/* MprisRoot.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from MprisRoot.vala, do not modify */

/*
 * SPDX-License-Identifier: LGPL-3.0-or-later
 * SPDX-FileCopyrightText: 2012-2022 elementary, Inc. (https://elementary.io)
 */

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

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define MUSIC_TYPE_MPRIS_ROOT (music_mpris_root_get_type ())
#define MUSIC_MPRIS_ROOT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MUSIC_TYPE_MPRIS_ROOT, MusicMprisRoot))
#define MUSIC_MPRIS_ROOT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MUSIC_TYPE_MPRIS_ROOT, MusicMprisRootClass))
#define MUSIC_IS_MPRIS_ROOT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MUSIC_TYPE_MPRIS_ROOT))
#define MUSIC_IS_MPRIS_ROOT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MUSIC_TYPE_MPRIS_ROOT))
#define MUSIC_MPRIS_ROOT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MUSIC_TYPE_MPRIS_ROOT, MusicMprisRootClass))

typedef struct _MusicMprisRoot MusicMprisRoot;
typedef struct _MusicMprisRootClass MusicMprisRootClass;
typedef struct _MusicMprisRootPrivate MusicMprisRootPrivate;
enum  {
	MUSIC_MPRIS_ROOT_0_PROPERTY,
	MUSIC_MPRIS_ROOT_CAN_QUIT_PROPERTY,
	MUSIC_MPRIS_ROOT_CAN_RAISE_PROPERTY,
	MUSIC_MPRIS_ROOT_HAS_TRACK_LIST_PROPERTY,
	MUSIC_MPRIS_ROOT_DESKTOP_ENTRY_PROPERTY,
	MUSIC_MPRIS_ROOT_IDENTITY_PROPERTY,
	MUSIC_MPRIS_ROOT_SUPPORTED_URI_SCHEMES_PROPERTY,
	MUSIC_MPRIS_ROOT_SUPPORTED_MIME_TYPES_PROPERTY,
	MUSIC_MPRIS_ROOT_NUM_PROPERTIES
};
static GParamSpec* music_mpris_root_properties[MUSIC_MPRIS_ROOT_NUM_PROPERTIES];

struct _MusicMprisRoot {
	GObject parent_instance;
	MusicMprisRootPrivate * priv;
};

struct _MusicMprisRootClass {
	GObjectClass parent_class;
};

static gpointer music_mpris_root_parent_class = NULL;

VALA_EXTERN GType music_mpris_root_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MusicMprisRoot, g_object_unref)
VALA_EXTERN guint music_mpris_root_register_object (void* object,
                                        GDBusConnection* connection,
                                        const gchar* path,
                                        GError** error);
VALA_EXTERN void music_mpris_root_quit (MusicMprisRoot* self,
                            GError** error);
VALA_EXTERN void music_mpris_root_raise (MusicMprisRoot* self,
                             GError** error);
VALA_EXTERN MusicMprisRoot* music_mpris_root_new (void);
VALA_EXTERN MusicMprisRoot* music_mpris_root_construct (GType object_type);
VALA_EXTERN gboolean music_mpris_root_get_can_quit (MusicMprisRoot* self);
VALA_EXTERN gboolean music_mpris_root_get_can_raise (MusicMprisRoot* self);
VALA_EXTERN gboolean music_mpris_root_get_has_track_list (MusicMprisRoot* self);
VALA_EXTERN const gchar* music_mpris_root_get_desktop_entry (MusicMprisRoot* self);
VALA_EXTERN const gchar* music_mpris_root_get_identity (MusicMprisRoot* self);
VALA_EXTERN gchar** music_mpris_root_get_supported_uri_schemes (MusicMprisRoot* self,
                                                    gint* result_length1);
VALA_EXTERN gchar** music_mpris_root_get_supported_mime_types (MusicMprisRoot* self,
                                                   gint* result_length1);
static GType music_mpris_root_get_type_once (void);
static void _vala_music_mpris_root_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec);
static void _dbus_music_mpris_root_quit (MusicMprisRoot* self,
                                  GVariant* _parameters_,
                                  GDBusMethodInvocation* invocation);
static void _dbus_music_mpris_root_raise (MusicMprisRoot* self,
                                   GVariant* _parameters_,
                                   GDBusMethodInvocation* invocation);
static void music_mpris_root_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* music_mpris_root_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 GVariant* _dbus_music_mpris_root_get_can_quit (MusicMprisRoot* self);
static GVariant* _dbus_music_mpris_root_get_can_raise (MusicMprisRoot* self);
static GVariant* _dbus_music_mpris_root_get_has_track_list (MusicMprisRoot* self);
static GVariant* _dbus_music_mpris_root_get_desktop_entry (MusicMprisRoot* self);
static GVariant* _dbus_music_mpris_root_get_identity (MusicMprisRoot* self);
static GVariant* _dbus_music_mpris_root_get_supported_uri_schemes (MusicMprisRoot* self);
static GVariant* _dbus_music_mpris_root_get_supported_mime_types (MusicMprisRoot* self);
static gboolean music_mpris_root_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 _music_mpris_root_unregister_object (gpointer user_data);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static const GDBusArgInfo * const _music_mpris_root_dbus_arg_info_quit_in[] = {NULL};
static const GDBusArgInfo * const _music_mpris_root_dbus_arg_info_quit_out[] = {NULL};
static const GDBusMethodInfo _music_mpris_root_dbus_method_info_quit = {-1, "Quit", (GDBusArgInfo **) (&_music_mpris_root_dbus_arg_info_quit_in), (GDBusArgInfo **) (&_music_mpris_root_dbus_arg_info_quit_out), NULL};
static const GDBusArgInfo * const _music_mpris_root_dbus_arg_info_raise_in[] = {NULL};
static const GDBusArgInfo * const _music_mpris_root_dbus_arg_info_raise_out[] = {NULL};
static const GDBusMethodInfo _music_mpris_root_dbus_method_info_raise = {-1, "Raise", (GDBusArgInfo **) (&_music_mpris_root_dbus_arg_info_raise_in), (GDBusArgInfo **) (&_music_mpris_root_dbus_arg_info_raise_out), NULL};
static const GDBusMethodInfo * const _music_mpris_root_dbus_method_info[] = {&_music_mpris_root_dbus_method_info_quit, &_music_mpris_root_dbus_method_info_raise, NULL};
static const GDBusSignalInfo * const _music_mpris_root_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo _music_mpris_root_dbus_property_info_can_quit = {-1, "CanQuit", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _music_mpris_root_dbus_property_info_can_raise = {-1, "CanRaise", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _music_mpris_root_dbus_property_info_has_track_list = {-1, "HasTrackList", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _music_mpris_root_dbus_property_info_desktop_entry = {-1, "DesktopEntry", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _music_mpris_root_dbus_property_info_identity = {-1, "Identity", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _music_mpris_root_dbus_property_info_supported_uri_schemes = {-1, "SupportedUriSchemes", "as", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _music_mpris_root_dbus_property_info_supported_mime_types = {-1, "SupportedMimeTypes", "as", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo * const _music_mpris_root_dbus_property_info[] = {&_music_mpris_root_dbus_property_info_can_quit, &_music_mpris_root_dbus_property_info_can_raise, &_music_mpris_root_dbus_property_info_has_track_list, &_music_mpris_root_dbus_property_info_desktop_entry, &_music_mpris_root_dbus_property_info_identity, &_music_mpris_root_dbus_property_info_supported_uri_schemes, &_music_mpris_root_dbus_property_info_supported_mime_types, NULL};
static const GDBusInterfaceInfo _music_mpris_root_dbus_interface_info = {-1, "org.mpris.MediaPlayer2", (GDBusMethodInfo **) (&_music_mpris_root_dbus_method_info), (GDBusSignalInfo **) (&_music_mpris_root_dbus_signal_info), (GDBusPropertyInfo **) (&_music_mpris_root_dbus_property_info), NULL};
static const GDBusInterfaceVTable _music_mpris_root_dbus_interface_vtable = {music_mpris_root_dbus_interface_method_call, music_mpris_root_dbus_interface_get_property, music_mpris_root_dbus_interface_set_property};

void
music_mpris_root_quit (MusicMprisRoot* self,
                       GError** error)
{
	GApplication* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_application_get_default ();
	g_application_quit (_tmp0_);
}

void
music_mpris_root_raise (MusicMprisRoot* self,
                        GError** error)
{
	GApplication* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_application_get_default ();
	g_application_activate (_tmp0_);
}

MusicMprisRoot*
music_mpris_root_construct (GType object_type)
{
	MusicMprisRoot * self = NULL;
	self = (MusicMprisRoot*) g_object_new (object_type, NULL);
	return self;
}

MusicMprisRoot*
music_mpris_root_new (void)
{
	return music_mpris_root_construct (MUSIC_TYPE_MPRIS_ROOT);
}

gboolean
music_mpris_root_get_can_quit (MusicMprisRoot* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = TRUE;
	return result;
}

gboolean
music_mpris_root_get_can_raise (MusicMprisRoot* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = TRUE;
	return result;
}

gboolean
music_mpris_root_get_has_track_list (MusicMprisRoot* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = FALSE;
	return result;
}

const gchar*
music_mpris_root_get_desktop_entry (MusicMprisRoot* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = "io.elementary.music";
	return result;
}

const gchar*
music_mpris_root_get_identity (MusicMprisRoot* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = "io.elementary.music";
	return result;
}

gchar**
music_mpris_root_get_supported_uri_schemes (MusicMprisRoot* self,
                                            gint* result_length1)
{
	gchar** result;
	gchar* _tmp0_;
	gchar** _tmp1_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup ("file");
	_tmp1_ = g_new0 (gchar*, 1 + 1);
	_tmp1_[0] = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp2__length1 = 1;
	if (result_length1) {
		*result_length1 = _tmp2__length1;
	}
	result = _tmp2_;
	return result;
}

gchar**
music_mpris_root_get_supported_mime_types (MusicMprisRoot* self,
                                           gint* result_length1)
{
	gchar** result;
	gchar* _tmp0_;
	gchar** _tmp1_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup ("audio");
	_tmp1_ = g_new0 (gchar*, 1 + 1);
	_tmp1_[0] = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp2__length1 = 1;
	if (result_length1) {
		*result_length1 = _tmp2__length1;
	}
	result = _tmp2_;
	return result;
}

static void
music_mpris_root_class_init (MusicMprisRootClass * klass,
                             gpointer klass_data)
{
	music_mpris_root_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->get_property = _vala_music_mpris_root_get_property;
	g_object_class_install_property (G_OBJECT_CLASS (klass), MUSIC_MPRIS_ROOT_CAN_QUIT_PROPERTY, music_mpris_root_properties[MUSIC_MPRIS_ROOT_CAN_QUIT_PROPERTY] = g_param_spec_boolean ("can-quit", "can-quit", "can-quit", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), MUSIC_MPRIS_ROOT_CAN_RAISE_PROPERTY, music_mpris_root_properties[MUSIC_MPRIS_ROOT_CAN_RAISE_PROPERTY] = g_param_spec_boolean ("can-raise", "can-raise", "can-raise", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), MUSIC_MPRIS_ROOT_HAS_TRACK_LIST_PROPERTY, music_mpris_root_properties[MUSIC_MPRIS_ROOT_HAS_TRACK_LIST_PROPERTY] = g_param_spec_boolean ("has-track-list", "has-track-list", "has-track-list", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), MUSIC_MPRIS_ROOT_DESKTOP_ENTRY_PROPERTY, music_mpris_root_properties[MUSIC_MPRIS_ROOT_DESKTOP_ENTRY_PROPERTY] = g_param_spec_string ("desktop-entry", "desktop-entry", "desktop-entry", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), MUSIC_MPRIS_ROOT_IDENTITY_PROPERTY, music_mpris_root_properties[MUSIC_MPRIS_ROOT_IDENTITY_PROPERTY] = g_param_spec_string ("identity", "identity", "identity", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), MUSIC_MPRIS_ROOT_SUPPORTED_URI_SCHEMES_PROPERTY, music_mpris_root_properties[MUSIC_MPRIS_ROOT_SUPPORTED_URI_SCHEMES_PROPERTY] = g_param_spec_boxed ("supported-uri-schemes", "supported-uri-schemes", "supported-uri-schemes", G_TYPE_STRV, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), MUSIC_MPRIS_ROOT_SUPPORTED_MIME_TYPES_PROPERTY, music_mpris_root_properties[MUSIC_MPRIS_ROOT_SUPPORTED_MIME_TYPES_PROPERTY] = g_param_spec_boxed ("supported-mime-types", "supported-mime-types", "supported-mime-types", G_TYPE_STRV, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
music_mpris_root_instance_init (MusicMprisRoot * self,
                                gpointer klass)
{
}

static GType
music_mpris_root_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (MusicMprisRootClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) music_mpris_root_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MusicMprisRoot), 0, (GInstanceInitFunc) music_mpris_root_instance_init, NULL };
	GType music_mpris_root_type_id;
	music_mpris_root_type_id = g_type_register_static (G_TYPE_OBJECT, "MusicMprisRoot", &g_define_type_info, 0);
	g_type_set_qdata (music_mpris_root_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) music_mpris_root_register_object);
	return music_mpris_root_type_id;
}

GType
music_mpris_root_get_type (void)
{
	static volatile gsize music_mpris_root_type_id__once = 0;
	if (g_once_init_enter (&music_mpris_root_type_id__once)) {
		GType music_mpris_root_type_id;
		music_mpris_root_type_id = music_mpris_root_get_type_once ();
		g_once_init_leave (&music_mpris_root_type_id__once, music_mpris_root_type_id);
	}
	return music_mpris_root_type_id__once;
}

static void
_vala_music_mpris_root_get_property (GObject * object,
                                     guint property_id,
                                     GValue * value,
                                     GParamSpec * pspec)
{
	MusicMprisRoot * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, MUSIC_TYPE_MPRIS_ROOT, MusicMprisRoot);
	switch (property_id) {
		case MUSIC_MPRIS_ROOT_CAN_QUIT_PROPERTY:
		g_value_set_boolean (value, music_mpris_root_get_can_quit (self));
		break;
		case MUSIC_MPRIS_ROOT_CAN_RAISE_PROPERTY:
		g_value_set_boolean (value, music_mpris_root_get_can_raise (self));
		break;
		case MUSIC_MPRIS_ROOT_HAS_TRACK_LIST_PROPERTY:
		g_value_set_boolean (value, music_mpris_root_get_has_track_list (self));
		break;
		case MUSIC_MPRIS_ROOT_DESKTOP_ENTRY_PROPERTY:
		g_value_set_string (value, music_mpris_root_get_desktop_entry (self));
		break;
		case MUSIC_MPRIS_ROOT_IDENTITY_PROPERTY:
		g_value_set_string (value, music_mpris_root_get_identity (self));
		break;
		case MUSIC_MPRIS_ROOT_SUPPORTED_URI_SCHEMES_PROPERTY:
		{
			int length;
			g_value_take_boxed (value, music_mpris_root_get_supported_uri_schemes (self, &length));
		}
		break;
		case MUSIC_MPRIS_ROOT_SUPPORTED_MIME_TYPES_PROPERTY:
		{
			int length;
			g_value_take_boxed (value, music_mpris_root_get_supported_mime_types (self, &length));
		}
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_dbus_music_mpris_root_quit (MusicMprisRoot* self,
                             GVariant* _parameters_,
                             GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	music_mpris_root_quit (self, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_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_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_music_mpris_root_raise (MusicMprisRoot* self,
                              GVariant* _parameters_,
                              GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	music_mpris_root_raise (self, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_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_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
music_mpris_root_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, "Quit") == 0) {
		_dbus_music_mpris_root_quit (object, parameters, invocation);
	} else if (strcmp (method_name, "Raise") == 0) {
		_dbus_music_mpris_root_raise (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
_dbus_music_mpris_root_get_can_quit (MusicMprisRoot* self)
{
	gboolean result;
	GVariant* _reply;
	result = music_mpris_root_get_can_quit (self);
	_reply = g_variant_new_boolean (result);
	return _reply;
}

static GVariant*
_dbus_music_mpris_root_get_can_raise (MusicMprisRoot* self)
{
	gboolean result;
	GVariant* _reply;
	result = music_mpris_root_get_can_raise (self);
	_reply = g_variant_new_boolean (result);
	return _reply;
}

static GVariant*
_dbus_music_mpris_root_get_has_track_list (MusicMprisRoot* self)
{
	gboolean result;
	GVariant* _reply;
	result = music_mpris_root_get_has_track_list (self);
	_reply = g_variant_new_boolean (result);
	return _reply;
}

static GVariant*
_dbus_music_mpris_root_get_desktop_entry (MusicMprisRoot* self)
{
	const gchar* result;
	GVariant* _reply;
	result = music_mpris_root_get_desktop_entry (self);
	_reply = g_variant_new_string (result);
	return _reply;
}

static GVariant*
_dbus_music_mpris_root_get_identity (MusicMprisRoot* self)
{
	const gchar* result;
	GVariant* _reply;
	result = music_mpris_root_get_identity (self);
	_reply = g_variant_new_string (result);
	return _reply;
}

static GVariant*
_dbus_music_mpris_root_get_supported_uri_schemes (MusicMprisRoot* self)
{
	gchar** result;
	gint result_length1 = 0;
	GVariant* _reply;
	gchar** _tmp4_;
	GVariantBuilder _tmp5_;
	gint _tmp6_;
	result = music_mpris_root_get_supported_uri_schemes (self, &result_length1);
	_tmp4_ = result;
	g_variant_builder_init (&_tmp5_, G_VARIANT_TYPE ("as"));
	for (_tmp6_ = 0; _tmp6_ < result_length1; _tmp6_++) {
		g_variant_builder_add_value (&_tmp5_, g_variant_new_string (*_tmp4_));
		_tmp4_++;
	}
	_reply = g_variant_builder_end (&_tmp5_);
	result = (_vala_array_free (result, result_length1, (GDestroyNotify) g_free), NULL);
	return _reply;
}

static GVariant*
_dbus_music_mpris_root_get_supported_mime_types (MusicMprisRoot* self)
{
	gchar** result;
	gint result_length1 = 0;
	GVariant* _reply;
	gchar** _tmp7_;
	GVariantBuilder _tmp8_;
	gint _tmp9_;
	result = music_mpris_root_get_supported_mime_types (self, &result_length1);
	_tmp7_ = result;
	g_variant_builder_init (&_tmp8_, G_VARIANT_TYPE ("as"));
	for (_tmp9_ = 0; _tmp9_ < result_length1; _tmp9_++) {
		g_variant_builder_add_value (&_tmp8_, g_variant_new_string (*_tmp7_));
		_tmp7_++;
	}
	_reply = g_variant_builder_end (&_tmp8_);
	result = (_vala_array_free (result, result_length1, (GDestroyNotify) g_free), NULL);
	return _reply;
}

static GVariant*
music_mpris_root_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];
	if (strcmp (property_name, "CanQuit") == 0) {
		return _dbus_music_mpris_root_get_can_quit (object);
	} else if (strcmp (property_name, "CanRaise") == 0) {
		return _dbus_music_mpris_root_get_can_raise (object);
	} else if (strcmp (property_name, "HasTrackList") == 0) {
		return _dbus_music_mpris_root_get_has_track_list (object);
	} else if (strcmp (property_name, "DesktopEntry") == 0) {
		return _dbus_music_mpris_root_get_desktop_entry (object);
	} else if (strcmp (property_name, "Identity") == 0) {
		return _dbus_music_mpris_root_get_identity (object);
	} else if (strcmp (property_name, "SupportedUriSchemes") == 0) {
		return _dbus_music_mpris_root_get_supported_uri_schemes (object);
	} else if (strcmp (property_name, "SupportedMimeTypes") == 0) {
		return _dbus_music_mpris_root_get_supported_mime_types (object);
	}
	return NULL;
}

static gboolean
music_mpris_root_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
music_mpris_root_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 *) (&_music_mpris_root_dbus_interface_info), &_music_mpris_root_dbus_interface_vtable, data, _music_mpris_root_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}

static void
_music_mpris_root_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,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize 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,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

