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

/* -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*-*/
/*  */
/*  Copyright (C) 2012 Slingshot Developers*/
/* */
/*  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, see <http://www.gnu.org/licenses/>.*/

#include "slingshot.h"
#include <glib-object.h>
#include <gio/gio.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.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 SLINGSHOT_DBUS_SERVICE_TYPE_SERVICE (slingshot_dbus_service_service_get_type ())
#define SLINGSHOT_DBUS_SERVICE_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SLINGSHOT_DBUS_SERVICE_TYPE_SERVICE, SlingshotDBusServiceService))
#define SLINGSHOT_DBUS_SERVICE_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SLINGSHOT_DBUS_SERVICE_TYPE_SERVICE, SlingshotDBusServiceServiceClass))
#define SLINGSHOT_DBUS_SERVICE_IS_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SLINGSHOT_DBUS_SERVICE_TYPE_SERVICE))
#define SLINGSHOT_DBUS_SERVICE_IS_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SLINGSHOT_DBUS_SERVICE_TYPE_SERVICE))
#define SLINGSHOT_DBUS_SERVICE_SERVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SLINGSHOT_DBUS_SERVICE_TYPE_SERVICE, SlingshotDBusServiceServiceClass))

typedef struct _SlingshotDBusServiceService SlingshotDBusServiceService;
typedef struct _SlingshotDBusServiceServiceClass SlingshotDBusServiceServiceClass;
enum  {
	SLINGSHOT_DBUS_SERVICE_0_PROPERTY,
	SLINGSHOT_DBUS_SERVICE_NUM_PROPERTIES
};
static GParamSpec* slingshot_dbus_service_properties[SLINGSHOT_DBUS_SERVICE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block2Data Block2Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _SlingshotDBusServiceServicePrivate SlingshotDBusServiceServicePrivate;
enum  {
	SLINGSHOT_DBUS_SERVICE_SERVICE_0_PROPERTY,
	SLINGSHOT_DBUS_SERVICE_SERVICE_NUM_PROPERTIES
};
static GParamSpec* slingshot_dbus_service_service_properties[SLINGSHOT_DBUS_SERVICE_SERVICE_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	SLINGSHOT_DBUS_SERVICE_SERVICE_VISIBILITY_CHANGED_SIGNAL,
	SLINGSHOT_DBUS_SERVICE_SERVICE_NUM_SIGNALS
};
static guint slingshot_dbus_service_service_signals[SLINGSHOT_DBUS_SERVICE_SERVICE_NUM_SIGNALS] = {0};

struct _SlingshotDBusServicePrivate {
	SlingshotDBusServiceService* service;
};

struct _Block2Data {
	int _ref_count_;
	SlingshotDBusService* self;
	SlingshotSlingshotView* view;
};

struct _SlingshotDBusServiceService {
	GObject parent_instance;
	SlingshotDBusServiceServicePrivate * priv;
};

struct _SlingshotDBusServiceServiceClass {
	GObjectClass parent_class;
};

struct _SlingshotDBusServiceServicePrivate {
	GtkWidget* view;
};

static gint SlingshotDBusService_private_offset;
static gpointer slingshot_dbus_service_parent_class = NULL;
static gint SlingshotDBusServiceService_private_offset;
static gpointer slingshot_dbus_service_service_parent_class = NULL;
static GType slingshot_dbus_service_service_type_id = 0;
static GType slingshot_dbus_service_type_id = 0;

GType slingshot_dbus_service_service_register_type (GTypeModule * module);
VALA_EXTERN GType slingshot_dbus_service_service_get_type (void) G_GNUC_CONST ;
static guint slingshot_dbus_service_service_register_object (void* object,
                                                      GDBusConnection* connection,
                                                      const gchar* path,
                                                      GError** error);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static void __lambda114_ (Block2Data* _data2_,
                   GDBusConnection* conn);
static void slingshot_dbus_service_on_bus_acquired (SlingshotDBusService* self,
                                             GDBusConnection* connection,
                                             SlingshotSlingshotView* view);
static void ___lambda114__gbus_acquired_callback (GDBusConnection* connection,
                                           const gchar* name,
                                           gpointer self);
static void slingshot_dbus_service_name_acquired_handler (SlingshotDBusService* self,
                                                   GDBusConnection* connection,
                                                   const gchar* name);
static void _slingshot_dbus_service_name_acquired_handler_gbus_name_acquired_callback (GDBusConnection* connection,
                                                                                const gchar* name,
                                                                                gpointer self);
static void __lambda115_ (Block2Data* _data2_);
static void ___lambda115__gbus_name_lost_callback (GDBusConnection* connection,
                                            const gchar* name,
                                            gpointer self);
static SlingshotDBusServiceService* slingshot_dbus_service_service_new (GtkWidget* view);
static SlingshotDBusServiceService* slingshot_dbus_service_service_construct (GType object_type,
                                                                       GtkWidget* view);
static void slingshot_dbus_service_service_on_view_visibility_change (SlingshotDBusServiceService* self);
static void _slingshot_dbus_service_service_on_view_visibility_change_gtk_widget_show (GtkWidget* _sender,
                                                                                gpointer self);
static void _slingshot_dbus_service_service_on_view_visibility_change_gtk_widget_hide (GtkWidget* _sender,
                                                                                gpointer self);
static void slingshot_dbus_service_service_finalize (GObject * obj);
static void slingshot_dbus_service_service_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* slingshot_dbus_service_service_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 slingshot_dbus_service_service_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_slingshot_dbus_service_service_visibility_changed (GObject* _sender,
                                                              gboolean launcher_visible,
                                                              gpointer* _data);
static void _slingshot_dbus_service_service_unregister_object (gpointer user_data);
static void slingshot_dbus_service_finalize (GObject * obj);

static const GDBusMethodInfo * const _slingshot_dbus_service_service_dbus_method_info[] = {NULL};
static const GDBusArgInfo _slingshot_dbus_service_service_dbus_arg_info_visibility_changed_launcher_visible = {-1, "launcher_visible", "b", NULL};
static const GDBusArgInfo * const _slingshot_dbus_service_service_dbus_arg_info_visibility_changed[] = {&_slingshot_dbus_service_service_dbus_arg_info_visibility_changed_launcher_visible, NULL};
static const GDBusSignalInfo _slingshot_dbus_service_service_dbus_signal_info_visibility_changed = {-1, "VisibilityChanged", (GDBusArgInfo **) (&_slingshot_dbus_service_service_dbus_arg_info_visibility_changed), NULL};
static const GDBusSignalInfo * const _slingshot_dbus_service_service_dbus_signal_info[] = {&_slingshot_dbus_service_service_dbus_signal_info_visibility_changed, NULL};
static const GDBusPropertyInfo * const _slingshot_dbus_service_service_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _slingshot_dbus_service_service_dbus_interface_info = {-1, "io.elementary.desktop.AppLauncherService", (GDBusMethodInfo **) (&_slingshot_dbus_service_service_dbus_method_info), (GDBusSignalInfo **) (&_slingshot_dbus_service_service_dbus_signal_info), (GDBusPropertyInfo **) (&_slingshot_dbus_service_service_dbus_property_info), NULL};
static const GDBusInterfaceVTable _slingshot_dbus_service_service_dbus_interface_vtable = {slingshot_dbus_service_service_dbus_interface_method_call, slingshot_dbus_service_service_dbus_interface_get_property, slingshot_dbus_service_service_dbus_interface_set_property};

static inline gpointer
slingshot_dbus_service_get_instance_private (SlingshotDBusService* self)
{
	return G_STRUCT_MEMBER_P (self, SlingshotDBusService_private_offset);
}

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

static Block2Data*
block2_data_ref (Block2Data* _data2_)
{
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}

static void
block2_data_unref (void * _userdata_)
{
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		SlingshotDBusService* self;
		self = _data2_->self;
		_g_object_unref0 (_data2_->view);
		_g_object_unref0 (self);
		g_slice_free (Block2Data, _data2_);
	}
}

static void
__lambda114_ (Block2Data* _data2_,
              GDBusConnection* conn)
{
	SlingshotDBusService* self;
	self = _data2_->self;
	g_return_if_fail (conn != NULL);
	slingshot_dbus_service_on_bus_acquired (self, conn, _data2_->view);
}

static void
___lambda114__gbus_acquired_callback (GDBusConnection* connection,
                                      const gchar* name,
                                      gpointer self)
{
	__lambda114_ (self, connection);
}

static void
_slingshot_dbus_service_name_acquired_handler_gbus_name_acquired_callback (GDBusConnection* connection,
                                                                           const gchar* name,
                                                                           gpointer self)
{
	slingshot_dbus_service_name_acquired_handler ((SlingshotDBusService*) self, connection, name);
}

static void
__lambda115_ (Block2Data* _data2_)
{
	SlingshotDBusService* self;
	self = _data2_->self;
	g_critical ("DBusService.vala:48: Could not acquire service name");
}

static void
___lambda115__gbus_name_lost_callback (GDBusConnection* connection,
                                       const gchar* name,
                                       gpointer self)
{
	__lambda115_ (self);
}

SlingshotDBusService*
slingshot_dbus_service_construct (GType object_type,
                                  SlingshotSlingshotView* view)
{
	SlingshotDBusService * self = NULL;
	Block2Data* _data2_;
	SlingshotSlingshotView* _tmp0_;
	g_return_val_if_fail (view != NULL, NULL);
	_data2_ = g_slice_new0 (Block2Data);
	_data2_->_ref_count_ = 1;
	_tmp0_ = _g_object_ref0 (view);
	_g_object_unref0 (_data2_->view);
	_data2_->view = _tmp0_;
	self = (SlingshotDBusService*) g_object_new (object_type, NULL);
	_data2_->self = g_object_ref (self);
	g_bus_own_name_with_closures (G_BUS_TYPE_SESSION, "io.elementary.desktop.AppLauncherService", G_BUS_NAME_OWNER_FLAGS_NONE, (GClosure*) ((___lambda114__gbus_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda114__gbus_acquired_callback, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref)), (GClosure*) ((_slingshot_dbus_service_name_acquired_handler_gbus_name_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) _slingshot_dbus_service_name_acquired_handler_gbus_name_acquired_callback, g_object_ref (self), (GClosureNotify) g_object_unref)), (GClosure*) ((___lambda115__gbus_name_lost_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda115__gbus_name_lost_callback, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref)));
	block2_data_unref (_data2_);
	_data2_ = NULL;
	return self;
}

SlingshotDBusService*
slingshot_dbus_service_new (SlingshotSlingshotView* view)
{
	return slingshot_dbus_service_construct (SLINGSHOT_TYPE_DBUS_SERVICE, view);
}

static void
slingshot_dbus_service_on_bus_acquired (SlingshotDBusService* self,
                                        GDBusConnection* connection,
                                        SlingshotSlingshotView* view)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (connection != NULL);
	g_return_if_fail (view != NULL);
	{
		SlingshotDBusServiceService* _tmp0_;
		SlingshotDBusServiceService* _tmp1_;
		_tmp0_ = slingshot_dbus_service_service_new ((GtkWidget*) view);
		_g_object_unref0 (self->priv->service);
		self->priv->service = _tmp0_;
		_tmp1_ = self->priv->service;
		slingshot_dbus_service_service_register_object (_tmp1_, connection, "/io/elementary/desktop/AppLauncherService", &_inner_error0_);
		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_);
			return;
		}
	}
	goto __finally0;
	__catch0_g_io_error:
	{
		GError* e = NULL;
		const gchar* _tmp2_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp2_ = e->message;
		g_critical ("DBusService.vala:58: Could not register service: %s", _tmp2_);
		g_return_if_reached ();
		_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;
	}
}

static void
slingshot_dbus_service_name_acquired_handler (SlingshotDBusService* self,
                                              GDBusConnection* connection,
                                              const gchar* name)
{
	SlingshotDBusServiceService* _tmp0_;
	SlingshotDBusServiceService* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (connection != NULL);
	g_return_if_fail (name != NULL);
	g_debug ("DBusService.vala:64: Service registration succeeded");
	_tmp0_ = self->priv->service;
	g_return_if_fail (_tmp0_ != NULL);
	_tmp1_ = self->priv->service;
	slingshot_dbus_service_service_on_view_visibility_change (_tmp1_);
}

static inline gpointer
slingshot_dbus_service_service_get_instance_private (SlingshotDBusServiceService* self)
{
	return G_STRUCT_MEMBER_P (self, SlingshotDBusServiceService_private_offset);
}

static void
_slingshot_dbus_service_service_on_view_visibility_change_gtk_widget_show (GtkWidget* _sender,
                                                                           gpointer self)
{
	slingshot_dbus_service_service_on_view_visibility_change ((SlingshotDBusServiceService*) self);
}

static void
_slingshot_dbus_service_service_on_view_visibility_change_gtk_widget_hide (GtkWidget* _sender,
                                                                           gpointer self)
{
	slingshot_dbus_service_service_on_view_visibility_change ((SlingshotDBusServiceService*) self);
}

static SlingshotDBusServiceService*
slingshot_dbus_service_service_construct (GType object_type,
                                          GtkWidget* view)
{
	SlingshotDBusServiceService * self = NULL;
	GtkWidget* _tmp0_;
	g_return_val_if_fail (view != NULL, NULL);
	self = (SlingshotDBusServiceService*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (view);
	_g_object_unref0 (self->priv->view);
	self->priv->view = _tmp0_;
	g_signal_connect_object (view, "show", (GCallback) _slingshot_dbus_service_service_on_view_visibility_change_gtk_widget_show, self, 0);
	g_signal_connect_object (view, "hide", (GCallback) _slingshot_dbus_service_service_on_view_visibility_change_gtk_widget_hide, self, 0);
	return self;
}

static SlingshotDBusServiceService*
slingshot_dbus_service_service_new (GtkWidget* view)
{
	return slingshot_dbus_service_service_construct (SLINGSHOT_DBUS_SERVICE_TYPE_SERVICE, view);
}

static gchar*
bool_to_string (gboolean self)
{
	gchar* result;
	if (self) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup ("true");
		result = _tmp0_;
		return result;
	} else {
		gchar* _tmp1_;
		_tmp1_ = g_strdup ("false");
		result = _tmp1_;
		return result;
	}
}

static void
slingshot_dbus_service_service_on_view_visibility_change (SlingshotDBusServiceService* self)
{
	GtkWidget* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	GtkWidget* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->view;
	_tmp1_ = gtk_widget_get_visible (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = bool_to_string (_tmp2_);
	_tmp4_ = _tmp3_;
	g_debug ("DBusService.vala:33: Visibility changed. Sending visible = %s over DBu" \
"s", _tmp4_);
	_g_free0 (_tmp4_);
	_tmp5_ = self->priv->view;
	_tmp6_ = gtk_widget_get_visible (_tmp5_);
	_tmp7_ = _tmp6_;
	g_signal_emit (self, slingshot_dbus_service_service_signals[SLINGSHOT_DBUS_SERVICE_SERVICE_VISIBILITY_CHANGED_SIGNAL], 0, _tmp7_);
}

static void
slingshot_dbus_service_service_class_init (SlingshotDBusServiceServiceClass * klass,
                                           gpointer klass_data)
{
	slingshot_dbus_service_service_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SlingshotDBusServiceService_private_offset);
	G_OBJECT_CLASS (klass)->finalize = slingshot_dbus_service_service_finalize;
	slingshot_dbus_service_service_signals[SLINGSHOT_DBUS_SERVICE_SERVICE_VISIBILITY_CHANGED_SIGNAL] = g_signal_new ("visibility-changed", SLINGSHOT_DBUS_SERVICE_TYPE_SERVICE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
}

static void
slingshot_dbus_service_service_instance_init (SlingshotDBusServiceService * self,
                                              gpointer klass)
{
	self->priv = slingshot_dbus_service_service_get_instance_private (self);
	self->priv->view = NULL;
}

static void
slingshot_dbus_service_service_finalize (GObject * obj)
{
	SlingshotDBusServiceService * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SLINGSHOT_DBUS_SERVICE_TYPE_SERVICE, SlingshotDBusServiceService);
	_g_object_unref0 (self->priv->view);
	G_OBJECT_CLASS (slingshot_dbus_service_service_parent_class)->finalize (obj);
}

GType
slingshot_dbus_service_service_get_type (void)
{
	return slingshot_dbus_service_service_type_id;
}

GType
slingshot_dbus_service_service_register_type (GTypeModule * module)
{
	static const GTypeInfo g_define_type_info = { sizeof (SlingshotDBusServiceServiceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) slingshot_dbus_service_service_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SlingshotDBusServiceService), 0, (GInstanceInitFunc) slingshot_dbus_service_service_instance_init, NULL };
	slingshot_dbus_service_service_type_id = g_type_module_register_type (module, G_TYPE_OBJECT, "SlingshotDBusServiceService", &g_define_type_info, 0);
	g_type_set_qdata (slingshot_dbus_service_service_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) slingshot_dbus_service_service_register_object);
	SlingshotDBusServiceService_private_offset = sizeof (SlingshotDBusServiceServicePrivate);
	return slingshot_dbus_service_service_type_id;
}

static void
slingshot_dbus_service_service_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)
{
	g_object_unref (invocation);
}

static GVariant*
slingshot_dbus_service_service_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
slingshot_dbus_service_service_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;
}

static void
_dbus_slingshot_dbus_service_service_visibility_changed (GObject* _sender,
                                                         gboolean launcher_visible,
                                                         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_boolean (launcher_visible));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "io.elementary.desktop.AppLauncherService", "VisibilityChanged", _arguments, NULL);
}

static guint
slingshot_dbus_service_service_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 *) (&_slingshot_dbus_service_service_dbus_interface_info), &_slingshot_dbus_service_service_dbus_interface_vtable, data, _slingshot_dbus_service_service_unregister_object, error);
	if (!result) {
		return 0;
	}
	g_signal_connect (object, "visibility-changed", (GCallback) _dbus_slingshot_dbus_service_service_visibility_changed, data);
	return result;
}

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

static void
slingshot_dbus_service_class_init (SlingshotDBusServiceClass * klass,
                                   gpointer klass_data)
{
	slingshot_dbus_service_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SlingshotDBusService_private_offset);
	G_OBJECT_CLASS (klass)->finalize = slingshot_dbus_service_finalize;
}

static void
slingshot_dbus_service_instance_init (SlingshotDBusService * self,
                                      gpointer klass)
{
	self->priv = slingshot_dbus_service_get_instance_private (self);
	self->priv->service = NULL;
}

static void
slingshot_dbus_service_finalize (GObject * obj)
{
	SlingshotDBusService * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SLINGSHOT_TYPE_DBUS_SERVICE, SlingshotDBusService);
	_g_object_unref0 (self->priv->service);
	G_OBJECT_CLASS (slingshot_dbus_service_parent_class)->finalize (obj);
}

GType
slingshot_dbus_service_get_type (void)
{
	return slingshot_dbus_service_type_id;
}

GType
slingshot_dbus_service_register_type (GTypeModule * module)
{
	static const GTypeInfo g_define_type_info = { sizeof (SlingshotDBusServiceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) slingshot_dbus_service_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SlingshotDBusService), 0, (GInstanceInitFunc) slingshot_dbus_service_instance_init, NULL };
	slingshot_dbus_service_type_id = g_type_module_register_type (module, G_TYPE_OBJECT, "SlingshotDBusService", &g_define_type_info, 0);
	SlingshotDBusService_private_offset = sizeof (SlingshotDBusServicePrivate);
	return slingshot_dbus_service_type_id;
}

