/* world-shell-world-clocks.c generated by valac 0.56.0, the Vala compiler
 * generated from world-shell-world-clocks.vala, do not modify */

/*
 * Copyright (C) 2013  Paolo Borelli <pborelli@gnome.org>
 *
 * 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 <glib-object.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>

#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define CLOCKS_WORLD_TYPE_SHELL_WORLD_CLOCKS (clocks_world_shell_world_clocks_get_type ())
#define CLOCKS_WORLD_SHELL_WORLD_CLOCKS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_WORLD_TYPE_SHELL_WORLD_CLOCKS, ClocksWorldShellWorldClocks))
#define CLOCKS_WORLD_SHELL_WORLD_CLOCKS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_WORLD_TYPE_SHELL_WORLD_CLOCKS, ClocksWorldShellWorldClocksClass))
#define CLOCKS_WORLD_IS_SHELL_WORLD_CLOCKS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_WORLD_TYPE_SHELL_WORLD_CLOCKS))
#define CLOCKS_WORLD_IS_SHELL_WORLD_CLOCKS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_WORLD_TYPE_SHELL_WORLD_CLOCKS))
#define CLOCKS_WORLD_SHELL_WORLD_CLOCKS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_WORLD_TYPE_SHELL_WORLD_CLOCKS, ClocksWorldShellWorldClocksClass))

typedef struct _ClocksWorldShellWorldClocks ClocksWorldShellWorldClocks;
typedef struct _ClocksWorldShellWorldClocksClass ClocksWorldShellWorldClocksClass;
typedef struct _ClocksWorldShellWorldClocksPrivate ClocksWorldShellWorldClocksPrivate;
enum  {
	CLOCKS_WORLD_SHELL_WORLD_CLOCKS_0_PROPERTY,
	CLOCKS_WORLD_SHELL_WORLD_CLOCKS_LOCATIONS_PROPERTY,
	CLOCKS_WORLD_SHELL_WORLD_CLOCKS_NUM_PROPERTIES
};
static GParamSpec* clocks_world_shell_world_clocks_properties[CLOCKS_WORLD_SHELL_WORLD_CLOCKS_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_variant_type_free0(var) ((var == NULL) ? NULL : (var = (g_variant_type_free (var), NULL)))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_variant_builder_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_builder_unref (var), NULL)))
#define _g_variant_iter_free0(var) ((var == NULL) ? NULL : (var = (g_variant_iter_free (var), NULL)))

struct _ClocksWorldShellWorldClocks {
	GObject parent_instance;
	ClocksWorldShellWorldClocksPrivate * priv;
};

struct _ClocksWorldShellWorldClocksClass {
	GObjectClass parent_class;
};

struct _ClocksWorldShellWorldClocksPrivate {
	GDBusConnection* connection;
	gchar* object_path;
	GSettings* settings;
};

static gint ClocksWorldShellWorldClocks_private_offset;
static gpointer clocks_world_shell_world_clocks_parent_class = NULL;

VALA_EXTERN GType clocks_world_shell_world_clocks_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClocksWorldShellWorldClocks, g_object_unref)
VALA_EXTERN guint clocks_world_shell_world_clocks_register_object (void* object,
                                                       GDBusConnection* connection,
                                                       const gchar* path,
                                                       GError** error);
VALA_EXTERN ClocksWorldShellWorldClocks* clocks_world_shell_world_clocks_new (GDBusConnection* connection,
                                                                  const gchar* object_path);
VALA_EXTERN ClocksWorldShellWorldClocks* clocks_world_shell_world_clocks_construct (GType object_type,
                                                                        GDBusConnection* connection,
                                                                        const gchar* object_path);
static void __lambda9_ (ClocksWorldShellWorldClocks* self);
VALA_EXTERN GVariant* clocks_world_shell_world_clocks_get_locations (ClocksWorldShellWorldClocks* self);
static void ___lambda9__g_settings_changed (GSettings* _sender,
                                     const gchar* key,
                                     gpointer self);
static void _vala_array_add4 (GVariant** * array,
                       gint* length,
                       gint* size,
                       GVariant* value);
static GVariant* _variant_new6 (GVariant** value,
                         gint value_length1);
static void clocks_world_shell_world_clocks_finalize (GObject * obj);
static GType clocks_world_shell_world_clocks_get_type_once (void);
static void _vala_clocks_world_shell_world_clocks_get_property (GObject * object,
                                                         guint property_id,
                                                         GValue * value,
                                                         GParamSpec * pspec);
static void clocks_world_shell_world_clocks_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* clocks_world_shell_world_clocks_dbus_interface_get_property (GDBusConnection* connection,
                                                                       const gchar* sender,
                                                                       const gchar* object_path,
                                                                       const gchar* interface_name,
                                                                       const gchar* property_name,
                                                                       GError** error,
                                                                       gpointer user_data);
static GVariant* _dbus_clocks_world_shell_world_clocks_get_locations (ClocksWorldShellWorldClocks* self);
static gboolean clocks_world_shell_world_clocks_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 _clocks_world_shell_world_clocks_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 inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static const GDBusMethodInfo * const _clocks_world_shell_world_clocks_dbus_method_info[] = {NULL};
static const GDBusSignalInfo * const _clocks_world_shell_world_clocks_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo _clocks_world_shell_world_clocks_dbus_property_info_locations = {-1, "Locations", "av", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo * const _clocks_world_shell_world_clocks_dbus_property_info[] = {&_clocks_world_shell_world_clocks_dbus_property_info_locations, NULL};
static const GDBusInterfaceInfo _clocks_world_shell_world_clocks_dbus_interface_info = {-1, "org.gnome.Shell.ClocksIntegration", (GDBusMethodInfo **) (&_clocks_world_shell_world_clocks_dbus_method_info), (GDBusSignalInfo **) (&_clocks_world_shell_world_clocks_dbus_signal_info), (GDBusPropertyInfo **) (&_clocks_world_shell_world_clocks_dbus_property_info), NULL};
static const GDBusInterfaceVTable _clocks_world_shell_world_clocks_dbus_interface_vtable = {clocks_world_shell_world_clocks_dbus_interface_method_call, clocks_world_shell_world_clocks_dbus_interface_get_property, clocks_world_shell_world_clocks_dbus_interface_set_property};

static inline gpointer
clocks_world_shell_world_clocks_get_instance_private (ClocksWorldShellWorldClocks* self)
{
	return G_STRUCT_MEMBER_P (self, ClocksWorldShellWorldClocks_private_offset);
}

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

static void
__lambda9_ (ClocksWorldShellWorldClocks* self)
{
	GVariantBuilder* builder = NULL;
	const GVariantType* _tmp0_;
	GVariantBuilder* _tmp1_;
	GVariantBuilder* invalid_builder = NULL;
	GVariantType* _tmp2_;
	GVariantType* _tmp3_;
	GVariantBuilder* _tmp4_;
	GVariantBuilder* _tmp5_;
	GVariant* v = NULL;
	GVariant* _tmp6_;
	GVariant* _tmp7_;
	GError* _inner_error0_ = NULL;
	_tmp0_ = G_VARIANT_TYPE_ARRAY;
	_tmp1_ = g_variant_builder_new (_tmp0_);
	builder = _tmp1_;
	_tmp2_ = g_variant_type_new ("as");
	_tmp3_ = _tmp2_;
	_tmp4_ = g_variant_builder_new (_tmp3_);
	_tmp5_ = _tmp4_;
	_g_variant_type_free0 (_tmp3_);
	invalid_builder = _tmp5_;
	_tmp6_ = clocks_world_shell_world_clocks_get_locations (self);
	_tmp7_ = _tmp6_;
	v = _tmp7_;
	g_variant_builder_add (builder, "{sv}", "Locations", v, NULL);
	{
		GDBusConnection* _tmp8_;
		const gchar* _tmp9_;
		GVariant* _tmp10_;
		GVariant* _tmp11_;
		_tmp8_ = self->priv->connection;
		_tmp9_ = self->priv->object_path;
		_tmp10_ = g_variant_new ("(sa{sv}as)", "org.gnome.Shell.ClocksIntegration", builder, invalid_builder, NULL);
		g_variant_ref_sink (_tmp10_);
		_tmp11_ = _tmp10_;
		g_dbus_connection_emit_signal (_tmp8_, NULL, _tmp9_, "org.freedesktop.DBus.Properties", "PropertiesChanged", _tmp11_, &_inner_error0_);
		_g_variant_unref0 (_tmp11_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp12_;
		const gchar* _tmp13_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp12_ = e;
		_tmp13_ = _tmp12_->message;
		g_warning ("world-shell-world-clocks.vala:75: Shell Integration failed: %s", _tmp13_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_variant_unref0 (v);
		_g_variant_builder_unref0 (invalid_builder);
		_g_variant_builder_unref0 (builder);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_g_variant_unref0 (v);
	_g_variant_builder_unref0 (invalid_builder);
	_g_variant_builder_unref0 (builder);
}

static void
___lambda9__g_settings_changed (GSettings* _sender,
                                const gchar* key,
                                gpointer self)
{
	__lambda9_ ((ClocksWorldShellWorldClocks*) self);
}

ClocksWorldShellWorldClocks*
clocks_world_shell_world_clocks_construct (GType object_type,
                                           GDBusConnection* connection,
                                           const gchar* object_path)
{
	ClocksWorldShellWorldClocks * self = NULL;
	GDBusConnection* _tmp0_;
	gchar* _tmp1_;
	GSettings* _tmp2_;
	GSettings* _tmp3_;
	g_return_val_if_fail (connection != NULL, NULL);
	g_return_val_if_fail (object_path != NULL, NULL);
	self = (ClocksWorldShellWorldClocks*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (connection);
	_g_object_unref0 (self->priv->connection);
	self->priv->connection = _tmp0_;
	_tmp1_ = g_strdup (object_path);
	_g_free0 (self->priv->object_path);
	self->priv->object_path = _tmp1_;
	_tmp2_ = g_settings_new ("org.gnome.clocks");
	_g_object_unref0 (self->priv->settings);
	self->priv->settings = _tmp2_;
	_tmp3_ = self->priv->settings;
	g_signal_connect_object (_tmp3_, "changed::world-clocks", (GCallback) ___lambda9__g_settings_changed, self, 0);
	return self;
}

ClocksWorldShellWorldClocks*
clocks_world_shell_world_clocks_new (GDBusConnection* connection,
                                     const gchar* object_path)
{
	return clocks_world_shell_world_clocks_construct (CLOCKS_WORLD_TYPE_SHELL_WORLD_CLOCKS, connection, object_path);
}

static gpointer
_g_variant_ref0 (gpointer self)
{
	return self ? g_variant_ref (self) : NULL;
}

static void
_vala_array_add4 (GVariant** * array,
                  gint* length,
                  gint* size,
                  GVariant* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GVariant*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static GVariant*
_variant_new6 (GVariant** value,
               gint value_length1)
{
	GVariant** _tmp18_;
	GVariantBuilder _tmp19_;
	gint _tmp20_;
	_tmp18_ = value;
	g_variant_builder_init (&_tmp19_, G_VARIANT_TYPE ("av"));
	for (_tmp20_ = 0; _tmp20_ < value_length1; _tmp20_++) {
		g_variant_builder_add_value (&_tmp19_, g_variant_new_variant (*_tmp18_));
		_tmp18_++;
	}
	return g_variant_ref_sink (g_variant_builder_end (&_tmp19_));
}

GVariant*
clocks_world_shell_world_clocks_get_locations (ClocksWorldShellWorldClocks* self)
{
	GVariant* result;
	GVariant* dict = NULL;
	GVariant** rv = NULL;
	GVariant** _tmp0_;
	gint rv_length1;
	gint _rv_size_;
	GVariant* locations = NULL;
	GSettings* _tmp1_;
	GVariant* _tmp2_;
	GVariantIter* iter = NULL;
	GVariant* _tmp3_;
	GVariantIter* _tmp4_;
	GVariant** _tmp17_;
	gint _tmp17__length1;
	GVariant* _tmp21_;
	GVariant* _tmp22_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_new0 (GVariant*, 0 + 1);
	rv = _tmp0_;
	rv_length1 = 0;
	_rv_size_ = rv_length1;
	_tmp1_ = self->priv->settings;
	_tmp2_ = g_settings_get_value (_tmp1_, "world-clocks");
	locations = _tmp2_;
	_tmp3_ = locations;
	_tmp4_ = g_variant_iter_new (_tmp3_);
	iter = _tmp4_;
	while (TRUE) {
		GVariantIter* _tmp5_;
		GVariant* _tmp6_ = NULL;
		gboolean _tmp7_;
		gchar* key = NULL;
		GVariant* val = NULL;
		GVariantIter* dict_iter = NULL;
		GVariant* _tmp8_;
		GVariantIter* _tmp9_;
		_tmp5_ = iter;
		_tmp7_ = g_variant_iter_next (_tmp5_, "@a{sv}", &_tmp6_, NULL);
		_g_variant_unref0 (dict);
		dict = _tmp6_;
		if (!_tmp7_) {
			break;
		}
		_tmp8_ = dict;
		_tmp9_ = g_variant_iter_new (_tmp8_);
		dict_iter = _tmp9_;
		while (TRUE) {
			GVariantIter* _tmp10_;
			gchar* _tmp11_ = NULL;
			GVariant* _tmp12_ = NULL;
			gboolean _tmp13_;
			const gchar* _tmp14_;
			_tmp10_ = dict_iter;
			_tmp13_ = g_variant_iter_next (_tmp10_, "{sv}", &_tmp11_, &_tmp12_, NULL);
			_g_free0 (key);
			key = _tmp11_;
			_g_variant_unref0 (val);
			val = _tmp12_;
			if (!_tmp13_) {
				break;
			}
			_tmp14_ = key;
			if (g_strcmp0 (_tmp14_, "location") == 0) {
				GVariant* _tmp15_;
				GVariant* _tmp16_;
				_tmp15_ = val;
				_tmp16_ = _g_variant_ref0 (_tmp15_);
				_vala_array_add4 (&rv, &rv_length1, &_rv_size_, _tmp16_);
			}
		}
		_g_variant_iter_free0 (dict_iter);
		_g_variant_unref0 (val);
		_g_free0 (key);
	}
	_tmp17_ = rv;
	_tmp17__length1 = rv_length1;
	_tmp21_ = _variant_new6 (_tmp17_, rv_length1);
	_tmp22_ = _tmp21_;
	_tmp17_ = (_vala_array_free (_tmp17_, _tmp17__length1, (GDestroyNotify) g_variant_unref), NULL);
	result = _tmp22_;
	_g_variant_iter_free0 (iter);
	_g_variant_unref0 (locations);
	_g_variant_unref0 (dict);
	return result;
}

static void
clocks_world_shell_world_clocks_class_init (ClocksWorldShellWorldClocksClass * klass,
                                            gpointer klass_data)
{
	clocks_world_shell_world_clocks_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ClocksWorldShellWorldClocks_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_clocks_world_shell_world_clocks_get_property;
	G_OBJECT_CLASS (klass)->finalize = clocks_world_shell_world_clocks_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_WORLD_SHELL_WORLD_CLOCKS_LOCATIONS_PROPERTY, clocks_world_shell_world_clocks_properties[CLOCKS_WORLD_SHELL_WORLD_CLOCKS_LOCATIONS_PROPERTY] = g_param_spec_variant ("locations", "locations", "locations", G_VARIANT_TYPE_ANY, NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
clocks_world_shell_world_clocks_instance_init (ClocksWorldShellWorldClocks * self,
                                               gpointer klass)
{
	self->priv = clocks_world_shell_world_clocks_get_instance_private (self);
}

static void
clocks_world_shell_world_clocks_finalize (GObject * obj)
{
	ClocksWorldShellWorldClocks * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CLOCKS_WORLD_TYPE_SHELL_WORLD_CLOCKS, ClocksWorldShellWorldClocks);
	_g_object_unref0 (self->priv->connection);
	_g_free0 (self->priv->object_path);
	_g_object_unref0 (self->priv->settings);
	G_OBJECT_CLASS (clocks_world_shell_world_clocks_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
clocks_world_shell_world_clocks_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ClocksWorldShellWorldClocksClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) clocks_world_shell_world_clocks_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ClocksWorldShellWorldClocks), 0, (GInstanceInitFunc) clocks_world_shell_world_clocks_instance_init, NULL };
	GType clocks_world_shell_world_clocks_type_id;
	clocks_world_shell_world_clocks_type_id = g_type_register_static (G_TYPE_OBJECT, "ClocksWorldShellWorldClocks", &g_define_type_info, 0);
	g_type_set_qdata (clocks_world_shell_world_clocks_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) clocks_world_shell_world_clocks_register_object);
	ClocksWorldShellWorldClocks_private_offset = g_type_add_instance_private (clocks_world_shell_world_clocks_type_id, sizeof (ClocksWorldShellWorldClocksPrivate));
	return clocks_world_shell_world_clocks_type_id;
}

GType
clocks_world_shell_world_clocks_get_type (void)
{
	static volatile gsize clocks_world_shell_world_clocks_type_id__once = 0;
	if (g_once_init_enter (&clocks_world_shell_world_clocks_type_id__once)) {
		GType clocks_world_shell_world_clocks_type_id;
		clocks_world_shell_world_clocks_type_id = clocks_world_shell_world_clocks_get_type_once ();
		g_once_init_leave (&clocks_world_shell_world_clocks_type_id__once, clocks_world_shell_world_clocks_type_id);
	}
	return clocks_world_shell_world_clocks_type_id__once;
}

static void
_vala_clocks_world_shell_world_clocks_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec)
{
	ClocksWorldShellWorldClocks * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_WORLD_TYPE_SHELL_WORLD_CLOCKS, ClocksWorldShellWorldClocks);
	switch (property_id) {
		case CLOCKS_WORLD_SHELL_WORLD_CLOCKS_LOCATIONS_PROPERTY:
		g_value_take_variant (value, clocks_world_shell_world_clocks_get_locations (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
clocks_world_shell_world_clocks_dbus_interface_method_call (GDBusConnection* connection,
                                                            const gchar* sender,
                                                            const gchar* object_path,
                                                            const gchar* interface_name,
                                                            const gchar* method_name,
                                                            GVariant* parameters,
                                                            GDBusMethodInvocation* invocation,
                                                            gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	g_object_unref (invocation);
}

static GVariant*
_dbus_clocks_world_shell_world_clocks_get_locations (ClocksWorldShellWorldClocks* self)
{
	GVariant* result;
	GVariant* _reply;
	result = clocks_world_shell_world_clocks_get_locations (self);
	_reply = result;
	return _reply;
}

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

static gboolean
clocks_world_shell_world_clocks_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
clocks_world_shell_world_clocks_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 *) (&_clocks_world_shell_world_clocks_dbus_interface_info), &_clocks_world_shell_world_clocks_dbus_interface_vtable, data, _clocks_world_shell_world_clocks_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}

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

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

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

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

