/* DBus.c generated by valac 0.56.3, the Vala compiler
 * generated from DBus.vala, do not modify */

/*
 * Copyright 2012-2014 Tom Beckmann, Jacob Parker
 * Copyright 2018 elementary LLC. (https://elementary.io)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <glib-object.h>
#include <gio/gio.h>
#include <meta/meta-plugin.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gobject/gvaluecollector.h>

#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 GREETER_COMPOSITOR_TYPE_DBUS (greeter_compositor_dbus_get_type ())
#define GREETER_COMPOSITOR_DBUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GREETER_COMPOSITOR_TYPE_DBUS, GreeterCompositorDBus))
#define GREETER_COMPOSITOR_DBUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GREETER_COMPOSITOR_TYPE_DBUS, GreeterCompositorDBusClass))
#define GREETER_COMPOSITOR_IS_DBUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GREETER_COMPOSITOR_TYPE_DBUS))
#define GREETER_COMPOSITOR_IS_DBUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GREETER_COMPOSITOR_TYPE_DBUS))
#define GREETER_COMPOSITOR_DBUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GREETER_COMPOSITOR_TYPE_DBUS, GreeterCompositorDBusClass))

typedef struct _GreeterCompositorDBus GreeterCompositorDBus;
typedef struct _GreeterCompositorDBusClass GreeterCompositorDBusClass;
typedef struct _GreeterCompositorDBusPrivate GreeterCompositorDBusPrivate;

#define GREETER_COMPOSITOR_TYPE_WINDOW_MANAGER (greeter_compositor_window_manager_get_type ())
#define GREETER_COMPOSITOR_WINDOW_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GREETER_COMPOSITOR_TYPE_WINDOW_MANAGER, GreeterCompositorWindowManager))
#define GREETER_COMPOSITOR_WINDOW_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GREETER_COMPOSITOR_TYPE_WINDOW_MANAGER, GreeterCompositorWindowManagerClass))
#define GREETER_COMPOSITOR_IS_WINDOW_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GREETER_COMPOSITOR_TYPE_WINDOW_MANAGER))
#define GREETER_COMPOSITOR_IS_WINDOW_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GREETER_COMPOSITOR_TYPE_WINDOW_MANAGER))
#define GREETER_COMPOSITOR_WINDOW_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GREETER_COMPOSITOR_TYPE_WINDOW_MANAGER, GreeterCompositorWindowManagerClass))

typedef struct _GreeterCompositorWindowManager GreeterCompositorWindowManager;
typedef struct _GreeterCompositorWindowManagerClass GreeterCompositorWindowManagerClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _greeter_compositor_dbus_unref0(var) ((var == NULL) ? NULL : (var = (greeter_compositor_dbus_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define GREETER_COMPOSITOR_TYPE_DBUS_ACCELERATOR (greeter_compositor_dbus_accelerator_get_type ())
#define GREETER_COMPOSITOR_DBUS_ACCELERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GREETER_COMPOSITOR_TYPE_DBUS_ACCELERATOR, GreeterCompositorDBusAccelerator))
#define GREETER_COMPOSITOR_DBUS_ACCELERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GREETER_COMPOSITOR_TYPE_DBUS_ACCELERATOR, GreeterCompositorDBusAcceleratorClass))
#define GREETER_COMPOSITOR_IS_DBUS_ACCELERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GREETER_COMPOSITOR_TYPE_DBUS_ACCELERATOR))
#define GREETER_COMPOSITOR_IS_DBUS_ACCELERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GREETER_COMPOSITOR_TYPE_DBUS_ACCELERATOR))
#define GREETER_COMPOSITOR_DBUS_ACCELERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GREETER_COMPOSITOR_TYPE_DBUS_ACCELERATOR, GreeterCompositorDBusAcceleratorClass))

typedef struct _GreeterCompositorDBusAccelerator GreeterCompositorDBusAccelerator;
typedef struct _GreeterCompositorDBusAcceleratorClass GreeterCompositorDBusAcceleratorClass;
typedef struct _GreeterCompositorParamSpecDBus GreeterCompositorParamSpecDBus;
enum  {
	GREETER_COMPOSITOR_DBUS_CHANGE_WALLPAPER_SIGNAL,
	GREETER_COMPOSITOR_DBUS_NUM_SIGNALS
};
static guint greeter_compositor_dbus_signals[GREETER_COMPOSITOR_DBUS_NUM_SIGNALS] = {0};
#define _g_free0(var) (var = (g_free (var), NULL))

struct _GreeterCompositorDBus {
	GTypeInstance parent_instance;
	volatile int ref_count;
	GreeterCompositorDBusPrivate * priv;
};

struct _GreeterCompositorDBusClass {
	GTypeClass parent_class;
	void (*finalize) (GreeterCompositorDBus *self);
};

struct _GreeterCompositorParamSpecDBus {
	GParamSpec parent_instance;
};

static gpointer greeter_compositor_dbus_parent_class = NULL;
VALA_EXTERN GreeterCompositorDBus* greeter_compositor_dbus_instance;
GreeterCompositorDBus* greeter_compositor_dbus_instance = NULL;
static GreeterCompositorWindowManager* greeter_compositor_dbus_wm;
static GreeterCompositorWindowManager* greeter_compositor_dbus_wm = NULL;

VALA_EXTERN gpointer greeter_compositor_dbus_ref (gpointer instance);
VALA_EXTERN void greeter_compositor_dbus_unref (gpointer instance);
VALA_EXTERN GParamSpec* greeter_compositor_param_spec_dbus (const gchar* name,
                                                const gchar* nick,
                                                const gchar* blurb,
                                                GType object_type,
                                                GParamFlags flags);
VALA_EXTERN void greeter_compositor_value_set_dbus (GValue* value,
                                        gpointer v_object);
VALA_EXTERN void greeter_compositor_value_take_dbus (GValue* value,
                                         gpointer v_object);
VALA_EXTERN gpointer greeter_compositor_value_get_dbus (const GValue* value);
VALA_EXTERN GType greeter_compositor_dbus_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GreeterCompositorDBus, greeter_compositor_dbus_unref)
VALA_EXTERN guint greeter_compositor_dbus_register_object (void* object,
                                               GDBusConnection* connection,
                                               const gchar* path,
                                               GError** error);
VALA_EXTERN GType greeter_compositor_window_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GreeterCompositorWindowManager, g_object_unref)
VALA_EXTERN void greeter_compositor_dbus_init (GreeterCompositorWindowManager* _wm);
static void __lambda5_ (GDBusConnection* connection);
static GreeterCompositorDBus* greeter_compositor_dbus_new (void);
static GreeterCompositorDBus* greeter_compositor_dbus_construct (GType object_type);
static void ___lambda5__gbus_acquired_callback (GDBusConnection* connection,
                                         const gchar* name,
                                         gpointer self);
static void __lambda6_ (void);
static void ___lambda6__gbus_name_acquired_callback (GDBusConnection* connection,
                                              const gchar* name,
                                              gpointer self);
static void __lambda7_ (void);
static void ___lambda7__gbus_name_lost_callback (GDBusConnection* connection,
                                          const gchar* name,
                                          gpointer self);
static void __lambda8_ (GDBusConnection* connection);
VALA_EXTERN gpointer greeter_compositor_dbus_accelerator_ref (gpointer instance);
VALA_EXTERN void greeter_compositor_dbus_accelerator_unref (gpointer instance);
VALA_EXTERN GParamSpec* greeter_compositor_param_spec_dbus_accelerator (const gchar* name,
                                                            const gchar* nick,
                                                            const gchar* blurb,
                                                            GType object_type,
                                                            GParamFlags flags);
VALA_EXTERN void greeter_compositor_value_set_dbus_accelerator (GValue* value,
                                                    gpointer v_object);
VALA_EXTERN void greeter_compositor_value_take_dbus_accelerator (GValue* value,
                                                     gpointer v_object);
VALA_EXTERN gpointer greeter_compositor_value_get_dbus_accelerator (const GValue* value);
VALA_EXTERN GType greeter_compositor_dbus_accelerator_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GreeterCompositorDBusAccelerator, greeter_compositor_dbus_accelerator_unref)
VALA_EXTERN guint greeter_compositor_dbus_accelerator_register_object (void* object,
                                                           GDBusConnection* connection,
                                                           const gchar* path,
                                                           GError** error);
VALA_EXTERN GreeterCompositorDBusAccelerator* greeter_compositor_dbus_accelerator_init (GreeterCompositorWindowManager* wm);
static void ___lambda8__gbus_acquired_callback (GDBusConnection* connection,
                                         const gchar* name,
                                         gpointer self);
static void __lambda9_ (void);
static void ___lambda9__gbus_name_acquired_callback (GDBusConnection* connection,
                                              const gchar* name,
                                              gpointer self);
static void __lambda10_ (void);
static void ___lambda10__gbus_name_lost_callback (GDBusConnection* connection,
                                           const gchar* name,
                                           gpointer self);
VALA_EXTERN void greeter_compositor_dbus_set_wallpaper (GreeterCompositorDBus* self,
                                            const gchar* path,
                                            GError** error);
static void greeter_compositor_dbus_finalize (GreeterCompositorDBus * obj);
static GType greeter_compositor_dbus_get_type_once (void);
static void _dbus_greeter_compositor_dbus_set_wallpaper (GreeterCompositorDBus* self,
                                                  GVariant* _parameters_,
                                                  GDBusMethodInvocation* invocation);
static void greeter_compositor_dbus_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* greeter_compositor_dbus_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 greeter_compositor_dbus_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 _greeter_compositor_dbus_unregister_object (gpointer user_data);

static const GDBusArgInfo _greeter_compositor_dbus_dbus_arg_info_set_wallpaper_path = {-1, "path", "s", NULL};
static const GDBusArgInfo * const _greeter_compositor_dbus_dbus_arg_info_set_wallpaper_in[] = {&_greeter_compositor_dbus_dbus_arg_info_set_wallpaper_path, NULL};
static const GDBusArgInfo * const _greeter_compositor_dbus_dbus_arg_info_set_wallpaper_out[] = {NULL};
static const GDBusMethodInfo _greeter_compositor_dbus_dbus_method_info_set_wallpaper = {-1, "SetWallpaper", (GDBusArgInfo **) (&_greeter_compositor_dbus_dbus_arg_info_set_wallpaper_in), (GDBusArgInfo **) (&_greeter_compositor_dbus_dbus_arg_info_set_wallpaper_out), NULL};
static const GDBusMethodInfo * const _greeter_compositor_dbus_dbus_method_info[] = {&_greeter_compositor_dbus_dbus_method_info_set_wallpaper, NULL};
static const GDBusSignalInfo * const _greeter_compositor_dbus_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo * const _greeter_compositor_dbus_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _greeter_compositor_dbus_dbus_interface_info = {-1, "org.pantheon.greeter", (GDBusMethodInfo **) (&_greeter_compositor_dbus_dbus_method_info), (GDBusSignalInfo **) (&_greeter_compositor_dbus_dbus_signal_info), (GDBusPropertyInfo **) (&_greeter_compositor_dbus_dbus_property_info), NULL};
static const GDBusInterfaceVTable _greeter_compositor_dbus_dbus_interface_vtable = {greeter_compositor_dbus_dbus_interface_method_call, greeter_compositor_dbus_dbus_interface_get_property, greeter_compositor_dbus_dbus_interface_set_property};

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

static void
__lambda5_ (GDBusConnection* connection)
{
	GreeterCompositorDBus* _tmp0_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (connection != NULL);
	_tmp0_ = greeter_compositor_dbus_instance;
	if (_tmp0_ == NULL) {
		GreeterCompositorDBus* _tmp1_;
		_tmp1_ = greeter_compositor_dbus_new ();
		_greeter_compositor_dbus_unref0 (greeter_compositor_dbus_instance);
		greeter_compositor_dbus_instance = _tmp1_;
	}
	{
		GreeterCompositorDBus* _tmp2_;
		_tmp2_ = greeter_compositor_dbus_instance;
		greeter_compositor_dbus_register_object (_tmp2_, connection, "/org/pantheon/greeter", &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp3_;
		const gchar* _tmp4_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp3_ = e;
		_tmp4_ = _tmp3_->message;
		g_warning ("DBus.vala:36: %s", _tmp4_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
___lambda5__gbus_acquired_callback (GDBusConnection* connection,
                                    const gchar* name,
                                    gpointer self)
{
	__lambda5_ (connection);
}

static void
__lambda6_ (void)
{
}

static void
___lambda6__gbus_name_acquired_callback (GDBusConnection* connection,
                                         const gchar* name,
                                         gpointer self)
{
	__lambda6_ ();
}

static void
__lambda7_ (void)
{
	g_warning ("DBus.vala:40: Could not acquire name\n");
}

static void
___lambda7__gbus_name_lost_callback (GDBusConnection* connection,
                                     const gchar* name,
                                     gpointer self)
{
	__lambda7_ ();
}

static void
__lambda8_ (GDBusConnection* connection)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (connection != NULL);
	{
		GreeterCompositorWindowManager* _tmp0_;
		GreeterCompositorDBusAccelerator* _tmp1_;
		_tmp0_ = greeter_compositor_dbus_wm;
		_tmp1_ = greeter_compositor_dbus_accelerator_init (_tmp0_);
		greeter_compositor_dbus_accelerator_register_object (_tmp1_, connection, "/org/gnome/Shell", &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp2_;
		const gchar* _tmp3_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp2_ = e;
		_tmp3_ = _tmp2_->message;
		g_warning ("DBus.vala:48: %s", _tmp3_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
___lambda8__gbus_acquired_callback (GDBusConnection* connection,
                                    const gchar* name,
                                    gpointer self)
{
	__lambda8_ (connection);
}

static void
__lambda9_ (void)
{
}

static void
___lambda9__gbus_name_acquired_callback (GDBusConnection* connection,
                                         const gchar* name,
                                         gpointer self)
{
	__lambda9_ ();
}

static void
__lambda10_ (void)
{
	g_critical ("DBus.vala:52: Could not acquire name");
}

static void
___lambda10__gbus_name_lost_callback (GDBusConnection* connection,
                                      const gchar* name,
                                      gpointer self)
{
	__lambda10_ ();
}

void
greeter_compositor_dbus_init (GreeterCompositorWindowManager* _wm)
{
	GreeterCompositorWindowManager* _tmp0_;
	g_return_if_fail (_wm != NULL);
	_tmp0_ = _g_object_ref0 (_wm);
	_g_object_unref0 (greeter_compositor_dbus_wm);
	greeter_compositor_dbus_wm = _tmp0_;
	g_bus_own_name_with_closures (G_BUS_TYPE_SESSION, "org.pantheon.greeter", G_BUS_NAME_OWNER_FLAGS_NONE, (GClosure*) ((___lambda5__gbus_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda5__gbus_acquired_callback, NULL, (GClosureNotify) NULL)), (GClosure*) ((___lambda6__gbus_name_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda6__gbus_name_acquired_callback, NULL, (GClosureNotify) NULL)), (GClosure*) ((___lambda7__gbus_name_lost_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda7__gbus_name_lost_callback, NULL, (GClosureNotify) NULL)));
	g_bus_own_name_with_closures (G_BUS_TYPE_SESSION, "org.gnome.Shell", G_BUS_NAME_OWNER_FLAGS_NONE, (GClosure*) ((___lambda8__gbus_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda8__gbus_acquired_callback, NULL, (GClosureNotify) NULL)), (GClosure*) ((___lambda9__gbus_name_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda9__gbus_name_acquired_callback, NULL, (GClosureNotify) NULL)), (GClosure*) ((___lambda10__gbus_name_lost_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda10__gbus_name_lost_callback, NULL, (GClosureNotify) NULL)));
}

void
greeter_compositor_dbus_set_wallpaper (GreeterCompositorDBus* self,
                                       const gchar* path,
                                       GError** error)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (path != NULL);
	g_signal_emit (self, greeter_compositor_dbus_signals[GREETER_COMPOSITOR_DBUS_CHANGE_WALLPAPER_SIGNAL], 0, path);
}

static GreeterCompositorDBus*
greeter_compositor_dbus_construct (GType object_type)
{
	GreeterCompositorDBus* self = NULL;
	self = (GreeterCompositorDBus*) g_type_create_instance (object_type);
	return self;
}

static GreeterCompositorDBus*
greeter_compositor_dbus_new (void)
{
	return greeter_compositor_dbus_construct (GREETER_COMPOSITOR_TYPE_DBUS);
}

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

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

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

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

static gchar*
greeter_compositor_value_dbus_collect_value (GValue* value,
                                             guint n_collect_values,
                                             GTypeCValue* collect_values,
                                             guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		GreeterCompositorDBus * 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 = greeter_compositor_dbus_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
greeter_compositor_value_dbus_lcopy_value (const GValue* value,
                                           guint n_collect_values,
                                           GTypeCValue* collect_values,
                                           guint collect_flags)
{
	GreeterCompositorDBus ** 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 = greeter_compositor_dbus_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
greeter_compositor_param_spec_dbus (const gchar* name,
                                    const gchar* nick,
                                    const gchar* blurb,
                                    GType object_type,
                                    GParamFlags flags)
{
	GreeterCompositorParamSpecDBus* spec;
	g_return_val_if_fail (g_type_is_a (object_type, GREETER_COMPOSITOR_TYPE_DBUS), 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
greeter_compositor_value_get_dbus (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GREETER_COMPOSITOR_TYPE_DBUS), NULL);
	return value->data[0].v_pointer;
}

void
greeter_compositor_value_set_dbus (GValue* value,
                                   gpointer v_object)
{
	GreeterCompositorDBus * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GREETER_COMPOSITOR_TYPE_DBUS));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GREETER_COMPOSITOR_TYPE_DBUS));
		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;
		greeter_compositor_dbus_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		greeter_compositor_dbus_unref (old);
	}
}

void
greeter_compositor_value_take_dbus (GValue* value,
                                    gpointer v_object)
{
	GreeterCompositorDBus * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GREETER_COMPOSITOR_TYPE_DBUS));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GREETER_COMPOSITOR_TYPE_DBUS));
		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) {
		greeter_compositor_dbus_unref (old);
	}
}

static void
greeter_compositor_dbus_class_init (GreeterCompositorDBusClass * klass,
                                    gpointer klass_data)
{
	greeter_compositor_dbus_parent_class = g_type_class_peek_parent (klass);
	((GreeterCompositorDBusClass *) klass)->finalize = greeter_compositor_dbus_finalize;
	greeter_compositor_dbus_signals[GREETER_COMPOSITOR_DBUS_CHANGE_WALLPAPER_SIGNAL] = g_signal_new ("change-wallpaper", GREETER_COMPOSITOR_TYPE_DBUS, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
}

static void
greeter_compositor_dbus_instance_init (GreeterCompositorDBus * self,
                                       gpointer klass)
{
	self->ref_count = 1;
}

static void
greeter_compositor_dbus_finalize (GreeterCompositorDBus * obj)
{
	GreeterCompositorDBus * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GREETER_COMPOSITOR_TYPE_DBUS, GreeterCompositorDBus);
	g_signal_handlers_destroy (self);
}

static GType
greeter_compositor_dbus_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { greeter_compositor_value_dbus_init, greeter_compositor_value_dbus_free_value, greeter_compositor_value_dbus_copy_value, greeter_compositor_value_dbus_peek_pointer, "p", greeter_compositor_value_dbus_collect_value, "p", greeter_compositor_value_dbus_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (GreeterCompositorDBusClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) greeter_compositor_dbus_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GreeterCompositorDBus), 0, (GInstanceInitFunc) greeter_compositor_dbus_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 greeter_compositor_dbus_type_id;
	greeter_compositor_dbus_type_id = g_type_register_fundamental (g_type_fundamental_next (), "GreeterCompositorDBus", &g_define_type_info, &g_define_type_fundamental_info, 0);
	g_type_set_qdata (greeter_compositor_dbus_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) greeter_compositor_dbus_register_object);
	return greeter_compositor_dbus_type_id;
}

GType
greeter_compositor_dbus_get_type (void)
{
	static volatile gsize greeter_compositor_dbus_type_id__once = 0;
	if (g_once_init_enter (&greeter_compositor_dbus_type_id__once)) {
		GType greeter_compositor_dbus_type_id;
		greeter_compositor_dbus_type_id = greeter_compositor_dbus_get_type_once ();
		g_once_init_leave (&greeter_compositor_dbus_type_id__once, greeter_compositor_dbus_type_id);
	}
	return greeter_compositor_dbus_type_id__once;
}

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

void
greeter_compositor_dbus_unref (gpointer instance)
{
	GreeterCompositorDBus * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		GREETER_COMPOSITOR_DBUS_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static void
_dbus_greeter_compositor_dbus_set_wallpaper (GreeterCompositorDBus* self,
                                             GVariant* _parameters_,
                                             GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gchar* path = NULL;
	GVariant* _tmp0_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp0_ = g_variant_iter_next_value (&_arguments_iter);
	path = g_variant_dup_string (_tmp0_, NULL);
	g_variant_unref (_tmp0_);
	greeter_compositor_dbus_set_wallpaper (self, path, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_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);
	_error:
	_g_free0 (path);
	;
}

static void
greeter_compositor_dbus_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, "SetWallpaper") == 0) {
		_dbus_greeter_compositor_dbus_set_wallpaper (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
greeter_compositor_dbus_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
greeter_compositor_dbus_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
greeter_compositor_dbus_register_object (gpointer object,
                                         GDBusConnection* connection,
                                         const gchar* path,
                                         GError** error)
{
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = greeter_compositor_dbus_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_greeter_compositor_dbus_dbus_interface_info), &_greeter_compositor_dbus_dbus_interface_vtable, data, _greeter_compositor_dbus_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}

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

