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

/*
 * This file is part of budgie-desktop
 *
 * Copyright Budgie Desktop Developers
 *
 * 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.
 */

#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 BUDGIE_TYPE_END_SESSION_REMOTE (budgie_end_session_remote_get_type ())
#define BUDGIE_END_SESSION_REMOTE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BUDGIE_TYPE_END_SESSION_REMOTE, BudgieEndSessionRemote))
#define BUDGIE_IS_END_SESSION_REMOTE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BUDGIE_TYPE_END_SESSION_REMOTE))
#define BUDGIE_END_SESSION_REMOTE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), BUDGIE_TYPE_END_SESSION_REMOTE, BudgieEndSessionRemoteIface))

typedef struct _BudgieEndSessionRemote BudgieEndSessionRemote;
typedef struct _BudgieEndSessionRemoteIface BudgieEndSessionRemoteIface;

#define BUDGIE_TYPE_END_SESSION_REMOTE_PROXY (budgie_end_session_remote_proxy_get_type ())
enum  {
	BUDGIE_END_SESSION_REMOTE_CONFIRMED_LOGOUT_SIGNAL,
	BUDGIE_END_SESSION_REMOTE_CONFIRMED_REBOOT_SIGNAL,
	BUDGIE_END_SESSION_REMOTE_CONFIRMED_SHUTDOWN_SIGNAL,
	BUDGIE_END_SESSION_REMOTE_CANCELED_SIGNAL,
	BUDGIE_END_SESSION_REMOTE_CLOSED_SIGNAL,
	BUDGIE_END_SESSION_REMOTE_NUM_SIGNALS
};
static guint budgie_end_session_remote_signals[BUDGIE_END_SESSION_REMOTE_NUM_SIGNALS] = {0};
typedef GDBusProxy BudgieEndSessionRemoteProxy;
typedef GDBusProxyClass BudgieEndSessionRemoteProxyClass;

#define BUDGIE_TYPE_SESSION_HANDLER (budgie_session_handler_get_type ())
#define BUDGIE_SESSION_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BUDGIE_TYPE_SESSION_HANDLER, BudgieSessionHandler))
#define BUDGIE_SESSION_HANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BUDGIE_TYPE_SESSION_HANDLER, BudgieSessionHandlerClass))
#define BUDGIE_IS_SESSION_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BUDGIE_TYPE_SESSION_HANDLER))
#define BUDGIE_IS_SESSION_HANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BUDGIE_TYPE_SESSION_HANDLER))
#define BUDGIE_SESSION_HANDLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BUDGIE_TYPE_SESSION_HANDLER, BudgieSessionHandlerClass))

typedef struct _BudgieSessionHandler BudgieSessionHandler;
typedef struct _BudgieSessionHandlerClass BudgieSessionHandlerClass;
typedef struct _BudgieSessionHandlerPrivate BudgieSessionHandlerPrivate;
enum  {
	BUDGIE_SESSION_HANDLER_0_PROPERTY,
	BUDGIE_SESSION_HANDLER_NUM_PROPERTIES
};
static GParamSpec* budgie_session_handler_properties[BUDGIE_SESSION_HANDLER_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  {
	BUDGIE_SESSION_HANDLER_CONFIRMED_LOGOUT_SIGNAL,
	BUDGIE_SESSION_HANDLER_CONFIRMED_REBOOT_SIGNAL,
	BUDGIE_SESSION_HANDLER_CONFIRMED_SHUTDOWN_SIGNAL,
	BUDGIE_SESSION_HANDLER_CANCELED_SIGNAL,
	BUDGIE_SESSION_HANDLER_CLOSED_SIGNAL,
	BUDGIE_SESSION_HANDLER_NUM_SIGNALS
};
static guint budgie_session_handler_signals[BUDGIE_SESSION_HANDLER_NUM_SIGNALS] = {0};

#define BUDGIE_TYPE_SHELL_SHIM (budgie_shell_shim_get_type ())
#define BUDGIE_SHELL_SHIM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BUDGIE_TYPE_SHELL_SHIM, BudgieShellShim))
#define BUDGIE_SHELL_SHIM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BUDGIE_TYPE_SHELL_SHIM, BudgieShellShimClass))
#define BUDGIE_IS_SHELL_SHIM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BUDGIE_TYPE_SHELL_SHIM))
#define BUDGIE_IS_SHELL_SHIM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BUDGIE_TYPE_SHELL_SHIM))
#define BUDGIE_SHELL_SHIM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BUDGIE_TYPE_SHELL_SHIM, BudgieShellShimClass))

typedef struct _BudgieShellShim BudgieShellShim;
typedef struct _BudgieShellShimClass BudgieShellShimClass;
typedef struct _BudgieShellShimPrivate BudgieShellShimPrivate;
enum  {
	BUDGIE_SHELL_SHIM_0_PROPERTY,
	BUDGIE_SHELL_SHIM_NUM_PROPERTIES
};
static GParamSpec* budgie_shell_shim_properties[BUDGIE_SHELL_SHIM_NUM_PROPERTIES];

struct _BudgieEndSessionRemoteIface {
	GTypeInterface parent_iface;
	void (*Open) (BudgieEndSessionRemote* self, guint type, guint timestamp, guint open_length, char** inhibiters, gint inhibiters_length1, GError** error);
	void (*Close) (BudgieEndSessionRemote* self, GError** error);
};

struct _BudgieSessionHandler {
	GObject parent_instance;
	BudgieSessionHandlerPrivate * priv;
};

struct _BudgieSessionHandlerClass {
	GObjectClass parent_class;
};

struct _BudgieSessionHandlerPrivate {
	BudgieEndSessionRemote* proxy;
};

struct _BudgieShellShim {
	GObject parent_instance;
	BudgieShellShimPrivate * priv;
};

struct _BudgieShellShimClass {
	GObjectClass parent_class;
};

struct _BudgieShellShimPrivate {
	BudgieSessionHandler* handler;
};

static gint BudgieSessionHandler_private_offset;
static gpointer budgie_session_handler_parent_class = NULL;
static gint BudgieShellShim_private_offset;
static gpointer budgie_shell_shim_parent_class = NULL;

VALA_EXTERN GType budgie_end_session_remote_proxy_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint budgie_end_session_remote_register_object (void* object,
                                                 GDBusConnection* connection,
                                                 const gchar* path,
                                                 GError** error);
VALA_EXTERN GType budgie_end_session_remote_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BudgieEndSessionRemote, g_object_unref)
VALA_EXTERN void budgie_end_session_remote_Open (BudgieEndSessionRemote* self,
                                     guint type,
                                     guint timestamp,
                                     guint open_length,
                                     char** inhibiters,
                                     gint inhibiters_length1,
                                     GError** error);
VALA_EXTERN void budgie_end_session_remote_Close (BudgieEndSessionRemote* self,
                                      GError** error);
static GType budgie_end_session_remote_get_type_once (void);
static void budgie_end_session_remote_proxy_g_signal (GDBusProxy* proxy,
                                               const gchar* sender_name,
                                               const gchar* signal_name,
                                               GVariant* parameters);
static void _dbus_handle_budgie_end_session_remote_confirmed_logout (BudgieEndSessionRemote* self,
                                                              GVariant* parameters);
static void _dbus_handle_budgie_end_session_remote_confirmed_reboot (BudgieEndSessionRemote* self,
                                                              GVariant* parameters);
static void _dbus_handle_budgie_end_session_remote_confirmed_shutdown (BudgieEndSessionRemote* self,
                                                                GVariant* parameters);
static void _dbus_handle_budgie_end_session_remote_canceled (BudgieEndSessionRemote* self,
                                                      GVariant* parameters);
static void _dbus_handle_budgie_end_session_remote_closed (BudgieEndSessionRemote* self,
                                                    GVariant* parameters);
static void budgie_end_session_remote_proxy_Open (BudgieEndSessionRemote* self,
                                           guint type,
                                           guint timestamp,
                                           guint open_length,
                                           char** inhibiters,
                                           gint inhibiters_length1,
                                           GError** error);
static void budgie_end_session_remote_proxy_Close (BudgieEndSessionRemote* self,
                                            GError** error);
static void budgie_end_session_remote_proxy_budgie_end_session_remote_interface_init (BudgieEndSessionRemoteIface* iface);
static void _dbus_budgie_end_session_remote_Open (BudgieEndSessionRemote* self,
                                           GVariant* _parameters_,
                                           GDBusMethodInvocation* invocation);
static void _dbus_budgie_end_session_remote_Close (BudgieEndSessionRemote* self,
                                            GVariant* _parameters_,
                                            GDBusMethodInvocation* invocation);
static void budgie_end_session_remote_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* budgie_end_session_remote_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 budgie_end_session_remote_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_budgie_end_session_remote_confirmed_logout (GObject* _sender,
                                                       gpointer* _data);
static void _dbus_budgie_end_session_remote_confirmed_reboot (GObject* _sender,
                                                       gpointer* _data);
static void _dbus_budgie_end_session_remote_confirmed_shutdown (GObject* _sender,
                                                         gpointer* _data);
static void _dbus_budgie_end_session_remote_canceled (GObject* _sender,
                                               gpointer* _data);
static void _dbus_budgie_end_session_remote_closed (GObject* _sender,
                                             gpointer* _data);
static void _budgie_end_session_remote_unregister_object (gpointer user_data);
VALA_EXTERN GType budgie_session_handler_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BudgieSessionHandler, g_object_unref)
VALA_EXTERN guint budgie_session_handler_register_object (void* object,
                                              GDBusConnection* connection,
                                              const gchar* path,
                                              GError** error);
VALA_EXTERN BudgieSessionHandler* budgie_session_handler_new (void);
VALA_EXTERN BudgieSessionHandler* budgie_session_handler_construct (GType object_type);
static void budgie_session_handler_has_dialog (BudgieSessionHandler* self);
static void _budgie_session_handler_has_dialog_gbus_name_appeared_callback (GDBusConnection* connection,
                                                                     const gchar* name,
                                                                     const gchar* name_owner,
                                                                     gpointer self);
static void budgie_session_handler_lost_dialog (BudgieSessionHandler* self);
static void _budgie_session_handler_lost_dialog_gbus_name_vanished_callback (GDBusConnection* connection,
                                                                      const gchar* name,
                                                                      gpointer self);
static void budgie_session_handler_on_dialog_get (BudgieSessionHandler* self,
                                           GObject* o,
                                           GAsyncResult* res);
static void ___lambda17_ (BudgieSessionHandler* self);
static void ____lambda17__budgie_end_session_remote_confirmed_logout (BudgieEndSessionRemote* _sender,
                                                               gpointer self);
static void ___lambda18_ (BudgieSessionHandler* self);
static void ____lambda18__budgie_end_session_remote_confirmed_reboot (BudgieEndSessionRemote* _sender,
                                                               gpointer self);
static void ___lambda19_ (BudgieSessionHandler* self);
static void ____lambda19__budgie_end_session_remote_confirmed_shutdown (BudgieEndSessionRemote* _sender,
                                                                 gpointer self);
static void ___lambda20_ (BudgieSessionHandler* self);
static void ____lambda20__budgie_end_session_remote_canceled (BudgieEndSessionRemote* _sender,
                                                       gpointer self);
static void ___lambda21_ (BudgieSessionHandler* self);
static void ____lambda21__budgie_end_session_remote_closed (BudgieEndSessionRemote* _sender,
                                                     gpointer self);
static void _budgie_session_handler_on_dialog_get_gasync_ready_callback (GObject* source_object,
                                                                  GAsyncResult* res,
                                                                  gpointer self);
VALA_EXTERN void budgie_session_handler_Open (BudgieSessionHandler* self,
                                  guint type,
                                  guint timestamp,
                                  guint open_length,
                                  char** inhibiters,
                                  gint inhibiters_length1,
                                  GError** error);
VALA_EXTERN void budgie_session_handler_Close (BudgieSessionHandler* self,
                                   GError** error);
static void budgie_session_handler_finalize (GObject * obj);
static GType budgie_session_handler_get_type_once (void);
static void _dbus_budgie_session_handler_Open (BudgieSessionHandler* self,
                                        GVariant* _parameters_,
                                        GDBusMethodInvocation* invocation);
static void _dbus_budgie_session_handler_Close (BudgieSessionHandler* self,
                                         GVariant* _parameters_,
                                         GDBusMethodInvocation* invocation);
static void budgie_session_handler_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* budgie_session_handler_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 budgie_session_handler_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_budgie_session_handler_confirmed_logout (GObject* _sender,
                                                    gpointer* _data);
static void _dbus_budgie_session_handler_confirmed_reboot (GObject* _sender,
                                                    gpointer* _data);
static void _dbus_budgie_session_handler_confirmed_shutdown (GObject* _sender,
                                                      gpointer* _data);
static void _dbus_budgie_session_handler_canceled (GObject* _sender,
                                            gpointer* _data);
static void _dbus_budgie_session_handler_closed (GObject* _sender,
                                          gpointer* _data);
static void _budgie_session_handler_unregister_object (gpointer user_data);
VALA_EXTERN GType budgie_shell_shim_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BudgieShellShim, g_object_unref)
VALA_EXTERN guint budgie_shell_shim_register_object (void* object,
                                         GDBusConnection* connection,
                                         const gchar* path,
                                         GError** error);
VALA_EXTERN BudgieShellShim* budgie_shell_shim_new (void);
VALA_EXTERN BudgieShellShim* budgie_shell_shim_construct (GType object_type);
static void budgie_shell_shim_on_bus_acquired (BudgieShellShim* self,
                                        GDBusConnection* conn);
VALA_EXTERN void budgie_shell_shim_serve (BudgieShellShim* self);
static void _budgie_shell_shim_on_bus_acquired_gbus_acquired_callback (GDBusConnection* connection,
                                                                const gchar* name,
                                                                gpointer self);
static void budgie_shell_shim_finalize (GObject * obj);
static GType budgie_shell_shim_get_type_once (void);
static void budgie_shell_shim_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* budgie_shell_shim_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 budgie_shell_shim_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 _budgie_shell_shim_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 _budgie_end_session_remote_dbus_arg_info_Open_type = {-1, "type", "u", NULL};
static const GDBusArgInfo _budgie_end_session_remote_dbus_arg_info_Open_timestamp = {-1, "timestamp", "u", NULL};
static const GDBusArgInfo _budgie_end_session_remote_dbus_arg_info_Open_open_length = {-1, "open_length", "u", NULL};
static const GDBusArgInfo _budgie_end_session_remote_dbus_arg_info_Open_inhibiters = {-1, "inhibiters", "ao", NULL};
static const GDBusArgInfo * const _budgie_end_session_remote_dbus_arg_info_Open_in[] = {&_budgie_end_session_remote_dbus_arg_info_Open_type, &_budgie_end_session_remote_dbus_arg_info_Open_timestamp, &_budgie_end_session_remote_dbus_arg_info_Open_open_length, &_budgie_end_session_remote_dbus_arg_info_Open_inhibiters, NULL};
static const GDBusArgInfo * const _budgie_end_session_remote_dbus_arg_info_Open_out[] = {NULL};
static const GDBusMethodInfo _budgie_end_session_remote_dbus_method_info_Open = {-1, "Open", (GDBusArgInfo **) (&_budgie_end_session_remote_dbus_arg_info_Open_in), (GDBusArgInfo **) (&_budgie_end_session_remote_dbus_arg_info_Open_out), NULL};
static const GDBusArgInfo * const _budgie_end_session_remote_dbus_arg_info_Close_in[] = {NULL};
static const GDBusArgInfo * const _budgie_end_session_remote_dbus_arg_info_Close_out[] = {NULL};
static const GDBusMethodInfo _budgie_end_session_remote_dbus_method_info_Close = {-1, "Close", (GDBusArgInfo **) (&_budgie_end_session_remote_dbus_arg_info_Close_in), (GDBusArgInfo **) (&_budgie_end_session_remote_dbus_arg_info_Close_out), NULL};
static const GDBusMethodInfo * const _budgie_end_session_remote_dbus_method_info[] = {&_budgie_end_session_remote_dbus_method_info_Open, &_budgie_end_session_remote_dbus_method_info_Close, NULL};
static const GDBusArgInfo * const _budgie_end_session_remote_dbus_arg_info_confirmed_logout[] = {NULL};
static const GDBusSignalInfo _budgie_end_session_remote_dbus_signal_info_confirmed_logout = {-1, "ConfirmedLogout", (GDBusArgInfo **) (&_budgie_end_session_remote_dbus_arg_info_confirmed_logout), NULL};
static const GDBusArgInfo * const _budgie_end_session_remote_dbus_arg_info_confirmed_reboot[] = {NULL};
static const GDBusSignalInfo _budgie_end_session_remote_dbus_signal_info_confirmed_reboot = {-1, "ConfirmedReboot", (GDBusArgInfo **) (&_budgie_end_session_remote_dbus_arg_info_confirmed_reboot), NULL};
static const GDBusArgInfo * const _budgie_end_session_remote_dbus_arg_info_confirmed_shutdown[] = {NULL};
static const GDBusSignalInfo _budgie_end_session_remote_dbus_signal_info_confirmed_shutdown = {-1, "ConfirmedShutdown", (GDBusArgInfo **) (&_budgie_end_session_remote_dbus_arg_info_confirmed_shutdown), NULL};
static const GDBusArgInfo * const _budgie_end_session_remote_dbus_arg_info_canceled[] = {NULL};
static const GDBusSignalInfo _budgie_end_session_remote_dbus_signal_info_canceled = {-1, "Canceled", (GDBusArgInfo **) (&_budgie_end_session_remote_dbus_arg_info_canceled), NULL};
static const GDBusArgInfo * const _budgie_end_session_remote_dbus_arg_info_closed[] = {NULL};
static const GDBusSignalInfo _budgie_end_session_remote_dbus_signal_info_closed = {-1, "Closed", (GDBusArgInfo **) (&_budgie_end_session_remote_dbus_arg_info_closed), NULL};
static const GDBusSignalInfo * const _budgie_end_session_remote_dbus_signal_info[] = {&_budgie_end_session_remote_dbus_signal_info_confirmed_logout, &_budgie_end_session_remote_dbus_signal_info_confirmed_reboot, &_budgie_end_session_remote_dbus_signal_info_confirmed_shutdown, &_budgie_end_session_remote_dbus_signal_info_canceled, &_budgie_end_session_remote_dbus_signal_info_closed, NULL};
static const GDBusPropertyInfo * const _budgie_end_session_remote_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _budgie_end_session_remote_dbus_interface_info = {-1, "org.budgie_desktop.Session.EndSessionDialog", (GDBusMethodInfo **) (&_budgie_end_session_remote_dbus_method_info), (GDBusSignalInfo **) (&_budgie_end_session_remote_dbus_signal_info), (GDBusPropertyInfo **) (&_budgie_end_session_remote_dbus_property_info), NULL};
static const GDBusInterfaceVTable _budgie_end_session_remote_dbus_interface_vtable = {budgie_end_session_remote_dbus_interface_method_call, budgie_end_session_remote_dbus_interface_get_property, budgie_end_session_remote_dbus_interface_set_property};
static const GDBusArgInfo _budgie_session_handler_dbus_arg_info_Open_type = {-1, "type", "u", NULL};
static const GDBusArgInfo _budgie_session_handler_dbus_arg_info_Open_timestamp = {-1, "timestamp", "u", NULL};
static const GDBusArgInfo _budgie_session_handler_dbus_arg_info_Open_open_length = {-1, "open_length", "u", NULL};
static const GDBusArgInfo _budgie_session_handler_dbus_arg_info_Open_inhibiters = {-1, "inhibiters", "ao", NULL};
static const GDBusArgInfo * const _budgie_session_handler_dbus_arg_info_Open_in[] = {&_budgie_session_handler_dbus_arg_info_Open_type, &_budgie_session_handler_dbus_arg_info_Open_timestamp, &_budgie_session_handler_dbus_arg_info_Open_open_length, &_budgie_session_handler_dbus_arg_info_Open_inhibiters, NULL};
static const GDBusArgInfo * const _budgie_session_handler_dbus_arg_info_Open_out[] = {NULL};
static const GDBusMethodInfo _budgie_session_handler_dbus_method_info_Open = {-1, "Open", (GDBusArgInfo **) (&_budgie_session_handler_dbus_arg_info_Open_in), (GDBusArgInfo **) (&_budgie_session_handler_dbus_arg_info_Open_out), NULL};
static const GDBusArgInfo * const _budgie_session_handler_dbus_arg_info_Close_in[] = {NULL};
static const GDBusArgInfo * const _budgie_session_handler_dbus_arg_info_Close_out[] = {NULL};
static const GDBusMethodInfo _budgie_session_handler_dbus_method_info_Close = {-1, "Close", (GDBusArgInfo **) (&_budgie_session_handler_dbus_arg_info_Close_in), (GDBusArgInfo **) (&_budgie_session_handler_dbus_arg_info_Close_out), NULL};
static const GDBusMethodInfo * const _budgie_session_handler_dbus_method_info[] = {&_budgie_session_handler_dbus_method_info_Open, &_budgie_session_handler_dbus_method_info_Close, NULL};
static const GDBusArgInfo * const _budgie_session_handler_dbus_arg_info_confirmed_logout[] = {NULL};
static const GDBusSignalInfo _budgie_session_handler_dbus_signal_info_confirmed_logout = {-1, "ConfirmedLogout", (GDBusArgInfo **) (&_budgie_session_handler_dbus_arg_info_confirmed_logout), NULL};
static const GDBusArgInfo * const _budgie_session_handler_dbus_arg_info_confirmed_reboot[] = {NULL};
static const GDBusSignalInfo _budgie_session_handler_dbus_signal_info_confirmed_reboot = {-1, "ConfirmedReboot", (GDBusArgInfo **) (&_budgie_session_handler_dbus_arg_info_confirmed_reboot), NULL};
static const GDBusArgInfo * const _budgie_session_handler_dbus_arg_info_confirmed_shutdown[] = {NULL};
static const GDBusSignalInfo _budgie_session_handler_dbus_signal_info_confirmed_shutdown = {-1, "ConfirmedShutdown", (GDBusArgInfo **) (&_budgie_session_handler_dbus_arg_info_confirmed_shutdown), NULL};
static const GDBusArgInfo * const _budgie_session_handler_dbus_arg_info_canceled[] = {NULL};
static const GDBusSignalInfo _budgie_session_handler_dbus_signal_info_canceled = {-1, "Canceled", (GDBusArgInfo **) (&_budgie_session_handler_dbus_arg_info_canceled), NULL};
static const GDBusArgInfo * const _budgie_session_handler_dbus_arg_info_closed[] = {NULL};
static const GDBusSignalInfo _budgie_session_handler_dbus_signal_info_closed = {-1, "Closed", (GDBusArgInfo **) (&_budgie_session_handler_dbus_arg_info_closed), NULL};
static const GDBusSignalInfo * const _budgie_session_handler_dbus_signal_info[] = {&_budgie_session_handler_dbus_signal_info_confirmed_logout, &_budgie_session_handler_dbus_signal_info_confirmed_reboot, &_budgie_session_handler_dbus_signal_info_confirmed_shutdown, &_budgie_session_handler_dbus_signal_info_canceled, &_budgie_session_handler_dbus_signal_info_closed, NULL};
static const GDBusPropertyInfo * const _budgie_session_handler_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _budgie_session_handler_dbus_interface_info = {-1, "org.gnome.SessionManager.EndSessionDialog", (GDBusMethodInfo **) (&_budgie_session_handler_dbus_method_info), (GDBusSignalInfo **) (&_budgie_session_handler_dbus_signal_info), (GDBusPropertyInfo **) (&_budgie_session_handler_dbus_property_info), NULL};
static const GDBusInterfaceVTable _budgie_session_handler_dbus_interface_vtable = {budgie_session_handler_dbus_interface_method_call, budgie_session_handler_dbus_interface_get_property, budgie_session_handler_dbus_interface_set_property};
static const GDBusMethodInfo * const _budgie_shell_shim_dbus_method_info[] = {NULL};
static const GDBusSignalInfo * const _budgie_shell_shim_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo * const _budgie_shell_shim_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _budgie_shell_shim_dbus_interface_info = {-1, "org.gnome.Shell", (GDBusMethodInfo **) (&_budgie_shell_shim_dbus_method_info), (GDBusSignalInfo **) (&_budgie_shell_shim_dbus_signal_info), (GDBusPropertyInfo **) (&_budgie_shell_shim_dbus_property_info), NULL};
static const GDBusInterfaceVTable _budgie_shell_shim_dbus_interface_vtable = {budgie_shell_shim_dbus_interface_method_call, budgie_shell_shim_dbus_interface_get_property, budgie_shell_shim_dbus_interface_set_property};

void
budgie_end_session_remote_Open (BudgieEndSessionRemote* self,
                                guint type,
                                guint timestamp,
                                guint open_length,
                                char** inhibiters,
                                gint inhibiters_length1,
                                GError** error)
{
	BudgieEndSessionRemoteIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = BUDGIE_END_SESSION_REMOTE_GET_INTERFACE (self);
	if (_iface_->Open) {
		_iface_->Open (self, type, timestamp, open_length, inhibiters, inhibiters_length1, error);
	}
}

void
budgie_end_session_remote_Close (BudgieEndSessionRemote* self,
                                 GError** error)
{
	BudgieEndSessionRemoteIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = BUDGIE_END_SESSION_REMOTE_GET_INTERFACE (self);
	if (_iface_->Close) {
		_iface_->Close (self, error);
	}
}

static void
budgie_end_session_remote_default_init (BudgieEndSessionRemoteIface * iface,
                                        gpointer iface_data)
{
	budgie_end_session_remote_signals[BUDGIE_END_SESSION_REMOTE_CONFIRMED_LOGOUT_SIGNAL] = g_signal_new ("confirmed-logout", BUDGIE_TYPE_END_SESSION_REMOTE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	budgie_end_session_remote_signals[BUDGIE_END_SESSION_REMOTE_CONFIRMED_REBOOT_SIGNAL] = g_signal_new ("confirmed-reboot", BUDGIE_TYPE_END_SESSION_REMOTE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	budgie_end_session_remote_signals[BUDGIE_END_SESSION_REMOTE_CONFIRMED_SHUTDOWN_SIGNAL] = g_signal_new ("confirmed-shutdown", BUDGIE_TYPE_END_SESSION_REMOTE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	budgie_end_session_remote_signals[BUDGIE_END_SESSION_REMOTE_CANCELED_SIGNAL] = g_signal_new ("canceled", BUDGIE_TYPE_END_SESSION_REMOTE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	budgie_end_session_remote_signals[BUDGIE_END_SESSION_REMOTE_CLOSED_SIGNAL] = g_signal_new ("closed", BUDGIE_TYPE_END_SESSION_REMOTE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static GType
budgie_end_session_remote_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BudgieEndSessionRemoteIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) budgie_end_session_remote_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType budgie_end_session_remote_type_id;
	budgie_end_session_remote_type_id = g_type_register_static (G_TYPE_INTERFACE, "BudgieEndSessionRemote", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (budgie_end_session_remote_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (budgie_end_session_remote_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) budgie_end_session_remote_proxy_get_type);
	g_type_set_qdata (budgie_end_session_remote_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.budgie_desktop.Session.EndSessionDialog");
	g_type_set_qdata (budgie_end_session_remote_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_budgie_end_session_remote_dbus_interface_info));
	g_type_set_qdata (budgie_end_session_remote_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) budgie_end_session_remote_register_object);
	return budgie_end_session_remote_type_id;
}

GType
budgie_end_session_remote_get_type (void)
{
	static volatile gsize budgie_end_session_remote_type_id__once = 0;
	if (g_once_init_enter (&budgie_end_session_remote_type_id__once)) {
		GType budgie_end_session_remote_type_id;
		budgie_end_session_remote_type_id = budgie_end_session_remote_get_type_once ();
		g_once_init_leave (&budgie_end_session_remote_type_id__once, budgie_end_session_remote_type_id);
	}
	return budgie_end_session_remote_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (BudgieEndSessionRemoteProxy, budgie_end_session_remote_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (BUDGIE_TYPE_END_SESSION_REMOTE, budgie_end_session_remote_proxy_budgie_end_session_remote_interface_init) )
static void
budgie_end_session_remote_proxy_class_init (BudgieEndSessionRemoteProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = budgie_end_session_remote_proxy_g_signal;
}

static void
_dbus_handle_budgie_end_session_remote_confirmed_logout (BudgieEndSessionRemote* 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_budgie_end_session_remote_confirmed_reboot (BudgieEndSessionRemote* 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_budgie_end_session_remote_confirmed_shutdown (BudgieEndSessionRemote* 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_budgie_end_session_remote_canceled (BudgieEndSessionRemote* self,
                                                 GVariant* parameters)
{
	GVariantIter _arguments_iter;
	g_variant_iter_init (&_arguments_iter, parameters);
	g_signal_emit_by_name (self, "canceled");
}

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

static void
budgie_end_session_remote_proxy_g_signal (GDBusProxy* proxy,
                                          const gchar* sender_name,
                                          const gchar* signal_name,
                                          GVariant* parameters)
{
	if (strcmp (signal_name, "ConfirmedLogout") == 0) {
		_dbus_handle_budgie_end_session_remote_confirmed_logout ((BudgieEndSessionRemote*) proxy, parameters);
	} else if (strcmp (signal_name, "ConfirmedReboot") == 0) {
		_dbus_handle_budgie_end_session_remote_confirmed_reboot ((BudgieEndSessionRemote*) proxy, parameters);
	} else if (strcmp (signal_name, "ConfirmedShutdown") == 0) {
		_dbus_handle_budgie_end_session_remote_confirmed_shutdown ((BudgieEndSessionRemote*) proxy, parameters);
	} else if (strcmp (signal_name, "Canceled") == 0) {
		_dbus_handle_budgie_end_session_remote_canceled ((BudgieEndSessionRemote*) proxy, parameters);
	} else if (strcmp (signal_name, "Closed") == 0) {
		_dbus_handle_budgie_end_session_remote_closed ((BudgieEndSessionRemote*) proxy, parameters);
	}
}

static void
budgie_end_session_remote_proxy_init (BudgieEndSessionRemoteProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_budgie_end_session_remote_dbus_interface_info));
}

static void
budgie_end_session_remote_proxy_Open (BudgieEndSessionRemote* self,
                                      guint type,
                                      guint timestamp,
                                      guint open_length,
                                      char** inhibiters,
                                      gint inhibiters_length1,
                                      GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	char** _tmp4_;
	GVariantBuilder _tmp5_;
	gint _tmp6_;
	GDBusMessage *_reply_message;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.budgie_desktop.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));
	_tmp4_ = inhibiters;
	g_variant_builder_init (&_tmp5_, G_VARIANT_TYPE ("ao"));
	for (_tmp6_ = 0; _tmp6_ < inhibiters_length1; _tmp6_++) {
		g_variant_builder_add_value (&_tmp5_, g_variant_new_object_path (*_tmp4_));
		_tmp4_++;
	}
	g_variant_builder_add_value (&_arguments_builder, g_variant_builder_end (&_tmp5_));
	_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
budgie_end_session_remote_proxy_Close (BudgieEndSessionRemote* self,
                                       GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.budgie_desktop.Session.EndSessionDialog", "Close");
	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
budgie_end_session_remote_proxy_budgie_end_session_remote_interface_init (BudgieEndSessionRemoteIface* iface)
{
	iface->Open = budgie_end_session_remote_proxy_Open;
	iface->Close = budgie_end_session_remote_proxy_Close;
}

static void
_dbus_budgie_end_session_remote_Open (BudgieEndSessionRemote* self,
                                      GVariant* _parameters_,
                                      GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	guint type = 0U;
	GVariant* _tmp7_;
	guint timestamp = 0U;
	GVariant* _tmp8_;
	guint open_length = 0U;
	GVariant* _tmp9_;
	char** inhibiters = NULL;
	gint inhibiters_length1 = 0;
	GVariant* _tmp10_;
	char** _tmp11_;
	gint _tmp11__length;
	gint _tmp11__size;
	gint _tmp11__length1;
	GVariantIter _tmp12_;
	GVariant* _tmp13_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp7_ = g_variant_iter_next_value (&_arguments_iter);
	type = g_variant_get_uint32 (_tmp7_);
	g_variant_unref (_tmp7_);
	_tmp8_ = g_variant_iter_next_value (&_arguments_iter);
	timestamp = g_variant_get_uint32 (_tmp8_);
	g_variant_unref (_tmp8_);
	_tmp9_ = g_variant_iter_next_value (&_arguments_iter);
	open_length = g_variant_get_uint32 (_tmp9_);
	g_variant_unref (_tmp9_);
	_tmp10_ = g_variant_iter_next_value (&_arguments_iter);
	_tmp11_ = g_new (char*, 5);
	_tmp11__length = 0;
	_tmp11__size = 4;
	_tmp11__length1 = 0;
	g_variant_iter_init (&_tmp12_, _tmp10_);
	for (; (_tmp13_ = g_variant_iter_next_value (&_tmp12_)) != NULL; _tmp11__length1++) {
		if (_tmp11__size == _tmp11__length) {
			_tmp11__size = 2 * _tmp11__size;
			_tmp11_ = g_renew (char*, _tmp11_, _tmp11__size + 1);
		}
		_tmp11_[_tmp11__length++] = g_variant_dup_string (_tmp13_, NULL);
		g_variant_unref (_tmp13_);
	}
	inhibiters_length1 = _tmp11__length1;
	_tmp11_[_tmp11__length] = NULL;
	inhibiters = _tmp11_;
	g_variant_unref (_tmp10_);
	budgie_end_session_remote_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
_dbus_budgie_end_session_remote_Close (BudgieEndSessionRemote* 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_);
	budgie_end_session_remote_Close (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
budgie_end_session_remote_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_budgie_end_session_remote_Open (object, parameters, invocation);
	} else if (strcmp (method_name, "Close") == 0) {
		_dbus_budgie_end_session_remote_Close (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
budgie_end_session_remote_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
budgie_end_session_remote_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_budgie_end_session_remote_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.budgie_desktop.Session.EndSessionDialog", "ConfirmedLogout", _arguments, NULL);
}

static void
_dbus_budgie_end_session_remote_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.budgie_desktop.Session.EndSessionDialog", "ConfirmedReboot", _arguments, NULL);
}

static void
_dbus_budgie_end_session_remote_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.budgie_desktop.Session.EndSessionDialog", "ConfirmedShutdown", _arguments, NULL);
}

static void
_dbus_budgie_end_session_remote_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.budgie_desktop.Session.EndSessionDialog", "Canceled", _arguments, NULL);
}

static void
_dbus_budgie_end_session_remote_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.budgie_desktop.Session.EndSessionDialog", "Closed", _arguments, NULL);
}

guint
budgie_end_session_remote_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 *) (&_budgie_end_session_remote_dbus_interface_info), &_budgie_end_session_remote_dbus_interface_vtable, data, _budgie_end_session_remote_unregister_object, error);
	if (!result) {
		return 0;
	}
	g_signal_connect (object, "confirmed-logout", (GCallback) _dbus_budgie_end_session_remote_confirmed_logout, data);
	g_signal_connect (object, "confirmed-reboot", (GCallback) _dbus_budgie_end_session_remote_confirmed_reboot, data);
	g_signal_connect (object, "confirmed-shutdown", (GCallback) _dbus_budgie_end_session_remote_confirmed_shutdown, data);
	g_signal_connect (object, "canceled", (GCallback) _dbus_budgie_end_session_remote_canceled, data);
	g_signal_connect (object, "closed", (GCallback) _dbus_budgie_end_session_remote_closed, data);
	return result;
}

static void
_budgie_end_session_remote_unregister_object (gpointer user_data)
{
	gpointer* data;
	data = user_data;
	g_signal_handlers_disconnect_by_func (data[0], _dbus_budgie_end_session_remote_confirmed_logout, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_budgie_end_session_remote_confirmed_reboot, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_budgie_end_session_remote_confirmed_shutdown, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_budgie_end_session_remote_canceled, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_budgie_end_session_remote_closed, data);
	g_object_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}

static inline gpointer
budgie_session_handler_get_instance_private (BudgieSessionHandler* self)
{
	return G_STRUCT_MEMBER_P (self, BudgieSessionHandler_private_offset);
}

static void
_budgie_session_handler_has_dialog_gbus_name_appeared_callback (GDBusConnection* connection,
                                                                const gchar* name,
                                                                const gchar* name_owner,
                                                                gpointer self)
{
	budgie_session_handler_has_dialog ((BudgieSessionHandler*) self);
}

static void
_budgie_session_handler_lost_dialog_gbus_name_vanished_callback (GDBusConnection* connection,
                                                                 const gchar* name,
                                                                 gpointer self)
{
	budgie_session_handler_lost_dialog ((BudgieSessionHandler*) self);
}

BudgieSessionHandler*
budgie_session_handler_construct (GType object_type)
{
	BudgieSessionHandler * self = NULL;
	self = (BudgieSessionHandler*) g_object_new (object_type, NULL);
	g_bus_watch_name_with_closures (G_BUS_TYPE_SESSION, "org.budgie_desktop.Session.EndSessionDialog", G_BUS_NAME_WATCHER_FLAGS_NONE, (GClosure*) ((_budgie_session_handler_has_dialog_gbus_name_appeared_callback == NULL) ? NULL : g_cclosure_new ((GCallback) _budgie_session_handler_has_dialog_gbus_name_appeared_callback, g_object_ref (self), (GClosureNotify) g_object_unref)), (GClosure*) ((_budgie_session_handler_lost_dialog_gbus_name_vanished_callback == NULL) ? NULL : g_cclosure_new ((GCallback) _budgie_session_handler_lost_dialog_gbus_name_vanished_callback, g_object_ref (self), (GClosureNotify) g_object_unref)));
	return self;
}

BudgieSessionHandler*
budgie_session_handler_new (void)
{
	return budgie_session_handler_construct (BUDGIE_TYPE_SESSION_HANDLER);
}

static void
___lambda17_ (BudgieSessionHandler* self)
{
	g_signal_emit (self, budgie_session_handler_signals[BUDGIE_SESSION_HANDLER_CONFIRMED_LOGOUT_SIGNAL], 0);
}

static void
____lambda17__budgie_end_session_remote_confirmed_logout (BudgieEndSessionRemote* _sender,
                                                          gpointer self)
{
	___lambda17_ ((BudgieSessionHandler*) self);
}

static void
___lambda18_ (BudgieSessionHandler* self)
{
	g_signal_emit (self, budgie_session_handler_signals[BUDGIE_SESSION_HANDLER_CONFIRMED_REBOOT_SIGNAL], 0);
}

static void
____lambda18__budgie_end_session_remote_confirmed_reboot (BudgieEndSessionRemote* _sender,
                                                          gpointer self)
{
	___lambda18_ ((BudgieSessionHandler*) self);
}

static void
___lambda19_ (BudgieSessionHandler* self)
{
	g_signal_emit (self, budgie_session_handler_signals[BUDGIE_SESSION_HANDLER_CONFIRMED_SHUTDOWN_SIGNAL], 0);
}

static void
____lambda19__budgie_end_session_remote_confirmed_shutdown (BudgieEndSessionRemote* _sender,
                                                            gpointer self)
{
	___lambda19_ ((BudgieSessionHandler*) self);
}

static void
___lambda20_ (BudgieSessionHandler* self)
{
	g_signal_emit (self, budgie_session_handler_signals[BUDGIE_SESSION_HANDLER_CANCELED_SIGNAL], 0);
}

static void
____lambda20__budgie_end_session_remote_canceled (BudgieEndSessionRemote* _sender,
                                                  gpointer self)
{
	___lambda20_ ((BudgieSessionHandler*) self);
}

static void
___lambda21_ (BudgieSessionHandler* self)
{
	g_signal_emit (self, budgie_session_handler_signals[BUDGIE_SESSION_HANDLER_CLOSED_SIGNAL], 0);
}

static void
____lambda21__budgie_end_session_remote_closed (BudgieEndSessionRemote* _sender,
                                                gpointer self)
{
	___lambda21_ ((BudgieSessionHandler*) self);
}

static void
budgie_session_handler_on_dialog_get (BudgieSessionHandler* self,
                                      GObject* o,
                                      GAsyncResult* res)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	{
		BudgieEndSessionRemote* _tmp0_ = NULL;
		BudgieEndSessionRemote* _tmp1_;
		BudgieEndSessionRemote* _tmp2_;
		BudgieEndSessionRemote* _tmp3_;
		BudgieEndSessionRemote* _tmp4_;
		BudgieEndSessionRemote* _tmp5_;
		BudgieEndSessionRemote* _tmp6_;
		BudgieEndSessionRemote* _tmp7_;
		BudgieEndSessionRemote* _tmp8_;
		_tmp1_ = g_async_result_get_source_object (res);
		_tmp2_ = (BudgieEndSessionRemote*) g_async_initable_new_finish ((GAsyncInitable *) _tmp1_, res, &_inner_error0_);
		g_object_unref (_tmp1_);
		_tmp0_ = (BudgieEndSessionRemote*) _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_;
		_tmp4_ = self->priv->proxy;
		g_signal_connect_object (_tmp4_, "confirmed-logout", (GCallback) ____lambda17__budgie_end_session_remote_confirmed_logout, self, 0);
		_tmp5_ = self->priv->proxy;
		g_signal_connect_object (_tmp5_, "confirmed-reboot", (GCallback) ____lambda18__budgie_end_session_remote_confirmed_reboot, self, 0);
		_tmp6_ = self->priv->proxy;
		g_signal_connect_object (_tmp6_, "confirmed-shutdown", (GCallback) ____lambda19__budgie_end_session_remote_confirmed_shutdown, self, 0);
		_tmp7_ = self->priv->proxy;
		g_signal_connect_object (_tmp7_, "canceled", (GCallback) ____lambda20__budgie_end_session_remote_canceled, self, 0);
		_tmp8_ = self->priv->proxy;
		g_signal_connect_object (_tmp8_, "closed", (GCallback) ____lambda21__budgie_end_session_remote_closed, self, 0);
		_g_object_unref0 (_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
		_g_object_unref0 (self->priv->proxy);
		self->priv->proxy = NULL;
	}
	__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
_budgie_session_handler_on_dialog_get_gasync_ready_callback (GObject* source_object,
                                                             GAsyncResult* res,
                                                             gpointer self)
{
	budgie_session_handler_on_dialog_get ((BudgieSessionHandler*) self, source_object, res);
	g_object_unref (self);
}

static void
budgie_session_handler_has_dialog (BudgieSessionHandler* self)
{
	BudgieEndSessionRemote* _tmp0_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->proxy;
	if (_tmp0_ != NULL) {
		return;
	}
	g_async_initable_new_async (BUDGIE_TYPE_END_SESSION_REMOTE_PROXY, 0, NULL, _budgie_session_handler_on_dialog_get_gasync_ready_callback, g_object_ref (self), "g-flags", 0, "g-name", "org.budgie_desktop.Session.EndSessionDialog", "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/org/budgie_desktop/Session/EndSessionDialog", "g-interface-name", "org.budgie_desktop.Session.EndSessionDialog", NULL);
}

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

void
budgie_session_handler_Open (BudgieSessionHandler* self,
                             guint type,
                             guint timestamp,
                             guint open_length,
                             char** inhibiters,
                             gint inhibiters_length1,
                             GError** error)
{
	BudgieEndSessionRemote* _tmp0_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->proxy;
	if (_tmp0_ == NULL) {
		return;
	}
	{
		BudgieEndSessionRemote* _tmp1_;
		_tmp1_ = self->priv->proxy;
		budgie_end_session_remote_Open (_tmp1_, type, timestamp, open_length, inhibiters, (gint) inhibiters_length1, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp2_;
		const gchar* _tmp3_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp2_ = e;
		_tmp3_ = _tmp2_->message;
		g_message ("shim.vala:80: %s", _tmp3_);
		_g_error_free0 (e);
	}
	__finally0:
	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
budgie_session_handler_Close (BudgieSessionHandler* self,
                              GError** error)
{
	BudgieEndSessionRemote* _tmp0_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->proxy;
	if (_tmp0_ == NULL) {
		{
			BudgieEndSessionRemote* _tmp1_;
			_tmp1_ = self->priv->proxy;
			budgie_end_session_remote_Close (_tmp1_, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
		}
		goto __finally0;
		__catch0_g_error:
		{
			GError* e = NULL;
			GError* _tmp2_;
			const gchar* _tmp3_;
			e = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp2_ = e;
			_tmp3_ = _tmp2_->message;
			g_message ("shim.vala:89: %s", _tmp3_);
			_g_error_free0 (e);
		}
		__finally0:
		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;
			}
		}
	}
}

static void
budgie_session_handler_class_init (BudgieSessionHandlerClass * klass,
                                   gpointer klass_data)
{
	budgie_session_handler_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BudgieSessionHandler_private_offset);
	G_OBJECT_CLASS (klass)->finalize = budgie_session_handler_finalize;
	budgie_session_handler_signals[BUDGIE_SESSION_HANDLER_CONFIRMED_LOGOUT_SIGNAL] = g_signal_new ("confirmed-logout", BUDGIE_TYPE_SESSION_HANDLER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	budgie_session_handler_signals[BUDGIE_SESSION_HANDLER_CONFIRMED_REBOOT_SIGNAL] = g_signal_new ("confirmed-reboot", BUDGIE_TYPE_SESSION_HANDLER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	budgie_session_handler_signals[BUDGIE_SESSION_HANDLER_CONFIRMED_SHUTDOWN_SIGNAL] = g_signal_new ("confirmed-shutdown", BUDGIE_TYPE_SESSION_HANDLER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	budgie_session_handler_signals[BUDGIE_SESSION_HANDLER_CANCELED_SIGNAL] = g_signal_new ("canceled", BUDGIE_TYPE_SESSION_HANDLER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	budgie_session_handler_signals[BUDGIE_SESSION_HANDLER_CLOSED_SIGNAL] = g_signal_new ("closed", BUDGIE_TYPE_SESSION_HANDLER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
budgie_session_handler_instance_init (BudgieSessionHandler * self,
                                      gpointer klass)
{
	self->priv = budgie_session_handler_get_instance_private (self);
	self->priv->proxy = NULL;
}

static void
budgie_session_handler_finalize (GObject * obj)
{
	BudgieSessionHandler * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BUDGIE_TYPE_SESSION_HANDLER, BudgieSessionHandler);
	_g_object_unref0 (self->priv->proxy);
	G_OBJECT_CLASS (budgie_session_handler_parent_class)->finalize (obj);
}

static GType
budgie_session_handler_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BudgieSessionHandlerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) budgie_session_handler_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BudgieSessionHandler), 0, (GInstanceInitFunc) budgie_session_handler_instance_init, NULL };
	GType budgie_session_handler_type_id;
	budgie_session_handler_type_id = g_type_register_static (G_TYPE_OBJECT, "BudgieSessionHandler", &g_define_type_info, 0);
	g_type_set_qdata (budgie_session_handler_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) budgie_session_handler_register_object);
	BudgieSessionHandler_private_offset = g_type_add_instance_private (budgie_session_handler_type_id, sizeof (BudgieSessionHandlerPrivate));
	return budgie_session_handler_type_id;
}

GType
budgie_session_handler_get_type (void)
{
	static volatile gsize budgie_session_handler_type_id__once = 0;
	if (g_once_init_enter (&budgie_session_handler_type_id__once)) {
		GType budgie_session_handler_type_id;
		budgie_session_handler_type_id = budgie_session_handler_get_type_once ();
		g_once_init_leave (&budgie_session_handler_type_id__once, budgie_session_handler_type_id);
	}
	return budgie_session_handler_type_id__once;
}

static void
_dbus_budgie_session_handler_Open (BudgieSessionHandler* self,
                                   GVariant* _parameters_,
                                   GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	guint type = 0U;
	GVariant* _tmp14_;
	guint timestamp = 0U;
	GVariant* _tmp15_;
	guint open_length = 0U;
	GVariant* _tmp16_;
	char** inhibiters = NULL;
	gint inhibiters_length1 = 0;
	GVariant* _tmp17_;
	char** _tmp18_;
	gint _tmp18__length;
	gint _tmp18__size;
	gint _tmp18__length1;
	GVariantIter _tmp19_;
	GVariant* _tmp20_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp14_ = g_variant_iter_next_value (&_arguments_iter);
	type = g_variant_get_uint32 (_tmp14_);
	g_variant_unref (_tmp14_);
	_tmp15_ = g_variant_iter_next_value (&_arguments_iter);
	timestamp = g_variant_get_uint32 (_tmp15_);
	g_variant_unref (_tmp15_);
	_tmp16_ = g_variant_iter_next_value (&_arguments_iter);
	open_length = g_variant_get_uint32 (_tmp16_);
	g_variant_unref (_tmp16_);
	_tmp17_ = g_variant_iter_next_value (&_arguments_iter);
	_tmp18_ = g_new (char*, 5);
	_tmp18__length = 0;
	_tmp18__size = 4;
	_tmp18__length1 = 0;
	g_variant_iter_init (&_tmp19_, _tmp17_);
	for (; (_tmp20_ = g_variant_iter_next_value (&_tmp19_)) != NULL; _tmp18__length1++) {
		if (_tmp18__size == _tmp18__length) {
			_tmp18__size = 2 * _tmp18__size;
			_tmp18_ = g_renew (char*, _tmp18_, _tmp18__size + 1);
		}
		_tmp18_[_tmp18__length++] = g_variant_dup_string (_tmp20_, NULL);
		g_variant_unref (_tmp20_);
	}
	inhibiters_length1 = _tmp18__length1;
	_tmp18_[_tmp18__length] = NULL;
	inhibiters = _tmp18_;
	g_variant_unref (_tmp17_);
	budgie_session_handler_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
_dbus_budgie_session_handler_Close (BudgieSessionHandler* 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_);
	budgie_session_handler_Close (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
budgie_session_handler_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_budgie_session_handler_Open (object, parameters, invocation);
	} else if (strcmp (method_name, "Close") == 0) {
		_dbus_budgie_session_handler_Close (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
budgie_session_handler_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
budgie_session_handler_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_budgie_session_handler_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_budgie_session_handler_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_budgie_session_handler_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_budgie_session_handler_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_budgie_session_handler_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
budgie_session_handler_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 *) (&_budgie_session_handler_dbus_interface_info), &_budgie_session_handler_dbus_interface_vtable, data, _budgie_session_handler_unregister_object, error);
	if (!result) {
		return 0;
	}
	g_signal_connect (object, "confirmed-logout", (GCallback) _dbus_budgie_session_handler_confirmed_logout, data);
	g_signal_connect (object, "confirmed-reboot", (GCallback) _dbus_budgie_session_handler_confirmed_reboot, data);
	g_signal_connect (object, "confirmed-shutdown", (GCallback) _dbus_budgie_session_handler_confirmed_shutdown, data);
	g_signal_connect (object, "canceled", (GCallback) _dbus_budgie_session_handler_canceled, data);
	g_signal_connect (object, "closed", (GCallback) _dbus_budgie_session_handler_closed, data);
	return result;
}

static void
_budgie_session_handler_unregister_object (gpointer user_data)
{
	gpointer* data;
	data = user_data;
	g_signal_handlers_disconnect_by_func (data[0], _dbus_budgie_session_handler_confirmed_logout, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_budgie_session_handler_confirmed_reboot, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_budgie_session_handler_confirmed_shutdown, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_budgie_session_handler_canceled, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_budgie_session_handler_closed, data);
	g_object_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}

static inline gpointer
budgie_shell_shim_get_instance_private (BudgieShellShim* self)
{
	return G_STRUCT_MEMBER_P (self, BudgieShellShim_private_offset);
}

BudgieShellShim*
budgie_shell_shim_construct (GType object_type)
{
	BudgieShellShim * self = NULL;
	BudgieSessionHandler* _tmp0_;
	self = (BudgieShellShim*) g_object_new (object_type, NULL);
	_tmp0_ = budgie_session_handler_new ();
	_g_object_unref0 (self->priv->handler);
	self->priv->handler = _tmp0_;
	return self;
}

BudgieShellShim*
budgie_shell_shim_new (void)
{
	return budgie_shell_shim_construct (BUDGIE_TYPE_SHELL_SHIM);
}

static void
budgie_shell_shim_on_bus_acquired (BudgieShellShim* self,
                                   GDBusConnection* conn)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (conn != NULL);
	{
		BudgieSessionHandler* _tmp0_;
		_tmp0_ = self->priv->handler;
		budgie_session_handler_register_object (_tmp0_, conn, "/org/gnome/SessionManager/EndSessionDialog", &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp1_;
		const gchar* _tmp2_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp1_ = e;
		_tmp2_ = _tmp1_->message;
		g_message ("shim.vala:108: Unable to register ShellShim: %s", _tmp2_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
_budgie_shell_shim_on_bus_acquired_gbus_acquired_callback (GDBusConnection* connection,
                                                           const gchar* name,
                                                           gpointer self)
{
	budgie_shell_shim_on_bus_acquired ((BudgieShellShim*) self, connection);
}

void
budgie_shell_shim_serve (BudgieShellShim* self)
{
	g_return_if_fail (self != NULL);
	g_bus_own_name_with_closures (G_BUS_TYPE_SESSION, "org.gnome.Shell", G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT | G_BUS_NAME_OWNER_FLAGS_REPLACE, (GClosure*) ((_budgie_shell_shim_on_bus_acquired_gbus_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) _budgie_shell_shim_on_bus_acquired_gbus_acquired_callback, g_object_ref (self), (GClosureNotify) g_object_unref)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
}

static void
budgie_shell_shim_class_init (BudgieShellShimClass * klass,
                              gpointer klass_data)
{
	budgie_shell_shim_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BudgieShellShim_private_offset);
	G_OBJECT_CLASS (klass)->finalize = budgie_shell_shim_finalize;
}

static void
budgie_shell_shim_instance_init (BudgieShellShim * self,
                                 gpointer klass)
{
	self->priv = budgie_shell_shim_get_instance_private (self);
	self->priv->handler = NULL;
}

static void
budgie_shell_shim_finalize (GObject * obj)
{
	BudgieShellShim * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BUDGIE_TYPE_SHELL_SHIM, BudgieShellShim);
	_g_object_unref0 (self->priv->handler);
	G_OBJECT_CLASS (budgie_shell_shim_parent_class)->finalize (obj);
}

static GType
budgie_shell_shim_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BudgieShellShimClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) budgie_shell_shim_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BudgieShellShim), 0, (GInstanceInitFunc) budgie_shell_shim_instance_init, NULL };
	GType budgie_shell_shim_type_id;
	budgie_shell_shim_type_id = g_type_register_static (G_TYPE_OBJECT, "BudgieShellShim", &g_define_type_info, 0);
	g_type_set_qdata (budgie_shell_shim_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) budgie_shell_shim_register_object);
	BudgieShellShim_private_offset = g_type_add_instance_private (budgie_shell_shim_type_id, sizeof (BudgieShellShimPrivate));
	return budgie_shell_shim_type_id;
}

GType
budgie_shell_shim_get_type (void)
{
	static volatile gsize budgie_shell_shim_type_id__once = 0;
	if (g_once_init_enter (&budgie_shell_shim_type_id__once)) {
		GType budgie_shell_shim_type_id;
		budgie_shell_shim_type_id = budgie_shell_shim_get_type_once ();
		g_once_init_leave (&budgie_shell_shim_type_id__once, budgie_shell_shim_type_id);
	}
	return budgie_shell_shim_type_id__once;
}

static void
budgie_shell_shim_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];
	g_object_unref (invocation);
}

static GVariant*
budgie_shell_shim_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
budgie_shell_shim_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
budgie_shell_shim_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 *) (&_budgie_shell_shim_dbus_interface_info), &_budgie_shell_shim_dbus_interface_vtable, data, _budgie_shell_shim_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}

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

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

