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

/* RestBreakType.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 <glib-object.h>
#include <glib.h>
#include <gio/gio.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_REST_BREAK_REST_BREAK_TYPE_0_PROPERTY,
	BREAK_TIMER_DAEMON_REST_BREAK_REST_BREAK_TYPE_NUM_PROPERTIES
};
static GParamSpec* break_timer_daemon_rest_break_rest_break_type_properties[BREAK_TIMER_DAEMON_REST_BREAK_REST_BREAK_TYPE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

static gpointer break_timer_daemon_rest_break_rest_break_type_parent_class = NULL;

static GType break_timer_daemon_rest_break_rest_break_type_get_type_once (void);

BreakTimerDaemonRestBreakRestBreakType*
break_timer_daemon_rest_break_rest_break_type_construct (GType object_type,
                                                         BreakTimerDaemonActivityActivityMonitor* activity_monitor,
                                                         BreakTimerDaemonUIManager* ui_manager)
{
	BreakTimerDaemonRestBreakRestBreakType * self = NULL;
	BreakTimerDaemonRestBreakRestBreakController* break_controller = NULL;
	BreakTimerDaemonRestBreakRestBreakController* _tmp0_;
	BreakTimerDaemonRestBreakRestBreakView* break_view = NULL;
	BreakTimerDaemonRestBreakRestBreakView* _tmp1_;
	GSettings* settings = NULL;
	GSettings* _tmp2_;
	g_return_val_if_fail (activity_monitor != NULL, NULL);
	g_return_val_if_fail (ui_manager != NULL, NULL);
	_tmp0_ = break_timer_daemon_rest_break_rest_break_controller_new (activity_monitor);
	break_controller = _tmp0_;
	_tmp1_ = break_timer_daemon_rest_break_rest_break_view_new (break_controller, ui_manager);
	break_view = _tmp1_;
	_tmp2_ = g_settings_new (APPLICATION_ID ".restbreak");
	settings = _tmp2_;
	g_settings_bind (settings, "interval-seconds", (GObject*) break_controller, "interval", G_SETTINGS_BIND_GET);
	g_settings_bind (settings, "duration-seconds", (GObject*) break_controller, "duration", G_SETTINGS_BIND_GET);
	g_settings_bind (settings, "lock-screen", (GObject*) break_controller, "lock-screen-enabled", G_SETTINGS_BIND_GET);
	self = (BreakTimerDaemonRestBreakRestBreakType*) break_timer_daemon_timer_break_timer_break_type_construct (object_type, "restbreak", (BreakTimerDaemonBreakBreakController*) break_controller, (BreakTimerDaemonBreakBreakView*) break_view);
	_g_object_unref0 (settings);
	_g_object_unref0 (break_view);
	_g_object_unref0 (break_controller);
	return self;
}

BreakTimerDaemonRestBreakRestBreakType*
break_timer_daemon_rest_break_rest_break_type_new (BreakTimerDaemonActivityActivityMonitor* activity_monitor,
                                                   BreakTimerDaemonUIManager* ui_manager)
{
	return break_timer_daemon_rest_break_rest_break_type_construct (BREAK_TIMER_DAEMON_REST_BREAK_TYPE_REST_BREAK_TYPE, activity_monitor, ui_manager);
}

static void
break_timer_daemon_rest_break_rest_break_type_class_init (BreakTimerDaemonRestBreakRestBreakTypeClass * klass,
                                                          gpointer klass_data)
{
	break_timer_daemon_rest_break_rest_break_type_parent_class = g_type_class_peek_parent (klass);
}

static void
break_timer_daemon_rest_break_rest_break_type_instance_init (BreakTimerDaemonRestBreakRestBreakType * self,
                                                             gpointer klass)
{
}

static GType
break_timer_daemon_rest_break_rest_break_type_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BreakTimerDaemonRestBreakRestBreakTypeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) break_timer_daemon_rest_break_rest_break_type_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BreakTimerDaemonRestBreakRestBreakType), 0, (GInstanceInitFunc) break_timer_daemon_rest_break_rest_break_type_instance_init, NULL };
	GType break_timer_daemon_rest_break_rest_break_type_type_id;
	break_timer_daemon_rest_break_rest_break_type_type_id = g_type_register_static (BREAK_TIMER_DAEMON_TIMER_BREAK_TYPE_TIMER_BREAK_TYPE, "BreakTimerDaemonRestBreakRestBreakType", &g_define_type_info, 0);
	return break_timer_daemon_rest_break_rest_break_type_type_id;
}

GType
break_timer_daemon_rest_break_rest_break_type_get_type (void)
{
	static volatile gsize break_timer_daemon_rest_break_rest_break_type_type_id__once = 0;
	if (g_once_init_enter (&break_timer_daemon_rest_break_rest_break_type_type_id__once)) {
		GType break_timer_daemon_rest_break_rest_break_type_type_id;
		break_timer_daemon_rest_break_rest_break_type_type_id = break_timer_daemon_rest_break_rest_break_type_get_type_once ();
		g_once_init_leave (&break_timer_daemon_rest_break_rest_break_type_type_id__once, break_timer_daemon_rest_break_rest_break_type_type_id);
	}
	return break_timer_daemon_rest_break_rest_break_type_type_id__once;
}

