/* queued-proxy-wrapper.c generated by valac 0.56.19, the Vala compiler
 * generated from queued-proxy-wrapper.vala, do not modify */

/*
 * Copyright © 2012 Canonical Ltd.
 *             By Siegfried-A. Gevatter <siegfried.gevatter@collabora.co.uk>
 *
 * Based upon a C implementation (© 2010-2012 Canonical Ltd) by:
 *  Mikkel Kamstrup Erlandsen <mikkel.kamstrup@canonical.com>
 *  Michal Hruby <michal.hruby@canonical.com>
 *
 * This program 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 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 Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#include "zeitgeist.h"
#include <glib.h>
#include <gio/gio.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <gobject/gvaluecollector.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  {
	ZEITGEIST_QUEUED_PROXY_WRAPPER_0_PROPERTY,
	ZEITGEIST_QUEUED_PROXY_WRAPPER_PROXY_CREATED_PROPERTY,
	ZEITGEIST_QUEUED_PROXY_WRAPPER_IS_CONNECTED_PROPERTY,
	ZEITGEIST_QUEUED_PROXY_WRAPPER_NUM_PROPERTIES
};
static GParamSpec* zeitgeist_queued_proxy_wrapper_properties[ZEITGEIST_QUEUED_PROXY_WRAPPER_NUM_PROPERTIES];
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _zeitgeist_queued_proxy_wrapper_queued_method_unref0(var) ((var == NULL) ? NULL : (var = (zeitgeist_queued_proxy_wrapper_queued_method_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _ZeitgeistQueuedProxyWrapperWaitForProxyData ZeitgeistQueuedProxyWrapperWaitForProxyData;
typedef struct _ZeitgeistQueuedProxyWrapperParamSpecQueuedMethod ZeitgeistQueuedProxyWrapperParamSpecQueuedMethod;

struct _ZeitgeistQueuedProxyWrapperPrivate {
	gboolean _proxy_created;
	gboolean _is_connected;
	GSList* method_dispatch_queue;
	GError* log_error;
	GDBusProxy* dbus_proxy;
};

struct _ZeitgeistQueuedProxyWrapperWaitForProxyData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ZeitgeistQueuedProxyWrapper* self;
	gboolean _tmp0_;
	GSList* _tmp1_;
	ZeitgeistQueuedProxyWrapperQueuedMethod* _tmp2_;
	GError* _tmp3_;
	GError* _tmp4_;
	GError* _tmp5_;
	GError* _inner_error0_;
};

struct _ZeitgeistQueuedProxyWrapperQueuedMethodPrivate {
	GSourceFunc _queued_method;
	gpointer _queued_method_target;
	GDestroyNotify _queued_method_target_destroy_notify;
};

struct _ZeitgeistQueuedProxyWrapperParamSpecQueuedMethod {
	GParamSpec parent_instance;
};

static gint ZeitgeistQueuedProxyWrapper_private_offset;
static gpointer zeitgeist_queued_proxy_wrapper_parent_class = NULL;
static gint ZeitgeistQueuedProxyWrapperQueuedMethod_private_offset;
static gpointer zeitgeist_queued_proxy_wrapper_queued_method_parent_class = NULL;

static void _zeitgeist_queued_proxy_wrapper_queued_method_unref0_ (gpointer var);
static inline void _g_slist_free__zeitgeist_queued_proxy_wrapper_queued_method_unref0_ (GSList* self);
static void zeitgeist_queued_proxy_wrapper_set_is_connected (ZeitgeistQueuedProxyWrapper* self,
                                                      gboolean value);
static void zeitgeist_queued_proxy_wrapper_set_proxy_created (ZeitgeistQueuedProxyWrapper* self,
                                                       gboolean value);
static void _zeitgeist_queued_proxy_wrapper_name_owner_changed_g_object_notify (GObject* _sender,
                                                                         GParamSpec* pspec,
                                                                         gpointer self);
static void zeitgeist_queued_proxy_wrapper_real_on_connection_established (ZeitgeistQueuedProxyWrapper* self);
static void zeitgeist_queued_proxy_wrapper_real_on_connection_lost (ZeitgeistQueuedProxyWrapper* self);
static void zeitgeist_queued_proxy_wrapper_wait_for_proxy_data_free (gpointer _data);
static gboolean zeitgeist_queued_proxy_wrapper_wait_for_proxy_co (ZeitgeistQueuedProxyWrapperWaitForProxyData* _data_);
static gboolean _zeitgeist_queued_proxy_wrapper_wait_for_proxy_co_gsource_func (gpointer self);
static void zeitgeist_queued_proxy_wrapper_queued_method_set_queued_method (ZeitgeistQueuedProxyWrapperQueuedMethod* self,
                                                                     GSourceFunc value,
                                                                     gpointer value_target,
                                                                     GDestroyNotify value_target_destroy_notify);
static void zeitgeist_queued_proxy_wrapper_queued_method_finalize (ZeitgeistQueuedProxyWrapperQueuedMethod * obj);
static GType zeitgeist_queued_proxy_wrapper_queued_method_get_type_once (void);
static void zeitgeist_queued_proxy_wrapper_finalize (GObject * obj);
static GType zeitgeist_queued_proxy_wrapper_get_type_once (void);
static void _vala_zeitgeist_queued_proxy_wrapper_get_property (GObject * object,
                                                        guint property_id,
                                                        GValue * value,
                                                        GParamSpec * pspec);
static void _vala_zeitgeist_queued_proxy_wrapper_set_property (GObject * object,
                                                        guint property_id,
                                                        const GValue * value,
                                                        GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
zeitgeist_queued_proxy_wrapper_get_instance_private (ZeitgeistQueuedProxyWrapper* self)
{
	return G_STRUCT_MEMBER_P (self, ZeitgeistQueuedProxyWrapper_private_offset);
}

static void
_zeitgeist_queued_proxy_wrapper_queued_method_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (zeitgeist_queued_proxy_wrapper_queued_method_unref (var), NULL));
}

static inline void
_g_slist_free__zeitgeist_queued_proxy_wrapper_queued_method_unref0_ (GSList* self)
{
	g_slist_free_full (self, (GDestroyNotify) _zeitgeist_queued_proxy_wrapper_queued_method_unref0_);
}

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

static void
_zeitgeist_queued_proxy_wrapper_name_owner_changed_g_object_notify (GObject* _sender,
                                                                    GParamSpec* pspec,
                                                                    gpointer self)
{
	zeitgeist_queued_proxy_wrapper_name_owner_changed ((ZeitgeistQueuedProxyWrapper*) self, pspec);
}

void
zeitgeist_queued_proxy_wrapper_proxy_acquired (ZeitgeistQueuedProxyWrapper* self,
                                               GObject* proxy)
{
	GDBusProxy* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (proxy != NULL);
	zeitgeist_queued_proxy_wrapper_set_is_connected (self, TRUE);
	zeitgeist_queued_proxy_wrapper_set_proxy_created (self, TRUE);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (proxy, g_dbus_proxy_get_type ()) ? ((GDBusProxy*) proxy) : NULL);
	_g_object_unref0 (self->priv->dbus_proxy);
	self->priv->dbus_proxy = _tmp0_;
	g_signal_connect_object (proxy, "notify::g-name-owner", (GCallback) _zeitgeist_queued_proxy_wrapper_name_owner_changed_g_object_notify, self, 0);
	zeitgeist_queued_proxy_wrapper_on_connection_established (self);
	zeitgeist_queued_proxy_wrapper_process_queued_methods (self);
}

static gpointer
_g_error_copy0 (gpointer self)
{
	return self ? g_error_copy (self) : NULL;
}

void
zeitgeist_queued_proxy_wrapper_proxy_unavailable (ZeitgeistQueuedProxyWrapper* self,
                                                  GError* err)
{
	GError* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_error_copy0 (err);
	_g_error_free0 (self->priv->log_error);
	self->priv->log_error = _tmp0_;
	zeitgeist_queued_proxy_wrapper_process_queued_methods (self);
}

static gpointer
_zeitgeist_queued_proxy_wrapper_queued_method_ref0 (gpointer self)
{
	return self ? zeitgeist_queued_proxy_wrapper_queued_method_ref (self) : NULL;
}

void
zeitgeist_queued_proxy_wrapper_process_queued_methods (ZeitgeistQueuedProxyWrapper* self)
{
	GSList* _tmp0_;
	g_return_if_fail (self != NULL);
	self->priv->method_dispatch_queue = g_slist_reverse (self->priv->method_dispatch_queue);
	_tmp0_ = self->priv->method_dispatch_queue;
	{
		GSList* m_collection = NULL;
		GSList* m_it = NULL;
		m_collection = _tmp0_;
		for (m_it = m_collection; m_it != NULL; m_it = m_it->next) {
			ZeitgeistQueuedProxyWrapperQueuedMethod* _tmp1_;
			ZeitgeistQueuedProxyWrapperQueuedMethod* m = NULL;
			_tmp1_ = _zeitgeist_queued_proxy_wrapper_queued_method_ref0 ((ZeitgeistQueuedProxyWrapperQueuedMethod*) m_it->data);
			m = _tmp1_;
			{
				ZeitgeistQueuedProxyWrapperQueuedMethod* _tmp2_;
				GSourceFunc _tmp3_ = NULL;
				gpointer _tmp3__target = NULL;
				GSourceFunc _tmp4_;
				gpointer _tmp4__target;
				_tmp2_ = m;
				_tmp3_ = zeitgeist_queued_proxy_wrapper_queued_method_get_queued_method (_tmp2_, &_tmp3__target);
				_tmp4_ = _tmp3_;
				_tmp4__target = _tmp3__target;
				_tmp4_ (_tmp4__target);
				_zeitgeist_queued_proxy_wrapper_queued_method_unref0 (m);
			}
		}
	}
	(self->priv->method_dispatch_queue == NULL) ? NULL : (self->priv->method_dispatch_queue = (_g_slist_free__zeitgeist_queued_proxy_wrapper_queued_method_unref0_ (self->priv->method_dispatch_queue), NULL));
	self->priv->method_dispatch_queue = NULL;
}

void
zeitgeist_queued_proxy_wrapper_name_owner_changed (ZeitgeistQueuedProxyWrapper* self,
                                                   GParamSpec* pspec)
{
	gchar* name_owner = NULL;
	GDBusProxy* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	gboolean _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (pspec != NULL);
	_tmp0_ = self->priv->dbus_proxy;
	_tmp1_ = g_dbus_proxy_get_name_owner (_tmp0_);
	name_owner = _tmp1_;
	_tmp2_ = name_owner;
	zeitgeist_queued_proxy_wrapper_set_is_connected (self, _tmp2_ != NULL);
	_tmp3_ = self->priv->_is_connected;
	if (_tmp3_) {
		zeitgeist_queued_proxy_wrapper_on_connection_established (self);
	} else {
		zeitgeist_queued_proxy_wrapper_on_connection_lost (self);
	}
	_g_free0 (name_owner);
}

static void
zeitgeist_queued_proxy_wrapper_real_on_connection_established (ZeitgeistQueuedProxyWrapper* self)
{
	g_critical ("Type `%s' does not implement abstract method `zeitgeist_queued_proxy_wrapper_on_connection_established'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}

void
zeitgeist_queued_proxy_wrapper_on_connection_established (ZeitgeistQueuedProxyWrapper* self)
{
	ZeitgeistQueuedProxyWrapperClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = ZEITGEIST_QUEUED_PROXY_WRAPPER_GET_CLASS (self);
	if (_klass_->on_connection_established) {
		_klass_->on_connection_established (self);
	}
}

static void
zeitgeist_queued_proxy_wrapper_real_on_connection_lost (ZeitgeistQueuedProxyWrapper* self)
{
	g_critical ("Type `%s' does not implement abstract method `zeitgeist_queued_proxy_wrapper_on_connection_lost'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}

void
zeitgeist_queued_proxy_wrapper_on_connection_lost (ZeitgeistQueuedProxyWrapper* self)
{
	ZeitgeistQueuedProxyWrapperClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = ZEITGEIST_QUEUED_PROXY_WRAPPER_GET_CLASS (self);
	if (_klass_->on_connection_lost) {
		_klass_->on_connection_lost (self);
	}
}

static void
zeitgeist_queued_proxy_wrapper_wait_for_proxy_data_free (gpointer _data)
{
	ZeitgeistQueuedProxyWrapperWaitForProxyData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (ZeitgeistQueuedProxyWrapperWaitForProxyData, _data_);
}

void
zeitgeist_queued_proxy_wrapper_wait_for_proxy (ZeitgeistQueuedProxyWrapper* self,
                                               GAsyncReadyCallback _callback_,
                                               gpointer _user_data_)
{
	ZeitgeistQueuedProxyWrapperWaitForProxyData* _data_;
	ZeitgeistQueuedProxyWrapper* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (ZeitgeistQueuedProxyWrapperWaitForProxyData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, zeitgeist_queued_proxy_wrapper_wait_for_proxy_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	zeitgeist_queued_proxy_wrapper_wait_for_proxy_co (_data_);
}

void
zeitgeist_queued_proxy_wrapper_wait_for_proxy_finish (ZeitgeistQueuedProxyWrapper* self,
                                                      GAsyncResult* _res_,
                                                      GError** error)
{
	ZeitgeistQueuedProxyWrapperWaitForProxyData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static gboolean
_zeitgeist_queued_proxy_wrapper_wait_for_proxy_co_gsource_func (gpointer self)
{
	gboolean result;
	result = zeitgeist_queued_proxy_wrapper_wait_for_proxy_co (self);
	return result;
}

static gboolean
zeitgeist_queued_proxy_wrapper_wait_for_proxy_co (ZeitgeistQueuedProxyWrapperWaitForProxyData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_proxy_created;
	if (G_LIKELY (_data_->_tmp0_)) {
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp1_ = _data_->self->priv->method_dispatch_queue;
	if (_data_->_tmp1_ == NULL) {
		(_data_->self->priv->method_dispatch_queue == NULL) ? NULL : (_data_->self->priv->method_dispatch_queue = (_g_slist_free__zeitgeist_queued_proxy_wrapper_queued_method_unref0_ (_data_->self->priv->method_dispatch_queue), NULL));
		_data_->self->priv->method_dispatch_queue = NULL;
	}
	_data_->_tmp2_ = zeitgeist_queued_proxy_wrapper_queued_method_new (_zeitgeist_queued_proxy_wrapper_wait_for_proxy_co_gsource_func, _data_, NULL);
	_data_->self->priv->method_dispatch_queue = g_slist_prepend (_data_->self->priv->method_dispatch_queue, _data_->_tmp2_);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	_data_->_tmp3_ = _data_->self->priv->log_error;
	if (_data_->_tmp3_ != NULL) {
		_data_->_tmp4_ = _data_->self->priv->log_error;
		_data_->_tmp5_ = _g_error_copy0 (_data_->_tmp4_);
		_data_->_inner_error0_ = _data_->_tmp5_;
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

ZeitgeistQueuedProxyWrapper*
zeitgeist_queued_proxy_wrapper_construct (GType object_type)
{
	ZeitgeistQueuedProxyWrapper * self = NULL;
	self = (ZeitgeistQueuedProxyWrapper*) g_object_new (object_type, NULL);
	return self;
}

gboolean
zeitgeist_queued_proxy_wrapper_get_proxy_created (ZeitgeistQueuedProxyWrapper* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_proxy_created;
	return result;
}

static void
zeitgeist_queued_proxy_wrapper_set_proxy_created (ZeitgeistQueuedProxyWrapper* self,
                                                  gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = zeitgeist_queued_proxy_wrapper_get_proxy_created (self);
	if (old_value != value) {
		self->priv->_proxy_created = value;
		g_object_notify_by_pspec ((GObject *) self, zeitgeist_queued_proxy_wrapper_properties[ZEITGEIST_QUEUED_PROXY_WRAPPER_PROXY_CREATED_PROPERTY]);
	}
}

gboolean
zeitgeist_queued_proxy_wrapper_get_is_connected (ZeitgeistQueuedProxyWrapper* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_connected;
	return result;
}

static void
zeitgeist_queued_proxy_wrapper_set_is_connected (ZeitgeistQueuedProxyWrapper* self,
                                                 gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = zeitgeist_queued_proxy_wrapper_get_is_connected (self);
	if (old_value != value) {
		self->priv->_is_connected = value;
		g_object_notify_by_pspec ((GObject *) self, zeitgeist_queued_proxy_wrapper_properties[ZEITGEIST_QUEUED_PROXY_WRAPPER_IS_CONNECTED_PROPERTY]);
	}
}

static inline gpointer
zeitgeist_queued_proxy_wrapper_queued_method_get_instance_private (ZeitgeistQueuedProxyWrapperQueuedMethod* self)
{
	return G_STRUCT_MEMBER_P (self, ZeitgeistQueuedProxyWrapperQueuedMethod_private_offset);
}

ZeitgeistQueuedProxyWrapperQueuedMethod*
zeitgeist_queued_proxy_wrapper_queued_method_construct (GType object_type,
                                                        GSourceFunc callback,
                                                        gpointer callback_target,
                                                        GDestroyNotify callback_target_destroy_notify)
{
	ZeitgeistQueuedProxyWrapperQueuedMethod* self = NULL;
	GSourceFunc _tmp0_;
	gpointer _tmp0__target;
	GDestroyNotify _tmp0__target_destroy_notify;
	self = (ZeitgeistQueuedProxyWrapperQueuedMethod*) g_type_create_instance (object_type);
	_tmp0_ = callback;
	_tmp0__target = callback_target;
	_tmp0__target_destroy_notify = callback_target_destroy_notify;
	callback = NULL;
	callback_target = NULL;
	callback_target_destroy_notify = NULL;
	zeitgeist_queued_proxy_wrapper_queued_method_set_queued_method (self, _tmp0_, _tmp0__target, _tmp0__target_destroy_notify);
	(callback_target_destroy_notify == NULL) ? NULL : (callback_target_destroy_notify (callback_target), NULL);
	callback = NULL;
	callback_target = NULL;
	callback_target_destroy_notify = NULL;
	return self;
}

ZeitgeistQueuedProxyWrapperQueuedMethod*
zeitgeist_queued_proxy_wrapper_queued_method_new (GSourceFunc callback,
                                                  gpointer callback_target,
                                                  GDestroyNotify callback_target_destroy_notify)
{
	return zeitgeist_queued_proxy_wrapper_queued_method_construct (ZEITGEIST_QUEUED_PROXY_WRAPPER_TYPE_QUEUED_METHOD, callback, callback_target, callback_target_destroy_notify);
}

GSourceFunc
zeitgeist_queued_proxy_wrapper_queued_method_get_queued_method (ZeitgeistQueuedProxyWrapperQueuedMethod* self,
                                                                gpointer* result_target)
{
	GSourceFunc result;
	GSourceFunc _tmp0_;
	gpointer _tmp0__target;
	GSourceFunc _tmp1_;
	gpointer _tmp1__target;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_queued_method;
	_tmp0__target = self->priv->_queued_method_target;
	_tmp1_ = _tmp0_;
	_tmp1__target = _tmp0__target;
	*result_target = _tmp1__target;
	result = _tmp1_;
	return result;
}

static void
zeitgeist_queued_proxy_wrapper_queued_method_set_queued_method (ZeitgeistQueuedProxyWrapperQueuedMethod* self,
                                                                GSourceFunc value,
                                                                gpointer value_target,
                                                                GDestroyNotify value_target_destroy_notify)
{
	GSourceFunc _tmp0_;
	gpointer _tmp0__target;
	GDestroyNotify _tmp0__target_destroy_notify;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp0__target = value_target;
	_tmp0__target_destroy_notify = value_target_destroy_notify;
	value = NULL;
	value_target = NULL;
	value_target_destroy_notify = NULL;
	(self->priv->_queued_method_target_destroy_notify == NULL) ? NULL : (self->priv->_queued_method_target_destroy_notify (self->priv->_queued_method_target), NULL);
	self->priv->_queued_method = NULL;
	self->priv->_queued_method_target = NULL;
	self->priv->_queued_method_target_destroy_notify = NULL;
	self->priv->_queued_method = _tmp0_;
	self->priv->_queued_method_target = _tmp0__target;
	self->priv->_queued_method_target_destroy_notify = _tmp0__target_destroy_notify;
	(value_target_destroy_notify == NULL) ? NULL : (value_target_destroy_notify (value_target), NULL);
	value = NULL;
	value_target = NULL;
	value_target_destroy_notify = NULL;
}

static void
zeitgeist_queued_proxy_wrapper_value_queued_method_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
zeitgeist_queued_proxy_wrapper_value_queued_method_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		zeitgeist_queued_proxy_wrapper_queued_method_unref (value->data[0].v_pointer);
	}
}

static void
zeitgeist_queued_proxy_wrapper_value_queued_method_copy_value (const GValue* src_value,
                                                               GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = zeitgeist_queued_proxy_wrapper_queued_method_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
zeitgeist_queued_proxy_wrapper_value_queued_method_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
zeitgeist_queued_proxy_wrapper_value_queued_method_collect_value (GValue* value,
                                                                  guint n_collect_values,
                                                                  GTypeCValue* collect_values,
                                                                  guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		ZeitgeistQueuedProxyWrapperQueuedMethod * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = zeitgeist_queued_proxy_wrapper_queued_method_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
zeitgeist_queued_proxy_wrapper_value_queued_method_lcopy_value (const GValue* value,
                                                                guint n_collect_values,
                                                                GTypeCValue* collect_values,
                                                                guint collect_flags)
{
	ZeitgeistQueuedProxyWrapperQueuedMethod ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = zeitgeist_queued_proxy_wrapper_queued_method_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
zeitgeist_queued_proxy_wrapper_param_spec_queued_method (const gchar* name,
                                                         const gchar* nick,
                                                         const gchar* blurb,
                                                         GType object_type,
                                                         GParamFlags flags)
{
	ZeitgeistQueuedProxyWrapperParamSpecQueuedMethod* spec;
	g_return_val_if_fail (g_type_is_a (object_type, ZEITGEIST_QUEUED_PROXY_WRAPPER_TYPE_QUEUED_METHOD), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

gpointer
zeitgeist_queued_proxy_wrapper_value_get_queued_method (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, ZEITGEIST_QUEUED_PROXY_WRAPPER_TYPE_QUEUED_METHOD), NULL);
	return value->data[0].v_pointer;
}

void
zeitgeist_queued_proxy_wrapper_value_set_queued_method (GValue* value,
                                                        gpointer v_object)
{
	ZeitgeistQueuedProxyWrapperQueuedMethod * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, ZEITGEIST_QUEUED_PROXY_WRAPPER_TYPE_QUEUED_METHOD));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, ZEITGEIST_QUEUED_PROXY_WRAPPER_TYPE_QUEUED_METHOD));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		zeitgeist_queued_proxy_wrapper_queued_method_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		zeitgeist_queued_proxy_wrapper_queued_method_unref (old);
	}
}

void
zeitgeist_queued_proxy_wrapper_value_take_queued_method (GValue* value,
                                                         gpointer v_object)
{
	ZeitgeistQueuedProxyWrapperQueuedMethod * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, ZEITGEIST_QUEUED_PROXY_WRAPPER_TYPE_QUEUED_METHOD));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, ZEITGEIST_QUEUED_PROXY_WRAPPER_TYPE_QUEUED_METHOD));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		zeitgeist_queued_proxy_wrapper_queued_method_unref (old);
	}
}

static void
zeitgeist_queued_proxy_wrapper_queued_method_class_init (ZeitgeistQueuedProxyWrapperQueuedMethodClass * klass,
                                                         gpointer klass_data)
{
	zeitgeist_queued_proxy_wrapper_queued_method_parent_class = g_type_class_peek_parent (klass);
	((ZeitgeistQueuedProxyWrapperQueuedMethodClass *) klass)->finalize = zeitgeist_queued_proxy_wrapper_queued_method_finalize;
	g_type_class_adjust_private_offset (klass, &ZeitgeistQueuedProxyWrapperQueuedMethod_private_offset);
}

static void
zeitgeist_queued_proxy_wrapper_queued_method_instance_init (ZeitgeistQueuedProxyWrapperQueuedMethod * self,
                                                            gpointer klass)
{
	self->priv = zeitgeist_queued_proxy_wrapper_queued_method_get_instance_private (self);
	self->ref_count = 1;
}

static void
zeitgeist_queued_proxy_wrapper_queued_method_finalize (ZeitgeistQueuedProxyWrapperQueuedMethod * obj)
{
	ZeitgeistQueuedProxyWrapperQueuedMethod * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ZEITGEIST_QUEUED_PROXY_WRAPPER_TYPE_QUEUED_METHOD, ZeitgeistQueuedProxyWrapperQueuedMethod);
	g_signal_handlers_destroy (self);
	(self->priv->_queued_method_target_destroy_notify == NULL) ? NULL : (self->priv->_queued_method_target_destroy_notify (self->priv->_queued_method_target), NULL);
	self->priv->_queued_method = NULL;
	self->priv->_queued_method_target = NULL;
	self->priv->_queued_method_target_destroy_notify = NULL;
}

static GType
zeitgeist_queued_proxy_wrapper_queued_method_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { zeitgeist_queued_proxy_wrapper_value_queued_method_init, zeitgeist_queued_proxy_wrapper_value_queued_method_free_value, zeitgeist_queued_proxy_wrapper_value_queued_method_copy_value, zeitgeist_queued_proxy_wrapper_value_queued_method_peek_pointer, "p", zeitgeist_queued_proxy_wrapper_value_queued_method_collect_value, "p", zeitgeist_queued_proxy_wrapper_value_queued_method_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (ZeitgeistQueuedProxyWrapperQueuedMethodClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) zeitgeist_queued_proxy_wrapper_queued_method_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ZeitgeistQueuedProxyWrapperQueuedMethod), 0, (GInstanceInitFunc) zeitgeist_queued_proxy_wrapper_queued_method_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType zeitgeist_queued_proxy_wrapper_queued_method_type_id;
	zeitgeist_queued_proxy_wrapper_queued_method_type_id = g_type_register_fundamental (g_type_fundamental_next (), "ZeitgeistQueuedProxyWrapperQueuedMethod", &g_define_type_info, &g_define_type_fundamental_info, 0);
	ZeitgeistQueuedProxyWrapperQueuedMethod_private_offset = g_type_add_instance_private (zeitgeist_queued_proxy_wrapper_queued_method_type_id, sizeof (ZeitgeistQueuedProxyWrapperQueuedMethodPrivate));
	return zeitgeist_queued_proxy_wrapper_queued_method_type_id;
}

GType
zeitgeist_queued_proxy_wrapper_queued_method_get_type (void)
{
	static volatile gsize zeitgeist_queued_proxy_wrapper_queued_method_type_id__once = 0;
	if (g_once_init_enter (&zeitgeist_queued_proxy_wrapper_queued_method_type_id__once)) {
		GType zeitgeist_queued_proxy_wrapper_queued_method_type_id;
		zeitgeist_queued_proxy_wrapper_queued_method_type_id = zeitgeist_queued_proxy_wrapper_queued_method_get_type_once ();
		g_once_init_leave (&zeitgeist_queued_proxy_wrapper_queued_method_type_id__once, zeitgeist_queued_proxy_wrapper_queued_method_type_id);
	}
	return zeitgeist_queued_proxy_wrapper_queued_method_type_id__once;
}

gpointer
zeitgeist_queued_proxy_wrapper_queued_method_ref (gpointer instance)
{
	ZeitgeistQueuedProxyWrapperQueuedMethod * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

void
zeitgeist_queued_proxy_wrapper_queued_method_unref (gpointer instance)
{
	ZeitgeistQueuedProxyWrapperQueuedMethod * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		ZEITGEIST_QUEUED_PROXY_WRAPPER_QUEUED_METHOD_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static void
zeitgeist_queued_proxy_wrapper_class_init (ZeitgeistQueuedProxyWrapperClass * klass,
                                           gpointer klass_data)
{
	zeitgeist_queued_proxy_wrapper_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ZeitgeistQueuedProxyWrapper_private_offset);
	((ZeitgeistQueuedProxyWrapperClass *) klass)->on_connection_established = (void (*) (ZeitgeistQueuedProxyWrapper*)) zeitgeist_queued_proxy_wrapper_real_on_connection_established;
	((ZeitgeistQueuedProxyWrapperClass *) klass)->on_connection_lost = (void (*) (ZeitgeistQueuedProxyWrapper*)) zeitgeist_queued_proxy_wrapper_real_on_connection_lost;
	G_OBJECT_CLASS (klass)->get_property = _vala_zeitgeist_queued_proxy_wrapper_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_zeitgeist_queued_proxy_wrapper_set_property;
	G_OBJECT_CLASS (klass)->finalize = zeitgeist_queued_proxy_wrapper_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), ZEITGEIST_QUEUED_PROXY_WRAPPER_PROXY_CREATED_PROPERTY, zeitgeist_queued_proxy_wrapper_properties[ZEITGEIST_QUEUED_PROXY_WRAPPER_PROXY_CREATED_PROPERTY] = g_param_spec_boolean ("proxy-created", "proxy-created", "proxy-created", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), ZEITGEIST_QUEUED_PROXY_WRAPPER_IS_CONNECTED_PROPERTY, zeitgeist_queued_proxy_wrapper_properties[ZEITGEIST_QUEUED_PROXY_WRAPPER_IS_CONNECTED_PROPERTY] = g_param_spec_boolean ("is-connected", "is-connected", "is-connected", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
zeitgeist_queued_proxy_wrapper_instance_init (ZeitgeistQueuedProxyWrapper * self,
                                              gpointer klass)
{
	self->priv = zeitgeist_queued_proxy_wrapper_get_instance_private (self);
	self->priv->_proxy_created = FALSE;
	self->priv->_is_connected = FALSE;
}

static void
zeitgeist_queued_proxy_wrapper_finalize (GObject * obj)
{
	ZeitgeistQueuedProxyWrapper * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ZEITGEIST_TYPE_QUEUED_PROXY_WRAPPER, ZeitgeistQueuedProxyWrapper);
	(self->priv->method_dispatch_queue == NULL) ? NULL : (self->priv->method_dispatch_queue = (_g_slist_free__zeitgeist_queued_proxy_wrapper_queued_method_unref0_ (self->priv->method_dispatch_queue), NULL));
	_g_error_free0 (self->priv->log_error);
	_g_object_unref0 (self->priv->dbus_proxy);
	G_OBJECT_CLASS (zeitgeist_queued_proxy_wrapper_parent_class)->finalize (obj);
}

static GType
zeitgeist_queued_proxy_wrapper_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ZeitgeistQueuedProxyWrapperClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) zeitgeist_queued_proxy_wrapper_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ZeitgeistQueuedProxyWrapper), 0, (GInstanceInitFunc) zeitgeist_queued_proxy_wrapper_instance_init, NULL };
	GType zeitgeist_queued_proxy_wrapper_type_id;
	zeitgeist_queued_proxy_wrapper_type_id = g_type_register_static (G_TYPE_OBJECT, "ZeitgeistQueuedProxyWrapper", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	ZeitgeistQueuedProxyWrapper_private_offset = g_type_add_instance_private (zeitgeist_queued_proxy_wrapper_type_id, sizeof (ZeitgeistQueuedProxyWrapperPrivate));
	return zeitgeist_queued_proxy_wrapper_type_id;
}

GType
zeitgeist_queued_proxy_wrapper_get_type (void)
{
	static volatile gsize zeitgeist_queued_proxy_wrapper_type_id__once = 0;
	if (g_once_init_enter (&zeitgeist_queued_proxy_wrapper_type_id__once)) {
		GType zeitgeist_queued_proxy_wrapper_type_id;
		zeitgeist_queued_proxy_wrapper_type_id = zeitgeist_queued_proxy_wrapper_get_type_once ();
		g_once_init_leave (&zeitgeist_queued_proxy_wrapper_type_id__once, zeitgeist_queued_proxy_wrapper_type_id);
	}
	return zeitgeist_queued_proxy_wrapper_type_id__once;
}

static void
_vala_zeitgeist_queued_proxy_wrapper_get_property (GObject * object,
                                                   guint property_id,
                                                   GValue * value,
                                                   GParamSpec * pspec)
{
	ZeitgeistQueuedProxyWrapper * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, ZEITGEIST_TYPE_QUEUED_PROXY_WRAPPER, ZeitgeistQueuedProxyWrapper);
	switch (property_id) {
		case ZEITGEIST_QUEUED_PROXY_WRAPPER_PROXY_CREATED_PROPERTY:
		g_value_set_boolean (value, zeitgeist_queued_proxy_wrapper_get_proxy_created (self));
		break;
		case ZEITGEIST_QUEUED_PROXY_WRAPPER_IS_CONNECTED_PROPERTY:
		g_value_set_boolean (value, zeitgeist_queued_proxy_wrapper_get_is_connected (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_zeitgeist_queued_proxy_wrapper_set_property (GObject * object,
                                                   guint property_id,
                                                   const GValue * value,
                                                   GParamSpec * pspec)
{
	ZeitgeistQueuedProxyWrapper * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, ZEITGEIST_TYPE_QUEUED_PROXY_WRAPPER, ZeitgeistQueuedProxyWrapper);
	switch (property_id) {
		case ZEITGEIST_QUEUED_PROXY_WRAPPER_PROXY_CREATED_PROPERTY:
		zeitgeist_queued_proxy_wrapper_set_proxy_created (self, g_value_get_boolean (value));
		break;
		case ZEITGEIST_QUEUED_PROXY_WRAPPER_IS_CONNECTED_PROPERTY:
		zeitgeist_queued_proxy_wrapper_set_is_connected (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

