/* pieComboList.c generated by valac 0.56.18, the Vala compiler
 * generated from pieComboList.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 <gtk/gtk.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gdk-pixbuf/gdk-pixbuf.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_COMBO_LIST (gnome_pie_pie_combo_list_get_type ())
#define GNOME_PIE_PIE_COMBO_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_PIE_COMBO_LIST, GnomePiePieComboList))
#define GNOME_PIE_PIE_COMBO_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_PIE_COMBO_LIST, GnomePiePieComboListClass))
#define GNOME_PIE_IS_PIE_COMBO_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_PIE_COMBO_LIST))
#define GNOME_PIE_IS_PIE_COMBO_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_PIE_COMBO_LIST))
#define GNOME_PIE_PIE_COMBO_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_PIE_COMBO_LIST, GnomePiePieComboListClass))

typedef struct _GnomePiePieComboList GnomePiePieComboList;
typedef struct _GnomePiePieComboListClass GnomePiePieComboListClass;
typedef struct _GnomePiePieComboListPrivate GnomePiePieComboListPrivate;
enum  {
	GNOME_PIE_PIE_COMBO_LIST_0_PROPERTY,
	GNOME_PIE_PIE_COMBO_LIST_CURRENT_ID_PROPERTY,
	GNOME_PIE_PIE_COMBO_LIST_NUM_PROPERTIES
};
static GParamSpec* gnome_pie_pie_combo_list_properties[GNOME_PIE_PIE_COMBO_LIST_NUM_PROPERTIES];
typedef enum  {
	GNOME_PIE_PIE_COMBO_LIST_DATA_POS_ICON,
	GNOME_PIE_PIE_COMBO_LIST_DATA_POS_NAME,
	GNOME_PIE_PIE_COMBO_LIST_DATA_POS_ID
} GnomePiePieComboListDataPos;

#define GNOME_PIE_PIE_COMBO_LIST_TYPE_DATA_POS (gnome_pie_pie_combo_list_data_pos_get_type ())
#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_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 _Block6Data Block6Data;

#define GNOME_PIE_TYPE_IMAGE (gnome_pie_image_get_type ())
#define GNOME_PIE_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_IMAGE, GnomePieImage))
#define GNOME_PIE_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_IMAGE, GnomePieImageClass))
#define GNOME_PIE_IS_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_IMAGE))
#define GNOME_PIE_IS_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_IMAGE))
#define GNOME_PIE_IMAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_IMAGE, GnomePieImageClass))

typedef struct _GnomePieImage GnomePieImage;
typedef struct _GnomePieImageClass GnomePieImageClass;

#define GNOME_PIE_TYPE_ICON (gnome_pie_icon_get_type ())
#define GNOME_PIE_ICON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_ICON, GnomePieIcon))
#define GNOME_PIE_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_ICON, GnomePieIconClass))
#define GNOME_PIE_IS_ICON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_ICON))
#define GNOME_PIE_IS_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_ICON))
#define GNOME_PIE_ICON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_ICON, GnomePieIconClass))

typedef struct _GnomePieIcon GnomePieIcon;
typedef struct _GnomePieIconClass GnomePieIconClass;
enum  {
	GNOME_PIE_PIE_COMBO_LIST_ON_SELECT_SIGNAL,
	GNOME_PIE_PIE_COMBO_LIST_NUM_SIGNALS
};
static guint gnome_pie_pie_combo_list_signals[GNOME_PIE_PIE_COMBO_LIST_NUM_SIGNALS] = {0};

struct _GnomePiePieComboList {
	GtkComboBox parent_instance;
	GnomePiePieComboListPrivate * priv;
};

struct _GnomePiePieComboListClass {
	GtkComboBoxClass parent_class;
};

struct _GnomePiePieComboListPrivate {
	gchar* _current_id;
	GtkListStore* data;
};

struct _Block6Data {
	int _ref_count_;
	GnomePiePieComboList* self;
	gchar* id;
};

static gint GnomePiePieComboList_private_offset;
static gpointer gnome_pie_pie_combo_list_parent_class = NULL;

VALA_EXTERN GType gnome_pie_pie_combo_list_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePiePieComboList, g_object_unref)
static GType gnome_pie_pie_combo_list_data_pos_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
VALA_EXTERN GnomePiePieComboList* gnome_pie_pie_combo_list_new (void);
VALA_EXTERN GnomePiePieComboList* gnome_pie_pie_combo_list_construct (GType object_type);
static void __lambda52_ (GnomePiePieComboList* self);
static void gnome_pie_pie_combo_list_set_current_id (GnomePiePieComboList* self,
                                              const gchar* value);
static void ___lambda52__gtk_combo_box_changed (GtkComboBox* _sender,
                                         gpointer self);
VALA_EXTERN void gnome_pie_pie_combo_list_reload (GnomePiePieComboList* self);
VALA_EXTERN GType gnome_pie_pie_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePiePie, g_object_unref)
VALA_EXTERN GeeHashMap* gnome_pie_pie_manager_get_all_pies (void);
static void gnome_pie_pie_combo_list_load_pie (GnomePiePieComboList* self,
                                        GnomePiePie* pie);
VALA_EXTERN void gnome_pie_pie_combo_list_select_first (GnomePiePieComboList* self);
VALA_EXTERN void gnome_pie_pie_combo_list_select (GnomePiePieComboList* self,
                                      const gchar* id);
static Block6Data* block6_data_ref (Block6Data* _data6_);
static void block6_data_unref (void * _userdata_);
static gboolean __lambda53_ (Block6Data* _data6_,
                      GtkTreeModel* model,
                      GtkTreePath* path,
                      GtkTreeIter* iter);
static gboolean ___lambda53__gtk_tree_model_foreach_func (GtkTreeModel* model,
                                                   GtkTreePath* path,
                                                   GtkTreeIter* iter,
                                                   gpointer self);
VALA_EXTERN const gchar* gnome_pie_pie_get_id (GnomePiePie* self);
VALA_EXTERN GType gnome_pie_image_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieImage, g_object_unref)
VALA_EXTERN GType gnome_pie_icon_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieIcon, g_object_unref)
VALA_EXTERN const gchar* gnome_pie_pie_get_icon (GnomePiePie* self);
VALA_EXTERN GnomePieIcon* gnome_pie_icon_new (const gchar* icon_name,
                                  gint size);
VALA_EXTERN GnomePieIcon* gnome_pie_icon_construct (GType object_type,
                                        const gchar* icon_name,
                                        gint size);
VALA_EXTERN GdkPixbuf* gnome_pie_image_to_pixbuf (GnomePieImage* self);
VALA_EXTERN const gchar* gnome_pie_pie_get_name (GnomePiePie* self);
VALA_EXTERN const gchar* gnome_pie_pie_combo_list_get_current_id (GnomePiePieComboList* self);
static void gnome_pie_pie_combo_list_finalize (GObject * obj);
static GType gnome_pie_pie_combo_list_get_type_once (void);
static void _vala_gnome_pie_pie_combo_list_get_property (GObject * object,
                                                  guint property_id,
                                                  GValue * value,
                                                  GParamSpec * pspec);
static void _vala_gnome_pie_pie_combo_list_set_property (GObject * object,
                                                  guint property_id,
                                                  const GValue * value,
                                                  GParamSpec * pspec);

static inline gpointer
gnome_pie_pie_combo_list_get_instance_private (GnomePiePieComboList* self)
{
	return G_STRUCT_MEMBER_P (self, GnomePiePieComboList_private_offset);
}

static GType
gnome_pie_pie_combo_list_data_pos_get_type_once (void)
{
	static const GEnumValue values[] = {{GNOME_PIE_PIE_COMBO_LIST_DATA_POS_ICON, "GNOME_PIE_PIE_COMBO_LIST_DATA_POS_ICON", "icon"}, {GNOME_PIE_PIE_COMBO_LIST_DATA_POS_NAME, "GNOME_PIE_PIE_COMBO_LIST_DATA_POS_NAME", "name"}, {GNOME_PIE_PIE_COMBO_LIST_DATA_POS_ID, "GNOME_PIE_PIE_COMBO_LIST_DATA_POS_ID", "id"}, {0, NULL, NULL}};
	GType gnome_pie_pie_combo_list_data_pos_type_id;
	gnome_pie_pie_combo_list_data_pos_type_id = g_enum_register_static ("GnomePiePieComboListDataPos", values);
	return gnome_pie_pie_combo_list_data_pos_type_id;
}

static GType
gnome_pie_pie_combo_list_data_pos_get_type (void)
{
	static volatile gsize gnome_pie_pie_combo_list_data_pos_type_id__once = 0;
	if (g_once_init_enter (&gnome_pie_pie_combo_list_data_pos_type_id__once)) {
		GType gnome_pie_pie_combo_list_data_pos_type_id;
		gnome_pie_pie_combo_list_data_pos_type_id = gnome_pie_pie_combo_list_data_pos_get_type_once ();
		g_once_init_leave (&gnome_pie_pie_combo_list_data_pos_type_id__once, gnome_pie_pie_combo_list_data_pos_type_id);
	}
	return gnome_pie_pie_combo_list_data_pos_type_id__once;
}

static void
__lambda52_ (GnomePiePieComboList* self)
{
	GtkTreeIter active = {0};
	GtkTreeIter _tmp0_ = {0};
	gboolean _tmp1_;
	_tmp1_ = gtk_combo_box_get_active_iter ((GtkComboBox*) self, &_tmp0_);
	active = _tmp0_;
	if (_tmp1_) {
		gchar* id = NULL;
		gchar* _tmp2_;
		GtkListStore* _tmp3_;
		GtkTreeIter _tmp4_;
		gchar* _tmp5_ = NULL;
		const gchar* _tmp6_;
		const gchar* _tmp7_;
		_tmp2_ = g_strdup ("");
		id = _tmp2_;
		_tmp3_ = self->priv->data;
		_tmp4_ = active;
		gtk_tree_model_get ((GtkTreeModel*) _tmp3_, &_tmp4_, GNOME_PIE_PIE_COMBO_LIST_DATA_POS_ID, &_tmp5_, -1);
		_g_free0 (id);
		id = _tmp5_;
		_tmp6_ = id;
		g_signal_emit (self, gnome_pie_pie_combo_list_signals[GNOME_PIE_PIE_COMBO_LIST_ON_SELECT_SIGNAL], 0, _tmp6_);
		_tmp7_ = id;
		gnome_pie_pie_combo_list_set_current_id (self, _tmp7_);
		_g_free0 (id);
	}
}

static void
___lambda52__gtk_combo_box_changed (GtkComboBox* _sender,
                                    gpointer self)
{
	__lambda52_ ((GnomePiePieComboList*) self);
}

GnomePiePieComboList*
gnome_pie_pie_combo_list_construct (GType object_type)
{
	GnomePiePieComboList * self = NULL;
	GtkListStore* _tmp0_;
	GtkListStore* _tmp1_;
	GtkListStore* _tmp2_;
	GtkCellRendererPixbuf* icon_render = NULL;
	GtkCellRendererPixbuf* _tmp3_;
	GtkCellRendererText* name_render = NULL;
	GtkCellRendererText* _tmp4_;
	self = (GnomePiePieComboList*) g_object_new (object_type, NULL);
	_tmp0_ = gtk_list_store_new (3, gdk_pixbuf_get_type (), G_TYPE_STRING, G_TYPE_STRING, -1);
	_g_object_unref0 (self->priv->data);
	self->priv->data = _tmp0_;
	_tmp1_ = self->priv->data;
	gtk_tree_sortable_set_sort_column_id ((GtkTreeSortable*) _tmp1_, 1, GTK_SORT_ASCENDING);
	_tmp2_ = self->priv->data;
	gtk_combo_box_set_model (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_combo_box_get_type (), GtkComboBox), (GtkTreeModel*) _tmp2_);
	_tmp3_ = (GtkCellRendererPixbuf*) gtk_cell_renderer_pixbuf_new ();
	g_object_ref_sink (_tmp3_);
	icon_render = _tmp3_;
	g_object_set ((GtkCellRenderer*) icon_render, "xpad", (guint) 4, NULL);
	gtk_cell_layout_pack_start ((GtkCellLayout*) self, (GtkCellRenderer*) icon_render, FALSE);
	_tmp4_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	g_object_ref_sink (_tmp4_);
	name_render = _tmp4_;
	gtk_cell_layout_pack_start ((GtkCellLayout*) self, (GtkCellRenderer*) name_render, TRUE);
	gtk_cell_layout_add_attribute ((GtkCellLayout*) self, (GtkCellRenderer*) icon_render, "pixbuf", (gint) GNOME_PIE_PIE_COMBO_LIST_DATA_POS_ICON);
	gtk_cell_layout_add_attribute ((GtkCellLayout*) self, (GtkCellRenderer*) name_render, "text", (gint) GNOME_PIE_PIE_COMBO_LIST_DATA_POS_NAME);
	g_signal_connect_object ((GtkComboBox*) self, "changed", (GCallback) ___lambda52__gtk_combo_box_changed, self, 0);
	gnome_pie_pie_combo_list_reload (self);
	_g_object_unref0 (name_render);
	_g_object_unref0 (icon_render);
	return self;
}

GnomePiePieComboList*
gnome_pie_pie_combo_list_new (void)
{
	return gnome_pie_pie_combo_list_construct (GNOME_PIE_TYPE_PIE_COMBO_LIST);
}

void
gnome_pie_pie_combo_list_reload (GnomePiePieComboList* self)
{
	GtkTreeIter active = {0};
	gchar* id = NULL;
	gchar* _tmp0_;
	GtkTreeIter _tmp1_ = {0};
	gboolean _tmp2_;
	GtkListStore* _tmp6_;
	const gchar* _tmp20_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup ("");
	id = _tmp0_;
	_tmp2_ = gtk_combo_box_get_active_iter ((GtkComboBox*) self, &_tmp1_);
	active = _tmp1_;
	if (_tmp2_) {
		GtkListStore* _tmp3_;
		GtkTreeIter _tmp4_;
		gchar* _tmp5_ = NULL;
		_tmp3_ = self->priv->data;
		_tmp4_ = active;
		gtk_tree_model_get ((GtkTreeModel*) _tmp3_, &_tmp4_, GNOME_PIE_PIE_COMBO_LIST_DATA_POS_ID, &_tmp5_, -1);
		_g_free0 (id);
		id = _tmp5_;
	}
	_tmp6_ = self->priv->data;
	gtk_list_store_clear (_tmp6_);
	{
		GeeIterator* _pie_it = NULL;
		GeeHashMap* _tmp7_;
		GeeHashMap* _tmp8_;
		GeeSet* _tmp9_;
		GeeSet* _tmp10_;
		GeeSet* _tmp11_;
		GeeIterator* _tmp12_;
		GeeIterator* _tmp13_;
		_tmp7_ = gnome_pie_pie_manager_get_all_pies ();
		_tmp8_ = _tmp7_;
		_tmp9_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = _tmp10_;
		_tmp12_ = gee_iterable_iterator ((GeeIterable*) _tmp11_);
		_tmp13_ = _tmp12_;
		_g_object_unref0 (_tmp11_);
		_pie_it = _tmp13_;
		while (TRUE) {
			GeeIterator* _tmp14_;
			GeeMapEntry* pie = NULL;
			GeeIterator* _tmp15_;
			gpointer _tmp16_;
			GeeMapEntry* _tmp17_;
			gconstpointer _tmp18_;
			gconstpointer _tmp19_;
			_tmp14_ = _pie_it;
			if (!gee_iterator_next (_tmp14_)) {
				break;
			}
			_tmp15_ = _pie_it;
			_tmp16_ = gee_iterator_get (_tmp15_);
			pie = (GeeMapEntry*) _tmp16_;
			_tmp17_ = pie;
			_tmp18_ = gee_map_entry_get_value (_tmp17_);
			_tmp19_ = _tmp18_;
			gnome_pie_pie_combo_list_load_pie (self, (GnomePiePie*) _tmp19_);
			_g_object_unref0 (pie);
		}
		_g_object_unref0 (_pie_it);
	}
	gnome_pie_pie_combo_list_select_first (self);
	_tmp20_ = id;
	gnome_pie_pie_combo_list_select (self, _tmp20_);
	_g_free0 (id);
}

void
gnome_pie_pie_combo_list_select_first (GnomePiePieComboList* self)
{
	GtkTreeIter active = {0};
	GtkListStore* _tmp0_;
	GtkTreeIter _tmp1_ = {0};
	gboolean _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->data;
	_tmp2_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) _tmp0_, &_tmp1_);
	active = _tmp1_;
	if (_tmp2_) {
		GtkTreeIter _tmp3_;
		gchar* id = NULL;
		gchar* _tmp4_;
		GtkListStore* _tmp5_;
		GtkTreeIter _tmp6_;
		gchar* _tmp7_ = NULL;
		const gchar* _tmp8_;
		const gchar* _tmp9_;
		_tmp3_ = active;
		gtk_combo_box_set_active_iter ((GtkComboBox*) self, &_tmp3_);
		_tmp4_ = g_strdup ("");
		id = _tmp4_;
		_tmp5_ = self->priv->data;
		_tmp6_ = active;
		gtk_tree_model_get ((GtkTreeModel*) _tmp5_, &_tmp6_, GNOME_PIE_PIE_COMBO_LIST_DATA_POS_ID, &_tmp7_, -1);
		_g_free0 (id);
		id = _tmp7_;
		_tmp8_ = id;
		g_signal_emit (self, gnome_pie_pie_combo_list_signals[GNOME_PIE_PIE_COMBO_LIST_ON_SELECT_SIGNAL], 0, _tmp8_);
		_tmp9_ = id;
		gnome_pie_pie_combo_list_set_current_id (self, _tmp9_);
		_g_free0 (id);
	} else {
		g_signal_emit (self, gnome_pie_pie_combo_list_signals[GNOME_PIE_PIE_COMBO_LIST_ON_SELECT_SIGNAL], 0, "");
		gnome_pie_pie_combo_list_set_current_id (self, "");
	}
}

static Block6Data*
block6_data_ref (Block6Data* _data6_)
{
	g_atomic_int_inc (&_data6_->_ref_count_);
	return _data6_;
}

static void
block6_data_unref (void * _userdata_)
{
	Block6Data* _data6_;
	_data6_ = (Block6Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data6_->_ref_count_)) {
		GnomePiePieComboList* self;
		self = _data6_->self;
		_g_free0 (_data6_->id);
		_g_object_unref0 (self);
		g_slice_free (Block6Data, _data6_);
	}
}

static gboolean
__lambda53_ (Block6Data* _data6_,
             GtkTreeModel* model,
             GtkTreePath* path,
             GtkTreeIter* iter)
{
	GnomePiePieComboList* self;
	gchar* pie_id = NULL;
	GtkListStore* _tmp0_;
	GtkTreeIter _tmp1_;
	gchar* _tmp2_ = NULL;
	const gchar* _tmp3_;
	gboolean result;
	self = _data6_->self;
	g_return_val_if_fail (model != NULL, FALSE);
	g_return_val_if_fail (path != NULL, FALSE);
	g_return_val_if_fail (iter != NULL, FALSE);
	_tmp0_ = self->priv->data;
	_tmp1_ = *iter;
	gtk_tree_model_get ((GtkTreeModel*) _tmp0_, &_tmp1_, GNOME_PIE_PIE_COMBO_LIST_DATA_POS_ID, &_tmp2_, -1);
	_g_free0 (pie_id);
	pie_id = _tmp2_;
	_tmp3_ = pie_id;
	if (g_strcmp0 (_data6_->id, _tmp3_) == 0) {
		GtkTreeIter _tmp4_;
		_tmp4_ = *iter;
		gtk_combo_box_set_active_iter ((GtkComboBox*) self, &_tmp4_);
		result = TRUE;
		_g_free0 (pie_id);
		return result;
	}
	result = FALSE;
	_g_free0 (pie_id);
	return result;
}

static gboolean
___lambda53__gtk_tree_model_foreach_func (GtkTreeModel* model,
                                          GtkTreePath* path,
                                          GtkTreeIter* iter,
                                          gpointer self)
{
	gboolean result;
	result = __lambda53_ (self, model, path, iter);
	return result;
}

void
gnome_pie_pie_combo_list_select (GnomePiePieComboList* self,
                                 const gchar* id)
{
	Block6Data* _data6_;
	gchar* _tmp0_;
	GtkListStore* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (id != NULL);
	_data6_ = g_slice_new0 (Block6Data);
	_data6_->_ref_count_ = 1;
	_data6_->self = g_object_ref (self);
	_tmp0_ = g_strdup (id);
	_g_free0 (_data6_->id);
	_data6_->id = _tmp0_;
	_tmp1_ = self->priv->data;
	gtk_tree_model_foreach ((GtkTreeModel*) _tmp1_, ___lambda53__gtk_tree_model_foreach_func, _data6_);
	block6_data_unref (_data6_);
	_data6_ = NULL;
}

static void
gnome_pie_pie_combo_list_load_pie (GnomePiePieComboList* self,
                                   GnomePiePie* pie)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (pie != NULL);
	_tmp0_ = gnome_pie_pie_get_id (pie);
	_tmp1_ = _tmp0_;
	_tmp2_ = strlen (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_ == 3) {
		GtkTreeIter last = {0};
		GtkListStore* _tmp4_;
		GtkTreeIter _tmp5_ = {0};
		GnomePieIcon* icon = NULL;
		const gchar* _tmp6_;
		const gchar* _tmp7_;
		GnomePieIcon* _tmp8_;
		GtkListStore* _tmp9_;
		GtkTreeIter _tmp10_;
		GnomePieIcon* _tmp11_;
		GdkPixbuf* _tmp12_;
		GdkPixbuf* _tmp13_;
		const gchar* _tmp14_;
		const gchar* _tmp15_;
		const gchar* _tmp16_;
		const gchar* _tmp17_;
		_tmp4_ = self->priv->data;
		gtk_list_store_append (_tmp4_, &_tmp5_);
		last = _tmp5_;
		_tmp6_ = gnome_pie_pie_get_icon (pie);
		_tmp7_ = _tmp6_;
		_tmp8_ = gnome_pie_icon_new (_tmp7_, 24);
		icon = _tmp8_;
		_tmp9_ = self->priv->data;
		_tmp10_ = last;
		_tmp11_ = icon;
		_tmp12_ = gnome_pie_image_to_pixbuf ((GnomePieImage*) _tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = gnome_pie_pie_get_name (pie);
		_tmp15_ = _tmp14_;
		_tmp16_ = gnome_pie_pie_get_id (pie);
		_tmp17_ = _tmp16_;
		gtk_list_store_set (_tmp9_, &_tmp10_, GNOME_PIE_PIE_COMBO_LIST_DATA_POS_ICON, _tmp13_, GNOME_PIE_PIE_COMBO_LIST_DATA_POS_NAME, _tmp15_, GNOME_PIE_PIE_COMBO_LIST_DATA_POS_ID, _tmp17_, -1);
		_g_object_unref0 (_tmp13_);
		_g_object_unref0 (icon);
	}
}

const gchar*
gnome_pie_pie_combo_list_get_current_id (GnomePiePieComboList* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_current_id;
	result = _tmp0_;
	return result;
}

static void
gnome_pie_pie_combo_list_set_current_id (GnomePiePieComboList* self,
                                         const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_pie_combo_list_get_current_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_current_id);
		self->priv->_current_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_pie_combo_list_properties[GNOME_PIE_PIE_COMBO_LIST_CURRENT_ID_PROPERTY]);
	}
}

static void
gnome_pie_pie_combo_list_class_init (GnomePiePieComboListClass * klass,
                                     gpointer klass_data)
{
	gnome_pie_pie_combo_list_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GnomePiePieComboList_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_gnome_pie_pie_combo_list_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gnome_pie_pie_combo_list_set_property;
	G_OBJECT_CLASS (klass)->finalize = gnome_pie_pie_combo_list_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_PIE_COMBO_LIST_CURRENT_ID_PROPERTY, gnome_pie_pie_combo_list_properties[GNOME_PIE_PIE_COMBO_LIST_CURRENT_ID_PROPERTY] = g_param_spec_string ("current-id", "current-id", "current-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	gnome_pie_pie_combo_list_signals[GNOME_PIE_PIE_COMBO_LIST_ON_SELECT_SIGNAL] = g_signal_new ("on-select", GNOME_PIE_TYPE_PIE_COMBO_LIST, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
}

static void
gnome_pie_pie_combo_list_instance_init (GnomePiePieComboList * self,
                                        gpointer klass)
{
	gchar* _tmp0_;
	self->priv = gnome_pie_pie_combo_list_get_instance_private (self);
	_tmp0_ = g_strdup ("");
	self->priv->_current_id = _tmp0_;
}

static void
gnome_pie_pie_combo_list_finalize (GObject * obj)
{
	GnomePiePieComboList * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GNOME_PIE_TYPE_PIE_COMBO_LIST, GnomePiePieComboList);
	_g_free0 (self->priv->_current_id);
	_g_object_unref0 (self->priv->data);
	G_OBJECT_CLASS (gnome_pie_pie_combo_list_parent_class)->finalize (obj);
}

static GType
gnome_pie_pie_combo_list_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GnomePiePieComboListClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gnome_pie_pie_combo_list_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GnomePiePieComboList), 0, (GInstanceInitFunc) gnome_pie_pie_combo_list_instance_init, NULL };
	GType gnome_pie_pie_combo_list_type_id;
	gnome_pie_pie_combo_list_type_id = g_type_register_static (gtk_combo_box_get_type (), "GnomePiePieComboList", &g_define_type_info, 0);
	GnomePiePieComboList_private_offset = g_type_add_instance_private (gnome_pie_pie_combo_list_type_id, sizeof (GnomePiePieComboListPrivate));
	return gnome_pie_pie_combo_list_type_id;
}

GType
gnome_pie_pie_combo_list_get_type (void)
{
	static volatile gsize gnome_pie_pie_combo_list_type_id__once = 0;
	if (g_once_init_enter (&gnome_pie_pie_combo_list_type_id__once)) {
		GType gnome_pie_pie_combo_list_type_id;
		gnome_pie_pie_combo_list_type_id = gnome_pie_pie_combo_list_get_type_once ();
		g_once_init_leave (&gnome_pie_pie_combo_list_type_id__once, gnome_pie_pie_combo_list_type_id);
	}
	return gnome_pie_pie_combo_list_type_id__once;
}

static void
_vala_gnome_pie_pie_combo_list_get_property (GObject * object,
                                             guint property_id,
                                             GValue * value,
                                             GParamSpec * pspec)
{
	GnomePiePieComboList * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GNOME_PIE_TYPE_PIE_COMBO_LIST, GnomePiePieComboList);
	switch (property_id) {
		case GNOME_PIE_PIE_COMBO_LIST_CURRENT_ID_PROPERTY:
		g_value_set_string (value, gnome_pie_pie_combo_list_get_current_id (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gnome_pie_pie_combo_list_set_property (GObject * object,
                                             guint property_id,
                                             const GValue * value,
                                             GParamSpec * pspec)
{
	GnomePiePieComboList * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GNOME_PIE_TYPE_PIE_COMBO_LIST, GnomePiePieComboList);
	switch (property_id) {
		case GNOME_PIE_PIE_COMBO_LIST_CURRENT_ID_PROPERTY:
		gnome_pie_pie_combo_list_set_current_id (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

