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

/*
 * SPDX-License-Identifier: GPL-3.0-or-later
 * SPDX-FileCopyrightText: 2018 Adam Bieńkowski
 *                         2025 elementary, Inc. (https://elementary.io)
 */
/* Reference code by the Solus Project:*/
/* https://github.com/solus-project/budgie-desktop/blob/master/src/wm/shim.vala*/

#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 GALA_TYPE_SESSION_MANAGER (gala_session_manager_get_type ())
#define GALA_SESSION_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GALA_TYPE_SESSION_MANAGER, GalaSessionManager))
#define GALA_SESSION_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GALA_TYPE_SESSION_MANAGER, GalaSessionManagerClass))
#define GALA_IS_SESSION_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GALA_TYPE_SESSION_MANAGER))
#define GALA_IS_SESSION_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GALA_TYPE_SESSION_MANAGER))
#define GALA_SESSION_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GALA_TYPE_SESSION_MANAGER, GalaSessionManagerClass))

typedef struct _GalaSessionManager GalaSessionManager;
typedef struct _GalaSessionManagerClass GalaSessionManagerClass;
typedef struct _GalaSessionManagerPrivate GalaSessionManagerPrivate;

#define GALA_SESSION_MANAGER_TYPE_WINGPANEL_END_SESSION_DIALOG (gala_session_manager_wingpanel_end_session_dialog_get_type ())
#define GALA_SESSION_MANAGER_WINGPANEL_END_SESSION_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GALA_SESSION_MANAGER_TYPE_WINGPANEL_END_SESSION_DIALOG, GalaSessionManagerWingpanelEndSessionDialog))
#define GALA_SESSION_MANAGER_IS_WINGPANEL_END_SESSION_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GALA_SESSION_MANAGER_TYPE_WINGPANEL_END_SESSION_DIALOG))
#define GALA_SESSION_MANAGER_WINGPANEL_END_SESSION_DIALOG_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GALA_SESSION_MANAGER_TYPE_WINGPANEL_END_SESSION_DIALOG, GalaSessionManagerWingpanelEndSessionDialogIface))

typedef struct _GalaSessionManagerWingpanelEndSessionDialog GalaSessionManagerWingpanelEndSessionDialog;
typedef struct _GalaSessionManagerWingpanelEndSessionDialogIface GalaSessionManagerWingpanelEndSessionDialogIface;

#define GALA_SESSION_MANAGER_TYPE_WINGPANEL_END_SESSION_DIALOG_PROXY (gala_session_manager_wingpanel_end_session_dialog_proxy_get_type ())
enum  {
	GALA_SESSION_MANAGER_0_PROPERTY,
	GALA_SESSION_MANAGER_NUM_PROPERTIES
};
static GParamSpec* gala_session_manager_properties[GALA_SESSION_MANAGER_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)))
enum  {
	GALA_SESSION_MANAGER_WINGPANEL_END_SESSION_DIALOG_CONFIRMED_LOGOUT_SIGNAL,
	GALA_SESSION_MANAGER_WINGPANEL_END_SESSION_DIALOG_CONFIRMED_REBOOT_SIGNAL,
	GALA_SESSION_MANAGER_WINGPANEL_END_SESSION_DIALOG_CONFIRMED_SHUTDOWN_SIGNAL,
	GALA_SESSION_MANAGER_WINGPANEL_END_SESSION_DIALOG_CANCELED_SIGNAL,
	GALA_SESSION_MANAGER_WINGPANEL_END_SESSION_DIALOG_CLOSED_SIGNAL,
	GALA_SESSION_MANAGER_WINGPANEL_END_SESSION_DIALOG_NUM_SIGNALS
};
static guint gala_session_manager_wingpanel_end_session_dialog_signals[GALA_SESSION_MANAGER_WINGPANEL_END_SESSION_DIALOG_NUM_SIGNALS] = {0};
typedef GDBusProxy GalaSessionManagerWingpanelEndSessionDialogProxy;
typedef GDBusProxyClass GalaSessionManagerWingpanelEndSessionDialogProxyClass;
enum  {
	GALA_SESSION_MANAGER_CONFIRMED_LOGOUT_SIGNAL,
	GALA_SESSION_MANAGER_CONFIRMED_REBOOT_SIGNAL,
	GALA_SESSION_MANAGER_CONFIRMED_SHUTDOWN_SIGNAL,
	GALA_SESSION_MANAGER_CANCELED_SIGNAL,
	GALA_SESSION_MANAGER_CLOSED_SIGNAL,
	GALA_SESSION_MANAGER_NUM_SIGNALS
};
static guint gala_session_manager_signals[GALA_SESSION_MANAGER_NUM_SIGNALS] = {0};

struct _GalaSessionManager {
	GObject parent_instance;
	GalaSessionManagerPrivate * priv;
};

struct _GalaSessionManagerClass {
	GObjectClass parent_class;
};

struct _GalaSessionManagerWingpanelEndSessionDialogIface {
	GTypeInterface parent_iface;
	void (*open) (GalaSessionManagerWingpanelEndSessionDialog* self, guint type, guint timestamp, guint open_length, char** inhibiters, gint inhibiters_length1, GError** error);
};

struct _GalaSessionManagerPrivate {
	GalaSessionManagerWingpanelEndSessionDialog* proxy;
};

static gint GalaSessionManager_private_offset;
static gpointer gala_session_manager_parent_class = NULL;
static GalaSessionManager* gala_session_manager_instance;
static GalaSessionManager* gala_session_manager_instance = NULL;

VALA_EXTERN GType gala_session_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GalaSessionManager, g_object_unref)
VALA_EXTERN guint gala_session_manager_register_object (void* object,
                                            GDBusConnection* connection,
                                            const gchar* path,
                                            GError** error);
VALA_EXTERN GType gala_session_manager_wingpanel_end_session_dialog_proxy_get_type (void) G_GNUC_CONST ;
static guint gala_session_manager_wingpanel_end_session_dialog_register_object (void* object,
                                                                         GDBusConnection* connection,
                                                                         const gchar* path,
                                                                         GError** error);
static GType gala_session_manager_wingpanel_end_session_dialog_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GalaSessionManagerWingpanelEndSessionDialog, g_object_unref)
VALA_EXTERN GalaSessionManager* gala_session_manager_init (void);
static GalaSessionManager* gala_session_manager_new (void);
static GalaSessionManager* gala_session_manager_construct (GType object_type);
static void gala_session_manager_proxy_appeared (GalaSessionManager* self);
static void _gala_session_manager_proxy_appeared_gbus_name_appeared_callback (GDBusConnection* connection,
                                                                       const gchar* name,
                                                                       const gchar* name_owner,
                                                                       gpointer self);
static void gala_session_manager_proxy_vanished (GalaSessionManager* self);
static void _gala_session_manager_proxy_vanished_gbus_name_vanished_callback (GDBusConnection* connection,
                                                                       const gchar* name,
                                                                       gpointer self);
static void gala_session_manager_get_proxy_cb (GalaSessionManager* self,
                                        GObject* o,
                                        GAsyncResult* res);
static void __lambda146_ (GalaSessionManager* self);
static void ___lambda146__gala_session_manager_wingpanel_end_session_dialog_confirmed_logout (GalaSessionManagerWingpanelEndSessionDialog* _sender,
                                                                                       gpointer self);
static void __lambda147_ (GalaSessionManager* self);
static void ___lambda147__gala_session_manager_wingpanel_end_session_dialog_confirmed_reboot (GalaSessionManagerWingpanelEndSessionDialog* _sender,
                                                                                       gpointer self);
static void __lambda148_ (GalaSessionManager* self);
static void ___lambda148__gala_session_manager_wingpanel_end_session_dialog_confirmed_shutdown (GalaSessionManagerWingpanelEndSessionDialog* _sender,
                                                                                         gpointer self);
static void __lambda149_ (GalaSessionManager* self);
static void ___lambda149__gala_session_manager_wingpanel_end_session_dialog_canceled (GalaSessionManagerWingpanelEndSessionDialog* _sender,
                                                                               gpointer self);
static void __lambda150_ (GalaSessionManager* self);
static void ___lambda150__gala_session_manager_wingpanel_end_session_dialog_closed (GalaSessionManagerWingpanelEndSessionDialog* _sender,
                                                                             gpointer self);
static void _gala_session_manager_get_proxy_cb_gasync_ready_callback (GObject* source_object,
                                                               GAsyncResult* res,
                                                               gpointer self);
VALA_EXTERN void gala_session_manager_open (GalaSessionManager* self,
                                guint type,
                                guint timestamp,
                                guint open_length,
                                char** inhibiters,
                                gint inhibiters_length1,
                                GError** error);
static void gala_session_manager_wingpanel_end_session_dialog_open (GalaSessionManagerWingpanelEndSessionDialog* self,
                                                             guint type,
                                                             guint timestamp,
                                                             guint open_length,
                                                             char** inhibiters,
                                                             gint inhibiters_length1,
                                                             GError** error);
static GType gala_session_manager_wingpanel_end_session_dialog_get_type_once (void);
static void gala_session_manager_wingpanel_end_session_dialog_proxy_g_signal (GDBusProxy* proxy,
                                                                       const gchar* sender_name,
                                                                       const gchar* signal_name,
                                                                       GVariant* parameters);
static void _dbus_handle_gala_session_manager_wingpanel_end_session_dialog_confirmed_logout (GalaSessionManagerWingpanelEndSessionDialog* self,
                                                                                      GVariant* parameters);
static void _dbus_handle_gala_session_manager_wingpanel_end_session_dialog_confirmed_reboot (GalaSessionManagerWingpanelEndSessionDialog* self,
                                                                                      GVariant* parameters);
static void _dbus_handle_gala_session_manager_wingpanel_end_session_dialog_confirmed_shutdown (GalaSessionManagerWingpanelEndSessionDialog* self,
                                                                                        GVariant* parameters);
static void _dbus_handle_gala_session_manager_wingpanel_end_session_dialog_canceled (GalaSessionManagerWingpanelEndSessionDialog* self,
                                                                              GVariant* parameters);
static void _dbus_handle_gala_session_manager_wingpanel_end_session_dialog_closed (GalaSessionManagerWingpanelEndSessionDialog* self,
                                                                            GVariant* parameters);
static void gala_session_manager_wingpanel_end_session_dialog_proxy_open (GalaSessionManagerWingpanelEndSessionDialog* self,
                                                                   guint type,
                                                                   guint timestamp,
                                                                   guint open_length,
                                                                   char** inhibiters,
                                                                   gint inhibiters_length1,
                                                                   GError** error);
static void gala_session_manager_wingpanel_end_session_dialog_proxy_gala_session_manager_wingpanel_end_session_dialog_interface_init (GalaSessionManagerWingpanelEndSessionDialogIface* iface);
static void _dbus_gala_session_manager_wingpanel_end_session_dialog_open (GalaSessionManagerWingpanelEndSessionDialog* self,
                                                                   GVariant* _parameters_,
                                                                   GDBusMethodInvocation* invocation);
static void gala_session_manager_wingpanel_end_session_dialog_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* gala_session_manager_wingpanel_end_session_dialog_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 gala_session_manager_wingpanel_end_session_dialog_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 _dbus_gala_session_manager_wingpanel_end_session_dialog_confirmed_logout (GObject* _sender,
                                                                               gpointer* _data);
static void _dbus_gala_session_manager_wingpanel_end_session_dialog_confirmed_reboot (GObject* _sender,
                                                                               gpointer* _data);
static void _dbus_gala_session_manager_wingpanel_end_session_dialog_confirmed_shutdown (GObject* _sender,
                                                                                 gpointer* _data);
static void _dbus_gala_session_manager_wingpanel_end_session_dialog_canceled (GObject* _sender,
                                                                       gpointer* _data);
static void _dbus_gala_session_manager_wingpanel_end_session_dialog_closed (GObject* _sender,
                                                                     gpointer* _data);
static void _gala_session_manager_wingpanel_end_session_dialog_unregister_object (gpointer user_data);
static void gala_session_manager_finalize (GObject * obj);
static GType gala_session_manager_get_type_once (void);
static void _dbus_gala_session_manager_open (GalaSessionManager* self,
                                      GVariant* _parameters_,
                                      GDBusMethodInvocation* invocation);
static void gala_session_manager_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* gala_session_manager_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 gala_session_manager_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 _dbus_gala_session_manager_confirmed_logout (GObject* _sender,
                                                  gpointer* _data);
static void _dbus_gala_session_manager_confirmed_reboot (GObject* _sender,
                                                  gpointer* _data);
static void _dbus_gala_session_manager_confirmed_shutdown (GObject* _sender,
                                                    gpointer* _data);
static void _dbus_gala_session_manager_canceled (GObject* _sender,
                                          gpointer* _data);
static void _dbus_gala_session_manager_closed (GObject* _sender,
                                        gpointer* _data);
static void _gala_session_manager_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 _gala_session_manager_wingpanel_end_session_dialog_dbus_arg_info_open_type = {-1, "type", "u", NULL};
static const GDBusArgInfo _gala_session_manager_wingpanel_end_session_dialog_dbus_arg_info_open_timestamp = {-1, "timestamp", "u", NULL};
static const GDBusArgInfo _gala_session_manager_wingpanel_end_session_dialog_dbus_arg_info_open_open_length = {-1, "open_length", "u", NULL};
static const GDBusArgInfo _gala_session_manager_wingpanel_end_session_dialog_dbus_arg_info_open_inhibiters = {-1, "inhibiters", "ao", NULL};
static const GDBusArgInfo * const _gala_session_manager_wingpanel_end_session_dialog_dbus_arg_info_open_in[] = {&_gala_session_manager_wingpanel_end_session_dialog_dbus_arg_info_open_type, &_gala_session_manager_wingpanel_end_session_dialog_dbus_arg_info_open_timestamp, &_gala_session_manager_wingpanel_end_session_dialog_dbus_arg_info_open_open_length, &_gala_session_manager_wingpanel_end_session_dialog_dbus_arg_info_open_inhibiters, NULL};
static const GDBusArgInfo * const _gala_session_manager_wingpanel_end_session_dialog_dbus_arg_info_open_out[] = {NULL};
static const GDBusMethodInfo _gala_session_manager_wingpanel_end_session_dialog_dbus_method_info_open = {-1, "Open", (GDBusArgInfo **) (&_gala_session_manager_wingpanel_end_session_dialog_dbus_arg_info_open_in), (GDBusArgInfo **) (&_gala_session_manager_wingpanel_end_session_dialog_dbus_arg_info_open_out), NULL};
static const GDBusMethodInfo * const _gala_session_manager_wingpanel_end_session_dialog_dbus_method_info[] = {&_gala_session_manager_wingpanel_end_session_dialog_dbus_method_info_open, NULL};
static const GDBusArgInfo * const _gala_session_manager_wingpanel_end_session_dialog_dbus_arg_info_confirmed_logout[] = {NULL};
static const GDBusSignalInfo _gala_session_manager_wingpanel_end_session_dialog_dbus_signal_info_confirmed_logout = {-1, "ConfirmedLogout", (GDBusArgInfo **) (&_gala_session_manager_wingpanel_end_session_dialog_dbus_arg_info_confirmed_logout), NULL};
static const GDBusArgInfo * const _gala_session_manager_wingpanel_end_session_dialog_dbus_arg_info_confirmed_reboot[] = {NULL};
static const GDBusSignalInfo _gala_session_manager_wingpanel_end_session_dialog_dbus_signal_info_confirmed_reboot = {-1, "ConfirmedReboot", (GDBusArgInfo **) (&_gala_session_manager_wingpanel_end_session_dialog_dbus_arg_info_confirmed_reboot), NULL};
static const GDBusArgInfo * const _gala_session_manager_wingpanel_end_session_dialog_dbus_arg_info_confirmed_shutdown[] = {NULL};
static const GDBusSignalInfo _gala_session_manager_wingpanel_end_session_dialog_dbus_signal_info_confirmed_shutdown = {-1, "ConfirmedShutdown", (GDBusArgInfo **) (&_gala_session_manager_wingpanel_end_session_dialog_dbus_arg_info_confirmed_shutdown), NULL};
static const GDBusArgInfo * const _gala_session_manager_wingpanel_end_session_dialog_dbus_arg_info_canceled[] = {NULL};
static const GDBusSignalInfo _gala_session_manager_wingpanel_end_session_dialog_dbus_signal_info_canceled = {-1, "Canceled", (GDBusArgInfo **) (&_gala_session_manager_wingpanel_end_session_dialog_dbus_arg_info_canceled), NULL};
static const GDBusArgInfo * const _gala_session_manager_wingpanel_end_session_dialog_dbus_arg_info_closed[] = {NULL};
static const GDBusSignalInfo _gala_session_manager_wingpanel_end_session_dialog_dbus_signal_info_closed = {-1, "Closed", (GDBusArgInfo **) (&_gala_session_manager_wingpanel_end_session_dialog_dbus_arg_info_closed), NULL};
static const GDBusSignalInfo * const _gala_session_manager_wingpanel_end_session_dialog_dbus_signal_info[] = {&_gala_session_manager_wingpanel_end_session_dialog_dbus_signal_info_confirmed_logout, &_gala_session_manager_wingpanel_end_session_dialog_dbus_signal_info_confirmed_reboot, &_gala_session_manager_wingpanel_end_session_dialog_dbus_signal_info_confirmed_shutdown, &_gala_session_manager_wingpanel_end_session_dialog_dbus_signal_info_canceled, &_gala_session_manager_wingpanel_end_session_dialog_dbus_signal_info_closed, NULL};
static const GDBusPropertyInfo * const _gala_session_manager_wingpanel_end_session_dialog_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _gala_session_manager_wingpanel_end_session_dialog_dbus_interface_info = {-1, "io.elementary.wingpanel.session.EndSessionDialog", (GDBusMethodInfo **) (&_gala_session_manager_wingpanel_end_session_dialog_dbus_method_info), (GDBusSignalInfo **) (&_gala_session_manager_wingpanel_end_session_dialog_dbus_signal_info), (GDBusPropertyInfo **) (&_gala_session_manager_wingpanel_end_session_dialog_dbus_property_info), NULL};
static const GDBusInterfaceVTable _gala_session_manager_wingpanel_end_session_dialog_dbus_interface_vtable = {gala_session_manager_wingpanel_end_session_dialog_dbus_interface_method_call, gala_session_manager_wingpanel_end_session_dialog_dbus_interface_get_property, gala_session_manager_wingpanel_end_session_dialog_dbus_interface_set_property};
static const GDBusArgInfo _gala_session_manager_dbus_arg_info_open_type = {-1, "type", "u", NULL};
static const GDBusArgInfo _gala_session_manager_dbus_arg_info_open_timestamp = {-1, "timestamp", "u", NULL};
static const GDBusArgInfo _gala_session_manager_dbus_arg_info_open_open_length = {-1, "open_length", "u", NULL};
static const GDBusArgInfo _gala_session_manager_dbus_arg_info_open_inhibiters = {-1, "inhibiters", "ao", NULL};
static const GDBusArgInfo * const _gala_session_manager_dbus_arg_info_open_in[] = {&_gala_session_manager_dbus_arg_info_open_type, &_gala_session_manager_dbus_arg_info_open_timestamp, &_gala_session_manager_dbus_arg_info_open_open_length, &_gala_session_manager_dbus_arg_info_open_inhibiters, NULL};
static const GDBusArgInfo * const _gala_session_manager_dbus_arg_info_open_out[] = {NULL};
static const GDBusMethodInfo _gala_session_manager_dbus_method_info_open = {-1, "Open", (GDBusArgInfo **) (&_gala_session_manager_dbus_arg_info_open_in), (GDBusArgInfo **) (&_gala_session_manager_dbus_arg_info_open_out), NULL};
static const GDBusMethodInfo * const _gala_session_manager_dbus_method_info[] = {&_gala_session_manager_dbus_method_info_open, NULL};
static const GDBusArgInfo * const _gala_session_manager_dbus_arg_info_confirmed_logout[] = {NULL};
static const GDBusSignalInfo _gala_session_manager_dbus_signal_info_confirmed_logout = {-1, "ConfirmedLogout", (GDBusArgInfo **) (&_gala_session_manager_dbus_arg_info_confirmed_logout), NULL};
static const GDBusArgInfo * const _gala_session_manager_dbus_arg_info_confirmed_reboot[] = {NULL};
static const GDBusSignalInfo _gala_session_manager_dbus_signal_info_confirmed_reboot = {-1, "ConfirmedReboot", (GDBusArgInfo **) (&_gala_session_manager_dbus_arg_info_confirmed_reboot), NULL};
static const GDBusArgInfo * const _gala_session_manager_dbus_arg_info_confirmed_shutdown[] = {NULL};
static const GDBusSignalInfo _gala_session_manager_dbus_signal_info_confirmed_shutdown = {-1, "ConfirmedShutdown", (GDBusArgInfo **) (&_gala_session_manager_dbus_arg_info_confirmed_shutdown), NULL};
static const GDBusArgInfo * const _gala_session_manager_dbus_arg_info_canceled[] = {NULL};
static const GDBusSignalInfo _gala_session_manager_dbus_signal_info_canceled = {-1, "Canceled", (GDBusArgInfo **) (&_gala_session_manager_dbus_arg_info_canceled), NULL};
static const GDBusArgInfo * const _gala_session_manager_dbus_arg_info_closed[] = {NULL};
static const GDBusSignalInfo _gala_session_manager_dbus_signal_info_closed = {-1, "Closed", (GDBusArgInfo **) (&_gala_session_manager_dbus_arg_info_closed), NULL};
static const GDBusSignalInfo * const _gala_session_manager_dbus_signal_info[] = {&_gala_session_manager_dbus_signal_info_confirmed_logout, &_gala_session_manager_dbus_signal_info_confirmed_reboot, &_gala_session_manager_dbus_signal_info_confirmed_shutdown, &_gala_session_manager_dbus_signal_info_canceled, &_gala_session_manager_dbus_signal_info_closed, NULL};
static const GDBusPropertyInfo * const _gala_session_manager_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _gala_session_manager_dbus_interface_info = {-1, "org.gnome.SessionManager.EndSessionDialog", (GDBusMethodInfo **) (&_gala_session_manager_dbus_method_info), (GDBusSignalInfo **) (&_gala_session_manager_dbus_signal_info), (GDBusPropertyInfo **) (&_gala_session_manager_dbus_property_info), NULL};
static const GDBusInterfaceVTable _gala_session_manager_dbus_interface_vtable = {gala_session_manager_dbus_interface_method_call, gala_session_manager_dbus_interface_get_property, gala_session_manager_dbus_interface_set_property};

static inline gpointer
gala_session_manager_get_instance_private (GalaSessionManager* self)
{
	return G_STRUCT_MEMBER_P (self, GalaSessionManager_private_offset);
}

GalaSessionManager*
gala_session_manager_init (void)
{
	GalaSessionManager* _tmp0_;
	GalaSessionManager* _tmp2_;
	GalaSessionManager* result;
	_tmp0_ = gala_session_manager_instance;
	if (_tmp0_ == NULL) {
		GalaSessionManager* _tmp1_;
		_tmp1_ = gala_session_manager_new ();
		_g_object_unref0 (gala_session_manager_instance);
		gala_session_manager_instance = _tmp1_;
	}
	_tmp2_ = gala_session_manager_instance;
	result = _tmp2_;
	return result;
}

static void
_gala_session_manager_proxy_appeared_gbus_name_appeared_callback (GDBusConnection* connection,
                                                                  const gchar* name,
                                                                  const gchar* name_owner,
                                                                  gpointer self)
{
	gala_session_manager_proxy_appeared ((GalaSessionManager*) self);
}

static void
_gala_session_manager_proxy_vanished_gbus_name_vanished_callback (GDBusConnection* connection,
                                                                  const gchar* name,
                                                                  gpointer self)
{
	gala_session_manager_proxy_vanished ((GalaSessionManager*) self);
}

static GalaSessionManager*
gala_session_manager_construct (GType object_type)
{
	GalaSessionManager * self = NULL;
	self = (GalaSessionManager*) g_object_new (object_type, NULL);
	g_bus_watch_name_with_closures (G_BUS_TYPE_SESSION, "io.elementary.wingpanel.session.EndSessionDialog", G_BUS_NAME_WATCHER_FLAGS_NONE, (GClosure*) ((_gala_session_manager_proxy_appeared_gbus_name_appeared_callback == NULL) ? NULL : g_cclosure_new ((GCallback) _gala_session_manager_proxy_appeared_gbus_name_appeared_callback, g_object_ref (self), (GClosureNotify) g_object_unref)), (GClosure*) ((_gala_session_manager_proxy_vanished_gbus_name_vanished_callback == NULL) ? NULL : g_cclosure_new ((GCallback) _gala_session_manager_proxy_vanished_gbus_name_vanished_callback, g_object_ref (self), (GClosureNotify) g_object_unref)));
	return self;
}

static GalaSessionManager*
gala_session_manager_new (void)
{
	return gala_session_manager_construct (GALA_TYPE_SESSION_MANAGER);
}

static void
__lambda146_ (GalaSessionManager* self)
{
	g_signal_emit (self, gala_session_manager_signals[GALA_SESSION_MANAGER_CONFIRMED_LOGOUT_SIGNAL], 0);
}

static void
___lambda146__gala_session_manager_wingpanel_end_session_dialog_confirmed_logout (GalaSessionManagerWingpanelEndSessionDialog* _sender,
                                                                                  gpointer self)
{
	__lambda146_ ((GalaSessionManager*) self);
}

static void
__lambda147_ (GalaSessionManager* self)
{
	g_signal_emit (self, gala_session_manager_signals[GALA_SESSION_MANAGER_CONFIRMED_REBOOT_SIGNAL], 0);
}

static void
___lambda147__gala_session_manager_wingpanel_end_session_dialog_confirmed_reboot (GalaSessionManagerWingpanelEndSessionDialog* _sender,
                                                                                  gpointer self)
{
	__lambda147_ ((GalaSessionManager*) self);
}

static void
__lambda148_ (GalaSessionManager* self)
{
	g_signal_emit (self, gala_session_manager_signals[GALA_SESSION_MANAGER_CONFIRMED_SHUTDOWN_SIGNAL], 0);
}

static void
___lambda148__gala_session_manager_wingpanel_end_session_dialog_confirmed_shutdown (GalaSessionManagerWingpanelEndSessionDialog* _sender,
                                                                                    gpointer self)
{
	__lambda148_ ((GalaSessionManager*) self);
}

static void
__lambda149_ (GalaSessionManager* self)
{
	g_signal_emit (self, gala_session_manager_signals[GALA_SESSION_MANAGER_CANCELED_SIGNAL], 0);
}

static void
___lambda149__gala_session_manager_wingpanel_end_session_dialog_canceled (GalaSessionManagerWingpanelEndSessionDialog* _sender,
                                                                          gpointer self)
{
	__lambda149_ ((GalaSessionManager*) self);
}

static void
__lambda150_ (GalaSessionManager* self)
{
	g_signal_emit (self, gala_session_manager_signals[GALA_SESSION_MANAGER_CLOSED_SIGNAL], 0);
}

static void
___lambda150__gala_session_manager_wingpanel_end_session_dialog_closed (GalaSessionManagerWingpanelEndSessionDialog* _sender,
                                                                        gpointer self)
{
	__lambda150_ ((GalaSessionManager*) self);
}

static void
gala_session_manager_get_proxy_cb (GalaSessionManager* self,
                                   GObject* o,
                                   GAsyncResult* res)
{
	GalaSessionManagerWingpanelEndSessionDialog* _tmp6_;
	GalaSessionManagerWingpanelEndSessionDialog* _tmp7_;
	GalaSessionManagerWingpanelEndSessionDialog* _tmp8_;
	GalaSessionManagerWingpanelEndSessionDialog* _tmp9_;
	GalaSessionManagerWingpanelEndSessionDialog* _tmp10_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	{
		GalaSessionManagerWingpanelEndSessionDialog* _tmp0_ = NULL;
		GalaSessionManagerWingpanelEndSessionDialog* _tmp1_;
		GalaSessionManagerWingpanelEndSessionDialog* _tmp2_;
		GalaSessionManagerWingpanelEndSessionDialog* _tmp3_;
		_tmp1_ = g_async_result_get_source_object (res);
		_tmp2_ = (GalaSessionManagerWingpanelEndSessionDialog*) g_async_initable_new_finish ((GAsyncInitable *) _tmp1_, res, &_inner_error0_);
		g_object_unref (_tmp1_);
		_tmp0_ = (GalaSessionManagerWingpanelEndSessionDialog*) _tmp2_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp3_ = _tmp0_;
		_tmp0_ = NULL;
		_g_object_unref0 (self->priv->proxy);
		self->priv->proxy = _tmp3_;
		_g_object_unref0 (_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp4_;
		const gchar* _tmp5_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp4_ = e;
		_tmp5_ = _tmp4_->message;
		g_warning ("SessionManager.vala:51: Could not connect to io.elementary.wingpanel.s" \
"ession.EndSessionDialog proxy: %s", _tmp5_);
		_g_error_free0 (e);
		return;
	}
	__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;
	}
	_tmp6_ = self->priv->proxy;
	g_signal_connect_object (_tmp6_, "confirmed-logout", (GCallback) ___lambda146__gala_session_manager_wingpanel_end_session_dialog_confirmed_logout, self, 0);
	_tmp7_ = self->priv->proxy;
	g_signal_connect_object (_tmp7_, "confirmed-reboot", (GCallback) ___lambda147__gala_session_manager_wingpanel_end_session_dialog_confirmed_reboot, self, 0);
	_tmp8_ = self->priv->proxy;
	g_signal_connect_object (_tmp8_, "confirmed-shutdown", (GCallback) ___lambda148__gala_session_manager_wingpanel_end_session_dialog_confirmed_shutdown, self, 0);
	_tmp9_ = self->priv->proxy;
	g_signal_connect_object (_tmp9_, "canceled", (GCallback) ___lambda149__gala_session_manager_wingpanel_end_session_dialog_canceled, self, 0);
	_tmp10_ = self->priv->proxy;
	g_signal_connect_object (_tmp10_, "closed", (GCallback) ___lambda150__gala_session_manager_wingpanel_end_session_dialog_closed, self, 0);
}

static void
_gala_session_manager_get_proxy_cb_gasync_ready_callback (GObject* source_object,
                                                          GAsyncResult* res,
                                                          gpointer self)
{
	gala_session_manager_get_proxy_cb ((GalaSessionManager*) self, source_object, res);
	g_object_unref (self);
}

static void
gala_session_manager_proxy_appeared (GalaSessionManager* self)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_async_initable_new_async (GALA_SESSION_MANAGER_TYPE_WINGPANEL_END_SESSION_DIALOG_PROXY, 0, NULL, _gala_session_manager_get_proxy_cb_gasync_ready_callback, g_object_ref (self), "g-flags", 0, "g-name", "io.elementary.wingpanel.session.EndSessionDialog", "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/io/elementary/wingpanel/session/EndSessionDialog", "g-interface-name", "io.elementary.wingpanel.session.EndSessionDialog", NULL);
}

static void
gala_session_manager_proxy_vanished (GalaSessionManager* self)
{
	g_return_if_fail (self != NULL);
	_g_object_unref0 (self->priv->proxy);
	self->priv->proxy = NULL;
}

void
gala_session_manager_open (GalaSessionManager* self,
                           guint type,
                           guint timestamp,
                           guint open_length,
                           char** inhibiters,
                           gint inhibiters_length1,
                           GError** error)
{
	GalaSessionManagerWingpanelEndSessionDialog* _tmp0_;
	GalaSessionManagerWingpanelEndSessionDialog* _tmp2_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->proxy;
	if (_tmp0_ == NULL) {
		GError* _tmp1_;
		_tmp1_ = g_error_new_literal (G_DBUS_ERROR, G_DBUS_ERROR_FAILED, "io.elementary.wingpanel.session.EndSessionDialog DBus interface is not" \
" registered.");
		_inner_error0_ = _tmp1_;
		if ((_inner_error0_->domain == G_DBUS_ERROR) || (_inner_error0_->domain == G_IO_ERROR)) {
			g_propagate_error (error, _inner_error0_);
			return;
		} else {
			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;
		}
	}
	_tmp2_ = self->priv->proxy;
	gala_session_manager_wingpanel_end_session_dialog_open (_tmp2_, type, timestamp, open_length, inhibiters, (gint) inhibiters_length1, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if ((_inner_error0_->domain == G_DBUS_ERROR) || (_inner_error0_->domain == G_IO_ERROR)) {
			g_propagate_error (error, _inner_error0_);
			return;
		} else {
			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
gala_session_manager_wingpanel_end_session_dialog_open (GalaSessionManagerWingpanelEndSessionDialog* self,
                                                        guint type,
                                                        guint timestamp,
                                                        guint open_length,
                                                        char** inhibiters,
                                                        gint inhibiters_length1,
                                                        GError** error)
{
	GalaSessionManagerWingpanelEndSessionDialogIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = GALA_SESSION_MANAGER_WINGPANEL_END_SESSION_DIALOG_GET_INTERFACE (self);
	if (_iface_->open) {
		_iface_->open (self, type, timestamp, open_length, inhibiters, inhibiters_length1, error);
	}
}

static void
gala_session_manager_wingpanel_end_session_dialog_default_init (GalaSessionManagerWingpanelEndSessionDialogIface * iface,
                                                                gpointer iface_data)
{
	gala_session_manager_wingpanel_end_session_dialog_signals[GALA_SESSION_MANAGER_WINGPANEL_END_SESSION_DIALOG_CONFIRMED_LOGOUT_SIGNAL] = g_signal_new ("confirmed-logout", GALA_SESSION_MANAGER_TYPE_WINGPANEL_END_SESSION_DIALOG, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gala_session_manager_wingpanel_end_session_dialog_signals[GALA_SESSION_MANAGER_WINGPANEL_END_SESSION_DIALOG_CONFIRMED_REBOOT_SIGNAL] = g_signal_new ("confirmed-reboot", GALA_SESSION_MANAGER_TYPE_WINGPANEL_END_SESSION_DIALOG, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gala_session_manager_wingpanel_end_session_dialog_signals[GALA_SESSION_MANAGER_WINGPANEL_END_SESSION_DIALOG_CONFIRMED_SHUTDOWN_SIGNAL] = g_signal_new ("confirmed-shutdown", GALA_SESSION_MANAGER_TYPE_WINGPANEL_END_SESSION_DIALOG, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gala_session_manager_wingpanel_end_session_dialog_signals[GALA_SESSION_MANAGER_WINGPANEL_END_SESSION_DIALOG_CANCELED_SIGNAL] = g_signal_new ("canceled", GALA_SESSION_MANAGER_TYPE_WINGPANEL_END_SESSION_DIALOG, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gala_session_manager_wingpanel_end_session_dialog_signals[GALA_SESSION_MANAGER_WINGPANEL_END_SESSION_DIALOG_CLOSED_SIGNAL] = g_signal_new ("closed", GALA_SESSION_MANAGER_TYPE_WINGPANEL_END_SESSION_DIALOG, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

 G_GNUC_NO_INLINE static GType
gala_session_manager_wingpanel_end_session_dialog_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GalaSessionManagerWingpanelEndSessionDialogIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gala_session_manager_wingpanel_end_session_dialog_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType gala_session_manager_wingpanel_end_session_dialog_type_id;
	gala_session_manager_wingpanel_end_session_dialog_type_id = g_type_register_static (G_TYPE_INTERFACE, "GalaSessionManagerWingpanelEndSessionDialog", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (gala_session_manager_wingpanel_end_session_dialog_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (gala_session_manager_wingpanel_end_session_dialog_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) gala_session_manager_wingpanel_end_session_dialog_proxy_get_type);
	g_type_set_qdata (gala_session_manager_wingpanel_end_session_dialog_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "io.elementary.wingpanel.session.EndSessionDialog");
	g_type_set_qdata (gala_session_manager_wingpanel_end_session_dialog_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_gala_session_manager_wingpanel_end_session_dialog_dbus_interface_info));
	g_type_set_qdata (gala_session_manager_wingpanel_end_session_dialog_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) gala_session_manager_wingpanel_end_session_dialog_register_object);
	return gala_session_manager_wingpanel_end_session_dialog_type_id;
}

static GType
gala_session_manager_wingpanel_end_session_dialog_get_type (void)
{
	static gsize gala_session_manager_wingpanel_end_session_dialog_type_id__once = 0;
	if (g_once_init_enter (&gala_session_manager_wingpanel_end_session_dialog_type_id__once)) {
		GType gala_session_manager_wingpanel_end_session_dialog_type_id;
		gala_session_manager_wingpanel_end_session_dialog_type_id = gala_session_manager_wingpanel_end_session_dialog_get_type_once ();
		g_once_init_leave (&gala_session_manager_wingpanel_end_session_dialog_type_id__once, gala_session_manager_wingpanel_end_session_dialog_type_id);
	}
	return gala_session_manager_wingpanel_end_session_dialog_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (GalaSessionManagerWingpanelEndSessionDialogProxy, gala_session_manager_wingpanel_end_session_dialog_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (GALA_SESSION_MANAGER_TYPE_WINGPANEL_END_SESSION_DIALOG, gala_session_manager_wingpanel_end_session_dialog_proxy_gala_session_manager_wingpanel_end_session_dialog_interface_init) )
static void
gala_session_manager_wingpanel_end_session_dialog_proxy_class_init (GalaSessionManagerWingpanelEndSessionDialogProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = gala_session_manager_wingpanel_end_session_dialog_proxy_g_signal;
}

static void
_dbus_handle_gala_session_manager_wingpanel_end_session_dialog_confirmed_logout (GalaSessionManagerWingpanelEndSessionDialog* self,
                                                                                 GVariant* parameters)
{
	GVariantIter _arguments_iter;
	g_variant_iter_init (&_arguments_iter, parameters);
	g_signal_emit_by_name (self, "confirmed-logout");
}

static void
_dbus_handle_gala_session_manager_wingpanel_end_session_dialog_confirmed_reboot (GalaSessionManagerWingpanelEndSessionDialog* self,
                                                                                 GVariant* parameters)
{
	GVariantIter _arguments_iter;
	g_variant_iter_init (&_arguments_iter, parameters);
	g_signal_emit_by_name (self, "confirmed-reboot");
}

static void
_dbus_handle_gala_session_manager_wingpanel_end_session_dialog_confirmed_shutdown (GalaSessionManagerWingpanelEndSessionDialog* self,
                                                                                   GVariant* parameters)
{
	GVariantIter _arguments_iter;
	g_variant_iter_init (&_arguments_iter, parameters);
	g_signal_emit_by_name (self, "confirmed-shutdown");
}

static void
_dbus_handle_gala_session_manager_wingpanel_end_session_dialog_canceled (GalaSessionManagerWingpanelEndSessionDialog* self,
                                                                         GVariant* parameters)
{
	GVariantIter _arguments_iter;
	g_variant_iter_init (&_arguments_iter, parameters);
	g_signal_emit_by_name (self, "canceled");
}

static void
_dbus_handle_gala_session_manager_wingpanel_end_session_dialog_closed (GalaSessionManagerWingpanelEndSessionDialog* self,
                                                                       GVariant* parameters)
{
	GVariantIter _arguments_iter;
	g_variant_iter_init (&_arguments_iter, parameters);
	g_signal_emit_by_name (self, "closed");
}

static void
gala_session_manager_wingpanel_end_session_dialog_proxy_g_signal (GDBusProxy* proxy,
                                                                  const gchar* sender_name,
                                                                  const gchar* signal_name,
                                                                  GVariant* parameters)
{
	if (strcmp (signal_name, "ConfirmedLogout") == 0) {
		_dbus_handle_gala_session_manager_wingpanel_end_session_dialog_confirmed_logout ((GalaSessionManagerWingpanelEndSessionDialog*) proxy, parameters);
	} else if (strcmp (signal_name, "ConfirmedReboot") == 0) {
		_dbus_handle_gala_session_manager_wingpanel_end_session_dialog_confirmed_reboot ((GalaSessionManagerWingpanelEndSessionDialog*) proxy, parameters);
	} else if (strcmp (signal_name, "ConfirmedShutdown") == 0) {
		_dbus_handle_gala_session_manager_wingpanel_end_session_dialog_confirmed_shutdown ((GalaSessionManagerWingpanelEndSessionDialog*) proxy, parameters);
	} else if (strcmp (signal_name, "Canceled") == 0) {
		_dbus_handle_gala_session_manager_wingpanel_end_session_dialog_canceled ((GalaSessionManagerWingpanelEndSessionDialog*) proxy, parameters);
	} else if (strcmp (signal_name, "Closed") == 0) {
		_dbus_handle_gala_session_manager_wingpanel_end_session_dialog_closed ((GalaSessionManagerWingpanelEndSessionDialog*) proxy, parameters);
	}
}

static void
gala_session_manager_wingpanel_end_session_dialog_proxy_init (GalaSessionManagerWingpanelEndSessionDialogProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_gala_session_manager_wingpanel_end_session_dialog_dbus_interface_info));
}

static void
gala_session_manager_wingpanel_end_session_dialog_proxy_open (GalaSessionManagerWingpanelEndSessionDialog* self,
                                                              guint type,
                                                              guint timestamp,
                                                              guint open_length,
                                                              char** inhibiters,
                                                              gint inhibiters_length1,
                                                              GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	char** _tmp0_;
	GVariantBuilder _tmp1_;
	gint _tmp2_;
	GDBusMessage *_reply_message;
	G_DBUS_ERROR;
	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), "io.elementary.wingpanel.session.EndSessionDialog", "Open");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_uint32 (type));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_uint32 (timestamp));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_uint32 (open_length));
	_tmp0_ = inhibiters;
	g_variant_builder_init (&_tmp1_, G_VARIANT_TYPE ("ao"));
	for (_tmp2_ = 0; _tmp2_ < inhibiters_length1; _tmp2_++) {
		g_variant_builder_add_value (&_tmp1_, g_variant_new_object_path (*_tmp0_));
		_tmp0_++;
	}
	g_variant_builder_add_value (&_arguments_builder, g_variant_builder_end (&_tmp1_));
	_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
gala_session_manager_wingpanel_end_session_dialog_proxy_gala_session_manager_wingpanel_end_session_dialog_interface_init (GalaSessionManagerWingpanelEndSessionDialogIface* iface)
{
	iface->open = gala_session_manager_wingpanel_end_session_dialog_proxy_open;
}

static void
_dbus_gala_session_manager_wingpanel_end_session_dialog_open (GalaSessionManagerWingpanelEndSessionDialog* self,
                                                              GVariant* _parameters_,
                                                              GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	guint type = 0U;
	GVariant* _tmp3_;
	guint timestamp = 0U;
	GVariant* _tmp4_;
	guint open_length = 0U;
	GVariant* _tmp5_;
	char** inhibiters = NULL;
	gint inhibiters_length1 = 0;
	GVariant* _tmp6_;
	char** _tmp7_;
	gint _tmp7__length;
	gint _tmp7__size;
	gint _tmp7__length1;
	GVariantIter _tmp8_;
	GVariant* _tmp9_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp3_ = g_variant_iter_next_value (&_arguments_iter);
	type = g_variant_get_uint32 (_tmp3_);
	g_variant_unref (_tmp3_);
	_tmp4_ = g_variant_iter_next_value (&_arguments_iter);
	timestamp = g_variant_get_uint32 (_tmp4_);
	g_variant_unref (_tmp4_);
	_tmp5_ = g_variant_iter_next_value (&_arguments_iter);
	open_length = g_variant_get_uint32 (_tmp5_);
	g_variant_unref (_tmp5_);
	_tmp6_ = g_variant_iter_next_value (&_arguments_iter);
	_tmp7_ = g_new (char*, 5);
	_tmp7__length = 0;
	_tmp7__size = 4;
	_tmp7__length1 = 0;
	g_variant_iter_init (&_tmp8_, _tmp6_);
	for (; (_tmp9_ = g_variant_iter_next_value (&_tmp8_)) != NULL; _tmp7__length1++) {
		if (_tmp7__size == _tmp7__length) {
			_tmp7__size = 2 * _tmp7__size;
			_tmp7_ = g_renew (char*, _tmp7_, _tmp7__size + 1);
		}
		_tmp7_[_tmp7__length++] = g_variant_dup_string (_tmp9_, NULL);
		g_variant_unref (_tmp9_);
	}
	inhibiters_length1 = _tmp7__length1;
	_tmp7_[_tmp7__length] = NULL;
	inhibiters = _tmp7_;
	g_variant_unref (_tmp6_);
	gala_session_manager_wingpanel_end_session_dialog_open (self, type, timestamp, open_length, inhibiters, inhibiters_length1, &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:
	inhibiters = (_vala_array_free (inhibiters, inhibiters_length1, (GDestroyNotify) g_free), NULL);
	;
}

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

static GVariant*
gala_session_manager_wingpanel_end_session_dialog_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
gala_session_manager_wingpanel_end_session_dialog_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;
}

static void
_dbus_gala_session_manager_wingpanel_end_session_dialog_confirmed_logout (GObject* _sender,
                                                                          gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "io.elementary.wingpanel.session.EndSessionDialog", "ConfirmedLogout", _arguments, NULL);
}

static void
_dbus_gala_session_manager_wingpanel_end_session_dialog_confirmed_reboot (GObject* _sender,
                                                                          gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "io.elementary.wingpanel.session.EndSessionDialog", "ConfirmedReboot", _arguments, NULL);
}

static void
_dbus_gala_session_manager_wingpanel_end_session_dialog_confirmed_shutdown (GObject* _sender,
                                                                            gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "io.elementary.wingpanel.session.EndSessionDialog", "ConfirmedShutdown", _arguments, NULL);
}

static void
_dbus_gala_session_manager_wingpanel_end_session_dialog_canceled (GObject* _sender,
                                                                  gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "io.elementary.wingpanel.session.EndSessionDialog", "Canceled", _arguments, NULL);
}

static void
_dbus_gala_session_manager_wingpanel_end_session_dialog_closed (GObject* _sender,
                                                                gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "io.elementary.wingpanel.session.EndSessionDialog", "Closed", _arguments, NULL);
}

static guint
gala_session_manager_wingpanel_end_session_dialog_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 *) (&_gala_session_manager_wingpanel_end_session_dialog_dbus_interface_info), &_gala_session_manager_wingpanel_end_session_dialog_dbus_interface_vtable, data, _gala_session_manager_wingpanel_end_session_dialog_unregister_object, error);
	if (!result) {
		return 0;
	}
	g_signal_connect (object, "confirmed-logout", (GCallback) _dbus_gala_session_manager_wingpanel_end_session_dialog_confirmed_logout, data);
	g_signal_connect (object, "confirmed-reboot", (GCallback) _dbus_gala_session_manager_wingpanel_end_session_dialog_confirmed_reboot, data);
	g_signal_connect (object, "confirmed-shutdown", (GCallback) _dbus_gala_session_manager_wingpanel_end_session_dialog_confirmed_shutdown, data);
	g_signal_connect (object, "canceled", (GCallback) _dbus_gala_session_manager_wingpanel_end_session_dialog_canceled, data);
	g_signal_connect (object, "closed", (GCallback) _dbus_gala_session_manager_wingpanel_end_session_dialog_closed, data);
	return result;
}

static void
_gala_session_manager_wingpanel_end_session_dialog_unregister_object (gpointer user_data)
{
	gpointer* data;
	data = user_data;
	g_signal_handlers_disconnect_by_func (data[0], _dbus_gala_session_manager_wingpanel_end_session_dialog_confirmed_logout, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_gala_session_manager_wingpanel_end_session_dialog_confirmed_reboot, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_gala_session_manager_wingpanel_end_session_dialog_confirmed_shutdown, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_gala_session_manager_wingpanel_end_session_dialog_canceled, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_gala_session_manager_wingpanel_end_session_dialog_closed, data);
	g_object_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}

static void
gala_session_manager_class_init (GalaSessionManagerClass * klass,
                                 gpointer klass_data)
{
	gala_session_manager_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GalaSessionManager_private_offset);
	G_OBJECT_CLASS (klass)->finalize = gala_session_manager_finalize;
	gala_session_manager_signals[GALA_SESSION_MANAGER_CONFIRMED_LOGOUT_SIGNAL] = g_signal_new ("confirmed-logout", GALA_TYPE_SESSION_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gala_session_manager_signals[GALA_SESSION_MANAGER_CONFIRMED_REBOOT_SIGNAL] = g_signal_new ("confirmed-reboot", GALA_TYPE_SESSION_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gala_session_manager_signals[GALA_SESSION_MANAGER_CONFIRMED_SHUTDOWN_SIGNAL] = g_signal_new ("confirmed-shutdown", GALA_TYPE_SESSION_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gala_session_manager_signals[GALA_SESSION_MANAGER_CANCELED_SIGNAL] = g_signal_new ("canceled", GALA_TYPE_SESSION_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gala_session_manager_signals[GALA_SESSION_MANAGER_CLOSED_SIGNAL] = g_signal_new ("closed", GALA_TYPE_SESSION_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
gala_session_manager_instance_init (GalaSessionManager * self,
                                    gpointer klass)
{
	self->priv = gala_session_manager_get_instance_private (self);
	self->priv->proxy = NULL;
}

static void
gala_session_manager_finalize (GObject * obj)
{
	GalaSessionManager * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GALA_TYPE_SESSION_MANAGER, GalaSessionManager);
	_g_object_unref0 (self->priv->proxy);
	G_OBJECT_CLASS (gala_session_manager_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
gala_session_manager_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GalaSessionManagerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gala_session_manager_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GalaSessionManager), 0, (GInstanceInitFunc) gala_session_manager_instance_init, NULL };
	GType gala_session_manager_type_id;
	gala_session_manager_type_id = g_type_register_static (G_TYPE_OBJECT, "GalaSessionManager", &g_define_type_info, 0);
	g_type_set_qdata (gala_session_manager_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) gala_session_manager_register_object);
	GalaSessionManager_private_offset = g_type_add_instance_private (gala_session_manager_type_id, sizeof (GalaSessionManagerPrivate));
	return gala_session_manager_type_id;
}

GType
gala_session_manager_get_type (void)
{
	static gsize gala_session_manager_type_id__once = 0;
	if (g_once_init_enter (&gala_session_manager_type_id__once)) {
		GType gala_session_manager_type_id;
		gala_session_manager_type_id = gala_session_manager_get_type_once ();
		g_once_init_leave (&gala_session_manager_type_id__once, gala_session_manager_type_id);
	}
	return gala_session_manager_type_id__once;
}

static void
_dbus_gala_session_manager_open (GalaSessionManager* self,
                                 GVariant* _parameters_,
                                 GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	guint type = 0U;
	GVariant* _tmp82_;
	guint timestamp = 0U;
	GVariant* _tmp83_;
	guint open_length = 0U;
	GVariant* _tmp84_;
	char** inhibiters = NULL;
	gint inhibiters_length1 = 0;
	GVariant* _tmp85_;
	char** _tmp86_;
	gint _tmp86__length;
	gint _tmp86__size;
	gint _tmp86__length1;
	GVariantIter _tmp87_;
	GVariant* _tmp88_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp82_ = g_variant_iter_next_value (&_arguments_iter);
	type = g_variant_get_uint32 (_tmp82_);
	g_variant_unref (_tmp82_);
	_tmp83_ = g_variant_iter_next_value (&_arguments_iter);
	timestamp = g_variant_get_uint32 (_tmp83_);
	g_variant_unref (_tmp83_);
	_tmp84_ = g_variant_iter_next_value (&_arguments_iter);
	open_length = g_variant_get_uint32 (_tmp84_);
	g_variant_unref (_tmp84_);
	_tmp85_ = g_variant_iter_next_value (&_arguments_iter);
	_tmp86_ = g_new (char*, 5);
	_tmp86__length = 0;
	_tmp86__size = 4;
	_tmp86__length1 = 0;
	g_variant_iter_init (&_tmp87_, _tmp85_);
	for (; (_tmp88_ = g_variant_iter_next_value (&_tmp87_)) != NULL; _tmp86__length1++) {
		if (_tmp86__size == _tmp86__length) {
			_tmp86__size = 2 * _tmp86__size;
			_tmp86_ = g_renew (char*, _tmp86_, _tmp86__size + 1);
		}
		_tmp86_[_tmp86__length++] = g_variant_dup_string (_tmp88_, NULL);
		g_variant_unref (_tmp88_);
	}
	inhibiters_length1 = _tmp86__length1;
	_tmp86_[_tmp86__length] = NULL;
	inhibiters = _tmp86_;
	g_variant_unref (_tmp85_);
	gala_session_manager_open (self, type, timestamp, open_length, inhibiters, inhibiters_length1, &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:
	inhibiters = (_vala_array_free (inhibiters, inhibiters_length1, (GDestroyNotify) g_free), NULL);
	;
}

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

static GVariant*
gala_session_manager_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
gala_session_manager_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;
}

static void
_dbus_gala_session_manager_confirmed_logout (GObject* _sender,
                                             gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.gnome.SessionManager.EndSessionDialog", "ConfirmedLogout", _arguments, NULL);
}

static void
_dbus_gala_session_manager_confirmed_reboot (GObject* _sender,
                                             gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.gnome.SessionManager.EndSessionDialog", "ConfirmedReboot", _arguments, NULL);
}

static void
_dbus_gala_session_manager_confirmed_shutdown (GObject* _sender,
                                               gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.gnome.SessionManager.EndSessionDialog", "ConfirmedShutdown", _arguments, NULL);
}

static void
_dbus_gala_session_manager_canceled (GObject* _sender,
                                     gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.gnome.SessionManager.EndSessionDialog", "Canceled", _arguments, NULL);
}

static void
_dbus_gala_session_manager_closed (GObject* _sender,
                                   gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.gnome.SessionManager.EndSessionDialog", "Closed", _arguments, NULL);
}

guint
gala_session_manager_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 *) (&_gala_session_manager_dbus_interface_info), &_gala_session_manager_dbus_interface_vtable, data, _gala_session_manager_unregister_object, error);
	if (!result) {
		return 0;
	}
	g_signal_connect (object, "confirmed-logout", (GCallback) _dbus_gala_session_manager_confirmed_logout, data);
	g_signal_connect (object, "confirmed-reboot", (GCallback) _dbus_gala_session_manager_confirmed_reboot, data);
	g_signal_connect (object, "confirmed-shutdown", (GCallback) _dbus_gala_session_manager_confirmed_shutdown, data);
	g_signal_connect (object, "canceled", (GCallback) _dbus_gala_session_manager_canceled, data);
	g_signal_connect (object, "closed", (GCallback) _dbus_gala_session_manager_closed, data);
	return result;
}

static void
_gala_session_manager_unregister_object (gpointer user_data)
{
	gpointer* data;
	data = user_data;
	g_signal_handlers_disconnect_by_func (data[0], _dbus_gala_session_manager_confirmed_logout, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_gala_session_manager_confirmed_reboot, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_gala_session_manager_confirmed_shutdown, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_gala_session_manager_canceled, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_gala_session_manager_closed, 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);
}

