/* generic-title.c generated by valac 0.36.6.6-c7bee, the Vala compiler
 * generated from generic-title.vala, do not modify */

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

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


#define GAMES_TYPE_TITLE (games_title_get_type ())
#define GAMES_TITLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_TITLE, GamesTitle))
#define GAMES_IS_TITLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_TITLE))
#define GAMES_TITLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GAMES_TYPE_TITLE, GamesTitleIface))

typedef struct _GamesTitle GamesTitle;
typedef struct _GamesTitleIface GamesTitleIface;

#define GAMES_TYPE_GENERIC_TITLE (games_generic_title_get_type ())
#define GAMES_GENERIC_TITLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_GENERIC_TITLE, GamesGenericTitle))
#define GAMES_GENERIC_TITLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_GENERIC_TITLE, GamesGenericTitleClass))
#define GAMES_IS_GENERIC_TITLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_GENERIC_TITLE))
#define GAMES_IS_GENERIC_TITLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_GENERIC_TITLE))
#define GAMES_GENERIC_TITLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_GENERIC_TITLE, GamesGenericTitleClass))

typedef struct _GamesGenericTitle GamesGenericTitle;
typedef struct _GamesGenericTitleClass GamesGenericTitleClass;
typedef struct _GamesGenericTitlePrivate GamesGenericTitlePrivate;
#define _g_free0(var) (var = (g_free (var), NULL))

struct _GamesTitleIface {
	GTypeInterface parent_iface;
	gchar* (*get_title) (GamesTitle* self, GError** error);
};

struct _GamesGenericTitle {
	GObject parent_instance;
	GamesGenericTitlePrivate * priv;
};

struct _GamesGenericTitleClass {
	GObjectClass parent_class;
};

struct _GamesGenericTitlePrivate {
	gchar* title;
};


static gpointer games_generic_title_parent_class = NULL;
static GamesTitleIface * games_generic_title_games_title_parent_iface = NULL;

GType games_title_get_type (void) G_GNUC_CONST;
GType games_generic_title_get_type (void) G_GNUC_CONST;
#define GAMES_GENERIC_TITLE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GAMES_TYPE_GENERIC_TITLE, GamesGenericTitlePrivate))
enum  {
	GAMES_GENERIC_TITLE_0_PROPERTY
};
GamesGenericTitle* games_generic_title_new (const gchar* title);
GamesGenericTitle* games_generic_title_construct (GType object_type, const gchar* title);
static gchar* games_generic_title_real_get_title (GamesTitle* base, GError** error);
static void games_generic_title_finalize (GObject * obj);


GamesGenericTitle* games_generic_title_construct (GType object_type, const gchar* title) {
	GamesGenericTitle * self = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (title != NULL, NULL);
	self = (GamesGenericTitle*) g_object_new (object_type, NULL);
	_tmp0_ = title;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->priv->title);
	self->priv->title = _tmp1_;
	return self;
}


GamesGenericTitle* games_generic_title_new (const gchar* title) {
	return games_generic_title_construct (GAMES_TYPE_GENERIC_TITLE, title);
}


static gchar* games_generic_title_real_get_title (GamesTitle* base, GError** error) {
	GamesGenericTitle * self;
	gchar* result = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	self = (GamesGenericTitle*) base;
	_tmp0_ = self->priv->title;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}


static void games_generic_title_class_init (GamesGenericTitleClass * klass) {
	games_generic_title_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GamesGenericTitlePrivate));
	G_OBJECT_CLASS (klass)->finalize = games_generic_title_finalize;
}


static void games_generic_title_games_title_interface_init (GamesTitleIface * iface) {
	games_generic_title_games_title_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_title = (gchar* (*) (GamesTitle *, GError**)) games_generic_title_real_get_title;
}


static void games_generic_title_instance_init (GamesGenericTitle * self) {
	self->priv = GAMES_GENERIC_TITLE_GET_PRIVATE (self);
}


static void games_generic_title_finalize (GObject * obj) {
	GamesGenericTitle * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_GENERIC_TITLE, GamesGenericTitle);
	_g_free0 (self->priv->title);
	G_OBJECT_CLASS (games_generic_title_parent_class)->finalize (obj);
}


GType games_generic_title_get_type (void) {
	static volatile gsize games_generic_title_type_id__volatile = 0;
	if (g_once_init_enter (&games_generic_title_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GamesGenericTitleClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) games_generic_title_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GamesGenericTitle), 0, (GInstanceInitFunc) games_generic_title_instance_init, NULL };
		static const GInterfaceInfo games_title_info = { (GInterfaceInitFunc) games_generic_title_games_title_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType games_generic_title_type_id;
		games_generic_title_type_id = g_type_register_static (G_TYPE_OBJECT, "GamesGenericTitle", &g_define_type_info, 0);
		g_type_add_interface_static (games_generic_title_type_id, GAMES_TYPE_TITLE, &games_title_info);
		g_once_init_leave (&games_generic_title_type_id__volatile, games_generic_title_type_id);
	}
	return games_generic_title_type_id__volatile;
}



