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


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


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

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

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

typedef struct _Game Game;
typedef struct _GameClass GameClass;

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

typedef struct _GameView GameView;
typedef struct _GameViewClass GameViewClass;

#define TYPE_PREVIEW (preview_get_type ())
#define PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PREVIEW, Preview))
#define PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PREVIEW, PreviewClass))
#define IS_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PREVIEW))
#define IS_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PREVIEW))
#define PREVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PREVIEW, PreviewClass))

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

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

typedef struct _Shape Shape;
typedef struct _ShapeClass ShapeClass;

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

typedef struct _Block Block;
typedef struct _BlockClass BlockClass;
#define _g_option_context_free0(var) ((var == NULL) ? NULL : (var = (g_option_context_free (var), NULL)))
#define _quadrapassel_unref0(var) ((var == NULL) ? NULL : (var = (quadrapassel_unref (var), NULL)))
typedef struct _ParamSpecQuadrapassel ParamSpecQuadrapassel;

struct _Quadrapassel {
	GTypeInstance parent_instance;
	volatile int ref_count;
	QuadrapasselPrivate * priv;
};

struct _QuadrapasselClass {
	GTypeClass parent_class;
	void (*finalize) (Quadrapassel *self);
};

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

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

struct _GameViewClass {
	GtkClutterEmbedClass parent_class;
};

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

struct _GameClass {
	GObjectClass parent_class;
};

struct _ParamSpecQuadrapassel {
	GParamSpec parent_instance;
};


static gpointer quadrapassel_parent_class = NULL;

gpointer quadrapassel_ref (gpointer instance);
void quadrapassel_unref (gpointer instance);
GParamSpec* param_spec_quadrapassel (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_quadrapassel (GValue* value, gpointer v_object);
void value_take_quadrapassel (GValue* value, gpointer v_object);
gpointer value_get_quadrapassel (const GValue* value);
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, GtkAction* action);
static void _quadrapassel_new_game_cb_gtk_action_callback (GtkAction* action, gpointer self);
static void quadrapassel_scores_cb (Quadrapassel* self, GtkAction* action);
static void _quadrapassel_scores_cb_gtk_action_callback (GtkAction* action, gpointer self);
static void quadrapassel_quit_cb (Quadrapassel* self, GtkAction* action);
static void _quadrapassel_quit_cb_gtk_action_callback (GtkAction* action, gpointer self);
static void quadrapassel_preferences_cb (Quadrapassel* self, GtkAction* action);
static void _quadrapassel_preferences_cb_gtk_action_callback (GtkAction* action, gpointer self);
static void quadrapassel_help_cb (Quadrapassel* self, GtkAction* action);
static void _quadrapassel_help_cb_gtk_action_callback (GtkAction* action, gpointer self);
static void quadrapassel_about_cb (Quadrapassel* self, GtkAction* action);
static void _quadrapassel_about_cb_gtk_action_callback (GtkAction* action, gpointer self);
Quadrapassel* quadrapassel_new (void);
Quadrapassel* quadrapassel_construct (GType object_type);
static gboolean quadrapassel_window_delete_event_cb (Quadrapassel* self, GtkWidget* window, GdkEventAny* event);
static gboolean _quadrapassel_window_delete_event_cb_gtk_widget_delete_event (GtkWidget* _sender, GdkEventAny* 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 quadrapassel_pause_cb (Quadrapassel* self);
static void _quadrapassel_pause_cb_games_pause_action_state_changed (GamesPauseAction* _sender, 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);
static void _vala_GamesScoresCategory_array_free (GamesScoresCategory* array, gint array_length);
void quadrapassel_show (Quadrapassel* self);
static void quadrapassel_preferences_dialog_close_cb (Quadrapassel* self);
static void quadrapassel_preferences_dialog_response_cb (Quadrapassel* self, gint response_id);
static void _quadrapassel_preferences_dialog_close_cb_gtk_dialog_close (GtkDialog* _sender, gpointer self);
static void _quadrapassel_preferences_dialog_response_cb_gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self);
gint game_get_height (Game* self);
static void quadrapassel_fill_height_spinner_value_changed_cb (Quadrapassel* self, GtkSpinButton* spin);
static void _quadrapassel_fill_height_spinner_value_changed_cb_gtk_spin_button_value_changed (GtkSpinButton* _sender, gpointer self);
static void quadrapassel_fill_prob_spinner_value_changed_cb (Quadrapassel* self, GtkSpinButton* spin);
static void _quadrapassel_fill_prob_spinner_value_changed_cb_gtk_spin_button_value_changed (GtkSpinButton* _sender, gpointer self);
static void quadrapassel_starting_level_value_changed_cb (Quadrapassel* self, GtkSpinButton* spin);
static void _quadrapassel_starting_level_value_changed_cb_gtk_spin_button_value_changed (GtkSpinButton* _sender, gpointer self);
static void quadrapassel_sound_toggle_toggled_cb (Quadrapassel* self);
static void _quadrapassel_sound_toggle_toggled_cb_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self);
static void quadrapassel_do_preview_toggle_toggled_cb (Quadrapassel* self);
static void _quadrapassel_do_preview_toggle_toggled_cb_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self);
static void quadrapassel_difficult_blocks_toggled_cb (Quadrapassel* self);
static void _quadrapassel_difficult_blocks_toggled_cb_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self);
static void quadrapassel_set_rotate_counter_clock_wise (Quadrapassel* self);
static void _quadrapassel_set_rotate_counter_clock_wise_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self);
static void quadrapassel_user_target_toggled_cb (Quadrapassel* self);
static void _quadrapassel_user_target_toggled_cb_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self);
static void quadrapassel_theme_combo_changed_cb (Quadrapassel* self, GtkComboBox* widget);
static void _quadrapassel_theme_combo_changed_cb_gtk_combo_box_changed (GtkComboBox* _sender, gpointer self);
void preview_set_game (Preview* self, Game* value);
void game_set_paused (Game* self, gboolean value);
static void quadrapassel_quit (Quadrapassel* self);
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 guint quadrapassel_upper_key (Quadrapassel* self, guint keyval);
gboolean game_get_paused (Game* self);
gboolean game_move_left (Game* self);
gboolean game_move_right (Game* self);
gboolean game_rotate_left (Game* self);
gboolean game_rotate_right (Game* self);
void game_set_fast_forward (Game* self, gboolean enable);
void game_drop (Game* self);
static void quadrapassel_new_game (Quadrapassel* self);
void game_stop (Game* self);
static void quadrapassel_shape_landed_cb (Quadrapassel* self, gint* lines, int lines_length1, GList* line_blocks);
static void _quadrapassel_shape_landed_cb_game_shape_landed (Game* _sender, gint* lines, int lines_length1, GList* line_blocks, gpointer self);
static void quadrapassel_complete_cb (Quadrapassel* self);
static void _quadrapassel_complete_cb_game_complete (Game* _sender, gpointer self);
void game_start (Game* self);
static void quadrapassel_update_score (Quadrapassel* self);
gint game_get_level (Game* self);
gint quadrapassel_main (gchar** args, int args_length1);
static void quadrapassel_finalize (Quadrapassel* 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 GtkActionEntry QUADRAPASSEL_actions[9] = {{"GameMenu", NULL, "_Game"}, {"SettingsMenu", NULL, "_Settings"}, {"HelpMenu", NULL, "_Help"}, {"NewGame", GAMES_STOCK_NEW_GAME, NULL, NULL, NULL, (GCallback) _quadrapassel_new_game_cb_gtk_action_callback}, {"Scores", GAMES_STOCK_SCORES, NULL, NULL, NULL, (GCallback) _quadrapassel_scores_cb_gtk_action_callback}, {"Quit", GTK_STOCK_QUIT, NULL, NULL, NULL, (GCallback) _quadrapassel_quit_cb_gtk_action_callback}, {"Preferences", GTK_STOCK_PREFERENCES, NULL, NULL, NULL, (GCallback) _quadrapassel_preferences_cb_gtk_action_callback}, {"Contents", GAMES_STOCK_CONTENTS, NULL, NULL, NULL, (GCallback) _quadrapassel_help_cb_gtk_action_callback}, {"About", GTK_STOCK_ABOUT, NULL, NULL, NULL, (GCallback) _quadrapassel_about_cb_gtk_action_callback}};

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


static void _quadrapassel_scores_cb_gtk_action_callback (GtkAction* action, gpointer self) {
	quadrapassel_scores_cb (self, action);
}


static void _quadrapassel_quit_cb_gtk_action_callback (GtkAction* action, gpointer self) {
	quadrapassel_quit_cb (self, action);
}


static void _quadrapassel_preferences_cb_gtk_action_callback (GtkAction* action, gpointer self) {
	quadrapassel_preferences_cb (self, action);
}


static void _quadrapassel_help_cb_gtk_action_callback (GtkAction* action, gpointer self) {
	quadrapassel_help_cb (self, action);
}


static void _quadrapassel_about_cb_gtk_action_callback (GtkAction* action, gpointer self) {
	quadrapassel_about_cb (self, action);
}


static gboolean _quadrapassel_window_delete_event_cb_gtk_widget_delete_event (GtkWidget* _sender, GdkEventAny* event, gpointer self) {
	gboolean result;
	result = quadrapassel_window_delete_event_cb (self, _sender, event);
	return result;
}


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


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


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


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


static void _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);
}


Quadrapassel* quadrapassel_construct (GType object_type) {
	Quadrapassel* self = NULL;
	gchar* _tmp0_;
	gchar* ui_description;
	GSettings* _tmp1_;
	GtkWindow* _tmp2_;
	GtkWindow* _tmp3_;
	GtkWindow* _tmp4_;
	const gchar* _tmp5_ = NULL;
	GtkWindow* _tmp6_;
	GtkWindow* _tmp7_;
	GtkBox* _tmp8_;
	GtkBox* _tmp9_;
	GtkBox* vbox;
	GtkWindow* _tmp10_;
	GameView* _tmp11_;
	GameView* _tmp12_;
	GameView* _tmp13_;
	GSettings* _tmp14_;
	gchar* _tmp15_ = NULL;
	gchar* _tmp16_;
	GameView* _tmp17_;
	GSettings* _tmp18_;
	gboolean _tmp19_ = FALSE;
	GameView* _tmp20_;
	GSettings* _tmp21_;
	gboolean _tmp22_ = FALSE;
	GameView* _tmp23_;
	Game* _tmp24_;
	Game* _tmp25_;
	Preview* _tmp26_;
	Preview* _tmp27_;
	Preview* _tmp28_;
	GSettings* _tmp29_;
	gchar* _tmp30_ = NULL;
	gchar* _tmp31_;
	Preview* _tmp32_;
	GSettings* _tmp33_;
	gboolean _tmp34_ = FALSE;
	GtkActionGroup* _tmp35_;
	GtkActionGroup* action_group;
	GtkAction* _tmp36_ = NULL;
	GtkUIManager* _tmp37_;
	GtkUIManager* ui_manager;
	GtkWindow* _tmp38_;
	GtkAccelGroup* _tmp39_ = NULL;
	GamesPauseAction* _tmp40_;
	GamesPauseAction* _tmp41_;
	GamesPauseAction* _tmp42_;
	GtkWindow* _tmp43_;
	GamesFullscreenAction* _tmp44_;
	GamesFullscreenAction* _tmp45_;
	GtkWidget* _tmp46_ = NULL;
	GtkWidget* _tmp47_;
	GtkWidget* menubar;
	GtkWidget* _tmp48_ = NULL;
	GtkToolbar* _tmp49_;
	GtkToolbar* toolbar;
	GtkStyleContext* _tmp50_ = NULL;
	GtkBox* _tmp51_;
	GtkBox* _tmp52_;
	GtkBox* hb;
	GtkWindow* _tmp53_;
	GtkWindow* _tmp54_;
	gint _tmp55_ = 0;
	GtkBox* _tmp56_;
	GtkBox* _tmp57_;
	GtkBox* vb1;
	GameView* _tmp58_;
	GtkWindow* _tmp59_;
	GtkWindow* _tmp60_;
	GtkBox* _tmp61_;
	GtkBox* _tmp62_;
	GtkBox* vb2;
	Preview* _tmp63_;
	GtkGrid* _tmp64_;
	GtkGrid* _tmp65_;
	GtkGrid* score_grid;
	const gchar* _tmp66_ = NULL;
	GtkLabel* _tmp67_;
	GtkLabel* _tmp68_;
	GtkLabel* label;
	GtkLabel* _tmp69_;
	GtkLabel* _tmp70_;
	GtkLabel* _tmp71_;
	GtkLabel* _tmp72_;
	GtkLabel* _tmp73_;
	GtkLabel* _tmp74_;
	const gchar* _tmp75_ = NULL;
	GtkLabel* _tmp76_;
	GtkLabel* _tmp77_;
	GtkLabel* _tmp78_;
	GtkLabel* _tmp79_;
	GtkLabel* _tmp80_;
	GtkLabel* _tmp81_;
	GtkLabel* _tmp82_;
	GtkLabel* _tmp83_;
	const gchar* _tmp84_ = NULL;
	GtkLabel* _tmp85_;
	GtkLabel* _tmp86_;
	GtkLabel* _tmp87_;
	GtkLabel* _tmp88_;
	GtkLabel* _tmp89_;
	GtkLabel* _tmp90_;
	GtkLabel* _tmp91_;
	GtkLabel* _tmp92_;
	GamesScoresCategory* _tmp93_ = NULL;
	GamesScoresCategory* _tmp94_;
	gint _tmp94__length1;
	GamesScores* _tmp95_;
	GamesPauseAction* _tmp96_;
	GError * _inner_error_ = NULL;
	self = (Quadrapassel*) g_type_create_instance (object_type);
	_tmp0_ = g_strdup ("<ui>" "  <menubar name='MainMenu'>" "    <menu action='GameMenu'>" "      <menuitem action='NewGame'/>" "      <menuitem action='_Pause'/>" "      <separator/>" "      <menuitem action='Scores'/>" "      <separator/>" "      <menuitem action='Quit'/>" "    </menu>" "    <menu action='SettingsMenu'>" "      <menuitem action='Fullscreen'/>" "      <menuitem action='Preferences'/>" "    </menu>" "    <menu action='HelpMenu'>" "      <menuitem action='Contents'/>" "      <menuitem action='About'/>" "    </menu>" "  </menubar>" "    <toolbar name='Toolbar'>" "        <toolitem action='NewGame'/>" "        <toolitem action='_Pause'/>" "        <toolitem action='Fullscreen'/>" "    </toolbar>" "</ui>");
	ui_description = _tmp0_;
	_tmp1_ = g_settings_new ("org.gnome.quadrapassel");
	_g_object_unref0 (self->priv->settings);
	self->priv->settings = _tmp1_;
	_tmp2_ = (GtkWindow*) gtk_window_new (GTK_WINDOW_TOPLEVEL);
	_tmp3_ = g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->main_window);
	self->priv->main_window = _tmp3_;
	_tmp4_ = self->priv->main_window;
	_tmp5_ = _ ("Quadrapassel");
	gtk_window_set_title (_tmp4_, _tmp5_);
	_tmp6_ = self->priv->main_window;
	g_signal_connect ((GtkWidget*) _tmp6_, "delete-event", (GCallback) _quadrapassel_window_delete_event_cb_gtk_widget_delete_event, self);
	_tmp7_ = self->priv->main_window;
	gtk_window_set_default_size (_tmp7_, 500, 550);
	_tmp8_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	_tmp9_ = g_object_ref_sink (_tmp8_);
	vbox = _tmp9_;
	_tmp10_ = self->priv->main_window;
	gtk_container_add ((GtkContainer*) _tmp10_, (GtkWidget*) vbox);
	_tmp11_ = game_view_new ();
	_tmp12_ = g_object_ref_sink (_tmp11_);
	_g_object_unref0 (self->priv->view);
	self->priv->view = _tmp12_;
	_tmp13_ = self->priv->view;
	_tmp14_ = self->priv->settings;
	_tmp15_ = g_settings_get_string (_tmp14_, "theme");
	_tmp16_ = _tmp15_;
	game_view_set_theme (_tmp13_, _tmp16_);
	_g_free0 (_tmp16_);
	_tmp17_ = self->priv->view;
	_tmp18_ = self->priv->settings;
	_tmp19_ = g_settings_get_boolean (_tmp18_, "sound");
	_tmp17_->mute = !_tmp19_;
	_tmp20_ = self->priv->view;
	_tmp21_ = self->priv->settings;
	_tmp22_ = g_settings_get_boolean (_tmp21_, "show-shadow");
	game_view_set_show_shadow (_tmp20_, _tmp22_);
	_tmp23_ = self->priv->view;
	_tmp24_ = game_new (20, 14, 1, 20, 10, FALSE);
	_tmp25_ = _tmp24_;
	game_view_set_game (_tmp23_, _tmp25_);
	_g_object_unref0 (_tmp25_);
	_tmp26_ = preview_new ();
	_tmp27_ = g_object_ref_sink (_tmp26_);
	_g_object_unref0 (self->priv->preview);
	self->priv->preview = _tmp27_;
	_tmp28_ = self->priv->preview;
	_tmp29_ = self->priv->settings;
	_tmp30_ = g_settings_get_string (_tmp29_, "theme");
	_tmp31_ = _tmp30_;
	preview_set_theme (_tmp28_, _tmp31_);
	_g_free0 (_tmp31_);
	_tmp32_ = self->priv->preview;
	_tmp33_ = self->priv->settings;
	_tmp34_ = g_settings_get_boolean (_tmp33_, "do-preview");
	preview_set_enabled (_tmp32_, _tmp34_);
	games_stock_init ();
	_tmp35_ = gtk_action_group_new ("MenuActions");
	action_group = _tmp35_;
	gtk_action_group_set_translation_domain (action_group, GETTEXT_PACKAGE);
	gtk_action_group_add_actions (action_group, QUADRAPASSEL_actions, G_N_ELEMENTS (QUADRAPASSEL_actions), self);
	_tmp36_ = gtk_action_group_get_action (action_group, "NewGame");
	gtk_action_set_is_important (_tmp36_, TRUE);
	_tmp37_ = gtk_ui_manager_new ();
	ui_manager = _tmp37_;
	gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
	{
		gtk_ui_manager_add_ui_from_string (ui_manager, ui_description, (gssize) (-1), &_inner_error_);
		if (_inner_error_ != NULL) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		_g_error_free0 (e);
	}
	__finally0:
	if (_inner_error_ != NULL) {
		_g_object_unref0 (ui_manager);
		_g_object_unref0 (action_group);
		_g_object_unref0 (vbox);
		_g_free0 (ui_description);
		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 NULL;
	}
	_tmp38_ = self->priv->main_window;
	_tmp39_ = gtk_ui_manager_get_accel_group (ui_manager);
	gtk_window_add_accel_group (_tmp38_, _tmp39_);
	_tmp40_ = games_pause_action_new ("_Pause");
	_g_object_unref0 (self->priv->pause_action);
	self->priv->pause_action = _tmp40_;
	_tmp41_ = self->priv->pause_action;
	g_signal_connect (_tmp41_, "state-changed", (GCallback) _quadrapassel_pause_cb_games_pause_action_state_changed, self);
	_tmp42_ = self->priv->pause_action;
	gtk_action_group_add_action_with_accel (action_group, (GtkAction*) _tmp42_, NULL);
	_tmp43_ = self->priv->main_window;
	_tmp44_ = games_fullscreen_action_new ("Fullscreen", _tmp43_);
	_g_object_unref0 (self->priv->fullscreen_action);
	self->priv->fullscreen_action = _tmp44_;
	_tmp45_ = self->priv->fullscreen_action;
	gtk_action_group_add_action_with_accel (action_group, (GtkAction*) _tmp45_, NULL);
	_tmp46_ = gtk_ui_manager_get_widget (ui_manager, "/MainMenu");
	_tmp47_ = _g_object_ref0 (_tmp46_);
	menubar = _tmp47_;
	gtk_box_pack_start (vbox, menubar, FALSE, TRUE, (guint) 0);
	_tmp48_ = gtk_ui_manager_get_widget (ui_manager, "/Toolbar");
	_tmp49_ = _g_object_ref0 (GTK_TOOLBAR (_tmp48_));
	toolbar = _tmp49_;
	gtk_toolbar_set_show_arrow (toolbar, FALSE);
	_tmp50_ = gtk_widget_get_style_context ((GtkWidget*) toolbar);
	gtk_style_context_add_class (_tmp50_, GTK_STYLE_CLASS_PRIMARY_TOOLBAR);
	gtk_box_pack_start (vbox, (GtkWidget*) toolbar, FALSE, TRUE, (guint) 0);
	_tmp51_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	_tmp52_ = g_object_ref_sink (_tmp51_);
	hb = _tmp52_;
	gtk_box_pack_start (vbox, (GtkWidget*) hb, TRUE, TRUE, (guint) 0);
	_tmp53_ = self->priv->main_window;
	_tmp54_ = self->priv->main_window;
	_tmp55_ = gtk_widget_get_events ((GtkWidget*) _tmp54_);
	gtk_widget_set_events ((GtkWidget*) _tmp53_, (_tmp55_ | GDK_KEY_PRESS_MASK) | GDK_KEY_RELEASE_MASK);
	_tmp56_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	_tmp57_ = g_object_ref_sink (_tmp56_);
	vb1 = _tmp57_;
	gtk_container_set_border_width ((GtkContainer*) vb1, (guint) 10);
	_tmp58_ = self->priv->view;
	gtk_box_pack_start (vb1, (GtkWidget*) _tmp58_, TRUE, TRUE, (guint) 0);
	gtk_box_pack_start (hb, (GtkWidget*) vb1, TRUE, TRUE, (guint) 0);
	_tmp59_ = self->priv->main_window;
	g_signal_connect ((GtkWidget*) _tmp59_, "key-press-event", (GCallback) _quadrapassel_key_press_event_cb_gtk_widget_key_press_event, self);
	_tmp60_ = self->priv->main_window;
	g_signal_connect ((GtkWidget*) _tmp60_, "key-release-event", (GCallback) _quadrapassel_key_release_event_cb_gtk_widget_key_release_event, self);
	_tmp61_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	_tmp62_ = g_object_ref_sink (_tmp61_);
	vb2 = _tmp62_;
	gtk_container_set_border_width ((GtkContainer*) vb2, (guint) 10);
	gtk_box_pack_end (hb, (GtkWidget*) vb2, FALSE, FALSE, (guint) 0);
	_tmp63_ = self->priv->preview;
	gtk_box_pack_start (vb2, (GtkWidget*) _tmp63_, FALSE, FALSE, (guint) 0);
	_tmp64_ = (GtkGrid*) gtk_grid_new ();
	_tmp65_ = g_object_ref_sink (_tmp64_);
	score_grid = _tmp65_;
	_tmp66_ = _ ("Score:");
	_tmp67_ = (GtkLabel*) gtk_label_new (_tmp66_);
	_tmp68_ = g_object_ref_sink (_tmp67_);
	label = _tmp68_;
	_tmp69_ = label;
	gtk_misc_set_alignment ((GtkMisc*) _tmp69_, 0.0f, 0.5f);
	_tmp70_ = label;
	gtk_grid_attach (score_grid, (GtkWidget*) _tmp70_, 0, 0, 1, 1);
	_tmp71_ = (GtkLabel*) gtk_label_new ("0");
	_tmp72_ = g_object_ref_sink (_tmp71_);
	_g_object_unref0 (self->priv->score_label);
	self->priv->score_label = _tmp72_;
	_tmp73_ = self->priv->score_label;
	gtk_misc_set_alignment ((GtkMisc*) _tmp73_, 1.0f, 0.5f);
	_tmp74_ = self->priv->score_label;
	gtk_grid_attach (score_grid, (GtkWidget*) _tmp74_, 1, 0, 1, 1);
	_tmp75_ = _ ("Lines:");
	_tmp76_ = (GtkLabel*) gtk_label_new (_tmp75_);
	_tmp77_ = g_object_ref_sink (_tmp76_);
	_g_object_unref0 (label);
	label = _tmp77_;
	_tmp78_ = label;
	gtk_misc_set_alignment ((GtkMisc*) _tmp78_, 0.0f, 0.5f);
	_tmp79_ = label;
	gtk_grid_attach (score_grid, (GtkWidget*) _tmp79_, 0, 1, 1, 1);
	_tmp80_ = (GtkLabel*) gtk_label_new ("0");
	_tmp81_ = g_object_ref_sink (_tmp80_);
	_g_object_unref0 (self->priv->n_destroyed_label);
	self->priv->n_destroyed_label = _tmp81_;
	_tmp82_ = self->priv->n_destroyed_label;
	gtk_misc_set_alignment ((GtkMisc*) _tmp82_, 1.0f, 0.5f);
	_tmp83_ = self->priv->n_destroyed_label;
	gtk_grid_attach (score_grid, (GtkWidget*) _tmp83_, 1, 1, 1, 1);
	_tmp84_ = _ ("Level:");
	_tmp85_ = (GtkLabel*) gtk_label_new (_tmp84_);
	_tmp86_ = g_object_ref_sink (_tmp85_);
	_g_object_unref0 (label);
	label = _tmp86_;
	_tmp87_ = label;
	gtk_misc_set_alignment ((GtkMisc*) _tmp87_, 0.0f, 0.5f);
	_tmp88_ = label;
	gtk_grid_attach (score_grid, (GtkWidget*) _tmp88_, 0, 2, 1, 1);
	_tmp89_ = (GtkLabel*) gtk_label_new ("0");
	_tmp90_ = g_object_ref_sink (_tmp89_);
	_g_object_unref0 (self->priv->level_label);
	self->priv->level_label = _tmp90_;
	_tmp91_ = self->priv->level_label;
	gtk_misc_set_alignment ((GtkMisc*) _tmp91_, 1.0f, 0.5f);
	_tmp92_ = self->priv->level_label;
	gtk_grid_attach (score_grid, (GtkWidget*) _tmp92_, 1, 2, 1, 1);
	gtk_box_pack_end (vb2, (GtkWidget*) score_grid, TRUE, FALSE, (guint) 0);
	_tmp93_ = g_new0 (GamesScoresCategory, 0);
	_tmp94_ = _tmp93_;
	_tmp94__length1 = 0;
	_tmp95_ = games_scores_new ("quadrapassel", _tmp94_, 0, NULL, NULL, 0, GAMES_SCORES_STYLE_PLAIN_DESCENDING);
	_g_object_unref0 (self->priv->high_scores);
	self->priv->high_scores = _tmp95_;
	_tmp94_ = (_vala_GamesScoresCategory_array_free (_tmp94_, _tmp94__length1), NULL);
	_tmp96_ = self->priv->pause_action;
	gtk_action_set_sensitive ((GtkAction*) _tmp96_, 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 (toolbar);
	_g_object_unref0 (menubar);
	_g_object_unref0 (ui_manager);
	_g_object_unref0 (action_group);
	_g_object_unref0 (vbox);
	_g_free0 (ui_description);
	return self;
}


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


static void quadrapassel_pause_cb (Quadrapassel* self) {
	Game* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->game;
	if (_tmp0_ != NULL) {
		Game* _tmp1_;
		GamesPauseAction* _tmp2_;
		gboolean _tmp3_ = FALSE;
		_tmp1_ = self->priv->game;
		_tmp2_ = self->priv->pause_action;
		_tmp3_ = games_pause_action_get_is_paused (_tmp2_);
		game_set_paused (_tmp1_, _tmp3_);
	}
}


static gboolean quadrapassel_window_delete_event_cb (Quadrapassel* self, GtkWidget* window, GdkEventAny* event) {
	gboolean result = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (window != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	quadrapassel_quit (self);
	result = TRUE;
	return result;
}


static void quadrapassel_quit_cb (Quadrapassel* self, GtkAction* action) {
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	quadrapassel_quit (self);
}


static void quadrapassel_quit (Quadrapassel* self) {
	gboolean _tmp0_ = FALSE;
	Game* _tmp1_;
	gboolean _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->game;
	if (_tmp1_ != NULL) {
		Game* _tmp2_;
		gint _tmp3_;
		_tmp2_ = self->priv->game;
		_tmp3_ = _tmp2_->score;
		_tmp0_ = _tmp3_ > 0;
	} else {
		_tmp0_ = FALSE;
	}
	_tmp4_ = _tmp0_;
	if (_tmp4_) {
		GamesScores* _tmp5_;
		Game* _tmp6_;
		gint _tmp7_;
		_tmp5_ = self->priv->high_scores;
		_tmp6_ = self->priv->game;
		_tmp7_ = _tmp6_->score;
		games_scores_add_plain_score (_tmp5_, (guint32) _tmp7_);
	}
	gtk_main_quit ();
}


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


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


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


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


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


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


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


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


static void quadrapassel_complete_cb (Quadrapassel* self) {
	GamesPauseAction* _tmp0_;
	Game* _tmp1_;
	gint _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->pause_action;
	gtk_action_set_sensitive ((GtkAction*) _tmp0_, FALSE);
	_tmp1_ = self->priv->game;
	_tmp2_ = _tmp1_->score;
	if (_tmp2_ > 0) {
		GamesScores* _tmp3_;
		Game* _tmp4_;
		gint _tmp5_;
		gint _tmp6_ = 0;
		gint pos;
		GtkWindow* _tmp7_;
		GamesScores* _tmp8_;
		const gchar* _tmp9_ = NULL;
		GamesScoresDialog* _tmp10_;
		GamesScoresDialog* _tmp11_;
		GamesScoresDialog* dialog;
		const gchar* _tmp12_ = NULL;
		gchar* _tmp13_;
		gchar* title;
		const gchar* _tmp14_ = NULL;
		gchar* _tmp15_;
		gchar* message;
		gint _tmp16_;
		GamesScoresDialog* _tmp22_;
		const gchar* _tmp23_;
		const gchar* _tmp24_;
		gchar* _tmp25_ = NULL;
		gchar* _tmp26_;
		GamesScoresDialog* _tmp27_;
		gint _tmp28_;
		GamesScoresDialog* _tmp31_;
		gint _tmp32_ = 0;
		GamesScoresDialog* _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->main_window;
		_tmp8_ = self->priv->high_scores;
		_tmp9_ = _ ("Quadrapassel Scores");
		_tmp10_ = games_scores_dialog_new (_tmp7_, _tmp8_, _tmp9_);
		_tmp11_ = g_object_ref_sink (_tmp10_);
		dialog = _tmp11_;
		_tmp12_ = _ ("Puzzle solved!");
		_tmp13_ = g_strdup (_tmp12_);
		title = _tmp13_;
		_tmp14_ = _ ("You didn't make the top ten, better luck next time.");
		_tmp15_ = g_strdup (_tmp14_);
		message = _tmp15_;
		_tmp16_ = pos;
		if (_tmp16_ == 1) {
			const gchar* _tmp17_ = NULL;
			gchar* _tmp18_;
			_tmp17_ = _ ("Your score is the best!");
			_tmp18_ = g_strdup (_tmp17_);
			_g_free0 (message);
			message = _tmp18_;
		} else {
			gint _tmp19_;
			_tmp19_ = pos;
			if (_tmp19_ > 1) {
				const gchar* _tmp20_ = NULL;
				gchar* _tmp21_;
				_tmp20_ = _ ("Your score has made the top ten.");
				_tmp21_ = g_strdup (_tmp20_);
				_g_free0 (message);
				message = _tmp21_;
			}
		}
		_tmp22_ = dialog;
		_tmp23_ = title;
		_tmp24_ = message;
		_tmp25_ = g_strdup_printf ("<b>%s</b>\n\n%s", _tmp23_, _tmp24_);
		_tmp26_ = _tmp25_;
		games_scores_dialog_set_message (_tmp22_, _tmp26_);
		_g_free0 (_tmp26_);
		_tmp27_ = dialog;
		games_scores_dialog_set_buttons (_tmp27_, (guint) (GAMES_SCORES_QUIT_BUTTON | GAMES_SCORES_NEW_GAME_BUTTON));
		_tmp28_ = pos;
		if (_tmp28_ > 0) {
			GamesScoresDialog* _tmp29_;
			gint _tmp30_;
			_tmp29_ = dialog;
			_tmp30_ = pos;
			games_scores_dialog_set_hilight (_tmp29_, (guint) _tmp30_);
		}
		_tmp31_ = dialog;
		_tmp32_ = gtk_dialog_run ((GtkDialog*) _tmp31_);
		switch (_tmp32_) {
			case GTK_RESPONSE_REJECT:
			{
				gtk_main_quit ();
				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, GtkAction* action) {
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	{
		GtkWindow* _tmp0_;
		GdkScreen* _tmp1_ = NULL;
		guint32 _tmp2_ = 0U;
		_tmp0_ = self->priv->main_window;
		_tmp1_ = gtk_window_get_screen (_tmp0_);
		_tmp2_ = gtk_get_current_event_time ();
		gtk_show_uri (_tmp1_, "ghelp:quadrapassel", _tmp2_, &_inner_error_);
		if (_inner_error_ != NULL) {
			goto __catch1_g_error;
		}
	}
	goto __finally1;
	__catch1_g_error:
	{
		GError* e = NULL;
		GError* _tmp3_;
		const gchar* _tmp4_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp3_ = e;
		_tmp4_ = _tmp3_->message;
		g_warning ("quadrapassel.vala:642: Failed to show help: %s", _tmp4_);
		_g_error_free0 (e);
	}
	__finally1:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
}


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


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


gint quadrapassel_main (gchar** args, int args_length1) {
	gint result = 0;
	GOptionContext* _tmp0_;
	GOptionContext* context;
	GOptionContext* _tmp1_;
	GOptionGroup* _tmp2_ = NULL;
	GOptionContext* _tmp3_;
	GOptionGroup* _tmp4_ = NULL;
	const gchar* _tmp9_ = NULL;
	Quadrapassel* _tmp20_;
	Quadrapassel* app;
	Quadrapassel* _tmp21_;
	GError * _inner_error_ = NULL;
	setlocale (LC_ALL, "");
	bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
	textdomain (GETTEXT_PACKAGE);
	games_scores_startup ();
	_tmp0_ = g_option_context_new ("");
	context = _tmp0_;
	_tmp1_ = context;
	_tmp2_ = gtk_get_option_group (TRUE);
	g_option_context_add_group (_tmp1_, _tmp2_);
	_tmp3_ = context;
	_tmp4_ = clutter_get_option_group_without_init ();
	g_option_context_add_group (_tmp3_, _tmp4_);
	{
		GOptionContext* _tmp5_;
		_tmp5_ = context;
		g_option_context_parse (_tmp5_, &args_length1, &args, &_inner_error_);
		if (_inner_error_ != NULL) {
			goto __catch2_g_error;
		}
	}
	goto __finally2;
	__catch2_g_error:
	{
		GError* e = NULL;
		FILE* _tmp6_;
		GError* _tmp7_;
		const gchar* _tmp8_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp6_ = stderr;
		_tmp7_ = e;
		_tmp8_ = _tmp7_->message;
		fprintf (_tmp6_, "%s\n", _tmp8_);
		result = EXIT_FAILURE;
		_g_error_free0 (e);
		_g_option_context_free0 (context);
		return result;
	}
	__finally2:
	if (_inner_error_ != NULL) {
		_g_option_context_free0 (context);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return 0;
	}
	_tmp9_ = _ ("Quadrapassel");
	g_set_application_name (_tmp9_);
	gtk_window_set_default_icon_name ("quadrapassel");
	{
		GOptionEntry* _tmp10_ = NULL;
		GOptionEntry* _tmp11_;
		gint _tmp11__length1;
		_tmp10_ = g_new0 (GOptionEntry, 0);
		_tmp11_ = _tmp10_;
		_tmp11__length1 = 0;
		gtk_clutter_init_with_args (&args_length1, &args, "", _tmp11_, NULL, &_inner_error_);
		_tmp11_ = (g_free (_tmp11_), NULL);
		if (_inner_error_ != NULL) {
			goto __catch3_g_error;
		}
	}
	goto __finally3;
	__catch3_g_error:
	{
		GError* e = NULL;
		GError* _tmp12_;
		const gchar* _tmp13_;
		GtkMessageDialog* _tmp14_;
		GtkMessageDialog* _tmp15_;
		GtkMessageDialog* dialog;
		GtkMessageDialog* _tmp16_;
		const gchar* _tmp17_ = NULL;
		GtkMessageDialog* _tmp18_;
		GtkMessageDialog* _tmp19_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp12_ = e;
		_tmp13_ = _tmp12_->message;
		_tmp14_ = (GtkMessageDialog*) gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_NONE, "Unable to initialize Clutter:\n%s", _tmp13_);
		_tmp15_ = g_object_ref_sink (_tmp14_);
		dialog = _tmp15_;
		_tmp16_ = dialog;
		_tmp17_ = g_get_application_name ();
		gtk_window_set_title ((GtkWindow*) _tmp16_, _tmp17_);
		_tmp18_ = dialog;
		gtk_dialog_run ((GtkDialog*) _tmp18_);
		_tmp19_ = dialog;
		gtk_widget_destroy ((GtkWidget*) _tmp19_);
		result = EXIT_FAILURE;
		_g_object_unref0 (dialog);
		_g_error_free0 (e);
		_g_option_context_free0 (context);
		return result;
	}
	__finally3:
	if (_inner_error_ != NULL) {
		_g_option_context_free0 (context);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return 0;
	}
	_tmp20_ = quadrapassel_new ();
	app = _tmp20_;
	_tmp21_ = app;
	quadrapassel_show (_tmp21_);
	gtk_main ();
	result = EXIT_SUCCESS;
	_quadrapassel_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 value_quadrapassel_init (GValue* value) {
	value->data[0].v_pointer = NULL;
}


static void value_quadrapassel_free_value (GValue* value) {
	if (value->data[0].v_pointer) {
		quadrapassel_unref (value->data[0].v_pointer);
	}
}


static void value_quadrapassel_copy_value (const GValue* src_value, GValue* dest_value) {
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = quadrapassel_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}


static gpointer value_quadrapassel_peek_pointer (const GValue* value) {
	return value->data[0].v_pointer;
}


static gchar* value_quadrapassel_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	if (collect_values[0].v_pointer) {
		Quadrapassel* object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = quadrapassel_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}


static gchar* value_quadrapassel_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	Quadrapassel** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = quadrapassel_ref (value->data[0].v_pointer);
	}
	return NULL;
}


GParamSpec* param_spec_quadrapassel (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	ParamSpecQuadrapassel* spec;
	g_return_val_if_fail (g_type_is_a (object_type, TYPE_QUADRAPASSEL), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}


gpointer value_get_quadrapassel (const GValue* value) {
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_QUADRAPASSEL), NULL);
	return value->data[0].v_pointer;
}


void value_set_quadrapassel (GValue* value, gpointer v_object) {
	Quadrapassel* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_QUADRAPASSEL));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_QUADRAPASSEL));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		quadrapassel_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		quadrapassel_unref (old);
	}
}


void value_take_quadrapassel (GValue* value, gpointer v_object) {
	Quadrapassel* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_QUADRAPASSEL));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_QUADRAPASSEL));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		quadrapassel_unref (old);
	}
}


static void quadrapassel_class_init (QuadrapasselClass * klass) {
	quadrapassel_parent_class = g_type_class_peek_parent (klass);
	QUADRAPASSEL_CLASS (klass)->finalize = quadrapassel_finalize;
	g_type_class_add_private (klass, sizeof (QuadrapasselPrivate));
}


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


static void quadrapassel_finalize (Quadrapassel* obj) {
	Quadrapassel * self;
	self = QUADRAPASSEL (obj);
	_g_object_unref0 (self->priv->settings);
	_g_object_unref0 (self->priv->main_window);
	_g_object_unref0 (self->priv->game);
	_g_object_unref0 (self->priv->view);
	_g_object_unref0 (self->priv->preview);
	_g_object_unref0 (self->priv->score_label);
	_g_object_unref0 (self->priv->n_destroyed_label);
	_g_object_unref0 (self->priv->level_label);
	_g_object_unref0 (self->priv->high_scores);
	_g_object_unref0 (self->priv->pause_action);
	_g_object_unref0 (self->priv->fullscreen_action);
	_g_object_unref0 (self->priv->preferences_dialog);
	_g_object_unref0 (self->priv->starting_level_spin);
	_g_object_unref0 (self->priv->theme_preview);
	_g_object_unref0 (self->priv->fill_height_spinner);
	_g_object_unref0 (self->priv->fill_prob_spinner);
	_g_object_unref0 (self->priv->do_preview_toggle);
	_g_object_unref0 (self->priv->difficult_blocks_toggle);
	_g_object_unref0 (self->priv->rotate_counter_clock_wise_toggle);
	_g_object_unref0 (self->priv->show_shadow_toggle);
	_g_object_unref0 (self->priv->sound_toggle);
}


GType quadrapassel_get_type (void) {
	static volatile gsize quadrapassel_type_id__volatile = 0;
	if (g_once_init_enter (&quadrapassel_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { value_quadrapassel_init, value_quadrapassel_free_value, value_quadrapassel_copy_value, value_quadrapassel_peek_pointer, "p", value_quadrapassel_collect_value, "p", value_quadrapassel_lcopy_value };
		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, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType quadrapassel_type_id;
		quadrapassel_type_id = g_type_register_fundamental (g_type_fundamental_next (), "Quadrapassel", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&quadrapassel_type_id__volatile, quadrapassel_type_id);
	}
	return quadrapassel_type_id__volatile;
}


gpointer quadrapassel_ref (gpointer instance) {
	Quadrapassel* self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}


void quadrapassel_unref (gpointer instance) {
	Quadrapassel* self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		QUADRAPASSEL_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}


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



