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

/* BreakType.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 "daemon.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gio/gio.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_DAEMON_BREAK_BREAK_TYPE_0_PROPERTY,
	BREAK_TIMER_DAEMON_BREAK_BREAK_TYPE_ID_PROPERTY,
	BREAK_TIMER_DAEMON_BREAK_BREAK_TYPE_BREAK_CONTROLLER_PROPERTY,
	BREAK_TIMER_DAEMON_BREAK_BREAK_TYPE_BREAK_VIEW_PROPERTY,
	BREAK_TIMER_DAEMON_BREAK_BREAK_TYPE_NUM_PROPERTIES
};
static GParamSpec* break_timer_daemon_break_break_type_properties[BREAK_TIMER_DAEMON_BREAK_BREAK_TYPE_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _BreakTimerDaemonBreakBreakTypePrivate {
	gchar* _id;
	BreakTimerDaemonBreakBreakController* _break_controller;
	BreakTimerDaemonBreakBreakView* _break_view;
};

static gint BreakTimerDaemonBreakBreakType_private_offset;
static gpointer break_timer_daemon_break_break_type_parent_class = NULL;
static GInitableIface * break_timer_daemon_break_break_type_g_initable_parent_iface = NULL;

static void break_timer_daemon_break_break_type_set_id (BreakTimerDaemonBreakBreakType* self,
                                                 const gchar* value);
static void break_timer_daemon_break_break_type_set_break_controller (BreakTimerDaemonBreakBreakType* self,
                                                               BreakTimerDaemonBreakBreakController* value);
static void break_timer_daemon_break_break_type_set_break_view (BreakTimerDaemonBreakBreakType* self,
                                                         BreakTimerDaemonBreakBreakView* value);
static gboolean break_timer_daemon_break_break_type_real_init (BreakTimerDaemonBreakBreakType* self,
                                                        GCancellable* cancellable,
                                                        GError** error);
static void break_timer_daemon_break_break_type_finalize (GObject * obj);
static GType break_timer_daemon_break_break_type_get_type_once (void);
static void _vala_break_timer_daemon_break_break_type_get_property (GObject * object,
                                                             guint property_id,
                                                             GValue * value,
                                                             GParamSpec * pspec);
static void _vala_break_timer_daemon_break_break_type_set_property (GObject * object,
                                                             guint property_id,
                                                             const GValue * value,
                                                             GParamSpec * pspec);

static inline gpointer
break_timer_daemon_break_break_type_get_instance_private (BreakTimerDaemonBreakBreakType* self)
{
	return G_STRUCT_MEMBER_P (self, BreakTimerDaemonBreakBreakType_private_offset);
}

BreakTimerDaemonBreakBreakType*
break_timer_daemon_break_break_type_construct (GType object_type,
                                               const gchar* id,
                                               BreakTimerDaemonBreakBreakController* break_controller,
                                               BreakTimerDaemonBreakBreakView* break_view)
{
	BreakTimerDaemonBreakBreakType * self = NULL;
	g_return_val_if_fail (id != NULL, NULL);
	g_return_val_if_fail (break_controller != NULL, NULL);
	g_return_val_if_fail (break_view != NULL, NULL);
	self = (BreakTimerDaemonBreakBreakType*) g_object_new (object_type, NULL);
	break_timer_daemon_break_break_type_set_id (self, id);
	break_timer_daemon_break_break_type_set_break_controller (self, break_controller);
	break_timer_daemon_break_break_type_set_break_view (self, break_view);
	return self;
}

static gboolean
break_timer_daemon_break_break_type_real_init (BreakTimerDaemonBreakBreakType* self,
                                               GCancellable* cancellable,
                                               GError** error)
{
	gboolean result;
	result = TRUE;
	return result;
}

gboolean
break_timer_daemon_break_break_type_init (BreakTimerDaemonBreakBreakType* self,
                                          GCancellable* cancellable,
                                          GError** error)
{
	BreakTimerDaemonBreakBreakTypeClass* _klass_;
	g_return_val_if_fail (self != NULL, FALSE);
	_klass_ = BREAK_TIMER_DAEMON_BREAK_BREAK_TYPE_GET_CLASS (self);
	if (_klass_->init) {
		return _klass_->init (self, cancellable, error);
	}
	return FALSE;
}

const gchar*
break_timer_daemon_break_break_type_get_id (BreakTimerDaemonBreakBreakType* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_id;
	result = _tmp0_;
	return result;
}

static void
break_timer_daemon_break_break_type_set_id (BreakTimerDaemonBreakBreakType* self,
                                            const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = break_timer_daemon_break_break_type_get_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_id);
		self->priv->_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, break_timer_daemon_break_break_type_properties[BREAK_TIMER_DAEMON_BREAK_BREAK_TYPE_ID_PROPERTY]);
	}
}

BreakTimerDaemonBreakBreakController*
break_timer_daemon_break_break_type_get_break_controller (BreakTimerDaemonBreakBreakType* self)
{
	BreakTimerDaemonBreakBreakController* result;
	BreakTimerDaemonBreakBreakController* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_break_controller;
	result = _tmp0_;
	return result;
}

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

static void
break_timer_daemon_break_break_type_set_break_controller (BreakTimerDaemonBreakBreakType* self,
                                                          BreakTimerDaemonBreakBreakController* value)
{
	BreakTimerDaemonBreakBreakController* old_value;
	g_return_if_fail (self != NULL);
	old_value = break_timer_daemon_break_break_type_get_break_controller (self);
	if (old_value != value) {
		BreakTimerDaemonBreakBreakController* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_break_controller);
		self->priv->_break_controller = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, break_timer_daemon_break_break_type_properties[BREAK_TIMER_DAEMON_BREAK_BREAK_TYPE_BREAK_CONTROLLER_PROPERTY]);
	}
}

BreakTimerDaemonBreakBreakView*
break_timer_daemon_break_break_type_get_break_view (BreakTimerDaemonBreakBreakType* self)
{
	BreakTimerDaemonBreakBreakView* result;
	BreakTimerDaemonBreakBreakView* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_break_view;
	result = _tmp0_;
	return result;
}

static void
break_timer_daemon_break_break_type_set_break_view (BreakTimerDaemonBreakBreakType* self,
                                                    BreakTimerDaemonBreakBreakView* value)
{
	BreakTimerDaemonBreakBreakView* old_value;
	g_return_if_fail (self != NULL);
	old_value = break_timer_daemon_break_break_type_get_break_view (self);
	if (old_value != value) {
		BreakTimerDaemonBreakBreakView* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_break_view);
		self->priv->_break_view = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, break_timer_daemon_break_break_type_properties[BREAK_TIMER_DAEMON_BREAK_BREAK_TYPE_BREAK_VIEW_PROPERTY]);
	}
}

static void
break_timer_daemon_break_break_type_class_init (BreakTimerDaemonBreakBreakTypeClass * klass,
                                                gpointer klass_data)
{
	break_timer_daemon_break_break_type_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BreakTimerDaemonBreakBreakType_private_offset);
	((BreakTimerDaemonBreakBreakTypeClass *) klass)->init = (gboolean (*) (BreakTimerDaemonBreakBreakType*, GCancellable*, GError**)) break_timer_daemon_break_break_type_real_init;
	G_OBJECT_CLASS (klass)->get_property = _vala_break_timer_daemon_break_break_type_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_break_timer_daemon_break_break_type_set_property;
	G_OBJECT_CLASS (klass)->finalize = break_timer_daemon_break_break_type_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), BREAK_TIMER_DAEMON_BREAK_BREAK_TYPE_ID_PROPERTY, break_timer_daemon_break_break_type_properties[BREAK_TIMER_DAEMON_BREAK_BREAK_TYPE_ID_PROPERTY] = g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BREAK_TIMER_DAEMON_BREAK_BREAK_TYPE_BREAK_CONTROLLER_PROPERTY, break_timer_daemon_break_break_type_properties[BREAK_TIMER_DAEMON_BREAK_BREAK_TYPE_BREAK_CONTROLLER_PROPERTY] = g_param_spec_object ("break-controller", "break-controller", "break-controller", BREAK_TIMER_DAEMON_BREAK_TYPE_BREAK_CONTROLLER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BREAK_TIMER_DAEMON_BREAK_BREAK_TYPE_BREAK_VIEW_PROPERTY, break_timer_daemon_break_break_type_properties[BREAK_TIMER_DAEMON_BREAK_BREAK_TYPE_BREAK_VIEW_PROPERTY] = g_param_spec_object ("break-view", "break-view", "break-view", BREAK_TIMER_DAEMON_BREAK_TYPE_BREAK_VIEW, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
break_timer_daemon_break_break_type_g_initable_interface_init (GInitableIface * iface,
                                                               gpointer iface_data)
{
	break_timer_daemon_break_break_type_g_initable_parent_iface = g_type_interface_peek_parent (iface);
	iface->init = (gboolean (*) (GInitable*, GCancellable*, GError**)) break_timer_daemon_break_break_type_init;
}

static void
break_timer_daemon_break_break_type_instance_init (BreakTimerDaemonBreakBreakType * self,
                                                   gpointer klass)
{
	self->priv = break_timer_daemon_break_break_type_get_instance_private (self);
}

static void
break_timer_daemon_break_break_type_finalize (GObject * obj)
{
	BreakTimerDaemonBreakBreakType * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BREAK_TIMER_DAEMON_BREAK_TYPE_BREAK_TYPE, BreakTimerDaemonBreakBreakType);
	_g_free0 (self->priv->_id);
	_g_object_unref0 (self->priv->_break_controller);
	_g_object_unref0 (self->priv->_break_view);
	G_OBJECT_CLASS (break_timer_daemon_break_break_type_parent_class)->finalize (obj);
}

static GType
break_timer_daemon_break_break_type_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BreakTimerDaemonBreakBreakTypeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) break_timer_daemon_break_break_type_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BreakTimerDaemonBreakBreakType), 0, (GInstanceInitFunc) break_timer_daemon_break_break_type_instance_init, NULL };
	static const GInterfaceInfo g_initable_info = { (GInterfaceInitFunc) break_timer_daemon_break_break_type_g_initable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType break_timer_daemon_break_break_type_type_id;
	break_timer_daemon_break_break_type_type_id = g_type_register_static (G_TYPE_OBJECT, "BreakTimerDaemonBreakBreakType", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	g_type_add_interface_static (break_timer_daemon_break_break_type_type_id, g_initable_get_type (), &g_initable_info);
	BreakTimerDaemonBreakBreakType_private_offset = g_type_add_instance_private (break_timer_daemon_break_break_type_type_id, sizeof (BreakTimerDaemonBreakBreakTypePrivate));
	return break_timer_daemon_break_break_type_type_id;
}

GType
break_timer_daemon_break_break_type_get_type (void)
{
	static volatile gsize break_timer_daemon_break_break_type_type_id__once = 0;
	if (g_once_init_enter (&break_timer_daemon_break_break_type_type_id__once)) {
		GType break_timer_daemon_break_break_type_type_id;
		break_timer_daemon_break_break_type_type_id = break_timer_daemon_break_break_type_get_type_once ();
		g_once_init_leave (&break_timer_daemon_break_break_type_type_id__once, break_timer_daemon_break_break_type_type_id);
	}
	return break_timer_daemon_break_break_type_type_id__once;
}

static void
_vala_break_timer_daemon_break_break_type_get_property (GObject * object,
                                                        guint property_id,
                                                        GValue * value,
                                                        GParamSpec * pspec)
{
	BreakTimerDaemonBreakBreakType * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BREAK_TIMER_DAEMON_BREAK_TYPE_BREAK_TYPE, BreakTimerDaemonBreakBreakType);
	switch (property_id) {
		case BREAK_TIMER_DAEMON_BREAK_BREAK_TYPE_ID_PROPERTY:
		g_value_set_string (value, break_timer_daemon_break_break_type_get_id (self));
		break;
		case BREAK_TIMER_DAEMON_BREAK_BREAK_TYPE_BREAK_CONTROLLER_PROPERTY:
		g_value_set_object (value, break_timer_daemon_break_break_type_get_break_controller (self));
		break;
		case BREAK_TIMER_DAEMON_BREAK_BREAK_TYPE_BREAK_VIEW_PROPERTY:
		g_value_set_object (value, break_timer_daemon_break_break_type_get_break_view (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_break_timer_daemon_break_break_type_set_property (GObject * object,
                                                        guint property_id,
                                                        const GValue * value,
                                                        GParamSpec * pspec)
{
	BreakTimerDaemonBreakBreakType * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BREAK_TIMER_DAEMON_BREAK_TYPE_BREAK_TYPE, BreakTimerDaemonBreakBreakType);
	switch (property_id) {
		case BREAK_TIMER_DAEMON_BREAK_BREAK_TYPE_ID_PROPERTY:
		break_timer_daemon_break_break_type_set_id (self, g_value_get_string (value));
		break;
		case BREAK_TIMER_DAEMON_BREAK_BREAK_TYPE_BREAK_CONTROLLER_PROPERTY:
		break_timer_daemon_break_break_type_set_break_controller (self, g_value_get_object (value));
		break;
		case BREAK_TIMER_DAEMON_BREAK_BREAK_TYPE_BREAK_VIEW_PROPERTY:
		break_timer_daemon_break_break_type_set_break_view (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

