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

/* TimerBreakType.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 <gio/gio.h>
#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include "config.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_TIMER_BREAK_TIMER_BREAK_TYPE_0_PROPERTY,
	BREAK_TIMER_DAEMON_TIMER_BREAK_TIMER_BREAK_TYPE_NUM_PROPERTIES
};
static GParamSpec* break_timer_daemon_timer_break_timer_break_type_properties[BREAK_TIMER_DAEMON_TIMER_BREAK_TIMER_BREAK_TYPE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define BREAK_TIMER_DAEMON_TIMER_BREAK_TYPE_TIMER_BREAK_DBUS_OBJECT (break_timer_daemon_timer_break_timer_break_dbus_object_get_type ())
#define BREAK_TIMER_DAEMON_TIMER_BREAK_TIMER_BREAK_DBUS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BREAK_TIMER_DAEMON_TIMER_BREAK_TYPE_TIMER_BREAK_DBUS_OBJECT, BreakTimerDaemonTimerBreakTimerBreakDBusObject))
#define BREAK_TIMER_DAEMON_TIMER_BREAK_TIMER_BREAK_DBUS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BREAK_TIMER_DAEMON_TIMER_BREAK_TYPE_TIMER_BREAK_DBUS_OBJECT, BreakTimerDaemonTimerBreakTimerBreakDBusObjectClass))
#define BREAK_TIMER_DAEMON_TIMER_BREAK_IS_TIMER_BREAK_DBUS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BREAK_TIMER_DAEMON_TIMER_BREAK_TYPE_TIMER_BREAK_DBUS_OBJECT))
#define BREAK_TIMER_DAEMON_TIMER_BREAK_IS_TIMER_BREAK_DBUS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BREAK_TIMER_DAEMON_TIMER_BREAK_TYPE_TIMER_BREAK_DBUS_OBJECT))
#define BREAK_TIMER_DAEMON_TIMER_BREAK_TIMER_BREAK_DBUS_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BREAK_TIMER_DAEMON_TIMER_BREAK_TYPE_TIMER_BREAK_DBUS_OBJECT, BreakTimerDaemonTimerBreakTimerBreakDBusObjectClass))

typedef struct _BreakTimerDaemonTimerBreakTimerBreakDBusObject BreakTimerDaemonTimerBreakTimerBreakDBusObject;
typedef struct _BreakTimerDaemonTimerBreakTimerBreakDBusObjectClass BreakTimerDaemonTimerBreakTimerBreakDBusObjectClass;
#define _g_free0(var) (var = (g_free (var), NULL))

struct _BreakTimerDaemonTimerBreakTimerBreakTypePrivate {
	GDBusConnection* dbus_connection;
};

static gint BreakTimerDaemonTimerBreakTimerBreakType_private_offset;
static gpointer break_timer_daemon_timer_break_timer_break_type_parent_class = NULL;

static gboolean break_timer_daemon_timer_break_timer_break_type_real_init (BreakTimerDaemonBreakBreakType* base,
                                                                    GCancellable* cancellable,
                                                                    GError** error);
VALA_EXTERN BreakTimerDaemonTimerBreakTimerBreakDBusObject* break_timer_daemon_timer_break_timer_break_dbus_object_new (BreakTimerDaemonTimerBreakTimerBreakController* break_controller,
                                                                                                            BreakTimerDaemonTimerBreakTimerBreakView* break_view);
VALA_EXTERN BreakTimerDaemonTimerBreakTimerBreakDBusObject* break_timer_daemon_timer_break_timer_break_dbus_object_construct (GType object_type,
                                                                                                                  BreakTimerDaemonTimerBreakTimerBreakController* break_controller,
                                                                                                                  BreakTimerDaemonTimerBreakTimerBreakView* break_view);
VALA_EXTERN GType break_timer_daemon_timer_break_timer_break_dbus_object_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint break_timer_daemon_timer_break_timer_break_dbus_object_register_object (void* object,
                                                                              GDBusConnection* connection,
                                                                              const gchar* path,
                                                                              GError** error);
static void break_timer_daemon_timer_break_timer_break_type_finalize (GObject * obj);
static GType break_timer_daemon_timer_break_timer_break_type_get_type_once (void);

static inline gpointer
break_timer_daemon_timer_break_timer_break_type_get_instance_private (BreakTimerDaemonTimerBreakTimerBreakType* self)
{
	return G_STRUCT_MEMBER_P (self, BreakTimerDaemonTimerBreakTimerBreakType_private_offset);
}

BreakTimerDaemonTimerBreakTimerBreakType*
break_timer_daemon_timer_break_timer_break_type_construct (GType object_type,
                                                           const gchar* id,
                                                           BreakTimerDaemonBreakBreakController* break_controller,
                                                           BreakTimerDaemonBreakBreakView* break_view)
{
	BreakTimerDaemonTimerBreakTimerBreakType * 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 = (BreakTimerDaemonTimerBreakTimerBreakType*) break_timer_daemon_break_break_type_construct (object_type, id, break_controller, break_view);
	return self;
}

static gboolean
break_timer_daemon_timer_break_timer_break_type_real_init (BreakTimerDaemonBreakBreakType* base,
                                                           GCancellable* cancellable,
                                                           GError** error)
{
	BreakTimerDaemonTimerBreakTimerBreakType * self;
	GDBusConnection* _tmp0_ = NULL;
	GDBusConnection* _tmp1_;
	GDBusConnection* _tmp3_;
	GDBusConnection* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	BreakTimerDaemonBreakBreakController* _tmp9_;
	BreakTimerDaemonBreakBreakController* _tmp10_;
	BreakTimerDaemonBreakBreakView* _tmp11_;
	BreakTimerDaemonBreakBreakView* _tmp12_;
	BreakTimerDaemonTimerBreakTimerBreakDBusObject* _tmp13_;
	BreakTimerDaemonTimerBreakTimerBreakDBusObject* _tmp14_;
	gboolean _tmp16_ = FALSE;
	GError* _inner_error0_ = NULL;
	gboolean result;
	self = (BreakTimerDaemonTimerBreakTimerBreakType*) base;
	_tmp1_ = g_bus_get_sync (G_BUS_TYPE_SESSION, cancellable, &_inner_error0_);
	_tmp0_ = _tmp1_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp2_ = FALSE;
		g_propagate_error (error, _inner_error0_);
		return _tmp2_;
	}
	_tmp3_ = _tmp0_;
	_tmp0_ = NULL;
	_g_object_unref0 (self->priv->dbus_connection);
	self->priv->dbus_connection = _tmp3_;
	_tmp4_ = self->priv->dbus_connection;
	_tmp5_ = break_timer_daemon_break_break_type_get_id ((BreakTimerDaemonBreakBreakType*) self);
	_tmp6_ = _tmp5_;
	_tmp7_ = g_strconcat (DAEMON_OBJECT_PATH "/", _tmp6_, NULL);
	_tmp8_ = _tmp7_;
	_tmp9_ = break_timer_daemon_break_break_type_get_break_controller ((BreakTimerDaemonBreakBreakType*) self);
	_tmp10_ = _tmp9_;
	_tmp11_ = break_timer_daemon_break_break_type_get_break_view ((BreakTimerDaemonBreakBreakType*) self);
	_tmp12_ = _tmp11_;
	_tmp13_ = break_timer_daemon_timer_break_timer_break_dbus_object_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, BREAK_TIMER_DAEMON_TIMER_BREAK_TYPE_TIMER_BREAK_CONTROLLER, BreakTimerDaemonTimerBreakTimerBreakController), G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, BREAK_TIMER_DAEMON_TIMER_BREAK_TYPE_TIMER_BREAK_VIEW, BreakTimerDaemonTimerBreakTimerBreakView));
	_tmp14_ = _tmp13_;
	break_timer_daemon_timer_break_timer_break_dbus_object_register_object (_tmp14_, _tmp4_, _tmp8_, &_inner_error0_);
	_g_object_unref0 (_tmp14_);
	_g_free0 (_tmp8_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp15_ = FALSE;
		g_propagate_error (error, _inner_error0_);
		_g_object_unref0 (_tmp0_);
		return _tmp15_;
	}
	_tmp16_ = BREAK_TIMER_DAEMON_BREAK_BREAK_TYPE_CLASS (break_timer_daemon_timer_break_timer_break_type_parent_class)->init (G_TYPE_CHECK_INSTANCE_CAST (self, BREAK_TIMER_DAEMON_BREAK_TYPE_BREAK_TYPE, BreakTimerDaemonBreakBreakType), cancellable, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp17_ = FALSE;
		g_propagate_error (error, _inner_error0_);
		_g_object_unref0 (_tmp0_);
		return _tmp17_;
	}
	result = _tmp16_;
	_g_object_unref0 (_tmp0_);
	return result;
}

static void
break_timer_daemon_timer_break_timer_break_type_class_init (BreakTimerDaemonTimerBreakTimerBreakTypeClass * klass,
                                                            gpointer klass_data)
{
	break_timer_daemon_timer_break_timer_break_type_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BreakTimerDaemonTimerBreakTimerBreakType_private_offset);
	((BreakTimerDaemonBreakBreakTypeClass *) klass)->init = (gboolean (*) (BreakTimerDaemonBreakBreakType*, GCancellable*, GError**)) break_timer_daemon_timer_break_timer_break_type_real_init;
	G_OBJECT_CLASS (klass)->finalize = break_timer_daemon_timer_break_timer_break_type_finalize;
}

static void
break_timer_daemon_timer_break_timer_break_type_instance_init (BreakTimerDaemonTimerBreakTimerBreakType * self,
                                                               gpointer klass)
{
	self->priv = break_timer_daemon_timer_break_timer_break_type_get_instance_private (self);
}

static void
break_timer_daemon_timer_break_timer_break_type_finalize (GObject * obj)
{
	BreakTimerDaemonTimerBreakTimerBreakType * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BREAK_TIMER_DAEMON_TIMER_BREAK_TYPE_TIMER_BREAK_TYPE, BreakTimerDaemonTimerBreakTimerBreakType);
	_g_object_unref0 (self->priv->dbus_connection);
	G_OBJECT_CLASS (break_timer_daemon_timer_break_timer_break_type_parent_class)->finalize (obj);
}

static GType
break_timer_daemon_timer_break_timer_break_type_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BreakTimerDaemonTimerBreakTimerBreakTypeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) break_timer_daemon_timer_break_timer_break_type_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BreakTimerDaemonTimerBreakTimerBreakType), 0, (GInstanceInitFunc) break_timer_daemon_timer_break_timer_break_type_instance_init, NULL };
	GType break_timer_daemon_timer_break_timer_break_type_type_id;
	break_timer_daemon_timer_break_timer_break_type_type_id = g_type_register_static (BREAK_TIMER_DAEMON_BREAK_TYPE_BREAK_TYPE, "BreakTimerDaemonTimerBreakTimerBreakType", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	BreakTimerDaemonTimerBreakTimerBreakType_private_offset = g_type_add_instance_private (break_timer_daemon_timer_break_timer_break_type_type_id, sizeof (BreakTimerDaemonTimerBreakTimerBreakTypePrivate));
	return break_timer_daemon_timer_break_timer_break_type_type_id;
}

GType
break_timer_daemon_timer_break_timer_break_type_get_type (void)
{
	static volatile gsize break_timer_daemon_timer_break_timer_break_type_type_id__once = 0;
	if (g_once_init_enter (&break_timer_daemon_timer_break_timer_break_type_type_id__once)) {
		GType break_timer_daemon_timer_break_timer_break_type_type_id;
		break_timer_daemon_timer_break_timer_break_type_type_id = break_timer_daemon_timer_break_timer_break_type_get_type_once ();
		g_once_init_leave (&break_timer_daemon_timer_break_timer_break_type_type_id__once, break_timer_daemon_timer_break_timer_break_type_type_id);
	}
	return break_timer_daemon_timer_break_timer_break_type_type_id__once;
}

