/* session-progress-bar.c generated by valac 0.56.19, the Vala compiler
 * generated from session-progress-bar.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 <gtk/gtk.h>
#include "ft_core.h"
#include <glib.h>
#include <float.h>
#include <math.h>
#include <adwaita.h>
#include <glib-object.h>
#include <gdk/gdk.h>
#include <string.h>
#include <cairo-gobject.h>
#include <graphene-gobject.h>
#include <gsk/gsk.h>
#include <glib/gi18n-lib.h>
#include <stdlib.h>
#include "ft_ui.h"

#define FT_SESSION_PROGRESS_BAR_DEFAULT_LINE_WIDTH 6.0f
#define FT_SESSION_PROGRESS_BAR_SEGMENT_SPACING 0.17f
#define FT_SESSION_PROGRESS_BAR_MIN_WIDTH 100
#define FT_SESSION_PROGRESS_BAR_TIMEOUT_RESOLUTION 3U
#define FT_SESSION_PROGRESS_BAR_MIN_TIMEOUT_INTERVAL ((guint) 25)
#define FT_SESSION_PROGRESS_BAR_FADE_IN_DURATION ((guint) 500)
#define FT_SESSION_PROGRESS_BAR_FADE_OUT_DURATION ((guint) 500)
#define FT_SESSION_PROGRESS_BAR_VALUE_ANIMATION_DURATION ((guint) 500)
#define FT_SESSION_PROGRESS_BAR_SCALE_ANIMATION_DURATION ((guint) 700)
#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

typedef struct _FtSessionProgressBar FtSessionProgressBar;
typedef struct _FtSessionProgressBarClass FtSessionProgressBarClass;
typedef struct _FtSessionProgressBarPrivate FtSessionProgressBarPrivate;
typedef struct _FtSessionProgressBarSegment FtSessionProgressBarSegment;
typedef struct _FtSessionProgressBarSegmentClass FtSessionProgressBarSegmentClass;
enum  {
	FT_SESSION_PROGRESS_BAR_0_PROPERTY,
	FT_SESSION_PROGRESS_BAR_TIMER_PROPERTY,
	FT_SESSION_PROGRESS_BAR_SESSION_MANAGER_PROPERTY,
	FT_SESSION_PROGRESS_BAR_SESSION_PROPERTY,
	FT_SESSION_PROGRESS_BAR_LINE_WIDTH_PROPERTY,
	FT_SESSION_PROGRESS_BAR_REVEAL_PROPERTY,
	FT_SESSION_PROGRESS_BAR_NUM_PROPERTIES
};
static GParamSpec* ft_session_progress_bar_properties[FT_SESSION_PROGRESS_BAR_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block13Data Block13Data;
typedef struct _Block14Data Block14Data;
typedef struct _FtSessionProgressBarSegmentPrivate FtSessionProgressBarSegmentPrivate;
typedef struct _Block15Data Block15Data;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _FtGizmo FtGizmo;
typedef struct _FtGizmoClass FtGizmoClass;
enum  {
	FT_SESSION_PROGRESS_BAR_SEGMENT_0_PROPERTY,
	FT_SESSION_PROGRESS_BAR_SEGMENT_TIMER_PROPERTY,
	FT_SESSION_PROGRESS_BAR_SEGMENT_CYCLE_PROPERTY,
	FT_SESSION_PROGRESS_BAR_SEGMENT_SPAN_START_PROPERTY,
	FT_SESSION_PROGRESS_BAR_SEGMENT_SPAN_END_PROPERTY,
	FT_SESSION_PROGRESS_BAR_SEGMENT_WEIGHT_PROPERTY,
	FT_SESSION_PROGRESS_BAR_SEGMENT_LINE_WIDTH_PROPERTY,
	FT_SESSION_PROGRESS_BAR_SEGMENT_DISPLAY_VALUE_PROPERTY,
	FT_SESSION_PROGRESS_BAR_SEGMENT_NUM_PROPERTIES
};
static GParamSpec* ft_session_progress_bar_segment_properties[FT_SESSION_PROGRESS_BAR_SEGMENT_NUM_PROPERTIES];
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _FtSessionProgressBar {
	GtkWidget parent_instance;
	FtSessionProgressBarPrivate * priv;
};

struct _FtSessionProgressBarClass {
	GtkWidgetClass parent_class;
};

struct _FtSessionProgressBarPrivate {
	FtTimer* _timer;
	FtSessionManager* _session_manager;
	FtSession* _session;
	gfloat _line_width;
	gboolean _reveal;
	gboolean revealing;
	FtSessionProgressBarSegment* current_segment;
	gfloat scale;
	AdwTimedAnimation* scale_animation;
	AdwTimedAnimation* opacity_animation;
	AdwTimedAnimation* value_animation;
	gint64 long_break_time;
	guint tick_callback_id;
};

struct _Block13Data {
	int _ref_count_;
	FtSessionProgressBar* self;
	gint64 long_break_time;
};

struct _Block14Data {
	int _ref_count_;
	FtSessionProgressBar* self;
	FtSessionProgressBarSegment* segment;
	gboolean is_forward;
};

struct _FtSessionProgressBarSegment {
	GtkWidget parent_instance;
	FtSessionProgressBarSegmentPrivate * priv;
	gfloat display_value_from;
	gfloat display_value_to;
};

struct _FtSessionProgressBarSegmentClass {
	GtkWidgetClass parent_class;
};

struct _Block15Data {
	int _ref_count_;
	FtSessionProgressBar* self;
	FtSessionProgressBarSegment* segment;
};

struct _FtSessionProgressBarSegmentPrivate {
	FtCycle* _cycle;
	FtTimer* _timer;
	gfloat _line_width;
	gfloat _span_start;
	gfloat _span_end;
	gfloat _weight;
	gfloat _display_value;
	gulong cycle_changed_id;
	gulong tick_id;
	guint tick_callback_id;
	guint timeout_id;
	guint timeout_interval;
	FtGizmo* through;
	FtGizmo* highlight;
	graphene_rect_t bounds;
	GskRoundedRect outline;
	gfloat value_animation_progress;
	AdwTimedAnimation* weight_animation;
};

static gint FtSessionProgressBar_private_offset;
static gpointer ft_session_progress_bar_parent_class = NULL;
static gint FtSessionProgressBarSegment_private_offset;
static gpointer ft_session_progress_bar_segment_parent_class = NULL;

static void ft_session_progress_bar_remove_segments (FtSessionProgressBar* self);
static void ft_session_progress_bar_remove_invisible_segments (FtSessionProgressBar* self);
static gfloat ft_session_progress_bar_segment_get_span_start (FtSessionProgressBarSegment* self);
static FtCycle* ft_session_progress_bar_segment_get_cycle (FtSessionProgressBarSegment* self);
static inline void ft_session_progress_bar_snapshot_segments (FtSessionProgressBar* self,
                                                GtkSnapshot* snapshot);
static gfloat ft_session_progress_bar_calculate_scale (FtSessionProgressBar* self,
                                                gdouble total_weight,
                                                guint cycles_count);
static gfloat ft_session_progress_bar_get_current_scale (FtSessionProgressBar* self);
static gfloat ft_session_progress_bar_get_target_scale (FtSessionProgressBar* self);
static FtSessionProgressBarSegment* ft_session_progress_bar_get_current_segment (FtSessionProgressBar* self);
static gfloat ft_session_progress_bar_segment_get_display_value (FtSessionProgressBarSegment* self);
static gfloat ft_session_progress_bar_get_current_position (FtSessionProgressBar* self);
static gfloat ft_session_progress_bar_segment_get_span_end (FtSessionProgressBarSegment* self);
static gfloat ft_session_progress_bar_get_target_position (FtSessionProgressBar* self);
static void ft_session_progress_bar_update_segments_span (FtSessionProgressBar* self);
static void ft_session_progress_bar_segment_set_span_range (FtSessionProgressBarSegment* self,
                                                     gfloat span_start,
                                                     gfloat span_end);
static gfloat ft_session_progress_bar_segment_get_weight (FtSessionProgressBarSegment* self);
static void ft_session_progress_bar_update_segments (FtSessionProgressBar* self);
static void ft_session_progress_bar_segment_set_cycle (FtSessionProgressBarSegment* self,
                                                FtCycle* value);
static FtSessionProgressBarSegment* ft_session_progress_bar_segment_new (FtCycle* cycle);
static FtSessionProgressBarSegment* ft_session_progress_bar_segment_construct (GType object_type,
                                                                        FtCycle* cycle);
static void ft_session_progress_bar_fade_in (FtSessionProgressBar* self);
static void ft_session_progress_bar_fade_out (FtSessionProgressBar* self);
static void ft_session_progress_bar_animate_weights (FtSessionProgressBar* self);
static void ft_session_progress_bar_animate_scale (FtSessionProgressBar* self,
                                            gfloat scale_from,
                                            gfloat scale_to);
static void ft_session_progress_bar_animate_value (FtSessionProgressBar* self,
                                            gfloat position_from,
                                            gfloat position_to);
static void ft_session_progress_bar_update_long_break_time (FtSessionProgressBar* self);
static Block13Data* block13_data_ref (Block13Data* _data13_);
static void block13_data_unref (void * _userdata_);
static void ___lambda45_ (Block13Data* _data13_,
                   FtTimeBlock* time_block);
static void ____lambda45__gfunc (gconstpointer data,
                          gpointer self);
static void ft_session_progress_bar_update (FtSessionProgressBar* self);
static void ft_session_progress_bar_queue_update (FtSessionProgressBar* self);
static gboolean __lambda46_ (FtSessionProgressBar* self);
static gboolean ___lambda46__gtk_tick_callback (GtkWidget* widget,
                                         GdkFrameClock* frame_clock,
                                         gpointer self);
static void ft_session_progress_bar_on_scale_animation_done (FtSessionProgressBar* self);
static void _ft_session_progress_bar_update_segments_span_adw_animation_target_func (gdouble value,
                                                                              gpointer self);
static void _ft_session_progress_bar_on_scale_animation_done_adw_animation_done (AdwAnimation* _sender,
                                                                          gpointer self);
static void ft_session_progress_bar_prepare_value_animation (FtSessionProgressBar* self,
                                                      gfloat position_from,
                                                      gfloat position_to);
static void ft_session_progress_bar_segment_prepare_value_animation (FtSessionProgressBarSegment* self,
                                                              gfloat display_value_from,
                                                              gfloat display_value_to);
static void ft_session_progress_bar_finish_value_animation (FtSessionProgressBar* self);
static void ft_session_progress_bar_segment_finish_value_animation (FtSessionProgressBarSegment* self);
static void ft_session_progress_bar_on_value_animation_done (FtSessionProgressBar* self);
static Block14Data* block14_data_ref (Block14Data* _data14_);
static void block14_data_unref (void * _userdata_);
static void __lambda44_ (Block14Data* _data14_,
                  gdouble position);
static void ft_session_progress_bar_segment_set_value_animation_progress (FtSessionProgressBarSegment* self,
                                                                   gfloat progress);
static void ___lambda44__adw_animation_target_func (gdouble value,
                                             gpointer self);
static void _ft_session_progress_bar_on_value_animation_done_adw_animation_done (AdwAnimation* _sender,
                                                                          gpointer self);
static Block15Data* block15_data_ref (Block15Data* _data15_);
static void block15_data_unref (void * _userdata_);
static void ____lambda43_ (Block15Data* _data15_,
                    gdouble value);
static void ft_session_progress_bar_segment_set_weight (FtSessionProgressBarSegment* self,
                                                 gfloat value);
static void _____lambda43__adw_animation_target_func (gdouble value,
                                               gpointer self);
static void ft_session_progress_bar_segment_animate_weight (FtSessionProgressBarSegment* self,
                                                     gfloat weight_from,
                                                     gfloat weight_to,
                                                     AdwCallbackAnimationTarget* target);
static void ft_session_progress_bar_on_opacity_animation_done (FtSessionProgressBar* self);
static void ft_session_progress_bar_fade_in_internal (FtSessionProgressBar* self);
static void _gtk_widget_queue_draw_adw_animation_target_func (gdouble value,
                                                       gpointer self);
static void _ft_session_progress_bar_on_opacity_animation_done_adw_animation_done (AdwAnimation* _sender,
                                                                            gpointer self);
static void ft_session_progress_bar_on_session_changed (FtSessionProgressBar* self,
                                                 FtSession* session);
static void ft_session_progress_bar_on_timer_state_changed (FtSessionProgressBar* self,
                                                     const FtTimerState* current_state,
                                                     const FtTimerState* previous_state);
static void ft_session_progress_bar_segment_update_timeout (FtSessionProgressBarSegment* self);
static void ft_session_progress_bar_real_map (GtkWidget* base);
static void _ft_session_progress_bar_on_timer_state_changed_ft_timer_state_changed (FtTimer* _sender,
                                                                             const FtTimerState* current_state,
                                                                             const FtTimerState* previous_state,
                                                                             gpointer self);
static void ft_session_progress_bar_real_unmap (GtkWidget* base);
static GtkSizeRequestMode ft_session_progress_bar_real_get_request_mode (GtkWidget* base);
static void ft_session_progress_bar_real_measure (GtkWidget* base,
                                           GtkOrientation orientation,
                                           gint for_size,
                                           gint* minimum,
                                           gint* natural,
                                           gint* minimum_baseline,
                                           gint* natural_baseline);
static void ft_session_progress_bar_real_size_allocate (GtkWidget* base,
                                                 gint width,
                                                 gint height,
                                                 gint baseline);
static void ft_session_progress_bar_real_snapshot (GtkWidget* base,
                                            GtkSnapshot* snapshot);
static gboolean ft_session_progress_bar_real_query_tooltip (GtkWidget* base,
                                                     gint x,
                                                     gint y,
                                                     gboolean keyboard_tooltip,
                                                     GtkTooltip* tooltip);
static void ft_session_progress_bar_real_dispose (GObject* base);
static void _ft_session_progress_bar_on_session_changed_ft_session_changed (FtSession* _sender,
                                                                     gpointer self);
static inline gint64 ft_session_progress_bar_segment_get_current_time (FtSessionProgressBarSegment* self);
static void __lambda39_ (FtSessionProgressBarSegment* self);
static void ___lambda39__adw_animation_done (AdwAnimation* _sender,
                                      gpointer self);
static inline void ft_session_progress_bar_segment_queue_draw_all (FtSessionProgressBarSegment* self);
static void ft_session_progress_bar_segment_measure_child_cb (FtGizmo* gizmo,
                                                       GtkOrientation orientation,
                                                       gint for_size,
                                                       gint* minimum,
                                                       gint* natural,
                                                       gint* minimum_baseline,
                                                       gint* natural_baseline);
static void ft_session_progress_bar_segment_snapshot_through_cb (FtGizmo* gizmo,
                                                          GtkSnapshot* snapshot);
static void ft_session_progress_bar_segment_snapshot_through (FtSessionProgressBarSegment* self,
                                                       FtGizmo* gizmo,
                                                       GtkSnapshot* snapshot);
static void ft_session_progress_bar_segment_snapshot_highlight_cb (FtGizmo* gizmo,
                                                            GtkSnapshot* snapshot);
static void ft_session_progress_bar_segment_snapshot_highlight (FtSessionProgressBarSegment* self,
                                                         FtGizmo* gizmo,
                                                         GtkSnapshot* snapshot);
static guint ft_session_progress_bar_segment_calculate_timeout_interval (FtSessionProgressBarSegment* self);
static gboolean ft_session_progress_bar_segment_can_timeout (FtSessionProgressBarSegment* self);
static void ft_session_progress_bar_segment_start_timeout (FtSessionProgressBarSegment* self);
static void ft_session_progress_bar_segment_stop_timeout (FtSessionProgressBarSegment* self);
static void ___lambda40_ (FtSessionProgressBarSegment* self,
                   gint64 timestamp);
static void ____lambda40__ft_timer_tick (FtTimer* _sender,
                                  gint64 timestamp,
                                  gpointer self);
static gboolean ____lambda41_ (FtSessionProgressBarSegment* self);
static gboolean _____lambda41__gsource_func (gpointer self);
static gboolean _____lambda42_ (FtSessionProgressBarSegment* self);
static gboolean ______lambda42__gtk_tick_callback (GtkWidget* widget,
                                            GdkFrameClock* frame_clock,
                                            gpointer self);
static void ft_session_progress_bar_segment_update (FtSessionProgressBarSegment* self);
static void ft_session_progress_bar_segment_on_cycle_changed (FtSessionProgressBarSegment* self);
static void ft_session_progress_bar_segment_real_map (GtkWidget* base);
static void ft_session_progress_bar_segment_real_unmap (GtkWidget* base);
static GtkSizeRequestMode ft_session_progress_bar_segment_real_get_request_mode (GtkWidget* base);
static void ft_session_progress_bar_segment_real_measure (GtkWidget* base,
                                                   GtkOrientation orientation,
                                                   gint for_size,
                                                   gint* minimum,
                                                   gint* natural,
                                                   gint* minimum_baseline,
                                                   gint* natural_baseline);
static void ft_session_progress_bar_segment_real_size_allocate (GtkWidget* base,
                                                         gint width,
                                                         gint height,
                                                         gint baseline);
static void ft_session_progress_bar_segment_real_snapshot (GtkWidget* base,
                                                    GtkSnapshot* snapshot);
static void ft_session_progress_bar_segment_real_dispose (GObject* base);
static FtTimer* ft_session_progress_bar_segment_get_timer (FtSessionProgressBarSegment* self);
static void ft_session_progress_bar_segment_set_timer (FtSessionProgressBarSegment* self,
                                                FtTimer* value);
static void _ft_session_progress_bar_segment_on_cycle_changed_ft_cycle_changed (FtCycle* _sender,
                                                                         gpointer self);
static gfloat ft_session_progress_bar_segment_get_line_width (FtSessionProgressBarSegment* self);
static void ft_session_progress_bar_segment_set_line_width (FtSessionProgressBarSegment* self,
                                                     gfloat value);
static GObject * ft_session_progress_bar_segment_constructor (GType type,
                                                       guint n_construct_properties,
                                                       GObjectConstructParam * construct_properties);
static void _ft_session_progress_bar_segment_measure_child_cb_ft_gizmo_measure_func (FtGizmo* gizmo,
                                                                              GtkOrientation orientation,
                                                                              gint for_size,
                                                                              gint* minimum,
                                                                              gint* natural,
                                                                              gint* minimum_baseline,
                                                                              gint* natural_baseline,
                                                                              gpointer self);
static void _ft_session_progress_bar_segment_snapshot_through_cb_ft_gizmo_snapshot_func (FtGizmo* gizmo,
                                                                                  GtkSnapshot* snapshot,
                                                                                  gpointer self);
static void _ft_session_progress_bar_segment_snapshot_highlight_cb_ft_gizmo_snapshot_func (FtGizmo* gizmo,
                                                                                    GtkSnapshot* snapshot,
                                                                                    gpointer self);
static void ft_session_progress_bar_segment_finalize (GObject * obj);
static GType ft_session_progress_bar_segment_get_type_once (void);
static void _vala_ft_session_progress_bar_segment_get_property (GObject * object,
                                                         guint property_id,
                                                         GValue * value,
                                                         GParamSpec * pspec);
static void _vala_ft_session_progress_bar_segment_set_property (GObject * object,
                                                         guint property_id,
                                                         const GValue * value,
                                                         GParamSpec * pspec);
static GObject * ft_session_progress_bar_constructor (GType type,
                                               guint n_construct_properties,
                                               GObjectConstructParam * construct_properties);
static void ft_session_progress_bar_finalize (GObject * obj);
static GType ft_session_progress_bar_get_type_once (void);
static void _vala_ft_session_progress_bar_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec);
static void _vala_ft_session_progress_bar_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_session_progress_bar_get_instance_private (FtSessionProgressBar* self)
{
	return G_STRUCT_MEMBER_P (self, FtSessionProgressBar_private_offset);
}

static void
ft_session_progress_bar_remove_segments (FtSessionProgressBar* self)
{
	GtkWidget* child = NULL;
	g_return_if_fail (self != NULL);
	while (TRUE) {
		GtkWidget* _tmp0_;
		GtkWidget* _tmp1_;
		GtkWidget* _tmp2_;
		_tmp0_ = gtk_widget_get_first_child ((GtkWidget*) self);
		child = _tmp0_;
		_tmp1_ = child;
		if (!(_tmp1_ != NULL)) {
			break;
		}
		_tmp2_ = child;
		gtk_widget_unparent (_tmp2_);
	}
	self->priv->current_segment = NULL;
	self->priv->scale = NAN;
}

/**
         * Remove segments that are not in the view.
         */
static void
ft_session_progress_bar_remove_invisible_segments (FtSessionProgressBar* self)
{
	AdwTimedAnimation* _tmp0_;
	FtSessionProgressBarSegment* segment = NULL;
	GtkWidget* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->scale_animation;
	_vala_return_if_fail (_tmp0_ == NULL, "this.scale_animation == null");
	_tmp1_ = gtk_widget_get_first_child ((GtkWidget*) self);
	segment = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, FT_SESSION_PROGRESS_BAR_TYPE_SEGMENT, FtSessionProgressBarSegment);
	while (TRUE) {
		FtSessionProgressBarSegment* _tmp2_;
		FtSessionProgressBarSegment* next_segment = NULL;
		FtSessionProgressBarSegment* _tmp3_;
		GtkWidget* _tmp4_;
		gboolean _tmp5_ = FALSE;
		FtSessionProgressBarSegment* _tmp6_;
		gfloat _tmp7_;
		gfloat _tmp8_;
		FtSessionProgressBarSegment* _tmp13_;
		_tmp2_ = segment;
		if (!(_tmp2_ != NULL)) {
			break;
		}
		_tmp3_ = segment;
		_tmp4_ = gtk_widget_get_next_sibling ((GtkWidget*) _tmp3_);
		next_segment = G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, FT_SESSION_PROGRESS_BAR_TYPE_SEGMENT, FtSessionProgressBarSegment);
		_tmp6_ = segment;
		_tmp7_ = ft_session_progress_bar_segment_get_span_start (_tmp6_);
		_tmp8_ = _tmp7_;
		if (_tmp8_ >= 1.0f) {
			FtSessionProgressBarSegment* _tmp9_;
			FtCycle* _tmp10_;
			FtCycle* _tmp11_;
			_tmp9_ = segment;
			_tmp10_ = ft_session_progress_bar_segment_get_cycle (_tmp9_);
			_tmp11_ = _tmp10_;
			_tmp5_ = _tmp11_ == NULL;
		} else {
			_tmp5_ = FALSE;
		}
		if (_tmp5_) {
			FtSessionProgressBarSegment* _tmp12_;
			_tmp12_ = segment;
			gtk_widget_unparent ((GtkWidget*) _tmp12_);
		}
		_tmp13_ = next_segment;
		segment = _tmp13_;
	}
}

static inline void
ft_session_progress_bar_snapshot_segments (FtSessionProgressBar* self,
                                           GtkSnapshot* snapshot)
{
	GtkWidget* child = NULL;
	GtkWidget* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (snapshot != NULL);
	_tmp0_ = gtk_widget_get_first_child ((GtkWidget*) self);
	child = _tmp0_;
	while (TRUE) {
		GtkWidget* _tmp1_;
		GtkWidget* _tmp2_;
		GtkWidget* _tmp3_;
		GtkWidget* _tmp4_;
		_tmp1_ = child;
		if (!(_tmp1_ != NULL)) {
			break;
		}
		_tmp2_ = child;
		gtk_widget_snapshot_child ((GtkWidget*) self, _tmp2_, snapshot);
		_tmp3_ = child;
		_tmp4_ = gtk_widget_get_next_sibling (_tmp3_);
		child = _tmp4_;
	}
}

static gfloat
ft_session_progress_bar_calculate_scale (FtSessionProgressBar* self,
                                         gdouble total_weight,
                                         guint cycles_count)
{
	gdouble norm = 0.0;
	gfloat _tmp0_ = 0.0F;
	gfloat result;
	g_return_val_if_fail (self != NULL, -1.0F);
	norm = total_weight + ((cycles_count - 1) * ((gdouble) FT_SESSION_PROGRESS_BAR_SEGMENT_SPACING));
	if (norm > 0.0) {
		_tmp0_ = (gfloat) (1.0 / norm);
	} else {
		_tmp0_ = 0.0f;
	}
	result = _tmp0_;
	return result;
}

static gfloat
ft_session_progress_bar_get_current_scale (FtSessionProgressBar* self)
{
	gfloat _tmp0_ = 0.0F;
	AdwTimedAnimation* _tmp1_;
	gfloat result;
	g_return_val_if_fail (self != NULL, -1.0F);
	_tmp1_ = self->priv->scale_animation;
	if (_tmp1_ != NULL) {
		AdwTimedAnimation* _tmp2_;
		gdouble _tmp3_;
		gdouble _tmp4_;
		_tmp2_ = self->priv->scale_animation;
		_tmp3_ = adw_animation_get_value ((AdwAnimation*) _tmp2_);
		_tmp4_ = _tmp3_;
		_tmp0_ = (gfloat) _tmp4_;
	} else {
		_tmp0_ = self->priv->scale;
	}
	result = _tmp0_;
	return result;
}

static gfloat
ft_session_progress_bar_get_target_scale (FtSessionProgressBar* self)
{
	FtSessionProgressBarSegment* segment = NULL;
	GtkWidget* _tmp0_;
	gint cycles_count = 0;
	gdouble total_weight = 0.0;
	gfloat result;
	g_return_val_if_fail (self != NULL, -1.0F);
	_tmp0_ = gtk_widget_get_first_child ((GtkWidget*) self);
	segment = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, FT_SESSION_PROGRESS_BAR_TYPE_SEGMENT, FtSessionProgressBarSegment);
	cycles_count = 0;
	total_weight = 0.0;
	while (TRUE) {
		FtSessionProgressBarSegment* _tmp1_;
		FtCycle* cycle = NULL;
		FtSessionProgressBarSegment* _tmp2_;
		FtCycle* _tmp3_;
		FtCycle* _tmp4_;
		FtCycle* _tmp5_;
		FtSessionProgressBarSegment* _tmp8_;
		GtkWidget* _tmp9_;
		_tmp1_ = segment;
		if (!(_tmp1_ != NULL)) {
			break;
		}
		_tmp2_ = segment;
		_tmp3_ = ft_session_progress_bar_segment_get_cycle (_tmp2_);
		_tmp4_ = _tmp3_;
		cycle = _tmp4_;
		_tmp5_ = cycle;
		if (_tmp5_ != NULL) {
			FtCycle* _tmp6_;
			gint _tmp7_;
			_tmp6_ = cycle;
			total_weight += ft_cycle_get_weight (_tmp6_);
			_tmp7_ = cycles_count;
			cycles_count = _tmp7_ + 1;
		}
		_tmp8_ = segment;
		_tmp9_ = gtk_widget_get_next_sibling ((GtkWidget*) _tmp8_);
		segment = G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, FT_SESSION_PROGRESS_BAR_TYPE_SEGMENT, FtSessionProgressBarSegment);
	}
	result = ft_session_progress_bar_calculate_scale (self, total_weight, (guint) cycles_count);
	return result;
}

static FtSessionProgressBarSegment*
ft_session_progress_bar_get_current_segment (FtSessionProgressBar* self)
{
	FtSessionProgressBarSegment* segment = NULL;
	GtkWidget* _tmp0_;
	FtSessionProgressBarSegment* _tmp7_;
	FtSessionProgressBarSegment* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = gtk_widget_get_last_child ((GtkWidget*) self);
	segment = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, FT_SESSION_PROGRESS_BAR_TYPE_SEGMENT, FtSessionProgressBarSegment);
	while (TRUE) {
		FtSessionProgressBarSegment* _tmp1_;
		FtSessionProgressBarSegment* _tmp2_;
		gfloat _tmp3_;
		gfloat _tmp4_;
		FtSessionProgressBarSegment* _tmp5_;
		GtkWidget* _tmp6_;
		_tmp1_ = segment;
		if (!(_tmp1_ != NULL)) {
			break;
		}
		_tmp2_ = segment;
		_tmp3_ = ft_session_progress_bar_segment_get_display_value (_tmp2_);
		_tmp4_ = _tmp3_;
		if (_tmp4_ > 0.0f) {
			break;
		}
		_tmp5_ = segment;
		_tmp6_ = gtk_widget_get_prev_sibling ((GtkWidget*) _tmp5_);
		segment = G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, FT_SESSION_PROGRESS_BAR_TYPE_SEGMENT, FtSessionProgressBarSegment);
	}
	_tmp7_ = segment;
	result = _tmp7_;
	return result;
}

static gfloat
ft_session_progress_bar_get_current_position (FtSessionProgressBar* self)
{
	FtSessionProgressBarSegment* segment = NULL;
	GtkWidget* _tmp0_;
	gfloat position = 0.0F;
	gfloat result;
	g_return_val_if_fail (self != NULL, -1.0F);
	_tmp0_ = gtk_widget_get_first_child ((GtkWidget*) self);
	segment = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, FT_SESSION_PROGRESS_BAR_TYPE_SEGMENT, FtSessionProgressBarSegment);
	position = 0.0f;
	while (TRUE) {
		FtSessionProgressBarSegment* _tmp1_;
		gfloat display_value = 0.0F;
		FtSessionProgressBarSegment* _tmp2_;
		gfloat _tmp3_;
		gfloat _tmp4_;
		FtSessionProgressBarSegment* _tmp11_;
		gfloat _tmp12_;
		gfloat _tmp13_;
		FtSessionProgressBarSegment* _tmp14_;
		GtkWidget* _tmp15_;
		_tmp1_ = segment;
		if (!(_tmp1_ != NULL)) {
			break;
		}
		_tmp2_ = segment;
		_tmp3_ = ft_session_progress_bar_segment_get_display_value (_tmp2_);
		_tmp4_ = _tmp3_;
		display_value = _tmp4_;
		if (display_value < 1.0f) {
			FtSessionProgressBarSegment* _tmp5_;
			gfloat _tmp6_;
			gfloat _tmp7_;
			FtSessionProgressBarSegment* _tmp8_;
			gfloat _tmp9_;
			gfloat _tmp10_;
			_tmp5_ = segment;
			_tmp6_ = ft_session_progress_bar_segment_get_span_start (_tmp5_);
			_tmp7_ = _tmp6_;
			_tmp8_ = segment;
			_tmp9_ = ft_session_progress_bar_segment_get_span_end (_tmp8_);
			_tmp10_ = _tmp9_;
			position = ft_lerpf (_tmp7_, _tmp10_, display_value);
			break;
		}
		_tmp11_ = segment;
		_tmp12_ = ft_session_progress_bar_segment_get_span_end (_tmp11_);
		_tmp13_ = _tmp12_;
		position = _tmp13_;
		_tmp14_ = segment;
		_tmp15_ = gtk_widget_get_next_sibling ((GtkWidget*) _tmp14_);
		segment = G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, FT_SESSION_PROGRESS_BAR_TYPE_SEGMENT, FtSessionProgressBarSegment);
	}
	result = position;
	return result;
}

static gfloat
ft_session_progress_bar_get_target_position (FtSessionProgressBar* self)
{
	FtSessionProgressBarSegment* segment = NULL;
	GtkWidget* _tmp0_;
	gfloat position = 0.0F;
	gint64 _tmp1_ = 0LL;
	FtTimer* _tmp2_;
	gint64 timestamp = 0LL;
	gfloat result;
	g_return_val_if_fail (self != NULL, -1.0F);
	_tmp0_ = gtk_widget_get_first_child ((GtkWidget*) self);
	segment = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, FT_SESSION_PROGRESS_BAR_TYPE_SEGMENT, FtSessionProgressBarSegment);
	position = 0.0f;
	_tmp2_ = self->priv->_timer;
	if (ft_timer_is_running (_tmp2_)) {
		FtTimer* _tmp3_;
		_tmp3_ = self->priv->_timer;
		_tmp1_ = ft_timer_get_current_time (_tmp3_, FT_TIMESTAMP_UNDEFINED);
	} else {
		FtTimer* _tmp4_;
		_tmp4_ = self->priv->_timer;
		_tmp1_ = ft_timer_get_last_state_changed_time (_tmp4_);
	}
	timestamp = _tmp1_;
	while (TRUE) {
		FtSessionProgressBarSegment* _tmp5_;
		gfloat _tmp6_ = 0.0F;
		FtSessionProgressBarSegment* _tmp7_;
		FtCycle* _tmp8_;
		FtCycle* _tmp9_;
		gfloat segment_progress = 0.0F;
		FtSessionProgressBarSegment* _tmp19_;
		gfloat _tmp20_;
		gfloat _tmp21_;
		FtSessionProgressBarSegment* _tmp22_;
		GtkWidget* _tmp23_;
		_tmp5_ = segment;
		if (!(_tmp5_ != NULL)) {
			break;
		}
		_tmp7_ = segment;
		_tmp8_ = ft_session_progress_bar_segment_get_cycle (_tmp7_);
		_tmp9_ = _tmp8_;
		if (_tmp9_ != NULL) {
			FtSessionProgressBarSegment* _tmp10_;
			FtCycle* _tmp11_;
			FtCycle* _tmp12_;
			_tmp10_ = segment;
			_tmp11_ = ft_session_progress_bar_segment_get_cycle (_tmp10_);
			_tmp12_ = _tmp11_;
			_tmp6_ = (gfloat) ft_cycle_calculate_progress (_tmp12_, timestamp);
		} else {
			_tmp6_ = 0.0f;
		}
		segment_progress = _tmp6_;
		if (segment_progress <= 0.0f) {
			break;
		}
		if (segment_progress < 1.0f) {
			FtSessionProgressBarSegment* _tmp13_;
			gfloat _tmp14_;
			gfloat _tmp15_;
			FtSessionProgressBarSegment* _tmp16_;
			gfloat _tmp17_;
			gfloat _tmp18_;
			_tmp13_ = segment;
			_tmp14_ = ft_session_progress_bar_segment_get_span_start (_tmp13_);
			_tmp15_ = _tmp14_;
			_tmp16_ = segment;
			_tmp17_ = ft_session_progress_bar_segment_get_span_end (_tmp16_);
			_tmp18_ = _tmp17_;
			position = ft_lerpf (_tmp15_, _tmp18_, segment_progress);
			break;
		}
		_tmp19_ = segment;
		_tmp20_ = ft_session_progress_bar_segment_get_span_end (_tmp19_);
		_tmp21_ = _tmp20_;
		position = _tmp21_;
		_tmp22_ = segment;
		_tmp23_ = gtk_widget_get_next_sibling ((GtkWidget*) _tmp22_);
		segment = G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, FT_SESSION_PROGRESS_BAR_TYPE_SEGMENT, FtSessionProgressBarSegment);
	}
	result = position;
	return result;
}

static void
ft_session_progress_bar_update_segments_span (FtSessionProgressBar* self)
{
	gfloat _tmp0_ = 0.0F;
	AdwTimedAnimation* _tmp1_;
	gfloat scale = 0.0F;
	gfloat position = 0.0F;
	gfloat spacing = 0.0F;
	FtSessionProgressBarSegment* segment = NULL;
	GtkWidget* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->scale_animation;
	if (_tmp1_ != NULL) {
		AdwTimedAnimation* _tmp2_;
		gdouble _tmp3_;
		gdouble _tmp4_;
		_tmp2_ = self->priv->scale_animation;
		_tmp3_ = adw_animation_get_value ((AdwAnimation*) _tmp2_);
		_tmp4_ = _tmp3_;
		_tmp0_ = (gfloat) _tmp4_;
	} else {
		_tmp0_ = self->priv->scale;
	}
	scale = _tmp0_;
	position = 0.0f;
	spacing = (gfloat) (FT_SESSION_PROGRESS_BAR_SEGMENT_SPACING * scale);
	_tmp5_ = gtk_widget_get_first_child ((GtkWidget*) self);
	segment = G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, FT_SESSION_PROGRESS_BAR_TYPE_SEGMENT, FtSessionProgressBarSegment);
	while (TRUE) {
		FtSessionProgressBarSegment* _tmp6_;
		FtSessionProgressBarSegment* _tmp7_;
		FtSessionProgressBarSegment* _tmp8_;
		gfloat _tmp9_;
		gfloat _tmp10_;
		FtSessionProgressBarSegment* _tmp11_;
		gfloat _tmp12_;
		gfloat _tmp13_;
		FtSessionProgressBarSegment* _tmp14_;
		GtkWidget* _tmp15_;
		_tmp6_ = segment;
		if (!(_tmp6_ != NULL)) {
			break;
		}
		_tmp7_ = segment;
		_tmp8_ = segment;
		_tmp9_ = ft_session_progress_bar_segment_get_weight (_tmp8_);
		_tmp10_ = _tmp9_;
		ft_session_progress_bar_segment_set_span_range (_tmp7_, position, position + (_tmp10_ * scale));
		_tmp11_ = segment;
		_tmp12_ = ft_session_progress_bar_segment_get_span_end (_tmp11_);
		_tmp13_ = _tmp12_;
		position = _tmp13_ + spacing;
		_tmp14_ = segment;
		_tmp15_ = gtk_widget_get_next_sibling ((GtkWidget*) _tmp14_);
		segment = G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, FT_SESSION_PROGRESS_BAR_TYPE_SEGMENT, FtSessionProgressBarSegment);
	}
	gtk_widget_queue_draw ((GtkWidget*) self);
}

/**
         * Synchronise segments according to cycles.
         */
static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static void
ft_session_progress_bar_update_segments (FtSessionProgressBar* self)
{
	FtSession* _tmp0_;
	GList* cycles = NULL;
	FtSession* _tmp6_;
	GList* _tmp7_;
	guint cycles_count = 0U;
	GList* link = NULL;
	GList* _tmp8_;
	GList* _tmp9_;
	FtSessionProgressBarSegment* segment = NULL;
	GtkWidget* _tmp10_;
	FtCycle* current_cycle = NULL;
	FtSessionManager* _tmp11_;
	FtCycle* _tmp12_;
	FtSessionProgressBarSegment* current_segment = NULL;
	FtSessionProgressBarSegment* _tmp35_;
	gfloat scale_from = 0.0F;
	gfloat scale_to = 0.0F;
	gfloat position_from = 0.0F;
	gfloat position_to = 0.0F;
	AdwTimedAnimation* _tmp40_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_session;
	if (_tmp0_ == NULL) {
		FtSessionManager* _tmp1_;
		FtSessionManager* _tmp2_;
		FtSession* _tmp3_;
		FtSession* _tmp4_;
		FtSession* _tmp5_;
		_tmp1_ = self->priv->_session_manager;
		ft_session_manager_ensure_session (_tmp1_, FT_TIMESTAMP_UNDEFINED);
		_tmp2_ = self->priv->_session_manager;
		_tmp3_ = ft_session_manager_get_current_session (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = _g_object_ref0 (_tmp4_);
		_g_object_unref0 (self->priv->_session);
		self->priv->_session = _tmp5_;
		g_object_notify ((GObject*) self, "session");
	}
	_tmp6_ = self->priv->_session;
	_tmp7_ = ft_session_get_cycles (_tmp6_);
	cycles = _tmp7_;
	cycles_count = 0U;
	_tmp8_ = cycles;
	_tmp9_ = g_list_first (_tmp8_);
	link = _tmp9_;
	_tmp10_ = gtk_widget_get_first_child ((GtkWidget*) self);
	segment = G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, FT_SESSION_PROGRESS_BAR_TYPE_SEGMENT, FtSessionProgressBarSegment);
	_tmp11_ = self->priv->_session_manager;
	_tmp12_ = ft_session_manager_get_current_cycle (_tmp11_);
	current_cycle = _tmp12_;
	current_segment = NULL;
	while (TRUE) {
		GList* _tmp13_;
		FtCycle* cycle = NULL;
		GList* _tmp14_;
		gconstpointer _tmp15_;
		FtCycle* _tmp16_;
		GList* _tmp17_;
		gconstpointer _tmp18_;
		GList* _tmp33_;
		GList* _tmp34_;
		_tmp13_ = link;
		if (!(_tmp13_ != NULL)) {
			break;
		}
		_tmp14_ = link;
		_tmp15_ = _tmp14_->data;
		_tmp16_ = _g_object_ref0 ((FtCycle*) _tmp15_);
		cycle = _tmp16_;
		_tmp17_ = link;
		_tmp18_ = _tmp17_->data;
		if (ft_cycle_is_visible ((FtCycle*) _tmp18_)) {
			FtSessionProgressBarSegment* _tmp19_;
			FtCycle* _tmp27_;
			FtCycle* _tmp28_;
			guint _tmp30_;
			FtSessionProgressBarSegment* _tmp31_;
			GtkWidget* _tmp32_;
			_tmp19_ = segment;
			if (_tmp19_ != NULL) {
				FtSessionProgressBarSegment* _tmp20_;
				FtCycle* _tmp21_;
				_tmp20_ = segment;
				_tmp21_ = cycle;
				ft_session_progress_bar_segment_set_cycle (_tmp20_, _tmp21_);
			} else {
				FtSessionProgressBarSegment* new_segment = NULL;
				FtCycle* _tmp22_;
				FtSessionProgressBarSegment* _tmp23_;
				FtSessionProgressBarSegment* _tmp24_;
				FtSessionProgressBarSegment* _tmp25_;
				FtSessionProgressBarSegment* _tmp26_;
				_tmp22_ = cycle;
				_tmp23_ = ft_session_progress_bar_segment_new (_tmp22_);
				g_object_ref_sink (_tmp23_);
				new_segment = _tmp23_;
				_tmp24_ = new_segment;
				g_object_bind_property_with_closures ((GObject*) self, "line-width", (GObject*) _tmp24_, "line-width", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
				_tmp25_ = new_segment;
				gtk_widget_insert_before ((GtkWidget*) _tmp25_, (GtkWidget*) self, NULL);
				_tmp26_ = new_segment;
				segment = _tmp26_;
				_g_object_unref0 (new_segment);
			}
			_tmp27_ = cycle;
			_tmp28_ = current_cycle;
			if (_tmp27_ == _tmp28_) {
				FtSessionProgressBarSegment* _tmp29_;
				_tmp29_ = segment;
				current_segment = _tmp29_;
			}
			_tmp30_ = cycles_count;
			cycles_count = _tmp30_ + 1;
			_tmp31_ = segment;
			_tmp32_ = gtk_widget_get_next_sibling ((GtkWidget*) _tmp31_);
			segment = G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, FT_SESSION_PROGRESS_BAR_TYPE_SEGMENT, FtSessionProgressBarSegment);
		}
		_tmp33_ = link;
		_tmp34_ = _tmp33_->next;
		link = _tmp34_;
		_g_object_unref0 (cycle);
	}
	_tmp35_ = current_segment;
	self->priv->current_segment = _tmp35_;
	while (TRUE) {
		FtSessionProgressBarSegment* _tmp36_;
		FtSessionProgressBarSegment* _tmp37_;
		FtSessionProgressBarSegment* _tmp38_;
		GtkWidget* _tmp39_;
		_tmp36_ = segment;
		if (!(_tmp36_ != NULL)) {
			break;
		}
		_tmp37_ = segment;
		ft_session_progress_bar_segment_set_cycle (_tmp37_, NULL);
		_tmp38_ = segment;
		_tmp39_ = gtk_widget_get_next_sibling ((GtkWidget*) _tmp38_);
		segment = G_TYPE_CHECK_INSTANCE_CAST (_tmp39_, FT_SESSION_PROGRESS_BAR_TYPE_SEGMENT, FtSessionProgressBarSegment);
	}
	scale_from = ft_session_progress_bar_get_current_scale (self);
	scale_to = ft_session_progress_bar_get_target_scale (self);
	position_from = ft_session_progress_bar_get_current_position (self);
	position_to = ft_session_progress_bar_get_target_position (self);
	if (cycles_count > 1U) {
		ft_session_progress_bar_fade_in (self);
	} else {
		ft_session_progress_bar_fade_out (self);
	}
	if (self->priv->_reveal) {
		ft_session_progress_bar_animate_weights (self);
		ft_session_progress_bar_animate_scale (self, scale_from, scale_to);
		ft_session_progress_bar_animate_value (self, position_from, position_to);
	}
	_tmp40_ = self->priv->scale_animation;
	if (_tmp40_ == NULL) {
		ft_session_progress_bar_remove_invisible_segments (self);
	}
	(cycles == NULL) ? NULL : (cycles = (g_list_free (cycles), NULL));
}

/**
         * Find when there will be a long break for the tooltip.
         */
static Block13Data*
block13_data_ref (Block13Data* _data13_)
{
	g_atomic_int_inc (&_data13_->_ref_count_);
	return _data13_;
}

static void
block13_data_unref (void * _userdata_)
{
	Block13Data* _data13_;
	_data13_ = (Block13Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data13_->_ref_count_)) {
		FtSessionProgressBar* self;
		self = _data13_->self;
		_g_object_unref0 (self);
		g_slice_free (Block13Data, _data13_);
	}
}

static void
___lambda45_ (Block13Data* _data13_,
              FtTimeBlock* time_block)
{
	FtSessionProgressBar* self;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	FtState _tmp2_;
	FtState _tmp3_;
	self = _data13_->self;
	g_return_if_fail (time_block != NULL);
	_tmp2_ = ft_time_block_get_state (time_block);
	_tmp3_ = _tmp2_;
	if (_tmp3_ == FT_STATE_LONG_BREAK) {
		_tmp1_ = ft_time_block_get_status (time_block) == FT_TIME_BLOCK_STATUS_SCHEDULED;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		_tmp0_ = ft_timestamp_is_undefined (_data13_->long_break_time);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gint64 _tmp4_;
		gint64 _tmp5_;
		_tmp4_ = ft_schedulable_get_start_time ((FtSchedulable*) time_block);
		_tmp5_ = _tmp4_;
		_data13_->long_break_time = _tmp5_;
	}
}

static void
____lambda45__gfunc (gconstpointer data,
                     gpointer self)
{
	___lambda45_ (self, (FtTimeBlock*) data);
}

static void
ft_session_progress_bar_update_long_break_time (FtSessionProgressBar* self)
{
	Block13Data* _data13_;
	FtSession* _tmp0_ = NULL;
	FtSession* _tmp1_;
	g_return_if_fail (self != NULL);
	_data13_ = g_slice_new0 (Block13Data);
	_data13_->_ref_count_ = 1;
	_data13_->self = g_object_ref (self);
	_data13_->long_break_time = FT_TIMESTAMP_UNDEFINED;
	_tmp1_ = self->priv->_session;
	_tmp0_ = _tmp1_;
	if (_tmp0_ != NULL) {
		ft_session_foreach (_tmp0_, ____lambda45__gfunc, _data13_);
	}
	self->priv->long_break_time = _data13_->long_break_time;
	block13_data_unref (_data13_);
	_data13_ = NULL;
}

static void
ft_session_progress_bar_update (FtSessionProgressBar* self)
{
	g_return_if_fail (self != NULL);
	if (self->priv->tick_callback_id != ((guint) 0)) {
		gtk_widget_remove_tick_callback ((GtkWidget*) self, self->priv->tick_callback_id);
		self->priv->tick_callback_id = (guint) 0;
	}
	ft_session_progress_bar_update_long_break_time (self);
	ft_session_progress_bar_update_segments (self);
}

static gboolean
__lambda46_ (FtSessionProgressBar* self)
{
	gboolean result;
	self->priv->tick_callback_id = (guint) 0;
	ft_session_progress_bar_update (self);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda46__gtk_tick_callback (GtkWidget* widget,
                                GdkFrameClock* frame_clock,
                                gpointer self)
{
	gboolean result;
	result = __lambda46_ ((FtSessionProgressBar*) self);
	return result;
}

static void
ft_session_progress_bar_queue_update (FtSessionProgressBar* self)
{
	gboolean _tmp0_ = FALSE;
	g_return_if_fail (self != NULL);
	if (self->priv->_reveal) {
		_tmp0_ = !gtk_widget_get_mapped ((GtkWidget*) self);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		return;
	}
	if (self->priv->tick_callback_id != ((guint) 0)) {
		return;
	}
	self->priv->tick_callback_id = gtk_widget_add_tick_callback ((GtkWidget*) self, ___lambda46__gtk_tick_callback, g_object_ref (self), g_object_unref);
}

static void
ft_session_progress_bar_on_scale_animation_done (FtSessionProgressBar* self)
{
	g_return_if_fail (self != NULL);
	_g_object_unref0 (self->priv->scale_animation);
	self->priv->scale_animation = NULL;
	ft_session_progress_bar_update_segments_span (self);
	ft_session_progress_bar_remove_invisible_segments (self);
}

static void
_ft_session_progress_bar_update_segments_span_adw_animation_target_func (gdouble value,
                                                                         gpointer self)
{
	ft_session_progress_bar_update_segments_span ((FtSessionProgressBar*) self);
}

static void
_ft_session_progress_bar_on_scale_animation_done_adw_animation_done (AdwAnimation* _sender,
                                                                     gpointer self)
{
	ft_session_progress_bar_on_scale_animation_done ((FtSessionProgressBar*) self);
}

static void
ft_session_progress_bar_animate_scale (FtSessionProgressBar* self,
                                       gfloat scale_from,
                                       gfloat scale_to)
{
	AdwTimedAnimation* _tmp0_;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	g_return_if_fail (self != NULL);
	if (scale_to == scale_from) {
		return;
	}
	self->priv->scale = scale_to;
	_tmp0_ = self->priv->scale_animation;
	if (_tmp0_ != NULL) {
		AdwTimedAnimation* _tmp1_;
		_tmp1_ = self->priv->scale_animation;
		adw_animation_pause ((AdwAnimation*) _tmp1_);
		_g_object_unref0 (self->priv->scale_animation);
		self->priv->scale_animation = NULL;
	}
	if (gtk_widget_get_mapped ((GtkWidget*) self)) {
		_tmp3_ = !isnan (scale_from);
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		_tmp2_ = !isnan (scale_to);
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		AdwCallbackAnimationTarget* animation_target = NULL;
		AdwCallbackAnimationTarget* _tmp4_;
		AdwCallbackAnimationTarget* _tmp5_;
		AdwAnimationTarget* _tmp6_;
		AdwTimedAnimation* _tmp7_;
		AdwTimedAnimation* _tmp8_;
		AdwTimedAnimation* _tmp9_;
		AdwTimedAnimation* _tmp10_;
		_tmp4_ = (AdwCallbackAnimationTarget*) adw_callback_animation_target_new (_ft_session_progress_bar_update_segments_span_adw_animation_target_func, g_object_ref (self), g_object_unref);
		animation_target = _tmp4_;
		_tmp5_ = animation_target;
		_tmp6_ = _g_object_ref0 ((AdwAnimationTarget*) _tmp5_);
		_tmp7_ = (AdwTimedAnimation*) adw_timed_animation_new ((GtkWidget*) self, (gdouble) scale_from, (gdouble) scale_to, FT_SESSION_PROGRESS_BAR_SCALE_ANIMATION_DURATION, _tmp6_);
		_g_object_unref0 (self->priv->scale_animation);
		self->priv->scale_animation = _tmp7_;
		_tmp8_ = self->priv->scale_animation;
		adw_timed_animation_set_easing (_tmp8_, ADW_EASE_OUT_QUAD);
		_tmp9_ = self->priv->scale_animation;
		g_signal_connect_object ((AdwAnimation*) _tmp9_, "done", (GCallback) _ft_session_progress_bar_on_scale_animation_done_adw_animation_done, self, 0);
		_tmp10_ = self->priv->scale_animation;
		adw_animation_play ((AdwAnimation*) _tmp10_);
		_g_object_unref0 (animation_target);
	} else {
		if (!isnan (scale_to)) {
			ft_session_progress_bar_on_scale_animation_done (self);
		}
	}
}

static void
ft_session_progress_bar_prepare_value_animation (FtSessionProgressBar* self,
                                                 gfloat position_from,
                                                 gfloat position_to)
{
	FtSessionProgressBarSegment* segment = NULL;
	GtkWidget* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_widget_get_first_child ((GtkWidget*) self);
	segment = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, FT_SESSION_PROGRESS_BAR_TYPE_SEGMENT, FtSessionProgressBarSegment);
	while (TRUE) {
		FtSessionProgressBarSegment* _tmp1_;
		FtSessionProgressBarSegment* _tmp2_;
		gfloat _tmp3_;
		gfloat _tmp4_;
		FtSessionProgressBarSegment* _tmp5_;
		gfloat _tmp6_;
		gfloat _tmp7_;
		FtSessionProgressBarSegment* _tmp30_;
		GtkWidget* _tmp31_;
		_tmp1_ = segment;
		if (!(_tmp1_ != NULL)) {
			break;
		}
		_tmp2_ = segment;
		_tmp3_ = ft_session_progress_bar_segment_get_span_start (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = segment;
		_tmp6_ = ft_session_progress_bar_segment_get_span_end (_tmp5_);
		_tmp7_ = _tmp6_;
		if (_tmp4_ < _tmp7_) {
			gfloat display_value_from = 0.0F;
			FtSessionProgressBarSegment* _tmp8_;
			gfloat _tmp9_;
			gfloat _tmp10_;
			FtSessionProgressBarSegment* _tmp11_;
			gfloat _tmp12_;
			gfloat _tmp13_;
			FtSessionProgressBarSegment* _tmp14_;
			gfloat _tmp15_;
			gfloat _tmp16_;
			gfloat display_value_to = 0.0F;
			FtSessionProgressBarSegment* _tmp17_;
			gfloat _tmp18_;
			gfloat _tmp19_;
			FtSessionProgressBarSegment* _tmp20_;
			gfloat _tmp21_;
			gfloat _tmp22_;
			FtSessionProgressBarSegment* _tmp23_;
			gfloat _tmp24_;
			gfloat _tmp25_;
			FtSessionProgressBarSegment* _tmp26_;
			FtSessionProgressBarSegment* _tmp27_;
			gfloat _tmp28_;
			gfloat _tmp29_;
			_tmp8_ = segment;
			_tmp9_ = ft_session_progress_bar_segment_get_span_start (_tmp8_);
			_tmp10_ = _tmp9_;
			_tmp11_ = segment;
			_tmp12_ = ft_session_progress_bar_segment_get_span_end (_tmp11_);
			_tmp13_ = _tmp12_;
			_tmp14_ = segment;
			_tmp15_ = ft_session_progress_bar_segment_get_span_start (_tmp14_);
			_tmp16_ = _tmp15_;
			display_value_from = CLAMP ((position_from - _tmp10_) / (_tmp13_ - _tmp16_), 0.0f, 1.0f);
			_tmp17_ = segment;
			_tmp18_ = ft_session_progress_bar_segment_get_span_start (_tmp17_);
			_tmp19_ = _tmp18_;
			_tmp20_ = segment;
			_tmp21_ = ft_session_progress_bar_segment_get_span_end (_tmp20_);
			_tmp22_ = _tmp21_;
			_tmp23_ = segment;
			_tmp24_ = ft_session_progress_bar_segment_get_span_start (_tmp23_);
			_tmp25_ = _tmp24_;
			display_value_to = CLAMP ((position_to - _tmp19_) / (_tmp22_ - _tmp25_), 0.0f, 1.0f);
			_tmp26_ = segment;
			_tmp27_ = segment;
			_tmp28_ = ft_session_progress_bar_segment_get_display_value (_tmp27_);
			_tmp29_ = _tmp28_;
			ft_session_progress_bar_segment_prepare_value_animation (_tmp26_, MAX (display_value_from, _tmp29_), display_value_to);
		}
		_tmp30_ = segment;
		_tmp31_ = gtk_widget_get_next_sibling ((GtkWidget*) _tmp30_);
		segment = G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, FT_SESSION_PROGRESS_BAR_TYPE_SEGMENT, FtSessionProgressBarSegment);
	}
}

static void
ft_session_progress_bar_finish_value_animation (FtSessionProgressBar* self)
{
	FtSessionProgressBarSegment* segment = NULL;
	GtkWidget* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_widget_get_first_child ((GtkWidget*) self);
	segment = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, FT_SESSION_PROGRESS_BAR_TYPE_SEGMENT, FtSessionProgressBarSegment);
	while (TRUE) {
		FtSessionProgressBarSegment* _tmp1_;
		FtSessionProgressBarSegment* _tmp2_;
		FtSessionProgressBarSegment* _tmp3_;
		GtkWidget* _tmp4_;
		_tmp1_ = segment;
		if (!(_tmp1_ != NULL)) {
			break;
		}
		_tmp2_ = segment;
		ft_session_progress_bar_segment_finish_value_animation (_tmp2_);
		_tmp3_ = segment;
		_tmp4_ = gtk_widget_get_next_sibling ((GtkWidget*) _tmp3_);
		segment = G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, FT_SESSION_PROGRESS_BAR_TYPE_SEGMENT, FtSessionProgressBarSegment);
	}
}

static void
ft_session_progress_bar_on_value_animation_done (FtSessionProgressBar* self)
{
	g_return_if_fail (self != NULL);
	_g_object_unref0 (self->priv->value_animation);
	self->priv->value_animation = NULL;
	ft_session_progress_bar_finish_value_animation (self);
}

static Block14Data*
block14_data_ref (Block14Data* _data14_)
{
	g_atomic_int_inc (&_data14_->_ref_count_);
	return _data14_;
}

static void
block14_data_unref (void * _userdata_)
{
	Block14Data* _data14_;
	_data14_ = (Block14Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data14_->_ref_count_)) {
		FtSessionProgressBar* self;
		self = _data14_->self;
		_g_object_unref0 (_data14_->segment);
		_g_object_unref0 (self);
		g_slice_free (Block14Data, _data14_);
	}
}

static void
__lambda44_ (Block14Data* _data14_,
             gdouble position)
{
	FtSessionProgressBar* self;
	self = _data14_->self;
	while (TRUE) {
		FtSessionProgressBarSegment* _tmp0_;
		gboolean _tmp1_ = FALSE;
		gboolean _tmp9_ = FALSE;
		FtSessionProgressBarSegment* _tmp17_;
		FtSessionProgressBarSegment* _tmp18_;
		gfloat segment_position_from = 0.0F;
		FtSessionProgressBarSegment* _tmp20_;
		gfloat _tmp21_;
		gfloat _tmp22_;
		FtSessionProgressBarSegment* _tmp23_;
		gfloat _tmp24_;
		gfloat _tmp25_;
		FtSessionProgressBarSegment* _tmp26_;
		gfloat segment_position_to = 0.0F;
		FtSessionProgressBarSegment* _tmp27_;
		gfloat _tmp28_;
		gfloat _tmp29_;
		FtSessionProgressBarSegment* _tmp30_;
		gfloat _tmp31_;
		gfloat _tmp32_;
		FtSessionProgressBarSegment* _tmp33_;
		gfloat progress = 0.0F;
		FtSessionProgressBarSegment* _tmp34_;
		_tmp0_ = _data14_->segment;
		if (!(_tmp0_ != NULL)) {
			break;
		}
		if (!_data14_->is_forward) {
			FtSessionProgressBarSegment* _tmp2_;
			gfloat _tmp3_;
			gfloat _tmp4_;
			_tmp2_ = _data14_->segment;
			_tmp3_ = ft_session_progress_bar_segment_get_span_start (_tmp2_);
			_tmp4_ = _tmp3_;
			_tmp1_ = position < ((gdouble) _tmp4_);
		} else {
			_tmp1_ = FALSE;
		}
		if (_tmp1_) {
			FtSessionProgressBarSegment* _tmp5_;
			FtSessionProgressBarSegment* _tmp6_;
			GtkWidget* _tmp7_;
			FtSessionProgressBarSegment* _tmp8_;
			_tmp5_ = _data14_->segment;
			ft_session_progress_bar_segment_set_value_animation_progress (_tmp5_, 1.0f);
			_tmp6_ = _data14_->segment;
			_tmp7_ = gtk_widget_get_prev_sibling ((GtkWidget*) _tmp6_);
			_tmp8_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, FT_SESSION_PROGRESS_BAR_TYPE_SEGMENT, FtSessionProgressBarSegment));
			_g_object_unref0 (_data14_->segment);
			_data14_->segment = _tmp8_;
			continue;
		}
		if (_data14_->is_forward) {
			FtSessionProgressBarSegment* _tmp10_;
			gfloat _tmp11_;
			gfloat _tmp12_;
			_tmp10_ = _data14_->segment;
			_tmp11_ = ft_session_progress_bar_segment_get_span_end (_tmp10_);
			_tmp12_ = _tmp11_;
			_tmp9_ = position > ((gdouble) _tmp12_);
		} else {
			_tmp9_ = FALSE;
		}
		if (_tmp9_) {
			FtSessionProgressBarSegment* _tmp13_;
			FtSessionProgressBarSegment* _tmp14_;
			GtkWidget* _tmp15_;
			FtSessionProgressBarSegment* _tmp16_;
			_tmp13_ = _data14_->segment;
			ft_session_progress_bar_segment_set_value_animation_progress (_tmp13_, 1.0f);
			_tmp14_ = _data14_->segment;
			_tmp15_ = gtk_widget_get_next_sibling ((GtkWidget*) _tmp14_);
			_tmp16_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, FT_SESSION_PROGRESS_BAR_TYPE_SEGMENT, FtSessionProgressBarSegment));
			_g_object_unref0 (_data14_->segment);
			_data14_->segment = _tmp16_;
			continue;
		}
		_tmp17_ = _data14_->segment;
		_tmp18_ = _data14_->segment;
		if (_tmp17_->display_value_from == _tmp18_->display_value_to) {
			FtSessionProgressBarSegment* _tmp19_;
			_tmp19_ = _data14_->segment;
			ft_session_progress_bar_segment_set_value_animation_progress (_tmp19_, 1.0f);
			break;
		}
		_tmp20_ = _data14_->segment;
		_tmp21_ = ft_session_progress_bar_segment_get_span_start (_tmp20_);
		_tmp22_ = _tmp21_;
		_tmp23_ = _data14_->segment;
		_tmp24_ = ft_session_progress_bar_segment_get_span_end (_tmp23_);
		_tmp25_ = _tmp24_;
		_tmp26_ = _data14_->segment;
		segment_position_from = ft_lerpf (_tmp22_, _tmp25_, _tmp26_->display_value_from);
		_tmp27_ = _data14_->segment;
		_tmp28_ = ft_session_progress_bar_segment_get_span_start (_tmp27_);
		_tmp29_ = _tmp28_;
		_tmp30_ = _data14_->segment;
		_tmp31_ = ft_session_progress_bar_segment_get_span_end (_tmp30_);
		_tmp32_ = _tmp31_;
		_tmp33_ = _data14_->segment;
		segment_position_to = ft_lerpf (_tmp29_, _tmp32_, _tmp33_->display_value_to);
		progress = (((gfloat) position) - segment_position_from) / (segment_position_to - segment_position_from);
		_tmp34_ = _data14_->segment;
		ft_session_progress_bar_segment_set_value_animation_progress (_tmp34_, CLAMP (progress, 0.0f, 1.0f));
		break;
	}
}

static void
___lambda44__adw_animation_target_func (gdouble value,
                                        gpointer self)
{
	__lambda44_ (self, value);
}

static void
_ft_session_progress_bar_on_value_animation_done_adw_animation_done (AdwAnimation* _sender,
                                                                     gpointer self)
{
	ft_session_progress_bar_on_value_animation_done ((FtSessionProgressBar*) self);
}

static void
ft_session_progress_bar_animate_value (FtSessionProgressBar* self,
                                       gfloat position_from,
                                       gfloat position_to)
{
	Block14Data* _data14_;
	gboolean _tmp0_ = FALSE;
	AdwTimedAnimation* _tmp1_;
	FtSessionProgressBarSegment* _tmp3_;
	FtSessionProgressBarSegment* _tmp4_;
	gfloat scale = 0.0F;
	FtSessionProgressBarSegment* _tmp5_;
	guint animation_duration = 0U;
	AdwCallbackAnimationTarget* animation_target = NULL;
	AdwCallbackAnimationTarget* _tmp6_;
	AdwCallbackAnimationTarget* _tmp7_;
	AdwAnimationTarget* _tmp8_;
	AdwTimedAnimation* _tmp9_;
	AdwTimedAnimation* _tmp10_;
	AdwTimedAnimation* _tmp11_;
	AdwTimedAnimation* _tmp12_;
	g_return_if_fail (self != NULL);
	_vala_return_if_fail (isfinite (position_from), "position_from.is_finite ()");
	_vala_return_if_fail (isfinite (position_to), "position_to.is_finite ()");
	_data14_ = g_slice_new0 (Block14Data);
	_data14_->_ref_count_ = 1;
	_data14_->self = g_object_ref (self);
	if (!gtk_widget_get_mapped ((GtkWidget*) self)) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = fabsf (position_to - position_from) < 0.01f;
	}
	if (_tmp0_) {
		block14_data_unref (_data14_);
		_data14_ = NULL;
		return;
	}
	_tmp1_ = self->priv->value_animation;
	if (_tmp1_ != NULL) {
		AdwTimedAnimation* _tmp2_;
		_tmp2_ = self->priv->value_animation;
		adw_animation_pause ((AdwAnimation*) _tmp2_);
		_g_object_unref0 (self->priv->value_animation);
		self->priv->value_animation = NULL;
	}
	_tmp3_ = ft_session_progress_bar_get_current_segment (self);
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_data14_->segment = _tmp4_;
	scale = ft_session_progress_bar_get_current_scale (self);
	_data14_->is_forward = position_from < position_to;
	_tmp5_ = _data14_->segment;
	if (_tmp5_ == NULL) {
		g_debug ("session-progress-bar.vala:1110: Unable to animate value from %.3f to %" \
".3f", (gdouble) position_from, (gdouble) position_to);
		block14_data_unref (_data14_);
		_data14_ = NULL;
		return;
	}
	animation_duration = (guint) (sqrt (((gdouble) fabsf (position_to - position_from)) / ((gdouble) scale)) * ((gdouble) FT_SESSION_PROGRESS_BAR_VALUE_ANIMATION_DURATION));
	_tmp6_ = (AdwCallbackAnimationTarget*) adw_callback_animation_target_new (___lambda44__adw_animation_target_func, block14_data_ref (_data14_), block14_data_unref);
	animation_target = _tmp6_;
	ft_session_progress_bar_prepare_value_animation (self, position_from, position_to);
	_tmp7_ = animation_target;
	_tmp8_ = _g_object_ref0 ((AdwAnimationTarget*) _tmp7_);
	_tmp9_ = (AdwTimedAnimation*) adw_timed_animation_new ((GtkWidget*) self, (gdouble) position_from, (gdouble) position_to, animation_duration, _tmp8_);
	_g_object_unref0 (self->priv->value_animation);
	self->priv->value_animation = _tmp9_;
	_tmp10_ = self->priv->value_animation;
	adw_timed_animation_set_easing (_tmp10_, ADW_EASE_OUT_QUAD);
	_tmp11_ = self->priv->value_animation;
	g_signal_connect_object ((AdwAnimation*) _tmp11_, "done", (GCallback) _ft_session_progress_bar_on_value_animation_done_adw_animation_done, self, 0);
	_tmp12_ = self->priv->value_animation;
	adw_animation_play ((AdwAnimation*) _tmp12_);
	_g_object_unref0 (animation_target);
	block14_data_unref (_data14_);
	_data14_ = NULL;
}

static Block15Data*
block15_data_ref (Block15Data* _data15_)
{
	g_atomic_int_inc (&_data15_->_ref_count_);
	return _data15_;
}

static void
block15_data_unref (void * _userdata_)
{
	Block15Data* _data15_;
	_data15_ = (Block15Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data15_->_ref_count_)) {
		FtSessionProgressBar* self;
		self = _data15_->self;
		_g_object_unref0 (_data15_->segment);
		_g_object_unref0 (self);
		g_slice_free (Block15Data, _data15_);
	}
}

static void
____lambda43_ (Block15Data* _data15_,
               gdouble value)
{
	FtSessionProgressBar* self;
	FtSessionProgressBarSegment* _tmp0_;
	self = _data15_->self;
	_tmp0_ = _data15_->segment;
	ft_session_progress_bar_segment_set_weight (_tmp0_, (gfloat) value);
	ft_session_progress_bar_update_segments_span (self);
}

static void
_____lambda43__adw_animation_target_func (gdouble value,
                                          gpointer self)
{
	____lambda43_ (self, value);
}

static void
ft_session_progress_bar_animate_weights (FtSessionProgressBar* self)
{
	Block15Data* _data15_;
	GtkWidget* _tmp0_;
	FtSessionProgressBarSegment* _tmp1_;
	g_return_if_fail (self != NULL);
	_data15_ = g_slice_new0 (Block15Data);
	_data15_->_ref_count_ = 1;
	_data15_->self = g_object_ref (self);
	_tmp0_ = gtk_widget_get_first_child ((GtkWidget*) self);
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, FT_SESSION_PROGRESS_BAR_TYPE_SEGMENT, FtSessionProgressBarSegment));
	_data15_->segment = _tmp1_;
	while (TRUE) {
		FtSessionProgressBarSegment* _tmp2_;
		gfloat _tmp3_ = 0.0F;
		FtSessionProgressBarSegment* _tmp4_;
		FtCycle* _tmp5_;
		FtCycle* _tmp6_;
		gfloat weight = 0.0F;
		FtSessionProgressBarSegment* _tmp13_;
		gfloat _tmp14_;
		gfloat _tmp15_;
		FtSessionProgressBarSegment* _tmp23_;
		GtkWidget* _tmp24_;
		FtSessionProgressBarSegment* _tmp25_;
		_tmp2_ = _data15_->segment;
		if (!(_tmp2_ != NULL)) {
			break;
		}
		_tmp4_ = _data15_->segment;
		_tmp5_ = ft_session_progress_bar_segment_get_cycle (_tmp4_);
		_tmp6_ = _tmp5_;
		if (_tmp6_ != NULL) {
			FtSessionProgressBarSegment* _tmp7_;
			FtCycle* _tmp8_;
			FtCycle* _tmp9_;
			_tmp7_ = _data15_->segment;
			_tmp8_ = ft_session_progress_bar_segment_get_cycle (_tmp7_);
			_tmp9_ = _tmp8_;
			_tmp3_ = (gfloat) ft_cycle_get_weight (_tmp9_);
		} else {
			FtSessionProgressBarSegment* _tmp10_;
			gfloat _tmp11_;
			gfloat _tmp12_;
			_tmp10_ = _data15_->segment;
			_tmp11_ = ft_session_progress_bar_segment_get_weight (_tmp10_);
			_tmp12_ = _tmp11_;
			_tmp3_ = _tmp12_;
		}
		weight = _tmp3_;
		_tmp13_ = _data15_->segment;
		_tmp14_ = ft_session_progress_bar_segment_get_weight (_tmp13_);
		_tmp15_ = _tmp14_;
		if (weight != _tmp15_) {
			AdwCallbackAnimationTarget* animation_target = NULL;
			AdwCallbackAnimationTarget* _tmp16_;
			FtSessionProgressBarSegment* _tmp17_;
			FtSessionProgressBarSegment* _tmp18_;
			gfloat _tmp19_;
			gfloat _tmp20_;
			AdwCallbackAnimationTarget* _tmp21_;
			AdwCallbackAnimationTarget* _tmp22_;
			_tmp16_ = (AdwCallbackAnimationTarget*) adw_callback_animation_target_new (_____lambda43__adw_animation_target_func, block15_data_ref (_data15_), block15_data_unref);
			animation_target = _tmp16_;
			_tmp17_ = _data15_->segment;
			_tmp18_ = _data15_->segment;
			_tmp19_ = ft_session_progress_bar_segment_get_weight (_tmp18_);
			_tmp20_ = _tmp19_;
			_tmp21_ = animation_target;
			_tmp22_ = _g_object_ref0 (_tmp21_);
			ft_session_progress_bar_segment_animate_weight (_tmp17_, _tmp20_, weight, _tmp22_);
			_g_object_unref0 (animation_target);
			break;
		}
		_tmp23_ = _data15_->segment;
		_tmp24_ = gtk_widget_get_next_sibling ((GtkWidget*) _tmp23_);
		_tmp25_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, FT_SESSION_PROGRESS_BAR_TYPE_SEGMENT, FtSessionProgressBarSegment));
		_g_object_unref0 (_data15_->segment);
		_data15_->segment = _tmp25_;
	}
	block15_data_unref (_data15_);
	_data15_ = NULL;
}

static void
ft_session_progress_bar_on_opacity_animation_done (FtSessionProgressBar* self)
{
	g_return_if_fail (self != NULL);
	_g_object_unref0 (self->priv->opacity_animation);
	self->priv->opacity_animation = NULL;
	self->priv->revealing = FALSE;
}

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

static void
_ft_session_progress_bar_on_opacity_animation_done_adw_animation_done (AdwAnimation* _sender,
                                                                       gpointer self)
{
	ft_session_progress_bar_on_opacity_animation_done ((FtSessionProgressBar*) self);
}

static void
ft_session_progress_bar_fade_in_internal (FtSessionProgressBar* self)
{
	gdouble _tmp0_ = 0.0;
	AdwTimedAnimation* _tmp1_;
	gdouble opacity_from = 0.0;
	gdouble opacity_to = 0.0;
	AdwTimedAnimation* _tmp5_;
	AdwCallbackAnimationTarget* animation_target = NULL;
	AdwCallbackAnimationTarget* _tmp7_;
	AdwCallbackAnimationTarget* _tmp8_;
	AdwAnimationTarget* _tmp9_;
	AdwTimedAnimation* _tmp10_;
	AdwTimedAnimation* _tmp11_;
	AdwTimedAnimation* _tmp12_;
	AdwTimedAnimation* _tmp13_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->opacity_animation;
	if (_tmp1_ != NULL) {
		AdwTimedAnimation* _tmp2_;
		gdouble _tmp3_;
		gdouble _tmp4_;
		_tmp2_ = self->priv->opacity_animation;
		_tmp3_ = adw_animation_get_value ((AdwAnimation*) _tmp2_);
		_tmp4_ = _tmp3_;
		_tmp0_ = _tmp4_;
	} else {
		_tmp0_ = 0.0;
	}
	opacity_from = _tmp0_;
	opacity_to = 1.0;
	if (!self->priv->_reveal) {
		return;
	}
	_tmp5_ = self->priv->opacity_animation;
	if (_tmp5_ != NULL) {
		AdwTimedAnimation* _tmp6_;
		_tmp6_ = self->priv->opacity_animation;
		adw_animation_pause ((AdwAnimation*) _tmp6_);
		_g_object_unref0 (self->priv->opacity_animation);
		self->priv->opacity_animation = NULL;
	}
	_tmp7_ = (AdwCallbackAnimationTarget*) adw_callback_animation_target_new (_gtk_widget_queue_draw_adw_animation_target_func, g_object_ref ((GtkWidget*) self), g_object_unref);
	animation_target = _tmp7_;
	_tmp8_ = animation_target;
	_tmp9_ = _g_object_ref0 ((AdwAnimationTarget*) _tmp8_);
	_tmp10_ = (AdwTimedAnimation*) adw_timed_animation_new ((GtkWidget*) self, opacity_from, opacity_to, FT_SESSION_PROGRESS_BAR_FADE_IN_DURATION, _tmp9_);
	_g_object_unref0 (self->priv->opacity_animation);
	self->priv->opacity_animation = _tmp10_;
	_tmp11_ = self->priv->opacity_animation;
	adw_timed_animation_set_easing (_tmp11_, ADW_EASE_OUT_QUAD);
	_tmp12_ = self->priv->opacity_animation;
	g_signal_connect_object ((AdwAnimation*) _tmp12_, "done", (GCallback) _ft_session_progress_bar_on_opacity_animation_done_adw_animation_done, self, 0);
	_tmp13_ = self->priv->opacity_animation;
	adw_animation_play ((AdwAnimation*) _tmp13_);
	_g_object_unref0 (animation_target);
}

static void
ft_session_progress_bar_fade_in (FtSessionProgressBar* self)
{
	g_return_if_fail (self != NULL);
	if (self->priv->_reveal) {
		return;
	}
	self->priv->_reveal = TRUE;
	self->priv->revealing = TRUE;
	g_object_notify ((GObject*) self, "reveal");
	if (gtk_widget_get_mapped ((GtkWidget*) self)) {
		ft_session_progress_bar_fade_in_internal (self);
	}
}

static void
ft_session_progress_bar_fade_out (FtSessionProgressBar* self)
{
	gdouble _tmp0_ = 0.0;
	AdwTimedAnimation* _tmp1_;
	gdouble opacity_from = 0.0;
	gdouble opacity_to = 0.0;
	AdwTimedAnimation* _tmp5_;
	g_return_if_fail (self != NULL);
	if (!self->priv->_reveal) {
		return;
	}
	_tmp1_ = self->priv->opacity_animation;
	if (_tmp1_ != NULL) {
		AdwTimedAnimation* _tmp2_;
		gdouble _tmp3_;
		gdouble _tmp4_;
		_tmp2_ = self->priv->opacity_animation;
		_tmp3_ = adw_animation_get_value ((AdwAnimation*) _tmp2_);
		_tmp4_ = _tmp3_;
		_tmp0_ = _tmp4_;
	} else {
		_tmp0_ = 1.0;
	}
	opacity_from = _tmp0_;
	opacity_to = 0.0;
	self->priv->_reveal = FALSE;
	self->priv->revealing = FALSE;
	g_object_notify ((GObject*) self, "reveal");
	_tmp5_ = self->priv->opacity_animation;
	if (_tmp5_ != NULL) {
		AdwTimedAnimation* _tmp6_;
		_tmp6_ = self->priv->opacity_animation;
		adw_animation_pause ((AdwAnimation*) _tmp6_);
		_g_object_unref0 (self->priv->opacity_animation);
		self->priv->opacity_animation = NULL;
	}
	if (gtk_widget_get_mapped ((GtkWidget*) self)) {
		AdwCallbackAnimationTarget* animation_target = NULL;
		AdwCallbackAnimationTarget* _tmp7_;
		AdwCallbackAnimationTarget* _tmp8_;
		AdwAnimationTarget* _tmp9_;
		AdwTimedAnimation* _tmp10_;
		AdwTimedAnimation* _tmp11_;
		AdwTimedAnimation* _tmp12_;
		AdwTimedAnimation* _tmp13_;
		_tmp7_ = (AdwCallbackAnimationTarget*) adw_callback_animation_target_new (_gtk_widget_queue_draw_adw_animation_target_func, g_object_ref ((GtkWidget*) self), g_object_unref);
		animation_target = _tmp7_;
		_tmp8_ = animation_target;
		_tmp9_ = _g_object_ref0 ((AdwAnimationTarget*) _tmp8_);
		_tmp10_ = (AdwTimedAnimation*) adw_timed_animation_new ((GtkWidget*) self, opacity_from, opacity_to, FT_SESSION_PROGRESS_BAR_FADE_OUT_DURATION, _tmp9_);
		_g_object_unref0 (self->priv->opacity_animation);
		self->priv->opacity_animation = _tmp10_;
		_tmp11_ = self->priv->opacity_animation;
		adw_timed_animation_set_easing (_tmp11_, ADW_EASE_OUT_QUAD);
		_tmp12_ = self->priv->opacity_animation;
		g_signal_connect_object ((AdwAnimation*) _tmp12_, "done", (GCallback) _ft_session_progress_bar_on_opacity_animation_done_adw_animation_done, self, 0);
		_tmp13_ = self->priv->opacity_animation;
		adw_animation_play ((AdwAnimation*) _tmp13_);
		_g_object_unref0 (animation_target);
	} else {
		ft_session_progress_bar_on_opacity_animation_done (self);
	}
}

static void
ft_session_progress_bar_on_session_changed (FtSessionProgressBar* self,
                                            FtSession* session)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (session != NULL);
	ft_session_progress_bar_queue_update (self);
}

/**
         * Timer state may change after rescheduling / updating segments.
         * Keep the current segment's timeout in sync.
         */
static void
ft_session_progress_bar_on_timer_state_changed (FtSessionProgressBar* self,
                                                const FtTimerState* current_state,
                                                const FtTimerState* previous_state)
{
	FtSessionProgressBarSegment* segment = NULL;
	GtkWidget* _tmp0_;
	FtTimeBlock* current_time_block = NULL;
	FtTimerState _tmp1_;
	void* _tmp2_;
	FtTimeBlock* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (current_state != NULL);
	g_return_if_fail (previous_state != NULL);
	_tmp0_ = gtk_widget_get_first_child ((GtkWidget*) self);
	segment = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, FT_SESSION_PROGRESS_BAR_TYPE_SEGMENT, FtSessionProgressBarSegment);
	_tmp1_ = *current_state;
	_tmp2_ = _tmp1_.user_data;
	current_time_block = G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, FT_TYPE_TIME_BLOCK, FtTimeBlock);
	_tmp3_ = current_time_block;
	if (_tmp3_ == NULL) {
		return;
	}
	while (TRUE) {
		FtSessionProgressBarSegment* _tmp4_;
		gboolean _tmp5_ = FALSE;
		FtSessionProgressBarSegment* _tmp6_;
		FtCycle* _tmp7_;
		FtCycle* _tmp8_;
		FtSessionProgressBarSegment* _tmp14_;
		GtkWidget* _tmp15_;
		_tmp4_ = segment;
		if (!(_tmp4_ != NULL)) {
			break;
		}
		_tmp6_ = segment;
		_tmp7_ = ft_session_progress_bar_segment_get_cycle (_tmp6_);
		_tmp8_ = _tmp7_;
		if (_tmp8_ != NULL) {
			FtSessionProgressBarSegment* _tmp9_;
			FtCycle* _tmp10_;
			FtCycle* _tmp11_;
			FtTimeBlock* _tmp12_;
			_tmp9_ = segment;
			_tmp10_ = ft_session_progress_bar_segment_get_cycle (_tmp9_);
			_tmp11_ = _tmp10_;
			_tmp12_ = current_time_block;
			_tmp5_ = ft_cycle_contains (_tmp11_, _tmp12_);
		} else {
			_tmp5_ = FALSE;
		}
		if (_tmp5_) {
			FtSessionProgressBarSegment* _tmp13_;
			_tmp13_ = segment;
			ft_session_progress_bar_segment_update_timeout (_tmp13_);
			break;
		}
		_tmp14_ = segment;
		_tmp15_ = gtk_widget_get_next_sibling ((GtkWidget*) _tmp14_);
		segment = G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, FT_SESSION_PROGRESS_BAR_TYPE_SEGMENT, FtSessionProgressBarSegment);
	}
}

static void
_ft_session_progress_bar_on_timer_state_changed_ft_timer_state_changed (FtTimer* _sender,
                                                                        const FtTimerState* current_state,
                                                                        const FtTimerState* previous_state,
                                                                        gpointer self)
{
	ft_session_progress_bar_on_timer_state_changed ((FtSessionProgressBar*) self, current_state, previous_state);
}

static void
ft_session_progress_bar_real_map (GtkWidget* base)
{
	FtSessionProgressBar * self;
	FtTimer* _tmp0_;
	self = (FtSessionProgressBar*) base;
	ft_session_progress_bar_update (self);
	_tmp0_ = self->priv->_timer;
	g_signal_connect_object (_tmp0_, "state-changed", (GCallback) _ft_session_progress_bar_on_timer_state_changed_ft_timer_state_changed, self, 0);
	GTK_WIDGET_CLASS (ft_session_progress_bar_parent_class)->map (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	if (self->priv->revealing) {
		ft_session_progress_bar_fade_in_internal (self);
	}
}

static void
ft_session_progress_bar_real_unmap (GtkWidget* base)
{
	FtSessionProgressBar * self;
	AdwTimedAnimation* _tmp0_;
	AdwTimedAnimation* _tmp2_;
	FtTimer* _tmp4_;
	guint _tmp5_;
	self = (FtSessionProgressBar*) base;
	GTK_WIDGET_CLASS (ft_session_progress_bar_parent_class)->unmap (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	_tmp0_ = self->priv->scale_animation;
	if (_tmp0_ != NULL) {
		AdwTimedAnimation* _tmp1_;
		_tmp1_ = self->priv->scale_animation;
		adw_animation_pause ((AdwAnimation*) _tmp1_);
		_g_object_unref0 (self->priv->scale_animation);
		self->priv->scale_animation = NULL;
	}
	_tmp2_ = self->priv->opacity_animation;
	if (_tmp2_ != NULL) {
		AdwTimedAnimation* _tmp3_;
		_tmp3_ = self->priv->opacity_animation;
		adw_animation_pause ((AdwAnimation*) _tmp3_);
		_g_object_unref0 (self->priv->opacity_animation);
		self->priv->opacity_animation = NULL;
	}
	if (self->priv->tick_callback_id != ((guint) 0)) {
		gtk_widget_remove_tick_callback ((GtkWidget*) self, self->priv->tick_callback_id);
		self->priv->tick_callback_id = (guint) 0;
	}
	_tmp4_ = self->priv->_timer;
	g_signal_parse_name ("state-changed", FT_TYPE_TIMER, &_tmp5_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp4_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp5_, 0, NULL, (GCallback) _ft_session_progress_bar_on_timer_state_changed_ft_timer_state_changed, self);
	ft_session_progress_bar_remove_segments (self);
}

static GtkSizeRequestMode
ft_session_progress_bar_real_get_request_mode (GtkWidget* base)
{
	FtSessionProgressBar * self;
	GtkSizeRequestMode result;
	self = (FtSessionProgressBar*) base;
	result = GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH;
	return result;
}

static void
ft_session_progress_bar_real_measure (GtkWidget* base,
                                      GtkOrientation orientation,
                                      gint for_size,
                                      gint* minimum,
                                      gint* natural,
                                      gint* minimum_baseline,
                                      gint* natural_baseline)
{
	FtSessionProgressBar * self;
	gint _vala_minimum = 0;
	gint _vala_natural = 0;
	gint _vala_minimum_baseline = 0;
	gint _vala_natural_baseline = 0;
	gint line_width = 0;
	self = (FtSessionProgressBar*) base;
	line_width = (gint) ceilf (self->priv->_line_width);
	if (orientation == GTK_ORIENTATION_HORIZONTAL) {
		_vala_minimum = MAX (line_width, FT_SESSION_PROGRESS_BAR_MIN_WIDTH);
		_vala_natural = MAX (_vala_minimum, for_size);
	} else {
		_vala_minimum = line_width;
		_vala_natural = _vala_minimum;
	}
	_vala_minimum_baseline = -1;
	_vala_natural_baseline = -1;
	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;
	}
}

/**
         * All children have same allocation. This way animations can be a little smoother.
         */
static void
ft_session_progress_bar_real_size_allocate (GtkWidget* base,
                                            gint width,
                                            gint height,
                                            gint baseline)
{
	FtSessionProgressBar * self;
	GtkAllocation allocation = {0};
	GtkAllocation _tmp0_ = {0};
	GtkWidget* child = NULL;
	GtkWidget* _tmp1_;
	self = (FtSessionProgressBar*) base;
	memset (&_tmp0_, 0, sizeof (GtkAllocation));
	_tmp0_.x = 0;
	_tmp0_.y = 0;
	_tmp0_.width = width;
	_tmp0_.height = height;
	allocation = _tmp0_;
	_tmp1_ = gtk_widget_get_first_child ((GtkWidget*) self);
	child = _tmp1_;
	while (TRUE) {
		GtkWidget* _tmp2_;
		GtkWidget* _tmp3_;
		GtkAllocation _tmp4_;
		GtkWidget* _tmp5_;
		GtkWidget* _tmp6_;
		_tmp2_ = child;
		if (!(_tmp2_ != NULL)) {
			break;
		}
		_tmp3_ = child;
		_tmp4_ = allocation;
		gtk_widget_size_allocate (_tmp3_, &_tmp4_, baseline);
		_tmp5_ = child;
		_tmp6_ = gtk_widget_get_next_sibling (_tmp5_);
		child = _tmp6_;
	}
}

static void
ft_session_progress_bar_real_snapshot (GtkWidget* base,
                                       GtkSnapshot* snapshot)
{
	FtSessionProgressBar * self;
	gfloat width = 0.0F;
	gfloat height = 0.0F;
	gboolean fade_applied = FALSE;
	AdwTimedAnimation* _tmp0_;
	AdwTimedAnimation* _tmp23_;
	self = (FtSessionProgressBar*) base;
	g_return_if_fail (snapshot != NULL);
	width = (gfloat) gtk_widget_get_width ((GtkWidget*) self);
	height = (gfloat) gtk_widget_get_height ((GtkWidget*) self);
	fade_applied = FALSE;
	_tmp0_ = self->priv->scale_animation;
	if (_tmp0_ != NULL) {
		gdouble scale = 0.0;
		AdwTimedAnimation* _tmp1_;
		gdouble _tmp2_;
		gdouble _tmp3_;
		gdouble norm = 0.0;
		AdwTimedAnimation* _tmp4_;
		gdouble _tmp5_;
		gdouble _tmp6_;
		gdouble norm_from = 0.0;
		AdwTimedAnimation* _tmp7_;
		gdouble _tmp8_;
		gdouble _tmp9_;
		gdouble norm_to = 0.0;
		AdwTimedAnimation* _tmp10_;
		gdouble _tmp11_;
		gdouble _tmp12_;
		gfloat fade_x = 0.0F;
		gdouble fade_progress = 0.0;
		gfloat _tmp13_ = 0.0F;
		gfloat fade_opacity = 0.0F;
		_tmp1_ = self->priv->scale_animation;
		_tmp2_ = adw_animation_get_value ((AdwAnimation*) _tmp1_);
		_tmp3_ = _tmp2_;
		scale = _tmp3_;
		_tmp4_ = self->priv->scale_animation;
		_tmp5_ = adw_animation_get_value ((AdwAnimation*) _tmp4_);
		_tmp6_ = _tmp5_;
		norm = 1.0 / _tmp6_;
		_tmp7_ = self->priv->scale_animation;
		_tmp8_ = adw_timed_animation_get_value_from (_tmp7_);
		_tmp9_ = _tmp8_;
		norm_from = 1.0 / _tmp9_;
		_tmp10_ = self->priv->scale_animation;
		_tmp11_ = adw_timed_animation_get_value_to (_tmp10_);
		_tmp12_ = _tmp11_;
		norm_to = 1.0 / _tmp12_;
		fade_x = width * ((gfloat) (MIN (norm_from, norm_to) * scale));
		fade_progress = (norm - norm_from) / (norm_to - norm_from);
		if (norm_from >= norm_to) {
			_tmp13_ = (gfloat) fade_progress;
		} else {
			_tmp13_ = (gfloat) (1.0 - fade_progress);
		}
		fade_opacity = _tmp13_;
		if (fade_x < width) {
			graphene_rect_t fade_bounds = {0};
			graphene_rect_t _tmp14_;
			graphene_point_t _tmp15_ = {0};
			graphene_point_t _tmp16_ = {0};
			GdkRGBA _tmp17_ = {0};
			GskColorStop _tmp18_ = {0};
			GdkRGBA _tmp19_ = {0};
			GskColorStop _tmp20_ = {0};
			GskColorStop* _tmp21_;
			GskColorStop* _tmp22_;
			gint _tmp22__length1;
			memset (&fade_bounds, 0, sizeof (graphene_rect_t));
			graphene_rect_init (&fade_bounds, fade_x, 0.0f, width - fade_x, height);
			gtk_snapshot_push_mask (snapshot, GSK_MASK_MODE_INVERTED_ALPHA);
			_tmp14_ = fade_bounds;
			_tmp15_.x = width;
			_tmp15_.y = 0.0f;
			_tmp16_.x = fade_x;
			_tmp16_.y = 0.0f;
			_tmp17_.red = 0.0f;
			_tmp17_.green = 0.0f;
			_tmp17_.blue = 0.0f;
			_tmp17_.alpha = fade_opacity;
			memset (&_tmp18_, 0, sizeof (GskColorStop));
			_tmp18_.offset = 0.0f;
			_tmp18_.color = _tmp17_;
			_tmp19_.red = 0.0f;
			_tmp19_.green = 0.0f;
			_tmp19_.blue = 0.0f;
			_tmp19_.alpha = 0.0f;
			memset (&_tmp20_, 0, sizeof (GskColorStop));
			_tmp20_.offset = 1.0f;
			_tmp20_.color = _tmp19_;
			_tmp21_ = g_new0 (GskColorStop, 2);
			_tmp21_[0] = _tmp18_;
			_tmp21_[1] = _tmp20_;
			_tmp22_ = _tmp21_;
			_tmp22__length1 = 2;
			gtk_snapshot_append_linear_gradient (snapshot, &_tmp14_, &_tmp15_, &_tmp16_, _tmp22_, (gsize) 2);
			_tmp22_ = (g_free (_tmp22_), NULL);
			gtk_snapshot_pop (snapshot);
			fade_applied = TRUE;
		}
	}
	_tmp23_ = self->priv->opacity_animation;
	if (_tmp23_ != NULL) {
		AdwTimedAnimation* _tmp24_;
		gdouble _tmp25_;
		gdouble _tmp26_;
		_tmp24_ = self->priv->opacity_animation;
		_tmp25_ = adw_animation_get_value ((AdwAnimation*) _tmp24_);
		_tmp26_ = _tmp25_;
		gtk_snapshot_push_opacity (snapshot, _tmp26_);
		ft_session_progress_bar_snapshot_segments (self, snapshot);
		gtk_snapshot_pop (snapshot);
	} else {
		if (self->priv->_reveal) {
			ft_session_progress_bar_snapshot_segments (self, snapshot);
		}
	}
	if (fade_applied) {
		gtk_snapshot_pop (snapshot);
	}
}

static gboolean
ft_session_progress_bar_real_query_tooltip (GtkWidget* base,
                                            gint x,
                                            gint y,
                                            gboolean keyboard_tooltip,
                                            GtkTooltip* tooltip)
{
	FtSessionProgressBar * self;
	gint64 timestamp = 0LL;
	FtTimer* _tmp0_;
	FtTimer* _tmp1_;
	gint64 _tmp2_ = 0LL;
	gboolean _tmp3_ = FALSE;
	FtTimer* _tmp4_;
	gint64 remaining = 0LL;
	gboolean result;
	self = (FtSessionProgressBar*) base;
	g_return_val_if_fail (tooltip != NULL, FALSE);
	_tmp0_ = self->priv->_timer;
	_tmp1_ = self->priv->_timer;
	timestamp = MAX (ft_timer_get_last_state_changed_time (_tmp0_), ft_timer_get_last_tick_time (_tmp1_));
	_tmp4_ = self->priv->_timer;
	if (ft_timer_is_running (_tmp4_)) {
		_tmp3_ = ft_timestamp_is_defined (self->priv->long_break_time);
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		_tmp2_ = ft_timestamp_subtract (self->priv->long_break_time, timestamp);
	} else {
		_tmp2_ = (gint64) 0;
	}
	remaining = _tmp2_;
	if (remaining > ((gint64) 0)) {
		gdouble seconds = 0.0;
		guint seconds_uint = 0U;
		gchar* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		seconds = ft_timestamp_to_seconds (remaining);
		seconds_uint = (guint) ft_round_seconds (seconds);
		_tmp5_ = ft_format_time (seconds_uint);
		_tmp6_ = _tmp5_;
		_tmp7_ = g_strdup_printf (_ ("Long break due in <b>%s</b>"), _tmp6_);
		_tmp8_ = _tmp7_;
		gtk_tooltip_set_markup (tooltip, _tmp8_);
		_g_free0 (_tmp8_);
		_g_free0 (_tmp6_);
		result = TRUE;
		return result;
	} else {
		result = GTK_WIDGET_CLASS (ft_session_progress_bar_parent_class)->query_tooltip (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), x, y, keyboard_tooltip, tooltip);
		return result;
	}
}

static void
_ft_session_progress_bar_on_session_changed_ft_session_changed (FtSession* _sender,
                                                                gpointer self)
{
	ft_session_progress_bar_on_session_changed ((FtSessionProgressBar*) self, _sender);
}

static void
ft_session_progress_bar_real_dispose (GObject* base)
{
	FtSessionProgressBar * self;
	AdwTimedAnimation* _tmp0_;
	AdwTimedAnimation* _tmp2_;
	AdwTimedAnimation* _tmp4_;
	FtSession* _tmp6_;
	FtTimer* _tmp9_;
	guint _tmp10_;
	self = (FtSessionProgressBar*) base;
	_tmp0_ = self->priv->scale_animation;
	if (_tmp0_ != NULL) {
		AdwTimedAnimation* _tmp1_;
		_tmp1_ = self->priv->scale_animation;
		adw_animation_pause ((AdwAnimation*) _tmp1_);
		_g_object_unref0 (self->priv->scale_animation);
		self->priv->scale_animation = NULL;
	}
	_tmp2_ = self->priv->opacity_animation;
	if (_tmp2_ != NULL) {
		AdwTimedAnimation* _tmp3_;
		_tmp3_ = self->priv->opacity_animation;
		adw_animation_pause ((AdwAnimation*) _tmp3_);
		_g_object_unref0 (self->priv->opacity_animation);
		self->priv->opacity_animation = NULL;
	}
	_tmp4_ = self->priv->value_animation;
	if (_tmp4_ != NULL) {
		AdwTimedAnimation* _tmp5_;
		_tmp5_ = self->priv->value_animation;
		adw_animation_pause ((AdwAnimation*) _tmp5_);
		_g_object_unref0 (self->priv->value_animation);
		self->priv->value_animation = NULL;
	}
	if (self->priv->tick_callback_id != ((guint) 0)) {
		gtk_widget_remove_tick_callback ((GtkWidget*) self, self->priv->tick_callback_id);
		self->priv->tick_callback_id = (guint) 0;
	}
	_tmp6_ = self->priv->_session;
	if (_tmp6_ != NULL) {
		FtSession* _tmp7_;
		guint _tmp8_;
		_tmp7_ = self->priv->_session;
		g_signal_parse_name ("changed", FT_TYPE_SESSION, &_tmp8_, NULL, FALSE);
		g_signal_handlers_disconnect_matched (_tmp7_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp8_, 0, NULL, (GCallback) _ft_session_progress_bar_on_session_changed_ft_session_changed, self);
	}
	ft_session_progress_bar_remove_segments (self);
	_tmp9_ = self->priv->_timer;
	g_signal_parse_name ("state-changed", FT_TYPE_TIMER, &_tmp10_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp9_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp10_, 0, NULL, (GCallback) _ft_session_progress_bar_on_timer_state_changed_ft_timer_state_changed, self);
	_g_object_unref0 (self->priv->_session_manager);
	self->priv->_session_manager = NULL;
	_g_object_unref0 (self->priv->_timer);
	self->priv->_timer = NULL;
	_g_object_unref0 (self->priv->_session);
	self->priv->_session = NULL;
	self->priv->current_segment = NULL;
	G_OBJECT_CLASS (ft_session_progress_bar_parent_class)->dispose ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
}

FtSessionProgressBar*
ft_session_progress_bar_construct (GType object_type)
{
	FtSessionProgressBar * self = NULL;
	self = (FtSessionProgressBar*) g_object_new (object_type, NULL);
	return self;
}

FtSessionProgressBar*
ft_session_progress_bar_new (void)
{
	return ft_session_progress_bar_construct (FT_TYPE_SESSION_PROGRESS_BAR);
}

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

static void
ft_session_progress_bar_set_timer (FtSessionProgressBar* self,
                                   FtTimer* value)
{
	FtTimer* _tmp0_ = NULL;
	FtTimer* _tmp2_;
	g_return_if_fail (self != NULL);
	if (value != NULL) {
		_tmp0_ = value;
	} else {
		FtTimer* _tmp1_;
		_tmp1_ = ft_timer_get_default ();
		_tmp0_ = _tmp1_;
	}
	_tmp2_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->_timer);
	self->priv->_timer = _tmp2_;
	g_object_notify_by_pspec ((GObject *) self, ft_session_progress_bar_properties[FT_SESSION_PROGRESS_BAR_TIMER_PROPERTY]);
}

FtSessionManager*
ft_session_progress_bar_get_session_manager (FtSessionProgressBar* self)
{
	FtSessionManager* result;
	FtSessionManager* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_session_manager;
	result = _tmp0_;
	return result;
}

static void
ft_session_progress_bar_set_session_manager (FtSessionProgressBar* self,
                                             FtSessionManager* value)
{
	FtSessionManager* _tmp0_ = NULL;
	FtSessionManager* _tmp2_;
	g_return_if_fail (self != NULL);
	if (value != NULL) {
		_tmp0_ = value;
	} else {
		FtSessionManager* _tmp1_;
		_tmp1_ = ft_session_manager_get_default ();
		_tmp0_ = _tmp1_;
	}
	_tmp2_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->_session_manager);
	self->priv->_session_manager = _tmp2_;
	g_object_notify_by_pspec ((GObject *) self, ft_session_progress_bar_properties[FT_SESSION_PROGRESS_BAR_SESSION_MANAGER_PROPERTY]);
}

FtSession*
ft_session_progress_bar_get_session (FtSessionProgressBar* self)
{
	FtSession* result;
	FtSession* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_session;
	result = _tmp0_;
	return result;
}

void
ft_session_progress_bar_set_session (FtSessionProgressBar* self,
                                     FtSession* value)
{
	FtSession* _tmp0_;
	FtSession* _tmp1_;
	FtSession* _tmp4_;
	FtSession* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_session;
	if (_tmp0_ == value) {
		return;
	}
	_tmp1_ = self->priv->_session;
	if (_tmp1_ != NULL) {
		FtSession* _tmp2_;
		guint _tmp3_;
		_tmp2_ = self->priv->_session;
		g_signal_parse_name ("changed", FT_TYPE_SESSION, &_tmp3_, NULL, FALSE);
		g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _ft_session_progress_bar_on_session_changed_ft_session_changed, self);
	}
	_tmp4_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_session);
	self->priv->_session = _tmp4_;
	ft_session_progress_bar_update (self);
	_tmp5_ = self->priv->_session;
	if (_tmp5_ != NULL) {
		FtSession* _tmp6_;
		_tmp6_ = self->priv->_session;
		g_signal_connect_object (_tmp6_, "changed", (GCallback) _ft_session_progress_bar_on_session_changed_ft_session_changed, self, 0);
	}
	g_object_notify ((GObject*) self, "session");
}

gfloat
ft_session_progress_bar_get_line_width (FtSessionProgressBar* self)
{
	gfloat result;
	g_return_val_if_fail (self != NULL, -1.0F);
	result = self->priv->_line_width;
	return result;
}

void
ft_session_progress_bar_set_line_width (FtSessionProgressBar* self,
                                        gfloat value)
{
	g_return_if_fail (self != NULL);
	if (self->priv->_line_width == value) {
		return;
	}
	self->priv->_line_width = value;
	g_object_notify ((GObject*) self, "line-width");
	gtk_widget_queue_resize ((GtkWidget*) self);
}

gboolean
ft_session_progress_bar_get_reveal (FtSessionProgressBar* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_reveal;
	return result;
}

static inline gpointer
ft_session_progress_bar_segment_get_instance_private (FtSessionProgressBarSegment* self)
{
	return G_STRUCT_MEMBER_P (self, FtSessionProgressBarSegment_private_offset);
}

static FtSessionProgressBarSegment*
ft_session_progress_bar_segment_construct (GType object_type,
                                           FtCycle* cycle)
{
	FtSessionProgressBarSegment * self = NULL;
	FtTimer* _tmp0_;
	g_return_val_if_fail (cycle != NULL, NULL);
	_tmp0_ = ft_timer_get_default ();
	self = (FtSessionProgressBarSegment*) g_object_new (object_type, "timer", _tmp0_, "cycle", cycle, NULL);
	return self;
}

static FtSessionProgressBarSegment*
ft_session_progress_bar_segment_new (FtCycle* cycle)
{
	return ft_session_progress_bar_segment_construct (FT_SESSION_PROGRESS_BAR_TYPE_SEGMENT, cycle);
}

static inline gint64
ft_session_progress_bar_segment_get_current_time (FtSessionProgressBarSegment* self)
{
	gint64 _tmp0_ = 0LL;
	FtTimer* _tmp1_;
	gint64 result;
	g_return_val_if_fail (self != NULL, -1LL);
	_tmp1_ = self->priv->_timer;
	if (ft_timer_is_running (_tmp1_)) {
		FtTimer* _tmp2_;
		GdkFrameClock* _tmp3_;
		_tmp2_ = self->priv->_timer;
		_tmp3_ = gtk_widget_get_frame_clock ((GtkWidget*) self);
		_tmp0_ = ft_timer_get_current_time (_tmp2_, gdk_frame_clock_get_frame_time (_tmp3_));
	} else {
		FtTimer* _tmp4_;
		_tmp4_ = self->priv->_timer;
		_tmp0_ = ft_timer_get_last_state_changed_time (_tmp4_);
	}
	result = _tmp0_;
	return result;
}

static void
ft_session_progress_bar_segment_prepare_value_animation (FtSessionProgressBarSegment* self,
                                                         gfloat display_value_from,
                                                         gfloat display_value_to)
{
	gfloat _tmp0_ = 0.0F;
	g_return_if_fail (self != NULL);
	self->display_value_from = display_value_from;
	self->display_value_to = display_value_to;
	if (self->priv->_display_value == display_value_to) {
		_tmp0_ = 1.0f;
	} else {
		_tmp0_ = 0.0f;
	}
	self->priv->value_animation_progress = _tmp0_;
}

static void
ft_session_progress_bar_segment_finish_value_animation (FtSessionProgressBarSegment* self)
{
	g_return_if_fail (self != NULL);
	if (self->priv->value_animation_progress != 1.0f) {
		FtGizmo* _tmp0_;
		self->priv->value_animation_progress = 1.0f;
		_tmp0_ = self->priv->highlight;
		gtk_widget_queue_draw ((GtkWidget*) _tmp0_);
	}
}

static void
ft_session_progress_bar_segment_set_value_animation_progress (FtSessionProgressBarSegment* self,
                                                              gfloat progress)
{
	g_return_if_fail (self != NULL);
	if (self->priv->value_animation_progress != progress) {
		FtGizmo* _tmp0_;
		self->priv->value_animation_progress = progress;
		_tmp0_ = self->priv->highlight;
		gtk_widget_queue_draw ((GtkWidget*) _tmp0_);
	}
}

static void
__lambda39_ (FtSessionProgressBarSegment* self)
{
	_g_object_unref0 (self->priv->weight_animation);
	self->priv->weight_animation = NULL;
}

static void
___lambda39__adw_animation_done (AdwAnimation* _sender,
                                 gpointer self)
{
	__lambda39_ ((FtSessionProgressBarSegment*) self);
}

static void
ft_session_progress_bar_segment_animate_weight (FtSessionProgressBarSegment* self,
                                                gfloat weight_from,
                                                gfloat weight_to,
                                                AdwCallbackAnimationTarget* target)
{
	AdwTimedAnimation* _tmp0_;
	AdwAnimationTarget* _tmp2_;
	AdwTimedAnimation* _tmp3_;
	AdwTimedAnimation* _tmp4_;
	AdwTimedAnimation* _tmp5_;
	AdwTimedAnimation* _tmp6_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (target != NULL);
	if (weight_to == weight_from) {
		_g_object_unref0 (target);
		return;
	}
	_tmp0_ = self->priv->weight_animation;
	if (_tmp0_ != NULL) {
		AdwTimedAnimation* _tmp1_;
		_tmp1_ = self->priv->weight_animation;
		adw_animation_pause ((AdwAnimation*) _tmp1_);
		_g_object_unref0 (self->priv->weight_animation);
		self->priv->weight_animation = NULL;
	}
	_tmp2_ = _g_object_ref0 ((AdwAnimationTarget*) target);
	_tmp3_ = (AdwTimedAnimation*) adw_timed_animation_new ((GtkWidget*) self, (gdouble) weight_from, (gdouble) weight_to, FT_SESSION_PROGRESS_BAR_SCALE_ANIMATION_DURATION, _tmp2_);
	_g_object_unref0 (self->priv->weight_animation);
	self->priv->weight_animation = _tmp3_;
	_tmp4_ = self->priv->weight_animation;
	adw_timed_animation_set_easing (_tmp4_, ADW_EASE_OUT_QUAD);
	_tmp5_ = self->priv->weight_animation;
	g_signal_connect_object ((AdwAnimation*) _tmp5_, "done", (GCallback) ___lambda39__adw_animation_done, self, 0);
	_tmp6_ = self->priv->weight_animation;
	adw_animation_play ((AdwAnimation*) _tmp6_);
	_g_object_unref0 (target);
}

static inline void
ft_session_progress_bar_segment_queue_draw_all (FtSessionProgressBarSegment* self)
{
	FtGizmo* _tmp0_;
	FtGizmo* _tmp1_;
	g_return_if_fail (self != NULL);
	gtk_widget_queue_draw ((GtkWidget*) self);
	_tmp0_ = self->priv->through;
	gtk_widget_queue_draw ((GtkWidget*) _tmp0_);
	_tmp1_ = self->priv->highlight;
	gtk_widget_queue_draw ((GtkWidget*) _tmp1_);
}

static void
ft_session_progress_bar_segment_measure_child_cb (FtGizmo* gizmo,
                                                  GtkOrientation orientation,
                                                  gint for_size,
                                                  gint* minimum,
                                                  gint* natural,
                                                  gint* minimum_baseline,
                                                  gint* natural_baseline)
{
	gint _vala_minimum = 0;
	gint _vala_natural = 0;
	gint _vala_minimum_baseline = 0;
	gint _vala_natural_baseline = 0;
	g_return_if_fail (gizmo != NULL);
	_vala_minimum = 0;
	_vala_natural = 0;
	_vala_minimum_baseline = -1;
	_vala_natural_baseline = -1;
	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_session_progress_bar_segment_snapshot_through_cb (FtGizmo* gizmo,
                                                     GtkSnapshot* snapshot)
{
	FtSessionProgressBarSegment* _self_ = NULL;
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	FtSessionProgressBarSegment* _tmp2_;
	FtSessionProgressBarSegment* _tmp3_;
	g_return_if_fail (gizmo != NULL);
	g_return_if_fail (snapshot != NULL);
	_tmp0_ = gtk_widget_get_parent ((GtkWidget*) gizmo);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, FT_SESSION_PROGRESS_BAR_TYPE_SEGMENT, FtSessionProgressBarSegment));
	_self_ = _tmp2_;
	_tmp3_ = _self_;
	if (_tmp3_ != NULL) {
		FtSessionProgressBarSegment* _tmp4_;
		_tmp4_ = _self_;
		ft_session_progress_bar_segment_snapshot_through (_tmp4_, gizmo, snapshot);
	}
	_g_object_unref0 (_self_);
}

static void
ft_session_progress_bar_segment_snapshot_highlight_cb (FtGizmo* gizmo,
                                                       GtkSnapshot* snapshot)
{
	FtSessionProgressBarSegment* _self_ = NULL;
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	FtSessionProgressBarSegment* _tmp2_;
	FtSessionProgressBarSegment* _tmp3_;
	g_return_if_fail (gizmo != NULL);
	g_return_if_fail (snapshot != NULL);
	_tmp0_ = gtk_widget_get_parent ((GtkWidget*) gizmo);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, FT_SESSION_PROGRESS_BAR_TYPE_SEGMENT, FtSessionProgressBarSegment));
	_self_ = _tmp2_;
	_tmp3_ = _self_;
	if (_tmp3_ != NULL) {
		FtSessionProgressBarSegment* _tmp4_;
		_tmp4_ = _self_;
		ft_session_progress_bar_segment_snapshot_highlight (_tmp4_, gizmo, snapshot);
	}
	_g_object_unref0 (_self_);
}

static void
ft_session_progress_bar_segment_snapshot_through (FtSessionProgressBarSegment* self,
                                                  FtGizmo* gizmo,
                                                  GtkSnapshot* snapshot)
{
	GskRoundedRect _tmp0_;
	GdkRGBA _tmp1_ = {0};
	graphene_rect_t _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (gizmo != NULL);
	g_return_if_fail (snapshot != NULL);
	_tmp0_ = self->priv->outline;
	gtk_snapshot_push_rounded_clip (snapshot, &_tmp0_);
	gtk_widget_get_color ((GtkWidget*) gizmo, &_tmp1_);
	_tmp2_ = self->priv->bounds;
	gtk_snapshot_append_color (snapshot, &_tmp1_, &_tmp2_);
	gtk_snapshot_pop (snapshot);
}

static void
ft_session_progress_bar_segment_snapshot_highlight (FtSessionProgressBarSegment* self,
                                                    FtGizmo* gizmo,
                                                    GtkSnapshot* snapshot)
{
	gint64 timestamp = 0LL;
	gfloat _tmp0_ = 0.0F;
	FtCycle* _tmp1_;
	gfloat display_value = 0.0F;
	GdkRGBA color = {0};
	GdkRGBA _tmp3_ = {0};
	gboolean _tmp4_ = FALSE;
	g_return_if_fail (self != NULL);
	g_return_if_fail (gizmo != NULL);
	g_return_if_fail (snapshot != NULL);
	timestamp = ft_session_progress_bar_segment_get_current_time (self);
	_tmp1_ = self->priv->_cycle;
	if (_tmp1_ != NULL) {
		FtCycle* _tmp2_;
		_tmp2_ = self->priv->_cycle;
		_tmp0_ = (gfloat) ft_cycle_calculate_progress (_tmp2_, timestamp);
	} else {
		_tmp0_ = 0.0f;
	}
	display_value = _tmp0_;
	gtk_widget_get_color ((GtkWidget*) gizmo, &_tmp3_);
	color = _tmp3_;
	if (self->priv->value_animation_progress < 1.0f) {
		display_value = ft_lerpf (self->display_value_from, display_value, self->priv->value_animation_progress);
	}
	if (display_value > 0.0f) {
		_tmp4_ = display_value < 1.0f;
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		gfloat width = 0.0F;
		gfloat height = 0.0F;
		gfloat highlight_width = 0.0F;
		gfloat highlight_height = 0.0F;
		gfloat highlight_x = 0.0F;
		gfloat highlight_y = 0.0F;
		graphene_rect_t highlight_bounds = {0};
		GskRoundedRect highlight_outline = {0};
		gboolean clip_applied = FALSE;
		graphene_rect_t _tmp6_;
		GskRoundedRect _tmp7_;
		GdkRGBA _tmp8_;
		graphene_rect_t _tmp9_;
		width = (gfloat) gtk_widget_get_width ((GtkWidget*) self);
		height = (gfloat) gtk_widget_get_height ((GtkWidget*) self);
		highlight_width = ((self->priv->_span_end - self->priv->_span_start) * display_value) * width;
		highlight_height = self->priv->_line_width;
		highlight_x = self->priv->_span_start * width;
		highlight_y = (height - highlight_height) / 2.0f;
		memset (&highlight_bounds, 0, sizeof (graphene_rect_t));
		memset (&highlight_outline, 0, sizeof (GskRoundedRect));
		clip_applied = FALSE;
		if (highlight_width < highlight_height) {
			GskRoundedRect _tmp5_;
			highlight_x -= highlight_height - highlight_width;
			highlight_width = highlight_height;
			_tmp5_ = self->priv->outline;
			gtk_snapshot_push_rounded_clip (snapshot, &_tmp5_);
			clip_applied = TRUE;
		}
		if (gtk_widget_get_direction ((GtkWidget*) self) == GTK_TEXT_DIR_RTL) {
			highlight_x = (width - highlight_x) - highlight_width;
		}
		graphene_rect_init (&highlight_bounds, highlight_x, highlight_y, highlight_width, highlight_height);
		_tmp6_ = highlight_bounds;
		gsk_rounded_rect_init_from_rect (&highlight_outline, &_tmp6_, highlight_height / 2.0f);
		_tmp7_ = highlight_outline;
		gtk_snapshot_push_rounded_clip (snapshot, &_tmp7_);
		_tmp8_ = color;
		_tmp9_ = highlight_bounds;
		gtk_snapshot_append_color (snapshot, &_tmp8_, &_tmp9_);
		gtk_snapshot_pop (snapshot);
		if (clip_applied) {
			gtk_snapshot_pop (snapshot);
		}
	} else {
		if (display_value == 1.0f) {
			GskRoundedRect _tmp10_;
			GdkRGBA _tmp11_;
			graphene_rect_t _tmp12_;
			_tmp10_ = self->priv->outline;
			gtk_snapshot_push_rounded_clip (snapshot, &_tmp10_);
			_tmp11_ = color;
			_tmp12_ = self->priv->bounds;
			gtk_snapshot_append_color (snapshot, &_tmp11_, &_tmp12_);
			gtk_snapshot_pop (snapshot);
		}
	}
	self->priv->_display_value = display_value;
}

static void
ft_session_progress_bar_segment_set_span_range (FtSessionProgressBarSegment* self,
                                                gfloat span_start,
                                                gfloat span_end)
{
	gboolean changed = FALSE;
	g_return_if_fail (self != NULL);
	changed = FALSE;
	if (span_end < span_start) {
		gfloat tmp = 0.0F;
		tmp = span_start;
		span_start = span_end;
		span_end = tmp;
	}
	if (self->priv->_span_start != span_start) {
		self->priv->_span_start = span_start;
		changed = TRUE;
	}
	if (self->priv->_span_end != span_end) {
		self->priv->_span_end = span_end;
		changed = TRUE;
	}
	if (changed) {
		ft_session_progress_bar_segment_queue_draw_all (self);
	}
}

static guint
ft_session_progress_bar_segment_calculate_timeout_interval (FtSessionProgressBarSegment* self)
{
	FtCycle* _tmp0_;
	gint64 timestamp = 0LL;
	gfloat distance = 0.0F;
	gfloat duration = 0.0F;
	FtCycle* _tmp1_;
	guint _tmp2_ = 0U;
	guint result;
	g_return_val_if_fail (self != NULL, 0U);
	_tmp0_ = self->priv->_cycle;
	_vala_return_val_if_fail (_tmp0_ != NULL, "this._cycle != null", 0U);
	timestamp = ft_session_progress_bar_segment_get_current_time (self);
	distance = ((gfloat) (self->priv->_span_end - self->priv->_span_start)) * ((gfloat) gtk_widget_get_width ((GtkWidget*) self));
	_tmp1_ = self->priv->_cycle;
	duration = (gfloat) ft_cycle_calculate_progress_duration (_tmp1_, timestamp);
	distance *= (gfloat) FT_SESSION_PROGRESS_BAR_TIMEOUT_RESOLUTION;
	if (((gdouble) distance) > 0.0) {
		_tmp2_ = ft_timestamp_to_milliseconds_uint ((gint64) roundf (duration / distance));
	} else {
		_tmp2_ = (guint) 0;
	}
	result = _tmp2_;
	return result;
}

static gboolean
ft_session_progress_bar_segment_can_timeout (FtSessionProgressBarSegment* self)
{
	FtTimer* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	if (!gtk_widget_get_mapped ((GtkWidget*) self)) {
		result = FALSE;
		return result;
	}
	_tmp0_ = self->priv->_timer;
	if (!ft_timer_is_running (_tmp0_)) {
		result = FALSE;
		return result;
	}
	if (gtk_widget_get_width ((GtkWidget*) self) <= 0) {
		result = FALSE;
		return result;
	}
	result = (self->priv->_span_end - self->priv->_span_start) > 0.0f;
	return result;
}

static void
___lambda40_ (FtSessionProgressBarSegment* self,
              gint64 timestamp)
{
	FtGizmo* _tmp0_;
	_tmp0_ = self->priv->highlight;
	gtk_widget_queue_draw ((GtkWidget*) _tmp0_);
}

static void
____lambda40__ft_timer_tick (FtTimer* _sender,
                             gint64 timestamp,
                             gpointer self)
{
	___lambda40_ ((FtSessionProgressBarSegment*) self, timestamp);
}

static gboolean
____lambda41_ (FtSessionProgressBarSegment* self)
{
	FtGizmo* _tmp0_;
	gboolean result;
	_tmp0_ = self->priv->highlight;
	gtk_widget_queue_draw ((GtkWidget*) _tmp0_);
	result = G_SOURCE_CONTINUE;
	return result;
}

static gboolean
_____lambda41__gsource_func (gpointer self)
{
	gboolean result;
	result = ____lambda41_ ((FtSessionProgressBarSegment*) self);
	return result;
}

static gboolean
_____lambda42_ (FtSessionProgressBarSegment* self)
{
	FtGizmo* _tmp0_;
	gboolean result;
	_tmp0_ = self->priv->highlight;
	gtk_widget_queue_draw ((GtkWidget*) _tmp0_);
	result = G_SOURCE_CONTINUE;
	return result;
}

static gboolean
______lambda42__gtk_tick_callback (GtkWidget* widget,
                                   GdkFrameClock* frame_clock,
                                   gpointer self)
{
	gboolean result;
	result = _____lambda42_ ((FtSessionProgressBarSegment*) self);
	return result;
}

static void
ft_session_progress_bar_segment_start_timeout (FtSessionProgressBarSegment* self)
{
	FtCycle* _tmp0_;
	guint timeout_interval = 0U;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_cycle;
	_vala_return_if_fail (_tmp0_ != NULL, "this._cycle != null");
	timeout_interval = ft_session_progress_bar_segment_calculate_timeout_interval (self);
	if (timeout_interval < FT_SESSION_PROGRESS_BAR_MIN_TIMEOUT_INTERVAL) {
		timeout_interval = 0U;
	}
	if (self->priv->timeout_interval != timeout_interval) {
		self->priv->timeout_interval = timeout_interval;
		ft_session_progress_bar_segment_stop_timeout (self);
	}
	if (self->priv->tick_id == ((gulong) 0)) {
		_tmp2_ = timeout_interval > ((guint) 0);
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		_tmp1_ = timeout_interval > ((guint) 500);
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		FtTimer* _tmp3_;
		gulong _tmp4_;
		_tmp3_ = self->priv->_timer;
		_tmp4_ = g_signal_connect_object (_tmp3_, "tick", (GCallback) ____lambda40__ft_timer_tick, self, 0);
		self->priv->tick_id = _tmp4_;
	} else {
		gboolean _tmp5_ = FALSE;
		if (self->priv->timeout_id == ((guint) 0)) {
			_tmp5_ = timeout_interval > ((guint) 0);
		} else {
			_tmp5_ = FALSE;
		}
		if (_tmp5_) {
			self->priv->timeout_id = g_timeout_add_full (G_PRIORITY_DEFAULT, timeout_interval, _____lambda41__gsource_func, g_object_ref (self), g_object_unref);
			g_source_set_name_by_id (self->priv->timeout_id, "Ft.SessionProgressBar.Segment.queue_draw");
		} else {
			gboolean _tmp6_ = FALSE;
			if (self->priv->tick_callback_id == ((guint) 0)) {
				_tmp6_ = timeout_interval == ((guint) 0);
			} else {
				_tmp6_ = FALSE;
			}
			if (_tmp6_) {
				self->priv->tick_callback_id = gtk_widget_add_tick_callback ((GtkWidget*) self, ______lambda42__gtk_tick_callback, g_object_ref (self), g_object_unref);
			}
		}
	}
}

static void
ft_session_progress_bar_segment_stop_timeout (FtSessionProgressBarSegment* self)
{
	g_return_if_fail (self != NULL);
	if (self->priv->tick_id != ((gulong) 0)) {
		FtTimer* _tmp0_;
		_tmp0_ = self->priv->_timer;
		g_signal_handler_disconnect ((GObject*) _tmp0_, self->priv->tick_id);
		self->priv->tick_id = (gulong) 0;
	}
	if (self->priv->timeout_id != ((guint) 0)) {
		g_source_remove (self->priv->timeout_id);
		self->priv->timeout_id = (guint) 0;
	}
	if (self->priv->tick_callback_id != ((guint) 0)) {
		gtk_widget_remove_tick_callback ((GtkWidget*) self, self->priv->tick_callback_id);
		self->priv->tick_callback_id = (guint) 0;
	}
}

static void
ft_session_progress_bar_segment_update_timeout (FtSessionProgressBarSegment* self)
{
	gboolean _tmp0_ = FALSE;
	FtTimeBlock* current_time_block = NULL;
	FtTimer* _tmp2_;
	void* _tmp3_;
	void* _tmp4_;
	FtTimeBlock* _tmp5_;
	gboolean _tmp6_ = FALSE;
	FtTimeBlock* _tmp7_;
	g_return_if_fail (self != NULL);
	ft_session_progress_bar_segment_stop_timeout (self);
	if (!gtk_widget_get_mapped ((GtkWidget*) self)) {
		_tmp0_ = TRUE;
	} else {
		FtCycle* _tmp1_;
		_tmp1_ = self->priv->_cycle;
		_tmp0_ = _tmp1_ == NULL;
	}
	if (_tmp0_) {
		return;
	}
	_tmp2_ = self->priv->_timer;
	_tmp3_ = ft_timer_get_user_data (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, FT_TYPE_TIME_BLOCK) ? ((FtTimeBlock*) _tmp4_) : NULL);
	current_time_block = _tmp5_;
	_tmp7_ = current_time_block;
	if (_tmp7_ != NULL) {
		FtCycle* _tmp8_;
		FtTimeBlock* _tmp9_;
		_tmp8_ = self->priv->_cycle;
		_tmp9_ = current_time_block;
		_tmp6_ = !ft_cycle_contains (_tmp8_, _tmp9_);
	} else {
		_tmp6_ = FALSE;
	}
	if (_tmp6_) {
		_g_object_unref0 (current_time_block);
		return;
	}
	if (ft_session_progress_bar_segment_can_timeout (self)) {
		ft_session_progress_bar_segment_start_timeout (self);
	}
	_g_object_unref0 (current_time_block);
}

static void
ft_session_progress_bar_segment_update (FtSessionProgressBarSegment* self)
{
	g_return_if_fail (self != NULL);
	ft_session_progress_bar_segment_update_timeout (self);
}

static void
ft_session_progress_bar_segment_on_cycle_changed (FtSessionProgressBarSegment* self)
{
	gfloat _tmp0_ = 0.0F;
	FtCycle* _tmp1_;
	gfloat weight = 0.0F;
	gboolean _tmp3_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->_cycle;
	if (_tmp1_ != NULL) {
		FtCycle* _tmp2_;
		_tmp2_ = self->priv->_cycle;
		_tmp0_ = (gfloat) ft_cycle_get_weight (_tmp2_);
	} else {
		_tmp0_ = 0.0f;
	}
	weight = _tmp0_;
	if (weight <= 0.0f) {
		return;
	}
	if (self->priv->_weight != weight) {
		_tmp3_ = self->priv->_weight == 0.0f;
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		self->priv->_weight = weight;
	}
	ft_session_progress_bar_segment_update (self);
}

static void
ft_session_progress_bar_segment_real_map (GtkWidget* base)
{
	FtSessionProgressBarSegment * self;
	self = (FtSessionProgressBarSegment*) base;
	GTK_WIDGET_CLASS (ft_session_progress_bar_segment_parent_class)->map (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	ft_session_progress_bar_segment_update_timeout (self);
}

static void
ft_session_progress_bar_segment_real_unmap (GtkWidget* base)
{
	FtSessionProgressBarSegment * self;
	self = (FtSessionProgressBarSegment*) base;
	ft_session_progress_bar_segment_stop_timeout (self);
	GTK_WIDGET_CLASS (ft_session_progress_bar_segment_parent_class)->unmap (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
}

static GtkSizeRequestMode
ft_session_progress_bar_segment_real_get_request_mode (GtkWidget* base)
{
	FtSessionProgressBarSegment * self;
	GtkSizeRequestMode result;
	self = (FtSessionProgressBarSegment*) base;
	result = GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH;
	return result;
}

static void
ft_session_progress_bar_segment_real_measure (GtkWidget* base,
                                              GtkOrientation orientation,
                                              gint for_size,
                                              gint* minimum,
                                              gint* natural,
                                              gint* minimum_baseline,
                                              gint* natural_baseline)
{
	FtSessionProgressBarSegment * self;
	gint _vala_minimum = 0;
	gint _vala_natural = 0;
	gint _vala_minimum_baseline = 0;
	gint _vala_natural_baseline = 0;
	gint _tmp0_ = 0;
	self = (FtSessionProgressBarSegment*) base;
	if (orientation == GTK_ORIENTATION_HORIZONTAL) {
		_tmp0_ = FT_SESSION_PROGRESS_BAR_MIN_WIDTH;
	} else {
		_tmp0_ = (gint) ceilf (self->priv->_line_width);
	}
	_vala_minimum = _tmp0_;
	_vala_natural = _vala_minimum;
	_vala_minimum_baseline = -1;
	_vala_natural_baseline = -1;
	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_session_progress_bar_segment_real_size_allocate (GtkWidget* base,
                                                    gint width,
                                                    gint height,
                                                    gint baseline)
{
	FtSessionProgressBarSegment * self;
	FtGizmo* _tmp0_;
	FtGizmo* _tmp1_;
	gboolean _tmp2_ = FALSE;
	self = (FtSessionProgressBarSegment*) base;
	_tmp0_ = self->priv->through;
	gtk_widget_allocate ((GtkWidget*) _tmp0_, width, height, baseline, NULL);
	_tmp1_ = self->priv->highlight;
	gtk_widget_allocate ((GtkWidget*) _tmp1_, width, height, baseline, NULL);
	if (ft_session_progress_bar_segment_can_timeout (self)) {
		FtCycle* _tmp3_;
		_tmp3_ = self->priv->_cycle;
		_tmp2_ = _tmp3_ != NULL;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		FtTimeBlock* current_time_block = NULL;
		FtTimer* _tmp4_;
		void* _tmp5_;
		void* _tmp6_;
		FtTimeBlock* _tmp7_;
		gboolean _tmp8_ = FALSE;
		FtTimeBlock* _tmp9_;
		_tmp4_ = self->priv->_timer;
		_tmp5_ = ft_timer_get_user_data (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp6_, FT_TYPE_TIME_BLOCK) ? ((FtTimeBlock*) _tmp6_) : NULL);
		current_time_block = _tmp7_;
		_tmp9_ = current_time_block;
		if (_tmp9_ != NULL) {
			FtCycle* _tmp10_;
			FtTimeBlock* _tmp11_;
			_tmp10_ = self->priv->_cycle;
			_tmp11_ = current_time_block;
			_tmp8_ = ft_cycle_contains (_tmp10_, _tmp11_);
		} else {
			_tmp8_ = FALSE;
		}
		if (_tmp8_) {
			ft_session_progress_bar_segment_start_timeout (self);
		}
		_g_object_unref0 (current_time_block);
	}
}

static void
ft_session_progress_bar_segment_real_snapshot (GtkWidget* base,
                                               GtkSnapshot* snapshot)
{
	FtSessionProgressBarSegment * self;
	gfloat width = 0.0F;
	gfloat height = 0.0F;
	gfloat segment_x = 0.0F;
	gfloat segment_y = 0.0F;
	gfloat segment_width = 0.0F;
	gfloat segment_height = 0.0F;
	graphene_rect_t _tmp0_;
	FtGizmo* _tmp1_;
	FtGizmo* _tmp2_;
	self = (FtSessionProgressBarSegment*) base;
	g_return_if_fail (snapshot != NULL);
	width = (gfloat) gtk_widget_get_width ((GtkWidget*) self);
	height = (gfloat) gtk_widget_get_height ((GtkWidget*) self);
	segment_x = MAX (self->priv->_span_start, 0.0f) * width;
	segment_y = (height - self->priv->_line_width) / 2.0f;
	segment_width = (MIN (self->priv->_span_end, 1.0f) * width) - segment_x;
	segment_height = self->priv->_line_width;
	if (segment_width <= 0.0f) {
		return;
	}
	if (gtk_widget_get_direction ((GtkWidget*) self) == GTK_TEXT_DIR_RTL) {
		segment_x = (width - segment_x) - segment_width;
	}
	memset (&self->priv->bounds, 0, sizeof (graphene_rect_t));
	graphene_rect_init (&self->priv->bounds, segment_x, segment_y, segment_width, segment_height);
	memset (&self->priv->outline, 0, sizeof (GskRoundedRect));
	_tmp0_ = self->priv->bounds;
	gsk_rounded_rect_init_from_rect (&self->priv->outline, &_tmp0_, 0.5f * segment_height);
	_tmp1_ = self->priv->through;
	gtk_widget_snapshot_child ((GtkWidget*) self, (GtkWidget*) _tmp1_, snapshot);
	_tmp2_ = self->priv->highlight;
	gtk_widget_snapshot_child ((GtkWidget*) self, (GtkWidget*) _tmp2_, snapshot);
}

static void
ft_session_progress_bar_segment_real_dispose (GObject* base)
{
	FtSessionProgressBarSegment * self;
	AdwTimedAnimation* _tmp0_;
	FtGizmo* _tmp2_;
	FtGizmo* _tmp3_;
	self = (FtSessionProgressBarSegment*) base;
	ft_session_progress_bar_segment_stop_timeout (self);
	_tmp0_ = self->priv->weight_animation;
	if (_tmp0_ != NULL) {
		AdwTimedAnimation* _tmp1_;
		_tmp1_ = self->priv->weight_animation;
		adw_animation_pause ((AdwAnimation*) _tmp1_);
		_g_object_unref0 (self->priv->weight_animation);
		self->priv->weight_animation = NULL;
	}
	_tmp2_ = self->priv->through;
	gtk_widget_unparent ((GtkWidget*) _tmp2_);
	_tmp3_ = self->priv->highlight;
	gtk_widget_unparent ((GtkWidget*) _tmp3_);
	self->priv->through = NULL;
	self->priv->highlight = NULL;
	_g_object_unref0 (self->priv->_timer);
	self->priv->_timer = NULL;
	_g_object_unref0 (self->priv->_cycle);
	self->priv->_cycle = NULL;
	G_OBJECT_CLASS (ft_session_progress_bar_segment_parent_class)->dispose ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
}

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

static void
ft_session_progress_bar_segment_set_timer (FtSessionProgressBarSegment* self,
                                           FtTimer* value)
{
	FtTimer* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_timer);
	self->priv->_timer = _tmp0_;
	g_object_notify_by_pspec ((GObject *) self, ft_session_progress_bar_segment_properties[FT_SESSION_PROGRESS_BAR_SEGMENT_TIMER_PROPERTY]);
}

static FtCycle*
ft_session_progress_bar_segment_get_cycle (FtSessionProgressBarSegment* self)
{
	FtCycle* result;
	FtCycle* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_cycle;
	result = _tmp0_;
	return result;
}

static void
_ft_session_progress_bar_segment_on_cycle_changed_ft_cycle_changed (FtCycle* _sender,
                                                                    gpointer self)
{
	ft_session_progress_bar_segment_on_cycle_changed ((FtSessionProgressBarSegment*) self);
}

static void
ft_session_progress_bar_segment_set_cycle (FtSessionProgressBarSegment* self,
                                           FtCycle* value)
{
	FtCycle* _tmp0_;
	FtCycle* _tmp2_;
	FtCycle* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_cycle;
	if (_tmp0_ == value) {
		return;
	}
	if (self->priv->cycle_changed_id != ((gulong) 0)) {
		FtCycle* _tmp1_;
		_tmp1_ = self->priv->_cycle;
		g_signal_handler_disconnect ((GObject*) _tmp1_, self->priv->cycle_changed_id);
		self->priv->cycle_changed_id = (gulong) 0;
	}
	_tmp2_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_cycle);
	self->priv->_cycle = _tmp2_;
	_tmp3_ = self->priv->_cycle;
	if (_tmp3_ != NULL) {
		FtCycle* _tmp4_;
		gulong _tmp5_;
		_tmp4_ = self->priv->_cycle;
		_tmp5_ = g_signal_connect_object (_tmp4_, "changed", (GCallback) _ft_session_progress_bar_segment_on_cycle_changed_ft_cycle_changed, self, 0);
		self->priv->cycle_changed_id = _tmp5_;
	}
	ft_session_progress_bar_segment_on_cycle_changed (self);
	ft_session_progress_bar_segment_queue_draw_all (self);
	g_object_notify_by_pspec ((GObject *) self, ft_session_progress_bar_segment_properties[FT_SESSION_PROGRESS_BAR_SEGMENT_CYCLE_PROPERTY]);
}

static gfloat
ft_session_progress_bar_segment_get_span_start (FtSessionProgressBarSegment* self)
{
	gfloat result;
	g_return_val_if_fail (self != NULL, -1.0F);
	result = self->priv->_span_start;
	return result;
}

static gfloat
ft_session_progress_bar_segment_get_span_end (FtSessionProgressBarSegment* self)
{
	gfloat result;
	g_return_val_if_fail (self != NULL, -1.0F);
	result = self->priv->_span_end;
	return result;
}

static gfloat
ft_session_progress_bar_segment_get_weight (FtSessionProgressBarSegment* self)
{
	gfloat result;
	g_return_val_if_fail (self != NULL, -1.0F);
	result = self->priv->_weight;
	return result;
}

static void
ft_session_progress_bar_segment_set_weight (FtSessionProgressBarSegment* self,
                                            gfloat value)
{
	g_return_if_fail (self != NULL);
	self->priv->_weight = value;
	g_object_notify_by_pspec ((GObject *) self, ft_session_progress_bar_segment_properties[FT_SESSION_PROGRESS_BAR_SEGMENT_WEIGHT_PROPERTY]);
}

static gfloat
ft_session_progress_bar_segment_get_line_width (FtSessionProgressBarSegment* self)
{
	gfloat result;
	g_return_val_if_fail (self != NULL, -1.0F);
	result = self->priv->_line_width;
	return result;
}

static void
ft_session_progress_bar_segment_set_line_width (FtSessionProgressBarSegment* self,
                                                gfloat value)
{
	g_return_if_fail (self != NULL);
	if (self->priv->_line_width != value) {
		self->priv->_line_width = value;
		g_object_notify ((GObject*) self, "line-width");
		ft_session_progress_bar_segment_queue_draw_all (self);
	}
}

static gfloat
ft_session_progress_bar_segment_get_display_value (FtSessionProgressBarSegment* self)
{
	gfloat result;
	g_return_val_if_fail (self != NULL, -1.0F);
	result = self->priv->_display_value;
	return result;
}

static void
_ft_session_progress_bar_segment_measure_child_cb_ft_gizmo_measure_func (FtGizmo* gizmo,
                                                                         GtkOrientation orientation,
                                                                         gint for_size,
                                                                         gint* minimum,
                                                                         gint* natural,
                                                                         gint* minimum_baseline,
                                                                         gint* natural_baseline,
                                                                         gpointer self)
{
	ft_session_progress_bar_segment_measure_child_cb (gizmo, orientation, for_size, minimum, natural, minimum_baseline, natural_baseline);
}

static void
_ft_session_progress_bar_segment_snapshot_through_cb_ft_gizmo_snapshot_func (FtGizmo* gizmo,
                                                                             GtkSnapshot* snapshot,
                                                                             gpointer self)
{
	ft_session_progress_bar_segment_snapshot_through_cb (gizmo, snapshot);
}

static void
_ft_session_progress_bar_segment_snapshot_highlight_cb_ft_gizmo_snapshot_func (FtGizmo* gizmo,
                                                                               GtkSnapshot* snapshot,
                                                                               gpointer self)
{
	ft_session_progress_bar_segment_snapshot_highlight_cb (gizmo, snapshot);
}

static GObject *
ft_session_progress_bar_segment_constructor (GType type,
                                             guint n_construct_properties,
                                             GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	FtSessionProgressBarSegment * self;
	FtGizmo* through = NULL;
	FtGizmo* _tmp0_;
	FtGizmo* _tmp1_;
	FtGizmo* _tmp2_;
	FtGizmo* _tmp3_;
	FtGizmo* highlight = NULL;
	FtGizmo* _tmp4_;
	FtGizmo* _tmp5_;
	FtGizmo* _tmp6_;
	FtGizmo* _tmp7_;
	FtGizmo* _tmp8_;
	FtGizmo* _tmp9_;
	FtGizmo* _tmp10_;
	parent_class = G_OBJECT_CLASS (ft_session_progress_bar_segment_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_SESSION_PROGRESS_BAR_TYPE_SEGMENT, FtSessionProgressBarSegment);
	_tmp0_ = ft_gizmo_new (_ft_session_progress_bar_segment_measure_child_cb_ft_gizmo_measure_func, NULL, NULL, NULL, NULL, NULL, _ft_session_progress_bar_segment_snapshot_through_cb_ft_gizmo_snapshot_func, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	g_object_ref_sink (_tmp0_);
	through = _tmp0_;
	_tmp1_ = through;
	gtk_widget_set_focusable ((GtkWidget*) _tmp1_, FALSE);
	_tmp2_ = through;
	gtk_widget_add_css_class ((GtkWidget*) _tmp2_, "through");
	_tmp3_ = through;
	gtk_widget_set_parent ((GtkWidget*) _tmp3_, (GtkWidget*) self);
	_tmp4_ = ft_gizmo_new (_ft_session_progress_bar_segment_measure_child_cb_ft_gizmo_measure_func, NULL, NULL, NULL, NULL, NULL, _ft_session_progress_bar_segment_snapshot_highlight_cb_ft_gizmo_snapshot_func, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	g_object_ref_sink (_tmp4_);
	highlight = _tmp4_;
	_tmp5_ = highlight;
	gtk_widget_set_focusable ((GtkWidget*) _tmp5_, FALSE);
	_tmp6_ = highlight;
	gtk_widget_add_css_class ((GtkWidget*) _tmp6_, "highlight");
	_tmp7_ = highlight;
	_tmp8_ = through;
	gtk_widget_insert_after ((GtkWidget*) _tmp7_, (GtkWidget*) self, (GtkWidget*) _tmp8_);
	_tmp9_ = highlight;
	self->priv->highlight = _tmp9_;
	_tmp10_ = through;
	self->priv->through = _tmp10_;
	_g_object_unref0 (highlight);
	_g_object_unref0 (through);
	return obj;
}

static void
ft_session_progress_bar_segment_class_init (FtSessionProgressBarSegmentClass * klass,
                                            gpointer klass_data)
{
	ft_session_progress_bar_segment_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FtSessionProgressBarSegment_private_offset);
	((GtkWidgetClass *) klass)->map = (void (*) (GtkWidget*)) ft_session_progress_bar_segment_real_map;
	((GtkWidgetClass *) klass)->unmap = (void (*) (GtkWidget*)) ft_session_progress_bar_segment_real_unmap;
	((GtkWidgetClass *) klass)->get_request_mode = (GtkSizeRequestMode (*) (GtkWidget*)) ft_session_progress_bar_segment_real_get_request_mode;
	((GtkWidgetClass *) klass)->measure = (void (*) (GtkWidget*, GtkOrientation, gint, gint*, gint*, gint*, gint*)) ft_session_progress_bar_segment_real_measure;
	((GtkWidgetClass *) klass)->size_allocate = (void (*) (GtkWidget*, gint, gint, gint)) ft_session_progress_bar_segment_real_size_allocate;
	((GtkWidgetClass *) klass)->snapshot = (void (*) (GtkWidget*, GtkSnapshot*)) ft_session_progress_bar_segment_real_snapshot;
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) ft_session_progress_bar_segment_real_dispose;
	G_OBJECT_CLASS (klass)->get_property = _vala_ft_session_progress_bar_segment_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_ft_session_progress_bar_segment_set_property;
	G_OBJECT_CLASS (klass)->constructor = ft_session_progress_bar_segment_constructor;
	G_OBJECT_CLASS (klass)->finalize = ft_session_progress_bar_segment_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_SESSION_PROGRESS_BAR_SEGMENT_TIMER_PROPERTY, ft_session_progress_bar_segment_properties[FT_SESSION_PROGRESS_BAR_SEGMENT_TIMER_PROPERTY] = g_param_spec_object ("timer", "timer", "timer", FT_TYPE_TIMER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_SESSION_PROGRESS_BAR_SEGMENT_CYCLE_PROPERTY, ft_session_progress_bar_segment_properties[FT_SESSION_PROGRESS_BAR_SEGMENT_CYCLE_PROPERTY] = g_param_spec_object ("cycle", "cycle", "cycle", FT_TYPE_CYCLE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_SESSION_PROGRESS_BAR_SEGMENT_SPAN_START_PROPERTY, ft_session_progress_bar_segment_properties[FT_SESSION_PROGRESS_BAR_SEGMENT_SPAN_START_PROPERTY] = g_param_spec_float ("span-start", "span-start", "span-start", -G_MAXFLOAT, G_MAXFLOAT, 0.0F, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_SESSION_PROGRESS_BAR_SEGMENT_SPAN_END_PROPERTY, ft_session_progress_bar_segment_properties[FT_SESSION_PROGRESS_BAR_SEGMENT_SPAN_END_PROPERTY] = g_param_spec_float ("span-end", "span-end", "span-end", -G_MAXFLOAT, G_MAXFLOAT, 0.0F, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_SESSION_PROGRESS_BAR_SEGMENT_WEIGHT_PROPERTY, ft_session_progress_bar_segment_properties[FT_SESSION_PROGRESS_BAR_SEGMENT_WEIGHT_PROPERTY] = g_param_spec_float ("weight", "weight", "weight", -G_MAXFLOAT, G_MAXFLOAT, 0.0F, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_SESSION_PROGRESS_BAR_SEGMENT_LINE_WIDTH_PROPERTY, ft_session_progress_bar_segment_properties[FT_SESSION_PROGRESS_BAR_SEGMENT_LINE_WIDTH_PROPERTY] = g_param_spec_float ("line-width", "line-width", "line-width", -G_MAXFLOAT, G_MAXFLOAT, 0.0F, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_EXPLICIT_NOTIFY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_SESSION_PROGRESS_BAR_SEGMENT_DISPLAY_VALUE_PROPERTY, ft_session_progress_bar_segment_properties[FT_SESSION_PROGRESS_BAR_SEGMENT_DISPLAY_VALUE_PROPERTY] = g_param_spec_float ("display-value", "display-value", "display-value", -G_MAXFLOAT, G_MAXFLOAT, 0.0F, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
ft_session_progress_bar_segment_instance_init (FtSessionProgressBarSegment * self,
                                               gpointer klass)
{
	self->priv = ft_session_progress_bar_segment_get_instance_private (self);
	self->priv->_cycle = NULL;
	self->priv->_timer = NULL;
	self->priv->_span_start = 0.0f;
	self->priv->_span_end = 0.0f;
	self->priv->_weight = 0.0f;
	self->priv->_display_value = 0.0f;
	self->priv->cycle_changed_id = (gulong) 0U;
	self->priv->tick_id = (gulong) 0U;
	self->priv->tick_callback_id = 0U;
	self->priv->timeout_id = 0U;
	self->priv->timeout_interval = 0U;
	self->priv->through = NULL;
	self->priv->highlight = NULL;
	self->priv->value_animation_progress = 1.0f;
	self->priv->weight_animation = NULL;
	self->display_value_from = 0.0f;
	self->display_value_to = 0.0f;
}

static void
ft_session_progress_bar_segment_finalize (GObject * obj)
{
	FtSessionProgressBarSegment * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_SESSION_PROGRESS_BAR_TYPE_SEGMENT, FtSessionProgressBarSegment);
	_g_object_unref0 (self->priv->_cycle);
	_g_object_unref0 (self->priv->_timer);
	_g_object_unref0 (self->priv->weight_animation);
	G_OBJECT_CLASS (ft_session_progress_bar_segment_parent_class)->finalize (obj);
}

static GType
ft_session_progress_bar_segment_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FtSessionProgressBarSegmentClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_session_progress_bar_segment_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtSessionProgressBarSegment), 0, (GInstanceInitFunc) ft_session_progress_bar_segment_instance_init, NULL };
	GType ft_session_progress_bar_segment_type_id;
	ft_session_progress_bar_segment_type_id = g_type_register_static (gtk_widget_get_type (), "FtSessionProgressBarSegment", &g_define_type_info, 0);
	FtSessionProgressBarSegment_private_offset = g_type_add_instance_private (ft_session_progress_bar_segment_type_id, sizeof (FtSessionProgressBarSegmentPrivate));
	return ft_session_progress_bar_segment_type_id;
}

static GType
ft_session_progress_bar_segment_get_type (void)
{
	static volatile gsize ft_session_progress_bar_segment_type_id__once = 0;
	if (g_once_init_enter (&ft_session_progress_bar_segment_type_id__once)) {
		GType ft_session_progress_bar_segment_type_id;
		ft_session_progress_bar_segment_type_id = ft_session_progress_bar_segment_get_type_once ();
		g_once_init_leave (&ft_session_progress_bar_segment_type_id__once, ft_session_progress_bar_segment_type_id);
	}
	return ft_session_progress_bar_segment_type_id__once;
}

static void
_vala_ft_session_progress_bar_segment_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec)
{
	FtSessionProgressBarSegment * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FT_SESSION_PROGRESS_BAR_TYPE_SEGMENT, FtSessionProgressBarSegment);
	switch (property_id) {
		case FT_SESSION_PROGRESS_BAR_SEGMENT_TIMER_PROPERTY:
		g_value_set_object (value, ft_session_progress_bar_segment_get_timer (self));
		break;
		case FT_SESSION_PROGRESS_BAR_SEGMENT_CYCLE_PROPERTY:
		g_value_set_object (value, ft_session_progress_bar_segment_get_cycle (self));
		break;
		case FT_SESSION_PROGRESS_BAR_SEGMENT_SPAN_START_PROPERTY:
		g_value_set_float (value, ft_session_progress_bar_segment_get_span_start (self));
		break;
		case FT_SESSION_PROGRESS_BAR_SEGMENT_SPAN_END_PROPERTY:
		g_value_set_float (value, ft_session_progress_bar_segment_get_span_end (self));
		break;
		case FT_SESSION_PROGRESS_BAR_SEGMENT_WEIGHT_PROPERTY:
		g_value_set_float (value, ft_session_progress_bar_segment_get_weight (self));
		break;
		case FT_SESSION_PROGRESS_BAR_SEGMENT_LINE_WIDTH_PROPERTY:
		g_value_set_float (value, ft_session_progress_bar_segment_get_line_width (self));
		break;
		case FT_SESSION_PROGRESS_BAR_SEGMENT_DISPLAY_VALUE_PROPERTY:
		g_value_set_float (value, ft_session_progress_bar_segment_get_display_value (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_ft_session_progress_bar_segment_set_property (GObject * object,
                                                    guint property_id,
                                                    const GValue * value,
                                                    GParamSpec * pspec)
{
	FtSessionProgressBarSegment * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FT_SESSION_PROGRESS_BAR_TYPE_SEGMENT, FtSessionProgressBarSegment);
	switch (property_id) {
		case FT_SESSION_PROGRESS_BAR_SEGMENT_TIMER_PROPERTY:
		ft_session_progress_bar_segment_set_timer (self, g_value_get_object (value));
		break;
		case FT_SESSION_PROGRESS_BAR_SEGMENT_CYCLE_PROPERTY:
		ft_session_progress_bar_segment_set_cycle (self, g_value_get_object (value));
		break;
		case FT_SESSION_PROGRESS_BAR_SEGMENT_WEIGHT_PROPERTY:
		ft_session_progress_bar_segment_set_weight (self, g_value_get_float (value));
		break;
		case FT_SESSION_PROGRESS_BAR_SEGMENT_LINE_WIDTH_PROPERTY:
		ft_session_progress_bar_segment_set_line_width (self, g_value_get_float (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static GObject *
ft_session_progress_bar_constructor (GType type,
                                     guint n_construct_properties,
                                     GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	FtSessionProgressBar * self;
	parent_class = G_OBJECT_CLASS (ft_session_progress_bar_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_SESSION_PROGRESS_BAR, FtSessionProgressBar);
	gtk_widget_set_has_tooltip ((GtkWidget*) self, TRUE);
	return obj;
}

static void
ft_session_progress_bar_class_init (FtSessionProgressBarClass * klass,
                                    gpointer klass_data)
{
	ft_session_progress_bar_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FtSessionProgressBar_private_offset);
	((GtkWidgetClass *) klass)->map = (void (*) (GtkWidget*)) ft_session_progress_bar_real_map;
	((GtkWidgetClass *) klass)->unmap = (void (*) (GtkWidget*)) ft_session_progress_bar_real_unmap;
	((GtkWidgetClass *) klass)->get_request_mode = (GtkSizeRequestMode (*) (GtkWidget*)) ft_session_progress_bar_real_get_request_mode;
	((GtkWidgetClass *) klass)->measure = (void (*) (GtkWidget*, GtkOrientation, gint, gint*, gint*, gint*, gint*)) ft_session_progress_bar_real_measure;
	((GtkWidgetClass *) klass)->size_allocate = (void (*) (GtkWidget*, gint, gint, gint)) ft_session_progress_bar_real_size_allocate;
	((GtkWidgetClass *) klass)->snapshot = (void (*) (GtkWidget*, GtkSnapshot*)) ft_session_progress_bar_real_snapshot;
	((GtkWidgetClass *) klass)->query_tooltip = (gboolean (*) (GtkWidget*, gint, gint, gboolean, GtkTooltip*)) ft_session_progress_bar_real_query_tooltip;
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) ft_session_progress_bar_real_dispose;
	G_OBJECT_CLASS (klass)->get_property = _vala_ft_session_progress_bar_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_ft_session_progress_bar_set_property;
	G_OBJECT_CLASS (klass)->constructor = ft_session_progress_bar_constructor;
	G_OBJECT_CLASS (klass)->finalize = ft_session_progress_bar_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_SESSION_PROGRESS_BAR_TIMER_PROPERTY, ft_session_progress_bar_properties[FT_SESSION_PROGRESS_BAR_TIMER_PROPERTY] = g_param_spec_object ("timer", "timer", "timer", FT_TYPE_TIMER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_SESSION_PROGRESS_BAR_SESSION_MANAGER_PROPERTY, ft_session_progress_bar_properties[FT_SESSION_PROGRESS_BAR_SESSION_MANAGER_PROPERTY] = g_param_spec_object ("session-manager", "session-manager", "session-manager", FT_TYPE_SESSION_MANAGER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_SESSION_PROGRESS_BAR_SESSION_PROPERTY, ft_session_progress_bar_properties[FT_SESSION_PROGRESS_BAR_SESSION_PROPERTY] = g_param_spec_object ("session", "session", "session", FT_TYPE_SESSION, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_EXPLICIT_NOTIFY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_SESSION_PROGRESS_BAR_LINE_WIDTH_PROPERTY, ft_session_progress_bar_properties[FT_SESSION_PROGRESS_BAR_LINE_WIDTH_PROPERTY] = g_param_spec_float ("line-width", "line-width", "line-width", -G_MAXFLOAT, G_MAXFLOAT, 0.0F, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_EXPLICIT_NOTIFY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_SESSION_PROGRESS_BAR_REVEAL_PROPERTY, ft_session_progress_bar_properties[FT_SESSION_PROGRESS_BAR_REVEAL_PROPERTY] = g_param_spec_boolean ("reveal", "reveal", "reveal", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	gtk_widget_class_set_css_name (GTK_WIDGET_CLASS (klass), "sessionprogressbar");
}

static void
ft_session_progress_bar_instance_init (FtSessionProgressBar * self,
                                       gpointer klass)
{
	self->priv = ft_session_progress_bar_get_instance_private (self);
	self->priv->_timer = NULL;
	self->priv->_session_manager = NULL;
	self->priv->_session = NULL;
	self->priv->_line_width = FT_SESSION_PROGRESS_BAR_DEFAULT_LINE_WIDTH;
	self->priv->_reveal = TRUE;
	self->priv->revealing = FALSE;
	self->priv->current_segment = NULL;
	self->priv->scale = NAN;
	self->priv->scale_animation = NULL;
	self->priv->opacity_animation = NULL;
	self->priv->value_animation = NULL;
	self->priv->long_break_time = FT_TIMESTAMP_UNDEFINED;
	self->priv->tick_callback_id = (guint) 0;
}

static void
ft_session_progress_bar_finalize (GObject * obj)
{
	FtSessionProgressBar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_SESSION_PROGRESS_BAR, FtSessionProgressBar);
	_g_object_unref0 (self->priv->_timer);
	_g_object_unref0 (self->priv->_session_manager);
	_g_object_unref0 (self->priv->_session);
	_g_object_unref0 (self->priv->scale_animation);
	_g_object_unref0 (self->priv->opacity_animation);
	_g_object_unref0 (self->priv->value_animation);
	G_OBJECT_CLASS (ft_session_progress_bar_parent_class)->finalize (obj);
}

static GType
ft_session_progress_bar_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FtSessionProgressBarClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_session_progress_bar_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtSessionProgressBar), 0, (GInstanceInitFunc) ft_session_progress_bar_instance_init, NULL };
	GType ft_session_progress_bar_type_id;
	ft_session_progress_bar_type_id = g_type_register_static (gtk_widget_get_type (), "FtSessionProgressBar", &g_define_type_info, 0);
	FtSessionProgressBar_private_offset = g_type_add_instance_private (ft_session_progress_bar_type_id, sizeof (FtSessionProgressBarPrivate));
	return ft_session_progress_bar_type_id;
}

GType
ft_session_progress_bar_get_type (void)
{
	static volatile gsize ft_session_progress_bar_type_id__once = 0;
	if (g_once_init_enter (&ft_session_progress_bar_type_id__once)) {
		GType ft_session_progress_bar_type_id;
		ft_session_progress_bar_type_id = ft_session_progress_bar_get_type_once ();
		g_once_init_leave (&ft_session_progress_bar_type_id__once, ft_session_progress_bar_type_id);
	}
	return ft_session_progress_bar_type_id__once;
}

static void
_vala_ft_session_progress_bar_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec)
{
	FtSessionProgressBar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FT_TYPE_SESSION_PROGRESS_BAR, FtSessionProgressBar);
	switch (property_id) {
		case FT_SESSION_PROGRESS_BAR_TIMER_PROPERTY:
		g_value_set_object (value, ft_session_progress_bar_get_timer (self));
		break;
		case FT_SESSION_PROGRESS_BAR_SESSION_MANAGER_PROPERTY:
		g_value_set_object (value, ft_session_progress_bar_get_session_manager (self));
		break;
		case FT_SESSION_PROGRESS_BAR_SESSION_PROPERTY:
		g_value_set_object (value, ft_session_progress_bar_get_session (self));
		break;
		case FT_SESSION_PROGRESS_BAR_LINE_WIDTH_PROPERTY:
		g_value_set_float (value, ft_session_progress_bar_get_line_width (self));
		break;
		case FT_SESSION_PROGRESS_BAR_REVEAL_PROPERTY:
		g_value_set_boolean (value, ft_session_progress_bar_get_reveal (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_ft_session_progress_bar_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec)
{
	FtSessionProgressBar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FT_TYPE_SESSION_PROGRESS_BAR, FtSessionProgressBar);
	switch (property_id) {
		case FT_SESSION_PROGRESS_BAR_TIMER_PROPERTY:
		ft_session_progress_bar_set_timer (self, g_value_get_object (value));
		break;
		case FT_SESSION_PROGRESS_BAR_SESSION_MANAGER_PROPERTY:
		ft_session_progress_bar_set_session_manager (self, g_value_get_object (value));
		break;
		case FT_SESSION_PROGRESS_BAR_SESSION_PROPERTY:
		ft_session_progress_bar_set_session (self, g_value_get_object (value));
		break;
		case FT_SESSION_PROGRESS_BAR_LINE_WIDTH_PROPERTY:
		ft_session_progress_bar_set_line_width (self, g_value_get_float (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;
}

