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

/* 
 *      Copyright 2011 Julien Lavergne <gilir@ubuntu.com>
 *
 *      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 2 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, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */

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

#define LXSESSION_CONSOLE_KIT_OBJECT_UNIQUE_NAME "org.freedesktop.ConsoleKit"
#define LXSESSION_CONSOLE_KIT_OBJECT_OBJECT_PATH "/org/freedesktop/ConsoleKit/Manager"
#define LXSESSION_CONSOLE_KIT_OBJECT_INTERFACE_NAME "org.freedesktop.ConsoleKit.Manager"
#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 LXSESSION_TYPE_SESSION_OBJECT (lxsession_session_object_get_type ())
#define LXSESSION_SESSION_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LXSESSION_TYPE_SESSION_OBJECT, LxsessionSessionObject))
#define LXSESSION_SESSION_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LXSESSION_TYPE_SESSION_OBJECT, LxsessionSessionObjectClass))
#define LXSESSION_IS_SESSION_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LXSESSION_TYPE_SESSION_OBJECT))
#define LXSESSION_IS_SESSION_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LXSESSION_TYPE_SESSION_OBJECT))
#define LXSESSION_SESSION_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), LXSESSION_TYPE_SESSION_OBJECT, LxsessionSessionObjectClass))

typedef struct _LxsessionSessionObject LxsessionSessionObject;
typedef struct _LxsessionSessionObjectClass LxsessionSessionObjectClass;
typedef struct _LxsessionSessionObjectPrivate LxsessionSessionObjectPrivate;

#define LXSESSION_TYPE_CONSOLE_KIT_OBJECT (lxsession_console_kit_object_get_type ())
#define LXSESSION_CONSOLE_KIT_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LXSESSION_TYPE_CONSOLE_KIT_OBJECT, LxsessionConsoleKitObject))
#define LXSESSION_IS_CONSOLE_KIT_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LXSESSION_TYPE_CONSOLE_KIT_OBJECT))
#define LXSESSION_CONSOLE_KIT_OBJECT_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), LXSESSION_TYPE_CONSOLE_KIT_OBJECT, LxsessionConsoleKitObjectIface))

typedef struct _LxsessionConsoleKitObject LxsessionConsoleKitObject;
typedef struct _LxsessionConsoleKitObjectIface LxsessionConsoleKitObjectIface;

#define LXSESSION_TYPE_CONSOLE_KIT_OBJECT_PROXY (lxsession_console_kit_object_proxy_get_type ())
enum  {
	LXSESSION_SESSION_OBJECT_0_PROPERTY,
	LXSESSION_SESSION_OBJECT_NUM_PROPERTIES
};
static GParamSpec* lxsession_session_object_properties[LXSESSION_SESSION_OBJECT_NUM_PROPERTIES];
#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)))
typedef struct _LxsessionSessionObjectLxsessionCanShutdownData LxsessionSessionObjectLxsessionCanShutdownData;
typedef GDBusProxy LxsessionConsoleKitObjectProxy;
typedef GDBusProxyClass LxsessionConsoleKitObjectProxyClass;
typedef struct _LxsessionConsoleKitObjectCanRestartReadyData LxsessionConsoleKitObjectCanRestartReadyData;
typedef struct _LxsessionConsoleKitObjectCanStopReadyData LxsessionConsoleKitObjectCanStopReadyData;

#define LXSESSION_TYPE_LXDE_SESSION_SERVER (lxsession_lxde_session_server_get_type ())
#define LXSESSION_LXDE_SESSION_SERVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LXSESSION_TYPE_LXDE_SESSION_SERVER, LxsessionLxdeSessionServer))
#define LXSESSION_LXDE_SESSION_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LXSESSION_TYPE_LXDE_SESSION_SERVER, LxsessionLxdeSessionServerClass))
#define LXSESSION_IS_LXDE_SESSION_SERVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LXSESSION_TYPE_LXDE_SESSION_SERVER))
#define LXSESSION_IS_LXDE_SESSION_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LXSESSION_TYPE_LXDE_SESSION_SERVER))
#define LXSESSION_LXDE_SESSION_SERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), LXSESSION_TYPE_LXDE_SESSION_SERVER, LxsessionLxdeSessionServerClass))

typedef struct _LxsessionLxdeSessionServer LxsessionLxdeSessionServer;
typedef struct _LxsessionLxdeSessionServerClass LxsessionLxdeSessionServerClass;

#define LXSESSION_TYPE_GNOME_SESSION_SERVER (lxsession_gnome_session_server_get_type ())
#define LXSESSION_GNOME_SESSION_SERVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LXSESSION_TYPE_GNOME_SESSION_SERVER, LxsessionGnomeSessionServer))
#define LXSESSION_GNOME_SESSION_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LXSESSION_TYPE_GNOME_SESSION_SERVER, LxsessionGnomeSessionServerClass))
#define LXSESSION_IS_GNOME_SESSION_SERVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LXSESSION_TYPE_GNOME_SESSION_SERVER))
#define LXSESSION_IS_GNOME_SESSION_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LXSESSION_TYPE_GNOME_SESSION_SERVER))
#define LXSESSION_GNOME_SESSION_SERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), LXSESSION_TYPE_GNOME_SESSION_SERVER, LxsessionGnomeSessionServerClass))

typedef struct _LxsessionGnomeSessionServer LxsessionGnomeSessionServer;
typedef struct _LxsessionGnomeSessionServerClass LxsessionGnomeSessionServerClass;

struct _LxsessionConsoleKitObjectIface {
	GTypeInterface parent_iface;
	void (*restart) (LxsessionConsoleKitObject* self, GError** error);
	void (*stop) (LxsessionConsoleKitObject* self, GError** error);
	void (*can_restart) (LxsessionConsoleKitObject* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	gboolean (*can_restart_finish) (LxsessionConsoleKitObject* self, GAsyncResult* _res_, GError** error);
	void (*can_stop) (LxsessionConsoleKitObject* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	gboolean (*can_stop_finish) (LxsessionConsoleKitObject* self, GAsyncResult* _res_, GError** error);
};

struct _LxsessionSessionObject {
	GObject parent_instance;
	LxsessionSessionObjectPrivate * priv;
	LxsessionConsoleKitObject* dbus_interface;
};

struct _LxsessionSessionObjectClass {
	GObjectClass parent_class;
};

struct _LxsessionSessionObjectLxsessionCanShutdownData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	LxsessionSessionObject* self;
	gboolean result;
	gboolean can_shutdown_available;
	gboolean _tmp0_;
	LxsessionConsoleKitObject* _tmp1_;
	GError* err;
	GError* _tmp2_;
	const gchar* _tmp3_;
	GError* _inner_error0_;
};

struct _LxsessionConsoleKitObjectCanRestartReadyData {
	GDBusMethodInvocation* _invocation_;
};

struct _LxsessionConsoleKitObjectCanStopReadyData {
	GDBusMethodInvocation* _invocation_;
};

static gpointer lxsession_session_object_parent_class = NULL;

VALA_EXTERN GType lxsession_session_object_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LxsessionSessionObject, g_object_unref)
VALA_EXTERN GType lxsession_console_kit_object_proxy_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint lxsession_console_kit_object_register_object (void* object,
                                                    GDBusConnection* connection,
                                                    const gchar* path,
                                                    GError** error);
VALA_EXTERN GType lxsession_console_kit_object_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LxsessionConsoleKitObject, g_object_unref)
VALA_EXTERN LxsessionSessionObject* lxsession_session_object_new (void);
VALA_EXTERN LxsessionSessionObject* lxsession_session_object_construct (GType object_type);
static void lxsession_session_object_lxsession_can_shutdown_data_free (gpointer _data);
VALA_EXTERN void lxsession_session_object_lxsession_can_shutdown (LxsessionSessionObject* self,
                                                      GAsyncReadyCallback _callback_,
                                                      gpointer _user_data_);
VALA_EXTERN gboolean lxsession_session_object_lxsession_can_shutdown_finish (LxsessionSessionObject* self,
                                                                 GAsyncResult* _res_);
static gboolean lxsession_session_object_lxsession_can_shutdown_co (LxsessionSessionObjectLxsessionCanShutdownData* _data_);
VALA_EXTERN void lxsession_console_kit_object_can_stop (LxsessionConsoleKitObject* self,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_);
VALA_EXTERN gboolean lxsession_console_kit_object_can_stop_finish (LxsessionConsoleKitObject* self,
                                                       GAsyncResult* _res_,
                                                       GError** error);
static void lxsession_session_object_lxsession_can_shutdown_ready (GObject* source_object,
                                                            GAsyncResult* _res_,
                                                            gpointer _user_data_);
VALA_EXTERN void lxsession_session_object_lxsession_shutdown (LxsessionSessionObject* self);
VALA_EXTERN void lxsession_console_kit_object_stop (LxsessionConsoleKitObject* self,
                                        GError** error);
VALA_EXTERN void lxsession_session_object_lxsession_restart (LxsessionSessionObject* self);
VALA_EXTERN void lxsession_console_kit_object_restart (LxsessionConsoleKitObject* self,
                                           GError** error);
static void lxsession_session_object_finalize (GObject * obj);
static GType lxsession_session_object_get_type_once (void);
VALA_EXTERN void lxsession_console_kit_object_can_restart (LxsessionConsoleKitObject* self,
                                               GAsyncReadyCallback _callback_,
                                               gpointer _user_data_);
VALA_EXTERN gboolean lxsession_console_kit_object_can_restart_finish (LxsessionConsoleKitObject* self,
                                                          GAsyncResult* _res_,
                                                          GError** error);
static GType lxsession_console_kit_object_get_type_once (void);
static void lxsession_console_kit_object_proxy_g_signal (GDBusProxy* proxy,
                                                  const gchar* sender_name,
                                                  const gchar* signal_name,
                                                  GVariant* parameters);
static void lxsession_console_kit_object_proxy_restart (LxsessionConsoleKitObject* self,
                                                 GError** error);
static void lxsession_console_kit_object_proxy_stop (LxsessionConsoleKitObject* self,
                                              GError** error);
static void _vala_g_async_ready_callback (GObject *source_object,
                                   GAsyncResult *res,
                                   void *user_data);
static void lxsession_console_kit_object_proxy_can_restart_async (LxsessionConsoleKitObject* self,
                                                           GAsyncReadyCallback _callback_,
                                                           gpointer _user_data_);
static gboolean lxsession_console_kit_object_proxy_can_restart_finish (LxsessionConsoleKitObject* self,
                                                                GAsyncResult* _res_,
                                                                GError** error);
static void lxsession_console_kit_object_proxy_can_stop_async (LxsessionConsoleKitObject* self,
                                                        GAsyncReadyCallback _callback_,
                                                        gpointer _user_data_);
static gboolean lxsession_console_kit_object_proxy_can_stop_finish (LxsessionConsoleKitObject* self,
                                                             GAsyncResult* _res_,
                                                             GError** error);
static void lxsession_console_kit_object_proxy_lxsession_console_kit_object_interface_init (LxsessionConsoleKitObjectIface* iface);
static void _dbus_lxsession_console_kit_object_restart (LxsessionConsoleKitObject* self,
                                                 GVariant* _parameters_,
                                                 GDBusMethodInvocation* invocation);
static void _dbus_lxsession_console_kit_object_stop (LxsessionConsoleKitObject* self,
                                              GVariant* _parameters_,
                                              GDBusMethodInvocation* invocation);
static void _dbus_lxsession_console_kit_object_can_restart (LxsessionConsoleKitObject* self,
                                                     GVariant* _parameters_,
                                                     GDBusMethodInvocation* invocation);
static void _dbus_lxsession_console_kit_object_can_restart_ready (GObject * source_object,
                                                           GAsyncResult * _res_,
                                                           gpointer _user_data_);
static void _dbus_lxsession_console_kit_object_can_stop (LxsessionConsoleKitObject* self,
                                                  GVariant* _parameters_,
                                                  GDBusMethodInvocation* invocation);
static void _dbus_lxsession_console_kit_object_can_stop_ready (GObject * source_object,
                                                        GAsyncResult * _res_,
                                                        gpointer _user_data_);
static void lxsession_console_kit_object_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* lxsession_console_kit_object_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 lxsession_console_kit_object_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 _lxsession_console_kit_object_unregister_object (gpointer user_data);
VALA_EXTERN void lxsession_on_bus_aquired (GDBusConnection* conn);
VALA_EXTERN LxsessionLxdeSessionServer* lxsession_lxde_session_server_new (void);
VALA_EXTERN LxsessionLxdeSessionServer* lxsession_lxde_session_server_construct (GType object_type);
VALA_EXTERN GType lxsession_lxde_session_server_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LxsessionLxdeSessionServer, g_object_unref)
VALA_EXTERN guint lxsession_lxde_session_server_register_object (void* object,
                                                     GDBusConnection* connection,
                                                     const gchar* path,
                                                     GError** error);
VALA_EXTERN void lxsession_on_gnome_bus_aquired (GDBusConnection* conn);
VALA_EXTERN LxsessionGnomeSessionServer* lxsession_gnome_session_server_new (void);
VALA_EXTERN LxsessionGnomeSessionServer* lxsession_gnome_session_server_construct (GType object_type);
VALA_EXTERN GType lxsession_gnome_session_server_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LxsessionGnomeSessionServer, g_object_unref)
VALA_EXTERN guint lxsession_gnome_session_server_register_object (void* object,
                                                      GDBusConnection* connection,
                                                      const gchar* path,
                                                      GError** error);

static const GDBusArgInfo * const _lxsession_console_kit_object_dbus_arg_info_restart_in[] = {NULL};
static const GDBusArgInfo * const _lxsession_console_kit_object_dbus_arg_info_restart_out[] = {NULL};
static const GDBusMethodInfo _lxsession_console_kit_object_dbus_method_info_restart = {-1, "Restart", (GDBusArgInfo **) (&_lxsession_console_kit_object_dbus_arg_info_restart_in), (GDBusArgInfo **) (&_lxsession_console_kit_object_dbus_arg_info_restart_out), NULL};
static const GDBusArgInfo * const _lxsession_console_kit_object_dbus_arg_info_stop_in[] = {NULL};
static const GDBusArgInfo * const _lxsession_console_kit_object_dbus_arg_info_stop_out[] = {NULL};
static const GDBusMethodInfo _lxsession_console_kit_object_dbus_method_info_stop = {-1, "Stop", (GDBusArgInfo **) (&_lxsession_console_kit_object_dbus_arg_info_stop_in), (GDBusArgInfo **) (&_lxsession_console_kit_object_dbus_arg_info_stop_out), NULL};
static const GDBusArgInfo _lxsession_console_kit_object_dbus_arg_info_can_restart_result = {-1, "result", "b", NULL};
static const GDBusArgInfo * const _lxsession_console_kit_object_dbus_arg_info_can_restart_in[] = {NULL};
static const GDBusArgInfo * const _lxsession_console_kit_object_dbus_arg_info_can_restart_out[] = {&_lxsession_console_kit_object_dbus_arg_info_can_restart_result, NULL};
static const GDBusMethodInfo _lxsession_console_kit_object_dbus_method_info_can_restart = {-1, "CanRestart", (GDBusArgInfo **) (&_lxsession_console_kit_object_dbus_arg_info_can_restart_in), (GDBusArgInfo **) (&_lxsession_console_kit_object_dbus_arg_info_can_restart_out), NULL};
static const GDBusArgInfo _lxsession_console_kit_object_dbus_arg_info_can_stop_result = {-1, "result", "b", NULL};
static const GDBusArgInfo * const _lxsession_console_kit_object_dbus_arg_info_can_stop_in[] = {NULL};
static const GDBusArgInfo * const _lxsession_console_kit_object_dbus_arg_info_can_stop_out[] = {&_lxsession_console_kit_object_dbus_arg_info_can_stop_result, NULL};
static const GDBusMethodInfo _lxsession_console_kit_object_dbus_method_info_can_stop = {-1, "CanStop", (GDBusArgInfo **) (&_lxsession_console_kit_object_dbus_arg_info_can_stop_in), (GDBusArgInfo **) (&_lxsession_console_kit_object_dbus_arg_info_can_stop_out), NULL};
static const GDBusMethodInfo * const _lxsession_console_kit_object_dbus_method_info[] = {&_lxsession_console_kit_object_dbus_method_info_restart, &_lxsession_console_kit_object_dbus_method_info_stop, &_lxsession_console_kit_object_dbus_method_info_can_restart, &_lxsession_console_kit_object_dbus_method_info_can_stop, NULL};
static const GDBusSignalInfo * const _lxsession_console_kit_object_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo * const _lxsession_console_kit_object_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _lxsession_console_kit_object_dbus_interface_info = {-1, "org.freedesktop.ConsoleKit.Manager", (GDBusMethodInfo **) (&_lxsession_console_kit_object_dbus_method_info), (GDBusSignalInfo **) (&_lxsession_console_kit_object_dbus_signal_info), (GDBusPropertyInfo **) (&_lxsession_console_kit_object_dbus_property_info), NULL};
static const GDBusInterfaceVTable _lxsession_console_kit_object_dbus_interface_vtable = {lxsession_console_kit_object_dbus_interface_method_call, lxsession_console_kit_object_dbus_interface_get_property, lxsession_console_kit_object_dbus_interface_set_property};

LxsessionSessionObject*
lxsession_session_object_construct (GType object_type)
{
	LxsessionSessionObject * self = NULL;
	GError* _inner_error0_ = NULL;
	self = (LxsessionSessionObject*) g_object_new (object_type, NULL);
	{
		LxsessionConsoleKitObject* _tmp0_ = NULL;
		LxsessionConsoleKitObject* _tmp1_;
		LxsessionConsoleKitObject* _tmp2_;
		_tmp1_ = (LxsessionConsoleKitObject*) g_initable_new (LXSESSION_TYPE_CONSOLE_KIT_OBJECT_PROXY, NULL, &_inner_error0_, "g-flags", 0, "g-name", "org.freedesktop.ConsoleKit", "g-bus-type", G_BUS_TYPE_SYSTEM, "g-object-path", "/org/freedesktop/ConsoleKit/Manager", "g-interface-name", "org.freedesktop.ConsoleKit.Manager", NULL);
		_tmp0_ = (LxsessionConsoleKitObject*) _tmp1_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_IO_ERROR) {
				goto __catch0_g_io_error;
			}
			g_critical ("file %s: line %d: unexpected 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 NULL;
		}
		_tmp2_ = _tmp0_;
		_tmp0_ = NULL;
		_g_object_unref0 (self->dbus_interface);
		self->dbus_interface = _tmp2_;
		_g_object_unref0 (_tmp0_);
	}
	goto __finally0;
	__catch0_g_io_error:
	{
		g_clear_error (&_inner_error0_);
		g_message ("dbus-common.vala:37: Could not register service\n");
	}
	__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 NULL;
	}
	return self;
}

LxsessionSessionObject*
lxsession_session_object_new (void)
{
	return lxsession_session_object_construct (LXSESSION_TYPE_SESSION_OBJECT);
}

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

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

void
lxsession_session_object_lxsession_can_shutdown (LxsessionSessionObject* self,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_)
{
	LxsessionSessionObjectLxsessionCanShutdownData* _data_;
	LxsessionSessionObject* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (LxsessionSessionObjectLxsessionCanShutdownData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, lxsession_session_object_lxsession_can_shutdown_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	lxsession_session_object_lxsession_can_shutdown_co (_data_);
}

gboolean
lxsession_session_object_lxsession_can_shutdown_finish (LxsessionSessionObject* self,
                                                        GAsyncResult* _res_)
{
	gboolean result;
	LxsessionSessionObjectLxsessionCanShutdownData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
lxsession_session_object_lxsession_can_shutdown_ready (GObject* source_object,
                                                       GAsyncResult* _res_,
                                                       gpointer _user_data_)
{
	LxsessionSessionObjectLxsessionCanShutdownData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	lxsession_session_object_lxsession_can_shutdown_co (_data_);
}

static gboolean
lxsession_session_object_lxsession_can_shutdown_co (LxsessionSessionObjectLxsessionCanShutdownData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->can_shutdown_available = FALSE;
	{
		_data_->_tmp1_ = _data_->self->dbus_interface;
		_data_->_state_ = 1;
		lxsession_console_kit_object_can_stop (_data_->_tmp1_, lxsession_session_object_lxsession_can_shutdown_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp0_ = lxsession_console_kit_object_can_stop_finish (_data_->_tmp1_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (_data_->_inner_error0_->domain == G_IO_ERROR) {
				goto __catch0_g_io_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->can_shutdown_available = _data_->_tmp0_;
	}
	goto __finally0;
	__catch0_g_io_error:
	{
		_data_->err = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp2_ = _data_->err;
		_data_->_tmp3_ = _data_->_tmp2_->message;
		g_warning ("dbus-common.vala:47: %s", _data_->_tmp3_);
		_data_->can_shutdown_available = FALSE;
		_g_error_free0 (_data_->err);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->result = _data_->can_shutdown_available;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

void
lxsession_session_object_lxsession_shutdown (LxsessionSessionObject* self)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	{
		LxsessionConsoleKitObject* _tmp0_;
		_tmp0_ = self->dbus_interface;
		lxsession_console_kit_object_stop (_tmp0_, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_IO_ERROR) {
				goto __catch0_g_io_error;
			}
			g_critical ("file %s: line %d: unexpected 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;
		}
	}
	goto __finally0;
	__catch0_g_io_error:
	{
		GError* err = NULL;
		GError* _tmp1_;
		const gchar* _tmp2_;
		err = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp1_ = err;
		_tmp2_ = _tmp1_->message;
		g_warning ("dbus-common.vala:59: %s", _tmp2_);
		_g_error_free0 (err);
	}
	__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;
	}
}

void
lxsession_session_object_lxsession_restart (LxsessionSessionObject* self)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	{
		LxsessionConsoleKitObject* _tmp0_;
		_tmp0_ = self->dbus_interface;
		lxsession_console_kit_object_restart (_tmp0_, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_IO_ERROR) {
				goto __catch0_g_io_error;
			}
			g_critical ("file %s: line %d: unexpected 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;
		}
	}
	goto __finally0;
	__catch0_g_io_error:
	{
		GError* err = NULL;
		GError* _tmp1_;
		const gchar* _tmp2_;
		err = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp1_ = err;
		_tmp2_ = _tmp1_->message;
		g_warning ("dbus-common.vala:68: %s", _tmp2_);
		_g_error_free0 (err);
	}
	__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
lxsession_session_object_class_init (LxsessionSessionObjectClass * klass,
                                     gpointer klass_data)
{
	lxsession_session_object_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->finalize = lxsession_session_object_finalize;
}

static void
lxsession_session_object_instance_init (LxsessionSessionObject * self,
                                        gpointer klass)
{
}

static void
lxsession_session_object_finalize (GObject * obj)
{
	LxsessionSessionObject * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, LXSESSION_TYPE_SESSION_OBJECT, LxsessionSessionObject);
	_g_object_unref0 (self->dbus_interface);
	G_OBJECT_CLASS (lxsession_session_object_parent_class)->finalize (obj);
}

static GType
lxsession_session_object_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (LxsessionSessionObjectClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) lxsession_session_object_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LxsessionSessionObject), 0, (GInstanceInitFunc) lxsession_session_object_instance_init, NULL };
	GType lxsession_session_object_type_id;
	lxsession_session_object_type_id = g_type_register_static (G_TYPE_OBJECT, "LxsessionSessionObject", &g_define_type_info, 0);
	return lxsession_session_object_type_id;
}

GType
lxsession_session_object_get_type (void)
{
	static volatile gsize lxsession_session_object_type_id__once = 0;
	if (g_once_init_enter (&lxsession_session_object_type_id__once)) {
		GType lxsession_session_object_type_id;
		lxsession_session_object_type_id = lxsession_session_object_get_type_once ();
		g_once_init_leave (&lxsession_session_object_type_id__once, lxsession_session_object_type_id);
	}
	return lxsession_session_object_type_id__once;
}

void
lxsession_console_kit_object_restart (LxsessionConsoleKitObject* self,
                                      GError** error)
{
	LxsessionConsoleKitObjectIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = LXSESSION_CONSOLE_KIT_OBJECT_GET_INTERFACE (self);
	if (_iface_->restart) {
		_iface_->restart (self, error);
	}
}

void
lxsession_console_kit_object_stop (LxsessionConsoleKitObject* self,
                                   GError** error)
{
	LxsessionConsoleKitObjectIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = LXSESSION_CONSOLE_KIT_OBJECT_GET_INTERFACE (self);
	if (_iface_->stop) {
		_iface_->stop (self, error);
	}
}

void
lxsession_console_kit_object_can_restart (LxsessionConsoleKitObject* self,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_)
{
	LxsessionConsoleKitObjectIface* _iface_;
	_iface_ = LXSESSION_CONSOLE_KIT_OBJECT_GET_INTERFACE (self);
	if (_iface_->can_restart) {
		_iface_->can_restart (self, _callback_, _user_data_);
	}
}

gboolean
lxsession_console_kit_object_can_restart_finish (LxsessionConsoleKitObject* self,
                                                 GAsyncResult* _res_,
                                                 GError** error)
{
	LxsessionConsoleKitObjectIface* _iface_;
	_iface_ = LXSESSION_CONSOLE_KIT_OBJECT_GET_INTERFACE (self);
	if (_iface_->can_restart_finish) {
		return _iface_->can_restart_finish (self, _res_, error);
	}
	return FALSE;
}

void
lxsession_console_kit_object_can_stop (LxsessionConsoleKitObject* self,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_)
{
	LxsessionConsoleKitObjectIface* _iface_;
	_iface_ = LXSESSION_CONSOLE_KIT_OBJECT_GET_INTERFACE (self);
	if (_iface_->can_stop) {
		_iface_->can_stop (self, _callback_, _user_data_);
	}
}

gboolean
lxsession_console_kit_object_can_stop_finish (LxsessionConsoleKitObject* self,
                                              GAsyncResult* _res_,
                                              GError** error)
{
	LxsessionConsoleKitObjectIface* _iface_;
	_iface_ = LXSESSION_CONSOLE_KIT_OBJECT_GET_INTERFACE (self);
	if (_iface_->can_stop_finish) {
		return _iface_->can_stop_finish (self, _res_, error);
	}
	return FALSE;
}

static void
lxsession_console_kit_object_default_init (LxsessionConsoleKitObjectIface * iface,
                                           gpointer iface_data)
{
}

static GType
lxsession_console_kit_object_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (LxsessionConsoleKitObjectIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) lxsession_console_kit_object_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType lxsession_console_kit_object_type_id;
	lxsession_console_kit_object_type_id = g_type_register_static (G_TYPE_INTERFACE, "LxsessionConsoleKitObject", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (lxsession_console_kit_object_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (lxsession_console_kit_object_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) lxsession_console_kit_object_proxy_get_type);
	g_type_set_qdata (lxsession_console_kit_object_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.freedesktop.ConsoleKit.Manager");
	g_type_set_qdata (lxsession_console_kit_object_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_lxsession_console_kit_object_dbus_interface_info));
	g_type_set_qdata (lxsession_console_kit_object_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) lxsession_console_kit_object_register_object);
	return lxsession_console_kit_object_type_id;
}

GType
lxsession_console_kit_object_get_type (void)
{
	static volatile gsize lxsession_console_kit_object_type_id__once = 0;
	if (g_once_init_enter (&lxsession_console_kit_object_type_id__once)) {
		GType lxsession_console_kit_object_type_id;
		lxsession_console_kit_object_type_id = lxsession_console_kit_object_get_type_once ();
		g_once_init_leave (&lxsession_console_kit_object_type_id__once, lxsession_console_kit_object_type_id);
	}
	return lxsession_console_kit_object_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (LxsessionConsoleKitObjectProxy, lxsession_console_kit_object_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (LXSESSION_TYPE_CONSOLE_KIT_OBJECT, lxsession_console_kit_object_proxy_lxsession_console_kit_object_interface_init) )
static void
lxsession_console_kit_object_proxy_class_init (LxsessionConsoleKitObjectProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = lxsession_console_kit_object_proxy_g_signal;
}

static void
lxsession_console_kit_object_proxy_g_signal (GDBusProxy* proxy,
                                             const gchar* sender_name,
                                             const gchar* signal_name,
                                             GVariant* parameters)
{
}

static void
lxsession_console_kit_object_proxy_init (LxsessionConsoleKitObjectProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_lxsession_console_kit_object_dbus_interface_info));
}

static void
lxsession_console_kit_object_proxy_restart (LxsessionConsoleKitObject* self,
                                            GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	G_IO_ERROR;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.freedesktop.ConsoleKit.Manager", "Restart");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	_reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error);
	g_object_unref (_message);
	if (!_reply_message) {
		return;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return;
	}
	g_object_unref (_reply_message);
}

static void
lxsession_console_kit_object_proxy_stop (LxsessionConsoleKitObject* self,
                                         GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	G_IO_ERROR;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.freedesktop.ConsoleKit.Manager", "Stop");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	_reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error);
	g_object_unref (_message);
	if (!_reply_message) {
		return;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return;
	}
	g_object_unref (_reply_message);
}

static void
_vala_g_async_ready_callback (GObject *source_object,
                              GAsyncResult *res,
                              void *user_data)
{
	g_task_return_pointer (user_data, g_object_ref (res), g_object_unref);
	g_object_unref (user_data);
}

static void
lxsession_console_kit_object_proxy_can_restart_async (LxsessionConsoleKitObject* self,
                                                      GAsyncReadyCallback _callback_,
                                                      gpointer _user_data_)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	G_IO_ERROR;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.freedesktop.ConsoleKit.Manager", "CanRestart");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	if (_callback_ != NULL) {
		g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_task_new ((GObject *) self, NULL, _callback_, _user_data_));
	} else {
		g_dbus_message_set_flags (_message, G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED);
		g_dbus_connection_send_message (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	}
	g_object_unref (_message);
}

static gboolean
lxsession_console_kit_object_proxy_can_restart_finish (LxsessionConsoleKitObject* self,
                                                       GAsyncResult* _res_,
                                                       GError** error)
{
	GAsyncResult *_inner_res;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	gboolean _result = FALSE;
	GVariant* _tmp2_;
	_inner_res = g_task_propagate_pointer ((GTask *) _res_, NULL);
	_reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), _inner_res, error);
	g_object_unref (_inner_res);
	if (!_reply_message) {
		gboolean _tmp0_ = FALSE;
		return _tmp0_;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		gboolean _tmp1_ = FALSE;
		g_object_unref (_reply_message);
		return _tmp1_;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_tmp2_ = g_variant_iter_next_value (&_reply_iter);
	_result = g_variant_get_boolean (_tmp2_);
	g_variant_unref (_tmp2_);
	g_object_unref (_reply_message);
	return _result;
}

static void
lxsession_console_kit_object_proxy_can_stop_async (LxsessionConsoleKitObject* self,
                                                   GAsyncReadyCallback _callback_,
                                                   gpointer _user_data_)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	G_IO_ERROR;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.freedesktop.ConsoleKit.Manager", "CanStop");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	if (_callback_ != NULL) {
		g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_task_new ((GObject *) self, NULL, _callback_, _user_data_));
	} else {
		g_dbus_message_set_flags (_message, G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED);
		g_dbus_connection_send_message (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	}
	g_object_unref (_message);
}

static gboolean
lxsession_console_kit_object_proxy_can_stop_finish (LxsessionConsoleKitObject* self,
                                                    GAsyncResult* _res_,
                                                    GError** error)
{
	GAsyncResult *_inner_res;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	gboolean _result = FALSE;
	GVariant* _tmp5_;
	_inner_res = g_task_propagate_pointer ((GTask *) _res_, NULL);
	_reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), _inner_res, error);
	g_object_unref (_inner_res);
	if (!_reply_message) {
		gboolean _tmp3_ = FALSE;
		return _tmp3_;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		gboolean _tmp4_ = FALSE;
		g_object_unref (_reply_message);
		return _tmp4_;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_tmp5_ = g_variant_iter_next_value (&_reply_iter);
	_result = g_variant_get_boolean (_tmp5_);
	g_variant_unref (_tmp5_);
	g_object_unref (_reply_message);
	return _result;
}

static void
lxsession_console_kit_object_proxy_lxsession_console_kit_object_interface_init (LxsessionConsoleKitObjectIface* iface)
{
	iface->restart = lxsession_console_kit_object_proxy_restart;
	iface->stop = lxsession_console_kit_object_proxy_stop;
	iface->can_restart = lxsession_console_kit_object_proxy_can_restart_async;
	iface->can_restart_finish = lxsession_console_kit_object_proxy_can_restart_finish;
	iface->can_stop = lxsession_console_kit_object_proxy_can_stop_async;
	iface->can_stop_finish = lxsession_console_kit_object_proxy_can_stop_finish;
}

static void
_dbus_lxsession_console_kit_object_restart (LxsessionConsoleKitObject* 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_);
	lxsession_console_kit_object_restart (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_lxsession_console_kit_object_stop (LxsessionConsoleKitObject* 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_);
	lxsession_console_kit_object_stop (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_lxsession_console_kit_object_can_restart (LxsessionConsoleKitObject* self,
                                                GVariant* _parameters_,
                                                GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	LxsessionConsoleKitObjectCanRestartReadyData* _ready_data;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (LxsessionConsoleKitObjectCanRestartReadyData);
	_ready_data->_invocation_ = invocation;
	lxsession_console_kit_object_can_restart (self, (GAsyncReadyCallback) _dbus_lxsession_console_kit_object_can_restart_ready, _ready_data);
}

static void
_dbus_lxsession_console_kit_object_can_restart_ready (GObject * source_object,
                                                      GAsyncResult * _res_,
                                                      gpointer _user_data_)
{
	LxsessionConsoleKitObjectCanRestartReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gboolean result;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	result = lxsession_console_kit_object_can_restart_finish ((LxsessionConsoleKitObject*) source_object, _res_, &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);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_boolean (result));
	_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_slice_free (LxsessionConsoleKitObjectCanRestartReadyData, _ready_data);
}

static void
_dbus_lxsession_console_kit_object_can_stop (LxsessionConsoleKitObject* self,
                                             GVariant* _parameters_,
                                             GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	LxsessionConsoleKitObjectCanStopReadyData* _ready_data;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (LxsessionConsoleKitObjectCanStopReadyData);
	_ready_data->_invocation_ = invocation;
	lxsession_console_kit_object_can_stop (self, (GAsyncReadyCallback) _dbus_lxsession_console_kit_object_can_stop_ready, _ready_data);
}

static void
_dbus_lxsession_console_kit_object_can_stop_ready (GObject * source_object,
                                                   GAsyncResult * _res_,
                                                   gpointer _user_data_)
{
	LxsessionConsoleKitObjectCanStopReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gboolean result;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	result = lxsession_console_kit_object_can_stop_finish ((LxsessionConsoleKitObject*) source_object, _res_, &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);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_boolean (result));
	_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_slice_free (LxsessionConsoleKitObjectCanStopReadyData, _ready_data);
}

static void
lxsession_console_kit_object_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, "Restart") == 0) {
		_dbus_lxsession_console_kit_object_restart (object, parameters, invocation);
	} else if (strcmp (method_name, "Stop") == 0) {
		_dbus_lxsession_console_kit_object_stop (object, parameters, invocation);
	} else if (strcmp (method_name, "CanRestart") == 0) {
		_dbus_lxsession_console_kit_object_can_restart (object, parameters, invocation);
	} else if (strcmp (method_name, "CanStop") == 0) {
		_dbus_lxsession_console_kit_object_can_stop (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
lxsession_console_kit_object_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
lxsession_console_kit_object_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
lxsession_console_kit_object_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 *) (&_lxsession_console_kit_object_dbus_interface_info), &_lxsession_console_kit_object_dbus_interface_vtable, data, _lxsession_console_kit_object_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}

static void
_lxsession_console_kit_object_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);
}

void
lxsession_on_bus_aquired (GDBusConnection* conn)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (conn != NULL);
	{
		LxsessionLxdeSessionServer* _tmp0_;
		LxsessionLxdeSessionServer* _tmp1_;
		_tmp0_ = lxsession_lxde_session_server_new ();
		_tmp1_ = _tmp0_;
		lxsession_lxde_session_server_register_object (_tmp1_, conn, "/org/lxde/SessionManager", &_inner_error0_);
		_g_object_unref0 (_tmp1_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_IO_ERROR) {
				goto __catch0_g_io_error;
			}
			g_critical ("file %s: line %d: unexpected 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;
		}
	}
	goto __finally0;
	__catch0_g_io_error:
	{
		FILE* _tmp2_;
		g_clear_error (&_inner_error0_);
		_tmp2_ = stderr;
		fprintf (_tmp2_, "Could not register service\n");
	}
	__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;
	}
}

void
lxsession_on_gnome_bus_aquired (GDBusConnection* conn)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (conn != NULL);
	{
		LxsessionGnomeSessionServer* _tmp0_;
		LxsessionGnomeSessionServer* _tmp1_;
		_tmp0_ = lxsession_gnome_session_server_new ();
		_tmp1_ = _tmp0_;
		lxsession_gnome_session_server_register_object (_tmp1_, conn, "/org/gnome/SessionManager", &_inner_error0_);
		_g_object_unref0 (_tmp1_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_IO_ERROR) {
				goto __catch0_g_io_error;
			}
			g_critical ("file %s: line %d: unexpected 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;
		}
	}
	goto __finally0;
	__catch0_g_io_error:
	{
		FILE* _tmp2_;
		g_clear_error (&_inner_error0_);
		_tmp2_ = stderr;
		fprintf (_tmp2_, "Could not register service\n");
	}
	__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;
	}
}

