/* generic-uri-game-factory.c generated by valac 0.36.6.6-c7bee, the Vala compiler
 * generated from generic-uri-game-factory.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>
#include <gio/gio.h>
#include <gtk/gtk.h>


#define GAMES_TYPE_URI_GAME_FACTORY (games_uri_game_factory_get_type ())
#define GAMES_URI_GAME_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_URI_GAME_FACTORY, GamesUriGameFactory))
#define GAMES_IS_URI_GAME_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_URI_GAME_FACTORY))
#define GAMES_URI_GAME_FACTORY_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GAMES_TYPE_URI_GAME_FACTORY, GamesUriGameFactoryIface))

typedef struct _GamesUriGameFactory GamesUriGameFactory;
typedef struct _GamesUriGameFactoryIface GamesUriGameFactoryIface;

#define GAMES_TYPE_URI (games_uri_get_type ())
#define GAMES_URI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_URI, GamesUri))
#define GAMES_URI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_URI, GamesUriClass))
#define GAMES_IS_URI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_URI))
#define GAMES_IS_URI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_URI))
#define GAMES_URI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_URI, GamesUriClass))

typedef struct _GamesUri GamesUri;
typedef struct _GamesUriClass GamesUriClass;

#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_GENERIC_URI_GAME_FACTORY (games_generic_uri_game_factory_get_type ())
#define GAMES_GENERIC_URI_GAME_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_GENERIC_URI_GAME_FACTORY, GamesGenericUriGameFactory))
#define GAMES_GENERIC_URI_GAME_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_GENERIC_URI_GAME_FACTORY, GamesGenericUriGameFactoryClass))
#define GAMES_IS_GENERIC_URI_GAME_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_GENERIC_URI_GAME_FACTORY))
#define GAMES_IS_GENERIC_URI_GAME_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_GENERIC_URI_GAME_FACTORY))
#define GAMES_GENERIC_URI_GAME_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_GENERIC_URI_GAME_FACTORY, GamesGenericUriGameFactoryClass))

typedef struct _GamesGenericUriGameFactory GamesGenericUriGameFactory;
typedef struct _GamesGenericUriGameFactoryClass GamesGenericUriGameFactoryClass;
typedef struct _GamesGenericUriGameFactoryPrivate GamesGenericUriGameFactoryPrivate;

#define GAMES_TYPE_GAME_URI_ADAPTER (games_game_uri_adapter_get_type ())
#define GAMES_GAME_URI_ADAPTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_GAME_URI_ADAPTER, GamesGameUriAdapter))
#define GAMES_IS_GAME_URI_ADAPTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_GAME_URI_ADAPTER))
#define GAMES_GAME_URI_ADAPTER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GAMES_TYPE_GAME_URI_ADAPTER, GamesGameUriAdapterIface))

typedef struct _GamesGameUriAdapter GamesGameUriAdapter;
typedef struct _GamesGameUriAdapterIface GamesGameUriAdapterIface;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _games_uri_unref0(var) ((var == NULL) ? NULL : (var = (games_uri_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _GamesGenericUriGameFactoryAddUriData GamesGenericUriGameFactoryAddUriData;
typedef struct _GamesGenericUriGameFactoryQueryGameForUriData GamesGenericUriGameFactoryQueryGameForUriData;
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
typedef struct _GamesGenericUriGameFactoryForeachGameData GamesGenericUriGameFactoryForeachGameData;

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);
};

typedef void (*GamesGameCallback) (GamesGame* game, void* user_data);
struct _GamesUriGameFactoryIface {
	GTypeInterface parent_iface;
	gchar** (*get_mime_types) (GamesUriGameFactory* self, int* result_length1);
	gchar** (*get_schemes) (GamesUriGameFactory* self, int* result_length1);
	void (*add_uri) (GamesUriGameFactory* self, GamesUri* uri, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*add_uri_finish) (GamesUriGameFactory* self, GAsyncResult* _res_);
	void (*query_game_for_uri) (GamesUriGameFactory* self, GamesUri* uri, GAsyncReadyCallback _callback_, gpointer _user_data_);
	GamesGame* (*query_game_for_uri_finish) (GamesUriGameFactory* self, GAsyncResult* _res_);
	void (*foreach_game) (GamesUriGameFactory* self, GamesGameCallback game_callback, void* game_callback_target, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*foreach_game_finish) (GamesUriGameFactory* self, GAsyncResult* _res_);
};

struct _GamesGenericUriGameFactory {
	GObject parent_instance;
	GamesGenericUriGameFactoryPrivate * priv;
};

struct _GamesGenericUriGameFactoryClass {
	GObjectClass parent_class;
};

struct _GamesGameUriAdapterIface {
	GTypeInterface parent_iface;
	void (*game_for_uri) (GamesGameUriAdapter* self, GamesUri* uri, GAsyncReadyCallback _callback_, gpointer _user_data_);
	GamesGame* (*game_for_uri_finish) (GamesGameUriAdapter* self, GAsyncResult* _res_, GError** error);
};

struct _GamesGenericUriGameFactoryPrivate {
	GamesGameUriAdapter* game_uri_adapter;
	GHashTable* game_for_uri;
	gchar** mime_types;
	gint mime_types_length1;
	gint _mime_types_size_;
	gchar** schemes;
	gint schemes_length1;
	gint _schemes_size_;
};

struct _GamesGenericUriGameFactoryAddUriData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GAsyncReadyCallback _callback_;
	gboolean _task_complete_;
	GamesGenericUriGameFactory* self;
	GamesUri* uri;
	GHashTable* _tmp0_;
	GamesUri* _tmp1_;
	gboolean _tmp2_;
	GamesGame* game;
	GamesGameUriAdapter* _tmp3_;
	GamesUri* _tmp4_;
	GamesGame* _tmp5_;
	GHashTable* _tmp6_;
	GamesUri* _tmp7_;
	GamesUri* _tmp8_;
	GamesGame* _tmp9_;
	GamesGame* _tmp10_;
	GamesGame* _tmp11_;
	GError* e;
	GError* _tmp12_;
	const gchar* _tmp13_;
	GError * _inner_error_;
};

struct _GamesGenericUriGameFactoryQueryGameForUriData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GAsyncReadyCallback _callback_;
	gboolean _task_complete_;
	GamesGenericUriGameFactory* self;
	GamesUri* uri;
	GamesGame* result;
	GHashTable* _tmp0_;
	GamesUri* _tmp1_;
	gboolean _tmp2_;
	GHashTable* _tmp3_;
	GamesUri* _tmp4_;
	gconstpointer _tmp5_;
	GamesGame* _tmp6_;
};

struct _GamesGenericUriGameFactoryForeachGameData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GAsyncReadyCallback _callback_;
	gboolean _task_complete_;
	GamesGenericUriGameFactory* self;
	GamesGameCallback game_callback;
	gpointer game_callback_target;
	guint handled_uris;
	GList* games;
	GHashTable* _tmp0_;
	GList* _tmp1_;
	GList* game;
	GList* _tmp2_;
	gboolean _tmp3_;
	GList* _tmp4_;
	GList* _tmp5_;
	GList* _tmp6_;
	GamesGameCallback _tmp7_;
	void* _tmp7__target;
	GList* _tmp8_;
	gconstpointer _tmp9_;
	guint _tmp10_;
};


static gpointer games_generic_uri_game_factory_parent_class = NULL;
static GamesUriGameFactoryIface * games_generic_uri_game_factory_games_uri_game_factory_parent_iface = NULL;

gpointer games_uri_ref (gpointer instance);
void games_uri_unref (gpointer instance);
GParamSpec* games_param_spec_uri (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void games_value_set_uri (GValue* value, gpointer v_object);
void games_value_take_uri (GValue* value, gpointer v_object);
gpointer games_value_get_uri (const GValue* value);
GType games_uri_get_type (void) G_GNUC_CONST;
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_uri_game_factory_get_type (void) G_GNUC_CONST;
GType games_generic_uri_game_factory_get_type (void) G_GNUC_CONST;
GType games_game_uri_adapter_get_type (void) G_GNUC_CONST;
#define GAMES_GENERIC_URI_GAME_FACTORY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GAMES_TYPE_GENERIC_URI_GAME_FACTORY, GamesGenericUriGameFactoryPrivate))
enum  {
	GAMES_GENERIC_URI_GAME_FACTORY_0_PROPERTY
};
#define GAMES_GENERIC_URI_GAME_FACTORY_GAMES_PER_CYCLE ((guint) 4)
GamesGenericUriGameFactory* games_generic_uri_game_factory_new (GamesGameUriAdapter* game_uri_adapter);
GamesGenericUriGameFactory* games_generic_uri_game_factory_construct (GType object_type, GamesGameUriAdapter* game_uri_adapter);
guint games_uri_hash (GamesUri* uri);
static guint _games_uri_hash_ghash_func (gconstpointer key);
gboolean games_uri_equal (GamesUri* a, GamesUri* b);
static gboolean _games_uri_equal_gequal_func (gconstpointer a, gconstpointer b);
static void _games_uri_unref0_ (gpointer var);
static void _g_object_unref0_ (gpointer var);
static gchar** games_generic_uri_game_factory_real_get_mime_types (GamesUriGameFactory* base, int* result_length1);
static gchar** _vala_array_dup5 (gchar** self, int length);
void games_generic_uri_game_factory_add_mime_type (GamesGenericUriGameFactory* self, const gchar* mime_type);
static void _vala_array_add10 (gchar** * array, int* length, int* size, gchar* value);
static gchar** games_generic_uri_game_factory_real_get_schemes (GamesUriGameFactory* base, int* result_length1);
static gchar** _vala_array_dup6 (gchar** self, int length);
void games_generic_uri_game_factory_add_scheme (GamesGenericUriGameFactory* self, const gchar* scheme);
static void _vala_array_add11 (gchar** * array, int* length, int* size, gchar* value);
static void games_generic_uri_game_factory_real_add_uri_data_free (gpointer _data);
static void games_generic_uri_game_factory_real_add_uri_async_ready_wrapper (GObject *source_object, GAsyncResult *res, void *user_data);
static void games_generic_uri_game_factory_real_add_uri (GamesUriGameFactory* base, GamesUri* uri, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean games_generic_uri_game_factory_real_add_uri_co (GamesGenericUriGameFactoryAddUriData* _data_);
void games_uri_game_factory_add_uri (GamesUriGameFactory* self, GamesUri* uri, GAsyncReadyCallback _callback_, gpointer _user_data_);
void games_uri_game_factory_add_uri_finish (GamesUriGameFactory* self, GAsyncResult* _res_);
static gboolean _games_generic_uri_game_factory_real_add_uri_co_gsource_func (gpointer self);
void games_game_uri_adapter_game_for_uri (GamesGameUriAdapter* self, GamesUri* uri, GAsyncReadyCallback _callback_, gpointer _user_data_);
GamesGame* games_game_uri_adapter_game_for_uri_finish (GamesGameUriAdapter* self, GAsyncResult* _res_, GError** error);
static void games_generic_uri_game_factory_add_uri_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void games_generic_uri_game_factory_real_query_game_for_uri_data_free (gpointer _data);
static void games_generic_uri_game_factory_real_query_game_for_uri_async_ready_wrapper (GObject *source_object, GAsyncResult *res, void *user_data);
static void games_generic_uri_game_factory_real_query_game_for_uri (GamesUriGameFactory* base, GamesUri* uri, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean games_generic_uri_game_factory_real_query_game_for_uri_co (GamesGenericUriGameFactoryQueryGameForUriData* _data_);
void games_uri_game_factory_query_game_for_uri (GamesUriGameFactory* self, GamesUri* uri, GAsyncReadyCallback _callback_, gpointer _user_data_);
GamesGame* games_uri_game_factory_query_game_for_uri_finish (GamesUriGameFactory* self, GAsyncResult* _res_);
static gboolean _games_generic_uri_game_factory_real_query_game_for_uri_co_gsource_func (gpointer self);
static void games_generic_uri_game_factory_real_foreach_game_data_free (gpointer _data);
static void games_generic_uri_game_factory_real_foreach_game_async_ready_wrapper (GObject *source_object, GAsyncResult *res, void *user_data);
static void games_generic_uri_game_factory_real_foreach_game (GamesUriGameFactory* base, GamesGameCallback game_callback, void* game_callback_target, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean games_generic_uri_game_factory_real_foreach_game_co (GamesGenericUriGameFactoryForeachGameData* _data_);
void games_uri_game_factory_foreach_game (GamesUriGameFactory* self, GamesGameCallback game_callback, void* game_callback_target, GAsyncReadyCallback _callback_, gpointer _user_data_);
void games_uri_game_factory_foreach_game_finish (GamesUriGameFactory* self, GAsyncResult* _res_);
static gboolean _games_generic_uri_game_factory_real_foreach_game_co_gsource_func (gpointer self);
static void games_generic_uri_game_factory_finalize (GObject * obj);
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 gpointer _g_object_ref0 (gpointer self) {
	return self ? g_object_ref (self) : NULL;
}


static guint _games_uri_hash_ghash_func (gconstpointer key) {
	guint result;
	result = games_uri_hash ((GamesUri*) key);
	return result;
}


static gboolean _games_uri_equal_gequal_func (gconstpointer a, gconstpointer b) {
	gboolean result;
	result = games_uri_equal ((GamesUri*) a, (GamesUri*) b);
	return result;
}


static void _games_uri_unref0_ (gpointer var) {
	(var == NULL) ? NULL : (var = (games_uri_unref (var), NULL));
}


static void _g_object_unref0_ (gpointer var) {
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}


GamesGenericUriGameFactory* games_generic_uri_game_factory_construct (GType object_type, GamesGameUriAdapter* game_uri_adapter) {
	GamesGenericUriGameFactory * self = NULL;
	GamesGameUriAdapter* _tmp0_;
	GamesGameUriAdapter* _tmp1_;
	GHashTable* _tmp2_;
	gchar** _tmp3_;
	gchar** _tmp4_;
	g_return_val_if_fail (game_uri_adapter != NULL, NULL);
	self = (GamesGenericUriGameFactory*) g_object_new (object_type, NULL);
	_tmp0_ = game_uri_adapter;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->game_uri_adapter);
	self->priv->game_uri_adapter = _tmp1_;
	_tmp2_ = g_hash_table_new_full (_games_uri_hash_ghash_func, _games_uri_equal_gequal_func, _games_uri_unref0_, _g_object_unref0_);
	_g_hash_table_unref0 (self->priv->game_for_uri);
	self->priv->game_for_uri = _tmp2_;
	_tmp3_ = g_new0 (gchar*, 0 + 1);
	self->priv->mime_types = (_vala_array_free (self->priv->mime_types, self->priv->mime_types_length1, (GDestroyNotify) g_free), NULL);
	self->priv->mime_types = _tmp3_;
	self->priv->mime_types_length1 = 0;
	self->priv->_mime_types_size_ = self->priv->mime_types_length1;
	_tmp4_ = g_new0 (gchar*, 0 + 1);
	self->priv->schemes = (_vala_array_free (self->priv->schemes, self->priv->schemes_length1, (GDestroyNotify) g_free), NULL);
	self->priv->schemes = _tmp4_;
	self->priv->schemes_length1 = 0;
	self->priv->_schemes_size_ = self->priv->schemes_length1;
	return self;
}


GamesGenericUriGameFactory* games_generic_uri_game_factory_new (GamesGameUriAdapter* game_uri_adapter) {
	return games_generic_uri_game_factory_construct (GAMES_TYPE_GENERIC_URI_GAME_FACTORY, game_uri_adapter);
}


static gchar** _vala_array_dup5 (gchar** self, int length) {
	gchar** result;
	int i;
	result = g_new0 (gchar*, length + 1);
	for (i = 0; i < length; i++) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (self[i]);
		result[i] = _tmp0_;
	}
	return result;
}


static gchar** games_generic_uri_game_factory_real_get_mime_types (GamesUriGameFactory* base, int* result_length1) {
	GamesGenericUriGameFactory * self;
	gchar** result = NULL;
	gchar** _tmp0_;
	gint _tmp0__length1;
	gchar** _tmp1_;
	gint _tmp1__length1;
	gchar** _tmp2_;
	gint _tmp2__length1;
	self = (GamesGenericUriGameFactory*) base;
	_tmp0_ = self->priv->mime_types;
	_tmp0__length1 = self->priv->mime_types_length1;
	_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup5 (_tmp0_, _tmp0__length1) : ((gpointer) _tmp0_);
	_tmp1__length1 = _tmp0__length1;
	_tmp2_ = _tmp1_;
	_tmp2__length1 = _tmp1__length1;
	if (result_length1) {
		*result_length1 = _tmp2__length1;
	}
	result = _tmp2_;
	return result;
}


static void _vala_array_add10 (gchar** * array, int* length, int* size, gchar* value) {
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}


void games_generic_uri_game_factory_add_mime_type (GamesGenericUriGameFactory* self, const gchar* mime_type) {
	gchar** _tmp0_;
	gint _tmp0__length1;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (mime_type != NULL);
	_tmp0_ = self->priv->mime_types;
	_tmp0__length1 = self->priv->mime_types_length1;
	_tmp1_ = mime_type;
	_tmp2_ = g_strdup (_tmp1_);
	_vala_array_add10 (&self->priv->mime_types, &self->priv->mime_types_length1, &self->priv->_mime_types_size_, _tmp2_);
}


static gchar** _vala_array_dup6 (gchar** self, int length) {
	gchar** result;
	int i;
	result = g_new0 (gchar*, length + 1);
	for (i = 0; i < length; i++) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (self[i]);
		result[i] = _tmp0_;
	}
	return result;
}


static gchar** games_generic_uri_game_factory_real_get_schemes (GamesUriGameFactory* base, int* result_length1) {
	GamesGenericUriGameFactory * self;
	gchar** result = NULL;
	gchar** _tmp0_;
	gint _tmp0__length1;
	gchar** _tmp1_;
	gint _tmp1__length1;
	gchar** _tmp2_;
	gint _tmp2__length1;
	self = (GamesGenericUriGameFactory*) base;
	_tmp0_ = self->priv->schemes;
	_tmp0__length1 = self->priv->schemes_length1;
	_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup6 (_tmp0_, _tmp0__length1) : ((gpointer) _tmp0_);
	_tmp1__length1 = _tmp0__length1;
	_tmp2_ = _tmp1_;
	_tmp2__length1 = _tmp1__length1;
	if (result_length1) {
		*result_length1 = _tmp2__length1;
	}
	result = _tmp2_;
	return result;
}


static void _vala_array_add11 (gchar** * array, int* length, int* size, gchar* value) {
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}


void games_generic_uri_game_factory_add_scheme (GamesGenericUriGameFactory* self, const gchar* scheme) {
	gchar** _tmp0_;
	gint _tmp0__length1;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (scheme != NULL);
	_tmp0_ = self->priv->schemes;
	_tmp0__length1 = self->priv->schemes_length1;
	_tmp1_ = scheme;
	_tmp2_ = g_strdup (_tmp1_);
	_vala_array_add11 (&self->priv->schemes, &self->priv->schemes_length1, &self->priv->_schemes_size_, _tmp2_);
}


static void games_generic_uri_game_factory_real_add_uri_data_free (gpointer _data) {
	GamesGenericUriGameFactoryAddUriData* _data_;
	_data_ = _data;
	_games_uri_unref0 (_data_->uri);
	_g_object_unref0 (_data_->self);
	g_slice_free (GamesGenericUriGameFactoryAddUriData, _data_);
}


static void games_generic_uri_game_factory_real_add_uri_async_ready_wrapper (GObject *source_object, GAsyncResult *res, void *user_data) {
	GamesGenericUriGameFactoryAddUriData* _task_data_;
	_task_data_ = g_task_get_task_data (G_TASK (res));
	if (_task_data_->_callback_ != NULL) {
		_task_data_->_callback_ (source_object, res, user_data);
	}
	_task_data_->_task_complete_ = TRUE;
}


static gpointer _games_uri_ref0 (gpointer self) {
	return self ? games_uri_ref (self) : NULL;
}


static void games_generic_uri_game_factory_real_add_uri (GamesUriGameFactory* base, GamesUri* uri, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	GamesGenericUriGameFactory * self;
	GamesGenericUriGameFactoryAddUriData* _data_;
	GamesGenericUriGameFactory* _tmp0_;
	GamesUri* _tmp1_;
	GamesUri* _tmp2_;
	self = (GamesGenericUriGameFactory*) base;
	_data_ = g_slice_new0 (GamesGenericUriGameFactoryAddUriData);
	_data_->_callback_ = _callback_;
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, games_generic_uri_game_factory_real_add_uri_async_ready_wrapper, _user_data_);
	if (_callback_ == NULL) {
		_data_->_task_complete_ = TRUE;
	}
	g_task_set_task_data (_data_->_async_result, _data_, games_generic_uri_game_factory_real_add_uri_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = uri;
	_tmp2_ = _games_uri_ref0 (_tmp1_);
	_games_uri_unref0 (_data_->uri);
	_data_->uri = _tmp2_;
	games_generic_uri_game_factory_real_add_uri_co (_data_);
}


static void games_generic_uri_game_factory_real_add_uri_finish (GamesUriGameFactory* base, GAsyncResult* _res_) {
	GamesGenericUriGameFactoryAddUriData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}


static gboolean _games_generic_uri_game_factory_real_add_uri_co_gsource_func (gpointer self) {
	gboolean result;
	result = games_generic_uri_game_factory_real_add_uri_co (self);
	return result;
}


static void games_generic_uri_game_factory_add_uri_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	GamesGenericUriGameFactoryAddUriData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_data_->_task_complete_ = TRUE;
	games_generic_uri_game_factory_real_add_uri_co (_data_);
}


static gboolean games_generic_uri_game_factory_real_add_uri_co (GamesGenericUriGameFactoryAddUriData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _games_generic_uri_game_factory_real_add_uri_co_gsource_func, _data_, NULL);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	_data_->_tmp0_ = _data_->self->priv->game_for_uri;
	_data_->_tmp1_ = _data_->uri;
	_data_->_tmp2_ = g_hash_table_contains (_data_->_tmp0_, _data_->_tmp1_);
	if (_data_->_tmp2_) {
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (_data_->_task_complete_ != TRUE) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	{
		_data_->_tmp3_ = _data_->self->priv->game_uri_adapter;
		_data_->_tmp4_ = _data_->uri;
		_data_->_state_ = 2;
		games_game_uri_adapter_game_for_uri (_data_->_tmp3_, _data_->_tmp4_, games_generic_uri_game_factory_add_uri_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp5_ = games_game_uri_adapter_game_for_uri_finish (_data_->_tmp3_, _data_->_res_, &_data_->_inner_error_);
		_data_->game = _data_->_tmp5_;
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
			goto __catch8_g_error;
		}
		_data_->_tmp6_ = _data_->self->priv->game_for_uri;
		_data_->_tmp7_ = _data_->uri;
		_data_->_tmp8_ = _games_uri_ref0 (_data_->_tmp7_);
		_data_->_tmp9_ = _data_->game;
		_data_->_tmp10_ = _g_object_ref0 (_data_->_tmp9_);
		g_hash_table_insert (_data_->_tmp6_, _data_->_tmp8_, _data_->_tmp10_);
		_data_->_tmp11_ = _data_->game;
		g_signal_emit_by_name ((GamesUriGameFactory*) _data_->self, "game-added", _data_->_tmp11_);
		_g_object_unref0 (_data_->game);
	}
	goto __finally8;
	__catch8_g_error:
	{
		_data_->e = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp12_ = _data_->e;
		_data_->_tmp13_ = _data_->_tmp12_->message;
		g_debug ("generic-uri-game-factory.vala:48: %s", _data_->_tmp13_);
		_g_error_free0 (_data_->e);
	}
	__finally8:
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
		g_clear_error (&_data_->_inner_error_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (_data_->_task_complete_ != TRUE) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void games_generic_uri_game_factory_real_query_game_for_uri_data_free (gpointer _data) {
	GamesGenericUriGameFactoryQueryGameForUriData* _data_;
	_data_ = _data;
	_games_uri_unref0 (_data_->uri);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (GamesGenericUriGameFactoryQueryGameForUriData, _data_);
}


static void games_generic_uri_game_factory_real_query_game_for_uri_async_ready_wrapper (GObject *source_object, GAsyncResult *res, void *user_data) {
	GamesGenericUriGameFactoryQueryGameForUriData* _task_data_;
	_task_data_ = g_task_get_task_data (G_TASK (res));
	if (_task_data_->_callback_ != NULL) {
		_task_data_->_callback_ (source_object, res, user_data);
	}
	_task_data_->_task_complete_ = TRUE;
}


static void games_generic_uri_game_factory_real_query_game_for_uri (GamesUriGameFactory* base, GamesUri* uri, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	GamesGenericUriGameFactory * self;
	GamesGenericUriGameFactoryQueryGameForUriData* _data_;
	GamesGenericUriGameFactory* _tmp0_;
	GamesUri* _tmp1_;
	GamesUri* _tmp2_;
	self = (GamesGenericUriGameFactory*) base;
	_data_ = g_slice_new0 (GamesGenericUriGameFactoryQueryGameForUriData);
	_data_->_callback_ = _callback_;
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, games_generic_uri_game_factory_real_query_game_for_uri_async_ready_wrapper, _user_data_);
	if (_callback_ == NULL) {
		_data_->_task_complete_ = TRUE;
	}
	g_task_set_task_data (_data_->_async_result, _data_, games_generic_uri_game_factory_real_query_game_for_uri_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = uri;
	_tmp2_ = _games_uri_ref0 (_tmp1_);
	_games_uri_unref0 (_data_->uri);
	_data_->uri = _tmp2_;
	games_generic_uri_game_factory_real_query_game_for_uri_co (_data_);
}


static GamesGame* games_generic_uri_game_factory_real_query_game_for_uri_finish (GamesUriGameFactory* base, GAsyncResult* _res_) {
	GamesGame* result;
	GamesGenericUriGameFactoryQueryGameForUriData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static gboolean _games_generic_uri_game_factory_real_query_game_for_uri_co_gsource_func (gpointer self) {
	gboolean result;
	result = games_generic_uri_game_factory_real_query_game_for_uri_co (self);
	return result;
}


static gboolean games_generic_uri_game_factory_real_query_game_for_uri_co (GamesGenericUriGameFactoryQueryGameForUriData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _games_generic_uri_game_factory_real_query_game_for_uri_co_gsource_func, _data_, NULL);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	_data_->_tmp0_ = _data_->self->priv->game_for_uri;
	_data_->_tmp1_ = _data_->uri;
	_data_->_tmp2_ = g_hash_table_contains (_data_->_tmp0_, _data_->_tmp1_);
	if (_data_->_tmp2_) {
		_data_->_tmp3_ = _data_->self->priv->game_for_uri;
		_data_->_tmp4_ = _data_->uri;
		_data_->_tmp5_ = g_hash_table_lookup (_data_->_tmp3_, _data_->_tmp4_);
		_data_->_tmp6_ = _g_object_ref0 ((GamesGame*) _data_->_tmp5_);
		_data_->result = _data_->_tmp6_;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (_data_->_task_complete_ != TRUE) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->result = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (_data_->_task_complete_ != TRUE) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void games_generic_uri_game_factory_real_foreach_game_data_free (gpointer _data) {
	GamesGenericUriGameFactoryForeachGameData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (GamesGenericUriGameFactoryForeachGameData, _data_);
}


static void games_generic_uri_game_factory_real_foreach_game_async_ready_wrapper (GObject *source_object, GAsyncResult *res, void *user_data) {
	GamesGenericUriGameFactoryForeachGameData* _task_data_;
	_task_data_ = g_task_get_task_data (G_TASK (res));
	if (_task_data_->_callback_ != NULL) {
		_task_data_->_callback_ (source_object, res, user_data);
	}
	_task_data_->_task_complete_ = TRUE;
}


static void games_generic_uri_game_factory_real_foreach_game (GamesUriGameFactory* base, GamesGameCallback game_callback, void* game_callback_target, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	GamesGenericUriGameFactory * self;
	GamesGenericUriGameFactoryForeachGameData* _data_;
	GamesGenericUriGameFactory* _tmp0_;
	GamesGameCallback _tmp1_;
	void* _tmp1__target;
	self = (GamesGenericUriGameFactory*) base;
	_data_ = g_slice_new0 (GamesGenericUriGameFactoryForeachGameData);
	_data_->_callback_ = _callback_;
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, games_generic_uri_game_factory_real_foreach_game_async_ready_wrapper, _user_data_);
	if (_callback_ == NULL) {
		_data_->_task_complete_ = TRUE;
	}
	g_task_set_task_data (_data_->_async_result, _data_, games_generic_uri_game_factory_real_foreach_game_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = game_callback;
	_tmp1__target = game_callback_target;
	_data_->game_callback = _tmp1_;
	_data_->game_callback_target = _tmp1__target;
	games_generic_uri_game_factory_real_foreach_game_co (_data_);
}


static void games_generic_uri_game_factory_real_foreach_game_finish (GamesUriGameFactory* base, GAsyncResult* _res_) {
	GamesGenericUriGameFactoryForeachGameData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}


static gboolean _games_generic_uri_game_factory_real_foreach_game_co_gsource_func (gpointer self) {
	gboolean result;
	result = games_generic_uri_game_factory_real_foreach_game_co (self);
	return result;
}


static gboolean games_generic_uri_game_factory_real_foreach_game_co (GamesGenericUriGameFactoryForeachGameData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->handled_uris = (guint) 0;
	_data_->_tmp0_ = _data_->self->priv->game_for_uri;
	_data_->_tmp1_ = g_hash_table_get_values (_data_->_tmp0_);
	_data_->games = _data_->_tmp1_;
	{
		_data_->_tmp2_ = _data_->games;
		_data_->game = _data_->_tmp2_;
		{
			_data_->_tmp3_ = TRUE;
			while (TRUE) {
				if (!_data_->_tmp3_) {
					_data_->_tmp4_ = _data_->game;
					_data_->_tmp5_ = _data_->_tmp4_->next;
					_data_->game = _data_->_tmp5_;
				}
				_data_->_tmp3_ = FALSE;
				_data_->_tmp6_ = _data_->game;
				if (!(_data_->_tmp6_ != NULL)) {
					break;
				}
				_data_->_tmp7_ = _data_->game_callback;
				_data_->_tmp7__target = _data_->game_callback_target;
				_data_->_tmp8_ = _data_->game;
				_data_->_tmp9_ = _data_->_tmp8_->data;
				_data_->_tmp7_ ((GamesGame*) _data_->_tmp9_, _data_->_tmp7__target);
				_data_->_tmp10_ = _data_->handled_uris;
				_data_->handled_uris = _data_->_tmp10_ + 1;
				if (_data_->_tmp10_ < GAMES_GENERIC_URI_GAME_FACTORY_GAMES_PER_CYCLE) {
					continue;
				}
				_data_->handled_uris = (guint) 0;
				g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _games_generic_uri_game_factory_real_foreach_game_co_gsource_func, _data_, NULL);
				_data_->_state_ = 1;
				return FALSE;
				_state_1:
				;
			}
		}
	}
	_g_list_free0 (_data_->games);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (_data_->_task_complete_ != TRUE) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void games_generic_uri_game_factory_class_init (GamesGenericUriGameFactoryClass * klass) {
	games_generic_uri_game_factory_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GamesGenericUriGameFactoryPrivate));
	G_OBJECT_CLASS (klass)->finalize = games_generic_uri_game_factory_finalize;
}


static void games_generic_uri_game_factory_games_uri_game_factory_interface_init (GamesUriGameFactoryIface * iface) {
	games_generic_uri_game_factory_games_uri_game_factory_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_mime_types = (gchar** (*) (GamesUriGameFactory *, int*)) games_generic_uri_game_factory_real_get_mime_types;
	iface->get_schemes = (gchar** (*) (GamesUriGameFactory *, int*)) games_generic_uri_game_factory_real_get_schemes;
	iface->add_uri = (void (*) (GamesUriGameFactory *, GamesUri*, GAsyncReadyCallback, gpointer)) games_generic_uri_game_factory_real_add_uri;
	iface->add_uri_finish = (void (*) (GamesUriGameFactory *, GAsyncResult*)) games_generic_uri_game_factory_real_add_uri_finish;
	iface->query_game_for_uri = (void (*) (GamesUriGameFactory *, GamesUri*, GAsyncReadyCallback, gpointer)) games_generic_uri_game_factory_real_query_game_for_uri;
	iface->query_game_for_uri_finish = (GamesGame* (*) (GamesUriGameFactory *, GAsyncResult*)) games_generic_uri_game_factory_real_query_game_for_uri_finish;
	iface->foreach_game = (void (*) (GamesUriGameFactory *, GamesGameCallback, void*, GAsyncReadyCallback, gpointer)) games_generic_uri_game_factory_real_foreach_game;
	iface->foreach_game_finish = (void (*) (GamesUriGameFactory *, GAsyncResult*)) games_generic_uri_game_factory_real_foreach_game_finish;
}


static void games_generic_uri_game_factory_instance_init (GamesGenericUriGameFactory * self) {
	self->priv = GAMES_GENERIC_URI_GAME_FACTORY_GET_PRIVATE (self);
}


static void games_generic_uri_game_factory_finalize (GObject * obj) {
	GamesGenericUriGameFactory * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_GENERIC_URI_GAME_FACTORY, GamesGenericUriGameFactory);
	_g_object_unref0 (self->priv->game_uri_adapter);
	_g_hash_table_unref0 (self->priv->game_for_uri);
	self->priv->mime_types = (_vala_array_free (self->priv->mime_types, self->priv->mime_types_length1, (GDestroyNotify) g_free), NULL);
	self->priv->schemes = (_vala_array_free (self->priv->schemes, self->priv->schemes_length1, (GDestroyNotify) g_free), NULL);
	G_OBJECT_CLASS (games_generic_uri_game_factory_parent_class)->finalize (obj);
}


GType games_generic_uri_game_factory_get_type (void) {
	static volatile gsize games_generic_uri_game_factory_type_id__volatile = 0;
	if (g_once_init_enter (&games_generic_uri_game_factory_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GamesGenericUriGameFactoryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) games_generic_uri_game_factory_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GamesGenericUriGameFactory), 0, (GInstanceInitFunc) games_generic_uri_game_factory_instance_init, NULL };
		static const GInterfaceInfo games_uri_game_factory_info = { (GInterfaceInitFunc) games_generic_uri_game_factory_games_uri_game_factory_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType games_generic_uri_game_factory_type_id;
		games_generic_uri_game_factory_type_id = g_type_register_static (G_TYPE_OBJECT, "GamesGenericUriGameFactory", &g_define_type_info, 0);
		g_type_add_interface_static (games_generic_uri_game_factory_type_id, GAMES_TYPE_URI_GAME_FACTORY, &games_uri_game_factory_info);
		g_once_init_leave (&games_generic_uri_game_factory_type_id__volatile, games_generic_uri_game_factory_type_id);
	}
	return games_generic_uri_game_factory_type_id__volatile;
}


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);
}



