/* group-model.c generated by valac 0.32.0.49-00a57, the Vala compiler
 * generated from group-model.vala, do not modify */


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


#define CARIBOU_TYPE_IKEYBOARD_OBJECT (caribou_ikeyboard_object_get_type ())
#define CARIBOU_IKEYBOARD_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CARIBOU_TYPE_IKEYBOARD_OBJECT, CaribouIKeyboardObject))
#define CARIBOU_IS_IKEYBOARD_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CARIBOU_TYPE_IKEYBOARD_OBJECT))
#define CARIBOU_IKEYBOARD_OBJECT_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CARIBOU_TYPE_IKEYBOARD_OBJECT, CaribouIKeyboardObjectIface))

typedef struct _CaribouIKeyboardObject CaribouIKeyboardObject;
typedef struct _CaribouIKeyboardObjectIface CaribouIKeyboardObjectIface;

#define CARIBOU_TYPE_KEY_MODEL (caribou_key_model_get_type ())
#define CARIBOU_KEY_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CARIBOU_TYPE_KEY_MODEL, CaribouKeyModel))
#define CARIBOU_KEY_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CARIBOU_TYPE_KEY_MODEL, CaribouKeyModelClass))
#define CARIBOU_IS_KEY_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CARIBOU_TYPE_KEY_MODEL))
#define CARIBOU_IS_KEY_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CARIBOU_TYPE_KEY_MODEL))
#define CARIBOU_KEY_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CARIBOU_TYPE_KEY_MODEL, CaribouKeyModelClass))

typedef struct _CaribouKeyModel CaribouKeyModel;
typedef struct _CaribouKeyModelClass CaribouKeyModelClass;

#define CARIBOU_TYPE_GROUP_MODEL (caribou_group_model_get_type ())
#define CARIBOU_GROUP_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CARIBOU_TYPE_GROUP_MODEL, CaribouGroupModel))
#define CARIBOU_GROUP_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CARIBOU_TYPE_GROUP_MODEL, CaribouGroupModelClass))
#define CARIBOU_IS_GROUP_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CARIBOU_TYPE_GROUP_MODEL))
#define CARIBOU_IS_GROUP_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CARIBOU_TYPE_GROUP_MODEL))
#define CARIBOU_GROUP_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CARIBOU_TYPE_GROUP_MODEL, CaribouGroupModelClass))

typedef struct _CaribouGroupModel CaribouGroupModel;
typedef struct _CaribouGroupModelClass CaribouGroupModelClass;
typedef struct _CaribouGroupModelPrivate CaribouGroupModelPrivate;

#define CARIBOU_TYPE_SCANNABLE_GROUP (caribou_scannable_group_get_type ())
#define CARIBOU_SCANNABLE_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CARIBOU_TYPE_SCANNABLE_GROUP, CaribouScannableGroup))
#define CARIBOU_SCANNABLE_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CARIBOU_TYPE_SCANNABLE_GROUP, CaribouScannableGroupClass))
#define CARIBOU_IS_SCANNABLE_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CARIBOU_TYPE_SCANNABLE_GROUP))
#define CARIBOU_IS_SCANNABLE_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CARIBOU_TYPE_SCANNABLE_GROUP))
#define CARIBOU_SCANNABLE_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CARIBOU_TYPE_SCANNABLE_GROUP, CaribouScannableGroupClass))

typedef struct _CaribouScannableGroup CaribouScannableGroup;
typedef struct _CaribouScannableGroupClass CaribouScannableGroupClass;

#define CARIBOU_TYPE_LEVEL_MODEL (caribou_level_model_get_type ())
#define CARIBOU_LEVEL_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CARIBOU_TYPE_LEVEL_MODEL, CaribouLevelModel))
#define CARIBOU_LEVEL_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CARIBOU_TYPE_LEVEL_MODEL, CaribouLevelModelClass))
#define CARIBOU_IS_LEVEL_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CARIBOU_TYPE_LEVEL_MODEL))
#define CARIBOU_IS_LEVEL_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CARIBOU_TYPE_LEVEL_MODEL))
#define CARIBOU_LEVEL_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CARIBOU_TYPE_LEVEL_MODEL, CaribouLevelModelClass))

typedef struct _CaribouLevelModel CaribouLevelModel;
typedef struct _CaribouLevelModelClass CaribouLevelModelClass;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _CaribouIKeyboardObjectIface {
	GTypeInterface parent_iface;
	CaribouIKeyboardObject** (*get_children) (CaribouIKeyboardObject* self, int* result_length1);
	CaribouKeyModel** (*get_keys) (CaribouIKeyboardObject* self, int* result_length1);
};

struct _CaribouGroupModel {
	GObject parent_instance;
	CaribouGroupModelPrivate * priv;
	gchar* group;
	gchar* variant;
};

struct _CaribouGroupModelClass {
	GObjectClass parent_class;
};

struct _CaribouGroupModelPrivate {
	gchar* _active_level;
	gchar* default_level;
	GeeHashMap* levels;
};


static gpointer caribou_group_model_parent_class = NULL;
static CaribouIKeyboardObjectIface* caribou_group_model_caribou_ikeyboard_object_parent_iface = NULL;

GType caribou_key_model_get_type (void) G_GNUC_CONST;
GType caribou_ikeyboard_object_get_type (void) G_GNUC_CONST;
GType caribou_group_model_get_type (void) G_GNUC_CONST;
GType caribou_scannable_group_get_type (void) G_GNUC_CONST;
GType caribou_level_model_get_type (void) G_GNUC_CONST;
#define CARIBOU_GROUP_MODEL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CARIBOU_TYPE_GROUP_MODEL, CaribouGroupModelPrivate))
enum  {
	CARIBOU_GROUP_MODEL_DUMMY_PROPERTY,
	CARIBOU_GROUP_MODEL_ACTIVE_LEVEL
};
CaribouGroupModel* caribou_group_model_new (const gchar* group, const gchar* variant);
CaribouGroupModel* caribou_group_model_construct (GType object_type, const gchar* group, const gchar* variant);
static void caribou_group_model_set_active_level (CaribouGroupModel* self, const gchar* value);
gchar* caribou_group_model_create_group_name (const gchar* group, const gchar* variant);
void caribou_group_model_add_level (CaribouGroupModel* self, const gchar* lname, CaribouLevelModel* level);
static void caribou_group_model_on_level_toggled (CaribouGroupModel* self, const gchar* new_level);
static void _caribou_group_model_on_level_toggled_caribou_level_model_level_toggled (CaribouLevelModel* _sender, const gchar* new_level, gpointer self);
static void __lambda13_ (CaribouGroupModel* self, CaribouKeyModel* k);
static void ___lambda13__caribou_ikeyboard_object_key_clicked (CaribouIKeyboardObject* _sender, CaribouKeyModel* key, gpointer self);
static void __lambda14_ (CaribouGroupModel* self, CaribouKeyModel* k);
static void ___lambda14__caribou_ikeyboard_object_key_pressed (CaribouIKeyboardObject* _sender, CaribouKeyModel* key, gpointer self);
static void __lambda15_ (CaribouGroupModel* self, CaribouKeyModel* k);
static void ___lambda15__caribou_ikeyboard_object_key_released (CaribouIKeyboardObject* _sender, CaribouKeyModel* key, gpointer self);
const gchar* caribou_level_model_get_mode (CaribouLevelModel* self);
gchar** caribou_group_model_get_levels (CaribouGroupModel* self, int* result_length1);
CaribouLevelModel* caribou_group_model_get_level (CaribouGroupModel* self, const gchar* level_name);
static CaribouIKeyboardObject** caribou_group_model_real_get_children (CaribouIKeyboardObject* base, int* result_length1);
const gchar* caribou_group_model_get_active_level (CaribouGroupModel* self);
static void caribou_group_model_finalize (GObject* obj);
static void _vala_caribou_group_model_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_caribou_group_model_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);


CaribouGroupModel* caribou_group_model_construct (GType object_type, const gchar* group, const gchar* variant) {
	CaribouGroupModel * self = NULL;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	GeeHashMap* _tmp4_ = NULL;
	const gchar* _tmp5_ = NULL;
	g_return_val_if_fail (group != NULL, NULL);
	g_return_val_if_fail (variant != NULL, NULL);
	self = (CaribouGroupModel*) g_object_new (object_type, NULL);
	_tmp0_ = group;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->group);
	self->group = _tmp1_;
	_tmp2_ = variant;
	_tmp3_ = g_strdup (_tmp2_);
	_g_free0 (self->variant);
	self->variant = _tmp3_;
	_tmp4_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, CARIBOU_TYPE_LEVEL_MODEL, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->levels);
	self->priv->levels = _tmp4_;
	_tmp5_ = self->priv->default_level;
	caribou_group_model_set_active_level (self, _tmp5_);
	return self;
}


CaribouGroupModel* caribou_group_model_new (const gchar* group, const gchar* variant) {
	return caribou_group_model_construct (CARIBOU_TYPE_GROUP_MODEL, group, variant);
}


static const gchar* string_to_string (const gchar* self) {
	const gchar* result = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}


gchar* caribou_group_model_create_group_name (const gchar* group, const gchar* variant) {
	gchar* result = NULL;
	const gchar* _tmp0_ = NULL;
	g_return_val_if_fail (group != NULL, NULL);
	g_return_val_if_fail (variant != NULL, NULL);
	_tmp0_ = variant;
	if (g_strcmp0 (_tmp0_, "") != 0) {
		const gchar* _tmp1_ = NULL;
		const gchar* _tmp2_ = NULL;
		const gchar* _tmp3_ = NULL;
		const gchar* _tmp4_ = NULL;
		gchar* _tmp5_ = NULL;
		_tmp1_ = group;
		_tmp2_ = string_to_string (_tmp1_);
		_tmp3_ = variant;
		_tmp4_ = string_to_string (_tmp3_);
		_tmp5_ = g_strconcat (_tmp2_, "_", _tmp4_, NULL);
		result = _tmp5_;
		return result;
	} else {
		const gchar* _tmp6_ = NULL;
		gchar* _tmp7_ = NULL;
		_tmp6_ = group;
		_tmp7_ = g_strdup (_tmp6_);
		result = _tmp7_;
		return result;
	}
}


static void _caribou_group_model_on_level_toggled_caribou_level_model_level_toggled (CaribouLevelModel* _sender, const gchar* new_level, gpointer self) {
	caribou_group_model_on_level_toggled ((CaribouGroupModel*) self, new_level);
}


static void __lambda13_ (CaribouGroupModel* self, CaribouKeyModel* k) {
	CaribouKeyModel* _tmp0_ = NULL;
	g_return_if_fail (k != NULL);
	_tmp0_ = k;
	g_signal_emit_by_name ((CaribouIKeyboardObject*) self, "key-clicked", _tmp0_);
}


static void ___lambda13__caribou_ikeyboard_object_key_clicked (CaribouIKeyboardObject* _sender, CaribouKeyModel* key, gpointer self) {
	__lambda13_ ((CaribouGroupModel*) self, key);
}


static void __lambda14_ (CaribouGroupModel* self, CaribouKeyModel* k) {
	CaribouKeyModel* _tmp0_ = NULL;
	g_return_if_fail (k != NULL);
	_tmp0_ = k;
	g_signal_emit_by_name ((CaribouIKeyboardObject*) self, "key-pressed", _tmp0_);
}


static void ___lambda14__caribou_ikeyboard_object_key_pressed (CaribouIKeyboardObject* _sender, CaribouKeyModel* key, gpointer self) {
	__lambda14_ ((CaribouGroupModel*) self, key);
}


static void __lambda15_ (CaribouGroupModel* self, CaribouKeyModel* k) {
	CaribouKeyModel* _tmp0_ = NULL;
	g_return_if_fail (k != NULL);
	_tmp0_ = k;
	g_signal_emit_by_name ((CaribouIKeyboardObject*) self, "key-released", _tmp0_);
}


static void ___lambda15__caribou_ikeyboard_object_key_released (CaribouIKeyboardObject* _sender, CaribouKeyModel* key, gpointer self) {
	__lambda15_ ((CaribouGroupModel*) self, key);
}


void caribou_group_model_add_level (CaribouGroupModel* self, const gchar* lname, CaribouLevelModel* level) {
	GeeHashMap* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	CaribouLevelModel* _tmp2_ = NULL;
	CaribouLevelModel* _tmp3_ = NULL;
	CaribouLevelModel* _tmp4_ = NULL;
	CaribouLevelModel* _tmp5_ = NULL;
	CaribouLevelModel* _tmp6_ = NULL;
	CaribouLevelModel* _tmp7_ = NULL;
	const gchar* _tmp8_ = NULL;
	const gchar* _tmp9_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (lname != NULL);
	g_return_if_fail (level != NULL);
	_tmp0_ = self->priv->levels;
	_tmp1_ = lname;
	_tmp2_ = level;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp0_, _tmp1_, _tmp2_);
	_tmp3_ = level;
	g_signal_connect_object (_tmp3_, "level-toggled", (GCallback) _caribou_group_model_on_level_toggled_caribou_level_model_level_toggled, self, 0);
	_tmp4_ = level;
	g_signal_connect_object ((CaribouIKeyboardObject*) _tmp4_, "key-clicked", (GCallback) ___lambda13__caribou_ikeyboard_object_key_clicked, self, 0);
	_tmp5_ = level;
	g_signal_connect_object ((CaribouIKeyboardObject*) _tmp5_, "key-pressed", (GCallback) ___lambda14__caribou_ikeyboard_object_key_pressed, self, 0);
	_tmp6_ = level;
	g_signal_connect_object ((CaribouIKeyboardObject*) _tmp6_, "key-released", (GCallback) ___lambda15__caribou_ikeyboard_object_key_released, self, 0);
	_tmp7_ = level;
	_tmp8_ = caribou_level_model_get_mode (_tmp7_);
	_tmp9_ = _tmp8_;
	if (g_strcmp0 (_tmp9_, "default") == 0) {
		const gchar* _tmp10_ = NULL;
		gchar* _tmp11_ = NULL;
		const gchar* _tmp12_ = NULL;
		_tmp10_ = lname;
		_tmp11_ = g_strdup (_tmp10_);
		_g_free0 (self->priv->default_level);
		self->priv->default_level = _tmp11_;
		_tmp12_ = lname;
		caribou_group_model_set_active_level (self, _tmp12_);
	}
}


gchar** caribou_group_model_get_levels (CaribouGroupModel* self, int* result_length1) {
	gchar** result = NULL;
	GeeHashMap* _tmp0_ = NULL;
	GeeSet* _tmp1_ = NULL;
	GeeSet* _tmp2_ = NULL;
	GeeSet* _tmp3_ = NULL;
	gint _tmp4_ = 0;
	gpointer* _tmp5_ = NULL;
	gchar** _tmp6_ = NULL;
	gint _tmp6__length1 = 0;
	gchar** _tmp7_ = NULL;
	gint _tmp7__length1 = 0;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->levels;
	_tmp1_ = gee_abstract_map_get_keys ((GeeMap*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	_tmp5_ = gee_collection_to_array ((GeeCollection*) _tmp3_, &_tmp4_);
	_tmp6_ = (gchar**) _tmp5_;
	_tmp6__length1 = (_tmp4_ * sizeof (gchar*)) / sizeof (gchar*);
	_g_object_unref0 (_tmp3_);
	_tmp7_ = _tmp6_;
	_tmp7__length1 = _tmp6__length1;
	if (result_length1) {
		*result_length1 = _tmp7__length1;
	}
	result = _tmp7_;
	return result;
}


CaribouLevelModel* caribou_group_model_get_level (CaribouGroupModel* self, const gchar* level_name) {
	CaribouLevelModel* result = NULL;
	GeeHashMap* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gpointer _tmp2_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (level_name != NULL, NULL);
	_tmp0_ = self->priv->levels;
	_tmp1_ = level_name;
	_tmp2_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp0_, _tmp1_);
	result = (CaribouLevelModel*) _tmp2_;
	return result;
}


static void caribou_group_model_on_level_toggled (CaribouGroupModel* self, const gchar* new_level) {
	const gchar* _tmp0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (new_level != NULL);
	_tmp0_ = new_level;
	if (g_strcmp0 (_tmp0_, "default") == 0) {
		const gchar* _tmp1_ = NULL;
		_tmp1_ = self->priv->default_level;
		caribou_group_model_set_active_level (self, _tmp1_);
	} else {
		const gchar* _tmp2_ = NULL;
		_tmp2_ = new_level;
		caribou_group_model_set_active_level (self, _tmp2_);
	}
}


static CaribouIKeyboardObject** caribou_group_model_real_get_children (CaribouIKeyboardObject* base, int* result_length1) {
	CaribouGroupModel * self;
	CaribouIKeyboardObject** result = NULL;
	GeeHashMap* _tmp0_ = NULL;
	GeeCollection* _tmp1_ = NULL;
	GeeCollection* _tmp2_ = NULL;
	GeeCollection* _tmp3_ = NULL;
	gint _tmp4_ = 0;
	gpointer* _tmp5_ = NULL;
	CaribouIKeyboardObject** _tmp6_ = NULL;
	gint _tmp6__length1 = 0;
	CaribouIKeyboardObject** _tmp7_ = NULL;
	gint _tmp7__length1 = 0;
	self = (CaribouGroupModel*) base;
	_tmp0_ = self->priv->levels;
	_tmp1_ = gee_abstract_map_get_values ((GeeMap*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	_tmp5_ = gee_collection_to_array (_tmp3_, &_tmp4_);
	_tmp6_ = (CaribouIKeyboardObject**) _tmp5_;
	_tmp6__length1 = (_tmp4_ * sizeof (CaribouLevelModel*)) / sizeof (CaribouIKeyboardObject*);
	_g_object_unref0 (_tmp3_);
	_tmp7_ = _tmp6_;
	_tmp7__length1 = _tmp6__length1;
	if (result_length1) {
		*result_length1 = _tmp7__length1;
	}
	result = _tmp7_;
	return result;
}


const gchar* caribou_group_model_get_active_level (CaribouGroupModel* self) {
	const gchar* result;
	const gchar* _tmp0_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_active_level;
	result = _tmp0_;
	return result;
}


static void caribou_group_model_set_active_level (CaribouGroupModel* self, const gchar* value) {
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->priv->_active_level);
	self->priv->_active_level = _tmp1_;
	g_object_notify ((GObject *) self, "active-level");
}


static void caribou_group_model_class_init (CaribouGroupModelClass * klass) {
	caribou_group_model_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (CaribouGroupModelPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_caribou_group_model_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_caribou_group_model_set_property;
	G_OBJECT_CLASS (klass)->finalize = caribou_group_model_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CARIBOU_GROUP_MODEL_ACTIVE_LEVEL, g_param_spec_string ("active-level", "active-level", "active-level", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
}


static void caribou_group_model_caribou_ikeyboard_object_interface_init (CaribouIKeyboardObjectIface * iface) {
	caribou_group_model_caribou_ikeyboard_object_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_children = (CaribouIKeyboardObject** (*)(CaribouIKeyboardObject*, int*)) caribou_group_model_real_get_children;
}


static void caribou_group_model_instance_init (CaribouGroupModel * self) {
	self->priv = CARIBOU_GROUP_MODEL_GET_PRIVATE (self);
}


static void caribou_group_model_finalize (GObject* obj) {
	CaribouGroupModel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CARIBOU_TYPE_GROUP_MODEL, CaribouGroupModel);
	_g_free0 (self->priv->_active_level);
	_g_free0 (self->group);
	_g_free0 (self->variant);
	_g_free0 (self->priv->default_level);
	_g_object_unref0 (self->priv->levels);
	G_OBJECT_CLASS (caribou_group_model_parent_class)->finalize (obj);
}


/**
     * Object representing a group in a keyboard.
     *
     * This is used for implementing custom keyboard service.
     *
     * A group object consists of {@link LevelModel} objects.
     */
GType caribou_group_model_get_type (void) {
	static volatile gsize caribou_group_model_type_id__volatile = 0;
	if (g_once_init_enter (&caribou_group_model_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (CaribouGroupModelClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) caribou_group_model_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CaribouGroupModel), 0, (GInstanceInitFunc) caribou_group_model_instance_init, NULL };
		static const GInterfaceInfo caribou_ikeyboard_object_info = { (GInterfaceInitFunc) caribou_group_model_caribou_ikeyboard_object_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType caribou_group_model_type_id;
		caribou_group_model_type_id = g_type_register_static (G_TYPE_OBJECT, "CaribouGroupModel", &g_define_type_info, 0);
		g_type_add_interface_static (caribou_group_model_type_id, CARIBOU_TYPE_IKEYBOARD_OBJECT, &caribou_ikeyboard_object_info);
		g_once_init_leave (&caribou_group_model_type_id__volatile, caribou_group_model_type_id);
	}
	return caribou_group_model_type_id__volatile;
}


static void _vala_caribou_group_model_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	CaribouGroupModel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CARIBOU_TYPE_GROUP_MODEL, CaribouGroupModel);
	switch (property_id) {
		case CARIBOU_GROUP_MODEL_ACTIVE_LEVEL:
		g_value_set_string (value, caribou_group_model_get_active_level (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_caribou_group_model_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	CaribouGroupModel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CARIBOU_TYPE_GROUP_MODEL, CaribouGroupModel);
	switch (property_id) {
		case CARIBOU_GROUP_MODEL_ACTIVE_LEVEL:
		caribou_group_model_set_active_level (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}



