/* rygel-external-plugin-factory.c generated by valac 0.25.1.16-16e7a, the Vala compiler
 * generated from rygel-external-plugin-factory.vala, do not modify */

/*
 * Copyright (C) 2009 Zeeshan Ali (Khattak) <zeeshanak@gnome.org>.
 * Copyright (C) 2009,2010 Nokia Corporation.
 *
 * Author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
 *                               <zeeshan.ali@nokia.com>
 *
 * This file is part of Rygel.
 *
 * Rygel is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Rygel is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */

#include <glib.h>
#include <glib-object.h>
#include <rygel-core.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
#include <stdlib.h>
#include <string.h>
#include <rygel-server.h>
#include <gobject/gvaluecollector.h>


#define RYGEL_EXTERNAL_TYPE_PLUGIN_FACTORY (rygel_external_plugin_factory_get_type ())
#define RYGEL_EXTERNAL_PLUGIN_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_EXTERNAL_TYPE_PLUGIN_FACTORY, RygelExternalPluginFactory))
#define RYGEL_EXTERNAL_PLUGIN_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_EXTERNAL_TYPE_PLUGIN_FACTORY, RygelExternalPluginFactoryClass))
#define RYGEL_EXTERNAL_IS_PLUGIN_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_EXTERNAL_TYPE_PLUGIN_FACTORY))
#define RYGEL_EXTERNAL_IS_PLUGIN_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_EXTERNAL_TYPE_PLUGIN_FACTORY))
#define RYGEL_EXTERNAL_PLUGIN_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_EXTERNAL_TYPE_PLUGIN_FACTORY, RygelExternalPluginFactoryClass))

typedef struct _RygelExternalPluginFactory RygelExternalPluginFactory;
typedef struct _RygelExternalPluginFactoryClass RygelExternalPluginFactoryClass;
#define _rygel_external_plugin_factory_unref0(var) ((var == NULL) ? NULL : (var = (rygel_external_plugin_factory_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _RygelExternalPluginFactoryPrivate RygelExternalPluginFactoryPrivate;

#define RYGEL_EXTERNAL_FREE_DESKTOP_TYPE_DBUS_OBJECT (rygel_external_free_desktop_dbus_object_get_type ())
#define RYGEL_EXTERNAL_FREE_DESKTOP_DBUS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_EXTERNAL_FREE_DESKTOP_TYPE_DBUS_OBJECT, RygelExternalFreeDesktopDBusObject))
#define RYGEL_EXTERNAL_FREE_DESKTOP_IS_DBUS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_EXTERNAL_FREE_DESKTOP_TYPE_DBUS_OBJECT))
#define RYGEL_EXTERNAL_FREE_DESKTOP_DBUS_OBJECT_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), RYGEL_EXTERNAL_FREE_DESKTOP_TYPE_DBUS_OBJECT, RygelExternalFreeDesktopDBusObjectIface))

typedef struct _RygelExternalFreeDesktopDBusObject RygelExternalFreeDesktopDBusObject;
typedef struct _RygelExternalFreeDesktopDBusObjectIface RygelExternalFreeDesktopDBusObjectIface;

#define RYGEL_EXTERNAL_FREE_DESKTOP_TYPE_DBUS_OBJECT_PROXY (rygel_external_free_desktop_dbus_object_proxy_get_type ())

#define RYGEL_EXTERNAL_TYPE_ICON_FACTORY (rygel_external_icon_factory_get_type ())
#define RYGEL_EXTERNAL_ICON_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_EXTERNAL_TYPE_ICON_FACTORY, RygelExternalIconFactory))
#define RYGEL_EXTERNAL_ICON_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_EXTERNAL_TYPE_ICON_FACTORY, RygelExternalIconFactoryClass))
#define RYGEL_EXTERNAL_IS_ICON_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_EXTERNAL_TYPE_ICON_FACTORY))
#define RYGEL_EXTERNAL_IS_ICON_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_EXTERNAL_TYPE_ICON_FACTORY))
#define RYGEL_EXTERNAL_ICON_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_EXTERNAL_TYPE_ICON_FACTORY, RygelExternalIconFactoryClass))

typedef struct _RygelExternalIconFactory RygelExternalIconFactory;
typedef struct _RygelExternalIconFactoryClass RygelExternalIconFactoryClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _rygel_external_icon_factory_unref0(var) ((var == NULL) ? NULL : (var = (rygel_external_icon_factory_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _RygelExternalPluginFactoryLoadPluginsData RygelExternalPluginFactoryLoadPluginsData;
typedef struct _RygelExternalPluginFactoryLoadActivatablePluginsData RygelExternalPluginFactoryLoadActivatablePluginsData;
typedef struct _RygelExternalPluginFactoryLoadPluginNHandleErrorData RygelExternalPluginFactoryLoadPluginNHandleErrorData;
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))

#define RYGEL_EXTERNAL_FREE_DESKTOP_TYPE_PROPERTIES (rygel_external_free_desktop_properties_get_type ())
#define RYGEL_EXTERNAL_FREE_DESKTOP_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_EXTERNAL_FREE_DESKTOP_TYPE_PROPERTIES, RygelExternalFreeDesktopProperties))
#define RYGEL_EXTERNAL_FREE_DESKTOP_IS_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_EXTERNAL_FREE_DESKTOP_TYPE_PROPERTIES))
#define RYGEL_EXTERNAL_FREE_DESKTOP_PROPERTIES_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), RYGEL_EXTERNAL_FREE_DESKTOP_TYPE_PROPERTIES, RygelExternalFreeDesktopPropertiesIface))

typedef struct _RygelExternalFreeDesktopProperties RygelExternalFreeDesktopProperties;
typedef struct _RygelExternalFreeDesktopPropertiesIface RygelExternalFreeDesktopPropertiesIface;

#define RYGEL_EXTERNAL_FREE_DESKTOP_TYPE_PROPERTIES_PROXY (rygel_external_free_desktop_properties_proxy_get_type ())
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))

#define RYGEL_EXTERNAL_TYPE_PLUGIN (rygel_external_plugin_get_type ())
#define RYGEL_EXTERNAL_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_EXTERNAL_TYPE_PLUGIN, RygelExternalPlugin))
#define RYGEL_EXTERNAL_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_EXTERNAL_TYPE_PLUGIN, RygelExternalPluginClass))
#define RYGEL_EXTERNAL_IS_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_EXTERNAL_TYPE_PLUGIN))
#define RYGEL_EXTERNAL_IS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_EXTERNAL_TYPE_PLUGIN))
#define RYGEL_EXTERNAL_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_EXTERNAL_TYPE_PLUGIN, RygelExternalPluginClass))

typedef struct _RygelExternalPlugin RygelExternalPlugin;
typedef struct _RygelExternalPluginClass RygelExternalPluginClass;
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
#define _rygel_icon_info_unref0(var) ((var == NULL) ? NULL : (var = (rygel_icon_info_unref (var), NULL)))
typedef struct _RygelExternalPluginFactoryLoadPluginData RygelExternalPluginFactoryLoadPluginData;
typedef struct _RygelExternalParamSpecPluginFactory RygelExternalParamSpecPluginFactory;

struct _RygelExternalPluginFactory {
	GTypeInstance parent_instance;
	volatile int ref_count;
	RygelExternalPluginFactoryPrivate * priv;
};

struct _RygelExternalPluginFactoryClass {
	GTypeClass parent_class;
	void (*finalize) (RygelExternalPluginFactory *self);
};

struct _RygelExternalFreeDesktopDBusObjectIface {
	GTypeInterface parent_iface;
	void (*list_names) (RygelExternalFreeDesktopDBusObject* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	gchar** (*list_names_finish) (RygelExternalFreeDesktopDBusObject* self, GAsyncResult* _res_, int* result_length1, GError** error);
	void (*list_activatable_names) (RygelExternalFreeDesktopDBusObject* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	gchar** (*list_activatable_names_finish) (RygelExternalFreeDesktopDBusObject* self, GAsyncResult* _res_, int* result_length1, GError** error);
};

struct _RygelExternalPluginFactoryPrivate {
	RygelExternalFreeDesktopDBusObject* dbus_obj;
	RygelPluginLoader* loader;
	RygelExternalIconFactory* icon_factory;
};

struct _RygelExternalPluginFactoryLoadPluginsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	RygelExternalPluginFactory* self;
	gchar** services;
	RygelExternalFreeDesktopDBusObject* _tmp0_;
	gint _tmp1_;
	gchar** _tmp2_;
	gint services_length1;
	gint _services_size_;
	gchar** _tmp3_;
	gint _tmp3__length1;
	gchar** service_collection;
	gint service_collection_length1;
	gint _service_collection_size_;
	gint service_it;
	gchar* _tmp4_;
	gchar* service;
	gboolean _tmp5_;
	const gchar* _tmp6_;
	gboolean _tmp7_;
	RygelPluginLoader* _tmp8_;
	const gchar* _tmp9_;
	RygelPlugin* _tmp10_;
	RygelPlugin* _tmp11_;
	const gchar* _tmp12_;
	GError * _inner_error_;
};

struct _RygelExternalPluginFactoryLoadActivatablePluginsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	RygelExternalPluginFactory* self;
	gchar** services;
	RygelExternalFreeDesktopDBusObject* _tmp0_;
	gint _tmp1_;
	gchar** _tmp2_;
	gint services_length1;
	gint _services_size_;
	gchar** service_collection;
	gint service_collection_length1;
	gint _service_collection_size_;
	gint service_it;
	gchar* _tmp3_;
	gchar* service;
	gboolean _tmp4_;
	const gchar* _tmp5_;
	gboolean _tmp6_;
	RygelPluginLoader* _tmp7_;
	const gchar* _tmp8_;
	RygelPlugin* _tmp9_;
	RygelPlugin* _tmp10_;
	const gchar* _tmp11_;
	RygelExternalFreeDesktopDBusObject* _tmp12_;
	GError * _inner_error_;
};

struct _RygelExternalPluginFactoryLoadPluginNHandleErrorData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	RygelExternalPluginFactory* self;
	gchar* service_name;
	const gchar* _tmp0_;
	GError* _error_;
	const gchar* _tmp1_;
	GError* _tmp2_;
	const gchar* _tmp3_;
	GError * _inner_error_;
};

struct _RygelExternalFreeDesktopPropertiesIface {
	GTypeInterface parent_iface;
	void (*get_all) (RygelExternalFreeDesktopProperties* self, const gchar* iface, GAsyncReadyCallback _callback_, gpointer _user_data_);
	GHashTable* (*get_all_finish) (RygelExternalFreeDesktopProperties* self, GAsyncResult* _res_, GError** error);
};

struct _RygelExternalPluginFactoryLoadPluginData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	RygelExternalPluginFactory* self;
	gchar* service_name;
	RygelPluginLoader* _tmp0_;
	const gchar* _tmp1_;
	gboolean _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	gboolean _tmp5_;
	gchar* root_object;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	RygelExternalFreeDesktopProperties* props;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	RygelExternalFreeDesktopProperties* _tmp13_;
	GHashTable* object_props;
	GHashTable* container_props;
	GHashTable* _tmp14_;
	RygelExternalFreeDesktopProperties* _tmp15_;
	GHashTable* _tmp16_;
	GHashTable* _tmp17_;
	GHashTable* _tmp18_;
	RygelExternalFreeDesktopProperties* _tmp19_;
	GHashTable* _tmp20_;
	GHashTable* _tmp21_;
	RygelIconInfo* icon;
	RygelExternalIconFactory* _tmp22_;
	const gchar* _tmp23_;
	GHashTable* _tmp24_;
	RygelIconInfo* _tmp25_;
	gchar* title;
	GVariant* value;
	GHashTable* _tmp26_;
	gconstpointer _tmp27_;
	GVariant* _tmp28_;
	GVariant* _tmp29_;
	GVariant* _tmp30_;
	gchar* _tmp31_;
	const gchar* _tmp32_;
	gchar* _tmp33_;
	guint child_count;
	GHashTable* _tmp34_;
	gconstpointer _tmp35_;
	guint _tmp36_;
	gboolean searchable;
	GHashTable* _tmp37_;
	gconstpointer _tmp38_;
	gboolean _tmp39_;
	RygelExternalPlugin* plugin;
	const gchar* _tmp40_;
	const gchar* _tmp41_;
	guint _tmp42_;
	gboolean _tmp43_;
	const gchar* _tmp44_;
	RygelIconInfo* _tmp45_;
	RygelExternalPlugin* _tmp46_;
	RygelPluginLoader* _tmp47_;
	RygelExternalPlugin* _tmp48_;
	GError* err;
	const gchar* _tmp49_;
	GError* _tmp50_;
	const gchar* _tmp51_;
	GError * _inner_error_;
};

struct _RygelExternalParamSpecPluginFactory {
	GParamSpec parent_instance;
};


extern RygelExternalPluginFactory* plugin_factory;
RygelExternalPluginFactory* plugin_factory = NULL;
static gpointer rygel_external_plugin_factory_parent_class = NULL;

gpointer rygel_external_plugin_factory_ref (gpointer instance);
void rygel_external_plugin_factory_unref (gpointer instance);
GParamSpec* rygel_external_param_spec_plugin_factory (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void rygel_external_value_set_plugin_factory (GValue* value, gpointer v_object);
void rygel_external_value_take_plugin_factory (GValue* value, gpointer v_object);
gpointer rygel_external_value_get_plugin_factory (const GValue* value);
GType rygel_external_plugin_factory_get_type (void) G_GNUC_CONST;
void module_init (RygelPluginLoader* loader);
RygelExternalPluginFactory* rygel_external_plugin_factory_new (RygelPluginLoader* loader, GError** error);
RygelExternalPluginFactory* rygel_external_plugin_factory_construct (GType object_type, RygelPluginLoader* loader, GError** error);
#define RYGEL_EXTERNAL_PLUGIN_MODULE_NAME "External"
GType rygel_external_free_desktop_dbus_object_proxy_get_type (void) G_GNUC_CONST;
guint rygel_external_free_desktop_dbus_object_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error);
GType rygel_external_free_desktop_dbus_object_get_type (void) G_GNUC_CONST;
gpointer rygel_external_icon_factory_ref (gpointer instance);
void rygel_external_icon_factory_unref (gpointer instance);
GParamSpec* rygel_external_param_spec_icon_factory (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void rygel_external_value_set_icon_factory (GValue* value, gpointer v_object);
void rygel_external_value_take_icon_factory (GValue* value, gpointer v_object);
gpointer rygel_external_value_get_icon_factory (const GValue* value);
GType rygel_external_icon_factory_get_type (void) G_GNUC_CONST;
#define RYGEL_EXTERNAL_PLUGIN_FACTORY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RYGEL_EXTERNAL_TYPE_PLUGIN_FACTORY, RygelExternalPluginFactoryPrivate))
enum  {
	RYGEL_EXTERNAL_PLUGIN_FACTORY_DUMMY_PROPERTY
};
#define RYGEL_EXTERNAL_PLUGIN_FACTORY_SERVICE_PREFIX "org.gnome.UPnP.MediaServer2."
#define RYGEL_EXTERNAL_PLUGIN_FACTORY_GRILO_UPNP_PREFIX RYGEL_EXTERNAL_PLUGIN_FACTORY_SERVICE_PREFIX "grl_upnp"
RygelExternalIconFactory* rygel_external_icon_factory_new (void);
RygelExternalIconFactory* rygel_external_icon_factory_construct (GType object_type);
#define RYGEL_EXTERNAL_FREE_DESKTOP_DBUS_SERVICE "org.freedesktop.DBus"
#define RYGEL_EXTERNAL_FREE_DESKTOP_DBUS_OBJECT_PATH "/org/freedesktop/DBus"
static void rygel_external_plugin_factory_load_plugins (RygelExternalPluginFactory* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void rygel_external_plugin_factory_load_plugins_finish (RygelExternalPluginFactory* self, GAsyncResult* _res_, GError** error);
static void rygel_external_plugin_factory_load_plugins_data_free (gpointer _data);
static gboolean rygel_external_plugin_factory_load_plugins_co (RygelExternalPluginFactoryLoadPluginsData* _data_);
void rygel_external_free_desktop_dbus_object_list_names (RygelExternalFreeDesktopDBusObject* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
gchar** rygel_external_free_desktop_dbus_object_list_names_finish (RygelExternalFreeDesktopDBusObject* self, GAsyncResult* _res_, int* result_length1, GError** error);
static void rygel_external_plugin_factory_load_plugins_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void rygel_external_plugin_factory_load_plugin_n_handle_error (RygelExternalPluginFactory* self, const gchar* service_name, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void rygel_external_plugin_factory_load_plugin_n_handle_error_finish (RygelExternalPluginFactory* self, GAsyncResult* _res_);
static void rygel_external_plugin_factory_load_activatable_plugins (RygelExternalPluginFactory* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void rygel_external_plugin_factory_load_activatable_plugins_finish (RygelExternalPluginFactory* self, GAsyncResult* _res_, GError** error);
static void rygel_external_plugin_factory_load_activatable_plugins_data_free (gpointer _data);
static gboolean rygel_external_plugin_factory_load_activatable_plugins_co (RygelExternalPluginFactoryLoadActivatablePluginsData* _data_);
void rygel_external_free_desktop_dbus_object_list_activatable_names (RygelExternalFreeDesktopDBusObject* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
gchar** rygel_external_free_desktop_dbus_object_list_activatable_names_finish (RygelExternalFreeDesktopDBusObject* self, GAsyncResult* _res_, int* result_length1, GError** error);
static void rygel_external_plugin_factory_load_activatable_plugins_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void rygel_external_plugin_factory_name_owner_changed (RygelExternalPluginFactory* self, RygelExternalFreeDesktopDBusObject* dbus_obj, const gchar* name, const gchar* old_owner, const gchar* new_owner);
static void _rygel_external_plugin_factory_name_owner_changed_rygel_external_free_desktop_dbus_object_name_owner_changed (RygelExternalFreeDesktopDBusObject* _sender, const gchar* name, const gchar* old_owner, const gchar* new_owner, gpointer self);
static void rygel_external_plugin_factory_load_plugin_n_handle_error_data_free (gpointer _data);
static gboolean rygel_external_plugin_factory_load_plugin_n_handle_error_co (RygelExternalPluginFactoryLoadPluginNHandleErrorData* _data_);
static void rygel_external_plugin_factory_load_plugin (RygelExternalPluginFactory* self, const gchar* service_name, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void rygel_external_plugin_factory_load_plugin_finish (RygelExternalPluginFactory* self, GAsyncResult* _res_, GError** error);
static void rygel_external_plugin_factory_load_plugin_n_handle_error_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void rygel_external_plugin_factory_load_plugin_data_free (gpointer _data);
static gboolean rygel_external_plugin_factory_load_plugin_co (RygelExternalPluginFactoryLoadPluginData* _data_);
GType rygel_external_free_desktop_properties_proxy_get_type (void) G_GNUC_CONST;
guint rygel_external_free_desktop_properties_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error);
GType rygel_external_free_desktop_properties_get_type (void) G_GNUC_CONST;
static void rygel_external_plugin_factory_load_plugin_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
void rygel_external_free_desktop_properties_get_all (RygelExternalFreeDesktopProperties* self, const gchar* iface, GAsyncReadyCallback _callback_, gpointer _user_data_);
GHashTable* rygel_external_free_desktop_properties_get_all_finish (RygelExternalFreeDesktopProperties* self, GAsyncResult* _res_, GError** error);
#define RYGEL_EXTERNAL_MEDIA_OBJECT_PROXY_IFACE "org.gnome.UPnP.MediaObject2"
#define RYGEL_EXTERNAL_MEDIA_CONTAINER_PROXY_IFACE "org.gnome.UPnP.MediaContainer2"
void rygel_external_icon_factory_create (RygelExternalIconFactory* self, const gchar* service_name, GHashTable* container_props, GAsyncReadyCallback _callback_, gpointer _user_data_);
RygelIconInfo* rygel_external_icon_factory_create_finish (RygelExternalIconFactory* self, GAsyncResult* _res_, GError** error);
static gchar* _variant_get25 (GVariant* value);
static guint _variant_get26 (GVariant* value);
static gboolean _variant_get27 (GVariant* value);
GType rygel_external_plugin_get_type (void) G_GNUC_CONST;
RygelExternalPlugin* rygel_external_plugin_new (const gchar* service_name, const gchar* title, guint child_count, gboolean searchable, const gchar* root_object, RygelIconInfo* icon, GError** error);
RygelExternalPlugin* rygel_external_plugin_construct (GType object_type, const gchar* service_name, const gchar* title, guint child_count, gboolean searchable, const gchar* root_object, RygelIconInfo* icon, GError** error);
static void rygel_external_plugin_factory_finalize (RygelExternalPluginFactory* 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);


void module_init (RygelPluginLoader* loader) {
	GError * _inner_error_ = NULL;
	g_return_if_fail (loader != NULL);
	{
		RygelExternalPluginFactory* _tmp0_ = NULL;
		RygelPluginLoader* _tmp1_ = NULL;
		RygelExternalPluginFactory* _tmp2_ = NULL;
		RygelExternalPluginFactory* _tmp3_ = NULL;
		_tmp1_ = loader;
		_tmp2_ = rygel_external_plugin_factory_new (_tmp1_, &_inner_error_);
		_tmp0_ = _tmp2_;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			goto __catch2_g_error;
		}
		_tmp3_ = _tmp0_;
		_tmp0_ = NULL;
		_rygel_external_plugin_factory_unref0 (plugin_factory);
		plugin_factory = _tmp3_;
		_rygel_external_plugin_factory_unref0 (_tmp0_);
	}
	goto __finally2;
	__catch2_g_error:
	{
		GError* _error_ = NULL;
		const gchar* _tmp4_ = NULL;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		_tmp4_ = _ ("Module '%s' could not connect to D-Bus session bus. " "Ignoring…");
		g_message (_tmp4_, RYGEL_EXTERNAL_PLUGIN_MODULE_NAME);
		_g_error_free0 (_error_);
	}
	__finally2:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
}


static gpointer _g_object_ref0 (gpointer self) {
	return self ? g_object_ref (self) : NULL;
}


RygelExternalPluginFactory* rygel_external_plugin_factory_construct (GType object_type, RygelPluginLoader* loader, GError** error) {
	RygelExternalPluginFactory* self = NULL;
	RygelExternalIconFactory* _tmp0_ = NULL;
	RygelExternalFreeDesktopDBusObject* _tmp1_ = NULL;
	RygelExternalFreeDesktopDBusObject* _tmp2_ = NULL;
	RygelExternalFreeDesktopDBusObject* _tmp3_ = NULL;
	RygelPluginLoader* _tmp4_ = NULL;
	RygelPluginLoader* _tmp5_ = NULL;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (loader != NULL, NULL);
	self = (RygelExternalPluginFactory*) g_type_create_instance (object_type);
	_tmp0_ = rygel_external_icon_factory_new ();
	_rygel_external_icon_factory_unref0 (self->priv->icon_factory);
	self->priv->icon_factory = _tmp0_;
	_tmp2_ = g_initable_new (RYGEL_EXTERNAL_FREE_DESKTOP_TYPE_DBUS_OBJECT_PROXY, NULL, &_inner_error_, "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, "g-name", RYGEL_EXTERNAL_FREE_DESKTOP_DBUS_SERVICE, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", RYGEL_EXTERNAL_FREE_DESKTOP_DBUS_OBJECT_PATH, "g-interface-name", "org.freedesktop.DBus", NULL);
	_tmp1_ = (RygelExternalFreeDesktopDBusObject*) _tmp2_;
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		if ((_inner_error_->domain == G_IO_ERROR) || (_inner_error_->domain == G_DBUS_ERROR)) {
			g_propagate_error (error, _inner_error_);
			_rygel_external_plugin_factory_unref0 (self);
			return NULL;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
	}
	_tmp3_ = _tmp1_;
	_tmp1_ = NULL;
	_g_object_unref0 (self->priv->dbus_obj);
	self->priv->dbus_obj = _tmp3_;
	_tmp4_ = loader;
	_tmp5_ = _g_object_ref0 (_tmp4_);
	_g_object_unref0 (self->priv->loader);
	self->priv->loader = _tmp5_;
	rygel_external_plugin_factory_load_plugins (self, NULL, NULL);
	_g_object_unref0 (_tmp1_);
	return self;
}


RygelExternalPluginFactory* rygel_external_plugin_factory_new (RygelPluginLoader* loader, GError** error) {
	return rygel_external_plugin_factory_construct (RYGEL_EXTERNAL_TYPE_PLUGIN_FACTORY, loader, error);
}


static void rygel_external_plugin_factory_load_plugins_data_free (gpointer _data) {
	RygelExternalPluginFactoryLoadPluginsData* _data_;
	_data_ = _data;
	_rygel_external_plugin_factory_unref0 (_data_->self);
	g_slice_free (RygelExternalPluginFactoryLoadPluginsData, _data_);
}


static gpointer _rygel_external_plugin_factory_ref0 (gpointer self) {
	return self ? rygel_external_plugin_factory_ref (self) : NULL;
}


static void rygel_external_plugin_factory_load_plugins (RygelExternalPluginFactory* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	RygelExternalPluginFactoryLoadPluginsData* _data_;
	RygelExternalPluginFactory* _tmp0_ = NULL;
	_data_ = g_slice_new0 (RygelExternalPluginFactoryLoadPluginsData);
	_data_->_async_result = g_simple_async_result_new (NULL, _callback_, _user_data_, rygel_external_plugin_factory_load_plugins);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, rygel_external_plugin_factory_load_plugins_data_free);
	_tmp0_ = _rygel_external_plugin_factory_ref0 (self);
	_data_->self = _tmp0_;
	rygel_external_plugin_factory_load_plugins_co (_data_);
}


static void rygel_external_plugin_factory_load_plugins_finish (RygelExternalPluginFactory* self, GAsyncResult* _res_, GError** error) {
	RygelExternalPluginFactoryLoadPluginsData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void rygel_external_plugin_factory_load_plugins_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	RygelExternalPluginFactoryLoadPluginsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	rygel_external_plugin_factory_load_plugins_co (_data_);
}


static gboolean rygel_external_plugin_factory_load_plugins_co (RygelExternalPluginFactoryLoadPluginsData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = NULL;
	_data_->_tmp0_ = _data_->self->priv->dbus_obj;
	_data_->_tmp1_ = 0;
	_data_->_state_ = 1;
	rygel_external_free_desktop_dbus_object_list_names (_data_->_tmp0_, rygel_external_plugin_factory_load_plugins_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp2_ = NULL;
	_data_->_tmp2_ = rygel_external_free_desktop_dbus_object_list_names_finish (_data_->_tmp0_, _data_->_res_, &_data_->_tmp1_, &_data_->_inner_error_);
	_data_->services_length1 = 0;
	_data_->_services_size_ = 0;
	_data_->services = _data_->_tmp2_;
	_data_->services_length1 = _data_->_tmp1_;
	_data_->_services_size_ = _data_->services_length1;
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if (_data_->_inner_error_->domain == G_DBUS_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			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_);
			return FALSE;
		}
	}
	_data_->_tmp3_ = NULL;
	_data_->_tmp3__length1 = 0;
	_data_->_tmp3_ = _data_->services;
	_data_->_tmp3__length1 = _data_->services_length1;
	{
		_data_->service_collection_length1 = 0;
		_data_->_service_collection_size_ = 0;
		_data_->service_collection = _data_->_tmp3_;
		_data_->service_collection_length1 = _data_->_tmp3__length1;
		for (_data_->service_it = 0; _data_->service_it < _data_->_tmp3__length1; _data_->service_it = _data_->service_it + 1) {
			_data_->_tmp4_ = NULL;
			_data_->_tmp4_ = g_strdup (_data_->service_collection[_data_->service_it]);
			_data_->service = _data_->_tmp4_;
			{
				_data_->_tmp6_ = NULL;
				_data_->_tmp6_ = _data_->service;
				_data_->_tmp7_ = FALSE;
				_data_->_tmp7_ = g_str_has_prefix (_data_->_tmp6_, RYGEL_EXTERNAL_PLUGIN_FACTORY_SERVICE_PREFIX);
				if (_data_->_tmp7_) {
					_data_->_tmp8_ = NULL;
					_data_->_tmp8_ = _data_->self->priv->loader;
					_data_->_tmp9_ = NULL;
					_data_->_tmp9_ = _data_->service;
					_data_->_tmp10_ = NULL;
					_data_->_tmp10_ = rygel_plugin_loader_get_plugin_by_name (_data_->_tmp8_, _data_->_tmp9_);
					_data_->_tmp11_ = NULL;
					_data_->_tmp11_ = _data_->_tmp10_;
					_data_->_tmp5_ = _data_->_tmp11_ == NULL;
					_g_object_unref0 (_data_->_tmp11_);
				} else {
					_data_->_tmp5_ = FALSE;
				}
				if (_data_->_tmp5_) {
					_data_->_tmp12_ = NULL;
					_data_->_tmp12_ = _data_->service;
					_data_->_state_ = 2;
					rygel_external_plugin_factory_load_plugin_n_handle_error (_data_->self, _data_->_tmp12_, rygel_external_plugin_factory_load_plugins_ready, _data_);
					return FALSE;
					_state_2:
					rygel_external_plugin_factory_load_plugin_n_handle_error_finish (_data_->self, _data_->_res_);
				}
				_g_free0 (_data_->service);
			}
		}
	}
	_data_->_state_ = 3;
	rygel_external_plugin_factory_load_activatable_plugins (_data_->self, rygel_external_plugin_factory_load_plugins_ready, _data_);
	return FALSE;
	_state_3:
	rygel_external_plugin_factory_load_activatable_plugins_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if (_data_->_inner_error_->domain == G_DBUS_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			_data_->services = (_vala_array_free (_data_->services, _data_->services_length1, (GDestroyNotify) g_free), NULL);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_data_->services = (_vala_array_free (_data_->services, _data_->services_length1, (GDestroyNotify) g_free), 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_);
			return FALSE;
		}
	}
	_data_->services = (_vala_array_free (_data_->services, _data_->services_length1, (GDestroyNotify) g_free), NULL);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void rygel_external_plugin_factory_load_activatable_plugins_data_free (gpointer _data) {
	RygelExternalPluginFactoryLoadActivatablePluginsData* _data_;
	_data_ = _data;
	_rygel_external_plugin_factory_unref0 (_data_->self);
	g_slice_free (RygelExternalPluginFactoryLoadActivatablePluginsData, _data_);
}


static void rygel_external_plugin_factory_load_activatable_plugins (RygelExternalPluginFactory* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	RygelExternalPluginFactoryLoadActivatablePluginsData* _data_;
	RygelExternalPluginFactory* _tmp0_ = NULL;
	_data_ = g_slice_new0 (RygelExternalPluginFactoryLoadActivatablePluginsData);
	_data_->_async_result = g_simple_async_result_new (NULL, _callback_, _user_data_, rygel_external_plugin_factory_load_activatable_plugins);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, rygel_external_plugin_factory_load_activatable_plugins_data_free);
	_tmp0_ = _rygel_external_plugin_factory_ref0 (self);
	_data_->self = _tmp0_;
	rygel_external_plugin_factory_load_activatable_plugins_co (_data_);
}


static void rygel_external_plugin_factory_load_activatable_plugins_finish (RygelExternalPluginFactory* self, GAsyncResult* _res_, GError** error) {
	RygelExternalPluginFactoryLoadActivatablePluginsData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void rygel_external_plugin_factory_load_activatable_plugins_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	RygelExternalPluginFactoryLoadActivatablePluginsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	rygel_external_plugin_factory_load_activatable_plugins_co (_data_);
}


static void _rygel_external_plugin_factory_name_owner_changed_rygel_external_free_desktop_dbus_object_name_owner_changed (RygelExternalFreeDesktopDBusObject* _sender, const gchar* name, const gchar* old_owner, const gchar* new_owner, gpointer self) {
	rygel_external_plugin_factory_name_owner_changed ((RygelExternalPluginFactory*) self, _sender, name, old_owner, new_owner);
}


static gboolean rygel_external_plugin_factory_load_activatable_plugins_co (RygelExternalPluginFactoryLoadActivatablePluginsData* _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:
	_data_->_tmp0_ = NULL;
	_data_->_tmp0_ = _data_->self->priv->dbus_obj;
	_data_->_tmp1_ = 0;
	_data_->_state_ = 1;
	rygel_external_free_desktop_dbus_object_list_activatable_names (_data_->_tmp0_, rygel_external_plugin_factory_load_activatable_plugins_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp2_ = NULL;
	_data_->_tmp2_ = rygel_external_free_desktop_dbus_object_list_activatable_names_finish (_data_->_tmp0_, _data_->_res_, &_data_->_tmp1_, &_data_->_inner_error_);
	_data_->services_length1 = 0;
	_data_->_services_size_ = 0;
	_data_->services = _data_->_tmp2_;
	_data_->services_length1 = _data_->_tmp1_;
	_data_->_services_size_ = _data_->services_length1;
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if (_data_->_inner_error_->domain == G_DBUS_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			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_);
			return FALSE;
		}
	}
	{
		_data_->service_collection_length1 = 0;
		_data_->_service_collection_size_ = 0;
		_data_->service_collection = _data_->services;
		_data_->service_collection_length1 = _data_->services_length1;
		for (_data_->service_it = 0; _data_->service_it < _data_->services_length1; _data_->service_it = _data_->service_it + 1) {
			_data_->_tmp3_ = NULL;
			_data_->_tmp3_ = g_strdup (_data_->service_collection[_data_->service_it]);
			_data_->service = _data_->_tmp3_;
			{
				_data_->_tmp5_ = NULL;
				_data_->_tmp5_ = _data_->service;
				_data_->_tmp6_ = FALSE;
				_data_->_tmp6_ = g_str_has_prefix (_data_->_tmp5_, RYGEL_EXTERNAL_PLUGIN_FACTORY_SERVICE_PREFIX);
				if (_data_->_tmp6_) {
					_data_->_tmp7_ = NULL;
					_data_->_tmp7_ = _data_->self->priv->loader;
					_data_->_tmp8_ = NULL;
					_data_->_tmp8_ = _data_->service;
					_data_->_tmp9_ = NULL;
					_data_->_tmp9_ = rygel_plugin_loader_get_plugin_by_name (_data_->_tmp7_, _data_->_tmp8_);
					_data_->_tmp10_ = NULL;
					_data_->_tmp10_ = _data_->_tmp9_;
					_data_->_tmp4_ = _data_->_tmp10_ == NULL;
					_g_object_unref0 (_data_->_tmp10_);
				} else {
					_data_->_tmp4_ = FALSE;
				}
				if (_data_->_tmp4_) {
					_data_->_tmp11_ = NULL;
					_data_->_tmp11_ = _data_->service;
					_data_->_state_ = 2;
					rygel_external_plugin_factory_load_plugin_n_handle_error (_data_->self, _data_->_tmp11_, rygel_external_plugin_factory_load_activatable_plugins_ready, _data_);
					return FALSE;
					_state_2:
					rygel_external_plugin_factory_load_plugin_n_handle_error_finish (_data_->self, _data_->_res_);
				}
				_g_free0 (_data_->service);
			}
		}
	}
	_data_->_tmp12_ = NULL;
	_data_->_tmp12_ = _data_->self->priv->dbus_obj;
	g_signal_connect (_data_->_tmp12_, "name-owner-changed", (GCallback) _rygel_external_plugin_factory_name_owner_changed_rygel_external_free_desktop_dbus_object_name_owner_changed, _data_->self);
	_data_->services = (_vala_array_free (_data_->services, _data_->services_length1, (GDestroyNotify) g_free), NULL);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void rygel_external_plugin_factory_name_owner_changed (RygelExternalPluginFactory* self, RygelExternalFreeDesktopDBusObject* dbus_obj, const gchar* name, const gchar* old_owner, const gchar* new_owner) {
	RygelPlugin* plugin = NULL;
	RygelPluginLoader* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	RygelPlugin* _tmp2_ = NULL;
	RygelPlugin* _tmp3_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (dbus_obj != NULL);
	g_return_if_fail (name != NULL);
	g_return_if_fail (old_owner != NULL);
	g_return_if_fail (new_owner != NULL);
	_tmp0_ = self->priv->loader;
	_tmp1_ = name;
	_tmp2_ = rygel_plugin_loader_get_plugin_by_name (_tmp0_, _tmp1_);
	plugin = _tmp2_;
	_tmp3_ = plugin;
	if (_tmp3_ != NULL) {
		gboolean _tmp4_ = FALSE;
		const gchar* _tmp5_ = NULL;
		_tmp5_ = old_owner;
		if (g_strcmp0 (_tmp5_, "") != 0) {
			const gchar* _tmp6_ = NULL;
			_tmp6_ = new_owner;
			_tmp4_ = g_strcmp0 (_tmp6_, "") == 0;
		} else {
			_tmp4_ = FALSE;
		}
		if (_tmp4_) {
			const gchar* _tmp7_ = NULL;
			RygelPlugin* _tmp8_ = NULL;
			_tmp7_ = name;
			g_debug ("rygel-external-plugin-factory.vala:95: Service '%s' going down, deacti" \
"vating it", _tmp7_);
			_tmp8_ = plugin;
			rygel_plugin_set_active (_tmp8_, FALSE);
		} else {
			gboolean _tmp9_ = FALSE;
			const gchar* _tmp10_ = NULL;
			_tmp10_ = old_owner;
			if (g_strcmp0 (_tmp10_, "") == 0) {
				const gchar* _tmp11_ = NULL;
				_tmp11_ = new_owner;
				_tmp9_ = g_strcmp0 (_tmp11_, "") != 0;
			} else {
				_tmp9_ = FALSE;
			}
			if (_tmp9_) {
				const gchar* _tmp12_ = NULL;
				RygelPlugin* _tmp13_ = NULL;
				_tmp12_ = name;
				g_debug ("rygel-external-plugin-factory.vala:99: Service '%s' up again, activati" \
"ng it", _tmp12_);
				_tmp13_ = plugin;
				rygel_plugin_set_active (_tmp13_, TRUE);
			}
		}
	} else {
		const gchar* _tmp14_ = NULL;
		gboolean _tmp15_ = FALSE;
		_tmp14_ = name;
		_tmp15_ = g_str_has_prefix (_tmp14_, RYGEL_EXTERNAL_PLUGIN_FACTORY_SERVICE_PREFIX);
		if (_tmp15_) {
			const gchar* _tmp16_ = NULL;
			_tmp16_ = name;
			rygel_external_plugin_factory_load_plugin_n_handle_error (self, _tmp16_, NULL, NULL);
		}
	}
	_g_object_unref0 (plugin);
}


static void rygel_external_plugin_factory_load_plugin_n_handle_error_data_free (gpointer _data) {
	RygelExternalPluginFactoryLoadPluginNHandleErrorData* _data_;
	_data_ = _data;
	_g_free0 (_data_->service_name);
	_rygel_external_plugin_factory_unref0 (_data_->self);
	g_slice_free (RygelExternalPluginFactoryLoadPluginNHandleErrorData, _data_);
}


static void rygel_external_plugin_factory_load_plugin_n_handle_error (RygelExternalPluginFactory* self, const gchar* service_name, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	RygelExternalPluginFactoryLoadPluginNHandleErrorData* _data_;
	RygelExternalPluginFactory* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	_data_ = g_slice_new0 (RygelExternalPluginFactoryLoadPluginNHandleErrorData);
	_data_->_async_result = g_simple_async_result_new (NULL, _callback_, _user_data_, rygel_external_plugin_factory_load_plugin_n_handle_error);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, rygel_external_plugin_factory_load_plugin_n_handle_error_data_free);
	_tmp0_ = _rygel_external_plugin_factory_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = service_name;
	_tmp2_ = g_strdup (_tmp1_);
	_g_free0 (_data_->service_name);
	_data_->service_name = _tmp2_;
	rygel_external_plugin_factory_load_plugin_n_handle_error_co (_data_);
}


static void rygel_external_plugin_factory_load_plugin_n_handle_error_finish (RygelExternalPluginFactory* self, GAsyncResult* _res_) {
	RygelExternalPluginFactoryLoadPluginNHandleErrorData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void rygel_external_plugin_factory_load_plugin_n_handle_error_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	RygelExternalPluginFactoryLoadPluginNHandleErrorData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	rygel_external_plugin_factory_load_plugin_n_handle_error_co (_data_);
}


static gboolean rygel_external_plugin_factory_load_plugin_n_handle_error_co (RygelExternalPluginFactoryLoadPluginNHandleErrorData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_tmp0_ = NULL;
		_data_->_tmp0_ = _data_->service_name;
		_data_->_state_ = 1;
		rygel_external_plugin_factory_load_plugin (_data_->self, _data_->_tmp0_, rygel_external_plugin_factory_load_plugin_n_handle_error_ready, _data_);
		return FALSE;
		_state_1:
		rygel_external_plugin_factory_load_plugin_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
			goto __catch3_g_error;
		}
	}
	goto __finally3;
	__catch3_g_error:
	{
		_data_->_error_ = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp1_ = NULL;
		_data_->_tmp1_ = _data_->service_name;
		_data_->_tmp2_ = NULL;
		_data_->_tmp2_ = _data_->_error_;
		_data_->_tmp3_ = NULL;
		_data_->_tmp3_ = _data_->_tmp2_->message;
		g_warning ("rygel-external-plugin-factory.vala:112: Failed to load external plugin" \
" '%s': %s", _data_->_tmp1_, _data_->_tmp3_);
		_g_error_free0 (_data_->_error_);
	}
	__finally3:
	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_);
		return FALSE;
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void rygel_external_plugin_factory_load_plugin_data_free (gpointer _data) {
	RygelExternalPluginFactoryLoadPluginData* _data_;
	_data_ = _data;
	_g_free0 (_data_->service_name);
	_rygel_external_plugin_factory_unref0 (_data_->self);
	g_slice_free (RygelExternalPluginFactoryLoadPluginData, _data_);
}


static void rygel_external_plugin_factory_load_plugin (RygelExternalPluginFactory* self, const gchar* service_name, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	RygelExternalPluginFactoryLoadPluginData* _data_;
	RygelExternalPluginFactory* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	_data_ = g_slice_new0 (RygelExternalPluginFactoryLoadPluginData);
	_data_->_async_result = g_simple_async_result_new (NULL, _callback_, _user_data_, rygel_external_plugin_factory_load_plugin);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, rygel_external_plugin_factory_load_plugin_data_free);
	_tmp0_ = _rygel_external_plugin_factory_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = service_name;
	_tmp2_ = g_strdup (_tmp1_);
	_g_free0 (_data_->service_name);
	_data_->service_name = _tmp2_;
	rygel_external_plugin_factory_load_plugin_co (_data_);
}


static void rygel_external_plugin_factory_load_plugin_finish (RygelExternalPluginFactory* self, GAsyncResult* _res_, GError** error) {
	RygelExternalPluginFactoryLoadPluginData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gchar* string_replace (const gchar* self, const gchar* old, const gchar* replacement) {
	gchar* result = NULL;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (old != NULL, NULL);
	g_return_val_if_fail (replacement != NULL, NULL);
	{
		GRegex* regex = NULL;
		const gchar* _tmp0_ = NULL;
		gchar* _tmp1_ = NULL;
		gchar* _tmp2_ = NULL;
		GRegex* _tmp3_ = NULL;
		GRegex* _tmp4_ = NULL;
		gchar* _tmp5_ = NULL;
		GRegex* _tmp6_ = NULL;
		const gchar* _tmp7_ = NULL;
		gchar* _tmp8_ = NULL;
		gchar* _tmp9_ = NULL;
		_tmp0_ = old;
		_tmp1_ = g_regex_escape_string (_tmp0_, -1);
		_tmp2_ = _tmp1_;
		_tmp3_ = g_regex_new (_tmp2_, 0, 0, &_inner_error_);
		_tmp4_ = _tmp3_;
		_g_free0 (_tmp2_);
		regex = _tmp4_;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			if (_inner_error_->domain == G_REGEX_ERROR) {
				goto __catch4_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
		_tmp6_ = regex;
		_tmp7_ = replacement;
		_tmp8_ = g_regex_replace_literal (_tmp6_, self, (gssize) (-1), 0, _tmp7_, 0, &_inner_error_);
		_tmp5_ = _tmp8_;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			_g_regex_unref0 (regex);
			if (_inner_error_->domain == G_REGEX_ERROR) {
				goto __catch4_g_regex_error;
			}
			_g_regex_unref0 (regex);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
		_tmp9_ = _tmp5_;
		_tmp5_ = NULL;
		result = _tmp9_;
		_g_free0 (_tmp5_);
		_g_regex_unref0 (regex);
		return result;
	}
	goto __finally4;
	__catch4_g_regex_error:
	{
		GError* e = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		g_assert_not_reached ();
		_g_error_free0 (e);
	}
	__finally4:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return NULL;
	}
}


static void rygel_external_plugin_factory_load_plugin_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	RygelExternalPluginFactoryLoadPluginData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	rygel_external_plugin_factory_load_plugin_co (_data_);
}


static gpointer _g_variant_ref0 (gpointer self) {
	return self ? g_variant_ref (self) : NULL;
}


static gchar* _variant_get25 (GVariant* value) {
	return g_variant_dup_string (value, NULL);
}


static guint _variant_get26 (GVariant* value) {
	return g_variant_get_uint32 (value);
}


static gboolean _variant_get27 (GVariant* value) {
	return g_variant_get_boolean (value);
}


static gboolean rygel_external_plugin_factory_load_plugin_co (RygelExternalPluginFactoryLoadPluginData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = NULL;
	_data_->_tmp0_ = _data_->self->priv->loader;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = _data_->service_name;
	_data_->_tmp2_ = FALSE;
	_data_->_tmp2_ = rygel_plugin_loader_plugin_disabled (_data_->_tmp0_, _data_->_tmp1_);
	if (_data_->_tmp2_) {
		_data_->_tmp3_ = NULL;
		_data_->_tmp3_ = _data_->service_name;
		g_message ("rygel-external-plugin-factory.vala:121: Plugin '%s' disabled by user, " \
"ignoring..", _data_->_tmp3_);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp4_ = NULL;
	_data_->_tmp4_ = _data_->service_name;
	_data_->_tmp5_ = FALSE;
	_data_->_tmp5_ = g_str_has_prefix (_data_->_tmp4_, RYGEL_EXTERNAL_PLUGIN_FACTORY_GRILO_UPNP_PREFIX);
	if (_data_->_tmp5_) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp6_ = NULL;
	_data_->_tmp6_ = _data_->service_name;
	_data_->_tmp7_ = NULL;
	_data_->_tmp7_ = string_replace (_data_->_tmp6_, ".", "/");
	_data_->_tmp8_ = NULL;
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = NULL;
	_data_->_tmp9_ = g_strconcat ("/", _data_->_tmp8_, NULL);
	_data_->_tmp10_ = NULL;
	_data_->_tmp10_ = _data_->_tmp9_;
	_g_free0 (_data_->_tmp8_);
	_data_->root_object = _data_->_tmp10_;
	_data_->_tmp11_ = NULL;
	_data_->_tmp11_ = _data_->service_name;
	_data_->_tmp12_ = NULL;
	_data_->_tmp12_ = _data_->root_object;
	_data_->_state_ = 1;
	g_async_initable_new_async (RYGEL_EXTERNAL_FREE_DESKTOP_TYPE_PROPERTIES_PROXY, 0, NULL, rygel_external_plugin_factory_load_plugin_ready, _data_, "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, "g-name", _data_->_tmp11_, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", _data_->_tmp12_, "g-interface-name", "org.freedesktop.DBus.Properties", NULL);
	return FALSE;
	_state_1:
	_data_->_tmp13_ = NULL;
	_data_->_tmp13_ = g_async_initable_new_finish (_data_->_source_object_, _data_->_res_, &_data_->_inner_error_);
	_data_->props = (RygelExternalFreeDesktopProperties*) _data_->_tmp13_;
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if ((_data_->_inner_error_->domain == G_IO_ERROR) || (_data_->_inner_error_->domain == G_DBUS_ERROR)) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			_g_free0 (_data_->root_object);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_free0 (_data_->root_object);
			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_);
			return FALSE;
		}
	}
	_data_->_tmp15_ = NULL;
	_data_->_tmp15_ = _data_->props;
	_data_->_state_ = 2;
	rygel_external_free_desktop_properties_get_all (_data_->_tmp15_, RYGEL_EXTERNAL_MEDIA_OBJECT_PROXY_IFACE, rygel_external_plugin_factory_load_plugin_ready, _data_);
	return FALSE;
	_state_2:
	_data_->_tmp16_ = NULL;
	_data_->_tmp16_ = rygel_external_free_desktop_properties_get_all_finish (_data_->_tmp15_, _data_->_res_, &_data_->_inner_error_);
	_data_->_tmp14_ = _data_->_tmp16_;
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if ((_data_->_inner_error_->domain == G_IO_ERROR) || (_data_->_inner_error_->domain == G_DBUS_ERROR)) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			_g_hash_table_unref0 (_data_->container_props);
			_g_hash_table_unref0 (_data_->object_props);
			_g_object_unref0 (_data_->props);
			_g_free0 (_data_->root_object);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_hash_table_unref0 (_data_->container_props);
			_g_hash_table_unref0 (_data_->object_props);
			_g_object_unref0 (_data_->props);
			_g_free0 (_data_->root_object);
			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_);
			return FALSE;
		}
	}
	_data_->_tmp17_ = NULL;
	_data_->_tmp17_ = _data_->_tmp14_;
	_data_->_tmp14_ = NULL;
	_g_hash_table_unref0 (_data_->object_props);
	_data_->object_props = _data_->_tmp17_;
	_data_->_tmp19_ = NULL;
	_data_->_tmp19_ = _data_->props;
	_data_->_state_ = 3;
	rygel_external_free_desktop_properties_get_all (_data_->_tmp19_, RYGEL_EXTERNAL_MEDIA_CONTAINER_PROXY_IFACE, rygel_external_plugin_factory_load_plugin_ready, _data_);
	return FALSE;
	_state_3:
	_data_->_tmp20_ = NULL;
	_data_->_tmp20_ = rygel_external_free_desktop_properties_get_all_finish (_data_->_tmp19_, _data_->_res_, &_data_->_inner_error_);
	_data_->_tmp18_ = _data_->_tmp20_;
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if ((_data_->_inner_error_->domain == G_IO_ERROR) || (_data_->_inner_error_->domain == G_DBUS_ERROR)) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			_g_hash_table_unref0 (_data_->_tmp14_);
			_g_hash_table_unref0 (_data_->container_props);
			_g_hash_table_unref0 (_data_->object_props);
			_g_object_unref0 (_data_->props);
			_g_free0 (_data_->root_object);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_hash_table_unref0 (_data_->_tmp14_);
			_g_hash_table_unref0 (_data_->container_props);
			_g_hash_table_unref0 (_data_->object_props);
			_g_object_unref0 (_data_->props);
			_g_free0 (_data_->root_object);
			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_);
			return FALSE;
		}
	}
	_data_->_tmp21_ = NULL;
	_data_->_tmp21_ = _data_->_tmp18_;
	_data_->_tmp18_ = NULL;
	_g_hash_table_unref0 (_data_->container_props);
	_data_->container_props = _data_->_tmp21_;
	_data_->_tmp22_ = NULL;
	_data_->_tmp22_ = _data_->self->priv->icon_factory;
	_data_->_tmp23_ = NULL;
	_data_->_tmp23_ = _data_->service_name;
	_data_->_tmp24_ = NULL;
	_data_->_tmp24_ = _data_->container_props;
	_data_->_state_ = 4;
	rygel_external_icon_factory_create (_data_->_tmp22_, _data_->_tmp23_, _data_->_tmp24_, rygel_external_plugin_factory_load_plugin_ready, _data_);
	return FALSE;
	_state_4:
	_data_->_tmp25_ = NULL;
	_data_->_tmp25_ = rygel_external_icon_factory_create_finish (_data_->_tmp22_, _data_->_res_, &_data_->_inner_error_);
	_data_->icon = _data_->_tmp25_;
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if ((_data_->_inner_error_->domain == G_IO_ERROR) || (_data_->_inner_error_->domain == G_DBUS_ERROR)) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			_g_hash_table_unref0 (_data_->_tmp18_);
			_g_hash_table_unref0 (_data_->_tmp14_);
			_g_hash_table_unref0 (_data_->container_props);
			_g_hash_table_unref0 (_data_->object_props);
			_g_object_unref0 (_data_->props);
			_g_free0 (_data_->root_object);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_hash_table_unref0 (_data_->_tmp18_);
			_g_hash_table_unref0 (_data_->_tmp14_);
			_g_hash_table_unref0 (_data_->container_props);
			_g_hash_table_unref0 (_data_->object_props);
			_g_object_unref0 (_data_->props);
			_g_free0 (_data_->root_object);
			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_);
			return FALSE;
		}
	}
	_data_->_tmp26_ = NULL;
	_data_->_tmp26_ = _data_->object_props;
	_data_->_tmp27_ = NULL;
	_data_->_tmp27_ = g_hash_table_lookup (_data_->_tmp26_, "DisplayName");
	_data_->_tmp28_ = NULL;
	_data_->_tmp28_ = _g_variant_ref0 ((GVariant*) _data_->_tmp27_);
	_data_->value = _data_->_tmp28_;
	_data_->_tmp29_ = NULL;
	_data_->_tmp29_ = _data_->value;
	if (_data_->_tmp29_ != NULL) {
		_data_->_tmp30_ = NULL;
		_data_->_tmp30_ = _data_->value;
		_data_->_tmp31_ = NULL;
		_data_->_tmp31_ = _variant_get25 (_data_->_tmp30_);
		_g_free0 (_data_->title);
		_data_->title = _data_->_tmp31_;
	} else {
		_data_->_tmp32_ = NULL;
		_data_->_tmp32_ = _data_->service_name;
		_data_->_tmp33_ = NULL;
		_data_->_tmp33_ = g_strdup (_data_->_tmp32_);
		_g_free0 (_data_->title);
		_data_->title = _data_->_tmp33_;
	}
	_data_->_tmp34_ = NULL;
	_data_->_tmp34_ = _data_->container_props;
	_data_->_tmp35_ = NULL;
	_data_->_tmp35_ = g_hash_table_lookup (_data_->_tmp34_, "ChildCount");
	_data_->_tmp36_ = 0U;
	_data_->_tmp36_ = _variant_get26 ((GVariant*) _data_->_tmp35_);
	_data_->child_count = _data_->_tmp36_;
	_data_->_tmp37_ = NULL;
	_data_->_tmp37_ = _data_->container_props;
	_data_->_tmp38_ = NULL;
	_data_->_tmp38_ = g_hash_table_lookup (_data_->_tmp37_, "Searchable");
	_data_->_tmp39_ = FALSE;
	_data_->_tmp39_ = _variant_get27 ((GVariant*) _data_->_tmp38_);
	_data_->searchable = _data_->_tmp39_;
	{
		_data_->_tmp40_ = NULL;
		_data_->_tmp40_ = _data_->service_name;
		_data_->_tmp41_ = NULL;
		_data_->_tmp41_ = _data_->title;
		_data_->_tmp42_ = 0U;
		_data_->_tmp42_ = _data_->child_count;
		_data_->_tmp43_ = FALSE;
		_data_->_tmp43_ = _data_->searchable;
		_data_->_tmp44_ = NULL;
		_data_->_tmp44_ = _data_->root_object;
		_data_->_tmp45_ = NULL;
		_data_->_tmp45_ = _data_->icon;
		_data_->_tmp46_ = NULL;
		_data_->_tmp46_ = rygel_external_plugin_new (_data_->_tmp40_, _data_->_tmp41_, _data_->_tmp42_, _data_->_tmp43_, _data_->_tmp44_, _data_->_tmp45_, &_data_->_inner_error_);
		_data_->plugin = _data_->_tmp46_;
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
			goto __catch5_g_error;
		}
		_data_->_tmp47_ = NULL;
		_data_->_tmp47_ = _data_->self->priv->loader;
		_data_->_tmp48_ = NULL;
		_data_->_tmp48_ = _data_->plugin;
		rygel_plugin_loader_add_plugin (_data_->_tmp47_, (RygelPlugin*) _data_->_tmp48_);
		_g_object_unref0 (_data_->plugin);
	}
	goto __finally5;
	__catch5_g_error:
	{
		_data_->err = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp49_ = NULL;
		_data_->_tmp49_ = _data_->service_name;
		_data_->_tmp50_ = NULL;
		_data_->_tmp50_ = _data_->err;
		_data_->_tmp51_ = NULL;
		_data_->_tmp51_ = _data_->_tmp50_->message;
		g_critical ("Failed to create root container for '%s': %s. " "Ignoring", _data_->_tmp49_, _data_->_tmp51_);
		_g_error_free0 (_data_->err);
	}
	__finally5:
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if ((_data_->_inner_error_->domain == G_IO_ERROR) || (_data_->_inner_error_->domain == G_DBUS_ERROR)) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			_g_variant_unref0 (_data_->value);
			_g_free0 (_data_->title);
			_rygel_icon_info_unref0 (_data_->icon);
			_g_hash_table_unref0 (_data_->_tmp18_);
			_g_hash_table_unref0 (_data_->_tmp14_);
			_g_hash_table_unref0 (_data_->container_props);
			_g_hash_table_unref0 (_data_->object_props);
			_g_object_unref0 (_data_->props);
			_g_free0 (_data_->root_object);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_variant_unref0 (_data_->value);
			_g_free0 (_data_->title);
			_rygel_icon_info_unref0 (_data_->icon);
			_g_hash_table_unref0 (_data_->_tmp18_);
			_g_hash_table_unref0 (_data_->_tmp14_);
			_g_hash_table_unref0 (_data_->container_props);
			_g_hash_table_unref0 (_data_->object_props);
			_g_object_unref0 (_data_->props);
			_g_free0 (_data_->root_object);
			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_);
			return FALSE;
		}
	}
	_g_variant_unref0 (_data_->value);
	_g_free0 (_data_->title);
	_rygel_icon_info_unref0 (_data_->icon);
	_g_hash_table_unref0 (_data_->_tmp18_);
	_g_hash_table_unref0 (_data_->_tmp14_);
	_g_hash_table_unref0 (_data_->container_props);
	_g_hash_table_unref0 (_data_->object_props);
	_g_object_unref0 (_data_->props);
	_g_free0 (_data_->root_object);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void rygel_external_value_plugin_factory_init (GValue* value) {
	value->data[0].v_pointer = NULL;
}


static void rygel_external_value_plugin_factory_free_value (GValue* value) {
	if (value->data[0].v_pointer) {
		rygel_external_plugin_factory_unref (value->data[0].v_pointer);
	}
}


static void rygel_external_value_plugin_factory_copy_value (const GValue* src_value, GValue* dest_value) {
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = rygel_external_plugin_factory_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}


static gpointer rygel_external_value_plugin_factory_peek_pointer (const GValue* value) {
	return value->data[0].v_pointer;
}


static gchar* rygel_external_value_plugin_factory_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	if (collect_values[0].v_pointer) {
		RygelExternalPluginFactory* object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = rygel_external_plugin_factory_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}


static gchar* rygel_external_value_plugin_factory_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	RygelExternalPluginFactory** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = rygel_external_plugin_factory_ref (value->data[0].v_pointer);
	}
	return NULL;
}


GParamSpec* rygel_external_param_spec_plugin_factory (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	RygelExternalParamSpecPluginFactory* spec;
	g_return_val_if_fail (g_type_is_a (object_type, RYGEL_EXTERNAL_TYPE_PLUGIN_FACTORY), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}


gpointer rygel_external_value_get_plugin_factory (const GValue* value) {
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, RYGEL_EXTERNAL_TYPE_PLUGIN_FACTORY), NULL);
	return value->data[0].v_pointer;
}


void rygel_external_value_set_plugin_factory (GValue* value, gpointer v_object) {
	RygelExternalPluginFactory* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, RYGEL_EXTERNAL_TYPE_PLUGIN_FACTORY));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, RYGEL_EXTERNAL_TYPE_PLUGIN_FACTORY));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		rygel_external_plugin_factory_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		rygel_external_plugin_factory_unref (old);
	}
}


void rygel_external_value_take_plugin_factory (GValue* value, gpointer v_object) {
	RygelExternalPluginFactory* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, RYGEL_EXTERNAL_TYPE_PLUGIN_FACTORY));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, RYGEL_EXTERNAL_TYPE_PLUGIN_FACTORY));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		rygel_external_plugin_factory_unref (old);
	}
}


static void rygel_external_plugin_factory_class_init (RygelExternalPluginFactoryClass * klass) {
	rygel_external_plugin_factory_parent_class = g_type_class_peek_parent (klass);
	((RygelExternalPluginFactoryClass *) klass)->finalize = rygel_external_plugin_factory_finalize;
	g_type_class_add_private (klass, sizeof (RygelExternalPluginFactoryPrivate));
}


static void rygel_external_plugin_factory_instance_init (RygelExternalPluginFactory * self) {
	self->priv = RYGEL_EXTERNAL_PLUGIN_FACTORY_GET_PRIVATE (self);
	self->ref_count = 1;
}


static void rygel_external_plugin_factory_finalize (RygelExternalPluginFactory* obj) {
	RygelExternalPluginFactory * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, RYGEL_EXTERNAL_TYPE_PLUGIN_FACTORY, RygelExternalPluginFactory);
	g_signal_handlers_destroy (self);
	_g_object_unref0 (self->priv->dbus_obj);
	_g_object_unref0 (self->priv->loader);
	_rygel_external_icon_factory_unref0 (self->priv->icon_factory);
}


GType rygel_external_plugin_factory_get_type (void) {
	static volatile gsize rygel_external_plugin_factory_type_id__volatile = 0;
	if (g_once_init_enter (&rygel_external_plugin_factory_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { rygel_external_value_plugin_factory_init, rygel_external_value_plugin_factory_free_value, rygel_external_value_plugin_factory_copy_value, rygel_external_value_plugin_factory_peek_pointer, "p", rygel_external_value_plugin_factory_collect_value, "p", rygel_external_value_plugin_factory_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (RygelExternalPluginFactoryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_external_plugin_factory_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelExternalPluginFactory), 0, (GInstanceInitFunc) rygel_external_plugin_factory_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType rygel_external_plugin_factory_type_id;
		rygel_external_plugin_factory_type_id = g_type_register_fundamental (g_type_fundamental_next (), "RygelExternalPluginFactory", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&rygel_external_plugin_factory_type_id__volatile, rygel_external_plugin_factory_type_id);
	}
	return rygel_external_plugin_factory_type_id__volatile;
}


gpointer rygel_external_plugin_factory_ref (gpointer instance) {
	RygelExternalPluginFactory* self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}


void rygel_external_plugin_factory_unref (gpointer instance) {
	RygelExternalPluginFactory* self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		RYGEL_EXTERNAL_PLUGIN_FACTORY_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}


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



