/* piePreviewDeleteSign.c generated by valac 0.56.19, the Vala compiler
 * generated from piePreviewDeleteSign.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>

#define GNOME_PIE_PIE_PREVIEW_DELETE_SIGN_radius 18
#define GNOME_PIE_PIE_PREVIEW_DELETE_SIGN_globale_scale 0.8
#define GNOME_PIE_PIE_PREVIEW_DELETE_SIGN_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_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;
typedef struct _GnomePiePiePreviewDeleteSignPrivate GnomePiePiePreviewDeleteSignPrivate;

#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_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_DELETE_SIGN_0_PROPERTY,
	GNOME_PIE_PIE_PREVIEW_DELETE_SIGN_ICON_PROPERTY,
	GNOME_PIE_PIE_PREVIEW_DELETE_SIGN_NUM_PROPERTIES
};
static GParamSpec* gnome_pie_pie_preview_delete_sign_properties[GNOME_PIE_PIE_PREVIEW_DELETE_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_DELETE_SIGN_ON_CLICKED_SIGNAL,
	GNOME_PIE_PIE_PREVIEW_DELETE_SIGN_NUM_SIGNALS
};
static guint gnome_pie_pie_preview_delete_sign_signals[GNOME_PIE_PIE_PREVIEW_DELETE_SIGN_NUM_SIGNALS] = {0};

struct _GnomePiePiePreviewDeleteSign {
	GObject parent_instance;
	GnomePiePiePreviewDeleteSignPrivate * priv;
};

struct _GnomePiePiePreviewDeleteSignClass {
	GObjectClass parent_class;
};

struct _GnomePiePiePreviewDeleteSignPrivate {
	GnomePieImage* _icon;
	gboolean visible;
	GnomePieAnimatedValue* size;
	GnomePieAnimatedValue* alpha;
	GnomePieAnimatedValue* activity;
	GnomePieAnimatedValue* clicked;
	gdouble clicked_x;
	gdouble clicked_y;
};

static gint GnomePiePiePreviewDeleteSign_private_offset;
static gpointer gnome_pie_pie_preview_delete_sign_parent_class = NULL;

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_image_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieImage, 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 GnomePiePiePreviewDeleteSign* gnome_pie_pie_preview_delete_sign_new (void);
VALA_EXTERN GnomePiePiePreviewDeleteSign* gnome_pie_pie_preview_delete_sign_construct (GType object_type);
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_delete_sign_load (GnomePiePiePreviewDeleteSign* 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_delete_sign_set_icon (GnomePiePiePreviewDeleteSign* self,
                                                 GnomePieImage* value);
VALA_EXTERN void gnome_pie_pie_preview_delete_sign_show (GnomePiePiePreviewDeleteSign* self);
VALA_EXTERN void gnome_pie_animated_value_reset_target (GnomePieAnimatedValue* self,
                                            gdouble end,
                                            gdouble duration);
VALA_EXTERN void gnome_pie_pie_preview_delete_sign_hide (GnomePiePiePreviewDeleteSign* self);
VALA_EXTERN void gnome_pie_pie_preview_delete_sign_set_size (GnomePiePiePreviewDeleteSign* self,
                                                 gdouble size);
VALA_EXTERN void gnome_pie_pie_preview_delete_sign_draw (GnomePiePiePreviewDeleteSign* 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_delete_sign_get_icon (GnomePiePiePreviewDeleteSign* self);
VALA_EXTERN void gnome_pie_image_paint_on (GnomePieImage* self,
                               cairo_t* ctx,
                               gdouble alpha);
VALA_EXTERN gboolean gnome_pie_pie_preview_delete_sign_on_mouse_move (GnomePiePiePreviewDeleteSign* self,
                                                          gdouble x,
                                                          gdouble y);
VALA_EXTERN gdouble gnome_pie_animated_value_get_end (GnomePieAnimatedValue* self);
VALA_EXTERN gboolean gnome_pie_pie_preview_delete_sign_on_button_press (GnomePiePiePreviewDeleteSign* self,
                                                            gdouble x,
                                                            gdouble y);
VALA_EXTERN gboolean gnome_pie_pie_preview_delete_sign_on_button_release (GnomePiePiePreviewDeleteSign* self,
                                                              gdouble x,
                                                              gdouble y);
static void gnome_pie_pie_preview_delete_sign_finalize (GObject * obj);
static GType gnome_pie_pie_preview_delete_sign_get_type_once (void);
static void _vala_gnome_pie_pie_preview_delete_sign_get_property (GObject * object,
                                                           guint property_id,
                                                           GValue * value,
                                                           GParamSpec * pspec);
static void _vala_gnome_pie_pie_preview_delete_sign_set_property (GObject * object,
                                                           guint property_id,
                                                           const GValue * value,
                                                           GParamSpec * pspec);

static inline gpointer
gnome_pie_pie_preview_delete_sign_get_instance_private (GnomePiePiePreviewDeleteSign* self)
{
	return G_STRUCT_MEMBER_P (self, GnomePiePiePreviewDeleteSign_private_offset);
}

GnomePiePiePreviewDeleteSign*
gnome_pie_pie_preview_delete_sign_construct (GType object_type)
{
	GnomePiePiePreviewDeleteSign * self = NULL;
	GnomePieAnimatedValue* _tmp0_;
	GnomePieAnimatedValue* _tmp1_;
	GnomePieAnimatedValue* _tmp2_;
	GnomePieAnimatedValue* _tmp3_;
	self = (GnomePiePiePreviewDeleteSign*) g_object_new (object_type, NULL);
	_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;
}

GnomePiePiePreviewDeleteSign*
gnome_pie_pie_preview_delete_sign_new (void)
{
	return gnome_pie_pie_preview_delete_sign_construct (GNOME_PIE_TYPE_PIE_PREVIEW_DELETE_SIGN);
}

void
gnome_pie_pie_preview_delete_sign_load (GnomePiePiePreviewDeleteSign* self)
{
	GnomePieIcon* _tmp0_;
	GnomePieIcon* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gnome_pie_icon_new ("edit-delete", GNOME_PIE_PIE_PREVIEW_DELETE_SIGN_radius * 2);
	_tmp1_ = _tmp0_;
	gnome_pie_pie_preview_delete_sign_set_icon (self, (GnomePieImage*) _tmp1_);
	_g_object_unref0 (_tmp1_);
}

void
gnome_pie_pie_preview_delete_sign_show (GnomePiePiePreviewDeleteSign* self)
{
	g_return_if_fail (self != NULL);
	if (!self->priv->visible) {
		GnomePieAnimatedValue* _tmp0_;
		self->priv->visible = TRUE;
		_tmp0_ = self->priv->alpha;
		gnome_pie_animated_value_reset_target (_tmp0_, 1.0, 0.3);
	}
}

void
gnome_pie_pie_preview_delete_sign_hide (GnomePiePiePreviewDeleteSign* self)
{
	g_return_if_fail (self != NULL);
	if (self->priv->visible) {
		GnomePieAnimatedValue* _tmp0_;
		self->priv->visible = FALSE;
		_tmp0_ = self->priv->alpha;
		gnome_pie_animated_value_reset_target (_tmp0_, 0.0, 0.3);
	}
}

void
gnome_pie_pie_preview_delete_sign_set_size (GnomePiePiePreviewDeleteSign* self,
                                            gdouble size)
{
	GnomePieAnimatedValue* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->size;
	gnome_pie_animated_value_reset_target (_tmp0_, size, 0.2);
}

void
gnome_pie_pie_preview_delete_sign_draw (GnomePiePiePreviewDeleteSign* self,
                                        gdouble frame_time,
                                        cairo_t* ctx)
{
	GnomePieAnimatedValue* _tmp0_;
	GnomePieAnimatedValue* _tmp1_;
	GnomePieAnimatedValue* _tmp2_;
	GnomePieAnimatedValue* _tmp3_;
	GnomePieAnimatedValue* _tmp4_;
	gdouble _tmp5_;
	gdouble _tmp6_;
	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->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->alpha;
	_tmp5_ = gnome_pie_animated_value_get_val (_tmp4_);
	_tmp6_ = _tmp5_;
	if (_tmp6_ > ((gdouble) 0)) {
		gdouble scale = 0.0;
		GnomePieAnimatedValue* _tmp7_;
		gdouble _tmp8_;
		gdouble _tmp9_;
		GnomePieAnimatedValue* _tmp10_;
		gdouble _tmp11_;
		gdouble _tmp12_;
		GnomePieAnimatedValue* _tmp13_;
		gdouble _tmp14_;
		gdouble _tmp15_;
		GnomePieImage* _tmp16_;
		GnomePieAnimatedValue* _tmp17_;
		gdouble _tmp18_;
		gdouble _tmp19_;
		cairo_save (ctx);
		_tmp7_ = self->priv->size;
		_tmp8_ = gnome_pie_animated_value_get_val (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = self->priv->clicked;
		_tmp11_ = gnome_pie_animated_value_get_val (_tmp10_);
		_tmp12_ = _tmp11_;
		_tmp13_ = self->priv->activity;
		_tmp14_ = gnome_pie_animated_value_get_val (_tmp13_);
		_tmp15_ = _tmp14_;
		scale = (((_tmp9_ * _tmp12_) + (_tmp15_ * 0.2)) - 0.2) * GNOME_PIE_PIE_PREVIEW_DELETE_SIGN_globale_scale;
		cairo_scale (ctx, scale, scale);
		_tmp16_ = self->priv->_icon;
		_tmp17_ = self->priv->alpha;
		_tmp18_ = gnome_pie_animated_value_get_val (_tmp17_);
		_tmp19_ = _tmp18_;
		gnome_pie_image_paint_on (_tmp16_, ctx, _tmp19_);
		cairo_restore (ctx);
	}
}

gboolean
gnome_pie_pie_preview_delete_sign_on_mouse_move (GnomePiePiePreviewDeleteSign* self,
                                                 gdouble x,
                                                 gdouble y)
{
	GnomePieAnimatedValue* _tmp0_;
	gdouble _tmp1_;
	gdouble _tmp2_;
	gboolean _tmp4_ = FALSE;
	GnomePieAnimatedValue* _tmp6_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->clicked;
	_tmp1_ = gnome_pie_animated_value_get_end (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ == 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_DELETE_SIGN_click_cancel_treshold * GNOME_PIE_PIE_PREVIEW_DELETE_SIGN_click_cancel_treshold)) {
			GnomePieAnimatedValue* _tmp3_;
			_tmp3_ = self->priv->clicked;
			gnome_pie_animated_value_reset_target (_tmp3_, 1.0, 0.1);
		}
	}
	if (fabs (x) <= (GNOME_PIE_PIE_PREVIEW_DELETE_SIGN_radius * GNOME_PIE_PIE_PREVIEW_DELETE_SIGN_globale_scale)) {
		_tmp4_ = fabs (y) <= (GNOME_PIE_PIE_PREVIEW_DELETE_SIGN_radius * GNOME_PIE_PIE_PREVIEW_DELETE_SIGN_globale_scale);
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		GnomePieAnimatedValue* _tmp5_;
		_tmp5_ = self->priv->activity;
		gnome_pie_animated_value_reset_target (_tmp5_, 1.0, 0.2);
		result = TRUE;
		return result;
	}
	_tmp6_ = self->priv->activity;
	gnome_pie_animated_value_reset_target (_tmp6_, 0.0, 0.2);
	result = FALSE;
	return result;
}

gboolean
gnome_pie_pie_preview_delete_sign_on_button_press (GnomePiePiePreviewDeleteSign* self,
                                                   gdouble x,
                                                   gdouble y)
{
	GnomePieAnimatedValue* _tmp0_;
	gdouble _tmp1_;
	gdouble _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_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);
		self->priv->clicked_x = x;
		self->priv->clicked_y = y;
		result = TRUE;
		return result;
	}
	result = FALSE;
	return result;
}

gboolean
gnome_pie_pie_preview_delete_sign_on_button_release (GnomePiePiePreviewDeleteSign* self,
                                                     gdouble x,
                                                     gdouble y)
{
	GnomePieAnimatedValue* _tmp0_;
	gdouble _tmp1_;
	gdouble _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->clicked;
	_tmp1_ = gnome_pie_animated_value_get_end (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ == 0.9) {
		GnomePieAnimatedValue* _tmp3_;
		_tmp3_ = self->priv->clicked;
		gnome_pie_animated_value_reset_target (_tmp3_, 1.0, 0.1);
		g_signal_emit (self, gnome_pie_pie_preview_delete_sign_signals[GNOME_PIE_PIE_PREVIEW_DELETE_SIGN_ON_CLICKED_SIGNAL], 0);
		result = TRUE;
		return result;
	}
	result = FALSE;
	return result;
}

GnomePieImage*
gnome_pie_pie_preview_delete_sign_get_icon (GnomePiePiePreviewDeleteSign* 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_delete_sign_set_icon (GnomePiePiePreviewDeleteSign* self,
                                            GnomePieImage* value)
{
	GnomePieImage* old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_pie_preview_delete_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_delete_sign_properties[GNOME_PIE_PIE_PREVIEW_DELETE_SIGN_ICON_PROPERTY]);
	}
}

static void
gnome_pie_pie_preview_delete_sign_class_init (GnomePiePiePreviewDeleteSignClass * klass,
                                              gpointer klass_data)
{
	gnome_pie_pie_preview_delete_sign_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GnomePiePiePreviewDeleteSign_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_gnome_pie_pie_preview_delete_sign_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gnome_pie_pie_preview_delete_sign_set_property;
	G_OBJECT_CLASS (klass)->finalize = gnome_pie_pie_preview_delete_sign_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_PIE_PREVIEW_DELETE_SIGN_ICON_PROPERTY, gnome_pie_pie_preview_delete_sign_properties[GNOME_PIE_PIE_PREVIEW_DELETE_SIGN_ICON_PROPERTY] = g_param_spec_object ("icon", "icon", "icon", GNOME_PIE_TYPE_IMAGE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	gnome_pie_pie_preview_delete_sign_signals[GNOME_PIE_PIE_PREVIEW_DELETE_SIGN_ON_CLICKED_SIGNAL] = g_signal_new ("on-clicked", GNOME_PIE_TYPE_PIE_PREVIEW_DELETE_SIGN, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
gnome_pie_pie_preview_delete_sign_instance_init (GnomePiePiePreviewDeleteSign * self,
                                                 gpointer klass)
{
	self->priv = gnome_pie_pie_preview_delete_sign_get_instance_private (self);
	self->priv->visible = FALSE;
	self->priv->clicked_x = 0.0;
	self->priv->clicked_y = 0.0;
}

static void
gnome_pie_pie_preview_delete_sign_finalize (GObject * obj)
{
	GnomePiePiePreviewDeleteSign * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GNOME_PIE_TYPE_PIE_PREVIEW_DELETE_SIGN, GnomePiePiePreviewDeleteSign);
	_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_delete_sign_parent_class)->finalize (obj);
}

static GType
gnome_pie_pie_preview_delete_sign_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GnomePiePiePreviewDeleteSignClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gnome_pie_pie_preview_delete_sign_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GnomePiePiePreviewDeleteSign), 0, (GInstanceInitFunc) gnome_pie_pie_preview_delete_sign_instance_init, NULL };
	GType gnome_pie_pie_preview_delete_sign_type_id;
	gnome_pie_pie_preview_delete_sign_type_id = g_type_register_static (G_TYPE_OBJECT, "GnomePiePiePreviewDeleteSign", &g_define_type_info, 0);
	GnomePiePiePreviewDeleteSign_private_offset = g_type_add_instance_private (gnome_pie_pie_preview_delete_sign_type_id, sizeof (GnomePiePiePreviewDeleteSignPrivate));
	return gnome_pie_pie_preview_delete_sign_type_id;
}

GType
gnome_pie_pie_preview_delete_sign_get_type (void)
{
	static volatile gsize gnome_pie_pie_preview_delete_sign_type_id__once = 0;
	if (g_once_init_enter (&gnome_pie_pie_preview_delete_sign_type_id__once)) {
		GType gnome_pie_pie_preview_delete_sign_type_id;
		gnome_pie_pie_preview_delete_sign_type_id = gnome_pie_pie_preview_delete_sign_get_type_once ();
		g_once_init_leave (&gnome_pie_pie_preview_delete_sign_type_id__once, gnome_pie_pie_preview_delete_sign_type_id);
	}
	return gnome_pie_pie_preview_delete_sign_type_id__once;
}

static void
_vala_gnome_pie_pie_preview_delete_sign_get_property (GObject * object,
                                                      guint property_id,
                                                      GValue * value,
                                                      GParamSpec * pspec)
{
	GnomePiePiePreviewDeleteSign * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GNOME_PIE_TYPE_PIE_PREVIEW_DELETE_SIGN, GnomePiePiePreviewDeleteSign);
	switch (property_id) {
		case GNOME_PIE_PIE_PREVIEW_DELETE_SIGN_ICON_PROPERTY:
		g_value_set_object (value, gnome_pie_pie_preview_delete_sign_get_icon (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gnome_pie_pie_preview_delete_sign_set_property (GObject * object,
                                                      guint property_id,
                                                      const GValue * value,
                                                      GParamSpec * pspec)
{
	GnomePiePiePreviewDeleteSign * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GNOME_PIE_TYPE_PIE_PREVIEW_DELETE_SIGN, GnomePiePiePreviewDeleteSign);
	switch (property_id) {
		case GNOME_PIE_PIE_PREVIEW_DELETE_SIGN_ICON_PROPERTY:
		gnome_pie_pie_preview_delete_sign_set_icon (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

