/* error-info-bar.c generated by valac 0.36.12.13-3ae08, the Vala compiler
 * generated from error-info-bar.vala, do not modify */

/* This file is part of GNOME Games. License: GPL-3.0+.*/

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


#define GAMES_TYPE_ERROR_INFO_BAR (games_error_info_bar_get_type ())
#define GAMES_ERROR_INFO_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_ERROR_INFO_BAR, GamesErrorInfoBar))
#define GAMES_ERROR_INFO_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_ERROR_INFO_BAR, GamesErrorInfoBarClass))
#define GAMES_IS_ERROR_INFO_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_ERROR_INFO_BAR))
#define GAMES_IS_ERROR_INFO_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_ERROR_INFO_BAR))
#define GAMES_ERROR_INFO_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_ERROR_INFO_BAR, GamesErrorInfoBarClass))

typedef struct _GamesErrorInfoBar GamesErrorInfoBar;
typedef struct _GamesErrorInfoBarClass GamesErrorInfoBarClass;
typedef struct _GamesErrorInfoBarPrivate GamesErrorInfoBarPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _GamesErrorInfoBar {
	GtkInfoBar parent_instance;
	GamesErrorInfoBarPrivate * priv;
};

struct _GamesErrorInfoBarClass {
	GtkInfoBarClass parent_class;
};

struct _GamesErrorInfoBarPrivate {
	GtkLabel* label;
};


static gpointer games_error_info_bar_parent_class = NULL;

GType games_error_info_bar_get_type (void) G_GNUC_CONST;
#define GAMES_ERROR_INFO_BAR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GAMES_TYPE_ERROR_INFO_BAR, GamesErrorInfoBarPrivate))
enum  {
	GAMES_ERROR_INFO_BAR_0_PROPERTY,
	GAMES_ERROR_INFO_BAR_MESSAGE_PROPERTY
};
GamesErrorInfoBar* games_error_info_bar_new (void);
GamesErrorInfoBar* games_error_info_bar_construct (GType object_type);
void games_error_info_bar_set_message (GamesErrorInfoBar* self, const gchar* value);
static GObject * games_error_info_bar_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void games_error_info_bar_finalize (GObject * obj);
static void _vala_games_error_info_bar_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);


GamesErrorInfoBar* games_error_info_bar_construct (GType object_type) {
	GamesErrorInfoBar * self = NULL;
	self = (GamesErrorInfoBar*) g_object_new (object_type, NULL);
	return self;
}


GamesErrorInfoBar* games_error_info_bar_new (void) {
	return games_error_info_bar_construct (GAMES_TYPE_ERROR_INFO_BAR);
}


void games_error_info_bar_set_message (GamesErrorInfoBar* self, const gchar* value) {
	GtkLabel* _tmp0_;
	const gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->label;
	_tmp1_ = value;
	gtk_label_set_label (_tmp0_, _tmp1_);
	g_object_notify ((GObject *) self, "message");
}


static GObject * games_error_info_bar_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	GamesErrorInfoBar * self;
	parent_class = G_OBJECT_CLASS (games_error_info_bar_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_ERROR_INFO_BAR, GamesErrorInfoBar);
	gtk_info_bar_set_show_close_button ((GtkInfoBar*) self, TRUE);
	gtk_info_bar_set_message_type ((GtkInfoBar*) self, GTK_MESSAGE_ERROR);
	return obj;
}


static void games_error_info_bar_class_init (GamesErrorInfoBarClass * klass) {
	gint GamesErrorInfoBar_private_offset;
	games_error_info_bar_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GamesErrorInfoBarPrivate));
	G_OBJECT_CLASS (klass)->set_property = _vala_games_error_info_bar_set_property;
	G_OBJECT_CLASS (klass)->constructor = games_error_info_bar_constructor;
	G_OBJECT_CLASS (klass)->finalize = games_error_info_bar_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_ERROR_INFO_BAR_MESSAGE_PROPERTY, g_param_spec_string ("message", "message", "message", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE));
	GamesErrorInfoBar_private_offset = g_type_class_get_instance_private_offset (klass);
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Games/ui/error-info-bar.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "label", FALSE, GamesErrorInfoBar_private_offset + G_STRUCT_OFFSET (GamesErrorInfoBarPrivate, label));
}


static void games_error_info_bar_instance_init (GamesErrorInfoBar * self) {
	self->priv = GAMES_ERROR_INFO_BAR_GET_PRIVATE (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}


static void games_error_info_bar_finalize (GObject * obj) {
	GamesErrorInfoBar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_ERROR_INFO_BAR, GamesErrorInfoBar);
	_g_object_unref0 (self->priv->label);
	G_OBJECT_CLASS (games_error_info_bar_parent_class)->finalize (obj);
}


GType games_error_info_bar_get_type (void) {
	static volatile gsize games_error_info_bar_type_id__volatile = 0;
	if (g_once_init_enter (&games_error_info_bar_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GamesErrorInfoBarClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) games_error_info_bar_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GamesErrorInfoBar), 0, (GInstanceInitFunc) games_error_info_bar_instance_init, NULL };
		GType games_error_info_bar_type_id;
		games_error_info_bar_type_id = g_type_register_static (gtk_info_bar_get_type (), "GamesErrorInfoBar", &g_define_type_info, 0);
		g_once_init_leave (&games_error_info_bar_type_id__volatile, games_error_info_bar_type_id);
	}
	return games_error_info_bar_type_id__volatile;
}


static void _vala_games_error_info_bar_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	GamesErrorInfoBar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GAMES_TYPE_ERROR_INFO_BAR, GamesErrorInfoBar);
	switch (property_id) {
		case GAMES_ERROR_INFO_BAR_MESSAGE_PROPERTY:
		games_error_info_bar_set_message (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}



