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

#include <gtk/gtk.h>
#include <glib-object.h>
#include <adwaita.h>
#include <glib.h>
#include <float.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <gdk/gdk.h>
#include <graphene-gobject.h>
#include <gee.h>

#define TUBA_WIDGETS_VOTE_ROW_ANIMATION_DURATION ((guint) 500)
#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 TUBA_WIDGETS_TYPE_VOTE_ROW (tuba_widgets_vote_row_get_type ())
#define TUBA_WIDGETS_VOTE_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_VOTE_ROW, TubaWidgetsVoteRow))
#define TUBA_WIDGETS_VOTE_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_VOTE_ROW, TubaWidgetsVoteRowClass))
#define TUBA_WIDGETS_IS_VOTE_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_VOTE_ROW))
#define TUBA_WIDGETS_IS_VOTE_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_VOTE_ROW))
#define TUBA_WIDGETS_VOTE_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_VOTE_ROW, TubaWidgetsVoteRowClass))

typedef struct _TubaWidgetsVoteRow TubaWidgetsVoteRow;
typedef struct _TubaWidgetsVoteRowClass TubaWidgetsVoteRowClass;
typedef struct _TubaWidgetsVoteRowPrivate TubaWidgetsVoteRowPrivate;

#define TUBA_WIDGETS_TYPE_LABEL_WITH_WIDGETS (tuba_widgets_label_with_widgets_get_type ())
#define TUBA_WIDGETS_LABEL_WITH_WIDGETS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_LABEL_WITH_WIDGETS, TubaWidgetsLabelWithWidgets))
#define TUBA_WIDGETS_LABEL_WITH_WIDGETS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_LABEL_WITH_WIDGETS, TubaWidgetsLabelWithWidgetsClass))
#define TUBA_WIDGETS_IS_LABEL_WITH_WIDGETS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_LABEL_WITH_WIDGETS))
#define TUBA_WIDGETS_IS_LABEL_WITH_WIDGETS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_LABEL_WITH_WIDGETS))
#define TUBA_WIDGETS_LABEL_WITH_WIDGETS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_LABEL_WITH_WIDGETS, TubaWidgetsLabelWithWidgetsClass))

typedef struct _TubaWidgetsLabelWithWidgets TubaWidgetsLabelWithWidgets;
typedef struct _TubaWidgetsLabelWithWidgetsClass TubaWidgetsLabelWithWidgetsClass;

#define TUBA_WIDGETS_TYPE_EMOJI_LABEL (tuba_widgets_emoji_label_get_type ())
#define TUBA_WIDGETS_EMOJI_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_EMOJI_LABEL, TubaWidgetsEmojiLabel))
#define TUBA_WIDGETS_EMOJI_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_EMOJI_LABEL, TubaWidgetsEmojiLabelClass))
#define TUBA_WIDGETS_IS_EMOJI_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_EMOJI_LABEL))
#define TUBA_WIDGETS_IS_EMOJI_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_EMOJI_LABEL))
#define TUBA_WIDGETS_EMOJI_LABEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_EMOJI_LABEL, TubaWidgetsEmojiLabelClass))

typedef struct _TubaWidgetsEmojiLabel TubaWidgetsEmojiLabel;
typedef struct _TubaWidgetsEmojiLabelClass TubaWidgetsEmojiLabelClass;

#define TUBA_WIDGETS_TYPE_VOTE_CHECK_BUTTON (tuba_widgets_vote_check_button_get_type ())
#define TUBA_WIDGETS_VOTE_CHECK_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_VOTE_CHECK_BUTTON, TubaWidgetsVoteCheckButton))
#define TUBA_WIDGETS_VOTE_CHECK_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_VOTE_CHECK_BUTTON, TubaWidgetsVoteCheckButtonClass))
#define TUBA_WIDGETS_IS_VOTE_CHECK_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_VOTE_CHECK_BUTTON))
#define TUBA_WIDGETS_IS_VOTE_CHECK_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_VOTE_CHECK_BUTTON))
#define TUBA_WIDGETS_VOTE_CHECK_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_VOTE_CHECK_BUTTON, TubaWidgetsVoteCheckButtonClass))

typedef struct _TubaWidgetsVoteCheckButton TubaWidgetsVoteCheckButton;
typedef struct _TubaWidgetsVoteCheckButtonClass TubaWidgetsVoteCheckButtonClass;
enum  {
	TUBA_WIDGETS_VOTE_ROW_0_PROPERTY,
	TUBA_WIDGETS_VOTE_ROW_CHECK_BUTTON_PROPERTY,
	TUBA_WIDGETS_VOTE_ROW_DELAYED_ANIMATION_PROPERTY,
	TUBA_WIDGETS_VOTE_ROW_WINNER_PROPERTY,
	TUBA_WIDGETS_VOTE_ROW_PERCENTAGE_PROPERTY,
	TUBA_WIDGETS_VOTE_ROW_INSTANCE_EMOJIS_PROPERTY,
	TUBA_WIDGETS_VOTE_ROW_TITLE_PROPERTY,
	TUBA_WIDGETS_VOTE_ROW_VOTED_PROPERTY,
	TUBA_WIDGETS_VOTE_ROW_SHOW_RESULTS_PROPERTY,
	TUBA_WIDGETS_VOTE_ROW_NUM_PROPERTIES
};
static GParamSpec* tuba_widgets_vote_row_properties[TUBA_WIDGETS_VOTE_ROW_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 __vala_GdkRGBA_free0(var) ((var == NULL) ? NULL : (var = (_vala_GdkRGBA_free (var), NULL)))

struct _TubaWidgetsVoteRow {
	GtkListBoxRow parent_instance;
	TubaWidgetsVoteRowPrivate * priv;
};

struct _TubaWidgetsVoteRowClass {
	GtkListBoxRowClass parent_class;
};

struct _TubaWidgetsVoteRowPrivate {
	AdwSpringAnimation* animation;
	TubaWidgetsEmojiLabel* title_label;
	GtkLabel* subtitle_label;
	GtkBox* main_box;
	GtkImage* voted_icon;
	TubaWidgetsVoteCheckButton* _check_button;
	gboolean _delayed_animation;
	gboolean _winner;
	gdouble _percentage;
	gchar* _title;
	gboolean _voted;
	gboolean _show_results;
	GdkRGBA _background_color;
};

static gint TubaWidgetsVoteRow_private_offset;
static gpointer tuba_widgets_vote_row_parent_class = NULL;

VALA_EXTERN GType tuba_widgets_vote_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsVoteRow, g_object_unref)
VALA_EXTERN GType tuba_widgets_label_with_widgets_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsLabelWithWidgets, g_object_unref)
VALA_EXTERN GType tuba_widgets_emoji_label_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsEmojiLabel, g_object_unref)
VALA_EXTERN GType tuba_widgets_vote_check_button_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsVoteCheckButton, g_object_unref)
static void tuba_widgets_vote_row_animation_target_cb (TubaWidgetsVoteRow* self,
                                                gdouble value);
static void tuba_widgets_vote_row_animate (TubaWidgetsVoteRow* self,
                                    gdouble from,
                                    gdouble to);
VALA_EXTERN gboolean tuba_widgets_vote_row_get_delayed_animation (TubaWidgetsVoteRow* self);
VALA_EXTERN void tuba_widgets_vote_row_play_animation (TubaWidgetsVoteRow* self);
static void tuba_widgets_vote_row_update_accent_color (TubaWidgetsVoteRow* self);
static void tuba_widgets_vote_row_set_background_color (TubaWidgetsVoteRow* self,
                                                 GdkRGBA * value);
static void _vala_GdkRGBA_free (GdkRGBA* self);
VALA_EXTERN TubaWidgetsVoteRow* tuba_widgets_vote_row_new (const gchar* poll_title);
VALA_EXTERN TubaWidgetsVoteRow* tuba_widgets_vote_row_construct (GType object_type,
                                                     const gchar* poll_title);
VALA_EXTERN TubaWidgetsVoteCheckButton* tuba_widgets_vote_row_get_check_button (TubaWidgetsVoteRow* self);
VALA_EXTERN void tuba_widgets_vote_check_button_set_poll_title (TubaWidgetsVoteCheckButton* self,
                                                    const gchar* value);
static void tuba_widgets_vote_row_real_snapshot (GtkWidget* base,
                                          GtkSnapshot* snapshot);
VALA_EXTERN gboolean tuba_widgets_vote_row_get_show_results (TubaWidgetsVoteRow* self);
VALA_EXTERN gboolean tuba_widgets_vote_row_get_winner (TubaWidgetsVoteRow* self);
static void tuba_widgets_vote_row_get_background_color (TubaWidgetsVoteRow* self,
                                                 GdkRGBA * result);
static void tuba_widgets_vote_row_set_check_button (TubaWidgetsVoteRow* self,
                                             TubaWidgetsVoteCheckButton* value);
VALA_EXTERN void tuba_widgets_vote_row_set_delayed_animation (TubaWidgetsVoteRow* self,
                                                  gboolean value);
VALA_EXTERN void tuba_widgets_vote_row_set_winner (TubaWidgetsVoteRow* self,
                                       gboolean value);
VALA_EXTERN gdouble tuba_widgets_vote_row_get_percentage (TubaWidgetsVoteRow* self);
VALA_EXTERN void tuba_widgets_vote_row_set_percentage (TubaWidgetsVoteRow* self,
                                           gdouble value);
VALA_EXTERN void tuba_widgets_vote_row_set_instance_emojis (TubaWidgetsVoteRow* self,
                                                GeeHashMap* value);
VALA_EXTERN void tuba_widgets_emoji_label_set_instance_emojis (TubaWidgetsEmojiLabel* self,
                                                   GeeHashMap* value);
VALA_EXTERN const gchar* tuba_widgets_vote_row_get_title (TubaWidgetsVoteRow* self);
VALA_EXTERN void tuba_widgets_emoji_label_set_content (TubaWidgetsEmojiLabel* self,
                                           const gchar* value);
VALA_EXTERN void tuba_widgets_vote_row_set_title (TubaWidgetsVoteRow* self,
                                      const gchar* value);
VALA_EXTERN gboolean tuba_widgets_vote_row_get_voted (TubaWidgetsVoteRow* self);
VALA_EXTERN void tuba_widgets_vote_row_set_voted (TubaWidgetsVoteRow* self,
                                      gboolean value);
VALA_EXTERN void tuba_widgets_vote_row_set_show_results (TubaWidgetsVoteRow* self,
                                             gboolean value);
static GObject * tuba_widgets_vote_row_constructor (GType type,
                                             guint n_construct_properties,
                                             GObjectConstructParam * construct_properties);
VALA_EXTERN TubaWidgetsVoteCheckButton* tuba_widgets_vote_check_button_new (void);
VALA_EXTERN TubaWidgetsVoteCheckButton* tuba_widgets_vote_check_button_construct (GType object_type);
static void _tuba_widgets_vote_row_animation_target_cb_adw_animation_target_func (gdouble value,
                                                                           gpointer self);
static void _tuba_widgets_vote_row_update_accent_color_g_object_notify (GObject* _sender,
                                                                 GParamSpec* pspec,
                                                                 gpointer self);
VALA_EXTERN TubaWidgetsEmojiLabel* tuba_widgets_emoji_label_new (const gchar* text,
                                                     GeeHashMap* emojis);
VALA_EXTERN TubaWidgetsEmojiLabel* tuba_widgets_emoji_label_construct (GType object_type,
                                                           const gchar* text,
                                                           GeeHashMap* emojis);
VALA_EXTERN void tuba_widgets_label_with_widgets_set_use_markup (TubaWidgetsLabelWithWidgets* self,
                                                     gboolean value);
VALA_EXTERN void tuba_widgets_label_with_widgets_set_xalign (TubaWidgetsLabelWithWidgets* self,
                                                 gfloat value);
static void tuba_widgets_vote_row_finalize (GObject * obj);
static GType tuba_widgets_vote_row_get_type_once (void);
static void _vala_tuba_widgets_vote_row_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec);
static void _vala_tuba_widgets_vote_row_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static inline gpointer
tuba_widgets_vote_row_get_instance_private (TubaWidgetsVoteRow* self)
{
	return G_STRUCT_MEMBER_P (self, TubaWidgetsVoteRow_private_offset);
}

static void
tuba_widgets_vote_row_animation_target_cb (TubaWidgetsVoteRow* self,
                                           gdouble value)
{
	g_return_if_fail (self != NULL);
	gtk_widget_queue_draw ((GtkWidget*) self);
}

static void
tuba_widgets_vote_row_animate (TubaWidgetsVoteRow* self,
                               gdouble from,
                               gdouble to)
{
	AdwSpringAnimation* _tmp0_;
	AdwSpringAnimation* _tmp1_;
	gboolean _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->animation;
	adw_spring_animation_set_value_from (_tmp0_, from);
	_tmp1_ = self->priv->animation;
	adw_spring_animation_set_value_to (_tmp1_, to);
	_tmp2_ = self->priv->_delayed_animation;
	if (!_tmp2_) {
		tuba_widgets_vote_row_play_animation (self);
	}
}

void
tuba_widgets_vote_row_play_animation (TubaWidgetsVoteRow* self)
{
	AdwSpringAnimation* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->animation;
	adw_animation_play ((AdwAnimation*) _tmp0_);
}

static void
_vala_GdkRGBA_free (GdkRGBA* self)
{
	g_boxed_free (gdk_rgba_get_type (), self);
}

static void
tuba_widgets_vote_row_update_accent_color (TubaWidgetsVoteRow* self)
{
	AdwStyleManager* _tmp0_;
	GdkRGBA* _tmp1_;
	GdkRGBA* _tmp2_;
	GdkRGBA _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = adw_style_manager_get_default ();
	_tmp1_ = adw_style_manager_get_accent_color_rgba (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = *_tmp2_;
	tuba_widgets_vote_row_set_background_color (self, &_tmp3_);
	__vala_GdkRGBA_free0 (_tmp2_);
}

TubaWidgetsVoteRow*
tuba_widgets_vote_row_construct (GType object_type,
                                 const gchar* poll_title)
{
	TubaWidgetsVoteRow * self = NULL;
	TubaWidgetsVoteCheckButton* _tmp0_;
	g_return_val_if_fail (poll_title != NULL, NULL);
	self = (TubaWidgetsVoteRow*) g_object_new (object_type, NULL);
	_tmp0_ = self->priv->_check_button;
	tuba_widgets_vote_check_button_set_poll_title (_tmp0_, poll_title);
	return self;
}

TubaWidgetsVoteRow*
tuba_widgets_vote_row_new (const gchar* poll_title)
{
	return tuba_widgets_vote_row_construct (TUBA_WIDGETS_TYPE_VOTE_ROW, poll_title);
}

static void
tuba_widgets_vote_row_real_snapshot (GtkWidget* base,
                                     GtkSnapshot* snapshot)
{
	TubaWidgetsVoteRow * self;
	gboolean _tmp0_;
	gboolean _tmp1_;
	gint width = 0;
	graphene_rect_t bar = {0};
	graphene_point_t _tmp2_ = {0};
	AdwSpringAnimation* _tmp3_;
	gdouble _tmp4_;
	gdouble _tmp5_;
	graphene_size_t _tmp6_ = {0};
	graphene_rect_t _tmp7_ = {0};
	gboolean _tmp8_;
	gboolean _tmp9_;
	self = (TubaWidgetsVoteRow*) base;
	g_return_if_fail (snapshot != NULL);
	_tmp0_ = tuba_widgets_vote_row_get_show_results (self);
	_tmp1_ = _tmp0_;
	if (!_tmp1_) {
		GTK_WIDGET_CLASS (tuba_widgets_vote_row_parent_class)->snapshot ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_list_box_row_get_type (), GtkListBoxRow), snapshot);
		return;
	}
	width = gtk_widget_get_width ((GtkWidget*) self);
	memset (&_tmp2_, 0, sizeof (graphene_point_t));
	_tmp2_.x = 0.0f;
	_tmp2_.y = 0.0f;
	_tmp3_ = self->priv->animation;
	_tmp4_ = adw_animation_get_value ((AdwAnimation*) _tmp3_);
	_tmp5_ = _tmp4_;
	memset (&_tmp6_, 0, sizeof (graphene_size_t));
	_tmp6_.height = (gfloat) gtk_widget_get_height ((GtkWidget*) self);
	_tmp6_.width = ((gfloat) width) * ((gfloat) _tmp5_);
	memset (&_tmp7_, 0, sizeof (graphene_rect_t));
	_tmp7_.origin = _tmp2_;
	_tmp7_.size = _tmp6_;
	bar = _tmp7_;
	_tmp8_ = tuba_widgets_vote_row_get_winner (self);
	_tmp9_ = _tmp8_;
	if (_tmp9_) {
		GdkRGBA _tmp10_ = {0};
		GdkRGBA _tmp11_;
		graphene_rect_t _tmp12_;
		tuba_widgets_vote_row_get_background_color (self, &_tmp10_);
		_tmp11_ = _tmp10_;
		_tmp12_ = bar;
		gtk_snapshot_append_color (snapshot, &_tmp11_, &_tmp12_);
	} else {
		GdkRGBA color = {0};
		GdkRGBA _tmp13_ = {0};
		GdkRGBA _tmp14_;
		graphene_rect_t _tmp15_;
		gtk_widget_get_color ((GtkWidget*) self, &_tmp13_);
		color = _tmp13_;
		color.alpha = 0.2f;
		_tmp14_ = color;
		_tmp15_ = bar;
		gtk_snapshot_append_color (snapshot, &_tmp14_, &_tmp15_);
	}
	GTK_WIDGET_CLASS (tuba_widgets_vote_row_parent_class)->snapshot ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_list_box_row_get_type (), GtkListBoxRow), snapshot);
}

TubaWidgetsVoteCheckButton*
tuba_widgets_vote_row_get_check_button (TubaWidgetsVoteRow* self)
{
	TubaWidgetsVoteCheckButton* result;
	TubaWidgetsVoteCheckButton* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_check_button;
	result = _tmp0_;
	return result;
}

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

static void
tuba_widgets_vote_row_set_check_button (TubaWidgetsVoteRow* self,
                                        TubaWidgetsVoteCheckButton* value)
{
	TubaWidgetsVoteCheckButton* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_widgets_vote_row_get_check_button (self);
	if (old_value != value) {
		TubaWidgetsVoteCheckButton* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_check_button);
		self->priv->_check_button = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_widgets_vote_row_properties[TUBA_WIDGETS_VOTE_ROW_CHECK_BUTTON_PROPERTY]);
	}
}

gboolean
tuba_widgets_vote_row_get_delayed_animation (TubaWidgetsVoteRow* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_delayed_animation;
	return result;
}

void
tuba_widgets_vote_row_set_delayed_animation (TubaWidgetsVoteRow* self,
                                             gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_widgets_vote_row_get_delayed_animation (self);
	if (old_value != value) {
		self->priv->_delayed_animation = value;
		g_object_notify_by_pspec ((GObject *) self, tuba_widgets_vote_row_properties[TUBA_WIDGETS_VOTE_ROW_DELAYED_ANIMATION_PROPERTY]);
	}
}

gboolean
tuba_widgets_vote_row_get_winner (TubaWidgetsVoteRow* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_winner;
	return result;
}

void
tuba_widgets_vote_row_set_winner (TubaWidgetsVoteRow* self,
                                  gboolean value)
{
	g_return_if_fail (self != NULL);
	if (self->priv->_winner != value) {
		self->priv->_winner = value;
		gtk_widget_queue_draw ((GtkWidget*) self);
	}
	g_object_notify_by_pspec ((GObject *) self, tuba_widgets_vote_row_properties[TUBA_WIDGETS_VOTE_ROW_WINNER_PROPERTY]);
}

gdouble
tuba_widgets_vote_row_get_percentage (TubaWidgetsVoteRow* self)
{
	gdouble result;
	g_return_val_if_fail (self != NULL, -1.0);
	result = self->priv->_percentage;
	return result;
}

void
tuba_widgets_vote_row_set_percentage (TubaWidgetsVoteRow* self,
                                      gdouble value)
{
	g_return_if_fail (self != NULL);
	if (value != self->priv->_percentage) {
		gdouble before = 0.0;
		GtkLabel* _tmp0_;
		gdouble _tmp1_;
		gdouble _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		gdouble _tmp5_;
		gdouble _tmp6_;
		before = self->priv->_percentage / 100;
		self->priv->_percentage = value;
		_tmp0_ = self->priv->subtitle_label;
		_tmp1_ = tuba_widgets_vote_row_get_percentage (self);
		_tmp2_ = _tmp1_;
		_tmp3_ = g_strdup_printf ("%.1f%%", _tmp2_);
		_tmp4_ = _tmp3_;
		gtk_label_set_label (_tmp0_, _tmp4_);
		_g_free0 (_tmp4_);
		_tmp5_ = tuba_widgets_vote_row_get_percentage (self);
		_tmp6_ = _tmp5_;
		tuba_widgets_vote_row_animate (self, MIN (before, (gdouble) 0), _tmp6_ / 100);
	}
	g_object_notify_by_pspec ((GObject *) self, tuba_widgets_vote_row_properties[TUBA_WIDGETS_VOTE_ROW_PERCENTAGE_PROPERTY]);
}

void
tuba_widgets_vote_row_set_instance_emojis (TubaWidgetsVoteRow* self,
                                           GeeHashMap* value)
{
	TubaWidgetsEmojiLabel* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->title_label;
	tuba_widgets_emoji_label_set_instance_emojis (_tmp0_, value);
	_tmp1_ = tuba_widgets_vote_row_get_title (self);
	_tmp2_ = _tmp1_;
	if (g_strcmp0 (_tmp2_, "") != 0) {
		TubaWidgetsEmojiLabel* _tmp3_;
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		_tmp3_ = self->priv->title_label;
		_tmp4_ = tuba_widgets_vote_row_get_title (self);
		_tmp5_ = _tmp4_;
		tuba_widgets_emoji_label_set_content (_tmp3_, _tmp5_);
	}
	g_object_notify_by_pspec ((GObject *) self, tuba_widgets_vote_row_properties[TUBA_WIDGETS_VOTE_ROW_INSTANCE_EMOJIS_PROPERTY]);
}

const gchar*
tuba_widgets_vote_row_get_title (TubaWidgetsVoteRow* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_title;
	result = _tmp0_;
	return result;
}

void
tuba_widgets_vote_row_set_title (TubaWidgetsVoteRow* self,
                                 const gchar* value)
{
	const gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_title;
	if (g_strcmp0 (value, _tmp0_) != 0) {
		gchar* _tmp1_;
		TubaWidgetsEmojiLabel* _tmp2_;
		_tmp1_ = g_strdup (value);
		_g_free0 (self->priv->_title);
		self->priv->_title = _tmp1_;
		_tmp2_ = self->priv->title_label;
		tuba_widgets_emoji_label_set_content (_tmp2_, value);
	}
	g_object_notify_by_pspec ((GObject *) self, tuba_widgets_vote_row_properties[TUBA_WIDGETS_VOTE_ROW_TITLE_PROPERTY]);
}

gboolean
tuba_widgets_vote_row_get_voted (TubaWidgetsVoteRow* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_voted;
	return result;
}

void
tuba_widgets_vote_row_set_voted (TubaWidgetsVoteRow* self,
                                 gboolean value)
{
	g_return_if_fail (self != NULL);
	if (self->priv->_voted != value) {
		GtkImage* _tmp0_;
		self->priv->_voted = value;
		_tmp0_ = self->priv->voted_icon;
		gtk_widget_set_visible ((GtkWidget*) _tmp0_, value);
		tuba_widgets_vote_row_set_show_results (self, TRUE);
	}
	g_object_notify_by_pspec ((GObject *) self, tuba_widgets_vote_row_properties[TUBA_WIDGETS_VOTE_ROW_VOTED_PROPERTY]);
}

gboolean
tuba_widgets_vote_row_get_show_results (TubaWidgetsVoteRow* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_show_results;
	return result;
}

void
tuba_widgets_vote_row_set_show_results (TubaWidgetsVoteRow* self,
                                        gboolean value)
{
	g_return_if_fail (self != NULL);
	if (self->priv->_show_results != value) {
		TubaWidgetsVoteCheckButton* _tmp0_;
		gboolean _tmp1_ = FALSE;
		GtkLabel* _tmp5_;
		GtkImage* _tmp6_;
		gboolean _tmp7_;
		gboolean _tmp8_;
		gdouble _tmp9_;
		gdouble _tmp10_;
		self->priv->_show_results = value;
		_tmp0_ = self->priv->_check_button;
		gtk_widget_set_visible ((GtkWidget*) _tmp0_, !value);
		if (value) {
			GtkLabel* _tmp2_;
			const gchar* _tmp3_;
			const gchar* _tmp4_;
			_tmp2_ = self->priv->subtitle_label;
			_tmp3_ = gtk_label_get_label (_tmp2_);
			_tmp4_ = _tmp3_;
			_tmp1_ = g_strcmp0 (_tmp4_, "") != 0;
		} else {
			_tmp1_ = FALSE;
		}
		_tmp5_ = self->priv->subtitle_label;
		gtk_widget_set_visible ((GtkWidget*) _tmp5_, _tmp1_);
		_tmp6_ = self->priv->voted_icon;
		_tmp7_ = tuba_widgets_vote_row_get_voted (self);
		_tmp8_ = _tmp7_;
		gtk_widget_set_visible ((GtkWidget*) _tmp6_, _tmp8_);
		gtk_list_box_row_set_activatable ((GtkListBoxRow*) self, !value);
		_tmp9_ = tuba_widgets_vote_row_get_percentage (self);
		_tmp10_ = _tmp9_;
		tuba_widgets_vote_row_animate (self, (gdouble) 0, _tmp10_ / 100);
	}
	g_object_notify_by_pspec ((GObject *) self, tuba_widgets_vote_row_properties[TUBA_WIDGETS_VOTE_ROW_SHOW_RESULTS_PROPERTY]);
}

static void
tuba_widgets_vote_row_get_background_color (TubaWidgetsVoteRow* self,
                                            GdkRGBA * result)
{
	GdkRGBA _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_background_color;
	*result = _tmp0_;
	return;
}

static void
tuba_widgets_vote_row_set_background_color (TubaWidgetsVoteRow* self,
                                            GdkRGBA * value)
{
	GdkRGBA _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_if_fail (self != NULL);
	(*value).alpha = 0.5f;
	_tmp0_ = *value;
	self->priv->_background_color = _tmp0_;
	_tmp1_ = tuba_widgets_vote_row_get_winner (self);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		gtk_widget_queue_draw ((GtkWidget*) self);
	}
}

static void
_tuba_widgets_vote_row_animation_target_cb_adw_animation_target_func (gdouble value,
                                                                      gpointer self)
{
	tuba_widgets_vote_row_animation_target_cb ((TubaWidgetsVoteRow*) self, value);
}

static void
_tuba_widgets_vote_row_update_accent_color_g_object_notify (GObject* _sender,
                                                            GParamSpec* pspec,
                                                            gpointer self)
{
	tuba_widgets_vote_row_update_accent_color ((TubaWidgetsVoteRow*) self);
}

static GObject *
tuba_widgets_vote_row_constructor (GType type,
                                   guint n_construct_properties,
                                   GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	TubaWidgetsVoteRow * self;
	TubaWidgetsVoteCheckButton* _tmp0_;
	TubaWidgetsVoteCheckButton* _tmp1_;
	AdwCallbackAnimationTarget* target = NULL;
	AdwCallbackAnimationTarget* _tmp2_;
	AdwSpringParams* _tmp3_;
	AdwCallbackAnimationTarget* _tmp4_;
	AdwAnimationTarget* _tmp5_;
	AdwSpringAnimation* _tmp6_;
	AdwStyleManager* default_sm = NULL;
	AdwStyleManager* _tmp7_;
	AdwStyleManager* _tmp8_;
	AdwStyleManager* _tmp9_;
	gboolean _tmp10_;
	gboolean _tmp11_;
	TubaWidgetsEmojiLabel* _tmp16_ = NULL;
	gchar* _tmp17_;
	gchar** _tmp18_;
	GtkLabel* _tmp19_ = NULL;
	gchar* _tmp20_;
	GtkImage* _tmp21_ = NULL;
	GtkBox* title_box = NULL;
	GtkBox* _tmp22_ = NULL;
	GtkBox* _tmp23_;
	TubaWidgetsEmojiLabel* _tmp24_;
	GtkBox* _tmp25_;
	GtkLabel* _tmp26_;
	GtkBox* _tmp27_ = NULL;
	GtkBox* _tmp28_;
	TubaWidgetsVoteCheckButton* _tmp29_;
	GtkBox* _tmp30_;
	GtkBox* _tmp31_;
	GtkBox* _tmp32_;
	GtkImage* _tmp33_;
	GtkBox* _tmp34_;
	parent_class = G_OBJECT_CLASS (tuba_widgets_vote_row_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_WIDGETS_TYPE_VOTE_ROW, TubaWidgetsVoteRow);
	gtk_widget_add_css_class ((GtkWidget*) self, "ttl-poll-row");
	gtk_list_box_row_set_activatable ((GtkListBoxRow*) self, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) self, TRUE);
	_tmp0_ = tuba_widgets_vote_check_button_new ();
	g_object_ref_sink (_tmp0_);
	_tmp1_ = _tmp0_;
	tuba_widgets_vote_row_set_check_button (self, _tmp1_);
	_g_object_unref0 (_tmp1_);
	_tmp2_ = (AdwCallbackAnimationTarget*) adw_callback_animation_target_new (_tuba_widgets_vote_row_animation_target_cb_adw_animation_target_func, g_object_ref (self), g_object_unref);
	target = _tmp2_;
	_tmp3_ = adw_spring_params_new (0.65, 0.4, 110.0);
	_tmp4_ = target;
	_tmp5_ = _g_object_ref0 ((AdwAnimationTarget*) _tmp4_);
	_tmp6_ = (AdwSpringAnimation*) adw_spring_animation_new ((GtkWidget*) self, 0.0, 1.0, _tmp3_, _tmp5_);
	_g_object_unref0 (self->priv->animation);
	self->priv->animation = _tmp6_;
	_tmp7_ = adw_style_manager_get_default ();
	_tmp8_ = _g_object_ref0 (_tmp7_);
	default_sm = _tmp8_;
	_tmp9_ = default_sm;
	_tmp10_ = adw_style_manager_get_system_supports_accent_colors (_tmp9_);
	_tmp11_ = _tmp10_;
	if (_tmp11_) {
		AdwStyleManager* _tmp12_;
		AdwStyleManager* _tmp13_;
		GdkRGBA* _tmp14_;
		GdkRGBA* _tmp15_;
		_tmp12_ = default_sm;
		g_signal_connect_object ((GObject*) _tmp12_, "notify::accent-color-rgba", (GCallback) _tuba_widgets_vote_row_update_accent_color_g_object_notify, self, 0);
		_tmp13_ = default_sm;
		_tmp14_ = adw_style_manager_get_accent_color_rgba (_tmp13_);
		_tmp15_ = _tmp14_;
		self->priv->_background_color = *_tmp15_;
		__vala_GdkRGBA_free0 (_tmp15_);
		self->priv->_background_color.alpha = 0.5f;
	}
	_tmp16_ = tuba_widgets_emoji_label_new (NULL, NULL);
	tuba_widgets_label_with_widgets_set_use_markup ((TubaWidgetsLabelWithWidgets*) _tmp16_, FALSE);
	tuba_widgets_label_with_widgets_set_xalign ((TubaWidgetsLabelWithWidgets*) _tmp16_, 0.0f);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp16_, TRUE);
	gtk_widget_set_valign ((GtkWidget*) _tmp16_, GTK_ALIGN_CENTER);
	g_object_ref_sink (_tmp16_);
	_g_object_unref0 (self->priv->title_label);
	self->priv->title_label = _tmp16_;
	_tmp17_ = g_strdup ("dim-label");
	_tmp18_ = g_new0 (gchar*, 1 + 1);
	_tmp18_[0] = _tmp17_;
	_tmp19_ = (GtkLabel*) gtk_label_new ("");
	gtk_widget_set_visible ((GtkWidget*) _tmp19_, FALSE);
	gtk_label_set_xalign (_tmp19_, 0.0f);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp19_, _tmp18_);
	_tmp18_ = (_vala_array_free (_tmp18_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp19_);
	_g_object_unref0 (self->priv->subtitle_label);
	self->priv->subtitle_label = _tmp19_;
	_tmp20_ = g_strdup ("Voted");
	_tmp21_ = (GtkImage*) gtk_image_new_from_icon_name ("tuba-check-round-outline-symbolic");
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp21_, _tmp20_);
	_g_free0 (_tmp20_);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp21_, TRUE);
	gtk_widget_set_valign ((GtkWidget*) _tmp21_, GTK_ALIGN_CENTER);
	gtk_widget_set_visible ((GtkWidget*) _tmp21_, FALSE);
	g_object_ref_sink (_tmp21_);
	_g_object_unref0 (self->priv->voted_icon);
	self->priv->voted_icon = _tmp21_;
	_tmp22_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp22_, TRUE);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp22_, 6);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp22_, 6);
	g_object_ref_sink (_tmp22_);
	title_box = _tmp22_;
	_tmp23_ = title_box;
	_tmp24_ = self->priv->title_label;
	gtk_box_append (_tmp23_, (GtkWidget*) _tmp24_);
	_tmp25_ = title_box;
	_tmp26_ = self->priv->subtitle_label;
	gtk_box_append (_tmp25_, (GtkWidget*) _tmp26_);
	_tmp27_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp27_, 2);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp27_, 2);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp27_, 14);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp27_, 14);
	g_object_set ((GtkWidget*) _tmp27_, "height-request", 50, NULL);
	g_object_ref_sink (_tmp27_);
	_g_object_unref0 (self->priv->main_box);
	self->priv->main_box = _tmp27_;
	_tmp28_ = self->priv->main_box;
	_tmp29_ = self->priv->_check_button;
	gtk_box_append (_tmp28_, (GtkWidget*) _tmp29_);
	_tmp30_ = self->priv->main_box;
	_tmp31_ = title_box;
	gtk_box_append (_tmp30_, (GtkWidget*) _tmp31_);
	_tmp32_ = self->priv->main_box;
	_tmp33_ = self->priv->voted_icon;
	gtk_box_append (_tmp32_, (GtkWidget*) _tmp33_);
	_tmp34_ = self->priv->main_box;
	gtk_list_box_row_set_child ((GtkListBoxRow*) self, (GtkWidget*) _tmp34_);
	_g_object_unref0 (title_box);
	_g_object_unref0 (default_sm);
	_g_object_unref0 (target);
	return obj;
}

static void
tuba_widgets_vote_row_class_init (TubaWidgetsVoteRowClass * klass,
                                  gpointer klass_data)
{
	tuba_widgets_vote_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaWidgetsVoteRow_private_offset);
	((GtkWidgetClass *) klass)->snapshot = (void (*) (GtkWidget*, GtkSnapshot*)) tuba_widgets_vote_row_real_snapshot;
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_widgets_vote_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_widgets_vote_row_set_property;
	G_OBJECT_CLASS (klass)->constructor = tuba_widgets_vote_row_constructor;
	G_OBJECT_CLASS (klass)->finalize = tuba_widgets_vote_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_VOTE_ROW_CHECK_BUTTON_PROPERTY, tuba_widgets_vote_row_properties[TUBA_WIDGETS_VOTE_ROW_CHECK_BUTTON_PROPERTY] = g_param_spec_object ("check-button", "check-button", "check-button", TUBA_WIDGETS_TYPE_VOTE_CHECK_BUTTON, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_VOTE_ROW_DELAYED_ANIMATION_PROPERTY, tuba_widgets_vote_row_properties[TUBA_WIDGETS_VOTE_ROW_DELAYED_ANIMATION_PROPERTY] = g_param_spec_boolean ("delayed-animation", "delayed-animation", "delayed-animation", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_VOTE_ROW_WINNER_PROPERTY, tuba_widgets_vote_row_properties[TUBA_WIDGETS_VOTE_ROW_WINNER_PROPERTY] = g_param_spec_boolean ("winner", "winner", "winner", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_VOTE_ROW_PERCENTAGE_PROPERTY, tuba_widgets_vote_row_properties[TUBA_WIDGETS_VOTE_ROW_PERCENTAGE_PROPERTY] = g_param_spec_double ("percentage", "percentage", "percentage", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_VOTE_ROW_INSTANCE_EMOJIS_PROPERTY, tuba_widgets_vote_row_properties[TUBA_WIDGETS_VOTE_ROW_INSTANCE_EMOJIS_PROPERTY] = g_param_spec_object ("instance-emojis", "instance-emojis", "instance-emojis", GEE_TYPE_HASH_MAP, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_VOTE_ROW_TITLE_PROPERTY, tuba_widgets_vote_row_properties[TUBA_WIDGETS_VOTE_ROW_TITLE_PROPERTY] = g_param_spec_string ("title", "title", "title", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_VOTE_ROW_VOTED_PROPERTY, tuba_widgets_vote_row_properties[TUBA_WIDGETS_VOTE_ROW_VOTED_PROPERTY] = g_param_spec_boolean ("voted", "voted", "voted", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_VOTE_ROW_SHOW_RESULTS_PROPERTY, tuba_widgets_vote_row_properties[TUBA_WIDGETS_VOTE_ROW_SHOW_RESULTS_PROPERTY] = g_param_spec_boolean ("show-results", "show-results", "show-results", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
tuba_widgets_vote_row_instance_init (TubaWidgetsVoteRow * self,
                                     gpointer klass)
{
	gchar* _tmp0_;
	self->priv = tuba_widgets_vote_row_get_instance_private (self);
	self->priv->_delayed_animation = FALSE;
	self->priv->_winner = FALSE;
	self->priv->_percentage = (gdouble) -1;
	_tmp0_ = g_strdup ("");
	self->priv->_title = _tmp0_;
	self->priv->_voted = FALSE;
	self->priv->_show_results = FALSE;
	self->priv->_background_color = (GdkRGBA) {120 / 255.0f, 174 / 255.0f, 237 / 255.0f, 0.5f};
}

static void
tuba_widgets_vote_row_finalize (GObject * obj)
{
	TubaWidgetsVoteRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_WIDGETS_TYPE_VOTE_ROW, TubaWidgetsVoteRow);
	_g_object_unref0 (self->priv->animation);
	_g_object_unref0 (self->priv->title_label);
	_g_object_unref0 (self->priv->subtitle_label);
	_g_object_unref0 (self->priv->main_box);
	_g_object_unref0 (self->priv->voted_icon);
	_g_object_unref0 (self->priv->_check_button);
	_g_free0 (self->priv->_title);
	G_OBJECT_CLASS (tuba_widgets_vote_row_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_widgets_vote_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaWidgetsVoteRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_widgets_vote_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaWidgetsVoteRow), 0, (GInstanceInitFunc) tuba_widgets_vote_row_instance_init, NULL };
	GType tuba_widgets_vote_row_type_id;
	tuba_widgets_vote_row_type_id = g_type_register_static (gtk_list_box_row_get_type (), "TubaWidgetsVoteRow", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaWidgetsVoteRow_private_offset = g_type_add_instance_private (tuba_widgets_vote_row_type_id, sizeof (TubaWidgetsVoteRowPrivate));
	return tuba_widgets_vote_row_type_id;
}

GType
tuba_widgets_vote_row_get_type (void)
{
	static GType tuba_widgets_vote_row_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_widgets_vote_row_type_id__once)) {
		GType tuba_widgets_vote_row_type_id;
		tuba_widgets_vote_row_type_id = tuba_widgets_vote_row_get_type_once ();
		g_once_init_leave_pointer (&tuba_widgets_vote_row_type_id__once, tuba_widgets_vote_row_type_id);
	}
	return tuba_widgets_vote_row_type_id__once;
}

static void
_vala_tuba_widgets_vote_row_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec)
{
	TubaWidgetsVoteRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_WIDGETS_TYPE_VOTE_ROW, TubaWidgetsVoteRow);
	switch (property_id) {
		case TUBA_WIDGETS_VOTE_ROW_CHECK_BUTTON_PROPERTY:
		g_value_set_object (value, tuba_widgets_vote_row_get_check_button (self));
		break;
		case TUBA_WIDGETS_VOTE_ROW_DELAYED_ANIMATION_PROPERTY:
		g_value_set_boolean (value, tuba_widgets_vote_row_get_delayed_animation (self));
		break;
		case TUBA_WIDGETS_VOTE_ROW_WINNER_PROPERTY:
		g_value_set_boolean (value, tuba_widgets_vote_row_get_winner (self));
		break;
		case TUBA_WIDGETS_VOTE_ROW_PERCENTAGE_PROPERTY:
		g_value_set_double (value, tuba_widgets_vote_row_get_percentage (self));
		break;
		case TUBA_WIDGETS_VOTE_ROW_TITLE_PROPERTY:
		g_value_set_string (value, tuba_widgets_vote_row_get_title (self));
		break;
		case TUBA_WIDGETS_VOTE_ROW_VOTED_PROPERTY:
		g_value_set_boolean (value, tuba_widgets_vote_row_get_voted (self));
		break;
		case TUBA_WIDGETS_VOTE_ROW_SHOW_RESULTS_PROPERTY:
		g_value_set_boolean (value, tuba_widgets_vote_row_get_show_results (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_widgets_vote_row_set_property (GObject * object,
                                          guint property_id,
                                          const GValue * value,
                                          GParamSpec * pspec)
{
	TubaWidgetsVoteRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_WIDGETS_TYPE_VOTE_ROW, TubaWidgetsVoteRow);
	switch (property_id) {
		case TUBA_WIDGETS_VOTE_ROW_CHECK_BUTTON_PROPERTY:
		tuba_widgets_vote_row_set_check_button (self, g_value_get_object (value));
		break;
		case TUBA_WIDGETS_VOTE_ROW_DELAYED_ANIMATION_PROPERTY:
		tuba_widgets_vote_row_set_delayed_animation (self, g_value_get_boolean (value));
		break;
		case TUBA_WIDGETS_VOTE_ROW_WINNER_PROPERTY:
		tuba_widgets_vote_row_set_winner (self, g_value_get_boolean (value));
		break;
		case TUBA_WIDGETS_VOTE_ROW_PERCENTAGE_PROPERTY:
		tuba_widgets_vote_row_set_percentage (self, g_value_get_double (value));
		break;
		case TUBA_WIDGETS_VOTE_ROW_INSTANCE_EMOJIS_PROPERTY:
		tuba_widgets_vote_row_set_instance_emojis (self, g_value_get_object (value));
		break;
		case TUBA_WIDGETS_VOTE_ROW_TITLE_PROPERTY:
		tuba_widgets_vote_row_set_title (self, g_value_get_string (value));
		break;
		case TUBA_WIDGETS_VOTE_ROW_VOTED_PROPERTY:
		tuba_widgets_vote_row_set_voted (self, g_value_get_boolean (value));
		break;
		case TUBA_WIDGETS_VOTE_ROW_SHOW_RESULTS_PROPERTY:
		tuba_widgets_vote_row_set_show_results (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

