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

#include <glib-object.h>
#include <gio/gio.h>
#include <glib.h>
#include <stdlib.h>
#include <string.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 WINGPANEL_SERVICES_TYPE_WMD_BUS (wingpanel_services_wmd_bus_get_type ())
#define WINGPANEL_SERVICES_WMD_BUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WINGPANEL_SERVICES_TYPE_WMD_BUS, WingpanelServicesWMDBus))
#define WINGPANEL_SERVICES_IS_WMD_BUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WINGPANEL_SERVICES_TYPE_WMD_BUS))
#define WINGPANEL_SERVICES_WMD_BUS_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), WINGPANEL_SERVICES_TYPE_WMD_BUS, WingpanelServicesWMDBusIface))

typedef struct _WingpanelServicesWMDBus WingpanelServicesWMDBus;
typedef struct _WingpanelServicesWMDBusIface WingpanelServicesWMDBusIface;

#define WINGPANEL_SERVICES_TYPE_WMD_BUS_PROXY (wingpanel_services_wmd_bus_proxy_get_type ())
typedef enum  {
	WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_NONE = 0,
	WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_SHOW_WORKSPACE_VIEW,
	WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_MAXIMIZE_CURRENT,
	WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_HIDE_CURRENT,
	WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_OPEN_LAUNCHER,
	WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_CUSTOM_COMMAND,
	WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_WINDOW_OVERVIEW,
	WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_WINDOW_OVERVIEW_ALL,
	WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_SWITCH_TO_WORKSPACE_PREVIOUS,
	WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_SWITCH_TO_WORKSPACE_NEXT,
	WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_SWITCH_TO_WORKSPACE_LAST,
	WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_START_MOVE_CURRENT,
	WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_START_RESIZE_CURRENT,
	WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_TOGGLE_ALWAYS_ON_TOP_CURRENT,
	WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_TOGGLE_ALWAYS_ON_VISIBLE_WORKSPACE_CURRENT,
	WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_MOVE_CURRENT_WORKSPACE_LEFT,
	WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_MOVE_CURRENT_WORKSPACE_RIGHT,
	WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_CLOSE_CURRENT,
	WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_SCREENSHOT_CURRENT
} WingpanelServicesWMDBusActionType;

#define WINGPANEL_SERVICES_WMD_BUS_TYPE_ACTION_TYPE (wingpanel_services_wmd_bus_action_type_get_type ())
#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 _WingpanelServicesWmdBusSwitchWorkspaceData WingpanelServicesWmdBusSwitchWorkspaceData;
typedef GDBusProxy WingpanelServicesWMDBusProxy;
typedef GDBusProxyClass WingpanelServicesWMDBusProxyClass;
typedef struct _WingpanelServicesWmdBusPerformActionReadyData WingpanelServicesWmdBusPerformActionReadyData;

struct _WingpanelServicesWMDBusIface {
	GTypeInterface parent_iface;
	void (*perform_action) (WingpanelServicesWMDBus* self, WingpanelServicesWMDBusActionType type, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*perform_action_finish) (WingpanelServicesWMDBus* self, GAsyncResult* _res_, GError** error);
};

struct _WingpanelServicesWmdBusSwitchWorkspaceData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	gboolean backwards;
	WingpanelServicesWMDBus* _tmp0_;
	WingpanelServicesWMDBus* _tmp1_;
	WingpanelServicesWMDBus* _tmp2_;
	WingpanelServicesWMDBus* _tmp3_;
	GError* e;
	GError* _tmp4_;
	const gchar* _tmp5_;
	WingpanelServicesWMDBusActionType _tmp6_;
	WingpanelServicesWMDBusActionType action;
	WingpanelServicesWMDBus* _tmp7_;
	GError* _vala1_e;
	GError* _tmp8_;
	const gchar* _tmp9_;
	GError* _inner_error0_;
};

struct _WingpanelServicesWmdBusPerformActionReadyData {
	GDBusMethodInvocation* _invocation_;
	WingpanelServicesWMDBusActionType type;
};

static WingpanelServicesWMDBus* wingpanel_services_wmd_bus_instance;
static WingpanelServicesWMDBus* wingpanel_services_wmd_bus_instance = NULL;

VALA_EXTERN GType wingpanel_services_wmd_bus_proxy_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint wingpanel_services_wmd_bus_register_object (void* object,
                                                  GDBusConnection* connection,
                                                  const gchar* path,
                                                  GError** error);
VALA_EXTERN GType wingpanel_services_wmd_bus_action_type_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType wingpanel_services_wmd_bus_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WingpanelServicesWMDBus, g_object_unref)
static void wingpanel_services_wmd_bus_switch_workspace_data_free (gpointer _data);
VALA_EXTERN void wingpanel_services_wmd_bus_switch_workspace (gboolean backwards,
                                                  GAsyncReadyCallback _callback_,
                                                  gpointer _user_data_);
VALA_EXTERN void wingpanel_services_wmd_bus_switch_workspace_finish (GAsyncResult* _res_);
static gboolean wingpanel_services_wmd_bus_switch_workspace_co (WingpanelServicesWmdBusSwitchWorkspaceData* _data_);
static void wingpanel_services_wmd_bus_switch_workspace_ready (GObject* source_object,
                                                        GAsyncResult* _res_,
                                                        gpointer _user_data_);
VALA_EXTERN void wingpanel_services_wmd_bus_perform_action (WingpanelServicesWMDBus* self,
                                                WingpanelServicesWMDBusActionType type,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_);
VALA_EXTERN void wingpanel_services_wmd_bus_perform_action_finish (WingpanelServicesWMDBus* self,
                                                       GAsyncResult* _res_,
                                                       GError** error);
static GType wingpanel_services_wmd_bus_get_type_once (void);
static void wingpanel_services_wmd_bus_proxy_g_signal (GDBusProxy* proxy,
                                                const gchar* sender_name,
                                                const gchar* signal_name,
                                                GVariant* parameters);
static void _vala_g_async_ready_callback (GObject *source_object,
                                   GAsyncResult *res,
                                   void *user_data);
static void wingpanel_services_wmd_bus_proxy_perform_action_async (WingpanelServicesWMDBus* self,
                                                            WingpanelServicesWMDBusActionType type,
                                                            GAsyncReadyCallback _callback_,
                                                            gpointer _user_data_);
static void wingpanel_services_wmd_bus_proxy_perform_action_finish (WingpanelServicesWMDBus* self,
                                                             GAsyncResult* _res_,
                                                             GError** error);
static void wingpanel_services_wmd_bus_proxy_wingpanel_services_wmd_bus_interface_init (WingpanelServicesWMDBusIface* iface);
static void _dbus_wingpanel_services_wmd_bus_perform_action (WingpanelServicesWMDBus* self,
                                                      GVariant* _parameters_,
                                                      GDBusMethodInvocation* invocation);
static void _dbus_wingpanel_services_wmd_bus_perform_action_ready (GObject * source_object,
                                                            GAsyncResult * _res_,
                                                            gpointer _user_data_);
static void wingpanel_services_wmd_bus_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* wingpanel_services_wmd_bus_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 wingpanel_services_wmd_bus_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 _wingpanel_services_wmd_bus_unregister_object (gpointer user_data);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static const GDBusArgInfo _wingpanel_services_wmd_bus_dbus_arg_info_perform_action_type = {-1, "type", "i", NULL};
static const GDBusArgInfo * const _wingpanel_services_wmd_bus_dbus_arg_info_perform_action_in[] = {&_wingpanel_services_wmd_bus_dbus_arg_info_perform_action_type, NULL};
static const GDBusArgInfo * const _wingpanel_services_wmd_bus_dbus_arg_info_perform_action_out[] = {NULL};
static const GDBusMethodInfo _wingpanel_services_wmd_bus_dbus_method_info_perform_action = {-1, "PerformAction", (GDBusArgInfo **) (&_wingpanel_services_wmd_bus_dbus_arg_info_perform_action_in), (GDBusArgInfo **) (&_wingpanel_services_wmd_bus_dbus_arg_info_perform_action_out), NULL};
static const GDBusMethodInfo * const _wingpanel_services_wmd_bus_dbus_method_info[] = {&_wingpanel_services_wmd_bus_dbus_method_info_perform_action, NULL};
static const GDBusSignalInfo * const _wingpanel_services_wmd_bus_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo * const _wingpanel_services_wmd_bus_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _wingpanel_services_wmd_bus_dbus_interface_info = {-1, "org.pantheon.gala", (GDBusMethodInfo **) (&_wingpanel_services_wmd_bus_dbus_method_info), (GDBusSignalInfo **) (&_wingpanel_services_wmd_bus_dbus_signal_info), (GDBusPropertyInfo **) (&_wingpanel_services_wmd_bus_dbus_property_info), NULL};
static const GDBusInterfaceVTable _wingpanel_services_wmd_bus_dbus_interface_vtable = {wingpanel_services_wmd_bus_dbus_interface_method_call, wingpanel_services_wmd_bus_dbus_interface_get_property, wingpanel_services_wmd_bus_dbus_interface_set_property};

static GType
wingpanel_services_wmd_bus_action_type_get_type_once (void)
{
	static const GEnumValue values[] = {{WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_NONE, "WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_NONE", "none"}, {WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_SHOW_WORKSPACE_VIEW, "WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_SHOW_WORKSPACE_VIEW", "show-workspace-view"}, {WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_MAXIMIZE_CURRENT, "WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_MAXIMIZE_CURRENT", "maximize-current"}, {WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_HIDE_CURRENT, "WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_HIDE_CURRENT", "hide-current"}, {WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_OPEN_LAUNCHER, "WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_OPEN_LAUNCHER", "open-launcher"}, {WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_CUSTOM_COMMAND, "WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_CUSTOM_COMMAND", "custom-command"}, {WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_WINDOW_OVERVIEW, "WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_WINDOW_OVERVIEW", "window-overview"}, {WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_WINDOW_OVERVIEW_ALL, "WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_WINDOW_OVERVIEW_ALL", "window-overview-all"}, {WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_SWITCH_TO_WORKSPACE_PREVIOUS, "WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_SWITCH_TO_WORKSPACE_PREVIOUS", "switch-to-workspace-previous"}, {WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_SWITCH_TO_WORKSPACE_NEXT, "WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_SWITCH_TO_WORKSPACE_NEXT", "switch-to-workspace-next"}, {WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_SWITCH_TO_WORKSPACE_LAST, "WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_SWITCH_TO_WORKSPACE_LAST", "switch-to-workspace-last"}, {WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_START_MOVE_CURRENT, "WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_START_MOVE_CURRENT", "start-move-current"}, {WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_START_RESIZE_CURRENT, "WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_START_RESIZE_CURRENT", "start-resize-current"}, {WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_TOGGLE_ALWAYS_ON_TOP_CURRENT, "WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_TOGGLE_ALWAYS_ON_TOP_CURRENT", "toggle-always-on-top-current"}, {WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_TOGGLE_ALWAYS_ON_VISIBLE_WORKSPACE_CURRENT, "WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_TOGGLE_ALWAYS_ON_VISIBLE_WORKSPACE_CURRENT", "toggle-always-on-visible-workspace-current"}, {WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_MOVE_CURRENT_WORKSPACE_LEFT, "WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_MOVE_CURRENT_WORKSPACE_LEFT", "move-current-workspace-left"}, {WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_MOVE_CURRENT_WORKSPACE_RIGHT, "WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_MOVE_CURRENT_WORKSPACE_RIGHT", "move-current-workspace-right"}, {WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_CLOSE_CURRENT, "WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_CLOSE_CURRENT", "close-current"}, {WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_SCREENSHOT_CURRENT, "WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_SCREENSHOT_CURRENT", "screenshot-current"}, {0, NULL, NULL}};
	GType wingpanel_services_wmd_bus_action_type_type_id;
	wingpanel_services_wmd_bus_action_type_type_id = g_enum_register_static ("WingpanelServicesWMDBusActionType", values);
	return wingpanel_services_wmd_bus_action_type_type_id;
}

GType
wingpanel_services_wmd_bus_action_type_get_type (void)
{
	static volatile gsize wingpanel_services_wmd_bus_action_type_type_id__once = 0;
	if (g_once_init_enter (&wingpanel_services_wmd_bus_action_type_type_id__once)) {
		GType wingpanel_services_wmd_bus_action_type_type_id;
		wingpanel_services_wmd_bus_action_type_type_id = wingpanel_services_wmd_bus_action_type_get_type_once ();
		g_once_init_leave (&wingpanel_services_wmd_bus_action_type_type_id__once, wingpanel_services_wmd_bus_action_type_type_id);
	}
	return wingpanel_services_wmd_bus_action_type_type_id__once;
}

static void
wingpanel_services_wmd_bus_switch_workspace_data_free (gpointer _data)
{
	WingpanelServicesWmdBusSwitchWorkspaceData* _data_;
	_data_ = _data;
	g_slice_free (WingpanelServicesWmdBusSwitchWorkspaceData, _data_);
}

void
wingpanel_services_wmd_bus_switch_workspace (gboolean backwards,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_)
{
	WingpanelServicesWmdBusSwitchWorkspaceData* _data_;
	_data_ = g_slice_new0 (WingpanelServicesWmdBusSwitchWorkspaceData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, wingpanel_services_wmd_bus_switch_workspace_data_free);
	_data_->backwards = backwards;
	wingpanel_services_wmd_bus_switch_workspace_co (_data_);
}

void
wingpanel_services_wmd_bus_switch_workspace_finish (GAsyncResult* _res_)
{
	WingpanelServicesWmdBusSwitchWorkspaceData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
wingpanel_services_wmd_bus_switch_workspace_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_)
{
	WingpanelServicesWmdBusSwitchWorkspaceData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	wingpanel_services_wmd_bus_switch_workspace_co (_data_);
}

static gboolean
wingpanel_services_wmd_bus_switch_workspace_co (WingpanelServicesWmdBusSwitchWorkspaceData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = wingpanel_services_wmd_bus_instance;
	if (_data_->_tmp0_ == NULL) {
		{
			_data_->_state_ = 1;
			g_async_initable_new_async (WINGPANEL_SERVICES_TYPE_WMD_BUS_PROXY, 0, NULL, wingpanel_services_wmd_bus_switch_workspace_ready, _data_, "g-flags", 0, "g-name", "org.pantheon.gala", "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/org/pantheon/gala", "g-interface-name", "org.pantheon.gala", NULL);
			return FALSE;
			_state_1:
			_data_->_tmp2_ = (WingpanelServicesWMDBus*) g_async_initable_new_finish ((GAsyncInitable *) _data_->_source_object_, _data_->_res_, &_data_->_inner_error0_);
			_data_->_tmp1_ = (WingpanelServicesWMDBus*) _data_->_tmp2_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_data_->_tmp3_ = _data_->_tmp1_;
			_data_->_tmp1_ = NULL;
			_g_object_unref0 (wingpanel_services_wmd_bus_instance);
			wingpanel_services_wmd_bus_instance = _data_->_tmp3_;
			_g_object_unref0 (_data_->_tmp1_);
		}
		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 ("WMDBus.vala:9: Failed to get gala dbus: %s", _data_->_tmp5_);
			_g_error_free0 (_data_->e);
			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;
		}
		__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;
		}
	}
	if (_data_->backwards) {
		_data_->_tmp6_ = WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_SWITCH_TO_WORKSPACE_PREVIOUS;
	} else {
		_data_->_tmp6_ = WINGPANEL_SERVICES_WMD_BUS_ACTION_TYPE_SWITCH_TO_WORKSPACE_NEXT;
	}
	_data_->action = _data_->_tmp6_;
	{
		_data_->_tmp7_ = wingpanel_services_wmd_bus_instance;
		_data_->_state_ = 2;
		wingpanel_services_wmd_bus_perform_action (_data_->_tmp7_, _data_->action, wingpanel_services_wmd_bus_switch_workspace_ready, _data_);
		return FALSE;
		_state_2:
		wingpanel_services_wmd_bus_perform_action_finish (_data_->_tmp7_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch1_g_error;
		}
	}
	goto __finally1;
	__catch1_g_error:
	{
		_data_->_vala1_e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp8_ = _data_->_vala1_e;
		_data_->_tmp9_ = _data_->_tmp8_->message;
		g_warning ("WMDBus.vala:18: Failed to perform gala action: %s", _data_->_tmp9_);
		_g_error_free0 (_data_->_vala1_e);
	}
	__finally1:
	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;
}

void
wingpanel_services_wmd_bus_perform_action (WingpanelServicesWMDBus* self,
                                           WingpanelServicesWMDBusActionType type,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_)
{
	WingpanelServicesWMDBusIface* _iface_;
	_iface_ = WINGPANEL_SERVICES_WMD_BUS_GET_INTERFACE (self);
	if (_iface_->perform_action) {
		_iface_->perform_action (self, type, _callback_, _user_data_);
	}
}

void
wingpanel_services_wmd_bus_perform_action_finish (WingpanelServicesWMDBus* self,
                                                  GAsyncResult* _res_,
                                                  GError** error)
{
	WingpanelServicesWMDBusIface* _iface_;
	_iface_ = WINGPANEL_SERVICES_WMD_BUS_GET_INTERFACE (self);
	if (_iface_->perform_action_finish) {
		_iface_->perform_action_finish (self, _res_, error);
	}
}

static void
wingpanel_services_wmd_bus_default_init (WingpanelServicesWMDBusIface * iface,
                                         gpointer iface_data)
{
}

static GType
wingpanel_services_wmd_bus_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (WingpanelServicesWMDBusIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) wingpanel_services_wmd_bus_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType wingpanel_services_wmd_bus_type_id;
	wingpanel_services_wmd_bus_type_id = g_type_register_static (G_TYPE_INTERFACE, "WingpanelServicesWMDBus", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (wingpanel_services_wmd_bus_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (wingpanel_services_wmd_bus_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) wingpanel_services_wmd_bus_proxy_get_type);
	g_type_set_qdata (wingpanel_services_wmd_bus_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.pantheon.gala");
	g_type_set_qdata (wingpanel_services_wmd_bus_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_wingpanel_services_wmd_bus_dbus_interface_info));
	g_type_set_qdata (wingpanel_services_wmd_bus_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) wingpanel_services_wmd_bus_register_object);
	return wingpanel_services_wmd_bus_type_id;
}

GType
wingpanel_services_wmd_bus_get_type (void)
{
	static volatile gsize wingpanel_services_wmd_bus_type_id__once = 0;
	if (g_once_init_enter (&wingpanel_services_wmd_bus_type_id__once)) {
		GType wingpanel_services_wmd_bus_type_id;
		wingpanel_services_wmd_bus_type_id = wingpanel_services_wmd_bus_get_type_once ();
		g_once_init_leave (&wingpanel_services_wmd_bus_type_id__once, wingpanel_services_wmd_bus_type_id);
	}
	return wingpanel_services_wmd_bus_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (WingpanelServicesWMDBusProxy, wingpanel_services_wmd_bus_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (WINGPANEL_SERVICES_TYPE_WMD_BUS, wingpanel_services_wmd_bus_proxy_wingpanel_services_wmd_bus_interface_init) )
static void
wingpanel_services_wmd_bus_proxy_class_init (WingpanelServicesWMDBusProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = wingpanel_services_wmd_bus_proxy_g_signal;
}

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

static void
wingpanel_services_wmd_bus_proxy_init (WingpanelServicesWMDBusProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_wingpanel_services_wmd_bus_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
wingpanel_services_wmd_bus_proxy_perform_action_async (WingpanelServicesWMDBus* self,
                                                       WingpanelServicesWMDBusActionType type,
                                                       GAsyncReadyCallback _callback_,
                                                       gpointer _user_data_)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	G_DBUS_ERROR;
	G_IO_ERROR;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.pantheon.gala", "PerformAction");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_int32 (type));
	_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
wingpanel_services_wmd_bus_proxy_perform_action_finish (WingpanelServicesWMDBus* 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
wingpanel_services_wmd_bus_proxy_wingpanel_services_wmd_bus_interface_init (WingpanelServicesWMDBusIface* iface)
{
	iface->perform_action = wingpanel_services_wmd_bus_proxy_perform_action_async;
	iface->perform_action_finish = wingpanel_services_wmd_bus_proxy_perform_action_finish;
}

static void
_dbus_wingpanel_services_wmd_bus_perform_action (WingpanelServicesWMDBus* self,
                                                 GVariant* _parameters_,
                                                 GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	WingpanelServicesWmdBusPerformActionReadyData* _ready_data;
	GVariant* _tmp121_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (WingpanelServicesWmdBusPerformActionReadyData);
	_ready_data->_invocation_ = invocation;
	_tmp121_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->type = g_variant_get_int32 (_tmp121_);
	g_variant_unref (_tmp121_);
	wingpanel_services_wmd_bus_perform_action (self, _ready_data->type, (GAsyncReadyCallback) _dbus_wingpanel_services_wmd_bus_perform_action_ready, _ready_data);
}

static void
_dbus_wingpanel_services_wmd_bus_perform_action_ready (GObject * source_object,
                                                       GAsyncResult * _res_,
                                                       gpointer _user_data_)
{
	WingpanelServicesWmdBusPerformActionReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	wingpanel_services_wmd_bus_perform_action_finish ((WingpanelServicesWMDBus*) 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 (WingpanelServicesWmdBusPerformActionReadyData, _ready_data);
}

static void
wingpanel_services_wmd_bus_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, "PerformAction") == 0) {
		_dbus_wingpanel_services_wmd_bus_perform_action (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
wingpanel_services_wmd_bus_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
wingpanel_services_wmd_bus_dbus_interface_set_property (GDBusConnection* connection,
                                                        const gchar* sender,
                                                        const gchar* object_path,
                                                        const gchar* interface_name,
                                                        const gchar* property_name,
                                                        GVariant* value,
                                                        GError** error,
                                                        gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	return FALSE;
}

guint
wingpanel_services_wmd_bus_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 *) (&_wingpanel_services_wmd_bus_dbus_interface_info), &_wingpanel_services_wmd_bus_dbus_interface_vtable, data, _wingpanel_services_wmd_bus_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}

static void
_wingpanel_services_wmd_bus_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 inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

