/* fadable.c generated by valac 0.56.19, the Vala compiler
 * generated from fadable.vala, do not modify */

/* -*- Mode: Vala; indent-tabs-mode: nil; tab-width: 4 -*-
 *
 * Copyright (C) 2012 Canonical Ltd
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 3 as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Authors: Michael Terry <michael.terry@canonical.com>
 */

#include <glib-object.h>
#include <glib.h>
#include <float.h>
#include <math.h>
#include <gtk/gtk.h>
#include <string.h>

#define ANIMATE_TIMER_INSTANT 150
#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 TYPE_FADE_TRACKER (fade_tracker_get_type ())
#define FADE_TRACKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FADE_TRACKER, FadeTracker))
#define FADE_TRACKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FADE_TRACKER, FadeTrackerClass))
#define IS_FADE_TRACKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FADE_TRACKER))
#define IS_FADE_TRACKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FADE_TRACKER))
#define FADE_TRACKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FADE_TRACKER, FadeTrackerClass))

typedef struct _FadeTracker FadeTracker;
typedef struct _FadeTrackerClass FadeTrackerClass;
typedef struct _FadeTrackerPrivate FadeTrackerPrivate;

#define TYPE_ANIMATE_TIMER (animate_timer_get_type ())
#define ANIMATE_TIMER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ANIMATE_TIMER, AnimateTimer))
#define ANIMATE_TIMER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ANIMATE_TIMER, AnimateTimerClass))
#define IS_ANIMATE_TIMER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ANIMATE_TIMER))
#define IS_ANIMATE_TIMER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ANIMATE_TIMER))
#define ANIMATE_TIMER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ANIMATE_TIMER, AnimateTimerClass))

typedef struct _AnimateTimer AnimateTimer;
typedef struct _AnimateTimerClass AnimateTimerClass;
typedef enum  {
	FADE_TRACKER_MODE_FADE_IN,
	FADE_TRACKER_MODE_FADE_OUT
} FadeTrackerMode;

#define FADE_TRACKER_TYPE_MODE (fade_tracker_mode_get_type ())
enum  {
	FADE_TRACKER_0_PROPERTY,
	FADE_TRACKER_ALPHA_PROPERTY,
	FADE_TRACKER_WIDGET_PROPERTY,
	FADE_TRACKER_NUM_PROPERTIES
};
static GParamSpec* fade_tracker_properties[FADE_TRACKER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef gdouble (*AnimateTimerEasingFunc) (gdouble x, gpointer user_data);
enum  {
	FADE_TRACKER_DONE_SIGNAL,
	FADE_TRACKER_NUM_SIGNALS
};
static guint fade_tracker_signals[FADE_TRACKER_NUM_SIGNALS] = {0};

#define TYPE_FADABLE (fadable_get_type ())
#define FADABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FADABLE, Fadable))
#define IS_FADABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FADABLE))
#define FADABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_FADABLE, FadableIface))

typedef struct _Fadable Fadable;
typedef struct _FadableIface FadableIface;

struct _FadeTracker {
	GObject parent_instance;
	FadeTrackerPrivate * priv;
};

struct _FadeTrackerClass {
	GObjectClass parent_class;
};

struct _FadeTrackerPrivate {
	gdouble _alpha;
	GtkWidget* _widget;
	AnimateTimer* timer;
	FadeTrackerMode mode;
};

struct _FadableIface {
	GTypeInterface parent_iface;
	FadeTracker* (*get_fade_tracker) (Fadable* self);
	void (*set_fade_tracker) (Fadable* self, FadeTracker* value);
};

static gint FadeTracker_private_offset;
static gpointer fade_tracker_parent_class = NULL;

VALA_EXTERN GType fade_tracker_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FadeTracker, g_object_unref)
VALA_EXTERN GType animate_timer_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AnimateTimer, g_object_unref)
VALA_EXTERN GType fade_tracker_mode_get_type (void) G_GNUC_CONST ;
VALA_EXTERN FadeTracker* fade_tracker_new (GtkWidget* widget);
VALA_EXTERN FadeTracker* fade_tracker_construct (GType object_type,
                                     GtkWidget* widget);
VALA_EXTERN void fade_tracker_reset (FadeTracker* self,
                         FadeTrackerMode mode);
static void fade_tracker_animate_cb (FadeTracker* self,
                              gdouble progress);
VALA_EXTERN GtkWidget* fade_tracker_get_widget (FadeTracker* self);
VALA_EXTERN void animate_timer_reset (AnimateTimer* self,
                          gint temp_speed);
VALA_EXTERN void fade_tracker_set_alpha (FadeTracker* self,
                             gdouble value);
VALA_EXTERN gdouble fade_tracker_get_alpha (FadeTracker* self);
static void fade_tracker_set_widget (FadeTracker* self,
                              GtkWidget* value);
static GObject * fade_tracker_constructor (GType type,
                                    guint n_construct_properties,
                                    GObjectConstructParam * construct_properties);
VALA_EXTERN gdouble animate_timer_ease_out_quint (gdouble x);
static gdouble _animate_timer_ease_out_quint_animate_timer_easing_func (gdouble x,
                                                                 gpointer self);
VALA_EXTERN AnimateTimer* animate_timer_new (AnimateTimerEasingFunc func,
                                 gpointer func_target,
                                 gint speed);
VALA_EXTERN AnimateTimer* animate_timer_construct (GType object_type,
                                       AnimateTimerEasingFunc func,
                                       gpointer func_target,
                                       gint speed);
static void _fade_tracker_animate_cb_animate_timer_animate (AnimateTimer* _sender,
                                                     gdouble progress,
                                                     gpointer self);
static void fade_tracker_finalize (GObject * obj);
static GType fade_tracker_get_type_once (void);
static void _vala_fade_tracker_get_property (GObject * object,
                                      guint property_id,
                                      GValue * value,
                                      GParamSpec * pspec);
static void _vala_fade_tracker_set_property (GObject * object,
                                      guint property_id,
                                      const GValue * value,
                                      GParamSpec * pspec);
VALA_EXTERN GType fadable_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Fadable, g_object_unref)
VALA_EXTERN void fadable_fade_in (Fadable* self);
VALA_EXTERN FadeTracker* fadable_get_fade_tracker (Fadable* self);
VALA_EXTERN void fadable_fade_out (Fadable* self);
VALA_EXTERN void fadable_set_alpha (Fadable* self,
                        gdouble alpha);
VALA_EXTERN void fadable_set_fade_tracker (Fadable* self,
                               FadeTracker* value);
static GType fadable_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
fade_tracker_get_instance_private (FadeTracker* self)
{
	return G_STRUCT_MEMBER_P (self, FadeTracker_private_offset);
}

static GType
fade_tracker_mode_get_type_once (void)
{
	static const GEnumValue values[] = {{FADE_TRACKER_MODE_FADE_IN, "FADE_TRACKER_MODE_FADE_IN", "fade-in"}, {FADE_TRACKER_MODE_FADE_OUT, "FADE_TRACKER_MODE_FADE_OUT", "fade-out"}, {0, NULL, NULL}};
	GType fade_tracker_mode_type_id;
	fade_tracker_mode_type_id = g_enum_register_static ("FadeTrackerMode", values);
	return fade_tracker_mode_type_id;
}

GType
fade_tracker_mode_get_type (void)
{
	static volatile gsize fade_tracker_mode_type_id__once = 0;
	if (g_once_init_enter (&fade_tracker_mode_type_id__once)) {
		GType fade_tracker_mode_type_id;
		fade_tracker_mode_type_id = fade_tracker_mode_get_type_once ();
		g_once_init_leave (&fade_tracker_mode_type_id__once, fade_tracker_mode_type_id);
	}
	return fade_tracker_mode_type_id__once;
}

FadeTracker*
fade_tracker_construct (GType object_type,
                        GtkWidget* widget)
{
	FadeTracker * self = NULL;
#line 33 "../src/fadable.vala"
	g_return_val_if_fail (widget != NULL, NULL);
#line 35 "../src/fadable.vala"
	self = (FadeTracker*) g_object_new (object_type, "widget", widget, NULL);
#line 33 "../src/fadable.vala"
	return self;
#line 221 "fadable.c"
}

FadeTracker*
fade_tracker_new (GtkWidget* widget)
{
#line 33 "../src/fadable.vala"
	return fade_tracker_construct (TYPE_FADE_TRACKER, widget);
#line 229 "fadable.c"
}

void
fade_tracker_reset (FadeTracker* self,
                    FadeTrackerMode mode)
{
	GtkWidget* _tmp0_;
	AnimateTimer* _tmp1_;
#line 38 "../src/fadable.vala"
	g_return_if_fail (self != NULL);
#line 40 "../src/fadable.vala"
	self->priv->mode = mode;
#line 41 "../src/fadable.vala"
	fade_tracker_animate_cb (self, 0.0);
#line 42 "../src/fadable.vala"
	_tmp0_ = self->priv->_widget;
#line 42 "../src/fadable.vala"
	gtk_widget_show (_tmp0_);
#line 43 "../src/fadable.vala"
	_tmp1_ = self->priv->timer;
#line 43 "../src/fadable.vala"
	animate_timer_reset (_tmp1_, -1);
#line 252 "fadable.c"
}

static void
fade_tracker_animate_cb (FadeTracker* self,
                         gdouble progress)
{
	GtkWidget* _tmp1_;
#line 55 "../src/fadable.vala"
	g_return_if_fail (self != NULL);
#line 57 "../src/fadable.vala"
	if (self->priv->mode == FADE_TRACKER_MODE_FADE_IN) {
#line 59 "../src/fadable.vala"
		fade_tracker_set_alpha (self, progress);
#line 60 "../src/fadable.vala"
		if (progress == 1.0) {
#line 62 "../src/fadable.vala"
			g_signal_emit (self, fade_tracker_signals[FADE_TRACKER_DONE_SIGNAL], 0);
#line 270 "fadable.c"
		}
	} else {
#line 67 "../src/fadable.vala"
		fade_tracker_set_alpha (self, 1.0 - progress);
#line 68 "../src/fadable.vala"
		if (progress == 1.0) {
#line 277 "fadable.c"
			GtkWidget* _tmp0_;
#line 70 "../src/fadable.vala"
			_tmp0_ = self->priv->_widget;
#line 70 "../src/fadable.vala"
			gtk_widget_hide (_tmp0_);
#line 71 "../src/fadable.vala"
			g_signal_emit (self, fade_tracker_signals[FADE_TRACKER_DONE_SIGNAL], 0);
#line 285 "fadable.c"
		}
	}
#line 75 "../src/fadable.vala"
	_tmp1_ = self->priv->_widget;
#line 75 "../src/fadable.vala"
	gtk_widget_queue_draw (_tmp1_);
#line 292 "fadable.c"
}

gdouble
fade_tracker_get_alpha (FadeTracker* self)
{
	gdouble result;
#line 24 "../src/fadable.vala"
	g_return_val_if_fail (self != NULL, -1.0);
#line 24 "../src/fadable.vala"
	result = self->priv->_alpha;
#line 24 "../src/fadable.vala"
	return result;
#line 305 "fadable.c"
}

void
fade_tracker_set_alpha (FadeTracker* self,
                        gdouble value)
{
	gdouble old_value;
#line 24 "../src/fadable.vala"
	g_return_if_fail (self != NULL);
#line 24 "../src/fadable.vala"
	old_value = fade_tracker_get_alpha (self);
#line 24 "../src/fadable.vala"
	if (old_value != value) {
#line 24 "../src/fadable.vala"
		self->priv->_alpha = value;
#line 24 "../src/fadable.vala"
		g_object_notify_by_pspec ((GObject *) self, fade_tracker_properties[FADE_TRACKER_ALPHA_PROPERTY]);
#line 323 "fadable.c"
	}
}

GtkWidget*
fade_tracker_get_widget (FadeTracker* self)
{
	GtkWidget* result;
	GtkWidget* _tmp0_;
#line 25 "../src/fadable.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 25 "../src/fadable.vala"
	_tmp0_ = self->priv->_widget;
#line 25 "../src/fadable.vala"
	result = _tmp0_;
#line 25 "../src/fadable.vala"
	return result;
#line 340 "fadable.c"
}

static gpointer
_g_object_ref0 (gpointer self)
{
#line 25 "../src/fadable.vala"
	return self ? g_object_ref (self) : NULL;
#line 348 "fadable.c"
}

static void
fade_tracker_set_widget (FadeTracker* self,
                         GtkWidget* value)
{
	GtkWidget* old_value;
#line 25 "../src/fadable.vala"
	g_return_if_fail (self != NULL);
#line 25 "../src/fadable.vala"
	old_value = fade_tracker_get_widget (self);
#line 25 "../src/fadable.vala"
	if (old_value != value) {
#line 362 "fadable.c"
		GtkWidget* _tmp0_;
#line 25 "../src/fadable.vala"
		_tmp0_ = _g_object_ref0 (value);
#line 25 "../src/fadable.vala"
		_g_object_unref0 (self->priv->_widget);
#line 25 "../src/fadable.vala"
		self->priv->_widget = _tmp0_;
#line 25 "../src/fadable.vala"
		g_object_notify_by_pspec ((GObject *) self, fade_tracker_properties[FADE_TRACKER_WIDGET_PROPERTY]);
#line 372 "fadable.c"
	}
}

static gdouble
_animate_timer_ease_out_quint_animate_timer_easing_func (gdouble x,
                                                         gpointer self)
{
	gdouble result;
	result = animate_timer_ease_out_quint (x);
#line 51 "../src/fadable.vala"
	return result;
#line 384 "fadable.c"
}

static void
_fade_tracker_animate_cb_animate_timer_animate (AnimateTimer* _sender,
                                                gdouble progress,
                                                gpointer self)
{
#line 52 "../src/fadable.vala"
	fade_tracker_animate_cb ((FadeTracker*) self, progress);
#line 394 "fadable.c"
}

static GObject *
fade_tracker_constructor (GType type,
                          guint n_construct_properties,
                          GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	FadeTracker * self;
	AnimateTimer* _tmp0_;
	AnimateTimer* _tmp1_;
#line 49 "../src/fadable.vala"
	parent_class = G_OBJECT_CLASS (fade_tracker_parent_class);
#line 49 "../src/fadable.vala"
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
#line 49 "../src/fadable.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_FADE_TRACKER, FadeTracker);
#line 51 "../src/fadable.vala"
	_tmp0_ = animate_timer_new (_animate_timer_ease_out_quint_animate_timer_easing_func, NULL, ANIMATE_TIMER_INSTANT);
#line 51 "../src/fadable.vala"
	_g_object_unref0 (self->priv->timer);
#line 51 "../src/fadable.vala"
	self->priv->timer = _tmp0_;
#line 52 "../src/fadable.vala"
	_tmp1_ = self->priv->timer;
#line 52 "../src/fadable.vala"
	g_signal_connect_object (_tmp1_, "animate", (GCallback) _fade_tracker_animate_cb_animate_timer_animate, self, 0);
#line 49 "../src/fadable.vala"
	return obj;
#line 425 "fadable.c"
}

static void
fade_tracker_class_init (FadeTrackerClass * klass,
                         gpointer klass_data)
{
#line 20 "../src/fadable.vala"
	fade_tracker_parent_class = g_type_class_peek_parent (klass);
#line 20 "../src/fadable.vala"
	g_type_class_adjust_private_offset (klass, &FadeTracker_private_offset);
#line 20 "../src/fadable.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_fade_tracker_get_property;
#line 20 "../src/fadable.vala"
	G_OBJECT_CLASS (klass)->set_property = _vala_fade_tracker_set_property;
#line 20 "../src/fadable.vala"
	G_OBJECT_CLASS (klass)->constructor = fade_tracker_constructor;
#line 20 "../src/fadable.vala"
	G_OBJECT_CLASS (klass)->finalize = fade_tracker_finalize;
#line 20 "../src/fadable.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), FADE_TRACKER_ALPHA_PROPERTY, fade_tracker_properties[FADE_TRACKER_ALPHA_PROPERTY] = g_param_spec_double ("alpha", "alpha", "alpha", -G_MAXDOUBLE, G_MAXDOUBLE, 1.0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
#line 20 "../src/fadable.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), FADE_TRACKER_WIDGET_PROPERTY, fade_tracker_properties[FADE_TRACKER_WIDGET_PROPERTY] = g_param_spec_object ("widget", "widget", "widget", gtk_widget_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
#line 20 "../src/fadable.vala"
	fade_tracker_signals[FADE_TRACKER_DONE_SIGNAL] = g_signal_new ("done", TYPE_FADE_TRACKER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
#line 450 "fadable.c"
}

static void
fade_tracker_instance_init (FadeTracker * self,
                            gpointer klass)
{
#line 20 "../src/fadable.vala"
	self->priv = fade_tracker_get_instance_private (self);
#line 24 "../src/fadable.vala"
	self->priv->_alpha = 1.0;
#line 461 "fadable.c"
}

static void
fade_tracker_finalize (GObject * obj)
{
	FadeTracker * self;
#line 20 "../src/fadable.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_FADE_TRACKER, FadeTracker);
#line 25 "../src/fadable.vala"
	_g_object_unref0 (self->priv->_widget);
#line 46 "../src/fadable.vala"
	_g_object_unref0 (self->priv->timer);
#line 20 "../src/fadable.vala"
	G_OBJECT_CLASS (fade_tracker_parent_class)->finalize (obj);
#line 476 "fadable.c"
}

static GType
fade_tracker_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FadeTrackerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) fade_tracker_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FadeTracker), 0, (GInstanceInitFunc) fade_tracker_instance_init, NULL };
	GType fade_tracker_type_id;
	fade_tracker_type_id = g_type_register_static (G_TYPE_OBJECT, "FadeTracker", &g_define_type_info, 0);
	FadeTracker_private_offset = g_type_add_instance_private (fade_tracker_type_id, sizeof (FadeTrackerPrivate));
	return fade_tracker_type_id;
}

GType
fade_tracker_get_type (void)
{
	static volatile gsize fade_tracker_type_id__once = 0;
	if (g_once_init_enter (&fade_tracker_type_id__once)) {
		GType fade_tracker_type_id;
		fade_tracker_type_id = fade_tracker_get_type_once ();
		g_once_init_leave (&fade_tracker_type_id__once, fade_tracker_type_id);
	}
	return fade_tracker_type_id__once;
}

static void
_vala_fade_tracker_get_property (GObject * object,
                                 guint property_id,
                                 GValue * value,
                                 GParamSpec * pspec)
{
	FadeTracker * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_FADE_TRACKER, FadeTracker);
#line 20 "../src/fadable.vala"
	switch (property_id) {
#line 20 "../src/fadable.vala"
		case FADE_TRACKER_ALPHA_PROPERTY:
#line 20 "../src/fadable.vala"
		g_value_set_double (value, fade_tracker_get_alpha (self));
#line 20 "../src/fadable.vala"
		break;
#line 20 "../src/fadable.vala"
		case FADE_TRACKER_WIDGET_PROPERTY:
#line 20 "../src/fadable.vala"
		g_value_set_object (value, fade_tracker_get_widget (self));
#line 20 "../src/fadable.vala"
		break;
#line 523 "fadable.c"
		default:
#line 20 "../src/fadable.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 20 "../src/fadable.vala"
		break;
#line 529 "fadable.c"
	}
}

static void
_vala_fade_tracker_set_property (GObject * object,
                                 guint property_id,
                                 const GValue * value,
                                 GParamSpec * pspec)
{
	FadeTracker * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_FADE_TRACKER, FadeTracker);
#line 20 "../src/fadable.vala"
	switch (property_id) {
#line 20 "../src/fadable.vala"
		case FADE_TRACKER_ALPHA_PROPERTY:
#line 20 "../src/fadable.vala"
		fade_tracker_set_alpha (self, g_value_get_double (value));
#line 20 "../src/fadable.vala"
		break;
#line 20 "../src/fadable.vala"
		case FADE_TRACKER_WIDGET_PROPERTY:
#line 20 "../src/fadable.vala"
		fade_tracker_set_widget (self, g_value_get_object (value));
#line 20 "../src/fadable.vala"
		break;
#line 555 "fadable.c"
		default:
#line 20 "../src/fadable.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 20 "../src/fadable.vala"
		break;
#line 561 "fadable.c"
	}
}

void
fadable_fade_in (Fadable* self)
{
	FadeTracker* _tmp0_;
	FadeTracker* _tmp1_;
#line 85 "../src/fadable.vala"
	_tmp0_ = fadable_get_fade_tracker (self);
#line 85 "../src/fadable.vala"
	_tmp1_ = _tmp0_;
#line 85 "../src/fadable.vala"
	fade_tracker_reset (_tmp1_, FADE_TRACKER_MODE_FADE_IN);
#line 576 "fadable.c"
}

void
fadable_fade_out (Fadable* self)
{
	FadeTracker* _tmp0_;
	FadeTracker* _tmp1_;
#line 90 "../src/fadable.vala"
	_tmp0_ = fadable_get_fade_tracker (self);
#line 90 "../src/fadable.vala"
	_tmp1_ = _tmp0_;
#line 90 "../src/fadable.vala"
	fade_tracker_reset (_tmp1_, FADE_TRACKER_MODE_FADE_OUT);
#line 590 "fadable.c"
}

void
fadable_set_alpha (Fadable* self,
                   gdouble alpha)
{
	FadeTracker* _tmp0_;
	FadeTracker* _tmp1_;
#line 96 "../src/fadable.vala"
	_tmp0_ = fadable_get_fade_tracker (self);
#line 96 "../src/fadable.vala"
	_tmp1_ = _tmp0_;
#line 96 "../src/fadable.vala"
	fade_tracker_set_alpha (_tmp1_, alpha);
#line 97 "../src/fadable.vala"
	gtk_widget_queue_draw ((GtkWidget*) self);
#line 607 "fadable.c"
}

FadeTracker*
fadable_get_fade_tracker (Fadable* self)
{
	FadableIface* _iface_;
#line 81 "../src/fadable.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 81 "../src/fadable.vala"
	_iface_ = FADABLE_GET_INTERFACE (self);
#line 81 "../src/fadable.vala"
	if (_iface_->get_fade_tracker) {
#line 81 "../src/fadable.vala"
		return _iface_->get_fade_tracker (self);
#line 622 "fadable.c"
	}
#line 81 "../src/fadable.vala"
	return NULL;
#line 626 "fadable.c"
}

void
fadable_set_fade_tracker (Fadable* self,
                          FadeTracker* value)
{
	FadableIface* _iface_;
#line 81 "../src/fadable.vala"
	g_return_if_fail (self != NULL);
#line 81 "../src/fadable.vala"
	_iface_ = FADABLE_GET_INTERFACE (self);
#line 81 "../src/fadable.vala"
	if (_iface_->set_fade_tracker) {
#line 81 "../src/fadable.vala"
		_iface_->set_fade_tracker (self, value);
#line 642 "fadable.c"
	}
}

static void
fadable_default_init (FadableIface * iface,
                      gpointer iface_data)
{
#line 79 "../src/fadable.vala"
	g_object_interface_install_property (iface, g_param_spec_object ("fade-tracker", "fade-tracker", "fade-tracker", TYPE_FADE_TRACKER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
#line 652 "fadable.c"
}

static GType
fadable_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FadableIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) fadable_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType fadable_type_id;
	fadable_type_id = g_type_register_static (G_TYPE_INTERFACE, "Fadable", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (fadable_type_id, gtk_widget_get_type ());
	return fadable_type_id;
}

GType
fadable_get_type (void)
{
	static volatile gsize fadable_type_id__once = 0;
	if (g_once_init_enter (&fadable_type_id__once)) {
		GType fadable_type_id;
		fadable_type_id = fadable_get_type_once ();
		g_once_init_leave (&fadable_type_id__once, fadable_type_id);
	}
	return fadable_type_id__once;
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

