/* notification-backend-provider.c generated by valac 0.56.19, the Vala compiler
 * generated from notification-backend-provider.vala, do not modify */

/*
 * Copyright (c) 2024-2026 focus-timer contributors
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <config.h>
#include "ft_core.h"
#include "ft_plugin_freedesktop.h"
#include <gio/gio.h>
#include <glib-object.h>

#define FREEDESKTOP_NOTIFICATION_BACKEND_PROVIDER_DEFAULT_EXPIRY -1
#define FREEDESKTOP_NOTIFICATION_BACKEND_PROVIDER_NO_EXPIRY 0
#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

typedef struct _FreedesktopNotificationInfo FreedesktopNotificationInfo;
#define _ft_notification_unref0(var) ((var == NULL) ? NULL : (var = (ft_notification_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	FREEDESKTOP_NOTIFICATION_BACKEND_PROVIDER_0_PROPERTY,
	FREEDESKTOP_NOTIFICATION_BACKEND_PROVIDER_NUM_PROPERTIES
};
static GParamSpec* freedesktop_notification_backend_provider_properties[FREEDESKTOP_NOTIFICATION_BACKEND_PROVIDER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _FreedesktopNotificationBackendProviderInitializeData FreedesktopNotificationBackendProviderInitializeData;
typedef struct _FreedesktopNotificationBackendProviderUninitializeData FreedesktopNotificationBackendProviderUninitializeData;
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _FreedesktopNotificationBackendProviderEnableData FreedesktopNotificationBackendProviderEnableData;
typedef struct _FreedesktopNotificationBackendProviderDisableData FreedesktopNotificationBackendProviderDisableData;
#define _g_variant_type_free0(var) ((var == NULL) ? NULL : (var = (g_variant_type_free (var), NULL)))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
typedef struct _FreedesktopNotificationBackendProviderWithdrawNotificationInternalData FreedesktopNotificationBackendProviderWithdrawNotificationInternalData;
typedef struct _Block1Data Block1Data;
#define _freedesktop_notification_info_free0(var) ((var == NULL) ? NULL : (var = (freedesktop_notification_info_free (var), NULL)))
typedef struct _FreedesktopNotificationBackendProviderSendNotificationData FreedesktopNotificationBackendProviderSendNotificationData;
typedef struct _FreedesktopNotificationBackendProviderWithdrawNotificationData FreedesktopNotificationBackendProviderWithdrawNotificationData;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _FreedesktopNotificationInfo {
	FtNotification* notification;
	gchar* id;
	guint32 external_id;
};

struct _FreedesktopNotificationBackendProviderPrivate {
	gboolean has_actions;
	gboolean has_persistence;
	gboolean has_default_action;
	guint watcher_id;
	FreedesktopNotifications* proxy;
	GSList* notifications;
	GCancellable* cancellable;
	GApplication* application;
	gchar* application_name;
	gchar* application_icon;
};

struct _FreedesktopNotificationBackendProviderInitializeData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	FreedesktopNotificationBackendProvider* self;
	GCancellable* cancellable;
};

struct _FreedesktopNotificationBackendProviderUninitializeData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	FreedesktopNotificationBackendProvider* self;
};

struct _FreedesktopNotificationBackendProviderEnableData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	FreedesktopNotificationBackendProvider* self;
	GCancellable* cancellable;
	GCancellable* _tmp0_;
	GCancellable* _tmp1_;
	GCancellable* _tmp2_;
	GCancellable* _tmp3_;
	gchar* name;
	gchar* vendor;
	gchar* version;
	gchar* spec_version;
	FreedesktopNotifications* proxy;
	GCancellable* _tmp4_;
	FreedesktopNotifications* _tmp5_;
	FreedesktopNotifications* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar** capabilities_strv;
	FreedesktopNotifications* _tmp11_;
	gint _tmp12_;
	gchar** _tmp13_;
	gint capabilities_strv_length1;
	gint _capabilities_strv_size_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	const gchar* _tmp16_;
	const gchar* _tmp17_;
	gchar** _tmp18_;
	gint _tmp18__length1;
	gchar* _tmp19_;
	gchar* _tmp20_;
	GHashTable* capabilities;
	GHashFunc _tmp21_;
	GEqualFunc _tmp22_;
	GHashTable* _tmp23_;
	gchar** _tmp24_;
	gint _tmp24__length1;
	gchar** capability_collection;
	gint capability_collection_length1;
	gint _capability_collection_size_;
	gint capability_it;
	gchar* _tmp25_;
	gchar* capability;
	GHashTable* _tmp26_;
	const gchar* _tmp27_;
	gchar* _tmp28_;
	GHashTable* _tmp29_;
	GHashTable* _tmp30_;
	const gchar* _tmp31_;
	const gchar* _tmp32_;
	gchar* _tmp33_;
	FreedesktopNotifications* _tmp34_;
	FreedesktopNotifications* _tmp35_;
	FreedesktopNotifications* _tmp36_;
	FreedesktopNotifications* _tmp37_;
	GError* _error_;
	GError* _tmp38_;
	const gchar* _tmp39_;
	GError* _tmp40_;
	GError* _tmp41_;
	GError* _inner_error0_;
};

struct _FreedesktopNotificationBackendProviderDisableData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	FreedesktopNotificationBackendProvider* self;
	GCancellable* _tmp0_;
	GCancellable* _tmp1_;
	GSList* link;
	GSList* _tmp2_;
	GSList* _tmp3_;
	GSList* _tmp4_;
	gconstpointer _tmp5_;
	GSList* _tmp6_;
	gconstpointer _tmp7_;
	GSList* _tmp8_;
	GSList* _tmp9_;
	FreedesktopNotifications* _tmp10_;
	FreedesktopNotifications* _tmp11_;
	guint _tmp12_;
	FreedesktopNotifications* _tmp13_;
	guint _tmp14_;
};

struct _FreedesktopNotificationBackendProviderWithdrawNotificationInternalData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	FreedesktopNotificationBackendProvider* self;
	guint32 external_id;
	gboolean _tmp0_;
	FreedesktopNotifications* _tmp1_;
	FreedesktopNotifications* _tmp2_;
	GError* _error_;
	GError* _tmp3_;
	const gchar* _tmp4_;
	GError* _tmp5_;
	GError* _tmp6_;
	const gchar* _tmp7_;
	GError* _inner_error0_;
};

struct _Block1Data {
	int _ref_count_;
	FreedesktopNotificationBackendProvider* self;
	gchar** actions;
	gint actions_length1;
	gint _actions_size_;
	gpointer _async_data_;
};

struct _FreedesktopNotificationBackendProviderSendNotificationData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	FreedesktopNotificationBackendProvider* self;
	gchar* id;
	FtNotification* notification;
	FreedesktopNotifications* _tmp0_;
	Block1Data* _data1_;
	gboolean _tmp1_;
	GCancellable* _tmp2_;
	GCancellable* _tmp3_;
	FreedesktopNotificationInfo* existing_notification_info;
	FreedesktopNotificationInfo* _tmp4_;
	gboolean _tmp5_;
	FreedesktopNotificationInfo* _tmp6_;
	FreedesktopNotificationInfo* _tmp7_;
	FtNotification* _tmp8_;
	guint32 _tmp9_;
	FreedesktopNotificationInfo* _tmp10_;
	FreedesktopNotificationInfo* _tmp11_;
	guint32 replace_id;
	gchar** _tmp12_;
	gboolean _tmp13_;
	const gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	GHashTable* hints;
	GHashFunc _tmp17_;
	GEqualFunc _tmp18_;
	GHashTable* _tmp19_;
	GHashTable* _tmp20_;
	gchar* _tmp21_;
	GVariant* _tmp22_;
	GHashTable* _tmp23_;
	gchar* _tmp24_;
	GVariant* _tmp25_;
	GHashTable* _tmp26_;
	gchar* _tmp27_;
	GVariant* _tmp28_;
	GHashTable* _tmp29_;
	gchar* _tmp30_;
	GVariant* _tmp31_;
	const gchar* _tmp32_;
	GHashTable* _tmp33_;
	gchar* _tmp34_;
	const gchar* _tmp35_;
	GVariant* _tmp36_;
	const gchar* _tmp37_;
	GHashTable* _tmp38_;
	gchar* _tmp39_;
	const gchar* _tmp40_;
	GVariant* _tmp41_;
	gint _tmp42_;
	gint expire_timeout;
	FreedesktopNotificationInfo* tmp_notification_info;
	FreedesktopNotificationInfo* _tmp43_;
	FreedesktopNotificationInfo* notification_info;
	FreedesktopNotificationInfo* _tmp44_;
	FreedesktopNotificationInfo* _tmp45_;
	FreedesktopNotificationInfo* _tmp46_;
	FreedesktopNotificationInfo* _tmp47_;
	FreedesktopNotificationInfo* _tmp48_;
	const gchar* _tmp49_;
	const gchar* _tmp50_;
	guint32 external_id;
	FreedesktopNotifications* _tmp51_;
	const gchar* _tmp52_;
	const gchar* _tmp53_;
	const gchar* _tmp54_;
	gchar** _tmp55_;
	gint _tmp55__length1;
	GHashTable* _tmp56_;
	GCancellable* _tmp57_;
	gboolean _tmp58_;
	GSList* _tmp59_;
	FreedesktopNotificationInfo* _tmp60_;
	FreedesktopNotificationInfo* _tmp61_;
	GError* _error_;
	GError* _tmp62_;
	const gchar* _tmp63_;
	GError* _tmp64_;
	GError* _tmp65_;
	const gchar* _tmp66_;
	GError* _inner_error0_;
};

struct _FreedesktopNotificationBackendProviderWithdrawNotificationData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	FreedesktopNotificationBackendProvider* self;
	gchar* id;
	FreedesktopNotifications* _tmp0_;
	gboolean _tmp1_;
	GCancellable* _tmp2_;
	GCancellable* _tmp3_;
	FreedesktopNotificationInfo* notification_info;
	FreedesktopNotificationInfo* _tmp4_;
	FreedesktopNotificationInfo* _tmp5_;
	guint32 _tmp6_;
	FreedesktopNotificationInfo* _tmp7_;
	FreedesktopNotificationInfo* _tmp8_;
	guint32 external_id;
	FreedesktopNotificationInfo* _tmp9_;
};

static gint FreedesktopNotificationBackendProvider_private_offset;
static gpointer freedesktop_notification_backend_provider_parent_class = NULL;
static FtNotificationBackendProviderIface * freedesktop_notification_backend_provider_ft_notification_backend_provider_parent_iface = NULL;
static GType freedesktop_notification_backend_provider_type_id = 0;

VALA_EXTERN gboolean freedesktop_have_default_action (const gchar* server_name);
VALA_EXTERN gchar* freedesktop_get_application_icon (const gchar* server_name);
VALA_EXTERN FreedesktopNotificationUrgency freedesktop_priority_to_urgency (FtNotificationPriority priority);
VALA_EXTERN void freedesktop_notification_info_free (FreedesktopNotificationInfo * self);
static void freedesktop_notification_info_instance_init (FreedesktopNotificationInfo * self);
VALA_EXTERN FreedesktopNotificationInfo* freedesktop_notification_info_new (const gchar* id,
                                                                FtNotification* notification);
static void _freedesktop_notification_info_free0_ (gpointer var);
static inline void _g_slist_free__freedesktop_notification_info_free0_ (GSList* self);
static void freedesktop_notification_backend_provider_on_name_appeared (FreedesktopNotificationBackendProvider* self,
                                                                 GDBusConnection* connection,
                                                                 const gchar* name,
                                                                 const gchar* name_owner);
static void freedesktop_notification_backend_provider_on_name_vanished (FreedesktopNotificationBackendProvider* self,
                                                                 GDBusConnection* connection,
                                                                 const gchar* name);
static void freedesktop_notification_backend_provider_real_initialize_data_free (gpointer _data);
static void freedesktop_notification_backend_provider_real_initialize (FtProvider* base,
                                                                GCancellable* cancellable,
                                                                GAsyncReadyCallback _callback_,
                                                                gpointer _user_data_);
static gboolean freedesktop_notification_backend_provider_real_initialize_co (FreedesktopNotificationBackendProviderInitializeData* _data_);
static void _freedesktop_notification_backend_provider_on_name_appeared_gbus_name_appeared_callback (GDBusConnection* connection,
                                                                                              const gchar* name,
                                                                                              const gchar* name_owner,
                                                                                              gpointer self);
static void _freedesktop_notification_backend_provider_on_name_vanished_gbus_name_vanished_callback (GDBusConnection* connection,
                                                                                              const gchar* name,
                                                                                              gpointer self);
static void freedesktop_notification_backend_provider_real_uninitialize_data_free (gpointer _data);
static void freedesktop_notification_backend_provider_real_uninitialize (FtProvider* base,
                                                                  GAsyncReadyCallback _callback_,
                                                                  gpointer _user_data_);
static gboolean freedesktop_notification_backend_provider_real_uninitialize_co (FreedesktopNotificationBackendProviderUninitializeData* _data_);
static void freedesktop_notification_backend_provider_real_enable_data_free (gpointer _data);
static void freedesktop_notification_backend_provider_real_enable (FtProvider* base,
                                                            GCancellable* cancellable,
                                                            GAsyncReadyCallback _callback_,
                                                            gpointer _user_data_);
static gboolean freedesktop_notification_backend_provider_real_enable_co (FreedesktopNotificationBackendProviderEnableData* _data_);
static void freedesktop_notification_backend_provider_enable_ready (GObject* source_object,
                                                             GAsyncResult* _res_,
                                                             gpointer _user_data_);
static void _g_free0_ (gpointer var);
static void freedesktop_notification_backend_provider_on_action_invoked (FreedesktopNotificationBackendProvider* self,
                                                                  guint32 id,
                                                                  const gchar* action_key);
static void _freedesktop_notification_backend_provider_on_action_invoked_freedesktop_notifications_action_invoked (FreedesktopNotifications* _sender,
                                                                                                            guint32 id,
                                                                                                            const gchar* action_key,
                                                                                                            gpointer self);
static void freedesktop_notification_backend_provider_on_notification_closed (FreedesktopNotificationBackendProvider* self,
                                                                       guint32 id,
                                                                       guint32 reason);
static void _freedesktop_notification_backend_provider_on_notification_closed_freedesktop_notifications_notification_closed (FreedesktopNotifications* _sender,
                                                                                                                      guint32 id,
                                                                                                                      guint32 reason,
                                                                                                                      gpointer self);
static void freedesktop_notification_backend_provider_real_disable_data_free (gpointer _data);
static void freedesktop_notification_backend_provider_real_disable (FtProvider* base,
                                                             GAsyncReadyCallback _callback_,
                                                             gpointer _user_data_);
static gboolean freedesktop_notification_backend_provider_real_disable_co (FreedesktopNotificationBackendProviderDisableData* _data_);
static void freedesktop_notification_backend_provider_withdraw_notification_internal (FreedesktopNotificationBackendProvider* self,
                                                                               guint32 external_id,
                                                                               GAsyncReadyCallback _callback_,
                                                                               gpointer _user_data_);
static void freedesktop_notification_backend_provider_withdraw_notification_internal_finish (FreedesktopNotificationBackendProvider* self,
                                                                                      GAsyncResult* _res_);
static void freedesktop_notification_backend_provider_disable_ready (GObject* source_object,
                                                              GAsyncResult* _res_,
                                                              gpointer _user_data_);
static FreedesktopNotificationInfo* freedesktop_notification_backend_provider_lookup_by_id (FreedesktopNotificationBackendProvider* self,
                                                                                     const gchar* id);
static FreedesktopNotificationInfo* freedesktop_notification_backend_provider_lookup_by_external_id (FreedesktopNotificationBackendProvider* self,
                                                                                              guint32 external_id);
static gboolean freedesktop_notification_backend_provider_activate_action (FreedesktopNotificationBackendProvider* self,
                                                                    const gchar* action,
                                                                    GVariant* parameter);
static gboolean freedesktop_notification_backend_provider_activate_detailed_action (FreedesktopNotificationBackendProvider* self,
                                                                             const gchar* detailed_action);
static void freedesktop_notification_backend_provider_withdraw_notification_internal_data_free (gpointer _data);
static gboolean freedesktop_notification_backend_provider_withdraw_notification_internal_co (FreedesktopNotificationBackendProviderWithdrawNotificationInternalData* _data_);
static void freedesktop_notification_backend_provider_withdraw_notification_internal_ready (GObject* source_object,
                                                                                     GAsyncResult* _res_,
                                                                                     gpointer _user_data_);
static void freedesktop_notification_backend_provider_remove_by_external_id (FreedesktopNotificationBackendProvider* self,
                                                                      guint32 external_id);
static void freedesktop_notification_backend_provider_real_send_notification_data_free (gpointer _data);
static void freedesktop_notification_backend_provider_real_send_notification (FtNotificationBackendProvider* base,
                                                                       const gchar* id,
                                                                       FtNotification* notification,
                                                                       GAsyncReadyCallback _callback_,
                                                                       gpointer _user_data_);
static gboolean freedesktop_notification_backend_provider_real_send_notification_co (FreedesktopNotificationBackendProviderSendNotificationData* _data_);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static void _vala_array_add1 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static void _vala_array_add2 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static void ___lambda4_ (Block1Data* _data1_,
                  const gchar* label,
                  const gchar* action,
                  GVariant* target_value);
static void _vala_array_add3 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static void _vala_array_add4 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static void ____lambda4__ft_notification_foreach_button_func (const gchar* label,
                                                       const gchar* action,
                                                       GVariant* target_value,
                                                       gpointer self);
static void _g_variant_unref0_ (gpointer var);
static void freedesktop_notification_backend_provider_send_notification_ready (GObject* source_object,
                                                                        GAsyncResult* _res_,
                                                                        gpointer _user_data_);
static void freedesktop_notification_backend_provider_real_withdraw_notification_data_free (gpointer _data);
static void freedesktop_notification_backend_provider_real_withdraw_notification (FtNotificationBackendProvider* base,
                                                                           const gchar* id,
                                                                           GAsyncReadyCallback _callback_,
                                                                           gpointer _user_data_);
static gboolean freedesktop_notification_backend_provider_real_withdraw_notification_co (FreedesktopNotificationBackendProviderWithdrawNotificationData* _data_);
static void freedesktop_notification_backend_provider_withdraw_notification_ready (GObject* source_object,
                                                                            GAsyncResult* _res_,
                                                                            gpointer _user_data_);
static void freedesktop_notification_backend_provider_real_dispose (GObject* base);
static GObject * freedesktop_notification_backend_provider_constructor (GType type,
                                                                 guint n_construct_properties,
                                                                 GObjectConstructParam * construct_properties);
static void freedesktop_notification_backend_provider_finalize (GObject * obj);
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 gssize _vala_array_length (gpointer array);

/**
     * Whether clicking the notification activates the app.
     */
gboolean
freedesktop_have_default_action (const gchar* server_name)
{
	const gchar* _tmp0_;
	GQuark _tmp2_ = 0U;
	static GQuark _tmp1_label0 = 0;
	gboolean result;
	g_return_val_if_fail (server_name != NULL, FALSE);
	_tmp0_ = server_name;
	_tmp2_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_);
	if (_tmp2_ == ((0 != _tmp1_label0) ? _tmp1_label0 : (_tmp1_label0 = g_quark_from_static_string ("Xfce Notify Daemon")))) {
		switch (0) {
			default:
			{
				result = FALSE;
				return result;
			}
		}
	} else {
		switch (0) {
			default:
			{
				result = TRUE;
				return result;
			}
		}
	}
}

/**
     * Some servers do not read icon name from the .desktop file.
     */
static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

gchar*
freedesktop_get_application_icon (const gchar* server_name)
{
	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;
	gchar* result;
	g_return_val_if_fail (server_name != NULL, NULL);
	_tmp0_ = server_name;
	_tmp2_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_);
	if ((_tmp2_ == ((0 != _tmp1_label0) ? _tmp1_label0 : (_tmp1_label0 = g_quark_from_static_string ("cinnamon")))) || (_tmp2_ == ((0 != _tmp1_label1) ? _tmp1_label1 : (_tmp1_label1 = g_quark_from_static_string ("cosmic-notifications"))))) {
		switch (0) {
			default:
			{
				const gchar* _tmp3_;
				gchar* _tmp4_;
				_tmp3_ = string_to_string (APPLICATION_ID);
				_tmp4_ = g_strconcat (_tmp3_, "-symbolic", NULL);
				result = _tmp4_;
				return result;
			}
		}
	} else if ((_tmp2_ == ((0 != _tmp1_label2) ? _tmp1_label2 : (_tmp1_label2 = g_quark_from_static_string ("Xfce Notify Daemon")))) || (_tmp2_ == ((0 != _tmp1_label3) ? _tmp1_label3 : (_tmp1_label3 = g_quark_from_static_string ("lxqt-notificationd"))))) {
		switch (0) {
			default:
			{
				gchar* _tmp5_;
				_tmp5_ = g_strdup (APPLICATION_ID);
				result = _tmp5_;
				return result;
			}
		}
	} else {
		switch (0) {
			default:
			{
				gchar* _tmp6_;
				_tmp6_ = g_strdup ("");
				result = _tmp6_;
				return result;
			}
		}
	}
}

FreedesktopNotificationUrgency
freedesktop_priority_to_urgency (FtNotificationPriority priority)
{
	FreedesktopNotificationUrgency result;
	switch (priority) {
		case FT_NOTIFICATION_PRIORITY_LOW:
		{
			result = FREEDESKTOP_NOTIFICATION_URGENCY_LOW;
			return result;
		}
		case FT_NOTIFICATION_PRIORITY_NORMAL:
		case FT_NOTIFICATION_PRIORITY_HIGH:
		{
			result = FREEDESKTOP_NOTIFICATION_URGENCY_NORMAL;
			return result;
		}
		case FT_NOTIFICATION_PRIORITY_URGENT:
		{
			result = FREEDESKTOP_NOTIFICATION_URGENCY_CRITICAL;
			return result;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
}

static gpointer
_ft_notification_ref0 (gpointer self)
{
	return self ? ft_notification_ref (self) : NULL;
}

FreedesktopNotificationInfo*
freedesktop_notification_info_new (const gchar* id,
                                   FtNotification* notification)
{
	FreedesktopNotificationInfo* self;
	gchar* _tmp0_;
	FtNotification* _tmp1_;
	g_return_val_if_fail (id != NULL, NULL);
	g_return_val_if_fail (notification != NULL, NULL);
	self = g_slice_new0 (FreedesktopNotificationInfo);
	freedesktop_notification_info_instance_init (self);
	_tmp0_ = g_strdup (id);
	_g_free0 (self->id);
	self->id = _tmp0_;
	_tmp1_ = _ft_notification_ref0 (notification);
	_ft_notification_unref0 (self->notification);
	self->notification = _tmp1_;
	return self;
}

static void
freedesktop_notification_info_instance_init (FreedesktopNotificationInfo * self)
{
	self->external_id = (guint32) 0U;
}

void
freedesktop_notification_info_free (FreedesktopNotificationInfo * self)
{
	_ft_notification_unref0 (self->notification);
	self->notification = NULL;
	_ft_notification_unref0 (self->notification);
	_g_free0 (self->id);
	g_slice_free (FreedesktopNotificationInfo, self);
}

static inline gpointer
freedesktop_notification_backend_provider_get_instance_private (FreedesktopNotificationBackendProvider* self)
{
	return G_STRUCT_MEMBER_P (self, FreedesktopNotificationBackendProvider_private_offset);
}

static void
_freedesktop_notification_info_free0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (freedesktop_notification_info_free (var), NULL));
}

static inline void
_g_slist_free__freedesktop_notification_info_free0_ (GSList* self)
{
	g_slist_free_full (self, (GDestroyNotify) _freedesktop_notification_info_free0_);
}

static void
freedesktop_notification_backend_provider_on_name_appeared (FreedesktopNotificationBackendProvider* self,
                                                            GDBusConnection* connection,
                                                            const gchar* name,
                                                            const gchar* name_owner)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (connection != NULL);
	g_return_if_fail (name != NULL);
	g_return_if_fail (name_owner != NULL);
	ft_provider_set_available ((FtProvider*) self, TRUE);
}

static void
freedesktop_notification_backend_provider_on_name_vanished (FreedesktopNotificationBackendProvider* self,
                                                            GDBusConnection* connection,
                                                            const gchar* name)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	ft_provider_set_available ((FtProvider*) self, FALSE);
}

static void
freedesktop_notification_backend_provider_real_initialize_data_free (gpointer _data)
{
	FreedesktopNotificationBackendProviderInitializeData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->self);
	g_slice_free (FreedesktopNotificationBackendProviderInitializeData, _data_);
}

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

static void
freedesktop_notification_backend_provider_real_initialize (FtProvider* base,
                                                           GCancellable* cancellable,
                                                           GAsyncReadyCallback _callback_,
                                                           gpointer _user_data_)
{
	FreedesktopNotificationBackendProvider * self;
	FreedesktopNotificationBackendProviderInitializeData* _data_;
	FreedesktopNotificationBackendProvider* _tmp0_;
	GCancellable* _tmp1_;
	self = (FreedesktopNotificationBackendProvider*) base;
	_data_ = g_slice_new0 (FreedesktopNotificationBackendProviderInitializeData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, freedesktop_notification_backend_provider_real_initialize_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp1_;
	freedesktop_notification_backend_provider_real_initialize_co (_data_);
}

static void
freedesktop_notification_backend_provider_initialize_finish (FtProvider* base,
                                                             GAsyncResult* _res_,
                                                             GError** error)
{
	FreedesktopNotificationBackendProviderInitializeData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
_freedesktop_notification_backend_provider_on_name_appeared_gbus_name_appeared_callback (GDBusConnection* connection,
                                                                                         const gchar* name,
                                                                                         const gchar* name_owner,
                                                                                         gpointer self)
{
	freedesktop_notification_backend_provider_on_name_appeared ((FreedesktopNotificationBackendProvider*) self, connection, name, name_owner);
}

static void
_freedesktop_notification_backend_provider_on_name_vanished_gbus_name_vanished_callback (GDBusConnection* connection,
                                                                                         const gchar* name,
                                                                                         gpointer self)
{
	freedesktop_notification_backend_provider_on_name_vanished ((FreedesktopNotificationBackendProvider*) self, connection, name);
}

static gboolean
freedesktop_notification_backend_provider_real_initialize_co (FreedesktopNotificationBackendProviderInitializeData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->self->priv->watcher_id = g_bus_watch_name_with_closures (G_BUS_TYPE_SESSION, "org.freedesktop.Notifications", G_BUS_NAME_WATCHER_FLAGS_NONE, (GClosure*) ((_freedesktop_notification_backend_provider_on_name_appeared_gbus_name_appeared_callback == NULL) ? NULL : g_cclosure_new ((GCallback) _freedesktop_notification_backend_provider_on_name_appeared_gbus_name_appeared_callback, g_object_ref (_data_->self), (GClosureNotify) g_object_unref)), (GClosure*) ((_freedesktop_notification_backend_provider_on_name_vanished_gbus_name_vanished_callback == NULL) ? NULL : g_cclosure_new ((GCallback) _freedesktop_notification_backend_provider_on_name_vanished_gbus_name_vanished_callback, g_object_ref (_data_->self), (GClosureNotify) g_object_unref)));
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
freedesktop_notification_backend_provider_real_uninitialize_data_free (gpointer _data)
{
	FreedesktopNotificationBackendProviderUninitializeData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (FreedesktopNotificationBackendProviderUninitializeData, _data_);
}

static void
freedesktop_notification_backend_provider_real_uninitialize (FtProvider* base,
                                                             GAsyncReadyCallback _callback_,
                                                             gpointer _user_data_)
{
	FreedesktopNotificationBackendProvider * self;
	FreedesktopNotificationBackendProviderUninitializeData* _data_;
	FreedesktopNotificationBackendProvider* _tmp0_;
	self = (FreedesktopNotificationBackendProvider*) base;
	_data_ = g_slice_new0 (FreedesktopNotificationBackendProviderUninitializeData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, freedesktop_notification_backend_provider_real_uninitialize_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	freedesktop_notification_backend_provider_real_uninitialize_co (_data_);
}

static void
freedesktop_notification_backend_provider_uninitialize_finish (FtProvider* base,
                                                               GAsyncResult* _res_,
                                                               GError** error)
{
	FreedesktopNotificationBackendProviderUninitializeData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static gboolean
freedesktop_notification_backend_provider_real_uninitialize_co (FreedesktopNotificationBackendProviderUninitializeData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->self->priv->watcher_id != ((guint) 0)) {
		g_bus_unwatch_name (_data_->self->priv->watcher_id);
		_data_->self->priv->watcher_id = (guint) 0;
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
freedesktop_notification_backend_provider_real_enable_data_free (gpointer _data)
{
	FreedesktopNotificationBackendProviderEnableData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->self);
	g_slice_free (FreedesktopNotificationBackendProviderEnableData, _data_);
}

static void
freedesktop_notification_backend_provider_real_enable (FtProvider* base,
                                                       GCancellable* cancellable,
                                                       GAsyncReadyCallback _callback_,
                                                       gpointer _user_data_)
{
	FreedesktopNotificationBackendProvider * self;
	FreedesktopNotificationBackendProviderEnableData* _data_;
	FreedesktopNotificationBackendProvider* _tmp0_;
	GCancellable* _tmp1_;
	self = (FreedesktopNotificationBackendProvider*) base;
	_data_ = g_slice_new0 (FreedesktopNotificationBackendProviderEnableData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, freedesktop_notification_backend_provider_real_enable_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp1_;
	freedesktop_notification_backend_provider_real_enable_co (_data_);
}

static void
freedesktop_notification_backend_provider_enable_finish (FtProvider* base,
                                                         GAsyncResult* _res_,
                                                         GError** error)
{
	FreedesktopNotificationBackendProviderEnableData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
freedesktop_notification_backend_provider_enable_ready (GObject* source_object,
                                                        GAsyncResult* _res_,
                                                        gpointer _user_data_)
{
	FreedesktopNotificationBackendProviderEnableData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	freedesktop_notification_backend_provider_real_enable_co (_data_);
}

static gchar*
_vala_g_strjoinv (const gchar* separator,
                  gchar** str_array,
                  gint str_array_length1)
{
	gboolean _tmp0_ = FALSE;
	gchar* result;
	if (separator == NULL) {
		separator = "";
	}
	if (str_array != NULL) {
		gboolean _tmp1_ = FALSE;
		if (str_array_length1 > 0) {
			_tmp1_ = TRUE;
		} else {
			gboolean _tmp2_ = FALSE;
			if (str_array_length1 == -1) {
				const gchar* _tmp3_;
				_tmp3_ = str_array[0];
				_tmp2_ = _tmp3_ != NULL;
			} else {
				_tmp2_ = FALSE;
			}
			_tmp1_ = _tmp2_;
		}
		_tmp0_ = _tmp1_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gint i = 0;
		gsize len = 0UL;
		gint _tmp16_;
		gint _tmp17_;
		const gchar* res = NULL;
		void* _tmp18_;
		const gchar* _tmp19_ = NULL;
		const gchar* _tmp20_;
		void* ptr = NULL;
		const gchar* _tmp22_;
		void* _tmp23_;
		const gchar* _tmp33_;
		len = (gsize) 1;
		{
			gboolean _tmp4_ = FALSE;
			i = 0;
			_tmp4_ = TRUE;
			while (TRUE) {
				gboolean _tmp6_ = FALSE;
				gboolean _tmp7_ = FALSE;
				gint _tmp10_ = 0;
				const gchar* _tmp11_;
				if (!_tmp4_) {
					gint _tmp5_;
					_tmp5_ = i;
					i = _tmp5_ + 1;
				}
				_tmp4_ = FALSE;
				if (str_array_length1 != -1) {
					_tmp7_ = i < str_array_length1;
				} else {
					_tmp7_ = FALSE;
				}
				if (_tmp7_) {
					_tmp6_ = TRUE;
				} else {
					gboolean _tmp8_ = FALSE;
					if (str_array_length1 == -1) {
						const gchar* _tmp9_;
						_tmp9_ = str_array[i];
						_tmp8_ = _tmp9_ != NULL;
					} else {
						_tmp8_ = FALSE;
					}
					_tmp6_ = _tmp8_;
				}
				if (!_tmp6_) {
					break;
				}
				_tmp11_ = str_array[i];
				if (_tmp11_ != NULL) {
					const gchar* _tmp12_;
					gint _tmp13_;
					gint _tmp14_;
					_tmp12_ = str_array[i];
					_tmp13_ = strlen ((const gchar*) _tmp12_);
					_tmp14_ = _tmp13_;
					_tmp10_ = _tmp14_;
				} else {
					_tmp10_ = 0;
				}
				len += (gsize) _tmp10_;
			}
		}
		if (i == 0) {
			gchar* _tmp15_;
			_tmp15_ = g_strdup ("");
			result = _tmp15_;
			return result;
		}
		str_array_length1 = i;
		_tmp16_ = strlen ((const gchar*) separator);
		_tmp17_ = _tmp16_;
		len += (gsize) (_tmp17_ * (i - 1));
		_tmp18_ = g_malloc (len);
		res = _tmp18_;
		_tmp20_ = str_array[0];
		if (_tmp20_ != NULL) {
			const gchar* _tmp21_;
			_tmp21_ = str_array[0];
			_tmp19_ = (const gchar*) _tmp21_;
		} else {
			_tmp19_ = "";
		}
		_tmp22_ = res;
		_tmp23_ = g_stpcpy ((void*) _tmp22_, _tmp19_);
		ptr = _tmp23_;
		{
			gboolean _tmp24_ = FALSE;
			i = 1;
			_tmp24_ = TRUE;
			while (TRUE) {
				void* _tmp26_;
				void* _tmp27_;
				const gchar* _tmp28_ = NULL;
				const gchar* _tmp29_;
				void* _tmp31_;
				void* _tmp32_;
				if (!_tmp24_) {
					gint _tmp25_;
					_tmp25_ = i;
					i = _tmp25_ + 1;
				}
				_tmp24_ = FALSE;
				if (!(i < str_array_length1)) {
					break;
				}
				_tmp26_ = ptr;
				_tmp27_ = g_stpcpy (_tmp26_, (const gchar*) separator);
				ptr = _tmp27_;
				_tmp29_ = str_array[i];
				if (_tmp29_ != NULL) {
					const gchar* _tmp30_;
					_tmp30_ = str_array[i];
					_tmp28_ = (const gchar*) _tmp30_;
				} else {
					_tmp28_ = "";
				}
				_tmp31_ = ptr;
				_tmp32_ = g_stpcpy (_tmp31_, _tmp28_);
				ptr = _tmp32_;
			}
		}
		_tmp33_ = res;
		res = NULL;
		result = (gchar*) _tmp33_;
		return result;
	} else {
		gchar* _tmp34_;
		_tmp34_ = g_strdup ("");
		result = _tmp34_;
		return result;
	}
}

static void
_g_free0_ (gpointer var)
{
	var = (g_free (var), NULL);
}

static void
_freedesktop_notification_backend_provider_on_action_invoked_freedesktop_notifications_action_invoked (FreedesktopNotifications* _sender,
                                                                                                       guint32 id,
                                                                                                       const gchar* action_key,
                                                                                                       gpointer self)
{
	freedesktop_notification_backend_provider_on_action_invoked ((FreedesktopNotificationBackendProvider*) self, id, action_key);
}

static void
_freedesktop_notification_backend_provider_on_notification_closed_freedesktop_notifications_notification_closed (FreedesktopNotifications* _sender,
                                                                                                                 guint32 id,
                                                                                                                 guint32 reason,
                                                                                                                 gpointer self)
{
	freedesktop_notification_backend_provider_on_notification_closed ((FreedesktopNotificationBackendProvider*) self, id, reason);
}

static gpointer
_g_error_copy0 (gpointer self)
{
	return self ? g_error_copy (self) : NULL;
}

static gboolean
freedesktop_notification_backend_provider_real_enable_co (FreedesktopNotificationBackendProviderEnableData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->cancellable != NULL) {
		_data_->_tmp1_ = _g_object_ref0 (_data_->cancellable);
		_g_object_unref0 (_data_->_tmp0_);
		_data_->_tmp0_ = _data_->_tmp1_;
	} else {
		_data_->_tmp2_ = g_cancellable_new ();
		_g_object_unref0 (_data_->_tmp0_);
		_data_->_tmp0_ = _data_->_tmp2_;
	}
	_data_->_tmp3_ = _data_->_tmp0_;
	_data_->_tmp0_ = NULL;
	_g_object_unref0 (_data_->self->priv->cancellable);
	_data_->self->priv->cancellable = _data_->_tmp3_;
	{
		_data_->_tmp4_ = _data_->self->priv->cancellable;
		_data_->_state_ = 1;
		g_async_initable_new_async (FREEDESKTOP_TYPE_NOTIFICATIONS_PROXY, 0, _data_->_tmp4_, freedesktop_notification_backend_provider_enable_ready, _data_, "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, "g-name", "org.freedesktop.Notifications", "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/org/freedesktop/Notifications", "g-interface-name", "org.freedesktop.Notifications", NULL);
		return FALSE;
		_state_1:
		_data_->_tmp5_ = (FreedesktopNotifications*) g_async_initable_new_finish ((GAsyncInitable *) _data_->_source_object_, _data_->_res_, &_data_->_inner_error0_);
		_data_->proxy = (FreedesktopNotifications*) _data_->_tmp5_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_free0 (_data_->spec_version);
			_g_free0 (_data_->version);
			_g_free0 (_data_->vendor);
			_g_free0 (_data_->name);
			goto __catch0_g_error;
		}
		_data_->_tmp6_ = _data_->proxy;
		_data_->_tmp7_ = NULL;
		_data_->_tmp8_ = NULL;
		_data_->_tmp9_ = NULL;
		_data_->_tmp10_ = NULL;
		_data_->_state_ = 2;
		freedesktop_notifications_get_server_information (_data_->_tmp6_, freedesktop_notification_backend_provider_enable_ready, _data_);
		return FALSE;
		_state_2:
		freedesktop_notifications_get_server_information_finish (_data_->_tmp6_, _data_->_res_, &_data_->_tmp7_, &_data_->_tmp8_, &_data_->_tmp9_, &_data_->_tmp10_, &_data_->_inner_error0_);
		_g_free0 (_data_->name);
		_data_->name = _data_->_tmp7_;
		_g_free0 (_data_->vendor);
		_data_->vendor = _data_->_tmp8_;
		_g_free0 (_data_->version);
		_data_->version = _data_->_tmp9_;
		_g_free0 (_data_->spec_version);
		_data_->spec_version = _data_->_tmp10_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->proxy);
			_g_free0 (_data_->spec_version);
			_g_free0 (_data_->version);
			_g_free0 (_data_->vendor);
			_g_free0 (_data_->name);
			goto __catch0_g_error;
		}
		_data_->_tmp11_ = _data_->proxy;
		_data_->_tmp12_ = 0;
		_data_->_state_ = 3;
		freedesktop_notifications_get_capabilities (_data_->_tmp11_, freedesktop_notification_backend_provider_enable_ready, _data_);
		return FALSE;
		_state_3:
		_data_->_tmp13_ = freedesktop_notifications_get_capabilities_finish (_data_->_tmp11_, _data_->_res_, &_data_->_tmp12_, &_data_->_inner_error0_);
		_data_->capabilities_strv = _data_->_tmp13_;
		_data_->capabilities_strv_length1 = _data_->_tmp12_;
		_data_->_capabilities_strv_size_ = _data_->capabilities_strv_length1;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->proxy);
			_g_free0 (_data_->spec_version);
			_g_free0 (_data_->version);
			_g_free0 (_data_->vendor);
			_g_free0 (_data_->name);
			goto __catch0_g_error;
		}
		_data_->_tmp14_ = _data_->name;
		_data_->_tmp15_ = _data_->vendor;
		_data_->_tmp16_ = _data_->version;
		_data_->_tmp17_ = _data_->spec_version;
		_data_->_tmp18_ = _data_->capabilities_strv;
		_data_->_tmp18__length1 = _data_->capabilities_strv_length1;
		_data_->_tmp19_ = _vala_g_strjoinv (", ", _data_->_tmp18_, (gint) _data_->_tmp18__length1);
		_data_->_tmp20_ = _data_->_tmp19_;
		g_debug ("notification-backend-provider.vala:165: Notification backend:\n" \
"  name: %s\n" \
"  vendor: %s\n" \
"  version: %s\n" \
"  spec_version: %s\n" \
"  capabilities: %s", _data_->_tmp14_, _data_->_tmp15_, _data_->_tmp16_, _data_->_tmp17_, _data_->_tmp20_);
		_g_free0 (_data_->_tmp20_);
		_data_->_tmp21_ = g_str_hash;
		_data_->_tmp22_ = g_str_equal;
		_data_->_tmp23_ = g_hash_table_new_full (_data_->_tmp21_, _data_->_tmp22_, NULL, _g_free0_);
		_data_->capabilities = _data_->_tmp23_;
		_data_->_tmp24_ = _data_->capabilities_strv;
		_data_->_tmp24__length1 = _data_->capabilities_strv_length1;
		{
			_data_->capability_collection_length1 = 0;
			_data_->_capability_collection_size_ = 0;
			_data_->capability_collection = _data_->_tmp24_;
			_data_->capability_collection_length1 = _data_->_tmp24__length1;
			for (_data_->capability_it = 0; _data_->capability_it < _data_->capability_collection_length1; _data_->capability_it = _data_->capability_it + 1) {
				_data_->_tmp25_ = g_strdup (_data_->capability_collection[_data_->capability_it]);
				_data_->capability = _data_->_tmp25_;
				{
					_data_->_tmp26_ = _data_->capabilities;
					_data_->_tmp27_ = _data_->capability;
					_data_->_tmp28_ = g_strdup (_data_->_tmp27_);
					g_hash_table_add (_data_->_tmp26_, _data_->_tmp28_);
					_g_free0 (_data_->capability);
				}
			}
		}
		_data_->_tmp29_ = _data_->capabilities;
		_data_->self->priv->has_actions = g_hash_table_contains (_data_->_tmp29_, "actions");
		_data_->_tmp30_ = _data_->capabilities;
		_data_->self->priv->has_persistence = g_hash_table_contains (_data_->_tmp30_, "persistence");
		_data_->_tmp31_ = _data_->name;
		_data_->self->priv->has_default_action = freedesktop_have_default_action (_data_->_tmp31_);
		_data_->_tmp32_ = _data_->name;
		_data_->_tmp33_ = freedesktop_get_application_icon (_data_->_tmp32_);
		_g_free0 (_data_->self->priv->application_icon);
		_data_->self->priv->application_icon = _data_->_tmp33_;
		(_data_->self->priv->notifications == NULL) ? NULL : (_data_->self->priv->notifications = (_g_slist_free__freedesktop_notification_info_free0_ (_data_->self->priv->notifications), NULL));
		_data_->self->priv->notifications = NULL;
		_data_->_tmp34_ = _data_->proxy;
		_data_->_tmp35_ = _g_object_ref0 (_data_->_tmp34_);
		_g_object_unref0 (_data_->self->priv->proxy);
		_data_->self->priv->proxy = _data_->_tmp35_;
		_data_->_tmp36_ = _data_->self->priv->proxy;
		g_signal_connect_object (_data_->_tmp36_, "action-invoked", (GCallback) _freedesktop_notification_backend_provider_on_action_invoked_freedesktop_notifications_action_invoked, _data_->self, 0);
		_data_->_tmp37_ = _data_->self->priv->proxy;
		g_signal_connect_object (_data_->_tmp37_, "notification-closed", (GCallback) _freedesktop_notification_backend_provider_on_notification_closed_freedesktop_notifications_notification_closed, _data_->self, 0);
		_g_hash_table_unref0 (_data_->capabilities);
		_data_->capabilities_strv = (_vala_array_free (_data_->capabilities_strv, _data_->capabilities_strv_length1, (GDestroyNotify) g_free), NULL);
		_g_object_unref0 (_data_->proxy);
		_g_free0 (_data_->spec_version);
		_g_free0 (_data_->version);
		_g_free0 (_data_->vendor);
		_g_free0 (_data_->name);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->_error_ = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp38_ = _data_->_error_;
		_data_->_tmp39_ = _data_->_tmp38_->message;
		g_warning ("notification-backend-provider.vala:189: Error while creating notificat" \
"ions proxy: %s", _data_->_tmp39_);
		_data_->_tmp40_ = _data_->_error_;
		_data_->_tmp41_ = _g_error_copy0 (_data_->_tmp40_);
		_data_->_inner_error0_ = _data_->_tmp41_;
		_g_error_free0 (_data_->_error_);
		goto __finally0;
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->_tmp0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_g_object_unref0 (_data_->_tmp0_);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
freedesktop_notification_backend_provider_real_disable_data_free (gpointer _data)
{
	FreedesktopNotificationBackendProviderDisableData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (FreedesktopNotificationBackendProviderDisableData, _data_);
}

static void
freedesktop_notification_backend_provider_real_disable (FtProvider* base,
                                                        GAsyncReadyCallback _callback_,
                                                        gpointer _user_data_)
{
	FreedesktopNotificationBackendProvider * self;
	FreedesktopNotificationBackendProviderDisableData* _data_;
	FreedesktopNotificationBackendProvider* _tmp0_;
	self = (FreedesktopNotificationBackendProvider*) base;
	_data_ = g_slice_new0 (FreedesktopNotificationBackendProviderDisableData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, freedesktop_notification_backend_provider_real_disable_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	freedesktop_notification_backend_provider_real_disable_co (_data_);
}

static void
freedesktop_notification_backend_provider_disable_finish (FtProvider* base,
                                                          GAsyncResult* _res_,
                                                          GError** error)
{
	FreedesktopNotificationBackendProviderDisableData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
freedesktop_notification_backend_provider_disable_ready (GObject* source_object,
                                                         GAsyncResult* _res_,
                                                         gpointer _user_data_)
{
	FreedesktopNotificationBackendProviderDisableData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	freedesktop_notification_backend_provider_real_disable_co (_data_);
}

static gboolean
freedesktop_notification_backend_provider_real_disable_co (FreedesktopNotificationBackendProviderDisableData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp1_ = _data_->self->priv->cancellable;
	_data_->_tmp0_ = _data_->_tmp1_;
	if (_data_->_tmp0_ != NULL) {
		g_cancellable_cancel (_data_->_tmp0_);
	}
	_data_->_tmp2_ = _data_->self->priv->notifications;
	_data_->link = _data_->_tmp2_;
	while (TRUE) {
		_data_->_tmp3_ = _data_->link;
		if (!(_data_->_tmp3_ != NULL)) {
			break;
		}
		_data_->_tmp4_ = _data_->link;
		_data_->_tmp5_ = _data_->_tmp4_->data;
		if (((FreedesktopNotificationInfo*) _data_->_tmp5_)->external_id != ((guint32) 0U)) {
			_data_->_tmp6_ = _data_->link;
			_data_->_tmp7_ = _data_->_tmp6_->data;
			_data_->_state_ = 1;
			freedesktop_notification_backend_provider_withdraw_notification_internal (_data_->self, ((FreedesktopNotificationInfo*) _data_->_tmp7_)->external_id, freedesktop_notification_backend_provider_disable_ready, _data_);
			return FALSE;
			_state_1:
			freedesktop_notification_backend_provider_withdraw_notification_internal_finish (_data_->self, _data_->_res_);
		}
		_data_->_tmp8_ = _data_->link;
		_data_->_tmp9_ = _data_->_tmp8_->next;
		_data_->link = _data_->_tmp9_;
	}
	_data_->_tmp10_ = _data_->self->priv->proxy;
	if (_data_->_tmp10_ != NULL) {
		_data_->_tmp11_ = _data_->self->priv->proxy;
		g_signal_parse_name ("action-invoked", FREEDESKTOP_TYPE_NOTIFICATIONS, &_data_->_tmp12_, NULL, FALSE);
		g_signal_handlers_disconnect_matched (_data_->_tmp11_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _data_->_tmp12_, 0, NULL, (GCallback) _freedesktop_notification_backend_provider_on_action_invoked_freedesktop_notifications_action_invoked, _data_->self);
		_data_->_tmp13_ = _data_->self->priv->proxy;
		g_signal_parse_name ("notification-closed", FREEDESKTOP_TYPE_NOTIFICATIONS, &_data_->_tmp14_, NULL, FALSE);
		g_signal_handlers_disconnect_matched (_data_->_tmp13_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _data_->_tmp14_, 0, NULL, (GCallback) _freedesktop_notification_backend_provider_on_notification_closed_freedesktop_notifications_notification_closed, _data_->self);
		_g_object_unref0 (_data_->self->priv->proxy);
		_data_->self->priv->proxy = NULL;
	}
	(_data_->self->priv->notifications == NULL) ? NULL : (_data_->self->priv->notifications = (_g_slist_free__freedesktop_notification_info_free0_ (_data_->self->priv->notifications), NULL));
	_data_->self->priv->notifications = NULL;
	_g_object_unref0 (_data_->self->priv->cancellable);
	_data_->self->priv->cancellable = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static FreedesktopNotificationInfo*
freedesktop_notification_backend_provider_lookup_by_id (FreedesktopNotificationBackendProvider* self,
                                                        const gchar* id)
{
	GSList* link = NULL;
	GSList* _tmp0_;
	FreedesktopNotificationInfo* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (id != NULL, NULL);
	_tmp0_ = self->priv->notifications;
	link = _tmp0_;
	while (TRUE) {
		GSList* _tmp1_;
		GSList* _tmp2_;
		gconstpointer _tmp3_;
		const gchar* _tmp4_;
		GSList* _tmp7_;
		GSList* _tmp8_;
		_tmp1_ = link;
		if (!(_tmp1_ != NULL)) {
			break;
		}
		_tmp2_ = link;
		_tmp3_ = _tmp2_->data;
		_tmp4_ = ((FreedesktopNotificationInfo*) _tmp3_)->id;
		if (g_strcmp0 (_tmp4_, id) == 0) {
			GSList* _tmp5_;
			gconstpointer _tmp6_;
			_tmp5_ = link;
			_tmp6_ = _tmp5_->data;
			result = (FreedesktopNotificationInfo*) _tmp6_;
			return result;
		}
		_tmp7_ = link;
		_tmp8_ = _tmp7_->next;
		link = _tmp8_;
	}
	result = NULL;
	return result;
}

static FreedesktopNotificationInfo*
freedesktop_notification_backend_provider_lookup_by_external_id (FreedesktopNotificationBackendProvider* self,
                                                                 guint32 external_id)
{
	GSList* link = NULL;
	GSList* _tmp0_;
	FreedesktopNotificationInfo* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (external_id == ((guint32) 0U)) {
		result = NULL;
		return result;
	}
	_tmp0_ = self->priv->notifications;
	link = _tmp0_;
	while (TRUE) {
		GSList* _tmp1_;
		GSList* _tmp2_;
		gconstpointer _tmp3_;
		GSList* _tmp6_;
		GSList* _tmp7_;
		_tmp1_ = link;
		if (!(_tmp1_ != NULL)) {
			break;
		}
		_tmp2_ = link;
		_tmp3_ = _tmp2_->data;
		if (((FreedesktopNotificationInfo*) _tmp3_)->external_id == external_id) {
			GSList* _tmp4_;
			gconstpointer _tmp5_;
			_tmp4_ = link;
			_tmp5_ = _tmp4_->data;
			result = (FreedesktopNotificationInfo*) _tmp5_;
			return result;
		}
		_tmp6_ = link;
		_tmp7_ = _tmp6_->next;
		link = _tmp7_;
	}
	result = NULL;
	return result;
}

static gpointer
_g_variant_type_copy0 (gpointer self)
{
	return self ? g_variant_type_copy (self) : NULL;
}

static gboolean
freedesktop_notification_backend_provider_activate_action (FreedesktopNotificationBackendProvider* self,
                                                           const gchar* action,
                                                           GVariant* parameter)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	if (parameter != NULL) {
		_tmp0_ = g_variant_is_floating (parameter);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		result = FALSE;
		return result;
	}
	if (action != NULL) {
		_tmp1_ = g_str_has_prefix (action, "app.");
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		gchar* action_name = NULL;
		gchar** _tmp2_;
		gchar** _tmp3_;
		gchar** _tmp4_;
		gint _tmp4__length1;
		const gchar* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		GVariantType* parameter_type = NULL;
		GActionGroup* action_group = NULL;
		GApplication* _tmp8_;
		GActionGroup* _tmp9_;
		gboolean _tmp10_ = FALSE;
		GActionGroup* _tmp11_;
		const gchar* _tmp12_;
		const GVariantType* _tmp13_ = NULL;
		gboolean _tmp14_;
		GVariantType* _tmp15_;
		_tmp3_ = _tmp2_ = g_strsplit (action, ".", 2);
		_tmp4_ = _tmp3_;
		_tmp4__length1 = _vala_array_length (_tmp2_);
		_tmp5_ = _tmp4_[1];
		_tmp6_ = g_strdup (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp4_ = (_vala_array_free (_tmp4_, _tmp4__length1, (GDestroyNotify) g_free), NULL);
		action_name = _tmp7_;
		parameter_type = NULL;
		_tmp8_ = self->priv->application;
		_tmp9_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, g_action_group_get_type (), GActionGroup));
		action_group = _tmp9_;
		_tmp11_ = action_group;
		_tmp12_ = action_name;
		_tmp14_ = g_action_group_query_action (_tmp11_, _tmp12_, NULL, &_tmp13_, NULL, NULL, NULL);
		_g_variant_type_free0 (parameter_type);
		_tmp15_ = _g_variant_type_copy0 (_tmp13_);
		parameter_type = _tmp15_;
		if (_tmp14_) {
			gboolean _tmp16_ = FALSE;
			gboolean _tmp17_ = FALSE;
			const GVariantType* _tmp18_;
			_tmp18_ = parameter_type;
			if (_tmp18_ == NULL) {
				_tmp17_ = parameter == NULL;
			} else {
				_tmp17_ = FALSE;
			}
			if (_tmp17_) {
				_tmp16_ = TRUE;
			} else {
				gboolean _tmp19_ = FALSE;
				gboolean _tmp20_ = FALSE;
				const GVariantType* _tmp21_;
				_tmp21_ = parameter_type;
				if (_tmp21_ != NULL) {
					_tmp20_ = parameter != NULL;
				} else {
					_tmp20_ = FALSE;
				}
				if (_tmp20_) {
					const GVariantType* _tmp22_;
					_tmp22_ = parameter_type;
					_tmp19_ = g_variant_is_of_type (parameter, _tmp22_);
				} else {
					_tmp19_ = FALSE;
				}
				_tmp16_ = _tmp19_;
			}
			_tmp10_ = _tmp16_;
		} else {
			_tmp10_ = FALSE;
		}
		if (_tmp10_) {
			GActionGroup* _tmp23_;
			const gchar* _tmp24_;
			_tmp23_ = action_group;
			_tmp24_ = action_name;
			g_action_group_activate_action (_tmp23_, _tmp24_, parameter);
			result = TRUE;
			_g_object_unref0 (action_group);
			_g_variant_type_free0 (parameter_type);
			_g_free0 (action_name);
			return result;
		}
		_g_object_unref0 (action_group);
		_g_variant_type_free0 (parameter_type);
		_g_free0 (action_name);
	} else {
		if (action == NULL) {
			GApplication* _tmp25_;
			_tmp25_ = self->priv->application;
			g_application_activate (_tmp25_);
			result = TRUE;
			return result;
		}
	}
	result = FALSE;
	return result;
}

static gboolean
freedesktop_notification_backend_provider_activate_detailed_action (FreedesktopNotificationBackendProvider* self,
                                                                    const gchar* detailed_action)
{
	gchar* action_name = NULL;
	GVariant* target_value = NULL;
	gboolean _tmp2_ = FALSE;
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (detailed_action != NULL, FALSE);
	{
		gchar* _tmp0_ = NULL;
		GVariant* _tmp1_ = NULL;
		g_action_parse_detailed_name (detailed_action, &_tmp0_, &_tmp1_, &_inner_error0_);
		_g_free0 (action_name);
		action_name = _tmp0_;
		_g_variant_unref0 (target_value);
		target_value = _tmp1_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		result = freedesktop_notification_backend_provider_activate_action (self, action_name, target_value);
		_g_variant_unref0 (target_value);
		_g_free0 (action_name);
		return result;
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
		result = FALSE;
		_g_variant_unref0 (target_value);
		_g_free0 (action_name);
		return result;
	}
	__finally0:
	_g_variant_unref0 (target_value);
	_g_free0 (action_name);
	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 _tmp2_;
}

static GSList*
vala_g_slist_remove_full (GSList* self,
                          gconstpointer data,
                          GFreeFunc func)
{
	GSList* l = NULL;
	GSList* result;
	l = self;
	while (TRUE) {
		GSList* _tmp0_;
		GSList* _tmp1_;
		gconstpointer _tmp2_;
		_tmp0_ = l;
		if (!(_tmp0_ != NULL)) {
			break;
		}
		_tmp1_ = l;
		_tmp2_ = ((GSList*) _tmp1_)->data;
		if (_tmp2_ != data) {
			GSList* _tmp3_;
			GSList* _tmp4_;
			_tmp3_ = l;
			_tmp4_ = ((GSList*) _tmp3_)->next;
			l = _tmp4_;
		} else {
			GSList* _tmp5_;
			gconstpointer _tmp6_;
			GSList* _tmp7_;
			_tmp5_ = l;
			_tmp6_ = ((GSList*) _tmp5_)->data;
			func (_tmp6_);
			_tmp7_ = l;
			self = g_slist_delete_link (self, (GSList*) _tmp7_);
			break;
		}
	}
	result = self;
	return result;
}

static void
freedesktop_notification_backend_provider_on_notification_closed (FreedesktopNotificationBackendProvider* self,
                                                                  guint32 id,
                                                                  guint32 reason)
{
	FreedesktopNotificationInfo* notification_info = NULL;
	FreedesktopNotificationInfo* _tmp0_;
	FreedesktopNotificationInfo* _tmp1_;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	FreedesktopNotificationInfo* _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = freedesktop_notification_backend_provider_lookup_by_external_id (self, id);
	notification_info = _tmp0_;
	_tmp1_ = notification_info;
	if (_tmp1_ == NULL) {
		return;
	}
	if (self->priv->has_persistence) {
		_tmp3_ = reason == ((guint32) FREEDESKTOP_NOTIFICATION_DESTROYED_REASON_EXPIRED);
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		FreedesktopNotificationInfo* _tmp4_;
		FtNotification* _tmp5_;
		_tmp4_ = notification_info;
		_tmp5_ = _tmp4_->notification;
		_tmp2_ = _tmp5_->is_transient;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		FreedesktopNotificationInfo* _tmp6_;
		_tmp6_ = notification_info;
		freedesktop_notification_backend_provider_withdraw_notification_internal (self, _tmp6_->external_id, NULL, NULL);
	}
	_tmp7_ = notification_info;
	self->priv->notifications = vala_g_slist_remove_full (self->priv->notifications, _tmp7_, _freedesktop_notification_info_free0_);
}

static void
freedesktop_notification_backend_provider_on_action_invoked (FreedesktopNotificationBackendProvider* self,
                                                             guint32 id,
                                                             const gchar* action_key)
{
	FreedesktopNotificationInfo* notification_info = NULL;
	FreedesktopNotificationInfo* _tmp0_;
	FreedesktopNotificationInfo* _tmp1_ = NULL;
	FreedesktopNotificationInfo* _tmp2_;
	FtNotification* _tmp3_ = NULL;
	FtNotification* notification = NULL;
	FtNotification* _tmp5_;
	gboolean _tmp6_ = FALSE;
	gboolean notification_closed = FALSE;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action_key != NULL);
	_tmp0_ = freedesktop_notification_backend_provider_lookup_by_external_id (self, id);
	notification_info = _tmp0_;
	_tmp2_ = notification_info;
	_tmp1_ = _tmp2_;
	_tmp3_ = NULL;
	if (_tmp1_ != NULL) {
		FtNotification* _tmp4_;
		_tmp4_ = _tmp1_->notification;
		_tmp3_ = _tmp4_;
	}
	notification = _tmp3_;
	_tmp5_ = notification;
	if (_tmp5_ == NULL) {
		return;
	}
	if (g_strcmp0 (action_key, "default") == 0) {
		FtNotification* _tmp7_;
		const gchar* _tmp8_;
		FtNotification* _tmp9_;
		GVariant* _tmp10_;
		_tmp7_ = notification;
		_tmp8_ = _tmp7_->default_action;
		_tmp9_ = notification;
		_tmp10_ = _tmp9_->default_target_value;
		_tmp6_ = freedesktop_notification_backend_provider_activate_action (self, _tmp8_, _tmp10_);
	} else {
		_tmp6_ = freedesktop_notification_backend_provider_activate_detailed_action (self, action_key);
	}
	notification_closed = _tmp6_;
	if (notification_closed) {
		FreedesktopNotificationInfo* _tmp11_;
		_tmp11_ = notification_info;
		self->priv->notifications = vala_g_slist_remove_full (self->priv->notifications, _tmp11_, _freedesktop_notification_info_free0_);
	}
}

static void
freedesktop_notification_backend_provider_withdraw_notification_internal_data_free (gpointer _data)
{
	FreedesktopNotificationBackendProviderWithdrawNotificationInternalData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (FreedesktopNotificationBackendProviderWithdrawNotificationInternalData, _data_);
}

static void
freedesktop_notification_backend_provider_withdraw_notification_internal (FreedesktopNotificationBackendProvider* self,
                                                                          guint32 external_id,
                                                                          GAsyncReadyCallback _callback_,
                                                                          gpointer _user_data_)
{
	FreedesktopNotificationBackendProviderWithdrawNotificationInternalData* _data_;
	FreedesktopNotificationBackendProvider* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (FreedesktopNotificationBackendProviderWithdrawNotificationInternalData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, freedesktop_notification_backend_provider_withdraw_notification_internal_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->external_id = external_id;
	freedesktop_notification_backend_provider_withdraw_notification_internal_co (_data_);
}

static void
freedesktop_notification_backend_provider_withdraw_notification_internal_finish (FreedesktopNotificationBackendProvider* self,
                                                                                 GAsyncResult* _res_)
{
	FreedesktopNotificationBackendProviderWithdrawNotificationInternalData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
freedesktop_notification_backend_provider_withdraw_notification_internal_ready (GObject* source_object,
                                                                                GAsyncResult* _res_,
                                                                                gpointer _user_data_)
{
	FreedesktopNotificationBackendProviderWithdrawNotificationInternalData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	freedesktop_notification_backend_provider_withdraw_notification_internal_co (_data_);
}

static gboolean
freedesktop_notification_backend_provider_withdraw_notification_internal_co (FreedesktopNotificationBackendProviderWithdrawNotificationInternalData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->external_id == ((guint32) 0U)) {
		_data_->_tmp0_ = TRUE;
	} else {
		_data_->_tmp1_ = _data_->self->priv->proxy;
		_data_->_tmp0_ = _data_->_tmp1_ == NULL;
	}
	if (_data_->_tmp0_) {
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	{
		_data_->_tmp2_ = _data_->self->priv->proxy;
		_data_->_state_ = 1;
		freedesktop_notifications_close_notification (_data_->_tmp2_, _data_->external_id, freedesktop_notification_backend_provider_withdraw_notification_internal_ready, _data_);
		return FALSE;
		_state_1:
		freedesktop_notifications_close_notification_finish (_data_->_tmp2_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->_error_ = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp3_ = _data_->_error_;
		_data_->_tmp4_ = g_quark_to_string (_data_->_tmp3_->domain);
		_data_->_tmp5_ = _data_->_error_;
		_data_->_tmp6_ = _data_->_error_;
		_data_->_tmp7_ = _data_->_tmp6_->message;
		g_warning ("notification-backend-provider.vala:353: Failed to withdraw notificatio" \
"n [%s.%d]: %s", _data_->_tmp4_, _data_->_tmp5_->code, _data_->_tmp7_);
		_g_error_free0 (_data_->_error_);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
freedesktop_notification_backend_provider_remove_by_external_id (FreedesktopNotificationBackendProvider* self,
                                                                 guint32 external_id)
{
	GSList* link = NULL;
	GSList* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->notifications;
	link = _tmp0_;
	while (TRUE) {
		GSList* _tmp1_;
		GSList* _tmp2_;
		gconstpointer _tmp3_;
		_tmp1_ = link;
		if (!(_tmp1_ != NULL)) {
			break;
		}
		_tmp2_ = link;
		_tmp3_ = _tmp2_->data;
		if (((FreedesktopNotificationInfo*) _tmp3_)->external_id == external_id) {
			GSList* next_link = NULL;
			GSList* _tmp4_;
			GSList* _tmp5_;
			GSList* _tmp6_;
			GSList* _tmp7_;
			_tmp4_ = link;
			_tmp5_ = _tmp4_->next;
			next_link = _tmp5_;
			_tmp6_ = link;
			self->priv->notifications = g_slist_remove_link (self->priv->notifications, _tmp6_);
			_tmp7_ = next_link;
			link = _tmp7_;
		} else {
			GSList* _tmp8_;
			GSList* _tmp9_;
			_tmp8_ = link;
			_tmp9_ = _tmp8_->next;
			link = _tmp9_;
		}
	}
}

static void
freedesktop_notification_backend_provider_real_send_notification_data_free (gpointer _data)
{
	FreedesktopNotificationBackendProviderSendNotificationData* _data_;
	_data_ = _data;
	_g_free0 (_data_->id);
	_ft_notification_unref0 (_data_->notification);
	_g_object_unref0 (_data_->self);
	g_slice_free (FreedesktopNotificationBackendProviderSendNotificationData, _data_);
}

static void
freedesktop_notification_backend_provider_real_send_notification (FtNotificationBackendProvider* base,
                                                                  const gchar* id,
                                                                  FtNotification* notification,
                                                                  GAsyncReadyCallback _callback_,
                                                                  gpointer _user_data_)
{
	FreedesktopNotificationBackendProvider * self;
	FreedesktopNotificationBackendProviderSendNotificationData* _data_;
	FreedesktopNotificationBackendProvider* _tmp0_;
	gchar* _tmp1_;
	FtNotification* _tmp2_;
	g_return_if_fail (id != NULL);
	g_return_if_fail (notification != NULL);
	self = (FreedesktopNotificationBackendProvider*) base;
	_data_ = g_slice_new0 (FreedesktopNotificationBackendProviderSendNotificationData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, freedesktop_notification_backend_provider_real_send_notification_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (id);
	_g_free0 (_data_->id);
	_data_->id = _tmp1_;
	_tmp2_ = _ft_notification_ref0 (notification);
	_ft_notification_unref0 (_data_->notification);
	_data_->notification = _tmp2_;
	freedesktop_notification_backend_provider_real_send_notification_co (_data_);
}

static void
freedesktop_notification_backend_provider_send_notification_finish (FtNotificationBackendProvider* base,
                                                                    GAsyncResult* _res_)
{
	FreedesktopNotificationBackendProviderSendNotificationData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static Block1Data*
block1_data_ref (Block1Data* _data1_)
{
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}

static void
block1_data_unref (void * _userdata_)
{
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		FreedesktopNotificationBackendProvider* self;
		self = _data1_->self;
		_data1_->actions = (_vala_array_free (_data1_->actions, _data1_->actions_length1, (GDestroyNotify) g_free), NULL);
		_g_object_unref0 (self);
		g_slice_free (Block1Data, _data1_);
	}
}

static void
_vala_array_add1 (gchar** * array,
                  gint* length,
                  gint* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add2 (gchar** * array,
                  gint* length,
                  gint* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add3 (gchar** * array,
                  gint* length,
                  gint* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add4 (gchar** * array,
                  gint* length,
                  gint* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
___lambda4_ (Block1Data* _data1_,
             const gchar* label,
             const gchar* action,
             GVariant* target_value)
{
	FreedesktopNotificationBackendProvider* self;
	gchar* _tmp0_;
	gchar* _tmp1_;
	self = _data1_->self;
	g_return_if_fail (label != NULL);
	g_return_if_fail (action != NULL);
	_tmp0_ = g_action_print_detailed_name (action, target_value);
	_vala_array_add3 (&_data1_->actions, &_data1_->actions_length1, &_data1_->_actions_size_, _tmp0_);
	_tmp1_ = g_strdup (label);
	_vala_array_add4 (&_data1_->actions, &_data1_->actions_length1, &_data1_->_actions_size_, _tmp1_);
}

static void
____lambda4__ft_notification_foreach_button_func (const gchar* label,
                                                  const gchar* action,
                                                  GVariant* target_value,
                                                  gpointer self)
{
	___lambda4_ (self, label, action, target_value);
}

static void
_g_variant_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_variant_unref (var), NULL));
}

static void
freedesktop_notification_backend_provider_send_notification_ready (GObject* source_object,
                                                                   GAsyncResult* _res_,
                                                                   gpointer _user_data_)
{
	FreedesktopNotificationBackendProviderSendNotificationData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	freedesktop_notification_backend_provider_real_send_notification_co (_data_);
}

static gboolean
freedesktop_notification_backend_provider_real_send_notification_co (FreedesktopNotificationBackendProviderSendNotificationData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->proxy;
	_vala_return_val_if_fail (_data_->_tmp0_ != NULL, "this.proxy != null", FALSE);
	_data_->_data1_ = g_slice_new0 (Block1Data);
	_data_->_data1_->_ref_count_ = 1;
	_data_->_data1_->self = g_object_ref (_data_->self);
	_data_->_data1_->_async_data_ = _data_;
	_data_->_tmp2_ = _data_->self->priv->cancellable;
	if (_data_->_tmp2_ == NULL) {
		_data_->_tmp1_ = TRUE;
	} else {
		_data_->_tmp3_ = _data_->self->priv->cancellable;
		_data_->_tmp1_ = g_cancellable_is_cancelled (_data_->_tmp3_);
	}
	if (_data_->_tmp1_) {
		block1_data_unref (_data_->_data1_);
		_data_->_data1_ = NULL;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp4_ = freedesktop_notification_backend_provider_lookup_by_id (_data_->self, _data_->id);
	_data_->existing_notification_info = _data_->_tmp4_;
	_data_->_tmp6_ = _data_->existing_notification_info;
	if (_data_->_tmp6_ != NULL) {
		_data_->_tmp7_ = _data_->existing_notification_info;
		_data_->_tmp8_ = _data_->_tmp7_->notification;
		_data_->_tmp5_ = ft_notification_is_similar (_data_->_tmp8_, _data_->notification);
	} else {
		_data_->_tmp5_ = FALSE;
	}
	if (_data_->_tmp5_) {
		block1_data_unref (_data_->_data1_);
		_data_->_data1_ = NULL;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp10_ = _data_->existing_notification_info;
	if (_data_->_tmp10_ != NULL) {
		_data_->_tmp11_ = _data_->existing_notification_info;
		_data_->_tmp9_ = _data_->_tmp11_->external_id;
	} else {
		_data_->_tmp9_ = (guint32) 0U;
	}
	_data_->replace_id = _data_->_tmp9_;
	_data_->_tmp12_ = g_new0 (gchar*, 0 + 1);
	_data_->_data1_->actions = _data_->_tmp12_;
	_data_->_data1_->actions_length1 = 0;
	_data_->_data1_->_actions_size_ = _data_->_data1_->actions_length1;
	_data_->_tmp14_ = _data_->notification->default_action;
	if (_data_->_tmp14_ != NULL) {
		_data_->_tmp13_ = _data_->self->priv->has_default_action;
	} else {
		_data_->_tmp13_ = FALSE;
	}
	if (_data_->_tmp13_) {
		_data_->_tmp15_ = g_strdup ("default");
		_vala_array_add1 (&_data_->_data1_->actions, &_data_->_data1_->actions_length1, &_data_->_data1_->_actions_size_, _data_->_tmp15_);
		_data_->_tmp16_ = g_strdup ("");
		_vala_array_add2 (&_data_->_data1_->actions, &_data_->_data1_->actions_length1, &_data_->_data1_->_actions_size_, _data_->_tmp16_);
	}
	if (_data_->self->priv->has_actions) {
		ft_notification_foreach_button (_data_->notification, ____lambda4__ft_notification_foreach_button_func, _data_->_data1_);
	}
	_data_->_tmp17_ = g_str_hash;
	_data_->_tmp18_ = g_str_equal;
	_data_->_tmp19_ = g_hash_table_new_full (_data_->_tmp17_, _data_->_tmp18_, _g_free0_, _g_variant_unref0_);
	_data_->hints = _data_->_tmp19_;
	_data_->_tmp20_ = _data_->hints;
	_data_->_tmp21_ = g_strdup ("desktop-entry");
	_data_->_tmp22_ = g_variant_new_string (APPLICATION_ID);
	g_variant_ref_sink (_data_->_tmp22_);
	g_hash_table_insert (_data_->_tmp20_, _data_->_tmp21_, _data_->_tmp22_);
	_data_->_tmp23_ = _data_->hints;
	_data_->_tmp24_ = g_strdup ("urgency");
	_data_->_tmp25_ = freedesktop_notification_urgency_to_variant (freedesktop_priority_to_urgency (_data_->notification->priority));
	g_hash_table_insert (_data_->_tmp23_, _data_->_tmp24_, _data_->_tmp25_);
	if (_data_->notification->is_transient) {
		_data_->_tmp26_ = _data_->hints;
		_data_->_tmp27_ = g_strdup ("transient");
		_data_->_tmp28_ = g_variant_new_boolean (TRUE);
		g_variant_ref_sink (_data_->_tmp28_);
		g_hash_table_insert (_data_->_tmp26_, _data_->_tmp27_, _data_->_tmp28_);
	}
	if (_data_->notification->suppress_sound) {
		_data_->_tmp29_ = _data_->hints;
		_data_->_tmp30_ = g_strdup ("suppress-sound");
		_data_->_tmp31_ = g_variant_new_boolean (TRUE);
		g_variant_ref_sink (_data_->_tmp31_);
		g_hash_table_insert (_data_->_tmp29_, _data_->_tmp30_, _data_->_tmp31_);
	}
	_data_->_tmp32_ = _data_->notification->category;
	if (_data_->_tmp32_ != NULL) {
		_data_->_tmp33_ = _data_->hints;
		_data_->_tmp34_ = g_strdup ("category");
		_data_->_tmp35_ = _data_->notification->category;
		_data_->_tmp36_ = g_variant_new_string (_data_->_tmp35_);
		g_variant_ref_sink (_data_->_tmp36_);
		g_hash_table_insert (_data_->_tmp33_, _data_->_tmp34_, _data_->_tmp36_);
	}
	_data_->_tmp37_ = _data_->notification->event_id;
	if (_data_->_tmp37_ != NULL) {
		_data_->_tmp38_ = _data_->hints;
		_data_->_tmp39_ = g_strdup ("event-id");
		_data_->_tmp40_ = _data_->notification->event_id;
		_data_->_tmp41_ = g_variant_new_string (_data_->_tmp40_);
		g_variant_ref_sink (_data_->_tmp41_);
		g_hash_table_insert (_data_->_tmp38_, _data_->_tmp39_, _data_->_tmp41_);
	}
	if (_data_->notification->priority != FT_NOTIFICATION_PRIORITY_URGENT) {
		_data_->_tmp42_ = _data_->notification->expire_timeout;
	} else {
		_data_->_tmp42_ = FREEDESKTOP_NOTIFICATION_BACKEND_PROVIDER_NO_EXPIRY;
	}
	_data_->expire_timeout = _data_->_tmp42_;
	_data_->_tmp43_ = freedesktop_notification_info_new (_data_->id, _data_->notification);
	_data_->tmp_notification_info = _data_->_tmp43_;
	_data_->_tmp44_ = _data_->tmp_notification_info;
	_data_->notification_info = _data_->_tmp44_;
	_data_->_tmp45_ = _data_->tmp_notification_info;
	_data_->tmp_notification_info = NULL;
	_data_->self->priv->notifications = g_slist_append (_data_->self->priv->notifications, _data_->_tmp45_);
	_data_->_tmp46_ = _data_->existing_notification_info;
	if (_data_->_tmp46_ != NULL) {
		_data_->_tmp47_ = _data_->existing_notification_info;
		_data_->replace_id = _data_->_tmp47_->external_id;
		_data_->_tmp48_ = _data_->existing_notification_info;
		_data_->self->priv->notifications = vala_g_slist_remove_full (_data_->self->priv->notifications, _data_->_tmp48_, _freedesktop_notification_info_free0_);
	}
	{
		_data_->_tmp50_ = _data_->notification->body;
		_data_->_tmp49_ = _data_->_tmp50_;
		if (_data_->_tmp49_ == NULL) {
			_data_->_tmp49_ = "";
		}
		_data_->_tmp51_ = _data_->self->priv->proxy;
		_data_->_tmp52_ = _data_->self->priv->application_name;
		_data_->_tmp53_ = _data_->self->priv->application_icon;
		_data_->_tmp54_ = _data_->notification->title;
		_data_->_tmp55_ = _data_->_data1_->actions;
		_data_->_tmp55__length1 = _data_->_data1_->actions_length1;
		_data_->_tmp56_ = _data_->hints;
		_data_->_tmp57_ = _data_->self->priv->cancellable;
		_data_->_state_ = 1;
		freedesktop_notifications_notify (_data_->_tmp51_, _data_->_tmp52_, _data_->replace_id, _data_->_tmp53_, _data_->_tmp54_, _data_->_tmp49_, _data_->_tmp55_, (gint) _data_->_tmp55__length1, _data_->_tmp56_, (gint32) _data_->expire_timeout, _data_->_tmp57_, freedesktop_notification_backend_provider_send_notification_ready, _data_);
		return FALSE;
		_state_1:
		_data_->external_id = freedesktop_notifications_notify_finish (_data_->_tmp51_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		if (_data_->replace_id != ((guint32) 0)) {
			_data_->_tmp58_ = _data_->replace_id != _data_->external_id;
		} else {
			_data_->_tmp58_ = FALSE;
		}
		if (_data_->_tmp58_) {
			_data_->_state_ = 2;
			freedesktop_notification_backend_provider_withdraw_notification_internal (_data_->self, _data_->replace_id, freedesktop_notification_backend_provider_send_notification_ready, _data_);
			return FALSE;
			_state_2:
			freedesktop_notification_backend_provider_withdraw_notification_internal_finish (_data_->self, _data_->_res_);
		}
		_data_->_tmp59_ = _data_->self->priv->notifications;
		_data_->_tmp60_ = _data_->notification_info;
		if (g_slist_index (_data_->_tmp59_, _data_->_tmp60_) >= 0) {
			_data_->_tmp61_ = _data_->notification_info;
			_data_->_tmp61_->external_id = _data_->external_id;
		} else {
			_data_->_state_ = 3;
			freedesktop_notification_backend_provider_withdraw_notification_internal (_data_->self, _data_->external_id, freedesktop_notification_backend_provider_send_notification_ready, _data_);
			return FALSE;
			_state_3:
			freedesktop_notification_backend_provider_withdraw_notification_internal_finish (_data_->self, _data_->_res_);
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->_error_ = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp62_ = _data_->_error_;
		_data_->_tmp63_ = g_quark_to_string (_data_->_tmp62_->domain);
		_data_->_tmp64_ = _data_->_error_;
		_data_->_tmp65_ = _data_->_error_;
		_data_->_tmp66_ = _data_->_tmp65_->message;
		g_warning ("notification-backend-provider.vala:466: Failed to send notification [%" \
"s.%d]: %s", _data_->_tmp63_, _data_->_tmp64_->code, _data_->_tmp66_);
		if (_data_->replace_id != ((guint32) 0U)) {
			freedesktop_notification_backend_provider_remove_by_external_id (_data_->self, _data_->replace_id);
			_data_->_state_ = 4;
			freedesktop_notification_backend_provider_withdraw_notification_internal (_data_->self, _data_->replace_id, freedesktop_notification_backend_provider_send_notification_ready, _data_);
			return FALSE;
			_state_4:
			freedesktop_notification_backend_provider_withdraw_notification_internal_finish (_data_->self, _data_->_res_);
		}
		_g_error_free0 (_data_->_error_);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_freedesktop_notification_info_free0 (_data_->tmp_notification_info);
		_g_hash_table_unref0 (_data_->hints);
		block1_data_unref (_data_->_data1_);
		_data_->_data1_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_freedesktop_notification_info_free0 (_data_->tmp_notification_info);
	_g_hash_table_unref0 (_data_->hints);
	block1_data_unref (_data_->_data1_);
	_data_->_data1_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
freedesktop_notification_backend_provider_real_withdraw_notification_data_free (gpointer _data)
{
	FreedesktopNotificationBackendProviderWithdrawNotificationData* _data_;
	_data_ = _data;
	_g_free0 (_data_->id);
	_g_object_unref0 (_data_->self);
	g_slice_free (FreedesktopNotificationBackendProviderWithdrawNotificationData, _data_);
}

static void
freedesktop_notification_backend_provider_real_withdraw_notification (FtNotificationBackendProvider* base,
                                                                      const gchar* id,
                                                                      GAsyncReadyCallback _callback_,
                                                                      gpointer _user_data_)
{
	FreedesktopNotificationBackendProvider * self;
	FreedesktopNotificationBackendProviderWithdrawNotificationData* _data_;
	FreedesktopNotificationBackendProvider* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (id != NULL);
	self = (FreedesktopNotificationBackendProvider*) base;
	_data_ = g_slice_new0 (FreedesktopNotificationBackendProviderWithdrawNotificationData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, freedesktop_notification_backend_provider_real_withdraw_notification_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (id);
	_g_free0 (_data_->id);
	_data_->id = _tmp1_;
	freedesktop_notification_backend_provider_real_withdraw_notification_co (_data_);
}

static void
freedesktop_notification_backend_provider_withdraw_notification_finish (FtNotificationBackendProvider* base,
                                                                        GAsyncResult* _res_)
{
	FreedesktopNotificationBackendProviderWithdrawNotificationData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
freedesktop_notification_backend_provider_withdraw_notification_ready (GObject* source_object,
                                                                       GAsyncResult* _res_,
                                                                       gpointer _user_data_)
{
	FreedesktopNotificationBackendProviderWithdrawNotificationData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	freedesktop_notification_backend_provider_real_withdraw_notification_co (_data_);
}

static gboolean
freedesktop_notification_backend_provider_real_withdraw_notification_co (FreedesktopNotificationBackendProviderWithdrawNotificationData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->proxy;
	_vala_return_val_if_fail (_data_->_tmp0_ != NULL, "this.proxy != null", FALSE);
	_data_->_tmp2_ = _data_->self->priv->cancellable;
	if (_data_->_tmp2_ == NULL) {
		_data_->_tmp1_ = TRUE;
	} else {
		_data_->_tmp3_ = _data_->self->priv->cancellable;
		_data_->_tmp1_ = g_cancellable_is_cancelled (_data_->_tmp3_);
	}
	if (_data_->_tmp1_) {
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp4_ = freedesktop_notification_backend_provider_lookup_by_id (_data_->self, _data_->id);
	_data_->notification_info = _data_->_tmp4_;
	_data_->_tmp5_ = _data_->notification_info;
	if (_data_->_tmp5_ == NULL) {
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp7_ = _data_->notification_info;
	if (_data_->_tmp7_ != NULL) {
		_data_->_tmp8_ = _data_->notification_info;
		_data_->_tmp6_ = _data_->_tmp8_->external_id;
	} else {
		_data_->_tmp6_ = (guint32) 0U;
	}
	_data_->external_id = _data_->_tmp6_;
	if (_data_->external_id != ((guint32) 0U)) {
		freedesktop_notification_backend_provider_remove_by_external_id (_data_->self, _data_->external_id);
		_data_->_state_ = 1;
		freedesktop_notification_backend_provider_withdraw_notification_internal (_data_->self, _data_->external_id, freedesktop_notification_backend_provider_withdraw_notification_ready, _data_);
		return FALSE;
		_state_1:
		freedesktop_notification_backend_provider_withdraw_notification_internal_finish (_data_->self, _data_->_res_);
	} else {
		_data_->_tmp9_ = _data_->notification_info;
		_data_->self->priv->notifications = vala_g_slist_remove_full (_data_->self->priv->notifications, _data_->_tmp9_, _freedesktop_notification_info_free0_);
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
freedesktop_notification_backend_provider_real_dispose (GObject* base)
{
	FreedesktopNotificationBackendProvider * self;
	self = (FreedesktopNotificationBackendProvider*) base;
	_g_object_unref0 (self->priv->application);
	self->priv->application = NULL;
	G_OBJECT_CLASS (freedesktop_notification_backend_provider_parent_class)->dispose ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (self, FT_TYPE_PROVIDER, FtProvider));
}

FreedesktopNotificationBackendProvider*
freedesktop_notification_backend_provider_construct (GType object_type)
{
	FreedesktopNotificationBackendProvider * self = NULL;
	self = (FreedesktopNotificationBackendProvider*) ft_provider_construct (object_type);
	return self;
}

FreedesktopNotificationBackendProvider*
freedesktop_notification_backend_provider_new (void)
{
	return freedesktop_notification_backend_provider_construct (FREEDESKTOP_TYPE_NOTIFICATION_BACKEND_PROVIDER);
}

static GObject *
freedesktop_notification_backend_provider_constructor (GType type,
                                                       guint n_construct_properties,
                                                       GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	FreedesktopNotificationBackendProvider * self;
	GApplication* _tmp0_;
	GApplication* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	parent_class = G_OBJECT_CLASS (freedesktop_notification_backend_provider_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FREEDESKTOP_TYPE_NOTIFICATION_BACKEND_PROVIDER, FreedesktopNotificationBackendProvider);
	_tmp0_ = g_application_get_default ();
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->application);
	self->priv->application = _tmp1_;
	_tmp2_ = g_get_application_name ();
	_tmp3_ = g_strdup (_tmp2_);
	_g_free0 (self->priv->application_name);
	self->priv->application_name = _tmp3_;
	return obj;
}

static void
freedesktop_notification_backend_provider_class_init (FreedesktopNotificationBackendProviderClass * klass,
                                                      gpointer klass_data)
{
	freedesktop_notification_backend_provider_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FreedesktopNotificationBackendProvider_private_offset);
	((FtProviderClass *) klass)->initialize = (void (*) (FtProvider*, GCancellable*, GAsyncReadyCallback, gpointer)) freedesktop_notification_backend_provider_real_initialize;
	((FtProviderClass *) klass)->initialize_finish = (void (*) (FtProvider*, GAsyncResult*, GError**)) freedesktop_notification_backend_provider_initialize_finish;
	((FtProviderClass *) klass)->uninitialize = (void (*) (FtProvider*, GAsyncReadyCallback, gpointer)) freedesktop_notification_backend_provider_real_uninitialize;
	((FtProviderClass *) klass)->uninitialize_finish = (void (*) (FtProvider*, GAsyncResult*, GError**)) freedesktop_notification_backend_provider_uninitialize_finish;
	((FtProviderClass *) klass)->enable = (void (*) (FtProvider*, GCancellable*, GAsyncReadyCallback, gpointer)) freedesktop_notification_backend_provider_real_enable;
	((FtProviderClass *) klass)->enable_finish = (void (*) (FtProvider*, GAsyncResult*, GError**)) freedesktop_notification_backend_provider_enable_finish;
	((FtProviderClass *) klass)->disable = (void (*) (FtProvider*, GAsyncReadyCallback, gpointer)) freedesktop_notification_backend_provider_real_disable;
	((FtProviderClass *) klass)->disable_finish = (void (*) (FtProvider*, GAsyncResult*, GError**)) freedesktop_notification_backend_provider_disable_finish;
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) freedesktop_notification_backend_provider_real_dispose;
	G_OBJECT_CLASS (klass)->constructor = freedesktop_notification_backend_provider_constructor;
	G_OBJECT_CLASS (klass)->finalize = freedesktop_notification_backend_provider_finalize;
}

static void
freedesktop_notification_backend_provider_ft_notification_backend_provider_interface_init (FtNotificationBackendProviderIface * iface,
                                                                                           gpointer iface_data)
{
	freedesktop_notification_backend_provider_ft_notification_backend_provider_parent_iface = g_type_interface_peek_parent (iface);
	iface->send_notification = (void (*) (FtNotificationBackendProvider*, const gchar*, FtNotification*, GAsyncReadyCallback, gpointer)) freedesktop_notification_backend_provider_real_send_notification;
	iface->send_notification_finish = (void (*) (FtNotificationBackendProvider*, GAsyncResult*)) freedesktop_notification_backend_provider_send_notification_finish;
	iface->withdraw_notification = (void (*) (FtNotificationBackendProvider*, const gchar*, GAsyncReadyCallback, gpointer)) freedesktop_notification_backend_provider_real_withdraw_notification;
	iface->withdraw_notification_finish = (void (*) (FtNotificationBackendProvider*, GAsyncResult*)) freedesktop_notification_backend_provider_withdraw_notification_finish;
}

static void
freedesktop_notification_backend_provider_instance_init (FreedesktopNotificationBackendProvider * self,
                                                         gpointer klass)
{
	self->priv = freedesktop_notification_backend_provider_get_instance_private (self);
	self->priv->has_actions = FALSE;
	self->priv->watcher_id = (guint) 0;
	self->priv->proxy = NULL;
	self->priv->notifications = NULL;
	self->priv->cancellable = NULL;
}

static void
freedesktop_notification_backend_provider_finalize (GObject * obj)
{
	FreedesktopNotificationBackendProvider * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FREEDESKTOP_TYPE_NOTIFICATION_BACKEND_PROVIDER, FreedesktopNotificationBackendProvider);
	_g_object_unref0 (self->priv->proxy);
	(self->priv->notifications == NULL) ? NULL : (self->priv->notifications = (_g_slist_free__freedesktop_notification_info_free0_ (self->priv->notifications), NULL));
	_g_object_unref0 (self->priv->cancellable);
	_g_object_unref0 (self->priv->application);
	_g_free0 (self->priv->application_name);
	_g_free0 (self->priv->application_icon);
	G_OBJECT_CLASS (freedesktop_notification_backend_provider_parent_class)->finalize (obj);
}

GType
freedesktop_notification_backend_provider_get_type (void)
{
	return freedesktop_notification_backend_provider_type_id;
}

GType
freedesktop_notification_backend_provider_register_type (GTypeModule * module)
{
	static const GTypeInfo g_define_type_info = { sizeof (FreedesktopNotificationBackendProviderClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) freedesktop_notification_backend_provider_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FreedesktopNotificationBackendProvider), 0, (GInstanceInitFunc) freedesktop_notification_backend_provider_instance_init, NULL };
	static const GInterfaceInfo ft_notification_backend_provider_info = { (GInterfaceInitFunc) freedesktop_notification_backend_provider_ft_notification_backend_provider_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	freedesktop_notification_backend_provider_type_id = g_type_module_register_type (module, FT_TYPE_PROVIDER, "FreedesktopNotificationBackendProvider", &g_define_type_info, 0);
	g_type_module_add_interface (module, freedesktop_notification_backend_provider_type_id, FT_TYPE_NOTIFICATION_BACKEND_PROVIDER, &ft_notification_backend_provider_info);
	FreedesktopNotificationBackendProvider_private_offset = sizeof (FreedesktopNotificationBackendProviderPrivate);
	return freedesktop_notification_backend_provider_type_id;
}

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

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

