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

/*///////////////////////////////////////////////////////////////////////*/
/* Copyright 2011-2021 Simon Schneegans*/
/**/
/* Permission is hereby granted, free of charge, to any person obtaining*/
/* a copy of this software and associated documentation files (the*/
/* "Software"), to deal in the Software without restriction, including*/
/* without limitation the rights to use, copy, modify, merge, publish,*/
/* distribute, sublicense, and/or sell copies of the Software, and to*/
/* permit persons to whom the Software is furnished to do so, subject to*/
/* the following conditions:*/
/* */
/* The above copyright notice and this permission notice shall be*/
/* included in all copies or substantial portions of the Software.*/
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,*/
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF*/
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY*/
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,*/
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE*/
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/
/*///////////////////////////////////////////////////////////////////////*/

#include <glib-object.h>
#include <gee.h>
#include <glib.h>
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <X11/Xutil.h>
#include <X11/Xregion.h>
#include <gdk/gdk.h>
#include <stdlib.h>
#include <string.h>
#include <gdk/gdkx.h>
#include <glib/gi18n-lib.h>
#include <X11/extensions/XTest.h>
#include <gobject/gvaluecollector.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 GNOME_PIE_TYPE_BINDING_MANAGER (gnome_pie_binding_manager_get_type ())
#define GNOME_PIE_BINDING_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_BINDING_MANAGER, GnomePieBindingManager))
#define GNOME_PIE_BINDING_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_BINDING_MANAGER, GnomePieBindingManagerClass))
#define GNOME_PIE_IS_BINDING_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_BINDING_MANAGER))
#define GNOME_PIE_IS_BINDING_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_BINDING_MANAGER))
#define GNOME_PIE_BINDING_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_BINDING_MANAGER, GnomePieBindingManagerClass))

typedef struct _GnomePieBindingManager GnomePieBindingManager;
typedef struct _GnomePieBindingManagerClass GnomePieBindingManagerClass;
typedef struct _GnomePieBindingManagerPrivate GnomePieBindingManagerPrivate;

#define GNOME_PIE_BINDING_MANAGER_TYPE_KEYBINDING (gnome_pie_binding_manager_keybinding_get_type ())
#define GNOME_PIE_BINDING_MANAGER_KEYBINDING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_BINDING_MANAGER_TYPE_KEYBINDING, GnomePieBindingManagerKeybinding))
#define GNOME_PIE_BINDING_MANAGER_KEYBINDING_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_BINDING_MANAGER_TYPE_KEYBINDING, GnomePieBindingManagerKeybindingClass))
#define GNOME_PIE_BINDING_MANAGER_IS_KEYBINDING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_BINDING_MANAGER_TYPE_KEYBINDING))
#define GNOME_PIE_BINDING_MANAGER_IS_KEYBINDING_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_BINDING_MANAGER_TYPE_KEYBINDING))
#define GNOME_PIE_BINDING_MANAGER_KEYBINDING_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_BINDING_MANAGER_TYPE_KEYBINDING, GnomePieBindingManagerKeybindingClass))

typedef struct _GnomePieBindingManagerKeybinding GnomePieBindingManagerKeybinding;
typedef struct _GnomePieBindingManagerKeybindingClass GnomePieBindingManagerKeybindingClass;
enum  {
	GNOME_PIE_BINDING_MANAGER_0_PROPERTY,
	GNOME_PIE_BINDING_MANAGER_NUM_PROPERTIES
};
static GParamSpec* gnome_pie_binding_manager_properties[GNOME_PIE_BINDING_MANAGER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) ((var == NULL) ? NULL : (var = (g_free (var), NULL)))
#define _gnome_pie_binding_manager_keybinding_unref0(var) ((var == NULL) ? NULL : (var = (gnome_pie_binding_manager_keybinding_unref (var), NULL)))

#define GNOME_PIE_TYPE_TRIGGER (gnome_pie_trigger_get_type ())
#define GNOME_PIE_TRIGGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_TRIGGER, GnomePieTrigger))
#define GNOME_PIE_TRIGGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_TRIGGER, GnomePieTriggerClass))
#define GNOME_PIE_IS_TRIGGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_TRIGGER))
#define GNOME_PIE_IS_TRIGGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_TRIGGER))
#define GNOME_PIE_TRIGGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_TRIGGER, GnomePieTriggerClass))

typedef struct _GnomePieTrigger GnomePieTrigger;
typedef struct _GnomePieTriggerClass GnomePieTriggerClass;
typedef struct _Block23Data Block23Data;
typedef struct _Block24Data Block24Data;
typedef struct _GnomePieBindingManagerKeybindingPrivate GnomePieBindingManagerKeybindingPrivate;
typedef struct _GnomePieBindingManagerParamSpecKeybinding GnomePieBindingManagerParamSpecKeybinding;
enum  {
	GNOME_PIE_BINDING_MANAGER_ON_PRESS_SIGNAL,
	GNOME_PIE_BINDING_MANAGER_ON_RELEASE_SIGNAL,
	GNOME_PIE_BINDING_MANAGER_NUM_SIGNALS
};
static guint gnome_pie_binding_manager_signals[GNOME_PIE_BINDING_MANAGER_NUM_SIGNALS] = {0};

struct _GnomePieBindingManager {
	GObject parent_instance;
	GnomePieBindingManagerPrivate * priv;
};

struct _GnomePieBindingManagerClass {
	GObjectClass parent_class;
};

struct _GnomePieBindingManagerPrivate {
	GeeList* bindings;
	guint32 delayed_count;
	XEvent* delayed_event;
	GnomePieBindingManagerKeybinding* delayed_binding;
	gboolean wayland;
};

struct _Block23Data {
	int _ref_count_;
	GnomePieBindingManager* self;
	GnomePieBindingManagerKeybinding* binding;
};

struct _Block24Data {
	int _ref_count_;
	Block23Data * _data23_;
	guint32 current_count;
};

struct _GnomePieBindingManagerKeybinding {
	GTypeInstance parent_instance;
	volatile int ref_count;
	GnomePieBindingManagerKeybindingPrivate * priv;
};

struct _GnomePieBindingManagerKeybindingClass {
	GTypeClass parent_class;
	void (*finalize) (GnomePieBindingManagerKeybinding *self);
};

struct _GnomePieBindingManagerKeybindingPrivate {
	GnomePieTrigger* _trigger;
	gchar* _id;
};

struct _GnomePieBindingManagerParamSpecKeybinding {
	GParamSpec parent_instance;
};

static gint GnomePieBindingManager_private_offset;
static gpointer gnome_pie_binding_manager_parent_class = NULL;
static guint* gnome_pie_binding_manager_lock_modifiers;
static gint gnome_pie_binding_manager_lock_modifiers_length1;
static guint* gnome_pie_binding_manager_lock_modifiers = NULL;
static gint gnome_pie_binding_manager_lock_modifiers_length1 = 0;
static gint _gnome_pie_binding_manager_lock_modifiers_size_ = 0;
static gint GnomePieBindingManagerKeybinding_private_offset;
static gpointer gnome_pie_binding_manager_keybinding_parent_class = NULL;

VALA_EXTERN GType gnome_pie_binding_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieBindingManager, g_object_unref)
static gpointer gnome_pie_binding_manager_keybinding_ref (gpointer instance);
static void gnome_pie_binding_manager_keybinding_unref (gpointer instance);
static GParamSpec* gnome_pie_binding_manager_param_spec_keybinding (const gchar* name,
                                                             const gchar* nick,
                                                             const gchar* blurb,
                                                             GType object_type,
                                                             GParamFlags flags) G_GNUC_UNUSED ;
static void gnome_pie_binding_manager_value_set_keybinding (GValue* value,
                                                     gpointer v_object) G_GNUC_UNUSED ;
static void gnome_pie_binding_manager_value_take_keybinding (GValue* value,
                                                      gpointer v_object) G_GNUC_UNUSED ;
static gpointer gnome_pie_binding_manager_value_get_keybinding (const GValue* value) G_GNUC_UNUSED ;
static GType gnome_pie_binding_manager_keybinding_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieBindingManagerKeybinding, gnome_pie_binding_manager_keybinding_unref)
VALA_EXTERN GnomePieBindingManager* gnome_pie_binding_manager_new (void);
VALA_EXTERN GnomePieBindingManager* gnome_pie_binding_manager_construct (GType object_type);
static GdkFilterReturn gnome_pie_binding_manager_event_filter (GnomePieBindingManager* self,
                                                        GdkXEvent* gdk_xevent,
                                                        GdkEvent* gdk_event);
static GdkFilterReturn _gnome_pie_binding_manager_event_filter_gdk_filter_func (GdkXEvent* xevent,
                                                                         GdkEvent* event,
                                                                         gpointer self);
VALA_EXTERN GType gnome_pie_trigger_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieTrigger, g_object_unref)
VALA_EXTERN void gnome_pie_binding_manager_bind (GnomePieBindingManager* self,
                                     GnomePieTrigger* trigger,
                                     const gchar* id);
VALA_EXTERN gint gnome_pie_trigger_get_key_code (GnomePieTrigger* self);
static GdkModifierType gnome_pie_binding_manager_prepare_modifiers (GnomePieBindingManager* self,
                                                             GdkModifierType mods);
VALA_EXTERN GdkModifierType gnome_pie_trigger_get_modifiers (GnomePieTrigger* self);
VALA_EXTERN gboolean gnome_pie_trigger_get_with_mouse (GnomePieTrigger* self);
static GnomePieBindingManagerKeybinding* gnome_pie_binding_manager_keybinding_new (GnomePieTrigger* trigger,
                                                                            const gchar* id);
static GnomePieBindingManagerKeybinding* gnome_pie_binding_manager_keybinding_construct (GType object_type,
                                                                                  GnomePieTrigger* trigger,
                                                                                  const gchar* id);
VALA_EXTERN void gnome_pie_binding_manager_unbind (GnomePieBindingManager* self,
                                       const gchar* id);
static const gchar* gnome_pie_binding_manager_keybinding_get_id (GnomePieBindingManagerKeybinding* self);
static GnomePieTrigger* gnome_pie_binding_manager_keybinding_get_trigger (GnomePieBindingManagerKeybinding* self);
VALA_EXTERN gchar* gnome_pie_binding_manager_get_accelerator_label_of (GnomePieBindingManager* self,
                                                           const gchar* id);
VALA_EXTERN const gchar* gnome_pie_trigger_get_label_with_specials (GnomePieTrigger* self);
VALA_EXTERN gchar* gnome_pie_binding_manager_get_accelerator_of (GnomePieBindingManager* self,
                                                     const gchar* id);
VALA_EXTERN const gchar* gnome_pie_trigger_get_name (GnomePieTrigger* self);
VALA_EXTERN gboolean gnome_pie_binding_manager_get_is_turbo (GnomePieBindingManager* self,
                                                 const gchar* id);
VALA_EXTERN gboolean gnome_pie_trigger_get_turbo (GnomePieTrigger* self);
VALA_EXTERN gboolean gnome_pie_binding_manager_get_is_centered (GnomePieBindingManager* self,
                                                    const gchar* id);
VALA_EXTERN gboolean gnome_pie_trigger_get_centered (GnomePieTrigger* self);
VALA_EXTERN gboolean gnome_pie_binding_manager_get_is_warp (GnomePieBindingManager* self,
                                                const gchar* id);
VALA_EXTERN gboolean gnome_pie_trigger_get_warp (GnomePieTrigger* self);
VALA_EXTERN gboolean gnome_pie_binding_manager_get_is_auto_shape (GnomePieBindingManager* self,
                                                      const gchar* id);
VALA_EXTERN gint gnome_pie_trigger_get_shape (GnomePieTrigger* self);
VALA_EXTERN gint gnome_pie_binding_manager_get_shape_number (GnomePieBindingManager* self,
                                                 const gchar* id);
VALA_EXTERN gchar* gnome_pie_binding_manager_get_assigned_id (GnomePieBindingManager* self,
                                                  GnomePieTrigger* trigger);
VALA_EXTERN gchar* gnome_pie_trigger_remove_optional (const gchar* trigger);
VALA_EXTERN gboolean gnome_pie_trigger_get_delayed (GnomePieTrigger* self);
static void gnome_pie_binding_manager_activate_delayed (GnomePieBindingManager* self,
                                                 GnomePieBindingManagerKeybinding* binding,
                                                 XEvent* event);
static void gnome_pie_binding_manager_cancel_activate_delayed (GnomePieBindingManager* self);
static Block23Data* block23_data_ref (Block23Data* _data23_);
static void block23_data_unref (void * _userdata_);
static Block24Data* block24_data_ref (Block24Data* _data24_);
static void block24_data_unref (void * _userdata_);
static XEvent* _event_dup (XEvent* self);
static gboolean ___lambda5_ (Block24Data* _data24_);
static gboolean ____lambda5__gsource_func (gpointer self);
static void gnome_pie_binding_manager_keybinding_set_trigger (GnomePieBindingManagerKeybinding* self,
                                                       GnomePieTrigger* value);
static void gnome_pie_binding_manager_keybinding_set_id (GnomePieBindingManagerKeybinding* self,
                                                  const gchar* value);
static void gnome_pie_binding_manager_keybinding_finalize (GnomePieBindingManagerKeybinding * obj);
static GType gnome_pie_binding_manager_keybinding_get_type_once (void);
static void gnome_pie_binding_manager_finalize (GObject * obj);
static GType gnome_pie_binding_manager_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
gnome_pie_binding_manager_get_instance_private (GnomePieBindingManager* self)
{
	return G_STRUCT_MEMBER_P (self, GnomePieBindingManager_private_offset);
}

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

static GdkFilterReturn
_gnome_pie_binding_manager_event_filter_gdk_filter_func (GdkXEvent* xevent,
                                                         GdkEvent* event,
                                                         gpointer self)
{
	GdkFilterReturn result;
	result = gnome_pie_binding_manager_event_filter ((GnomePieBindingManager*) self, xevent, event);
	return result;
}

GnomePieBindingManager*
gnome_pie_binding_manager_construct (GType object_type)
{
	GnomePieBindingManager * self = NULL;
	GdkWindow* rootwin = NULL;
	GdkWindow* _tmp0_;
	GdkWindow* _tmp1_;
	GdkWindow* _tmp2_;
	self = (GnomePieBindingManager*) g_object_new (object_type, NULL);
	_tmp0_ = gdk_get_default_root_window ();
	_tmp1_ = _g_object_ref0 (_tmp0_);
	rootwin = _tmp1_;
	_tmp2_ = rootwin;
	if (_tmp2_ != NULL) {
		GdkWindow* _tmp3_;
		_tmp3_ = rootwin;
		gdk_window_add_filter (_tmp3_, _gnome_pie_binding_manager_event_filter_gdk_filter_func, self);
	}
	_g_object_unref0 (rootwin);
	return self;
}

GnomePieBindingManager*
gnome_pie_binding_manager_new (void)
{
	return gnome_pie_binding_manager_construct (GNOME_PIE_TYPE_BINDING_MANAGER);
}

void
gnome_pie_binding_manager_bind (GnomePieBindingManager* self,
                                GnomePieTrigger* trigger,
                                const gchar* id)
{
	gboolean _tmp0_ = FALSE;
	g_return_if_fail (self != NULL);
	g_return_if_fail (trigger != NULL);
	g_return_if_fail (id != NULL);
	if (!self->priv->wayland) {
		gint _tmp1_;
		gint _tmp2_;
		_tmp1_ = gnome_pie_trigger_get_key_code (trigger);
		_tmp2_ = _tmp1_;
		_tmp0_ = _tmp2_ != 0;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		Display* display = NULL;
		Display* _tmp3_;
		XID xid = 0;
		GdkModifierType modifiers = 0U;
		GdkModifierType _tmp4_;
		GdkModifierType _tmp5_;
		guint* _tmp6_;
		gint _tmp6__length1;
		GnomePieBindingManagerKeybinding* binding = NULL;
		GnomePieBindingManagerKeybinding* _tmp15_;
		GeeList* _tmp16_;
		GnomePieBindingManagerKeybinding* _tmp17_;
		Display* _tmp18_;
		_tmp3_ = gdk_x11_get_default_xdisplay ();
		display = _tmp3_;
		xid = (XID) gdk_x11_get_default_root_xwindow ();
		gdk_error_trap_push ();
		_tmp4_ = gnome_pie_trigger_get_modifiers (trigger);
		_tmp5_ = _tmp4_;
		modifiers = gnome_pie_binding_manager_prepare_modifiers (self, _tmp5_);
		_tmp6_ = gnome_pie_binding_manager_lock_modifiers;
		_tmp6__length1 = gnome_pie_binding_manager_lock_modifiers_length1;
		{
			guint* lock_modifier_collection = NULL;
			gint lock_modifier_collection_length1 = 0;
			gint _lock_modifier_collection_size_ = 0;
			gint lock_modifier_it = 0;
			lock_modifier_collection = _tmp6_;
			lock_modifier_collection_length1 = _tmp6__length1;
			for (lock_modifier_it = 0; lock_modifier_it < lock_modifier_collection_length1; lock_modifier_it = lock_modifier_it + 1) {
				guint lock_modifier = 0U;
				lock_modifier = lock_modifier_collection[lock_modifier_it];
				{
					gboolean _tmp7_;
					gboolean _tmp8_;
					_tmp7_ = gnome_pie_trigger_get_with_mouse (trigger);
					_tmp8_ = _tmp7_;
					if (_tmp8_) {
						Display* _tmp9_;
						gint _tmp10_;
						gint _tmp11_;
						_tmp9_ = display;
						_tmp10_ = gnome_pie_trigger_get_key_code (trigger);
						_tmp11_ = _tmp10_;
						XGrabButton (_tmp9_, (guint) _tmp11_, (guint) (modifiers | lock_modifier), (Window) xid, FALSE, (guint) (ButtonPressMask | ButtonReleaseMask), (gint) GrabModeAsync, (gint) GrabModeAsync, (Window) xid, (guint) 0);
					} else {
						Display* _tmp12_;
						gint _tmp13_;
						gint _tmp14_;
						_tmp12_ = display;
						_tmp13_ = gnome_pie_trigger_get_key_code (trigger);
						_tmp14_ = _tmp13_;
						XGrabKey (_tmp12_, _tmp14_, (guint) (modifiers | lock_modifier), (Window) xid, FALSE, (gint) GrabModeAsync, (gint) GrabModeAsync);
					}
				}
			}
		}
		gdk_flush ();
		_tmp15_ = gnome_pie_binding_manager_keybinding_new (trigger, id);
		binding = _tmp15_;
		_tmp16_ = self->priv->bindings;
		_tmp17_ = binding;
		gee_collection_add ((GeeCollection*) _tmp16_, _tmp17_);
		_tmp18_ = display;
		XFlush (_tmp18_);
		_gnome_pie_binding_manager_keybinding_unref0 (binding);
	} else {
		GnomePieBindingManagerKeybinding* binding = NULL;
		GnomePieBindingManagerKeybinding* _tmp19_;
		GeeList* _tmp20_;
		GnomePieBindingManagerKeybinding* _tmp21_;
		_tmp19_ = gnome_pie_binding_manager_keybinding_new (trigger, id);
		binding = _tmp19_;
		_tmp20_ = self->priv->bindings;
		_tmp21_ = binding;
		gee_collection_add ((GeeCollection*) _tmp20_, _tmp21_);
		_gnome_pie_binding_manager_keybinding_unref0 (binding);
	}
}

void
gnome_pie_binding_manager_unbind (GnomePieBindingManager* self,
                                  const gchar* id)
{
	Display* display = NULL;
	Display* _tmp19_;
	XID xid = 0;
	GeeList* remove_bindings = NULL;
	GeeArrayList* _tmp20_;
	GeeList* _tmp57_;
	GeeList* _tmp58_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (id != NULL);
	{
		GeeList* _binding_list = NULL;
		GeeList* _tmp0_;
		gint _binding_size = 0;
		GeeList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		gint _binding_index = 0;
		_tmp0_ = self->priv->bindings;
		_binding_list = _tmp0_;
		_tmp1_ = _binding_list;
		_tmp2_ = gee_collection_get_size ((GeeCollection*) _tmp1_);
		_tmp3_ = _tmp2_;
		_binding_size = _tmp3_;
		_binding_index = -1;
		while (TRUE) {
			gint _tmp4_;
			gint _tmp5_;
			GnomePieBindingManagerKeybinding* binding = NULL;
			GeeList* _tmp6_;
			gpointer _tmp7_;
			GnomePieBindingManagerKeybinding* _tmp8_;
			const gchar* _tmp9_;
			const gchar* _tmp10_;
			_binding_index = _binding_index + 1;
			_tmp4_ = _binding_index;
			_tmp5_ = _binding_size;
			if (!(_tmp4_ < _tmp5_)) {
				break;
			}
			_tmp6_ = _binding_list;
			_tmp7_ = gee_list_get (_tmp6_, _binding_index);
			binding = (GnomePieBindingManagerKeybinding*) _tmp7_;
			_tmp8_ = binding;
			_tmp9_ = gnome_pie_binding_manager_keybinding_get_id (_tmp8_);
			_tmp10_ = _tmp9_;
			if (g_strcmp0 (id, _tmp10_) == 0) {
				gboolean _tmp11_ = FALSE;
				GnomePieBindingManagerKeybinding* _tmp12_;
				GnomePieTrigger* _tmp13_;
				GnomePieTrigger* _tmp14_;
				gint _tmp15_;
				gint _tmp16_;
				_tmp12_ = binding;
				_tmp13_ = gnome_pie_binding_manager_keybinding_get_trigger (_tmp12_);
				_tmp14_ = _tmp13_;
				_tmp15_ = gnome_pie_trigger_get_key_code (_tmp14_);
				_tmp16_ = _tmp15_;
				if (_tmp16_ == 0) {
					_tmp11_ = TRUE;
				} else {
					_tmp11_ = self->priv->wayland;
				}
				if (_tmp11_) {
					GeeList* _tmp17_;
					GnomePieBindingManagerKeybinding* _tmp18_;
					_tmp17_ = self->priv->bindings;
					_tmp18_ = binding;
					gee_collection_remove ((GeeCollection*) _tmp17_, _tmp18_);
					_gnome_pie_binding_manager_keybinding_unref0 (binding);
					return;
				}
				_gnome_pie_binding_manager_keybinding_unref0 (binding);
				break;
			}
			_gnome_pie_binding_manager_keybinding_unref0 (binding);
		}
	}
	_tmp19_ = gdk_x11_get_default_xdisplay ();
	display = _tmp19_;
	xid = (XID) gdk_x11_get_default_root_xwindow ();
	_tmp20_ = gee_array_list_new (GNOME_PIE_BINDING_MANAGER_TYPE_KEYBINDING, (GBoxedCopyFunc) gnome_pie_binding_manager_keybinding_ref, (GDestroyNotify) gnome_pie_binding_manager_keybinding_unref, NULL, NULL, NULL);
	remove_bindings = (GeeList*) _tmp20_;
	{
		GeeList* _binding_list = NULL;
		GeeList* _tmp21_;
		gint _binding_size = 0;
		GeeList* _tmp22_;
		gint _tmp23_;
		gint _tmp24_;
		gint _binding_index = 0;
		_tmp21_ = self->priv->bindings;
		_binding_list = _tmp21_;
		_tmp22_ = _binding_list;
		_tmp23_ = gee_collection_get_size ((GeeCollection*) _tmp22_);
		_tmp24_ = _tmp23_;
		_binding_size = _tmp24_;
		_binding_index = -1;
		while (TRUE) {
			gint _tmp25_;
			gint _tmp26_;
			GnomePieBindingManagerKeybinding* binding = NULL;
			GeeList* _tmp27_;
			gpointer _tmp28_;
			GnomePieBindingManagerKeybinding* _tmp29_;
			const gchar* _tmp30_;
			const gchar* _tmp31_;
			_binding_index = _binding_index + 1;
			_tmp25_ = _binding_index;
			_tmp26_ = _binding_size;
			if (!(_tmp25_ < _tmp26_)) {
				break;
			}
			_tmp27_ = _binding_list;
			_tmp28_ = gee_list_get (_tmp27_, _binding_index);
			binding = (GnomePieBindingManagerKeybinding*) _tmp28_;
			_tmp29_ = binding;
			_tmp30_ = gnome_pie_binding_manager_keybinding_get_id (_tmp29_);
			_tmp31_ = _tmp30_;
			if (g_strcmp0 (id, _tmp31_) == 0) {
				GdkModifierType modifiers = 0U;
				GnomePieBindingManagerKeybinding* _tmp32_;
				GnomePieTrigger* _tmp33_;
				GnomePieTrigger* _tmp34_;
				GdkModifierType _tmp35_;
				GdkModifierType _tmp36_;
				guint* _tmp37_;
				gint _tmp37__length1;
				GeeList* _tmp55_;
				GnomePieBindingManagerKeybinding* _tmp56_;
				_tmp32_ = binding;
				_tmp33_ = gnome_pie_binding_manager_keybinding_get_trigger (_tmp32_);
				_tmp34_ = _tmp33_;
				_tmp35_ = gnome_pie_trigger_get_modifiers (_tmp34_);
				_tmp36_ = _tmp35_;
				modifiers = gnome_pie_binding_manager_prepare_modifiers (self, _tmp36_);
				_tmp37_ = gnome_pie_binding_manager_lock_modifiers;
				_tmp37__length1 = gnome_pie_binding_manager_lock_modifiers_length1;
				{
					guint* lock_modifier_collection = NULL;
					gint lock_modifier_collection_length1 = 0;
					gint _lock_modifier_collection_size_ = 0;
					gint lock_modifier_it = 0;
					lock_modifier_collection = _tmp37_;
					lock_modifier_collection_length1 = _tmp37__length1;
					for (lock_modifier_it = 0; lock_modifier_it < lock_modifier_collection_length1; lock_modifier_it = lock_modifier_it + 1) {
						guint lock_modifier = 0U;
						lock_modifier = lock_modifier_collection[lock_modifier_it];
						{
							GnomePieBindingManagerKeybinding* _tmp38_;
							GnomePieTrigger* _tmp39_;
							GnomePieTrigger* _tmp40_;
							gboolean _tmp41_;
							gboolean _tmp42_;
							_tmp38_ = binding;
							_tmp39_ = gnome_pie_binding_manager_keybinding_get_trigger (_tmp38_);
							_tmp40_ = _tmp39_;
							_tmp41_ = gnome_pie_trigger_get_with_mouse (_tmp40_);
							_tmp42_ = _tmp41_;
							if (_tmp42_) {
								Display* _tmp43_;
								GnomePieBindingManagerKeybinding* _tmp44_;
								GnomePieTrigger* _tmp45_;
								GnomePieTrigger* _tmp46_;
								gint _tmp47_;
								gint _tmp48_;
								_tmp43_ = display;
								_tmp44_ = binding;
								_tmp45_ = gnome_pie_binding_manager_keybinding_get_trigger (_tmp44_);
								_tmp46_ = _tmp45_;
								_tmp47_ = gnome_pie_trigger_get_key_code (_tmp46_);
								_tmp48_ = _tmp47_;
								XUngrabButton (_tmp43_, (guint) _tmp48_, (guint) (modifiers | lock_modifier), (Window) xid);
							} else {
								Display* _tmp49_;
								GnomePieBindingManagerKeybinding* _tmp50_;
								GnomePieTrigger* _tmp51_;
								GnomePieTrigger* _tmp52_;
								gint _tmp53_;
								gint _tmp54_;
								_tmp49_ = display;
								_tmp50_ = binding;
								_tmp51_ = gnome_pie_binding_manager_keybinding_get_trigger (_tmp50_);
								_tmp52_ = _tmp51_;
								_tmp53_ = gnome_pie_trigger_get_key_code (_tmp52_);
								_tmp54_ = _tmp53_;
								XUngrabKey (_tmp49_, _tmp54_, (guint) (modifiers | lock_modifier), (Window) xid);
							}
						}
					}
				}
				_tmp55_ = remove_bindings;
				_tmp56_ = binding;
				gee_collection_add ((GeeCollection*) _tmp55_, _tmp56_);
			}
			_gnome_pie_binding_manager_keybinding_unref0 (binding);
		}
	}
	_tmp57_ = self->priv->bindings;
	_tmp58_ = remove_bindings;
	gee_collection_remove_all ((GeeCollection*) _tmp57_, (GeeCollection*) _tmp58_);
	if (!self->priv->wayland) {
		Display* _tmp59_;
		_tmp59_ = display;
		XFlush (_tmp59_);
	}
	_g_object_unref0 (remove_bindings);
}

gchar*
gnome_pie_binding_manager_get_accelerator_label_of (GnomePieBindingManager* self,
                                                    const gchar* id)
{
	gchar* _tmp17_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (id != NULL, NULL);
	{
		GeeList* _binding_list = NULL;
		GeeList* _tmp0_;
		gint _binding_size = 0;
		GeeList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		gint _binding_index = 0;
		_tmp0_ = self->priv->bindings;
		_binding_list = _tmp0_;
		_tmp1_ = _binding_list;
		_tmp2_ = gee_collection_get_size ((GeeCollection*) _tmp1_);
		_tmp3_ = _tmp2_;
		_binding_size = _tmp3_;
		_binding_index = -1;
		while (TRUE) {
			gint _tmp4_;
			gint _tmp5_;
			GnomePieBindingManagerKeybinding* binding = NULL;
			GeeList* _tmp6_;
			gpointer _tmp7_;
			GnomePieBindingManagerKeybinding* _tmp8_;
			const gchar* _tmp9_;
			const gchar* _tmp10_;
			_binding_index = _binding_index + 1;
			_tmp4_ = _binding_index;
			_tmp5_ = _binding_size;
			if (!(_tmp4_ < _tmp5_)) {
				break;
			}
			_tmp6_ = _binding_list;
			_tmp7_ = gee_list_get (_tmp6_, _binding_index);
			binding = (GnomePieBindingManagerKeybinding*) _tmp7_;
			_tmp8_ = binding;
			_tmp9_ = gnome_pie_binding_manager_keybinding_get_id (_tmp8_);
			_tmp10_ = _tmp9_;
			if (g_strcmp0 (_tmp10_, id) == 0) {
				GnomePieBindingManagerKeybinding* _tmp11_;
				GnomePieTrigger* _tmp12_;
				GnomePieTrigger* _tmp13_;
				const gchar* _tmp14_;
				const gchar* _tmp15_;
				gchar* _tmp16_;
				_tmp11_ = binding;
				_tmp12_ = gnome_pie_binding_manager_keybinding_get_trigger (_tmp11_);
				_tmp13_ = _tmp12_;
				_tmp14_ = gnome_pie_trigger_get_label_with_specials (_tmp13_);
				_tmp15_ = _tmp14_;
				_tmp16_ = g_strdup (_tmp15_);
				result = _tmp16_;
				_gnome_pie_binding_manager_keybinding_unref0 (binding);
				return result;
			}
			_gnome_pie_binding_manager_keybinding_unref0 (binding);
		}
	}
	_tmp17_ = g_strdup (_ ("Not bound"));
	result = _tmp17_;
	return result;
}

gchar*
gnome_pie_binding_manager_get_accelerator_of (GnomePieBindingManager* self,
                                              const gchar* id)
{
	gchar* _tmp17_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (id != NULL, NULL);
	{
		GeeList* _binding_list = NULL;
		GeeList* _tmp0_;
		gint _binding_size = 0;
		GeeList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		gint _binding_index = 0;
		_tmp0_ = self->priv->bindings;
		_binding_list = _tmp0_;
		_tmp1_ = _binding_list;
		_tmp2_ = gee_collection_get_size ((GeeCollection*) _tmp1_);
		_tmp3_ = _tmp2_;
		_binding_size = _tmp3_;
		_binding_index = -1;
		while (TRUE) {
			gint _tmp4_;
			gint _tmp5_;
			GnomePieBindingManagerKeybinding* binding = NULL;
			GeeList* _tmp6_;
			gpointer _tmp7_;
			GnomePieBindingManagerKeybinding* _tmp8_;
			const gchar* _tmp9_;
			const gchar* _tmp10_;
			_binding_index = _binding_index + 1;
			_tmp4_ = _binding_index;
			_tmp5_ = _binding_size;
			if (!(_tmp4_ < _tmp5_)) {
				break;
			}
			_tmp6_ = _binding_list;
			_tmp7_ = gee_list_get (_tmp6_, _binding_index);
			binding = (GnomePieBindingManagerKeybinding*) _tmp7_;
			_tmp8_ = binding;
			_tmp9_ = gnome_pie_binding_manager_keybinding_get_id (_tmp8_);
			_tmp10_ = _tmp9_;
			if (g_strcmp0 (_tmp10_, id) == 0) {
				GnomePieBindingManagerKeybinding* _tmp11_;
				GnomePieTrigger* _tmp12_;
				GnomePieTrigger* _tmp13_;
				const gchar* _tmp14_;
				const gchar* _tmp15_;
				gchar* _tmp16_;
				_tmp11_ = binding;
				_tmp12_ = gnome_pie_binding_manager_keybinding_get_trigger (_tmp11_);
				_tmp13_ = _tmp12_;
				_tmp14_ = gnome_pie_trigger_get_name (_tmp13_);
				_tmp15_ = _tmp14_;
				_tmp16_ = g_strdup (_tmp15_);
				result = _tmp16_;
				_gnome_pie_binding_manager_keybinding_unref0 (binding);
				return result;
			}
			_gnome_pie_binding_manager_keybinding_unref0 (binding);
		}
	}
	_tmp17_ = g_strdup ("");
	result = _tmp17_;
	return result;
}

gboolean
gnome_pie_binding_manager_get_is_turbo (GnomePieBindingManager* self,
                                        const gchar* id)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (id != NULL, FALSE);
	{
		GeeList* _binding_list = NULL;
		GeeList* _tmp0_;
		gint _binding_size = 0;
		GeeList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		gint _binding_index = 0;
		_tmp0_ = self->priv->bindings;
		_binding_list = _tmp0_;
		_tmp1_ = _binding_list;
		_tmp2_ = gee_collection_get_size ((GeeCollection*) _tmp1_);
		_tmp3_ = _tmp2_;
		_binding_size = _tmp3_;
		_binding_index = -1;
		while (TRUE) {
			gint _tmp4_;
			gint _tmp5_;
			GnomePieBindingManagerKeybinding* binding = NULL;
			GeeList* _tmp6_;
			gpointer _tmp7_;
			GnomePieBindingManagerKeybinding* _tmp8_;
			const gchar* _tmp9_;
			const gchar* _tmp10_;
			_binding_index = _binding_index + 1;
			_tmp4_ = _binding_index;
			_tmp5_ = _binding_size;
			if (!(_tmp4_ < _tmp5_)) {
				break;
			}
			_tmp6_ = _binding_list;
			_tmp7_ = gee_list_get (_tmp6_, _binding_index);
			binding = (GnomePieBindingManagerKeybinding*) _tmp7_;
			_tmp8_ = binding;
			_tmp9_ = gnome_pie_binding_manager_keybinding_get_id (_tmp8_);
			_tmp10_ = _tmp9_;
			if (g_strcmp0 (_tmp10_, id) == 0) {
				GnomePieBindingManagerKeybinding* _tmp11_;
				GnomePieTrigger* _tmp12_;
				GnomePieTrigger* _tmp13_;
				gboolean _tmp14_;
				gboolean _tmp15_;
				_tmp11_ = binding;
				_tmp12_ = gnome_pie_binding_manager_keybinding_get_trigger (_tmp11_);
				_tmp13_ = _tmp12_;
				_tmp14_ = gnome_pie_trigger_get_turbo (_tmp13_);
				_tmp15_ = _tmp14_;
				result = _tmp15_;
				_gnome_pie_binding_manager_keybinding_unref0 (binding);
				return result;
			}
			_gnome_pie_binding_manager_keybinding_unref0 (binding);
		}
	}
	result = FALSE;
	return result;
}

gboolean
gnome_pie_binding_manager_get_is_centered (GnomePieBindingManager* self,
                                           const gchar* id)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (id != NULL, FALSE);
	{
		GeeList* _binding_list = NULL;
		GeeList* _tmp0_;
		gint _binding_size = 0;
		GeeList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		gint _binding_index = 0;
		_tmp0_ = self->priv->bindings;
		_binding_list = _tmp0_;
		_tmp1_ = _binding_list;
		_tmp2_ = gee_collection_get_size ((GeeCollection*) _tmp1_);
		_tmp3_ = _tmp2_;
		_binding_size = _tmp3_;
		_binding_index = -1;
		while (TRUE) {
			gint _tmp4_;
			gint _tmp5_;
			GnomePieBindingManagerKeybinding* binding = NULL;
			GeeList* _tmp6_;
			gpointer _tmp7_;
			GnomePieBindingManagerKeybinding* _tmp8_;
			const gchar* _tmp9_;
			const gchar* _tmp10_;
			_binding_index = _binding_index + 1;
			_tmp4_ = _binding_index;
			_tmp5_ = _binding_size;
			if (!(_tmp4_ < _tmp5_)) {
				break;
			}
			_tmp6_ = _binding_list;
			_tmp7_ = gee_list_get (_tmp6_, _binding_index);
			binding = (GnomePieBindingManagerKeybinding*) _tmp7_;
			_tmp8_ = binding;
			_tmp9_ = gnome_pie_binding_manager_keybinding_get_id (_tmp8_);
			_tmp10_ = _tmp9_;
			if (g_strcmp0 (_tmp10_, id) == 0) {
				GnomePieBindingManagerKeybinding* _tmp11_;
				GnomePieTrigger* _tmp12_;
				GnomePieTrigger* _tmp13_;
				gboolean _tmp14_;
				gboolean _tmp15_;
				_tmp11_ = binding;
				_tmp12_ = gnome_pie_binding_manager_keybinding_get_trigger (_tmp11_);
				_tmp13_ = _tmp12_;
				_tmp14_ = gnome_pie_trigger_get_centered (_tmp13_);
				_tmp15_ = _tmp14_;
				result = _tmp15_;
				_gnome_pie_binding_manager_keybinding_unref0 (binding);
				return result;
			}
			_gnome_pie_binding_manager_keybinding_unref0 (binding);
		}
	}
	result = FALSE;
	return result;
}

gboolean
gnome_pie_binding_manager_get_is_warp (GnomePieBindingManager* self,
                                       const gchar* id)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (id != NULL, FALSE);
	{
		GeeList* _binding_list = NULL;
		GeeList* _tmp0_;
		gint _binding_size = 0;
		GeeList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		gint _binding_index = 0;
		_tmp0_ = self->priv->bindings;
		_binding_list = _tmp0_;
		_tmp1_ = _binding_list;
		_tmp2_ = gee_collection_get_size ((GeeCollection*) _tmp1_);
		_tmp3_ = _tmp2_;
		_binding_size = _tmp3_;
		_binding_index = -1;
		while (TRUE) {
			gint _tmp4_;
			gint _tmp5_;
			GnomePieBindingManagerKeybinding* binding = NULL;
			GeeList* _tmp6_;
			gpointer _tmp7_;
			GnomePieBindingManagerKeybinding* _tmp8_;
			const gchar* _tmp9_;
			const gchar* _tmp10_;
			_binding_index = _binding_index + 1;
			_tmp4_ = _binding_index;
			_tmp5_ = _binding_size;
			if (!(_tmp4_ < _tmp5_)) {
				break;
			}
			_tmp6_ = _binding_list;
			_tmp7_ = gee_list_get (_tmp6_, _binding_index);
			binding = (GnomePieBindingManagerKeybinding*) _tmp7_;
			_tmp8_ = binding;
			_tmp9_ = gnome_pie_binding_manager_keybinding_get_id (_tmp8_);
			_tmp10_ = _tmp9_;
			if (g_strcmp0 (_tmp10_, id) == 0) {
				GnomePieBindingManagerKeybinding* _tmp11_;
				GnomePieTrigger* _tmp12_;
				GnomePieTrigger* _tmp13_;
				gboolean _tmp14_;
				gboolean _tmp15_;
				_tmp11_ = binding;
				_tmp12_ = gnome_pie_binding_manager_keybinding_get_trigger (_tmp11_);
				_tmp13_ = _tmp12_;
				_tmp14_ = gnome_pie_trigger_get_warp (_tmp13_);
				_tmp15_ = _tmp14_;
				result = _tmp15_;
				_gnome_pie_binding_manager_keybinding_unref0 (binding);
				return result;
			}
			_gnome_pie_binding_manager_keybinding_unref0 (binding);
		}
	}
	result = FALSE;
	return result;
}

gboolean
gnome_pie_binding_manager_get_is_auto_shape (GnomePieBindingManager* self,
                                             const gchar* id)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (id != NULL, FALSE);
	{
		GeeList* _binding_list = NULL;
		GeeList* _tmp0_;
		gint _binding_size = 0;
		GeeList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		gint _binding_index = 0;
		_tmp0_ = self->priv->bindings;
		_binding_list = _tmp0_;
		_tmp1_ = _binding_list;
		_tmp2_ = gee_collection_get_size ((GeeCollection*) _tmp1_);
		_tmp3_ = _tmp2_;
		_binding_size = _tmp3_;
		_binding_index = -1;
		while (TRUE) {
			gint _tmp4_;
			gint _tmp5_;
			GnomePieBindingManagerKeybinding* binding = NULL;
			GeeList* _tmp6_;
			gpointer _tmp7_;
			GnomePieBindingManagerKeybinding* _tmp8_;
			const gchar* _tmp9_;
			const gchar* _tmp10_;
			_binding_index = _binding_index + 1;
			_tmp4_ = _binding_index;
			_tmp5_ = _binding_size;
			if (!(_tmp4_ < _tmp5_)) {
				break;
			}
			_tmp6_ = _binding_list;
			_tmp7_ = gee_list_get (_tmp6_, _binding_index);
			binding = (GnomePieBindingManagerKeybinding*) _tmp7_;
			_tmp8_ = binding;
			_tmp9_ = gnome_pie_binding_manager_keybinding_get_id (_tmp8_);
			_tmp10_ = _tmp9_;
			if (g_strcmp0 (_tmp10_, id) == 0) {
				GnomePieBindingManagerKeybinding* _tmp11_;
				GnomePieTrigger* _tmp12_;
				GnomePieTrigger* _tmp13_;
				gint _tmp14_;
				gint _tmp15_;
				_tmp11_ = binding;
				_tmp12_ = gnome_pie_binding_manager_keybinding_get_trigger (_tmp11_);
				_tmp13_ = _tmp12_;
				_tmp14_ = gnome_pie_trigger_get_shape (_tmp13_);
				_tmp15_ = _tmp14_;
				result = _tmp15_ == 0;
				_gnome_pie_binding_manager_keybinding_unref0 (binding);
				return result;
			}
			_gnome_pie_binding_manager_keybinding_unref0 (binding);
		}
	}
	result = FALSE;
	return result;
}

gint
gnome_pie_binding_manager_get_shape_number (GnomePieBindingManager* self,
                                            const gchar* id)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	g_return_val_if_fail (id != NULL, -1);
	{
		GeeList* _binding_list = NULL;
		GeeList* _tmp0_;
		gint _binding_size = 0;
		GeeList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		gint _binding_index = 0;
		_tmp0_ = self->priv->bindings;
		_binding_list = _tmp0_;
		_tmp1_ = _binding_list;
		_tmp2_ = gee_collection_get_size ((GeeCollection*) _tmp1_);
		_tmp3_ = _tmp2_;
		_binding_size = _tmp3_;
		_binding_index = -1;
		while (TRUE) {
			gint _tmp4_;
			gint _tmp5_;
			GnomePieBindingManagerKeybinding* binding = NULL;
			GeeList* _tmp6_;
			gpointer _tmp7_;
			GnomePieBindingManagerKeybinding* _tmp8_;
			const gchar* _tmp9_;
			const gchar* _tmp10_;
			_binding_index = _binding_index + 1;
			_tmp4_ = _binding_index;
			_tmp5_ = _binding_size;
			if (!(_tmp4_ < _tmp5_)) {
				break;
			}
			_tmp6_ = _binding_list;
			_tmp7_ = gee_list_get (_tmp6_, _binding_index);
			binding = (GnomePieBindingManagerKeybinding*) _tmp7_;
			_tmp8_ = binding;
			_tmp9_ = gnome_pie_binding_manager_keybinding_get_id (_tmp8_);
			_tmp10_ = _tmp9_;
			if (g_strcmp0 (_tmp10_, id) == 0) {
				GnomePieBindingManagerKeybinding* _tmp11_;
				GnomePieTrigger* _tmp12_;
				GnomePieTrigger* _tmp13_;
				gint _tmp14_;
				gint _tmp15_;
				GnomePieBindingManagerKeybinding* _tmp16_;
				GnomePieTrigger* _tmp17_;
				GnomePieTrigger* _tmp18_;
				gint _tmp19_;
				gint _tmp20_;
				_tmp11_ = binding;
				_tmp12_ = gnome_pie_binding_manager_keybinding_get_trigger (_tmp11_);
				_tmp13_ = _tmp12_;
				_tmp14_ = gnome_pie_trigger_get_shape (_tmp13_);
				_tmp15_ = _tmp14_;
				if (_tmp15_ == 0) {
					_gnome_pie_binding_manager_keybinding_unref0 (binding);
					break;
				}
				_tmp16_ = binding;
				_tmp17_ = gnome_pie_binding_manager_keybinding_get_trigger (_tmp16_);
				_tmp18_ = _tmp17_;
				_tmp19_ = gnome_pie_trigger_get_shape (_tmp18_);
				_tmp20_ = _tmp19_;
				result = _tmp20_;
				_gnome_pie_binding_manager_keybinding_unref0 (binding);
				return result;
			}
			_gnome_pie_binding_manager_keybinding_unref0 (binding);
		}
	}
	result = 5;
	return result;
}

gchar*
gnome_pie_binding_manager_get_assigned_id (GnomePieBindingManager* self,
                                           GnomePieTrigger* trigger)
{
	gchar* second = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp24_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (trigger != NULL, NULL);
	_tmp0_ = gnome_pie_trigger_get_name (trigger);
	_tmp1_ = _tmp0_;
	_tmp2_ = gnome_pie_trigger_remove_optional (_tmp1_);
	second = _tmp2_;
	_tmp3_ = second;
	if (g_strcmp0 (_tmp3_, "") != 0) {
		{
			GeeList* _binding_list = NULL;
			GeeList* _tmp4_;
			gint _binding_size = 0;
			GeeList* _tmp5_;
			gint _tmp6_;
			gint _tmp7_;
			gint _binding_index = 0;
			_tmp4_ = self->priv->bindings;
			_binding_list = _tmp4_;
			_tmp5_ = _binding_list;
			_tmp6_ = gee_collection_get_size ((GeeCollection*) _tmp5_);
			_tmp7_ = _tmp6_;
			_binding_size = _tmp7_;
			_binding_index = -1;
			while (TRUE) {
				gint _tmp8_;
				gint _tmp9_;
				GnomePieBindingManagerKeybinding* binding = NULL;
				GeeList* _tmp10_;
				gpointer _tmp11_;
				gchar* first = NULL;
				GnomePieBindingManagerKeybinding* _tmp12_;
				GnomePieTrigger* _tmp13_;
				GnomePieTrigger* _tmp14_;
				const gchar* _tmp15_;
				const gchar* _tmp16_;
				gchar* _tmp17_;
				const gchar* _tmp18_;
				const gchar* _tmp19_;
				_binding_index = _binding_index + 1;
				_tmp8_ = _binding_index;
				_tmp9_ = _binding_size;
				if (!(_tmp8_ < _tmp9_)) {
					break;
				}
				_tmp10_ = _binding_list;
				_tmp11_ = gee_list_get (_tmp10_, _binding_index);
				binding = (GnomePieBindingManagerKeybinding*) _tmp11_;
				_tmp12_ = binding;
				_tmp13_ = gnome_pie_binding_manager_keybinding_get_trigger (_tmp12_);
				_tmp14_ = _tmp13_;
				_tmp15_ = gnome_pie_trigger_get_name (_tmp14_);
				_tmp16_ = _tmp15_;
				_tmp17_ = gnome_pie_trigger_remove_optional (_tmp16_);
				first = _tmp17_;
				_tmp18_ = first;
				_tmp19_ = second;
				if (g_strcmp0 (_tmp18_, _tmp19_) == 0) {
					GnomePieBindingManagerKeybinding* _tmp20_;
					const gchar* _tmp21_;
					const gchar* _tmp22_;
					gchar* _tmp23_;
					_tmp20_ = binding;
					_tmp21_ = gnome_pie_binding_manager_keybinding_get_id (_tmp20_);
					_tmp22_ = _tmp21_;
					_tmp23_ = g_strdup (_tmp22_);
					result = _tmp23_;
					_g_free0 (first);
					_gnome_pie_binding_manager_keybinding_unref0 (binding);
					_g_free0 (second);
					return result;
				}
				_g_free0 (first);
				_gnome_pie_binding_manager_keybinding_unref0 (binding);
			}
		}
	}
	_tmp24_ = g_strdup ("");
	result = _tmp24_;
	_g_free0 (second);
	return result;
}

static GdkModifierType
gnome_pie_binding_manager_prepare_modifiers (GnomePieBindingManager* self,
                                             GdkModifierType mods)
{
	guint* _tmp0_;
	gint _tmp0__length1;
	guint _tmp1_;
	GdkModifierType result;
	g_return_val_if_fail (self != NULL, 0U);
	if ((mods & GDK_SUPER_MASK) > 0) {
		mods = mods | GDK_MOD4_MASK;
		mods = mods & (~GDK_SUPER_MASK);
	}
	mods = mods & (~((((GDK_BUTTON1_MASK | GDK_BUTTON2_MASK) | GDK_BUTTON3_MASK) | GDK_BUTTON4_MASK) | GDK_BUTTON5_MASK));
	_tmp0_ = gnome_pie_binding_manager_lock_modifiers;
	_tmp0__length1 = gnome_pie_binding_manager_lock_modifiers_length1;
	_tmp1_ = _tmp0_[7];
	result = mods & (~_tmp1_);
	return result;
}

static GdkFilterReturn
gnome_pie_binding_manager_event_filter (GnomePieBindingManager* self,
                                        GdkXEvent* gdk_xevent,
                                        GdkEvent* gdk_event)
{
	XEvent* xevent = NULL;
	XEvent* _tmp0_;
	GdkFilterReturn result;
	g_return_val_if_fail (self != NULL, 0);
	g_return_val_if_fail (gdk_xevent != NULL, 0);
	g_return_val_if_fail (gdk_event != NULL, 0);
	xevent = (XEvent*) gdk_xevent;
	_tmp0_ = xevent;
	if ((*_tmp0_).type == ((gint) KeyPress)) {
		GdkModifierType event_mods = 0U;
		XEvent* _tmp1_;
		XKeyEvent _tmp2_;
		_tmp1_ = xevent;
		_tmp2_ = (*_tmp1_).xkey;
		event_mods = gnome_pie_binding_manager_prepare_modifiers (self, (GdkModifierType) _tmp2_.state);
		{
			GeeList* _binding_list = NULL;
			GeeList* _tmp3_;
			gint _binding_size = 0;
			GeeList* _tmp4_;
			gint _tmp5_;
			gint _tmp6_;
			gint _binding_index = 0;
			_tmp3_ = self->priv->bindings;
			_binding_list = _tmp3_;
			_tmp4_ = _binding_list;
			_tmp5_ = gee_collection_get_size ((GeeCollection*) _tmp4_);
			_tmp6_ = _tmp5_;
			_binding_size = _tmp6_;
			_binding_index = -1;
			while (TRUE) {
				gint _tmp7_;
				gint _tmp8_;
				GnomePieBindingManagerKeybinding* binding = NULL;
				GeeList* _tmp9_;
				gpointer _tmp10_;
				GdkModifierType bound_mods = 0U;
				GnomePieBindingManagerKeybinding* _tmp11_;
				GnomePieTrigger* _tmp12_;
				GnomePieTrigger* _tmp13_;
				GdkModifierType _tmp14_;
				GdkModifierType _tmp15_;
				gboolean _tmp16_ = FALSE;
				XEvent* _tmp17_;
				XKeyEvent _tmp18_;
				GnomePieBindingManagerKeybinding* _tmp19_;
				GnomePieTrigger* _tmp20_;
				GnomePieTrigger* _tmp21_;
				gint _tmp22_;
				gint _tmp23_;
				_binding_index = _binding_index + 1;
				_tmp7_ = _binding_index;
				_tmp8_ = _binding_size;
				if (!(_tmp7_ < _tmp8_)) {
					break;
				}
				_tmp9_ = _binding_list;
				_tmp10_ = gee_list_get (_tmp9_, _binding_index);
				binding = (GnomePieBindingManagerKeybinding*) _tmp10_;
				_tmp11_ = binding;
				_tmp12_ = gnome_pie_binding_manager_keybinding_get_trigger (_tmp11_);
				_tmp13_ = _tmp12_;
				_tmp14_ = gnome_pie_trigger_get_modifiers (_tmp13_);
				_tmp15_ = _tmp14_;
				bound_mods = gnome_pie_binding_manager_prepare_modifiers (self, _tmp15_);
				_tmp17_ = xevent;
				_tmp18_ = (*_tmp17_).xkey;
				_tmp19_ = binding;
				_tmp20_ = gnome_pie_binding_manager_keybinding_get_trigger (_tmp19_);
				_tmp21_ = _tmp20_;
				_tmp22_ = gnome_pie_trigger_get_key_code (_tmp21_);
				_tmp23_ = _tmp22_;
				if (_tmp18_.keycode == ((guint) _tmp23_)) {
					_tmp16_ = event_mods == bound_mods;
				} else {
					_tmp16_ = FALSE;
				}
				if (_tmp16_) {
					GnomePieBindingManagerKeybinding* _tmp24_;
					GnomePieTrigger* _tmp25_;
					GnomePieTrigger* _tmp26_;
					gboolean _tmp27_;
					gboolean _tmp28_;
					_tmp24_ = binding;
					_tmp25_ = gnome_pie_binding_manager_keybinding_get_trigger (_tmp24_);
					_tmp26_ = _tmp25_;
					_tmp27_ = gnome_pie_trigger_get_delayed (_tmp26_);
					_tmp28_ = _tmp27_;
					if (_tmp28_) {
						GnomePieBindingManagerKeybinding* _tmp29_;
						XEvent* _tmp30_;
						XEvent _tmp31_;
						_tmp29_ = binding;
						_tmp30_ = xevent;
						_tmp31_ = *_tmp30_;
						gnome_pie_binding_manager_activate_delayed (self, _tmp29_, &_tmp31_);
					} else {
						GnomePieBindingManagerKeybinding* _tmp32_;
						const gchar* _tmp33_;
						const gchar* _tmp34_;
						_tmp32_ = binding;
						_tmp33_ = gnome_pie_binding_manager_keybinding_get_id (_tmp32_);
						_tmp34_ = _tmp33_;
						g_signal_emit (self, gnome_pie_binding_manager_signals[GNOME_PIE_BINDING_MANAGER_ON_PRESS_SIGNAL], 0, _tmp34_);
					}
				}
				_gnome_pie_binding_manager_keybinding_unref0 (binding);
			}
		}
	} else {
		XEvent* _tmp35_;
		_tmp35_ = xevent;
		if ((*_tmp35_).type == ((gint) ButtonPress)) {
			GdkModifierType event_mods = 0U;
			XEvent* _tmp36_;
			XButtonEvent _tmp37_;
			_tmp36_ = xevent;
			_tmp37_ = (*_tmp36_).xbutton;
			event_mods = gnome_pie_binding_manager_prepare_modifiers (self, (GdkModifierType) _tmp37_.state);
			{
				GeeList* _binding_list = NULL;
				GeeList* _tmp38_;
				gint _binding_size = 0;
				GeeList* _tmp39_;
				gint _tmp40_;
				gint _tmp41_;
				gint _binding_index = 0;
				_tmp38_ = self->priv->bindings;
				_binding_list = _tmp38_;
				_tmp39_ = _binding_list;
				_tmp40_ = gee_collection_get_size ((GeeCollection*) _tmp39_);
				_tmp41_ = _tmp40_;
				_binding_size = _tmp41_;
				_binding_index = -1;
				while (TRUE) {
					gint _tmp42_;
					gint _tmp43_;
					GnomePieBindingManagerKeybinding* binding = NULL;
					GeeList* _tmp44_;
					gpointer _tmp45_;
					GdkModifierType bound_mods = 0U;
					GnomePieBindingManagerKeybinding* _tmp46_;
					GnomePieTrigger* _tmp47_;
					GnomePieTrigger* _tmp48_;
					GdkModifierType _tmp49_;
					GdkModifierType _tmp50_;
					gboolean _tmp51_ = FALSE;
					XEvent* _tmp52_;
					XButtonEvent _tmp53_;
					GnomePieBindingManagerKeybinding* _tmp54_;
					GnomePieTrigger* _tmp55_;
					GnomePieTrigger* _tmp56_;
					gint _tmp57_;
					gint _tmp58_;
					_binding_index = _binding_index + 1;
					_tmp42_ = _binding_index;
					_tmp43_ = _binding_size;
					if (!(_tmp42_ < _tmp43_)) {
						break;
					}
					_tmp44_ = _binding_list;
					_tmp45_ = gee_list_get (_tmp44_, _binding_index);
					binding = (GnomePieBindingManagerKeybinding*) _tmp45_;
					_tmp46_ = binding;
					_tmp47_ = gnome_pie_binding_manager_keybinding_get_trigger (_tmp46_);
					_tmp48_ = _tmp47_;
					_tmp49_ = gnome_pie_trigger_get_modifiers (_tmp48_);
					_tmp50_ = _tmp49_;
					bound_mods = gnome_pie_binding_manager_prepare_modifiers (self, _tmp50_);
					_tmp52_ = xevent;
					_tmp53_ = (*_tmp52_).xbutton;
					_tmp54_ = binding;
					_tmp55_ = gnome_pie_binding_manager_keybinding_get_trigger (_tmp54_);
					_tmp56_ = _tmp55_;
					_tmp57_ = gnome_pie_trigger_get_key_code (_tmp56_);
					_tmp58_ = _tmp57_;
					if (_tmp53_.button == ((guint) _tmp58_)) {
						_tmp51_ = event_mods == bound_mods;
					} else {
						_tmp51_ = FALSE;
					}
					if (_tmp51_) {
						GnomePieBindingManagerKeybinding* _tmp59_;
						GnomePieTrigger* _tmp60_;
						GnomePieTrigger* _tmp61_;
						gboolean _tmp62_;
						gboolean _tmp63_;
						_tmp59_ = binding;
						_tmp60_ = gnome_pie_binding_manager_keybinding_get_trigger (_tmp59_);
						_tmp61_ = _tmp60_;
						_tmp62_ = gnome_pie_trigger_get_delayed (_tmp61_);
						_tmp63_ = _tmp62_;
						if (_tmp63_) {
							GnomePieBindingManagerKeybinding* _tmp64_;
							XEvent* _tmp65_;
							XEvent _tmp66_;
							_tmp64_ = binding;
							_tmp65_ = xevent;
							_tmp66_ = *_tmp65_;
							gnome_pie_binding_manager_activate_delayed (self, _tmp64_, &_tmp66_);
						} else {
							GnomePieBindingManagerKeybinding* _tmp67_;
							const gchar* _tmp68_;
							const gchar* _tmp69_;
							_tmp67_ = binding;
							_tmp68_ = gnome_pie_binding_manager_keybinding_get_id (_tmp67_);
							_tmp69_ = _tmp68_;
							g_signal_emit (self, gnome_pie_binding_manager_signals[GNOME_PIE_BINDING_MANAGER_ON_PRESS_SIGNAL], 0, _tmp69_);
						}
					}
					_gnome_pie_binding_manager_keybinding_unref0 (binding);
				}
			}
		} else {
			gboolean _tmp70_ = FALSE;
			XEvent* _tmp71_;
			_tmp71_ = xevent;
			if ((*_tmp71_).type == ((gint) ButtonRelease)) {
				_tmp70_ = TRUE;
			} else {
				XEvent* _tmp72_;
				_tmp72_ = xevent;
				_tmp70_ = (*_tmp72_).type == ((gint) KeyRelease);
			}
			if (_tmp70_) {
				XEvent* _tmp73_;
				XKeyEvent _tmp74_;
				_tmp73_ = xevent;
				_tmp74_ = (*_tmp73_).xkey;
				g_signal_emit (self, gnome_pie_binding_manager_signals[GNOME_PIE_BINDING_MANAGER_ON_RELEASE_SIGNAL], 0, (guint32) _tmp74_.time);
				gnome_pie_binding_manager_cancel_activate_delayed (self);
			}
		}
	}
	result = GDK_FILTER_CONTINUE;
	return result;
}

static gpointer
_gnome_pie_binding_manager_keybinding_ref0 (gpointer self)
{
	return self ? gnome_pie_binding_manager_keybinding_ref (self) : NULL;
}

static Block23Data*
block23_data_ref (Block23Data* _data23_)
{
	g_atomic_int_inc (&_data23_->_ref_count_);
	return _data23_;
}

static void
block23_data_unref (void * _userdata_)
{
	Block23Data* _data23_;
	_data23_ = (Block23Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data23_->_ref_count_)) {
		GnomePieBindingManager* self;
		self = _data23_->self;
		_gnome_pie_binding_manager_keybinding_unref0 (_data23_->binding);
		_g_object_unref0 (self);
		g_slice_free (Block23Data, _data23_);
	}
}

static Block24Data*
block24_data_ref (Block24Data* _data24_)
{
	g_atomic_int_inc (&_data24_->_ref_count_);
	return _data24_;
}

static void
block24_data_unref (void * _userdata_)
{
	Block24Data* _data24_;
	_data24_ = (Block24Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data24_->_ref_count_)) {
		GnomePieBindingManager* self;
		self = _data24_->_data23_->self;
		block23_data_unref (_data24_->_data23_);
		_data24_->_data23_ = NULL;
		g_slice_free (Block24Data, _data24_);
	}
}

static XEvent*
_event_dup (XEvent* self)
{
	XEvent* dup;
	dup = g_new0 (XEvent, 1);
	memcpy (dup, self, sizeof (XEvent));
	return dup;
}

static gpointer
__event_dup0 (gpointer self)
{
	return self ? _event_dup (self) : NULL;
}

static gboolean
___lambda5_ (Block24Data* _data24_)
{
	Block23Data* _data23_;
	GnomePieBindingManager* self;
	gboolean result;
	_data23_ = _data24_->_data23_;
	self = _data23_->self;
	if (_data24_->current_count == self->priv->delayed_count) {
		const gchar* _tmp0_;
		const gchar* _tmp1_;
		_gnome_pie_binding_manager_keybinding_unref0 (self->priv->delayed_binding);
		self->priv->delayed_binding = NULL;
		_g_free0 (self->priv->delayed_event);
		self->priv->delayed_event = NULL;
		_tmp0_ = gnome_pie_binding_manager_keybinding_get_id (_data23_->binding);
		_tmp1_ = _tmp0_;
		g_signal_emit (self, gnome_pie_binding_manager_signals[GNOME_PIE_BINDING_MANAGER_ON_PRESS_SIGNAL], 0, _tmp1_);
	}
	result = FALSE;
	return result;
}

static gboolean
____lambda5__gsource_func (gpointer self)
{
	gboolean result;
	result = ___lambda5_ (self);
	return result;
}

static void
gnome_pie_binding_manager_activate_delayed (GnomePieBindingManager* self,
                                            GnomePieBindingManagerKeybinding* binding,
                                            XEvent* event)
{
	Block23Data* _data23_;
	GnomePieBindingManagerKeybinding* _tmp0_;
	GnomePieBindingManagerKeybinding* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (binding != NULL);
	g_return_if_fail (event != NULL);
	_data23_ = g_slice_new0 (Block23Data);
	_data23_->_ref_count_ = 1;
	_data23_->self = g_object_ref (self);
	_tmp0_ = _gnome_pie_binding_manager_keybinding_ref0 (binding);
	_gnome_pie_binding_manager_keybinding_unref0 (_data23_->binding);
	_data23_->binding = _tmp0_;
	_tmp1_ = self->priv->delayed_binding;
	if (_tmp1_ == NULL) {
		Block24Data* _data24_;
		XEvent _tmp2_;
		XEvent* _tmp3_;
		GnomePieBindingManagerKeybinding* _tmp4_;
		_data24_ = g_slice_new0 (Block24Data);
		_data24_->_ref_count_ = 1;
		_data24_->_data23_ = block23_data_ref (_data23_);
		_data24_->current_count = self->priv->delayed_count;
		_tmp2_ = *event;
		_tmp3_ = __event_dup0 (&_tmp2_);
		_g_free0 (self->priv->delayed_event);
		self->priv->delayed_event = _tmp3_;
		_tmp4_ = _gnome_pie_binding_manager_keybinding_ref0 (_data23_->binding);
		_gnome_pie_binding_manager_keybinding_unref0 (self->priv->delayed_binding);
		self->priv->delayed_binding = _tmp4_;
		g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 300, ____lambda5__gsource_func, block24_data_ref (_data24_), block24_data_unref);
		block24_data_unref (_data24_);
		_data24_ = NULL;
	}
	block23_data_unref (_data23_);
	_data23_ = NULL;
}

static void
gnome_pie_binding_manager_cancel_activate_delayed (GnomePieBindingManager* self)
{
	XEvent* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->delayed_event;
	if (_tmp0_ != NULL) {
		guint32 _tmp1_;
		Display* display = NULL;
		Display* _tmp2_;
		GnomePieBindingManagerKeybinding* _tmp3_;
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		GnomePieBindingManagerKeybinding* _tmp6_;
		GnomePieTrigger* _tmp7_;
		GnomePieTrigger* _tmp8_;
		gboolean _tmp9_;
		gboolean _tmp10_;
		GnomePieBindingManagerKeybinding* _tmp27_;
		GnomePieTrigger* _tmp28_;
		GnomePieTrigger* _tmp29_;
		GnomePieBindingManagerKeybinding* _tmp30_;
		const gchar* _tmp31_;
		const gchar* _tmp32_;
		self->priv->delayed_count = self->priv->delayed_count + 1;
		_tmp1_ = self->priv->delayed_count;
		_tmp2_ = gdk_x11_get_default_xdisplay ();
		display = _tmp2_;
		_tmp3_ = self->priv->delayed_binding;
		_tmp4_ = gnome_pie_binding_manager_keybinding_get_id (_tmp3_);
		_tmp5_ = _tmp4_;
		gnome_pie_binding_manager_unbind (self, _tmp5_);
		_tmp6_ = self->priv->delayed_binding;
		_tmp7_ = gnome_pie_binding_manager_keybinding_get_trigger (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = gnome_pie_trigger_get_with_mouse (_tmp8_);
		_tmp10_ = _tmp9_;
		if (_tmp10_) {
			Display* _tmp11_;
			XEvent* _tmp12_;
			XButtonEvent _tmp13_;
			Display* _tmp14_;
			Display* _tmp15_;
			XEvent* _tmp16_;
			XButtonEvent _tmp17_;
			Display* _tmp18_;
			_tmp11_ = display;
			_tmp12_ = self->priv->delayed_event;
			_tmp13_ = (*_tmp12_).xbutton;
			XTestFakeButtonEvent (_tmp11_, _tmp13_.button, TRUE, (gulong) 0);
			_tmp14_ = display;
			XFlush (_tmp14_);
			_tmp15_ = display;
			_tmp16_ = self->priv->delayed_event;
			_tmp17_ = (*_tmp16_).xbutton;
			XTestFakeButtonEvent (_tmp15_, _tmp17_.button, FALSE, (gulong) 0);
			_tmp18_ = display;
			XFlush (_tmp18_);
		} else {
			Display* _tmp19_;
			XEvent* _tmp20_;
			XKeyEvent _tmp21_;
			Display* _tmp22_;
			Display* _tmp23_;
			XEvent* _tmp24_;
			XKeyEvent _tmp25_;
			Display* _tmp26_;
			_tmp19_ = display;
			_tmp20_ = self->priv->delayed_event;
			_tmp21_ = (*_tmp20_).xkey;
			XTestFakeKeyEvent (_tmp19_, _tmp21_.keycode, TRUE, (gulong) 0);
			_tmp22_ = display;
			XFlush (_tmp22_);
			_tmp23_ = display;
			_tmp24_ = self->priv->delayed_event;
			_tmp25_ = (*_tmp24_).xkey;
			XTestFakeKeyEvent (_tmp23_, _tmp25_.keycode, FALSE, (gulong) 0);
			_tmp26_ = display;
			XFlush (_tmp26_);
		}
		_tmp27_ = self->priv->delayed_binding;
		_tmp28_ = gnome_pie_binding_manager_keybinding_get_trigger (_tmp27_);
		_tmp29_ = _tmp28_;
		_tmp30_ = self->priv->delayed_binding;
		_tmp31_ = gnome_pie_binding_manager_keybinding_get_id (_tmp30_);
		_tmp32_ = _tmp31_;
		gnome_pie_binding_manager_bind (self, _tmp29_, _tmp32_);
		_gnome_pie_binding_manager_keybinding_unref0 (self->priv->delayed_binding);
		self->priv->delayed_binding = NULL;
		_g_free0 (self->priv->delayed_event);
		self->priv->delayed_event = NULL;
	}
}

static inline gpointer
gnome_pie_binding_manager_keybinding_get_instance_private (GnomePieBindingManagerKeybinding* self)
{
	return G_STRUCT_MEMBER_P (self, GnomePieBindingManagerKeybinding_private_offset);
}

static GnomePieBindingManagerKeybinding*
gnome_pie_binding_manager_keybinding_construct (GType object_type,
                                                GnomePieTrigger* trigger,
                                                const gchar* id)
{
	GnomePieBindingManagerKeybinding* self = NULL;
	g_return_val_if_fail (trigger != NULL, NULL);
	g_return_val_if_fail (id != NULL, NULL);
	self = (GnomePieBindingManagerKeybinding*) g_type_create_instance (object_type);
	gnome_pie_binding_manager_keybinding_set_trigger (self, trigger);
	gnome_pie_binding_manager_keybinding_set_id (self, id);
	return self;
}

static GnomePieBindingManagerKeybinding*
gnome_pie_binding_manager_keybinding_new (GnomePieTrigger* trigger,
                                          const gchar* id)
{
	return gnome_pie_binding_manager_keybinding_construct (GNOME_PIE_BINDING_MANAGER_TYPE_KEYBINDING, trigger, id);
}

static GnomePieTrigger*
gnome_pie_binding_manager_keybinding_get_trigger (GnomePieBindingManagerKeybinding* self)
{
	GnomePieTrigger* result;
	GnomePieTrigger* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_trigger;
	result = _tmp0_;
	return result;
}

static void
gnome_pie_binding_manager_keybinding_set_trigger (GnomePieBindingManagerKeybinding* self,
                                                  GnomePieTrigger* value)
{
	GnomePieTrigger* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_trigger);
	self->priv->_trigger = _tmp0_;
}

static const gchar*
gnome_pie_binding_manager_keybinding_get_id (GnomePieBindingManagerKeybinding* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_id;
	result = _tmp0_;
	return result;
}

static void
gnome_pie_binding_manager_keybinding_set_id (GnomePieBindingManagerKeybinding* self,
                                             const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_id);
	self->priv->_id = _tmp0_;
}

static void
gnome_pie_binding_manager_value_keybinding_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
gnome_pie_binding_manager_value_keybinding_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		gnome_pie_binding_manager_keybinding_unref (value->data[0].v_pointer);
	}
}

static void
gnome_pie_binding_manager_value_keybinding_copy_value (const GValue* src_value,
                                                       GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = gnome_pie_binding_manager_keybinding_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
gnome_pie_binding_manager_value_keybinding_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
gnome_pie_binding_manager_value_keybinding_collect_value (GValue* value,
                                                          guint n_collect_values,
                                                          GTypeCValue* collect_values,
                                                          guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		GnomePieBindingManagerKeybinding * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = gnome_pie_binding_manager_keybinding_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
gnome_pie_binding_manager_value_keybinding_lcopy_value (const GValue* value,
                                                        guint n_collect_values,
                                                        GTypeCValue* collect_values,
                                                        guint collect_flags)
{
	GnomePieBindingManagerKeybinding ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = gnome_pie_binding_manager_keybinding_ref (value->data[0].v_pointer);
	}
	return NULL;
}

static GParamSpec*
gnome_pie_binding_manager_param_spec_keybinding (const gchar* name,
                                                 const gchar* nick,
                                                 const gchar* blurb,
                                                 GType object_type,
                                                 GParamFlags flags)
{
	GnomePieBindingManagerParamSpecKeybinding* spec;
	g_return_val_if_fail (g_type_is_a (object_type, GNOME_PIE_BINDING_MANAGER_TYPE_KEYBINDING), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

static gpointer
gnome_pie_binding_manager_value_get_keybinding (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GNOME_PIE_BINDING_MANAGER_TYPE_KEYBINDING), NULL);
	return value->data[0].v_pointer;
}

static void
gnome_pie_binding_manager_value_set_keybinding (GValue* value,
                                                gpointer v_object)
{
	GnomePieBindingManagerKeybinding * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GNOME_PIE_BINDING_MANAGER_TYPE_KEYBINDING));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GNOME_PIE_BINDING_MANAGER_TYPE_KEYBINDING));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		gnome_pie_binding_manager_keybinding_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		gnome_pie_binding_manager_keybinding_unref (old);
	}
}

static void
gnome_pie_binding_manager_value_take_keybinding (GValue* value,
                                                 gpointer v_object)
{
	GnomePieBindingManagerKeybinding * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GNOME_PIE_BINDING_MANAGER_TYPE_KEYBINDING));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GNOME_PIE_BINDING_MANAGER_TYPE_KEYBINDING));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		gnome_pie_binding_manager_keybinding_unref (old);
	}
}

static void
gnome_pie_binding_manager_keybinding_class_init (GnomePieBindingManagerKeybindingClass * klass,
                                                 gpointer klass_data)
{
	gnome_pie_binding_manager_keybinding_parent_class = g_type_class_peek_parent (klass);
	((GnomePieBindingManagerKeybindingClass *) klass)->finalize = gnome_pie_binding_manager_keybinding_finalize;
	g_type_class_adjust_private_offset (klass, &GnomePieBindingManagerKeybinding_private_offset);
}

static void
gnome_pie_binding_manager_keybinding_instance_init (GnomePieBindingManagerKeybinding * self,
                                                    gpointer klass)
{
	self->priv = gnome_pie_binding_manager_keybinding_get_instance_private (self);
	self->ref_count = 1;
}

static void
gnome_pie_binding_manager_keybinding_finalize (GnomePieBindingManagerKeybinding * obj)
{
	GnomePieBindingManagerKeybinding * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GNOME_PIE_BINDING_MANAGER_TYPE_KEYBINDING, GnomePieBindingManagerKeybinding);
	g_signal_handlers_destroy (self);
	_g_object_unref0 (self->priv->_trigger);
	_g_free0 (self->priv->_id);
}

static GType
gnome_pie_binding_manager_keybinding_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { gnome_pie_binding_manager_value_keybinding_init, gnome_pie_binding_manager_value_keybinding_free_value, gnome_pie_binding_manager_value_keybinding_copy_value, gnome_pie_binding_manager_value_keybinding_peek_pointer, "p", gnome_pie_binding_manager_value_keybinding_collect_value, "p", gnome_pie_binding_manager_value_keybinding_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (GnomePieBindingManagerKeybindingClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gnome_pie_binding_manager_keybinding_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GnomePieBindingManagerKeybinding), 0, (GInstanceInitFunc) gnome_pie_binding_manager_keybinding_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType gnome_pie_binding_manager_keybinding_type_id;
	gnome_pie_binding_manager_keybinding_type_id = g_type_register_fundamental (g_type_fundamental_next (), "GnomePieBindingManagerKeybinding", &g_define_type_info, &g_define_type_fundamental_info, 0);
	GnomePieBindingManagerKeybinding_private_offset = g_type_add_instance_private (gnome_pie_binding_manager_keybinding_type_id, sizeof (GnomePieBindingManagerKeybindingPrivate));
	return gnome_pie_binding_manager_keybinding_type_id;
}

static GType
gnome_pie_binding_manager_keybinding_get_type (void)
{
	static volatile gsize gnome_pie_binding_manager_keybinding_type_id__once = 0;
	if (g_once_init_enter (&gnome_pie_binding_manager_keybinding_type_id__once)) {
		GType gnome_pie_binding_manager_keybinding_type_id;
		gnome_pie_binding_manager_keybinding_type_id = gnome_pie_binding_manager_keybinding_get_type_once ();
		g_once_init_leave (&gnome_pie_binding_manager_keybinding_type_id__once, gnome_pie_binding_manager_keybinding_type_id);
	}
	return gnome_pie_binding_manager_keybinding_type_id__once;
}

static gpointer
gnome_pie_binding_manager_keybinding_ref (gpointer instance)
{
	GnomePieBindingManagerKeybinding * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

static void
gnome_pie_binding_manager_keybinding_unref (gpointer instance)
{
	GnomePieBindingManagerKeybinding * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		GNOME_PIE_BINDING_MANAGER_KEYBINDING_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static void
gnome_pie_binding_manager_class_init (GnomePieBindingManagerClass * klass,
                                      gpointer klass_data)
{
	guint* _tmp0_;
	gnome_pie_binding_manager_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GnomePieBindingManager_private_offset);
	G_OBJECT_CLASS (klass)->finalize = gnome_pie_binding_manager_finalize;
	gnome_pie_binding_manager_signals[GNOME_PIE_BINDING_MANAGER_ON_PRESS_SIGNAL] = g_signal_new ("on-press", GNOME_PIE_TYPE_BINDING_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
	gnome_pie_binding_manager_signals[GNOME_PIE_BINDING_MANAGER_ON_RELEASE_SIGNAL] = g_signal_new ("on-release", GNOME_PIE_TYPE_BINDING_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__UINT, G_TYPE_NONE, 1, G_TYPE_UINT);
	_tmp0_ = g_new0 (guint, 8);
	_tmp0_[0] = (guint) 0;
	_tmp0_[1] = (guint) GDK_MOD2_MASK;
	_tmp0_[2] = (guint) GDK_LOCK_MASK;
	_tmp0_[3] = (guint) GDK_MOD5_MASK;
	_tmp0_[4] = (guint) (GDK_MOD2_MASK | GDK_LOCK_MASK);
	_tmp0_[5] = (guint) (GDK_MOD2_MASK | GDK_MOD5_MASK);
	_tmp0_[6] = (guint) (GDK_LOCK_MASK | GDK_MOD5_MASK);
	_tmp0_[7] = (guint) ((GDK_MOD2_MASK | GDK_LOCK_MASK) | GDK_MOD5_MASK);
	gnome_pie_binding_manager_lock_modifiers = _tmp0_;
	gnome_pie_binding_manager_lock_modifiers_length1 = 8;
	_gnome_pie_binding_manager_lock_modifiers_size_ = gnome_pie_binding_manager_lock_modifiers_length1;
}

static void
gnome_pie_binding_manager_instance_init (GnomePieBindingManager * self,
                                         gpointer klass)
{
	GeeArrayList* _tmp0_;
	const gchar* _tmp1_;
	self->priv = gnome_pie_binding_manager_get_instance_private (self);
	_tmp0_ = gee_array_list_new (GNOME_PIE_BINDING_MANAGER_TYPE_KEYBINDING, (GBoxedCopyFunc) gnome_pie_binding_manager_keybinding_ref, (GDestroyNotify) gnome_pie_binding_manager_keybinding_unref, NULL, NULL, NULL);
	self->priv->bindings = (GeeList*) _tmp0_;
	self->priv->delayed_count = (guint32) 0;
	self->priv->delayed_event = NULL;
	self->priv->delayed_binding = NULL;
	_tmp1_ = g_getenv ("XDG_SESSION_TYPE");
	self->priv->wayland = g_strcmp0 (_tmp1_, "wayland") == 0;
}

static void
gnome_pie_binding_manager_finalize (GObject * obj)
{
	GnomePieBindingManager * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GNOME_PIE_TYPE_BINDING_MANAGER, GnomePieBindingManager);
	_g_object_unref0 (self->priv->bindings);
	_g_free0 (self->priv->delayed_event);
	_gnome_pie_binding_manager_keybinding_unref0 (self->priv->delayed_binding);
	G_OBJECT_CLASS (gnome_pie_binding_manager_parent_class)->finalize (obj);
}

static GType
gnome_pie_binding_manager_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GnomePieBindingManagerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gnome_pie_binding_manager_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GnomePieBindingManager), 0, (GInstanceInitFunc) gnome_pie_binding_manager_instance_init, NULL };
	GType gnome_pie_binding_manager_type_id;
	gnome_pie_binding_manager_type_id = g_type_register_static (G_TYPE_OBJECT, "GnomePieBindingManager", &g_define_type_info, 0);
	GnomePieBindingManager_private_offset = g_type_add_instance_private (gnome_pie_binding_manager_type_id, sizeof (GnomePieBindingManagerPrivate));
	return gnome_pie_binding_manager_type_id;
}

GType
gnome_pie_binding_manager_get_type (void)
{
	static volatile gsize gnome_pie_binding_manager_type_id__once = 0;
	if (g_once_init_enter (&gnome_pie_binding_manager_type_id__once)) {
		GType gnome_pie_binding_manager_type_id;
		gnome_pie_binding_manager_type_id = gnome_pie_binding_manager_get_type_once ();
		g_once_init_leave (&gnome_pie_binding_manager_type_id__once, gnome_pie_binding_manager_type_id);
	}
	return gnome_pie_binding_manager_type_id__once;
}

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;
}

