/* rygel-media-export-dbus-service.c generated by valac 0.18.1, the Vala compiler
 * generated from rygel-media-export-dbus-service.vala, do not modify */

/*
 * Copyright (C) 2009 Jens Georg <mail@jensge.org>.
 *
 * 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 <gio/gio.h>
#include <rygel-server.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>


#define RYGEL_MEDIA_EXPORT_TYPE_DBUS_SERVICE (rygel_media_export_dbus_service_get_type ())
#define RYGEL_MEDIA_EXPORT_DBUS_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_MEDIA_EXPORT_TYPE_DBUS_SERVICE, RygelMediaExportDBusService))
#define RYGEL_MEDIA_EXPORT_DBUS_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_MEDIA_EXPORT_TYPE_DBUS_SERVICE, RygelMediaExportDBusServiceClass))
#define RYGEL_MEDIA_EXPORT_IS_DBUS_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_MEDIA_EXPORT_TYPE_DBUS_SERVICE))
#define RYGEL_MEDIA_EXPORT_IS_DBUS_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_MEDIA_EXPORT_TYPE_DBUS_SERVICE))
#define RYGEL_MEDIA_EXPORT_DBUS_SERVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_MEDIA_EXPORT_TYPE_DBUS_SERVICE, RygelMediaExportDBusServiceClass))

typedef struct _RygelMediaExportDBusService RygelMediaExportDBusService;
typedef struct _RygelMediaExportDBusServiceClass RygelMediaExportDBusServiceClass;
typedef struct _RygelMediaExportDBusServicePrivate RygelMediaExportDBusServicePrivate;

#define RYGEL_MEDIA_EXPORT_TYPE_DB_CONTAINER (rygel_media_export_db_container_get_type ())
#define RYGEL_MEDIA_EXPORT_DB_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_MEDIA_EXPORT_TYPE_DB_CONTAINER, RygelMediaExportDBContainer))
#define RYGEL_MEDIA_EXPORT_DB_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_MEDIA_EXPORT_TYPE_DB_CONTAINER, RygelMediaExportDBContainerClass))
#define RYGEL_MEDIA_EXPORT_IS_DB_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_MEDIA_EXPORT_TYPE_DB_CONTAINER))
#define RYGEL_MEDIA_EXPORT_IS_DB_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_MEDIA_EXPORT_TYPE_DB_CONTAINER))
#define RYGEL_MEDIA_EXPORT_DB_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_MEDIA_EXPORT_TYPE_DB_CONTAINER, RygelMediaExportDBContainerClass))

typedef struct _RygelMediaExportDBContainer RygelMediaExportDBContainer;
typedef struct _RygelMediaExportDBContainerClass RygelMediaExportDBContainerClass;

#define RYGEL_MEDIA_EXPORT_TYPE_ROOT_CONTAINER (rygel_media_export_root_container_get_type ())
#define RYGEL_MEDIA_EXPORT_ROOT_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_MEDIA_EXPORT_TYPE_ROOT_CONTAINER, RygelMediaExportRootContainer))
#define RYGEL_MEDIA_EXPORT_ROOT_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_MEDIA_EXPORT_TYPE_ROOT_CONTAINER, RygelMediaExportRootContainerClass))
#define RYGEL_MEDIA_EXPORT_IS_ROOT_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_MEDIA_EXPORT_TYPE_ROOT_CONTAINER))
#define RYGEL_MEDIA_EXPORT_IS_ROOT_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_MEDIA_EXPORT_TYPE_ROOT_CONTAINER))
#define RYGEL_MEDIA_EXPORT_ROOT_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_MEDIA_EXPORT_TYPE_ROOT_CONTAINER, RygelMediaExportRootContainerClass))

typedef struct _RygelMediaExportRootContainer RygelMediaExportRootContainer;
typedef struct _RygelMediaExportRootContainerClass RygelMediaExportRootContainerClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

struct _RygelMediaExportDBusService {
	GObject parent_instance;
	RygelMediaExportDBusServicePrivate * priv;
};

struct _RygelMediaExportDBusServiceClass {
	GObjectClass parent_class;
};

struct _RygelMediaExportDBusServicePrivate {
	RygelMediaExportRootContainer* root_container;
};


static gpointer rygel_media_export_dbus_service_parent_class = NULL;

GType rygel_media_export_dbus_service_get_type (void) G_GNUC_CONST;
guint rygel_media_export_dbus_service_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error);
GType rygel_media_export_db_container_get_type (void) G_GNUC_CONST;
GType rygel_media_export_root_container_get_type (void) G_GNUC_CONST;
#define RYGEL_MEDIA_EXPORT_DBUS_SERVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RYGEL_MEDIA_EXPORT_TYPE_DBUS_SERVICE, RygelMediaExportDBusServicePrivate))
enum  {
	RYGEL_MEDIA_EXPORT_DBUS_SERVICE_DUMMY_PROPERTY
};
#define RYGEL_MEDIA_EXPORT_DBUS_SERVICE_RYGEL_MEDIA_EXPORT_PATH "/org/gnome/Rygel/MediaExport1"
RygelMediaExportDBusService* rygel_media_export_dbus_service_new (RygelMediaExportRootContainer* root_container, GError** error);
RygelMediaExportDBusService* rygel_media_export_dbus_service_construct (GType object_type, RygelMediaExportRootContainer* root_container, GError** error);
void rygel_media_export_dbus_service_AddUri (RygelMediaExportDBusService* self, const gchar* uri);
void rygel_media_export_root_container_add_uri (RygelMediaExportRootContainer* self, const gchar* uri);
void rygel_media_export_dbus_service_RemoveUri (RygelMediaExportDBusService* self, const gchar* uri);
void rygel_media_export_root_container_remove_uri (RygelMediaExportRootContainer* self, const gchar* uri);
gchar** rygel_media_export_dbus_service_GetUris (RygelMediaExportDBusService* self, int* result_length1);
gchar** rygel_media_export_root_container_get_dynamic_uris (RygelMediaExportRootContainer* self, int* result_length1);
static void rygel_media_export_dbus_service_finalize (GObject* obj);
static void _dbus_rygel_media_export_dbus_service_AddUri (RygelMediaExportDBusService* self, GVariant* parameters, GDBusMethodInvocation* invocation);
static void _dbus_rygel_media_export_dbus_service_RemoveUri (RygelMediaExportDBusService* self, GVariant* parameters, GDBusMethodInvocation* invocation);
static void _dbus_rygel_media_export_dbus_service_GetUris (RygelMediaExportDBusService* self, GVariant* parameters, GDBusMethodInvocation* invocation);
static void rygel_media_export_dbus_service_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data);
static GVariant* rygel_media_export_dbus_service_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data);
static gboolean rygel_media_export_dbus_service_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data);
static void _rygel_media_export_dbus_service_unregister_object (gpointer user_data);
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 const GDBusArgInfo _rygel_media_export_dbus_service_dbus_arg_info_AddUri_uri = {-1, "uri", "s"};
static const GDBusArgInfo * const _rygel_media_export_dbus_service_dbus_arg_info_AddUri_in[] = {&_rygel_media_export_dbus_service_dbus_arg_info_AddUri_uri, NULL};
static const GDBusArgInfo * const _rygel_media_export_dbus_service_dbus_arg_info_AddUri_out[] = {NULL};
static const GDBusMethodInfo _rygel_media_export_dbus_service_dbus_method_info_AddUri = {-1, "AddUri", (GDBusArgInfo **) (&_rygel_media_export_dbus_service_dbus_arg_info_AddUri_in), (GDBusArgInfo **) (&_rygel_media_export_dbus_service_dbus_arg_info_AddUri_out)};
static const GDBusArgInfo _rygel_media_export_dbus_service_dbus_arg_info_RemoveUri_uri = {-1, "uri", "s"};
static const GDBusArgInfo * const _rygel_media_export_dbus_service_dbus_arg_info_RemoveUri_in[] = {&_rygel_media_export_dbus_service_dbus_arg_info_RemoveUri_uri, NULL};
static const GDBusArgInfo * const _rygel_media_export_dbus_service_dbus_arg_info_RemoveUri_out[] = {NULL};
static const GDBusMethodInfo _rygel_media_export_dbus_service_dbus_method_info_RemoveUri = {-1, "RemoveUri", (GDBusArgInfo **) (&_rygel_media_export_dbus_service_dbus_arg_info_RemoveUri_in), (GDBusArgInfo **) (&_rygel_media_export_dbus_service_dbus_arg_info_RemoveUri_out)};
static const GDBusArgInfo _rygel_media_export_dbus_service_dbus_arg_info_GetUris_result = {-1, "result", "as"};
static const GDBusArgInfo * const _rygel_media_export_dbus_service_dbus_arg_info_GetUris_in[] = {NULL};
static const GDBusArgInfo * const _rygel_media_export_dbus_service_dbus_arg_info_GetUris_out[] = {&_rygel_media_export_dbus_service_dbus_arg_info_GetUris_result, NULL};
static const GDBusMethodInfo _rygel_media_export_dbus_service_dbus_method_info_GetUris = {-1, "GetUris", (GDBusArgInfo **) (&_rygel_media_export_dbus_service_dbus_arg_info_GetUris_in), (GDBusArgInfo **) (&_rygel_media_export_dbus_service_dbus_arg_info_GetUris_out)};
static const GDBusMethodInfo * const _rygel_media_export_dbus_service_dbus_method_info[] = {&_rygel_media_export_dbus_service_dbus_method_info_AddUri, &_rygel_media_export_dbus_service_dbus_method_info_RemoveUri, &_rygel_media_export_dbus_service_dbus_method_info_GetUris, NULL};
static const GDBusSignalInfo * const _rygel_media_export_dbus_service_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo * const _rygel_media_export_dbus_service_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _rygel_media_export_dbus_service_dbus_interface_info = {-1, "org.gnome.Rygel.MediaExport1", (GDBusMethodInfo **) (&_rygel_media_export_dbus_service_dbus_method_info), (GDBusSignalInfo **) (&_rygel_media_export_dbus_service_dbus_signal_info), (GDBusPropertyInfo **) (&_rygel_media_export_dbus_service_dbus_property_info)};
static const GDBusInterfaceVTable _rygel_media_export_dbus_service_dbus_interface_vtable = {rygel_media_export_dbus_service_dbus_interface_method_call, rygel_media_export_dbus_service_dbus_interface_get_property, rygel_media_export_dbus_service_dbus_interface_set_property};

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


RygelMediaExportDBusService* rygel_media_export_dbus_service_construct (GType object_type, RygelMediaExportRootContainer* root_container, GError** error) {
	RygelMediaExportDBusService * self = NULL;
	RygelMediaExportRootContainer* _tmp0_;
	RygelMediaExportRootContainer* _tmp1_;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (root_container != NULL, NULL);
	self = (RygelMediaExportDBusService*) g_object_new (object_type, NULL);
	_tmp0_ = root_container;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->root_container);
	self->priv->root_container = _tmp1_;
	{
		GDBusConnection* _tmp2_ = NULL;
		GDBusConnection* connection;
		GDBusConnection* _tmp3_;
		gboolean _tmp4_ = FALSE;
		_tmp2_ = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &_inner_error_);
		connection = _tmp2_;
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == G_IO_ERROR) {
				goto __catch43_g_io_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;
		}
		_tmp3_ = connection;
		_tmp4_ = G_LIKELY (_tmp3_ != NULL);
		if (_tmp4_) {
			GDBusConnection* _tmp5_;
			_tmp5_ = connection;
			rygel_media_export_dbus_service_register_object (self, _tmp5_, RYGEL_MEDIA_EXPORT_DBUS_SERVICE_RYGEL_MEDIA_EXPORT_PATH, &_inner_error_);
			if (_inner_error_ != NULL) {
				_g_object_unref0 (connection);
				if (_inner_error_->domain == G_IO_ERROR) {
					goto __catch43_g_io_error;
				}
				_g_object_unref0 (connection);
				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;
			}
		}
		_g_object_unref0 (connection);
	}
	goto __finally43;
	__catch43_g_io_error:
	{
		GError* err = NULL;
		const gchar* _tmp6_ = NULL;
		GError* _tmp7_;
		const gchar* _tmp8_;
		err = _inner_error_;
		_inner_error_ = NULL;
		_tmp6_ = _ ("Failed to attach to D-Bus session bus: %s");
		_tmp7_ = err;
		_tmp8_ = _tmp7_->message;
		g_warning (_tmp6_, _tmp8_);
		_g_error_free0 (err);
	}
	__finally43:
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		_g_object_unref0 (self);
		return NULL;
	}
	return self;
}


RygelMediaExportDBusService* rygel_media_export_dbus_service_new (RygelMediaExportRootContainer* root_container, GError** error) {
	return rygel_media_export_dbus_service_construct (RYGEL_MEDIA_EXPORT_TYPE_DBUS_SERVICE, root_container, error);
}


void rygel_media_export_dbus_service_AddUri (RygelMediaExportDBusService* self, const gchar* uri) {
	RygelMediaExportRootContainer* _tmp0_;
	const gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (uri != NULL);
	_tmp0_ = self->priv->root_container;
	_tmp1_ = uri;
	rygel_media_export_root_container_add_uri (_tmp0_, _tmp1_);
}


void rygel_media_export_dbus_service_RemoveUri (RygelMediaExportDBusService* self, const gchar* uri) {
	RygelMediaExportRootContainer* _tmp0_;
	const gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (uri != NULL);
	_tmp0_ = self->priv->root_container;
	_tmp1_ = uri;
	rygel_media_export_root_container_remove_uri (_tmp0_, _tmp1_);
}


gchar** rygel_media_export_dbus_service_GetUris (RygelMediaExportDBusService* self, int* result_length1) {
	gchar** result = NULL;
	RygelMediaExportRootContainer* _tmp0_;
	gint _tmp1_ = 0;
	gchar** _tmp2_ = NULL;
	gchar** _tmp3_;
	gint _tmp3__length1;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->root_container;
	_tmp2_ = rygel_media_export_root_container_get_dynamic_uris (_tmp0_, &_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp3__length1 = _tmp1_;
	if (result_length1) {
		*result_length1 = _tmp3__length1;
	}
	result = _tmp3_;
	return result;
}


static void rygel_media_export_dbus_service_class_init (RygelMediaExportDBusServiceClass * klass) {
	rygel_media_export_dbus_service_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (RygelMediaExportDBusServicePrivate));
	G_OBJECT_CLASS (klass)->finalize = rygel_media_export_dbus_service_finalize;
}


static void rygel_media_export_dbus_service_instance_init (RygelMediaExportDBusService * self) {
	self->priv = RYGEL_MEDIA_EXPORT_DBUS_SERVICE_GET_PRIVATE (self);
}


static void rygel_media_export_dbus_service_finalize (GObject* obj) {
	RygelMediaExportDBusService * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, RYGEL_MEDIA_EXPORT_TYPE_DBUS_SERVICE, RygelMediaExportDBusService);
	_g_object_unref0 (self->priv->root_container);
	G_OBJECT_CLASS (rygel_media_export_dbus_service_parent_class)->finalize (obj);
}


GType rygel_media_export_dbus_service_get_type (void) {
	static volatile gsize rygel_media_export_dbus_service_type_id__volatile = 0;
	if (g_once_init_enter (&rygel_media_export_dbus_service_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (RygelMediaExportDBusServiceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_media_export_dbus_service_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelMediaExportDBusService), 0, (GInstanceInitFunc) rygel_media_export_dbus_service_instance_init, NULL };
		GType rygel_media_export_dbus_service_type_id;
		rygel_media_export_dbus_service_type_id = g_type_register_static (G_TYPE_OBJECT, "RygelMediaExportDBusService", &g_define_type_info, 0);
		g_type_set_qdata (rygel_media_export_dbus_service_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) rygel_media_export_dbus_service_register_object);
		g_once_init_leave (&rygel_media_export_dbus_service_type_id__volatile, rygel_media_export_dbus_service_type_id);
	}
	return rygel_media_export_dbus_service_type_id__volatile;
}


static void _dbus_rygel_media_export_dbus_service_AddUri (RygelMediaExportDBusService* self, GVariant* parameters, GDBusMethodInvocation* invocation) {
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gchar* uri = NULL;
	GVariant* _tmp0_;
	GDBusMessage* _reply_message;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, parameters);
	_tmp0_ = g_variant_iter_next_value (&_arguments_iter);
	uri = g_variant_dup_string (_tmp0_, NULL);
	g_variant_unref (_tmp0_);
	rygel_media_export_dbus_service_AddUri (self, uri);
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	_g_free0 (uri);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}


static void _dbus_rygel_media_export_dbus_service_RemoveUri (RygelMediaExportDBusService* self, GVariant* parameters, GDBusMethodInvocation* invocation) {
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gchar* uri = NULL;
	GVariant* _tmp1_;
	GDBusMessage* _reply_message;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, parameters);
	_tmp1_ = g_variant_iter_next_value (&_arguments_iter);
	uri = g_variant_dup_string (_tmp1_, NULL);
	g_variant_unref (_tmp1_);
	rygel_media_export_dbus_service_RemoveUri (self, uri);
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	_g_free0 (uri);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}


static void _dbus_rygel_media_export_dbus_service_GetUris (RygelMediaExportDBusService* self, GVariant* parameters, GDBusMethodInvocation* invocation) {
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gchar** result;
	int result_length1 = 0;
	gchar** _tmp2_;
	GVariantBuilder _tmp3_;
	int _tmp4_;
	g_variant_iter_init (&_arguments_iter, parameters);
	result = rygel_media_export_dbus_service_GetUris (self, &result_length1);
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_tmp2_ = result;
	g_variant_builder_init (&_tmp3_, G_VARIANT_TYPE ("as"));
	for (_tmp4_ = 0; _tmp4_ < result_length1; _tmp4_++) {
		g_variant_builder_add_value (&_tmp3_, g_variant_new_string (*_tmp2_));
		_tmp2_++;
	}
	g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp3_));
	result = (_vala_array_free (result, result_length1, (GDestroyNotify) g_free), NULL);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}


static void rygel_media_export_dbus_service_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data) {
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (method_name, "AddUri") == 0) {
		_dbus_rygel_media_export_dbus_service_AddUri (object, parameters, invocation);
	} else if (strcmp (method_name, "RemoveUri") == 0) {
		_dbus_rygel_media_export_dbus_service_RemoveUri (object, parameters, invocation);
	} else if (strcmp (method_name, "GetUris") == 0) {
		_dbus_rygel_media_export_dbus_service_GetUris (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}


static GVariant* rygel_media_export_dbus_service_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data) {
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	return NULL;
}


static gboolean rygel_media_export_dbus_service_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data) {
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	return FALSE;
}


guint rygel_media_export_dbus_service_register_object (gpointer object, GDBusConnection* connection, const gchar* path, GError** error) {
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = g_object_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_rygel_media_export_dbus_service_dbus_interface_info), &_rygel_media_export_dbus_service_dbus_interface_vtable, data, _rygel_media_export_dbus_service_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}


static void _rygel_media_export_dbus_service_unregister_object (gpointer user_data) {
	gpointer* data;
	data = user_data;
	g_object_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}


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



