/* timer-row.c generated by valac 0.56.3, the Vala compiler
 * generated from timer-row.vala, do not modify */

/*
 * Copyright (C) 2013  Paolo Borelli <pborelli@gnome.org>
 * Copyright (C) 2020  Bilal Elmoussaoui <bilal.elmoussaoui@gnome.org>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * 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, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

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

#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 CLOCKS_TIMER_TYPE_ROW (clocks_timer_row_get_type ())
#define CLOCKS_TIMER_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_TIMER_TYPE_ROW, ClocksTimerRow))
#define CLOCKS_TIMER_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_TIMER_TYPE_ROW, ClocksTimerRowClass))
#define CLOCKS_TIMER_IS_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_TIMER_TYPE_ROW))
#define CLOCKS_TIMER_IS_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_TIMER_TYPE_ROW))
#define CLOCKS_TIMER_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_TIMER_TYPE_ROW, ClocksTimerRowClass))

typedef struct _ClocksTimerRow ClocksTimerRow;
typedef struct _ClocksTimerRowClass ClocksTimerRowClass;
typedef struct _ClocksTimerRowPrivate ClocksTimerRowPrivate;

#define CLOCKS_TIMER_TYPE_ITEM (clocks_timer_item_get_type ())
#define CLOCKS_TIMER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_TIMER_TYPE_ITEM, ClocksTimerItem))
#define CLOCKS_TIMER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_TIMER_TYPE_ITEM, ClocksTimerItemClass))
#define CLOCKS_TIMER_IS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_TIMER_TYPE_ITEM))
#define CLOCKS_TIMER_IS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_TIMER_TYPE_ITEM))
#define CLOCKS_TIMER_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_TIMER_TYPE_ITEM, ClocksTimerItemClass))

typedef struct _ClocksTimerItem ClocksTimerItem;
typedef struct _ClocksTimerItemClass ClocksTimerItemClass;
enum  {
	CLOCKS_TIMER_ROW_0_PROPERTY,
	CLOCKS_TIMER_ROW_ITEM_PROPERTY,
	CLOCKS_TIMER_ROW_NUM_PROPERTIES
};
static GParamSpec* clocks_timer_row_properties[CLOCKS_TIMER_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 CLOCKS_TYPE_CONTENT_ITEM (clocks_content_item_get_type ())
#define CLOCKS_CONTENT_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_TYPE_CONTENT_ITEM, ClocksContentItem))
#define CLOCKS_IS_CONTENT_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_TYPE_CONTENT_ITEM))
#define CLOCKS_CONTENT_ITEM_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CLOCKS_TYPE_CONTENT_ITEM, ClocksContentItemIface))

typedef struct _ClocksContentItem ClocksContentItem;
typedef struct _ClocksContentItemIface ClocksContentItemIface;
enum  {
	CLOCKS_TIMER_ROW_DELETED_SIGNAL,
	CLOCKS_TIMER_ROW_EDITED_SIGNAL,
	CLOCKS_TIMER_ROW_NUM_SIGNALS
};
static guint clocks_timer_row_signals[CLOCKS_TIMER_ROW_NUM_SIGNALS] = {0};

struct _ClocksTimerRow {
	GtkListBoxRow parent_instance;
	ClocksTimerRowPrivate * priv;
};

struct _ClocksTimerRowClass {
	GtkListBoxRowClass parent_class;
};

struct _ClocksTimerRowPrivate {
	ClocksTimerItem* _item;
	AdwTimedAnimation* paused_animation;
	GtkLabel* countdown_label;
	GtkLabel* timer_name;
	GtkStack* name_stack;
	GtkRevealer* name_revealer;
	GtkStack* start_stack;
	GtkStack* reset_stack;
	GtkStack* delete_stack;
	GtkButton* delete_button;
	GtkEntry* title;
};

struct _ClocksContentItemIface {
	GTypeInterface parent_iface;
	void (*serialize) (ClocksContentItem* self, GVariantBuilder* builder);
	const gchar* (*get_name) (ClocksContentItem* self);
	void (*set_name) (ClocksContentItem* self, const gchar* value);
};

static gint ClocksTimerRow_private_offset;
static gpointer clocks_timer_row_parent_class = NULL;

VALA_EXTERN GType clocks_timer_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClocksTimerRow, g_object_unref)
VALA_EXTERN GType clocks_timer_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClocksTimerItem, g_object_unref)
VALA_EXTERN ClocksTimerRow* clocks_timer_row_new (ClocksTimerItem* item);
VALA_EXTERN ClocksTimerRow* clocks_timer_row_construct (GType object_type,
                                            ClocksTimerItem* item);
static void clocks_timer_row_update_countdown (ClocksTimerRow* self,
                                        gint h,
                                        gint m,
                                        gint s);
static void _clocks_timer_row_update_countdown_clocks_timer_item_countdown_updated (ClocksTimerItem* _sender,
                                                                             gint hours,
                                                                             gint minutes,
                                                                             gint seconds,
                                                                             gpointer self);
static void __lambda36_ (ClocksTimerRow* self);
static void clocks_timer_row_ring (ClocksTimerRow* self);
static void ___lambda36__clocks_timer_item_ring (ClocksTimerItem* _sender,
                                          gpointer self);
static void __lambda37_ (ClocksTimerRow* self);
static void clocks_timer_row_start (ClocksTimerRow* self);
static void ___lambda37__clocks_timer_item_start (ClocksTimerItem* _sender,
                                           gpointer self);
static void __lambda38_ (ClocksTimerRow* self);
static void clocks_timer_row_pause (ClocksTimerRow* self);
static void ___lambda38__clocks_timer_item_pause (ClocksTimerItem* _sender,
                                           gpointer self);
static void __lambda39_ (ClocksTimerRow* self);
static void clocks_timer_row_reset (ClocksTimerRow* self);
static void ___lambda39__clocks_timer_item_reset (ClocksTimerItem* _sender,
                                           gpointer self);
static void __lambda41_ (ClocksTimerRow* self);
static void ___lambda41__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static void clocks_timer_row_animation_target (ClocksTimerRow* self,
                                        gdouble val);
static void _clocks_timer_row_animation_target_adw_animation_target_func (gdouble value,
                                                                   gpointer self);
static void clocks_timer_row_on_start_button_clicked (ClocksTimerRow* self);
VALA_EXTERN ClocksTimerItem* clocks_timer_row_get_item (ClocksTimerRow* self);
static void _clocks_timer_row_on_start_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                   gpointer self);
static void clocks_timer_row_on_pause_button_clicked (ClocksTimerRow* self);
static void _clocks_timer_row_on_pause_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                   gpointer self);
static void clocks_timer_row_on_reset_button_clicked (ClocksTimerRow* self);
static void _clocks_timer_row_on_reset_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                   gpointer self);
VALA_EXTERN gint clocks_timer_item_get_hours (ClocksTimerItem* self);
VALA_EXTERN gint clocks_timer_item_get_minutes (ClocksTimerItem* self);
VALA_EXTERN gint clocks_timer_item_get_seconds (ClocksTimerItem* self);
VALA_EXTERN void clocks_timer_row_set_item (ClocksTimerRow* self,
                                ClocksTimerItem* value);
VALA_EXTERN GType clocks_content_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClocksContentItem, g_object_unref)
VALA_EXTERN const gchar* clocks_content_item_get_name (ClocksContentItem* self);
static void _clocks_timer_row_item___lambda40_ (ClocksTimerRow* self);
static void __clocks_timer_row_item___lambda40__g_object_notify (GObject* _sender,
                                                          GParamSpec* pspec,
                                                          gpointer self);
static void clocks_timer_row_finalize (GObject * obj);
static GType clocks_timer_row_get_type_once (void);
static void _vala_clocks_timer_row_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec);
static void _vala_clocks_timer_row_set_property (GObject * object,
                                          guint property_id,
                                          const GValue * value,
                                          GParamSpec * pspec);

static inline gpointer
clocks_timer_row_get_instance_private (ClocksTimerRow* self)
{
	return G_STRUCT_MEMBER_P (self, ClocksTimerRow_private_offset);
}

static void
_clocks_timer_row_update_countdown_clocks_timer_item_countdown_updated (ClocksTimerItem* _sender,
                                                                        gint hours,
                                                                        gint minutes,
                                                                        gint seconds,
                                                                        gpointer self)
{
	clocks_timer_row_update_countdown ((ClocksTimerRow*) self, hours, minutes, seconds);
}

static void
__lambda36_ (ClocksTimerRow* self)
{
	clocks_timer_row_ring (self);
}

static void
___lambda36__clocks_timer_item_ring (ClocksTimerItem* _sender,
                                     gpointer self)
{
	__lambda36_ ((ClocksTimerRow*) self);
}

static void
__lambda37_ (ClocksTimerRow* self)
{
	clocks_timer_row_start (self);
}

static void
___lambda37__clocks_timer_item_start (ClocksTimerItem* _sender,
                                      gpointer self)
{
	__lambda37_ ((ClocksTimerRow*) self);
}

static void
__lambda38_ (ClocksTimerRow* self)
{
	clocks_timer_row_pause (self);
}

static void
___lambda38__clocks_timer_item_pause (ClocksTimerItem* _sender,
                                      gpointer self)
{
	__lambda38_ ((ClocksTimerRow*) self);
}

static void
__lambda39_ (ClocksTimerRow* self)
{
	clocks_timer_row_reset (self);
}

static void
___lambda39__clocks_timer_item_reset (ClocksTimerItem* _sender,
                                      gpointer self)
{
	__lambda39_ ((ClocksTimerRow*) self);
}

static void
__lambda41_ (ClocksTimerRow* self)
{
	g_signal_emit (self, clocks_timer_row_signals[CLOCKS_TIMER_ROW_DELETED_SIGNAL], 0);
}

static void
___lambda41__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda41_ ((ClocksTimerRow*) self);
}

static void
_clocks_timer_row_animation_target_adw_animation_target_func (gdouble value,
                                                              gpointer self)
{
	clocks_timer_row_animation_target ((ClocksTimerRow*) self, value);
}

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

ClocksTimerRow*
clocks_timer_row_construct (GType object_type,
                            ClocksTimerItem* item)
{
	ClocksTimerRow * self = NULL;
	GtkLabel* _tmp0_;
	GtkButton* _tmp1_;
	AdwCallbackAnimationTarget* target = NULL;
	AdwCallbackAnimationTarget* _tmp2_;
	AdwAnimationTarget* _tmp3_;
	AdwTimedAnimation* _tmp4_;
	AdwTimedAnimation* _tmp5_;
	AdwTimedAnimation* _tmp6_;
	g_return_val_if_fail (item != NULL, NULL);
	self = (ClocksTimerRow*) g_object_new (object_type, "item", item, NULL);
	_tmp0_ = self->priv->countdown_label;
	gtk_widget_set_direction ((GtkWidget*) _tmp0_, GTK_TEXT_DIR_LTR);
	g_signal_connect_object (item, "countdown-updated", (GCallback) _clocks_timer_row_update_countdown_clocks_timer_item_countdown_updated, self, 0);
	g_signal_connect_object (item, "ring", (GCallback) ___lambda36__clocks_timer_item_ring, self, 0);
	g_signal_connect_object (item, "start", (GCallback) ___lambda37__clocks_timer_item_start, self, 0);
	g_signal_connect_object (item, "pause", (GCallback) ___lambda38__clocks_timer_item_pause, self, 0);
	g_signal_connect_object (item, "reset", (GCallback) ___lambda39__clocks_timer_item_reset, self, 0);
	_tmp1_ = self->priv->delete_button;
	g_signal_connect_object (_tmp1_, "clicked", (GCallback) ___lambda41__gtk_button_clicked, self, 0);
	_tmp2_ = (AdwCallbackAnimationTarget*) adw_callback_animation_target_new (_clocks_timer_row_animation_target_adw_animation_target_func, g_object_ref (self), g_object_unref);
	target = _tmp2_;
	_tmp3_ = _g_object_ref0 ((AdwAnimationTarget*) target);
	_tmp4_ = (AdwTimedAnimation*) adw_timed_animation_new ((GtkWidget*) self, (gdouble) 0, (gdouble) 2, (guint) 2000, _tmp3_);
	_g_object_unref0 (self->priv->paused_animation);
	self->priv->paused_animation = _tmp4_;
	_tmp5_ = self->priv->paused_animation;
	adw_timed_animation_set_repeat_count (_tmp5_, ADW_DURATION_INFINITE);
	_tmp6_ = self->priv->paused_animation;
	adw_timed_animation_set_easing (_tmp6_, ADW_LINEAR);
	clocks_timer_row_reset (self);
	_g_object_unref0 (target);
	return self;
}

ClocksTimerRow*
clocks_timer_row_new (ClocksTimerItem* item)
{
	return clocks_timer_row_construct (CLOCKS_TIMER_TYPE_ROW, item);
}

static void
clocks_timer_row_on_start_button_clicked (ClocksTimerRow* self)
{
	ClocksTimerItem* _tmp0_;
	ClocksTimerItem* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = clocks_timer_row_get_item (self);
	_tmp1_ = _tmp0_;
	g_signal_emit_by_name (_tmp1_, "start");
}

static void
_clocks_timer_row_on_start_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                              gpointer self)
{
	clocks_timer_row_on_start_button_clicked ((ClocksTimerRow*) self);
}

static void
clocks_timer_row_on_pause_button_clicked (ClocksTimerRow* self)
{
	ClocksTimerItem* _tmp0_;
	ClocksTimerItem* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = clocks_timer_row_get_item (self);
	_tmp1_ = _tmp0_;
	g_signal_emit_by_name (_tmp1_, "pause");
}

static void
_clocks_timer_row_on_pause_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                              gpointer self)
{
	clocks_timer_row_on_pause_button_clicked ((ClocksTimerRow*) self);
}

static void
clocks_timer_row_on_reset_button_clicked (ClocksTimerRow* self)
{
	ClocksTimerItem* _tmp0_;
	ClocksTimerItem* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = clocks_timer_row_get_item (self);
	_tmp1_ = _tmp0_;
	g_signal_emit_by_name (_tmp1_, "reset");
}

static void
_clocks_timer_row_on_reset_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                              gpointer self)
{
	clocks_timer_row_on_reset_button_clicked ((ClocksTimerRow*) self);
}

static void
clocks_timer_row_reset (ClocksTimerRow* self)
{
	GtkStack* _tmp0_;
	GtkStack* _tmp1_;
	GtkLabel* _tmp2_;
	GtkLabel* _tmp3_;
	AdwTimedAnimation* _tmp4_;
	GtkStack* _tmp5_;
	GtkRevealer* _tmp6_;
	GtkStack* _tmp7_;
	ClocksTimerItem* _tmp8_;
	ClocksTimerItem* _tmp9_;
	gint _tmp10_;
	gint _tmp11_;
	ClocksTimerItem* _tmp12_;
	ClocksTimerItem* _tmp13_;
	gint _tmp14_;
	gint _tmp15_;
	ClocksTimerItem* _tmp16_;
	ClocksTimerItem* _tmp17_;
	gint _tmp18_;
	gint _tmp19_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->reset_stack;
	gtk_stack_set_visible_child_name (_tmp0_, "empty");
	_tmp1_ = self->priv->delete_stack;
	gtk_stack_set_visible_child_name (_tmp1_, "button");
	_tmp2_ = self->priv->countdown_label;
	gtk_widget_remove_css_class ((GtkWidget*) _tmp2_, "accent");
	_tmp3_ = self->priv->countdown_label;
	gtk_widget_add_css_class ((GtkWidget*) _tmp3_, "dim-label");
	_tmp4_ = self->priv->paused_animation;
	adw_animation_pause ((AdwAnimation*) _tmp4_);
	_tmp5_ = self->priv->start_stack;
	gtk_stack_set_visible_child_name (_tmp5_, "start");
	_tmp6_ = self->priv->name_revealer;
	gtk_revealer_set_reveal_child (_tmp6_, TRUE);
	_tmp7_ = self->priv->name_stack;
	gtk_stack_set_visible_child_name (_tmp7_, "edit");
	_tmp8_ = clocks_timer_row_get_item (self);
	_tmp9_ = _tmp8_;
	_tmp10_ = clocks_timer_item_get_hours (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = clocks_timer_row_get_item (self);
	_tmp13_ = _tmp12_;
	_tmp14_ = clocks_timer_item_get_minutes (_tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = clocks_timer_row_get_item (self);
	_tmp17_ = _tmp16_;
	_tmp18_ = clocks_timer_item_get_seconds (_tmp17_);
	_tmp19_ = _tmp18_;
	clocks_timer_row_update_countdown (self, _tmp11_, _tmp15_, _tmp19_);
}

static void
clocks_timer_row_start (ClocksTimerRow* self)
{
	GtkLabel* _tmp0_;
	GtkLabel* _tmp1_;
	AdwTimedAnimation* _tmp2_;
	GtkStack* _tmp3_;
	GtkStack* _tmp4_;
	GtkStack* _tmp5_;
	GtkRevealer* _tmp6_;
	GtkLabel* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	GtkStack* _tmp10_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->countdown_label;
	gtk_widget_add_css_class ((GtkWidget*) _tmp0_, "accent");
	_tmp1_ = self->priv->countdown_label;
	gtk_widget_remove_css_class ((GtkWidget*) _tmp1_, "dim-label");
	_tmp2_ = self->priv->paused_animation;
	adw_animation_pause ((AdwAnimation*) _tmp2_);
	_tmp3_ = self->priv->reset_stack;
	gtk_stack_set_visible_child_name (_tmp3_, "empty");
	_tmp4_ = self->priv->delete_stack;
	gtk_stack_set_visible_child_name (_tmp4_, "empty");
	_tmp5_ = self->priv->start_stack;
	gtk_stack_set_visible_child_name (_tmp5_, "pause");
	_tmp6_ = self->priv->name_revealer;
	_tmp7_ = self->priv->timer_name;
	_tmp8_ = gtk_label_get_label (_tmp7_);
	_tmp9_ = _tmp8_;
	gtk_revealer_set_reveal_child (_tmp6_, g_strcmp0 (_tmp9_, "") != 0);
	_tmp10_ = self->priv->name_stack;
	gtk_stack_set_visible_child_name (_tmp10_, "display");
}

static void
clocks_timer_row_ring (ClocksTimerRow* self)
{
	AdwTimedAnimation* _tmp0_;
	GtkLabel* _tmp1_;
	GtkLabel* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->paused_animation;
	adw_animation_pause ((AdwAnimation*) _tmp0_);
	_tmp1_ = self->priv->countdown_label;
	gtk_widget_remove_css_class ((GtkWidget*) _tmp1_, "accent");
	_tmp2_ = self->priv->countdown_label;
	gtk_widget_add_css_class ((GtkWidget*) _tmp2_, "dim-label");
}

static void
clocks_timer_row_pause (ClocksTimerRow* self)
{
	AdwTimedAnimation* _tmp0_;
	GtkStack* _tmp1_;
	GtkStack* _tmp2_;
	GtkStack* _tmp3_;
	GtkRevealer* _tmp4_;
	GtkLabel* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	GtkStack* _tmp8_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->paused_animation;
	adw_animation_play ((AdwAnimation*) _tmp0_);
	_tmp1_ = self->priv->reset_stack;
	gtk_stack_set_visible_child_name (_tmp1_, "button");
	_tmp2_ = self->priv->delete_stack;
	gtk_stack_set_visible_child_name (_tmp2_, "button");
	_tmp3_ = self->priv->start_stack;
	gtk_stack_set_visible_child_name (_tmp3_, "start");
	_tmp4_ = self->priv->name_revealer;
	_tmp5_ = self->priv->timer_name;
	_tmp6_ = gtk_label_get_label (_tmp5_);
	_tmp7_ = _tmp6_;
	gtk_revealer_set_reveal_child (_tmp4_, g_strcmp0 (_tmp7_, "") != 0);
	_tmp8_ = self->priv->name_stack;
	gtk_stack_set_visible_child_name (_tmp8_, "display");
}

static void
clocks_timer_row_update_countdown (ClocksTimerRow* self,
                                   gint h,
                                   gint m,
                                   gint s)
{
	GtkLabel* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->countdown_label;
	_tmp1_ = g_strdup_printf ("%02i ∶ %02i ∶ %02i", h, m, s);
	_tmp2_ = _tmp1_;
	gtk_label_set_text (_tmp0_, _tmp2_);
	_g_free0 (_tmp2_);
}

static void
clocks_timer_row_animation_target (ClocksTimerRow* self,
                                   gdouble val)
{
	g_return_if_fail (self != NULL);
	if (val < 1.0) {
		GtkLabel* _tmp0_;
		GtkLabel* _tmp1_;
		_tmp0_ = self->priv->countdown_label;
		gtk_widget_add_css_class ((GtkWidget*) _tmp0_, "dim-label");
		_tmp1_ = self->priv->countdown_label;
		gtk_widget_remove_css_class ((GtkWidget*) _tmp1_, "accent");
	} else {
		GtkLabel* _tmp2_;
		GtkLabel* _tmp3_;
		_tmp2_ = self->priv->countdown_label;
		gtk_widget_add_css_class ((GtkWidget*) _tmp2_, "accent");
		_tmp3_ = self->priv->countdown_label;
		gtk_widget_remove_css_class ((GtkWidget*) _tmp3_, "dim-label");
	}
}

ClocksTimerItem*
clocks_timer_row_get_item (ClocksTimerRow* self)
{
	ClocksTimerItem* result;
	ClocksTimerItem* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_item;
	result = _tmp0_;
	return result;
}

static void
_clocks_timer_row_item___lambda40_ (ClocksTimerRow* self)
{
	g_signal_emit (self, clocks_timer_row_signals[CLOCKS_TIMER_ROW_EDITED_SIGNAL], 0);
}

static void
__clocks_timer_row_item___lambda40__g_object_notify (GObject* _sender,
                                                     GParamSpec* pspec,
                                                     gpointer self)
{
	_clocks_timer_row_item___lambda40_ ((ClocksTimerRow*) self);
}

void
clocks_timer_row_set_item (ClocksTimerRow* self,
                           ClocksTimerItem* value)
{
	ClocksTimerItem* _tmp0_;
	GtkEntry* _tmp1_;
	ClocksTimerItem* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	GtkEntry* _tmp5_;
	ClocksTimerItem* _tmp6_;
	GtkLabel* _tmp7_;
	ClocksTimerItem* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	GtkEntry* _tmp11_;
	GtkLabel* _tmp12_;
	ClocksTimerItem* _tmp13_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_item);
	self->priv->_item = _tmp0_;
	_tmp1_ = self->priv->title;
	_tmp2_ = self->priv->_item;
	_tmp3_ = clocks_content_item_get_name ((ClocksContentItem*) _tmp2_);
	_tmp4_ = _tmp3_;
	gtk_editable_set_text ((GtkEditable*) _tmp1_, (const gchar*) _tmp4_);
	_tmp5_ = self->priv->title;
	_tmp6_ = self->priv->_item;
	g_object_bind_property_with_closures ((GObject*) _tmp5_, "text", (GObject*) _tmp6_, "name", G_BINDING_DEFAULT, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp7_ = self->priv->timer_name;
	_tmp8_ = self->priv->_item;
	_tmp9_ = clocks_content_item_get_name ((ClocksContentItem*) _tmp8_);
	_tmp10_ = _tmp9_;
	gtk_label_set_label (_tmp7_, (const gchar*) _tmp10_);
	_tmp11_ = self->priv->title;
	_tmp12_ = self->priv->timer_name;
	g_object_bind_property_with_closures ((GObject*) _tmp11_, "text", (GObject*) _tmp12_, "label", G_BINDING_DEFAULT, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp13_ = self->priv->_item;
	g_signal_connect_object ((GObject*) _tmp13_, "notify::name", (GCallback) __clocks_timer_row_item___lambda40__g_object_notify, self, 0);
	g_object_notify_by_pspec ((GObject *) self, clocks_timer_row_properties[CLOCKS_TIMER_ROW_ITEM_PROPERTY]);
}

static void
clocks_timer_row_class_init (ClocksTimerRowClass * klass,
                             gpointer klass_data)
{
	clocks_timer_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ClocksTimerRow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_clocks_timer_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_clocks_timer_row_set_property;
	G_OBJECT_CLASS (klass)->finalize = clocks_timer_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_TIMER_ROW_ITEM_PROPERTY, clocks_timer_row_properties[CLOCKS_TIMER_ROW_ITEM_PROPERTY] = g_param_spec_object ("item", "item", "item", CLOCKS_TIMER_TYPE_ITEM, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/clocks/ui/timer-row.ui");
	clocks_timer_row_signals[CLOCKS_TIMER_ROW_DELETED_SIGNAL] = g_signal_new ("deleted", CLOCKS_TIMER_TYPE_ROW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	clocks_timer_row_signals[CLOCKS_TIMER_ROW_EDITED_SIGNAL] = g_signal_new ("edited", CLOCKS_TIMER_TYPE_ROW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "countdown_label", FALSE, ClocksTimerRow_private_offset + G_STRUCT_OFFSET (ClocksTimerRowPrivate, countdown_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "timer_name", FALSE, ClocksTimerRow_private_offset + G_STRUCT_OFFSET (ClocksTimerRowPrivate, timer_name));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "name_stack", FALSE, ClocksTimerRow_private_offset + G_STRUCT_OFFSET (ClocksTimerRowPrivate, name_stack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "name_revealer", FALSE, ClocksTimerRow_private_offset + G_STRUCT_OFFSET (ClocksTimerRowPrivate, name_revealer));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "start_stack", FALSE, ClocksTimerRow_private_offset + G_STRUCT_OFFSET (ClocksTimerRowPrivate, start_stack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "reset_stack", FALSE, ClocksTimerRow_private_offset + G_STRUCT_OFFSET (ClocksTimerRowPrivate, reset_stack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "delete_stack", FALSE, ClocksTimerRow_private_offset + G_STRUCT_OFFSET (ClocksTimerRowPrivate, delete_stack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "delete_button", FALSE, ClocksTimerRow_private_offset + G_STRUCT_OFFSET (ClocksTimerRowPrivate, delete_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "title", FALSE, ClocksTimerRow_private_offset + G_STRUCT_OFFSET (ClocksTimerRowPrivate, title));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_start_button_clicked", G_CALLBACK(_clocks_timer_row_on_start_button_clicked_gtk_button_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_pause_button_clicked", G_CALLBACK(_clocks_timer_row_on_pause_button_clicked_gtk_button_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_reset_button_clicked", G_CALLBACK(_clocks_timer_row_on_reset_button_clicked_gtk_button_clicked));
}

static void
clocks_timer_row_instance_init (ClocksTimerRow * self,
                                gpointer klass)
{
	self->priv = clocks_timer_row_get_instance_private (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
clocks_timer_row_finalize (GObject * obj)
{
	ClocksTimerRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CLOCKS_TIMER_TYPE_ROW, ClocksTimerRow);
	_g_object_unref0 (self->priv->_item);
	_g_object_unref0 (self->priv->paused_animation);
	G_OBJECT_CLASS (clocks_timer_row_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
clocks_timer_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ClocksTimerRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) clocks_timer_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ClocksTimerRow), 0, (GInstanceInitFunc) clocks_timer_row_instance_init, NULL };
	GType clocks_timer_row_type_id;
	clocks_timer_row_type_id = g_type_register_static (gtk_list_box_row_get_type (), "ClocksTimerRow", &g_define_type_info, 0);
	ClocksTimerRow_private_offset = g_type_add_instance_private (clocks_timer_row_type_id, sizeof (ClocksTimerRowPrivate));
	return clocks_timer_row_type_id;
}

GType
clocks_timer_row_get_type (void)
{
	static volatile gsize clocks_timer_row_type_id__once = 0;
	if (g_once_init_enter (&clocks_timer_row_type_id__once)) {
		GType clocks_timer_row_type_id;
		clocks_timer_row_type_id = clocks_timer_row_get_type_once ();
		g_once_init_leave (&clocks_timer_row_type_id__once, clocks_timer_row_type_id);
	}
	return clocks_timer_row_type_id__once;
}

static void
_vala_clocks_timer_row_get_property (GObject * object,
                                     guint property_id,
                                     GValue * value,
                                     GParamSpec * pspec)
{
	ClocksTimerRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_TIMER_TYPE_ROW, ClocksTimerRow);
	switch (property_id) {
		case CLOCKS_TIMER_ROW_ITEM_PROPERTY:
		g_value_set_object (value, clocks_timer_row_get_item (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_clocks_timer_row_set_property (GObject * object,
                                     guint property_id,
                                     const GValue * value,
                                     GParamSpec * pspec)
{
	ClocksTimerRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_TIMER_TYPE_ROW, ClocksTimerRow);
	switch (property_id) {
		case CLOCKS_TIMER_ROW_ITEM_PROPERTY:
		clocks_timer_row_set_item (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

