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

/*
* Copyright 2011-2019 elementary, Inc. (https://elementary.io)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 3 as published by the Free Software Foundation.
*
* 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 Lesser 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 <granite.h>
#include <glib-object.h>
#include <handy.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <gio/gio.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 SCRATCH_DIALOGS_TYPE_RESTORE_CONFIRMATION_DIALOG (scratch_dialogs_restore_confirmation_dialog_get_type ())
#define SCRATCH_DIALOGS_RESTORE_CONFIRMATION_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SCRATCH_DIALOGS_TYPE_RESTORE_CONFIRMATION_DIALOG, ScratchDialogsRestoreConfirmationDialog))
#define SCRATCH_DIALOGS_RESTORE_CONFIRMATION_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SCRATCH_DIALOGS_TYPE_RESTORE_CONFIRMATION_DIALOG, ScratchDialogsRestoreConfirmationDialogClass))
#define SCRATCH_DIALOGS_IS_RESTORE_CONFIRMATION_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SCRATCH_DIALOGS_TYPE_RESTORE_CONFIRMATION_DIALOG))
#define SCRATCH_DIALOGS_IS_RESTORE_CONFIRMATION_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SCRATCH_DIALOGS_TYPE_RESTORE_CONFIRMATION_DIALOG))
#define SCRATCH_DIALOGS_RESTORE_CONFIRMATION_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SCRATCH_DIALOGS_TYPE_RESTORE_CONFIRMATION_DIALOG, ScratchDialogsRestoreConfirmationDialogClass))

typedef struct _ScratchDialogsRestoreConfirmationDialog ScratchDialogsRestoreConfirmationDialog;
typedef struct _ScratchDialogsRestoreConfirmationDialogClass ScratchDialogsRestoreConfirmationDialogClass;
typedef struct _ScratchDialogsRestoreConfirmationDialogPrivate ScratchDialogsRestoreConfirmationDialogPrivate;
enum  {
	SCRATCH_DIALOGS_RESTORE_CONFIRMATION_DIALOG_0_PROPERTY,
	SCRATCH_DIALOGS_RESTORE_CONFIRMATION_DIALOG_NUM_PROPERTIES
};
static GParamSpec* scratch_dialogs_restore_confirmation_dialog_properties[SCRATCH_DIALOGS_RESTORE_CONFIRMATION_DIALOG_NUM_PROPERTIES];

#define SCRATCH_TYPE_MAIN_WINDOW (scratch_main_window_get_type ())
#define SCRATCH_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SCRATCH_TYPE_MAIN_WINDOW, ScratchMainWindow))
#define SCRATCH_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SCRATCH_TYPE_MAIN_WINDOW, ScratchMainWindowClass))
#define SCRATCH_IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SCRATCH_TYPE_MAIN_WINDOW))
#define SCRATCH_IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SCRATCH_TYPE_MAIN_WINDOW))
#define SCRATCH_MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SCRATCH_TYPE_MAIN_WINDOW, ScratchMainWindowClass))

typedef struct _ScratchMainWindow ScratchMainWindow;
typedef struct _ScratchMainWindowClass ScratchMainWindowClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _ScratchDialogsRestoreConfirmationDialog {
	GraniteMessageDialog parent_instance;
	ScratchDialogsRestoreConfirmationDialogPrivate * priv;
};

struct _ScratchDialogsRestoreConfirmationDialogClass {
	GraniteMessageDialogClass parent_class;
};

static gpointer scratch_dialogs_restore_confirmation_dialog_parent_class = NULL;

VALA_EXTERN GType scratch_dialogs_restore_confirmation_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ScratchDialogsRestoreConfirmationDialog, g_object_unref)
VALA_EXTERN GType scratch_main_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ScratchMainWindow, g_object_unref)
VALA_EXTERN ScratchDialogsRestoreConfirmationDialog* scratch_dialogs_restore_confirmation_dialog_new (ScratchMainWindow* parent);
VALA_EXTERN ScratchDialogsRestoreConfirmationDialog* scratch_dialogs_restore_confirmation_dialog_construct (GType object_type,
                                                                                                ScratchMainWindow* parent);
static GObject * scratch_dialogs_restore_confirmation_dialog_constructor (GType type,
                                                                   guint n_construct_properties,
                                                                   GObjectConstructParam * construct_properties);
static GType scratch_dialogs_restore_confirmation_dialog_get_type_once (void);

ScratchDialogsRestoreConfirmationDialog*
scratch_dialogs_restore_confirmation_dialog_construct (GType object_type,
                                                       ScratchMainWindow* parent)
{
	ScratchDialogsRestoreConfirmationDialog * self = NULL;
	g_return_val_if_fail (parent != NULL, NULL);
	self = (ScratchDialogsRestoreConfirmationDialog*) g_object_new (object_type, "buttons", GTK_BUTTONS_NONE, "transient-for", parent, NULL);
	return self;
}

ScratchDialogsRestoreConfirmationDialog*
scratch_dialogs_restore_confirmation_dialog_new (ScratchMainWindow* parent)
{
	return scratch_dialogs_restore_confirmation_dialog_construct (SCRATCH_DIALOGS_TYPE_RESTORE_CONFIRMATION_DIALOG, parent);
}

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

static GObject *
scratch_dialogs_restore_confirmation_dialog_constructor (GType type,
                                                         guint n_construct_properties,
                                                         GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ScratchDialogsRestoreConfirmationDialog * self;
	GThemedIcon* _tmp0_;
	GThemedIcon* _tmp1_;
	GtkButton* ignore_button = NULL;
	GtkWidget* _tmp2_;
	GtkButton* _tmp3_;
	GtkButton* _tmp4_;
	GtkStyleContext* _tmp5_;
	parent_class = G_OBJECT_CLASS (scratch_dialogs_restore_confirmation_dialog_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SCRATCH_DIALOGS_TYPE_RESTORE_CONFIRMATION_DIALOG, ScratchDialogsRestoreConfirmationDialog);
	_tmp0_ = (GThemedIcon*) g_themed_icon_new ("dialog-warning");
	_tmp1_ = _tmp0_;
	granite_message_dialog_set_image_icon ((GraniteMessageDialog*) self, (GIcon*) _tmp1_);
	_g_object_unref0 (_tmp1_);
	granite_message_dialog_set_primary_text ((GraniteMessageDialog*) self, _ ("Are You Sure You Want to Restore This File?"));
	granite_message_dialog_set_secondary_text ((GraniteMessageDialog*) self, _ ("Restoring a file will undo all changes made since opening it"));
	gtk_dialog_add_button ((GtkDialog*) self, _ ("Don't Restore"), (gint) GTK_RESPONSE_REJECT);
	_tmp2_ = gtk_dialog_add_button ((GtkDialog*) self, _ ("Restore Anyway"), (gint) GTK_RESPONSE_ACCEPT);
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_button_get_type (), GtkButton));
	ignore_button = _tmp3_;
	_tmp4_ = ignore_button;
	_tmp5_ = gtk_widget_get_style_context ((GtkWidget*) _tmp4_);
	gtk_style_context_add_class (_tmp5_, GTK_STYLE_CLASS_DESTRUCTIVE_ACTION);
	_g_object_unref0 (ignore_button);
	return obj;
}

static void
scratch_dialogs_restore_confirmation_dialog_class_init (ScratchDialogsRestoreConfirmationDialogClass * klass,
                                                        gpointer klass_data)
{
	scratch_dialogs_restore_confirmation_dialog_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->constructor = scratch_dialogs_restore_confirmation_dialog_constructor;
}

static void
scratch_dialogs_restore_confirmation_dialog_instance_init (ScratchDialogsRestoreConfirmationDialog * self,
                                                           gpointer klass)
{
}

 G_GNUC_NO_INLINE static GType
scratch_dialogs_restore_confirmation_dialog_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ScratchDialogsRestoreConfirmationDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) scratch_dialogs_restore_confirmation_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ScratchDialogsRestoreConfirmationDialog), 0, (GInstanceInitFunc) scratch_dialogs_restore_confirmation_dialog_instance_init, NULL };
	GType scratch_dialogs_restore_confirmation_dialog_type_id;
	scratch_dialogs_restore_confirmation_dialog_type_id = g_type_register_static (GRANITE_TYPE_MESSAGE_DIALOG, "ScratchDialogsRestoreConfirmationDialog", &g_define_type_info, G_TYPE_FLAG_NONE);
	return scratch_dialogs_restore_confirmation_dialog_type_id;
}

GType
scratch_dialogs_restore_confirmation_dialog_get_type (void)
{
	static gsize scratch_dialogs_restore_confirmation_dialog_type_id__once = 0;
	if (g_once_init_enter (&scratch_dialogs_restore_confirmation_dialog_type_id__once)) {
		GType scratch_dialogs_restore_confirmation_dialog_type_id;
		scratch_dialogs_restore_confirmation_dialog_type_id = scratch_dialogs_restore_confirmation_dialog_get_type_once ();
		g_once_init_leave (&scratch_dialogs_restore_confirmation_dialog_type_id__once, scratch_dialogs_restore_confirmation_dialog_type_id);
	}
	return scratch_dialogs_restore_confirmation_dialog_type_id__once;
}

