/* PrivacyModeOn.c generated by valac 0.56.19, the Vala compiler
 * generated from PrivacyModeOn.vala, do not modify */

#include <granite.h>
#include <glib-object.h>
#include "pantheon-files-core.h"
#include <gtk/gtk.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <stdlib.h>
#include <string.h>
#include <gdk/gdk.h>
#include <gio/gio.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define FILES_VIEW_TYPE_WELCOME (files_view_welcome_get_type ())
#define FILES_VIEW_WELCOME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FILES_VIEW_TYPE_WELCOME, FilesViewWelcome))
#define FILES_VIEW_WELCOME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FILES_VIEW_TYPE_WELCOME, FilesViewWelcomeClass))
#define FILES_VIEW_IS_WELCOME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FILES_VIEW_TYPE_WELCOME))
#define FILES_VIEW_IS_WELCOME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FILES_VIEW_TYPE_WELCOME))
#define FILES_VIEW_WELCOME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FILES_VIEW_TYPE_WELCOME, FilesViewWelcomeClass))

typedef struct _FilesViewWelcome FilesViewWelcome;
typedef struct _FilesViewWelcomeClass FilesViewWelcomeClass;
typedef struct _FilesViewWelcomePrivate FilesViewWelcomePrivate;

#define FILES_VIEW_TYPE_PRIVACY_MODE_ON (files_view_privacy_mode_on_get_type ())
#define FILES_VIEW_PRIVACY_MODE_ON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FILES_VIEW_TYPE_PRIVACY_MODE_ON, FilesViewPrivacyModeOn))
#define FILES_VIEW_PRIVACY_MODE_ON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FILES_VIEW_TYPE_PRIVACY_MODE_ON, FilesViewPrivacyModeOnClass))
#define FILES_VIEW_IS_PRIVACY_MODE_ON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FILES_VIEW_TYPE_PRIVACY_MODE_ON))
#define FILES_VIEW_IS_PRIVACY_MODE_ON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FILES_VIEW_TYPE_PRIVACY_MODE_ON))
#define FILES_VIEW_PRIVACY_MODE_ON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FILES_VIEW_TYPE_PRIVACY_MODE_ON, FilesViewPrivacyModeOnClass))

typedef struct _FilesViewPrivacyModeOn FilesViewPrivacyModeOn;
typedef struct _FilesViewPrivacyModeOnClass FilesViewPrivacyModeOnClass;
typedef struct _FilesViewPrivacyModeOnPrivate FilesViewPrivacyModeOnPrivate;

#define FILES_VIEW_TYPE_VIEW_CONTAINER (files_view_view_container_get_type ())
#define FILES_VIEW_VIEW_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FILES_VIEW_TYPE_VIEW_CONTAINER, FilesViewViewContainer))
#define FILES_VIEW_VIEW_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FILES_VIEW_TYPE_VIEW_CONTAINER, FilesViewViewContainerClass))
#define FILES_VIEW_IS_VIEW_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FILES_VIEW_TYPE_VIEW_CONTAINER))
#define FILES_VIEW_IS_VIEW_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FILES_VIEW_TYPE_VIEW_CONTAINER))
#define FILES_VIEW_VIEW_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FILES_VIEW_TYPE_VIEW_CONTAINER, FilesViewViewContainerClass))

typedef struct _FilesViewViewContainer FilesViewViewContainer;
typedef struct _FilesViewViewContainerClass FilesViewViewContainerClass;
enum  {
	FILES_VIEW_PRIVACY_MODE_ON_0_PROPERTY,
	FILES_VIEW_PRIVACY_MODE_ON_REMEMBER_HISTORY_PROPERTY,
	FILES_VIEW_PRIVACY_MODE_ON_NUM_PROPERTIES
};
static GParamSpec* files_view_privacy_mode_on_properties[FILES_VIEW_PRIVACY_MODE_ON_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _FilesViewWelcome {
	GraniteWidgetsWelcome parent_instance;
	FilesViewWelcomePrivate * priv;
};

struct _FilesViewWelcomeClass {
	GraniteWidgetsWelcomeClass parent_class;
};

struct _FilesViewPrivacyModeOn {
	FilesViewWelcome parent_instance;
	FilesViewPrivacyModeOnPrivate * priv;
	FilesDirectory* dir_saved;
	FilesViewViewContainer* ctab;
};

struct _FilesViewPrivacyModeOnClass {
	FilesViewWelcomeClass parent_class;
};

struct _FilesViewPrivacyModeOnPrivate {
	gboolean _remember_history;
};

static gint FilesViewPrivacyModeOn_private_offset;
static gpointer files_view_privacy_mode_on_parent_class = NULL;

VALA_EXTERN GType files_view_welcome_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FilesViewWelcome, g_object_unref)
VALA_EXTERN GType files_view_privacy_mode_on_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FilesViewPrivacyModeOn, g_object_unref)
VALA_EXTERN GType files_view_view_container_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FilesViewViewContainer, g_object_unref)
VALA_EXTERN FilesViewPrivacyModeOn* files_view_privacy_mode_on_new (FilesViewViewContainer* tab);
VALA_EXTERN FilesViewPrivacyModeOn* files_view_privacy_mode_on_construct (GType object_type,
                                                              FilesViewViewContainer* tab);
VALA_EXTERN FilesViewWelcome* files_view_welcome_new (const gchar* primary,
                                          const gchar* secondary);
VALA_EXTERN FilesViewWelcome* files_view_welcome_construct (GType object_type,
                                                const gchar* primary,
                                                const gchar* secondary);
static void __lambda71_ (FilesViewPrivacyModeOn* self,
                  gint index);
static void ___lambda71__granite_widgets_welcome_activated (GraniteWidgetsWelcome* _sender,
                                                     gint index,
                                                     gpointer self);
VALA_EXTERN gboolean files_view_privacy_mode_on_get_remember_history (FilesViewPrivacyModeOn* self);
VALA_EXTERN void files_view_privacy_mode_on_set_remember_history (FilesViewPrivacyModeOn* self,
                                                      gboolean value);
static void files_view_privacy_mode_on_finalize (GObject * obj);
static GType files_view_privacy_mode_on_get_type_once (void);
static void _vala_files_view_privacy_mode_on_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec);
static void _vala_files_view_privacy_mode_on_set_property (GObject * object,
                                                    guint property_id,
                                                    const GValue * value,
                                                    GParamSpec * pspec);

static inline gpointer
files_view_privacy_mode_on_get_instance_private (FilesViewPrivacyModeOn* self)
{
	return G_STRUCT_MEMBER_P (self, FilesViewPrivacyModeOn_private_offset);
}

static void
__lambda71_ (FilesViewPrivacyModeOn* self,
             gint index)
{
	GError* _inner_error0_ = NULL;
	switch (index) {
		case 0:
		{
			GdkAppLaunchContext* ctx = NULL;
			GdkWindow* _tmp0_;
			GdkDisplay* _tmp1_;
			GdkAppLaunchContext* _tmp2_;
			_tmp0_ = gtk_widget_get_window ((GtkWidget*) self);
			_tmp1_ = gdk_window_get_display (_tmp0_);
			_tmp2_ = gdk_display_get_app_launch_context (_tmp1_);
			ctx = _tmp2_;
			{
				GdkAppLaunchContext* _tmp3_;
				_tmp3_ = ctx;
				g_app_info_launch_default_for_uri ("settings://security", (GAppLaunchContext*) _tmp3_, &_inner_error0_);
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					goto __catch0_g_error;
				}
			}
			goto __finally0;
			__catch0_g_error:
			{
				g_clear_error (&_inner_error0_);
				g_critical ("PrivacyModeOn.vala:40: No default security app found");
			}
			__finally0:
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_object_unref0 (ctx);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return;
			}
			_g_object_unref0 (ctx);
			break;
		}
		default:
		break;
	}
}

static void
___lambda71__granite_widgets_welcome_activated (GraniteWidgetsWelcome* _sender,
                                                gint index,
                                                gpointer self)
{
	__lambda71_ ((FilesViewPrivacyModeOn*) self, index);
}

FilesViewPrivacyModeOn*
files_view_privacy_mode_on_construct (GType object_type,
                                      FilesViewViewContainer* tab)
{
	FilesViewPrivacyModeOn * self = NULL;
	g_return_val_if_fail (tab != NULL, NULL);
	self = (FilesViewPrivacyModeOn*) files_view_welcome_construct (object_type, _ ("Privacy mode is on"), _ ("No recent files are remembered"));
	granite_widgets_welcome_append ((GraniteWidgetsWelcome*) self, "preferences-system-privacy", _ ("Change security settings"), _ ("Open the system security and privacy settings app"));
	g_signal_connect_object ((GraniteWidgetsWelcome*) self, "activated", (GCallback) ___lambda71__granite_widgets_welcome_activated, self, 0);
	gtk_widget_show_all ((GtkWidget*) self);
	return self;
}

FilesViewPrivacyModeOn*
files_view_privacy_mode_on_new (FilesViewViewContainer* tab)
{
	return files_view_privacy_mode_on_construct (FILES_VIEW_TYPE_PRIVACY_MODE_ON, tab);
}

gboolean
files_view_privacy_mode_on_get_remember_history (FilesViewPrivacyModeOn* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_remember_history;
	return result;
}

void
files_view_privacy_mode_on_set_remember_history (FilesViewPrivacyModeOn* self,
                                                 gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = files_view_privacy_mode_on_get_remember_history (self);
	if (old_value != value) {
		self->priv->_remember_history = value;
		g_object_notify_by_pspec ((GObject *) self, files_view_privacy_mode_on_properties[FILES_VIEW_PRIVACY_MODE_ON_REMEMBER_HISTORY_PROPERTY]);
	}
}

static void
files_view_privacy_mode_on_class_init (FilesViewPrivacyModeOnClass * klass,
                                       gpointer klass_data)
{
	files_view_privacy_mode_on_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FilesViewPrivacyModeOn_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_files_view_privacy_mode_on_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_files_view_privacy_mode_on_set_property;
	G_OBJECT_CLASS (klass)->finalize = files_view_privacy_mode_on_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FILES_VIEW_PRIVACY_MODE_ON_REMEMBER_HISTORY_PROPERTY, files_view_privacy_mode_on_properties[FILES_VIEW_PRIVACY_MODE_ON_REMEMBER_HISTORY_PROPERTY] = g_param_spec_boolean ("remember-history", "remember-history", "remember-history", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
files_view_privacy_mode_on_instance_init (FilesViewPrivacyModeOn * self,
                                          gpointer klass)
{
	self->priv = files_view_privacy_mode_on_get_instance_private (self);
}

static void
files_view_privacy_mode_on_finalize (GObject * obj)
{
	FilesViewPrivacyModeOn * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FILES_VIEW_TYPE_PRIVACY_MODE_ON, FilesViewPrivacyModeOn);
	_g_object_unref0 (self->dir_saved);
	_g_object_unref0 (self->ctab);
	G_OBJECT_CLASS (files_view_privacy_mode_on_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
files_view_privacy_mode_on_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FilesViewPrivacyModeOnClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) files_view_privacy_mode_on_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FilesViewPrivacyModeOn), 0, (GInstanceInitFunc) files_view_privacy_mode_on_instance_init, NULL };
	GType files_view_privacy_mode_on_type_id;
	files_view_privacy_mode_on_type_id = g_type_register_static (FILES_VIEW_TYPE_WELCOME, "FilesViewPrivacyModeOn", &g_define_type_info, 0);
	FilesViewPrivacyModeOn_private_offset = g_type_add_instance_private (files_view_privacy_mode_on_type_id, sizeof (FilesViewPrivacyModeOnPrivate));
	return files_view_privacy_mode_on_type_id;
}

GType
files_view_privacy_mode_on_get_type (void)
{
	static volatile gsize files_view_privacy_mode_on_type_id__once = 0;
	if (g_once_init_enter (&files_view_privacy_mode_on_type_id__once)) {
		GType files_view_privacy_mode_on_type_id;
		files_view_privacy_mode_on_type_id = files_view_privacy_mode_on_get_type_once ();
		g_once_init_leave (&files_view_privacy_mode_on_type_id__once, files_view_privacy_mode_on_type_id);
	}
	return files_view_privacy_mode_on_type_id__once;
}

static void
_vala_files_view_privacy_mode_on_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec)
{
	FilesViewPrivacyModeOn * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FILES_VIEW_TYPE_PRIVACY_MODE_ON, FilesViewPrivacyModeOn);
	switch (property_id) {
		case FILES_VIEW_PRIVACY_MODE_ON_REMEMBER_HISTORY_PROPERTY:
		g_value_set_boolean (value, files_view_privacy_mode_on_get_remember_history (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_files_view_privacy_mode_on_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec)
{
	FilesViewPrivacyModeOn * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FILES_VIEW_TYPE_PRIVACY_MODE_ON, FilesViewPrivacyModeOn);
	switch (property_id) {
		case FILES_VIEW_PRIVACY_MODE_ON_REMEMBER_HISTORY_PROPERTY:
		files_view_privacy_mode_on_set_remember_history (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

