/* BootOptionsWindow.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from BootOptionsWindow.vala, do not modify */

/*
 * BootOptionsWindow.vala
 *
 * Copyright 2012-2018 Tony George <teejeetech@gmail.com>
 *
 * This program 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 2 of the License, or
 * (at your option) any later version.
 *
 * This program 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 this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA 02110-1301, USA.
 *
 *
 */

#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include <gdk-pixbuf/gdk-pixbuf.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_BOOT_OPTIONS_WINDOW (boot_options_window_get_type ())
#define BOOT_OPTIONS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BOOT_OPTIONS_WINDOW, BootOptionsWindow))
#define BOOT_OPTIONS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BOOT_OPTIONS_WINDOW, BootOptionsWindowClass))
#define IS_BOOT_OPTIONS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BOOT_OPTIONS_WINDOW))
#define IS_BOOT_OPTIONS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BOOT_OPTIONS_WINDOW))
#define BOOT_OPTIONS_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BOOT_OPTIONS_WINDOW, BootOptionsWindowClass))

typedef struct _BootOptionsWindow BootOptionsWindow;
typedef struct _BootOptionsWindowClass BootOptionsWindowClass;
typedef struct _BootOptionsWindowPrivate BootOptionsWindowPrivate;

#define TYPE_BOOT_OPTIONS_BOX (boot_options_box_get_type ())
#define BOOT_OPTIONS_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BOOT_OPTIONS_BOX, BootOptionsBox))
#define BOOT_OPTIONS_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BOOT_OPTIONS_BOX, BootOptionsBoxClass))
#define IS_BOOT_OPTIONS_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BOOT_OPTIONS_BOX))
#define IS_BOOT_OPTIONS_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BOOT_OPTIONS_BOX))
#define BOOT_OPTIONS_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BOOT_OPTIONS_BOX, BootOptionsBoxClass))

typedef struct _BootOptionsBox BootOptionsBox;
typedef struct _BootOptionsBoxClass BootOptionsBoxClass;
enum  {
	BOOT_OPTIONS_WINDOW_0_PROPERTY,
	BOOT_OPTIONS_WINDOW_NUM_PROPERTIES
};
static GParamSpec* boot_options_window_properties[BOOT_OPTIONS_WINDOW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _BootOptionsWindow {
	GtkWindow parent_instance;
	BootOptionsWindowPrivate * priv;
};

struct _BootOptionsWindowClass {
	GtkWindowClass parent_class;
};

struct _BootOptionsWindowPrivate {
	GtkBox* vbox_main;
	BootOptionsBox* boot_options_box;
	guint tmr_init;
};

static gint BootOptionsWindow_private_offset;
static gpointer boot_options_window_parent_class = NULL;

VALA_EXTERN GType boot_options_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BootOptionsWindow, g_object_unref)
VALA_EXTERN GType boot_options_box_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BootOptionsBox, g_object_unref)
VALA_EXTERN BootOptionsWindow* boot_options_window_new (void);
VALA_EXTERN BootOptionsWindow* boot_options_window_construct (GType object_type);
VALA_EXTERN void tee_jee_logging_log_debug (const gchar* message);
VALA_EXTERN GdkPixbuf* icon_manager_lookup (const gchar* icon_name,
                                gint icon_size,
                                gboolean symbolic,
                                gboolean use_hardcoded,
                                gint scale);
static gboolean boot_options_window_on_delete_event (BootOptionsWindow* self,
                                              GdkEventAny* event);
static gboolean _boot_options_window_on_delete_event_gtk_widget_delete_event (GtkWidget* _sender,
                                                                       GdkEventAny* event,
                                                                       gpointer self);
VALA_EXTERN BootOptionsBox* boot_options_box_new (GtkWindow* _parent_window);
VALA_EXTERN BootOptionsBox* boot_options_box_construct (GType object_type,
                                            GtkWindow* _parent_window);
static void boot_options_window_create_actions (BootOptionsWindow* self);
static gboolean boot_options_window_init_delayed (BootOptionsWindow* self);
static gboolean _boot_options_window_init_delayed_gsource_func (gpointer self);
static void boot_options_window_save_changes (BootOptionsWindow* self);
VALA_EXTERN GtkButton* tee_jee_gtk_helper_add_button (GtkBox* box,
                                          const gchar* text,
                                          const gchar* tooltip,
                                          GtkSizeGroup* size_group,
                                          GtkImage* icon);
static void __lambda112_ (BootOptionsWindow* self);
static void ___lambda112__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void boot_options_window_finalize (GObject * obj);
static GType boot_options_window_get_type_once (void);

static inline gpointer
boot_options_window_get_instance_private (BootOptionsWindow* self)
{
	return G_STRUCT_MEMBER_P (self, BootOptionsWindow_private_offset);
}

static gboolean
_boot_options_window_on_delete_event_gtk_widget_delete_event (GtkWidget* _sender,
                                                              GdkEventAny* event,
                                                              gpointer self)
{
	gboolean result;
	result = boot_options_window_on_delete_event ((BootOptionsWindow*) self, event);
	return result;
}

static gboolean
_boot_options_window_init_delayed_gsource_func (gpointer self)
{
	gboolean result;
	result = boot_options_window_init_delayed ((BootOptionsWindow*) self);
	return result;
}

BootOptionsWindow*
boot_options_window_construct (GType object_type)
{
	BootOptionsWindow * self = NULL;
	GdkPixbuf* _tmp0_;
	GdkPixbuf* _tmp1_;
	GtkBox* _tmp2_;
	GtkBox* _tmp3_;
	GtkBox* _tmp4_;
	BootOptionsBox* _tmp5_;
	BootOptionsBox* _tmp6_;
	GtkBox* _tmp7_;
	BootOptionsBox* _tmp8_;
	self = (BootOptionsWindow*) g_object_new (object_type, NULL);
	tee_jee_logging_log_debug ("BootOptionsWindow: BootOptionsWindow()");
	gtk_window_set_title ((GtkWindow*) self, _ ("Bootloader Options"));
	g_object_set ((GtkWindow*) self, "window-position", GTK_WIN_POS_CENTER, NULL);
	gtk_window_set_modal ((GtkWindow*) self, TRUE);
	_tmp0_ = icon_manager_lookup ("timeshift", 16, FALSE, FALSE, 1);
	_tmp1_ = _tmp0_;
	gtk_window_set_icon ((GtkWindow*) self, _tmp1_);
	_g_object_unref0 (_tmp1_);
	g_signal_connect_object ((GtkWidget*) self, "delete-event", (GCallback) _boot_options_window_on_delete_event_gtk_widget_delete_event, self, 0);
	_tmp2_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->vbox_main);
	self->priv->vbox_main = _tmp2_;
	_tmp3_ = self->priv->vbox_main;
	g_object_set ((GtkWidget*) _tmp3_, "margin", 12, NULL);
	_tmp4_ = self->priv->vbox_main;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp4_);
	_tmp5_ = boot_options_box_new ((GtkWindow*) self);
	g_object_ref_sink (_tmp5_);
	_g_object_unref0 (self->priv->boot_options_box);
	self->priv->boot_options_box = _tmp5_;
	_tmp6_ = self->priv->boot_options_box;
	g_object_set ((GtkWidget*) _tmp6_, "margin", 0, NULL);
	_tmp7_ = self->priv->vbox_main;
	_tmp8_ = self->priv->boot_options_box;
	gtk_container_add ((GtkContainer*) _tmp7_, (GtkWidget*) _tmp8_);
	boot_options_window_create_actions (self);
	gtk_widget_show_all ((GtkWidget*) self);
	self->priv->tmr_init = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 100, _boot_options_window_init_delayed_gsource_func, g_object_ref (self), g_object_unref);
	tee_jee_logging_log_debug ("BootOptionsWindow: BootOptionsWindow(): exit");
	return self;
}

BootOptionsWindow*
boot_options_window_new (void)
{
	return boot_options_window_construct (TYPE_BOOT_OPTIONS_WINDOW);
}

static gboolean
boot_options_window_init_delayed (BootOptionsWindow* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	if (self->priv->tmr_init > ((guint) 0)) {
		g_source_remove (self->priv->tmr_init);
		self->priv->tmr_init = (guint) 0;
	}
	result = FALSE;
	return result;
}

static gboolean
boot_options_window_on_delete_event (BootOptionsWindow* self,
                                     GdkEventAny* event)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	result = FALSE;
	return result;
}

static void
boot_options_window_save_changes (BootOptionsWindow* self)
{
	g_return_if_fail (self != NULL);
}

static void
__lambda112_ (BootOptionsWindow* self)
{
	boot_options_window_save_changes (self);
	gtk_widget_destroy ((GtkWidget*) self);
}

static void
___lambda112__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda112_ ((BootOptionsWindow*) self);
}

static void
boot_options_window_create_actions (BootOptionsWindow* self)
{
	GtkButtonBox* hbox = NULL;
	GtkButtonBox* _tmp0_;
	GtkBox* _tmp1_;
	GtkSizeGroup* size_group = NULL;
	GtkSizeGroup* _tmp2_;
	GtkButton* btn_close = NULL;
	GtkButton* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = (GtkButtonBox*) gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
	g_object_ref_sink (_tmp0_);
	hbox = _tmp0_;
	g_object_set ((GtkWidget*) hbox, "margin", 0, NULL);
	gtk_widget_set_margin_top ((GtkWidget*) hbox, 24);
	_tmp1_ = self->priv->vbox_main;
	gtk_container_add ((GtkContainer*) _tmp1_, (GtkWidget*) hbox);
	_tmp2_ = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
	size_group = _tmp2_;
	_tmp3_ = tee_jee_gtk_helper_add_button ((GtkBox*) hbox, _ ("Close"), "", size_group, NULL);
	btn_close = _tmp3_;
	g_signal_connect_object (btn_close, "clicked", (GCallback) ___lambda112__gtk_button_clicked, self, 0);
	_g_object_unref0 (btn_close);
	_g_object_unref0 (size_group);
	_g_object_unref0 (hbox);
}

static void
boot_options_window_class_init (BootOptionsWindowClass * klass,
                                gpointer klass_data)
{
	boot_options_window_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BootOptionsWindow_private_offset);
	G_OBJECT_CLASS (klass)->finalize = boot_options_window_finalize;
}

static void
boot_options_window_instance_init (BootOptionsWindow * self,
                                   gpointer klass)
{
	self->priv = boot_options_window_get_instance_private (self);
}

static void
boot_options_window_finalize (GObject * obj)
{
	BootOptionsWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_BOOT_OPTIONS_WINDOW, BootOptionsWindow);
	_g_object_unref0 (self->priv->vbox_main);
	_g_object_unref0 (self->priv->boot_options_box);
	G_OBJECT_CLASS (boot_options_window_parent_class)->finalize (obj);
}

static GType
boot_options_window_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BootOptionsWindowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boot_options_window_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BootOptionsWindow), 0, (GInstanceInitFunc) boot_options_window_instance_init, NULL };
	GType boot_options_window_type_id;
	boot_options_window_type_id = g_type_register_static (gtk_window_get_type (), "BootOptionsWindow", &g_define_type_info, 0);
	BootOptionsWindow_private_offset = g_type_add_instance_private (boot_options_window_type_id, sizeof (BootOptionsWindowPrivate));
	return boot_options_window_type_id;
}

GType
boot_options_window_get_type (void)
{
	static volatile gsize boot_options_window_type_id__once = 0;
	if (g_once_init_enter (&boot_options_window_type_id__once)) {
		GType boot_options_window_type_id;
		boot_options_window_type_id = boot_options_window_get_type_once ();
		g_once_init_leave (&boot_options_window_type_id__once, boot_options_window_type_id);
	}
	return boot_options_window_type_id__once;
}

