/* pieOptionsWindow.c generated by valac 0.56.18, the Vala compiler
 * generated from pieOptionsWindow.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 <gtk/gtk.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gdk/gdk.h>
#include <gee.h>
#include <glib/gi18n-lib.h>
#include <gdk-pixbuf/gdk-pixbuf.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_PIE_OPTIONS_WINDOW (gnome_pie_pie_options_window_get_type ())
#define GNOME_PIE_PIE_OPTIONS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_PIE_OPTIONS_WINDOW, GnomePiePieOptionsWindow))
#define GNOME_PIE_PIE_OPTIONS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_PIE_OPTIONS_WINDOW, GnomePiePieOptionsWindowClass))
#define GNOME_PIE_IS_PIE_OPTIONS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_PIE_OPTIONS_WINDOW))
#define GNOME_PIE_IS_PIE_OPTIONS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_PIE_OPTIONS_WINDOW))
#define GNOME_PIE_PIE_OPTIONS_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_PIE_OPTIONS_WINDOW, GnomePiePieOptionsWindowClass))

typedef struct _GnomePiePieOptionsWindow GnomePiePieOptionsWindow;
typedef struct _GnomePiePieOptionsWindowClass GnomePiePieOptionsWindowClass;
typedef struct _GnomePiePieOptionsWindowPrivate GnomePiePieOptionsWindowPrivate;

#define GNOME_PIE_TYPE_TRIGGER_SELECT_BUTTON (gnome_pie_trigger_select_button_get_type ())
#define GNOME_PIE_TRIGGER_SELECT_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_TRIGGER_SELECT_BUTTON, GnomePieTriggerSelectButton))
#define GNOME_PIE_TRIGGER_SELECT_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_TRIGGER_SELECT_BUTTON, GnomePieTriggerSelectButtonClass))
#define GNOME_PIE_IS_TRIGGER_SELECT_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_TRIGGER_SELECT_BUTTON))
#define GNOME_PIE_IS_TRIGGER_SELECT_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_TRIGGER_SELECT_BUTTON))
#define GNOME_PIE_TRIGGER_SELECT_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_TRIGGER_SELECT_BUTTON, GnomePieTriggerSelectButtonClass))

typedef struct _GnomePieTriggerSelectButton GnomePieTriggerSelectButton;
typedef struct _GnomePieTriggerSelectButtonClass GnomePieTriggerSelectButtonClass;

#define GNOME_PIE_TYPE_ICON_SELECT_WINDOW (gnome_pie_icon_select_window_get_type ())
#define GNOME_PIE_ICON_SELECT_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_ICON_SELECT_WINDOW, GnomePieIconSelectWindow))
#define GNOME_PIE_ICON_SELECT_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_ICON_SELECT_WINDOW, GnomePieIconSelectWindowClass))
#define GNOME_PIE_IS_ICON_SELECT_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_ICON_SELECT_WINDOW))
#define GNOME_PIE_IS_ICON_SELECT_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_ICON_SELECT_WINDOW))
#define GNOME_PIE_ICON_SELECT_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_ICON_SELECT_WINDOW, GnomePieIconSelectWindowClass))

typedef struct _GnomePieIconSelectWindow GnomePieIconSelectWindow;
typedef struct _GnomePieIconSelectWindowClass GnomePieIconSelectWindowClass;

#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;
enum  {
	GNOME_PIE_PIE_OPTIONS_WINDOW_0_PROPERTY,
	GNOME_PIE_PIE_OPTIONS_WINDOW_NUM_PROPERTIES
};
static GParamSpec* gnome_pie_pie_options_window_properties[GNOME_PIE_PIE_OPTIONS_WINDOW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define GNOME_PIE_TYPE_PIE (gnome_pie_pie_get_type ())
#define GNOME_PIE_PIE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_PIE, GnomePiePie))
#define GNOME_PIE_PIE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_PIE, GnomePiePieClass))
#define GNOME_PIE_IS_PIE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_PIE))
#define GNOME_PIE_IS_PIE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_PIE))
#define GNOME_PIE_PIE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_PIE, GnomePiePieClass))

typedef struct _GnomePiePie GnomePiePie;
typedef struct _GnomePiePieClass GnomePiePieClass;
enum  {
	GNOME_PIE_PIE_OPTIONS_WINDOW_ON_OK_SIGNAL,
	GNOME_PIE_PIE_OPTIONS_WINDOW_NUM_SIGNALS
};
static guint gnome_pie_pie_options_window_signals[GNOME_PIE_PIE_OPTIONS_WINDOW_NUM_SIGNALS] = {0};

struct _GnomePiePieOptionsWindow {
	GObject parent_instance;
	GnomePiePieOptionsWindowPrivate * priv;
};

struct _GnomePiePieOptionsWindowClass {
	GObjectClass parent_class;
};

struct _GnomePiePieOptionsWindowPrivate {
	GtkDialog* window;
	GtkCheckButton* turbo;
	GtkCheckButton* delayed;
	GtkCheckButton* centered;
	GtkCheckButton* warp;
	GtkRadioButton* rshape[10];
	GnomePieTriggerSelectButton* trigger_button;
	GtkEntry* name_entry;
	GtkButton* icon_button;
	GtkImage* icon;
	GtkLabel* pie_id;
	GtkLabel* hint;
	GtkFrame* optionsFrame;
	GnomePieIconSelectWindow* icon_window;
	GnomePieTrigger* trigger;
	GnomePieTrigger* original_trigger;
	gchar* icon_name;
	gchar* id;
};

static gint GnomePiePieOptionsWindow_private_offset;
static gpointer gnome_pie_pie_options_window_parent_class = NULL;
static gint gnome_pie_pie_options_window_notify_toggle;
static gint gnome_pie_pie_options_window_notify_toggle = 0;

VALA_EXTERN GType gnome_pie_pie_options_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePiePieOptionsWindow, g_object_unref)
VALA_EXTERN GType gnome_pie_trigger_select_button_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieTriggerSelectButton, g_object_unref)
VALA_EXTERN GType gnome_pie_icon_select_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieIconSelectWindow, g_object_unref)
VALA_EXTERN GType gnome_pie_trigger_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieTrigger, g_object_unref)
VALA_EXTERN GnomePiePieOptionsWindow* gnome_pie_pie_options_window_new (void);
VALA_EXTERN GnomePiePieOptionsWindow* gnome_pie_pie_options_window_construct (GType object_type);
VALA_EXTERN const gchar* gnome_pie_paths_get_ui_files (void);
VALA_EXTERN GnomePieTriggerSelectButton* gnome_pie_trigger_select_button_new (gboolean enable_mouse);
VALA_EXTERN GnomePieTriggerSelectButton* gnome_pie_trigger_select_button_construct (GType object_type,
                                                                        gboolean enable_mouse);
static void ___lambda72_ (GnomePiePieOptionsWindow* self,
                   GnomePieTrigger* trigger);
VALA_EXTERN guint gnome_pie_trigger_get_key_sym (GnomePieTrigger* self);
VALA_EXTERN GdkModifierType gnome_pie_trigger_get_modifiers (GnomePieTrigger* self);
VALA_EXTERN gboolean gnome_pie_trigger_get_with_mouse (GnomePieTrigger* self);
static gint gnome_pie_pie_options_window_get_radio_shape (GnomePiePieOptionsWindow* self);
VALA_EXTERN GnomePieTrigger* gnome_pie_trigger_new_from_values (guint key_sym,
                                                    GdkModifierType modifiers,
                                                    gboolean with_mouse,
                                                    gboolean turbo,
                                                    gboolean delayed,
                                                    gboolean centered,
                                                    gboolean warp,
                                                    gint shape);
VALA_EXTERN GnomePieTrigger* gnome_pie_trigger_construct_from_values (GType object_type,
                                                          guint key_sym,
                                                          GdkModifierType modifiers,
                                                          gboolean with_mouse,
                                                          gboolean turbo,
                                                          gboolean delayed,
                                                          gboolean centered,
                                                          gboolean warp,
                                                          gint shape);
static void ____lambda72__gnome_pie_trigger_select_button_on_select (GnomePieTriggerSelectButton* _sender,
                                                              GnomePieTrigger* trigger,
                                                              gpointer self);
static void gnome_pie_pie_options_window_on_ok_button_clicked (GnomePiePieOptionsWindow* self);
static void _gnome_pie_pie_options_window_on_ok_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                            gpointer self);
static void gnome_pie_pie_options_window_on_cancel_button_clicked (GnomePiePieOptionsWindow* self);
static void _gnome_pie_pie_options_window_on_cancel_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                gpointer self);
static void gnome_pie_pie_options_window_on_check_toggled (GnomePiePieOptionsWindow* self);
static void _gnome_pie_pie_options_window_on_check_toggled_gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                                               gpointer self);
static void gnome_pie_pie_options_window_on_radio_toggled (GnomePiePieOptionsWindow* self);
static void _gnome_pie_pie_options_window_on_radio_toggled_gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                                               gpointer self);
static void _gnome_pie_pie_options_window_on_ok_button_clicked_gtk_entry_activate (GtkEntry* _sender,
                                                                            gpointer self);
static void gnome_pie_pie_options_window_on_icon_button_clicked (GnomePiePieOptionsWindow* self,
                                                          GtkButton* button);
static void _gnome_pie_pie_options_window_on_icon_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                              gpointer self);
static gboolean _gtk_widget_hide_on_delete_gtk_widget_delete_event (GtkWidget* _sender,
                                                             GdkEventAny* event,
                                                             gpointer self);
VALA_EXTERN void gnome_pie_pie_options_window_set_parent (GnomePiePieOptionsWindow* self,
                                              GtkWindow* parent);
VALA_EXTERN void gnome_pie_pie_options_window_show (GnomePiePieOptionsWindow* self);
VALA_EXTERN void gnome_pie_pie_options_window_set_pie (GnomePiePieOptionsWindow* self,
                                           const gchar* id);
VALA_EXTERN gchar* gnome_pie_pie_manager_get_accelerator_of (const gchar* id);
VALA_EXTERN GnomePieTrigger* gnome_pie_trigger_new_from_string (const gchar* trigger);
VALA_EXTERN GnomePieTrigger* gnome_pie_trigger_construct_from_string (GType object_type,
                                                          const gchar* trigger);
VALA_EXTERN GType gnome_pie_pie_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePiePie, g_object_unref)
VALA_EXTERN GeeHashMap* gnome_pie_pie_manager_get_all_pies (void);
VALA_EXTERN gboolean gnome_pie_trigger_get_turbo (GnomePieTrigger* self);
VALA_EXTERN gboolean gnome_pie_trigger_get_delayed (GnomePieTrigger* self);
VALA_EXTERN gboolean gnome_pie_trigger_get_centered (GnomePieTrigger* self);
VALA_EXTERN gboolean gnome_pie_trigger_get_warp (GnomePieTrigger* self);
static void gnome_pie_pie_options_window_set_radio_shape (GnomePiePieOptionsWindow* self,
                                                   gint rs);
VALA_EXTERN gint gnome_pie_trigger_get_shape (GnomePieTrigger* self);
VALA_EXTERN gchar* gnome_pie_pie_manager_get_name_of (const gchar* id);
VALA_EXTERN void gnome_pie_trigger_select_button_set_trigger (GnomePieTriggerSelectButton* self,
                                                  GnomePieTrigger* trigger);
static void gnome_pie_pie_options_window_set_icon (GnomePiePieOptionsWindow* self,
                                            const gchar* name);
VALA_EXTERN const gchar* gnome_pie_pie_get_icon (GnomePiePie* self);
VALA_EXTERN GnomePieIconSelectWindow* gnome_pie_icon_select_window_new (GtkWindow* parent);
VALA_EXTERN GnomePieIconSelectWindow* gnome_pie_icon_select_window_construct (GType object_type,
                                                                  GtkWindow* parent);
static void ___lambda73_ (GnomePiePieOptionsWindow* self,
                   const gchar* icon);
static void ____lambda73__gnome_pie_icon_select_window_on_ok (GnomePieIconSelectWindow* _sender,
                                                       const gchar* icon_name,
                                                       gpointer self);
VALA_EXTERN void gnome_pie_icon_select_window_show (GnomePieIconSelectWindow* self);
VALA_EXTERN void gnome_pie_icon_select_window_set_icon (GnomePieIconSelectWindow* self,
                                            const gchar* icon);
VALA_EXTERN gchar* gnome_pie_pie_manager_get_assigned_id (GnomePieTrigger* trigger);
static void g_cclosure_user_marshal_VOID__OBJECT_STRING_STRING (GClosure * closure,
                                                         GValue * return_value,
                                                         guint n_param_values,
                                                         const GValue * param_values,
                                                         gpointer invocation_hint,
                                                         gpointer marshal_data);
static void gnome_pie_pie_options_window_finalize (GObject * obj);
static GType gnome_pie_pie_options_window_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static inline gpointer
gnome_pie_pie_options_window_get_instance_private (GnomePiePieOptionsWindow* self)
{
	return G_STRUCT_MEMBER_P (self, GnomePiePieOptionsWindow_private_offset);
}

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

static void
___lambda72_ (GnomePiePieOptionsWindow* self,
              GnomePieTrigger* trigger)
{
	guint _tmp0_;
	guint _tmp1_;
	GdkModifierType _tmp2_;
	GdkModifierType _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	GtkCheckButton* _tmp6_;
	gboolean _tmp7_;
	gboolean _tmp8_;
	GtkCheckButton* _tmp9_;
	gboolean _tmp10_;
	gboolean _tmp11_;
	GtkCheckButton* _tmp12_;
	gboolean _tmp13_;
	gboolean _tmp14_;
	GtkCheckButton* _tmp15_;
	gboolean _tmp16_;
	gboolean _tmp17_;
	GnomePieTrigger* _tmp18_;
	g_return_if_fail (trigger != NULL);
	_tmp0_ = gnome_pie_trigger_get_key_sym (trigger);
	_tmp1_ = _tmp0_;
	_tmp2_ = gnome_pie_trigger_get_modifiers (trigger);
	_tmp3_ = _tmp2_;
	_tmp4_ = gnome_pie_trigger_get_with_mouse (trigger);
	_tmp5_ = _tmp4_;
	_tmp6_ = self->priv->turbo;
	_tmp7_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = self->priv->delayed;
	_tmp10_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = self->priv->centered;
	_tmp13_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp12_);
	_tmp14_ = _tmp13_;
	_tmp15_ = self->priv->warp;
	_tmp16_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp15_);
	_tmp17_ = _tmp16_;
	_tmp18_ = gnome_pie_trigger_new_from_values (_tmp1_, _tmp3_, _tmp5_, _tmp8_, _tmp11_, _tmp14_, _tmp17_, gnome_pie_pie_options_window_get_radio_shape (self));
	_g_object_unref0 (self->priv->trigger);
	self->priv->trigger = _tmp18_;
}

static void
____lambda72__gnome_pie_trigger_select_button_on_select (GnomePieTriggerSelectButton* _sender,
                                                         GnomePieTrigger* trigger,
                                                         gpointer self)
{
	___lambda72_ ((GnomePiePieOptionsWindow*) self, trigger);
}

static void
_gnome_pie_pie_options_window_on_ok_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                       gpointer self)
{
	gnome_pie_pie_options_window_on_ok_button_clicked ((GnomePiePieOptionsWindow*) self);
}

static void
_gnome_pie_pie_options_window_on_cancel_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                           gpointer self)
{
	gnome_pie_pie_options_window_on_cancel_button_clicked ((GnomePiePieOptionsWindow*) self);
}

static void
_gnome_pie_pie_options_window_on_check_toggled_gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                                          gpointer self)
{
	gnome_pie_pie_options_window_on_check_toggled ((GnomePiePieOptionsWindow*) self);
}

static void
_gnome_pie_pie_options_window_on_radio_toggled_gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                                          gpointer self)
{
	gnome_pie_pie_options_window_on_radio_toggled ((GnomePiePieOptionsWindow*) self);
}

static void
_gnome_pie_pie_options_window_on_ok_button_clicked_gtk_entry_activate (GtkEntry* _sender,
                                                                       gpointer self)
{
	gnome_pie_pie_options_window_on_ok_button_clicked ((GnomePiePieOptionsWindow*) self);
}

static void
_gnome_pie_pie_options_window_on_icon_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                         gpointer self)
{
	gnome_pie_pie_options_window_on_icon_button_clicked ((GnomePiePieOptionsWindow*) self, _sender);
}

static gboolean
_gtk_widget_hide_on_delete_gtk_widget_delete_event (GtkWidget* _sender,
                                                    GdkEventAny* event,
                                                    gpointer self)
{
	gboolean result;
	result = gtk_widget_hide_on_delete ((GtkWidget*) self);
	return result;
}

GnomePiePieOptionsWindow*
gnome_pie_pie_options_window_construct (GType object_type)
{
	GnomePiePieOptionsWindow * self = NULL;
	GError* _inner_error0_ = NULL;
	self = (GnomePiePieOptionsWindow*) g_object_new (object_type, NULL);
	{
		GtkBuilder* builder = NULL;
		GtkBuilder* _tmp0_;
		const gchar* _tmp1_;
		const gchar* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		GObject* _tmp5_;
		GtkDialog* _tmp6_;
		GnomePieTriggerSelectButton* _tmp7_;
		GnomePieTriggerSelectButton* _tmp8_;
		GnomePieTriggerSelectButton* _tmp9_;
		GObject* _tmp10_;
		GnomePieTriggerSelectButton* _tmp11_;
		GObject* _tmp12_;
		GObject* _tmp13_;
		GObject* _tmp14_;
		GtkCheckButton* _tmp15_;
		GtkCheckButton* _tmp16_;
		GObject* _tmp17_;
		GtkCheckButton* _tmp18_;
		GtkCheckButton* _tmp19_;
		GObject* _tmp20_;
		GtkCheckButton* _tmp21_;
		GtkCheckButton* _tmp22_;
		GObject* _tmp23_;
		GtkCheckButton* _tmp24_;
		GtkCheckButton* _tmp25_;
		GObject* _tmp33_;
		GtkEntry* _tmp34_;
		GtkEntry* _tmp35_;
		GObject* _tmp36_;
		GtkLabel* _tmp37_;
		GObject* _tmp38_;
		GtkImage* _tmp39_;
		GObject* _tmp40_;
		GtkButton* _tmp41_;
		GtkButton* _tmp42_;
		GObject* _tmp43_;
		GtkLabel* _tmp44_;
		GObject* _tmp45_;
		GtkFrame* _tmp46_;
		GtkDialog* _tmp47_;
		GtkDialog* _tmp48_;
		_tmp0_ = gtk_builder_new ();
		builder = _tmp0_;
		_tmp1_ = gnome_pie_paths_get_ui_files ();
		_tmp2_ = _tmp1_;
		_tmp3_ = g_strconcat (_tmp2_, "/pie_options.ui", NULL);
		_tmp4_ = _tmp3_;
		gtk_builder_add_from_file (builder, _tmp4_, &_inner_error0_);
		_g_free0 (_tmp4_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (builder);
			goto __catch0_g_error;
		}
		_tmp5_ = gtk_builder_get_object (builder, "window");
		_tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, gtk_dialog_get_type ()) ? ((GtkDialog*) _tmp5_) : NULL);
		_g_object_unref0 (self->priv->window);
		self->priv->window = _tmp6_;
		_tmp7_ = gnome_pie_trigger_select_button_new (TRUE);
		g_object_ref_sink (_tmp7_);
		_g_object_unref0 (self->priv->trigger_button);
		self->priv->trigger_button = _tmp7_;
		_tmp8_ = self->priv->trigger_button;
		gtk_widget_show ((GtkWidget*) _tmp8_);
		_tmp9_ = self->priv->trigger_button;
		g_signal_connect_object (_tmp9_, "on-select", (GCallback) ____lambda72__gnome_pie_trigger_select_button_on_select, self, 0);
		_tmp10_ = gtk_builder_get_object (builder, "trigger-box");
		_tmp11_ = self->priv->trigger_button;
		gtk_box_pack_start (G_TYPE_CHECK_INSTANCE_TYPE (_tmp10_, gtk_box_get_type ()) ? ((GtkBox*) _tmp10_) : NULL, (GtkWidget*) _tmp11_, TRUE, TRUE, (guint) 0);
		_tmp12_ = gtk_builder_get_object (builder, "ok-button");
		g_signal_connect_object (G_TYPE_CHECK_INSTANCE_TYPE (_tmp12_, gtk_button_get_type ()) ? ((GtkButton*) _tmp12_) : NULL, "clicked", (GCallback) _gnome_pie_pie_options_window_on_ok_button_clicked_gtk_button_clicked, self, 0);
		_tmp13_ = gtk_builder_get_object (builder, "cancel-button");
		g_signal_connect_object (G_TYPE_CHECK_INSTANCE_TYPE (_tmp13_, gtk_button_get_type ()) ? ((GtkButton*) _tmp13_) : NULL, "clicked", (GCallback) _gnome_pie_pie_options_window_on_cancel_button_clicked_gtk_button_clicked, self, 0);
		_tmp14_ = gtk_builder_get_object (builder, "turbo-check");
		_tmp15_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp14_, gtk_check_button_get_type ()) ? ((GtkCheckButton*) _tmp14_) : NULL);
		_g_object_unref0 (self->priv->turbo);
		self->priv->turbo = _tmp15_;
		_tmp16_ = self->priv->turbo;
		g_signal_connect_object ((GtkToggleButton*) _tmp16_, "toggled", (GCallback) _gnome_pie_pie_options_window_on_check_toggled_gtk_toggle_button_toggled, self, 0);
		_tmp17_ = gtk_builder_get_object (builder, "delay-check");
		_tmp18_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp17_, gtk_check_button_get_type ()) ? ((GtkCheckButton*) _tmp17_) : NULL);
		_g_object_unref0 (self->priv->delayed);
		self->priv->delayed = _tmp18_;
		_tmp19_ = self->priv->delayed;
		g_signal_connect_object ((GtkToggleButton*) _tmp19_, "toggled", (GCallback) _gnome_pie_pie_options_window_on_check_toggled_gtk_toggle_button_toggled, self, 0);
		_tmp20_ = gtk_builder_get_object (builder, "center-check");
		_tmp21_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp20_, gtk_check_button_get_type ()) ? ((GtkCheckButton*) _tmp20_) : NULL);
		_g_object_unref0 (self->priv->centered);
		self->priv->centered = _tmp21_;
		_tmp22_ = self->priv->centered;
		g_signal_connect_object ((GtkToggleButton*) _tmp22_, "toggled", (GCallback) _gnome_pie_pie_options_window_on_check_toggled_gtk_toggle_button_toggled, self, 0);
		_tmp23_ = gtk_builder_get_object (builder, "warp-check");
		_tmp24_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp23_, gtk_check_button_get_type ()) ? ((GtkCheckButton*) _tmp23_) : NULL);
		_g_object_unref0 (self->priv->warp);
		self->priv->warp = _tmp24_;
		_tmp25_ = self->priv->warp;
		g_signal_connect_object ((GtkToggleButton*) _tmp25_, "toggled", (GCallback) _gnome_pie_pie_options_window_on_check_toggled_gtk_toggle_button_toggled, self, 0);
		{
			gint i = 0;
			i = 0;
			{
				gboolean _tmp26_ = FALSE;
				_tmp26_ = TRUE;
				while (TRUE) {
					gchar* _tmp28_;
					gchar* _tmp29_;
					GObject* _tmp30_;
					GtkRadioButton* _tmp31_;
					GtkRadioButton* _tmp32_;
					if (!_tmp26_) {
						gint _tmp27_;
						_tmp27_ = i;
						i = _tmp27_ + 1;
					}
					_tmp26_ = FALSE;
					if (!(i < 10)) {
						break;
					}
					_tmp28_ = g_strdup_printf ("rshape%d", i);
					_tmp29_ = _tmp28_;
					_tmp30_ = gtk_builder_get_object (builder, _tmp29_);
					_tmp31_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp30_, gtk_radio_button_get_type ()) ? ((GtkRadioButton*) _tmp30_) : NULL);
					_g_object_unref0 (self->priv->rshape[i]);
					self->priv->rshape[i] = _tmp31_;
					_g_free0 (_tmp29_);
					_tmp32_ = self->priv->rshape[i];
					g_signal_connect_object ((GtkToggleButton*) _tmp32_, "toggled", (GCallback) _gnome_pie_pie_options_window_on_radio_toggled_gtk_toggle_button_toggled, self, 0);
				}
			}
		}
		_tmp33_ = gtk_builder_get_object (builder, "name-entry");
		_tmp34_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp33_, gtk_entry_get_type ()) ? ((GtkEntry*) _tmp33_) : NULL);
		_g_object_unref0 (self->priv->name_entry);
		self->priv->name_entry = _tmp34_;
		_tmp35_ = self->priv->name_entry;
		g_signal_connect_object (_tmp35_, "activate", (GCallback) _gnome_pie_pie_options_window_on_ok_button_clicked_gtk_entry_activate, self, 0);
		_tmp36_ = gtk_builder_get_object (builder, "pie-id");
		_tmp37_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp36_, gtk_label_get_type ()) ? ((GtkLabel*) _tmp36_) : NULL);
		_g_object_unref0 (self->priv->pie_id);
		self->priv->pie_id = _tmp37_;
		_tmp38_ = gtk_builder_get_object (builder, "icon");
		_tmp39_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp38_, gtk_image_get_type ()) ? ((GtkImage*) _tmp38_) : NULL);
		_g_object_unref0 (self->priv->icon);
		self->priv->icon = _tmp39_;
		_tmp40_ = gtk_builder_get_object (builder, "icon-button");
		_tmp41_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp40_, gtk_button_get_type ()) ? ((GtkButton*) _tmp40_) : NULL);
		_g_object_unref0 (self->priv->icon_button);
		self->priv->icon_button = _tmp41_;
		_tmp42_ = self->priv->icon_button;
		g_signal_connect_object (_tmp42_, "clicked", (GCallback) _gnome_pie_pie_options_window_on_icon_button_clicked_gtk_button_clicked, self, 0);
		_tmp43_ = gtk_builder_get_object (builder, "hint");
		_tmp44_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp43_, gtk_label_get_type ()) ? ((GtkLabel*) _tmp43_) : NULL);
		_g_object_unref0 (self->priv->hint);
		self->priv->hint = _tmp44_;
		_tmp45_ = gtk_builder_get_object (builder, "optionsFrame");
		_tmp46_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp45_, gtk_frame_get_type ()) ? ((GtkFrame*) _tmp45_) : NULL);
		_g_object_unref0 (self->priv->optionsFrame);
		self->priv->optionsFrame = _tmp46_;
		_tmp47_ = self->priv->window;
		_tmp48_ = self->priv->window;
		g_signal_connect_object ((GtkWidget*) _tmp47_, "delete-event", (GCallback) _gtk_widget_hide_on_delete_gtk_widget_delete_event, (GtkWidget*) _tmp48_, 0);
		_g_object_unref0 (builder);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		const gchar* _tmp49_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp49_ = e->message;
		g_error ("pieOptionsWindow.vala:159: Could not load UI: %s\n", _tmp49_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	return self;
}

GnomePiePieOptionsWindow*
gnome_pie_pie_options_window_new (void)
{
	return gnome_pie_pie_options_window_construct (GNOME_PIE_TYPE_PIE_OPTIONS_WINDOW);
}

void
gnome_pie_pie_options_window_set_parent (GnomePiePieOptionsWindow* self,
                                         GtkWindow* parent)
{
	GtkDialog* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (parent != NULL);
	_tmp0_ = self->priv->window;
	gtk_window_set_transient_for ((GtkWindow*) _tmp0_, parent);
}

void
gnome_pie_pie_options_window_show (GnomePiePieOptionsWindow* self)
{
	GtkDialog* _tmp0_;
	const gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->window;
	gtk_widget_show_all ((GtkWidget*) _tmp0_);
	_tmp1_ = g_getenv ("XDG_SESSION_TYPE");
	if (g_strcmp0 (_tmp1_, "wayland") == 0) {
		GtkFrame* _tmp2_;
		_tmp2_ = self->priv->optionsFrame;
		gtk_widget_set_visible ((GtkWidget*) _tmp2_, FALSE);
	}
}

void
gnome_pie_pie_options_window_set_pie (GnomePiePieOptionsWindow* self,
                                      const gchar* id)
{
	GnomePieTrigger* trigger = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	GnomePieTrigger* _tmp2_;
	GnomePieTrigger* _tmp3_;
	GnomePiePie* pie = NULL;
	GeeHashMap* _tmp4_;
	GeeHashMap* _tmp5_;
	gpointer _tmp6_;
	gchar* _tmp7_;
	GtkCheckButton* _tmp8_;
	GnomePieTrigger* _tmp9_;
	gboolean _tmp10_;
	gboolean _tmp11_;
	GtkCheckButton* _tmp12_;
	GnomePieTrigger* _tmp13_;
	gboolean _tmp14_;
	gboolean _tmp15_;
	GtkCheckButton* _tmp16_;
	GnomePieTrigger* _tmp17_;
	gboolean _tmp18_;
	gboolean _tmp19_;
	GtkCheckButton* _tmp20_;
	GnomePieTrigger* _tmp21_;
	gboolean _tmp22_;
	gboolean _tmp23_;
	GnomePieTrigger* _tmp24_;
	gint _tmp25_;
	gint _tmp26_;
	GnomePieTrigger* _tmp27_;
	GnomePieTrigger* _tmp28_;
	GnomePieTrigger* _tmp29_;
	GnomePieTrigger* _tmp30_;
	GtkEntry* _tmp31_;
	gchar* _tmp32_;
	gchar* _tmp33_;
	GtkLabel* _tmp34_;
	gchar* _tmp35_;
	gchar* _tmp36_;
	GnomePieTriggerSelectButton* _tmp37_;
	GnomePieTrigger* _tmp38_;
	GnomePiePie* _tmp39_;
	const gchar* _tmp40_;
	const gchar* _tmp41_;
	const gchar* _tmp42_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (id != NULL);
	_tmp0_ = gnome_pie_pie_manager_get_accelerator_of (id);
	_tmp1_ = _tmp0_;
	_tmp2_ = gnome_pie_trigger_new_from_string (_tmp1_);
	_tmp3_ = _tmp2_;
	_g_free0 (_tmp1_);
	trigger = _tmp3_;
	_tmp4_ = gnome_pie_pie_manager_get_all_pies ();
	_tmp5_ = _tmp4_;
	_tmp6_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp5_, id);
	pie = (GnomePiePie*) _tmp6_;
	_tmp7_ = g_strdup (id);
	_g_free0 (self->priv->id);
	self->priv->id = _tmp7_;
	_tmp8_ = self->priv->turbo;
	_tmp9_ = trigger;
	_tmp10_ = gnome_pie_trigger_get_turbo (_tmp9_);
	_tmp11_ = _tmp10_;
	gtk_toggle_button_set_active ((GtkToggleButton*) _tmp8_, _tmp11_);
	_tmp12_ = self->priv->delayed;
	_tmp13_ = trigger;
	_tmp14_ = gnome_pie_trigger_get_delayed (_tmp13_);
	_tmp15_ = _tmp14_;
	gtk_toggle_button_set_active ((GtkToggleButton*) _tmp12_, _tmp15_);
	_tmp16_ = self->priv->centered;
	_tmp17_ = trigger;
	_tmp18_ = gnome_pie_trigger_get_centered (_tmp17_);
	_tmp19_ = _tmp18_;
	gtk_toggle_button_set_active ((GtkToggleButton*) _tmp16_, _tmp19_);
	_tmp20_ = self->priv->warp;
	_tmp21_ = trigger;
	_tmp22_ = gnome_pie_trigger_get_warp (_tmp21_);
	_tmp23_ = _tmp22_;
	gtk_toggle_button_set_active ((GtkToggleButton*) _tmp20_, _tmp23_);
	_tmp24_ = trigger;
	_tmp25_ = gnome_pie_trigger_get_shape (_tmp24_);
	_tmp26_ = _tmp25_;
	gnome_pie_pie_options_window_set_radio_shape (self, _tmp26_);
	_tmp27_ = trigger;
	_tmp28_ = _g_object_ref0 (_tmp27_);
	_g_object_unref0 (self->priv->original_trigger);
	self->priv->original_trigger = _tmp28_;
	_tmp29_ = trigger;
	_tmp30_ = _g_object_ref0 (_tmp29_);
	_g_object_unref0 (self->priv->trigger);
	self->priv->trigger = _tmp30_;
	_tmp31_ = self->priv->name_entry;
	_tmp32_ = gnome_pie_pie_manager_get_name_of (id);
	_tmp33_ = _tmp32_;
	gtk_entry_set_text (_tmp31_, _tmp33_);
	_g_free0 (_tmp33_);
	_tmp34_ = self->priv->pie_id;
	_tmp35_ = g_strconcat ("Pie-ID: ", id, NULL);
	_tmp36_ = _tmp35_;
	gtk_label_set_label (_tmp34_, _tmp36_);
	_g_free0 (_tmp36_);
	_tmp37_ = self->priv->trigger_button;
	_tmp38_ = trigger;
	gnome_pie_trigger_select_button_set_trigger (_tmp37_, _tmp38_);
	_tmp39_ = pie;
	_tmp40_ = gnome_pie_pie_get_icon (_tmp39_);
	_tmp41_ = _tmp40_;
	gnome_pie_pie_options_window_set_icon (self, _tmp41_);
	_tmp42_ = g_getenv ("XDG_SESSION_TYPE");
	if (g_strcmp0 (_tmp42_, "wayland") == 0) {
		GnomePieTriggerSelectButton* _tmp43_;
		GtkLabel* _tmp44_;
		GtkLabel* _tmp45_;
		GtkLabel* _tmp46_;
		GtkLabel* _tmp47_;
		gchar* _tmp48_;
		gchar* _tmp49_;
		_tmp43_ = self->priv->trigger_button;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp43_, FALSE);
		_tmp44_ = self->priv->hint;
		gtk_label_set_line_wrap (_tmp44_, TRUE);
		_tmp45_ = self->priv->hint;
		gtk_label_set_max_width_chars (_tmp45_, 40);
		_tmp46_ = self->priv->hint;
		gtk_label_set_justify (_tmp46_, GTK_JUSTIFY_RIGHT);
		_tmp47_ = self->priv->hint;
		_tmp48_ = g_strdup_printf (_ ("Keybindings and some other options are not supported on Wayland. Howev" \
"er, you can use the terminial command \"gnome-pie --open %s\" to open " \
"this pie. Create a global hotkey in your system settings which execute" \
"s this command!"), id);
		_tmp49_ = _tmp48_;
		gtk_label_set_label (_tmp47_, _tmp49_);
		_g_free0 (_tmp49_);
	}
	_g_object_unref0 (pie);
	_g_object_unref0 (trigger);
}

static void
gnome_pie_pie_options_window_on_check_toggled (GnomePiePieOptionsWindow* self)
{
	GnomePieTrigger* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->trigger;
	if (_tmp0_ != NULL) {
		GnomePieTrigger* _tmp1_;
		guint _tmp2_;
		guint _tmp3_;
		GnomePieTrigger* _tmp4_;
		GdkModifierType _tmp5_;
		GdkModifierType _tmp6_;
		GnomePieTrigger* _tmp7_;
		gboolean _tmp8_;
		gboolean _tmp9_;
		GtkCheckButton* _tmp10_;
		gboolean _tmp11_;
		gboolean _tmp12_;
		GtkCheckButton* _tmp13_;
		gboolean _tmp14_;
		gboolean _tmp15_;
		GtkCheckButton* _tmp16_;
		gboolean _tmp17_;
		gboolean _tmp18_;
		GtkCheckButton* _tmp19_;
		gboolean _tmp20_;
		gboolean _tmp21_;
		GnomePieTrigger* _tmp22_;
		_tmp1_ = self->priv->trigger;
		_tmp2_ = gnome_pie_trigger_get_key_sym (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = self->priv->trigger;
		_tmp5_ = gnome_pie_trigger_get_modifiers (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = self->priv->trigger;
		_tmp8_ = gnome_pie_trigger_get_with_mouse (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = self->priv->turbo;
		_tmp11_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp10_);
		_tmp12_ = _tmp11_;
		_tmp13_ = self->priv->delayed;
		_tmp14_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp13_);
		_tmp15_ = _tmp14_;
		_tmp16_ = self->priv->centered;
		_tmp17_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp16_);
		_tmp18_ = _tmp17_;
		_tmp19_ = self->priv->warp;
		_tmp20_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp19_);
		_tmp21_ = _tmp20_;
		_tmp22_ = gnome_pie_trigger_new_from_values (_tmp3_, _tmp6_, _tmp9_, _tmp12_, _tmp15_, _tmp18_, _tmp21_, gnome_pie_pie_options_window_get_radio_shape (self));
		_g_object_unref0 (self->priv->trigger);
		self->priv->trigger = _tmp22_;
	}
}

static gint
gnome_pie_pie_options_window_get_radio_shape (GnomePiePieOptionsWindow* self)
{
	gint rs = 0;
	gint result;
	g_return_val_if_fail (self != NULL, 0);
	{
		gboolean _tmp0_ = FALSE;
		rs = 0;
		_tmp0_ = TRUE;
		while (TRUE) {
			GtkRadioButton* _tmp2_;
			gboolean _tmp3_;
			gboolean _tmp4_;
			if (!_tmp0_) {
				gint _tmp1_;
				_tmp1_ = rs;
				rs = _tmp1_ + 1;
			}
			_tmp0_ = FALSE;
			if (!(rs < 10)) {
				break;
			}
			_tmp2_ = self->priv->rshape[rs];
			_tmp3_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp2_);
			_tmp4_ = _tmp3_;
			if (_tmp4_) {
				break;
			}
		}
	}
	result = rs;
	return result;
}

static void
gnome_pie_pie_options_window_set_radio_shape (GnomePiePieOptionsWindow* self,
                                              gint rs)
{
	gboolean _tmp0_ = FALSE;
	GtkRadioButton* _tmp1_;
	g_return_if_fail (self != NULL);
	if (rs < 0) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = rs > 9;
	}
	if (_tmp0_) {
		rs = 5;
	}
	_tmp1_ = self->priv->rshape[rs];
	gtk_toggle_button_set_active ((GtkToggleButton*) _tmp1_, TRUE);
}

static void
gnome_pie_pie_options_window_on_radio_toggled (GnomePiePieOptionsWindow* self)
{
	g_return_if_fail (self != NULL);
	gnome_pie_pie_options_window_notify_toggle = 1 - gnome_pie_pie_options_window_notify_toggle;
	if (gnome_pie_pie_options_window_notify_toggle == 1) {
		gnome_pie_pie_options_window_on_check_toggled (self);
	}
}

static void
___lambda73_ (GnomePiePieOptionsWindow* self,
              const gchar* icon)
{
	g_return_if_fail (icon != NULL);
	gnome_pie_pie_options_window_set_icon (self, icon);
}

static void
____lambda73__gnome_pie_icon_select_window_on_ok (GnomePieIconSelectWindow* _sender,
                                                  const gchar* icon_name,
                                                  gpointer self)
{
	___lambda73_ ((GnomePiePieOptionsWindow*) self, icon_name);
}

static void
gnome_pie_pie_options_window_on_icon_button_clicked (GnomePiePieOptionsWindow* self,
                                                     GtkButton* button)
{
	GnomePieIconSelectWindow* _tmp0_;
	GnomePieIconSelectWindow* _tmp4_;
	GnomePieIconSelectWindow* _tmp5_;
	const gchar* _tmp6_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (button != NULL);
	_tmp0_ = self->priv->icon_window;
	if (_tmp0_ == NULL) {
		GtkDialog* _tmp1_;
		GnomePieIconSelectWindow* _tmp2_;
		GnomePieIconSelectWindow* _tmp3_;
		_tmp1_ = self->priv->window;
		_tmp2_ = gnome_pie_icon_select_window_new ((GtkWindow*) _tmp1_);
		_g_object_unref0 (self->priv->icon_window);
		self->priv->icon_window = _tmp2_;
		_tmp3_ = self->priv->icon_window;
		g_signal_connect_object (_tmp3_, "on-ok", (GCallback) ____lambda73__gnome_pie_icon_select_window_on_ok, self, 0);
	}
	_tmp4_ = self->priv->icon_window;
	gnome_pie_icon_select_window_show (_tmp4_);
	_tmp5_ = self->priv->icon_window;
	_tmp6_ = self->priv->icon_name;
	gnome_pie_icon_select_window_set_icon (_tmp5_, _tmp6_);
}

static void
gnome_pie_pie_options_window_on_ok_button_clicked (GnomePiePieOptionsWindow* self)
{
	gchar* assigned_id = NULL;
	GnomePieTrigger* _tmp0_;
	gchar* _tmp1_;
	gboolean _tmp2_ = FALSE;
	const gchar* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->trigger;
	_tmp1_ = gnome_pie_pie_manager_get_assigned_id (_tmp0_);
	assigned_id = _tmp1_;
	_tmp3_ = assigned_id;
	if (g_strcmp0 (_tmp3_, "") != 0) {
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		_tmp4_ = assigned_id;
		_tmp5_ = self->priv->id;
		_tmp2_ = g_strcmp0 (_tmp4_, _tmp5_) != 0;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		gchar* _error_ = NULL;
		const gchar* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		GtkMessageDialog* dialog = NULL;
		GtkDialog* _tmp11_;
		GtkWidget* _tmp12_;
		const gchar* _tmp13_;
		GtkMessageDialog* _tmp14_;
		GtkMessageDialog* _tmp15_;
		GtkMessageDialog* _tmp16_;
		_tmp6_ = assigned_id;
		_tmp7_ = gnome_pie_pie_manager_get_name_of (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = g_strdup_printf (_ ("This hotkey is already assigned to the pie \"%s\"! \n" \
"\n" \
"Please select " "another one or cancel your selection."), _tmp8_);
		_tmp10_ = _tmp9_;
		_g_free0 (_tmp8_);
		_error_ = _tmp10_;
		_tmp11_ = self->priv->window;
		_tmp12_ = gtk_widget_get_toplevel ((GtkWidget*) _tmp11_);
		_tmp13_ = _error_;
		_tmp14_ = (GtkMessageDialog*) gtk_message_dialog_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, gtk_window_get_type (), GtkWindow), GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_CANCEL, "%s", _tmp13_);
		g_object_ref_sink (_tmp14_);
		dialog = _tmp14_;
		_tmp15_ = dialog;
		gtk_dialog_run ((GtkDialog*) _tmp15_);
		_tmp16_ = dialog;
		gtk_widget_destroy ((GtkWidget*) _tmp16_);
		_g_object_unref0 (dialog);
		_g_free0 (_error_);
	} else {
		GnomePieTrigger* _tmp17_;
		GtkEntry* _tmp18_;
		const gchar* _tmp19_;
		const gchar* _tmp20_;
		const gchar* _tmp21_;
		GtkDialog* _tmp22_;
		_tmp17_ = self->priv->trigger;
		_tmp18_ = self->priv->name_entry;
		_tmp19_ = gtk_entry_get_text (_tmp18_);
		_tmp20_ = _tmp19_;
		_tmp21_ = self->priv->icon_name;
		g_signal_emit (self, gnome_pie_pie_options_window_signals[GNOME_PIE_PIE_OPTIONS_WINDOW_ON_OK_SIGNAL], 0, _tmp17_, _tmp20_, _tmp21_);
		_tmp22_ = self->priv->window;
		gtk_widget_hide ((GtkWidget*) _tmp22_);
	}
	_g_free0 (assigned_id);
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
	result = _tmp0_ != NULL;
	return result;
}

static void
gnome_pie_pie_options_window_set_icon (GnomePiePieOptionsWindow* self,
                                       const gchar* name)
{
	gchar* _tmp0_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	_tmp0_ = g_strdup (name);
	_g_free0 (self->priv->icon_name);
	self->priv->icon_name = _tmp0_;
	if (string_contains (name, "/")) {
		{
			GdkPixbuf* _tmp1_ = NULL;
			GtkImage* _tmp2_;
			GtkImage* _tmp3_;
			GdkPixbuf* _tmp4_;
			GtkImage* _tmp5_;
			_tmp2_ = self->priv->icon;
			_tmp3_ = self->priv->icon;
			_tmp4_ = gdk_pixbuf_new_from_file_at_scale (name, gtk_image_get_pixel_size (_tmp2_), gtk_image_get_pixel_size (_tmp3_), TRUE, &_inner_error0_);
			_tmp1_ = _tmp4_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_tmp5_ = self->priv->icon;
			g_object_set (_tmp5_, "pixbuf", _tmp1_, NULL);
			_g_object_unref0 (_tmp1_);
		}
		goto __finally0;
		__catch0_g_error:
		{
			GError* _error_ = NULL;
			GError* _tmp6_;
			const gchar* _tmp7_;
			_error_ = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp6_ = _error_;
			_tmp7_ = _tmp6_->message;
			g_warning ("pieOptionsWindow.vala:324: %s", _tmp7_);
			_g_error_free0 (_error_);
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	} else {
		GtkImage* _tmp8_;
		_tmp8_ = self->priv->icon;
		g_object_set (_tmp8_, "icon-name", name, NULL);
	}
}

static void
gnome_pie_pie_options_window_on_cancel_button_clicked (GnomePiePieOptionsWindow* self)
{
	GtkDialog* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->window;
	gtk_widget_hide ((GtkWidget*) _tmp0_);
}

static void
g_cclosure_user_marshal_VOID__OBJECT_STRING_STRING (GClosure * closure,
                                                    GValue * return_value,
                                                    guint n_param_values,
                                                    const GValue * param_values,
                                                    gpointer invocation_hint,
                                                    gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__OBJECT_STRING_STRING) (gpointer data1, gpointer arg_1, const char* arg_2, const char* arg_3, gpointer data2);
	register GMarshalFunc_VOID__OBJECT_STRING_STRING callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 4);
	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__OBJECT_STRING_STRING) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_object (param_values + 1), g_value_get_string (param_values + 2), g_value_get_string (param_values + 3), data2);
}

static void
gnome_pie_pie_options_window_class_init (GnomePiePieOptionsWindowClass * klass,
                                         gpointer klass_data)
{
	gnome_pie_pie_options_window_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GnomePiePieOptionsWindow_private_offset);
	G_OBJECT_CLASS (klass)->finalize = gnome_pie_pie_options_window_finalize;
	gnome_pie_pie_options_window_signals[GNOME_PIE_PIE_OPTIONS_WINDOW_ON_OK_SIGNAL] = g_signal_new ("on-ok", GNOME_PIE_TYPE_PIE_OPTIONS_WINDOW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_STRING_STRING, G_TYPE_NONE, 3, GNOME_PIE_TYPE_TRIGGER, G_TYPE_STRING, G_TYPE_STRING);
}

static void
gnome_pie_pie_options_window_instance_init (GnomePiePieOptionsWindow * self,
                                            gpointer klass)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	self->priv = gnome_pie_pie_options_window_get_instance_private (self);
	self->priv->name_entry = NULL;
	self->priv->icon_button = NULL;
	self->priv->icon = NULL;
	self->priv->pie_id = NULL;
	self->priv->hint = NULL;
	self->priv->optionsFrame = NULL;
	self->priv->icon_window = NULL;
	self->priv->trigger = NULL;
	self->priv->original_trigger = NULL;
	_tmp0_ = g_strdup ("");
	self->priv->icon_name = _tmp0_;
	_tmp1_ = g_strdup ("");
	self->priv->id = _tmp1_;
}

static void
gnome_pie_pie_options_window_finalize (GObject * obj)
{
	GnomePiePieOptionsWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GNOME_PIE_TYPE_PIE_OPTIONS_WINDOW, GnomePiePieOptionsWindow);
	_g_object_unref0 (self->priv->window);
	_g_object_unref0 (self->priv->turbo);
	_g_object_unref0 (self->priv->delayed);
	_g_object_unref0 (self->priv->centered);
	_g_object_unref0 (self->priv->warp);
	_vala_array_destroy (self->priv->rshape, 10, (GDestroyNotify) g_object_unref);
	_g_object_unref0 (self->priv->trigger_button);
	_g_object_unref0 (self->priv->name_entry);
	_g_object_unref0 (self->priv->icon_button);
	_g_object_unref0 (self->priv->icon);
	_g_object_unref0 (self->priv->pie_id);
	_g_object_unref0 (self->priv->hint);
	_g_object_unref0 (self->priv->optionsFrame);
	_g_object_unref0 (self->priv->icon_window);
	_g_object_unref0 (self->priv->trigger);
	_g_object_unref0 (self->priv->original_trigger);
	_g_free0 (self->priv->icon_name);
	_g_free0 (self->priv->id);
	G_OBJECT_CLASS (gnome_pie_pie_options_window_parent_class)->finalize (obj);
}

static GType
gnome_pie_pie_options_window_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GnomePiePieOptionsWindowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gnome_pie_pie_options_window_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GnomePiePieOptionsWindow), 0, (GInstanceInitFunc) gnome_pie_pie_options_window_instance_init, NULL };
	GType gnome_pie_pie_options_window_type_id;
	gnome_pie_pie_options_window_type_id = g_type_register_static (G_TYPE_OBJECT, "GnomePiePieOptionsWindow", &g_define_type_info, 0);
	GnomePiePieOptionsWindow_private_offset = g_type_add_instance_private (gnome_pie_pie_options_window_type_id, sizeof (GnomePiePieOptionsWindowPrivate));
	return gnome_pie_pie_options_window_type_id;
}

GType
gnome_pie_pie_options_window_get_type (void)
{
	static volatile gsize gnome_pie_pie_options_window_type_id__once = 0;
	if (g_once_init_enter (&gnome_pie_pie_options_window_type_id__once)) {
		GType gnome_pie_pie_options_window_type_id;
		gnome_pie_pie_options_window_type_id = gnome_pie_pie_options_window_get_type_once ();
		g_once_init_leave (&gnome_pie_pie_options_window_type_id__once, gnome_pie_pie_options_window_type_id);
	}
	return gnome_pie_pie_options_window_type_id__once;
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

