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

/*///////////////////////////////////////////////////////////////////////*/
/* Copyright 2011-2021 Simon Schneegans*/
/**/
/* Permission is hereby granted, free of charge, to any person obtaining*/
/* a copy of this software and associated documentation files (the*/
/* "Software"), to deal in the Software without restriction, including*/
/* without limitation the rights to use, copy, modify, merge, publish,*/
/* distribute, sublicense, and/or sell copies of the Software, and to*/
/* permit persons to whom the Software is furnished to do so, subject to*/
/* the following conditions:*/
/* */
/* The above copyright notice and this permission notice shall be*/
/* included in all copies or substantial portions of the Software.*/
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,*/
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF*/
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY*/
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,*/
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE*/
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/
/*///////////////////////////////////////////////////////////////////////*/

#include <glib-object.h>
#include <libxml/xmlwriter.h>
#include <libxml/tree.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <stdlib.h>
#include <string.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 GNOME_PIE_TYPE_ACTION_GROUP (gnome_pie_action_group_get_type ())
#define GNOME_PIE_ACTION_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_ACTION_GROUP, GnomePieActionGroup))
#define GNOME_PIE_ACTION_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_ACTION_GROUP, GnomePieActionGroupClass))
#define GNOME_PIE_IS_ACTION_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_ACTION_GROUP))
#define GNOME_PIE_IS_ACTION_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_ACTION_GROUP))
#define GNOME_PIE_ACTION_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_ACTION_GROUP, GnomePieActionGroupClass))

typedef struct _GnomePieActionGroup GnomePieActionGroup;
typedef struct _GnomePieActionGroupClass GnomePieActionGroupClass;
typedef struct _GnomePieActionGroupPrivate GnomePieActionGroupPrivate;

#define GNOME_PIE_TYPE_SESSION_GROUP (gnome_pie_session_group_get_type ())
#define GNOME_PIE_SESSION_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_SESSION_GROUP, GnomePieSessionGroup))
#define GNOME_PIE_SESSION_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_SESSION_GROUP, GnomePieSessionGroupClass))
#define GNOME_PIE_IS_SESSION_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_SESSION_GROUP))
#define GNOME_PIE_IS_SESSION_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_SESSION_GROUP))
#define GNOME_PIE_SESSION_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_SESSION_GROUP, GnomePieSessionGroupClass))

typedef struct _GnomePieSessionGroup GnomePieSessionGroup;
typedef struct _GnomePieSessionGroupClass GnomePieSessionGroupClass;
typedef struct _GnomePieSessionGroupPrivate GnomePieSessionGroupPrivate;
enum  {
	GNOME_PIE_SESSION_GROUP_0_PROPERTY,
	GNOME_PIE_SESSION_GROUP_NUM_PROPERTIES
};
static GParamSpec* gnome_pie_session_group_properties[GNOME_PIE_SESSION_GROUP_NUM_PROPERTIES];

#define GNOME_PIE_GROUP_REGISTRY_TYPE_TYPEDESCRIPTION (gnome_pie_group_registry_typedescription_get_type ())
#define GNOME_PIE_GROUP_REGISTRY_TYPEDESCRIPTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_GROUP_REGISTRY_TYPE_TYPEDESCRIPTION, GnomePieGroupRegistryTypeDescription))
#define GNOME_PIE_GROUP_REGISTRY_TYPEDESCRIPTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_GROUP_REGISTRY_TYPE_TYPEDESCRIPTION, GnomePieGroupRegistryTypeDescriptionClass))
#define GNOME_PIE_GROUP_REGISTRY_IS_TYPEDESCRIPTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_GROUP_REGISTRY_TYPE_TYPEDESCRIPTION))
#define GNOME_PIE_GROUP_REGISTRY_IS_TYPEDESCRIPTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_GROUP_REGISTRY_TYPE_TYPEDESCRIPTION))
#define GNOME_PIE_GROUP_REGISTRY_TYPEDESCRIPTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_GROUP_REGISTRY_TYPE_TYPEDESCRIPTION, GnomePieGroupRegistryTypeDescriptionClass))

typedef struct _GnomePieGroupRegistryTypeDescription GnomePieGroupRegistryTypeDescription;
typedef struct _GnomePieGroupRegistryTypeDescriptionClass GnomePieGroupRegistryTypeDescriptionClass;

#define GNOME_PIE_TYPE_ACTION (gnome_pie_action_get_type ())
#define GNOME_PIE_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_ACTION, GnomePieAction))
#define GNOME_PIE_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_ACTION, GnomePieActionClass))
#define GNOME_PIE_IS_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_ACTION))
#define GNOME_PIE_IS_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_ACTION))
#define GNOME_PIE_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_ACTION, GnomePieActionClass))

typedef struct _GnomePieAction GnomePieAction;
typedef struct _GnomePieActionClass GnomePieActionClass;

#define GNOME_PIE_TYPE_APP_ACTION (gnome_pie_app_action_get_type ())
#define GNOME_PIE_APP_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_APP_ACTION, GnomePieAppAction))
#define GNOME_PIE_APP_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_APP_ACTION, GnomePieAppActionClass))
#define GNOME_PIE_IS_APP_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_APP_ACTION))
#define GNOME_PIE_IS_APP_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_APP_ACTION))
#define GNOME_PIE_APP_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_APP_ACTION, GnomePieAppActionClass))

typedef struct _GnomePieAppAction GnomePieAppAction;
typedef struct _GnomePieAppActionClass GnomePieAppActionClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _GnomePieActionGroup {
	GObject parent_instance;
	GnomePieActionGroupPrivate * priv;
};

struct _GnomePieActionGroupClass {
	GObjectClass parent_class;
	void (*on_remove) (GnomePieActionGroup* self);
	void (*on_save) (GnomePieActionGroup* self, xmlTextWriter* writer);
	void (*on_load) (GnomePieActionGroup* self, xmlNode* data);
};

struct _GnomePieSessionGroup {
	GnomePieActionGroup parent_instance;
	GnomePieSessionGroupPrivate * priv;
};

struct _GnomePieSessionGroupClass {
	GnomePieActionGroupClass parent_class;
};

static gpointer gnome_pie_session_group_parent_class = NULL;

VALA_EXTERN GType gnome_pie_action_group_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieActionGroup, g_object_unref)
VALA_EXTERN GType gnome_pie_session_group_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieSessionGroup, g_object_unref)
VALA_EXTERN gpointer gnome_pie_group_registry_typedescription_ref (gpointer instance);
VALA_EXTERN void gnome_pie_group_registry_typedescription_unref (gpointer instance);
VALA_EXTERN GParamSpec* gnome_pie_group_registry_param_spec_typedescription (const gchar* name,
                                                                 const gchar* nick,
                                                                 const gchar* blurb,
                                                                 GType object_type,
                                                                 GParamFlags flags);
VALA_EXTERN void gnome_pie_group_registry_value_set_typedescription (GValue* value,
                                                         gpointer v_object);
VALA_EXTERN void gnome_pie_group_registry_value_take_typedescription (GValue* value,
                                                          gpointer v_object);
VALA_EXTERN gpointer gnome_pie_group_registry_value_get_typedescription (const GValue* value);
VALA_EXTERN GType gnome_pie_group_registry_typedescription_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieGroupRegistryTypeDescription, gnome_pie_group_registry_typedescription_unref)
VALA_EXTERN GnomePieGroupRegistryTypeDescription* gnome_pie_session_group_register (void);
VALA_EXTERN GnomePieGroupRegistryTypeDescription* gnome_pie_group_registry_typedescription_new (void);
VALA_EXTERN GnomePieGroupRegistryTypeDescription* gnome_pie_group_registry_typedescription_construct (GType object_type);
VALA_EXTERN void gnome_pie_group_registry_typedescription_set_name (GnomePieGroupRegistryTypeDescription* self,
                                                        const gchar* value);
VALA_EXTERN void gnome_pie_group_registry_typedescription_set_icon (GnomePieGroupRegistryTypeDescription* self,
                                                        const gchar* value);
VALA_EXTERN void gnome_pie_group_registry_typedescription_set_description (GnomePieGroupRegistryTypeDescription* self,
                                                               const gchar* value);
VALA_EXTERN void gnome_pie_group_registry_typedescription_set_id (GnomePieGroupRegistryTypeDescription* self,
                                                      const gchar* value);
VALA_EXTERN GnomePieSessionGroup* gnome_pie_session_group_new (const gchar* parent_id);
VALA_EXTERN GnomePieSessionGroup* gnome_pie_session_group_construct (GType object_type,
                                                         const gchar* parent_id);
static GObject * gnome_pie_session_group_constructor (GType type,
                                               guint n_construct_properties,
                                               GObjectConstructParam * construct_properties);
VALA_EXTERN GType gnome_pie_action_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieAction, g_object_unref)
VALA_EXTERN void gnome_pie_action_group_add_action (GnomePieActionGroup* self,
                                        GnomePieAction* new_action);
VALA_EXTERN GnomePieAppAction* gnome_pie_app_action_new (const gchar* name,
                                             const gchar* icon,
                                             const gchar* command,
                                             gboolean is_quickaction);
VALA_EXTERN GnomePieAppAction* gnome_pie_app_action_construct (GType object_type,
                                                   const gchar* name,
                                                   const gchar* icon,
                                                   const gchar* command,
                                                   gboolean is_quickaction);
VALA_EXTERN GType gnome_pie_app_action_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieAppAction, g_object_unref)
static GType gnome_pie_session_group_get_type_once (void);

GnomePieGroupRegistryTypeDescription*
gnome_pie_session_group_register (void)
{
	GnomePieGroupRegistryTypeDescription* description = NULL;
	GnomePieGroupRegistryTypeDescription* _tmp0_;
	GnomePieGroupRegistryTypeDescription* result;
	_tmp0_ = gnome_pie_group_registry_typedescription_new ();
	description = _tmp0_;
	gnome_pie_group_registry_typedescription_set_name (description, _ ("Group: Session Control"));
	gnome_pie_group_registry_typedescription_set_icon (description, "system-log-out");
	gnome_pie_group_registry_typedescription_set_description (description, _ ("Shows a Slice for Shutdown, Reboot, and Hibernate."));
	gnome_pie_group_registry_typedescription_set_id (description, "session");
	result = description;
	return result;
}

GnomePieSessionGroup*
gnome_pie_session_group_construct (GType object_type,
                                   const gchar* parent_id)
{
	GnomePieSessionGroup * self = NULL;
	g_return_val_if_fail (parent_id != NULL, NULL);
	self = (GnomePieSessionGroup*) g_object_new (object_type, "parent-id", parent_id, NULL);
	return self;
}

GnomePieSessionGroup*
gnome_pie_session_group_new (const gchar* parent_id)
{
	return gnome_pie_session_group_construct (GNOME_PIE_TYPE_SESSION_GROUP, parent_id);
}

static GObject *
gnome_pie_session_group_constructor (GType type,
                                     guint n_construct_properties,
                                     GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GnomePieSessionGroup * self;
	GnomePieAppAction* _tmp0_;
	GnomePieAppAction* _tmp1_;
	GnomePieAppAction* _tmp2_;
	GnomePieAppAction* _tmp3_;
	GnomePieAppAction* _tmp4_;
	GnomePieAppAction* _tmp5_;
	parent_class = G_OBJECT_CLASS (gnome_pie_session_group_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GNOME_PIE_TYPE_SESSION_GROUP, GnomePieSessionGroup);
	_tmp0_ = gnome_pie_app_action_new (_ ("Shutdown"), "system-shutdown", "dbus-send --print-reply --dest=org.gnome.SessionManager /org/gnome/Ses" \
"sionManager org.gnome.SessionManager.Shutdown", FALSE);
	_tmp1_ = _tmp0_;
	gnome_pie_action_group_add_action ((GnomePieActionGroup*) self, (GnomePieAction*) _tmp1_);
	_g_object_unref0 (_tmp1_);
	_tmp2_ = gnome_pie_app_action_new (_ ("Logout"), "system-log-out", "dbus-send --print-reply --dest=org.gnome.SessionManager /org/gnome/Ses" \
"sionManager org.gnome.SessionManager.Logout uint32:1", FALSE);
	_tmp3_ = _tmp2_;
	gnome_pie_action_group_add_action ((GnomePieActionGroup*) self, (GnomePieAction*) _tmp3_);
	_g_object_unref0 (_tmp3_);
	_tmp4_ = gnome_pie_app_action_new (_ ("Reboot"), "view-refresh", "dbus-send --print-reply --dest=org.gnome.SessionManager /org/gnome/Ses" \
"sionManager org.gnome.SessionManager.Reboot", FALSE);
	_tmp5_ = _tmp4_;
	gnome_pie_action_group_add_action ((GnomePieActionGroup*) self, (GnomePieAction*) _tmp5_);
	_g_object_unref0 (_tmp5_);
	return obj;
}

static void
gnome_pie_session_group_class_init (GnomePieSessionGroupClass * klass,
                                    gpointer klass_data)
{
	gnome_pie_session_group_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->constructor = gnome_pie_session_group_constructor;
}

static void
gnome_pie_session_group_instance_init (GnomePieSessionGroup * self,
                                       gpointer klass)
{
}

static GType
gnome_pie_session_group_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GnomePieSessionGroupClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gnome_pie_session_group_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GnomePieSessionGroup), 0, (GInstanceInitFunc) gnome_pie_session_group_instance_init, NULL };
	GType gnome_pie_session_group_type_id;
	gnome_pie_session_group_type_id = g_type_register_static (GNOME_PIE_TYPE_ACTION_GROUP, "GnomePieSessionGroup", &g_define_type_info, 0);
	return gnome_pie_session_group_type_id;
}

GType
gnome_pie_session_group_get_type (void)
{
	static volatile gsize gnome_pie_session_group_type_id__once = 0;
	if (g_once_init_enter (&gnome_pie_session_group_type_id__once)) {
		GType gnome_pie_session_group_type_id;
		gnome_pie_session_group_type_id = gnome_pie_session_group_get_type_once ();
		g_once_init_leave (&gnome_pie_session_group_type_id__once, gnome_pie_session_group_type_id);
	}
	return gnome_pie_session_group_type_id__once;
}

