/* config.c generated by valac 0.56.19, the Vala compiler
 * generated from config.vala, do not modify */

/*///////////////////////////////////////////////////////////////////////*/
/* Copyright 2011-2021 Simon Schneegans*/
/**/
/* Permission is hereby granted, free of charge, to any person obtaining*/
/* a copy of this software and associated documentation files (the*/
/* "Software"), to deal in the Software without restriction, including*/
/* without limitation the rights to use, copy, modify, merge, publish,*/
/* distribute, sublicense, and/or sell copies of the Software, and to*/
/* permit persons to whom the Software is furnished to do so, subject to*/
/* the following conditions:*/
/* */
/* The above copyright notice and this permission notice shall be*/
/* included in all copies or substantial portions of the Software.*/
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,*/
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF*/
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY*/
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,*/
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE*/
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/
/*///////////////////////////////////////////////////////////////////////*/

#include <glib-object.h>
#include <glib.h>
#include <float.h>
#include <math.h>
#include <gee.h>
#include <libxml/xmlwriter.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gstdio.h>
#include <libxml/parser.h>
#include <libxml/tree.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_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;
typedef struct _GnomePieConfigPrivate GnomePieConfigPrivate;

#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;
enum  {
	GNOME_PIE_CONFIG_0_PROPERTY,
	GNOME_PIE_CONFIG_THEME_PROPERTY,
	GNOME_PIE_CONFIG_REFRESH_RATE_PROPERTY,
	GNOME_PIE_CONFIG_GLOBAL_SCALE_PROPERTY,
	GNOME_PIE_CONFIG_ACTIVATION_RANGE_PROPERTY,
	GNOME_PIE_CONFIG_MAX_VISIBLE_SLICES_PROPERTY,
	GNOME_PIE_CONFIG_SHOW_INDICATOR_PROPERTY,
	GNOME_PIE_CONFIG_SHOW_CAPTIONS_PROPERTY,
	GNOME_PIE_CONFIG_SEARCH_BY_STRING_PROPERTY,
	GNOME_PIE_CONFIG_AUTO_START_PROPERTY,
	GNOME_PIE_CONFIG_SHOWED_NEWS_PROPERTY,
	GNOME_PIE_CONFIG_THEMES_PROPERTY,
	GNOME_PIE_CONFIG_NUM_PROPERTIES
};
static GParamSpec* gnome_pie_config_properties[GNOME_PIE_CONFIG_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _xmlFreeTextWriter0(var) ((var == NULL) ? NULL : (var = (xmlFreeTextWriter (var), NULL)))
#define _xmlFreeDoc0(var) ((var == NULL) ? NULL : (var = (xmlFreeDoc (var), NULL)))
#define _g_dir_close0(var) ((var == NULL) ? NULL : (var = (g_dir_close (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

struct _GnomePieConfig {
	GObject parent_instance;
	GnomePieConfigPrivate * priv;
};

struct _GnomePieConfigClass {
	GObjectClass parent_class;
};

struct _GnomePieConfigPrivate {
	GnomePieTheme* _theme;
	gdouble _refresh_rate;
	gdouble _global_scale;
	gint _activation_range;
	gint _max_visible_slices;
	gboolean _show_indicator;
	gboolean _show_captions;
	gboolean _search_by_string;
	gboolean _auto_start;
	gint _showed_news;
	GeeArrayList* _themes;
};

static gint GnomePieConfig_private_offset;
static gpointer gnome_pie_config_parent_class = NULL;
static GnomePieConfig* gnome_pie_config__instance;
static GnomePieConfig* gnome_pie_config__instance = NULL;

VALA_EXTERN GType gnome_pie_config_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieConfig, g_object_unref)
VALA_EXTERN GType gnome_pie_theme_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieTheme, g_object_unref)
VALA_EXTERN void gnome_pie_config_save (GnomePieConfig* self);
VALA_EXTERN const gchar* gnome_pie_paths_get_settings (void);
VALA_EXTERN GnomePieTheme* gnome_pie_config_get_theme (GnomePieConfig* self);
VALA_EXTERN const gchar* gnome_pie_theme_get_name (GnomePieTheme* self);
VALA_EXTERN gdouble gnome_pie_config_get_refresh_rate (GnomePieConfig* self);
VALA_EXTERN gdouble gnome_pie_config_get_global_scale (GnomePieConfig* self);
VALA_EXTERN gint gnome_pie_config_get_activation_range (GnomePieConfig* self);
VALA_EXTERN gint gnome_pie_config_get_max_visible_slices (GnomePieConfig* self);
VALA_EXTERN gboolean gnome_pie_config_get_show_indicator (GnomePieConfig* self);
VALA_EXTERN gboolean gnome_pie_config_get_show_captions (GnomePieConfig* self);
VALA_EXTERN gboolean gnome_pie_config_get_search_by_string (GnomePieConfig* self);
VALA_EXTERN gint gnome_pie_config_get_showed_news (GnomePieConfig* self);
static void gnome_pie_config_load (GnomePieConfig* self);
VALA_EXTERN const gchar* gnome_pie_paths_get_autostart (void);
VALA_EXTERN void gnome_pie_config_set_auto_start (GnomePieConfig* self,
                                      gboolean value);
VALA_EXTERN void gnome_pie_config_set_refresh_rate (GnomePieConfig* self,
                                        gdouble value);
VALA_EXTERN void gnome_pie_config_set_global_scale (GnomePieConfig* self,
                                        gdouble value);
VALA_EXTERN void gnome_pie_config_set_activation_range (GnomePieConfig* self,
                                            gint value);
VALA_EXTERN void gnome_pie_config_set_max_visible_slices (GnomePieConfig* self,
                                              gint value);
VALA_EXTERN void gnome_pie_config_set_show_indicator (GnomePieConfig* self,
                                          gboolean value);
VALA_EXTERN void gnome_pie_config_set_show_captions (GnomePieConfig* self,
                                         gboolean value);
VALA_EXTERN void gnome_pie_config_set_search_by_string (GnomePieConfig* self,
                                            gboolean value);
VALA_EXTERN void gnome_pie_config_set_showed_news (GnomePieConfig* self,
                                       gint value);
VALA_EXTERN void gnome_pie_config_load_themes (GnomePieConfig* self,
                                   const gchar* current);
static void gnome_pie_config_set_themes (GnomePieConfig* self,
                                  GeeArrayList* value);
VALA_EXTERN const gchar* gnome_pie_paths_get_global_themes (void);
VALA_EXTERN GnomePieTheme* gnome_pie_theme_new (const gchar* dir);
VALA_EXTERN GnomePieTheme* gnome_pie_theme_construct (GType object_type,
                                          const gchar* dir);
VALA_EXTERN gboolean gnome_pie_theme_load (GnomePieTheme* self);
VALA_EXTERN GeeArrayList* gnome_pie_config_get_themes (GnomePieConfig* self);
VALA_EXTERN const gchar* gnome_pie_paths_get_local_themes (void);
VALA_EXTERN void gnome_pie_config_set_theme (GnomePieConfig* self,
                                 GnomePieTheme* value);
VALA_EXTERN void gnome_pie_theme_load_images (GnomePieTheme* self);
VALA_EXTERN gboolean gnome_pie_config_has_theme (GnomePieConfig* self,
                                     const gchar* name);
VALA_EXTERN const gchar* gnome_pie_theme_get_directory (GnomePieTheme* self);
VALA_EXTERN GnomePieConfig* gnome_pie_config_new (void);
VALA_EXTERN GnomePieConfig* gnome_pie_config_construct (GType object_type);
VALA_EXTERN GnomePieConfig* gnome_pie_config_get_global (void);
static void gnome_pie_config_set_global (GnomePieConfig* value);
VALA_EXTERN gboolean gnome_pie_config_get_auto_start (GnomePieConfig* self);
static void gnome_pie_config_finalize (GObject * obj);
static GType gnome_pie_config_get_type_once (void);
static void _vala_gnome_pie_config_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec);
static void _vala_gnome_pie_config_set_property (GObject * object,
                                          guint property_id,
                                          const GValue * value,
                                          GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
gnome_pie_config_get_instance_private (GnomePieConfig* self)
{
	return G_STRUCT_MEMBER_P (self, GnomePieConfig_private_offset);
}

static gchar*
double_to_string (gdouble self)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gint _tmp1__length1;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* result;
	_tmp0_ = g_new0 (gchar, G_ASCII_DTOSTR_BUF_SIZE);
	_tmp1_ = _tmp0_;
	_tmp1__length1 = G_ASCII_DTOSTR_BUF_SIZE;
	_tmp2_ = g_ascii_dtostr (_tmp1_, (gint) G_ASCII_DTOSTR_BUF_SIZE, self);
	_tmp3_ = g_strdup (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp1_ = (g_free (_tmp1_), NULL);
	result = _tmp4_;
	return result;
}

void
gnome_pie_config_save (GnomePieConfig* self)
{
	xmlTextWriter* writer = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	xmlTextWriter* _tmp2_;
	xmlTextWriter* _tmp3_;
	xmlTextWriter* _tmp4_;
	xmlTextWriter* _tmp5_;
	GnomePieTheme* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	xmlTextWriter* _tmp9_;
	gdouble _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	xmlTextWriter* _tmp13_;
	gdouble _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	xmlTextWriter* _tmp17_;
	gint _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	xmlTextWriter* _tmp21_;
	gint _tmp22_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	const gchar* _tmp25_ = NULL;
	gboolean _tmp26_;
	xmlTextWriter* _tmp27_;
	const gchar* _tmp28_ = NULL;
	gboolean _tmp29_;
	xmlTextWriter* _tmp30_;
	const gchar* _tmp31_ = NULL;
	gboolean _tmp32_;
	xmlTextWriter* _tmp33_;
	xmlTextWriter* _tmp34_;
	gint _tmp35_;
	gchar* _tmp36_;
	gchar* _tmp37_;
	xmlTextWriter* _tmp38_;
	xmlTextWriter* _tmp39_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gnome_pie_paths_get_settings ();
	_tmp1_ = _tmp0_;
	_tmp2_ = xmlNewTextWriterFilename (_tmp1_, FALSE);
	writer = _tmp2_;
	_tmp3_ = writer;
	xmlTextWriterStartDocument (_tmp3_, "1.0", NULL, NULL);
	_tmp4_ = writer;
	xmlTextWriterStartElement (_tmp4_, (xmlChar*) "settings");
	_tmp5_ = writer;
	_tmp6_ = self->priv->_theme;
	_tmp7_ = gnome_pie_theme_get_name (_tmp6_);
	_tmp8_ = _tmp7_;
	xmlTextWriterWriteAttribute (_tmp5_, (xmlChar*) "theme", (xmlChar*) _tmp8_);
	_tmp9_ = writer;
	_tmp10_ = self->priv->_refresh_rate;
	_tmp11_ = double_to_string (_tmp10_);
	_tmp12_ = _tmp11_;
	xmlTextWriterWriteAttribute (_tmp9_, (xmlChar*) "refresh_rate", (xmlChar*) _tmp12_);
	_g_free0 (_tmp12_);
	_tmp13_ = writer;
	_tmp14_ = self->priv->_global_scale;
	_tmp15_ = double_to_string (_tmp14_);
	_tmp16_ = _tmp15_;
	xmlTextWriterWriteAttribute (_tmp13_, (xmlChar*) "global_scale", (xmlChar*) _tmp16_);
	_g_free0 (_tmp16_);
	_tmp17_ = writer;
	_tmp18_ = self->priv->_activation_range;
	_tmp19_ = g_strdup_printf ("%i", _tmp18_);
	_tmp20_ = _tmp19_;
	xmlTextWriterWriteAttribute (_tmp17_, (xmlChar*) "activation_range", (xmlChar*) _tmp20_);
	_g_free0 (_tmp20_);
	_tmp21_ = writer;
	_tmp22_ = self->priv->_max_visible_slices;
	_tmp23_ = g_strdup_printf ("%i", _tmp22_);
	_tmp24_ = _tmp23_;
	xmlTextWriterWriteAttribute (_tmp21_, (xmlChar*) "max_visible_slices", (xmlChar*) _tmp24_);
	_g_free0 (_tmp24_);
	_tmp26_ = self->priv->_show_indicator;
	if (_tmp26_) {
		_tmp25_ = "true";
	} else {
		_tmp25_ = "false";
	}
	_tmp27_ = writer;
	xmlTextWriterWriteAttribute (_tmp27_, (xmlChar*) "show_indicator", (xmlChar*) _tmp25_);
	_tmp29_ = self->priv->_show_captions;
	if (_tmp29_) {
		_tmp28_ = "true";
	} else {
		_tmp28_ = "false";
	}
	_tmp30_ = writer;
	xmlTextWriterWriteAttribute (_tmp30_, (xmlChar*) "show_captions", (xmlChar*) _tmp28_);
	_tmp32_ = self->priv->_search_by_string;
	if (_tmp32_) {
		_tmp31_ = "true";
	} else {
		_tmp31_ = "false";
	}
	_tmp33_ = writer;
	xmlTextWriterWriteAttribute (_tmp33_, (xmlChar*) "search_by_string", (xmlChar*) _tmp31_);
	_tmp34_ = writer;
	_tmp35_ = self->priv->_showed_news;
	_tmp36_ = g_strdup_printf ("%i", _tmp35_);
	_tmp37_ = _tmp36_;
	xmlTextWriterWriteAttribute (_tmp34_, (xmlChar*) "showed_news", (xmlChar*) _tmp37_);
	_g_free0 (_tmp37_);
	_tmp38_ = writer;
	xmlTextWriterEndElement (_tmp38_);
	_tmp39_ = writer;
	xmlTextWriterEndDocument (_tmp39_);
	_xmlFreeTextWriter0 (writer);
}

static gdouble
double_parse (const gchar* str)
{
	gdouble result;
	g_return_val_if_fail (str != NULL, -1.0);
	result = g_ascii_strtod (str, NULL);
	return result;
}

static gboolean
bool_parse (const gchar* str)
{
	gboolean result;
	g_return_val_if_fail (str != NULL, FALSE);
	if (g_strcmp0 (str, "true") == 0) {
		result = TRUE;
		return result;
	} else {
		result = FALSE;
		return result;
	}
}

static void
gnome_pie_config_load (GnomePieConfig* self)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	xmlDoc* settingsXML = NULL;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	xmlDoc* _tmp4_;
	gboolean error_occrured = FALSE;
	gchar* theme_name = NULL;
	gchar* _tmp5_;
	xmlDoc* _tmp6_;
	const gchar* _tmp46_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gnome_pie_paths_get_autostart ();
	_tmp1_ = _tmp0_;
	gnome_pie_config_set_auto_start (self, g_file_test (_tmp1_, G_FILE_TEST_EXISTS));
	xmlInitParser ();
	_tmp2_ = gnome_pie_paths_get_settings ();
	_tmp3_ = _tmp2_;
	_tmp4_ = xmlParseFile (_tmp3_);
	settingsXML = _tmp4_;
	error_occrured = FALSE;
	_tmp5_ = g_strdup ("");
	theme_name = _tmp5_;
	_tmp6_ = settingsXML;
	if (_tmp6_ != NULL) {
		xmlNode* root = NULL;
		xmlDoc* _tmp7_;
		xmlNode* _tmp8_;
		xmlNode* _tmp9_;
		xmlDoc* _tmp45_;
		_tmp7_ = settingsXML;
		_tmp8_ = xmlDocGetRootElement (_tmp7_);
		root = _tmp8_;
		_tmp9_ = root;
		if (_tmp9_ != NULL) {
			{
				xmlAttr* attribute = NULL;
				xmlNode* _tmp10_;
				xmlAttr* _tmp11_;
				_tmp10_ = root;
				_tmp11_ = _tmp10_->properties;
				attribute = _tmp11_;
				{
					gboolean _tmp12_ = FALSE;
					_tmp12_ = TRUE;
					while (TRUE) {
						xmlAttr* _tmp15_;
						gchar* attr_name = NULL;
						xmlAttr* _tmp16_;
						const gchar* _tmp17_;
						gchar* _tmp18_;
						gchar* attr_content = NULL;
						xmlAttr* _tmp19_;
						xmlNode* _tmp20_;
						const gchar* _tmp21_;
						gchar* _tmp22_;
						const gchar* _tmp23_;
						const gchar* _tmp24_;
						GQuark _tmp26_ = 0U;
						static GQuark _tmp25_label0 = 0;
						static GQuark _tmp25_label1 = 0;
						static GQuark _tmp25_label2 = 0;
						static GQuark _tmp25_label3 = 0;
						static GQuark _tmp25_label4 = 0;
						static GQuark _tmp25_label5 = 0;
						static GQuark _tmp25_label6 = 0;
						static GQuark _tmp25_label7 = 0;
						static GQuark _tmp25_label8 = 0;
						if (!_tmp12_) {
							xmlAttr* _tmp13_;
							xmlAttr* _tmp14_;
							_tmp13_ = attribute;
							_tmp14_ = _tmp13_->next;
							attribute = _tmp14_;
						}
						_tmp12_ = FALSE;
						_tmp15_ = attribute;
						if (!(_tmp15_ != NULL)) {
							break;
						}
						_tmp16_ = attribute;
						_tmp17_ = _tmp16_->name;
						_tmp18_ = g_utf8_strdown (_tmp17_, (gssize) -1);
						attr_name = _tmp18_;
						_tmp19_ = attribute;
						_tmp20_ = _tmp19_->children;
						_tmp21_ = _tmp20_->content;
						_tmp22_ = g_strdup (_tmp21_);
						attr_content = _tmp22_;
						_tmp23_ = attr_name;
						_tmp24_ = _tmp23_;
						_tmp26_ = (NULL == _tmp24_) ? 0 : g_quark_from_string (_tmp24_);
						if (_tmp26_ == ((0 != _tmp25_label0) ? _tmp25_label0 : (_tmp25_label0 = g_quark_from_static_string ("theme")))) {
							switch (0) {
								default:
								{
									const gchar* _tmp27_;
									gchar* _tmp28_;
									_tmp27_ = attr_content;
									_tmp28_ = g_strdup (_tmp27_);
									_g_free0 (theme_name);
									theme_name = _tmp28_;
									break;
								}
							}
						} else if (_tmp26_ == ((0 != _tmp25_label1) ? _tmp25_label1 : (_tmp25_label1 = g_quark_from_static_string ("refresh_rate")))) {
							switch (0) {
								default:
								{
									const gchar* _tmp29_;
									_tmp29_ = attr_content;
									gnome_pie_config_set_refresh_rate (self, double_parse (_tmp29_));
									break;
								}
							}
						} else if (_tmp26_ == ((0 != _tmp25_label2) ? _tmp25_label2 : (_tmp25_label2 = g_quark_from_static_string ("global_scale")))) {
							switch (0) {
								default:
								{
									const gchar* _tmp30_;
									gdouble _tmp31_;
									_tmp30_ = attr_content;
									gnome_pie_config_set_global_scale (self, double_parse (_tmp30_));
									_tmp31_ = self->priv->_global_scale;
									CLAMP (_tmp31_, 0.5, 2.0);
									break;
								}
							}
						} else if (_tmp26_ == ((0 != _tmp25_label3) ? _tmp25_label3 : (_tmp25_label3 = g_quark_from_static_string ("activation_range")))) {
							switch (0) {
								default:
								{
									const gchar* _tmp32_;
									gint _tmp33_;
									_tmp32_ = attr_content;
									gnome_pie_config_set_activation_range (self, atoi (_tmp32_));
									_tmp33_ = self->priv->_activation_range;
									CLAMP (_tmp33_, 0, 2000);
									break;
								}
							}
						} else if (_tmp26_ == ((0 != _tmp25_label4) ? _tmp25_label4 : (_tmp25_label4 = g_quark_from_static_string ("max_visible_slices")))) {
							switch (0) {
								default:
								{
									const gchar* _tmp34_;
									gint _tmp35_;
									_tmp34_ = attr_content;
									gnome_pie_config_set_max_visible_slices (self, atoi (_tmp34_));
									_tmp35_ = self->priv->_max_visible_slices;
									CLAMP (_tmp35_, 10, 2000);
									break;
								}
							}
						} else if (_tmp26_ == ((0 != _tmp25_label5) ? _tmp25_label5 : (_tmp25_label5 = g_quark_from_static_string ("show_indicator")))) {
							switch (0) {
								default:
								{
									const gchar* _tmp36_;
									_tmp36_ = attr_content;
									gnome_pie_config_set_show_indicator (self, bool_parse (_tmp36_));
									break;
								}
							}
						} else if (_tmp26_ == ((0 != _tmp25_label6) ? _tmp25_label6 : (_tmp25_label6 = g_quark_from_static_string ("show_captions")))) {
							switch (0) {
								default:
								{
									const gchar* _tmp37_;
									_tmp37_ = attr_content;
									gnome_pie_config_set_show_captions (self, bool_parse (_tmp37_));
									break;
								}
							}
						} else if (_tmp26_ == ((0 != _tmp25_label7) ? _tmp25_label7 : (_tmp25_label7 = g_quark_from_static_string ("search_by_string")))) {
							switch (0) {
								default:
								{
									const gchar* _tmp38_;
									_tmp38_ = attr_content;
									gnome_pie_config_set_search_by_string (self, bool_parse (_tmp38_));
									break;
								}
							}
						} else if (_tmp26_ == ((0 != _tmp25_label8) ? _tmp25_label8 : (_tmp25_label8 = g_quark_from_static_string ("showed_news")))) {
							switch (0) {
								default:
								{
									const gchar* _tmp39_;
									_tmp39_ = attr_content;
									gnome_pie_config_set_showed_news (self, atoi (_tmp39_));
									break;
								}
							}
						} else {
							switch (0) {
								default:
								{
									const gchar* _tmp40_;
									gchar* _tmp41_;
									gchar* _tmp42_;
									gchar* _tmp43_;
									gchar* _tmp44_;
									_tmp40_ = attr_name;
									_tmp41_ = g_strconcat ("Invalid setting \"", _tmp40_, NULL);
									_tmp42_ = _tmp41_;
									_tmp43_ = g_strconcat (_tmp42_, "\" in gnome-pie.conf!", NULL);
									_tmp44_ = _tmp43_;
									g_warning ("config.vala:149: %s", _tmp44_);
									_g_free0 (_tmp44_);
									_g_free0 (_tmp42_);
									break;
								}
							}
						}
						_g_free0 (attr_content);
						_g_free0 (attr_name);
					}
				}
			}
			xmlCleanupParser ();
		} else {
			g_warning ("config.vala:157: Error loading settings: gnome-pie.conf is empty! Usin" \
"g defaults...");
			error_occrured = TRUE;
		}
		_tmp45_ = settingsXML;
		_xmlFreeDoc0 (_tmp45_);
	} else {
		g_warning ("config.vala:164: Error loading settings: gnome-pie.conf not found! Usi" \
"ng defaults...");
		error_occrured = TRUE;
	}
	_tmp46_ = theme_name;
	gnome_pie_config_load_themes (self, _tmp46_);
	if (error_occrured) {
		gnome_pie_config_save (self);
	}
	_g_free0 (theme_name);
}

void
gnome_pie_config_load_themes (GnomePieConfig* self,
                              const gchar* current)
{
	GeeArrayList* _tmp0_;
	GeeArrayList* _tmp1_;
	GeeArrayList* _tmp44_;
	gint _tmp45_;
	gint _tmp46_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (current != NULL);
	_tmp0_ = gee_array_list_new (GNOME_PIE_TYPE_THEME, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	_tmp1_ = _tmp0_;
	gnome_pie_config_set_themes (self, _tmp1_);
	_g_object_unref0 (_tmp1_);
	{
		gchar* name = NULL;
		GDir* d = NULL;
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		GDir* _tmp4_;
		GDir* _tmp21_ = NULL;
		const gchar* _tmp22_;
		const gchar* _tmp23_;
		GDir* _tmp24_;
		GDir* _tmp25_;
		_tmp2_ = gnome_pie_paths_get_global_themes ();
		_tmp3_ = _tmp2_;
		_tmp4_ = g_dir_open (_tmp3_, (guint) 0, &_inner_error0_);
		d = _tmp4_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_free0 (name);
			goto __catch0_g_error;
		}
		while (TRUE) {
			GDir* _tmp5_;
			const gchar* _tmp6_;
			gchar* _tmp7_;
			const gchar* _tmp8_;
			GnomePieTheme* new_theme = NULL;
			const gchar* _tmp9_;
			const gchar* _tmp10_;
			gchar* _tmp11_;
			gchar* _tmp12_;
			const gchar* _tmp13_;
			gchar* _tmp14_;
			gchar* _tmp15_;
			GnomePieTheme* _tmp16_;
			GnomePieTheme* _tmp17_;
			GnomePieTheme* _tmp18_;
			_tmp5_ = d;
			_tmp6_ = g_dir_read_name (_tmp5_);
			_tmp7_ = g_strdup (_tmp6_);
			_g_free0 (name);
			name = _tmp7_;
			_tmp8_ = name;
			if (!(_tmp8_ != NULL)) {
				break;
			}
			_tmp9_ = gnome_pie_paths_get_global_themes ();
			_tmp10_ = _tmp9_;
			_tmp11_ = g_strconcat (_tmp10_, "/", NULL);
			_tmp12_ = _tmp11_;
			_tmp13_ = name;
			_tmp14_ = g_strconcat (_tmp12_, _tmp13_, NULL);
			_tmp15_ = _tmp14_;
			_tmp16_ = gnome_pie_theme_new (_tmp15_);
			_tmp17_ = _tmp16_;
			_g_free0 (_tmp15_);
			_g_free0 (_tmp12_);
			new_theme = _tmp17_;
			_tmp18_ = new_theme;
			if (gnome_pie_theme_load (_tmp18_)) {
				GeeArrayList* _tmp19_;
				GnomePieTheme* _tmp20_;
				_tmp19_ = self->priv->_themes;
				_tmp20_ = new_theme;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp19_, _tmp20_);
			}
			_g_object_unref0 (new_theme);
		}
		_tmp22_ = gnome_pie_paths_get_local_themes ();
		_tmp23_ = _tmp22_;
		_tmp24_ = g_dir_open (_tmp23_, (guint) 0, &_inner_error0_);
		_tmp21_ = _tmp24_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_dir_close0 (d);
			_g_free0 (name);
			goto __catch0_g_error;
		}
		_tmp25_ = _tmp21_;
		_tmp21_ = NULL;
		_g_dir_close0 (d);
		d = _tmp25_;
		while (TRUE) {
			GDir* _tmp26_;
			const gchar* _tmp27_;
			gchar* _tmp28_;
			const gchar* _tmp29_;
			GnomePieTheme* new_theme = NULL;
			const gchar* _tmp30_;
			const gchar* _tmp31_;
			gchar* _tmp32_;
			gchar* _tmp33_;
			const gchar* _tmp34_;
			gchar* _tmp35_;
			gchar* _tmp36_;
			GnomePieTheme* _tmp37_;
			GnomePieTheme* _tmp38_;
			GnomePieTheme* _tmp39_;
			_tmp26_ = d;
			_tmp27_ = g_dir_read_name (_tmp26_);
			_tmp28_ = g_strdup (_tmp27_);
			_g_free0 (name);
			name = _tmp28_;
			_tmp29_ = name;
			if (!(_tmp29_ != NULL)) {
				break;
			}
			_tmp30_ = gnome_pie_paths_get_local_themes ();
			_tmp31_ = _tmp30_;
			_tmp32_ = g_strconcat (_tmp31_, "/", NULL);
			_tmp33_ = _tmp32_;
			_tmp34_ = name;
			_tmp35_ = g_strconcat (_tmp33_, _tmp34_, NULL);
			_tmp36_ = _tmp35_;
			_tmp37_ = gnome_pie_theme_new (_tmp36_);
			_tmp38_ = _tmp37_;
			_g_free0 (_tmp36_);
			_g_free0 (_tmp33_);
			new_theme = _tmp38_;
			_tmp39_ = new_theme;
			if (gnome_pie_theme_load (_tmp39_)) {
				GeeArrayList* _tmp40_;
				GnomePieTheme* _tmp41_;
				_tmp40_ = self->priv->_themes;
				_tmp41_ = new_theme;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp40_, _tmp41_);
			}
			_g_object_unref0 (new_theme);
		}
		_g_dir_close0 (_tmp21_);
		_g_dir_close0 (d);
		_g_free0 (name);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp42_;
		const gchar* _tmp43_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp42_ = e;
		_tmp43_ = _tmp42_->message;
		g_warning ("config.vala:204: %s", _tmp43_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_tmp44_ = self->priv->_themes;
	_tmp45_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp44_);
	_tmp46_ = _tmp45_;
	if (_tmp46_ > 0) {
		GnomePieTheme* _tmp59_;
		GnomePieTheme* _tmp67_;
		if (g_strcmp0 (current, "") == 0) {
			current = "Adwaita";
			g_warning ("config.vala:210: No theme specified! Using default...");
		}
		{
			GeeArrayList* _t_list = NULL;
			GeeArrayList* _tmp47_;
			gint _t_size = 0;
			GeeArrayList* _tmp48_;
			gint _tmp49_;
			gint _tmp50_;
			gint _t_index = 0;
			_tmp47_ = self->priv->_themes;
			_t_list = _tmp47_;
			_tmp48_ = _t_list;
			_tmp49_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp48_);
			_tmp50_ = _tmp49_;
			_t_size = _tmp50_;
			_t_index = -1;
			while (TRUE) {
				gint _tmp51_;
				gint _tmp52_;
				GnomePieTheme* t = NULL;
				GeeArrayList* _tmp53_;
				gpointer _tmp54_;
				GnomePieTheme* _tmp55_;
				const gchar* _tmp56_;
				const gchar* _tmp57_;
				_t_index = _t_index + 1;
				_tmp51_ = _t_index;
				_tmp52_ = _t_size;
				if (!(_tmp51_ < _tmp52_)) {
					break;
				}
				_tmp53_ = _t_list;
				_tmp54_ = gee_abstract_list_get ((GeeAbstractList*) _tmp53_, _t_index);
				t = (GnomePieTheme*) _tmp54_;
				_tmp55_ = t;
				_tmp56_ = gnome_pie_theme_get_name (_tmp55_);
				_tmp57_ = _tmp56_;
				if (g_strcmp0 (_tmp57_, current) == 0) {
					GnomePieTheme* _tmp58_;
					_tmp58_ = t;
					gnome_pie_config_set_theme (self, _tmp58_);
					_g_object_unref0 (t);
					break;
				}
				_g_object_unref0 (t);
			}
		}
		_tmp59_ = self->priv->_theme;
		if (_tmp59_ == NULL) {
			GeeArrayList* _tmp60_;
			gpointer _tmp61_;
			GnomePieTheme* _tmp62_;
			gchar* _tmp63_;
			gchar* _tmp64_;
			gchar* _tmp65_;
			gchar* _tmp66_;
			_tmp60_ = self->priv->_themes;
			_tmp61_ = gee_abstract_list_get ((GeeAbstractList*) _tmp60_, 0);
			_tmp62_ = (GnomePieTheme*) _tmp61_;
			gnome_pie_config_set_theme (self, _tmp62_);
			_g_object_unref0 (_tmp62_);
			_tmp63_ = g_strconcat ("Theme \"", current, NULL);
			_tmp64_ = _tmp63_;
			_tmp65_ = g_strconcat (_tmp64_, "\" not found! Using fallback...", NULL);
			_tmp66_ = _tmp65_;
			g_warning ("config.vala:220: %s", _tmp66_);
			_g_free0 (_tmp66_);
			_g_free0 (_tmp64_);
		}
		_tmp67_ = self->priv->_theme;
		gnome_pie_theme_load_images (_tmp67_);
	} else {
		g_error ("config.vala:224: No theme found!");
	}
}

gboolean
gnome_pie_config_has_theme (GnomePieConfig* self,
                            const gchar* name)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (name != NULL, FALSE);
	{
		GeeArrayList* _theme_list = NULL;
		GeeArrayList* _tmp0_;
		gint _theme_size = 0;
		GeeArrayList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		gint _theme_index = 0;
		_tmp0_ = self->priv->_themes;
		_theme_list = _tmp0_;
		_tmp1_ = _theme_list;
		_tmp2_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp1_);
		_tmp3_ = _tmp2_;
		_theme_size = _tmp3_;
		_theme_index = -1;
		while (TRUE) {
			gint _tmp4_;
			gint _tmp5_;
			GnomePieTheme* theme = NULL;
			GeeArrayList* _tmp6_;
			gpointer _tmp7_;
			gboolean _tmp8_ = FALSE;
			GnomePieTheme* _tmp9_;
			const gchar* _tmp10_;
			const gchar* _tmp11_;
			_theme_index = _theme_index + 1;
			_tmp4_ = _theme_index;
			_tmp5_ = _theme_size;
			if (!(_tmp4_ < _tmp5_)) {
				break;
			}
			_tmp6_ = _theme_list;
			_tmp7_ = gee_abstract_list_get ((GeeAbstractList*) _tmp6_, _theme_index);
			theme = (GnomePieTheme*) _tmp7_;
			_tmp9_ = theme;
			_tmp10_ = gnome_pie_theme_get_name (_tmp9_);
			_tmp11_ = _tmp10_;
			if (g_strcmp0 (_tmp11_, name) == 0) {
				_tmp8_ = TRUE;
			} else {
				GnomePieTheme* _tmp12_;
				const gchar* _tmp13_;
				const gchar* _tmp14_;
				_tmp12_ = theme;
				_tmp13_ = gnome_pie_theme_get_directory (_tmp12_);
				_tmp14_ = _tmp13_;
				_tmp8_ = g_str_has_suffix (_tmp14_, name);
			}
			if (_tmp8_) {
				result = TRUE;
				_g_object_unref0 (theme);
				return result;
			}
			_g_object_unref0 (theme);
		}
	}
	result = FALSE;
	return result;
}

GnomePieConfig*
gnome_pie_config_construct (GType object_type)
{
	GnomePieConfig * self = NULL;
	self = (GnomePieConfig*) g_object_new (object_type, NULL);
	return self;
}

GnomePieConfig*
gnome_pie_config_new (void)
{
	return gnome_pie_config_construct (GNOME_PIE_TYPE_CONFIG);
}

GnomePieConfig*
gnome_pie_config_get_global (void)
{
	GnomePieConfig* result;
	GnomePieConfig* _tmp0_;
	GnomePieConfig* _tmp3_;
	_tmp0_ = gnome_pie_config__instance;
	if (_tmp0_ == NULL) {
		GnomePieConfig* _tmp1_;
		GnomePieConfig* _tmp2_;
		_tmp1_ = gnome_pie_config_new ();
		_g_object_unref0 (gnome_pie_config__instance);
		gnome_pie_config__instance = _tmp1_;
		_tmp2_ = gnome_pie_config__instance;
		gnome_pie_config_load (_tmp2_);
	}
	_tmp3_ = gnome_pie_config__instance;
	result = _tmp3_;
	return result;
}

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

static void
gnome_pie_config_set_global (GnomePieConfig* value)
{
	GnomePieConfig* _tmp0_;
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (gnome_pie_config__instance);
	gnome_pie_config__instance = _tmp0_;
}

GnomePieTheme*
gnome_pie_config_get_theme (GnomePieConfig* self)
{
	GnomePieTheme* result;
	GnomePieTheme* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_theme;
	result = _tmp0_;
	return result;
}

void
gnome_pie_config_set_theme (GnomePieConfig* self,
                            GnomePieTheme* value)
{
	GnomePieTheme* old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_config_get_theme (self);
	if (old_value != value) {
		GnomePieTheme* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_theme);
		self->priv->_theme = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_config_properties[GNOME_PIE_CONFIG_THEME_PROPERTY]);
	}
}

gdouble
gnome_pie_config_get_refresh_rate (GnomePieConfig* self)
{
	gdouble result;
	g_return_val_if_fail (self != NULL, -1.0);
	result = self->priv->_refresh_rate;
	return result;
}

void
gnome_pie_config_set_refresh_rate (GnomePieConfig* self,
                                   gdouble value)
{
	gdouble old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_config_get_refresh_rate (self);
	if (old_value != value) {
		self->priv->_refresh_rate = value;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_config_properties[GNOME_PIE_CONFIG_REFRESH_RATE_PROPERTY]);
	}
}

gdouble
gnome_pie_config_get_global_scale (GnomePieConfig* self)
{
	gdouble result;
	g_return_val_if_fail (self != NULL, -1.0);
	result = self->priv->_global_scale;
	return result;
}

void
gnome_pie_config_set_global_scale (GnomePieConfig* self,
                                   gdouble value)
{
	gdouble old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_config_get_global_scale (self);
	if (old_value != value) {
		self->priv->_global_scale = value;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_config_properties[GNOME_PIE_CONFIG_GLOBAL_SCALE_PROPERTY]);
	}
}

gint
gnome_pie_config_get_activation_range (GnomePieConfig* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_activation_range;
	return result;
}

void
gnome_pie_config_set_activation_range (GnomePieConfig* self,
                                       gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_config_get_activation_range (self);
	if (old_value != value) {
		self->priv->_activation_range = value;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_config_properties[GNOME_PIE_CONFIG_ACTIVATION_RANGE_PROPERTY]);
	}
}

gint
gnome_pie_config_get_max_visible_slices (GnomePieConfig* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_max_visible_slices;
	return result;
}

void
gnome_pie_config_set_max_visible_slices (GnomePieConfig* self,
                                         gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_config_get_max_visible_slices (self);
	if (old_value != value) {
		self->priv->_max_visible_slices = value;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_config_properties[GNOME_PIE_CONFIG_MAX_VISIBLE_SLICES_PROPERTY]);
	}
}

gboolean
gnome_pie_config_get_show_indicator (GnomePieConfig* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_show_indicator;
	return result;
}

void
gnome_pie_config_set_show_indicator (GnomePieConfig* self,
                                     gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_config_get_show_indicator (self);
	if (old_value != value) {
		self->priv->_show_indicator = value;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_config_properties[GNOME_PIE_CONFIG_SHOW_INDICATOR_PROPERTY]);
	}
}

gboolean
gnome_pie_config_get_show_captions (GnomePieConfig* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_show_captions;
	return result;
}

void
gnome_pie_config_set_show_captions (GnomePieConfig* self,
                                    gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_config_get_show_captions (self);
	if (old_value != value) {
		self->priv->_show_captions = value;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_config_properties[GNOME_PIE_CONFIG_SHOW_CAPTIONS_PROPERTY]);
	}
}

gboolean
gnome_pie_config_get_search_by_string (GnomePieConfig* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_search_by_string;
	return result;
}

void
gnome_pie_config_set_search_by_string (GnomePieConfig* self,
                                       gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_config_get_search_by_string (self);
	if (old_value != value) {
		self->priv->_search_by_string = value;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_config_properties[GNOME_PIE_CONFIG_SEARCH_BY_STRING_PROPERTY]);
	}
}

gboolean
gnome_pie_config_get_auto_start (GnomePieConfig* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_auto_start;
	return result;
}

void
gnome_pie_config_set_auto_start (GnomePieConfig* self,
                                 gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_config_get_auto_start (self);
	if (old_value != value) {
		self->priv->_auto_start = value;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_config_properties[GNOME_PIE_CONFIG_AUTO_START_PROPERTY]);
	}
}

gint
gnome_pie_config_get_showed_news (GnomePieConfig* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_showed_news;
	return result;
}

void
gnome_pie_config_set_showed_news (GnomePieConfig* self,
                                  gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_config_get_showed_news (self);
	if (old_value != value) {
		self->priv->_showed_news = value;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_config_properties[GNOME_PIE_CONFIG_SHOWED_NEWS_PROPERTY]);
	}
}

GeeArrayList*
gnome_pie_config_get_themes (GnomePieConfig* self)
{
	GeeArrayList* result;
	GeeArrayList* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_themes;
	result = _tmp0_;
	return result;
}

static void
gnome_pie_config_set_themes (GnomePieConfig* self,
                             GeeArrayList* value)
{
	GeeArrayList* old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_config_get_themes (self);
	if (old_value != value) {
		GeeArrayList* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_themes);
		self->priv->_themes = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_config_properties[GNOME_PIE_CONFIG_THEMES_PROPERTY]);
	}
}

static void
gnome_pie_config_class_init (GnomePieConfigClass * klass,
                             gpointer klass_data)
{
	gnome_pie_config_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GnomePieConfig_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_gnome_pie_config_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gnome_pie_config_set_property;
	G_OBJECT_CLASS (klass)->finalize = gnome_pie_config_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_CONFIG_THEME_PROPERTY, gnome_pie_config_properties[GNOME_PIE_CONFIG_THEME_PROPERTY] = g_param_spec_object ("theme", "theme", "theme", GNOME_PIE_TYPE_THEME, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_CONFIG_REFRESH_RATE_PROPERTY, gnome_pie_config_properties[GNOME_PIE_CONFIG_REFRESH_RATE_PROPERTY] = g_param_spec_double ("refresh-rate", "refresh-rate", "refresh-rate", -G_MAXDOUBLE, G_MAXDOUBLE, 60.0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_CONFIG_GLOBAL_SCALE_PROPERTY, gnome_pie_config_properties[GNOME_PIE_CONFIG_GLOBAL_SCALE_PROPERTY] = g_param_spec_double ("global-scale", "global-scale", "global-scale", -G_MAXDOUBLE, G_MAXDOUBLE, 1.0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_CONFIG_ACTIVATION_RANGE_PROPERTY, gnome_pie_config_properties[GNOME_PIE_CONFIG_ACTIVATION_RANGE_PROPERTY] = g_param_spec_int ("activation-range", "activation-range", "activation-range", G_MININT, G_MAXINT, 200, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_CONFIG_MAX_VISIBLE_SLICES_PROPERTY, gnome_pie_config_properties[GNOME_PIE_CONFIG_MAX_VISIBLE_SLICES_PROPERTY] = g_param_spec_int ("max-visible-slices", "max-visible-slices", "max-visible-slices", G_MININT, G_MAXINT, 24, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_CONFIG_SHOW_INDICATOR_PROPERTY, gnome_pie_config_properties[GNOME_PIE_CONFIG_SHOW_INDICATOR_PROPERTY] = g_param_spec_boolean ("show-indicator", "show-indicator", "show-indicator", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_CONFIG_SHOW_CAPTIONS_PROPERTY, gnome_pie_config_properties[GNOME_PIE_CONFIG_SHOW_CAPTIONS_PROPERTY] = g_param_spec_boolean ("show-captions", "show-captions", "show-captions", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_CONFIG_SEARCH_BY_STRING_PROPERTY, gnome_pie_config_properties[GNOME_PIE_CONFIG_SEARCH_BY_STRING_PROPERTY] = g_param_spec_boolean ("search-by-string", "search-by-string", "search-by-string", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_CONFIG_AUTO_START_PROPERTY, gnome_pie_config_properties[GNOME_PIE_CONFIG_AUTO_START_PROPERTY] = g_param_spec_boolean ("auto-start", "auto-start", "auto-start", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_CONFIG_SHOWED_NEWS_PROPERTY, gnome_pie_config_properties[GNOME_PIE_CONFIG_SHOWED_NEWS_PROPERTY] = g_param_spec_int ("showed-news", "showed-news", "showed-news", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_CONFIG_THEMES_PROPERTY, gnome_pie_config_properties[GNOME_PIE_CONFIG_THEMES_PROPERTY] = g_param_spec_object ("themes", "themes", "themes", GEE_TYPE_ARRAY_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
gnome_pie_config_instance_init (GnomePieConfig * self,
                                gpointer klass)
{
	self->priv = gnome_pie_config_get_instance_private (self);
	self->priv->_refresh_rate = 60.0;
	self->priv->_global_scale = 1.0;
	self->priv->_activation_range = 200;
	self->priv->_max_visible_slices = 24;
	self->priv->_show_indicator = TRUE;
	self->priv->_show_captions = FALSE;
	self->priv->_search_by_string = TRUE;
	self->priv->_auto_start = FALSE;
	self->priv->_showed_news = 0;
}

static void
gnome_pie_config_finalize (GObject * obj)
{
	GnomePieConfig * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GNOME_PIE_TYPE_CONFIG, GnomePieConfig);
	_g_object_unref0 (self->priv->_theme);
	_g_object_unref0 (self->priv->_themes);
	G_OBJECT_CLASS (gnome_pie_config_parent_class)->finalize (obj);
}

static GType
gnome_pie_config_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GnomePieConfigClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gnome_pie_config_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GnomePieConfig), 0, (GInstanceInitFunc) gnome_pie_config_instance_init, NULL };
	GType gnome_pie_config_type_id;
	gnome_pie_config_type_id = g_type_register_static (G_TYPE_OBJECT, "GnomePieConfig", &g_define_type_info, 0);
	GnomePieConfig_private_offset = g_type_add_instance_private (gnome_pie_config_type_id, sizeof (GnomePieConfigPrivate));
	return gnome_pie_config_type_id;
}

GType
gnome_pie_config_get_type (void)
{
	static volatile gsize gnome_pie_config_type_id__once = 0;
	if (g_once_init_enter (&gnome_pie_config_type_id__once)) {
		GType gnome_pie_config_type_id;
		gnome_pie_config_type_id = gnome_pie_config_get_type_once ();
		g_once_init_leave (&gnome_pie_config_type_id__once, gnome_pie_config_type_id);
	}
	return gnome_pie_config_type_id__once;
}

static void
_vala_gnome_pie_config_get_property (GObject * object,
                                     guint property_id,
                                     GValue * value,
                                     GParamSpec * pspec)
{
	GnomePieConfig * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GNOME_PIE_TYPE_CONFIG, GnomePieConfig);
	switch (property_id) {
		case GNOME_PIE_CONFIG_THEME_PROPERTY:
		g_value_set_object (value, gnome_pie_config_get_theme (self));
		break;
		case GNOME_PIE_CONFIG_REFRESH_RATE_PROPERTY:
		g_value_set_double (value, gnome_pie_config_get_refresh_rate (self));
		break;
		case GNOME_PIE_CONFIG_GLOBAL_SCALE_PROPERTY:
		g_value_set_double (value, gnome_pie_config_get_global_scale (self));
		break;
		case GNOME_PIE_CONFIG_ACTIVATION_RANGE_PROPERTY:
		g_value_set_int (value, gnome_pie_config_get_activation_range (self));
		break;
		case GNOME_PIE_CONFIG_MAX_VISIBLE_SLICES_PROPERTY:
		g_value_set_int (value, gnome_pie_config_get_max_visible_slices (self));
		break;
		case GNOME_PIE_CONFIG_SHOW_INDICATOR_PROPERTY:
		g_value_set_boolean (value, gnome_pie_config_get_show_indicator (self));
		break;
		case GNOME_PIE_CONFIG_SHOW_CAPTIONS_PROPERTY:
		g_value_set_boolean (value, gnome_pie_config_get_show_captions (self));
		break;
		case GNOME_PIE_CONFIG_SEARCH_BY_STRING_PROPERTY:
		g_value_set_boolean (value, gnome_pie_config_get_search_by_string (self));
		break;
		case GNOME_PIE_CONFIG_AUTO_START_PROPERTY:
		g_value_set_boolean (value, gnome_pie_config_get_auto_start (self));
		break;
		case GNOME_PIE_CONFIG_SHOWED_NEWS_PROPERTY:
		g_value_set_int (value, gnome_pie_config_get_showed_news (self));
		break;
		case GNOME_PIE_CONFIG_THEMES_PROPERTY:
		g_value_set_object (value, gnome_pie_config_get_themes (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gnome_pie_config_set_property (GObject * object,
                                     guint property_id,
                                     const GValue * value,
                                     GParamSpec * pspec)
{
	GnomePieConfig * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GNOME_PIE_TYPE_CONFIG, GnomePieConfig);
	switch (property_id) {
		case GNOME_PIE_CONFIG_THEME_PROPERTY:
		gnome_pie_config_set_theme (self, g_value_get_object (value));
		break;
		case GNOME_PIE_CONFIG_REFRESH_RATE_PROPERTY:
		gnome_pie_config_set_refresh_rate (self, g_value_get_double (value));
		break;
		case GNOME_PIE_CONFIG_GLOBAL_SCALE_PROPERTY:
		gnome_pie_config_set_global_scale (self, g_value_get_double (value));
		break;
		case GNOME_PIE_CONFIG_ACTIVATION_RANGE_PROPERTY:
		gnome_pie_config_set_activation_range (self, g_value_get_int (value));
		break;
		case GNOME_PIE_CONFIG_MAX_VISIBLE_SLICES_PROPERTY:
		gnome_pie_config_set_max_visible_slices (self, g_value_get_int (value));
		break;
		case GNOME_PIE_CONFIG_SHOW_INDICATOR_PROPERTY:
		gnome_pie_config_set_show_indicator (self, g_value_get_boolean (value));
		break;
		case GNOME_PIE_CONFIG_SHOW_CAPTIONS_PROPERTY:
		gnome_pie_config_set_show_captions (self, g_value_get_boolean (value));
		break;
		case GNOME_PIE_CONFIG_SEARCH_BY_STRING_PROPERTY:
		gnome_pie_config_set_search_by_string (self, g_value_get_boolean (value));
		break;
		case GNOME_PIE_CONFIG_AUTO_START_PROPERTY:
		gnome_pie_config_set_auto_start (self, g_value_get_boolean (value));
		break;
		case GNOME_PIE_CONFIG_SHOWED_NEWS_PROPERTY:
		gnome_pie_config_set_showed_news (self, g_value_get_int (value));
		break;
		case GNOME_PIE_CONFIG_THEMES_PROPERTY:
		gnome_pie_config_set_themes (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

