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

/*
 * Copyright (c) 2022-2025 focus-timer contributors
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

#include "ft_ui.h"
#include <gtk/gtk.h>
#include "ft_core.h"
#include <gio/gio.h>
#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	FT_COMPACT_TIMER_VIEW_0_PROPERTY,
	FT_COMPACT_TIMER_VIEW_NUM_PROPERTIES
};
static GParamSpec* ft_compact_timer_view_properties[FT_COMPACT_TIMER_VIEW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

struct _FtCompactTimerViewPrivate {
	GtkMenuButton* state_menubutton;
	FtTimerLabel* timer_label;
	FtSessionManager* session_manager;
	FtTimer* timer;
	GMenuModel* state_menu;
	GMenuModel* uniform_state_menu;
	gulong timer_state_changed_id;
	gulong notify_current_time_block_id;
	gulong notify_has_uniform_breaks_id;
	gulong current_time_block_changed_id;
	FtTimeBlock* current_time_block;
};

static gint FtCompactTimerView_private_offset;
static gpointer ft_compact_timer_view_parent_class = NULL;
static GtkBuildableIface * ft_compact_timer_view_gtk_buildable_parent_iface = NULL;

static gchar* ft_compact_timer_view_get_state_label (FtCompactTimerView* self);
static void ft_compact_timer_view_update_css_classes (FtCompactTimerView* self);
static void ft_compact_timer_view_update_buttons (FtCompactTimerView* self);
static void ft_compact_timer_view_update_timer_label_placeholder (FtCompactTimerView* self);
static void ft_compact_timer_view_update (FtCompactTimerView* self);
static void ft_compact_timer_view_on_timer_state_changed (FtCompactTimerView* self,
                                                   const FtTimerState* current_state,
                                                   const FtTimerState* previous_state);
static void ft_compact_timer_view_on_current_time_block_changed (FtCompactTimerView* self);
static void ft_compact_timer_view_on_session_manager_notify_current_time_block (FtCompactTimerView* self);
static void _ft_compact_timer_view_on_current_time_block_changed_ft_time_block_changed (FtTimeBlock* _sender,
                                                                                 gpointer self);
static void ft_compact_timer_view_on_session_manager_notify_has_uniform_breaks (FtCompactTimerView* self);
static void ft_compact_timer_view_connect_signals (FtCompactTimerView* self);
static void _ft_compact_timer_view_on_timer_state_changed_ft_timer_state_changed (FtTimer* _sender,
                                                                           const FtTimerState* current_state,
                                                                           const FtTimerState* previous_state,
                                                                           gpointer self);
static void ft_compact_timer_view_disconnect_signals (FtCompactTimerView* self);
static void ft_compact_timer_view_real_map (GtkWidget* base);
static void ft_compact_timer_view_real_unmap (GtkWidget* base);
static void ft_compact_timer_view_real_dispose (GObject* base);
static GObject * ft_compact_timer_view_constructor (GType type,
                                             guint n_construct_properties,
                                             GObjectConstructParam * construct_properties);
static void _ft_compact_timer_view_on_session_manager_notify_current_time_block_g_object_notify (GObject* _sender,
                                                                                          GParamSpec* pspec,
                                                                                          gpointer self);
static void _ft_compact_timer_view_on_session_manager_notify_has_uniform_breaks_g_object_notify (GObject* _sender,
                                                                                          GParamSpec* pspec,
                                                                                          gpointer self);
static void ft_compact_timer_view_finalize (GObject * obj);
static GType ft_compact_timer_view_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
ft_compact_timer_view_get_instance_private (FtCompactTimerView* self)
{
	return G_STRUCT_MEMBER_P (self, FtCompactTimerView_private_offset);
}

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

static gchar*
ft_compact_timer_view_get_state_label (FtCompactTimerView* self)
{
	FtTimeBlock* current_time_block = NULL;
	FtSessionManager* _tmp0_;
	FtTimeBlock* _tmp1_;
	FtTimeBlock* _tmp2_;
	FtTimeBlock* _tmp3_;
	FtState _tmp4_ = 0;
	FtTimeBlock* _tmp5_;
	FtState current_state = 0;
	gchar* _tmp9_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->session_manager;
	_tmp1_ = ft_session_manager_get_current_time_block (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	current_time_block = _tmp3_;
	_tmp5_ = current_time_block;
	if (_tmp5_ != NULL) {
		FtTimeBlock* _tmp6_;
		FtState _tmp7_;
		FtState _tmp8_;
		_tmp6_ = current_time_block;
		_tmp7_ = ft_time_block_get_state (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp4_ = _tmp8_;
	} else {
		_tmp4_ = FT_STATE_STOPPED;
	}
	current_state = _tmp4_;
	_tmp9_ = ft_state_get_label (current_state);
	result = _tmp9_;
	_g_object_unref0 (current_time_block);
	return result;
}

static void
ft_compact_timer_view_update_css_classes (FtCompactTimerView* self)
{
	FtTimer* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->timer;
	if (ft_timer_is_running (_tmp0_)) {
		GtkMenuButton* _tmp1_;
		_tmp1_ = self->priv->state_menubutton;
		gtk_widget_add_css_class ((GtkWidget*) _tmp1_, "timer-running");
	} else {
		GtkMenuButton* _tmp2_;
		_tmp2_ = self->priv->state_menubutton;
		gtk_widget_remove_css_class ((GtkWidget*) _tmp2_, "timer-running");
	}
}

static void
ft_compact_timer_view_update_buttons (FtCompactTimerView* self)
{
	gchar* _tmp0_ = NULL;
	FtTimer* _tmp1_;
	GtkMenuButton* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->timer;
	if (!ft_timer_is_finished (_tmp1_)) {
		gchar* _tmp2_;
		_tmp2_ = ft_compact_timer_view_get_state_label (self);
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp2_;
	} else {
		gchar* _tmp3_;
		_tmp3_ = g_strdup (_ ("Finished!"));
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp3_;
	}
	_tmp4_ = self->priv->state_menubutton;
	gtk_menu_button_set_label (_tmp4_, _tmp0_);
	_g_free0 (_tmp0_);
}

static void
ft_compact_timer_view_update_timer_label_placeholder (FtCompactTimerView* self)
{
	FtSessionTemplate session_template = {0};
	FtSessionManager* _tmp0_;
	FtScheduler* _tmp1_;
	FtScheduler* _tmp2_;
	FtSessionTemplate _tmp3_ = {0};
	FtSessionTemplate _tmp4_;
	FtTimerLabel* _tmp5_;
	FtSessionTemplate _tmp6_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->session_manager;
	_tmp1_ = ft_session_manager_get_scheduler (_tmp0_);
	_tmp2_ = _tmp1_;
	ft_scheduler_get_session_template (_tmp2_, &_tmp3_);
	_tmp4_ = _tmp3_;
	session_template = _tmp4_;
	_tmp5_ = self->priv->timer_label;
	_tmp6_ = session_template;
	ft_timer_label_set_placeholder_has_hours (_tmp5_, _tmp6_.pomodoro_duration >= FT_INTERVAL_HOUR);
}

static void
ft_compact_timer_view_update (FtCompactTimerView* self)
{
	g_return_if_fail (self != NULL);
	ft_compact_timer_view_update_css_classes (self);
	ft_compact_timer_view_update_buttons (self);
	ft_compact_timer_view_update_timer_label_placeholder (self);
}

static void
ft_compact_timer_view_on_timer_state_changed (FtCompactTimerView* self,
                                              const FtTimerState* current_state,
                                              const FtTimerState* previous_state)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (current_state != NULL);
	g_return_if_fail (previous_state != NULL);
	ft_compact_timer_view_update (self);
}

static void
ft_compact_timer_view_on_current_time_block_changed (FtCompactTimerView* self)
{
	g_return_if_fail (self != NULL);
	ft_compact_timer_view_update_buttons (self);
}

static void
_ft_compact_timer_view_on_current_time_block_changed_ft_time_block_changed (FtTimeBlock* _sender,
                                                                            gpointer self)
{
	ft_compact_timer_view_on_current_time_block_changed ((FtCompactTimerView*) self);
}

static void
ft_compact_timer_view_on_session_manager_notify_current_time_block (FtCompactTimerView* self)
{
	FtTimeBlock* current_time_block = NULL;
	FtSessionManager* _tmp0_;
	FtTimeBlock* _tmp1_;
	FtTimeBlock* _tmp2_;
	FtTimeBlock* _tmp3_;
	FtTimeBlock* _tmp5_;
	FtTimeBlock* _tmp8_;
	FtTimeBlock* _tmp9_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->session_manager;
	_tmp1_ = ft_session_manager_get_current_time_block (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	current_time_block = _tmp3_;
	if (self->priv->current_time_block_changed_id != ((gulong) 0)) {
		FtTimeBlock* _tmp4_;
		_tmp4_ = self->priv->current_time_block;
		g_signal_handler_disconnect ((GObject*) _tmp4_, self->priv->current_time_block_changed_id);
		self->priv->current_time_block_changed_id = (gulong) 0;
	}
	_tmp5_ = current_time_block;
	if (_tmp5_ != NULL) {
		FtTimeBlock* _tmp6_;
		gulong _tmp7_;
		_tmp6_ = current_time_block;
		_tmp7_ = g_signal_connect_object (_tmp6_, "changed", (GCallback) _ft_compact_timer_view_on_current_time_block_changed_ft_time_block_changed, self, 0);
		self->priv->current_time_block_changed_id = _tmp7_;
	}
	_tmp8_ = current_time_block;
	_tmp9_ = _g_object_ref0 (_tmp8_);
	_g_object_unref0 (self->priv->current_time_block);
	self->priv->current_time_block = _tmp9_;
	ft_compact_timer_view_on_current_time_block_changed (self);
	_g_object_unref0 (current_time_block);
}

static void
ft_compact_timer_view_on_session_manager_notify_has_uniform_breaks (FtCompactTimerView* self)
{
	GMenuModel* _tmp0_ = NULL;
	FtSessionManager* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	GtkMenuButton* _tmp6_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->session_manager;
	_tmp2_ = ft_session_manager_get_has_uniform_breaks (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_) {
		GMenuModel* _tmp4_;
		_tmp4_ = self->priv->uniform_state_menu;
		_tmp0_ = _tmp4_;
	} else {
		GMenuModel* _tmp5_;
		_tmp5_ = self->priv->state_menu;
		_tmp0_ = _tmp5_;
	}
	_tmp6_ = self->priv->state_menubutton;
	gtk_menu_button_set_menu_model (_tmp6_, _tmp0_);
}

static void
_ft_compact_timer_view_on_timer_state_changed_ft_timer_state_changed (FtTimer* _sender,
                                                                      const FtTimerState* current_state,
                                                                      const FtTimerState* previous_state,
                                                                      gpointer self)
{
	ft_compact_timer_view_on_timer_state_changed ((FtCompactTimerView*) self, current_state, previous_state);
}

static void
ft_compact_timer_view_connect_signals (FtCompactTimerView* self)
{
	g_return_if_fail (self != NULL);
	if (self->priv->timer_state_changed_id == ((gulong) 0)) {
		FtTimer* _tmp0_;
		gulong _tmp1_;
		_tmp0_ = self->priv->timer;
		_tmp1_ = g_signal_connect_object (_tmp0_, "state-changed", (GCallback) _ft_compact_timer_view_on_timer_state_changed_ft_timer_state_changed, self, 0);
		self->priv->timer_state_changed_id = _tmp1_;
	}
}

static void
ft_compact_timer_view_disconnect_signals (FtCompactTimerView* self)
{
	g_return_if_fail (self != NULL);
	if (self->priv->timer_state_changed_id != ((gulong) 0)) {
		FtTimer* _tmp0_;
		_tmp0_ = self->priv->timer;
		g_signal_handler_disconnect ((GObject*) _tmp0_, self->priv->timer_state_changed_id);
		self->priv->timer_state_changed_id = (gulong) 0;
	}
}

static void
ft_compact_timer_view_real_map (GtkWidget* base)
{
	FtCompactTimerView * self;
	FtSessionManager* _tmp0_;
	self = (FtCompactTimerView*) base;
	_tmp0_ = self->priv->session_manager;
	ft_session_manager_ensure_session (_tmp0_, FT_TIMESTAMP_UNDEFINED);
	ft_compact_timer_view_update (self);
	GTK_WIDGET_CLASS (ft_compact_timer_view_parent_class)->map ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, adw_bin_get_type (), AdwBin));
	ft_compact_timer_view_connect_signals (self);
}

static void
ft_compact_timer_view_real_unmap (GtkWidget* base)
{
	FtCompactTimerView * self;
	self = (FtCompactTimerView*) base;
	GTK_WIDGET_CLASS (ft_compact_timer_view_parent_class)->unmap ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, adw_bin_get_type (), AdwBin));
	ft_compact_timer_view_disconnect_signals (self);
}

static void
ft_compact_timer_view_real_dispose (GObject* base)
{
	FtCompactTimerView * self;
	self = (FtCompactTimerView*) base;
	ft_compact_timer_view_disconnect_signals (self);
	if (self->priv->current_time_block_changed_id != ((gulong) 0)) {
		FtTimeBlock* _tmp0_;
		_tmp0_ = self->priv->current_time_block;
		g_signal_handler_disconnect ((GObject*) _tmp0_, self->priv->current_time_block_changed_id);
		self->priv->current_time_block_changed_id = (gulong) 0;
	}
	if (self->priv->notify_current_time_block_id != ((gulong) 0)) {
		FtSessionManager* _tmp1_;
		_tmp1_ = self->priv->session_manager;
		g_signal_handler_disconnect ((GObject*) _tmp1_, self->priv->notify_current_time_block_id);
		self->priv->notify_current_time_block_id = (gulong) 0;
	}
	if (self->priv->notify_has_uniform_breaks_id != ((gulong) 0)) {
		FtSessionManager* _tmp2_;
		_tmp2_ = self->priv->session_manager;
		g_signal_handler_disconnect ((GObject*) _tmp2_, self->priv->notify_has_uniform_breaks_id);
		self->priv->notify_has_uniform_breaks_id = (gulong) 0;
	}
	_g_object_unref0 (self->priv->state_menu);
	self->priv->state_menu = NULL;
	_g_object_unref0 (self->priv->uniform_state_menu);
	self->priv->uniform_state_menu = NULL;
	_g_object_unref0 (self->priv->current_time_block);
	self->priv->current_time_block = NULL;
	_g_object_unref0 (self->priv->session_manager);
	self->priv->session_manager = NULL;
	_g_object_unref0 (self->priv->timer);
	self->priv->timer = NULL;
	G_OBJECT_CLASS (ft_compact_timer_view_parent_class)->dispose ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (self, adw_bin_get_type (), AdwBin));
}

FtCompactTimerView*
ft_compact_timer_view_construct (GType object_type)
{
	FtCompactTimerView * self = NULL;
	self = (FtCompactTimerView*) g_object_new (object_type, NULL);
	return self;
}

FtCompactTimerView*
ft_compact_timer_view_new (void)
{
	return ft_compact_timer_view_construct (FT_TYPE_COMPACT_TIMER_VIEW);
}

static void
_ft_compact_timer_view_on_session_manager_notify_current_time_block_g_object_notify (GObject* _sender,
                                                                                     GParamSpec* pspec,
                                                                                     gpointer self)
{
	ft_compact_timer_view_on_session_manager_notify_current_time_block ((FtCompactTimerView*) self);
}

static void
_ft_compact_timer_view_on_session_manager_notify_has_uniform_breaks_g_object_notify (GObject* _sender,
                                                                                     GParamSpec* pspec,
                                                                                     gpointer self)
{
	ft_compact_timer_view_on_session_manager_notify_has_uniform_breaks ((FtCompactTimerView*) self);
}

static GObject *
ft_compact_timer_view_constructor (GType type,
                                   guint n_construct_properties,
                                   GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	FtCompactTimerView * self;
	FtSessionManager* _tmp0_;
	FtSessionManager* _tmp1_;
	FtSessionManager* _tmp2_;
	FtTimer* _tmp3_;
	FtTimer* _tmp4_;
	FtTimer* _tmp5_;
	GtkBuilder* builder = NULL;
	GtkBuilder* _tmp6_;
	GtkBuilder* _tmp7_;
	GObject* _tmp8_;
	GMenuModel* _tmp9_;
	GtkBuilder* _tmp10_;
	GObject* _tmp11_;
	GMenuModel* _tmp12_;
	FtSessionManager* _tmp13_;
	gulong _tmp14_;
	FtSessionManager* _tmp15_;
	gulong _tmp16_;
	parent_class = G_OBJECT_CLASS (ft_compact_timer_view_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_COMPACT_TIMER_VIEW, FtCompactTimerView);
	_tmp0_ = ft_session_manager_get_default ();
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->session_manager);
	self->priv->session_manager = _tmp1_;
	_tmp2_ = self->priv->session_manager;
	_tmp3_ = ft_session_manager_get_timer (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = _g_object_ref0 (_tmp4_);
	_g_object_unref0 (self->priv->timer);
	self->priv->timer = _tmp5_;
	_tmp6_ = gtk_builder_new_from_resource ("/io/github/focustimerhq/FocusTimer/ui/main/timer/menus.ui");
	builder = _tmp6_;
	_tmp7_ = builder;
	_tmp8_ = gtk_builder_get_object (_tmp7_, "state_menu");
	_tmp9_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, g_menu_model_get_type (), GMenuModel));
	_g_object_unref0 (self->priv->state_menu);
	self->priv->state_menu = _tmp9_;
	_tmp10_ = builder;
	_tmp11_ = gtk_builder_get_object (_tmp10_, "uniform_state_menu");
	_tmp12_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, g_menu_model_get_type (), GMenuModel));
	_g_object_unref0 (self->priv->uniform_state_menu);
	self->priv->uniform_state_menu = _tmp12_;
	_tmp13_ = self->priv->session_manager;
	_tmp14_ = g_signal_connect_object ((GObject*) _tmp13_, "notify::current-time-block", (GCallback) _ft_compact_timer_view_on_session_manager_notify_current_time_block_g_object_notify, self, 0);
	self->priv->notify_current_time_block_id = _tmp14_;
	_tmp15_ = self->priv->session_manager;
	_tmp16_ = g_signal_connect_object ((GObject*) _tmp15_, "notify::has-uniform-breaks", (GCallback) _ft_compact_timer_view_on_session_manager_notify_has_uniform_breaks_g_object_notify, self, 0);
	self->priv->notify_has_uniform_breaks_id = _tmp16_;
	ft_compact_timer_view_on_session_manager_notify_current_time_block (self);
	ft_compact_timer_view_on_session_manager_notify_has_uniform_breaks (self);
	_g_object_unref0 (builder);
	return obj;
}

static void
ft_compact_timer_view_class_init (FtCompactTimerViewClass * klass,
                                  gpointer klass_data)
{
	ft_compact_timer_view_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FtCompactTimerView_private_offset);
	((GtkWidgetClass *) klass)->map = (void (*) (GtkWidget*)) ft_compact_timer_view_real_map;
	((GtkWidgetClass *) klass)->unmap = (void (*) (GtkWidget*)) ft_compact_timer_view_real_unmap;
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) ft_compact_timer_view_real_dispose;
	G_OBJECT_CLASS (klass)->constructor = ft_compact_timer_view_constructor;
	G_OBJECT_CLASS (klass)->finalize = ft_compact_timer_view_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/io/github/focustimerhq/FocusTimer/ui/main/timer/compact-timer-view.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "state_menubutton", FALSE, FtCompactTimerView_private_offset + G_STRUCT_OFFSET (FtCompactTimerViewPrivate, state_menubutton));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "timer_label", FALSE, FtCompactTimerView_private_offset + G_STRUCT_OFFSET (FtCompactTimerViewPrivate, timer_label));
	gtk_widget_class_set_css_name (GTK_WIDGET_CLASS (klass), "compacttimerview");
}

static void
ft_compact_timer_view_gtk_buildable_interface_init (GtkBuildableIface * iface,
                                                    gpointer iface_data)
{
	ft_compact_timer_view_gtk_buildable_parent_iface = g_type_interface_peek_parent (iface);
}

static void
ft_compact_timer_view_instance_init (FtCompactTimerView * self,
                                     gpointer klass)
{
	self->priv = ft_compact_timer_view_get_instance_private (self);
	self->priv->timer_state_changed_id = (gulong) 0;
	self->priv->notify_current_time_block_id = (gulong) 0;
	self->priv->notify_has_uniform_breaks_id = (gulong) 0;
	self->priv->current_time_block_changed_id = (gulong) 0;
	g_type_ensure (FT_TYPE_TIMER_LABEL);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
ft_compact_timer_view_finalize (GObject * obj)
{
	FtCompactTimerView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_COMPACT_TIMER_VIEW, FtCompactTimerView);
	_g_object_unref0 (self->priv->session_manager);
	_g_object_unref0 (self->priv->timer);
	_g_object_unref0 (self->priv->state_menu);
	_g_object_unref0 (self->priv->uniform_state_menu);
	_g_object_unref0 (self->priv->current_time_block);
	G_OBJECT_CLASS (ft_compact_timer_view_parent_class)->finalize (obj);
}

static GType
ft_compact_timer_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FtCompactTimerViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_compact_timer_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtCompactTimerView), 0, (GInstanceInitFunc) ft_compact_timer_view_instance_init, NULL };
	static const GInterfaceInfo gtk_buildable_info = { (GInterfaceInitFunc) ft_compact_timer_view_gtk_buildable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType ft_compact_timer_view_type_id;
	ft_compact_timer_view_type_id = g_type_register_static (adw_bin_get_type (), "FtCompactTimerView", &g_define_type_info, 0);
	g_type_add_interface_static (ft_compact_timer_view_type_id, gtk_buildable_get_type (), &gtk_buildable_info);
	FtCompactTimerView_private_offset = g_type_add_instance_private (ft_compact_timer_view_type_id, sizeof (FtCompactTimerViewPrivate));
	return ft_compact_timer_view_type_id;
}

GType
ft_compact_timer_view_get_type (void)
{
	static volatile gsize ft_compact_timer_view_type_id__once = 0;
	if (g_once_init_enter (&ft_compact_timer_view_type_id__once)) {
		GType ft_compact_timer_view_type_id;
		ft_compact_timer_view_type_id = ft_compact_timer_view_get_type_once ();
		g_once_init_leave (&ft_compact_timer_view_type_id__once, ft_compact_timer_view_type_id);
	}
	return ft_compact_timer_view_type_id__once;
}

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

