/* swell-foop.c generated by valac 0.16.0, the Vala compiler
 * generated from swell-foop.vala, do not modify */


#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <clutter/clutter.h>
#include <clutter-gtk/clutter-gtk.h>
#include <games-scores.h>
#include <games-stock.h>
#include <glib/gi18n-lib.h>
#include <gdk/gdk.h>
#include <games-score.h>
#include <float.h>
#include <math.h>
#include <games-scores-dialog.h>
#include <locale.h>
#include <stdio.h>


#define TYPE_SWELL_FOOP (swell_foop_get_type ())
#define SWELL_FOOP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SWELL_FOOP, SwellFoop))
#define SWELL_FOOP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SWELL_FOOP, SwellFoopClass))
#define IS_SWELL_FOOP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SWELL_FOOP))
#define IS_SWELL_FOOP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SWELL_FOOP))
#define SWELL_FOOP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SWELL_FOOP, SwellFoopClass))

typedef struct _SwellFoop SwellFoop;
typedef struct _SwellFoopClass SwellFoopClass;
typedef struct _SwellFoopPrivate SwellFoopPrivate;

#define TYPE_SIZE (size_get_type ())
typedef struct _Size Size;

#define TYPE_GAME (game_get_type ())
#define GAME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_GAME, Game))
#define GAME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GAME, GameClass))
#define IS_GAME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_GAME))
#define IS_GAME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GAME))
#define GAME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_GAME, GameClass))

typedef struct _Game Game;
typedef struct _GameClass GameClass;

#define TYPE_GAME_VIEW (game_view_get_type ())
#define GAME_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_GAME_VIEW, GameView))
#define GAME_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GAME_VIEW, GameViewClass))
#define IS_GAME_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_GAME_VIEW))
#define IS_GAME_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GAME_VIEW))
#define GAME_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_GAME_VIEW, GameViewClass))

typedef struct _GameView GameView;
typedef struct _GameViewClass GameViewClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _GameViewPrivate GameViewPrivate;
#define _g_option_context_free0(var) ((var == NULL) ? NULL : (var = (g_option_context_free (var), NULL)))

struct _Size {
	gchar* id;
	gchar* name;
	gint columns;
	gint rows;
};

struct _SwellFoop {
	GtkApplication parent_instance;
	SwellFoopPrivate * priv;
	Size* sizes;
	gint sizes_length1;
};

struct _SwellFoopClass {
	GtkApplicationClass parent_class;
};

struct _SwellFoopPrivate {
	GSettings* settings;
	GtkWindow* main_window;
	Game* game;
	GameView* view;
	ClutterStage* stage;
	GtkClutterEmbed* clutter_embed;
	GamesScores* high_scores;
	GtkDialog* preferences_dialog;
	GtkLabel* current_score_label;
};

struct _GameView {
	ClutterGroup parent_instance;
	GameViewPrivate * priv;
	gboolean is_zealous;
};

struct _GameViewClass {
	ClutterGroupClass parent_class;
};


static gpointer swell_foop_parent_class = NULL;

GType swell_foop_get_type (void) G_GNUC_CONST;
GType size_get_type (void) G_GNUC_CONST;
Size* size_dup (const Size* self);
void size_free (Size* self);
void size_copy (const Size* self, Size* dest);
void size_destroy (Size* self);
GType game_get_type (void) G_GNUC_CONST;
GType game_view_get_type (void) G_GNUC_CONST;
#define SWELL_FOOP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_SWELL_FOOP, SwellFoopPrivate))
enum  {
	SWELL_FOOP_DUMMY_PROPERTY
};
static void _vala_Size_array_free (Size* array, gint array_length);
static void swell_foop_new_game_cb (SwellFoop* self);
static void _swell_foop_new_game_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void swell_foop_scores_cb (SwellFoop* self);
static void _swell_foop_scores_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
void swell_foop_preferences_cb (SwellFoop* self);
static void _swell_foop_preferences_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void swell_foop_help_cb (SwellFoop* self);
static void _swell_foop_help_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void swell_foop_about_cb (SwellFoop* self);
static void _swell_foop_about_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void swell_foop_quit_cb (SwellFoop* self);
static void _swell_foop_quit_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void _swell_foop_new_game_cb_gtk_action_callback (GtkAction* action, gpointer self);
SwellFoop* swell_foop_new (void);
SwellFoop* swell_foop_construct (GType object_type);
static void swell_foop_real_startup (GApplication* base);
static void swell_foop_update_score_cb (SwellFoop* self, gint points_awarded);
static void swell_foop_get_size (SwellFoop* self, Size* result);
Game* game_new (gint rows, gint columns, gint color_num);
Game* game_construct (GType object_type, gint rows, gint columns, gint color_num);
static void _swell_foop_update_score_cb_game_update_score (Game* _sender, gint points_awarded, gpointer self);
static void swell_foop_complete_cb (SwellFoop* self);
static void _swell_foop_complete_cb_game_complete (Game* _sender, gpointer self);
GameView* game_view_new (void);
GameView* game_view_construct (GType object_type);
void game_view_set_theme_name (GameView* self, const gchar* value);
void game_view_set_game (GameView* self, Game* value);
gboolean game_view_board_left_cb (GameView* self);
static gboolean _game_view_board_left_cb_gtk_widget_leave_notify_event (GtkWidget* _sender, GdkEventCrossing* event, gpointer self);
static void _vala_GamesScoresCategory_array_free (GamesScoresCategory* array, gint array_length);
gint game_get_score (Game* self);
static void swell_foop_real_shutdown (GApplication* base);
gboolean game_has_completed (Game* self);
static void swell_foop_real_activate (GApplication* base);
static void swell_foop_preferences_response_cb (SwellFoop* self);
static void _swell_foop_preferences_response_cb_gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self);
void G_MODULE_EXPORT select_theme (GtkComboBox* theme_combo, SwellFoop* self);
void G_MODULE_EXPORT set_zealous_animation (GtkCheckButton* button, SwellFoop* self);
void G_MODULE_EXPORT update_size (GtkComboBox* size_combo, SwellFoop* self);
void swell_foop_new_game (SwellFoop* self);
void G_MODULE_EXPORT update_colors (GtkSpinButton* button, SwellFoop* self);
void swell_foop_show (SwellFoop* self);
gint swell_foop_main (gchar** args, int args_length1);
static void swell_foop_finalize (GObject* obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);

static const GActionEntry SWELL_FOOP_action_entries[6] = {{"new-game", _swell_foop_new_game_cb_gsimple_action_activate_callback}, {"scores", _swell_foop_scores_cb_gsimple_action_activate_callback}, {"preferences", _swell_foop_preferences_cb_gsimple_action_activate_callback}, {"help", _swell_foop_help_cb_gsimple_action_activate_callback}, {"about", _swell_foop_about_cb_gsimple_action_activate_callback}, {"quit", _swell_foop_quit_cb_gsimple_action_activate_callback}};
static const GtkActionEntry SWELL_FOOP_actions[1] = {{"NewGame", GAMES_STOCK_NEW_GAME, NULL, NULL, NULL, (GCallback) _swell_foop_new_game_cb_gtk_action_callback}};

static void _vala_Size_array_free (Size* array, gint array_length) {
	if (array != NULL) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			size_destroy (&array[i]);
		}
	}
	g_free (array);
}


static void _swell_foop_new_game_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	swell_foop_new_game_cb (self);
}


static void _swell_foop_scores_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	swell_foop_scores_cb (self);
}


static void _swell_foop_preferences_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	swell_foop_preferences_cb (self);
}


static void _swell_foop_help_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	swell_foop_help_cb (self);
}


static void _swell_foop_about_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	swell_foop_about_cb (self);
}


static void _swell_foop_quit_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	swell_foop_quit_cb (self);
}


static void _swell_foop_new_game_cb_gtk_action_callback (GtkAction* action, gpointer self) {
	swell_foop_new_game_cb (self);
}


SwellFoop* swell_foop_construct (GType object_type) {
	SwellFoop * self = NULL;
	self = (SwellFoop*) g_object_new (object_type, "application-id", "org.gnome.swell-foop", "flags", G_APPLICATION_FLAGS_NONE, NULL);
	return self;
}


SwellFoop* swell_foop_new (void) {
	return swell_foop_construct (TYPE_SWELL_FOOP);
}


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


static void _swell_foop_update_score_cb_game_update_score (Game* _sender, gint points_awarded, gpointer self) {
	swell_foop_update_score_cb (self, points_awarded);
}


static void _swell_foop_complete_cb_game_complete (Game* _sender, gpointer self) {
	swell_foop_complete_cb (self);
}


static gboolean _game_view_board_left_cb_gtk_widget_leave_notify_event (GtkWidget* _sender, GdkEventCrossing* event, gpointer self) {
	gboolean result;
	result = game_view_board_left_cb (self);
	return result;
}


static void _vala_GamesScoresCategory_array_free (GamesScoresCategory* array, gint array_length) {
	if (array != NULL) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			 (&array[i]);
		}
	}
	g_free (array);
}


static void swell_foop_real_startup (GApplication* base) {
	SwellFoop * self;
	GSettings* _tmp0_;
	GtkActionGroup* _tmp1_;
	GtkActionGroup* action_group;
	GtkAction* _tmp2_ = NULL;
	GtkApplicationWindow* _tmp3_;
	GtkWindow* _tmp4_;
	GtkWindow* _tmp5_;
	const gchar* _tmp6_ = NULL;
	GtkWindow* _tmp7_;
	GtkBox* _tmp8_;
	GtkBox* _tmp9_;
	GtkBox* vbox;
	GtkWindow* _tmp10_;
	GMenu* _tmp11_;
	GMenu* menu;
	GMenu* _tmp12_;
	GMenu* section;
	GMenu* _tmp13_;
	GMenu* _tmp14_;
	const gchar* _tmp15_ = NULL;
	GMenu* _tmp16_;
	const gchar* _tmp17_ = NULL;
	GMenu* _tmp18_;
	const gchar* _tmp19_ = NULL;
	GMenu* _tmp20_;
	GMenu* _tmp21_;
	GMenu* _tmp22_;
	const gchar* _tmp23_ = NULL;
	GMenu* _tmp24_;
	const gchar* _tmp25_ = NULL;
	GMenu* _tmp26_;
	GMenu* _tmp27_;
	GMenu* _tmp28_;
	const gchar* _tmp29_ = NULL;
	GtkUIManager* _tmp30_;
	GtkUIManager* ui_manager;
	GtkWindow* _tmp34_;
	GtkAccelGroup* _tmp35_ = NULL;
	GtkWidget* _tmp36_ = NULL;
	GtkToolbar* _tmp37_;
	GtkToolbar* toolbar;
	GtkStyleContext* _tmp38_ = NULL;
	GtkBox* _tmp39_;
	GtkBox* _tmp40_;
	GtkBox* status_box;
	GtkLabel* _tmp41_;
	GtkLabel* _tmp42_;
	GtkLabel* _tmp43_;
	GtkLabel* _tmp44_;
	GtkToolItem* _tmp45_;
	GtkToolItem* _tmp46_;
	GtkToolItem* status_item;
	GtkClutterEmbed* _tmp47_;
	GtkClutterEmbed* _tmp48_;
	GtkClutterEmbed* _tmp49_;
	GtkClutterEmbed* _tmp50_;
	GtkClutterEmbed* _tmp51_;
	ClutterActor* _tmp52_ = NULL;
	ClutterStage* _tmp53_;
	ClutterStage* _tmp54_;
	ClutterColor _tmp55_ = {0};
	Size* _tmp56_ = NULL;
	Size* _tmp57_;
	gint _tmp57__length1;
	gchar* _tmp58_;
	const gchar* _tmp59_ = NULL;
	gchar* _tmp60_;
	Size _tmp61_ = {0};
	Size _tmp62_;
	Size* _tmp63_;
	gint _tmp63__length1;
	gchar* _tmp64_;
	const gchar* _tmp65_ = NULL;
	gchar* _tmp66_;
	Size _tmp67_ = {0};
	Size _tmp68_;
	Size* _tmp69_;
	gint _tmp69__length1;
	gchar* _tmp70_;
	const gchar* _tmp71_ = NULL;
	gchar* _tmp72_;
	Size _tmp73_ = {0};
	Size _tmp74_;
	Size _tmp75_ = {0};
	Size _tmp76_;
	gint _tmp77_;
	Size _tmp78_ = {0};
	Size _tmp79_;
	gint _tmp80_;
	GSettings* _tmp81_;
	gint _tmp82_ = 0;
	Game* _tmp83_;
	Game* _tmp84_;
	Game* _tmp85_;
	GameView* _tmp86_;
	GameView* _tmp87_;
	GameView* _tmp88_;
	GSettings* _tmp89_;
	gchar* _tmp90_ = NULL;
	gchar* _tmp91_;
	GameView* _tmp92_;
	GSettings* _tmp93_;
	gboolean _tmp94_ = FALSE;
	GameView* _tmp95_;
	Game* _tmp96_;
	ClutterStage* _tmp97_;
	GameView* _tmp98_;
	ClutterStage* _tmp99_;
	GameView* _tmp100_;
	gfloat _tmp101_;
	gfloat _tmp102_;
	GameView* _tmp103_;
	gfloat _tmp104_;
	gfloat _tmp105_;
	GtkClutterEmbed* _tmp106_;
	ClutterStage* _tmp107_;
	gfloat _tmp108_;
	gfloat _tmp109_;
	ClutterStage* _tmp110_;
	gfloat _tmp111_;
	gfloat _tmp112_;
	GtkClutterEmbed* _tmp113_;
	GameView* _tmp114_;
	GamesScoresCategory* _tmp115_ = NULL;
	GamesScoresCategory* _tmp116_;
	gint _tmp116__length1;
	GamesScores* _tmp117_;
	GamesScores* _tmp118_;
	GSettings* _tmp119_;
	gchar* _tmp120_ = NULL;
	gchar* _tmp121_;
	GamesScores* _tmp122_;
	const gchar* _tmp123_ = NULL;
	GamesScores* _tmp124_;
	const gchar* _tmp125_ = NULL;
	GamesScores* _tmp126_;
	const gchar* _tmp127_ = NULL;
	GError * _inner_error_ = NULL;
	self = (SwellFoop*) base;
	G_APPLICATION_CLASS (swell_foop_parent_class)->startup ((GApplication*) GTK_APPLICATION (self));
	_tmp0_ = g_settings_new ("org.gnome.swell-foop");
	_g_object_unref0 (self->priv->settings);
	self->priv->settings = _tmp0_;
	games_stock_init ();
	g_action_map_add_action_entries ((GActionMap*) self, SWELL_FOOP_action_entries, G_N_ELEMENTS (SWELL_FOOP_action_entries), self);
	_tmp1_ = gtk_action_group_new ("group");
	action_group = _tmp1_;
	gtk_action_group_set_translation_domain (action_group, GETTEXT_PACKAGE);
	gtk_action_group_add_actions (action_group, SWELL_FOOP_actions, G_N_ELEMENTS (SWELL_FOOP_actions), self);
	_tmp2_ = gtk_action_group_get_action (action_group, "NewGame");
	gtk_action_set_is_important (_tmp2_, TRUE);
	_tmp3_ = (GtkApplicationWindow*) gtk_application_window_new ((GtkApplication*) self);
	_tmp4_ = (GtkWindow*) g_object_ref_sink (_tmp3_);
	_g_object_unref0 (self->priv->main_window);
	self->priv->main_window = _tmp4_;
	_tmp5_ = self->priv->main_window;
	_tmp6_ = _ ("Swell Foop");
	gtk_window_set_title (_tmp5_, _tmp6_);
	_tmp7_ = self->priv->main_window;
	gtk_window_set_resizable (_tmp7_, FALSE);
	_tmp8_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	_tmp9_ = g_object_ref_sink (_tmp8_);
	vbox = _tmp9_;
	gtk_widget_show ((GtkWidget*) vbox);
	_tmp10_ = self->priv->main_window;
	gtk_container_add ((GtkContainer*) _tmp10_, (GtkWidget*) vbox);
	_tmp11_ = g_menu_new ();
	menu = _tmp11_;
	_tmp12_ = g_menu_new ();
	section = _tmp12_;
	_tmp13_ = section;
	g_menu_append_section (menu, NULL, (GMenuModel*) _tmp13_);
	_tmp14_ = section;
	_tmp15_ = _ ("_New Game");
	g_menu_append (_tmp14_, _tmp15_, "app.new-game");
	_tmp16_ = section;
	_tmp17_ = _ ("_Scores");
	g_menu_append (_tmp16_, _tmp17_, "app.scores");
	_tmp18_ = section;
	_tmp19_ = _ ("_Preferences");
	g_menu_append (_tmp18_, _tmp19_, "app.preferences");
	_tmp20_ = g_menu_new ();
	_g_object_unref0 (section);
	section = _tmp20_;
	_tmp21_ = section;
	g_menu_append_section (menu, NULL, (GMenuModel*) _tmp21_);
	_tmp22_ = section;
	_tmp23_ = _ ("_Help");
	g_menu_append (_tmp22_, _tmp23_, "app.help");
	_tmp24_ = section;
	_tmp25_ = _ ("_About");
	g_menu_append (_tmp24_, _tmp25_, "app.about");
	_tmp26_ = g_menu_new ();
	_g_object_unref0 (section);
	section = _tmp26_;
	_tmp27_ = section;
	g_menu_append_section (menu, NULL, (GMenuModel*) _tmp27_);
	_tmp28_ = section;
	_tmp29_ = _ ("_Quit");
	g_menu_append (_tmp28_, _tmp29_, "app.quit");
	gtk_application_set_app_menu ((GtkApplication*) self, (GMenuModel*) menu);
	_tmp30_ = gtk_ui_manager_new ();
	ui_manager = _tmp30_;
	gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
	{
		gchar* _tmp31_;
		gchar* ui_description;
		_tmp31_ = g_strdup ("<ui>" "    <toolbar name='Toolbar'>" "        <toolitem action='NewGame'/>" "    </toolbar>" "</ui>");
		ui_description = _tmp31_;
		gtk_ui_manager_add_ui_from_string (ui_manager, ui_description, (gssize) (-1), &_inner_error_);
		if (_inner_error_ != NULL) {
			_g_free0 (ui_description);
			goto __catch1_g_error;
		}
		_g_free0 (ui_description);
	}
	goto __finally1;
	__catch1_g_error:
	{
		GError* e = NULL;
		GError* _tmp32_;
		const gchar* _tmp33_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp32_ = e;
		_tmp33_ = _tmp32_->message;
		g_warning ("swell-foop.vala:103: Failed to load UI: %s", _tmp33_);
		_g_error_free0 (e);
	}
	__finally1:
	if (_inner_error_ != NULL) {
		_g_object_unref0 (ui_manager);
		_g_object_unref0 (section);
		_g_object_unref0 (menu);
		_g_object_unref0 (vbox);
		_g_object_unref0 (action_group);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
	_tmp34_ = self->priv->main_window;
	_tmp35_ = gtk_ui_manager_get_accel_group (ui_manager);
	gtk_window_add_accel_group (_tmp34_, _tmp35_);
	_tmp36_ = gtk_ui_manager_get_widget (ui_manager, "/Toolbar");
	_tmp37_ = _g_object_ref0 (GTK_TOOLBAR (_tmp36_));
	toolbar = _tmp37_;
	gtk_toolbar_set_show_arrow (toolbar, FALSE);
	_tmp38_ = gtk_widget_get_style_context ((GtkWidget*) toolbar);
	gtk_style_context_add_class (_tmp38_, GTK_STYLE_CLASS_PRIMARY_TOOLBAR);
	gtk_widget_show ((GtkWidget*) toolbar);
	gtk_box_pack_start (vbox, (GtkWidget*) toolbar, FALSE, TRUE, (guint) 0);
	_tmp39_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
	_tmp40_ = g_object_ref_sink (_tmp39_);
	status_box = _tmp40_;
	gtk_widget_set_halign ((GtkWidget*) status_box, GTK_ALIGN_END);
	gtk_widget_set_valign ((GtkWidget*) status_box, GTK_ALIGN_CENTER);
	gtk_widget_show ((GtkWidget*) status_box);
	_tmp41_ = (GtkLabel*) gtk_label_new ("");
	_tmp42_ = g_object_ref_sink (_tmp41_);
	_g_object_unref0 (self->priv->current_score_label);
	self->priv->current_score_label = _tmp42_;
	_tmp43_ = self->priv->current_score_label;
	gtk_widget_show ((GtkWidget*) _tmp43_);
	_tmp44_ = self->priv->current_score_label;
	gtk_box_pack_start (status_box, (GtkWidget*) _tmp44_, FALSE, FALSE, (guint) 0);
	swell_foop_update_score_cb (self, 0);
	_tmp45_ = gtk_tool_item_new ();
	_tmp46_ = g_object_ref_sink (_tmp45_);
	status_item = _tmp46_;
	gtk_tool_item_set_expand (status_item, TRUE);
	gtk_container_add ((GtkContainer*) status_item, (GtkWidget*) status_box);
	gtk_widget_show ((GtkWidget*) status_item);
	gtk_toolbar_insert (toolbar, status_item, -1);
	_tmp47_ = (GtkClutterEmbed*) gtk_clutter_embed_new ();
	_tmp48_ = g_object_ref_sink (_tmp47_);
	_g_object_unref0 (self->priv->clutter_embed);
	self->priv->clutter_embed = _tmp48_;
	_tmp49_ = self->priv->clutter_embed;
	gtk_widget_show ((GtkWidget*) _tmp49_);
	_tmp50_ = self->priv->clutter_embed;
	gtk_box_pack_start (vbox, (GtkWidget*) _tmp50_, TRUE, TRUE, (guint) 0);
	_tmp51_ = self->priv->clutter_embed;
	_tmp52_ = gtk_clutter_embed_get_stage (_tmp51_);
	_tmp53_ = _g_object_ref0 (CLUTTER_STAGE (_tmp52_));
	_g_object_unref0 (self->priv->stage);
	self->priv->stage = _tmp53_;
	_tmp54_ = self->priv->stage;
	clutter_color_from_string (&_tmp55_, "#000000");
	clutter_stage_set_color (_tmp54_, &_tmp55_);
	_tmp56_ = g_new0 (Size, 3);
	self->sizes = (_vala_Size_array_free (self->sizes, self->sizes_length1), NULL);
	self->sizes = _tmp56_;
	self->sizes_length1 = 3;
	_tmp57_ = self->sizes;
	_tmp57__length1 = self->sizes_length1;
	_tmp58_ = g_strdup ("small");
	_tmp59_ = _ ("Small");
	_tmp60_ = g_strdup (_tmp59_);
	_g_free0 (_tmp61_.id);
	_tmp61_.id = _tmp58_;
	_g_free0 (_tmp61_.name);
	_tmp61_.name = _tmp60_;
	_tmp61_.columns = 6;
	_tmp61_.rows = 5;
	size_destroy (&_tmp57_[0]);
	_tmp57_[0] = _tmp61_;
	_tmp62_ = _tmp57_[0];
	_tmp63_ = self->sizes;
	_tmp63__length1 = self->sizes_length1;
	_tmp64_ = g_strdup ("normal");
	_tmp65_ = _ ("Normal");
	_tmp66_ = g_strdup (_tmp65_);
	_g_free0 (_tmp67_.id);
	_tmp67_.id = _tmp64_;
	_g_free0 (_tmp67_.name);
	_tmp67_.name = _tmp66_;
	_tmp67_.columns = 15;
	_tmp67_.rows = 10;
	size_destroy (&_tmp63_[1]);
	_tmp63_[1] = _tmp67_;
	_tmp68_ = _tmp63_[1];
	_tmp69_ = self->sizes;
	_tmp69__length1 = self->sizes_length1;
	_tmp70_ = g_strdup ("large");
	_tmp71_ = _ ("Large");
	_tmp72_ = g_strdup (_tmp71_);
	_g_free0 (_tmp73_.id);
	_tmp73_.id = _tmp70_;
	_g_free0 (_tmp73_.name);
	_tmp73_.name = _tmp72_;
	_tmp73_.columns = 20;
	_tmp73_.rows = 15;
	size_destroy (&_tmp69_[2]);
	_tmp69_[2] = _tmp73_;
	_tmp74_ = _tmp69_[2];
	swell_foop_get_size (self, &_tmp75_);
	_tmp76_ = _tmp75_;
	_tmp77_ = _tmp76_.rows;
	swell_foop_get_size (self, &_tmp78_);
	_tmp79_ = _tmp78_;
	_tmp80_ = _tmp79_.columns;
	_tmp81_ = self->priv->settings;
	_tmp82_ = g_settings_get_int (_tmp81_, "colors");
	_tmp83_ = game_new (_tmp77_, _tmp80_, _tmp82_);
	_g_object_unref0 (self->priv->game);
	self->priv->game = _tmp83_;
	size_destroy (&_tmp79_);
	size_destroy (&_tmp76_);
	_tmp84_ = self->priv->game;
	g_signal_connect_object (_tmp84_, "update-score", (GCallback) _swell_foop_update_score_cb_game_update_score, self, 0);
	_tmp85_ = self->priv->game;
	g_signal_connect_object (_tmp85_, "complete", (GCallback) _swell_foop_complete_cb_game_complete, self, 0);
	_tmp86_ = game_view_new ();
	_tmp87_ = g_object_ref_sink (_tmp86_);
	_g_object_unref0 (self->priv->view);
	self->priv->view = _tmp87_;
	_tmp88_ = self->priv->view;
	_tmp89_ = self->priv->settings;
	_tmp90_ = g_settings_get_string (_tmp89_, "theme");
	_tmp91_ = _tmp90_;
	game_view_set_theme_name (_tmp88_, _tmp91_);
	_g_free0 (_tmp91_);
	_tmp92_ = self->priv->view;
	_tmp93_ = self->priv->settings;
	_tmp94_ = g_settings_get_boolean (_tmp93_, "zealous");
	_tmp92_->is_zealous = _tmp94_;
	_tmp95_ = self->priv->view;
	_tmp96_ = self->priv->game;
	game_view_set_game (_tmp95_, _tmp96_);
	_tmp97_ = self->priv->stage;
	_tmp98_ = self->priv->view;
	clutter_container_add_actor ((ClutterContainer*) _tmp97_, (ClutterActor*) _tmp98_);
	_tmp99_ = self->priv->stage;
	_tmp100_ = self->priv->view;
	_tmp101_ = clutter_actor_get_width ((ClutterActor*) _tmp100_);
	_tmp102_ = _tmp101_;
	_tmp103_ = self->priv->view;
	_tmp104_ = clutter_actor_get_height ((ClutterActor*) _tmp103_);
	_tmp105_ = _tmp104_;
	clutter_actor_set_size ((ClutterActor*) _tmp99_, _tmp102_, _tmp105_);
	_tmp106_ = self->priv->clutter_embed;
	_tmp107_ = self->priv->stage;
	_tmp108_ = clutter_actor_get_width ((ClutterActor*) _tmp107_);
	_tmp109_ = _tmp108_;
	_tmp110_ = self->priv->stage;
	_tmp111_ = clutter_actor_get_height ((ClutterActor*) _tmp110_);
	_tmp112_ = _tmp111_;
	gtk_widget_set_size_request ((GtkWidget*) _tmp106_, (gint) _tmp109_, (gint) _tmp112_);
	_tmp113_ = self->priv->clutter_embed;
	_tmp114_ = self->priv->view;
	g_signal_connect_object ((GtkWidget*) _tmp113_, "leave-notify-event", (GCallback) _game_view_board_left_cb_gtk_widget_leave_notify_event, _tmp114_, 0);
	_tmp115_ = g_new0 (GamesScoresCategory, 0);
	_tmp116_ = _tmp115_;
	_tmp116__length1 = 0;
	_tmp117_ = games_scores_new ("swell-foop", _tmp116_, 0, NULL, NULL, 0, GAMES_SCORES_STYLE_PLAIN_DESCENDING);
	_g_object_unref0 (self->priv->high_scores);
	self->priv->high_scores = _tmp117_;
	_tmp116_ = (_vala_GamesScoresCategory_array_free (_tmp116_, _tmp116__length1), NULL);
	_tmp118_ = self->priv->high_scores;
	_tmp119_ = self->priv->settings;
	_tmp120_ = g_settings_get_string (_tmp119_, "size");
	_tmp121_ = _tmp120_;
	games_scores_set_category (_tmp118_, _tmp121_);
	_g_free0 (_tmp121_);
	_tmp122_ = self->priv->high_scores;
	_tmp123_ = _ ("Small");
	games_scores_add_category (_tmp122_, "small", _tmp123_);
	_tmp124_ = self->priv->high_scores;
	_tmp125_ = _ ("Normal");
	games_scores_add_category (_tmp124_, "normal", _tmp125_);
	_tmp126_ = self->priv->high_scores;
	_tmp127_ = _ ("Large");
	games_scores_add_category (_tmp126_, "large", _tmp127_);
	_g_object_unref0 (status_item);
	_g_object_unref0 (status_box);
	_g_object_unref0 (toolbar);
	_g_object_unref0 (ui_manager);
	_g_object_unref0 (section);
	_g_object_unref0 (menu);
	_g_object_unref0 (vbox);
	_g_object_unref0 (action_group);
}


static void swell_foop_get_size (SwellFoop* self, Size* result) {
	Size* _tmp17_;
	gint _tmp17__length1;
	Size _tmp18_;
	Size _tmp19_ = {0};
	g_return_if_fail (self != NULL);
	{
		gint i;
		i = 0;
		{
			gboolean _tmp0_;
			_tmp0_ = TRUE;
			while (TRUE) {
				gboolean _tmp1_;
				gint _tmp3_;
				Size* _tmp4_;
				gint _tmp4__length1;
				Size* _tmp5_;
				gint _tmp5__length1;
				gint _tmp6_;
				Size _tmp7_;
				const gchar* _tmp8_;
				GSettings* _tmp9_;
				gchar* _tmp10_ = NULL;
				gchar* _tmp11_;
				gboolean _tmp12_;
				_tmp1_ = _tmp0_;
				if (!_tmp1_) {
					gint _tmp2_;
					_tmp2_ = i;
					i = _tmp2_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp3_ = i;
				_tmp4_ = self->sizes;
				_tmp4__length1 = self->sizes_length1;
				if (!(_tmp3_ < _tmp4__length1)) {
					break;
				}
				_tmp5_ = self->sizes;
				_tmp5__length1 = self->sizes_length1;
				_tmp6_ = i;
				_tmp7_ = _tmp5_[_tmp6_];
				_tmp8_ = _tmp7_.id;
				_tmp9_ = self->priv->settings;
				_tmp10_ = g_settings_get_string (_tmp9_, "size");
				_tmp11_ = _tmp10_;
				_tmp12_ = g_strcmp0 (_tmp8_, _tmp11_) == 0;
				_g_free0 (_tmp11_);
				if (_tmp12_) {
					Size* _tmp13_;
					gint _tmp13__length1;
					gint _tmp14_;
					Size _tmp15_;
					Size _tmp16_ = {0};
					_tmp13_ = self->sizes;
					_tmp13__length1 = self->sizes_length1;
					_tmp14_ = i;
					_tmp15_ = _tmp13_[_tmp14_];
					size_copy (&_tmp15_, &_tmp16_);
					*result = _tmp16_;
					return;
				}
			}
		}
	}
	_tmp17_ = self->sizes;
	_tmp17__length1 = self->sizes_length1;
	_tmp18_ = _tmp17_[0];
	size_copy (&_tmp18_, &_tmp19_);
	*result = _tmp19_;
	return;
}


static void swell_foop_update_score_cb (SwellFoop* self, gint points_awarded) {
	gint score;
	Game* _tmp0_;
	GtkLabel* _tmp4_;
	const gchar* _tmp5_ = NULL;
	gint _tmp6_;
	gchar* _tmp7_ = NULL;
	gchar* _tmp8_;
	g_return_if_fail (self != NULL);
	score = 0;
	_tmp0_ = self->priv->game;
	if (_tmp0_ != NULL) {
		Game* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		_tmp1_ = self->priv->game;
		_tmp2_ = game_get_score (_tmp1_);
		_tmp3_ = _tmp2_;
		score = _tmp3_;
	}
	_tmp4_ = self->priv->current_score_label;
	_tmp5_ = _ ("Score: %4u ");
	_tmp6_ = score;
	_tmp7_ = g_strdup_printf (_tmp5_, _tmp6_);
	_tmp8_ = _tmp7_;
	gtk_label_set_text (_tmp4_, _tmp8_);
	_g_free0 (_tmp8_);
}


static void swell_foop_complete_cb (SwellFoop* self) {
	GamesScores* _tmp0_;
	Game* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->high_scores;
	_tmp1_ = self->priv->game;
	_tmp2_ = game_get_score (_tmp1_);
	_tmp3_ = _tmp2_;
	games_scores_add_plain_score (_tmp0_, (guint32) _tmp3_);
}


static void swell_foop_real_shutdown (GApplication* base) {
	SwellFoop * self;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	Game* _tmp2_;
	gboolean _tmp5_;
	gboolean _tmp9_;
	self = (SwellFoop*) base;
	G_APPLICATION_CLASS (swell_foop_parent_class)->shutdown ((GApplication*) GTK_APPLICATION (self));
	_tmp2_ = self->priv->game;
	if (_tmp2_ != NULL) {
		Game* _tmp3_;
		gboolean _tmp4_ = FALSE;
		_tmp3_ = self->priv->game;
		_tmp4_ = game_has_completed (_tmp3_);
		_tmp1_ = !_tmp4_;
	} else {
		_tmp1_ = FALSE;
	}
	_tmp5_ = _tmp1_;
	if (_tmp5_) {
		Game* _tmp6_;
		gint _tmp7_;
		gint _tmp8_;
		_tmp6_ = self->priv->game;
		_tmp7_ = game_get_score (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp0_ = _tmp8_ > 0;
	} else {
		_tmp0_ = FALSE;
	}
	_tmp9_ = _tmp0_;
	if (_tmp9_) {
		GamesScores* _tmp10_;
		Game* _tmp11_;
		gint _tmp12_;
		gint _tmp13_;
		_tmp10_ = self->priv->high_scores;
		_tmp11_ = self->priv->game;
		_tmp12_ = game_get_score (_tmp11_);
		_tmp13_ = _tmp12_;
		games_scores_add_plain_score (_tmp10_, (guint32) _tmp13_);
	}
}


static void swell_foop_real_activate (GApplication* base) {
	SwellFoop * self;
	GtkWindow* _tmp0_;
	self = (SwellFoop*) base;
	_tmp0_ = self->priv->main_window;
	gtk_window_present (_tmp0_);
}


static void _swell_foop_preferences_response_cb_gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self) {
	swell_foop_preferences_response_cb (self);
}


void swell_foop_preferences_cb (SwellFoop* self) {
	GtkDialog* _tmp0_;
	GtkBuilder* _tmp2_;
	GtkBuilder* preferences_builder;
	GtkBuilder* _tmp8_;
	GObject* _tmp9_ = NULL;
	GtkDialog* _tmp10_;
	GtkBuilder* _tmp11_;
	GObject* _tmp12_ = NULL;
	GtkComboBox* _tmp13_;
	GtkComboBox* theme_combo;
	GtkComboBox* _tmp14_;
	GtkTreeModel* _tmp15_;
	GtkTreeModel* _tmp16_;
	GtkListStore* _tmp17_;
	GtkListStore* model;
	GtkTreeIter iter = {0};
	GtkListStore* _tmp18_;
	GtkTreeIter _tmp19_ = {0};
	GtkListStore* _tmp20_;
	GtkTreeIter _tmp21_;
	const gchar* _tmp22_ = NULL;
	GSettings* _tmp23_;
	gchar* _tmp24_ = NULL;
	gchar* _tmp25_;
	gboolean _tmp26_;
	GtkListStore* _tmp29_;
	GtkTreeIter _tmp30_ = {0};
	GtkListStore* _tmp31_;
	GtkTreeIter _tmp32_;
	const gchar* _tmp33_ = NULL;
	GSettings* _tmp34_;
	gchar* _tmp35_ = NULL;
	gchar* _tmp36_;
	gboolean _tmp37_;
	GtkBuilder* _tmp40_;
	GObject* _tmp41_ = NULL;
	GtkComboBox* _tmp42_;
	GtkComboBox* size_combo;
	GtkComboBox* _tmp43_;
	GtkTreeModel* _tmp44_;
	GtkTreeModel* _tmp45_;
	GtkListStore* _tmp46_;
	GtkBuilder* _tmp74_;
	GObject* _tmp75_ = NULL;
	GSettings* _tmp76_;
	gint _tmp77_ = 0;
	GtkBuilder* _tmp78_;
	GObject* _tmp79_ = NULL;
	GSettings* _tmp80_;
	gboolean _tmp81_ = FALSE;
	GtkBuilder* _tmp82_;
	GtkDialog* _tmp83_;
	GtkDialog* _tmp84_;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->preferences_dialog;
	if (_tmp0_ != NULL) {
		GtkDialog* _tmp1_;
		_tmp1_ = self->priv->preferences_dialog;
		gtk_window_present ((GtkWindow*) _tmp1_);
		return;
	}
	_tmp2_ = gtk_builder_new ();
	preferences_builder = _tmp2_;
	{
		GtkBuilder* _tmp3_;
		gchar* _tmp4_ = NULL;
		gchar* _tmp5_;
		_tmp3_ = preferences_builder;
		_tmp4_ = g_build_filename (DATADIR, "preferences.ui", NULL, NULL);
		_tmp5_ = _tmp4_;
		gtk_builder_add_from_file (_tmp3_, _tmp5_, &_inner_error_);
		_g_free0 (_tmp5_);
		if (_inner_error_ != NULL) {
			goto __catch2_g_error;
		}
	}
	goto __finally2;
	__catch2_g_error:
	{
		GError* e = NULL;
		GError* _tmp6_;
		const gchar* _tmp7_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp6_ = e;
		_tmp7_ = _tmp6_->message;
		g_warning ("swell-foop.vala:234: Could not load preferences UI: %s", _tmp7_);
		_g_error_free0 (e);
	}
	__finally2:
	if (_inner_error_ != NULL) {
		_g_object_unref0 (preferences_builder);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
	_tmp8_ = preferences_builder;
	_tmp9_ = gtk_builder_get_object (_tmp8_, "preferences");
	_tmp10_ = _g_object_ref0 (GTK_DIALOG (_tmp9_));
	_g_object_unref0 (self->priv->preferences_dialog);
	self->priv->preferences_dialog = _tmp10_;
	_tmp11_ = preferences_builder;
	_tmp12_ = gtk_builder_get_object (_tmp11_, "theme-selector");
	_tmp13_ = _g_object_ref0 (GTK_IS_COMBO_BOX (_tmp12_) ? ((GtkComboBox*) _tmp12_) : NULL);
	theme_combo = _tmp13_;
	_tmp14_ = theme_combo;
	_tmp15_ = gtk_combo_box_get_model (_tmp14_);
	_tmp16_ = _tmp15_;
	_tmp17_ = _g_object_ref0 (GTK_LIST_STORE (_tmp16_));
	model = _tmp17_;
	_tmp18_ = model;
	gtk_list_store_append (_tmp18_, &_tmp19_);
	iter = _tmp19_;
	_tmp20_ = model;
	_tmp21_ = iter;
	_tmp22_ = _ ("Colors");
	gtk_list_store_set (_tmp20_, &_tmp21_, 0, _tmp22_, 1, "colors", -1, -1);
	_tmp23_ = self->priv->settings;
	_tmp24_ = g_settings_get_string (_tmp23_, "theme");
	_tmp25_ = _tmp24_;
	_tmp26_ = g_strcmp0 (_tmp25_, "colors") == 0;
	_g_free0 (_tmp25_);
	if (_tmp26_) {
		GtkComboBox* _tmp27_;
		GtkTreeIter _tmp28_;
		_tmp27_ = theme_combo;
		_tmp28_ = iter;
		gtk_combo_box_set_active_iter (_tmp27_, &_tmp28_);
	}
	_tmp29_ = model;
	gtk_list_store_append (_tmp29_, &_tmp30_);
	iter = _tmp30_;
	_tmp31_ = model;
	_tmp32_ = iter;
	_tmp33_ = _ ("Shapes and Colors");
	gtk_list_store_set (_tmp31_, &_tmp32_, 0, _tmp33_, 1, "shapesandcolors", -1, -1);
	_tmp34_ = self->priv->settings;
	_tmp35_ = g_settings_get_string (_tmp34_, "theme");
	_tmp36_ = _tmp35_;
	_tmp37_ = g_strcmp0 (_tmp36_, "shapesandcolors") == 0;
	_g_free0 (_tmp36_);
	if (_tmp37_) {
		GtkComboBox* _tmp38_;
		GtkTreeIter _tmp39_;
		_tmp38_ = theme_combo;
		_tmp39_ = iter;
		gtk_combo_box_set_active_iter (_tmp38_, &_tmp39_);
	}
	_tmp40_ = preferences_builder;
	_tmp41_ = gtk_builder_get_object (_tmp40_, "size-selector");
	_tmp42_ = _g_object_ref0 (GTK_IS_COMBO_BOX (_tmp41_) ? ((GtkComboBox*) _tmp41_) : NULL);
	size_combo = _tmp42_;
	_tmp43_ = size_combo;
	_tmp44_ = gtk_combo_box_get_model (_tmp43_);
	_tmp45_ = _tmp44_;
	_tmp46_ = _g_object_ref0 (GTK_LIST_STORE (_tmp45_));
	_g_object_unref0 (model);
	model = _tmp46_;
	{
		gint i;
		i = 0;
		{
			gboolean _tmp47_;
			_tmp47_ = TRUE;
			while (TRUE) {
				gboolean _tmp48_;
				gint _tmp50_;
				Size* _tmp51_;
				gint _tmp51__length1;
				GtkListStore* _tmp52_;
				GtkTreeIter _tmp53_ = {0};
				GtkListStore* _tmp54_;
				GtkTreeIter _tmp55_;
				Size* _tmp56_;
				gint _tmp56__length1;
				gint _tmp57_;
				Size _tmp58_;
				const gchar* _tmp59_;
				Size* _tmp60_;
				gint _tmp60__length1;
				gint _tmp61_;
				Size _tmp62_;
				const gchar* _tmp63_;
				GSettings* _tmp64_;
				gchar* _tmp65_ = NULL;
				gchar* _tmp66_;
				Size* _tmp67_;
				gint _tmp67__length1;
				gint _tmp68_;
				Size _tmp69_;
				const gchar* _tmp70_;
				gboolean _tmp71_;
				_tmp48_ = _tmp47_;
				if (!_tmp48_) {
					gint _tmp49_;
					_tmp49_ = i;
					i = _tmp49_ + 1;
				}
				_tmp47_ = FALSE;
				_tmp50_ = i;
				_tmp51_ = self->sizes;
				_tmp51__length1 = self->sizes_length1;
				if (!(_tmp50_ < _tmp51__length1)) {
					break;
				}
				_tmp52_ = model;
				gtk_list_store_append (_tmp52_, &_tmp53_);
				iter = _tmp53_;
				_tmp54_ = model;
				_tmp55_ = iter;
				_tmp56_ = self->sizes;
				_tmp56__length1 = self->sizes_length1;
				_tmp57_ = i;
				_tmp58_ = _tmp56_[_tmp57_];
				_tmp59_ = _tmp58_.name;
				_tmp60_ = self->sizes;
				_tmp60__length1 = self->sizes_length1;
				_tmp61_ = i;
				_tmp62_ = _tmp60_[_tmp61_];
				_tmp63_ = _tmp62_.id;
				gtk_list_store_set (_tmp54_, &_tmp55_, 0, _tmp59_, 1, _tmp63_, -1, -1);
				_tmp64_ = self->priv->settings;
				_tmp65_ = g_settings_get_string (_tmp64_, "size");
				_tmp66_ = _tmp65_;
				_tmp67_ = self->sizes;
				_tmp67__length1 = self->sizes_length1;
				_tmp68_ = i;
				_tmp69_ = _tmp67_[_tmp68_];
				_tmp70_ = _tmp69_.id;
				_tmp71_ = g_strcmp0 (_tmp66_, _tmp70_) == 0;
				_g_free0 (_tmp66_);
				if (_tmp71_) {
					GtkComboBox* _tmp72_;
					GtkTreeIter _tmp73_;
					_tmp72_ = size_combo;
					_tmp73_ = iter;
					gtk_combo_box_set_active_iter (_tmp72_, &_tmp73_);
				}
			}
		}
	}
	_tmp74_ = preferences_builder;
	_tmp75_ = gtk_builder_get_object (_tmp74_, "colors-spinner");
	_tmp76_ = self->priv->settings;
	_tmp77_ = g_settings_get_int (_tmp76_, "colors");
	gtk_spin_button_set_value (GTK_SPIN_BUTTON (_tmp75_), (gdouble) _tmp77_);
	_tmp78_ = preferences_builder;
	_tmp79_ = gtk_builder_get_object (_tmp78_, "zealous-checkbox");
	_tmp80_ = self->priv->settings;
	_tmp81_ = g_settings_get_boolean (_tmp80_, "zealous");
	gtk_toggle_button_set_active ((GtkToggleButton*) GTK_CHECK_BUTTON (_tmp79_), _tmp81_);
	_tmp82_ = preferences_builder;
	gtk_builder_connect_signals (_tmp82_, self);
	_tmp83_ = self->priv->preferences_dialog;
	g_signal_connect_object (_tmp83_, "response", (GCallback) _swell_foop_preferences_response_cb_gtk_dialog_response, self, 0);
	_tmp84_ = self->priv->preferences_dialog;
	gtk_window_present ((GtkWindow*) _tmp84_);
	_g_object_unref0 (size_combo);
	_g_object_unref0 (model);
	_g_object_unref0 (theme_combo);
	_g_object_unref0 (preferences_builder);
}


void G_MODULE_EXPORT select_theme (GtkComboBox* theme_combo, SwellFoop* self) {
	GtkTreeIter iter = {0};
	GtkComboBox* _tmp0_;
	GtkTreeIter _tmp1_ = {0};
	gboolean _tmp2_ = FALSE;
	gchar* new_theme = NULL;
	GtkComboBox* _tmp3_;
	GtkTreeModel* _tmp4_;
	GtkTreeModel* _tmp5_;
	GtkTreeIter _tmp6_;
	const gchar* _tmp7_;
	GSettings* _tmp8_;
	gchar* _tmp9_ = NULL;
	gchar* _tmp10_;
	gboolean _tmp11_;
	GSettings* _tmp12_;
	const gchar* _tmp13_;
	GameView* _tmp14_;
	const gchar* _tmp15_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (theme_combo != NULL);
	_tmp0_ = theme_combo;
	_tmp2_ = gtk_combo_box_get_active_iter (_tmp0_, &_tmp1_);
	iter = _tmp1_;
	if (!_tmp2_) {
		return;
	}
	_tmp3_ = theme_combo;
	_tmp4_ = gtk_combo_box_get_model (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = iter;
	gtk_tree_model_get (_tmp5_, &_tmp6_, 1, &new_theme, -1, -1);
	_tmp7_ = new_theme;
	_tmp8_ = self->priv->settings;
	_tmp9_ = g_settings_get_string (_tmp8_, "theme");
	_tmp10_ = _tmp9_;
	_tmp11_ = g_strcmp0 (_tmp7_, _tmp10_) == 0;
	_g_free0 (_tmp10_);
	if (_tmp11_) {
		_g_free0 (new_theme);
		return;
	}
	_tmp12_ = self->priv->settings;
	_tmp13_ = new_theme;
	g_settings_set_string (_tmp12_, "theme", _tmp13_);
	_tmp14_ = self->priv->view;
	_tmp15_ = new_theme;
	game_view_set_theme_name (_tmp14_, _tmp15_);
	_g_free0 (new_theme);
}


void G_MODULE_EXPORT set_zealous_animation (GtkCheckButton* button, SwellFoop* self) {
	GSettings* _tmp0_;
	GtkCheckButton* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	GameView* _tmp4_;
	GSettings* _tmp5_;
	gboolean _tmp6_ = FALSE;
	g_return_if_fail (self != NULL);
	g_return_if_fail (button != NULL);
	_tmp0_ = self->priv->settings;
	_tmp1_ = button;
	_tmp2_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp1_);
	_tmp3_ = _tmp2_;
	g_settings_set_boolean (_tmp0_, "zealous", _tmp3_);
	_tmp4_ = self->priv->view;
	_tmp5_ = self->priv->settings;
	_tmp6_ = g_settings_get_boolean (_tmp5_, "zealous");
	_tmp4_->is_zealous = _tmp6_;
}


void G_MODULE_EXPORT update_size (GtkComboBox* size_combo, SwellFoop* self) {
	GtkTreeIter iter = {0};
	GtkComboBox* _tmp0_;
	GtkTreeIter _tmp1_ = {0};
	gboolean _tmp2_ = FALSE;
	gchar* new_size = NULL;
	GtkComboBox* _tmp3_;
	GtkTreeModel* _tmp4_;
	GtkTreeModel* _tmp5_;
	GtkTreeIter _tmp6_;
	const gchar* _tmp7_;
	GSettings* _tmp8_;
	gchar* _tmp9_ = NULL;
	gchar* _tmp10_;
	gboolean _tmp11_;
	GSettings* _tmp12_;
	const gchar* _tmp13_;
	GamesScores* _tmp14_;
	const gchar* _tmp15_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (size_combo != NULL);
	_tmp0_ = size_combo;
	_tmp2_ = gtk_combo_box_get_active_iter (_tmp0_, &_tmp1_);
	iter = _tmp1_;
	if (!_tmp2_) {
		return;
	}
	_tmp3_ = size_combo;
	_tmp4_ = gtk_combo_box_get_model (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = iter;
	gtk_tree_model_get (_tmp5_, &_tmp6_, 1, &new_size, -1, -1);
	_tmp7_ = new_size;
	_tmp8_ = self->priv->settings;
	_tmp9_ = g_settings_get_string (_tmp8_, "size");
	_tmp10_ = _tmp9_;
	_tmp11_ = g_strcmp0 (_tmp7_, _tmp10_) == 0;
	_g_free0 (_tmp10_);
	if (_tmp11_) {
		_g_free0 (new_size);
		return;
	}
	_tmp12_ = self->priv->settings;
	_tmp13_ = new_size;
	g_settings_set_string (_tmp12_, "size", _tmp13_);
	_tmp14_ = self->priv->high_scores;
	_tmp15_ = new_size;
	games_scores_set_category (_tmp14_, _tmp15_);
	swell_foop_new_game (self);
	_g_free0 (new_size);
}


void G_MODULE_EXPORT update_colors (GtkSpinButton* button, SwellFoop* self) {
	GtkSpinButton* _tmp0_;
	gdouble _tmp1_ = 0.0;
	gint new_colors;
	gint _tmp2_;
	GSettings* _tmp3_;
	gint _tmp4_ = 0;
	GSettings* _tmp5_;
	gint _tmp6_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (button != NULL);
	_tmp0_ = button;
	_tmp1_ = gtk_spin_button_get_value (_tmp0_);
	new_colors = (gint) _tmp1_;
	_tmp2_ = new_colors;
	_tmp3_ = self->priv->settings;
	_tmp4_ = g_settings_get_int (_tmp3_, "colors");
	if (_tmp2_ == _tmp4_) {
		return;
	}
	_tmp5_ = self->priv->settings;
	_tmp6_ = new_colors;
	g_settings_set_int (_tmp5_, "colors", _tmp6_);
	swell_foop_new_game (self);
}


static void swell_foop_preferences_response_cb (SwellFoop* self) {
	GtkDialog* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->preferences_dialog;
	gtk_widget_destroy ((GtkWidget*) _tmp0_);
	_g_object_unref0 (self->priv->preferences_dialog);
	self->priv->preferences_dialog = NULL;
}


void swell_foop_show (SwellFoop* self) {
	GtkWindow* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->main_window;
	gtk_widget_show ((GtkWidget*) _tmp0_);
}


static void swell_foop_new_game_cb (SwellFoop* self) {
	g_return_if_fail (self != NULL);
	swell_foop_new_game (self);
}


static void swell_foop_scores_cb (SwellFoop* self) {
	GtkWindow* _tmp0_;
	GamesScores* _tmp1_;
	const gchar* _tmp2_ = NULL;
	GamesScoresDialog* _tmp3_;
	GamesScoresDialog* _tmp4_;
	GamesScoresDialog* scores_dialog;
	const gchar* _tmp5_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->main_window;
	_tmp1_ = self->priv->high_scores;
	_tmp2_ = _ ("Swell Foop Scores");
	_tmp3_ = games_scores_dialog_new (_tmp0_, _tmp1_, _tmp2_);
	_tmp4_ = g_object_ref_sink (_tmp3_);
	scores_dialog = _tmp4_;
	_tmp5_ = _ ("Size:");
	games_scores_dialog_set_category_description (scores_dialog, _tmp5_);
	gtk_dialog_run ((GtkDialog*) scores_dialog);
	gtk_widget_destroy ((GtkWidget*) scores_dialog);
	_g_object_unref0 (scores_dialog);
}


static void swell_foop_quit_cb (SwellFoop* self) {
	GtkWindow* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->main_window;
	gtk_widget_destroy ((GtkWidget*) _tmp0_);
}


static void swell_foop_help_cb (SwellFoop* self) {
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	{
		GtkWindow* _tmp0_;
		GdkScreen* _tmp1_ = NULL;
		guint32 _tmp2_ = 0U;
		_tmp0_ = self->priv->main_window;
		_tmp1_ = gtk_window_get_screen (_tmp0_);
		_tmp2_ = gtk_get_current_event_time ();
		gtk_show_uri (_tmp1_, "help:swell-foop", _tmp2_, &_inner_error_);
		if (_inner_error_ != NULL) {
			goto __catch3_g_error;
		}
	}
	goto __finally3;
	__catch3_g_error:
	{
		GError* e = NULL;
		GError* _tmp3_;
		const gchar* _tmp4_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp3_ = e;
		_tmp4_ = _tmp3_->message;
		g_warning ("swell-foop.vala:364: Failed to show help: %s", _tmp4_);
		_g_error_free0 (e);
	}
	__finally3:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
}


static void swell_foop_about_cb (SwellFoop* self) {
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar** _tmp2_ = NULL;
	gchar** authors;
	gint authors_length1;
	gint _authors_size_;
	gchar* _tmp3_;
	gchar** _tmp4_ = NULL;
	gchar** artists;
	gint artists_length1;
	gint _artists_size_;
	gchar** _tmp5_ = NULL;
	gchar** documenters;
	gint documenters_length1;
	gint _documenters_size_;
	GtkWindow* _tmp6_;
	const gchar* _tmp7_ = NULL;
	const gchar* _tmp8_ = NULL;
	const gchar* _tmp9_ = NULL;
	const gchar* _tmp10_ = NULL;
	gchar* _tmp11_ = NULL;
	gchar* _tmp12_;
	const gchar* _tmp13_ = NULL;
	const gchar* _tmp14_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup ("Tim Horton");
	_tmp1_ = g_strdup ("Sophia Yu");
	_tmp2_ = g_new0 (gchar*, 3 + 1);
	_tmp2_[0] = _tmp0_;
	_tmp2_[1] = _tmp1_;
	_tmp2_[2] = NULL;
	authors = _tmp2_;
	authors_length1 = 3;
	_authors_size_ = authors_length1;
	_tmp3_ = g_strdup ("Tim Horton");
	_tmp4_ = g_new0 (gchar*, 2 + 1);
	_tmp4_[0] = _tmp3_;
	_tmp4_[1] = NULL;
	artists = _tmp4_;
	artists_length1 = 2;
	_artists_size_ = artists_length1;
	_tmp5_ = g_new0 (gchar*, 1 + 1);
	_tmp5_[0] = NULL;
	documenters = _tmp5_;
	documenters_length1 = 1;
	_documenters_size_ = documenters_length1;
	_tmp6_ = self->priv->main_window;
	_tmp7_ = _ ("Swell Foop");
	_tmp8_ = _ ("I want to play that game! You know, they all light-up and you click on" \
" them and they vanish!\n" \
"\n" \
"Swell Foop is a part of GNOME Games.");
	_tmp9_ = _ ("Copyright \xc2\xa9 2009 Tim Horton");
	_tmp10_ = _ ("Swell Foop");
	_tmp11_ = games_get_license (_tmp10_);
	_tmp12_ = _tmp11_;
	_tmp13_ = _ ("translator-credits");
	_tmp14_ = _ ("GNOME Games web site");
	gtk_show_about_dialog (_tmp6_, "program-name", _tmp7_, "version", VERSION, "comments", _tmp8_, "copyright", _tmp9_, "license", _tmp12_, "wrap-license", TRUE, "authors", authors, "artists", artists, "documenters", documenters, "translator-credits", _tmp13_, "logo-icon-name", "gnome-swell-foop", "website", "http://www.gnome.org/projects/gnome-games", "website-label", _tmp14_, NULL, NULL);
	_g_free0 (_tmp12_);
	documenters = (_vala_array_free (documenters, documenters_length1, (GDestroyNotify) g_free), NULL);
	artists = (_vala_array_free (artists, artists_length1, (GDestroyNotify) g_free), NULL);
	authors = (_vala_array_free (authors, authors_length1, (GDestroyNotify) g_free), NULL);
}


void swell_foop_new_game (SwellFoop* self) {
	Size _tmp0_ = {0};
	Size _tmp1_;
	gint _tmp2_;
	Size _tmp3_ = {0};
	Size _tmp4_;
	gint _tmp5_;
	GSettings* _tmp6_;
	gint _tmp7_ = 0;
	Game* _tmp8_;
	Game* _tmp9_;
	Game* _tmp10_;
	GameView* _tmp11_;
	GSettings* _tmp12_;
	gchar* _tmp13_ = NULL;
	gchar* _tmp14_;
	GameView* _tmp15_;
	Game* _tmp16_;
	GameView* _tmp17_;
	GSettings* _tmp18_;
	gboolean _tmp19_ = FALSE;
	ClutterStage* _tmp20_;
	GameView* _tmp21_;
	gfloat _tmp22_;
	gfloat _tmp23_;
	GameView* _tmp24_;
	gfloat _tmp25_;
	gfloat _tmp26_;
	GtkClutterEmbed* _tmp27_;
	ClutterStage* _tmp28_;
	gfloat _tmp29_;
	gfloat _tmp30_;
	ClutterStage* _tmp31_;
	gfloat _tmp32_;
	gfloat _tmp33_;
	g_return_if_fail (self != NULL);
	swell_foop_get_size (self, &_tmp0_);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_.rows;
	swell_foop_get_size (self, &_tmp3_);
	_tmp4_ = _tmp3_;
	_tmp5_ = _tmp4_.columns;
	_tmp6_ = self->priv->settings;
	_tmp7_ = g_settings_get_int (_tmp6_, "colors");
	_tmp8_ = game_new (_tmp2_, _tmp5_, _tmp7_);
	_g_object_unref0 (self->priv->game);
	self->priv->game = _tmp8_;
	size_destroy (&_tmp4_);
	size_destroy (&_tmp1_);
	_tmp9_ = self->priv->game;
	g_signal_connect_object (_tmp9_, "update-score", (GCallback) _swell_foop_update_score_cb_game_update_score, self, 0);
	_tmp10_ = self->priv->game;
	g_signal_connect_object (_tmp10_, "complete", (GCallback) _swell_foop_complete_cb_game_complete, self, 0);
	_tmp11_ = self->priv->view;
	_tmp12_ = self->priv->settings;
	_tmp13_ = g_settings_get_string (_tmp12_, "theme");
	_tmp14_ = _tmp13_;
	game_view_set_theme_name (_tmp11_, _tmp14_);
	_g_free0 (_tmp14_);
	_tmp15_ = self->priv->view;
	_tmp16_ = self->priv->game;
	game_view_set_game (_tmp15_, _tmp16_);
	_tmp17_ = self->priv->view;
	_tmp18_ = self->priv->settings;
	_tmp19_ = g_settings_get_boolean (_tmp18_, "zealous");
	_tmp17_->is_zealous = _tmp19_;
	_tmp20_ = self->priv->stage;
	_tmp21_ = self->priv->view;
	_tmp22_ = clutter_actor_get_width ((ClutterActor*) _tmp21_);
	_tmp23_ = _tmp22_;
	_tmp24_ = self->priv->view;
	_tmp25_ = clutter_actor_get_height ((ClutterActor*) _tmp24_);
	_tmp26_ = _tmp25_;
	clutter_actor_set_size ((ClutterActor*) _tmp20_, _tmp23_, _tmp26_);
	_tmp27_ = self->priv->clutter_embed;
	_tmp28_ = self->priv->stage;
	_tmp29_ = clutter_actor_get_width ((ClutterActor*) _tmp28_);
	_tmp30_ = _tmp29_;
	_tmp31_ = self->priv->stage;
	_tmp32_ = clutter_actor_get_height ((ClutterActor*) _tmp31_);
	_tmp33_ = _tmp32_;
	gtk_widget_set_size_request ((GtkWidget*) _tmp27_, (gint) _tmp30_, (gint) _tmp33_);
	swell_foop_update_score_cb (self, 0);
}


gint swell_foop_main (gchar** args, int args_length1) {
	gint result = 0;
	ClutterInitError _tmp0_ = 0;
	GOptionContext* _tmp1_;
	GOptionContext* context;
	GOptionContext* _tmp2_;
	GOptionContext* _tmp3_;
	GOptionGroup* _tmp4_ = NULL;
	GOptionContext* _tmp5_;
	GOptionGroup* _tmp6_ = NULL;
	const gchar* _tmp11_ = NULL;
	SwellFoop* _tmp12_;
	SwellFoop* app;
	SwellFoop* _tmp13_;
	gchar** _tmp14_;
	gint _tmp14__length1;
	gint _tmp15_ = 0;
	GError * _inner_error_ = NULL;
	setlocale (LC_ALL, "");
	bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
	textdomain (GETTEXT_PACKAGE);
	games_scores_startup ();
	_tmp0_ = gtk_clutter_init (&args_length1, &args);
	if (_tmp0_ != CLUTTER_INIT_SUCCESS) {
		g_warning ("swell-foop.vala:420: Failed to initialise Clutter");
		result = EXIT_FAILURE;
		return result;
	}
	_tmp1_ = g_option_context_new ("");
	context = _tmp1_;
	_tmp2_ = context;
	g_option_context_set_translation_domain (_tmp2_, GETTEXT_PACKAGE);
	_tmp3_ = context;
	_tmp4_ = gtk_get_option_group (TRUE);
	g_option_context_add_group (_tmp3_, _tmp4_);
	_tmp5_ = context;
	_tmp6_ = clutter_get_option_group_without_init ();
	g_option_context_add_group (_tmp5_, _tmp6_);
	{
		GOptionContext* _tmp7_;
		_tmp7_ = context;
		g_option_context_parse (_tmp7_, &args_length1, &args, &_inner_error_);
		if (_inner_error_ != NULL) {
			goto __catch4_g_error;
		}
	}
	goto __finally4;
	__catch4_g_error:
	{
		GError* e = NULL;
		FILE* _tmp8_;
		GError* _tmp9_;
		const gchar* _tmp10_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp8_ = stderr;
		_tmp9_ = e;
		_tmp10_ = _tmp9_->message;
		fprintf (_tmp8_, "%s\n", _tmp10_);
		result = EXIT_FAILURE;
		_g_error_free0 (e);
		_g_option_context_free0 (context);
		return result;
	}
	__finally4:
	if (_inner_error_ != NULL) {
		_g_option_context_free0 (context);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return 0;
	}
	_tmp11_ = _ ("Swell Foop");
	g_set_application_name (_tmp11_);
	gtk_window_set_default_icon_name ("swellfoop");
	_tmp12_ = swell_foop_new ();
	app = _tmp12_;
	_tmp13_ = app;
	_tmp14_ = args;
	_tmp14__length1 = args_length1;
	_tmp15_ = g_application_run ((GApplication*) _tmp13_, _tmp14__length1, _tmp14_);
	result = _tmp15_;
	_g_object_unref0 (app);
	_g_option_context_free0 (context);
	return result;
}


int main (int argc, char ** argv) {
	g_type_init ();
	return swell_foop_main (argv, argc);
}


static void swell_foop_class_init (SwellFoopClass * klass) {
	swell_foop_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (SwellFoopPrivate));
	G_APPLICATION_CLASS (klass)->startup = swell_foop_real_startup;
	G_APPLICATION_CLASS (klass)->shutdown = swell_foop_real_shutdown;
	G_APPLICATION_CLASS (klass)->activate = swell_foop_real_activate;
	G_OBJECT_CLASS (klass)->finalize = swell_foop_finalize;
}


static void swell_foop_instance_init (SwellFoop * self) {
	self->priv = SWELL_FOOP_GET_PRIVATE (self);
	self->priv->game = NULL;
	self->priv->preferences_dialog = NULL;
}


static void swell_foop_finalize (GObject* obj) {
	SwellFoop * self;
	self = SWELL_FOOP (obj);
	_g_object_unref0 (self->priv->settings);
	_g_object_unref0 (self->priv->main_window);
	_g_object_unref0 (self->priv->game);
	_g_object_unref0 (self->priv->view);
	_g_object_unref0 (self->priv->stage);
	_g_object_unref0 (self->priv->clutter_embed);
	_g_object_unref0 (self->priv->high_scores);
	_g_object_unref0 (self->priv->preferences_dialog);
	_g_object_unref0 (self->priv->current_score_label);
	self->sizes = (_vala_Size_array_free (self->sizes, self->sizes_length1), NULL);
	G_OBJECT_CLASS (swell_foop_parent_class)->finalize (obj);
}


GType swell_foop_get_type (void) {
	static volatile gsize swell_foop_type_id__volatile = 0;
	if (g_once_init_enter (&swell_foop_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (SwellFoopClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) swell_foop_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SwellFoop), 0, (GInstanceInitFunc) swell_foop_instance_init, NULL };
		GType swell_foop_type_id;
		swell_foop_type_id = g_type_register_static (GTK_TYPE_APPLICATION, "SwellFoop", &g_define_type_info, 0);
		g_once_init_leave (&swell_foop_type_id__volatile, swell_foop_type_id);
	}
	return swell_foop_type_id__volatile;
}


void size_copy (const Size* self, Size* dest) {
	const gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	_tmp0_ = (*self).id;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 ((*dest).id);
	(*dest).id = _tmp1_;
	_tmp2_ = (*self).name;
	_tmp3_ = g_strdup (_tmp2_);
	_g_free0 ((*dest).name);
	(*dest).name = _tmp3_;
	_tmp4_ = (*self).columns;
	(*dest).columns = _tmp4_;
	_tmp5_ = (*self).rows;
	(*dest).rows = _tmp5_;
}


void size_destroy (Size* self) {
	_g_free0 ((*self).id);
	_g_free0 ((*self).name);
}


Size* size_dup (const Size* self) {
	Size* dup;
	dup = g_new0 (Size, 1);
	size_copy (self, dup);
	return dup;
}


void size_free (Size* self) {
	size_destroy (self);
	g_free (self);
}


GType size_get_type (void) {
	static volatile gsize size_type_id__volatile = 0;
	if (g_once_init_enter (&size_type_id__volatile)) {
		GType size_type_id;
		size_type_id = g_boxed_type_register_static ("Size", (GBoxedCopyFunc) size_dup, (GBoxedFreeFunc) size_free);
		g_once_init_leave (&size_type_id__volatile, size_type_id);
	}
	return size_type_id__volatile;
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}



