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


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


#define TYPE_GNO_MINE (gno_mine_get_type ())
#define GNO_MINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_GNO_MINE, GnoMine))
#define GNO_MINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GNO_MINE, GnoMineClass))
#define IS_GNO_MINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_GNO_MINE))
#define IS_GNO_MINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GNO_MINE))
#define GNO_MINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_GNO_MINE, GnoMineClass))

typedef struct _GnoMine GnoMine;
typedef struct _GnoMineClass GnoMineClass;
typedef struct _GnoMinePrivate GnoMinePrivate;

#define TYPE_MINEFIELD (minefield_get_type ())
#define MINEFIELD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MINEFIELD, Minefield))
#define MINEFIELD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MINEFIELD, MinefieldClass))
#define IS_MINEFIELD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MINEFIELD))
#define IS_MINEFIELD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MINEFIELD))
#define MINEFIELD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MINEFIELD, MinefieldClass))

typedef struct _Minefield Minefield;
typedef struct _MinefieldClass MinefieldClass;

#define TYPE_MINEFIELD_VIEW (minefield_view_get_type ())
#define MINEFIELD_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MINEFIELD_VIEW, MinefieldView))
#define MINEFIELD_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MINEFIELD_VIEW, MinefieldViewClass))
#define IS_MINEFIELD_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MINEFIELD_VIEW))
#define IS_MINEFIELD_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MINEFIELD_VIEW))
#define MINEFIELD_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MINEFIELD_VIEW, MinefieldViewClass))

typedef struct _MinefieldView MinefieldView;
typedef struct _MinefieldViewClass MinefieldViewClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _minefield_unref0(var) ((var == NULL) ? NULL : (var = (minefield_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _MinefieldPrivate MinefieldPrivate;
#define _g_option_context_free0(var) ((var == NULL) ? NULL : (var = (g_option_context_free (var), NULL)))

struct _GnoMine {
	GtkApplication parent_instance;
	GnoMinePrivate * priv;
};

struct _GnoMineClass {
	GtkApplicationClass parent_class;
};

struct _GnoMinePrivate {
	GSettings* settings;
	GtkToolButton* face_button;
	GtkImage* win_face_image;
	GtkImage* sad_face_image;
	GtkImage* smile_face_image;
	GtkImage* cool_face_image;
	GtkImage* worried_face_image;
	GtkWindow* window;
	Minefield* minefield;
	MinefieldView* minefield_view;
	GtkDialog* pref_dialog;
	GtkLabel* flag_label;
	GtkSpinButton* n_mines_spin;
	GamesClock* clock;
	GtkAction* hint_action;
	GamesFullscreenAction* fullscreen_action;
	GamesPauseAction* pause_action;
	GtkAspectFrame* new_game_screen;
	GtkAspectFrame* custom_game_screen;
	gboolean is_new_game_screen;
	GamesScores* highscores;
};

struct _Minefield {
	GTypeInstance parent_instance;
	volatile int ref_count;
	MinefieldPrivate * priv;
	guint width;
	guint height;
	guint n_mines;
	gboolean exploded;
};

struct _MinefieldClass {
	GTypeClass parent_class;
	void (*finalize) (Minefield *self);
};


static gpointer gno_mine_parent_class = NULL;

GType gno_mine_get_type (void) G_GNUC_CONST;
gpointer minefield_ref (gpointer instance);
void minefield_unref (gpointer instance);
GParamSpec* param_spec_minefield (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_minefield (GValue* value, gpointer v_object);
void value_take_minefield (GValue* value, gpointer v_object);
gpointer value_get_minefield (const GValue* value);
GType minefield_get_type (void) G_GNUC_CONST;
GType minefield_view_get_type (void) G_GNUC_CONST;
#define GNO_MINE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_GNO_MINE, GnoMinePrivate))
enum  {
	GNO_MINE_DUMMY_PROPERTY
};
#define GNO_MINE_KEY_XSIZE "xsize"
#define GNO_MINE_XSIZE_MIN 4
#define GNO_MINE_XSIZE_MAX 100
#define GNO_MINE_KEY_YSIZE "ysize"
#define GNO_MINE_YSIZE_MIN 4
#define GNO_MINE_YSIZE_MAX 100
#define GNO_MINE_KEY_NMINES "nmines"
#define GNO_MINE_KEY_MODE "mode"
#define GNO_MINE_KEY_USE_QUESTION_MARKS "use-question-marks"
#define GNO_MINE_KEY_USE_OVERMINE_WARNING "use-overmine-warning"
#define GNO_MINE_KEY_USE_AUTOFLAG "use-autoflag"
static void gno_mine_new_game_cb (GnoMine* self);
static void _gno_mine_new_game_cb_gtk_action_callback (GtkAction* action, gpointer self);
static void gno_mine_hint_cb (GnoMine* self);
static void _gno_mine_hint_cb_gtk_action_callback (GtkAction* action, gpointer self);
static void gno_mine_scores_cb (GnoMine* self);
static void _gno_mine_scores_cb_gtk_action_callback (GtkAction* action, gpointer self);
static void gno_mine_quit_game_cb (GnoMine* self);
static void _gno_mine_quit_game_cb_gtk_action_callback (GtkAction* action, gpointer self);
static void gno_mine_preferences_cb (GnoMine* self);
static void _gno_mine_preferences_cb_gtk_action_callback (GtkAction* action, gpointer self);
static void gno_mine_help_cb (GnoMine* self);
static void _gno_mine_help_cb_gtk_action_callback (GtkAction* action, gpointer self);
static void gno_mine_about_cb (GnoMine* self);
static void _gno_mine_about_cb_gtk_action_callback (GtkAction* action, gpointer self);
#define GNO_MINE_ui_description "<ui>" "    <menubar name='MainMenu'>" "        <menu action='GameMenu'>" "            <menuitem action='NewGame'/>" "            <menuitem action='Hint'/>" "            <menuitem action='PauseGame'/>" "            <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='Hint'/>" "        <toolitem action='PauseGame'/>" "        <toolitem action='Fullscreen'/>" "    </toolbar>" "</ui>"
GnoMine* gno_mine_new (void);
GnoMine* gno_mine_construct (GType object_type);
static void gno_mine_pause_cb (GnoMine* self, GtkAction* action);
static void _gno_mine_pause_cb_games_pause_action_state_changed (GamesPauseAction* _sender, gpointer self);
static GtkImage* gno_mine_load_face_image (GnoMine* self, const gchar* name);
static void gno_mine_set_face_image (GnoMine* self, GtkImage* face_image);
MinefieldView* minefield_view_new (void);
MinefieldView* minefield_view_construct (GType object_type);
void minefield_view_set_use_question_marks (MinefieldView* self, gboolean use_question_marks);
void minefield_view_set_use_overmine_warning (MinefieldView* self, gboolean use_overmine_warning);
void minefield_view_set_use_autoflag (MinefieldView* self, gboolean use_autoflag);
static gboolean gno_mine_view_button_press_event (GnoMine* self, GtkWidget* widget, GdkEventButton* event);
static gboolean _gno_mine_view_button_press_event_gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self);
static void gno_mine_look_cb (GnoMine* self, MinefieldView* minefield_view);
static void _gno_mine_look_cb_minefield_view_look (MinefieldView* _sender, gpointer self);
static void gno_mine_unlook_cb (GnoMine* self, MinefieldView* minefield_view);
static void _gno_mine_unlook_cb_minefield_view_unlook (MinefieldView* _sender, gpointer self);
static void gno_mine_small_size_clicked_cb (GnoMine* self);
static void _gno_mine_small_size_clicked_cb_gtk_button_clicked (GtkButton* _sender, gpointer self);
static void gno_mine_medium_size_clicked_cb (GnoMine* self);
static void _gno_mine_medium_size_clicked_cb_gtk_button_clicked (GtkButton* _sender, gpointer self);
static void gno_mine_large_size_clicked_cb (GnoMine* self);
static void _gno_mine_large_size_clicked_cb_gtk_button_clicked (GtkButton* _sender, gpointer self);
static void gno_mine_show_custom_game_screen (GnoMine* self);
static void _gno_mine_show_custom_game_screen_gtk_button_clicked (GtkButton* _sender, gpointer self);
static void gno_mine_xsize_spin_cb (GnoMine* self, GtkSpinButton* spin);
static void _gno_mine_xsize_spin_cb_gtk_spin_button_value_changed (GtkSpinButton* _sender, gpointer self);
static void gno_mine_ysize_spin_cb (GnoMine* self, GtkSpinButton* spin);
static void _gno_mine_ysize_spin_cb_gtk_spin_button_value_changed (GtkSpinButton* _sender, gpointer self);
static void gno_mine_n_mines_spin_cb (GnoMine* self, GtkSpinButton* spin);
static void _gno_mine_n_mines_spin_cb_gtk_spin_button_value_changed (GtkSpinButton* _sender, gpointer self);
static void gno_mine_set_n_mines_limit (GnoMine* self);
static void gno_mine_show_new_game_screen (GnoMine* self);
static void _gno_mine_show_new_game_screen_gtk_button_clicked (GtkButton* _sender, gpointer self);
static void gno_mine_custom_size_clicked_cb (GnoMine* self);
static void _gno_mine_custom_size_clicked_cb_gtk_button_clicked (GtkButton* _sender, gpointer self);
void gno_mine_start (GnoMine* self);
static void gno_mine_real_activate (GApplication* base);
static void gno_mine_update_flag_label (GnoMine* self);
guint minefield_get_n_flags (Minefield* self);
static gint gno_mine_show_scores (GnoMine* self, gint pos, gboolean endofgame);
guint minefield_get_n_cleared (Minefield* self);
gboolean minefield_get_is_complete (Minefield* self);
void minefield_view_set_paused (MinefieldView* self, gboolean value);
static void gno_mine_new_game (GnoMine* self);
Minefield* minefield_new (guint width, guint height, guint n_mines);
Minefield* minefield_construct (GType object_type, guint width, guint height, guint n_mines);
static void gno_mine_marks_changed_cb (GnoMine* self, Minefield* minefield);
static void _gno_mine_marks_changed_cb_minefield_marks_changed (Minefield* _sender, gpointer self);
static void gno_mine_explode_cb (GnoMine* self, Minefield* minefield);
static void _gno_mine_explode_cb_minefield_explode (Minefield* _sender, gpointer self);
static void gno_mine_cleared_cb (GnoMine* self, Minefield* minefield);
static void _gno_mine_cleared_cb_minefield_cleared (Minefield* _sender, gpointer self);
void minefield_view_set_minefield (MinefieldView* self, Minefield* value);
void minefield_hint (Minefield* self, guint* x, guint* y);
void minefield_clear_mine (Minefield* self, guint x, guint y);
static void gno_mine_use_question_toggle_cb (GnoMine* self, GtkToggleButton* button);
static void gno_mine_use_overmine_toggle_cb (GnoMine* self, GtkToggleButton* button);
static GtkDialog* gno_mine_create_preferences (GnoMine* self);
static void _gno_mine_use_question_toggle_cb_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self);
static void _gno_mine_use_overmine_toggle_cb_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self);
static void gno_mine_pref_response_cb (GnoMine* self, GtkDialog* dialog, gint response_id);
static void _gno_mine_pref_response_cb_gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self);
static gboolean gno_mine_pref_delete_event_cb (GnoMine* self, GtkWidget* widget, GdkEventAny* event);
static gboolean _gno_mine_pref_delete_event_cb_gtk_widget_delete_event (GtkWidget* _sender, GdkEventAny* event, gpointer self);
static void gno_mine_set_mode (GnoMine* self, gint mode);
gint gno_mine_main (gchar** args, int args_length1);
static void gno_mine_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 GamesScoresCategory GNO_MINE_scorecats[4] = {{"Small", "Small"}, {"Medium", "Medium"}, {"Large", "Large"}, {"Custom", "Custom"}};
static const GtkActionEntry GNO_MINE_actions[10] = {{"GameMenu", NULL, "_Game"}, {"SettingsMenu", NULL, "_Settings"}, {"HelpMenu", NULL, "_Help"}, {"NewGame", GAMES_STOCK_NEW_GAME, NULL, NULL, "Start a new game", (GCallback) _gno_mine_new_game_cb_gtk_action_callback}, {"Hint", GAMES_STOCK_HINT, NULL, NULL, "Show a hint", (GCallback) _gno_mine_hint_cb_gtk_action_callback}, {"Scores", GAMES_STOCK_SCORES, NULL, NULL, NULL, (GCallback) _gno_mine_scores_cb_gtk_action_callback}, {"Quit", GTK_STOCK_QUIT, NULL, NULL, NULL, (GCallback) _gno_mine_quit_game_cb_gtk_action_callback}, {"Preferences", GTK_STOCK_PREFERENCES, NULL, NULL, NULL, (GCallback) _gno_mine_preferences_cb_gtk_action_callback}, {"Contents", GAMES_STOCK_CONTENTS, NULL, NULL, NULL, (GCallback) _gno_mine_help_cb_gtk_action_callback}, {"About", GTK_STOCK_ABOUT, NULL, NULL, NULL, (GCallback) _gno_mine_about_cb_gtk_action_callback}};

static void _gno_mine_new_game_cb_gtk_action_callback (GtkAction* action, gpointer self) {
	gno_mine_new_game_cb (self);
}


static void _gno_mine_hint_cb_gtk_action_callback (GtkAction* action, gpointer self) {
	gno_mine_hint_cb (self);
}


static void _gno_mine_scores_cb_gtk_action_callback (GtkAction* action, gpointer self) {
	gno_mine_scores_cb (self);
}


static void _gno_mine_quit_game_cb_gtk_action_callback (GtkAction* action, gpointer self) {
	gno_mine_quit_game_cb (self);
}


static void _gno_mine_preferences_cb_gtk_action_callback (GtkAction* action, gpointer self) {
	gno_mine_preferences_cb (self);
}


static void _gno_mine_help_cb_gtk_action_callback (GtkAction* action, gpointer self) {
	gno_mine_help_cb (self);
}


static void _gno_mine_about_cb_gtk_action_callback (GtkAction* action, gpointer self) {
	gno_mine_about_cb (self);
}


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


static void _gno_mine_pause_cb_games_pause_action_state_changed (GamesPauseAction* _sender, gpointer self) {
	gno_mine_pause_cb (self, _sender);
}


static gboolean _gno_mine_view_button_press_event_gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self) {
	gboolean result;
	result = gno_mine_view_button_press_event (self, _sender, event);
	return result;
}


static void _gno_mine_look_cb_minefield_view_look (MinefieldView* _sender, gpointer self) {
	gno_mine_look_cb (self, _sender);
}


static void _gno_mine_unlook_cb_minefield_view_unlook (MinefieldView* _sender, gpointer self) {
	gno_mine_unlook_cb (self, _sender);
}


static void _gno_mine_small_size_clicked_cb_gtk_button_clicked (GtkButton* _sender, gpointer self) {
	gno_mine_small_size_clicked_cb (self);
}


static void _gno_mine_medium_size_clicked_cb_gtk_button_clicked (GtkButton* _sender, gpointer self) {
	gno_mine_medium_size_clicked_cb (self);
}


static void _gno_mine_large_size_clicked_cb_gtk_button_clicked (GtkButton* _sender, gpointer self) {
	gno_mine_large_size_clicked_cb (self);
}


static void _gno_mine_show_custom_game_screen_gtk_button_clicked (GtkButton* _sender, gpointer self) {
	gno_mine_show_custom_game_screen (self);
}


static void _gno_mine_xsize_spin_cb_gtk_spin_button_value_changed (GtkSpinButton* _sender, gpointer self) {
	gno_mine_xsize_spin_cb (self, _sender);
}


static void _gno_mine_ysize_spin_cb_gtk_spin_button_value_changed (GtkSpinButton* _sender, gpointer self) {
	gno_mine_ysize_spin_cb (self, _sender);
}


static void _gno_mine_n_mines_spin_cb_gtk_spin_button_value_changed (GtkSpinButton* _sender, gpointer self) {
	gno_mine_n_mines_spin_cb (self, _sender);
}


static void _gno_mine_show_new_game_screen_gtk_button_clicked (GtkButton* _sender, gpointer self) {
	gno_mine_show_new_game_screen (self);
}


static void _gno_mine_custom_size_clicked_cb_gtk_button_clicked (GtkButton* _sender, gpointer self) {
	gno_mine_custom_size_clicked_cb (self);
}


GnoMine* gno_mine_construct (GType object_type) {
	GnoMine * self = NULL;
	GSettings* _tmp0_;
	GamesScores* _tmp1_;
	GtkWindow* _tmp2_;
	GtkWindow* _tmp3_;
	GtkWindow* _tmp4_;
	const gchar* _tmp5_ = NULL;
	GtkWindow* _tmp6_;
	GtkWindow* _tmp7_;
	GtkBox* _tmp8_;
	GtkBox* _tmp9_;
	GtkBox* main_vbox;
	GtkWindow* _tmp10_;
	GtkActionGroup* _tmp11_;
	GtkActionGroup* action_group;
	GtkUIManager* _tmp12_;
	GtkUIManager* ui_manager;
	GtkAction* _tmp13_ = NULL;
	GtkAction* _tmp14_;
	GtkAction* _tmp15_;
	GtkAction* _tmp16_ = NULL;
	GtkWindow* _tmp17_;
	GamesFullscreenAction* _tmp18_;
	GamesFullscreenAction* _tmp19_;
	GamesPauseAction* _tmp20_;
	GamesPauseAction* _tmp21_;
	GamesPauseAction* _tmp22_;
	GtkWindow* _tmp23_;
	GtkAccelGroup* _tmp24_ = NULL;
	GtkWidget* _tmp25_ = NULL;
	GtkMenuBar* _tmp26_;
	GtkMenuBar* menubar;
	GtkBox* _tmp27_;
	GtkBox* _tmp28_;
	GtkBox* status_box;
	GtkLabel* _tmp29_;
	GtkLabel* _tmp30_;
	GtkLabel* _tmp31_;
	GtkLabel* _tmp32_;
	GtkBox* _tmp33_;
	GtkBox* _tmp34_;
	GtkBox* box;
	const gchar* _tmp35_ = NULL;
	GtkLabel* _tmp36_;
	GtkLabel* _tmp37_;
	GtkLabel* label;
	GtkLabel* _tmp38_;
	GtkLabel* _tmp39_;
	GamesClock* _tmp40_;
	GamesClock* _tmp41_;
	GamesClock* _tmp42_;
	GamesClock* _tmp43_;
	GtkAlignment* _tmp44_;
	GtkAlignment* _tmp45_;
	GtkAlignment* status_alignment;
	GtkToolItem* _tmp46_;
	GtkToolItem* _tmp47_;
	GtkToolItem* status_item;
	GtkImage* _tmp48_ = NULL;
	GtkImage* _tmp49_ = NULL;
	GtkImage* _tmp50_ = NULL;
	GtkImage* _tmp51_ = NULL;
	GtkImage* _tmp52_ = NULL;
	GtkWidget* _tmp53_ = NULL;
	GtkToolbar* _tmp54_;
	GtkToolbar* toolbar;
	GtkWidget* _tmp55_ = NULL;
	GtkToolButton* _tmp56_;
	GtkStyleContext* _tmp57_ = NULL;
	GtkImage* _tmp58_;
	GtkBox* _tmp59_;
	GtkBox* _tmp60_;
	GtkBox* view_box;
	MinefieldView* _tmp61_;
	MinefieldView* _tmp62_;
	MinefieldView* _tmp63_;
	GSettings* _tmp64_;
	gboolean _tmp65_ = FALSE;
	MinefieldView* _tmp66_;
	GSettings* _tmp67_;
	gboolean _tmp68_ = FALSE;
	MinefieldView* _tmp69_;
	GSettings* _tmp70_;
	gboolean _tmp71_ = FALSE;
	MinefieldView* _tmp72_;
	MinefieldView* _tmp73_;
	MinefieldView* _tmp74_;
	MinefieldView* _tmp75_;
	const gchar* _tmp76_ = NULL;
	GtkAspectFrame* _tmp77_;
	GtkAspectFrame* _tmp78_;
	GtkAspectFrame* _tmp79_;
	GtkAspectFrame* _tmp80_;
	GtkTable* _tmp81_;
	GtkTable* _tmp82_;
	GtkTable* new_game_table;
	GtkAspectFrame* _tmp83_;
	GtkButton* _tmp84_;
	GtkButton* _tmp85_;
	GtkButton* button_small;
	GtkLabel* _tmp86_;
	GtkLabel* _tmp87_;
	GtkLabel* _tmp88_;
	const gchar* _tmp89_ = NULL;
	gchar* _tmp90_;
	gchar* _tmp91_;
	gchar* _tmp92_;
	gchar* _tmp93_;
	GtkLabel* _tmp94_;
	GtkLabel* _tmp95_;
	GtkButton* _tmp96_;
	GtkButton* _tmp97_;
	GtkButton* button_medium;
	GtkLabel* _tmp98_;
	GtkLabel* _tmp99_;
	GtkLabel* _tmp100_;
	const gchar* _tmp101_ = NULL;
	gchar* _tmp102_;
	gchar* _tmp103_;
	gchar* _tmp104_;
	gchar* _tmp105_;
	GtkLabel* _tmp106_;
	GtkLabel* _tmp107_;
	GtkButton* _tmp108_;
	GtkButton* _tmp109_;
	GtkButton* button_large;
	GtkLabel* _tmp110_;
	GtkLabel* _tmp111_;
	GtkLabel* _tmp112_;
	const gchar* _tmp113_ = NULL;
	gchar* _tmp114_;
	gchar* _tmp115_;
	gchar* _tmp116_;
	gchar* _tmp117_;
	GtkLabel* _tmp118_;
	GtkLabel* _tmp119_;
	GtkButton* _tmp120_;
	GtkButton* _tmp121_;
	GtkButton* button_custom;
	GtkButton* _tmp122_;
	GtkButton* _tmp123_;
	GtkLabel* _tmp124_;
	GtkLabel* _tmp125_;
	GtkLabel* _tmp126_;
	const gchar* _tmp127_ = NULL;
	gchar* _tmp128_;
	gchar* _tmp129_;
	gchar* _tmp130_;
	gchar* _tmp131_;
	GtkLabel* _tmp132_;
	GtkButton* _tmp133_;
	GtkLabel* _tmp134_;
	GtkAspectFrame* _tmp135_;
	GtkAspectFrame* _tmp136_;
	GtkAspectFrame* _tmp137_;
	GtkAspectFrame* _tmp138_;
	GtkAspectFrame* _tmp139_;
	const gchar* _tmp140_ = NULL;
	GamesFrame* _tmp141_;
	GamesFrame* _tmp142_;
	GamesFrame* custom_game_frame;
	GtkAspectFrame* _tmp143_;
	GtkGrid* _tmp144_;
	GtkGrid* _tmp145_;
	GtkGrid* custom_field_grid;
	const gchar* _tmp146_ = NULL;
	GtkLabel* _tmp147_;
	GtkLabel* _tmp148_;
	GtkLabel* _tmp149_;
	GtkLabel* _tmp150_;
	GtkSpinButton* _tmp151_;
	GtkSpinButton* _tmp152_;
	GtkSpinButton* field_width_entry;
	GSettings* _tmp153_;
	gint _tmp154_ = 0;
	GtkLabel* _tmp155_;
	const gchar* _tmp156_ = NULL;
	GtkLabel* _tmp157_;
	GtkLabel* _tmp158_;
	GtkLabel* _tmp159_;
	GtkLabel* _tmp160_;
	GtkSpinButton* _tmp161_;
	GtkSpinButton* _tmp162_;
	GtkSpinButton* field_height_entry;
	GSettings* _tmp163_;
	gint _tmp164_ = 0;
	GtkLabel* _tmp165_;
	const gchar* _tmp166_ = NULL;
	GtkLabel* _tmp167_;
	GtkLabel* _tmp168_;
	GtkLabel* _tmp169_;
	GtkLabel* _tmp170_;
	GtkSpinButton* _tmp171_;
	GtkSpinButton* _tmp172_;
	GtkSpinButton* _tmp173_;
	GtkSpinButton* _tmp174_;
	GSettings* _tmp175_;
	gint _tmp176_ = 0;
	GtkSpinButton* _tmp177_;
	GtkLabel* _tmp178_;
	GtkSpinButton* _tmp179_;
	GtkHBox* _tmp180_;
	GtkHBox* _tmp181_;
	GtkHBox* hbox;
	GtkButton* _tmp182_;
	GtkButton* _tmp183_;
	GtkButton* button_back;
	GtkButton* _tmp184_;
	GtkButton* _tmp185_;
	GtkButton* _tmp186_;
	GtkImage* _tmp187_;
	GtkImage* _tmp188_;
	GtkButton* _tmp189_;
	GtkButton* _tmp190_;
	GtkAspectFrame* _tmp191_;
	GtkAspectFrame* _tmp192_;
	GtkAspectFrame* _tmp193_;
	GError * _inner_error_ = NULL;
	self = (GnoMine*) g_object_new (object_type, "application-id", "org.gnome.gnomine", "flags", G_APPLICATION_FLAGS_NONE, NULL);
	_tmp0_ = g_settings_new ("org.gnome.gnomine");
	_g_object_unref0 (self->priv->settings);
	self->priv->settings = _tmp0_;
	_tmp1_ = games_scores_new ("gnomine", GNO_MINE_scorecats, G_N_ELEMENTS (GNO_MINE_scorecats), "board size", NULL, 0, GAMES_SCORES_STYLE_TIME_ASCENDING);
	_g_object_unref0 (self->priv->highscores);
	self->priv->highscores = _tmp1_;
	gtk_window_set_default_icon_name ("gnome-mines");
	_tmp2_ = (GtkWindow*) gtk_window_new (GTK_WINDOW_TOPLEVEL);
	_tmp3_ = g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->window);
	self->priv->window = _tmp3_;
	_tmp4_ = self->priv->window;
	_tmp5_ = _ ("Mines");
	gtk_window_set_title (_tmp4_, _tmp5_);
	_tmp6_ = self->priv->window;
	games_settings_bind_window_state ("/org/gnome/gnomine/", _tmp6_);
	_tmp7_ = self->priv->window;
	gtk_application_add_window ((GtkApplication*) self, _tmp7_);
	games_stock_init ();
	_tmp8_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	_tmp9_ = g_object_ref_sink (_tmp8_);
	main_vbox = _tmp9_;
	_tmp10_ = self->priv->window;
	gtk_container_add ((GtkContainer*) _tmp10_, (GtkWidget*) main_vbox);
	gtk_widget_show ((GtkWidget*) main_vbox);
	_tmp11_ = gtk_action_group_new ("group");
	action_group = _tmp11_;
	gtk_action_group_set_translation_domain (action_group, GETTEXT_PACKAGE);
	gtk_action_group_add_actions (action_group, GNO_MINE_actions, G_N_ELEMENTS (GNO_MINE_actions), self);
	_tmp12_ = gtk_ui_manager_new ();
	ui_manager = _tmp12_;
	gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
	{
		gtk_ui_manager_add_ui_from_string (ui_manager, GNO_MINE_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 (main_vbox);
		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;
	}
	_tmp13_ = gtk_action_group_get_action (action_group, "Hint");
	_tmp14_ = _g_object_ref0 (_tmp13_);
	_g_object_unref0 (self->priv->hint_action);
	self->priv->hint_action = _tmp14_;
	_tmp15_ = self->priv->hint_action;
	gtk_action_set_is_important (_tmp15_, TRUE);
	_tmp16_ = gtk_action_group_get_action (action_group, "NewGame");
	gtk_action_set_is_important (_tmp16_, TRUE);
	_tmp17_ = self->priv->window;
	_tmp18_ = games_fullscreen_action_new ("Fullscreen", _tmp17_);
	_g_object_unref0 (self->priv->fullscreen_action);
	self->priv->fullscreen_action = _tmp18_;
	_tmp19_ = self->priv->fullscreen_action;
	gtk_action_group_add_action_with_accel (action_group, (GtkAction*) _tmp19_, NULL);
	_tmp20_ = games_pause_action_new ("PauseGame");
	_g_object_unref0 (self->priv->pause_action);
	self->priv->pause_action = _tmp20_;
	_tmp21_ = self->priv->pause_action;
	g_signal_connect_object (_tmp21_, "state-changed", (GCallback) _gno_mine_pause_cb_games_pause_action_state_changed, self, 0);
	_tmp22_ = self->priv->pause_action;
	gtk_action_group_add_action_with_accel (action_group, (GtkAction*) _tmp22_, NULL);
	_tmp23_ = self->priv->window;
	_tmp24_ = gtk_ui_manager_get_accel_group (ui_manager);
	gtk_window_add_accel_group (_tmp23_, _tmp24_);
	_tmp25_ = gtk_ui_manager_get_widget (ui_manager, "/MainMenu");
	_tmp26_ = _g_object_ref0 (GTK_MENU_BAR (_tmp25_));
	menubar = _tmp26_;
	gtk_widget_show ((GtkWidget*) menubar);
	gtk_box_pack_start (main_vbox, (GtkWidget*) menubar, FALSE, TRUE, (guint) 0);
	_tmp27_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
	_tmp28_ = g_object_ref_sink (_tmp27_);
	status_box = _tmp28_;
	gtk_widget_show ((GtkWidget*) status_box);
	_tmp29_ = (GtkLabel*) gtk_label_new ("");
	_tmp30_ = g_object_ref_sink (_tmp29_);
	_g_object_unref0 (self->priv->flag_label);
	self->priv->flag_label = _tmp30_;
	_tmp31_ = self->priv->flag_label;
	gtk_widget_show ((GtkWidget*) _tmp31_);
	_tmp32_ = self->priv->flag_label;
	gtk_box_pack_start (status_box, (GtkWidget*) _tmp32_, FALSE, FALSE, (guint) 0);
	_tmp33_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	_tmp34_ = g_object_ref_sink (_tmp33_);
	box = _tmp34_;
	gtk_widget_show ((GtkWidget*) box);
	gtk_box_pack_start (status_box, (GtkWidget*) box, FALSE, FALSE, (guint) 0);
	_tmp35_ = _ ("Time: ");
	_tmp36_ = (GtkLabel*) gtk_label_new (_tmp35_);
	_tmp37_ = g_object_ref_sink (_tmp36_);
	label = _tmp37_;
	_tmp38_ = label;
	gtk_box_pack_start (box, (GtkWidget*) _tmp38_, FALSE, FALSE, (guint) 0);
	_tmp39_ = label;
	gtk_widget_show ((GtkWidget*) _tmp39_);
	_tmp40_ = games_clock_new ();
	_tmp41_ = g_object_ref_sink (_tmp40_);
	_g_object_unref0 (self->priv->clock);
	self->priv->clock = _tmp41_;
	_tmp42_ = self->priv->clock;
	gtk_widget_show ((GtkWidget*) _tmp42_);
	_tmp43_ = self->priv->clock;
	gtk_box_pack_start (box, (GtkWidget*) _tmp43_, FALSE, FALSE, (guint) 0);
	_tmp44_ = (GtkAlignment*) gtk_alignment_new (1.0f, 0.5f, 0.0f, 0.0f);
	_tmp45_ = g_object_ref_sink (_tmp44_);
	status_alignment = _tmp45_;
	gtk_container_add ((GtkContainer*) status_alignment, (GtkWidget*) status_box);
	gtk_widget_show ((GtkWidget*) status_alignment);
	_tmp46_ = gtk_tool_item_new ();
	_tmp47_ = g_object_ref_sink (_tmp46_);
	status_item = _tmp47_;
	gtk_tool_item_set_expand (status_item, TRUE);
	gtk_container_add ((GtkContainer*) status_item, (GtkWidget*) status_alignment);
	gtk_widget_show ((GtkWidget*) status_item);
	_tmp48_ = gno_mine_load_face_image (self, "face-win.svg");
	_g_object_unref0 (self->priv->win_face_image);
	self->priv->win_face_image = _tmp48_;
	_tmp49_ = gno_mine_load_face_image (self, "face-sad.svg");
	_g_object_unref0 (self->priv->sad_face_image);
	self->priv->sad_face_image = _tmp49_;
	_tmp50_ = gno_mine_load_face_image (self, "face-smile.svg");
	_g_object_unref0 (self->priv->smile_face_image);
	self->priv->smile_face_image = _tmp50_;
	_tmp51_ = gno_mine_load_face_image (self, "face-cool.svg");
	_g_object_unref0 (self->priv->cool_face_image);
	self->priv->cool_face_image = _tmp51_;
	_tmp52_ = gno_mine_load_face_image (self, "face-worried.svg");
	_g_object_unref0 (self->priv->worried_face_image);
	self->priv->worried_face_image = _tmp52_;
	_tmp53_ = gtk_ui_manager_get_widget (ui_manager, "/Toolbar");
	_tmp54_ = _g_object_ref0 (GTK_TOOLBAR (_tmp53_));
	toolbar = _tmp54_;
	gtk_toolbar_set_show_arrow (toolbar, FALSE);
	_tmp55_ = gtk_ui_manager_get_widget (ui_manager, "/Toolbar/NewGame");
	_tmp56_ = _g_object_ref0 (GTK_TOOL_BUTTON (_tmp55_));
	_g_object_unref0 (self->priv->face_button);
	self->priv->face_button = _tmp56_;
	_tmp57_ = gtk_widget_get_style_context ((GtkWidget*) toolbar);
	gtk_style_context_add_class (_tmp57_, GTK_STYLE_CLASS_PRIMARY_TOOLBAR);
	_tmp58_ = self->priv->smile_face_image;
	gno_mine_set_face_image (self, _tmp58_);
	gtk_toolbar_insert (toolbar, status_item, -1);
	gtk_box_pack_start (main_vbox, (GtkWidget*) toolbar, FALSE, FALSE, (guint) 0);
	_tmp59_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	_tmp60_ = g_object_ref_sink (_tmp59_);
	view_box = _tmp60_;
	gtk_container_set_border_width ((GtkContainer*) view_box, (guint) 3);
	gtk_widget_show ((GtkWidget*) view_box);
	gtk_box_pack_start (main_vbox, (GtkWidget*) view_box, TRUE, TRUE, (guint) 0);
	_tmp61_ = minefield_view_new ();
	_tmp62_ = g_object_ref_sink (_tmp61_);
	_g_object_unref0 (self->priv->minefield_view);
	self->priv->minefield_view = _tmp62_;
	_tmp63_ = self->priv->minefield_view;
	_tmp64_ = self->priv->settings;
	_tmp65_ = g_settings_get_boolean (_tmp64_, GNO_MINE_KEY_USE_QUESTION_MARKS);
	minefield_view_set_use_question_marks (_tmp63_, _tmp65_);
	_tmp66_ = self->priv->minefield_view;
	_tmp67_ = self->priv->settings;
	_tmp68_ = g_settings_get_boolean (_tmp67_, GNO_MINE_KEY_USE_OVERMINE_WARNING);
	minefield_view_set_use_overmine_warning (_tmp66_, _tmp68_);
	_tmp69_ = self->priv->minefield_view;
	_tmp70_ = self->priv->settings;
	_tmp71_ = g_settings_get_boolean (_tmp70_, GNO_MINE_KEY_USE_AUTOFLAG);
	minefield_view_set_use_autoflag (_tmp69_, _tmp71_);
	_tmp72_ = self->priv->minefield_view;
	g_signal_connect_object ((GtkWidget*) _tmp72_, "button-press-event", (GCallback) _gno_mine_view_button_press_event_gtk_widget_button_press_event, self, 0);
	_tmp73_ = self->priv->minefield_view;
	g_signal_connect_object (_tmp73_, "look", (GCallback) _gno_mine_look_cb_minefield_view_look, self, 0);
	_tmp74_ = self->priv->minefield_view;
	g_signal_connect_object (_tmp74_, "unlook", (GCallback) _gno_mine_unlook_cb_minefield_view_unlook, self, 0);
	_tmp75_ = self->priv->minefield_view;
	gtk_box_pack_start (view_box, (GtkWidget*) _tmp75_, TRUE, TRUE, (guint) 0);
	_tmp76_ = _ ("Field Size");
	_tmp77_ = (GtkAspectFrame*) gtk_aspect_frame_new (_tmp76_, 0.5f, 0.5f, 1.0f, FALSE);
	_tmp78_ = g_object_ref_sink (_tmp77_);
	_g_object_unref0 (self->priv->new_game_screen);
	self->priv->new_game_screen = _tmp78_;
	_tmp79_ = self->priv->new_game_screen;
	gtk_frame_set_shadow_type ((GtkFrame*) _tmp79_, GTK_SHADOW_NONE);
	_tmp80_ = self->priv->new_game_screen;
	gtk_widget_set_size_request ((GtkWidget*) _tmp80_, 200, 200);
	_tmp81_ = (GtkTable*) gtk_table_new ((guint) 2, (guint) 2, TRUE);
	_tmp82_ = g_object_ref_sink (_tmp81_);
	new_game_table = _tmp82_;
	_tmp83_ = self->priv->new_game_screen;
	gtk_container_add ((GtkContainer*) _tmp83_, (GtkWidget*) new_game_table);
	_tmp84_ = (GtkButton*) gtk_button_new ();
	_tmp85_ = g_object_ref_sink (_tmp84_);
	button_small = _tmp85_;
	gtk_table_attach_defaults (new_game_table, (GtkWidget*) button_small, (guint) 0, (guint) 1, (guint) 0, (guint) 1);
	g_signal_connect_object (button_small, "clicked", (GCallback) _gno_mine_small_size_clicked_cb_gtk_button_clicked, self, 0);
	_tmp86_ = (GtkLabel*) gtk_label_new (NULL);
	_tmp87_ = g_object_ref_sink (_tmp86_);
	_g_object_unref0 (label);
	label = _tmp87_;
	_tmp88_ = label;
	_tmp89_ = _ ("Mines");
	_tmp90_ = g_strconcat ("<span fgcolor='#0000ff'><span size='x-large' weight='ultrabold'>8 x 8<" \
"/span>\n", _tmp89_, NULL);
	_tmp91_ = _tmp90_;
	_tmp92_ = g_strconcat (_tmp91_, ": <b>10</b></span>", NULL);
	_tmp93_ = _tmp92_;
	gtk_label_set_markup (_tmp88_, _tmp93_);
	_g_free0 (_tmp93_);
	_g_free0 (_tmp91_);
	_tmp94_ = label;
	gtk_label_set_justify (_tmp94_, GTK_JUSTIFY_CENTER);
	_tmp95_ = label;
	gtk_container_add ((GtkContainer*) button_small, (GtkWidget*) _tmp95_);
	_tmp96_ = (GtkButton*) gtk_button_new ();
	_tmp97_ = g_object_ref_sink (_tmp96_);
	button_medium = _tmp97_;
	gtk_table_attach_defaults (new_game_table, (GtkWidget*) button_medium, (guint) 1, (guint) 2, (guint) 0, (guint) 1);
	g_signal_connect_object (button_medium, "clicked", (GCallback) _gno_mine_medium_size_clicked_cb_gtk_button_clicked, self, 0);
	_tmp98_ = (GtkLabel*) gtk_label_new (NULL);
	_tmp99_ = g_object_ref_sink (_tmp98_);
	_g_object_unref0 (label);
	label = _tmp99_;
	_tmp100_ = label;
	_tmp101_ = _ ("Mines");
	_tmp102_ = g_strconcat ("<span fgcolor='#00a000'><span size='x-large' weight='ultrabold'>16 x 1" \
"6</span>\n", _tmp101_, NULL);
	_tmp103_ = _tmp102_;
	_tmp104_ = g_strconcat (_tmp103_, ": <b>40</b></span>", NULL);
	_tmp105_ = _tmp104_;
	gtk_label_set_markup (_tmp100_, _tmp105_);
	_g_free0 (_tmp105_);
	_g_free0 (_tmp103_);
	_tmp106_ = label;
	gtk_label_set_justify (_tmp106_, GTK_JUSTIFY_CENTER);
	_tmp107_ = label;
	gtk_container_add ((GtkContainer*) button_medium, (GtkWidget*) _tmp107_);
	_tmp108_ = (GtkButton*) gtk_button_new ();
	_tmp109_ = g_object_ref_sink (_tmp108_);
	button_large = _tmp109_;
	gtk_table_attach_defaults (new_game_table, (GtkWidget*) button_large, (guint) 0, (guint) 1, (guint) 1, (guint) 2);
	g_signal_connect_object (button_large, "clicked", (GCallback) _gno_mine_large_size_clicked_cb_gtk_button_clicked, self, 0);
	_tmp110_ = (GtkLabel*) gtk_label_new (NULL);
	_tmp111_ = g_object_ref_sink (_tmp110_);
	_g_object_unref0 (label);
	label = _tmp111_;
	_tmp112_ = label;
	_tmp113_ = _ ("Mines");
	_tmp114_ = g_strconcat ("<span fgcolor='#ff0000'><span size='x-large' weight='ultrabold'>30 x 1" \
"6</span>\n", _tmp113_, NULL);
	_tmp115_ = _tmp114_;
	_tmp116_ = g_strconcat (_tmp115_, ": <b>99</b></span>", NULL);
	_tmp117_ = _tmp116_;
	gtk_label_set_markup (_tmp112_, _tmp117_);
	_g_free0 (_tmp117_);
	_g_free0 (_tmp115_);
	_tmp118_ = label;
	gtk_label_set_justify (_tmp118_, GTK_JUSTIFY_CENTER);
	_tmp119_ = label;
	gtk_container_add ((GtkContainer*) button_large, (GtkWidget*) _tmp119_);
	_tmp120_ = (GtkButton*) gtk_button_new ();
	_tmp121_ = g_object_ref_sink (_tmp120_);
	button_custom = _tmp121_;
	_tmp122_ = button_custom;
	gtk_table_attach_defaults (new_game_table, (GtkWidget*) _tmp122_, (guint) 1, (guint) 2, (guint) 1, (guint) 2);
	_tmp123_ = button_custom;
	g_signal_connect_object (_tmp123_, "clicked", (GCallback) _gno_mine_show_custom_game_screen_gtk_button_clicked, self, 0);
	_tmp124_ = (GtkLabel*) gtk_label_new (NULL);
	_tmp125_ = g_object_ref_sink (_tmp124_);
	_g_object_unref0 (label);
	label = _tmp125_;
	_tmp126_ = label;
	_tmp127_ = g_dpgettext2 (NULL, "board size", "_Custom");
	_tmp128_ = g_strconcat ("<span fgcolor='#00007f'><span size='xx-large' weight='heavy'>?</span>\n", _tmp127_, NULL);
	_tmp129_ = _tmp128_;
	_tmp130_ = g_strconcat (_tmp129_, "</span>", NULL);
	_tmp131_ = _tmp130_;
	gtk_label_set_markup_with_mnemonic (_tmp126_, _tmp131_);
	_g_free0 (_tmp131_);
	_g_free0 (_tmp129_);
	_tmp132_ = label;
	gtk_label_set_justify (_tmp132_, GTK_JUSTIFY_CENTER);
	_tmp133_ = button_custom;
	_tmp134_ = label;
	gtk_container_add ((GtkContainer*) _tmp133_, (GtkWidget*) _tmp134_);
	_tmp135_ = self->priv->new_game_screen;
	gtk_widget_show_all ((GtkWidget*) _tmp135_);
	_tmp136_ = self->priv->new_game_screen;
	gtk_box_pack_start (view_box, (GtkWidget*) _tmp136_, TRUE, TRUE, (guint) 0);
	_tmp137_ = (GtkAspectFrame*) gtk_aspect_frame_new ("", 0.5f, 0.5f, 0.0f, TRUE);
	_tmp138_ = g_object_ref_sink (_tmp137_);
	_g_object_unref0 (self->priv->custom_game_screen);
	self->priv->custom_game_screen = _tmp138_;
	_tmp139_ = self->priv->custom_game_screen;
	gtk_frame_set_shadow_type ((GtkFrame*) _tmp139_, GTK_SHADOW_NONE);
	_tmp140_ = _ ("Custom Size");
	_tmp141_ = games_frame_new (_tmp140_);
	_tmp142_ = g_object_ref_sink (_tmp141_);
	custom_game_frame = _tmp142_;
	_tmp143_ = self->priv->custom_game_screen;
	gtk_container_add ((GtkContainer*) _tmp143_, (GtkWidget*) custom_game_frame);
	_tmp144_ = (GtkGrid*) gtk_grid_new ();
	_tmp145_ = g_object_ref_sink (_tmp144_);
	custom_field_grid = _tmp145_;
	gtk_grid_set_row_spacing (custom_field_grid, (guint) 6);
	gtk_grid_set_column_spacing (custom_field_grid, (guint) 12);
	gtk_container_add ((GtkContainer*) custom_game_frame, (GtkWidget*) custom_field_grid);
	_tmp146_ = _ ("H_orizontal:");
	_tmp147_ = (GtkLabel*) gtk_label_new_with_mnemonic (_tmp146_);
	_tmp148_ = g_object_ref_sink (_tmp147_);
	_g_object_unref0 (label);
	label = _tmp148_;
	_tmp149_ = label;
	gtk_misc_set_alignment ((GtkMisc*) _tmp149_, (gfloat) 0, 0.5f);
	_tmp150_ = label;
	gtk_grid_attach (custom_field_grid, (GtkWidget*) _tmp150_, 0, 0, 1, 1);
	_tmp151_ = (GtkSpinButton*) gtk_spin_button_new_with_range ((gdouble) GNO_MINE_XSIZE_MIN, (gdouble) GNO_MINE_XSIZE_MAX, (gdouble) 1);
	_tmp152_ = g_object_ref_sink (_tmp151_);
	field_width_entry = _tmp152_;
	g_signal_connect_object (field_width_entry, "value-changed", (GCallback) _gno_mine_xsize_spin_cb_gtk_spin_button_value_changed, self, 0);
	_tmp153_ = self->priv->settings;
	_tmp154_ = g_settings_get_int (_tmp153_, GNO_MINE_KEY_XSIZE);
	gtk_spin_button_set_value (field_width_entry, (gdouble) _tmp154_);
	gtk_grid_attach (custom_field_grid, (GtkWidget*) field_width_entry, 1, 0, 1, 1);
	_tmp155_ = label;
	gtk_label_set_mnemonic_widget (_tmp155_, (GtkWidget*) field_width_entry);
	_tmp156_ = _ ("_Vertical:");
	_tmp157_ = (GtkLabel*) gtk_label_new_with_mnemonic (_tmp156_);
	_tmp158_ = g_object_ref_sink (_tmp157_);
	_g_object_unref0 (label);
	label = _tmp158_;
	_tmp159_ = label;
	gtk_misc_set_alignment ((GtkMisc*) _tmp159_, (gfloat) 0, 0.5f);
	_tmp160_ = label;
	gtk_grid_attach (custom_field_grid, (GtkWidget*) _tmp160_, 0, 1, 1, 1);
	_tmp161_ = (GtkSpinButton*) gtk_spin_button_new_with_range ((gdouble) GNO_MINE_YSIZE_MIN, (gdouble) GNO_MINE_YSIZE_MAX, (gdouble) 1);
	_tmp162_ = g_object_ref_sink (_tmp161_);
	field_height_entry = _tmp162_;
	g_signal_connect_object (field_height_entry, "value-changed", (GCallback) _gno_mine_ysize_spin_cb_gtk_spin_button_value_changed, self, 0);
	_tmp163_ = self->priv->settings;
	_tmp164_ = g_settings_get_int (_tmp163_, GNO_MINE_KEY_YSIZE);
	gtk_spin_button_set_value (field_height_entry, (gdouble) _tmp164_);
	gtk_grid_attach (custom_field_grid, (GtkWidget*) field_height_entry, 1, 1, 1, 1);
	_tmp165_ = label;
	gtk_label_set_mnemonic_widget (_tmp165_, (GtkWidget*) field_height_entry);
	_tmp166_ = _ ("_Number of mines:");
	_tmp167_ = (GtkLabel*) gtk_label_new_with_mnemonic (_tmp166_);
	_tmp168_ = g_object_ref_sink (_tmp167_);
	_g_object_unref0 (label);
	label = _tmp168_;
	_tmp169_ = label;
	gtk_misc_set_alignment ((GtkMisc*) _tmp169_, (gfloat) 0, 0.5f);
	_tmp170_ = label;
	gtk_grid_attach (custom_field_grid, (GtkWidget*) _tmp170_, 0, 2, 1, 1);
	_tmp171_ = (GtkSpinButton*) gtk_spin_button_new_with_range ((gdouble) 1, (gdouble) (GNO_MINE_XSIZE_MAX * GNO_MINE_YSIZE_MAX), (gdouble) 1);
	_tmp172_ = g_object_ref_sink (_tmp171_);
	_g_object_unref0 (self->priv->n_mines_spin);
	self->priv->n_mines_spin = _tmp172_;
	_tmp173_ = self->priv->n_mines_spin;
	g_signal_connect_object (_tmp173_, "value-changed", (GCallback) _gno_mine_n_mines_spin_cb_gtk_spin_button_value_changed, self, 0);
	_tmp174_ = self->priv->n_mines_spin;
	_tmp175_ = self->priv->settings;
	_tmp176_ = g_settings_get_int (_tmp175_, GNO_MINE_KEY_NMINES);
	gtk_spin_button_set_value (_tmp174_, (gdouble) _tmp176_);
	_tmp177_ = self->priv->n_mines_spin;
	gtk_grid_attach (custom_field_grid, (GtkWidget*) _tmp177_, 1, 2, 1, 1);
	gno_mine_set_n_mines_limit (self);
	_tmp178_ = label;
	_tmp179_ = self->priv->n_mines_spin;
	gtk_label_set_mnemonic_widget (_tmp178_, (GtkWidget*) _tmp179_);
	_tmp180_ = (GtkHBox*) gtk_hbox_new (FALSE, 5);
	_tmp181_ = g_object_ref_sink (_tmp180_);
	hbox = _tmp181_;
	gtk_grid_attach (custom_field_grid, (GtkWidget*) hbox, 0, 3, 2, 1);
	_tmp182_ = (GtkButton*) gtk_button_new_from_stock (GTK_STOCK_CANCEL);
	_tmp183_ = g_object_ref_sink (_tmp182_);
	button_back = _tmp183_;
	g_signal_connect_object (button_back, "clicked", (GCallback) _gno_mine_show_new_game_screen_gtk_button_clicked, self, 0);
	gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) button_back, TRUE, TRUE, (guint) 0);
	_tmp184_ = (GtkButton*) gtk_button_new_with_mnemonic ("_Play Game");
	_tmp185_ = g_object_ref_sink (_tmp184_);
	_g_object_unref0 (button_custom);
	button_custom = _tmp185_;
	_tmp186_ = button_custom;
	_tmp187_ = (GtkImage*) gtk_image_new_from_stock (GTK_STOCK_GO_FORWARD, GTK_ICON_SIZE_BUTTON);
	_tmp188_ = g_object_ref_sink (_tmp187_);
	gtk_button_set_image (_tmp186_, (GtkWidget*) _tmp188_);
	_g_object_unref0 (_tmp188_);
	_tmp189_ = button_custom;
	g_signal_connect_object (_tmp189_, "clicked", (GCallback) _gno_mine_custom_size_clicked_cb_gtk_button_clicked, self, 0);
	_tmp190_ = button_custom;
	gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) _tmp190_, TRUE, TRUE, (guint) 0);
	_tmp191_ = self->priv->custom_game_screen;
	gtk_widget_show_all ((GtkWidget*) _tmp191_);
	_tmp192_ = self->priv->custom_game_screen;
	gtk_widget_hide ((GtkWidget*) _tmp192_);
	_tmp193_ = self->priv->custom_game_screen;
	gtk_box_pack_start (view_box, (GtkWidget*) _tmp193_, TRUE, FALSE, (guint) 0);
	_g_object_unref0 (button_back);
	_g_object_unref0 (hbox);
	_g_object_unref0 (field_height_entry);
	_g_object_unref0 (field_width_entry);
	_g_object_unref0 (custom_field_grid);
	_g_object_unref0 (custom_game_frame);
	_g_object_unref0 (button_custom);
	_g_object_unref0 (button_large);
	_g_object_unref0 (button_medium);
	_g_object_unref0 (button_small);
	_g_object_unref0 (new_game_table);
	_g_object_unref0 (view_box);
	_g_object_unref0 (toolbar);
	_g_object_unref0 (status_item);
	_g_object_unref0 (status_alignment);
	_g_object_unref0 (label);
	_g_object_unref0 (box);
	_g_object_unref0 (status_box);
	_g_object_unref0 (menubar);
	_g_object_unref0 (ui_manager);
	_g_object_unref0 (action_group);
	_g_object_unref0 (main_vbox);
	return self;
}


GnoMine* gno_mine_new (void) {
	return gno_mine_construct (TYPE_GNO_MINE);
}


void gno_mine_start (GnoMine* self) {
	GtkWindow* _tmp0_;
	GtkImage* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->window;
	gtk_widget_show ((GtkWidget*) _tmp0_);
	gno_mine_show_new_game_screen (self);
	_tmp1_ = self->priv->smile_face_image;
	gno_mine_set_face_image (self, _tmp1_);
}


static void gno_mine_real_activate (GApplication* base) {
	GnoMine * self;
	GtkWindow* _tmp0_;
	self = (GnoMine*) base;
	_tmp0_ = self->priv->window;
	gtk_widget_show ((GtkWidget*) _tmp0_);
}


static GtkImage* gno_mine_load_face_image (GnoMine* self, const gchar* name) {
	GtkImage* result = NULL;
	GtkImage* _tmp0_;
	GtkImage* _tmp1_;
	GtkImage* image;
	const gchar* _tmp2_;
	gchar* _tmp3_ = NULL;
	gchar* filename;
	const gchar* _tmp4_;
	GtkImage* _tmp7_;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	_tmp0_ = (GtkImage*) gtk_image_new ();
	_tmp1_ = g_object_ref_sink (_tmp0_);
	image = _tmp1_;
	_tmp2_ = name;
	_tmp3_ = g_build_filename (DATA_DIRECTORY, _tmp2_, NULL);
	filename = _tmp3_;
	_tmp4_ = filename;
	if (_tmp4_ != NULL) {
		GtkImage* _tmp5_;
		const gchar* _tmp6_;
		_tmp5_ = image;
		_tmp6_ = filename;
		gtk_image_set_from_file (_tmp5_, _tmp6_);
	}
	_tmp7_ = image;
	gtk_widget_show ((GtkWidget*) _tmp7_);
	result = image;
	_g_free0 (filename);
	return result;
}


static void gno_mine_set_face_image (GnoMine* self, GtkImage* face_image) {
	GtkToolButton* _tmp0_;
	GtkImage* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (face_image != NULL);
	_tmp0_ = self->priv->face_button;
	_tmp1_ = face_image;
	gtk_tool_button_set_icon_widget (_tmp0_, (GtkWidget*) _tmp1_);
}


static gboolean gno_mine_view_button_press_event (GnoMine* self, GtkWidget* widget, GdkEventButton* event) {
	gboolean result = FALSE;
	GamesPauseAction* _tmp0_;
	gboolean _tmp1_ = FALSE;
	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_ = self->priv->pause_action;
	_tmp1_ = games_pause_action_get_is_paused (_tmp0_);
	if (_tmp1_) {
		GamesPauseAction* _tmp2_;
		_tmp2_ = self->priv->pause_action;
		games_pause_action_set_is_paused (_tmp2_, FALSE);
		result = TRUE;
		return result;
	}
	result = FALSE;
	return result;
}


static void gno_mine_quit_game_cb (GnoMine* self) {
	GtkWindow* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->window;
	gtk_widget_destroy ((GtkWidget*) _tmp0_);
}


static void gno_mine_update_flag_label (GnoMine* self) {
	GtkLabel* _tmp0_;
	Minefield* _tmp1_;
	guint _tmp2_;
	guint _tmp3_;
	Minefield* _tmp4_;
	guint _tmp5_;
	gchar* _tmp6_ = NULL;
	gchar* _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->flag_label;
	_tmp1_ = self->priv->minefield;
	_tmp2_ = minefield_get_n_flags (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = self->priv->minefield;
	_tmp5_ = _tmp4_->n_mines;
	_tmp6_ = g_strdup_printf ("Flags: %u/%u", _tmp3_, _tmp5_);
	_tmp7_ = _tmp6_;
	gtk_label_set_text (_tmp0_, _tmp7_);
	_g_free0 (_tmp7_);
}


static gint gno_mine_show_scores (GnoMine* self, gint pos, gboolean endofgame) {
	gint result = 0;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	gboolean _tmp3_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp1_ = endofgame;
	if (_tmp1_) {
		gint _tmp2_;
		_tmp2_ = pos;
		_tmp0_ = _tmp2_ <= 0;
	} else {
		_tmp0_ = FALSE;
	}
	_tmp3_ = _tmp0_;
	if (_tmp3_) {
		GtkWindow* _tmp4_;
		const gchar* _tmp5_ = NULL;
		const gchar* _tmp6_ = NULL;
		GtkMessageDialog* _tmp7_;
		GtkMessageDialog* _tmp8_;
		GtkMessageDialog* dialog;
		GtkMessageDialog* _tmp9_;
		const gchar* _tmp10_ = NULL;
		GtkMessageDialog* _tmp11_;
		GtkMessageDialog* _tmp12_;
		GtkMessageDialog* _tmp13_;
		gint _tmp14_ = 0;
		gint _result_;
		GtkMessageDialog* _tmp15_;
		_tmp4_ = self->priv->window;
		_tmp5_ = _ ("The Mines Have Been Cleared!");
		_tmp6_ = _ ("Great work, but unfortunately your score did not make the top ten.");
		_tmp7_ = (GtkMessageDialog*) gtk_message_dialog_new_with_markup (_tmp4_, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_NONE, "<b>%s</b>\n%s", _tmp5_, _tmp6_);
		_tmp8_ = g_object_ref_sink (_tmp7_);
		dialog = _tmp8_;
		_tmp9_ = dialog;
		_tmp10_ = _ ("_New Game");
		gtk_dialog_add_buttons ((GtkDialog*) _tmp9_, GTK_STOCK_QUIT, GTK_RESPONSE_REJECT, _tmp10_, GTK_RESPONSE_ACCEPT, NULL, NULL);
		_tmp11_ = dialog;
		gtk_dialog_set_default_response ((GtkDialog*) _tmp11_, (gint) GTK_RESPONSE_ACCEPT);
		_tmp12_ = dialog;
		gtk_window_set_title ((GtkWindow*) _tmp12_, "");
		_tmp13_ = dialog;
		_tmp14_ = gtk_dialog_run ((GtkDialog*) _tmp13_);
		_result_ = _tmp14_;
		_tmp15_ = dialog;
		gtk_widget_destroy ((GtkWidget*) _tmp15_);
		result = _result_;
		_g_object_unref0 (dialog);
		return result;
	} else {
		GtkWindow* _tmp16_;
		GamesScores* _tmp17_;
		const gchar* _tmp18_ = NULL;
		GamesScoresDialog* _tmp19_;
		GamesScoresDialog* _tmp20_;
		GamesScoresDialog* dialog;
		GamesScoresDialog* _tmp21_;
		const gchar* _tmp22_ = NULL;
		gint _tmp23_;
		gboolean _tmp36_;
		GamesScoresDialog* _tmp39_;
		gint _tmp40_ = 0;
		gint _result_;
		GamesScoresDialog* _tmp41_;
		_tmp16_ = self->priv->window;
		_tmp17_ = self->priv->highscores;
		_tmp18_ = _ ("Mines Scores");
		_tmp19_ = games_scores_dialog_new (_tmp16_, _tmp17_, _tmp18_);
		_tmp20_ = g_object_ref_sink (_tmp19_);
		dialog = _tmp20_;
		_tmp21_ = dialog;
		_tmp22_ = _ ("Size:");
		games_scores_dialog_set_category_description (_tmp21_, _tmp22_);
		_tmp23_ = pos;
		if (_tmp23_ > 0) {
			GamesScoresDialog* _tmp24_;
			gint _tmp25_;
			const gchar* _tmp26_ = NULL;
			gint _tmp27_;
			const gchar* _tmp30_ = NULL;
			const gchar* _tmp31_;
			gchar* _tmp32_ = NULL;
			gchar* message;
			GamesScoresDialog* _tmp33_;
			const gchar* _tmp34_;
			_tmp24_ = dialog;
			_tmp25_ = pos;
			games_scores_dialog_set_hilight (_tmp24_, (guint) _tmp25_);
			_tmp27_ = pos;
			if (_tmp27_ == 1) {
				const gchar* _tmp28_ = NULL;
				_tmp28_ = _ ("Your score is the best!");
				_tmp26_ = _tmp28_;
			} else {
				const gchar* _tmp29_ = NULL;
				_tmp29_ = _ ("Your score has made the top ten.");
				_tmp26_ = _tmp29_;
			}
			_tmp30_ = _ ("Congratulations!");
			_tmp31_ = _tmp26_;
			_tmp32_ = g_strdup_printf ("<b>%s</b>\n\n%s", _tmp30_, _tmp31_);
			message = _tmp32_;
			_tmp33_ = dialog;
			_tmp34_ = message;
			games_scores_dialog_set_message (_tmp33_, _tmp34_);
			_g_free0 (message);
		} else {
			GamesScoresDialog* _tmp35_;
			_tmp35_ = dialog;
			games_scores_dialog_set_message (_tmp35_, NULL);
		}
		_tmp36_ = endofgame;
		if (_tmp36_) {
			GamesScoresDialog* _tmp37_;
			_tmp37_ = dialog;
			games_scores_dialog_set_buttons (_tmp37_, (guint) (GAMES_SCORES_QUIT_BUTTON | GAMES_SCORES_NEW_GAME_BUTTON));
		} else {
			GamesScoresDialog* _tmp38_;
			_tmp38_ = dialog;
			games_scores_dialog_set_buttons (_tmp38_, (guint) 0);
		}
		_tmp39_ = dialog;
		_tmp40_ = gtk_dialog_run ((GtkDialog*) _tmp39_);
		_result_ = _tmp40_;
		_tmp41_ = dialog;
		gtk_widget_destroy ((GtkWidget*) _tmp41_);
		result = _result_;
		_g_object_unref0 (dialog);
		return result;
	}
}


static void gno_mine_scores_cb (GnoMine* self) {
	g_return_if_fail (self != NULL);
	gno_mine_show_scores (self, 0, FALSE);
}


static void gno_mine_show_custom_game_screen (GnoMine* self) {
	GtkAspectFrame* _tmp0_;
	MinefieldView* _tmp1_;
	GtkAspectFrame* _tmp2_;
	g_return_if_fail (self != NULL);
	self->priv->is_new_game_screen = FALSE;
	_tmp0_ = self->priv->custom_game_screen;
	gtk_widget_show ((GtkWidget*) _tmp0_);
	_tmp1_ = self->priv->minefield_view;
	gtk_widget_hide ((GtkWidget*) _tmp1_);
	_tmp2_ = self->priv->new_game_screen;
	gtk_widget_hide ((GtkWidget*) _tmp2_);
}


static void gno_mine_show_new_game_screen (GnoMine* self) {
	gboolean _tmp0_;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	Minefield* _tmp4_;
	gboolean _tmp8_;
	gboolean _tmp11_;
	gboolean _tmp15_;
	GtkAspectFrame* _tmp27_;
	MinefieldView* _tmp28_;
	GtkAspectFrame* _tmp29_;
	GtkLabel* _tmp30_;
	GamesClock* _tmp31_;
	GamesClock* _tmp32_;
	GtkImage* _tmp33_;
	GtkAction* _tmp34_;
	GamesPauseAction* _tmp35_;
	MinefieldView* _tmp36_;
	GamesPauseAction* _tmp37_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->is_new_game_screen;
	if (_tmp0_) {
		return;
	}
	_tmp4_ = self->priv->minefield;
	if (_tmp4_ != NULL) {
		Minefield* _tmp5_;
		guint _tmp6_;
		guint _tmp7_;
		_tmp5_ = self->priv->minefield;
		_tmp6_ = minefield_get_n_cleared (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp3_ = _tmp7_ > ((guint) 0);
	} else {
		_tmp3_ = FALSE;
	}
	_tmp8_ = _tmp3_;
	if (_tmp8_) {
		Minefield* _tmp9_;
		gboolean _tmp10_;
		_tmp9_ = self->priv->minefield;
		_tmp10_ = _tmp9_->exploded;
		_tmp2_ = !_tmp10_;
	} else {
		_tmp2_ = FALSE;
	}
	_tmp11_ = _tmp2_;
	if (_tmp11_) {
		Minefield* _tmp12_;
		gboolean _tmp13_;
		gboolean _tmp14_;
		_tmp12_ = self->priv->minefield;
		_tmp13_ = minefield_get_is_complete (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp1_ = !_tmp14_;
	} else {
		_tmp1_ = FALSE;
	}
	_tmp15_ = _tmp1_;
	if (_tmp15_) {
		GtkWindow* _tmp16_;
		const gchar* _tmp17_ = NULL;
		GtkMessageDialog* _tmp18_;
		GtkMessageDialog* _tmp19_;
		GtkMessageDialog* dialog;
		GtkMessageDialog* _tmp20_;
		const gchar* _tmp21_ = NULL;
		const gchar* _tmp22_ = NULL;
		GtkMessageDialog* _tmp23_;
		gint _tmp24_ = 0;
		gint _result_;
		GtkMessageDialog* _tmp25_;
		gint _tmp26_;
		_tmp16_ = self->priv->window;
		_tmp17_ = _ ("Cancel current game?");
		_tmp18_ = (GtkMessageDialog*) gtk_message_dialog_new (_tmp16_, GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, "%s", _tmp17_);
		_tmp19_ = g_object_ref_sink (_tmp18_);
		dialog = _tmp19_;
		_tmp20_ = dialog;
		_tmp21_ = _ ("Start New Game");
		_tmp22_ = _ ("Keep Current Game");
		gtk_dialog_add_buttons ((GtkDialog*) _tmp20_, _tmp21_, GTK_RESPONSE_ACCEPT, _tmp22_, GTK_RESPONSE_REJECT, NULL, NULL);
		_tmp23_ = dialog;
		_tmp24_ = gtk_dialog_run ((GtkDialog*) _tmp23_);
		_result_ = _tmp24_;
		_tmp25_ = dialog;
		gtk_widget_destroy ((GtkWidget*) _tmp25_);
		_tmp26_ = _result_;
		if (_tmp26_ == ((gint) GTK_RESPONSE_REJECT)) {
			_g_object_unref0 (dialog);
			return;
		}
		_g_object_unref0 (dialog);
	}
	_minefield_unref0 (self->priv->minefield);
	self->priv->minefield = NULL;
	self->priv->is_new_game_screen = TRUE;
	_tmp27_ = self->priv->custom_game_screen;
	gtk_widget_hide ((GtkWidget*) _tmp27_);
	_tmp28_ = self->priv->minefield_view;
	gtk_widget_hide ((GtkWidget*) _tmp28_);
	_tmp29_ = self->priv->new_game_screen;
	gtk_widget_show ((GtkWidget*) _tmp29_);
	_tmp30_ = self->priv->flag_label;
	gtk_label_set_text (_tmp30_, "");
	_tmp31_ = self->priv->clock;
	games_clock_stop (_tmp31_);
	_tmp32_ = self->priv->clock;
	games_clock_reset (_tmp32_);
	_tmp33_ = self->priv->smile_face_image;
	gno_mine_set_face_image (self, _tmp33_);
	_tmp34_ = self->priv->hint_action;
	gtk_action_set_sensitive (_tmp34_, FALSE);
	_tmp35_ = self->priv->pause_action;
	gtk_action_set_sensitive ((GtkAction*) _tmp35_, FALSE);
	_tmp36_ = self->priv->minefield_view;
	minefield_view_set_paused (_tmp36_, FALSE);
	_tmp37_ = self->priv->pause_action;
	games_pause_action_set_is_paused (_tmp37_, FALSE);
}


static void _gno_mine_marks_changed_cb_minefield_marks_changed (Minefield* _sender, gpointer self) {
	gno_mine_marks_changed_cb (self, _sender);
}


static void _gno_mine_explode_cb_minefield_explode (Minefield* _sender, gpointer self) {
	gno_mine_explode_cb (self, _sender);
}


static void _gno_mine_cleared_cb_minefield_cleared (Minefield* _sender, gpointer self) {
	gno_mine_cleared_cb (self, _sender);
}


static void gno_mine_new_game (GnoMine* self) {
	GtkAspectFrame* _tmp0_;
	MinefieldView* _tmp1_;
	GtkAspectFrame* _tmp2_;
	GamesClock* _tmp3_;
	GtkImage* _tmp4_;
	gint x = 0;
	gint y = 0;
	gint n = 0;
	gchar* _tmp5_;
	gchar* score_key;
	GSettings* _tmp6_;
	gint _tmp7_ = 0;
	GamesScores* _tmp23_;
	const gchar* _tmp24_;
	Minefield* _tmp25_;
	gint _tmp27_;
	gint _tmp28_;
	gint _tmp29_;
	Minefield* _tmp30_;
	Minefield* _tmp31_;
	Minefield* _tmp32_;
	Minefield* _tmp33_;
	MinefieldView* _tmp34_;
	Minefield* _tmp35_;
	GtkAction* _tmp36_;
	GamesPauseAction* _tmp37_;
	MinefieldView* _tmp38_;
	GamesPauseAction* _tmp39_;
	g_return_if_fail (self != NULL);
	self->priv->is_new_game_screen = FALSE;
	_tmp0_ = self->priv->custom_game_screen;
	gtk_widget_hide ((GtkWidget*) _tmp0_);
	_tmp1_ = self->priv->minefield_view;
	gtk_widget_show ((GtkWidget*) _tmp1_);
	_tmp2_ = self->priv->new_game_screen;
	gtk_widget_hide ((GtkWidget*) _tmp2_);
	_tmp3_ = self->priv->clock;
	games_clock_reset (_tmp3_);
	_tmp4_ = self->priv->smile_face_image;
	gno_mine_set_face_image (self, _tmp4_);
	_tmp5_ = g_strdup ("");
	score_key = _tmp5_;
	_tmp6_ = self->priv->settings;
	_tmp7_ = g_settings_get_int (_tmp6_, GNO_MINE_KEY_MODE);
	switch (_tmp7_) {
		case 0:
		{
			gchar* _tmp8_;
			x = 8;
			y = 8;
			n = 10;
			_tmp8_ = g_strdup ("Small");
			_g_free0 (score_key);
			score_key = _tmp8_;
			break;
		}
		case 1:
		{
			gchar* _tmp9_;
			x = 16;
			y = 16;
			n = 40;
			_tmp9_ = g_strdup ("Medium");
			_g_free0 (score_key);
			score_key = _tmp9_;
			break;
		}
		case 2:
		{
			gchar* _tmp10_;
			x = 30;
			y = 16;
			n = 99;
			_tmp10_ = g_strdup ("Large");
			_g_free0 (score_key);
			score_key = _tmp10_;
			break;
		}
		default:
		case 3:
		{
			GSettings* _tmp11_;
			gint _tmp12_ = 0;
			gint _tmp13_ = 0;
			GSettings* _tmp14_;
			gint _tmp15_ = 0;
			gint _tmp16_ = 0;
			GSettings* _tmp17_;
			gint _tmp18_ = 0;
			gint _tmp19_;
			gint _tmp20_;
			gint _tmp21_ = 0;
			gchar* _tmp22_;
			_tmp11_ = self->priv->settings;
			_tmp12_ = g_settings_get_int (_tmp11_, GNO_MINE_KEY_XSIZE);
			_tmp13_ = CLAMP (_tmp12_, GNO_MINE_XSIZE_MIN, GNO_MINE_XSIZE_MAX);
			x = _tmp13_;
			_tmp14_ = self->priv->settings;
			_tmp15_ = g_settings_get_int (_tmp14_, GNO_MINE_KEY_YSIZE);
			_tmp16_ = CLAMP (_tmp15_, GNO_MINE_YSIZE_MIN, GNO_MINE_YSIZE_MAX);
			y = _tmp16_;
			_tmp17_ = self->priv->settings;
			_tmp18_ = g_settings_get_int (_tmp17_, GNO_MINE_KEY_NMINES);
			_tmp19_ = x;
			_tmp20_ = y;
			_tmp21_ = CLAMP (_tmp18_, 1, (_tmp19_ * _tmp20_) - 10);
			n = _tmp21_;
			_tmp22_ = g_strdup ("Custom");
			_g_free0 (score_key);
			score_key = _tmp22_;
			break;
		}
	}
	_tmp23_ = self->priv->highscores;
	_tmp24_ = score_key;
	games_scores_set_category (_tmp23_, _tmp24_);
	_tmp25_ = self->priv->minefield;
	if (_tmp25_ != NULL) {
		Minefield* _tmp26_;
		_tmp26_ = self->priv->minefield;
		g_signal_handlers_disconnect_by_func (_tmp26_, NULL, self);
	}
	_tmp27_ = x;
	_tmp28_ = y;
	_tmp29_ = n;
	_tmp30_ = minefield_new ((guint) _tmp27_, (guint) _tmp28_, (guint) _tmp29_);
	_minefield_unref0 (self->priv->minefield);
	self->priv->minefield = _tmp30_;
	_tmp31_ = self->priv->minefield;
	g_signal_connect_object (_tmp31_, "marks-changed", (GCallback) _gno_mine_marks_changed_cb_minefield_marks_changed, self, 0);
	_tmp32_ = self->priv->minefield;
	g_signal_connect_object (_tmp32_, "explode", (GCallback) _gno_mine_explode_cb_minefield_explode, self, 0);
	_tmp33_ = self->priv->minefield;
	g_signal_connect_object (_tmp33_, "cleared", (GCallback) _gno_mine_cleared_cb_minefield_cleared, self, 0);
	_tmp34_ = self->priv->minefield_view;
	_tmp35_ = self->priv->minefield;
	minefield_view_set_minefield (_tmp34_, _tmp35_);
	gno_mine_update_flag_label (self);
	_tmp36_ = self->priv->hint_action;
	gtk_action_set_sensitive (_tmp36_, TRUE);
	_tmp37_ = self->priv->pause_action;
	gtk_action_set_sensitive ((GtkAction*) _tmp37_, TRUE);
	_tmp38_ = self->priv->minefield_view;
	minefield_view_set_paused (_tmp38_, FALSE);
	_tmp39_ = self->priv->pause_action;
	games_pause_action_set_is_paused (_tmp39_, FALSE);
	_g_free0 (score_key);
}


static void gno_mine_hint_cb (GnoMine* self) {
	guint x = 0U;
	guint y = 0U;
	Minefield* _tmp0_;
	guint _tmp1_ = 0U;
	guint _tmp2_ = 0U;
	Minefield* _tmp3_;
	GamesClock* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->minefield;
	minefield_hint (_tmp0_, &_tmp1_, &_tmp2_);
	x = _tmp1_;
	y = _tmp2_;
	_tmp3_ = self->priv->minefield;
	minefield_clear_mine (_tmp3_, x, y);
	_tmp4_ = self->priv->clock;
	games_clock_add_seconds (_tmp4_, (time_t) 10);
}


static void gno_mine_new_game_cb (GnoMine* self) {
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->is_new_game_screen;
	if (_tmp0_) {
		gno_mine_new_game (self);
	} else {
		gno_mine_show_new_game_screen (self);
	}
}


static void gno_mine_pause_cb (GnoMine* self, GtkAction* action) {
	GamesPauseAction* _tmp0_;
	gboolean _tmp1_ = FALSE;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	_tmp0_ = self->priv->pause_action;
	_tmp1_ = games_pause_action_get_is_paused (_tmp0_);
	if (_tmp1_) {
		MinefieldView* _tmp2_;
		GtkAction* _tmp3_;
		GamesClock* _tmp4_;
		_tmp2_ = self->priv->minefield_view;
		minefield_view_set_paused (_tmp2_, TRUE);
		_tmp3_ = self->priv->hint_action;
		gtk_action_set_sensitive (_tmp3_, FALSE);
		_tmp4_ = self->priv->clock;
		games_clock_stop (_tmp4_);
	} else {
		MinefieldView* _tmp5_;
		GtkAction* _tmp6_;
		GamesClock* _tmp7_;
		_tmp5_ = self->priv->minefield_view;
		minefield_view_set_paused (_tmp5_, FALSE);
		_tmp6_ = self->priv->hint_action;
		gtk_action_set_sensitive (_tmp6_, TRUE);
		_tmp7_ = self->priv->clock;
		games_clock_start (_tmp7_);
	}
}


static void gno_mine_marks_changed_cb (GnoMine* self, Minefield* minefield) {
	GamesClock* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (minefield != NULL);
	gno_mine_update_flag_label (self);
	_tmp0_ = self->priv->clock;
	games_clock_start (_tmp0_);
}


static void gno_mine_explode_cb (GnoMine* self, Minefield* minefield) {
	GtkImage* _tmp0_;
	GtkAction* _tmp1_;
	GamesPauseAction* _tmp2_;
	GamesClock* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (minefield != NULL);
	_tmp0_ = self->priv->sad_face_image;
	gno_mine_set_face_image (self, _tmp0_);
	_tmp1_ = self->priv->hint_action;
	gtk_action_set_sensitive (_tmp1_, FALSE);
	_tmp2_ = self->priv->pause_action;
	gtk_action_set_sensitive ((GtkAction*) _tmp2_, FALSE);
	_tmp3_ = self->priv->clock;
	games_clock_stop (_tmp3_);
}


static void gno_mine_cleared_cb (GnoMine* self, Minefield* minefield) {
	GamesClock* _tmp0_;
	GtkImage* _tmp1_;
	GamesClock* _tmp2_;
	time_t _tmp3_ = 0;
	time_t seconds;
	GamesScores* _tmp4_;
	time_t _tmp5_;
	time_t _tmp6_;
	gint _tmp7_ = 0;
	gint pos;
	gint _tmp8_;
	gint _tmp9_ = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (minefield != NULL);
	_tmp0_ = self->priv->clock;
	games_clock_stop (_tmp0_);
	_tmp1_ = self->priv->win_face_image;
	gno_mine_set_face_image (self, _tmp1_);
	_tmp2_ = self->priv->clock;
	_tmp3_ = games_clock_get_seconds (_tmp2_);
	seconds = _tmp3_;
	_tmp4_ = self->priv->highscores;
	_tmp5_ = seconds;
	_tmp6_ = seconds;
	_tmp7_ = games_scores_add_time_score (_tmp4_, (gdouble) (((gfloat) (_tmp5_ / 60)) + (((gfloat) (_tmp6_ % 60)) / 100)));
	pos = _tmp7_;
	_tmp8_ = pos;
	_tmp9_ = gno_mine_show_scores (self, _tmp8_, TRUE);
	if (_tmp9_ == ((gint) GTK_RESPONSE_REJECT)) {
		GtkWindow* _tmp10_;
		_tmp10_ = self->priv->window;
		gtk_widget_destroy ((GtkWidget*) _tmp10_);
	} else {
		gno_mine_show_new_game_screen (self);
	}
}


static void gno_mine_look_cb (GnoMine* self, MinefieldView* minefield_view) {
	GtkImage* _tmp0_;
	GamesClock* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (minefield_view != NULL);
	_tmp0_ = self->priv->worried_face_image;
	gno_mine_set_face_image (self, _tmp0_);
	_tmp1_ = self->priv->clock;
	games_clock_start (_tmp1_);
}


static void gno_mine_unlook_cb (GnoMine* self, MinefieldView* minefield_view) {
	GtkImage* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (minefield_view != NULL);
	_tmp0_ = self->priv->cool_face_image;
	gno_mine_set_face_image (self, _tmp0_);
}


static void gno_mine_about_cb (GnoMine* self) {
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	const gchar* _tmp6_ = NULL;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	const gchar* _tmp10_ = NULL;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar** _tmp14_ = NULL;
	gchar** authors;
	gint authors_length1;
	gint _authors_size_;
	const gchar* _tmp15_ = NULL;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	const gchar* _tmp20_ = NULL;
	gchar* _tmp21_;
	gchar* _tmp22_;
	gchar** _tmp23_ = NULL;
	gchar** artists;
	gint artists_length1;
	gint _artists_size_;
	gchar* _tmp24_;
	gchar** _tmp25_ = NULL;
	gchar** documenters;
	gint documenters_length1;
	gint _documenters_size_;
	GtkWindow* _tmp26_;
	const gchar* _tmp27_ = NULL;
	const gchar* _tmp28_ = NULL;
	const gchar* _tmp29_ = NULL;
	gchar* _tmp30_ = NULL;
	gchar* _tmp31_;
	const gchar* _tmp32_ = NULL;
	const gchar* _tmp33_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = _ ("Main game:");
	_tmp1_ = g_strdup (_tmp0_);
	_tmp2_ = g_strdup ("Pista");
	_tmp3_ = g_strdup ("Szekeres Istvan");
	_tmp4_ = g_strdup ("Robert Ancell");
	_tmp5_ = g_strdup ("");
	_tmp6_ = _ ("Score:");
	_tmp7_ = g_strdup (_tmp6_);
	_tmp8_ = g_strdup ("Horacio J. Pe\xc3\xb1a");
	_tmp9_ = g_strdup ("");
	_tmp10_ = _ ("Resizing and SVG support:");
	_tmp11_ = g_strdup (_tmp10_);
	_tmp12_ = g_strdup ("Steve Chaplin");
	_tmp13_ = g_strdup ("Callum McKenzie");
	_tmp14_ = g_new0 (gchar*, 12 + 1);
	_tmp14_[0] = _tmp1_;
	_tmp14_[1] = _tmp2_;
	_tmp14_[2] = _tmp3_;
	_tmp14_[3] = _tmp4_;
	_tmp14_[4] = _tmp5_;
	_tmp14_[5] = _tmp7_;
	_tmp14_[6] = _tmp8_;
	_tmp14_[7] = _tmp9_;
	_tmp14_[8] = _tmp11_;
	_tmp14_[9] = _tmp12_;
	_tmp14_[10] = _tmp13_;
	_tmp14_[11] = NULL;
	authors = _tmp14_;
	authors_length1 = 12;
	_authors_size_ = authors_length1;
	_tmp15_ = _ ("Faces:");
	_tmp16_ = g_strdup (_tmp15_);
	_tmp17_ = g_strdup ("tigert");
	_tmp18_ = g_strdup ("Lapo Calamandrei and Ulisse Perusin");
	_tmp19_ = g_strdup ("");
	_tmp20_ = _ ("Graphics:");
	_tmp21_ = g_strdup (_tmp20_);
	_tmp22_ = g_strdup ("Richard Hoelscher");
	_tmp23_ = g_new0 (gchar*, 7 + 1);
	_tmp23_[0] = _tmp16_;
	_tmp23_[1] = _tmp17_;
	_tmp23_[2] = _tmp18_;
	_tmp23_[3] = _tmp19_;
	_tmp23_[4] = _tmp21_;
	_tmp23_[5] = _tmp22_;
	_tmp23_[6] = NULL;
	artists = _tmp23_;
	artists_length1 = 7;
	_artists_size_ = artists_length1;
	_tmp24_ = g_strdup ("Callum McKenzie");
	_tmp25_ = g_new0 (gchar*, 2 + 1);
	_tmp25_[0] = _tmp24_;
	_tmp25_[1] = NULL;
	documenters = _tmp25_;
	documenters_length1 = 2;
	_documenters_size_ = documenters_length1;
	_tmp26_ = self->priv->window;
	_tmp27_ = _ ("Mines");
	_tmp28_ = _ ("The popular logic puzzle minesweeper. Clear mines from a board using h" \
"ints from squares you have already uncovered.\n" \
"\n" \
"Mines is a part of GNOME Games.");
	_tmp29_ = _ ("Mines");
	_tmp30_ = games_get_license (_tmp29_);
	_tmp31_ = _tmp30_;
	_tmp32_ = _ ("translator-credits");
	_tmp33_ = _ ("GNOME Games web site");
	gtk_show_about_dialog (_tmp26_, "name", _tmp27_, "version", VERSION, "comments", _tmp28_, "copyright", "Copyright \xc2\xa9 1997-2008 Free Software Foundation, Inc.", "license", _tmp31_, "authors", authors, "artists", artists, "documenters", documenters, "translator-credits", _tmp32_, "logo-icon-name", "gnomine", "website", "http://www.gnome.org/projects/gnome-games/", "website-label", _tmp33_, "wrap-license", TRUE, NULL, NULL);
	_g_free0 (_tmp31_);
	documenters = (_vala_array_free (documenters, documenters_length1, (GDestroyNotify) g_free), NULL);
	artists = (_vala_array_free (artists, artists_length1, (GDestroyNotify) g_free), NULL);
	authors = (_vala_array_free (authors, authors_length1, (GDestroyNotify) g_free), NULL);
}


static void gno_mine_set_n_mines_limit (GnoMine* self) {
	GSettings* _tmp0_;
	gint _tmp1_ = 0;
	GSettings* _tmp2_;
	gint _tmp3_ = 0;
	gint max_mines;
	GSettings* _tmp4_;
	gint _tmp5_ = 0;
	gint _tmp6_;
	GtkSpinButton* _tmp11_;
	gint _tmp12_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->settings;
	_tmp1_ = g_settings_get_int (_tmp0_, GNO_MINE_KEY_XSIZE);
	_tmp2_ = self->priv->settings;
	_tmp3_ = g_settings_get_int (_tmp2_, GNO_MINE_KEY_YSIZE);
	max_mines = (_tmp1_ * _tmp3_) - 10;
	_tmp4_ = self->priv->settings;
	_tmp5_ = g_settings_get_int (_tmp4_, GNO_MINE_KEY_NMINES);
	_tmp6_ = max_mines;
	if (_tmp5_ > _tmp6_) {
		GSettings* _tmp7_;
		gint _tmp8_;
		GtkSpinButton* _tmp9_;
		gint _tmp10_;
		_tmp7_ = self->priv->settings;
		_tmp8_ = max_mines;
		g_settings_set_int (_tmp7_, GNO_MINE_KEY_NMINES, _tmp8_);
		_tmp9_ = self->priv->n_mines_spin;
		_tmp10_ = max_mines;
		gtk_spin_button_set_value (_tmp9_, (gdouble) _tmp10_);
	}
	_tmp11_ = self->priv->n_mines_spin;
	_tmp12_ = max_mines;
	gtk_spin_button_set_range (_tmp11_, (gdouble) 1, (gdouble) _tmp12_);
}


static void gno_mine_xsize_spin_cb (GnoMine* self, GtkSpinButton* spin) {
	GtkSpinButton* _tmp0_;
	gint _tmp1_ = 0;
	gint xsize;
	gint _tmp2_;
	GSettings* _tmp3_;
	gint _tmp4_ = 0;
	GSettings* _tmp5_;
	gint _tmp6_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (spin != NULL);
	_tmp0_ = spin;
	_tmp1_ = gtk_spin_button_get_value_as_int (_tmp0_);
	xsize = _tmp1_;
	_tmp2_ = xsize;
	_tmp3_ = self->priv->settings;
	_tmp4_ = g_settings_get_int (_tmp3_, GNO_MINE_KEY_XSIZE);
	if (_tmp2_ == _tmp4_) {
		return;
	}
	_tmp5_ = self->priv->settings;
	_tmp6_ = xsize;
	g_settings_set_int (_tmp5_, GNO_MINE_KEY_XSIZE, _tmp6_);
	gno_mine_set_n_mines_limit (self);
}


static void gno_mine_ysize_spin_cb (GnoMine* self, GtkSpinButton* spin) {
	GtkSpinButton* _tmp0_;
	gint _tmp1_ = 0;
	gint ysize;
	gint _tmp2_;
	GSettings* _tmp3_;
	gint _tmp4_ = 0;
	GSettings* _tmp5_;
	gint _tmp6_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (spin != NULL);
	_tmp0_ = spin;
	_tmp1_ = gtk_spin_button_get_value_as_int (_tmp0_);
	ysize = _tmp1_;
	_tmp2_ = ysize;
	_tmp3_ = self->priv->settings;
	_tmp4_ = g_settings_get_int (_tmp3_, GNO_MINE_KEY_YSIZE);
	if (_tmp2_ == _tmp4_) {
		return;
	}
	_tmp5_ = self->priv->settings;
	_tmp6_ = ysize;
	g_settings_set_int (_tmp5_, GNO_MINE_KEY_YSIZE, _tmp6_);
	gno_mine_set_n_mines_limit (self);
}


static void gno_mine_n_mines_spin_cb (GnoMine* self, GtkSpinButton* spin) {
	GtkSpinButton* _tmp0_;
	gint _tmp1_ = 0;
	gint n_mines;
	gint _tmp2_;
	GSettings* _tmp3_;
	gint _tmp4_ = 0;
	GSettings* _tmp5_;
	gint _tmp6_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (spin != NULL);
	_tmp0_ = spin;
	_tmp1_ = gtk_spin_button_get_value_as_int (_tmp0_);
	n_mines = _tmp1_;
	_tmp2_ = n_mines;
	_tmp3_ = self->priv->settings;
	_tmp4_ = g_settings_get_int (_tmp3_, GNO_MINE_KEY_NMINES);
	if (_tmp2_ == _tmp4_) {
		return;
	}
	_tmp5_ = self->priv->settings;
	_tmp6_ = n_mines;
	g_settings_set_int (_tmp5_, GNO_MINE_KEY_NMINES, _tmp6_);
}


static void gno_mine_use_question_toggle_cb (GnoMine* self, GtkToggleButton* button) {
	GtkToggleButton* _tmp0_;
	gboolean _tmp1_ = FALSE;
	gboolean use_question_marks;
	GSettings* _tmp2_;
	MinefieldView* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (button != NULL);
	_tmp0_ = button;
	_tmp1_ = gtk_toggle_button_get_active (_tmp0_);
	use_question_marks = _tmp1_;
	_tmp2_ = self->priv->settings;
	g_settings_set_boolean (_tmp2_, GNO_MINE_KEY_USE_QUESTION_MARKS, use_question_marks);
	_tmp3_ = self->priv->minefield_view;
	minefield_view_set_use_question_marks (_tmp3_, use_question_marks);
}


static void gno_mine_use_overmine_toggle_cb (GnoMine* self, GtkToggleButton* button) {
	GtkToggleButton* _tmp0_;
	gboolean _tmp1_ = FALSE;
	gboolean use_overmine_warning;
	GSettings* _tmp2_;
	MinefieldView* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (button != NULL);
	_tmp0_ = button;
	_tmp1_ = gtk_toggle_button_get_active (_tmp0_);
	use_overmine_warning = _tmp1_;
	_tmp2_ = self->priv->settings;
	g_settings_set_boolean (_tmp2_, GNO_MINE_KEY_USE_OVERMINE_WARNING, use_overmine_warning);
	_tmp3_ = self->priv->minefield_view;
	minefield_view_set_use_overmine_warning (_tmp3_, use_overmine_warning);
}


static void _gno_mine_use_question_toggle_cb_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self) {
	gno_mine_use_question_toggle_cb (self, _sender);
}


static void _gno_mine_use_overmine_toggle_cb_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self) {
	gno_mine_use_overmine_toggle_cb (self, _sender);
}


static void _gno_mine_pref_response_cb_gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self) {
	gno_mine_pref_response_cb (self, _sender, response_id);
}


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


static GtkDialog* gno_mine_create_preferences (GnoMine* self) {
	GtkDialog* result = NULL;
	GtkVBox* _tmp0_;
	GtkVBox* _tmp1_;
	GtkVBox* vbox;
	const gchar* _tmp2_ = NULL;
	GamesFrame* _tmp3_;
	GamesFrame* _tmp4_;
	GamesFrame* frame;
	GtkBox* _tmp5_;
	GtkBox* _tmp6_;
	GtkBox* flag_options_vbox;
	const gchar* _tmp7_ = NULL;
	GtkCheckButton* _tmp8_;
	GtkCheckButton* _tmp9_;
	GtkCheckButton* question_toggle;
	GSettings* _tmp10_;
	gboolean _tmp11_ = FALSE;
	const gchar* _tmp12_ = NULL;
	GtkCheckButton* _tmp13_;
	GtkCheckButton* _tmp14_;
	GtkCheckButton* overmine_toggle;
	GSettings* _tmp15_;
	gboolean _tmp16_ = FALSE;
	const gchar* _tmp17_ = NULL;
	GtkWindow* _tmp18_;
	GtkDialog* _tmp19_;
	GtkDialog* _tmp20_;
	GtkDialog* dialog;
	GtkBox* _tmp21_ = NULL;
	GtkBox* _tmp22_;
	GtkBox* box;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = (GtkVBox*) gtk_vbox_new (FALSE, 5);
	_tmp1_ = g_object_ref_sink (_tmp0_);
	vbox = _tmp1_;
	_tmp2_ = _ ("Flags");
	_tmp3_ = games_frame_new (_tmp2_);
	_tmp4_ = g_object_ref_sink (_tmp3_);
	frame = _tmp4_;
	gtk_box_pack_start ((GtkBox*) vbox, (GtkWidget*) frame, FALSE, FALSE, (guint) 0);
	_tmp5_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
	_tmp6_ = g_object_ref_sink (_tmp5_);
	flag_options_vbox = _tmp6_;
	gtk_widget_show ((GtkWidget*) flag_options_vbox);
	gtk_container_add ((GtkContainer*) frame, (GtkWidget*) flag_options_vbox);
	_tmp7_ = _ ("_Use \"I'm not sure\" flags");
	_tmp8_ = (GtkCheckButton*) gtk_check_button_new_with_mnemonic (_tmp7_);
	_tmp9_ = g_object_ref_sink (_tmp8_);
	question_toggle = _tmp9_;
	g_signal_connect_object ((GtkToggleButton*) question_toggle, "toggled", (GCallback) _gno_mine_use_question_toggle_cb_gtk_toggle_button_toggled, self, 0);
	_tmp10_ = self->priv->settings;
	_tmp11_ = g_settings_get_boolean (_tmp10_, GNO_MINE_KEY_USE_QUESTION_MARKS);
	gtk_toggle_button_set_active ((GtkToggleButton*) question_toggle, _tmp11_);
	gtk_box_pack_start (flag_options_vbox, (GtkWidget*) question_toggle, FALSE, TRUE, (guint) 0);
	_tmp12_ = _ ("_Warn if too many flags placed");
	_tmp13_ = (GtkCheckButton*) gtk_check_button_new_with_mnemonic (_tmp12_);
	_tmp14_ = g_object_ref_sink (_tmp13_);
	overmine_toggle = _tmp14_;
	g_signal_connect_object ((GtkToggleButton*) overmine_toggle, "toggled", (GCallback) _gno_mine_use_overmine_toggle_cb_gtk_toggle_button_toggled, self, 0);
	_tmp15_ = self->priv->settings;
	_tmp16_ = g_settings_get_boolean (_tmp15_, GNO_MINE_KEY_USE_OVERMINE_WARNING);
	gtk_toggle_button_set_active ((GtkToggleButton*) overmine_toggle, _tmp16_);
	gtk_box_pack_start (flag_options_vbox, (GtkWidget*) overmine_toggle, FALSE, TRUE, (guint) 0);
	_tmp17_ = _ ("Mines Preferences");
	_tmp18_ = self->priv->window;
	_tmp19_ = (GtkDialog*) gtk_dialog_new_with_buttons (_tmp17_, _tmp18_, 0, GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL, NULL);
	_tmp20_ = g_object_ref_sink (_tmp19_);
	dialog = _tmp20_;
	gtk_container_set_border_width ((GtkContainer*) dialog, (guint) 5);
	gtk_window_set_resizable ((GtkWindow*) dialog, FALSE);
	_tmp21_ = gtk_dialog_get_content_area (dialog);
	_tmp22_ = _g_object_ref0 (GTK_BOX (_tmp21_));
	box = _tmp22_;
	gtk_box_set_spacing (box, 2);
	gtk_box_pack_start (box, (GtkWidget*) vbox, FALSE, FALSE, (guint) 0);
	g_signal_connect_object (dialog, "response", (GCallback) _gno_mine_pref_response_cb_gtk_dialog_response, self, 0);
	g_signal_connect_object ((GtkWidget*) dialog, "delete-event", (GCallback) _gno_mine_pref_delete_event_cb_gtk_widget_delete_event, self, 0);
	gtk_widget_show_all ((GtkWidget*) vbox);
	result = dialog;
	_g_object_unref0 (box);
	_g_object_unref0 (overmine_toggle);
	_g_object_unref0 (question_toggle);
	_g_object_unref0 (flag_options_vbox);
	_g_object_unref0 (frame);
	_g_object_unref0 (vbox);
	return result;
}


static void gno_mine_set_mode (GnoMine* self, gint mode) {
	gint _tmp0_;
	GSettings* _tmp1_;
	gint _tmp2_ = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = mode;
	_tmp1_ = self->priv->settings;
	_tmp2_ = g_settings_get_int (_tmp1_, GNO_MINE_KEY_MODE);
	if (_tmp0_ != _tmp2_) {
		GSettings* _tmp3_;
		gint _tmp4_;
		_tmp3_ = self->priv->settings;
		_tmp4_ = mode;
		g_settings_set_int (_tmp3_, GNO_MINE_KEY_MODE, _tmp4_);
	}
	gno_mine_new_game (self);
}


static void gno_mine_small_size_clicked_cb (GnoMine* self) {
	g_return_if_fail (self != NULL);
	gno_mine_set_mode (self, 0);
}


static void gno_mine_medium_size_clicked_cb (GnoMine* self) {
	g_return_if_fail (self != NULL);
	gno_mine_set_mode (self, 1);
}


static void gno_mine_large_size_clicked_cb (GnoMine* self) {
	g_return_if_fail (self != NULL);
	gno_mine_set_mode (self, 2);
}


static void gno_mine_custom_size_clicked_cb (GnoMine* self) {
	g_return_if_fail (self != NULL);
	gno_mine_set_mode (self, 3);
}


static void gno_mine_pref_response_cb (GnoMine* self, GtkDialog* dialog, gint response_id) {
	GtkDialog* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (dialog != NULL);
	_tmp0_ = self->priv->pref_dialog;
	gtk_widget_hide ((GtkWidget*) _tmp0_);
}


static gboolean gno_mine_pref_delete_event_cb (GnoMine* self, GtkWidget* widget, GdkEventAny* event) {
	gboolean result = FALSE;
	GtkDialog* _tmp0_;
	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_ = self->priv->pref_dialog;
	gtk_widget_hide ((GtkWidget*) _tmp0_);
	result = TRUE;
	return result;
}


static void gno_mine_preferences_cb (GnoMine* self) {
	GtkDialog* _tmp0_;
	GtkDialog* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->pref_dialog;
	if (_tmp0_ == NULL) {
		GtkDialog* _tmp1_ = NULL;
		_tmp1_ = gno_mine_create_preferences (self);
		_g_object_unref0 (self->priv->pref_dialog);
		self->priv->pref_dialog = _tmp1_;
	}
	_tmp2_ = self->priv->pref_dialog;
	gtk_window_present ((GtkWindow*) _tmp2_);
}


static void gno_mine_help_cb (GnoMine* 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:gnomine", _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 ("gnomine.vala:807: 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;
	}
}


gint gno_mine_main (gchar** args, int args_length1) {
	gint result = 0;
	GOptionContext* _tmp0_;
	GOptionContext* context;
	GOptionContext* _tmp1_;
	GOptionContext* _tmp2_;
	GOptionGroup* _tmp3_ = NULL;
	const gchar* _tmp8_ = NULL;
	GnoMine* _tmp9_;
	GnoMine* app;
	GnoMine* _tmp10_;
	GnoMine* _tmp11_;
	gint _tmp12_ = 0;
	gint _result_;
	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;
	g_option_context_set_translation_domain (_tmp1_, GETTEXT_PACKAGE);
	_tmp2_ = context;
	_tmp3_ = gtk_get_option_group (TRUE);
	g_option_context_add_group (_tmp2_, _tmp3_);
	{
		GOptionContext* _tmp4_;
		_tmp4_ = context;
		g_option_context_parse (_tmp4_, &args_length1, &args, &_inner_error_);
		if (_inner_error_ != NULL) {
			goto __catch2_g_error;
		}
	}
	goto __finally2;
	__catch2_g_error:
	{
		GError* e = NULL;
		FILE* _tmp5_;
		GError* _tmp6_;
		const gchar* _tmp7_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp5_ = stderr;
		_tmp6_ = e;
		_tmp7_ = _tmp6_->message;
		fprintf (_tmp5_, "%s\n", _tmp7_);
		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;
	}
	_tmp8_ = _ ("Mines");
	g_set_application_name (_tmp8_);
	_tmp9_ = gno_mine_new ();
	app = _tmp9_;
	_tmp10_ = app;
	gno_mine_start (_tmp10_);
	_tmp11_ = app;
	_tmp12_ = g_application_run ((GApplication*) _tmp11_, 0, NULL);
	_result_ = _tmp12_;
	g_settings_sync ();
	result = _result_;
	_g_object_unref0 (app);
	_g_option_context_free0 (context);
	return result;
}


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


static void gno_mine_class_init (GnoMineClass * klass) {
	gno_mine_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GnoMinePrivate));
	G_APPLICATION_CLASS (klass)->activate = gno_mine_real_activate;
	G_OBJECT_CLASS (klass)->finalize = gno_mine_finalize;
}


static void gno_mine_instance_init (GnoMine * self) {
	self->priv = GNO_MINE_GET_PRIVATE (self);
	self->priv->pref_dialog = NULL;
}


static void gno_mine_finalize (GObject* obj) {
	GnoMine * self;
	self = GNO_MINE (obj);
	_g_object_unref0 (self->priv->settings);
	_g_object_unref0 (self->priv->face_button);
	_g_object_unref0 (self->priv->win_face_image);
	_g_object_unref0 (self->priv->sad_face_image);
	_g_object_unref0 (self->priv->smile_face_image);
	_g_object_unref0 (self->priv->cool_face_image);
	_g_object_unref0 (self->priv->worried_face_image);
	_g_object_unref0 (self->priv->window);
	_minefield_unref0 (self->priv->minefield);
	_g_object_unref0 (self->priv->minefield_view);
	_g_object_unref0 (self->priv->pref_dialog);
	_g_object_unref0 (self->priv->flag_label);
	_g_object_unref0 (self->priv->n_mines_spin);
	_g_object_unref0 (self->priv->clock);
	_g_object_unref0 (self->priv->hint_action);
	_g_object_unref0 (self->priv->fullscreen_action);
	_g_object_unref0 (self->priv->pause_action);
	_g_object_unref0 (self->priv->new_game_screen);
	_g_object_unref0 (self->priv->custom_game_screen);
	_g_object_unref0 (self->priv->highscores);
	G_OBJECT_CLASS (gno_mine_parent_class)->finalize (obj);
}


GType gno_mine_get_type (void) {
	static volatile gsize gno_mine_type_id__volatile = 0;
	if (g_once_init_enter (&gno_mine_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GnoMineClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gno_mine_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GnoMine), 0, (GInstanceInitFunc) gno_mine_instance_init, NULL };
		GType gno_mine_type_id;
		gno_mine_type_id = g_type_register_static (GTK_TYPE_APPLICATION, "GnoMine", &g_define_type_info, 0);
		g_once_init_leave (&gno_mine_type_id__volatile, gno_mine_type_id);
	}
	return gno_mine_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);
}



