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

#include <glib-object.h>
#include <gsk/gsk.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <stdio.h>
#include <gio/gio.h>
#include <float.h>
#include <math.h>
#include <graphene-gobject.h>
#include <unistd.h>
#include <wayland-client.h>
#include <gdk/wayland/gdkwayland.h>
#include <cairo-gobject.h>
#include <gobject/gvaluecollector.h>

#define SWAY_NOTIFICATION_CENTER_FUNCTIONS_SCALING_FILTER GSK_SCALING_FILTER_NEAREST
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define SWAY_NOTIFICATION_CENTER_TYPE_FUNCTIONS (sway_notification_center_functions_get_type ())
#define SWAY_NOTIFICATION_CENTER_FUNCTIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWAY_NOTIFICATION_CENTER_TYPE_FUNCTIONS, SwayNotificationCenterFunctions))
#define SWAY_NOTIFICATION_CENTER_FUNCTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWAY_NOTIFICATION_CENTER_TYPE_FUNCTIONS, SwayNotificationCenterFunctionsClass))
#define SWAY_NOTIFICATION_CENTER_IS_FUNCTIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWAY_NOTIFICATION_CENTER_TYPE_FUNCTIONS))
#define SWAY_NOTIFICATION_CENTER_IS_FUNCTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWAY_NOTIFICATION_CENTER_TYPE_FUNCTIONS))
#define SWAY_NOTIFICATION_CENTER_FUNCTIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWAY_NOTIFICATION_CENTER_TYPE_FUNCTIONS, SwayNotificationCenterFunctionsClass))

typedef struct _SwayNotificationCenterFunctions SwayNotificationCenterFunctions;
typedef struct _SwayNotificationCenterFunctionsClass SwayNotificationCenterFunctionsClass;
typedef struct _SwayNotificationCenterFunctionsPrivate SwayNotificationCenterFunctionsPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define SWAY_NOTIFICATION_CENTER_TYPE_IMAGE_DATA (sway_notification_center_image_data_get_type ())
typedef struct _SwayNotificationCenterImageData SwayNotificationCenterImageData;

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

typedef struct _SwayNotificationCenterConfigModel SwayNotificationCenterConfigModel;
typedef struct _SwayNotificationCenterConfigModelClass SwayNotificationCenterConfigModelClass;
typedef enum  {
	SWAY_NOTIFICATION_CENTER_CSS_PRIORITY_APPLICATION,
	SWAY_NOTIFICATION_CENTER_CSS_PRIORITY_USER
} SwayNotificationCenterCssPriority;

#define SWAY_NOTIFICATION_CENTER_TYPE_CSS_PRIORITY (sway_notification_center_css_priority_get_type ())
typedef gboolean (*SwayNotificationCenterFunctionsFilterFunc) (gchar character, gpointer user_data);
typedef struct _Block25Data Block25Data;
typedef struct _Block26Data Block26Data;
#define _g_io_channel_unref0(var) ((var == NULL) ? NULL : (var = (g_io_channel_unref (var), NULL)))
typedef struct _SwayNotificationCenterFunctionsExecuteCommandData SwayNotificationCenterFunctionsExecuteCommandData;
typedef struct _SwayNotificationCenterParamSpecFunctions SwayNotificationCenterParamSpecFunctions;

struct _SwayNotificationCenterFunctions {
	GTypeInstance parent_instance;
	volatile int ref_count;
	SwayNotificationCenterFunctionsPrivate * priv;
};

struct _SwayNotificationCenterFunctionsClass {
	GTypeClass parent_class;
	void (*finalize) (SwayNotificationCenterFunctions *self);
};

struct _SwayNotificationCenterImageData {
	gint width;
	gint height;
	gint rowstride;
	gboolean has_alpha;
	gint bits_per_sample;
	gint channels;
	guint8* data;
	gint data_length1;
	gboolean is_initialized;
};

struct _Block25Data {
	int _ref_count_;
	gpointer _async_data_;
};

struct _Block26Data {
	int _ref_count_;
	Block25Data * _data25_;
	gint std_output;
	gchar* res;
	gint end_status;
};

struct _SwayNotificationCenterFunctionsExecuteCommandData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	gchar* cmd;
	gchar** env_additions;
	gint env_additions_length1;
	gchar* msg;
	gboolean result;
	Block25Data* _data25_;
	gchar* _tmp0_;
	Block26Data* _data26_;
	gchar** spawn_env;
	gchar** _tmp1_;
	gchar** _tmp2_;
	gint spawn_env_length1;
	gint _spawn_env_size_;
	gchar** additions_collection;
	gint additions_collection_length1;
	gint _additions_collection_size_;
	gint additions_it;
	gchar* _tmp3_;
	gchar* additions;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	gchar** argvp;
	gint argvp_length1;
	gint _argvp_size_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar** _tmp8_;
	gint _tmp9_;
	gchar** _tmp10_;
	gint _tmp10__length1;
	const gchar* _tmp11_;
	gchar** _tmp12_;
	gint _tmp12__length1;
	const gchar* _tmp13_;
	gchar** _tmp14_;
	gint _tmp14__length1;
	const gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	GPid child_pid;
	gchar** _tmp19_;
	gint _tmp19__length1;
	gchar** _tmp20_;
	gint _tmp20__length1;
	GPid _tmp21_;
	gint _tmp22_;
	gchar* _tmp23_;
	GIOChannel* output;
	GIOChannel* _tmp24_;
	GIOChannel* _tmp25_;
	const gchar* _tmp26_;
	gchar* _tmp27_;
	GError* e;
	GError* _tmp28_;
	const gchar* _tmp29_;
	GError* _tmp30_;
	const gchar* _tmp31_;
	gchar* _tmp32_;
	GError* _inner_error0_;
};

struct _SwayNotificationCenterParamSpecFunctions {
	GParamSpec parent_instance;
};

static gpointer sway_notification_center_functions_parent_class = NULL;
static GtkCssProvider* sway_notification_center_functions_system_css_provider;
static GtkCssProvider* sway_notification_center_functions_system_css_provider = NULL;
static GtkCssProvider* sway_notification_center_functions_user_css_provider;
static GtkCssProvider* sway_notification_center_functions_user_css_provider = NULL;
VALA_EXTERN gchar* sway_notification_center_custom_packaged_css;
VALA_EXTERN gboolean sway_notification_center_skip_packaged_css;
VALA_EXTERN GListModel* sway_notification_center_monitors;

VALA_EXTERN gpointer sway_notification_center_functions_ref (gpointer instance);
VALA_EXTERN void sway_notification_center_functions_unref (gpointer instance);
VALA_EXTERN GParamSpec* sway_notification_center_param_spec_functions (const gchar* name,
                                                           const gchar* nick,
                                                           const gchar* blurb,
                                                           GType object_type,
                                                           GParamFlags flags);
VALA_EXTERN void sway_notification_center_value_set_functions (GValue* value,
                                                   gpointer v_object);
VALA_EXTERN void sway_notification_center_value_take_functions (GValue* value,
                                                    gpointer v_object);
VALA_EXTERN gpointer sway_notification_center_value_get_functions (const GValue* value);
VALA_EXTERN GType sway_notification_center_functions_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SwayNotificationCenterFunctions, sway_notification_center_functions_unref)
static SwayNotificationCenterFunctions* sway_notification_center_functions_new (void);
static SwayNotificationCenterFunctions* sway_notification_center_functions_construct (GType object_type);
VALA_EXTERN void sway_notification_center_functions_init (void);
VALA_EXTERN gchar* sway_notification_center_functions_uri_to_path (gchar* uri);
VALA_EXTERN void sway_notification_center_functions_set_image_uri (gchar* uri,
                                                       GtkImage* img,
                                                       gboolean file_exists,
                                                       gboolean is_theme_icon);
VALA_EXTERN GType sway_notification_center_image_data_get_type (void) G_GNUC_CONST ;
VALA_EXTERN SwayNotificationCenterImageData* sway_notification_center_image_data_dup (const SwayNotificationCenterImageData* self);
VALA_EXTERN void sway_notification_center_image_data_free (SwayNotificationCenterImageData* self);
VALA_EXTERN void sway_notification_center_functions_set_image_data (SwayNotificationCenterImageData* data,
                                                        GtkImage* img);
VALA_EXTERN gboolean sway_notification_center_functions_load_css (const gchar* style_path);
VALA_EXTERN GType sway_notification_center_config_model_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SwayNotificationCenterConfigModel, g_object_unref)
VALA_EXTERN SwayNotificationCenterConfigModel* sway_notification_center_config_model_get_instance (void);
VALA_EXTERN GType sway_notification_center_css_priority_get_type (void) G_GNUC_CONST ;
VALA_EXTERN SwayNotificationCenterCssPriority sway_notification_center_config_model_get_cssPriority (SwayNotificationCenterConfigModel* self);
VALA_EXTERN gint sway_notification_center_css_priority_get_priority (SwayNotificationCenterCssPriority self);
VALA_EXTERN gchar* sway_notification_center_functions_get_style_path (gchar* custom_path,
                                                          gboolean only_system);
static void _vala_array_add37 (gchar** * array,
                        gint* length,
                        gint* size,
                        gchar* value);
static void _vala_array_add38 (gchar** * array,
                        gint* length,
                        gint* size,
                        gchar* value);
static void _vala_array_add39 (gchar** * array,
                        gint* length,
                        gint* size,
                        gchar* value);
static void _vala_array_add40 (gchar** * array,
                        gint* length,
                        gint* size,
                        gchar* value);
VALA_EXTERN gchar* sway_notification_center_functions_get_config_path (gchar* custom_path);
static void _vala_array_add41 (gchar** * array,
                        gint* length,
                        gint* size,
                        gchar* value);
static void _vala_array_add42 (gchar** * array,
                        gint* length,
                        gint* size,
                        gchar* value);
static void _vala_array_add43 (gchar** * array,
                        gint* length,
                        gint* size,
                        gchar* value);
static void _vala_array_add44 (gchar** * array,
                        gint* length,
                        gint* size,
                        gchar* value);
VALA_EXTERN GType sway_notification_center_functions_get_base_type (GType type);
VALA_EXTERN void sway_notification_center_functions_scale_texture (GdkTexture* texture,
                                                       gint buffer_width,
                                                       gint buffer_height,
                                                       gint img_scale,
                                                       GtkSnapshot* snapshot);
static void sway_notification_center_functions_draw_scale_wide (gint buffer_width,
                                                         gint width,
                                                         gint buffer_height,
                                                         gint height,
                                                         GtkSnapshot* snapshot,
                                                         GdkTexture* texture);
static void sway_notification_center_functions_draw_scale_tall (gint buffer_width,
                                                         gint width,
                                                         gint buffer_height,
                                                         gint height,
                                                         GtkSnapshot* snapshot,
                                                         GdkTexture* texture);
VALA_EXTERN gchar* sway_notification_center_functions_filter_string (const gchar* body,
                                                         SwayNotificationCenterFunctionsFilterFunc func,
                                                         gpointer func_target);
static void sway_notification_center_functions_execute_command_data_free (gpointer _data);
VALA_EXTERN void sway_notification_center_functions_execute_command (const gchar* cmd,
                                                         gchar** env_additions,
                                                         gint env_additions_length1,
                                                         GAsyncReadyCallback _callback_,
                                                         gpointer _user_data_);
VALA_EXTERN gboolean sway_notification_center_functions_execute_command_finish (GAsyncResult* _res_,
                                                                    gchar** msg);
static gboolean sway_notification_center_functions_execute_command_co (SwayNotificationCenterFunctionsExecuteCommandData* _data_);
static Block25Data* block25_data_ref (Block25Data* _data25_);
static void block25_data_unref (void * _userdata_);
static Block26Data* block26_data_ref (Block26Data* _data26_);
static void block26_data_unref (void * _userdata_);
static void _vala_array_add45 (gchar** * array,
                        gint* length,
                        gint* size,
                        gchar* value);
static gboolean ___lambda13_ (Block26Data* _data26_,
                       GIOChannel* channel,
                       GIOCondition condition);
static gboolean ____lambda13__gio_func (GIOChannel* source,
                                 GIOCondition condition,
                                 gpointer self);
static void ___lambda14_ (Block26Data* _data26_,
                   GPid pid,
                   gint status);
static void ____lambda14__gchild_watch_func (GPid pid,
                                      gint wait_status,
                                      gpointer self);
VALA_EXTERN struct wl_display* sway_notification_center_functions_get_wl_display (void);
VALA_EXTERN struct wl_surface* sway_notification_center_functions_get_wl_surface (GdkSurface* surface);
VALA_EXTERN gdouble sway_notification_center_functions_lerp (gdouble a,
                                                 gdouble b,
                                                 gdouble t);
VALA_EXTERN GdkMonitor* sway_notification_center_functions_try_get_monitor (const gchar* name);
VALA_EXTERN gchar* sway_notification_center_functions_monitor_to_string (GdkMonitor* monitor);
static void sway_notification_center_functions_finalize (SwayNotificationCenterFunctions * obj);
static GType sway_notification_center_functions_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);

static SwayNotificationCenterFunctions*
sway_notification_center_functions_construct (GType object_type)
{
	SwayNotificationCenterFunctions* self = NULL;
	self = (SwayNotificationCenterFunctions*) g_type_create_instance (object_type);
	return self;
}

static SwayNotificationCenterFunctions*
sway_notification_center_functions_new (void)
{
	return sway_notification_center_functions_construct (SWAY_NOTIFICATION_CENTER_TYPE_FUNCTIONS);
}

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

void
sway_notification_center_functions_init (void)
{
	GtkCssProvider* _tmp0_;
	GtkCssProvider* _tmp1_;
	GtkIconTheme* theme = NULL;
	GdkDisplay* _tmp2_;
	GtkIconTheme* _tmp3_;
	GtkIconTheme* _tmp4_;
	_tmp0_ = gtk_css_provider_new ();
	if (_tmp0_) {
		g_object_set_data ((GObject *) _tmp0_, "vala-creation-function", "SwayNotificationCenter.Functions.init");
	}
	_g_object_unref0 (sway_notification_center_functions_system_css_provider);
	sway_notification_center_functions_system_css_provider = _tmp0_;
	_tmp1_ = gtk_css_provider_new ();
	if (_tmp1_) {
		g_object_set_data ((GObject *) _tmp1_, "vala-creation-function", "SwayNotificationCenter.Functions.init");
	}
	_g_object_unref0 (sway_notification_center_functions_user_css_provider);
	sway_notification_center_functions_user_css_provider = _tmp1_;
	_tmp2_ = gdk_display_get_default ();
	_tmp3_ = gtk_icon_theme_get_for_display (_tmp2_);
	_tmp4_ = _g_object_ref0 (_tmp3_);
	theme = _tmp4_;
	gtk_icon_theme_add_resource_path (theme, "/org/erikreider/swaync/icons");
	_g_object_unref0 (theme);
}

static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strstrip (_result_);
	result = _result_;
	return result;
}

static gchar*
string_slice (const gchar* self,
              glong start,
              glong end)
{
	glong string_length = 0L;
	gint _tmp0_;
	gint _tmp1_;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gchar* _tmp4_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	string_length = (glong) _tmp1_;
	if (start < ((glong) 0)) {
		start = string_length + start;
	}
	if (end < ((glong) 0)) {
		end = string_length + end;
	}
	if (start >= ((glong) 0)) {
		_tmp2_ = start <= string_length;
	} else {
		_tmp2_ = FALSE;
	}
	g_return_val_if_fail (_tmp2_, NULL);
	if (end >= ((glong) 0)) {
		_tmp3_ = end <= string_length;
	} else {
		_tmp3_ = FALSE;
	}
	g_return_val_if_fail (_tmp3_, NULL);
	g_return_val_if_fail (start <= end, NULL);
	_tmp4_ = g_strndup (((gchar*) self) + start, (gsize) (end - start));
	result = _tmp4_;
	return result;
}

gchar*
sway_notification_center_functions_uri_to_path (gchar* uri)
{
	gchar* _tmp0_;
	static const char URI_PREFIX[] = "file://";
	gboolean _tmp1_ = FALSE;
	gint _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	gboolean is_uri = FALSE;
	gchar* _tmp15_;
	gchar* result;
	g_return_val_if_fail (uri != NULL, NULL);
	_tmp0_ = string_strip (uri);
	_g_free0 (uri);
	uri = _tmp0_;
	_tmp2_ = strlen (uri);
	_tmp3_ = _tmp2_;
	_tmp4_ = strlen (URI_PREFIX);
	_tmp5_ = _tmp4_;
	if (_tmp3_ >= _tmp5_) {
		gint _tmp6_;
		gint _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
		_tmp6_ = strlen (URI_PREFIX);
		_tmp7_ = _tmp6_;
		_tmp8_ = string_slice (uri, (glong) 0, (glong) _tmp7_);
		_tmp9_ = _tmp8_;
		_tmp1_ = g_strcmp0 (_tmp9_, URI_PREFIX) == 0;
		_g_free0 (_tmp9_);
	} else {
		_tmp1_ = FALSE;
	}
	is_uri = _tmp1_;
	if (is_uri) {
		gint _tmp10_;
		gint _tmp11_;
		gint _tmp12_;
		gint _tmp13_;
		gchar* _tmp14_;
		_tmp10_ = strlen (URI_PREFIX);
		_tmp11_ = _tmp10_;
		_tmp12_ = strlen (uri);
		_tmp13_ = _tmp12_;
		_tmp14_ = string_slice (uri, (glong) _tmp11_, (glong) _tmp13_);
		_g_free0 (uri);
		uri = _tmp14_;
	}
	_tmp15_ = g_strdup (uri);
	result = _tmp15_;
	_g_free0 (uri);
	return result;
}

void
sway_notification_center_functions_set_image_uri (gchar* uri,
                                                  GtkImage* img,
                                                  gboolean file_exists,
                                                  gboolean is_theme_icon)
{
	static const char URI_PREFIX[] = "file://";
	gboolean _tmp0_ = FALSE;
	gint _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	gboolean is_uri = FALSE;
	gboolean _tmp9_ = FALSE;
	GtkImageType _tmp31_;
	GtkImageType _tmp32_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (uri != NULL);
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (img, gtk_image_get_type ()));
	_tmp1_ = strlen (uri);
	_tmp2_ = _tmp1_;
	_tmp3_ = strlen (URI_PREFIX);
	_tmp4_ = _tmp3_;
	if (_tmp2_ >= _tmp4_) {
		gint _tmp5_;
		gint _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		_tmp5_ = strlen (URI_PREFIX);
		_tmp6_ = _tmp5_;
		_tmp7_ = string_slice (uri, (glong) 0, (glong) _tmp6_);
		_tmp8_ = _tmp7_;
		_tmp0_ = g_strcmp0 (_tmp8_, URI_PREFIX) == 0;
		_g_free0 (_tmp8_);
	} else {
		_tmp0_ = FALSE;
	}
	is_uri = _tmp0_;
	if (!is_theme_icon) {
		gboolean _tmp10_ = FALSE;
		if (is_uri) {
			_tmp10_ = TRUE;
		} else {
			_tmp10_ = file_exists;
		}
		_tmp9_ = _tmp10_;
	} else {
		_tmp9_ = FALSE;
	}
	if (_tmp9_) {
		{
			GtkRequisition natural_size = {0};
			GtkRequisition _tmp16_ = {0};
			GdkPixbuf* pixbuf = NULL;
			gchar* _tmp17_;
			gchar* _tmp18_;
			GtkRequisition _tmp19_;
			GtkRequisition _tmp20_;
			GdkPixbuf* _tmp21_;
			GdkPixbuf* _tmp22_;
			GdkTexture* texture = NULL;
			GdkPixbuf* _tmp23_;
			GdkTexture* _tmp24_;
			GdkTexture* _tmp25_;
			if (is_uri) {
				gint _tmp11_;
				gint _tmp12_;
				gint _tmp13_;
				gint _tmp14_;
				gchar* _tmp15_;
				_tmp11_ = strlen (URI_PREFIX);
				_tmp12_ = _tmp11_;
				_tmp13_ = strlen (uri);
				_tmp14_ = _tmp13_;
				_tmp15_ = string_slice (uri, (glong) _tmp12_, (glong) _tmp14_);
				_g_free0 (uri);
				uri = _tmp15_;
			}
			gtk_widget_get_preferred_size (G_TYPE_CHECK_INSTANCE_CAST (img, gtk_widget_get_type (), GtkWidget), NULL, &_tmp16_);
			natural_size = _tmp16_;
			_tmp17_ = g_uri_unescape_string (uri, NULL);
			_tmp18_ = _tmp17_;
			_tmp19_ = natural_size;
			_tmp20_ = natural_size;
			_tmp21_ = gdk_pixbuf_new_from_file_at_size (_tmp18_, _tmp19_.width, _tmp20_.height, &_inner_error0_);
			if (_tmp21_) {
				g_object_set_data ((GObject *) _tmp21_, "vala-creation-function", "SwayNotificationCenter.Functions.set_image_uri");
			}
			_tmp22_ = _tmp21_;
			_g_free0 (_tmp18_);
			pixbuf = _tmp22_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_tmp23_ = pixbuf;
			_tmp24_ = gdk_texture_new_for_pixbuf (_tmp23_);
			texture = _tmp24_;
			_tmp25_ = texture;
			gtk_image_set_from_paintable (img, G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, gdk_paintable_get_type (), GdkPaintable));
			_g_object_unref0 (texture);
			_g_object_unref0 (pixbuf);
		}
		goto __finally0;
		__catch0_g_error:
		{
			GError* e = NULL;
			FILE* _tmp26_;
			GError* _tmp27_;
			const gchar* _tmp28_;
			gchar* _tmp29_;
			gchar* _tmp30_;
			e = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp26_ = stderr;
			_tmp27_ = e;
			_tmp28_ = _tmp27_->message;
			_tmp29_ = g_strconcat (_tmp28_, "\n", NULL);
			_tmp30_ = _tmp29_;
			fprintf (_tmp26_, "%s", _tmp30_);
			_g_free0 (_tmp30_);
			_g_error_free0 (e);
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_free0 (uri);
			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;
		}
	}
	_tmp31_ = gtk_image_get_storage_type (img);
	_tmp32_ = _tmp31_;
	if (_tmp32_ == GTK_IMAGE_EMPTY) {
		GdkDisplay* display = NULL;
		GdkDisplay* _tmp33_;
		GtkIconTheme* icon_theme = NULL;
		GdkDisplay* _tmp34_;
		GtkIconTheme* _tmp35_;
		GtkIconTheme* _tmp36_;
		_tmp33_ = gdk_display_get_default ();
		display = _tmp33_;
		_tmp34_ = display;
		_tmp35_ = gtk_icon_theme_get_for_display (_tmp34_);
		icon_theme = _tmp35_;
		_tmp36_ = icon_theme;
		if (gtk_icon_theme_has_icon (_tmp36_, uri)) {
			gtk_image_set_from_icon_name (img, uri);
		}
	}
	_g_free0 (uri);
}

void
sway_notification_center_functions_set_image_data (SwayNotificationCenterImageData* data,
                                                   GtkImage* img)
{
	GtkRequisition natural_size = {0};
	GtkRequisition _tmp0_ = {0};
	GdkPixbuf* pixbuf = NULL;
	SwayNotificationCenterImageData _tmp1_;
	guint8* _tmp2_;
	gint _tmp2__length1;
	SwayNotificationCenterImageData _tmp3_;
	SwayNotificationCenterImageData _tmp4_;
	SwayNotificationCenterImageData _tmp5_;
	SwayNotificationCenterImageData _tmp6_;
	SwayNotificationCenterImageData _tmp7_;
	GdkPixbuf* _tmp8_;
	GdkPixbuf* scaled = NULL;
	GtkRequisition _tmp9_;
	GtkRequisition _tmp10_;
	GdkPixbuf* _tmp11_;
	GdkTexture* texture = NULL;
	GdkTexture* _tmp12_;
	g_return_if_fail (data != NULL);
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (img, gtk_image_get_type ()));
	gtk_widget_get_preferred_size (G_TYPE_CHECK_INSTANCE_CAST (img, gtk_widget_get_type (), GtkWidget), NULL, &_tmp0_);
	natural_size = _tmp0_;
	_tmp1_ = *data;
	_tmp2_ = _tmp1_.data;
	_tmp2__length1 = _tmp1_.data_length1;
	_tmp3_ = *data;
	_tmp4_ = *data;
	_tmp5_ = *data;
	_tmp6_ = *data;
	_tmp7_ = *data;
	_tmp8_ = gdk_pixbuf_new_from_data (_tmp2_, GDK_COLORSPACE_RGB, _tmp3_.has_alpha, _tmp4_.bits_per_sample, _tmp5_.width, _tmp6_.height, _tmp7_.rowstride, (GdkPixbufDestroyNotify) NULL, NULL);
	if (_tmp8_) {
		g_object_set_data ((GObject *) _tmp8_, "vala-creation-function", "SwayNotificationCenter.Functions.set_image_data");
	}
	pixbuf = _tmp8_;
	_tmp9_ = natural_size;
	_tmp10_ = natural_size;
	_tmp11_ = gdk_pixbuf_scale_simple (pixbuf, _tmp9_.width, _tmp10_.height, GDK_INTERP_BILINEAR);
	scaled = _tmp11_;
	_tmp12_ = gdk_texture_new_for_pixbuf (scaled);
	texture = _tmp12_;
	gtk_image_set_from_paintable (img, G_TYPE_CHECK_INSTANCE_CAST (texture, gdk_paintable_get_type (), GdkPaintable));
	_g_object_unref0 (texture);
	_g_object_unref0 (scaled);
	_g_object_unref0 (pixbuf);
}

/** Load the package provided CSS file as a base.
         * Without this, an empty user CSS file would result in widgets
         * with default GTK style properties
         */
gboolean
sway_notification_center_functions_load_css (const gchar* style_path)
{
	gint css_priority = 0;
	SwayNotificationCenterConfigModel* _tmp0_;
	SwayNotificationCenterConfigModel* _tmp1_;
	SwayNotificationCenterCssPriority _tmp2_;
	SwayNotificationCenterCssPriority _tmp3_;
	gchar* system_css = NULL;
	gchar* _tmp4_;
	gchar* _tmp5_ = NULL;
	const gchar* _tmp6_;
	GFile* _tmp7_;
	GFile* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp13_;
	const gchar* _tmp14_;
	gchar* user_css = NULL;
	gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_ = NULL;
	const gchar* _tmp26_;
	GFile* _tmp27_;
	GFile* _tmp28_;
	gchar* _tmp29_;
	gchar* _tmp30_;
	gchar* _tmp33_;
	const gchar* _tmp34_;
	GtkCssProvider* _tmp35_;
	const gchar* _tmp36_;
	GdkDisplay* _tmp37_;
	GtkCssProvider* _tmp38_;
	gboolean result;
	_tmp0_ = sway_notification_center_config_model_get_instance ();
	_tmp1_ = _tmp0_;
	_tmp2_ = sway_notification_center_config_model_get_cssPriority (_tmp1_);
	_tmp3_ = _tmp2_;
	css_priority = sway_notification_center_css_priority_get_priority (_tmp3_);
	_tmp4_ = sway_notification_center_functions_get_style_path (NULL, TRUE);
	system_css = _tmp4_;
	_tmp6_ = system_css;
	_tmp7_ = g_file_new_for_path (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = g_file_get_path (_tmp8_);
	_tmp10_ = _tmp9_;
	_g_object_unref0 (_tmp8_);
	_tmp5_ = _tmp10_;
	if (_tmp5_ == NULL) {
		const gchar* _tmp11_;
		gchar* _tmp12_;
		_tmp11_ = system_css;
		_tmp12_ = g_strdup (_tmp11_);
		_g_free0 (_tmp5_);
		_tmp5_ = _tmp12_;
	}
	_tmp13_ = _tmp5_;
	_tmp5_ = NULL;
	_g_free0 (system_css);
	system_css = _tmp13_;
	_tmp14_ = sway_notification_center_custom_packaged_css;
	if (_tmp14_ != NULL) {
		const gchar* _tmp15_;
		gchar* _tmp16_;
		_tmp15_ = sway_notification_center_custom_packaged_css;
		_tmp16_ = g_strdup (_tmp15_);
		_g_free0 (system_css);
		system_css = _tmp16_;
	}
	if (!sway_notification_center_skip_packaged_css) {
		const gchar* _tmp17_;
		GtkCssProvider* _tmp18_;
		const gchar* _tmp19_;
		GdkDisplay* _tmp20_;
		GtkCssProvider* _tmp21_;
		_tmp17_ = system_css;
		g_message ("functions.vala:104: Loading CSS: \"%s\"", _tmp17_);
		_tmp18_ = sway_notification_center_functions_system_css_provider;
		_tmp19_ = system_css;
		gtk_css_provider_load_from_path (_tmp18_, _tmp19_);
		_tmp20_ = gdk_display_get_default ();
		_tmp21_ = sway_notification_center_functions_system_css_provider;
		gtk_style_context_add_provider_for_display (_tmp20_, G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, gtk_style_provider_get_type (), GtkStyleProvider), (guint) css_priority);
	} else {
		const gchar* _tmp22_;
		_tmp22_ = system_css;
		g_message ("functions.vala:111: Skipping system CSS: \"%s\"", _tmp22_);
	}
	_tmp23_ = g_strdup (style_path);
	_tmp24_ = sway_notification_center_functions_get_style_path (_tmp23_, FALSE);
	user_css = _tmp24_;
	_tmp26_ = user_css;
	_tmp27_ = g_file_new_for_path (_tmp26_);
	_tmp28_ = _tmp27_;
	_tmp29_ = g_file_get_path (_tmp28_);
	_tmp30_ = _tmp29_;
	_g_object_unref0 (_tmp28_);
	_tmp25_ = _tmp30_;
	if (_tmp25_ == NULL) {
		const gchar* _tmp31_;
		gchar* _tmp32_;
		_tmp31_ = user_css;
		_tmp32_ = g_strdup (_tmp31_);
		_g_free0 (_tmp25_);
		_tmp25_ = _tmp32_;
	}
	_tmp33_ = _tmp25_;
	_tmp25_ = NULL;
	_g_free0 (user_css);
	user_css = _tmp33_;
	_tmp34_ = user_css;
	g_message ("functions.vala:117: Loading CSS: \"%s\"", _tmp34_);
	_tmp35_ = sway_notification_center_functions_user_css_provider;
	_tmp36_ = user_css;
	gtk_css_provider_load_from_path (_tmp35_, _tmp36_);
	_tmp37_ = gdk_display_get_default ();
	_tmp38_ = sway_notification_center_functions_user_css_provider;
	gtk_style_context_add_provider_for_display (_tmp37_, G_TYPE_CHECK_INSTANCE_CAST (_tmp38_, gtk_style_provider_get_type (), GtkStyleProvider), (guint) css_priority);
	result = TRUE;
	_g_free0 (_tmp25_);
	_g_free0 (user_css);
	_g_free0 (_tmp5_);
	_g_free0 (system_css);
	return result;
}

static gchar
string_get (const gchar* self,
            glong index)
{
	gchar _tmp0_;
	gchar result;
	g_return_val_if_fail (self != NULL, '\0');
	_tmp0_ = ((gchar*) self)[index];
	result = _tmp0_;
	return result;
}

static void
_vala_array_add37 (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_add38 (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_add39 (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_add40 (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 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;
	}
}

gchar*
sway_notification_center_functions_get_style_path (gchar* custom_path,
                                                   gboolean only_system)
{
	gchar** paths = NULL;
	gchar** _tmp0_;
	gint paths_length1;
	gint _paths_size_;
	gboolean _tmp1_ = FALSE;
	gchar** _tmp15_;
	gchar** _tmp16_;
	gchar* _tmp22_;
	gchar** _tmp23_;
	gint _tmp23__length1;
	gchar* _tmp24_;
	gchar* _tmp25_;
	gchar* path = NULL;
	gchar* _tmp26_;
	gchar** _tmp27_;
	gint _tmp27__length1;
	const gchar* _tmp35_;
	gchar* result;
	_tmp0_ = g_new0 (gchar*, 0 + 1);
	paths = _tmp0_;
	paths_length1 = 0;
	_paths_size_ = paths_length1;
	if (custom_path != NULL) {
		gint _tmp2_;
		gint _tmp3_;
		_tmp2_ = strlen (custom_path);
		_tmp3_ = _tmp2_;
		_tmp1_ = _tmp3_ > 0;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		gchar* _tmp10_;
		if (string_get (custom_path, (glong) 0) == '~') {
			const gchar* _tmp4_;
			gint _tmp5_;
			gint _tmp6_;
			gchar* _tmp7_;
			gchar* _tmp8_;
			gchar* _tmp9_;
			_tmp4_ = g_get_home_dir ();
			_tmp5_ = strlen (custom_path);
			_tmp6_ = _tmp5_;
			_tmp7_ = string_slice (custom_path, (glong) 1, (glong) _tmp6_);
			_tmp8_ = _tmp7_;
			_tmp9_ = g_strconcat (_tmp4_, _tmp8_, NULL);
			_g_free0 (custom_path);
			custom_path = _tmp9_;
			_g_free0 (_tmp8_);
		}
		_tmp10_ = g_strdup (custom_path);
		_vala_array_add37 (&paths, &paths_length1, &_paths_size_, _tmp10_);
	}
	if (!only_system) {
		gchar* _tmp11_;
		gchar* _tmp12_;
		const gchar* _tmp13_;
		gchar* _tmp14_;
		_tmp11_ = g_strdup_printf ("%c", G_DIR_SEPARATOR);
		_tmp12_ = _tmp11_;
		_tmp13_ = g_get_user_config_dir ();
		_tmp14_ = g_build_path (_tmp12_, _tmp13_, "swaync/style.css", NULL);
		_vala_array_add38 (&paths, &paths_length1, &_paths_size_, _tmp14_);
		_g_free0 (_tmp12_);
	}
	_tmp16_ = _tmp15_ = g_get_system_config_dirs ();
	{
		gchar** path_collection = NULL;
		gint path_collection_length1 = 0;
		gint _path_collection_size_ = 0;
		gint path_it = 0;
		path_collection = _tmp16_;
		path_collection_length1 = _vala_array_length (_tmp15_);
		for (path_it = 0; path_it < path_collection_length1; path_it = path_it + 1) {
			gchar* _tmp17_;
			gchar* path = NULL;
			_tmp17_ = g_strdup (path_collection[path_it]);
			path = _tmp17_;
			{
				gchar* _tmp18_;
				gchar* _tmp19_;
				const gchar* _tmp20_;
				gchar* _tmp21_;
				_tmp18_ = g_strdup_printf ("%c", G_DIR_SEPARATOR);
				_tmp19_ = _tmp18_;
				_tmp20_ = path;
				_tmp21_ = g_build_path (_tmp19_, _tmp20_, "swaync/style.css", NULL);
				_vala_array_add39 (&paths, &paths_length1, &_paths_size_, _tmp21_);
				_g_free0 (_tmp19_);
				_g_free0 (path);
			}
		}
	}
	_tmp22_ = g_strdup ("/usr/local/etc/xdg/swaync/style.css");
	_vala_array_add40 (&paths, &paths_length1, &_paths_size_, _tmp22_);
	_tmp23_ = paths;
	_tmp23__length1 = paths_length1;
	_tmp24_ = _vala_g_strjoinv ("\n\t- ", _tmp23_, (gint) _tmp23__length1);
	_tmp25_ = _tmp24_;
	g_info ("functions.vala:150: Looking for CSS file in these directories:\n" \
"\t- %s", _tmp25_);
	_g_free0 (_tmp25_);
	_tmp26_ = g_strdup ("");
	path = _tmp26_;
	_tmp27_ = paths;
	_tmp27__length1 = paths_length1;
	{
		gchar** try_path_collection = NULL;
		gint try_path_collection_length1 = 0;
		gint _try_path_collection_size_ = 0;
		gint try_path_it = 0;
		try_path_collection = _tmp27_;
		try_path_collection_length1 = _tmp27__length1;
		for (try_path_it = 0; try_path_it < try_path_collection_length1; try_path_it = try_path_it + 1) {
			gchar* _tmp28_;
			gchar* try_path = NULL;
			_tmp28_ = g_strdup (try_path_collection[try_path_it]);
			try_path = _tmp28_;
			{
				const gchar* _tmp29_;
				GFile* _tmp30_;
				GFile* _tmp31_;
				gboolean _tmp32_;
				_tmp29_ = try_path;
				_tmp30_ = g_file_new_for_path (_tmp29_);
				_tmp31_ = _tmp30_;
				_tmp32_ = g_file_query_exists (_tmp31_, NULL);
				_g_object_unref0 (_tmp31_);
				if (_tmp32_) {
					const gchar* _tmp33_;
					gchar* _tmp34_;
					_tmp33_ = try_path;
					_tmp34_ = g_strdup (_tmp33_);
					_g_free0 (path);
					path = _tmp34_;
					_g_free0 (try_path);
					break;
				}
				_g_free0 (try_path);
			}
		}
	}
	_tmp35_ = path;
	if (g_strcmp0 (_tmp35_, "") == 0) {
		FILE* _tmp36_;
		_tmp36_ = stderr;
		fprintf (_tmp36_, "COULD NOT FIND CSS FILE! REINSTALL THE PACKAGE!\n");
		exit (1);
	}
	result = path;
	paths = (_vala_array_free (paths, paths_length1, (GDestroyNotify) g_free), NULL);
	_g_free0 (custom_path);
	return result;
}

static void
_vala_array_add41 (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_add42 (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_add43 (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_add44 (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;
}

gchar*
sway_notification_center_functions_get_config_path (gchar* custom_path)
{
	gchar** paths = NULL;
	gchar** _tmp0_;
	gint paths_length1;
	gint _paths_size_;
	gboolean _tmp1_ = FALSE;
	gchar* _tmp15_;
	gchar* _tmp16_;
	const gchar* _tmp17_;
	gchar* _tmp18_;
	gchar** _tmp19_;
	gchar** _tmp20_;
	gchar* _tmp26_;
	gchar** _tmp27_;
	gint _tmp27__length1;
	gchar* _tmp28_;
	gchar* _tmp29_;
	gchar* path = NULL;
	gchar* _tmp30_;
	gchar** _tmp31_;
	gint _tmp31__length1;
	const gchar* _tmp39_;
	gchar* result;
	_tmp0_ = g_new0 (gchar*, 0 + 1);
	paths = _tmp0_;
	paths_length1 = 0;
	_paths_size_ = paths_length1;
	if (custom_path != NULL) {
		gchar* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		_tmp2_ = string_strip (custom_path);
		_g_free0 (custom_path);
		custom_path = _tmp2_;
		_tmp3_ = strlen (custom_path);
		_tmp4_ = _tmp3_;
		_tmp1_ = _tmp4_ > 0;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		GFile* _tmp11_;
		GFile* _tmp12_;
		gboolean _tmp13_;
		if (string_get (custom_path, (glong) 0) == '~') {
			const gchar* _tmp5_;
			gint _tmp6_;
			gint _tmp7_;
			gchar* _tmp8_;
			gchar* _tmp9_;
			gchar* _tmp10_;
			_tmp5_ = g_get_home_dir ();
			_tmp6_ = strlen (custom_path);
			_tmp7_ = _tmp6_;
			_tmp8_ = string_slice (custom_path, (glong) 1, (glong) _tmp7_);
			_tmp9_ = _tmp8_;
			_tmp10_ = g_strconcat (_tmp5_, _tmp9_, NULL);
			_g_free0 (custom_path);
			custom_path = _tmp10_;
			_g_free0 (_tmp9_);
		}
		_tmp11_ = g_file_new_for_path (custom_path);
		_tmp12_ = _tmp11_;
		_tmp13_ = g_file_query_exists (_tmp12_, NULL);
		_g_object_unref0 (_tmp12_);
		if (_tmp13_) {
			gchar* _tmp14_;
			_tmp14_ = g_strdup (custom_path);
			_vala_array_add41 (&paths, &paths_length1, &_paths_size_, _tmp14_);
		} else {
			g_warning ("functions.vala:179: Custom config file \"%s\" not found, skipping...", custom_path);
		}
	}
	_tmp15_ = g_strdup_printf ("%c", G_DIR_SEPARATOR);
	_tmp16_ = _tmp15_;
	_tmp17_ = g_get_user_config_dir ();
	_tmp18_ = g_build_path (_tmp16_, _tmp17_, "swaync/config.json", NULL);
	_vala_array_add42 (&paths, &paths_length1, &_paths_size_, _tmp18_);
	_g_free0 (_tmp16_);
	_tmp20_ = _tmp19_ = g_get_system_config_dirs ();
	{
		gchar** path_collection = NULL;
		gint path_collection_length1 = 0;
		gint _path_collection_size_ = 0;
		gint path_it = 0;
		path_collection = _tmp20_;
		path_collection_length1 = _vala_array_length (_tmp19_);
		for (path_it = 0; path_it < path_collection_length1; path_it = path_it + 1) {
			gchar* _tmp21_;
			gchar* path = NULL;
			_tmp21_ = g_strdup (path_collection[path_it]);
			path = _tmp21_;
			{
				gchar* _tmp22_;
				gchar* _tmp23_;
				const gchar* _tmp24_;
				gchar* _tmp25_;
				_tmp22_ = g_strdup_printf ("%c", G_DIR_SEPARATOR);
				_tmp23_ = _tmp22_;
				_tmp24_ = path;
				_tmp25_ = g_build_path (_tmp23_, _tmp24_, "swaync/config.json", NULL);
				_vala_array_add43 (&paths, &paths_length1, &_paths_size_, _tmp25_);
				_g_free0 (_tmp23_);
				_g_free0 (path);
			}
		}
	}
	_tmp26_ = g_strdup ("/usr/local/etc/xdg/swaync/config.json");
	_vala_array_add44 (&paths, &paths_length1, &_paths_size_, _tmp26_);
	_tmp27_ = paths;
	_tmp27__length1 = paths_length1;
	_tmp28_ = _vala_g_strjoinv ("\n\t- ", _tmp27_, (gint) _tmp27__length1);
	_tmp29_ = _tmp28_;
	g_info ("functions.vala:192: Looking for config file in these directories:\n" \
"\t- %s", _tmp29_);
	_g_free0 (_tmp29_);
	_tmp30_ = g_strdup ("");
	path = _tmp30_;
	_tmp31_ = paths;
	_tmp31__length1 = paths_length1;
	{
		gchar** try_path_collection = NULL;
		gint try_path_collection_length1 = 0;
		gint _try_path_collection_size_ = 0;
		gint try_path_it = 0;
		try_path_collection = _tmp31_;
		try_path_collection_length1 = _tmp31__length1;
		for (try_path_it = 0; try_path_it < try_path_collection_length1; try_path_it = try_path_it + 1) {
			gchar* _tmp32_;
			gchar* try_path = NULL;
			_tmp32_ = g_strdup (try_path_collection[try_path_it]);
			try_path = _tmp32_;
			{
				const gchar* _tmp33_;
				GFile* _tmp34_;
				GFile* _tmp35_;
				gboolean _tmp36_;
				_tmp33_ = try_path;
				_tmp34_ = g_file_new_for_path (_tmp33_);
				_tmp35_ = _tmp34_;
				_tmp36_ = g_file_query_exists (_tmp35_, NULL);
				_g_object_unref0 (_tmp35_);
				if (_tmp36_) {
					const gchar* _tmp37_;
					gchar* _tmp38_;
					_tmp37_ = try_path;
					_tmp38_ = g_strdup (_tmp37_);
					_g_free0 (path);
					path = _tmp38_;
					_g_free0 (try_path);
					break;
				}
				_g_free0 (try_path);
			}
		}
	}
	_tmp39_ = path;
	if (g_strcmp0 (_tmp39_, "") == 0) {
		FILE* _tmp40_;
		_tmp40_ = stderr;
		fprintf (_tmp40_, "COULD NOT FIND CONFIG FILE! REINSTALL THE PACKAGE!\n");
		exit (1);
	}
	result = path;
	paths = (_vala_array_free (paths, paths_length1, (GDestroyNotify) g_free), NULL);
	_g_free0 (custom_path);
	return result;
}

/** Gets the base type of a type if it's derivited */
GType
sway_notification_center_functions_get_base_type (GType type)
{
	GType result;
	if (G_TYPE_IS_DERIVED (type)) {
		while (TRUE) {
			if (!G_TYPE_IS_DERIVED (type)) {
				break;
			}
			type = g_type_parent (type);
		}
	}
	result = type;
	return result;
}

/** Scales the Texture to fit the given dimensions */
void
sway_notification_center_functions_scale_texture (GdkTexture* texture,
                                                  gint buffer_width,
                                                  gint buffer_height,
                                                  gint img_scale,
                                                  GtkSnapshot* snapshot)
{
	gint width = 0;
	gint _tmp0_;
	gint _tmp1_;
	gint height = 0;
	gint _tmp2_;
	gint _tmp3_;
	gdouble window_ratio = 0.0;
	gdouble bg_ratio = 0.0;
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (texture, gdk_texture_get_type ()));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (snapshot, gtk_snapshot_get_type ()));
	_tmp0_ = gdk_texture_get_width (texture);
	_tmp1_ = _tmp0_;
	width = _tmp1_ / img_scale;
	_tmp2_ = gdk_texture_get_height (texture);
	_tmp3_ = _tmp2_;
	height = _tmp3_ / img_scale;
	window_ratio = ((gdouble) buffer_width) / buffer_height;
	bg_ratio = (gdouble) (width / height);
	gtk_snapshot_save (snapshot);
	if (window_ratio > bg_ratio) {
		gdouble scale = 0.0;
		scale = ((gdouble) buffer_width) / width;
		if ((scale * height) < ((gdouble) buffer_height)) {
			sway_notification_center_functions_draw_scale_wide (buffer_width, width, buffer_height, height, snapshot, texture);
		} else {
			sway_notification_center_functions_draw_scale_tall (buffer_width, width, buffer_height, height, snapshot, texture);
		}
	} else {
		gdouble scale = 0.0;
		scale = ((gdouble) buffer_height) / height;
		if ((scale * width) < ((gdouble) buffer_width)) {
			sway_notification_center_functions_draw_scale_tall (buffer_width, width, buffer_height, height, snapshot, texture);
		} else {
			sway_notification_center_functions_draw_scale_wide (buffer_width, width, buffer_height, height, snapshot, texture);
		}
	}
	gtk_snapshot_restore (snapshot);
}

static void
sway_notification_center_functions_draw_scale_tall (gint buffer_width,
                                                    gint width,
                                                    gint buffer_height,
                                                    gint height,
                                                    GtkSnapshot* snapshot,
                                                    GdkTexture* texture)
{
	gfloat scale = 0.0F;
	gfloat x = 0.0F;
	gfloat y = 0.0F;
	graphene_rect_t _tmp0_ = {0};
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (snapshot, gtk_snapshot_get_type ()));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (texture, gdk_texture_get_type ()));
	scale = ((gfloat) buffer_width) / width;
	gtk_snapshot_scale (snapshot, scale, scale);
	x = (gfloat) 0;
	y = (gfloat) (((buffer_height / 2) / scale) - (height / 2));
	_tmp0_.origin = (graphene_point_t) {x, y};
	_tmp0_.size = (graphene_size_t) {(gfloat) width, (gfloat) height};
	gtk_snapshot_append_scaled_texture (snapshot, texture, SWAY_NOTIFICATION_CENTER_FUNCTIONS_SCALING_FILTER, &_tmp0_);
}

static void
sway_notification_center_functions_draw_scale_wide (gint buffer_width,
                                                    gint width,
                                                    gint buffer_height,
                                                    gint height,
                                                    GtkSnapshot* snapshot,
                                                    GdkTexture* texture)
{
	gfloat scale = 0.0F;
	gfloat x = 0.0F;
	gfloat y = 0.0F;
	graphene_rect_t _tmp0_ = {0};
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (snapshot, gtk_snapshot_get_type ()));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (texture, gdk_texture_get_type ()));
	scale = ((gfloat) buffer_height) / height;
	gtk_snapshot_scale (snapshot, scale, scale);
	x = (gfloat) (((buffer_width / 2) / scale) - (width / 2));
	y = (gfloat) 0;
	_tmp0_.origin = (graphene_point_t) {x, y};
	_tmp0_.size = (graphene_size_t) {(gfloat) width, (gfloat) height};
	gtk_snapshot_append_scaled_texture (snapshot, texture, SWAY_NOTIFICATION_CENTER_FUNCTIONS_SCALING_FILTER, &_tmp0_);
}

static guint8*
string_get_data (const gchar* self,
                 gint* result_length1)
{
	guint8* result;
	guint8* res = NULL;
	gint res_length1;
	gint _res_size_;
	gint _tmp0_;
	gint _tmp1_;
	guint8* _tmp2_;
	gint _tmp2__length1;
	g_return_val_if_fail (self != NULL, NULL);
	res = (guint8*) self;
	res_length1 = -1;
	_res_size_ = res_length1;
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	res_length1 = (gint) _tmp1_;
	_tmp2_ = res;
	_tmp2__length1 = res_length1;
	if (result_length1) {
		*result_length1 = _tmp2__length1;
	}
	result = _tmp2_;
	return result;
}

gchar*
sway_notification_center_functions_filter_string (const gchar* body,
                                                  SwayNotificationCenterFunctionsFilterFunc func,
                                                  gpointer func_target)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	guint8* _tmp1_;
	gint _tmp1__length1;
	gint _tmp2_ = 0;
	guint8* _tmp3_;
	gint _tmp3__length1;
	gchar* result;
	g_return_val_if_fail (body != NULL, NULL);
	_tmp0_ = g_strdup ("");
	_result_ = _tmp0_;
	_tmp1_ = string_get_data (body, &_tmp2_);
	_tmp1__length1 = _tmp2_;
	_tmp3_ = _tmp1_;
	_tmp3__length1 = _tmp1__length1;
	{
		gchar* char_collection = NULL;
		gint char_collection_length1 = 0;
		gint _char_collection_size_ = 0;
		gint char_it = 0;
		char_collection = (gchar*) _tmp3_;
		char_collection_length1 = (_tmp3__length1 * sizeof (guint8)) / sizeof (gchar);
		for (char_it = 0; char_it < char_collection_length1; char_it = char_it + 1) {
			gchar _char_ = '\0';
			_char_ = char_collection[char_it];
			{
				const gchar* _tmp4_;
				gchar* _tmp5_;
				gchar* _tmp6_;
				gchar* _tmp7_;
				if (!func (_char_, func_target)) {
					continue;
				}
				_tmp4_ = _result_;
				_tmp5_ = g_strdup_printf ("%c", _char_);
				_tmp6_ = _tmp5_;
				_tmp7_ = g_strconcat (_tmp4_, _tmp6_, NULL);
				_g_free0 (_result_);
				_result_ = _tmp7_;
				_g_free0 (_tmp6_);
			}
		}
	}
	result = _result_;
	return result;
}

static void
sway_notification_center_functions_execute_command_data_free (gpointer _data)
{
	SwayNotificationCenterFunctionsExecuteCommandData* _data_;
	_data_ = _data;
	_g_free0 (_data_->cmd);
	g_slice_free (SwayNotificationCenterFunctionsExecuteCommandData, _data_);
}

void
sway_notification_center_functions_execute_command (const gchar* cmd,
                                                    gchar** env_additions,
                                                    gint env_additions_length1,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_)
{
	SwayNotificationCenterFunctionsExecuteCommandData* _data_;
	gchar* _tmp0_;
	g_return_if_fail (cmd != NULL);
	_data_ = g_slice_new0 (SwayNotificationCenterFunctionsExecuteCommandData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, sway_notification_center_functions_execute_command_data_free);
	_tmp0_ = g_strdup (cmd);
	_g_free0 (_data_->cmd);
	_data_->cmd = _tmp0_;
	_data_->env_additions = env_additions;
	_data_->env_additions_length1 = env_additions_length1;
	sway_notification_center_functions_execute_command_co (_data_);
}

gboolean
sway_notification_center_functions_execute_command_finish (GAsyncResult* _res_,
                                                           gchar** msg)
{
	gboolean result;
	SwayNotificationCenterFunctionsExecuteCommandData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	if (msg) {
		*msg = _data_->msg;
	} else {
		_g_free0 (_data_->msg);
	}
	_data_->msg = NULL;
	result = _data_->result;
	return result;
}

static Block25Data*
block25_data_ref (Block25Data* _data25_)
{
	g_atomic_int_inc (&_data25_->_ref_count_);
	return _data25_;
}

static void
block25_data_unref (void * _userdata_)
{
	Block25Data* _data25_;
	_data25_ = (Block25Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data25_->_ref_count_)) {
		g_slice_free (Block25Data, _data25_);
	}
}

static Block26Data*
block26_data_ref (Block26Data* _data26_)
{
	g_atomic_int_inc (&_data26_->_ref_count_);
	return _data26_;
}

static void
block26_data_unref (void * _userdata_)
{
	Block26Data* _data26_;
	_data26_ = (Block26Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data26_->_ref_count_)) {
		_g_free0 (_data26_->res);
		block25_data_unref (_data26_->_data25_);
		_data26_->_data25_ = NULL;
		g_slice_free (Block26Data, _data26_);
	}
}

static void
_vala_array_add45 (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 glong
string_strnlen (gchar* str,
                glong maxlen)
{
	gchar* end = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	glong result;
	_tmp0_ = memchr (str, 0, (gsize) maxlen);
	end = _tmp0_;
	_tmp1_ = end;
	if (_tmp1_ == NULL) {
		result = maxlen;
		return result;
	} else {
		gchar* _tmp2_;
		_tmp2_ = end;
		result = (glong) (_tmp2_ - str);
		return result;
	}
}

static gchar*
string_substring (const gchar* self,
                  glong offset,
                  glong len)
{
	glong string_length = 0L;
	gboolean _tmp0_ = FALSE;
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (offset >= ((glong) 0)) {
		_tmp0_ = len >= ((glong) 0);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		string_length = string_strnlen ((gchar*) self, offset + len);
	} else {
		gint _tmp1_;
		gint _tmp2_;
		_tmp1_ = strlen (self);
		_tmp2_ = _tmp1_;
		string_length = (glong) _tmp2_;
	}
	if (offset < ((glong) 0)) {
		offset = string_length + offset;
		g_return_val_if_fail (offset >= ((glong) 0), NULL);
	} else {
		g_return_val_if_fail (offset <= string_length, NULL);
	}
	if (len < ((glong) 0)) {
		len = string_length - offset;
	}
	g_return_val_if_fail ((offset + len) <= string_length, NULL);
	_tmp3_ = g_strndup (((gchar*) self) + offset, (gsize) len);
	result = _tmp3_;
	return result;
}

static gboolean
___lambda13_ (Block26Data* _data26_,
              GIOChannel* channel,
              GIOCondition condition)
{
	Block25Data* _data25_;
	gboolean _tmp10_ = FALSE;
	GError* _inner_error0_ = NULL;
	gboolean result;
	_data25_ = _data26_->_data25_;
	g_return_val_if_fail (channel != NULL, FALSE);
	if (condition == G_IO_HUP) {
		result = FALSE;
		return result;
	}
	{
		GIOStatus _tmp0_ = 0;
		gchar* _tmp1_ = NULL;
		GIOStatus _tmp2_;
		_tmp2_ = g_io_channel_read_line (channel, &_tmp1_, NULL, NULL, &_inner_error0_);
		_g_free0 (_data26_->res);
		_data26_->res = _tmp1_;
		_tmp0_ = _tmp2_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			gboolean _tmp3_ = FALSE;
			if (_inner_error0_->domain == G_IO_CHANNEL_ERROR) {
				goto __catch0_g_io_channel_error;
			}
			if (_inner_error0_->domain == G_CONVERT_ERROR) {
				goto __catch0_g_convert_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return _tmp3_;
		}
		if (_tmp0_ == G_IO_STATUS_NORMAL) {
			const gchar* _tmp4_;
			_tmp4_ = _data26_->res;
			g_debug ("functions.vala:332: Exec output:\n%s", _tmp4_);
		} else {
			gchar* _tmp5_;
			_tmp5_ = g_strdup ("");
			_g_free0 (_data26_->res);
			_data26_->res = _tmp5_;
		}
		result = TRUE;
		return result;
	}
	goto __finally0;
	__catch0_g_io_channel_error:
	{
		GError* e = NULL;
		GError* _tmp6_;
		const gchar* _tmp7_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp6_ = e;
		_tmp7_ = _tmp6_->message;
		g_warning ("functions.vala:338: stdout: IOChannelError: %s", _tmp7_);
		result = FALSE;
		_g_error_free0 (e);
		return result;
	}
	goto __finally0;
	__catch0_g_convert_error:
	{
		GError* e = NULL;
		GError* _tmp8_;
		const gchar* _tmp9_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp8_ = e;
		_tmp9_ = _tmp8_->message;
		g_warning ("functions.vala:341: stdout: ConvertError: %s", _tmp9_);
		result = FALSE;
		_g_error_free0 (e);
		return result;
	}
	__finally0:
	g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
	g_clear_error (&_inner_error0_);
	return _tmp10_;
}

static gboolean
____lambda13__gio_func (GIOChannel* source,
                        GIOCondition condition,
                        gpointer self)
{
	gboolean result;
	result = ___lambda13_ (self, source, condition);
	return result;
}

static void
___lambda14_ (Block26Data* _data26_,
              GPid pid,
              gint status)
{
	Block25Data* _data25_;
	_data25_ = _data26_->_data25_;
	g_spawn_close_pid (pid);
	close (_data26_->std_output);
	_data26_->end_status = status;
	sway_notification_center_functions_execute_command_co (_data25_->_async_data_);
}

static void
____lambda14__gchild_watch_func (GPid pid,
                                 gint wait_status,
                                 gpointer self)
{
	___lambda14_ (self, pid, wait_status);
}

static gboolean
sway_notification_center_functions_execute_command_co (SwayNotificationCenterFunctionsExecuteCommandData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data25_ = g_slice_new0 (Block25Data);
	_data_->_data25_->_ref_count_ = 1;
	_data_->_data25_->_async_data_ = _data_;
	_data_->_tmp0_ = g_strdup ("");
	_g_free0 (_data_->msg);
	_data_->msg = _data_->_tmp0_;
	{
		_data_->_data26_ = g_slice_new0 (Block26Data);
		_data_->_data26_->_ref_count_ = 1;
		_data_->_data26_->_data25_ = block25_data_ref (_data_->_data25_);
		_data_->_tmp2_ = _data_->_tmp1_ = g_get_environ ();
		_data_->spawn_env = _data_->_tmp2_;
		_data_->spawn_env_length1 = _vala_array_length (_data_->_tmp1_);
		_data_->_spawn_env_size_ = _data_->spawn_env_length1;
		{
			_data_->additions_collection_length1 = 0;
			_data_->_additions_collection_size_ = 0;
			_data_->additions_collection = _data_->env_additions;
			_data_->additions_collection_length1 = _data_->env_additions_length1;
			for (_data_->additions_it = 0; _data_->additions_it < _data_->additions_collection_length1; _data_->additions_it = _data_->additions_it + 1) {
				_data_->_tmp3_ = g_strdup (_data_->additions_collection[_data_->additions_it]);
				_data_->additions = _data_->_tmp3_;
				{
					_data_->_tmp4_ = _data_->additions;
					_data_->_tmp5_ = g_strdup (_data_->_tmp4_);
					_vala_array_add45 (&_data_->spawn_env, &_data_->spawn_env_length1, &_data_->_spawn_env_size_, _data_->_tmp5_);
					_g_free0 (_data_->additions);
				}
			}
		}
		_data_->argvp_length1 = 0;
		_data_->_argvp_size_ = 0;
		_data_->_tmp6_ = g_strdup_printf ("/bin/sh -c \"%s\"", _data_->cmd);
		_data_->_tmp7_ = _data_->_tmp6_;
		_data_->_tmp8_ = NULL;
		_data_->_tmp9_ = 0;
		g_shell_parse_argv (_data_->_tmp7_, &_data_->_tmp9_, &_data_->_tmp8_, &_data_->_inner_error0_);
		_data_->argvp = (_vala_array_free (_data_->argvp, _data_->argvp_length1, (GDestroyNotify) g_free), NULL);
		_data_->argvp = _data_->_tmp8_;
		_data_->argvp_length1 = _data_->_tmp9_;
		_data_->_argvp_size_ = _data_->argvp_length1;
		_g_free0 (_data_->_tmp7_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_data_->argvp = (_vala_array_free (_data_->argvp, _data_->argvp_length1, (GDestroyNotify) g_free), NULL);
			_data_->spawn_env = (_vala_array_free (_data_->spawn_env, _data_->spawn_env_length1, (GDestroyNotify) g_free), NULL);
			block26_data_unref (_data_->_data26_);
			_data_->_data26_ = NULL;
			goto __catch0_g_error;
		}
		_data_->_tmp10_ = _data_->argvp;
		_data_->_tmp10__length1 = _data_->argvp_length1;
		_data_->_tmp11_ = _data_->_tmp10_[0];
		if (g_str_has_prefix (_data_->_tmp11_, "~")) {
			_data_->_tmp12_ = _data_->argvp;
			_data_->_tmp12__length1 = _data_->argvp_length1;
			_data_->_tmp13_ = g_get_home_dir ();
			_data_->_tmp14_ = _data_->argvp;
			_data_->_tmp14__length1 = _data_->argvp_length1;
			_data_->_tmp15_ = _data_->_tmp14_[0];
			_data_->_tmp16_ = string_substring (_data_->_tmp15_, (glong) 1, (glong) -1);
			_data_->_tmp17_ = _data_->_tmp16_;
			_data_->_tmp18_ = g_strconcat (_data_->_tmp13_, _data_->_tmp17_, NULL);
			_g_free0 (_data_->_tmp12_[0]);
			_data_->_tmp12_[0] = _data_->_tmp18_;
			_g_free0 (_data_->_tmp17_);
		}
		_data_->_tmp19_ = _data_->argvp;
		_data_->_tmp19__length1 = _data_->argvp_length1;
		_data_->_tmp20_ = _data_->spawn_env;
		_data_->_tmp20__length1 = _data_->spawn_env_length1;
		_data_->_tmp21_ = 0;
		_data_->_tmp22_ = 0;
		g_spawn_async_with_pipes ("/", _data_->_tmp19_, _data_->_tmp20_, G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, &_data_->_tmp21_, NULL, &_data_->_tmp22_, NULL, &_data_->_inner_error0_);
		_data_->child_pid = _data_->_tmp21_;
		_data_->_data26_->std_output = _data_->_tmp22_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_data_->argvp = (_vala_array_free (_data_->argvp, _data_->argvp_length1, (GDestroyNotify) g_free), NULL);
			_data_->spawn_env = (_vala_array_free (_data_->spawn_env, _data_->spawn_env_length1, (GDestroyNotify) g_free), NULL);
			block26_data_unref (_data_->_data26_);
			_data_->_data26_ = NULL;
			goto __catch0_g_error;
		}
		_data_->_tmp23_ = g_strdup ("");
		_data_->_data26_->res = _data_->_tmp23_;
		_data_->_tmp24_ = g_io_channel_unix_new (_data_->_data26_->std_output);
		_data_->output = _data_->_tmp24_;
		_data_->_tmp25_ = _data_->output;
		g_io_add_watch (_data_->_tmp25_, G_IO_IN | G_IO_HUP, ____lambda13__gio_func, _data_->_data26_);
		_data_->_data26_->end_status = 0;
		g_child_watch_add_full (G_PRIORITY_DEFAULT_IDLE, _data_->child_pid, ____lambda14__gchild_watch_func, block26_data_ref (_data_->_data26_), block26_data_unref);
		_data_->_state_ = 1;
		return FALSE;
		_state_1:
		;
		_data_->_tmp26_ = _data_->_data26_->res;
		_data_->_tmp27_ = g_strdup (_data_->_tmp26_);
		_g_free0 (_data_->msg);
		_data_->msg = _data_->_tmp27_;
		_data_->result = _data_->_data26_->end_status == 0;
		_g_io_channel_unref0 (_data_->output);
		_data_->argvp = (_vala_array_free (_data_->argvp, _data_->argvp_length1, (GDestroyNotify) g_free), NULL);
		_data_->spawn_env = (_vala_array_free (_data_->spawn_env, _data_->spawn_env_length1, (GDestroyNotify) g_free), NULL);
		block26_data_unref (_data_->_data26_);
		_data_->_data26_ = NULL;
		block25_data_unref (_data_->_data25_);
		_data_->_data25_ = 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;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp28_ = _data_->e;
		_data_->_tmp29_ = _data_->_tmp28_->message;
		g_warning ("functions.vala:359: Execute Command Error: %s", _data_->_tmp29_);
		_data_->_tmp30_ = _data_->e;
		_data_->_tmp31_ = _data_->_tmp30_->message;
		_data_->_tmp32_ = g_strdup (_data_->_tmp31_);
		_g_free0 (_data_->msg);
		_data_->msg = _data_->_tmp32_;
		_data_->result = FALSE;
		_g_error_free0 (_data_->e);
		block25_data_unref (_data_->_data25_);
		_data_->_data25_ = 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;
	}
	__finally0:
	block25_data_unref (_data_->_data25_);
	_data_->_data25_ = NULL;
	_g_free0 (_data_->msg);
	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;
}

struct wl_display*
sway_notification_center_functions_get_wl_display (void)
{
	GdkDisplay* display = NULL;
	GdkDisplay* _tmp0_;
	struct wl_display* result;
	_tmp0_ = gdk_display_get_default ();
	display = _tmp0_;
	if (G_TYPE_CHECK_INSTANCE_TYPE (display, gdk_wayland_display_get_type ())) {
		struct wl_display* _tmp1_;
		_tmp1_ = gdk_wayland_display_get_wl_display (G_TYPE_CHECK_INSTANCE_CAST (display, gdk_wayland_display_get_type (), GdkWaylandDisplay));
		result = _tmp1_;
		return result;
	}
	g_error ("functions.vala:370: Only supports Wayland!");
}

struct wl_surface*
sway_notification_center_functions_get_wl_surface (GdkSurface* surface)
{
	struct wl_surface* result;
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (surface, gdk_surface_get_type ()), NULL);
	if (G_TYPE_CHECK_INSTANCE_TYPE (surface, gdk_wayland_surface_get_type ())) {
		struct wl_surface* _tmp0_;
		_tmp0_ = gdk_wayland_surface_get_wl_surface (G_TYPE_CHECK_INSTANCE_CAST (surface, gdk_wayland_surface_get_type (), GdkWaylandSurface));
		result = _tmp0_;
		return result;
	}
	g_error ("functions.vala:377: Only supports Wayland!");
}

gdouble
sway_notification_center_functions_lerp (gdouble a,
                                         gdouble b,
                                         gdouble t)
{
	gdouble result;
	result = (a * (1.0 - t)) + (b * t);
	return result;
}

GdkMonitor*
sway_notification_center_functions_try_get_monitor (const gchar* name)
{
	gboolean _tmp0_ = FALSE;
	GdkMonitor* result;
	g_return_val_if_fail (name != NULL, NULL);
	if (name == NULL) {
		_tmp0_ = TRUE;
	} else {
		gint _tmp1_;
		gint _tmp2_;
		_tmp1_ = strlen (name);
		_tmp2_ = _tmp1_;
		_tmp0_ = _tmp2_ == 0;
	}
	if (_tmp0_) {
		result = NULL;
		return result;
	}
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp3_ = FALSE;
			_tmp3_ = TRUE;
			while (TRUE) {
				GListModel* _tmp5_;
				GObject* obj = NULL;
				GListModel* _tmp6_;
				GObject* _tmp7_;
				gboolean _tmp8_ = FALSE;
				GObject* _tmp9_;
				GdkMonitor* monitor = NULL;
				GObject* _tmp11_;
				GdkMonitor* _tmp12_;
				const gchar* _tmp13_;
				const gchar* _tmp14_;
				gchar* id = NULL;
				GdkMonitor* _tmp16_;
				const gchar* _tmp17_;
				const gchar* _tmp18_;
				GdkMonitor* _tmp19_;
				const gchar* _tmp20_;
				const gchar* _tmp21_;
				GdkMonitor* _tmp22_;
				const gchar* _tmp23_;
				const gchar* _tmp24_;
				gchar* _tmp25_;
				const gchar* _tmp26_;
				if (!_tmp3_) {
					gint _tmp4_;
					_tmp4_ = i;
					i = _tmp4_ + 1;
				}
				_tmp3_ = FALSE;
				_tmp5_ = sway_notification_center_monitors;
				if (!(((guint) i) < g_list_model_get_n_items (_tmp5_))) {
					break;
				}
				_tmp6_ = sway_notification_center_monitors;
				_tmp7_ = g_list_model_get_item (_tmp6_, (guint) i);
				obj = _tmp7_;
				_tmp9_ = obj;
				if (_tmp9_ == NULL) {
					_tmp8_ = TRUE;
				} else {
					GObject* _tmp10_;
					_tmp10_ = obj;
					_tmp8_ = !G_TYPE_CHECK_INSTANCE_TYPE (_tmp10_, gdk_monitor_get_type ());
				}
				if (_tmp8_) {
					_g_object_unref0 (obj);
					continue;
				}
				_tmp11_ = obj;
				monitor = G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, gdk_monitor_get_type (), GdkMonitor);
				_tmp12_ = monitor;
				_tmp13_ = gdk_monitor_get_connector (_tmp12_);
				_tmp14_ = _tmp13_;
				if (g_strcmp0 (_tmp14_, name) == 0) {
					GdkMonitor* _tmp15_;
					_tmp15_ = monitor;
					result = _tmp15_;
					_g_object_unref0 (obj);
					return result;
				}
				_tmp16_ = monitor;
				_tmp17_ = gdk_monitor_get_manufacturer (_tmp16_);
				_tmp18_ = _tmp17_;
				_tmp19_ = monitor;
				_tmp20_ = gdk_monitor_get_model (_tmp19_);
				_tmp21_ = _tmp20_;
				_tmp22_ = monitor;
				_tmp23_ = gdk_monitor_get_description (_tmp22_);
				_tmp24_ = _tmp23_;
				_tmp25_ = g_strdup_printf ("%s %s %s", _tmp18_, _tmp21_, _tmp24_);
				id = _tmp25_;
				_tmp26_ = id;
				if (g_strcmp0 (_tmp26_, name) == 0) {
					GdkMonitor* _tmp27_;
					_tmp27_ = monitor;
					result = _tmp27_;
					_g_free0 (id);
					_g_object_unref0 (obj);
					return result;
				}
				_g_free0 (id);
				_g_object_unref0 (obj);
			}
		}
	}
	result = NULL;
	return result;
}

gchar*
sway_notification_center_functions_monitor_to_string (GdkMonitor* monitor)
{
	const gchar* _tmp0_;
	GdkRectangle _tmp1_ = {0};
	GdkRectangle _tmp2_;
	GdkRectangle _tmp3_ = {0};
	GdkRectangle _tmp4_;
	GdkRectangle _tmp5_ = {0};
	GdkRectangle _tmp6_;
	GdkRectangle _tmp7_ = {0};
	GdkRectangle _tmp8_;
	gdouble _tmp9_;
	gdouble _tmp10_;
	gchar* _tmp11_;
	gchar* result;
	g_return_val_if_fail ((monitor == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (monitor, gdk_monitor_get_type ()), NULL);
	if (monitor == NULL) {
		result = NULL;
		return result;
	}
	_tmp0_ = gdk_monitor_get_description (monitor);
	gdk_monitor_get_geometry (monitor, &_tmp1_);
	_tmp2_ = _tmp1_;
	gdk_monitor_get_geometry (monitor, &_tmp3_);
	_tmp4_ = _tmp3_;
	gdk_monitor_get_geometry (monitor, &_tmp5_);
	_tmp6_ = _tmp5_;
	gdk_monitor_get_geometry (monitor, &_tmp7_);
	_tmp8_ = _tmp7_;
	_tmp9_ = gdk_monitor_get_scale (monitor);
	_tmp10_ = _tmp9_;
	_tmp11_ = g_strdup_printf ("%s, %ix%i, x:%i y:%i, scale:%f\n", _tmp0_, _tmp2_.width, _tmp4_.height, _tmp6_.x, _tmp8_.y, _tmp10_);
	result = _tmp11_;
	return result;
}

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

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

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

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

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

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

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

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

void
sway_notification_center_value_set_functions (GValue* value,
                                              gpointer v_object)
{
	SwayNotificationCenterFunctions * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, SWAY_NOTIFICATION_CENTER_TYPE_FUNCTIONS));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, SWAY_NOTIFICATION_CENTER_TYPE_FUNCTIONS));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		sway_notification_center_functions_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		sway_notification_center_functions_unref (old);
	}
}

void
sway_notification_center_value_take_functions (GValue* value,
                                               gpointer v_object)
{
	SwayNotificationCenterFunctions * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, SWAY_NOTIFICATION_CENTER_TYPE_FUNCTIONS));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, SWAY_NOTIFICATION_CENTER_TYPE_FUNCTIONS));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		sway_notification_center_functions_unref (old);
	}
}

static void
sway_notification_center_functions_class_init (SwayNotificationCenterFunctionsClass * klass,
                                               gpointer klass_data)
{
	sway_notification_center_functions_parent_class = g_type_class_peek_parent (klass);
	((SwayNotificationCenterFunctionsClass *) klass)->finalize = sway_notification_center_functions_finalize;
}

static void
sway_notification_center_functions_instance_init (SwayNotificationCenterFunctions * self,
                                                  gpointer klass)
{
	self->ref_count = 1;
}

static void
sway_notification_center_functions_finalize (SwayNotificationCenterFunctions * obj)
{
	SwayNotificationCenterFunctions * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SWAY_NOTIFICATION_CENTER_TYPE_FUNCTIONS, SwayNotificationCenterFunctions);
	g_signal_handlers_destroy (self);
}

 G_GNUC_NO_INLINE static GType
sway_notification_center_functions_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { sway_notification_center_value_functions_init, sway_notification_center_value_functions_free_value, sway_notification_center_value_functions_copy_value, sway_notification_center_value_functions_peek_pointer, "p", sway_notification_center_value_functions_collect_value, "p", sway_notification_center_value_functions_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (SwayNotificationCenterFunctionsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) sway_notification_center_functions_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SwayNotificationCenterFunctions), 0, (GInstanceInitFunc) sway_notification_center_functions_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType sway_notification_center_functions_type_id;
	sway_notification_center_functions_type_id = g_type_register_fundamental (g_type_fundamental_next (), "SwayNotificationCenterFunctions", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return sway_notification_center_functions_type_id;
}

GType
sway_notification_center_functions_get_type (void)
{
	static gsize sway_notification_center_functions_type_id__once = 0;
	if (g_once_init_enter (&sway_notification_center_functions_type_id__once)) {
		GType sway_notification_center_functions_type_id;
		sway_notification_center_functions_type_id = sway_notification_center_functions_get_type_once ();
		g_once_init_leave (&sway_notification_center_functions_type_id__once, sway_notification_center_functions_type_id);
	}
	return sway_notification_center_functions_type_id__once;
}

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

void
sway_notification_center_functions_unref (gpointer instance)
{
	SwayNotificationCenterFunctions * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		SWAY_NOTIFICATION_CENTER_FUNCTIONS_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

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

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

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

