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

/* BreakStatusWidget.vala
 *
 * Copyright 2020 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.h>
#include <glib-object.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_BREAK_BREAK_STATUS_WIDGET_0_PROPERTY,
	BREAK_TIMER_SETTINGS_BREAK_BREAK_STATUS_WIDGET_BREAK_TYPE_PROPERTY,
	BREAK_TIMER_SETTINGS_BREAK_BREAK_STATUS_WIDGET_IS_ENABLED_PROPERTY,
	BREAK_TIMER_SETTINGS_BREAK_BREAK_STATUS_WIDGET_NUM_PROPERTIES
};
static GParamSpec* break_timer_settings_break_break_status_widget_properties[BREAK_TIMER_SETTINGS_BREAK_BREAK_STATUS_WIDGET_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _BreakTimerSettingsBreakBreakStatusWidgetPrivate {
	BreakTimerSettingsBreakBreakType* _break_type;
	gboolean _is_enabled;
};

static gint BreakTimerSettingsBreakBreakStatusWidget_private_offset;
static gpointer break_timer_settings_break_break_status_widget_parent_class = NULL;

static void break_timer_settings_break_break_status_widget_set_break_type (BreakTimerSettingsBreakBreakStatusWidget* self,
                                                                    BreakTimerSettingsBreakBreakType* value);
static void break_timer_settings_break_break_status_widget_finalize (GObject * obj);
static GType break_timer_settings_break_break_status_widget_get_type_once (void);
static void _vala_break_timer_settings_break_break_status_widget_get_property (GObject * object,
                                                                        guint property_id,
                                                                        GValue * value,
                                                                        GParamSpec * pspec);
static void _vala_break_timer_settings_break_break_status_widget_set_property (GObject * object,
                                                                        guint property_id,
                                                                        const GValue * value,
                                                                        GParamSpec * pspec);

static inline gpointer
break_timer_settings_break_break_status_widget_get_instance_private (BreakTimerSettingsBreakBreakStatusWidget* self)
{
	return G_STRUCT_MEMBER_P (self, BreakTimerSettingsBreakBreakStatusWidget_private_offset);
}

BreakTimerSettingsBreakBreakStatusWidget*
break_timer_settings_break_break_status_widget_construct (GType object_type,
                                                          BreakTimerSettingsBreakBreakType* break_type)
{
	BreakTimerSettingsBreakBreakStatusWidget * self = NULL;
	g_return_val_if_fail (break_type != NULL, NULL);
	self = (BreakTimerSettingsBreakBreakStatusWidget*) g_object_new (object_type, NULL);
	break_timer_settings_break_break_status_widget_set_break_type (self, break_type);
	return self;
}

BreakTimerSettingsBreakBreakType*
break_timer_settings_break_break_status_widget_get_break_type (BreakTimerSettingsBreakBreakStatusWidget* self)
{
	BreakTimerSettingsBreakBreakType* result;
	BreakTimerSettingsBreakBreakType* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_break_type;
	result = _tmp0_;
	return result;
}

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

static void
break_timer_settings_break_break_status_widget_set_break_type (BreakTimerSettingsBreakBreakStatusWidget* self,
                                                               BreakTimerSettingsBreakBreakType* value)
{
	BreakTimerSettingsBreakBreakType* old_value;
	g_return_if_fail (self != NULL);
	old_value = break_timer_settings_break_break_status_widget_get_break_type (self);
	if (old_value != value) {
		BreakTimerSettingsBreakBreakType* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_break_type);
		self->priv->_break_type = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, break_timer_settings_break_break_status_widget_properties[BREAK_TIMER_SETTINGS_BREAK_BREAK_STATUS_WIDGET_BREAK_TYPE_PROPERTY]);
	}
}

gboolean
break_timer_settings_break_break_status_widget_get_is_enabled (BreakTimerSettingsBreakBreakStatusWidget* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_enabled;
	return result;
}

void
break_timer_settings_break_break_status_widget_set_is_enabled (BreakTimerSettingsBreakBreakStatusWidget* self,
                                                               gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = break_timer_settings_break_break_status_widget_get_is_enabled (self);
	if (old_value != value) {
		self->priv->_is_enabled = value;
		g_object_notify_by_pspec ((GObject *) self, break_timer_settings_break_break_status_widget_properties[BREAK_TIMER_SETTINGS_BREAK_BREAK_STATUS_WIDGET_IS_ENABLED_PROPERTY]);
	}
}

static void
break_timer_settings_break_break_status_widget_class_init (BreakTimerSettingsBreakBreakStatusWidgetClass * klass,
                                                           gpointer klass_data)
{
	break_timer_settings_break_break_status_widget_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BreakTimerSettingsBreakBreakStatusWidget_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_break_timer_settings_break_break_status_widget_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_break_timer_settings_break_break_status_widget_set_property;
	G_OBJECT_CLASS (klass)->finalize = break_timer_settings_break_break_status_widget_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), BREAK_TIMER_SETTINGS_BREAK_BREAK_STATUS_WIDGET_BREAK_TYPE_PROPERTY, break_timer_settings_break_break_status_widget_properties[BREAK_TIMER_SETTINGS_BREAK_BREAK_STATUS_WIDGET_BREAK_TYPE_PROPERTY] = g_param_spec_object ("break-type", "break-type", "break-type", BREAK_TIMER_SETTINGS_BREAK_TYPE_BREAK_TYPE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BREAK_TIMER_SETTINGS_BREAK_BREAK_STATUS_WIDGET_IS_ENABLED_PROPERTY, break_timer_settings_break_break_status_widget_properties[BREAK_TIMER_SETTINGS_BREAK_BREAK_STATUS_WIDGET_IS_ENABLED_PROPERTY] = g_param_spec_boolean ("is-enabled", "is-enabled", "is-enabled", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
break_timer_settings_break_break_status_widget_instance_init (BreakTimerSettingsBreakBreakStatusWidget * self,
                                                              gpointer klass)
{
	self->priv = break_timer_settings_break_break_status_widget_get_instance_private (self);
	self->priv->_is_enabled = FALSE;
}

static void
break_timer_settings_break_break_status_widget_finalize (GObject * obj)
{
	BreakTimerSettingsBreakBreakStatusWidget * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BREAK_TIMER_SETTINGS_BREAK_TYPE_BREAK_STATUS_WIDGET, BreakTimerSettingsBreakBreakStatusWidget);
	_g_object_unref0 (self->priv->_break_type);
	G_OBJECT_CLASS (break_timer_settings_break_break_status_widget_parent_class)->finalize (obj);
}

static GType
break_timer_settings_break_break_status_widget_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BreakTimerSettingsBreakBreakStatusWidgetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) break_timer_settings_break_break_status_widget_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BreakTimerSettingsBreakBreakStatusWidget), 0, (GInstanceInitFunc) break_timer_settings_break_break_status_widget_instance_init, NULL };
	GType break_timer_settings_break_break_status_widget_type_id;
	break_timer_settings_break_break_status_widget_type_id = g_type_register_static (gtk_box_get_type (), "BreakTimerSettingsBreakBreakStatusWidget", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	BreakTimerSettingsBreakBreakStatusWidget_private_offset = g_type_add_instance_private (break_timer_settings_break_break_status_widget_type_id, sizeof (BreakTimerSettingsBreakBreakStatusWidgetPrivate));
	return break_timer_settings_break_break_status_widget_type_id;
}

GType
break_timer_settings_break_break_status_widget_get_type (void)
{
	static volatile gsize break_timer_settings_break_break_status_widget_type_id__once = 0;
	if (g_once_init_enter (&break_timer_settings_break_break_status_widget_type_id__once)) {
		GType break_timer_settings_break_break_status_widget_type_id;
		break_timer_settings_break_break_status_widget_type_id = break_timer_settings_break_break_status_widget_get_type_once ();
		g_once_init_leave (&break_timer_settings_break_break_status_widget_type_id__once, break_timer_settings_break_break_status_widget_type_id);
	}
	return break_timer_settings_break_break_status_widget_type_id__once;
}

static void
_vala_break_timer_settings_break_break_status_widget_get_property (GObject * object,
                                                                   guint property_id,
                                                                   GValue * value,
                                                                   GParamSpec * pspec)
{
	BreakTimerSettingsBreakBreakStatusWidget * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BREAK_TIMER_SETTINGS_BREAK_TYPE_BREAK_STATUS_WIDGET, BreakTimerSettingsBreakBreakStatusWidget);
	switch (property_id) {
		case BREAK_TIMER_SETTINGS_BREAK_BREAK_STATUS_WIDGET_BREAK_TYPE_PROPERTY:
		g_value_set_object (value, break_timer_settings_break_break_status_widget_get_break_type (self));
		break;
		case BREAK_TIMER_SETTINGS_BREAK_BREAK_STATUS_WIDGET_IS_ENABLED_PROPERTY:
		g_value_set_boolean (value, break_timer_settings_break_break_status_widget_get_is_enabled (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_break_timer_settings_break_break_status_widget_set_property (GObject * object,
                                                                   guint property_id,
                                                                   const GValue * value,
                                                                   GParamSpec * pspec)
{
	BreakTimerSettingsBreakBreakStatusWidget * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BREAK_TIMER_SETTINGS_BREAK_TYPE_BREAK_STATUS_WIDGET, BreakTimerSettingsBreakBreakStatusWidget);
	switch (property_id) {
		case BREAK_TIMER_SETTINGS_BREAK_BREAK_STATUS_WIDGET_BREAK_TYPE_PROPERTY:
		break_timer_settings_break_break_status_widget_set_break_type (self, g_value_get_object (value));
		break;
		case BREAK_TIMER_SETTINGS_BREAK_BREAK_STATUS_WIDGET_IS_ENABLED_PROPERTY:
		break_timer_settings_break_break_status_widget_set_is_enabled (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

