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

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

#include <gtk/gtk.h>
#include <glib-object.h>
#include <gdk/gdk.h>
#include <stdlib.h>
#include <string.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_WELCOME_TUTORIAL_PAGE (boxes_welcome_tutorial_page_get_type ())
#define BOXES_WELCOME_TUTORIAL_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_WELCOME_TUTORIAL_PAGE, BoxesWelcomeTutorialPage))
#define BOXES_WELCOME_TUTORIAL_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_WELCOME_TUTORIAL_PAGE, BoxesWelcomeTutorialPageClass))
#define BOXES_IS_WELCOME_TUTORIAL_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_WELCOME_TUTORIAL_PAGE))
#define BOXES_IS_WELCOME_TUTORIAL_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_WELCOME_TUTORIAL_PAGE))
#define BOXES_WELCOME_TUTORIAL_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_WELCOME_TUTORIAL_PAGE, BoxesWelcomeTutorialPageClass))

typedef struct _BoxesWelcomeTutorialPage BoxesWelcomeTutorialPage;
typedef struct _BoxesWelcomeTutorialPageClass BoxesWelcomeTutorialPageClass;
typedef struct _BoxesWelcomeTutorialPagePrivate BoxesWelcomeTutorialPagePrivate;
enum  {
	BOXES_WELCOME_TUTORIAL_PAGE_0_PROPERTY,
	BOXES_WELCOME_TUTORIAL_PAGE_TITLE_PROPERTY,
	BOXES_WELCOME_TUTORIAL_PAGE_DESCRIPTION_PROPERTY,
	BOXES_WELCOME_TUTORIAL_PAGE_COLOR_PROPERTY,
	BOXES_WELCOME_TUTORIAL_PAGE_IMAGE_PROPERTY,
	BOXES_WELCOME_TUTORIAL_PAGE_NUM_PROPERTIES
};
static GParamSpec* boxes_welcome_tutorial_page_properties[BOXES_WELCOME_TUTORIAL_PAGE_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _BoxesWelcomeTutorialPage {
	GtkBox parent_instance;
	BoxesWelcomeTutorialPagePrivate * priv;
};

struct _BoxesWelcomeTutorialPageClass {
	GtkBoxClass parent_class;
};

struct _BoxesWelcomeTutorialPagePrivate {
	GtkLabel* title_label;
	GtkLabel* description_label;
	GdkRGBA _color;
	gchar* _image;
};

static gint BoxesWelcomeTutorialPage_private_offset;
static gpointer boxes_welcome_tutorial_page_parent_class = NULL;

VALA_EXTERN GType boxes_welcome_tutorial_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesWelcomeTutorialPage, g_object_unref)
static void boxes_welcome_tutorial_page_load_css (BoxesWelcomeTutorialPage* self);
VALA_EXTERN const gchar* boxes_welcome_tutorial_page_get_image (BoxesWelcomeTutorialPage* self);
static void _boxes_welcome_tutorial_page_load_css_gtk_widget_map (GtkWidget* _sender,
                                                           gpointer self);
VALA_EXTERN BoxesWelcomeTutorialPage* boxes_welcome_tutorial_page_new (void);
VALA_EXTERN BoxesWelcomeTutorialPage* boxes_welcome_tutorial_page_construct (GType object_type);
VALA_EXTERN const gchar* boxes_welcome_tutorial_page_get_title (BoxesWelcomeTutorialPage* self);
VALA_EXTERN void boxes_welcome_tutorial_page_set_title (BoxesWelcomeTutorialPage* self,
                                            const gchar* value);
VALA_EXTERN const gchar* boxes_welcome_tutorial_page_get_description (BoxesWelcomeTutorialPage* self);
VALA_EXTERN void boxes_welcome_tutorial_page_set_description (BoxesWelcomeTutorialPage* self,
                                                  const gchar* value);
VALA_EXTERN void boxes_welcome_tutorial_page_get_color (BoxesWelcomeTutorialPage* self,
                                            GdkRGBA * result);
VALA_EXTERN void boxes_welcome_tutorial_page_set_color (BoxesWelcomeTutorialPage* self,
                                            GdkRGBA * value);
static gboolean _gdk_rgba_equal (const GdkRGBA * s1,
                          const GdkRGBA * s2);
VALA_EXTERN void boxes_welcome_tutorial_page_set_image (BoxesWelcomeTutorialPage* self,
                                            const gchar* value);
static void boxes_welcome_tutorial_page_finalize (GObject * obj);
static GType boxes_welcome_tutorial_page_get_type_once (void);
static void _vala_boxes_welcome_tutorial_page_get_property (GObject * object,
                                                     guint property_id,
                                                     GValue * value,
                                                     GParamSpec * pspec);
static void _vala_boxes_welcome_tutorial_page_set_property (GObject * object,
                                                     guint property_id,
                                                     const GValue * value,
                                                     GParamSpec * pspec);

static inline gpointer
boxes_welcome_tutorial_page_get_instance_private (BoxesWelcomeTutorialPage* self)
{
	return G_STRUCT_MEMBER_P (self, BoxesWelcomeTutorialPage_private_offset);
}

static void
boxes_welcome_tutorial_page_load_css (BoxesWelcomeTutorialPage* self)
{
	GtkCssProvider* provider = NULL;
	GtkCssProvider* _tmp0_;
	gchar* css = NULL;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_css_provider_new ();
	provider = _tmp0_;
	_tmp1_ = self->priv->_image;
	_tmp2_ = g_strdup_printf ("\n" \
"          .tutorial-page {\n" \
"            background-image: url(\"resource://%s\");\n" \
"          }\n" \
"        ", _tmp1_);
	css = _tmp2_;
	{
		GtkStyleContext* _tmp3_;
		gtk_css_provider_load_from_data (provider, css, (gssize) -1, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp3_ = gtk_widget_get_style_context ((GtkWidget*) self);
		gtk_style_context_add_provider (_tmp3_, (GtkStyleProvider*) provider, (guint) GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		GError* _tmp4_;
		const gchar* _tmp5_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp4_ = _error_;
		_tmp5_ = _tmp4_->message;
		g_warning ("welcome-tutorial-page.vala:44: Failed to load CSS: %s", _tmp5_);
		_g_error_free0 (_error_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (css);
		_g_object_unref0 (provider);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_g_free0 (css);
	_g_object_unref0 (provider);
}

static void
_boxes_welcome_tutorial_page_load_css_gtk_widget_map (GtkWidget* _sender,
                                                      gpointer self)
{
	boxes_welcome_tutorial_page_load_css ((BoxesWelcomeTutorialPage*) self);
}

BoxesWelcomeTutorialPage*
boxes_welcome_tutorial_page_construct (GType object_type)
{
	BoxesWelcomeTutorialPage * self = NULL;
	self = (BoxesWelcomeTutorialPage*) g_object_new (object_type, NULL);
	return self;
}

BoxesWelcomeTutorialPage*
boxes_welcome_tutorial_page_new (void)
{
	return boxes_welcome_tutorial_page_construct (BOXES_TYPE_WELCOME_TUTORIAL_PAGE);
}

const gchar*
boxes_welcome_tutorial_page_get_title (BoxesWelcomeTutorialPage* self)
{
	const gchar* result;
	GtkLabel* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->title_label;
	_tmp1_ = gtk_label_get_label (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

void
boxes_welcome_tutorial_page_set_title (BoxesWelcomeTutorialPage* self,
                                       const gchar* value)
{
	GtkLabel* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->title_label;
	gtk_label_set_label (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, boxes_welcome_tutorial_page_properties[BOXES_WELCOME_TUTORIAL_PAGE_TITLE_PROPERTY]);
}

const gchar*
boxes_welcome_tutorial_page_get_description (BoxesWelcomeTutorialPage* self)
{
	const gchar* result;
	GtkLabel* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->description_label;
	_tmp1_ = gtk_label_get_label (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

void
boxes_welcome_tutorial_page_set_description (BoxesWelcomeTutorialPage* self,
                                             const gchar* value)
{
	GtkLabel* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->description_label;
	gtk_label_set_label (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, boxes_welcome_tutorial_page_properties[BOXES_WELCOME_TUTORIAL_PAGE_DESCRIPTION_PROPERTY]);
}

void
boxes_welcome_tutorial_page_get_color (BoxesWelcomeTutorialPage* self,
                                       GdkRGBA * result)
{
	GdkRGBA _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_color;
	*result = _tmp0_;
	return;
}

static gboolean
_gdk_rgba_equal (const GdkRGBA * s1,
                 const GdkRGBA * s2)
{
	if (s1 == s2) {
		return TRUE;
	}
	if (s1 == NULL) {
		return FALSE;
	}
	if (s2 == NULL) {
		return FALSE;
	}
	if (s1->red != s2->red) {
		return FALSE;
	}
	if (s1->green != s2->green) {
		return FALSE;
	}
	if (s1->blue != s2->blue) {
		return FALSE;
	}
	if (s1->alpha != s2->alpha) {
		return FALSE;
	}
	return TRUE;
}

void
boxes_welcome_tutorial_page_set_color (BoxesWelcomeTutorialPage* self,
                                       GdkRGBA * value)
{
	GdkRGBA old_value;
	g_return_if_fail (self != NULL);
	boxes_welcome_tutorial_page_get_color (self, &old_value);
	if (_gdk_rgba_equal (value, &old_value) != TRUE) {
		GdkRGBA _tmp0_;
		_tmp0_ = *value;
		self->priv->_color = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, boxes_welcome_tutorial_page_properties[BOXES_WELCOME_TUTORIAL_PAGE_COLOR_PROPERTY]);
	}
}

const gchar*
boxes_welcome_tutorial_page_get_image (BoxesWelcomeTutorialPage* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_image;
	result = _tmp0_;
	return result;
}

void
boxes_welcome_tutorial_page_set_image (BoxesWelcomeTutorialPage* self,
                                       const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = boxes_welcome_tutorial_page_get_image (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_image);
		self->priv->_image = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, boxes_welcome_tutorial_page_properties[BOXES_WELCOME_TUTORIAL_PAGE_IMAGE_PROPERTY]);
	}
}

static void
boxes_welcome_tutorial_page_class_init (BoxesWelcomeTutorialPageClass * klass,
                                        gpointer klass_data)
{
	boxes_welcome_tutorial_page_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BoxesWelcomeTutorialPage_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_boxes_welcome_tutorial_page_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_boxes_welcome_tutorial_page_set_property;
	G_OBJECT_CLASS (klass)->finalize = boxes_welcome_tutorial_page_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_WELCOME_TUTORIAL_PAGE_TITLE_PROPERTY, boxes_welcome_tutorial_page_properties[BOXES_WELCOME_TUTORIAL_PAGE_TITLE_PROPERTY] = g_param_spec_string ("title", "title", "title", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_WELCOME_TUTORIAL_PAGE_DESCRIPTION_PROPERTY, boxes_welcome_tutorial_page_properties[BOXES_WELCOME_TUTORIAL_PAGE_DESCRIPTION_PROPERTY] = g_param_spec_string ("description", "description", "description", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_WELCOME_TUTORIAL_PAGE_COLOR_PROPERTY, boxes_welcome_tutorial_page_properties[BOXES_WELCOME_TUTORIAL_PAGE_COLOR_PROPERTY] = g_param_spec_boxed ("color", "color", "color", gdk_rgba_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_WELCOME_TUTORIAL_PAGE_IMAGE_PROPERTY, boxes_welcome_tutorial_page_properties[BOXES_WELCOME_TUTORIAL_PAGE_IMAGE_PROPERTY] = g_param_spec_string ("image", "image", "image", NULL, 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/welcome-tutorial-page.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "title_label", FALSE, BoxesWelcomeTutorialPage_private_offset + G_STRUCT_OFFSET (BoxesWelcomeTutorialPagePrivate, title_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "description_label", FALSE, BoxesWelcomeTutorialPage_private_offset + G_STRUCT_OFFSET (BoxesWelcomeTutorialPagePrivate, description_label));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "load_css", G_CALLBACK(_boxes_welcome_tutorial_page_load_css_gtk_widget_map));
}

static void
boxes_welcome_tutorial_page_instance_init (BoxesWelcomeTutorialPage * self,
                                           gpointer klass)
{
	self->priv = boxes_welcome_tutorial_page_get_instance_private (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
boxes_welcome_tutorial_page_finalize (GObject * obj)
{
	BoxesWelcomeTutorialPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_WELCOME_TUTORIAL_PAGE, BoxesWelcomeTutorialPage);
	_g_free0 (self->priv->_image);
	G_OBJECT_CLASS (boxes_welcome_tutorial_page_parent_class)->finalize (obj);
}

static GType
boxes_welcome_tutorial_page_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BoxesWelcomeTutorialPageClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_welcome_tutorial_page_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesWelcomeTutorialPage), 0, (GInstanceInitFunc) boxes_welcome_tutorial_page_instance_init, NULL };
	GType boxes_welcome_tutorial_page_type_id;
	boxes_welcome_tutorial_page_type_id = g_type_register_static (gtk_box_get_type (), "BoxesWelcomeTutorialPage", &g_define_type_info, 0);
	BoxesWelcomeTutorialPage_private_offset = g_type_add_instance_private (boxes_welcome_tutorial_page_type_id, sizeof (BoxesWelcomeTutorialPagePrivate));
	return boxes_welcome_tutorial_page_type_id;
}

GType
boxes_welcome_tutorial_page_get_type (void)
{
	static volatile gsize boxes_welcome_tutorial_page_type_id__once = 0;
	if (g_once_init_enter (&boxes_welcome_tutorial_page_type_id__once)) {
		GType boxes_welcome_tutorial_page_type_id;
		boxes_welcome_tutorial_page_type_id = boxes_welcome_tutorial_page_get_type_once ();
		g_once_init_leave (&boxes_welcome_tutorial_page_type_id__once, boxes_welcome_tutorial_page_type_id);
	}
	return boxes_welcome_tutorial_page_type_id__once;
}

static void
_vala_boxes_welcome_tutorial_page_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec)
{
	BoxesWelcomeTutorialPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_WELCOME_TUTORIAL_PAGE, BoxesWelcomeTutorialPage);
	switch (property_id) {
		case BOXES_WELCOME_TUTORIAL_PAGE_TITLE_PROPERTY:
		g_value_set_string (value, boxes_welcome_tutorial_page_get_title (self));
		break;
		case BOXES_WELCOME_TUTORIAL_PAGE_DESCRIPTION_PROPERTY:
		g_value_set_string (value, boxes_welcome_tutorial_page_get_description (self));
		break;
		case BOXES_WELCOME_TUTORIAL_PAGE_COLOR_PROPERTY:
		{
			GdkRGBA boxed;
			boxes_welcome_tutorial_page_get_color (self, &boxed);
			g_value_set_boxed (value, &boxed);
		}
		break;
		case BOXES_WELCOME_TUTORIAL_PAGE_IMAGE_PROPERTY:
		g_value_set_string (value, boxes_welcome_tutorial_page_get_image (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_boxes_welcome_tutorial_page_set_property (GObject * object,
                                                guint property_id,
                                                const GValue * value,
                                                GParamSpec * pspec)
{
	BoxesWelcomeTutorialPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_WELCOME_TUTORIAL_PAGE, BoxesWelcomeTutorialPage);
	switch (property_id) {
		case BOXES_WELCOME_TUTORIAL_PAGE_TITLE_PROPERTY:
		boxes_welcome_tutorial_page_set_title (self, g_value_get_string (value));
		break;
		case BOXES_WELCOME_TUTORIAL_PAGE_DESCRIPTION_PROPERTY:
		boxes_welcome_tutorial_page_set_description (self, g_value_get_string (value));
		break;
		case BOXES_WELCOME_TUTORIAL_PAGE_COLOR_PROPERTY:
		boxes_welcome_tutorial_page_set_color (self, g_value_get_boxed (value));
		break;
		case BOXES_WELCOME_TUTORIAL_PAGE_IMAGE_PROPERTY:
		boxes_welcome_tutorial_page_set_image (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

