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

/*
 * Copyright (c) 2021-2025 focus-timer contributors
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 *
 * Authors: Kamil Prusko <kamilprusko@gmail.com>
 */

#include "ft_ui.h"
#include <gtk/gtk.h>
#include "ft_core.h"
#include <glib.h>
#include <adwaita.h>
#include <float.h>
#include <math.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <pango/pango.h>
#include <cairo-gobject.h>

#define FT_TIMER_LABEL_BLINK_FADE_VALUE 0.2
#define FT_TIMER_LABEL_BLINK_DURATION ((guint) 1500)
#define FT_TIMER_LABEL_TRANSITION_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

enum  {
	FT_TIMER_LABEL_0_PROPERTY,
	FT_TIMER_LABEL_TIMER_PROPERTY,
	FT_TIMER_LABEL_PLACEHOLDER_HAS_HOURS_PROPERTY,
	FT_TIMER_LABEL_NUM_PROPERTIES
};
static GParamSpec* ft_timer_label_properties[FT_TIMER_LABEL_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

struct _FtTimerLabelPrivate {
	GtkBox* placeholder_box;
	FtMonospaceLabel* placeholder_hours_label;
	FtMonospaceLabel* placeholder_hours_separator_label;
	FtMonospaceLabel* placeholder_minutes_label;
	FtMonospaceLabel* placeholder_minutes_separator_label;
	FtMonospaceLabel* placeholder_seconds_label;
	GtkBox* box;
	FtMonospaceLabel* hours_label;
	FtMonospaceLabel* hours_separator_label;
	FtMonospaceLabel* minutes_label;
	FtMonospaceLabel* minutes_separator_label;
	FtMonospaceLabel* seconds_label;
	FtTimer* _timer;
	gulong timer_state_changed_id;
	gulong timer_tick_id;
	AdwTimedAnimation* crossfade_animation;
	AdwTimedAnimation* blink_animation;
	AdwTimedAnimation* hours_animation;
	gdouble reference_width_lower;
	gdouble reference_width_upper;
	gdouble reference_height;
	gdouble reference_baseline;
	gboolean faded_in;
	gboolean _placeholder_has_hours;
	gboolean has_hours;
	gdouble scale;
};

static gint FtTimerLabel_private_offset;
static gpointer ft_timer_label_parent_class = NULL;
static GtkBuildableIface * ft_timer_label_gtk_buildable_parent_iface = NULL;

static void ft_timer_label_set_default_direction_ltr (FtTimerLabel* self);
static gdouble ft_timer_label_get_crossfade_progress (FtTimerLabel* self);
static void ft_timer_label_update_children_scale (FtTimerLabel* self);
static void ft_timer_label_stop_hours_animation (FtTimerLabel* self);
static void ft_timer_label_start_hours_animation (FtTimerLabel* self);
static gboolean ft_timer_label_get_has_hours (FtTimerLabel* self);
static void _gtk_widget_queue_resize_adw_animation_target_func (gdouble value,
                                                         gpointer self);
static void _ft_timer_label_stop_hours_animation_adw_animation_done (AdwAnimation* _sender,
                                                              gpointer self);
static void ft_timer_label_stop_crossfade_animation (FtTimerLabel* self);
static void ft_timer_label_fade_in (FtTimerLabel* self);
static void _gtk_widget_queue_draw_adw_animation_target_func (gdouble value,
                                                       gpointer self);
static void _ft_timer_label_stop_crossfade_animation_adw_animation_done (AdwAnimation* _sender,
                                                                  gpointer self);
static void ft_timer_label_fade_out (FtTimerLabel* self);
static void ft_timer_label_update_css_classes (FtTimerLabel* self);
static void ft_timer_label_update_remaining_time (FtTimerLabel* self,
                                           gint64 timestamp);
static gboolean ft_timer_label_should_blink (FtTimerLabel* self);
static void ft_timer_label_stop_blinking_animation (FtTimerLabel* self);
static void _ft_timer_label_stop_blinking_animation_adw_animation_done (AdwAnimation* _sender,
                                                                 gpointer self);
static void ft_timer_label_start_blinking_animation (FtTimerLabel* self);
static void _ft_timer_label_start_blinking_animation_adw_animation_done (AdwAnimation* _sender,
                                                                  gpointer self);
static void ft_timer_label_update (FtTimerLabel* self,
                            gint64 timestamp);
static void ft_timer_label_connect_signals (FtTimerLabel* self);
static void ft_timer_label_on_timer_tick (FtTimerLabel* self,
                                   gint64 timestamp);
static void _ft_timer_label_on_timer_tick_ft_timer_tick (FtTimer* _sender,
                                                  gint64 timestamp,
                                                  gpointer self);
static void ft_timer_label_on_timer_state_changed (FtTimerLabel* self,
                                            const FtTimerState* current_state,
                                            const FtTimerState* previous_state);
static void _ft_timer_label_on_timer_state_changed_ft_timer_state_changed (FtTimer* _sender,
                                                                    const FtTimerState* current_state,
                                                                    const FtTimerState* previous_state,
                                                                    gpointer self);
static void ft_timer_label_disconnect_signals (FtTimerLabel* self);
static void ft_timer_label_ensure_reference_size (FtTimerLabel* self);
static void ft_timer_label_invalidate_reference_size (FtTimerLabel* self);
static gdouble ft_timer_label_get_reference_width (FtTimerLabel* self);
static GtkSizeRequestMode ft_timer_label_real_get_request_mode (GtkWidget* base);
static void ft_timer_label_real_measure (GtkWidget* base,
                                  GtkOrientation orientation,
                                  gint for_size,
                                  gint* minimum,
                                  gint* natural,
                                  gint* minimum_baseline,
                                  gint* natural_baseline);
static void ft_timer_label_real_size_allocate (GtkWidget* base,
                                        gint width,
                                        gint height,
                                        gint baseline);
static void ft_timer_label_real_snapshot (GtkWidget* base,
                                   GtkSnapshot* snapshot);
static void ft_timer_label_real_map (GtkWidget* base);
static void ft_timer_label_real_unmap (GtkWidget* base);
static void ft_timer_label_real_unroot (GtkWidget* base);
static void ft_timer_label_real_dispose (GObject* base);
static GObject * ft_timer_label_constructor (GType type,
                                      guint n_construct_properties,
                                      GObjectConstructParam * construct_properties);
static void ft_timer_label_finalize (GObject * obj);
static GType ft_timer_label_get_type_once (void);
static void _vala_ft_timer_label_get_property (GObject * object,
                                        guint property_id,
                                        GValue * value,
                                        GParamSpec * pspec);
static void _vala_ft_timer_label_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
ft_timer_label_get_instance_private (FtTimerLabel* self)
{
	return G_STRUCT_MEMBER_P (self, FtTimerLabel_private_offset);
}

static void
ft_timer_label_set_default_direction_ltr (FtTimerLabel* self)
{
	GtkBox* _tmp0_;
	FtMonospaceLabel* _tmp1_;
	FtMonospaceLabel* _tmp2_;
	FtMonospaceLabel* _tmp3_;
	FtMonospaceLabel* _tmp4_;
	FtMonospaceLabel* _tmp5_;
	GtkBox* _tmp6_;
	FtMonospaceLabel* _tmp7_;
	FtMonospaceLabel* _tmp8_;
	FtMonospaceLabel* _tmp9_;
	FtMonospaceLabel* _tmp10_;
	FtMonospaceLabel* _tmp11_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->placeholder_box;
	gtk_widget_set_direction ((GtkWidget*) _tmp0_, GTK_TEXT_DIR_LTR);
	_tmp1_ = self->priv->placeholder_hours_label;
	gtk_widget_set_direction ((GtkWidget*) _tmp1_, GTK_TEXT_DIR_LTR);
	_tmp2_ = self->priv->placeholder_hours_separator_label;
	gtk_widget_set_direction ((GtkWidget*) _tmp2_, GTK_TEXT_DIR_LTR);
	_tmp3_ = self->priv->placeholder_minutes_label;
	gtk_widget_set_direction ((GtkWidget*) _tmp3_, GTK_TEXT_DIR_LTR);
	_tmp4_ = self->priv->placeholder_minutes_separator_label;
	gtk_widget_set_direction ((GtkWidget*) _tmp4_, GTK_TEXT_DIR_LTR);
	_tmp5_ = self->priv->placeholder_seconds_label;
	gtk_widget_set_direction ((GtkWidget*) _tmp5_, GTK_TEXT_DIR_LTR);
	_tmp6_ = self->priv->box;
	gtk_widget_set_direction ((GtkWidget*) _tmp6_, GTK_TEXT_DIR_LTR);
	_tmp7_ = self->priv->hours_label;
	gtk_widget_set_direction ((GtkWidget*) _tmp7_, GTK_TEXT_DIR_LTR);
	_tmp8_ = self->priv->hours_separator_label;
	gtk_widget_set_direction ((GtkWidget*) _tmp8_, GTK_TEXT_DIR_LTR);
	_tmp9_ = self->priv->minutes_label;
	gtk_widget_set_direction ((GtkWidget*) _tmp9_, GTK_TEXT_DIR_LTR);
	_tmp10_ = self->priv->minutes_separator_label;
	gtk_widget_set_direction ((GtkWidget*) _tmp10_, GTK_TEXT_DIR_LTR);
	_tmp11_ = self->priv->seconds_label;
	gtk_widget_set_direction ((GtkWidget*) _tmp11_, GTK_TEXT_DIR_LTR);
}

static gdouble
ft_timer_label_get_crossfade_progress (FtTimerLabel* self)
{
	AdwTimedAnimation* _tmp0_;
	gdouble _tmp4_ = 0.0;
	gdouble result;
	g_return_val_if_fail (self != NULL, -1.0);
	_tmp0_ = self->priv->crossfade_animation;
	if (_tmp0_ != NULL) {
		AdwTimedAnimation* _tmp1_;
		gdouble _tmp2_;
		gdouble _tmp3_;
		_tmp1_ = self->priv->crossfade_animation;
		_tmp2_ = adw_animation_get_value ((AdwAnimation*) _tmp1_);
		_tmp3_ = _tmp2_;
		result = _tmp3_;
		return result;
	}
	if (self->priv->faded_in) {
		_tmp4_ = 1.0;
	} else {
		_tmp4_ = 0.0;
	}
	result = _tmp4_;
	return result;
}

static void
ft_timer_label_update_children_scale (FtTimerLabel* self)
{
	FtMonospaceLabel* _tmp0_;
	FtMonospaceLabel* _tmp1_;
	FtMonospaceLabel* _tmp2_;
	FtMonospaceLabel* _tmp3_;
	FtMonospaceLabel* _tmp4_;
	FtMonospaceLabel* _tmp5_;
	FtMonospaceLabel* _tmp6_;
	FtMonospaceLabel* _tmp7_;
	FtMonospaceLabel* _tmp8_;
	FtMonospaceLabel* _tmp9_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->placeholder_hours_label;
	ft_monospace_label_set_scale (_tmp0_, self->priv->scale);
	_tmp1_ = self->priv->placeholder_hours_separator_label;
	ft_monospace_label_set_scale (_tmp1_, self->priv->scale);
	_tmp2_ = self->priv->placeholder_minutes_label;
	ft_monospace_label_set_scale (_tmp2_, self->priv->scale);
	_tmp3_ = self->priv->placeholder_minutes_separator_label;
	ft_monospace_label_set_scale (_tmp3_, self->priv->scale);
	_tmp4_ = self->priv->placeholder_seconds_label;
	ft_monospace_label_set_scale (_tmp4_, self->priv->scale);
	_tmp5_ = self->priv->hours_label;
	ft_monospace_label_set_scale (_tmp5_, self->priv->scale);
	_tmp6_ = self->priv->hours_separator_label;
	ft_monospace_label_set_scale (_tmp6_, self->priv->scale);
	_tmp7_ = self->priv->minutes_label;
	ft_monospace_label_set_scale (_tmp7_, self->priv->scale);
	_tmp8_ = self->priv->minutes_separator_label;
	ft_monospace_label_set_scale (_tmp8_, self->priv->scale);
	_tmp9_ = self->priv->seconds_label;
	ft_monospace_label_set_scale (_tmp9_, self->priv->scale);
}

static void
ft_timer_label_stop_hours_animation (FtTimerLabel* self)
{
	AdwTimedAnimation* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->hours_animation;
	if (_tmp0_ != NULL) {
		AdwTimedAnimation* _tmp1_;
		_tmp1_ = self->priv->hours_animation;
		adw_animation_pause ((AdwAnimation*) _tmp1_);
		_g_object_unref0 (self->priv->hours_animation);
		self->priv->hours_animation = NULL;
	}
}

/**
         * TODO: hours animation is not smooth.
         *
         * When animating labels scale the labels are jittery. It's smoother to keep labels at constant scale during
         * animation, but during snapshot children are pixelated. Either we could render glyphs directly in the
         * snapshot, or render children onto a texture to have more interpolation options.
         */
static void
_gtk_widget_queue_resize_adw_animation_target_func (gdouble value,
                                                    gpointer self)
{
	gtk_widget_queue_resize ((GtkWidget*) self);
}

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

static void
_ft_timer_label_stop_hours_animation_adw_animation_done (AdwAnimation* _sender,
                                                         gpointer self)
{
	ft_timer_label_stop_hours_animation ((FtTimerLabel*) self);
}

static void
ft_timer_label_start_hours_animation (FtTimerLabel* self)
{
	gboolean has_hours = FALSE;
	gdouble _tmp0_ = 0.0;
	gdouble progress = 0.0;
	AdwTimedAnimation* _tmp1_;
	AdwCallbackAnimationTarget* animation_target = NULL;
	AdwCallbackAnimationTarget* _tmp6_;
	gdouble _tmp7_ = 0.0;
	AdwCallbackAnimationTarget* _tmp8_;
	AdwAnimationTarget* _tmp9_;
	AdwTimedAnimation* _tmp10_;
	AdwTimedAnimation* _tmp11_;
	AdwTimedAnimation* _tmp12_;
	AdwTimedAnimation* _tmp13_;
	g_return_if_fail (self != NULL);
	has_hours = ft_timer_label_get_has_hours (self);
	if (!has_hours) {
		_tmp0_ = 1.0;
	} else {
		_tmp0_ = 0.0;
	}
	progress = _tmp0_;
	_tmp1_ = self->priv->hours_animation;
	if (_tmp1_ != NULL) {
		AdwTimedAnimation* _tmp2_;
		gdouble _tmp3_;
		gdouble _tmp4_;
		AdwTimedAnimation* _tmp5_;
		_tmp2_ = self->priv->hours_animation;
		_tmp3_ = adw_animation_get_value ((AdwAnimation*) _tmp2_);
		_tmp4_ = _tmp3_;
		progress = _tmp4_;
		_tmp5_ = self->priv->hours_animation;
		adw_animation_pause ((AdwAnimation*) _tmp5_);
		_g_object_unref0 (self->priv->hours_animation);
		self->priv->hours_animation = NULL;
	}
	_tmp6_ = (AdwCallbackAnimationTarget*) adw_callback_animation_target_new (_gtk_widget_queue_resize_adw_animation_target_func, g_object_ref ((GtkWidget*) self), g_object_unref);
	animation_target = _tmp6_;
	if (has_hours) {
		_tmp7_ = 1.0;
	} else {
		_tmp7_ = 0.0;
	}
	_tmp8_ = animation_target;
	_tmp9_ = _g_object_ref0 ((AdwAnimationTarget*) _tmp8_);
	_tmp10_ = (AdwTimedAnimation*) adw_timed_animation_new ((GtkWidget*) self, progress, _tmp7_, (guint) 300, _tmp9_);
	_g_object_unref0 (self->priv->hours_animation);
	self->priv->hours_animation = _tmp10_;
	_tmp11_ = self->priv->hours_animation;
	adw_timed_animation_set_easing (_tmp11_, ADW_EASE_OUT_QUAD);
	_tmp12_ = self->priv->hours_animation;
	g_signal_connect_object ((AdwAnimation*) _tmp12_, "done", (GCallback) _ft_timer_label_stop_hours_animation_adw_animation_done, self, 0);
	_tmp13_ = self->priv->hours_animation;
	adw_animation_play ((AdwAnimation*) _tmp13_);
	_g_object_unref0 (animation_target);
}

static void
ft_timer_label_stop_crossfade_animation (FtTimerLabel* self)
{
	AdwTimedAnimation* _tmp0_;
	GtkBox* _tmp2_;
	GtkBox* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->crossfade_animation;
	if (_tmp0_ != NULL) {
		AdwTimedAnimation* _tmp1_;
		_tmp1_ = self->priv->crossfade_animation;
		adw_animation_pause ((AdwAnimation*) _tmp1_);
		_g_object_unref0 (self->priv->crossfade_animation);
		self->priv->crossfade_animation = NULL;
	}
	_tmp2_ = self->priv->placeholder_box;
	gtk_widget_set_child_visible ((GtkWidget*) _tmp2_, !self->priv->faded_in);
	_tmp3_ = self->priv->box;
	gtk_widget_set_child_visible ((GtkWidget*) _tmp3_, self->priv->faded_in);
	gtk_widget_queue_allocate ((GtkWidget*) self);
}

static void
_gtk_widget_queue_draw_adw_animation_target_func (gdouble value,
                                                  gpointer self)
{
	gtk_widget_queue_draw ((GtkWidget*) self);
}

static void
_ft_timer_label_stop_crossfade_animation_adw_animation_done (AdwAnimation* _sender,
                                                             gpointer self)
{
	ft_timer_label_stop_crossfade_animation ((FtTimerLabel*) self);
}

static void
ft_timer_label_fade_in (FtTimerLabel* self)
{
	gdouble crossfade_progress = 0.0;
	AdwTimedAnimation* _tmp0_;
	AdwCallbackAnimationTarget* animation_target = NULL;
	AdwCallbackAnimationTarget* _tmp2_;
	AdwCallbackAnimationTarget* _tmp3_;
	AdwAnimationTarget* _tmp4_;
	AdwTimedAnimation* _tmp5_;
	AdwTimedAnimation* _tmp6_;
	AdwTimedAnimation* _tmp7_;
	AdwTimedAnimation* _tmp8_;
	GtkBox* _tmp9_;
	GtkBox* _tmp10_;
	GtkBox* _tmp11_;
	gboolean _tmp12_ = FALSE;
	g_return_if_fail (self != NULL);
	crossfade_progress = ft_timer_label_get_crossfade_progress (self);
	if (self->priv->faded_in) {
		return;
	}
	_tmp0_ = self->priv->crossfade_animation;
	if (_tmp0_ != NULL) {
		AdwTimedAnimation* _tmp1_;
		_tmp1_ = self->priv->crossfade_animation;
		adw_animation_pause ((AdwAnimation*) _tmp1_);
		_g_object_unref0 (self->priv->crossfade_animation);
		self->priv->crossfade_animation = NULL;
	}
	_tmp2_ = (AdwCallbackAnimationTarget*) adw_callback_animation_target_new (_gtk_widget_queue_draw_adw_animation_target_func, g_object_ref ((GtkWidget*) self), g_object_unref);
	animation_target = _tmp2_;
	_tmp3_ = animation_target;
	_tmp4_ = _g_object_ref0 ((AdwAnimationTarget*) _tmp3_);
	_tmp5_ = (AdwTimedAnimation*) adw_timed_animation_new ((GtkWidget*) self, crossfade_progress, 1.0, FT_TIMER_LABEL_TRANSITION_DURATION, _tmp4_);
	_g_object_unref0 (self->priv->crossfade_animation);
	self->priv->crossfade_animation = _tmp5_;
	_tmp6_ = self->priv->crossfade_animation;
	adw_timed_animation_set_easing (_tmp6_, ADW_EASE_OUT_QUAD);
	_tmp7_ = self->priv->crossfade_animation;
	g_signal_connect_object ((AdwAnimation*) _tmp7_, "done", (GCallback) _ft_timer_label_stop_crossfade_animation_adw_animation_done, self, 0);
	_tmp8_ = self->priv->crossfade_animation;
	adw_animation_play ((AdwAnimation*) _tmp8_);
	_tmp9_ = self->priv->placeholder_box;
	gtk_widget_set_child_visible ((GtkWidget*) _tmp9_, TRUE);
	_tmp10_ = self->priv->box;
	gtk_widget_set_child_visible ((GtkWidget*) _tmp10_, TRUE);
	_tmp11_ = self->priv->box;
	gtk_widget_set_opacity ((GtkWidget*) _tmp11_, 1.0);
	if (self->priv->has_hours != self->priv->_placeholder_has_hours) {
		AdwTimedAnimation* _tmp13_;
		_tmp13_ = self->priv->hours_animation;
		_tmp12_ = _tmp13_ == NULL;
	} else {
		_tmp12_ = FALSE;
	}
	if (_tmp12_) {
		ft_timer_label_start_hours_animation (self);
	}
	self->priv->faded_in = TRUE;
	_g_object_unref0 (animation_target);
}

static void
ft_timer_label_fade_out (FtTimerLabel* self)
{
	gdouble crossfade_progress = 0.0;
	AdwTimedAnimation* _tmp0_;
	AdwTimedAnimation* _tmp2_;
	AdwCallbackAnimationTarget* animation_target = NULL;
	AdwCallbackAnimationTarget* _tmp4_;
	AdwCallbackAnimationTarget* _tmp5_;
	AdwAnimationTarget* _tmp6_;
	AdwTimedAnimation* _tmp7_;
	AdwTimedAnimation* _tmp8_;
	AdwTimedAnimation* _tmp9_;
	AdwTimedAnimation* _tmp10_;
	GtkBox* _tmp11_;
	GtkBox* _tmp12_;
	gboolean _tmp13_ = FALSE;
	g_return_if_fail (self != NULL);
	crossfade_progress = ft_timer_label_get_crossfade_progress (self);
	if (!self->priv->faded_in) {
		return;
	}
	_tmp0_ = self->priv->crossfade_animation;
	if (_tmp0_ != NULL) {
		AdwTimedAnimation* _tmp1_;
		_tmp1_ = self->priv->crossfade_animation;
		adw_animation_pause ((AdwAnimation*) _tmp1_);
		_g_object_unref0 (self->priv->crossfade_animation);
		self->priv->crossfade_animation = NULL;
	}
	_tmp2_ = self->priv->blink_animation;
	if (_tmp2_ != NULL) {
		AdwTimedAnimation* _tmp3_;
		_tmp3_ = self->priv->blink_animation;
		adw_animation_pause ((AdwAnimation*) _tmp3_);
		_g_object_unref0 (self->priv->blink_animation);
		self->priv->blink_animation = NULL;
	}
	_tmp4_ = (AdwCallbackAnimationTarget*) adw_callback_animation_target_new (_gtk_widget_queue_draw_adw_animation_target_func, g_object_ref ((GtkWidget*) self), g_object_unref);
	animation_target = _tmp4_;
	_tmp5_ = animation_target;
	_tmp6_ = _g_object_ref0 ((AdwAnimationTarget*) _tmp5_);
	_tmp7_ = (AdwTimedAnimation*) adw_timed_animation_new ((GtkWidget*) self, crossfade_progress, 0.0, FT_TIMER_LABEL_TRANSITION_DURATION, _tmp6_);
	_g_object_unref0 (self->priv->crossfade_animation);
	self->priv->crossfade_animation = _tmp7_;
	_tmp8_ = self->priv->crossfade_animation;
	adw_timed_animation_set_easing (_tmp8_, ADW_EASE_IN_OUT_CUBIC);
	_tmp9_ = self->priv->crossfade_animation;
	g_signal_connect_object ((AdwAnimation*) _tmp9_, "done", (GCallback) _ft_timer_label_stop_crossfade_animation_adw_animation_done, self, 0);
	_tmp10_ = self->priv->crossfade_animation;
	adw_animation_play ((AdwAnimation*) _tmp10_);
	_tmp11_ = self->priv->placeholder_box;
	gtk_widget_set_child_visible ((GtkWidget*) _tmp11_, TRUE);
	_tmp12_ = self->priv->box;
	gtk_widget_set_child_visible ((GtkWidget*) _tmp12_, TRUE);
	if (self->priv->has_hours != self->priv->_placeholder_has_hours) {
		AdwTimedAnimation* _tmp14_;
		_tmp14_ = self->priv->hours_animation;
		_tmp13_ = _tmp14_ == NULL;
	} else {
		_tmp13_ = FALSE;
	}
	if (_tmp13_) {
		ft_timer_label_start_hours_animation (self);
	}
	self->priv->faded_in = FALSE;
	_g_object_unref0 (animation_target);
}

static void
ft_timer_label_update_css_classes (FtTimerLabel* self)
{
	g_return_if_fail (self != NULL);
	if (self->priv->_placeholder_has_hours) {
		GtkBox* _tmp0_;
		_tmp0_ = self->priv->placeholder_box;
		gtk_widget_add_css_class ((GtkWidget*) _tmp0_, "with-hours");
	} else {
		GtkBox* _tmp1_;
		_tmp1_ = self->priv->placeholder_box;
		gtk_widget_remove_css_class ((GtkWidget*) _tmp1_, "with-hours");
	}
	if (self->priv->has_hours) {
		GtkBox* _tmp2_;
		_tmp2_ = self->priv->box;
		gtk_widget_add_css_class ((GtkWidget*) _tmp2_, "with-hours");
	} else {
		GtkBox* _tmp3_;
		_tmp3_ = self->priv->box;
		gtk_widget_remove_css_class ((GtkWidget*) _tmp3_, "with-hours");
	}
}

static void
ft_timer_label_update_remaining_time (FtTimerLabel* self,
                                      gint64 timestamp)
{
	gint64 remaining = 0LL;
	FtTimer* _tmp0_;
	guint remaining_uint = 0U;
	gboolean has_hours = FALSE;
	FtMonospaceLabel* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	FtMonospaceLabel* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_timer;
	remaining = ft_timer_calculate_remaining (_tmp0_, timestamp);
	remaining_uint = ft_timestamp_to_seconds_uint (remaining);
	has_hours = remaining_uint >= ((guint) 3600);
	if (self->priv->has_hours != has_hours) {
		FtMonospaceLabel* _tmp1_;
		FtMonospaceLabel* _tmp2_;
		_tmp1_ = self->priv->hours_label;
		gtk_widget_set_visible ((GtkWidget*) _tmp1_, has_hours);
		_tmp2_ = self->priv->hours_separator_label;
		gtk_widget_set_visible ((GtkWidget*) _tmp2_, has_hours);
		self->priv->has_hours = has_hours;
		ft_timer_label_update_css_classes (self);
		if (self->priv->faded_in) {
			ft_timer_label_start_hours_animation (self);
		}
	}
	if (has_hours) {
		FtMonospaceLabel* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		_tmp3_ = self->priv->hours_label;
		_tmp4_ = g_strdup_printf ("%u", remaining_uint / 3600);
		_tmp5_ = _tmp4_;
		ft_monospace_label_set_text (_tmp3_, _tmp5_);
		_g_free0 (_tmp5_);
		remaining_uint = remaining_uint % 3600;
	}
	_tmp6_ = self->priv->minutes_label;
	_tmp7_ = g_strdup_printf ("%02u", remaining_uint / 60);
	_tmp8_ = _tmp7_;
	ft_monospace_label_set_text (_tmp6_, _tmp8_);
	_g_free0 (_tmp8_);
	_tmp9_ = self->priv->seconds_label;
	_tmp10_ = g_strdup_printf ("%02u", remaining_uint % 60);
	_tmp11_ = _tmp10_;
	ft_monospace_label_set_text (_tmp9_, _tmp11_);
	_g_free0 (_tmp11_);
}

static gboolean
ft_timer_label_should_blink (FtTimerLabel* self)
{
	FtTimer* _tmp0_;
	void* _tmp1_;
	void* _tmp2_;
	gboolean _tmp3_ = FALSE;
	gboolean _tmp4_ = FALSE;
	FtTimer* _tmp5_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_timer;
	_tmp1_ = ft_timer_get_user_data (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ == NULL) {
		result = FALSE;
		return result;
	}
	_tmp5_ = self->priv->_timer;
	if (ft_timer_is_paused (_tmp5_)) {
		_tmp4_ = TRUE;
	} else {
		FtTimer* _tmp6_;
		_tmp6_ = self->priv->_timer;
		_tmp4_ = ft_timer_is_finished (_tmp6_);
	}
	if (_tmp4_) {
		_tmp3_ = TRUE;
	} else {
		FtTimer* _tmp7_;
		_tmp7_ = self->priv->_timer;
		_tmp3_ = !ft_timer_is_started (_tmp7_);
	}
	result = _tmp3_;
	return result;
}

static void
_ft_timer_label_stop_blinking_animation_adw_animation_done (AdwAnimation* _sender,
                                                            gpointer self)
{
	ft_timer_label_stop_blinking_animation ((FtTimerLabel*) self);
}

static void
ft_timer_label_stop_blinking_animation (FtTimerLabel* self)
{
	AdwTimedAnimation* _tmp0_;
	AdwTimedAnimation* _tmp1_;
	gboolean _tmp2_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->blink_animation;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->priv->blink_animation;
	adw_animation_pause ((AdwAnimation*) _tmp1_);
	_g_object_unref0 (self->priv->blink_animation);
	self->priv->blink_animation = NULL;
	if (gtk_widget_get_mapped ((GtkWidget*) self)) {
		GtkBox* _tmp3_;
		gdouble _tmp4_;
		gdouble _tmp5_;
		_tmp3_ = self->priv->box;
		_tmp4_ = gtk_widget_get_opacity ((GtkWidget*) _tmp3_);
		_tmp5_ = _tmp4_;
		_tmp2_ = _tmp5_ != 1.0;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		AdwPropertyAnimationTarget* animation_target = NULL;
		GtkBox* _tmp6_;
		AdwPropertyAnimationTarget* _tmp7_;
		GtkBox* _tmp8_;
		GtkBox* _tmp9_;
		gdouble _tmp10_;
		gdouble _tmp11_;
		AdwPropertyAnimationTarget* _tmp12_;
		AdwAnimationTarget* _tmp13_;
		AdwTimedAnimation* _tmp14_;
		AdwTimedAnimation* _tmp15_;
		AdwTimedAnimation* _tmp16_;
		AdwTimedAnimation* _tmp17_;
		AdwTimedAnimation* _tmp18_;
		_tmp6_ = self->priv->box;
		_tmp7_ = (AdwPropertyAnimationTarget*) adw_property_animation_target_new ((GObject*) _tmp6_, "opacity");
		animation_target = _tmp7_;
		_tmp8_ = self->priv->box;
		_tmp9_ = self->priv->box;
		_tmp10_ = gtk_widget_get_opacity ((GtkWidget*) _tmp9_);
		_tmp11_ = _tmp10_;
		_tmp12_ = animation_target;
		_tmp13_ = _g_object_ref0 ((AdwAnimationTarget*) _tmp12_);
		_tmp14_ = (AdwTimedAnimation*) adw_timed_animation_new ((GtkWidget*) _tmp8_, _tmp11_, 1.0, FT_TIMER_LABEL_TRANSITION_DURATION, _tmp13_);
		_g_object_unref0 (self->priv->blink_animation);
		self->priv->blink_animation = _tmp14_;
		_tmp15_ = self->priv->blink_animation;
		adw_timed_animation_set_easing (_tmp15_, ADW_EASE_OUT_QUAD);
		_tmp16_ = self->priv->blink_animation;
		adw_animation_set_follow_enable_animations_setting ((AdwAnimation*) _tmp16_, FALSE);
		_tmp17_ = self->priv->blink_animation;
		g_signal_connect_object ((AdwAnimation*) _tmp17_, "done", (GCallback) _ft_timer_label_stop_blinking_animation_adw_animation_done, self, 0);
		_tmp18_ = self->priv->blink_animation;
		adw_animation_play ((AdwAnimation*) _tmp18_);
		_g_object_unref0 (animation_target);
	} else {
		GtkBox* _tmp19_;
		_tmp19_ = self->priv->box;
		gtk_widget_set_opacity ((GtkWidget*) _tmp19_, 1.0);
	}
}

static void
_ft_timer_label_start_blinking_animation_adw_animation_done (AdwAnimation* _sender,
                                                             gpointer self)
{
	ft_timer_label_start_blinking_animation ((FtTimerLabel*) self);
}

static void
ft_timer_label_start_blinking_animation (FtTimerLabel* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	AdwTimedAnimation* _tmp2_;
	AdwTimedAnimation* _tmp9_;
	AdwPropertyAnimationTarget* animation_target = NULL;
	GtkBox* _tmp11_;
	AdwPropertyAnimationTarget* _tmp12_;
	GtkBox* _tmp13_;
	GtkBox* _tmp14_;
	gdouble _tmp15_;
	gdouble _tmp16_;
	AdwPropertyAnimationTarget* _tmp17_;
	AdwAnimationTarget* _tmp18_;
	AdwTimedAnimation* _tmp19_;
	AdwTimedAnimation* _tmp20_;
	GtkBox* _tmp21_;
	gdouble _tmp22_;
	gdouble _tmp23_;
	AdwTimedAnimation* _tmp24_;
	AdwTimedAnimation* _tmp25_;
	gdouble _tmp26_;
	gdouble _tmp27_;
	AdwTimedAnimation* _tmp29_;
	gboolean _tmp30_;
	gboolean _tmp31_;
	AdwTimedAnimation* _tmp36_;
	g_return_if_fail (self != NULL);
	if (!gtk_widget_get_mapped ((GtkWidget*) self)) {
		return;
	}
	_tmp2_ = self->priv->blink_animation;
	if (_tmp2_ != NULL) {
		AdwTimedAnimation* _tmp3_;
		gboolean _tmp4_;
		gboolean _tmp5_;
		_tmp3_ = self->priv->blink_animation;
		_tmp4_ = adw_timed_animation_get_alternate (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp1_ = _tmp5_;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		AdwTimedAnimation* _tmp6_;
		AdwAnimationState _tmp7_;
		AdwAnimationState _tmp8_;
		_tmp6_ = self->priv->blink_animation;
		_tmp7_ = adw_animation_get_state ((AdwAnimation*) _tmp6_);
		_tmp8_ = _tmp7_;
		_tmp0_ = _tmp8_ == ADW_ANIMATION_PLAYING;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		return;
	}
	_tmp9_ = self->priv->blink_animation;
	if (_tmp9_ != NULL) {
		AdwTimedAnimation* _tmp10_;
		_tmp10_ = self->priv->blink_animation;
		adw_animation_pause ((AdwAnimation*) _tmp10_);
		_g_object_unref0 (self->priv->blink_animation);
		self->priv->blink_animation = NULL;
	}
	_tmp11_ = self->priv->box;
	_tmp12_ = (AdwPropertyAnimationTarget*) adw_property_animation_target_new ((GObject*) _tmp11_, "opacity");
	animation_target = _tmp12_;
	_tmp13_ = self->priv->box;
	_tmp14_ = self->priv->box;
	_tmp15_ = gtk_widget_get_opacity ((GtkWidget*) _tmp14_);
	_tmp16_ = _tmp15_;
	_tmp17_ = animation_target;
	_tmp18_ = _g_object_ref0 ((AdwAnimationTarget*) _tmp17_);
	_tmp19_ = (AdwTimedAnimation*) adw_timed_animation_new ((GtkWidget*) _tmp13_, _tmp16_, FT_TIMER_LABEL_BLINK_FADE_VALUE, FT_TIMER_LABEL_BLINK_DURATION, _tmp18_);
	_g_object_unref0 (self->priv->blink_animation);
	self->priv->blink_animation = _tmp19_;
	_tmp20_ = self->priv->blink_animation;
	_tmp21_ = self->priv->box;
	_tmp22_ = gtk_widget_get_opacity ((GtkWidget*) _tmp21_);
	_tmp23_ = _tmp22_;
	adw_timed_animation_set_alternate (_tmp20_, _tmp23_ == 1.0);
	_tmp24_ = self->priv->blink_animation;
	adw_animation_set_follow_enable_animations_setting ((AdwAnimation*) _tmp24_, FALSE);
	_tmp25_ = self->priv->blink_animation;
	_tmp26_ = adw_timed_animation_get_value_from (_tmp25_);
	_tmp27_ = _tmp26_;
	if (_tmp27_ <= FT_TIMER_LABEL_BLINK_FADE_VALUE) {
		AdwTimedAnimation* _tmp28_;
		_tmp28_ = self->priv->blink_animation;
		adw_timed_animation_set_value_to (_tmp28_, 1.0);
	}
	_tmp29_ = self->priv->blink_animation;
	_tmp30_ = adw_timed_animation_get_alternate (_tmp29_);
	_tmp31_ = _tmp30_;
	if (_tmp31_) {
		AdwTimedAnimation* _tmp32_;
		AdwTimedAnimation* _tmp33_;
		_tmp32_ = self->priv->blink_animation;
		adw_timed_animation_set_repeat_count (_tmp32_, G_MAXUINT);
		_tmp33_ = self->priv->blink_animation;
		adw_timed_animation_set_easing (_tmp33_, ADW_EASE_IN_OUT_CUBIC);
	} else {
		AdwTimedAnimation* _tmp34_;
		AdwTimedAnimation* _tmp35_;
		_tmp34_ = self->priv->blink_animation;
		adw_timed_animation_set_easing (_tmp34_, ADW_EASE_OUT_QUAD);
		_tmp35_ = self->priv->blink_animation;
		g_signal_connect_object ((AdwAnimation*) _tmp35_, "done", (GCallback) _ft_timer_label_start_blinking_animation_adw_animation_done, self, 0);
	}
	_tmp36_ = self->priv->blink_animation;
	adw_animation_play ((AdwAnimation*) _tmp36_);
	_g_object_unref0 (animation_target);
}

/**
         * Sync all of things with the timer state
         */
static void
ft_timer_label_update (FtTimerLabel* self,
                       gint64 timestamp)
{
	FtTimer* _tmp0_;
	void* _tmp1_;
	void* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_timer;
	_tmp1_ = ft_timer_get_user_data (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ != NULL) {
		ft_timer_label_update_remaining_time (self, timestamp);
		ft_timer_label_fade_in (self);
	} else {
		ft_timer_label_fade_out (self);
	}
	if (ft_timer_label_should_blink (self)) {
		ft_timer_label_start_blinking_animation (self);
	} else {
		ft_timer_label_stop_blinking_animation (self);
	}
	gtk_widget_queue_resize ((GtkWidget*) self);
}

static void
_ft_timer_label_on_timer_tick_ft_timer_tick (FtTimer* _sender,
                                             gint64 timestamp,
                                             gpointer self)
{
	ft_timer_label_on_timer_tick ((FtTimerLabel*) self, timestamp);
}

static void
_ft_timer_label_on_timer_state_changed_ft_timer_state_changed (FtTimer* _sender,
                                                               const FtTimerState* current_state,
                                                               const FtTimerState* previous_state,
                                                               gpointer self)
{
	ft_timer_label_on_timer_state_changed ((FtTimerLabel*) self, current_state, previous_state);
}

static void
ft_timer_label_connect_signals (FtTimerLabel* self)
{
	g_return_if_fail (self != NULL);
	if (self->priv->timer_tick_id == ((gulong) 0)) {
		FtTimer* _tmp0_;
		gulong _tmp1_;
		_tmp0_ = self->priv->_timer;
		_tmp1_ = g_signal_connect_object (_tmp0_, "tick", (GCallback) _ft_timer_label_on_timer_tick_ft_timer_tick, self, 0);
		self->priv->timer_tick_id = _tmp1_;
	}
	if (self->priv->timer_state_changed_id == ((gulong) 0)) {
		FtTimer* _tmp2_;
		gulong _tmp3_;
		_tmp2_ = self->priv->_timer;
		_tmp3_ = g_signal_connect_object (_tmp2_, "state-changed", (GCallback) _ft_timer_label_on_timer_state_changed_ft_timer_state_changed, self, G_CONNECT_AFTER);
		self->priv->timer_state_changed_id = _tmp3_;
	}
}

static void
ft_timer_label_disconnect_signals (FtTimerLabel* self)
{
	g_return_if_fail (self != NULL);
	if (self->priv->timer_tick_id != ((gulong) 0)) {
		FtTimer* _tmp0_;
		_tmp0_ = self->priv->_timer;
		g_signal_handler_disconnect ((GObject*) _tmp0_, self->priv->timer_tick_id);
		self->priv->timer_tick_id = (gulong) 0;
	}
	if (self->priv->timer_state_changed_id != ((gulong) 0)) {
		FtTimer* _tmp1_;
		_tmp1_ = self->priv->_timer;
		g_signal_handler_disconnect ((GObject*) _tmp1_, self->priv->timer_state_changed_id);
		self->priv->timer_state_changed_id = (gulong) 0;
	}
}

static void
ft_timer_label_on_timer_tick (FtTimerLabel* self,
                              gint64 timestamp)
{
	g_return_if_fail (self != NULL);
	ft_timer_label_update_remaining_time (self, timestamp);
}

static void
ft_timer_label_on_timer_state_changed (FtTimerLabel* self,
                                       const FtTimerState* current_state,
                                       const FtTimerState* previous_state)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (current_state != NULL);
	g_return_if_fail (previous_state != NULL);
	if (gtk_widget_get_mapped ((GtkWidget*) self)) {
		FtTimer* _tmp0_;
		_tmp0_ = self->priv->_timer;
		ft_timer_label_update (self, ft_timer_get_last_state_changed_time (_tmp0_));
	}
}

/**
         * To estimate font scale we need to measure layout at reference scale.
         */
static void
ft_timer_label_ensure_reference_size (FtTimerLabel* self)
{
	g_return_if_fail (self != NULL);
	if (self->priv->reference_width_lower == 0.0) {
		PangoLayout* layout = NULL;
		PangoLayout* _tmp0_;
		gint layout_width = 0;
		gint layout_height = 0;
		PangoLayout* _tmp1_;
		gint _tmp2_ = 0;
		gint _tmp3_ = 0;
		PangoLayout* _tmp4_;
		PangoLayout* _tmp5_;
		PangoLayout* _tmp6_;
		gint _tmp7_ = 0;
		gint _tmp8_ = 0;
		_tmp0_ = gtk_widget_create_pango_layout ((GtkWidget*) self, "00:00");
		layout = _tmp0_;
		layout_width = 0;
		layout_height = 0;
		_tmp1_ = layout;
		pango_layout_get_size (_tmp1_, &_tmp2_, &_tmp3_);
		layout_width = _tmp2_;
		layout_height = _tmp3_;
		self->priv->reference_width_lower = ((gdouble) layout_width) / ((gdouble) PANGO_SCALE);
		self->priv->reference_height = ((gdouble) layout_height) / ((gdouble) PANGO_SCALE);
		_tmp4_ = layout;
		self->priv->reference_baseline = ((gdouble) pango_layout_get_baseline (_tmp4_)) / ((gdouble) PANGO_SCALE);
		_tmp5_ = layout;
		pango_layout_set_text (_tmp5_, "0:00:00", 7);
		_tmp6_ = layout;
		pango_layout_get_size (_tmp6_, &_tmp7_, &_tmp8_);
		layout_width = _tmp7_;
		layout_height = _tmp8_;
		self->priv->reference_width_upper = ((gdouble) layout_width) / ((gdouble) PANGO_SCALE);
		_g_object_unref0 (layout);
	}
}

static void
ft_timer_label_invalidate_reference_size (FtTimerLabel* self)
{
	g_return_if_fail (self != NULL);
	self->priv->reference_width_lower = 0.0;
	self->priv->reference_width_upper = 0.0;
	self->priv->reference_height = 0.0;
	self->priv->reference_baseline = 0.0;
}

static gboolean
ft_timer_label_get_has_hours (FtTimerLabel* self)
{
	gboolean _tmp0_ = FALSE;
	FtTimer* _tmp1_;
	FtTimer* _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = ft_timer_label_get_timer (self);
	_tmp2_ = _tmp1_;
	if (ft_timer_is_started (_tmp2_)) {
		_tmp0_ = self->priv->has_hours;
	} else {
		_tmp0_ = self->priv->_placeholder_has_hours;
	}
	result = _tmp0_;
	return result;
}

static gdouble
ft_timer_label_get_reference_width (FtTimerLabel* self)
{
	AdwTimedAnimation* _tmp0_;
	gdouble _tmp4_ = 0.0;
	gdouble result;
	g_return_val_if_fail (self != NULL, -1.0);
	_tmp0_ = self->priv->hours_animation;
	if (_tmp0_ != NULL) {
		AdwTimedAnimation* _tmp1_;
		gdouble _tmp2_;
		gdouble _tmp3_;
		_tmp1_ = self->priv->hours_animation;
		_tmp2_ = adw_animation_get_value ((AdwAnimation*) _tmp1_);
		_tmp3_ = _tmp2_;
		result = adw_lerp (self->priv->reference_width_lower, self->priv->reference_width_upper, _tmp3_);
		return result;
	}
	if (self->priv->faded_in) {
		gdouble _tmp5_ = 0.0;
		if (self->priv->has_hours) {
			_tmp5_ = self->priv->reference_width_upper;
		} else {
			_tmp5_ = self->priv->reference_width_lower;
		}
		_tmp4_ = (gdouble) _tmp5_;
	} else {
		gdouble _tmp6_ = 0.0;
		if (self->priv->_placeholder_has_hours) {
			_tmp6_ = self->priv->reference_width_upper;
		} else {
			_tmp6_ = self->priv->reference_width_lower;
		}
		_tmp4_ = (gdouble) _tmp6_;
	}
	result = _tmp4_;
	return result;
}

static GtkSizeRequestMode
ft_timer_label_real_get_request_mode (GtkWidget* base)
{
	FtTimerLabel * self;
	GtkSizeRequestMode result;
	self = (FtTimerLabel*) base;
	result = GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH;
	return result;
}

/**
         * Estimate size.
         *
         * Interpolate between two children and with-hours / without-hours.
         */
static void
ft_timer_label_real_measure (GtkWidget* base,
                             GtkOrientation orientation,
                             gint for_size,
                             gint* minimum,
                             gint* natural,
                             gint* minimum_baseline,
                             gint* natural_baseline)
{
	FtTimerLabel * self;
	gint _vala_minimum = 0;
	gint _vala_natural = 0;
	gint _vala_minimum_baseline = 0;
	gint _vala_natural_baseline = 0;
	gdouble reference_width = 0.0;
	gdouble reference_height = 0.0;
	gdouble reference_baseline = 0.0;
	gdouble scale = 0.0;
	gboolean _tmp0_ = FALSE;
	self = (FtTimerLabel*) base;
	ft_timer_label_ensure_reference_size (self);
	reference_width = ft_timer_label_get_reference_width (self);
	reference_height = self->priv->reference_height;
	reference_baseline = self->priv->reference_baseline;
	scale = 1.0;
	if (for_size != -1) {
		GtkAlign _tmp1_;
		GtkAlign _tmp2_;
		_tmp1_ = gtk_widget_get_halign ((GtkWidget*) self);
		_tmp2_ = _tmp1_;
		_tmp0_ = _tmp2_ == GTK_ALIGN_FILL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gdouble _tmp3_ = 0.0;
		if (orientation == GTK_ORIENTATION_HORIZONTAL) {
			_tmp3_ = ((gdouble) for_size) / reference_height;
		} else {
			_tmp3_ = ((gdouble) for_size) / reference_width;
		}
		scale = _tmp3_;
	}
	if (orientation == GTK_ORIENTATION_HORIZONTAL) {
		_vala_natural = (gint) round (scale * reference_width);
		_vala_natural_baseline = -1;
	} else {
		_vala_natural = (gint) round (scale * reference_height);
		_vala_natural_baseline = (gint) round (scale * reference_baseline);
	}
	_vala_minimum = _vala_natural;
	_vala_minimum_baseline = _vala_natural_baseline;
	if (minimum) {
		*minimum = _vala_minimum;
	}
	if (natural) {
		*natural = _vala_natural;
	}
	if (minimum_baseline) {
		*minimum_baseline = _vala_minimum_baseline;
	}
	if (natural_baseline) {
		*natural_baseline = _vala_natural_baseline;
	}
}

static void
ft_timer_label_real_size_allocate (GtkWidget* base,
                                   gint width,
                                   gint height,
                                   gint baseline)
{
	FtTimerLabel * self;
	GtkAllocation placeholder_allocation = {0};
	GtkAllocation allocation = {0};
	gdouble _tmp0_ = 0.0;
	GtkAlign _tmp1_;
	GtkAlign _tmp2_;
	gdouble scale = 0.0;
	GtkBox* _tmp3_;
	gint _tmp4_ = 0;
	GtkBox* _tmp5_;
	gint _tmp6_ = 0;
	GtkBox* _tmp7_;
	gint _tmp8_ = 0;
	GtkBox* _tmp9_;
	gint _tmp10_ = 0;
	GtkAlign _tmp11_;
	GtkAlign _tmp12_;
	GtkAllocation _tmp17_;
	GtkAllocation _tmp18_;
	GtkBox* _tmp19_;
	GtkAllocation _tmp20_;
	GtkBox* _tmp21_;
	GtkAllocation _tmp22_;
	self = (FtTimerLabel*) base;
	memset (&placeholder_allocation, 0, sizeof (GtkAllocation));
	memset (&allocation, 0, sizeof (GtkAllocation));
	ft_timer_label_ensure_reference_size (self);
	_tmp1_ = gtk_widget_get_halign ((GtkWidget*) self);
	_tmp2_ = _tmp1_;
	if (_tmp2_ == GTK_ALIGN_FILL) {
		_tmp0_ = ((gdouble) width) / ft_timer_label_get_reference_width (self);
	} else {
		_tmp0_ = 1.0;
	}
	scale = _tmp0_;
	if (self->priv->scale != scale) {
		self->priv->scale = scale;
		ft_timer_label_update_children_scale (self);
	}
	_tmp3_ = self->priv->placeholder_box;
	gtk_widget_measure ((GtkWidget*) _tmp3_, GTK_ORIENTATION_VERTICAL, -1, NULL, &_tmp4_, NULL, NULL);
	placeholder_allocation.height = _tmp4_;
	_tmp5_ = self->priv->placeholder_box;
	gtk_widget_measure ((GtkWidget*) _tmp5_, GTK_ORIENTATION_HORIZONTAL, -1, NULL, &_tmp6_, NULL, NULL);
	placeholder_allocation.width = _tmp6_;
	_tmp7_ = self->priv->box;
	gtk_widget_measure ((GtkWidget*) _tmp7_, GTK_ORIENTATION_VERTICAL, -1, NULL, &_tmp8_, NULL, NULL);
	allocation.height = _tmp8_;
	_tmp9_ = self->priv->box;
	gtk_widget_measure ((GtkWidget*) _tmp9_, GTK_ORIENTATION_HORIZONTAL, -1, NULL, &_tmp10_, NULL, NULL);
	allocation.width = _tmp10_;
	_tmp11_ = gtk_widget_get_halign ((GtkWidget*) self);
	_tmp12_ = _tmp11_;
	switch (_tmp12_) {
		case GTK_ALIGN_START:
		{
			placeholder_allocation.x = 0;
			allocation.x = 0;
			break;
		}
		case GTK_ALIGN_END:
		{
			GtkAllocation _tmp13_;
			GtkAllocation _tmp14_;
			_tmp13_ = placeholder_allocation;
			placeholder_allocation.x = width - _tmp13_.width;
			_tmp14_ = allocation;
			allocation.x = width - _tmp14_.width;
			break;
		}
		case GTK_ALIGN_CENTER:
		case GTK_ALIGN_FILL:
		{
			GtkAllocation _tmp15_;
			GtkAllocation _tmp16_;
			_tmp15_ = placeholder_allocation;
			placeholder_allocation.x = (width - _tmp15_.width) / 2;
			_tmp16_ = allocation;
			allocation.x = (width - _tmp16_.width) / 2;
			break;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
	_tmp17_ = placeholder_allocation;
	placeholder_allocation.y = (height - _tmp17_.height) / 2;
	_tmp18_ = allocation;
	allocation.y = (height - _tmp18_.height) / 2;
	_tmp19_ = self->priv->placeholder_box;
	_tmp20_ = placeholder_allocation;
	gtk_widget_size_allocate ((GtkWidget*) _tmp19_, &_tmp20_, baseline);
	_tmp21_ = self->priv->box;
	_tmp22_ = allocation;
	gtk_widget_size_allocate ((GtkWidget*) _tmp21_, &_tmp22_, baseline);
}

static void
ft_timer_label_real_snapshot (GtkWidget* base,
                              GtkSnapshot* snapshot)
{
	FtTimerLabel * self;
	AdwTimedAnimation* _tmp0_;
	self = (FtTimerLabel*) base;
	g_return_if_fail (snapshot != NULL);
	_tmp0_ = self->priv->crossfade_animation;
	if (_tmp0_ != NULL) {
		AdwTimedAnimation* _tmp1_;
		gdouble _tmp2_;
		gdouble _tmp3_;
		GtkBox* _tmp4_;
		GtkBox* _tmp5_;
		_tmp1_ = self->priv->crossfade_animation;
		_tmp2_ = adw_animation_get_value ((AdwAnimation*) _tmp1_);
		_tmp3_ = _tmp2_;
		gtk_snapshot_push_cross_fade (snapshot, _tmp3_);
		_tmp4_ = self->priv->placeholder_box;
		gtk_widget_snapshot_child ((GtkWidget*) self, (GtkWidget*) _tmp4_, snapshot);
		gtk_snapshot_pop (snapshot);
		_tmp5_ = self->priv->box;
		gtk_widget_snapshot_child ((GtkWidget*) self, (GtkWidget*) _tmp5_, snapshot);
		gtk_snapshot_pop (snapshot);
	} else {
		if (!self->priv->faded_in) {
			GtkBox* _tmp6_;
			_tmp6_ = self->priv->placeholder_box;
			gtk_widget_snapshot_child ((GtkWidget*) self, (GtkWidget*) _tmp6_, snapshot);
		} else {
			GtkBox* _tmp7_;
			_tmp7_ = self->priv->box;
			gtk_widget_snapshot_child ((GtkWidget*) self, (GtkWidget*) _tmp7_, snapshot);
		}
	}
}

static void
ft_timer_label_real_map (GtkWidget* base)
{
	FtTimerLabel * self;
	FtTimer* _tmp0_;
	self = (FtTimerLabel*) base;
	_tmp0_ = self->priv->_timer;
	ft_timer_label_update (self, ft_timer_get_last_tick_time (_tmp0_));
	ft_timer_label_connect_signals (self);
	GTK_WIDGET_CLASS (ft_timer_label_parent_class)->map (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	if (ft_timer_label_should_blink (self)) {
		ft_timer_label_start_blinking_animation (self);
	}
}

static void
ft_timer_label_real_unmap (GtkWidget* base)
{
	FtTimerLabel * self;
	self = (FtTimerLabel*) base;
	ft_timer_label_disconnect_signals (self);
	ft_timer_label_stop_blinking_animation (self);
	ft_timer_label_stop_crossfade_animation (self);
	ft_timer_label_stop_hours_animation (self);
	GTK_WIDGET_CLASS (ft_timer_label_parent_class)->unmap (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
}

static void
ft_timer_label_real_unroot (GtkWidget* base)
{
	FtTimerLabel * self;
	self = (FtTimerLabel*) base;
	GTK_WIDGET_CLASS (ft_timer_label_parent_class)->unroot (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	ft_timer_label_invalidate_reference_size (self);
}

static void
ft_timer_label_real_dispose (GObject* base)
{
	FtTimerLabel * self;
	GtkBox* _tmp0_;
	GtkBox* _tmp2_;
	self = (FtTimerLabel*) base;
	_tmp0_ = self->priv->placeholder_box;
	if (_tmp0_ != NULL) {
		GtkBox* _tmp1_;
		_tmp1_ = self->priv->placeholder_box;
		gtk_widget_unparent ((GtkWidget*) _tmp1_);
	}
	_tmp2_ = self->priv->box;
	if (_tmp2_ != NULL) {
		GtkBox* _tmp3_;
		_tmp3_ = self->priv->box;
		gtk_widget_unparent ((GtkWidget*) _tmp3_);
	}
	_g_object_unref0 (self->priv->_timer);
	self->priv->_timer = NULL;
	G_OBJECT_CLASS (ft_timer_label_parent_class)->dispose ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
}

FtTimerLabel*
ft_timer_label_construct (GType object_type)
{
	FtTimerLabel * self = NULL;
	self = (FtTimerLabel*) g_object_new (object_type, NULL);
	return self;
}

FtTimerLabel*
ft_timer_label_new (void)
{
	return ft_timer_label_construct (FT_TYPE_TIMER_LABEL);
}

FtTimer*
ft_timer_label_get_timer (FtTimerLabel* self)
{
	FtTimer* result;
	FtTimer* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_timer;
	result = _tmp0_;
	return result;
}

void
ft_timer_label_set_timer (FtTimerLabel* self,
                          FtTimer* value)
{
	FtTimer* _tmp0_;
	FtTimer* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_timer;
	if (value == _tmp0_) {
		return;
	}
	ft_timer_label_disconnect_signals (self);
	_tmp1_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_timer);
	self->priv->_timer = _tmp1_;
	if (gtk_widget_get_mapped ((GtkWidget*) self)) {
		ft_timer_label_connect_signals (self);
	}
	g_object_notify_by_pspec ((GObject *) self, ft_timer_label_properties[FT_TIMER_LABEL_TIMER_PROPERTY]);
}

gboolean
ft_timer_label_get_placeholder_has_hours (FtTimerLabel* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_placeholder_has_hours;
	return result;
}

void
ft_timer_label_set_placeholder_has_hours (FtTimerLabel* self,
                                          gboolean value)
{
	FtMonospaceLabel* _tmp0_;
	FtMonospaceLabel* _tmp1_;
	g_return_if_fail (self != NULL);
	if (value == self->priv->_placeholder_has_hours) {
		return;
	}
	self->priv->_placeholder_has_hours = value;
	_tmp0_ = self->priv->placeholder_hours_label;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, value);
	_tmp1_ = self->priv->placeholder_hours_separator_label;
	gtk_widget_set_visible ((GtkWidget*) _tmp1_, value);
	ft_timer_label_update_css_classes (self);
	gtk_widget_queue_resize ((GtkWidget*) self);
	g_object_notify_by_pspec ((GObject *) self, ft_timer_label_properties[FT_TIMER_LABEL_PLACEHOLDER_HAS_HOURS_PROPERTY]);
}

static GObject *
ft_timer_label_constructor (GType type,
                            guint n_construct_properties,
                            GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	FtTimerLabel * self;
	FtTimer* _tmp0_;
	FtTimer* _tmp1_;
	parent_class = G_OBJECT_CLASS (ft_timer_label_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_TIMER_LABEL, FtTimerLabel);
	_tmp0_ = ft_timer_get_default ();
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->_timer);
	self->priv->_timer = _tmp1_;
	ft_timer_label_set_default_direction_ltr (self);
	return obj;
}

static void
ft_timer_label_class_init (FtTimerLabelClass * klass,
                           gpointer klass_data)
{
	ft_timer_label_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FtTimerLabel_private_offset);
	((GtkWidgetClass *) klass)->get_request_mode = (GtkSizeRequestMode (*) (GtkWidget*)) ft_timer_label_real_get_request_mode;
	((GtkWidgetClass *) klass)->measure = (void (*) (GtkWidget*, GtkOrientation, gint, gint*, gint*, gint*, gint*)) ft_timer_label_real_measure;
	((GtkWidgetClass *) klass)->size_allocate = (void (*) (GtkWidget*, gint, gint, gint)) ft_timer_label_real_size_allocate;
	((GtkWidgetClass *) klass)->snapshot = (void (*) (GtkWidget*, GtkSnapshot*)) ft_timer_label_real_snapshot;
	((GtkWidgetClass *) klass)->map = (void (*) (GtkWidget*)) ft_timer_label_real_map;
	((GtkWidgetClass *) klass)->unmap = (void (*) (GtkWidget*)) ft_timer_label_real_unmap;
	((GtkWidgetClass *) klass)->unroot = (void (*) (GtkWidget*)) ft_timer_label_real_unroot;
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) ft_timer_label_real_dispose;
	G_OBJECT_CLASS (klass)->get_property = _vala_ft_timer_label_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_ft_timer_label_set_property;
	G_OBJECT_CLASS (klass)->constructor = ft_timer_label_constructor;
	G_OBJECT_CLASS (klass)->finalize = ft_timer_label_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_TIMER_LABEL_TIMER_PROPERTY, ft_timer_label_properties[FT_TIMER_LABEL_TIMER_PROPERTY] = g_param_spec_object ("timer", "timer", "timer", FT_TYPE_TIMER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_TIMER_LABEL_PLACEHOLDER_HAS_HOURS_PROPERTY, ft_timer_label_properties[FT_TIMER_LABEL_PLACEHOLDER_HAS_HOURS_PROPERTY] = g_param_spec_boolean ("placeholder-has-hours", "placeholder-has-hours", "placeholder-has-hours", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/io/github/focustimerhq/FocusTimer/ui/main/timer/widgets/timer-label.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "placeholder_box", FALSE, FtTimerLabel_private_offset + G_STRUCT_OFFSET (FtTimerLabelPrivate, placeholder_box));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "placeholder_hours_label", FALSE, FtTimerLabel_private_offset + G_STRUCT_OFFSET (FtTimerLabelPrivate, placeholder_hours_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "placeholder_hours_separator_label", FALSE, FtTimerLabel_private_offset + G_STRUCT_OFFSET (FtTimerLabelPrivate, placeholder_hours_separator_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "placeholder_minutes_label", FALSE, FtTimerLabel_private_offset + G_STRUCT_OFFSET (FtTimerLabelPrivate, placeholder_minutes_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "placeholder_minutes_separator_label", FALSE, FtTimerLabel_private_offset + G_STRUCT_OFFSET (FtTimerLabelPrivate, placeholder_minutes_separator_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "placeholder_seconds_label", FALSE, FtTimerLabel_private_offset + G_STRUCT_OFFSET (FtTimerLabelPrivate, placeholder_seconds_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "box", FALSE, FtTimerLabel_private_offset + G_STRUCT_OFFSET (FtTimerLabelPrivate, box));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "hours_label", FALSE, FtTimerLabel_private_offset + G_STRUCT_OFFSET (FtTimerLabelPrivate, hours_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "hours_separator_label", FALSE, FtTimerLabel_private_offset + G_STRUCT_OFFSET (FtTimerLabelPrivate, hours_separator_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "minutes_label", FALSE, FtTimerLabel_private_offset + G_STRUCT_OFFSET (FtTimerLabelPrivate, minutes_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "minutes_separator_label", FALSE, FtTimerLabel_private_offset + G_STRUCT_OFFSET (FtTimerLabelPrivate, minutes_separator_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "seconds_label", FALSE, FtTimerLabel_private_offset + G_STRUCT_OFFSET (FtTimerLabelPrivate, seconds_label));
	gtk_widget_class_set_css_name (GTK_WIDGET_CLASS (klass), "timerlabel");
}

static void
ft_timer_label_gtk_buildable_interface_init (GtkBuildableIface * iface,
                                             gpointer iface_data)
{
	ft_timer_label_gtk_buildable_parent_iface = g_type_interface_peek_parent (iface);
}

static void
ft_timer_label_instance_init (FtTimerLabel * self,
                              gpointer klass)
{
	self->priv = ft_timer_label_get_instance_private (self);
	self->priv->timer_state_changed_id = (gulong) 0;
	self->priv->timer_tick_id = (gulong) 0;
	self->priv->reference_width_lower = 0.0;
	self->priv->reference_width_upper = 0.0;
	self->priv->reference_height = 0.0;
	self->priv->reference_baseline = 0.0;
	self->priv->faded_in = FALSE;
	self->priv->_placeholder_has_hours = FALSE;
	self->priv->has_hours = FALSE;
	self->priv->scale = 1.0;
	g_type_ensure (FT_TYPE_MONOSPACE_LABEL);
	g_type_ensure (FT_TYPE_MONOSPACE_LABEL);
	g_type_ensure (FT_TYPE_MONOSPACE_LABEL);
	g_type_ensure (FT_TYPE_MONOSPACE_LABEL);
	g_type_ensure (FT_TYPE_MONOSPACE_LABEL);
	g_type_ensure (FT_TYPE_MONOSPACE_LABEL);
	g_type_ensure (FT_TYPE_MONOSPACE_LABEL);
	g_type_ensure (FT_TYPE_MONOSPACE_LABEL);
	g_type_ensure (FT_TYPE_MONOSPACE_LABEL);
	g_type_ensure (FT_TYPE_MONOSPACE_LABEL);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
ft_timer_label_finalize (GObject * obj)
{
	FtTimerLabel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_TIMER_LABEL, FtTimerLabel);
	_g_object_unref0 (self->priv->_timer);
	_g_object_unref0 (self->priv->crossfade_animation);
	_g_object_unref0 (self->priv->blink_animation);
	_g_object_unref0 (self->priv->hours_animation);
	G_OBJECT_CLASS (ft_timer_label_parent_class)->finalize (obj);
}

static GType
ft_timer_label_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FtTimerLabelClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_timer_label_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtTimerLabel), 0, (GInstanceInitFunc) ft_timer_label_instance_init, NULL };
	static const GInterfaceInfo gtk_buildable_info = { (GInterfaceInitFunc) ft_timer_label_gtk_buildable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType ft_timer_label_type_id;
	ft_timer_label_type_id = g_type_register_static (gtk_widget_get_type (), "FtTimerLabel", &g_define_type_info, 0);
	g_type_add_interface_static (ft_timer_label_type_id, gtk_buildable_get_type (), &gtk_buildable_info);
	FtTimerLabel_private_offset = g_type_add_instance_private (ft_timer_label_type_id, sizeof (FtTimerLabelPrivate));
	return ft_timer_label_type_id;
}

GType
ft_timer_label_get_type (void)
{
	static volatile gsize ft_timer_label_type_id__once = 0;
	if (g_once_init_enter (&ft_timer_label_type_id__once)) {
		GType ft_timer_label_type_id;
		ft_timer_label_type_id = ft_timer_label_get_type_once ();
		g_once_init_leave (&ft_timer_label_type_id__once, ft_timer_label_type_id);
	}
	return ft_timer_label_type_id__once;
}

static void
_vala_ft_timer_label_get_property (GObject * object,
                                   guint property_id,
                                   GValue * value,
                                   GParamSpec * pspec)
{
	FtTimerLabel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FT_TYPE_TIMER_LABEL, FtTimerLabel);
	switch (property_id) {
		case FT_TIMER_LABEL_TIMER_PROPERTY:
		g_value_set_object (value, ft_timer_label_get_timer (self));
		break;
		case FT_TIMER_LABEL_PLACEHOLDER_HAS_HOURS_PROPERTY:
		g_value_set_boolean (value, ft_timer_label_get_placeholder_has_hours (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_ft_timer_label_set_property (GObject * object,
                                   guint property_id,
                                   const GValue * value,
                                   GParamSpec * pspec)
{
	FtTimerLabel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FT_TYPE_TIMER_LABEL, FtTimerLabel);
	switch (property_id) {
		case FT_TIMER_LABEL_TIMER_PROPERTY:
		ft_timer_label_set_timer (self, g_value_get_object (value));
		break;
		case FT_TIMER_LABEL_PLACEHOLDER_HAS_HOURS_PROPERTY:
		ft_timer_label_set_placeholder_has_hours (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

