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

/*
 * Copyright (c) 2021 elementary, Inc. (https://elementary.io)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301 USA
 *
 * Authored by: Marius Meisenzahl <mariusmeisenzahl@gmail.com>
 */

#include "system.h"
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <glib-object.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

typedef GDBusProxy AboutLoginInterfaceProxy;
typedef GDBusProxyClass AboutLoginInterfaceProxyClass;
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	ABOUT_LOGIN_MANAGER_0_PROPERTY,
	ABOUT_LOGIN_MANAGER_NUM_PROPERTIES
};
static GParamSpec* about_login_manager_properties[ABOUT_LOGIN_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)))

struct _AboutLoginManagerPrivate {
	AboutLoginInterface* interface;
};

static gint AboutLoginManager_private_offset;
static gpointer about_login_manager_parent_class = NULL;
static AboutLoginManager* about_login_manager_instance;
static AboutLoginManager* about_login_manager_instance = NULL;

static GType about_login_interface_get_type_once (void);
static void about_login_interface_proxy_g_signal (GDBusProxy* proxy,
                                           const gchar* sender_name,
                                           const gchar* signal_name,
                                           GVariant* parameters);
static void about_login_interface_proxy_reboot (AboutLoginInterface* self,
                                         gboolean interactive,
                                         GError** error);
static void about_login_interface_proxy_power_off (AboutLoginInterface* self,
                                            gboolean interactive,
                                            GError** error);
static void about_login_interface_proxy_set_reboot_to_firmware_setup (AboutLoginInterface* self,
                                                               gboolean interactive,
                                                               GError** error);
static gchar* about_login_interface_proxy_can_reboot_to_firmware_setup (AboutLoginInterface* self,
                                                                 GError** error);
static void about_login_interface_proxy_about_login_interface_interface_init (AboutLoginInterfaceIface* iface);
static void _dbus_about_login_interface_reboot (AboutLoginInterface* self,
                                         GVariant* _parameters_,
                                         GDBusMethodInvocation* invocation);
static void _dbus_about_login_interface_power_off (AboutLoginInterface* self,
                                            GVariant* _parameters_,
                                            GDBusMethodInvocation* invocation);
static void _dbus_about_login_interface_set_reboot_to_firmware_setup (AboutLoginInterface* self,
                                                               GVariant* _parameters_,
                                                               GDBusMethodInvocation* invocation);
static void _dbus_about_login_interface_can_reboot_to_firmware_setup (AboutLoginInterface* self,
                                                               GVariant* _parameters_,
                                                               GDBusMethodInvocation* invocation);
static void about_login_interface_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* about_login_interface_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 about_login_interface_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 _about_login_interface_unregister_object (gpointer user_data);
static AboutLoginManager* about_login_manager_new (void);
static AboutLoginManager* about_login_manager_construct (GType object_type);
static GObject * about_login_manager_constructor (GType type,
                                           guint n_construct_properties,
                                           GObjectConstructParam * construct_properties);
static void about_login_manager_finalize (GObject * obj);
static GType about_login_manager_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static const GDBusArgInfo _about_login_interface_dbus_arg_info_reboot_interactive = {-1, "interactive", "b", NULL};
static const GDBusArgInfo * const _about_login_interface_dbus_arg_info_reboot_in[] = {&_about_login_interface_dbus_arg_info_reboot_interactive, NULL};
static const GDBusArgInfo * const _about_login_interface_dbus_arg_info_reboot_out[] = {NULL};
static const GDBusMethodInfo _about_login_interface_dbus_method_info_reboot = {-1, "Reboot", (GDBusArgInfo **) (&_about_login_interface_dbus_arg_info_reboot_in), (GDBusArgInfo **) (&_about_login_interface_dbus_arg_info_reboot_out), NULL};
static const GDBusArgInfo _about_login_interface_dbus_arg_info_power_off_interactive = {-1, "interactive", "b", NULL};
static const GDBusArgInfo * const _about_login_interface_dbus_arg_info_power_off_in[] = {&_about_login_interface_dbus_arg_info_power_off_interactive, NULL};
static const GDBusArgInfo * const _about_login_interface_dbus_arg_info_power_off_out[] = {NULL};
static const GDBusMethodInfo _about_login_interface_dbus_method_info_power_off = {-1, "PowerOff", (GDBusArgInfo **) (&_about_login_interface_dbus_arg_info_power_off_in), (GDBusArgInfo **) (&_about_login_interface_dbus_arg_info_power_off_out), NULL};
static const GDBusArgInfo _about_login_interface_dbus_arg_info_set_reboot_to_firmware_setup_interactive = {-1, "interactive", "b", NULL};
static const GDBusArgInfo * const _about_login_interface_dbus_arg_info_set_reboot_to_firmware_setup_in[] = {&_about_login_interface_dbus_arg_info_set_reboot_to_firmware_setup_interactive, NULL};
static const GDBusArgInfo * const _about_login_interface_dbus_arg_info_set_reboot_to_firmware_setup_out[] = {NULL};
static const GDBusMethodInfo _about_login_interface_dbus_method_info_set_reboot_to_firmware_setup = {-1, "SetRebootToFirmwareSetup", (GDBusArgInfo **) (&_about_login_interface_dbus_arg_info_set_reboot_to_firmware_setup_in), (GDBusArgInfo **) (&_about_login_interface_dbus_arg_info_set_reboot_to_firmware_setup_out), NULL};
static const GDBusArgInfo _about_login_interface_dbus_arg_info_can_reboot_to_firmware_setup_result = {-1, "result", "s", NULL};
static const GDBusArgInfo * const _about_login_interface_dbus_arg_info_can_reboot_to_firmware_setup_in[] = {NULL};
static const GDBusArgInfo * const _about_login_interface_dbus_arg_info_can_reboot_to_firmware_setup_out[] = {&_about_login_interface_dbus_arg_info_can_reboot_to_firmware_setup_result, NULL};
static const GDBusMethodInfo _about_login_interface_dbus_method_info_can_reboot_to_firmware_setup = {-1, "CanRebootToFirmwareSetup", (GDBusArgInfo **) (&_about_login_interface_dbus_arg_info_can_reboot_to_firmware_setup_in), (GDBusArgInfo **) (&_about_login_interface_dbus_arg_info_can_reboot_to_firmware_setup_out), NULL};
static const GDBusMethodInfo * const _about_login_interface_dbus_method_info[] = {&_about_login_interface_dbus_method_info_reboot, &_about_login_interface_dbus_method_info_power_off, &_about_login_interface_dbus_method_info_set_reboot_to_firmware_setup, &_about_login_interface_dbus_method_info_can_reboot_to_firmware_setup, NULL};
static const GDBusSignalInfo * const _about_login_interface_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo * const _about_login_interface_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _about_login_interface_dbus_interface_info = {-1, "org.freedesktop.login1.Manager", (GDBusMethodInfo **) (&_about_login_interface_dbus_method_info), (GDBusSignalInfo **) (&_about_login_interface_dbus_signal_info), (GDBusPropertyInfo **) (&_about_login_interface_dbus_property_info), NULL};
static const GDBusInterfaceVTable _about_login_interface_dbus_interface_vtable = {about_login_interface_dbus_interface_method_call, about_login_interface_dbus_interface_get_property, about_login_interface_dbus_interface_set_property};

void
about_login_interface_reboot (AboutLoginInterface* self,
                              gboolean interactive,
                              GError** error)
{
	AboutLoginInterfaceIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = ABOUT_LOGIN_INTERFACE_GET_INTERFACE (self);
	if (_iface_->reboot) {
		_iface_->reboot (self, interactive, error);
	}
}

void
about_login_interface_power_off (AboutLoginInterface* self,
                                 gboolean interactive,
                                 GError** error)
{
	AboutLoginInterfaceIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = ABOUT_LOGIN_INTERFACE_GET_INTERFACE (self);
	if (_iface_->power_off) {
		_iface_->power_off (self, interactive, error);
	}
}

void
about_login_interface_set_reboot_to_firmware_setup (AboutLoginInterface* self,
                                                    gboolean interactive,
                                                    GError** error)
{
	AboutLoginInterfaceIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = ABOUT_LOGIN_INTERFACE_GET_INTERFACE (self);
	if (_iface_->set_reboot_to_firmware_setup) {
		_iface_->set_reboot_to_firmware_setup (self, interactive, error);
	}
}

gchar*
about_login_interface_can_reboot_to_firmware_setup (AboutLoginInterface* self,
                                                    GError** error)
{
	AboutLoginInterfaceIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = ABOUT_LOGIN_INTERFACE_GET_INTERFACE (self);
	if (_iface_->can_reboot_to_firmware_setup) {
		return _iface_->can_reboot_to_firmware_setup (self, error);
	}
	return NULL;
}

static void
about_login_interface_default_init (AboutLoginInterfaceIface * iface,
                                    gpointer iface_data)
{
}

 G_GNUC_NO_INLINE static GType
about_login_interface_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (AboutLoginInterfaceIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) about_login_interface_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType about_login_interface_type_id;
	about_login_interface_type_id = g_type_register_static (G_TYPE_INTERFACE, "AboutLoginInterface", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (about_login_interface_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (about_login_interface_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) about_login_interface_proxy_get_type);
	g_type_set_qdata (about_login_interface_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.freedesktop.login1.Manager");
	g_type_set_qdata (about_login_interface_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_about_login_interface_dbus_interface_info));
	g_type_set_qdata (about_login_interface_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) about_login_interface_register_object);
	return about_login_interface_type_id;
}

GType
about_login_interface_get_type (void)
{
	static volatile gsize about_login_interface_type_id__once = 0;
	if (g_once_init_enter (&about_login_interface_type_id__once)) {
		GType about_login_interface_type_id;
		about_login_interface_type_id = about_login_interface_get_type_once ();
		g_once_init_leave (&about_login_interface_type_id__once, about_login_interface_type_id);
	}
	return about_login_interface_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (AboutLoginInterfaceProxy, about_login_interface_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (ABOUT_TYPE_LOGIN_INTERFACE, about_login_interface_proxy_about_login_interface_interface_init) )
static void
about_login_interface_proxy_class_init (AboutLoginInterfaceProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = about_login_interface_proxy_g_signal;
}

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

static void
about_login_interface_proxy_init (AboutLoginInterfaceProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_about_login_interface_dbus_interface_info));
}

static void
about_login_interface_proxy_reboot (AboutLoginInterface* self,
                                    gboolean interactive,
                                    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.freedesktop.login1.Manager", "Reboot");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_boolean (interactive));
	_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
about_login_interface_proxy_power_off (AboutLoginInterface* self,
                                       gboolean interactive,
                                       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.freedesktop.login1.Manager", "PowerOff");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_boolean (interactive));
	_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
about_login_interface_proxy_set_reboot_to_firmware_setup (AboutLoginInterface* self,
                                                          gboolean interactive,
                                                          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.freedesktop.login1.Manager", "SetRebootToFirmwareSetup");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_boolean (interactive));
	_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 gchar*
about_login_interface_proxy_can_reboot_to_firmware_setup (AboutLoginInterface* self,
                                                          GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	gchar* _result = NULL;
	GVariant* _tmp57_;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.freedesktop.login1.Manager", "CanRebootToFirmwareSetup");
	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 NULL;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return NULL;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_tmp57_ = g_variant_iter_next_value (&_reply_iter);
	_result = g_variant_dup_string (_tmp57_, NULL);
	g_variant_unref (_tmp57_);
	g_object_unref (_reply_message);
	return _result;
}

static void
about_login_interface_proxy_about_login_interface_interface_init (AboutLoginInterfaceIface* iface)
{
	iface->reboot = about_login_interface_proxy_reboot;
	iface->power_off = about_login_interface_proxy_power_off;
	iface->set_reboot_to_firmware_setup = about_login_interface_proxy_set_reboot_to_firmware_setup;
	iface->can_reboot_to_firmware_setup = about_login_interface_proxy_can_reboot_to_firmware_setup;
}

static void
_dbus_about_login_interface_reboot (AboutLoginInterface* self,
                                    GVariant* _parameters_,
                                    GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gboolean interactive = FALSE;
	GVariant* _tmp58_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp58_ = g_variant_iter_next_value (&_arguments_iter);
	interactive = g_variant_get_boolean (_tmp58_);
	g_variant_unref (_tmp58_);
	about_login_interface_reboot (self, interactive, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
_dbus_about_login_interface_power_off (AboutLoginInterface* self,
                                       GVariant* _parameters_,
                                       GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gboolean interactive = FALSE;
	GVariant* _tmp59_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp59_ = g_variant_iter_next_value (&_arguments_iter);
	interactive = g_variant_get_boolean (_tmp59_);
	g_variant_unref (_tmp59_);
	about_login_interface_power_off (self, interactive, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
_dbus_about_login_interface_set_reboot_to_firmware_setup (AboutLoginInterface* self,
                                                          GVariant* _parameters_,
                                                          GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gboolean interactive = FALSE;
	GVariant* _tmp60_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp60_ = g_variant_iter_next_value (&_arguments_iter);
	interactive = g_variant_get_boolean (_tmp60_);
	g_variant_unref (_tmp60_);
	about_login_interface_set_reboot_to_firmware_setup (self, interactive, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
_dbus_about_login_interface_can_reboot_to_firmware_setup (AboutLoginInterface* self,
                                                          GVariant* _parameters_,
                                                          GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gchar* result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	result = about_login_interface_can_reboot_to_firmware_setup (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);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_string (result));
	_g_free0 (result);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
about_login_interface_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, "Reboot") == 0) {
		_dbus_about_login_interface_reboot (object, parameters, invocation);
	} else if (strcmp (method_name, "PowerOff") == 0) {
		_dbus_about_login_interface_power_off (object, parameters, invocation);
	} else if (strcmp (method_name, "SetRebootToFirmwareSetup") == 0) {
		_dbus_about_login_interface_set_reboot_to_firmware_setup (object, parameters, invocation);
	} else if (strcmp (method_name, "CanRebootToFirmwareSetup") == 0) {
		_dbus_about_login_interface_can_reboot_to_firmware_setup (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
about_login_interface_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)
{
	return NULL;
}

static gboolean
about_login_interface_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)
{
	return FALSE;
}

guint
about_login_interface_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 *) (&_about_login_interface_dbus_interface_info), &_about_login_interface_dbus_interface_vtable, data, _about_login_interface_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}

static void
_about_login_interface_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 inline gpointer
about_login_manager_get_instance_private (AboutLoginManager* self)
{
	return G_STRUCT_MEMBER_P (self, AboutLoginManager_private_offset);
}

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

AboutLoginManager*
about_login_manager_get_instance (void)
{
	AboutLoginManager* _tmp0_;
	AboutLoginManager* _tmp2_;
	AboutLoginManager* _tmp3_;
	AboutLoginManager* result;
	_tmp0_ = about_login_manager_instance;
	if (_tmp0_ == NULL) {
		AboutLoginManager* _tmp1_;
		_tmp1_ = about_login_manager_new ();
		_g_object_unref0 (about_login_manager_instance);
		about_login_manager_instance = _tmp1_;
	}
	_tmp2_ = about_login_manager_instance;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	result = _tmp3_;
	return result;
}

static AboutLoginManager*
about_login_manager_construct (GType object_type)
{
	AboutLoginManager * self = NULL;
	self = (AboutLoginManager*) g_object_new (object_type, NULL);
	return self;
}

static AboutLoginManager*
about_login_manager_new (void)
{
	return about_login_manager_construct (ABOUT_TYPE_LOGIN_MANAGER);
}

gboolean
about_login_manager_shutdown (AboutLoginManager* self)
{
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	{
		AboutLoginInterface* _tmp0_;
		_tmp0_ = self->priv->interface;
		about_login_interface_power_off (_tmp0_, TRUE, &_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_warning ("LoginManager.vala:56: Could not connect to login interface: %s", _tmp2_);
		result = FALSE;
		_g_error_free0 (e);
		return result;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp3_ = FALSE;
		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 _tmp3_;
	}
	result = TRUE;
	return result;
}

gboolean
about_login_manager_reboot (AboutLoginManager* self)
{
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	{
		AboutLoginInterface* _tmp0_;
		_tmp0_ = self->priv->interface;
		about_login_interface_reboot (_tmp0_, TRUE, &_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_warning ("LoginManager.vala:67: Could not connect to login interface: %s", _tmp2_);
		result = FALSE;
		_g_error_free0 (e);
		return result;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp3_ = FALSE;
		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 _tmp3_;
	}
	result = TRUE;
	return result;
}

GError*
about_login_manager_set_reboot_to_firmware_setup (AboutLoginManager* self)
{
	GError* _inner_error0_ = NULL;
	GError* result;
	g_return_val_if_fail (self != NULL, NULL);
	{
		AboutLoginInterface* _tmp0_;
		_tmp0_ = self->priv->interface;
		about_login_interface_set_reboot_to_firmware_setup (_tmp0_, TRUE, &_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_warning ("LoginManager.vala:78: Could not set reboot to firmware setup: %s", _tmp2_);
		result = e;
		return result;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	result = NULL;
	return result;
}

gboolean
about_login_manager_can_reboot_to_firmware_setup (AboutLoginManager* self)
{
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	{
		gchar* _tmp0_ = NULL;
		AboutLoginInterface* _tmp1_;
		gchar* _tmp2_;
		_tmp1_ = self->priv->interface;
		_tmp2_ = about_login_interface_can_reboot_to_firmware_setup (_tmp1_, &_inner_error0_);
		_tmp0_ = _tmp2_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		result = g_strcmp0 (_tmp0_, "yes") == 0;
		_g_free0 (_tmp0_);
		return result;
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp3_;
		const gchar* _tmp4_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp3_ = e;
		_tmp4_ = _tmp3_->message;
		g_warning ("LoginManager.vala:89: Could not connect to login interface: %s", _tmp4_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp5_ = FALSE;
		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 _tmp5_;
	}
	result = FALSE;
	return result;
}

static GObject *
about_login_manager_constructor (GType type,
                                 guint n_construct_properties,
                                 GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	AboutLoginManager * self;
	GError* _inner_error0_ = NULL;
	parent_class = G_OBJECT_CLASS (about_login_manager_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ABOUT_TYPE_LOGIN_MANAGER, AboutLoginManager);
	{
		AboutLoginInterface* _tmp0_ = NULL;
		AboutLoginInterface* _tmp1_;
		AboutLoginInterface* _tmp2_;
		_tmp1_ = (AboutLoginInterface*) g_initable_new (ABOUT_TYPE_LOGIN_INTERFACE_PROXY, NULL, &_inner_error0_, "g-flags", 0, "g-name", "org.freedesktop.login1", "g-bus-type", G_BUS_TYPE_SYSTEM, "g-object-path", "/org/freedesktop/login1", "g-interface-name", "org.freedesktop.login1.Manager", NULL);
		_tmp0_ = (AboutLoginInterface*) _tmp1_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp2_ = _tmp0_;
		_tmp0_ = NULL;
		_g_object_unref0 (self->priv->interface);
		self->priv->interface = _tmp2_;
		_g_object_unref0 (_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp3_;
		const gchar* _tmp4_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp3_ = e;
		_tmp4_ = _tmp3_->message;
		g_warning ("LoginManager.vala:48: Could not connect to login interface: %s", _tmp4_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
	}
	return obj;
}

static void
about_login_manager_class_init (AboutLoginManagerClass * klass,
                                gpointer klass_data)
{
	about_login_manager_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &AboutLoginManager_private_offset);
	G_OBJECT_CLASS (klass)->constructor = about_login_manager_constructor;
	G_OBJECT_CLASS (klass)->finalize = about_login_manager_finalize;
}

static void
about_login_manager_instance_init (AboutLoginManager * self,
                                   gpointer klass)
{
	self->priv = about_login_manager_get_instance_private (self);
}

static void
about_login_manager_finalize (GObject * obj)
{
	AboutLoginManager * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ABOUT_TYPE_LOGIN_MANAGER, AboutLoginManager);
	_g_object_unref0 (self->priv->interface);
	G_OBJECT_CLASS (about_login_manager_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
about_login_manager_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (AboutLoginManagerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) about_login_manager_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (AboutLoginManager), 0, (GInstanceInitFunc) about_login_manager_instance_init, NULL };
	GType about_login_manager_type_id;
	about_login_manager_type_id = g_type_register_static (G_TYPE_OBJECT, "AboutLoginManager", &g_define_type_info, 0);
	AboutLoginManager_private_offset = g_type_add_instance_private (about_login_manager_type_id, sizeof (AboutLoginManagerPrivate));
	return about_login_manager_type_id;
}

GType
about_login_manager_get_type (void)
{
	static volatile gsize about_login_manager_type_id__once = 0;
	if (g_once_init_enter (&about_login_manager_type_id__once)) {
		GType about_login_manager_type_id;
		about_login_manager_type_id = about_login_manager_get_type_once ();
		g_once_init_leave (&about_login_manager_type_id__once, about_login_manager_type_id);
	}
	return about_login_manager_type_id__once;
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

