/* preferences-switch-item.c generated by valac 0.35.5, the Vala compiler
 * generated from preferences-switch-item.vala, do not modify */

/* This file is part of GNOME Games. License: GPLv3*/

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


#define GAMES_TYPE_PREFERENCES_SWITCH_ITEM (games_preferences_switch_item_get_type ())
#define GAMES_PREFERENCES_SWITCH_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_PREFERENCES_SWITCH_ITEM, GamesPreferencesSwitchItem))
#define GAMES_PREFERENCES_SWITCH_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_PREFERENCES_SWITCH_ITEM, GamesPreferencesSwitchItemClass))
#define GAMES_IS_PREFERENCES_SWITCH_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_PREFERENCES_SWITCH_ITEM))
#define GAMES_IS_PREFERENCES_SWITCH_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_PREFERENCES_SWITCH_ITEM))
#define GAMES_PREFERENCES_SWITCH_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_PREFERENCES_SWITCH_ITEM, GamesPreferencesSwitchItemClass))

typedef struct _GamesPreferencesSwitchItem GamesPreferencesSwitchItem;
typedef struct _GamesPreferencesSwitchItemClass GamesPreferencesSwitchItemClass;
typedef struct _GamesPreferencesSwitchItemPrivate GamesPreferencesSwitchItemPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _GamesPreferencesSwitchItem {
	GtkBox parent_instance;
	GamesPreferencesSwitchItemPrivate * priv;
};

struct _GamesPreferencesSwitchItemClass {
	GtkBoxClass parent_class;
};

struct _GamesPreferencesSwitchItemPrivate {
	GtkLabel* title_label;
	GtkImage* select_image;
};


static gpointer games_preferences_switch_item_parent_class = NULL;

GType games_preferences_switch_item_get_type (void) G_GNUC_CONST;
#define GAMES_PREFERENCES_SWITCH_ITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GAMES_TYPE_PREFERENCES_SWITCH_ITEM, GamesPreferencesSwitchItemPrivate))
enum  {
	GAMES_PREFERENCES_SWITCH_ITEM_DUMMY_PROPERTY
};
GamesPreferencesSwitchItem* games_preferences_switch_item_new (const gchar* name);
GamesPreferencesSwitchItem* games_preferences_switch_item_construct (GType object_type, const gchar* name);
void games_preferences_switch_item_switch_activate (GamesPreferencesSwitchItem* self);
void games_preferences_switch_item_switch_deactivate (GamesPreferencesSwitchItem* self);
static void games_preferences_switch_item_finalize (GObject * obj);


GamesPreferencesSwitchItem* games_preferences_switch_item_construct (GType object_type, const gchar* name) {
	GamesPreferencesSwitchItem * self = NULL;
	GtkLabel* _tmp0_;
	const gchar* _tmp1_;
	g_return_val_if_fail (name != NULL, NULL);
	self = (GamesPreferencesSwitchItem*) g_object_new (object_type, NULL);
	_tmp0_ = self->priv->title_label;
	_tmp1_ = name;
	gtk_label_set_label (_tmp0_, _tmp1_);
	return self;
}


GamesPreferencesSwitchItem* games_preferences_switch_item_new (const gchar* name) {
	return games_preferences_switch_item_construct (GAMES_TYPE_PREFERENCES_SWITCH_ITEM, name);
}


void games_preferences_switch_item_switch_activate (GamesPreferencesSwitchItem* self) {
	GtkImage* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->select_image;
	gtk_widget_show ((GtkWidget*) _tmp0_);
}


void games_preferences_switch_item_switch_deactivate (GamesPreferencesSwitchItem* self) {
	GtkImage* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->select_image;
	gtk_widget_hide ((GtkWidget*) _tmp0_);
}


static void games_preferences_switch_item_class_init (GamesPreferencesSwitchItemClass * klass) {
	gint GamesPreferencesSwitchItem_private_offset;
	games_preferences_switch_item_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GamesPreferencesSwitchItemPrivate));
	G_OBJECT_CLASS (klass)->finalize = games_preferences_switch_item_finalize;
	GamesPreferencesSwitchItem_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/preferences-switch-item.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "title_label", FALSE, GamesPreferencesSwitchItem_private_offset + G_STRUCT_OFFSET (GamesPreferencesSwitchItemPrivate, title_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "select_image", FALSE, GamesPreferencesSwitchItem_private_offset + G_STRUCT_OFFSET (GamesPreferencesSwitchItemPrivate, select_image));
}


static void games_preferences_switch_item_instance_init (GamesPreferencesSwitchItem * self) {
	self->priv = GAMES_PREFERENCES_SWITCH_ITEM_GET_PRIVATE (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}


static void games_preferences_switch_item_finalize (GObject * obj) {
	GamesPreferencesSwitchItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_PREFERENCES_SWITCH_ITEM, GamesPreferencesSwitchItem);
	_g_object_unref0 (self->priv->title_label);
	_g_object_unref0 (self->priv->select_image);
	G_OBJECT_CLASS (games_preferences_switch_item_parent_class)->finalize (obj);
}


GType games_preferences_switch_item_get_type (void) {
	static volatile gsize games_preferences_switch_item_type_id__volatile = 0;
	if (g_once_init_enter (&games_preferences_switch_item_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GamesPreferencesSwitchItemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) games_preferences_switch_item_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GamesPreferencesSwitchItem), 0, (GInstanceInitFunc) games_preferences_switch_item_instance_init, NULL };
		GType games_preferences_switch_item_type_id;
		games_preferences_switch_item_type_id = g_type_register_static (gtk_box_get_type (), "GamesPreferencesSwitchItem", &g_define_type_info, 0);
		g_once_init_leave (&games_preferences_switch_item_type_id__volatile, games_preferences_switch_item_type_id);
	}
	return games_preferences_switch_item_type_id__volatile;
}



