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

/* MicroBreakController.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>

#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_MICRO_BREAK_MICRO_BREAK_CONTROLLER_0_PROPERTY,
	BREAK_TIMER_DAEMON_MICRO_BREAK_MICRO_BREAK_CONTROLLER_NUM_PROPERTIES
};
static GParamSpec* break_timer_daemon_micro_break_micro_break_controller_properties[BREAK_TIMER_DAEMON_MICRO_BREAK_MICRO_BREAK_CONTROLLER_NUM_PROPERTIES];

static gpointer break_timer_daemon_micro_break_micro_break_controller_parent_class = NULL;

static void break_timer_daemon_micro_break_micro_break_controller_delayed_cb (BreakTimerDaemonMicroBreakMicroBreakController* self,
                                                                       gint lap_time,
                                                                       gint total_time);
static void _break_timer_daemon_micro_break_micro_break_controller_delayed_cb_break_timer_daemon_timer_break_timer_break_controller_delayed (BreakTimerDaemonTimerBreakTimerBreakController* _sender,
                                                                                                                                      gint lap_time,
                                                                                                                                      gint total_time,
                                                                                                                                      gpointer self);
static GType break_timer_daemon_micro_break_micro_break_controller_get_type_once (void);

static void
_break_timer_daemon_micro_break_micro_break_controller_delayed_cb_break_timer_daemon_timer_break_timer_break_controller_delayed (BreakTimerDaemonTimerBreakTimerBreakController* _sender,
                                                                                                                                 gint lap_time,
                                                                                                                                 gint total_time,
                                                                                                                                 gpointer self)
{
	break_timer_daemon_micro_break_micro_break_controller_delayed_cb ((BreakTimerDaemonMicroBreakMicroBreakController*) self, lap_time, total_time);
}

BreakTimerDaemonMicroBreakMicroBreakController*
break_timer_daemon_micro_break_micro_break_controller_construct (GType object_type,
                                                                 BreakTimerDaemonActivityActivityMonitor* activity_monitor)
{
	BreakTimerDaemonMicroBreakMicroBreakController * self = NULL;
	g_return_val_if_fail (activity_monitor != NULL, NULL);
	self = (BreakTimerDaemonMicroBreakMicroBreakController*) break_timer_daemon_timer_break_timer_break_controller_construct (object_type, activity_monitor, 0);
	g_signal_connect_object ((BreakTimerDaemonTimerBreakTimerBreakController*) self, "delayed", (GCallback) _break_timer_daemon_micro_break_micro_break_controller_delayed_cb_break_timer_daemon_timer_break_timer_break_controller_delayed, self, 0);
	return self;
}

BreakTimerDaemonMicroBreakMicroBreakController*
break_timer_daemon_micro_break_micro_break_controller_new (BreakTimerDaemonActivityActivityMonitor* activity_monitor)
{
	return break_timer_daemon_micro_break_micro_break_controller_construct (BREAK_TIMER_DAEMON_MICRO_BREAK_TYPE_MICRO_BREAK_CONTROLLER, activity_monitor);
}

static void
break_timer_daemon_micro_break_micro_break_controller_delayed_cb (BreakTimerDaemonMicroBreakMicroBreakController* self,
                                                                  gint lap_time,
                                                                  gint total_time)
{
	BreakTimerDaemonUtilCountdown* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = ((BreakTimerDaemonTimerBreakTimerBreakController*) self)->duration_countdown;
	break_timer_daemon_util_countdown_reset (_tmp0_);
}

static void
break_timer_daemon_micro_break_micro_break_controller_class_init (BreakTimerDaemonMicroBreakMicroBreakControllerClass * klass,
                                                                  gpointer klass_data)
{
	break_timer_daemon_micro_break_micro_break_controller_parent_class = g_type_class_peek_parent (klass);
}

static void
break_timer_daemon_micro_break_micro_break_controller_instance_init (BreakTimerDaemonMicroBreakMicroBreakController * self,
                                                                     gpointer klass)
{
}

/**
 * A type of timer break that should activate frequently and for short
 * durations. Satisfied when the user is inactive for its entire duration,
 * and when it is active it restarts its countdown whenever the user types
 * or moves the mouse.
 */
static GType
break_timer_daemon_micro_break_micro_break_controller_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BreakTimerDaemonMicroBreakMicroBreakControllerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) break_timer_daemon_micro_break_micro_break_controller_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BreakTimerDaemonMicroBreakMicroBreakController), 0, (GInstanceInitFunc) break_timer_daemon_micro_break_micro_break_controller_instance_init, NULL };
	GType break_timer_daemon_micro_break_micro_break_controller_type_id;
	break_timer_daemon_micro_break_micro_break_controller_type_id = g_type_register_static (BREAK_TIMER_DAEMON_TIMER_BREAK_TYPE_TIMER_BREAK_CONTROLLER, "BreakTimerDaemonMicroBreakMicroBreakController", &g_define_type_info, 0);
	return break_timer_daemon_micro_break_micro_break_controller_type_id;
}

GType
break_timer_daemon_micro_break_micro_break_controller_get_type (void)
{
	static volatile gsize break_timer_daemon_micro_break_micro_break_controller_type_id__once = 0;
	if (g_once_init_enter (&break_timer_daemon_micro_break_micro_break_controller_type_id__once)) {
		GType break_timer_daemon_micro_break_micro_break_controller_type_id;
		break_timer_daemon_micro_break_micro_break_controller_type_id = break_timer_daemon_micro_break_micro_break_controller_get_type_once ();
		g_once_init_leave (&break_timer_daemon_micro_break_micro_break_controller_type_id__once, break_timer_daemon_micro_break_micro_break_controller_type_id);
	}
	return break_timer_daemon_micro_break_micro_break_controller_type_id__once;
}

