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

/* TimerBreakSettingsWidget.vala
 *
 * Copyright 2020-2021 Dylan McCall <dylan@dylanmccall.ca>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

#include "settings.h"
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <adwaita.h>
#include <glib/gi18n-lib.h>
#include <gio/gio.h>
#include <gtk/gtk.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  {
	BREAK_TIMER_SETTINGS_TIMER_BREAK_TIMER_BREAK_SETTINGS_WIDGET_0_PROPERTY,
	BREAK_TIMER_SETTINGS_TIMER_BREAK_TIMER_BREAK_SETTINGS_WIDGET_NUM_PROPERTIES
};
static GParamSpec* break_timer_settings_timer_break_timer_break_settings_widget_properties[BREAK_TIMER_SETTINGS_TIMER_BREAK_TIMER_BREAK_SETTINGS_WIDGET_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

static gpointer break_timer_settings_timer_break_timer_break_settings_widget_parent_class = NULL;

static GType break_timer_settings_timer_break_timer_break_settings_widget_get_type_once (void);

BreakTimerSettingsTimerBreakTimerBreakSettingsWidget*
break_timer_settings_timer_break_timer_break_settings_widget_construct (GType object_type,
                                                                        BreakTimerSettingsTimerBreakTimerBreakType* break_type,
                                                                        const gchar* title,
                                                                        const gchar* description)
{
	BreakTimerSettingsTimerBreakTimerBreakSettingsWidget * self = NULL;
	BreakTimerSettingsWidgetsTimeChooserRow* interval_row = NULL;
	BreakTimerSettingsTimerBreakBreakTimeOption** _tmp0_;
	gint _tmp0__length1;
	BreakTimerSettingsWidgetsTimeChooserRow* _tmp1_;
	GSettings* _tmp2_;
	BreakTimerSettingsWidgetsTimeChooserRow* duration_row = NULL;
	BreakTimerSettingsTimerBreakBreakTimeOption** _tmp3_;
	gint _tmp3__length1;
	BreakTimerSettingsWidgetsTimeChooserRow* _tmp4_;
	GSettings* _tmp5_;
	g_return_val_if_fail (break_type != NULL, NULL);
	g_return_val_if_fail (title != NULL, NULL);
	self = (BreakTimerSettingsTimerBreakTimerBreakSettingsWidget*) break_timer_settings_break_break_settings_widget_construct (object_type, title, description);
	_tmp0_ = break_type->interval_options;
	_tmp0__length1 = break_type->interval_options_length1;
	_tmp1_ = break_timer_settings_widgets_time_chooser_row_new (_tmp0_, _tmp0__length1);
	g_object_ref_sink (_tmp1_);
	interval_row = _tmp1_;
	adw_preferences_row_set_title ((AdwPreferencesRow*) interval_row, _ ("Every"));
	_tmp2_ = ((BreakTimerSettingsBreakBreakType*) break_type)->settings;
	g_settings_bind (_tmp2_, "interval-seconds", (GObject*) interval_row, "time-seconds", G_SETTINGS_BIND_DEFAULT);
	adw_preferences_group_add ((AdwPreferencesGroup*) self, (GtkWidget*) interval_row);
	_tmp3_ = break_type->duration_options;
	_tmp3__length1 = break_type->duration_options_length1;
	_tmp4_ = break_timer_settings_widgets_time_chooser_row_new (_tmp3_, _tmp3__length1);
	g_object_ref_sink (_tmp4_);
	duration_row = _tmp4_;
	adw_preferences_row_set_title ((AdwPreferencesRow*) duration_row, _ ("For"));
	_tmp5_ = ((BreakTimerSettingsBreakBreakType*) break_type)->settings;
	g_settings_bind (_tmp5_, "duration-seconds", (GObject*) duration_row, "time-seconds", G_SETTINGS_BIND_DEFAULT);
	adw_preferences_group_add ((AdwPreferencesGroup*) self, (GtkWidget*) duration_row);
	_g_object_unref0 (duration_row);
	_g_object_unref0 (interval_row);
	return self;
}

static void
break_timer_settings_timer_break_timer_break_settings_widget_class_init (BreakTimerSettingsTimerBreakTimerBreakSettingsWidgetClass * klass,
                                                                         gpointer klass_data)
{
	break_timer_settings_timer_break_timer_break_settings_widget_parent_class = g_type_class_peek_parent (klass);
}

static void
break_timer_settings_timer_break_timer_break_settings_widget_instance_init (BreakTimerSettingsTimerBreakTimerBreakSettingsWidget * self,
                                                                            gpointer klass)
{
}

static GType
break_timer_settings_timer_break_timer_break_settings_widget_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BreakTimerSettingsTimerBreakTimerBreakSettingsWidgetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) break_timer_settings_timer_break_timer_break_settings_widget_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BreakTimerSettingsTimerBreakTimerBreakSettingsWidget), 0, (GInstanceInitFunc) break_timer_settings_timer_break_timer_break_settings_widget_instance_init, NULL };
	GType break_timer_settings_timer_break_timer_break_settings_widget_type_id;
	break_timer_settings_timer_break_timer_break_settings_widget_type_id = g_type_register_static (BREAK_TIMER_SETTINGS_BREAK_TYPE_BREAK_SETTINGS_WIDGET, "BreakTimerSettingsTimerBreakTimerBreakSettingsWidget", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	return break_timer_settings_timer_break_timer_break_settings_widget_type_id;
}

GType
break_timer_settings_timer_break_timer_break_settings_widget_get_type (void)
{
	static volatile gsize break_timer_settings_timer_break_timer_break_settings_widget_type_id__once = 0;
	if (g_once_init_enter (&break_timer_settings_timer_break_timer_break_settings_widget_type_id__once)) {
		GType break_timer_settings_timer_break_timer_break_settings_widget_type_id;
		break_timer_settings_timer_break_timer_break_settings_widget_type_id = break_timer_settings_timer_break_timer_break_settings_widget_get_type_once ();
		g_once_init_leave (&break_timer_settings_timer_break_timer_break_settings_widget_type_id__once, break_timer_settings_timer_break_timer_break_settings_widget_type_id);
	}
	return break_timer_settings_timer_break_timer_break_settings_widget_type_id__once;
}

