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

#include "sound.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gio/gio.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 _g_free0(var) (var = (g_free (var), NULL))
enum  {
	SHELL_KEY_GRABBER_ACCELERATOR_ACTIVATED_SIGNAL,
	SHELL_KEY_GRABBER_NUM_SIGNALS
};
static guint shell_key_grabber_signals[SHELL_KEY_GRABBER_NUM_SIGNALS] = {0};
typedef GDBusProxy ShellKeyGrabberProxy;
typedef GDBusProxyClass ShellKeyGrabberProxyClass;
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))

static void g_cclosure_user_marshal_VOID__UINT_BOXED (GClosure * closure,
                                               GValue * return_value,
                                               guint n_param_values,
                                               const GValue * param_values,
                                               gpointer invocation_hint,
                                               gpointer marshal_data);
static GType shell_key_grabber_get_type_once (void);
static void shell_key_grabber_proxy_g_signal (GDBusProxy* proxy,
                                       const gchar* sender_name,
                                       const gchar* signal_name,
                                       GVariant* parameters);
static void _dbus_handle_shell_key_grabber_accelerator_activated (ShellKeyGrabber* self,
                                                           GVariant* parameters);
static guint shell_key_grabber_proxy_grab_accelerator (ShellKeyGrabber* self,
                                                const gchar* accelerator,
                                                ActionMode mode_flags,
                                                MetaKeyBindingFlags grab_flags,
                                                GError** error);
static guint* shell_key_grabber_proxy_grab_accelerators (ShellKeyGrabber* self,
                                                  Accelerator* accelerators,
                                                  gint accelerators_length1,
                                                  gint* result_length1,
                                                  GError** error);
static gboolean shell_key_grabber_proxy_ungrab_accelerator (ShellKeyGrabber* self,
                                                     guint action,
                                                     GError** error);
static gboolean shell_key_grabber_proxy_ungrab_accelerators (ShellKeyGrabber* self,
                                                      guint* actions,
                                                      gint actions_length1,
                                                      GError** error);
static void shell_key_grabber_proxy_show_osd (ShellKeyGrabber* self,
                                       GHashTable* parameters_dict,
                                       GError** error);
static void shell_key_grabber_proxy_shell_key_grabber_interface_init (ShellKeyGrabberIface* iface);
static void _dbus_shell_key_grabber_grab_accelerator (ShellKeyGrabber* self,
                                               GVariant* _parameters_,
                                               GDBusMethodInvocation* invocation);
static void _vala_Accelerator_array_free (Accelerator * array,
                                   gssize array_length);
static void _dbus_shell_key_grabber_grab_accelerators (ShellKeyGrabber* self,
                                                GVariant* _parameters_,
                                                GDBusMethodInvocation* invocation);
static void _dbus_shell_key_grabber_ungrab_accelerator (ShellKeyGrabber* self,
                                                 GVariant* _parameters_,
                                                 GDBusMethodInvocation* invocation);
static void _dbus_shell_key_grabber_ungrab_accelerators (ShellKeyGrabber* self,
                                                  GVariant* _parameters_,
                                                  GDBusMethodInvocation* invocation);
static void _dbus_shell_key_grabber_show_osd (ShellKeyGrabber* self,
                                       GVariant* _parameters_,
                                       GDBusMethodInvocation* invocation);
static void shell_key_grabber_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* shell_key_grabber_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 shell_key_grabber_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_shell_key_grabber_accelerator_activated (GObject* _sender,
                                                    guint action,
                                                    GHashTable* parameters_dict,
                                                    gpointer* _data);
static void _shell_key_grabber_unregister_object (gpointer user_data);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static const GDBusArgInfo _shell_key_grabber_dbus_arg_info_grab_accelerator_accelerator = {-1, "accelerator", "s", NULL};
static const GDBusArgInfo _shell_key_grabber_dbus_arg_info_grab_accelerator_mode_flags = {-1, "mode_flags", "u", NULL};
static const GDBusArgInfo _shell_key_grabber_dbus_arg_info_grab_accelerator_grab_flags = {-1, "grab_flags", "u", NULL};
static const GDBusArgInfo _shell_key_grabber_dbus_arg_info_grab_accelerator_result = {-1, "result", "u", NULL};
static const GDBusArgInfo * const _shell_key_grabber_dbus_arg_info_grab_accelerator_in[] = {&_shell_key_grabber_dbus_arg_info_grab_accelerator_accelerator, &_shell_key_grabber_dbus_arg_info_grab_accelerator_mode_flags, &_shell_key_grabber_dbus_arg_info_grab_accelerator_grab_flags, NULL};
static const GDBusArgInfo * const _shell_key_grabber_dbus_arg_info_grab_accelerator_out[] = {&_shell_key_grabber_dbus_arg_info_grab_accelerator_result, NULL};
static const GDBusMethodInfo _shell_key_grabber_dbus_method_info_grab_accelerator = {-1, "GrabAccelerator", (GDBusArgInfo **) (&_shell_key_grabber_dbus_arg_info_grab_accelerator_in), (GDBusArgInfo **) (&_shell_key_grabber_dbus_arg_info_grab_accelerator_out), NULL};
static const GDBusArgInfo _shell_key_grabber_dbus_arg_info_grab_accelerators_accelerators = {-1, "accelerators", "a(suu)", NULL};
static const GDBusArgInfo _shell_key_grabber_dbus_arg_info_grab_accelerators_result = {-1, "result", "au", NULL};
static const GDBusArgInfo * const _shell_key_grabber_dbus_arg_info_grab_accelerators_in[] = {&_shell_key_grabber_dbus_arg_info_grab_accelerators_accelerators, NULL};
static const GDBusArgInfo * const _shell_key_grabber_dbus_arg_info_grab_accelerators_out[] = {&_shell_key_grabber_dbus_arg_info_grab_accelerators_result, NULL};
static const GDBusMethodInfo _shell_key_grabber_dbus_method_info_grab_accelerators = {-1, "GrabAccelerators", (GDBusArgInfo **) (&_shell_key_grabber_dbus_arg_info_grab_accelerators_in), (GDBusArgInfo **) (&_shell_key_grabber_dbus_arg_info_grab_accelerators_out), NULL};
static const GDBusArgInfo _shell_key_grabber_dbus_arg_info_ungrab_accelerator_action = {-1, "action", "u", NULL};
static const GDBusArgInfo _shell_key_grabber_dbus_arg_info_ungrab_accelerator_result = {-1, "result", "b", NULL};
static const GDBusArgInfo * const _shell_key_grabber_dbus_arg_info_ungrab_accelerator_in[] = {&_shell_key_grabber_dbus_arg_info_ungrab_accelerator_action, NULL};
static const GDBusArgInfo * const _shell_key_grabber_dbus_arg_info_ungrab_accelerator_out[] = {&_shell_key_grabber_dbus_arg_info_ungrab_accelerator_result, NULL};
static const GDBusMethodInfo _shell_key_grabber_dbus_method_info_ungrab_accelerator = {-1, "UngrabAccelerator", (GDBusArgInfo **) (&_shell_key_grabber_dbus_arg_info_ungrab_accelerator_in), (GDBusArgInfo **) (&_shell_key_grabber_dbus_arg_info_ungrab_accelerator_out), NULL};
static const GDBusArgInfo _shell_key_grabber_dbus_arg_info_ungrab_accelerators_actions = {-1, "actions", "au", NULL};
static const GDBusArgInfo _shell_key_grabber_dbus_arg_info_ungrab_accelerators_result = {-1, "result", "b", NULL};
static const GDBusArgInfo * const _shell_key_grabber_dbus_arg_info_ungrab_accelerators_in[] = {&_shell_key_grabber_dbus_arg_info_ungrab_accelerators_actions, NULL};
static const GDBusArgInfo * const _shell_key_grabber_dbus_arg_info_ungrab_accelerators_out[] = {&_shell_key_grabber_dbus_arg_info_ungrab_accelerators_result, NULL};
static const GDBusMethodInfo _shell_key_grabber_dbus_method_info_ungrab_accelerators = {-1, "UngrabAccelerators", (GDBusArgInfo **) (&_shell_key_grabber_dbus_arg_info_ungrab_accelerators_in), (GDBusArgInfo **) (&_shell_key_grabber_dbus_arg_info_ungrab_accelerators_out), NULL};
static const GDBusArgInfo _shell_key_grabber_dbus_arg_info_show_osd_parameters_dict = {-1, "parameters_dict", "a{sv}", NULL};
static const GDBusArgInfo * const _shell_key_grabber_dbus_arg_info_show_osd_in[] = {&_shell_key_grabber_dbus_arg_info_show_osd_parameters_dict, NULL};
static const GDBusArgInfo * const _shell_key_grabber_dbus_arg_info_show_osd_out[] = {NULL};
static const GDBusMethodInfo _shell_key_grabber_dbus_method_info_show_osd = {-1, "ShowOSD", (GDBusArgInfo **) (&_shell_key_grabber_dbus_arg_info_show_osd_in), (GDBusArgInfo **) (&_shell_key_grabber_dbus_arg_info_show_osd_out), NULL};
static const GDBusMethodInfo * const _shell_key_grabber_dbus_method_info[] = {&_shell_key_grabber_dbus_method_info_grab_accelerator, &_shell_key_grabber_dbus_method_info_grab_accelerators, &_shell_key_grabber_dbus_method_info_ungrab_accelerator, &_shell_key_grabber_dbus_method_info_ungrab_accelerators, &_shell_key_grabber_dbus_method_info_show_osd, NULL};
static const GDBusArgInfo _shell_key_grabber_dbus_arg_info_accelerator_activated_action = {-1, "action", "u", NULL};
static const GDBusArgInfo _shell_key_grabber_dbus_arg_info_accelerator_activated_parameters_dict = {-1, "parameters_dict", "a{sv}", NULL};
static const GDBusArgInfo * const _shell_key_grabber_dbus_arg_info_accelerator_activated[] = {&_shell_key_grabber_dbus_arg_info_accelerator_activated_action, &_shell_key_grabber_dbus_arg_info_accelerator_activated_parameters_dict, NULL};
static const GDBusSignalInfo _shell_key_grabber_dbus_signal_info_accelerator_activated = {-1, "AcceleratorActivated", (GDBusArgInfo **) (&_shell_key_grabber_dbus_arg_info_accelerator_activated), NULL};
static const GDBusSignalInfo * const _shell_key_grabber_dbus_signal_info[] = {&_shell_key_grabber_dbus_signal_info_accelerator_activated, NULL};
static const GDBusPropertyInfo * const _shell_key_grabber_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _shell_key_grabber_dbus_interface_info = {-1, "org.gnome.Shell", (GDBusMethodInfo **) (&_shell_key_grabber_dbus_method_info), (GDBusSignalInfo **) (&_shell_key_grabber_dbus_signal_info), (GDBusPropertyInfo **) (&_shell_key_grabber_dbus_property_info), NULL};
static const GDBusInterfaceVTable _shell_key_grabber_dbus_interface_vtable = {shell_key_grabber_dbus_interface_method_call, shell_key_grabber_dbus_interface_get_property, shell_key_grabber_dbus_interface_set_property};

/**
 * ActionMode:
 * @NONE: block action
 * @NORMAL: allow action when in window mode, e.g. when the focus is in an application window
 * @OVERVIEW: allow action while the overview is active
 * @LOCK_SCREEN: allow action when the screen is locked, e.g. when the screen shield is shown
 * @UNLOCK_SCREEN: allow action in the unlock dialog
 * @LOGIN_SCREEN: allow action in the login screen
 * @SYSTEM_MODAL: allow action when a system modal dialog (e.g. authentification or session dialogs) is open
 * @LOOKING_GLASS: allow action in looking glass
 * @POPUP: allow action while a shell menu is open
 */
static GType
action_mode_get_type_once (void)
{
	static const GFlagsValue values[] = {{ACTION_MODE_NONE, "ACTION_MODE_NONE", "none"}, {ACTION_MODE_NORMAL, "ACTION_MODE_NORMAL", "normal"}, {ACTION_MODE_OVERVIEW, "ACTION_MODE_OVERVIEW", "overview"}, {ACTION_MODE_LOCK_SCREEN, "ACTION_MODE_LOCK_SCREEN", "lock-screen"}, {ACTION_MODE_UNLOCK_SCREEN, "ACTION_MODE_UNLOCK_SCREEN", "unlock-screen"}, {ACTION_MODE_LOGIN_SCREEN, "ACTION_MODE_LOGIN_SCREEN", "login-screen"}, {ACTION_MODE_SYSTEM_MODAL, "ACTION_MODE_SYSTEM_MODAL", "system-modal"}, {ACTION_MODE_LOOKING_GLASS, "ACTION_MODE_LOOKING_GLASS", "looking-glass"}, {ACTION_MODE_POPUP, "ACTION_MODE_POPUP", "popup"}, {0, NULL, NULL}};
	GType action_mode_type_id;
	action_mode_type_id = g_flags_register_static ("ActionMode", values);
	return action_mode_type_id;
}

GType
action_mode_get_type (void)
{
	static volatile gsize action_mode_type_id__once = 0;
	if (g_once_init_enter (&action_mode_type_id__once)) {
		GType action_mode_type_id;
		action_mode_type_id = action_mode_get_type_once ();
		g_once_init_leave (&action_mode_type_id__once, action_mode_type_id);
	}
	return action_mode_type_id__once;
}

static GType
meta_key_binding_flags_get_type_once (void)
{
	static const GFlagsValue values[] = {{META_KEY_BINDING_FLAGS_NONE, "META_KEY_BINDING_FLAGS_NONE", "none"}, {META_KEY_BINDING_FLAGS_PER_WINDOW, "META_KEY_BINDING_FLAGS_PER_WINDOW", "per-window"}, {META_KEY_BINDING_FLAGS_BUILTIN, "META_KEY_BINDING_FLAGS_BUILTIN", "builtin"}, {META_KEY_BINDING_FLAGS_IS_REVERSED, "META_KEY_BINDING_FLAGS_IS_REVERSED", "is-reversed"}, {META_KEY_BINDING_FLAGS_NON_MASKABLE, "META_KEY_BINDING_FLAGS_NON_MASKABLE", "non-maskable"}, {META_KEY_BINDING_FLAGS_IGNORE_AUTOREPEAT, "META_KEY_BINDING_FLAGS_IGNORE_AUTOREPEAT", "ignore-autorepeat"}, {0, NULL, NULL}};
	GType meta_key_binding_flags_type_id;
	meta_key_binding_flags_type_id = g_flags_register_static ("MetaKeyBindingFlags", values);
	return meta_key_binding_flags_type_id;
}

GType
meta_key_binding_flags_get_type (void)
{
	static volatile gsize meta_key_binding_flags_type_id__once = 0;
	if (g_once_init_enter (&meta_key_binding_flags_type_id__once)) {
		GType meta_key_binding_flags_type_id;
		meta_key_binding_flags_type_id = meta_key_binding_flags_get_type_once ();
		g_once_init_leave (&meta_key_binding_flags_type_id__once, meta_key_binding_flags_type_id);
	}
	return meta_key_binding_flags_type_id__once;
}

void
accelerator_copy (const Accelerator* self,
                  Accelerator* dest)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	_tmp0_ = (*self).name;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 ((*dest).name);
	(*dest).name = _tmp1_;
	(*dest).mode_flags = (*self).mode_flags;
	(*dest).grab_flags = (*self).grab_flags;
}

void
accelerator_destroy (Accelerator* self)
{
	_g_free0 ((*self).name);
}

Accelerator*
accelerator_dup (const Accelerator* self)
{
	Accelerator* dup;
	dup = g_new0 (Accelerator, 1);
	accelerator_copy (self, dup);
	return dup;
}

void
accelerator_free (Accelerator* self)
{
	accelerator_destroy (self);
	g_free (self);
}

static GType
accelerator_get_type_once (void)
{
	GType accelerator_type_id;
	accelerator_type_id = g_boxed_type_register_static ("Accelerator", (GBoxedCopyFunc) accelerator_dup, (GBoxedFreeFunc) accelerator_free);
	return accelerator_type_id;
}

GType
accelerator_get_type (void)
{
	static volatile gsize accelerator_type_id__once = 0;
	if (g_once_init_enter (&accelerator_type_id__once)) {
		GType accelerator_type_id;
		accelerator_type_id = accelerator_get_type_once ();
		g_once_init_leave (&accelerator_type_id__once, accelerator_type_id);
	}
	return accelerator_type_id__once;
}

guint
shell_key_grabber_grab_accelerator (ShellKeyGrabber* self,
                                    const gchar* accelerator,
                                    ActionMode mode_flags,
                                    MetaKeyBindingFlags grab_flags,
                                    GError** error)
{
	ShellKeyGrabberIface* _iface_;
	g_return_val_if_fail (self != NULL, 0U);
	_iface_ = SHELL_KEY_GRABBER_GET_INTERFACE (self);
	if (_iface_->grab_accelerator) {
		return _iface_->grab_accelerator (self, accelerator, mode_flags, grab_flags, error);
	}
	return 0U;
}

guint*
shell_key_grabber_grab_accelerators (ShellKeyGrabber* self,
                                     Accelerator* accelerators,
                                     gint accelerators_length1,
                                     gint* result_length1,
                                     GError** error)
{
	ShellKeyGrabberIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = SHELL_KEY_GRABBER_GET_INTERFACE (self);
	if (_iface_->grab_accelerators) {
		return _iface_->grab_accelerators (self, accelerators, accelerators_length1, result_length1, error);
	}
	return NULL;
}

gboolean
shell_key_grabber_ungrab_accelerator (ShellKeyGrabber* self,
                                      guint action,
                                      GError** error)
{
	ShellKeyGrabberIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = SHELL_KEY_GRABBER_GET_INTERFACE (self);
	if (_iface_->ungrab_accelerator) {
		return _iface_->ungrab_accelerator (self, action, error);
	}
	return FALSE;
}

gboolean
shell_key_grabber_ungrab_accelerators (ShellKeyGrabber* self,
                                       guint* actions,
                                       gint actions_length1,
                                       GError** error)
{
	ShellKeyGrabberIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = SHELL_KEY_GRABBER_GET_INTERFACE (self);
	if (_iface_->ungrab_accelerators) {
		return _iface_->ungrab_accelerators (self, actions, actions_length1, error);
	}
	return FALSE;
}

void
shell_key_grabber_show_osd (ShellKeyGrabber* self,
                            GHashTable* parameters_dict,
                            GError** error)
{
	ShellKeyGrabberIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = SHELL_KEY_GRABBER_GET_INTERFACE (self);
	if (_iface_->show_osd) {
		_iface_->show_osd (self, parameters_dict, error);
	}
}

static void
g_cclosure_user_marshal_VOID__UINT_BOXED (GClosure * closure,
                                          GValue * return_value,
                                          guint n_param_values,
                                          const GValue * param_values,
                                          gpointer invocation_hint,
                                          gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__UINT_BOXED) (gpointer data1, guint arg_1, gpointer arg_2, gpointer data2);
	register GMarshalFunc_VOID__UINT_BOXED callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 3);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__UINT_BOXED) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_uint (param_values + 1), g_value_get_boxed (param_values + 2), data2);
}

static void
shell_key_grabber_default_init (ShellKeyGrabberIface * iface,
                                gpointer iface_data)
{
	shell_key_grabber_signals[SHELL_KEY_GRABBER_ACCELERATOR_ACTIVATED_SIGNAL] = g_signal_new ("accelerator-activated", TYPE_SHELL_KEY_GRABBER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__UINT_BOXED, G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_HASH_TABLE);
}

static GType
shell_key_grabber_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ShellKeyGrabberIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) shell_key_grabber_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType shell_key_grabber_type_id;
	shell_key_grabber_type_id = g_type_register_static (G_TYPE_INTERFACE, "ShellKeyGrabber", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (shell_key_grabber_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (shell_key_grabber_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) shell_key_grabber_proxy_get_type);
	g_type_set_qdata (shell_key_grabber_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.gnome.Shell");
	g_type_set_qdata (shell_key_grabber_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_shell_key_grabber_dbus_interface_info));
	g_type_set_qdata (shell_key_grabber_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) shell_key_grabber_register_object);
	return shell_key_grabber_type_id;
}

GType
shell_key_grabber_get_type (void)
{
	static volatile gsize shell_key_grabber_type_id__once = 0;
	if (g_once_init_enter (&shell_key_grabber_type_id__once)) {
		GType shell_key_grabber_type_id;
		shell_key_grabber_type_id = shell_key_grabber_get_type_once ();
		g_once_init_leave (&shell_key_grabber_type_id__once, shell_key_grabber_type_id);
	}
	return shell_key_grabber_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (ShellKeyGrabberProxy, shell_key_grabber_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (TYPE_SHELL_KEY_GRABBER, shell_key_grabber_proxy_shell_key_grabber_interface_init) )
static void
shell_key_grabber_proxy_class_init (ShellKeyGrabberProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = shell_key_grabber_proxy_g_signal;
}

static void
_dbus_handle_shell_key_grabber_accelerator_activated (ShellKeyGrabber* self,
                                                      GVariant* parameters)
{
	GVariantIter _arguments_iter;
	guint action = 0U;
	GVariant* _tmp68_;
	GHashTable* parameters_dict = NULL;
	GVariant* _tmp69_;
	GHashTable* _tmp70_;
	GVariantIter _tmp71_;
	GVariant* _tmp72_;
	GVariant* _tmp73_;
	g_variant_iter_init (&_arguments_iter, parameters);
	_tmp68_ = g_variant_iter_next_value (&_arguments_iter);
	action = g_variant_get_uint32 (_tmp68_);
	g_variant_unref (_tmp68_);
	_tmp69_ = g_variant_iter_next_value (&_arguments_iter);
	_tmp70_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_variant_unref);
	g_variant_iter_init (&_tmp71_, _tmp69_);
	while (g_variant_iter_loop (&_tmp71_, "{?*}", &_tmp72_, &_tmp73_)) {
		g_hash_table_insert (_tmp70_, g_variant_dup_string (_tmp72_, NULL), g_variant_get_variant (_tmp73_));
	}
	parameters_dict = _tmp70_;
	g_variant_unref (_tmp69_);
	g_signal_emit_by_name (self, "accelerator-activated", action, parameters_dict);
	_g_hash_table_unref0 (parameters_dict);
}

static void
shell_key_grabber_proxy_g_signal (GDBusProxy* proxy,
                                  const gchar* sender_name,
                                  const gchar* signal_name,
                                  GVariant* parameters)
{
	if (strcmp (signal_name, "AcceleratorActivated") == 0) {
		_dbus_handle_shell_key_grabber_accelerator_activated ((ShellKeyGrabber*) proxy, parameters);
	}
}

static void
shell_key_grabber_proxy_init (ShellKeyGrabberProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_shell_key_grabber_dbus_interface_info));
}

static guint
shell_key_grabber_proxy_grab_accelerator (ShellKeyGrabber* self,
                                          const gchar* accelerator,
                                          ActionMode mode_flags,
                                          MetaKeyBindingFlags grab_flags,
                                          GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	guint _result = 0U;
	GVariant* _tmp76_;
	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.gnome.Shell", "GrabAccelerator");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (accelerator));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_uint32 (mode_flags));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_uint32 (grab_flags));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	_reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error);
	g_object_unref (_message);
	if (!_reply_message) {
		guint _tmp74_ = 0U;
		return _tmp74_;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		guint _tmp75_ = 0U;
		g_object_unref (_reply_message);
		return _tmp75_;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_tmp76_ = g_variant_iter_next_value (&_reply_iter);
	_result = g_variant_get_uint32 (_tmp76_);
	g_variant_unref (_tmp76_);
	g_object_unref (_reply_message);
	return _result;
}

static guint*
shell_key_grabber_proxy_grab_accelerators (ShellKeyGrabber* self,
                                           Accelerator* accelerators,
                                           gint accelerators_length1,
                                           gint* result_length1,
                                           GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	Accelerator* _tmp77_;
	GVariantBuilder _tmp78_;
	gint _tmp79_;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	guint* _result = NULL;
	gint _result_length1;
	GVariant* _tmp81_;
	guint* _tmp82_;
	gint _tmp82__length;
	gint _tmp82__size;
	gint _tmp82__length1;
	GVariantIter _tmp83_;
	GVariant* _tmp84_;
	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.gnome.Shell", "GrabAccelerators");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_tmp77_ = accelerators;
	g_variant_builder_init (&_tmp78_, G_VARIANT_TYPE ("a(suu)"));
	for (_tmp79_ = 0; _tmp79_ < accelerators_length1; _tmp79_++) {
		GVariantBuilder _tmp80_;
		g_variant_builder_init (&_tmp80_, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_tmp80_, g_variant_new_string ((*_tmp77_).name));
		g_variant_builder_add_value (&_tmp80_, g_variant_new_uint32 ((*_tmp77_).mode_flags));
		g_variant_builder_add_value (&_tmp80_, g_variant_new_uint32 ((*_tmp77_).grab_flags));
		g_variant_builder_add_value (&_tmp78_, g_variant_builder_end (&_tmp80_));
		_tmp77_++;
	}
	g_variant_builder_add_value (&_arguments_builder, g_variant_builder_end (&_tmp78_));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	_reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error);
	g_object_unref (_message);
	if (!_reply_message) {
		return NULL;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return NULL;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_result_length1 = 0;
	_tmp81_ = g_variant_iter_next_value (&_reply_iter);
	_tmp82_ = g_new (guint, 5);
	_tmp82__length = 0;
	_tmp82__size = 4;
	_tmp82__length1 = 0;
	g_variant_iter_init (&_tmp83_, _tmp81_);
	for (; (_tmp84_ = g_variant_iter_next_value (&_tmp83_)) != NULL; _tmp82__length1++) {
		if (_tmp82__size == _tmp82__length) {
			_tmp82__size = 2 * _tmp82__size;
			_tmp82_ = g_renew (guint, _tmp82_, _tmp82__size + 1);
		}
		_tmp82_[_tmp82__length++] = g_variant_get_uint32 (_tmp84_);
		g_variant_unref (_tmp84_);
	}
	_result_length1 = _tmp82__length1;
	_result = _tmp82_;
	g_variant_unref (_tmp81_);
	*result_length1 = _result_length1;
	g_object_unref (_reply_message);
	return _result;
}

static gboolean
shell_key_grabber_proxy_ungrab_accelerator (ShellKeyGrabber* self,
                                            guint action,
                                            GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	gboolean _result = FALSE;
	GVariant* _tmp87_;
	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.gnome.Shell", "UngrabAccelerator");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_uint32 (action));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	_reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error);
	g_object_unref (_message);
	if (!_reply_message) {
		gboolean _tmp85_ = FALSE;
		return _tmp85_;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		gboolean _tmp86_ = FALSE;
		g_object_unref (_reply_message);
		return _tmp86_;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_tmp87_ = g_variant_iter_next_value (&_reply_iter);
	_result = g_variant_get_boolean (_tmp87_);
	g_variant_unref (_tmp87_);
	g_object_unref (_reply_message);
	return _result;
}

static gboolean
shell_key_grabber_proxy_ungrab_accelerators (ShellKeyGrabber* self,
                                             guint* actions,
                                             gint actions_length1,
                                             GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	guint* _tmp88_;
	GVariantBuilder _tmp89_;
	gint _tmp90_;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	gboolean _result = FALSE;
	GVariant* _tmp93_;
	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.gnome.Shell", "UngrabAccelerators");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_tmp88_ = actions;
	g_variant_builder_init (&_tmp89_, G_VARIANT_TYPE ("au"));
	for (_tmp90_ = 0; _tmp90_ < actions_length1; _tmp90_++) {
		g_variant_builder_add_value (&_tmp89_, g_variant_new_uint32 (*_tmp88_));
		_tmp88_++;
	}
	g_variant_builder_add_value (&_arguments_builder, g_variant_builder_end (&_tmp89_));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	_reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error);
	g_object_unref (_message);
	if (!_reply_message) {
		gboolean _tmp91_ = FALSE;
		return _tmp91_;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		gboolean _tmp92_ = FALSE;
		g_object_unref (_reply_message);
		return _tmp92_;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_tmp93_ = g_variant_iter_next_value (&_reply_iter);
	_result = g_variant_get_boolean (_tmp93_);
	g_variant_unref (_tmp93_);
	g_object_unref (_reply_message);
	return _result;
}

static void
shell_key_grabber_proxy_show_osd (ShellKeyGrabber* self,
                                  GHashTable* parameters_dict,
                                  GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GVariantBuilder _tmp94_;
	GHashTableIter _tmp95_;
	gpointer _tmp96_;
	gpointer _tmp97_;
	GDBusMessage *_reply_message;
	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.gnome.Shell", "ShowOSD");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_hash_table_iter_init (&_tmp95_, parameters_dict);
	g_variant_builder_init (&_tmp94_, G_VARIANT_TYPE ("a{sv}"));
	while (g_hash_table_iter_next (&_tmp95_, &_tmp96_, &_tmp97_)) {
		gchar* _key;
		GVariant* _value;
		_key = (gchar*) _tmp96_;
		_value = (GVariant*) _tmp97_;
		g_variant_builder_add (&_tmp94_, "{?*}", g_variant_new_string (_key), g_variant_new_variant (_value));
	}
	g_variant_builder_add_value (&_arguments_builder, g_variant_builder_end (&_tmp94_));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	_reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error);
	g_object_unref (_message);
	if (!_reply_message) {
		return;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return;
	}
	g_object_unref (_reply_message);
}

static void
shell_key_grabber_proxy_shell_key_grabber_interface_init (ShellKeyGrabberIface* iface)
{
	iface->grab_accelerator = shell_key_grabber_proxy_grab_accelerator;
	iface->grab_accelerators = shell_key_grabber_proxy_grab_accelerators;
	iface->ungrab_accelerator = shell_key_grabber_proxy_ungrab_accelerator;
	iface->ungrab_accelerators = shell_key_grabber_proxy_ungrab_accelerators;
	iface->show_osd = shell_key_grabber_proxy_show_osd;
}

static void
_dbus_shell_key_grabber_grab_accelerator (ShellKeyGrabber* self,
                                          GVariant* _parameters_,
                                          GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gchar* accelerator = NULL;
	GVariant* _tmp98_;
	ActionMode mode_flags = 0U;
	GVariant* _tmp99_;
	MetaKeyBindingFlags grab_flags = 0U;
	GVariant* _tmp100_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	guint result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp98_ = g_variant_iter_next_value (&_arguments_iter);
	accelerator = g_variant_dup_string (_tmp98_, NULL);
	g_variant_unref (_tmp98_);
	_tmp99_ = g_variant_iter_next_value (&_arguments_iter);
	mode_flags = g_variant_get_uint32 (_tmp99_);
	g_variant_unref (_tmp99_);
	_tmp100_ = g_variant_iter_next_value (&_arguments_iter);
	grab_flags = g_variant_get_uint32 (_tmp100_);
	g_variant_unref (_tmp100_);
	result = shell_key_grabber_grab_accelerator (self, accelerator, mode_flags, grab_flags, &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);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_uint32 (result));
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	_g_free0 (accelerator);
	;
}

static void
_vala_Accelerator_array_free (Accelerator * array,
                              gssize array_length)
{
	if (array != NULL) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			accelerator_destroy (&array[i]);
		}
	}
	g_free (array);
}

static void
_dbus_shell_key_grabber_grab_accelerators (ShellKeyGrabber* self,
                                           GVariant* _parameters_,
                                           GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	Accelerator* accelerators = NULL;
	gint accelerators_length1 = 0;
	GVariant* _tmp101_;
	Accelerator* _tmp102_;
	gint _tmp102__length;
	gint _tmp102__size;
	gint _tmp102__length1;
	GVariantIter _tmp103_;
	GVariant* _tmp104_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	guint* result;
	gint result_length1 = 0;
	guint* _tmp110_;
	GVariantBuilder _tmp111_;
	gint _tmp112_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp101_ = g_variant_iter_next_value (&_arguments_iter);
	_tmp102_ = g_new (Accelerator, 5);
	_tmp102__length = 0;
	_tmp102__size = 4;
	_tmp102__length1 = 0;
	g_variant_iter_init (&_tmp103_, _tmp101_);
	for (; (_tmp104_ = g_variant_iter_next_value (&_tmp103_)) != NULL; _tmp102__length1++) {
		Accelerator _tmp105_;
		GVariantIter _tmp106_;
		GVariant* _tmp107_;
		GVariant* _tmp108_;
		GVariant* _tmp109_;
		if (_tmp102__size == _tmp102__length) {
			_tmp102__size = 2 * _tmp102__size;
			_tmp102_ = g_renew (Accelerator, _tmp102_, _tmp102__size + 1);
		}
		g_variant_iter_init (&_tmp106_, _tmp104_);
		_tmp107_ = g_variant_iter_next_value (&_tmp106_);
		_tmp105_.name = g_variant_dup_string (_tmp107_, NULL);
		g_variant_unref (_tmp107_);
		_tmp108_ = g_variant_iter_next_value (&_tmp106_);
		_tmp105_.mode_flags = g_variant_get_uint32 (_tmp108_);
		g_variant_unref (_tmp108_);
		_tmp109_ = g_variant_iter_next_value (&_tmp106_);
		_tmp105_.grab_flags = g_variant_get_uint32 (_tmp109_);
		g_variant_unref (_tmp109_);
		_tmp102_[_tmp102__length++] = _tmp105_;
		g_variant_unref (_tmp104_);
	}
	accelerators_length1 = _tmp102__length1;
	accelerators = _tmp102_;
	g_variant_unref (_tmp101_);
	result = shell_key_grabber_grab_accelerators (self, accelerators, accelerators_length1, &result_length1, &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);
	_tmp110_ = result;
	g_variant_builder_init (&_tmp111_, G_VARIANT_TYPE ("au"));
	for (_tmp112_ = 0; _tmp112_ < result_length1; _tmp112_++) {
		g_variant_builder_add_value (&_tmp111_, g_variant_new_uint32 (*_tmp110_));
		_tmp110_++;
	}
	g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp111_));
	result = (g_free (result), NULL);
	_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:
	accelerators = (_vala_Accelerator_array_free (accelerators, accelerators_length1), NULL);
	;
}

static void
_dbus_shell_key_grabber_ungrab_accelerator (ShellKeyGrabber* self,
                                            GVariant* _parameters_,
                                            GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	guint action = 0U;
	GVariant* _tmp113_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gboolean result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp113_ = g_variant_iter_next_value (&_arguments_iter);
	action = g_variant_get_uint32 (_tmp113_);
	g_variant_unref (_tmp113_);
	result = shell_key_grabber_ungrab_accelerator (self, action, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_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);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_boolean (result));
	_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);
}

static void
_dbus_shell_key_grabber_ungrab_accelerators (ShellKeyGrabber* self,
                                             GVariant* _parameters_,
                                             GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	guint* actions = NULL;
	gint actions_length1 = 0;
	GVariant* _tmp114_;
	guint* _tmp115_;
	gint _tmp115__length;
	gint _tmp115__size;
	gint _tmp115__length1;
	GVariantIter _tmp116_;
	GVariant* _tmp117_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gboolean result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp114_ = g_variant_iter_next_value (&_arguments_iter);
	_tmp115_ = g_new (guint, 5);
	_tmp115__length = 0;
	_tmp115__size = 4;
	_tmp115__length1 = 0;
	g_variant_iter_init (&_tmp116_, _tmp114_);
	for (; (_tmp117_ = g_variant_iter_next_value (&_tmp116_)) != NULL; _tmp115__length1++) {
		if (_tmp115__size == _tmp115__length) {
			_tmp115__size = 2 * _tmp115__size;
			_tmp115_ = g_renew (guint, _tmp115_, _tmp115__size + 1);
		}
		_tmp115_[_tmp115__length++] = g_variant_get_uint32 (_tmp117_);
		g_variant_unref (_tmp117_);
	}
	actions_length1 = _tmp115__length1;
	actions = _tmp115_;
	g_variant_unref (_tmp114_);
	result = shell_key_grabber_ungrab_accelerators (self, actions, actions_length1, &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);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_boolean (result));
	_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:
	actions = (g_free (actions), NULL);
	;
}

static void
_dbus_shell_key_grabber_show_osd (ShellKeyGrabber* self,
                                  GVariant* _parameters_,
                                  GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GHashTable* parameters_dict = NULL;
	GVariant* _tmp118_;
	GHashTable* _tmp119_;
	GVariantIter _tmp120_;
	GVariant* _tmp121_;
	GVariant* _tmp122_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp118_ = g_variant_iter_next_value (&_arguments_iter);
	_tmp119_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_variant_unref);
	g_variant_iter_init (&_tmp120_, _tmp118_);
	while (g_variant_iter_loop (&_tmp120_, "{?*}", &_tmp121_, &_tmp122_)) {
		g_hash_table_insert (_tmp119_, g_variant_dup_string (_tmp121_, NULL), g_variant_get_variant (_tmp122_));
	}
	parameters_dict = _tmp119_;
	g_variant_unref (_tmp118_);
	shell_key_grabber_show_osd (self, parameters_dict, &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_hash_table_unref0 (parameters_dict);
	;
}

static void
shell_key_grabber_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, "GrabAccelerator") == 0) {
		_dbus_shell_key_grabber_grab_accelerator (object, parameters, invocation);
	} else if (strcmp (method_name, "GrabAccelerators") == 0) {
		_dbus_shell_key_grabber_grab_accelerators (object, parameters, invocation);
	} else if (strcmp (method_name, "UngrabAccelerator") == 0) {
		_dbus_shell_key_grabber_ungrab_accelerator (object, parameters, invocation);
	} else if (strcmp (method_name, "UngrabAccelerators") == 0) {
		_dbus_shell_key_grabber_ungrab_accelerators (object, parameters, invocation);
	} else if (strcmp (method_name, "ShowOSD") == 0) {
		_dbus_shell_key_grabber_show_osd (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
shell_key_grabber_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
shell_key_grabber_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_shell_key_grabber_accelerator_activated (GObject* _sender,
                                               guint action,
                                               GHashTable* parameters_dict,
                                               gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GVariantBuilder _tmp123_;
	GHashTableIter _tmp124_;
	gpointer _tmp125_;
	gpointer _tmp126_;
	_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_uint32 (action));
	g_hash_table_iter_init (&_tmp124_, parameters_dict);
	g_variant_builder_init (&_tmp123_, G_VARIANT_TYPE ("a{sv}"));
	while (g_hash_table_iter_next (&_tmp124_, &_tmp125_, &_tmp126_)) {
		gchar* _key;
		GVariant* _value;
		_key = (gchar*) _tmp125_;
		_value = (GVariant*) _tmp126_;
		g_variant_builder_add (&_tmp123_, "{?*}", g_variant_new_string (_key), g_variant_new_variant (_value));
	}
	g_variant_builder_add_value (&_arguments_builder, g_variant_builder_end (&_tmp123_));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.gnome.Shell", "AcceleratorActivated", _arguments, NULL);
}

guint
shell_key_grabber_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 *) (&_shell_key_grabber_dbus_interface_info), &_shell_key_grabber_dbus_interface_vtable, data, _shell_key_grabber_unregister_object, error);
	if (!result) {
		return 0;
	}
	g_signal_connect (object, "accelerator-activated", (GCallback) _dbus_shell_key_grabber_accelerator_activated, data);
	return result;
}

static void
_shell_key_grabber_unregister_object (gpointer user_data)
{
	gpointer* data;
	data = user_data;
	g_signal_handlers_disconnect_by_func (data[0], _dbus_shell_key_grabber_accelerator_activated, 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;
}

