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

#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_CENTER_LAYER (gnome_pie_center_layer_get_type ())
#define GNOME_PIE_CENTER_LAYER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_CENTER_LAYER, GnomePieCenterLayer))
#define GNOME_PIE_CENTER_LAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_CENTER_LAYER, GnomePieCenterLayerClass))
#define GNOME_PIE_IS_CENTER_LAYER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_CENTER_LAYER))
#define GNOME_PIE_IS_CENTER_LAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_CENTER_LAYER))
#define GNOME_PIE_CENTER_LAYER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_CENTER_LAYER, GnomePieCenterLayerClass))

typedef struct _GnomePieCenterLayer GnomePieCenterLayer;
typedef struct _GnomePieCenterLayerClass GnomePieCenterLayerClass;
typedef struct _GnomePieCenterLayerPrivate GnomePieCenterLayerPrivate;

#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;
typedef enum  {
	GNOME_PIE_CENTER_LAYER_ROTATION_MODE_AUTO,
	GNOME_PIE_CENTER_LAYER_ROTATION_MODE_TO_MOUSE,
	GNOME_PIE_CENTER_LAYER_ROTATION_MODE_TO_ACTIVE,
	GNOME_PIE_CENTER_LAYER_ROTATION_MODE_TO_HOUR_12,
	GNOME_PIE_CENTER_LAYER_ROTATION_MODE_TO_HOUR_24,
	GNOME_PIE_CENTER_LAYER_ROTATION_MODE_TO_MINUTE,
	GNOME_PIE_CENTER_LAYER_ROTATION_MODE_TO_SECOND
} GnomePieCenterLayerRotationMode;

#define GNOME_PIE_CENTER_LAYER_TYPE_ROTATION_MODE (gnome_pie_center_layer_rotation_mode_get_type ())
enum  {
	GNOME_PIE_CENTER_LAYER_0_PROPERTY,
	GNOME_PIE_CENTER_LAYER_IMAGE_PROPERTY,
	GNOME_PIE_CENTER_LAYER_ACTIVE_SCALE_PROPERTY,
	GNOME_PIE_CENTER_LAYER_ACTIVE_ROTATION_SPEED_PROPERTY,
	GNOME_PIE_CENTER_LAYER_ACTIVE_ALPHA_PROPERTY,
	GNOME_PIE_CENTER_LAYER_ACTIVE_COLORIZE_PROPERTY,
	GNOME_PIE_CENTER_LAYER_ACTIVE_ROTATION_MODE_PROPERTY,
	GNOME_PIE_CENTER_LAYER_INACTIVE_SCALE_PROPERTY,
	GNOME_PIE_CENTER_LAYER_INACTIVE_ROTATION_SPEED_PROPERTY,
	GNOME_PIE_CENTER_LAYER_INACTIVE_ALPHA_PROPERTY,
	GNOME_PIE_CENTER_LAYER_INACTIVE_COLORIZE_PROPERTY,
	GNOME_PIE_CENTER_LAYER_INACTIVE_ROTATION_MODE_PROPERTY,
	GNOME_PIE_CENTER_LAYER_ROTATION_PROPERTY,
	GNOME_PIE_CENTER_LAYER_NUM_PROPERTIES
};
static GParamSpec* gnome_pie_center_layer_properties[GNOME_PIE_CENTER_LAYER_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))

struct _GnomePieCenterLayer {
	GObject parent_instance;
	GnomePieCenterLayerPrivate * priv;
	gchar* image_file;
};

struct _GnomePieCenterLayerClass {
	GObjectClass parent_class;
};

struct _GnomePieCenterLayerPrivate {
	GnomePieImage* _image;
	gdouble _active_scale;
	gdouble _active_rotation_speed;
	gdouble _active_alpha;
	gboolean _active_colorize;
	GnomePieCenterLayerRotationMode _active_rotation_mode;
	gdouble _inactive_scale;
	gdouble _inactive_rotation_speed;
	gdouble _inactive_alpha;
	gboolean _inactive_colorize;
	GnomePieCenterLayerRotationMode _inactive_rotation_mode;
	gdouble _rotation;
	gint center_radius;
};

static gint GnomePieCenterLayer_private_offset;
static gpointer gnome_pie_center_layer_parent_class = NULL;

VALA_EXTERN GType gnome_pie_center_layer_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieCenterLayer, 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_center_layer_rotation_mode_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GnomePieCenterLayer* gnome_pie_center_layer_new (const gchar* image_file,
                                                 gint center_radius,
                                                 gdouble active_scale,
                                                 gdouble active_rotation_speed,
                                                 gdouble active_alpha,
                                                 gboolean active_colorize,
                                                 GnomePieCenterLayerRotationMode active_rotation_mode,
                                                 gdouble inactive_scale,
                                                 gdouble inactive_rotation_speed,
                                                 gdouble inactive_alpha,
                                                 gboolean inactive_colorize,
                                                 GnomePieCenterLayerRotationMode inactive_rotation_mode);
VALA_EXTERN GnomePieCenterLayer* gnome_pie_center_layer_construct (GType object_type,
                                                       const gchar* image_file,
                                                       gint center_radius,
                                                       gdouble active_scale,
                                                       gdouble active_rotation_speed,
                                                       gdouble active_alpha,
                                                       gboolean active_colorize,
                                                       GnomePieCenterLayerRotationMode active_rotation_mode,
                                                       gdouble inactive_scale,
                                                       gdouble inactive_rotation_speed,
                                                       gdouble inactive_alpha,
                                                       gboolean inactive_colorize,
                                                       GnomePieCenterLayerRotationMode inactive_rotation_mode);
static void gnome_pie_center_layer_set_active_scale (GnomePieCenterLayer* self,
                                              gdouble value);
static void gnome_pie_center_layer_set_active_rotation_speed (GnomePieCenterLayer* self,
                                                       gdouble value);
static void gnome_pie_center_layer_set_active_alpha (GnomePieCenterLayer* self,
                                              gdouble value);
static void gnome_pie_center_layer_set_active_colorize (GnomePieCenterLayer* self,
                                                 gboolean value);
static void gnome_pie_center_layer_set_active_rotation_mode (GnomePieCenterLayer* self,
                                                      GnomePieCenterLayerRotationMode value);
static void gnome_pie_center_layer_set_inactive_scale (GnomePieCenterLayer* self,
                                                gdouble value);
static void gnome_pie_center_layer_set_inactive_rotation_speed (GnomePieCenterLayer* self,
                                                         gdouble value);
static void gnome_pie_center_layer_set_inactive_alpha (GnomePieCenterLayer* self,
                                                gdouble value);
static void gnome_pie_center_layer_set_inactive_colorize (GnomePieCenterLayer* self,
                                                   gboolean value);
static void gnome_pie_center_layer_set_inactive_rotation_mode (GnomePieCenterLayer* self,
                                                        GnomePieCenterLayerRotationMode value);
VALA_EXTERN void gnome_pie_center_layer_set_rotation (GnomePieCenterLayer* self,
                                          gdouble value);
VALA_EXTERN void gnome_pie_center_layer_load_image (GnomePieCenterLayer* self);
VALA_EXTERN GnomePieImage* gnome_pie_image_new_from_file_at_size (const gchar* filename,
                                                      gint width,
                                                      gint height);
VALA_EXTERN GnomePieImage* gnome_pie_image_construct_from_file_at_size (GType object_type,
                                                            const gchar* filename,
                                                            gint width,
                                                            gint height);
static void gnome_pie_center_layer_set_image (GnomePieCenterLayer* self,
                                       GnomePieImage* value);
VALA_EXTERN GnomePieImage* gnome_pie_center_layer_get_image (GnomePieCenterLayer* self);
VALA_EXTERN gdouble gnome_pie_center_layer_get_active_scale (GnomePieCenterLayer* self);
VALA_EXTERN gdouble gnome_pie_center_layer_get_active_rotation_speed (GnomePieCenterLayer* self);
VALA_EXTERN gdouble gnome_pie_center_layer_get_active_alpha (GnomePieCenterLayer* self);
VALA_EXTERN gboolean gnome_pie_center_layer_get_active_colorize (GnomePieCenterLayer* self);
VALA_EXTERN GnomePieCenterLayerRotationMode gnome_pie_center_layer_get_active_rotation_mode (GnomePieCenterLayer* self);
VALA_EXTERN gdouble gnome_pie_center_layer_get_inactive_scale (GnomePieCenterLayer* self);
VALA_EXTERN gdouble gnome_pie_center_layer_get_inactive_rotation_speed (GnomePieCenterLayer* self);
VALA_EXTERN gdouble gnome_pie_center_layer_get_inactive_alpha (GnomePieCenterLayer* self);
VALA_EXTERN gboolean gnome_pie_center_layer_get_inactive_colorize (GnomePieCenterLayer* self);
VALA_EXTERN GnomePieCenterLayerRotationMode gnome_pie_center_layer_get_inactive_rotation_mode (GnomePieCenterLayer* self);
VALA_EXTERN gdouble gnome_pie_center_layer_get_rotation (GnomePieCenterLayer* self);
static void gnome_pie_center_layer_finalize (GObject * obj);
static GType gnome_pie_center_layer_get_type_once (void);
static void _vala_gnome_pie_center_layer_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec);
static void _vala_gnome_pie_center_layer_set_property (GObject * object,
                                                guint property_id,
                                                const GValue * value,
                                                GParamSpec * pspec);

static inline gpointer
gnome_pie_center_layer_get_instance_private (GnomePieCenterLayer* self)
{
	return G_STRUCT_MEMBER_P (self, GnomePieCenterLayer_private_offset);
}

static GType
gnome_pie_center_layer_rotation_mode_get_type_once (void)
{
	static const GEnumValue values[] = {{GNOME_PIE_CENTER_LAYER_ROTATION_MODE_AUTO, "GNOME_PIE_CENTER_LAYER_ROTATION_MODE_AUTO", "auto"}, {GNOME_PIE_CENTER_LAYER_ROTATION_MODE_TO_MOUSE, "GNOME_PIE_CENTER_LAYER_ROTATION_MODE_TO_MOUSE", "to-mouse"}, {GNOME_PIE_CENTER_LAYER_ROTATION_MODE_TO_ACTIVE, "GNOME_PIE_CENTER_LAYER_ROTATION_MODE_TO_ACTIVE", "to-active"}, {GNOME_PIE_CENTER_LAYER_ROTATION_MODE_TO_HOUR_12, "GNOME_PIE_CENTER_LAYER_ROTATION_MODE_TO_HOUR_12", "to-hour-12"}, {GNOME_PIE_CENTER_LAYER_ROTATION_MODE_TO_HOUR_24, "GNOME_PIE_CENTER_LAYER_ROTATION_MODE_TO_HOUR_24", "to-hour-24"}, {GNOME_PIE_CENTER_LAYER_ROTATION_MODE_TO_MINUTE, "GNOME_PIE_CENTER_LAYER_ROTATION_MODE_TO_MINUTE", "to-minute"}, {GNOME_PIE_CENTER_LAYER_ROTATION_MODE_TO_SECOND, "GNOME_PIE_CENTER_LAYER_ROTATION_MODE_TO_SECOND", "to-second"}, {0, NULL, NULL}};
	GType gnome_pie_center_layer_rotation_mode_type_id;
	gnome_pie_center_layer_rotation_mode_type_id = g_enum_register_static ("GnomePieCenterLayerRotationMode", values);
	return gnome_pie_center_layer_rotation_mode_type_id;
}

GType
gnome_pie_center_layer_rotation_mode_get_type (void)
{
	static volatile gsize gnome_pie_center_layer_rotation_mode_type_id__once = 0;
	if (g_once_init_enter (&gnome_pie_center_layer_rotation_mode_type_id__once)) {
		GType gnome_pie_center_layer_rotation_mode_type_id;
		gnome_pie_center_layer_rotation_mode_type_id = gnome_pie_center_layer_rotation_mode_get_type_once ();
		g_once_init_leave (&gnome_pie_center_layer_rotation_mode_type_id__once, gnome_pie_center_layer_rotation_mode_type_id);
	}
	return gnome_pie_center_layer_rotation_mode_type_id__once;
}

GnomePieCenterLayer*
gnome_pie_center_layer_construct (GType object_type,
                                  const gchar* image_file,
                                  gint center_radius,
                                  gdouble active_scale,
                                  gdouble active_rotation_speed,
                                  gdouble active_alpha,
                                  gboolean active_colorize,
                                  GnomePieCenterLayerRotationMode active_rotation_mode,
                                  gdouble inactive_scale,
                                  gdouble inactive_rotation_speed,
                                  gdouble inactive_alpha,
                                  gboolean inactive_colorize,
                                  GnomePieCenterLayerRotationMode inactive_rotation_mode)
{
	GnomePieCenterLayer * self = NULL;
	gchar* _tmp0_;
	g_return_val_if_fail (image_file != NULL, NULL);
	self = (GnomePieCenterLayer*) g_object_new (object_type, NULL);
	_tmp0_ = g_strdup (image_file);
	_g_free0 (self->image_file);
	self->image_file = _tmp0_;
	self->priv->center_radius = center_radius;
	gnome_pie_center_layer_set_active_scale (self, active_scale);
	gnome_pie_center_layer_set_active_rotation_speed (self, active_rotation_speed);
	gnome_pie_center_layer_set_active_alpha (self, active_alpha);
	gnome_pie_center_layer_set_active_colorize (self, active_colorize);
	gnome_pie_center_layer_set_active_rotation_mode (self, active_rotation_mode);
	gnome_pie_center_layer_set_inactive_scale (self, inactive_scale);
	gnome_pie_center_layer_set_inactive_rotation_speed (self, inactive_rotation_speed);
	gnome_pie_center_layer_set_inactive_alpha (self, inactive_alpha);
	gnome_pie_center_layer_set_inactive_colorize (self, inactive_colorize);
	gnome_pie_center_layer_set_inactive_rotation_mode (self, inactive_rotation_mode);
	gnome_pie_center_layer_set_rotation (self, 0.0);
	return self;
}

GnomePieCenterLayer*
gnome_pie_center_layer_new (const gchar* image_file,
                            gint center_radius,
                            gdouble active_scale,
                            gdouble active_rotation_speed,
                            gdouble active_alpha,
                            gboolean active_colorize,
                            GnomePieCenterLayerRotationMode active_rotation_mode,
                            gdouble inactive_scale,
                            gdouble inactive_rotation_speed,
                            gdouble inactive_alpha,
                            gboolean inactive_colorize,
                            GnomePieCenterLayerRotationMode inactive_rotation_mode)
{
	return gnome_pie_center_layer_construct (GNOME_PIE_TYPE_CENTER_LAYER, image_file, center_radius, active_scale, active_rotation_speed, active_alpha, active_colorize, active_rotation_mode, inactive_scale, inactive_rotation_speed, inactive_alpha, inactive_colorize, inactive_rotation_mode);
}

void
gnome_pie_center_layer_load_image (GnomePieCenterLayer* self)
{
	const gchar* _tmp0_;
	GnomePieImage* _tmp1_;
	GnomePieImage* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->image_file;
	_tmp1_ = gnome_pie_image_new_from_file_at_size (_tmp0_, 2 * self->priv->center_radius, 2 * self->priv->center_radius);
	_tmp2_ = _tmp1_;
	gnome_pie_center_layer_set_image (self, _tmp2_);
	_g_object_unref0 (_tmp2_);
}

GnomePieImage*
gnome_pie_center_layer_get_image (GnomePieCenterLayer* self)
{
	GnomePieImage* result;
	GnomePieImage* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_image;
	result = _tmp0_;
	return result;
}

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

static void
gnome_pie_center_layer_set_image (GnomePieCenterLayer* self,
                                  GnomePieImage* value)
{
	GnomePieImage* old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_center_layer_get_image (self);
	if (old_value != value) {
		GnomePieImage* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_image);
		self->priv->_image = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_center_layer_properties[GNOME_PIE_CENTER_LAYER_IMAGE_PROPERTY]);
	}
}

gdouble
gnome_pie_center_layer_get_active_scale (GnomePieCenterLayer* self)
{
	gdouble result;
	g_return_val_if_fail (self != NULL, -1.0);
	result = self->priv->_active_scale;
	return result;
}

static void
gnome_pie_center_layer_set_active_scale (GnomePieCenterLayer* self,
                                         gdouble value)
{
	gdouble old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_center_layer_get_active_scale (self);
	if (old_value != value) {
		self->priv->_active_scale = value;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_center_layer_properties[GNOME_PIE_CENTER_LAYER_ACTIVE_SCALE_PROPERTY]);
	}
}

gdouble
gnome_pie_center_layer_get_active_rotation_speed (GnomePieCenterLayer* self)
{
	gdouble result;
	g_return_val_if_fail (self != NULL, -1.0);
	result = self->priv->_active_rotation_speed;
	return result;
}

static void
gnome_pie_center_layer_set_active_rotation_speed (GnomePieCenterLayer* self,
                                                  gdouble value)
{
	gdouble old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_center_layer_get_active_rotation_speed (self);
	if (old_value != value) {
		self->priv->_active_rotation_speed = value;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_center_layer_properties[GNOME_PIE_CENTER_LAYER_ACTIVE_ROTATION_SPEED_PROPERTY]);
	}
}

gdouble
gnome_pie_center_layer_get_active_alpha (GnomePieCenterLayer* self)
{
	gdouble result;
	g_return_val_if_fail (self != NULL, -1.0);
	result = self->priv->_active_alpha;
	return result;
}

static void
gnome_pie_center_layer_set_active_alpha (GnomePieCenterLayer* self,
                                         gdouble value)
{
	gdouble old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_center_layer_get_active_alpha (self);
	if (old_value != value) {
		self->priv->_active_alpha = value;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_center_layer_properties[GNOME_PIE_CENTER_LAYER_ACTIVE_ALPHA_PROPERTY]);
	}
}

gboolean
gnome_pie_center_layer_get_active_colorize (GnomePieCenterLayer* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_active_colorize;
	return result;
}

static void
gnome_pie_center_layer_set_active_colorize (GnomePieCenterLayer* self,
                                            gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_center_layer_get_active_colorize (self);
	if (old_value != value) {
		self->priv->_active_colorize = value;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_center_layer_properties[GNOME_PIE_CENTER_LAYER_ACTIVE_COLORIZE_PROPERTY]);
	}
}

GnomePieCenterLayerRotationMode
gnome_pie_center_layer_get_active_rotation_mode (GnomePieCenterLayer* self)
{
	GnomePieCenterLayerRotationMode result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_active_rotation_mode;
	return result;
}

static void
gnome_pie_center_layer_set_active_rotation_mode (GnomePieCenterLayer* self,
                                                 GnomePieCenterLayerRotationMode value)
{
	GnomePieCenterLayerRotationMode old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_center_layer_get_active_rotation_mode (self);
	if (old_value != value) {
		self->priv->_active_rotation_mode = value;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_center_layer_properties[GNOME_PIE_CENTER_LAYER_ACTIVE_ROTATION_MODE_PROPERTY]);
	}
}

gdouble
gnome_pie_center_layer_get_inactive_scale (GnomePieCenterLayer* self)
{
	gdouble result;
	g_return_val_if_fail (self != NULL, -1.0);
	result = self->priv->_inactive_scale;
	return result;
}

static void
gnome_pie_center_layer_set_inactive_scale (GnomePieCenterLayer* self,
                                           gdouble value)
{
	gdouble old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_center_layer_get_inactive_scale (self);
	if (old_value != value) {
		self->priv->_inactive_scale = value;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_center_layer_properties[GNOME_PIE_CENTER_LAYER_INACTIVE_SCALE_PROPERTY]);
	}
}

gdouble
gnome_pie_center_layer_get_inactive_rotation_speed (GnomePieCenterLayer* self)
{
	gdouble result;
	g_return_val_if_fail (self != NULL, -1.0);
	result = self->priv->_inactive_rotation_speed;
	return result;
}

static void
gnome_pie_center_layer_set_inactive_rotation_speed (GnomePieCenterLayer* self,
                                                    gdouble value)
{
	gdouble old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_center_layer_get_inactive_rotation_speed (self);
	if (old_value != value) {
		self->priv->_inactive_rotation_speed = value;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_center_layer_properties[GNOME_PIE_CENTER_LAYER_INACTIVE_ROTATION_SPEED_PROPERTY]);
	}
}

gdouble
gnome_pie_center_layer_get_inactive_alpha (GnomePieCenterLayer* self)
{
	gdouble result;
	g_return_val_if_fail (self != NULL, -1.0);
	result = self->priv->_inactive_alpha;
	return result;
}

static void
gnome_pie_center_layer_set_inactive_alpha (GnomePieCenterLayer* self,
                                           gdouble value)
{
	gdouble old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_center_layer_get_inactive_alpha (self);
	if (old_value != value) {
		self->priv->_inactive_alpha = value;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_center_layer_properties[GNOME_PIE_CENTER_LAYER_INACTIVE_ALPHA_PROPERTY]);
	}
}

gboolean
gnome_pie_center_layer_get_inactive_colorize (GnomePieCenterLayer* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_inactive_colorize;
	return result;
}

static void
gnome_pie_center_layer_set_inactive_colorize (GnomePieCenterLayer* self,
                                              gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_center_layer_get_inactive_colorize (self);
	if (old_value != value) {
		self->priv->_inactive_colorize = value;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_center_layer_properties[GNOME_PIE_CENTER_LAYER_INACTIVE_COLORIZE_PROPERTY]);
	}
}

GnomePieCenterLayerRotationMode
gnome_pie_center_layer_get_inactive_rotation_mode (GnomePieCenterLayer* self)
{
	GnomePieCenterLayerRotationMode result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_inactive_rotation_mode;
	return result;
}

static void
gnome_pie_center_layer_set_inactive_rotation_mode (GnomePieCenterLayer* self,
                                                   GnomePieCenterLayerRotationMode value)
{
	GnomePieCenterLayerRotationMode old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_center_layer_get_inactive_rotation_mode (self);
	if (old_value != value) {
		self->priv->_inactive_rotation_mode = value;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_center_layer_properties[GNOME_PIE_CENTER_LAYER_INACTIVE_ROTATION_MODE_PROPERTY]);
	}
}

gdouble
gnome_pie_center_layer_get_rotation (GnomePieCenterLayer* self)
{
	gdouble result;
	g_return_val_if_fail (self != NULL, -1.0);
	result = self->priv->_rotation;
	return result;
}

void
gnome_pie_center_layer_set_rotation (GnomePieCenterLayer* self,
                                     gdouble value)
{
	gdouble old_value;
	g_return_if_fail (self != NULL);
	old_value = gnome_pie_center_layer_get_rotation (self);
	if (old_value != value) {
		self->priv->_rotation = value;
		g_object_notify_by_pspec ((GObject *) self, gnome_pie_center_layer_properties[GNOME_PIE_CENTER_LAYER_ROTATION_PROPERTY]);
	}
}

static void
gnome_pie_center_layer_class_init (GnomePieCenterLayerClass * klass,
                                   gpointer klass_data)
{
	gnome_pie_center_layer_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GnomePieCenterLayer_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_gnome_pie_center_layer_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gnome_pie_center_layer_set_property;
	G_OBJECT_CLASS (klass)->finalize = gnome_pie_center_layer_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_CENTER_LAYER_IMAGE_PROPERTY, gnome_pie_center_layer_properties[GNOME_PIE_CENTER_LAYER_IMAGE_PROPERTY] = g_param_spec_object ("image", "image", "image", GNOME_PIE_TYPE_IMAGE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_CENTER_LAYER_ACTIVE_SCALE_PROPERTY, gnome_pie_center_layer_properties[GNOME_PIE_CENTER_LAYER_ACTIVE_SCALE_PROPERTY] = g_param_spec_double ("active-scale", "active-scale", "active-scale", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_CENTER_LAYER_ACTIVE_ROTATION_SPEED_PROPERTY, gnome_pie_center_layer_properties[GNOME_PIE_CENTER_LAYER_ACTIVE_ROTATION_SPEED_PROPERTY] = g_param_spec_double ("active-rotation-speed", "active-rotation-speed", "active-rotation-speed", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_CENTER_LAYER_ACTIVE_ALPHA_PROPERTY, gnome_pie_center_layer_properties[GNOME_PIE_CENTER_LAYER_ACTIVE_ALPHA_PROPERTY] = g_param_spec_double ("active-alpha", "active-alpha", "active-alpha", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_CENTER_LAYER_ACTIVE_COLORIZE_PROPERTY, gnome_pie_center_layer_properties[GNOME_PIE_CENTER_LAYER_ACTIVE_COLORIZE_PROPERTY] = g_param_spec_boolean ("active-colorize", "active-colorize", "active-colorize", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_CENTER_LAYER_ACTIVE_ROTATION_MODE_PROPERTY, gnome_pie_center_layer_properties[GNOME_PIE_CENTER_LAYER_ACTIVE_ROTATION_MODE_PROPERTY] = g_param_spec_enum ("active-rotation-mode", "active-rotation-mode", "active-rotation-mode", GNOME_PIE_CENTER_LAYER_TYPE_ROTATION_MODE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_CENTER_LAYER_INACTIVE_SCALE_PROPERTY, gnome_pie_center_layer_properties[GNOME_PIE_CENTER_LAYER_INACTIVE_SCALE_PROPERTY] = g_param_spec_double ("inactive-scale", "inactive-scale", "inactive-scale", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_CENTER_LAYER_INACTIVE_ROTATION_SPEED_PROPERTY, gnome_pie_center_layer_properties[GNOME_PIE_CENTER_LAYER_INACTIVE_ROTATION_SPEED_PROPERTY] = g_param_spec_double ("inactive-rotation-speed", "inactive-rotation-speed", "inactive-rotation-speed", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_CENTER_LAYER_INACTIVE_ALPHA_PROPERTY, gnome_pie_center_layer_properties[GNOME_PIE_CENTER_LAYER_INACTIVE_ALPHA_PROPERTY] = g_param_spec_double ("inactive-alpha", "inactive-alpha", "inactive-alpha", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_CENTER_LAYER_INACTIVE_COLORIZE_PROPERTY, gnome_pie_center_layer_properties[GNOME_PIE_CENTER_LAYER_INACTIVE_COLORIZE_PROPERTY] = g_param_spec_boolean ("inactive-colorize", "inactive-colorize", "inactive-colorize", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_CENTER_LAYER_INACTIVE_ROTATION_MODE_PROPERTY, gnome_pie_center_layer_properties[GNOME_PIE_CENTER_LAYER_INACTIVE_ROTATION_MODE_PROPERTY] = g_param_spec_enum ("inactive-rotation-mode", "inactive-rotation-mode", "inactive-rotation-mode", GNOME_PIE_CENTER_LAYER_TYPE_ROTATION_MODE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GNOME_PIE_CENTER_LAYER_ROTATION_PROPERTY, gnome_pie_center_layer_properties[GNOME_PIE_CENTER_LAYER_ROTATION_PROPERTY] = g_param_spec_double ("rotation", "rotation", "rotation", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
gnome_pie_center_layer_instance_init (GnomePieCenterLayer * self,
                                      gpointer klass)
{
	self->priv = gnome_pie_center_layer_get_instance_private (self);
}

static void
gnome_pie_center_layer_finalize (GObject * obj)
{
	GnomePieCenterLayer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GNOME_PIE_TYPE_CENTER_LAYER, GnomePieCenterLayer);
	_g_object_unref0 (self->priv->_image);
	_g_free0 (self->image_file);
	G_OBJECT_CLASS (gnome_pie_center_layer_parent_class)->finalize (obj);
}

static GType
gnome_pie_center_layer_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GnomePieCenterLayerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gnome_pie_center_layer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GnomePieCenterLayer), 0, (GInstanceInitFunc) gnome_pie_center_layer_instance_init, NULL };
	GType gnome_pie_center_layer_type_id;
	gnome_pie_center_layer_type_id = g_type_register_static (G_TYPE_OBJECT, "GnomePieCenterLayer", &g_define_type_info, 0);
	GnomePieCenterLayer_private_offset = g_type_add_instance_private (gnome_pie_center_layer_type_id, sizeof (GnomePieCenterLayerPrivate));
	return gnome_pie_center_layer_type_id;
}

GType
gnome_pie_center_layer_get_type (void)
{
	static volatile gsize gnome_pie_center_layer_type_id__once = 0;
	if (g_once_init_enter (&gnome_pie_center_layer_type_id__once)) {
		GType gnome_pie_center_layer_type_id;
		gnome_pie_center_layer_type_id = gnome_pie_center_layer_get_type_once ();
		g_once_init_leave (&gnome_pie_center_layer_type_id__once, gnome_pie_center_layer_type_id);
	}
	return gnome_pie_center_layer_type_id__once;
}

static void
_vala_gnome_pie_center_layer_get_property (GObject * object,
                                           guint property_id,
                                           GValue * value,
                                           GParamSpec * pspec)
{
	GnomePieCenterLayer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GNOME_PIE_TYPE_CENTER_LAYER, GnomePieCenterLayer);
	switch (property_id) {
		case GNOME_PIE_CENTER_LAYER_IMAGE_PROPERTY:
		g_value_set_object (value, gnome_pie_center_layer_get_image (self));
		break;
		case GNOME_PIE_CENTER_LAYER_ACTIVE_SCALE_PROPERTY:
		g_value_set_double (value, gnome_pie_center_layer_get_active_scale (self));
		break;
		case GNOME_PIE_CENTER_LAYER_ACTIVE_ROTATION_SPEED_PROPERTY:
		g_value_set_double (value, gnome_pie_center_layer_get_active_rotation_speed (self));
		break;
		case GNOME_PIE_CENTER_LAYER_ACTIVE_ALPHA_PROPERTY:
		g_value_set_double (value, gnome_pie_center_layer_get_active_alpha (self));
		break;
		case GNOME_PIE_CENTER_LAYER_ACTIVE_COLORIZE_PROPERTY:
		g_value_set_boolean (value, gnome_pie_center_layer_get_active_colorize (self));
		break;
		case GNOME_PIE_CENTER_LAYER_ACTIVE_ROTATION_MODE_PROPERTY:
		g_value_set_enum (value, gnome_pie_center_layer_get_active_rotation_mode (self));
		break;
		case GNOME_PIE_CENTER_LAYER_INACTIVE_SCALE_PROPERTY:
		g_value_set_double (value, gnome_pie_center_layer_get_inactive_scale (self));
		break;
		case GNOME_PIE_CENTER_LAYER_INACTIVE_ROTATION_SPEED_PROPERTY:
		g_value_set_double (value, gnome_pie_center_layer_get_inactive_rotation_speed (self));
		break;
		case GNOME_PIE_CENTER_LAYER_INACTIVE_ALPHA_PROPERTY:
		g_value_set_double (value, gnome_pie_center_layer_get_inactive_alpha (self));
		break;
		case GNOME_PIE_CENTER_LAYER_INACTIVE_COLORIZE_PROPERTY:
		g_value_set_boolean (value, gnome_pie_center_layer_get_inactive_colorize (self));
		break;
		case GNOME_PIE_CENTER_LAYER_INACTIVE_ROTATION_MODE_PROPERTY:
		g_value_set_enum (value, gnome_pie_center_layer_get_inactive_rotation_mode (self));
		break;
		case GNOME_PIE_CENTER_LAYER_ROTATION_PROPERTY:
		g_value_set_double (value, gnome_pie_center_layer_get_rotation (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gnome_pie_center_layer_set_property (GObject * object,
                                           guint property_id,
                                           const GValue * value,
                                           GParamSpec * pspec)
{
	GnomePieCenterLayer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GNOME_PIE_TYPE_CENTER_LAYER, GnomePieCenterLayer);
	switch (property_id) {
		case GNOME_PIE_CENTER_LAYER_IMAGE_PROPERTY:
		gnome_pie_center_layer_set_image (self, g_value_get_object (value));
		break;
		case GNOME_PIE_CENTER_LAYER_ACTIVE_SCALE_PROPERTY:
		gnome_pie_center_layer_set_active_scale (self, g_value_get_double (value));
		break;
		case GNOME_PIE_CENTER_LAYER_ACTIVE_ROTATION_SPEED_PROPERTY:
		gnome_pie_center_layer_set_active_rotation_speed (self, g_value_get_double (value));
		break;
		case GNOME_PIE_CENTER_LAYER_ACTIVE_ALPHA_PROPERTY:
		gnome_pie_center_layer_set_active_alpha (self, g_value_get_double (value));
		break;
		case GNOME_PIE_CENTER_LAYER_ACTIVE_COLORIZE_PROPERTY:
		gnome_pie_center_layer_set_active_colorize (self, g_value_get_boolean (value));
		break;
		case GNOME_PIE_CENTER_LAYER_ACTIVE_ROTATION_MODE_PROPERTY:
		gnome_pie_center_layer_set_active_rotation_mode (self, g_value_get_enum (value));
		break;
		case GNOME_PIE_CENTER_LAYER_INACTIVE_SCALE_PROPERTY:
		gnome_pie_center_layer_set_inactive_scale (self, g_value_get_double (value));
		break;
		case GNOME_PIE_CENTER_LAYER_INACTIVE_ROTATION_SPEED_PROPERTY:
		gnome_pie_center_layer_set_inactive_rotation_speed (self, g_value_get_double (value));
		break;
		case GNOME_PIE_CENTER_LAYER_INACTIVE_ALPHA_PROPERTY:
		gnome_pie_center_layer_set_inactive_alpha (self, g_value_get_double (value));
		break;
		case GNOME_PIE_CENTER_LAYER_INACTIVE_COLORIZE_PROPERTY:
		gnome_pie_center_layer_set_inactive_colorize (self, g_value_get_boolean (value));
		break;
		case GNOME_PIE_CENTER_LAYER_INACTIVE_ROTATION_MODE_PROPERTY:
		gnome_pie_center_layer_set_inactive_rotation_mode (self, g_value_get_enum (value));
		break;
		case GNOME_PIE_CENTER_LAYER_ROTATION_PROPERTY:
		gnome_pie_center_layer_set_rotation (self, g_value_get_double (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

