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

/* -*- Mode: Vala; indent-tabs-mode: nil; tab-width: 2 -*-
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 * SPDX-FileCopyrightText: Michael Terry
 */

#include <adwaita.h>
#include <glib-object.h>
#include <glib.h>
#include <gtk/gtk.h>
#include "deja.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_BASIC_NAVIGATION_PAGE (basic_navigation_page_get_type ())
#define BASIC_NAVIGATION_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BASIC_NAVIGATION_PAGE, BasicNavigationPage))
#define BASIC_NAVIGATION_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BASIC_NAVIGATION_PAGE, BasicNavigationPageClass))
#define IS_BASIC_NAVIGATION_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BASIC_NAVIGATION_PAGE))
#define IS_BASIC_NAVIGATION_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BASIC_NAVIGATION_PAGE))
#define BASIC_NAVIGATION_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BASIC_NAVIGATION_PAGE, BasicNavigationPageClass))

typedef struct _BasicNavigationPage BasicNavigationPage;
typedef struct _BasicNavigationPageClass BasicNavigationPageClass;
typedef struct _BasicNavigationPagePrivate BasicNavigationPagePrivate;

#define TYPE_WELCOME_PAGE (welcome_page_get_type ())
#define WELCOME_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_WELCOME_PAGE, WelcomePage))
#define WELCOME_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_WELCOME_PAGE, WelcomePageClass))
#define IS_WELCOME_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_WELCOME_PAGE))
#define IS_WELCOME_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_WELCOME_PAGE))
#define WELCOME_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_WELCOME_PAGE, WelcomePageClass))

typedef struct _WelcomePage WelcomePage;
typedef struct _WelcomePageClass WelcomePageClass;
typedef struct _WelcomePagePrivate WelcomePagePrivate;
enum  {
	WELCOME_PAGE_0_PROPERTY,
	WELCOME_PAGE_NUM_PROPERTIES
};
static GParamSpec* welcome_page_properties[WELCOME_PAGE_NUM_PROPERTIES];

#define TYPE_ACTION_DIALOG (action_dialog_get_type ())
#define ACTION_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ACTION_DIALOG, ActionDialog))
#define ACTION_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ACTION_DIALOG, ActionDialogClass))
#define IS_ACTION_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ACTION_DIALOG))
#define IS_ACTION_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ACTION_DIALOG))
#define ACTION_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ACTION_DIALOG, ActionDialogClass))

typedef struct _ActionDialog ActionDialog;
typedef struct _ActionDialogClass ActionDialogClass;

#define TYPE_FIRST_BACKUP_DIALOG (first_backup_dialog_get_type ())
#define FIRST_BACKUP_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FIRST_BACKUP_DIALOG, FirstBackupDialog))
#define FIRST_BACKUP_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FIRST_BACKUP_DIALOG, FirstBackupDialogClass))
#define IS_FIRST_BACKUP_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FIRST_BACKUP_DIALOG))
#define IS_FIRST_BACKUP_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FIRST_BACKUP_DIALOG))
#define FIRST_BACKUP_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FIRST_BACKUP_DIALOG, FirstBackupDialogClass))

typedef struct _FirstBackupDialog FirstBackupDialog;
typedef struct _FirstBackupDialogClass FirstBackupDialogClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define TYPE_RESTORE_LOCATION_DIALOG (restore_location_dialog_get_type ())
#define RESTORE_LOCATION_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_RESTORE_LOCATION_DIALOG, RestoreLocationDialog))
#define RESTORE_LOCATION_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_RESTORE_LOCATION_DIALOG, RestoreLocationDialogClass))
#define IS_RESTORE_LOCATION_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_RESTORE_LOCATION_DIALOG))
#define IS_RESTORE_LOCATION_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_RESTORE_LOCATION_DIALOG))
#define RESTORE_LOCATION_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_RESTORE_LOCATION_DIALOG, RestoreLocationDialogClass))

typedef struct _RestoreLocationDialog RestoreLocationDialog;
typedef struct _RestoreLocationDialogClass RestoreLocationDialogClass;
enum  {
	WELCOME_PAGE_BACK_UP_SIGNAL,
	WELCOME_PAGE_BROWSE_SIGNAL,
	WELCOME_PAGE_NUM_SIGNALS
};
static guint welcome_page_signals[WELCOME_PAGE_NUM_SIGNALS] = {0};

struct _BasicNavigationPage {
	AdwNavigationPage parent_instance;
	BasicNavigationPagePrivate * priv;
};

struct _BasicNavigationPageClass {
	AdwNavigationPageClass parent_class;
};

struct _WelcomePage {
	BasicNavigationPage parent_instance;
	WelcomePagePrivate * priv;
};

struct _WelcomePageClass {
	BasicNavigationPageClass parent_class;
};

struct _WelcomePagePrivate {
	AdwStatusPage* status_page;
};

static gint WelcomePage_private_offset;
static gpointer welcome_page_parent_class = NULL;

VALA_EXTERN GType basic_navigation_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BasicNavigationPage, g_object_unref)
VALA_EXTERN GType welcome_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WelcomePage, g_object_unref)
static void welcome_page_on_initial_backup (WelcomePage* self);
VALA_EXTERN GType action_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ActionDialog, g_object_unref)
VALA_EXTERN GType first_backup_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FirstBackupDialog, g_object_unref)
VALA_EXTERN FirstBackupDialog* first_backup_dialog_new (void);
VALA_EXTERN FirstBackupDialog* first_backup_dialog_construct (GType object_type);
static void __lambda30_ (WelcomePage* self);
static void ___lambda30__first_backup_dialog_back_up (FirstBackupDialog* _sender,
                                               gpointer self);
static void _welcome_page_on_initial_backup_gtk_button_clicked (GtkButton* _sender,
                                                         gpointer self);
static void welcome_page_on_initial_restore (WelcomePage* self);
VALA_EXTERN GType restore_location_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (RestoreLocationDialog, g_object_unref)
VALA_EXTERN RestoreLocationDialog* restore_location_dialog_new (void);
VALA_EXTERN RestoreLocationDialog* restore_location_dialog_construct (GType object_type);
static void __lambda31_ (WelcomePage* self,
                  DejaDupBackend* backend);
static void ___lambda31__restore_location_dialog_browse (RestoreLocationDialog* _sender,
                                                  DejaDupBackend* backend,
                                                  gpointer self);
static void _welcome_page_on_initial_restore_gtk_button_clicked (GtkButton* _sender,
                                                          gpointer self);
VALA_EXTERN WelcomePage* welcome_page_new (void);
VALA_EXTERN WelcomePage* welcome_page_construct (GType object_type);
VALA_EXTERN BasicNavigationPage* basic_navigation_page_new (void);
VALA_EXTERN BasicNavigationPage* basic_navigation_page_construct (GType object_type);
static GObject * welcome_page_constructor (GType type,
                                    guint n_construct_properties,
                                    GObjectConstructParam * construct_properties);
static void welcome_page_finalize (GObject * obj);
static GType welcome_page_get_type_once (void);

static inline gpointer
welcome_page_get_instance_private (WelcomePage* self)
{
	return G_STRUCT_MEMBER_P (self, WelcomePage_private_offset);
}

static void
__lambda30_ (WelcomePage* self)
{
	g_signal_emit (self, welcome_page_signals[WELCOME_PAGE_BACK_UP_SIGNAL], 0);
}

static void
___lambda30__first_backup_dialog_back_up (FirstBackupDialog* _sender,
                                          gpointer self)
{
	__lambda30_ ((WelcomePage*) self);
}

static void
welcome_page_on_initial_backup (WelcomePage* self)
{
	FirstBackupDialog* dlg = NULL;
	FirstBackupDialog* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = first_backup_dialog_new ();
	g_object_ref_sink (_tmp0_);
	dlg = _tmp0_;
	g_signal_connect_object (dlg, "back-up", (GCallback) ___lambda30__first_backup_dialog_back_up, self, 0);
	adw_dialog_present ((AdwDialog*) dlg, (GtkWidget*) self);
	_g_object_unref0 (dlg);
}

static void
_welcome_page_on_initial_backup_gtk_button_clicked (GtkButton* _sender,
                                                    gpointer self)
{
	welcome_page_on_initial_backup ((WelcomePage*) self);
}

static void
__lambda31_ (WelcomePage* self,
             DejaDupBackend* backend)
{
	g_return_if_fail (backend != NULL);
	g_signal_emit (self, welcome_page_signals[WELCOME_PAGE_BROWSE_SIGNAL], 0, backend);
}

static void
___lambda31__restore_location_dialog_browse (RestoreLocationDialog* _sender,
                                             DejaDupBackend* backend,
                                             gpointer self)
{
	__lambda31_ ((WelcomePage*) self, backend);
}

static void
welcome_page_on_initial_restore (WelcomePage* self)
{
	RestoreLocationDialog* dlg = NULL;
	RestoreLocationDialog* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = restore_location_dialog_new ();
	g_object_ref_sink (_tmp0_);
	dlg = _tmp0_;
	g_signal_connect_object (dlg, "browse", (GCallback) ___lambda31__restore_location_dialog_browse, self, 0);
	adw_dialog_present ((AdwDialog*) dlg, (GtkWidget*) self);
	_g_object_unref0 (dlg);
}

static void
_welcome_page_on_initial_restore_gtk_button_clicked (GtkButton* _sender,
                                                     gpointer self)
{
	welcome_page_on_initial_restore ((WelcomePage*) self);
}

WelcomePage*
welcome_page_construct (GType object_type)
{
	WelcomePage * self = NULL;
	self = (WelcomePage*) basic_navigation_page_construct (object_type);
	return self;
}

WelcomePage*
welcome_page_new (void)
{
	return welcome_page_construct (TYPE_WELCOME_PAGE);
}

static GObject *
welcome_page_constructor (GType type,
                          guint n_construct_properties,
                          GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	WelcomePage * self;
	AdwStatusPage* _tmp0_;
	parent_class = G_OBJECT_CLASS (welcome_page_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_WELCOME_PAGE, WelcomePage);
	_tmp0_ = self->priv->status_page;
	adw_status_page_set_icon_name (_tmp0_, ICON_NAME);
	return obj;
}

static void
welcome_page_class_init (WelcomePageClass * klass,
                         gpointer klass_data)
{
	welcome_page_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &WelcomePage_private_offset);
	G_OBJECT_CLASS (klass)->constructor = welcome_page_constructor;
	G_OBJECT_CLASS (klass)->finalize = welcome_page_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/DejaDup/WelcomePage.ui");
	welcome_page_signals[WELCOME_PAGE_BACK_UP_SIGNAL] = g_signal_new ("back-up", TYPE_WELCOME_PAGE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	welcome_page_signals[WELCOME_PAGE_BROWSE_SIGNAL] = g_signal_new ("browse", TYPE_WELCOME_PAGE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, DEJA_DUP_TYPE_BACKEND);
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "status_page", FALSE, WelcomePage_private_offset + G_STRUCT_OFFSET (WelcomePagePrivate, status_page));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_initial_backup", G_CALLBACK(_welcome_page_on_initial_backup_gtk_button_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_initial_restore", G_CALLBACK(_welcome_page_on_initial_restore_gtk_button_clicked));
}

static void
welcome_page_instance_init (WelcomePage * self,
                            gpointer klass)
{
	self->priv = welcome_page_get_instance_private (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
welcome_page_finalize (GObject * obj)
{
	WelcomePage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_WELCOME_PAGE, WelcomePage);
	G_OBJECT_CLASS (welcome_page_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
welcome_page_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (WelcomePageClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) welcome_page_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WelcomePage), 0, (GInstanceInitFunc) welcome_page_instance_init, NULL };
	GType welcome_page_type_id;
	welcome_page_type_id = g_type_register_static (TYPE_BASIC_NAVIGATION_PAGE, "WelcomePage", &g_define_type_info, 0);
	WelcomePage_private_offset = g_type_add_instance_private (welcome_page_type_id, sizeof (WelcomePagePrivate));
	return welcome_page_type_id;
}

GType
welcome_page_get_type (void)
{
	static gsize welcome_page_type_id__once = 0;
	if (g_once_init_enter (&welcome_page_type_id__once)) {
		GType welcome_page_type_id;
		welcome_page_type_id = welcome_page_get_type_once ();
		g_once_init_leave (&welcome_page_type_id__once, welcome_page_type_id);
	}
	return welcome_page_type_id__once;
}

