/* save.c generated by valac 0.56.19, the Vala compiler
 * generated from save.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.h>
#include <stdlib.h>
#include <string.h>
#include <libxml/xmlwriter.h>
#include <gee.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_free0(var) (var = (g_free (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 _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

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

#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_ACTION_REGISTRY_TYPE_TYPEDESCRIPTION (gnome_pie_action_registry_typedescription_get_type ())
#define GNOME_PIE_ACTION_REGISTRY_TYPEDESCRIPTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_ACTION_REGISTRY_TYPE_TYPEDESCRIPTION, GnomePieActionRegistryTypeDescription))
#define GNOME_PIE_ACTION_REGISTRY_TYPEDESCRIPTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_ACTION_REGISTRY_TYPE_TYPEDESCRIPTION, GnomePieActionRegistryTypeDescriptionClass))
#define GNOME_PIE_ACTION_REGISTRY_IS_TYPEDESCRIPTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_ACTION_REGISTRY_TYPE_TYPEDESCRIPTION))
#define GNOME_PIE_ACTION_REGISTRY_IS_TYPEDESCRIPTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_ACTION_REGISTRY_TYPE_TYPEDESCRIPTION))
#define GNOME_PIE_ACTION_REGISTRY_TYPEDESCRIPTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_ACTION_REGISTRY_TYPE_TYPEDESCRIPTION, GnomePieActionRegistryTypeDescriptionClass))

typedef struct _GnomePieActionRegistryTypeDescription GnomePieActionRegistryTypeDescription;
typedef struct _GnomePieActionRegistryTypeDescriptionClass GnomePieActionRegistryTypeDescriptionClass;
#define _gnome_pie_action_registry_typedescription_unref0(var) ((var == NULL) ? NULL : (var = (gnome_pie_action_registry_typedescription_unref (var), NULL)))
#define _xmlFreeTextWriter0(var) ((var == NULL) ? NULL : (var = (xmlFreeTextWriter (var), NULL)))

VALA_EXTERN void gnome_pie_pies_save (void);
VALA_EXTERN const gchar* gnome_pie_paths_get_pie_config (void);
VALA_EXTERN GType gnome_pie_pie_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePiePie, g_object_unref)
VALA_EXTERN GeeHashMap* gnome_pie_pie_manager_get_all_pies (void);
VALA_EXTERN const gchar* gnome_pie_pie_get_id (GnomePiePie* self);
VALA_EXTERN const gchar* gnome_pie_pie_get_name (GnomePiePie* self);
VALA_EXTERN const gchar* gnome_pie_pie_get_icon (GnomePiePie* self);
VALA_EXTERN gchar* gnome_pie_pie_manager_get_accelerator_of (const gchar* id);
VALA_EXTERN GType gnome_pie_action_group_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieActionGroup, g_object_unref)
VALA_EXTERN GeeArrayList* gnome_pie_pie_get_action_groups (GnomePiePie* self);
VALA_EXTERN GType gnome_pie_action_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieAction, g_object_unref)
VALA_EXTERN GeeArrayList* gnome_pie_action_group_get_actions (GnomePieActionGroup* self);
VALA_EXTERN gpointer gnome_pie_action_registry_typedescription_ref (gpointer instance);
VALA_EXTERN void gnome_pie_action_registry_typedescription_unref (gpointer instance);
VALA_EXTERN GParamSpec* gnome_pie_action_registry_param_spec_typedescription (const gchar* name,
                                                                  const gchar* nick,
                                                                  const gchar* blurb,
                                                                  GType object_type,
                                                                  GParamFlags flags);
VALA_EXTERN void gnome_pie_action_registry_value_set_typedescription (GValue* value,
                                                          gpointer v_object);
VALA_EXTERN void gnome_pie_action_registry_value_take_typedescription (GValue* value,
                                                           gpointer v_object);
VALA_EXTERN gpointer gnome_pie_action_registry_value_get_typedescription (const GValue* value);
VALA_EXTERN GType gnome_pie_action_registry_typedescription_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieActionRegistryTypeDescription, gnome_pie_action_registry_typedescription_unref)
VALA_EXTERN GeeHashMap* gnome_pie_action_registry_get_descriptions (void);
VALA_EXTERN const gchar* gnome_pie_action_registry_typedescription_get_id (GnomePieActionRegistryTypeDescription* self);
VALA_EXTERN gboolean gnome_pie_action_registry_typedescription_get_icon_name_editable (GnomePieActionRegistryTypeDescription* self);
VALA_EXTERN const gchar* gnome_pie_action_get_name (GnomePieAction* self);
VALA_EXTERN const gchar* gnome_pie_action_get_icon (GnomePieAction* self);
VALA_EXTERN const gchar* gnome_pie_action_get_real_command (GnomePieAction* self);
VALA_EXTERN gboolean gnome_pie_action_get_is_quickaction (GnomePieAction* self);
VALA_EXTERN void gnome_pie_action_group_on_save (GnomePieActionGroup* self,
                                     xmlTextWriter* writer);

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

void
gnome_pie_pies_save (void)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	xmlTextWriter* writer = NULL;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	xmlTextWriter* _tmp8_;
	xmlTextWriter* _tmp9_;
	xmlTextWriter* _tmp10_;
	xmlTextWriter* _tmp11_;
	xmlTextWriter* _tmp119_;
	xmlTextWriter* _tmp120_;
	_tmp0_ = gnome_pie_paths_get_pie_config ();
	_tmp1_ = _tmp0_;
	_tmp2_ = g_strconcat ("Saving Pies to \"", _tmp1_, NULL);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_strconcat (_tmp3_, "\".", NULL);
	_tmp5_ = _tmp4_;
	g_message ("save.vala:39: %s", _tmp5_);
	_g_free0 (_tmp5_);
	_g_free0 (_tmp3_);
	_tmp6_ = gnome_pie_paths_get_pie_config ();
	_tmp7_ = _tmp6_;
	_tmp8_ = xmlNewTextWriterFilename (_tmp7_, FALSE);
	writer = _tmp8_;
	_tmp9_ = writer;
	xmlTextWriterSetIndent (_tmp9_, TRUE);
	_tmp10_ = writer;
	xmlTextWriterStartDocument (_tmp10_, "1.0", NULL, NULL);
	_tmp11_ = writer;
	xmlTextWriterStartElement (_tmp11_, (xmlChar*) "pies");
	{
		GeeIterator* _pie_entry_it = NULL;
		GeeHashMap* _tmp12_;
		GeeHashMap* _tmp13_;
		GeeSet* _tmp14_;
		GeeSet* _tmp15_;
		GeeSet* _tmp16_;
		GeeIterator* _tmp17_;
		GeeIterator* _tmp18_;
		_tmp12_ = gnome_pie_pie_manager_get_all_pies ();
		_tmp13_ = _tmp12_;
		_tmp14_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _tmp13_);
		_tmp15_ = _tmp14_;
		_tmp16_ = _tmp15_;
		_tmp17_ = gee_iterable_iterator ((GeeIterable*) _tmp16_);
		_tmp18_ = _tmp17_;
		_g_object_unref0 (_tmp16_);
		_pie_entry_it = _tmp18_;
		while (TRUE) {
			GeeIterator* _tmp19_;
			GeeMapEntry* pie_entry = NULL;
			GeeIterator* _tmp20_;
			gpointer _tmp21_;
			GnomePiePie* pie = NULL;
			GeeMapEntry* _tmp22_;
			gconstpointer _tmp23_;
			gconstpointer _tmp24_;
			GnomePiePie* _tmp25_;
			GnomePiePie* _tmp26_;
			const gchar* _tmp27_;
			const gchar* _tmp28_;
			gint _tmp29_;
			gint _tmp30_;
			_tmp19_ = _pie_entry_it;
			if (!gee_iterator_next (_tmp19_)) {
				break;
			}
			_tmp20_ = _pie_entry_it;
			_tmp21_ = gee_iterator_get (_tmp20_);
			pie_entry = (GeeMapEntry*) _tmp21_;
			_tmp22_ = pie_entry;
			_tmp23_ = gee_map_entry_get_value (_tmp22_);
			_tmp24_ = _tmp23_;
			_tmp25_ = _g_object_ref0 ((GnomePiePie*) _tmp24_);
			pie = _tmp25_;
			_tmp26_ = pie;
			_tmp27_ = gnome_pie_pie_get_id (_tmp26_);
			_tmp28_ = _tmp27_;
			_tmp29_ = strlen (_tmp28_);
			_tmp30_ = _tmp29_;
			if (_tmp30_ == 3) {
				gint slice_count = 0;
				xmlTextWriter* _tmp31_;
				xmlTextWriter* _tmp32_;
				GnomePiePie* _tmp33_;
				const gchar* _tmp34_;
				const gchar* _tmp35_;
				xmlTextWriter* _tmp36_;
				GnomePiePie* _tmp37_;
				const gchar* _tmp38_;
				const gchar* _tmp39_;
				xmlTextWriter* _tmp40_;
				GnomePiePie* _tmp41_;
				const gchar* _tmp42_;
				const gchar* _tmp43_;
				xmlTextWriter* _tmp44_;
				GnomePiePie* _tmp45_;
				const gchar* _tmp46_;
				const gchar* _tmp47_;
				gchar* _tmp48_;
				gchar* _tmp49_;
				xmlTextWriter* _tmp118_;
				slice_count = 0;
				_tmp31_ = writer;
				xmlTextWriterStartElement (_tmp31_, (xmlChar*) "pie");
				_tmp32_ = writer;
				_tmp33_ = pie;
				_tmp34_ = gnome_pie_pie_get_name (_tmp33_);
				_tmp35_ = _tmp34_;
				xmlTextWriterWriteAttribute (_tmp32_, (xmlChar*) "name", (xmlChar*) _tmp35_);
				_tmp36_ = writer;
				_tmp37_ = pie;
				_tmp38_ = gnome_pie_pie_get_id (_tmp37_);
				_tmp39_ = _tmp38_;
				xmlTextWriterWriteAttribute (_tmp36_, (xmlChar*) "id", (xmlChar*) _tmp39_);
				_tmp40_ = writer;
				_tmp41_ = pie;
				_tmp42_ = gnome_pie_pie_get_icon (_tmp41_);
				_tmp43_ = _tmp42_;
				xmlTextWriterWriteAttribute (_tmp40_, (xmlChar*) "icon", (xmlChar*) _tmp43_);
				_tmp44_ = writer;
				_tmp45_ = pie;
				_tmp46_ = gnome_pie_pie_get_id (_tmp45_);
				_tmp47_ = _tmp46_;
				_tmp48_ = gnome_pie_pie_manager_get_accelerator_of (_tmp47_);
				_tmp49_ = _tmp48_;
				xmlTextWriterWriteAttribute (_tmp44_, (xmlChar*) "hotkey", (xmlChar*) _tmp49_);
				_g_free0 (_tmp49_);
				{
					GeeArrayList* _group_list = NULL;
					GnomePiePie* _tmp50_;
					GeeArrayList* _tmp51_;
					GeeArrayList* _tmp52_;
					gint _group_size = 0;
					GeeArrayList* _tmp53_;
					gint _tmp54_;
					gint _tmp55_;
					gint _group_index = 0;
					_tmp50_ = pie;
					_tmp51_ = gnome_pie_pie_get_action_groups (_tmp50_);
					_tmp52_ = _tmp51_;
					_group_list = _tmp52_;
					_tmp53_ = _group_list;
					_tmp54_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp53_);
					_tmp55_ = _tmp54_;
					_group_size = _tmp55_;
					_group_index = -1;
					while (TRUE) {
						gint _tmp56_;
						gint _tmp57_;
						GnomePieActionGroup* group = NULL;
						GeeArrayList* _tmp58_;
						gpointer _tmp59_;
						GnomePieActionGroup* _tmp60_;
						_group_index = _group_index + 1;
						_tmp56_ = _group_index;
						_tmp57_ = _group_size;
						if (!(_tmp56_ < _tmp57_)) {
							break;
						}
						_tmp58_ = _group_list;
						_tmp59_ = gee_abstract_list_get ((GeeAbstractList*) _tmp58_, _group_index);
						group = (GnomePieActionGroup*) _tmp59_;
						_tmp60_ = group;
						if (g_type_depth (G_TYPE_FROM_INSTANCE ((GObject*) _tmp60_)) == ((guint) 2)) {
							{
								GeeArrayList* _action_list = NULL;
								GnomePieActionGroup* _tmp61_;
								GeeArrayList* _tmp62_;
								GeeArrayList* _tmp63_;
								gint _action_size = 0;
								GeeArrayList* _tmp64_;
								gint _tmp65_;
								gint _tmp66_;
								gint _action_index = 0;
								_tmp61_ = group;
								_tmp62_ = gnome_pie_action_group_get_actions (_tmp61_);
								_tmp63_ = _tmp62_;
								_action_list = _tmp63_;
								_tmp64_ = _action_list;
								_tmp65_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp64_);
								_tmp66_ = _tmp65_;
								_action_size = _tmp66_;
								_action_index = -1;
								while (TRUE) {
									gint _tmp67_;
									gint _tmp68_;
									GnomePieAction* action = NULL;
									GeeArrayList* _tmp69_;
									gpointer _tmp70_;
									xmlTextWriter* _tmp71_;
									xmlTextWriter* _tmp72_;
									GeeHashMap* _tmp73_;
									GeeHashMap* _tmp74_;
									GnomePieAction* _tmp75_;
									const gchar* _tmp76_;
									gpointer _tmp77_;
									GnomePieActionRegistryTypeDescription* _tmp78_;
									const gchar* _tmp79_;
									const gchar* _tmp80_;
									GeeHashMap* _tmp81_;
									GeeHashMap* _tmp82_;
									GnomePieAction* _tmp83_;
									const gchar* _tmp84_;
									gpointer _tmp85_;
									GnomePieActionRegistryTypeDescription* _tmp86_;
									gboolean _tmp87_;
									gboolean _tmp88_;
									gboolean _tmp89_;
									xmlTextWriter* _tmp98_;
									GnomePieAction* _tmp99_;
									const gchar* _tmp100_;
									const gchar* _tmp101_;
									const gchar* _tmp102_ = NULL;
									GnomePieAction* _tmp103_;
									gboolean _tmp104_;
									gboolean _tmp105_;
									xmlTextWriter* _tmp106_;
									xmlTextWriter* _tmp107_;
									gint _tmp108_;
									_action_index = _action_index + 1;
									_tmp67_ = _action_index;
									_tmp68_ = _action_size;
									if (!(_tmp67_ < _tmp68_)) {
										break;
									}
									_tmp69_ = _action_list;
									_tmp70_ = gee_abstract_list_get ((GeeAbstractList*) _tmp69_, _action_index);
									action = (GnomePieAction*) _tmp70_;
									_tmp71_ = writer;
									xmlTextWriterStartElement (_tmp71_, (xmlChar*) "slice");
									_tmp72_ = writer;
									_tmp73_ = gnome_pie_action_registry_get_descriptions ();
									_tmp74_ = _tmp73_;
									_tmp75_ = action;
									_tmp76_ = g_type_name (G_TYPE_FROM_INSTANCE ((GObject*) _tmp75_));
									_tmp77_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp74_, _tmp76_);
									_tmp78_ = (GnomePieActionRegistryTypeDescription*) _tmp77_;
									_tmp79_ = gnome_pie_action_registry_typedescription_get_id (_tmp78_);
									_tmp80_ = _tmp79_;
									xmlTextWriterWriteAttribute (_tmp72_, (xmlChar*) "type", (xmlChar*) _tmp80_);
									_gnome_pie_action_registry_typedescription_unref0 (_tmp78_);
									_tmp81_ = gnome_pie_action_registry_get_descriptions ();
									_tmp82_ = _tmp81_;
									_tmp83_ = action;
									_tmp84_ = g_type_name (G_TYPE_FROM_INSTANCE ((GObject*) _tmp83_));
									_tmp85_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp82_, _tmp84_);
									_tmp86_ = (GnomePieActionRegistryTypeDescription*) _tmp85_;
									_tmp87_ = gnome_pie_action_registry_typedescription_get_icon_name_editable (_tmp86_);
									_tmp88_ = _tmp87_;
									_tmp89_ = _tmp88_;
									_gnome_pie_action_registry_typedescription_unref0 (_tmp86_);
									if (_tmp89_) {
										xmlTextWriter* _tmp90_;
										GnomePieAction* _tmp91_;
										const gchar* _tmp92_;
										const gchar* _tmp93_;
										xmlTextWriter* _tmp94_;
										GnomePieAction* _tmp95_;
										const gchar* _tmp96_;
										const gchar* _tmp97_;
										_tmp90_ = writer;
										_tmp91_ = action;
										_tmp92_ = gnome_pie_action_get_name (_tmp91_);
										_tmp93_ = _tmp92_;
										xmlTextWriterWriteAttribute (_tmp90_, (xmlChar*) "name", (xmlChar*) _tmp93_);
										_tmp94_ = writer;
										_tmp95_ = action;
										_tmp96_ = gnome_pie_action_get_icon (_tmp95_);
										_tmp97_ = _tmp96_;
										xmlTextWriterWriteAttribute (_tmp94_, (xmlChar*) "icon", (xmlChar*) _tmp97_);
									}
									_tmp98_ = writer;
									_tmp99_ = action;
									_tmp100_ = gnome_pie_action_get_real_command (_tmp99_);
									_tmp101_ = _tmp100_;
									xmlTextWriterWriteAttribute (_tmp98_, (xmlChar*) "command", (xmlChar*) _tmp101_);
									_tmp103_ = action;
									_tmp104_ = gnome_pie_action_get_is_quickaction (_tmp103_);
									_tmp105_ = _tmp104_;
									if (_tmp105_) {
										_tmp102_ = "true";
									} else {
										_tmp102_ = "false";
									}
									_tmp106_ = writer;
									xmlTextWriterWriteAttribute (_tmp106_, (xmlChar*) "quickAction", (xmlChar*) _tmp102_);
									_tmp107_ = writer;
									xmlTextWriterEndElement (_tmp107_);
									slice_count = slice_count + 1;
									_tmp108_ = slice_count;
									_g_object_unref0 (action);
								}
							}
						} else {
							xmlTextWriter* _tmp109_;
							GnomePieActionGroup* _tmp110_;
							xmlTextWriter* _tmp111_;
							xmlTextWriter* _tmp112_;
							GnomePieActionGroup* _tmp113_;
							GeeArrayList* _tmp114_;
							GeeArrayList* _tmp115_;
							gint _tmp116_;
							gint _tmp117_;
							_tmp109_ = writer;
							xmlTextWriterStartElement (_tmp109_, (xmlChar*) "group");
							_tmp110_ = group;
							_tmp111_ = writer;
							gnome_pie_action_group_on_save (_tmp110_, _tmp111_);
							_tmp112_ = writer;
							xmlTextWriterEndElement (_tmp112_);
							_tmp113_ = group;
							_tmp114_ = gnome_pie_action_group_get_actions (_tmp113_);
							_tmp115_ = _tmp114_;
							_tmp116_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp115_);
							_tmp117_ = _tmp116_;
							slice_count += _tmp117_;
						}
						_g_object_unref0 (group);
					}
				}
				_tmp118_ = writer;
				xmlTextWriterEndElement (_tmp118_);
			}
			_g_object_unref0 (pie);
			_g_object_unref0 (pie_entry);
		}
		_g_object_unref0 (_pie_entry_it);
	}
	_tmp119_ = writer;
	xmlTextWriterEndElement (_tmp119_);
	_tmp120_ = writer;
	xmlTextWriterEndDocument (_tmp120_);
	_xmlFreeTextWriter0 (writer);
}

