/* game-view.c generated by valac 0.56.19, the Vala compiler
 * generated from game-view.vala, do not modify */

/* -*- Mode: vala; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * Copyright © 2014 Parin Porecha
 * Copyright © 2014 Michael Catanzaro
 * Copyright © 2023 Jamie Murphy <jmurphy@gnome.org>
 *
 * This file is part of GNOME Sudoku.
 *
 * GNOME Sudoku is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * GNOME Sudoku is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GNOME Sudoku. If not, see <http://www.gnu.org/licenses/>.
 */

#include <adwaita.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include "libsudoku.h"
#include <glib.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include <math.h>
#include <glib/gi18n-lib.h>
#include <pango/pango.h>
#include <gdk/gdk.h>
#include <glib/gstdio.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define TYPE_SUDOKU_GAME_VIEW (sudoku_game_view_get_type ())
#define SUDOKU_GAME_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SUDOKU_GAME_VIEW, SudokuGameView))
#define SUDOKU_GAME_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SUDOKU_GAME_VIEW, SudokuGameViewClass))
#define IS_SUDOKU_GAME_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SUDOKU_GAME_VIEW))
#define IS_SUDOKU_GAME_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SUDOKU_GAME_VIEW))
#define SUDOKU_GAME_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SUDOKU_GAME_VIEW, SudokuGameViewClass))

typedef struct _SudokuGameView SudokuGameView;
typedef struct _SudokuGameViewClass SudokuGameViewClass;
typedef struct _SudokuGameViewPrivate SudokuGameViewPrivate;

#define TYPE_SUDOKU_GRID (sudoku_grid_get_type ())
#define SUDOKU_GRID(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SUDOKU_GRID, SudokuGrid))
#define SUDOKU_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SUDOKU_GRID, SudokuGridClass))
#define IS_SUDOKU_GRID(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SUDOKU_GRID))
#define IS_SUDOKU_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SUDOKU_GRID))
#define SUDOKU_GRID_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SUDOKU_GRID, SudokuGridClass))

typedef struct _SudokuGrid SudokuGrid;
typedef struct _SudokuGridClass SudokuGridClass;

#define TYPE_SUDOKU_WINDOW (sudoku_window_get_type ())
#define SUDOKU_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SUDOKU_WINDOW, SudokuWindow))
#define SUDOKU_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SUDOKU_WINDOW, SudokuWindowClass))
#define IS_SUDOKU_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SUDOKU_WINDOW))
#define IS_SUDOKU_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SUDOKU_WINDOW))
#define SUDOKU_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SUDOKU_WINDOW, SudokuWindowClass))

typedef struct _SudokuWindow SudokuWindow;
typedef struct _SudokuWindowClass SudokuWindowClass;

#define TYPE_SUDOKU_MENU_BUTTON (sudoku_menu_button_get_type ())
#define SUDOKU_MENU_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SUDOKU_MENU_BUTTON, SudokuMenuButton))
#define SUDOKU_MENU_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SUDOKU_MENU_BUTTON, SudokuMenuButtonClass))
#define IS_SUDOKU_MENU_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SUDOKU_MENU_BUTTON))
#define IS_SUDOKU_MENU_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SUDOKU_MENU_BUTTON))
#define SUDOKU_MENU_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SUDOKU_MENU_BUTTON, SudokuMenuButtonClass))

typedef struct _SudokuMenuButton SudokuMenuButton;
typedef struct _SudokuMenuButtonClass SudokuMenuButtonClass;
enum  {
	SUDOKU_GAME_VIEW_0_PROPERTY,
	SUDOKU_GAME_VIEW_INITIALIZED_PROPERTY,
	SUDOKU_GAME_VIEW_NUM_PROPERTIES
};
static GParamSpec* sudoku_game_view_properties[SUDOKU_GAME_VIEW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define TYPE_SUDOKU (sudoku_get_type ())
#define SUDOKU(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SUDOKU, Sudoku))
#define SUDOKU_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SUDOKU, SudokuClass))
#define IS_SUDOKU(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SUDOKU))
#define IS_SUDOKU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SUDOKU))
#define SUDOKU_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SUDOKU, SudokuClass))

typedef struct _Sudoku Sudoku;
typedef struct _SudokuClass SudokuClass;
typedef struct _SudokuMenuButtonPrivate SudokuMenuButtonPrivate;
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))

#define TYPE_SUDOKU_GRID_LAYOUT_MANAGER (sudoku_grid_layout_manager_get_type ())
#define SUDOKU_GRID_LAYOUT_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SUDOKU_GRID_LAYOUT_MANAGER, SudokuGridLayoutManager))
#define SUDOKU_GRID_LAYOUT_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SUDOKU_GRID_LAYOUT_MANAGER, SudokuGridLayoutManagerClass))
#define IS_SUDOKU_GRID_LAYOUT_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SUDOKU_GRID_LAYOUT_MANAGER))
#define IS_SUDOKU_GRID_LAYOUT_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SUDOKU_GRID_LAYOUT_MANAGER))
#define SUDOKU_GRID_LAYOUT_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SUDOKU_GRID_LAYOUT_MANAGER, SudokuGridLayoutManagerClass))

typedef struct _SudokuGridLayoutManager SudokuGridLayoutManager;
typedef struct _SudokuGridLayoutManagerClass SudokuGridLayoutManagerClass;
#define _pango_attr_list_unref0(var) ((var == NULL) ? NULL : (var = (pango_attr_list_unref (var), NULL)))
typedef struct _Block1Data Block1Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _Block2Data Block2Data;
typedef enum  {
	ZOOM_LEVEL_NONE = 0,
	ZOOM_LEVEL_SMALL = 1,
	ZOOM_LEVEL_MEDIUM = 2,
	ZOOM_LEVEL_LARGE = 3
} ZoomLevel;

#define TYPE_ZOOM_LEVEL (zoom_level_get_type ())

struct _SudokuGameView {
	AdwBin parent_instance;
	SudokuGameViewPrivate * priv;
	SudokuGrid* grid;
	SudokuWindow* window;
};

struct _SudokuGameViewClass {
	AdwBinClass parent_class;
};

struct _SudokuGameViewPrivate {
	GtkOverlay* grid_overlay;
	AdwToastOverlay* toast_overlay;
	AdwBin* grid_bin;
	GtkBox* clock_box;
	GtkLabel* clock_label;
	GtkToggleButton* earmark_mode_button;
	AdwWindowTitle* windowtitle;
	GtkStack* play_pause_stack;
	GtkButton* pause_button;
	GtkButton* play_button;
	SudokuMenuButton* menu_button;
	SudokuBackend* backend;
	GtkLabel* paused_label;
	GtkGestureClick* button_controller;
	gulong tick_handle;
	gboolean _initialized;
	GSimpleAction* toggle_pause_action;
	GSimpleAction* earmark_mode_action;
	GSimpleAction* undo_action;
	GSimpleAction* redo_action;
	GSimpleAction* reset_board_action;
	GSimpleAction* save_game_as_action;
	GSimpleAction* share_puzzle_to_clipboard_action;
	GSimpleAction* export_puzzle_to_filesystem_action;
};

struct _SudokuMenuButton {
	AdwBin parent_instance;
	SudokuMenuButtonPrivate * priv;
	GtkStack* menu_fullscreen_stack;
	GtkButton* menu_unfullscreen_button;
	GtkButton* menu_fullscreen_button;
	GtkPopover* main_menu;
};

struct _SudokuMenuButtonClass {
	AdwBinClass parent_class;
};

struct _Block1Data {
	int _ref_count_;
	SudokuGameView* self;
	GtkFileDialog* file_dialog;
};

struct _Block2Data {
	int _ref_count_;
	SudokuGameView* self;
	GtkFileDialog* file_dialog;
};

static gint SudokuGameView_private_offset;
static gpointer sudoku_game_view_parent_class = NULL;
VALA_EXTERN Sudoku* sudoku_app;

VALA_EXTERN GType sudoku_game_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SudokuGameView, g_object_unref)
VALA_EXTERN GType sudoku_grid_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SudokuGrid, g_object_unref)
VALA_EXTERN GType sudoku_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SudokuWindow, g_object_unref)
VALA_EXTERN GType sudoku_menu_button_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SudokuMenuButton, g_object_unref)
static void sudoku_game_view_new_shortcut (SudokuGameViewClass* klass,
                                    const gchar* name,
                                    const gchar* accelerator);
VALA_EXTERN void sudoku_game_view_init (SudokuGameView* self,
                            SudokuBackend* backend,
                            SudokuWindow* window);
static SudokuGame* sudoku_game_view_get_game (SudokuGameView* self);
VALA_EXTERN GType sudoku_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Sudoku, g_object_unref)
static void sudoku_game_view_show_possibilities_cb (SudokuGameView* self);
static void _sudoku_game_view_show_possibilities_cb_g_object_notify (GObject* _sender,
                                                              GParamSpec* pspec,
                                                              gpointer self);
static void sudoku_game_view_warnings_cb (SudokuGameView* self);
static void _sudoku_game_view_warnings_cb_g_object_notify (GObject* _sender,
                                                    GParamSpec* pspec,
                                                    gpointer self);
static void sudoku_game_view_zoom_cb (SudokuGameView* self);
static void _sudoku_game_view_zoom_cb_g_object_notify (GObject* _sender,
                                                GParamSpec* pspec,
                                                gpointer self);
static void sudoku_game_view_show_timer_cb (SudokuGameView* self);
static void _sudoku_game_view_show_timer_cb_g_object_notify (GObject* _sender,
                                                      GParamSpec* pspec,
                                                      gpointer self);
static void sudoku_game_view_window_width_is_small_cb (SudokuGameView* self);
static void _sudoku_game_view_window_width_is_small_cb_g_object_notify (GObject* _sender,
                                                                 GParamSpec* pspec,
                                                                 gpointer self);
static void __lambda8_ (SudokuGameView* self);
static void ___lambda8__gtk_popover_closed (GtkPopover* _sender,
                                     gpointer self);
static void sudoku_game_view_button_released_cb (SudokuGameView* self,
                                          GtkGestureClick* gesture,
                                          gint n_press,
                                          gdouble x,
                                          gdouble y);
static void _sudoku_game_view_button_released_cb_gtk_gesture_click_released (GtkGestureClick* _sender,
                                                                      gint n_press,
                                                                      gdouble x,
                                                                      gdouble y,
                                                                      gpointer self);
static GVariant* _variant_new5 (gboolean value);
static void sudoku_game_view_earmark_mode_cb (SudokuGameView* self);
static void _sudoku_game_view_earmark_mode_cb_g_simple_action_activate (GSimpleAction* _sender,
                                                                 GVariant* parameter,
                                                                 gpointer self);
static GVariant* _variant_new6 (gboolean value);
VALA_EXTERN gboolean sudoku_get_show_timer (Sudoku* self);
VALA_EXTERN void sudoku_game_view_share_puzzle_to_clipboard_cb (SudokuGameView* self);
static void _sudoku_game_view_share_puzzle_to_clipboard_cb_g_simple_action_activate (GSimpleAction* _sender,
                                                                              GVariant* parameter,
                                                                              gpointer self);
VALA_EXTERN void sudoku_game_view_export_puzzle_to_filesystem_cb (SudokuGameView* self);
static void _sudoku_game_view_export_puzzle_to_filesystem_cb_g_simple_action_activate (GSimpleAction* _sender,
                                                                                GVariant* parameter,
                                                                                gpointer self);
VALA_EXTERN void sudoku_game_view_save_game_as_cb (SudokuGameView* self);
static void _sudoku_game_view_save_game_as_cb_g_simple_action_activate (GSimpleAction* _sender,
                                                                 GVariant* parameter,
                                                                 gpointer self);
static void sudoku_game_view_initialize_clock_label (SudokuGameView* self);
static void sudoku_game_view_initialize_buttons (SudokuGameView* self);
static void sudoku_game_view_add_game_hooks (SudokuGameView* self);
static void sudoku_game_view_add_earmark_possibilities (SudokuGameView* self);
VALA_EXTERN SudokuGrid* sudoku_grid_new (SudokuGame* game);
VALA_EXTERN SudokuGrid* sudoku_grid_construct (GType object_type,
                                   SudokuGame* game);
VALA_EXTERN GType sudoku_grid_layout_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SudokuGridLayoutManager, g_object_unref)
VALA_EXTERN SudokuGridLayoutManager* sudoku_grid_layout_manager_new (void);
VALA_EXTERN SudokuGridLayoutManager* sudoku_grid_layout_manager_construct (GType object_type);
static void sudoku_game_view_set_initialized (SudokuGameView* self,
                                       gboolean value);
VALA_EXTERN void sudoku_game_view_change_game (SudokuGameView* self);
VALA_EXTERN void sudoku_grid_change_game (SudokuGrid* self,
                              SudokuGame* new_game);
VALA_EXTERN gboolean sudoku_window_get_width_is_small (SudokuWindow* self);
static gchar* sudoku_game_view_create_timer_string (SudokuGameView* self,
                                             gint elapsed_time);
VALA_EXTERN gboolean sudoku_get_show_possibilities (Sudoku* self);
static void sudoku_game_view_paused_cb (SudokuGameView* self);
static void _sudoku_game_view_paused_cb_g_object_notify (GObject* _sender,
                                                  GParamSpec* pspec,
                                                  gpointer self);
static void sudoku_game_view_action_completed_cb (SudokuGameView* self);
static void _sudoku_game_view_action_completed_cb_sudoku_game_action_completed (SudokuGame* _sender,
                                                                         StackAction action,
                                                                         gpointer self);
static void _sudoku_game_toggle_pause_g_simple_action_activate (GSimpleAction* _sender,
                                                         GVariant* parameter,
                                                         gpointer self);
static void _sudoku_game_reset_g_simple_action_activate (GSimpleAction* _sender,
                                                  GVariant* parameter,
                                                  gpointer self);
static void _sudoku_game_undo_g_simple_action_activate (GSimpleAction* _sender,
                                                 GVariant* parameter,
                                                 gpointer self);
static void _sudoku_game_redo_g_simple_action_activate (GSimpleAction* _sender,
                                                 GVariant* parameter,
                                                 gpointer self);
static void sudoku_game_view_update_tick_connection (SudokuGameView* self);
static void sudoku_game_view_tick_cb (SudokuGameView* self);
static void _sudoku_game_view_tick_cb_sudoku_game_tick (SudokuGame* _sender,
                                                 gpointer self);
VALA_EXTERN void sudoku_grid_update_warnings (SudokuGrid* self);
VALA_EXTERN void sudoku_grid_update_zoom (SudokuGrid* self);
VALA_EXTERN void sudoku_grid_unselect (SudokuGrid* self);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static void __lambda10_ (Block1Data* _data1_,
                  GObject* obj,
                  GAsyncResult* res);
static void ___lambda10__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static void __lambda9_ (Block2Data* _data2_,
                 GObject* obj,
                 GAsyncResult* res);
static void ___lambda9__gasync_ready_callback (GObject* source_object,
                                        GAsyncResult* res,
                                        gpointer self);
VALA_EXTERN gboolean sudoku_get_earmark_mode (Sudoku* self);
VALA_EXTERN void sudoku_set_earmark_mode (Sudoku* self,
                              gboolean value);
static gboolean sudoku_game_view_real_grab_focus (GtkWidget* base);
static void sudoku_game_view_real_dispose (GObject* base);
VALA_EXTERN SudokuGameView* sudoku_game_view_new (void);
VALA_EXTERN SudokuGameView* sudoku_game_view_construct (GType object_type);
VALA_EXTERN gboolean sudoku_game_view_get_initialized (SudokuGameView* self);
static void sudoku_game_view_finalize (GObject * obj);
static GType sudoku_game_view_get_type_once (void);
static void _vala_sudoku_game_view_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec);
static void _vala_sudoku_game_view_set_property (GObject * object,
                                          guint property_id,
                                          const GValue * value,
                                          GParamSpec * pspec);
VALA_EXTERN GType zoom_level_get_type (void) G_GNUC_CONST ;
VALA_EXTERN gboolean zoom_level_is_fully_zoomed_out (ZoomLevel self);
VALA_EXTERN gboolean zoom_level_is_fully_zoomed_in (ZoomLevel self);
VALA_EXTERN ZoomLevel zoom_level_zoom_in (ZoomLevel self);
VALA_EXTERN ZoomLevel zoom_level_zoom_out (ZoomLevel self);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static inline gpointer
sudoku_game_view_get_instance_private (SudokuGameView* self)
{
	return G_STRUCT_MEMBER_P (self, SudokuGameView_private_offset);
}

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

static void
sudoku_game_view_new_shortcut (SudokuGameViewClass* klass,
                               const gchar* name,
                               const gchar* accelerator)
{
	GtkNamedAction* action = NULL;
	GtkNamedAction* _tmp0_;
	GtkShortcutTrigger* trigger = NULL;
	GtkShortcutTrigger* _tmp1_;
	GtkShortcut* shortcut = NULL;
	GtkShortcutTrigger* _tmp2_;
	GtkShortcutAction* _tmp3_;
	GtkShortcut* _tmp4_;
	g_return_if_fail (name != NULL);
	g_return_if_fail (accelerator != NULL);
	_tmp0_ = (GtkNamedAction*) gtk_named_action_new (name);
	action = _tmp0_;
	_tmp1_ = gtk_shortcut_trigger_parse_string (accelerator);
	trigger = _tmp1_;
	_tmp2_ = _g_object_ref0 (trigger);
	_tmp3_ = _g_object_ref0 ((GtkShortcutAction*) action);
	_tmp4_ = gtk_shortcut_new (_tmp2_, _tmp3_);
	shortcut = _tmp4_;
	gtk_widget_class_add_shortcut (GTK_WIDGET_CLASS (klass), shortcut);
	_g_object_unref0 (shortcut);
	_g_object_unref0 (trigger);
	_g_object_unref0 (action);
}

static void
_sudoku_game_view_show_possibilities_cb_g_object_notify (GObject* _sender,
                                                         GParamSpec* pspec,
                                                         gpointer self)
{
	sudoku_game_view_show_possibilities_cb ((SudokuGameView*) self);
}

static void
_sudoku_game_view_warnings_cb_g_object_notify (GObject* _sender,
                                               GParamSpec* pspec,
                                               gpointer self)
{
	sudoku_game_view_warnings_cb ((SudokuGameView*) self);
}

static void
_sudoku_game_view_zoom_cb_g_object_notify (GObject* _sender,
                                           GParamSpec* pspec,
                                           gpointer self)
{
	sudoku_game_view_zoom_cb ((SudokuGameView*) self);
}

static void
_sudoku_game_view_show_timer_cb_g_object_notify (GObject* _sender,
                                                 GParamSpec* pspec,
                                                 gpointer self)
{
	sudoku_game_view_show_timer_cb ((SudokuGameView*) self);
}

static void
_sudoku_game_view_window_width_is_small_cb_g_object_notify (GObject* _sender,
                                                            GParamSpec* pspec,
                                                            gpointer self)
{
	sudoku_game_view_window_width_is_small_cb ((SudokuGameView*) self);
}

static void
__lambda8_ (SudokuGameView* self)
{
	gtk_widget_grab_focus ((GtkWidget*) self);
}

static void
___lambda8__gtk_popover_closed (GtkPopover* _sender,
                                gpointer self)
{
	__lambda8_ ((SudokuGameView*) self);
}

static void
_sudoku_game_view_button_released_cb_gtk_gesture_click_released (GtkGestureClick* _sender,
                                                                 gint n_press,
                                                                 gdouble x,
                                                                 gdouble y,
                                                                 gpointer self)
{
	sudoku_game_view_button_released_cb ((SudokuGameView*) self, _sender, n_press, x, y);
}

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

static void
_sudoku_game_view_earmark_mode_cb_g_simple_action_activate (GSimpleAction* _sender,
                                                            GVariant* parameter,
                                                            gpointer self)
{
	sudoku_game_view_earmark_mode_cb ((SudokuGameView*) self);
}

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

static void
_sudoku_game_view_share_puzzle_to_clipboard_cb_g_simple_action_activate (GSimpleAction* _sender,
                                                                         GVariant* parameter,
                                                                         gpointer self)
{
	sudoku_game_view_share_puzzle_to_clipboard_cb ((SudokuGameView*) self);
}

static void
_sudoku_game_view_export_puzzle_to_filesystem_cb_g_simple_action_activate (GSimpleAction* _sender,
                                                                           GVariant* parameter,
                                                                           gpointer self)
{
	sudoku_game_view_export_puzzle_to_filesystem_cb ((SudokuGameView*) self);
}

static void
_sudoku_game_view_save_game_as_cb_g_simple_action_activate (GSimpleAction* _sender,
                                                            GVariant* parameter,
                                                            gpointer self)
{
	sudoku_game_view_save_game_as_cb ((SudokuGameView*) self);
}

void
sudoku_game_view_init (SudokuGameView* self,
                       SudokuBackend* backend,
                       SudokuWindow* window)
{
	SudokuBackend* _tmp0_;
	AdwWindowTitle* _tmp1_;
	SudokuGame* _tmp2_;
	SudokuGame* _tmp3_;
	SudokuBoard* _tmp4_;
	SudokuBoard* _tmp5_;
	DifficultyCategory _tmp6_;
	DifficultyCategory _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	Sudoku* _tmp10_;
	Sudoku* _tmp11_;
	Sudoku* _tmp12_;
	Sudoku* _tmp13_;
	Sudoku* _tmp14_;
	Sudoku* _tmp15_;
	SudokuWindow* _tmp16_;
	SudokuMenuButton* _tmp17_;
	GtkPopover* _tmp18_;
	GtkGestureClick* _tmp19_;
	GtkGestureClick* _tmp20_;
	GtkGestureClick* _tmp21_;
	GtkGestureClick* _tmp22_;
	GtkEventController* _tmp23_;
	GSimpleActionGroup* action_group = NULL;
	GSimpleActionGroup* _tmp24_;
	GVariant* _tmp25_;
	GSimpleAction* _tmp26_;
	GSimpleAction* _tmp27_;
	GSimpleAction* _tmp28_;
	GSimpleActionGroup* _tmp29_;
	GSimpleAction* _tmp30_;
	GVariant* _tmp31_;
	GSimpleAction* _tmp32_;
	GSimpleAction* _tmp33_;
	Sudoku* _tmp34_;
	gboolean _tmp35_;
	gboolean _tmp36_;
	GSimpleActionGroup* _tmp37_;
	GSimpleAction* _tmp38_;
	GSimpleAction* _tmp39_;
	GSimpleAction* _tmp40_;
	SudokuGame* _tmp41_;
	SudokuGame* _tmp42_;
	GSimpleActionGroup* _tmp43_;
	GSimpleAction* _tmp44_;
	GSimpleAction* _tmp45_;
	GSimpleAction* _tmp46_;
	SudokuGame* _tmp47_;
	SudokuGame* _tmp48_;
	GSimpleActionGroup* _tmp49_;
	GSimpleAction* _tmp50_;
	GSimpleAction* _tmp51_;
	GSimpleAction* _tmp52_;
	SudokuGame* _tmp53_;
	SudokuGame* _tmp54_;
	GSimpleActionGroup* _tmp55_;
	GSimpleAction* _tmp56_;
	GSimpleAction* _tmp57_;
	GSimpleAction* _tmp58_;
	GSimpleActionGroup* _tmp59_;
	GSimpleAction* _tmp60_;
	GSimpleAction* _tmp61_;
	GSimpleAction* _tmp62_;
	GSimpleActionGroup* _tmp63_;
	GSimpleAction* _tmp64_;
	GSimpleAction* _tmp65_;
	GSimpleAction* _tmp66_;
	GSimpleActionGroup* _tmp67_;
	GSimpleAction* _tmp68_;
	GSimpleActionGroup* _tmp69_;
	GtkLabel* _tmp70_;
	SudokuGame* _tmp71_;
	SudokuGame* _tmp72_;
	SudokuBoard* _tmp73_;
	SudokuBoard* _tmp74_;
	gdouble _tmp75_;
	gdouble _tmp76_;
	SudokuGame* _tmp77_;
	SudokuGame* _tmp78_;
	SudokuGrid* _tmp79_;
	SudokuGridLayoutManager* grid_layout = NULL;
	SudokuGridLayoutManager* _tmp80_;
	AdwBin* _tmp81_;
	GtkLayoutManager* _tmp82_;
	GtkOverlay* _tmp83_;
	SudokuGrid* _tmp84_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (backend != NULL);
	g_return_if_fail (window != NULL);
	_tmp0_ = _g_object_ref0 (backend);
	_g_object_unref0 (self->priv->backend);
	self->priv->backend = _tmp0_;
	self->window = window;
	_tmp1_ = self->priv->windowtitle;
	_tmp2_ = sudoku_game_view_get_game (self);
	_tmp3_ = _tmp2_;
	_tmp4_ = sudoku_game_get_board (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = sudoku_board_get_difficulty_category (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = difficulty_category_to_string (_tmp7_);
	_tmp9_ = _tmp8_;
	adw_window_title_set_subtitle (_tmp1_, _tmp9_);
	_g_free0 (_tmp9_);
	_tmp10_ = sudoku_app;
	g_signal_connect_object ((GObject*) _tmp10_, "notify::show-possibilities", (GCallback) _sudoku_game_view_show_possibilities_cb_g_object_notify, self, 0);
	_tmp11_ = sudoku_app;
	g_signal_connect_object ((GObject*) _tmp11_, "notify::duplicate-warnings", (GCallback) _sudoku_game_view_warnings_cb_g_object_notify, self, 0);
	_tmp12_ = sudoku_app;
	g_signal_connect_object ((GObject*) _tmp12_, "notify::solution-warnings", (GCallback) _sudoku_game_view_warnings_cb_g_object_notify, self, 0);
	_tmp13_ = sudoku_app;
	g_signal_connect_object ((GObject*) _tmp13_, "notify::earmark-warnings", (GCallback) _sudoku_game_view_warnings_cb_g_object_notify, self, 0);
	_tmp14_ = sudoku_app;
	g_signal_connect_object ((GObject*) _tmp14_, "notify::zoom-level", (GCallback) _sudoku_game_view_zoom_cb_g_object_notify, self, 0);
	_tmp15_ = sudoku_app;
	g_signal_connect_object ((GObject*) _tmp15_, "notify::show-timer", (GCallback) _sudoku_game_view_show_timer_cb_g_object_notify, self, 0);
	_tmp16_ = self->window;
	g_signal_connect_object ((GObject*) _tmp16_, "notify::width-is-small", (GCallback) _sudoku_game_view_window_width_is_small_cb_g_object_notify, self, 0);
	_tmp17_ = self->priv->menu_button;
	_tmp18_ = _tmp17_->main_menu;
	g_signal_connect_object (_tmp18_, "closed", (GCallback) ___lambda8__gtk_popover_closed, self, 0);
	_tmp19_ = (GtkGestureClick*) gtk_gesture_click_new ();
	_g_object_unref0 (self->priv->button_controller);
	self->priv->button_controller = _tmp19_;
	_tmp20_ = self->priv->button_controller;
	gtk_gesture_single_set_button ((GtkGestureSingle*) _tmp20_, (guint) 0);
	_tmp21_ = self->priv->button_controller;
	g_signal_connect_object (_tmp21_, "released", (GCallback) _sudoku_game_view_button_released_cb_gtk_gesture_click_released, self, 0);
	_tmp22_ = self->priv->button_controller;
	_tmp23_ = _g_object_ref0 ((GtkEventController*) _tmp22_);
	gtk_widget_add_controller (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), _tmp23_);
	_tmp24_ = g_simple_action_group_new ();
	action_group = _tmp24_;
	_tmp25_ = _variant_new5 (FALSE);
	_tmp26_ = g_simple_action_new_stateful ("earmark-mode", NULL, _tmp25_);
	_g_object_unref0 (self->priv->earmark_mode_action);
	self->priv->earmark_mode_action = _tmp26_;
	_g_variant_unref0 (_tmp25_);
	_tmp27_ = self->priv->earmark_mode_action;
	g_simple_action_set_enabled (_tmp27_, TRUE);
	_tmp28_ = self->priv->earmark_mode_action;
	g_signal_connect_object (_tmp28_, "activate", (GCallback) _sudoku_game_view_earmark_mode_cb_g_simple_action_activate, self, 0);
	_tmp29_ = action_group;
	_tmp30_ = self->priv->earmark_mode_action;
	g_action_map_add_action ((GActionMap*) _tmp29_, (GAction*) _tmp30_);
	_tmp31_ = _variant_new6 (FALSE);
	_tmp32_ = g_simple_action_new_stateful ("toggle-pause", NULL, _tmp31_);
	_g_object_unref0 (self->priv->toggle_pause_action);
	self->priv->toggle_pause_action = _tmp32_;
	_g_variant_unref0 (_tmp31_);
	_tmp33_ = self->priv->toggle_pause_action;
	_tmp34_ = sudoku_app;
	_tmp35_ = sudoku_get_show_timer (_tmp34_);
	_tmp36_ = _tmp35_;
	g_simple_action_set_enabled (_tmp33_, _tmp36_);
	_tmp37_ = action_group;
	_tmp38_ = self->priv->toggle_pause_action;
	g_action_map_add_action ((GActionMap*) _tmp37_, (GAction*) _tmp38_);
	_tmp39_ = g_simple_action_new ("reset-board", NULL);
	_g_object_unref0 (self->priv->reset_board_action);
	self->priv->reset_board_action = _tmp39_;
	_tmp40_ = self->priv->reset_board_action;
	_tmp41_ = sudoku_game_view_get_game (self);
	_tmp42_ = _tmp41_;
	g_simple_action_set_enabled (_tmp40_, !sudoku_game_is_empty (_tmp42_));
	_tmp43_ = action_group;
	_tmp44_ = self->priv->reset_board_action;
	g_action_map_add_action ((GActionMap*) _tmp43_, (GAction*) _tmp44_);
	_tmp45_ = g_simple_action_new ("undo", NULL);
	_g_object_unref0 (self->priv->undo_action);
	self->priv->undo_action = _tmp45_;
	_tmp46_ = self->priv->undo_action;
	_tmp47_ = sudoku_game_view_get_game (self);
	_tmp48_ = _tmp47_;
	g_simple_action_set_enabled (_tmp46_, !sudoku_game_is_undostack_null (_tmp48_));
	_tmp49_ = action_group;
	_tmp50_ = self->priv->undo_action;
	g_action_map_add_action ((GActionMap*) _tmp49_, (GAction*) _tmp50_);
	_tmp51_ = g_simple_action_new ("redo", NULL);
	_g_object_unref0 (self->priv->redo_action);
	self->priv->redo_action = _tmp51_;
	_tmp52_ = self->priv->redo_action;
	_tmp53_ = sudoku_game_view_get_game (self);
	_tmp54_ = _tmp53_;
	g_simple_action_set_enabled (_tmp52_, !sudoku_game_is_redostack_null (_tmp54_));
	_tmp55_ = action_group;
	_tmp56_ = self->priv->redo_action;
	g_action_map_add_action ((GActionMap*) _tmp55_, (GAction*) _tmp56_);
	_tmp57_ = g_simple_action_new ("share-puzzle-to-clipboard", NULL);
	_g_object_unref0 (self->priv->share_puzzle_to_clipboard_action);
	self->priv->share_puzzle_to_clipboard_action = _tmp57_;
	_tmp58_ = self->priv->share_puzzle_to_clipboard_action;
	g_signal_connect_object (_tmp58_, "activate", (GCallback) _sudoku_game_view_share_puzzle_to_clipboard_cb_g_simple_action_activate, self, 0);
	_tmp59_ = action_group;
	_tmp60_ = self->priv->share_puzzle_to_clipboard_action;
	g_action_map_add_action ((GActionMap*) _tmp59_, (GAction*) _tmp60_);
	_tmp61_ = g_simple_action_new ("export-puzzle-to-filesystem", NULL);
	_g_object_unref0 (self->priv->export_puzzle_to_filesystem_action);
	self->priv->export_puzzle_to_filesystem_action = _tmp61_;
	_tmp62_ = self->priv->export_puzzle_to_filesystem_action;
	g_signal_connect_object (_tmp62_, "activate", (GCallback) _sudoku_game_view_export_puzzle_to_filesystem_cb_g_simple_action_activate, self, 0);
	_tmp63_ = action_group;
	_tmp64_ = self->priv->export_puzzle_to_filesystem_action;
	g_action_map_add_action ((GActionMap*) _tmp63_, (GAction*) _tmp64_);
	_tmp65_ = g_simple_action_new ("save-game-as", NULL);
	_g_object_unref0 (self->priv->save_game_as_action);
	self->priv->save_game_as_action = _tmp65_;
	_tmp66_ = self->priv->save_game_as_action;
	g_signal_connect_object (_tmp66_, "activate", (GCallback) _sudoku_game_view_save_game_as_cb_g_simple_action_activate, self, 0);
	_tmp67_ = action_group;
	_tmp68_ = self->priv->save_game_as_action;
	g_action_map_add_action ((GActionMap*) _tmp67_, (GAction*) _tmp68_);
	_tmp69_ = action_group;
	gtk_widget_insert_action_group ((GtkWidget*) self, "game-view", (GActionGroup*) _tmp69_);
	_tmp70_ = (GtkLabel*) gtk_label_new (_ ("Paused"));
	g_object_ref_sink (_tmp70_);
	_g_object_unref0 (self->priv->paused_label);
	self->priv->paused_label = _tmp70_;
	sudoku_game_view_initialize_clock_label (self);
	sudoku_game_view_initialize_buttons (self);
	sudoku_game_view_add_game_hooks (self);
	_tmp71_ = sudoku_game_view_get_game (self);
	_tmp72_ = _tmp71_;
	_tmp73_ = sudoku_game_get_board (_tmp72_);
	_tmp74_ = _tmp73_;
	_tmp75_ = sudoku_board_get_previous_played_time (_tmp74_);
	_tmp76_ = _tmp75_;
	if (_tmp76_ == 0.0) {
		sudoku_game_view_add_earmark_possibilities (self);
	}
	gtk_widget_set_vexpand ((GtkWidget*) self, TRUE);
	gtk_widget_set_focusable ((GtkWidget*) self, TRUE);
	_tmp77_ = sudoku_game_view_get_game (self);
	_tmp78_ = _tmp77_;
	_tmp79_ = sudoku_grid_new (_tmp78_);
	g_object_ref_sink (_tmp79_);
	_g_object_unref0 (self->grid);
	self->grid = _tmp79_;
	_tmp80_ = sudoku_grid_layout_manager_new ();
	grid_layout = _tmp80_;
	_tmp81_ = self->priv->grid_bin;
	_tmp82_ = _g_object_ref0 ((GtkLayoutManager*) grid_layout);
	gtk_widget_set_layout_manager ((GtkWidget*) _tmp81_, _tmp82_);
	_tmp83_ = self->priv->grid_overlay;
	_tmp84_ = self->grid;
	gtk_overlay_set_child (_tmp83_, (GtkWidget*) _tmp84_);
	sudoku_game_view_set_initialized (self, TRUE);
	_g_object_unref0 (grid_layout);
	_g_object_unref0 (action_group);
}

void
sudoku_game_view_change_game (SudokuGameView* self)
{
	GSimpleAction* _tmp0_;
	GSimpleAction* _tmp1_;
	Sudoku* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	SudokuGrid* _tmp5_;
	SudokuGame* _tmp6_;
	SudokuGame* _tmp7_;
	AdwWindowTitle* _tmp8_;
	SudokuGame* _tmp9_;
	SudokuGame* _tmp10_;
	SudokuBoard* _tmp11_;
	SudokuBoard* _tmp12_;
	DifficultyCategory _tmp13_;
	DifficultyCategory _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	g_return_if_fail (self != NULL);
	sudoku_game_view_add_game_hooks (self);
	_tmp0_ = self->priv->earmark_mode_action;
	g_simple_action_set_enabled (_tmp0_, TRUE);
	_tmp1_ = self->priv->toggle_pause_action;
	_tmp2_ = sudoku_app;
	_tmp3_ = sudoku_get_show_timer (_tmp2_);
	_tmp4_ = _tmp3_;
	g_simple_action_set_enabled (_tmp1_, _tmp4_);
	sudoku_game_view_initialize_buttons (self);
	sudoku_game_view_add_earmark_possibilities (self);
	_tmp5_ = self->grid;
	_tmp6_ = sudoku_game_view_get_game (self);
	_tmp7_ = _tmp6_;
	sudoku_grid_change_game (_tmp5_, _tmp7_);
	sudoku_game_view_initialize_clock_label (self);
	_tmp8_ = self->priv->windowtitle;
	_tmp9_ = sudoku_game_view_get_game (self);
	_tmp10_ = _tmp9_;
	_tmp11_ = sudoku_game_get_board (_tmp10_);
	_tmp12_ = _tmp11_;
	_tmp13_ = sudoku_board_get_difficulty_category (_tmp12_);
	_tmp14_ = _tmp13_;
	_tmp15_ = difficulty_category_to_string (_tmp14_);
	_tmp16_ = _tmp15_;
	adw_window_title_set_subtitle (_tmp8_, _tmp16_);
	_g_free0 (_tmp16_);
	G_TYPE_INSTANCE_GET_CLASS ((GtkWidget*) self, gtk_widget_get_type (), GtkWidgetClass)->focus ((GtkWidget*) self, GTK_DIR_TAB_FORWARD);
}

static void
sudoku_game_view_initialize_buttons (SudokuGameView* self)
{
	gboolean _tmp0_ = FALSE;
	Sudoku* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	GtkBox* _tmp7_;
	GtkStack* _tmp8_;
	Sudoku* _tmp9_;
	gboolean _tmp10_;
	gboolean _tmp11_;
	gboolean _tmp12_ = FALSE;
	Sudoku* _tmp13_;
	gboolean _tmp14_;
	gboolean _tmp15_;
	GtkToggleButton* _tmp23_;
	g_return_if_fail (self != NULL);
	_tmp1_ = sudoku_app;
	_tmp2_ = sudoku_get_show_timer (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_) {
		SudokuWindow* _tmp4_;
		gboolean _tmp5_;
		gboolean _tmp6_;
		_tmp4_ = self->window;
		_tmp5_ = sudoku_window_get_width_is_small (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp0_ = !_tmp6_;
	} else {
		_tmp0_ = FALSE;
	}
	_tmp7_ = self->priv->clock_box;
	gtk_widget_set_visible ((GtkWidget*) _tmp7_, _tmp0_);
	_tmp8_ = self->priv->play_pause_stack;
	_tmp9_ = sudoku_app;
	_tmp10_ = sudoku_get_show_timer (_tmp9_);
	_tmp11_ = _tmp10_;
	gtk_widget_set_visible ((GtkWidget*) _tmp8_, _tmp11_);
	_tmp13_ = sudoku_app;
	_tmp14_ = sudoku_get_show_timer (_tmp13_);
	_tmp15_ = _tmp14_;
	if (!_tmp15_) {
		_tmp12_ = TRUE;
	} else {
		gboolean _tmp16_ = FALSE;
		Sudoku* _tmp17_;
		gboolean _tmp18_;
		gboolean _tmp19_;
		_tmp17_ = sudoku_app;
		_tmp18_ = sudoku_get_show_timer (_tmp17_);
		_tmp19_ = _tmp18_;
		if (_tmp19_) {
			SudokuWindow* _tmp20_;
			gboolean _tmp21_;
			gboolean _tmp22_;
			_tmp20_ = self->window;
			_tmp21_ = sudoku_window_get_width_is_small (_tmp20_);
			_tmp22_ = _tmp21_;
			_tmp16_ = !_tmp22_;
		} else {
			_tmp16_ = FALSE;
		}
		_tmp12_ = _tmp16_;
	}
	_tmp23_ = self->priv->earmark_mode_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp23_, _tmp12_);
}

static void
sudoku_game_view_initialize_clock_label (SudokuGameView* self)
{
	Sudoku* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gint elapsed_time = 0;
	SudokuGame* _tmp3_;
	SudokuGame* _tmp4_;
	gchar* highscore_string = NULL;
	gchar* _tmp5_;
	gdouble* highscore = NULL;
	SudokuBackend* _tmp6_;
	gdouble* _tmp7_;
	gdouble* _tmp8_;
	GtkLabel* _tmp39_;
	gchar* _tmp40_;
	gchar* _tmp41_;
	g_return_if_fail (self != NULL);
	_tmp0_ = sudoku_app;
	_tmp1_ = sudoku_get_show_timer (_tmp0_);
	_tmp2_ = _tmp1_;
	if (!_tmp2_) {
		return;
	}
	_tmp3_ = sudoku_game_view_get_game (self);
	_tmp4_ = _tmp3_;
	elapsed_time = (gint) sudoku_game_get_total_time_played (_tmp4_);
	_tmp5_ = g_strdup ("");
	highscore_string = _tmp5_;
	_tmp6_ = self->priv->backend;
	_tmp7_ = sudoku_backend_get_highscore (_tmp6_);
	highscore = _tmp7_;
	_tmp8_ = highscore;
	if (_tmp8_ != NULL) {
		gdouble* _tmp9_;
		gchar* _tmp10_;
		gchar* _tmp11_;
		gchar* _tmp12_;
		GtkBox* _tmp13_;
		const gchar* _tmp14_;
		gchar* _tmp15_;
		gchar* _tmp16_;
		gdouble* _tmp17_;
		_tmp9_ = highscore;
		_tmp10_ = sudoku_game_view_create_timer_string (self, (gint) (*_tmp9_));
		_tmp11_ = _tmp10_;
		_tmp12_ = g_strconcat ("🥇", _tmp11_, NULL);
		_g_free0 (highscore_string);
		highscore_string = _tmp12_;
		_g_free0 (_tmp11_);
		_tmp13_ = self->priv->clock_box;
		_tmp14_ = highscore_string;
		_tmp15_ = g_strdup_printf ("<span font_features='tnum=1'>%s</span>", _tmp14_);
		_tmp16_ = _tmp15_;
		gtk_widget_set_tooltip_markup ((GtkWidget*) _tmp13_, _tmp16_);
		_g_free0 (_tmp16_);
		_tmp17_ = highscore;
		if (((gdouble) elapsed_time) > (*_tmp17_)) {
			GtkLabel* _tmp18_;
			gchar* _tmp19_;
			gchar** _tmp20_;
			gchar** _tmp21_;
			gint _tmp21__length1;
			_tmp18_ = self->priv->clock_label;
			_tmp19_ = g_strdup ("numeric");
			_tmp20_ = g_new0 (gchar*, 1 + 1);
			_tmp20_[0] = _tmp19_;
			_tmp21_ = _tmp20_;
			_tmp21__length1 = 1;
			gtk_widget_set_css_classes ((GtkWidget*) _tmp18_, _tmp21_);
			_tmp21_ = (_vala_array_free (_tmp21_, _tmp21__length1, (GDestroyNotify) g_free), NULL);
		} else {
			gdouble* _tmp22_;
			_tmp22_ = highscore;
			if (((gdouble) elapsed_time) > ((*_tmp22_) - 60)) {
				GtkLabel* _tmp23_;
				gchar* _tmp24_;
				gchar* _tmp25_;
				gchar** _tmp26_;
				gchar** _tmp27_;
				gint _tmp27__length1;
				_tmp23_ = self->priv->clock_label;
				_tmp24_ = g_strdup ("numeric");
				_tmp25_ = g_strdup ("warning");
				_tmp26_ = g_new0 (gchar*, 2 + 1);
				_tmp26_[0] = _tmp24_;
				_tmp26_[1] = _tmp25_;
				_tmp27_ = _tmp26_;
				_tmp27__length1 = 2;
				gtk_widget_set_css_classes ((GtkWidget*) _tmp23_, _tmp27_);
				_tmp27_ = (_vala_array_free (_tmp27_, _tmp27__length1, (GDestroyNotify) g_free), NULL);
			} else {
				GtkLabel* _tmp28_;
				gchar* _tmp29_;
				gchar* _tmp30_;
				gchar** _tmp31_;
				gchar** _tmp32_;
				gint _tmp32__length1;
				_tmp28_ = self->priv->clock_label;
				_tmp29_ = g_strdup ("numeric");
				_tmp30_ = g_strdup ("success");
				_tmp31_ = g_new0 (gchar*, 2 + 1);
				_tmp31_[0] = _tmp29_;
				_tmp31_[1] = _tmp30_;
				_tmp32_ = _tmp31_;
				_tmp32__length1 = 2;
				gtk_widget_set_css_classes ((GtkWidget*) _tmp28_, _tmp32_);
				_tmp32_ = (_vala_array_free (_tmp32_, _tmp32__length1, (GDestroyNotify) g_free), NULL);
			}
		}
	} else {
		GtkLabel* _tmp33_;
		gchar* _tmp34_;
		gchar** _tmp35_;
		gchar** _tmp36_;
		gint _tmp36__length1;
		GtkBox* _tmp37_;
		const gchar* _tmp38_;
		_tmp33_ = self->priv->clock_label;
		_tmp34_ = g_strdup ("numeric");
		_tmp35_ = g_new0 (gchar*, 1 + 1);
		_tmp35_[0] = _tmp34_;
		_tmp36_ = _tmp35_;
		_tmp36__length1 = 1;
		gtk_widget_set_css_classes ((GtkWidget*) _tmp33_, _tmp36_);
		_tmp36_ = (_vala_array_free (_tmp36_, _tmp36__length1, (GDestroyNotify) g_free), NULL);
		_tmp37_ = self->priv->clock_box;
		_tmp38_ = highscore_string;
		gtk_widget_set_tooltip_text ((GtkWidget*) _tmp37_, _tmp38_);
	}
	_tmp39_ = self->priv->clock_label;
	_tmp40_ = sudoku_game_view_create_timer_string (self, elapsed_time);
	_tmp41_ = _tmp40_;
	gtk_label_set_label (_tmp39_, _tmp41_);
	_g_free0 (_tmp41_);
	_g_free0 (highscore);
	_g_free0 (highscore_string);
}

static gchar*
sudoku_game_view_create_timer_string (SudokuGameView* self,
                                      gint elapsed_time)
{
	gchar* ret = NULL;
	gchar* _tmp0_;
	gint hours = 0;
	gint minutes = 0;
	gint seconds = 0;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup ("");
	ret = _tmp0_;
	hours = elapsed_time / 3600;
	minutes = (elapsed_time - (hours * 3600)) / 60;
	seconds = (elapsed_time - (hours * 3600)) - (minutes * 60);
	if (hours > 0) {
		gchar* _tmp1_;
		_tmp1_ = g_strdup_printf ("%02d∶\xE2\x80\x8E%02d∶\xE2\x80\x8E%02d", hours, minutes, seconds);
		_g_free0 (ret);
		ret = _tmp1_;
	} else {
		gchar* _tmp2_;
		_tmp2_ = g_strdup_printf ("%02d∶\xE2\x80\x8E%02d", minutes, seconds);
		_g_free0 (ret);
		ret = _tmp2_;
	}
	result = ret;
	return result;
}

static void
sudoku_game_view_add_earmark_possibilities (SudokuGameView* self)
{
	Sudoku* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = sudoku_app;
	_tmp1_ = sudoku_get_show_possibilities (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		SudokuGame* _tmp3_;
		SudokuGame* _tmp4_;
		_tmp3_ = sudoku_game_view_get_game (self);
		_tmp4_ = _tmp3_;
		sudoku_game_enable_all_earmark_possibilities (_tmp4_);
	}
}

static void
_sudoku_game_view_paused_cb_g_object_notify (GObject* _sender,
                                             GParamSpec* pspec,
                                             gpointer self)
{
	sudoku_game_view_paused_cb ((SudokuGameView*) self);
}

static void
_sudoku_game_view_action_completed_cb_sudoku_game_action_completed (SudokuGame* _sender,
                                                                    StackAction action,
                                                                    gpointer self)
{
	sudoku_game_view_action_completed_cb ((SudokuGameView*) self);
}

static void
_sudoku_game_toggle_pause_g_simple_action_activate (GSimpleAction* _sender,
                                                    GVariant* parameter,
                                                    gpointer self)
{
	sudoku_game_toggle_pause ((SudokuGame*) self);
}

static void
_sudoku_game_reset_g_simple_action_activate (GSimpleAction* _sender,
                                             GVariant* parameter,
                                             gpointer self)
{
	sudoku_game_reset ((SudokuGame*) self);
}

static void
_sudoku_game_undo_g_simple_action_activate (GSimpleAction* _sender,
                                            GVariant* parameter,
                                            gpointer self)
{
	sudoku_game_undo ((SudokuGame*) self);
}

static void
_sudoku_game_redo_g_simple_action_activate (GSimpleAction* _sender,
                                            GVariant* parameter,
                                            gpointer self)
{
	sudoku_game_redo ((SudokuGame*) self);
}

static void
sudoku_game_view_add_game_hooks (SudokuGameView* self)
{
	SudokuGame* _tmp0_;
	SudokuGame* _tmp1_;
	SudokuGame* _tmp2_;
	SudokuGame* _tmp3_;
	GSimpleAction* _tmp4_;
	SudokuGame* _tmp5_;
	SudokuGame* _tmp6_;
	GSimpleAction* _tmp7_;
	SudokuGame* _tmp8_;
	SudokuGame* _tmp9_;
	GSimpleAction* _tmp10_;
	SudokuGame* _tmp11_;
	SudokuGame* _tmp12_;
	GSimpleAction* _tmp13_;
	SudokuGame* _tmp14_;
	SudokuGame* _tmp15_;
	g_return_if_fail (self != NULL);
	_tmp0_ = sudoku_game_view_get_game (self);
	_tmp1_ = _tmp0_;
	g_signal_connect_object ((GObject*) _tmp1_, "notify::paused", (GCallback) _sudoku_game_view_paused_cb_g_object_notify, self, 0);
	_tmp2_ = sudoku_game_view_get_game (self);
	_tmp3_ = _tmp2_;
	g_signal_connect_object (_tmp3_, "action-completed", (GCallback) _sudoku_game_view_action_completed_cb_sudoku_game_action_completed, self, 0);
	_tmp4_ = self->priv->toggle_pause_action;
	_tmp5_ = sudoku_game_view_get_game (self);
	_tmp6_ = _tmp5_;
	g_signal_connect_object (_tmp4_, "activate", (GCallback) _sudoku_game_toggle_pause_g_simple_action_activate, _tmp6_, 0);
	_tmp7_ = self->priv->reset_board_action;
	_tmp8_ = sudoku_game_view_get_game (self);
	_tmp9_ = _tmp8_;
	g_signal_connect_object (_tmp7_, "activate", (GCallback) _sudoku_game_reset_g_simple_action_activate, _tmp9_, 0);
	_tmp10_ = self->priv->undo_action;
	_tmp11_ = sudoku_game_view_get_game (self);
	_tmp12_ = _tmp11_;
	g_signal_connect_object (_tmp10_, "activate", (GCallback) _sudoku_game_undo_g_simple_action_activate, _tmp12_, 0);
	_tmp13_ = self->priv->redo_action;
	_tmp14_ = sudoku_game_view_get_game (self);
	_tmp15_ = _tmp14_;
	g_signal_connect_object (_tmp13_, "activate", (GCallback) _sudoku_game_redo_g_simple_action_activate, _tmp15_, 0);
	self->priv->tick_handle = (gulong) 0;
	sudoku_game_view_update_tick_connection (self);
}

static void
_sudoku_game_view_tick_cb_sudoku_game_tick (SudokuGame* _sender,
                                            gpointer self)
{
	sudoku_game_view_tick_cb ((SudokuGameView*) self);
}

static void
sudoku_game_view_update_tick_connection (SudokuGameView* self)
{
	gboolean _tmp0_ = FALSE;
	g_return_if_fail (self != NULL);
	if (self->priv->tick_handle == ((gulong) 0)) {
		Sudoku* _tmp1_;
		gboolean _tmp2_;
		gboolean _tmp3_;
		_tmp1_ = sudoku_app;
		_tmp2_ = sudoku_get_show_timer (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp0_ = _tmp3_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		SudokuGame* _tmp4_;
		SudokuGame* _tmp5_;
		gulong _tmp6_;
		_tmp4_ = sudoku_game_view_get_game (self);
		_tmp5_ = _tmp4_;
		_tmp6_ = g_signal_connect_object (_tmp5_, "tick", (GCallback) _sudoku_game_view_tick_cb_sudoku_game_tick, self, 0);
		self->priv->tick_handle = _tmp6_;
	} else {
		gboolean _tmp7_ = FALSE;
		if (self->priv->tick_handle != ((gulong) 0)) {
			Sudoku* _tmp8_;
			gboolean _tmp9_;
			gboolean _tmp10_;
			_tmp8_ = sudoku_app;
			_tmp9_ = sudoku_get_show_timer (_tmp8_);
			_tmp10_ = _tmp9_;
			_tmp7_ = !_tmp10_;
		} else {
			_tmp7_ = FALSE;
		}
		if (_tmp7_) {
			SudokuGame* _tmp11_;
			SudokuGame* _tmp12_;
			_tmp11_ = sudoku_game_view_get_game (self);
			_tmp12_ = _tmp11_;
			g_signal_handler_disconnect ((GObject*) _tmp12_, self->priv->tick_handle);
			self->priv->tick_handle = (gulong) 0;
		}
	}
}

static void
sudoku_game_view_tick_cb (SudokuGameView* self)
{
	gint elapsed_time = 0;
	SudokuGame* _tmp0_;
	SudokuGame* _tmp1_;
	gdouble* highscore = NULL;
	SudokuBackend* _tmp2_;
	gdouble* _tmp3_;
	gdouble* _tmp4_;
	GtkLabel* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	g_return_if_fail (self != NULL);
	_tmp0_ = sudoku_game_view_get_game (self);
	_tmp1_ = _tmp0_;
	elapsed_time = (gint) sudoku_game_get_total_time_played (_tmp1_);
	_tmp2_ = self->priv->backend;
	_tmp3_ = sudoku_backend_get_highscore (_tmp2_);
	highscore = _tmp3_;
	_tmp4_ = highscore;
	if (_tmp4_ != NULL) {
		gboolean _tmp5_ = FALSE;
		gdouble* _tmp6_;
		_tmp6_ = highscore;
		if (((gdouble) elapsed_time) > (*_tmp6_)) {
			GtkLabel* _tmp7_;
			_tmp7_ = self->priv->clock_label;
			_tmp5_ = gtk_widget_has_css_class ((GtkWidget*) _tmp7_, "warning");
		} else {
			_tmp5_ = FALSE;
		}
		if (_tmp5_) {
			GtkLabel* _tmp8_;
			_tmp8_ = self->priv->clock_label;
			gtk_widget_remove_css_class ((GtkWidget*) _tmp8_, "warning");
		} else {
			gboolean _tmp9_ = FALSE;
			gdouble* _tmp10_;
			_tmp10_ = highscore;
			if (((gdouble) elapsed_time) > ((*_tmp10_) - 60)) {
				GtkLabel* _tmp11_;
				_tmp11_ = self->priv->clock_label;
				_tmp9_ = gtk_widget_has_css_class ((GtkWidget*) _tmp11_, "success");
			} else {
				_tmp9_ = FALSE;
			}
			if (_tmp9_) {
				GtkLabel* _tmp12_;
				gchar* _tmp13_;
				gchar** _tmp14_;
				gchar** _tmp15_;
				gint _tmp15__length1;
				_tmp12_ = self->priv->clock_label;
				_tmp13_ = g_strdup ("warning");
				_tmp14_ = g_new0 (gchar*, 1 + 1);
				_tmp14_[0] = _tmp13_;
				_tmp15_ = _tmp14_;
				_tmp15__length1 = 1;
				gtk_widget_set_css_classes ((GtkWidget*) _tmp12_, _tmp15_);
				_tmp15_ = (_vala_array_free (_tmp15_, _tmp15__length1, (GDestroyNotify) g_free), NULL);
			}
		}
	}
	_tmp16_ = self->priv->clock_label;
	_tmp17_ = sudoku_game_view_create_timer_string (self, elapsed_time);
	_tmp18_ = _tmp17_;
	gtk_label_set_label (_tmp16_, _tmp18_);
	_g_free0 (_tmp18_);
	_g_free0 (highscore);
}

static void
sudoku_game_view_window_width_is_small_cb (SudokuGameView* self)
{
	gboolean _tmp0_ = FALSE;
	Sudoku* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	GtkBox* _tmp7_;
	gboolean _tmp8_ = FALSE;
	Sudoku* _tmp9_;
	gboolean _tmp10_;
	gboolean _tmp11_;
	GtkToggleButton* _tmp19_;
	g_return_if_fail (self != NULL);
	_tmp1_ = sudoku_app;
	_tmp2_ = sudoku_get_show_timer (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_) {
		SudokuWindow* _tmp4_;
		gboolean _tmp5_;
		gboolean _tmp6_;
		_tmp4_ = self->window;
		_tmp5_ = sudoku_window_get_width_is_small (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp0_ = !_tmp6_;
	} else {
		_tmp0_ = FALSE;
	}
	_tmp7_ = self->priv->clock_box;
	gtk_widget_set_visible ((GtkWidget*) _tmp7_, _tmp0_);
	_tmp9_ = sudoku_app;
	_tmp10_ = sudoku_get_show_timer (_tmp9_);
	_tmp11_ = _tmp10_;
	if (!_tmp11_) {
		_tmp8_ = TRUE;
	} else {
		gboolean _tmp12_ = FALSE;
		Sudoku* _tmp13_;
		gboolean _tmp14_;
		gboolean _tmp15_;
		_tmp13_ = sudoku_app;
		_tmp14_ = sudoku_get_show_timer (_tmp13_);
		_tmp15_ = _tmp14_;
		if (_tmp15_) {
			SudokuWindow* _tmp16_;
			gboolean _tmp17_;
			gboolean _tmp18_;
			_tmp16_ = self->window;
			_tmp17_ = sudoku_window_get_width_is_small (_tmp16_);
			_tmp18_ = _tmp17_;
			_tmp12_ = !_tmp18_;
		} else {
			_tmp12_ = FALSE;
		}
		_tmp8_ = _tmp12_;
	}
	_tmp19_ = self->priv->earmark_mode_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp19_, _tmp8_);
}

static void
sudoku_game_view_action_completed_cb (SudokuGameView* self)
{
	GSimpleAction* _tmp0_;
	SudokuGame* _tmp1_;
	SudokuGame* _tmp2_;
	GSimpleAction* _tmp3_;
	SudokuGame* _tmp4_;
	SudokuGame* _tmp5_;
	GSimpleAction* _tmp6_;
	SudokuGame* _tmp7_;
	SudokuGame* _tmp8_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->undo_action;
	_tmp1_ = sudoku_game_view_get_game (self);
	_tmp2_ = _tmp1_;
	g_simple_action_set_enabled (_tmp0_, !sudoku_game_is_undostack_null (_tmp2_));
	_tmp3_ = self->priv->redo_action;
	_tmp4_ = sudoku_game_view_get_game (self);
	_tmp5_ = _tmp4_;
	g_simple_action_set_enabled (_tmp3_, !sudoku_game_is_redostack_null (_tmp5_));
	_tmp6_ = self->priv->reset_board_action;
	_tmp7_ = sudoku_game_view_get_game (self);
	_tmp8_ = _tmp7_;
	g_simple_action_set_enabled (_tmp6_, !sudoku_game_is_empty (_tmp8_));
}

static gpointer
_pango_attr_list_ref0 (gpointer self)
{
	return self ? pango_attr_list_ref (self) : NULL;
}

static void
sudoku_game_view_paused_cb (SudokuGameView* self)
{
	PangoAttrList* attr_list = NULL;
	GtkLabel* _tmp0_;
	PangoAttrList* _tmp1_;
	PangoAttrList* _tmp2_;
	PangoAttrList* _tmp3_;
	PangoAttrList* _tmp5_;
	PangoAttribute* _tmp6_;
	GtkLabel* _tmp7_;
	PangoAttrList* _tmp8_;
	GtkLabel* _tmp9_;
	SudokuGame* _tmp10_;
	SudokuGame* _tmp11_;
	gboolean _tmp12_;
	gboolean _tmp13_;
	SudokuGrid* _tmp14_;
	SudokuGame* _tmp15_;
	SudokuGame* _tmp16_;
	gboolean _tmp17_;
	gboolean _tmp18_;
	SudokuGame* _tmp19_;
	SudokuGame* _tmp20_;
	gboolean _tmp21_;
	gboolean _tmp22_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->paused_label;
	_tmp1_ = gtk_label_get_attributes (_tmp0_);
	_tmp2_ = _pango_attr_list_ref0 (_tmp1_);
	attr_list = _tmp2_;
	_tmp3_ = attr_list;
	if (_tmp3_ == NULL) {
		PangoAttrList* _tmp4_;
		_tmp4_ = pango_attr_list_new ();
		_pango_attr_list_unref0 (attr_list);
		attr_list = _tmp4_;
	}
	_tmp5_ = attr_list;
	_tmp6_ = pango_attr_size_new_absolute (((gint) (gtk_widget_get_width ((GtkWidget*) self) * 0.125)) * PANGO_SCALE);
	pango_attr_list_change (_tmp5_, _tmp6_);
	_tmp7_ = self->priv->paused_label;
	_tmp8_ = attr_list;
	gtk_label_set_attributes (_tmp7_, _tmp8_);
	_tmp9_ = self->priv->paused_label;
	_tmp10_ = sudoku_game_view_get_game (self);
	_tmp11_ = _tmp10_;
	_tmp12_ = sudoku_game_get_paused (_tmp11_);
	_tmp13_ = _tmp12_;
	gtk_widget_set_visible ((GtkWidget*) _tmp9_, _tmp13_);
	_tmp14_ = self->grid;
	_tmp15_ = sudoku_game_view_get_game (self);
	_tmp16_ = _tmp15_;
	_tmp17_ = sudoku_game_get_paused (_tmp16_);
	_tmp18_ = _tmp17_;
	gtk_widget_set_can_focus ((GtkWidget*) _tmp14_, !_tmp18_);
	_tmp19_ = sudoku_game_view_get_game (self);
	_tmp20_ = _tmp19_;
	_tmp21_ = sudoku_game_get_paused (_tmp20_);
	_tmp22_ = _tmp21_;
	if (_tmp22_) {
		GtkStack* _tmp23_;
		GtkButton* _tmp24_;
		GSimpleAction* _tmp25_;
		GtkOverlay* _tmp26_;
		GtkLabel* _tmp27_;
		GtkOverlay* _tmp28_;
		_tmp23_ = self->priv->play_pause_stack;
		_tmp24_ = self->priv->play_button;
		gtk_stack_set_visible_child (_tmp23_, (GtkWidget*) _tmp24_);
		_tmp25_ = self->priv->reset_board_action;
		g_simple_action_set_enabled (_tmp25_, FALSE);
		_tmp26_ = self->priv->grid_overlay;
		_tmp27_ = self->priv->paused_label;
		gtk_overlay_add_overlay (_tmp26_, (GtkWidget*) _tmp27_);
		_tmp28_ = self->priv->grid_overlay;
		gtk_widget_add_css_class ((GtkWidget*) _tmp28_, "paused");
	} else {
		GtkStack* _tmp29_;
		GtkButton* _tmp30_;
		GSimpleAction* _tmp31_;
		SudokuGame* _tmp32_;
		SudokuGame* _tmp33_;
		GtkOverlay* _tmp34_;
		GtkLabel* _tmp35_;
		GtkOverlay* _tmp36_;
		_tmp29_ = self->priv->play_pause_stack;
		_tmp30_ = self->priv->pause_button;
		gtk_stack_set_visible_child (_tmp29_, (GtkWidget*) _tmp30_);
		_tmp31_ = self->priv->reset_board_action;
		_tmp32_ = sudoku_game_view_get_game (self);
		_tmp33_ = _tmp32_;
		g_simple_action_set_enabled (_tmp31_, !sudoku_game_is_empty (_tmp33_));
		_tmp34_ = self->priv->grid_overlay;
		_tmp35_ = self->priv->paused_label;
		gtk_overlay_remove_overlay (_tmp34_, (GtkWidget*) _tmp35_);
		_tmp36_ = self->priv->grid_overlay;
		gtk_widget_remove_css_class ((GtkWidget*) _tmp36_, "paused");
	}
	_pango_attr_list_unref0 (attr_list);
}

static void
sudoku_game_view_show_possibilities_cb (SudokuGameView* self)
{
	SudokuGame* _tmp0_;
	SudokuGame* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = sudoku_game_view_get_game (self);
	_tmp1_ = _tmp0_;
	if (sudoku_game_get_current_stack_action (_tmp1_) == STACK_ACTION_ENABLE_ALL_EARMARK_POSSIBILITIES) {
		SudokuGame* _tmp2_;
		SudokuGame* _tmp3_;
		_tmp2_ = sudoku_game_view_get_game (self);
		_tmp3_ = _tmp2_;
		sudoku_game_undo (_tmp3_);
	} else {
		sudoku_game_view_add_earmark_possibilities (self);
	}
}

static void
sudoku_game_view_warnings_cb (SudokuGameView* self)
{
	SudokuGrid* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->grid;
	sudoku_grid_update_warnings (_tmp0_);
}

static void
sudoku_game_view_zoom_cb (SudokuGameView* self)
{
	SudokuGrid* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->grid;
	sudoku_grid_update_zoom (_tmp0_);
}

static void
sudoku_game_view_show_timer_cb (SudokuGameView* self)
{
	Sudoku* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = sudoku_app;
	_tmp1_ = sudoku_get_show_timer (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		GtkToggleButton* _tmp3_;
		SudokuWindow* _tmp4_;
		gboolean _tmp5_;
		gboolean _tmp6_;
		GtkBox* _tmp7_;
		SudokuWindow* _tmp8_;
		gboolean _tmp9_;
		gboolean _tmp10_;
		GSimpleAction* _tmp11_;
		GtkStack* _tmp12_;
		sudoku_game_view_initialize_clock_label (self);
		sudoku_game_view_update_tick_connection (self);
		_tmp3_ = self->priv->earmark_mode_button;
		_tmp4_ = self->window;
		_tmp5_ = sudoku_window_get_width_is_small (_tmp4_);
		_tmp6_ = _tmp5_;
		gtk_widget_set_visible ((GtkWidget*) _tmp3_, !_tmp6_);
		_tmp7_ = self->priv->clock_box;
		_tmp8_ = self->window;
		_tmp9_ = sudoku_window_get_width_is_small (_tmp8_);
		_tmp10_ = _tmp9_;
		gtk_widget_set_visible ((GtkWidget*) _tmp7_, !_tmp10_);
		_tmp11_ = self->priv->toggle_pause_action;
		g_simple_action_set_enabled (_tmp11_, TRUE);
		_tmp12_ = self->priv->play_pause_stack;
		gtk_widget_set_visible ((GtkWidget*) _tmp12_, TRUE);
	} else {
		GtkBox* _tmp13_;
		GtkToggleButton* _tmp14_;
		GtkStack* _tmp15_;
		GSimpleAction* _tmp16_;
		SudokuGame* _tmp17_;
		SudokuGame* _tmp18_;
		gboolean _tmp19_;
		gboolean _tmp20_;
		_tmp13_ = self->priv->clock_box;
		gtk_widget_set_visible ((GtkWidget*) _tmp13_, FALSE);
		sudoku_game_view_update_tick_connection (self);
		_tmp14_ = self->priv->earmark_mode_button;
		gtk_widget_set_visible ((GtkWidget*) _tmp14_, TRUE);
		_tmp15_ = self->priv->play_pause_stack;
		gtk_widget_set_visible ((GtkWidget*) _tmp15_, FALSE);
		_tmp16_ = self->priv->toggle_pause_action;
		g_simple_action_set_enabled (_tmp16_, FALSE);
		_tmp17_ = sudoku_game_view_get_game (self);
		_tmp18_ = _tmp17_;
		_tmp19_ = sudoku_game_get_paused (_tmp18_);
		_tmp20_ = _tmp19_;
		if (_tmp20_) {
			SudokuGame* _tmp21_;
			SudokuGame* _tmp22_;
			_tmp21_ = sudoku_game_view_get_game (self);
			_tmp22_ = _tmp21_;
			sudoku_game_toggle_pause (_tmp22_);
		}
	}
}

static void
sudoku_game_view_button_released_cb (SudokuGameView* self,
                                     GtkGestureClick* gesture,
                                     gint n_press,
                                     gdouble x,
                                     gdouble y)
{
	gboolean _tmp0_ = FALSE;
	SudokuGame* _tmp1_;
	SudokuGame* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (gesture != NULL);
	if (gtk_gesture_single_get_current_button ((GtkGestureSingle*) gesture) != ((guint) GDK_BUTTON_PRIMARY)) {
		_tmp0_ = gtk_gesture_single_get_current_button ((GtkGestureSingle*) gesture) != ((guint) GDK_BUTTON_SECONDARY);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		return;
	}
	_tmp1_ = sudoku_game_view_get_game (self);
	_tmp2_ = _tmp1_;
	_tmp3_ = sudoku_game_get_paused (_tmp2_);
	_tmp4_ = _tmp3_;
	if (!_tmp4_) {
		SudokuGrid* _tmp5_;
		_tmp5_ = self->grid;
		sudoku_grid_unselect (_tmp5_);
	}
	gtk_gesture_set_state ((GtkGesture*) gesture, GTK_EVENT_SEQUENCE_CLAIMED);
}

static Block1Data*
block1_data_ref (Block1Data* _data1_)
{
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}

static void
block1_data_unref (void * _userdata_)
{
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		SudokuGameView* self;
		self = _data1_->self;
		_g_object_unref0 (_data1_->file_dialog);
		_g_object_unref0 (self);
		g_slice_free (Block1Data, _data1_);
	}
}

static void
__lambda10_ (Block1Data* _data1_,
             GObject* obj,
             GAsyncResult* res)
{
	SudokuGameView* self;
	GError* _inner_error0_ = NULL;
	self = _data1_->self;
	g_return_if_fail (res != NULL);
	{
		GFile* file = NULL;
		GFile* _tmp0_;
		SudokuBackend* _tmp1_;
		gchar* _tmp2_;
		gchar* _tmp3_;
		_tmp0_ = gtk_file_dialog_save_finish (_data1_->file_dialog, res, &_inner_error0_);
		file = _tmp0_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp1_ = self->priv->backend;
		_tmp2_ = g_file_get_path (file);
		_tmp3_ = _tmp2_;
		sudoku_backend_save_game_as (_tmp1_, _tmp3_);
		_g_free0 (_tmp3_);
		_g_object_unref0 (file);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp4_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp4_ = e;
		if (_tmp4_->domain == ((GQuark) GTK_DIALOG_ERROR_FAILED)) {
			GError* _tmp5_;
			const gchar* _tmp6_;
			_tmp5_ = e;
			_tmp6_ = _tmp5_->message;
			g_warning ("game-view.vala:403: Error: %s", _tmp6_);
		}
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
___lambda10__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda10_ (self, source_object, res);
	block1_data_unref (self);
}

void
sudoku_game_view_save_game_as_cb (SudokuGameView* self)
{
	Block1Data* _data1_;
	GtkFileDialog* _tmp0_;
	gchar* name = NULL;
	SudokuGame* _tmp1_;
	SudokuGame* _tmp2_;
	SudokuBoard* _tmp3_;
	SudokuBoard* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	GFile* dir = NULL;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	GFile* _tmp11_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	SudokuWindow* _tmp14_;
	g_return_if_fail (self != NULL);
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	_data1_->self = g_object_ref (self);
	_tmp0_ = gtk_file_dialog_new ();
	_data1_->file_dialog = _tmp0_;
	_tmp1_ = sudoku_game_view_get_game (self);
	_tmp2_ = _tmp1_;
	_tmp3_ = sudoku_game_get_board (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = sudoku_board_fixed_to_string_pretty (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = g_strconcat (_tmp6_, ".save", NULL);
	_tmp8_ = _tmp7_;
	_g_free0 (_tmp6_);
	name = _tmp8_;
	gtk_file_dialog_set_initial_name (_data1_->file_dialog, name);
	_tmp9_ = sudoku_backend_get_saved_dir ();
	_tmp10_ = _tmp9_;
	_tmp11_ = g_file_new_for_path (_tmp10_);
	dir = _tmp11_;
	_tmp12_ = sudoku_backend_get_saved_dir ();
	_tmp13_ = _tmp12_;
	g_mkdir (_tmp13_, 0755);
	gtk_file_dialog_set_initial_folder (_data1_->file_dialog, dir);
	_tmp14_ = self->window;
	gtk_file_dialog_save (_data1_->file_dialog, (GtkWindow*) _tmp14_, NULL, ___lambda10__gasync_ready_callback, block1_data_ref (_data1_));
	_g_object_unref0 (dir);
	_g_free0 (name);
	block1_data_unref (_data1_);
	_data1_ = NULL;
}

static Block2Data*
block2_data_ref (Block2Data* _data2_)
{
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}

static void
block2_data_unref (void * _userdata_)
{
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		SudokuGameView* self;
		self = _data2_->self;
		_g_object_unref0 (_data2_->file_dialog);
		_g_object_unref0 (self);
		g_slice_free (Block2Data, _data2_);
	}
}

static void
__lambda9_ (Block2Data* _data2_,
            GObject* obj,
            GAsyncResult* res)
{
	SudokuGameView* self;
	GError* _inner_error0_ = NULL;
	self = _data2_->self;
	g_return_if_fail (res != NULL);
	{
		GFile* file = NULL;
		GFile* _tmp0_;
		SudokuBackend* _tmp1_;
		gchar* _tmp2_;
		gchar* _tmp3_;
		_tmp0_ = gtk_file_dialog_save_finish (_data2_->file_dialog, res, &_inner_error0_);
		file = _tmp0_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp1_ = self->priv->backend;
		_tmp2_ = g_file_get_path (file);
		_tmp3_ = _tmp2_;
		sudoku_backend_export_puzzle (_tmp1_, _tmp3_);
		_g_free0 (_tmp3_);
		_g_object_unref0 (file);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp4_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp4_ = e;
		if (_tmp4_->domain == ((GQuark) GTK_DIALOG_ERROR_FAILED)) {
			GError* _tmp5_;
			const gchar* _tmp6_;
			_tmp5_ = e;
			_tmp6_ = _tmp5_->message;
			g_warning ("game-view.vala:421: Error: %s", _tmp6_);
		}
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
___lambda9__gasync_ready_callback (GObject* source_object,
                                   GAsyncResult* res,
                                   gpointer self)
{
	__lambda9_ (self, source_object, res);
	block2_data_unref (self);
}

void
sudoku_game_view_export_puzzle_to_filesystem_cb (SudokuGameView* self)
{
	Block2Data* _data2_;
	GtkFileDialog* _tmp0_;
	SudokuWindow* _tmp1_;
	g_return_if_fail (self != NULL);
	_data2_ = g_slice_new0 (Block2Data);
	_data2_->_ref_count_ = 1;
	_data2_->self = g_object_ref (self);
	_tmp0_ = gtk_file_dialog_new ();
	_data2_->file_dialog = _tmp0_;
	gtk_file_dialog_set_initial_name (_data2_->file_dialog, C_ (".skp is a file extension", "Sudoku puzzle.skp"));
	_tmp1_ = self->window;
	gtk_file_dialog_save (_data2_->file_dialog, (GtkWindow*) _tmp1_, NULL, ___lambda9__gasync_ready_callback, block2_data_ref (_data2_));
	block2_data_unref (_data2_);
	_data2_ = NULL;
}

void
sudoku_game_view_share_puzzle_to_clipboard_cb (SudokuGameView* self)
{
	GdkClipboard* clipboard = NULL;
	GdkClipboard* _tmp0_;
	GdkClipboard* _tmp1_;
	SudokuBackend* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	AdwToast* toast = NULL;
	AdwToast* _tmp5_;
	AdwToastOverlay* _tmp6_;
	AdwToast* _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_widget_get_clipboard ((GtkWidget*) self);
	_tmp1_ = _g_object_ref0 (_tmp0_);
	clipboard = _tmp1_;
	_tmp2_ = self->priv->backend;
	_tmp3_ = sudoku_backend_get_short_puzzle (_tmp2_);
	_tmp4_ = _tmp3_;
	gdk_clipboard_set_text (clipboard, _tmp4_);
	_g_free0 (_tmp4_);
	_tmp5_ = adw_toast_new (_ ("Puzzle copied to clipboard"));
	toast = _tmp5_;
	adw_toast_set_timeout (toast, (guint) 3);
	_tmp6_ = self->priv->toast_overlay;
	_tmp7_ = _g_object_ref0 (toast);
	adw_toast_overlay_add_toast (_tmp6_, _tmp7_);
	_g_object_unref0 (toast);
	_g_object_unref0 (clipboard);
}

static void
sudoku_game_view_earmark_mode_cb (SudokuGameView* self)
{
	Sudoku* _tmp0_;
	Sudoku* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	GtkToggleButton* _tmp4_;
	Sudoku* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = sudoku_app;
	_tmp1_ = sudoku_app;
	_tmp2_ = sudoku_get_earmark_mode (_tmp1_);
	_tmp3_ = _tmp2_;
	sudoku_set_earmark_mode (_tmp0_, !_tmp3_);
	_tmp4_ = self->priv->earmark_mode_button;
	_tmp5_ = sudoku_app;
	_tmp6_ = sudoku_get_earmark_mode (_tmp5_);
	_tmp7_ = _tmp6_;
	gtk_toggle_button_set_active (_tmp4_, _tmp7_);
}

static gboolean
sudoku_game_view_real_grab_focus (GtkWidget* base)
{
	SudokuGameView * self;
	SudokuGrid* _tmp0_;
	gboolean result;
	self = (SudokuGameView*) base;
	_tmp0_ = self->grid;
	result = gtk_widget_grab_focus ((GtkWidget*) _tmp0_);
	return result;
}

static void
sudoku_game_view_real_dispose (GObject* base)
{
	SudokuGameView * self;
	SudokuBackend* _tmp0_;
	self = (SudokuGameView*) base;
	_tmp0_ = self->priv->backend;
	if (_tmp0_ != NULL) {
		SudokuGame* _tmp1_;
		SudokuGame* _tmp2_;
		gboolean _tmp3_;
		gboolean _tmp4_;
		SudokuGrid* _tmp7_;
		_tmp1_ = sudoku_game_view_get_game (self);
		_tmp2_ = _tmp1_;
		_tmp3_ = sudoku_game_get_paused (_tmp2_);
		_tmp4_ = _tmp3_;
		if (!_tmp4_) {
			SudokuGame* _tmp5_;
			SudokuGame* _tmp6_;
			_tmp5_ = sudoku_game_view_get_game (self);
			_tmp6_ = _tmp5_;
			sudoku_game_stop_clock (_tmp6_);
		}
		_tmp7_ = self->grid;
		gtk_widget_unparent ((GtkWidget*) _tmp7_);
	}
	gtk_widget_dispose_template ((GtkWidget*) self, G_TYPE_FROM_INSTANCE ((GObject*) self));
	G_OBJECT_CLASS (sudoku_game_view_parent_class)->dispose ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (self, adw_bin_get_type (), AdwBin));
}

SudokuGameView*
sudoku_game_view_construct (GType object_type)
{
	SudokuGameView * self = NULL;
	self = (SudokuGameView*) g_object_new (object_type, NULL);
	return self;
}

SudokuGameView*
sudoku_game_view_new (void)
{
	return sudoku_game_view_construct (TYPE_SUDOKU_GAME_VIEW);
}

gboolean
sudoku_game_view_get_initialized (SudokuGameView* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_initialized;
	return result;
}

static void
sudoku_game_view_set_initialized (SudokuGameView* self,
                                  gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = sudoku_game_view_get_initialized (self);
	if (old_value != value) {
		self->priv->_initialized = value;
		g_object_notify_by_pspec ((GObject *) self, sudoku_game_view_properties[SUDOKU_GAME_VIEW_INITIALIZED_PROPERTY]);
	}
}

static SudokuGame*
sudoku_game_view_get_game (SudokuGameView* self)
{
	SudokuGame* result;
	SudokuBackend* _tmp0_;
	SudokuGame* _tmp1_;
	SudokuGame* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->backend;
	_tmp1_ = sudoku_backend_get_game (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

static void
sudoku_game_view_class_init (SudokuGameViewClass * klass,
                             gpointer klass_data)
{
	sudoku_game_view_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SudokuGameView_private_offset);
	((GtkWidgetClass *) klass)->grab_focus = (gboolean (*) (GtkWidget*)) sudoku_game_view_real_grab_focus;
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) sudoku_game_view_real_dispose;
	G_OBJECT_CLASS (klass)->get_property = _vala_sudoku_game_view_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_sudoku_game_view_set_property;
	G_OBJECT_CLASS (klass)->finalize = sudoku_game_view_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SUDOKU_GAME_VIEW_INITIALIZED_PROPERTY, sudoku_game_view_properties[SUDOKU_GAME_VIEW_INITIALIZED_PROPERTY] = g_param_spec_boolean ("initialized", "initialized", "initialized", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Sudoku/ui/game-view.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "grid_overlay", FALSE, SudokuGameView_private_offset + G_STRUCT_OFFSET (SudokuGameViewPrivate, grid_overlay));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "toast_overlay", FALSE, SudokuGameView_private_offset + G_STRUCT_OFFSET (SudokuGameViewPrivate, toast_overlay));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "grid_bin", FALSE, SudokuGameView_private_offset + G_STRUCT_OFFSET (SudokuGameViewPrivate, grid_bin));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "clock_box", FALSE, SudokuGameView_private_offset + G_STRUCT_OFFSET (SudokuGameViewPrivate, clock_box));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "clock_label", FALSE, SudokuGameView_private_offset + G_STRUCT_OFFSET (SudokuGameViewPrivate, clock_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "earmark_mode_button", FALSE, SudokuGameView_private_offset + G_STRUCT_OFFSET (SudokuGameViewPrivate, earmark_mode_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "windowtitle", FALSE, SudokuGameView_private_offset + G_STRUCT_OFFSET (SudokuGameViewPrivate, windowtitle));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "play_pause_stack", FALSE, SudokuGameView_private_offset + G_STRUCT_OFFSET (SudokuGameViewPrivate, play_pause_stack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "pause_button", FALSE, SudokuGameView_private_offset + G_STRUCT_OFFSET (SudokuGameViewPrivate, pause_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "play_button", FALSE, SudokuGameView_private_offset + G_STRUCT_OFFSET (SudokuGameViewPrivate, play_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "menu_button", FALSE, SudokuGameView_private_offset + G_STRUCT_OFFSET (SudokuGameViewPrivate, menu_button));
	sudoku_game_view_new_shortcut (klass, "game-view.earmark-mode", "e");
	sudoku_game_view_new_shortcut (klass, "game-view.toggle-pause", "p");
	sudoku_game_view_new_shortcut (klass, "game-view.reset-board", "<Primary>r");
	sudoku_game_view_new_shortcut (klass, "game-view.undo", "u|<Primary>z");
	sudoku_game_view_new_shortcut (klass, "game-view.redo", "r|<Primary><Shift>z");
	sudoku_game_view_new_shortcut (klass, "game-view.save-game-as", "<Primary>s");
	sudoku_game_view_new_shortcut (klass, "game-view.share-puzzle-to-clipboard", "<Primary>c");
	sudoku_game_view_new_shortcut (klass, "game-view.export-puzzle-to-filesystem", "<Primary>e");
}

static void
sudoku_game_view_instance_init (SudokuGameView * self,
                                gpointer klass)
{
	self->priv = sudoku_game_view_get_instance_private (self);
	self->priv->_initialized = FALSE;
	g_type_ensure (TYPE_SUDOKU_MENU_BUTTON);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
sudoku_game_view_finalize (GObject * obj)
{
	SudokuGameView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_SUDOKU_GAME_VIEW, SudokuGameView);
	_g_object_unref0 (self->priv->backend);
	_g_object_unref0 (self->priv->paused_label);
	_g_object_unref0 (self->priv->button_controller);
	_g_object_unref0 (self->grid);
	_g_object_unref0 (self->priv->toggle_pause_action);
	_g_object_unref0 (self->priv->earmark_mode_action);
	_g_object_unref0 (self->priv->undo_action);
	_g_object_unref0 (self->priv->redo_action);
	_g_object_unref0 (self->priv->reset_board_action);
	_g_object_unref0 (self->priv->save_game_as_action);
	_g_object_unref0 (self->priv->share_puzzle_to_clipboard_action);
	_g_object_unref0 (self->priv->export_puzzle_to_filesystem_action);
	G_OBJECT_CLASS (sudoku_game_view_parent_class)->finalize (obj);
}

static GType
sudoku_game_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SudokuGameViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) sudoku_game_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SudokuGameView), 0, (GInstanceInitFunc) sudoku_game_view_instance_init, NULL };
	GType sudoku_game_view_type_id;
	sudoku_game_view_type_id = g_type_register_static (adw_bin_get_type (), "SudokuGameView", &g_define_type_info, 0);
	SudokuGameView_private_offset = g_type_add_instance_private (sudoku_game_view_type_id, sizeof (SudokuGameViewPrivate));
	return sudoku_game_view_type_id;
}

GType
sudoku_game_view_get_type (void)
{
	static volatile gsize sudoku_game_view_type_id__once = 0;
	if (g_once_init_enter (&sudoku_game_view_type_id__once)) {
		GType sudoku_game_view_type_id;
		sudoku_game_view_type_id = sudoku_game_view_get_type_once ();
		g_once_init_leave (&sudoku_game_view_type_id__once, sudoku_game_view_type_id);
	}
	return sudoku_game_view_type_id__once;
}

static void
_vala_sudoku_game_view_get_property (GObject * object,
                                     guint property_id,
                                     GValue * value,
                                     GParamSpec * pspec)
{
	SudokuGameView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_SUDOKU_GAME_VIEW, SudokuGameView);
	switch (property_id) {
		case SUDOKU_GAME_VIEW_INITIALIZED_PROPERTY:
		g_value_set_boolean (value, sudoku_game_view_get_initialized (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_sudoku_game_view_set_property (GObject * object,
                                     guint property_id,
                                     const GValue * value,
                                     GParamSpec * pspec)
{
	SudokuGameView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_SUDOKU_GAME_VIEW, SudokuGameView);
	switch (property_id) {
		case SUDOKU_GAME_VIEW_INITIALIZED_PROPERTY:
		sudoku_game_view_set_initialized (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

gboolean
zoom_level_is_fully_zoomed_out (ZoomLevel self)
{
	gboolean result;
	switch (self) {
		case ZOOM_LEVEL_SMALL:
		{
			result = TRUE;
			return result;
		}
		default:
		{
			result = FALSE;
			return result;
		}
	}
}

gboolean
zoom_level_is_fully_zoomed_in (ZoomLevel self)
{
	gboolean result;
	switch (self) {
		case ZOOM_LEVEL_LARGE:
		{
			result = TRUE;
			return result;
		}
		default:
		{
			result = FALSE;
			return result;
		}
	}
}

ZoomLevel
zoom_level_zoom_in (ZoomLevel self)
{
	ZoomLevel result;
	switch (self) {
		case ZOOM_LEVEL_SMALL:
		{
			result = ZOOM_LEVEL_MEDIUM;
			return result;
		}
		case ZOOM_LEVEL_MEDIUM:
		{
			result = ZOOM_LEVEL_LARGE;
			return result;
		}
		case ZOOM_LEVEL_LARGE:
		{
			{
				g_warning ("game-view.vala:500: ZOOM already at maximum");
				result = ZOOM_LEVEL_LARGE;
				return result;
			}
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
}

ZoomLevel
zoom_level_zoom_out (ZoomLevel self)
{
	ZoomLevel result;
	switch (self) {
		case ZOOM_LEVEL_LARGE:
		{
			result = ZOOM_LEVEL_MEDIUM;
			return result;
		}
		case ZOOM_LEVEL_MEDIUM:
		{
			result = ZOOM_LEVEL_SMALL;
			return result;
		}
		case ZOOM_LEVEL_SMALL:
		{
			{
				g_warning ("game-view.vala:518: ZOOM already at minimum");
				result = ZOOM_LEVEL_SMALL;
				return result;
			}
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
}

static GType
zoom_level_get_type_once (void)
{
	static const GEnumValue values[] = {{ZOOM_LEVEL_NONE, "ZOOM_LEVEL_NONE", "none"}, {ZOOM_LEVEL_SMALL, "ZOOM_LEVEL_SMALL", "small"}, {ZOOM_LEVEL_MEDIUM, "ZOOM_LEVEL_MEDIUM", "medium"}, {ZOOM_LEVEL_LARGE, "ZOOM_LEVEL_LARGE", "large"}, {0, NULL, NULL}};
	GType zoom_level_type_id;
	zoom_level_type_id = g_enum_register_static ("ZoomLevel", values);
	return zoom_level_type_id;
}

GType
zoom_level_get_type (void)
{
	static volatile gsize zoom_level_type_id__once = 0;
	if (g_once_init_enter (&zoom_level_type_id__once)) {
		GType zoom_level_type_id;
		zoom_level_type_id = zoom_level_get_type_once ();
		g_once_init_leave (&zoom_level_type_id__once, zoom_level_type_id);
	}
	return zoom_level_type_id__once;
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize 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,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

