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

#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gee.h>
#include <json-glib/json-glib.h>
#include <gio/gio.h>
#include <adwaita.h>
#include <float.h>
#include <math.h>
#include <gdk/gdk.h>

#define SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS_STACK_NOTIFICATIONS_PAGE "notifications-list"
#define SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS_STACK_PLACEHOLDER_PAGE "notifications-placeholder"
#define CONSTANTS_ANIMATION_DURATION ((guint) 400)
#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_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;
typedef struct _SwayNotificationCenterWidgetsNotificationsPrivate SwayNotificationCenterWidgetsNotificationsPrivate;

#define TYPE_ITER_LIST_BOX_CONTROLLER (iter_list_box_controller_get_type ())
#define ITER_LIST_BOX_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ITER_LIST_BOX_CONTROLLER, IterListBoxController))
#define ITER_LIST_BOX_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ITER_LIST_BOX_CONTROLLER, IterListBoxControllerClass))
#define IS_ITER_LIST_BOX_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ITER_LIST_BOX_CONTROLLER))
#define IS_ITER_LIST_BOX_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ITER_LIST_BOX_CONTROLLER))
#define ITER_LIST_BOX_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ITER_LIST_BOX_CONTROLLER, IterListBoxControllerClass))

typedef struct _IterListBoxController IterListBoxController;
typedef struct _IterListBoxControllerClass IterListBoxControllerClass;

#define SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_GROUP (sway_notification_center_notification_group_get_type ())
#define SWAY_NOTIFICATION_CENTER_NOTIFICATION_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_GROUP, SwayNotificationCenterNotificationGroup))
#define SWAY_NOTIFICATION_CENTER_NOTIFICATION_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_GROUP, SwayNotificationCenterNotificationGroupClass))
#define SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_GROUP))
#define SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_GROUP))
#define SWAY_NOTIFICATION_CENTER_NOTIFICATION_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_GROUP, SwayNotificationCenterNotificationGroupClass))

typedef struct _SwayNotificationCenterNotificationGroup SwayNotificationCenterNotificationGroup;
typedef struct _SwayNotificationCenterNotificationGroupClass SwayNotificationCenterNotificationGroupClass;
enum  {
	SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS_0_PROPERTY,
	SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS_WIDGET_NAME_PROPERTY,
	SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS_N_NOTIFICATIONS_PROPERTY,
	SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS_N_GROUPS_PROPERTY,
	SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS_EXPANDED_GROUP_PROPERTY,
	SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS_NUM_PROPERTIES
};
static GParamSpec* sway_notification_center_widgets_notifications_properties[SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define SWAY_NOTIFICATION_CENTER_TYPE_CONFIG_MODEL (sway_notification_center_config_model_get_type ())
#define SWAY_NOTIFICATION_CENTER_CONFIG_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWAY_NOTIFICATION_CENTER_TYPE_CONFIG_MODEL, SwayNotificationCenterConfigModel))
#define SWAY_NOTIFICATION_CENTER_CONFIG_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWAY_NOTIFICATION_CENTER_TYPE_CONFIG_MODEL, SwayNotificationCenterConfigModelClass))
#define SWAY_NOTIFICATION_CENTER_IS_CONFIG_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWAY_NOTIFICATION_CENTER_TYPE_CONFIG_MODEL))
#define SWAY_NOTIFICATION_CENTER_IS_CONFIG_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWAY_NOTIFICATION_CENTER_TYPE_CONFIG_MODEL))
#define SWAY_NOTIFICATION_CENTER_CONFIG_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWAY_NOTIFICATION_CENTER_TYPE_CONFIG_MODEL, SwayNotificationCenterConfigModelClass))

typedef struct _SwayNotificationCenterConfigModel SwayNotificationCenterConfigModel;
typedef struct _SwayNotificationCenterConfigModelClass SwayNotificationCenterConfigModelClass;
#define _g_free0(var) ((var == NULL) ? NULL : (var = (g_free (var), NULL)))
#define _json_object_unref0(var) ((var == NULL) ? NULL : (var = (json_object_unref (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 ())
typedef struct _SwayNotificationCenterNotificationGroupPrivate SwayNotificationCenterNotificationGroupPrivate;
typedef struct _Block15Data Block15Data;

#define SWAY_NOTIFICATION_CENTER_TYPE_CONTROL_CENTER (sway_notification_center_control_center_get_type ())
#define SWAY_NOTIFICATION_CENTER_CONTROL_CENTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWAY_NOTIFICATION_CENTER_TYPE_CONTROL_CENTER, SwayNotificationCenterControlCenter))
#define SWAY_NOTIFICATION_CENTER_CONTROL_CENTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWAY_NOTIFICATION_CENTER_TYPE_CONTROL_CENTER, SwayNotificationCenterControlCenterClass))
#define SWAY_NOTIFICATION_CENTER_IS_CONTROL_CENTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWAY_NOTIFICATION_CENTER_TYPE_CONTROL_CENTER))
#define SWAY_NOTIFICATION_CENTER_IS_CONTROL_CENTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWAY_NOTIFICATION_CENTER_TYPE_CONTROL_CENTER))
#define SWAY_NOTIFICATION_CENTER_CONTROL_CENTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWAY_NOTIFICATION_CENTER_TYPE_CONTROL_CENTER, SwayNotificationCenterControlCenterClass))

typedef struct _SwayNotificationCenterControlCenter SwayNotificationCenterControlCenter;
typedef struct _SwayNotificationCenterControlCenterClass SwayNotificationCenterControlCenterClass;
typedef struct _Block16Data Block16Data;

#define SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION (sway_notification_center_notification_get_type ())
#define SWAY_NOTIFICATION_CENTER_NOTIFICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION, SwayNotificationCenterNotification))
#define SWAY_NOTIFICATION_CENTER_NOTIFICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION, SwayNotificationCenterNotificationClass))
#define SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION))
#define SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION))
#define SWAY_NOTIFICATION_CENTER_NOTIFICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION, SwayNotificationCenterNotificationClass))

typedef struct _SwayNotificationCenterNotification SwayNotificationCenterNotification;
typedef struct _SwayNotificationCenterNotificationClass SwayNotificationCenterNotificationClass;
typedef struct _Block17Data Block17Data;
typedef enum  {
	SWAY_NOTIFICATION_CENTER_NOTIFICATION_GROUP_STATE_EMPTY = 0,
	SWAY_NOTIFICATION_CENTER_NOTIFICATION_GROUP_STATE_SINLGE = 1,
	SWAY_NOTIFICATION_CENTER_NOTIFICATION_GROUP_STATE_MANY = 2
} SwayNotificationCenterNotificationGroupState;

#define SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_GROUP_STATE (sway_notification_center_notification_group_state_get_type ())

#define SWAY_NOTIFICATION_CENTER_TYPE_NOTIFY_PARAMS (sway_notification_center_notify_params_get_type ())
#define SWAY_NOTIFICATION_CENTER_NOTIFY_PARAMS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWAY_NOTIFICATION_CENTER_TYPE_NOTIFY_PARAMS, SwayNotificationCenterNotifyParams))
#define SWAY_NOTIFICATION_CENTER_NOTIFY_PARAMS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWAY_NOTIFICATION_CENTER_TYPE_NOTIFY_PARAMS, SwayNotificationCenterNotifyParamsClass))
#define SWAY_NOTIFICATION_CENTER_IS_NOTIFY_PARAMS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWAY_NOTIFICATION_CENTER_TYPE_NOTIFY_PARAMS))
#define SWAY_NOTIFICATION_CENTER_IS_NOTIFY_PARAMS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWAY_NOTIFICATION_CENTER_TYPE_NOTIFY_PARAMS))
#define SWAY_NOTIFICATION_CENTER_NOTIFY_PARAMS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWAY_NOTIFICATION_CENTER_TYPE_NOTIFY_PARAMS, SwayNotificationCenterNotifyParamsClass))

typedef struct _SwayNotificationCenterNotifyParams SwayNotificationCenterNotifyParams;
typedef struct _SwayNotificationCenterNotifyParamsClass SwayNotificationCenterNotifyParamsClass;
typedef struct _Block18Data Block18Data;
typedef enum  {
	SWAY_NOTIFICATION_CENTER_NOTIFICATION_TYPE_CONTROL_CENTER,
	SWAY_NOTIFICATION_CENTER_NOTIFICATION_TYPE_FLOATING
} SwayNotificationCenterNotificationType;

#define SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_TYPE (sway_notification_center_notification_type_get_type ())

#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 _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (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 _SwayNotificationCenterWidgetsNotifications {
	SwayNotificationCenterWidgetsBaseWidget parent_instance;
	SwayNotificationCenterWidgetsNotificationsPrivate * priv;
};

struct _SwayNotificationCenterWidgetsNotificationsClass {
	SwayNotificationCenterWidgetsBaseWidgetClass parent_class;
};

struct _SwayNotificationCenterWidgetsNotificationsPrivate {
	guint _n_notifications;
	guint _n_groups;
	GtkLabel* text_empty_label;
	GtkStack* stack;
	GtkScrolledWindow* scrolled_window;
	GtkViewport* viewport;
	GtkListBox* list_box;
	IterListBoxController* list_box_controller;
	SwayNotificationCenterNotificationGroup* _expanded_group;
	guint scroll_timer_id;
	GeeHashMap* noti_groups_id;
	GeeHashMap* noti_groups_name;
	gboolean list_reverse;
	gboolean vertical_expand;
};

struct _SwayNotificationCenterNotificationGroup {
	GtkListBoxRow parent_instance;
	SwayNotificationCenterNotificationGroupPrivate * priv;
	gchar* name_id;
};

struct _SwayNotificationCenterNotificationGroupClass {
	GtkListBoxRowClass parent_class;
};

struct _Block15Data {
	int _ref_count_;
	SwayNotificationCenterWidgetsNotifications* self;
	SwayNotificationCenterNotificationGroup* group;
};

struct _Block16Data {
	int _ref_count_;
	SwayNotificationCenterWidgetsNotifications* self;
	SwayNotificationCenterNotificationGroup* group;
};

struct _Block17Data {
	int _ref_count_;
	SwayNotificationCenterWidgetsNotifications* self;
	SwayNotificationCenterNotificationGroup* group;
};

struct _Block18Data {
	int _ref_count_;
	SwayNotificationCenterWidgetsNotifications* self;
	SwayNotificationCenterNotificationGroup* group;
};

static gint SwayNotificationCenterWidgetsNotifications_private_offset;
static gpointer sway_notification_center_widgets_notifications_parent_class = NULL;
VALA_EXTERN SwayNotificationCenterNotiDaemon* sway_notification_center_noti_daemon;
VALA_EXTERN SwayNotificationCenterControlCenter* sway_notification_center_control_center;
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_notifications_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SwayNotificationCenterWidgetsNotifications, g_object_unref)
VALA_EXTERN GType iter_list_box_controller_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (IterListBoxController, g_object_unref)
VALA_EXTERN GType sway_notification_center_notification_group_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SwayNotificationCenterNotificationGroup, g_object_unref)
VALA_EXTERN void sway_notification_center_widgets_base_widget_on_cc_visibility_change (SwayNotificationCenterWidgetsBaseWidget* self,
                                                                           gboolean value);
VALA_EXTERN const gchar* sway_notification_center_widgets_base_widget_get_widget_name (SwayNotificationCenterWidgetsBaseWidget* self);
VALA_EXTERN SwayNotificationCenterWidgetsNotifications* sway_notification_center_widgets_notifications_new (void);
VALA_EXTERN SwayNotificationCenterWidgetsNotifications* sway_notification_center_widgets_notifications_construct (GType object_type);
VALA_EXTERN SwayNotificationCenterWidgetsBaseWidget* sway_notification_center_widgets_base_widget_construct (GType object_type,
                                                                                                 const gchar* suffix);
VALA_EXTERN IterListBoxController* iter_list_box_controller_new (GtkListBox* list_box);
VALA_EXTERN IterListBoxController* iter_list_box_controller_construct (GType object_type,
                                                           GtkListBox* list_box);
static void sway_notification_center_widgets_notifications_expanded_changed (SwayNotificationCenterWidgetsNotifications* self);
static void _sway_notification_center_widgets_notifications_expanded_changed_g_object_notify (GObject* _sender,
                                                                                       GParamSpec* pspec,
                                                                                       gpointer self);
VALA_EXTERN GType sway_notification_center_config_model_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SwayNotificationCenterConfigModel, g_object_unref)
VALA_EXTERN SwayNotificationCenterConfigModel* sway_notification_center_config_model_get_instance (void);
VALA_EXTERN const gchar* sway_notification_center_config_model_get_text_empty (SwayNotificationCenterConfigModel* self);
VALA_EXTERN void sway_notification_center_widgets_notifications_reload_config (SwayNotificationCenterWidgetsNotifications* self);
VALA_EXTERN SwayNotificationCenterNotificationGroup* sway_notification_center_widgets_notifications_get_expanded_group (SwayNotificationCenterWidgetsNotifications* self);
VALA_EXTERN GList* iter_list_box_controller_get_children (IterListBoxController* self);
VALA_EXTERN void sway_notification_center_notification_group_set_expanded (SwayNotificationCenterNotificationGroup* self,
                                                               gboolean state);
static void sway_notification_center_widgets_notifications_real_on_cc_visibility_change (SwayNotificationCenterWidgetsBaseWidget* base,
                                                                                  gboolean value);
static void sway_notification_center_widgets_notifications_navigate_to_first_notification (SwayNotificationCenterWidgetsNotifications* self);
VALA_EXTERN void sway_notification_center_notification_group_update (SwayNotificationCenterNotificationGroup* self);
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);
VALA_EXTERN gboolean sway_notification_center_widgets_notifications_is_empty (SwayNotificationCenterWidgetsNotifications* self);
VALA_EXTERN guint sway_notification_center_widgets_notifications_get_n_notifications (SwayNotificationCenterWidgetsNotifications* self);
VALA_EXTERN void sway_notification_center_widgets_notifications_request_dismiss_all_notifications (SwayNotificationCenterWidgetsNotifications* 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 sway_notification_center_widgets_notifications_prepare_group_removal (SwayNotificationCenterWidgetsNotifications* self,
                                                                           SwayNotificationCenterNotificationGroup* group);
static void sway_notification_center_widgets_notifications_set_expanded_group (SwayNotificationCenterWidgetsNotifications* self,
                                                                        SwayNotificationCenterNotificationGroup* value);
static void sway_notification_center_widgets_notifications_navigate_up (SwayNotificationCenterWidgetsNotifications* self,
                                                                 gboolean fallback_other_dir,
                                                                 SwayNotificationCenterNotificationGroup* focused_group);
static void sway_notification_center_widgets_notifications_navigate_down (SwayNotificationCenterWidgetsNotifications* self,
                                                                   gboolean fallback_other_dir,
                                                                   SwayNotificationCenterNotificationGroup* focused_group);
static void sway_notification_center_widgets_notifications_commit_group_removal (SwayNotificationCenterWidgetsNotifications* self,
                                                                          SwayNotificationCenterNotificationGroup* group);
VALA_EXTERN void iter_list_box_controller_remove (IterListBoxController* self,
                                      GtkWidget* child);
VALA_EXTERN gint iter_list_box_controller_get_length (IterListBoxController* self);
static void sway_notification_center_widgets_notifications_set_n_notifications (SwayNotificationCenterWidgetsNotifications* self,
                                                                         guint value);
static void sway_notification_center_widgets_notifications_set_n_groups (SwayNotificationCenterWidgetsNotifications* self,
                                                                  guint value);
VALA_EXTERN void sway_notification_center_widgets_notifications_remove_all_notifications (SwayNotificationCenterWidgetsNotifications* self,
                                                                              gboolean animate);
static Block15Data* block15_data_ref (Block15Data* _data15_);
static void block15_data_unref (void * _userdata_);
VALA_EXTERN void sway_notification_center_notification_group_remove_all_notifications (SwayNotificationCenterNotificationGroup* self,
                                                                           gboolean transition,
                                                                           GAsyncReadyCallback _callback_,
                                                                           gpointer _user_data_);
VALA_EXTERN gboolean sway_notification_center_notification_group_remove_all_notifications_finish (SwayNotificationCenterNotificationGroup* self,
                                                                                      GAsyncResult* _res_);
static void _____lambda46_ (Block15Data* _data15_,
                     GObject* obj,
                     GAsyncResult* _result_);
static void ______lambda46__gasync_ready_callback (GObject* source_object,
                                            GAsyncResult* res,
                                            gpointer self);
VALA_EXTERN gboolean sway_notification_center_config_model_get_hide_on_clear (SwayNotificationCenterConfigModel* self);
VALA_EXTERN GType sway_notification_center_control_center_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SwayNotificationCenterControlCenter, g_object_unref)
VALA_EXTERN void sway_notification_center_control_center_set_visibility (SwayNotificationCenterControlCenter* self,
                                                             gboolean visibility);
VALA_EXTERN void sway_notification_center_widgets_notifications_remove_group (SwayNotificationCenterWidgetsNotifications* self,
                                                                  const gchar* group_name_id);
static void sway_notification_center_widgets_notifications_remove_group_internal (SwayNotificationCenterWidgetsNotifications* self,
                                                                           SwayNotificationCenterNotificationGroup* group);
static Block16Data* block16_data_ref (Block16Data* _data16_);
static void block16_data_unref (void * _userdata_);
VALA_EXTERN GType sway_notification_center_notification_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SwayNotificationCenterNotification, g_object_unref)
VALA_EXTERN GeeHashMap* sway_notification_center_notification_group_get_notification_ids (SwayNotificationCenterNotificationGroup* self);
VALA_EXTERN guint sway_notification_center_widgets_notifications_get_n_groups (SwayNotificationCenterWidgetsNotifications* self);
static void __lambda24_ (Block16Data* _data16_,
                  GObject* obj,
                  GAsyncResult* _result_);
static void ___lambda24__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
VALA_EXTERN void sway_notification_center_widgets_notifications_remove_notification (SwayNotificationCenterWidgetsNotifications* self,
                                                                         guint32 id);
static Block17Data* block17_data_ref (Block17Data* _data17_);
static void block17_data_unref (void * _userdata_);
VALA_EXTERN GType sway_notification_center_notification_group_state_get_type (void) G_GNUC_CONST ;
VALA_EXTERN SwayNotificationCenterNotificationGroupState sway_notification_center_notification_group_get_state (SwayNotificationCenterNotificationGroup* self);
VALA_EXTERN void sway_notification_center_notification_group_remove_notification (SwayNotificationCenterNotificationGroup* self,
                                                                      guint32 id,
                                                                      GAsyncReadyCallback _callback_,
                                                                      gpointer _user_data_);
VALA_EXTERN gboolean sway_notification_center_notification_group_remove_notification_finish (SwayNotificationCenterNotificationGroup* self,
                                                                                 GAsyncResult* _res_);
static void ___lambda94_ (Block17Data* _data17_,
                   GObject* obj,
                   GAsyncResult* _result_);
static void ____lambda94__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
VALA_EXTERN GType sway_notification_center_notify_params_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SwayNotificationCenterNotifyParams, g_object_unref)
VALA_EXTERN void sway_notification_center_widgets_notifications_replace_notification (SwayNotificationCenterWidgetsNotifications* self,
                                                                          guint32 id,
                                                                          SwayNotificationCenterNotifyParams* new_params);
VALA_EXTERN gboolean sway_notification_center_notification_group_replace_notification (SwayNotificationCenterNotificationGroup* self,
                                                                           guint32 id,
                                                                           SwayNotificationCenterNotifyParams* new_params);
VALA_EXTERN guint32 sway_notification_center_notify_params_get_applied_id (SwayNotificationCenterNotifyParams* self);
VALA_EXTERN void sway_notification_center_widgets_notifications_add_notification (SwayNotificationCenterWidgetsNotifications* self,
                                                                      SwayNotificationCenterNotifyParams* param);
static Block18Data* block18_data_ref (Block18Data* _data18_);
static void block18_data_unref (void * _userdata_);
VALA_EXTERN GType sway_notification_center_notification_type_get_type (void) G_GNUC_CONST ;
VALA_EXTERN SwayNotificationCenterNotification* sway_notification_center_notification_new_regular (SwayNotificationCenterNotifyParams* param,
                                                                                       SwayNotificationCenterNotificationType notification_type);
VALA_EXTERN SwayNotificationCenterNotification* sway_notification_center_notification_construct_regular (GType object_type,
                                                                                             SwayNotificationCenterNotifyParams* param,
                                                                                             SwayNotificationCenterNotificationType notification_type);
VALA_EXTERN void sway_notification_center_notification_set_time (SwayNotificationCenterNotification* self);
VALA_EXTERN const gchar* sway_notification_center_notify_params_get_name_id (SwayNotificationCenterNotifyParams* self);
VALA_EXTERN gboolean sway_notification_center_notification_group_get_dismissed (SwayNotificationCenterNotificationGroup* self);
VALA_EXTERN gboolean sway_notification_center_config_model_get_notification_grouping (SwayNotificationCenterConfigModel* self);
VALA_EXTERN const gchar* sway_notification_center_notify_params_get_display_name (SwayNotificationCenterNotifyParams* self);
VALA_EXTERN SwayNotificationCenterNotificationGroup* sway_notification_center_notification_group_new (const gchar* name_id,
                                                                                          const gchar* display_name,
                                                                                          GtkViewport* viewport);
VALA_EXTERN SwayNotificationCenterNotificationGroup* sway_notification_center_notification_group_construct (GType object_type,
                                                                                                const gchar* name_id,
                                                                                                const gchar* display_name,
                                                                                                GtkViewport* viewport);
static void ___lambda91_ (Block18Data* _data18_,
                   gboolean expanded);
VALA_EXTERN gfloat sway_notification_center_notification_group_get_relative_y (SwayNotificationCenterNotificationGroup* self,
                                                                   GtkWidget* parent);
static void sway_notification_center_widgets_notifications_scroll_animate (SwayNotificationCenterWidgetsNotifications* self,
                                                                    gdouble to);
static void ____lambda91__sway_notification_center_notification_group_on_expand_change (SwayNotificationCenterNotificationGroup* _sender,
                                                                                 gboolean state,
                                                                                 gpointer self);
VALA_EXTERN void iter_list_box_controller_append (IterListBoxController* self,
                                      GtkWidget* child);
VALA_EXTERN void sway_notification_center_notification_group_add_notification (SwayNotificationCenterNotificationGroup* self,
                                                                   SwayNotificationCenterNotification* noti);
static void sway_notification_center_widgets_notifications_scroll_to_start (SwayNotificationCenterWidgetsNotifications* self);
VALA_EXTERN void sway_notification_center_widgets_notifications_set_list_is_reversed (SwayNotificationCenterWidgetsNotifications* self,
                                                                          gboolean reversed);
static gint sway_notification_center_widgets_notifications_list_box_sort_func (SwayNotificationCenterWidgetsNotifications* self,
                                                                        GtkListBoxRow* row1,
                                                                        GtkListBoxRow* row2);
static gint _sway_notification_center_widgets_notifications_list_box_sort_func_gtk_list_box_sort_func (GtkListBoxRow* row1,
                                                                                                GtkListBoxRow* row2,
                                                                                                gpointer self);
VALA_EXTERN gboolean sway_notification_center_widgets_notifications_key_press_event_cb (SwayNotificationCenterWidgetsNotifications* self,
                                                                            guint keyval,
                                                                            guint keycode,
                                                                            GdkModifierType state);
VALA_EXTERN SwayNotificationCenterNotification* sway_notification_center_notification_group_get_latest_notification (SwayNotificationCenterNotificationGroup* self);
VALA_EXTERN void sway_notification_center_notification_click_default_action (SwayNotificationCenterNotification* self);
VALA_EXTERN gboolean sway_notification_center_notification_group_toggle_expanded (SwayNotificationCenterNotificationGroup* self);
VALA_EXTERN void sway_notification_center_notification_request_dismiss_notification (SwayNotificationCenterNotification* self,
                                                                         SwayNotificationCenterClosedReasons reason,
                                                                         gboolean by_swipe);
VALA_EXTERN void sway_notification_center_notification_group_request_dismiss_all_notifications (SwayNotificationCenterNotificationGroup* 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);
VALA_EXTERN gboolean sway_notification_center_swaync_daemon_toggle_dnd (SwayNotificationCenterSwayncDaemon* self,
                                                            GError** error);
static void sway_notification_center_widgets_notifications_navigate_to_last_notification (SwayNotificationCenterWidgetsNotifications* self);
VALA_EXTERN void sway_notification_center_notification_click_alt_action (SwayNotificationCenterNotification* self,
                                                             guint index);
VALA_EXTERN gboolean sway_notification_center_notification_group_get_is_urgent (SwayNotificationCenterNotificationGroup* self);
VALA_EXTERN gint64 sway_notification_center_notification_group_get_time (SwayNotificationCenterNotificationGroup* self);
static void __lambda92_ (SwayNotificationCenterWidgetsNotifications* self);
static void ___lambda92__gsource_once_func (gpointer self);
static void sway_notification_center_widgets_notifications_navigate_list (SwayNotificationCenterWidgetsNotifications* self,
                                                                   gint i);
static void sway_notification_center_widgets_notifications_finalize (GObject * obj);
static GType sway_notification_center_widgets_notifications_get_type_once (void);
static void _vala_sway_notification_center_widgets_notifications_get_property (GObject * object,
                                                                        guint property_id,
                                                                        GValue * value,
                                                                        GParamSpec * pspec);
static void _vala_sway_notification_center_widgets_notifications_set_property (GObject * object,
                                                                        guint property_id,
                                                                        const GValue * value,
                                                                        GParamSpec * pspec);

static inline gpointer
sway_notification_center_widgets_notifications_get_instance_private (SwayNotificationCenterWidgetsNotifications* self)
{
	return G_STRUCT_MEMBER_P (self, SwayNotificationCenterWidgetsNotifications_private_offset);
}

static void
_sway_notification_center_widgets_notifications_expanded_changed_g_object_notify (GObject* _sender,
                                                                                  GParamSpec* pspec,
                                                                                  gpointer self)
{
	sway_notification_center_widgets_notifications_expanded_changed ((SwayNotificationCenterWidgetsNotifications*) self);
}

SwayNotificationCenterWidgetsNotifications*
sway_notification_center_widgets_notifications_construct (GType object_type)
{
	SwayNotificationCenterWidgetsNotifications * self = NULL;
	GtkListBox* _tmp0_;
	IterListBoxController* _tmp1_;
	GtkLabel* _tmp2_;
	SwayNotificationCenterConfigModel* _tmp3_;
	SwayNotificationCenterConfigModel* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	GtkStack* _tmp7_;
	GtkListBox* _tmp8_;
	self = (SwayNotificationCenterWidgetsNotifications*) sway_notification_center_widgets_base_widget_construct (object_type, "");
	_tmp0_ = self->priv->list_box;
	_tmp1_ = iter_list_box_controller_new (_tmp0_);
	if (_tmp1_) {
		g_object_set_data ((GObject *) _tmp1_, "vala-creation-function", "SwayNotificationCenter.Widgets.Notifications.new");
	}
	_g_object_unref0 (self->priv->list_box_controller);
	self->priv->list_box_controller = _tmp1_;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (self, G_TYPE_OBJECT, GObject), "notify::expanded-group", (GCallback) _sway_notification_center_widgets_notifications_expanded_changed_g_object_notify, self, 0);
	_tmp2_ = self->priv->text_empty_label;
	_tmp3_ = sway_notification_center_config_model_get_instance ();
	_tmp4_ = _tmp3_;
	_tmp5_ = sway_notification_center_config_model_get_text_empty (_tmp4_);
	_tmp6_ = _tmp5_;
	gtk_label_set_text (_tmp2_, _tmp6_);
	_tmp7_ = self->priv->stack;
	gtk_stack_set_visible_child_name (_tmp7_, SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS_STACK_PLACEHOLDER_PAGE);
	_tmp8_ = self->priv->list_box;
	gtk_widget_set_valign (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_START);
	sway_notification_center_widgets_notifications_reload_config (self);
	return self;
}

SwayNotificationCenterWidgetsNotifications*
sway_notification_center_widgets_notifications_new (void)
{
	return sway_notification_center_widgets_notifications_construct (SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_NOTIFICATIONS);
}

static void
sway_notification_center_widgets_notifications_expanded_changed (SwayNotificationCenterWidgetsNotifications* self)
{
	gboolean is_expanded = FALSE;
	SwayNotificationCenterNotificationGroup* _tmp0_;
	IterListBoxController* _tmp1_;
	GList* _tmp2_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_NOTIFICATIONS (self));
	_tmp0_ = self->priv->_expanded_group;
	is_expanded = _tmp0_ != NULL;
	_tmp1_ = self->priv->list_box_controller;
	_tmp2_ = iter_list_box_controller_get_children (_tmp1_);
	{
		GList* child_collection = NULL;
		GList* child_it = NULL;
		child_collection = _tmp2_;
		for (child_it = child_collection; child_it != NULL; child_it = child_it->next) {
			GtkWidget* child = NULL;
			child = (GtkWidget*) child_it->data;
			{
				GtkWidget* _tmp3_;
				_tmp3_ = child;
				if (SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION_GROUP (_tmp3_)) {
					SwayNotificationCenterNotificationGroup* group = NULL;
					GtkWidget* _tmp4_;
					gboolean _tmp5_ = FALSE;
					_tmp4_ = child;
					group = G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_GROUP, SwayNotificationCenterNotificationGroup);
					if (is_expanded) {
						SwayNotificationCenterNotificationGroup* _tmp6_;
						SwayNotificationCenterNotificationGroup* _tmp7_;
						_tmp6_ = group;
						_tmp7_ = self->priv->_expanded_group;
						_tmp5_ = _tmp6_ != _tmp7_;
					} else {
						_tmp5_ = FALSE;
					}
					if (_tmp5_) {
						SwayNotificationCenterNotificationGroup* _tmp8_;
						SwayNotificationCenterNotificationGroup* _tmp9_;
						_tmp8_ = group;
						sway_notification_center_notification_group_set_expanded (_tmp8_, FALSE);
						_tmp9_ = group;
						gtk_widget_add_css_class (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_widget_get_type (), GtkWidget), "not-expanded");
					} else {
						SwayNotificationCenterNotificationGroup* _tmp10_;
						_tmp10_ = group;
						gtk_widget_remove_css_class (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, gtk_widget_get_type (), GtkWidget), "not-expanded");
					}
				}
			}
		}
		(child_collection == NULL) ? NULL : (child_collection = (g_list_free (child_collection), NULL));
	}
}

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

static void
sway_notification_center_widgets_notifications_real_on_cc_visibility_change (SwayNotificationCenterWidgetsBaseWidget* base,
                                                                             gboolean value)
{
	SwayNotificationCenterWidgetsNotifications * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_NOTIFICATIONS, SwayNotificationCenterWidgetsNotifications);
	if (value) {
		IterListBoxController* _tmp0_;
		GList* _tmp1_;
		sway_notification_center_widgets_notifications_navigate_to_first_notification (self);
		_tmp0_ = self->priv->list_box_controller;
		_tmp1_ = iter_list_box_controller_get_children (_tmp0_);
		{
			GList* w_collection = NULL;
			GList* w_it = NULL;
			w_collection = _tmp1_;
			for (w_it = w_collection; w_it != NULL; w_it = w_it->next) {
				GtkWidget* w = NULL;
				w = (GtkWidget*) w_it->data;
				{
					SwayNotificationCenterNotificationGroup* group = NULL;
					GtkWidget* _tmp2_;
					SwayNotificationCenterNotificationGroup* _tmp3_;
					SwayNotificationCenterNotificationGroup* _tmp4_;
					_tmp2_ = w;
					_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_GROUP, SwayNotificationCenterNotificationGroup));
					group = _tmp3_;
					_tmp4_ = group;
					if (_tmp4_ != NULL) {
						SwayNotificationCenterNotificationGroup* _tmp5_;
						_tmp5_ = group;
						sway_notification_center_notification_group_update (_tmp5_);
					}
					_g_object_unref0 (group);
				}
			}
			(w_collection == NULL) ? NULL : (w_collection = (g_list_free (w_collection), NULL));
		}
	}
}

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;
}

void
sway_notification_center_widgets_notifications_reload_config (SwayNotificationCenterWidgetsNotifications* self)
{
	JsonObject* config = NULL;
	JsonObject* _tmp0_;
	JsonObject* _tmp1_;
	GtkScrolledWindow* _tmp8_;
	GtkStack* _tmp9_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_NOTIFICATIONS (self));
	_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) {
		gboolean found_vexpand = FALSE;
		gboolean* vexpand = NULL;
		JsonObject* _tmp2_;
		gboolean _tmp3_ = FALSE;
		gpointer _tmp4_;
		gboolean _tmp5_;
		gboolean* _tmp6_;
		_tmp2_ = config;
		_tmp4_ = 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, _tmp2_, "vexpand", &_tmp3_);
		found_vexpand = _tmp3_;
		_tmp5_ = (gboolean) ((gintptr) _tmp4_);
		_tmp6_ = __bool_dup0 (&_tmp5_);
		vexpand = _tmp6_;
		if (found_vexpand) {
			gboolean* _tmp7_;
			_tmp7_ = vexpand;
			self->priv->vertical_expand = *_tmp7_;
		}
		_g_free0 (vexpand);
	}
	gtk_widget_set_vexpand (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), self->priv->vertical_expand);
	_tmp8_ = self->priv->scrolled_window;
	gtk_scrolled_window_set_propagate_natural_height (_tmp8_, !self->priv->vertical_expand);
	_tmp9_ = self->priv->stack;
	gtk_stack_set_vhomogeneous (_tmp9_, self->priv->vertical_expand);
	_json_object_unref0 (config);
}

inline gboolean
sway_notification_center_widgets_notifications_is_empty (SwayNotificationCenterWidgetsNotifications* self)
{
	guint _tmp0_;
	gboolean result;
	g_return_val_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_NOTIFICATIONS (self), FALSE);
	_tmp0_ = self->priv->_n_notifications;
	result = _tmp0_ == ((guint) 0);
	return result;
}

void
sway_notification_center_widgets_notifications_request_dismiss_all_notifications (SwayNotificationCenterWidgetsNotifications* self)
{
	SwayNotificationCenterNotiDaemon* _tmp0_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_NOTIFICATIONS (self));
	_tmp0_ = sway_notification_center_noti_daemon;
	sway_notification_center_noti_daemon_request_dismiss_all_notifications (_tmp0_, SWAY_NOTIFICATION_CENTER_CLOSED_REASONS_DISMISSED);
}

static void
sway_notification_center_widgets_notifications_prepare_group_removal (SwayNotificationCenterWidgetsNotifications* self,
                                                                      SwayNotificationCenterNotificationGroup* group)
{
	const gchar* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	SwayNotificationCenterNotificationGroup* _tmp5_;
	SwayNotificationCenterNotificationGroup* focused_group = NULL;
	GtkListBox* _tmp6_;
	GtkWidget* _tmp7_;
	gboolean _tmp8_ = FALSE;
	SwayNotificationCenterNotificationGroup* _tmp9_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_NOTIFICATIONS (self));
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION_GROUP (group));
	_tmp0_ = group->name_id;
	_tmp1_ = strlen (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ > 0) {
		GeeHashMap* _tmp3_;
		const gchar* _tmp4_;
		_tmp3_ = self->priv->noti_groups_name;
		_tmp4_ = group->name_id;
		gee_abstract_map_unset (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp4_, NULL);
	}
	_tmp5_ = self->priv->_expanded_group;
	if (_tmp5_ == group) {
		sway_notification_center_widgets_notifications_set_expanded_group (self, NULL);
	}
	_tmp6_ = self->priv->list_box;
	_tmp7_ = gtk_widget_get_focus_child (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_widget_get_type (), GtkWidget));
	focused_group = G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_GROUP, SwayNotificationCenterNotificationGroup);
	_tmp9_ = focused_group;
	if (_tmp9_ == NULL) {
		_tmp8_ = TRUE;
	} else {
		SwayNotificationCenterNotificationGroup* _tmp10_;
		_tmp10_ = focused_group;
		_tmp8_ = _tmp10_ == group;
	}
	if (_tmp8_) {
		if (self->priv->list_reverse) {
			sway_notification_center_widgets_notifications_navigate_up (self, TRUE, NULL);
		} else {
			sway_notification_center_widgets_notifications_navigate_down (self, TRUE, NULL);
		}
	}
}

static void
sway_notification_center_widgets_notifications_commit_group_removal (SwayNotificationCenterWidgetsNotifications* self,
                                                                     SwayNotificationCenterNotificationGroup* group)
{
	IterListBoxController* _tmp0_;
	IterListBoxController* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_NOTIFICATIONS (self));
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION_GROUP (group));
	_tmp0_ = self->priv->list_box_controller;
	iter_list_box_controller_remove (_tmp0_, G_TYPE_CHECK_INSTANCE_CAST (group, gtk_widget_get_type (), GtkWidget));
	_tmp1_ = self->priv->list_box_controller;
	_tmp2_ = iter_list_box_controller_get_length (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_ < 1) {
		GtkStack* _tmp4_;
		sway_notification_center_widgets_notifications_set_n_notifications (self, (guint) 0);
		sway_notification_center_widgets_notifications_set_n_groups (self, (guint) 0);
		_tmp4_ = self->priv->stack;
		gtk_stack_set_visible_child_name (_tmp4_, SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS_STACK_PLACEHOLDER_PAGE);
	}
}

static Block15Data*
block15_data_ref (Block15Data* _data15_)
{
	g_atomic_int_inc (&_data15_->_ref_count_);
	return _data15_;
}

static void
block15_data_unref (void * _userdata_)
{
	Block15Data* _data15_;
	_data15_ = (Block15Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data15_->_ref_count_)) {
		SwayNotificationCenterWidgetsNotifications* self;
		self = _data15_->self;
		_g_object_unref0 (_data15_->group);
		_g_object_unref0 (self);
		g_slice_free (Block15Data, _data15_);
	}
}

static void
_____lambda46_ (Block15Data* _data15_,
                GObject* obj,
                GAsyncResult* _result_)
{
	SwayNotificationCenterWidgetsNotifications* self;
	SwayNotificationCenterNotificationGroup* _tmp0_;
	self = _data15_->self;
	g_return_if_fail ((obj == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (obj, G_TYPE_OBJECT));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (_result_, g_async_result_get_type ()));
	_tmp0_ = _data15_->group;
	if (sway_notification_center_notification_group_remove_all_notifications_finish (_tmp0_, _result_)) {
		SwayNotificationCenterNotificationGroup* _tmp1_;
		_tmp1_ = _data15_->group;
		sway_notification_center_widgets_notifications_commit_group_removal (self, _tmp1_);
	}
}

static void
______lambda46__gasync_ready_callback (GObject* source_object,
                                       GAsyncResult* res,
                                       gpointer self)
{
	_____lambda46_ (self, source_object, res);
	block15_data_unref (self);
}

void
sway_notification_center_widgets_notifications_remove_all_notifications (SwayNotificationCenterWidgetsNotifications* self,
                                                                         gboolean animate)
{
	GeeHashMap* _tmp0_;
	IterListBoxController* _tmp1_;
	GList* _tmp2_;
	SwayNotificationCenterConfigModel* _tmp8_;
	SwayNotificationCenterConfigModel* _tmp9_;
	gboolean _tmp10_;
	gboolean _tmp11_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_NOTIFICATIONS (self));
	_tmp0_ = self->priv->noti_groups_id;
	gee_abstract_map_clear (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap));
	sway_notification_center_widgets_notifications_set_n_notifications (self, (guint) 0);
	sway_notification_center_widgets_notifications_set_n_groups (self, (guint) 0);
	_tmp1_ = self->priv->list_box_controller;
	_tmp2_ = iter_list_box_controller_get_children (_tmp1_);
	{
		GList* w_collection = NULL;
		GList* w_it = NULL;
		w_collection = _tmp2_;
		for (w_it = w_collection; w_it != NULL; w_it = w_it->next) {
			GtkWidget* w = NULL;
			w = (GtkWidget*) w_it->data;
			{
				Block15Data* _data15_;
				GtkWidget* _tmp3_;
				SwayNotificationCenterNotificationGroup* _tmp4_;
				SwayNotificationCenterNotificationGroup* _tmp5_;
				_data15_ = g_slice_new0 (Block15Data);
				_data15_->_ref_count_ = 1;
				_data15_->self = g_object_ref (self);
				_tmp3_ = w;
				_tmp4_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_GROUP, SwayNotificationCenterNotificationGroup));
				_data15_->group = _tmp4_;
				_tmp5_ = _data15_->group;
				if (_tmp5_ != NULL) {
					SwayNotificationCenterNotificationGroup* _tmp6_;
					SwayNotificationCenterNotificationGroup* _tmp7_;
					_tmp6_ = _data15_->group;
					sway_notification_center_widgets_notifications_prepare_group_removal (self, _tmp6_);
					_tmp7_ = _data15_->group;
					sway_notification_center_notification_group_remove_all_notifications (_tmp7_, TRUE, ______lambda46__gasync_ready_callback, block15_data_ref (_data15_));
				}
				block15_data_unref (_data15_);
				_data15_ = NULL;
			}
		}
		(w_collection == NULL) ? NULL : (w_collection = (g_list_free (w_collection), NULL));
	}
	_tmp8_ = sway_notification_center_config_model_get_instance ();
	_tmp9_ = _tmp8_;
	_tmp10_ = sway_notification_center_config_model_get_hide_on_clear (_tmp9_);
	_tmp11_ = _tmp10_;
	if (_tmp11_) {
		SwayNotificationCenterControlCenter* _tmp12_;
		_tmp12_ = sway_notification_center_control_center;
		sway_notification_center_control_center_set_visibility (_tmp12_, FALSE);
	}
}

void
sway_notification_center_widgets_notifications_remove_group (SwayNotificationCenterWidgetsNotifications* self,
                                                             const gchar* group_name_id)
{
	SwayNotificationCenterNotificationGroup* group = NULL;
	GeeHashMap* _tmp0_;
	gpointer _tmp1_;
	SwayNotificationCenterNotificationGroup* _tmp2_;
	SwayNotificationCenterNotificationGroup* _tmp3_;
	SwayNotificationCenterNotificationGroup* _tmp4_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_NOTIFICATIONS (self));
	g_return_if_fail (group_name_id != NULL);
	_tmp0_ = self->priv->noti_groups_name;
	_tmp1_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), group_name_id);
	_tmp2_ = _g_object_ref0 ((SwayNotificationCenterNotificationGroup*) _tmp1_);
	group = _tmp2_;
	_tmp3_ = group;
	if (_tmp3_ == NULL) {
		_g_object_unref0 (group);
		return;
	}
	_tmp4_ = group;
	sway_notification_center_widgets_notifications_remove_group_internal (self, _tmp4_);
	_g_object_unref0 (group);
}

static Block16Data*
block16_data_ref (Block16Data* _data16_)
{
	g_atomic_int_inc (&_data16_->_ref_count_);
	return _data16_;
}

static void
block16_data_unref (void * _userdata_)
{
	Block16Data* _data16_;
	_data16_ = (Block16Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data16_->_ref_count_)) {
		SwayNotificationCenterWidgetsNotifications* self;
		self = _data16_->self;
		_g_object_unref0 (_data16_->group);
		_g_object_unref0 (self);
		g_slice_free (Block16Data, _data16_);
	}
}

static void
__lambda24_ (Block16Data* _data16_,
             GObject* obj,
             GAsyncResult* _result_)
{
	SwayNotificationCenterWidgetsNotifications* self;
	self = _data16_->self;
	g_return_if_fail ((obj == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (obj, G_TYPE_OBJECT));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (_result_, g_async_result_get_type ()));
	if (sway_notification_center_notification_group_remove_all_notifications_finish (_data16_->group, _result_)) {
		sway_notification_center_widgets_notifications_commit_group_removal (self, _data16_->group);
	}
}

static void
___lambda24__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda24_ (self, source_object, res);
	block16_data_unref (self);
}

static void
sway_notification_center_widgets_notifications_remove_group_internal (SwayNotificationCenterWidgetsNotifications* self,
                                                                      SwayNotificationCenterNotificationGroup* group)
{
	Block16Data* _data16_;
	SwayNotificationCenterNotificationGroup* _tmp0_;
	guint _tmp13_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_NOTIFICATIONS (self));
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION_GROUP (group));
	_data16_ = g_slice_new0 (Block16Data);
	_data16_->_ref_count_ = 1;
	_data16_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (group);
	_g_object_unref0 (_data16_->group);
	_data16_->group = _tmp0_;
	{
		GeeIterator* _id_it = NULL;
		GeeHashMap* _tmp1_;
		GeeHashMap* _tmp2_;
		GeeSet* _tmp3_;
		GeeSet* _tmp4_;
		GeeSet* _tmp5_;
		GeeIterator* _tmp6_;
		GeeIterator* _tmp7_;
		_tmp1_ = sway_notification_center_notification_group_get_notification_ids (_data16_->group);
		_tmp2_ = _tmp1_;
		_tmp3_ = gee_abstract_map_get_keys (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap));
		_tmp4_ = _tmp3_;
		_tmp5_ = _tmp4_;
		_tmp6_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, GEE_TYPE_ITERABLE, GeeIterable));
		_tmp7_ = _tmp6_;
		_g_object_unref0 (_tmp5_);
		_id_it = _tmp7_;
		while (TRUE) {
			GeeIterator* _tmp8_;
			guint32 id = 0U;
			GeeIterator* _tmp9_;
			gpointer _tmp10_;
			GeeHashMap* _tmp11_;
			_tmp8_ = _id_it;
			if (!gee_iterator_next (_tmp8_)) {
				break;
			}
			_tmp9_ = _id_it;
			_tmp10_ = gee_iterator_get (_tmp9_);
			id = (guint32) ((guintptr) _tmp10_);
			_tmp11_ = self->priv->noti_groups_id;
			if (gee_abstract_map_unset (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), (gpointer) ((guintptr) id), NULL)) {
				guint _tmp12_;
				_tmp12_ = self->priv->_n_notifications;
				sway_notification_center_widgets_notifications_set_n_notifications (self, _tmp12_ - 1);
			}
		}
		_g_object_unref0 (_id_it);
	}
	_tmp13_ = self->priv->_n_groups;
	sway_notification_center_widgets_notifications_set_n_groups (self, _tmp13_ - 1);
	sway_notification_center_widgets_notifications_prepare_group_removal (self, _data16_->group);
	sway_notification_center_notification_group_remove_all_notifications (_data16_->group, TRUE, ___lambda24__gasync_ready_callback, block16_data_ref (_data16_));
	block16_data_unref (_data16_);
	_data16_ = NULL;
}

/** Removes the notification widget with ID. Doesn't dismiss */
static Block17Data*
block17_data_ref (Block17Data* _data17_)
{
	g_atomic_int_inc (&_data17_->_ref_count_);
	return _data17_;
}

static void
block17_data_unref (void * _userdata_)
{
	Block17Data* _data17_;
	_data17_ = (Block17Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data17_->_ref_count_)) {
		SwayNotificationCenterWidgetsNotifications* self;
		self = _data17_->self;
		_g_object_unref0 (_data17_->group);
		_g_object_unref0 (self);
		g_slice_free (Block17Data, _data17_);
	}
}

static void
___lambda94_ (Block17Data* _data17_,
              GObject* obj,
              GAsyncResult* _result_)
{
	SwayNotificationCenterWidgetsNotifications* self;
	SwayNotificationCenterNotificationGroup* _tmp0_;
	SwayNotificationCenterNotificationGroupState _tmp1_;
	SwayNotificationCenterNotificationGroupState _tmp2_;
	self = _data17_->self;
	g_return_if_fail ((obj == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (obj, G_TYPE_OBJECT));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (_result_, g_async_result_get_type ()));
	_tmp0_ = _data17_->group;
	_tmp1_ = sway_notification_center_notification_group_get_state (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ == SWAY_NOTIFICATION_CENTER_NOTIFICATION_GROUP_STATE_EMPTY) {
		guint _tmp3_;
		SwayNotificationCenterNotificationGroup* _tmp4_;
		SwayNotificationCenterNotificationGroup* _tmp5_;
		_tmp3_ = self->priv->_n_groups;
		sway_notification_center_widgets_notifications_set_n_groups (self, _tmp3_ - 1);
		_tmp4_ = _data17_->group;
		sway_notification_center_widgets_notifications_prepare_group_removal (self, _tmp4_);
		_tmp5_ = _data17_->group;
		sway_notification_center_widgets_notifications_commit_group_removal (self, _tmp5_);
	}
}

static void
____lambda94__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	___lambda94_ (self, source_object, res);
	block17_data_unref (self);
}

void
sway_notification_center_widgets_notifications_remove_notification (SwayNotificationCenterWidgetsNotifications* self,
                                                                    guint32 id)
{
	Block17Data* _data17_;
	GeeHashMap* _tmp0_;
	gpointer _tmp1_;
	SwayNotificationCenterNotificationGroup* _tmp2_;
	SwayNotificationCenterNotificationGroup* _tmp3_;
	SwayNotificationCenterNotificationGroup* _tmp4_;
	SwayNotificationCenterNotificationGroupState _tmp5_;
	SwayNotificationCenterNotificationGroupState _tmp6_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_NOTIFICATIONS (self));
	_data17_ = g_slice_new0 (Block17Data);
	_data17_->_ref_count_ = 1;
	_data17_->self = g_object_ref (self);
	_tmp0_ = self->priv->noti_groups_id;
	_tmp1_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), (gpointer) ((guintptr) id));
	_tmp2_ = _g_object_ref0 ((SwayNotificationCenterNotificationGroup*) _tmp1_);
	_data17_->group = _tmp2_;
	_tmp3_ = _data17_->group;
	if (_tmp3_ == NULL) {
		block17_data_unref (_data17_);
		_data17_ = NULL;
		return;
	}
	_tmp4_ = _data17_->group;
	_tmp5_ = sway_notification_center_notification_group_get_state (_tmp4_);
	_tmp6_ = _tmp5_;
	if (_tmp6_ == SWAY_NOTIFICATION_CENTER_NOTIFICATION_GROUP_STATE_MANY) {
		GeeHashMap* _tmp7_;
		guint _tmp8_;
		SwayNotificationCenterNotificationGroup* _tmp9_;
		guint32 _tmp10_;
		_tmp7_ = self->priv->noti_groups_id;
		gee_abstract_map_unset (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), (gpointer) ((guintptr) id), NULL);
		_tmp8_ = self->priv->_n_notifications;
		sway_notification_center_widgets_notifications_set_n_notifications (self, _tmp8_ - 1);
		_tmp9_ = _data17_->group;
		_tmp10_ = id;
		sway_notification_center_notification_group_remove_notification (_tmp9_, _tmp10_, ____lambda94__gasync_ready_callback, block17_data_ref (_data17_));
	} else {
		SwayNotificationCenterNotificationGroup* _tmp11_;
		_tmp11_ = _data17_->group;
		sway_notification_center_widgets_notifications_remove_group_internal (self, _tmp11_);
	}
	block17_data_unref (_data17_);
	_data17_ = NULL;
}

void
sway_notification_center_widgets_notifications_replace_notification (SwayNotificationCenterWidgetsNotifications* self,
                                                                     guint32 id,
                                                                     SwayNotificationCenterNotifyParams* new_params)
{
	SwayNotificationCenterNotificationGroup* group = NULL;
	GeeHashMap* _tmp0_;
	gpointer _tmp1_;
	SwayNotificationCenterNotificationGroup* _tmp2_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_NOTIFICATIONS (self));
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_NOTIFY_PARAMS (new_params));
	_tmp0_ = self->priv->noti_groups_id;
	_tmp1_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), (gpointer) ((guintptr) id));
	group = (SwayNotificationCenterNotificationGroup*) _tmp1_;
	_tmp2_ = group;
	if (_tmp2_ != NULL) {
		GeeHashMap* _tmp3_;
		SwayNotificationCenterNotificationGroup* _tmp4_;
		_tmp3_ = self->priv->noti_groups_id;
		gee_abstract_map_unset (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), (gpointer) ((guintptr) id), NULL);
		_tmp4_ = group;
		if (sway_notification_center_notification_group_replace_notification (_tmp4_, id, new_params)) {
			GeeHashMap* _tmp5_;
			guint32 _tmp6_;
			guint32 _tmp7_;
			SwayNotificationCenterNotificationGroup* _tmp8_;
			GtkListBox* _tmp9_;
			_tmp5_ = self->priv->noti_groups_id;
			_tmp6_ = sway_notification_center_notify_params_get_applied_id (new_params);
			_tmp7_ = _tmp6_;
			_tmp8_ = group;
			gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), (gpointer) ((guintptr) _tmp7_), _tmp8_);
			_tmp9_ = self->priv->list_box;
			gtk_list_box_invalidate_sort (_tmp9_);
			return;
		}
	}
	sway_notification_center_widgets_notifications_add_notification (self, new_params);
}

static Block18Data*
block18_data_ref (Block18Data* _data18_)
{
	g_atomic_int_inc (&_data18_->_ref_count_);
	return _data18_;
}

static void
block18_data_unref (void * _userdata_)
{
	Block18Data* _data18_;
	_data18_ = (Block18Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data18_->_ref_count_)) {
		SwayNotificationCenterWidgetsNotifications* self;
		self = _data18_->self;
		_g_object_unref0 (_data18_->group);
		_g_object_unref0 (self);
		g_slice_free (Block18Data, _data18_);
	}
}

static void
___lambda91_ (Block18Data* _data18_,
              gboolean expanded)
{
	SwayNotificationCenterWidgetsNotifications* self;
	SwayNotificationCenterNotificationGroup* _tmp0_;
	gfloat y = 0.0F;
	SwayNotificationCenterNotificationGroup* _tmp1_;
	GtkListBox* _tmp2_;
	self = _data18_->self;
	if (!expanded) {
		sway_notification_center_widgets_notifications_set_expanded_group (self, NULL);
		return;
	}
	_tmp0_ = _data18_->group;
	sway_notification_center_widgets_notifications_set_expanded_group (self, _tmp0_);
	_tmp1_ = self->priv->_expanded_group;
	_tmp2_ = self->priv->list_box;
	y = sway_notification_center_notification_group_get_relative_y (_tmp1_, G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_widget_get_type (), GtkWidget));
	if (y > ((gfloat) 0)) {
		sway_notification_center_widgets_notifications_scroll_animate (self, (gdouble) y);
	}
}

static void
____lambda91__sway_notification_center_notification_group_on_expand_change (SwayNotificationCenterNotificationGroup* _sender,
                                                                            gboolean state,
                                                                            gpointer self)
{
	___lambda91_ (self, state);
}

void
sway_notification_center_widgets_notifications_add_notification (SwayNotificationCenterWidgetsNotifications* self,
                                                                 SwayNotificationCenterNotifyParams* param)
{
	Block18Data* _data18_;
	SwayNotificationCenterNotification* noti = NULL;
	SwayNotificationCenterNotification* _tmp0_;
	SwayNotificationCenterNotification* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	gboolean _tmp11_ = FALSE;
	gboolean _tmp12_ = FALSE;
	SwayNotificationCenterNotificationGroup* _tmp13_;
	SwayNotificationCenterNotificationGroup* _tmp40_;
	SwayNotificationCenterNotificationGroup* _tmp42_;
	SwayNotificationCenterNotification* _tmp43_;
	GeeHashMap* _tmp44_;
	guint32 _tmp45_;
	guint32 _tmp46_;
	SwayNotificationCenterNotificationGroup* _tmp47_;
	guint _tmp48_;
	GtkListBox* _tmp49_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_NOTIFICATIONS (self));
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_NOTIFY_PARAMS (param));
	_data18_ = g_slice_new0 (Block18Data);
	_data18_->_ref_count_ = 1;
	_data18_->self = g_object_ref (self);
	_tmp0_ = sway_notification_center_notification_new_regular (param, SWAY_NOTIFICATION_CENTER_NOTIFICATION_TYPE_CONTROL_CENTER);
	if (_tmp0_) {
		g_object_set_data ((GObject *) _tmp0_, "vala-creation-function", "SwayNotificationCenter.Widgets.Notifications.add_notification");
	}
	g_object_ref_sink (_tmp0_);
	noti = _tmp0_;
	_tmp1_ = noti;
	sway_notification_center_notification_set_time (_tmp1_);
	_data18_->group = NULL;
	_tmp2_ = sway_notification_center_notify_params_get_name_id (param);
	_tmp3_ = _tmp2_;
	_tmp4_ = strlen (_tmp3_);
	_tmp5_ = _tmp4_;
	if (_tmp5_ > 0) {
		GeeHashMap* _tmp6_;
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		gpointer _tmp9_;
		SwayNotificationCenterNotificationGroup* _tmp10_;
		_tmp6_ = self->priv->noti_groups_name;
		_tmp7_ = sway_notification_center_notify_params_get_name_id (param);
		_tmp8_ = _tmp7_;
		_tmp9_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp8_);
		_tmp10_ = _g_object_ref0 ((SwayNotificationCenterNotificationGroup*) _tmp9_);
		_g_object_unref0 (_data18_->group);
		_data18_->group = _tmp10_;
	}
	_tmp13_ = _data18_->group;
	if (_tmp13_ == NULL) {
		_tmp12_ = TRUE;
	} else {
		SwayNotificationCenterNotificationGroup* _tmp14_;
		gboolean _tmp15_;
		gboolean _tmp16_;
		_tmp14_ = _data18_->group;
		_tmp15_ = sway_notification_center_notification_group_get_dismissed (_tmp14_);
		_tmp16_ = _tmp15_;
		_tmp12_ = _tmp16_;
	}
	if (_tmp12_) {
		_tmp11_ = TRUE;
	} else {
		SwayNotificationCenterConfigModel* _tmp17_;
		SwayNotificationCenterConfigModel* _tmp18_;
		gboolean _tmp19_;
		gboolean _tmp20_;
		_tmp17_ = sway_notification_center_config_model_get_instance ();
		_tmp18_ = _tmp17_;
		_tmp19_ = sway_notification_center_config_model_get_notification_grouping (_tmp18_);
		_tmp20_ = _tmp19_;
		_tmp11_ = _tmp20_ == FALSE;
	}
	if (_tmp11_) {
		const gchar* _tmp21_;
		const gchar* _tmp22_;
		const gchar* _tmp23_;
		const gchar* _tmp24_;
		GtkViewport* _tmp25_;
		SwayNotificationCenterNotificationGroup* _tmp26_;
		SwayNotificationCenterNotificationGroup* _tmp27_;
		const gchar* _tmp28_;
		const gchar* _tmp29_;
		gint _tmp30_;
		gint _tmp31_;
		GtkStack* _tmp36_;
		IterListBoxController* _tmp37_;
		SwayNotificationCenterNotificationGroup* _tmp38_;
		guint _tmp39_;
		_tmp21_ = sway_notification_center_notify_params_get_name_id (param);
		_tmp22_ = _tmp21_;
		_tmp23_ = sway_notification_center_notify_params_get_display_name (param);
		_tmp24_ = _tmp23_;
		_tmp25_ = self->priv->viewport;
		_tmp26_ = sway_notification_center_notification_group_new (_tmp22_, _tmp24_, _tmp25_);
		if (_tmp26_) {
			g_object_set_data ((GObject *) _tmp26_, "vala-creation-function", "SwayNotificationCenter.Widgets.Notifications.add_notification");
		}
		g_object_ref_sink (_tmp26_);
		_g_object_unref0 (_data18_->group);
		_data18_->group = _tmp26_;
		_tmp27_ = _data18_->group;
		g_signal_connect_data (_tmp27_, "on-expand-change", (GCallback) ____lambda91__sway_notification_center_notification_group_on_expand_change, block18_data_ref (_data18_), (GClosureNotify) block18_data_unref, 0);
		_tmp28_ = sway_notification_center_notify_params_get_name_id (param);
		_tmp29_ = _tmp28_;
		_tmp30_ = strlen (_tmp29_);
		_tmp31_ = _tmp30_;
		if (_tmp31_ > 0) {
			GeeHashMap* _tmp32_;
			const gchar* _tmp33_;
			const gchar* _tmp34_;
			SwayNotificationCenterNotificationGroup* _tmp35_;
			_tmp32_ = self->priv->noti_groups_name;
			_tmp33_ = sway_notification_center_notify_params_get_name_id (param);
			_tmp34_ = _tmp33_;
			_tmp35_ = _data18_->group;
			gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp34_, _tmp35_);
		}
		_tmp36_ = self->priv->stack;
		gtk_stack_set_visible_child_name (_tmp36_, SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS_STACK_NOTIFICATIONS_PAGE);
		_tmp37_ = self->priv->list_box_controller;
		_tmp38_ = _data18_->group;
		iter_list_box_controller_append (_tmp37_, G_TYPE_CHECK_INSTANCE_CAST (_tmp38_, gtk_widget_get_type (), GtkWidget));
		_tmp39_ = self->priv->_n_groups;
		sway_notification_center_widgets_notifications_set_n_groups (self, _tmp39_ + 1);
	}
	_tmp40_ = self->priv->_expanded_group;
	if (_tmp40_ != NULL) {
		SwayNotificationCenterNotificationGroup* _tmp41_;
		_tmp41_ = _data18_->group;
		gtk_widget_add_css_class (G_TYPE_CHECK_INSTANCE_CAST (_tmp41_, gtk_widget_get_type (), GtkWidget), "not-expanded");
	}
	_tmp42_ = _data18_->group;
	_tmp43_ = noti;
	sway_notification_center_notification_group_add_notification (_tmp42_, _tmp43_);
	_tmp44_ = self->priv->noti_groups_id;
	_tmp45_ = sway_notification_center_notify_params_get_applied_id (param);
	_tmp46_ = _tmp45_;
	_tmp47_ = _data18_->group;
	gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp44_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), (gpointer) ((guintptr) _tmp46_), _tmp47_);
	_tmp48_ = self->priv->_n_notifications;
	sway_notification_center_widgets_notifications_set_n_notifications (self, _tmp48_ + 1);
	_tmp49_ = self->priv->list_box;
	gtk_list_box_invalidate_sort (_tmp49_);
	sway_notification_center_widgets_notifications_scroll_to_start (self);
	_g_object_unref0 (noti);
	block18_data_unref (_data18_);
	_data18_ = NULL;
}

static gint
_sway_notification_center_widgets_notifications_list_box_sort_func_gtk_list_box_sort_func (GtkListBoxRow* row1,
                                                                                           GtkListBoxRow* row2,
                                                                                           gpointer self)
{
	gint result;
	result = sway_notification_center_widgets_notifications_list_box_sort_func ((SwayNotificationCenterWidgetsNotifications*) self, row1, row2);
	return result;
}

void
sway_notification_center_widgets_notifications_set_list_is_reversed (SwayNotificationCenterWidgetsNotifications* self,
                                                                     gboolean reversed)
{
	GtkAlign _tmp0_ = 0;
	GtkListBox* _tmp1_;
	GtkListBox* _tmp2_;
	GtkListBox* _tmp3_;
	GtkListBox* _tmp4_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_NOTIFICATIONS (self));
	self->priv->list_reverse = reversed;
	if (reversed) {
		_tmp0_ = GTK_ALIGN_END;
	} else {
		_tmp0_ = GTK_ALIGN_START;
	}
	_tmp1_ = self->priv->list_box;
	gtk_widget_set_valign (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_widget_get_type (), GtkWidget), _tmp0_);
	_tmp2_ = self->priv->list_box;
	gtk_list_box_set_sort_func (_tmp2_, _sway_notification_center_widgets_notifications_list_box_sort_func_gtk_list_box_sort_func, g_object_ref (self), g_object_unref);
	_tmp3_ = self->priv->list_box;
	gtk_list_box_set_selection_mode (_tmp3_, GTK_SELECTION_NONE);
	_tmp4_ = self->priv->list_box;
	gtk_list_box_set_activate_on_single_click (_tmp4_, FALSE);
}

gboolean
sway_notification_center_widgets_notifications_key_press_event_cb (SwayNotificationCenterWidgetsNotifications* self,
                                                                   guint keyval,
                                                                   guint keycode,
                                                                   GdkModifierType state)
{
	GtkListBox* _tmp0_;
	GtkWidget* _tmp1_;
	SwayNotificationCenterNotificationGroup* group = NULL;
	GtkListBox* _tmp2_;
	GtkWidget* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	GQuark _tmp7_ = 0U;
	static GQuark _tmp6_label0 = 0;
	static GQuark _tmp6_label1 = 0;
	static GQuark _tmp6_label2 = 0;
	static GQuark _tmp6_label3 = 0;
	static GQuark _tmp6_label4 = 0;
	static GQuark _tmp6_label5 = 0;
	static GQuark _tmp6_label6 = 0;
	static GQuark _tmp6_label7 = 0;
	static GQuark _tmp6_label8 = 0;
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_NOTIFICATIONS (self), FALSE);
	_tmp0_ = self->priv->list_box;
	_tmp1_ = gtk_widget_get_focus_child (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_widget_get_type (), GtkWidget));
	if (!SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION_GROUP (_tmp1_)) {
		sway_notification_center_widgets_notifications_navigate_to_first_notification (self);
	}
	_tmp2_ = self->priv->list_box;
	_tmp3_ = gtk_widget_get_focus_child (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_widget_get_type (), GtkWidget));
	group = G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_GROUP, SwayNotificationCenterNotificationGroup);
	_tmp4_ = gdk_keyval_name (keyval);
	_tmp5_ = _tmp4_;
	_tmp7_ = (NULL == _tmp5_) ? 0 : g_quark_from_string (_tmp5_);
	if (_tmp7_ == ((0 != _tmp6_label0) ? _tmp6_label0 : (_tmp6_label0 = g_quark_from_static_string ("Return")))) {
		switch (0) {
			default:
			{
				SwayNotificationCenterNotificationGroup* _tmp8_;
				_tmp8_ = group;
				if (_tmp8_ != NULL) {
					SwayNotificationCenterNotification* noti = NULL;
					SwayNotificationCenterNotificationGroup* _tmp9_;
					SwayNotificationCenterNotification* _tmp10_;
					SwayNotificationCenterNotification* _tmp11_;
					gboolean _tmp12_ = FALSE;
					SwayNotificationCenterNotificationGroup* _tmp13_;
					SwayNotificationCenterNotificationGroupState _tmp14_;
					SwayNotificationCenterNotificationGroupState _tmp15_;
					SwayNotificationCenterNotificationGroup* _tmp18_;
					SwayNotificationCenterNotificationGroup* _tmp19_;
					_tmp9_ = group;
					_tmp10_ = sway_notification_center_notification_group_get_latest_notification (_tmp9_);
					_tmp11_ = _g_object_ref0 (_tmp10_);
					noti = _tmp11_;
					_tmp13_ = group;
					_tmp14_ = sway_notification_center_notification_group_get_state (_tmp13_);
					_tmp15_ = _tmp14_;
					if (_tmp15_ == SWAY_NOTIFICATION_CENTER_NOTIFICATION_GROUP_STATE_SINLGE) {
						SwayNotificationCenterNotification* _tmp16_;
						_tmp16_ = noti;
						_tmp12_ = _tmp16_ != NULL;
					} else {
						_tmp12_ = FALSE;
					}
					if (_tmp12_) {
						SwayNotificationCenterNotification* _tmp17_;
						_tmp17_ = noti;
						sway_notification_center_notification_click_default_action (_tmp17_);
						_g_object_unref0 (noti);
						break;
					}
					_tmp18_ = group;
					_tmp19_ = group;
					g_signal_emit_by_name (_tmp18_, "on-expand-change", sway_notification_center_notification_group_toggle_expanded (_tmp19_));
					_g_object_unref0 (noti);
				}
				break;
			}
		}
	} else if ((_tmp7_ == ((0 != _tmp6_label1) ? _tmp6_label1 : (_tmp6_label1 = g_quark_from_static_string ("Delete")))) || (_tmp7_ == ((0 != _tmp6_label2) ? _tmp6_label2 : (_tmp6_label2 = g_quark_from_static_string ("BackSpace"))))) {
		switch (0) {
			default:
			{
				gboolean _tmp20_ = FALSE;
				SwayNotificationCenterNotificationGroup* _tmp21_;
				_tmp21_ = group;
				if (_tmp21_ != NULL) {
					guint _tmp22_;
					_tmp22_ = self->priv->_n_groups;
					_tmp20_ = _tmp22_ > ((guint) 0);
				} else {
					_tmp20_ = FALSE;
				}
				if (_tmp20_) {
					SwayNotificationCenterNotification* noti = NULL;
					SwayNotificationCenterNotificationGroup* _tmp23_;
					SwayNotificationCenterNotification* _tmp24_;
					gboolean _tmp25_ = FALSE;
					SwayNotificationCenterNotificationGroup* _tmp26_;
					SwayNotificationCenterNotificationGroupState _tmp27_;
					SwayNotificationCenterNotificationGroupState _tmp28_;
					SwayNotificationCenterNotificationGroup* _tmp31_;
					_tmp23_ = group;
					_tmp24_ = sway_notification_center_notification_group_get_latest_notification (_tmp23_);
					noti = _tmp24_;
					_tmp26_ = group;
					_tmp27_ = sway_notification_center_notification_group_get_state (_tmp26_);
					_tmp28_ = _tmp27_;
					if (_tmp28_ == SWAY_NOTIFICATION_CENTER_NOTIFICATION_GROUP_STATE_SINLGE) {
						SwayNotificationCenterNotification* _tmp29_;
						_tmp29_ = noti;
						_tmp25_ = _tmp29_ != NULL;
					} else {
						_tmp25_ = FALSE;
					}
					if (_tmp25_) {
						SwayNotificationCenterNotification* _tmp30_;
						_tmp30_ = noti;
						sway_notification_center_notification_request_dismiss_notification (_tmp30_, SWAY_NOTIFICATION_CENTER_CLOSED_REASONS_DISMISSED, FALSE);
						break;
					}
					_tmp31_ = group;
					sway_notification_center_notification_group_request_dismiss_all_notifications (_tmp31_);
					break;
				}
				break;
			}
		}
	} else if (_tmp7_ == ((0 != _tmp6_label3) ? _tmp6_label3 : (_tmp6_label3 = g_quark_from_static_string ("C")))) {
		switch (0) {
			default:
			{
				sway_notification_center_widgets_notifications_request_dismiss_all_notifications (self);
				break;
			}
		}
	} else if (_tmp7_ == ((0 != _tmp6_label4) ? _tmp6_label4 : (_tmp6_label4 = g_quark_from_static_string ("D")))) {
		switch (0) {
			default:
			{
				{
					SwayNotificationCenterSwayncDaemon* _tmp32_;
					_tmp32_ = sway_notification_center_swaync_daemon;
					sway_notification_center_swaync_daemon_toggle_dnd (_tmp32_, &_inner_error0_);
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						goto __catch0_g_error;
					}
				}
				goto __finally0;
				__catch0_g_error:
				{
					GError* e = NULL;
					GError* _tmp33_;
					const gchar* _tmp34_;
					e = _inner_error0_;
					_inner_error0_ = NULL;
					_tmp33_ = e;
					_tmp34_ = _tmp33_->message;
					g_critical ("notifications.vala:327: Error: %s\n", _tmp34_);
					_g_error_free0 (e);
				}
				__finally0:
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					gboolean _tmp35_ = FALSE;
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return _tmp35_;
				}
				break;
			}
		}
	} else if (_tmp7_ == ((0 != _tmp6_label5) ? _tmp6_label5 : (_tmp6_label5 = g_quark_from_static_string ("Down")))) {
		switch (0) {
			default:
			{
				SwayNotificationCenterNotificationGroup* _tmp36_;
				_tmp36_ = group;
				sway_notification_center_widgets_notifications_navigate_down (self, FALSE, _tmp36_);
				break;
			}
		}
	} else if (_tmp7_ == ((0 != _tmp6_label6) ? _tmp6_label6 : (_tmp6_label6 = g_quark_from_static_string ("Up")))) {
		switch (0) {
			default:
			{
				SwayNotificationCenterNotificationGroup* _tmp37_;
				_tmp37_ = group;
				sway_notification_center_widgets_notifications_navigate_up (self, FALSE, _tmp37_);
				break;
			}
		}
	} else if (_tmp7_ == ((0 != _tmp6_label7) ? _tmp6_label7 : (_tmp6_label7 = g_quark_from_static_string ("Home")))) {
		switch (0) {
			default:
			{
				sway_notification_center_widgets_notifications_navigate_to_first_notification (self);
				break;
			}
		}
	} else if (_tmp7_ == ((0 != _tmp6_label8) ? _tmp6_label8 : (_tmp6_label8 = g_quark_from_static_string ("End")))) {
		switch (0) {
			default:
			{
				sway_notification_center_widgets_notifications_navigate_to_last_notification (self);
				break;
			}
		}
	} else {
		switch (0) {
			default:
			{
				{
					gint i = 0;
					i = 0;
					{
						gboolean _tmp38_ = FALSE;
						_tmp38_ = TRUE;
						while (TRUE) {
							guint num_keyval = 0U;
							gchar* _tmp40_;
							gchar* _tmp41_;
							guint _tmp42_;
							gboolean _tmp43_ = FALSE;
							if (!_tmp38_) {
								gint _tmp39_;
								_tmp39_ = i;
								i = _tmp39_ + 1;
							}
							_tmp38_ = FALSE;
							if (!(i < 9)) {
								break;
							}
							_tmp40_ = g_strdup_printf ("%i", i + 1);
							_tmp41_ = _tmp40_;
							_tmp42_ = gdk_keyval_from_name (_tmp41_);
							_g_free0 (_tmp41_);
							num_keyval = _tmp42_;
							if (keyval == num_keyval) {
								SwayNotificationCenterNotificationGroup* _tmp44_;
								_tmp44_ = group;
								_tmp43_ = _tmp44_ != NULL;
							} else {
								_tmp43_ = FALSE;
							}
							if (_tmp43_) {
								SwayNotificationCenterNotification* noti = NULL;
								SwayNotificationCenterNotificationGroup* _tmp45_;
								SwayNotificationCenterNotification* _tmp46_;
								SwayNotificationCenterNotification* _tmp47_;
								SwayNotificationCenterNotification* _tmp48_;
								_tmp45_ = group;
								_tmp46_ = sway_notification_center_notification_group_get_latest_notification (_tmp45_);
								_tmp47_ = _g_object_ref0 (_tmp46_);
								noti = _tmp47_;
								_tmp48_ = noti;
								sway_notification_center_notification_click_alt_action (_tmp48_, (guint) i);
								_g_object_unref0 (noti);
								break;
							}
						}
					}
				}
				break;
			}
		}
	}
	result = TRUE;
	return result;
}

/**
         * Returns < 0 if row1 should be before row2, 0 if they are equal
         * and > 0 otherwise
         */
static gint
sway_notification_center_widgets_notifications_list_box_sort_func (SwayNotificationCenterWidgetsNotifications* self,
                                                                   GtkListBoxRow* row1,
                                                                   GtkListBoxRow* row2)
{
	gint _tmp0_ = 0;
	gint val = 0;
	SwayNotificationCenterNotificationGroup* a_group = NULL;
	SwayNotificationCenterNotificationGroup* _tmp1_;
	SwayNotificationCenterNotificationGroup* b_group = NULL;
	SwayNotificationCenterNotificationGroup* _tmp2_;
	gboolean a_urgency = FALSE;
	SwayNotificationCenterNotificationGroup* _tmp3_;
	gboolean b_urgency = FALSE;
	SwayNotificationCenterNotificationGroup* _tmp4_;
	gint64 a_time = 0LL;
	SwayNotificationCenterNotificationGroup* _tmp6_;
	gint64 b_time = 0LL;
	SwayNotificationCenterNotificationGroup* _tmp7_;
	gboolean _tmp8_ = FALSE;
	gint _tmp9_ = 0;
	gint result;
	g_return_val_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_NOTIFICATIONS (self), 0);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (row1, gtk_list_box_row_get_type ()), 0);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (row2, gtk_list_box_row_get_type ()), 0);
	if (self->priv->list_reverse) {
		_tmp0_ = 1;
	} else {
		_tmp0_ = -1;
	}
	val = _tmp0_;
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (row1, SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_GROUP, SwayNotificationCenterNotificationGroup));
	a_group = _tmp1_;
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (row2, SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_GROUP, SwayNotificationCenterNotificationGroup));
	b_group = _tmp2_;
	_tmp3_ = a_group;
	a_urgency = sway_notification_center_notification_group_get_is_urgent (_tmp3_);
	_tmp4_ = b_group;
	b_urgency = sway_notification_center_notification_group_get_is_urgent (_tmp4_);
	if (a_urgency != b_urgency) {
		gint _tmp5_ = 0;
		if (a_urgency) {
			_tmp5_ = val;
		} else {
			_tmp5_ = val * -1;
		}
		result = _tmp5_;
		_g_object_unref0 (b_group);
		_g_object_unref0 (a_group);
		return result;
	}
	_tmp6_ = a_group;
	a_time = sway_notification_center_notification_group_get_time (_tmp6_);
	_tmp7_ = b_group;
	b_time = sway_notification_center_notification_group_get_time (_tmp7_);
	if (a_time < ((gint64) 0)) {
		_tmp8_ = TRUE;
	} else {
		_tmp8_ = b_time < ((gint64) 0);
	}
	if (_tmp8_) {
		result = 0;
		_g_object_unref0 (b_group);
		_g_object_unref0 (a_group);
		return result;
	}
	if (a_time == b_time) {
		result = 0;
		_g_object_unref0 (b_group);
		_g_object_unref0 (a_group);
		return result;
	}
	if (a_time > b_time) {
		_tmp9_ = val;
	} else {
		_tmp9_ = val * -1;
	}
	result = _tmp9_;
	_g_object_unref0 (b_group);
	_g_object_unref0 (a_group);
	return result;
}

static void
__lambda92_ (SwayNotificationCenterWidgetsNotifications* self)
{
	SwayNotificationCenterNotificationGroup* _tmp0_;
	gfloat y = 0.0F;
	SwayNotificationCenterNotificationGroup* _tmp1_;
	GtkListBox* _tmp2_;
	self->priv->scroll_timer_id = (guint) 0;
	_tmp0_ = self->priv->_expanded_group;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->priv->_expanded_group;
	_tmp2_ = self->priv->list_box;
	y = sway_notification_center_notification_group_get_relative_y (_tmp1_, G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_widget_get_type (), GtkWidget));
	if (y > ((gfloat) 0)) {
		GtkViewport* _tmp3_;
		SwayNotificationCenterNotificationGroup* _tmp4_;
		_tmp3_ = self->priv->viewport;
		_tmp4_ = self->priv->_expanded_group;
		gtk_viewport_scroll_to (_tmp3_, G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_widget_get_type (), GtkWidget), NULL);
	}
}

static void
___lambda92__gsource_once_func (gpointer self)
{
	__lambda92_ ((SwayNotificationCenterWidgetsNotifications*) self);
}

static void
sway_notification_center_widgets_notifications_scroll_animate (SwayNotificationCenterWidgetsNotifications* self,
                                                               gdouble to)
{
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_NOTIFICATIONS (self));
	if (self->priv->scroll_timer_id > ((guint) 0)) {
		g_source_remove (self->priv->scroll_timer_id);
		self->priv->scroll_timer_id = (guint) 0;
	}
	self->priv->scroll_timer_id = g_timeout_add_once (CONSTANTS_ANIMATION_DURATION, ___lambda92__gsource_once_func, self);
}

static void
sway_notification_center_widgets_notifications_scroll_to_start (SwayNotificationCenterWidgetsNotifications* self)
{
	GtkScrollType scroll_type = 0;
	GtkScrolledWindow* _tmp0_;
	gboolean _tmp1_ = FALSE;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_NOTIFICATIONS (self));
	scroll_type = GTK_SCROLL_START;
	if (self->priv->list_reverse) {
		scroll_type = GTK_SCROLL_END;
	}
	_tmp0_ = self->priv->scrolled_window;
	g_signal_emit_by_name (_tmp0_, "scroll-child", scroll_type, FALSE, &_tmp1_);
}

static void
sway_notification_center_widgets_notifications_navigate_list (SwayNotificationCenterWidgetsNotifications* self,
                                                              gint i)
{
	guint _tmp0_;
	SwayNotificationCenterNotificationGroup* group = NULL;
	GtkListBox* _tmp1_;
	GtkListBoxRow* _tmp2_;
	SwayNotificationCenterNotificationGroup* _tmp3_;
	SwayNotificationCenterNotificationGroup* _tmp11_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_NOTIFICATIONS (self));
	_tmp0_ = self->priv->_n_groups;
	if (_tmp0_ == ((guint) 0)) {
		return;
	}
	_tmp1_ = self->priv->list_box;
	_tmp2_ = gtk_list_box_get_row_at_index (_tmp1_, i);
	group = G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_GROUP, SwayNotificationCenterNotificationGroup);
	_tmp3_ = group;
	if (_tmp3_ == NULL) {
		if (self->priv->list_reverse) {
			GtkListBox* _tmp4_;
			GtkListBoxRow* _tmp5_;
			_tmp4_ = self->priv->list_box;
			_tmp5_ = gtk_list_box_get_row_at_index (_tmp4_, 0);
			group = G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_GROUP, SwayNotificationCenterNotificationGroup);
		} else {
			gint len = 0;
			IterListBoxController* _tmp6_;
			gint _tmp7_;
			gint _tmp8_;
			GtkListBox* _tmp9_;
			GtkListBoxRow* _tmp10_;
			_tmp6_ = self->priv->list_box_controller;
			_tmp7_ = iter_list_box_controller_get_length (_tmp6_);
			_tmp8_ = _tmp7_;
			len = MAX (0, _tmp8_ - 1);
			_tmp9_ = self->priv->list_box;
			_tmp10_ = gtk_list_box_get_row_at_index (_tmp9_, len);
			group = G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_GROUP, SwayNotificationCenterNotificationGroup);
		}
	}
	_tmp11_ = group;
	if (_tmp11_ != NULL) {
		SwayNotificationCenterNotificationGroup* _tmp12_;
		gboolean _tmp13_;
		gboolean _tmp14_;
		SwayNotificationCenterNotificationGroup* _tmp30_;
		_tmp12_ = group;
		_tmp13_ = sway_notification_center_notification_group_get_dismissed (_tmp12_);
		_tmp14_ = _tmp13_;
		if (_tmp14_) {
			gboolean list_reverse = FALSE;
			SwayNotificationCenterNotificationGroup* sibling = NULL;
			SwayNotificationCenterNotificationGroup* _tmp15_;
			list_reverse = self->priv->list_reverse;
			_tmp15_ = group;
			sibling = _tmp15_;
			{
				gsize j = 0UL;
				j = (gsize) 0;
				{
					gboolean _tmp16_ = FALSE;
					_tmp16_ = TRUE;
					while (TRUE) {
						guint _tmp18_;
						GtkWidget* _tmp19_ = NULL;
						SwayNotificationCenterNotificationGroup* _tmp24_;
						SwayNotificationCenterNotificationGroup* _tmp26_;
						gboolean _tmp27_;
						gboolean _tmp28_;
						if (!_tmp16_) {
							gsize _tmp17_;
							_tmp17_ = j;
							j = _tmp17_ + 1;
						}
						_tmp16_ = FALSE;
						_tmp18_ = self->priv->_n_groups;
						if (!(j < ((gsize) _tmp18_))) {
							break;
						}
						if (list_reverse) {
							SwayNotificationCenterNotificationGroup* _tmp20_;
							GtkWidget* _tmp21_;
							_tmp20_ = sibling;
							_tmp21_ = gtk_widget_get_prev_sibling (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, gtk_widget_get_type (), GtkWidget));
							_tmp19_ = _tmp21_;
						} else {
							SwayNotificationCenterNotificationGroup* _tmp22_;
							GtkWidget* _tmp23_;
							_tmp22_ = sibling;
							_tmp23_ = gtk_widget_get_next_sibling (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, gtk_widget_get_type (), GtkWidget));
							_tmp19_ = _tmp23_;
						}
						sibling = G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_GROUP, SwayNotificationCenterNotificationGroup);
						_tmp24_ = sibling;
						if (_tmp24_ == NULL) {
							GtkListBox* _tmp25_;
							g_debug ("notifications.vala:441: Could not find a non-dismissed group to focus");
							_tmp25_ = self->priv->list_box;
							gtk_widget_grab_focus (G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, gtk_widget_get_type (), GtkWidget));
							return;
						}
						_tmp26_ = sibling;
						_tmp27_ = sway_notification_center_notification_group_get_dismissed (_tmp26_);
						_tmp28_ = _tmp27_;
						if (!_tmp28_) {
							SwayNotificationCenterNotificationGroup* _tmp29_;
							_tmp29_ = sibling;
							group = _tmp29_;
							break;
						}
					}
				}
			}
		}
		_tmp30_ = group;
		gtk_widget_grab_focus (G_TYPE_CHECK_INSTANCE_CAST (_tmp30_, gtk_widget_get_type (), GtkWidget));
	} else {
		GtkListBox* _tmp31_;
		_tmp31_ = self->priv->list_box;
		gtk_widget_grab_focus (G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, gtk_widget_get_type (), GtkWidget));
	}
}

static void
sway_notification_center_widgets_notifications_navigate_up (SwayNotificationCenterWidgetsNotifications* self,
                                                            gboolean fallback_other_dir,
                                                            SwayNotificationCenterNotificationGroup* focused_group)
{
	guint _tmp2_;
	GtkListBox* _tmp5_;
	GtkWidget* _tmp6_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_NOTIFICATIONS (self));
	g_return_if_fail ((focused_group == NULL) || SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION_GROUP (focused_group));
	if (focused_group == NULL) {
		GtkListBox* _tmp0_;
		GtkWidget* _tmp1_;
		_tmp0_ = self->priv->list_box;
		_tmp1_ = gtk_widget_get_focus_child (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_widget_get_type (), GtkWidget));
		focused_group = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_GROUP, SwayNotificationCenterNotificationGroup);
	}
	_tmp2_ = self->priv->_n_groups;
	if (_tmp2_ == ((guint) 0)) {
		return;
	} else {
		gboolean _tmp3_ = FALSE;
		if (!SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION_GROUP (focused_group)) {
			_tmp3_ = TRUE;
		} else {
			guint _tmp4_;
			_tmp4_ = self->priv->_n_groups;
			_tmp3_ = _tmp4_ == ((guint) 1);
		}
		if (_tmp3_) {
			sway_notification_center_widgets_notifications_navigate_to_first_notification (self);
			return;
		}
	}
	_tmp5_ = self->priv->list_box;
	_tmp6_ = gtk_widget_get_first_child (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_widget_get_type (), GtkWidget));
	if (_tmp6_ == G_TYPE_CHECK_INSTANCE_CAST (focused_group, gtk_widget_get_type (), GtkWidget)) {
		if (fallback_other_dir) {
			sway_notification_center_widgets_notifications_navigate_down (self, FALSE, focused_group);
		}
		return;
	}
	g_signal_emit_by_name (G_TYPE_CHECK_INSTANCE_CAST (focused_group, gtk_widget_get_type (), GtkWidget), "move-focus", GTK_DIR_TAB_BACKWARD);
}

static void
sway_notification_center_widgets_notifications_navigate_down (SwayNotificationCenterWidgetsNotifications* self,
                                                              gboolean fallback_other_dir,
                                                              SwayNotificationCenterNotificationGroup* focused_group)
{
	guint _tmp2_;
	GtkListBox* _tmp5_;
	GtkWidget* _tmp6_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_NOTIFICATIONS (self));
	g_return_if_fail ((focused_group == NULL) || SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION_GROUP (focused_group));
	if (focused_group == NULL) {
		GtkListBox* _tmp0_;
		GtkWidget* _tmp1_;
		_tmp0_ = self->priv->list_box;
		_tmp1_ = gtk_widget_get_focus_child (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_widget_get_type (), GtkWidget));
		focused_group = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_GROUP, SwayNotificationCenterNotificationGroup);
	}
	_tmp2_ = self->priv->_n_groups;
	if (_tmp2_ == ((guint) 0)) {
		return;
	} else {
		gboolean _tmp3_ = FALSE;
		if (!SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION_GROUP (focused_group)) {
			_tmp3_ = TRUE;
		} else {
			guint _tmp4_;
			_tmp4_ = self->priv->_n_groups;
			_tmp3_ = _tmp4_ == ((guint) 1);
		}
		if (_tmp3_) {
			sway_notification_center_widgets_notifications_navigate_to_first_notification (self);
			return;
		}
	}
	_tmp5_ = self->priv->list_box;
	_tmp6_ = gtk_widget_get_last_child (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_widget_get_type (), GtkWidget));
	if (_tmp6_ == G_TYPE_CHECK_INSTANCE_CAST (focused_group, gtk_widget_get_type (), GtkWidget)) {
		if (fallback_other_dir) {
			sway_notification_center_widgets_notifications_navigate_up (self, FALSE, focused_group);
		}
		return;
	}
	g_signal_emit_by_name (G_TYPE_CHECK_INSTANCE_CAST (focused_group, gtk_widget_get_type (), GtkWidget), "move-focus", GTK_DIR_TAB_FORWARD);
}

static void
sway_notification_center_widgets_notifications_navigate_to_first_notification (SwayNotificationCenterWidgetsNotifications* self)
{
	gint _tmp0_ = 0;
	gint i = 0;
	IterListBoxController* _tmp4_;
	gint _tmp5_;
	gint _tmp6_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_NOTIFICATIONS (self));
	if (self->priv->list_reverse) {
		IterListBoxController* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		_tmp1_ = self->priv->list_box_controller;
		_tmp2_ = iter_list_box_controller_get_length (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp0_ = _tmp3_ - 1;
	} else {
		_tmp0_ = 0;
	}
	_tmp4_ = self->priv->list_box_controller;
	_tmp5_ = iter_list_box_controller_get_length (_tmp4_);
	_tmp6_ = _tmp5_;
	i = CLAMP (_tmp0_, 0, _tmp6_);
	sway_notification_center_widgets_notifications_navigate_list (self, i);
}

static void
sway_notification_center_widgets_notifications_navigate_to_last_notification (SwayNotificationCenterWidgetsNotifications* self)
{
	gint _tmp0_ = 0;
	gint i = 0;
	IterListBoxController* _tmp4_;
	gint _tmp5_;
	gint _tmp6_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_NOTIFICATIONS (self));
	if (!self->priv->list_reverse) {
		IterListBoxController* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		_tmp1_ = self->priv->list_box_controller;
		_tmp2_ = iter_list_box_controller_get_length (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp0_ = _tmp3_ - 1;
	} else {
		_tmp0_ = 0;
	}
	_tmp4_ = self->priv->list_box_controller;
	_tmp5_ = iter_list_box_controller_get_length (_tmp4_);
	_tmp6_ = _tmp5_;
	i = CLAMP (_tmp0_, 0, _tmp6_);
	sway_notification_center_widgets_notifications_navigate_list (self, i);
}

static const gchar*
sway_notification_center_widgets_notifications_real_get_widget_name (SwayNotificationCenterWidgetsBaseWidget* base)
{
	const gchar* result;
	SwayNotificationCenterWidgetsNotifications* self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_NOTIFICATIONS, SwayNotificationCenterWidgetsNotifications);
	result = "notifications";
	return result;
}

guint
sway_notification_center_widgets_notifications_get_n_notifications (SwayNotificationCenterWidgetsNotifications* self)
{
	guint result;
	g_return_val_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_NOTIFICATIONS (self), 0U);
	result = self->priv->_n_notifications;
	return result;
}

static void
sway_notification_center_widgets_notifications_set_n_notifications (SwayNotificationCenterWidgetsNotifications* self,
                                                                    guint value)
{
	guint old_value;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_NOTIFICATIONS (self));
	old_value = sway_notification_center_widgets_notifications_get_n_notifications (self);
	if (old_value != value) {
		self->priv->_n_notifications = value;
		g_object_notify_by_pspec ((GObject *) self, sway_notification_center_widgets_notifications_properties[SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS_N_NOTIFICATIONS_PROPERTY]);
	}
}

guint
sway_notification_center_widgets_notifications_get_n_groups (SwayNotificationCenterWidgetsNotifications* self)
{
	guint result;
	g_return_val_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_NOTIFICATIONS (self), 0U);
	result = self->priv->_n_groups;
	return result;
}

static void
sway_notification_center_widgets_notifications_set_n_groups (SwayNotificationCenterWidgetsNotifications* self,
                                                             guint value)
{
	guint old_value;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_NOTIFICATIONS (self));
	old_value = sway_notification_center_widgets_notifications_get_n_groups (self);
	if (old_value != value) {
		self->priv->_n_groups = value;
		g_object_notify_by_pspec ((GObject *) self, sway_notification_center_widgets_notifications_properties[SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS_N_GROUPS_PROPERTY]);
	}
}

SwayNotificationCenterNotificationGroup*
sway_notification_center_widgets_notifications_get_expanded_group (SwayNotificationCenterWidgetsNotifications* self)
{
	SwayNotificationCenterNotificationGroup* result;
	SwayNotificationCenterNotificationGroup* _tmp0_;
	g_return_val_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_NOTIFICATIONS (self), NULL);
	_tmp0_ = self->priv->_expanded_group;
	result = _tmp0_;
	return result;
}

static void
sway_notification_center_widgets_notifications_set_expanded_group (SwayNotificationCenterWidgetsNotifications* self,
                                                                   SwayNotificationCenterNotificationGroup* value)
{
	SwayNotificationCenterNotificationGroup* old_value;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_NOTIFICATIONS (self));
	old_value = sway_notification_center_widgets_notifications_get_expanded_group (self);
	if (old_value != value) {
		self->priv->_expanded_group = value;
		g_object_notify_by_pspec ((GObject *) self, sway_notification_center_widgets_notifications_properties[SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS_EXPANDED_GROUP_PROPERTY]);
	}
}

static void
sway_notification_center_widgets_notifications_class_init (SwayNotificationCenterWidgetsNotificationsClass * klass,
                                                           gpointer klass_data)
{
	sway_notification_center_widgets_notifications_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SwayNotificationCenterWidgetsNotifications_private_offset);
	((SwayNotificationCenterWidgetsBaseWidgetClass *) klass)->on_cc_visibility_change = (void (*) (SwayNotificationCenterWidgetsBaseWidget*, gboolean)) sway_notification_center_widgets_notifications_real_on_cc_visibility_change;
	SWAY_NOTIFICATION_CENTER_WIDGETS_BASE_WIDGET_CLASS (klass)->get_widget_name = (const gchar* (*) (SwayNotificationCenterWidgetsBaseWidget*)) sway_notification_center_widgets_notifications_real_get_widget_name;
	G_OBJECT_CLASS (klass)->get_property = _vala_sway_notification_center_widgets_notifications_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_sway_notification_center_widgets_notifications_set_property;
	G_OBJECT_CLASS (klass)->finalize = sway_notification_center_widgets_notifications_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS_WIDGET_NAME_PROPERTY, sway_notification_center_widgets_notifications_properties[SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS_WIDGET_NAME_PROPERTY] = g_param_spec_string ("widget-name", "widget-name", "widget-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS_N_NOTIFICATIONS_PROPERTY, sway_notification_center_widgets_notifications_properties[SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS_N_NOTIFICATIONS_PROPERTY] = g_param_spec_uint ("n-notifications", "n-notifications", "n-notifications", 0, G_MAXUINT, (guint) 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS_N_GROUPS_PROPERTY, sway_notification_center_widgets_notifications_properties[SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS_N_GROUPS_PROPERTY] = g_param_spec_uint ("n-groups", "n-groups", "n-groups", 0, G_MAXUINT, (guint) 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS_EXPANDED_GROUP_PROPERTY, sway_notification_center_widgets_notifications_properties[SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS_EXPANDED_GROUP_PROPERTY] = g_param_spec_object ("expanded-group", "expanded-group", "expanded-group", SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_GROUP, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/erikreider/swaync/ui/notifications_widget.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "text_empty_label", FALSE, SwayNotificationCenterWidgetsNotifications_private_offset + G_STRUCT_OFFSET (SwayNotificationCenterWidgetsNotificationsPrivate, text_empty_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "stack", FALSE, SwayNotificationCenterWidgetsNotifications_private_offset + G_STRUCT_OFFSET (SwayNotificationCenterWidgetsNotificationsPrivate, stack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "scrolled_window", FALSE, SwayNotificationCenterWidgetsNotifications_private_offset + G_STRUCT_OFFSET (SwayNotificationCenterWidgetsNotificationsPrivate, scrolled_window));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "viewport", FALSE, SwayNotificationCenterWidgetsNotifications_private_offset + G_STRUCT_OFFSET (SwayNotificationCenterWidgetsNotificationsPrivate, viewport));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "list_box", FALSE, SwayNotificationCenterWidgetsNotifications_private_offset + G_STRUCT_OFFSET (SwayNotificationCenterWidgetsNotificationsPrivate, list_box));
}

static void
sway_notification_center_widgets_notifications_instance_init (SwayNotificationCenterWidgetsNotifications * self,
                                                              gpointer klass)
{
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	self->priv = sway_notification_center_widgets_notifications_get_instance_private (self);
	self->priv->_n_notifications = (guint) 0;
	self->priv->_n_groups = (guint) 0;
	self->priv->_expanded_group = NULL;
	self->priv->scroll_timer_id = (guint) 0;
	_tmp0_ = gee_hash_map_new (G_TYPE_UINT, NULL, NULL, SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_GROUP, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	if (_tmp0_) {
		g_object_set_data ((GObject *) _tmp0_, "vala-creation-function", "");
	}
	self->priv->noti_groups_id = _tmp0_;
	_tmp1_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_GROUP, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	if (_tmp1_) {
		g_object_set_data ((GObject *) _tmp1_, "vala-creation-function", "");
	}
	self->priv->noti_groups_name = _tmp1_;
	self->priv->list_reverse = FALSE;
	self->priv->vertical_expand = TRUE;
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
sway_notification_center_widgets_notifications_finalize (GObject * obj)
{
	SwayNotificationCenterWidgetsNotifications * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_NOTIFICATIONS, SwayNotificationCenterWidgetsNotifications);
	_g_object_unref0 (self->priv->list_box_controller);
	_g_object_unref0 (self->priv->noti_groups_id);
	_g_object_unref0 (self->priv->noti_groups_name);
	G_OBJECT_CLASS (sway_notification_center_widgets_notifications_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
sway_notification_center_widgets_notifications_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SwayNotificationCenterWidgetsNotificationsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) sway_notification_center_widgets_notifications_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SwayNotificationCenterWidgetsNotifications), 0, (GInstanceInitFunc) sway_notification_center_widgets_notifications_instance_init, NULL };
	GType sway_notification_center_widgets_notifications_type_id;
	sway_notification_center_widgets_notifications_type_id = g_type_register_static (SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_BASE_WIDGET, "SwayNotificationCenterWidgetsNotifications", &g_define_type_info, 0);
	SwayNotificationCenterWidgetsNotifications_private_offset = g_type_add_instance_private (sway_notification_center_widgets_notifications_type_id, sizeof (SwayNotificationCenterWidgetsNotificationsPrivate));
	return sway_notification_center_widgets_notifications_type_id;
}

GType
sway_notification_center_widgets_notifications_get_type (void)
{
	static gsize sway_notification_center_widgets_notifications_type_id__once = 0;
	if (g_once_init_enter (&sway_notification_center_widgets_notifications_type_id__once)) {
		GType sway_notification_center_widgets_notifications_type_id;
		sway_notification_center_widgets_notifications_type_id = sway_notification_center_widgets_notifications_get_type_once ();
		g_once_init_leave (&sway_notification_center_widgets_notifications_type_id__once, sway_notification_center_widgets_notifications_type_id);
	}
	return sway_notification_center_widgets_notifications_type_id__once;
}

static void
_vala_sway_notification_center_widgets_notifications_get_property (GObject * object,
                                                                   guint property_id,
                                                                   GValue * value,
                                                                   GParamSpec * pspec)
{
	SwayNotificationCenterWidgetsNotifications * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_NOTIFICATIONS, SwayNotificationCenterWidgetsNotifications);
	switch (property_id) {
		case SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS_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;
		case SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS_N_NOTIFICATIONS_PROPERTY:
		g_value_set_uint (value, sway_notification_center_widgets_notifications_get_n_notifications (self));
		break;
		case SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS_N_GROUPS_PROPERTY:
		g_value_set_uint (value, sway_notification_center_widgets_notifications_get_n_groups (self));
		break;
		case SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS_EXPANDED_GROUP_PROPERTY:
		g_value_set_object (value, sway_notification_center_widgets_notifications_get_expanded_group (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_sway_notification_center_widgets_notifications_set_property (GObject * object,
                                                                   guint property_id,
                                                                   const GValue * value,
                                                                   GParamSpec * pspec)
{
	SwayNotificationCenterWidgetsNotifications * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_NOTIFICATIONS, SwayNotificationCenterWidgetsNotifications);
	switch (property_id) {
		case SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS_N_NOTIFICATIONS_PROPERTY:
		sway_notification_center_widgets_notifications_set_n_notifications (self, g_value_get_uint (value));
		break;
		case SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS_N_GROUPS_PROPERTY:
		sway_notification_center_widgets_notifications_set_n_groups (self, g_value_get_uint (value));
		break;
		case SWAY_NOTIFICATION_CENTER_WIDGETS_NOTIFICATIONS_EXPANDED_GROUP_PROPERTY:
		sway_notification_center_widgets_notifications_set_expanded_group (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

