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

/*
 * Copyright © 2016 Alain M. (https://github.com/alainm23/planner)
 *
 * 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 3 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
 *
 * Authored by: Alain M. <alainmh23@gmail.com>
 */

#include <glib-object.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.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
#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 TYPE_DBUS_CLIENT_INTERFACE (dbus_client_interface_get_type ())
#define DBUS_CLIENT_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DBUS_CLIENT_INTERFACE, DBusClientInterface))
#define IS_DBUS_CLIENT_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DBUS_CLIENT_INTERFACE))
#define DBUS_CLIENT_INTERFACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_DBUS_CLIENT_INTERFACE, DBusClientInterfaceIface))

typedef struct _DBusClientInterface DBusClientInterface;
typedef struct _DBusClientInterfaceIface DBusClientInterfaceIface;

#define TYPE_DBUS_CLIENT_INTERFACE_PROXY (dbus_client_interface_proxy_get_type ())
typedef GDBusProxy DBusClientInterfaceProxy;
typedef GDBusProxyClass DBusClientInterfaceProxyClass;
#define _g_free0(var) (var = (g_free (var), NULL))

#define TYPE_DBUS_CLIENT (dbus_client_get_type ())
#define DBUS_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DBUS_CLIENT, DBusClient))
#define DBUS_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DBUS_CLIENT, DBusClientClass))
#define IS_DBUS_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DBUS_CLIENT))
#define IS_DBUS_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DBUS_CLIENT))
#define DBUS_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DBUS_CLIENT, DBusClientClass))

typedef struct _DBusClient DBusClient;
typedef struct _DBusClientClass DBusClientClass;
typedef struct _DBusClientPrivate DBusClientPrivate;
enum  {
	DBUS_CLIENT_0_PROPERTY,
	DBUS_CLIENT_NUM_PROPERTIES
};
static GParamSpec* dbus_client_properties[DBUS_CLIENT_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

struct _DBusClientInterfaceIface {
	GTypeInterface parent_iface;
	void (*add_item) (DBusClientInterface* self, const gchar* id, GError** error);
	void (*update_item) (DBusClientInterface* self, const gchar* id, GError** error);
};

struct _DBusClient {
	GObject parent_instance;
	DBusClientPrivate * priv;
	DBusClientInterface* interface;
};

struct _DBusClientClass {
	GObjectClass parent_class;
};

static gpointer dbus_client_parent_class = NULL;
static GOnce dbus_client_instance;
static GOnce dbus_client_instance = G_ONCE_INIT;

VALA_EXTERN GType dbus_client_interface_proxy_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint dbus_client_interface_register_object (void* object,
                                             GDBusConnection* connection,
                                             const gchar* path,
                                             GError** error);
VALA_EXTERN GType dbus_client_interface_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DBusClientInterface, g_object_unref)
VALA_EXTERN void dbus_client_interface_add_item (DBusClientInterface* self,
                                     const gchar* id,
                                     GError** error);
VALA_EXTERN void dbus_client_interface_update_item (DBusClientInterface* self,
                                        const gchar* id,
                                        GError** error);
static GType dbus_client_interface_get_type_once (void);
static void dbus_client_interface_proxy_g_signal (GDBusProxy* proxy,
                                           const gchar* sender_name,
                                           const gchar* signal_name,
                                           GVariant* parameters);
static void dbus_client_interface_proxy_add_item (DBusClientInterface* self,
                                           const gchar* id,
                                           GError** error);
static void dbus_client_interface_proxy_update_item (DBusClientInterface* self,
                                              const gchar* id,
                                              GError** error);
static void dbus_client_interface_proxy_dbus_client_interface_interface_init (DBusClientInterfaceIface* iface);
static void _dbus_dbus_client_interface_add_item (DBusClientInterface* self,
                                           GVariant* _parameters_,
                                           GDBusMethodInvocation* invocation);
static void _dbus_dbus_client_interface_update_item (DBusClientInterface* self,
                                              GVariant* _parameters_,
                                              GDBusMethodInvocation* invocation);
static void dbus_client_interface_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* dbus_client_interface_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 dbus_client_interface_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_client_interface_unregister_object (gpointer user_data);
VALA_EXTERN GType dbus_client_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DBusClient, g_object_unref)
VALA_EXTERN DBusClient* dbus_client_get_default (void);
static DBusClient* __lambda4_ (void);
VALA_EXTERN DBusClient* dbus_client_new (void);
VALA_EXTERN DBusClient* dbus_client_construct (GType object_type);
static gpointer ___lambda4__gthread_func (gpointer self);
static GObject * dbus_client_constructor (GType type,
                                   guint n_construct_properties,
                                   GObjectConstructParam * construct_properties);
static void dbus_client_finalize (GObject * obj);
static GType dbus_client_get_type_once (void);

static const GDBusArgInfo _dbus_client_interface_dbus_arg_info_add_item_id = {-1, "id", "s", NULL};
static const GDBusArgInfo * const _dbus_client_interface_dbus_arg_info_add_item_in[] = {&_dbus_client_interface_dbus_arg_info_add_item_id, NULL};
static const GDBusArgInfo * const _dbus_client_interface_dbus_arg_info_add_item_out[] = {NULL};
static const GDBusMethodInfo _dbus_client_interface_dbus_method_info_add_item = {-1, "AddItem", (GDBusArgInfo **) (&_dbus_client_interface_dbus_arg_info_add_item_in), (GDBusArgInfo **) (&_dbus_client_interface_dbus_arg_info_add_item_out), NULL};
static const GDBusArgInfo _dbus_client_interface_dbus_arg_info_update_item_id = {-1, "id", "s", NULL};
static const GDBusArgInfo * const _dbus_client_interface_dbus_arg_info_update_item_in[] = {&_dbus_client_interface_dbus_arg_info_update_item_id, NULL};
static const GDBusArgInfo * const _dbus_client_interface_dbus_arg_info_update_item_out[] = {NULL};
static const GDBusMethodInfo _dbus_client_interface_dbus_method_info_update_item = {-1, "UpdateItem", (GDBusArgInfo **) (&_dbus_client_interface_dbus_arg_info_update_item_in), (GDBusArgInfo **) (&_dbus_client_interface_dbus_arg_info_update_item_out), NULL};
static const GDBusMethodInfo * const _dbus_client_interface_dbus_method_info[] = {&_dbus_client_interface_dbus_method_info_add_item, &_dbus_client_interface_dbus_method_info_update_item, NULL};
static const GDBusSignalInfo * const _dbus_client_interface_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo * const _dbus_client_interface_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _dbus_client_interface_dbus_interface_info = {-1, "io.github.alainm23.planify", (GDBusMethodInfo **) (&_dbus_client_interface_dbus_method_info), (GDBusSignalInfo **) (&_dbus_client_interface_dbus_signal_info), (GDBusPropertyInfo **) (&_dbus_client_interface_dbus_property_info), NULL};
static const GDBusInterfaceVTable _dbus_client_interface_dbus_interface_vtable = {dbus_client_interface_dbus_interface_method_call, dbus_client_interface_dbus_interface_get_property, dbus_client_interface_dbus_interface_set_property};

void
dbus_client_interface_add_item (DBusClientInterface* self,
                                const gchar* id,
                                GError** error)
{
	DBusClientInterfaceIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = DBUS_CLIENT_INTERFACE_GET_INTERFACE (self);
	if (_iface_->add_item) {
		_iface_->add_item (self, id, error);
	}
}

void
dbus_client_interface_update_item (DBusClientInterface* self,
                                   const gchar* id,
                                   GError** error)
{
	DBusClientInterfaceIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = DBUS_CLIENT_INTERFACE_GET_INTERFACE (self);
	if (_iface_->update_item) {
		_iface_->update_item (self, id, error);
	}
}

static void
dbus_client_interface_default_init (DBusClientInterfaceIface * iface,
                                    gpointer iface_data)
{
}

static GType
dbus_client_interface_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DBusClientInterfaceIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dbus_client_interface_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType dbus_client_interface_type_id;
	dbus_client_interface_type_id = g_type_register_static (G_TYPE_INTERFACE, "DBusClientInterface", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (dbus_client_interface_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (dbus_client_interface_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) dbus_client_interface_proxy_get_type);
	g_type_set_qdata (dbus_client_interface_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "io.github.alainm23.planify");
	g_type_set_qdata (dbus_client_interface_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_dbus_client_interface_dbus_interface_info));
	g_type_set_qdata (dbus_client_interface_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) dbus_client_interface_register_object);
	return dbus_client_interface_type_id;
}

GType
dbus_client_interface_get_type (void)
{
	static volatile gsize dbus_client_interface_type_id__once = 0;
	if (g_once_init_enter (&dbus_client_interface_type_id__once)) {
		GType dbus_client_interface_type_id;
		dbus_client_interface_type_id = dbus_client_interface_get_type_once ();
		g_once_init_leave (&dbus_client_interface_type_id__once, dbus_client_interface_type_id);
	}
	return dbus_client_interface_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (DBusClientInterfaceProxy, dbus_client_interface_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (TYPE_DBUS_CLIENT_INTERFACE, dbus_client_interface_proxy_dbus_client_interface_interface_init) )
static void
dbus_client_interface_proxy_class_init (DBusClientInterfaceProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = dbus_client_interface_proxy_g_signal;
}

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

static void
dbus_client_interface_proxy_init (DBusClientInterfaceProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_dbus_client_interface_dbus_interface_info));
}

static void
dbus_client_interface_proxy_add_item (DBusClientInterface* self,
                                      const gchar* id,
                                      GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "io.github.alainm23.planify", "AddItem");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (id));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	_reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error);
	g_object_unref (_message);
	if (!_reply_message) {
		return;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return;
	}
	g_object_unref (_reply_message);
}

static void
dbus_client_interface_proxy_update_item (DBusClientInterface* self,
                                         const gchar* id,
                                         GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "io.github.alainm23.planify", "UpdateItem");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (id));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	_reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error);
	g_object_unref (_message);
	if (!_reply_message) {
		return;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return;
	}
	g_object_unref (_reply_message);
}

static void
dbus_client_interface_proxy_dbus_client_interface_interface_init (DBusClientInterfaceIface* iface)
{
	iface->add_item = dbus_client_interface_proxy_add_item;
	iface->update_item = dbus_client_interface_proxy_update_item;
}

static void
_dbus_dbus_client_interface_add_item (DBusClientInterface* self,
                                      GVariant* _parameters_,
                                      GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gchar* id = NULL;
	GVariant* _tmp0_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp0_ = g_variant_iter_next_value (&_arguments_iter);
	id = g_variant_dup_string (_tmp0_, NULL);
	g_variant_unref (_tmp0_);
	dbus_client_interface_add_item (self, id, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	_g_free0 (id);
	;
}

static void
_dbus_dbus_client_interface_update_item (DBusClientInterface* self,
                                         GVariant* _parameters_,
                                         GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gchar* id = NULL;
	GVariant* _tmp1_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp1_ = g_variant_iter_next_value (&_arguments_iter);
	id = g_variant_dup_string (_tmp1_, NULL);
	g_variant_unref (_tmp1_);
	dbus_client_interface_update_item (self, id, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	_g_free0 (id);
	;
}

static void
dbus_client_interface_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, "AddItem") == 0) {
		_dbus_dbus_client_interface_add_item (object, parameters, invocation);
	} else if (strcmp (method_name, "UpdateItem") == 0) {
		_dbus_dbus_client_interface_update_item (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
dbus_client_interface_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)
{
	return NULL;
}

static gboolean
dbus_client_interface_dbus_interface_set_property (GDBusConnection* connection,
                                                   const gchar* sender,
                                                   const gchar* object_path,
                                                   const gchar* interface_name,
                                                   const gchar* property_name,
                                                   GVariant* value,
                                                   GError** error,
                                                   gpointer user_data)
{
	return FALSE;
}

guint
dbus_client_interface_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 *) (&_dbus_client_interface_dbus_interface_info), &_dbus_client_interface_dbus_interface_vtable, data, _dbus_client_interface_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}

static void
_dbus_client_interface_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 DBusClient*
__lambda4_ (void)
{
	DBusClient* _tmp0_;
	DBusClient* result;
	_tmp0_ = dbus_client_new ();
	result = _tmp0_;
	return result;
}

static gpointer
___lambda4__gthread_func (gpointer self)
{
	gpointer result;
	result = __lambda4_ ();
	return result;
}

DBusClient*
dbus_client_get_default (void)
{
	gconstpointer _tmp0_;
	DBusClient* result;
	_tmp0_ = g_once (&dbus_client_instance, ___lambda4__gthread_func, NULL);
	result = (DBusClient*) _tmp0_;
	return result;
}

DBusClient*
dbus_client_construct (GType object_type)
{
	DBusClient * self = NULL;
	self = (DBusClient*) g_object_new (object_type, NULL);
	return self;
}

DBusClient*
dbus_client_new (void)
{
	return dbus_client_construct (TYPE_DBUS_CLIENT);
}

static GObject *
dbus_client_constructor (GType type,
                         guint n_construct_properties,
                         GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	DBusClient * self;
	GError* _inner_error0_ = NULL;
	parent_class = G_OBJECT_CLASS (dbus_client_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_DBUS_CLIENT, DBusClient);
	{
		DBusClientInterface* _tmp0_ = NULL;
		DBusClientInterface* _tmp1_;
		DBusClientInterface* _tmp2_;
		_tmp1_ = (DBusClientInterface*) g_initable_new (TYPE_DBUS_CLIENT_INTERFACE_PROXY, NULL, &_inner_error0_, "g-flags", 0, "g-name", "io.github.alainm23.planify", "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/io/github/alainm23/planify", "g-interface-name", "io.github.alainm23.planify", NULL);
		_tmp0_ = (DBusClientInterface*) _tmp1_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_IO_ERROR) {
				goto __catch0_g_io_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
		}
		_tmp2_ = _tmp0_;
		_tmp0_ = NULL;
		_g_object_unref0 (self->interface);
		self->interface = _tmp2_;
		_g_object_unref0 (_tmp0_);
	}
	goto __finally0;
	__catch0_g_io_error:
	{
		GError* e = NULL;
		GError* _tmp3_;
		const gchar* _tmp4_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp3_ = e;
		_tmp4_ = _tmp3_->message;
		g_error ("DBusClient.vala:43: Monitor Indicator DBus: %s\n", _tmp4_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
	}
	return obj;
}

static void
dbus_client_class_init (DBusClientClass * klass,
                        gpointer klass_data)
{
	dbus_client_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->constructor = dbus_client_constructor;
	G_OBJECT_CLASS (klass)->finalize = dbus_client_finalize;
}

static void
dbus_client_instance_init (DBusClient * self,
                           gpointer klass)
{
	self->interface = NULL;
}

static void
dbus_client_finalize (GObject * obj)
{
	DBusClient * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_DBUS_CLIENT, DBusClient);
	_g_object_unref0 (self->interface);
	G_OBJECT_CLASS (dbus_client_parent_class)->finalize (obj);
}

static GType
dbus_client_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DBusClientClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dbus_client_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DBusClient), 0, (GInstanceInitFunc) dbus_client_instance_init, NULL };
	GType dbus_client_type_id;
	dbus_client_type_id = g_type_register_static (G_TYPE_OBJECT, "DBusClient", &g_define_type_info, 0);
	return dbus_client_type_id;
}

GType
dbus_client_get_type (void)
{
	static volatile gsize dbus_client_type_id__once = 0;
	if (g_once_init_enter (&dbus_client_type_id__once)) {
		GType dbus_client_type_id;
		dbus_client_type_id = dbus_client_get_type_once ();
		g_once_init_leave (&dbus_client_type_id__once, dbus_client_type_id);
	}
	return dbus_client_type_id__once;
}

