/* gnome-sudoku.c generated by valac 0.56.19, the Vala compiler
 * generated from gnome-sudoku.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
 *
 * 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 <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <adwaita.h>
#include <glib-object.h>
#include <gio/gio.h>
#include "libsudoku.h"
#include <glib/gi18n-lib.h>
#include <stdio.h>
#include <gdk/gdk.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 (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 _SudokuPrivate SudokuPrivate;

#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;
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 ())
enum  {
	SUDOKU_0_PROPERTY,
	SUDOKU_START_BUTTON_SELECTED_PROPERTY,
	SUDOKU_ZOOM_LEVEL_PROPERTY,
	SUDOKU_SHOW_TIMER_PROPERTY,
	SUDOKU_EARMARK_MODE_PROPERTY,
	SUDOKU_SHOW_POSSIBILITIES_PROPERTY,
	SUDOKU_HIGHLIGHT_ROW_COLUMN_PROPERTY,
	SUDOKU_HIGHLIGHT_BLOCK_PROPERTY,
	SUDOKU_HIGHLIGHT_NUMBERS_PROPERTY,
	SUDOKU_DUPLICATE_WARNINGS_PROPERTY,
	SUDOKU_SOLUTION_WARNINGS_PROPERTY,
	SUDOKU_EARMARK_WARNINGS_PROPERTY,
	SUDOKU_AUTOCLEAN_EARMARKS_PROPERTY,
	SUDOKU_NUMBER_PICKER_SECOND_CLICK_PROPERTY,
	SUDOKU_NUM_PROPERTIES
};
static GParamSpec* sudoku_properties[SUDOKU_NUM_PROPERTIES];
typedef void (*GSimpleActionActivateCallback) (GSimpleAction* action, GVariant* parameter, gpointer user_data);
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block3Data Block3Data;
#define _g_free0(var) (var = (g_free (var), NULL))

#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 _Block4Data Block4Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef enum  {
	SUDOKU_WINDOW_SCREEN_NONE,
	SUDOKU_WINDOW_SCREEN_PLAY,
	SUDOKU_WINDOW_SCREEN_START
} SudokuWindowScreen;

#define TYPE_SUDOKU_WINDOW_SCREEN (sudoku_window_screen_get_type ())

#define TYPE_SUDOKU_PRINT_DIALOG (sudoku_print_dialog_get_type ())
#define SUDOKU_PRINT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SUDOKU_PRINT_DIALOG, SudokuPrintDialog))
#define SUDOKU_PRINT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SUDOKU_PRINT_DIALOG, SudokuPrintDialogClass))
#define IS_SUDOKU_PRINT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SUDOKU_PRINT_DIALOG))
#define IS_SUDOKU_PRINT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SUDOKU_PRINT_DIALOG))
#define SUDOKU_PRINT_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SUDOKU_PRINT_DIALOG, SudokuPrintDialogClass))

typedef struct _SudokuPrintDialog SudokuPrintDialog;
typedef struct _SudokuPrintDialogClass SudokuPrintDialogClass;

#define TYPE_SUDOKU_PREFERENCES_DIALOG (sudoku_preferences_dialog_get_type ())
#define SUDOKU_PREFERENCES_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SUDOKU_PREFERENCES_DIALOG, SudokuPreferencesDialog))
#define SUDOKU_PREFERENCES_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SUDOKU_PREFERENCES_DIALOG, SudokuPreferencesDialogClass))
#define IS_SUDOKU_PREFERENCES_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SUDOKU_PREFERENCES_DIALOG))
#define IS_SUDOKU_PREFERENCES_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SUDOKU_PREFERENCES_DIALOG))
#define SUDOKU_PREFERENCES_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SUDOKU_PREFERENCES_DIALOG, SudokuPreferencesDialogClass))

typedef struct _SudokuPreferencesDialog SudokuPreferencesDialog;
typedef struct _SudokuPreferencesDialogClass SudokuPreferencesDialogClass;
typedef struct _SudokuWindowPrivate SudokuWindowPrivate;

#define TYPE_SUDOKU_START_VIEW (sudoku_start_view_get_type ())
#define SUDOKU_START_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SUDOKU_START_VIEW, SudokuStartView))
#define SUDOKU_START_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SUDOKU_START_VIEW, SudokuStartViewClass))
#define IS_SUDOKU_START_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SUDOKU_START_VIEW))
#define IS_SUDOKU_START_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SUDOKU_START_VIEW))
#define SUDOKU_START_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SUDOKU_START_VIEW, SudokuStartViewClass))

typedef struct _SudokuStartView SudokuStartView;
typedef struct _SudokuStartViewClass SudokuStartViewClass;

struct _Sudoku {
	AdwApplication parent_instance;
	SudokuPrivate * priv;
};

struct _SudokuClass {
	AdwApplicationClass parent_class;
};

struct _SudokuPrivate {
	GSettings* settings;
	SudokuWindow* window;
	GSimpleAction* print_multiple_action;
	GSimpleAction* new_game_action;
	GSimpleAction* back_action;
	GSimpleAction* zoom_in_action;
	GSimpleAction* zoom_out_action;
	SudokuBackend* backend;
	DifficultyCategory _start_button_selected;
	ZoomLevel _zoom_level;
	gboolean _show_timer;
	gboolean _earmark_mode;
	gboolean _show_possibilities;
	gboolean _highlight_row_column;
	gboolean _highlight_block;
	gboolean _highlight_numbers;
	gboolean _duplicate_warnings;
	gboolean _solution_warnings;
	gboolean _earmark_warnings;
	gboolean _autoclean_earmarks;
	gboolean _number_picker_second_click;
};

struct _Block3Data {
	int _ref_count_;
	Sudoku* self;
	AdwAlertDialog* dialog;
};

struct _Block4Data {
	int _ref_count_;
	Sudoku* self;
	GtkFileDialog* file_dialog;
};

struct _SudokuWindow {
	AdwApplicationWindow parent_instance;
	SudokuWindowPrivate * priv;
	SudokuStartView* start_view;
	SudokuGameView* game_view;
};

struct _SudokuWindowClass {
	AdwApplicationWindowClass parent_class;
};

static gint Sudoku_private_offset;
static gpointer sudoku_parent_class = NULL;
VALA_EXTERN Sudoku* sudoku_app;
Sudoku* sudoku_app = NULL;

VALA_EXTERN GType sudoku_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Sudoku, 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 zoom_level_get_type (void) G_GNUC_CONST ;
static void sudoku_new_game_cb (Sudoku* self);
static void _sudoku_new_game_cb_gsimple_action_activate_callback (GSimpleAction* action,
                                                           GVariant* parameter,
                                                           gpointer self);
static void sudoku_start_game_cb (Sudoku* self,
                           GSimpleAction* action,
                           GVariant* difficulty);
static void _sudoku_start_game_cb_gsimple_action_activate_callback (GSimpleAction* action,
                                                             GVariant* parameter,
                                                             gpointer self);
static void sudoku_open_file_cb (Sudoku* self);
static void _sudoku_open_file_cb_gsimple_action_activate_callback (GSimpleAction* action,
                                                            GVariant* parameter,
                                                            gpointer self);
static void sudoku_back_cb (Sudoku* self);
static void _sudoku_back_cb_gsimple_action_activate_callback (GSimpleAction* action,
                                                       GVariant* parameter,
                                                       gpointer self);
static void sudoku_print_multiple_cb (Sudoku* self);
static void _sudoku_print_multiple_cb_gsimple_action_activate_callback (GSimpleAction* action,
                                                                 GVariant* parameter,
                                                                 gpointer self);
static void sudoku_help_cb (Sudoku* self);
static void _sudoku_help_cb_gsimple_action_activate_callback (GSimpleAction* action,
                                                       GVariant* parameter,
                                                       gpointer self);
static void sudoku_about_cb (Sudoku* self);
static void _sudoku_about_cb_gsimple_action_activate_callback (GSimpleAction* action,
                                                        GVariant* parameter,
                                                        gpointer self);
static void sudoku_toggle_fullscreen_cb (Sudoku* self);
static void _sudoku_toggle_fullscreen_cb_gsimple_action_activate_callback (GSimpleAction* action,
                                                                    GVariant* parameter,
                                                                    gpointer self);
static void sudoku_zoom_in_cb (Sudoku* self);
static void _sudoku_zoom_in_cb_gsimple_action_activate_callback (GSimpleAction* action,
                                                          GVariant* parameter,
                                                          gpointer self);
static void sudoku_zoom_out_cb (Sudoku* self);
static void _sudoku_zoom_out_cb_gsimple_action_activate_callback (GSimpleAction* action,
                                                           GVariant* parameter,
                                                           gpointer self);
static void sudoku_zoom_reset_cb (Sudoku* self);
static void _sudoku_zoom_reset_cb_gsimple_action_activate_callback (GSimpleAction* action,
                                                             GVariant* parameter,
                                                             gpointer self);
static void sudoku_shortcuts_dialog_cb (Sudoku* self);
static void _sudoku_shortcuts_dialog_cb_gsimple_action_activate_callback (GSimpleAction* action,
                                                                   GVariant* parameter,
                                                                   gpointer self);
static void sudoku_preferences_dialog_cb (Sudoku* self);
static void _sudoku_preferences_dialog_cb_gsimple_action_activate_callback (GSimpleAction* action,
                                                                     GVariant* parameter,
                                                                     gpointer self);
static void _g_application_quit_gsimple_action_activate_callback (GSimpleAction* action,
                                                           GVariant* parameter,
                                                           gpointer self);
VALA_EXTERN Sudoku* sudoku_new (void);
VALA_EXTERN Sudoku* sudoku_construct (GType object_type);
static gint sudoku_real_handle_local_options (GApplication* base,
                                       GVariantDict* options);
static void sudoku_real_startup (GApplication* base);
VALA_EXTERN void sudoku_set_duplicate_warnings (Sudoku* self,
                                    gboolean value);
VALA_EXTERN void sudoku_set_solution_warnings (Sudoku* self,
                                   gboolean value);
VALA_EXTERN void sudoku_set_earmark_warnings (Sudoku* self,
                                  gboolean value);
VALA_EXTERN void sudoku_set_start_button_selected (Sudoku* self,
                                       DifficultyCategory value);
VALA_EXTERN ZoomLevel sudoku_get_zoom_level (Sudoku* self);
VALA_EXTERN gboolean zoom_level_is_fully_zoomed_in (ZoomLevel self);
VALA_EXTERN gboolean zoom_level_is_fully_zoomed_out (ZoomLevel self);
static void sudoku_real_activate (GApplication* base);
VALA_EXTERN SudokuWindow* sudoku_window_new (SudokuBackend* backend,
                                 GSettings* settings);
VALA_EXTERN SudokuWindow* sudoku_window_construct (GType object_type,
                                       SudokuBackend* backend,
                                       GSettings* settings);
VALA_EXTERN void sudoku_change_game (Sudoku* self);
static void sudoku_show_start_view (Sudoku* self);
static void _sudoku_change_game_sudoku_backend_game_changed (SudokuBackend* _sender,
                                                      gpointer self);
static void sudoku_real_shutdown (GApplication* base);
static void sudoku_board_completed_cb (Sudoku* self);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
static SudokuGame* sudoku_get_game (Sudoku* self);
static void _sudoku_board_completed_cb_sudoku_board_completed (SudokuBoard* _sender,
                                                        gpointer self);
VALA_EXTERN gboolean sudoku_get_show_timer (Sudoku* self);
VALA_EXTERN gboolean sudoku_window_get_width_is_small (SudokuWindow* self);
VALA_EXTERN DifficultyCategory sudoku_get_start_button_selected (Sudoku* self);
static void __lambda16_ (Block3Data* _data3_,
                  const gchar* response_id);
static void sudoku_create_game (Sudoku* self);
static void ___lambda16__adw_alert_dialog_response (AdwAlertDialog* _sender,
                                             const gchar* response,
                                             gpointer self);
VALA_EXTERN GType sudoku_game_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SudokuGameView, g_object_unref)
static SudokuGameView* sudoku_get_game_view (Sudoku* self);
VALA_EXTERN gboolean sudoku_game_view_get_initialized (SudokuGameView* self);
VALA_EXTERN void sudoku_game_view_init (SudokuGameView* self,
                            SudokuBackend* backend,
                            SudokuWindow* window);
VALA_EXTERN void sudoku_game_view_change_game (SudokuGameView* self);
static void sudoku_show_game_view (Sudoku* self);
VALA_EXTERN void sudoku_window_show_start_view (SudokuWindow* self);
VALA_EXTERN void sudoku_window_show_game_view (SudokuWindow* self);
static DifficultyCategory _variant_get1 (GVariant* value);
static Block4Data* block4_data_ref (Block4Data* _data4_);
static void block4_data_unref (void * _userdata_);
static void __lambda12_ (Block4Data* _data4_,
                  GObject* obj,
                  GAsyncResult* res);
static void sudoku_open_fail (Sudoku* self);
static void ___lambda12__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void __lambda13_ (Sudoku* self,
                  const gchar* response_id);
static void ___lambda13__adw_alert_dialog_response (AdwAlertDialog* _sender,
                                             const gchar* response,
                                             gpointer self);
VALA_EXTERN GType sudoku_window_screen_get_type (void) G_GNUC_CONST ;
VALA_EXTERN SudokuWindowScreen sudoku_window_get_current_screen (SudokuWindow* self);
VALA_EXTERN GType sudoku_print_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SudokuPrintDialog, g_object_unref)
VALA_EXTERN SudokuPrintDialog* sudoku_print_dialog_new (SudokuBackend* backend,
                                            SudokuWindow* window);
VALA_EXTERN SudokuPrintDialog* sudoku_print_dialog_construct (GType object_type,
                                                  SudokuBackend* backend,
                                                  SudokuWindow* window);
VALA_EXTERN GType sudoku_preferences_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SudokuPreferencesDialog, g_object_unref)
VALA_EXTERN SudokuPreferencesDialog* sudoku_preferences_dialog_new (void);
VALA_EXTERN SudokuPreferencesDialog* sudoku_preferences_dialog_construct (GType object_type);
VALA_EXTERN ZoomLevel zoom_level_zoom_in (ZoomLevel self);
VALA_EXTERN void sudoku_set_zoom_level (Sudoku* self,
                            ZoomLevel value);
VALA_EXTERN ZoomLevel zoom_level_zoom_out (ZoomLevel self);
static gint sudoku_main (gchar** args,
                  gint args_length1);
VALA_EXTERN GType sudoku_start_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SudokuStartView, g_object_unref)
VALA_EXTERN void sudoku_set_show_timer (Sudoku* self,
                            gboolean value);
VALA_EXTERN gboolean sudoku_get_earmark_mode (Sudoku* self);
VALA_EXTERN void sudoku_set_earmark_mode (Sudoku* self,
                              gboolean value);
VALA_EXTERN gboolean sudoku_get_show_possibilities (Sudoku* self);
VALA_EXTERN void sudoku_set_show_possibilities (Sudoku* self,
                                    gboolean value);
VALA_EXTERN gboolean sudoku_get_highlight_row_column (Sudoku* self);
VALA_EXTERN void sudoku_set_highlight_row_column (Sudoku* self,
                                      gboolean value);
VALA_EXTERN gboolean sudoku_get_highlight_block (Sudoku* self);
VALA_EXTERN void sudoku_set_highlight_block (Sudoku* self,
                                 gboolean value);
VALA_EXTERN gboolean sudoku_get_highlight_numbers (Sudoku* self);
VALA_EXTERN void sudoku_set_highlight_numbers (Sudoku* self,
                                   gboolean value);
VALA_EXTERN gboolean sudoku_get_duplicate_warnings (Sudoku* self);
VALA_EXTERN gboolean sudoku_get_solution_warnings (Sudoku* self);
VALA_EXTERN gboolean sudoku_get_earmark_warnings (Sudoku* self);
VALA_EXTERN gboolean sudoku_get_autoclean_earmarks (Sudoku* self);
VALA_EXTERN void sudoku_set_autoclean_earmarks (Sudoku* self,
                                    gboolean value);
VALA_EXTERN gboolean sudoku_get_number_picker_second_click (Sudoku* self);
VALA_EXTERN void sudoku_set_number_picker_second_click (Sudoku* self,
                                            gboolean value);
static void sudoku_finalize (GObject * obj);
static GType sudoku_get_type_once (void);
static void _vala_sudoku_get_property (GObject * object,
                                guint property_id,
                                GValue * value,
                                GParamSpec * pspec);
static void _vala_sudoku_set_property (GObject * object,
                                guint property_id,
                                const GValue * value,
                                GParamSpec * pspec);
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 const GActionEntry SUDOKU_action_entries[14] = {{"new-game", _sudoku_new_game_cb_gsimple_action_activate_callback}, {"start-game", _sudoku_start_game_cb_gsimple_action_activate_callback, "i"}, {"open-file", _sudoku_open_file_cb_gsimple_action_activate_callback}, {"back", _sudoku_back_cb_gsimple_action_activate_callback}, {"print-generator", _sudoku_print_multiple_cb_gsimple_action_activate_callback}, {"help", _sudoku_help_cb_gsimple_action_activate_callback}, {"about", _sudoku_about_cb_gsimple_action_activate_callback}, {"toggle-fullscreen", _sudoku_toggle_fullscreen_cb_gsimple_action_activate_callback}, {"zoom-in", _sudoku_zoom_in_cb_gsimple_action_activate_callback, NULL, "false"}, {"zoom-out", _sudoku_zoom_out_cb_gsimple_action_activate_callback, NULL, "false"}, {"zoom-reset", _sudoku_zoom_reset_cb_gsimple_action_activate_callback}, {"shortcuts-dialog", _sudoku_shortcuts_dialog_cb_gsimple_action_activate_callback}, {"preferences-dialog", _sudoku_preferences_dialog_cb_gsimple_action_activate_callback}, {"quit", _g_application_quit_gsimple_action_activate_callback}};
static const GOptionEntry SUDOKU_option_entries[2] = {{"version", 'v', (gint) 0, G_OPTION_ARG_NONE, NULL, N_ ("Show release version"), NULL}, {NULL}};
static const gchar* SUDOKU_authors[7] = {"Robert Ancell <robert.ancell@gmail.com>", "Christopher Baines <cbaines8@gmail.com>", "Thomas M. Hinkle <Thomas_Hinkle@alumni.brown.edu>", "Parin Porecha <parinporecha@gmail.com>", "John Stowers <john.stowers@gmail.com>", "Jamie Murphy <jmurphy@gnome.org>", NULL};

static inline gpointer
sudoku_get_instance_private (Sudoku* self)
{
	return G_STRUCT_MEMBER_P (self, Sudoku_private_offset);
}

static void
_sudoku_new_game_cb_gsimple_action_activate_callback (GSimpleAction* action,
                                                      GVariant* parameter,
                                                      gpointer self)
{
	sudoku_new_game_cb ((Sudoku*) self);
}

static void
_sudoku_start_game_cb_gsimple_action_activate_callback (GSimpleAction* action,
                                                        GVariant* parameter,
                                                        gpointer self)
{
	sudoku_start_game_cb ((Sudoku*) self, action, parameter);
}

static void
_sudoku_open_file_cb_gsimple_action_activate_callback (GSimpleAction* action,
                                                       GVariant* parameter,
                                                       gpointer self)
{
	sudoku_open_file_cb ((Sudoku*) self);
}

static void
_sudoku_back_cb_gsimple_action_activate_callback (GSimpleAction* action,
                                                  GVariant* parameter,
                                                  gpointer self)
{
	sudoku_back_cb ((Sudoku*) self);
}

static void
_sudoku_print_multiple_cb_gsimple_action_activate_callback (GSimpleAction* action,
                                                            GVariant* parameter,
                                                            gpointer self)
{
	sudoku_print_multiple_cb ((Sudoku*) self);
}

static void
_sudoku_help_cb_gsimple_action_activate_callback (GSimpleAction* action,
                                                  GVariant* parameter,
                                                  gpointer self)
{
	sudoku_help_cb ((Sudoku*) self);
}

static void
_sudoku_about_cb_gsimple_action_activate_callback (GSimpleAction* action,
                                                   GVariant* parameter,
                                                   gpointer self)
{
	sudoku_about_cb ((Sudoku*) self);
}

static void
_sudoku_toggle_fullscreen_cb_gsimple_action_activate_callback (GSimpleAction* action,
                                                               GVariant* parameter,
                                                               gpointer self)
{
	sudoku_toggle_fullscreen_cb ((Sudoku*) self);
}

static void
_sudoku_zoom_in_cb_gsimple_action_activate_callback (GSimpleAction* action,
                                                     GVariant* parameter,
                                                     gpointer self)
{
	sudoku_zoom_in_cb ((Sudoku*) self);
}

static void
_sudoku_zoom_out_cb_gsimple_action_activate_callback (GSimpleAction* action,
                                                      GVariant* parameter,
                                                      gpointer self)
{
	sudoku_zoom_out_cb ((Sudoku*) self);
}

static void
_sudoku_zoom_reset_cb_gsimple_action_activate_callback (GSimpleAction* action,
                                                        GVariant* parameter,
                                                        gpointer self)
{
	sudoku_zoom_reset_cb ((Sudoku*) self);
}

static void
_sudoku_shortcuts_dialog_cb_gsimple_action_activate_callback (GSimpleAction* action,
                                                              GVariant* parameter,
                                                              gpointer self)
{
	sudoku_shortcuts_dialog_cb ((Sudoku*) self);
}

static void
_sudoku_preferences_dialog_cb_gsimple_action_activate_callback (GSimpleAction* action,
                                                                GVariant* parameter,
                                                                gpointer self)
{
	sudoku_preferences_dialog_cb ((Sudoku*) self);
}

static void
_g_application_quit_gsimple_action_activate_callback (GSimpleAction* action,
                                                      GVariant* parameter,
                                                      gpointer self)
{
	g_application_quit ((GApplication*) self);
}

Sudoku*
sudoku_construct (GType object_type)
{
	Sudoku * self = NULL;
	bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
	textdomain (GETTEXT_PACKAGE);
	self = (Sudoku*) g_object_new (object_type, "application-id", APP_ID, "flags", G_APPLICATION_DEFAULT_FLAGS, "resource-base-path", "/org/gnome/Sudoku", NULL);
	g_application_add_main_option_entries ((GApplication*) self, SUDOKU_option_entries);
	return self;
}

Sudoku*
sudoku_new (void)
{
	return sudoku_construct (TYPE_SUDOKU);
}

static gint
sudoku_real_handle_local_options (GApplication* base,
                                  GVariantDict* options)
{
	Sudoku * self;
	gint result;
	self = (Sudoku*) base;
	g_return_val_if_fail (options != NULL, -1);
	if (g_variant_dict_contains (options, "version")) {
		FILE* _tmp0_;
		_tmp0_ = stderr;
		fprintf (_tmp0_, "gnome-sudoku %s\n", VERSION);
		result = EXIT_SUCCESS;
		return result;
	}
	result = -1;
	return result;
}

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

static void
sudoku_real_startup (GApplication* base)
{
	Sudoku * self;
	SudokuBackend* _tmp0_;
	GSettings* _tmp1_;
	GSettings* _tmp2_;
	GSettings* _tmp3_;
	GSettings* _tmp4_;
	GSettings* _tmp5_;
	GSettings* _tmp6_;
	GSettings* _tmp7_;
	GSettings* _tmp8_;
	GSettings* _tmp9_;
	GSettings* _tmp10_;
	GSettings* _tmp11_;
	GSettings* _tmp12_;
	GSettings* _tmp13_;
	gboolean old_warnings_enabled = FALSE;
	GSettings* _tmp14_;
	DifficultyCategory old_selected_button = 0;
	GSettings* _tmp16_;
	gchar* _tmp18_;
	gchar** _tmp19_;
	gchar** _tmp20_;
	gint _tmp20__length1;
	gchar* _tmp21_;
	gchar** _tmp22_;
	gchar** _tmp23_;
	gint _tmp23__length1;
	gchar* _tmp24_;
	gchar** _tmp25_;
	gchar** _tmp26_;
	gint _tmp26__length1;
	gchar* _tmp27_;
	gchar** _tmp28_;
	gchar** _tmp29_;
	gint _tmp29__length1;
	gchar* _tmp30_;
	gchar** _tmp31_;
	gchar** _tmp32_;
	gint _tmp32__length1;
	gchar* _tmp33_;
	gchar* _tmp34_;
	gchar** _tmp35_;
	gchar** _tmp36_;
	gint _tmp36__length1;
	gchar* _tmp37_;
	gchar* _tmp38_;
	gchar* _tmp39_;
	gchar* _tmp40_;
	gchar** _tmp41_;
	gchar** _tmp42_;
	gint _tmp42__length1;
	gchar* _tmp43_;
	gchar* _tmp44_;
	gchar* _tmp45_;
	gchar** _tmp46_;
	gchar** _tmp47_;
	gint _tmp47__length1;
	gchar* _tmp48_;
	gchar* _tmp49_;
	gchar** _tmp50_;
	gchar** _tmp51_;
	gint _tmp51__length1;
	gchar* _tmp52_;
	gchar** _tmp53_;
	gchar** _tmp54_;
	gint _tmp54__length1;
	GAction* _tmp55_;
	GSimpleAction* _tmp56_;
	GAction* _tmp57_;
	GSimpleAction* _tmp58_;
	GAction* _tmp59_;
	GSimpleAction* _tmp60_;
	GAction* _tmp61_;
	GSimpleAction* _tmp62_;
	GAction* _tmp63_;
	GSimpleAction* _tmp64_;
	GSimpleAction* _tmp65_;
	ZoomLevel _tmp66_;
	GSimpleAction* _tmp67_;
	ZoomLevel _tmp68_;
	self = (Sudoku*) base;
	_tmp0_ = sudoku_backend_new ();
	_g_object_unref0 (self->priv->backend);
	self->priv->backend = _tmp0_;
	sudoku_app = self;
	G_APPLICATION_CLASS (sudoku_parent_class)->startup ((GApplication*) G_TYPE_CHECK_INSTANCE_CAST (self, adw_application_get_type (), AdwApplication));
	_tmp1_ = g_settings_new ("org.gnome.Sudoku");
	_g_object_unref0 (self->priv->settings);
	self->priv->settings = _tmp1_;
	_tmp2_ = self->priv->settings;
	g_settings_bind (_tmp2_, "start-button-selected", (GObject*) self, "start-button-selected", G_SETTINGS_BIND_DEFAULT);
	_tmp3_ = self->priv->settings;
	g_settings_bind (_tmp3_, "zoom-level", (GObject*) self, "zoom-level", G_SETTINGS_BIND_DEFAULT);
	_tmp4_ = self->priv->settings;
	g_settings_bind (_tmp4_, "show-timer", (GObject*) self, "show-timer", G_SETTINGS_BIND_DEFAULT);
	_tmp5_ = self->priv->settings;
	g_settings_bind (_tmp5_, "show-possibilities", (GObject*) self, "show-possibilities", G_SETTINGS_BIND_DEFAULT);
	_tmp6_ = self->priv->settings;
	g_settings_bind (_tmp6_, "autoclean-earmarks", (GObject*) self, "autoclean-earmarks", G_SETTINGS_BIND_DEFAULT);
	_tmp7_ = self->priv->settings;
	g_settings_bind (_tmp7_, "number-picker-second-click", (GObject*) self, "number-picker-second-click", G_SETTINGS_BIND_DEFAULT);
	_tmp8_ = self->priv->settings;
	g_settings_bind (_tmp8_, "duplicate-warnings", (GObject*) self, "duplicate-warnings", G_SETTINGS_BIND_DEFAULT);
	_tmp9_ = self->priv->settings;
	g_settings_bind (_tmp9_, "solution-warnings", (GObject*) self, "solution-warnings", G_SETTINGS_BIND_DEFAULT);
	_tmp10_ = self->priv->settings;
	g_settings_bind (_tmp10_, "earmark-warnings", (GObject*) self, "earmark-warnings", G_SETTINGS_BIND_DEFAULT);
	_tmp11_ = self->priv->settings;
	g_settings_bind (_tmp11_, "highlight-row-column", (GObject*) self, "highlight-row-column", G_SETTINGS_BIND_DEFAULT);
	_tmp12_ = self->priv->settings;
	g_settings_bind (_tmp12_, "highlight-block", (GObject*) self, "highlight-block", G_SETTINGS_BIND_DEFAULT);
	_tmp13_ = self->priv->settings;
	g_settings_bind (_tmp13_, "highlight-numbers", (GObject*) self, "highlight-numbers", G_SETTINGS_BIND_DEFAULT);
	_tmp14_ = self->priv->settings;
	old_warnings_enabled = g_settings_get_boolean (_tmp14_, "show-warnings");
	if (!old_warnings_enabled) {
		GSettings* _tmp15_;
		_tmp15_ = self->priv->settings;
		g_settings_reset (_tmp15_, "show-warnings");
		sudoku_set_duplicate_warnings (self, FALSE);
		sudoku_set_solution_warnings (self, FALSE);
		sudoku_set_earmark_warnings (self, FALSE);
	}
	_tmp16_ = self->priv->settings;
	old_selected_button = (DifficultyCategory) g_settings_get_enum (_tmp16_, "play-difficulty");
	if (old_selected_button != DIFFICULTY_CATEGORY_EASY) {
		GSettings* _tmp17_;
		_tmp17_ = self->priv->settings;
		g_settings_reset (_tmp17_, "play-difficulty");
		sudoku_set_start_button_selected (self, old_selected_button);
	}
	g_action_map_add_action_entries ((GActionMap*) self, SUDOKU_action_entries, (gint) G_N_ELEMENTS (SUDOKU_action_entries), self);
	_tmp18_ = g_strdup ("<Primary>n");
	_tmp19_ = g_new0 (gchar*, 1 + 1);
	_tmp19_[0] = _tmp18_;
	_tmp20_ = _tmp19_;
	_tmp20__length1 = 1;
	gtk_application_set_accels_for_action ((GtkApplication*) self, "app.new-game", _tmp20_);
	_tmp20_ = (_vala_array_free (_tmp20_, _tmp20__length1, (GDestroyNotify) g_free), NULL);
	_tmp21_ = g_strdup ("<Primary>q");
	_tmp22_ = g_new0 (gchar*, 1 + 1);
	_tmp22_[0] = _tmp21_;
	_tmp23_ = _tmp22_;
	_tmp23__length1 = 1;
	gtk_application_set_accels_for_action ((GtkApplication*) self, "app.quit", _tmp23_);
	_tmp23_ = (_vala_array_free (_tmp23_, _tmp23__length1, (GDestroyNotify) g_free), NULL);
	_tmp24_ = g_strdup ("F1");
	_tmp25_ = g_new0 (gchar*, 1 + 1);
	_tmp25_[0] = _tmp24_;
	_tmp26_ = _tmp25_;
	_tmp26__length1 = 1;
	gtk_application_set_accels_for_action ((GtkApplication*) self, "app.help", _tmp26_);
	_tmp26_ = (_vala_array_free (_tmp26_, _tmp26__length1, (GDestroyNotify) g_free), NULL);
	_tmp27_ = g_strdup ("<Primary>question");
	_tmp28_ = g_new0 (gchar*, 1 + 1);
	_tmp28_[0] = _tmp27_;
	_tmp29_ = _tmp28_;
	_tmp29__length1 = 1;
	gtk_application_set_accels_for_action ((GtkApplication*) self, "app.shortcuts-dialog", _tmp29_);
	_tmp29_ = (_vala_array_free (_tmp29_, _tmp29__length1, (GDestroyNotify) g_free), NULL);
	_tmp30_ = g_strdup ("<Primary>comma");
	_tmp31_ = g_new0 (gchar*, 1 + 1);
	_tmp31_[0] = _tmp30_;
	_tmp32_ = _tmp31_;
	_tmp32__length1 = 1;
	gtk_application_set_accels_for_action ((GtkApplication*) self, "app.preferences-dialog", _tmp32_);
	_tmp32_ = (_vala_array_free (_tmp32_, _tmp32__length1, (GDestroyNotify) g_free), NULL);
	_tmp33_ = g_strdup ("F11");
	_tmp34_ = g_strdup ("f");
	_tmp35_ = g_new0 (gchar*, 2 + 1);
	_tmp35_[0] = _tmp33_;
	_tmp35_[1] = _tmp34_;
	_tmp36_ = _tmp35_;
	_tmp36__length1 = 2;
	gtk_application_set_accels_for_action ((GtkApplication*) self, "app.toggle-fullscreen", _tmp36_);
	_tmp36_ = (_vala_array_free (_tmp36_, _tmp36__length1, (GDestroyNotify) g_free), NULL);
	_tmp37_ = g_strdup ("<Primary>plus");
	_tmp38_ = g_strdup ("<Primary>equal");
	_tmp39_ = g_strdup ("ZoomIn");
	_tmp40_ = g_strdup ("<Primary>KP_Add");
	_tmp41_ = g_new0 (gchar*, 4 + 1);
	_tmp41_[0] = _tmp37_;
	_tmp41_[1] = _tmp38_;
	_tmp41_[2] = _tmp39_;
	_tmp41_[3] = _tmp40_;
	_tmp42_ = _tmp41_;
	_tmp42__length1 = 4;
	gtk_application_set_accels_for_action ((GtkApplication*) self, "app.zoom-in", _tmp42_);
	_tmp42_ = (_vala_array_free (_tmp42_, _tmp42__length1, (GDestroyNotify) g_free), NULL);
	_tmp43_ = g_strdup ("<Primary>minus");
	_tmp44_ = g_strdup ("ZoomOut");
	_tmp45_ = g_strdup ("<Primary>KP_Subtract");
	_tmp46_ = g_new0 (gchar*, 3 + 1);
	_tmp46_[0] = _tmp43_;
	_tmp46_[1] = _tmp44_;
	_tmp46_[2] = _tmp45_;
	_tmp47_ = _tmp46_;
	_tmp47__length1 = 3;
	gtk_application_set_accels_for_action ((GtkApplication*) self, "app.zoom-out", _tmp47_);
	_tmp47_ = (_vala_array_free (_tmp47_, _tmp47__length1, (GDestroyNotify) g_free), NULL);
	_tmp48_ = g_strdup ("<Primary>0");
	_tmp49_ = g_strdup ("<Primary>KP_0");
	_tmp50_ = g_new0 (gchar*, 2 + 1);
	_tmp50_[0] = _tmp48_;
	_tmp50_[1] = _tmp49_;
	_tmp51_ = _tmp50_;
	_tmp51__length1 = 2;
	gtk_application_set_accels_for_action ((GtkApplication*) self, "app.zoom-reset", _tmp51_);
	_tmp51_ = (_vala_array_free (_tmp51_, _tmp51__length1, (GDestroyNotify) g_free), NULL);
	_tmp52_ = g_strdup ("<Primary>P");
	_tmp53_ = g_new0 (gchar*, 1 + 1);
	_tmp53_[0] = _tmp52_;
	_tmp54_ = _tmp53_;
	_tmp54__length1 = 1;
	gtk_application_set_accels_for_action ((GtkApplication*) self, "app.print-generator", _tmp54_);
	_tmp54_ = (_vala_array_free (_tmp54_, _tmp54__length1, (GDestroyNotify) g_free), NULL);
	_tmp55_ = g_action_map_lookup_action ((GActionMap*) self, "new-game");
	_tmp56_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp55_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp55_) : NULL);
	_g_object_unref0 (self->priv->new_game_action);
	self->priv->new_game_action = _tmp56_;
	_tmp57_ = g_action_map_lookup_action ((GActionMap*) self, "print-multiple");
	_tmp58_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp57_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp57_) : NULL);
	_g_object_unref0 (self->priv->print_multiple_action);
	self->priv->print_multiple_action = _tmp58_;
	_tmp59_ = g_action_map_lookup_action ((GActionMap*) self, "back");
	_tmp60_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp59_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp59_) : NULL);
	_g_object_unref0 (self->priv->back_action);
	self->priv->back_action = _tmp60_;
	_tmp61_ = g_action_map_lookup_action ((GActionMap*) self, "zoom-in");
	_tmp62_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp61_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp61_) : NULL);
	_g_object_unref0 (self->priv->zoom_in_action);
	self->priv->zoom_in_action = _tmp62_;
	_tmp63_ = g_action_map_lookup_action ((GActionMap*) self, "zoom-out");
	_tmp64_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp63_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp63_) : NULL);
	_g_object_unref0 (self->priv->zoom_out_action);
	self->priv->zoom_out_action = _tmp64_;
	_tmp65_ = self->priv->zoom_in_action;
	_tmp66_ = self->priv->_zoom_level;
	g_simple_action_set_enabled (_tmp65_, !zoom_level_is_fully_zoomed_in (_tmp66_));
	_tmp67_ = self->priv->zoom_out_action;
	_tmp68_ = self->priv->_zoom_level;
	g_simple_action_set_enabled (_tmp67_, !zoom_level_is_fully_zoomed_out (_tmp68_));
	gtk_window_set_default_icon_name (APP_ID);
}

static void
_sudoku_change_game_sudoku_backend_game_changed (SudokuBackend* _sender,
                                                 gpointer self)
{
	sudoku_change_game ((Sudoku*) self);
}

static void
sudoku_real_activate (GApplication* base)
{
	Sudoku * self;
	SudokuWindow* _tmp0_;
	SudokuWindow* _tmp9_;
	self = (Sudoku*) base;
	_tmp0_ = self->priv->window;
	if (_tmp0_ == NULL) {
		SudokuBackend* _tmp1_;
		GSettings* _tmp2_;
		SudokuWindow* _tmp3_;
		SudokuWindow* _tmp4_;
		SudokuBackend* _tmp5_;
		SudokuGame* _tmp6_;
		SudokuGame* _tmp7_;
		SudokuBackend* _tmp8_;
		_tmp1_ = self->priv->backend;
		_tmp2_ = self->priv->settings;
		_tmp3_ = sudoku_window_new (_tmp1_, _tmp2_);
		g_object_ref_sink (_tmp3_);
		_g_object_unref0 (self->priv->window);
		self->priv->window = _tmp3_;
		_tmp4_ = self->priv->window;
		gtk_application_add_window ((GtkApplication*) self, (GtkWindow*) _tmp4_);
		_tmp5_ = self->priv->backend;
		_tmp6_ = sudoku_backend_get_game (_tmp5_);
		_tmp7_ = _tmp6_;
		if (_tmp7_ != NULL) {
			sudoku_change_game (self);
		} else {
			sudoku_show_start_view (self);
		}
		_tmp8_ = self->priv->backend;
		g_signal_connect_object (_tmp8_, "game-changed", (GCallback) _sudoku_change_game_sudoku_backend_game_changed, self, 0);
	}
	_tmp9_ = self->priv->window;
	gtk_window_present ((GtkWindow*) _tmp9_);
}

static void
sudoku_real_shutdown (GApplication* base)
{
	Sudoku * self;
	SudokuWindow* _tmp0_;
	self = (Sudoku*) base;
	_tmp0_ = self->priv->window;
	if (_tmp0_ != NULL) {
		SudokuBackend* _tmp1_;
		SudokuBackend* _tmp2_;
		SudokuWindow* _tmp3_;
		_tmp1_ = self->priv->backend;
		sudoku_backend_stop_autosave (_tmp1_);
		_tmp2_ = self->priv->backend;
		sudoku_backend_save_game (_tmp2_);
		_tmp3_ = self->priv->window;
		gtk_window_close ((GtkWindow*) _tmp3_);
	}
	G_APPLICATION_CLASS (sudoku_parent_class)->shutdown ((GApplication*) G_TYPE_CHECK_INSTANCE_CAST (self, adw_application_get_type (), AdwApplication));
}

static Block3Data*
block3_data_ref (Block3Data* _data3_)
{
	g_atomic_int_inc (&_data3_->_ref_count_);
	return _data3_;
}

static void
block3_data_unref (void * _userdata_)
{
	Block3Data* _data3_;
	_data3_ = (Block3Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
		Sudoku* self;
		self = _data3_->self;
		_g_object_unref0 (_data3_->dialog);
		_g_object_unref0 (self);
		g_slice_free (Block3Data, _data3_);
	}
}

static void
_sudoku_board_completed_cb_sudoku_board_completed (SudokuBoard* _sender,
                                                   gpointer self)
{
	sudoku_board_completed_cb ((Sudoku*) self);
}

static void
__lambda16_ (Block3Data* _data3_,
             const gchar* response_id)
{
	Sudoku* self;
	const gchar* _tmp0_;
	GQuark _tmp2_ = 0U;
	static GQuark _tmp1_label0 = 0;
	static GQuark _tmp1_label1 = 0;
	static GQuark _tmp1_label2 = 0;
	static GQuark _tmp1_label3 = 0;
	AdwAlertDialog* _tmp3_;
	self = _data3_->self;
	g_return_if_fail (response_id != NULL);
	_tmp0_ = response_id;
	_tmp2_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_);
	if (_tmp2_ == ((0 != _tmp1_label0) ? _tmp1_label0 : (_tmp1_label0 = g_quark_from_static_string ("start-menu")))) {
		switch (0) {
			default:
			{
				sudoku_show_start_view (self);
				break;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label1) ? _tmp1_label1 : (_tmp1_label1 = g_quark_from_static_string ("play-again")))) {
		switch (0) {
			default:
			{
				sudoku_create_game (self);
				break;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label2) ? _tmp1_label2 : (_tmp1_label2 = g_quark_from_static_string ("quit")))) {
		switch (0) {
			default:
			{
				g_application_quit ((GApplication*) self);
				break;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label3) ? _tmp1_label3 : (_tmp1_label3 = g_quark_from_static_string ("close")))) {
		switch (0) {
			default:
			{
				sudoku_show_start_view (self);
				break;
			}
		}
	}
	_tmp3_ = _data3_->dialog;
	g_signal_emit_by_name ((GtkWidget*) _tmp3_, "destroy");
}

static void
___lambda16__adw_alert_dialog_response (AdwAlertDialog* _sender,
                                        const gchar* response,
                                        gpointer self)
{
	__lambda16_ (self, response);
}

static void
sudoku_board_completed_cb (Sudoku* self)
{
	Block3Data* _data3_;
	SudokuGame* _tmp0_;
	SudokuGame* _tmp1_;
	SudokuBoard* _tmp2_;
	SudokuBoard* _tmp3_;
	guint _tmp4_;
	SudokuBackend* _tmp5_;
	Sudoku* _tmp6_;
	gboolean _tmp7_;
	gchar* win_str = NULL;
	gchar* _tmp8_;
	gboolean _tmp9_;
	const gchar* _tmp21_;
	AdwAlertDialog* _tmp22_;
	AdwAlertDialog* _tmp23_;
	DifficultyCategory _tmp24_;
	AdwAlertDialog* _tmp30_;
	AdwAlertDialog* _tmp31_;
	SudokuWindow* _tmp32_;
	g_return_if_fail (self != NULL);
	_data3_ = g_slice_new0 (Block3Data);
	_data3_->_ref_count_ = 1;
	_data3_->self = g_object_ref (self);
	_tmp0_ = sudoku_get_game (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = sudoku_game_get_board (_tmp1_);
	_tmp3_ = _tmp2_;
	g_signal_parse_name ("completed", TYPE_SUDOKU_BOARD, &_tmp4_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp3_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp4_, 0, NULL, (GCallback) _sudoku_board_completed_cb_sudoku_board_completed, self);
	_tmp5_ = self->priv->backend;
	_tmp6_ = sudoku_app;
	_tmp7_ = _tmp6_->priv->_show_timer;
	sudoku_backend_add_game_to_finished (_tmp5_, _tmp7_);
	_tmp8_ = g_strdup (_ ("Puzzle Completed!"));
	win_str = _tmp8_;
	_tmp9_ = self->priv->_show_timer;
	if (_tmp9_) {
		gboolean highscore_changed = FALSE;
		SudokuBackend* _tmp10_;
		SudokuWindow* _tmp11_;
		gboolean _tmp12_;
		gboolean _tmp13_;
		_tmp10_ = self->priv->backend;
		highscore_changed = sudoku_backend_save_highscore (_tmp10_);
		_tmp11_ = self->priv->window;
		_tmp12_ = sudoku_window_get_width_is_small (_tmp11_);
		_tmp13_ = _tmp12_;
		if (_tmp13_) {
			gint minutes = 0;
			SudokuGame* _tmp14_;
			SudokuGame* _tmp15_;
			gchar* localized_time = NULL;
			gchar* _tmp16_;
			_tmp14_ = sudoku_get_game (self);
			_tmp15_ = _tmp14_;
			minutes = ((gint) sudoku_game_get_total_time_played (_tmp15_)) / 60;
			_tmp16_ = g_strdup_printf (ngettext ("%d minute", "%d minutes", (gulong) minutes), minutes);
			localized_time = _tmp16_;
			if (highscore_changed) {
				const gchar* _tmp17_;
				gchar* _tmp18_;
				_tmp17_ = localized_time;
				_tmp18_ = g_strdup_printf (_ ("Well done, you completed the puzzle in %s and set a new personal best!"), _tmp17_);
				_g_free0 (win_str);
				win_str = _tmp18_;
			} else {
				const gchar* _tmp19_;
				gchar* _tmp20_;
				_tmp19_ = localized_time;
				_tmp20_ = g_strdup_printf (_ ("Well done, you completed the puzzle in %s!"), _tmp19_);
				_g_free0 (win_str);
				win_str = _tmp20_;
			}
			_g_free0 (localized_time);
		}
	}
	_tmp21_ = win_str;
	_tmp22_ = (AdwAlertDialog*) adw_alert_dialog_new (_tmp21_, NULL);
	g_object_ref_sink (_tmp22_);
	_data3_->dialog = _tmp22_;
	_tmp23_ = _data3_->dialog;
	adw_alert_dialog_add_response (_tmp23_, "quit", _ ("_Quit"));
	_tmp24_ = self->priv->_start_button_selected;
	if (_tmp24_ != DIFFICULTY_CATEGORY_CUSTOM) {
		AdwAlertDialog* _tmp25_;
		AdwAlertDialog* _tmp26_;
		AdwAlertDialog* _tmp27_;
		_tmp25_ = _data3_->dialog;
		adw_alert_dialog_add_response (_tmp25_, "start-menu", _ ("_Change Difficulty"));
		_tmp26_ = _data3_->dialog;
		adw_alert_dialog_add_response (_tmp26_, "play-again", _ ("_Play Again"));
		_tmp27_ = _data3_->dialog;
		adw_alert_dialog_set_response_appearance (_tmp27_, "play-again", ADW_RESPONSE_SUGGESTED);
	} else {
		AdwAlertDialog* _tmp28_;
		AdwAlertDialog* _tmp29_;
		_tmp28_ = _data3_->dialog;
		adw_alert_dialog_add_response (_tmp28_, "start-menu", _ ("_New Game…"));
		_tmp29_ = _data3_->dialog;
		adw_alert_dialog_set_response_appearance (_tmp29_, "start-menu", ADW_RESPONSE_SUGGESTED);
	}
	_tmp30_ = _data3_->dialog;
	g_signal_connect_data (_tmp30_, "response", (GCallback) ___lambda16__adw_alert_dialog_response, block3_data_ref (_data3_), (GClosureNotify) block3_data_unref, 0);
	_tmp31_ = _data3_->dialog;
	_tmp32_ = self->priv->window;
	adw_dialog_present ((AdwDialog*) _tmp31_, (GtkWidget*) _tmp32_);
	_g_free0 (win_str);
	block3_data_unref (_data3_);
	_data3_ = NULL;
}

static void
sudoku_create_game (Sudoku* self)
{
	SudokuBackend* _tmp0_;
	DifficultyCategory _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->backend;
	_tmp1_ = self->priv->_start_button_selected;
	sudoku_backend_generate_game (_tmp0_, _tmp1_);
}

void
sudoku_change_game (Sudoku* self)
{
	SudokuGameView* _tmp0_;
	SudokuGameView* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	SudokuGame* _tmp10_;
	SudokuGame* _tmp11_;
	GSimpleAction* _tmp12_;
	SudokuGame* _tmp13_;
	SudokuGame* _tmp14_;
	SudokuBoard* _tmp15_;
	SudokuBoard* _tmp16_;
	g_return_if_fail (self != NULL);
	_tmp0_ = sudoku_get_game_view (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = sudoku_game_view_get_initialized (_tmp1_);
	_tmp3_ = _tmp2_;
	if (!_tmp3_) {
		SudokuGameView* _tmp4_;
		SudokuGameView* _tmp5_;
		SudokuBackend* _tmp6_;
		SudokuWindow* _tmp7_;
		_tmp4_ = sudoku_get_game_view (self);
		_tmp5_ = _tmp4_;
		_tmp6_ = self->priv->backend;
		_tmp7_ = self->priv->window;
		sudoku_game_view_init (_tmp5_, _tmp6_, _tmp7_);
	} else {
		SudokuGameView* _tmp8_;
		SudokuGameView* _tmp9_;
		_tmp8_ = sudoku_get_game_view (self);
		_tmp9_ = _tmp8_;
		sudoku_game_view_change_game (_tmp9_);
	}
	sudoku_show_game_view (self);
	_tmp10_ = sudoku_get_game (self);
	_tmp11_ = _tmp10_;
	_tmp12_ = self->priv->new_game_action;
	g_object_bind_property_with_closures ((GObject*) _tmp11_, "paused", (GObject*) _tmp12_, "enabled", G_BINDING_DEFAULT | G_BINDING_INVERT_BOOLEAN, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp13_ = sudoku_get_game (self);
	_tmp14_ = _tmp13_;
	_tmp15_ = sudoku_game_get_board (_tmp14_);
	_tmp16_ = _tmp15_;
	g_signal_connect_object (_tmp16_, "completed", (GCallback) _sudoku_board_completed_cb_sudoku_board_completed, self, 0);
}

static void
sudoku_show_start_view (Sudoku* self)
{
	gboolean _tmp0_ = FALSE;
	SudokuGame* _tmp1_;
	SudokuGame* _tmp2_;
	GSimpleAction* _tmp11_;
	SudokuWindow* _tmp12_;
	g_return_if_fail (self != NULL);
	_tmp1_ = sudoku_get_game (self);
	_tmp2_ = _tmp1_;
	if (_tmp2_ != NULL) {
		SudokuGame* _tmp3_;
		SudokuGame* _tmp4_;
		SudokuBoard* _tmp5_;
		SudokuBoard* _tmp6_;
		gboolean _tmp7_;
		gboolean _tmp8_;
		_tmp3_ = sudoku_get_game (self);
		_tmp4_ = _tmp3_;
		_tmp5_ = sudoku_game_get_board (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = sudoku_board_get_complete (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp0_ = _tmp8_ != TRUE;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		SudokuGame* _tmp9_;
		SudokuGame* _tmp10_;
		_tmp9_ = sudoku_get_game (self);
		_tmp10_ = _tmp9_;
		sudoku_game_stop_clock (_tmp10_);
	}
	_tmp11_ = self->priv->new_game_action;
	g_simple_action_set_enabled (_tmp11_, FALSE);
	_tmp12_ = self->priv->window;
	sudoku_window_show_start_view (_tmp12_);
}

static void
sudoku_show_game_view (Sudoku* self)
{
	GSimpleAction* _tmp0_;
	SudokuWindow* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->new_game_action;
	g_simple_action_set_enabled (_tmp0_, TRUE);
	_tmp1_ = self->priv->window;
	sudoku_window_show_game_view (_tmp1_);
}

static void
sudoku_new_game_cb (Sudoku* self)
{
	g_return_if_fail (self != NULL);
	sudoku_show_start_view (self);
}

static DifficultyCategory
_variant_get1 (GVariant* value)
{
	return g_variant_get_int32 (value);
}

static void
sudoku_start_game_cb (Sudoku* self,
                      GSimpleAction* action,
                      GVariant* difficulty)
{
	DifficultyCategory _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	_tmp0_ = _variant_get1 (difficulty);
	sudoku_set_start_button_selected (self, _tmp0_);
	sudoku_create_game (self);
}

static Block4Data*
block4_data_ref (Block4Data* _data4_)
{
	g_atomic_int_inc (&_data4_->_ref_count_);
	return _data4_;
}

static void
block4_data_unref (void * _userdata_)
{
	Block4Data* _data4_;
	_data4_ = (Block4Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data4_->_ref_count_)) {
		Sudoku* self;
		self = _data4_->self;
		_g_object_unref0 (_data4_->file_dialog);
		_g_object_unref0 (self);
		g_slice_free (Block4Data, _data4_);
	}
}

static void
__lambda12_ (Block4Data* _data4_,
             GObject* obj,
             GAsyncResult* res)
{
	Sudoku* self;
	GError* _inner_error0_ = NULL;
	self = _data4_->self;
	g_return_if_fail (res != NULL);
	{
		GFile* file = NULL;
		GtkFileDialog* _tmp0_;
		GFile* _tmp1_;
		SudokuBackend* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		gboolean _tmp5_;
		_tmp0_ = _data4_->file_dialog;
		_tmp1_ = gtk_file_dialog_open_finish (_tmp0_, res, &_inner_error0_);
		file = _tmp1_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp2_ = self->priv->backend;
		_tmp3_ = g_file_get_path (file);
		_tmp4_ = _tmp3_;
		_tmp5_ = !sudoku_backend_load_game_path (_tmp2_, _tmp4_);
		_g_free0 (_tmp4_);
		if (_tmp5_) {
			sudoku_open_fail (self);
		}
		_g_object_unref0 (file);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp6_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp6_ = e;
		if (_tmp6_->domain == ((GQuark) GTK_DIALOG_ERROR_FAILED)) {
			GError* _tmp7_;
			const gchar* _tmp8_;
			_tmp7_ = e;
			_tmp8_ = _tmp7_->message;
			g_warning ("gnome-sudoku.vala:356: Error: %s", _tmp8_);
		}
		_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
___lambda12__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda12_ (self, source_object, res);
	block4_data_unref (self);
}

static void
sudoku_open_file_cb (Sudoku* self)
{
	Block4Data* _data4_;
	GtkFileDialog* _tmp0_;
	GtkFileDialog* _tmp1_;
	GtkFileFilter* filter = NULL;
	GtkFileDialog* _tmp2_;
	GtkFileFilter* _tmp3_;
	GtkFileFilter* _tmp4_;
	GtkFileFilter* _tmp5_;
	GtkFileFilter* _tmp9_;
	GtkFileFilter* _tmp10_;
	GtkFileFilter* _tmp11_;
	GFile* dir = NULL;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	GFile* _tmp14_;
	GFile* _tmp15_;
	GtkFileDialog* _tmp18_;
	SudokuWindow* _tmp19_;
	g_return_if_fail (self != NULL);
	_data4_ = g_slice_new0 (Block4Data);
	_data4_->_ref_count_ = 1;
	_data4_->self = g_object_ref (self);
	_tmp0_ = gtk_file_dialog_new ();
	_data4_->file_dialog = _tmp0_;
	_tmp1_ = _data4_->file_dialog;
	gtk_file_dialog_set_accept_label (_tmp1_, _ ("_Start Game"));
	_tmp2_ = _data4_->file_dialog;
	_tmp3_ = gtk_file_dialog_get_default_filter (_tmp2_);
	_tmp4_ = _g_object_ref0 (_tmp3_);
	filter = _tmp4_;
	_tmp5_ = filter;
	if (_tmp5_ == NULL) {
		GtkFileFilter* _tmp6_;
		GtkFileDialog* _tmp7_;
		GtkFileFilter* _tmp8_;
		_tmp6_ = gtk_file_filter_new ();
		_g_object_unref0 (filter);
		filter = _tmp6_;
		_tmp7_ = _data4_->file_dialog;
		_tmp8_ = filter;
		gtk_file_dialog_set_default_filter (_tmp7_, _tmp8_);
	}
	_tmp9_ = filter;
	gtk_file_filter_add_suffix (_tmp9_, "skp");
	_tmp10_ = filter;
	gtk_file_filter_add_mime_type (_tmp10_, "text/plain");
	_tmp11_ = filter;
	gtk_file_filter_add_suffix (_tmp11_, "save");
	_tmp12_ = sudoku_backend_get_saved_dir ();
	_tmp13_ = _tmp12_;
	_tmp14_ = g_file_new_for_path (_tmp13_);
	dir = _tmp14_;
	_tmp15_ = dir;
	if (g_file_query_exists (_tmp15_, NULL)) {
		GtkFileDialog* _tmp16_;
		GFile* _tmp17_;
		_tmp16_ = _data4_->file_dialog;
		_tmp17_ = dir;
		gtk_file_dialog_set_initial_folder (_tmp16_, _tmp17_);
	}
	_tmp18_ = _data4_->file_dialog;
	_tmp19_ = self->priv->window;
	gtk_file_dialog_open (_tmp18_, (GtkWindow*) _tmp19_, NULL, ___lambda12__gasync_ready_callback, block4_data_ref (_data4_));
	_g_object_unref0 (dir);
	_g_object_unref0 (filter);
	block4_data_unref (_data4_);
	_data4_ = NULL;
}

static void
__lambda13_ (Sudoku* self,
             const gchar* response_id)
{
	g_return_if_fail (response_id != NULL);
	if (g_strcmp0 (response_id, "open") == 0) {
		sudoku_open_file_cb (self);
	}
}

static void
___lambda13__adw_alert_dialog_response (AdwAlertDialog* _sender,
                                        const gchar* response,
                                        gpointer self)
{
	__lambda13_ ((Sudoku*) self, response);
}

static void
sudoku_open_fail (Sudoku* self)
{
	AdwAlertDialog* dialog = NULL;
	AdwAlertDialog* _tmp0_;
	SudokuWindow* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = (AdwAlertDialog*) adw_alert_dialog_new (_ ("Failed to import the puzzle, please enter a valid Sudoku puzzle"), NULL);
	g_object_ref_sink (_tmp0_);
	dialog = _tmp0_;
	adw_alert_dialog_add_response (dialog, "close", _ ("_Cancel"));
	adw_alert_dialog_add_response (dialog, "open", _ ("_Try Again"));
	adw_alert_dialog_set_response_appearance (dialog, "open", ADW_RESPONSE_SUGGESTED);
	g_signal_connect_object (dialog, "response", (GCallback) ___lambda13__adw_alert_dialog_response, self, 0);
	_tmp1_ = self->priv->window;
	adw_dialog_present ((AdwDialog*) dialog, (GtkWidget*) _tmp1_);
	_g_object_unref0 (dialog);
}

static void
sudoku_back_cb (Sudoku* self)
{
	gboolean _tmp0_ = FALSE;
	SudokuGame* _tmp1_;
	SudokuGame* _tmp2_;
	SudokuWindow* _tmp9_;
	SudokuWindowScreen _tmp10_;
	SudokuWindowScreen _tmp11_;
	g_return_if_fail (self != NULL);
	_tmp1_ = sudoku_get_game (self);
	_tmp2_ = _tmp1_;
	if (_tmp2_ == NULL) {
		_tmp0_ = TRUE;
	} else {
		SudokuGame* _tmp3_;
		SudokuGame* _tmp4_;
		SudokuBoard* _tmp5_;
		SudokuBoard* _tmp6_;
		gboolean _tmp7_;
		gboolean _tmp8_;
		_tmp3_ = sudoku_get_game (self);
		_tmp4_ = _tmp3_;
		_tmp5_ = sudoku_game_get_board (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = sudoku_board_get_complete (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp0_ = _tmp8_ == TRUE;
	}
	if (_tmp0_) {
		return;
	}
	sudoku_show_game_view (self);
	_tmp9_ = self->priv->window;
	_tmp10_ = sudoku_window_get_current_screen (_tmp9_);
	_tmp11_ = _tmp10_;
	if (_tmp11_ == SUDOKU_WINDOW_SCREEN_PLAY) {
		SudokuGame* _tmp12_;
		SudokuGame* _tmp13_;
		_tmp12_ = sudoku_get_game (self);
		_tmp13_ = _tmp12_;
		sudoku_game_resume_clock (_tmp13_);
	}
}

static void
sudoku_print_multiple_cb (Sudoku* self)
{
	SudokuPrintDialog* print_dialog = NULL;
	SudokuBackend* _tmp0_;
	SudokuWindow* _tmp1_;
	SudokuPrintDialog* _tmp2_;
	SudokuWindow* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->backend;
	_tmp1_ = self->priv->window;
	_tmp2_ = sudoku_print_dialog_new (_tmp0_, _tmp1_);
	g_object_ref_sink (_tmp2_);
	print_dialog = _tmp2_;
	_tmp3_ = self->priv->window;
	adw_dialog_present ((AdwDialog*) print_dialog, (GtkWidget*) _tmp3_);
	_g_object_unref0 (print_dialog);
}

static void
sudoku_preferences_dialog_cb (Sudoku* self)
{
	SudokuPreferencesDialog* preferences_dialog = NULL;
	SudokuPreferencesDialog* _tmp0_;
	SudokuWindow* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = sudoku_preferences_dialog_new ();
	g_object_ref_sink (_tmp0_);
	preferences_dialog = _tmp0_;
	_tmp1_ = self->priv->window;
	adw_dialog_present ((AdwDialog*) preferences_dialog, (GtkWidget*) _tmp1_);
	_g_object_unref0 (preferences_dialog);
}

static void
sudoku_shortcuts_dialog_cb (Sudoku* self)
{
	GtkBuilder* builder = NULL;
	GtkBuilder* _tmp0_;
	AdwShortcutsDialog* shortcuts_dialog = NULL;
	GObject* _tmp1_;
	AdwShortcutsDialog* _tmp2_;
	SudokuWindow* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_builder_new_from_resource ("/org/gnome/Sudoku/ui/shortcuts-dialog.ui");
	builder = _tmp0_;
	_tmp1_ = gtk_builder_get_object (builder, "SudokuShortcutsDialog");
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, adw_shortcuts_dialog_get_type ()) ? ((AdwShortcutsDialog*) _tmp1_) : NULL);
	shortcuts_dialog = _tmp2_;
	_tmp3_ = self->priv->window;
	adw_dialog_present ((AdwDialog*) shortcuts_dialog, (GtkWidget*) _tmp3_);
	_g_object_unref0 (shortcuts_dialog);
	_g_object_unref0 (builder);
}

static void
sudoku_help_cb (Sudoku* self)
{
	SudokuWindow* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->window;
	gtk_show_uri ((GtkWindow*) _tmp0_, "help:gnome-sudoku", (guint32) GDK_CURRENT_TIME);
}

static void
sudoku_about_cb (Sudoku* self)
{
	AdwAboutDialog* about_dialog = NULL;
	AdwAboutDialog* _tmp0_;
	SudokuWindow* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = (AdwAboutDialog*) adw_about_dialog_new_from_appdata ("/org/gnome/Sudoku/metainfo.xml", VERSION);
	g_object_ref_sink (_tmp0_);
	about_dialog = _tmp0_;
	adw_about_dialog_set_version (about_dialog, VERSION);
	adw_about_dialog_set_copyright (about_dialog, "Copyright © 2005–2008 Thomas M. Hinkle\n" \
"Copyright © 2010–2011 Robert Ancell\n" \
"Copyright © 2014 Parin Porecha\n" \
"Copyright © 2023 Jamie Murphy\n" \
"Copyright © 2024-2026 Johan Gay");
	adw_about_dialog_set_developers (about_dialog, SUDOKU_authors);
	adw_about_dialog_set_translator_credits (about_dialog, _ ("translator-credits"));
	_tmp1_ = self->priv->window;
	adw_dialog_present ((AdwDialog*) about_dialog, (GtkWidget*) _tmp1_);
	_g_object_unref0 (about_dialog);
}

static void
sudoku_toggle_fullscreen_cb (Sudoku* self)
{
	SudokuWindow* _tmp0_;
	SudokuWindow* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->window;
	_tmp1_ = self->priv->window;
	g_object_get ((GtkWindow*) _tmp1_, "fullscreened", &_tmp2_, NULL);
	_tmp3_ = _tmp2_;
	g_object_set ((GtkWindow*) _tmp0_, "fullscreened", !_tmp3_, NULL);
}

static void
sudoku_zoom_in_cb (Sudoku* self)
{
	ZoomLevel _tmp0_;
	ZoomLevel _tmp1_;
	GSimpleAction* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_zoom_level;
	sudoku_set_zoom_level (self, zoom_level_zoom_in (_tmp0_));
	_tmp1_ = self->priv->_zoom_level;
	if (zoom_level_is_fully_zoomed_in (_tmp1_)) {
		GSimpleAction* _tmp2_;
		_tmp2_ = self->priv->zoom_in_action;
		g_simple_action_set_enabled (_tmp2_, FALSE);
	}
	_tmp3_ = self->priv->zoom_out_action;
	g_simple_action_set_enabled (_tmp3_, TRUE);
}

static void
sudoku_zoom_out_cb (Sudoku* self)
{
	ZoomLevel _tmp0_;
	ZoomLevel _tmp1_;
	GSimpleAction* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_zoom_level;
	sudoku_set_zoom_level (self, zoom_level_zoom_out (_tmp0_));
	_tmp1_ = self->priv->_zoom_level;
	if (zoom_level_is_fully_zoomed_out (_tmp1_)) {
		GSimpleAction* _tmp2_;
		_tmp2_ = self->priv->zoom_out_action;
		g_simple_action_set_enabled (_tmp2_, FALSE);
	}
	_tmp3_ = self->priv->zoom_in_action;
	g_simple_action_set_enabled (_tmp3_, TRUE);
}

static void
sudoku_zoom_reset_cb (Sudoku* self)
{
	GSettings* _tmp0_;
	GSimpleAction* _tmp1_;
	GSimpleAction* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->settings;
	g_settings_reset (_tmp0_, "zoom-level");
	_tmp1_ = self->priv->zoom_in_action;
	g_simple_action_set_enabled (_tmp1_, TRUE);
	_tmp2_ = self->priv->zoom_out_action;
	g_simple_action_set_enabled (_tmp2_, TRUE);
}

static gint
sudoku_main (gchar** args,
             gint args_length1)
{
	Sudoku* _tmp0_;
	Sudoku* _tmp1_;
	gint _tmp2_;
	gint result;
	_tmp0_ = sudoku_new ();
	_tmp1_ = _tmp0_;
	_tmp2_ = g_application_run ((GApplication*) _tmp1_, (gint) args_length1, args);
	_g_object_unref0 (_tmp1_);
	result = _tmp2_;
	return result;
}

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

static SudokuGameView*
sudoku_get_game_view (Sudoku* self)
{
	SudokuGameView* result;
	SudokuWindow* _tmp0_;
	SudokuGameView* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->window;
	_tmp1_ = _tmp0_->game_view;
	result = _tmp1_;
	return result;
}

static SudokuGame*
sudoku_get_game (Sudoku* 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;
}

DifficultyCategory
sudoku_get_start_button_selected (Sudoku* self)
{
	DifficultyCategory result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_start_button_selected;
	return result;
}

void
sudoku_set_start_button_selected (Sudoku* self,
                                  DifficultyCategory value)
{
	DifficultyCategory old_value;
	g_return_if_fail (self != NULL);
	old_value = sudoku_get_start_button_selected (self);
	if (old_value != value) {
		self->priv->_start_button_selected = value;
		g_object_notify_by_pspec ((GObject *) self, sudoku_properties[SUDOKU_START_BUTTON_SELECTED_PROPERTY]);
	}
}

ZoomLevel
sudoku_get_zoom_level (Sudoku* self)
{
	ZoomLevel result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_zoom_level;
	return result;
}

void
sudoku_set_zoom_level (Sudoku* self,
                       ZoomLevel value)
{
	ZoomLevel old_value;
	g_return_if_fail (self != NULL);
	old_value = sudoku_get_zoom_level (self);
	if (old_value != value) {
		self->priv->_zoom_level = value;
		g_object_notify_by_pspec ((GObject *) self, sudoku_properties[SUDOKU_ZOOM_LEVEL_PROPERTY]);
	}
}

gboolean
sudoku_get_show_timer (Sudoku* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_show_timer;
	return result;
}

void
sudoku_set_show_timer (Sudoku* self,
                       gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = sudoku_get_show_timer (self);
	if (old_value != value) {
		self->priv->_show_timer = value;
		g_object_notify_by_pspec ((GObject *) self, sudoku_properties[SUDOKU_SHOW_TIMER_PROPERTY]);
	}
}

gboolean
sudoku_get_earmark_mode (Sudoku* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_earmark_mode;
	return result;
}

void
sudoku_set_earmark_mode (Sudoku* self,
                         gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = sudoku_get_earmark_mode (self);
	if (old_value != value) {
		self->priv->_earmark_mode = value;
		g_object_notify_by_pspec ((GObject *) self, sudoku_properties[SUDOKU_EARMARK_MODE_PROPERTY]);
	}
}

gboolean
sudoku_get_show_possibilities (Sudoku* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_show_possibilities;
	return result;
}

void
sudoku_set_show_possibilities (Sudoku* self,
                               gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = sudoku_get_show_possibilities (self);
	if (old_value != value) {
		self->priv->_show_possibilities = value;
		g_object_notify_by_pspec ((GObject *) self, sudoku_properties[SUDOKU_SHOW_POSSIBILITIES_PROPERTY]);
	}
}

gboolean
sudoku_get_highlight_row_column (Sudoku* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_highlight_row_column;
	return result;
}

void
sudoku_set_highlight_row_column (Sudoku* self,
                                 gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = sudoku_get_highlight_row_column (self);
	if (old_value != value) {
		self->priv->_highlight_row_column = value;
		g_object_notify_by_pspec ((GObject *) self, sudoku_properties[SUDOKU_HIGHLIGHT_ROW_COLUMN_PROPERTY]);
	}
}

gboolean
sudoku_get_highlight_block (Sudoku* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_highlight_block;
	return result;
}

void
sudoku_set_highlight_block (Sudoku* self,
                            gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = sudoku_get_highlight_block (self);
	if (old_value != value) {
		self->priv->_highlight_block = value;
		g_object_notify_by_pspec ((GObject *) self, sudoku_properties[SUDOKU_HIGHLIGHT_BLOCK_PROPERTY]);
	}
}

gboolean
sudoku_get_highlight_numbers (Sudoku* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_highlight_numbers;
	return result;
}

void
sudoku_set_highlight_numbers (Sudoku* self,
                              gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = sudoku_get_highlight_numbers (self);
	if (old_value != value) {
		self->priv->_highlight_numbers = value;
		g_object_notify_by_pspec ((GObject *) self, sudoku_properties[SUDOKU_HIGHLIGHT_NUMBERS_PROPERTY]);
	}
}

gboolean
sudoku_get_duplicate_warnings (Sudoku* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_duplicate_warnings;
	return result;
}

void
sudoku_set_duplicate_warnings (Sudoku* self,
                               gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = sudoku_get_duplicate_warnings (self);
	if (old_value != value) {
		self->priv->_duplicate_warnings = value;
		g_object_notify_by_pspec ((GObject *) self, sudoku_properties[SUDOKU_DUPLICATE_WARNINGS_PROPERTY]);
	}
}

gboolean
sudoku_get_solution_warnings (Sudoku* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_solution_warnings;
	return result;
}

void
sudoku_set_solution_warnings (Sudoku* self,
                              gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = sudoku_get_solution_warnings (self);
	if (old_value != value) {
		self->priv->_solution_warnings = value;
		g_object_notify_by_pspec ((GObject *) self, sudoku_properties[SUDOKU_SOLUTION_WARNINGS_PROPERTY]);
	}
}

gboolean
sudoku_get_earmark_warnings (Sudoku* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_earmark_warnings;
	return result;
}

void
sudoku_set_earmark_warnings (Sudoku* self,
                             gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = sudoku_get_earmark_warnings (self);
	if (old_value != value) {
		self->priv->_earmark_warnings = value;
		g_object_notify_by_pspec ((GObject *) self, sudoku_properties[SUDOKU_EARMARK_WARNINGS_PROPERTY]);
	}
}

gboolean
sudoku_get_autoclean_earmarks (Sudoku* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_autoclean_earmarks;
	return result;
}

void
sudoku_set_autoclean_earmarks (Sudoku* self,
                               gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = sudoku_get_autoclean_earmarks (self);
	if (old_value != value) {
		self->priv->_autoclean_earmarks = value;
		g_object_notify_by_pspec ((GObject *) self, sudoku_properties[SUDOKU_AUTOCLEAN_EARMARKS_PROPERTY]);
	}
}

gboolean
sudoku_get_number_picker_second_click (Sudoku* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_number_picker_second_click;
	return result;
}

void
sudoku_set_number_picker_second_click (Sudoku* self,
                                       gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = sudoku_get_number_picker_second_click (self);
	if (old_value != value) {
		self->priv->_number_picker_second_click = value;
		g_object_notify_by_pspec ((GObject *) self, sudoku_properties[SUDOKU_NUMBER_PICKER_SECOND_CLICK_PROPERTY]);
	}
}

static void
sudoku_class_init (SudokuClass * klass,
                   gpointer klass_data)
{
	sudoku_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &Sudoku_private_offset);
	((GApplicationClass *) klass)->handle_local_options = (gint (*) (GApplication*, GVariantDict*)) sudoku_real_handle_local_options;
	((GApplicationClass *) klass)->startup = (void (*) (GApplication*)) sudoku_real_startup;
	((GApplicationClass *) klass)->activate = (void (*) (GApplication*)) sudoku_real_activate;
	((GApplicationClass *) klass)->shutdown = (void (*) (GApplication*)) sudoku_real_shutdown;
	G_OBJECT_CLASS (klass)->get_property = _vala_sudoku_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_sudoku_set_property;
	G_OBJECT_CLASS (klass)->finalize = sudoku_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SUDOKU_START_BUTTON_SELECTED_PROPERTY, sudoku_properties[SUDOKU_START_BUTTON_SELECTED_PROPERTY] = g_param_spec_enum ("start-button-selected", "start-button-selected", "start-button-selected", TYPE_DIFFICULTY_CATEGORY, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SUDOKU_ZOOM_LEVEL_PROPERTY, sudoku_properties[SUDOKU_ZOOM_LEVEL_PROPERTY] = g_param_spec_enum ("zoom-level", "zoom-level", "zoom-level", TYPE_ZOOM_LEVEL, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SUDOKU_SHOW_TIMER_PROPERTY, sudoku_properties[SUDOKU_SHOW_TIMER_PROPERTY] = g_param_spec_boolean ("show-timer", "show-timer", "show-timer", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SUDOKU_EARMARK_MODE_PROPERTY, sudoku_properties[SUDOKU_EARMARK_MODE_PROPERTY] = g_param_spec_boolean ("earmark-mode", "earmark-mode", "earmark-mode", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SUDOKU_SHOW_POSSIBILITIES_PROPERTY, sudoku_properties[SUDOKU_SHOW_POSSIBILITIES_PROPERTY] = g_param_spec_boolean ("show-possibilities", "show-possibilities", "show-possibilities", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SUDOKU_HIGHLIGHT_ROW_COLUMN_PROPERTY, sudoku_properties[SUDOKU_HIGHLIGHT_ROW_COLUMN_PROPERTY] = g_param_spec_boolean ("highlight-row-column", "highlight-row-column", "highlight-row-column", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SUDOKU_HIGHLIGHT_BLOCK_PROPERTY, sudoku_properties[SUDOKU_HIGHLIGHT_BLOCK_PROPERTY] = g_param_spec_boolean ("highlight-block", "highlight-block", "highlight-block", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SUDOKU_HIGHLIGHT_NUMBERS_PROPERTY, sudoku_properties[SUDOKU_HIGHLIGHT_NUMBERS_PROPERTY] = g_param_spec_boolean ("highlight-numbers", "highlight-numbers", "highlight-numbers", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SUDOKU_DUPLICATE_WARNINGS_PROPERTY, sudoku_properties[SUDOKU_DUPLICATE_WARNINGS_PROPERTY] = g_param_spec_boolean ("duplicate-warnings", "duplicate-warnings", "duplicate-warnings", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SUDOKU_SOLUTION_WARNINGS_PROPERTY, sudoku_properties[SUDOKU_SOLUTION_WARNINGS_PROPERTY] = g_param_spec_boolean ("solution-warnings", "solution-warnings", "solution-warnings", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SUDOKU_EARMARK_WARNINGS_PROPERTY, sudoku_properties[SUDOKU_EARMARK_WARNINGS_PROPERTY] = g_param_spec_boolean ("earmark-warnings", "earmark-warnings", "earmark-warnings", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SUDOKU_AUTOCLEAN_EARMARKS_PROPERTY, sudoku_properties[SUDOKU_AUTOCLEAN_EARMARKS_PROPERTY] = g_param_spec_boolean ("autoclean-earmarks", "autoclean-earmarks", "autoclean-earmarks", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SUDOKU_NUMBER_PICKER_SECOND_CLICK_PROPERTY, sudoku_properties[SUDOKU_NUMBER_PICKER_SECOND_CLICK_PROPERTY] = g_param_spec_boolean ("number-picker-second-click", "number-picker-second-click", "number-picker-second-click", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
sudoku_instance_init (Sudoku * self,
                      gpointer klass)
{
	self->priv = sudoku_get_instance_private (self);
	self->priv->_earmark_mode = FALSE;
}

static void
sudoku_finalize (GObject * obj)
{
	Sudoku * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_SUDOKU, Sudoku);
	_g_object_unref0 (self->priv->settings);
	_g_object_unref0 (self->priv->window);
	_g_object_unref0 (self->priv->print_multiple_action);
	_g_object_unref0 (self->priv->new_game_action);
	_g_object_unref0 (self->priv->back_action);
	_g_object_unref0 (self->priv->zoom_in_action);
	_g_object_unref0 (self->priv->zoom_out_action);
	_g_object_unref0 (self->priv->backend);
	G_OBJECT_CLASS (sudoku_parent_class)->finalize (obj);
}

static GType
sudoku_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SudokuClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) sudoku_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Sudoku), 0, (GInstanceInitFunc) sudoku_instance_init, NULL };
	GType sudoku_type_id;
	sudoku_type_id = g_type_register_static (adw_application_get_type (), "Sudoku", &g_define_type_info, 0);
	Sudoku_private_offset = g_type_add_instance_private (sudoku_type_id, sizeof (SudokuPrivate));
	return sudoku_type_id;
}

GType
sudoku_get_type (void)
{
	static volatile gsize sudoku_type_id__once = 0;
	if (g_once_init_enter (&sudoku_type_id__once)) {
		GType sudoku_type_id;
		sudoku_type_id = sudoku_get_type_once ();
		g_once_init_leave (&sudoku_type_id__once, sudoku_type_id);
	}
	return sudoku_type_id__once;
}

static void
_vala_sudoku_get_property (GObject * object,
                           guint property_id,
                           GValue * value,
                           GParamSpec * pspec)
{
	Sudoku * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_SUDOKU, Sudoku);
	switch (property_id) {
		case SUDOKU_START_BUTTON_SELECTED_PROPERTY:
		g_value_set_enum (value, sudoku_get_start_button_selected (self));
		break;
		case SUDOKU_ZOOM_LEVEL_PROPERTY:
		g_value_set_enum (value, sudoku_get_zoom_level (self));
		break;
		case SUDOKU_SHOW_TIMER_PROPERTY:
		g_value_set_boolean (value, sudoku_get_show_timer (self));
		break;
		case SUDOKU_EARMARK_MODE_PROPERTY:
		g_value_set_boolean (value, sudoku_get_earmark_mode (self));
		break;
		case SUDOKU_SHOW_POSSIBILITIES_PROPERTY:
		g_value_set_boolean (value, sudoku_get_show_possibilities (self));
		break;
		case SUDOKU_HIGHLIGHT_ROW_COLUMN_PROPERTY:
		g_value_set_boolean (value, sudoku_get_highlight_row_column (self));
		break;
		case SUDOKU_HIGHLIGHT_BLOCK_PROPERTY:
		g_value_set_boolean (value, sudoku_get_highlight_block (self));
		break;
		case SUDOKU_HIGHLIGHT_NUMBERS_PROPERTY:
		g_value_set_boolean (value, sudoku_get_highlight_numbers (self));
		break;
		case SUDOKU_DUPLICATE_WARNINGS_PROPERTY:
		g_value_set_boolean (value, sudoku_get_duplicate_warnings (self));
		break;
		case SUDOKU_SOLUTION_WARNINGS_PROPERTY:
		g_value_set_boolean (value, sudoku_get_solution_warnings (self));
		break;
		case SUDOKU_EARMARK_WARNINGS_PROPERTY:
		g_value_set_boolean (value, sudoku_get_earmark_warnings (self));
		break;
		case SUDOKU_AUTOCLEAN_EARMARKS_PROPERTY:
		g_value_set_boolean (value, sudoku_get_autoclean_earmarks (self));
		break;
		case SUDOKU_NUMBER_PICKER_SECOND_CLICK_PROPERTY:
		g_value_set_boolean (value, sudoku_get_number_picker_second_click (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_sudoku_set_property (GObject * object,
                           guint property_id,
                           const GValue * value,
                           GParamSpec * pspec)
{
	Sudoku * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_SUDOKU, Sudoku);
	switch (property_id) {
		case SUDOKU_START_BUTTON_SELECTED_PROPERTY:
		sudoku_set_start_button_selected (self, g_value_get_enum (value));
		break;
		case SUDOKU_ZOOM_LEVEL_PROPERTY:
		sudoku_set_zoom_level (self, g_value_get_enum (value));
		break;
		case SUDOKU_SHOW_TIMER_PROPERTY:
		sudoku_set_show_timer (self, g_value_get_boolean (value));
		break;
		case SUDOKU_EARMARK_MODE_PROPERTY:
		sudoku_set_earmark_mode (self, g_value_get_boolean (value));
		break;
		case SUDOKU_SHOW_POSSIBILITIES_PROPERTY:
		sudoku_set_show_possibilities (self, g_value_get_boolean (value));
		break;
		case SUDOKU_HIGHLIGHT_ROW_COLUMN_PROPERTY:
		sudoku_set_highlight_row_column (self, g_value_get_boolean (value));
		break;
		case SUDOKU_HIGHLIGHT_BLOCK_PROPERTY:
		sudoku_set_highlight_block (self, g_value_get_boolean (value));
		break;
		case SUDOKU_HIGHLIGHT_NUMBERS_PROPERTY:
		sudoku_set_highlight_numbers (self, g_value_get_boolean (value));
		break;
		case SUDOKU_DUPLICATE_WARNINGS_PROPERTY:
		sudoku_set_duplicate_warnings (self, g_value_get_boolean (value));
		break;
		case SUDOKU_SOLUTION_WARNINGS_PROPERTY:
		sudoku_set_solution_warnings (self, g_value_get_boolean (value));
		break;
		case SUDOKU_EARMARK_WARNINGS_PROPERTY:
		sudoku_set_earmark_warnings (self, g_value_get_boolean (value));
		break;
		case SUDOKU_AUTOCLEAN_EARMARKS_PROPERTY:
		sudoku_set_autoclean_earmarks (self, g_value_get_boolean (value));
		break;
		case SUDOKU_NUMBER_PICKER_SECOND_CLICK_PROPERTY:
		sudoku_set_number_picker_second_click (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

