/* display-config.c generated by valac 0.16.0.2-f2187, the Vala compiler
 * generated from display-config.vala, do not modify */

/* This file is part of GNOME Boxes. License: LGPLv2+*/

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>


#define BOXES_TYPE_ICONFIG (boxes_iconfig_get_type ())
#define BOXES_ICONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_ICONFIG, BoxesIConfig))
#define BOXES_IS_ICONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_ICONFIG))
#define BOXES_ICONFIG_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), BOXES_TYPE_ICONFIG, BoxesIConfigIface))

typedef struct _BoxesIConfig BoxesIConfig;
typedef struct _BoxesIConfigIface BoxesIConfigIface;

#define BOXES_TYPE_DISPLAY_CONFIG (boxes_display_config_get_type ())
#define BOXES_DISPLAY_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_DISPLAY_CONFIG, BoxesDisplayConfig))
#define BOXES_DISPLAY_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_DISPLAY_CONFIG, BoxesDisplayConfigClass))
#define BOXES_IS_DISPLAY_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_DISPLAY_CONFIG))
#define BOXES_IS_DISPLAY_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_DISPLAY_CONFIG))
#define BOXES_DISPLAY_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_DISPLAY_CONFIG, BoxesDisplayConfigClass))

typedef struct _BoxesDisplayConfig BoxesDisplayConfig;
typedef struct _BoxesDisplayConfigClass BoxesDisplayConfigClass;
typedef struct _BoxesDisplayConfigPrivate BoxesDisplayConfigPrivate;

#define BOXES_TYPE_COLLECTION_SOURCE (boxes_collection_source_get_type ())
#define BOXES_COLLECTION_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_COLLECTION_SOURCE, BoxesCollectionSource))
#define BOXES_COLLECTION_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_COLLECTION_SOURCE, BoxesCollectionSourceClass))
#define BOXES_IS_COLLECTION_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_COLLECTION_SOURCE))
#define BOXES_IS_COLLECTION_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_COLLECTION_SOURCE))
#define BOXES_COLLECTION_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_COLLECTION_SOURCE, BoxesCollectionSourceClass))

typedef struct _BoxesCollectionSource BoxesCollectionSource;
typedef struct _BoxesCollectionSourceClass BoxesCollectionSourceClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

struct _BoxesIConfigIface {
	GTypeInterface parent_iface;
	GKeyFile* (*get_keyfile) (BoxesIConfig* self);
	const gchar* (*get_filename) (BoxesIConfig* self);
	void (*set_filename) (BoxesIConfig* self, const gchar* value);
	gboolean (*get_has_file) (BoxesIConfig* self);
	void (*set_has_file) (BoxesIConfig* self, gboolean value);
};

struct _BoxesDisplayConfig {
	GObject parent_instance;
	BoxesDisplayConfigPrivate * priv;
};

struct _BoxesDisplayConfigClass {
	GObjectClass parent_class;
};

struct _BoxesDisplayConfigPrivate {
	BoxesCollectionSource* source;
	gchar* group;
};


static gpointer boxes_display_config_parent_class = NULL;
static BoxesIConfigIface* boxes_display_config_boxes_iconfig_parent_iface = NULL;

GType boxes_iconfig_get_type (void) G_GNUC_CONST;
GType boxes_display_config_get_type (void) G_GNUC_CONST;
GType boxes_collection_source_get_type (void) G_GNUC_CONST;
#define BOXES_DISPLAY_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BOXES_TYPE_DISPLAY_CONFIG, BoxesDisplayConfigPrivate))
enum  {
	BOXES_DISPLAY_CONFIG_DUMMY_PROPERTY,
	BOXES_DISPLAY_CONFIG_CATEGORIES
};
BoxesDisplayConfig* boxes_display_config_new (BoxesCollectionSource* source, const gchar* subgroup);
BoxesDisplayConfig* boxes_display_config_construct (GType object_type, BoxesCollectionSource* source, const gchar* subgroup);
void boxes_display_config_add_category (BoxesDisplayConfig* self, const gchar* category);
gchar** boxes_display_config_get_categories (BoxesDisplayConfig* self, int* result_length1);
static gboolean _vala_string_array_contains (gchar** stack, int stack_length, gchar* needle);
static void _vala_array_add1 (gchar*** array, int* length, int* size, gchar* value);
void boxes_display_config_set_categories (BoxesDisplayConfig* self, gchar** value, int value_length1);
void boxes_iconfig_save (BoxesIConfig* self);
void boxes_display_config_save_display_property (BoxesDisplayConfig* self, GObject* display, const gchar* property_name);
GKeyFile* boxes_iconfig_get_keyfile (BoxesIConfig* self);
void boxes_display_config_load_display_property (BoxesDisplayConfig* self, GObject* display, const gchar* property_name, GValue* default_value);
gboolean boxes_iconfig_get_has_file (BoxesIConfig* self);
void boxes_iconfig_set_has_file (BoxesIConfig* self, gboolean value);
const gchar* boxes_iconfig_get_filename (BoxesIConfig* self);
gchar** boxes_iconfig_get_string_list (BoxesIConfig* self, const gchar* group, const gchar* key, int* result_length1);
static void boxes_display_config_finalize (GObject* obj);
static void _vala_boxes_display_config_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_boxes_display_config_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);


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


BoxesDisplayConfig* boxes_display_config_construct (GType object_type, BoxesCollectionSource* source, const gchar* subgroup) {
	BoxesDisplayConfig * self = NULL;
	BoxesCollectionSource* _tmp0_;
	BoxesCollectionSource* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	g_return_val_if_fail (source != NULL, NULL);
	self = (BoxesDisplayConfig*) g_object_new (object_type, NULL);
	_tmp0_ = source;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->source);
	self->priv->source = _tmp1_;
	_tmp2_ = g_strdup ("display");
	_g_free0 (self->priv->group);
	self->priv->group = _tmp2_;
	_tmp3_ = subgroup;
	if (_tmp3_ != NULL) {
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		_tmp4_ = self->priv->group;
		_tmp5_ = subgroup;
		_tmp6_ = g_strconcat (" ", _tmp5_, NULL);
		_tmp7_ = _tmp6_;
		_tmp8_ = g_strconcat (_tmp4_, _tmp7_, NULL);
		_g_free0 (self->priv->group);
		self->priv->group = _tmp8_;
		_g_free0 (_tmp7_);
	}
	return self;
}


BoxesDisplayConfig* boxes_display_config_new (BoxesCollectionSource* source, const gchar* subgroup) {
	return boxes_display_config_construct (BOXES_TYPE_DISPLAY_CONFIG, source, subgroup);
}


static gboolean _vala_string_array_contains (gchar** stack, int stack_length, gchar* needle) {
	int i;
	for (i = 0; i < stack_length; i++) {
		if (g_strcmp0 (stack[i], needle) == 0) {
			return TRUE;
		}
	}
	return FALSE;
}


static void _vala_array_add1 (gchar*** array, int* length, int* size, gchar* value) {
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}


void boxes_display_config_add_category (BoxesDisplayConfig* self, const gchar* category) {
	const gchar* _tmp0_;
	gchar** _tmp1_;
	gint _tmp1__length1;
	gchar** _tmp2_;
	gint _tmp2__length1;
	gchar** _tmp3_;
	gint _tmp3__length1;
	gboolean _tmp4_;
	gchar** _tmp5_;
	gint _tmp5__length1;
	gchar** _tmp6_;
	gint _tmp6__length1;
	gchar** categories;
	gint categories_length1;
	gint _categories_size_;
	gchar** _tmp7_;
	gint _tmp7__length1;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	gchar** _tmp10_;
	gint _tmp10__length1;
	g_return_if_fail (self != NULL);
	g_return_if_fail (category != NULL);
	_tmp0_ = category;
	_tmp1_ = boxes_display_config_get_categories (self, &_tmp1__length1);
	_tmp2_ = _tmp1_;
	_tmp2__length1 = _tmp1__length1;
	_tmp3_ = _tmp2_;
	_tmp3__length1 = _tmp2__length1;
	_tmp4_ = _vala_string_array_contains (_tmp3_, _tmp2__length1, _tmp0_);
	_tmp3_ = (_vala_array_free (_tmp3_, _tmp3__length1, (GDestroyNotify) g_free), NULL);
	if (_tmp4_) {
		return;
	}
	_tmp5_ = boxes_display_config_get_categories (self, &_tmp5__length1);
	_tmp6_ = _tmp5_;
	_tmp6__length1 = _tmp5__length1;
	categories = _tmp6_;
	categories_length1 = _tmp6__length1;
	_categories_size_ = categories_length1;
	_tmp7_ = categories;
	_tmp7__length1 = categories_length1;
	_tmp8_ = category;
	_tmp9_ = g_strdup (_tmp8_);
	_vala_array_add1 (&categories, &categories_length1, &_categories_size_, _tmp9_);
	_tmp10_ = categories;
	_tmp10__length1 = categories_length1;
	boxes_display_config_set_categories (self, _tmp10_, _tmp10__length1);
	boxes_iconfig_save ((BoxesIConfig*) self);
	categories = (_vala_array_free (categories, categories_length1, (GDestroyNotify) g_free), NULL);
}


void boxes_display_config_save_display_property (BoxesDisplayConfig* self, GObject* display, const gchar* property_name) {
	GObject* _tmp0_;
	GObjectClass* _tmp1_ = NULL;
	const gchar* _tmp2_;
	GParamSpec* _tmp3_ = NULL;
	GType _tmp4_;
	GValue _tmp5_ = {0};
	GValue value;
	GObject* _tmp6_;
	const gchar* _tmp7_;
	GType _tmp8_ = 0UL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (display != NULL);
	g_return_if_fail (property_name != NULL);
	_tmp0_ = display;
	_tmp1_ = G_OBJECT_GET_CLASS (_tmp0_);
	_tmp2_ = property_name;
	_tmp3_ = g_object_class_find_property (_tmp1_, _tmp2_);
	_tmp4_ = _tmp3_->value_type;
	g_value_init (&_tmp5_, _tmp4_);
	value = _tmp5_;
	_tmp6_ = display;
	_tmp7_ = property_name;
	g_object_get_property (_tmp6_, _tmp7_, &value);
	_tmp8_ = G_VALUE_TYPE (&value);
	if (_tmp8_ == G_TYPE_STRING) {
		GKeyFile* _tmp9_;
		GKeyFile* _tmp10_;
		const gchar* _tmp11_;
		const gchar* _tmp12_;
		const gchar* _tmp13_ = NULL;
		_tmp9_ = boxes_iconfig_get_keyfile ((BoxesIConfig*) self);
		_tmp10_ = _tmp9_;
		_tmp11_ = self->priv->group;
		_tmp12_ = property_name;
		_tmp13_ = g_value_get_string (&value);
		g_key_file_set_string (_tmp10_, _tmp11_, _tmp12_, _tmp13_);
	} else {
		GType _tmp14_ = 0UL;
		_tmp14_ = G_VALUE_TYPE (&value);
		if (_tmp14_ == G_TYPE_BOOLEAN) {
			GKeyFile* _tmp15_;
			GKeyFile* _tmp16_;
			const gchar* _tmp17_;
			const gchar* _tmp18_;
			gboolean _tmp19_ = FALSE;
			_tmp15_ = boxes_iconfig_get_keyfile ((BoxesIConfig*) self);
			_tmp16_ = _tmp15_;
			_tmp17_ = self->priv->group;
			_tmp18_ = property_name;
			_tmp19_ = g_value_get_boolean (&value);
			g_key_file_set_boolean (_tmp16_, _tmp17_, _tmp18_, _tmp19_);
		} else {
			const gchar* _tmp20_;
			gchar* _tmp21_ = NULL;
			gchar* _tmp22_;
			gchar* _tmp23_ = NULL;
			gchar* _tmp24_;
			_tmp20_ = property_name;
			_tmp21_ = g_strdup_value_contents (&value);
			_tmp22_ = _tmp21_;
			_tmp23_ = g_strdup_printf ("unhandled property %s type, value: %s", _tmp20_, _tmp22_);
			_tmp24_ = _tmp23_;
			g_warning ("display-config.vala:55: %s", _tmp24_);
			_g_free0 (_tmp24_);
			_g_free0 (_tmp22_);
		}
	}
	boxes_iconfig_save ((BoxesIConfig*) self);
	G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL;
}


void boxes_display_config_load_display_property (BoxesDisplayConfig* self, GObject* display, const gchar* property_name, GValue* default_value) {
	GObject* _tmp0_;
	GObjectClass* _tmp1_ = NULL;
	const gchar* _tmp2_;
	GParamSpec* _tmp3_ = NULL;
	GType _tmp4_;
	GValue _tmp5_ = {0};
	GValue value;
	GObject* _tmp24_;
	const gchar* _tmp25_;
	GValue _tmp26_;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (display != NULL);
	g_return_if_fail (property_name != NULL);
	g_return_if_fail (default_value != NULL);
	_tmp0_ = display;
	_tmp1_ = G_OBJECT_GET_CLASS (_tmp0_);
	_tmp2_ = property_name;
	_tmp3_ = g_object_class_find_property (_tmp1_, _tmp2_);
	_tmp4_ = _tmp3_->value_type;
	g_value_init (&_tmp5_, _tmp4_);
	value = _tmp5_;
	{
		GType _tmp6_ = 0UL;
		GType _tmp14_ = 0UL;
		_tmp6_ = G_VALUE_TYPE (&value);
		if (_tmp6_ == G_TYPE_STRING) {
			GKeyFile* _tmp7_;
			GKeyFile* _tmp8_;
			const gchar* _tmp9_;
			const gchar* _tmp10_;
			gchar* _tmp11_ = NULL;
			gchar* _tmp12_;
			GValue _tmp13_ = {0};
			_tmp7_ = boxes_iconfig_get_keyfile ((BoxesIConfig*) self);
			_tmp8_ = _tmp7_;
			_tmp9_ = self->priv->group;
			_tmp10_ = property_name;
			_tmp11_ = g_key_file_get_string (_tmp8_, _tmp9_, _tmp10_, &_inner_error_);
			_tmp12_ = _tmp11_;
			if (_inner_error_ != NULL) {
				goto __catch8_g_error;
			}
			g_value_init (&_tmp13_, G_TYPE_STRING);
			g_value_take_string (&_tmp13_, _tmp12_);
			G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL;
			value = _tmp13_;
		}
		_tmp14_ = G_VALUE_TYPE (&value);
		if (_tmp14_ == G_TYPE_BOOLEAN) {
			GKeyFile* _tmp15_;
			GKeyFile* _tmp16_;
			const gchar* _tmp17_;
			const gchar* _tmp18_;
			gboolean _tmp19_ = FALSE;
			gboolean _tmp20_;
			GValue _tmp21_ = {0};
			_tmp15_ = boxes_iconfig_get_keyfile ((BoxesIConfig*) self);
			_tmp16_ = _tmp15_;
			_tmp17_ = self->priv->group;
			_tmp18_ = property_name;
			_tmp19_ = g_key_file_get_boolean (_tmp16_, _tmp17_, _tmp18_, &_inner_error_);
			_tmp20_ = _tmp19_;
			if (_inner_error_ != NULL) {
				goto __catch8_g_error;
			}
			g_value_init (&_tmp21_, G_TYPE_BOOLEAN);
			g_value_set_boolean (&_tmp21_, _tmp20_);
			G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL;
			value = _tmp21_;
		}
	}
	goto __finally8;
	__catch8_g_error:
	{
		GError* err = NULL;
		GValue _tmp22_;
		GValue _tmp23_ = {0};
		err = _inner_error_;
		_inner_error_ = NULL;
		_tmp22_ = *default_value;
		if (G_IS_VALUE (&_tmp22_)) {
			g_value_init (&_tmp23_, G_VALUE_TYPE (&_tmp22_));
			g_value_copy (&_tmp22_, &_tmp23_);
		} else {
			_tmp23_ = _tmp22_;
		}
		G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL;
		value = _tmp23_;
		_g_error_free0 (err);
	}
	__finally8:
	if (_inner_error_ != NULL) {
		G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
	_tmp24_ = display;
	_tmp25_ = property_name;
	_tmp26_ = value;
	g_object_set_property (_tmp24_, _tmp25_, &_tmp26_);
	G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL;
}


static gboolean boxes_display_config_real_get_has_file (BoxesIConfig* base) {
	gboolean result;
	BoxesDisplayConfig* self;
	BoxesCollectionSource* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	self = (BoxesDisplayConfig*) base;
	_tmp0_ = self->priv->source;
	_tmp1_ = boxes_iconfig_get_has_file ((BoxesIConfig*) _tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}


static void boxes_display_config_real_set_has_file (BoxesIConfig* base, gboolean value) {
	BoxesDisplayConfig* self;
	BoxesCollectionSource* _tmp0_;
	gboolean _tmp1_;
	self = (BoxesDisplayConfig*) base;
	_tmp0_ = self->priv->source;
	_tmp1_ = value;
	boxes_iconfig_set_has_file ((BoxesIConfig*) _tmp0_, _tmp1_);
}


static const gchar* boxes_display_config_real_get_filename (BoxesIConfig* base) {
	const gchar* result;
	BoxesDisplayConfig* self;
	BoxesCollectionSource* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	self = (BoxesDisplayConfig*) base;
	_tmp0_ = self->priv->source;
	_tmp1_ = boxes_iconfig_get_filename ((BoxesIConfig*) _tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}


static void boxes_display_config_real_set_filename (BoxesIConfig* base, const gchar* value) {
	BoxesDisplayConfig* self;
	self = (BoxesDisplayConfig*) base;
	g_warning ("display-config.vala:12: not allowed to change filename");
}


static GKeyFile* boxes_display_config_real_get_keyfile (BoxesIConfig* base) {
	GKeyFile* result;
	BoxesDisplayConfig* self;
	BoxesCollectionSource* _tmp0_;
	GKeyFile* _tmp1_;
	GKeyFile* _tmp2_;
	self = (BoxesDisplayConfig*) base;
	_tmp0_ = self->priv->source;
	_tmp1_ = boxes_iconfig_get_keyfile ((BoxesIConfig*) _tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}


gchar** boxes_display_config_get_categories (BoxesDisplayConfig* self, int* result_length1) {
	gchar** result;
	const gchar* _tmp0_;
	gint _tmp1_ = 0;
	gchar** _tmp2_ = NULL;
	gchar** _tmp3_;
	gint _tmp3__length1;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->group;
	_tmp2_ = boxes_iconfig_get_string_list ((BoxesIConfig*) self, _tmp0_, "categories", &_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp3__length1 = _tmp1_;
	if (result_length1) {
		*result_length1 = _tmp3__length1;
	}
	result = _tmp3_;
	return result;
}


void boxes_display_config_set_categories (BoxesDisplayConfig* self, gchar** value, int value_length1) {
	GKeyFile* _tmp0_;
	GKeyFile* _tmp1_;
	const gchar* _tmp2_;
	gchar** _tmp3_;
	gint _tmp3__length1;
	g_return_if_fail (self != NULL);
	_tmp0_ = boxes_iconfig_get_keyfile ((BoxesIConfig*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->group;
	_tmp3_ = value;
	_tmp3__length1 = value_length1;
	g_key_file_set_string_list (_tmp1_, _tmp2_, "categories", (const gchar* const*) _tmp3_, _tmp3__length1);
	g_object_notify ((GObject *) self, "categories");
}


static void boxes_display_config_class_init (BoxesDisplayConfigClass * klass) {
	boxes_display_config_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (BoxesDisplayConfigPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_boxes_display_config_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_boxes_display_config_set_property;
	G_OBJECT_CLASS (klass)->finalize = boxes_display_config_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_DISPLAY_CONFIG_CATEGORIES, g_param_spec_boxed ("categories", "categories", "categories", G_TYPE_STRV, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
}


static void boxes_display_config_boxes_iconfig_interface_init (BoxesIConfigIface * iface) {
	boxes_display_config_boxes_iconfig_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_has_file = boxes_display_config_real_get_has_file;
	iface->set_has_file = boxes_display_config_real_set_has_file;
	iface->get_filename = boxes_display_config_real_get_filename;
	iface->set_filename = boxes_display_config_real_set_filename;
	iface->get_keyfile = boxes_display_config_real_get_keyfile;
}


static void boxes_display_config_instance_init (BoxesDisplayConfig * self) {
	self->priv = BOXES_DISPLAY_CONFIG_GET_PRIVATE (self);
}


static void boxes_display_config_finalize (GObject* obj) {
	BoxesDisplayConfig * self;
	self = BOXES_DISPLAY_CONFIG (obj);
	_g_object_unref0 (self->priv->source);
	_g_free0 (self->priv->group);
	G_OBJECT_CLASS (boxes_display_config_parent_class)->finalize (obj);
}


GType boxes_display_config_get_type (void) {
	static volatile gsize boxes_display_config_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_display_config_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BoxesDisplayConfigClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_display_config_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesDisplayConfig), 0, (GInstanceInitFunc) boxes_display_config_instance_init, NULL };
		static const GInterfaceInfo boxes_iconfig_info = { (GInterfaceInitFunc) boxes_display_config_boxes_iconfig_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType boxes_display_config_type_id;
		boxes_display_config_type_id = g_type_register_static (G_TYPE_OBJECT, "BoxesDisplayConfig", &g_define_type_info, 0);
		g_type_add_interface_static (boxes_display_config_type_id, BOXES_TYPE_ICONFIG, &boxes_iconfig_info);
		g_once_init_leave (&boxes_display_config_type_id__volatile, boxes_display_config_type_id);
	}
	return boxes_display_config_type_id__volatile;
}


static void _vala_boxes_display_config_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	BoxesDisplayConfig * self;
	self = BOXES_DISPLAY_CONFIG (object);
	switch (property_id) {
		case BOXES_DISPLAY_CONFIG_CATEGORIES:
		{
			int length;
			g_value_take_boxed (value, boxes_display_config_get_categories (self, &length));
		}
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_boxes_display_config_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	BoxesDisplayConfig * self;
	self = BOXES_DISPLAY_CONFIG (object);
	switch (property_id) {
		case BOXES_DISPLAY_CONFIG_CATEGORIES:
		{
			gpointer boxed;
			boxed = g_value_get_boxed (value);
			boxes_display_config_set_categories (self, boxed, g_strv_length (boxed));
		}
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}



