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

/*
 * Copyright (c) 2026 focus-timer contributors
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 *
 * Authors: Kamil Prusko <kamilprusko@gmail.com>
 */

#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "ft_core.h"
#include <gio/gio.h>
#include <gobject/gvaluecollector.h>

#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

#define FT_TYPE_NOTIFICATION_BUTTON (ft_notification_button_get_type ())
typedef struct _FtNotificationButton FtNotificationButton;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _FtParamSpecNotification FtParamSpecNotification;

struct _FtNotificationButton {
	gchar* label;
	gchar* action;
	GVariant* target_value;
};

struct _FtNotificationPrivate {
	FtNotificationButton* buttons;
	gint buttons_length1;
	gint _buttons_size_;
};

struct _FtParamSpecNotification {
	GParamSpec parent_instance;
};

static gint FtNotification_private_offset;
static gpointer ft_notification_parent_class = NULL;

VALA_EXTERN GType ft_notification_button_get_type (void) G_GNUC_CONST ;
VALA_EXTERN FtNotificationButton* ft_notification_button_dup (const FtNotificationButton* self);
VALA_EXTERN void ft_notification_button_free (FtNotificationButton* self);
VALA_EXTERN void ft_notification_button_copy (const FtNotificationButton* self,
                                  FtNotificationButton* dest);
VALA_EXTERN void ft_notification_button_destroy (FtNotificationButton* self);
static void _vala_FtNotificationButton_array_free (FtNotificationButton * array,
                                            gssize array_length);
static void _vala_array_add20 (FtNotificationButton* * array,
                        gint* length,
                        gint* size,
                        const FtNotificationButton* value);
static void ft_notification_finalize (FtNotification * obj);
static GType ft_notification_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

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

void
ft_notification_button_copy (const FtNotificationButton* self,
                             FtNotificationButton* dest)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	GVariant* _tmp4_;
	GVariant* _tmp5_;
	_tmp0_ = (*self).label;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 ((*dest).label);
	(*dest).label = _tmp1_;
	_tmp2_ = (*self).action;
	_tmp3_ = g_strdup (_tmp2_);
	_g_free0 ((*dest).action);
	(*dest).action = _tmp3_;
	_tmp4_ = (*self).target_value;
	_tmp5_ = _g_variant_ref0 (_tmp4_);
	_g_variant_unref0 ((*dest).target_value);
	(*dest).target_value = _tmp5_;
}

void
ft_notification_button_destroy (FtNotificationButton* self)
{
	_g_free0 ((*self).label);
	_g_free0 ((*self).action);
	_g_variant_unref0 ((*self).target_value);
}

FtNotificationButton*
ft_notification_button_dup (const FtNotificationButton* self)
{
	FtNotificationButton* dup;
	dup = g_new0 (FtNotificationButton, 1);
	ft_notification_button_copy (self, dup);
	return dup;
}

void
ft_notification_button_free (FtNotificationButton* self)
{
	ft_notification_button_destroy (self);
	g_free (self);
}

static GType
ft_notification_button_get_type_once (void)
{
	GType ft_notification_button_type_id;
	ft_notification_button_type_id = g_boxed_type_register_static ("FtNotificationButton", (GBoxedCopyFunc) ft_notification_button_dup, (GBoxedFreeFunc) ft_notification_button_free);
	return ft_notification_button_type_id;
}

GType
ft_notification_button_get_type (void)
{
	static volatile gsize ft_notification_button_type_id__once = 0;
	if (g_once_init_enter (&ft_notification_button_type_id__once)) {
		GType ft_notification_button_type_id;
		ft_notification_button_type_id = ft_notification_button_get_type_once ();
		g_once_init_leave (&ft_notification_button_type_id__once, ft_notification_button_type_id);
	}
	return ft_notification_button_type_id__once;
}

gchar*
ft_notification_priority_to_string (FtNotificationPriority self)
{
	gchar* result;
	switch (self) {
		case FT_NOTIFICATION_PRIORITY_LOW:
		{
			gchar* _tmp0_;
			_tmp0_ = g_strdup ("low");
			result = _tmp0_;
			return result;
		}
		case FT_NOTIFICATION_PRIORITY_NORMAL:
		{
			gchar* _tmp1_;
			_tmp1_ = g_strdup ("normal");
			result = _tmp1_;
			return result;
		}
		case FT_NOTIFICATION_PRIORITY_HIGH:
		{
			gchar* _tmp2_;
			_tmp2_ = g_strdup ("high");
			result = _tmp2_;
			return result;
		}
		case FT_NOTIFICATION_PRIORITY_URGENT:
		{
			gchar* _tmp3_;
			_tmp3_ = g_strdup ("urgent");
			result = _tmp3_;
			return result;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
}

static GType
ft_notification_priority_get_type_once (void)
{
	static const GEnumValue values[] = {{FT_NOTIFICATION_PRIORITY_LOW, "FT_NOTIFICATION_PRIORITY_LOW", "low"}, {FT_NOTIFICATION_PRIORITY_NORMAL, "FT_NOTIFICATION_PRIORITY_NORMAL", "normal"}, {FT_NOTIFICATION_PRIORITY_HIGH, "FT_NOTIFICATION_PRIORITY_HIGH", "high"}, {FT_NOTIFICATION_PRIORITY_URGENT, "FT_NOTIFICATION_PRIORITY_URGENT", "urgent"}, {0, NULL, NULL}};
	GType ft_notification_priority_type_id;
	ft_notification_priority_type_id = g_enum_register_static ("FtNotificationPriority", values);
	return ft_notification_priority_type_id;
}

GType
ft_notification_priority_get_type (void)
{
	static volatile gsize ft_notification_priority_type_id__once = 0;
	if (g_once_init_enter (&ft_notification_priority_type_id__once)) {
		GType ft_notification_priority_type_id;
		ft_notification_priority_type_id = ft_notification_priority_get_type_once ();
		g_once_init_leave (&ft_notification_priority_type_id__once, ft_notification_priority_type_id);
	}
	return ft_notification_priority_type_id__once;
}

static inline gpointer
ft_notification_get_instance_private (FtNotification* self)
{
	return G_STRUCT_MEMBER_P (self, FtNotification_private_offset);
}

static void
_vala_FtNotificationButton_array_free (FtNotificationButton * array,
                                       gssize array_length)
{
	if (array != NULL) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			ft_notification_button_destroy (&array[i]);
		}
	}
	g_free (array);
}

FtNotification*
ft_notification_construct (GType object_type,
                           const gchar* title,
                           const gchar* body)
{
	FtNotification* self = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	FtNotificationButton* _tmp2_;
	g_return_val_if_fail (title != NULL, NULL);
	g_return_val_if_fail (body != NULL, NULL);
	self = (FtNotification*) g_type_create_instance (object_type);
	_tmp0_ = g_strdup (title);
	_g_free0 (self->title);
	self->title = _tmp0_;
	_tmp1_ = g_strdup (body);
	_g_free0 (self->body);
	self->body = _tmp1_;
	_tmp2_ = g_new0 (FtNotificationButton, 0);
	self->priv->buttons = (_vala_FtNotificationButton_array_free (self->priv->buttons, self->priv->buttons_length1), NULL);
	self->priv->buttons = _tmp2_;
	self->priv->buttons_length1 = 0;
	self->priv->_buttons_size_ = self->priv->buttons_length1;
	return self;
}

FtNotification*
ft_notification_new (const gchar* title,
                     const gchar* body)
{
	return ft_notification_construct (FT_TYPE_NOTIFICATION, title, body);
}

void
ft_notification_set_default_action_and_target_value (FtNotification* self,
                                                     const gchar* action,
                                                     GVariant* target_value)
{
	gchar* _tmp0_;
	GVariant* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	_tmp0_ = g_strdup (action);
	_g_free0 (self->default_action);
	self->default_action = _tmp0_;
	_tmp1_ = _g_variant_ref0 (target_value);
	_g_variant_unref0 (self->default_target_value);
	self->default_target_value = _tmp1_;
}

void
ft_notification_set_default_action (FtNotification* self,
                                    const gchar* detailed_action)
{
	gchar* action = NULL;
	GVariant* target_value = NULL;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (detailed_action != NULL);
	{
		gchar* _tmp0_ = NULL;
		GVariant* _tmp1_ = NULL;
		g_action_parse_detailed_name (detailed_action, &_tmp0_, &_tmp1_, &_inner_error0_);
		_g_free0 (action);
		action = _tmp0_;
		_g_variant_unref0 (target_value);
		target_value = _tmp1_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		ft_notification_set_default_action_and_target_value (self, action, target_value);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		GError* _tmp2_;
		const gchar* _tmp3_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp2_ = _error_;
		_tmp3_ = _tmp2_->message;
		g_warning ("notification.vala:109: Failed to set notification default action: %s", _tmp3_);
		_g_error_free0 (_error_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_variant_unref0 (target_value);
		_g_free0 (action);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_g_variant_unref0 (target_value);
	_g_free0 (action);
}

static void
_vala_array_add20 (FtNotificationButton* * array,
                   gint* length,
                   gint* size,
                   const FtNotificationButton* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (FtNotificationButton, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

void
ft_notification_add_button_with_target_value (FtNotification* self,
                                              const gchar* label,
                                              const gchar* action,
                                              GVariant* target_value)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	GVariant* _tmp2_;
	FtNotificationButton _tmp3_ = {0};
	g_return_if_fail (self != NULL);
	g_return_if_fail (label != NULL);
	g_return_if_fail (action != NULL);
	_tmp0_ = g_strdup (label);
	_tmp1_ = g_strdup (action);
	_tmp2_ = _g_variant_ref0 (target_value);
	memset (&_tmp3_, 0, sizeof (FtNotificationButton));
	_g_free0 (_tmp3_.label);
	_tmp3_.label = _tmp0_;
	_g_free0 (_tmp3_.action);
	_tmp3_.action = _tmp1_;
	_g_variant_unref0 (_tmp3_.target_value);
	_tmp3_.target_value = _tmp2_;
	_vala_array_add20 (&self->priv->buttons, &self->priv->buttons_length1, &self->priv->_buttons_size_, &_tmp3_);
}

void
ft_notification_add_button (FtNotification* self,
                            const gchar* label,
                            const gchar* detailed_action)
{
	gchar* action = NULL;
	GVariant* target_value = NULL;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (label != NULL);
	g_return_if_fail (detailed_action != NULL);
	{
		gchar* _tmp0_ = NULL;
		GVariant* _tmp1_ = NULL;
		g_action_parse_detailed_name (detailed_action, &_tmp0_, &_tmp1_, &_inner_error0_);
		_g_free0 (action);
		action = _tmp0_;
		_g_variant_unref0 (target_value);
		target_value = _tmp1_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		ft_notification_add_button_with_target_value (self, label, action, target_value);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		GError* _tmp2_;
		const gchar* _tmp3_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp2_ = _error_;
		_tmp3_ = _tmp2_->message;
		g_warning ("notification.vala:137: Failed to add notification button: %s", _tmp3_);
		_g_error_free0 (_error_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_variant_unref0 (target_value);
		_g_free0 (action);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_g_variant_unref0 (target_value);
	_g_free0 (action);
}

void
ft_notification_foreach_button (FtNotification* self,
                                FtNotificationForeachButtonFunc func,
                                gpointer func_target)
{
	FtNotificationButton* _tmp0_;
	gint _tmp0__length1;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->buttons;
	_tmp0__length1 = self->priv->buttons_length1;
	{
		FtNotificationButton* button_collection = NULL;
		gint button_collection_length1 = 0;
		gint _button_collection_size_ = 0;
		gint button_it = 0;
		button_collection = _tmp0_;
		button_collection_length1 = _tmp0__length1;
		for (button_it = 0; button_it < button_collection_length1; button_it = button_it + 1) {
			FtNotificationButton _tmp1_;
			FtNotificationButton _tmp2_ = {0};
			FtNotificationButton button = {0};
			_tmp1_ = button_collection[button_it];
			ft_notification_button_copy (&_tmp1_, &_tmp2_);
			button = _tmp2_;
			{
				FtNotificationButton _tmp3_;
				const gchar* _tmp4_;
				FtNotificationButton _tmp5_;
				const gchar* _tmp6_;
				FtNotificationButton _tmp7_;
				GVariant* _tmp8_;
				_tmp3_ = button;
				_tmp4_ = _tmp3_.label;
				_tmp5_ = button;
				_tmp6_ = _tmp5_.action;
				_tmp7_ = button;
				_tmp8_ = _tmp7_.target_value;
				func (_tmp4_, _tmp6_, _tmp8_, func_target);
				ft_notification_button_destroy (&button);
			}
		}
	}
}

/**
         * Compare visible fields and tell whether notifications are roughly the same.
         */
gboolean
ft_notification_is_similar (FtNotification* self,
                            FtNotification* other)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (other != NULL, FALSE);
	_tmp0_ = self->title;
	_tmp1_ = other->title;
	if (g_strcmp0 (_tmp0_, _tmp1_) != 0) {
		result = FALSE;
		return result;
	}
	_tmp2_ = self->body;
	_tmp3_ = other->body;
	if (g_strcmp0 (_tmp2_, _tmp3_) != 0) {
		result = FALSE;
		return result;
	}
	result = TRUE;
	return result;
}

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

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

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

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

static gchar*
ft_value_notification_collect_value (GValue* value,
                                     guint n_collect_values,
                                     GTypeCValue* collect_values,
                                     guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		FtNotification * 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 = ft_notification_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
ft_value_notification_lcopy_value (const GValue* value,
                                   guint n_collect_values,
                                   GTypeCValue* collect_values,
                                   guint collect_flags)
{
	FtNotification ** 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 = ft_notification_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
ft_param_spec_notification (const gchar* name,
                            const gchar* nick,
                            const gchar* blurb,
                            GType object_type,
                            GParamFlags flags)
{
	FtParamSpecNotification* spec;
	g_return_val_if_fail (g_type_is_a (object_type, FT_TYPE_NOTIFICATION), 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
ft_value_get_notification (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, FT_TYPE_NOTIFICATION), NULL);
	return value->data[0].v_pointer;
}

void
ft_value_set_notification (GValue* value,
                           gpointer v_object)
{
	FtNotification * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, FT_TYPE_NOTIFICATION));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, FT_TYPE_NOTIFICATION));
		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;
		ft_notification_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		ft_notification_unref (old);
	}
}

void
ft_value_take_notification (GValue* value,
                            gpointer v_object)
{
	FtNotification * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, FT_TYPE_NOTIFICATION));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, FT_TYPE_NOTIFICATION));
		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) {
		ft_notification_unref (old);
	}
}

static void
ft_notification_class_init (FtNotificationClass * klass,
                            gpointer klass_data)
{
	ft_notification_parent_class = g_type_class_peek_parent (klass);
	((FtNotificationClass *) klass)->finalize = ft_notification_finalize;
	g_type_class_adjust_private_offset (klass, &FtNotification_private_offset);
}

static void
ft_notification_instance_init (FtNotification * self,
                               gpointer klass)
{
	self->priv = ft_notification_get_instance_private (self);
	self->category = NULL;
	self->event_id = NULL;
	self->icon = NULL;
	self->is_transient = FALSE;
	self->suppress_sound = FALSE;
	self->priority = FT_NOTIFICATION_PRIORITY_NORMAL;
	self->default_action = NULL;
	self->default_target_value = NULL;
	self->expire_timeout = -1;
	self->ref_count = 1;
}

static void
ft_notification_finalize (FtNotification * obj)
{
	FtNotification * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_NOTIFICATION, FtNotification);
	g_signal_handlers_destroy (self);
	_g_free0 (self->category);
	self->category = NULL;
	_g_free0 (self->event_id);
	self->event_id = NULL;
	_g_object_unref0 (self->icon);
	self->icon = NULL;
	_g_free0 (self->default_action);
	self->default_action = NULL;
	_g_variant_unref0 (self->default_target_value);
	self->default_target_value = NULL;
	self->priv->buttons = (_vala_FtNotificationButton_array_free (self->priv->buttons, self->priv->buttons_length1), NULL);
	self->priv->buttons = NULL;
	self->priv->buttons_length1 = 0;
	self->priv->_buttons_size_ = self->priv->buttons_length1;
	_g_free0 (self->title);
	_g_free0 (self->body);
	_g_free0 (self->category);
	_g_free0 (self->event_id);
	_g_object_unref0 (self->icon);
	_g_free0 (self->default_action);
	_g_variant_unref0 (self->default_target_value);
	self->priv->buttons = (_vala_FtNotificationButton_array_free (self->priv->buttons, self->priv->buttons_length1), NULL);
}

/**
     * `GLib.Notification` equivalent, but fully editable and with extra fields.
     */
static GType
ft_notification_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { ft_value_notification_init, ft_value_notification_free_value, ft_value_notification_copy_value, ft_value_notification_peek_pointer, "p", ft_value_notification_collect_value, "p", ft_value_notification_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (FtNotificationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_notification_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtNotification), 0, (GInstanceInitFunc) ft_notification_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 ft_notification_type_id;
	ft_notification_type_id = g_type_register_fundamental (g_type_fundamental_next (), "FtNotification", &g_define_type_info, &g_define_type_fundamental_info, 0);
	FtNotification_private_offset = g_type_add_instance_private (ft_notification_type_id, sizeof (FtNotificationPrivate));
	return ft_notification_type_id;
}

GType
ft_notification_get_type (void)
{
	static volatile gsize ft_notification_type_id__once = 0;
	if (g_once_init_enter (&ft_notification_type_id__once)) {
		GType ft_notification_type_id;
		ft_notification_type_id = ft_notification_get_type_once ();
		g_once_init_leave (&ft_notification_type_id__once, ft_notification_type_id);
	}
	return ft_notification_type_id__once;
}

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

void
ft_notification_unref (gpointer instance)
{
	FtNotification * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		FT_NOTIFICATION_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

