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

/*
 * RestoreSummaryBox.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>

#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_RESTORE_SUMMARY_BOX (restore_summary_box_get_type ())
#define RESTORE_SUMMARY_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_RESTORE_SUMMARY_BOX, RestoreSummaryBox))
#define RESTORE_SUMMARY_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_RESTORE_SUMMARY_BOX, RestoreSummaryBoxClass))
#define IS_RESTORE_SUMMARY_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_RESTORE_SUMMARY_BOX))
#define IS_RESTORE_SUMMARY_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_RESTORE_SUMMARY_BOX))
#define RESTORE_SUMMARY_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_RESTORE_SUMMARY_BOX, RestoreSummaryBoxClass))

typedef struct _RestoreSummaryBox RestoreSummaryBox;
typedef struct _RestoreSummaryBoxClass RestoreSummaryBoxClass;
typedef struct _RestoreSummaryBoxPrivate RestoreSummaryBoxPrivate;
enum  {
	RESTORE_SUMMARY_BOX_0_PROPERTY,
	RESTORE_SUMMARY_BOX_NUM_PROPERTIES
};
static GParamSpec* restore_summary_box_properties[RESTORE_SUMMARY_BOX_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define TYPE_MAIN (main_get_type ())
#define MAIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAIN, Main))
#define MAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAIN, MainClass))
#define IS_MAIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAIN))
#define IS_MAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAIN))
#define MAIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAIN, MainClass))

typedef struct _Main Main;
typedef struct _MainClass MainClass;
#define _g_free0(var) (var = (g_free (var), NULL))

struct _RestoreSummaryBox {
	GtkBox parent_instance;
	RestoreSummaryBoxPrivate * priv;
	GtkLabel* lbl_devices;
	GtkLabel* lbl_reboot;
	GtkLabel* lbl_disclaimer;
};

struct _RestoreSummaryBoxClass {
	GtkBoxClass parent_class;
};

struct _RestoreSummaryBoxPrivate {
	GtkWindow* parent_window;
};

static gint RestoreSummaryBox_private_offset;
static gpointer restore_summary_box_parent_class = NULL;
VALA_EXTERN Main* App;

VALA_EXTERN GType restore_summary_box_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (RestoreSummaryBox, g_object_unref)
VALA_EXTERN RestoreSummaryBox* restore_summary_box_new (GtkWindow* _parent_window);
VALA_EXTERN RestoreSummaryBox* restore_summary_box_construct (GType object_type,
                                                  GtkWindow* _parent_window);
VALA_EXTERN void tee_jee_logging_log_debug (const gchar* message);
VALA_EXTERN GtkLabel* tee_jee_gtk_helper_add_label_header (GtkBox* box,
                                               const gchar* text,
                                               gboolean large_heading);
VALA_EXTERN GtkLabel* tee_jee_gtk_helper_add_label (GtkBox* box,
                                        const gchar* text,
                                        gboolean bold,
                                        gboolean italic,
                                        gboolean large);
VALA_EXTERN void restore_summary_box_refresh (RestoreSummaryBox* self);
VALA_EXTERN GType main_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Main, g_object_unref)
VALA_EXTERN void main_get_restore_messages (Main* self,
                                gboolean formatted,
                                gchar** msg_devices,
                                gchar** msg_reboot,
                                gchar** msg_disclaimer);
static void restore_summary_box_finalize (GObject * obj);
static GType restore_summary_box_get_type_once (void);

static inline gpointer
restore_summary_box_get_instance_private (RestoreSummaryBox* self)
{
	return G_STRUCT_MEMBER_P (self, RestoreSummaryBox_private_offset);
}

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

RestoreSummaryBox*
restore_summary_box_construct (GType object_type,
                               GtkWindow* _parent_window)
{
	RestoreSummaryBox * self = NULL;
	GtkWindow* _tmp0_;
	GtkLabel* _tmp1_;
	GtkLabel* _tmp2_;
	GtkLabel* _tmp3_;
	GtkLabel* _tmp4_;
	GtkLabel* _tmp5_;
	GtkLabel* _tmp6_;
	GtkLabel* _tmp7_;
	GtkLabel* _tmp8_;
	g_return_val_if_fail (_parent_window != NULL, NULL);
	tee_jee_logging_log_debug ("RestoreSummaryBox: RestoreSummaryBox()");
	self = (RestoreSummaryBox*) g_object_new (object_type, "orientation", GTK_ORIENTATION_VERTICAL, "spacing", 6, NULL);
	_tmp0_ = _g_object_ref0 (_parent_window);
	_g_object_unref0 (self->priv->parent_window);
	self->priv->parent_window = _tmp0_;
	g_object_set ((GtkWidget*) self, "margin", 12, NULL);
	_tmp1_ = tee_jee_gtk_helper_add_label_header ((GtkBox*) self, _ ("Warning"), TRUE);
	_tmp2_ = _tmp1_;
	_g_object_unref0 (_tmp2_);
	_tmp3_ = tee_jee_gtk_helper_add_label ((GtkBox*) self, "", FALSE, FALSE, FALSE);
	_g_object_unref0 (self->lbl_devices);
	self->lbl_devices = _tmp3_;
	_tmp4_ = tee_jee_gtk_helper_add_label ((GtkBox*) self, "", TRUE, FALSE, FALSE);
	_g_object_unref0 (self->lbl_reboot);
	self->lbl_reboot = _tmp4_;
	_tmp5_ = self->lbl_reboot;
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp5_, 6);
	_tmp6_ = tee_jee_gtk_helper_add_label_header ((GtkBox*) self, _ ("Disclaimer"), TRUE);
	_tmp7_ = _tmp6_;
	_g_object_unref0 (_tmp7_);
	_tmp8_ = tee_jee_gtk_helper_add_label ((GtkBox*) self, "", FALSE, FALSE, FALSE);
	_g_object_unref0 (self->lbl_disclaimer);
	self->lbl_disclaimer = _tmp8_;
	tee_jee_logging_log_debug ("RestoreSummaryBox: RestoreSummaryBox(): exit");
	return self;
}

RestoreSummaryBox*
restore_summary_box_new (GtkWindow* _parent_window)
{
	return restore_summary_box_construct (TYPE_RESTORE_SUMMARY_BOX, _parent_window);
}

void
restore_summary_box_refresh (RestoreSummaryBox* self)
{
	gchar* msg_devices = NULL;
	gchar* _tmp0_;
	gchar* msg_reboot = NULL;
	gchar* _tmp1_;
	gchar* msg_disclaimer = NULL;
	gchar* _tmp2_;
	Main* _tmp3_;
	gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	GtkLabel* _tmp7_;
	const gchar* _tmp8_;
	GtkLabel* _tmp9_;
	const gchar* _tmp10_;
	GtkLabel* _tmp11_;
	const gchar* _tmp12_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup ("");
	msg_devices = _tmp0_;
	_tmp1_ = g_strdup ("");
	msg_reboot = _tmp1_;
	_tmp2_ = g_strdup ("");
	msg_disclaimer = _tmp2_;
	_tmp3_ = App;
	main_get_restore_messages (_tmp3_, TRUE, &_tmp4_, &_tmp5_, &_tmp6_);
	_g_free0 (msg_devices);
	msg_devices = _tmp4_;
	_g_free0 (msg_reboot);
	msg_reboot = _tmp5_;
	_g_free0 (msg_disclaimer);
	msg_disclaimer = _tmp6_;
	_tmp7_ = self->lbl_devices;
	_tmp8_ = msg_devices;
	gtk_label_set_label (_tmp7_, _tmp8_);
	_tmp9_ = self->lbl_reboot;
	_tmp10_ = msg_reboot;
	gtk_label_set_label (_tmp9_, _tmp10_);
	_tmp11_ = self->lbl_disclaimer;
	_tmp12_ = msg_disclaimer;
	gtk_label_set_label (_tmp11_, _tmp12_);
	_g_free0 (msg_disclaimer);
	_g_free0 (msg_reboot);
	_g_free0 (msg_devices);
}

static void
restore_summary_box_class_init (RestoreSummaryBoxClass * klass,
                                gpointer klass_data)
{
	restore_summary_box_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &RestoreSummaryBox_private_offset);
	G_OBJECT_CLASS (klass)->finalize = restore_summary_box_finalize;
}

static void
restore_summary_box_instance_init (RestoreSummaryBox * self,
                                   gpointer klass)
{
	self->priv = restore_summary_box_get_instance_private (self);
}

static void
restore_summary_box_finalize (GObject * obj)
{
	RestoreSummaryBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_RESTORE_SUMMARY_BOX, RestoreSummaryBox);
	_g_object_unref0 (self->lbl_devices);
	_g_object_unref0 (self->lbl_reboot);
	_g_object_unref0 (self->lbl_disclaimer);
	_g_object_unref0 (self->priv->parent_window);
	G_OBJECT_CLASS (restore_summary_box_parent_class)->finalize (obj);
}

static GType
restore_summary_box_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (RestoreSummaryBoxClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) restore_summary_box_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RestoreSummaryBox), 0, (GInstanceInitFunc) restore_summary_box_instance_init, NULL };
	GType restore_summary_box_type_id;
	restore_summary_box_type_id = g_type_register_static (gtk_box_get_type (), "RestoreSummaryBox", &g_define_type_info, 0);
	RestoreSummaryBox_private_offset = g_type_add_instance_private (restore_summary_box_type_id, sizeof (RestoreSummaryBoxPrivate));
	return restore_summary_box_type_id;
}

GType
restore_summary_box_get_type (void)
{
	static volatile gsize restore_summary_box_type_id__once = 0;
	if (g_once_init_enter (&restore_summary_box_type_id__once)) {
		GType restore_summary_box_type_id;
		restore_summary_box_type_id = restore_summary_box_get_type_once ();
		g_once_init_leave (&restore_summary_box_type_id__once, restore_summary_box_type_id);
	}
	return restore_summary_box_type_id__once;
}

