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

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

#include <gtk/gtk.h>
#include <glib-object.h>
#include <handy.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_UI (boxes_ui_get_type ())
#define BOXES_UI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_UI, BoxesUI))
#define BOXES_IS_UI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_UI))
#define BOXES_UI_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), BOXES_TYPE_UI, BoxesUIIface))

typedef struct _BoxesUI BoxesUI;
typedef struct _BoxesUIIface BoxesUIIface;
typedef enum  {
	BOXES_UI_STATE_NONE,
	BOXES_UI_STATE_COLLECTION,
	BOXES_UI_STATE_CREDS,
	BOXES_UI_STATE_DISPLAY,
	BOXES_UI_STATE_WIZARD,
	BOXES_UI_STATE_PROPERTIES,
	BOXES_UI_STATE_TROUBLESHOOT
} BoxesUIState;

#define BOXES_TYPE_UI_STATE (boxes_ui_state_get_type ())

#define BOXES_TYPE_TROUBLESHOOT_VIEW (boxes_troubleshoot_view_get_type ())
#define BOXES_TROUBLESHOOT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_TROUBLESHOOT_VIEW, BoxesTroubleshootView))
#define BOXES_TROUBLESHOOT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_TROUBLESHOOT_VIEW, BoxesTroubleshootViewClass))
#define BOXES_IS_TROUBLESHOOT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_TROUBLESHOOT_VIEW))
#define BOXES_IS_TROUBLESHOOT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_TROUBLESHOOT_VIEW))
#define BOXES_TROUBLESHOOT_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_TROUBLESHOOT_VIEW, BoxesTroubleshootViewClass))

typedef struct _BoxesTroubleshootView BoxesTroubleshootView;
typedef struct _BoxesTroubleshootViewClass BoxesTroubleshootViewClass;
typedef struct _BoxesTroubleshootViewPrivate BoxesTroubleshootViewPrivate;

#define BOXES_TYPE_APP_WINDOW (boxes_app_window_get_type ())
#define BOXES_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_APP_WINDOW, BoxesAppWindow))
#define BOXES_APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_APP_WINDOW, BoxesAppWindowClass))
#define BOXES_IS_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_APP_WINDOW))
#define BOXES_IS_APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_APP_WINDOW))
#define BOXES_APP_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_APP_WINDOW, BoxesAppWindowClass))

typedef struct _BoxesAppWindow BoxesAppWindow;
typedef struct _BoxesAppWindowClass BoxesAppWindowClass;
enum  {
	BOXES_TROUBLESHOOT_VIEW_0_PROPERTY,
	BOXES_TROUBLESHOOT_VIEW_PREVIOUS_UI_STATE_PROPERTY,
	BOXES_TROUBLESHOOT_VIEW_UI_STATE_PROPERTY,
	BOXES_TROUBLESHOOT_VIEW_NUM_PROPERTIES
};
static GParamSpec* boxes_troubleshoot_view_properties[BOXES_TROUBLESHOOT_VIEW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _BoxesUIIface {
	GTypeInterface parent_iface;
	BoxesUIState (*get_previous_ui_state) (BoxesUI* self);
	void (*set_previous_ui_state) (BoxesUI* self, BoxesUIState value);
	BoxesUIState (*get_ui_state) (BoxesUI* self);
	void (*set_ui_state) (BoxesUI* self, BoxesUIState value);
};

struct _BoxesTroubleshootView {
	GtkStack parent_instance;
	BoxesTroubleshootViewPrivate * priv;
};

struct _BoxesTroubleshootViewClass {
	GtkStackClass parent_class;
};

struct _BoxesTroubleshootViewPrivate {
	BoxesUIState _previous_ui_state;
	BoxesUIState _ui_state;
	BoxesAppWindow* window;
};

static gint BoxesTroubleshootView_private_offset;
static gpointer boxes_troubleshoot_view_parent_class = NULL;
static BoxesUIIface * boxes_troubleshoot_view_boxes_ui_parent_iface = NULL;

VALA_EXTERN GType boxes_ui_state_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType boxes_ui_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesUI, g_object_unref)
VALA_EXTERN GType boxes_troubleshoot_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesTroubleshootView, g_object_unref)
VALA_EXTERN GType boxes_app_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesAppWindow, g_object_unref)
VALA_EXTERN void boxes_troubleshoot_view_setup_ui (BoxesTroubleshootView* self,
                                       BoxesAppWindow* window);
VALA_EXTERN BoxesTroubleshootView* boxes_troubleshoot_view_new (void);
VALA_EXTERN BoxesTroubleshootView* boxes_troubleshoot_view_construct (GType object_type);
VALA_EXTERN BoxesUIState boxes_ui_get_previous_ui_state (BoxesUI* self);
VALA_EXTERN void boxes_ui_set_previous_ui_state (BoxesUI* self,
                                     BoxesUIState value);
VALA_EXTERN BoxesUIState boxes_ui_get_ui_state (BoxesUI* self);
VALA_EXTERN void boxes_ui_set_ui_state (BoxesUI* self,
                            BoxesUIState value);
static void boxes_troubleshoot_view_finalize (GObject * obj);
static GType boxes_troubleshoot_view_get_type_once (void);
static void _vala_boxes_troubleshoot_view_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec);
static void _vala_boxes_troubleshoot_view_set_property (GObject * object,
                                                 guint property_id,
                                                 const GValue * value,
                                                 GParamSpec * pspec);

static inline gpointer
boxes_troubleshoot_view_get_instance_private (BoxesTroubleshootView* self)
{
	return G_STRUCT_MEMBER_P (self, BoxesTroubleshootView_private_offset);
}

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

void
boxes_troubleshoot_view_setup_ui (BoxesTroubleshootView* self,
                                  BoxesAppWindow* window)
{
	BoxesAppWindow* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (window != NULL);
	_tmp0_ = _g_object_ref0 (window);
	_g_object_unref0 (self->priv->window);
	self->priv->window = _tmp0_;
}

BoxesTroubleshootView*
boxes_troubleshoot_view_construct (GType object_type)
{
	BoxesTroubleshootView * self = NULL;
	self = (BoxesTroubleshootView*) g_object_new (object_type, NULL);
	return self;
}

BoxesTroubleshootView*
boxes_troubleshoot_view_new (void)
{
	return boxes_troubleshoot_view_construct (BOXES_TYPE_TROUBLESHOOT_VIEW);
}

static BoxesUIState
boxes_troubleshoot_view_real_get_previous_ui_state (BoxesUI* base)
{
	BoxesUIState result;
	BoxesTroubleshootView* self;
	self = (BoxesTroubleshootView*) base;
	result = self->priv->_previous_ui_state;
	return result;
}

static void
boxes_troubleshoot_view_real_set_previous_ui_state (BoxesUI* base,
                                                    BoxesUIState value)
{
	BoxesTroubleshootView* self;
	BoxesUIState old_value;
	self = (BoxesTroubleshootView*) base;
	old_value = boxes_troubleshoot_view_real_get_previous_ui_state (base);
	if (old_value != value) {
		self->priv->_previous_ui_state = value;
		g_object_notify_by_pspec ((GObject *) self, boxes_troubleshoot_view_properties[BOXES_TROUBLESHOOT_VIEW_PREVIOUS_UI_STATE_PROPERTY]);
	}
}

static BoxesUIState
boxes_troubleshoot_view_real_get_ui_state (BoxesUI* base)
{
	BoxesUIState result;
	BoxesTroubleshootView* self;
	self = (BoxesTroubleshootView*) base;
	result = self->priv->_ui_state;
	return result;
}

static void
boxes_troubleshoot_view_real_set_ui_state (BoxesUI* base,
                                           BoxesUIState value)
{
	BoxesTroubleshootView* self;
	BoxesUIState old_value;
	self = (BoxesTroubleshootView*) base;
	old_value = boxes_troubleshoot_view_real_get_ui_state (base);
	if (old_value != value) {
		self->priv->_ui_state = value;
		g_object_notify_by_pspec ((GObject *) self, boxes_troubleshoot_view_properties[BOXES_TROUBLESHOOT_VIEW_UI_STATE_PROPERTY]);
	}
}

static void
boxes_troubleshoot_view_class_init (BoxesTroubleshootViewClass * klass,
                                    gpointer klass_data)
{
	boxes_troubleshoot_view_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BoxesTroubleshootView_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_boxes_troubleshoot_view_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_boxes_troubleshoot_view_set_property;
	G_OBJECT_CLASS (klass)->finalize = boxes_troubleshoot_view_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_TROUBLESHOOT_VIEW_PREVIOUS_UI_STATE_PROPERTY, boxes_troubleshoot_view_properties[BOXES_TROUBLESHOOT_VIEW_PREVIOUS_UI_STATE_PROPERTY] = g_param_spec_enum ("previous-ui-state", "previous-ui-state", "previous-ui-state", BOXES_TYPE_UI_STATE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_TROUBLESHOOT_VIEW_UI_STATE_PROPERTY, boxes_troubleshoot_view_properties[BOXES_TROUBLESHOOT_VIEW_UI_STATE_PROPERTY] = g_param_spec_enum ("ui-state", "ui-state", "ui-state", BOXES_TYPE_UI_STATE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Boxes/ui/troubleshoot-view.ui");
}

static void
boxes_troubleshoot_view_boxes_ui_interface_init (BoxesUIIface * iface,
                                                 gpointer iface_data)
{
	boxes_troubleshoot_view_boxes_ui_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_previous_ui_state = boxes_troubleshoot_view_real_get_previous_ui_state;
	iface->set_previous_ui_state = boxes_troubleshoot_view_real_set_previous_ui_state;
	iface->get_ui_state = boxes_troubleshoot_view_real_get_ui_state;
	iface->set_ui_state = boxes_troubleshoot_view_real_set_ui_state;
}

static void
boxes_troubleshoot_view_instance_init (BoxesTroubleshootView * self,
                                       gpointer klass)
{
	self->priv = boxes_troubleshoot_view_get_instance_private (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
boxes_troubleshoot_view_finalize (GObject * obj)
{
	BoxesTroubleshootView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_TROUBLESHOOT_VIEW, BoxesTroubleshootView);
	_g_object_unref0 (self->priv->window);
	G_OBJECT_CLASS (boxes_troubleshoot_view_parent_class)->finalize (obj);
}

static GType
boxes_troubleshoot_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BoxesTroubleshootViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_troubleshoot_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesTroubleshootView), 0, (GInstanceInitFunc) boxes_troubleshoot_view_instance_init, NULL };
	static const GInterfaceInfo boxes_ui_info = { (GInterfaceInitFunc) boxes_troubleshoot_view_boxes_ui_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType boxes_troubleshoot_view_type_id;
	boxes_troubleshoot_view_type_id = g_type_register_static (gtk_stack_get_type (), "BoxesTroubleshootView", &g_define_type_info, 0);
	g_type_add_interface_static (boxes_troubleshoot_view_type_id, BOXES_TYPE_UI, &boxes_ui_info);
	BoxesTroubleshootView_private_offset = g_type_add_instance_private (boxes_troubleshoot_view_type_id, sizeof (BoxesTroubleshootViewPrivate));
	return boxes_troubleshoot_view_type_id;
}

GType
boxes_troubleshoot_view_get_type (void)
{
	static volatile gsize boxes_troubleshoot_view_type_id__once = 0;
	if (g_once_init_enter (&boxes_troubleshoot_view_type_id__once)) {
		GType boxes_troubleshoot_view_type_id;
		boxes_troubleshoot_view_type_id = boxes_troubleshoot_view_get_type_once ();
		g_once_init_leave (&boxes_troubleshoot_view_type_id__once, boxes_troubleshoot_view_type_id);
	}
	return boxes_troubleshoot_view_type_id__once;
}

static void
_vala_boxes_troubleshoot_view_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec)
{
	BoxesTroubleshootView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_TROUBLESHOOT_VIEW, BoxesTroubleshootView);
	switch (property_id) {
		case BOXES_TROUBLESHOOT_VIEW_PREVIOUS_UI_STATE_PROPERTY:
		g_value_set_enum (value, boxes_ui_get_previous_ui_state ((BoxesUI*) self));
		break;
		case BOXES_TROUBLESHOOT_VIEW_UI_STATE_PROPERTY:
		g_value_set_enum (value, boxes_ui_get_ui_state ((BoxesUI*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_boxes_troubleshoot_view_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec)
{
	BoxesTroubleshootView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_TROUBLESHOOT_VIEW, BoxesTroubleshootView);
	switch (property_id) {
		case BOXES_TROUBLESHOOT_VIEW_PREVIOUS_UI_STATE_PROPERTY:
		boxes_ui_set_previous_ui_state ((BoxesUI*) self, g_value_get_enum (value));
		break;
		case BOXES_TROUBLESHOOT_VIEW_UI_STATE_PROPERTY:
		boxes_ui_set_ui_state ((BoxesUI*) self, g_value_get_enum (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

