/* generic-uid.c generated by valac 0.36.12.13-3ae08, the Vala compiler
 * generated from generic-uid.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_UID (games_uid_get_type ())
#define GAMES_UID(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_UID, GamesUid))
#define GAMES_IS_UID(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_UID))
#define GAMES_UID_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GAMES_TYPE_UID, GamesUidIface))

typedef struct _GamesUid GamesUid;
typedef struct _GamesUidIface GamesUidIface;

#define GAMES_TYPE_GENERIC_UID (games_generic_uid_get_type ())
#define GAMES_GENERIC_UID(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_GENERIC_UID, GamesGenericUid))
#define GAMES_GENERIC_UID_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_GENERIC_UID, GamesGenericUidClass))
#define GAMES_IS_GENERIC_UID(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_GENERIC_UID))
#define GAMES_IS_GENERIC_UID_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_GENERIC_UID))
#define GAMES_GENERIC_UID_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_GENERIC_UID, GamesGenericUidClass))

typedef struct _GamesGenericUid GamesGenericUid;
typedef struct _GamesGenericUidClass GamesGenericUidClass;
typedef struct _GamesGenericUidPrivate GamesGenericUidPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))

struct _GamesUidIface {
	GTypeInterface parent_iface;
	gchar* (*get_uid) (GamesUid* self, GError** error);
};

struct _GamesGenericUid {
	GObject parent_instance;
	GamesGenericUidPrivate * priv;
};

struct _GamesGenericUidClass {
	GObjectClass parent_class;
};

struct _GamesGenericUidPrivate {
	gchar* uid;
};


static gpointer games_generic_uid_parent_class = NULL;
static GamesUidIface * games_generic_uid_games_uid_parent_iface = NULL;

GType games_uid_get_type (void) G_GNUC_CONST;
GType games_generic_uid_get_type (void) G_GNUC_CONST;
#define GAMES_GENERIC_UID_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GAMES_TYPE_GENERIC_UID, GamesGenericUidPrivate))
enum  {
	GAMES_GENERIC_UID_0_PROPERTY
};
GamesGenericUid* games_generic_uid_new (const gchar* uid);
GamesGenericUid* games_generic_uid_construct (GType object_type, const gchar* uid);
static gchar* games_generic_uid_real_get_uid (GamesUid* base, GError** error);
static void games_generic_uid_finalize (GObject * obj);


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


GamesGenericUid* games_generic_uid_new (const gchar* uid) {
	return games_generic_uid_construct (GAMES_TYPE_GENERIC_UID, uid);
}


static gchar* games_generic_uid_real_get_uid (GamesUid* base, GError** error) {
	GamesGenericUid * self;
	gchar* result = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	self = (GamesGenericUid*) base;
	_tmp0_ = self->priv->uid;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}


static void games_generic_uid_class_init (GamesGenericUidClass * klass) {
	games_generic_uid_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GamesGenericUidPrivate));
	G_OBJECT_CLASS (klass)->finalize = games_generic_uid_finalize;
}


static void games_generic_uid_games_uid_interface_init (GamesUidIface * iface) {
	games_generic_uid_games_uid_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_uid = (gchar* (*) (GamesUid *, GError**)) games_generic_uid_real_get_uid;
}


static void games_generic_uid_instance_init (GamesGenericUid * self) {
	self->priv = GAMES_GENERIC_UID_GET_PRIVATE (self);
}


static void games_generic_uid_finalize (GObject * obj) {
	GamesGenericUid * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_GENERIC_UID, GamesGenericUid);
	_g_free0 (self->priv->uid);
	G_OBJECT_CLASS (games_generic_uid_parent_class)->finalize (obj);
}


GType games_generic_uid_get_type (void) {
	static volatile gsize games_generic_uid_type_id__volatile = 0;
	if (g_once_init_enter (&games_generic_uid_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GamesGenericUidClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) games_generic_uid_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GamesGenericUid), 0, (GInstanceInitFunc) games_generic_uid_instance_init, NULL };
		static const GInterfaceInfo games_uid_info = { (GInterfaceInitFunc) games_generic_uid_games_uid_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType games_generic_uid_type_id;
		games_generic_uid_type_id = g_type_register_static (G_TYPE_OBJECT, "GamesGenericUid", &g_define_type_info, 0);
		g_type_add_interface_static (games_generic_uid_type_id, GAMES_TYPE_UID, &games_uid_info);
		g_once_init_leave (&games_generic_uid_type_id__volatile, games_generic_uid_type_id);
	}
	return games_generic_uid_type_id__volatile;
}



