/* title.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from title.vala, do not modify */

#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <json-glib/json-glib.h>
#include <gio/gio.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
#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 SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BASE_WIDGET (sway_notification_center_widgets_base_widget_get_type ())
#define SWAY_NOTIFICATION_CENTER_WIDGETS_BASE_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BASE_WIDGET, SwayNotificationCenterWidgetsBaseWidget))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_BASE_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BASE_WIDGET, SwayNotificationCenterWidgetsBaseWidgetClass))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_IS_BASE_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BASE_WIDGET))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_IS_BASE_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BASE_WIDGET))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_BASE_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BASE_WIDGET, SwayNotificationCenterWidgetsBaseWidgetClass))

typedef struct _SwayNotificationCenterWidgetsBaseWidget SwayNotificationCenterWidgetsBaseWidget;
typedef struct _SwayNotificationCenterWidgetsBaseWidgetClass SwayNotificationCenterWidgetsBaseWidgetClass;
typedef struct _SwayNotificationCenterWidgetsBaseWidgetPrivate SwayNotificationCenterWidgetsBaseWidgetPrivate;

#define SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_TITLE (sway_notification_center_widgets_title_get_type ())
#define SWAY_NOTIFICATION_CENTER_WIDGETS_TITLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_TITLE, SwayNotificationCenterWidgetsTitle))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_TITLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_TITLE, SwayNotificationCenterWidgetsTitleClass))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_IS_TITLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_TITLE))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_IS_TITLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_TITLE))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_TITLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_TITLE, SwayNotificationCenterWidgetsTitleClass))

typedef struct _SwayNotificationCenterWidgetsTitle SwayNotificationCenterWidgetsTitle;
typedef struct _SwayNotificationCenterWidgetsTitleClass SwayNotificationCenterWidgetsTitleClass;
typedef struct _SwayNotificationCenterWidgetsTitlePrivate SwayNotificationCenterWidgetsTitlePrivate;
enum  {
	SWAY_NOTIFICATION_CENTER_WIDGETS_TITLE_0_PROPERTY,
	SWAY_NOTIFICATION_CENTER_WIDGETS_TITLE_WIDGET_NAME_PROPERTY,
	SWAY_NOTIFICATION_CENTER_WIDGETS_TITLE_NUM_PROPERTIES
};
static GParamSpec* sway_notification_center_widgets_title_properties[SWAY_NOTIFICATION_CENTER_WIDGETS_TITLE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define SWAY_NOTIFICATION_CENTER_TYPE_NOTI_DAEMON (sway_notification_center_noti_daemon_get_type ())
#define SWAY_NOTIFICATION_CENTER_NOTI_DAEMON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWAY_NOTIFICATION_CENTER_TYPE_NOTI_DAEMON, SwayNotificationCenterNotiDaemon))
#define SWAY_NOTIFICATION_CENTER_NOTI_DAEMON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWAY_NOTIFICATION_CENTER_TYPE_NOTI_DAEMON, SwayNotificationCenterNotiDaemonClass))
#define SWAY_NOTIFICATION_CENTER_IS_NOTI_DAEMON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWAY_NOTIFICATION_CENTER_TYPE_NOTI_DAEMON))
#define SWAY_NOTIFICATION_CENTER_IS_NOTI_DAEMON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWAY_NOTIFICATION_CENTER_TYPE_NOTI_DAEMON))
#define SWAY_NOTIFICATION_CENTER_NOTI_DAEMON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWAY_NOTIFICATION_CENTER_TYPE_NOTI_DAEMON, SwayNotificationCenterNotiDaemonClass))

typedef struct _SwayNotificationCenterNotiDaemon SwayNotificationCenterNotiDaemon;
typedef struct _SwayNotificationCenterNotiDaemonClass SwayNotificationCenterNotiDaemonClass;
typedef enum  {
	SWAY_NOTIFICATION_CENTER_CLOSED_REASONS_EXPIRED = 1,
	SWAY_NOTIFICATION_CENTER_CLOSED_REASONS_DISMISSED = 2,
	SWAY_NOTIFICATION_CENTER_CLOSED_REASONS_CLOSED_BY_CLOSENOTIFICATION = 3,
	SWAY_NOTIFICATION_CENTER_CLOSED_REASONS_UNDEFINED = 4
} SwayNotificationCenterClosedReasons;

#define SWAY_NOTIFICATION_CENTER_TYPE_CLOSED_REASONS (sway_notification_center_closed_reasons_get_type ())

#define SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_NOTIFICATIONS (sway_notification_center_widgets_notifications_get_type ())
#define SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_NOTIFICATIONS, SwayNotificationCenterWidgetsNotifications))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_NOTIFICATIONS, SwayNotificationCenterWidgetsNotificationsClass))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_IS_NOTIFICATIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_NOTIFICATIONS))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_IS_NOTIFICATIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_NOTIFICATIONS))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_NOTIFICATIONS, SwayNotificationCenterWidgetsNotificationsClass))

typedef struct _SwayNotificationCenterWidgetsNotifications SwayNotificationCenterWidgetsNotifications;
typedef struct _SwayNotificationCenterWidgetsNotificationsClass SwayNotificationCenterWidgetsNotificationsClass;

#define SWAY_NOTIFICATION_CENTER_TYPE_SWAYNC_DAEMON (sway_notification_center_swaync_daemon_get_type ())
#define SWAY_NOTIFICATION_CENTER_SWAYNC_DAEMON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWAY_NOTIFICATION_CENTER_TYPE_SWAYNC_DAEMON, SwayNotificationCenterSwayncDaemon))
#define SWAY_NOTIFICATION_CENTER_SWAYNC_DAEMON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWAY_NOTIFICATION_CENTER_TYPE_SWAYNC_DAEMON, SwayNotificationCenterSwayncDaemonClass))
#define SWAY_NOTIFICATION_CENTER_IS_SWAYNC_DAEMON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWAY_NOTIFICATION_CENTER_TYPE_SWAYNC_DAEMON))
#define SWAY_NOTIFICATION_CENTER_IS_SWAYNC_DAEMON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWAY_NOTIFICATION_CENTER_TYPE_SWAYNC_DAEMON))
#define SWAY_NOTIFICATION_CENTER_SWAYNC_DAEMON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWAY_NOTIFICATION_CENTER_TYPE_SWAYNC_DAEMON, SwayNotificationCenterSwayncDaemonClass))

typedef struct _SwayNotificationCenterSwayncDaemon SwayNotificationCenterSwayncDaemon;
typedef struct _SwayNotificationCenterSwayncDaemonClass SwayNotificationCenterSwayncDaemonClass;
#define _json_object_unref0(var) ((var == NULL) ? NULL : (var = (json_object_unref (var), NULL)))

struct _SwayNotificationCenterWidgetsBaseWidget {
	GtkBox parent_instance;
	SwayNotificationCenterWidgetsBaseWidgetPrivate * priv;
};

struct _SwayNotificationCenterWidgetsBaseWidgetClass {
	GtkBoxClass parent_class;
	void (*on_cc_visibility_change) (SwayNotificationCenterWidgetsBaseWidget* self, gboolean value);
	const gchar* (*get_widget_name) (SwayNotificationCenterWidgetsBaseWidget* self);
};

struct _SwayNotificationCenterWidgetsTitle {
	SwayNotificationCenterWidgetsBaseWidget parent_instance;
	SwayNotificationCenterWidgetsTitlePrivate * priv;
};

struct _SwayNotificationCenterWidgetsTitleClass {
	SwayNotificationCenterWidgetsBaseWidgetClass parent_class;
};

struct _SwayNotificationCenterWidgetsTitlePrivate {
	GtkLabel* title_widget;
	GtkButton* clear_all_button;
	gchar* title;
	gboolean has_clear_all_button;
	gchar* button_text;
};

static gint SwayNotificationCenterWidgetsTitle_private_offset;
static gpointer sway_notification_center_widgets_title_parent_class = NULL;
VALA_EXTERN SwayNotificationCenterNotiDaemon* sway_notification_center_noti_daemon;
VALA_EXTERN SwayNotificationCenterWidgetsNotifications* sway_notification_center_notifications_widget;
VALA_EXTERN SwayNotificationCenterSwayncDaemon* sway_notification_center_swaync_daemon;

VALA_EXTERN GType sway_notification_center_widgets_base_widget_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SwayNotificationCenterWidgetsBaseWidget, g_object_unref)
VALA_EXTERN GType sway_notification_center_widgets_title_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SwayNotificationCenterWidgetsTitle, g_object_unref)
VALA_EXTERN const gchar* sway_notification_center_widgets_base_widget_get_widget_name (SwayNotificationCenterWidgetsBaseWidget* self);
VALA_EXTERN SwayNotificationCenterWidgetsTitle* sway_notification_center_widgets_title_new (const gchar* suffix);
VALA_EXTERN SwayNotificationCenterWidgetsTitle* sway_notification_center_widgets_title_construct (GType object_type,
                                                                                      const gchar* suffix);
VALA_EXTERN SwayNotificationCenterWidgetsBaseWidget* sway_notification_center_widgets_base_widget_construct (GType object_type,
                                                                                                 const gchar* suffix);
VALA_EXTERN JsonObject* sway_notification_center_widgets_base_widget_get_config (SwayNotificationCenterWidgetsBaseWidget* self,
                                                                     GtkWidget* widget);
VALA_EXTERN gpointer sway_notification_center_widgets_base_widget_get_prop (SwayNotificationCenterWidgetsBaseWidget* self,
                                                                GType t_type,
                                                                GBoxedCopyFunc t_dup_func,
                                                                GDestroyNotify t_destroy_func,
                                                                JsonObject* config,
                                                                const gchar* value_key,
                                                                gboolean* found);
static gboolean* _bool_dup (gboolean* self);
static void ___lambda48_ (SwayNotificationCenterWidgetsTitle* self);
VALA_EXTERN GType sway_notification_center_noti_daemon_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SwayNotificationCenterNotiDaemon, g_object_unref)
VALA_EXTERN guint sway_notification_center_noti_daemon_register_object (void* object,
                                                            GDBusConnection* connection,
                                                            const gchar* path,
                                                            GError** error);
VALA_EXTERN GType sway_notification_center_closed_reasons_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void sway_notification_center_noti_daemon_request_dismiss_all_notifications (SwayNotificationCenterNotiDaemon* self,
                                                                             SwayNotificationCenterClosedReasons reason);
static void ____lambda48__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
VALA_EXTERN GType sway_notification_center_widgets_notifications_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SwayNotificationCenterWidgetsNotifications, g_object_unref)
VALA_EXTERN gboolean sway_notification_center_widgets_notifications_is_empty (SwayNotificationCenterWidgetsNotifications* self);
VALA_EXTERN GType sway_notification_center_swaync_daemon_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SwayNotificationCenterSwayncDaemon, g_object_unref)
VALA_EXTERN guint sway_notification_center_swaync_daemon_register_object (void* object,
                                                              GDBusConnection* connection,
                                                              const gchar* path,
                                                              GError** error);
static void ___lambda49_ (SwayNotificationCenterWidgetsTitle* self,
                   guint count);
static void ____lambda49__sway_notification_center_swaync_daemon_subscribe_v2 (SwayNotificationCenterSwayncDaemon* _sender,
                                                                        guint count,
                                                                        gboolean dnd,
                                                                        gboolean cc_open,
                                                                        gboolean inhibited,
                                                                        gpointer self);
static void sway_notification_center_widgets_title_finalize (GObject * obj);
static GType sway_notification_center_widgets_title_get_type_once (void);
static void _vala_sway_notification_center_widgets_title_get_property (GObject * object,
                                                                guint property_id,
                                                                GValue * value,
                                                                GParamSpec * pspec);

static inline gpointer
sway_notification_center_widgets_title_get_instance_private (SwayNotificationCenterWidgetsTitle* self)
{
	return G_STRUCT_MEMBER_P (self, SwayNotificationCenterWidgetsTitle_private_offset);
}

static gboolean*
_bool_dup (gboolean* self)
{
	gboolean* dup;
	dup = g_new0 (gboolean, 1);
	memcpy (dup, self, sizeof (gboolean));
	return dup;
}

static gpointer
__bool_dup0 (gpointer self)
{
	return self ? _bool_dup (self) : NULL;
}

static void
___lambda48_ (SwayNotificationCenterWidgetsTitle* self)
{
	SwayNotificationCenterNotiDaemon* _tmp0_;
	_tmp0_ = sway_notification_center_noti_daemon;
	sway_notification_center_noti_daemon_request_dismiss_all_notifications (_tmp0_, SWAY_NOTIFICATION_CENTER_CLOSED_REASONS_DISMISSED);
}

static void
____lambda48__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	___lambda48_ ((SwayNotificationCenterWidgetsTitle*) self);
}

static void
___lambda49_ (SwayNotificationCenterWidgetsTitle* self,
              guint count)
{
	GtkButton* _tmp0_;
	_tmp0_ = self->priv->clear_all_button;
	gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_widget_get_type (), GtkWidget), count > ((guint) 0));
}

static void
____lambda49__sway_notification_center_swaync_daemon_subscribe_v2 (SwayNotificationCenterSwayncDaemon* _sender,
                                                                   guint count,
                                                                   gboolean dnd,
                                                                   gboolean cc_open,
                                                                   gboolean inhibited,
                                                                   gpointer self)
{
	___lambda49_ ((SwayNotificationCenterWidgetsTitle*) self, count);
}

SwayNotificationCenterWidgetsTitle*
sway_notification_center_widgets_title_construct (GType object_type,
                                                  const gchar* suffix)
{
	SwayNotificationCenterWidgetsTitle * self = NULL;
	JsonObject* config = NULL;
	JsonObject* _tmp0_;
	JsonObject* _tmp1_;
	const gchar* _tmp18_;
	GtkLabel* _tmp19_;
	GtkLabel* _tmp20_;
	GtkLabel* _tmp21_;
	GtkLabel* _tmp22_;
	g_return_val_if_fail (suffix != NULL, NULL);
	self = (SwayNotificationCenterWidgetsTitle*) sway_notification_center_widgets_base_widget_construct (object_type, suffix);
	_tmp0_ = sway_notification_center_widgets_base_widget_get_config (G_TYPE_CHECK_INSTANCE_CAST (self, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BASE_WIDGET, SwayNotificationCenterWidgetsBaseWidget), G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	config = _tmp0_;
	_tmp1_ = config;
	if (_tmp1_ != NULL) {
		gchar* title = NULL;
		JsonObject* _tmp2_;
		gpointer _tmp3_;
		const gchar* _tmp4_;
		gboolean found_clear_all = FALSE;
		gboolean* has_clear_all_button = NULL;
		JsonObject* _tmp7_;
		gboolean _tmp8_ = FALSE;
		gpointer _tmp9_;
		gboolean _tmp10_;
		gboolean* _tmp11_;
		gchar* button_text = NULL;
		JsonObject* _tmp13_;
		gpointer _tmp14_;
		const gchar* _tmp15_;
		_tmp2_ = config;
		_tmp3_ = sway_notification_center_widgets_base_widget_get_prop (G_TYPE_CHECK_INSTANCE_CAST (self, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BASE_WIDGET, SwayNotificationCenterWidgetsBaseWidget), G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp2_, "text", NULL);
		title = (gchar*) _tmp3_;
		_tmp4_ = title;
		if (_tmp4_ != NULL) {
			const gchar* _tmp5_;
			gchar* _tmp6_;
			_tmp5_ = title;
			_tmp6_ = g_strdup (_tmp5_);
			_g_free0 (self->priv->title);
			self->priv->title = _tmp6_;
		}
		_tmp7_ = config;
		_tmp9_ = sway_notification_center_widgets_base_widget_get_prop (G_TYPE_CHECK_INSTANCE_CAST (self, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BASE_WIDGET, SwayNotificationCenterWidgetsBaseWidget), G_TYPE_BOOLEAN, NULL, NULL, _tmp7_, "clear-all-button", &_tmp8_);
		found_clear_all = _tmp8_;
		_tmp10_ = (gboolean) ((gintptr) _tmp9_);
		_tmp11_ = __bool_dup0 (&_tmp10_);
		has_clear_all_button = _tmp11_;
		if (found_clear_all) {
			gboolean* _tmp12_;
			_tmp12_ = has_clear_all_button;
			self->priv->has_clear_all_button = *_tmp12_;
		}
		_tmp13_ = config;
		_tmp14_ = sway_notification_center_widgets_base_widget_get_prop (G_TYPE_CHECK_INSTANCE_CAST (self, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BASE_WIDGET, SwayNotificationCenterWidgetsBaseWidget), G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp13_, "button-text", NULL);
		button_text = (gchar*) _tmp14_;
		_tmp15_ = button_text;
		if (_tmp15_ != NULL) {
			const gchar* _tmp16_;
			gchar* _tmp17_;
			_tmp16_ = button_text;
			_tmp17_ = g_strdup (_tmp16_);
			_g_free0 (self->priv->button_text);
			self->priv->button_text = _tmp17_;
		}
		_g_free0 (button_text);
		_g_free0 (has_clear_all_button);
		_g_free0 (title);
	}
	_tmp18_ = self->priv->title;
	_tmp19_ = (GtkLabel*) gtk_label_new (_tmp18_);
	if (_tmp19_) {
		g_object_set_data ((GObject *) _tmp19_, "vala-creation-function", "SwayNotificationCenter.Widgets.Title.new");
	}
	g_object_ref_sink (_tmp19_);
	_g_object_unref0 (self->priv->title_widget);
	self->priv->title_widget = _tmp19_;
	_tmp20_ = self->priv->title_widget;
	gtk_widget_set_hexpand (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, gtk_widget_get_type (), GtkWidget), TRUE);
	_tmp21_ = self->priv->title_widget;
	gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_START);
	_tmp22_ = self->priv->title_widget;
	gtk_box_append (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_box_get_type (), GtkBox), G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, gtk_widget_get_type (), GtkWidget));
	if (self->priv->has_clear_all_button) {
		const gchar* _tmp23_;
		GtkButton* _tmp24_;
		GtkButton* _tmp25_;
		GtkButton* _tmp26_;
		SwayNotificationCenterWidgetsNotifications* _tmp27_;
		SwayNotificationCenterSwayncDaemon* _tmp28_;
		GtkButton* _tmp29_;
		GtkButton* _tmp30_;
		GtkButton* _tmp31_;
		GtkButton* _tmp32_;
		_tmp23_ = self->priv->button_text;
		_tmp24_ = (GtkButton*) gtk_button_new_with_label (_tmp23_);
		if (_tmp24_) {
			g_object_set_data ((GObject *) _tmp24_, "vala-creation-function", "SwayNotificationCenter.Widgets.Title.new");
		}
		g_object_ref_sink (_tmp24_);
		_g_object_unref0 (self->priv->clear_all_button);
		self->priv->clear_all_button = _tmp24_;
		_tmp25_ = self->priv->clear_all_button;
		g_signal_connect_object (_tmp25_, "clicked", (GCallback) ____lambda48__gtk_button_clicked, self, 0);
		_tmp26_ = self->priv->clear_all_button;
		_tmp27_ = sway_notification_center_notifications_widget;
		gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, gtk_widget_get_type (), GtkWidget), !sway_notification_center_widgets_notifications_is_empty (_tmp27_));
		_tmp28_ = sway_notification_center_swaync_daemon;
		g_signal_connect_object (_tmp28_, "subscribe-v2", (GCallback) ____lambda49__sway_notification_center_swaync_daemon_subscribe_v2, self, 0);
		_tmp29_ = self->priv->clear_all_button;
		gtk_widget_set_can_focus (G_TYPE_CHECK_INSTANCE_CAST (_tmp29_, gtk_widget_get_type (), GtkWidget), FALSE);
		_tmp30_ = self->priv->clear_all_button;
		gtk_widget_set_valign (G_TYPE_CHECK_INSTANCE_CAST (_tmp30_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_CENTER);
		_tmp31_ = self->priv->clear_all_button;
		gtk_widget_add_css_class (G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, gtk_widget_get_type (), GtkWidget), "control-center-clear-all");
		_tmp32_ = self->priv->clear_all_button;
		gtk_box_append (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_box_get_type (), GtkBox), G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, gtk_widget_get_type (), GtkWidget));
	}
	_json_object_unref0 (config);
	return self;
}

SwayNotificationCenterWidgetsTitle*
sway_notification_center_widgets_title_new (const gchar* suffix)
{
	return sway_notification_center_widgets_title_construct (SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_TITLE, suffix);
}

static const gchar*
sway_notification_center_widgets_title_real_get_widget_name (SwayNotificationCenterWidgetsBaseWidget* base)
{
	const gchar* result;
	SwayNotificationCenterWidgetsTitle* self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_TITLE, SwayNotificationCenterWidgetsTitle);
	result = "title";
	return result;
}

static void
sway_notification_center_widgets_title_class_init (SwayNotificationCenterWidgetsTitleClass * klass,
                                                   gpointer klass_data)
{
	sway_notification_center_widgets_title_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SwayNotificationCenterWidgetsTitle_private_offset);
	SWAY_NOTIFICATION_CENTER_WIDGETS_BASE_WIDGET_CLASS (klass)->get_widget_name = (const gchar* (*) (SwayNotificationCenterWidgetsBaseWidget*)) sway_notification_center_widgets_title_real_get_widget_name;
	G_OBJECT_CLASS (klass)->get_property = _vala_sway_notification_center_widgets_title_get_property;
	G_OBJECT_CLASS (klass)->finalize = sway_notification_center_widgets_title_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SWAY_NOTIFICATION_CENTER_WIDGETS_TITLE_WIDGET_NAME_PROPERTY, sway_notification_center_widgets_title_properties[SWAY_NOTIFICATION_CENTER_WIDGETS_TITLE_WIDGET_NAME_PROPERTY] = g_param_spec_string ("widget-name", "widget-name", "widget-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
sway_notification_center_widgets_title_instance_init (SwayNotificationCenterWidgetsTitle * self,
                                                      gpointer klass)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	self->priv = sway_notification_center_widgets_title_get_instance_private (self);
	_tmp0_ = g_strdup ("Notifications");
	self->priv->title = _tmp0_;
	self->priv->has_clear_all_button = TRUE;
	_tmp1_ = g_strdup ("Clear All");
	self->priv->button_text = _tmp1_;
}

static void
sway_notification_center_widgets_title_finalize (GObject * obj)
{
	SwayNotificationCenterWidgetsTitle * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_TITLE, SwayNotificationCenterWidgetsTitle);
	_g_object_unref0 (self->priv->title_widget);
	_g_object_unref0 (self->priv->clear_all_button);
	_g_free0 (self->priv->title);
	_g_free0 (self->priv->button_text);
	G_OBJECT_CLASS (sway_notification_center_widgets_title_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
sway_notification_center_widgets_title_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SwayNotificationCenterWidgetsTitleClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) sway_notification_center_widgets_title_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SwayNotificationCenterWidgetsTitle), 0, (GInstanceInitFunc) sway_notification_center_widgets_title_instance_init, NULL };
	GType sway_notification_center_widgets_title_type_id;
	sway_notification_center_widgets_title_type_id = g_type_register_static (SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BASE_WIDGET, "SwayNotificationCenterWidgetsTitle", &g_define_type_info, 0);
	SwayNotificationCenterWidgetsTitle_private_offset = g_type_add_instance_private (sway_notification_center_widgets_title_type_id, sizeof (SwayNotificationCenterWidgetsTitlePrivate));
	return sway_notification_center_widgets_title_type_id;
}

GType
sway_notification_center_widgets_title_get_type (void)
{
	static gsize sway_notification_center_widgets_title_type_id__once = 0;
	if (g_once_init_enter (&sway_notification_center_widgets_title_type_id__once)) {
		GType sway_notification_center_widgets_title_type_id;
		sway_notification_center_widgets_title_type_id = sway_notification_center_widgets_title_get_type_once ();
		g_once_init_leave (&sway_notification_center_widgets_title_type_id__once, sway_notification_center_widgets_title_type_id);
	}
	return sway_notification_center_widgets_title_type_id__once;
}

static void
_vala_sway_notification_center_widgets_title_get_property (GObject * object,
                                                           guint property_id,
                                                           GValue * value,
                                                           GParamSpec * pspec)
{
	SwayNotificationCenterWidgetsTitle * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_TITLE, SwayNotificationCenterWidgetsTitle);
	switch (property_id) {
		case SWAY_NOTIFICATION_CENTER_WIDGETS_TITLE_WIDGET_NAME_PROPERTY:
		g_value_set_string (value, sway_notification_center_widgets_base_widget_get_widget_name (G_TYPE_CHECK_INSTANCE_CAST (self, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BASE_WIDGET, SwayNotificationCenterWidgetsBaseWidget)));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

