/* piePreviewAddSign.c generated by valac 0.56.18, the Vala compiler
 * generated from piePreviewAddSign.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 <glib.h>
#include <float.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <cairo-gobject.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_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;
typedef struct _GnomePiePiePreviewAddSignPrivate GnomePiePiePreviewAddSignPrivate;

#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_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_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_ADD_SIGN_0_PROPERTY,
	GNOME_PIE_PIE_PREVIEW_ADD_SIGN_ICON_PROPERTY,
	GNOME_PIE_PIE_PREVIEW_ADD_SIGN_VISIBLE_PROPERTY,
	GNOME_PIE_PIE_PREVIEW_ADD_SIGN_NUM_PROPERTIES
};
static GParamSpec* gnome_pie_pie_preview_add_sign_properties[GNOME_PIE_PIE_PREVIEW_ADD_SIGN_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (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_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;
enum  {
	GNOME_PIE_PIE_PREVIEW_ADD_SIGN_ON_CLICKED_SIGNAL,
	GNOME_PIE_PIE_PREVIEW_ADD_SIGN_NUM_SIGNALS
};
static guint gnome_pie_pie_preview_add_sign_signals[GNOME_PIE_PIE_PREVIEW_ADD_SIGN_NUM_SIGNALS] = {0};

struct _GnomePiePiePreviewAddSign {
	GObject parent_instance;
	GnomePiePiePreviewAddSignPrivate * priv;
};

struct _GnomePiePiePreviewAddSignClass {
	GObjectClass parent_class;
};

struct _GnomePiePiePreviewAddSignPrivate {
	GnomePieImage* _icon;
	gboolean _visible;
	gdouble position;
	GnomePiePiePreviewRenderer* parent;
	gdouble time;
	gdouble max_size;
	gdouble angle;
	GnomePieAnimatedValue* size;
	GnomePieAnimatedValue* alpha;
	GnomePieAnimatedValue* activity;
	GnomePieAnimatedValue* clicked;
};

static gint GnomePiePiePreviewAddSign_private_offset;
static gpointer gnome_pie_pie_preview_add_sign_parent_class = NULL;

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_image_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieImage, 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_animated_value_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieAnimatedValue, g_object_unref)
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 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_add_sign_load (GnomePiePiePreviewAddSign* 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 GType gnome_pie_icon_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieIcon, g_object_unref)
static void gnome_pie_pie_preview_add_sign_set_icon (GnomePiePiePreviewAddSign* self,
                                              GnomePieImage* value);
VALA_EXTERN void gnome_pie_pie_preview_add_sign_set_position (GnomePiePiePreviewAddSign* self,
                                                  gint position);
VALA_EXTERN gboolean gnome_pie_pie_preview_renderer_get_drag_n_drop_mode (GnomePiePiePreviewRenderer* self);
VALA_EXTERN gint gnome_pie_pie_preview_renderer_slice_count (GnomePiePiePreviewRenderer* self);
VALA_EXTERN void gnome_pie_pie_preview_add_sign_show (GnomePiePiePreviewAddSign* self);
static void gnome_pie_pie_preview_add_sign_set_visible (GnomePiePiePreviewAddSign* self,
                                                 gboolean value);
VALA_EXTERN void gnome_pie_animated_value_reset_target (GnomePieAnimatedValue* self,
                                            gdouble end,
                                            gdouble duration);
VALA_EXTERN void gnome_pie_pie_preview_add_sign_hide (GnomePiePiePreviewAddSign* self);
VALA_EXTERN void gnome_pie_pie_preview_add_sign_set_size (GnomePiePiePreviewAddSign* self,
                                              gdouble size);
VALA_EXTERN void gnome_pie_pie_preview_add_sign_draw (GnomePiePiePreviewAddSign* self,
                                          gdouble frame_time,
                                          cairo_t* ctx);
VALA_EXTERN void gnome_pie_animated_value_update (GnomePieAnimatedValue* self,
                                      gdouble time);
VALA_EXTERN gdouble gnome_pie_animated_value_get_val (GnomePieAnimatedValue* self);
VALA_EXTERN GnomePieImage* gnome_pie_pie_preview_add_sign_get_icon (GnomePiePiePreviewAddSign* self);
VALA_EXTERN void gnome_pie_image_paint_on (GnomePieImage* self,
                               cairo_t* ctx,
                               gdouble alpha);
VALA_EXTERN void gnome_pie_pie_preview_add_sign_on_mouse_move (GnomePiePiePreviewAddSign* self,
                                                   gdouble angle);
VALA_EXTERN void gnome_pie_pie_preview_add_sign_on_button_press (GnomePiePiePreviewAddSign* self,
                                                     gdouble x,
                                                     gdouble y);
VALA_EXTERN gdouble gnome_pie_animated_value_get_end (GnomePieAnimatedValue* self);
VALA_EXTERN void gnome_pie_pie_preview_add_sign_on_button_release (GnomePiePiePreviewAddSign* self,
                                                       gdouble x,
                                                       gdouble y);
VALA_EXTERN gboolean gnome_pie_pie_preview_add_sign_get_visible (GnomePiePiePreviewAddSign* self);
static void gnome_pie_pie_preview_add_sign_finalize (GObject * obj);
static GType gnome_pie_pie_preview_add_sign_get_type_once (void);
static void _vala_gnome_pie_pie_preview_add_sign_get_property (GObject * object,
                                                        guint property_id,
                                                        GValue * value,
                                                        GParamSpec * pspec);
static void _vala_gnome_pie_pie_preview_add_sign_set_property (GObject * object,
                                                        guint property_id,
                                                        const GValue * value,
                                                        GParamSpec * pspec);

static inline gpointer
gnome_pie_pie_preview_add_sign_get_instance_private (GnomePiePiePreviewAddSign* self)
{
	return G_STRUCT_MEMBER_P (self, GnomePiePiePreviewAddSign_private_offset);
}

GnomePiePiePreviewAddSign*
gnome_pie_pie_preview_add_sign_construct (GType object_type,
                                          GnomePiePiePreviewRenderer* parent)
{
	GnomePiePiePreviewAddSign * self = NULL;
	GnomePieAnimatedValue* _tmp0_;
	GnomePieAnimatedValue* _tmp1_;
	GnomePieAnimatedValue* _tmp2_;
	GnomePieAnimatedValue* _tmp3_;
	g_return_val_if_fail (parent != NULL, NULL);
	self = (GnomePiePiePreviewAddSign*) g_object_new (object_type, NULL);
	self->priv->parent = parent;
	_tmp0_ = gnome_pie_animated_value_new_cubic (GNOME_PIE_ANIMATED_VALUE_DIRECTION_OUT, (gdouble) 0, (gdouble) 0, (gdouble) 0, 2.0);
	_g_object_unref0 (self->priv->size);
	self->priv->size = _tmp0_;
	_tmp1_ = 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->alpha);
	self->priv->alpha = _tmp1_;
	_tmp2_ = gnome_pie_animated_value_new_cubic (GNOME_PIE_ANIMATED_VALUE_DIRECTION_OUT, (gdouble) -3, (gdouble) -3, (gdouble) 0, 0.0);
	_g_object_unref0 (self->priv->activity);
	self->priv->activity = _tmp2_;
	_tmp3_ = gnome_pie_animated_value_new_cubic (GNOME_PIE_ANIMATED_VALUE_DIRECTION_OUT, (gdouble) 1, (gdouble) 1, (gdouble) 0, 0.0);
	_g_object_unref0 (self->priv->clicked);
	self->priv->clicked = _tmp3_;
	return self;
}

GnomePiePiePreviewAddSign*
gnome_pie_pie_preview_add_sign_new (GnomePiePiePreviewRenderer* parent)
{
	return gnome_pie_pie_preview_add_sign_construct (GNOME_PIE_TYPE_PIE_PREVIEW_ADD_SIGN, parent);
}

void
gnome_pie_pie_preview_add_sign_load (GnomePiePiePreviewAddSign* self)
{
	GnomePieIcon* _tmp0_;
	GnomePieIcon* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gnome_pie_icon_new ("list-add", 36);
	_tmp1_ = _tmp0_;
	gnome_pie_pie_preview_add_sign_set_icon (self, (GnomePieImage*) _tmp1_);
	_g_object_unref0 (_tmp1_);
}

void
gnome_pie_pie_preview_add_sign_set_position (GnomePiePiePreviewAddSign* self,
                                             gint position)
{
	gdouble new_position = 0.0;
	GnomePiePiePreviewRenderer* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	GnomePiePiePreviewRenderer* _tmp3_;
	g_return_if_fail (self != NULL);
	new_position = (gdouble) position;
	_tmp0_ = self->priv->parent;
	_tmp1_ = gnome_pie_pie_preview_renderer_get_drag_n_drop_mode (_tmp0_);
	_tmp2_ = _tmp1_;
	if (!_tmp2_) {
		new_position += 0.5;
	}
	self->priv->position = new_position;
	_tmp3_ = self->priv->parent;
	self->priv->angle = ((2.0 * G_PI) * new_position) / gnome_pie_pie_preview_renderer_slice_count (_tmp3_);
}

void
gnome_pie_pie_preview_add_sign_show (GnomePiePiePreviewAddSign* self)
{
	GnomePieAnimatedValue* _tmp0_;
	GnomePieAnimatedValue* _tmp1_;
	g_return_if_fail (self != NULL);
	gnome_pie_pie_preview_add_sign_set_visible (self, TRUE);
	_tmp0_ = self->priv->size;
	gnome_pie_animated_value_reset_target (_tmp0_, self->priv->max_size, 0.3);
	_tmp1_ = self->priv->alpha;
	gnome_pie_animated_value_reset_target (_tmp1_, 1.0, 0.3);
}

void
gnome_pie_pie_preview_add_sign_hide (GnomePiePiePreviewAddSign* self)
{
	GnomePieAnimatedValue* _tmp0_;
	GnomePieAnimatedValue* _tmp1_;
	g_return_if_fail (self != NULL);
	gnome_pie_pie_preview_add_sign_set_visible (self, FALSE);
	_tmp0_ = self->priv->size;
	gnome_pie_animated_value_reset_target (_tmp0_, 0.0, 0.3);
	_tmp1_ = self->priv->alpha;
	gnome_pie_animated_value_reset_target (_tmp1_, 0.0, 0.3);
}

void
gnome_pie_pie_preview_add_sign_set_size (GnomePiePiePreviewAddSign* self,
                                         gdouble size)
{
	GnomePieAnimatedValue* _tmp0_;
	g_return_if_fail (self != NULL);
	self->priv->max_size = size;
	_tmp0_ = self->priv->size;
	gnome_pie_animated_value_reset_target (_tmp0_, size, 0.5);
}

void
gnome_pie_pie_preview_add_sign_draw (GnomePiePiePreviewAddSign* self,
                                     gdouble frame_time,
                                     cairo_t* ctx)
{
	GnomePieAnimatedValue* _tmp0_;
	GnomePieAnimatedValue* _tmp1_;
	GnomePieAnimatedValue* _tmp2_;
	GnomePieAnimatedValue* _tmp3_;
	GnomePiePiePreviewRenderer* _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (ctx != NULL);
	self->priv->time = self->priv->time + frame_time;
	_tmp0_ = self->priv->size;
	gnome_pie_animated_value_update (_tmp0_, frame_time);
	_tmp1_ = self->priv->alpha;
	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);
	_tmp4_ = self->priv->parent;
	if (gnome_pie_pie_preview_renderer_slice_count (_tmp4_) == 0) {
		gdouble scale = 0.0;
		GnomePieAnimatedValue* _tmp5_;
		gdouble _tmp6_;
		gdouble _tmp7_;
		GnomePieAnimatedValue* _tmp8_;
		gdouble _tmp9_;
		gdouble _tmp10_;
		GnomePieAnimatedValue* _tmp11_;
		gdouble _tmp12_;
		gdouble _tmp13_;
		GnomePieImage* _tmp14_;
		cairo_save (ctx);
		_tmp5_ = self->priv->clicked;
		_tmp6_ = gnome_pie_animated_value_get_val (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = self->priv->alpha;
		_tmp9_ = gnome_pie_animated_value_get_val (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = self->priv->alpha;
		_tmp12_ = gnome_pie_animated_value_get_val (_tmp11_);
		_tmp13_ = _tmp12_;
		scale = ((_tmp7_ + ((sin (self->priv->time * 10) * 0.02) * _tmp10_)) + (_tmp13_ * 0.08)) - 0.1;
		cairo_scale (ctx, scale, scale);
		_tmp14_ = self->priv->_icon;
		gnome_pie_image_paint_on (_tmp14_, ctx, 1.0);
		cairo_restore (ctx);
	} else {
		GnomePieAnimatedValue* _tmp15_;
		gdouble _tmp16_;
		gdouble _tmp17_;
		GnomePieAnimatedValue* _tmp18_;
		gdouble _tmp19_;
		gdouble _tmp20_;
		_tmp15_ = self->priv->alpha;
		_tmp16_ = gnome_pie_animated_value_get_val (_tmp15_);
		_tmp17_ = _tmp16_;
		_tmp18_ = self->priv->activity;
		_tmp19_ = gnome_pie_animated_value_get_val (_tmp18_);
		_tmp20_ = _tmp19_;
		if ((_tmp17_ * _tmp20_) > ((gdouble) 0)) {
			gdouble radius = 0.0;
			gdouble scale = 0.0;
			GnomePieAnimatedValue* _tmp21_;
			gdouble _tmp22_;
			gdouble _tmp23_;
			GnomePieAnimatedValue* _tmp24_;
			gdouble _tmp25_;
			gdouble _tmp26_;
			GnomePieAnimatedValue* _tmp27_;
			gdouble _tmp28_;
			gdouble _tmp29_;
			GnomePieAnimatedValue* _tmp30_;
			gdouble _tmp31_;
			gdouble _tmp32_;
			GnomePieImage* _tmp33_;
			GnomePieAnimatedValue* _tmp34_;
			gdouble _tmp35_;
			gdouble _tmp36_;
			GnomePieAnimatedValue* _tmp37_;
			gdouble _tmp38_;
			gdouble _tmp39_;
			cairo_save (ctx);
			radius = (gdouble) 120;
			cairo_translate (ctx, cos (self->priv->angle) * radius, sin (self->priv->angle) * radius);
			_tmp21_ = self->priv->size;
			_tmp22_ = gnome_pie_animated_value_get_val (_tmp21_);
			_tmp23_ = _tmp22_;
			_tmp24_ = self->priv->clicked;
			_tmp25_ = gnome_pie_animated_value_get_val (_tmp24_);
			_tmp26_ = _tmp25_;
			_tmp27_ = self->priv->activity;
			_tmp28_ = gnome_pie_animated_value_get_val (_tmp27_);
			_tmp29_ = _tmp28_;
			_tmp30_ = self->priv->activity;
			_tmp31_ = gnome_pie_animated_value_get_val (_tmp30_);
			_tmp32_ = _tmp31_;
			scale = (((_tmp23_ * _tmp26_) + (_tmp29_ * 0.07)) + ((sin (self->priv->time * 10) * 0.03) * _tmp32_)) - 0.1;
			cairo_scale (ctx, scale, scale);
			_tmp33_ = self->priv->_icon;
			_tmp34_ = self->priv->alpha;
			_tmp35_ = gnome_pie_animated_value_get_val (_tmp34_);
			_tmp36_ = _tmp35_;
			_tmp37_ = self->priv->activity;
			_tmp38_ = gnome_pie_animated_value_get_val (_tmp37_);
			_tmp39_ = _tmp38_;
			gnome_pie_image_paint_on (_tmp33_, ctx, _tmp36_ * _tmp39_);
			cairo_restore (ctx);
		}
	}
}

void
gnome_pie_pie_preview_add_sign_on_mouse_move (GnomePiePiePreviewAddSign* self,
                                              gdouble angle)
{
	GnomePiePiePreviewRenderer* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->parent;
	if (gnome_pie_pie_preview_renderer_slice_count (_tmp0_) > 0) {
		gdouble direction = 0.0;
		GnomePiePiePreviewRenderer* _tmp1_;
		gdouble diff = 0.0;
		GnomePiePiePreviewRenderer* _tmp2_;
		_tmp1_ = self->priv->parent;
		direction = ((2.0 * G_PI) * self->priv->position) / gnome_pie_pie_preview_renderer_slice_count (_tmp1_);
		diff = fabs (angle - direction);
		if (diff > G_PI) {
			diff = (2 * G_PI) - diff;
		}
		_tmp2_ = self->priv->parent;
		if (diff < ((0.5 * G_PI) / gnome_pie_pie_preview_renderer_slice_count (_tmp2_))) {
			GnomePieAnimatedValue* _tmp3_;
			_tmp3_ = self->priv->activity;
			gnome_pie_animated_value_reset_target (_tmp3_, 1.0, 1.0);
		} else {
			GnomePieAnimatedValue* _tmp4_;
			_tmp4_ = self->priv->activity;
			gnome_pie_animated_value_reset_target (_tmp4_, -3.0, 1.5);
		}
	} else {
		GnomePieAnimatedValue* _tmp5_;
		_tmp5_ = self->priv->activity;
		gnome_pie_animated_value_reset_target (_tmp5_, 1.0, 1.0);
	}
}

void
gnome_pie_pie_preview_add_sign_on_button_press (GnomePiePiePreviewAddSign* self,
                                                gdouble x,
                                                gdouble y)
{
	GnomePieAnimatedValue* _tmp0_;
	gdouble _tmp1_;
	gdouble _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->activity;
	_tmp1_ = gnome_pie_animated_value_get_end (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ == 1.0) {
		GnomePieAnimatedValue* _tmp3_;
		_tmp3_ = self->priv->clicked;
		gnome_pie_animated_value_reset_target (_tmp3_, 0.9, 0.1);
	}
}

void
gnome_pie_pie_preview_add_sign_on_button_release (GnomePiePiePreviewAddSign* self,
                                                  gdouble x,
                                                  gdouble y)
{
	GnomePieAnimatedValue* _tmp0_;
	gdouble _tmp1_;
	gdouble _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->clicked;
	_tmp1_ = gnome_pie_animated_value_get_end (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ == 0.9) {
		GnomePieAnimatedValue* _tmp3_;
		g_signal_emit (self, gnome_pie_pie_preview_add_sign_signals[GNOME_PIE_PIE_PREVIEW_ADD_SIGN_ON_CLICKED_SIGNAL], 0, (gint) self->priv->position);
		_tmp3_ = self->priv->clicked;
		gnome_pie_animated_value_reset_target (_tmp3_, 1.0, 0.1);
	}
}

GnomePieImage*
gnome_pie_pie_preview_add_sign_get_icon (GnomePiePiePreviewAddSign* self)
{
	GnomePieImage* result;
	GnomePieImage* _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_add_sign_set_icon (GnomePiePiePreviewAddSign* self,
                                         GnomePieImage* value)
{
	GnomePieImage* old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_pie_preview_add_sign_get_icon (self);
	if (old_value != value) {
		GnomePieImage* _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_add_sign_properties[GNOME_PIE_PIE_PREVIEW_ADD_SIGN_ICON_PROPERTY]);
	}
}

gboolean
gnome_pie_pie_preview_add_sign_get_visible (GnomePiePiePreviewAddSign* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_visible;
	return result;
}

static void
gnome_pie_pie_preview_add_sign_set_visible (GnomePiePiePreviewAddSign* self,
                                            gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_pie_preview_add_sign_get_visible (self);
	if (old_value != value) {
		self->priv->_visible = value;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_pie_preview_add_sign_properties[GNOME_PIE_PIE_PREVIEW_ADD_SIGN_VISIBLE_PROPERTY]);
	}
}

static void
gnome_pie_pie_preview_add_sign_class_init (GnomePiePiePreviewAddSignClass * klass,
                                           gpointer klass_data)
{
	gnome_pie_pie_preview_add_sign_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GnomePiePiePreviewAddSign_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_gnome_pie_pie_preview_add_sign_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gnome_pie_pie_preview_add_sign_set_property;
	G_OBJECT_CLASS (klass)->finalize = gnome_pie_pie_preview_add_sign_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_PIE_PREVIEW_ADD_SIGN_ICON_PROPERTY, gnome_pie_pie_preview_add_sign_properties[GNOME_PIE_PIE_PREVIEW_ADD_SIGN_ICON_PROPERTY] = g_param_spec_object ("icon", "icon", "icon", GNOME_PIE_TYPE_IMAGE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_PIE_PREVIEW_ADD_SIGN_VISIBLE_PROPERTY, gnome_pie_pie_preview_add_sign_properties[GNOME_PIE_PIE_PREVIEW_ADD_SIGN_VISIBLE_PROPERTY] = g_param_spec_boolean ("visible", "visible", "visible", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	gnome_pie_pie_preview_add_sign_signals[GNOME_PIE_PIE_PREVIEW_ADD_SIGN_ON_CLICKED_SIGNAL] = g_signal_new ("on-clicked", GNOME_PIE_TYPE_PIE_PREVIEW_ADD_SIGN, 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_add_sign_instance_init (GnomePiePiePreviewAddSign * self,
                                              gpointer klass)
{
	self->priv = gnome_pie_pie_preview_add_sign_get_instance_private (self);
	self->priv->_visible = FALSE;
	self->priv->position = (gdouble) 0;
	self->priv->time = (gdouble) 0;
	self->priv->max_size = (gdouble) 0;
	self->priv->angle = (gdouble) 0;
}

static void
gnome_pie_pie_preview_add_sign_finalize (GObject * obj)
{
	GnomePiePiePreviewAddSign * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GNOME_PIE_TYPE_PIE_PREVIEW_ADD_SIGN, GnomePiePiePreviewAddSign);
	_g_object_unref0 (self->priv->_icon);
	_g_object_unref0 (self->priv->size);
	_g_object_unref0 (self->priv->alpha);
	_g_object_unref0 (self->priv->activity);
	_g_object_unref0 (self->priv->clicked);
	G_OBJECT_CLASS (gnome_pie_pie_preview_add_sign_parent_class)->finalize (obj);
}

static GType
gnome_pie_pie_preview_add_sign_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GnomePiePiePreviewAddSignClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gnome_pie_pie_preview_add_sign_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GnomePiePiePreviewAddSign), 0, (GInstanceInitFunc) gnome_pie_pie_preview_add_sign_instance_init, NULL };
	GType gnome_pie_pie_preview_add_sign_type_id;
	gnome_pie_pie_preview_add_sign_type_id = g_type_register_static (G_TYPE_OBJECT, "GnomePiePiePreviewAddSign", &g_define_type_info, 0);
	GnomePiePiePreviewAddSign_private_offset = g_type_add_instance_private (gnome_pie_pie_preview_add_sign_type_id, sizeof (GnomePiePiePreviewAddSignPrivate));
	return gnome_pie_pie_preview_add_sign_type_id;
}

GType
gnome_pie_pie_preview_add_sign_get_type (void)
{
	static volatile gsize gnome_pie_pie_preview_add_sign_type_id__once = 0;
	if (g_once_init_enter (&gnome_pie_pie_preview_add_sign_type_id__once)) {
		GType gnome_pie_pie_preview_add_sign_type_id;
		gnome_pie_pie_preview_add_sign_type_id = gnome_pie_pie_preview_add_sign_get_type_once ();
		g_once_init_leave (&gnome_pie_pie_preview_add_sign_type_id__once, gnome_pie_pie_preview_add_sign_type_id);
	}
	return gnome_pie_pie_preview_add_sign_type_id__once;
}

static void
_vala_gnome_pie_pie_preview_add_sign_get_property (GObject * object,
                                                   guint property_id,
                                                   GValue * value,
                                                   GParamSpec * pspec)
{
	GnomePiePiePreviewAddSign * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GNOME_PIE_TYPE_PIE_PREVIEW_ADD_SIGN, GnomePiePiePreviewAddSign);
	switch (property_id) {
		case GNOME_PIE_PIE_PREVIEW_ADD_SIGN_ICON_PROPERTY:
		g_value_set_object (value, gnome_pie_pie_preview_add_sign_get_icon (self));
		break;
		case GNOME_PIE_PIE_PREVIEW_ADD_SIGN_VISIBLE_PROPERTY:
		g_value_set_boolean (value, gnome_pie_pie_preview_add_sign_get_visible (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gnome_pie_pie_preview_add_sign_set_property (GObject * object,
                                                   guint property_id,
                                                   const GValue * value,
                                                   GParamSpec * pspec)
{
	GnomePiePiePreviewAddSign * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GNOME_PIE_TYPE_PIE_PREVIEW_ADD_SIGN, GnomePiePiePreviewAddSign);
	switch (property_id) {
		case GNOME_PIE_PIE_PREVIEW_ADD_SIGN_ICON_PROPERTY:
		gnome_pie_pie_preview_add_sign_set_icon (self, g_value_get_object (value));
		break;
		case GNOME_PIE_PIE_PREVIEW_ADD_SIGN_VISIBLE_PROPERTY:
		gnome_pie_pie_preview_add_sign_set_visible (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

