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

/* This file is part of GNOME Boxes. License: LGPLv2+*/

#include <handy.h>
#include <glib-object.h>
#include <glib.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 BOXES_TYPE_PREFERENCES_WINDOW (boxes_preferences_window_get_type ())
#define BOXES_PREFERENCES_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_PREFERENCES_WINDOW, BoxesPreferencesWindow))
#define BOXES_PREFERENCES_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_PREFERENCES_WINDOW, BoxesPreferencesWindowClass))
#define BOXES_IS_PREFERENCES_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_PREFERENCES_WINDOW))
#define BOXES_IS_PREFERENCES_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_PREFERENCES_WINDOW))
#define BOXES_PREFERENCES_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_PREFERENCES_WINDOW, BoxesPreferencesWindowClass))

typedef struct _BoxesPreferencesWindow BoxesPreferencesWindow;
typedef struct _BoxesPreferencesWindowClass BoxesPreferencesWindowClass;
typedef struct _BoxesPreferencesWindowPrivate BoxesPreferencesWindowPrivate;

#define BOXES_TYPE_RESOURCES_PAGE (boxes_resources_page_get_type ())
#define BOXES_RESOURCES_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_RESOURCES_PAGE, BoxesResourcesPage))
#define BOXES_RESOURCES_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_RESOURCES_PAGE, BoxesResourcesPageClass))
#define BOXES_IS_RESOURCES_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_RESOURCES_PAGE))
#define BOXES_IS_RESOURCES_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_RESOURCES_PAGE))
#define BOXES_RESOURCES_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_RESOURCES_PAGE, BoxesResourcesPageClass))

typedef struct _BoxesResourcesPage BoxesResourcesPage;
typedef struct _BoxesResourcesPageClass BoxesResourcesPageClass;

#define BOXES_TYPE_DEVICES_PAGE (boxes_devices_page_get_type ())
#define BOXES_DEVICES_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_DEVICES_PAGE, BoxesDevicesPage))
#define BOXES_DEVICES_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_DEVICES_PAGE, BoxesDevicesPageClass))
#define BOXES_IS_DEVICES_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_DEVICES_PAGE))
#define BOXES_IS_DEVICES_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_DEVICES_PAGE))
#define BOXES_DEVICES_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_DEVICES_PAGE, BoxesDevicesPageClass))

typedef struct _BoxesDevicesPage BoxesDevicesPage;
typedef struct _BoxesDevicesPageClass BoxesDevicesPageClass;

#define BOXES_TYPE_SNAPSHOTS_PAGE (boxes_snapshots_page_get_type ())
#define BOXES_SNAPSHOTS_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_SNAPSHOTS_PAGE, BoxesSnapshotsPage))
#define BOXES_SNAPSHOTS_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_SNAPSHOTS_PAGE, BoxesSnapshotsPageClass))
#define BOXES_IS_SNAPSHOTS_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_SNAPSHOTS_PAGE))
#define BOXES_IS_SNAPSHOTS_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_SNAPSHOTS_PAGE))
#define BOXES_SNAPSHOTS_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_SNAPSHOTS_PAGE, BoxesSnapshotsPageClass))

typedef struct _BoxesSnapshotsPage BoxesSnapshotsPage;
typedef struct _BoxesSnapshotsPageClass BoxesSnapshotsPageClass;
enum  {
	BOXES_PREFERENCES_WINDOW_0_PROPERTY,
	BOXES_PREFERENCES_WINDOW_MACHINE_PROPERTY,
	BOXES_PREFERENCES_WINDOW_NUM_PROPERTIES
};
static GParamSpec* boxes_preferences_window_properties[BOXES_PREFERENCES_WINDOW_NUM_PROPERTIES];

#define BOXES_TYPE_COLLECTION_ITEM (boxes_collection_item_get_type ())
#define BOXES_COLLECTION_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_COLLECTION_ITEM, BoxesCollectionItem))
#define BOXES_COLLECTION_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_COLLECTION_ITEM, BoxesCollectionItemClass))
#define BOXES_IS_COLLECTION_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_COLLECTION_ITEM))
#define BOXES_IS_COLLECTION_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_COLLECTION_ITEM))
#define BOXES_COLLECTION_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_COLLECTION_ITEM, BoxesCollectionItemClass))

typedef struct _BoxesCollectionItem BoxesCollectionItem;
typedef struct _BoxesCollectionItemClass BoxesCollectionItemClass;

#define BOXES_TYPE_MACHINE (boxes_machine_get_type ())
#define BOXES_MACHINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_MACHINE, BoxesMachine))
#define BOXES_MACHINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_MACHINE, BoxesMachineClass))
#define BOXES_IS_MACHINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_MACHINE))
#define BOXES_IS_MACHINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_MACHINE))
#define BOXES_MACHINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_MACHINE, BoxesMachineClass))

typedef struct _BoxesMachine BoxesMachine;
typedef struct _BoxesMachineClass BoxesMachineClass;

#define BOXES_TYPE_LIBVIRT_MACHINE (boxes_libvirt_machine_get_type ())
#define BOXES_LIBVIRT_MACHINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_LIBVIRT_MACHINE, BoxesLibvirtMachine))
#define BOXES_LIBVIRT_MACHINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_LIBVIRT_MACHINE, BoxesLibvirtMachineClass))
#define BOXES_IS_LIBVIRT_MACHINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_LIBVIRT_MACHINE))
#define BOXES_IS_LIBVIRT_MACHINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_LIBVIRT_MACHINE))
#define BOXES_LIBVIRT_MACHINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_LIBVIRT_MACHINE, BoxesLibvirtMachineClass))

typedef struct _BoxesLibvirtMachine BoxesLibvirtMachine;
typedef struct _BoxesLibvirtMachineClass BoxesLibvirtMachineClass;

struct _BoxesPreferencesWindow {
	HdyPreferencesWindow parent_instance;
	BoxesPreferencesWindowPrivate * priv;
};

struct _BoxesPreferencesWindowClass {
	HdyPreferencesWindowClass parent_class;
};

struct _BoxesPreferencesWindowPrivate {
	BoxesResourcesPage* resources_page;
	BoxesDevicesPage* devices_page;
	BoxesSnapshotsPage* snapshots_page;
};

static gint BoxesPreferencesWindow_private_offset;
static gpointer boxes_preferences_window_parent_class = NULL;

VALA_EXTERN GType boxes_preferences_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesPreferencesWindow, g_object_unref)
VALA_EXTERN GType boxes_resources_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesResourcesPage, g_object_unref)
VALA_EXTERN GType boxes_devices_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesDevicesPage, g_object_unref)
VALA_EXTERN GType boxes_snapshots_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesSnapshotsPage, g_object_unref)
VALA_EXTERN void boxes_preferences_window_show_troubleshoot_logs (BoxesPreferencesWindow* self);
VALA_EXTERN void boxes_resources_page_show_logs (BoxesResourcesPage* self);
VALA_EXTERN BoxesPreferencesWindow* boxes_preferences_window_new (void);
VALA_EXTERN BoxesPreferencesWindow* boxes_preferences_window_construct (GType object_type);
VALA_EXTERN GType boxes_collection_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesCollectionItem, g_object_unref)
VALA_EXTERN GType boxes_machine_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesMachine, g_object_unref)
VALA_EXTERN void boxes_preferences_window_set_machine (BoxesPreferencesWindow* self,
                                           BoxesMachine* value);
VALA_EXTERN GType boxes_libvirt_machine_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesLibvirtMachine, g_object_unref)
VALA_EXTERN void boxes_resources_page_setup (BoxesResourcesPage* self,
                                 BoxesLibvirtMachine* machine);
VALA_EXTERN void boxes_devices_page_setup (BoxesDevicesPage* self,
                               BoxesLibvirtMachine* machine);
VALA_EXTERN void boxes_snapshots_page_setup (BoxesSnapshotsPage* self,
                                 BoxesLibvirtMachine* machine);
static void boxes_preferences_window_finalize (GObject * obj);
static GType boxes_preferences_window_get_type_once (void);
static void _vala_boxes_preferences_window_set_property (GObject * object,
                                                  guint property_id,
                                                  const GValue * value,
                                                  GParamSpec * pspec);

static inline gpointer
boxes_preferences_window_get_instance_private (BoxesPreferencesWindow* self)
{
	return G_STRUCT_MEMBER_P (self, BoxesPreferencesWindow_private_offset);
}

void
boxes_preferences_window_show_troubleshoot_logs (BoxesPreferencesWindow* self)
{
	BoxesResourcesPage* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->resources_page;
	boxes_resources_page_show_logs (_tmp0_);
}

BoxesPreferencesWindow*
boxes_preferences_window_construct (GType object_type)
{
	BoxesPreferencesWindow * self = NULL;
	self = (BoxesPreferencesWindow*) g_object_new (object_type, NULL);
	return self;
}

BoxesPreferencesWindow*
boxes_preferences_window_new (void)
{
	return boxes_preferences_window_construct (BOXES_TYPE_PREFERENCES_WINDOW);
}

void
boxes_preferences_window_set_machine (BoxesPreferencesWindow* self,
                                      BoxesMachine* value)
{
	BoxesResourcesPage* _tmp0_;
	BoxesDevicesPage* _tmp1_;
	BoxesSnapshotsPage* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->resources_page;
	boxes_resources_page_setup (_tmp0_, BOXES_IS_LIBVIRT_MACHINE (value) ? ((BoxesLibvirtMachine*) value) : NULL);
	_tmp1_ = self->priv->devices_page;
	boxes_devices_page_setup (_tmp1_, BOXES_IS_LIBVIRT_MACHINE (value) ? ((BoxesLibvirtMachine*) value) : NULL);
	_tmp2_ = self->priv->snapshots_page;
	boxes_snapshots_page_setup (_tmp2_, BOXES_IS_LIBVIRT_MACHINE (value) ? ((BoxesLibvirtMachine*) value) : NULL);
	g_object_notify_by_pspec ((GObject *) self, boxes_preferences_window_properties[BOXES_PREFERENCES_WINDOW_MACHINE_PROPERTY]);
}

static void
boxes_preferences_window_class_init (BoxesPreferencesWindowClass * klass,
                                     gpointer klass_data)
{
	boxes_preferences_window_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BoxesPreferencesWindow_private_offset);
	G_OBJECT_CLASS (klass)->set_property = _vala_boxes_preferences_window_set_property;
	G_OBJECT_CLASS (klass)->finalize = boxes_preferences_window_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_PREFERENCES_WINDOW_MACHINE_PROPERTY, boxes_preferences_window_properties[BOXES_PREFERENCES_WINDOW_MACHINE_PROPERTY] = g_param_spec_object ("machine", "machine", "machine", BOXES_TYPE_MACHINE, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Boxes/ui/preferences/preferences-window.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "resources_page", FALSE, BoxesPreferencesWindow_private_offset + G_STRUCT_OFFSET (BoxesPreferencesWindowPrivate, resources_page));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "devices_page", FALSE, BoxesPreferencesWindow_private_offset + G_STRUCT_OFFSET (BoxesPreferencesWindowPrivate, devices_page));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "snapshots_page", FALSE, BoxesPreferencesWindow_private_offset + G_STRUCT_OFFSET (BoxesPreferencesWindowPrivate, snapshots_page));
}

static void
boxes_preferences_window_instance_init (BoxesPreferencesWindow * self,
                                        gpointer klass)
{
	self->priv = boxes_preferences_window_get_instance_private (self);
	g_type_ensure (BOXES_TYPE_RESOURCES_PAGE);
	g_type_ensure (BOXES_TYPE_DEVICES_PAGE);
	g_type_ensure (BOXES_TYPE_SNAPSHOTS_PAGE);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
boxes_preferences_window_finalize (GObject * obj)
{
	BoxesPreferencesWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_PREFERENCES_WINDOW, BoxesPreferencesWindow);
	G_OBJECT_CLASS (boxes_preferences_window_parent_class)->finalize (obj);
}

static GType
boxes_preferences_window_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BoxesPreferencesWindowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_preferences_window_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesPreferencesWindow), 0, (GInstanceInitFunc) boxes_preferences_window_instance_init, NULL };
	GType boxes_preferences_window_type_id;
	boxes_preferences_window_type_id = g_type_register_static (hdy_preferences_window_get_type (), "BoxesPreferencesWindow", &g_define_type_info, 0);
	BoxesPreferencesWindow_private_offset = g_type_add_instance_private (boxes_preferences_window_type_id, sizeof (BoxesPreferencesWindowPrivate));
	return boxes_preferences_window_type_id;
}

GType
boxes_preferences_window_get_type (void)
{
	static volatile gsize boxes_preferences_window_type_id__once = 0;
	if (g_once_init_enter (&boxes_preferences_window_type_id__once)) {
		GType boxes_preferences_window_type_id;
		boxes_preferences_window_type_id = boxes_preferences_window_get_type_once ();
		g_once_init_leave (&boxes_preferences_window_type_id__once, boxes_preferences_window_type_id);
	}
	return boxes_preferences_window_type_id__once;
}

static void
_vala_boxes_preferences_window_set_property (GObject * object,
                                             guint property_id,
                                             const GValue * value,
                                             GParamSpec * pspec)
{
	BoxesPreferencesWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_PREFERENCES_WINDOW, BoxesPreferencesWindow);
	switch (property_id) {
		case BOXES_PREFERENCES_WINDOW_MACHINE_PROPERTY:
		boxes_preferences_window_set_machine (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

