/* piePreviewRenderer.c generated by valac 0.56.19, the Vala compiler
 * generated from piePreviewRenderer.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 <gtk/gtk.h>
#include <glib.h>
#include <float.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <cairo-gobject.h>
#include <glib/gi18n-lib.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_PREVIEW_RENDERER (gnome_pie_pie_preview_renderer_get_type ())
#define GNOME_PIE_PIE_PREVIEW_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_PIE_PREVIEW_RENDERER, GnomePiePiePreviewRenderer))
#define GNOME_PIE_PIE_PREVIEW_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_PIE_PREVIEW_RENDERER, GnomePiePiePreviewRendererClass))
#define GNOME_PIE_IS_PIE_PREVIEW_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_PIE_PREVIEW_RENDERER))
#define GNOME_PIE_IS_PIE_PREVIEW_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_PIE_PREVIEW_RENDERER))
#define GNOME_PIE_PIE_PREVIEW_RENDERER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_PIE_PREVIEW_RENDERER, GnomePiePiePreviewRendererClass))

typedef struct _GnomePiePiePreviewRenderer GnomePiePiePreviewRenderer;
typedef struct _GnomePiePiePreviewRendererClass GnomePiePiePreviewRendererClass;
typedef struct _GnomePiePiePreviewRendererPrivate GnomePiePiePreviewRendererPrivate;

#define GNOME_PIE_TYPE_PIE_PREVIEW_SLICE_RENDERER (gnome_pie_pie_preview_slice_renderer_get_type ())
#define GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_PIE_PREVIEW_SLICE_RENDERER, GnomePiePiePreviewSliceRenderer))
#define GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_PIE_PREVIEW_SLICE_RENDERER, GnomePiePiePreviewSliceRendererClass))
#define GNOME_PIE_IS_PIE_PREVIEW_SLICE_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_PIE_PREVIEW_SLICE_RENDERER))
#define GNOME_PIE_IS_PIE_PREVIEW_SLICE_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_PIE_PREVIEW_SLICE_RENDERER))
#define GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_PIE_PREVIEW_SLICE_RENDERER, GnomePiePiePreviewSliceRendererClass))

typedef struct _GnomePiePiePreviewSliceRenderer GnomePiePiePreviewSliceRenderer;
typedef struct _GnomePiePiePreviewSliceRendererClass GnomePiePiePreviewSliceRendererClass;

#define GNOME_PIE_TYPE_PIE_PREVIEW_ADD_SIGN (gnome_pie_pie_preview_add_sign_get_type ())
#define GNOME_PIE_PIE_PREVIEW_ADD_SIGN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_PIE_PREVIEW_ADD_SIGN, GnomePiePiePreviewAddSign))
#define GNOME_PIE_PIE_PREVIEW_ADD_SIGN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_PIE_PREVIEW_ADD_SIGN, GnomePiePiePreviewAddSignClass))
#define GNOME_PIE_IS_PIE_PREVIEW_ADD_SIGN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_PIE_PREVIEW_ADD_SIGN))
#define GNOME_PIE_IS_PIE_PREVIEW_ADD_SIGN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_PIE_PREVIEW_ADD_SIGN))
#define GNOME_PIE_PIE_PREVIEW_ADD_SIGN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_PIE_PREVIEW_ADD_SIGN, GnomePiePiePreviewAddSignClass))

typedef struct _GnomePiePiePreviewAddSign GnomePiePiePreviewAddSign;
typedef struct _GnomePiePiePreviewAddSignClass GnomePiePiePreviewAddSignClass;

#define GNOME_PIE_TYPE_PIE_PREVIEW_CENTER (gnome_pie_pie_preview_center_get_type ())
#define GNOME_PIE_PIE_PREVIEW_CENTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_PIE_PREVIEW_CENTER, GnomePiePiePreviewCenter))
#define GNOME_PIE_PIE_PREVIEW_CENTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_PIE_PREVIEW_CENTER, GnomePiePiePreviewCenterClass))
#define GNOME_PIE_IS_PIE_PREVIEW_CENTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_PIE_PREVIEW_CENTER))
#define GNOME_PIE_IS_PIE_PREVIEW_CENTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_PIE_PREVIEW_CENTER))
#define GNOME_PIE_PIE_PREVIEW_CENTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_PIE_PREVIEW_CENTER, GnomePiePiePreviewCenterClass))

typedef struct _GnomePiePiePreviewCenter GnomePiePiePreviewCenter;
typedef struct _GnomePiePiePreviewCenterClass GnomePiePiePreviewCenterClass;
enum  {
	GNOME_PIE_PIE_PREVIEW_RENDERER_0_PROPERTY,
	GNOME_PIE_PIE_PREVIEW_RENDERER_DRAG_N_DROP_MODE_PROPERTY,
	GNOME_PIE_PIE_PREVIEW_RENDERER_HIDDEN_GROUP_PROPERTY,
	GNOME_PIE_PIE_PREVIEW_RENDERER_NUM_PROPERTIES
};
static GParamSpec* gnome_pie_pie_preview_renderer_properties[GNOME_PIE_PIE_PREVIEW_RENDERER_NUM_PROPERTIES];
typedef enum  {
	GNOME_PIE_PIE_PREVIEW_RENDERER_CENTER_DISPLAY_NONE,
	GNOME_PIE_PIE_PREVIEW_RENDERER_CENTER_DISPLAY_ACTIVE_SLICE,
	GNOME_PIE_PIE_PREVIEW_RENDERER_CENTER_DISPLAY_DROP,
	GNOME_PIE_PIE_PREVIEW_RENDERER_CENTER_DISPLAY_ADD,
	GNOME_PIE_PIE_PREVIEW_RENDERER_CENTER_DISPLAY_DELETE
} GnomePiePiePreviewRendererCenterDisplay;

#define GNOME_PIE_PIE_PREVIEW_RENDERER_TYPE_CENTER_DISPLAY (gnome_pie_pie_preview_renderer_center_display_get_type ())
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (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;

#define GNOME_PIE_TYPE_ACTION_GROUP (gnome_pie_action_group_get_type ())
#define GNOME_PIE_ACTION_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_ACTION_GROUP, GnomePieActionGroup))
#define GNOME_PIE_ACTION_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_ACTION_GROUP, GnomePieActionGroupClass))
#define GNOME_PIE_IS_ACTION_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_ACTION_GROUP))
#define GNOME_PIE_IS_ACTION_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_ACTION_GROUP))
#define GNOME_PIE_ACTION_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_ACTION_GROUP, GnomePieActionGroupClass))

typedef struct _GnomePieActionGroup GnomePieActionGroup;
typedef struct _GnomePieActionGroupClass GnomePieActionGroupClass;

#define GNOME_PIE_TYPE_IMAGE (gnome_pie_image_get_type ())
#define GNOME_PIE_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_IMAGE, GnomePieImage))
#define GNOME_PIE_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_IMAGE, GnomePieImageClass))
#define GNOME_PIE_IS_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_IMAGE))
#define GNOME_PIE_IS_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_IMAGE))
#define GNOME_PIE_IMAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_IMAGE, GnomePieImageClass))

typedef struct _GnomePieImage GnomePieImage;
typedef struct _GnomePieImageClass GnomePieImageClass;

#define GNOME_PIE_TYPE_ICON (gnome_pie_icon_get_type ())
#define GNOME_PIE_ICON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_ICON, GnomePieIcon))
#define GNOME_PIE_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_ICON, GnomePieIconClass))
#define GNOME_PIE_IS_ICON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_ICON))
#define GNOME_PIE_IS_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_ICON))
#define GNOME_PIE_ICON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_ICON, GnomePieIconClass))

typedef struct _GnomePieIcon GnomePieIcon;
typedef struct _GnomePieIconClass GnomePieIconClass;
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	GNOME_PIE_PIE_PREVIEW_RENDERER_ON_ADD_SLICE_SIGNAL,
	GNOME_PIE_PIE_PREVIEW_RENDERER_ON_REMOVE_SLICE_SIGNAL,
	GNOME_PIE_PIE_PREVIEW_RENDERER_ON_EDIT_SLICE_SIGNAL,
	GNOME_PIE_PIE_PREVIEW_RENDERER_NUM_SIGNALS
};
static guint gnome_pie_pie_preview_renderer_signals[GNOME_PIE_PIE_PREVIEW_RENDERER_NUM_SIGNALS] = {0};

struct _GnomePiePiePreviewRenderer {
	GObject parent_instance;
	GnomePiePiePreviewRendererPrivate * priv;
	GeeArrayList* slices;
	GtkDrawingArea* parent;
};

struct _GnomePiePiePreviewRendererClass {
	GObjectClass parent_class;
};

struct _GnomePiePiePreviewRendererPrivate {
	gboolean _drag_n_drop_mode;
	GnomePiePiePreviewSliceRenderer* _hidden_group;
	GnomePiePiePreviewAddSign* add_sign;
	GnomePiePiePreviewCenter* center_renderer;
	gint active_slice;
	gdouble angle;
	gdouble mouse_x;
	gdouble mouse_y;
};

static gint GnomePiePiePreviewRenderer_private_offset;
static gpointer gnome_pie_pie_preview_renderer_parent_class = NULL;

VALA_EXTERN GType gnome_pie_pie_preview_renderer_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePiePiePreviewRenderer, g_object_unref)
VALA_EXTERN GType gnome_pie_pie_preview_slice_renderer_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePiePiePreviewSliceRenderer, g_object_unref)
VALA_EXTERN GType gnome_pie_pie_preview_add_sign_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePiePiePreviewAddSign, g_object_unref)
VALA_EXTERN GType gnome_pie_pie_preview_center_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePiePiePreviewCenter, g_object_unref)
static GType gnome_pie_pie_preview_renderer_center_display_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
VALA_EXTERN GnomePiePiePreviewRenderer* gnome_pie_pie_preview_renderer_new (GtkDrawingArea* parent);
VALA_EXTERN GnomePiePiePreviewRenderer* gnome_pie_pie_preview_renderer_construct (GType object_type,
                                                                      GtkDrawingArea* parent);
VALA_EXTERN GnomePiePiePreviewCenter* gnome_pie_pie_preview_center_new (GnomePiePiePreviewRenderer* parent);
VALA_EXTERN GnomePiePiePreviewCenter* gnome_pie_pie_preview_center_construct (GType object_type,
                                                                  GnomePiePiePreviewRenderer* parent);
VALA_EXTERN GnomePiePiePreviewAddSign* gnome_pie_pie_preview_add_sign_new (GnomePiePiePreviewRenderer* parent);
VALA_EXTERN GnomePiePiePreviewAddSign* gnome_pie_pie_preview_add_sign_construct (GType object_type,
                                                                     GnomePiePiePreviewRenderer* parent);
VALA_EXTERN void gnome_pie_pie_preview_add_sign_load (GnomePiePiePreviewAddSign* self);
static void __lambda35_ (GnomePiePiePreviewRenderer* self,
                  gint pos);
static void ___lambda35__gnome_pie_pie_preview_add_sign_on_clicked (GnomePiePiePreviewAddSign* _sender,
                                                             gint position,
                                                             gpointer self);
VALA_EXTERN GType gnome_pie_pie_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePiePie, g_object_unref)
VALA_EXTERN void gnome_pie_pie_preview_renderer_load_pie (GnomePiePiePreviewRenderer* self,
                                              GnomePiePie* pie);
VALA_EXTERN GType gnome_pie_action_group_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieActionGroup, g_object_unref)
VALA_EXTERN GeeArrayList* gnome_pie_pie_get_action_groups (GnomePiePie* self);
VALA_EXTERN GnomePiePiePreviewSliceRenderer* gnome_pie_pie_preview_slice_renderer_new (GnomePiePiePreviewRenderer* parent);
VALA_EXTERN GnomePiePiePreviewSliceRenderer* gnome_pie_pie_preview_slice_renderer_construct (GType object_type,
                                                                                 GnomePiePiePreviewRenderer* parent);
VALA_EXTERN void gnome_pie_pie_preview_slice_renderer_load (GnomePiePiePreviewSliceRenderer* self,
                                                GnomePieActionGroup* group);
static void gnome_pie_pie_preview_renderer_add_slice_renderer (GnomePiePiePreviewRenderer* self,
                                                        GnomePiePiePreviewSliceRenderer* renderer,
                                                        gint at_position);
static void gnome_pie_pie_preview_renderer_connect_siganls (GnomePiePiePreviewRenderer* self,
                                                     GnomePiePiePreviewSliceRenderer* renderer);
static void gnome_pie_pie_preview_renderer_update_sizes (GnomePiePiePreviewRenderer* self);
static void gnome_pie_pie_preview_renderer_update_positions (GnomePiePiePreviewRenderer* self,
                                                      gboolean smoothly);
VALA_EXTERN void gnome_pie_pie_preview_renderer_set_dnd_mode (GnomePiePiePreviewRenderer* self,
                                                  gboolean dnd);
VALA_EXTERN gboolean gnome_pie_pie_preview_renderer_get_drag_n_drop_mode (GnomePiePiePreviewRenderer* self);
static void gnome_pie_pie_preview_renderer_set_drag_n_drop_mode (GnomePiePiePreviewRenderer* self,
                                                          gboolean value);
VALA_EXTERN gint gnome_pie_pie_preview_renderer_slice_count (GnomePiePiePreviewRenderer* self);
VALA_EXTERN gint gnome_pie_pie_preview_renderer_get_active_slice (GnomePiePiePreviewRenderer* self);
VALA_EXTERN GType gnome_pie_image_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieImage, g_object_unref)
VALA_EXTERN GType gnome_pie_icon_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieIcon, g_object_unref)
VALA_EXTERN GnomePieIcon* gnome_pie_pie_preview_renderer_get_active_icon (GnomePiePiePreviewRenderer* self);
VALA_EXTERN GnomePieIcon* gnome_pie_pie_preview_slice_renderer_get_icon (GnomePiePiePreviewSliceRenderer* self);
VALA_EXTERN GnomePieIcon* gnome_pie_icon_new (const gchar* icon_name,
                                  gint size);
VALA_EXTERN GnomePieIcon* gnome_pie_icon_construct (GType object_type,
                                        const gchar* icon_name,
                                        gint size);
VALA_EXTERN void gnome_pie_pie_preview_renderer_draw (GnomePiePiePreviewRenderer* self,
                                          gdouble frame_time,
                                          cairo_t* ctx);
VALA_EXTERN void gnome_pie_pie_preview_add_sign_draw (GnomePiePiePreviewAddSign* self,
                                          gdouble frame_time,
                                          cairo_t* ctx);
VALA_EXTERN void gnome_pie_pie_preview_center_draw (GnomePiePiePreviewCenter* self,
                                        gdouble frame_time,
                                        cairo_t* ctx);
VALA_EXTERN void gnome_pie_pie_preview_slice_renderer_draw (GnomePiePiePreviewSliceRenderer* self,
                                                gdouble frame_time,
                                                cairo_t* ctx);
VALA_EXTERN void gnome_pie_pie_preview_renderer_on_mouse_leave (GnomePiePiePreviewRenderer* self);
VALA_EXTERN void gnome_pie_pie_preview_add_sign_hide (GnomePiePiePreviewAddSign* self);
static void gnome_pie_pie_preview_renderer_update_center (GnomePiePiePreviewRenderer* self,
                                                   GnomePiePiePreviewRendererCenterDisplay display);
VALA_EXTERN void gnome_pie_pie_preview_slice_renderer_on_mouse_leave (GnomePiePiePreviewSliceRenderer* self);
VALA_EXTERN void gnome_pie_pie_preview_renderer_on_mouse_enter (GnomePiePiePreviewRenderer* self);
VALA_EXTERN void gnome_pie_pie_preview_add_sign_show (GnomePiePiePreviewAddSign* self);
VALA_EXTERN void gnome_pie_pie_preview_renderer_on_mouse_move (GnomePiePiePreviewRenderer* self,
                                                   gdouble x,
                                                   gdouble y);
VALA_EXTERN gboolean gnome_pie_pie_preview_slice_renderer_on_mouse_move (GnomePiePiePreviewSliceRenderer* self,
                                                             gdouble angle,
                                                             gdouble x,
                                                             gdouble y);
VALA_EXTERN gboolean gnome_pie_pie_preview_slice_renderer_get_delete_hovered (GnomePiePiePreviewSliceRenderer* self);
VALA_EXTERN void gnome_pie_pie_preview_add_sign_on_mouse_move (GnomePiePiePreviewAddSign* self,
                                                   gdouble angle);
VALA_EXTERN void gnome_pie_pie_preview_renderer_on_button_press (GnomePiePiePreviewRenderer* self);
VALA_EXTERN void gnome_pie_pie_preview_slice_renderer_on_button_press (GnomePiePiePreviewSliceRenderer* self,
                                                           gdouble x,
                                                           gdouble y);
VALA_EXTERN void gnome_pie_pie_preview_add_sign_on_button_press (GnomePiePiePreviewAddSign* self,
                                                     gdouble x,
                                                     gdouble y);
VALA_EXTERN void gnome_pie_pie_preview_renderer_on_button_release (GnomePiePiePreviewRenderer* self);
VALA_EXTERN void gnome_pie_pie_preview_slice_renderer_on_button_release (GnomePiePiePreviewSliceRenderer* self,
                                                             gdouble x,
                                                             gdouble y);
VALA_EXTERN void gnome_pie_pie_preview_add_sign_on_button_release (GnomePiePiePreviewAddSign* self,
                                                       gdouble x,
                                                       gdouble y);
VALA_EXTERN void gnome_pie_pie_preview_renderer_add_group (GnomePiePiePreviewRenderer* self,
                                               GnomePieActionGroup* group,
                                               gint at_position);
VALA_EXTERN void gnome_pie_pie_preview_renderer_remove_group (GnomePiePiePreviewRenderer* self,
                                                  gint index);
VALA_EXTERN void gnome_pie_pie_preview_renderer_hide_group (GnomePiePiePreviewRenderer* self,
                                                gint index);
static void gnome_pie_pie_preview_renderer_set_hidden_group (GnomePiePiePreviewRenderer* self,
                                                      GnomePiePiePreviewSliceRenderer* value);
VALA_EXTERN void gnome_pie_pie_preview_renderer_show_hidden_group_at (GnomePiePiePreviewRenderer* self,
                                                          gint index);
VALA_EXTERN GnomePiePiePreviewSliceRenderer* gnome_pie_pie_preview_renderer_get_hidden_group (GnomePiePiePreviewRenderer* self);
VALA_EXTERN void gnome_pie_pie_preview_slice_renderer_set_position (GnomePiePiePreviewSliceRenderer* self,
                                                        gint position,
                                                        gboolean smoothly);
VALA_EXTERN void gnome_pie_pie_preview_renderer_update_group (GnomePiePiePreviewRenderer* self,
                                                  GnomePieActionGroup* group,
                                                  gint index);
VALA_EXTERN void gnome_pie_pie_preview_renderer_disable_quickactions (GnomePiePiePreviewRenderer* self);
VALA_EXTERN void gnome_pie_pie_preview_slice_renderer_disable_quickactions (GnomePiePiePreviewSliceRenderer* self);
static void __lambda36_ (GnomePiePiePreviewRenderer* self,
                  gint pos);
static void ___lambda36__gnome_pie_pie_preview_slice_renderer_on_clicked (GnomePiePiePreviewSliceRenderer* _sender,
                                                                   gint position,
                                                                   gpointer self);
static void __lambda37_ (GnomePiePiePreviewRenderer* self,
                  gint pos);
static void ___lambda37__gnome_pie_pie_preview_slice_renderer_on_remove (GnomePiePiePreviewSliceRenderer* _sender,
                                                                  gint position,
                                                                  gpointer self);
VALA_EXTERN gboolean gnome_pie_pie_preview_add_sign_get_visible (GnomePiePiePreviewAddSign* self);
VALA_EXTERN void gnome_pie_pie_preview_add_sign_set_position (GnomePiePiePreviewAddSign* self,
                                                  gint position);
VALA_EXTERN void gnome_pie_pie_preview_add_sign_set_size (GnomePiePiePreviewAddSign* self,
                                              gdouble size);
VALA_EXTERN void gnome_pie_pie_preview_slice_renderer_set_size (GnomePiePiePreviewSliceRenderer* self,
                                                    gdouble size);
VALA_EXTERN void gnome_pie_pie_preview_center_set_text (GnomePiePiePreviewCenter* self,
                                            const gchar* text);
VALA_EXTERN const gchar* gnome_pie_pie_preview_slice_renderer_get_name (GnomePiePiePreviewSliceRenderer* self);
static void gnome_pie_pie_preview_renderer_finalize (GObject * obj);
static GType gnome_pie_pie_preview_renderer_get_type_once (void);
static void _vala_gnome_pie_pie_preview_renderer_get_property (GObject * object,
                                                        guint property_id,
                                                        GValue * value,
                                                        GParamSpec * pspec);
static void _vala_gnome_pie_pie_preview_renderer_set_property (GObject * object,
                                                        guint property_id,
                                                        const GValue * value,
                                                        GParamSpec * pspec);

static inline gpointer
gnome_pie_pie_preview_renderer_get_instance_private (GnomePiePiePreviewRenderer* self)
{
	return G_STRUCT_MEMBER_P (self, GnomePiePiePreviewRenderer_private_offset);
}

static GType
gnome_pie_pie_preview_renderer_center_display_get_type_once (void)
{
	static const GEnumValue values[] = {{GNOME_PIE_PIE_PREVIEW_RENDERER_CENTER_DISPLAY_NONE, "GNOME_PIE_PIE_PREVIEW_RENDERER_CENTER_DISPLAY_NONE", "none"}, {GNOME_PIE_PIE_PREVIEW_RENDERER_CENTER_DISPLAY_ACTIVE_SLICE, "GNOME_PIE_PIE_PREVIEW_RENDERER_CENTER_DISPLAY_ACTIVE_SLICE", "active-slice"}, {GNOME_PIE_PIE_PREVIEW_RENDERER_CENTER_DISPLAY_DROP, "GNOME_PIE_PIE_PREVIEW_RENDERER_CENTER_DISPLAY_DROP", "drop"}, {GNOME_PIE_PIE_PREVIEW_RENDERER_CENTER_DISPLAY_ADD, "GNOME_PIE_PIE_PREVIEW_RENDERER_CENTER_DISPLAY_ADD", "add"}, {GNOME_PIE_PIE_PREVIEW_RENDERER_CENTER_DISPLAY_DELETE, "GNOME_PIE_PIE_PREVIEW_RENDERER_CENTER_DISPLAY_DELETE", "delete"}, {0, NULL, NULL}};
	GType gnome_pie_pie_preview_renderer_center_display_type_id;
	gnome_pie_pie_preview_renderer_center_display_type_id = g_enum_register_static ("GnomePiePiePreviewRendererCenterDisplay", values);
	return gnome_pie_pie_preview_renderer_center_display_type_id;
}

static GType
gnome_pie_pie_preview_renderer_center_display_get_type (void)
{
	static volatile gsize gnome_pie_pie_preview_renderer_center_display_type_id__once = 0;
	if (g_once_init_enter (&gnome_pie_pie_preview_renderer_center_display_type_id__once)) {
		GType gnome_pie_pie_preview_renderer_center_display_type_id;
		gnome_pie_pie_preview_renderer_center_display_type_id = gnome_pie_pie_preview_renderer_center_display_get_type_once ();
		g_once_init_leave (&gnome_pie_pie_preview_renderer_center_display_type_id__once, gnome_pie_pie_preview_renderer_center_display_type_id);
	}
	return gnome_pie_pie_preview_renderer_center_display_type_id__once;
}

static void
__lambda35_ (GnomePiePiePreviewRenderer* self,
             gint pos)
{
	g_signal_emit (self, gnome_pie_pie_preview_renderer_signals[GNOME_PIE_PIE_PREVIEW_RENDERER_ON_ADD_SLICE_SIGNAL], 0, pos);
}

static void
___lambda35__gnome_pie_pie_preview_add_sign_on_clicked (GnomePiePiePreviewAddSign* _sender,
                                                        gint position,
                                                        gpointer self)
{
	__lambda35_ ((GnomePiePiePreviewRenderer*) self, position);
}

GnomePiePiePreviewRenderer*
gnome_pie_pie_preview_renderer_construct (GType object_type,
                                          GtkDrawingArea* parent)
{
	GnomePiePiePreviewRenderer * self = NULL;
	GeeArrayList* _tmp0_;
	GnomePiePiePreviewCenter* _tmp1_;
	GnomePiePiePreviewAddSign* _tmp2_;
	GnomePiePiePreviewAddSign* _tmp3_;
	GnomePiePiePreviewAddSign* _tmp4_;
	g_return_val_if_fail (parent != NULL, NULL);
	self = (GnomePiePiePreviewRenderer*) g_object_new (object_type, NULL);
	self->parent = parent;
	_tmp0_ = gee_array_list_new (GNOME_PIE_TYPE_PIE_PREVIEW_SLICE_RENDERER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	_g_object_unref0 (self->slices);
	self->slices = _tmp0_;
	_tmp1_ = gnome_pie_pie_preview_center_new (self);
	_g_object_unref0 (self->priv->center_renderer);
	self->priv->center_renderer = _tmp1_;
	_tmp2_ = gnome_pie_pie_preview_add_sign_new (self);
	_g_object_unref0 (self->priv->add_sign);
	self->priv->add_sign = _tmp2_;
	_tmp3_ = self->priv->add_sign;
	gnome_pie_pie_preview_add_sign_load (_tmp3_);
	_tmp4_ = self->priv->add_sign;
	g_signal_connect_object (_tmp4_, "on-clicked", (GCallback) ___lambda35__gnome_pie_pie_preview_add_sign_on_clicked, self, 0);
	return self;
}

GnomePiePiePreviewRenderer*
gnome_pie_pie_preview_renderer_new (GtkDrawingArea* parent)
{
	return gnome_pie_pie_preview_renderer_construct (GNOME_PIE_TYPE_PIE_PREVIEW_RENDERER, parent);
}

void
gnome_pie_pie_preview_renderer_load_pie (GnomePiePiePreviewRenderer* self,
                                         GnomePiePie* pie)
{
	GeeArrayList* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (pie != NULL);
	_tmp0_ = self->slices;
	gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp0_);
	{
		GeeArrayList* _group_list = NULL;
		GeeArrayList* _tmp1_;
		GeeArrayList* _tmp2_;
		gint _group_size = 0;
		GeeArrayList* _tmp3_;
		gint _tmp4_;
		gint _tmp5_;
		gint _group_index = 0;
		_tmp1_ = gnome_pie_pie_get_action_groups (pie);
		_tmp2_ = _tmp1_;
		_group_list = _tmp2_;
		_tmp3_ = _group_list;
		_tmp4_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp3_);
		_tmp5_ = _tmp4_;
		_group_size = _tmp5_;
		_group_index = -1;
		while (TRUE) {
			gint _tmp6_;
			gint _tmp7_;
			GnomePieActionGroup* group = NULL;
			GeeArrayList* _tmp8_;
			gpointer _tmp9_;
			GnomePiePiePreviewSliceRenderer* renderer = NULL;
			GnomePiePiePreviewSliceRenderer* _tmp10_;
			GnomePiePiePreviewSliceRenderer* _tmp11_;
			GnomePieActionGroup* _tmp12_;
			GnomePiePiePreviewSliceRenderer* _tmp13_;
			GnomePiePiePreviewSliceRenderer* _tmp14_;
			_group_index = _group_index + 1;
			_tmp6_ = _group_index;
			_tmp7_ = _group_size;
			if (!(_tmp6_ < _tmp7_)) {
				break;
			}
			_tmp8_ = _group_list;
			_tmp9_ = gee_abstract_list_get ((GeeAbstractList*) _tmp8_, _group_index);
			group = (GnomePieActionGroup*) _tmp9_;
			_tmp10_ = gnome_pie_pie_preview_slice_renderer_new (self);
			renderer = _tmp10_;
			_tmp11_ = renderer;
			_tmp12_ = group;
			gnome_pie_pie_preview_slice_renderer_load (_tmp11_, _tmp12_);
			_tmp13_ = renderer;
			gnome_pie_pie_preview_renderer_add_slice_renderer (self, _tmp13_, -1);
			_tmp14_ = renderer;
			gnome_pie_pie_preview_renderer_connect_siganls (self, _tmp14_);
			_g_object_unref0 (renderer);
			_g_object_unref0 (group);
		}
	}
	self->priv->active_slice = -1;
	gnome_pie_pie_preview_renderer_update_sizes (self);
	gnome_pie_pie_preview_renderer_update_positions (self, FALSE);
}

void
gnome_pie_pie_preview_renderer_set_dnd_mode (GnomePiePiePreviewRenderer* self,
                                             gboolean dnd)
{
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_drag_n_drop_mode;
	if (_tmp0_ != dnd) {
		gnome_pie_pie_preview_renderer_set_drag_n_drop_mode (self, dnd);
		gnome_pie_pie_preview_renderer_update_positions (self, TRUE);
		gnome_pie_pie_preview_renderer_update_sizes (self);
	}
}

gint
gnome_pie_pie_preview_renderer_slice_count (GnomePiePiePreviewRenderer* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	GeeArrayList* _tmp8_;
	gint _tmp9_;
	gint _tmp10_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	_tmp1_ = self->priv->_drag_n_drop_mode;
	if (_tmp1_) {
		GeeArrayList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		_tmp2_ = self->slices;
		_tmp3_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_tmp0_ = !(_tmp4_ == 0);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GeeArrayList* _tmp5_;
		gint _tmp6_;
		gint _tmp7_;
		_tmp5_ = self->slices;
		_tmp6_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp5_);
		_tmp7_ = _tmp6_;
		result = _tmp7_ + 1;
		return result;
	}
	_tmp8_ = self->slices;
	_tmp9_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp8_);
	_tmp10_ = _tmp9_;
	result = _tmp10_;
	return result;
}

gint
gnome_pie_pie_preview_renderer_get_active_slice (GnomePiePiePreviewRenderer* self)
{
	GeeArrayList* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gboolean _tmp3_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	_tmp0_ = self->slices;
	_tmp1_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ == 0) {
		result = 0;
		return result;
	}
	_tmp3_ = self->priv->_drag_n_drop_mode;
	if (_tmp3_) {
		result = ((gint) (((self->priv->angle / (2 * G_PI)) * gnome_pie_pie_preview_renderer_slice_count (self)) + 0.5)) % gnome_pie_pie_preview_renderer_slice_count (self);
		return result;
	}
	result = self->priv->active_slice;
	return result;
}

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

GnomePieIcon*
gnome_pie_pie_preview_renderer_get_active_icon (GnomePiePiePreviewRenderer* self)
{
	gboolean _tmp0_ = FALSE;
	GnomePieIcon* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (self->priv->active_slice >= 0) {
		GeeArrayList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		_tmp1_ = self->slices;
		_tmp2_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp0_ = self->priv->active_slice < _tmp3_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GeeArrayList* _tmp4_;
		gpointer _tmp5_;
		GnomePiePiePreviewSliceRenderer* _tmp6_;
		GnomePieIcon* _tmp7_;
		GnomePieIcon* _tmp8_;
		GnomePieIcon* _tmp9_;
		GnomePieIcon* _tmp10_;
		_tmp4_ = self->slices;
		_tmp5_ = gee_abstract_list_get ((GeeAbstractList*) _tmp4_, self->priv->active_slice);
		_tmp6_ = (GnomePiePiePreviewSliceRenderer*) _tmp5_;
		_tmp7_ = gnome_pie_pie_preview_slice_renderer_get_icon (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = _g_object_ref0 (_tmp8_);
		_tmp10_ = _tmp9_;
		_g_object_unref0 (_tmp6_);
		result = _tmp10_;
		return result;
	} else {
		GnomePieIcon* _tmp11_;
		_tmp11_ = gnome_pie_icon_new ("", 24);
		result = _tmp11_;
		return result;
	}
}

void
gnome_pie_pie_preview_renderer_draw (GnomePiePiePreviewRenderer* self,
                                     gdouble frame_time,
                                     cairo_t* ctx)
{
	GnomePiePiePreviewAddSign* _tmp0_;
	GnomePiePiePreviewCenter* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (ctx != NULL);
	_tmp0_ = self->priv->add_sign;
	gnome_pie_pie_preview_add_sign_draw (_tmp0_, frame_time, ctx);
	_tmp1_ = self->priv->center_renderer;
	gnome_pie_pie_preview_center_draw (_tmp1_, frame_time, ctx);
	{
		GeeArrayList* _slice_list = NULL;
		GeeArrayList* _tmp2_;
		gint _slice_size = 0;
		GeeArrayList* _tmp3_;
		gint _tmp4_;
		gint _tmp5_;
		gint _slice_index = 0;
		_tmp2_ = self->slices;
		_slice_list = _tmp2_;
		_tmp3_ = _slice_list;
		_tmp4_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp3_);
		_tmp5_ = _tmp4_;
		_slice_size = _tmp5_;
		_slice_index = -1;
		while (TRUE) {
			gint _tmp6_;
			gint _tmp7_;
			GnomePiePiePreviewSliceRenderer* slice = NULL;
			GeeArrayList* _tmp8_;
			gpointer _tmp9_;
			GnomePiePiePreviewSliceRenderer* _tmp10_;
			_slice_index = _slice_index + 1;
			_tmp6_ = _slice_index;
			_tmp7_ = _slice_size;
			if (!(_tmp6_ < _tmp7_)) {
				break;
			}
			_tmp8_ = _slice_list;
			_tmp9_ = gee_abstract_list_get ((GeeAbstractList*) _tmp8_, _slice_index);
			slice = (GnomePiePiePreviewSliceRenderer*) _tmp9_;
			_tmp10_ = slice;
			gnome_pie_pie_preview_slice_renderer_draw (_tmp10_, frame_time, ctx);
			_g_object_unref0 (slice);
		}
	}
}

void
gnome_pie_pie_preview_renderer_on_mouse_leave (GnomePiePiePreviewRenderer* self)
{
	GnomePiePiePreviewAddSign* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->add_sign;
	gnome_pie_pie_preview_add_sign_hide (_tmp0_);
	gnome_pie_pie_preview_renderer_update_positions (self, TRUE);
	gnome_pie_pie_preview_renderer_update_center (self, GNOME_PIE_PIE_PREVIEW_RENDERER_CENTER_DISPLAY_NONE);
	{
		GeeArrayList* _slice_list = NULL;
		GeeArrayList* _tmp1_;
		gint _slice_size = 0;
		GeeArrayList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _slice_index = 0;
		_tmp1_ = self->slices;
		_slice_list = _tmp1_;
		_tmp2_ = _slice_list;
		_tmp3_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_slice_size = _tmp4_;
		_slice_index = -1;
		while (TRUE) {
			gint _tmp5_;
			gint _tmp6_;
			GnomePiePiePreviewSliceRenderer* slice = NULL;
			GeeArrayList* _tmp7_;
			gpointer _tmp8_;
			GnomePiePiePreviewSliceRenderer* _tmp9_;
			_slice_index = _slice_index + 1;
			_tmp5_ = _slice_index;
			_tmp6_ = _slice_size;
			if (!(_tmp5_ < _tmp6_)) {
				break;
			}
			_tmp7_ = _slice_list;
			_tmp8_ = gee_abstract_list_get ((GeeAbstractList*) _tmp7_, _slice_index);
			slice = (GnomePiePiePreviewSliceRenderer*) _tmp8_;
			_tmp9_ = slice;
			gnome_pie_pie_preview_slice_renderer_on_mouse_leave (_tmp9_);
			_g_object_unref0 (slice);
		}
	}
}

void
gnome_pie_pie_preview_renderer_on_mouse_enter (GnomePiePiePreviewRenderer* self)
{
	GnomePiePiePreviewAddSign* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->add_sign;
	gnome_pie_pie_preview_add_sign_show (_tmp0_);
	gnome_pie_pie_preview_renderer_update_positions (self, TRUE);
}

void
gnome_pie_pie_preview_renderer_on_mouse_move (GnomePiePiePreviewRenderer* self,
                                              gdouble x,
                                              gdouble y)
{
	gboolean _tmp0_;
	gboolean delete_hovered = FALSE;
	gboolean _tmp17_;
	GnomePiePiePreviewAddSign* _tmp18_;
	g_return_if_fail (self != NULL);
	self->priv->mouse_x = x;
	self->priv->mouse_y = y;
	self->priv->angle = acos (x / sqrt ((x * x) + (y * y)));
	if (y < ((gdouble) 0)) {
		self->priv->angle = (2 * G_PI) - self->priv->angle;
	}
	_tmp0_ = self->priv->_drag_n_drop_mode;
	if (!_tmp0_) {
		self->priv->active_slice = -1;
	}
	delete_hovered = FALSE;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp1_ = FALSE;
			_tmp1_ = TRUE;
			while (TRUE) {
				GeeArrayList* _tmp3_;
				gint _tmp4_;
				gint _tmp5_;
				gboolean _tmp6_ = FALSE;
				GeeArrayList* _tmp7_;
				gpointer _tmp8_;
				GnomePiePiePreviewSliceRenderer* _tmp9_;
				gboolean _tmp10_;
				if (!_tmp1_) {
					gint _tmp2_;
					i = i + 1;
					_tmp2_ = i;
				}
				_tmp1_ = FALSE;
				_tmp3_ = self->slices;
				_tmp4_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp3_);
				_tmp5_ = _tmp4_;
				if (!(i < _tmp5_)) {
					break;
				}
				_tmp7_ = self->slices;
				_tmp8_ = gee_abstract_list_get ((GeeAbstractList*) _tmp7_, i);
				_tmp9_ = (GnomePiePiePreviewSliceRenderer*) _tmp8_;
				_tmp10_ = gnome_pie_pie_preview_slice_renderer_on_mouse_move (_tmp9_, self->priv->angle, x, y);
				_g_object_unref0 (_tmp9_);
				if (_tmp10_) {
					gboolean _tmp11_;
					_tmp11_ = self->priv->_drag_n_drop_mode;
					_tmp6_ = !_tmp11_;
				} else {
					_tmp6_ = FALSE;
				}
				if (_tmp6_) {
					GeeArrayList* _tmp12_;
					gpointer _tmp13_;
					GnomePiePiePreviewSliceRenderer* _tmp14_;
					gboolean _tmp15_;
					gboolean _tmp16_;
					self->priv->active_slice = i;
					_tmp12_ = self->slices;
					_tmp13_ = gee_abstract_list_get ((GeeAbstractList*) _tmp12_, i);
					_tmp14_ = (GnomePiePiePreviewSliceRenderer*) _tmp13_;
					_tmp15_ = gnome_pie_pie_preview_slice_renderer_get_delete_hovered (_tmp14_);
					_tmp16_ = _tmp15_;
					delete_hovered = _tmp16_;
					_g_object_unref0 (_tmp14_);
				}
			}
		}
	}
	_tmp17_ = self->priv->_drag_n_drop_mode;
	if (_tmp17_) {
		gnome_pie_pie_preview_renderer_update_center (self, GNOME_PIE_PIE_PREVIEW_RENDERER_CENTER_DISPLAY_DROP);
	} else {
		if (self->priv->active_slice < 0) {
			gnome_pie_pie_preview_renderer_update_center (self, GNOME_PIE_PIE_PREVIEW_RENDERER_CENTER_DISPLAY_ADD);
		} else {
			if (delete_hovered) {
				gnome_pie_pie_preview_renderer_update_center (self, GNOME_PIE_PIE_PREVIEW_RENDERER_CENTER_DISPLAY_DELETE);
			} else {
				gnome_pie_pie_preview_renderer_update_center (self, GNOME_PIE_PIE_PREVIEW_RENDERER_CENTER_DISPLAY_ACTIVE_SLICE);
			}
		}
	}
	_tmp18_ = self->priv->add_sign;
	gnome_pie_pie_preview_add_sign_on_mouse_move (_tmp18_, self->priv->angle);
	gnome_pie_pie_preview_renderer_update_positions (self, TRUE);
}

void
gnome_pie_pie_preview_renderer_on_button_press (GnomePiePiePreviewRenderer* self)
{
	GnomePiePiePreviewAddSign* _tmp8_;
	g_return_if_fail (self != NULL);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				GeeArrayList* _tmp2_;
				gint _tmp3_;
				gint _tmp4_;
				GeeArrayList* _tmp5_;
				gpointer _tmp6_;
				GnomePiePiePreviewSliceRenderer* _tmp7_;
				if (!_tmp0_) {
					gint _tmp1_;
					i = i + 1;
					_tmp1_ = i;
				}
				_tmp0_ = FALSE;
				_tmp2_ = self->slices;
				_tmp3_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp2_);
				_tmp4_ = _tmp3_;
				if (!(i < _tmp4_)) {
					break;
				}
				_tmp5_ = self->slices;
				_tmp6_ = gee_abstract_list_get ((GeeAbstractList*) _tmp5_, i);
				_tmp7_ = (GnomePiePiePreviewSliceRenderer*) _tmp6_;
				gnome_pie_pie_preview_slice_renderer_on_button_press (_tmp7_, self->priv->mouse_x, self->priv->mouse_y);
				_g_object_unref0 (_tmp7_);
			}
		}
	}
	_tmp8_ = self->priv->add_sign;
	gnome_pie_pie_preview_add_sign_on_button_press (_tmp8_, self->priv->mouse_x, self->priv->mouse_y);
}

void
gnome_pie_pie_preview_renderer_on_button_release (GnomePiePiePreviewRenderer* self)
{
	GnomePiePiePreviewAddSign* _tmp8_;
	g_return_if_fail (self != NULL);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				GeeArrayList* _tmp2_;
				gint _tmp3_;
				gint _tmp4_;
				GeeArrayList* _tmp5_;
				gpointer _tmp6_;
				GnomePiePiePreviewSliceRenderer* _tmp7_;
				if (!_tmp0_) {
					gint _tmp1_;
					i = i + 1;
					_tmp1_ = i;
				}
				_tmp0_ = FALSE;
				_tmp2_ = self->slices;
				_tmp3_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp2_);
				_tmp4_ = _tmp3_;
				if (!(i < _tmp4_)) {
					break;
				}
				_tmp5_ = self->slices;
				_tmp6_ = gee_abstract_list_get ((GeeAbstractList*) _tmp5_, i);
				_tmp7_ = (GnomePiePiePreviewSliceRenderer*) _tmp6_;
				gnome_pie_pie_preview_slice_renderer_on_button_release (_tmp7_, self->priv->mouse_x, self->priv->mouse_y);
				_g_object_unref0 (_tmp7_);
			}
		}
	}
	_tmp8_ = self->priv->add_sign;
	gnome_pie_pie_preview_add_sign_on_button_release (_tmp8_, self->priv->mouse_x, self->priv->mouse_y);
}

void
gnome_pie_pie_preview_renderer_add_group (GnomePiePiePreviewRenderer* self,
                                          GnomePieActionGroup* group,
                                          gint at_position)
{
	GnomePiePiePreviewSliceRenderer* renderer = NULL;
	GnomePiePiePreviewSliceRenderer* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (group != NULL);
	_tmp0_ = gnome_pie_pie_preview_slice_renderer_new (self);
	renderer = _tmp0_;
	gnome_pie_pie_preview_slice_renderer_load (renderer, group);
	gnome_pie_pie_preview_renderer_add_slice_renderer (self, renderer, at_position);
	gnome_pie_pie_preview_renderer_connect_siganls (self, renderer);
	_g_object_unref0 (renderer);
}

void
gnome_pie_pie_preview_renderer_remove_group (GnomePiePiePreviewRenderer* self,
                                             gint index)
{
	GeeArrayList* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->slices;
	_tmp1_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ > index) {
		GeeArrayList* _tmp3_;
		gpointer _tmp4_;
		GnomePiePiePreviewSliceRenderer* _tmp5_;
		_tmp3_ = self->slices;
		_tmp4_ = gee_abstract_list_remove_at ((GeeAbstractList*) _tmp3_, index);
		_tmp5_ = (GnomePiePiePreviewSliceRenderer*) _tmp4_;
		_g_object_unref0 (_tmp5_);
		gnome_pie_pie_preview_renderer_update_positions (self, TRUE);
		gnome_pie_pie_preview_renderer_update_sizes (self);
	}
}

void
gnome_pie_pie_preview_renderer_hide_group (GnomePiePiePreviewRenderer* self,
                                           gint index)
{
	GeeArrayList* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->slices;
	_tmp1_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ > index) {
		GeeArrayList* _tmp3_;
		gpointer _tmp4_;
		GnomePiePiePreviewSliceRenderer* _tmp5_;
		_tmp3_ = self->slices;
		_tmp4_ = gee_abstract_list_get ((GeeAbstractList*) _tmp3_, index);
		_tmp5_ = (GnomePiePiePreviewSliceRenderer*) _tmp4_;
		gnome_pie_pie_preview_renderer_set_hidden_group (self, _tmp5_);
		_g_object_unref0 (_tmp5_);
		gnome_pie_pie_preview_renderer_remove_group (self, index);
	}
}

void
gnome_pie_pie_preview_renderer_show_hidden_group_at (GnomePiePiePreviewRenderer* self,
                                                     gint index)
{
	gboolean _tmp0_ = FALSE;
	GeeArrayList* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->slices;
	_tmp2_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_ >= index) {
		GnomePiePiePreviewSliceRenderer* _tmp4_;
		_tmp4_ = self->priv->_hidden_group;
		_tmp0_ = _tmp4_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GnomePiePiePreviewSliceRenderer* _tmp5_;
		GnomePiePiePreviewSliceRenderer* _tmp6_;
		_tmp5_ = self->priv->_hidden_group;
		gnome_pie_pie_preview_slice_renderer_set_position (_tmp5_, index, FALSE);
		_tmp6_ = self->priv->_hidden_group;
		gnome_pie_pie_preview_renderer_add_slice_renderer (self, _tmp6_, index);
		gnome_pie_pie_preview_renderer_set_hidden_group (self, NULL);
	}
}

void
gnome_pie_pie_preview_renderer_update_group (GnomePiePiePreviewRenderer* self,
                                             GnomePieActionGroup* group,
                                             gint index)
{
	GeeArrayList* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (group != NULL);
	_tmp0_ = self->slices;
	_tmp1_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ > index) {
		GnomePiePiePreviewSliceRenderer* renderer = NULL;
		GnomePiePiePreviewSliceRenderer* _tmp3_;
		GeeArrayList* _tmp4_;
		GnomePiePiePreviewSliceRenderer* _tmp5_;
		GnomePiePiePreviewSliceRenderer* _tmp6_;
		GnomePiePiePreviewSliceRenderer* _tmp7_;
		_tmp3_ = gnome_pie_pie_preview_slice_renderer_new (self);
		renderer = _tmp3_;
		_tmp4_ = self->slices;
		_tmp5_ = renderer;
		gee_abstract_list_set ((GeeAbstractList*) _tmp4_, index, _tmp5_);
		_tmp6_ = renderer;
		gnome_pie_pie_preview_slice_renderer_load (_tmp6_, group);
		_tmp7_ = renderer;
		gnome_pie_pie_preview_renderer_connect_siganls (self, _tmp7_);
		gnome_pie_pie_preview_renderer_update_positions (self, FALSE);
		gnome_pie_pie_preview_renderer_update_sizes (self);
		_g_object_unref0 (renderer);
	}
}

void
gnome_pie_pie_preview_renderer_disable_quickactions (GnomePiePiePreviewRenderer* self)
{
	g_return_if_fail (self != NULL);
	{
		GeeArrayList* _slice_list = NULL;
		GeeArrayList* _tmp0_;
		gint _slice_size = 0;
		GeeArrayList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		gint _slice_index = 0;
		_tmp0_ = self->slices;
		_slice_list = _tmp0_;
		_tmp1_ = _slice_list;
		_tmp2_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp1_);
		_tmp3_ = _tmp2_;
		_slice_size = _tmp3_;
		_slice_index = -1;
		while (TRUE) {
			gint _tmp4_;
			gint _tmp5_;
			GnomePiePiePreviewSliceRenderer* slice = NULL;
			GeeArrayList* _tmp6_;
			gpointer _tmp7_;
			GnomePiePiePreviewSliceRenderer* _tmp8_;
			_slice_index = _slice_index + 1;
			_tmp4_ = _slice_index;
			_tmp5_ = _slice_size;
			if (!(_tmp4_ < _tmp5_)) {
				break;
			}
			_tmp6_ = _slice_list;
			_tmp7_ = gee_abstract_list_get ((GeeAbstractList*) _tmp6_, _slice_index);
			slice = (GnomePiePiePreviewSliceRenderer*) _tmp7_;
			_tmp8_ = slice;
			gnome_pie_pie_preview_slice_renderer_disable_quickactions (_tmp8_);
			_g_object_unref0 (slice);
		}
	}
}

static void
gnome_pie_pie_preview_renderer_add_slice_renderer (GnomePiePiePreviewRenderer* self,
                                                   GnomePiePiePreviewSliceRenderer* renderer,
                                                   gint at_position)
{
	gboolean _tmp0_ = FALSE;
	g_return_if_fail (self != NULL);
	g_return_if_fail (renderer != NULL);
	if (at_position < 0) {
		_tmp0_ = TRUE;
	} else {
		GeeArrayList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		_tmp1_ = self->slices;
		_tmp2_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp0_ = at_position >= _tmp3_;
	}
	if (_tmp0_) {
		GeeArrayList* _tmp4_;
		_tmp4_ = self->slices;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp4_, renderer);
	} else {
		GeeArrayList* _tmp5_;
		_tmp5_ = self->slices;
		gee_abstract_list_insert ((GeeAbstractList*) _tmp5_, at_position, renderer);
	}
	gnome_pie_pie_preview_renderer_update_positions (self, FALSE);
	gnome_pie_pie_preview_renderer_update_sizes (self);
}

static void
__lambda36_ (GnomePiePiePreviewRenderer* self,
             gint pos)
{
	g_signal_emit (self, gnome_pie_pie_preview_renderer_signals[GNOME_PIE_PIE_PREVIEW_RENDERER_ON_EDIT_SLICE_SIGNAL], 0, pos);
}

static void
___lambda36__gnome_pie_pie_preview_slice_renderer_on_clicked (GnomePiePiePreviewSliceRenderer* _sender,
                                                              gint position,
                                                              gpointer self)
{
	__lambda36_ ((GnomePiePiePreviewRenderer*) self, position);
}

static void
__lambda37_ (GnomePiePiePreviewRenderer* self,
             gint pos)
{
	g_signal_emit (self, gnome_pie_pie_preview_renderer_signals[GNOME_PIE_PIE_PREVIEW_RENDERER_ON_REMOVE_SLICE_SIGNAL], 0, pos);
}

static void
___lambda37__gnome_pie_pie_preview_slice_renderer_on_remove (GnomePiePiePreviewSliceRenderer* _sender,
                                                             gint position,
                                                             gpointer self)
{
	__lambda37_ ((GnomePiePiePreviewRenderer*) self, position);
}

static void
gnome_pie_pie_preview_renderer_connect_siganls (GnomePiePiePreviewRenderer* self,
                                                GnomePiePiePreviewSliceRenderer* renderer)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (renderer != NULL);
	g_signal_connect_object (renderer, "on-clicked", (GCallback) ___lambda36__gnome_pie_pie_preview_slice_renderer_on_clicked, self, 0);
	g_signal_connect_object (renderer, "on-remove", (GCallback) ___lambda37__gnome_pie_pie_preview_slice_renderer_on_remove, self, 0);
}

static void
gnome_pie_pie_preview_renderer_update_positions (GnomePiePiePreviewRenderer* self,
                                                 gboolean smoothly)
{
	GeeArrayList* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->slices;
	_tmp1_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ > 0) {
		GnomePiePiePreviewAddSign* _tmp3_;
		gboolean _tmp4_;
		gboolean _tmp5_;
		_tmp3_ = self->priv->add_sign;
		_tmp4_ = gnome_pie_pie_preview_add_sign_get_visible (_tmp3_);
		_tmp5_ = _tmp4_;
		if (_tmp5_) {
			gint add_position = 0;
			GnomePiePiePreviewAddSign* _tmp6_;
			add_position = 0;
			add_position = ((gint) ((self->priv->angle / (2 * G_PI)) * gnome_pie_pie_preview_renderer_slice_count (self))) % gnome_pie_pie_preview_renderer_slice_count (self);
			_tmp6_ = self->priv->add_sign;
			gnome_pie_pie_preview_add_sign_set_position (_tmp6_, add_position);
			{
				gint i = 0;
				i = 0;
				{
					gboolean _tmp7_ = FALSE;
					_tmp7_ = TRUE;
					while (TRUE) {
						GeeArrayList* _tmp9_;
						gint _tmp10_;
						gint _tmp11_;
						GeeArrayList* _tmp12_;
						gpointer _tmp13_;
						GnomePiePiePreviewSliceRenderer* _tmp14_;
						if (!_tmp7_) {
							gint _tmp8_;
							i = i + 1;
							_tmp8_ = i;
						}
						_tmp7_ = FALSE;
						_tmp9_ = self->slices;
						_tmp10_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp9_);
						_tmp11_ = _tmp10_;
						if (!(i < _tmp11_)) {
							break;
						}
						_tmp12_ = self->slices;
						_tmp13_ = gee_abstract_list_get ((GeeAbstractList*) _tmp12_, i);
						_tmp14_ = (GnomePiePiePreviewSliceRenderer*) _tmp13_;
						gnome_pie_pie_preview_slice_renderer_set_position (_tmp14_, i, smoothly);
						_g_object_unref0 (_tmp14_);
					}
				}
			}
		} else {
			gboolean _tmp15_;
			_tmp15_ = self->priv->_drag_n_drop_mode;
			if (_tmp15_) {
				gint add_position = 0;
				add_position = 0;
				add_position = ((gint) (((self->priv->angle / (2 * G_PI)) * gnome_pie_pie_preview_renderer_slice_count (self)) + 0.5)) % gnome_pie_pie_preview_renderer_slice_count (self);
				{
					gint i = 0;
					i = 0;
					{
						gboolean _tmp16_ = FALSE;
						_tmp16_ = TRUE;
						while (TRUE) {
							GeeArrayList* _tmp18_;
							gint _tmp19_;
							gint _tmp20_;
							gint _tmp21_ = 0;
							GeeArrayList* _tmp22_;
							gpointer _tmp23_;
							GnomePiePiePreviewSliceRenderer* _tmp24_;
							if (!_tmp16_) {
								gint _tmp17_;
								i = i + 1;
								_tmp17_ = i;
							}
							_tmp16_ = FALSE;
							_tmp18_ = self->slices;
							_tmp19_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp18_);
							_tmp20_ = _tmp19_;
							if (!(i < _tmp20_)) {
								break;
							}
							if (i >= add_position) {
								_tmp21_ = i + 1;
							} else {
								_tmp21_ = i;
							}
							_tmp22_ = self->slices;
							_tmp23_ = gee_abstract_list_get ((GeeAbstractList*) _tmp22_, i);
							_tmp24_ = (GnomePiePiePreviewSliceRenderer*) _tmp23_;
							gnome_pie_pie_preview_slice_renderer_set_position (_tmp24_, _tmp21_, smoothly);
							_g_object_unref0 (_tmp24_);
						}
					}
				}
				gnome_pie_pie_preview_renderer_update_center (self, GNOME_PIE_PIE_PREVIEW_RENDERER_CENTER_DISPLAY_DROP);
			} else {
				{
					gint i = 0;
					i = 0;
					{
						gboolean _tmp25_ = FALSE;
						_tmp25_ = TRUE;
						while (TRUE) {
							GeeArrayList* _tmp27_;
							gint _tmp28_;
							gint _tmp29_;
							GeeArrayList* _tmp30_;
							gpointer _tmp31_;
							GnomePiePiePreviewSliceRenderer* _tmp32_;
							if (!_tmp25_) {
								gint _tmp26_;
								i = i + 1;
								_tmp26_ = i;
							}
							_tmp25_ = FALSE;
							_tmp27_ = self->slices;
							_tmp28_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp27_);
							_tmp29_ = _tmp28_;
							if (!(i < _tmp29_)) {
								break;
							}
							_tmp30_ = self->slices;
							_tmp31_ = gee_abstract_list_get ((GeeAbstractList*) _tmp30_, i);
							_tmp32_ = (GnomePiePiePreviewSliceRenderer*) _tmp31_;
							gnome_pie_pie_preview_slice_renderer_set_position (_tmp32_, i, smoothly);
							_g_object_unref0 (_tmp32_);
						}
					}
				}
				if (self->priv->active_slice < 0) {
					gnome_pie_pie_preview_renderer_update_center (self, GNOME_PIE_PIE_PREVIEW_RENDERER_CENTER_DISPLAY_NONE);
				} else {
					gnome_pie_pie_preview_renderer_update_center (self, GNOME_PIE_PIE_PREVIEW_RENDERER_CENTER_DISPLAY_ACTIVE_SLICE);
				}
			}
		}
	}
}

static void
gnome_pie_pie_preview_renderer_update_sizes (GnomePiePiePreviewRenderer* self)
{
	gdouble size = 0.0;
	GnomePiePiePreviewAddSign* _tmp0_;
	g_return_if_fail (self != NULL);
	size = 1.0;
	if (gnome_pie_pie_preview_renderer_slice_count (self) > 20) {
		size = 0.5;
	} else {
		if (gnome_pie_pie_preview_renderer_slice_count (self) > 8) {
			size = 1.0 - (((gdouble) (gnome_pie_pie_preview_renderer_slice_count (self) - 8)) / 24.0);
		}
	}
	_tmp0_ = self->priv->add_sign;
	gnome_pie_pie_preview_add_sign_set_size (_tmp0_, size);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp1_ = FALSE;
			_tmp1_ = TRUE;
			while (TRUE) {
				GeeArrayList* _tmp3_;
				gint _tmp4_;
				gint _tmp5_;
				GeeArrayList* _tmp6_;
				gpointer _tmp7_;
				GnomePiePiePreviewSliceRenderer* _tmp8_;
				if (!_tmp1_) {
					gint _tmp2_;
					i = i + 1;
					_tmp2_ = i;
				}
				_tmp1_ = FALSE;
				_tmp3_ = self->slices;
				_tmp4_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp3_);
				_tmp5_ = _tmp4_;
				if (!(i < _tmp5_)) {
					break;
				}
				_tmp6_ = self->slices;
				_tmp7_ = gee_abstract_list_get ((GeeAbstractList*) _tmp6_, i);
				_tmp8_ = (GnomePiePiePreviewSliceRenderer*) _tmp7_;
				gnome_pie_pie_preview_slice_renderer_set_size (_tmp8_, size);
				_g_object_unref0 (_tmp8_);
			}
		}
	}
}

static void
gnome_pie_pie_preview_renderer_update_center (GnomePiePiePreviewRenderer* self,
                                              GnomePiePiePreviewRendererCenterDisplay display)
{
	g_return_if_fail (self != NULL);
	switch (display) {
		case GNOME_PIE_PIE_PREVIEW_RENDERER_CENTER_DISPLAY_ACTIVE_SLICE:
		{
			gboolean _tmp0_ = FALSE;
			if (self->priv->active_slice >= 0) {
				GeeArrayList* _tmp1_;
				gint _tmp2_;
				gint _tmp3_;
				_tmp1_ = self->slices;
				_tmp2_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp1_);
				_tmp3_ = _tmp2_;
				_tmp0_ = self->priv->active_slice < _tmp3_;
			} else {
				_tmp0_ = FALSE;
			}
			if (_tmp0_) {
				GnomePiePiePreviewCenter* _tmp4_;
				GeeArrayList* _tmp5_;
				gpointer _tmp6_;
				GnomePiePiePreviewSliceRenderer* _tmp7_;
				const gchar* _tmp8_;
				const gchar* _tmp9_;
				gchar* _tmp10_;
				gchar* _tmp11_;
				gchar* _tmp12_;
				gchar* _tmp13_;
				gchar* _tmp14_;
				gchar* _tmp15_;
				gchar* _tmp16_;
				gchar* _tmp17_;
				gchar* _tmp18_;
				gchar* _tmp19_;
				gchar* _tmp20_;
				gchar* _tmp21_;
				gchar* _tmp22_;
				gchar* _tmp23_;
				_tmp4_ = self->priv->center_renderer;
				_tmp5_ = self->slices;
				_tmp6_ = gee_abstract_list_get ((GeeAbstractList*) _tmp5_, self->priv->active_slice);
				_tmp7_ = (GnomePiePiePreviewSliceRenderer*) _tmp6_;
				_tmp8_ = gnome_pie_pie_preview_slice_renderer_get_name (_tmp7_);
				_tmp9_ = _tmp8_;
				_tmp10_ = g_markup_escape_text (_tmp9_, (gssize) -1);
				_tmp11_ = _tmp10_;
				_tmp12_ = g_strconcat ("<b>", _tmp11_, NULL);
				_tmp13_ = _tmp12_;
				_tmp14_ = g_strconcat (_tmp13_, "</b>\n<small>", NULL);
				_tmp15_ = _tmp14_;
				_tmp16_ = g_strconcat (_tmp15_, _ ("Click to edit"), NULL);
				_tmp17_ = _tmp16_;
				_tmp18_ = g_strconcat (_tmp17_, "\n", NULL);
				_tmp19_ = _tmp18_;
				_tmp20_ = g_strconcat (_tmp19_, _ ("Drag to move"), NULL);
				_tmp21_ = _tmp20_;
				_tmp22_ = g_strconcat (_tmp21_, "</small>", NULL);
				_tmp23_ = _tmp22_;
				gnome_pie_pie_preview_center_set_text (_tmp4_, _tmp23_);
				_g_free0 (_tmp23_);
				_g_free0 (_tmp21_);
				_g_free0 (_tmp19_);
				_g_free0 (_tmp17_);
				_g_free0 (_tmp15_);
				_g_free0 (_tmp13_);
				_g_free0 (_tmp11_);
				_g_object_unref0 (_tmp7_);
			}
			break;
		}
		case GNOME_PIE_PIE_PREVIEW_RENDERER_CENTER_DISPLAY_ADD:
		{
			GnomePiePiePreviewCenter* _tmp24_;
			gchar* _tmp25_;
			gchar* _tmp26_;
			gchar* _tmp27_;
			gchar* _tmp28_;
			_tmp24_ = self->priv->center_renderer;
			_tmp25_ = g_strconcat ("<small>", _ ("Click to add a new Slice"), NULL);
			_tmp26_ = _tmp25_;
			_tmp27_ = g_strconcat (_tmp26_, "</small>", NULL);
			_tmp28_ = _tmp27_;
			gnome_pie_pie_preview_center_set_text (_tmp24_, _tmp28_);
			_g_free0 (_tmp28_);
			_g_free0 (_tmp26_);
			break;
		}
		case GNOME_PIE_PIE_PREVIEW_RENDERER_CENTER_DISPLAY_DROP:
		{
			GnomePiePiePreviewSliceRenderer* _tmp29_;
			_tmp29_ = self->priv->_hidden_group;
			if (_tmp29_ == NULL) {
				GnomePiePiePreviewCenter* _tmp30_;
				gchar* _tmp31_;
				gchar* _tmp32_;
				gchar* _tmp33_;
				gchar* _tmp34_;
				_tmp30_ = self->priv->center_renderer;
				_tmp31_ = g_strconcat ("<small>", _ ("Drop to add as new Slice"), NULL);
				_tmp32_ = _tmp31_;
				_tmp33_ = g_strconcat (_tmp32_, "</small>", NULL);
				_tmp34_ = _tmp33_;
				gnome_pie_pie_preview_center_set_text (_tmp30_, _tmp34_);
				_g_free0 (_tmp34_);
				_g_free0 (_tmp32_);
			} else {
				GnomePiePiePreviewCenter* _tmp35_;
				GnomePiePiePreviewSliceRenderer* _tmp36_;
				const gchar* _tmp37_;
				const gchar* _tmp38_;
				gchar* _tmp39_;
				gchar* _tmp40_;
				gchar* _tmp41_;
				gchar* _tmp42_;
				gchar* _tmp43_;
				gchar* _tmp44_;
				gchar* _tmp45_;
				gchar* _tmp46_;
				gchar* _tmp47_;
				gchar* _tmp48_;
				_tmp35_ = self->priv->center_renderer;
				_tmp36_ = self->priv->_hidden_group;
				_tmp37_ = gnome_pie_pie_preview_slice_renderer_get_name (_tmp36_);
				_tmp38_ = _tmp37_;
				_tmp39_ = g_markup_escape_text (_tmp38_, (gssize) -1);
				_tmp40_ = _tmp39_;
				_tmp41_ = g_strconcat ("<b>", _tmp40_, NULL);
				_tmp42_ = _tmp41_;
				_tmp43_ = g_strconcat (_tmp42_, "</b>\n<small>", NULL);
				_tmp44_ = _tmp43_;
				_tmp45_ = g_strconcat (_tmp44_, _ ("Drop to move Slice"), NULL);
				_tmp46_ = _tmp45_;
				_tmp47_ = g_strconcat (_tmp46_, "</small>", NULL);
				_tmp48_ = _tmp47_;
				gnome_pie_pie_preview_center_set_text (_tmp35_, _tmp48_);
				_g_free0 (_tmp48_);
				_g_free0 (_tmp46_);
				_g_free0 (_tmp44_);
				_g_free0 (_tmp42_);
				_g_free0 (_tmp40_);
			}
			break;
		}
		case GNOME_PIE_PIE_PREVIEW_RENDERER_CENTER_DISPLAY_DELETE:
		{
			gboolean _tmp49_ = FALSE;
			if (self->priv->active_slice >= 0) {
				GeeArrayList* _tmp50_;
				gint _tmp51_;
				gint _tmp52_;
				_tmp50_ = self->slices;
				_tmp51_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp50_);
				_tmp52_ = _tmp51_;
				_tmp49_ = self->priv->active_slice < _tmp52_;
			} else {
				_tmp49_ = FALSE;
			}
			if (_tmp49_) {
				GnomePiePiePreviewCenter* _tmp53_;
				GeeArrayList* _tmp54_;
				gpointer _tmp55_;
				GnomePiePiePreviewSliceRenderer* _tmp56_;
				const gchar* _tmp57_;
				const gchar* _tmp58_;
				gchar* _tmp59_;
				gchar* _tmp60_;
				gchar* _tmp61_;
				gchar* _tmp62_;
				gchar* _tmp63_;
				gchar* _tmp64_;
				gchar* _tmp65_;
				gchar* _tmp66_;
				gchar* _tmp67_;
				gchar* _tmp68_;
				gchar* _tmp69_;
				gchar* _tmp70_;
				gchar* _tmp71_;
				gchar* _tmp72_;
				_tmp53_ = self->priv->center_renderer;
				_tmp54_ = self->slices;
				_tmp55_ = gee_abstract_list_get ((GeeAbstractList*) _tmp54_, self->priv->active_slice);
				_tmp56_ = (GnomePiePiePreviewSliceRenderer*) _tmp55_;
				_tmp57_ = gnome_pie_pie_preview_slice_renderer_get_name (_tmp56_);
				_tmp58_ = _tmp57_;
				_tmp59_ = g_markup_escape_text (_tmp58_, (gssize) -1);
				_tmp60_ = _tmp59_;
				_tmp61_ = g_strconcat ("<b>", _tmp60_, NULL);
				_tmp62_ = _tmp61_;
				_tmp63_ = g_strconcat (_tmp62_, "</b>\n<small>", NULL);
				_tmp64_ = _tmp63_;
				_tmp65_ = g_strconcat (_tmp64_, _ ("Click to delete"), NULL);
				_tmp66_ = _tmp65_;
				_tmp67_ = g_strconcat (_tmp66_, "\n", NULL);
				_tmp68_ = _tmp67_;
				_tmp69_ = g_strconcat (_tmp68_, _ ("Drag to move"), NULL);
				_tmp70_ = _tmp69_;
				_tmp71_ = g_strconcat (_tmp70_, "</small>", NULL);
				_tmp72_ = _tmp71_;
				gnome_pie_pie_preview_center_set_text (_tmp53_, _tmp72_);
				_g_free0 (_tmp72_);
				_g_free0 (_tmp70_);
				_g_free0 (_tmp68_);
				_g_free0 (_tmp66_);
				_g_free0 (_tmp64_);
				_g_free0 (_tmp62_);
				_g_free0 (_tmp60_);
				_g_object_unref0 (_tmp56_);
			}
			break;
		}
		default:
		{
			GnomePiePiePreviewCenter* _tmp73_;
			_tmp73_ = self->priv->center_renderer;
			gnome_pie_pie_preview_center_set_text (_tmp73_, "");
			break;
		}
	}
}

gboolean
gnome_pie_pie_preview_renderer_get_drag_n_drop_mode (GnomePiePiePreviewRenderer* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_drag_n_drop_mode;
	return result;
}

static void
gnome_pie_pie_preview_renderer_set_drag_n_drop_mode (GnomePiePiePreviewRenderer* self,
                                                     gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_pie_preview_renderer_get_drag_n_drop_mode (self);
	if (old_value != value) {
		self->priv->_drag_n_drop_mode = value;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_pie_preview_renderer_properties[GNOME_PIE_PIE_PREVIEW_RENDERER_DRAG_N_DROP_MODE_PROPERTY]);
	}
}

GnomePiePiePreviewSliceRenderer*
gnome_pie_pie_preview_renderer_get_hidden_group (GnomePiePiePreviewRenderer* self)
{
	GnomePiePiePreviewSliceRenderer* result;
	GnomePiePiePreviewSliceRenderer* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_hidden_group;
	result = _tmp0_;
	return result;
}

static void
gnome_pie_pie_preview_renderer_set_hidden_group (GnomePiePiePreviewRenderer* self,
                                                 GnomePiePiePreviewSliceRenderer* value)
{
	GnomePiePiePreviewSliceRenderer* old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_pie_preview_renderer_get_hidden_group (self);
	if (old_value != value) {
		GnomePiePiePreviewSliceRenderer* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_hidden_group);
		self->priv->_hidden_group = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_pie_preview_renderer_properties[GNOME_PIE_PIE_PREVIEW_RENDERER_HIDDEN_GROUP_PROPERTY]);
	}
}

static void
gnome_pie_pie_preview_renderer_class_init (GnomePiePiePreviewRendererClass * klass,
                                           gpointer klass_data)
{
	gnome_pie_pie_preview_renderer_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GnomePiePiePreviewRenderer_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_gnome_pie_pie_preview_renderer_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gnome_pie_pie_preview_renderer_set_property;
	G_OBJECT_CLASS (klass)->finalize = gnome_pie_pie_preview_renderer_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_PIE_PREVIEW_RENDERER_DRAG_N_DROP_MODE_PROPERTY, gnome_pie_pie_preview_renderer_properties[GNOME_PIE_PIE_PREVIEW_RENDERER_DRAG_N_DROP_MODE_PROPERTY] = g_param_spec_boolean ("drag-n-drop-mode", "drag-n-drop-mode", "drag-n-drop-mode", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_PIE_PREVIEW_RENDERER_HIDDEN_GROUP_PROPERTY, gnome_pie_pie_preview_renderer_properties[GNOME_PIE_PIE_PREVIEW_RENDERER_HIDDEN_GROUP_PROPERTY] = g_param_spec_object ("hidden-group", "hidden-group", "hidden-group", GNOME_PIE_TYPE_PIE_PREVIEW_SLICE_RENDERER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	gnome_pie_pie_preview_renderer_signals[GNOME_PIE_PIE_PREVIEW_RENDERER_ON_ADD_SLICE_SIGNAL] = g_signal_new ("on-add-slice", GNOME_PIE_TYPE_PIE_PREVIEW_RENDERER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
	gnome_pie_pie_preview_renderer_signals[GNOME_PIE_PIE_PREVIEW_RENDERER_ON_REMOVE_SLICE_SIGNAL] = g_signal_new ("on-remove-slice", GNOME_PIE_TYPE_PIE_PREVIEW_RENDERER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
	gnome_pie_pie_preview_renderer_signals[GNOME_PIE_PIE_PREVIEW_RENDERER_ON_EDIT_SLICE_SIGNAL] = g_signal_new ("on-edit-slice", GNOME_PIE_TYPE_PIE_PREVIEW_RENDERER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
}

static void
gnome_pie_pie_preview_renderer_instance_init (GnomePiePiePreviewRenderer * self,
                                              gpointer klass)
{
	self->priv = gnome_pie_pie_preview_renderer_get_instance_private (self);
	self->priv->_drag_n_drop_mode = FALSE;
	self->priv->_hidden_group = NULL;
	self->priv->add_sign = NULL;
	self->priv->center_renderer = NULL;
	self->priv->active_slice = -1;
	self->priv->angle = 0.0;
	self->priv->mouse_x = 0.0;
	self->priv->mouse_y = 0.0;
}

static void
gnome_pie_pie_preview_renderer_finalize (GObject * obj)
{
	GnomePiePiePreviewRenderer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GNOME_PIE_TYPE_PIE_PREVIEW_RENDERER, GnomePiePiePreviewRenderer);
	_g_object_unref0 (self->slices);
	_g_object_unref0 (self->priv->_hidden_group);
	_g_object_unref0 (self->priv->add_sign);
	_g_object_unref0 (self->priv->center_renderer);
	G_OBJECT_CLASS (gnome_pie_pie_preview_renderer_parent_class)->finalize (obj);
}

static GType
gnome_pie_pie_preview_renderer_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GnomePiePiePreviewRendererClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gnome_pie_pie_preview_renderer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GnomePiePiePreviewRenderer), 0, (GInstanceInitFunc) gnome_pie_pie_preview_renderer_instance_init, NULL };
	GType gnome_pie_pie_preview_renderer_type_id;
	gnome_pie_pie_preview_renderer_type_id = g_type_register_static (G_TYPE_OBJECT, "GnomePiePiePreviewRenderer", &g_define_type_info, 0);
	GnomePiePiePreviewRenderer_private_offset = g_type_add_instance_private (gnome_pie_pie_preview_renderer_type_id, sizeof (GnomePiePiePreviewRendererPrivate));
	return gnome_pie_pie_preview_renderer_type_id;
}

GType
gnome_pie_pie_preview_renderer_get_type (void)
{
	static volatile gsize gnome_pie_pie_preview_renderer_type_id__once = 0;
	if (g_once_init_enter (&gnome_pie_pie_preview_renderer_type_id__once)) {
		GType gnome_pie_pie_preview_renderer_type_id;
		gnome_pie_pie_preview_renderer_type_id = gnome_pie_pie_preview_renderer_get_type_once ();
		g_once_init_leave (&gnome_pie_pie_preview_renderer_type_id__once, gnome_pie_pie_preview_renderer_type_id);
	}
	return gnome_pie_pie_preview_renderer_type_id__once;
}

static void
_vala_gnome_pie_pie_preview_renderer_get_property (GObject * object,
                                                   guint property_id,
                                                   GValue * value,
                                                   GParamSpec * pspec)
{
	GnomePiePiePreviewRenderer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GNOME_PIE_TYPE_PIE_PREVIEW_RENDERER, GnomePiePiePreviewRenderer);
	switch (property_id) {
		case GNOME_PIE_PIE_PREVIEW_RENDERER_DRAG_N_DROP_MODE_PROPERTY:
		g_value_set_boolean (value, gnome_pie_pie_preview_renderer_get_drag_n_drop_mode (self));
		break;
		case GNOME_PIE_PIE_PREVIEW_RENDERER_HIDDEN_GROUP_PROPERTY:
		g_value_set_object (value, gnome_pie_pie_preview_renderer_get_hidden_group (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gnome_pie_pie_preview_renderer_set_property (GObject * object,
                                                   guint property_id,
                                                   const GValue * value,
                                                   GParamSpec * pspec)
{
	GnomePiePiePreviewRenderer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GNOME_PIE_TYPE_PIE_PREVIEW_RENDERER, GnomePiePiePreviewRenderer);
	switch (property_id) {
		case GNOME_PIE_PIE_PREVIEW_RENDERER_DRAG_N_DROP_MODE_PROPERTY:
		gnome_pie_pie_preview_renderer_set_drag_n_drop_mode (self, g_value_get_boolean (value));
		break;
		case GNOME_PIE_PIE_PREVIEW_RENDERER_HIDDEN_GROUP_PROPERTY:
		gnome_pie_pie_preview_renderer_set_hidden_group (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

