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

#include <gtk/gtk.h>
#include <glib-object.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <adwaita.h>

#define TUBA_WIDGETS_LABEL_WITH_WIDGETS_OBJECT_REPLACEMENT_CHARACTER "\xEF\xBF\xBC"
#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_LABEL_WITH_WIDGETS (tuba_widgets_label_with_widgets_get_type ())
#define TUBA_WIDGETS_LABEL_WITH_WIDGETS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_LABEL_WITH_WIDGETS, TubaWidgetsLabelWithWidgets))
#define TUBA_WIDGETS_LABEL_WITH_WIDGETS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_LABEL_WITH_WIDGETS, TubaWidgetsLabelWithWidgetsClass))
#define TUBA_WIDGETS_IS_LABEL_WITH_WIDGETS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_LABEL_WITH_WIDGETS))
#define TUBA_WIDGETS_IS_LABEL_WITH_WIDGETS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_LABEL_WITH_WIDGETS))
#define TUBA_WIDGETS_LABEL_WITH_WIDGETS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_LABEL_WITH_WIDGETS, TubaWidgetsLabelWithWidgetsClass))

typedef struct _TubaWidgetsLabelWithWidgets TubaWidgetsLabelWithWidgets;
typedef struct _TubaWidgetsLabelWithWidgetsClass TubaWidgetsLabelWithWidgetsClass;
typedef struct _TubaWidgetsLabelWithWidgetsPrivate TubaWidgetsLabelWithWidgetsPrivate;

#define TUBA_WIDGETS_TYPE_EMOJI_LABEL (tuba_widgets_emoji_label_get_type ())
#define TUBA_WIDGETS_EMOJI_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_EMOJI_LABEL, TubaWidgetsEmojiLabel))
#define TUBA_WIDGETS_EMOJI_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_EMOJI_LABEL, TubaWidgetsEmojiLabelClass))
#define TUBA_WIDGETS_IS_EMOJI_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_EMOJI_LABEL))
#define TUBA_WIDGETS_IS_EMOJI_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_EMOJI_LABEL))
#define TUBA_WIDGETS_EMOJI_LABEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_EMOJI_LABEL, TubaWidgetsEmojiLabelClass))

typedef struct _TubaWidgetsEmojiLabel TubaWidgetsEmojiLabel;
typedef struct _TubaWidgetsEmojiLabelClass TubaWidgetsEmojiLabelClass;
typedef struct _TubaWidgetsEmojiLabelPrivate TubaWidgetsEmojiLabelPrivate;
enum  {
	TUBA_WIDGETS_EMOJI_LABEL_0_PROPERTY,
	TUBA_WIDGETS_EMOJI_LABEL_INSTANCE_EMOJIS_PROPERTY,
	TUBA_WIDGETS_EMOJI_LABEL_SMALLER_EMOJI_PIXEL_SIZE_PROPERTY,
	TUBA_WIDGETS_EMOJI_LABEL_LARGE_EMOJIS_PROPERTY,
	TUBA_WIDGETS_EMOJI_LABEL_CONTENT_PROPERTY,
	TUBA_WIDGETS_EMOJI_LABEL_NUM_PROPERTIES
};
static GParamSpec* tuba_widgets_emoji_label_properties[TUBA_WIDGETS_EMOJI_LABEL_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))
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))

#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;

struct _TubaWidgetsLabelWithWidgets {
	GtkWidget parent_instance;
	TubaWidgetsLabelWithWidgetsPrivate * priv;
	GtkLabel* label;
};

struct _TubaWidgetsLabelWithWidgetsClass {
	GtkWidgetClass parent_class;
};

struct _TubaWidgetsEmojiLabel {
	TubaWidgetsLabelWithWidgets parent_instance;
	TubaWidgetsEmojiLabelPrivate * priv;
};

struct _TubaWidgetsEmojiLabelClass {
	TubaWidgetsLabelWithWidgetsClass parent_class;
};

struct _TubaWidgetsEmojiLabelPrivate {
	GeeHashMap* _instance_emojis;
	gboolean _smaller_emoji_pixel_size;
	gboolean _large_emojis;
	gchar* _content;
};

static gint TubaWidgetsEmojiLabel_private_offset;
static gpointer tuba_widgets_emoji_label_parent_class = NULL;
VALA_EXTERN GRegex* tuba_custom_emoji_regex;

VALA_EXTERN GType tuba_widgets_label_with_widgets_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsLabelWithWidgets, g_object_unref)
VALA_EXTERN GType tuba_widgets_emoji_label_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsEmojiLabel, g_object_unref)
VALA_EXTERN TubaWidgetsEmojiLabel* tuba_widgets_emoji_label_new (const gchar* text,
                                                     GeeHashMap* emojis);
VALA_EXTERN TubaWidgetsEmojiLabel* tuba_widgets_emoji_label_construct (GType object_type,
                                                           const gchar* text,
                                                           GeeHashMap* emojis);
VALA_EXTERN void tuba_widgets_emoji_label_set_instance_emojis (TubaWidgetsEmojiLabel* self,
                                                   GeeHashMap* value);
VALA_EXTERN void tuba_widgets_emoji_label_set_content (TubaWidgetsEmojiLabel* self,
                                           const gchar* value);
static void tuba_widgets_emoji_label_generate_label_with_emojis (TubaWidgetsEmojiLabel* self,
                                                          const gchar* t_input,
                                                          gchar** t_input_with_placeholder,
                                                          GtkWidget*** t_widgets,
                                                          gint* t_widgets_length1);
VALA_EXTERN const gchar* tuba_widgets_label_with_widgets_get_placeholder (TubaWidgetsLabelWithWidgets* self);
VALA_EXTERN GeeHashMap* tuba_widgets_emoji_label_get_instance_emojis (TubaWidgetsEmojiLabel* self);
VALA_EXTERN gboolean tuba_widgets_emoji_label_get_smaller_emoji_pixel_size (TubaWidgetsEmojiLabel* self);
VALA_EXTERN gboolean tuba_widgets_emoji_label_get_large_emojis (TubaWidgetsEmojiLabel* self);
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_pixel_size (TubaWidgetsEmoji* self,
                                        gint value);
VALA_EXTERN void tuba_widgets_emoji_set_icon_size (TubaWidgetsEmoji* self,
                                       GtkIconSize value);
static void _vala_array_add140 (GtkWidget** * array,
                         gint* length,
                         gint* size,
                         GtkWidget* value);
static GtkWidget** _vala_array_dup48 (GtkWidget** self,
                               gssize length);
VALA_EXTERN void tuba_widgets_emoji_label_set_smaller_emoji_pixel_size (TubaWidgetsEmojiLabel* self,
                                                            gboolean value);
VALA_EXTERN void tuba_widgets_emoji_label_set_large_emojis (TubaWidgetsEmojiLabel* self,
                                                gboolean value);
VALA_EXTERN const gchar* tuba_widgets_emoji_label_get_content (TubaWidgetsEmojiLabel* self);
VALA_EXTERN void tuba_widgets_label_with_widgets_set_children (TubaWidgetsLabelWithWidgets* self,
                                                   GtkWidget** t_widgets,
                                                   gint t_widgets_length1);
VALA_EXTERN void tuba_widgets_label_with_widgets_set_text (TubaWidgetsLabelWithWidgets* self,
                                               const gchar* value);
static void tuba_widgets_emoji_label_finalize (GObject * obj);
static GType tuba_widgets_emoji_label_get_type_once (void);
static void _vala_tuba_widgets_emoji_label_get_property (GObject * object,
                                                  guint property_id,
                                                  GValue * value,
                                                  GParamSpec * pspec);
static void _vala_tuba_widgets_emoji_label_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 gssize _vala_array_length (gpointer array);

static inline gpointer
tuba_widgets_emoji_label_get_instance_private (TubaWidgetsEmojiLabel* self)
{
	return G_STRUCT_MEMBER_P (self, TubaWidgetsEmojiLabel_private_offset);
}

TubaWidgetsEmojiLabel*
tuba_widgets_emoji_label_construct (GType object_type,
                                    const gchar* text,
                                    GeeHashMap* emojis)
{
	TubaWidgetsEmojiLabel * self = NULL;
	self = (TubaWidgetsEmojiLabel*) g_object_new (object_type, NULL);
	if (text == NULL) {
		return self;
	}
	tuba_widgets_emoji_label_set_instance_emojis (self, emojis);
	tuba_widgets_emoji_label_set_content (self, text);
	return self;
}

TubaWidgetsEmojiLabel*
tuba_widgets_emoji_label_new (const gchar* text,
                              GeeHashMap* emojis)
{
	return tuba_widgets_emoji_label_construct (TUBA_WIDGETS_TYPE_EMOJI_LABEL, text, emojis);
}

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

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

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

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

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

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

static GtkWidget**
_vala_array_dup48 (GtkWidget** self,
                   gssize length)
{
	if (length >= 0) {
		GtkWidget** result;
		gssize i;
		result = g_new0 (GtkWidget*, length + 1);
		for (i = 0; i < length; i++) {
			GtkWidget* _tmp0_;
			_tmp0_ = _g_object_ref0 (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static void
tuba_widgets_emoji_label_generate_label_with_emojis (TubaWidgetsEmojiLabel* self,
                                                     const gchar* t_input,
                                                     gchar** t_input_with_placeholder,
                                                     GtkWidget*** t_widgets,
                                                     gint* t_widgets_length1)
{
	gchar* _vala_t_input_with_placeholder = NULL;
	GtkWidget** _vala_t_widgets = NULL;
	gint _vala_t_widgets_length1 = 0;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	GtkWidget** _tmp5_;
	gboolean _tmp6_ = FALSE;
	GtkWidget** t_t_widgets = NULL;
	GtkWidget** _tmp8_;
	gint t_t_widgets_length1;
	gint _t_t_widgets_size_;
	gchar** emoji_arr = NULL;
	GRegex* _tmp9_;
	gchar** _tmp10_;
	gchar** _tmp11_;
	gint emoji_arr_length1;
	gint _emoji_arr_size_;
	gchar** _tmp12_;
	gint _tmp12__length1;
	GtkWidget** _tmp42_;
	gint _tmp42__length1;
	GtkWidget** _tmp43_;
	gint _tmp43__length1;
	g_return_if_fail (self != NULL);
	g_return_if_fail (t_input != NULL);
	_tmp0_ = tuba_widgets_label_with_widgets_get_placeholder ((TubaWidgetsLabelWithWidgets*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = string_replace (t_input, _tmp1_, " ");
	_tmp3_ = _tmp2_;
	_tmp4_ = string_replace (_tmp3_, TUBA_WIDGETS_LABEL_WITH_WIDGETS_OBJECT_REPLACEMENT_CHARACTER, " ");
	_g_free0 (_vala_t_input_with_placeholder);
	_vala_t_input_with_placeholder = _tmp4_;
	_g_free0 (_tmp3_);
	_tmp5_ = g_new0 (GtkWidget*, 0 + 1);
	_vala_t_widgets = (_vala_array_free (_vala_t_widgets, _vala_t_widgets_length1, (GDestroyNotify) g_object_unref), NULL);
	_vala_t_widgets = _tmp5_;
	_vala_t_widgets_length1 = 0;
	if (!string_contains (t_input, ":")) {
		_tmp6_ = TRUE;
	} else {
		GeeHashMap* _tmp7_;
		_tmp7_ = self->priv->_instance_emojis;
		_tmp6_ = _tmp7_ == NULL;
	}
	if (_tmp6_) {
		if (t_input_with_placeholder) {
			*t_input_with_placeholder = _vala_t_input_with_placeholder;
		} else {
			_g_free0 (_vala_t_input_with_placeholder);
		}
		if (t_widgets) {
			*t_widgets = _vala_t_widgets;
		} else {
			_vala_t_widgets = (_vala_array_free (_vala_t_widgets, _vala_t_widgets_length1, (GDestroyNotify) g_object_unref), NULL);
		}
		if (t_widgets_length1) {
			*t_widgets_length1 = _vala_t_widgets_length1;
		}
		return;
	}
	_tmp8_ = g_new0 (GtkWidget*, 0 + 1);
	t_t_widgets = _tmp8_;
	t_t_widgets_length1 = 0;
	_t_t_widgets_size_ = t_t_widgets_length1;
	_tmp9_ = tuba_custom_emoji_regex;
	_tmp11_ = _tmp10_ = g_regex_split (_tmp9_, t_input, 0);
	emoji_arr = _tmp11_;
	emoji_arr_length1 = _vala_array_length (_tmp10_);
	_emoji_arr_size_ = emoji_arr_length1;
	_tmp12_ = emoji_arr;
	_tmp12__length1 = emoji_arr_length1;
	{
		gchar** str_collection = NULL;
		gint str_collection_length1 = 0;
		gint _str_collection_size_ = 0;
		gint str_it = 0;
		str_collection = _tmp12_;
		str_collection_length1 = _tmp12__length1;
		for (str_it = 0; str_it < str_collection_length1; str_it = str_it + 1) {
			const gchar* str = NULL;
			str = str_collection[str_it];
			{
				gchar* _tmp13_ = NULL;
				const gchar* _tmp14_;
				gint _tmp15_;
				gint _tmp16_;
				gchar* shortcode = NULL;
				gchar* _tmp19_;
				gboolean _tmp20_ = FALSE;
				const gchar* _tmp21_;
				_tmp14_ = str;
				_tmp15_ = strlen (_tmp14_);
				_tmp16_ = _tmp15_;
				if (_tmp16_ > 2) {
					const gchar* _tmp17_;
					gchar* _tmp18_;
					_tmp17_ = str;
					_tmp18_ = string_slice (_tmp17_, (glong) 1, (glong) -1);
					_g_free0 (_tmp13_);
					_tmp13_ = _tmp18_;
				} else {
					_g_free0 (_tmp13_);
					_tmp13_ = NULL;
				}
				_tmp19_ = _tmp13_;
				_tmp13_ = NULL;
				shortcode = _tmp19_;
				_tmp21_ = shortcode;
				if (_tmp21_ != NULL) {
					GeeHashMap* _tmp22_;
					const gchar* _tmp23_;
					_tmp22_ = self->priv->_instance_emojis;
					_tmp23_ = shortcode;
					_tmp20_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp22_, _tmp23_);
				} else {
					_tmp20_ = FALSE;
				}
				if (_tmp20_) {
					gint _tmp24_ = 0;
					gboolean _tmp25_;
					GtkIconSize _tmp26_ = 0;
					gboolean _tmp27_;
					GeeHashMap* _tmp28_;
					const gchar* _tmp29_;
					gpointer _tmp30_;
					gchar* _tmp31_;
					const gchar* _tmp32_;
					TubaWidgetsEmoji* _tmp33_ = NULL;
					const gchar* _tmp34_;
					const gchar* _tmp35_;
					const gchar* _tmp36_;
					gchar* _tmp37_;
					gchar* _tmp38_;
					const gchar* _tmp39_;
					const gchar* _tmp40_;
					gchar* _tmp41_;
					_tmp25_ = self->priv->_smaller_emoji_pixel_size;
					if (_tmp25_) {
						_tmp24_ = 14;
					} else {
						_tmp24_ = -1;
					}
					_tmp27_ = self->priv->_large_emojis;
					if (_tmp27_) {
						_tmp26_ = GTK_ICON_SIZE_LARGE;
					} else {
						_tmp26_ = GTK_ICON_SIZE_INHERIT;
					}
					_tmp28_ = self->priv->_instance_emojis;
					_tmp29_ = shortcode;
					_tmp30_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp28_, _tmp29_);
					_tmp31_ = (gchar*) _tmp30_;
					_tmp32_ = shortcode;
					_tmp33_ = tuba_widgets_emoji_new (_tmp31_, _tmp32_);
					tuba_widgets_emoji_set_pixel_size (_tmp33_, _tmp24_);
					tuba_widgets_emoji_set_icon_size (_tmp33_, _tmp26_);
					g_object_ref_sink (_tmp33_);
					_vala_array_add140 (&t_t_widgets, &t_t_widgets_length1, &_t_t_widgets_size_, (GtkWidget*) _tmp33_);
					_g_free0 (_tmp31_);
					_tmp34_ = _vala_t_input_with_placeholder;
					_tmp35_ = shortcode;
					_tmp36_ = string_to_string (_tmp35_);
					_tmp37_ = g_strconcat (":", _tmp36_, ":", NULL);
					_tmp38_ = _tmp37_;
					_tmp39_ = tuba_widgets_label_with_widgets_get_placeholder ((TubaWidgetsLabelWithWidgets*) self);
					_tmp40_ = _tmp39_;
					_tmp41_ = string_replace (_tmp34_, _tmp38_, _tmp40_);
					_g_free0 (_vala_t_input_with_placeholder);
					_vala_t_input_with_placeholder = _tmp41_;
					_g_free0 (_tmp38_);
				}
				_g_free0 (shortcode);
				_g_free0 (_tmp13_);
			}
		}
	}
	_tmp42_ = t_t_widgets;
	_tmp42__length1 = t_t_widgets_length1;
	_tmp43_ = (_tmp42_ != NULL) ? _vala_array_dup48 (_tmp42_, _tmp42__length1) : _tmp42_;
	_tmp43__length1 = _tmp42__length1;
	_vala_t_widgets = (_vala_array_free (_vala_t_widgets, _vala_t_widgets_length1, (GDestroyNotify) g_object_unref), NULL);
	_vala_t_widgets = _tmp43_;
	_vala_t_widgets_length1 = _tmp43__length1;
	emoji_arr = (_vala_array_free (emoji_arr, emoji_arr_length1, (GDestroyNotify) g_free), NULL);
	t_t_widgets = (_vala_array_free (t_t_widgets, t_t_widgets_length1, (GDestroyNotify) g_object_unref), NULL);
	if (t_input_with_placeholder) {
		*t_input_with_placeholder = _vala_t_input_with_placeholder;
	} else {
		_g_free0 (_vala_t_input_with_placeholder);
	}
	if (t_widgets) {
		*t_widgets = _vala_t_widgets;
	} else {
		_vala_t_widgets = (_vala_array_free (_vala_t_widgets, _vala_t_widgets_length1, (GDestroyNotify) g_object_unref), NULL);
	}
	if (t_widgets_length1) {
		*t_widgets_length1 = _vala_t_widgets_length1;
	}
}

GeeHashMap*
tuba_widgets_emoji_label_get_instance_emojis (TubaWidgetsEmojiLabel* self)
{
	GeeHashMap* result;
	GeeHashMap* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_instance_emojis;
	result = _tmp0_;
	return result;
}

void
tuba_widgets_emoji_label_set_instance_emojis (TubaWidgetsEmojiLabel* self,
                                              GeeHashMap* value)
{
	GeeHashMap* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_widgets_emoji_label_get_instance_emojis (self);
	if (old_value != value) {
		GeeHashMap* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_instance_emojis);
		self->priv->_instance_emojis = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_widgets_emoji_label_properties[TUBA_WIDGETS_EMOJI_LABEL_INSTANCE_EMOJIS_PROPERTY]);
	}
}

gboolean
tuba_widgets_emoji_label_get_smaller_emoji_pixel_size (TubaWidgetsEmojiLabel* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_smaller_emoji_pixel_size;
	return result;
}

void
tuba_widgets_emoji_label_set_smaller_emoji_pixel_size (TubaWidgetsEmojiLabel* self,
                                                       gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_widgets_emoji_label_get_smaller_emoji_pixel_size (self);
	if (old_value != value) {
		self->priv->_smaller_emoji_pixel_size = value;
		g_object_notify_by_pspec ((GObject *) self, tuba_widgets_emoji_label_properties[TUBA_WIDGETS_EMOJI_LABEL_SMALLER_EMOJI_PIXEL_SIZE_PROPERTY]);
	}
}

gboolean
tuba_widgets_emoji_label_get_large_emojis (TubaWidgetsEmojiLabel* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_large_emojis;
	return result;
}

void
tuba_widgets_emoji_label_set_large_emojis (TubaWidgetsEmojiLabel* self,
                                           gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_widgets_emoji_label_get_large_emojis (self);
	if (old_value != value) {
		self->priv->_large_emojis = value;
		g_object_notify_by_pspec ((GObject *) self, tuba_widgets_emoji_label_properties[TUBA_WIDGETS_EMOJI_LABEL_LARGE_EMOJIS_PROPERTY]);
	}
}

const gchar*
tuba_widgets_emoji_label_get_content (TubaWidgetsEmojiLabel* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_content;
	result = _tmp0_;
	return result;
}

void
tuba_widgets_emoji_label_set_content (TubaWidgetsEmojiLabel* self,
                                      const gchar* value)
{
	gchar* _tmp0_;
	gchar* t_value = NULL;
	GtkWidget** t_widgets = NULL;
	gint t_widgets_length1 = 0;
	gint _t_widgets_size_ = 0;
	gchar* _tmp1_ = NULL;
	GtkWidget** _tmp2_ = NULL;
	gint _tmp3_ = 0;
	g_return_if_fail (self != NULL);
	if (value == NULL) {
		value = "";
	}
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_content);
	self->priv->_content = _tmp0_;
	tuba_widgets_emoji_label_generate_label_with_emojis (self, value, &_tmp1_, &_tmp2_, &_tmp3_);
	_g_free0 (t_value);
	t_value = _tmp1_;
	t_widgets = (_vala_array_free (t_widgets, t_widgets_length1, (GDestroyNotify) g_object_unref), NULL);
	t_widgets = _tmp2_;
	t_widgets_length1 = _tmp3_;
	_t_widgets_size_ = t_widgets_length1;
	tuba_widgets_label_with_widgets_set_children ((TubaWidgetsLabelWithWidgets*) self, t_widgets, (gint) t_widgets_length1);
	tuba_widgets_label_with_widgets_set_text ((TubaWidgetsLabelWithWidgets*) self, t_value);
	t_widgets = (_vala_array_free (t_widgets, t_widgets_length1, (GDestroyNotify) g_object_unref), NULL);
	_g_free0 (t_value);
	g_object_notify_by_pspec ((GObject *) self, tuba_widgets_emoji_label_properties[TUBA_WIDGETS_EMOJI_LABEL_CONTENT_PROPERTY]);
}

static void
tuba_widgets_emoji_label_class_init (TubaWidgetsEmojiLabelClass * klass,
                                     gpointer klass_data)
{
	tuba_widgets_emoji_label_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaWidgetsEmojiLabel_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_widgets_emoji_label_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_widgets_emoji_label_set_property;
	G_OBJECT_CLASS (klass)->finalize = tuba_widgets_emoji_label_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_EMOJI_LABEL_INSTANCE_EMOJIS_PROPERTY, tuba_widgets_emoji_label_properties[TUBA_WIDGETS_EMOJI_LABEL_INSTANCE_EMOJIS_PROPERTY] = g_param_spec_object ("instance-emojis", "instance-emojis", "instance-emojis", GEE_TYPE_HASH_MAP, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_EMOJI_LABEL_SMALLER_EMOJI_PIXEL_SIZE_PROPERTY, tuba_widgets_emoji_label_properties[TUBA_WIDGETS_EMOJI_LABEL_SMALLER_EMOJI_PIXEL_SIZE_PROPERTY] = g_param_spec_boolean ("smaller-emoji-pixel-size", "smaller-emoji-pixel-size", "smaller-emoji-pixel-size", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_EMOJI_LABEL_LARGE_EMOJIS_PROPERTY, tuba_widgets_emoji_label_properties[TUBA_WIDGETS_EMOJI_LABEL_LARGE_EMOJIS_PROPERTY] = g_param_spec_boolean ("large-emojis", "large-emojis", "large-emojis", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_EMOJI_LABEL_CONTENT_PROPERTY, tuba_widgets_emoji_label_properties[TUBA_WIDGETS_EMOJI_LABEL_CONTENT_PROPERTY] = g_param_spec_string ("content", "content", "content", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	gtk_widget_class_set_accessible_role (GTK_WIDGET_CLASS (klass), GTK_ACCESSIBLE_ROLE_LABEL);
}

static void
tuba_widgets_emoji_label_instance_init (TubaWidgetsEmojiLabel * self,
                                        gpointer klass)
{
	gchar* _tmp0_;
	self->priv = tuba_widgets_emoji_label_get_instance_private (self);
	self->priv->_instance_emojis = NULL;
	self->priv->_smaller_emoji_pixel_size = FALSE;
	self->priv->_large_emojis = FALSE;
	_tmp0_ = g_strdup ("");
	self->priv->_content = _tmp0_;
}

static void
tuba_widgets_emoji_label_finalize (GObject * obj)
{
	TubaWidgetsEmojiLabel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_WIDGETS_TYPE_EMOJI_LABEL, TubaWidgetsEmojiLabel);
	_g_object_unref0 (self->priv->_instance_emojis);
	_g_free0 (self->priv->_content);
	G_OBJECT_CLASS (tuba_widgets_emoji_label_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_widgets_emoji_label_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaWidgetsEmojiLabelClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_widgets_emoji_label_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaWidgetsEmojiLabel), 0, (GInstanceInitFunc) tuba_widgets_emoji_label_instance_init, NULL };
	GType tuba_widgets_emoji_label_type_id;
	tuba_widgets_emoji_label_type_id = g_type_register_static (TUBA_WIDGETS_TYPE_LABEL_WITH_WIDGETS, "TubaWidgetsEmojiLabel", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaWidgetsEmojiLabel_private_offset = g_type_add_instance_private (tuba_widgets_emoji_label_type_id, sizeof (TubaWidgetsEmojiLabelPrivate));
	return tuba_widgets_emoji_label_type_id;
}

GType
tuba_widgets_emoji_label_get_type (void)
{
	static GType tuba_widgets_emoji_label_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_widgets_emoji_label_type_id__once)) {
		GType tuba_widgets_emoji_label_type_id;
		tuba_widgets_emoji_label_type_id = tuba_widgets_emoji_label_get_type_once ();
		g_once_init_leave_pointer (&tuba_widgets_emoji_label_type_id__once, tuba_widgets_emoji_label_type_id);
	}
	return tuba_widgets_emoji_label_type_id__once;
}

static void
_vala_tuba_widgets_emoji_label_get_property (GObject * object,
                                             guint property_id,
                                             GValue * value,
                                             GParamSpec * pspec)
{
	TubaWidgetsEmojiLabel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_WIDGETS_TYPE_EMOJI_LABEL, TubaWidgetsEmojiLabel);
	switch (property_id) {
		case TUBA_WIDGETS_EMOJI_LABEL_INSTANCE_EMOJIS_PROPERTY:
		g_value_set_object (value, tuba_widgets_emoji_label_get_instance_emojis (self));
		break;
		case TUBA_WIDGETS_EMOJI_LABEL_SMALLER_EMOJI_PIXEL_SIZE_PROPERTY:
		g_value_set_boolean (value, tuba_widgets_emoji_label_get_smaller_emoji_pixel_size (self));
		break;
		case TUBA_WIDGETS_EMOJI_LABEL_LARGE_EMOJIS_PROPERTY:
		g_value_set_boolean (value, tuba_widgets_emoji_label_get_large_emojis (self));
		break;
		case TUBA_WIDGETS_EMOJI_LABEL_CONTENT_PROPERTY:
		g_value_set_string (value, tuba_widgets_emoji_label_get_content (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_widgets_emoji_label_set_property (GObject * object,
                                             guint property_id,
                                             const GValue * value,
                                             GParamSpec * pspec)
{
	TubaWidgetsEmojiLabel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_WIDGETS_TYPE_EMOJI_LABEL, TubaWidgetsEmojiLabel);
	switch (property_id) {
		case TUBA_WIDGETS_EMOJI_LABEL_INSTANCE_EMOJIS_PROPERTY:
		tuba_widgets_emoji_label_set_instance_emojis (self, g_value_get_object (value));
		break;
		case TUBA_WIDGETS_EMOJI_LABEL_SMALLER_EMOJI_PIXEL_SIZE_PROPERTY:
		tuba_widgets_emoji_label_set_smaller_emoji_pixel_size (self, g_value_get_boolean (value));
		break;
		case TUBA_WIDGETS_EMOJI_LABEL_LARGE_EMOJIS_PROPERTY:
		tuba_widgets_emoji_label_set_large_emojis (self, g_value_get_boolean (value));
		break;
		case TUBA_WIDGETS_EMOJI_LABEL_CONTENT_PROPERTY:
		tuba_widgets_emoji_label_set_content (self, g_value_get_string (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);
}

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

