/* dash-button.c generated by valac 0.56.19, the Vala compiler
 * generated from dash-button.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 <gtk/gtk.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <cairo-gobject.h>
#include "config.h"
#include <gdk-pixbuf/gdk-pixbuf.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 TYPE_FLAT_BUTTON (flat_button_get_type ())
#define FLAT_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FLAT_BUTTON, FlatButton))
#define FLAT_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FLAT_BUTTON, FlatButtonClass))
#define IS_FLAT_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FLAT_BUTTON))
#define IS_FLAT_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FLAT_BUTTON))
#define FLAT_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FLAT_BUTTON, FlatButtonClass))

typedef struct _FlatButton FlatButton;
typedef struct _FlatButtonClass FlatButtonClass;
typedef struct _FlatButtonPrivate FlatButtonPrivate;

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

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

#define TYPE_DASH_BUTTON (dash_button_get_type ())
#define DASH_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DASH_BUTTON, DashButton))
#define DASH_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DASH_BUTTON, DashButtonClass))
#define IS_DASH_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DASH_BUTTON))
#define IS_DASH_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DASH_BUTTON))
#define DASH_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DASH_BUTTON, DashButtonClass))

typedef struct _DashButton DashButton;
typedef struct _DashButtonClass DashButtonClass;
typedef struct _DashButtonPrivate DashButtonPrivate;
enum  {
	DASH_BUTTON_0_PROPERTY,
	DASH_BUTTON_FADE_TRACKER_PROPERTY,
	DASH_BUTTON_TEXT_PROPERTY,
	DASH_BUTTON_NUM_PROPERTIES
};
static GParamSpec* dash_button_properties[DASH_BUTTON_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))

#define TYPE_CACHED_IMAGE (cached_image_get_type ())
#define CACHED_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CACHED_IMAGE, CachedImage))
#define CACHED_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CACHED_IMAGE, CachedImageClass))
#define IS_CACHED_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CACHED_IMAGE))
#define IS_CACHED_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CACHED_IMAGE))
#define CACHED_IMAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CACHED_IMAGE, CachedImageClass))

typedef struct _CachedImage CachedImage;
typedef struct _CachedImageClass CachedImageClass;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

struct _FlatButton {
	GtkButton parent_instance;
	FlatButtonPrivate * priv;
};

struct _FlatButtonClass {
	GtkButtonClass parent_class;
};

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

struct _DashButton {
	FlatButton parent_instance;
	DashButtonPrivate * priv;
};

struct _DashButtonClass {
	FlatButtonClass parent_class;
};

struct _DashButtonPrivate {
	FadeTracker* _fade_tracker;
	GtkLabel* text_label;
	gchar* _text;
};

static gint DashButton_private_offset;
static gpointer dash_button_parent_class = NULL;
static FadableIface * dash_button_fadable_parent_iface = NULL;

VALA_EXTERN GType flat_button_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FlatButton, g_object_unref)
VALA_EXTERN GType fade_tracker_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FadeTracker, g_object_unref)
VALA_EXTERN GType fadable_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Fadable, g_object_unref)
VALA_EXTERN GType dash_button_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DashButton, g_object_unref)
VALA_EXTERN DashButton* dash_button_new (const gchar* text);
VALA_EXTERN DashButton* dash_button_construct (GType object_type,
                                   const gchar* text);
VALA_EXTERN FlatButton* flat_button_new (void);
VALA_EXTERN FlatButton* flat_button_construct (GType object_type);
VALA_EXTERN FadeTracker* fade_tracker_new (GtkWidget* widget);
VALA_EXTERN FadeTracker* fade_tracker_construct (GType object_type,
                                     GtkWidget* widget);
VALA_EXTERN void fadable_set_fade_tracker (Fadable* self,
                               FadeTracker* value);
VALA_EXTERN void dash_button_set_text (DashButton* self,
                           const gchar* value);
VALA_EXTERN GType cached_image_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CachedImage, g_object_unref)
VALA_EXTERN CachedImage* cached_image_new (GdkPixbuf* pixbuf);
VALA_EXTERN CachedImage* cached_image_construct (GType object_type,
                                     GdkPixbuf* pixbuf);
static gboolean dash_button_real_draw (GtkWidget* base,
                                cairo_t* c);
VALA_EXTERN FadeTracker* fadable_get_fade_tracker (Fadable* self);
VALA_EXTERN gdouble fade_tracker_get_alpha (FadeTracker* self);
VALA_EXTERN const gchar* dash_button_get_text (DashButton* self);
static void dash_button_finalize (GObject * obj);
static GType dash_button_get_type_once (void);
static void _vala_dash_button_get_property (GObject * object,
                                     guint property_id,
                                     GValue * value,
                                     GParamSpec * pspec);
static void _vala_dash_button_set_property (GObject * object,
                                     guint property_id,
                                     const GValue * value,
                                     GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
dash_button_get_instance_private (DashButton* self)
{
	return G_STRUCT_MEMBER_P (self, DashButton_private_offset);
}

DashButton*
dash_button_construct (GType object_type,
                       const gchar* text)
{
	DashButton * self = NULL;
	FadeTracker* _tmp0_;
	FadeTracker* _tmp1_;
	GtkBox* hbox = NULL;
	GtkBox* _tmp2_;
	GtkLabel* _tmp3_;
	GtkLabel* _tmp4_;
	GtkLabel* _tmp5_;
	GtkLabel* _tmp6_;
	GtkLabel* _tmp7_;
	gchar* path = NULL;
	gchar* _tmp8_;
	GError* _inner_error0_ = NULL;
#line 36 "../src/dash-button.vala"
	g_return_val_if_fail (text != NULL, NULL);
#line 36 "../src/dash-button.vala"
	self = (DashButton*) flat_button_construct (object_type);
#line 38 "../src/dash-button.vala"
	_tmp0_ = fade_tracker_new ((GtkWidget*) self);
#line 38 "../src/dash-button.vala"
	_tmp1_ = _tmp0_;
#line 38 "../src/dash-button.vala"
	fadable_set_fade_tracker ((Fadable*) self, _tmp1_);
#line 38 "../src/dash-button.vala"
	_g_object_unref0 (_tmp1_);
#line 40 "../src/dash-button.vala"
	_tmp2_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
#line 40 "../src/dash-button.vala"
	g_object_ref_sink (_tmp2_);
#line 40 "../src/dash-button.vala"
	hbox = _tmp2_;
#line 43 "../src/dash-button.vala"
	_tmp3_ = (GtkLabel*) gtk_label_new ("");
#line 43 "../src/dash-button.vala"
	g_object_ref_sink (_tmp3_);
#line 43 "../src/dash-button.vala"
	_g_object_unref0 (self->priv->text_label);
#line 43 "../src/dash-button.vala"
	self->priv->text_label = _tmp3_;
#line 44 "../src/dash-button.vala"
	_tmp4_ = self->priv->text_label;
#line 44 "../src/dash-button.vala"
	gtk_label_set_use_markup (_tmp4_, TRUE);
#line 45 "../src/dash-button.vala"
	_tmp5_ = self->priv->text_label;
#line 45 "../src/dash-button.vala"
	gtk_widget_set_hexpand ((GtkWidget*) _tmp5_, TRUE);
#line 46 "../src/dash-button.vala"
	_tmp6_ = self->priv->text_label;
#line 46 "../src/dash-button.vala"
	gtk_widget_set_halign ((GtkWidget*) _tmp6_, GTK_ALIGN_START);
#line 47 "../src/dash-button.vala"
	_tmp7_ = self->priv->text_label;
#line 47 "../src/dash-button.vala"
	gtk_container_add ((GtkContainer*) hbox, (GtkWidget*) _tmp7_);
#line 48 "../src/dash-button.vala"
	dash_button_set_text (self, text);
#line 51 "../src/dash-button.vala"
	_tmp8_ = g_build_filename (PKGDATADIR, "arrow_right.svg", NULL, NULL);
#line 51 "../src/dash-button.vala"
	path = _tmp8_;
#line 261 "dash-button.c"
	{
		GdkPixbuf* pixbuf = NULL;
		GdkPixbuf* _tmp9_;
		CachedImage* image = NULL;
		CachedImage* _tmp10_;
		CachedImage* _tmp11_;
		CachedImage* _tmp12_;
#line 54 "../src/dash-button.vala"
		_tmp9_ = gdk_pixbuf_new_from_file (path, &_inner_error0_);
#line 54 "../src/dash-button.vala"
		pixbuf = _tmp9_;
#line 54 "../src/dash-button.vala"
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 275 "dash-button.c"
			goto __catch0_g_error;
		}
#line 55 "../src/dash-button.vala"
		_tmp10_ = cached_image_new (pixbuf);
#line 55 "../src/dash-button.vala"
		g_object_ref_sink (_tmp10_);
#line 55 "../src/dash-button.vala"
		image = _tmp10_;
#line 56 "../src/dash-button.vala"
		_tmp11_ = image;
#line 56 "../src/dash-button.vala"
		gtk_widget_set_valign ((GtkWidget*) _tmp11_, GTK_ALIGN_CENTER);
#line 57 "../src/dash-button.vala"
		_tmp12_ = image;
#line 57 "../src/dash-button.vala"
		gtk_container_add ((GtkContainer*) hbox, (GtkWidget*) _tmp12_);
#line 52 "../src/dash-button.vala"
		_g_object_unref0 (image);
#line 52 "../src/dash-button.vala"
		_g_object_unref0 (pixbuf);
#line 296 "dash-button.c"
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp13_;
		const gchar* _tmp14_;
#line 52 "../src/dash-button.vala"
		e = _inner_error0_;
#line 52 "../src/dash-button.vala"
		_inner_error0_ = NULL;
#line 61 "../src/dash-button.vala"
		_tmp13_ = e;
#line 61 "../src/dash-button.vala"
		_tmp14_ = _tmp13_->message;
#line 61 "../src/dash-button.vala"
		g_debug ("dash-button.vala:61: Error loading image %s: %s", path, _tmp14_);
#line 52 "../src/dash-button.vala"
		_g_error_free0 (e);
#line 316 "dash-button.c"
	}
	__finally0:
#line 52 "../src/dash-button.vala"
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 52 "../src/dash-button.vala"
		_g_free0 (path);
#line 52 "../src/dash-button.vala"
		_g_object_unref0 (hbox);
#line 52 "../src/dash-button.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
#line 52 "../src/dash-button.vala"
		g_clear_error (&_inner_error0_);
#line 52 "../src/dash-button.vala"
		return NULL;
#line 331 "dash-button.c"
	}
#line 64 "../src/dash-button.vala"
	gtk_widget_show_all ((GtkWidget*) hbox);
#line 65 "../src/dash-button.vala"
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) hbox);
#line 337 "dash-button.c"
	{
		GtkCssProvider* style = NULL;
		GtkCssProvider* _tmp15_;
		GtkStyleContext* _tmp16_;
#line 69 "../src/dash-button.vala"
		_tmp15_ = gtk_css_provider_new ();
#line 69 "../src/dash-button.vala"
		style = _tmp15_;
#line 70 "../src/dash-button.vala"
		gtk_css_provider_load_from_data (style, "* {padding: 6px 8px 6px 8px;}", (gssize) -1, &_inner_error0_);
#line 70 "../src/dash-button.vala"
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 70 "../src/dash-button.vala"
			_g_object_unref0 (style);
#line 352 "dash-button.c"
			goto __catch1_g_error;
		}
#line 71 "../src/dash-button.vala"
		_tmp16_ = gtk_widget_get_style_context ((GtkWidget*) self);
#line 71 "../src/dash-button.vala"
		gtk_style_context_add_provider (_tmp16_, (GtkStyleProvider*) style, (guint) GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
#line 67 "../src/dash-button.vala"
		_g_object_unref0 (style);
#line 361 "dash-button.c"
	}
	goto __finally1;
	__catch1_g_error:
	{
		GError* e = NULL;
		GError* _tmp17_;
		const gchar* _tmp18_;
#line 67 "../src/dash-button.vala"
		e = _inner_error0_;
#line 67 "../src/dash-button.vala"
		_inner_error0_ = NULL;
#line 75 "../src/dash-button.vala"
		_tmp17_ = e;
#line 75 "../src/dash-button.vala"
		_tmp18_ = _tmp17_->message;
#line 75 "../src/dash-button.vala"
		g_debug ("dash-button.vala:75: Internal error loading session chooser style: %s", _tmp18_);
#line 67 "../src/dash-button.vala"
		_g_error_free0 (e);
#line 381 "dash-button.c"
	}
	__finally1:
#line 67 "../src/dash-button.vala"
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 67 "../src/dash-button.vala"
		_g_free0 (path);
#line 67 "../src/dash-button.vala"
		_g_object_unref0 (hbox);
#line 67 "../src/dash-button.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
#line 67 "../src/dash-button.vala"
		g_clear_error (&_inner_error0_);
#line 67 "../src/dash-button.vala"
		return NULL;
#line 396 "dash-button.c"
	}
#line 36 "../src/dash-button.vala"
	_g_free0 (path);
#line 36 "../src/dash-button.vala"
	_g_object_unref0 (hbox);
#line 36 "../src/dash-button.vala"
	return self;
#line 404 "dash-button.c"
}

DashButton*
dash_button_new (const gchar* text)
{
#line 36 "../src/dash-button.vala"
	return dash_button_construct (TYPE_DASH_BUTTON, text);
#line 412 "dash-button.c"
}

static gboolean
dash_button_real_draw (GtkWidget* base,
                       cairo_t* c)
{
	DashButton * self;
	FadeTracker* _tmp0_;
	FadeTracker* _tmp1_;
	gdouble _tmp2_;
	gdouble _tmp3_;
	gboolean result;
#line 79 "../src/dash-button.vala"
	self = (DashButton*) base;
#line 79 "../src/dash-button.vala"
	g_return_val_if_fail (c != NULL, FALSE);
#line 81 "../src/dash-button.vala"
	cairo_push_group (c);
#line 82 "../src/dash-button.vala"
	GTK_WIDGET_CLASS (dash_button_parent_class)->draw ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_FLAT_BUTTON, FlatButton), c);
#line 83 "../src/dash-button.vala"
	cairo_pop_group_to_source (c);
#line 84 "../src/dash-button.vala"
	_tmp0_ = fadable_get_fade_tracker ((Fadable*) self);
#line 84 "../src/dash-button.vala"
	_tmp1_ = _tmp0_;
#line 84 "../src/dash-button.vala"
	_tmp2_ = fade_tracker_get_alpha (_tmp1_);
#line 84 "../src/dash-button.vala"
	_tmp3_ = _tmp2_;
#line 84 "../src/dash-button.vala"
	cairo_paint_with_alpha (c, _tmp3_);
#line 85 "../src/dash-button.vala"
	result = FALSE;
#line 85 "../src/dash-button.vala"
	return result;
#line 449 "dash-button.c"
}

static FadeTracker*
dash_button_real_get_fade_tracker (Fadable* base)
{
	FadeTracker* result;
	DashButton* self;
	FadeTracker* _tmp0_;
#line 22 "../src/dash-button.vala"
	self = (DashButton*) base;
#line 22 "../src/dash-button.vala"
	_tmp0_ = self->priv->_fade_tracker;
#line 22 "../src/dash-button.vala"
	result = _tmp0_;
#line 22 "../src/dash-button.vala"
	return result;
#line 466 "dash-button.c"
}

static gpointer
_g_object_ref0 (gpointer self)
{
#line 22 "../src/dash-button.vala"
	return self ? g_object_ref (self) : NULL;
#line 474 "dash-button.c"
}

static void
dash_button_real_set_fade_tracker (Fadable* base,
                                   FadeTracker* value)
{
	DashButton* self;
	FadeTracker* old_value;
#line 22 "../src/dash-button.vala"
	self = (DashButton*) base;
#line 22 "../src/dash-button.vala"
	old_value = dash_button_real_get_fade_tracker (base);
#line 22 "../src/dash-button.vala"
	if (old_value != value) {
#line 489 "dash-button.c"
		FadeTracker* _tmp0_;
#line 22 "../src/dash-button.vala"
		_tmp0_ = _g_object_ref0 (value);
#line 22 "../src/dash-button.vala"
		_g_object_unref0 (self->priv->_fade_tracker);
#line 22 "../src/dash-button.vala"
		self->priv->_fade_tracker = _tmp0_;
#line 22 "../src/dash-button.vala"
		g_object_notify_by_pspec ((GObject *) self, dash_button_properties[DASH_BUTTON_FADE_TRACKER_PROPERTY]);
#line 499 "dash-button.c"
	}
}

const gchar*
dash_button_get_text (DashButton* self)
{
	const gchar* result;
	const gchar* _tmp0_;
#line 28 "../src/dash-button.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 28 "../src/dash-button.vala"
	_tmp0_ = self->priv->_text;
#line 28 "../src/dash-button.vala"
	result = _tmp0_;
#line 28 "../src/dash-button.vala"
	return result;
#line 516 "dash-button.c"
}

void
dash_button_set_text (DashButton* self,
                      const gchar* value)
{
	gchar* _tmp0_;
	GtkLabel* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
#line 29 "../src/dash-button.vala"
	g_return_if_fail (self != NULL);
#line 31 "../src/dash-button.vala"
	_tmp0_ = g_strdup (value);
#line 31 "../src/dash-button.vala"
	_g_free0 (self->priv->_text);
#line 31 "../src/dash-button.vala"
	self->priv->_text = _tmp0_;
#line 32 "../src/dash-button.vala"
	_tmp1_ = self->priv->text_label;
#line 32 "../src/dash-button.vala"
	_tmp2_ = g_strdup_printf ("<span font=\"Ubuntu 13\">%s</span>", value);
#line 32 "../src/dash-button.vala"
	_tmp3_ = _tmp2_;
#line 32 "../src/dash-button.vala"
	gtk_label_set_markup (_tmp1_, _tmp3_);
#line 32 "../src/dash-button.vala"
	_g_free0 (_tmp3_);
#line 29 "../src/dash-button.vala"
	g_object_notify_by_pspec ((GObject *) self, dash_button_properties[DASH_BUTTON_TEXT_PROPERTY]);
#line 547 "dash-button.c"
}

static void
dash_button_class_init (DashButtonClass * klass,
                        gpointer klass_data)
{
#line 20 "../src/dash-button.vala"
	dash_button_parent_class = g_type_class_peek_parent (klass);
#line 20 "../src/dash-button.vala"
	g_type_class_adjust_private_offset (klass, &DashButton_private_offset);
#line 20 "../src/dash-button.vala"
	((GtkWidgetClass *) klass)->draw = (gboolean (*) (GtkWidget*, cairo_t*)) dash_button_real_draw;
#line 20 "../src/dash-button.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_dash_button_get_property;
#line 20 "../src/dash-button.vala"
	G_OBJECT_CLASS (klass)->set_property = _vala_dash_button_set_property;
#line 20 "../src/dash-button.vala"
	G_OBJECT_CLASS (klass)->finalize = dash_button_finalize;
#line 20 "../src/dash-button.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), DASH_BUTTON_FADE_TRACKER_PROPERTY, dash_button_properties[DASH_BUTTON_FADE_TRACKER_PROPERTY] = g_param_spec_object ("fade-tracker", "fade-tracker", "fade-tracker", TYPE_FADE_TRACKER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
#line 20 "../src/dash-button.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), DASH_BUTTON_TEXT_PROPERTY, dash_button_properties[DASH_BUTTON_TEXT_PROPERTY] = g_param_spec_string ("text", "text", "text", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
#line 570 "dash-button.c"
}

static void
dash_button_fadable_interface_init (FadableIface * iface,
                                    gpointer iface_data)
{
#line 20 "../src/dash-button.vala"
	dash_button_fadable_parent_iface = g_type_interface_peek_parent (iface);
#line 20 "../src/dash-button.vala"
	iface->get_fade_tracker = dash_button_real_get_fade_tracker;
#line 20 "../src/dash-button.vala"
	iface->set_fade_tracker = dash_button_real_set_fade_tracker;
#line 583 "dash-button.c"
}

static void
dash_button_instance_init (DashButton * self,
                           gpointer klass)
{
	gchar* _tmp0_;
#line 20 "../src/dash-button.vala"
	self->priv = dash_button_get_instance_private (self);
#line 25 "../src/dash-button.vala"
	_tmp0_ = g_strdup ("");
#line 25 "../src/dash-button.vala"
	self->priv->_text = _tmp0_;
#line 597 "dash-button.c"
}

static void
dash_button_finalize (GObject * obj)
{
	DashButton * self;
#line 20 "../src/dash-button.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_DASH_BUTTON, DashButton);
#line 22 "../src/dash-button.vala"
	_g_object_unref0 (self->priv->_fade_tracker);
#line 23 "../src/dash-button.vala"
	_g_object_unref0 (self->priv->text_label);
#line 25 "../src/dash-button.vala"
	_g_free0 (self->priv->_text);
#line 20 "../src/dash-button.vala"
	G_OBJECT_CLASS (dash_button_parent_class)->finalize (obj);
#line 614 "dash-button.c"
}

static GType
dash_button_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DashButtonClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dash_button_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DashButton), 0, (GInstanceInitFunc) dash_button_instance_init, NULL };
	static const GInterfaceInfo fadable_info = { (GInterfaceInitFunc) dash_button_fadable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType dash_button_type_id;
	dash_button_type_id = g_type_register_static (TYPE_FLAT_BUTTON, "DashButton", &g_define_type_info, 0);
	g_type_add_interface_static (dash_button_type_id, TYPE_FADABLE, &fadable_info);
	DashButton_private_offset = g_type_add_instance_private (dash_button_type_id, sizeof (DashButtonPrivate));
	return dash_button_type_id;
}

GType
dash_button_get_type (void)
{
	static volatile gsize dash_button_type_id__once = 0;
	if (g_once_init_enter (&dash_button_type_id__once)) {
		GType dash_button_type_id;
		dash_button_type_id = dash_button_get_type_once ();
		g_once_init_leave (&dash_button_type_id__once, dash_button_type_id);
	}
	return dash_button_type_id__once;
}

static void
_vala_dash_button_get_property (GObject * object,
                                guint property_id,
                                GValue * value,
                                GParamSpec * pspec)
{
	DashButton * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_DASH_BUTTON, DashButton);
#line 20 "../src/dash-button.vala"
	switch (property_id) {
#line 20 "../src/dash-button.vala"
		case DASH_BUTTON_FADE_TRACKER_PROPERTY:
#line 20 "../src/dash-button.vala"
		g_value_set_object (value, fadable_get_fade_tracker ((Fadable*) self));
#line 20 "../src/dash-button.vala"
		break;
#line 20 "../src/dash-button.vala"
		case DASH_BUTTON_TEXT_PROPERTY:
#line 20 "../src/dash-button.vala"
		g_value_set_string (value, dash_button_get_text (self));
#line 20 "../src/dash-button.vala"
		break;
#line 663 "dash-button.c"
		default:
#line 20 "../src/dash-button.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 20 "../src/dash-button.vala"
		break;
#line 669 "dash-button.c"
	}
}

static void
_vala_dash_button_set_property (GObject * object,
                                guint property_id,
                                const GValue * value,
                                GParamSpec * pspec)
{
	DashButton * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_DASH_BUTTON, DashButton);
#line 20 "../src/dash-button.vala"
	switch (property_id) {
#line 20 "../src/dash-button.vala"
		case DASH_BUTTON_FADE_TRACKER_PROPERTY:
#line 20 "../src/dash-button.vala"
		fadable_set_fade_tracker ((Fadable*) self, g_value_get_object (value));
#line 20 "../src/dash-button.vala"
		break;
#line 20 "../src/dash-button.vala"
		case DASH_BUTTON_TEXT_PROPERTY:
#line 20 "../src/dash-button.vala"
		dash_button_set_text (self, g_value_get_string (value));
#line 20 "../src/dash-button.vala"
		break;
#line 695 "dash-button.c"
		default:
#line 20 "../src/dash-button.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 20 "../src/dash-button.vala"
		break;
#line 701 "dash-button.c"
	}
}

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;
}

