/* alarm-ringing-panel.c generated by valac 0.56.3, the Vala compiler
 * generated from alarm-ringing-panel.vala, do not modify */

/*
 * Copyright (C) 2013  Paolo Borelli <pborelli@gnome.org>
 * Copyright (C) 2020  Zander Brown <zbrown@gnome.org>
 *
 * 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 2
 * 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, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

#include <adwaita.h>
#include <glib-object.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>

#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define CLOCKS_ALARM_TYPE_RINGING_PANEL (clocks_alarm_ringing_panel_get_type ())
#define CLOCKS_ALARM_RINGING_PANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_ALARM_TYPE_RINGING_PANEL, ClocksAlarmRingingPanel))
#define CLOCKS_ALARM_RINGING_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_ALARM_TYPE_RINGING_PANEL, ClocksAlarmRingingPanelClass))
#define CLOCKS_ALARM_IS_RINGING_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_ALARM_TYPE_RINGING_PANEL))
#define CLOCKS_ALARM_IS_RINGING_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_ALARM_TYPE_RINGING_PANEL))
#define CLOCKS_ALARM_RINGING_PANEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_ALARM_TYPE_RINGING_PANEL, ClocksAlarmRingingPanelClass))

typedef struct _ClocksAlarmRingingPanel ClocksAlarmRingingPanel;
typedef struct _ClocksAlarmRingingPanelClass ClocksAlarmRingingPanelClass;
typedef struct _ClocksAlarmRingingPanelPrivate ClocksAlarmRingingPanelPrivate;

#define CLOCKS_ALARM_TYPE_ITEM (clocks_alarm_item_get_type ())
#define CLOCKS_ALARM_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_ALARM_TYPE_ITEM, ClocksAlarmItem))
#define CLOCKS_ALARM_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_ALARM_TYPE_ITEM, ClocksAlarmItemClass))
#define CLOCKS_ALARM_IS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_ALARM_TYPE_ITEM))
#define CLOCKS_ALARM_IS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_ALARM_TYPE_ITEM))
#define CLOCKS_ALARM_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_ALARM_TYPE_ITEM, ClocksAlarmItemClass))

typedef struct _ClocksAlarmItem ClocksAlarmItem;
typedef struct _ClocksAlarmItemClass ClocksAlarmItemClass;
enum  {
	CLOCKS_ALARM_RINGING_PANEL_0_PROPERTY,
	CLOCKS_ALARM_RINGING_PANEL_ALARM_PROPERTY,
	CLOCKS_ALARM_RINGING_PANEL_NUM_PROPERTIES
};
static GParamSpec* clocks_alarm_ringing_panel_properties[CLOCKS_ALARM_RINGING_PANEL_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define CLOCKS_TYPE_CONTENT_ITEM (clocks_content_item_get_type ())
#define CLOCKS_CONTENT_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_TYPE_CONTENT_ITEM, ClocksContentItem))
#define CLOCKS_IS_CONTENT_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_TYPE_CONTENT_ITEM))
#define CLOCKS_CONTENT_ITEM_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CLOCKS_TYPE_CONTENT_ITEM, ClocksContentItemIface))

typedef struct _ClocksContentItem ClocksContentItem;
typedef struct _ClocksContentItemIface ClocksContentItemIface;
typedef enum  {
	CLOCKS_ALARM_ITEM_STATE_READY,
	CLOCKS_ALARM_ITEM_STATE_RINGING,
	CLOCKS_ALARM_ITEM_STATE_SNOOZING
} ClocksAlarmItemState;

#define CLOCKS_ALARM_ITEM_TYPE_STATE (clocks_alarm_item_state_get_type ())
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))

#define CLOCKS_UTILS_TYPE_WALL_CLOCK (clocks_utils_wall_clock_get_type ())
#define CLOCKS_UTILS_WALL_CLOCK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_UTILS_TYPE_WALL_CLOCK, ClocksUtilsWallClock))
#define CLOCKS_UTILS_WALL_CLOCK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_UTILS_TYPE_WALL_CLOCK, ClocksUtilsWallClockClass))
#define CLOCKS_UTILS_IS_WALL_CLOCK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_UTILS_TYPE_WALL_CLOCK))
#define CLOCKS_UTILS_IS_WALL_CLOCK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_UTILS_TYPE_WALL_CLOCK))
#define CLOCKS_UTILS_WALL_CLOCK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_UTILS_TYPE_WALL_CLOCK, ClocksUtilsWallClockClass))

typedef struct _ClocksUtilsWallClock ClocksUtilsWallClock;
typedef struct _ClocksUtilsWallClockClass ClocksUtilsWallClockClass;
enum  {
	CLOCKS_ALARM_RINGING_PANEL_DISMISS_SIGNAL,
	CLOCKS_ALARM_RINGING_PANEL_NUM_SIGNALS
};
static guint clocks_alarm_ringing_panel_signals[CLOCKS_ALARM_RINGING_PANEL_NUM_SIGNALS] = {0};

struct _ClocksAlarmRingingPanel {
	AdwBin parent_instance;
	ClocksAlarmRingingPanelPrivate * priv;
};

struct _ClocksAlarmRingingPanelClass {
	AdwBinClass parent_class;
	void (*dismiss) (ClocksAlarmRingingPanel* self);
};

struct _ClocksAlarmRingingPanelPrivate {
	ClocksAlarmItem* _alarm;
	gulong alarm_state_handler;
	GtkLabel* title_label;
	GtkLabel* time_label;
	GtkButton* stop_button;
	GtkButton* snooze_button;
};

struct _ClocksContentItemIface {
	GTypeInterface parent_iface;
	void (*serialize) (ClocksContentItem* self, GVariantBuilder* builder);
	const gchar* (*get_name) (ClocksContentItem* self);
	void (*set_name) (ClocksContentItem* self, const gchar* value);
};

static gint ClocksAlarmRingingPanel_private_offset;
static gpointer clocks_alarm_ringing_panel_parent_class = NULL;

VALA_EXTERN GType clocks_alarm_ringing_panel_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClocksAlarmRingingPanel, g_object_unref)
VALA_EXTERN GType clocks_alarm_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClocksAlarmItem, g_object_unref)
static void clocks_alarm_ringing_panel_update (ClocksAlarmRingingPanel* self);
VALA_EXTERN ClocksAlarmItem* clocks_alarm_ringing_panel_get_alarm (ClocksAlarmRingingPanel* self);
VALA_EXTERN GType clocks_content_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClocksContentItem, g_object_unref)
VALA_EXTERN const gchar* clocks_content_item_get_name (ClocksContentItem* self);
VALA_EXTERN GType clocks_alarm_item_state_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ClocksAlarmItemState clocks_alarm_item_get_state (ClocksAlarmItem* self);
VALA_EXTERN gchar* clocks_alarm_item_get_snooze_time_label (ClocksAlarmItem* self);
VALA_EXTERN gchar* clocks_alarm_item_get_time_label (ClocksAlarmItem* self);
VALA_EXTERN ClocksAlarmRingingPanel* clocks_alarm_ringing_panel_new (void);
VALA_EXTERN ClocksAlarmRingingPanel* clocks_alarm_ringing_panel_construct (GType object_type);
VALA_EXTERN void clocks_alarm_ringing_panel_set_alarm (ClocksAlarmRingingPanel* self,
                                           ClocksAlarmItem* value);
static void _clocks_alarm_ringing_panel_alarm____lambda23_ (ClocksAlarmRingingPanel* self);
static void __clocks_alarm_ringing_panel_alarm____lambda23__g_object_notify (GObject* _sender,
                                                                      GParamSpec* pspec,
                                                                      gpointer self);
VALA_EXTERN const gchar* clocks_alarm_item_get_id (ClocksAlarmItem* self);
static GVariant* _variant_new1 (const gchar* value);
static GVariant* _variant_new2 (const gchar* value);
static void clocks_alarm_ringing_panel_real_dismiss (ClocksAlarmRingingPanel* self);
static GObject * clocks_alarm_ringing_panel_constructor (GType type,
                                                  guint n_construct_properties,
                                                  GObjectConstructParam * construct_properties);
VALA_EXTERN GType clocks_utils_wall_clock_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClocksUtilsWallClock, g_object_unref)
VALA_EXTERN ClocksUtilsWallClock* clocks_utils_wall_clock_get_default (void);
static void _clocks_alarm_ringing_panel_update_clocks_utils_wall_clock_tick (ClocksUtilsWallClock* _sender,
                                                                      gpointer self);
static void clocks_alarm_ringing_panel_finalize (GObject * obj);
static GType clocks_alarm_ringing_panel_get_type_once (void);
static void _vala_clocks_alarm_ringing_panel_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec);
static void _vala_clocks_alarm_ringing_panel_set_property (GObject * object,
                                                    guint property_id,
                                                    const GValue * value,
                                                    GParamSpec * pspec);

static inline gpointer
clocks_alarm_ringing_panel_get_instance_private (ClocksAlarmRingingPanel* self)
{
	return G_STRUCT_MEMBER_P (self, ClocksAlarmRingingPanel_private_offset);
}

static void
clocks_alarm_ringing_panel_update (ClocksAlarmRingingPanel* self)
{
	ClocksAlarmItem* _tmp0_;
	ClocksAlarmItem* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = clocks_alarm_ringing_panel_get_alarm (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		GtkLabel* _tmp2_;
		ClocksAlarmItem* _tmp3_;
		ClocksAlarmItem* _tmp4_;
		const gchar* _tmp5_;
		const gchar* _tmp6_;
		ClocksAlarmItem* _tmp7_;
		ClocksAlarmItem* _tmp8_;
		ClocksAlarmItemState _tmp9_;
		ClocksAlarmItemState _tmp10_;
		_tmp2_ = self->priv->title_label;
		_tmp3_ = clocks_alarm_ringing_panel_get_alarm (self);
		_tmp4_ = _tmp3_;
		_tmp5_ = clocks_content_item_get_name ((ClocksContentItem*) G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, CLOCKS_ALARM_TYPE_ITEM, ClocksAlarmItem));
		_tmp6_ = _tmp5_;
		gtk_label_set_label (_tmp2_, (const gchar*) _tmp6_);
		_tmp7_ = clocks_alarm_ringing_panel_get_alarm (self);
		_tmp8_ = _tmp7_;
		_tmp9_ = clocks_alarm_item_get_state (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, CLOCKS_ALARM_TYPE_ITEM, ClocksAlarmItem));
		_tmp10_ = _tmp9_;
		if (_tmp10_ == CLOCKS_ALARM_ITEM_STATE_SNOOZING) {
			GtkLabel* _tmp11_;
			ClocksAlarmItem* _tmp12_;
			ClocksAlarmItem* _tmp13_;
			gchar* _tmp14_;
			gchar* _tmp15_;
			gchar* _tmp16_;
			_tmp11_ = self->priv->time_label;
			_tmp12_ = clocks_alarm_ringing_panel_get_alarm (self);
			_tmp13_ = _tmp12_;
			_tmp14_ = clocks_alarm_item_get_snooze_time_label (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, CLOCKS_ALARM_TYPE_ITEM, ClocksAlarmItem));
			_tmp15_ = _tmp14_;
			_tmp16_ = _tmp15_;
			gtk_label_set_label (_tmp11_, _tmp16_);
			_g_free0 (_tmp16_);
		} else {
			GtkLabel* _tmp17_;
			ClocksAlarmItem* _tmp18_;
			ClocksAlarmItem* _tmp19_;
			gchar* _tmp20_;
			gchar* _tmp21_;
			gchar* _tmp22_;
			_tmp17_ = self->priv->time_label;
			_tmp18_ = clocks_alarm_ringing_panel_get_alarm (self);
			_tmp19_ = _tmp18_;
			_tmp20_ = clocks_alarm_item_get_time_label (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, CLOCKS_ALARM_TYPE_ITEM, ClocksAlarmItem));
			_tmp21_ = _tmp20_;
			_tmp22_ = _tmp21_;
			gtk_label_set_label (_tmp17_, _tmp22_);
			_g_free0 (_tmp22_);
		}
	} else {
		GtkLabel* _tmp23_;
		GtkLabel* _tmp24_;
		_tmp23_ = self->priv->title_label;
		gtk_label_set_label (_tmp23_, "");
		_tmp24_ = self->priv->time_label;
		gtk_label_set_label (_tmp24_, "");
	}
}

ClocksAlarmRingingPanel*
clocks_alarm_ringing_panel_construct (GType object_type)
{
	ClocksAlarmRingingPanel * self = NULL;
	self = (ClocksAlarmRingingPanel*) g_object_new (object_type, NULL);
	return self;
}

ClocksAlarmRingingPanel*
clocks_alarm_ringing_panel_new (void)
{
	return clocks_alarm_ringing_panel_construct (CLOCKS_ALARM_TYPE_RINGING_PANEL);
}

ClocksAlarmItem*
clocks_alarm_ringing_panel_get_alarm (ClocksAlarmRingingPanel* self)
{
	ClocksAlarmItem* result;
	ClocksAlarmItem* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_alarm;
	result = _tmp0_;
	return result;
}

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

static void
_clocks_alarm_ringing_panel_alarm____lambda23_ (ClocksAlarmRingingPanel* self)
{
	ClocksAlarmItem* _tmp0_;
	ClocksAlarmItemState _tmp1_;
	ClocksAlarmItemState _tmp2_;
	_tmp0_ = self->priv->_alarm;
	_tmp1_ = clocks_alarm_item_get_state (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, CLOCKS_ALARM_TYPE_ITEM, ClocksAlarmItem));
	_tmp2_ = _tmp1_;
	if (_tmp2_ != CLOCKS_ALARM_ITEM_STATE_RINGING) {
		g_signal_emit (self, clocks_alarm_ringing_panel_signals[CLOCKS_ALARM_RINGING_PANEL_DISMISS_SIGNAL], 0);
	}
}

static void
__clocks_alarm_ringing_panel_alarm____lambda23__g_object_notify (GObject* _sender,
                                                                 GParamSpec* pspec,
                                                                 gpointer self)
{
	_clocks_alarm_ringing_panel_alarm____lambda23_ ((ClocksAlarmRingingPanel*) self);
}

static GVariant*
_variant_new1 (const gchar* value)
{
	return g_variant_ref_sink (g_variant_new_string (value));
}

static GVariant*
_variant_new2 (const gchar* value)
{
	return g_variant_ref_sink (g_variant_new_string (value));
}

void
clocks_alarm_ringing_panel_set_alarm (ClocksAlarmRingingPanel* self,
                                      ClocksAlarmItem* value)
{
	ClocksAlarmItem* _tmp0_;
	ClocksAlarmItem* _tmp2_;
	ClocksAlarmItem* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_alarm;
	if (_tmp0_ != NULL) {
		ClocksAlarmItem* _tmp1_;
		_tmp1_ = self->priv->_alarm;
		g_signal_handler_disconnect ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, CLOCKS_ALARM_TYPE_ITEM, ClocksAlarmItem), self->priv->alarm_state_handler);
	}
	_tmp2_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_alarm);
	self->priv->_alarm = _tmp2_;
	_tmp3_ = self->priv->_alarm;
	if (_tmp3_ != NULL) {
		ClocksAlarmItem* _tmp4_;
		gulong _tmp5_;
		GtkButton* _tmp6_;
		ClocksAlarmItem* _tmp7_;
		const gchar* _tmp8_;
		const gchar* _tmp9_;
		GVariant* _tmp10_;
		GtkButton* _tmp11_;
		GtkButton* _tmp12_;
		ClocksAlarmItem* _tmp13_;
		const gchar* _tmp14_;
		const gchar* _tmp15_;
		GVariant* _tmp16_;
		GtkButton* _tmp17_;
		_tmp4_ = self->priv->_alarm;
		_tmp5_ = g_signal_connect_object ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, CLOCKS_ALARM_TYPE_ITEM, ClocksAlarmItem), "notify::state", (GCallback) __clocks_alarm_ringing_panel_alarm____lambda23__g_object_notify, self, 0);
		self->priv->alarm_state_handler = _tmp5_;
		_tmp6_ = self->priv->stop_button;
		_tmp7_ = self->priv->_alarm;
		_tmp8_ = clocks_alarm_item_get_id (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, CLOCKS_ALARM_TYPE_ITEM, ClocksAlarmItem));
		_tmp9_ = _tmp8_;
		_tmp10_ = _variant_new1 (_tmp9_);
		g_object_set ((GtkActionable*) _tmp6_, "action-target", _tmp10_, NULL);
		_g_variant_unref0 (_tmp10_);
		_tmp11_ = self->priv->stop_button;
		gtk_actionable_set_action_name ((GtkActionable*) _tmp11_, "app.stop-alarm");
		_tmp12_ = self->priv->snooze_button;
		_tmp13_ = self->priv->_alarm;
		_tmp14_ = clocks_alarm_item_get_id (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, CLOCKS_ALARM_TYPE_ITEM, ClocksAlarmItem));
		_tmp15_ = _tmp14_;
		_tmp16_ = _variant_new2 (_tmp15_);
		g_object_set ((GtkActionable*) _tmp12_, "action-target", _tmp16_, NULL);
		_g_variant_unref0 (_tmp16_);
		_tmp17_ = self->priv->snooze_button;
		gtk_actionable_set_action_name ((GtkActionable*) _tmp17_, "app.snooze-alarm");
	}
	clocks_alarm_ringing_panel_update (self);
	g_object_notify_by_pspec ((GObject *) self, clocks_alarm_ringing_panel_properties[CLOCKS_ALARM_RINGING_PANEL_ALARM_PROPERTY]);
}

static void
clocks_alarm_ringing_panel_real_dismiss (ClocksAlarmRingingPanel* self)
{
	clocks_alarm_ringing_panel_set_alarm (self, NULL);
}

static void
_clocks_alarm_ringing_panel_update_clocks_utils_wall_clock_tick (ClocksUtilsWallClock* _sender,
                                                                 gpointer self)
{
	clocks_alarm_ringing_panel_update ((ClocksAlarmRingingPanel*) self);
}

static GObject *
clocks_alarm_ringing_panel_constructor (GType type,
                                        guint n_construct_properties,
                                        GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ClocksAlarmRingingPanel * self;
	ClocksUtilsWallClock* _tmp0_;
	ClocksUtilsWallClock* _tmp1_;
	parent_class = G_OBJECT_CLASS (clocks_alarm_ringing_panel_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CLOCKS_ALARM_TYPE_RINGING_PANEL, ClocksAlarmRingingPanel);
	_tmp0_ = clocks_utils_wall_clock_get_default ();
	_tmp1_ = _tmp0_;
	g_signal_connect_object (_tmp1_, "tick", (GCallback) _clocks_alarm_ringing_panel_update_clocks_utils_wall_clock_tick, self, 0);
	_g_object_unref0 (_tmp1_);
	return obj;
}

static void
clocks_alarm_ringing_panel_class_init (ClocksAlarmRingingPanelClass * klass,
                                       gpointer klass_data)
{
	clocks_alarm_ringing_panel_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ClocksAlarmRingingPanel_private_offset);
	((ClocksAlarmRingingPanelClass *) klass)->dismiss = clocks_alarm_ringing_panel_real_dismiss;
	G_OBJECT_CLASS (klass)->get_property = _vala_clocks_alarm_ringing_panel_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_clocks_alarm_ringing_panel_set_property;
	G_OBJECT_CLASS (klass)->constructor = clocks_alarm_ringing_panel_constructor;
	G_OBJECT_CLASS (klass)->finalize = clocks_alarm_ringing_panel_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_ALARM_RINGING_PANEL_ALARM_PROPERTY, clocks_alarm_ringing_panel_properties[CLOCKS_ALARM_RINGING_PANEL_ALARM_PROPERTY] = g_param_spec_object ("alarm", "alarm", "alarm", CLOCKS_ALARM_TYPE_ITEM, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/clocks/ui/alarm-ringing-panel.ui");
	clocks_alarm_ringing_panel_signals[CLOCKS_ALARM_RINGING_PANEL_DISMISS_SIGNAL] = g_signal_new ("dismiss", CLOCKS_ALARM_TYPE_RINGING_PANEL, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ClocksAlarmRingingPanelClass, dismiss), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "title_label", FALSE, ClocksAlarmRingingPanel_private_offset + G_STRUCT_OFFSET (ClocksAlarmRingingPanelPrivate, title_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "time_label", FALSE, ClocksAlarmRingingPanel_private_offset + G_STRUCT_OFFSET (ClocksAlarmRingingPanelPrivate, time_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "stop_button", FALSE, ClocksAlarmRingingPanel_private_offset + G_STRUCT_OFFSET (ClocksAlarmRingingPanelPrivate, stop_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "snooze_button", FALSE, ClocksAlarmRingingPanel_private_offset + G_STRUCT_OFFSET (ClocksAlarmRingingPanelPrivate, snooze_button));
}

static void
clocks_alarm_ringing_panel_instance_init (ClocksAlarmRingingPanel * self,
                                          gpointer klass)
{
	self->priv = clocks_alarm_ringing_panel_get_instance_private (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
clocks_alarm_ringing_panel_finalize (GObject * obj)
{
	ClocksAlarmRingingPanel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CLOCKS_ALARM_TYPE_RINGING_PANEL, ClocksAlarmRingingPanel);
	_g_object_unref0 (self->priv->_alarm);
	G_OBJECT_CLASS (clocks_alarm_ringing_panel_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
clocks_alarm_ringing_panel_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ClocksAlarmRingingPanelClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) clocks_alarm_ringing_panel_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ClocksAlarmRingingPanel), 0, (GInstanceInitFunc) clocks_alarm_ringing_panel_instance_init, NULL };
	GType clocks_alarm_ringing_panel_type_id;
	clocks_alarm_ringing_panel_type_id = g_type_register_static (adw_bin_get_type (), "ClocksAlarmRingingPanel", &g_define_type_info, 0);
	ClocksAlarmRingingPanel_private_offset = g_type_add_instance_private (clocks_alarm_ringing_panel_type_id, sizeof (ClocksAlarmRingingPanelPrivate));
	return clocks_alarm_ringing_panel_type_id;
}

GType
clocks_alarm_ringing_panel_get_type (void)
{
	static volatile gsize clocks_alarm_ringing_panel_type_id__once = 0;
	if (g_once_init_enter (&clocks_alarm_ringing_panel_type_id__once)) {
		GType clocks_alarm_ringing_panel_type_id;
		clocks_alarm_ringing_panel_type_id = clocks_alarm_ringing_panel_get_type_once ();
		g_once_init_leave (&clocks_alarm_ringing_panel_type_id__once, clocks_alarm_ringing_panel_type_id);
	}
	return clocks_alarm_ringing_panel_type_id__once;
}

static void
_vala_clocks_alarm_ringing_panel_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec)
{
	ClocksAlarmRingingPanel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_ALARM_TYPE_RINGING_PANEL, ClocksAlarmRingingPanel);
	switch (property_id) {
		case CLOCKS_ALARM_RINGING_PANEL_ALARM_PROPERTY:
		g_value_set_object (value, clocks_alarm_ringing_panel_get_alarm (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_clocks_alarm_ringing_panel_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec)
{
	ClocksAlarmRingingPanel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_ALARM_TYPE_RINGING_PANEL, ClocksAlarmRingingPanel);
	switch (property_id) {
		case CLOCKS_ALARM_RINGING_PANEL_ALARM_PROPERTY:
		clocks_alarm_ringing_panel_set_alarm (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

