/* gnomine.c generated by valac 0.16.0, 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 <glib/gi18n-lib.h>
#include <games-score.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_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_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;
	GSimpleAction* pause;
	GSimpleAction* hint;
	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_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void gno_mine_hint_cb (GnoMine* self);
static void _gno_mine_hint_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void gno_mine_toggle_pause_cb (GnoMine* self);
static void _gno_mine_toggle_pause_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void gno_mine_fullscreen_cb (GnoMine* self);
static void _gno_mine_fullscreen_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void gno_mine_scores_cb (GnoMine* self);
static void _gno_mine_scores_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void gno_mine_preferences_cb (GnoMine* self);
static void _gno_mine_preferences_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void gno_mine_quit_cb (GnoMine* self);
static void _gno_mine_quit_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void gno_mine_help_cb (GnoMine* self);
static void _gno_mine_help_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void gno_mine_about_cb (GnoMine* self);
static void _gno_mine_about_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void _gno_mine_new_game_cb_gtk_action_callback (GtkAction* action, gpointer self);
static void _gno_mine_hint_cb_gtk_action_callback (GtkAction* action, gpointer self);
#define GNO_MINE_ui_description "<ui>" "    <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_real_startup (GApplication* base);
static void gno_mine_pause_cb (GnoMine* self);
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 gchar* gno_mine_make_minefield_description (GnoMine* self, const gchar* color, gint width, gint height, gint n_mines);
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 GActionEntry GNO_MINE_action_entries[9] = {{"new-game", _gno_mine_new_game_cb_gsimple_action_activate_callback}, {"hint", _gno_mine_hint_cb_gsimple_action_activate_callback}, {"pause", _gno_mine_toggle_pause_cb_gsimple_action_activate_callback}, {"fullscreen", _gno_mine_fullscreen_cb_gsimple_action_activate_callback}, {"scores", _gno_mine_scores_cb_gsimple_action_activate_callback}, {"preferences", _gno_mine_preferences_cb_gsimple_action_activate_callback}, {"quit", _gno_mine_quit_cb_gsimple_action_activate_callback}, {"help", _gno_mine_help_cb_gsimple_action_activate_callback}, {"about", _gno_mine_about_cb_gsimple_action_activate_callback}};
static const GamesScoresCategory GNO_MINE_scorecats[4] = {{"Small", "Small"}, {"Medium", "Medium"}, {"Large", "Large"}, {"Custom", "Custom"}};
static const GtkActionEntry GNO_MINE_actions[2] = {{"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}};

static void _gno_mine_new_game_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	gno_mine_new_game_cb (self);
}


static void _gno_mine_hint_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	gno_mine_hint_cb (self);
}


static void _gno_mine_toggle_pause_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	gno_mine_toggle_pause_cb (self);
}


static void _gno_mine_fullscreen_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	gno_mine_fullscreen_cb (self);
}


static void _gno_mine_scores_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	gno_mine_scores_cb (self);
}


static void _gno_mine_preferences_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	gno_mine_preferences_cb (self);
}


static void _gno_mine_quit_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	gno_mine_quit_cb (self);
}


static void _gno_mine_help_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	gno_mine_help_cb (self);
}


static void _gno_mine_about_cb_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	gno_mine_about_cb (self);
}


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


GnoMine* gno_mine_construct (GType object_type) {
	GnoMine * self = NULL;
	self = (GnoMine*) g_object_new (object_type, "application-id", "org.gnome.gnomine", "flags", G_APPLICATION_FLAGS_NONE, NULL);
	return self;
}


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


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


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


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


static gchar* gno_mine_make_minefield_description (GnoMine* self, const gchar* color, gint width, gint height, gint n_mines) {
	gchar* result = NULL;
	gint _tmp0_;
	gint _tmp1_;
	gchar* _tmp2_ = NULL;
	gchar* size_label;
	gint _tmp3_;
	const gchar* _tmp4_ = NULL;
	gint _tmp5_;
	gchar* _tmp6_ = NULL;
	gchar* mines_label;
	const gchar* _tmp7_;
	gchar* _tmp8_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (color != NULL, NULL);
	_tmp0_ = width;
	_tmp1_ = height;
	_tmp2_ = g_strdup_printf ("%d × %d", _tmp0_, _tmp1_);
	size_label = _tmp2_;
	_tmp3_ = n_mines;
	_tmp4_ = ngettext ("<b>%d</b> mine", "<b>%d</b> mines", (gulong) _tmp3_);
	_tmp5_ = n_mines;
	_tmp6_ = g_strdup_printf (_tmp4_, _tmp5_);
	mines_label = _tmp6_;
	_tmp7_ = color;
	_tmp8_ = g_strdup_printf ("<span fgcolor='%s'><span size='x-large' weight='ultrabold'>%s</span>\n" \
"%s</span>", _tmp7_, size_label, mines_label);
	result = _tmp8_;
	_g_free0 (mines_label);
	_g_free0 (size_label);
	return result;
}


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_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_;
	const gchar* _tmp1_ = NULL;
	Minefield* _tmp2_;
	guint _tmp3_;
	guint _tmp4_;
	Minefield* _tmp5_;
	guint _tmp6_;
	gchar* _tmp7_ = NULL;
	gchar* _tmp8_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->flag_label;
	_tmp1_ = _ ("Flags: %u/%u");
	_tmp2_ = self->priv->minefield;
	_tmp3_ = minefield_get_n_flags (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = self->priv->minefield;
	_tmp6_ = _tmp5_->n_mines;
	_tmp7_ = g_strdup_printf (_tmp1_, _tmp4_, _tmp6_);
	_tmp8_ = _tmp7_;
	gtk_label_set_text (_tmp0_, _tmp8_);
	_g_free0 (_tmp8_);
}


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_fullscreen_cb (GnoMine* self) {
	GamesFullscreenAction* _tmp0_;
	GamesFullscreenAction* _tmp1_;
	gboolean _tmp2_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->fullscreen_action;
	_tmp1_ = self->priv->fullscreen_action;
	_tmp2_ = games_fullscreen_action_get_is_fullscreen (_tmp1_);
	games_fullscreen_action_set_is_fullscreen (_tmp0_, !_tmp2_);
}


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_;
	GSimpleAction* _tmp34_;
	GtkAction* _tmp35_;
	GSimpleAction* _tmp36_;
	GamesPauseAction* _tmp37_;
	MinefieldView* _tmp38_;
	GamesPauseAction* _tmp39_;
	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_DELETE_EVENT, 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_DELETE_EVENT)) {
			_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;
	g_simple_action_set_enabled (_tmp34_, FALSE);
	_tmp35_ = self->priv->hint_action;
	gtk_action_set_sensitive (_tmp35_, FALSE);
	_tmp36_ = self->priv->pause;
	g_simple_action_set_enabled (_tmp36_, FALSE);
	_tmp37_ = self->priv->pause_action;
	gtk_action_set_sensitive ((GtkAction*) _tmp37_, FALSE);
	_tmp38_ = self->priv->minefield_view;
	minefield_view_set_paused (_tmp38_, FALSE);
	_tmp39_ = self->priv->pause_action;
	games_pause_action_set_is_paused (_tmp39_, 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_;
	GSimpleAction* _tmp36_;
	GtkAction* _tmp37_;
	GSimpleAction* _tmp38_;
	GamesPauseAction* _tmp39_;
	MinefieldView* _tmp40_;
	GamesPauseAction* _tmp41_;
	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;
	g_simple_action_set_enabled (_tmp36_, TRUE);
	_tmp37_ = self->priv->hint_action;
	gtk_action_set_sensitive (_tmp37_, TRUE);
	_tmp38_ = self->priv->pause;
	g_simple_action_set_enabled (_tmp38_, TRUE);
	_tmp39_ = self->priv->pause_action;
	gtk_action_set_sensitive ((GtkAction*) _tmp39_, TRUE);
	_tmp40_ = self->priv->minefield_view;
	minefield_view_set_paused (_tmp40_, FALSE);
	_tmp41_ = self->priv->pause_action;
	games_pause_action_set_is_paused (_tmp41_, 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_toggle_pause_cb (GnoMine* self) {
	GamesPauseAction* _tmp0_;
	GamesPauseAction* _tmp1_;
	gboolean _tmp2_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->pause_action;
	_tmp1_ = self->priv->pause_action;
	_tmp2_ = games_pause_action_get_is_paused (_tmp1_);
	games_pause_action_set_is_paused (_tmp0_, !_tmp2_);
}


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


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_;
	GSimpleAction* _tmp1_;
	GtkAction* _tmp2_;
	GSimpleAction* _tmp3_;
	GamesPauseAction* _tmp4_;
	GamesClock* _tmp5_;
	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;
	g_simple_action_set_enabled (_tmp1_, FALSE);
	_tmp2_ = self->priv->hint_action;
	gtk_action_set_sensitive (_tmp2_, FALSE);
	_tmp3_ = self->priv->pause;
	g_simple_action_set_enabled (_tmp3_, FALSE);
	_tmp4_ = self->priv->pause_action;
	gtk_action_set_sensitive ((GtkAction*) _tmp4_, FALSE);
	_tmp5_ = self->priv->clock;
	games_clock_stop (_tmp5_);
}


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 __catch2_g_error;
		}
	}
	goto __finally2;
	__catch2_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:843: Failed to show help: %s", _tmp4_);
		_g_error_free0 (e);
	}
	__finally2:
	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;
	GnoMine* _tmp8_;
	GnoMine* app;
	GnoMine* _tmp9_;
	gint _tmp10_ = 0;
	GError * _inner_error_ = NULL;
	setlocale (LC_ALL, "");
	bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
	textdomain (GETTEXT_PACKAGE);
	games_scores_startup ();
	_tmp0_ = g_option_context_new ("");
	context = _tmp0_;
	_tmp1_ = context;
	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 __catch3_g_error;
		}
	}
	goto __finally3;
	__catch3_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;
	}
	__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;
	}
	_tmp8_ = gno_mine_new ();
	app = _tmp8_;
	_tmp9_ = app;
	_tmp10_ = g_application_run ((GApplication*) _tmp9_, 0, NULL);
	result = _tmp10_;
	_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)->startup = gno_mine_real_startup;
	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->pause);
	_g_object_unref0 (self->priv->hint);
	_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);
}



