/* piePreviewSliceRenderer.c generated by valac 0.56.18, the Vala compiler
 * generated from piePreviewSliceRenderer.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 <stdlib.h>
#include <string.h>
#include <glib.h>
#include <float.h>
#include <math.h>
#include <gee.h>
#include <cairo-gobject.h>

#define GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_pie_radius ((gdouble) 126)
#define GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_radius ((gdouble) 24)
#define GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_delete_x ((gdouble) 13)
#define GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_delete_y ((gdouble) -13)
#define GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_click_cancel_treshold ((gdouble) 5)
#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_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;
typedef struct _GnomePiePiePreviewSliceRendererPrivate GnomePiePiePreviewSliceRendererPrivate;

#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 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_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;

#define GNOME_PIE_TYPE_PIE_PREVIEW_DELETE_SIGN (gnome_pie_pie_preview_delete_sign_get_type ())
#define GNOME_PIE_PIE_PREVIEW_DELETE_SIGN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_PIE_PREVIEW_DELETE_SIGN, GnomePiePiePreviewDeleteSign))
#define GNOME_PIE_PIE_PREVIEW_DELETE_SIGN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_PIE_PREVIEW_DELETE_SIGN, GnomePiePiePreviewDeleteSignClass))
#define GNOME_PIE_IS_PIE_PREVIEW_DELETE_SIGN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_PIE_PREVIEW_DELETE_SIGN))
#define GNOME_PIE_IS_PIE_PREVIEW_DELETE_SIGN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_PIE_PREVIEW_DELETE_SIGN))
#define GNOME_PIE_PIE_PREVIEW_DELETE_SIGN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_PIE_PREVIEW_DELETE_SIGN, GnomePiePiePreviewDeleteSignClass))

typedef struct _GnomePiePiePreviewDeleteSign GnomePiePiePreviewDeleteSign;
typedef struct _GnomePiePiePreviewDeleteSignClass GnomePiePiePreviewDeleteSignClass;

#define GNOME_PIE_TYPE_ANIMATED_VALUE (gnome_pie_animated_value_get_type ())
#define GNOME_PIE_ANIMATED_VALUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_ANIMATED_VALUE, GnomePieAnimatedValue))
#define GNOME_PIE_ANIMATED_VALUE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_ANIMATED_VALUE, GnomePieAnimatedValueClass))
#define GNOME_PIE_IS_ANIMATED_VALUE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_ANIMATED_VALUE))
#define GNOME_PIE_IS_ANIMATED_VALUE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_ANIMATED_VALUE))
#define GNOME_PIE_ANIMATED_VALUE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_ANIMATED_VALUE, GnomePieAnimatedValueClass))

typedef struct _GnomePieAnimatedValue GnomePieAnimatedValue;
typedef struct _GnomePieAnimatedValueClass GnomePieAnimatedValueClass;
enum  {
	GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_0_PROPERTY,
	GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_ICON_PROPERTY,
	GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_ACTION_GROUP_PROPERTY,
	GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_NAME_PROPERTY,
	GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_DELETE_HOVERED_PROPERTY,
	GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_NUM_PROPERTIES
};
static GParamSpec* gnome_pie_pie_preview_slice_renderer_properties[GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_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))
typedef enum  {
	GNOME_PIE_ANIMATED_VALUE_DIRECTION_IN,
	GNOME_PIE_ANIMATED_VALUE_DIRECTION_OUT,
	GNOME_PIE_ANIMATED_VALUE_DIRECTION_IN_OUT,
	GNOME_PIE_ANIMATED_VALUE_DIRECTION_OUT_IN
} GnomePieAnimatedValueDirection;

#define GNOME_PIE_ANIMATED_VALUE_TYPE_DIRECTION (gnome_pie_animated_value_direction_get_type ())

#define GNOME_PIE_TYPE_ACTION (gnome_pie_action_get_type ())
#define GNOME_PIE_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_ACTION, GnomePieAction))
#define GNOME_PIE_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_ACTION, GnomePieActionClass))
#define GNOME_PIE_IS_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_ACTION))
#define GNOME_PIE_IS_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_ACTION))
#define GNOME_PIE_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_ACTION, GnomePieActionClass))

typedef struct _GnomePieAction GnomePieAction;
typedef struct _GnomePieActionClass GnomePieActionClass;

#define GNOME_PIE_GROUP_REGISTRY_TYPE_TYPEDESCRIPTION (gnome_pie_group_registry_typedescription_get_type ())
#define GNOME_PIE_GROUP_REGISTRY_TYPEDESCRIPTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_GROUP_REGISTRY_TYPE_TYPEDESCRIPTION, GnomePieGroupRegistryTypeDescription))
#define GNOME_PIE_GROUP_REGISTRY_TYPEDESCRIPTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_GROUP_REGISTRY_TYPE_TYPEDESCRIPTION, GnomePieGroupRegistryTypeDescriptionClass))
#define GNOME_PIE_GROUP_REGISTRY_IS_TYPEDESCRIPTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_GROUP_REGISTRY_TYPE_TYPEDESCRIPTION))
#define GNOME_PIE_GROUP_REGISTRY_IS_TYPEDESCRIPTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_GROUP_REGISTRY_TYPE_TYPEDESCRIPTION))
#define GNOME_PIE_GROUP_REGISTRY_TYPEDESCRIPTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_GROUP_REGISTRY_TYPE_TYPEDESCRIPTION, GnomePieGroupRegistryTypeDescriptionClass))

typedef struct _GnomePieGroupRegistryTypeDescription GnomePieGroupRegistryTypeDescription;
typedef struct _GnomePieGroupRegistryTypeDescriptionClass GnomePieGroupRegistryTypeDescriptionClass;
#define _gnome_pie_group_registry_typedescription_unref0(var) ((var == NULL) ? NULL : (var = (gnome_pie_group_registry_typedescription_unref (var), NULL)))
enum  {
	GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_ON_CLICKED_SIGNAL,
	GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_ON_REMOVE_SIGNAL,
	GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_NUM_SIGNALS
};
static guint gnome_pie_pie_preview_slice_renderer_signals[GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_NUM_SIGNALS] = {0};

struct _GnomePiePiePreviewSliceRenderer {
	GObject parent_instance;
	GnomePiePiePreviewSliceRendererPrivate * priv;
};

struct _GnomePiePiePreviewSliceRendererClass {
	GObjectClass parent_class;
};

struct _GnomePiePiePreviewSliceRendererPrivate {
	GnomePieIcon* _icon;
	GnomePieActionGroup* _action_group;
	gchar* _name;
	gboolean _delete_hovered;
	GnomePiePiePreviewRenderer* parent;
	GnomePiePiePreviewDeleteSign* delete_sign;
	GnomePieAnimatedValue* angle;
	GnomePieAnimatedValue* size;
	GnomePieAnimatedValue* activity;
	GnomePieAnimatedValue* clicked;
	gdouble clicked_x;
	gdouble clicked_y;
	gint position;
};

static gint GnomePiePiePreviewSliceRenderer_private_offset;
static gpointer gnome_pie_pie_preview_slice_renderer_parent_class = NULL;

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_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 GType gnome_pie_action_group_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieActionGroup, g_object_unref)
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_delete_sign_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePiePiePreviewDeleteSign, g_object_unref)
VALA_EXTERN GType gnome_pie_animated_value_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieAnimatedValue, g_object_unref)
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 GnomePiePiePreviewDeleteSign* gnome_pie_pie_preview_delete_sign_new (void);
VALA_EXTERN GnomePiePiePreviewDeleteSign* gnome_pie_pie_preview_delete_sign_construct (GType object_type);
VALA_EXTERN void gnome_pie_pie_preview_delete_sign_load (GnomePiePiePreviewDeleteSign* self);
static void __lambda34_ (GnomePiePiePreviewSliceRenderer* self);
static void ___lambda34__gnome_pie_pie_preview_delete_sign_on_clicked (GnomePiePiePreviewDeleteSign* _sender,
                                                                gpointer self);
VALA_EXTERN GType gnome_pie_animated_value_direction_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GnomePieAnimatedValue* gnome_pie_animated_value_new_cubic (GnomePieAnimatedValueDirection direction,
                                                           gdouble start,
                                                           gdouble end,
                                                           gdouble duration,
                                                           gdouble multiplier);
VALA_EXTERN GnomePieAnimatedValue* gnome_pie_animated_value_construct_cubic (GType object_type,
                                                                 GnomePieAnimatedValueDirection direction,
                                                                 gdouble start,
                                                                 gdouble end,
                                                                 gdouble duration,
                                                                 gdouble multiplier);
VALA_EXTERN void gnome_pie_pie_preview_slice_renderer_load (GnomePiePiePreviewSliceRenderer* self,
                                                GnomePieActionGroup* group);
static void gnome_pie_pie_preview_slice_renderer_set_action_group (GnomePiePiePreviewSliceRenderer* self,
                                                            GnomePieActionGroup* value);
VALA_EXTERN GType gnome_pie_action_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieAction, g_object_unref)
VALA_EXTERN GeeArrayList* gnome_pie_action_group_get_actions (GnomePieActionGroup* self);
VALA_EXTERN const gchar* gnome_pie_action_get_icon (GnomePieAction* 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);
static void gnome_pie_pie_preview_slice_renderer_set_icon (GnomePiePiePreviewSliceRenderer* self,
                                                    GnomePieIcon* value);
VALA_EXTERN const gchar* gnome_pie_action_get_name (GnomePieAction* self);
static void gnome_pie_pie_preview_slice_renderer_set_name (GnomePiePiePreviewSliceRenderer* self,
                                                    const gchar* value);
VALA_EXTERN gpointer gnome_pie_group_registry_typedescription_ref (gpointer instance);
VALA_EXTERN void gnome_pie_group_registry_typedescription_unref (gpointer instance);
VALA_EXTERN GParamSpec* gnome_pie_group_registry_param_spec_typedescription (const gchar* name,
                                                                 const gchar* nick,
                                                                 const gchar* blurb,
                                                                 GType object_type,
                                                                 GParamFlags flags);
VALA_EXTERN void gnome_pie_group_registry_value_set_typedescription (GValue* value,
                                                         gpointer v_object);
VALA_EXTERN void gnome_pie_group_registry_value_take_typedescription (GValue* value,
                                                          gpointer v_object);
VALA_EXTERN gpointer gnome_pie_group_registry_value_get_typedescription (const GValue* value);
VALA_EXTERN GType gnome_pie_group_registry_typedescription_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieGroupRegistryTypeDescription, gnome_pie_group_registry_typedescription_unref)
VALA_EXTERN GeeHashMap* gnome_pie_group_registry_get_descriptions (void);
VALA_EXTERN const gchar* gnome_pie_group_registry_typedescription_get_icon (GnomePieGroupRegistryTypeDescription* self);
VALA_EXTERN const gchar* gnome_pie_group_registry_typedescription_get_name (GnomePieGroupRegistryTypeDescription* self);
VALA_EXTERN void gnome_pie_pie_preview_slice_renderer_set_position (GnomePiePiePreviewSliceRenderer* self,
                                                        gint position,
                                                        gboolean smoothly);
VALA_EXTERN gint gnome_pie_pie_preview_renderer_slice_count (GnomePiePiePreviewRenderer* self);
VALA_EXTERN gdouble gnome_pie_animated_value_get_end (GnomePieAnimatedValue* self);
VALA_EXTERN void gnome_pie_animated_value_reset_target (GnomePieAnimatedValue* self,
                                            gdouble end,
                                            gdouble duration);
VALA_EXTERN void gnome_pie_animated_value_update (GnomePieAnimatedValue* self,
                                      gdouble time);
VALA_EXTERN void gnome_pie_pie_preview_slice_renderer_set_size (GnomePiePiePreviewSliceRenderer* self,
                                                    gdouble size);
VALA_EXTERN void gnome_pie_pie_preview_delete_sign_set_size (GnomePiePiePreviewDeleteSign* self,
                                                 gdouble size);
VALA_EXTERN void gnome_pie_pie_preview_slice_renderer_disable_quickactions (GnomePiePiePreviewSliceRenderer* self);
VALA_EXTERN GnomePieActionGroup* gnome_pie_pie_preview_slice_renderer_get_action_group (GnomePiePiePreviewSliceRenderer* self);
VALA_EXTERN void gnome_pie_action_group_disable_quickactions (GnomePieActionGroup* self);
VALA_EXTERN void gnome_pie_pie_preview_slice_renderer_draw (GnomePiePiePreviewSliceRenderer* self,
                                                gdouble frame_time,
                                                cairo_t* ctx);
VALA_EXTERN gdouble gnome_pie_animated_value_get_val (GnomePieAnimatedValue* self);
VALA_EXTERN GnomePieIcon* gnome_pie_pie_preview_slice_renderer_get_icon (GnomePiePiePreviewSliceRenderer* self);
VALA_EXTERN void gnome_pie_image_paint_on (GnomePieImage* self,
                               cairo_t* ctx,
                               gdouble alpha);
VALA_EXTERN void gnome_pie_pie_preview_delete_sign_draw (GnomePiePiePreviewDeleteSign* self,
                                             gdouble frame_time,
                                             cairo_t* ctx);
VALA_EXTERN gboolean gnome_pie_pie_preview_slice_renderer_on_mouse_move (GnomePiePiePreviewSliceRenderer* self,
                                                             gdouble angle,
                                                             gdouble x,
                                                             gdouble y);
VALA_EXTERN void gnome_pie_pie_preview_delete_sign_show (GnomePiePiePreviewDeleteSign* self);
VALA_EXTERN void gnome_pie_pie_preview_delete_sign_hide (GnomePiePiePreviewDeleteSign* self);
VALA_EXTERN gboolean gnome_pie_pie_preview_delete_sign_on_mouse_move (GnomePiePiePreviewDeleteSign* self,
                                                          gdouble x,
                                                          gdouble y);
static void gnome_pie_pie_preview_slice_renderer_set_delete_hovered (GnomePiePiePreviewSliceRenderer* self,
                                                              gboolean value);
VALA_EXTERN void gnome_pie_pie_preview_slice_renderer_on_mouse_leave (GnomePiePiePreviewSliceRenderer* self);
VALA_EXTERN void gnome_pie_pie_preview_slice_renderer_on_button_press (GnomePiePiePreviewSliceRenderer* self,
                                                           gdouble x,
                                                           gdouble y);
VALA_EXTERN gboolean gnome_pie_pie_preview_delete_sign_on_button_press (GnomePiePiePreviewDeleteSign* self,
                                                            gdouble x,
                                                            gdouble y);
VALA_EXTERN void gnome_pie_pie_preview_slice_renderer_on_button_release (GnomePiePiePreviewSliceRenderer* self,
                                                             gdouble x,
                                                             gdouble y);
VALA_EXTERN gboolean gnome_pie_pie_preview_delete_sign_on_button_release (GnomePiePiePreviewDeleteSign* self,
                                                              gdouble x,
                                                              gdouble y);
VALA_EXTERN const gchar* gnome_pie_pie_preview_slice_renderer_get_name (GnomePiePiePreviewSliceRenderer* self);
VALA_EXTERN gboolean gnome_pie_pie_preview_slice_renderer_get_delete_hovered (GnomePiePiePreviewSliceRenderer* self);
static void gnome_pie_pie_preview_slice_renderer_finalize (GObject * obj);
static GType gnome_pie_pie_preview_slice_renderer_get_type_once (void);
static void _vala_gnome_pie_pie_preview_slice_renderer_get_property (GObject * object,
                                                              guint property_id,
                                                              GValue * value,
                                                              GParamSpec * pspec);
static void _vala_gnome_pie_pie_preview_slice_renderer_set_property (GObject * object,
                                                              guint property_id,
                                                              const GValue * value,
                                                              GParamSpec * pspec);

static inline gpointer
gnome_pie_pie_preview_slice_renderer_get_instance_private (GnomePiePiePreviewSliceRenderer* self)
{
	return G_STRUCT_MEMBER_P (self, GnomePiePiePreviewSliceRenderer_private_offset);
}

static void
__lambda34_ (GnomePiePiePreviewSliceRenderer* self)
{
	g_signal_emit (self, gnome_pie_pie_preview_slice_renderer_signals[GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_ON_REMOVE_SIGNAL], 0, self->priv->position);
}

static void
___lambda34__gnome_pie_pie_preview_delete_sign_on_clicked (GnomePiePiePreviewDeleteSign* _sender,
                                                           gpointer self)
{
	__lambda34_ ((GnomePiePiePreviewSliceRenderer*) self);
}

GnomePiePiePreviewSliceRenderer*
gnome_pie_pie_preview_slice_renderer_construct (GType object_type,
                                                GnomePiePiePreviewRenderer* parent)
{
	GnomePiePiePreviewSliceRenderer * self = NULL;
	GnomePiePiePreviewDeleteSign* _tmp0_;
	GnomePiePiePreviewDeleteSign* _tmp1_;
	GnomePiePiePreviewDeleteSign* _tmp2_;
	GnomePieAnimatedValue* _tmp3_;
	GnomePieAnimatedValue* _tmp4_;
	GnomePieAnimatedValue* _tmp5_;
	GnomePieAnimatedValue* _tmp6_;
	g_return_val_if_fail (parent != NULL, NULL);
	self = (GnomePiePiePreviewSliceRenderer*) g_object_new (object_type, NULL);
	_tmp0_ = gnome_pie_pie_preview_delete_sign_new ();
	_g_object_unref0 (self->priv->delete_sign);
	self->priv->delete_sign = _tmp0_;
	_tmp1_ = self->priv->delete_sign;
	gnome_pie_pie_preview_delete_sign_load (_tmp1_);
	_tmp2_ = self->priv->delete_sign;
	g_signal_connect_object (_tmp2_, "on-clicked", (GCallback) ___lambda34__gnome_pie_pie_preview_delete_sign_on_clicked, self, 0);
	self->priv->parent = parent;
	_tmp3_ = gnome_pie_animated_value_new_cubic (GNOME_PIE_ANIMATED_VALUE_DIRECTION_OUT, (gdouble) 0, (gdouble) 0, (gdouble) 0, 0.5);
	_g_object_unref0 (self->priv->angle);
	self->priv->angle = _tmp3_;
	_tmp4_ = gnome_pie_animated_value_new_cubic (GNOME_PIE_ANIMATED_VALUE_DIRECTION_OUT, (gdouble) 0, (gdouble) 0, (gdouble) 0, 1.0);
	_g_object_unref0 (self->priv->size);
	self->priv->size = _tmp4_;
	_tmp5_ = gnome_pie_animated_value_new_cubic (GNOME_PIE_ANIMATED_VALUE_DIRECTION_OUT, (gdouble) 0, (gdouble) 0, (gdouble) 0, 0.0);
	_g_object_unref0 (self->priv->activity);
	self->priv->activity = _tmp5_;
	_tmp6_ = gnome_pie_animated_value_new_cubic (GNOME_PIE_ANIMATED_VALUE_DIRECTION_OUT, (gdouble) 1, (gdouble) 1, (gdouble) 0, 1.0);
	_g_object_unref0 (self->priv->clicked);
	self->priv->clicked = _tmp6_;
	return self;
}

GnomePiePiePreviewSliceRenderer*
gnome_pie_pie_preview_slice_renderer_new (GnomePiePiePreviewRenderer* parent)
{
	return gnome_pie_pie_preview_slice_renderer_construct (GNOME_PIE_TYPE_PIE_PREVIEW_SLICE_RENDERER, parent);
}

void
gnome_pie_pie_preview_slice_renderer_load (GnomePiePiePreviewSliceRenderer* self,
                                           GnomePieActionGroup* group)
{
	gboolean _tmp0_ = FALSE;
	g_return_if_fail (self != NULL);
	g_return_if_fail (group != NULL);
	gnome_pie_pie_preview_slice_renderer_set_action_group (self, group);
	if (g_type_depth (G_TYPE_FROM_INSTANCE ((GObject*) group)) == ((guint) 2)) {
		GeeArrayList* _tmp1_;
		GeeArrayList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		_tmp1_ = gnome_pie_action_group_get_actions (group);
		_tmp2_ = _tmp1_;
		_tmp3_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_tmp0_ = _tmp4_ > 0;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GeeArrayList* _tmp5_;
		GeeArrayList* _tmp6_;
		gpointer _tmp7_;
		GnomePieAction* _tmp8_;
		const gchar* _tmp9_;
		const gchar* _tmp10_;
		GnomePieIcon* _tmp11_;
		GnomePieIcon* _tmp12_;
		GeeArrayList* _tmp13_;
		GeeArrayList* _tmp14_;
		gpointer _tmp15_;
		GnomePieAction* _tmp16_;
		const gchar* _tmp17_;
		const gchar* _tmp18_;
		_tmp5_ = gnome_pie_action_group_get_actions (group);
		_tmp6_ = _tmp5_;
		_tmp7_ = gee_abstract_list_get ((GeeAbstractList*) _tmp6_, 0);
		_tmp8_ = (GnomePieAction*) _tmp7_;
		_tmp9_ = gnome_pie_action_get_icon (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = gnome_pie_icon_new (_tmp10_, (gint) (GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_radius * 2));
		_tmp12_ = _tmp11_;
		gnome_pie_pie_preview_slice_renderer_set_icon (self, _tmp12_);
		_g_object_unref0 (_tmp12_);
		_g_object_unref0 (_tmp8_);
		_tmp13_ = gnome_pie_action_group_get_actions (group);
		_tmp14_ = _tmp13_;
		_tmp15_ = gee_abstract_list_get ((GeeAbstractList*) _tmp14_, 0);
		_tmp16_ = (GnomePieAction*) _tmp15_;
		_tmp17_ = gnome_pie_action_get_name (_tmp16_);
		_tmp18_ = _tmp17_;
		gnome_pie_pie_preview_slice_renderer_set_name (self, _tmp18_);
		_g_object_unref0 (_tmp16_);
	} else {
		GeeHashMap* _tmp19_;
		GeeHashMap* _tmp20_;
		const gchar* _tmp21_;
		gpointer _tmp22_;
		GnomePieGroupRegistryTypeDescription* _tmp23_;
		const gchar* _tmp24_;
		const gchar* _tmp25_;
		GnomePieIcon* _tmp26_;
		GnomePieIcon* _tmp27_;
		GeeHashMap* _tmp28_;
		GeeHashMap* _tmp29_;
		const gchar* _tmp30_;
		gpointer _tmp31_;
		GnomePieGroupRegistryTypeDescription* _tmp32_;
		const gchar* _tmp33_;
		const gchar* _tmp34_;
		_tmp19_ = gnome_pie_group_registry_get_descriptions ();
		_tmp20_ = _tmp19_;
		_tmp21_ = g_type_name (G_TYPE_FROM_INSTANCE ((GObject*) group));
		_tmp22_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp20_, _tmp21_);
		_tmp23_ = (GnomePieGroupRegistryTypeDescription*) _tmp22_;
		_tmp24_ = gnome_pie_group_registry_typedescription_get_icon (_tmp23_);
		_tmp25_ = _tmp24_;
		_tmp26_ = gnome_pie_icon_new (_tmp25_, (gint) (GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_radius * 2));
		_tmp27_ = _tmp26_;
		gnome_pie_pie_preview_slice_renderer_set_icon (self, _tmp27_);
		_g_object_unref0 (_tmp27_);
		_gnome_pie_group_registry_typedescription_unref0 (_tmp23_);
		_tmp28_ = gnome_pie_group_registry_get_descriptions ();
		_tmp29_ = _tmp28_;
		_tmp30_ = g_type_name (G_TYPE_FROM_INSTANCE ((GObject*) group));
		_tmp31_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp29_, _tmp30_);
		_tmp32_ = (GnomePieGroupRegistryTypeDescription*) _tmp31_;
		_tmp33_ = gnome_pie_group_registry_typedescription_get_name (_tmp32_);
		_tmp34_ = _tmp33_;
		gnome_pie_pie_preview_slice_renderer_set_name (self, _tmp34_);
		_gnome_pie_group_registry_typedescription_unref0 (_tmp32_);
	}
}

void
gnome_pie_pie_preview_slice_renderer_set_position (GnomePiePiePreviewSliceRenderer* self,
                                                   gint position,
                                                   gboolean smoothly)
{
	gdouble direction = 0.0;
	GnomePiePiePreviewRenderer* _tmp0_;
	GnomePieAnimatedValue* _tmp1_;
	gdouble _tmp2_;
	gdouble _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->parent;
	direction = ((2.0 * G_PI) * position) / gnome_pie_pie_preview_renderer_slice_count (_tmp0_);
	_tmp1_ = self->priv->angle;
	_tmp2_ = gnome_pie_animated_value_get_end (_tmp1_);
	_tmp3_ = _tmp2_;
	if (direction != _tmp3_) {
		gdouble _tmp4_ = 0.0;
		GnomePieAnimatedValue* _tmp5_;
		self->priv->position = position;
		if (smoothly) {
			_tmp4_ = 0.5;
		} else {
			_tmp4_ = 0.0;
		}
		_tmp5_ = self->priv->angle;
		gnome_pie_animated_value_reset_target (_tmp5_, direction, _tmp4_);
		if (!smoothly) {
			GnomePieAnimatedValue* _tmp6_;
			_tmp6_ = self->priv->angle;
			gnome_pie_animated_value_update (_tmp6_, 1.0);
		}
	}
}

void
gnome_pie_pie_preview_slice_renderer_set_size (GnomePiePiePreviewSliceRenderer* self,
                                               gdouble size)
{
	GnomePieAnimatedValue* _tmp0_;
	GnomePiePiePreviewDeleteSign* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->size;
	gnome_pie_animated_value_reset_target (_tmp0_, size, 0.5);
	_tmp1_ = self->priv->delete_sign;
	gnome_pie_pie_preview_delete_sign_set_size (_tmp1_, size);
}

void
gnome_pie_pie_preview_slice_renderer_disable_quickactions (GnomePiePiePreviewSliceRenderer* self)
{
	GnomePieActionGroup* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_action_group;
	gnome_pie_action_group_disable_quickactions (_tmp0_);
}

void
gnome_pie_pie_preview_slice_renderer_draw (GnomePiePiePreviewSliceRenderer* self,
                                           gdouble frame_time,
                                           cairo_t* ctx)
{
	GnomePieAnimatedValue* _tmp0_;
	GnomePieAnimatedValue* _tmp1_;
	GnomePieAnimatedValue* _tmp2_;
	GnomePieAnimatedValue* _tmp3_;
	GnomePieAnimatedValue* _tmp4_;
	gdouble _tmp5_;
	gdouble _tmp6_;
	GnomePieAnimatedValue* _tmp7_;
	gdouble _tmp8_;
	gdouble _tmp9_;
	gdouble scale = 0.0;
	GnomePieAnimatedValue* _tmp10_;
	gdouble _tmp11_;
	gdouble _tmp12_;
	GnomePieAnimatedValue* _tmp13_;
	gdouble _tmp14_;
	gdouble _tmp15_;
	GnomePieAnimatedValue* _tmp16_;
	gdouble _tmp17_;
	gdouble _tmp18_;
	GnomePieIcon* _tmp19_;
	GnomePieAnimatedValue* _tmp20_;
	gdouble _tmp21_;
	gdouble _tmp22_;
	GnomePieAnimatedValue* _tmp23_;
	gdouble _tmp24_;
	gdouble _tmp25_;
	GnomePiePiePreviewDeleteSign* _tmp26_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (ctx != NULL);
	_tmp0_ = self->priv->size;
	gnome_pie_animated_value_update (_tmp0_, frame_time);
	_tmp1_ = self->priv->angle;
	gnome_pie_animated_value_update (_tmp1_, frame_time);
	_tmp2_ = self->priv->activity;
	gnome_pie_animated_value_update (_tmp2_, frame_time);
	_tmp3_ = self->priv->clicked;
	gnome_pie_animated_value_update (_tmp3_, frame_time);
	cairo_save (ctx);
	_tmp4_ = self->priv->angle;
	_tmp5_ = gnome_pie_animated_value_get_val (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = self->priv->angle;
	_tmp8_ = gnome_pie_animated_value_get_val (_tmp7_);
	_tmp9_ = _tmp8_;
	cairo_translate (ctx, cos (_tmp6_) * GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_pie_radius, sin (_tmp9_) * GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_pie_radius);
	_tmp10_ = self->priv->size;
	_tmp11_ = gnome_pie_animated_value_get_val (_tmp10_);
	_tmp12_ = _tmp11_;
	_tmp13_ = self->priv->clicked;
	_tmp14_ = gnome_pie_animated_value_get_val (_tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = self->priv->activity;
	_tmp17_ = gnome_pie_animated_value_get_val (_tmp16_);
	_tmp18_ = _tmp17_;
	scale = ((_tmp12_ * _tmp15_) + (_tmp18_ * 0.1)) - 0.1;
	cairo_save (ctx);
	cairo_scale (ctx, scale, scale);
	_tmp19_ = self->priv->_icon;
	gnome_pie_image_paint_on ((GnomePieImage*) _tmp19_, ctx, 1.0);
	cairo_restore (ctx);
	_tmp20_ = self->priv->size;
	_tmp21_ = gnome_pie_animated_value_get_val (_tmp20_);
	_tmp22_ = _tmp21_;
	_tmp23_ = self->priv->size;
	_tmp24_ = gnome_pie_animated_value_get_val (_tmp23_);
	_tmp25_ = _tmp24_;
	cairo_translate (ctx, GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_delete_x * _tmp22_, GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_delete_y * _tmp25_);
	_tmp26_ = self->priv->delete_sign;
	gnome_pie_pie_preview_delete_sign_draw (_tmp26_, frame_time, ctx);
	cairo_restore (ctx);
}

gboolean
gnome_pie_pie_preview_slice_renderer_on_mouse_move (GnomePiePiePreviewSliceRenderer* self,
                                                    gdouble angle,
                                                    gdouble x,
                                                    gdouble y)
{
	gdouble direction = 0.0;
	GnomePiePiePreviewRenderer* _tmp0_;
	gdouble diff = 0.0;
	gboolean active = FALSE;
	GnomePiePiePreviewRenderer* _tmp1_;
	GnomePieAnimatedValue* _tmp6_;
	gdouble _tmp7_;
	gdouble _tmp8_;
	gdouble own_x = 0.0;
	GnomePieAnimatedValue* _tmp10_;
	gdouble _tmp11_;
	gdouble _tmp12_;
	gdouble own_y = 0.0;
	GnomePieAnimatedValue* _tmp13_;
	gdouble _tmp14_;
	gdouble _tmp15_;
	GnomePiePiePreviewDeleteSign* _tmp16_;
	GnomePieAnimatedValue* _tmp17_;
	gdouble _tmp18_;
	gdouble _tmp19_;
	GnomePieAnimatedValue* _tmp20_;
	gdouble _tmp21_;
	gdouble _tmp22_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->parent;
	direction = ((2.0 * G_PI) * self->priv->position) / gnome_pie_pie_preview_renderer_slice_count (_tmp0_);
	diff = fabs (angle - direction);
	if (diff > G_PI) {
		diff = (2 * G_PI) - diff;
	}
	_tmp1_ = self->priv->parent;
	active = diff < ((0.5 * G_PI) / gnome_pie_pie_preview_renderer_slice_count (_tmp1_));
	if (active) {
		GnomePieAnimatedValue* _tmp2_;
		GnomePiePiePreviewDeleteSign* _tmp3_;
		_tmp2_ = self->priv->activity;
		gnome_pie_animated_value_reset_target (_tmp2_, 1.0, 0.3);
		_tmp3_ = self->priv->delete_sign;
		gnome_pie_pie_preview_delete_sign_show (_tmp3_);
	} else {
		GnomePieAnimatedValue* _tmp4_;
		GnomePiePiePreviewDeleteSign* _tmp5_;
		_tmp4_ = self->priv->activity;
		gnome_pie_animated_value_reset_target (_tmp4_, 0.0, 0.3);
		_tmp5_ = self->priv->delete_sign;
		gnome_pie_pie_preview_delete_sign_hide (_tmp5_);
	}
	_tmp6_ = self->priv->clicked;
	_tmp7_ = gnome_pie_animated_value_get_end (_tmp6_);
	_tmp8_ = _tmp7_;
	if (_tmp8_ == 0.9) {
		gdouble dist = 0.0;
		dist = pow (x - self->priv->clicked_x, (gdouble) 2) + pow (y - self->priv->clicked_y, (gdouble) 2);
		if (dist > (GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_click_cancel_treshold * GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_click_cancel_treshold)) {
			GnomePieAnimatedValue* _tmp9_;
			_tmp9_ = self->priv->clicked;
			gnome_pie_animated_value_reset_target (_tmp9_, 1.0, 0.1);
		}
	}
	_tmp10_ = self->priv->angle;
	_tmp11_ = gnome_pie_animated_value_get_val (_tmp10_);
	_tmp12_ = _tmp11_;
	own_x = cos (_tmp12_) * GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_pie_radius;
	_tmp13_ = self->priv->angle;
	_tmp14_ = gnome_pie_animated_value_get_val (_tmp13_);
	_tmp15_ = _tmp14_;
	own_y = sin (_tmp15_) * GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_pie_radius;
	_tmp16_ = self->priv->delete_sign;
	_tmp17_ = self->priv->size;
	_tmp18_ = gnome_pie_animated_value_get_val (_tmp17_);
	_tmp19_ = _tmp18_;
	_tmp20_ = self->priv->size;
	_tmp21_ = gnome_pie_animated_value_get_val (_tmp20_);
	_tmp22_ = _tmp21_;
	gnome_pie_pie_preview_slice_renderer_set_delete_hovered (self, gnome_pie_pie_preview_delete_sign_on_mouse_move (_tmp16_, (x - own_x) - (GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_delete_x * _tmp19_), (y - own_y) - (GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_delete_y * _tmp22_)));
	result = active;
	return result;
}

void
gnome_pie_pie_preview_slice_renderer_on_mouse_leave (GnomePiePiePreviewSliceRenderer* self)
{
	GnomePieAnimatedValue* _tmp0_;
	GnomePiePiePreviewDeleteSign* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->activity;
	gnome_pie_animated_value_reset_target (_tmp0_, 0.0, 0.3);
	_tmp1_ = self->priv->delete_sign;
	gnome_pie_pie_preview_delete_sign_hide (_tmp1_);
}

void
gnome_pie_pie_preview_slice_renderer_on_button_press (GnomePiePiePreviewSliceRenderer* self,
                                                      gdouble x,
                                                      gdouble y)
{
	gboolean delete_pressed = FALSE;
	GnomePieAnimatedValue* _tmp0_;
	gdouble _tmp1_;
	gdouble _tmp2_;
	gboolean _tmp16_ = FALSE;
	g_return_if_fail (self != NULL);
	delete_pressed = FALSE;
	_tmp0_ = self->priv->activity;
	_tmp1_ = gnome_pie_animated_value_get_end (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ == 1.0) {
		gdouble own_x = 0.0;
		GnomePieAnimatedValue* _tmp3_;
		gdouble _tmp4_;
		gdouble _tmp5_;
		gdouble own_y = 0.0;
		GnomePieAnimatedValue* _tmp6_;
		gdouble _tmp7_;
		gdouble _tmp8_;
		GnomePiePiePreviewDeleteSign* _tmp9_;
		GnomePieAnimatedValue* _tmp10_;
		gdouble _tmp11_;
		gdouble _tmp12_;
		GnomePieAnimatedValue* _tmp13_;
		gdouble _tmp14_;
		gdouble _tmp15_;
		_tmp3_ = self->priv->angle;
		_tmp4_ = gnome_pie_animated_value_get_val (_tmp3_);
		_tmp5_ = _tmp4_;
		own_x = cos (_tmp5_) * GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_pie_radius;
		_tmp6_ = self->priv->angle;
		_tmp7_ = gnome_pie_animated_value_get_val (_tmp6_);
		_tmp8_ = _tmp7_;
		own_y = sin (_tmp8_) * GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_pie_radius;
		_tmp9_ = self->priv->delete_sign;
		_tmp10_ = self->priv->size;
		_tmp11_ = gnome_pie_animated_value_get_val (_tmp10_);
		_tmp12_ = _tmp11_;
		_tmp13_ = self->priv->size;
		_tmp14_ = gnome_pie_animated_value_get_val (_tmp13_);
		_tmp15_ = _tmp14_;
		delete_pressed = gnome_pie_pie_preview_delete_sign_on_button_press (_tmp9_, (x - own_x) - (GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_delete_x * _tmp12_), (y - own_y) - (GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_delete_y * _tmp15_));
	}
	if (!delete_pressed) {
		GnomePieAnimatedValue* _tmp17_;
		gdouble _tmp18_;
		gdouble _tmp19_;
		_tmp17_ = self->priv->activity;
		_tmp18_ = gnome_pie_animated_value_get_end (_tmp17_);
		_tmp19_ = _tmp18_;
		_tmp16_ = _tmp19_ == 1.0;
	} else {
		_tmp16_ = FALSE;
	}
	if (_tmp16_) {
		GnomePieAnimatedValue* _tmp20_;
		_tmp20_ = self->priv->clicked;
		gnome_pie_animated_value_reset_target (_tmp20_, 0.9, 0.1);
		self->priv->clicked_x = x;
		self->priv->clicked_y = y;
	}
}

void
gnome_pie_pie_preview_slice_renderer_on_button_release (GnomePiePiePreviewSliceRenderer* self,
                                                        gdouble x,
                                                        gdouble y)
{
	gboolean deleted = FALSE;
	GnomePieAnimatedValue* _tmp0_;
	gdouble _tmp1_;
	gdouble _tmp2_;
	gboolean _tmp4_ = FALSE;
	g_return_if_fail (self != NULL);
	deleted = FALSE;
	_tmp0_ = self->priv->activity;
	_tmp1_ = gnome_pie_animated_value_get_end (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ == 1.0) {
		GnomePiePiePreviewDeleteSign* _tmp3_;
		_tmp3_ = self->priv->delete_sign;
		deleted = gnome_pie_pie_preview_delete_sign_on_button_release (_tmp3_, x, y);
	}
	if (!deleted) {
		GnomePieAnimatedValue* _tmp5_;
		gdouble _tmp6_;
		gdouble _tmp7_;
		_tmp5_ = self->priv->clicked;
		_tmp6_ = gnome_pie_animated_value_get_end (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp4_ = _tmp7_ == 0.9;
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		GnomePieAnimatedValue* _tmp8_;
		_tmp8_ = self->priv->clicked;
		gnome_pie_animated_value_reset_target (_tmp8_, 1.0, 0.1);
		g_signal_emit (self, gnome_pie_pie_preview_slice_renderer_signals[GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_ON_CLICKED_SIGNAL], 0, self->priv->position);
	}
}

GnomePieIcon*
gnome_pie_pie_preview_slice_renderer_get_icon (GnomePiePiePreviewSliceRenderer* self)
{
	GnomePieIcon* result;
	GnomePieIcon* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_icon;
	result = _tmp0_;
	return result;
}

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

static void
gnome_pie_pie_preview_slice_renderer_set_icon (GnomePiePiePreviewSliceRenderer* self,
                                               GnomePieIcon* value)
{
	GnomePieIcon* old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_pie_preview_slice_renderer_get_icon (self);
	if (old_value != value) {
		GnomePieIcon* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_icon);
		self->priv->_icon = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_pie_preview_slice_renderer_properties[GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_ICON_PROPERTY]);
	}
}

GnomePieActionGroup*
gnome_pie_pie_preview_slice_renderer_get_action_group (GnomePiePiePreviewSliceRenderer* self)
{
	GnomePieActionGroup* result;
	GnomePieActionGroup* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_action_group;
	result = _tmp0_;
	return result;
}

static void
gnome_pie_pie_preview_slice_renderer_set_action_group (GnomePiePiePreviewSliceRenderer* self,
                                                       GnomePieActionGroup* value)
{
	GnomePieActionGroup* old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_pie_preview_slice_renderer_get_action_group (self);
	if (old_value != value) {
		GnomePieActionGroup* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_action_group);
		self->priv->_action_group = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_pie_preview_slice_renderer_properties[GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_ACTION_GROUP_PROPERTY]);
	}
}

const gchar*
gnome_pie_pie_preview_slice_renderer_get_name (GnomePiePiePreviewSliceRenderer* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_name;
	result = _tmp0_;
	return result;
}

static void
gnome_pie_pie_preview_slice_renderer_set_name (GnomePiePiePreviewSliceRenderer* self,
                                               const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_pie_preview_slice_renderer_get_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_name);
		self->priv->_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_pie_preview_slice_renderer_properties[GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_NAME_PROPERTY]);
	}
}

gboolean
gnome_pie_pie_preview_slice_renderer_get_delete_hovered (GnomePiePiePreviewSliceRenderer* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_delete_hovered;
	return result;
}

static void
gnome_pie_pie_preview_slice_renderer_set_delete_hovered (GnomePiePiePreviewSliceRenderer* self,
                                                         gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_pie_preview_slice_renderer_get_delete_hovered (self);
	if (old_value != value) {
		self->priv->_delete_hovered = value;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_pie_preview_slice_renderer_properties[GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_DELETE_HOVERED_PROPERTY]);
	}
}

static void
gnome_pie_pie_preview_slice_renderer_class_init (GnomePiePiePreviewSliceRendererClass * klass,
                                                 gpointer klass_data)
{
	gnome_pie_pie_preview_slice_renderer_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GnomePiePiePreviewSliceRenderer_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_gnome_pie_pie_preview_slice_renderer_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gnome_pie_pie_preview_slice_renderer_set_property;
	G_OBJECT_CLASS (klass)->finalize = gnome_pie_pie_preview_slice_renderer_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_ICON_PROPERTY, gnome_pie_pie_preview_slice_renderer_properties[GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_ICON_PROPERTY] = g_param_spec_object ("icon", "icon", "icon", GNOME_PIE_TYPE_ICON, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_ACTION_GROUP_PROPERTY, gnome_pie_pie_preview_slice_renderer_properties[GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_ACTION_GROUP_PROPERTY] = g_param_spec_object ("action-group", "action-group", "action-group", GNOME_PIE_TYPE_ACTION_GROUP, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_NAME_PROPERTY, gnome_pie_pie_preview_slice_renderer_properties[GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_NAME_PROPERTY] = g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_DELETE_HOVERED_PROPERTY, gnome_pie_pie_preview_slice_renderer_properties[GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_DELETE_HOVERED_PROPERTY] = g_param_spec_boolean ("delete-hovered", "delete-hovered", "delete-hovered", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	gnome_pie_pie_preview_slice_renderer_signals[GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_ON_CLICKED_SIGNAL] = g_signal_new ("on-clicked", GNOME_PIE_TYPE_PIE_PREVIEW_SLICE_RENDERER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
	gnome_pie_pie_preview_slice_renderer_signals[GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_ON_REMOVE_SIGNAL] = g_signal_new ("on-remove", GNOME_PIE_TYPE_PIE_PREVIEW_SLICE_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_slice_renderer_instance_init (GnomePiePiePreviewSliceRenderer * self,
                                                    gpointer klass)
{
	gchar* _tmp0_;
	self->priv = gnome_pie_pie_preview_slice_renderer_get_instance_private (self);
	_tmp0_ = g_strdup ("");
	self->priv->_name = _tmp0_;
	self->priv->_delete_hovered = FALSE;
	self->priv->delete_sign = NULL;
	self->priv->clicked_x = 0.0;
	self->priv->clicked_y = 0.0;
}

static void
gnome_pie_pie_preview_slice_renderer_finalize (GObject * obj)
{
	GnomePiePiePreviewSliceRenderer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GNOME_PIE_TYPE_PIE_PREVIEW_SLICE_RENDERER, GnomePiePiePreviewSliceRenderer);
	_g_object_unref0 (self->priv->_icon);
	_g_object_unref0 (self->priv->_action_group);
	_g_free0 (self->priv->_name);
	_g_object_unref0 (self->priv->delete_sign);
	_g_object_unref0 (self->priv->angle);
	_g_object_unref0 (self->priv->size);
	_g_object_unref0 (self->priv->activity);
	_g_object_unref0 (self->priv->clicked);
	G_OBJECT_CLASS (gnome_pie_pie_preview_slice_renderer_parent_class)->finalize (obj);
}

static GType
gnome_pie_pie_preview_slice_renderer_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GnomePiePiePreviewSliceRendererClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gnome_pie_pie_preview_slice_renderer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GnomePiePiePreviewSliceRenderer), 0, (GInstanceInitFunc) gnome_pie_pie_preview_slice_renderer_instance_init, NULL };
	GType gnome_pie_pie_preview_slice_renderer_type_id;
	gnome_pie_pie_preview_slice_renderer_type_id = g_type_register_static (G_TYPE_OBJECT, "GnomePiePiePreviewSliceRenderer", &g_define_type_info, 0);
	GnomePiePiePreviewSliceRenderer_private_offset = g_type_add_instance_private (gnome_pie_pie_preview_slice_renderer_type_id, sizeof (GnomePiePiePreviewSliceRendererPrivate));
	return gnome_pie_pie_preview_slice_renderer_type_id;
}

GType
gnome_pie_pie_preview_slice_renderer_get_type (void)
{
	static volatile gsize gnome_pie_pie_preview_slice_renderer_type_id__once = 0;
	if (g_once_init_enter (&gnome_pie_pie_preview_slice_renderer_type_id__once)) {
		GType gnome_pie_pie_preview_slice_renderer_type_id;
		gnome_pie_pie_preview_slice_renderer_type_id = gnome_pie_pie_preview_slice_renderer_get_type_once ();
		g_once_init_leave (&gnome_pie_pie_preview_slice_renderer_type_id__once, gnome_pie_pie_preview_slice_renderer_type_id);
	}
	return gnome_pie_pie_preview_slice_renderer_type_id__once;
}

static void
_vala_gnome_pie_pie_preview_slice_renderer_get_property (GObject * object,
                                                         guint property_id,
                                                         GValue * value,
                                                         GParamSpec * pspec)
{
	GnomePiePiePreviewSliceRenderer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GNOME_PIE_TYPE_PIE_PREVIEW_SLICE_RENDERER, GnomePiePiePreviewSliceRenderer);
	switch (property_id) {
		case GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_ICON_PROPERTY:
		g_value_set_object (value, gnome_pie_pie_preview_slice_renderer_get_icon (self));
		break;
		case GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_ACTION_GROUP_PROPERTY:
		g_value_set_object (value, gnome_pie_pie_preview_slice_renderer_get_action_group (self));
		break;
		case GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_NAME_PROPERTY:
		g_value_set_string (value, gnome_pie_pie_preview_slice_renderer_get_name (self));
		break;
		case GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_DELETE_HOVERED_PROPERTY:
		g_value_set_boolean (value, gnome_pie_pie_preview_slice_renderer_get_delete_hovered (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gnome_pie_pie_preview_slice_renderer_set_property (GObject * object,
                                                         guint property_id,
                                                         const GValue * value,
                                                         GParamSpec * pspec)
{
	GnomePiePiePreviewSliceRenderer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GNOME_PIE_TYPE_PIE_PREVIEW_SLICE_RENDERER, GnomePiePiePreviewSliceRenderer);
	switch (property_id) {
		case GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_ICON_PROPERTY:
		gnome_pie_pie_preview_slice_renderer_set_icon (self, g_value_get_object (value));
		break;
		case GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_ACTION_GROUP_PROPERTY:
		gnome_pie_pie_preview_slice_renderer_set_action_group (self, g_value_get_object (value));
		break;
		case GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_NAME_PROPERTY:
		gnome_pie_pie_preview_slice_renderer_set_name (self, g_value_get_string (value));
		break;
		case GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_DELETE_HOVERED_PROPERTY:
		gnome_pie_pie_preview_slice_renderer_set_delete_hovered (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

