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

#include <adwaita.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gio/gio.h>
#include <gdk/gdk.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
#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 TUBA_WIDGETS_TYPE_EMOJI (tuba_widgets_emoji_get_type ())
#define TUBA_WIDGETS_EMOJI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_EMOJI, TubaWidgetsEmoji))
#define TUBA_WIDGETS_EMOJI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_EMOJI, TubaWidgetsEmojiClass))
#define TUBA_WIDGETS_IS_EMOJI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_EMOJI))
#define TUBA_WIDGETS_IS_EMOJI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_EMOJI))
#define TUBA_WIDGETS_EMOJI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_EMOJI, TubaWidgetsEmojiClass))

typedef struct _TubaWidgetsEmoji TubaWidgetsEmoji;
typedef struct _TubaWidgetsEmojiClass TubaWidgetsEmojiClass;
typedef struct _TubaWidgetsEmojiPrivate TubaWidgetsEmojiPrivate;
enum  {
	TUBA_WIDGETS_EMOJI_0_PROPERTY,
	TUBA_WIDGETS_EMOJI_PIXEL_SIZE_PROPERTY,
	TUBA_WIDGETS_EMOJI_ICON_SIZE_PROPERTY,
	TUBA_WIDGETS_EMOJI_SHORTCODE_PROPERTY,
	TUBA_WIDGETS_EMOJI_EMOJI_URL_PROPERTY,
	TUBA_WIDGETS_EMOJI_DISABLE_HOVER_SCALE_PROPERTY,
	TUBA_WIDGETS_EMOJI_NUM_PROPERTIES
};
static GParamSpec* tuba_widgets_emoji_properties[TUBA_WIDGETS_EMOJI_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef void (*TubaHelperImageOnItemChangedFn) (GdkPaintable* data, gpointer user_data);

struct _TubaWidgetsEmoji {
	AdwBin parent_instance;
	TubaWidgetsEmojiPrivate * priv;
	GtkImage* image;
};

struct _TubaWidgetsEmojiClass {
	AdwBinClass parent_class;
};

struct _TubaWidgetsEmojiPrivate {
	gchar* _shortcode;
	GCancellable* cancellable;
	gchar* _emoji_url;
};

static gint TubaWidgetsEmoji_private_offset;
static gpointer tuba_widgets_emoji_parent_class = NULL;

VALA_EXTERN GType tuba_widgets_emoji_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsEmoji, g_object_unref)
VALA_EXTERN TubaWidgetsEmoji* tuba_widgets_emoji_new (const gchar* emoji_url,
                                          const gchar* t_shortcode);
VALA_EXTERN TubaWidgetsEmoji* tuba_widgets_emoji_construct (GType object_type,
                                                const gchar* emoji_url,
                                                const gchar* t_shortcode);
VALA_EXTERN void tuba_widgets_emoji_set_shortcode (TubaWidgetsEmoji* self,
                                       const gchar* value);
VALA_EXTERN void tuba_widgets_emoji_set_emoji_url (TubaWidgetsEmoji* self,
                                       const gchar* value);
static void tuba_widgets_emoji_on_cache_response (TubaWidgetsEmoji* self,
                                           GdkPaintable* data);
VALA_EXTERN gint tuba_widgets_emoji_get_pixel_size (TubaWidgetsEmoji* self);
VALA_EXTERN void tuba_widgets_emoji_set_pixel_size (TubaWidgetsEmoji* self,
                                        gint value);
VALA_EXTERN GtkIconSize tuba_widgets_emoji_get_icon_size (TubaWidgetsEmoji* self);
VALA_EXTERN void tuba_widgets_emoji_set_icon_size (TubaWidgetsEmoji* self,
                                       GtkIconSize value);
VALA_EXTERN const gchar* tuba_widgets_emoji_get_shortcode (TubaWidgetsEmoji* self);
VALA_EXTERN const gchar* tuba_widgets_emoji_get_emoji_url (TubaWidgetsEmoji* self);
VALA_EXTERN GdkPaintable* tuba_helper_image_lookup_cache (const gchar* uri);
VALA_EXTERN void tuba_helper_image_request_paintable (const gchar* url,
                                          const gchar* blurhash,
                                          gboolean disable_cache,
                                          TubaHelperImageOnItemChangedFn cb,
                                          gpointer cb_target,
                                          GDestroyNotify cb_target_destroy_notify,
                                          GCancellable* cancellable);
static void _tuba_widgets_emoji_on_cache_response_tuba_helper_image_on_item_changed_fn (GdkPaintable* data,
                                                                                 gpointer self);
VALA_EXTERN void tuba_widgets_emoji_set_disable_hover_scale (TubaWidgetsEmoji* self,
                                                 gboolean value);
static GObject * tuba_widgets_emoji_constructor (GType type,
                                          guint n_construct_properties,
                                          GObjectConstructParam * construct_properties);
static void tuba_widgets_emoji_finalize (GObject * obj);
static GType tuba_widgets_emoji_get_type_once (void);
static void _vala_tuba_widgets_emoji_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec);
static void _vala_tuba_widgets_emoji_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec);
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 inline gpointer
tuba_widgets_emoji_get_instance_private (TubaWidgetsEmoji* self)
{
	return G_STRUCT_MEMBER_P (self, TubaWidgetsEmoji_private_offset);
}

TubaWidgetsEmoji*
tuba_widgets_emoji_construct (GType object_type,
                              const gchar* emoji_url,
                              const gchar* t_shortcode)
{
	TubaWidgetsEmoji * self = NULL;
	g_return_val_if_fail (emoji_url != NULL, NULL);
	self = (TubaWidgetsEmoji*) g_object_new (object_type, NULL);
	tuba_widgets_emoji_set_shortcode (self, t_shortcode);
	tuba_widgets_emoji_set_emoji_url (self, emoji_url);
	return self;
}

TubaWidgetsEmoji*
tuba_widgets_emoji_new (const gchar* emoji_url,
                        const gchar* t_shortcode)
{
	return tuba_widgets_emoji_construct (TUBA_WIDGETS_TYPE_EMOJI, emoji_url, t_shortcode);
}

static void
tuba_widgets_emoji_on_cache_response (TubaWidgetsEmoji* self,
                                      GdkPaintable* data)
{
	GtkImage* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->image;
	g_object_set (_tmp0_, "paintable", data, NULL);
}

gint
tuba_widgets_emoji_get_pixel_size (TubaWidgetsEmoji* self)
{
	gint result;
	GtkImage* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	g_return_val_if_fail (self != NULL, -1);
	_tmp0_ = self->image;
	_tmp1_ = gtk_image_get_pixel_size (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

void
tuba_widgets_emoji_set_pixel_size (TubaWidgetsEmoji* self,
                                   gint value)
{
	GtkImage* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->image;
	gtk_image_set_pixel_size (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, tuba_widgets_emoji_properties[TUBA_WIDGETS_EMOJI_PIXEL_SIZE_PROPERTY]);
}

GtkIconSize
tuba_widgets_emoji_get_icon_size (TubaWidgetsEmoji* self)
{
	GtkIconSize result;
	GtkImage* _tmp0_;
	GtkIconSize _tmp1_;
	GtkIconSize _tmp2_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->image;
	_tmp1_ = gtk_image_get_icon_size (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

void
tuba_widgets_emoji_set_icon_size (TubaWidgetsEmoji* self,
                                  GtkIconSize value)
{
	GtkImage* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->image;
	gtk_image_set_icon_size (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, tuba_widgets_emoji_properties[TUBA_WIDGETS_EMOJI_ICON_SIZE_PROPERTY]);
}

const gchar*
tuba_widgets_emoji_get_shortcode (TubaWidgetsEmoji* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_shortcode;
	result = _tmp0_;
	return result;
}

void
tuba_widgets_emoji_set_shortcode (TubaWidgetsEmoji* self,
                                  const gchar* value)
{
	const gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_shortcode;
	if (g_strcmp0 (value, _tmp0_) != 0) {
		gchar* _tmp1_;
		const gchar* _tmp2_ = NULL;
		_tmp1_ = g_strdup (value);
		_g_free0 (self->priv->_shortcode);
		self->priv->_shortcode = _tmp1_;
		if (value == NULL) {
			_tmp2_ = "";
		} else {
			_tmp2_ = value;
		}
		gtk_widget_set_tooltip_text ((GtkWidget*) self, _tmp2_);
	}
	g_object_notify_by_pspec ((GObject *) self, tuba_widgets_emoji_properties[TUBA_WIDGETS_EMOJI_SHORTCODE_PROPERTY]);
}

const gchar*
tuba_widgets_emoji_get_emoji_url (TubaWidgetsEmoji* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_emoji_url;
	result = _tmp0_;
	return result;
}

static void
_tuba_widgets_emoji_on_cache_response_tuba_helper_image_on_item_changed_fn (GdkPaintable* data,
                                                                            gpointer self)
{
	tuba_widgets_emoji_on_cache_response ((TubaWidgetsEmoji*) self, data);
}

void
tuba_widgets_emoji_set_emoji_url (TubaWidgetsEmoji* self,
                                  const gchar* value)
{
	const gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_emoji_url;
	if (g_strcmp0 (_tmp0_, value) != 0) {
		GCancellable* _tmp1_;
		gboolean _tmp3_ = FALSE;
		_tmp1_ = self->priv->cancellable;
		if (_tmp1_ != NULL) {
			GCancellable* _tmp2_;
			_tmp2_ = self->priv->cancellable;
			g_cancellable_cancel (_tmp2_);
		}
		if (value == NULL) {
			_tmp3_ = TRUE;
		} else {
			_tmp3_ = g_strcmp0 (value, "") == 0;
		}
		if (_tmp3_) {
			gchar* _tmp4_;
			GtkImage* _tmp5_;
			_tmp4_ = g_strdup ("");
			_g_free0 (self->priv->_emoji_url);
			self->priv->_emoji_url = _tmp4_;
			_tmp5_ = self->image;
			g_object_set (_tmp5_, "paintable", NULL, NULL);
		} else {
			gchar* _tmp6_;
			GdkPaintable* cached_paintable = NULL;
			const gchar* _tmp7_;
			const gchar* _tmp8_;
			GdkPaintable* _tmp9_;
			GdkPaintable* _tmp10_;
			_tmp6_ = g_strdup (value);
			_g_free0 (self->priv->_emoji_url);
			self->priv->_emoji_url = _tmp6_;
			_tmp7_ = tuba_widgets_emoji_get_emoji_url (self);
			_tmp8_ = _tmp7_;
			_tmp9_ = tuba_helper_image_lookup_cache (_tmp8_);
			cached_paintable = _tmp9_;
			_tmp10_ = cached_paintable;
			if (_tmp10_ == NULL) {
				GCancellable* _tmp11_;
				const gchar* _tmp12_;
				const gchar* _tmp13_;
				GCancellable* _tmp14_;
				_tmp11_ = g_cancellable_new ();
				_g_object_unref0 (self->priv->cancellable);
				self->priv->cancellable = _tmp11_;
				_tmp12_ = tuba_widgets_emoji_get_emoji_url (self);
				_tmp13_ = _tmp12_;
				_tmp14_ = self->priv->cancellable;
				tuba_helper_image_request_paintable (_tmp13_, NULL, FALSE, _tuba_widgets_emoji_on_cache_response_tuba_helper_image_on_item_changed_fn, g_object_ref (self), g_object_unref, _tmp14_);
			} else {
				GdkPaintable* _tmp15_;
				_tmp15_ = cached_paintable;
				tuba_widgets_emoji_on_cache_response (self, _tmp15_);
			}
			_g_object_unref0 (cached_paintable);
		}
	}
	g_object_notify_by_pspec ((GObject *) self, tuba_widgets_emoji_properties[TUBA_WIDGETS_EMOJI_EMOJI_URL_PROPERTY]);
}

void
tuba_widgets_emoji_set_disable_hover_scale (TubaWidgetsEmoji* self,
                                            gboolean value)
{
	g_return_if_fail (self != NULL);
	if (value) {
		GtkImage* _tmp0_;
		_tmp0_ = self->image;
		gtk_widget_remove_css_class ((GtkWidget*) _tmp0_, "lww-emoji");
	} else {
		GtkImage* _tmp1_;
		_tmp1_ = self->image;
		gtk_widget_add_css_class ((GtkWidget*) _tmp1_, "lww-emoji");
	}
	g_object_notify_by_pspec ((GObject *) self, tuba_widgets_emoji_properties[TUBA_WIDGETS_EMOJI_DISABLE_HOVER_SCALE_PROPERTY]);
}

static GObject *
tuba_widgets_emoji_constructor (GType type,
                                guint n_construct_properties,
                                GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	TubaWidgetsEmoji * self;
	gchar* _tmp0_;
	gchar** _tmp1_;
	GtkImage* _tmp2_ = NULL;
	GtkImage* _tmp3_;
	parent_class = G_OBJECT_CLASS (tuba_widgets_emoji_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_WIDGETS_TYPE_EMOJI, TubaWidgetsEmoji);
	_tmp0_ = g_strdup ("lww-emoji");
	_tmp1_ = g_new0 (gchar*, 1 + 1);
	_tmp1_[0] = _tmp0_;
	_tmp2_ = (GtkImage*) gtk_image_new ();
	gtk_widget_set_css_classes ((GtkWidget*) _tmp2_, _tmp1_);
	_tmp1_ = (_vala_array_free (_tmp1_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->image);
	self->image = _tmp2_;
	_tmp3_ = self->image;
	adw_bin_set_child ((AdwBin*) self, (GtkWidget*) _tmp3_);
	return obj;
}

static void
tuba_widgets_emoji_class_init (TubaWidgetsEmojiClass * klass,
                               gpointer klass_data)
{
	tuba_widgets_emoji_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaWidgetsEmoji_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_widgets_emoji_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_widgets_emoji_set_property;
	G_OBJECT_CLASS (klass)->constructor = tuba_widgets_emoji_constructor;
	G_OBJECT_CLASS (klass)->finalize = tuba_widgets_emoji_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_EMOJI_PIXEL_SIZE_PROPERTY, tuba_widgets_emoji_properties[TUBA_WIDGETS_EMOJI_PIXEL_SIZE_PROPERTY] = g_param_spec_int ("pixel-size", "pixel-size", "pixel-size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_EMOJI_ICON_SIZE_PROPERTY, tuba_widgets_emoji_properties[TUBA_WIDGETS_EMOJI_ICON_SIZE_PROPERTY] = g_param_spec_enum ("icon-size", "icon-size", "icon-size", gtk_icon_size_get_type (), 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_EMOJI_SHORTCODE_PROPERTY, tuba_widgets_emoji_properties[TUBA_WIDGETS_EMOJI_SHORTCODE_PROPERTY] = g_param_spec_string ("shortcode", "shortcode", "shortcode", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_EMOJI_EMOJI_URL_PROPERTY, tuba_widgets_emoji_properties[TUBA_WIDGETS_EMOJI_EMOJI_URL_PROPERTY] = g_param_spec_string ("emoji-url", "emoji-url", "emoji-url", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_EMOJI_DISABLE_HOVER_SCALE_PROPERTY, tuba_widgets_emoji_properties[TUBA_WIDGETS_EMOJI_DISABLE_HOVER_SCALE_PROPERTY] = g_param_spec_boolean ("disable-hover-scale", "disable-hover-scale", "disable-hover-scale", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	gtk_widget_class_set_accessible_role (GTK_WIDGET_CLASS (klass), GTK_ACCESSIBLE_ROLE_IMG);
}

static void
tuba_widgets_emoji_instance_init (TubaWidgetsEmoji * self,
                                  gpointer klass)
{
	gchar* _tmp0_;
	self->priv = tuba_widgets_emoji_get_instance_private (self);
	self->priv->_shortcode = NULL;
	self->priv->cancellable = NULL;
	_tmp0_ = g_strdup ("");
	self->priv->_emoji_url = _tmp0_;
}

static void
tuba_widgets_emoji_finalize (GObject * obj)
{
	TubaWidgetsEmoji * self;
	GCancellable* _tmp0_;
	GtkImage* _tmp2_;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_WIDGETS_TYPE_EMOJI, TubaWidgetsEmoji);
	_tmp0_ = self->priv->cancellable;
	if (_tmp0_ != NULL) {
		GCancellable* _tmp1_;
		_tmp1_ = self->priv->cancellable;
		g_cancellable_cancel (_tmp1_);
	}
	_tmp2_ = self->image;
	g_object_set (_tmp2_, "paintable", NULL, NULL);
	_g_object_unref0 (self->image);
	_g_free0 (self->priv->_shortcode);
	_g_object_unref0 (self->priv->cancellable);
	_g_free0 (self->priv->_emoji_url);
	G_OBJECT_CLASS (tuba_widgets_emoji_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_widgets_emoji_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaWidgetsEmojiClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_widgets_emoji_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaWidgetsEmoji), 0, (GInstanceInitFunc) tuba_widgets_emoji_instance_init, NULL };
	GType tuba_widgets_emoji_type_id;
	tuba_widgets_emoji_type_id = g_type_register_static (adw_bin_get_type (), "TubaWidgetsEmoji", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaWidgetsEmoji_private_offset = g_type_add_instance_private (tuba_widgets_emoji_type_id, sizeof (TubaWidgetsEmojiPrivate));
	return tuba_widgets_emoji_type_id;
}

GType
tuba_widgets_emoji_get_type (void)
{
	static GType tuba_widgets_emoji_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_widgets_emoji_type_id__once)) {
		GType tuba_widgets_emoji_type_id;
		tuba_widgets_emoji_type_id = tuba_widgets_emoji_get_type_once ();
		g_once_init_leave_pointer (&tuba_widgets_emoji_type_id__once, tuba_widgets_emoji_type_id);
	}
	return tuba_widgets_emoji_type_id__once;
}

static void
_vala_tuba_widgets_emoji_get_property (GObject * object,
                                       guint property_id,
                                       GValue * value,
                                       GParamSpec * pspec)
{
	TubaWidgetsEmoji * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_WIDGETS_TYPE_EMOJI, TubaWidgetsEmoji);
	switch (property_id) {
		case TUBA_WIDGETS_EMOJI_PIXEL_SIZE_PROPERTY:
		g_value_set_int (value, tuba_widgets_emoji_get_pixel_size (self));
		break;
		case TUBA_WIDGETS_EMOJI_ICON_SIZE_PROPERTY:
		g_value_set_enum (value, tuba_widgets_emoji_get_icon_size (self));
		break;
		case TUBA_WIDGETS_EMOJI_SHORTCODE_PROPERTY:
		g_value_set_string (value, tuba_widgets_emoji_get_shortcode (self));
		break;
		case TUBA_WIDGETS_EMOJI_EMOJI_URL_PROPERTY:
		g_value_set_string (value, tuba_widgets_emoji_get_emoji_url (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_widgets_emoji_set_property (GObject * object,
                                       guint property_id,
                                       const GValue * value,
                                       GParamSpec * pspec)
{
	TubaWidgetsEmoji * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_WIDGETS_TYPE_EMOJI, TubaWidgetsEmoji);
	switch (property_id) {
		case TUBA_WIDGETS_EMOJI_PIXEL_SIZE_PROPERTY:
		tuba_widgets_emoji_set_pixel_size (self, g_value_get_int (value));
		break;
		case TUBA_WIDGETS_EMOJI_ICON_SIZE_PROPERTY:
		tuba_widgets_emoji_set_icon_size (self, g_value_get_enum (value));
		break;
		case TUBA_WIDGETS_EMOJI_SHORTCODE_PROPERTY:
		tuba_widgets_emoji_set_shortcode (self, g_value_get_string (value));
		break;
		case TUBA_WIDGETS_EMOJI_EMOJI_URL_PROPERTY:
		tuba_widgets_emoji_set_emoji_url (self, g_value_get_string (value));
		break;
		case TUBA_WIDGETS_EMOJI_DISABLE_HOVER_SCALE_PROPERTY:
		tuba_widgets_emoji_set_disable_hover_scale (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

