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

/*
 * Copyright 2024 elementary, Inc. (https://elementary.io)
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

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

#define SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_PROFILE_PLUGGED_IN "profile-plugged-in"
#define SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_PROFILE_ON_BATTERY "profile-on-good-battery"
#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 SETTINGS_DAEMON_BACKENDS_TYPE_POWER_PROFILES_SYNC (settings_daemon_backends_power_profiles_sync_get_type ())
#define SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SETTINGS_DAEMON_BACKENDS_TYPE_POWER_PROFILES_SYNC, SettingsDaemonBackendsPowerProfilesSync))
#define SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SETTINGS_DAEMON_BACKENDS_TYPE_POWER_PROFILES_SYNC, SettingsDaemonBackendsPowerProfilesSyncClass))
#define SETTINGS_DAEMON_BACKENDS_IS_POWER_PROFILES_SYNC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SETTINGS_DAEMON_BACKENDS_TYPE_POWER_PROFILES_SYNC))
#define SETTINGS_DAEMON_BACKENDS_IS_POWER_PROFILES_SYNC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SETTINGS_DAEMON_BACKENDS_TYPE_POWER_PROFILES_SYNC))
#define SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SETTINGS_DAEMON_BACKENDS_TYPE_POWER_PROFILES_SYNC, SettingsDaemonBackendsPowerProfilesSyncClass))

typedef struct _SettingsDaemonBackendsPowerProfilesSync SettingsDaemonBackendsPowerProfilesSync;
typedef struct _SettingsDaemonBackendsPowerProfilesSyncClass SettingsDaemonBackendsPowerProfilesSyncClass;
typedef struct _SettingsDaemonBackendsPowerProfilesSyncPrivate SettingsDaemonBackendsPowerProfilesSyncPrivate;

#define SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_TYPE_UPOWER (settings_daemon_backends_power_profiles_sync_upower_get_type ())
#define SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_UPOWER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_TYPE_UPOWER, SettingsDaemonBackendsPowerProfilesSyncUPower))
#define SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_IS_UPOWER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_TYPE_UPOWER))
#define SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_UPOWER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_TYPE_UPOWER, SettingsDaemonBackendsPowerProfilesSyncUPowerIface))

typedef struct _SettingsDaemonBackendsPowerProfilesSyncUPower SettingsDaemonBackendsPowerProfilesSyncUPower;
typedef struct _SettingsDaemonBackendsPowerProfilesSyncUPowerIface SettingsDaemonBackendsPowerProfilesSyncUPowerIface;

#define SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_TYPE_UPOWER_PROXY (settings_daemon_backends_power_profiles_sync_upower_proxy_get_type ())

#define SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_TYPE_POWER_PROFILE (settings_daemon_backends_power_profiles_sync_power_profile_get_type ())
#define SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_POWER_PROFILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_TYPE_POWER_PROFILE, SettingsDaemonBackendsPowerProfilesSyncPowerProfile))
#define SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_IS_POWER_PROFILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_TYPE_POWER_PROFILE))
#define SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_POWER_PROFILE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_TYPE_POWER_PROFILE, SettingsDaemonBackendsPowerProfilesSyncPowerProfileIface))

typedef struct _SettingsDaemonBackendsPowerProfilesSyncPowerProfile SettingsDaemonBackendsPowerProfilesSyncPowerProfile;
typedef struct _SettingsDaemonBackendsPowerProfilesSyncPowerProfileIface SettingsDaemonBackendsPowerProfilesSyncPowerProfileIface;

#define SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_TYPE_POWER_PROFILE_PROXY (settings_daemon_backends_power_profiles_sync_power_profile_proxy_get_type ())
enum  {
	SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_0_PROPERTY,
	SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_NUM_PROPERTIES
};
static GParamSpec* settings_daemon_backends_power_profiles_sync_properties[SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_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)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef GDBusProxy SettingsDaemonBackendsPowerProfilesSyncUPowerProxy;
typedef GDBusProxyClass SettingsDaemonBackendsPowerProfilesSyncUPowerProxyClass;
typedef GDBusProxy SettingsDaemonBackendsPowerProfilesSyncPowerProfileProxy;
typedef GDBusProxyClass SettingsDaemonBackendsPowerProfilesSyncPowerProfileProxyClass;

struct _SettingsDaemonBackendsPowerProfilesSync {
	GObject parent_instance;
	SettingsDaemonBackendsPowerProfilesSyncPrivate * priv;
};

struct _SettingsDaemonBackendsPowerProfilesSyncClass {
	GObjectClass parent_class;
};

struct _SettingsDaemonBackendsPowerProfilesSyncUPowerIface {
	GTypeInterface parent_iface;
	gboolean (*get_on_battery) (SettingsDaemonBackendsPowerProfilesSyncUPower* self);
};

struct _SettingsDaemonBackendsPowerProfilesSyncPowerProfileIface {
	GTypeInterface parent_iface;
	GHashTable** (*get_profiles) (SettingsDaemonBackendsPowerProfilesSyncPowerProfile* self, gint* result_length1);
	gchar* (*get_active_profile) (SettingsDaemonBackendsPowerProfilesSyncPowerProfile* self);
	void (*set_active_profile) (SettingsDaemonBackendsPowerProfilesSyncPowerProfile* self, const gchar* value);
};

struct _SettingsDaemonBackendsPowerProfilesSyncPrivate {
	GSettings* settings;
	SettingsDaemonBackendsPowerProfilesSyncUPower* upower;
	SettingsDaemonBackendsPowerProfilesSyncPowerProfile* power_profiles_daemon;
};

static gint SettingsDaemonBackendsPowerProfilesSync_private_offset;
static gpointer settings_daemon_backends_power_profiles_sync_parent_class = NULL;

VALA_EXTERN GType settings_daemon_backends_power_profiles_sync_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SettingsDaemonBackendsPowerProfilesSync, g_object_unref)
static GType settings_daemon_backends_power_profiles_sync_upower_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SettingsDaemonBackendsPowerProfilesSyncUPower, g_object_unref)
VALA_EXTERN GType settings_daemon_backends_power_profiles_sync_upower_proxy_get_type (void) G_GNUC_CONST ;
static guint settings_daemon_backends_power_profiles_sync_upower_register_object (void* object,
                                                                           GDBusConnection* connection,
                                                                           const gchar* path,
                                                                           GError** error);
static GType settings_daemon_backends_power_profiles_sync_power_profile_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SettingsDaemonBackendsPowerProfilesSyncPowerProfile, g_object_unref)
VALA_EXTERN GType settings_daemon_backends_power_profiles_sync_power_profile_proxy_get_type (void) G_GNUC_CONST ;
static guint settings_daemon_backends_power_profiles_sync_power_profile_register_object (void* object,
                                                                                  GDBusConnection* connection,
                                                                                  const gchar* path,
                                                                                  GError** error);
static void settings_daemon_backends_power_profiles_sync_on_upower_watch (SettingsDaemonBackendsPowerProfilesSync* self,
                                                                   GDBusConnection* connection);
static void __lambda14_ (SettingsDaemonBackendsPowerProfilesSync* self,
                  GObject* obj,
                  GAsyncResult* res);
static void settings_daemon_backends_power_profiles_sync_update_profile (SettingsDaemonBackendsPowerProfilesSync* self);
static void ___lambda15_ (SettingsDaemonBackendsPowerProfilesSync* self,
                   GVariant* changed_properties);
static void ____lambda15__g_dbus_proxy_g_properties_changed (GDBusProxy* _sender,
                                                      GVariant* changed_properties,
                                                      gchar** invalidated_properties,
                                                      gpointer self);
static void ___lambda14__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void settings_daemon_backends_power_profiles_sync_on_upower_unwatch (SettingsDaemonBackendsPowerProfilesSync* self,
                                                                     GDBusConnection* connection);
static void settings_daemon_backends_power_profiles_sync_on_ppd_watch (SettingsDaemonBackendsPowerProfilesSync* self,
                                                                GDBusConnection* connection);
static void __lambda16_ (SettingsDaemonBackendsPowerProfilesSync* self,
                  GObject* obj,
                  GAsyncResult* res);
static void ___lambda16__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void settings_daemon_backends_power_profiles_sync_on_ppd_unwatch (SettingsDaemonBackendsPowerProfilesSync* self,
                                                                  GDBusConnection* connection);
VALA_EXTERN gboolean settings_daemon_backends_power_profiles_sync_upower_get_on_battery (SettingsDaemonBackendsPowerProfilesSyncUPower* self);
VALA_EXTERN GHashTable** settings_daemon_backends_power_profiles_sync_power_profile_get_profiles (SettingsDaemonBackendsPowerProfilesSyncPowerProfile* self,
                                                                                      gint* result_length1);
VALA_EXTERN void settings_daemon_backends_power_profiles_sync_power_profile_set_active_profile (SettingsDaemonBackendsPowerProfilesSyncPowerProfile* self,
                                                                                    const gchar* value);
VALA_EXTERN SettingsDaemonBackendsPowerProfilesSync* settings_daemon_backends_power_profiles_sync_new (void);
VALA_EXTERN SettingsDaemonBackendsPowerProfilesSync* settings_daemon_backends_power_profiles_sync_construct (GType object_type);
static GType settings_daemon_backends_power_profiles_sync_upower_get_type_once (void);
static void settings_daemon_backends_power_profiles_sync_upower_proxy_g_signal (GDBusProxy* proxy,
                                                                         const gchar* sender_name,
                                                                         const gchar* signal_name,
                                                                         GVariant* parameters);
static gboolean settings_daemon_backends_power_profiles_sync_upower_dbus_proxy_get_on_battery (SettingsDaemonBackendsPowerProfilesSyncUPower* self);
static void settings_daemon_backends_power_profiles_sync_upower_proxy_settings_daemon_backends_power_profiles_sync_upower_interface_init (SettingsDaemonBackendsPowerProfilesSyncUPowerIface* iface);
static void settings_daemon_backends_power_profiles_sync_upower_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* settings_daemon_backends_power_profiles_sync_upower_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 GVariant* _dbus_settings_daemon_backends_power_profiles_sync_upower_get_on_battery (SettingsDaemonBackendsPowerProfilesSyncUPower* self);
static gboolean settings_daemon_backends_power_profiles_sync_upower_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 _settings_daemon_backends_power_profiles_sync_upower_unregister_object (gpointer user_data);
VALA_EXTERN gchar* settings_daemon_backends_power_profiles_sync_power_profile_get_active_profile (SettingsDaemonBackendsPowerProfilesSyncPowerProfile* self);
static GType settings_daemon_backends_power_profiles_sync_power_profile_get_type_once (void);
static void settings_daemon_backends_power_profiles_sync_power_profile_proxy_g_signal (GDBusProxy* proxy,
                                                                                const gchar* sender_name,
                                                                                const gchar* signal_name,
                                                                                GVariant* parameters);
static GHashTable** settings_daemon_backends_power_profiles_sync_power_profile_dbus_proxy_get_profiles (SettingsDaemonBackendsPowerProfilesSyncPowerProfile* self,
                                                                                                 gint* result_length1);
static gchar* settings_daemon_backends_power_profiles_sync_power_profile_dbus_proxy_get_active_profile (SettingsDaemonBackendsPowerProfilesSyncPowerProfile* self);
static void settings_daemon_backends_power_profiles_sync_power_profile_dbus_proxy_set_active_profile (SettingsDaemonBackendsPowerProfilesSyncPowerProfile* self,
                                                                                               const gchar* value);
static void settings_daemon_backends_power_profiles_sync_power_profile_proxy_settings_daemon_backends_power_profiles_sync_power_profile_interface_init (SettingsDaemonBackendsPowerProfilesSyncPowerProfileIface* iface);
static void settings_daemon_backends_power_profiles_sync_power_profile_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* settings_daemon_backends_power_profiles_sync_power_profile_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 GVariant* _dbus_settings_daemon_backends_power_profiles_sync_power_profile_get_profiles (SettingsDaemonBackendsPowerProfilesSyncPowerProfile* self);
static GVariant* _dbus_settings_daemon_backends_power_profiles_sync_power_profile_get_active_profile (SettingsDaemonBackendsPowerProfilesSyncPowerProfile* self);
static gboolean settings_daemon_backends_power_profiles_sync_power_profile_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_settings_daemon_backends_power_profiles_sync_power_profile_set_active_profile (SettingsDaemonBackendsPowerProfilesSyncPowerProfile* self,
                                                                                          GVariant* _value);
static void _settings_daemon_backends_power_profiles_sync_power_profile_unregister_object (gpointer user_data);
static GObject * settings_daemon_backends_power_profiles_sync_constructor (GType type,
                                                                    guint n_construct_properties,
                                                                    GObjectConstructParam * construct_properties);
static void _settings_daemon_backends_power_profiles_sync_on_upower_watch_gbus_name_appeared_callback (GDBusConnection* connection,
                                                                                                const gchar* name,
                                                                                                const gchar* name_owner,
                                                                                                gpointer self);
static void _settings_daemon_backends_power_profiles_sync_on_upower_unwatch_gbus_name_vanished_callback (GDBusConnection* connection,
                                                                                                  const gchar* name,
                                                                                                  gpointer self);
static void _settings_daemon_backends_power_profiles_sync_on_ppd_watch_gbus_name_appeared_callback (GDBusConnection* connection,
                                                                                             const gchar* name,
                                                                                             const gchar* name_owner,
                                                                                             gpointer self);
static void _settings_daemon_backends_power_profiles_sync_on_ppd_unwatch_gbus_name_vanished_callback (GDBusConnection* connection,
                                                                                               const gchar* name,
                                                                                               gpointer self);
static void _settings_daemon_backends_power_profiles_sync_update_profile_g_settings_changed (GSettings* _sender,
                                                                                      const gchar* key,
                                                                                      gpointer self);
static void settings_daemon_backends_power_profiles_sync_finalize (GObject * obj);
static GType settings_daemon_backends_power_profiles_sync_get_type_once (void);
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 inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static const GDBusMethodInfo * const _settings_daemon_backends_power_profiles_sync_upower_dbus_method_info[] = {NULL};
static const GDBusSignalInfo * const _settings_daemon_backends_power_profiles_sync_upower_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo _settings_daemon_backends_power_profiles_sync_upower_dbus_property_info_on_battery = {-1, "OnBattery", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo * const _settings_daemon_backends_power_profiles_sync_upower_dbus_property_info[] = {&_settings_daemon_backends_power_profiles_sync_upower_dbus_property_info_on_battery, NULL};
static const GDBusInterfaceInfo _settings_daemon_backends_power_profiles_sync_upower_dbus_interface_info = {-1, "org.freedesktop.UPower", (GDBusMethodInfo **) (&_settings_daemon_backends_power_profiles_sync_upower_dbus_method_info), (GDBusSignalInfo **) (&_settings_daemon_backends_power_profiles_sync_upower_dbus_signal_info), (GDBusPropertyInfo **) (&_settings_daemon_backends_power_profiles_sync_upower_dbus_property_info), NULL};
static const GDBusInterfaceVTable _settings_daemon_backends_power_profiles_sync_upower_dbus_interface_vtable = {settings_daemon_backends_power_profiles_sync_upower_dbus_interface_method_call, settings_daemon_backends_power_profiles_sync_upower_dbus_interface_get_property, settings_daemon_backends_power_profiles_sync_upower_dbus_interface_set_property};
static const GDBusMethodInfo * const _settings_daemon_backends_power_profiles_sync_power_profile_dbus_method_info[] = {NULL};
static const GDBusSignalInfo * const _settings_daemon_backends_power_profiles_sync_power_profile_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo _settings_daemon_backends_power_profiles_sync_power_profile_dbus_property_info_profiles = {-1, "Profiles", "aa{sv}", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _settings_daemon_backends_power_profiles_sync_power_profile_dbus_property_info_active_profile = {-1, "ActiveProfile", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL};
static const GDBusPropertyInfo * const _settings_daemon_backends_power_profiles_sync_power_profile_dbus_property_info[] = {&_settings_daemon_backends_power_profiles_sync_power_profile_dbus_property_info_profiles, &_settings_daemon_backends_power_profiles_sync_power_profile_dbus_property_info_active_profile, NULL};
static const GDBusInterfaceInfo _settings_daemon_backends_power_profiles_sync_power_profile_dbus_interface_info = {-1, "net.hadess.PowerProfiles", (GDBusMethodInfo **) (&_settings_daemon_backends_power_profiles_sync_power_profile_dbus_method_info), (GDBusSignalInfo **) (&_settings_daemon_backends_power_profiles_sync_power_profile_dbus_signal_info), (GDBusPropertyInfo **) (&_settings_daemon_backends_power_profiles_sync_power_profile_dbus_property_info), NULL};
static const GDBusInterfaceVTable _settings_daemon_backends_power_profiles_sync_power_profile_dbus_interface_vtable = {settings_daemon_backends_power_profiles_sync_power_profile_dbus_interface_method_call, settings_daemon_backends_power_profiles_sync_power_profile_dbus_interface_get_property, settings_daemon_backends_power_profiles_sync_power_profile_dbus_interface_set_property};

static inline gpointer
settings_daemon_backends_power_profiles_sync_get_instance_private (SettingsDaemonBackendsPowerProfilesSync* self)
{
	return G_STRUCT_MEMBER_P (self, SettingsDaemonBackendsPowerProfilesSync_private_offset);
}

static void
___lambda15_ (SettingsDaemonBackendsPowerProfilesSync* self,
              GVariant* changed_properties)
{
	g_return_if_fail (changed_properties != NULL);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				const gchar* property = NULL;
				const gchar* _tmp2_ = NULL;
				const gchar* _tmp3_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				if (!(((gsize) i) < g_variant_n_children (changed_properties))) {
					break;
				}
				g_variant_get_child (changed_properties, (gsize) i, "{&sv}", &_tmp2_, NULL, NULL);
				property = _tmp2_;
				_tmp3_ = property;
				if (g_strcmp0 (_tmp3_, "OnBattery") == 0) {
					settings_daemon_backends_power_profiles_sync_update_profile (self);
					break;
				}
			}
		}
	}
}

static void
____lambda15__g_dbus_proxy_g_properties_changed (GDBusProxy* _sender,
                                                 GVariant* changed_properties,
                                                 gchar** invalidated_properties,
                                                 gpointer self)
{
	___lambda15_ ((SettingsDaemonBackendsPowerProfilesSync*) self, changed_properties);
}

static void
__lambda14_ (SettingsDaemonBackendsPowerProfilesSync* self,
             GObject* obj,
             GAsyncResult* res)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (res != NULL);
	{
		SettingsDaemonBackendsPowerProfilesSyncUPower* _tmp0_ = NULL;
		SettingsDaemonBackendsPowerProfilesSyncUPower* _tmp1_;
		SettingsDaemonBackendsPowerProfilesSyncUPower* _tmp2_;
		SettingsDaemonBackendsPowerProfilesSyncUPower* _tmp3_;
		SettingsDaemonBackendsPowerProfilesSyncUPower* _tmp4_;
		_tmp1_ = g_async_result_get_source_object (res);
		_tmp2_ = (SettingsDaemonBackendsPowerProfilesSyncUPower*) g_async_initable_new_finish ((GAsyncInitable *) _tmp1_, res, &_inner_error0_);
		g_object_unref (_tmp1_);
		_tmp0_ = (SettingsDaemonBackendsPowerProfilesSyncUPower*) _tmp2_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp3_ = _tmp0_;
		_tmp0_ = NULL;
		_g_object_unref0 (self->priv->upower);
		self->priv->upower = _tmp3_;
		g_debug ("PowerProfilesSync.vala:40: Connected to UPower");
		settings_daemon_backends_power_profiles_sync_update_profile (self);
		_tmp4_ = self->priv->upower;
		g_signal_connect_object ((GDBusProxy*) _tmp4_, "g-properties-changed", (GCallback) ____lambda15__g_dbus_proxy_g_properties_changed, self, 0);
		_g_object_unref0 (_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp5_;
		const gchar* _tmp6_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp5_ = e;
		_tmp6_ = _tmp5_->message;
		g_critical ("PowerProfilesSync.vala:55: %s", _tmp6_);
		_g_object_unref0 (self->priv->upower);
		self->priv->upower = NULL;
		_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
___lambda14__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda14_ ((SettingsDaemonBackendsPowerProfilesSync*) self, source_object, res);
	g_object_unref (self);
}

static void
settings_daemon_backends_power_profiles_sync_on_upower_watch (SettingsDaemonBackendsPowerProfilesSync* self,
                                                              GDBusConnection* connection)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (connection != NULL);
	g_async_initable_new_async (SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_TYPE_UPOWER_PROXY, 0, NULL, ___lambda14__gasync_ready_callback, g_object_ref (self), "g-flags", G_DBUS_PROXY_FLAGS_NONE, "g-name", "org.freedesktop.UPower", "g-connection", connection, "g-object-path", "/org/freedesktop/UPower", "g-interface-name", "org.freedesktop.UPower", NULL);
}

static void
settings_daemon_backends_power_profiles_sync_on_upower_unwatch (SettingsDaemonBackendsPowerProfilesSync* self,
                                                                GDBusConnection* connection)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (connection != NULL);
	_g_object_unref0 (self->priv->upower);
	self->priv->upower = NULL;
	g_critical ("PowerProfilesSync.vala:64: Lost connection to UPower");
}

static void
__lambda16_ (SettingsDaemonBackendsPowerProfilesSync* self,
             GObject* obj,
             GAsyncResult* res)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (res != NULL);
	{
		SettingsDaemonBackendsPowerProfilesSyncPowerProfile* _tmp0_ = NULL;
		SettingsDaemonBackendsPowerProfilesSyncPowerProfile* _tmp1_;
		SettingsDaemonBackendsPowerProfilesSyncPowerProfile* _tmp2_;
		SettingsDaemonBackendsPowerProfilesSyncPowerProfile* _tmp3_;
		_tmp1_ = g_async_result_get_source_object (res);
		_tmp2_ = (SettingsDaemonBackendsPowerProfilesSyncPowerProfile*) g_async_initable_new_finish ((GAsyncInitable *) _tmp1_, res, &_inner_error0_);
		g_object_unref (_tmp1_);
		_tmp0_ = (SettingsDaemonBackendsPowerProfilesSyncPowerProfile*) _tmp2_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp3_ = _tmp0_;
		_tmp0_ = NULL;
		_g_object_unref0 (self->priv->power_profiles_daemon);
		self->priv->power_profiles_daemon = _tmp3_;
		g_debug ("PowerProfilesSync.vala:73: Connected to power profiles daemon");
		settings_daemon_backends_power_profiles_sync_update_profile (self);
		_g_object_unref0 (_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp4_;
		const gchar* _tmp5_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp4_ = e;
		_tmp5_ = _tmp4_->message;
		g_critical ("PowerProfilesSync.vala:77: %s", _tmp5_);
		_g_object_unref0 (self->priv->power_profiles_daemon);
		self->priv->power_profiles_daemon = NULL;
		_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
___lambda16__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda16_ ((SettingsDaemonBackendsPowerProfilesSync*) self, source_object, res);
	g_object_unref (self);
}

static void
settings_daemon_backends_power_profiles_sync_on_ppd_watch (SettingsDaemonBackendsPowerProfilesSync* self,
                                                           GDBusConnection* connection)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (connection != NULL);
	g_async_initable_new_async (SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_TYPE_POWER_PROFILE_PROXY, 0, NULL, ___lambda16__gasync_ready_callback, g_object_ref (self), "g-flags", G_DBUS_PROXY_FLAGS_NONE, "g-name", "net.hadess.PowerProfiles", "g-connection", connection, "g-object-path", "/net/hadess/PowerProfiles", "g-interface-name", "net.hadess.PowerProfiles", NULL);
}

static void
settings_daemon_backends_power_profiles_sync_on_ppd_unwatch (SettingsDaemonBackendsPowerProfilesSync* self,
                                                             GDBusConnection* connection)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (connection != NULL);
	_g_object_unref0 (self->priv->power_profiles_daemon);
	self->priv->power_profiles_daemon = NULL;
	g_critical ("PowerProfilesSync.vala:86: Lost connection to power profiles daemon");
}

static void
settings_daemon_backends_power_profiles_sync_update_profile (SettingsDaemonBackendsPowerProfilesSync* self)
{
	gboolean _tmp0_ = FALSE;
	SettingsDaemonBackendsPowerProfilesSyncPowerProfile* _tmp1_;
	const gchar* _tmp3_ = NULL;
	SettingsDaemonBackendsPowerProfilesSyncUPower* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	gchar* profile_to_set = NULL;
	GSettings* _tmp7_;
	gchar* _tmp8_;
	gboolean found_profile = FALSE;
	GHashTable** profiles = NULL;
	SettingsDaemonBackendsPowerProfilesSyncPowerProfile* _tmp9_;
	GHashTable** _tmp10_;
	gint _tmp10__length1;
	gint _tmp11_ = 0;
	GHashTable** _tmp12_;
	gint _tmp12__length1;
	gint profiles_length1;
	gint _profiles_size_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->power_profiles_daemon;
	if (_tmp1_ == NULL) {
		_tmp0_ = TRUE;
	} else {
		SettingsDaemonBackendsPowerProfilesSyncUPower* _tmp2_;
		_tmp2_ = self->priv->upower;
		_tmp0_ = _tmp2_ == NULL;
	}
	if (_tmp0_) {
		return;
	}
	_tmp4_ = self->priv->upower;
	_tmp5_ = settings_daemon_backends_power_profiles_sync_upower_get_on_battery (_tmp4_);
	_tmp6_ = _tmp5_;
	if (_tmp6_) {
		_tmp3_ = SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_PROFILE_ON_BATTERY;
	} else {
		_tmp3_ = SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_PROFILE_PLUGGED_IN;
	}
	_tmp7_ = self->priv->settings;
	_tmp8_ = g_settings_get_string (_tmp7_, _tmp3_);
	profile_to_set = _tmp8_;
	found_profile = FALSE;
	_tmp9_ = self->priv->power_profiles_daemon;
	_tmp10_ = settings_daemon_backends_power_profiles_sync_power_profile_get_profiles (_tmp9_, &_tmp11_);
	_tmp10__length1 = _tmp11_;
	_tmp12_ = _tmp10_;
	_tmp12__length1 = _tmp10__length1;
	profiles = _tmp12_;
	profiles_length1 = _tmp12__length1;
	_profiles_size_ = profiles_length1;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp13_ = FALSE;
			_tmp13_ = TRUE;
			while (TRUE) {
				GHashTable** _tmp15_;
				gint _tmp15__length1;
				GHashTable** _tmp16_;
				gint _tmp16__length1;
				GHashTable* _tmp17_;
				gconstpointer _tmp18_;
				const gchar* _tmp19_;
				const gchar* _tmp20_;
				if (!_tmp13_) {
					gint _tmp14_;
					_tmp14_ = i;
					i = _tmp14_ + 1;
				}
				_tmp13_ = FALSE;
				_tmp15_ = profiles;
				_tmp15__length1 = profiles_length1;
				if (!(i < _tmp15__length1)) {
					break;
				}
				_tmp16_ = profiles;
				_tmp16__length1 = profiles_length1;
				_tmp17_ = _tmp16_[i];
				_tmp18_ = g_hash_table_lookup (_tmp17_, "Profile");
				_tmp19_ = g_variant_get_string ((GVariant*) _tmp18_, NULL);
				_tmp20_ = profile_to_set;
				if (g_strcmp0 (_tmp19_, _tmp20_) == 0) {
					found_profile = TRUE;
					break;
				}
			}
		}
	}
	if (found_profile) {
		SettingsDaemonBackendsPowerProfilesSyncPowerProfile* _tmp21_;
		const gchar* _tmp22_;
		_tmp21_ = self->priv->power_profiles_daemon;
		_tmp22_ = profile_to_set;
		settings_daemon_backends_power_profiles_sync_power_profile_set_active_profile (_tmp21_, _tmp22_);
	} else {
		const gchar* _tmp23_;
		_tmp23_ = profile_to_set;
		g_warning ("PowerProfilesSync.vala:108: Couldn't set power profile to %s", _tmp23_);
	}
	profiles = (_vala_array_free (profiles, profiles_length1, (GDestroyNotify) g_hash_table_unref), NULL);
	_g_free0 (profile_to_set);
}

SettingsDaemonBackendsPowerProfilesSync*
settings_daemon_backends_power_profiles_sync_construct (GType object_type)
{
	SettingsDaemonBackendsPowerProfilesSync * self = NULL;
	self = (SettingsDaemonBackendsPowerProfilesSync*) g_object_new (object_type, NULL);
	return self;
}

SettingsDaemonBackendsPowerProfilesSync*
settings_daemon_backends_power_profiles_sync_new (void)
{
	return settings_daemon_backends_power_profiles_sync_construct (SETTINGS_DAEMON_BACKENDS_TYPE_POWER_PROFILES_SYNC);
}

gboolean
settings_daemon_backends_power_profiles_sync_upower_get_on_battery (SettingsDaemonBackendsPowerProfilesSyncUPower* self)
{
	SettingsDaemonBackendsPowerProfilesSyncUPowerIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_UPOWER_GET_INTERFACE (self);
	if (_iface_->get_on_battery) {
		return _iface_->get_on_battery (self);
	}
	return FALSE;
}

static void
settings_daemon_backends_power_profiles_sync_upower_default_init (SettingsDaemonBackendsPowerProfilesSyncUPowerIface * iface,
                                                                  gpointer iface_data)
{
}

static GType
settings_daemon_backends_power_profiles_sync_upower_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SettingsDaemonBackendsPowerProfilesSyncUPowerIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) settings_daemon_backends_power_profiles_sync_upower_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType settings_daemon_backends_power_profiles_sync_upower_type_id;
	settings_daemon_backends_power_profiles_sync_upower_type_id = g_type_register_static (G_TYPE_INTERFACE, "SettingsDaemonBackendsPowerProfilesSyncUPower", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (settings_daemon_backends_power_profiles_sync_upower_type_id, g_dbus_proxy_get_type ());
	g_type_set_qdata (settings_daemon_backends_power_profiles_sync_upower_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) settings_daemon_backends_power_profiles_sync_upower_proxy_get_type);
	g_type_set_qdata (settings_daemon_backends_power_profiles_sync_upower_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.freedesktop.UPower");
	g_type_set_qdata (settings_daemon_backends_power_profiles_sync_upower_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_settings_daemon_backends_power_profiles_sync_upower_dbus_interface_info));
	g_type_set_qdata (settings_daemon_backends_power_profiles_sync_upower_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) settings_daemon_backends_power_profiles_sync_upower_register_object);
	return settings_daemon_backends_power_profiles_sync_upower_type_id;
}

static GType
settings_daemon_backends_power_profiles_sync_upower_get_type (void)
{
	static volatile gsize settings_daemon_backends_power_profiles_sync_upower_type_id__once = 0;
	if (g_once_init_enter (&settings_daemon_backends_power_profiles_sync_upower_type_id__once)) {
		GType settings_daemon_backends_power_profiles_sync_upower_type_id;
		settings_daemon_backends_power_profiles_sync_upower_type_id = settings_daemon_backends_power_profiles_sync_upower_get_type_once ();
		g_once_init_leave (&settings_daemon_backends_power_profiles_sync_upower_type_id__once, settings_daemon_backends_power_profiles_sync_upower_type_id);
	}
	return settings_daemon_backends_power_profiles_sync_upower_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (SettingsDaemonBackendsPowerProfilesSyncUPowerProxy, settings_daemon_backends_power_profiles_sync_upower_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_TYPE_UPOWER, settings_daemon_backends_power_profiles_sync_upower_proxy_settings_daemon_backends_power_profiles_sync_upower_interface_init) )
static void
settings_daemon_backends_power_profiles_sync_upower_proxy_class_init (SettingsDaemonBackendsPowerProfilesSyncUPowerProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = settings_daemon_backends_power_profiles_sync_upower_proxy_g_signal;
}

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

static void
settings_daemon_backends_power_profiles_sync_upower_proxy_init (SettingsDaemonBackendsPowerProfilesSyncUPowerProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_settings_daemon_backends_power_profiles_sync_upower_dbus_interface_info));
}

static gboolean
settings_daemon_backends_power_profiles_sync_upower_dbus_proxy_get_on_battery (SettingsDaemonBackendsPowerProfilesSyncUPower* self)
{
	GVariant *_inner_reply;
	gboolean _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "OnBattery");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.freedesktop.UPower"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("OnBattery"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			gboolean _tmp0_ = FALSE;
			return _tmp0_;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_boolean (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}

static void
settings_daemon_backends_power_profiles_sync_upower_proxy_settings_daemon_backends_power_profiles_sync_upower_interface_init (SettingsDaemonBackendsPowerProfilesSyncUPowerIface* iface)
{
	iface->get_on_battery = settings_daemon_backends_power_profiles_sync_upower_dbus_proxy_get_on_battery;
}

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

static GVariant*
_dbus_settings_daemon_backends_power_profiles_sync_upower_get_on_battery (SettingsDaemonBackendsPowerProfilesSyncUPower* self)
{
	gboolean result;
	GVariant* _reply;
	result = settings_daemon_backends_power_profiles_sync_upower_get_on_battery (self);
	_reply = g_variant_new_boolean (result);
	return _reply;
}

static GVariant*
settings_daemon_backends_power_profiles_sync_upower_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];
	if (strcmp (property_name, "OnBattery") == 0) {
		return _dbus_settings_daemon_backends_power_profiles_sync_upower_get_on_battery (object);
	}
	return NULL;
}

static gboolean
settings_daemon_backends_power_profiles_sync_upower_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;
}

static guint
settings_daemon_backends_power_profiles_sync_upower_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 *) (&_settings_daemon_backends_power_profiles_sync_upower_dbus_interface_info), &_settings_daemon_backends_power_profiles_sync_upower_dbus_interface_vtable, data, _settings_daemon_backends_power_profiles_sync_upower_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}

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

GHashTable**
settings_daemon_backends_power_profiles_sync_power_profile_get_profiles (SettingsDaemonBackendsPowerProfilesSyncPowerProfile* self,
                                                                         gint* result_length1)
{
	SettingsDaemonBackendsPowerProfilesSyncPowerProfileIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_POWER_PROFILE_GET_INTERFACE (self);
	if (_iface_->get_profiles) {
		return _iface_->get_profiles (self, result_length1);
	}
	return NULL;
}

gchar*
settings_daemon_backends_power_profiles_sync_power_profile_get_active_profile (SettingsDaemonBackendsPowerProfilesSyncPowerProfile* self)
{
	SettingsDaemonBackendsPowerProfilesSyncPowerProfileIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_POWER_PROFILE_GET_INTERFACE (self);
	if (_iface_->get_active_profile) {
		return _iface_->get_active_profile (self);
	}
	return NULL;
}

void
settings_daemon_backends_power_profiles_sync_power_profile_set_active_profile (SettingsDaemonBackendsPowerProfilesSyncPowerProfile* self,
                                                                               const gchar* value)
{
	SettingsDaemonBackendsPowerProfilesSyncPowerProfileIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_POWER_PROFILE_GET_INTERFACE (self);
	if (_iface_->set_active_profile) {
		_iface_->set_active_profile (self, value);
	}
}

static void
settings_daemon_backends_power_profiles_sync_power_profile_default_init (SettingsDaemonBackendsPowerProfilesSyncPowerProfileIface * iface,
                                                                         gpointer iface_data)
{
}

static GType
settings_daemon_backends_power_profiles_sync_power_profile_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SettingsDaemonBackendsPowerProfilesSyncPowerProfileIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) settings_daemon_backends_power_profiles_sync_power_profile_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType settings_daemon_backends_power_profiles_sync_power_profile_type_id;
	settings_daemon_backends_power_profiles_sync_power_profile_type_id = g_type_register_static (G_TYPE_INTERFACE, "SettingsDaemonBackendsPowerProfilesSyncPowerProfile", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (settings_daemon_backends_power_profiles_sync_power_profile_type_id, g_dbus_proxy_get_type ());
	g_type_set_qdata (settings_daemon_backends_power_profiles_sync_power_profile_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) settings_daemon_backends_power_profiles_sync_power_profile_proxy_get_type);
	g_type_set_qdata (settings_daemon_backends_power_profiles_sync_power_profile_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "net.hadess.PowerProfiles");
	g_type_set_qdata (settings_daemon_backends_power_profiles_sync_power_profile_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_settings_daemon_backends_power_profiles_sync_power_profile_dbus_interface_info));
	g_type_set_qdata (settings_daemon_backends_power_profiles_sync_power_profile_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) settings_daemon_backends_power_profiles_sync_power_profile_register_object);
	return settings_daemon_backends_power_profiles_sync_power_profile_type_id;
}

static GType
settings_daemon_backends_power_profiles_sync_power_profile_get_type (void)
{
	static volatile gsize settings_daemon_backends_power_profiles_sync_power_profile_type_id__once = 0;
	if (g_once_init_enter (&settings_daemon_backends_power_profiles_sync_power_profile_type_id__once)) {
		GType settings_daemon_backends_power_profiles_sync_power_profile_type_id;
		settings_daemon_backends_power_profiles_sync_power_profile_type_id = settings_daemon_backends_power_profiles_sync_power_profile_get_type_once ();
		g_once_init_leave (&settings_daemon_backends_power_profiles_sync_power_profile_type_id__once, settings_daemon_backends_power_profiles_sync_power_profile_type_id);
	}
	return settings_daemon_backends_power_profiles_sync_power_profile_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (SettingsDaemonBackendsPowerProfilesSyncPowerProfileProxy, settings_daemon_backends_power_profiles_sync_power_profile_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (SETTINGS_DAEMON_BACKENDS_POWER_PROFILES_SYNC_TYPE_POWER_PROFILE, settings_daemon_backends_power_profiles_sync_power_profile_proxy_settings_daemon_backends_power_profiles_sync_power_profile_interface_init) )
static void
settings_daemon_backends_power_profiles_sync_power_profile_proxy_class_init (SettingsDaemonBackendsPowerProfilesSyncPowerProfileProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = settings_daemon_backends_power_profiles_sync_power_profile_proxy_g_signal;
}

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

static void
settings_daemon_backends_power_profiles_sync_power_profile_proxy_init (SettingsDaemonBackendsPowerProfilesSyncPowerProfileProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_settings_daemon_backends_power_profiles_sync_power_profile_dbus_interface_info));
}

static GHashTable**
settings_daemon_backends_power_profiles_sync_power_profile_dbus_proxy_get_profiles (SettingsDaemonBackendsPowerProfilesSyncPowerProfile* self,
                                                                                    gint* result_length1)
{
	GVariant *_inner_reply;
	GHashTable** _result;
	gint _result_length1;
	GHashTable** _tmp1_;
	gint _tmp1__length;
	gint _tmp1__size;
	gint _tmp1__length1;
	GVariantIter _tmp2_;
	GVariant* _tmp3_;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "Profiles");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("net.hadess.PowerProfiles"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Profiles"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			return NULL;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result_length1 = 0;
	_tmp1_ = g_new (GHashTable*, 5);
	_tmp1__length = 0;
	_tmp1__size = 4;
	_tmp1__length1 = 0;
	g_variant_iter_init (&_tmp2_, _inner_reply);
	for (; (_tmp3_ = g_variant_iter_next_value (&_tmp2_)) != NULL; _tmp1__length1++) {
		GHashTable* _tmp4_;
		GVariantIter _tmp5_;
		GVariant* _tmp6_;
		GVariant* _tmp7_;
		if (_tmp1__size == _tmp1__length) {
			_tmp1__size = 2 * _tmp1__size;
			_tmp1_ = g_renew (GHashTable*, _tmp1_, _tmp1__size + 1);
		}
		_tmp4_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_variant_unref);
		g_variant_iter_init (&_tmp5_, _tmp3_);
		while (g_variant_iter_loop (&_tmp5_, "{?*}", &_tmp6_, &_tmp7_)) {
			g_hash_table_insert (_tmp4_, g_variant_dup_string (_tmp6_, NULL), g_variant_get_variant (_tmp7_));
		}
		_tmp1_[_tmp1__length++] = _tmp4_;
		g_variant_unref (_tmp3_);
	}
	_result_length1 = _tmp1__length1;
	_tmp1_[_tmp1__length] = NULL;
	_result = _tmp1_;
	*result_length1 = _result_length1;
	g_variant_unref (_inner_reply);
	return _result;
}

static gchar*
settings_daemon_backends_power_profiles_sync_power_profile_dbus_proxy_get_active_profile (SettingsDaemonBackendsPowerProfilesSyncPowerProfile* self)
{
	GVariant *_inner_reply;
	gchar* _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "ActiveProfile");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("net.hadess.PowerProfiles"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("ActiveProfile"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			return NULL;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_dup_string (_inner_reply, NULL);
	g_variant_unref (_inner_reply);
	return _result;
}

static void
settings_daemon_backends_power_profiles_sync_power_profile_dbus_proxy_set_active_profile (SettingsDaemonBackendsPowerProfilesSyncPowerProfile* self,
                                                                                          const gchar* value)
{
	GVariant *_arguments;
	GVariant *_reply;
	GVariantBuilder _arguments_builder;
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("net.hadess.PowerProfiles"));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("ActiveProfile"));
	g_variant_builder_open (&_arguments_builder, G_VARIANT_TYPE_VARIANT);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (value));
	g_variant_builder_close (&_arguments_builder);
	_arguments = g_variant_builder_end (&_arguments_builder);
	_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Set", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
	if (!_reply) {
		return;
	}
	g_variant_unref (_reply);
}

static void
settings_daemon_backends_power_profiles_sync_power_profile_proxy_settings_daemon_backends_power_profiles_sync_power_profile_interface_init (SettingsDaemonBackendsPowerProfilesSyncPowerProfileIface* iface)
{
	iface->get_profiles = settings_daemon_backends_power_profiles_sync_power_profile_dbus_proxy_get_profiles;
	iface->get_active_profile = settings_daemon_backends_power_profiles_sync_power_profile_dbus_proxy_get_active_profile;
	iface->set_active_profile = settings_daemon_backends_power_profiles_sync_power_profile_dbus_proxy_set_active_profile;
}

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

static GVariant*
_dbus_settings_daemon_backends_power_profiles_sync_power_profile_get_profiles (SettingsDaemonBackendsPowerProfilesSyncPowerProfile* self)
{
	GHashTable** result;
	gint result_length1 = 0;
	GVariant* _reply;
	GHashTable** _tmp8_;
	GVariantBuilder _tmp9_;
	gint _tmp10_;
	result = settings_daemon_backends_power_profiles_sync_power_profile_get_profiles (self, &result_length1);
	_tmp8_ = result;
	g_variant_builder_init (&_tmp9_, G_VARIANT_TYPE ("aa{sv}"));
	for (_tmp10_ = 0; _tmp10_ < result_length1; _tmp10_++) {
		GVariantBuilder _tmp11_;
		GHashTableIter _tmp12_;
		gpointer _tmp13_;
		gpointer _tmp14_;
		g_hash_table_iter_init (&_tmp12_, *_tmp8_);
		g_variant_builder_init (&_tmp11_, G_VARIANT_TYPE ("a{sv}"));
		while (g_hash_table_iter_next (&_tmp12_, &_tmp13_, &_tmp14_)) {
			gchar* _key;
			GVariant* _value;
			_key = (gchar*) _tmp13_;
			_value = (GVariant*) _tmp14_;
			g_variant_builder_add (&_tmp11_, "{?*}", g_variant_new_string (_key), g_variant_new_variant (_value));
		}
		g_variant_builder_add_value (&_tmp9_, g_variant_builder_end (&_tmp11_));
		_tmp8_++;
	}
	_reply = g_variant_builder_end (&_tmp9_);
	result = (_vala_array_free (result, result_length1, (GDestroyNotify) g_hash_table_unref), NULL);
	return _reply;
}

static GVariant*
_dbus_settings_daemon_backends_power_profiles_sync_power_profile_get_active_profile (SettingsDaemonBackendsPowerProfilesSyncPowerProfile* self)
{
	gchar* result;
	GVariant* _reply;
	result = settings_daemon_backends_power_profiles_sync_power_profile_get_active_profile (self);
	_reply = g_variant_new_string (result);
	_g_free0 (result);
	return _reply;
}

static GVariant*
settings_daemon_backends_power_profiles_sync_power_profile_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];
	if (strcmp (property_name, "Profiles") == 0) {
		return _dbus_settings_daemon_backends_power_profiles_sync_power_profile_get_profiles (object);
	} else if (strcmp (property_name, "ActiveProfile") == 0) {
		return _dbus_settings_daemon_backends_power_profiles_sync_power_profile_get_active_profile (object);
	}
	return NULL;
}

static void
_dbus_settings_daemon_backends_power_profiles_sync_power_profile_set_active_profile (SettingsDaemonBackendsPowerProfilesSyncPowerProfile* self,
                                                                                     GVariant* _value)
{
	gchar* value = NULL;
	value = g_variant_dup_string (_value, NULL);
	settings_daemon_backends_power_profiles_sync_power_profile_set_active_profile (self, value);
	_g_free0 (value);
}

static gboolean
settings_daemon_backends_power_profiles_sync_power_profile_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];
	if (strcmp (property_name, "ActiveProfile") == 0) {
		_dbus_settings_daemon_backends_power_profiles_sync_power_profile_set_active_profile (object, value);
		return TRUE;
	}
	return FALSE;
}

static guint
settings_daemon_backends_power_profiles_sync_power_profile_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 *) (&_settings_daemon_backends_power_profiles_sync_power_profile_dbus_interface_info), &_settings_daemon_backends_power_profiles_sync_power_profile_dbus_interface_vtable, data, _settings_daemon_backends_power_profiles_sync_power_profile_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}

static void
_settings_daemon_backends_power_profiles_sync_power_profile_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
_settings_daemon_backends_power_profiles_sync_on_upower_watch_gbus_name_appeared_callback (GDBusConnection* connection,
                                                                                           const gchar* name,
                                                                                           const gchar* name_owner,
                                                                                           gpointer self)
{
	settings_daemon_backends_power_profiles_sync_on_upower_watch ((SettingsDaemonBackendsPowerProfilesSync*) self, connection);
}

static void
_settings_daemon_backends_power_profiles_sync_on_upower_unwatch_gbus_name_vanished_callback (GDBusConnection* connection,
                                                                                             const gchar* name,
                                                                                             gpointer self)
{
	settings_daemon_backends_power_profiles_sync_on_upower_unwatch ((SettingsDaemonBackendsPowerProfilesSync*) self, connection);
}

static void
_settings_daemon_backends_power_profiles_sync_on_ppd_watch_gbus_name_appeared_callback (GDBusConnection* connection,
                                                                                        const gchar* name,
                                                                                        const gchar* name_owner,
                                                                                        gpointer self)
{
	settings_daemon_backends_power_profiles_sync_on_ppd_watch ((SettingsDaemonBackendsPowerProfilesSync*) self, connection);
}

static void
_settings_daemon_backends_power_profiles_sync_on_ppd_unwatch_gbus_name_vanished_callback (GDBusConnection* connection,
                                                                                          const gchar* name,
                                                                                          gpointer self)
{
	settings_daemon_backends_power_profiles_sync_on_ppd_unwatch ((SettingsDaemonBackendsPowerProfilesSync*) self, connection);
}

static void
_settings_daemon_backends_power_profiles_sync_update_profile_g_settings_changed (GSettings* _sender,
                                                                                 const gchar* key,
                                                                                 gpointer self)
{
	settings_daemon_backends_power_profiles_sync_update_profile ((SettingsDaemonBackendsPowerProfilesSync*) self);
}

static GObject *
settings_daemon_backends_power_profiles_sync_constructor (GType type,
                                                          guint n_construct_properties,
                                                          GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SettingsDaemonBackendsPowerProfilesSync * self;
	GSettings* _tmp0_;
	GSettings* _tmp1_;
	parent_class = G_OBJECT_CLASS (settings_daemon_backends_power_profiles_sync_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SETTINGS_DAEMON_BACKENDS_TYPE_POWER_PROFILES_SYNC, SettingsDaemonBackendsPowerProfilesSync);
	_tmp0_ = g_settings_new ("io.elementary.settings-daemon.power");
	_g_object_unref0 (self->priv->settings);
	self->priv->settings = _tmp0_;
	g_bus_watch_name_with_closures (G_BUS_TYPE_SYSTEM, "org.freedesktop.UPower", G_BUS_NAME_WATCHER_FLAGS_NONE, (GClosure*) ((_settings_daemon_backends_power_profiles_sync_on_upower_watch_gbus_name_appeared_callback == NULL) ? NULL : g_cclosure_new ((GCallback) _settings_daemon_backends_power_profiles_sync_on_upower_watch_gbus_name_appeared_callback, g_object_ref (self), (GClosureNotify) g_object_unref)), (GClosure*) ((_settings_daemon_backends_power_profiles_sync_on_upower_unwatch_gbus_name_vanished_callback == NULL) ? NULL : g_cclosure_new ((GCallback) _settings_daemon_backends_power_profiles_sync_on_upower_unwatch_gbus_name_vanished_callback, g_object_ref (self), (GClosureNotify) g_object_unref)));
	g_bus_watch_name_with_closures (G_BUS_TYPE_SYSTEM, "net.hadess.PowerProfiles", G_BUS_NAME_WATCHER_FLAGS_NONE, (GClosure*) ((_settings_daemon_backends_power_profiles_sync_on_ppd_watch_gbus_name_appeared_callback == NULL) ? NULL : g_cclosure_new ((GCallback) _settings_daemon_backends_power_profiles_sync_on_ppd_watch_gbus_name_appeared_callback, g_object_ref (self), (GClosureNotify) g_object_unref)), (GClosure*) ((_settings_daemon_backends_power_profiles_sync_on_ppd_unwatch_gbus_name_vanished_callback == NULL) ? NULL : g_cclosure_new ((GCallback) _settings_daemon_backends_power_profiles_sync_on_ppd_unwatch_gbus_name_vanished_callback, g_object_ref (self), (GClosureNotify) g_object_unref)));
	_tmp1_ = self->priv->settings;
	g_signal_connect_object (_tmp1_, "changed", (GCallback) _settings_daemon_backends_power_profiles_sync_update_profile_g_settings_changed, self, 0);
	return obj;
}

static void
settings_daemon_backends_power_profiles_sync_class_init (SettingsDaemonBackendsPowerProfilesSyncClass * klass,
                                                         gpointer klass_data)
{
	settings_daemon_backends_power_profiles_sync_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SettingsDaemonBackendsPowerProfilesSync_private_offset);
	G_OBJECT_CLASS (klass)->constructor = settings_daemon_backends_power_profiles_sync_constructor;
	G_OBJECT_CLASS (klass)->finalize = settings_daemon_backends_power_profiles_sync_finalize;
}

static void
settings_daemon_backends_power_profiles_sync_instance_init (SettingsDaemonBackendsPowerProfilesSync * self,
                                                            gpointer klass)
{
	self->priv = settings_daemon_backends_power_profiles_sync_get_instance_private (self);
	self->priv->upower = NULL;
	self->priv->power_profiles_daemon = NULL;
}

static void
settings_daemon_backends_power_profiles_sync_finalize (GObject * obj)
{
	SettingsDaemonBackendsPowerProfilesSync * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SETTINGS_DAEMON_BACKENDS_TYPE_POWER_PROFILES_SYNC, SettingsDaemonBackendsPowerProfilesSync);
	_g_object_unref0 (self->priv->settings);
	_g_object_unref0 (self->priv->upower);
	_g_object_unref0 (self->priv->power_profiles_daemon);
	G_OBJECT_CLASS (settings_daemon_backends_power_profiles_sync_parent_class)->finalize (obj);
}

static GType
settings_daemon_backends_power_profiles_sync_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SettingsDaemonBackendsPowerProfilesSyncClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) settings_daemon_backends_power_profiles_sync_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SettingsDaemonBackendsPowerProfilesSync), 0, (GInstanceInitFunc) settings_daemon_backends_power_profiles_sync_instance_init, NULL };
	GType settings_daemon_backends_power_profiles_sync_type_id;
	settings_daemon_backends_power_profiles_sync_type_id = g_type_register_static (G_TYPE_OBJECT, "SettingsDaemonBackendsPowerProfilesSync", &g_define_type_info, 0);
	SettingsDaemonBackendsPowerProfilesSync_private_offset = g_type_add_instance_private (settings_daemon_backends_power_profiles_sync_type_id, sizeof (SettingsDaemonBackendsPowerProfilesSyncPrivate));
	return settings_daemon_backends_power_profiles_sync_type_id;
}

GType
settings_daemon_backends_power_profiles_sync_get_type (void)
{
	static volatile gsize settings_daemon_backends_power_profiles_sync_type_id__once = 0;
	if (g_once_init_enter (&settings_daemon_backends_power_profiles_sync_type_id__once)) {
		GType settings_daemon_backends_power_profiles_sync_type_id;
		settings_daemon_backends_power_profiles_sync_type_id = settings_daemon_backends_power_profiles_sync_get_type_once ();
		g_once_init_leave (&settings_daemon_backends_power_profiles_sync_type_id__once, settings_daemon_backends_power_profiles_sync_type_id);
	}
	return settings_daemon_backends_power_profiles_sync_type_id__once;
}

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);
}

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;
}

