/* onboarding-dialog-page.c generated by valac 0.56.3, the Vala compiler
 * generated from onboarding-dialog-page.vala, do not modify */

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

#include <gtk/gtk.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>

#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 CONNECTIONS_TYPE_ONBOARDING_DIALOG_PAGE (connections_onboarding_dialog_page_get_type ())
#define CONNECTIONS_ONBOARDING_DIALOG_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONNECTIONS_TYPE_ONBOARDING_DIALOG_PAGE, ConnectionsOnboardingDialogPage))
#define CONNECTIONS_ONBOARDING_DIALOG_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONNECTIONS_TYPE_ONBOARDING_DIALOG_PAGE, ConnectionsOnboardingDialogPageClass))
#define CONNECTIONS_IS_ONBOARDING_DIALOG_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONNECTIONS_TYPE_ONBOARDING_DIALOG_PAGE))
#define CONNECTIONS_IS_ONBOARDING_DIALOG_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONNECTIONS_TYPE_ONBOARDING_DIALOG_PAGE))
#define CONNECTIONS_ONBOARDING_DIALOG_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONNECTIONS_TYPE_ONBOARDING_DIALOG_PAGE, ConnectionsOnboardingDialogPageClass))

typedef struct _ConnectionsOnboardingDialogPage ConnectionsOnboardingDialogPage;
typedef struct _ConnectionsOnboardingDialogPageClass ConnectionsOnboardingDialogPageClass;
typedef struct _ConnectionsOnboardingDialogPagePrivate ConnectionsOnboardingDialogPagePrivate;
enum  {
	CONNECTIONS_ONBOARDING_DIALOG_PAGE_0_PROPERTY,
	CONNECTIONS_ONBOARDING_DIALOG_PAGE_TITLE_PROPERTY,
	CONNECTIONS_ONBOARDING_DIALOG_PAGE_DESCRIPTION_PROPERTY,
	CONNECTIONS_ONBOARDING_DIALOG_PAGE_IMAGE_PROPERTY,
	CONNECTIONS_ONBOARDING_DIALOG_PAGE_NUM_PROPERTIES
};
static GParamSpec* connections_onboarding_dialog_page_properties[CONNECTIONS_ONBOARDING_DIALOG_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 _ConnectionsOnboardingDialogPage {
	GtkBox parent_instance;
	ConnectionsOnboardingDialogPagePrivate * priv;
};

struct _ConnectionsOnboardingDialogPageClass {
	GtkBoxClass parent_class;
};

struct _ConnectionsOnboardingDialogPagePrivate {
	GtkLabel* title_label;
	GtkLabel* description_label;
	gchar* _image;
};

static gint ConnectionsOnboardingDialogPage_private_offset;
static gpointer connections_onboarding_dialog_page_parent_class = NULL;

VALA_EXTERN GType connections_onboarding_dialog_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConnectionsOnboardingDialogPage, g_object_unref)
static void connections_onboarding_dialog_page_load_css (ConnectionsOnboardingDialogPage* self);
VALA_EXTERN const gchar* connections_onboarding_dialog_page_get_image (ConnectionsOnboardingDialogPage* self);
static void _connections_onboarding_dialog_page_load_css_gtk_widget_map (GtkWidget* _sender,
                                                                  gpointer self);
VALA_EXTERN ConnectionsOnboardingDialogPage* connections_onboarding_dialog_page_new (void);
VALA_EXTERN ConnectionsOnboardingDialogPage* connections_onboarding_dialog_page_construct (GType object_type);
VALA_EXTERN const gchar* connections_onboarding_dialog_page_get_title (ConnectionsOnboardingDialogPage* self);
VALA_EXTERN void connections_onboarding_dialog_page_set_title (ConnectionsOnboardingDialogPage* self,
                                                   const gchar* value);
VALA_EXTERN const gchar* connections_onboarding_dialog_page_get_description (ConnectionsOnboardingDialogPage* self);
VALA_EXTERN void connections_onboarding_dialog_page_set_description (ConnectionsOnboardingDialogPage* self,
                                                         const gchar* value);
VALA_EXTERN void connections_onboarding_dialog_page_set_image (ConnectionsOnboardingDialogPage* self,
                                                   const gchar* value);
static void connections_onboarding_dialog_page_finalize (GObject * obj);
static GType connections_onboarding_dialog_page_get_type_once (void);
static void _vala_connections_onboarding_dialog_page_get_property (GObject * object,
                                                            guint property_id,
                                                            GValue * value,
                                                            GParamSpec * pspec);
static void _vala_connections_onboarding_dialog_page_set_property (GObject * object,
                                                            guint property_id,
                                                            const GValue * value,
                                                            GParamSpec * pspec);

static inline gpointer
connections_onboarding_dialog_page_get_instance_private (ConnectionsOnboardingDialogPage* self)
{
	return G_STRUCT_MEMBER_P (self, ConnectionsOnboardingDialogPage_private_offset);
}

static void
connections_onboarding_dialog_page_load_css (ConnectionsOnboardingDialogPage* 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" \
"              .onboarding-dialog-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 ("onboarding-dialog-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
_connections_onboarding_dialog_page_load_css_gtk_widget_map (GtkWidget* _sender,
                                                             gpointer self)
{
	connections_onboarding_dialog_page_load_css ((ConnectionsOnboardingDialogPage*) self);
}

ConnectionsOnboardingDialogPage*
connections_onboarding_dialog_page_construct (GType object_type)
{
	ConnectionsOnboardingDialogPage * self = NULL;
	self = (ConnectionsOnboardingDialogPage*) g_object_new (object_type, NULL);
	return self;
}

ConnectionsOnboardingDialogPage*
connections_onboarding_dialog_page_new (void)
{
	return connections_onboarding_dialog_page_construct (CONNECTIONS_TYPE_ONBOARDING_DIALOG_PAGE);
}

const gchar*
connections_onboarding_dialog_page_get_title (ConnectionsOnboardingDialogPage* 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
connections_onboarding_dialog_page_set_title (ConnectionsOnboardingDialogPage* 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, connections_onboarding_dialog_page_properties[CONNECTIONS_ONBOARDING_DIALOG_PAGE_TITLE_PROPERTY]);
}

const gchar*
connections_onboarding_dialog_page_get_description (ConnectionsOnboardingDialogPage* 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
connections_onboarding_dialog_page_set_description (ConnectionsOnboardingDialogPage* 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, connections_onboarding_dialog_page_properties[CONNECTIONS_ONBOARDING_DIALOG_PAGE_DESCRIPTION_PROPERTY]);
}

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

void
connections_onboarding_dialog_page_set_image (ConnectionsOnboardingDialogPage* self,
                                              const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = connections_onboarding_dialog_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, connections_onboarding_dialog_page_properties[CONNECTIONS_ONBOARDING_DIALOG_PAGE_IMAGE_PROPERTY]);
	}
}

static void
connections_onboarding_dialog_page_class_init (ConnectionsOnboardingDialogPageClass * klass,
                                               gpointer klass_data)
{
	connections_onboarding_dialog_page_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ConnectionsOnboardingDialogPage_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_connections_onboarding_dialog_page_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_connections_onboarding_dialog_page_set_property;
	G_OBJECT_CLASS (klass)->finalize = connections_onboarding_dialog_page_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONNECTIONS_ONBOARDING_DIALOG_PAGE_TITLE_PROPERTY, connections_onboarding_dialog_page_properties[CONNECTIONS_ONBOARDING_DIALOG_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), CONNECTIONS_ONBOARDING_DIALOG_PAGE_DESCRIPTION_PROPERTY, connections_onboarding_dialog_page_properties[CONNECTIONS_ONBOARDING_DIALOG_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), CONNECTIONS_ONBOARDING_DIALOG_PAGE_IMAGE_PROPERTY, connections_onboarding_dialog_page_properties[CONNECTIONS_ONBOARDING_DIALOG_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/Connections/ui/onboarding-dialog-page.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "title_label", FALSE, ConnectionsOnboardingDialogPage_private_offset + G_STRUCT_OFFSET (ConnectionsOnboardingDialogPagePrivate, title_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "description_label", FALSE, ConnectionsOnboardingDialogPage_private_offset + G_STRUCT_OFFSET (ConnectionsOnboardingDialogPagePrivate, description_label));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "load_css", G_CALLBACK(_connections_onboarding_dialog_page_load_css_gtk_widget_map));
}

static void
connections_onboarding_dialog_page_instance_init (ConnectionsOnboardingDialogPage * self,
                                                  gpointer klass)
{
	self->priv = connections_onboarding_dialog_page_get_instance_private (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
connections_onboarding_dialog_page_finalize (GObject * obj)
{
	ConnectionsOnboardingDialogPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONNECTIONS_TYPE_ONBOARDING_DIALOG_PAGE, ConnectionsOnboardingDialogPage);
	_g_free0 (self->priv->_image);
	G_OBJECT_CLASS (connections_onboarding_dialog_page_parent_class)->finalize (obj);
}

static GType
connections_onboarding_dialog_page_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ConnectionsOnboardingDialogPageClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) connections_onboarding_dialog_page_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ConnectionsOnboardingDialogPage), 0, (GInstanceInitFunc) connections_onboarding_dialog_page_instance_init, NULL };
	GType connections_onboarding_dialog_page_type_id;
	connections_onboarding_dialog_page_type_id = g_type_register_static (gtk_box_get_type (), "ConnectionsOnboardingDialogPage", &g_define_type_info, 0);
	ConnectionsOnboardingDialogPage_private_offset = g_type_add_instance_private (connections_onboarding_dialog_page_type_id, sizeof (ConnectionsOnboardingDialogPagePrivate));
	return connections_onboarding_dialog_page_type_id;
}

GType
connections_onboarding_dialog_page_get_type (void)
{
	static volatile gsize connections_onboarding_dialog_page_type_id__once = 0;
	if (g_once_init_enter (&connections_onboarding_dialog_page_type_id__once)) {
		GType connections_onboarding_dialog_page_type_id;
		connections_onboarding_dialog_page_type_id = connections_onboarding_dialog_page_get_type_once ();
		g_once_init_leave (&connections_onboarding_dialog_page_type_id__once, connections_onboarding_dialog_page_type_id);
	}
	return connections_onboarding_dialog_page_type_id__once;
}

static void
_vala_connections_onboarding_dialog_page_get_property (GObject * object,
                                                       guint property_id,
                                                       GValue * value,
                                                       GParamSpec * pspec)
{
	ConnectionsOnboardingDialogPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CONNECTIONS_TYPE_ONBOARDING_DIALOG_PAGE, ConnectionsOnboardingDialogPage);
	switch (property_id) {
		case CONNECTIONS_ONBOARDING_DIALOG_PAGE_TITLE_PROPERTY:
		g_value_set_string (value, connections_onboarding_dialog_page_get_title (self));
		break;
		case CONNECTIONS_ONBOARDING_DIALOG_PAGE_DESCRIPTION_PROPERTY:
		g_value_set_string (value, connections_onboarding_dialog_page_get_description (self));
		break;
		case CONNECTIONS_ONBOARDING_DIALOG_PAGE_IMAGE_PROPERTY:
		g_value_set_string (value, connections_onboarding_dialog_page_get_image (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_connections_onboarding_dialog_page_set_property (GObject * object,
                                                       guint property_id,
                                                       const GValue * value,
                                                       GParamSpec * pspec)
{
	ConnectionsOnboardingDialogPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CONNECTIONS_TYPE_ONBOARDING_DIALOG_PAGE, ConnectionsOnboardingDialogPage);
	switch (property_id) {
		case CONNECTIONS_ONBOARDING_DIALOG_PAGE_TITLE_PROPERTY:
		connections_onboarding_dialog_page_set_title (self, g_value_get_string (value));
		break;
		case CONNECTIONS_ONBOARDING_DIALOG_PAGE_DESCRIPTION_PROPERTY:
		connections_onboarding_dialog_page_set_description (self, g_value_get_string (value));
		break;
		case CONNECTIONS_ONBOARDING_DIALOG_PAGE_IMAGE_PROPERTY:
		connections_onboarding_dialog_page_set_image (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

