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

/*
 * Copyright (c) 2011-2018 elementary LLC. (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 2 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */

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

enum  {
	POWER_SERVICES_DBUS_INTERFACES_PROPERTIES_PROPERTIES_CHANGED_SIGNAL,
	POWER_SERVICES_DBUS_INTERFACES_PROPERTIES_NUM_SIGNALS
};
static guint power_services_dbus_interfaces_properties_signals[POWER_SERVICES_DBUS_INTERFACES_PROPERTIES_NUM_SIGNALS] = {0};
typedef GDBusProxy PowerServicesDBusInterfacesPropertiesProxy;
typedef GDBusProxyClass PowerServicesDBusInterfacesPropertiesProxyClass;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))

static void g_cclosure_user_marshal_VOID__STRING_BOXED_BOXED_INT (GClosure * closure,
                                                           GValue * return_value,
                                                           guint n_param_values,
                                                           const GValue * param_values,
                                                           gpointer invocation_hint,
                                                           gpointer marshal_data);
static GType power_services_dbus_interfaces_properties_get_type_once (void);
static void power_services_dbus_interfaces_properties_proxy_g_signal (GDBusProxy* proxy,
                                                               const gchar* sender_name,
                                                               const gchar* signal_name,
                                                               GVariant* parameters);
static void _dbus_handle_power_services_dbus_interfaces_properties_properties_changed (PowerServicesDBusInterfacesProperties* self,
                                                                                GVariant* parameters);
static GVariant* power_services_dbus_interfaces_properties_proxy_get (PowerServicesDBusInterfacesProperties* self,
                                                               const gchar* interface,
                                                               const gchar* propname,
                                                               GError** error);
static void power_services_dbus_interfaces_properties_proxy_set (PowerServicesDBusInterfacesProperties* self,
                                                          const gchar* interface,
                                                          const gchar* propname,
                                                          GVariant* value,
                                                          GError** error);
static void power_services_dbus_interfaces_properties_proxy_power_services_dbus_interfaces_properties_interface_init (PowerServicesDBusInterfacesPropertiesIface* iface);
static void _dbus_power_services_dbus_interfaces_properties_get (PowerServicesDBusInterfacesProperties* self,
                                                          GVariant* _parameters_,
                                                          GDBusMethodInvocation* invocation);
static void _dbus_power_services_dbus_interfaces_properties_set (PowerServicesDBusInterfacesProperties* self,
                                                          GVariant* _parameters_,
                                                          GDBusMethodInvocation* invocation);
static void power_services_dbus_interfaces_properties_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* power_services_dbus_interfaces_properties_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 power_services_dbus_interfaces_properties_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_power_services_dbus_interfaces_properties_properties_changed (GObject* _sender,
                                                                         const gchar* changed,
                                                                         GHashTable* propertiesm,
                                                                         gchar** array,
                                                                         gint array_length1,
                                                                         gpointer* _data);
static void _power_services_dbus_interfaces_properties_unregister_object (gpointer user_data);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static const GDBusArgInfo _power_services_dbus_interfaces_properties_dbus_arg_info_get_interface = {-1, "interface", "s", NULL};
static const GDBusArgInfo _power_services_dbus_interfaces_properties_dbus_arg_info_get_propname = {-1, "propname", "s", NULL};
static const GDBusArgInfo _power_services_dbus_interfaces_properties_dbus_arg_info_get_result = {-1, "result", "v", NULL};
static const GDBusArgInfo * const _power_services_dbus_interfaces_properties_dbus_arg_info_get_in[] = {&_power_services_dbus_interfaces_properties_dbus_arg_info_get_interface, &_power_services_dbus_interfaces_properties_dbus_arg_info_get_propname, NULL};
static const GDBusArgInfo * const _power_services_dbus_interfaces_properties_dbus_arg_info_get_out[] = {&_power_services_dbus_interfaces_properties_dbus_arg_info_get_result, NULL};
static const GDBusMethodInfo _power_services_dbus_interfaces_properties_dbus_method_info_get = {-1, "Get", (GDBusArgInfo **) (&_power_services_dbus_interfaces_properties_dbus_arg_info_get_in), (GDBusArgInfo **) (&_power_services_dbus_interfaces_properties_dbus_arg_info_get_out), NULL};
static const GDBusArgInfo _power_services_dbus_interfaces_properties_dbus_arg_info_set_interface = {-1, "interface", "s", NULL};
static const GDBusArgInfo _power_services_dbus_interfaces_properties_dbus_arg_info_set_propname = {-1, "propname", "s", NULL};
static const GDBusArgInfo _power_services_dbus_interfaces_properties_dbus_arg_info_set_value = {-1, "value", "v", NULL};
static const GDBusArgInfo * const _power_services_dbus_interfaces_properties_dbus_arg_info_set_in[] = {&_power_services_dbus_interfaces_properties_dbus_arg_info_set_interface, &_power_services_dbus_interfaces_properties_dbus_arg_info_set_propname, &_power_services_dbus_interfaces_properties_dbus_arg_info_set_value, NULL};
static const GDBusArgInfo * const _power_services_dbus_interfaces_properties_dbus_arg_info_set_out[] = {NULL};
static const GDBusMethodInfo _power_services_dbus_interfaces_properties_dbus_method_info_set = {-1, "Set", (GDBusArgInfo **) (&_power_services_dbus_interfaces_properties_dbus_arg_info_set_in), (GDBusArgInfo **) (&_power_services_dbus_interfaces_properties_dbus_arg_info_set_out), NULL};
static const GDBusMethodInfo * const _power_services_dbus_interfaces_properties_dbus_method_info[] = {&_power_services_dbus_interfaces_properties_dbus_method_info_get, &_power_services_dbus_interfaces_properties_dbus_method_info_set, NULL};
static const GDBusArgInfo _power_services_dbus_interfaces_properties_dbus_arg_info_properties_changed_changed = {-1, "changed", "s", NULL};
static const GDBusArgInfo _power_services_dbus_interfaces_properties_dbus_arg_info_properties_changed_propertiesm = {-1, "propertiesm", "a{sv}", NULL};
static const GDBusArgInfo _power_services_dbus_interfaces_properties_dbus_arg_info_properties_changed_array = {-1, "array", "as", NULL};
static const GDBusArgInfo * const _power_services_dbus_interfaces_properties_dbus_arg_info_properties_changed[] = {&_power_services_dbus_interfaces_properties_dbus_arg_info_properties_changed_changed, &_power_services_dbus_interfaces_properties_dbus_arg_info_properties_changed_propertiesm, &_power_services_dbus_interfaces_properties_dbus_arg_info_properties_changed_array, NULL};
static const GDBusSignalInfo _power_services_dbus_interfaces_properties_dbus_signal_info_properties_changed = {-1, "PropertiesChanged", (GDBusArgInfo **) (&_power_services_dbus_interfaces_properties_dbus_arg_info_properties_changed), NULL};
static const GDBusSignalInfo * const _power_services_dbus_interfaces_properties_dbus_signal_info[] = {&_power_services_dbus_interfaces_properties_dbus_signal_info_properties_changed, NULL};
static const GDBusPropertyInfo * const _power_services_dbus_interfaces_properties_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _power_services_dbus_interfaces_properties_dbus_interface_info = {-1, "org.freedesktop.DBus.Properties", (GDBusMethodInfo **) (&_power_services_dbus_interfaces_properties_dbus_method_info), (GDBusSignalInfo **) (&_power_services_dbus_interfaces_properties_dbus_signal_info), (GDBusPropertyInfo **) (&_power_services_dbus_interfaces_properties_dbus_property_info), NULL};
static const GDBusInterfaceVTable _power_services_dbus_interfaces_properties_dbus_interface_vtable = {power_services_dbus_interfaces_properties_dbus_interface_method_call, power_services_dbus_interfaces_properties_dbus_interface_get_property, power_services_dbus_interfaces_properties_dbus_interface_set_property};

GVariant*
power_services_dbus_interfaces_properties_get (PowerServicesDBusInterfacesProperties* self,
                                               const gchar* interface,
                                               const gchar* propname,
                                               GError** error)
{
	PowerServicesDBusInterfacesPropertiesIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = POWER_SERVICES_DBUS_INTERFACES_PROPERTIES_GET_INTERFACE (self);
	if (_iface_->get) {
		return _iface_->get (self, interface, propname, error);
	}
	return NULL;
}

void
power_services_dbus_interfaces_properties_set (PowerServicesDBusInterfacesProperties* self,
                                               const gchar* interface,
                                               const gchar* propname,
                                               GVariant* value,
                                               GError** error)
{
	PowerServicesDBusInterfacesPropertiesIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = POWER_SERVICES_DBUS_INTERFACES_PROPERTIES_GET_INTERFACE (self);
	if (_iface_->set) {
		_iface_->set (self, interface, propname, value, error);
	}
}

static void
g_cclosure_user_marshal_VOID__STRING_BOXED_BOXED_INT (GClosure * closure,
                                                      GValue * return_value,
                                                      guint n_param_values,
                                                      const GValue * param_values,
                                                      gpointer invocation_hint,
                                                      gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__STRING_BOXED_BOXED_INT) (gpointer data1, const char* arg_1, gpointer arg_2, gpointer arg_3, gint arg_4, gpointer data2);
	register GMarshalFunc_VOID__STRING_BOXED_BOXED_INT callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 5);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__STRING_BOXED_BOXED_INT) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_string (param_values + 1), g_value_get_boxed (param_values + 2), g_value_get_boxed (param_values + 3), g_value_get_int (param_values + 4), data2);
}

static void
power_services_dbus_interfaces_properties_default_init (PowerServicesDBusInterfacesPropertiesIface * iface,
                                                        gpointer iface_data)
{
	power_services_dbus_interfaces_properties_signals[POWER_SERVICES_DBUS_INTERFACES_PROPERTIES_PROPERTIES_CHANGED_SIGNAL] = g_signal_new ("properties-changed", POWER_SERVICES_DBUS_INTERFACES_TYPE_PROPERTIES, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_BOXED_BOXED_INT, G_TYPE_NONE, 4, G_TYPE_STRING, G_TYPE_HASH_TABLE, G_TYPE_STRV, G_TYPE_INT);
}

static GType
power_services_dbus_interfaces_properties_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PowerServicesDBusInterfacesPropertiesIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) power_services_dbus_interfaces_properties_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType power_services_dbus_interfaces_properties_type_id;
	power_services_dbus_interfaces_properties_type_id = g_type_register_static (G_TYPE_INTERFACE, "PowerServicesDBusInterfacesProperties", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (power_services_dbus_interfaces_properties_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (power_services_dbus_interfaces_properties_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) power_services_dbus_interfaces_properties_proxy_get_type);
	g_type_set_qdata (power_services_dbus_interfaces_properties_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.freedesktop.DBus.Properties");
	g_type_set_qdata (power_services_dbus_interfaces_properties_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_power_services_dbus_interfaces_properties_dbus_interface_info));
	g_type_set_qdata (power_services_dbus_interfaces_properties_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) power_services_dbus_interfaces_properties_register_object);
	return power_services_dbus_interfaces_properties_type_id;
}

GType
power_services_dbus_interfaces_properties_get_type (void)
{
	static volatile gsize power_services_dbus_interfaces_properties_type_id__once = 0;
	if (g_once_init_enter (&power_services_dbus_interfaces_properties_type_id__once)) {
		GType power_services_dbus_interfaces_properties_type_id;
		power_services_dbus_interfaces_properties_type_id = power_services_dbus_interfaces_properties_get_type_once ();
		g_once_init_leave (&power_services_dbus_interfaces_properties_type_id__once, power_services_dbus_interfaces_properties_type_id);
	}
	return power_services_dbus_interfaces_properties_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (PowerServicesDBusInterfacesPropertiesProxy, power_services_dbus_interfaces_properties_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (POWER_SERVICES_DBUS_INTERFACES_TYPE_PROPERTIES, power_services_dbus_interfaces_properties_proxy_power_services_dbus_interfaces_properties_interface_init) )
static void
power_services_dbus_interfaces_properties_proxy_class_init (PowerServicesDBusInterfacesPropertiesProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = power_services_dbus_interfaces_properties_proxy_g_signal;
}

static void
_dbus_handle_power_services_dbus_interfaces_properties_properties_changed (PowerServicesDBusInterfacesProperties* self,
                                                                           GVariant* parameters)
{
	GVariantIter _arguments_iter;
	gchar* changed = NULL;
	GVariant* _tmp52_;
	GHashTable* propertiesm = NULL;
	GVariant* _tmp53_;
	GHashTable* _tmp54_;
	GVariantIter _tmp55_;
	GVariant* _tmp56_;
	GVariant* _tmp57_;
	gchar** array = NULL;
	gint array_length1;
	GVariant* _tmp58_;
	gchar** _tmp59_;
	gint _tmp59__length;
	gint _tmp59__size;
	gint _tmp59__length1;
	GVariantIter _tmp60_;
	GVariant* _tmp61_;
	g_variant_iter_init (&_arguments_iter, parameters);
	_tmp52_ = g_variant_iter_next_value (&_arguments_iter);
	changed = g_variant_dup_string (_tmp52_, NULL);
	g_variant_unref (_tmp52_);
	_tmp53_ = g_variant_iter_next_value (&_arguments_iter);
	_tmp54_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_variant_unref);
	g_variant_iter_init (&_tmp55_, _tmp53_);
	while (g_variant_iter_loop (&_tmp55_, "{?*}", &_tmp56_, &_tmp57_)) {
		g_hash_table_insert (_tmp54_, g_variant_dup_string (_tmp56_, NULL), g_variant_get_variant (_tmp57_));
	}
	propertiesm = _tmp54_;
	g_variant_unref (_tmp53_);
	array_length1 = 0;
	_tmp58_ = g_variant_iter_next_value (&_arguments_iter);
	_tmp59_ = g_new (gchar*, 5);
	_tmp59__length = 0;
	_tmp59__size = 4;
	_tmp59__length1 = 0;
	g_variant_iter_init (&_tmp60_, _tmp58_);
	for (; (_tmp61_ = g_variant_iter_next_value (&_tmp60_)) != NULL; _tmp59__length1++) {
		if (_tmp59__size == _tmp59__length) {
			_tmp59__size = 2 * _tmp59__size;
			_tmp59_ = g_renew (gchar*, _tmp59_, _tmp59__size + 1);
		}
		_tmp59_[_tmp59__length++] = g_variant_dup_string (_tmp61_, NULL);
		g_variant_unref (_tmp61_);
	}
	array_length1 = _tmp59__length1;
	_tmp59_[_tmp59__length] = NULL;
	array = _tmp59_;
	g_variant_unref (_tmp58_);
	g_signal_emit_by_name (self, "properties-changed", changed, propertiesm, array, array_length1);
	_g_free0 (changed);
	_g_hash_table_unref0 (propertiesm);
	array = (_vala_array_free (array, array_length1, (GDestroyNotify) g_free), NULL);
}

static void
power_services_dbus_interfaces_properties_proxy_g_signal (GDBusProxy* proxy,
                                                          const gchar* sender_name,
                                                          const gchar* signal_name,
                                                          GVariant* parameters)
{
	if (strcmp (signal_name, "PropertiesChanged") == 0) {
		_dbus_handle_power_services_dbus_interfaces_properties_properties_changed ((PowerServicesDBusInterfacesProperties*) proxy, parameters);
	}
}

static void
power_services_dbus_interfaces_properties_proxy_init (PowerServicesDBusInterfacesPropertiesProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_power_services_dbus_interfaces_properties_dbus_interface_info));
}

static GVariant*
power_services_dbus_interfaces_properties_proxy_get (PowerServicesDBusInterfacesProperties* self,
                                                     const gchar* interface,
                                                     const gchar* propname,
                                                     GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	GVariant* _result = NULL;
	GVariant* _tmp62_;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.freedesktop.DBus.Properties", "Get");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (interface));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (propname));
	_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);
	_tmp62_ = g_variant_iter_next_value (&_reply_iter);
	_result = g_variant_get_variant (_tmp62_);
	g_variant_unref (_tmp62_);
	g_object_unref (_reply_message);
	return _result;
}

static void
power_services_dbus_interfaces_properties_proxy_set (PowerServicesDBusInterfacesProperties* self,
                                                     const gchar* interface,
                                                     const gchar* propname,
                                                     GVariant* value,
                                                     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.DBus.Properties", "Set");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (interface));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (propname));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_variant (value));
	_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
power_services_dbus_interfaces_properties_proxy_power_services_dbus_interfaces_properties_interface_init (PowerServicesDBusInterfacesPropertiesIface* iface)
{
	iface->get = power_services_dbus_interfaces_properties_proxy_get;
	iface->set = power_services_dbus_interfaces_properties_proxy_set;
}

static void
_dbus_power_services_dbus_interfaces_properties_get (PowerServicesDBusInterfacesProperties* self,
                                                     GVariant* _parameters_,
                                                     GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gchar* interface = NULL;
	GVariant* _tmp63_;
	gchar* propname = NULL;
	GVariant* _tmp64_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	GVariant* result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp63_ = g_variant_iter_next_value (&_arguments_iter);
	interface = g_variant_dup_string (_tmp63_, NULL);
	g_variant_unref (_tmp63_);
	_tmp64_ = g_variant_iter_next_value (&_arguments_iter);
	propname = g_variant_dup_string (_tmp64_, NULL);
	g_variant_unref (_tmp64_);
	result = power_services_dbus_interfaces_properties_get (self, interface, propname, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_variant (result));
	_g_variant_unref0 (result);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	_g_free0 (interface);
	_g_free0 (propname);
	;
}

static void
_dbus_power_services_dbus_interfaces_properties_set (PowerServicesDBusInterfacesProperties* self,
                                                     GVariant* _parameters_,
                                                     GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gchar* interface = NULL;
	GVariant* _tmp65_;
	gchar* propname = NULL;
	GVariant* _tmp66_;
	GVariant* value = NULL;
	GVariant* _tmp67_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp65_ = g_variant_iter_next_value (&_arguments_iter);
	interface = g_variant_dup_string (_tmp65_, NULL);
	g_variant_unref (_tmp65_);
	_tmp66_ = g_variant_iter_next_value (&_arguments_iter);
	propname = g_variant_dup_string (_tmp66_, NULL);
	g_variant_unref (_tmp66_);
	_tmp67_ = g_variant_iter_next_value (&_arguments_iter);
	value = g_variant_get_variant (_tmp67_);
	g_variant_unref (_tmp67_);
	power_services_dbus_interfaces_properties_set (self, interface, propname, value, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	_g_free0 (interface);
	_g_free0 (propname);
	_g_variant_unref0 (value);
	;
}

static void
power_services_dbus_interfaces_properties_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, "Get") == 0) {
		_dbus_power_services_dbus_interfaces_properties_get (object, parameters, invocation);
	} else if (strcmp (method_name, "Set") == 0) {
		_dbus_power_services_dbus_interfaces_properties_set (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
power_services_dbus_interfaces_properties_dbus_interface_get_property (GDBusConnection* connection,
                                                                       const gchar* sender,
                                                                       const gchar* object_path,
                                                                       const gchar* interface_name,
                                                                       const gchar* property_name,
                                                                       GError** error,
                                                                       gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	return NULL;
}

static gboolean
power_services_dbus_interfaces_properties_dbus_interface_set_property (GDBusConnection* connection,
                                                                       const gchar* sender,
                                                                       const gchar* object_path,
                                                                       const gchar* interface_name,
                                                                       const gchar* property_name,
                                                                       GVariant* value,
                                                                       GError** error,
                                                                       gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	return FALSE;
}

static void
_dbus_power_services_dbus_interfaces_properties_properties_changed (GObject* _sender,
                                                                    const gchar* changed,
                                                                    GHashTable* propertiesm,
                                                                    gchar** array,
                                                                    gint array_length1,
                                                                    gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GVariantBuilder _tmp68_;
	GHashTableIter _tmp69_;
	gpointer _tmp70_;
	gpointer _tmp71_;
	gchar** _tmp72_;
	GVariantBuilder _tmp73_;
	gint _tmp74_;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (changed));
	g_hash_table_iter_init (&_tmp69_, propertiesm);
	g_variant_builder_init (&_tmp68_, G_VARIANT_TYPE ("a{sv}"));
	while (g_hash_table_iter_next (&_tmp69_, &_tmp70_, &_tmp71_)) {
		gchar* _key;
		GVariant* _value;
		_key = (gchar*) _tmp70_;
		_value = (GVariant*) _tmp71_;
		g_variant_builder_add (&_tmp68_, "{?*}", g_variant_new_string (_key), g_variant_new_variant (_value));
	}
	g_variant_builder_add_value (&_arguments_builder, g_variant_builder_end (&_tmp68_));
	_tmp72_ = array;
	g_variant_builder_init (&_tmp73_, G_VARIANT_TYPE ("as"));
	for (_tmp74_ = 0; _tmp74_ < array_length1; _tmp74_++) {
		g_variant_builder_add_value (&_tmp73_, g_variant_new_string (*_tmp72_));
		_tmp72_++;
	}
	g_variant_builder_add_value (&_arguments_builder, g_variant_builder_end (&_tmp73_));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.freedesktop.DBus.Properties", "PropertiesChanged", _arguments, NULL);
}

guint
power_services_dbus_interfaces_properties_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 *) (&_power_services_dbus_interfaces_properties_dbus_interface_info), &_power_services_dbus_interfaces_properties_dbus_interface_vtable, data, _power_services_dbus_interfaces_properties_unregister_object, error);
	if (!result) {
		return 0;
	}
	g_signal_connect (object, "properties-changed", (GCallback) _dbus_power_services_dbus_interfaces_properties_properties_changed, data);
	return result;
}

static void
_power_services_dbus_interfaces_properties_unregister_object (gpointer user_data)
{
	gpointer* data;
	data = user_data;
	g_signal_handlers_disconnect_by_func (data[0], _dbus_power_services_dbus_interfaces_properties_properties_changed, data);
	g_object_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}

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

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

