/* pie.c generated by valac 0.56.19, the Vala compiler
 * generated from pie.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 <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gee.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_PIE (gnome_pie_pie_get_type ())
#define GNOME_PIE_PIE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_PIE, GnomePiePie))
#define GNOME_PIE_PIE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_PIE, GnomePiePieClass))
#define GNOME_PIE_IS_PIE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_PIE))
#define GNOME_PIE_IS_PIE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_PIE))
#define GNOME_PIE_PIE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_PIE, GnomePiePieClass))

typedef struct _GnomePiePie GnomePiePie;
typedef struct _GnomePiePieClass GnomePiePieClass;
typedef struct _GnomePiePiePrivate GnomePiePiePrivate;

#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;
enum  {
	GNOME_PIE_PIE_0_PROPERTY,
	GNOME_PIE_PIE_NAME_PROPERTY,
	GNOME_PIE_PIE_ICON_PROPERTY,
	GNOME_PIE_PIE_ID_PROPERTY,
	GNOME_PIE_PIE_ACTION_GROUPS_PROPERTY,
	GNOME_PIE_PIE_NUM_PROPERTIES
};
static GParamSpec* gnome_pie_pie_properties[GNOME_PIE_PIE_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#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;

struct _GnomePiePie {
	GObject parent_instance;
	GnomePiePiePrivate * priv;
};

struct _GnomePiePieClass {
	GObjectClass parent_class;
	void (*on_remove) (GnomePiePie* self);
};

struct _GnomePiePiePrivate {
	gchar* _name;
	gchar* _icon;
	gchar* _id;
	GeeArrayList* _action_groups;
};

static gint GnomePiePie_private_offset;
static gpointer gnome_pie_pie_parent_class = NULL;

VALA_EXTERN GType gnome_pie_pie_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePiePie, g_object_unref)
VALA_EXTERN GType gnome_pie_action_group_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieActionGroup, g_object_unref)
VALA_EXTERN void gnome_pie_pie_on_remove (GnomePiePie* self);
VALA_EXTERN GnomePiePie* gnome_pie_pie_new (const gchar* id,
                                const gchar* name,
                                const gchar* icon);
VALA_EXTERN GnomePiePie* gnome_pie_pie_construct (GType object_type,
                                      const gchar* id,
                                      const gchar* name,
                                      const gchar* icon);
static void gnome_pie_pie_set_action_groups (GnomePiePie* self,
                                      GeeArrayList* value);
static void gnome_pie_pie_real_on_remove (GnomePiePie* self);
VALA_EXTERN GeeArrayList* gnome_pie_pie_get_action_groups (GnomePiePie* self);
VALA_EXTERN void gnome_pie_action_group_on_remove (GnomePieActionGroup* self);
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_pie_add_action (GnomePiePie* self,
                               GnomePieAction* action,
                               gint at_position);
VALA_EXTERN const gchar* gnome_pie_pie_get_id (GnomePiePie* self);
VALA_EXTERN GnomePieActionGroup* gnome_pie_action_group_new (const gchar* parent_id);
VALA_EXTERN GnomePieActionGroup* gnome_pie_action_group_construct (GType object_type,
                                                       const gchar* parent_id);
VALA_EXTERN void gnome_pie_action_group_add_action (GnomePieActionGroup* self,
                                        GnomePieAction* new_action);
VALA_EXTERN void gnome_pie_pie_add_group (GnomePiePie* self,
                              GnomePieActionGroup* group,
                              gint at_position);
VALA_EXTERN gboolean gnome_pie_action_group_has_quickaction (GnomePieActionGroup* self);
VALA_EXTERN void gnome_pie_action_group_disable_quickactions (GnomePieActionGroup* self);
VALA_EXTERN void gnome_pie_pie_remove_group (GnomePiePie* self,
                                 gint index);
VALA_EXTERN void gnome_pie_pie_move_group (GnomePiePie* self,
                               gint from,
                               gint to);
VALA_EXTERN void gnome_pie_pie_update_group (GnomePiePie* self,
                                 GnomePieActionGroup* group,
                                 gint index);
VALA_EXTERN const gchar* gnome_pie_pie_get_name (GnomePiePie* self);
VALA_EXTERN void gnome_pie_pie_set_name (GnomePiePie* self,
                             const gchar* value);
VALA_EXTERN const gchar* gnome_pie_pie_get_icon (GnomePiePie* self);
VALA_EXTERN void gnome_pie_pie_set_icon (GnomePiePie* self,
                             const gchar* value);
static void gnome_pie_pie_set_id (GnomePiePie* self,
                           const gchar* value);
static void gnome_pie_pie_finalize (GObject * obj);
static GType gnome_pie_pie_get_type_once (void);
static void _vala_gnome_pie_pie_get_property (GObject * object,
                                       guint property_id,
                                       GValue * value,
                                       GParamSpec * pspec);
static void _vala_gnome_pie_pie_set_property (GObject * object,
                                       guint property_id,
                                       const GValue * value,
                                       GParamSpec * pspec);

static inline gpointer
gnome_pie_pie_get_instance_private (GnomePiePie* self)
{
	return G_STRUCT_MEMBER_P (self, GnomePiePie_private_offset);
}

GnomePiePie*
gnome_pie_pie_construct (GType object_type,
                         const gchar* id,
                         const gchar* name,
                         const gchar* icon)
{
	GnomePiePie * self = NULL;
	GeeArrayList* _tmp0_;
	GeeArrayList* _tmp1_;
	g_return_val_if_fail (id != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	g_return_val_if_fail (icon != NULL, NULL);
	self = (GnomePiePie*) g_object_new (object_type, "id", id, "name", name, "icon", icon, NULL);
	_tmp0_ = gee_array_list_new (GNOME_PIE_TYPE_ACTION_GROUP, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	_tmp1_ = _tmp0_;
	gnome_pie_pie_set_action_groups (self, _tmp1_);
	_g_object_unref0 (_tmp1_);
	return self;
}

GnomePiePie*
gnome_pie_pie_new (const gchar* id,
                   const gchar* name,
                   const gchar* icon)
{
	return gnome_pie_pie_construct (GNOME_PIE_TYPE_PIE, id, name, icon);
}

static void
gnome_pie_pie_real_on_remove (GnomePiePie* self)
{
	{
		GeeArrayList* _action_group_list = NULL;
		GeeArrayList* _tmp0_;
		gint _action_group_size = 0;
		GeeArrayList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		gint _action_group_index = 0;
		_tmp0_ = self->priv->_action_groups;
		_action_group_list = _tmp0_;
		_tmp1_ = _action_group_list;
		_tmp2_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp1_);
		_tmp3_ = _tmp2_;
		_action_group_size = _tmp3_;
		_action_group_index = -1;
		while (TRUE) {
			gint _tmp4_;
			gint _tmp5_;
			GnomePieActionGroup* action_group = NULL;
			GeeArrayList* _tmp6_;
			gpointer _tmp7_;
			GnomePieActionGroup* _tmp8_;
			_action_group_index = _action_group_index + 1;
			_tmp4_ = _action_group_index;
			_tmp5_ = _action_group_size;
			if (!(_tmp4_ < _tmp5_)) {
				break;
			}
			_tmp6_ = _action_group_list;
			_tmp7_ = gee_abstract_list_get ((GeeAbstractList*) _tmp6_, _action_group_index);
			action_group = (GnomePieActionGroup*) _tmp7_;
			_tmp8_ = action_group;
			gnome_pie_action_group_on_remove (_tmp8_);
			_g_object_unref0 (action_group);
		}
	}
}

void
gnome_pie_pie_on_remove (GnomePiePie* self)
{
	GnomePiePieClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = GNOME_PIE_PIE_GET_CLASS (self);
	if (_klass_->on_remove) {
		_klass_->on_remove (self);
	}
}

void
gnome_pie_pie_add_action (GnomePiePie* self,
                          GnomePieAction* action,
                          gint at_position)
{
	GnomePieActionGroup* group = NULL;
	const gchar* _tmp0_;
	GnomePieActionGroup* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	_tmp0_ = self->priv->_id;
	_tmp1_ = gnome_pie_action_group_new (_tmp0_);
	group = _tmp1_;
	gnome_pie_action_group_add_action (group, action);
	gnome_pie_pie_add_group (self, group, at_position);
	_g_object_unref0 (group);
}

void
gnome_pie_pie_add_group (GnomePiePie* self,
                         GnomePieActionGroup* group,
                         gint at_position)
{
	gboolean _tmp9_ = FALSE;
	g_return_if_fail (self != NULL);
	g_return_if_fail (group != NULL);
	if (gnome_pie_action_group_has_quickaction (group)) {
		{
			GeeArrayList* _action_group_list = NULL;
			GeeArrayList* _tmp0_;
			gint _action_group_size = 0;
			GeeArrayList* _tmp1_;
			gint _tmp2_;
			gint _tmp3_;
			gint _action_group_index = 0;
			_tmp0_ = self->priv->_action_groups;
			_action_group_list = _tmp0_;
			_tmp1_ = _action_group_list;
			_tmp2_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp1_);
			_tmp3_ = _tmp2_;
			_action_group_size = _tmp3_;
			_action_group_index = -1;
			while (TRUE) {
				gint _tmp4_;
				gint _tmp5_;
				GnomePieActionGroup* action_group = NULL;
				GeeArrayList* _tmp6_;
				gpointer _tmp7_;
				GnomePieActionGroup* _tmp8_;
				_action_group_index = _action_group_index + 1;
				_tmp4_ = _action_group_index;
				_tmp5_ = _action_group_size;
				if (!(_tmp4_ < _tmp5_)) {
					break;
				}
				_tmp6_ = _action_group_list;
				_tmp7_ = gee_abstract_list_get ((GeeAbstractList*) _tmp6_, _action_group_index);
				action_group = (GnomePieActionGroup*) _tmp7_;
				_tmp8_ = action_group;
				gnome_pie_action_group_disable_quickactions (_tmp8_);
				_g_object_unref0 (action_group);
			}
		}
	}
	if (at_position < 0) {
		_tmp9_ = TRUE;
	} else {
		GeeArrayList* _tmp10_;
		gint _tmp11_;
		gint _tmp12_;
		_tmp10_ = self->priv->_action_groups;
		_tmp11_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp10_);
		_tmp12_ = _tmp11_;
		_tmp9_ = at_position >= _tmp12_;
	}
	if (_tmp9_) {
		GeeArrayList* _tmp13_;
		_tmp13_ = self->priv->_action_groups;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp13_, group);
	} else {
		GeeArrayList* _tmp14_;
		_tmp14_ = self->priv->_action_groups;
		gee_abstract_list_insert ((GeeAbstractList*) _tmp14_, at_position, group);
	}
}

void
gnome_pie_pie_remove_group (GnomePiePie* self,
                            gint index)
{
	GeeArrayList* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_action_groups;
	_tmp1_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ > index) {
		GeeArrayList* _tmp3_;
		gpointer _tmp4_;
		GnomePieActionGroup* _tmp5_;
		_tmp3_ = self->priv->_action_groups;
		_tmp4_ = gee_abstract_list_remove_at ((GeeAbstractList*) _tmp3_, index);
		_tmp5_ = (GnomePieActionGroup*) _tmp4_;
		_g_object_unref0 (_tmp5_);
	}
}

void
gnome_pie_pie_move_group (GnomePiePie* self,
                          gint from,
                          gint to)
{
	gboolean _tmp0_ = FALSE;
	GeeArrayList* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->_action_groups;
	_tmp2_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_ > from) {
		GeeArrayList* _tmp4_;
		gint _tmp5_;
		gint _tmp6_;
		_tmp4_ = self->priv->_action_groups;
		_tmp5_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp4_);
		_tmp6_ = _tmp5_;
		_tmp0_ = _tmp6_ > to;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GnomePieActionGroup* tmp = NULL;
		GeeArrayList* _tmp7_;
		gpointer _tmp8_;
		GnomePieActionGroup* _tmp9_;
		_tmp7_ = self->priv->_action_groups;
		_tmp8_ = gee_abstract_list_get ((GeeAbstractList*) _tmp7_, from);
		tmp = (GnomePieActionGroup*) _tmp8_;
		gnome_pie_pie_remove_group (self, from);
		_tmp9_ = tmp;
		gnome_pie_pie_add_group (self, _tmp9_, to);
		_g_object_unref0 (tmp);
	}
}

void
gnome_pie_pie_update_group (GnomePiePie* self,
                            GnomePieActionGroup* group,
                            gint index)
{
	GeeArrayList* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (group != NULL);
	_tmp0_ = self->priv->_action_groups;
	_tmp1_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ > index) {
		GeeArrayList* _tmp3_;
		_tmp3_ = self->priv->_action_groups;
		gee_abstract_list_set ((GeeAbstractList*) _tmp3_, index, group);
	}
}

const gchar*
gnome_pie_pie_get_name (GnomePiePie* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_name;
	result = _tmp0_;
	return result;
}

void
gnome_pie_pie_set_name (GnomePiePie* self,
                        const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_pie_get_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_name);
		self->priv->_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_pie_properties[GNOME_PIE_PIE_NAME_PROPERTY]);
	}
}

const gchar*
gnome_pie_pie_get_icon (GnomePiePie* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_icon;
	result = _tmp0_;
	return result;
}

void
gnome_pie_pie_set_icon (GnomePiePie* self,
                        const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_pie_get_icon (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_icon);
		self->priv->_icon = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_pie_properties[GNOME_PIE_PIE_ICON_PROPERTY]);
	}
}

const gchar*
gnome_pie_pie_get_id (GnomePiePie* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_id;
	result = _tmp0_;
	return result;
}

static void
gnome_pie_pie_set_id (GnomePiePie* self,
                      const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_pie_get_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_id);
		self->priv->_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_pie_properties[GNOME_PIE_PIE_ID_PROPERTY]);
	}
}

GeeArrayList*
gnome_pie_pie_get_action_groups (GnomePiePie* self)
{
	GeeArrayList* result;
	GeeArrayList* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_action_groups;
	result = _tmp0_;
	return result;
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static void
gnome_pie_pie_set_action_groups (GnomePiePie* self,
                                 GeeArrayList* value)
{
	GeeArrayList* old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_pie_get_action_groups (self);
	if (old_value != value) {
		GeeArrayList* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_action_groups);
		self->priv->_action_groups = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_pie_properties[GNOME_PIE_PIE_ACTION_GROUPS_PROPERTY]);
	}
}

static void
gnome_pie_pie_class_init (GnomePiePieClass * klass,
                          gpointer klass_data)
{
	gnome_pie_pie_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GnomePiePie_private_offset);
	((GnomePiePieClass *) klass)->on_remove = (void (*) (GnomePiePie*)) gnome_pie_pie_real_on_remove;
	G_OBJECT_CLASS (klass)->get_property = _vala_gnome_pie_pie_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gnome_pie_pie_set_property;
	G_OBJECT_CLASS (klass)->finalize = gnome_pie_pie_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_PIE_NAME_PROPERTY, gnome_pie_pie_properties[GNOME_PIE_PIE_NAME_PROPERTY] = g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_PIE_ICON_PROPERTY, gnome_pie_pie_properties[GNOME_PIE_PIE_ICON_PROPERTY] = g_param_spec_string ("icon", "icon", "icon", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_PIE_ID_PROPERTY, gnome_pie_pie_properties[GNOME_PIE_PIE_ID_PROPERTY] = g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_PIE_ACTION_GROUPS_PROPERTY, gnome_pie_pie_properties[GNOME_PIE_PIE_ACTION_GROUPS_PROPERTY] = g_param_spec_object ("action-groups", "action-groups", "action-groups", GEE_TYPE_ARRAY_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
gnome_pie_pie_instance_init (GnomePiePie * self,
                             gpointer klass)
{
	self->priv = gnome_pie_pie_get_instance_private (self);
}

static void
gnome_pie_pie_finalize (GObject * obj)
{
	GnomePiePie * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GNOME_PIE_TYPE_PIE, GnomePiePie);
	_g_free0 (self->priv->_name);
	_g_free0 (self->priv->_icon);
	_g_free0 (self->priv->_id);
	_g_object_unref0 (self->priv->_action_groups);
	G_OBJECT_CLASS (gnome_pie_pie_parent_class)->finalize (obj);
}

static GType
gnome_pie_pie_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GnomePiePieClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gnome_pie_pie_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GnomePiePie), 0, (GInstanceInitFunc) gnome_pie_pie_instance_init, NULL };
	GType gnome_pie_pie_type_id;
	gnome_pie_pie_type_id = g_type_register_static (G_TYPE_OBJECT, "GnomePiePie", &g_define_type_info, 0);
	GnomePiePie_private_offset = g_type_add_instance_private (gnome_pie_pie_type_id, sizeof (GnomePiePiePrivate));
	return gnome_pie_pie_type_id;
}

GType
gnome_pie_pie_get_type (void)
{
	static volatile gsize gnome_pie_pie_type_id__once = 0;
	if (g_once_init_enter (&gnome_pie_pie_type_id__once)) {
		GType gnome_pie_pie_type_id;
		gnome_pie_pie_type_id = gnome_pie_pie_get_type_once ();
		g_once_init_leave (&gnome_pie_pie_type_id__once, gnome_pie_pie_type_id);
	}
	return gnome_pie_pie_type_id__once;
}

static void
_vala_gnome_pie_pie_get_property (GObject * object,
                                  guint property_id,
                                  GValue * value,
                                  GParamSpec * pspec)
{
	GnomePiePie * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GNOME_PIE_TYPE_PIE, GnomePiePie);
	switch (property_id) {
		case GNOME_PIE_PIE_NAME_PROPERTY:
		g_value_set_string (value, gnome_pie_pie_get_name (self));
		break;
		case GNOME_PIE_PIE_ICON_PROPERTY:
		g_value_set_string (value, gnome_pie_pie_get_icon (self));
		break;
		case GNOME_PIE_PIE_ID_PROPERTY:
		g_value_set_string (value, gnome_pie_pie_get_id (self));
		break;
		case GNOME_PIE_PIE_ACTION_GROUPS_PROPERTY:
		g_value_set_object (value, gnome_pie_pie_get_action_groups (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gnome_pie_pie_set_property (GObject * object,
                                  guint property_id,
                                  const GValue * value,
                                  GParamSpec * pspec)
{
	GnomePiePie * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GNOME_PIE_TYPE_PIE, GnomePiePie);
	switch (property_id) {
		case GNOME_PIE_PIE_NAME_PROPERTY:
		gnome_pie_pie_set_name (self, g_value_get_string (value));
		break;
		case GNOME_PIE_PIE_ICON_PROPERTY:
		gnome_pie_pie_set_icon (self, g_value_get_string (value));
		break;
		case GNOME_PIE_PIE_ID_PROPERTY:
		gnome_pie_pie_set_id (self, g_value_get_string (value));
		break;
		case GNOME_PIE_PIE_ACTION_GROUPS_PROPERTY:
		gnome_pie_pie_set_action_groups (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

