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

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

#include "ft_ui.h"
#include <stdlib.h>
#include <string.h>
#include <glib.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

static GType ft_stats_page_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

gint
ft_stats_category_from_string (const gchar* category)
{
	const gchar* _tmp0_;
	GQuark _tmp2_ = 0U;
	static GQuark _tmp1_label0 = 0;
	static GQuark _tmp1_label1 = 0;
	static GQuark _tmp1_label2 = 0;
	gint result;
	g_return_val_if_fail (category != NULL, -1);
	_tmp0_ = category;
	_tmp2_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_);
	if (_tmp2_ == ((0 != _tmp1_label0) ? _tmp1_label0 : (_tmp1_label0 = g_quark_from_static_string ("pomodoro")))) {
		switch (0) {
			default:
			{
				result = (gint) FT_STATS_CATEGORY_POMODORO;
				return result;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label1) ? _tmp1_label1 : (_tmp1_label1 = g_quark_from_static_string ("break")))) {
		switch (0) {
			default:
			{
				result = (gint) FT_STATS_CATEGORY_BREAK;
				return result;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label2) ? _tmp1_label2 : (_tmp1_label2 = g_quark_from_static_string ("interruption")))) {
		switch (0) {
			default:
			{
				result = (gint) FT_STATS_CATEGORY_INTERRUPTION;
				return result;
			}
		}
	} else {
		switch (0) {
			default:
			{
				result = (gint) FT_STATS_CATEGORY_INVALID;
				return result;
			}
		}
	}
}

static GType
ft_stats_category_get_type_once (void)
{
	static const GEnumValue values[] = {{FT_STATS_CATEGORY_POMODORO, "FT_STATS_CATEGORY_POMODORO", "pomodoro"}, {FT_STATS_CATEGORY_BREAK, "FT_STATS_CATEGORY_BREAK", "break"}, {FT_STATS_CATEGORY_INTERRUPTION, "FT_STATS_CATEGORY_INTERRUPTION", "interruption"}, {FT_STATS_CATEGORY_INVALID, "FT_STATS_CATEGORY_INVALID", "invalid"}, {0, NULL, NULL}};
	GType ft_stats_category_type_id;
	ft_stats_category_type_id = g_enum_register_static ("FtStatsCategory", values);
	return ft_stats_category_type_id;
}

GType
ft_stats_category_get_type (void)
{
	static volatile gsize ft_stats_category_type_id__once = 0;
	if (g_once_init_enter (&ft_stats_category_type_id__once)) {
		GType ft_stats_category_type_id;
		ft_stats_category_type_id = ft_stats_category_get_type_once ();
		g_once_init_leave (&ft_stats_category_type_id__once, ft_stats_category_type_id);
	}
	return ft_stats_category_type_id__once;
}

void
ft_stats_page_get_date (FtStatsPage* self,
                        GDate * result)
{
	FtStatsPageIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = FT_STATS_PAGE_GET_INTERFACE (self);
	if (_iface_->get_date) {
		_iface_->get_date (self, result);
	}
	return;
}

void
ft_stats_page_set_date (FtStatsPage* self,
                        GDate * value)
{
	FtStatsPageIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = FT_STATS_PAGE_GET_INTERFACE (self);
	if (_iface_->set_date) {
		_iface_->set_date (self, value);
	}
}

static void
ft_stats_page_default_init (FtStatsPageIface * iface,
                            gpointer iface_data)
{
	g_object_interface_install_property (iface, g_param_spec_boxed ("date", "date", "date", G_TYPE_DATE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static GType
ft_stats_page_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FtStatsPageIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_stats_page_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType ft_stats_page_type_id;
	ft_stats_page_type_id = g_type_register_static (G_TYPE_INTERFACE, "FtStatsPage", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (ft_stats_page_type_id, gtk_widget_get_type ());
	return ft_stats_page_type_id;
}

GType
ft_stats_page_get_type (void)
{
	static volatile gsize ft_stats_page_type_id__once = 0;
	if (g_once_init_enter (&ft_stats_page_type_id__once)) {
		GType ft_stats_page_type_id;
		ft_stats_page_type_id = ft_stats_page_get_type_once ();
		g_once_init_leave (&ft_stats_page_type_id__once, ft_stats_page_type_id);
	}
	return ft_stats_page_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;
}

