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

/*
 * This file is part of budgie-desktop
 *
 * Copyright Budgie Desktop Developers
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 */

#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib-object.h>
#include <gio/gio.h>
#include "budgie-private.h"
#include <gtk/gtk.h>
#include <libnotify/notify.h>
#include <budgie-config.h>
#include "budgie-waylandclient.h"
#include <gdk/gdk.h>
#include <gtk-layer-shell/gtk-layer-shell.h>
#include <cairo-gobject.h>
#include <gio/gdesktopappinfo.h>
#include <glib/gi18n-lib.h>
#include <canberra.h>
#include <canberra-gtk.h>
#include <gobject/gvaluecollector.h>

#define BUDGIE_NOTIFICATIONS_NOTIFICATION_DBUS_NAME "org.budgie_desktop.Notifications"
#define BUDGIE_NOTIFICATIONS_NOTIFICATION_DBUS_OBJECT_PATH "/org/budgie_desktop/Notifications"
#define BUDGIE_NOTIFICATIONS_RAVEN_DBUS_NAME "org.budgie_desktop.Raven"
#define BUDGIE_NOTIFICATIONS_RAVEN_DBUS_OBJECT_PATH "/org/budgie_desktop/Raven"
#define BUDGIE_NOTIFICATIONS_MINIMUM_EXPIRY ((gint32) 6000)
#define BUDGIE_NOTIFICATIONS_MAXIMUM_EXPIRY ((gint32) 12000)
#define BUDGIE_NOTIFICATIONS_SERVER_BUDGIE_PANEL_SCHEMA "com.solus-project.budgie-panel"
#define BUDGIE_NOTIFICATIONS_SERVER_APPLICATION_SCHEMA "org.gnome.desktop.notifications.application"
#define BUDGIE_NOTIFICATIONS_SERVER_APPLICATION_PREFIX "/org/gnome/desktop/notifications/application"
#define BUDGIE_NOTIFICATIONS_SERVER_BUFFER_ZONE 0
#define BUDGIE_NOTIFICATIONS_SERVER_INITIAL_BUFFER_ZONE 45
#define BUDGIE_NOTIFICATIONS_SERVER_MAX_POPUPS_SHOWN 3
#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 BUDGIE_NOTIFICATIONS_TYPE_RAVEN_PROXY (budgie_notifications_raven_proxy_get_type ())
#define BUDGIE_NOTIFICATIONS_RAVEN_PROXY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BUDGIE_NOTIFICATIONS_TYPE_RAVEN_PROXY, BudgieNotificationsRavenProxy))
#define BUDGIE_NOTIFICATIONS_IS_RAVEN_PROXY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BUDGIE_NOTIFICATIONS_TYPE_RAVEN_PROXY))
#define BUDGIE_NOTIFICATIONS_RAVEN_PROXY_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), BUDGIE_NOTIFICATIONS_TYPE_RAVEN_PROXY, BudgieNotificationsRavenProxyIface))

typedef struct _BudgieNotificationsRavenProxy BudgieNotificationsRavenProxy;
typedef struct _BudgieNotificationsRavenProxyIface BudgieNotificationsRavenProxyIface;

#define BUDGIE_NOTIFICATIONS_TYPE_RAVEN_PROXY_PROXY (budgie_notifications_raven_proxy_proxy_get_type ())
typedef GDBusProxy BudgieNotificationsRavenProxyProxy;
typedef GDBusProxyClass BudgieNotificationsRavenProxyProxyClass;
typedef struct _budgie_notifications_raven_proxy_ToggleNotificationsViewReadyData budgie_notifications_raven_proxy_ToggleNotificationsViewReadyData;

#define BUDGIE_NOTIFICATIONS_TYPE_DISPATCHER (budgie_notifications_dispatcher_get_type ())
#define BUDGIE_NOTIFICATIONS_DISPATCHER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BUDGIE_NOTIFICATIONS_TYPE_DISPATCHER, BudgieNotificationsDispatcher))
#define BUDGIE_NOTIFICATIONS_DISPATCHER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BUDGIE_NOTIFICATIONS_TYPE_DISPATCHER, BudgieNotificationsDispatcherClass))
#define BUDGIE_NOTIFICATIONS_IS_DISPATCHER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BUDGIE_NOTIFICATIONS_TYPE_DISPATCHER))
#define BUDGIE_NOTIFICATIONS_IS_DISPATCHER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BUDGIE_NOTIFICATIONS_TYPE_DISPATCHER))
#define BUDGIE_NOTIFICATIONS_DISPATCHER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BUDGIE_NOTIFICATIONS_TYPE_DISPATCHER, BudgieNotificationsDispatcherClass))

typedef struct _BudgieNotificationsDispatcher BudgieNotificationsDispatcher;
typedef struct _BudgieNotificationsDispatcherClass BudgieNotificationsDispatcherClass;
typedef struct _BudgieNotificationsDispatcherPrivate BudgieNotificationsDispatcherPrivate;
enum  {
	BUDGIE_NOTIFICATIONS_DISPATCHER_0_PROPERTY,
	BUDGIE_NOTIFICATIONS_DISPATCHER_NOTIFICATIONS_PAUSED_PROPERTY,
	BUDGIE_NOTIFICATIONS_DISPATCHER_NUM_PROPERTIES
};
static GParamSpec* budgie_notifications_dispatcher_properties[BUDGIE_NOTIFICATIONS_DISPATCHER_NUM_PROPERTIES];
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
enum  {
	BUDGIE_NOTIFICATIONS_DISPATCHER_DO_NOT_DISTURB_CHANGED_SIGNAL,
	BUDGIE_NOTIFICATIONS_DISPATCHER_NOTIFICATION_ADDED_SIGNAL,
	BUDGIE_NOTIFICATIONS_DISPATCHER_NOTIFICATION_CLOSED_SIGNAL,
	BUDGIE_NOTIFICATIONS_DISPATCHER_NUM_SIGNALS
};
static guint budgie_notifications_dispatcher_signals[BUDGIE_NOTIFICATIONS_DISPATCHER_NUM_SIGNALS] = {0};

#define BUDGIE_NOTIFICATIONS_TYPE_SERVER (budgie_notifications_server_get_type ())
#define BUDGIE_NOTIFICATIONS_SERVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BUDGIE_NOTIFICATIONS_TYPE_SERVER, BudgieNotificationsServer))
#define BUDGIE_NOTIFICATIONS_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BUDGIE_NOTIFICATIONS_TYPE_SERVER, BudgieNotificationsServerClass))
#define BUDGIE_NOTIFICATIONS_IS_SERVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BUDGIE_NOTIFICATIONS_TYPE_SERVER))
#define BUDGIE_NOTIFICATIONS_IS_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BUDGIE_NOTIFICATIONS_TYPE_SERVER))
#define BUDGIE_NOTIFICATIONS_SERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BUDGIE_NOTIFICATIONS_TYPE_SERVER, BudgieNotificationsServerClass))

typedef struct _BudgieNotificationsServer BudgieNotificationsServer;
typedef struct _BudgieNotificationsServerClass BudgieNotificationsServerClass;
typedef struct _BudgieNotificationsServerPrivate BudgieNotificationsServerPrivate;

#define BUDGIE_NOTIFICATIONS_TYPE_POPUP_BASE (budgie_notifications_popup_base_get_type ())
#define BUDGIE_NOTIFICATIONS_POPUP_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BUDGIE_NOTIFICATIONS_TYPE_POPUP_BASE, BudgieNotificationsPopupBase))
#define BUDGIE_NOTIFICATIONS_POPUP_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BUDGIE_NOTIFICATIONS_TYPE_POPUP_BASE, BudgieNotificationsPopupBaseClass))
#define BUDGIE_NOTIFICATIONS_IS_POPUP_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BUDGIE_NOTIFICATIONS_TYPE_POPUP_BASE))
#define BUDGIE_NOTIFICATIONS_IS_POPUP_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BUDGIE_NOTIFICATIONS_TYPE_POPUP_BASE))
#define BUDGIE_NOTIFICATIONS_POPUP_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BUDGIE_NOTIFICATIONS_TYPE_POPUP_BASE, BudgieNotificationsPopupBaseClass))

typedef struct _BudgieNotificationsPopupBase BudgieNotificationsPopupBase;
typedef struct _BudgieNotificationsPopupBaseClass BudgieNotificationsPopupBaseClass;

#define BUDGIE_NOTIFICATIONS_TYPE_POPUP (budgie_notifications_popup_get_type ())
#define BUDGIE_NOTIFICATIONS_POPUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BUDGIE_NOTIFICATIONS_TYPE_POPUP, BudgieNotificationsPopup))
#define BUDGIE_NOTIFICATIONS_POPUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BUDGIE_NOTIFICATIONS_TYPE_POPUP, BudgieNotificationsPopupClass))
#define BUDGIE_NOTIFICATIONS_IS_POPUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BUDGIE_NOTIFICATIONS_TYPE_POPUP))
#define BUDGIE_NOTIFICATIONS_IS_POPUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BUDGIE_NOTIFICATIONS_TYPE_POPUP))
#define BUDGIE_NOTIFICATIONS_POPUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BUDGIE_NOTIFICATIONS_TYPE_POPUP, BudgieNotificationsPopupClass))

typedef struct _BudgieNotificationsPopup BudgieNotificationsPopup;
typedef struct _BudgieNotificationsPopupClass BudgieNotificationsPopupClass;
enum  {
	BUDGIE_NOTIFICATIONS_SERVER_0_PROPERTY,
	BUDGIE_NOTIFICATIONS_SERVER_NUM_PROPERTIES
};
static GParamSpec* budgie_notifications_server_properties[BUDGIE_NOTIFICATIONS_SERVER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block2Data Block2Data;
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
#define _g_settings_schema_unref0(var) ((var == NULL) ? NULL : (var = (g_settings_schema_unref (var), NULL)))
typedef struct _Block3Data Block3Data;
typedef struct _Block4Data Block4Data;

#define BUDGIE_NOTIFICATIONS_TYPE_SOUND_PLAYER (budgie_notifications_sound_player_get_type ())
#define BUDGIE_NOTIFICATIONS_SOUND_PLAYER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BUDGIE_NOTIFICATIONS_TYPE_SOUND_PLAYER, BudgieNotificationsSoundPlayer))
#define BUDGIE_NOTIFICATIONS_SOUND_PLAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BUDGIE_NOTIFICATIONS_TYPE_SOUND_PLAYER, BudgieNotificationsSoundPlayerClass))
#define BUDGIE_NOTIFICATIONS_IS_SOUND_PLAYER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BUDGIE_NOTIFICATIONS_TYPE_SOUND_PLAYER))
#define BUDGIE_NOTIFICATIONS_IS_SOUND_PLAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BUDGIE_NOTIFICATIONS_TYPE_SOUND_PLAYER))
#define BUDGIE_NOTIFICATIONS_SOUND_PLAYER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BUDGIE_NOTIFICATIONS_TYPE_SOUND_PLAYER, BudgieNotificationsSoundPlayerClass))

typedef struct _BudgieNotificationsSoundPlayer BudgieNotificationsSoundPlayer;
typedef struct _BudgieNotificationsSoundPlayerClass BudgieNotificationsSoundPlayerClass;
#define _g_thread_unref0(var) ((var == NULL) ? NULL : (var = (g_thread_unref (var), NULL)))
#define _budgie_notifications_sound_player_unref0(var) ((var == NULL) ? NULL : (var = (budgie_notifications_sound_player_unref (var), NULL)))
enum  {
	BUDGIE_NOTIFICATIONS_SERVER_ACTION_INVOKED_SIGNAL,
	BUDGIE_NOTIFICATIONS_SERVER_ACTIVATION_TOKEN_SIGNAL,
	BUDGIE_NOTIFICATIONS_SERVER_NOTIFICATION_CLOSED_SIGNAL,
	BUDGIE_NOTIFICATIONS_SERVER_NUM_SIGNALS
};
static guint budgie_notifications_server_signals[BUDGIE_NOTIFICATIONS_SERVER_NUM_SIGNALS] = {0};
typedef struct _BudgieNotificationsSoundPlayerPrivate BudgieNotificationsSoundPlayerPrivate;
#define _ca_proplist_destroy0(var) ((var == NULL) ? NULL : (var = (ca_proplist_destroy (var), NULL)))
typedef struct _BudgieNotificationsParamSpecSoundPlayer BudgieNotificationsParamSpecSoundPlayer;

struct _BudgieNotificationsRavenProxyIface {
	GTypeInterface parent_iface;
	void (*ToggleNotificationsView) (BudgieNotificationsRavenProxy* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*ToggleNotificationsView_finish) (BudgieNotificationsRavenProxy* self, GAsyncResult* _res_, GError** error);
};

struct _budgie_notifications_raven_proxy_ToggleNotificationsViewReadyData {
	GDBusMethodInvocation* _invocation_;
};

struct _BudgieNotificationsDispatcher {
	GObject parent_instance;
	BudgieNotificationsDispatcherPrivate * priv;
};

struct _BudgieNotificationsDispatcherClass {
	GObjectClass parent_class;
};

struct _BudgieNotificationsDispatcherPrivate {
	gboolean _dnd;
	gboolean _notifications_paused;
};

struct _BudgieNotificationsServer {
	GObject parent_instance;
	BudgieNotificationsServerPrivate * priv;
};

struct _BudgieNotificationsServerClass {
	GObjectClass parent_class;
};

struct _BudgieNotificationsServerPrivate {
	guint32 notif_id;
	BudgieNotificationsDispatcher* _dispatcher;
	BudgieNotificationsRavenProxy* _raven;
	GHashTable* popups;
	GSettings* _panel_settings;
	guint32 _latest_popup_id;
	gint32 latest_popup_y;
	gint _paused_notifications;
	NotifyNotification* unpaused_noti;
};

struct _Block2Data {
	int _ref_count_;
	BudgieNotificationsServer* self;
	guint32 id;
	gchar* app_name;
};

struct _Block3Data {
	int _ref_count_;
	BudgieNotificationsServer* self;
	BudgieWaylandClient* wayland_client;
	BudgieNotificationsPopup* popup;
};

struct _Block4Data {
	int _ref_count_;
	Block3Data * _data3_;
	GdkRectangle mon_rect;
	GdkMonitor* monitor;
	gulong handler_id;
};

struct _BudgieNotificationsSoundPlayer {
	GTypeInstance parent_instance;
	volatile int ref_count;
	BudgieNotificationsSoundPlayerPrivate * priv;
};

struct _BudgieNotificationsSoundPlayerClass {
	GTypeClass parent_class;
	void (*finalize) (BudgieNotificationsSoundPlayer *self);
};

struct _BudgieNotificationsSoundPlayerPrivate {
	BudgieNotification* notification;
	gchar* sound_name;
};

struct _BudgieNotificationsParamSpecSoundPlayer {
	GParamSpec parent_instance;
};

static gint BudgieNotificationsDispatcher_private_offset;
static gpointer budgie_notifications_dispatcher_parent_class = NULL;
static gint BudgieNotificationsServer_private_offset;
static gpointer budgie_notifications_server_parent_class = NULL;
static gint BudgieNotificationsSoundPlayer_private_offset;
static gpointer budgie_notifications_sound_player_parent_class = NULL;

VALA_EXTERN GType budgie_notifications_raven_proxy_proxy_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint budgie_notifications_raven_proxy_register_object (void* object,
                                                        GDBusConnection* connection,
                                                        const gchar* path,
                                                        GError** error);
VALA_EXTERN GType budgie_notifications_raven_proxy_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BudgieNotificationsRavenProxy, g_object_unref)
VALA_EXTERN void budgie_notifications_raven_proxy_ToggleNotificationsView (BudgieNotificationsRavenProxy* self,
                                                               GAsyncReadyCallback _callback_,
                                                               gpointer _user_data_);
VALA_EXTERN void budgie_notifications_raven_proxy_ToggleNotificationsView_finish (BudgieNotificationsRavenProxy* self,
                                                                      GAsyncResult* _res_,
                                                                      GError** error);
static GType budgie_notifications_raven_proxy_get_type_once (void);
static void budgie_notifications_raven_proxy_proxy_g_signal (GDBusProxy* proxy,
                                                      const gchar* sender_name,
                                                      const gchar* signal_name,
                                                      GVariant* parameters);
static void _vala_g_async_ready_callback (GObject *source_object,
                                   GAsyncResult *res,
                                   void *user_data);
static void budgie_notifications_raven_proxy_proxy_ToggleNotificationsView_async (BudgieNotificationsRavenProxy* self,
                                                                           GAsyncReadyCallback _callback_,
                                                                           gpointer _user_data_);
static void budgie_notifications_raven_proxy_proxy_ToggleNotificationsView_finish (BudgieNotificationsRavenProxy* self,
                                                                            GAsyncResult* _res_,
                                                                            GError** error);
static void budgie_notifications_raven_proxy_proxy_budgie_notifications_raven_proxy_interface_init (BudgieNotificationsRavenProxyIface* iface);
static void _dbus_budgie_notifications_raven_proxy_ToggleNotificationsView (BudgieNotificationsRavenProxy* self,
                                                                     GVariant* _parameters_,
                                                                     GDBusMethodInvocation* invocation);
static void _dbus_budgie_notifications_raven_proxy_ToggleNotificationsView_ready (GObject * source_object,
                                                                           GAsyncResult * _res_,
                                                                           gpointer _user_data_);
static void budgie_notifications_raven_proxy_dbus_interface_method_call (GDBusConnection* connection,
                                                                  const gchar* sender,
                                                                  const gchar* object_path,
                                                                  const gchar* interface_name,
                                                                  const gchar* method_name,
                                                                  GVariant* parameters,
                                                                  GDBusMethodInvocation* invocation,
                                                                  gpointer user_data);
static GVariant* budgie_notifications_raven_proxy_dbus_interface_get_property (GDBusConnection* connection,
                                                                        const gchar* sender,
                                                                        const gchar* object_path,
                                                                        const gchar* interface_name,
                                                                        const gchar* property_name,
                                                                        GError** error,
                                                                        gpointer user_data);
static gboolean budgie_notifications_raven_proxy_dbus_interface_set_property (GDBusConnection* connection,
                                                                       const gchar* sender,
                                                                       const gchar* object_path,
                                                                       const gchar* interface_name,
                                                                       const gchar* property_name,
                                                                       GVariant* value,
                                                                       GError** error,
                                                                       gpointer user_data);
static void _budgie_notifications_raven_proxy_unregister_object (gpointer user_data);
VALA_EXTERN GType budgie_notifications_dispatcher_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BudgieNotificationsDispatcher, g_object_unref)
VALA_EXTERN guint budgie_notifications_dispatcher_register_object (void* object,
                                                       GDBusConnection* connection,
                                                       const gchar* path,
                                                       GError** error);
VALA_EXTERN void budgie_notifications_dispatcher_setup_dbus (BudgieNotificationsDispatcher* self,
                                                 gboolean replace);
static void budgie_notifications_dispatcher_on_dbus_acquired (BudgieNotificationsDispatcher* self,
                                                       GDBusConnection* conn);
static void _budgie_notifications_dispatcher_on_dbus_acquired_gbus_acquired_callback (GDBusConnection* connection,
                                                                               const gchar* name,
                                                                               gpointer self);
static void __lambda10_ (BudgieNotificationsDispatcher* self);
static void ___lambda10__gbus_name_acquired_callback (GDBusConnection* connection,
                                               const gchar* name,
                                               gpointer self);
VALA_EXTERN void budgie_DaemonNameLost (GDBusConnection* conn,
                            const gchar* name);
static void _budgie_DaemonNameLost_gbus_name_lost_callback (GDBusConnection* connection,
                                                     const gchar* name,
                                                     gpointer self);
VALA_EXTERN gboolean budgie_notifications_dispatcher_get_do_not_disturb (BudgieNotificationsDispatcher* self,
                                                             GError** error);
static gboolean budgie_notifications_dispatcher_get_dnd (BudgieNotificationsDispatcher* self);
VALA_EXTERN void budgie_notifications_dispatcher_toggle_do_not_disturb (BudgieNotificationsDispatcher* self,
                                                            GError** error);
static void budgie_notifications_dispatcher_set_dnd (BudgieNotificationsDispatcher* self,
                                              gboolean value);
VALA_EXTERN BudgieNotificationsDispatcher* budgie_notifications_dispatcher_new (void);
VALA_EXTERN BudgieNotificationsDispatcher* budgie_notifications_dispatcher_construct (GType object_type);
VALA_EXTERN gboolean budgie_notifications_dispatcher_get_notifications_paused (BudgieNotificationsDispatcher* self);
VALA_EXTERN void budgie_notifications_dispatcher_set_notifications_paused (BudgieNotificationsDispatcher* self,
                                                               gboolean value);
static void g_cclosure_user_marshal_VOID__STRING_UINT_STRING_STRING_STRING_BOXED_INT_BOXED_INT (GClosure * closure,
                                                                                         GValue * return_value,
                                                                                         guint n_param_values,
                                                                                         const GValue * param_values,
                                                                                         gpointer invocation_hint,
                                                                                         gpointer marshal_data);
static void g_cclosure_user_marshal_VOID__UINT_STRING_ENUM (GClosure * closure,
                                                     GValue * return_value,
                                                     guint n_param_values,
                                                     const GValue * param_values,
                                                     gpointer invocation_hint,
                                                     gpointer marshal_data);
static GObject * budgie_notifications_dispatcher_constructor (GType type,
                                                       guint n_construct_properties,
                                                       GObjectConstructParam * construct_properties);
static void budgie_notifications_dispatcher_finalize (GObject * obj);
static GType budgie_notifications_dispatcher_get_type_once (void);
static void _vala_budgie_notifications_dispatcher_get_property (GObject * object,
                                                         guint property_id,
                                                         GValue * value,
                                                         GParamSpec * pspec);
static void _vala_budgie_notifications_dispatcher_set_property (GObject * object,
                                                         guint property_id,
                                                         const GValue * value,
                                                         GParamSpec * pspec);
static void _dbus_budgie_notifications_dispatcher_get_do_not_disturb (BudgieNotificationsDispatcher* self,
                                                               GVariant* _parameters_,
                                                               GDBusMethodInvocation* invocation);
static void _dbus_budgie_notifications_dispatcher_toggle_do_not_disturb (BudgieNotificationsDispatcher* self,
                                                                  GVariant* _parameters_,
                                                                  GDBusMethodInvocation* invocation);
static void budgie_notifications_dispatcher_dbus_interface_method_call (GDBusConnection* connection,
                                                                 const gchar* sender,
                                                                 const gchar* object_path,
                                                                 const gchar* interface_name,
                                                                 const gchar* method_name,
                                                                 GVariant* parameters,
                                                                 GDBusMethodInvocation* invocation,
                                                                 gpointer user_data);
static GVariant* budgie_notifications_dispatcher_dbus_interface_get_property (GDBusConnection* connection,
                                                                       const gchar* sender,
                                                                       const gchar* object_path,
                                                                       const gchar* interface_name,
                                                                       const gchar* property_name,
                                                                       GError** error,
                                                                       gpointer user_data);
static GVariant* _dbus_budgie_notifications_dispatcher_get_notifications_paused (BudgieNotificationsDispatcher* self);
static gboolean budgie_notifications_dispatcher_dbus_interface_set_property (GDBusConnection* connection,
                                                                      const gchar* sender,
                                                                      const gchar* object_path,
                                                                      const gchar* interface_name,
                                                                      const gchar* property_name,
                                                                      GVariant* value,
                                                                      GError** error,
                                                                      gpointer user_data);
static void _dbus_budgie_notifications_dispatcher_set_notifications_paused (BudgieNotificationsDispatcher* self,
                                                                     GVariant* _value);
static void _dbus_budgie_notifications_dispatcher_do_not_disturb_changed (GObject* _sender,
                                                                   gboolean value,
                                                                   gpointer* _data);
static void _dbus_budgie_notifications_dispatcher_notification_added (GObject* _sender,
                                                               const gchar* app_name,
                                                               guint32 id,
                                                               const gchar* app_icon,
                                                               const gchar* summary,
                                                               const gchar* body,
                                                               gchar** actions,
                                                               gint actions_length1,
                                                               GHashTable* hints,
                                                               gint32 expire_timeout,
                                                               gpointer* _data);
static void _dbus_budgie_notifications_dispatcher_notification_closed (GObject* _sender,
                                                                guint32 id,
                                                                const gchar* app_name,
                                                                BudgieNotificationCloseReason reason,
                                                                gpointer* _data);
static void _budgie_notifications_dispatcher_unregister_object (gpointer user_data);
VALA_EXTERN GType budgie_notifications_server_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BudgieNotificationsServer, g_object_unref)
VALA_EXTERN guint budgie_notifications_server_register_object (void* object,
                                                   GDBusConnection* connection,
                                                   const gchar* path,
                                                   GError** error);
VALA_EXTERN GType budgie_notifications_popup_base_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BudgieNotificationsPopupBase, g_object_unref)
VALA_EXTERN GType budgie_notifications_popup_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BudgieNotificationsPopup, g_object_unref)
VALA_EXTERN void budgie_notifications_server_setup_dbus (BudgieNotificationsServer* self,
                                             gboolean replace);
static void budgie_notifications_server_on_bus_acquired (BudgieNotificationsServer* self,
                                                  GDBusConnection* conn);
static void _budgie_notifications_server_on_bus_acquired_gbus_acquired_callback (GDBusConnection* connection,
                                                                          const gchar* name,
                                                                          gpointer self);
static void __lambda20_ (BudgieNotificationsServer* self);
static void ___lambda20__gbus_name_acquired_callback (GDBusConnection* connection,
                                               const gchar* name,
                                               gpointer self);
static BudgieNotificationsDispatcher* budgie_notifications_server_get_dispatcher (BudgieNotificationsServer* self);
static void budgie_notifications_server_on_raven_get (BudgieNotificationsServer* self,
                                               GObject* o,
                                               GAsyncResult* res);
static void budgie_notifications_server_set_raven (BudgieNotificationsServer* self,
                                            BudgieNotificationsRavenProxy* value);
VALA_EXTERN gchar** budgie_notifications_server_GetCapabilities (BudgieNotificationsServer* self,
                                                     gint* result_length1,
                                                     GError** error);
VALA_EXTERN void budgie_notifications_server_GetServerInformation (BudgieNotificationsServer* self,
                                                       gchar** name,
                                                       gchar** vendor,
                                                       gchar** version,
                                                       gchar** spec_version,
                                                       GError** error);
VALA_EXTERN guint32 budgie_notifications_server_notification_received (BudgieNotificationsServer* self,
                                                           const gchar* app_name,
                                                           guint32 replaces_id,
                                                           const gchar* app_icon,
                                                           const gchar* summary,
                                                           const gchar* body,
                                                           gchar** actions,
                                                           gint actions_length1,
                                                           GHashTable* hints,
                                                           gint32 expire_timeout,
                                                           GError** error);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static gint budgie_notifications_server_get_paused_notifications (BudgieNotificationsServer* self);
static void budgie_notifications_server_set_paused_notifications (BudgieNotificationsServer* self,
                                                           gint value);
VALA_EXTERN void budgie_notifications_popup_replace (BudgieNotificationsPopup* self,
                                         BudgieNotification* new_notif);
VALA_EXTERN BudgieNotificationsPopup* budgie_notifications_popup_new (BudgieNotificationsServer* owner,
                                                          BudgieNotification* notification);
VALA_EXTERN BudgieNotificationsPopup* budgie_notifications_popup_construct (GType object_type,
                                                                BudgieNotificationsServer* owner,
                                                                BudgieNotification* notification);
VALA_EXTERN void budgie_notifications_popup_toggle_body_text (BudgieNotificationsPopup* self);
static void budgie_notifications_server_configure_window (BudgieNotificationsServer* self,
                                                   BudgieNotificationsPopup* popup);
static void budgie_notifications_server_set_latest_popup_id (BudgieNotificationsServer* self,
                                                      guint32 value);
VALA_EXTERN void budgie_notifications_popup_base_begin_decay (BudgieNotificationsPopupBase* self,
                                                  guint timeout);
static void ___lambda23_ (Block2Data* _data2_,
                   const gchar* action_key);
static void ____lambda23__budgie_notifications_popup_action_invoked (BudgieNotificationsPopup* _sender,
                                                              const gchar* action_key,
                                                              gpointer self);
static void ___lambda24_ (Block2Data* _data2_,
                   BudgieNotificationCloseReason reason);
static guint32 budgie_notifications_server_get_latest_popup_id (BudgieNotificationsServer* self);
static void ____lambda24__budgie_notifications_popup_base_closed (BudgieNotificationsPopupBase* _sender,
                                                           BudgieNotificationCloseReason reason,
                                                           gpointer self);
static void budgie_notifications_server_maybe_play_sound (BudgieNotificationsServer* self,
                                                   BudgieNotification* notification,
                                                   gboolean notify,
                                                   gboolean should_show,
                                                   GSettings* settings);
VALA_EXTERN void budgie_notifications_server_CloseNotification (BudgieNotificationsServer* self,
                                                    guint32 id,
                                                    GError** error);
VALA_EXTERN void budgie_notifications_popup_base_dismiss (BudgieNotificationsPopupBase* self);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
static gboolean __lambda21_ (Block3Data* _data3_);
static Block4Data* block4_data_ref (Block4Data* _data4_);
static void block4_data_unref (void * _userdata_);
static void __lambda22_ (Block4Data* _data4_,
                  GtkAllocation* alloc);
static void budgie_notifications_server_calculate_position (BudgieNotificationsServer* self,
                                                     gint monitor_height);
static GSettings* budgie_notifications_server_get_panel_settings (BudgieNotificationsServer* self);
static void ___lambda22__gtk_widget_size_allocate (GtkWidget* _sender,
                                            GtkAllocation* allocation,
                                            gpointer self);
static gboolean ___lambda21__budgie_monitor_callback (gpointer self);
VALA_EXTERN gboolean budgie_notifications_popup_base_get_destroying (BudgieNotificationsPopupBase* self);
static const gchar* budgie_notifications_server_get_sound_for_category (BudgieNotificationsServer* self,
                                                                 const gchar* category);
VALA_EXTERN gpointer budgie_notifications_sound_player_ref (gpointer instance);
VALA_EXTERN void budgie_notifications_sound_player_unref (gpointer instance);
VALA_EXTERN GParamSpec* budgie_notifications_param_spec_sound_player (const gchar* name,
                                                          const gchar* nick,
                                                          const gchar* blurb,
                                                          GType object_type,
                                                          GParamFlags flags);
VALA_EXTERN void budgie_notifications_value_set_sound_player (GValue* value,
                                                  gpointer v_object);
VALA_EXTERN void budgie_notifications_value_take_sound_player (GValue* value,
                                                   gpointer v_object);
VALA_EXTERN gpointer budgie_notifications_value_get_sound_player (const GValue* value);
VALA_EXTERN GType budgie_notifications_sound_player_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BudgieNotificationsSoundPlayer, budgie_notifications_sound_player_unref)
VALA_EXTERN BudgieNotificationsSoundPlayer* budgie_notifications_sound_player_new (BudgieNotification* notification,
                                                                       const gchar* sound_name);
VALA_EXTERN BudgieNotificationsSoundPlayer* budgie_notifications_sound_player_construct (GType object_type,
                                                                             BudgieNotification* notification,
                                                                             const gchar* sound_name);
VALA_EXTERN void budgie_notifications_sound_player_play (BudgieNotificationsSoundPlayer* self);
static gpointer _budgie_notifications_sound_player_play_gthread_func (gpointer self);
static void budgie_notifications_server_on_property_changed (BudgieNotificationsServer* self,
                                                      GParamSpec* p);
static void ___lambda25_ (BudgieNotificationsServer* self,
                   NotifyNotification* notification,
                   const gchar* action);
static BudgieNotificationsRavenProxy* budgie_notifications_server_get_raven (BudgieNotificationsServer* self);
static void __lambda26_ (BudgieNotificationsServer* self,
                  GObject* obj,
                  GAsyncResult* res);
static void ___lambda26__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void ____lambda25__notify_action_callback (NotifyNotification* notification,
                                           const gchar* action,
                                           gpointer self);
static void ___lambda27_ (BudgieNotificationsServer* self);
static void ____lambda27__notify_notification_closed (NotifyNotification* _sender,
                                               gpointer self);
static void* ___lambda28_ (BudgieNotificationsServer* self);
static gpointer ____lambda28__gthread_func (gpointer self);
VALA_EXTERN BudgieNotificationsServer* budgie_notifications_server_new (void);
VALA_EXTERN BudgieNotificationsServer* budgie_notifications_server_construct (GType object_type);
static void budgie_notifications_server_set_dispatcher (BudgieNotificationsServer* self,
                                                 BudgieNotificationsDispatcher* value);
static void budgie_notifications_server_set_panel_settings (BudgieNotificationsServer* self,
                                                     GSettings* value);
static void g_cclosure_user_marshal_VOID__UINT_STRING (GClosure * closure,
                                                GValue * return_value,
                                                guint n_param_values,
                                                const GValue * param_values,
                                                gpointer invocation_hint,
                                                gpointer marshal_data);
static void g_cclosure_user_marshal_VOID__UINT_UINT (GClosure * closure,
                                              GValue * return_value,
                                              guint n_param_values,
                                              const GValue * param_values,
                                              gpointer invocation_hint,
                                              gpointer marshal_data);
static GObject * budgie_notifications_server_constructor (GType type,
                                                   guint n_construct_properties,
                                                   GObjectConstructParam * construct_properties);
static void _budgie_notifications_server_on_property_changed_g_object_notify (GObject* _sender,
                                                                       GParamSpec* pspec,
                                                                       gpointer self);
static void _budgie_notifications_server_on_raven_get_gasync_ready_callback (GObject* source_object,
                                                                      GAsyncResult* res,
                                                                      gpointer self);
static void _g_object_unref0_ (gpointer var);
static void budgie_notifications_server_finalize (GObject * obj);
static GType budgie_notifications_server_get_type_once (void);
static void _vala_budgie_notifications_server_get_property (GObject * object,
                                                     guint property_id,
                                                     GValue * value,
                                                     GParamSpec * pspec);
static void _vala_budgie_notifications_server_set_property (GObject * object,
                                                     guint property_id,
                                                     const GValue * value,
                                                     GParamSpec * pspec);
static void _dbus_budgie_notifications_server_GetCapabilities (BudgieNotificationsServer* self,
                                                        GVariant* _parameters_,
                                                        GDBusMethodInvocation* invocation);
static void _dbus_budgie_notifications_server_GetServerInformation (BudgieNotificationsServer* self,
                                                             GVariant* _parameters_,
                                                             GDBusMethodInvocation* invocation);
static void _dbus_budgie_notifications_server_notification_received (BudgieNotificationsServer* self,
                                                              GVariant* _parameters_,
                                                              GDBusMethodInvocation* invocation);
static void _dbus_budgie_notifications_server_CloseNotification (BudgieNotificationsServer* self,
                                                          GVariant* _parameters_,
                                                          GDBusMethodInvocation* invocation);
static void budgie_notifications_server_dbus_interface_method_call (GDBusConnection* connection,
                                                             const gchar* sender,
                                                             const gchar* object_path,
                                                             const gchar* interface_name,
                                                             const gchar* method_name,
                                                             GVariant* parameters,
                                                             GDBusMethodInvocation* invocation,
                                                             gpointer user_data);
static GVariant* budgie_notifications_server_dbus_interface_get_property (GDBusConnection* connection,
                                                                   const gchar* sender,
                                                                   const gchar* object_path,
                                                                   const gchar* interface_name,
                                                                   const gchar* property_name,
                                                                   GError** error,
                                                                   gpointer user_data);
static gboolean budgie_notifications_server_dbus_interface_set_property (GDBusConnection* connection,
                                                                  const gchar* sender,
                                                                  const gchar* object_path,
                                                                  const gchar* interface_name,
                                                                  const gchar* property_name,
                                                                  GVariant* value,
                                                                  GError** error,
                                                                  gpointer user_data);
static void _dbus_budgie_notifications_server_action_invoked (GObject* _sender,
                                                       guint32 id,
                                                       const gchar* action_key,
                                                       gpointer* _data);
static void _dbus_budgie_notifications_server_activation_token (GObject* _sender,
                                                         guint32 id,
                                                         const gchar* activation_token,
                                                         gpointer* _data);
static void _dbus_budgie_notifications_server_notification_closed (GObject* _sender,
                                                            guint32 id,
                                                            guint32 reason,
                                                            gpointer* _data);
static void _budgie_notifications_server_unregister_object (gpointer user_data);
static void budgie_notifications_sound_player_finalize (BudgieNotificationsSoundPlayer * obj);
static GType budgie_notifications_sound_player_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static const GDBusArgInfo * const _budgie_notifications_raven_proxy_dbus_arg_info_ToggleNotificationsView_in[] = {NULL};
static const GDBusArgInfo * const _budgie_notifications_raven_proxy_dbus_arg_info_ToggleNotificationsView_out[] = {NULL};
static const GDBusMethodInfo _budgie_notifications_raven_proxy_dbus_method_info_ToggleNotificationsView = {-1, "ToggleNotificationsView", (GDBusArgInfo **) (&_budgie_notifications_raven_proxy_dbus_arg_info_ToggleNotificationsView_in), (GDBusArgInfo **) (&_budgie_notifications_raven_proxy_dbus_arg_info_ToggleNotificationsView_out), NULL};
static const GDBusMethodInfo * const _budgie_notifications_raven_proxy_dbus_method_info[] = {&_budgie_notifications_raven_proxy_dbus_method_info_ToggleNotificationsView, NULL};
static const GDBusSignalInfo * const _budgie_notifications_raven_proxy_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo * const _budgie_notifications_raven_proxy_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _budgie_notifications_raven_proxy_dbus_interface_info = {-1, "org.budgie_desktop.Raven", (GDBusMethodInfo **) (&_budgie_notifications_raven_proxy_dbus_method_info), (GDBusSignalInfo **) (&_budgie_notifications_raven_proxy_dbus_signal_info), (GDBusPropertyInfo **) (&_budgie_notifications_raven_proxy_dbus_property_info), NULL};
static const GDBusInterfaceVTable _budgie_notifications_raven_proxy_dbus_interface_vtable = {budgie_notifications_raven_proxy_dbus_interface_method_call, budgie_notifications_raven_proxy_dbus_interface_get_property, budgie_notifications_raven_proxy_dbus_interface_set_property};
static const GDBusArgInfo _budgie_notifications_dispatcher_dbus_arg_info_get_do_not_disturb_result = {-1, "result", "b", NULL};
static const GDBusArgInfo * const _budgie_notifications_dispatcher_dbus_arg_info_get_do_not_disturb_in[] = {NULL};
static const GDBusArgInfo * const _budgie_notifications_dispatcher_dbus_arg_info_get_do_not_disturb_out[] = {&_budgie_notifications_dispatcher_dbus_arg_info_get_do_not_disturb_result, NULL};
static const GDBusMethodInfo _budgie_notifications_dispatcher_dbus_method_info_get_do_not_disturb = {-1, "GetDoNotDisturb", (GDBusArgInfo **) (&_budgie_notifications_dispatcher_dbus_arg_info_get_do_not_disturb_in), (GDBusArgInfo **) (&_budgie_notifications_dispatcher_dbus_arg_info_get_do_not_disturb_out), NULL};
static const GDBusArgInfo * const _budgie_notifications_dispatcher_dbus_arg_info_toggle_do_not_disturb_in[] = {NULL};
static const GDBusArgInfo * const _budgie_notifications_dispatcher_dbus_arg_info_toggle_do_not_disturb_out[] = {NULL};
static const GDBusMethodInfo _budgie_notifications_dispatcher_dbus_method_info_toggle_do_not_disturb = {-1, "ToggleDoNotDisturb", (GDBusArgInfo **) (&_budgie_notifications_dispatcher_dbus_arg_info_toggle_do_not_disturb_in), (GDBusArgInfo **) (&_budgie_notifications_dispatcher_dbus_arg_info_toggle_do_not_disturb_out), NULL};
static const GDBusMethodInfo * const _budgie_notifications_dispatcher_dbus_method_info[] = {&_budgie_notifications_dispatcher_dbus_method_info_get_do_not_disturb, &_budgie_notifications_dispatcher_dbus_method_info_toggle_do_not_disturb, NULL};
static const GDBusArgInfo _budgie_notifications_dispatcher_dbus_arg_info_do_not_disturb_changed_value = {-1, "value", "b", NULL};
static const GDBusArgInfo * const _budgie_notifications_dispatcher_dbus_arg_info_do_not_disturb_changed[] = {&_budgie_notifications_dispatcher_dbus_arg_info_do_not_disturb_changed_value, NULL};
static const GDBusSignalInfo _budgie_notifications_dispatcher_dbus_signal_info_do_not_disturb_changed = {-1, "DoNotDisturbChanged", (GDBusArgInfo **) (&_budgie_notifications_dispatcher_dbus_arg_info_do_not_disturb_changed), NULL};
static const GDBusArgInfo _budgie_notifications_dispatcher_dbus_arg_info_notification_added_app_name = {-1, "app_name", "s", NULL};
static const GDBusArgInfo _budgie_notifications_dispatcher_dbus_arg_info_notification_added_id = {-1, "id", "u", NULL};
static const GDBusArgInfo _budgie_notifications_dispatcher_dbus_arg_info_notification_added_app_icon = {-1, "app_icon", "s", NULL};
static const GDBusArgInfo _budgie_notifications_dispatcher_dbus_arg_info_notification_added_summary = {-1, "summary", "s", NULL};
static const GDBusArgInfo _budgie_notifications_dispatcher_dbus_arg_info_notification_added_body = {-1, "body", "s", NULL};
static const GDBusArgInfo _budgie_notifications_dispatcher_dbus_arg_info_notification_added_actions = {-1, "actions", "as", NULL};
static const GDBusArgInfo _budgie_notifications_dispatcher_dbus_arg_info_notification_added_hints = {-1, "hints", "a{sv}", NULL};
static const GDBusArgInfo _budgie_notifications_dispatcher_dbus_arg_info_notification_added_expire_timeout = {-1, "expire_timeout", "i", NULL};
static const GDBusArgInfo * const _budgie_notifications_dispatcher_dbus_arg_info_notification_added[] = {&_budgie_notifications_dispatcher_dbus_arg_info_notification_added_app_name, &_budgie_notifications_dispatcher_dbus_arg_info_notification_added_id, &_budgie_notifications_dispatcher_dbus_arg_info_notification_added_app_icon, &_budgie_notifications_dispatcher_dbus_arg_info_notification_added_summary, &_budgie_notifications_dispatcher_dbus_arg_info_notification_added_body, &_budgie_notifications_dispatcher_dbus_arg_info_notification_added_actions, &_budgie_notifications_dispatcher_dbus_arg_info_notification_added_hints, &_budgie_notifications_dispatcher_dbus_arg_info_notification_added_expire_timeout, NULL};
static const GDBusSignalInfo _budgie_notifications_dispatcher_dbus_signal_info_notification_added = {-1, "NotificationAdded", (GDBusArgInfo **) (&_budgie_notifications_dispatcher_dbus_arg_info_notification_added), NULL};
static const GDBusArgInfo _budgie_notifications_dispatcher_dbus_arg_info_notification_closed_id = {-1, "id", "u", NULL};
static const GDBusArgInfo _budgie_notifications_dispatcher_dbus_arg_info_notification_closed_app_name = {-1, "app_name", "s", NULL};
static const GDBusArgInfo _budgie_notifications_dispatcher_dbus_arg_info_notification_closed_reason = {-1, "reason", "i", NULL};
static const GDBusArgInfo * const _budgie_notifications_dispatcher_dbus_arg_info_notification_closed[] = {&_budgie_notifications_dispatcher_dbus_arg_info_notification_closed_id, &_budgie_notifications_dispatcher_dbus_arg_info_notification_closed_app_name, &_budgie_notifications_dispatcher_dbus_arg_info_notification_closed_reason, NULL};
static const GDBusSignalInfo _budgie_notifications_dispatcher_dbus_signal_info_notification_closed = {-1, "NotificationClosed", (GDBusArgInfo **) (&_budgie_notifications_dispatcher_dbus_arg_info_notification_closed), NULL};
static const GDBusSignalInfo * const _budgie_notifications_dispatcher_dbus_signal_info[] = {&_budgie_notifications_dispatcher_dbus_signal_info_do_not_disturb_changed, &_budgie_notifications_dispatcher_dbus_signal_info_notification_added, &_budgie_notifications_dispatcher_dbus_signal_info_notification_closed, NULL};
static const GDBusPropertyInfo _budgie_notifications_dispatcher_dbus_property_info_notifications_paused = {-1, "NotificationsPaused", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL};
static const GDBusPropertyInfo * const _budgie_notifications_dispatcher_dbus_property_info[] = {&_budgie_notifications_dispatcher_dbus_property_info_notifications_paused, NULL};
static const GDBusInterfaceInfo _budgie_notifications_dispatcher_dbus_interface_info = {-1, "org.buddiesofbudgie.budgie.Dispatcher", (GDBusMethodInfo **) (&_budgie_notifications_dispatcher_dbus_method_info), (GDBusSignalInfo **) (&_budgie_notifications_dispatcher_dbus_signal_info), (GDBusPropertyInfo **) (&_budgie_notifications_dispatcher_dbus_property_info), NULL};
static const GDBusInterfaceVTable _budgie_notifications_dispatcher_dbus_interface_vtable = {budgie_notifications_dispatcher_dbus_interface_method_call, budgie_notifications_dispatcher_dbus_interface_get_property, budgie_notifications_dispatcher_dbus_interface_set_property};
static const GDBusArgInfo _budgie_notifications_server_dbus_arg_info_GetCapabilities_result = {-1, "result", "as", NULL};
static const GDBusArgInfo * const _budgie_notifications_server_dbus_arg_info_GetCapabilities_in[] = {NULL};
static const GDBusArgInfo * const _budgie_notifications_server_dbus_arg_info_GetCapabilities_out[] = {&_budgie_notifications_server_dbus_arg_info_GetCapabilities_result, NULL};
static const GDBusMethodInfo _budgie_notifications_server_dbus_method_info_GetCapabilities = {-1, "GetCapabilities", (GDBusArgInfo **) (&_budgie_notifications_server_dbus_arg_info_GetCapabilities_in), (GDBusArgInfo **) (&_budgie_notifications_server_dbus_arg_info_GetCapabilities_out), NULL};
static const GDBusArgInfo _budgie_notifications_server_dbus_arg_info_GetServerInformation_name = {-1, "name", "s", NULL};
static const GDBusArgInfo _budgie_notifications_server_dbus_arg_info_GetServerInformation_vendor = {-1, "vendor", "s", NULL};
static const GDBusArgInfo _budgie_notifications_server_dbus_arg_info_GetServerInformation_version = {-1, "version", "s", NULL};
static const GDBusArgInfo _budgie_notifications_server_dbus_arg_info_GetServerInformation_spec_version = {-1, "spec_version", "s", NULL};
static const GDBusArgInfo * const _budgie_notifications_server_dbus_arg_info_GetServerInformation_in[] = {NULL};
static const GDBusArgInfo * const _budgie_notifications_server_dbus_arg_info_GetServerInformation_out[] = {&_budgie_notifications_server_dbus_arg_info_GetServerInformation_name, &_budgie_notifications_server_dbus_arg_info_GetServerInformation_vendor, &_budgie_notifications_server_dbus_arg_info_GetServerInformation_version, &_budgie_notifications_server_dbus_arg_info_GetServerInformation_spec_version, NULL};
static const GDBusMethodInfo _budgie_notifications_server_dbus_method_info_GetServerInformation = {-1, "GetServerInformation", (GDBusArgInfo **) (&_budgie_notifications_server_dbus_arg_info_GetServerInformation_in), (GDBusArgInfo **) (&_budgie_notifications_server_dbus_arg_info_GetServerInformation_out), NULL};
static const GDBusArgInfo _budgie_notifications_server_dbus_arg_info_notification_received_app_name = {-1, "app_name", "s", NULL};
static const GDBusArgInfo _budgie_notifications_server_dbus_arg_info_notification_received_replaces_id = {-1, "replaces_id", "u", NULL};
static const GDBusArgInfo _budgie_notifications_server_dbus_arg_info_notification_received_app_icon = {-1, "app_icon", "s", NULL};
static const GDBusArgInfo _budgie_notifications_server_dbus_arg_info_notification_received_summary = {-1, "summary", "s", NULL};
static const GDBusArgInfo _budgie_notifications_server_dbus_arg_info_notification_received_body = {-1, "body", "s", NULL};
static const GDBusArgInfo _budgie_notifications_server_dbus_arg_info_notification_received_actions = {-1, "actions", "as", NULL};
static const GDBusArgInfo _budgie_notifications_server_dbus_arg_info_notification_received_hints = {-1, "hints", "a{sv}", NULL};
static const GDBusArgInfo _budgie_notifications_server_dbus_arg_info_notification_received_expire_timeout = {-1, "expire_timeout", "i", NULL};
static const GDBusArgInfo _budgie_notifications_server_dbus_arg_info_notification_received_result = {-1, "result", "u", NULL};
static const GDBusArgInfo * const _budgie_notifications_server_dbus_arg_info_notification_received_in[] = {&_budgie_notifications_server_dbus_arg_info_notification_received_app_name, &_budgie_notifications_server_dbus_arg_info_notification_received_replaces_id, &_budgie_notifications_server_dbus_arg_info_notification_received_app_icon, &_budgie_notifications_server_dbus_arg_info_notification_received_summary, &_budgie_notifications_server_dbus_arg_info_notification_received_body, &_budgie_notifications_server_dbus_arg_info_notification_received_actions, &_budgie_notifications_server_dbus_arg_info_notification_received_hints, &_budgie_notifications_server_dbus_arg_info_notification_received_expire_timeout, NULL};
static const GDBusArgInfo * const _budgie_notifications_server_dbus_arg_info_notification_received_out[] = {&_budgie_notifications_server_dbus_arg_info_notification_received_result, NULL};
static const GDBusMethodInfo _budgie_notifications_server_dbus_method_info_notification_received = {-1, "Notify", (GDBusArgInfo **) (&_budgie_notifications_server_dbus_arg_info_notification_received_in), (GDBusArgInfo **) (&_budgie_notifications_server_dbus_arg_info_notification_received_out), NULL};
static const GDBusArgInfo _budgie_notifications_server_dbus_arg_info_CloseNotification_id = {-1, "id", "u", NULL};
static const GDBusArgInfo * const _budgie_notifications_server_dbus_arg_info_CloseNotification_in[] = {&_budgie_notifications_server_dbus_arg_info_CloseNotification_id, NULL};
static const GDBusArgInfo * const _budgie_notifications_server_dbus_arg_info_CloseNotification_out[] = {NULL};
static const GDBusMethodInfo _budgie_notifications_server_dbus_method_info_CloseNotification = {-1, "CloseNotification", (GDBusArgInfo **) (&_budgie_notifications_server_dbus_arg_info_CloseNotification_in), (GDBusArgInfo **) (&_budgie_notifications_server_dbus_arg_info_CloseNotification_out), NULL};
static const GDBusMethodInfo * const _budgie_notifications_server_dbus_method_info[] = {&_budgie_notifications_server_dbus_method_info_GetCapabilities, &_budgie_notifications_server_dbus_method_info_GetServerInformation, &_budgie_notifications_server_dbus_method_info_notification_received, &_budgie_notifications_server_dbus_method_info_CloseNotification, NULL};
static const GDBusArgInfo _budgie_notifications_server_dbus_arg_info_action_invoked_id = {-1, "id", "u", NULL};
static const GDBusArgInfo _budgie_notifications_server_dbus_arg_info_action_invoked_action_key = {-1, "action_key", "s", NULL};
static const GDBusArgInfo * const _budgie_notifications_server_dbus_arg_info_action_invoked[] = {&_budgie_notifications_server_dbus_arg_info_action_invoked_id, &_budgie_notifications_server_dbus_arg_info_action_invoked_action_key, NULL};
static const GDBusSignalInfo _budgie_notifications_server_dbus_signal_info_action_invoked = {-1, "ActionInvoked", (GDBusArgInfo **) (&_budgie_notifications_server_dbus_arg_info_action_invoked), NULL};
static const GDBusArgInfo _budgie_notifications_server_dbus_arg_info_activation_token_id = {-1, "id", "u", NULL};
static const GDBusArgInfo _budgie_notifications_server_dbus_arg_info_activation_token_activation_token = {-1, "activation_token", "s", NULL};
static const GDBusArgInfo * const _budgie_notifications_server_dbus_arg_info_activation_token[] = {&_budgie_notifications_server_dbus_arg_info_activation_token_id, &_budgie_notifications_server_dbus_arg_info_activation_token_activation_token, NULL};
static const GDBusSignalInfo _budgie_notifications_server_dbus_signal_info_activation_token = {-1, "ActivationToken", (GDBusArgInfo **) (&_budgie_notifications_server_dbus_arg_info_activation_token), NULL};
static const GDBusArgInfo _budgie_notifications_server_dbus_arg_info_notification_closed_id = {-1, "id", "u", NULL};
static const GDBusArgInfo _budgie_notifications_server_dbus_arg_info_notification_closed_reason = {-1, "reason", "u", NULL};
static const GDBusArgInfo * const _budgie_notifications_server_dbus_arg_info_notification_closed[] = {&_budgie_notifications_server_dbus_arg_info_notification_closed_id, &_budgie_notifications_server_dbus_arg_info_notification_closed_reason, NULL};
static const GDBusSignalInfo _budgie_notifications_server_dbus_signal_info_notification_closed = {-1, "NotificationClosed", (GDBusArgInfo **) (&_budgie_notifications_server_dbus_arg_info_notification_closed), NULL};
static const GDBusSignalInfo * const _budgie_notifications_server_dbus_signal_info[] = {&_budgie_notifications_server_dbus_signal_info_action_invoked, &_budgie_notifications_server_dbus_signal_info_activation_token, &_budgie_notifications_server_dbus_signal_info_notification_closed, NULL};
static const GDBusPropertyInfo * const _budgie_notifications_server_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _budgie_notifications_server_dbus_interface_info = {-1, "org.freedesktop.Notifications", (GDBusMethodInfo **) (&_budgie_notifications_server_dbus_method_info), (GDBusSignalInfo **) (&_budgie_notifications_server_dbus_signal_info), (GDBusPropertyInfo **) (&_budgie_notifications_server_dbus_property_info), NULL};
static const GDBusInterfaceVTable _budgie_notifications_server_dbus_interface_vtable = {budgie_notifications_server_dbus_interface_method_call, budgie_notifications_server_dbus_interface_get_property, budgie_notifications_server_dbus_interface_set_property};

void
budgie_notifications_raven_proxy_ToggleNotificationsView (BudgieNotificationsRavenProxy* self,
                                                          GAsyncReadyCallback _callback_,
                                                          gpointer _user_data_)
{
	BudgieNotificationsRavenProxyIface* _iface_;
	_iface_ = BUDGIE_NOTIFICATIONS_RAVEN_PROXY_GET_INTERFACE (self);
	if (_iface_->ToggleNotificationsView) {
		_iface_->ToggleNotificationsView (self, _callback_, _user_data_);
	}
}

void
budgie_notifications_raven_proxy_ToggleNotificationsView_finish (BudgieNotificationsRavenProxy* self,
                                                                 GAsyncResult* _res_,
                                                                 GError** error)
{
	BudgieNotificationsRavenProxyIface* _iface_;
	_iface_ = BUDGIE_NOTIFICATIONS_RAVEN_PROXY_GET_INTERFACE (self);
	if (_iface_->ToggleNotificationsView_finish) {
		_iface_->ToggleNotificationsView_finish (self, _res_, error);
	}
}

static void
budgie_notifications_raven_proxy_default_init (BudgieNotificationsRavenProxyIface * iface,
                                               gpointer iface_data)
{
}

static GType
budgie_notifications_raven_proxy_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BudgieNotificationsRavenProxyIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) budgie_notifications_raven_proxy_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType budgie_notifications_raven_proxy_type_id;
	budgie_notifications_raven_proxy_type_id = g_type_register_static (G_TYPE_INTERFACE, "BudgieNotificationsRavenProxy", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (budgie_notifications_raven_proxy_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (budgie_notifications_raven_proxy_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) budgie_notifications_raven_proxy_proxy_get_type);
	g_type_set_qdata (budgie_notifications_raven_proxy_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.budgie_desktop.Raven");
	g_type_set_qdata (budgie_notifications_raven_proxy_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_budgie_notifications_raven_proxy_dbus_interface_info));
	g_type_set_qdata (budgie_notifications_raven_proxy_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) budgie_notifications_raven_proxy_register_object);
	return budgie_notifications_raven_proxy_type_id;
}

GType
budgie_notifications_raven_proxy_get_type (void)
{
	static volatile gsize budgie_notifications_raven_proxy_type_id__once = 0;
	if (g_once_init_enter (&budgie_notifications_raven_proxy_type_id__once)) {
		GType budgie_notifications_raven_proxy_type_id;
		budgie_notifications_raven_proxy_type_id = budgie_notifications_raven_proxy_get_type_once ();
		g_once_init_leave (&budgie_notifications_raven_proxy_type_id__once, budgie_notifications_raven_proxy_type_id);
	}
	return budgie_notifications_raven_proxy_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (BudgieNotificationsRavenProxyProxy, budgie_notifications_raven_proxy_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (BUDGIE_NOTIFICATIONS_TYPE_RAVEN_PROXY, budgie_notifications_raven_proxy_proxy_budgie_notifications_raven_proxy_interface_init) )
static void
budgie_notifications_raven_proxy_proxy_class_init (BudgieNotificationsRavenProxyProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = budgie_notifications_raven_proxy_proxy_g_signal;
}

static void
budgie_notifications_raven_proxy_proxy_g_signal (GDBusProxy* proxy,
                                                 const gchar* sender_name,
                                                 const gchar* signal_name,
                                                 GVariant* parameters)
{
}

static void
budgie_notifications_raven_proxy_proxy_init (BudgieNotificationsRavenProxyProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_budgie_notifications_raven_proxy_dbus_interface_info));
}

static void
_vala_g_async_ready_callback (GObject *source_object,
                              GAsyncResult *res,
                              void *user_data)
{
	g_task_return_pointer (user_data, g_object_ref (res), g_object_unref);
	g_object_unref (user_data);
}

static void
budgie_notifications_raven_proxy_proxy_ToggleNotificationsView_async (BudgieNotificationsRavenProxy* self,
                                                                      GAsyncReadyCallback _callback_,
                                                                      gpointer _user_data_)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.budgie_desktop.Raven", "ToggleNotificationsView");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	if (_callback_ != NULL) {
		g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_task_new ((GObject *) self, NULL, _callback_, _user_data_));
	} else {
		g_dbus_message_set_flags (_message, G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED);
		g_dbus_connection_send_message (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	}
	g_object_unref (_message);
}

static void
budgie_notifications_raven_proxy_proxy_ToggleNotificationsView_finish (BudgieNotificationsRavenProxy* self,
                                                                       GAsyncResult* _res_,
                                                                       GError** error)
{
	GAsyncResult *_inner_res;
	GDBusMessage *_reply_message;
	_inner_res = g_task_propagate_pointer ((GTask *) _res_, NULL);
	_reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), _inner_res, error);
	g_object_unref (_inner_res);
	if (!_reply_message) {
		return;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return;
	}
	g_object_unref (_reply_message);
}

static void
budgie_notifications_raven_proxy_proxy_budgie_notifications_raven_proxy_interface_init (BudgieNotificationsRavenProxyIface* iface)
{
	iface->ToggleNotificationsView = budgie_notifications_raven_proxy_proxy_ToggleNotificationsView_async;
	iface->ToggleNotificationsView_finish = budgie_notifications_raven_proxy_proxy_ToggleNotificationsView_finish;
}

static void
_dbus_budgie_notifications_raven_proxy_ToggleNotificationsView (BudgieNotificationsRavenProxy* self,
                                                                GVariant* _parameters_,
                                                                GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	budgie_notifications_raven_proxy_ToggleNotificationsViewReadyData* _ready_data;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (budgie_notifications_raven_proxy_ToggleNotificationsViewReadyData);
	_ready_data->_invocation_ = invocation;
	budgie_notifications_raven_proxy_ToggleNotificationsView (self, (GAsyncReadyCallback) _dbus_budgie_notifications_raven_proxy_ToggleNotificationsView_ready, _ready_data);
}

static void
_dbus_budgie_notifications_raven_proxy_ToggleNotificationsView_ready (GObject * source_object,
                                                                      GAsyncResult * _res_,
                                                                      gpointer _user_data_)
{
	budgie_notifications_raven_proxy_ToggleNotificationsViewReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	budgie_notifications_raven_proxy_ToggleNotificationsView_finish ((BudgieNotificationsRavenProxy*) source_object, _res_, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	g_slice_free (budgie_notifications_raven_proxy_ToggleNotificationsViewReadyData, _ready_data);
}

static void
budgie_notifications_raven_proxy_dbus_interface_method_call (GDBusConnection* connection,
                                                             const gchar* sender,
                                                             const gchar* object_path,
                                                             const gchar* interface_name,
                                                             const gchar* method_name,
                                                             GVariant* parameters,
                                                             GDBusMethodInvocation* invocation,
                                                             gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (method_name, "ToggleNotificationsView") == 0) {
		_dbus_budgie_notifications_raven_proxy_ToggleNotificationsView (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
budgie_notifications_raven_proxy_dbus_interface_get_property (GDBusConnection* connection,
                                                              const gchar* sender,
                                                              const gchar* object_path,
                                                              const gchar* interface_name,
                                                              const gchar* property_name,
                                                              GError** error,
                                                              gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	return NULL;
}

static gboolean
budgie_notifications_raven_proxy_dbus_interface_set_property (GDBusConnection* connection,
                                                              const gchar* sender,
                                                              const gchar* object_path,
                                                              const gchar* interface_name,
                                                              const gchar* property_name,
                                                              GVariant* value,
                                                              GError** error,
                                                              gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	return FALSE;
}

guint
budgie_notifications_raven_proxy_register_object (gpointer object,
                                                  GDBusConnection* connection,
                                                  const gchar* path,
                                                  GError** error)
{
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = g_object_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_budgie_notifications_raven_proxy_dbus_interface_info), &_budgie_notifications_raven_proxy_dbus_interface_vtable, data, _budgie_notifications_raven_proxy_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}

static void
_budgie_notifications_raven_proxy_unregister_object (gpointer user_data)
{
	gpointer* data;
	data = user_data;
	g_object_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}

static inline gpointer
budgie_notifications_dispatcher_get_instance_private (BudgieNotificationsDispatcher* self)
{
	return G_STRUCT_MEMBER_P (self, BudgieNotificationsDispatcher_private_offset);
}

static void
_budgie_notifications_dispatcher_on_dbus_acquired_gbus_acquired_callback (GDBusConnection* connection,
                                                                          const gchar* name,
                                                                          gpointer self)
{
	budgie_notifications_dispatcher_on_dbus_acquired ((BudgieNotificationsDispatcher*) self, connection);
}

static void
__lambda10_ (BudgieNotificationsDispatcher* self)
{
}

static void
___lambda10__gbus_name_acquired_callback (GDBusConnection* connection,
                                          const gchar* name,
                                          gpointer self)
{
	__lambda10_ ((BudgieNotificationsDispatcher*) self);
}

static void
_budgie_DaemonNameLost_gbus_name_lost_callback (GDBusConnection* connection,
                                                const gchar* name,
                                                gpointer self)
{
	budgie_DaemonNameLost (connection, name);
}

void
budgie_notifications_dispatcher_setup_dbus (BudgieNotificationsDispatcher* self,
                                            gboolean replace)
{
	GBusNameOwnerFlags flags = 0U;
	g_return_if_fail (self != NULL);
	flags = G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT;
	if (replace) {
		flags |= G_BUS_NAME_OWNER_FLAGS_REPLACE;
	}
	g_bus_own_name_with_closures (G_BUS_TYPE_SESSION, BUDGIE_NOTIFICATIONS_NOTIFICATION_DBUS_NAME, flags, (GClosure*) ((_budgie_notifications_dispatcher_on_dbus_acquired_gbus_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) _budgie_notifications_dispatcher_on_dbus_acquired_gbus_acquired_callback, g_object_ref (self), (GClosureNotify) g_object_unref)), (GClosure*) ((___lambda10__gbus_name_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda10__gbus_name_acquired_callback, g_object_ref (self), (GClosureNotify) g_object_unref)), (GClosure*) g_cclosure_new ((GCallback) _budgie_DaemonNameLost_gbus_name_lost_callback, NULL, (GClosureNotify) NULL));
}

static void
budgie_notifications_dispatcher_on_dbus_acquired (BudgieNotificationsDispatcher* self,
                                                  GDBusConnection* conn)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (conn != NULL);
	{
		budgie_notifications_dispatcher_register_object (self, conn, BUDGIE_NOTIFICATIONS_NOTIFICATION_DBUS_OBJECT_PATH, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp0_;
		const gchar* _tmp1_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp0_ = e;
		_tmp1_ = _tmp0_->message;
		g_critical ("dbus.vala:55: Unable to register notification dispatcher: %s", _tmp1_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		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;
	}
}

/**
 * Returns if Do Not Disturb mode is enabled or not.
 */
gboolean
budgie_notifications_dispatcher_get_do_not_disturb (BudgieNotificationsDispatcher* self,
                                                    GError** error)
{
	gboolean _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_dnd;
	result = _tmp0_;
	return result;
}

/**
 * Toggles if Do Not Disturb mode is enabled or not.
 */
void
budgie_notifications_dispatcher_toggle_do_not_disturb (BudgieNotificationsDispatcher* self,
                                                       GError** error)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_dnd;
	budgie_notifications_dispatcher_set_dnd (self, !_tmp0_);
	_tmp1_ = self->priv->_dnd;
	g_signal_emit (self, budgie_notifications_dispatcher_signals[BUDGIE_NOTIFICATIONS_DISPATCHER_DO_NOT_DISTURB_CHANGED_SIGNAL], 0, _tmp1_);
}

BudgieNotificationsDispatcher*
budgie_notifications_dispatcher_construct (GType object_type)
{
	BudgieNotificationsDispatcher * self = NULL;
	self = (BudgieNotificationsDispatcher*) g_object_new (object_type, NULL);
	return self;
}

BudgieNotificationsDispatcher*
budgie_notifications_dispatcher_new (void)
{
	return budgie_notifications_dispatcher_construct (BUDGIE_NOTIFICATIONS_TYPE_DISPATCHER);
}

static gboolean
budgie_notifications_dispatcher_get_dnd (BudgieNotificationsDispatcher* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_dnd;
	return result;
}

static void
budgie_notifications_dispatcher_set_dnd (BudgieNotificationsDispatcher* self,
                                         gboolean value)
{
	g_return_if_fail (self != NULL);
	self->priv->_dnd = value;
}

gboolean
budgie_notifications_dispatcher_get_notifications_paused (BudgieNotificationsDispatcher* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_notifications_paused;
	return result;
}

void
budgie_notifications_dispatcher_set_notifications_paused (BudgieNotificationsDispatcher* self,
                                                          gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = budgie_notifications_dispatcher_get_notifications_paused (self);
	if (old_value != value) {
		self->priv->_notifications_paused = value;
		g_object_notify_by_pspec ((GObject *) self, budgie_notifications_dispatcher_properties[BUDGIE_NOTIFICATIONS_DISPATCHER_NOTIFICATIONS_PAUSED_PROPERTY]);
	}
}

static void
g_cclosure_user_marshal_VOID__STRING_UINT_STRING_STRING_STRING_BOXED_INT_BOXED_INT (GClosure * closure,
                                                                                    GValue * return_value,
                                                                                    guint n_param_values,
                                                                                    const GValue * param_values,
                                                                                    gpointer invocation_hint,
                                                                                    gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__STRING_UINT_STRING_STRING_STRING_BOXED_INT_BOXED_INT) (gpointer data1, const char* arg_1, guint32 arg_2, const char* arg_3, const char* arg_4, const char* arg_5, gpointer arg_6, gint arg_7, gpointer arg_8, gint32 arg_9, gpointer data2);
	register GMarshalFunc_VOID__STRING_UINT_STRING_STRING_STRING_BOXED_INT_BOXED_INT callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 10);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__STRING_UINT_STRING_STRING_STRING_BOXED_INT_BOXED_INT) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_string (param_values + 1), g_value_get_uint (param_values + 2), g_value_get_string (param_values + 3), g_value_get_string (param_values + 4), g_value_get_string (param_values + 5), g_value_get_boxed (param_values + 6), g_value_get_int (param_values + 7), g_value_get_boxed (param_values + 8), g_value_get_int (param_values + 9), data2);
}

static void
g_cclosure_user_marshal_VOID__UINT_STRING_ENUM (GClosure * closure,
                                                GValue * return_value,
                                                guint n_param_values,
                                                const GValue * param_values,
                                                gpointer invocation_hint,
                                                gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__UINT_STRING_ENUM) (gpointer data1, guint32 arg_1, const char* arg_2, gint arg_3, gpointer data2);
	register GMarshalFunc_VOID__UINT_STRING_ENUM callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 4);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__UINT_STRING_ENUM) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_uint (param_values + 1), g_value_get_string (param_values + 2), g_value_get_enum (param_values + 3), data2);
}

static GObject *
budgie_notifications_dispatcher_constructor (GType type,
                                             guint n_construct_properties,
                                             GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	BudgieNotificationsDispatcher * self;
	parent_class = G_OBJECT_CLASS (budgie_notifications_dispatcher_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BUDGIE_NOTIFICATIONS_TYPE_DISPATCHER, BudgieNotificationsDispatcher);
	return obj;
}

static void
budgie_notifications_dispatcher_class_init (BudgieNotificationsDispatcherClass * klass,
                                            gpointer klass_data)
{
	budgie_notifications_dispatcher_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BudgieNotificationsDispatcher_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_budgie_notifications_dispatcher_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_budgie_notifications_dispatcher_set_property;
	G_OBJECT_CLASS (klass)->constructor = budgie_notifications_dispatcher_constructor;
	G_OBJECT_CLASS (klass)->finalize = budgie_notifications_dispatcher_finalize;
	/**
	 * Get or set whether or not notifications should be paused, e.g. when an app enters fullscreen
	 * and Budgie is configured to not show notifications when there is a fullscreen app open.
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), BUDGIE_NOTIFICATIONS_DISPATCHER_NOTIFICATIONS_PAUSED_PROPERTY, budgie_notifications_dispatcher_properties[BUDGIE_NOTIFICATIONS_DISPATCHER_NOTIFICATIONS_PAUSED_PROPERTY] = g_param_spec_boolean ("notifications-paused", "notifications-paused", "notifications-paused", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	 * Signal emitted when Do Not Disturb is toggled.
	 */
	budgie_notifications_dispatcher_signals[BUDGIE_NOTIFICATIONS_DISPATCHER_DO_NOT_DISTURB_CHANGED_SIGNAL] = g_signal_new ("do-not-disturb-changed", BUDGIE_NOTIFICATIONS_TYPE_DISPATCHER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
	/**
	 * Signal emitted when a new notification comes in.
	 *
	 * The id might be a replacement id. It is up to the client to check for this
	 * if they are keeping track of notifications.
	 */
	budgie_notifications_dispatcher_signals[BUDGIE_NOTIFICATIONS_DISPATCHER_NOTIFICATION_ADDED_SIGNAL] = g_signal_new ("notification-added", BUDGIE_NOTIFICATIONS_TYPE_DISPATCHER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_UINT_STRING_STRING_STRING_BOXED_INT_BOXED_INT, G_TYPE_NONE, 9, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRV, G_TYPE_INT, G_TYPE_HASH_TABLE, G_TYPE_INT);
	/**
	 * Signal emitted when a notification is closed.
	 */
	budgie_notifications_dispatcher_signals[BUDGIE_NOTIFICATIONS_DISPATCHER_NOTIFICATION_CLOSED_SIGNAL] = g_signal_new ("notification-closed", BUDGIE_NOTIFICATIONS_TYPE_DISPATCHER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__UINT_STRING_ENUM, G_TYPE_NONE, 3, G_TYPE_UINT, G_TYPE_STRING, BUDGIE_TYPE_NOTIFICATION_CLOSE_REASON);
}

static void
budgie_notifications_dispatcher_instance_init (BudgieNotificationsDispatcher * self,
                                               gpointer klass)
{
	self->priv = budgie_notifications_dispatcher_get_instance_private (self);
	self->priv->_dnd = FALSE;
	self->priv->_notifications_paused = FALSE;
}

static void
budgie_notifications_dispatcher_finalize (GObject * obj)
{
	BudgieNotificationsDispatcher * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BUDGIE_NOTIFICATIONS_TYPE_DISPATCHER, BudgieNotificationsDispatcher);
	G_OBJECT_CLASS (budgie_notifications_dispatcher_parent_class)->finalize (obj);
}

static GType
budgie_notifications_dispatcher_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BudgieNotificationsDispatcherClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) budgie_notifications_dispatcher_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BudgieNotificationsDispatcher), 0, (GInstanceInitFunc) budgie_notifications_dispatcher_instance_init, NULL };
	GType budgie_notifications_dispatcher_type_id;
	budgie_notifications_dispatcher_type_id = g_type_register_static (G_TYPE_OBJECT, "BudgieNotificationsDispatcher", &g_define_type_info, 0);
	g_type_set_qdata (budgie_notifications_dispatcher_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) budgie_notifications_dispatcher_register_object);
	BudgieNotificationsDispatcher_private_offset = g_type_add_instance_private (budgie_notifications_dispatcher_type_id, sizeof (BudgieNotificationsDispatcherPrivate));
	return budgie_notifications_dispatcher_type_id;
}

GType
budgie_notifications_dispatcher_get_type (void)
{
	static volatile gsize budgie_notifications_dispatcher_type_id__once = 0;
	if (g_once_init_enter (&budgie_notifications_dispatcher_type_id__once)) {
		GType budgie_notifications_dispatcher_type_id;
		budgie_notifications_dispatcher_type_id = budgie_notifications_dispatcher_get_type_once ();
		g_once_init_leave (&budgie_notifications_dispatcher_type_id__once, budgie_notifications_dispatcher_type_id);
	}
	return budgie_notifications_dispatcher_type_id__once;
}

static void
_vala_budgie_notifications_dispatcher_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec)
{
	BudgieNotificationsDispatcher * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BUDGIE_NOTIFICATIONS_TYPE_DISPATCHER, BudgieNotificationsDispatcher);
	switch (property_id) {
		case BUDGIE_NOTIFICATIONS_DISPATCHER_NOTIFICATIONS_PAUSED_PROPERTY:
		g_value_set_boolean (value, budgie_notifications_dispatcher_get_notifications_paused (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_budgie_notifications_dispatcher_set_property (GObject * object,
                                                    guint property_id,
                                                    const GValue * value,
                                                    GParamSpec * pspec)
{
	BudgieNotificationsDispatcher * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BUDGIE_NOTIFICATIONS_TYPE_DISPATCHER, BudgieNotificationsDispatcher);
	switch (property_id) {
		case BUDGIE_NOTIFICATIONS_DISPATCHER_NOTIFICATIONS_PAUSED_PROPERTY:
		budgie_notifications_dispatcher_set_notifications_paused (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_dbus_budgie_notifications_dispatcher_get_do_not_disturb (BudgieNotificationsDispatcher* self,
                                                          GVariant* _parameters_,
                                                          GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gboolean result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	result = budgie_notifications_dispatcher_get_do_not_disturb (self, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_boolean (result));
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
_dbus_budgie_notifications_dispatcher_toggle_do_not_disturb (BudgieNotificationsDispatcher* self,
                                                             GVariant* _parameters_,
                                                             GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	budgie_notifications_dispatcher_toggle_do_not_disturb (self, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
budgie_notifications_dispatcher_dbus_interface_method_call (GDBusConnection* connection,
                                                            const gchar* sender,
                                                            const gchar* object_path,
                                                            const gchar* interface_name,
                                                            const gchar* method_name,
                                                            GVariant* parameters,
                                                            GDBusMethodInvocation* invocation,
                                                            gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (method_name, "GetDoNotDisturb") == 0) {
		_dbus_budgie_notifications_dispatcher_get_do_not_disturb (object, parameters, invocation);
	} else if (strcmp (method_name, "ToggleDoNotDisturb") == 0) {
		_dbus_budgie_notifications_dispatcher_toggle_do_not_disturb (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
_dbus_budgie_notifications_dispatcher_get_notifications_paused (BudgieNotificationsDispatcher* self)
{
	gboolean result;
	GVariant* _reply;
	result = budgie_notifications_dispatcher_get_notifications_paused (self);
	_reply = g_variant_new_boolean (result);
	return _reply;
}

static GVariant*
budgie_notifications_dispatcher_dbus_interface_get_property (GDBusConnection* connection,
                                                             const gchar* sender,
                                                             const gchar* object_path,
                                                             const gchar* interface_name,
                                                             const gchar* property_name,
                                                             GError** error,
                                                             gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (property_name, "NotificationsPaused") == 0) {
		return _dbus_budgie_notifications_dispatcher_get_notifications_paused (object);
	}
	return NULL;
}

static void
_dbus_budgie_notifications_dispatcher_set_notifications_paused (BudgieNotificationsDispatcher* self,
                                                                GVariant* _value)
{
	gboolean value = FALSE;
	value = g_variant_get_boolean (_value);
	budgie_notifications_dispatcher_set_notifications_paused (self, value);
}

static gboolean
budgie_notifications_dispatcher_dbus_interface_set_property (GDBusConnection* connection,
                                                             const gchar* sender,
                                                             const gchar* object_path,
                                                             const gchar* interface_name,
                                                             const gchar* property_name,
                                                             GVariant* value,
                                                             GError** error,
                                                             gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (property_name, "NotificationsPaused") == 0) {
		_dbus_budgie_notifications_dispatcher_set_notifications_paused (object, value);
		return TRUE;
	}
	return FALSE;
}

static void
_dbus_budgie_notifications_dispatcher_do_not_disturb_changed (GObject* _sender,
                                                              gboolean value,
                                                              gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_boolean (value));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.buddiesofbudgie.budgie.Dispatcher", "DoNotDisturbChanged", _arguments, NULL);
}

static void
_dbus_budgie_notifications_dispatcher_notification_added (GObject* _sender,
                                                          const gchar* app_name,
                                                          guint32 id,
                                                          const gchar* app_icon,
                                                          const gchar* summary,
                                                          const gchar* body,
                                                          gchar** actions,
                                                          gint actions_length1,
                                                          GHashTable* hints,
                                                          gint32 expire_timeout,
                                                          gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	gchar** _tmp12_;
	GVariantBuilder _tmp13_;
	gint _tmp14_;
	GVariantBuilder _tmp15_;
	GHashTableIter _tmp16_;
	gpointer _tmp17_;
	gpointer _tmp18_;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (app_name));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_uint32 (id));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (app_icon));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (summary));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (body));
	_tmp12_ = actions;
	g_variant_builder_init (&_tmp13_, G_VARIANT_TYPE ("as"));
	for (_tmp14_ = 0; _tmp14_ < actions_length1; _tmp14_++) {
		g_variant_builder_add_value (&_tmp13_, g_variant_new_string (*_tmp12_));
		_tmp12_++;
	}
	g_variant_builder_add_value (&_arguments_builder, g_variant_builder_end (&_tmp13_));
	g_hash_table_iter_init (&_tmp16_, hints);
	g_variant_builder_init (&_tmp15_, G_VARIANT_TYPE ("a{sv}"));
	while (g_hash_table_iter_next (&_tmp16_, &_tmp17_, &_tmp18_)) {
		gchar* _key;
		GVariant* _value;
		_key = (gchar*) _tmp17_;
		_value = (GVariant*) _tmp18_;
		g_variant_builder_add (&_tmp15_, "{?*}", g_variant_new_string (_key), g_variant_new_variant (_value));
	}
	g_variant_builder_add_value (&_arguments_builder, g_variant_builder_end (&_tmp15_));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_int32 (expire_timeout));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.buddiesofbudgie.budgie.Dispatcher", "NotificationAdded", _arguments, NULL);
}

static void
_dbus_budgie_notifications_dispatcher_notification_closed (GObject* _sender,
                                                           guint32 id,
                                                           const gchar* app_name,
                                                           BudgieNotificationCloseReason reason,
                                                           gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_uint32 (id));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (app_name));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_int32 (reason));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.buddiesofbudgie.budgie.Dispatcher", "NotificationClosed", _arguments, NULL);
}

guint
budgie_notifications_dispatcher_register_object (gpointer object,
                                                 GDBusConnection* connection,
                                                 const gchar* path,
                                                 GError** error)
{
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = g_object_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_budgie_notifications_dispatcher_dbus_interface_info), &_budgie_notifications_dispatcher_dbus_interface_vtable, data, _budgie_notifications_dispatcher_unregister_object, error);
	if (!result) {
		return 0;
	}
	g_signal_connect (object, "do-not-disturb-changed", (GCallback) _dbus_budgie_notifications_dispatcher_do_not_disturb_changed, data);
	g_signal_connect (object, "notification-added", (GCallback) _dbus_budgie_notifications_dispatcher_notification_added, data);
	g_signal_connect (object, "notification-closed", (GCallback) _dbus_budgie_notifications_dispatcher_notification_closed, data);
	return result;
}

static void
_budgie_notifications_dispatcher_unregister_object (gpointer user_data)
{
	gpointer* data;
	data = user_data;
	g_signal_handlers_disconnect_by_func (data[0], _dbus_budgie_notifications_dispatcher_do_not_disturb_changed, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_budgie_notifications_dispatcher_notification_added, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_budgie_notifications_dispatcher_notification_closed, data);
	g_object_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}

static inline gpointer
budgie_notifications_server_get_instance_private (BudgieNotificationsServer* self)
{
	return G_STRUCT_MEMBER_P (self, BudgieNotificationsServer_private_offset);
}

static void
_budgie_notifications_server_on_bus_acquired_gbus_acquired_callback (GDBusConnection* connection,
                                                                     const gchar* name,
                                                                     gpointer self)
{
	budgie_notifications_server_on_bus_acquired ((BudgieNotificationsServer*) self, connection);
}

static void
__lambda20_ (BudgieNotificationsServer* self)
{
}

static void
___lambda20__gbus_name_acquired_callback (GDBusConnection* connection,
                                          const gchar* name,
                                          gpointer self)
{
	__lambda20_ ((BudgieNotificationsServer*) self);
}

void
budgie_notifications_server_setup_dbus (BudgieNotificationsServer* self,
                                        gboolean replace)
{
	GBusNameOwnerFlags flags = 0U;
	BudgieNotificationsDispatcher* _tmp0_;
	g_return_if_fail (self != NULL);
	flags = G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT;
	if (replace) {
		flags |= G_BUS_NAME_OWNER_FLAGS_REPLACE;
	}
	g_bus_own_name_with_closures (G_BUS_TYPE_SESSION, "org.freedesktop.Notifications", flags, (GClosure*) ((_budgie_notifications_server_on_bus_acquired_gbus_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) _budgie_notifications_server_on_bus_acquired_gbus_acquired_callback, g_object_ref (self), (GClosureNotify) g_object_unref)), (GClosure*) ((___lambda20__gbus_name_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda20__gbus_name_acquired_callback, g_object_ref (self), (GClosureNotify) g_object_unref)), (GClosure*) g_cclosure_new ((GCallback) _budgie_DaemonNameLost_gbus_name_lost_callback, NULL, (GClosureNotify) NULL));
	_tmp0_ = self->priv->_dispatcher;
	budgie_notifications_dispatcher_setup_dbus (_tmp0_, replace);
}

static void
budgie_notifications_server_on_bus_acquired (BudgieNotificationsServer* self,
                                             GDBusConnection* conn)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (conn != NULL);
	{
		budgie_notifications_server_register_object (self, conn, "/org/freedesktop/Notifications", &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp0_;
		const gchar* _tmp1_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp0_ = e;
		_tmp1_ = _tmp0_->message;
		g_warning ("dbus.vala:156: Unable to register notification DBus: %s", _tmp1_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		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;
	}
}

static void
budgie_notifications_server_on_raven_get (BudgieNotificationsServer* self,
                                          GObject* o,
                                          GAsyncResult* res)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	{
		BudgieNotificationsRavenProxy* _tmp0_ = NULL;
		BudgieNotificationsRavenProxy* _tmp1_;
		BudgieNotificationsRavenProxy* _tmp2_;
		_tmp1_ = g_async_result_get_source_object (res);
		_tmp2_ = (BudgieNotificationsRavenProxy*) g_async_initable_new_finish ((GAsyncInitable *) _tmp1_, res, &_inner_error0_);
		g_object_unref (_tmp1_);
		_tmp0_ = (BudgieNotificationsRavenProxy*) _tmp2_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		budgie_notifications_server_set_raven (self, _tmp0_);
		_g_object_unref0 (_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp3_;
		const gchar* _tmp4_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp3_ = e;
		_tmp4_ = _tmp3_->message;
		g_critical ("dbus.vala:164: Failed to get Raven proxy: %s", _tmp4_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		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;
	}
}

/**
 * Returns the capabilities of this DBus Notification server.
 */
gchar**
budgie_notifications_server_GetCapabilities (BudgieNotificationsServer* self,
                                             gint* result_length1,
                                             GError** error)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar** _tmp5_;
	gchar** _tmp6_;
	gint _tmp6__length1;
	gchar** result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup ("action-icons");
	_tmp1_ = g_strdup ("actions");
	_tmp2_ = g_strdup ("body");
	_tmp3_ = g_strdup ("body-markup");
	_tmp4_ = g_strdup ("sound");
	_tmp5_ = g_new0 (gchar*, 5 + 1);
	_tmp5_[0] = _tmp0_;
	_tmp5_[1] = _tmp1_;
	_tmp5_[2] = _tmp2_;
	_tmp5_[3] = _tmp3_;
	_tmp5_[4] = _tmp4_;
	_tmp6_ = _tmp5_;
	_tmp6__length1 = 5;
	if (result_length1) {
		*result_length1 = _tmp6__length1;
	}
	result = _tmp6_;
	return result;
}

/**
 * Returns the information for this DBus Notification server.
 */
void
budgie_notifications_server_GetServerInformation (BudgieNotificationsServer* self,
                                                  gchar** name,
                                                  gchar** vendor,
                                                  gchar** version,
                                                  gchar** spec_version,
                                                  GError** error)
{
	gchar* _vala_name = NULL;
	gchar* _vala_vendor = NULL;
	gchar* _vala_version = NULL;
	gchar* _vala_spec_version = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup ("Budgie Notification Server");
	_g_free0 (_vala_name);
	_vala_name = _tmp0_;
	_tmp1_ = g_strdup ("Budgie Desktop Developers");
	_g_free0 (_vala_vendor);
	_vala_vendor = _tmp1_;
	_tmp2_ = g_strdup (BUDGIE_VERSION);
	_g_free0 (_vala_version);
	_vala_version = _tmp2_;
	_tmp3_ = g_strdup ("1.2");
	_g_free0 (_vala_spec_version);
	_vala_spec_version = _tmp3_;
	if (name) {
		*name = _vala_name;
	} else {
		_g_free0 (_vala_name);
	}
	if (vendor) {
		*vendor = _vala_vendor;
	} else {
		_g_free0 (_vala_vendor);
	}
	if (version) {
		*version = _vala_version;
	} else {
		_g_free0 (_vala_version);
	}
	if (spec_version) {
		*spec_version = _vala_spec_version;
	} else {
		_g_free0 (_vala_spec_version);
	}
}

/**
 * Handles a notification from DBus.
 *
 * If replaces_id is 0, the return value is a UINT32 that represent the notification.
 * It is unique, and will not be reused unless a MAXINT number of notifications have been generated.
 * An acceptable implementation may just use an incrementing counter for the ID. The returned ID is
 * always greater than zero. Servers must make sure not to return zero as an ID.
 *
 * If replaces_id is not 0, the returned value is the same value as replaces_id.
 */
static Block2Data*
block2_data_ref (Block2Data* _data2_)
{
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}

static void
block2_data_unref (void * _userdata_)
{
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		BudgieNotificationsServer* self;
		self = _data2_->self;
		_g_free0 (_data2_->app_name);
		_g_object_unref0 (self);
		g_slice_free (Block2Data, _data2_);
	}
}

static gpointer
_g_variant_ref0 (gpointer self)
{
	return self ? g_variant_ref (self) : NULL;
}

static gchar*
string_replace (const gchar* self,
                const gchar* old,
                const gchar* replacement)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (old != NULL, NULL);
	g_return_val_if_fail (replacement != NULL, NULL);
	if ((*((gchar*) self)) == '\0') {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = (*((gchar*) old)) == '\0';
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = g_strcmp0 (old, replacement) == 0;
	}
	if (_tmp0_) {
		gchar* _tmp2_;
		_tmp2_ = g_strdup (self);
		result = _tmp2_;
		return result;
	}
	{
		GRegex* regex = NULL;
		gchar* _tmp3_;
		gchar* _tmp4_;
		GRegex* _tmp5_;
		GRegex* _tmp6_;
		gchar* _tmp7_ = NULL;
		GRegex* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		_tmp3_ = g_regex_escape_string (old, -1);
		_tmp4_ = _tmp3_;
		_tmp5_ = g_regex_new (_tmp4_, 0, 0, &_inner_error0_);
		_tmp6_ = _tmp5_;
		_g_free0 (_tmp4_);
		regex = _tmp6_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected 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 NULL;
		}
		_tmp8_ = regex;
		_tmp9_ = g_regex_replace_literal (_tmp8_, self, (gssize) -1, 0, replacement, 0, &_inner_error0_);
		_tmp7_ = _tmp9_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_regex_unref0 (regex);
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected 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 NULL;
		}
		_tmp10_ = _tmp7_;
		_tmp7_ = NULL;
		result = _tmp10_;
		_g_free0 (_tmp7_);
		_g_regex_unref0 (regex);
		return result;
	}
	goto __finally0;
	__catch0_g_regex_error:
	{
		g_clear_error (&_inner_error0_);
		g_assert_not_reached ();
	}
	__finally0:
	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 NULL;
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
	result = _tmp0_ != NULL;
	return result;
}

static void
___lambda23_ (Block2Data* _data2_,
              const gchar* action_key)
{
	BudgieNotificationsServer* self;
	self = _data2_->self;
	g_return_if_fail (action_key != NULL);
	g_signal_emit (self, budgie_notifications_server_signals[BUDGIE_NOTIFICATIONS_SERVER_ACTION_INVOKED_SIGNAL], 0, _data2_->id, action_key);
}

static void
____lambda23__budgie_notifications_popup_action_invoked (BudgieNotificationsPopup* _sender,
                                                         const gchar* action_key,
                                                         gpointer self)
{
	___lambda23_ (self, action_key);
}

static void
___lambda24_ (Block2Data* _data2_,
              BudgieNotificationCloseReason reason)
{
	BudgieNotificationsServer* self;
	gboolean _tmp0_ = FALSE;
	GHashTable* _tmp1_;
	guint _tmp2_;
	guint _tmp3_;
	GHashTable* _tmp5_;
	BudgieNotificationsDispatcher* _tmp6_;
	self = _data2_->self;
	_tmp1_ = self->priv->popups;
	_tmp2_ = g_hash_table_size (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_ == ((guint) 1)) {
		guint32 _tmp4_;
		_tmp4_ = self->priv->_latest_popup_id;
		_tmp0_ = _tmp4_ == _data2_->id;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		budgie_notifications_server_set_latest_popup_id (self, (guint32) 0);
	}
	_tmp5_ = self->priv->popups;
	g_hash_table_remove (_tmp5_, (gpointer) ((guintptr) _data2_->id));
	_tmp6_ = self->priv->_dispatcher;
	g_signal_emit (_tmp6_, budgie_notifications_dispatcher_signals[BUDGIE_NOTIFICATIONS_DISPATCHER_NOTIFICATION_CLOSED_SIGNAL], 0, _data2_->id, _data2_->app_name, reason);
	g_signal_emit (self, budgie_notifications_server_signals[BUDGIE_NOTIFICATIONS_SERVER_NOTIFICATION_CLOSED_SIGNAL], 0, _data2_->id, (guint32) reason);
}

static void
____lambda24__budgie_notifications_popup_base_closed (BudgieNotificationsPopupBase* _sender,
                                                      BudgieNotificationCloseReason reason,
                                                      gpointer self)
{
	___lambda24_ (self, reason);
}

guint32
budgie_notifications_server_notification_received (BudgieNotificationsServer* self,
                                                   const gchar* app_name,
                                                   guint32 replaces_id,
                                                   const gchar* app_icon,
                                                   const gchar* summary,
                                                   const gchar* body,
                                                   gchar** actions,
                                                   gint actions_length1,
                                                   GHashTable* hints,
                                                   gint32 expire_timeout,
                                                   GError** error)
{
	Block2Data* _data2_;
	gchar* _tmp0_;
	guint32 _tmp1_ = 0U;
	gint32 expires = 0;
	BudgieNotification* notification = NULL;
	BudgieNotification* _tmp3_;
	gchar* settings_app_name = NULL;
	gchar* _tmp4_;
	gboolean should_show = FALSE;
	GSettingsSchema* schema = NULL;
	GSettingsSchemaSource* _tmp13_;
	GSettingsSchema* _tmp14_;
	GSettingsSchema* _tmp15_;
	GSettings* app_notification_settings = NULL;
	GSettingsSchema* _tmp16_;
	const gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	GSettings* _tmp20_;
	GSettings* _tmp21_;
	GSettings* _tmp22_;
	gboolean _tmp23_ = FALSE;
	gboolean _tmp24_ = FALSE;
	BudgieNotificationsDispatcher* _tmp25_;
	gboolean should_notify = FALSE;
	gboolean _tmp31_ = FALSE;
	gboolean _tmp32_ = FALSE;
	GSettings* _tmp33_;
	gboolean _tmp42_ = FALSE;
	gboolean show_body_text = FALSE;
	GSettings* _tmp46_;
	gboolean _tmp47_ = FALSE;
	GHashTable* _tmp48_;
	BudgieNotification* _tmp70_;
	GSettings* _tmp71_;
	BudgieNotificationsDispatcher* _tmp72_;
	GError* _inner_error0_ = NULL;
	guint32 result;
	g_return_val_if_fail (self != NULL, 0U);
	g_return_val_if_fail (app_name != NULL, 0U);
	g_return_val_if_fail (app_icon != NULL, 0U);
	g_return_val_if_fail (summary != NULL, 0U);
	g_return_val_if_fail (body != NULL, 0U);
	g_return_val_if_fail (hints != NULL, 0U);
	_data2_ = g_slice_new0 (Block2Data);
	_data2_->_ref_count_ = 1;
	_data2_->self = g_object_ref (self);
	_tmp0_ = g_strdup (app_name);
	_g_free0 (_data2_->app_name);
	_data2_->app_name = _tmp0_;
	if (replaces_id != ((guint32) 0)) {
		_tmp1_ = replaces_id;
	} else {
		guint32 _tmp2_;
		self->priv->notif_id = self->priv->notif_id + 1;
		_tmp2_ = self->priv->notif_id;
		_tmp1_ = _tmp2_;
	}
	_data2_->id = _tmp1_;
	expires = CLAMP (expire_timeout, BUDGIE_NOTIFICATIONS_MINIMUM_EXPIRY, BUDGIE_NOTIFICATIONS_MAXIMUM_EXPIRY);
	_tmp3_ = budgie_notification_new (_data2_->id, _data2_->app_name, app_icon, summary, body, actions, actions_length1, hints, (guint) expires);
	notification = _tmp3_;
	_tmp4_ = g_strdup (_data2_->app_name);
	settings_app_name = _tmp4_;
	should_show = TRUE;
	if (g_hash_table_contains (hints, "desktop-entry")) {
		GVariant* desktop_entry = NULL;
		gconstpointer _tmp5_;
		GVariant* _tmp6_;
		GVariant* _tmp7_;
		_tmp5_ = g_hash_table_lookup (hints, "desktop-entry");
		_tmp6_ = _g_variant_ref0 ((GVariant*) _tmp5_);
		desktop_entry = _tmp6_;
		_tmp7_ = desktop_entry;
		if (_tmp7_ != NULL) {
			GVariant* _tmp8_;
			const gchar* _tmp9_;
			gchar* _tmp10_;
			gchar* _tmp11_;
			gchar* _tmp12_;
			_tmp8_ = desktop_entry;
			_tmp9_ = g_variant_get_string (_tmp8_, NULL);
			_tmp10_ = string_replace (_tmp9_, ".", "-");
			_tmp11_ = _tmp10_;
			_tmp12_ = g_utf8_strdown (_tmp11_, (gssize) -1);
			_g_free0 (settings_app_name);
			settings_app_name = _tmp12_;
			_g_free0 (_tmp11_);
		}
		_g_variant_unref0 (desktop_entry);
	}
	_tmp13_ = g_settings_schema_source_get_default ();
	_tmp14_ = g_settings_schema_source_lookup (_tmp13_, BUDGIE_NOTIFICATIONS_SERVER_APPLICATION_SCHEMA, TRUE);
	schema = _tmp14_;
	_tmp15_ = schema;
	if (_tmp15_ == NULL) {
		g_warning ("dbus.vala:259: Application notification schema '%s' not found", BUDGIE_NOTIFICATIONS_SERVER_APPLICATION_SCHEMA);
		result = _data2_->id;
		_g_settings_schema_unref0 (schema);
		_g_free0 (settings_app_name);
		_g_object_unref0 (notification);
		block2_data_unref (_data2_);
		_data2_ = NULL;
		return result;
	}
	_tmp16_ = schema;
	_tmp17_ = settings_app_name;
	_tmp18_ = g_strdup_printf ("%s/%s/", BUDGIE_NOTIFICATIONS_SERVER_APPLICATION_PREFIX, _tmp17_);
	_tmp19_ = _tmp18_;
	_tmp20_ = g_settings_new_full (_tmp16_, NULL, _tmp19_);
	_tmp21_ = _tmp20_;
	_g_free0 (_tmp19_);
	app_notification_settings = _tmp21_;
	_tmp22_ = app_notification_settings;
	if (!g_settings_get_boolean (_tmp22_, "enable")) {
		result = _data2_->id;
		_g_object_unref0 (app_notification_settings);
		_g_settings_schema_unref0 (schema);
		_g_free0 (settings_app_name);
		_g_object_unref0 (notification);
		block2_data_unref (_data2_);
		_data2_ = NULL;
		return result;
	}
	_tmp25_ = self->priv->_dispatcher;
	_tmp24_ = budgie_notifications_dispatcher_get_do_not_disturb (_tmp25_, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if ((_inner_error0_->domain == G_DBUS_ERROR) || (_inner_error0_->domain == G_IO_ERROR)) {
			guint32 _tmp26_ = 0U;
			g_propagate_error (error, _inner_error0_);
			_g_object_unref0 (app_notification_settings);
			_g_settings_schema_unref0 (schema);
			_g_free0 (settings_app_name);
			_g_object_unref0 (notification);
			block2_data_unref (_data2_);
			_data2_ = NULL;
			return _tmp26_;
		} else {
			guint32 _tmp27_ = 0U;
			_g_object_unref0 (app_notification_settings);
			_g_settings_schema_unref0 (schema);
			_g_free0 (settings_app_name);
			_g_object_unref0 (notification);
			block2_data_unref (_data2_);
			_data2_ = NULL;
			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 _tmp27_;
		}
	}
	if (!_tmp24_) {
		_tmp23_ = TRUE;
	} else {
		BudgieNotification* _tmp28_;
		GNotificationPriority _tmp29_;
		GNotificationPriority _tmp30_;
		_tmp28_ = notification;
		_tmp29_ = budgie_notification_get_urgency (_tmp28_);
		_tmp30_ = _tmp29_;
		_tmp23_ = _tmp30_ == G_NOTIFICATION_PRIORITY_URGENT;
	}
	should_notify = _tmp23_;
	_tmp33_ = app_notification_settings;
	if (g_settings_get_boolean (_tmp33_, "show-banners")) {
		BudgieNotificationsDispatcher* _tmp34_;
		gboolean _tmp35_;
		gboolean _tmp36_;
		_tmp34_ = self->priv->_dispatcher;
		_tmp35_ = budgie_notifications_dispatcher_get_notifications_paused (_tmp34_);
		_tmp36_ = _tmp35_;
		_tmp32_ = !_tmp36_;
	} else {
		_tmp32_ = FALSE;
	}
	if (_tmp32_) {
		gboolean _tmp37_ = FALSE;
		GHashTable* _tmp38_;
		_tmp38_ = self->priv->popups;
		if (g_hash_table_size (_tmp38_) < ((guint) BUDGIE_NOTIFICATIONS_SERVER_MAX_POPUPS_SHOWN)) {
			_tmp37_ = TRUE;
		} else {
			BudgieNotification* _tmp39_;
			GNotificationPriority _tmp40_;
			GNotificationPriority _tmp41_;
			_tmp39_ = notification;
			_tmp40_ = budgie_notification_get_urgency (_tmp39_);
			_tmp41_ = _tmp40_;
			_tmp37_ = _tmp41_ == G_NOTIFICATION_PRIORITY_URGENT;
		}
		_tmp31_ = _tmp37_;
	} else {
		_tmp31_ = FALSE;
	}
	should_show = _tmp31_;
	if (!should_notify) {
		_tmp42_ = TRUE;
	} else {
		_tmp42_ = !should_show;
	}
	if (_tmp42_) {
		gint _tmp43_;
		BudgieNotificationsDispatcher* _tmp44_;
		BudgieNotificationsDispatcher* _tmp45_;
		if (string_contains (_data2_->app_name, "budgie-daemon")) {
			result = _data2_->id;
			_g_object_unref0 (app_notification_settings);
			_g_settings_schema_unref0 (schema);
			_g_free0 (settings_app_name);
			_g_object_unref0 (notification);
			block2_data_unref (_data2_);
			_data2_ = NULL;
			return result;
		}
		_tmp43_ = self->priv->_paused_notifications;
		budgie_notifications_server_set_paused_notifications (self, _tmp43_ + 1);
		_tmp44_ = self->priv->_dispatcher;
		g_signal_emit (_tmp44_, budgie_notifications_dispatcher_signals[BUDGIE_NOTIFICATIONS_DISPATCHER_NOTIFICATION_ADDED_SIGNAL], 0, _data2_->app_name, _data2_->id, app_icon, summary, body, actions, (gint) actions_length1, hints, expire_timeout);
		_tmp45_ = self->priv->_dispatcher;
		g_signal_emit (_tmp45_, budgie_notifications_dispatcher_signals[BUDGIE_NOTIFICATIONS_DISPATCHER_NOTIFICATION_CLOSED_SIGNAL], 0, _data2_->id, _data2_->app_name, BUDGIE_NOTIFICATION_CLOSE_REASON_EXPIRED);
		g_signal_emit (self, budgie_notifications_server_signals[BUDGIE_NOTIFICATIONS_SERVER_NOTIFICATION_CLOSED_SIGNAL], 0, _data2_->id, (guint32) BUDGIE_NOTIFICATION_CLOSE_REASON_EXPIRED);
		result = _data2_->id;
		_g_object_unref0 (app_notification_settings);
		_g_settings_schema_unref0 (schema);
		_g_free0 (settings_app_name);
		_g_object_unref0 (notification);
		block2_data_unref (_data2_);
		_data2_ = NULL;
		return result;
	}
	_tmp46_ = app_notification_settings;
	show_body_text = g_settings_get_boolean (_tmp46_, "force-expanded");
	_tmp48_ = self->priv->popups;
	if (g_hash_table_contains (_tmp48_, (gpointer) ((guintptr) _data2_->id))) {
		GHashTable* _tmp49_;
		gconstpointer _tmp50_;
		_tmp49_ = self->priv->popups;
		_tmp50_ = g_hash_table_lookup (_tmp49_, (gpointer) ((guintptr) _data2_->id));
		_tmp47_ = ((BudgieNotificationsPopup*) _tmp50_) != NULL;
	} else {
		_tmp47_ = FALSE;
	}
	if (_tmp47_) {
		GHashTable* _tmp51_;
		gconstpointer _tmp52_;
		BudgieNotification* _tmp53_;
		_tmp51_ = self->priv->popups;
		_tmp52_ = g_hash_table_lookup (_tmp51_, (gpointer) ((guintptr) _data2_->id));
		_tmp53_ = notification;
		budgie_notifications_popup_replace ((BudgieNotificationsPopup*) _tmp52_, _tmp53_);
	} else {
		GHashTable* _tmp54_;
		BudgieNotification* _tmp55_;
		BudgieNotificationsPopup* _tmp56_;
		GHashTable* _tmp59_;
		gconstpointer _tmp60_;
		GHashTable* _tmp61_;
		gconstpointer _tmp62_;
		BudgieNotification* _tmp63_;
		guint _tmp64_;
		guint _tmp65_;
		GHashTable* _tmp66_;
		gconstpointer _tmp67_;
		GHashTable* _tmp68_;
		gconstpointer _tmp69_;
		_tmp54_ = self->priv->popups;
		_tmp55_ = notification;
		_tmp56_ = budgie_notifications_popup_new (self, _tmp55_);
		g_object_ref_sink (_tmp56_);
		g_hash_table_insert (_tmp54_, (gpointer) ((guintptr) _data2_->id), _tmp56_);
		if (!show_body_text) {
			GHashTable* _tmp57_;
			gconstpointer _tmp58_;
			_tmp57_ = self->priv->popups;
			_tmp58_ = g_hash_table_lookup (_tmp57_, (gpointer) ((guintptr) _data2_->id));
			budgie_notifications_popup_toggle_body_text ((BudgieNotificationsPopup*) _tmp58_);
		}
		_tmp59_ = self->priv->popups;
		_tmp60_ = g_hash_table_lookup (_tmp59_, (gpointer) ((guintptr) _data2_->id));
		budgie_notifications_server_configure_window (self, (BudgieNotificationsPopup*) _tmp60_);
		budgie_notifications_server_set_latest_popup_id (self, _data2_->id);
		_tmp61_ = self->priv->popups;
		_tmp62_ = g_hash_table_lookup (_tmp61_, (gpointer) ((guintptr) _data2_->id));
		_tmp63_ = notification;
		_tmp64_ = budgie_notification_get_expire_timeout (_tmp63_);
		_tmp65_ = _tmp64_;
		budgie_notifications_popup_base_begin_decay ((BudgieNotificationsPopupBase*) ((BudgieNotificationsPopup*) _tmp62_), _tmp65_);
		_tmp66_ = self->priv->popups;
		_tmp67_ = g_hash_table_lookup (_tmp66_, (gpointer) ((guintptr) _data2_->id));
		g_signal_connect_data ((BudgieNotificationsPopup*) _tmp67_, "action-invoked", (GCallback) ____lambda23__budgie_notifications_popup_action_invoked, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
		_tmp68_ = self->priv->popups;
		_tmp69_ = g_hash_table_lookup (_tmp68_, (gpointer) ((guintptr) _data2_->id));
		g_signal_connect_data ((BudgieNotificationsPopupBase*) ((BudgieNotificationsPopup*) _tmp69_), "closed", (GCallback) ____lambda24__budgie_notifications_popup_base_closed, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
	}
	_tmp70_ = notification;
	_tmp71_ = app_notification_settings;
	budgie_notifications_server_maybe_play_sound (self, _tmp70_, should_notify, should_show, _tmp71_);
	_tmp72_ = self->priv->_dispatcher;
	g_signal_emit (_tmp72_, budgie_notifications_dispatcher_signals[BUDGIE_NOTIFICATIONS_DISPATCHER_NOTIFICATION_ADDED_SIGNAL], 0, _data2_->app_name, _data2_->id, app_icon, summary, body, actions, (gint) actions_length1, hints, expire_timeout);
	result = _data2_->id;
	_g_object_unref0 (app_notification_settings);
	_g_settings_schema_unref0 (schema);
	_g_free0 (settings_app_name);
	_g_object_unref0 (notification);
	block2_data_unref (_data2_);
	_data2_ = NULL;
	return result;
}

/**
 * Causes a notification to be forcefully closed and removed from the user's view.
 * It can be used, for example, in the event that what the notification pertains to is no longer relevant,
 * or to cancel a notification with no expiration time.
 *
 * Per the spec, a blank DBusError should be thrown if the notification doesn't exist when this is called.
 * However, this can break notifications from some applications, and other desktop environments don't
 * follow that part of the spec, either. So, return to avoid breaking things.
 */
void
budgie_notifications_server_CloseNotification (BudgieNotificationsServer* self,
                                               guint32 id,
                                               GError** error)
{
	GHashTable* _tmp0_;
	GHashTable* _tmp1_;
	gconstpointer _tmp2_;
	GHashTable* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->popups;
	if (!g_hash_table_contains (_tmp0_, (gpointer) ((guintptr) id))) {
		return;
	}
	_tmp1_ = self->priv->popups;
	_tmp2_ = g_hash_table_lookup (_tmp1_, (gpointer) ((guintptr) id));
	budgie_notifications_popup_base_dismiss ((BudgieNotificationsPopupBase*) ((BudgieNotificationsPopup*) _tmp2_));
	_tmp3_ = self->priv->popups;
	g_hash_table_remove (_tmp3_, (gpointer) ((guintptr) id));
	g_signal_emit (self, budgie_notifications_server_signals[BUDGIE_NOTIFICATIONS_SERVER_NOTIFICATION_CLOSED_SIGNAL], 0, id, (guint32) BUDGIE_NOTIFICATION_CLOSE_REASON_CLOSED);
}

/**
 * Configures the location of a notification popup and makes it visible on the screen.
 */
static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static Block3Data*
block3_data_ref (Block3Data* _data3_)
{
	g_atomic_int_inc (&_data3_->_ref_count_);
	return _data3_;
}

static void
block3_data_unref (void * _userdata_)
{
	Block3Data* _data3_;
	_data3_ = (Block3Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
		BudgieNotificationsServer* self;
		self = _data3_->self;
		_g_object_unref0 (_data3_->wayland_client);
		_g_object_unref0 (_data3_->popup);
		_g_object_unref0 (self);
		g_slice_free (Block3Data, _data3_);
	}
}

static Block4Data*
block4_data_ref (Block4Data* _data4_)
{
	g_atomic_int_inc (&_data4_->_ref_count_);
	return _data4_;
}

static void
block4_data_unref (void * _userdata_)
{
	Block4Data* _data4_;
	_data4_ = (Block4Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data4_->_ref_count_)) {
		BudgieNotificationsServer* self;
		self = _data4_->_data3_->self;
		_g_object_unref0 (_data4_->monitor);
		block3_data_unref (_data4_->_data3_);
		_data4_->_data3_ = NULL;
		g_slice_free (Block4Data, _data4_);
	}
}

static void
__lambda22_ (Block4Data* _data4_,
             GtkAllocation* alloc)
{
	Block3Data* _data3_;
	BudgieNotificationsServer* self;
	GtkWidget* _tmp0_;
	GdkRectangle _tmp1_;
	GdkMonitor* _tmp2_;
	BudgieNotificationPosition pos = 0;
	GSettings* _tmp3_;
	gint edge_a = 0;
	gint edge_b = 0;
	_data3_ = _data4_->_data3_;
	self = _data3_->self;
	g_return_if_fail (alloc != NULL);
	_tmp0_ = gtk_bin_get_child ((GtkBin*) _data3_->popup);
	g_signal_handler_disconnect ((GObject*) _tmp0_, _data4_->handler_id);
	_data4_->handler_id = (gulong) 0;
	_tmp1_ = _data4_->mon_rect;
	budgie_notifications_server_calculate_position (self, _tmp1_.y);
	_tmp2_ = _data4_->monitor;
	gtk_layer_set_monitor ((GtkWindow*) _data3_->popup, _tmp2_);
	_tmp3_ = self->priv->_panel_settings;
	pos = (BudgieNotificationPosition) g_settings_get_enum (_tmp3_, "notification-position");
	switch (pos) {
		case BUDGIE_NOTIFICATION_POSITION_TOP_LEFT:
		{
			edge_a = (gint) GTK_LAYER_SHELL_EDGE_LEFT;
			edge_b = (gint) GTK_LAYER_SHELL_EDGE_TOP;
			break;
		}
		case BUDGIE_NOTIFICATION_POSITION_BOTTOM_LEFT:
		{
			edge_a = (gint) GTK_LAYER_SHELL_EDGE_LEFT;
			edge_b = (gint) GTK_LAYER_SHELL_EDGE_BOTTOM;
			break;
		}
		case BUDGIE_NOTIFICATION_POSITION_BOTTOM_RIGHT:
		{
			edge_a = (gint) GTK_LAYER_SHELL_EDGE_RIGHT;
			edge_b = (gint) GTK_LAYER_SHELL_EDGE_BOTTOM;
			break;
		}
		default:
		case BUDGIE_NOTIFICATION_POSITION_TOP_RIGHT:
		{
			edge_a = (gint) GTK_LAYER_SHELL_EDGE_RIGHT;
			edge_b = (gint) GTK_LAYER_SHELL_EDGE_TOP;
			break;
		}
	}
	gtk_layer_set_margin ((GtkWindow*) _data3_->popup, edge_a, BUDGIE_NOTIFICATIONS_SERVER_BUFFER_ZONE);
	gtk_layer_set_margin ((GtkWindow*) _data3_->popup, edge_b, (gint) self->priv->latest_popup_y);
	gtk_layer_set_anchor ((GtkWindow*) _data3_->popup, edge_a, TRUE);
	gtk_layer_set_anchor ((GtkWindow*) _data3_->popup, edge_b, TRUE);
}

static void
___lambda22__gtk_widget_size_allocate (GtkWidget* _sender,
                                       GtkAllocation* allocation,
                                       gpointer self)
{
	__lambda22_ (self, allocation);
}

static gboolean
__lambda21_ (Block3Data* _data3_)
{
	BudgieNotificationsServer* self;
	Block4Data* _data4_;
	BudgieWaylandClient* _tmp0_;
	GdkRectangle _tmp1_ = {0};
	GdkRectangle _tmp2_;
	BudgieWaylandClient* _tmp3_;
	GdkMonitor* _tmp4_;
	GdkMonitor* _tmp5_;
	GdkMonitor* _tmp6_;
	GdkMonitor* _tmp7_;
	GtkWidget* _tmp8_;
	gulong _tmp9_;
	gboolean result;
	self = _data3_->self;
	_data4_ = g_slice_new0 (Block4Data);
	_data4_->_ref_count_ = 1;
	_data4_->_data3_ = block3_data_ref (_data3_);
	_tmp0_ = _data3_->wayland_client;
	budgie_wayland_client_get_monitor_res (_tmp0_, &_tmp1_);
	_tmp2_ = _tmp1_;
	_data4_->mon_rect = _tmp2_;
	_tmp3_ = _data3_->wayland_client;
	_tmp4_ = budgie_wayland_client_get_gdk_monitor (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = _g_object_ref0 (_tmp5_);
	_data4_->monitor = _tmp6_;
	_tmp7_ = _data4_->monitor;
	if (_tmp7_ == NULL) {
		g_warning ("dbus.vala:383: Monitor is null during window configuration");
		result = FALSE;
		block4_data_unref (_data4_);
		_data4_ = NULL;
		return result;
	}
	gtk_layer_init_for_window ((GtkWindow*) _data3_->popup);
	gtk_layer_set_layer ((GtkWindow*) _data3_->popup, GTK_LAYER_SHELL_LAYER_TOP);
	_data4_->handler_id = (gulong) 0;
	_tmp8_ = gtk_bin_get_child ((GtkBin*) _data3_->popup);
	_tmp9_ = g_signal_connect_data (_tmp8_, "size-allocate", (GCallback) ___lambda22__gtk_widget_size_allocate, block4_data_ref (_data4_), (GClosureNotify) block4_data_unref, 0);
	_data4_->handler_id = _tmp9_;
	gtk_widget_show_all ((GtkWidget*) _data3_->popup);
	result = TRUE;
	block4_data_unref (_data4_);
	_data4_ = NULL;
	return result;
}

static gboolean
___lambda21__budgie_monitor_callback (gpointer self)
{
	gboolean result;
	result = __lambda21_ (self);
	return result;
}

static void
budgie_notifications_server_configure_window (BudgieNotificationsServer* self,
                                              BudgieNotificationsPopup* popup)
{
	Block3Data* _data3_;
	BudgieNotificationsPopup* _tmp0_;
	BudgieWaylandClient* _tmp1_;
	BudgieWaylandClient* _tmp2_;
	gboolean configured = FALSE;
	BudgieWaylandClient* _tmp3_;
	g_return_if_fail (self != NULL);
	_data3_ = g_slice_new0 (Block3Data);
	_data3_->_ref_count_ = 1;
	_data3_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (popup);
	_g_object_unref0 (_data3_->popup);
	_data3_->popup = _tmp0_;
	_tmp1_ = budgie_wayland_client_new ();
	_data3_->wayland_client = _tmp1_;
	_tmp2_ = _data3_->wayland_client;
	if (!budgie_wayland_client_is_initialised (_tmp2_)) {
		g_warning ("dbus.vala:374: Cannot configure notification window: WaylandClient not" \
" initialized");
		block3_data_unref (_data3_);
		_data3_ = NULL;
		return;
	}
	_tmp3_ = _data3_->wayland_client;
	configured = budgie_wayland_client_with_valid_monitor (_tmp3_, ___lambda21__budgie_monitor_callback, block3_data_ref (_data3_), block3_data_unref);
	if (!configured) {
		g_warning ("dbus.vala:432: Failed to configure notification popup window");
	}
	block3_data_unref (_data3_);
	_data3_ = NULL;
}

/**
* Calculate the (y) position of a notification popup based on the setting for where on
* the screen notifications should appear.
*/
static void
budgie_notifications_server_calculate_position (BudgieNotificationsServer* self,
                                                gint monitor_height)
{
	BudgieNotificationPosition pos = 0;
	GSettings* _tmp0_;
	BudgieNotificationsPopup* latest = NULL;
	GHashTable* _tmp1_;
	guint32 _tmp2_;
	gconstpointer _tmp3_;
	BudgieNotificationsPopup* _tmp4_;
	gboolean _tmp5_ = FALSE;
	BudgieNotificationsPopup* _tmp6_;
	gboolean latest_exists = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_panel_settings;
	pos = (BudgieNotificationPosition) g_settings_get_enum (_tmp0_, "notification-position");
	_tmp1_ = self->priv->popups;
	_tmp2_ = self->priv->_latest_popup_id;
	_tmp3_ = g_hash_table_lookup (_tmp1_, (gpointer) ((guintptr) _tmp2_));
	_tmp4_ = _g_object_ref0 ((BudgieNotificationsPopup*) _tmp3_);
	latest = _tmp4_;
	_tmp6_ = latest;
	if (_tmp6_ != NULL) {
		BudgieNotificationsPopup* _tmp7_;
		gboolean _tmp8_;
		gboolean _tmp9_;
		_tmp7_ = latest;
		_tmp8_ = budgie_notifications_popup_base_get_destroying ((BudgieNotificationsPopupBase*) _tmp7_);
		_tmp9_ = _tmp8_;
		_tmp5_ = !_tmp9_;
	} else {
		_tmp5_ = FALSE;
	}
	latest_exists = _tmp5_;
	if (latest_exists) {
		gint existing_height = 0;
		BudgieNotificationsPopup* _tmp10_;
		GtkWidget* _tmp11_;
		_tmp10_ = latest;
		_tmp11_ = gtk_bin_get_child ((GtkBin*) _tmp10_);
		existing_height = gtk_widget_get_allocated_height (_tmp11_);
		self->priv->latest_popup_y = (self->priv->latest_popup_y + existing_height) + BUDGIE_NOTIFICATIONS_SERVER_BUFFER_ZONE;
	} else {
		gboolean _tmp12_ = FALSE;
		if (pos == BUDGIE_NOTIFICATION_POSITION_BOTTOM_LEFT) {
			_tmp12_ = TRUE;
		} else {
			_tmp12_ = pos == BUDGIE_NOTIFICATION_POSITION_BOTTOM_RIGHT;
		}
		if (_tmp12_) {
			self->priv->latest_popup_y = (gint32) BUDGIE_NOTIFICATIONS_SERVER_INITIAL_BUFFER_ZONE;
		} else {
			self->priv->latest_popup_y = (gint32) (monitor_height + BUDGIE_NOTIFICATIONS_SERVER_INITIAL_BUFFER_ZONE);
		}
	}
	_g_object_unref0 (latest);
}

/**
 * Performs a bunch of checks and plays a sound if all checks pass.
 */
static gpointer
_budgie_notifications_sound_player_play_gthread_func (gpointer self)
{
	gpointer result;
	budgie_notifications_sound_player_play ((BudgieNotificationsSoundPlayer*) self);
	result = NULL;
	budgie_notifications_sound_player_unref (self);
	return result;
}

static void
budgie_notifications_server_maybe_play_sound (BudgieNotificationsServer* self,
                                              BudgieNotification* notification,
                                              gboolean notify,
                                              gboolean should_show,
                                              GSettings* settings)
{
	GVariant* variant = NULL;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GHashTable* _tmp2_;
	GHashTable* _tmp3_;
	gconstpointer _tmp4_;
	GVariant* _tmp5_;
	gboolean suppress = FALSE;
	GDesktopAppInfo* _tmp9_;
	GDesktopAppInfo* _tmp10_;
	GDesktopAppInfo* _tmp11_;
	GDesktopAppInfo* _tmp12_;
	gboolean _tmp13_ = FALSE;
	gboolean _tmp14_ = FALSE;
	gchar* sound_name = NULL;
	gchar* _tmp15_;
	GNotificationPriority _tmp16_;
	GNotificationPriority _tmp17_;
	GHashTable* _tmp19_;
	GHashTable* _tmp20_;
	gboolean _tmp29_ = FALSE;
	const gchar* _tmp30_;
	BudgieNotificationsSoundPlayer* player = NULL;
	const gchar* _tmp37_;
	BudgieNotificationsSoundPlayer* _tmp38_;
	BudgieNotificationsSoundPlayer* _tmp39_;
	GThread* _tmp40_;
	GThread* _tmp41_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (notification != NULL);
	g_return_if_fail (settings != NULL);
	variant = NULL;
	_tmp2_ = budgie_notification_get_hints (notification);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_hash_table_lookup (_tmp3_, "suppress-sound");
	variant = (GVariant*) _tmp4_;
	_tmp5_ = variant;
	if (_tmp5_ != NULL) {
		GVariant* _tmp6_;
		const GVariantType* _tmp7_;
		_tmp6_ = variant;
		_tmp7_ = G_VARIANT_TYPE_BOOLEAN;
		_tmp1_ = g_variant_is_of_type (_tmp6_, _tmp7_);
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		GVariant* _tmp8_;
		_tmp8_ = variant;
		_tmp0_ = g_variant_get_boolean (_tmp8_);
	} else {
		_tmp0_ = FALSE;
	}
	suppress = _tmp0_;
	if (suppress) {
		return;
	}
	_tmp9_ = budgie_notification_get_app_info (notification);
	_tmp10_ = _tmp9_;
	if (_tmp10_ == NULL) {
		return;
	}
	_tmp11_ = budgie_notification_get_app_info (notification);
	_tmp12_ = _tmp11_;
	if (!g_desktop_app_info_get_boolean (_tmp12_, "X-GNOME-UsesNotifications")) {
		return;
	}
	if (!g_settings_get_boolean (settings, "enable-sound-alerts")) {
		_tmp14_ = TRUE;
	} else {
		_tmp14_ = !notify;
	}
	if (_tmp14_) {
		_tmp13_ = TRUE;
	} else {
		_tmp13_ = !should_show;
	}
	if (_tmp13_) {
		return;
	}
	_tmp15_ = g_strdup ("dialog-information");
	sound_name = _tmp15_;
	_tmp16_ = budgie_notification_get_urgency (notification);
	_tmp17_ = _tmp16_;
	if (_tmp17_ == G_NOTIFICATION_PRIORITY_URGENT) {
		gchar* _tmp18_;
		_tmp18_ = g_strdup ("dialog-warning");
		_g_free0 (sound_name);
		sound_name = _tmp18_;
	}
	_tmp19_ = budgie_notification_get_hints (notification);
	_tmp20_ = _tmp19_;
	if (g_hash_table_contains (_tmp20_, "sound-name")) {
		GVariant* sound_hint = NULL;
		GHashTable* _tmp21_;
		GHashTable* _tmp22_;
		gconstpointer _tmp23_;
		GVariant* _tmp24_;
		GVariant* _tmp25_;
		_tmp21_ = budgie_notification_get_hints (notification);
		_tmp22_ = _tmp21_;
		_tmp23_ = g_hash_table_lookup (_tmp22_, "sound-name");
		_tmp24_ = _g_variant_ref0 ((GVariant*) _tmp23_);
		sound_hint = _tmp24_;
		_tmp25_ = sound_hint;
		if (_tmp25_ != NULL) {
			GVariant* _tmp26_;
			const gchar* _tmp27_;
			gchar* _tmp28_;
			_tmp26_ = sound_hint;
			_tmp27_ = g_variant_get_string (_tmp26_, NULL);
			_tmp28_ = g_strdup (_tmp27_);
			_g_free0 (sound_name);
			sound_name = _tmp28_;
		}
		_g_variant_unref0 (sound_hint);
	}
	_tmp30_ = sound_name;
	if (g_strcmp0 (_tmp30_, "dialog-information") == 0) {
		const gchar* _tmp31_;
		const gchar* _tmp32_;
		_tmp31_ = budgie_notification_get_category (notification);
		_tmp32_ = _tmp31_;
		_tmp29_ = _tmp32_ != NULL;
	} else {
		_tmp29_ = FALSE;
	}
	if (_tmp29_) {
		const gchar* _tmp33_;
		const gchar* _tmp34_;
		const gchar* _tmp35_;
		gchar* _tmp36_;
		_tmp33_ = budgie_notification_get_category (notification);
		_tmp34_ = _tmp33_;
		_tmp35_ = budgie_notifications_server_get_sound_for_category (self, _tmp34_);
		_tmp36_ = g_strdup (_tmp35_);
		_g_free0 (sound_name);
		sound_name = _tmp36_;
	}
	_tmp37_ = sound_name;
	_tmp38_ = budgie_notifications_sound_player_new (notification, _tmp37_);
	player = _tmp38_;
	_tmp39_ = player;
	_tmp40_ = g_thread_new (NULL, _budgie_notifications_sound_player_play_gthread_func, budgie_notifications_sound_player_ref (_tmp39_));
	_tmp41_ = _tmp40_;
	_g_thread_unref0 (_tmp41_);
	_budgie_notifications_sound_player_unref0 (player);
	_g_free0 (sound_name);
}

/**
 * Gets the sound name to use for a notification category.
 *
 * See categories: https://specifications.freedesktop.org/notification-spec/latest/ar01s06.html
 * See sound naming: https://0pointer.de/public/sound-naming-spec.html#names
 */
static const gchar*
budgie_notifications_server_get_sound_for_category (BudgieNotificationsServer* self,
                                                    const gchar* category)
{
	const gchar* sound = NULL;
	const gchar* _tmp0_;
	GQuark _tmp2_ = 0U;
	static GQuark _tmp1_label0 = 0;
	static GQuark _tmp1_label1 = 0;
	static GQuark _tmp1_label2 = 0;
	static GQuark _tmp1_label3 = 0;
	static GQuark _tmp1_label4 = 0;
	static GQuark _tmp1_label5 = 0;
	static GQuark _tmp1_label6 = 0;
	static GQuark _tmp1_label7 = 0;
	static GQuark _tmp1_label8 = 0;
	static GQuark _tmp1_label9 = 0;
	static GQuark _tmp1_label10 = 0;
	static GQuark _tmp1_label11 = 0;
	static GQuark _tmp1_label12 = 0;
	static GQuark _tmp1_label13 = 0;
	static GQuark _tmp1_label14 = 0;
	const gchar* _tmp3_;
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (category != NULL, NULL);
	sound = NULL;
	_tmp0_ = category;
	_tmp2_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_);
	if (_tmp2_ == ((0 != _tmp1_label0) ? _tmp1_label0 : (_tmp1_label0 = g_quark_from_static_string ("device.added")))) {
		switch (0) {
			default:
			{
				sound = "device-added";
				break;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label1) ? _tmp1_label1 : (_tmp1_label1 = g_quark_from_static_string ("device.removed")))) {
		switch (0) {
			default:
			{
				sound = "device-removed";
				break;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label2) ? _tmp1_label2 : (_tmp1_label2 = g_quark_from_static_string ("email.arrived")))) {
		switch (0) {
			default:
			{
				sound = "message-new-email";
				break;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label3) ? _tmp1_label3 : (_tmp1_label3 = g_quark_from_static_string ("im")))) {
		switch (0) {
			default:
			{
				sound = "message";
				break;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label4) ? _tmp1_label4 : (_tmp1_label4 = g_quark_from_static_string ("im.received")))) {
		switch (0) {
			default:
			{
				sound = "message-new-instant";
				break;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label5) ? _tmp1_label5 : (_tmp1_label5 = g_quark_from_static_string ("network.connected")))) {
		switch (0) {
			default:
			{
				sound = "network-connectivity-established";
				break;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label6) ? _tmp1_label6 : (_tmp1_label6 = g_quark_from_static_string ("network.disconnected")))) {
		switch (0) {
			default:
			{
				sound = "network-connectivity-lost";
				break;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label7) ? _tmp1_label7 : (_tmp1_label7 = g_quark_from_static_string ("presence.online")))) {
		switch (0) {
			default:
			{
				sound = "service-login";
				break;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label8) ? _tmp1_label8 : (_tmp1_label8 = g_quark_from_static_string ("presence.offline")))) {
		switch (0) {
			default:
			{
				sound = "service-logout";
				break;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label9) ? _tmp1_label9 : (_tmp1_label9 = g_quark_from_static_string ("x-gnome-music")))) {
		switch (0) {
			default:
			{
				sound = NULL;
				break;
			}
		}
	} else if (((((_tmp2_ == ((0 != _tmp1_label10) ? _tmp1_label10 : (_tmp1_label10 = g_quark_from_static_string ("device.error")))) || (_tmp2_ == ((0 != _tmp1_label11) ? _tmp1_label11 : (_tmp1_label11 = g_quark_from_static_string ("email.bounced"))))) || (_tmp2_ == ((0 != _tmp1_label12) ? _tmp1_label12 : (_tmp1_label12 = g_quark_from_static_string ("im.error"))))) || (_tmp2_ == ((0 != _tmp1_label13) ? _tmp1_label13 : (_tmp1_label13 = g_quark_from_static_string ("network.error"))))) || (_tmp2_ == ((0 != _tmp1_label14) ? _tmp1_label14 : (_tmp1_label14 = g_quark_from_static_string ("transfer.error"))))) {
		switch (0) {
			default:
			{
				sound = "dialog-error";
				break;
			}
		}
	} else {
		switch (0) {
			default:
			{
				sound = "dialog-information";
				break;
			}
		}
	}
	_tmp3_ = sound;
	result = _tmp3_;
	return result;
}

static void
__lambda26_ (BudgieNotificationsServer* self,
             GObject* obj,
             GAsyncResult* res)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (res != NULL);
	{
		BudgieNotificationsRavenProxy* _tmp0_;
		_tmp0_ = self->priv->_raven;
		budgie_notifications_raven_proxy_ToggleNotificationsView_finish (_tmp0_, res, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp1_;
		const gchar* _tmp2_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp1_ = e;
		_tmp2_ = _tmp1_->message;
		g_warning ("dbus.vala:596: Unable to open Raven notification view: %s", _tmp2_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		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;
	}
}

static void
___lambda26__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda26_ ((BudgieNotificationsServer*) self, source_object, res);
	g_object_unref (self);
}

static void
___lambda25_ (BudgieNotificationsServer* self,
              NotifyNotification* notification,
              const gchar* action)
{
	BudgieNotificationsRavenProxy* _tmp0_;
	g_return_if_fail (notification != NULL);
	g_return_if_fail (action != NULL);
	_tmp0_ = self->priv->_raven;
	budgie_notifications_raven_proxy_ToggleNotificationsView (_tmp0_, ___lambda26__gasync_ready_callback, g_object_ref (self));
}

static void
____lambda25__notify_action_callback (NotifyNotification* notification,
                                      const gchar* action,
                                      gpointer self)
{
	___lambda25_ ((BudgieNotificationsServer*) self, notification, action);
}

static void
___lambda27_ (BudgieNotificationsServer* self)
{
	_g_object_unref0 (self->priv->unpaused_noti);
	self->priv->unpaused_noti = NULL;
}

static void
____lambda27__notify_notification_closed (NotifyNotification* _sender,
                                          gpointer self)
{
	___lambda27_ ((BudgieNotificationsServer*) self);
}

static void*
___lambda28_ (BudgieNotificationsServer* self)
{
	GError* _inner_error0_ = NULL;
	void* result;
	{
		NotifyNotification* _tmp0_;
		_tmp0_ = self->priv->unpaused_noti;
		notify_notification_show (_tmp0_, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp1_;
		const gchar* _tmp2_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp1_ = e;
		_tmp2_ = _tmp1_->message;
		g_critical ("dbus.vala:614: error sending unpause notification: %s", _tmp2_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		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 NULL;
	}
	result = NULL;
	return result;
}

static gpointer
____lambda28__gthread_func (gpointer self)
{
	gpointer result;
	result = ___lambda28_ ((BudgieNotificationsServer*) self);
	g_object_unref (self);
	return result;
}

static void
budgie_notifications_server_on_property_changed (BudgieNotificationsServer* self,
                                                 GParamSpec* p)
{
	const gchar* _tmp0_;
	BudgieNotificationsDispatcher* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	gint _tmp4_;
	gchar* summary = NULL;
	gchar* _tmp5_;
	gchar* body = NULL;
	gint _tmp6_;
	gint _tmp7_;
	gchar* _tmp8_;
	gchar* icon = NULL;
	gchar* _tmp9_;
	NotifyNotification* _tmp10_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (p != NULL);
	_tmp0_ = p->name;
	if (g_strcmp0 (_tmp0_, "notifications-paused") != 0) {
		return;
	}
	_tmp1_ = self->priv->_dispatcher;
	_tmp2_ = budgie_notifications_dispatcher_get_notifications_paused (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_) {
		budgie_notifications_server_set_paused_notifications (self, 0);
		return;
	}
	_tmp4_ = self->priv->_paused_notifications;
	if (_tmp4_ == 0) {
		return;
	}
	_tmp5_ = g_strdup (_ ("Unread Notifications"));
	summary = _tmp5_;
	_tmp6_ = self->priv->_paused_notifications;
	_tmp7_ = self->priv->_paused_notifications;
	_tmp8_ = g_strdup_printf (ngettext ("You received %d notification while an application was fullscreened.", "You received %d notifications while an application was fullscreened.", (gulong) _tmp6_), _tmp7_);
	body = _tmp8_;
	_tmp9_ = g_strdup ("dialog-information");
	icon = _tmp9_;
	_tmp10_ = self->priv->unpaused_noti;
	if (_tmp10_ != NULL) {
		NotifyNotification* _tmp11_;
		const gchar* _tmp12_;
		const gchar* _tmp13_;
		const gchar* _tmp14_;
		_tmp11_ = self->priv->unpaused_noti;
		_tmp12_ = summary;
		_tmp13_ = body;
		_tmp14_ = icon;
		notify_notification_update (_tmp11_, _tmp12_, _tmp13_, _tmp14_);
	} else {
		const gchar* _tmp15_;
		const gchar* _tmp16_;
		const gchar* _tmp17_;
		NotifyNotification* _tmp18_;
		NotifyNotification* _tmp19_;
		NotifyNotification* _tmp20_;
		_tmp15_ = summary;
		_tmp16_ = body;
		_tmp17_ = icon;
		_tmp18_ = notify_notification_new (_tmp15_, _tmp16_, _tmp17_);
		_g_object_unref0 (self->priv->unpaused_noti);
		self->priv->unpaused_noti = _tmp18_;
		_tmp19_ = self->priv->unpaused_noti;
		notify_notification_add_action (_tmp19_, "view-notifications", _ ("View Notifications"), ____lambda25__notify_action_callback, g_object_ref (self), g_object_unref);
		_tmp20_ = self->priv->unpaused_noti;
		g_signal_connect_object (_tmp20_, "closed", (GCallback) ____lambda27__notify_notification_closed, self, 0);
	}
	{
		GThread* _tmp21_;
		GThread* _tmp22_;
		_tmp21_ = g_thread_try_new ("budgie-daemon-notification", ____lambda28__gthread_func, g_object_ref (self), &_inner_error0_);
		_tmp22_ = _tmp21_;
		_g_thread_unref0 (_tmp22_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp23_;
		const gchar* _tmp24_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp23_ = e;
		_tmp24_ = _tmp23_->message;
		g_critical ("dbus.vala:620: Error starting notification thread: %s", _tmp24_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (icon);
		_g_free0 (body);
		_g_free0 (summary);
		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;
	}
	_g_free0 (icon);
	_g_free0 (body);
	_g_free0 (summary);
}

BudgieNotificationsServer*
budgie_notifications_server_construct (GType object_type)
{
	BudgieNotificationsServer * self = NULL;
	self = (BudgieNotificationsServer*) g_object_new (object_type, NULL);
	return self;
}

BudgieNotificationsServer*
budgie_notifications_server_new (void)
{
	return budgie_notifications_server_construct (BUDGIE_NOTIFICATIONS_TYPE_SERVER);
}

static BudgieNotificationsDispatcher*
budgie_notifications_server_get_dispatcher (BudgieNotificationsServer* self)
{
	BudgieNotificationsDispatcher* result;
	BudgieNotificationsDispatcher* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_dispatcher;
	result = _tmp0_;
	return result;
}

static void
budgie_notifications_server_set_dispatcher (BudgieNotificationsServer* self,
                                            BudgieNotificationsDispatcher* value)
{
	BudgieNotificationsDispatcher* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_dispatcher);
	self->priv->_dispatcher = _tmp0_;
}

static BudgieNotificationsRavenProxy*
budgie_notifications_server_get_raven (BudgieNotificationsServer* self)
{
	BudgieNotificationsRavenProxy* result;
	BudgieNotificationsRavenProxy* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_raven;
	result = _tmp0_;
	return result;
}

static void
budgie_notifications_server_set_raven (BudgieNotificationsServer* self,
                                       BudgieNotificationsRavenProxy* value)
{
	BudgieNotificationsRavenProxy* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_raven);
	self->priv->_raven = _tmp0_;
}

static GSettings*
budgie_notifications_server_get_panel_settings (BudgieNotificationsServer* self)
{
	GSettings* result;
	GSettings* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_panel_settings;
	result = _tmp0_;
	return result;
}

static void
budgie_notifications_server_set_panel_settings (BudgieNotificationsServer* self,
                                                GSettings* value)
{
	GSettings* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_panel_settings);
	self->priv->_panel_settings = _tmp0_;
}

static guint32
budgie_notifications_server_get_latest_popup_id (BudgieNotificationsServer* self)
{
	guint32 result;
	g_return_val_if_fail (self != NULL, 0U);
	result = self->priv->_latest_popup_id;
	return result;
}

static void
budgie_notifications_server_set_latest_popup_id (BudgieNotificationsServer* self,
                                                 guint32 value)
{
	g_return_if_fail (self != NULL);
	self->priv->_latest_popup_id = value;
}

static gint
budgie_notifications_server_get_paused_notifications (BudgieNotificationsServer* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_paused_notifications;
	return result;
}

static void
budgie_notifications_server_set_paused_notifications (BudgieNotificationsServer* self,
                                                      gint value)
{
	g_return_if_fail (self != NULL);
	self->priv->_paused_notifications = value;
}

static void
g_cclosure_user_marshal_VOID__UINT_STRING (GClosure * closure,
                                           GValue * return_value,
                                           guint n_param_values,
                                           const GValue * param_values,
                                           gpointer invocation_hint,
                                           gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__UINT_STRING) (gpointer data1, guint32 arg_1, const char* arg_2, gpointer data2);
	register GMarshalFunc_VOID__UINT_STRING callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 3);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__UINT_STRING) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_uint (param_values + 1), g_value_get_string (param_values + 2), data2);
}

static void
g_cclosure_user_marshal_VOID__UINT_UINT (GClosure * closure,
                                         GValue * return_value,
                                         guint n_param_values,
                                         const GValue * param_values,
                                         gpointer invocation_hint,
                                         gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__UINT_UINT) (gpointer data1, guint32 arg_1, guint32 arg_2, gpointer data2);
	register GMarshalFunc_VOID__UINT_UINT callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 3);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__UINT_UINT) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_uint (param_values + 1), g_value_get_uint (param_values + 2), data2);
}

static void
_budgie_notifications_server_on_property_changed_g_object_notify (GObject* _sender,
                                                                  GParamSpec* pspec,
                                                                  gpointer self)
{
	budgie_notifications_server_on_property_changed ((BudgieNotificationsServer*) self, pspec);
}

static void
_budgie_notifications_server_on_raven_get_gasync_ready_callback (GObject* source_object,
                                                                 GAsyncResult* res,
                                                                 gpointer self)
{
	budgie_notifications_server_on_raven_get ((BudgieNotificationsServer*) self, source_object, res);
	g_object_unref (self);
}

static void
_g_object_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}

static GObject *
budgie_notifications_server_constructor (GType type,
                                         guint n_construct_properties,
                                         GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	BudgieNotificationsServer * self;
	BudgieNotificationsDispatcher* _tmp0_;
	BudgieNotificationsDispatcher* _tmp1_;
	BudgieNotificationsDispatcher* _tmp2_;
	GHashFunc _tmp3_;
	GEqualFunc _tmp4_;
	GHashTable* _tmp5_;
	GSettings* _tmp6_;
	GSettings* _tmp7_;
	GError* _inner_error0_ = NULL;
	parent_class = G_OBJECT_CLASS (budgie_notifications_server_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BUDGIE_NOTIFICATIONS_TYPE_SERVER, BudgieNotificationsServer);
	_tmp0_ = budgie_notifications_dispatcher_new ();
	_tmp1_ = _tmp0_;
	budgie_notifications_server_set_dispatcher (self, _tmp1_);
	_g_object_unref0 (_tmp1_);
	_tmp2_ = self->priv->_dispatcher;
	g_signal_connect_object ((GObject*) _tmp2_, "notify", (GCallback) _budgie_notifications_server_on_property_changed_g_object_notify, self, 0);
	g_async_initable_new_async (BUDGIE_NOTIFICATIONS_TYPE_RAVEN_PROXY_PROXY, 0, NULL, _budgie_notifications_server_on_raven_get_gasync_ready_callback, g_object_ref (self), "g-flags", 0, "g-name", BUDGIE_NOTIFICATIONS_RAVEN_DBUS_NAME, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", BUDGIE_NOTIFICATIONS_RAVEN_DBUS_OBJECT_PATH, "g-interface-name", "org.budgie_desktop.Raven", NULL);
	_tmp3_ = g_direct_hash;
	_tmp4_ = g_direct_equal;
	_tmp5_ = g_hash_table_new_full (_tmp3_, _tmp4_, NULL, _g_object_unref0_);
	_g_hash_table_unref0 (self->priv->popups);
	self->priv->popups = _tmp5_;
	_tmp6_ = g_settings_new (BUDGIE_NOTIFICATIONS_SERVER_BUDGIE_PANEL_SCHEMA);
	_tmp7_ = _tmp6_;
	budgie_notifications_server_set_panel_settings (self, _tmp7_);
	_g_object_unref0 (_tmp7_);
	return obj;
}

static void
budgie_notifications_server_class_init (BudgieNotificationsServerClass * klass,
                                        gpointer klass_data)
{
	budgie_notifications_server_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BudgieNotificationsServer_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_budgie_notifications_server_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_budgie_notifications_server_set_property;
	G_OBJECT_CLASS (klass)->constructor = budgie_notifications_server_constructor;
	G_OBJECT_CLASS (klass)->finalize = budgie_notifications_server_finalize;
	/**
	 * Signal emitted when one of the following occurs:
	 *   - When the user performs some global "invoking" action upon a notification.
	 * 	   For instance, clicking somewhere on the notification itself.
	 *   - The user invokes a specific action as specified in the original Notify request.
	 *     For example, clicking on an action button.
	 */
	budgie_notifications_server_signals[BUDGIE_NOTIFICATIONS_SERVER_ACTION_INVOKED_SIGNAL] = g_signal_new ("action-invoked", BUDGIE_NOTIFICATIONS_TYPE_SERVER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__UINT_STRING, G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_STRING);
	/**
	 * This signal can be emitted before a ActionInvoked signal.
	 * It carries an activation token that can be used to activate a toplevel.
	 */
	budgie_notifications_server_signals[BUDGIE_NOTIFICATIONS_SERVER_ACTIVATION_TOKEN_SIGNAL] = g_signal_new ("activation-token", BUDGIE_NOTIFICATIONS_TYPE_SERVER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__UINT_STRING, G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_STRING);
	/**
	 * Signal emitted when a notification is closed.
	 */
	budgie_notifications_server_signals[BUDGIE_NOTIFICATIONS_SERVER_NOTIFICATION_CLOSED_SIGNAL] = g_signal_new ("notification-closed", BUDGIE_NOTIFICATIONS_TYPE_SERVER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__UINT_UINT, G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT);
}

static void
budgie_notifications_server_instance_init (BudgieNotificationsServer * self,
                                           gpointer klass)
{
	self->priv = budgie_notifications_server_get_instance_private (self);
	self->priv->notif_id = (guint32) 0;
	self->priv->_dispatcher = NULL;
	self->priv->_raven = NULL;
	self->priv->_panel_settings = NULL;
	self->priv->_latest_popup_id = (guint32) 0;
	self->priv->_paused_notifications = 0;
	self->priv->unpaused_noti = NULL;
}

static void
budgie_notifications_server_finalize (GObject * obj)
{
	BudgieNotificationsServer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BUDGIE_NOTIFICATIONS_TYPE_SERVER, BudgieNotificationsServer);
	_g_object_unref0 (self->priv->_dispatcher);
	_g_object_unref0 (self->priv->_raven);
	_g_hash_table_unref0 (self->priv->popups);
	_g_object_unref0 (self->priv->_panel_settings);
	_g_object_unref0 (self->priv->unpaused_noti);
	G_OBJECT_CLASS (budgie_notifications_server_parent_class)->finalize (obj);
}

/**
 * This is our implementation of the FreeDesktop Notification spec.
 */
static GType
budgie_notifications_server_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BudgieNotificationsServerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) budgie_notifications_server_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BudgieNotificationsServer), 0, (GInstanceInitFunc) budgie_notifications_server_instance_init, NULL };
	GType budgie_notifications_server_type_id;
	budgie_notifications_server_type_id = g_type_register_static (G_TYPE_OBJECT, "BudgieNotificationsServer", &g_define_type_info, 0);
	g_type_set_qdata (budgie_notifications_server_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) budgie_notifications_server_register_object);
	BudgieNotificationsServer_private_offset = g_type_add_instance_private (budgie_notifications_server_type_id, sizeof (BudgieNotificationsServerPrivate));
	return budgie_notifications_server_type_id;
}

GType
budgie_notifications_server_get_type (void)
{
	static volatile gsize budgie_notifications_server_type_id__once = 0;
	if (g_once_init_enter (&budgie_notifications_server_type_id__once)) {
		GType budgie_notifications_server_type_id;
		budgie_notifications_server_type_id = budgie_notifications_server_get_type_once ();
		g_once_init_leave (&budgie_notifications_server_type_id__once, budgie_notifications_server_type_id);
	}
	return budgie_notifications_server_type_id__once;
}

static void
_vala_budgie_notifications_server_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec)
{
	BudgieNotificationsServer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BUDGIE_NOTIFICATIONS_TYPE_SERVER, BudgieNotificationsServer);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_budgie_notifications_server_set_property (GObject * object,
                                                guint property_id,
                                                const GValue * value,
                                                GParamSpec * pspec)
{
	BudgieNotificationsServer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BUDGIE_NOTIFICATIONS_TYPE_SERVER, BudgieNotificationsServer);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_dbus_budgie_notifications_server_GetCapabilities (BudgieNotificationsServer* self,
                                                   GVariant* _parameters_,
                                                   GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gchar** result;
	gint result_length1 = 0;
	gchar** _tmp19_;
	GVariantBuilder _tmp20_;
	gint _tmp21_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	result = budgie_notifications_server_GetCapabilities (self, &result_length1, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_tmp19_ = result;
	g_variant_builder_init (&_tmp20_, G_VARIANT_TYPE ("as"));
	for (_tmp21_ = 0; _tmp21_ < result_length1; _tmp21_++) {
		g_variant_builder_add_value (&_tmp20_, g_variant_new_string (*_tmp19_));
		_tmp19_++;
	}
	g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp20_));
	result = (_vala_array_free (result, result_length1, (GDestroyNotify) g_free), NULL);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
_dbus_budgie_notifications_server_GetServerInformation (BudgieNotificationsServer* self,
                                                        GVariant* _parameters_,
                                                        GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gchar* name = NULL;
	gchar* vendor = NULL;
	gchar* version = NULL;
	gchar* spec_version = NULL;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	budgie_notifications_server_GetServerInformation (self, &name, &vendor, &version, &spec_version, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_string (name));
	g_variant_builder_add_value (&_reply_builder, g_variant_new_string (vendor));
	g_variant_builder_add_value (&_reply_builder, g_variant_new_string (version));
	g_variant_builder_add_value (&_reply_builder, g_variant_new_string (spec_version));
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_g_free0 (name);
	_g_free0 (vendor);
	_g_free0 (version);
	_g_free0 (spec_version);
}

static void
_dbus_budgie_notifications_server_notification_received (BudgieNotificationsServer* self,
                                                         GVariant* _parameters_,
                                                         GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gchar* app_name = NULL;
	GVariant* _tmp22_;
	guint32 replaces_id = 0U;
	GVariant* _tmp23_;
	gchar* app_icon = NULL;
	GVariant* _tmp24_;
	gchar* summary = NULL;
	GVariant* _tmp25_;
	gchar* body = NULL;
	GVariant* _tmp26_;
	gchar** actions = NULL;
	gint actions_length1 = 0;
	GVariant* _tmp27_;
	gchar** _tmp28_;
	gint _tmp28__length;
	gint _tmp28__size;
	gint _tmp28__length1;
	GVariantIter _tmp29_;
	GVariant* _tmp30_;
	GHashTable* hints = NULL;
	GVariant* _tmp31_;
	GHashTable* _tmp32_;
	GVariantIter _tmp33_;
	GVariant* _tmp34_;
	GVariant* _tmp35_;
	gint32 expire_timeout = 0;
	GVariant* _tmp36_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	guint32 result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp22_ = g_variant_iter_next_value (&_arguments_iter);
	app_name = g_variant_dup_string (_tmp22_, NULL);
	g_variant_unref (_tmp22_);
	_tmp23_ = g_variant_iter_next_value (&_arguments_iter);
	replaces_id = g_variant_get_uint32 (_tmp23_);
	g_variant_unref (_tmp23_);
	_tmp24_ = g_variant_iter_next_value (&_arguments_iter);
	app_icon = g_variant_dup_string (_tmp24_, NULL);
	g_variant_unref (_tmp24_);
	_tmp25_ = g_variant_iter_next_value (&_arguments_iter);
	summary = g_variant_dup_string (_tmp25_, NULL);
	g_variant_unref (_tmp25_);
	_tmp26_ = g_variant_iter_next_value (&_arguments_iter);
	body = g_variant_dup_string (_tmp26_, NULL);
	g_variant_unref (_tmp26_);
	_tmp27_ = g_variant_iter_next_value (&_arguments_iter);
	_tmp28_ = g_new (gchar*, 5);
	_tmp28__length = 0;
	_tmp28__size = 4;
	_tmp28__length1 = 0;
	g_variant_iter_init (&_tmp29_, _tmp27_);
	for (; (_tmp30_ = g_variant_iter_next_value (&_tmp29_)) != NULL; _tmp28__length1++) {
		if (_tmp28__size == _tmp28__length) {
			_tmp28__size = 2 * _tmp28__size;
			_tmp28_ = g_renew (gchar*, _tmp28_, _tmp28__size + 1);
		}
		_tmp28_[_tmp28__length++] = g_variant_dup_string (_tmp30_, NULL);
		g_variant_unref (_tmp30_);
	}
	actions_length1 = _tmp28__length1;
	_tmp28_[_tmp28__length] = NULL;
	actions = _tmp28_;
	g_variant_unref (_tmp27_);
	_tmp31_ = g_variant_iter_next_value (&_arguments_iter);
	_tmp32_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_variant_unref);
	g_variant_iter_init (&_tmp33_, _tmp31_);
	while (g_variant_iter_loop (&_tmp33_, "{?*}", &_tmp34_, &_tmp35_)) {
		g_hash_table_insert (_tmp32_, g_variant_dup_string (_tmp34_, NULL), g_variant_get_variant (_tmp35_));
	}
	hints = _tmp32_;
	g_variant_unref (_tmp31_);
	_tmp36_ = g_variant_iter_next_value (&_arguments_iter);
	expire_timeout = g_variant_get_int32 (_tmp36_);
	g_variant_unref (_tmp36_);
	result = budgie_notifications_server_notification_received (self, app_name, replaces_id, app_icon, summary, body, actions, actions_length1, hints, expire_timeout, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_uint32 (result));
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	_g_free0 (app_name);
	_g_free0 (app_icon);
	_g_free0 (summary);
	_g_free0 (body);
	actions = (_vala_array_free (actions, actions_length1, (GDestroyNotify) g_free), NULL);
	_g_hash_table_unref0 (hints);
	;
}

static void
_dbus_budgie_notifications_server_CloseNotification (BudgieNotificationsServer* self,
                                                     GVariant* _parameters_,
                                                     GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	guint32 id = 0U;
	GVariant* _tmp37_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp37_ = g_variant_iter_next_value (&_arguments_iter);
	id = g_variant_get_uint32 (_tmp37_);
	g_variant_unref (_tmp37_);
	budgie_notifications_server_CloseNotification (self, id, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
budgie_notifications_server_dbus_interface_method_call (GDBusConnection* connection,
                                                        const gchar* sender,
                                                        const gchar* object_path,
                                                        const gchar* interface_name,
                                                        const gchar* method_name,
                                                        GVariant* parameters,
                                                        GDBusMethodInvocation* invocation,
                                                        gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (method_name, "GetCapabilities") == 0) {
		_dbus_budgie_notifications_server_GetCapabilities (object, parameters, invocation);
	} else if (strcmp (method_name, "GetServerInformation") == 0) {
		_dbus_budgie_notifications_server_GetServerInformation (object, parameters, invocation);
	} else if (strcmp (method_name, "Notify") == 0) {
		_dbus_budgie_notifications_server_notification_received (object, parameters, invocation);
	} else if (strcmp (method_name, "CloseNotification") == 0) {
		_dbus_budgie_notifications_server_CloseNotification (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
budgie_notifications_server_dbus_interface_get_property (GDBusConnection* connection,
                                                         const gchar* sender,
                                                         const gchar* object_path,
                                                         const gchar* interface_name,
                                                         const gchar* property_name,
                                                         GError** error,
                                                         gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	return NULL;
}

static gboolean
budgie_notifications_server_dbus_interface_set_property (GDBusConnection* connection,
                                                         const gchar* sender,
                                                         const gchar* object_path,
                                                         const gchar* interface_name,
                                                         const gchar* property_name,
                                                         GVariant* value,
                                                         GError** error,
                                                         gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	return FALSE;
}

static void
_dbus_budgie_notifications_server_action_invoked (GObject* _sender,
                                                  guint32 id,
                                                  const gchar* action_key,
                                                  gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_uint32 (id));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (action_key));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.freedesktop.Notifications", "ActionInvoked", _arguments, NULL);
}

static void
_dbus_budgie_notifications_server_activation_token (GObject* _sender,
                                                    guint32 id,
                                                    const gchar* activation_token,
                                                    gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_uint32 (id));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (activation_token));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.freedesktop.Notifications", "ActivationToken", _arguments, NULL);
}

static void
_dbus_budgie_notifications_server_notification_closed (GObject* _sender,
                                                       guint32 id,
                                                       guint32 reason,
                                                       gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_uint32 (id));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_uint32 (reason));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.freedesktop.Notifications", "NotificationClosed", _arguments, NULL);
}

guint
budgie_notifications_server_register_object (gpointer object,
                                             GDBusConnection* connection,
                                             const gchar* path,
                                             GError** error)
{
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = g_object_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_budgie_notifications_server_dbus_interface_info), &_budgie_notifications_server_dbus_interface_vtable, data, _budgie_notifications_server_unregister_object, error);
	if (!result) {
		return 0;
	}
	g_signal_connect (object, "action-invoked", (GCallback) _dbus_budgie_notifications_server_action_invoked, data);
	g_signal_connect (object, "activation-token", (GCallback) _dbus_budgie_notifications_server_activation_token, data);
	g_signal_connect (object, "notification-closed", (GCallback) _dbus_budgie_notifications_server_notification_closed, data);
	return result;
}

static void
_budgie_notifications_server_unregister_object (gpointer user_data)
{
	gpointer* data;
	data = user_data;
	g_signal_handlers_disconnect_by_func (data[0], _dbus_budgie_notifications_server_action_invoked, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_budgie_notifications_server_activation_token, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_budgie_notifications_server_notification_closed, data);
	g_object_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}

static inline gpointer
budgie_notifications_sound_player_get_instance_private (BudgieNotificationsSoundPlayer* self)
{
	return G_STRUCT_MEMBER_P (self, BudgieNotificationsSoundPlayer_private_offset);
}

BudgieNotificationsSoundPlayer*
budgie_notifications_sound_player_construct (GType object_type,
                                             BudgieNotification* notification,
                                             const gchar* sound_name)
{
	BudgieNotificationsSoundPlayer* self = NULL;
	BudgieNotification* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (notification != NULL, NULL);
	self = (BudgieNotificationsSoundPlayer*) g_type_create_instance (object_type);
	_tmp0_ = _g_object_ref0 (notification);
	_g_object_unref0 (self->priv->notification);
	self->priv->notification = _tmp0_;
	_tmp1_ = g_strdup (sound_name);
	_g_free0 (self->priv->sound_name);
	self->priv->sound_name = _tmp1_;
	return self;
}

BudgieNotificationsSoundPlayer*
budgie_notifications_sound_player_new (BudgieNotification* notification,
                                       const gchar* sound_name)
{
	return budgie_notifications_sound_player_construct (BUDGIE_NOTIFICATIONS_TYPE_SOUND_PLAYER, notification, sound_name);
}

void
budgie_notifications_sound_player_play (BudgieNotificationsSoundPlayer* self)
{
	const gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->sound_name;
	if (_tmp0_ != NULL) {
		ca_proplist* props = NULL;
		ca_proplist* _tmp1_ = NULL;
		ca_proplist* _tmp2_;
		ca_proplist* _tmp3_;
		const gchar* _tmp4_;
		ca_context* _tmp5_;
		ca_proplist* _tmp6_;
		ca_proplist_create (&_tmp1_);
		_ca_proplist_destroy0 (props);
		props = _tmp1_;
		_tmp2_ = props;
		ca_proplist_sets (_tmp2_, CA_PROP_CANBERRA_CACHE_CONTROL, "volatile");
		_tmp3_ = props;
		_tmp4_ = self->priv->sound_name;
		ca_proplist_sets (_tmp3_, CA_PROP_EVENT_ID, _tmp4_);
		_tmp5_ = ca_gtk_context_get ();
		_tmp6_ = props;
		ca_context_play_full (_tmp5_, (guint32) 0, _tmp6_, NULL, NULL);
		_ca_proplist_destroy0 (props);
	}
}

static void
budgie_notifications_value_sound_player_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
budgie_notifications_value_sound_player_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		budgie_notifications_sound_player_unref (value->data[0].v_pointer);
	}
}

static void
budgie_notifications_value_sound_player_copy_value (const GValue* src_value,
                                                    GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = budgie_notifications_sound_player_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
budgie_notifications_value_sound_player_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
budgie_notifications_value_sound_player_collect_value (GValue* value,
                                                       guint n_collect_values,
                                                       GTypeCValue* collect_values,
                                                       guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		BudgieNotificationsSoundPlayer * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = budgie_notifications_sound_player_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
budgie_notifications_value_sound_player_lcopy_value (const GValue* value,
                                                     guint n_collect_values,
                                                     GTypeCValue* collect_values,
                                                     guint collect_flags)
{
	BudgieNotificationsSoundPlayer ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = budgie_notifications_sound_player_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
budgie_notifications_param_spec_sound_player (const gchar* name,
                                              const gchar* nick,
                                              const gchar* blurb,
                                              GType object_type,
                                              GParamFlags flags)
{
	BudgieNotificationsParamSpecSoundPlayer* spec;
	g_return_val_if_fail (g_type_is_a (object_type, BUDGIE_NOTIFICATIONS_TYPE_SOUND_PLAYER), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

gpointer
budgie_notifications_value_get_sound_player (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, BUDGIE_NOTIFICATIONS_TYPE_SOUND_PLAYER), NULL);
	return value->data[0].v_pointer;
}

void
budgie_notifications_value_set_sound_player (GValue* value,
                                             gpointer v_object)
{
	BudgieNotificationsSoundPlayer * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, BUDGIE_NOTIFICATIONS_TYPE_SOUND_PLAYER));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, BUDGIE_NOTIFICATIONS_TYPE_SOUND_PLAYER));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		budgie_notifications_sound_player_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		budgie_notifications_sound_player_unref (old);
	}
}

void
budgie_notifications_value_take_sound_player (GValue* value,
                                              gpointer v_object)
{
	BudgieNotificationsSoundPlayer * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, BUDGIE_NOTIFICATIONS_TYPE_SOUND_PLAYER));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, BUDGIE_NOTIFICATIONS_TYPE_SOUND_PLAYER));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		budgie_notifications_sound_player_unref (old);
	}
}

static void
budgie_notifications_sound_player_class_init (BudgieNotificationsSoundPlayerClass * klass,
                                              gpointer klass_data)
{
	budgie_notifications_sound_player_parent_class = g_type_class_peek_parent (klass);
	((BudgieNotificationsSoundPlayerClass *) klass)->finalize = budgie_notifications_sound_player_finalize;
	g_type_class_adjust_private_offset (klass, &BudgieNotificationsSoundPlayer_private_offset);
}

static void
budgie_notifications_sound_player_instance_init (BudgieNotificationsSoundPlayer * self,
                                                 gpointer klass)
{
	self->priv = budgie_notifications_sound_player_get_instance_private (self);
	self->ref_count = 1;
}

static void
budgie_notifications_sound_player_finalize (BudgieNotificationsSoundPlayer * obj)
{
	BudgieNotificationsSoundPlayer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BUDGIE_NOTIFICATIONS_TYPE_SOUND_PLAYER, BudgieNotificationsSoundPlayer);
	g_signal_handlers_destroy (self);
	_g_object_unref0 (self->priv->notification);
	_g_free0 (self->priv->sound_name);
}

static GType
budgie_notifications_sound_player_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { budgie_notifications_value_sound_player_init, budgie_notifications_value_sound_player_free_value, budgie_notifications_value_sound_player_copy_value, budgie_notifications_value_sound_player_peek_pointer, "p", budgie_notifications_value_sound_player_collect_value, "p", budgie_notifications_value_sound_player_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (BudgieNotificationsSoundPlayerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) budgie_notifications_sound_player_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BudgieNotificationsSoundPlayer), 0, (GInstanceInitFunc) budgie_notifications_sound_player_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType budgie_notifications_sound_player_type_id;
	budgie_notifications_sound_player_type_id = g_type_register_fundamental (g_type_fundamental_next (), "BudgieNotificationsSoundPlayer", &g_define_type_info, &g_define_type_fundamental_info, 0);
	BudgieNotificationsSoundPlayer_private_offset = g_type_add_instance_private (budgie_notifications_sound_player_type_id, sizeof (BudgieNotificationsSoundPlayerPrivate));
	return budgie_notifications_sound_player_type_id;
}

GType
budgie_notifications_sound_player_get_type (void)
{
	static volatile gsize budgie_notifications_sound_player_type_id__once = 0;
	if (g_once_init_enter (&budgie_notifications_sound_player_type_id__once)) {
		GType budgie_notifications_sound_player_type_id;
		budgie_notifications_sound_player_type_id = budgie_notifications_sound_player_get_type_once ();
		g_once_init_leave (&budgie_notifications_sound_player_type_id__once, budgie_notifications_sound_player_type_id);
	}
	return budgie_notifications_sound_player_type_id__once;
}

gpointer
budgie_notifications_sound_player_ref (gpointer instance)
{
	BudgieNotificationsSoundPlayer * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

void
budgie_notifications_sound_player_unref (gpointer instance)
{
	BudgieNotificationsSoundPlayer * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		BUDGIE_NOTIFICATIONS_SOUND_PLAYER_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

