/* quadrapassel.c generated by valac 0.17.7.1-fedb1, 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 <glib/gi18n-lib.h>
#include <gdk/gdk.h>
#include <stdlib.h>
#include <string.h>
#include <games-score.h>
#include <float.h>
#include <math.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;
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 _gtk_tree_path_free0(var) ((var == NULL) ? NULL : (var = (gtk_tree_path_free (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (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* window;
	gint window_width;
	gint window_height;
	gboolean is_fullscreen;
	gboolean is_maximized;
	Game* game;
	GameView* view;
	Preview* preview;
	GtkLabel* score_label;
	GtkLabel* n_destroyed_label;
	GtkLabel* level_label;
	GamesScores* high_scores;
	GSimpleAction* pause_action;
	GtkToolButton* pause_button;
	GtkToolButton* fullscreen_button;
	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;
	GtkListStore* controls_model;
};

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_pause_cb (Quadrapassel* self);
static void _quadrapassel_pause_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, 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_fullscreen_cb (Quadrapassel* self);
static void _quadrapassel_fullscreen_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);
Quadrapassel* quadrapassel_new (void);
Quadrapassel* quadrapassel_construct (GType object_type);
static void quadrapassel_real_startup (GApplication* base);
static gboolean quadrapassel_window_configure_event_cb (Quadrapassel* self, GdkEventConfigure* event);
static gboolean _quadrapassel_window_configure_event_cb_gtk_widget_configure_event (GtkWidget* _sender, GdkEventConfigure* event, gpointer self);
static gboolean quadrapassel_window_state_event_cb (Quadrapassel* self, GdkEventWindowState* event);
static gboolean _quadrapassel_window_state_event_cb_gtk_widget_window_state_event (GtkWidget* _sender, GdkEventWindowState* event, gpointer self);
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);
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 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_accel_edited_cb (Quadrapassel* self, GtkCellRendererAccel* cell, const gchar* path_string, guint keyval, GdkModifierType mask, guint hardware_keycode);
static void _quadrapassel_accel_edited_cb_gtk_cell_renderer_accel_accel_edited (GtkCellRendererAccel* _sender, const gchar* path_string, guint accel_key, GdkModifierType accel_mods, guint hardware_keycode, gpointer self);
static void quadrapassel_accel_cleared_cb (Quadrapassel* self, GtkCellRendererAccel* cell, const gchar* path_string);
static void _quadrapassel_accel_cleared_cb_gtk_cell_renderer_accel_accel_cleared (GtkCellRendererAccel* _sender, const gchar* path_string, 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);
gboolean game_get_paused (Game* self);
void game_set_paused (Game* self, gboolean value);
static guint quadrapassel_upper_key (Quadrapassel* self, guint keyval);
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_pause_changed_cb (Quadrapassel* self);
static void _quadrapassel_pause_changed_cb_game_pause_changed (Game* _sender, gpointer 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[8] = {{"new-game", _quadrapassel_new_game_cb_gsimple_action_activate_callback}, {"pause", _quadrapassel_pause_cb_gsimple_action_activate_callback}, {"scores", _quadrapassel_scores_cb_gsimple_action_activate_callback}, {"preferences", _quadrapassel_preferences_cb_gsimple_action_activate_callback}, {"fullscreen", _quadrapassel_fullscreen_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 void _quadrapassel_new_game_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	quadrapassel_new_game_cb (self);
}


static void _quadrapassel_pause_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	quadrapassel_pause_cb (self);
}


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_fullscreen_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	quadrapassel_fullscreen_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);
}


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_window_configure_event_cb_gtk_widget_configure_event (GtkWidget* _sender, GdkEventConfigure* event, gpointer self) {
	gboolean result;
	result = quadrapassel_window_configure_event_cb (self, event);
	return result;
}


static gboolean _quadrapassel_window_state_event_cb_gtk_widget_window_state_event (GtkWidget* _sender, GdkEventWindowState* event, gpointer self) {
	gboolean result;
	result = quadrapassel_window_state_event_cb (self, event);
	return result;
}


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 _vala_GamesScoresCategory_array_free (GamesScoresCategory* array, gint array_length) {
	if (array != NULL) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			 (&array[i]);
		}
	}
	g_free (array);
}


static void quadrapassel_real_startup (GApplication* base) {
	Quadrapassel * self;
	GAction* _tmp0_ = NULL;
	GSimpleAction* _tmp1_;
	GMenu* _tmp2_;
	GMenu* menu;
	GMenu* _tmp3_;
	GMenu* section;
	GMenu* _tmp4_;
	GMenu* _tmp5_;
	GMenu* _tmp6_;
	const gchar* _tmp7_ = NULL;
	GMenu* _tmp8_;
	const gchar* _tmp9_ = NULL;
	GMenu* _tmp10_;
	const gchar* _tmp11_ = NULL;
	GMenu* _tmp12_;
	const gchar* _tmp13_ = NULL;
	GMenu* _tmp14_;
	GMenu* _tmp15_;
	GMenu* _tmp16_;
	GMenu* _tmp17_;
	const gchar* _tmp18_ = NULL;
	GMenu* _tmp19_;
	const gchar* _tmp20_ = NULL;
	GMenu* _tmp21_;
	GMenu* _tmp22_;
	GMenu* _tmp23_;
	GMenu* _tmp24_;
	const gchar* _tmp25_ = NULL;
	GMenu* _tmp26_;
	GSettings* _tmp27_;
	GtkApplicationWindow* _tmp28_;
	GtkWindow* _tmp29_;
	GtkWindow* _tmp30_;
	gint _tmp31_ = 0;
	GtkWindow* _tmp32_;
	const gchar* _tmp33_ = NULL;
	GtkWindow* _tmp34_;
	GtkWindow* _tmp35_;
	GtkWindow* _tmp36_;
	GtkWindow* _tmp37_;
	GtkWindow* _tmp38_;
	GSettings* _tmp39_;
	gint _tmp40_ = 0;
	GSettings* _tmp41_;
	gint _tmp42_ = 0;
	GSettings* _tmp43_;
	gboolean _tmp44_ = FALSE;
	GtkBox* _tmp49_;
	GtkBox* vbox;
	GtkWindow* _tmp50_;
	GameView* _tmp51_;
	GameView* _tmp52_;
	GSettings* _tmp53_;
	gchar* _tmp54_ = NULL;
	gchar* _tmp55_;
	GameView* _tmp56_;
	GSettings* _tmp57_;
	gboolean _tmp58_ = FALSE;
	GameView* _tmp59_;
	GSettings* _tmp60_;
	gboolean _tmp61_ = FALSE;
	GameView* _tmp62_;
	Game* _tmp63_;
	Game* _tmp64_;
	GameView* _tmp65_;
	GtkToolbar* _tmp66_;
	GtkToolbar* toolbar;
	GtkStyleContext* _tmp67_ = NULL;
	const gchar* _tmp68_ = NULL;
	GtkToolButton* _tmp69_;
	GtkToolButton* new_game_button;
	const gchar* _tmp70_ = NULL;
	GtkToolButton* _tmp71_;
	GtkToolButton* _tmp72_;
	GtkToolButton* _tmp73_;
	GtkToolButton* _tmp74_;
	GtkToolButton* _tmp75_;
	GtkToolButton* _tmp76_;
	const gchar* _tmp77_ = NULL;
	GtkToolButton* _tmp78_;
	GtkToolButton* _tmp79_;
	GtkToolButton* _tmp80_;
	GtkToolButton* _tmp81_;
	GtkToolButton* _tmp82_;
	GtkToolButton* _tmp83_;
	GtkBox* _tmp84_;
	GtkBox* hb;
	GtkBox* _tmp85_;
	GtkBox* vb1;
	GameView* _tmp86_;
	GtkBox* _tmp87_;
	GtkBox* vb2;
	Preview* _tmp88_;
	Preview* _tmp89_;
	GSettings* _tmp90_;
	gchar* _tmp91_ = NULL;
	gchar* _tmp92_;
	Preview* _tmp93_;
	GSettings* _tmp94_;
	gboolean _tmp95_ = FALSE;
	Preview* _tmp96_;
	Preview* _tmp97_;
	GtkGrid* _tmp98_;
	GtkGrid* score_grid;
	const gchar* _tmp99_ = NULL;
	GtkLabel* _tmp100_;
	GtkLabel* label;
	GtkLabel* _tmp101_;
	GtkLabel* _tmp102_;
	GtkLabel* _tmp103_;
	GtkLabel* _tmp104_;
	GtkLabel* _tmp105_;
	GtkLabel* _tmp106_;
	GtkLabel* _tmp107_;
	const gchar* _tmp108_ = NULL;
	GtkLabel* _tmp109_;
	GtkLabel* _tmp110_;
	GtkLabel* _tmp111_;
	GtkLabel* _tmp112_;
	GtkLabel* _tmp113_;
	GtkLabel* _tmp114_;
	GtkLabel* _tmp115_;
	GtkLabel* _tmp116_;
	const gchar* _tmp117_ = NULL;
	GtkLabel* _tmp118_;
	GtkLabel* _tmp119_;
	GtkLabel* _tmp120_;
	GtkLabel* _tmp121_;
	GtkLabel* _tmp122_;
	GtkLabel* _tmp123_;
	GtkLabel* _tmp124_;
	GtkLabel* _tmp125_;
	GamesScoresCategory* _tmp126_ = NULL;
	GamesScoresCategory* _tmp127_;
	gint _tmp127__length1;
	GamesScores* _tmp128_;
	GSimpleAction* _tmp129_;
	self = (Quadrapassel*) base;
	G_APPLICATION_CLASS (quadrapassel_parent_class)->startup ((GApplication*) G_TYPE_CHECK_INSTANCE_CAST (self, GTK_TYPE_APPLICATION, GtkApplication));
	g_action_map_add_action_entries ((GActionMap*) self, (const GActionEntry*) QUADRAPASSEL_action_entries, G_N_ELEMENTS (QUADRAPASSEL_action_entries), self);
	gtk_application_add_accelerator ((GtkApplication*) self, "<Primary>n", "app.new-game", NULL);
	gtk_application_add_accelerator ((GtkApplication*) self, "Pause", "app.pause", NULL);
	gtk_application_add_accelerator ((GtkApplication*) self, "F11", "app.fullscreen", NULL);
	gtk_application_add_accelerator ((GtkApplication*) self, "F1", "app.help", NULL);
	gtk_application_add_accelerator ((GtkApplication*) self, "<Primary>q", "app.quit", NULL);
	_tmp0_ = g_action_map_lookup_action ((GActionMap*) self, "pause");
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp0_) : NULL);
	_g_object_unref0 (self->priv->pause_action);
	self->priv->pause_action = _tmp1_;
	_tmp2_ = g_menu_new ();
	menu = _tmp2_;
	_tmp3_ = g_menu_new ();
	section = _tmp3_;
	_tmp4_ = menu;
	_tmp5_ = section;
	g_menu_append_section (_tmp4_, NULL, (GMenuModel*) _tmp5_);
	_tmp6_ = section;
	_tmp7_ = _ ("_New Game");
	g_menu_append (_tmp6_, _tmp7_, "app.new-game");
	_tmp8_ = section;
	_tmp9_ = _ ("_Pause");
	g_menu_append (_tmp8_, _tmp9_, "app.pause");
	_tmp10_ = section;
	_tmp11_ = _ ("_Scores");
	g_menu_append (_tmp10_, _tmp11_, "app.scores");
	_tmp12_ = section;
	_tmp13_ = _ ("_Preferences");
	g_menu_append (_tmp12_, _tmp13_, "app.preferences");
	_tmp14_ = g_menu_new ();
	_g_object_unref0 (section);
	section = _tmp14_;
	_tmp15_ = menu;
	_tmp16_ = section;
	g_menu_append_section (_tmp15_, NULL, (GMenuModel*) _tmp16_);
	_tmp17_ = section;
	_tmp18_ = _ ("_Help");
	g_menu_append (_tmp17_, _tmp18_, "app.help");
	_tmp19_ = section;
	_tmp20_ = _ ("_About");
	g_menu_append (_tmp19_, _tmp20_, "app.about");
	_tmp21_ = g_menu_new ();
	_g_object_unref0 (section);
	section = _tmp21_;
	_tmp22_ = menu;
	_tmp23_ = section;
	g_menu_append_section (_tmp22_, NULL, (GMenuModel*) _tmp23_);
	_tmp24_ = section;
	_tmp25_ = _ ("_Quit");
	g_menu_append (_tmp24_, _tmp25_, "app.quit");
	_tmp26_ = menu;
	gtk_application_set_app_menu ((GtkApplication*) self, (GMenuModel*) _tmp26_);
	_tmp27_ = g_settings_new ("org.gnome.quadrapassel");
	_g_object_unref0 (self->priv->settings);
	self->priv->settings = _tmp27_;
	_tmp28_ = (GtkApplicationWindow*) gtk_application_window_new ((GtkApplication*) self);
	g_object_ref_sink (_tmp28_);
	_g_object_unref0 (self->priv->window);
	self->priv->window = (GtkWindow*) _tmp28_;
	_tmp29_ = self->priv->window;
	_tmp30_ = self->priv->window;
	_tmp31_ = gtk_widget_get_events ((GtkWidget*) _tmp30_);
	gtk_widget_set_events ((GtkWidget*) _tmp29_, (_tmp31_ | GDK_KEY_PRESS_MASK) | GDK_KEY_RELEASE_MASK);
	_tmp32_ = self->priv->window;
	_tmp33_ = _ ("Quadrapassel");
	gtk_window_set_title (_tmp32_, _tmp33_);
	_tmp34_ = self->priv->window;
	g_signal_connect_object ((GtkWidget*) _tmp34_, "configure-event", (GCallback) _quadrapassel_window_configure_event_cb_gtk_widget_configure_event, self, 0);
	_tmp35_ = self->priv->window;
	g_signal_connect_object ((GtkWidget*) _tmp35_, "window-state-event", (GCallback) _quadrapassel_window_state_event_cb_gtk_widget_window_state_event, self, 0);
	_tmp36_ = self->priv->window;
	g_signal_connect_object ((GtkWidget*) _tmp36_, "key-press-event", (GCallback) _quadrapassel_key_press_event_cb_gtk_widget_key_press_event, self, 0);
	_tmp37_ = self->priv->window;
	g_signal_connect_object ((GtkWidget*) _tmp37_, "key-release-event", (GCallback) _quadrapassel_key_release_event_cb_gtk_widget_key_release_event, self, 0);
	_tmp38_ = self->priv->window;
	_tmp39_ = self->priv->settings;
	_tmp40_ = g_settings_get_int (_tmp39_, "window-width");
	_tmp41_ = self->priv->settings;
	_tmp42_ = g_settings_get_int (_tmp41_, "window-height");
	gtk_window_set_default_size (_tmp38_, _tmp40_, _tmp42_);
	_tmp43_ = self->priv->settings;
	_tmp44_ = g_settings_get_boolean (_tmp43_, "window-is-fullscreen");
	if (_tmp44_) {
		GtkWindow* _tmp45_;
		_tmp45_ = self->priv->window;
		gtk_window_fullscreen (_tmp45_);
	} else {
		GSettings* _tmp46_;
		gboolean _tmp47_ = FALSE;
		_tmp46_ = self->priv->settings;
		_tmp47_ = g_settings_get_boolean (_tmp46_, "window-is-maximized");
		if (_tmp47_) {
			GtkWindow* _tmp48_;
			_tmp48_ = self->priv->window;
			gtk_window_maximize (_tmp48_);
		}
	}
	_tmp49_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	g_object_ref_sink (_tmp49_);
	vbox = _tmp49_;
	gtk_widget_show ((GtkWidget*) vbox);
	_tmp50_ = self->priv->window;
	gtk_container_add ((GtkContainer*) _tmp50_, (GtkWidget*) vbox);
	_tmp51_ = game_view_new ();
	g_object_ref_sink (_tmp51_);
	_g_object_unref0 (self->priv->view);
	self->priv->view = _tmp51_;
	_tmp52_ = self->priv->view;
	_tmp53_ = self->priv->settings;
	_tmp54_ = g_settings_get_string (_tmp53_, "theme");
	_tmp55_ = _tmp54_;
	game_view_set_theme (_tmp52_, _tmp55_);
	_g_free0 (_tmp55_);
	_tmp56_ = self->priv->view;
	_tmp57_ = self->priv->settings;
	_tmp58_ = g_settings_get_boolean (_tmp57_, "sound");
	_tmp56_->mute = !_tmp58_;
	_tmp59_ = self->priv->view;
	_tmp60_ = self->priv->settings;
	_tmp61_ = g_settings_get_boolean (_tmp60_, "show-shadow");
	game_view_set_show_shadow (_tmp59_, _tmp61_);
	_tmp62_ = self->priv->view;
	_tmp63_ = game_new (20, 14, 1, 20, 10, FALSE);
	_tmp64_ = _tmp63_;
	game_view_set_game (_tmp62_, _tmp64_);
	_g_object_unref0 (_tmp64_);
	_tmp65_ = self->priv->view;
	gtk_widget_show ((GtkWidget*) _tmp65_);
	_tmp66_ = (GtkToolbar*) gtk_toolbar_new ();
	g_object_ref_sink (_tmp66_);
	toolbar = _tmp66_;
	gtk_widget_show ((GtkWidget*) toolbar);
	gtk_toolbar_set_show_arrow (toolbar, FALSE);
	_tmp67_ = gtk_widget_get_style_context ((GtkWidget*) toolbar);
	gtk_style_context_add_class (_tmp67_, GTK_STYLE_CLASS_PRIMARY_TOOLBAR);
	gtk_box_pack_start (vbox, (GtkWidget*) toolbar, FALSE, TRUE, (guint) 0);
	_tmp68_ = _ ("_New");
	_tmp69_ = (GtkToolButton*) gtk_tool_button_new (NULL, _tmp68_);
	g_object_ref_sink (_tmp69_);
	new_game_button = _tmp69_;
	gtk_tool_button_set_use_underline (new_game_button, TRUE);
	gtk_tool_button_set_icon_name (new_game_button, "document-new");
	gtk_actionable_set_action_name ((GtkActionable*) new_game_button, "app.new-game");
	gtk_tool_item_set_is_important ((GtkToolItem*) new_game_button, TRUE);
	gtk_widget_show ((GtkWidget*) new_game_button);
	gtk_toolbar_insert (toolbar, (GtkToolItem*) new_game_button, -1);
	_tmp70_ = _ ("_Pause");
	_tmp71_ = (GtkToolButton*) gtk_tool_button_new (NULL, _tmp70_);
	g_object_ref_sink (_tmp71_);
	_g_object_unref0 (self->priv->pause_button);
	self->priv->pause_button = _tmp71_;
	_tmp72_ = self->priv->pause_button;
	gtk_tool_button_set_icon_name (_tmp72_, "media-playback-pause");
	_tmp73_ = self->priv->pause_button;
	gtk_tool_button_set_use_underline (_tmp73_, TRUE);
	_tmp74_ = self->priv->pause_button;
	gtk_actionable_set_action_name ((GtkActionable*) _tmp74_, "app.pause");
	_tmp75_ = self->priv->pause_button;
	gtk_widget_show ((GtkWidget*) _tmp75_);
	_tmp76_ = self->priv->pause_button;
	gtk_toolbar_insert (toolbar, (GtkToolItem*) _tmp76_, -1);
	_tmp77_ = _ ("_Fullscreen");
	_tmp78_ = (GtkToolButton*) gtk_tool_button_new (NULL, _tmp77_);
	g_object_ref_sink (_tmp78_);
	_g_object_unref0 (self->priv->fullscreen_button);
	self->priv->fullscreen_button = _tmp78_;
	_tmp79_ = self->priv->fullscreen_button;
	gtk_tool_button_set_icon_name (_tmp79_, "view-fullscreen");
	_tmp80_ = self->priv->fullscreen_button;
	gtk_tool_button_set_use_underline (_tmp80_, TRUE);
	_tmp81_ = self->priv->fullscreen_button;
	gtk_actionable_set_action_name ((GtkActionable*) _tmp81_, "app.fullscreen");
	_tmp82_ = self->priv->fullscreen_button;
	gtk_widget_show ((GtkWidget*) _tmp82_);
	_tmp83_ = self->priv->fullscreen_button;
	gtk_toolbar_insert (toolbar, (GtkToolItem*) _tmp83_, -1);
	_tmp84_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	g_object_ref_sink (_tmp84_);
	hb = _tmp84_;
	gtk_widget_show ((GtkWidget*) hb);
	gtk_box_pack_start (vbox, (GtkWidget*) hb, TRUE, TRUE, (guint) 0);
	_tmp85_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	g_object_ref_sink (_tmp85_);
	vb1 = _tmp85_;
	gtk_container_set_border_width ((GtkContainer*) vb1, (guint) 10);
	_tmp86_ = self->priv->view;
	gtk_box_pack_start (vb1, (GtkWidget*) _tmp86_, TRUE, TRUE, (guint) 0);
	gtk_widget_show ((GtkWidget*) vb1);
	gtk_box_pack_start (hb, (GtkWidget*) vb1, TRUE, TRUE, (guint) 0);
	_tmp87_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	g_object_ref_sink (_tmp87_);
	vb2 = _tmp87_;
	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);
	_tmp88_ = preview_new ();
	g_object_ref_sink (_tmp88_);
	_g_object_unref0 (self->priv->preview);
	self->priv->preview = _tmp88_;
	_tmp89_ = self->priv->preview;
	_tmp90_ = self->priv->settings;
	_tmp91_ = g_settings_get_string (_tmp90_, "theme");
	_tmp92_ = _tmp91_;
	preview_set_theme (_tmp89_, _tmp92_);
	_g_free0 (_tmp92_);
	_tmp93_ = self->priv->preview;
	_tmp94_ = self->priv->settings;
	_tmp95_ = g_settings_get_boolean (_tmp94_, "do-preview");
	preview_set_enabled (_tmp93_, _tmp95_);
	_tmp96_ = self->priv->preview;
	gtk_widget_show ((GtkWidget*) _tmp96_);
	_tmp97_ = self->priv->preview;
	gtk_box_pack_start (vb2, (GtkWidget*) _tmp97_, FALSE, FALSE, (guint) 0);
	_tmp98_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp98_);
	score_grid = _tmp98_;
	gtk_widget_show ((GtkWidget*) score_grid);
	gtk_box_pack_end (vb2, (GtkWidget*) score_grid, TRUE, FALSE, (guint) 0);
	_tmp99_ = _ ("Score:");
	_tmp100_ = (GtkLabel*) gtk_label_new (_tmp99_);
	g_object_ref_sink (_tmp100_);
	label = _tmp100_;
	_tmp101_ = label;
	gtk_misc_set_alignment ((GtkMisc*) _tmp101_, 0.0f, 0.5f);
	_tmp102_ = label;
	gtk_widget_show ((GtkWidget*) _tmp102_);
	_tmp103_ = label;
	gtk_grid_attach (score_grid, (GtkWidget*) _tmp103_, 0, 0, 1, 1);
	_tmp104_ = (GtkLabel*) gtk_label_new ("0");
	g_object_ref_sink (_tmp104_);
	_g_object_unref0 (self->priv->score_label);
	self->priv->score_label = _tmp104_;
	_tmp105_ = self->priv->score_label;
	gtk_misc_set_alignment ((GtkMisc*) _tmp105_, 1.0f, 0.5f);
	_tmp106_ = self->priv->score_label;
	gtk_widget_show ((GtkWidget*) _tmp106_);
	_tmp107_ = self->priv->score_label;
	gtk_grid_attach (score_grid, (GtkWidget*) _tmp107_, 1, 0, 1, 1);
	_tmp108_ = _ ("Lines:");
	_tmp109_ = (GtkLabel*) gtk_label_new (_tmp108_);
	g_object_ref_sink (_tmp109_);
	_g_object_unref0 (label);
	label = _tmp109_;
	_tmp110_ = label;
	gtk_misc_set_alignment ((GtkMisc*) _tmp110_, 0.0f, 0.5f);
	_tmp111_ = label;
	gtk_widget_show ((GtkWidget*) _tmp111_);
	_tmp112_ = label;
	gtk_grid_attach (score_grid, (GtkWidget*) _tmp112_, 0, 1, 1, 1);
	_tmp113_ = (GtkLabel*) gtk_label_new ("0");
	g_object_ref_sink (_tmp113_);
	_g_object_unref0 (self->priv->n_destroyed_label);
	self->priv->n_destroyed_label = _tmp113_;
	_tmp114_ = self->priv->n_destroyed_label;
	gtk_misc_set_alignment ((GtkMisc*) _tmp114_, 1.0f, 0.5f);
	_tmp115_ = self->priv->n_destroyed_label;
	gtk_widget_show ((GtkWidget*) _tmp115_);
	_tmp116_ = self->priv->n_destroyed_label;
	gtk_grid_attach (score_grid, (GtkWidget*) _tmp116_, 1, 1, 1, 1);
	_tmp117_ = _ ("Level:");
	_tmp118_ = (GtkLabel*) gtk_label_new (_tmp117_);
	g_object_ref_sink (_tmp118_);
	_g_object_unref0 (label);
	label = _tmp118_;
	_tmp119_ = label;
	gtk_misc_set_alignment ((GtkMisc*) _tmp119_, 0.0f, 0.5f);
	_tmp120_ = label;
	gtk_widget_show ((GtkWidget*) _tmp120_);
	_tmp121_ = label;
	gtk_grid_attach (score_grid, (GtkWidget*) _tmp121_, 0, 2, 1, 1);
	_tmp122_ = (GtkLabel*) gtk_label_new ("0");
	g_object_ref_sink (_tmp122_);
	_g_object_unref0 (self->priv->level_label);
	self->priv->level_label = _tmp122_;
	_tmp123_ = self->priv->level_label;
	gtk_misc_set_alignment ((GtkMisc*) _tmp123_, 1.0f, 0.5f);
	_tmp124_ = self->priv->level_label;
	gtk_widget_show ((GtkWidget*) _tmp124_);
	_tmp125_ = self->priv->level_label;
	gtk_grid_attach (score_grid, (GtkWidget*) _tmp125_, 1, 2, 1, 1);
	_tmp126_ = g_new0 (GamesScoresCategory, 0);
	_tmp127_ = _tmp126_;
	_tmp127__length1 = 0;
	_tmp128_ = games_scores_new ("quadrapassel", _tmp127_, 0, NULL, NULL, 0, GAMES_SCORES_STYLE_PLAIN_DESCENDING);
	_g_object_unref0 (self->priv->high_scores);
	self->priv->high_scores = _tmp128_;
	_tmp127_ = (_vala_GamesScoresCategory_array_free (_tmp127_, _tmp127__length1), NULL);
	_tmp129_ = self->priv->pause_action;
	g_simple_action_set_enabled (_tmp129_, FALSE);
	_g_object_unref0 (label);
	_g_object_unref0 (score_grid);
	_g_object_unref0 (vb2);
	_g_object_unref0 (vb1);
	_g_object_unref0 (hb);
	_g_object_unref0 (new_game_button);
	_g_object_unref0 (toolbar);
	_g_object_unref0 (vbox);
	_g_object_unref0 (section);
	_g_object_unref0 (menu);
}


static gboolean quadrapassel_window_configure_event_cb (Quadrapassel* self, GdkEventConfigure* event) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	gboolean _tmp3_;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp1_ = self->priv->is_maximized;
	if (!_tmp1_) {
		gboolean _tmp2_;
		_tmp2_ = self->priv->is_fullscreen;
		_tmp0_ = !_tmp2_;
	} else {
		_tmp0_ = FALSE;
	}
	_tmp3_ = _tmp0_;
	if (_tmp3_) {
		GdkEventConfigure _tmp4_;
		gint _tmp5_;
		GdkEventConfigure _tmp6_;
		gint _tmp7_;
		_tmp4_ = *event;
		_tmp5_ = _tmp4_.width;
		self->priv->window_width = _tmp5_;
		_tmp6_ = *event;
		_tmp7_ = _tmp6_.height;
		self->priv->window_height = _tmp7_;
	}
	result = FALSE;
	return result;
}


static gboolean quadrapassel_window_state_event_cb (Quadrapassel* self, GdkEventWindowState* event) {
	gboolean result = FALSE;
	GdkEventWindowState _tmp0_;
	GdkWindowState _tmp1_;
	GdkEventWindowState _tmp4_;
	GdkWindowState _tmp5_;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = *event;
	_tmp1_ = _tmp0_.changed_mask;
	if ((_tmp1_ & GDK_WINDOW_STATE_MAXIMIZED) != 0) {
		GdkEventWindowState _tmp2_;
		GdkWindowState _tmp3_;
		_tmp2_ = *event;
		_tmp3_ = _tmp2_.new_window_state;
		self->priv->is_maximized = (_tmp3_ & GDK_WINDOW_STATE_MAXIMIZED) != 0;
	}
	_tmp4_ = *event;
	_tmp5_ = _tmp4_.changed_mask;
	if ((_tmp5_ & GDK_WINDOW_STATE_FULLSCREEN) != 0) {
		GdkEventWindowState _tmp6_;
		GdkWindowState _tmp7_;
		gboolean _tmp8_;
		_tmp6_ = *event;
		_tmp7_ = _tmp6_.new_window_state;
		self->priv->is_fullscreen = (_tmp7_ & GDK_WINDOW_STATE_FULLSCREEN) != 0;
		_tmp8_ = self->priv->is_fullscreen;
		if (_tmp8_) {
			GtkToolButton* _tmp9_;
			const gchar* _tmp10_ = NULL;
			GtkToolButton* _tmp11_;
			_tmp9_ = self->priv->fullscreen_button;
			_tmp10_ = _ ("_Leave Fullscreen");
			gtk_tool_button_set_label (_tmp9_, _tmp10_);
			_tmp11_ = self->priv->fullscreen_button;
			gtk_tool_button_set_icon_name (_tmp11_, "view-restore");
		} else {
			GtkToolButton* _tmp12_;
			const gchar* _tmp13_ = NULL;
			GtkToolButton* _tmp14_;
			_tmp12_ = self->priv->fullscreen_button;
			_tmp13_ = _ ("_Fullscreen");
			gtk_tool_button_set_label (_tmp12_, _tmp13_);
			_tmp14_ = self->priv->fullscreen_button;
			gtk_tool_button_set_icon_name (_tmp14_, "view-fullscreen");
		}
	}
	result = FALSE;
	return result;
}


static void quadrapassel_real_shutdown (GApplication* base) {
	Quadrapassel * self;
	GSettings* _tmp0_;
	gint _tmp1_;
	GSettings* _tmp2_;
	gint _tmp3_;
	GSettings* _tmp4_;
	gboolean _tmp5_;
	GSettings* _tmp6_;
	gboolean _tmp7_;
	gboolean _tmp8_ = FALSE;
	Game* _tmp9_;
	gboolean _tmp12_;
	self = (Quadrapassel*) base;
	G_APPLICATION_CLASS (quadrapassel_parent_class)->shutdown ((GApplication*) G_TYPE_CHECK_INSTANCE_CAST (self, GTK_TYPE_APPLICATION, GtkApplication));
	_tmp0_ = self->priv->settings;
	_tmp1_ = self->priv->window_width;
	g_settings_set_int (_tmp0_, "window-width", _tmp1_);
	_tmp2_ = self->priv->settings;
	_tmp3_ = self->priv->window_height;
	g_settings_set_int (_tmp2_, "window-height", _tmp3_);
	_tmp4_ = self->priv->settings;
	_tmp5_ = self->priv->is_maximized;
	g_settings_set_boolean (_tmp4_, "window-is-maximized", _tmp5_);
	_tmp6_ = self->priv->settings;
	_tmp7_ = self->priv->is_fullscreen;
	g_settings_set_boolean (_tmp6_, "window-is-fullscreen", _tmp7_);
	_tmp9_ = self->priv->game;
	if (_tmp9_ != NULL) {
		Game* _tmp10_;
		gint _tmp11_;
		_tmp10_ = self->priv->game;
		_tmp11_ = _tmp10_->score;
		_tmp8_ = _tmp11_ > 0;
	} else {
		_tmp8_ = FALSE;
	}
	_tmp12_ = _tmp8_;
	if (_tmp12_) {
		GamesScores* _tmp13_;
		Game* _tmp14_;
		gint _tmp15_;
		_tmp13_ = self->priv->high_scores;
		_tmp14_ = self->priv->game;
		_tmp15_ = _tmp14_->score;
		games_scores_add_plain_score (_tmp13_, (guint32) _tmp15_);
	}
}


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


static void quadrapassel_fullscreen_cb (Quadrapassel* self) {
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->is_fullscreen;
	if (_tmp0_) {
		GtkWindow* _tmp1_;
		_tmp1_ = self->priv->window;
		gtk_window_unfullscreen (_tmp1_);
	} else {
		GtkWindow* _tmp2_;
		_tmp2_ = self->priv->window;
		gtk_window_fullscreen (_tmp2_);
	}
}


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_accel_edited_cb_gtk_cell_renderer_accel_accel_edited (GtkCellRendererAccel* _sender, const gchar* path_string, guint accel_key, GdkModifierType accel_mods, guint hardware_keycode, gpointer self) {
	quadrapassel_accel_edited_cb (self, _sender, path_string, accel_key, accel_mods, hardware_keycode);
}


static void _quadrapassel_accel_cleared_cb_gtk_cell_renderer_accel_accel_cleared (GtkCellRendererAccel* _sender, const gchar* path_string, gpointer self) {
	quadrapassel_accel_cleared_cb (self, _sender, path_string);
}


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


static void quadrapassel_accel_cleared_cb (Quadrapassel* self, GtkCellRendererAccel* cell, const gchar* path_string) {
	const gchar* _tmp0_;
	GtkTreePath* _tmp1_;
	GtkTreePath* path;
	GtkTreePath* _tmp2_;
	GtkTreeIter iter = {0};
	GtkListStore* _tmp3_;
	GtkTreePath* _tmp4_;
	GtkTreeIter _tmp5_ = {0};
	gboolean _tmp6_ = FALSE;
	gchar* key;
	GtkListStore* _tmp7_;
	GtkTreeIter _tmp8_;
	const gchar* _tmp9_;
	GtkListStore* _tmp10_;
	GtkTreeIter _tmp11_;
	GSettings* _tmp12_;
	const gchar* _tmp13_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (cell != NULL);
	g_return_if_fail (path_string != NULL);
	_tmp0_ = path_string;
	_tmp1_ = gtk_tree_path_new_from_string (_tmp0_);
	path = _tmp1_;
	_tmp2_ = path;
	if (_tmp2_ == NULL) {
		_gtk_tree_path_free0 (path);
		return;
	}
	_tmp3_ = self->priv->controls_model;
	_tmp4_ = path;
	_tmp6_ = gtk_tree_model_get_iter ((GtkTreeModel*) _tmp3_, &_tmp5_, _tmp4_);
	iter = _tmp5_;
	if (!_tmp6_) {
		_gtk_tree_path_free0 (path);
		return;
	}
	key = NULL;
	_tmp7_ = self->priv->controls_model;
	_tmp8_ = iter;
	gtk_tree_model_get ((GtkTreeModel*) _tmp7_, &_tmp8_, 0, &key, -1);
	_tmp9_ = key;
	if (_tmp9_ == NULL) {
		_g_free0 (key);
		_gtk_tree_path_free0 (path);
		return;
	}
	_tmp10_ = self->priv->controls_model;
	_tmp11_ = iter;
	gtk_list_store_set (_tmp10_, &_tmp11_, 2, 0, -1);
	_tmp12_ = self->priv->settings;
	_tmp13_ = key;
	g_settings_set_int (_tmp12_, _tmp13_, 0);
	_g_free0 (key);
	_gtk_tree_path_free0 (path);
}


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 void quadrapassel_pause_cb (Quadrapassel* self) {
	Game* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->game;
	if (_tmp0_ != NULL) {
		Game* _tmp1_;
		Game* _tmp2_;
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp1_ = self->priv->game;
		_tmp2_ = self->priv->game;
		_tmp3_ = game_get_paused (_tmp2_);
		_tmp4_ = _tmp3_;
		game_set_paused (_tmp1_, !_tmp4_);
	}
}


static void quadrapassel_quit_cb (Quadrapassel* self) {
	GtkWindow* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->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* _tmp12_;
	gboolean _tmp13_;
	gboolean _tmp14_;
	guint _tmp15_;
	GSettings* _tmp16_;
	gint _tmp17_ = 0;
	guint _tmp18_ = 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_) {
		Game* _tmp8_;
		Game* _tmp9_;
		gboolean _tmp10_;
		gboolean _tmp11_;
		_tmp8_ = self->priv->game;
		_tmp9_ = self->priv->game;
		_tmp10_ = game_get_paused (_tmp9_);
		_tmp11_ = _tmp10_;
		game_set_paused (_tmp8_, !_tmp11_);
		result = TRUE;
		return result;
	}
	_tmp12_ = self->priv->game;
	_tmp13_ = game_get_paused (_tmp12_);
	_tmp14_ = _tmp13_;
	if (_tmp14_) {
		result = FALSE;
		return result;
	}
	_tmp15_ = keyval;
	_tmp16_ = self->priv->settings;
	_tmp17_ = g_settings_get_int (_tmp16_, "key-left");
	_tmp18_ = quadrapassel_upper_key (self, (guint) _tmp17_);
	if (_tmp15_ == _tmp18_) {
		Game* _tmp19_;
		_tmp19_ = self->priv->game;
		game_move_left (_tmp19_);
		result = TRUE;
		return result;
	} else {
		guint _tmp20_;
		GSettings* _tmp21_;
		gint _tmp22_ = 0;
		guint _tmp23_ = 0U;
		_tmp20_ = keyval;
		_tmp21_ = self->priv->settings;
		_tmp22_ = g_settings_get_int (_tmp21_, "key-right");
		_tmp23_ = quadrapassel_upper_key (self, (guint) _tmp22_);
		if (_tmp20_ == _tmp23_) {
			Game* _tmp24_;
			_tmp24_ = self->priv->game;
			game_move_right (_tmp24_);
			result = TRUE;
			return result;
		} else {
			guint _tmp25_;
			GSettings* _tmp26_;
			gint _tmp27_ = 0;
			guint _tmp28_ = 0U;
			_tmp25_ = keyval;
			_tmp26_ = self->priv->settings;
			_tmp27_ = g_settings_get_int (_tmp26_, "key-rotate");
			_tmp28_ = quadrapassel_upper_key (self, (guint) _tmp27_);
			if (_tmp25_ == _tmp28_) {
				GSettings* _tmp29_;
				gboolean _tmp30_ = FALSE;
				_tmp29_ = self->priv->settings;
				_tmp30_ = g_settings_get_boolean (_tmp29_, "rotate-counter-clock-wise");
				if (_tmp30_) {
					Game* _tmp31_;
					_tmp31_ = self->priv->game;
					game_rotate_left (_tmp31_);
				} else {
					Game* _tmp32_;
					_tmp32_ = self->priv->game;
					game_rotate_right (_tmp32_);
				}
				result = TRUE;
				return result;
			} else {
				guint _tmp33_;
				GSettings* _tmp34_;
				gint _tmp35_ = 0;
				guint _tmp36_ = 0U;
				_tmp33_ = keyval;
				_tmp34_ = self->priv->settings;
				_tmp35_ = g_settings_get_int (_tmp34_, "key-down");
				_tmp36_ = quadrapassel_upper_key (self, (guint) _tmp35_);
				if (_tmp33_ == _tmp36_) {
					Game* _tmp37_;
					_tmp37_ = self->priv->game;
					game_set_fast_forward (_tmp37_, TRUE);
					result = TRUE;
					return result;
				} else {
					guint _tmp38_;
					GSettings* _tmp39_;
					gint _tmp40_ = 0;
					guint _tmp41_ = 0U;
					_tmp38_ = keyval;
					_tmp39_ = self->priv->settings;
					_tmp40_ = g_settings_get_int (_tmp39_, "key-drop");
					_tmp41_ = quadrapassel_upper_key (self, (guint) _tmp40_);
					if (_tmp38_ == _tmp41_) {
						Game* _tmp42_;
						_tmp42_ = self->priv->game;
						game_drop (_tmp42_);
						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_pause_changed_cb_game_pause_changed (Game* _sender, gpointer self) {
	quadrapassel_pause_changed_cb (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_;
	Game* _tmp14_;
	Preview* _tmp15_;
	Game* _tmp16_;
	GameView* _tmp17_;
	Game* _tmp18_;
	Game* _tmp19_;
	GSimpleAction* _tmp20_;
	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_, "pause-changed", (GCallback) _quadrapassel_pause_changed_cb_game_pause_changed, self, 0);
	_tmp13_ = self->priv->game;
	g_signal_connect_object (_tmp13_, "shape-landed", (GCallback) _quadrapassel_shape_landed_cb_game_shape_landed, self, 0);
	_tmp14_ = self->priv->game;
	g_signal_connect_object (_tmp14_, "complete", (GCallback) _quadrapassel_complete_cb_game_complete, self, 0);
	_tmp15_ = self->priv->preview;
	_tmp16_ = self->priv->game;
	preview_set_game (_tmp15_, _tmp16_);
	_tmp17_ = self->priv->view;
	_tmp18_ = self->priv->game;
	game_view_set_game (_tmp17_, _tmp18_);
	_tmp19_ = self->priv->game;
	game_start (_tmp19_);
	quadrapassel_update_score (self);
	_tmp20_ = self->priv->pause_action;
	g_simple_action_set_enabled (_tmp20_, TRUE);
}


static void quadrapassel_pause_changed_cb (Quadrapassel* self) {
	Game* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->game;
	_tmp1_ = game_get_paused (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		GtkToolButton* _tmp3_;
		GtkToolButton* _tmp4_;
		const gchar* _tmp5_ = NULL;
		_tmp3_ = self->priv->pause_button;
		gtk_tool_button_set_icon_name (_tmp3_, "media-playback-start");
		_tmp4_ = self->priv->pause_button;
		_tmp5_ = _ ("Res_ume");
		gtk_tool_button_set_label (_tmp4_, _tmp5_);
	} else {
		GtkToolButton* _tmp6_;
		GtkToolButton* _tmp7_;
		const gchar* _tmp8_ = NULL;
		_tmp6_ = self->priv->pause_button;
		gtk_tool_button_set_icon_name (_tmp6_, "media-playback-pause");
		_tmp7_ = self->priv->pause_button;
		_tmp8_ = _ ("_Pause");
		gtk_tool_button_set_label (_tmp7_, _tmp8_);
	}
}


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) {
	GSimpleAction* _tmp0_;
	Game* _tmp1_;
	gint _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->pause_action;
	g_simple_action_set_enabled (_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* dialog;
		const gchar* _tmp11_ = NULL;
		gchar* _tmp12_;
		gchar* title;
		const gchar* _tmp13_ = NULL;
		gchar* _tmp14_;
		gchar* message;
		gint _tmp15_;
		GamesScoresDialog* _tmp21_;
		const gchar* _tmp22_;
		const gchar* _tmp23_;
		gchar* _tmp24_ = NULL;
		gchar* _tmp25_;
		GamesScoresDialog* _tmp26_;
		gint _tmp27_;
		GamesScoresDialog* _tmp30_;
		gint _tmp31_ = 0;
		GamesScoresDialog* _tmp33_;
		_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->window;
		_tmp8_ = self->priv->high_scores;
		_tmp9_ = _ ("Quadrapassel Scores");
		_tmp10_ = games_scores_dialog_new (_tmp7_, _tmp8_, _tmp9_);
		g_object_ref_sink (_tmp10_);
		dialog = _tmp10_;
		_tmp11_ = _ ("Puzzle solved!");
		_tmp12_ = g_strdup (_tmp11_);
		title = _tmp12_;
		_tmp13_ = _ ("You didn't make the top ten, better luck next time.");
		_tmp14_ = g_strdup (_tmp13_);
		message = _tmp14_;
		_tmp15_ = pos;
		if (_tmp15_ == 1) {
			const gchar* _tmp16_ = NULL;
			gchar* _tmp17_;
			_tmp16_ = _ ("Your score is the best!");
			_tmp17_ = g_strdup (_tmp16_);
			_g_free0 (message);
			message = _tmp17_;
		} else {
			gint _tmp18_;
			_tmp18_ = pos;
			if (_tmp18_ > 1) {
				const gchar* _tmp19_ = NULL;
				gchar* _tmp20_;
				_tmp19_ = _ ("Your score has made the top ten.");
				_tmp20_ = g_strdup (_tmp19_);
				_g_free0 (message);
				message = _tmp20_;
			}
		}
		_tmp21_ = dialog;
		_tmp22_ = title;
		_tmp23_ = message;
		_tmp24_ = g_strdup_printf ("<b>%s</b>\n\n%s", _tmp22_, _tmp23_);
		_tmp25_ = _tmp24_;
		games_scores_dialog_set_message (_tmp21_, _tmp25_);
		_g_free0 (_tmp25_);
		_tmp26_ = dialog;
		games_scores_dialog_set_buttons (_tmp26_, (guint) (GAMES_SCORES_QUIT_BUTTON | GAMES_SCORES_NEW_GAME_BUTTON));
		_tmp27_ = pos;
		if (_tmp27_ > 0) {
			GamesScoresDialog* _tmp28_;
			gint _tmp29_;
			_tmp28_ = dialog;
			_tmp29_ = pos;
			games_scores_dialog_set_hilight (_tmp28_, (guint) _tmp29_);
		}
		_tmp30_ = dialog;
		_tmp31_ = gtk_dialog_run ((GtkDialog*) _tmp30_);
		switch (_tmp31_) {
			case GTK_RESPONSE_REJECT:
			{
				GtkWindow* _tmp32_;
				_tmp32_ = self->priv->window;
				gtk_widget_destroy ((GtkWidget*) _tmp32_);
				break;
			}
			default:
			{
				quadrapassel_new_game (self);
				break;
			}
		}
		_tmp33_ = dialog;
		gtk_widget_destroy ((GtkWidget*) _tmp33_);
		_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->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 __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_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:746: Failed to show help: %s", _tmp4_);
		_g_error_free0 (e);
	}
	__finally0:
	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_;
	gchar* _tmp4_;
	gchar* license;
	GtkWindow* _tmp5_;
	const gchar* _tmp6_ = NULL;
	const gchar* _tmp7_ = NULL;
	const gchar* _tmp8_ = NULL;
	const gchar* _tmp9_ = 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_ = g_strdup ("Quadrapassel is free software; you can redistribute it and/or modify i" \
"t under the terms of the GNU General Public License as published by th" \
"e Free Software Foundation; either version 2 of the License, or (at yo" \
"ur option) any later version.\n" \
"\n" \
"Quadrapassel is distributed in the hope that it will be useful, but WI" \
"THOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILI" \
"TY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public Lic" \
"ense for more details.\n" \
"\n" \
"You should have received a copy of the GNU General Public License alon" \
"g with Quadrapassel; if not, write to the Free Software Foundation, In" \
"c., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA");
	license = _tmp4_;
	_tmp5_ = self->priv->window;
	_tmp6_ = _ ("Quadrapassel");
	_tmp7_ = _ ("A classic game of fitting falling blocks together.\n" \
"\n" \
"Quadrapassel is a part of GNOME Games.");
	_tmp8_ = _ ("GNOME Games web site");
	_tmp9_ = _ ("translator-credits");
	gtk_show_about_dialog (_tmp5_, "program-name", _tmp6_, "version", VERSION, "comments", _tmp7_, "copyright", "Copyright \xc2\xa9 1999 J. Marcin Gorycki, 2000-2009 Others", "license", license, "website-label", _tmp8_, "authors", authors, "documenters", documenters, "translator-credits", _tmp9_, "logo-icon-name", "quadrapassel", "website", "http://wwwindow.gnome.org/projects/gnome-games/", "wrap-license", TRUE, NULL, NULL);
	_g_free0 (license);
	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* dialog;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->window;
	_tmp1_ = self->priv->high_scores;
	_tmp2_ = _ ("Quadrapassel Scores");
	_tmp3_ = games_scores_dialog_new (_tmp0_, _tmp1_, _tmp2_);
	g_object_ref_sink (_tmp3_);
	dialog = _tmp3_;
	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* _tmp19_;
	Quadrapassel* app;
	Quadrapassel* _tmp20_;
	gchar** _tmp21_;
	gint _tmp21__length1;
	gint _tmp22_ = 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 __catch1_g_error;
		}
	}
	goto __finally1;
	__catch1_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;
	}
	__finally1:
	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 __catch2_g_error;
		}
	}
	goto __finally2;
	__catch2_g_error:
	{
		GError* e = NULL;
		GError* _tmp12_;
		const gchar* _tmp13_;
		GtkMessageDialog* _tmp14_;
		GtkMessageDialog* dialog;
		GtkMessageDialog* _tmp15_;
		const gchar* _tmp16_ = NULL;
		GtkMessageDialog* _tmp17_;
		GtkMessageDialog* _tmp18_;
		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_);
		g_object_ref_sink (_tmp14_);
		dialog = _tmp14_;
		_tmp15_ = dialog;
		_tmp16_ = g_get_application_name ();
		gtk_window_set_title ((GtkWindow*) _tmp15_, _tmp16_);
		_tmp17_ = dialog;
		gtk_dialog_run ((GtkDialog*) _tmp17_);
		_tmp18_ = dialog;
		gtk_widget_destroy ((GtkWidget*) _tmp18_);
		result = EXIT_FAILURE;
		_g_object_unref0 (dialog);
		_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;
	}
	_tmp19_ = quadrapassel_new ();
	app = _tmp19_;
	_tmp20_ = app;
	_tmp21_ = args;
	_tmp21__length1 = args_length1;
	_tmp22_ = g_application_run ((GApplication*) _tmp20_, _tmp21__length1, _tmp21_);
	result = _tmp22_;
	_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 = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_QUADRAPASSEL, Quadrapassel);
	_g_object_unref0 (self->priv->settings);
	_g_object_unref0 (self->priv->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_action);
	_g_object_unref0 (self->priv->pause_button);
	_g_object_unref0 (self->priv->fullscreen_button);
	_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_unref0 (self->priv->controls_model);
	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);
}



