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

#include <gtk/gtk.h>
#include <glib-object.h>
#include <gee.h>
#include <glib.h>
#include <adwaita.h>
#include <stdlib.h>
#include <string.h>
#include <gtk4-layer-shell.h>
#include <stdio.h>
#include <gdk/gdk.h>
#include <float.h>
#include <math.h>
#include <graphene-gobject.h>
#include <cairo-gobject.h>
#include <gio/gio.h>

#define SWAY_NOTIFICATION_CENTER_NOTIFICATION_WINDOW_MAX_HEIGHT 600
#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_TYPE_NOTIFICATION_WINDOW (sway_notification_center_notification_window_get_type ())
#define SWAY_NOTIFICATION_CENTER_NOTIFICATION_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_WINDOW, SwayNotificationCenterNotificationWindow))
#define SWAY_NOTIFICATION_CENTER_NOTIFICATION_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_WINDOW, SwayNotificationCenterNotificationWindowClass))
#define SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_WINDOW))
#define SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_WINDOW))
#define SWAY_NOTIFICATION_CENTER_NOTIFICATION_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_WINDOW, SwayNotificationCenterNotificationWindowClass))

typedef struct _SwayNotificationCenterNotificationWindow SwayNotificationCenterNotificationWindow;
typedef struct _SwayNotificationCenterNotificationWindowClass SwayNotificationCenterNotificationWindowClass;
typedef struct _SwayNotificationCenterNotificationWindowPrivate SwayNotificationCenterNotificationWindowPrivate;

#define TYPE_ANIMATED_LIST (animated_list_get_type ())
#define ANIMATED_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ANIMATED_LIST, AnimatedList))
#define ANIMATED_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ANIMATED_LIST, AnimatedListClass))
#define IS_ANIMATED_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ANIMATED_LIST))
#define IS_ANIMATED_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ANIMATED_LIST))
#define ANIMATED_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ANIMATED_LIST, AnimatedListClass))

typedef struct _AnimatedList AnimatedList;
typedef struct _AnimatedListClass AnimatedListClass;

#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;
enum  {
	SWAY_NOTIFICATION_CENTER_NOTIFICATION_WINDOW_0_PROPERTY,
	SWAY_NOTIFICATION_CENTER_NOTIFICATION_WINDOW_NUM_PROPERTIES
};
static GParamSpec* sway_notification_center_notification_window_properties[SWAY_NOTIFICATION_CENTER_NOTIFICATION_WINDOW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define SWAY_NOTIFICATION_CENTER_TYPE_SWAYNC (sway_notification_center_swaync_get_type ())
#define SWAY_NOTIFICATION_CENTER_SWAYNC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWAY_NOTIFICATION_CENTER_TYPE_SWAYNC, SwayNotificationCenterSwaync))
#define SWAY_NOTIFICATION_CENTER_SWAYNC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWAY_NOTIFICATION_CENTER_TYPE_SWAYNC, SwayNotificationCenterSwayncClass))
#define SWAY_NOTIFICATION_CENTER_IS_SWAYNC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWAY_NOTIFICATION_CENTER_TYPE_SWAYNC))
#define SWAY_NOTIFICATION_CENTER_IS_SWAYNC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWAY_NOTIFICATION_CENTER_TYPE_SWAYNC))
#define SWAY_NOTIFICATION_CENTER_SWAYNC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWAY_NOTIFICATION_CENTER_TYPE_SWAYNC, SwayNotificationCenterSwayncClass))

typedef struct _SwayNotificationCenterSwaync SwayNotificationCenterSwaync;
typedef struct _SwayNotificationCenterSwayncClass SwayNotificationCenterSwayncClass;
typedef struct _SwayNotificationCenterSwayncPrivate SwayNotificationCenterSwayncPrivate;

#define TYPE_XDG_ACTIVATION_HELPER (xdg_activation_helper_get_type ())
#define XDG_ACTIVATION_HELPER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_XDG_ACTIVATION_HELPER, XdgActivationHelper))
#define XDG_ACTIVATION_HELPER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_XDG_ACTIVATION_HELPER, XdgActivationHelperClass))
#define IS_XDG_ACTIVATION_HELPER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_XDG_ACTIVATION_HELPER))
#define IS_XDG_ACTIVATION_HELPER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_XDG_ACTIVATION_HELPER))
#define XDG_ACTIVATION_HELPER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_XDG_ACTIVATION_HELPER, XdgActivationHelperClass))

typedef struct _XdgActivationHelper XdgActivationHelper;
typedef struct _XdgActivationHelperClass XdgActivationHelperClass;
typedef struct _Block7Data Block7Data;
#define _g_free0(var) (var = (g_free (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;
typedef enum  {
	SWAY_NOTIFICATION_CENTER_LAYER_BACKGROUND,
	SWAY_NOTIFICATION_CENTER_LAYER_BOTTOM,
	SWAY_NOTIFICATION_CENTER_LAYER_TOP,
	SWAY_NOTIFICATION_CENTER_LAYER_OVERLAY
} SwayNotificationCenterLayer;

#define SWAY_NOTIFICATION_CENTER_TYPE_LAYER (sway_notification_center_layer_get_type ())
typedef enum  {
	SWAY_NOTIFICATION_CENTER_POSITION_X_RIGHT,
	SWAY_NOTIFICATION_CENTER_POSITION_X_LEFT,
	SWAY_NOTIFICATION_CENTER_POSITION_X_CENTER,
	SWAY_NOTIFICATION_CENTER_POSITION_X_NONE
} SwayNotificationCenterPositionX;

#define SWAY_NOTIFICATION_CENTER_TYPE_POSITION_X (sway_notification_center_position_x_get_type ())
typedef enum  {
	SWAY_NOTIFICATION_CENTER_POSITION_Y_TOP,
	SWAY_NOTIFICATION_CENTER_POSITION_Y_BOTTOM,
	SWAY_NOTIFICATION_CENTER_POSITION_Y_CENTER,
	SWAY_NOTIFICATION_CENTER_POSITION_Y_NONE
} SwayNotificationCenterPositionY;

#define SWAY_NOTIFICATION_CENTER_TYPE_POSITION_Y (sway_notification_center_position_y_get_type ())
typedef enum  {
	ANIMATED_LIST_ITEM_REVEAL_ANIMATION_TYPE_NONE,
	ANIMATED_LIST_ITEM_REVEAL_ANIMATION_TYPE_SLIDE,
	ANIMATED_LIST_ITEM_REVEAL_ANIMATION_TYPE_SLIDE_WITH
} AnimatedListItemRevealAnimationType;

#define ANIMATED_LIST_ITEM_TYPE_REVEAL_ANIMATION_TYPE (animated_list_item_reveal_animation_type_get_type ())
typedef enum  {
	ANIMATED_LIST_ITEM_CHILD_ANIMATION_TYPE_NONE,
	ANIMATED_LIST_ITEM_CHILD_ANIMATION_TYPE_SLIDE_FROM_LEFT,
	ANIMATED_LIST_ITEM_CHILD_ANIMATION_TYPE_SLIDE_FROM_RIGHT
} AnimatedListItemChildAnimationType;

#define ANIMATED_LIST_ITEM_TYPE_CHILD_ANIMATION_TYPE (animated_list_item_child_animation_type_get_type ())
typedef enum  {
	ANIMATED_LIST_DIRECTION_TOP_TO_BOTTOM,
	ANIMATED_LIST_DIRECTION_BOTTOM_TO_TOP
} AnimatedListDirection;

#define TYPE_ANIMATED_LIST_DIRECTION (animated_list_direction_get_type ())

#define TYPE_ANIMATED_LIST_ITEM (animated_list_item_get_type ())
#define ANIMATED_LIST_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ANIMATED_LIST_ITEM, AnimatedListItem))
#define ANIMATED_LIST_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ANIMATED_LIST_ITEM, AnimatedListItemClass))
#define IS_ANIMATED_LIST_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ANIMATED_LIST_ITEM))
#define IS_ANIMATED_LIST_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ANIMATED_LIST_ITEM))
#define ANIMATED_LIST_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ANIMATED_LIST_ITEM, AnimatedListItemClass))

typedef struct _AnimatedListItem AnimatedListItem;
typedef struct _AnimatedListItemClass AnimatedListItemClass;
#define _cairo_region_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_region_destroy (var), NULL)))

#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 gboolean (*SwayNotificationCenternotification_filter_func) (SwayNotificationCenterNotification* notification, gpointer user_data);
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 ())

struct _SwayNotificationCenterNotificationWindow {
	GtkApplicationWindow parent_instance;
	SwayNotificationCenterNotificationWindowPrivate * priv;
};

struct _SwayNotificationCenterNotificationWindowClass {
	GtkApplicationWindowClass parent_class;
};

struct _SwayNotificationCenterNotificationWindowPrivate {
	GtkScrolledWindow* scrolled_window;
	AnimatedList* list;
	GeeHashSet* inline_reply_notifications;
	GeeHashMap* notification_ids;
};

struct _SwayNotificationCenterSwaync {
	GtkApplication parent_instance;
	SwayNotificationCenterSwayncPrivate * priv;
	gboolean use_layer_shell;
	gboolean has_layer_on_demand;
	XdgActivationHelper* xdg_activation;
};

struct _SwayNotificationCenterSwayncClass {
	GtkApplicationClass parent_class;
};

struct _Block7Data {
	int _ref_count_;
	SwayNotificationCenterNotificationWindow* self;
	GdkSurface* surface;
	gulong id;
};

static gint SwayNotificationCenterNotificationWindow_private_offset;
static gpointer sway_notification_center_notification_window_parent_class = NULL;
static gchar* sway_notification_center_notification_window_monitor_name;
static gchar* sway_notification_center_notification_window_monitor_name = NULL;
VALA_EXTERN SwayNotificationCenterSwaync* sway_notification_center_app;

VALA_EXTERN GType sway_notification_center_notification_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SwayNotificationCenterNotificationWindow, g_object_unref)
VALA_EXTERN GType animated_list_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AnimatedList, g_object_unref)
VALA_EXTERN GType sway_notification_center_notification_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SwayNotificationCenterNotification, g_object_unref)
VALA_EXTERN SwayNotificationCenterNotificationWindow* sway_notification_center_notification_window_new (void);
VALA_EXTERN SwayNotificationCenterNotificationWindow* sway_notification_center_notification_window_construct (GType object_type);
VALA_EXTERN GType sway_notification_center_swaync_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SwayNotificationCenterSwaync, g_object_unref)
VALA_EXTERN GType xdg_activation_helper_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (XdgActivationHelper, g_object_unref)
static void sway_notification_center_notification_window_set_anchor (SwayNotificationCenterNotificationWindow* self);
static void __lambda119_ (SwayNotificationCenterNotificationWindow* self);
static Block7Data* block7_data_ref (Block7Data* _data7_);
static void block7_data_unref (void * _userdata_);
static void __lambda120_ (Block7Data* _data7_,
                   GdkMonitor* monitor);
VALA_EXTERN gchar* sway_notification_center_functions_monitor_to_string (GdkMonitor* monitor);
static void __lambda121_ (SwayNotificationCenterNotificationWindow* self);
static inline void sway_notification_center_notification_window_set_keyboard_mode (SwayNotificationCenterNotificationWindow* self);
static void ___lambda121__gsource_once_func (gpointer self);
static void ___lambda120__gdk_surface_enter_monitor (GdkSurface* _sender,
                                              GdkMonitor* monitor,
                                              gpointer self);
static void ___lambda119__gtk_widget_map (GtkWidget* _sender,
                                   gpointer self);
static void __lambda122_ (SwayNotificationCenterNotificationWindow* self);
static void ___lambda122__gtk_widget_unmap (GtkWidget* _sender,
                                     gpointer self);
VALA_EXTERN void animated_list_set_use_card_animation (AnimatedList* self,
                                           gboolean value);
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 gint sway_notification_center_config_model_get_notification_window_width (SwayNotificationCenterConfigModel* self);
static void __lambda123_ (SwayNotificationCenterNotificationWindow* self,
                   SwayNotificationCenterConfigModel* old,
                   SwayNotificationCenterConfigModel* config);
VALA_EXTERN const gchar* sway_notification_center_config_model_get_notification_window_preferred_output (SwayNotificationCenterConfigModel* self);
static void ___lambda123__sway_notification_center_swaync_config_reload (SwayNotificationCenterSwaync* _sender,
                                                                  SwayNotificationCenterConfigModel* old_config,
                                                                  SwayNotificationCenterConfigModel* new_config,
                                                                  gpointer self);
static void sway_notification_center_notification_window_real_size_allocate (GtkWidget* base,
                                                                      gint w,
                                                                      gint h,
                                                                      gint baseline);
static void sway_notification_center_notification_window_set_input_region (SwayNotificationCenterNotificationWindow* self);
static void sway_notification_center_notification_window_real_snapshot (GtkWidget* base,
                                                                 GtkSnapshot* snapshot);
VALA_EXTERN GType sway_notification_center_layer_get_type (void) G_GNUC_CONST ;
VALA_EXTERN SwayNotificationCenterLayer sway_notification_center_config_model_get_layer (SwayNotificationCenterConfigModel* self);
VALA_EXTERN GtkLayerShellLayer sway_notification_center_layer_to_layer (SwayNotificationCenterLayer self);
VALA_EXTERN GType sway_notification_center_position_x_get_type (void) G_GNUC_CONST ;
VALA_EXTERN SwayNotificationCenterPositionX sway_notification_center_config_model_get_positionX (SwayNotificationCenterConfigModel* self);
VALA_EXTERN GType sway_notification_center_position_y_get_type (void) G_GNUC_CONST ;
VALA_EXTERN SwayNotificationCenterPositionY sway_notification_center_config_model_get_positionY (SwayNotificationCenterConfigModel* self);
VALA_EXTERN void sway_notification_center_notification_window_set_monitor (SwayNotificationCenterNotificationWindow* self,
                                                               GdkMonitor* monitor);
VALA_EXTERN GdkMonitor* sway_notification_center_functions_try_get_monitor (const gchar* name);
VALA_EXTERN GType animated_list_item_reveal_animation_type_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void animated_list_set_animation_add_reveal_type (AnimatedList* self,
                                                  AnimatedListItemRevealAnimationType value);
VALA_EXTERN void animated_list_set_animation_remove_reveal_type (AnimatedList* self,
                                                     AnimatedListItemRevealAnimationType value);
VALA_EXTERN GType animated_list_item_child_animation_type_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void animated_list_set_animation_remove_child_type (AnimatedList* self,
                                                    AnimatedListItemChildAnimationType value);
VALA_EXTERN void animated_list_set_animation_add_child_type (AnimatedList* self,
                                                 AnimatedListItemChildAnimationType value);
VALA_EXTERN GType animated_list_direction_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void animated_list_set_direction (AnimatedList* self,
                                  AnimatedListDirection value);
VALA_EXTERN gint sway_notification_center_config_model_get_notification_window_height (SwayNotificationCenterConfigModel* self);
VALA_EXTERN GType animated_list_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AnimatedListItem, g_object_unref)
VALA_EXTERN GList* animated_list_get_visible_children (AnimatedList* self);
VALA_EXTERN gboolean animated_list_item_get_destroying (AnimatedListItem* self);
static inline SwayNotificationCenterNotification* sway_notification_center_notification_window_find_notification (SwayNotificationCenterNotificationWindow* self,
                                                                                                    guint32 id);
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 SwayNotificationCenterNotifyParams* sway_notification_center_notification_get_param (SwayNotificationCenterNotification* self);
VALA_EXTERN guint32 sway_notification_center_notify_params_get_applied_id (SwayNotificationCenterNotifyParams* self);
VALA_EXTERN void sway_notification_center_notification_window_remove_all_notifications (SwayNotificationCenterNotificationWindow* self,
                                                                            gboolean transition,
                                                                            SwayNotificationCenternotification_filter_func filter_func,
                                                                            gpointer filter_func_target);
VALA_EXTERN GList* animated_list_get_children (AnimatedList* self);
VALA_EXTERN GtkWidget* animated_list_item_get_child (AnimatedListItem* self);
static void sway_notification_center_notification_window_remove_notification_internal (SwayNotificationCenterNotificationWindow* self,
                                                                                SwayNotificationCenterNotification* notification,
                                                                                gboolean transition);
VALA_EXTERN gboolean sway_notification_center_notification_get_has_inline_reply (SwayNotificationCenterNotification* self);
VALA_EXTERN void sway_notification_center_notification_remove_noti_timeout (SwayNotificationCenterNotification* self);
VALA_EXTERN void animated_list_remove (AnimatedList* self,
                           GtkWidget* widget,
                           gboolean transition,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_);
VALA_EXTERN gboolean animated_list_remove_finish (AnimatedList* self,
                                      GAsyncResult* _res_);
static void __lambda22_ (SwayNotificationCenterNotificationWindow* self,
                  GObject* obj,
                  GAsyncResult* res);
VALA_EXTERN gboolean animated_list_is_empty (AnimatedList* self);
static void ___lambda22__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
VALA_EXTERN void sway_notification_center_notification_window_add_notification (SwayNotificationCenterNotificationWindow* self,
                                                                    SwayNotificationCenterNotifyParams* param);
VALA_EXTERN GType sway_notification_center_notification_type_get_type (void) G_GNUC_CONST ;
VALA_EXTERN gint sway_notification_center_config_model_get_timeout (SwayNotificationCenterConfigModel* self);
VALA_EXTERN gint sway_notification_center_config_model_get_timeout_low (SwayNotificationCenterConfigModel* self);
VALA_EXTERN gint sway_notification_center_config_model_get_timeout_critical (SwayNotificationCenterConfigModel* self);
VALA_EXTERN SwayNotificationCenterNotification* sway_notification_center_notification_new_timed (SwayNotificationCenterNotifyParams* param,
                                                                                     SwayNotificationCenterNotificationType notification_type,
                                                                                     guint timeout,
                                                                                     guint timeout_low,
                                                                                     guint timeout_critical);
VALA_EXTERN SwayNotificationCenterNotification* sway_notification_center_notification_construct_timed (GType object_type,
                                                                                           SwayNotificationCenterNotifyParams* param,
                                                                                           SwayNotificationCenterNotificationType notification_type,
                                                                                           guint timeout,
                                                                                           guint timeout_low,
                                                                                           guint timeout_critical);
VALA_EXTERN void animated_list_append (AnimatedList* self,
                           GtkWidget* widget,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_);
VALA_EXTERN AnimatedListItem* animated_list_append_finish (AnimatedList* self,
                                               GAsyncResult* _res_);
VALA_EXTERN void sway_notification_center_notification_window_remove_notification (SwayNotificationCenterNotificationWindow* self,
                                                                       guint32 id);
VALA_EXTERN void sway_notification_center_notification_window_replace_notification (SwayNotificationCenterNotificationWindow* self,
                                                                        guint32 id,
                                                                        SwayNotificationCenterNotifyParams* new_params);
VALA_EXTERN void sway_notification_center_notification_replace_notification (SwayNotificationCenterNotification* self,
                                                                 SwayNotificationCenterNotifyParams* new_params);
VALA_EXTERN gboolean animated_list_move_to_beginning (AnimatedList* self,
                                          GtkWidget* widget,
                                          gboolean scroll_to);
VALA_EXTERN SwayNotificationCenterNotifyParams* sway_notification_center_notification_window_get_latest_notification (SwayNotificationCenterNotificationWindow* self);
VALA_EXTERN AnimatedListItem* animated_list_get_first_item (AnimatedList* self);
VALA_EXTERN void sway_notification_center_notification_window_latest_notification_action (SwayNotificationCenterNotificationWindow* self,
                                                                              guint32 action);
VALA_EXTERN void sway_notification_center_notification_click_alt_action (SwayNotificationCenterNotification* self,
                                                             guint index);
static void sway_notification_center_notification_window_finalize (GObject * obj);
static GType sway_notification_center_notification_window_get_type_once (void);

static inline gpointer
sway_notification_center_notification_window_get_instance_private (SwayNotificationCenterNotificationWindow* self)
{
	return G_STRUCT_MEMBER_P (self, SwayNotificationCenterNotificationWindow_private_offset);
}

static Block7Data*
block7_data_ref (Block7Data* _data7_)
{
	g_atomic_int_inc (&_data7_->_ref_count_);
	return _data7_;
}

static void
block7_data_unref (void * _userdata_)
{
	Block7Data* _data7_;
	_data7_ = (Block7Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data7_->_ref_count_)) {
		SwayNotificationCenterNotificationWindow* self;
		self = _data7_->self;
		_g_object_unref0 (self);
		g_slice_free (Block7Data, _data7_);
	}
}

static void
__lambda121_ (SwayNotificationCenterNotificationWindow* self)
{
	sway_notification_center_notification_window_set_keyboard_mode (self);
}

static void
___lambda121__gsource_once_func (gpointer self)
{
	__lambda121_ ((SwayNotificationCenterNotificationWindow*) self);
}

static void
__lambda120_ (Block7Data* _data7_,
              GdkMonitor* monitor)
{
	SwayNotificationCenterNotificationWindow* self;
	GdkSurface* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	self = _data7_->self;
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (monitor, gdk_monitor_get_type ()));
	_tmp0_ = _data7_->surface;
	g_signal_handler_disconnect (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, G_TYPE_OBJECT, GObject), _data7_->id);
	_tmp1_ = sway_notification_center_functions_monitor_to_string (monitor);
	_tmp2_ = _tmp1_;
	g_debug ("notificationWindow.vala:43: NotificationWindow mapped on monitor: %s", _tmp2_);
	_g_free0 (_tmp2_);
	g_idle_add_once (___lambda121__gsource_once_func, self);
}

static void
___lambda120__gdk_surface_enter_monitor (GdkSurface* _sender,
                                         GdkMonitor* monitor,
                                         gpointer self)
{
	__lambda120_ (self, monitor);
}

static void
__lambda119_ (SwayNotificationCenterNotificationWindow* self)
{
	Block7Data* _data7_;
	GdkSurface* _tmp0_;
	GdkSurface* _tmp1_;
	GdkSurface* _tmp2_;
	gulong _tmp3_;
	_data7_ = g_slice_new0 (Block7Data);
	_data7_->_ref_count_ = 1;
	_data7_->self = g_object_ref (self);
	sway_notification_center_notification_window_set_anchor (self);
	_tmp0_ = gtk_native_get_surface (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_native_get_type (), GtkNative));
	_data7_->surface = _tmp0_;
	_tmp1_ = _data7_->surface;
	if (!G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, gdk_surface_get_type ())) {
		g_warn_if_reached ();
		block7_data_unref (_data7_);
		_data7_ = NULL;
		return;
	}
	_data7_->id = (gulong) 0;
	_tmp2_ = _data7_->surface;
	_tmp3_ = g_signal_connect_data (_tmp2_, "enter-monitor", (GCallback) ___lambda120__gdk_surface_enter_monitor, block7_data_ref (_data7_), (GClosureNotify) block7_data_unref, 0);
	_data7_->id = _tmp3_;
	block7_data_unref (_data7_);
	_data7_ = NULL;
}

static void
___lambda119__gtk_widget_map (GtkWidget* _sender,
                              gpointer self)
{
	__lambda119_ ((SwayNotificationCenterNotificationWindow*) self);
}

static void
__lambda122_ (SwayNotificationCenterNotificationWindow* self)
{
	sway_notification_center_notification_window_set_keyboard_mode (self);
	g_debug ("notificationWindow.vala:52: NotificationWindow un-mapped");
}

static void
___lambda122__gtk_widget_unmap (GtkWidget* _sender,
                                gpointer self)
{
	__lambda122_ ((SwayNotificationCenterNotificationWindow*) self);
}

static void
__lambda123_ (SwayNotificationCenterNotificationWindow* self,
              SwayNotificationCenterConfigModel* old,
              SwayNotificationCenterConfigModel* config)
{
	gchar* monitor_name = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gboolean _tmp3_ = FALSE;
	gboolean _tmp4_ = FALSE;
	g_return_if_fail ((old == NULL) || SWAY_NOTIFICATION_CENTER_IS_CONFIG_MODEL (old));
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_CONFIG_MODEL (config));
	_tmp0_ = sway_notification_center_config_model_get_notification_window_preferred_output (config);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_strdup (_tmp1_);
	monitor_name = _tmp2_;
	if (old == NULL) {
		_tmp4_ = TRUE;
	} else {
		const gchar* _tmp5_;
		const gchar* _tmp6_;
		const gchar* _tmp7_;
		_tmp5_ = sway_notification_center_config_model_get_notification_window_preferred_output (old);
		_tmp6_ = _tmp5_;
		_tmp7_ = monitor_name;
		_tmp4_ = g_strcmp0 (_tmp6_, _tmp7_) != 0;
	}
	if (_tmp4_) {
		_tmp3_ = TRUE;
	} else {
		const gchar* _tmp8_;
		const gchar* _tmp9_;
		_tmp8_ = sway_notification_center_notification_window_monitor_name;
		_tmp9_ = monitor_name;
		_tmp3_ = g_strcmp0 (_tmp8_, _tmp9_) != 0;
	}
	if (_tmp3_) {
		_g_free0 (sway_notification_center_notification_window_monitor_name);
		sway_notification_center_notification_window_monitor_name = NULL;
		sway_notification_center_notification_window_set_anchor (self);
	}
	_g_free0 (monitor_name);
}

static void
___lambda123__sway_notification_center_swaync_config_reload (SwayNotificationCenterSwaync* _sender,
                                                             SwayNotificationCenterConfigModel* old_config,
                                                             SwayNotificationCenterConfigModel* new_config,
                                                             gpointer self)
{
	__lambda123_ ((SwayNotificationCenterNotificationWindow*) self, old_config, new_config);
}

SwayNotificationCenterNotificationWindow*
sway_notification_center_notification_window_construct (GType object_type)
{
	SwayNotificationCenterNotificationWindow * self = NULL;
	SwayNotificationCenterSwaync* _tmp0_;
	AnimatedList* _tmp5_;
	SwayNotificationCenterConfigModel* _tmp6_;
	SwayNotificationCenterConfigModel* _tmp7_;
	gint _tmp8_;
	gint _tmp9_;
	SwayNotificationCenterSwaync* _tmp10_;
	self = (SwayNotificationCenterNotificationWindow*) g_object_new (object_type, "css-name", "notificationwindow", NULL);
	_tmp0_ = sway_notification_center_app;
	if (_tmp0_->use_layer_shell) {
		if (!gtk_layer_is_supported ()) {
			FILE* _tmp1_;
			FILE* _tmp2_;
			FILE* _tmp3_;
			FILE* _tmp4_;
			_tmp1_ = stderr;
			fprintf (_tmp1_, "GTKLAYERSHELL IS NOT SUPPORTED!\n");
			_tmp2_ = stderr;
			fprintf (_tmp2_, "Swaync only works on Wayland!\n");
			_tmp3_ = stderr;
			fprintf (_tmp3_, "If running waylans session, try running:\n");
			_tmp4_ = stderr;
			fprintf (_tmp4_, "\tGDK_BACKEND=wayland swaync\n");
			exit (1);
		}
		gtk_layer_init_for_window (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow));
		gtk_layer_set_namespace (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), "swaync-notification-window");
	}
	sway_notification_center_notification_window_set_anchor (self);
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), "map", (GCallback) ___lambda119__gtk_widget_map, self, 0);
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), "unmap", (GCallback) ___lambda122__gtk_widget_unmap, self, 0);
	_tmp5_ = self->priv->list;
	animated_list_set_use_card_animation (_tmp5_, TRUE);
	_tmp6_ = sway_notification_center_config_model_get_instance ();
	_tmp7_ = _tmp6_;
	_tmp8_ = sway_notification_center_config_model_get_notification_window_width (_tmp7_);
	_tmp9_ = _tmp8_;
	g_object_set (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), "default-width", _tmp9_, NULL);
	_tmp10_ = sway_notification_center_app;
	g_signal_connect_object (_tmp10_, "config-reload", (GCallback) ___lambda123__sway_notification_center_swaync_config_reload, self, 0);
	return self;
}

SwayNotificationCenterNotificationWindow*
sway_notification_center_notification_window_new (void)
{
	return sway_notification_center_notification_window_construct (SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_WINDOW);
}

static void
sway_notification_center_notification_window_real_size_allocate (GtkWidget* base,
                                                                 gint w,
                                                                 gint h,
                                                                 gint baseline)
{
	SwayNotificationCenterNotificationWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_WINDOW, SwayNotificationCenterNotificationWindow);
	GTK_WIDGET_CLASS (sway_notification_center_notification_window_parent_class)->size_allocate (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_application_window_get_type (), GtkApplicationWindow), gtk_widget_get_type (), GtkWidget), w, h, baseline);
	sway_notification_center_notification_window_set_input_region (self);
}

static void
sway_notification_center_notification_window_real_snapshot (GtkWidget* base,
                                                            GtkSnapshot* snapshot)
{
	SwayNotificationCenterNotificationWindow * self;
	GdkRGBA color = {0};
	GdkRGBA _tmp0_ = {0};
	GdkRGBA _tmp1_;
	graphene_rect_t _tmp2_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_WINDOW, SwayNotificationCenterNotificationWindow);
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (snapshot, gtk_snapshot_get_type ()));
	memset (&_tmp0_, 0, sizeof (GdkRGBA));
	_tmp0_.red = (gfloat) 0;
	_tmp0_.green = (gfloat) 0;
	_tmp0_.blue = (gfloat) 0;
	_tmp0_.alpha = (gfloat) 0;
	color = _tmp0_;
	_tmp1_ = color;
	_tmp2_ = *graphene_rect_zero ();
	gtk_snapshot_append_color (snapshot, &_tmp1_, &_tmp2_);
	GTK_WIDGET_CLASS (sway_notification_center_notification_window_parent_class)->snapshot (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_application_window_get_type (), GtkApplicationWindow), gtk_widget_get_type (), GtkWidget), snapshot);
}

/**
         * Compositors handle the layer shell ON_DEMAND mode differently, so
         * only set the mode while mapped to reduce the chance of the users
         * input focus being stolen by an incoming notification.
         */
static inline void
sway_notification_center_notification_window_set_keyboard_mode (SwayNotificationCenterNotificationWindow* self)
{
	SwayNotificationCenterSwaync* _tmp0_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION_WINDOW (self));
	_tmp0_ = sway_notification_center_app;
	if (_tmp0_->use_layer_shell) {
		gboolean _tmp1_ = FALSE;
		gboolean _tmp2_ = FALSE;
		SwayNotificationCenterSwaync* _tmp3_;
		_tmp3_ = sway_notification_center_app;
		if (_tmp3_->has_layer_on_demand) {
			_tmp2_ = gtk_widget_get_mapped (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
		} else {
			_tmp2_ = FALSE;
		}
		if (_tmp2_) {
			GeeHashSet* _tmp4_;
			gboolean _tmp5_;
			gboolean _tmp6_;
			_tmp4_ = self->priv->inline_reply_notifications;
			_tmp5_ = gee_collection_get_is_empty (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEE_TYPE_COLLECTION, GeeCollection));
			_tmp6_ = _tmp5_;
			_tmp1_ = !_tmp6_;
		} else {
			_tmp1_ = FALSE;
		}
		if (_tmp1_) {
			gtk_layer_set_keyboard_mode (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), GTK_LAYER_SHELL_KEYBOARD_MODE_ON_DEMAND);
		} else {
			gtk_layer_set_keyboard_mode (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), GTK_LAYER_SHELL_KEYBOARD_MODE_NONE);
		}
	}
}

static void
sway_notification_center_notification_window_set_anchor (SwayNotificationCenterNotificationWindow* self)
{
	SwayNotificationCenterSwaync* _tmp0_;
	AnimatedList* _tmp26_;
	AnimatedList* _tmp27_;
	AnimatedList* _tmp28_;
	SwayNotificationCenterConfigModel* _tmp29_;
	SwayNotificationCenterConfigModel* _tmp30_;
	SwayNotificationCenterPositionX _tmp31_;
	SwayNotificationCenterPositionX _tmp32_;
	SwayNotificationCenterConfigModel* _tmp36_;
	SwayNotificationCenterConfigModel* _tmp37_;
	SwayNotificationCenterPositionY _tmp38_;
	SwayNotificationCenterPositionY _tmp39_;
	GtkScrolledWindow* _tmp42_;
	GtkScrolledWindow* _tmp43_;
	SwayNotificationCenterConfigModel* _tmp44_;
	SwayNotificationCenterConfigModel* _tmp45_;
	gint _tmp46_;
	gint _tmp47_;
	GtkScrolledWindow* _tmp48_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION_WINDOW (self));
	g_debug ("notificationWindow.vala:109: NotificationWindow set_anchor");
	_tmp0_ = sway_notification_center_app;
	if (_tmp0_->use_layer_shell) {
		SwayNotificationCenterConfigModel* _tmp1_;
		SwayNotificationCenterConfigModel* _tmp2_;
		SwayNotificationCenterLayer _tmp3_;
		SwayNotificationCenterLayer _tmp4_;
		SwayNotificationCenterConfigModel* _tmp5_;
		SwayNotificationCenterConfigModel* _tmp6_;
		SwayNotificationCenterPositionX _tmp7_;
		SwayNotificationCenterPositionX _tmp8_;
		SwayNotificationCenterConfigModel* _tmp9_;
		SwayNotificationCenterConfigModel* _tmp10_;
		SwayNotificationCenterPositionY _tmp11_;
		SwayNotificationCenterPositionY _tmp12_;
		gchar* monitor_name = NULL;
		SwayNotificationCenterConfigModel* _tmp16_;
		SwayNotificationCenterConfigModel* _tmp17_;
		const gchar* _tmp18_;
		const gchar* _tmp19_;
		gchar* _tmp20_;
		const gchar* _tmp21_;
		const gchar* _tmp24_;
		GdkMonitor* _tmp25_;
		_tmp1_ = sway_notification_center_config_model_get_instance ();
		_tmp2_ = _tmp1_;
		_tmp3_ = sway_notification_center_config_model_get_layer (_tmp2_);
		_tmp4_ = _tmp3_;
		gtk_layer_set_layer (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), sway_notification_center_layer_to_layer (_tmp4_));
		gtk_layer_set_anchor (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), GTK_LAYER_SHELL_EDGE_BOTTOM, TRUE);
		gtk_layer_set_anchor (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), GTK_LAYER_SHELL_EDGE_TOP, TRUE);
		_tmp5_ = sway_notification_center_config_model_get_instance ();
		_tmp6_ = _tmp5_;
		_tmp7_ = sway_notification_center_config_model_get_positionX (_tmp6_);
		_tmp8_ = _tmp7_;
		switch (_tmp8_) {
			case SWAY_NOTIFICATION_CENTER_POSITION_X_LEFT:
			{
				gtk_layer_set_anchor (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), GTK_LAYER_SHELL_EDGE_RIGHT, FALSE);
				gtk_layer_set_anchor (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), GTK_LAYER_SHELL_EDGE_LEFT, TRUE);
				break;
			}
			case SWAY_NOTIFICATION_CENTER_POSITION_X_CENTER:
			{
				gtk_layer_set_anchor (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), GTK_LAYER_SHELL_EDGE_RIGHT, FALSE);
				gtk_layer_set_anchor (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), GTK_LAYER_SHELL_EDGE_LEFT, FALSE);
				break;
			}
			default:
			{
				gtk_layer_set_anchor (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), GTK_LAYER_SHELL_EDGE_LEFT, FALSE);
				gtk_layer_set_anchor (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), GTK_LAYER_SHELL_EDGE_RIGHT, TRUE);
				break;
			}
		}
		_tmp9_ = sway_notification_center_config_model_get_instance ();
		_tmp10_ = _tmp9_;
		_tmp11_ = sway_notification_center_config_model_get_positionY (_tmp10_);
		_tmp12_ = _tmp11_;
		switch (_tmp12_) {
			default:
			case SWAY_NOTIFICATION_CENTER_POSITION_Y_TOP:
			{
				GtkScrolledWindow* _tmp13_;
				_tmp13_ = self->priv->scrolled_window;
				gtk_widget_set_valign (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_START);
				break;
			}
			case SWAY_NOTIFICATION_CENTER_POSITION_Y_CENTER:
			{
				GtkScrolledWindow* _tmp14_;
				_tmp14_ = self->priv->scrolled_window;
				gtk_widget_set_valign (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_CENTER);
				break;
			}
			case SWAY_NOTIFICATION_CENTER_POSITION_Y_BOTTOM:
			{
				GtkScrolledWindow* _tmp15_;
				_tmp15_ = self->priv->scrolled_window;
				gtk_widget_set_valign (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_END);
				break;
			}
		}
		_tmp16_ = sway_notification_center_config_model_get_instance ();
		_tmp17_ = _tmp16_;
		_tmp18_ = sway_notification_center_config_model_get_notification_window_preferred_output (_tmp17_);
		_tmp19_ = _tmp18_;
		_tmp20_ = g_strdup (_tmp19_);
		monitor_name = _tmp20_;
		_tmp21_ = sway_notification_center_notification_window_monitor_name;
		if (_tmp21_ != NULL) {
			const gchar* _tmp22_;
			gchar* _tmp23_;
			_tmp22_ = sway_notification_center_notification_window_monitor_name;
			_tmp23_ = g_strdup (_tmp22_);
			_g_free0 (monitor_name);
			monitor_name = _tmp23_;
		}
		_tmp24_ = monitor_name;
		_tmp25_ = sway_notification_center_functions_try_get_monitor (_tmp24_);
		sway_notification_center_notification_window_set_monitor (self, _tmp25_);
		_g_free0 (monitor_name);
	}
	_tmp26_ = self->priv->list;
	animated_list_set_animation_add_reveal_type (_tmp26_, ANIMATED_LIST_ITEM_REVEAL_ANIMATION_TYPE_SLIDE);
	_tmp27_ = self->priv->list;
	animated_list_set_animation_remove_reveal_type (_tmp27_, ANIMATED_LIST_ITEM_REVEAL_ANIMATION_TYPE_SLIDE);
	_tmp28_ = self->priv->list;
	animated_list_set_animation_remove_child_type (_tmp28_, ANIMATED_LIST_ITEM_CHILD_ANIMATION_TYPE_NONE);
	_tmp29_ = sway_notification_center_config_model_get_instance ();
	_tmp30_ = _tmp29_;
	_tmp31_ = sway_notification_center_config_model_get_positionX (_tmp30_);
	_tmp32_ = _tmp31_;
	switch (_tmp32_) {
		case SWAY_NOTIFICATION_CENTER_POSITION_X_LEFT:
		{
			AnimatedList* _tmp33_;
			_tmp33_ = self->priv->list;
			animated_list_set_animation_add_child_type (_tmp33_, ANIMATED_LIST_ITEM_CHILD_ANIMATION_TYPE_SLIDE_FROM_LEFT);
			break;
		}
		case SWAY_NOTIFICATION_CENTER_POSITION_X_CENTER:
		{
			AnimatedList* _tmp34_;
			_tmp34_ = self->priv->list;
			animated_list_set_animation_add_child_type (_tmp34_, ANIMATED_LIST_ITEM_CHILD_ANIMATION_TYPE_NONE);
			break;
		}
		default:
		case SWAY_NOTIFICATION_CENTER_POSITION_X_RIGHT:
		{
			AnimatedList* _tmp35_;
			_tmp35_ = self->priv->list;
			animated_list_set_animation_add_child_type (_tmp35_, ANIMATED_LIST_ITEM_CHILD_ANIMATION_TYPE_SLIDE_FROM_RIGHT);
			break;
		}
	}
	_tmp36_ = sway_notification_center_config_model_get_instance ();
	_tmp37_ = _tmp36_;
	_tmp38_ = sway_notification_center_config_model_get_positionY (_tmp37_);
	_tmp39_ = _tmp38_;
	switch (_tmp39_) {
		default:
		case SWAY_NOTIFICATION_CENTER_POSITION_Y_TOP:
		case SWAY_NOTIFICATION_CENTER_POSITION_Y_CENTER:
		{
			AnimatedList* _tmp40_;
			_tmp40_ = self->priv->list;
			animated_list_set_direction (_tmp40_, ANIMATED_LIST_DIRECTION_TOP_TO_BOTTOM);
			break;
		}
		case SWAY_NOTIFICATION_CENTER_POSITION_Y_BOTTOM:
		{
			AnimatedList* _tmp41_;
			_tmp41_ = self->priv->list;
			animated_list_set_direction (_tmp41_, ANIMATED_LIST_DIRECTION_BOTTOM_TO_TOP);
			break;
		}
	}
	_tmp42_ = self->priv->scrolled_window;
	gtk_scrolled_window_set_min_content_height (_tmp42_, -1);
	_tmp43_ = self->priv->scrolled_window;
	_tmp44_ = sway_notification_center_config_model_get_instance ();
	_tmp45_ = _tmp44_;
	_tmp46_ = sway_notification_center_config_model_get_notification_window_height (_tmp45_);
	_tmp47_ = _tmp46_;
	gtk_scrolled_window_set_max_content_height (_tmp43_, MAX (_tmp47_, -1));
	_tmp48_ = self->priv->scrolled_window;
	gtk_scrolled_window_set_propagate_natural_height (_tmp48_, TRUE);
	sway_notification_center_notification_window_set_input_region (self);
}

static void
sway_notification_center_notification_window_set_input_region (SwayNotificationCenterNotificationWindow* self)
{
	GdkSurface* surface = NULL;
	GdkSurface* _tmp0_;
	GdkSurface* _tmp1_;
	cairo_region_t* region = NULL;
	cairo_region_t* _tmp2_;
	AnimatedList* _tmp3_;
	GList* _tmp4_;
	GList* _tmp5_;
	graphene_rect_t scrollbar_bounds = {0};
	GtkWidget* scrollbar = NULL;
	GtkScrolledWindow* _tmp19_;
	GtkWidget* _tmp20_;
	GtkWidget* _tmp21_;
	GdkSurface* _tmp27_;
	cairo_region_t* _tmp28_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION_WINDOW (self));
	_tmp0_ = gtk_native_get_surface (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_native_get_type (), GtkNative));
	surface = _tmp0_;
	_tmp1_ = surface;
	if (_tmp1_ == NULL) {
		return;
	}
	_tmp2_ = cairo_region_create ();
	region = _tmp2_;
	_tmp3_ = self->priv->list;
	_tmp4_ = animated_list_get_visible_children (_tmp3_);
	_tmp5_ = _tmp4_;
	{
		GList* item_collection = NULL;
		GList* item_it = NULL;
		item_collection = _tmp5_;
		for (item_it = item_collection; item_it != NULL; item_it = item_it->next) {
			AnimatedListItem* item = NULL;
			item = (AnimatedListItem*) item_it->data;
			{
				gboolean _tmp6_ = FALSE;
				AnimatedListItem* _tmp7_;
				AnimatedListItem* _tmp10_;
				gboolean _tmp11_;
				gboolean _tmp12_;
				graphene_rect_t out_bounds = {0};
				AnimatedListItem* _tmp13_;
				graphene_rect_t _tmp14_ = {0};
				gboolean _tmp15_;
				_tmp7_ = item;
				if (_tmp7_ == NULL) {
					_tmp6_ = TRUE;
				} else {
					AnimatedListItem* _tmp8_;
					_tmp8_ = item;
					_tmp6_ = !G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, G_TYPE_OBJECT);
				}
				if (_tmp6_) {
					AnimatedListItem* _tmp9_;
					_tmp9_ = item;
					g_critical ("notificationWindow.vala:202: Could not iter over AnimatedListItem (%p)" \
" while setting input region\n", _tmp9_);
					continue;
				}
				_tmp10_ = item;
				_tmp11_ = animated_list_item_get_destroying (_tmp10_);
				_tmp12_ = _tmp11_;
				if (_tmp12_) {
					continue;
				}
				_tmp13_ = item;
				_tmp15_ = gtk_widget_compute_bounds (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, gtk_widget_get_type (), GtkWidget), G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), &_tmp14_);
				out_bounds = _tmp14_;
				if (_tmp15_) {
					cairo_rectangle_int_t item_rect = {0};
					cairo_rectangle_int_t _tmp16_ = {0};
					cairo_region_t* _tmp17_;
					cairo_rectangle_int_t _tmp18_;
					memset (&_tmp16_, 0, sizeof (cairo_rectangle_int_t));
					_tmp16_.x = (gint) graphene_rect_get_x (&out_bounds);
					_tmp16_.y = (gint) graphene_rect_get_y (&out_bounds);
					_tmp16_.width = (gint) graphene_rect_get_width (&out_bounds);
					_tmp16_.height = (gint) graphene_rect_get_height (&out_bounds);
					item_rect = _tmp16_;
					_tmp17_ = region;
					_tmp18_ = item_rect;
					cairo_region_union_rectangle (_tmp17_, &_tmp18_);
				}
			}
		}
	}
	_tmp19_ = self->priv->scrolled_window;
	_tmp20_ = gtk_scrolled_window_get_vscrollbar (_tmp19_);
	scrollbar = _tmp20_;
	_tmp21_ = scrollbar;
	if (gtk_widget_should_layout (_tmp21_)) {
		GtkWidget* _tmp22_;
		graphene_rect_t _tmp23_ = {0};
		cairo_rectangle_int_t rect = {0};
		cairo_rectangle_int_t _tmp24_ = {0};
		cairo_region_t* _tmp25_;
		cairo_rectangle_int_t _tmp26_;
		_tmp22_ = scrollbar;
		gtk_widget_compute_bounds (_tmp22_, G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), &_tmp23_);
		scrollbar_bounds = _tmp23_;
		memset (&_tmp24_, 0, sizeof (cairo_rectangle_int_t));
		_tmp24_.x = (gint) graphene_rect_get_x (&scrollbar_bounds);
		_tmp24_.y = (gint) graphene_rect_get_y (&scrollbar_bounds);
		_tmp24_.width = (gint) graphene_rect_get_width (&scrollbar_bounds);
		_tmp24_.height = (gint) graphene_rect_get_height (&scrollbar_bounds);
		rect = _tmp24_;
		_tmp25_ = region;
		_tmp26_ = rect;
		cairo_region_union_rectangle (_tmp25_, &_tmp26_);
	}
	_tmp27_ = surface;
	_tmp28_ = region;
	gdk_surface_set_input_region (_tmp27_, _tmp28_);
	_cairo_region_destroy0 (region);
}

static inline SwayNotificationCenterNotification*
sway_notification_center_notification_window_find_notification (SwayNotificationCenterNotificationWindow* self,
                                                                guint32 id)
{
	SwayNotificationCenterNotification* notification = NULL;
	GeeHashMap* _tmp0_;
	gpointer _tmp1_;
	gboolean _tmp2_ = FALSE;
	SwayNotificationCenterNotification* _tmp3_;
	AnimatedListItem* item = NULL;
	SwayNotificationCenterNotification* _tmp9_;
	GtkWidget* _tmp10_;
	gboolean _tmp11_ = FALSE;
	AnimatedListItem* _tmp12_;
	SwayNotificationCenterNotification* _tmp16_;
	SwayNotificationCenterNotification* result;
	g_return_val_if_fail (SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION_WINDOW (self), NULL);
	_tmp0_ = self->priv->notification_ids;
	_tmp1_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), (gpointer) ((guintptr) id));
	notification = (SwayNotificationCenterNotification*) _tmp1_;
	_tmp3_ = notification;
	if (_tmp3_ == NULL) {
		_tmp2_ = TRUE;
	} else {
		SwayNotificationCenterNotification* _tmp4_;
		SwayNotificationCenterNotifyParams* _tmp5_;
		SwayNotificationCenterNotifyParams* _tmp6_;
		guint32 _tmp7_;
		guint32 _tmp8_;
		_tmp4_ = notification;
		_tmp5_ = sway_notification_center_notification_get_param (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = sway_notification_center_notify_params_get_applied_id (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp2_ = _tmp8_ != id;
	}
	if (_tmp2_) {
		result = NULL;
		return result;
	}
	_tmp9_ = notification;
	_tmp10_ = gtk_widget_get_parent (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_widget_get_type (), GtkWidget));
	item = G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, TYPE_ANIMATED_LIST_ITEM, AnimatedListItem);
	_tmp12_ = item;
	if (_tmp12_ == NULL) {
		_tmp11_ = TRUE;
	} else {
		AnimatedListItem* _tmp13_;
		gboolean _tmp14_;
		gboolean _tmp15_;
		_tmp13_ = item;
		_tmp14_ = animated_list_item_get_destroying (_tmp13_);
		_tmp15_ = _tmp14_;
		_tmp11_ = _tmp15_;
	}
	if (_tmp11_) {
		result = NULL;
		return result;
	}
	_tmp16_ = notification;
	result = _tmp16_;
	return result;
}

/**
         * Hides all notifications. Only invokes the NotificationClosed signal when transient.
         * The optional callback is used to remove select notifications where each
         * iteration returns a bool. True to remove notification, false to skip.
         */
void
sway_notification_center_notification_window_remove_all_notifications (SwayNotificationCenterNotificationWindow* self,
                                                                       gboolean transition,
                                                                       SwayNotificationCenternotification_filter_func filter_func,
                                                                       gpointer filter_func_target)
{
	GeeHashMap* _tmp0_;
	GeeHashSet* _tmp1_;
	AnimatedList* _tmp2_;
	GList* _tmp3_;
	GList* _tmp4_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION_WINDOW (self));
	_tmp0_ = self->priv->notification_ids;
	gee_abstract_map_clear (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap));
	_tmp1_ = self->priv->inline_reply_notifications;
	gee_abstract_collection_clear (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection));
	_tmp2_ = self->priv->list;
	_tmp3_ = animated_list_get_children (_tmp2_);
	_tmp4_ = _tmp3_;
	{
		GList* item_collection = NULL;
		GList* item_it = NULL;
		item_collection = _tmp4_;
		for (item_it = item_collection; item_it != NULL; item_it = item_it->next) {
			AnimatedListItem* item = NULL;
			item = (AnimatedListItem*) item_it->data;
			{
				AnimatedListItem* _tmp5_;
				gboolean _tmp6_;
				gboolean _tmp7_;
				SwayNotificationCenterNotification* notification = NULL;
				AnimatedListItem* _tmp8_;
				GtkWidget* _tmp9_;
				GtkWidget* _tmp10_;
				gboolean _tmp11_ = FALSE;
				SwayNotificationCenterNotification* _tmp12_;
				_tmp5_ = item;
				_tmp6_ = animated_list_item_get_destroying (_tmp5_);
				_tmp7_ = _tmp6_;
				if (_tmp7_) {
					continue;
				}
				_tmp8_ = item;
				_tmp9_ = animated_list_item_get_child (_tmp8_);
				_tmp10_ = _tmp9_;
				notification = G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION, SwayNotificationCenterNotification);
				_tmp12_ = notification;
				if (_tmp12_ != NULL) {
					gboolean _tmp13_ = FALSE;
					if (filter_func == NULL) {
						_tmp13_ = TRUE;
					} else {
						SwayNotificationCenterNotification* _tmp14_;
						_tmp14_ = notification;
						_tmp13_ = filter_func (_tmp14_, filter_func_target);
					}
					_tmp11_ = _tmp13_;
				} else {
					_tmp11_ = FALSE;
				}
				if (_tmp11_) {
					SwayNotificationCenterNotification* _tmp15_;
					_tmp15_ = notification;
					sway_notification_center_notification_window_remove_notification_internal (self, _tmp15_, transition);
				}
			}
		}
	}
	gtk_widget_set_visible (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), FALSE);
}

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

static void
__lambda22_ (SwayNotificationCenterNotificationWindow* self,
             GObject* obj,
             GAsyncResult* res)
{
	AnimatedList* _tmp0_;
	g_return_if_fail ((obj == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (obj, G_TYPE_OBJECT));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (res, g_async_result_get_type ()));
	_tmp0_ = self->priv->list;
	if (animated_list_is_empty (_tmp0_)) {
		gtk_widget_set_visible (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), FALSE);
		return;
	}
	sway_notification_center_notification_window_set_input_region (self);
}

static void
___lambda22__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda22_ ((SwayNotificationCenterNotificationWindow*) self, source_object, res);
	g_object_unref (self);
}

static void
sway_notification_center_notification_window_remove_notification_internal (SwayNotificationCenterNotificationWindow* self,
                                                                           SwayNotificationCenterNotification* notification,
                                                                           gboolean transition)
{
	SwayNotificationCenterNotifyParams* param = NULL;
	SwayNotificationCenterNotifyParams* _tmp0_;
	SwayNotificationCenterNotifyParams* _tmp1_;
	SwayNotificationCenterNotifyParams* _tmp2_;
	GeeHashMap* _tmp3_;
	SwayNotificationCenterNotifyParams* _tmp4_;
	guint32 _tmp5_;
	guint32 _tmp6_;
	gboolean _tmp7_;
	gboolean _tmp8_;
	AnimatedList* _tmp13_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION_WINDOW (self));
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION (notification));
	g_return_if_fail (notification != NULL);
	_tmp0_ = sway_notification_center_notification_get_param (notification);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	param = _tmp2_;
	_tmp3_ = self->priv->notification_ids;
	_tmp4_ = param;
	_tmp5_ = sway_notification_center_notify_params_get_applied_id (_tmp4_);
	_tmp6_ = _tmp5_;
	gee_abstract_map_unset (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), (gpointer) ((guintptr) _tmp6_), NULL);
	transition = transition & gtk_widget_get_mapped (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	_tmp7_ = sway_notification_center_notification_get_has_inline_reply (notification);
	_tmp8_ = _tmp7_;
	if (_tmp8_) {
		GeeHashSet* _tmp9_;
		SwayNotificationCenterNotifyParams* _tmp10_;
		guint32 _tmp11_;
		guint32 _tmp12_;
		_tmp9_ = self->priv->inline_reply_notifications;
		_tmp10_ = param;
		_tmp11_ = sway_notification_center_notify_params_get_applied_id (_tmp10_);
		_tmp12_ = _tmp11_;
		gee_abstract_collection_remove (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), (gpointer) ((guintptr) _tmp12_));
		sway_notification_center_notification_window_set_keyboard_mode (self);
	}
	sway_notification_center_notification_remove_noti_timeout (notification);
	_tmp13_ = self->priv->list;
	animated_list_remove (_tmp13_, G_TYPE_CHECK_INSTANCE_CAST (notification, gtk_widget_get_type (), GtkWidget), transition, ___lambda22__gasync_ready_callback, g_object_ref (self));
	_g_object_unref0 (param);
}

void
sway_notification_center_notification_window_add_notification (SwayNotificationCenterNotificationWindow* self,
                                                               SwayNotificationCenterNotifyParams* param)
{
	SwayNotificationCenterNotification* noti = NULL;
	SwayNotificationCenterConfigModel* _tmp0_;
	SwayNotificationCenterConfigModel* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	SwayNotificationCenterConfigModel* _tmp4_;
	SwayNotificationCenterConfigModel* _tmp5_;
	gint _tmp6_;
	gint _tmp7_;
	SwayNotificationCenterConfigModel* _tmp8_;
	SwayNotificationCenterConfigModel* _tmp9_;
	gint _tmp10_;
	gint _tmp11_;
	SwayNotificationCenterNotification* _tmp12_;
	gboolean _tmp13_;
	gboolean _tmp14_;
	SwayNotificationCenterNotification* _tmp15_;
	gboolean _tmp16_;
	gboolean _tmp17_;
	AnimatedList* _tmp21_;
	SwayNotificationCenterNotification* _tmp22_;
	GeeHashMap* _tmp23_;
	guint32 _tmp24_;
	guint32 _tmp25_;
	SwayNotificationCenterNotification* _tmp26_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION_WINDOW (self));
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_NOTIFY_PARAMS (param));
	_tmp0_ = sway_notification_center_config_model_get_instance ();
	_tmp1_ = _tmp0_;
	_tmp2_ = sway_notification_center_config_model_get_timeout (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = sway_notification_center_config_model_get_instance ();
	_tmp5_ = _tmp4_;
	_tmp6_ = sway_notification_center_config_model_get_timeout_low (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = sway_notification_center_config_model_get_instance ();
	_tmp9_ = _tmp8_;
	_tmp10_ = sway_notification_center_config_model_get_timeout_critical (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = sway_notification_center_notification_new_timed (param, SWAY_NOTIFICATION_CENTER_NOTIFICATION_TYPE_FLOATING, (guint) _tmp3_, (guint) _tmp7_, (guint) _tmp11_);
	if (_tmp12_) {
		g_object_set_data ((GObject *) _tmp12_, "vala-creation-function", "SwayNotificationCenter.NotificationWindow.add_notification");
	}
	g_object_ref_sink (_tmp12_);
	noti = _tmp12_;
	_tmp13_ = gtk_widget_get_visible (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	_tmp14_ = _tmp13_;
	if (!_tmp14_) {
		gtk_widget_unrealize (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	}
	_tmp15_ = noti;
	_tmp16_ = sway_notification_center_notification_get_has_inline_reply (_tmp15_);
	_tmp17_ = _tmp16_;
	if (_tmp17_) {
		GeeHashSet* _tmp18_;
		guint32 _tmp19_;
		guint32 _tmp20_;
		_tmp18_ = self->priv->inline_reply_notifications;
		_tmp19_ = sway_notification_center_notify_params_get_applied_id (param);
		_tmp20_ = _tmp19_;
		gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), (gpointer) ((guintptr) _tmp20_));
		if (gtk_widget_get_mapped (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget))) {
			sway_notification_center_notification_window_set_keyboard_mode (self);
		}
	}
	gtk_widget_set_visible (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), TRUE);
	_tmp21_ = self->priv->list;
	_tmp22_ = noti;
	animated_list_append (_tmp21_, G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, gtk_widget_get_type (), GtkWidget), NULL, NULL);
	_tmp23_ = self->priv->notification_ids;
	_tmp24_ = sway_notification_center_notify_params_get_applied_id (param);
	_tmp25_ = _tmp24_;
	_tmp26_ = noti;
	gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), (gpointer) ((guintptr) _tmp25_), _tmp26_);
	_g_object_unref0 (noti);
}

/** Removes the notification widget with ID. Doesn't dismiss */
void
sway_notification_center_notification_window_remove_notification (SwayNotificationCenterNotificationWindow* self,
                                                                  guint32 id)
{
	SwayNotificationCenterNotification* notification = NULL;
	SwayNotificationCenterNotification* _tmp0_;
	SwayNotificationCenterNotification* _tmp1_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION_WINDOW (self));
	_tmp0_ = sway_notification_center_notification_window_find_notification (self, id);
	notification = _tmp0_;
	_tmp1_ = notification;
	if (_tmp1_ != NULL) {
		SwayNotificationCenterNotification* _tmp2_;
		_tmp2_ = notification;
		sway_notification_center_notification_window_remove_notification_internal (self, _tmp2_, TRUE);
	}
}

void
sway_notification_center_notification_window_replace_notification (SwayNotificationCenterNotificationWindow* self,
                                                                   guint32 id,
                                                                   SwayNotificationCenterNotifyParams* new_params)
{
	SwayNotificationCenterNotification* notification = NULL;
	SwayNotificationCenterNotification* _tmp0_;
	SwayNotificationCenterNotification* _tmp1_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION_WINDOW (self));
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_NOTIFY_PARAMS (new_params));
	_tmp0_ = sway_notification_center_notification_window_find_notification (self, id);
	notification = _tmp0_;
	_tmp1_ = notification;
	if (_tmp1_ != NULL) {
		GeeHashMap* _tmp2_;
		GeeHashMap* _tmp3_;
		guint32 _tmp4_;
		guint32 _tmp5_;
		SwayNotificationCenterNotification* _tmp6_;
		SwayNotificationCenterNotification* _tmp7_;
		AnimatedList* _tmp8_;
		SwayNotificationCenterNotification* _tmp9_;
		_tmp2_ = self->priv->notification_ids;
		gee_abstract_map_unset (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), (gpointer) ((guintptr) id), NULL);
		_tmp3_ = self->priv->notification_ids;
		_tmp4_ = sway_notification_center_notify_params_get_applied_id (new_params);
		_tmp5_ = _tmp4_;
		_tmp6_ = notification;
		gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), (gpointer) ((guintptr) _tmp5_), _tmp6_);
		_tmp7_ = notification;
		sway_notification_center_notification_replace_notification (_tmp7_, new_params);
		_tmp8_ = self->priv->list;
		_tmp9_ = notification;
		animated_list_move_to_beginning (_tmp8_, G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_widget_get_type (), GtkWidget), TRUE);
		return;
	}
	g_debug ("notificationWindow.vala:349: Could not find floating notification to r" \
"eplace: %u", (guint) id);
	sway_notification_center_notification_window_add_notification (self, new_params);
}

SwayNotificationCenterNotifyParams*
sway_notification_center_notification_window_get_latest_notification (SwayNotificationCenterNotificationWindow* self)
{
	AnimatedListItem* item = NULL;
	AnimatedList* _tmp0_;
	AnimatedListItem* _tmp1_;
	gboolean _tmp2_ = FALSE;
	AnimatedListItem* _tmp3_;
	SwayNotificationCenterNotification* noti = NULL;
	AnimatedListItem* _tmp7_;
	GtkWidget* _tmp8_;
	GtkWidget* _tmp9_;
	SwayNotificationCenterNotification* _tmp10_;
	SwayNotificationCenterNotification* _tmp11_;
	SwayNotificationCenterNotifyParams* _tmp12_;
	SwayNotificationCenterNotifyParams* _tmp13_;
	SwayNotificationCenterNotifyParams* _tmp14_;
	SwayNotificationCenterNotifyParams* result;
	g_return_val_if_fail (SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION_WINDOW (self), NULL);
	_tmp0_ = self->priv->list;
	_tmp1_ = animated_list_get_first_item (_tmp0_);
	item = _tmp1_;
	_tmp3_ = item;
	if (_tmp3_ == NULL) {
		_tmp2_ = TRUE;
	} else {
		AnimatedListItem* _tmp4_;
		GtkWidget* _tmp5_;
		GtkWidget* _tmp6_;
		_tmp4_ = item;
		_tmp5_ = animated_list_item_get_child (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp2_ = !SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION (_tmp6_);
	}
	if (_tmp2_) {
		g_warn_if_reached ();
		result = NULL;
		return result;
	}
	_tmp7_ = item;
	_tmp8_ = animated_list_item_get_child (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION, SwayNotificationCenterNotification));
	noti = _tmp10_;
	_tmp11_ = noti;
	_tmp12_ = sway_notification_center_notification_get_param (_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = _g_object_ref0 (_tmp13_);
	result = _tmp14_;
	_g_object_unref0 (noti);
	return result;
}

void
sway_notification_center_notification_window_latest_notification_action (SwayNotificationCenterNotificationWindow* self,
                                                                         guint32 action)
{
	AnimatedListItem* item = NULL;
	AnimatedList* _tmp0_;
	AnimatedListItem* _tmp1_;
	gboolean _tmp2_ = FALSE;
	AnimatedListItem* _tmp3_;
	SwayNotificationCenterNotification* noti = NULL;
	AnimatedListItem* _tmp7_;
	GtkWidget* _tmp8_;
	GtkWidget* _tmp9_;
	SwayNotificationCenterNotification* _tmp10_;
	SwayNotificationCenterNotification* _tmp11_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION_WINDOW (self));
	_tmp0_ = self->priv->list;
	_tmp1_ = animated_list_get_first_item (_tmp0_);
	item = _tmp1_;
	_tmp3_ = item;
	if (_tmp3_ == NULL) {
		_tmp2_ = TRUE;
	} else {
		AnimatedListItem* _tmp4_;
		GtkWidget* _tmp5_;
		GtkWidget* _tmp6_;
		_tmp4_ = item;
		_tmp5_ = animated_list_item_get_child (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp2_ = !SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION (_tmp6_);
	}
	if (_tmp2_) {
		g_warn_if_reached ();
		return;
	}
	_tmp7_ = item;
	_tmp8_ = animated_list_item_get_child (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION, SwayNotificationCenterNotification));
	noti = _tmp10_;
	_tmp11_ = noti;
	sway_notification_center_notification_click_alt_action (_tmp11_, (guint) action);
	_g_object_unref0 (noti);
}

void
sway_notification_center_notification_window_set_monitor (SwayNotificationCenterNotificationWindow* self,
                                                          GdkMonitor* monitor)
{
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_;
	const gchar* _tmp3_ = NULL;
	gchar* _tmp6_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_IS_NOTIFICATION_WINDOW (self));
	g_return_if_fail ((monitor == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (monitor, gdk_monitor_get_type ()));
	_tmp1_ = sway_notification_center_functions_monitor_to_string (monitor);
	_tmp0_ = _tmp1_;
	if (_tmp0_ == NULL) {
		gchar* _tmp2_;
		_tmp2_ = g_strdup ("Monitor Picked by Compositor");
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp2_;
	}
	g_debug ("notificationWindow.vala:376: Setting monitor for Floating Notification" \
"s: %s", _tmp0_);
	if (monitor == NULL) {
		_tmp3_ = NULL;
	} else {
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		_tmp4_ = gdk_monitor_get_connector (monitor);
		_tmp5_ = _tmp4_;
		_tmp3_ = _tmp5_;
	}
	_tmp6_ = g_strdup (_tmp3_);
	_g_free0 (sway_notification_center_notification_window_monitor_name);
	sway_notification_center_notification_window_monitor_name = _tmp6_;
	gtk_layer_set_monitor (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), monitor);
	sway_notification_center_notification_window_set_input_region (self);
	_g_free0 (_tmp0_);
}

static void
sway_notification_center_notification_window_class_init (SwayNotificationCenterNotificationWindowClass * klass,
                                                         gpointer klass_data)
{
	sway_notification_center_notification_window_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SwayNotificationCenterNotificationWindow_private_offset);
	((GtkWidgetClass *) klass)->size_allocate = (void (*) (GtkWidget*, gint, gint, gint)) sway_notification_center_notification_window_real_size_allocate;
	((GtkWidgetClass *) klass)->snapshot = (void (*) (GtkWidget*, GtkSnapshot*)) sway_notification_center_notification_window_real_snapshot;
	G_OBJECT_CLASS (klass)->finalize = sway_notification_center_notification_window_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/erikreider/swaync/ui/notification_window.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "scrolled_window", FALSE, SwayNotificationCenterNotificationWindow_private_offset + G_STRUCT_OFFSET (SwayNotificationCenterNotificationWindowPrivate, scrolled_window));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "list", FALSE, SwayNotificationCenterNotificationWindow_private_offset + G_STRUCT_OFFSET (SwayNotificationCenterNotificationWindowPrivate, list));
}

static void
sway_notification_center_notification_window_instance_init (SwayNotificationCenterNotificationWindow * self,
                                                            gpointer klass)
{
	GeeHashSet* _tmp0_;
	GeeHashMap* _tmp1_;
	self->priv = sway_notification_center_notification_window_get_instance_private (self);
	_tmp0_ = gee_hash_set_new (G_TYPE_UINT, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	if (_tmp0_) {
		g_object_set_data ((GObject *) _tmp0_, "vala-creation-function", "");
	}
	self->priv->inline_reply_notifications = _tmp0_;
	_tmp1_ = gee_hash_map_new (G_TYPE_UINT, NULL, NULL, SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	if (_tmp1_) {
		g_object_set_data ((GObject *) _tmp1_, "vala-creation-function", "");
	}
	self->priv->notification_ids = _tmp1_;
	g_type_ensure (TYPE_ANIMATED_LIST);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
sway_notification_center_notification_window_finalize (GObject * obj)
{
	SwayNotificationCenterNotificationWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SWAY_NOTIFICATION_CENTER_TYPE_NOTIFICATION_WINDOW, SwayNotificationCenterNotificationWindow);
	_g_object_unref0 (self->priv->inline_reply_notifications);
	_g_object_unref0 (self->priv->notification_ids);
	G_OBJECT_CLASS (sway_notification_center_notification_window_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
sway_notification_center_notification_window_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SwayNotificationCenterNotificationWindowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) sway_notification_center_notification_window_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SwayNotificationCenterNotificationWindow), 0, (GInstanceInitFunc) sway_notification_center_notification_window_instance_init, NULL };
	GType sway_notification_center_notification_window_type_id;
	sway_notification_center_notification_window_type_id = g_type_register_static (gtk_application_window_get_type (), "SwayNotificationCenterNotificationWindow", &g_define_type_info, 0);
	SwayNotificationCenterNotificationWindow_private_offset = g_type_add_instance_private (sway_notification_center_notification_window_type_id, sizeof (SwayNotificationCenterNotificationWindowPrivate));
	return sway_notification_center_notification_window_type_id;
}

GType
sway_notification_center_notification_window_get_type (void)
{
	static gsize sway_notification_center_notification_window_type_id__once = 0;
	if (g_once_init_enter (&sway_notification_center_notification_window_type_id__once)) {
		GType sway_notification_center_notification_window_type_id;
		sway_notification_center_notification_window_type_id = sway_notification_center_notification_window_get_type_once ();
		g_once_init_leave (&sway_notification_center_notification_window_type_id__once, sway_notification_center_notification_window_type_id);
	}
	return sway_notification_center_notification_window_type_id__once;
}

