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


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


#define TYPE_QUADRAPASSEL (quadrapassel_get_type ())
#define QUADRAPASSEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_QUADRAPASSEL, Quadrapassel))
#define QUADRAPASSEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_QUADRAPASSEL, QuadrapasselClass))
#define IS_QUADRAPASSEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_QUADRAPASSEL))
#define IS_QUADRAPASSEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_QUADRAPASSEL))
#define QUADRAPASSEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_QUADRAPASSEL, QuadrapasselClass))

typedef struct _Quadrapassel Quadrapassel;
typedef struct _QuadrapasselClass QuadrapasselClass;
typedef struct _QuadrapasselPrivate QuadrapasselPrivate;

#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 TYPE_PREVIEW (preview_get_type ())
#define PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PREVIEW, Preview))
#define PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PREVIEW, PreviewClass))
#define IS_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PREVIEW))
#define IS_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PREVIEW))
#define PREVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PREVIEW, PreviewClass))

typedef struct _Preview Preview;
typedef struct _PreviewClass PreviewClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _GameViewPrivate GameViewPrivate;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _GamePrivate GamePrivate;

#define TYPE_SHAPE (shape_get_type ())
#define SHAPE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SHAPE, Shape))
#define SHAPE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SHAPE, ShapeClass))
#define IS_SHAPE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SHAPE))
#define IS_SHAPE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SHAPE))
#define SHAPE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SHAPE, ShapeClass))

typedef struct _Shape Shape;
typedef struct _ShapeClass ShapeClass;

#define TYPE_BLOCK (block_get_type ())
#define BLOCK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BLOCK, Block))
#define BLOCK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BLOCK, BlockClass))
#define IS_BLOCK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BLOCK))
#define IS_BLOCK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BLOCK))
#define BLOCK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BLOCK, BlockClass))

typedef struct _Block Block;
typedef struct _BlockClass BlockClass;
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
#define _g_option_context_free0(var) ((var == NULL) ? NULL : (var = (g_option_context_free (var), NULL)))

struct _Quadrapassel {
	GtkApplication parent_instance;
	QuadrapasselPrivate * priv;
};

struct _QuadrapasselClass {
	GtkApplicationClass parent_class;
};

struct _QuadrapasselPrivate {
	GSettings* settings;
	GtkWindow* main_window;
	Game* game;
	GameView* view;
	Preview* preview;
	GtkLabel* score_label;
	GtkLabel* n_destroyed_label;
	GtkLabel* level_label;
	GamesScores* high_scores;
	GSimpleAction* pause;
	GamesPauseAction* pause_action;
	GamesFullscreenAction* fullscreen_action;
	GtkDialog* preferences_dialog;
	GtkSpinButton* starting_level_spin;
	Preview* theme_preview;
	GtkSpinButton* fill_height_spinner;
	GtkSpinButton* fill_prob_spinner;
	GtkCheckButton* do_preview_toggle;
	GtkCheckButton* difficult_blocks_toggle;
	GtkCheckButton* rotate_counter_clock_wise_toggle;
	GtkCheckButton* show_shadow_toggle;
	GtkCheckButton* sound_toggle;
};

struct _GameView {
	GtkClutterEmbed parent_instance;
	GameViewPrivate * priv;
	gboolean mute;
};

struct _GameViewClass {
	GtkClutterEmbedClass parent_class;
};

struct _Game {
	GObject parent_instance;
	GamePrivate * priv;
	Shape* shape;
	Shape* next_shape;
	Block** blocks;
	gint blocks_length1;
	gint blocks_length2;
	gint n_lines_destroyed;
	gint score;
	gboolean game_over;
};

struct _GameClass {
	GObjectClass parent_class;
};


static gpointer quadrapassel_parent_class = NULL;

GType quadrapassel_get_type (void) G_GNUC_CONST;
GType game_get_type (void) G_GNUC_CONST;
GType game_view_get_type (void) G_GNUC_CONST;
GType preview_get_type (void) G_GNUC_CONST;
#define QUADRAPASSEL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_QUADRAPASSEL, QuadrapasselPrivate))
enum  {
	QUADRAPASSEL_DUMMY_PROPERTY
};
static void quadrapassel_new_game_cb (Quadrapassel* self);
static void _quadrapassel_new_game_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void quadrapassel_toggle_cb (Quadrapassel* self, GSimpleAction* action, GVariant* parameter);
static void _quadrapassel_toggle_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void quadrapassel_pause_changed (Quadrapassel* self, GSimpleAction* action, GVariant* state);
static void _quadrapassel_pause_changed_gsimple_action_change_state_callback (GSimpleAction* action, GVariant* value, gpointer self);
static void quadrapassel_scores_cb (Quadrapassel* self);
static void _quadrapassel_scores_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void quadrapassel_preferences_cb (Quadrapassel* self);
static void _quadrapassel_preferences_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void quadrapassel_help_cb (Quadrapassel* self);
static void _quadrapassel_help_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void quadrapassel_about_cb (Quadrapassel* self);
static void _quadrapassel_about_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void quadrapassel_quit_cb (Quadrapassel* self);
static void _quadrapassel_quit_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void _quadrapassel_new_game_cb_gtk_action_callback (GtkAction* action, gpointer self);
Quadrapassel* quadrapassel_new (void);
Quadrapassel* quadrapassel_construct (GType object_type);
static void quadrapassel_real_startup (GApplication* base);
static gboolean quadrapassel_key_press_event_cb (Quadrapassel* self, GtkWidget* widget, GdkEventKey* event);
static gboolean _quadrapassel_key_press_event_cb_gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self);
static gboolean quadrapassel_key_release_event_cb (Quadrapassel* self, GtkWidget* widget, GdkEventKey* event);
static gboolean _quadrapassel_key_release_event_cb_gtk_widget_key_release_event (GtkWidget* _sender, GdkEventKey* event, gpointer self);
GameView* game_view_new (void);
GameView* game_view_construct (GType object_type);
void game_view_set_theme (GameView* self, const gchar* value);
void game_view_set_show_shadow (GameView* self, gboolean value);
Game* game_new (gint lines, gint columns, gint starting_level, gint filled_lines, gint fill_prob, gboolean pick_difficult_blocks);
Game* game_construct (GType object_type, gint lines, gint columns, gint starting_level, gint filled_lines, gint fill_prob, gboolean pick_difficult_blocks);
void game_view_set_game (GameView* self, Game* value);
static void quadrapassel_pause_cb (Quadrapassel* self);
static void _quadrapassel_pause_cb_games_pause_action_state_changed (GamesPauseAction* _sender, gpointer self);
Preview* preview_new (void);
Preview* preview_construct (GType object_type);
void preview_set_theme (Preview* self, const gchar* value);
void preview_set_enabled (Preview* self, gboolean value);
static void _vala_GamesScoresCategory_array_free (GamesScoresCategory* array, gint array_length);
static GVariant* _variant_new1 (gboolean value);
static void quadrapassel_real_shutdown (GApplication* base);
gpointer shape_ref (gpointer instance);
void shape_unref (gpointer instance);
GParamSpec* param_spec_shape (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_shape (GValue* value, gpointer v_object);
void value_take_shape (GValue* value, gpointer v_object);
gpointer value_get_shape (const GValue* value);
GType shape_get_type (void) G_GNUC_CONST;
gpointer block_ref (gpointer instance);
void block_unref (gpointer instance);
GParamSpec* param_spec_block (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_block (GValue* value, gpointer v_object);
void value_take_block (GValue* value, gpointer v_object);
gpointer value_get_block (const GValue* value);
GType block_get_type (void) G_GNUC_CONST;
static void quadrapassel_real_activate (GApplication* base);
static void quadrapassel_preferences_dialog_close_cb (Quadrapassel* self);
static void quadrapassel_preferences_dialog_response_cb (Quadrapassel* self, gint response_id);
static void _quadrapassel_preferences_dialog_close_cb_gtk_dialog_close (GtkDialog* _sender, gpointer self);
static void _quadrapassel_preferences_dialog_response_cb_gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self);
gint game_get_height (Game* self);
static void quadrapassel_fill_height_spinner_value_changed_cb (Quadrapassel* self, GtkSpinButton* spin);
static void _quadrapassel_fill_height_spinner_value_changed_cb_gtk_spin_button_value_changed (GtkSpinButton* _sender, gpointer self);
static void quadrapassel_fill_prob_spinner_value_changed_cb (Quadrapassel* self, GtkSpinButton* spin);
static void _quadrapassel_fill_prob_spinner_value_changed_cb_gtk_spin_button_value_changed (GtkSpinButton* _sender, gpointer self);
static void quadrapassel_starting_level_value_changed_cb (Quadrapassel* self, GtkSpinButton* spin);
static void _quadrapassel_starting_level_value_changed_cb_gtk_spin_button_value_changed (GtkSpinButton* _sender, gpointer self);
static void quadrapassel_sound_toggle_toggled_cb (Quadrapassel* self);
static void _quadrapassel_sound_toggle_toggled_cb_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self);
static void quadrapassel_do_preview_toggle_toggled_cb (Quadrapassel* self);
static void _quadrapassel_do_preview_toggle_toggled_cb_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self);
static void quadrapassel_difficult_blocks_toggled_cb (Quadrapassel* self);
static void _quadrapassel_difficult_blocks_toggled_cb_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self);
static void quadrapassel_set_rotate_counter_clock_wise (Quadrapassel* self);
static void _quadrapassel_set_rotate_counter_clock_wise_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self);
static void quadrapassel_user_target_toggled_cb (Quadrapassel* self);
static void _quadrapassel_user_target_toggled_cb_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self);
static void quadrapassel_theme_combo_changed_cb (Quadrapassel* self, GtkComboBox* widget);
static void _quadrapassel_theme_combo_changed_cb_gtk_combo_box_changed (GtkComboBox* _sender, gpointer self);
void preview_set_game (Preview* self, Game* value);
static gboolean _variant_get2 (GVariant* value);
static GVariant* _variant_new3 (gboolean value);
static gboolean _variant_get4 (GVariant* value);
void game_set_paused (Game* self, gboolean value);
static GVariant* _variant_new5 (gboolean value);
static guint quadrapassel_upper_key (Quadrapassel* self, guint keyval);
gboolean game_get_paused (Game* self);
gboolean game_move_left (Game* self);
gboolean game_move_right (Game* self);
gboolean game_rotate_left (Game* self);
gboolean game_rotate_right (Game* self);
void game_set_fast_forward (Game* self, gboolean enable);
void game_drop (Game* self);
static void quadrapassel_new_game (Quadrapassel* self);
void game_stop (Game* self);
static void quadrapassel_shape_landed_cb (Quadrapassel* self, gint* lines, int lines_length1, GList* line_blocks);
static void _quadrapassel_shape_landed_cb_game_shape_landed (Game* _sender, gint* lines, int lines_length1, GList* line_blocks, gpointer self);
static void quadrapassel_complete_cb (Quadrapassel* self);
static void _quadrapassel_complete_cb_game_complete (Game* _sender, gpointer self);
void game_start (Game* self);
static void quadrapassel_update_score (Quadrapassel* self);
gint game_get_level (Game* self);
gint quadrapassel_main (gchar** args, int args_length1);
static void quadrapassel_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 QUADRAPASSEL_action_entries[7] = {{"new-game", _quadrapassel_new_game_cb_gsimple_action_activate_callback}, {"pause", _quadrapassel_toggle_cb_gsimple_action_activate_callback, NULL, "false", _quadrapassel_pause_changed_gsimple_action_change_state_callback}, {"scores", _quadrapassel_scores_cb_gsimple_action_activate_callback}, {"preferences", _quadrapassel_preferences_cb_gsimple_action_activate_callback}, {"help", _quadrapassel_help_cb_gsimple_action_activate_callback}, {"about", _quadrapassel_about_cb_gsimple_action_activate_callback}, {"quit", _quadrapassel_quit_cb_gsimple_action_activate_callback}};
static const GtkActionEntry QUADRAPASSEL_actions[1] = {{"NewGame", GAMES_STOCK_NEW_GAME, NULL, NULL, NULL, (GCallback) _quadrapassel_new_game_cb_gtk_action_callback}};

static void _quadrapassel_new_game_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	quadrapassel_new_game_cb (self);
}


static void _quadrapassel_toggle_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	quadrapassel_toggle_cb (self, action, parameter);
}


static void _quadrapassel_pause_changed_gsimple_action_change_state_callback (GSimpleAction* action, GVariant* value, gpointer self) {
	quadrapassel_pause_changed (self, action, value);
}


static void _quadrapassel_scores_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	quadrapassel_scores_cb (self);
}


static void _quadrapassel_preferences_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	quadrapassel_preferences_cb (self);
}


static void _quadrapassel_help_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	quadrapassel_help_cb (self);
}


static void _quadrapassel_about_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	quadrapassel_about_cb (self);
}


static void _quadrapassel_quit_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	quadrapassel_quit_cb (self);
}


static void _quadrapassel_new_game_cb_gtk_action_callback (GtkAction* action, gpointer self) {
	quadrapassel_new_game_cb (self);
}


Quadrapassel* quadrapassel_construct (GType object_type) {
	Quadrapassel * self = NULL;
	self = (Quadrapassel*) g_object_new (object_type, "application-id", "org.gnome.quadrapassel", "flags", G_APPLICATION_FLAGS_NONE, NULL);
	return self;
}


Quadrapassel* quadrapassel_new (void) {
	return quadrapassel_construct (TYPE_QUADRAPASSEL);
}


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


static gboolean _quadrapassel_key_press_event_cb_gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self) {
	gboolean result;
	result = quadrapassel_key_press_event_cb (self, _sender, event);
	return result;
}


static gboolean _quadrapassel_key_release_event_cb_gtk_widget_key_release_event (GtkWidget* _sender, GdkEventKey* event, gpointer self) {
	gboolean result;
	result = quadrapassel_key_release_event_cb (self, _sender, event);
	return result;
}


static void _quadrapassel_pause_cb_games_pause_action_state_changed (GamesPauseAction* _sender, gpointer self) {
	quadrapassel_pause_cb (self);
}


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 GVariant* _variant_new1 (gboolean value) {
	return g_variant_ref_sink (g_variant_new_boolean (value));
}


static void quadrapassel_real_startup (GApplication* base) {
	Quadrapassel * self;
	GAction* _tmp0_ = NULL;
	GSimpleAction* _tmp1_;
	GMenu* _tmp2_;
	GMenu* menu;
	GMenu* _tmp3_;
	GMenu* section;
	GMenu* _tmp4_;
	GMenu* _tmp5_;
	const gchar* _tmp6_ = NULL;
	GMenu* _tmp7_;
	const gchar* _tmp8_ = NULL;
	GMenu* _tmp9_;
	const gchar* _tmp10_ = NULL;
	GMenu* _tmp11_;
	const gchar* _tmp12_ = NULL;
	GMenu* _tmp13_;
	GMenu* _tmp14_;
	GMenu* _tmp15_;
	const gchar* _tmp16_ = NULL;
	GMenu* _tmp17_;
	const gchar* _tmp18_ = NULL;
	GMenu* _tmp19_;
	GMenu* _tmp20_;
	GMenu* _tmp21_;
	const gchar* _tmp22_ = NULL;
	GSettings* _tmp23_;
	GtkApplicationWindow* _tmp24_;
	GtkWindow* _tmp25_;
	GtkWindow* _tmp26_;
	GtkWindow* _tmp27_;
	gint _tmp28_ = 0;
	GtkWindow* _tmp29_;
	const gchar* _tmp30_ = NULL;
	GtkWindow* _tmp31_;
	GtkWindow* _tmp32_;
	GtkWindow* _tmp33_;
	GtkBox* _tmp34_;
	GtkBox* _tmp35_;
	GtkBox* vbox;
	GtkWindow* _tmp36_;
	GameView* _tmp37_;
	GameView* _tmp38_;
	GameView* _tmp39_;
	GSettings* _tmp40_;
	gchar* _tmp41_ = NULL;
	gchar* _tmp42_;
	GameView* _tmp43_;
	GSettings* _tmp44_;
	gboolean _tmp45_ = FALSE;
	GameView* _tmp46_;
	GSettings* _tmp47_;
	gboolean _tmp48_ = FALSE;
	GameView* _tmp49_;
	Game* _tmp50_;
	Game* _tmp51_;
	GameView* _tmp52_;
	GtkActionGroup* _tmp53_;
	GtkActionGroup* action_group;
	GtkAction* _tmp54_ = NULL;
	GtkUIManager* _tmp55_;
	GtkUIManager* ui_manager;
	GtkWindow* _tmp59_;
	GtkAccelGroup* _tmp60_ = NULL;
	GamesPauseAction* _tmp61_;
	GamesPauseAction* _tmp62_;
	GamesPauseAction* _tmp63_;
	GtkWindow* _tmp64_;
	GamesFullscreenAction* _tmp65_;
	GamesFullscreenAction* _tmp66_;
	GtkWidget* _tmp67_ = NULL;
	GtkToolbar* _tmp68_;
	GtkToolbar* toolbar;
	GtkStyleContext* _tmp69_ = NULL;
	GtkBox* _tmp70_;
	GtkBox* _tmp71_;
	GtkBox* hb;
	GtkBox* _tmp72_;
	GtkBox* _tmp73_;
	GtkBox* vb1;
	GameView* _tmp74_;
	GtkBox* _tmp75_;
	GtkBox* _tmp76_;
	GtkBox* vb2;
	Preview* _tmp77_;
	Preview* _tmp78_;
	Preview* _tmp79_;
	GSettings* _tmp80_;
	gchar* _tmp81_ = NULL;
	gchar* _tmp82_;
	Preview* _tmp83_;
	GSettings* _tmp84_;
	gboolean _tmp85_ = FALSE;
	Preview* _tmp86_;
	Preview* _tmp87_;
	GtkGrid* _tmp88_;
	GtkGrid* _tmp89_;
	GtkGrid* score_grid;
	const gchar* _tmp90_ = NULL;
	GtkLabel* _tmp91_;
	GtkLabel* _tmp92_;
	GtkLabel* label;
	GtkLabel* _tmp93_;
	GtkLabel* _tmp94_;
	GtkLabel* _tmp95_;
	GtkLabel* _tmp96_;
	GtkLabel* _tmp97_;
	GtkLabel* _tmp98_;
	GtkLabel* _tmp99_;
	GtkLabel* _tmp100_;
	const gchar* _tmp101_ = NULL;
	GtkLabel* _tmp102_;
	GtkLabel* _tmp103_;
	GtkLabel* _tmp104_;
	GtkLabel* _tmp105_;
	GtkLabel* _tmp106_;
	GtkLabel* _tmp107_;
	GtkLabel* _tmp108_;
	GtkLabel* _tmp109_;
	GtkLabel* _tmp110_;
	GtkLabel* _tmp111_;
	const gchar* _tmp112_ = NULL;
	GtkLabel* _tmp113_;
	GtkLabel* _tmp114_;
	GtkLabel* _tmp115_;
	GtkLabel* _tmp116_;
	GtkLabel* _tmp117_;
	GtkLabel* _tmp118_;
	GtkLabel* _tmp119_;
	GtkLabel* _tmp120_;
	GtkLabel* _tmp121_;
	GtkLabel* _tmp122_;
	GamesScoresCategory* _tmp123_ = NULL;
	GamesScoresCategory* _tmp124_;
	gint _tmp124__length1;
	GamesScores* _tmp125_;
	GamesPauseAction* _tmp126_;
	GSimpleAction* _tmp127_;
	GVariant* _tmp128_;
	GError * _inner_error_ = NULL;
	self = (Quadrapassel*) base;
	G_APPLICATION_CLASS (quadrapassel_parent_class)->startup ((GApplication*) GTK_APPLICATION (self));
	g_action_map_add_action_entries ((GActionMap*) self, QUADRAPASSEL_action_entries, G_N_ELEMENTS (QUADRAPASSEL_action_entries), self);
	_tmp0_ = g_action_map_lookup_action ((GActionMap*) self, "pause");
	_tmp1_ = _g_object_ref0 (G_IS_SIMPLE_ACTION (_tmp0_) ? ((GSimpleAction*) _tmp0_) : NULL);
	_g_object_unref0 (self->priv->pause);
	self->priv->pause = _tmp1_;
	_tmp2_ = g_menu_new ();
	menu = _tmp2_;
	_tmp3_ = g_menu_new ();
	section = _tmp3_;
	_tmp4_ = section;
	g_menu_append_section (menu, NULL, (GMenuModel*) _tmp4_);
	_tmp5_ = section;
	_tmp6_ = _ ("_New Game");
	g_menu_append (_tmp5_, _tmp6_, "app.new-game");
	_tmp7_ = section;
	_tmp8_ = _ ("_Pause");
	g_menu_append (_tmp7_, _tmp8_, "app.pause");
	_tmp9_ = section;
	_tmp10_ = _ ("_Scores");
	g_menu_append (_tmp9_, _tmp10_, "app.scores");
	_tmp11_ = section;
	_tmp12_ = _ ("_Preferences");
	g_menu_append (_tmp11_, _tmp12_, "app.preferences");
	_tmp13_ = g_menu_new ();
	_g_object_unref0 (section);
	section = _tmp13_;
	_tmp14_ = section;
	g_menu_append_section (menu, NULL, (GMenuModel*) _tmp14_);
	_tmp15_ = section;
	_tmp16_ = _ ("_Help");
	g_menu_append (_tmp15_, _tmp16_, "app.help");
	_tmp17_ = section;
	_tmp18_ = _ ("_About");
	g_menu_append (_tmp17_, _tmp18_, "app.about");
	_tmp19_ = g_menu_new ();
	_g_object_unref0 (section);
	section = _tmp19_;
	_tmp20_ = section;
	g_menu_append_section (menu, NULL, (GMenuModel*) _tmp20_);
	_tmp21_ = section;
	_tmp22_ = _ ("_Quit");
	g_menu_append (_tmp21_, _tmp22_, "app.quit");
	gtk_application_set_app_menu ((GtkApplication*) self, (GMenuModel*) menu);
	_tmp23_ = g_settings_new ("org.gnome.quadrapassel");
	_g_object_unref0 (self->priv->settings);
	self->priv->settings = _tmp23_;
	_tmp24_ = (GtkApplicationWindow*) gtk_application_window_new ((GtkApplication*) self);
	_tmp25_ = (GtkWindow*) g_object_ref_sink (_tmp24_);
	_g_object_unref0 (self->priv->main_window);
	self->priv->main_window = _tmp25_;
	_tmp26_ = self->priv->main_window;
	_tmp27_ = self->priv->main_window;
	_tmp28_ = gtk_widget_get_events ((GtkWidget*) _tmp27_);
	gtk_widget_set_events ((GtkWidget*) _tmp26_, (_tmp28_ | GDK_KEY_PRESS_MASK) | GDK_KEY_RELEASE_MASK);
	_tmp29_ = self->priv->main_window;
	_tmp30_ = _ ("Quadrapassel");
	gtk_window_set_title (_tmp29_, _tmp30_);
	_tmp31_ = self->priv->main_window;
	g_signal_connect_object ((GtkWidget*) _tmp31_, "key-press-event", (GCallback) _quadrapassel_key_press_event_cb_gtk_widget_key_press_event, self, 0);
	_tmp32_ = self->priv->main_window;
	g_signal_connect_object ((GtkWidget*) _tmp32_, "key-release-event", (GCallback) _quadrapassel_key_release_event_cb_gtk_widget_key_release_event, self, 0);
	_tmp33_ = self->priv->main_window;
	gtk_window_set_default_size (_tmp33_, 500, 550);
	_tmp34_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	_tmp35_ = g_object_ref_sink (_tmp34_);
	vbox = _tmp35_;
	gtk_widget_show ((GtkWidget*) vbox);
	_tmp36_ = self->priv->main_window;
	gtk_container_add ((GtkContainer*) _tmp36_, (GtkWidget*) vbox);
	_tmp37_ = game_view_new ();
	_tmp38_ = g_object_ref_sink (_tmp37_);
	_g_object_unref0 (self->priv->view);
	self->priv->view = _tmp38_;
	_tmp39_ = self->priv->view;
	_tmp40_ = self->priv->settings;
	_tmp41_ = g_settings_get_string (_tmp40_, "theme");
	_tmp42_ = _tmp41_;
	game_view_set_theme (_tmp39_, _tmp42_);
	_g_free0 (_tmp42_);
	_tmp43_ = self->priv->view;
	_tmp44_ = self->priv->settings;
	_tmp45_ = g_settings_get_boolean (_tmp44_, "sound");
	_tmp43_->mute = !_tmp45_;
	_tmp46_ = self->priv->view;
	_tmp47_ = self->priv->settings;
	_tmp48_ = g_settings_get_boolean (_tmp47_, "show-shadow");
	game_view_set_show_shadow (_tmp46_, _tmp48_);
	_tmp49_ = self->priv->view;
	_tmp50_ = game_new (20, 14, 1, 20, 10, FALSE);
	_tmp51_ = _tmp50_;
	game_view_set_game (_tmp49_, _tmp51_);
	_g_object_unref0 (_tmp51_);
	_tmp52_ = self->priv->view;
	gtk_widget_show ((GtkWidget*) _tmp52_);
	games_stock_init ();
	_tmp53_ = gtk_action_group_new ("group");
	action_group = _tmp53_;
	gtk_action_group_set_translation_domain (action_group, GETTEXT_PACKAGE);
	gtk_action_group_add_actions (action_group, QUADRAPASSEL_actions, G_N_ELEMENTS (QUADRAPASSEL_actions), self);
	_tmp54_ = gtk_action_group_get_action (action_group, "NewGame");
	gtk_action_set_is_important (_tmp54_, TRUE);
	_tmp55_ = gtk_ui_manager_new ();
	ui_manager = _tmp55_;
	gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
	{
		gchar* _tmp56_;
		gchar* ui_description;
		_tmp56_ = g_strdup ("<ui>" "    <toolbar name='Toolbar'>" "        <toolitem action='NewGame'/>" "        <toolitem action='_Pause'/>" "        <toolitem action='Fullscreen'/>" "    </toolbar>" "</ui>");
		ui_description = _tmp56_;
		gtk_ui_manager_add_ui_from_string (ui_manager, ui_description, (gssize) (-1), &_inner_error_);
		if (_inner_error_ != NULL) {
			_g_free0 (ui_description);
			goto __catch0_g_error;
		}
		_g_free0 (ui_description);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp57_;
		const gchar* _tmp58_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp57_ = e;
		_tmp58_ = _tmp57_->message;
		g_warning ("quadrapassel.vala:132: Failed to load UI: %s", _tmp58_);
		_g_error_free0 (e);
	}
	__finally0:
	if (_inner_error_ != NULL) {
		_g_object_unref0 (ui_manager);
		_g_object_unref0 (action_group);
		_g_object_unref0 (vbox);
		_g_object_unref0 (section);
		_g_object_unref0 (menu);
		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;
	}
	_tmp59_ = self->priv->main_window;
	_tmp60_ = gtk_ui_manager_get_accel_group (ui_manager);
	gtk_window_add_accel_group (_tmp59_, _tmp60_);
	_tmp61_ = games_pause_action_new ("_Pause");
	_g_object_unref0 (self->priv->pause_action);
	self->priv->pause_action = _tmp61_;
	_tmp62_ = self->priv->pause_action;
	g_signal_connect_object (_tmp62_, "state-changed", (GCallback) _quadrapassel_pause_cb_games_pause_action_state_changed, self, 0);
	_tmp63_ = self->priv->pause_action;
	gtk_action_group_add_action_with_accel (action_group, (GtkAction*) _tmp63_, NULL);
	_tmp64_ = self->priv->main_window;
	_tmp65_ = games_fullscreen_action_new ("Fullscreen", _tmp64_);
	_g_object_unref0 (self->priv->fullscreen_action);
	self->priv->fullscreen_action = _tmp65_;
	_tmp66_ = self->priv->fullscreen_action;
	gtk_action_group_add_action_with_accel (action_group, (GtkAction*) _tmp66_, NULL);
	_tmp67_ = gtk_ui_manager_get_widget (ui_manager, "/Toolbar");
	_tmp68_ = _g_object_ref0 (GTK_TOOLBAR (_tmp67_));
	toolbar = _tmp68_;
	gtk_toolbar_set_show_arrow (toolbar, FALSE);
	_tmp69_ = gtk_widget_get_style_context ((GtkWidget*) toolbar);
	gtk_style_context_add_class (_tmp69_, GTK_STYLE_CLASS_PRIMARY_TOOLBAR);
	gtk_widget_show ((GtkWidget*) toolbar);
	gtk_box_pack_start (vbox, (GtkWidget*) toolbar, FALSE, TRUE, (guint) 0);
	_tmp70_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	_tmp71_ = g_object_ref_sink (_tmp70_);
	hb = _tmp71_;
	gtk_widget_show ((GtkWidget*) hb);
	gtk_box_pack_start (vbox, (GtkWidget*) hb, TRUE, TRUE, (guint) 0);
	_tmp72_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	_tmp73_ = g_object_ref_sink (_tmp72_);
	vb1 = _tmp73_;
	gtk_container_set_border_width ((GtkContainer*) vb1, (guint) 10);
	_tmp74_ = self->priv->view;
	gtk_box_pack_start (vb1, (GtkWidget*) _tmp74_, TRUE, TRUE, (guint) 0);
	gtk_widget_show ((GtkWidget*) vb1);
	gtk_box_pack_start (hb, (GtkWidget*) vb1, TRUE, TRUE, (guint) 0);
	_tmp75_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	_tmp76_ = g_object_ref_sink (_tmp75_);
	vb2 = _tmp76_;
	gtk_container_set_border_width ((GtkContainer*) vb2, (guint) 10);
	gtk_widget_show ((GtkWidget*) vb2);
	gtk_box_pack_end (hb, (GtkWidget*) vb2, FALSE, FALSE, (guint) 0);
	_tmp77_ = preview_new ();
	_tmp78_ = g_object_ref_sink (_tmp77_);
	_g_object_unref0 (self->priv->preview);
	self->priv->preview = _tmp78_;
	_tmp79_ = self->priv->preview;
	_tmp80_ = self->priv->settings;
	_tmp81_ = g_settings_get_string (_tmp80_, "theme");
	_tmp82_ = _tmp81_;
	preview_set_theme (_tmp79_, _tmp82_);
	_g_free0 (_tmp82_);
	_tmp83_ = self->priv->preview;
	_tmp84_ = self->priv->settings;
	_tmp85_ = g_settings_get_boolean (_tmp84_, "do-preview");
	preview_set_enabled (_tmp83_, _tmp85_);
	_tmp86_ = self->priv->preview;
	gtk_widget_show ((GtkWidget*) _tmp86_);
	_tmp87_ = self->priv->preview;
	gtk_box_pack_start (vb2, (GtkWidget*) _tmp87_, FALSE, FALSE, (guint) 0);
	_tmp88_ = (GtkGrid*) gtk_grid_new ();
	_tmp89_ = g_object_ref_sink (_tmp88_);
	score_grid = _tmp89_;
	gtk_widget_show ((GtkWidget*) score_grid);
	gtk_box_pack_end (vb2, (GtkWidget*) score_grid, TRUE, FALSE, (guint) 0);
	_tmp90_ = _ ("Score:");
	_tmp91_ = (GtkLabel*) gtk_label_new (_tmp90_);
	_tmp92_ = g_object_ref_sink (_tmp91_);
	label = _tmp92_;
	_tmp93_ = label;
	gtk_misc_set_alignment ((GtkMisc*) _tmp93_, 0.0f, 0.5f);
	_tmp94_ = label;
	gtk_widget_show ((GtkWidget*) _tmp94_);
	_tmp95_ = label;
	gtk_grid_attach (score_grid, (GtkWidget*) _tmp95_, 0, 0, 1, 1);
	_tmp96_ = (GtkLabel*) gtk_label_new ("0");
	_tmp97_ = g_object_ref_sink (_tmp96_);
	_g_object_unref0 (self->priv->score_label);
	self->priv->score_label = _tmp97_;
	_tmp98_ = self->priv->score_label;
	gtk_misc_set_alignment ((GtkMisc*) _tmp98_, 1.0f, 0.5f);
	_tmp99_ = self->priv->score_label;
	gtk_widget_show ((GtkWidget*) _tmp99_);
	_tmp100_ = self->priv->score_label;
	gtk_grid_attach (score_grid, (GtkWidget*) _tmp100_, 1, 0, 1, 1);
	_tmp101_ = _ ("Lines:");
	_tmp102_ = (GtkLabel*) gtk_label_new (_tmp101_);
	_tmp103_ = g_object_ref_sink (_tmp102_);
	_g_object_unref0 (label);
	label = _tmp103_;
	_tmp104_ = label;
	gtk_misc_set_alignment ((GtkMisc*) _tmp104_, 0.0f, 0.5f);
	_tmp105_ = label;
	gtk_widget_show ((GtkWidget*) _tmp105_);
	_tmp106_ = label;
	gtk_grid_attach (score_grid, (GtkWidget*) _tmp106_, 0, 1, 1, 1);
	_tmp107_ = (GtkLabel*) gtk_label_new ("0");
	_tmp108_ = g_object_ref_sink (_tmp107_);
	_g_object_unref0 (self->priv->n_destroyed_label);
	self->priv->n_destroyed_label = _tmp108_;
	_tmp109_ = self->priv->n_destroyed_label;
	gtk_misc_set_alignment ((GtkMisc*) _tmp109_, 1.0f, 0.5f);
	_tmp110_ = self->priv->n_destroyed_label;
	gtk_widget_show ((GtkWidget*) _tmp110_);
	_tmp111_ = self->priv->n_destroyed_label;
	gtk_grid_attach (score_grid, (GtkWidget*) _tmp111_, 1, 1, 1, 1);
	_tmp112_ = _ ("Level:");
	_tmp113_ = (GtkLabel*) gtk_label_new (_tmp112_);
	_tmp114_ = g_object_ref_sink (_tmp113_);
	_g_object_unref0 (label);
	label = _tmp114_;
	_tmp115_ = label;
	gtk_misc_set_alignment ((GtkMisc*) _tmp115_, 0.0f, 0.5f);
	_tmp116_ = label;
	gtk_widget_show ((GtkWidget*) _tmp116_);
	_tmp117_ = label;
	gtk_grid_attach (score_grid, (GtkWidget*) _tmp117_, 0, 2, 1, 1);
	_tmp118_ = (GtkLabel*) gtk_label_new ("0");
	_tmp119_ = g_object_ref_sink (_tmp118_);
	_g_object_unref0 (self->priv->level_label);
	self->priv->level_label = _tmp119_;
	_tmp120_ = self->priv->level_label;
	gtk_misc_set_alignment ((GtkMisc*) _tmp120_, 1.0f, 0.5f);
	_tmp121_ = self->priv->level_label;
	gtk_widget_show ((GtkWidget*) _tmp121_);
	_tmp122_ = self->priv->level_label;
	gtk_grid_attach (score_grid, (GtkWidget*) _tmp122_, 1, 2, 1, 1);
	_tmp123_ = g_new0 (GamesScoresCategory, 0);
	_tmp124_ = _tmp123_;
	_tmp124__length1 = 0;
	_tmp125_ = games_scores_new ("quadrapassel", _tmp124_, 0, NULL, NULL, 0, GAMES_SCORES_STYLE_PLAIN_DESCENDING);
	_g_object_unref0 (self->priv->high_scores);
	self->priv->high_scores = _tmp125_;
	_tmp124_ = (_vala_GamesScoresCategory_array_free (_tmp124_, _tmp124__length1), NULL);
	_tmp126_ = self->priv->pause_action;
	gtk_action_set_sensitive ((GtkAction*) _tmp126_, FALSE);
	_tmp127_ = self->priv->pause;
	_tmp128_ = _variant_new1 (FALSE);
	g_signal_emit_by_name (_tmp127_, "change-state", _tmp128_);
	_g_object_unref0 (label);
	_g_object_unref0 (score_grid);
	_g_object_unref0 (vb2);
	_g_object_unref0 (vb1);
	_g_object_unref0 (hb);
	_g_object_unref0 (toolbar);
	_g_object_unref0 (ui_manager);
	_g_object_unref0 (action_group);
	_g_object_unref0 (vbox);
	_g_object_unref0 (section);
	_g_object_unref0 (menu);
}


static void quadrapassel_real_shutdown (GApplication* base) {
	Quadrapassel * self;
	gboolean _tmp0_ = FALSE;
	Game* _tmp1_;
	gboolean _tmp4_;
	self = (Quadrapassel*) base;
	G_APPLICATION_CLASS (quadrapassel_parent_class)->shutdown ((GApplication*) GTK_APPLICATION (self));
	_tmp1_ = self->priv->game;
	if (_tmp1_ != NULL) {
		Game* _tmp2_;
		gint _tmp3_;
		_tmp2_ = self->priv->game;
		_tmp3_ = _tmp2_->score;
		_tmp0_ = _tmp3_ > 0;
	} else {
		_tmp0_ = FALSE;
	}
	_tmp4_ = _tmp0_;
	if (_tmp4_) {
		GamesScores* _tmp5_;
		Game* _tmp6_;
		gint _tmp7_;
		_tmp5_ = self->priv->high_scores;
		_tmp6_ = self->priv->game;
		_tmp7_ = _tmp6_->score;
		games_scores_add_plain_score (_tmp5_, (guint32) _tmp7_);
	}
}


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


static void quadrapassel_preferences_dialog_close_cb (Quadrapassel* 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;
}


static void quadrapassel_preferences_dialog_response_cb (Quadrapassel* self, gint response_id) {
	g_return_if_fail (self != NULL);
	quadrapassel_preferences_dialog_close_cb (self);
}


static void _quadrapassel_preferences_dialog_close_cb_gtk_dialog_close (GtkDialog* _sender, gpointer self) {
	quadrapassel_preferences_dialog_close_cb (self);
}


static void _quadrapassel_preferences_dialog_response_cb_gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self) {
	quadrapassel_preferences_dialog_response_cb (self, response_id);
}


static void _quadrapassel_fill_height_spinner_value_changed_cb_gtk_spin_button_value_changed (GtkSpinButton* _sender, gpointer self) {
	quadrapassel_fill_height_spinner_value_changed_cb (self, _sender);
}


static void _quadrapassel_fill_prob_spinner_value_changed_cb_gtk_spin_button_value_changed (GtkSpinButton* _sender, gpointer self) {
	quadrapassel_fill_prob_spinner_value_changed_cb (self, _sender);
}


static void _quadrapassel_starting_level_value_changed_cb_gtk_spin_button_value_changed (GtkSpinButton* _sender, gpointer self) {
	quadrapassel_starting_level_value_changed_cb (self, _sender);
}


static void _quadrapassel_sound_toggle_toggled_cb_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self) {
	quadrapassel_sound_toggle_toggled_cb (self);
}


static void _quadrapassel_do_preview_toggle_toggled_cb_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self) {
	quadrapassel_do_preview_toggle_toggled_cb (self);
}


static void _quadrapassel_difficult_blocks_toggled_cb_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self) {
	quadrapassel_difficult_blocks_toggled_cb (self);
}


static void _quadrapassel_set_rotate_counter_clock_wise_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self) {
	quadrapassel_set_rotate_counter_clock_wise (self);
}


static void _quadrapassel_user_target_toggled_cb_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self) {
	quadrapassel_user_target_toggled_cb (self);
}


static void _quadrapassel_theme_combo_changed_cb_gtk_combo_box_changed (GtkComboBox* _sender, gpointer self) {
	quadrapassel_theme_combo_changed_cb (self, _sender);
}


static void quadrapassel_preferences_cb (Quadrapassel* self) {
	GtkDialog* _tmp0_;
	const gchar* _tmp2_ = NULL;
	GtkWindow* _tmp3_;
	GtkDialog* _tmp4_;
	GtkDialog* _tmp5_;
	GtkDialog* _tmp6_;
	GtkDialog* _tmp7_;
	GtkBox* _tmp8_ = NULL;
	GtkBox* _tmp9_;
	GtkBox* vbox;
	GtkBox* _tmp10_;
	GtkDialog* _tmp11_;
	GtkDialog* _tmp12_;
	GtkNotebook* _tmp13_;
	GtkNotebook* _tmp14_;
	GtkNotebook* notebook;
	GtkNotebook* _tmp15_;
	GtkBox* _tmp16_;
	GtkNotebook* _tmp17_;
	GtkBox* _tmp18_;
	GtkBox* _tmp19_;
	GtkBox* _tmp20_;
	const gchar* _tmp21_ = NULL;
	GtkLabel* _tmp22_;
	GtkLabel* _tmp23_;
	GtkLabel* label;
	GtkNotebook* _tmp24_;
	GtkBox* _tmp25_;
	GtkLabel* _tmp26_;
	const gchar* _tmp27_ = NULL;
	GamesFrame* _tmp28_;
	GamesFrame* _tmp29_;
	GamesFrame* frame;
	GtkGrid* _tmp30_;
	GtkGrid* _tmp31_;
	GtkGrid* grid;
	GtkGrid* _tmp32_;
	GtkGrid* _tmp33_;
	const gchar* _tmp34_ = NULL;
	GtkLabel* _tmp35_;
	GtkLabel* _tmp36_;
	GtkLabel* _tmp37_;
	GtkLabel* _tmp38_;
	GtkGrid* _tmp39_;
	GtkLabel* _tmp40_;
	GSettings* _tmp41_;
	gint _tmp42_ = 0;
	Game* _tmp43_;
	gint _tmp44_;
	gint _tmp45_;
	GtkAdjustment* _tmp46_;
	GtkAdjustment* _tmp47_;
	GtkAdjustment* adj;
	GtkAdjustment* _tmp48_;
	GtkSpinButton* _tmp49_;
	GtkSpinButton* _tmp50_;
	GtkSpinButton* _tmp51_;
	GtkSpinButton* _tmp52_;
	GtkSpinButton* _tmp53_;
	GtkGrid* _tmp54_;
	GtkSpinButton* _tmp55_;
	GtkLabel* _tmp56_;
	GtkSpinButton* _tmp57_;
	const gchar* _tmp58_ = NULL;
	GtkLabel* _tmp59_;
	GtkLabel* _tmp60_;
	GtkLabel* _tmp61_;
	GtkLabel* _tmp62_;
	GtkGrid* _tmp63_;
	GtkLabel* _tmp64_;
	GSettings* _tmp65_;
	gint _tmp66_ = 0;
	GtkAdjustment* _tmp67_;
	GtkAdjustment* _tmp68_;
	GtkAdjustment* _tmp69_;
	GtkSpinButton* _tmp70_;
	GtkSpinButton* _tmp71_;
	GtkSpinButton* _tmp72_;
	GtkSpinButton* _tmp73_;
	GtkSpinButton* _tmp74_;
	GtkGrid* _tmp75_;
	GtkSpinButton* _tmp76_;
	GtkLabel* _tmp77_;
	GtkSpinButton* _tmp78_;
	const gchar* _tmp79_ = NULL;
	GtkLabel* _tmp80_;
	GtkLabel* _tmp81_;
	GtkLabel* _tmp82_;
	GtkLabel* _tmp83_;
	GtkGrid* _tmp84_;
	GtkLabel* _tmp85_;
	GSettings* _tmp86_;
	gint _tmp87_ = 0;
	GtkAdjustment* _tmp88_;
	GtkAdjustment* _tmp89_;
	GtkAdjustment* _tmp90_;
	GtkSpinButton* _tmp91_;
	GtkSpinButton* _tmp92_;
	GtkSpinButton* _tmp93_;
	GtkSpinButton* _tmp94_;
	GtkSpinButton* _tmp95_;
	GtkGrid* _tmp96_;
	GtkSpinButton* _tmp97_;
	GtkLabel* _tmp98_;
	GtkSpinButton* _tmp99_;
	GamesFrame* _tmp100_;
	GtkGrid* _tmp101_;
	GtkBox* _tmp102_;
	GamesFrame* _tmp103_;
	const gchar* _tmp104_ = NULL;
	GamesFrame* _tmp105_;
	GamesFrame* _tmp106_;
	GtkBox* _tmp107_;
	GtkBox* _tmp108_;
	GtkBox* fvbox;
	const gchar* _tmp109_ = NULL;
	GtkCheckButton* _tmp110_;
	GtkCheckButton* _tmp111_;
	GtkCheckButton* _tmp112_;
	GSettings* _tmp113_;
	gboolean _tmp114_ = FALSE;
	GtkCheckButton* _tmp115_;
	GtkBox* _tmp116_;
	GtkCheckButton* _tmp117_;
	const gchar* _tmp118_ = NULL;
	GtkCheckButton* _tmp119_;
	GtkCheckButton* _tmp120_;
	GtkCheckButton* _tmp121_;
	GSettings* _tmp122_;
	gboolean _tmp123_ = FALSE;
	GtkCheckButton* _tmp124_;
	GtkBox* _tmp125_;
	GtkCheckButton* _tmp126_;
	const gchar* _tmp127_ = NULL;
	GtkCheckButton* _tmp128_;
	GtkCheckButton* _tmp129_;
	GtkCheckButton* _tmp130_;
	GSettings* _tmp131_;
	gboolean _tmp132_ = FALSE;
	GtkCheckButton* _tmp133_;
	GtkBox* _tmp134_;
	GtkCheckButton* _tmp135_;
	const gchar* _tmp136_ = NULL;
	GtkCheckButton* _tmp137_;
	GtkCheckButton* _tmp138_;
	GtkCheckButton* _tmp139_;
	GSettings* _tmp140_;
	gboolean _tmp141_ = FALSE;
	GtkCheckButton* _tmp142_;
	GtkBox* _tmp143_;
	GtkCheckButton* _tmp144_;
	const gchar* _tmp145_ = NULL;
	GtkCheckButton* _tmp146_;
	GtkCheckButton* _tmp147_;
	GtkCheckButton* _tmp148_;
	GSettings* _tmp149_;
	gboolean _tmp150_ = FALSE;
	GtkCheckButton* _tmp151_;
	GtkBox* _tmp152_;
	GtkCheckButton* _tmp153_;
	GamesFrame* _tmp154_;
	GtkBox* _tmp155_;
	GtkBox* _tmp156_;
	GamesFrame* _tmp157_;
	const gchar* _tmp158_ = NULL;
	GamesFrame* _tmp159_;
	GamesFrame* _tmp160_;
	GtkGrid* _tmp161_;
	GtkGrid* _tmp162_;
	GtkGrid* _tmp163_;
	GtkGrid* _tmp164_;
	GtkGrid* _tmp165_;
	GtkBox* _tmp166_;
	GtkBox* _tmp167_;
	GtkBox* _tmp168_;
	const gchar* _tmp169_ = NULL;
	GtkLabel* _tmp170_;
	GtkLabel* _tmp171_;
	GtkNotebook* _tmp172_;
	GtkBox* _tmp173_;
	GtkLabel* _tmp174_;
	const gchar* _tmp175_ = NULL;
	GamesFrame* _tmp176_;
	GamesFrame* _tmp177_;
	GtkBox* _tmp178_;
	GamesFrame* _tmp179_;
	GtkBox* _tmp180_;
	GtkBox* _tmp181_;
	GamesFrame* _tmp182_;
	GtkBox* _tmp183_;
	GSettings* _tmp184_;
	GamesControlsList* _tmp185_;
	GamesControlsList* _tmp186_;
	GamesControlsList* controls_list;
	GamesControlsList* _tmp187_;
	const gchar* _tmp188_ = NULL;
	const gchar* _tmp189_ = NULL;
	const gchar* _tmp190_ = NULL;
	const gchar* _tmp191_ = NULL;
	const gchar* _tmp192_ = NULL;
	const gchar* _tmp193_ = NULL;
	GtkBox* _tmp194_;
	GamesControlsList* _tmp195_;
	GtkBox* _tmp196_;
	GtkBox* _tmp197_;
	GtkBox* _tmp198_;
	const gchar* _tmp199_ = NULL;
	GtkLabel* _tmp200_;
	GtkLabel* _tmp201_;
	GtkNotebook* _tmp202_;
	GtkBox* _tmp203_;
	GtkLabel* _tmp204_;
	const gchar* _tmp205_ = NULL;
	GamesFrame* _tmp206_;
	GamesFrame* _tmp207_;
	GtkBox* _tmp208_;
	GamesFrame* _tmp209_;
	GtkBox* _tmp210_;
	GtkBox* _tmp211_;
	GamesFrame* _tmp212_;
	GtkBox* _tmp213_;
	GtkComboBox* _tmp214_;
	GtkComboBox* _tmp215_;
	GtkComboBox* theme_combo;
	GtkListStore* _tmp216_;
	GtkListStore* theme_store;
	GtkComboBox* _tmp217_;
	GtkListStore* _tmp218_;
	GtkCellRendererText* _tmp219_;
	GtkCellRendererText* _tmp220_;
	GtkCellRendererText* renderer;
	GtkComboBox* _tmp221_;
	GtkCellRendererText* _tmp222_;
	GtkComboBox* _tmp223_;
	GtkCellRendererText* _tmp224_;
	GtkTreeIter iter = {0};
	GtkListStore* _tmp225_;
	GtkTreeIter _tmp226_ = {0};
	GtkListStore* _tmp227_;
	GtkTreeIter _tmp228_;
	const gchar* _tmp229_ = NULL;
	GSettings* _tmp230_;
	gchar* _tmp231_ = NULL;
	gchar* _tmp232_;
	gboolean _tmp233_;
	GtkListStore* _tmp236_;
	GtkTreeIter _tmp237_ = {0};
	GtkListStore* _tmp238_;
	GtkTreeIter _tmp239_;
	const gchar* _tmp240_ = NULL;
	GSettings* _tmp241_;
	gchar* _tmp242_ = NULL;
	gchar* _tmp243_;
	gboolean _tmp244_;
	GtkListStore* _tmp247_;
	GtkTreeIter _tmp248_ = {0};
	GtkListStore* _tmp249_;
	GtkTreeIter _tmp250_;
	const gchar* _tmp251_ = NULL;
	GSettings* _tmp252_;
	gchar* _tmp253_ = NULL;
	gchar* _tmp254_;
	gboolean _tmp255_;
	GtkListStore* _tmp258_;
	GtkTreeIter _tmp259_ = {0};
	GtkListStore* _tmp260_;
	GtkTreeIter _tmp261_;
	const gchar* _tmp262_ = NULL;
	GSettings* _tmp263_;
	gchar* _tmp264_ = NULL;
	gchar* _tmp265_;
	gboolean _tmp266_;
	GtkComboBox* _tmp269_;
	GtkBox* _tmp270_;
	GtkComboBox* _tmp271_;
	Preview* _tmp272_;
	Preview* _tmp273_;
	Preview* _tmp274_;
	Game* _tmp275_;
	Game* _tmp276_;
	Preview* _tmp277_;
	GSettings* _tmp278_;
	gchar* _tmp279_ = NULL;
	gchar* _tmp280_;
	GtkBox* _tmp281_;
	Preview* _tmp282_;
	GtkDialog* _tmp283_;
	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_ = _ ("Quadrapassel Preferences");
	_tmp3_ = self->priv->main_window;
	_tmp4_ = (GtkDialog*) gtk_dialog_new_with_buttons (_tmp2_, _tmp3_, (GtkDialogFlags) 0, GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL, NULL);
	_tmp5_ = g_object_ref_sink (_tmp4_);
	_g_object_unref0 (self->priv->preferences_dialog);
	self->priv->preferences_dialog = _tmp5_;
	_tmp6_ = self->priv->preferences_dialog;
	gtk_container_set_border_width ((GtkContainer*) _tmp6_, (guint) 5);
	_tmp7_ = self->priv->preferences_dialog;
	_tmp8_ = gtk_dialog_get_content_area (_tmp7_);
	_tmp9_ = _g_object_ref0 (GTK_BOX (_tmp8_));
	vbox = _tmp9_;
	_tmp10_ = vbox;
	gtk_box_set_spacing (_tmp10_, 2);
	_tmp11_ = self->priv->preferences_dialog;
	g_signal_connect_object (_tmp11_, "close", (GCallback) _quadrapassel_preferences_dialog_close_cb_gtk_dialog_close, self, 0);
	_tmp12_ = self->priv->preferences_dialog;
	g_signal_connect_object (_tmp12_, "response", (GCallback) _quadrapassel_preferences_dialog_response_cb_gtk_dialog_response, self, 0);
	_tmp13_ = (GtkNotebook*) gtk_notebook_new ();
	_tmp14_ = g_object_ref_sink (_tmp13_);
	notebook = _tmp14_;
	_tmp15_ = notebook;
	gtk_container_set_border_width ((GtkContainer*) _tmp15_, (guint) 5);
	_tmp16_ = vbox;
	_tmp17_ = notebook;
	gtk_box_pack_start (_tmp16_, (GtkWidget*) _tmp17_, TRUE, TRUE, (guint) 0);
	_tmp18_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 18);
	_tmp19_ = g_object_ref_sink (_tmp18_);
	_g_object_unref0 (vbox);
	vbox = _tmp19_;
	_tmp20_ = vbox;
	gtk_container_set_border_width ((GtkContainer*) _tmp20_, (guint) 12);
	_tmp21_ = _ ("Game");
	_tmp22_ = (GtkLabel*) gtk_label_new (_tmp21_);
	_tmp23_ = g_object_ref_sink (_tmp22_);
	label = _tmp23_;
	_tmp24_ = notebook;
	_tmp25_ = vbox;
	_tmp26_ = label;
	gtk_notebook_append_page (_tmp24_, (GtkWidget*) _tmp25_, (GtkWidget*) _tmp26_);
	_tmp27_ = _ ("Setup");
	_tmp28_ = games_frame_new (_tmp27_);
	_tmp29_ = g_object_ref_sink (_tmp28_);
	frame = _tmp29_;
	_tmp30_ = (GtkGrid*) gtk_grid_new ();
	_tmp31_ = g_object_ref_sink (_tmp30_);
	grid = _tmp31_;
	_tmp32_ = grid;
	gtk_grid_set_row_spacing (_tmp32_, (guint) 6);
	_tmp33_ = grid;
	gtk_grid_set_column_spacing (_tmp33_, (guint) 12);
	_tmp34_ = _ ("_Number of pre-filled rows:");
	_tmp35_ = (GtkLabel*) gtk_label_new_with_mnemonic (_tmp34_);
	_tmp36_ = g_object_ref_sink (_tmp35_);
	_g_object_unref0 (label);
	label = _tmp36_;
	_tmp37_ = label;
	gtk_misc_set_alignment ((GtkMisc*) _tmp37_, (gfloat) 0, 0.5f);
	_tmp38_ = label;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp38_, TRUE);
	_tmp39_ = grid;
	_tmp40_ = label;
	gtk_grid_attach (_tmp39_, (GtkWidget*) _tmp40_, 0, 0, 1, 1);
	_tmp41_ = self->priv->settings;
	_tmp42_ = g_settings_get_int (_tmp41_, "line-fill-height");
	_tmp43_ = self->priv->game;
	_tmp44_ = game_get_height (_tmp43_);
	_tmp45_ = _tmp44_;
	_tmp46_ = gtk_adjustment_new ((gdouble) _tmp42_, (gdouble) 0, (gdouble) (_tmp45_ - 1), (gdouble) 1, (gdouble) 5, (gdouble) 0);
	_tmp47_ = g_object_ref_sink (_tmp46_);
	adj = _tmp47_;
	_tmp48_ = adj;
	_tmp49_ = (GtkSpinButton*) gtk_spin_button_new (_tmp48_, (gdouble) 10, (guint) 0);
	_tmp50_ = g_object_ref_sink (_tmp49_);
	_g_object_unref0 (self->priv->fill_height_spinner);
	self->priv->fill_height_spinner = _tmp50_;
	_tmp51_ = self->priv->fill_height_spinner;
	gtk_spin_button_set_update_policy (_tmp51_, GTK_UPDATE_ALWAYS);
	_tmp52_ = self->priv->fill_height_spinner;
	gtk_spin_button_set_snap_to_ticks (_tmp52_, TRUE);
	_tmp53_ = self->priv->fill_height_spinner;
	g_signal_connect_object (_tmp53_, "value-changed", (GCallback) _quadrapassel_fill_height_spinner_value_changed_cb_gtk_spin_button_value_changed, self, 0);
	_tmp54_ = grid;
	_tmp55_ = self->priv->fill_height_spinner;
	gtk_grid_attach (_tmp54_, (GtkWidget*) _tmp55_, 1, 0, 2, 1);
	_tmp56_ = label;
	_tmp57_ = self->priv->fill_height_spinner;
	gtk_label_set_mnemonic_widget (_tmp56_, (GtkWidget*) _tmp57_);
	_tmp58_ = _ ("_Density of blocks in a pre-filled row:");
	_tmp59_ = (GtkLabel*) gtk_label_new_with_mnemonic (_tmp58_);
	_tmp60_ = g_object_ref_sink (_tmp59_);
	_g_object_unref0 (label);
	label = _tmp60_;
	_tmp61_ = label;
	gtk_misc_set_alignment ((GtkMisc*) _tmp61_, (gfloat) 0, 0.5f);
	_tmp62_ = label;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp62_, TRUE);
	_tmp63_ = grid;
	_tmp64_ = label;
	gtk_grid_attach (_tmp63_, (GtkWidget*) _tmp64_, 0, 1, 1, 1);
	_tmp65_ = self->priv->settings;
	_tmp66_ = g_settings_get_int (_tmp65_, "line-fill-probability");
	_tmp67_ = gtk_adjustment_new ((gdouble) _tmp66_, (gdouble) 0, (gdouble) 10, (gdouble) 1, (gdouble) 5, (gdouble) 0);
	_tmp68_ = g_object_ref_sink (_tmp67_);
	_g_object_unref0 (adj);
	adj = _tmp68_;
	_tmp69_ = adj;
	_tmp70_ = (GtkSpinButton*) gtk_spin_button_new (_tmp69_, (gdouble) 10, (guint) 0);
	_tmp71_ = g_object_ref_sink (_tmp70_);
	_g_object_unref0 (self->priv->fill_prob_spinner);
	self->priv->fill_prob_spinner = _tmp71_;
	_tmp72_ = self->priv->fill_prob_spinner;
	gtk_spin_button_set_update_policy (_tmp72_, GTK_UPDATE_ALWAYS);
	_tmp73_ = self->priv->fill_prob_spinner;
	gtk_spin_button_set_snap_to_ticks (_tmp73_, TRUE);
	_tmp74_ = self->priv->fill_prob_spinner;
	g_signal_connect_object (_tmp74_, "value-changed", (GCallback) _quadrapassel_fill_prob_spinner_value_changed_cb_gtk_spin_button_value_changed, self, 0);
	_tmp75_ = grid;
	_tmp76_ = self->priv->fill_prob_spinner;
	gtk_grid_attach (_tmp75_, (GtkWidget*) _tmp76_, 1, 1, 1, 1);
	_tmp77_ = label;
	_tmp78_ = self->priv->fill_prob_spinner;
	gtk_label_set_mnemonic_widget (_tmp77_, (GtkWidget*) _tmp78_);
	_tmp79_ = _ ("_Starting level:");
	_tmp80_ = (GtkLabel*) gtk_label_new_with_mnemonic (_tmp79_);
	_tmp81_ = g_object_ref_sink (_tmp80_);
	_g_object_unref0 (label);
	label = _tmp81_;
	_tmp82_ = label;
	gtk_misc_set_alignment ((GtkMisc*) _tmp82_, (gfloat) 0, 0.5f);
	_tmp83_ = label;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp83_, TRUE);
	_tmp84_ = grid;
	_tmp85_ = label;
	gtk_grid_attach (_tmp84_, (GtkWidget*) _tmp85_, 0, 2, 1, 1);
	_tmp86_ = self->priv->settings;
	_tmp87_ = g_settings_get_int (_tmp86_, "starting-level");
	_tmp88_ = gtk_adjustment_new ((gdouble) _tmp87_, (gdouble) 1, (gdouble) 20, (gdouble) 1, (gdouble) 5, (gdouble) 0);
	_tmp89_ = g_object_ref_sink (_tmp88_);
	_g_object_unref0 (adj);
	adj = _tmp89_;
	_tmp90_ = adj;
	_tmp91_ = (GtkSpinButton*) gtk_spin_button_new (_tmp90_, 10.0, (guint) 0);
	_tmp92_ = g_object_ref_sink (_tmp91_);
	_g_object_unref0 (self->priv->starting_level_spin);
	self->priv->starting_level_spin = _tmp92_;
	_tmp93_ = self->priv->starting_level_spin;
	gtk_spin_button_set_update_policy (_tmp93_, GTK_UPDATE_ALWAYS);
	_tmp94_ = self->priv->starting_level_spin;
	gtk_spin_button_set_snap_to_ticks (_tmp94_, TRUE);
	_tmp95_ = self->priv->starting_level_spin;
	g_signal_connect_object (_tmp95_, "value-changed", (GCallback) _quadrapassel_starting_level_value_changed_cb_gtk_spin_button_value_changed, self, 0);
	_tmp96_ = grid;
	_tmp97_ = self->priv->starting_level_spin;
	gtk_grid_attach (_tmp96_, (GtkWidget*) _tmp97_, 1, 2, 1, 1);
	_tmp98_ = label;
	_tmp99_ = self->priv->starting_level_spin;
	gtk_label_set_mnemonic_widget (_tmp98_, (GtkWidget*) _tmp99_);
	_tmp100_ = frame;
	_tmp101_ = grid;
	gtk_container_add ((GtkContainer*) _tmp100_, (GtkWidget*) _tmp101_);
	_tmp102_ = vbox;
	_tmp103_ = frame;
	gtk_box_pack_start (_tmp102_, (GtkWidget*) _tmp103_, FALSE, FALSE, (guint) 0);
	_tmp104_ = _ ("Operation");
	_tmp105_ = games_frame_new (_tmp104_);
	_tmp106_ = g_object_ref_sink (_tmp105_);
	_g_object_unref0 (frame);
	frame = _tmp106_;
	_tmp107_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
	_tmp108_ = g_object_ref_sink (_tmp107_);
	fvbox = _tmp108_;
	_tmp109_ = _ ("_Enable sounds");
	_tmp110_ = (GtkCheckButton*) gtk_check_button_new_with_mnemonic (_tmp109_);
	_tmp111_ = g_object_ref_sink (_tmp110_);
	_g_object_unref0 (self->priv->sound_toggle);
	self->priv->sound_toggle = _tmp111_;
	_tmp112_ = self->priv->sound_toggle;
	_tmp113_ = self->priv->settings;
	_tmp114_ = g_settings_get_boolean (_tmp113_, "sound");
	gtk_toggle_button_set_active ((GtkToggleButton*) _tmp112_, _tmp114_);
	_tmp115_ = self->priv->sound_toggle;
	g_signal_connect_object ((GtkToggleButton*) _tmp115_, "toggled", (GCallback) _quadrapassel_sound_toggle_toggled_cb_gtk_toggle_button_toggled, self, 0);
	_tmp116_ = fvbox;
	_tmp117_ = self->priv->sound_toggle;
	gtk_box_pack_start (_tmp116_, (GtkWidget*) _tmp117_, FALSE, FALSE, (guint) 0);
	_tmp118_ = _ ("_Preview next block");
	_tmp119_ = (GtkCheckButton*) gtk_check_button_new_with_mnemonic (_tmp118_);
	_tmp120_ = g_object_ref_sink (_tmp119_);
	_g_object_unref0 (self->priv->do_preview_toggle);
	self->priv->do_preview_toggle = _tmp120_;
	_tmp121_ = self->priv->do_preview_toggle;
	_tmp122_ = self->priv->settings;
	_tmp123_ = g_settings_get_boolean (_tmp122_, "do-preview");
	gtk_toggle_button_set_active ((GtkToggleButton*) _tmp121_, _tmp123_);
	_tmp124_ = self->priv->do_preview_toggle;
	g_signal_connect_object ((GtkToggleButton*) _tmp124_, "toggled", (GCallback) _quadrapassel_do_preview_toggle_toggled_cb_gtk_toggle_button_toggled, self, 0);
	_tmp125_ = fvbox;
	_tmp126_ = self->priv->do_preview_toggle;
	gtk_box_pack_start (_tmp125_, (GtkWidget*) _tmp126_, FALSE, FALSE, (guint) 0);
	_tmp127_ = _ ("Choose difficult _blocks");
	_tmp128_ = (GtkCheckButton*) gtk_check_button_new_with_mnemonic (_tmp127_);
	_tmp129_ = g_object_ref_sink (_tmp128_);
	_g_object_unref0 (self->priv->difficult_blocks_toggle);
	self->priv->difficult_blocks_toggle = _tmp129_;
	_tmp130_ = self->priv->difficult_blocks_toggle;
	_tmp131_ = self->priv->settings;
	_tmp132_ = g_settings_get_boolean (_tmp131_, "pick-difficult-blocks");
	gtk_toggle_button_set_active ((GtkToggleButton*) _tmp130_, _tmp132_);
	_tmp133_ = self->priv->difficult_blocks_toggle;
	g_signal_connect_object ((GtkToggleButton*) _tmp133_, "toggled", (GCallback) _quadrapassel_difficult_blocks_toggled_cb_gtk_toggle_button_toggled, self, 0);
	_tmp134_ = fvbox;
	_tmp135_ = self->priv->difficult_blocks_toggle;
	gtk_box_pack_start (_tmp134_, (GtkWidget*) _tmp135_, FALSE, FALSE, (guint) 0);
	_tmp136_ = _ ("_Rotate blocks counterclockwise");
	_tmp137_ = (GtkCheckButton*) gtk_check_button_new_with_mnemonic (_tmp136_);
	_tmp138_ = g_object_ref_sink (_tmp137_);
	_g_object_unref0 (self->priv->rotate_counter_clock_wise_toggle);
	self->priv->rotate_counter_clock_wise_toggle = _tmp138_;
	_tmp139_ = self->priv->rotate_counter_clock_wise_toggle;
	_tmp140_ = self->priv->settings;
	_tmp141_ = g_settings_get_boolean (_tmp140_, "rotate-counter-clock-wise");
	gtk_toggle_button_set_active ((GtkToggleButton*) _tmp139_, _tmp141_);
	_tmp142_ = self->priv->rotate_counter_clock_wise_toggle;
	g_signal_connect_object ((GtkToggleButton*) _tmp142_, "toggled", (GCallback) _quadrapassel_set_rotate_counter_clock_wise_gtk_toggle_button_toggled, self, 0);
	_tmp143_ = fvbox;
	_tmp144_ = self->priv->rotate_counter_clock_wise_toggle;
	gtk_box_pack_start (_tmp143_, (GtkWidget*) _tmp144_, FALSE, FALSE, (guint) 0);
	_tmp145_ = _ ("Show _where the block will land");
	_tmp146_ = (GtkCheckButton*) gtk_check_button_new_with_mnemonic (_tmp145_);
	_tmp147_ = g_object_ref_sink (_tmp146_);
	_g_object_unref0 (self->priv->show_shadow_toggle);
	self->priv->show_shadow_toggle = _tmp147_;
	_tmp148_ = self->priv->show_shadow_toggle;
	_tmp149_ = self->priv->settings;
	_tmp150_ = g_settings_get_boolean (_tmp149_, "show-shadow");
	gtk_toggle_button_set_active ((GtkToggleButton*) _tmp148_, _tmp150_);
	_tmp151_ = self->priv->show_shadow_toggle;
	g_signal_connect_object ((GtkToggleButton*) _tmp151_, "toggled", (GCallback) _quadrapassel_user_target_toggled_cb_gtk_toggle_button_toggled, self, 0);
	_tmp152_ = fvbox;
	_tmp153_ = self->priv->show_shadow_toggle;
	gtk_box_pack_start (_tmp152_, (GtkWidget*) _tmp153_, FALSE, FALSE, (guint) 0);
	_tmp154_ = frame;
	_tmp155_ = fvbox;
	gtk_container_add ((GtkContainer*) _tmp154_, (GtkWidget*) _tmp155_);
	_tmp156_ = vbox;
	_tmp157_ = frame;
	gtk_box_pack_start (_tmp156_, (GtkWidget*) _tmp157_, FALSE, FALSE, (guint) 0);
	_tmp158_ = _ ("Theme");
	_tmp159_ = games_frame_new (_tmp158_);
	_tmp160_ = g_object_ref_sink (_tmp159_);
	_g_object_unref0 (frame);
	frame = _tmp160_;
	_tmp161_ = (GtkGrid*) gtk_grid_new ();
	_tmp162_ = g_object_ref_sink (_tmp161_);
	_g_object_unref0 (grid);
	grid = _tmp162_;
	_tmp163_ = grid;
	gtk_container_set_border_width ((GtkContainer*) _tmp163_, (guint) 0);
	_tmp164_ = grid;
	gtk_grid_set_row_spacing (_tmp164_, (guint) 6);
	_tmp165_ = grid;
	gtk_grid_set_column_spacing (_tmp165_, (guint) 12);
	_tmp166_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	_tmp167_ = g_object_ref_sink (_tmp166_);
	_g_object_unref0 (vbox);
	vbox = _tmp167_;
	_tmp168_ = vbox;
	gtk_container_set_border_width ((GtkContainer*) _tmp168_, (guint) 12);
	_tmp169_ = _ ("Controls");
	_tmp170_ = (GtkLabel*) gtk_label_new (_tmp169_);
	_tmp171_ = g_object_ref_sink (_tmp170_);
	_g_object_unref0 (label);
	label = _tmp171_;
	_tmp172_ = notebook;
	_tmp173_ = vbox;
	_tmp174_ = label;
	gtk_notebook_append_page (_tmp172_, (GtkWidget*) _tmp173_, (GtkWidget*) _tmp174_);
	_tmp175_ = _ ("Keyboard Controls");
	_tmp176_ = games_frame_new (_tmp175_);
	_tmp177_ = g_object_ref_sink (_tmp176_);
	_g_object_unref0 (frame);
	frame = _tmp177_;
	_tmp178_ = vbox;
	_tmp179_ = frame;
	gtk_box_pack_start (_tmp178_, (GtkWidget*) _tmp179_, TRUE, TRUE, (guint) 0);
	_tmp180_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
	_tmp181_ = g_object_ref_sink (_tmp180_);
	_g_object_unref0 (fvbox);
	fvbox = _tmp181_;
	_tmp182_ = frame;
	_tmp183_ = fvbox;
	gtk_container_add ((GtkContainer*) _tmp182_, (GtkWidget*) _tmp183_);
	_tmp184_ = self->priv->settings;
	_tmp185_ = games_controls_list_new (_tmp184_);
	_tmp186_ = g_object_ref_sink (_tmp185_);
	controls_list = _tmp186_;
	_tmp187_ = controls_list;
	_tmp188_ = _ ("Move left");
	_tmp189_ = _ ("Move right");
	_tmp190_ = _ ("Move down");
	_tmp191_ = _ ("Drop");
	_tmp192_ = _ ("Rotate");
	_tmp193_ = _ ("Pause");
	games_controls_list_add_controls (_tmp187_, "key-left", _tmp188_, 0, "key-right", _tmp189_, 0, "key-down", _tmp190_, 0, "key-drop", _tmp191_, 0, "key-rotate", _tmp192_, 0, "key-pause", _tmp193_, 0, NULL, NULL);
	_tmp194_ = fvbox;
	_tmp195_ = controls_list;
	gtk_box_pack_start (_tmp194_, (GtkWidget*) _tmp195_, TRUE, TRUE, (guint) 0);
	_tmp196_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	_tmp197_ = g_object_ref_sink (_tmp196_);
	_g_object_unref0 (vbox);
	vbox = _tmp197_;
	_tmp198_ = vbox;
	gtk_container_set_border_width ((GtkContainer*) _tmp198_, (guint) 12);
	_tmp199_ = _ ("Theme");
	_tmp200_ = (GtkLabel*) gtk_label_new (_tmp199_);
	_tmp201_ = g_object_ref_sink (_tmp200_);
	_g_object_unref0 (label);
	label = _tmp201_;
	_tmp202_ = notebook;
	_tmp203_ = vbox;
	_tmp204_ = label;
	gtk_notebook_append_page (_tmp202_, (GtkWidget*) _tmp203_, (GtkWidget*) _tmp204_);
	_tmp205_ = _ ("Block Style");
	_tmp206_ = games_frame_new (_tmp205_);
	_tmp207_ = g_object_ref_sink (_tmp206_);
	_g_object_unref0 (frame);
	frame = _tmp207_;
	_tmp208_ = vbox;
	_tmp209_ = frame;
	gtk_box_pack_start (_tmp208_, (GtkWidget*) _tmp209_, TRUE, TRUE, (guint) 0);
	_tmp210_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
	_tmp211_ = g_object_ref_sink (_tmp210_);
	_g_object_unref0 (fvbox);
	fvbox = _tmp211_;
	_tmp212_ = frame;
	_tmp213_ = fvbox;
	gtk_container_add ((GtkContainer*) _tmp212_, (GtkWidget*) _tmp213_);
	_tmp214_ = (GtkComboBox*) gtk_combo_box_new ();
	_tmp215_ = g_object_ref_sink (_tmp214_);
	theme_combo = _tmp215_;
	_tmp216_ = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING);
	theme_store = _tmp216_;
	_tmp217_ = theme_combo;
	_tmp218_ = theme_store;
	gtk_combo_box_set_model (_tmp217_, (GtkTreeModel*) _tmp218_);
	_tmp219_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	_tmp220_ = g_object_ref_sink (_tmp219_);
	renderer = _tmp220_;
	_tmp221_ = theme_combo;
	_tmp222_ = renderer;
	gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp221_, (GtkCellRenderer*) _tmp222_, TRUE);
	_tmp223_ = theme_combo;
	_tmp224_ = renderer;
	gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp223_, (GtkCellRenderer*) _tmp224_, "text", 0);
	_tmp225_ = theme_store;
	gtk_list_store_append (_tmp225_, &_tmp226_);
	iter = _tmp226_;
	_tmp227_ = theme_store;
	_tmp228_ = iter;
	_tmp229_ = _ ("Plain");
	gtk_list_store_set (_tmp227_, &_tmp228_, 0, _tmp229_, 1, "plain", -1, -1);
	_tmp230_ = self->priv->settings;
	_tmp231_ = g_settings_get_string (_tmp230_, "theme");
	_tmp232_ = _tmp231_;
	_tmp233_ = g_strcmp0 (_tmp232_, "plain") == 0;
	_g_free0 (_tmp232_);
	if (_tmp233_) {
		GtkComboBox* _tmp234_;
		GtkTreeIter _tmp235_;
		_tmp234_ = theme_combo;
		_tmp235_ = iter;
		gtk_combo_box_set_active_iter (_tmp234_, &_tmp235_);
	}
	_tmp236_ = theme_store;
	gtk_list_store_append (_tmp236_, &_tmp237_);
	iter = _tmp237_;
	_tmp238_ = theme_store;
	_tmp239_ = iter;
	_tmp240_ = _ ("Tango Flat");
	gtk_list_store_set (_tmp238_, &_tmp239_, 0, _tmp240_, 1, "tangoflat", -1, -1);
	_tmp241_ = self->priv->settings;
	_tmp242_ = g_settings_get_string (_tmp241_, "theme");
	_tmp243_ = _tmp242_;
	_tmp244_ = g_strcmp0 (_tmp243_, "tangoflat") == 0;
	_g_free0 (_tmp243_);
	if (_tmp244_) {
		GtkComboBox* _tmp245_;
		GtkTreeIter _tmp246_;
		_tmp245_ = theme_combo;
		_tmp246_ = iter;
		gtk_combo_box_set_active_iter (_tmp245_, &_tmp246_);
	}
	_tmp247_ = theme_store;
	gtk_list_store_append (_tmp247_, &_tmp248_);
	iter = _tmp248_;
	_tmp249_ = theme_store;
	_tmp250_ = iter;
	_tmp251_ = _ ("Tango Shaded");
	gtk_list_store_set (_tmp249_, &_tmp250_, 0, _tmp251_, 1, "tangoshaded", -1, -1);
	_tmp252_ = self->priv->settings;
	_tmp253_ = g_settings_get_string (_tmp252_, "theme");
	_tmp254_ = _tmp253_;
	_tmp255_ = g_strcmp0 (_tmp254_, "tangoshaded") == 0;
	_g_free0 (_tmp254_);
	if (_tmp255_) {
		GtkComboBox* _tmp256_;
		GtkTreeIter _tmp257_;
		_tmp256_ = theme_combo;
		_tmp257_ = iter;
		gtk_combo_box_set_active_iter (_tmp256_, &_tmp257_);
	}
	_tmp258_ = theme_store;
	gtk_list_store_append (_tmp258_, &_tmp259_);
	iter = _tmp259_;
	_tmp260_ = theme_store;
	_tmp261_ = iter;
	_tmp262_ = _ ("Clean");
	gtk_list_store_set (_tmp260_, &_tmp261_, 0, _tmp262_, 1, "clean", -1, -1);
	_tmp263_ = self->priv->settings;
	_tmp264_ = g_settings_get_string (_tmp263_, "theme");
	_tmp265_ = _tmp264_;
	_tmp266_ = g_strcmp0 (_tmp265_, "clean") == 0;
	_g_free0 (_tmp265_);
	if (_tmp266_) {
		GtkComboBox* _tmp267_;
		GtkTreeIter _tmp268_;
		_tmp267_ = theme_combo;
		_tmp268_ = iter;
		gtk_combo_box_set_active_iter (_tmp267_, &_tmp268_);
	}
	_tmp269_ = theme_combo;
	g_signal_connect_object (_tmp269_, "changed", (GCallback) _quadrapassel_theme_combo_changed_cb_gtk_combo_box_changed, self, 0);
	_tmp270_ = fvbox;
	_tmp271_ = theme_combo;
	gtk_box_pack_start (_tmp270_, (GtkWidget*) _tmp271_, FALSE, FALSE, (guint) 0);
	_tmp272_ = preview_new ();
	_tmp273_ = g_object_ref_sink (_tmp272_);
	_g_object_unref0 (self->priv->theme_preview);
	self->priv->theme_preview = _tmp273_;
	_tmp274_ = self->priv->theme_preview;
	_tmp275_ = game_new (20, 14, 1, 0, 5, FALSE);
	_tmp276_ = _tmp275_;
	preview_set_game (_tmp274_, _tmp276_);
	_g_object_unref0 (_tmp276_);
	_tmp277_ = self->priv->theme_preview;
	_tmp278_ = self->priv->settings;
	_tmp279_ = g_settings_get_string (_tmp278_, "theme");
	_tmp280_ = _tmp279_;
	preview_set_theme (_tmp277_, _tmp280_);
	_g_free0 (_tmp280_);
	_tmp281_ = fvbox;
	_tmp282_ = self->priv->theme_preview;
	gtk_box_pack_start (_tmp281_, (GtkWidget*) _tmp282_, TRUE, TRUE, (guint) 0);
	_tmp283_ = self->priv->preferences_dialog;
	gtk_widget_show_all ((GtkWidget*) _tmp283_);
	_g_object_unref0 (renderer);
	_g_object_unref0 (theme_store);
	_g_object_unref0 (theme_combo);
	_g_object_unref0 (controls_list);
	_g_object_unref0 (fvbox);
	_g_object_unref0 (adj);
	_g_object_unref0 (grid);
	_g_object_unref0 (frame);
	_g_object_unref0 (label);
	_g_object_unref0 (notebook);
	_g_object_unref0 (vbox);
}


static void quadrapassel_sound_toggle_toggled_cb (Quadrapassel* self) {
	GtkCheckButton* _tmp0_;
	gboolean _tmp1_ = FALSE;
	gboolean play_sound;
	GSettings* _tmp2_;
	GameView* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->sound_toggle;
	_tmp1_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp0_);
	play_sound = _tmp1_;
	_tmp2_ = self->priv->settings;
	g_settings_set_boolean (_tmp2_, "sound", play_sound);
	_tmp3_ = self->priv->view;
	_tmp3_->mute = !play_sound;
}


static void quadrapassel_do_preview_toggle_toggled_cb (Quadrapassel* self) {
	GtkCheckButton* _tmp0_;
	gboolean _tmp1_ = FALSE;
	gboolean do_preview;
	GSettings* _tmp2_;
	Preview* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->do_preview_toggle;
	_tmp1_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp0_);
	do_preview = _tmp1_;
	_tmp2_ = self->priv->settings;
	g_settings_set_boolean (_tmp2_, "do-preview", do_preview);
	_tmp3_ = self->priv->preview;
	preview_set_enabled (_tmp3_, do_preview);
}


static void quadrapassel_difficult_blocks_toggled_cb (Quadrapassel* self) {
	GSettings* _tmp0_;
	GtkCheckButton* _tmp1_;
	gboolean _tmp2_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->settings;
	_tmp1_ = self->priv->difficult_blocks_toggle;
	_tmp2_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp1_);
	g_settings_set_boolean (_tmp0_, "pick-difficult-blocks", _tmp2_);
}


static void quadrapassel_set_rotate_counter_clock_wise (Quadrapassel* self) {
	GSettings* _tmp0_;
	GtkCheckButton* _tmp1_;
	gboolean _tmp2_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->settings;
	_tmp1_ = self->priv->rotate_counter_clock_wise_toggle;
	_tmp2_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp1_);
	g_settings_set_boolean (_tmp0_, "rotate-counter-clock-wise", _tmp2_);
}


static void quadrapassel_user_target_toggled_cb (Quadrapassel* self) {
	GtkCheckButton* _tmp0_;
	gboolean _tmp1_ = FALSE;
	gboolean show_shadow;
	GSettings* _tmp2_;
	GameView* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->show_shadow_toggle;
	_tmp1_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp0_);
	show_shadow = _tmp1_;
	_tmp2_ = self->priv->settings;
	g_settings_set_boolean (_tmp2_, "show-shadow", show_shadow);
	_tmp3_ = self->priv->view;
	game_view_set_show_shadow (_tmp3_, show_shadow);
}


static void quadrapassel_theme_combo_changed_cb (Quadrapassel* self, GtkComboBox* widget) {
	GtkTreeIter iter = {0};
	GtkComboBox* _tmp0_;
	GtkTreeIter _tmp1_ = {0};
	gchar* theme = NULL;
	GtkComboBox* _tmp2_;
	GtkTreeModel* _tmp3_;
	GtkTreeModel* _tmp4_;
	GtkTreeIter _tmp5_;
	GameView* _tmp6_;
	const gchar* _tmp7_;
	Preview* _tmp8_;
	const gchar* _tmp9_;
	Preview* _tmp10_;
	GSettings* _tmp13_;
	const gchar* _tmp14_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (widget != NULL);
	_tmp0_ = widget;
	gtk_combo_box_get_active_iter (_tmp0_, &_tmp1_);
	iter = _tmp1_;
	_tmp2_ = widget;
	_tmp3_ = gtk_combo_box_get_model (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = iter;
	gtk_tree_model_get (_tmp4_, &_tmp5_, 1, &theme, -1);
	_tmp6_ = self->priv->view;
	_tmp7_ = theme;
	game_view_set_theme (_tmp6_, _tmp7_);
	_tmp8_ = self->priv->preview;
	_tmp9_ = theme;
	preview_set_theme (_tmp8_, _tmp9_);
	_tmp10_ = self->priv->theme_preview;
	if (_tmp10_ != NULL) {
		Preview* _tmp11_;
		const gchar* _tmp12_;
		_tmp11_ = self->priv->theme_preview;
		_tmp12_ = theme;
		preview_set_theme (_tmp11_, _tmp12_);
	}
	_tmp13_ = self->priv->settings;
	_tmp14_ = theme;
	g_settings_set_string (_tmp13_, "theme", _tmp14_);
	_g_free0 (theme);
}


static void quadrapassel_fill_height_spinner_value_changed_cb (Quadrapassel* self, GtkSpinButton* spin) {
	GtkSpinButton* _tmp0_;
	gint _tmp1_ = 0;
	gint value;
	GSettings* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (spin != NULL);
	_tmp0_ = spin;
	_tmp1_ = gtk_spin_button_get_value_as_int (_tmp0_);
	value = _tmp1_;
	_tmp2_ = self->priv->settings;
	g_settings_set_int (_tmp2_, "line-fill-height", value);
}


static void quadrapassel_fill_prob_spinner_value_changed_cb (Quadrapassel* self, GtkSpinButton* spin) {
	GtkSpinButton* _tmp0_;
	gint _tmp1_ = 0;
	gint value;
	GSettings* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (spin != NULL);
	_tmp0_ = spin;
	_tmp1_ = gtk_spin_button_get_value_as_int (_tmp0_);
	value = _tmp1_;
	_tmp2_ = self->priv->settings;
	g_settings_set_int (_tmp2_, "line-fill-probability", value);
}


static void quadrapassel_starting_level_value_changed_cb (Quadrapassel* self, GtkSpinButton* spin) {
	GtkSpinButton* _tmp0_;
	gint _tmp1_ = 0;
	gint value;
	GSettings* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (spin != NULL);
	_tmp0_ = spin;
	_tmp1_ = gtk_spin_button_get_value_as_int (_tmp0_);
	value = _tmp1_;
	_tmp2_ = self->priv->settings;
	g_settings_set_int (_tmp2_, "starting-level", value);
}


static gboolean _variant_get2 (GVariant* value) {
	return g_variant_get_boolean (value);
}


static GVariant* _variant_new3 (gboolean value) {
	return g_variant_ref_sink (g_variant_new_boolean (value));
}


static void quadrapassel_toggle_cb (Quadrapassel* self, GSimpleAction* action, GVariant* parameter) {
	GSimpleAction* _tmp0_;
	GSimpleAction* _tmp1_;
	GVariant* _tmp2_ = NULL;
	GVariant* _tmp3_;
	gboolean _tmp4_;
	GVariant* _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	_tmp0_ = action;
	_tmp1_ = action;
	_tmp2_ = g_action_get_state ((GAction*) _tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = _variant_get2 (_tmp3_);
	_tmp5_ = _variant_new3 (!_tmp4_);
	g_signal_emit_by_name (_tmp0_, "change-state", _tmp5_);
	_g_variant_unref0 (_tmp3_);
}


static gboolean _variant_get4 (GVariant* value) {
	return g_variant_get_boolean (value);
}


static void quadrapassel_pause_changed (Quadrapassel* self, GSimpleAction* action, GVariant* state) {
	GamesPauseAction* _tmp0_;
	GVariant* _tmp1_;
	gboolean _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	g_return_if_fail (state != NULL);
	_tmp0_ = self->priv->pause_action;
	_tmp1_ = state;
	_tmp2_ = _variant_get4 (_tmp1_);
	games_pause_action_set_is_paused (_tmp0_, _tmp2_);
}


static GVariant* _variant_new5 (gboolean value) {
	return g_variant_ref_sink (g_variant_new_boolean (value));
}


static void quadrapassel_pause_cb (Quadrapassel* self) {
	Game* _tmp0_;
	GSimpleAction* _tmp4_;
	GamesPauseAction* _tmp5_;
	gboolean _tmp6_ = FALSE;
	GVariant* _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->game;
	if (_tmp0_ != NULL) {
		Game* _tmp1_;
		GamesPauseAction* _tmp2_;
		gboolean _tmp3_ = FALSE;
		_tmp1_ = self->priv->game;
		_tmp2_ = self->priv->pause_action;
		_tmp3_ = games_pause_action_get_is_paused (_tmp2_);
		game_set_paused (_tmp1_, _tmp3_);
	}
	_tmp4_ = self->priv->pause;
	_tmp5_ = self->priv->pause_action;
	_tmp6_ = games_pause_action_get_is_paused (_tmp5_);
	_tmp7_ = _variant_new5 (_tmp6_);
	g_simple_action_set_state (_tmp4_, _tmp7_);
}


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


static gboolean quadrapassel_key_press_event_cb (Quadrapassel* self, GtkWidget* widget, GdkEventKey* event) {
	gboolean result = FALSE;
	GdkEventKey _tmp0_;
	guint _tmp1_;
	guint _tmp2_ = 0U;
	guint keyval;
	Game* _tmp3_;
	guint _tmp4_;
	GSettings* _tmp5_;
	gint _tmp6_ = 0;
	guint _tmp7_ = 0U;
	Game* _tmp11_;
	gboolean _tmp12_;
	gboolean _tmp13_;
	guint _tmp14_;
	GSettings* _tmp15_;
	gint _tmp16_ = 0;
	guint _tmp17_ = 0U;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (widget != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = *event;
	_tmp1_ = _tmp0_.keyval;
	_tmp2_ = quadrapassel_upper_key (self, _tmp1_);
	keyval = _tmp2_;
	_tmp3_ = self->priv->game;
	if (_tmp3_ == NULL) {
		result = FALSE;
		return result;
	}
	_tmp4_ = keyval;
	_tmp5_ = self->priv->settings;
	_tmp6_ = g_settings_get_int (_tmp5_, "key-pause");
	_tmp7_ = quadrapassel_upper_key (self, (guint) _tmp6_);
	if (_tmp4_ == _tmp7_) {
		GamesPauseAction* _tmp8_;
		GamesPauseAction* _tmp9_;
		gboolean _tmp10_ = FALSE;
		_tmp8_ = self->priv->pause_action;
		_tmp9_ = self->priv->pause_action;
		_tmp10_ = games_pause_action_get_is_paused (_tmp9_);
		games_pause_action_set_is_paused (_tmp8_, !_tmp10_);
		result = TRUE;
		return result;
	}
	_tmp11_ = self->priv->game;
	_tmp12_ = game_get_paused (_tmp11_);
	_tmp13_ = _tmp12_;
	if (_tmp13_) {
		result = FALSE;
		return result;
	}
	_tmp14_ = keyval;
	_tmp15_ = self->priv->settings;
	_tmp16_ = g_settings_get_int (_tmp15_, "key-left");
	_tmp17_ = quadrapassel_upper_key (self, (guint) _tmp16_);
	if (_tmp14_ == _tmp17_) {
		Game* _tmp18_;
		_tmp18_ = self->priv->game;
		game_move_left (_tmp18_);
		result = TRUE;
		return result;
	} else {
		guint _tmp19_;
		GSettings* _tmp20_;
		gint _tmp21_ = 0;
		guint _tmp22_ = 0U;
		_tmp19_ = keyval;
		_tmp20_ = self->priv->settings;
		_tmp21_ = g_settings_get_int (_tmp20_, "key-right");
		_tmp22_ = quadrapassel_upper_key (self, (guint) _tmp21_);
		if (_tmp19_ == _tmp22_) {
			Game* _tmp23_;
			_tmp23_ = self->priv->game;
			game_move_right (_tmp23_);
			result = TRUE;
			return result;
		} else {
			guint _tmp24_;
			GSettings* _tmp25_;
			gint _tmp26_ = 0;
			guint _tmp27_ = 0U;
			_tmp24_ = keyval;
			_tmp25_ = self->priv->settings;
			_tmp26_ = g_settings_get_int (_tmp25_, "key-rotate");
			_tmp27_ = quadrapassel_upper_key (self, (guint) _tmp26_);
			if (_tmp24_ == _tmp27_) {
				GSettings* _tmp28_;
				gboolean _tmp29_ = FALSE;
				_tmp28_ = self->priv->settings;
				_tmp29_ = g_settings_get_boolean (_tmp28_, "rotate-counter-clock-wise");
				if (_tmp29_) {
					Game* _tmp30_;
					_tmp30_ = self->priv->game;
					game_rotate_left (_tmp30_);
				} else {
					Game* _tmp31_;
					_tmp31_ = self->priv->game;
					game_rotate_right (_tmp31_);
				}
				result = TRUE;
				return result;
			} else {
				guint _tmp32_;
				GSettings* _tmp33_;
				gint _tmp34_ = 0;
				guint _tmp35_ = 0U;
				_tmp32_ = keyval;
				_tmp33_ = self->priv->settings;
				_tmp34_ = g_settings_get_int (_tmp33_, "key-down");
				_tmp35_ = quadrapassel_upper_key (self, (guint) _tmp34_);
				if (_tmp32_ == _tmp35_) {
					Game* _tmp36_;
					_tmp36_ = self->priv->game;
					game_set_fast_forward (_tmp36_, TRUE);
					result = TRUE;
					return result;
				} else {
					guint _tmp37_;
					GSettings* _tmp38_;
					gint _tmp39_ = 0;
					guint _tmp40_ = 0U;
					_tmp37_ = keyval;
					_tmp38_ = self->priv->settings;
					_tmp39_ = g_settings_get_int (_tmp38_, "key-drop");
					_tmp40_ = quadrapassel_upper_key (self, (guint) _tmp39_);
					if (_tmp37_ == _tmp40_) {
						Game* _tmp41_;
						_tmp41_ = self->priv->game;
						game_drop (_tmp41_);
						result = TRUE;
						return result;
					}
				}
			}
		}
	}
	result = FALSE;
	return result;
}


static gboolean quadrapassel_key_release_event_cb (Quadrapassel* self, GtkWidget* widget, GdkEventKey* event) {
	gboolean result = FALSE;
	GdkEventKey _tmp0_;
	guint _tmp1_;
	guint _tmp2_ = 0U;
	guint keyval;
	Game* _tmp3_;
	guint _tmp4_;
	GSettings* _tmp5_;
	gint _tmp6_ = 0;
	guint _tmp7_ = 0U;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (widget != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = *event;
	_tmp1_ = _tmp0_.keyval;
	_tmp2_ = quadrapassel_upper_key (self, _tmp1_);
	keyval = _tmp2_;
	_tmp3_ = self->priv->game;
	if (_tmp3_ == NULL) {
		result = FALSE;
		return result;
	}
	_tmp4_ = keyval;
	_tmp5_ = self->priv->settings;
	_tmp6_ = g_settings_get_int (_tmp5_, "key-down");
	_tmp7_ = quadrapassel_upper_key (self, (guint) _tmp6_);
	if (_tmp4_ == _tmp7_) {
		Game* _tmp8_;
		_tmp8_ = self->priv->game;
		game_set_fast_forward (_tmp8_, FALSE);
		result = TRUE;
		return result;
	}
	result = FALSE;
	return result;
}


static guint quadrapassel_upper_key (Quadrapassel* self, guint keyval) {
	guint result = 0U;
	guint _tmp0_;
	guint _tmp2_;
	gchar _tmp3_ = '\0';
	g_return_val_if_fail (self != NULL, 0U);
	_tmp0_ = keyval;
	if (_tmp0_ > ((guint) 255)) {
		guint _tmp1_;
		_tmp1_ = keyval;
		result = _tmp1_;
		return result;
	}
	_tmp2_ = keyval;
	_tmp3_ = g_ascii_toupper ((gchar) _tmp2_);
	result = (guint) _tmp3_;
	return result;
}


static void quadrapassel_new_game_cb (Quadrapassel* self) {
	g_return_if_fail (self != NULL);
	quadrapassel_new_game (self);
}


static void _quadrapassel_shape_landed_cb_game_shape_landed (Game* _sender, gint* lines, int lines_length1, GList* line_blocks, gpointer self) {
	quadrapassel_shape_landed_cb (self, lines, lines_length1, line_blocks);
}


static void _quadrapassel_complete_cb_game_complete (Game* _sender, gpointer self) {
	quadrapassel_complete_cb (self);
}


static void quadrapassel_new_game (Quadrapassel* self) {
	Game* _tmp0_;
	GSettings* _tmp3_;
	gint _tmp4_ = 0;
	GSettings* _tmp5_;
	gint _tmp6_ = 0;
	GSettings* _tmp7_;
	gint _tmp8_ = 0;
	GSettings* _tmp9_;
	gboolean _tmp10_ = FALSE;
	Game* _tmp11_;
	Game* _tmp12_;
	Game* _tmp13_;
	Preview* _tmp14_;
	Game* _tmp15_;
	GameView* _tmp16_;
	Game* _tmp17_;
	Game* _tmp18_;
	GamesPauseAction* _tmp19_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->game;
	if (_tmp0_ != NULL) {
		Game* _tmp1_;
		Game* _tmp2_;
		_tmp1_ = self->priv->game;
		game_stop (_tmp1_);
		_tmp2_ = self->priv->game;
		g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_DATA, (guint) 0, (GQuark) 0, NULL, NULL, self);
	}
	_tmp3_ = self->priv->settings;
	_tmp4_ = g_settings_get_int (_tmp3_, "starting-level");
	_tmp5_ = self->priv->settings;
	_tmp6_ = g_settings_get_int (_tmp5_, "line-fill-height");
	_tmp7_ = self->priv->settings;
	_tmp8_ = g_settings_get_int (_tmp7_, "line-fill-probability");
	_tmp9_ = self->priv->settings;
	_tmp10_ = g_settings_get_boolean (_tmp9_, "pick-difficult-blocks");
	_tmp11_ = game_new (20, 14, _tmp4_, _tmp6_, _tmp8_, _tmp10_);
	_g_object_unref0 (self->priv->game);
	self->priv->game = _tmp11_;
	_tmp12_ = self->priv->game;
	g_signal_connect_object (_tmp12_, "shape-landed", (GCallback) _quadrapassel_shape_landed_cb_game_shape_landed, self, 0);
	_tmp13_ = self->priv->game;
	g_signal_connect_object (_tmp13_, "complete", (GCallback) _quadrapassel_complete_cb_game_complete, self, 0);
	_tmp14_ = self->priv->preview;
	_tmp15_ = self->priv->game;
	preview_set_game (_tmp14_, _tmp15_);
	_tmp16_ = self->priv->view;
	_tmp17_ = self->priv->game;
	game_view_set_game (_tmp16_, _tmp17_);
	_tmp18_ = self->priv->game;
	game_start (_tmp18_);
	quadrapassel_update_score (self);
	_tmp19_ = self->priv->pause_action;
	gtk_action_set_sensitive ((GtkAction*) _tmp19_, TRUE);
}


static void quadrapassel_shape_landed_cb (Quadrapassel* self, gint* lines, int lines_length1, GList* line_blocks) {
	g_return_if_fail (self != NULL);
	quadrapassel_update_score (self);
}


static void quadrapassel_complete_cb (Quadrapassel* self) {
	GamesPauseAction* _tmp0_;
	Game* _tmp1_;
	gint _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->pause_action;
	gtk_action_set_sensitive ((GtkAction*) _tmp0_, FALSE);
	_tmp1_ = self->priv->game;
	_tmp2_ = _tmp1_->score;
	if (_tmp2_ > 0) {
		GamesScores* _tmp3_;
		Game* _tmp4_;
		gint _tmp5_;
		gint _tmp6_ = 0;
		gint pos;
		GtkWindow* _tmp7_;
		GamesScores* _tmp8_;
		const gchar* _tmp9_ = NULL;
		GamesScoresDialog* _tmp10_;
		GamesScoresDialog* _tmp11_;
		GamesScoresDialog* dialog;
		const gchar* _tmp12_ = NULL;
		gchar* _tmp13_;
		gchar* title;
		const gchar* _tmp14_ = NULL;
		gchar* _tmp15_;
		gchar* message;
		gint _tmp16_;
		GamesScoresDialog* _tmp22_;
		const gchar* _tmp23_;
		const gchar* _tmp24_;
		gchar* _tmp25_ = NULL;
		gchar* _tmp26_;
		GamesScoresDialog* _tmp27_;
		gint _tmp28_;
		GamesScoresDialog* _tmp31_;
		gint _tmp32_ = 0;
		GamesScoresDialog* _tmp34_;
		_tmp3_ = self->priv->high_scores;
		_tmp4_ = self->priv->game;
		_tmp5_ = _tmp4_->score;
		_tmp6_ = games_scores_add_plain_score (_tmp3_, (guint32) _tmp5_);
		pos = _tmp6_;
		_tmp7_ = self->priv->main_window;
		_tmp8_ = self->priv->high_scores;
		_tmp9_ = _ ("Quadrapassel Scores");
		_tmp10_ = games_scores_dialog_new (_tmp7_, _tmp8_, _tmp9_);
		_tmp11_ = g_object_ref_sink (_tmp10_);
		dialog = _tmp11_;
		_tmp12_ = _ ("Puzzle solved!");
		_tmp13_ = g_strdup (_tmp12_);
		title = _tmp13_;
		_tmp14_ = _ ("You didn't make the top ten, better luck next time.");
		_tmp15_ = g_strdup (_tmp14_);
		message = _tmp15_;
		_tmp16_ = pos;
		if (_tmp16_ == 1) {
			const gchar* _tmp17_ = NULL;
			gchar* _tmp18_;
			_tmp17_ = _ ("Your score is the best!");
			_tmp18_ = g_strdup (_tmp17_);
			_g_free0 (message);
			message = _tmp18_;
		} else {
			gint _tmp19_;
			_tmp19_ = pos;
			if (_tmp19_ > 1) {
				const gchar* _tmp20_ = NULL;
				gchar* _tmp21_;
				_tmp20_ = _ ("Your score has made the top ten.");
				_tmp21_ = g_strdup (_tmp20_);
				_g_free0 (message);
				message = _tmp21_;
			}
		}
		_tmp22_ = dialog;
		_tmp23_ = title;
		_tmp24_ = message;
		_tmp25_ = g_strdup_printf ("<b>%s</b>\n\n%s", _tmp23_, _tmp24_);
		_tmp26_ = _tmp25_;
		games_scores_dialog_set_message (_tmp22_, _tmp26_);
		_g_free0 (_tmp26_);
		_tmp27_ = dialog;
		games_scores_dialog_set_buttons (_tmp27_, (guint) (GAMES_SCORES_QUIT_BUTTON | GAMES_SCORES_NEW_GAME_BUTTON));
		_tmp28_ = pos;
		if (_tmp28_ > 0) {
			GamesScoresDialog* _tmp29_;
			gint _tmp30_;
			_tmp29_ = dialog;
			_tmp30_ = pos;
			games_scores_dialog_set_hilight (_tmp29_, (guint) _tmp30_);
		}
		_tmp31_ = dialog;
		_tmp32_ = gtk_dialog_run ((GtkDialog*) _tmp31_);
		switch (_tmp32_) {
			case GTK_RESPONSE_REJECT:
			{
				GtkWindow* _tmp33_;
				_tmp33_ = self->priv->main_window;
				gtk_widget_destroy ((GtkWidget*) _tmp33_);
				break;
			}
			default:
			{
				quadrapassel_new_game (self);
				break;
			}
		}
		_tmp34_ = dialog;
		gtk_widget_destroy ((GtkWidget*) _tmp34_);
		_g_free0 (message);
		_g_free0 (title);
		_g_object_unref0 (dialog);
	}
}


static void quadrapassel_update_score (Quadrapassel* self) {
	gint score;
	gint level;
	gint n_lines_destroyed;
	Game* _tmp0_;
	GtkLabel* _tmp8_;
	gint _tmp9_;
	gchar* _tmp10_ = NULL;
	gchar* _tmp11_;
	GtkLabel* _tmp12_;
	gint _tmp13_;
	gchar* _tmp14_ = NULL;
	gchar* _tmp15_;
	GtkLabel* _tmp16_;
	gint _tmp17_;
	gchar* _tmp18_ = NULL;
	gchar* _tmp19_;
	g_return_if_fail (self != NULL);
	score = 0;
	level = 0;
	n_lines_destroyed = 0;
	_tmp0_ = self->priv->game;
	if (_tmp0_ != NULL) {
		Game* _tmp1_;
		gint _tmp2_;
		Game* _tmp3_;
		gint _tmp4_;
		gint _tmp5_;
		Game* _tmp6_;
		gint _tmp7_;
		_tmp1_ = self->priv->game;
		_tmp2_ = _tmp1_->score;
		score = _tmp2_;
		_tmp3_ = self->priv->game;
		_tmp4_ = game_get_level (_tmp3_);
		_tmp5_ = _tmp4_;
		level = _tmp5_;
		_tmp6_ = self->priv->game;
		_tmp7_ = _tmp6_->n_lines_destroyed;
		n_lines_destroyed = _tmp7_;
	}
	_tmp8_ = self->priv->score_label;
	_tmp9_ = score;
	_tmp10_ = g_strdup_printf ("%d", _tmp9_);
	_tmp11_ = _tmp10_;
	gtk_label_set_text (_tmp8_, _tmp11_);
	_g_free0 (_tmp11_);
	_tmp12_ = self->priv->level_label;
	_tmp13_ = level;
	_tmp14_ = g_strdup_printf ("%d", _tmp13_);
	_tmp15_ = _tmp14_;
	gtk_label_set_text (_tmp12_, _tmp15_);
	_g_free0 (_tmp15_);
	_tmp16_ = self->priv->n_destroyed_label;
	_tmp17_ = n_lines_destroyed;
	_tmp18_ = g_strdup_printf ("%d", _tmp17_);
	_tmp19_ = _tmp18_;
	gtk_label_set_text (_tmp16_, _tmp19_);
	_g_free0 (_tmp19_);
}


static void quadrapassel_help_cb (Quadrapassel* 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:quadrapassel", _tmp2_, &_inner_error_);
		if (_inner_error_ != NULL) {
			goto __catch1_g_error;
		}
	}
	goto __finally1;
	__catch1_g_error:
	{
		GError* e = NULL;
		GError* _tmp3_;
		const gchar* _tmp4_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp3_ = e;
		_tmp4_ = _tmp3_->message;
		g_warning ("quadrapassel.vala:666: Failed to show help: %s", _tmp4_);
		_g_error_free0 (e);
	}
	__finally1:
	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 quadrapassel_about_cb (Quadrapassel* self) {
	gchar* _tmp0_;
	gchar** _tmp1_ = NULL;
	gchar** authors;
	gint authors_length1;
	gint _authors_size_;
	gchar* _tmp2_;
	gchar** _tmp3_ = NULL;
	gchar** documenters;
	gint documenters_length1;
	gint _documenters_size_;
	GtkWindow* _tmp4_;
	const gchar* _tmp5_ = NULL;
	const gchar* _tmp6_ = NULL;
	const gchar* _tmp7_ = NULL;
	gchar* _tmp8_ = NULL;
	gchar* _tmp9_;
	const gchar* _tmp10_ = NULL;
	const gchar* _tmp11_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup ("Gnome Games Team");
	_tmp1_ = g_new0 (gchar*, 2 + 1);
	_tmp1_[0] = _tmp0_;
	_tmp1_[1] = NULL;
	authors = _tmp1_;
	authors_length1 = 2;
	_authors_size_ = authors_length1;
	_tmp2_ = g_strdup ("Angela Boyle");
	_tmp3_ = g_new0 (gchar*, 2 + 1);
	_tmp3_[0] = _tmp2_;
	_tmp3_[1] = NULL;
	documenters = _tmp3_;
	documenters_length1 = 2;
	_documenters_size_ = documenters_length1;
	_tmp4_ = self->priv->main_window;
	_tmp5_ = _ ("Quadrapassel");
	_tmp6_ = _ ("A classic game of fitting falling blocks together.\n" \
"\n" \
"Quadrapassel is a part of GNOME Games.");
	_tmp7_ = _ ("Quadrapassel");
	_tmp8_ = games_get_license (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = _ ("GNOME Games web site");
	_tmp11_ = _ ("translator-credits");
	gtk_show_about_dialog (_tmp4_, "program-name", _tmp5_, "version", VERSION, "comments", _tmp6_, "copyright", "Copyright \xc2\xa9 1999 J. Marcin Gorycki, 2000-2009 Others", "license", _tmp9_, "website-label", _tmp10_, "authors", authors, "documenters", documenters, "translator-credits", _tmp11_, "logo-icon-name", "quadrapassel", "website", "http://wwmain_window.gnome.org/projects/gnome-games/", "wrap-license", TRUE, NULL, NULL);
	_g_free0 (_tmp9_);
	documenters = (_vala_array_free (documenters, documenters_length1, (GDestroyNotify) g_free), NULL);
	authors = (_vala_array_free (authors, authors_length1, (GDestroyNotify) g_free), NULL);
}


static void quadrapassel_scores_cb (Quadrapassel* self) {
	GtkWindow* _tmp0_;
	GamesScores* _tmp1_;
	const gchar* _tmp2_ = NULL;
	GamesScoresDialog* _tmp3_;
	GamesScoresDialog* _tmp4_;
	GamesScoresDialog* dialog;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->main_window;
	_tmp1_ = self->priv->high_scores;
	_tmp2_ = _ ("Quadrapassel Scores");
	_tmp3_ = games_scores_dialog_new (_tmp0_, _tmp1_, _tmp2_);
	_tmp4_ = g_object_ref_sink (_tmp3_);
	dialog = _tmp4_;
	gtk_dialog_run ((GtkDialog*) dialog);
	gtk_widget_destroy ((GtkWidget*) dialog);
	_g_object_unref0 (dialog);
}


gint quadrapassel_main (gchar** args, int args_length1) {
	gint result = 0;
	GOptionContext* _tmp0_;
	GOptionContext* context;
	GOptionContext* _tmp1_;
	GOptionGroup* _tmp2_ = NULL;
	GOptionContext* _tmp3_;
	GOptionGroup* _tmp4_ = NULL;
	const gchar* _tmp9_ = NULL;
	Quadrapassel* _tmp20_;
	Quadrapassel* app;
	Quadrapassel* _tmp21_;
	gchar** _tmp22_;
	gint _tmp22__length1;
	gint _tmp23_ = 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_ = g_option_context_new ("");
	context = _tmp0_;
	_tmp1_ = context;
	_tmp2_ = gtk_get_option_group (TRUE);
	g_option_context_add_group (_tmp1_, _tmp2_);
	_tmp3_ = context;
	_tmp4_ = clutter_get_option_group_without_init ();
	g_option_context_add_group (_tmp3_, _tmp4_);
	{
		GOptionContext* _tmp5_;
		_tmp5_ = context;
		g_option_context_parse (_tmp5_, &args_length1, &args, &_inner_error_);
		if (_inner_error_ != NULL) {
			goto __catch2_g_error;
		}
	}
	goto __finally2;
	__catch2_g_error:
	{
		GError* e = NULL;
		FILE* _tmp6_;
		GError* _tmp7_;
		const gchar* _tmp8_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp6_ = stderr;
		_tmp7_ = e;
		_tmp8_ = _tmp7_->message;
		fprintf (_tmp6_, "%s\n", _tmp8_);
		result = EXIT_FAILURE;
		_g_error_free0 (e);
		_g_option_context_free0 (context);
		return result;
	}
	__finally2:
	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;
	}
	_tmp9_ = _ ("Quadrapassel");
	g_set_application_name (_tmp9_);
	gtk_window_set_default_icon_name ("quadrapassel");
	{
		GOptionEntry* _tmp10_ = NULL;
		GOptionEntry* _tmp11_;
		gint _tmp11__length1;
		_tmp10_ = g_new0 (GOptionEntry, 0);
		_tmp11_ = _tmp10_;
		_tmp11__length1 = 0;
		gtk_clutter_init_with_args (&args_length1, &args, "", _tmp11_, NULL, &_inner_error_);
		_tmp11_ = (g_free (_tmp11_), NULL);
		if (_inner_error_ != NULL) {
			goto __catch3_g_error;
		}
	}
	goto __finally3;
	__catch3_g_error:
	{
		GError* e = NULL;
		GError* _tmp12_;
		const gchar* _tmp13_;
		GtkMessageDialog* _tmp14_;
		GtkMessageDialog* _tmp15_;
		GtkMessageDialog* dialog;
		GtkMessageDialog* _tmp16_;
		const gchar* _tmp17_ = NULL;
		GtkMessageDialog* _tmp18_;
		GtkMessageDialog* _tmp19_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp12_ = e;
		_tmp13_ = _tmp12_->message;
		_tmp14_ = (GtkMessageDialog*) gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_NONE, "Unable to initialize Clutter:\n%s", _tmp13_);
		_tmp15_ = g_object_ref_sink (_tmp14_);
		dialog = _tmp15_;
		_tmp16_ = dialog;
		_tmp17_ = g_get_application_name ();
		gtk_window_set_title ((GtkWindow*) _tmp16_, _tmp17_);
		_tmp18_ = dialog;
		gtk_dialog_run ((GtkDialog*) _tmp18_);
		_tmp19_ = dialog;
		gtk_widget_destroy ((GtkWidget*) _tmp19_);
		result = EXIT_FAILURE;
		_g_object_unref0 (dialog);
		_g_error_free0 (e);
		_g_option_context_free0 (context);
		return result;
	}
	__finally3:
	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;
	}
	_tmp20_ = quadrapassel_new ();
	app = _tmp20_;
	_tmp21_ = app;
	_tmp22_ = args;
	_tmp22__length1 = args_length1;
	_tmp23_ = g_application_run ((GApplication*) _tmp21_, _tmp22__length1, _tmp22_);
	result = _tmp23_;
	_g_object_unref0 (app);
	_g_option_context_free0 (context);
	return result;
}


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


static void quadrapassel_class_init (QuadrapasselClass * klass) {
	quadrapassel_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (QuadrapasselPrivate));
	G_APPLICATION_CLASS (klass)->startup = quadrapassel_real_startup;
	G_APPLICATION_CLASS (klass)->shutdown = quadrapassel_real_shutdown;
	G_APPLICATION_CLASS (klass)->activate = quadrapassel_real_activate;
	G_OBJECT_CLASS (klass)->finalize = quadrapassel_finalize;
}


static void quadrapassel_instance_init (Quadrapassel * self) {
	self->priv = QUADRAPASSEL_GET_PRIVATE (self);
	self->priv->game = NULL;
}


static void quadrapassel_finalize (GObject* obj) {
	Quadrapassel * self;
	self = QUADRAPASSEL (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->preview);
	_g_object_unref0 (self->priv->score_label);
	_g_object_unref0 (self->priv->n_destroyed_label);
	_g_object_unref0 (self->priv->level_label);
	_g_object_unref0 (self->priv->high_scores);
	_g_object_unref0 (self->priv->pause);
	_g_object_unref0 (self->priv->pause_action);
	_g_object_unref0 (self->priv->fullscreen_action);
	_g_object_unref0 (self->priv->preferences_dialog);
	_g_object_unref0 (self->priv->starting_level_spin);
	_g_object_unref0 (self->priv->theme_preview);
	_g_object_unref0 (self->priv->fill_height_spinner);
	_g_object_unref0 (self->priv->fill_prob_spinner);
	_g_object_unref0 (self->priv->do_preview_toggle);
	_g_object_unref0 (self->priv->difficult_blocks_toggle);
	_g_object_unref0 (self->priv->rotate_counter_clock_wise_toggle);
	_g_object_unref0 (self->priv->show_shadow_toggle);
	_g_object_unref0 (self->priv->sound_toggle);
	G_OBJECT_CLASS (quadrapassel_parent_class)->finalize (obj);
}


GType quadrapassel_get_type (void) {
	static volatile gsize quadrapassel_type_id__volatile = 0;
	if (g_once_init_enter (&quadrapassel_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (QuadrapasselClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) quadrapassel_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Quadrapassel), 0, (GInstanceInitFunc) quadrapassel_instance_init, NULL };
		GType quadrapassel_type_id;
		quadrapassel_type_id = g_type_register_static (GTK_TYPE_APPLICATION, "Quadrapassel", &g_define_type_info, 0);
		g_once_init_leave (&quadrapassel_type_id__volatile, quadrapassel_type_id);
	}
	return quadrapassel_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);
}



