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

/*
 * This file is part of budgie-desktop
 *
 * Copyright Budgie Desktop 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 2 of the License, or
 * (at your option) any later version.
 */

#include <glib-object.h>
#include <gio/gio.h>
#include <glib.h>
#include <string.h>
#include "showdesktopapplet.h"
#include <stdlib.h>
#include "plugin.h"
#include <gtk/gtk.h>
#include <glib/gi18n-lib.h>
#include <libpeas.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 TYPE_PANEL_REMOTE (panel_remote_get_type ())
#define PANEL_REMOTE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PANEL_REMOTE, PanelRemote))
#define IS_PANEL_REMOTE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PANEL_REMOTE))
#define PANEL_REMOTE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_PANEL_REMOTE, PanelRemoteIface))

typedef struct _PanelRemote PanelRemote;
typedef struct _PanelRemoteIface PanelRemoteIface;

#define TYPE_PANEL_REMOTE_PROXY (panel_remote_proxy_get_type ())
enum  {
	PANEL_REMOTE_DESKTOP_SHOWN_SIGNAL,
	PANEL_REMOTE_NUM_SIGNALS
};
static guint panel_remote_signals[PANEL_REMOTE_NUM_SIGNALS] = {0};
typedef GDBusProxy PanelRemoteProxy;
typedef GDBusProxyClass PanelRemoteProxyClass;
typedef struct _panel_remote_ShowDesktopReadyData panel_remote_ShowDesktopReadyData;
typedef struct _panel_remote_ToggleShowDesktopReadyData panel_remote_ToggleShowDesktopReadyData;
enum  {
	SHOW_DESKTOP_PLUGIN_0_PROPERTY,
	SHOW_DESKTOP_PLUGIN_NUM_PROPERTIES
};
static GParamSpec* show_desktop_plugin_properties[SHOW_DESKTOP_PLUGIN_NUM_PROPERTIES];
enum  {
	SHOW_DESKTOP_APPLET_0_PROPERTY,
	SHOW_DESKTOP_APPLET_NUM_PROPERTIES
};
static GParamSpec* show_desktop_applet_properties[SHOW_DESKTOP_APPLET_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)))
typedef struct _ShowDesktopAppletSetupDbusData ShowDesktopAppletSetupDbusData;
typedef struct _ShowDesktopAppletToggleDesktopData ShowDesktopAppletToggleDesktopData;

struct _PanelRemoteIface {
	GTypeInterface parent_iface;
	void (*ShowDesktop) (PanelRemote* self, gboolean show, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*ShowDesktop_finish) (PanelRemote* self, GAsyncResult* _res_, GError** error);
	void (*ToggleShowDesktop) (PanelRemote* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*ToggleShowDesktop_finish) (PanelRemote* self, GAsyncResult* _res_, GError** error);
};

struct _panel_remote_ShowDesktopReadyData {
	GDBusMethodInvocation* _invocation_;
	gboolean show;
};

struct _panel_remote_ToggleShowDesktopReadyData {
	GDBusMethodInvocation* _invocation_;
};

struct _ShowDesktopAppletPrivate {
	PanelRemote* panel_proxy;
	gboolean in_toggle;
};

struct _ShowDesktopAppletSetupDbusData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ShowDesktopApplet* self;
	PanelRemote* _tmp0_;
	PanelRemote* _tmp1_;
	PanelRemote* _tmp2_;
	PanelRemote* _tmp3_;
	GError* e;
	GError* _tmp4_;
	const gchar* _tmp5_;
	GError* _inner_error0_;
};

struct _ShowDesktopAppletToggleDesktopData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ShowDesktopApplet* self;
	PanelRemote* _tmp0_;
	PanelRemote* _tmp1_;
	gboolean _tmp2_;
	GtkToggleButton* _tmp3_;
	GError* e;
	GError* _tmp4_;
	const gchar* _tmp5_;
	GtkToggleButton* _tmp6_;
	GtkToggleButton* _tmp7_;
	GError* _inner_error0_;
};

static GType panel_remote_type_id = 0;
static gpointer show_desktop_plugin_parent_class = NULL;
static BudgiePluginIface * show_desktop_plugin_budgie_plugin_parent_iface = NULL;
static GType show_desktop_plugin_type_id = 0;
static gint ShowDesktopApplet_private_offset;
static gpointer show_desktop_applet_parent_class = NULL;
static GType show_desktop_applet_type_id = 0;

VALA_EXTERN GType panel_remote_proxy_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void panel_remote_proxy_register_dynamic_type (GTypeModule* module);
VALA_EXTERN guint panel_remote_register_object (void* object,
                                    GDBusConnection* connection,
                                    const gchar* path,
                                    GError** error);
GType panel_remote_register_type (GTypeModule * module);
VALA_EXTERN GType panel_remote_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void panel_remote_ShowDesktop (PanelRemote* self,
                               gboolean show,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_);
VALA_EXTERN void panel_remote_ShowDesktop_finish (PanelRemote* self,
                                      GAsyncResult* _res_,
                                      GError** error);
VALA_EXTERN void panel_remote_ToggleShowDesktop (PanelRemote* self,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
VALA_EXTERN void panel_remote_ToggleShowDesktop_finish (PanelRemote* self,
                                            GAsyncResult* _res_,
                                            GError** error);
static void panel_remote_proxy_g_signal (GDBusProxy* proxy,
                                  const gchar* sender_name,
                                  const gchar* signal_name,
                                  GVariant* parameters);
static void _dbus_handle_panel_remote_desktop_shown (PanelRemote* self,
                                              GVariant* parameters);
static void _vala_g_async_ready_callback (GObject *source_object,
                                   GAsyncResult *res,
                                   void *user_data);
static void panel_remote_proxy_ShowDesktop_async (PanelRemote* self,
                                           gboolean show,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_);
static void panel_remote_proxy_ShowDesktop_finish (PanelRemote* self,
                                            GAsyncResult* _res_,
                                            GError** error);
static void panel_remote_proxy_ToggleShowDesktop_async (PanelRemote* self,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_);
static void panel_remote_proxy_ToggleShowDesktop_finish (PanelRemote* self,
                                                  GAsyncResult* _res_,
                                                  GError** error);
static void panel_remote_proxy_panel_remote_interface_init (PanelRemoteIface* iface);
static void _dbus_panel_remote_ShowDesktop (PanelRemote* self,
                                     GVariant* _parameters_,
                                     GDBusMethodInvocation* invocation);
static void _dbus_panel_remote_ShowDesktop_ready (GObject * source_object,
                                           GAsyncResult * _res_,
                                           gpointer _user_data_);
static void _dbus_panel_remote_ToggleShowDesktop (PanelRemote* self,
                                           GVariant* _parameters_,
                                           GDBusMethodInvocation* invocation);
static void _dbus_panel_remote_ToggleShowDesktop_ready (GObject * source_object,
                                                 GAsyncResult * _res_,
                                                 gpointer _user_data_);
static void panel_remote_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* panel_remote_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 panel_remote_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_panel_remote_desktop_shown (GObject* _sender,
                                       gboolean showing,
                                       gpointer* _data);
static void _panel_remote_unregister_object (gpointer user_data);
static BudgieApplet* show_desktop_plugin_real_get_panel_widget (BudgiePlugin* base,
                                                         const gchar* uuid);
static void show_desktop_applet_setup_dbus (ShowDesktopApplet* self,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
static void show_desktop_applet_setup_dbus_finish (ShowDesktopApplet* self,
                                            GAsyncResult* _res_);
static void __lambda5_ (ShowDesktopApplet* self);
static void show_desktop_applet_toggle_desktop (ShowDesktopApplet* self,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_);
static void show_desktop_applet_toggle_desktop_finish (ShowDesktopApplet* self,
                                                GAsyncResult* _res_);
static void ___lambda5__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                            gpointer self);
static void show_desktop_applet_setup_dbus_data_free (gpointer _data);
static gboolean show_desktop_applet_setup_dbus_co (ShowDesktopAppletSetupDbusData* _data_);
static void show_desktop_applet_setup_dbus_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_);
static void ___lambda4_ (ShowDesktopApplet* self,
                  gboolean showing);
static void ____lambda4__panel_remote_desktop_shown (PanelRemote* _sender,
                                              gboolean showing,
                                              gpointer self);
static void show_desktop_applet_toggle_desktop_data_free (gpointer _data);
static gboolean show_desktop_applet_toggle_desktop_co (ShowDesktopAppletToggleDesktopData* _data_);
static void show_desktop_applet_toggle_desktop_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_data_);
static gboolean ____lambda6_ (ShowDesktopApplet* self);
static gboolean _____lambda6__gsource_func (gpointer self);
static void show_desktop_applet_finalize (GObject * obj);

static const GDBusArgInfo _panel_remote_dbus_arg_info_ShowDesktop_show = {-1, "show", "b", NULL};
static const GDBusArgInfo * const _panel_remote_dbus_arg_info_ShowDesktop_in[] = {&_panel_remote_dbus_arg_info_ShowDesktop_show, NULL};
static const GDBusArgInfo * const _panel_remote_dbus_arg_info_ShowDesktop_out[] = {NULL};
static const GDBusMethodInfo _panel_remote_dbus_method_info_ShowDesktop = {-1, "ShowDesktop", (GDBusArgInfo **) (&_panel_remote_dbus_arg_info_ShowDesktop_in), (GDBusArgInfo **) (&_panel_remote_dbus_arg_info_ShowDesktop_out), NULL};
static const GDBusArgInfo * const _panel_remote_dbus_arg_info_ToggleShowDesktop_in[] = {NULL};
static const GDBusArgInfo * const _panel_remote_dbus_arg_info_ToggleShowDesktop_out[] = {NULL};
static const GDBusMethodInfo _panel_remote_dbus_method_info_ToggleShowDesktop = {-1, "ToggleShowDesktop", (GDBusArgInfo **) (&_panel_remote_dbus_arg_info_ToggleShowDesktop_in), (GDBusArgInfo **) (&_panel_remote_dbus_arg_info_ToggleShowDesktop_out), NULL};
static const GDBusMethodInfo * const _panel_remote_dbus_method_info[] = {&_panel_remote_dbus_method_info_ShowDesktop, &_panel_remote_dbus_method_info_ToggleShowDesktop, NULL};
static const GDBusArgInfo _panel_remote_dbus_arg_info_desktop_shown_showing = {-1, "showing", "b", NULL};
static const GDBusArgInfo * const _panel_remote_dbus_arg_info_desktop_shown[] = {&_panel_remote_dbus_arg_info_desktop_shown_showing, NULL};
static const GDBusSignalInfo _panel_remote_dbus_signal_info_desktop_shown = {-1, "DesktopShown", (GDBusArgInfo **) (&_panel_remote_dbus_arg_info_desktop_shown), NULL};
static const GDBusSignalInfo * const _panel_remote_dbus_signal_info[] = {&_panel_remote_dbus_signal_info_desktop_shown, NULL};
static const GDBusPropertyInfo * const _panel_remote_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _panel_remote_dbus_interface_info = {-1, "org.budgie_desktop.Panel", (GDBusMethodInfo **) (&_panel_remote_dbus_method_info), (GDBusSignalInfo **) (&_panel_remote_dbus_signal_info), (GDBusPropertyInfo **) (&_panel_remote_dbus_property_info), NULL};
static const GDBusInterfaceVTable _panel_remote_dbus_interface_vtable = {panel_remote_dbus_interface_method_call, panel_remote_dbus_interface_get_property, panel_remote_dbus_interface_set_property};

void
panel_remote_ShowDesktop (PanelRemote* self,
                          gboolean show,
                          GAsyncReadyCallback _callback_,
                          gpointer _user_data_)
{
	PanelRemoteIface* _iface_;
	_iface_ = PANEL_REMOTE_GET_INTERFACE (self);
	if (_iface_->ShowDesktop) {
		_iface_->ShowDesktop (self, show, _callback_, _user_data_);
	}
}

void
panel_remote_ShowDesktop_finish (PanelRemote* self,
                                 GAsyncResult* _res_,
                                 GError** error)
{
	PanelRemoteIface* _iface_;
	_iface_ = PANEL_REMOTE_GET_INTERFACE (self);
	if (_iface_->ShowDesktop_finish) {
		_iface_->ShowDesktop_finish (self, _res_, error);
	}
}

void
panel_remote_ToggleShowDesktop (PanelRemote* self,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_)
{
	PanelRemoteIface* _iface_;
	_iface_ = PANEL_REMOTE_GET_INTERFACE (self);
	if (_iface_->ToggleShowDesktop) {
		_iface_->ToggleShowDesktop (self, _callback_, _user_data_);
	}
}

void
panel_remote_ToggleShowDesktop_finish (PanelRemote* self,
                                       GAsyncResult* _res_,
                                       GError** error)
{
	PanelRemoteIface* _iface_;
	_iface_ = PANEL_REMOTE_GET_INTERFACE (self);
	if (_iface_->ToggleShowDesktop_finish) {
		_iface_->ToggleShowDesktop_finish (self, _res_, error);
	}
}

static void
panel_remote_default_init (PanelRemoteIface * iface,
                           gpointer iface_data)
{
	panel_remote_signals[PANEL_REMOTE_DESKTOP_SHOWN_SIGNAL] = g_signal_new ("desktop-shown", TYPE_PANEL_REMOTE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
}

GType
panel_remote_get_type (void)
{
	return panel_remote_type_id;
}

GType
panel_remote_register_type (GTypeModule * module)
{
	static const GTypeInfo g_define_type_info = { sizeof (PanelRemoteIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) panel_remote_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	panel_remote_type_id = g_type_module_register_type (module, G_TYPE_INTERFACE, "PanelRemote", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (panel_remote_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (panel_remote_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) panel_remote_proxy_get_type);
	g_type_set_qdata (panel_remote_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.budgie_desktop.Panel");
	g_type_set_qdata (panel_remote_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_panel_remote_dbus_interface_info));
	g_type_set_qdata (panel_remote_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) panel_remote_register_object);
	return panel_remote_type_id;
}

G_DEFINE_DYNAMIC_TYPE_EXTENDED (PanelRemoteProxy, panel_remote_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE_DYNAMIC (TYPE_PANEL_REMOTE, panel_remote_proxy_panel_remote_interface_init) )
static void
panel_remote_proxy_class_init (PanelRemoteProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = panel_remote_proxy_g_signal;
}

static void
_dbus_handle_panel_remote_desktop_shown (PanelRemote* self,
                                         GVariant* parameters)
{
	GVariantIter _arguments_iter;
	gboolean showing = FALSE;
	GVariant* _tmp0_;
	g_variant_iter_init (&_arguments_iter, parameters);
	_tmp0_ = g_variant_iter_next_value (&_arguments_iter);
	showing = g_variant_get_boolean (_tmp0_);
	g_variant_unref (_tmp0_);
	g_signal_emit_by_name (self, "desktop-shown", showing);
}

static void
panel_remote_proxy_g_signal (GDBusProxy* proxy,
                             const gchar* sender_name,
                             const gchar* signal_name,
                             GVariant* parameters)
{
	if (strcmp (signal_name, "DesktopShown") == 0) {
		_dbus_handle_panel_remote_desktop_shown ((PanelRemote*) proxy, parameters);
	}
}

static void
panel_remote_proxy_class_finalize (PanelRemoteProxyClass* klass)
{
}

void
panel_remote_proxy_register_dynamic_type (GTypeModule* module)
{
	panel_remote_proxy_register_type (module);
}

static void
panel_remote_proxy_init (PanelRemoteProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_panel_remote_dbus_interface_info));
}

static void
_vala_g_async_ready_callback (GObject *source_object,
                              GAsyncResult *res,
                              void *user_data)
{
	g_task_return_pointer (user_data, g_object_ref (res), g_object_unref);
	g_object_unref (user_data);
}

static void
panel_remote_proxy_ShowDesktop_async (PanelRemote* self,
                                      gboolean show,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.budgie_desktop.Panel", "ShowDesktop");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_boolean (show));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	if (_callback_ != NULL) {
		g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_task_new ((GObject *) self, NULL, _callback_, _user_data_));
	} else {
		g_dbus_message_set_flags (_message, G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED);
		g_dbus_connection_send_message (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	}
	g_object_unref (_message);
}

static void
panel_remote_proxy_ShowDesktop_finish (PanelRemote* self,
                                       GAsyncResult* _res_,
                                       GError** error)
{
	GAsyncResult *_inner_res;
	GDBusMessage *_reply_message;
	_inner_res = g_task_propagate_pointer ((GTask *) _res_, NULL);
	_reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), _inner_res, error);
	g_object_unref (_inner_res);
	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
panel_remote_proxy_ToggleShowDesktop_async (PanelRemote* self,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.budgie_desktop.Panel", "ToggleShowDesktop");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	if (_callback_ != NULL) {
		g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_task_new ((GObject *) self, NULL, _callback_, _user_data_));
	} else {
		g_dbus_message_set_flags (_message, G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED);
		g_dbus_connection_send_message (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	}
	g_object_unref (_message);
}

static void
panel_remote_proxy_ToggleShowDesktop_finish (PanelRemote* self,
                                             GAsyncResult* _res_,
                                             GError** error)
{
	GAsyncResult *_inner_res;
	GDBusMessage *_reply_message;
	_inner_res = g_task_propagate_pointer ((GTask *) _res_, NULL);
	_reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), _inner_res, error);
	g_object_unref (_inner_res);
	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
panel_remote_proxy_panel_remote_interface_init (PanelRemoteIface* iface)
{
	iface->ShowDesktop = panel_remote_proxy_ShowDesktop_async;
	iface->ShowDesktop_finish = panel_remote_proxy_ShowDesktop_finish;
	iface->ToggleShowDesktop = panel_remote_proxy_ToggleShowDesktop_async;
	iface->ToggleShowDesktop_finish = panel_remote_proxy_ToggleShowDesktop_finish;
}

static void
_dbus_panel_remote_ShowDesktop (PanelRemote* self,
                                GVariant* _parameters_,
                                GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	panel_remote_ShowDesktopReadyData* _ready_data;
	GVariant* _tmp1_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (panel_remote_ShowDesktopReadyData);
	_ready_data->_invocation_ = invocation;
	_tmp1_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->show = g_variant_get_boolean (_tmp1_);
	g_variant_unref (_tmp1_);
	panel_remote_ShowDesktop (self, _ready_data->show, (GAsyncReadyCallback) _dbus_panel_remote_ShowDesktop_ready, _ready_data);
}

static void
_dbus_panel_remote_ShowDesktop_ready (GObject * source_object,
                                      GAsyncResult * _res_,
                                      gpointer _user_data_)
{
	panel_remote_ShowDesktopReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	panel_remote_ShowDesktop_finish ((PanelRemote*) source_object, _res_, &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_slice_free (panel_remote_ShowDesktopReadyData, _ready_data);
}

static void
_dbus_panel_remote_ToggleShowDesktop (PanelRemote* self,
                                      GVariant* _parameters_,
                                      GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	panel_remote_ToggleShowDesktopReadyData* _ready_data;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (panel_remote_ToggleShowDesktopReadyData);
	_ready_data->_invocation_ = invocation;
	panel_remote_ToggleShowDesktop (self, (GAsyncReadyCallback) _dbus_panel_remote_ToggleShowDesktop_ready, _ready_data);
}

static void
_dbus_panel_remote_ToggleShowDesktop_ready (GObject * source_object,
                                            GAsyncResult * _res_,
                                            gpointer _user_data_)
{
	panel_remote_ToggleShowDesktopReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	panel_remote_ToggleShowDesktop_finish ((PanelRemote*) source_object, _res_, &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_slice_free (panel_remote_ToggleShowDesktopReadyData, _ready_data);
}

static void
panel_remote_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, "ShowDesktop") == 0) {
		_dbus_panel_remote_ShowDesktop (object, parameters, invocation);
	} else if (strcmp (method_name, "ToggleShowDesktop") == 0) {
		_dbus_panel_remote_ToggleShowDesktop (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

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

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

static void
_dbus_panel_remote_desktop_shown (GObject* _sender,
                                  gboolean showing,
                                  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 (showing));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.budgie_desktop.Panel", "DesktopShown", _arguments, NULL);
}

guint
panel_remote_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 *) (&_panel_remote_dbus_interface_info), &_panel_remote_dbus_interface_vtable, data, _panel_remote_unregister_object, error);
	if (!result) {
		return 0;
	}
	g_signal_connect (object, "desktop-shown", (GCallback) _dbus_panel_remote_desktop_shown, data);
	return result;
}

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

static BudgieApplet*
show_desktop_plugin_real_get_panel_widget (BudgiePlugin* base,
                                           const gchar* uuid)
{
	ShowDesktopPlugin * self;
	ShowDesktopApplet* _tmp0_;
	BudgieApplet* result;
	self = (ShowDesktopPlugin*) base;
	g_return_val_if_fail (uuid != NULL, NULL);
	_tmp0_ = show_desktop_applet_new ();
	g_object_ref_sink (_tmp0_);
	result = (BudgieApplet*) _tmp0_;
	return result;
}

ShowDesktopPlugin*
show_desktop_plugin_construct (GType object_type)
{
	ShowDesktopPlugin * self = NULL;
	self = (ShowDesktopPlugin*) g_object_new (object_type, NULL);
	return self;
}

ShowDesktopPlugin*
show_desktop_plugin_new (void)
{
	return show_desktop_plugin_construct (TYPE_SHOW_DESKTOP_PLUGIN);
}

static void
show_desktop_plugin_class_init (ShowDesktopPluginClass * klass,
                                gpointer klass_data)
{
	show_desktop_plugin_parent_class = g_type_class_peek_parent (klass);
}

static void
show_desktop_plugin_budgie_plugin_interface_init (BudgiePluginIface * iface,
                                                  gpointer iface_data)
{
	show_desktop_plugin_budgie_plugin_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_panel_widget = (BudgieApplet* (*) (BudgiePlugin*, const gchar*)) show_desktop_plugin_real_get_panel_widget;
}

static void
show_desktop_plugin_instance_init (ShowDesktopPlugin * self,
                                   gpointer klass)
{
}

GType
show_desktop_plugin_get_type (void)
{
	return show_desktop_plugin_type_id;
}

GType
show_desktop_plugin_register_type (GTypeModule * module)
{
	static const GTypeInfo g_define_type_info = { sizeof (ShowDesktopPluginClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) show_desktop_plugin_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ShowDesktopPlugin), 0, (GInstanceInitFunc) show_desktop_plugin_instance_init, NULL };
	static const GInterfaceInfo budgie_plugin_info = { (GInterfaceInitFunc) show_desktop_plugin_budgie_plugin_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	show_desktop_plugin_type_id = g_type_module_register_type (module, peas_extension_base_get_type (), "ShowDesktopPlugin", &g_define_type_info, 0);
	g_type_module_add_interface (module, show_desktop_plugin_type_id, budgie_plugin_get_type (), &budgie_plugin_info);
	return show_desktop_plugin_type_id;
}

static inline gpointer
show_desktop_applet_get_instance_private (ShowDesktopApplet* self)
{
	return G_STRUCT_MEMBER_P (self, ShowDesktopApplet_private_offset);
}

static void
__lambda5_ (ShowDesktopApplet* self)
{
	if (self->priv->in_toggle) {
		return;
	}
	show_desktop_applet_toggle_desktop (self, NULL, NULL);
}

static void
___lambda5__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                       gpointer self)
{
	__lambda5_ ((ShowDesktopApplet*) self);
}

ShowDesktopApplet*
show_desktop_applet_construct (GType object_type)
{
	ShowDesktopApplet * self = NULL;
	GtkToggleButton* _tmp0_;
	GtkToggleButton* _tmp1_;
	GtkToggleButton* _tmp2_;
	GtkImage* _tmp3_;
	GtkToggleButton* _tmp4_;
	GtkImage* _tmp5_;
	GtkToggleButton* _tmp6_;
	GtkToggleButton* _tmp7_;
	GtkToggleButton* _tmp8_;
	self = (ShowDesktopApplet*) g_object_new (object_type, NULL);
	_tmp0_ = (GtkToggleButton*) gtk_toggle_button_new ();
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->widget);
	self->widget = _tmp0_;
	_tmp1_ = self->widget;
	gtk_button_set_relief ((GtkButton*) _tmp1_, GTK_RELIEF_NONE);
	_tmp2_ = self->widget;
	gtk_toggle_button_set_active (_tmp2_, FALSE);
	_tmp3_ = (GtkImage*) gtk_image_new_from_icon_name ("user-desktop-symbolic", (GtkIconSize) GTK_ICON_SIZE_BUTTON);
	g_object_ref_sink (_tmp3_);
	_g_object_unref0 (self->img);
	self->img = _tmp3_;
	_tmp4_ = self->widget;
	_tmp5_ = self->img;
	gtk_container_add ((GtkContainer*) _tmp4_, (GtkWidget*) _tmp5_);
	_tmp6_ = self->widget;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp6_, _ ("Toggle the desktop"));
	show_desktop_applet_setup_dbus (self, NULL, NULL);
	_tmp7_ = self->widget;
	g_signal_connect_object (_tmp7_, "toggled", (GCallback) ___lambda5__gtk_toggle_button_toggled, self, 0);
	_tmp8_ = self->widget;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp8_);
	gtk_widget_show_all ((GtkWidget*) self);
	return self;
}

ShowDesktopApplet*
show_desktop_applet_new (void)
{
	return show_desktop_applet_construct (TYPE_SHOW_DESKTOP_APPLET);
}

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

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

static void
show_desktop_applet_setup_dbus (ShowDesktopApplet* self,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_)
{
	ShowDesktopAppletSetupDbusData* _data_;
	ShowDesktopApplet* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (ShowDesktopAppletSetupDbusData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, show_desktop_applet_setup_dbus_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	show_desktop_applet_setup_dbus_co (_data_);
}

static void
show_desktop_applet_setup_dbus_finish (ShowDesktopApplet* self,
                                       GAsyncResult* _res_)
{
	ShowDesktopAppletSetupDbusData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
show_desktop_applet_setup_dbus_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_)
{
	ShowDesktopAppletSetupDbusData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	show_desktop_applet_setup_dbus_co (_data_);
}

static void
___lambda4_ (ShowDesktopApplet* self,
             gboolean showing)
{
	GtkToggleButton* _tmp0_;
	self->priv->in_toggle = TRUE;
	_tmp0_ = self->widget;
	gtk_toggle_button_set_active (_tmp0_, showing);
	self->priv->in_toggle = FALSE;
}

static void
____lambda4__panel_remote_desktop_shown (PanelRemote* _sender,
                                         gboolean showing,
                                         gpointer self)
{
	___lambda4_ ((ShowDesktopApplet*) self, showing);
}

static gboolean
show_desktop_applet_setup_dbus_co (ShowDesktopAppletSetupDbusData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_state_ = 1;
		g_async_initable_new_async (TYPE_PANEL_REMOTE_PROXY, 0, NULL, show_desktop_applet_setup_dbus_ready, _data_, "g-flags", 0, "g-name", "org.budgie_desktop.Panel", "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/org/budgie_desktop/Panel", "g-interface-name", "org.budgie_desktop.Panel", NULL);
		return FALSE;
		_state_1:
		_data_->_tmp1_ = (PanelRemote*) g_async_initable_new_finish ((GAsyncInitable *) _data_->_source_object_, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp0_ = (PanelRemote*) _data_->_tmp1_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp2_ = _data_->_tmp0_;
		_data_->_tmp0_ = NULL;
		_g_object_unref0 (_data_->self->priv->panel_proxy);
		_data_->self->priv->panel_proxy = _data_->_tmp2_;
		_data_->_tmp3_ = _data_->self->priv->panel_proxy;
		g_signal_connect_object (_data_->_tmp3_, "desktop-shown", (GCallback) ____lambda4__panel_remote_desktop_shown, _data_->self, 0);
		_g_object_unref0 (_data_->_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp4_ = _data_->e;
		_data_->_tmp5_ = _data_->_tmp4_->message;
		g_warning ("ShowDesktopApplet.vala:64: Failed to connect to panel DBus: %s", _data_->_tmp5_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_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;
}

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

static void
show_desktop_applet_toggle_desktop (ShowDesktopApplet* self,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_)
{
	ShowDesktopAppletToggleDesktopData* _data_;
	ShowDesktopApplet* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (ShowDesktopAppletToggleDesktopData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, show_desktop_applet_toggle_desktop_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	show_desktop_applet_toggle_desktop_co (_data_);
}

static void
show_desktop_applet_toggle_desktop_finish (ShowDesktopApplet* self,
                                           GAsyncResult* _res_)
{
	ShowDesktopAppletToggleDesktopData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
show_desktop_applet_toggle_desktop_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_)
{
	ShowDesktopAppletToggleDesktopData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	show_desktop_applet_toggle_desktop_co (_data_);
}

static gboolean
____lambda6_ (ShowDesktopApplet* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean result;
	if (!self->priv->in_toggle) {
		GtkToggleButton* _tmp1_;
		_tmp1_ = self->widget;
		_tmp0_ = gtk_toggle_button_get_active (_tmp1_);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GtkToggleButton* _tmp2_;
		self->priv->in_toggle = TRUE;
		_tmp2_ = self->widget;
		gtk_toggle_button_set_active (_tmp2_, FALSE);
		self->priv->in_toggle = FALSE;
	}
	result = FALSE;
	return result;
}

static gboolean
_____lambda6__gsource_func (gpointer self)
{
	gboolean result;
	result = ____lambda6_ ((ShowDesktopApplet*) self);
	return result;
}

static gboolean
show_desktop_applet_toggle_desktop_co (ShowDesktopAppletToggleDesktopData* _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->panel_proxy;
	if (_data_->_tmp0_ == NULL) {
		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->panel_proxy;
		_data_->_state_ = 1;
		panel_remote_ToggleShowDesktop (_data_->_tmp1_, show_desktop_applet_toggle_desktop_ready, _data_);
		return FALSE;
		_state_1:
		panel_remote_ToggleShowDesktop_finish (_data_->_tmp1_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		if (!_data_->self->priv->in_toggle) {
			_data_->_tmp3_ = _data_->self->widget;
			_data_->_tmp2_ = gtk_toggle_button_get_active (_data_->_tmp3_);
		} else {
			_data_->_tmp2_ = FALSE;
		}
		if (_data_->_tmp2_) {
			g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 50, _____lambda6__gsource_func, g_object_ref (_data_->self), g_object_unref);
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp4_ = _data_->e;
		_data_->_tmp5_ = _data_->_tmp4_->message;
		g_warning ("ShowDesktopApplet.vala:89: Failed to toggle desktop: %s", _data_->_tmp5_);
		_data_->self->priv->in_toggle = TRUE;
		_data_->_tmp6_ = _data_->self->widget;
		_data_->_tmp7_ = _data_->self->widget;
		gtk_toggle_button_set_active (_data_->_tmp6_, !gtk_toggle_button_get_active (_data_->_tmp7_));
		_data_->self->priv->in_toggle = FALSE;
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_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;
}

static void
show_desktop_applet_class_init (ShowDesktopAppletClass * klass,
                                gpointer klass_data)
{
	show_desktop_applet_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ShowDesktopApplet_private_offset);
	G_OBJECT_CLASS (klass)->finalize = show_desktop_applet_finalize;
}

static void
show_desktop_applet_instance_init (ShowDesktopApplet * self,
                                   gpointer klass)
{
	self->priv = show_desktop_applet_get_instance_private (self);
	self->priv->panel_proxy = NULL;
	self->priv->in_toggle = FALSE;
}

static void
show_desktop_applet_finalize (GObject * obj)
{
	ShowDesktopApplet * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_SHOW_DESKTOP_APPLET, ShowDesktopApplet);
	_g_object_unref0 (self->widget);
	_g_object_unref0 (self->img);
	_g_object_unref0 (self->priv->panel_proxy);
	G_OBJECT_CLASS (show_desktop_applet_parent_class)->finalize (obj);
}

GType
show_desktop_applet_get_type (void)
{
	return show_desktop_applet_type_id;
}

GType
show_desktop_applet_register_type (GTypeModule * module)
{
	static const GTypeInfo g_define_type_info = { sizeof (ShowDesktopAppletClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) show_desktop_applet_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ShowDesktopApplet), 0, (GInstanceInitFunc) show_desktop_applet_instance_init, NULL };
	show_desktop_applet_type_id = g_type_module_register_type (module, budgie_applet_get_type (), "ShowDesktopApplet", &g_define_type_info, 0);
	ShowDesktopApplet_private_offset = sizeof (ShowDesktopAppletPrivate);
	return show_desktop_applet_type_id;
}

void
peas_register_types (GTypeModule* module)
{
	PeasObjectModule* objmodule = NULL;
	PeasObjectModule* _tmp0_;
	g_return_if_fail (module != NULL);
	show_desktop_plugin_register_type (module);
	show_desktop_applet_register_type (module);
	panel_remote_register_type (module);
	panel_remote_proxy_register_dynamic_type (module);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (module, peas_object_module_get_type ()) ? ((PeasObjectModule*) module) : NULL);
	objmodule = _tmp0_;
	peas_object_module_register_extension_type (objmodule, budgie_plugin_get_type (), TYPE_SHOW_DESKTOP_PLUGIN);
	_g_object_unref0 (objmodule);
}

