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

/* -*- Mode: vala; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * Copyright © 2024 Johan Gay
 *
 * 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 <glib.h>
#include <gtk/gtk.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_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 _SudokuPreferencesDialogPrivate SudokuPreferencesDialogPrivate;
enum  {
	SUDOKU_PREFERENCES_DIALOG_0_PROPERTY,
	SUDOKU_PREFERENCES_DIALOG_NUM_PROPERTIES
};
static GParamSpec* sudoku_preferences_dialog_properties[SUDOKU_PREFERENCES_DIALOG_NUM_PROPERTIES];

#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;

struct _SudokuPreferencesDialog {
	AdwPreferencesDialog parent_instance;
	SudokuPreferencesDialogPrivate * priv;
	AdwSwitchRow* show_timer;
	AdwSwitchRow* autoclean_earmarks;
	AdwSwitchRow* number_picker_second_click;
	AdwSwitchRow* show_possibilities;
	AdwSwitchRow* earmark_warnings;
	AdwSwitchRow* solution_warnings;
	AdwSwitchRow* duplicate_warnings;
	AdwSwitchRow* highlight_numbers;
	AdwSwitchRow* highlight_block;
	AdwSwitchRow* highlight_row_column;
};

struct _SudokuPreferencesDialogClass {
	AdwPreferencesDialogClass parent_class;
};

static gpointer sudoku_preferences_dialog_parent_class = NULL;
VALA_EXTERN Sudoku* sudoku_app;

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 GType sudoku_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Sudoku, g_object_unref)
static void sudoku_preferences_dialog_real_dispose (GObject* base);
static void sudoku_preferences_dialog_finalize (GObject * obj);
static GType sudoku_preferences_dialog_get_type_once (void);

SudokuPreferencesDialog*
sudoku_preferences_dialog_construct (GType object_type)
{
	SudokuPreferencesDialog * self = NULL;
	Sudoku* _tmp0_;
	AdwSwitchRow* _tmp1_;
	Sudoku* _tmp2_;
	AdwSwitchRow* _tmp3_;
	Sudoku* _tmp4_;
	AdwSwitchRow* _tmp5_;
	Sudoku* _tmp6_;
	AdwSwitchRow* _tmp7_;
	Sudoku* _tmp8_;
	AdwSwitchRow* _tmp9_;
	Sudoku* _tmp10_;
	AdwSwitchRow* _tmp11_;
	Sudoku* _tmp12_;
	AdwSwitchRow* _tmp13_;
	Sudoku* _tmp14_;
	AdwSwitchRow* _tmp15_;
	Sudoku* _tmp16_;
	AdwSwitchRow* _tmp17_;
	Sudoku* _tmp18_;
	AdwSwitchRow* _tmp19_;
	self = (SudokuPreferencesDialog*) g_object_new (object_type, NULL);
	_tmp0_ = sudoku_app;
	_tmp1_ = self->show_timer;
	g_object_bind_property_with_closures ((GObject*) _tmp0_, "show-timer", (GObject*) _tmp1_, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp2_ = sudoku_app;
	_tmp3_ = self->autoclean_earmarks;
	g_object_bind_property_with_closures ((GObject*) _tmp2_, "autoclean-earmarks", (GObject*) _tmp3_, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp4_ = sudoku_app;
	_tmp5_ = self->number_picker_second_click;
	g_object_bind_property_with_closures ((GObject*) _tmp4_, "number_picker-second_click", (GObject*) _tmp5_, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp6_ = sudoku_app;
	_tmp7_ = self->show_possibilities;
	g_object_bind_property_with_closures ((GObject*) _tmp6_, "show-possibilities", (GObject*) _tmp7_, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp8_ = sudoku_app;
	_tmp9_ = self->duplicate_warnings;
	g_object_bind_property_with_closures ((GObject*) _tmp8_, "duplicate_warnings", (GObject*) _tmp9_, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp10_ = sudoku_app;
	_tmp11_ = self->solution_warnings;
	g_object_bind_property_with_closures ((GObject*) _tmp10_, "solution-warnings", (GObject*) _tmp11_, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp12_ = sudoku_app;
	_tmp13_ = self->earmark_warnings;
	g_object_bind_property_with_closures ((GObject*) _tmp12_, "earmark-warnings", (GObject*) _tmp13_, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp14_ = sudoku_app;
	_tmp15_ = self->highlight_row_column;
	g_object_bind_property_with_closures ((GObject*) _tmp14_, "highlight-row-column", (GObject*) _tmp15_, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp16_ = sudoku_app;
	_tmp17_ = self->highlight_block;
	g_object_bind_property_with_closures ((GObject*) _tmp16_, "highlight-block", (GObject*) _tmp17_, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp18_ = sudoku_app;
	_tmp19_ = self->highlight_numbers;
	g_object_bind_property_with_closures ((GObject*) _tmp18_, "highlight-numbers", (GObject*) _tmp19_, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	return self;
}

SudokuPreferencesDialog*
sudoku_preferences_dialog_new (void)
{
	return sudoku_preferences_dialog_construct (TYPE_SUDOKU_PREFERENCES_DIALOG);
}

static void
sudoku_preferences_dialog_real_dispose (GObject* base)
{
	SudokuPreferencesDialog * self;
	self = (SudokuPreferencesDialog*) base;
	gtk_widget_dispose_template ((GtkWidget*) self, G_TYPE_FROM_INSTANCE ((GObject*) self));
	G_OBJECT_CLASS (sudoku_preferences_dialog_parent_class)->dispose ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (self, adw_preferences_dialog_get_type (), AdwPreferencesDialog));
}

static void
sudoku_preferences_dialog_class_init (SudokuPreferencesDialogClass * klass,
                                      gpointer klass_data)
{
	sudoku_preferences_dialog_parent_class = g_type_class_peek_parent (klass);
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) sudoku_preferences_dialog_real_dispose;
	G_OBJECT_CLASS (klass)->finalize = sudoku_preferences_dialog_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Sudoku/ui/preferences-dialog.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "show_timer", FALSE, G_STRUCT_OFFSET (SudokuPreferencesDialog, show_timer));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "autoclean_earmarks", FALSE, G_STRUCT_OFFSET (SudokuPreferencesDialog, autoclean_earmarks));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "number_picker_second_click", FALSE, G_STRUCT_OFFSET (SudokuPreferencesDialog, number_picker_second_click));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "show_possibilities", FALSE, G_STRUCT_OFFSET (SudokuPreferencesDialog, show_possibilities));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "earmark_warnings", FALSE, G_STRUCT_OFFSET (SudokuPreferencesDialog, earmark_warnings));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "solution_warnings", FALSE, G_STRUCT_OFFSET (SudokuPreferencesDialog, solution_warnings));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "duplicate_warnings", FALSE, G_STRUCT_OFFSET (SudokuPreferencesDialog, duplicate_warnings));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "highlight_numbers", FALSE, G_STRUCT_OFFSET (SudokuPreferencesDialog, highlight_numbers));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "highlight_block", FALSE, G_STRUCT_OFFSET (SudokuPreferencesDialog, highlight_block));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "highlight_row_column", FALSE, G_STRUCT_OFFSET (SudokuPreferencesDialog, highlight_row_column));
}

static void
sudoku_preferences_dialog_instance_init (SudokuPreferencesDialog * self,
                                         gpointer klass)
{
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
sudoku_preferences_dialog_finalize (GObject * obj)
{
	SudokuPreferencesDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_SUDOKU_PREFERENCES_DIALOG, SudokuPreferencesDialog);
	G_OBJECT_CLASS (sudoku_preferences_dialog_parent_class)->finalize (obj);
}

static GType
sudoku_preferences_dialog_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SudokuPreferencesDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) sudoku_preferences_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SudokuPreferencesDialog), 0, (GInstanceInitFunc) sudoku_preferences_dialog_instance_init, NULL };
	GType sudoku_preferences_dialog_type_id;
	sudoku_preferences_dialog_type_id = g_type_register_static (adw_preferences_dialog_get_type (), "SudokuPreferencesDialog", &g_define_type_info, 0);
	return sudoku_preferences_dialog_type_id;
}

GType
sudoku_preferences_dialog_get_type (void)
{
	static volatile gsize sudoku_preferences_dialog_type_id__once = 0;
	if (g_once_init_enter (&sudoku_preferences_dialog_type_id__once)) {
		GType sudoku_preferences_dialog_type_id;
		sudoku_preferences_dialog_type_id = sudoku_preferences_dialog_get_type_once ();
		g_once_init_leave (&sudoku_preferences_dialog_type_id__once, sudoku_preferences_dialog_type_id);
	}
	return sudoku_preferences_dialog_type_id__once;
}

