/* themeList.c generated by valac 0.56.18, the Vala compiler
 * generated from themeList.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 <glib.h>
#include <glib/gi18n-lib.h>
#include <stdlib.h>
#include <string.h>
#include <gee.h>
#include <gdk-pixbuf/gdk-pixbuf.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_THEME_LIST (gnome_pie_theme_list_get_type ())
#define GNOME_PIE_THEME_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_THEME_LIST, GnomePieThemeList))
#define GNOME_PIE_THEME_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_THEME_LIST, GnomePieThemeListClass))
#define GNOME_PIE_IS_THEME_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_THEME_LIST))
#define GNOME_PIE_IS_THEME_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_THEME_LIST))
#define GNOME_PIE_THEME_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_THEME_LIST, GnomePieThemeListClass))

typedef struct _GnomePieThemeList GnomePieThemeList;
typedef struct _GnomePieThemeListClass GnomePieThemeListClass;
typedef struct _GnomePieThemeListPrivate GnomePieThemeListPrivate;
enum  {
	GNOME_PIE_THEME_LIST_0_PROPERTY,
	GNOME_PIE_THEME_LIST_NUM_PROPERTIES
};
static GParamSpec* gnome_pie_theme_list_properties[GNOME_PIE_THEME_LIST_NUM_PROPERTIES];
typedef enum  {
	GNOME_PIE_THEME_LIST_DATA_POS_ICON,
	GNOME_PIE_THEME_LIST_DATA_POS_NAME
} GnomePieThemeListDataPos;

#define GNOME_PIE_THEME_LIST_TYPE_DATA_POS (gnome_pie_theme_list_data_pos_get_type ())
typedef struct _Block16Data Block16Data;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define __vala_GtkTreePath_free0(var) ((var == NULL) ? NULL : (var = (_vala_GtkTreePath_free (var), NULL)))

#define GNOME_PIE_TYPE_CONFIG (gnome_pie_config_get_type ())
#define GNOME_PIE_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_CONFIG, GnomePieConfig))
#define GNOME_PIE_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_CONFIG, GnomePieConfigClass))
#define GNOME_PIE_IS_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_CONFIG))
#define GNOME_PIE_IS_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_CONFIG))
#define GNOME_PIE_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_CONFIG, GnomePieConfigClass))

typedef struct _GnomePieConfig GnomePieConfig;
typedef struct _GnomePieConfigClass GnomePieConfigClass;

#define GNOME_PIE_TYPE_THEME (gnome_pie_theme_get_type ())
#define GNOME_PIE_THEME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_THEME, GnomePieTheme))
#define GNOME_PIE_THEME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_THEME, GnomePieThemeClass))
#define GNOME_PIE_IS_THEME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_THEME))
#define GNOME_PIE_IS_THEME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_THEME))
#define GNOME_PIE_THEME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_THEME, GnomePieThemeClass))

typedef struct _GnomePieTheme GnomePieTheme;
typedef struct _GnomePieThemeClass GnomePieThemeClass;

#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_THEME_LIST_ON_SELECT_NEW_SIGNAL,
	GNOME_PIE_THEME_LIST_NUM_SIGNALS
};
static guint gnome_pie_theme_list_signals[GNOME_PIE_THEME_LIST_NUM_SIGNALS] = {0};

struct _GnomePieThemeList {
	GtkTreeView parent_instance;
	GnomePieThemeListPrivate * priv;
};

struct _GnomePieThemeListClass {
	GtkTreeViewClass parent_class;
};

struct _GnomePieThemeListPrivate {
	GtkTreeIter _active;
};

struct _Block16Data {
	int _ref_count_;
	GnomePieThemeList* self;
	GtkTreeIter active;
};

static gint GnomePieThemeList_private_offset;
static gpointer gnome_pie_theme_list_parent_class = NULL;

VALA_EXTERN GType gnome_pie_theme_list_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieThemeList, g_object_unref)
static GType gnome_pie_theme_list_data_pos_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
VALA_EXTERN GnomePieThemeList* gnome_pie_theme_list_new (void);
VALA_EXTERN GnomePieThemeList* gnome_pie_theme_list_construct (GType object_type);
static void __lambda32_ (GnomePieThemeList* self);
static Block16Data* block16_data_ref (Block16Data* _data16_);
static void block16_data_unref (void * _userdata_);
static gboolean ___lambda33_ (Block16Data* _data16_);
static void _vala_GtkTreePath_free (GtkTreePath* self);
VALA_EXTERN GType gnome_pie_config_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieConfig, g_object_unref)
VALA_EXTERN GnomePieConfig* gnome_pie_config_get_global (void);
VALA_EXTERN GType gnome_pie_theme_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieTheme, g_object_unref)
VALA_EXTERN GeeArrayList* gnome_pie_config_get_themes (GnomePieConfig* self);
VALA_EXTERN void gnome_pie_config_set_theme (GnomePieConfig* self,
                                 GnomePieTheme* value);
VALA_EXTERN GnomePieTheme* gnome_pie_config_get_theme (GnomePieConfig* self);
VALA_EXTERN gboolean gnome_pie_theme_load (GnomePieTheme* self);
VALA_EXTERN void gnome_pie_theme_load_images (GnomePieTheme* self);
static gboolean ____lambda33__gsource_func (gpointer self);
static void ___lambda32__gtk_tree_selection_changed (GtkTreeSelection* _sender,
                                              gpointer self);
VALA_EXTERN void gnome_pie_theme_list_reload (GnomePieThemeList* 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 GnomePieIcon* gnome_pie_theme_get_preview_icon (GnomePieTheme* self);
VALA_EXTERN GdkPixbuf* gnome_pie_image_to_pixbuf (GnomePieImage* self);
VALA_EXTERN const gchar* gnome_pie_theme_get_name (GnomePieTheme* self);
VALA_EXTERN const gchar* gnome_pie_theme_get_description (GnomePieTheme* self);
VALA_EXTERN const gchar* gnome_pie_theme_get_author (GnomePieTheme* self);
static void __vala_GtkTreePath_free0_ (gpointer var);
static inline void _g_list_free___vala_GtkTreePath_free0_ (GList* self);
static void gnome_pie_theme_list_get_active (GnomePieThemeList* self,
                                      GtkTreeIter * result);
static void gnome_pie_theme_list_set_active (GnomePieThemeList* self,
                                      GtkTreeIter * value);
static void gnome_pie_theme_list_finalize (GObject * obj);
static GType gnome_pie_theme_list_get_type_once (void);
static void _vala_gnome_pie_theme_list_get_property (GObject * object,
                                              guint property_id,
                                              GValue * value,
                                              GParamSpec * pspec);
static void _vala_gnome_pie_theme_list_set_property (GObject * object,
                                              guint property_id,
                                              const GValue * value,
                                              GParamSpec * pspec);

static inline gpointer
gnome_pie_theme_list_get_instance_private (GnomePieThemeList* self)
{
	return G_STRUCT_MEMBER_P (self, GnomePieThemeList_private_offset);
}

static GType
gnome_pie_theme_list_data_pos_get_type_once (void)
{
	static const GEnumValue values[] = {{GNOME_PIE_THEME_LIST_DATA_POS_ICON, "GNOME_PIE_THEME_LIST_DATA_POS_ICON", "icon"}, {GNOME_PIE_THEME_LIST_DATA_POS_NAME, "GNOME_PIE_THEME_LIST_DATA_POS_NAME", "name"}, {0, NULL, NULL}};
	GType gnome_pie_theme_list_data_pos_type_id;
	gnome_pie_theme_list_data_pos_type_id = g_enum_register_static ("GnomePieThemeListDataPos", values);
	return gnome_pie_theme_list_data_pos_type_id;
}

static GType
gnome_pie_theme_list_data_pos_get_type (void)
{
	static volatile gsize gnome_pie_theme_list_data_pos_type_id__once = 0;
	if (g_once_init_enter (&gnome_pie_theme_list_data_pos_type_id__once)) {
		GType gnome_pie_theme_list_data_pos_type_id;
		gnome_pie_theme_list_data_pos_type_id = gnome_pie_theme_list_data_pos_get_type_once ();
		g_once_init_leave (&gnome_pie_theme_list_data_pos_type_id__once, gnome_pie_theme_list_data_pos_type_id);
	}
	return gnome_pie_theme_list_data_pos_type_id__once;
}

static Block16Data*
block16_data_ref (Block16Data* _data16_)
{
	g_atomic_int_inc (&_data16_->_ref_count_);
	return _data16_;
}

static void
block16_data_unref (void * _userdata_)
{
	Block16Data* _data16_;
	_data16_ = (Block16Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data16_->_ref_count_)) {
		GnomePieThemeList* self;
		self = _data16_->self;
		_g_object_unref0 (self);
		g_slice_free (Block16Data, _data16_);
	}
}

static void
_vala_GtkTreePath_free (GtkTreePath* self)
{
	g_boxed_free (gtk_tree_path_get_type (), self);
}

static gboolean
___lambda33_ (Block16Data* _data16_)
{
	GnomePieThemeList* self;
	gint index = 0;
	GtkTreeModel* _tmp0_;
	GtkTreeModel* _tmp1_;
	GtkTreeIter _tmp2_;
	GtkTreePath* _tmp3_;
	GtkTreePath* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gint _tmp7_;
	GnomePieConfig* _tmp8_;
	GnomePieConfig* _tmp9_;
	GnomePieConfig* _tmp10_;
	GnomePieConfig* _tmp11_;
	GeeArrayList* _tmp12_;
	GeeArrayList* _tmp13_;
	gpointer _tmp14_;
	GnomePieTheme* _tmp15_;
	GnomePieConfig* _tmp16_;
	GnomePieConfig* _tmp17_;
	GnomePieTheme* _tmp18_;
	GnomePieTheme* _tmp19_;
	GnomePieConfig* _tmp20_;
	GnomePieConfig* _tmp21_;
	GnomePieTheme* _tmp22_;
	GnomePieTheme* _tmp23_;
	gboolean result;
	self = _data16_->self;
	_tmp0_ = gtk_tree_view_get_model ((GtkTreeView*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _data16_->active;
	_tmp3_ = gtk_tree_model_get_path (_tmp1_, &_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = gtk_tree_path_to_string (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = atoi (_tmp6_);
	_g_free0 (_tmp6_);
	__vala_GtkTreePath_free0 (_tmp4_);
	index = _tmp7_;
	_tmp8_ = gnome_pie_config_get_global ();
	_tmp9_ = _tmp8_;
	_tmp10_ = gnome_pie_config_get_global ();
	_tmp11_ = _tmp10_;
	_tmp12_ = gnome_pie_config_get_themes (_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = gee_abstract_list_get ((GeeAbstractList*) _tmp13_, index);
	_tmp15_ = (GnomePieTheme*) _tmp14_;
	gnome_pie_config_set_theme (_tmp9_, _tmp15_);
	_g_object_unref0 (_tmp15_);
	g_signal_emit (self, gnome_pie_theme_list_signals[GNOME_PIE_THEME_LIST_ON_SELECT_NEW_SIGNAL], 0);
	_tmp16_ = gnome_pie_config_get_global ();
	_tmp17_ = _tmp16_;
	_tmp18_ = gnome_pie_config_get_theme (_tmp17_);
	_tmp19_ = _tmp18_;
	gnome_pie_theme_load (_tmp19_);
	_tmp20_ = gnome_pie_config_get_global ();
	_tmp21_ = _tmp20_;
	_tmp22_ = gnome_pie_config_get_theme (_tmp21_);
	_tmp23_ = _tmp22_;
	gnome_pie_theme_load_images (_tmp23_);
	result = FALSE;
	return result;
}

static gboolean
____lambda33__gsource_func (gpointer self)
{
	gboolean result;
	result = ___lambda33_ (self);
	return result;
}

static void
__lambda32_ (GnomePieThemeList* self)
{
	Block16Data* _data16_;
	GtkTreeSelection* _tmp0_;
	GtkTreeIter _tmp1_ = {0};
	gboolean _tmp2_;
	_data16_ = g_slice_new0 (Block16Data);
	_data16_->_ref_count_ = 1;
	_data16_->self = g_object_ref (self);
	_tmp0_ = gtk_tree_view_get_selection ((GtkTreeView*) self);
	_tmp2_ = gtk_tree_selection_get_selected (_tmp0_, NULL, &_tmp1_);
	_data16_->active = _tmp1_;
	if (_tmp2_) {
		g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 10, ____lambda33__gsource_func, block16_data_ref (_data16_), block16_data_unref);
	}
	block16_data_unref (_data16_);
	_data16_ = NULL;
}

static void
___lambda32__gtk_tree_selection_changed (GtkTreeSelection* _sender,
                                         gpointer self)
{
	__lambda32_ ((GnomePieThemeList*) self);
}

GnomePieThemeList*
gnome_pie_theme_list_construct (GType object_type)
{
	GnomePieThemeList * self = NULL;
	GtkTreeViewColumn* main_column = NULL;
	GtkTreeViewColumn* _tmp0_;
	GtkCellRendererPixbuf* icon_render = NULL;
	GtkCellRendererPixbuf* _tmp1_;
	GtkCellRendererText* name_render = NULL;
	GtkCellRendererText* _tmp2_;
	GtkTreeSelection* _tmp3_;
	self = (GnomePieThemeList*) g_object_new (object_type, NULL);
	gtk_tree_view_set_headers_visible ((GtkTreeView*) self, TRUE);
	gtk_tree_view_set_grid_lines ((GtkTreeView*) self, GTK_TREE_VIEW_GRID_LINES_NONE);
	gtk_tree_view_set_fixed_height_mode ((GtkTreeView*) self, TRUE);
	_tmp0_ = gtk_tree_view_column_new ();
	g_object_ref_sink (_tmp0_);
	main_column = _tmp0_;
	gtk_tree_view_column_set_title (main_column, _ ("Themes"));
	gtk_tree_view_column_set_sizing (main_column, GTK_TREE_VIEW_COLUMN_FIXED);
	_tmp1_ = (GtkCellRendererPixbuf*) gtk_cell_renderer_pixbuf_new ();
	g_object_ref_sink (_tmp1_);
	icon_render = _tmp1_;
	g_object_set ((GtkCellRenderer*) icon_render, "xpad", (guint) 4, NULL);
	g_object_set ((GtkCellRenderer*) icon_render, "ypad", (guint) 4, NULL);
	gtk_cell_layout_pack_start ((GtkCellLayout*) main_column, (GtkCellRenderer*) icon_render, FALSE);
	_tmp2_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	g_object_ref_sink (_tmp2_);
	name_render = _tmp2_;
	g_object_set ((GtkCellRenderer*) name_render, "xpad", (guint) 6, NULL);
	gtk_cell_layout_pack_start ((GtkCellLayout*) main_column, (GtkCellRenderer*) name_render, TRUE);
	gtk_tree_view_append_column ((GtkTreeView*) self, main_column);
	gtk_cell_layout_add_attribute ((GtkCellLayout*) main_column, (GtkCellRenderer*) icon_render, "pixbuf", (gint) GNOME_PIE_THEME_LIST_DATA_POS_ICON);
	gtk_cell_layout_add_attribute ((GtkCellLayout*) main_column, (GtkCellRenderer*) name_render, "markup", (gint) GNOME_PIE_THEME_LIST_DATA_POS_NAME);
	_tmp3_ = gtk_tree_view_get_selection ((GtkTreeView*) self);
	g_signal_connect_object (_tmp3_, "changed", (GCallback) ___lambda32__gtk_tree_selection_changed, self, 0);
	gnome_pie_theme_list_reload (self);
	_g_object_unref0 (name_render);
	_g_object_unref0 (icon_render);
	_g_object_unref0 (main_column);
	return self;
}

GnomePieThemeList*
gnome_pie_theme_list_new (void)
{
	return gnome_pie_theme_list_construct (GNOME_PIE_TYPE_THEME_LIST);
}

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

static void
__vala_GtkTreePath_free0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (_vala_GtkTreePath_free (var), NULL));
}

static inline void
_g_list_free___vala_GtkTreePath_free0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) __vala_GtkTreePath_free0_);
}

void
gnome_pie_theme_list_reload (GnomePieThemeList* self)
{
	GtkListStore* data = NULL;
	GtkListStore* _tmp0_;
	GtkListStore* _tmp1_;
	GeeArrayList* themes = NULL;
	GnomePieConfig* _tmp2_;
	GnomePieConfig* _tmp3_;
	GeeArrayList* _tmp4_;
	GeeArrayList* _tmp5_;
	GeeArrayList* _tmp6_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_list_store_new (2, gdk_pixbuf_get_type (), G_TYPE_STRING, -1);
	data = _tmp0_;
	_tmp1_ = data;
	gtk_tree_view_set_model ((GtkTreeView*) self, (GtkTreeModel*) _tmp1_);
	_tmp2_ = gnome_pie_config_get_global ();
	_tmp3_ = _tmp2_;
	_tmp4_ = gnome_pie_config_get_themes (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = _g_object_ref0 (_tmp5_);
	themes = _tmp6_;
	{
		GeeArrayList* _theme_list = NULL;
		GeeArrayList* _tmp7_;
		gint _theme_size = 0;
		GeeArrayList* _tmp8_;
		gint _tmp9_;
		gint _tmp10_;
		gint _theme_index = 0;
		_tmp7_ = themes;
		_theme_list = _tmp7_;
		_tmp8_ = _theme_list;
		_tmp9_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp8_);
		_tmp10_ = _tmp9_;
		_theme_size = _tmp10_;
		_theme_index = -1;
		while (TRUE) {
			gint _tmp11_;
			gint _tmp12_;
			GnomePieTheme* theme = NULL;
			GeeArrayList* _tmp13_;
			gpointer _tmp14_;
			GtkTreeIter current = {0};
			GtkListStore* _tmp15_;
			GtkTreeIter _tmp16_ = {0};
			GtkListStore* _tmp17_;
			GtkTreeIter _tmp18_;
			GnomePieTheme* _tmp19_;
			GnomePieIcon* _tmp20_;
			GnomePieIcon* _tmp21_;
			GdkPixbuf* _tmp22_;
			GdkPixbuf* _tmp23_;
			GtkListStore* _tmp24_;
			GtkTreeIter _tmp25_;
			GnomePieTheme* _tmp26_;
			const gchar* _tmp27_;
			const gchar* _tmp28_;
			gchar* _tmp29_;
			gchar* _tmp30_;
			gchar* _tmp31_;
			gchar* _tmp32_;
			gchar* _tmp33_;
			gchar* _tmp34_;
			GnomePieTheme* _tmp35_;
			const gchar* _tmp36_;
			const gchar* _tmp37_;
			gchar* _tmp38_;
			gchar* _tmp39_;
			gchar* _tmp40_;
			gchar* _tmp41_;
			gchar* _tmp42_;
			gchar* _tmp43_;
			gchar* _tmp44_;
			gchar* _tmp45_;
			GnomePieTheme* _tmp46_;
			const gchar* _tmp47_;
			const gchar* _tmp48_;
			gchar* _tmp49_;
			gchar* _tmp50_;
			gchar* _tmp51_;
			gchar* _tmp52_;
			gchar* _tmp53_;
			gchar* _tmp54_;
			gchar* _tmp55_;
			gchar* _tmp56_;
			GnomePieTheme* _tmp57_;
			GnomePieConfig* _tmp58_;
			GnomePieConfig* _tmp59_;
			GnomePieTheme* _tmp60_;
			GnomePieTheme* _tmp61_;
			_theme_index = _theme_index + 1;
			_tmp11_ = _theme_index;
			_tmp12_ = _theme_size;
			if (!(_tmp11_ < _tmp12_)) {
				break;
			}
			_tmp13_ = _theme_list;
			_tmp14_ = gee_abstract_list_get ((GeeAbstractList*) _tmp13_, _theme_index);
			theme = (GnomePieTheme*) _tmp14_;
			_tmp15_ = data;
			gtk_list_store_append (_tmp15_, &_tmp16_);
			current = _tmp16_;
			_tmp17_ = data;
			_tmp18_ = current;
			_tmp19_ = theme;
			_tmp20_ = gnome_pie_theme_get_preview_icon (_tmp19_);
			_tmp21_ = _tmp20_;
			_tmp22_ = gnome_pie_image_to_pixbuf ((GnomePieImage*) _tmp21_);
			_tmp23_ = _tmp22_;
			gtk_list_store_set (_tmp17_, &_tmp18_, GNOME_PIE_THEME_LIST_DATA_POS_ICON, _tmp23_, -1);
			_g_object_unref0 (_tmp23_);
			_tmp24_ = data;
			_tmp25_ = current;
			_tmp26_ = theme;
			_tmp27_ = gnome_pie_theme_get_name (_tmp26_);
			_tmp28_ = _tmp27_;
			_tmp29_ = g_markup_escape_text (_tmp28_, (gssize) -1);
			_tmp30_ = _tmp29_;
			_tmp31_ = g_strconcat (_tmp30_, "\n", NULL);
			_tmp32_ = _tmp31_;
			_tmp33_ = g_strconcat (_tmp32_, "<span font-size='x-small'>", NULL);
			_tmp34_ = _tmp33_;
			_tmp35_ = theme;
			_tmp36_ = gnome_pie_theme_get_description (_tmp35_);
			_tmp37_ = _tmp36_;
			_tmp38_ = g_markup_escape_text (_tmp37_, (gssize) -1);
			_tmp39_ = _tmp38_;
			_tmp40_ = g_strconcat (_tmp34_, _tmp39_, NULL);
			_tmp41_ = _tmp40_;
			_tmp42_ = g_strconcat (_tmp41_, " - <i>", NULL);
			_tmp43_ = _tmp42_;
			_tmp44_ = g_strconcat (_ ("by"), " ", NULL);
			_tmp45_ = _tmp44_;
			_tmp46_ = theme;
			_tmp47_ = gnome_pie_theme_get_author (_tmp46_);
			_tmp48_ = _tmp47_;
			_tmp49_ = g_strconcat (_tmp45_, _tmp48_, NULL);
			_tmp50_ = _tmp49_;
			_tmp51_ = g_markup_escape_text (_tmp50_, (gssize) -1);
			_tmp52_ = _tmp51_;
			_tmp53_ = g_strconcat (_tmp43_, _tmp52_, NULL);
			_tmp54_ = _tmp53_;
			_tmp55_ = g_strconcat (_tmp54_, "</i></span>", NULL);
			_tmp56_ = _tmp55_;
			gtk_list_store_set (_tmp24_, &_tmp25_, GNOME_PIE_THEME_LIST_DATA_POS_NAME, _tmp56_, -1);
			_g_free0 (_tmp56_);
			_g_free0 (_tmp54_);
			_g_free0 (_tmp52_);
			_g_free0 (_tmp50_);
			_g_free0 (_tmp45_);
			_g_free0 (_tmp43_);
			_g_free0 (_tmp41_);
			_g_free0 (_tmp39_);
			_g_free0 (_tmp34_);
			_g_free0 (_tmp32_);
			_g_free0 (_tmp30_);
			_tmp57_ = theme;
			_tmp58_ = gnome_pie_config_get_global ();
			_tmp59_ = _tmp58_;
			_tmp60_ = gnome_pie_config_get_theme (_tmp59_);
			_tmp61_ = _tmp60_;
			if (_tmp57_ == _tmp61_) {
				GtkTreeSelection* _tmp62_;
				GtkTreeIter _tmp63_;
				GtkTreeSelection* _tmp64_;
				GList* _tmp65_;
				GList* _tmp66_;
				gconstpointer _tmp67_;
				_tmp62_ = gtk_tree_view_get_selection ((GtkTreeView*) self);
				_tmp63_ = current;
				gtk_tree_selection_select_iter (_tmp62_, &_tmp63_);
				_tmp64_ = gtk_tree_view_get_selection ((GtkTreeView*) self);
				_tmp65_ = gtk_tree_selection_get_selected_rows (_tmp64_, NULL);
				_tmp66_ = _tmp65_;
				_tmp67_ = g_list_nth_data (_tmp66_, (guint) 0);
				gtk_tree_view_scroll_to_cell ((GtkTreeView*) self, (GtkTreePath*) _tmp67_, NULL, TRUE, 0.5f, 0.5f);
				(_tmp66_ == NULL) ? NULL : (_tmp66_ = (_g_list_free___vala_GtkTreePath_free0_ (_tmp66_), NULL));
			}
			_g_object_unref0 (theme);
		}
	}
	_g_object_unref0 (themes);
	_g_object_unref0 (data);
}

static void
gnome_pie_theme_list_get_active (GnomePieThemeList* self,
                                 GtkTreeIter * result)
{
	GtkTreeIter _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_active;
	*result = _tmp0_;
	return;
}

static void
gnome_pie_theme_list_set_active (GnomePieThemeList* self,
                                 GtkTreeIter * value)
{
	GtkTreeIter _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = *value;
	self->priv->_active = _tmp0_;
}

static void
gnome_pie_theme_list_class_init (GnomePieThemeListClass * klass,
                                 gpointer klass_data)
{
	gnome_pie_theme_list_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GnomePieThemeList_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_gnome_pie_theme_list_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gnome_pie_theme_list_set_property;
	G_OBJECT_CLASS (klass)->finalize = gnome_pie_theme_list_finalize;
	gnome_pie_theme_list_signals[GNOME_PIE_THEME_LIST_ON_SELECT_NEW_SIGNAL] = g_signal_new ("on-select-new", GNOME_PIE_TYPE_THEME_LIST, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
gnome_pie_theme_list_instance_init (GnomePieThemeList * self,
                                    gpointer klass)
{
	self->priv = gnome_pie_theme_list_get_instance_private (self);
}

static void
gnome_pie_theme_list_finalize (GObject * obj)
{
	GnomePieThemeList * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GNOME_PIE_TYPE_THEME_LIST, GnomePieThemeList);
	G_OBJECT_CLASS (gnome_pie_theme_list_parent_class)->finalize (obj);
}

static GType
gnome_pie_theme_list_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GnomePieThemeListClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gnome_pie_theme_list_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GnomePieThemeList), 0, (GInstanceInitFunc) gnome_pie_theme_list_instance_init, NULL };
	GType gnome_pie_theme_list_type_id;
	gnome_pie_theme_list_type_id = g_type_register_static (gtk_tree_view_get_type (), "GnomePieThemeList", &g_define_type_info, 0);
	GnomePieThemeList_private_offset = g_type_add_instance_private (gnome_pie_theme_list_type_id, sizeof (GnomePieThemeListPrivate));
	return gnome_pie_theme_list_type_id;
}

GType
gnome_pie_theme_list_get_type (void)
{
	static volatile gsize gnome_pie_theme_list_type_id__once = 0;
	if (g_once_init_enter (&gnome_pie_theme_list_type_id__once)) {
		GType gnome_pie_theme_list_type_id;
		gnome_pie_theme_list_type_id = gnome_pie_theme_list_get_type_once ();
		g_once_init_leave (&gnome_pie_theme_list_type_id__once, gnome_pie_theme_list_type_id);
	}
	return gnome_pie_theme_list_type_id__once;
}

static void
_vala_gnome_pie_theme_list_get_property (GObject * object,
                                         guint property_id,
                                         GValue * value,
                                         GParamSpec * pspec)
{
	GnomePieThemeList * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GNOME_PIE_TYPE_THEME_LIST, GnomePieThemeList);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gnome_pie_theme_list_set_property (GObject * object,
                                         guint property_id,
                                         const GValue * value,
                                         GParamSpec * pspec)
{
	GnomePieThemeList * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GNOME_PIE_TYPE_THEME_LIST, GnomePieThemeList);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

