/* dummy-game.c generated by valac 0.35.5, the Vala compiler
 * generated from dummy-game.vala, do not modify */

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

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


#define GAMES_TYPE_GAME (games_game_get_type ())
#define GAMES_GAME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_GAME, GamesGame))
#define GAMES_IS_GAME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_GAME))
#define GAMES_GAME_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GAMES_TYPE_GAME, GamesGameIface))

typedef struct _GamesGame GamesGame;
typedef struct _GamesGameIface GamesGameIface;

#define GAMES_TYPE_ICON (games_icon_get_type ())
#define GAMES_ICON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_ICON, GamesIcon))
#define GAMES_IS_ICON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_ICON))
#define GAMES_ICON_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GAMES_TYPE_ICON, GamesIconIface))

typedef struct _GamesIcon GamesIcon;
typedef struct _GamesIconIface GamesIconIface;

#define GAMES_TYPE_COVER (games_cover_get_type ())
#define GAMES_COVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_COVER, GamesCover))
#define GAMES_IS_COVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_COVER))
#define GAMES_COVER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GAMES_TYPE_COVER, GamesCoverIface))

typedef struct _GamesCover GamesCover;
typedef struct _GamesCoverIface GamesCoverIface;

#define GAMES_TYPE_RUNNER (games_runner_get_type ())
#define GAMES_RUNNER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_RUNNER, GamesRunner))
#define GAMES_IS_RUNNER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_RUNNER))
#define GAMES_RUNNER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GAMES_TYPE_RUNNER, GamesRunnerIface))

typedef struct _GamesRunner GamesRunner;
typedef struct _GamesRunnerIface GamesRunnerIface;

#define GAMES_TYPE_MEDIA_SET (games_media_set_get_type ())
#define GAMES_MEDIA_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_MEDIA_SET, GamesMediaSet))
#define GAMES_MEDIA_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_MEDIA_SET, GamesMediaSetClass))
#define GAMES_IS_MEDIA_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_MEDIA_SET))
#define GAMES_IS_MEDIA_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_MEDIA_SET))
#define GAMES_MEDIA_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_MEDIA_SET, GamesMediaSetClass))

typedef struct _GamesMediaSet GamesMediaSet;
typedef struct _GamesMediaSetClass GamesMediaSetClass;

#define GAMES_TYPE_DUMMY_GAME (games_dummy_game_get_type ())
#define GAMES_DUMMY_GAME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_DUMMY_GAME, GamesDummyGame))
#define GAMES_DUMMY_GAME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_DUMMY_GAME, GamesDummyGameClass))
#define GAMES_IS_DUMMY_GAME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_DUMMY_GAME))
#define GAMES_IS_DUMMY_GAME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_DUMMY_GAME))
#define GAMES_DUMMY_GAME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_DUMMY_GAME, GamesDummyGameClass))

typedef struct _GamesDummyGame GamesDummyGame;
typedef struct _GamesDummyGameClass GamesDummyGameClass;
typedef struct _GamesDummyGamePrivate GamesDummyGamePrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define GAMES_TYPE_DUMMY_ICON (games_dummy_icon_get_type ())
#define GAMES_DUMMY_ICON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_DUMMY_ICON, GamesDummyIcon))
#define GAMES_DUMMY_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_DUMMY_ICON, GamesDummyIconClass))
#define GAMES_IS_DUMMY_ICON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_DUMMY_ICON))
#define GAMES_IS_DUMMY_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_DUMMY_ICON))
#define GAMES_DUMMY_ICON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_DUMMY_ICON, GamesDummyIconClass))

typedef struct _GamesDummyIcon GamesDummyIcon;
typedef struct _GamesDummyIconClass GamesDummyIconClass;

#define GAMES_TYPE_DUMMY_COVER (games_dummy_cover_get_type ())
#define GAMES_DUMMY_COVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_DUMMY_COVER, GamesDummyCover))
#define GAMES_DUMMY_COVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_DUMMY_COVER, GamesDummyCoverClass))
#define GAMES_IS_DUMMY_COVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_DUMMY_COVER))
#define GAMES_IS_DUMMY_COVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_DUMMY_COVER))
#define GAMES_DUMMY_COVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_DUMMY_COVER, GamesDummyCoverClass))

typedef struct _GamesDummyCover GamesDummyCover;
typedef struct _GamesDummyCoverClass GamesDummyCoverClass;

#define GAMES_TYPE_DUMMY_RUNNER (games_dummy_runner_get_type ())
#define GAMES_DUMMY_RUNNER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_DUMMY_RUNNER, GamesDummyRunner))
#define GAMES_DUMMY_RUNNER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_DUMMY_RUNNER, GamesDummyRunnerClass))
#define GAMES_IS_DUMMY_RUNNER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_DUMMY_RUNNER))
#define GAMES_IS_DUMMY_RUNNER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_DUMMY_RUNNER))
#define GAMES_DUMMY_RUNNER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_DUMMY_RUNNER, GamesDummyRunnerClass))

typedef struct _GamesDummyRunner GamesDummyRunner;
typedef struct _GamesDummyRunnerClass GamesDummyRunnerClass;

struct _GamesIconIface {
	GTypeInterface parent_iface;
	GIcon* (*get_icon) (GamesIcon* self);
};

struct _GamesCoverIface {
	GTypeInterface parent_iface;
	GIcon* (*get_cover) (GamesCover* self);
};

struct _GamesRunnerIface {
	GTypeInterface parent_iface;
	gboolean (*check_is_valid) (GamesRunner* self, gchar* * error_message, GError** error);
	GtkWidget* (*get_display) (GamesRunner* self);
	void (*start) (GamesRunner* self, GError** error);
	void (*resume) (GamesRunner* self, GError** error);
	void (*pause) (GamesRunner* self);
	void (*stop) (GamesRunner* self);
	gboolean (*get_can_fullscreen) (GamesRunner* self);
	gboolean (*get_can_quit_safely) (GamesRunner* self);
	gboolean (*get_can_resume) (GamesRunner* self);
	GamesMediaSet* (*get_media_set) (GamesRunner* self);
};

struct _GamesGameIface {
	GTypeInterface parent_iface;
	GamesIcon* (*get_icon) (GamesGame* self);
	GamesCover* (*get_cover) (GamesGame* self);
	GamesRunner* (*get_runner) (GamesGame* self, GError** error);
	const gchar* (*get_name) (GamesGame* self);
};

struct _GamesDummyGame {
	GObject parent_instance;
	GamesDummyGamePrivate * priv;
};

struct _GamesDummyGameClass {
	GObjectClass parent_class;
};

struct _GamesDummyGamePrivate {
	gchar* _name;
};


static gpointer games_dummy_game_parent_class = NULL;
static GamesGameIface * games_dummy_game_games_game_parent_iface = NULL;

GType games_icon_get_type (void) G_GNUC_CONST;
GType games_cover_get_type (void) G_GNUC_CONST;
GType games_media_set_get_type (void) G_GNUC_CONST;
GType games_runner_get_type (void) G_GNUC_CONST;
GType games_game_get_type (void) G_GNUC_CONST;
GType games_dummy_game_get_type (void) G_GNUC_CONST;
#define GAMES_DUMMY_GAME_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GAMES_TYPE_DUMMY_GAME, GamesDummyGamePrivate))
enum  {
	GAMES_DUMMY_GAME_DUMMY_PROPERTY,
	GAMES_DUMMY_GAME_NAME
};
GamesDummyGame* games_dummy_game_new (const gchar* name);
GamesDummyGame* games_dummy_game_construct (GType object_type, const gchar* name);
GamesDummyGame* games_dummy_game_new_for_uri (const gchar* uri);
GamesDummyGame* games_dummy_game_construct_for_uri (GType object_type, const gchar* uri);
static GamesIcon* games_dummy_game_real_get_icon (GamesGame* base);
GamesDummyIcon* games_dummy_icon_new (void);
GamesDummyIcon* games_dummy_icon_construct (GType object_type);
GType games_dummy_icon_get_type (void) G_GNUC_CONST;
static GamesCover* games_dummy_game_real_get_cover (GamesGame* base);
GamesDummyCover* games_dummy_cover_new (void);
GamesDummyCover* games_dummy_cover_construct (GType object_type);
GType games_dummy_cover_get_type (void) G_GNUC_CONST;
static GamesRunner* games_dummy_game_real_get_runner (GamesGame* base, GError** error);
GamesDummyRunner* games_dummy_runner_new (void);
GamesDummyRunner* games_dummy_runner_construct (GType object_type);
GType games_dummy_runner_get_type (void) G_GNUC_CONST;
static void games_dummy_game_finalize (GObject * obj);
const gchar* games_game_get_name (GamesGame* self);
static void _vala_games_dummy_game_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
static gint _vala_array_length (gpointer array);


GamesDummyGame* games_dummy_game_construct (GType object_type, const gchar* name) {
	GamesDummyGame * self = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (name != NULL, NULL);
	self = (GamesDummyGame*) g_object_new (object_type, NULL);
	_tmp0_ = name;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->priv->_name);
	self->priv->_name = _tmp1_;
	return self;
}


GamesDummyGame* games_dummy_game_new (const gchar* name) {
	return games_dummy_game_construct (GAMES_TYPE_DUMMY_GAME, name);
}


static gchar* string_strip (const gchar* self) {
	gchar* result = NULL;
	gchar* _result_;
	gchar* _tmp0_;
	const gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	_tmp1_ = _result_;
	g_strstrip (_tmp1_);
	result = _result_;
	return result;
}


GamesDummyGame* games_dummy_game_construct_for_uri (GType object_type, const gchar* uri) {
	GamesDummyGame * self = NULL;
	GFile* file;
	const gchar* _tmp0_;
	GFile* _tmp1_;
	gchar* name;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar** _tmp4_;
	gchar** _tmp5_;
	gchar** _tmp6_;
	gint _tmp6__length1;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	const gchar* _tmp9_;
	gchar** _tmp10_;
	gchar** _tmp11_;
	gchar** _tmp12_;
	gint _tmp12__length1;
	const gchar* _tmp13_;
	gchar* _tmp14_;
	const gchar* _tmp15_;
	gchar* _tmp16_;
	g_return_val_if_fail (uri != NULL, NULL);
	self = (GamesDummyGame*) g_object_new (object_type, NULL);
	_tmp0_ = uri;
	_tmp1_ = g_file_new_for_uri (_tmp0_);
	file = _tmp1_;
	_tmp2_ = g_file_get_basename (file);
	name = _tmp2_;
	_tmp3_ = name;
	_tmp5_ = _tmp4_ = g_strsplit (_tmp3_, ".", 0);
	_tmp6_ = _tmp5_;
	_tmp6__length1 = _vala_array_length (_tmp4_);
	_tmp7_ = _tmp6_[0];
	_tmp8_ = g_strdup (_tmp7_);
	_g_free0 (name);
	name = _tmp8_;
	_tmp6_ = (_vala_array_free (_tmp6_, _tmp6__length1, (GDestroyNotify) g_free), NULL);
	_tmp9_ = name;
	_tmp11_ = _tmp10_ = g_strsplit (_tmp9_, "(", 0);
	_tmp12_ = _tmp11_;
	_tmp12__length1 = _vala_array_length (_tmp10_);
	_tmp13_ = _tmp12_[0];
	_tmp14_ = g_strdup (_tmp13_);
	_g_free0 (name);
	name = _tmp14_;
	_tmp12_ = (_vala_array_free (_tmp12_, _tmp12__length1, (GDestroyNotify) g_free), NULL);
	_tmp15_ = name;
	_tmp16_ = string_strip (_tmp15_);
	_g_free0 (self->priv->_name);
	self->priv->_name = _tmp16_;
	_g_free0 (name);
	_g_object_unref0 (file);
	return self;
}


GamesDummyGame* games_dummy_game_new_for_uri (const gchar* uri) {
	return games_dummy_game_construct_for_uri (GAMES_TYPE_DUMMY_GAME, uri);
}


static GamesIcon* games_dummy_game_real_get_icon (GamesGame* base) {
	GamesDummyGame * self;
	GamesIcon* result = NULL;
	GamesDummyIcon* _tmp0_;
	self = (GamesDummyGame*) base;
	_tmp0_ = games_dummy_icon_new ();
	result = (GamesIcon*) _tmp0_;
	return result;
}


static GamesCover* games_dummy_game_real_get_cover (GamesGame* base) {
	GamesDummyGame * self;
	GamesCover* result = NULL;
	GamesDummyCover* _tmp0_;
	self = (GamesDummyGame*) base;
	_tmp0_ = games_dummy_cover_new ();
	result = (GamesCover*) _tmp0_;
	return result;
}


static GamesRunner* games_dummy_game_real_get_runner (GamesGame* base, GError** error) {
	GamesDummyGame * self;
	GamesRunner* result = NULL;
	GamesDummyRunner* _tmp0_;
	self = (GamesDummyGame*) base;
	_tmp0_ = games_dummy_runner_new ();
	result = (GamesRunner*) _tmp0_;
	return result;
}


static const gchar* games_dummy_game_real_get_name (GamesGame* base) {
	const gchar* result;
	GamesDummyGame* self;
	const gchar* _tmp0_;
	self = (GamesDummyGame*) base;
	_tmp0_ = self->priv->_name;
	result = _tmp0_;
	return result;
}


static void games_dummy_game_class_init (GamesDummyGameClass * klass) {
	games_dummy_game_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GamesDummyGamePrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_games_dummy_game_get_property;
	G_OBJECT_CLASS (klass)->finalize = games_dummy_game_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_DUMMY_GAME_NAME, g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
}


static void games_dummy_game_games_game_interface_init (GamesGameIface * iface) {
	games_dummy_game_games_game_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_icon = (GamesIcon* (*) (GamesGame *)) games_dummy_game_real_get_icon;
	iface->get_cover = (GamesCover* (*) (GamesGame *)) games_dummy_game_real_get_cover;
	iface->get_runner = (GamesRunner* (*) (GamesGame *, GError**)) games_dummy_game_real_get_runner;
	iface->get_name = games_dummy_game_real_get_name;
}


static void games_dummy_game_instance_init (GamesDummyGame * self) {
	self->priv = GAMES_DUMMY_GAME_GET_PRIVATE (self);
}


static void games_dummy_game_finalize (GObject * obj) {
	GamesDummyGame * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_DUMMY_GAME, GamesDummyGame);
	_g_free0 (self->priv->_name);
	G_OBJECT_CLASS (games_dummy_game_parent_class)->finalize (obj);
}


GType games_dummy_game_get_type (void) {
	static volatile gsize games_dummy_game_type_id__volatile = 0;
	if (g_once_init_enter (&games_dummy_game_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GamesDummyGameClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) games_dummy_game_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GamesDummyGame), 0, (GInstanceInitFunc) games_dummy_game_instance_init, NULL };
		static const GInterfaceInfo games_game_info = { (GInterfaceInitFunc) games_dummy_game_games_game_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType games_dummy_game_type_id;
		games_dummy_game_type_id = g_type_register_static (G_TYPE_OBJECT, "GamesDummyGame", &g_define_type_info, 0);
		g_type_add_interface_static (games_dummy_game_type_id, GAMES_TYPE_GAME, &games_game_info);
		g_once_init_leave (&games_dummy_game_type_id__volatile, games_dummy_game_type_id);
	}
	return games_dummy_game_type_id__volatile;
}


static void _vala_games_dummy_game_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	GamesDummyGame * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GAMES_TYPE_DUMMY_GAME, GamesDummyGame);
	switch (property_id) {
		case GAMES_DUMMY_GAME_NAME:
		g_value_set_string (value, games_game_get_name ((GamesGame*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}


static gint _vala_array_length (gpointer array) {
	int length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}



