/* load.c generated by valac 0.56.19, the Vala compiler
 * generated from load.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 <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <glib-object.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 _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _xmlFreeDoc0(var) ((var == NULL) ? NULL : (var = (xmlFreeDoc (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;

#define GNOME_PIE_TYPE_TRIGGER (gnome_pie_trigger_get_type ())
#define GNOME_PIE_TRIGGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_TRIGGER, GnomePieTrigger))
#define GNOME_PIE_TRIGGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_TRIGGER, GnomePieTriggerClass))
#define GNOME_PIE_IS_TRIGGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_TRIGGER))
#define GNOME_PIE_IS_TRIGGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_TRIGGER))
#define GNOME_PIE_TRIGGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_TRIGGER, GnomePieTriggerClass))

typedef struct _GnomePieTrigger GnomePieTrigger;
typedef struct _GnomePieTriggerClass GnomePieTriggerClass;

#define GNOME_PIE_TYPE_ACTION (gnome_pie_action_get_type ())
#define GNOME_PIE_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_ACTION, GnomePieAction))
#define GNOME_PIE_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_ACTION, GnomePieActionClass))
#define GNOME_PIE_IS_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_ACTION))
#define GNOME_PIE_IS_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_ACTION))
#define GNOME_PIE_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_ACTION, GnomePieActionClass))

typedef struct _GnomePieAction GnomePieAction;
typedef struct _GnomePieActionClass GnomePieActionClass;

#define GNOME_PIE_TYPE_ACTION_GROUP (gnome_pie_action_group_get_type ())
#define GNOME_PIE_ACTION_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_ACTION_GROUP, GnomePieActionGroup))
#define GNOME_PIE_ACTION_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_ACTION_GROUP, GnomePieActionGroupClass))
#define GNOME_PIE_IS_ACTION_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_ACTION_GROUP))
#define GNOME_PIE_IS_ACTION_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_ACTION_GROUP))
#define GNOME_PIE_ACTION_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_ACTION_GROUP, GnomePieActionGroupClass))

typedef struct _GnomePieActionGroup GnomePieActionGroup;
typedef struct _GnomePieActionGroupClass GnomePieActionGroupClass;

VALA_EXTERN void gnome_pie_pies_load (void);
VALA_EXTERN const gchar* gnome_pie_paths_get_pie_config (void);
VALA_EXTERN void gnome_pie_pies_create_default_config (void);
VALA_EXTERN void gnome_pie_pies_parse_pie (xmlNode* node);
VALA_EXTERN GType gnome_pie_pie_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePiePie, g_object_unref)
VALA_EXTERN GType gnome_pie_trigger_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieTrigger, g_object_unref)
VALA_EXTERN GnomePiePie* gnome_pie_pie_manager_create_persistent_pie (const gchar* name,
                                                          const gchar* icon_name,
                                                          GnomePieTrigger* hotkey,
                                                          const gchar* desired_id);
VALA_EXTERN GnomePieTrigger* gnome_pie_trigger_new_from_string (const gchar* trigger);
VALA_EXTERN GnomePieTrigger* gnome_pie_trigger_construct_from_string (GType object_type,
                                                          const gchar* trigger);
VALA_EXTERN void gnome_pie_pies_parse_slice (xmlNode* slice,
                                 GnomePiePie* pie);
VALA_EXTERN void gnome_pie_pies_parse_group (xmlNode* slice,
                                 GnomePiePie* pie);
VALA_EXTERN GType gnome_pie_action_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieAction, g_object_unref)
VALA_EXTERN GnomePieAction* gnome_pie_action_registry_create_action (const gchar* type_id,
                                                         const gchar* name,
                                                         const gchar* icon,
                                                         const gchar* command,
                                                         gboolean quickaction);
VALA_EXTERN void gnome_pie_pie_add_action (GnomePiePie* self,
                               GnomePieAction* action,
                               gint at_position);
VALA_EXTERN GType gnome_pie_action_group_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieActionGroup, g_object_unref)
VALA_EXTERN GnomePieActionGroup* gnome_pie_group_registry_create_group (const gchar* type_id,
                                                            const gchar* parent_id);
VALA_EXTERN const gchar* gnome_pie_pie_get_id (GnomePiePie* self);
VALA_EXTERN void gnome_pie_action_group_on_load (GnomePieActionGroup* self,
                                     xmlNode* data);
VALA_EXTERN void gnome_pie_pie_add_group (GnomePiePie* self,
                              GnomePieActionGroup* group,
                              gint at_position);

void
gnome_pie_pies_load (void)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GFile* _tmp2_;
	GFile* _tmp3_;
	gboolean _tmp4_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	xmlDoc* piesXML = NULL;
	const gchar* _tmp17_;
	const gchar* _tmp18_;
	xmlDoc* _tmp19_;
	xmlDoc* _tmp20_;
	_tmp0_ = gnome_pie_paths_get_pie_config ();
	_tmp1_ = _tmp0_;
	_tmp2_ = g_file_new_for_path (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = !g_file_query_exists (_tmp3_, NULL);
	_g_object_unref0 (_tmp3_);
	if (_tmp4_) {
		const gchar* _tmp5_;
		const gchar* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		_tmp5_ = gnome_pie_paths_get_pie_config ();
		_tmp6_ = _tmp5_;
		_tmp7_ = g_strconcat ("Creating new configuration file in \"", _tmp6_, NULL);
		_tmp8_ = _tmp7_;
		_tmp9_ = g_strconcat (_tmp8_, "\".", NULL);
		_tmp10_ = _tmp9_;
		g_message ("load.vala:41: %s", _tmp10_);
		_g_free0 (_tmp10_);
		_g_free0 (_tmp8_);
		gnome_pie_pies_create_default_config ();
		return;
	}
	_tmp11_ = gnome_pie_paths_get_pie_config ();
	_tmp12_ = _tmp11_;
	_tmp13_ = g_strconcat ("Loading Pies from \"", _tmp12_, NULL);
	_tmp14_ = _tmp13_;
	_tmp15_ = g_strconcat (_tmp14_, "\".", NULL);
	_tmp16_ = _tmp15_;
	g_message ("load.vala:46: %s", _tmp16_);
	_g_free0 (_tmp16_);
	_g_free0 (_tmp14_);
	xmlInitParser ();
	_tmp17_ = gnome_pie_paths_get_pie_config ();
	_tmp18_ = _tmp17_;
	_tmp19_ = xmlParseFile (_tmp18_);
	piesXML = _tmp19_;
	_tmp20_ = piesXML;
	if (_tmp20_ != NULL) {
		xmlNode* root = NULL;
		xmlDoc* _tmp21_;
		xmlNode* _tmp22_;
		xmlNode* _tmp23_;
		xmlDoc* _tmp44_;
		_tmp21_ = piesXML;
		_tmp22_ = xmlDocGetRootElement (_tmp21_);
		root = _tmp22_;
		_tmp23_ = root;
		if (_tmp23_ != NULL) {
			{
				xmlNode* node = NULL;
				xmlNode* _tmp24_;
				xmlNode* _tmp25_;
				_tmp24_ = root;
				_tmp25_ = _tmp24_->children;
				node = _tmp25_;
				{
					gboolean _tmp26_ = FALSE;
					_tmp26_ = TRUE;
					while (TRUE) {
						xmlNode* _tmp29_;
						xmlNode* _tmp30_;
						if (!_tmp26_) {
							xmlNode* _tmp27_;
							xmlNode* _tmp28_;
							_tmp27_ = node;
							_tmp28_ = _tmp27_->next;
							node = _tmp28_;
						}
						_tmp26_ = FALSE;
						_tmp29_ = node;
						if (!(_tmp29_ != NULL)) {
							break;
						}
						_tmp30_ = node;
						if (_tmp30_->type == XML_ELEMENT_NODE) {
							gchar* node_name = NULL;
							xmlNode* _tmp31_;
							const gchar* _tmp32_;
							gchar* _tmp33_;
							const gchar* _tmp34_;
							const gchar* _tmp35_;
							GQuark _tmp37_ = 0U;
							static GQuark _tmp36_label0 = 0;
							_tmp31_ = node;
							_tmp32_ = _tmp31_->name;
							_tmp33_ = g_utf8_strdown (_tmp32_, (gssize) -1);
							node_name = _tmp33_;
							_tmp34_ = node_name;
							_tmp35_ = _tmp34_;
							_tmp37_ = (NULL == _tmp35_) ? 0 : g_quark_from_string (_tmp35_);
							if (_tmp37_ == ((0 != _tmp36_label0) ? _tmp36_label0 : (_tmp36_label0 = g_quark_from_static_string ("pie")))) {
								switch (0) {
									default:
									{
										xmlNode* _tmp38_;
										_tmp38_ = node;
										gnome_pie_pies_parse_pie (_tmp38_);
										break;
									}
								}
							} else {
								switch (0) {
									default:
									{
										const gchar* _tmp39_;
										gchar* _tmp40_;
										gchar* _tmp41_;
										gchar* _tmp42_;
										gchar* _tmp43_;
										_tmp39_ = node_name;
										_tmp40_ = g_strconcat ("Invalid child element <", _tmp39_, NULL);
										_tmp41_ = _tmp40_;
										_tmp42_ = g_strconcat (_tmp41_, "> in <pies> element pies.conf!", NULL);
										_tmp43_ = _tmp42_;
										g_warning ("load.vala:64: %s", _tmp43_);
										_g_free0 (_tmp43_);
										_g_free0 (_tmp41_);
										break;
									}
								}
							}
							_g_free0 (node_name);
						}
					}
				}
			}
		} else {
			g_warning ("load.vala:70: Error loading pies: pies.conf is empty! The cake is a li" \
"e...");
		}
		_tmp44_ = piesXML;
		_xmlFreeDoc0 (_tmp44_);
	} else {
		g_warning ("load.vala:76: Error loading pies: pies.conf not found! The cake is a l" \
"ie...");
	}
}

void
gnome_pie_pies_parse_pie (xmlNode* node)
{
	gchar* hotkey = NULL;
	gchar* _tmp0_;
	gchar* name = NULL;
	gchar* _tmp1_;
	gchar* icon = NULL;
	gchar* _tmp2_;
	gchar* id = NULL;
	gchar* _tmp3_;
	gint quickaction = 0;
	const gchar* _tmp34_;
	GnomePiePie* pie = NULL;
	const gchar* _tmp35_;
	const gchar* _tmp36_;
	const gchar* _tmp37_;
	GnomePieTrigger* _tmp38_;
	GnomePieTrigger* _tmp39_;
	const gchar* _tmp40_;
	GnomePiePie* _tmp41_;
	GnomePiePie* _tmp42_;
	_tmp0_ = g_strdup ("");
	hotkey = _tmp0_;
	_tmp1_ = g_strdup ("");
	name = _tmp1_;
	_tmp2_ = g_strdup ("");
	icon = _tmp2_;
	_tmp3_ = g_strdup ("");
	id = _tmp3_;
	quickaction = -1;
	{
		xmlAttr* attribute = NULL;
		xmlAttr* _tmp4_;
		_tmp4_ = node->properties;
		attribute = _tmp4_;
		{
			gboolean _tmp5_ = FALSE;
			_tmp5_ = TRUE;
			while (TRUE) {
				xmlAttr* _tmp8_;
				gchar* attr_name = NULL;
				xmlAttr* _tmp9_;
				const gchar* _tmp10_;
				gchar* _tmp11_;
				gchar* attr_content = NULL;
				xmlAttr* _tmp12_;
				xmlNode* _tmp13_;
				const gchar* _tmp14_;
				gchar* _tmp15_;
				const gchar* _tmp16_;
				const gchar* _tmp17_;
				GQuark _tmp19_ = 0U;
				static GQuark _tmp18_label0 = 0;
				static GQuark _tmp18_label1 = 0;
				static GQuark _tmp18_label2 = 0;
				static GQuark _tmp18_label3 = 0;
				static GQuark _tmp18_label4 = 0;
				if (!_tmp5_) {
					xmlAttr* _tmp6_;
					xmlAttr* _tmp7_;
					_tmp6_ = attribute;
					_tmp7_ = _tmp6_->next;
					attribute = _tmp7_;
				}
				_tmp5_ = FALSE;
				_tmp8_ = attribute;
				if (!(_tmp8_ != NULL)) {
					break;
				}
				_tmp9_ = attribute;
				_tmp10_ = _tmp9_->name;
				_tmp11_ = g_utf8_strdown (_tmp10_, (gssize) -1);
				attr_name = _tmp11_;
				_tmp12_ = attribute;
				_tmp13_ = _tmp12_->children;
				_tmp14_ = _tmp13_->content;
				_tmp15_ = g_strdup (_tmp14_);
				attr_content = _tmp15_;
				_tmp16_ = attr_name;
				_tmp17_ = _tmp16_;
				_tmp19_ = (NULL == _tmp17_) ? 0 : g_quark_from_string (_tmp17_);
				if (_tmp19_ == ((0 != _tmp18_label0) ? _tmp18_label0 : (_tmp18_label0 = g_quark_from_static_string ("hotkey")))) {
					switch (0) {
						default:
						{
							const gchar* _tmp20_;
							gchar* _tmp21_;
							_tmp20_ = attr_content;
							_tmp21_ = g_strdup (_tmp20_);
							_g_free0 (hotkey);
							hotkey = _tmp21_;
							break;
						}
					}
				} else if (_tmp19_ == ((0 != _tmp18_label1) ? _tmp18_label1 : (_tmp18_label1 = g_quark_from_static_string ("quickaction")))) {
					switch (0) {
						default:
						{
							const gchar* _tmp22_;
							_tmp22_ = attr_content;
							quickaction = atoi (_tmp22_);
							break;
						}
					}
				} else if (_tmp19_ == ((0 != _tmp18_label2) ? _tmp18_label2 : (_tmp18_label2 = g_quark_from_static_string ("name")))) {
					switch (0) {
						default:
						{
							const gchar* _tmp23_;
							gchar* _tmp24_;
							_tmp23_ = attr_content;
							_tmp24_ = g_strdup (_tmp23_);
							_g_free0 (name);
							name = _tmp24_;
							break;
						}
					}
				} else if (_tmp19_ == ((0 != _tmp18_label3) ? _tmp18_label3 : (_tmp18_label3 = g_quark_from_static_string ("icon")))) {
					switch (0) {
						default:
						{
							const gchar* _tmp25_;
							gchar* _tmp26_;
							_tmp25_ = attr_content;
							_tmp26_ = g_strdup (_tmp25_);
							_g_free0 (icon);
							icon = _tmp26_;
							break;
						}
					}
				} else if (_tmp19_ == ((0 != _tmp18_label4) ? _tmp18_label4 : (_tmp18_label4 = g_quark_from_static_string ("id")))) {
					switch (0) {
						default:
						{
							const gchar* _tmp27_;
							gchar* _tmp28_;
							_tmp27_ = attr_content;
							_tmp28_ = g_strdup (_tmp27_);
							_g_free0 (id);
							id = _tmp28_;
							break;
						}
					}
				} else {
					switch (0) {
						default:
						{
							const gchar* _tmp29_;
							gchar* _tmp30_;
							gchar* _tmp31_;
							gchar* _tmp32_;
							gchar* _tmp33_;
							_tmp29_ = attr_name;
							_tmp30_ = g_strconcat ("Invalid setting \"", _tmp29_, NULL);
							_tmp31_ = _tmp30_;
							_tmp32_ = g_strconcat (_tmp31_, "\" in pies.conf!", NULL);
							_tmp33_ = _tmp32_;
							g_warning ("load.vala:113: %s", _tmp33_);
							_g_free0 (_tmp33_);
							_g_free0 (_tmp31_);
							break;
						}
					}
				}
				_g_free0 (attr_content);
				_g_free0 (attr_name);
			}
		}
	}
	_tmp34_ = name;
	if (g_strcmp0 (_tmp34_, "") == 0) {
		g_warning ("load.vala:119: Invalid <pie> element in pies.conf: No name specified!");
		_g_free0 (id);
		_g_free0 (icon);
		_g_free0 (name);
		_g_free0 (hotkey);
		return;
	}
	_tmp35_ = name;
	_tmp36_ = icon;
	_tmp37_ = hotkey;
	_tmp38_ = gnome_pie_trigger_new_from_string (_tmp37_);
	_tmp39_ = _tmp38_;
	_tmp40_ = id;
	_tmp41_ = gnome_pie_pie_manager_create_persistent_pie (_tmp35_, _tmp36_, _tmp39_, _tmp40_);
	_tmp42_ = _tmp41_;
	_g_object_unref0 (_tmp39_);
	pie = _tmp42_;
	{
		xmlNode* slice = NULL;
		xmlNode* _tmp43_;
		_tmp43_ = node->children;
		slice = _tmp43_;
		{
			gboolean _tmp44_ = FALSE;
			_tmp44_ = TRUE;
			while (TRUE) {
				xmlNode* _tmp47_;
				xmlNode* _tmp48_;
				if (!_tmp44_) {
					xmlNode* _tmp45_;
					xmlNode* _tmp46_;
					_tmp45_ = slice;
					_tmp46_ = _tmp45_->next;
					slice = _tmp46_;
				}
				_tmp44_ = FALSE;
				_tmp47_ = slice;
				if (!(_tmp47_ != NULL)) {
					break;
				}
				_tmp48_ = slice;
				if (_tmp48_->type == XML_ELEMENT_NODE) {
					gchar* node_name = NULL;
					xmlNode* _tmp49_;
					const gchar* _tmp50_;
					gchar* _tmp51_;
					const gchar* _tmp52_;
					const gchar* _tmp53_;
					GQuark _tmp55_ = 0U;
					static GQuark _tmp54_label0 = 0;
					static GQuark _tmp54_label1 = 0;
					_tmp49_ = slice;
					_tmp50_ = _tmp49_->name;
					_tmp51_ = g_utf8_strdown (_tmp50_, (gssize) -1);
					node_name = _tmp51_;
					_tmp52_ = node_name;
					_tmp53_ = _tmp52_;
					_tmp55_ = (NULL == _tmp53_) ? 0 : g_quark_from_string (_tmp53_);
					if (_tmp55_ == ((0 != _tmp54_label0) ? _tmp54_label0 : (_tmp54_label0 = g_quark_from_static_string ("slice")))) {
						switch (0) {
							default:
							{
								xmlNode* _tmp56_;
								GnomePiePie* _tmp57_;
								_tmp56_ = slice;
								_tmp57_ = pie;
								gnome_pie_pies_parse_slice (_tmp56_, _tmp57_);
								break;
							}
						}
					} else if (_tmp55_ == ((0 != _tmp54_label1) ? _tmp54_label1 : (_tmp54_label1 = g_quark_from_static_string ("group")))) {
						switch (0) {
							default:
							{
								xmlNode* _tmp58_;
								GnomePiePie* _tmp59_;
								_tmp58_ = slice;
								_tmp59_ = pie;
								gnome_pie_pies_parse_group (_tmp58_, _tmp59_);
								break;
							}
						}
					} else {
						switch (0) {
							default:
							{
								const gchar* _tmp60_;
								gchar* _tmp61_;
								gchar* _tmp62_;
								gchar* _tmp63_;
								gchar* _tmp64_;
								_tmp60_ = node_name;
								_tmp61_ = g_strconcat ("Invalid child element <", _tmp60_, NULL);
								_tmp62_ = _tmp61_;
								_tmp63_ = g_strconcat (_tmp62_, "> in <pie> element in pies.conf!", NULL);
								_tmp64_ = _tmp63_;
								g_warning ("load.vala:138: %s", _tmp64_);
								_g_free0 (_tmp64_);
								_g_free0 (_tmp62_);
								break;
							}
						}
					}
					_g_free0 (node_name);
				}
			}
		}
	}
	_g_object_unref0 (pie);
	_g_free0 (id);
	_g_free0 (icon);
	_g_free0 (name);
	_g_free0 (hotkey);
}

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;
	}
}

void
gnome_pie_pies_parse_slice (xmlNode* slice,
                            GnomePiePie* pie)
{
	gchar* name = NULL;
	gchar* _tmp0_;
	gchar* icon = NULL;
	gchar* _tmp1_;
	gchar* command = NULL;
	gchar* _tmp2_;
	gchar* type = NULL;
	gchar* _tmp3_;
	gboolean quickaction = FALSE;
	GnomePieAction* action = NULL;
	const gchar* _tmp34_;
	const gchar* _tmp35_;
	const gchar* _tmp36_;
	const gchar* _tmp37_;
	GnomePieAction* _tmp38_;
	GnomePieAction* _tmp39_;
	g_return_if_fail (pie != NULL);
	_tmp0_ = g_strdup ("");
	name = _tmp0_;
	_tmp1_ = g_strdup ("");
	icon = _tmp1_;
	_tmp2_ = g_strdup ("");
	command = _tmp2_;
	_tmp3_ = g_strdup ("");
	type = _tmp3_;
	quickaction = FALSE;
	{
		xmlAttr* attribute = NULL;
		xmlAttr* _tmp4_;
		_tmp4_ = slice->properties;
		attribute = _tmp4_;
		{
			gboolean _tmp5_ = FALSE;
			_tmp5_ = TRUE;
			while (TRUE) {
				xmlAttr* _tmp8_;
				gchar* attr_name = NULL;
				xmlAttr* _tmp9_;
				const gchar* _tmp10_;
				gchar* _tmp11_;
				gchar* attr_content = NULL;
				xmlAttr* _tmp12_;
				xmlNode* _tmp13_;
				const gchar* _tmp14_;
				gchar* _tmp15_;
				const gchar* _tmp16_;
				const gchar* _tmp17_;
				GQuark _tmp19_ = 0U;
				static GQuark _tmp18_label0 = 0;
				static GQuark _tmp18_label1 = 0;
				static GQuark _tmp18_label2 = 0;
				static GQuark _tmp18_label3 = 0;
				static GQuark _tmp18_label4 = 0;
				if (!_tmp5_) {
					xmlAttr* _tmp6_;
					xmlAttr* _tmp7_;
					_tmp6_ = attribute;
					_tmp7_ = _tmp6_->next;
					attribute = _tmp7_;
				}
				_tmp5_ = FALSE;
				_tmp8_ = attribute;
				if (!(_tmp8_ != NULL)) {
					break;
				}
				_tmp9_ = attribute;
				_tmp10_ = _tmp9_->name;
				_tmp11_ = g_utf8_strdown (_tmp10_, (gssize) -1);
				attr_name = _tmp11_;
				_tmp12_ = attribute;
				_tmp13_ = _tmp12_->children;
				_tmp14_ = _tmp13_->content;
				_tmp15_ = g_strdup (_tmp14_);
				attr_content = _tmp15_;
				_tmp16_ = attr_name;
				_tmp17_ = _tmp16_;
				_tmp19_ = (NULL == _tmp17_) ? 0 : g_quark_from_string (_tmp17_);
				if (_tmp19_ == ((0 != _tmp18_label0) ? _tmp18_label0 : (_tmp18_label0 = g_quark_from_static_string ("name")))) {
					switch (0) {
						default:
						{
							const gchar* _tmp20_;
							gchar* _tmp21_;
							_tmp20_ = attr_content;
							_tmp21_ = g_strdup (_tmp20_);
							_g_free0 (name);
							name = _tmp21_;
							break;
						}
					}
				} else if (_tmp19_ == ((0 != _tmp18_label1) ? _tmp18_label1 : (_tmp18_label1 = g_quark_from_static_string ("icon")))) {
					switch (0) {
						default:
						{
							const gchar* _tmp22_;
							gchar* _tmp23_;
							_tmp22_ = attr_content;
							_tmp23_ = g_strdup (_tmp22_);
							_g_free0 (icon);
							icon = _tmp23_;
							break;
						}
					}
				} else if (_tmp19_ == ((0 != _tmp18_label2) ? _tmp18_label2 : (_tmp18_label2 = g_quark_from_static_string ("command")))) {
					switch (0) {
						default:
						{
							const gchar* _tmp24_;
							gchar* _tmp25_;
							_tmp24_ = attr_content;
							_tmp25_ = g_strdup (_tmp24_);
							_g_free0 (command);
							command = _tmp25_;
							break;
						}
					}
				} else if (_tmp19_ == ((0 != _tmp18_label3) ? _tmp18_label3 : (_tmp18_label3 = g_quark_from_static_string ("type")))) {
					switch (0) {
						default:
						{
							const gchar* _tmp26_;
							gchar* _tmp27_;
							_tmp26_ = attr_content;
							_tmp27_ = g_strdup (_tmp26_);
							_g_free0 (type);
							type = _tmp27_;
							break;
						}
					}
				} else if (_tmp19_ == ((0 != _tmp18_label4) ? _tmp18_label4 : (_tmp18_label4 = g_quark_from_static_string ("quickaction")))) {
					switch (0) {
						default:
						{
							const gchar* _tmp28_;
							_tmp28_ = attr_content;
							quickaction = bool_parse (_tmp28_);
							break;
						}
					}
				} else {
					switch (0) {
						default:
						{
							const gchar* _tmp29_;
							gchar* _tmp30_;
							gchar* _tmp31_;
							gchar* _tmp32_;
							gchar* _tmp33_;
							_tmp29_ = attr_name;
							_tmp30_ = g_strconcat ("Invalid attribute \"", _tmp29_, NULL);
							_tmp31_ = _tmp30_;
							_tmp32_ = g_strconcat (_tmp31_, "\" in <slice> element in pies.conf!", NULL);
							_tmp33_ = _tmp32_;
							g_warning ("load.vala:178: %s", _tmp33_);
							_g_free0 (_tmp33_);
							_g_free0 (_tmp31_);
							break;
						}
					}
				}
				_g_free0 (attr_content);
				_g_free0 (attr_name);
			}
		}
	}
	_tmp34_ = type;
	_tmp35_ = name;
	_tmp36_ = icon;
	_tmp37_ = command;
	_tmp38_ = gnome_pie_action_registry_create_action (_tmp34_, _tmp35_, _tmp36_, _tmp37_, quickaction);
	action = _tmp38_;
	_tmp39_ = action;
	if (_tmp39_ != NULL) {
		GnomePieAction* _tmp40_;
		_tmp40_ = action;
		gnome_pie_pie_add_action (pie, _tmp40_, -1);
	}
	_g_object_unref0 (action);
	_g_free0 (type);
	_g_free0 (command);
	_g_free0 (icon);
	_g_free0 (name);
}

void
gnome_pie_pies_parse_group (xmlNode* slice,
                            GnomePiePie* pie)
{
	gchar* type = NULL;
	gchar* _tmp0_;
	GnomePieActionGroup* group = NULL;
	const gchar* _tmp16_;
	const gchar* _tmp17_;
	const gchar* _tmp18_;
	GnomePieActionGroup* _tmp19_;
	GnomePieActionGroup* _tmp20_;
	g_return_if_fail (pie != NULL);
	_tmp0_ = g_strdup ("");
	type = _tmp0_;
	{
		xmlAttr* attribute = NULL;
		xmlAttr* _tmp1_;
		_tmp1_ = slice->properties;
		attribute = _tmp1_;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				xmlAttr* _tmp5_;
				gchar* attr_name = NULL;
				xmlAttr* _tmp6_;
				const gchar* _tmp7_;
				gchar* _tmp8_;
				gchar* attr_content = NULL;
				xmlAttr* _tmp9_;
				xmlNode* _tmp10_;
				const gchar* _tmp11_;
				gchar* _tmp12_;
				const gchar* _tmp13_;
				if (!_tmp2_) {
					xmlAttr* _tmp3_;
					xmlAttr* _tmp4_;
					_tmp3_ = attribute;
					_tmp4_ = _tmp3_->next;
					attribute = _tmp4_;
				}
				_tmp2_ = FALSE;
				_tmp5_ = attribute;
				if (!(_tmp5_ != NULL)) {
					break;
				}
				_tmp6_ = attribute;
				_tmp7_ = _tmp6_->name;
				_tmp8_ = g_utf8_strdown (_tmp7_, (gssize) -1);
				attr_name = _tmp8_;
				_tmp9_ = attribute;
				_tmp10_ = _tmp9_->children;
				_tmp11_ = _tmp10_->content;
				_tmp12_ = g_strdup (_tmp11_);
				attr_content = _tmp12_;
				_tmp13_ = attr_name;
				if (g_strcmp0 (_tmp13_, "type") == 0) {
					const gchar* _tmp14_;
					gchar* _tmp15_;
					_tmp14_ = attr_content;
					_tmp15_ = g_strdup (_tmp14_);
					_g_free0 (type);
					type = _tmp15_;
					_g_free0 (attr_content);
					_g_free0 (attr_name);
					break;
				}
				_g_free0 (attr_content);
				_g_free0 (attr_name);
			}
		}
	}
	_tmp16_ = type;
	_tmp17_ = gnome_pie_pie_get_id (pie);
	_tmp18_ = _tmp17_;
	_tmp19_ = gnome_pie_group_registry_create_group (_tmp16_, _tmp18_);
	group = _tmp19_;
	_tmp20_ = group;
	if (_tmp20_ != NULL) {
		GnomePieActionGroup* _tmp21_;
		GnomePieActionGroup* _tmp22_;
		_tmp21_ = group;
		gnome_pie_action_group_on_load (_tmp21_, slice);
		_tmp22_ = group;
		gnome_pie_pie_add_group (pie, _tmp22_, -1);
	}
	_g_object_unref0 (group);
	_g_free0 (type);
}

