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

/*
 * Copyright (C) 2012 Collabora Ltd.
 *
 * This library is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 2.1 of the License, or
 * (at your option) any later version.
 *
 * This library 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 Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Authors:
 *          Jeremy Whiting <jeremy.whiting@collabora.co.uk>
 */

#include "ofono.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

#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)))
enum  {
	ORG_OFONO_MANAGER_MODEM_ADDED_SIGNAL,
	ORG_OFONO_MANAGER_MODEM_REMOVED_SIGNAL,
	ORG_OFONO_MANAGER_NUM_SIGNALS
};
static guint org_ofono_manager_signals[ORG_OFONO_MANAGER_NUM_SIGNALS] = {0};
typedef GDBusProxy orgofonoManagerProxy;
typedef GDBusProxyClass orgofonoManagerProxyClass;
typedef GDBusProxy orgofonoPhonebookProxy;
typedef GDBusProxyClass orgofonoPhonebookProxyClass;
enum  {
	ORG_OFONO_SIM_MANAGER_PROPERTY_CHANGED_SIGNAL,
	ORG_OFONO_SIM_MANAGER_NUM_SIGNALS
};
static guint org_ofono_sim_manager_signals[ORG_OFONO_SIM_MANAGER_NUM_SIGNALS] = {0};
typedef GDBusProxy orgofonoSimManagerProxy;
typedef GDBusProxyClass orgofonoSimManagerProxyClass;
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))

static void g_cclosure_user_marshal_VOID__STRING_BOXED (GClosure * closure,
                                                 GValue * return_value,
                                                 guint n_param_values,
                                                 const GValue * param_values,
                                                 gpointer invocation_hint,
                                                 gpointer marshal_data);
static GType org_ofono_manager_get_type_once (void);
static void org_ofono_manager_proxy_g_signal (GDBusProxy* proxy,
                                       const gchar* sender_name,
                                       const gchar* signal_name,
                                       GVariant* parameters);
static void _dbus_handle_org_ofono_manager_modem_added (orgofonoManager* self,
                                                 GVariant* parameters);
static void _dbus_handle_org_ofono_manager_modem_removed (orgofonoManager* self,
                                                   GVariant* parameters);
static orgofonoModemProperties* org_ofono_manager_proxy_GetModems (orgofonoManager* self,
                                                            gint* result_length1,
                                                            GError** error);
static void org_ofono_manager_proxy_org_ofono_manager_interface_init (orgofonoManagerIface* iface);
static void _vala_orgofonoModemProperties_array_free (orgofonoModemProperties * array,
                                               gssize array_length);
static void _dbus_org_ofono_manager_GetModems (orgofonoManager* self,
                                        GVariant* _parameters_,
                                        GDBusMethodInvocation* invocation);
static void org_ofono_manager_dbus_interface_method_call (GDBusConnection* connection,
                                                   const gchar* sender,
                                                   const gchar* object_path,
                                                   const gchar* interface_name,
                                                   const gchar* method_name,
                                                   GVariant* parameters,
                                                   GDBusMethodInvocation* invocation,
                                                   gpointer user_data);
static GVariant* org_ofono_manager_dbus_interface_get_property (GDBusConnection* connection,
                                                         const gchar* sender,
                                                         const gchar* object_path,
                                                         const gchar* interface_name,
                                                         const gchar* property_name,
                                                         GError** error,
                                                         gpointer user_data);
static gboolean org_ofono_manager_dbus_interface_set_property (GDBusConnection* connection,
                                                        const gchar* sender,
                                                        const gchar* object_path,
                                                        const gchar* interface_name,
                                                        const gchar* property_name,
                                                        GVariant* value,
                                                        GError** error,
                                                        gpointer user_data);
static void _dbus_org_ofono_manager_modem_added (GObject* _sender,
                                          const char* path,
                                          GHashTable* properties,
                                          gpointer* _data);
static void _dbus_org_ofono_manager_modem_removed (GObject* _sender,
                                            const char* path,
                                            gpointer* _data);
static void _org_ofono_manager_unregister_object (gpointer user_data);
static GType org_ofono_phonebook_get_type_once (void);
static void org_ofono_phonebook_proxy_g_signal (GDBusProxy* proxy,
                                         const gchar* sender_name,
                                         const gchar* signal_name,
                                         GVariant* parameters);
static gchar* org_ofono_phonebook_proxy_Import (orgofonoPhonebook* self,
                                         GError** error);
static void org_ofono_phonebook_proxy_org_ofono_phonebook_interface_init (orgofonoPhonebookIface* iface);
static void _dbus_org_ofono_phonebook_Import (orgofonoPhonebook* self,
                                       GVariant* _parameters_,
                                       GDBusMethodInvocation* invocation);
static void org_ofono_phonebook_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* org_ofono_phonebook_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 org_ofono_phonebook_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 _org_ofono_phonebook_unregister_object (gpointer user_data);
static void g_cclosure_user_marshal_VOID__STRING_VARIANT (GClosure * closure,
                                                   GValue * return_value,
                                                   guint n_param_values,
                                                   const GValue * param_values,
                                                   gpointer invocation_hint,
                                                   gpointer marshal_data);
static GType org_ofono_sim_manager_get_type_once (void);
static void org_ofono_sim_manager_proxy_g_signal (GDBusProxy* proxy,
                                           const gchar* sender_name,
                                           const gchar* signal_name,
                                           GVariant* parameters);
static void _dbus_handle_org_ofono_sim_manager_property_changed (orgofonoSimManager* self,
                                                          GVariant* parameters);
static GHashTable* org_ofono_sim_manager_proxy_GetProperties (orgofonoSimManager* self,
                                                       GError** error);
static void org_ofono_sim_manager_proxy_org_ofono_sim_manager_interface_init (orgofonoSimManagerIface* iface);
static void _dbus_org_ofono_sim_manager_GetProperties (orgofonoSimManager* self,
                                                GVariant* _parameters_,
                                                GDBusMethodInvocation* invocation);
static void org_ofono_sim_manager_dbus_interface_method_call (GDBusConnection* connection,
                                                       const gchar* sender,
                                                       const gchar* object_path,
                                                       const gchar* interface_name,
                                                       const gchar* method_name,
                                                       GVariant* parameters,
                                                       GDBusMethodInvocation* invocation,
                                                       gpointer user_data);
static GVariant* org_ofono_sim_manager_dbus_interface_get_property (GDBusConnection* connection,
                                                             const gchar* sender,
                                                             const gchar* object_path,
                                                             const gchar* interface_name,
                                                             const gchar* property_name,
                                                             GError** error,
                                                             gpointer user_data);
static gboolean org_ofono_sim_manager_dbus_interface_set_property (GDBusConnection* connection,
                                                            const gchar* sender,
                                                            const gchar* object_path,
                                                            const gchar* interface_name,
                                                            const gchar* property_name,
                                                            GVariant* value,
                                                            GError** error,
                                                            gpointer user_data);
static void _dbus_org_ofono_sim_manager_property_changed (GObject* _sender,
                                                   const gchar* property,
                                                   GVariant* value,
                                                   gpointer* _data);
static void _org_ofono_sim_manager_unregister_object (gpointer user_data);

static const GDBusArgInfo _org_ofono_manager_dbus_arg_info_GetModems_result = {-1, "result", "a(oa{sv})", NULL};
static const GDBusArgInfo * const _org_ofono_manager_dbus_arg_info_GetModems_in[] = {NULL};
static const GDBusArgInfo * const _org_ofono_manager_dbus_arg_info_GetModems_out[] = {&_org_ofono_manager_dbus_arg_info_GetModems_result, NULL};
static const GDBusMethodInfo _org_ofono_manager_dbus_method_info_GetModems = {-1, "GetModems", (GDBusArgInfo **) (&_org_ofono_manager_dbus_arg_info_GetModems_in), (GDBusArgInfo **) (&_org_ofono_manager_dbus_arg_info_GetModems_out), NULL};
static const GDBusMethodInfo * const _org_ofono_manager_dbus_method_info[] = {&_org_ofono_manager_dbus_method_info_GetModems, NULL};
static const GDBusArgInfo _org_ofono_manager_dbus_arg_info_modem_added_path = {-1, "path", "o", NULL};
static const GDBusArgInfo _org_ofono_manager_dbus_arg_info_modem_added_properties = {-1, "properties", "a{sv}", NULL};
static const GDBusArgInfo * const _org_ofono_manager_dbus_arg_info_modem_added[] = {&_org_ofono_manager_dbus_arg_info_modem_added_path, &_org_ofono_manager_dbus_arg_info_modem_added_properties, NULL};
static const GDBusSignalInfo _org_ofono_manager_dbus_signal_info_modem_added = {-1, "ModemAdded", (GDBusArgInfo **) (&_org_ofono_manager_dbus_arg_info_modem_added), NULL};
static const GDBusArgInfo _org_ofono_manager_dbus_arg_info_modem_removed_path = {-1, "path", "o", NULL};
static const GDBusArgInfo * const _org_ofono_manager_dbus_arg_info_modem_removed[] = {&_org_ofono_manager_dbus_arg_info_modem_removed_path, NULL};
static const GDBusSignalInfo _org_ofono_manager_dbus_signal_info_modem_removed = {-1, "ModemRemoved", (GDBusArgInfo **) (&_org_ofono_manager_dbus_arg_info_modem_removed), NULL};
static const GDBusSignalInfo * const _org_ofono_manager_dbus_signal_info[] = {&_org_ofono_manager_dbus_signal_info_modem_added, &_org_ofono_manager_dbus_signal_info_modem_removed, NULL};
static const GDBusPropertyInfo * const _org_ofono_manager_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _org_ofono_manager_dbus_interface_info = {-1, "org.ofono.Manager", (GDBusMethodInfo **) (&_org_ofono_manager_dbus_method_info), (GDBusSignalInfo **) (&_org_ofono_manager_dbus_signal_info), (GDBusPropertyInfo **) (&_org_ofono_manager_dbus_property_info), NULL};
static const GDBusInterfaceVTable _org_ofono_manager_dbus_interface_vtable = {org_ofono_manager_dbus_interface_method_call, org_ofono_manager_dbus_interface_get_property, org_ofono_manager_dbus_interface_set_property};
static const GDBusArgInfo _org_ofono_phonebook_dbus_arg_info_Import_result = {-1, "result", "s", NULL};
static const GDBusArgInfo * const _org_ofono_phonebook_dbus_arg_info_Import_in[] = {NULL};
static const GDBusArgInfo * const _org_ofono_phonebook_dbus_arg_info_Import_out[] = {&_org_ofono_phonebook_dbus_arg_info_Import_result, NULL};
static const GDBusMethodInfo _org_ofono_phonebook_dbus_method_info_Import = {-1, "Import", (GDBusArgInfo **) (&_org_ofono_phonebook_dbus_arg_info_Import_in), (GDBusArgInfo **) (&_org_ofono_phonebook_dbus_arg_info_Import_out), NULL};
static const GDBusMethodInfo * const _org_ofono_phonebook_dbus_method_info[] = {&_org_ofono_phonebook_dbus_method_info_Import, NULL};
static const GDBusSignalInfo * const _org_ofono_phonebook_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo * const _org_ofono_phonebook_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _org_ofono_phonebook_dbus_interface_info = {-1, "org.ofono.Phonebook", (GDBusMethodInfo **) (&_org_ofono_phonebook_dbus_method_info), (GDBusSignalInfo **) (&_org_ofono_phonebook_dbus_signal_info), (GDBusPropertyInfo **) (&_org_ofono_phonebook_dbus_property_info), NULL};
static const GDBusInterfaceVTable _org_ofono_phonebook_dbus_interface_vtable = {org_ofono_phonebook_dbus_interface_method_call, org_ofono_phonebook_dbus_interface_get_property, org_ofono_phonebook_dbus_interface_set_property};
static const GDBusArgInfo _org_ofono_sim_manager_dbus_arg_info_GetProperties_result = {-1, "result", "a{sv}", NULL};
static const GDBusArgInfo * const _org_ofono_sim_manager_dbus_arg_info_GetProperties_in[] = {NULL};
static const GDBusArgInfo * const _org_ofono_sim_manager_dbus_arg_info_GetProperties_out[] = {&_org_ofono_sim_manager_dbus_arg_info_GetProperties_result, NULL};
static const GDBusMethodInfo _org_ofono_sim_manager_dbus_method_info_GetProperties = {-1, "GetProperties", (GDBusArgInfo **) (&_org_ofono_sim_manager_dbus_arg_info_GetProperties_in), (GDBusArgInfo **) (&_org_ofono_sim_manager_dbus_arg_info_GetProperties_out), NULL};
static const GDBusMethodInfo * const _org_ofono_sim_manager_dbus_method_info[] = {&_org_ofono_sim_manager_dbus_method_info_GetProperties, NULL};
static const GDBusArgInfo _org_ofono_sim_manager_dbus_arg_info_property_changed_property = {-1, "property", "s", NULL};
static const GDBusArgInfo _org_ofono_sim_manager_dbus_arg_info_property_changed_value = {-1, "value", "v", NULL};
static const GDBusArgInfo * const _org_ofono_sim_manager_dbus_arg_info_property_changed[] = {&_org_ofono_sim_manager_dbus_arg_info_property_changed_property, &_org_ofono_sim_manager_dbus_arg_info_property_changed_value, NULL};
static const GDBusSignalInfo _org_ofono_sim_manager_dbus_signal_info_property_changed = {-1, "PropertyChanged", (GDBusArgInfo **) (&_org_ofono_sim_manager_dbus_arg_info_property_changed), NULL};
static const GDBusSignalInfo * const _org_ofono_sim_manager_dbus_signal_info[] = {&_org_ofono_sim_manager_dbus_signal_info_property_changed, NULL};
static const GDBusPropertyInfo * const _org_ofono_sim_manager_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _org_ofono_sim_manager_dbus_interface_info = {-1, "org.ofono.SimManager", (GDBusMethodInfo **) (&_org_ofono_sim_manager_dbus_method_info), (GDBusSignalInfo **) (&_org_ofono_sim_manager_dbus_signal_info), (GDBusPropertyInfo **) (&_org_ofono_sim_manager_dbus_property_info), NULL};
static const GDBusInterfaceVTable _org_ofono_sim_manager_dbus_interface_vtable = {org_ofono_sim_manager_dbus_interface_method_call, org_ofono_sim_manager_dbus_interface_get_property, org_ofono_sim_manager_dbus_interface_set_property};

static gpointer
_g_hash_table_ref0 (gpointer self)
{
	return self ? g_hash_table_ref (self) : NULL;
}

void
org_ofono_modem_properties_copy (const orgofonoModemProperties* self,
                                 orgofonoModemProperties* dest)
{
	const char* _tmp0_;
	char* _tmp1_;
	GHashTable* _tmp2_;
	GHashTable* _tmp3_;
	_tmp0_ = (*self).path;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 ((*dest).path);
	(*dest).path = _tmp1_;
	_tmp2_ = (*self).properties;
	_tmp3_ = _g_hash_table_ref0 (_tmp2_);
	_g_hash_table_unref0 ((*dest).properties);
	(*dest).properties = _tmp3_;
}

void
org_ofono_modem_properties_destroy (orgofonoModemProperties* self)
{
	_g_free0 ((*self).path);
	_g_hash_table_unref0 ((*self).properties);
}

orgofonoModemProperties*
org_ofono_modem_properties_dup (const orgofonoModemProperties* self)
{
	orgofonoModemProperties* dup;
	dup = g_new0 (orgofonoModemProperties, 1);
	org_ofono_modem_properties_copy (self, dup);
	return dup;
}

void
org_ofono_modem_properties_free (orgofonoModemProperties* self)
{
	org_ofono_modem_properties_destroy (self);
	g_free (self);
}

static GType
org_ofono_modem_properties_get_type_once (void)
{
	GType org_ofono_modem_properties_type_id;
	org_ofono_modem_properties_type_id = g_boxed_type_register_static ("orgofonoModemProperties", (GBoxedCopyFunc) org_ofono_modem_properties_dup, (GBoxedFreeFunc) org_ofono_modem_properties_free);
	return org_ofono_modem_properties_type_id;
}

GType
org_ofono_modem_properties_get_type (void)
{
	static volatile gsize org_ofono_modem_properties_type_id__once = 0;
	if (g_once_init_enter (&org_ofono_modem_properties_type_id__once)) {
		GType org_ofono_modem_properties_type_id;
		org_ofono_modem_properties_type_id = org_ofono_modem_properties_get_type_once ();
		g_once_init_leave (&org_ofono_modem_properties_type_id__once, org_ofono_modem_properties_type_id);
	}
	return org_ofono_modem_properties_type_id__once;
}

orgofonoModemProperties*
org_ofono_manager_GetModems (orgofonoManager* self,
                             gint* result_length1,
                             GError** error)
{
	orgofonoManagerIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = ORG_OFONO_MANAGER_GET_INTERFACE (self);
	if (_iface_->GetModems) {
		return _iface_->GetModems (self, result_length1, error);
	}
	return NULL;
}

static void
g_cclosure_user_marshal_VOID__STRING_BOXED (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) (gpointer data1, const char* arg_1, gpointer arg_2, gpointer data2);
	register GMarshalFunc_VOID__STRING_BOXED callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 3);
	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) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_string (param_values + 1), g_value_get_boxed (param_values + 2), data2);
}

static void
org_ofono_manager_default_init (orgofonoManagerIface * iface,
                                gpointer iface_data)
{
	org_ofono_manager_signals[ORG_OFONO_MANAGER_MODEM_ADDED_SIGNAL] = g_signal_new ("modem-added", ORG_OFONO_TYPE_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_BOXED, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_HASH_TABLE);
	org_ofono_manager_signals[ORG_OFONO_MANAGER_MODEM_REMOVED_SIGNAL] = g_signal_new ("modem-removed", ORG_OFONO_TYPE_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
}

static GType
org_ofono_manager_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (orgofonoManagerIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) org_ofono_manager_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType org_ofono_manager_type_id;
	org_ofono_manager_type_id = g_type_register_static (G_TYPE_INTERFACE, "orgofonoManager", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (org_ofono_manager_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (org_ofono_manager_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) org_ofono_manager_proxy_get_type);
	g_type_set_qdata (org_ofono_manager_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.ofono.Manager");
	g_type_set_qdata (org_ofono_manager_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_org_ofono_manager_dbus_interface_info));
	g_type_set_qdata (org_ofono_manager_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) org_ofono_manager_register_object);
	return org_ofono_manager_type_id;
}

GType
org_ofono_manager_get_type (void)
{
	static volatile gsize org_ofono_manager_type_id__once = 0;
	if (g_once_init_enter (&org_ofono_manager_type_id__once)) {
		GType org_ofono_manager_type_id;
		org_ofono_manager_type_id = org_ofono_manager_get_type_once ();
		g_once_init_leave (&org_ofono_manager_type_id__once, org_ofono_manager_type_id);
	}
	return org_ofono_manager_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (orgofonoManagerProxy, org_ofono_manager_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (ORG_OFONO_TYPE_MANAGER, org_ofono_manager_proxy_org_ofono_manager_interface_init) )
static void
org_ofono_manager_proxy_class_init (orgofonoManagerProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = org_ofono_manager_proxy_g_signal;
}

static void
_dbus_handle_org_ofono_manager_modem_added (orgofonoManager* self,
                                            GVariant* parameters)
{
	GVariantIter _arguments_iter;
	char* path = NULL;
	GVariant* _tmp0_;
	GHashTable* properties = NULL;
	GVariant* _tmp1_;
	GHashTable* _tmp2_;
	GVariantIter _tmp3_;
	GVariant* _tmp4_;
	GVariant* _tmp5_;
	g_variant_iter_init (&_arguments_iter, parameters);
	_tmp0_ = g_variant_iter_next_value (&_arguments_iter);
	path = g_variant_dup_string (_tmp0_, NULL);
	g_variant_unref (_tmp0_);
	_tmp1_ = g_variant_iter_next_value (&_arguments_iter);
	_tmp2_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_variant_unref);
	g_variant_iter_init (&_tmp3_, _tmp1_);
	while (g_variant_iter_loop (&_tmp3_, "{?*}", &_tmp4_, &_tmp5_)) {
		g_hash_table_insert (_tmp2_, g_variant_dup_string (_tmp4_, NULL), g_variant_get_variant (_tmp5_));
	}
	properties = _tmp2_;
	g_variant_unref (_tmp1_);
	g_signal_emit_by_name (self, "modem-added", path, properties);
	_g_free0 (path);
	_g_hash_table_unref0 (properties);
}

static void
_dbus_handle_org_ofono_manager_modem_removed (orgofonoManager* self,
                                              GVariant* parameters)
{
	GVariantIter _arguments_iter;
	char* path = NULL;
	GVariant* _tmp6_;
	g_variant_iter_init (&_arguments_iter, parameters);
	_tmp6_ = g_variant_iter_next_value (&_arguments_iter);
	path = g_variant_dup_string (_tmp6_, NULL);
	g_variant_unref (_tmp6_);
	g_signal_emit_by_name (self, "modem-removed", path);
	_g_free0 (path);
}

static void
org_ofono_manager_proxy_g_signal (GDBusProxy* proxy,
                                  const gchar* sender_name,
                                  const gchar* signal_name,
                                  GVariant* parameters)
{
	if (strcmp (signal_name, "ModemAdded") == 0) {
		_dbus_handle_org_ofono_manager_modem_added ((orgofonoManager*) proxy, parameters);
	} else if (strcmp (signal_name, "ModemRemoved") == 0) {
		_dbus_handle_org_ofono_manager_modem_removed ((orgofonoManager*) proxy, parameters);
	}
}

static void
org_ofono_manager_proxy_init (orgofonoManagerProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_org_ofono_manager_dbus_interface_info));
}

static orgofonoModemProperties*
org_ofono_manager_proxy_GetModems (orgofonoManager* self,
                                   gint* result_length1,
                                   GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	orgofonoModemProperties* _result = NULL;
	gint _result_length1;
	GVariant* _tmp7_;
	orgofonoModemProperties* _tmp8_;
	gint _tmp8__length;
	gint _tmp8__size;
	gint _tmp8__length1;
	GVariantIter _tmp9_;
	GVariant* _tmp10_;
	G_DBUS_ERROR;
	G_IO_ERROR;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.ofono.Manager", "GetModems");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	_reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error);
	g_object_unref (_message);
	if (!_reply_message) {
		return NULL;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return NULL;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_result_length1 = 0;
	_tmp7_ = g_variant_iter_next_value (&_reply_iter);
	_tmp8_ = g_new (orgofonoModemProperties, 5);
	_tmp8__length = 0;
	_tmp8__size = 4;
	_tmp8__length1 = 0;
	g_variant_iter_init (&_tmp9_, _tmp7_);
	for (; (_tmp10_ = g_variant_iter_next_value (&_tmp9_)) != NULL; _tmp8__length1++) {
		orgofonoModemProperties _tmp11_;
		GVariantIter _tmp12_;
		GVariant* _tmp13_;
		GVariant* _tmp14_;
		GHashTable* _tmp15_;
		GVariantIter _tmp16_;
		GVariant* _tmp17_;
		GVariant* _tmp18_;
		if (_tmp8__size == _tmp8__length) {
			_tmp8__size = 2 * _tmp8__size;
			_tmp8_ = g_renew (orgofonoModemProperties, _tmp8_, _tmp8__size + 1);
		}
		g_variant_iter_init (&_tmp12_, _tmp10_);
		_tmp13_ = g_variant_iter_next_value (&_tmp12_);
		_tmp11_.path = g_variant_dup_string (_tmp13_, NULL);
		g_variant_unref (_tmp13_);
		_tmp14_ = g_variant_iter_next_value (&_tmp12_);
		_tmp15_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_variant_unref);
		g_variant_iter_init (&_tmp16_, _tmp14_);
		while (g_variant_iter_loop (&_tmp16_, "{?*}", &_tmp17_, &_tmp18_)) {
			g_hash_table_insert (_tmp15_, g_variant_dup_string (_tmp17_, NULL), g_variant_get_variant (_tmp18_));
		}
		_tmp11_.properties = _tmp15_;
		g_variant_unref (_tmp14_);
		_tmp8_[_tmp8__length++] = _tmp11_;
		g_variant_unref (_tmp10_);
	}
	_result_length1 = _tmp8__length1;
	_result = _tmp8_;
	g_variant_unref (_tmp7_);
	*result_length1 = _result_length1;
	g_object_unref (_reply_message);
	return _result;
}

static void
org_ofono_manager_proxy_org_ofono_manager_interface_init (orgofonoManagerIface* iface)
{
	iface->GetModems = org_ofono_manager_proxy_GetModems;
}

static void
_vala_orgofonoModemProperties_array_free (orgofonoModemProperties * array,
                                          gssize array_length)
{
	if (array != NULL) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			org_ofono_modem_properties_destroy (&array[i]);
		}
	}
	g_free (array);
}

static void
_dbus_org_ofono_manager_GetModems (orgofonoManager* self,
                                   GVariant* _parameters_,
                                   GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	orgofonoModemProperties* result;
	gint result_length1 = 0;
	orgofonoModemProperties* _tmp19_;
	GVariantBuilder _tmp20_;
	gint _tmp21_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	result = org_ofono_manager_GetModems (self, &result_length1, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_tmp19_ = result;
	g_variant_builder_init (&_tmp20_, G_VARIANT_TYPE ("a(oa{sv})"));
	for (_tmp21_ = 0; _tmp21_ < result_length1; _tmp21_++) {
		GVariantBuilder _tmp22_;
		GVariantBuilder _tmp23_;
		GHashTableIter _tmp24_;
		gpointer _tmp25_;
		gpointer _tmp26_;
		g_variant_builder_init (&_tmp22_, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_tmp22_, g_variant_new_object_path ((*_tmp19_).path));
		g_hash_table_iter_init (&_tmp24_, (*_tmp19_).properties);
		g_variant_builder_init (&_tmp23_, G_VARIANT_TYPE ("a{sv}"));
		while (g_hash_table_iter_next (&_tmp24_, &_tmp25_, &_tmp26_)) {
			gchar* _key;
			GVariant* _value;
			_key = (gchar*) _tmp25_;
			_value = (GVariant*) _tmp26_;
			g_variant_builder_add (&_tmp23_, "{?*}", g_variant_new_string (_key), g_variant_new_variant (_value));
		}
		g_variant_builder_add_value (&_tmp22_, g_variant_builder_end (&_tmp23_));
		g_variant_builder_add_value (&_tmp20_, g_variant_builder_end (&_tmp22_));
		_tmp19_++;
	}
	g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp20_));
	result = (_vala_orgofonoModemProperties_array_free (result, result_length1), NULL);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
org_ofono_manager_dbus_interface_method_call (GDBusConnection* connection,
                                              const gchar* sender,
                                              const gchar* object_path,
                                              const gchar* interface_name,
                                              const gchar* method_name,
                                              GVariant* parameters,
                                              GDBusMethodInvocation* invocation,
                                              gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (method_name, "GetModems") == 0) {
		_dbus_org_ofono_manager_GetModems (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

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

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

static void
_dbus_org_ofono_manager_modem_added (GObject* _sender,
                                     const char* path,
                                     GHashTable* properties,
                                     gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GVariantBuilder _tmp27_;
	GHashTableIter _tmp28_;
	gpointer _tmp29_;
	gpointer _tmp30_;
	_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_object_path (path));
	g_hash_table_iter_init (&_tmp28_, properties);
	g_variant_builder_init (&_tmp27_, G_VARIANT_TYPE ("a{sv}"));
	while (g_hash_table_iter_next (&_tmp28_, &_tmp29_, &_tmp30_)) {
		gchar* _key;
		GVariant* _value;
		_key = (gchar*) _tmp29_;
		_value = (GVariant*) _tmp30_;
		g_variant_builder_add (&_tmp27_, "{?*}", g_variant_new_string (_key), g_variant_new_variant (_value));
	}
	g_variant_builder_add_value (&_arguments_builder, g_variant_builder_end (&_tmp27_));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.ofono.Manager", "ModemAdded", _arguments, NULL);
}

static void
_dbus_org_ofono_manager_modem_removed (GObject* _sender,
                                       const char* path,
                                       gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_object_path (path));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.ofono.Manager", "ModemRemoved", _arguments, NULL);
}

guint
org_ofono_manager_register_object (gpointer object,
                                   GDBusConnection* connection,
                                   const gchar* path,
                                   GError** error)
{
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = g_object_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_org_ofono_manager_dbus_interface_info), &_org_ofono_manager_dbus_interface_vtable, data, _org_ofono_manager_unregister_object, error);
	if (!result) {
		return 0;
	}
	g_signal_connect (object, "modem-added", (GCallback) _dbus_org_ofono_manager_modem_added, data);
	g_signal_connect (object, "modem-removed", (GCallback) _dbus_org_ofono_manager_modem_removed, data);
	return result;
}

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

gchar*
org_ofono_phonebook_Import (orgofonoPhonebook* self,
                            GError** error)
{
	orgofonoPhonebookIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = ORG_OFONO_PHONEBOOK_GET_INTERFACE (self);
	if (_iface_->Import) {
		return _iface_->Import (self, error);
	}
	return NULL;
}

static void
org_ofono_phonebook_default_init (orgofonoPhonebookIface * iface,
                                  gpointer iface_data)
{
}

static GType
org_ofono_phonebook_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (orgofonoPhonebookIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) org_ofono_phonebook_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType org_ofono_phonebook_type_id;
	org_ofono_phonebook_type_id = g_type_register_static (G_TYPE_INTERFACE, "orgofonoPhonebook", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (org_ofono_phonebook_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (org_ofono_phonebook_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) org_ofono_phonebook_proxy_get_type);
	g_type_set_qdata (org_ofono_phonebook_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.ofono.Phonebook");
	g_type_set_qdata (org_ofono_phonebook_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_org_ofono_phonebook_dbus_interface_info));
	g_type_set_qdata (org_ofono_phonebook_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) org_ofono_phonebook_register_object);
	return org_ofono_phonebook_type_id;
}

GType
org_ofono_phonebook_get_type (void)
{
	static volatile gsize org_ofono_phonebook_type_id__once = 0;
	if (g_once_init_enter (&org_ofono_phonebook_type_id__once)) {
		GType org_ofono_phonebook_type_id;
		org_ofono_phonebook_type_id = org_ofono_phonebook_get_type_once ();
		g_once_init_leave (&org_ofono_phonebook_type_id__once, org_ofono_phonebook_type_id);
	}
	return org_ofono_phonebook_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (orgofonoPhonebookProxy, org_ofono_phonebook_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (ORG_OFONO_TYPE_PHONEBOOK, org_ofono_phonebook_proxy_org_ofono_phonebook_interface_init) )
static void
org_ofono_phonebook_proxy_class_init (orgofonoPhonebookProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = org_ofono_phonebook_proxy_g_signal;
}

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

static void
org_ofono_phonebook_proxy_init (orgofonoPhonebookProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_org_ofono_phonebook_dbus_interface_info));
}

static gchar*
org_ofono_phonebook_proxy_Import (orgofonoPhonebook* self,
                                  GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	gchar* _result = NULL;
	GVariant* _tmp31_;
	G_DBUS_ERROR;
	G_IO_ERROR;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.ofono.Phonebook", "Import");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	_reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error);
	g_object_unref (_message);
	if (!_reply_message) {
		return NULL;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return NULL;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_tmp31_ = g_variant_iter_next_value (&_reply_iter);
	_result = g_variant_dup_string (_tmp31_, NULL);
	g_variant_unref (_tmp31_);
	g_object_unref (_reply_message);
	return _result;
}

static void
org_ofono_phonebook_proxy_org_ofono_phonebook_interface_init (orgofonoPhonebookIface* iface)
{
	iface->Import = org_ofono_phonebook_proxy_Import;
}

static void
_dbus_org_ofono_phonebook_Import (orgofonoPhonebook* self,
                                  GVariant* _parameters_,
                                  GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gchar* result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	result = org_ofono_phonebook_Import (self, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_string (result));
	_g_free0 (result);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

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

static GVariant*
org_ofono_phonebook_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
org_ofono_phonebook_dbus_interface_set_property (GDBusConnection* connection,
                                                 const gchar* sender,
                                                 const gchar* object_path,
                                                 const gchar* interface_name,
                                                 const gchar* property_name,
                                                 GVariant* value,
                                                 GError** error,
                                                 gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	return FALSE;
}

guint
org_ofono_phonebook_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 *) (&_org_ofono_phonebook_dbus_interface_info), &_org_ofono_phonebook_dbus_interface_vtable, data, _org_ofono_phonebook_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}

static void
_org_ofono_phonebook_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*
org_ofono_sim_manager_GetProperties (orgofonoSimManager* self,
                                     GError** error)
{
	orgofonoSimManagerIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = ORG_OFONO_SIM_MANAGER_GET_INTERFACE (self);
	if (_iface_->GetProperties) {
		return _iface_->GetProperties (self, error);
	}
	return NULL;
}

static void
g_cclosure_user_marshal_VOID__STRING_VARIANT (GClosure * closure,
                                              GValue * return_value,
                                              guint n_param_values,
                                              const GValue * param_values,
                                              gpointer invocation_hint,
                                              gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__STRING_VARIANT) (gpointer data1, const char* arg_1, gpointer arg_2, gpointer data2);
	register GMarshalFunc_VOID__STRING_VARIANT callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 3);
	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_VARIANT) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_string (param_values + 1), g_value_get_variant (param_values + 2), data2);
}

static void
org_ofono_sim_manager_default_init (orgofonoSimManagerIface * iface,
                                    gpointer iface_data)
{
	org_ofono_sim_manager_signals[ORG_OFONO_SIM_MANAGER_PROPERTY_CHANGED_SIGNAL] = g_signal_new ("property-changed", ORG_OFONO_TYPE_SIM_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_VARIANT, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_VARIANT);
}

static GType
org_ofono_sim_manager_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (orgofonoSimManagerIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) org_ofono_sim_manager_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType org_ofono_sim_manager_type_id;
	org_ofono_sim_manager_type_id = g_type_register_static (G_TYPE_INTERFACE, "orgofonoSimManager", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (org_ofono_sim_manager_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (org_ofono_sim_manager_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) org_ofono_sim_manager_proxy_get_type);
	g_type_set_qdata (org_ofono_sim_manager_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.ofono.SimManager");
	g_type_set_qdata (org_ofono_sim_manager_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_org_ofono_sim_manager_dbus_interface_info));
	g_type_set_qdata (org_ofono_sim_manager_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) org_ofono_sim_manager_register_object);
	return org_ofono_sim_manager_type_id;
}

GType
org_ofono_sim_manager_get_type (void)
{
	static volatile gsize org_ofono_sim_manager_type_id__once = 0;
	if (g_once_init_enter (&org_ofono_sim_manager_type_id__once)) {
		GType org_ofono_sim_manager_type_id;
		org_ofono_sim_manager_type_id = org_ofono_sim_manager_get_type_once ();
		g_once_init_leave (&org_ofono_sim_manager_type_id__once, org_ofono_sim_manager_type_id);
	}
	return org_ofono_sim_manager_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (orgofonoSimManagerProxy, org_ofono_sim_manager_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (ORG_OFONO_TYPE_SIM_MANAGER, org_ofono_sim_manager_proxy_org_ofono_sim_manager_interface_init) )
static void
org_ofono_sim_manager_proxy_class_init (orgofonoSimManagerProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = org_ofono_sim_manager_proxy_g_signal;
}

static void
_dbus_handle_org_ofono_sim_manager_property_changed (orgofonoSimManager* self,
                                                     GVariant* parameters)
{
	GVariantIter _arguments_iter;
	gchar* property = NULL;
	GVariant* _tmp32_;
	GVariant* value = NULL;
	GVariant* _tmp33_;
	g_variant_iter_init (&_arguments_iter, parameters);
	_tmp32_ = g_variant_iter_next_value (&_arguments_iter);
	property = g_variant_dup_string (_tmp32_, NULL);
	g_variant_unref (_tmp32_);
	_tmp33_ = g_variant_iter_next_value (&_arguments_iter);
	value = g_variant_get_variant (_tmp33_);
	g_variant_unref (_tmp33_);
	g_signal_emit_by_name (self, "property-changed", property, value);
	_g_free0 (property);
	_g_variant_unref0 (value);
}

static void
org_ofono_sim_manager_proxy_g_signal (GDBusProxy* proxy,
                                      const gchar* sender_name,
                                      const gchar* signal_name,
                                      GVariant* parameters)
{
	if (strcmp (signal_name, "PropertyChanged") == 0) {
		_dbus_handle_org_ofono_sim_manager_property_changed ((orgofonoSimManager*) proxy, parameters);
	}
}

static void
org_ofono_sim_manager_proxy_init (orgofonoSimManagerProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_org_ofono_sim_manager_dbus_interface_info));
}

static GHashTable*
org_ofono_sim_manager_proxy_GetProperties (orgofonoSimManager* self,
                                           GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	GHashTable* _result = NULL;
	GVariant* _tmp34_;
	GHashTable* _tmp35_;
	GVariantIter _tmp36_;
	GVariant* _tmp37_;
	GVariant* _tmp38_;
	G_DBUS_ERROR;
	G_IO_ERROR;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.ofono.SimManager", "GetProperties");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	_reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error);
	g_object_unref (_message);
	if (!_reply_message) {
		return NULL;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return NULL;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_tmp34_ = g_variant_iter_next_value (&_reply_iter);
	_tmp35_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_variant_unref);
	g_variant_iter_init (&_tmp36_, _tmp34_);
	while (g_variant_iter_loop (&_tmp36_, "{?*}", &_tmp37_, &_tmp38_)) {
		g_hash_table_insert (_tmp35_, g_variant_dup_string (_tmp37_, NULL), g_variant_get_variant (_tmp38_));
	}
	_result = _tmp35_;
	g_variant_unref (_tmp34_);
	g_object_unref (_reply_message);
	return _result;
}

static void
org_ofono_sim_manager_proxy_org_ofono_sim_manager_interface_init (orgofonoSimManagerIface* iface)
{
	iface->GetProperties = org_ofono_sim_manager_proxy_GetProperties;
}

static void
_dbus_org_ofono_sim_manager_GetProperties (orgofonoSimManager* self,
                                           GVariant* _parameters_,
                                           GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	GHashTable* result;
	GVariantBuilder _tmp39_;
	GHashTableIter _tmp40_;
	gpointer _tmp41_;
	gpointer _tmp42_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	result = org_ofono_sim_manager_GetProperties (self, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_hash_table_iter_init (&_tmp40_, result);
	g_variant_builder_init (&_tmp39_, G_VARIANT_TYPE ("a{sv}"));
	while (g_hash_table_iter_next (&_tmp40_, &_tmp41_, &_tmp42_)) {
		gchar* _key;
		GVariant* _value;
		_key = (gchar*) _tmp41_;
		_value = (GVariant*) _tmp42_;
		g_variant_builder_add (&_tmp39_, "{?*}", g_variant_new_string (_key), g_variant_new_variant (_value));
	}
	g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp39_));
	_g_hash_table_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);
}

static void
org_ofono_sim_manager_dbus_interface_method_call (GDBusConnection* connection,
                                                  const gchar* sender,
                                                  const gchar* object_path,
                                                  const gchar* interface_name,
                                                  const gchar* method_name,
                                                  GVariant* parameters,
                                                  GDBusMethodInvocation* invocation,
                                                  gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (method_name, "GetProperties") == 0) {
		_dbus_org_ofono_sim_manager_GetProperties (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

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

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

static void
_dbus_org_ofono_sim_manager_property_changed (GObject* _sender,
                                              const gchar* property,
                                              GVariant* value,
                                              gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (property));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_variant (value));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.ofono.SimManager", "PropertyChanged", _arguments, NULL);
}

guint
org_ofono_sim_manager_register_object (gpointer object,
                                       GDBusConnection* connection,
                                       const gchar* path,
                                       GError** error)
{
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = g_object_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_org_ofono_sim_manager_dbus_interface_info), &_org_ofono_sim_manager_dbus_interface_vtable, data, _org_ofono_sim_manager_unregister_object, error);
	if (!result) {
		return 0;
	}
	g_signal_connect (object, "property-changed", (GCallback) _dbus_org_ofono_sim_manager_property_changed, data);
	return result;
}

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

