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

#include <adwaita.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include <pango/pango.h>

#define TUBA_WIDGETS_HASHTAG_BAR_MAX_VISIBLE_TAGS 3
#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_HASHTAG_BAR (tuba_widgets_hashtag_bar_get_type ())
#define TUBA_WIDGETS_HASHTAG_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_HASHTAG_BAR, TubaWidgetsHashtagBar))
#define TUBA_WIDGETS_HASHTAG_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_HASHTAG_BAR, TubaWidgetsHashtagBarClass))
#define TUBA_WIDGETS_IS_HASHTAG_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_HASHTAG_BAR))
#define TUBA_WIDGETS_IS_HASHTAG_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_HASHTAG_BAR))
#define TUBA_WIDGETS_HASHTAG_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_HASHTAG_BAR, TubaWidgetsHashtagBarClass))

typedef struct _TubaWidgetsHashtagBar TubaWidgetsHashtagBar;
typedef struct _TubaWidgetsHashtagBarClass TubaWidgetsHashtagBarClass;
typedef struct _TubaWidgetsHashtagBarPrivate TubaWidgetsHashtagBarPrivate;
enum  {
	TUBA_WIDGETS_HASHTAG_BAR_0_PROPERTY,
	TUBA_WIDGETS_HASHTAG_BAR_NUM_PROPERTIES
};
static GParamSpec* tuba_widgets_hashtag_bar_properties[TUBA_WIDGETS_HASHTAG_BAR_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define TUBA_UTILS_TAG_EXTRACTOR_TYPE_TAG (tuba_utils_tag_extractor_tag_get_type ())
typedef struct _TubaUtilsTagExtractorTag TubaUtilsTagExtractorTag;

#define TUBA_WIDGETS_HASHTAG_BAR_TYPE_HASHTAG_BUTTON (tuba_widgets_hashtag_bar_hashtag_button_get_type ())
#define TUBA_WIDGETS_HASHTAG_BAR_HASHTAG_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_HASHTAG_BAR_TYPE_HASHTAG_BUTTON, TubaWidgetsHashtagBarHashtagButton))
#define TUBA_WIDGETS_HASHTAG_BAR_HASHTAG_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_HASHTAG_BAR_TYPE_HASHTAG_BUTTON, TubaWidgetsHashtagBarHashtagButtonClass))
#define TUBA_WIDGETS_HASHTAG_BAR_IS_HASHTAG_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_HASHTAG_BAR_TYPE_HASHTAG_BUTTON))
#define TUBA_WIDGETS_HASHTAG_BAR_IS_HASHTAG_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_HASHTAG_BAR_TYPE_HASHTAG_BUTTON))
#define TUBA_WIDGETS_HASHTAG_BAR_HASHTAG_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_HASHTAG_BAR_TYPE_HASHTAG_BUTTON, TubaWidgetsHashtagBarHashtagButtonClass))

typedef struct _TubaWidgetsHashtagBarHashtagButton TubaWidgetsHashtagBarHashtagButton;
typedef struct _TubaWidgetsHashtagBarHashtagButtonClass TubaWidgetsHashtagBarHashtagButtonClass;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _TubaWidgetsHashtagBarHashtagButtonPrivate TubaWidgetsHashtagBarHashtagButtonPrivate;
enum  {
	TUBA_WIDGETS_HASHTAG_BAR_HASHTAG_BUTTON_0_PROPERTY,
	TUBA_WIDGETS_HASHTAG_BAR_HASHTAG_BUTTON_NUM_PROPERTIES
};
static GParamSpec* tuba_widgets_hashtag_bar_hashtag_button_properties[TUBA_WIDGETS_HASHTAG_BAR_HASHTAG_BUTTON_NUM_PROPERTIES];

#define TUBA_TYPE_APPLICATION (tuba_application_get_type ())
#define TUBA_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_APPLICATION, TubaApplication))
#define TUBA_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_APPLICATION, TubaApplicationClass))
#define TUBA_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_APPLICATION))
#define TUBA_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_APPLICATION))
#define TUBA_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_APPLICATION, TubaApplicationClass))

typedef struct _TubaApplication TubaApplication;
typedef struct _TubaApplicationClass TubaApplicationClass;

#define TUBA_DIALOGS_TYPE_MAIN_WINDOW (tuba_dialogs_main_window_get_type ())
#define TUBA_DIALOGS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_DIALOGS_TYPE_MAIN_WINDOW, TubaDialogsMainWindow))
#define TUBA_DIALOGS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_DIALOGS_TYPE_MAIN_WINDOW, TubaDialogsMainWindowClass))
#define TUBA_DIALOGS_IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_DIALOGS_TYPE_MAIN_WINDOW))
#define TUBA_DIALOGS_IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_DIALOGS_TYPE_MAIN_WINDOW))
#define TUBA_DIALOGS_MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_DIALOGS_TYPE_MAIN_WINDOW, TubaDialogsMainWindowClass))

typedef struct _TubaDialogsMainWindow TubaDialogsMainWindow;
typedef struct _TubaDialogsMainWindowClass TubaDialogsMainWindowClass;

#define TUBA_VIEWS_TYPE_BASE (tuba_views_base_get_type ())
#define TUBA_VIEWS_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_VIEWS_TYPE_BASE, TubaViewsBase))
#define TUBA_VIEWS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_VIEWS_TYPE_BASE, TubaViewsBaseClass))
#define TUBA_VIEWS_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_VIEWS_TYPE_BASE))
#define TUBA_VIEWS_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_VIEWS_TYPE_BASE))
#define TUBA_VIEWS_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_VIEWS_TYPE_BASE, TubaViewsBaseClass))

typedef struct _TubaViewsBase TubaViewsBase;
typedef struct _TubaViewsBaseClass TubaViewsBaseClass;

#define TUBA_VIEWS_TYPE_CONTENT_BASE (tuba_views_content_base_get_type ())
#define TUBA_VIEWS_CONTENT_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_VIEWS_TYPE_CONTENT_BASE, TubaViewsContentBase))
#define TUBA_VIEWS_CONTENT_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_VIEWS_TYPE_CONTENT_BASE, TubaViewsContentBaseClass))
#define TUBA_VIEWS_IS_CONTENT_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_VIEWS_TYPE_CONTENT_BASE))
#define TUBA_VIEWS_IS_CONTENT_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_VIEWS_TYPE_CONTENT_BASE))
#define TUBA_VIEWS_CONTENT_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_VIEWS_TYPE_CONTENT_BASE, TubaViewsContentBaseClass))

typedef struct _TubaViewsContentBase TubaViewsContentBase;
typedef struct _TubaViewsContentBaseClass TubaViewsContentBaseClass;

#define TUBA_VIEWS_TYPE_TIMELINE (tuba_views_timeline_get_type ())
#define TUBA_VIEWS_TIMELINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_VIEWS_TYPE_TIMELINE, TubaViewsTimeline))
#define TUBA_VIEWS_TIMELINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_VIEWS_TYPE_TIMELINE, TubaViewsTimelineClass))
#define TUBA_VIEWS_IS_TIMELINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_VIEWS_TYPE_TIMELINE))
#define TUBA_VIEWS_IS_TIMELINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_VIEWS_TYPE_TIMELINE))
#define TUBA_VIEWS_TIMELINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_VIEWS_TYPE_TIMELINE, TubaViewsTimelineClass))

typedef struct _TubaViewsTimeline TubaViewsTimeline;
typedef struct _TubaViewsTimelineClass TubaViewsTimelineClass;

#define TUBA_VIEWS_TYPE_HASHTAG (tuba_views_hashtag_get_type ())
#define TUBA_VIEWS_HASHTAG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_VIEWS_TYPE_HASHTAG, TubaViewsHashtag))
#define TUBA_VIEWS_HASHTAG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_VIEWS_TYPE_HASHTAG, TubaViewsHashtagClass))
#define TUBA_VIEWS_IS_HASHTAG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_VIEWS_TYPE_HASHTAG))
#define TUBA_VIEWS_IS_HASHTAG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_VIEWS_TYPE_HASHTAG))
#define TUBA_VIEWS_HASHTAG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_VIEWS_TYPE_HASHTAG, TubaViewsHashtagClass))

typedef struct _TubaViewsHashtag TubaViewsHashtag;
typedef struct _TubaViewsHashtagClass TubaViewsHashtagClass;

struct _TubaWidgetsHashtagBar {
	AdwBin parent_instance;
	TubaWidgetsHashtagBarPrivate * priv;
};

struct _TubaWidgetsHashtagBarClass {
	AdwBinClass parent_class;
};

struct _TubaWidgetsHashtagBarPrivate {
	AdwWrapBox* wrapbox;
	GtkButton* show_more;
};

struct _TubaUtilsTagExtractorTag {
	gchar* tag;
	gchar* link;
};

struct _TubaWidgetsHashtagBarHashtagButton {
	GtkButton parent_instance;
	TubaWidgetsHashtagBarHashtagButtonPrivate * priv;
};

struct _TubaWidgetsHashtagBarHashtagButtonClass {
	GtkButtonClass parent_class;
};

struct _TubaWidgetsHashtagBarHashtagButtonPrivate {
	gchar* tag;
};

static gint TubaWidgetsHashtagBar_private_offset;
static gpointer tuba_widgets_hashtag_bar_parent_class = NULL;
static gint TubaWidgetsHashtagBarHashtagButton_private_offset;
static gpointer tuba_widgets_hashtag_bar_hashtag_button_parent_class = NULL;
VALA_EXTERN TubaApplication* tuba_app;

VALA_EXTERN GType tuba_widgets_hashtag_bar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsHashtagBar, g_object_unref)
VALA_EXTERN GType tuba_utils_tag_extractor_tag_get_type (void) G_GNUC_CONST ;
VALA_EXTERN TubaUtilsTagExtractorTag* tuba_utils_tag_extractor_tag_dup (const TubaUtilsTagExtractorTag* self);
VALA_EXTERN void tuba_utils_tag_extractor_tag_free (TubaUtilsTagExtractorTag* self);
VALA_EXTERN void tuba_utils_tag_extractor_tag_copy (const TubaUtilsTagExtractorTag* self,
                                        TubaUtilsTagExtractorTag* dest);
VALA_EXTERN void tuba_utils_tag_extractor_tag_destroy (TubaUtilsTagExtractorTag* self);
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (TubaUtilsTagExtractorTag, tuba_utils_tag_extractor_tag_destroy)
VALA_EXTERN TubaWidgetsHashtagBar* tuba_widgets_hashtag_bar_new (TubaUtilsTagExtractorTag* tags,
                                                     gint tags_length1);
VALA_EXTERN TubaWidgetsHashtagBar* tuba_widgets_hashtag_bar_construct (GType object_type,
                                                           TubaUtilsTagExtractorTag* tags,
                                                           gint tags_length1);
VALA_EXTERN GType tuba_widgets_hashtag_bar_hashtag_button_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsHashtagBarHashtagButton, g_object_unref)
VALA_EXTERN TubaWidgetsHashtagBarHashtagButton* tuba_widgets_hashtag_bar_hashtag_button_new (TubaUtilsTagExtractorTag* hashtag);
VALA_EXTERN TubaWidgetsHashtagBarHashtagButton* tuba_widgets_hashtag_bar_hashtag_button_construct (GType object_type,
                                                                                       TubaUtilsTagExtractorTag* hashtag);
static void tuba_widgets_hashtag_bar_on_clicked (TubaWidgetsHashtagBar* self);
static void _tuba_widgets_hashtag_bar_on_clicked_gtk_button_clicked (GtkButton* _sender,
                                                              gpointer self);
VALA_EXTERN void tuba_widgets_hashtag_bar_to_display_only (TubaWidgetsHashtagBar* self);
static void tuba_widgets_hashtag_bar_hashtag_button_on_clicked (TubaWidgetsHashtagBarHashtagButton* self);
VALA_EXTERN GType tuba_application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaApplication, g_object_unref)
VALA_EXTERN GType tuba_dialogs_main_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaDialogsMainWindow, g_object_unref)
VALA_EXTERN TubaDialogsMainWindow* tuba_application_get_main_window (TubaApplication* self);
VALA_EXTERN GType tuba_views_base_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaViewsBase, g_object_unref)
VALA_EXTERN TubaViewsBase* tuba_dialogs_main_window_open_view (TubaDialogsMainWindow* self,
                                                   TubaViewsBase* view);
VALA_EXTERN TubaViewsHashtag* tuba_views_hashtag_new (const gchar* tag,
                                          gboolean* following,
                                          const gchar* url_basename,
                                          gboolean* featured);
VALA_EXTERN TubaViewsHashtag* tuba_views_hashtag_construct (GType object_type,
                                                const gchar* tag,
                                                gboolean* following,
                                                const gchar* url_basename,
                                                gboolean* featured);
VALA_EXTERN GType tuba_views_content_base_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaViewsContentBase, g_object_unref)
VALA_EXTERN GType tuba_views_timeline_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaViewsTimeline, g_object_unref)
VALA_EXTERN GType tuba_views_hashtag_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaViewsHashtag, g_object_unref)
static GObject * tuba_widgets_hashtag_bar_hashtag_button_constructor (GType type,
                                                               guint n_construct_properties,
                                                               GObjectConstructParam * construct_properties);
static void _tuba_widgets_hashtag_bar_hashtag_button_on_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                             gpointer self);
static void tuba_widgets_hashtag_bar_hashtag_button_finalize (GObject * obj);
static GType tuba_widgets_hashtag_bar_hashtag_button_get_type_once (void);
static GObject * tuba_widgets_hashtag_bar_constructor (GType type,
                                                guint n_construct_properties,
                                                GObjectConstructParam * construct_properties);
static void tuba_widgets_hashtag_bar_finalize (GObject * obj);
static GType tuba_widgets_hashtag_bar_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 inline gpointer
tuba_widgets_hashtag_bar_get_instance_private (TubaWidgetsHashtagBar* self)
{
	return G_STRUCT_MEMBER_P (self, TubaWidgetsHashtagBar_private_offset);
}

static void
_tuba_widgets_hashtag_bar_on_clicked_gtk_button_clicked (GtkButton* _sender,
                                                         gpointer self)
{
	tuba_widgets_hashtag_bar_on_clicked ((TubaWidgetsHashtagBar*) self);
}

TubaWidgetsHashtagBar*
tuba_widgets_hashtag_bar_construct (GType object_type,
                                    TubaUtilsTagExtractorTag* tags,
                                    gint tags_length1)
{
	TubaWidgetsHashtagBar * self = NULL;
	gboolean should_show_all = FALSE;
	self = (TubaWidgetsHashtagBar*) g_object_new (object_type, NULL);
	should_show_all = tags_length1 <= (TUBA_WIDGETS_HASHTAG_BAR_MAX_VISIBLE_TAGS + 1);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				gboolean _tmp2_ = FALSE;
				AdwWrapBox* _tmp3_;
				TubaUtilsTagExtractorTag _tmp4_;
				TubaWidgetsHashtagBarHashtagButton* _tmp5_ = NULL;
				TubaWidgetsHashtagBarHashtagButton* _tmp6_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				if (!(i < tags_length1)) {
					break;
				}
				if (should_show_all) {
					_tmp2_ = TRUE;
				} else {
					_tmp2_ = i < TUBA_WIDGETS_HASHTAG_BAR_MAX_VISIBLE_TAGS;
				}
				_tmp3_ = self->priv->wrapbox;
				_tmp4_ = tags[i];
				_tmp5_ = tuba_widgets_hashtag_bar_hashtag_button_new (&_tmp4_);
				gtk_widget_set_visible ((GtkWidget*) _tmp5_, _tmp2_);
				g_object_ref_sink (_tmp5_);
				_tmp6_ = _tmp5_;
				adw_wrap_box_append (_tmp3_, (GtkWidget*) _tmp6_);
				_g_object_unref0 (_tmp6_);
			}
		}
	}
	if (!should_show_all) {
		gchar* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		gchar* _tmp11_;
		gchar* _tmp12_;
		gchar** _tmp13_;
		GtkButton* _tmp14_ = NULL;
		GtkButton* _tmp15_;
		AdwWrapBox* _tmp16_;
		GtkButton* _tmp17_;
		_tmp7_ = g_strdup_printf (_ ("Show %d More"), tags_length1 - TUBA_WIDGETS_HASHTAG_BAR_MAX_VISIBLE_TAGS);
		_tmp8_ = _tmp7_;
		_tmp9_ = g_strdup ("flat");
		_tmp10_ = g_strdup ("tuba-circular");
		_tmp11_ = g_strdup ("hashtag-bar-hashtag");
		_tmp12_ = g_strdup ("font-small");
		_tmp13_ = g_new0 (gchar*, 4 + 1);
		_tmp13_[0] = _tmp9_;
		_tmp13_[1] = _tmp10_;
		_tmp13_[2] = _tmp11_;
		_tmp13_[3] = _tmp12_;
		_tmp14_ = (GtkButton*) gtk_button_new_with_label (_tmp8_);
		gtk_widget_set_css_classes ((GtkWidget*) _tmp14_, _tmp13_);
		_tmp13_ = (_vala_array_free (_tmp13_, 4, (GDestroyNotify) g_free), NULL);
		g_object_ref_sink (_tmp14_);
		_g_object_unref0 (self->priv->show_more);
		self->priv->show_more = _tmp14_;
		_g_free0 (_tmp8_);
		_tmp15_ = self->priv->show_more;
		g_signal_connect_object (_tmp15_, "clicked", (GCallback) _tuba_widgets_hashtag_bar_on_clicked_gtk_button_clicked, self, 0);
		_tmp16_ = self->priv->wrapbox;
		_tmp17_ = self->priv->show_more;
		adw_wrap_box_append (_tmp16_, (GtkWidget*) _tmp17_);
	}
	return self;
}

TubaWidgetsHashtagBar*
tuba_widgets_hashtag_bar_new (TubaUtilsTagExtractorTag* tags,
                              gint tags_length1)
{
	return tuba_widgets_hashtag_bar_construct (TUBA_WIDGETS_TYPE_HASHTAG_BAR, tags, tags_length1);
}

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

static void
tuba_widgets_hashtag_bar_on_clicked (TubaWidgetsHashtagBar* self)
{
	AdwWrapBox* _tmp0_;
	GtkButton* _tmp1_;
	GtkWidget* w = NULL;
	AdwWrapBox* _tmp2_;
	GtkWidget* _tmp3_;
	GtkWidget* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->wrapbox;
	_tmp1_ = self->priv->show_more;
	adw_wrap_box_remove (_tmp0_, (GtkWidget*) _tmp1_);
	_tmp2_ = self->priv->wrapbox;
	_tmp3_ = gtk_widget_get_first_child ((GtkWidget*) _tmp2_);
	_tmp4_ = _g_object_ref0 (_tmp3_);
	w = _tmp4_;
	while (TRUE) {
		GtkWidget* _tmp5_;
		GtkWidget* _tmp6_;
		gboolean _tmp7_;
		gboolean _tmp8_;
		GtkWidget* _tmp10_;
		GtkWidget* _tmp11_;
		GtkWidget* _tmp12_;
		_tmp5_ = w;
		if (!(_tmp5_ != NULL)) {
			break;
		}
		_tmp6_ = w;
		_tmp7_ = gtk_widget_get_visible (_tmp6_);
		_tmp8_ = _tmp7_;
		if (!_tmp8_) {
			GtkWidget* _tmp9_;
			_tmp9_ = w;
			gtk_widget_set_visible (_tmp9_, TRUE);
		}
		_tmp10_ = w;
		_tmp11_ = gtk_widget_get_next_sibling (_tmp10_);
		_tmp12_ = _g_object_ref0 (_tmp11_);
		_g_object_unref0 (w);
		w = _tmp12_;
	}
	_g_object_unref0 (w);
}

void
tuba_widgets_hashtag_bar_to_display_only (TubaWidgetsHashtagBar* self)
{
	GtkWidget* w = NULL;
	AdwWrapBox* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->wrapbox;
	_tmp1_ = gtk_widget_get_first_child ((GtkWidget*) _tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	w = _tmp2_;
	while (TRUE) {
		GtkWidget* _tmp3_;
		GtkWidget* _tmp4_;
		GtkWidget* _tmp8_;
		GtkWidget* _tmp9_;
		GtkWidget* _tmp10_;
		_tmp3_ = w;
		if (!(_tmp3_ != NULL)) {
			break;
		}
		_tmp4_ = w;
		if (TUBA_WIDGETS_HASHTAG_BAR_IS_HASHTAG_BUTTON (_tmp4_)) {
			GtkWidget* _tmp5_;
			GtkWidget* _tmp6_;
			GtkWidget* _tmp7_;
			_tmp5_ = w;
			_tmp6_ = w;
			_tmp7_ = w;
			gtk_widget_set_focusable (_tmp7_, FALSE);
			gtk_widget_set_can_focus (_tmp6_, FALSE);
			gtk_widget_set_can_target (_tmp5_, FALSE);
		}
		_tmp8_ = w;
		_tmp9_ = gtk_widget_get_next_sibling (_tmp8_);
		_tmp10_ = _g_object_ref0 (_tmp9_);
		_g_object_unref0 (w);
		w = _tmp10_;
	}
	_g_object_unref0 (w);
}

static inline gpointer
tuba_widgets_hashtag_bar_hashtag_button_get_instance_private (TubaWidgetsHashtagBarHashtagButton* self)
{
	return G_STRUCT_MEMBER_P (self, TubaWidgetsHashtagBarHashtagButton_private_offset);
}

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

TubaWidgetsHashtagBarHashtagButton*
tuba_widgets_hashtag_bar_hashtag_button_construct (GType object_type,
                                                   TubaUtilsTagExtractorTag* hashtag)
{
	TubaWidgetsHashtagBarHashtagButton * self = NULL;
	TubaUtilsTagExtractorTag _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	GtkLabel* _tmp7_ = NULL;
	GtkLabel* _tmp8_;
	g_return_val_if_fail (hashtag != NULL, NULL);
	self = (TubaWidgetsHashtagBarHashtagButton*) g_object_new (object_type, NULL);
	_tmp0_ = *hashtag;
	_tmp1_ = _tmp0_.tag;
	_tmp2_ = g_strdup (_tmp1_);
	_g_free0 (self->priv->tag);
	self->priv->tag = _tmp2_;
	_tmp3_ = self->priv->tag;
	_tmp4_ = string_to_string (_tmp3_);
	_tmp5_ = g_strconcat ("#", _tmp4_, NULL);
	_tmp6_ = _tmp5_;
	_tmp7_ = (GtkLabel*) gtk_label_new (_tmp6_);
	gtk_label_set_ellipsize (_tmp7_, PANGO_ELLIPSIZE_END);
	g_object_ref_sink (_tmp7_);
	_tmp8_ = _tmp7_;
	gtk_button_set_child ((GtkButton*) self, (GtkWidget*) _tmp8_);
	_g_object_unref0 (_tmp8_);
	_g_free0 (_tmp6_);
	return self;
}

TubaWidgetsHashtagBarHashtagButton*
tuba_widgets_hashtag_bar_hashtag_button_new (TubaUtilsTagExtractorTag* hashtag)
{
	return tuba_widgets_hashtag_bar_hashtag_button_construct (TUBA_WIDGETS_HASHTAG_BAR_TYPE_HASHTAG_BUTTON, hashtag);
}

static void
tuba_widgets_hashtag_bar_hashtag_button_on_clicked (TubaWidgetsHashtagBarHashtagButton* self)
{
	TubaApplication* _tmp0_;
	TubaDialogsMainWindow* _tmp1_;
	TubaDialogsMainWindow* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	TubaViewsHashtag* _tmp7_;
	TubaViewsHashtag* _tmp8_;
	TubaViewsBase* _tmp9_;
	TubaViewsBase* _tmp10_;
	g_return_if_fail (self != NULL);
	_tmp0_ = tuba_app;
	_tmp1_ = tuba_application_get_main_window (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->tag;
	_tmp4_ = self->priv->tag;
	_tmp5_ = g_uri_escape_string (_tmp4_, NULL, TRUE);
	_tmp6_ = _tmp5_;
	_tmp7_ = tuba_views_hashtag_new (_tmp3_, NULL, _tmp6_, NULL);
	g_object_ref_sink (_tmp7_);
	_tmp8_ = _tmp7_;
	_tmp9_ = tuba_dialogs_main_window_open_view (_tmp2_, (TubaViewsBase*) _tmp8_);
	_tmp10_ = _tmp9_;
	_g_object_unref0 (_tmp10_);
	_g_object_unref0 (_tmp8_);
	_g_free0 (_tmp6_);
}

static void
_tuba_widgets_hashtag_bar_hashtag_button_on_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                        gpointer self)
{
	tuba_widgets_hashtag_bar_hashtag_button_on_clicked ((TubaWidgetsHashtagBarHashtagButton*) self);
}

static GObject *
tuba_widgets_hashtag_bar_hashtag_button_constructor (GType type,
                                                     guint n_construct_properties,
                                                     GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	TubaWidgetsHashtagBarHashtagButton * self;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar** _tmp3_;
	gchar** _tmp4_;
	gint _tmp4__length1;
	parent_class = G_OBJECT_CLASS (tuba_widgets_hashtag_bar_hashtag_button_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_WIDGETS_HASHTAG_BAR_TYPE_HASHTAG_BUTTON, TubaWidgetsHashtagBarHashtagButton);
	g_signal_connect_object ((GtkButton*) self, "clicked", (GCallback) _tuba_widgets_hashtag_bar_hashtag_button_on_clicked_gtk_button_clicked, self, 0);
	_tmp0_ = g_strdup ("tuba-circular");
	_tmp1_ = g_strdup ("hashtag-bar-hashtag");
	_tmp2_ = g_strdup ("font-small");
	_tmp3_ = g_new0 (gchar*, 3 + 1);
	_tmp3_[0] = _tmp0_;
	_tmp3_[1] = _tmp1_;
	_tmp3_[2] = _tmp2_;
	_tmp4_ = _tmp3_;
	_tmp4__length1 = 3;
	gtk_widget_set_css_classes ((GtkWidget*) self, _tmp4_);
	_tmp4_ = (_vala_array_free (_tmp4_, _tmp4__length1, (GDestroyNotify) g_free), NULL);
	return obj;
}

static void
tuba_widgets_hashtag_bar_hashtag_button_class_init (TubaWidgetsHashtagBarHashtagButtonClass * klass,
                                                    gpointer klass_data)
{
	tuba_widgets_hashtag_bar_hashtag_button_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaWidgetsHashtagBarHashtagButton_private_offset);
	G_OBJECT_CLASS (klass)->constructor = tuba_widgets_hashtag_bar_hashtag_button_constructor;
	G_OBJECT_CLASS (klass)->finalize = tuba_widgets_hashtag_bar_hashtag_button_finalize;
}

static void
tuba_widgets_hashtag_bar_hashtag_button_instance_init (TubaWidgetsHashtagBarHashtagButton * self,
                                                       gpointer klass)
{
	self->priv = tuba_widgets_hashtag_bar_hashtag_button_get_instance_private (self);
}

static void
tuba_widgets_hashtag_bar_hashtag_button_finalize (GObject * obj)
{
	TubaWidgetsHashtagBarHashtagButton * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_WIDGETS_HASHTAG_BAR_TYPE_HASHTAG_BUTTON, TubaWidgetsHashtagBarHashtagButton);
	_g_free0 (self->priv->tag);
	G_OBJECT_CLASS (tuba_widgets_hashtag_bar_hashtag_button_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_widgets_hashtag_bar_hashtag_button_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaWidgetsHashtagBarHashtagButtonClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_widgets_hashtag_bar_hashtag_button_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaWidgetsHashtagBarHashtagButton), 0, (GInstanceInitFunc) tuba_widgets_hashtag_bar_hashtag_button_instance_init, NULL };
	GType tuba_widgets_hashtag_bar_hashtag_button_type_id;
	tuba_widgets_hashtag_bar_hashtag_button_type_id = g_type_register_static (gtk_button_get_type (), "TubaWidgetsHashtagBarHashtagButton", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaWidgetsHashtagBarHashtagButton_private_offset = g_type_add_instance_private (tuba_widgets_hashtag_bar_hashtag_button_type_id, sizeof (TubaWidgetsHashtagBarHashtagButtonPrivate));
	return tuba_widgets_hashtag_bar_hashtag_button_type_id;
}

GType
tuba_widgets_hashtag_bar_hashtag_button_get_type (void)
{
	static GType tuba_widgets_hashtag_bar_hashtag_button_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_widgets_hashtag_bar_hashtag_button_type_id__once)) {
		GType tuba_widgets_hashtag_bar_hashtag_button_type_id;
		tuba_widgets_hashtag_bar_hashtag_button_type_id = tuba_widgets_hashtag_bar_hashtag_button_get_type_once ();
		g_once_init_leave_pointer (&tuba_widgets_hashtag_bar_hashtag_button_type_id__once, tuba_widgets_hashtag_bar_hashtag_button_type_id);
	}
	return tuba_widgets_hashtag_bar_hashtag_button_type_id__once;
}

static GObject *
tuba_widgets_hashtag_bar_constructor (GType type,
                                      guint n_construct_properties,
                                      GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	TubaWidgetsHashtagBar * self;
	AdwWrapBox* _tmp0_ = NULL;
	AdwWrapBox* _tmp1_;
	parent_class = G_OBJECT_CLASS (tuba_widgets_hashtag_bar_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_WIDGETS_TYPE_HASHTAG_BAR, TubaWidgetsHashtagBar);
	_tmp0_ = (AdwWrapBox*) adw_wrap_box_new ();
	adw_wrap_box_set_child_spacing (_tmp0_, 6);
	adw_wrap_box_set_line_spacing (_tmp0_, 6);
	adw_wrap_box_set_justify (_tmp0_, ADW_JUSTIFY_NONE);
	adw_wrap_box_set_align (_tmp0_, 0.0f);
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->wrapbox);
	self->priv->wrapbox = _tmp0_;
	_tmp1_ = self->priv->wrapbox;
	adw_bin_set_child ((AdwBin*) self, (GtkWidget*) _tmp1_);
	return obj;
}

static void
tuba_widgets_hashtag_bar_class_init (TubaWidgetsHashtagBarClass * klass,
                                     gpointer klass_data)
{
	tuba_widgets_hashtag_bar_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaWidgetsHashtagBar_private_offset);
	G_OBJECT_CLASS (klass)->constructor = tuba_widgets_hashtag_bar_constructor;
	G_OBJECT_CLASS (klass)->finalize = tuba_widgets_hashtag_bar_finalize;
}

static void
tuba_widgets_hashtag_bar_instance_init (TubaWidgetsHashtagBar * self,
                                        gpointer klass)
{
	self->priv = tuba_widgets_hashtag_bar_get_instance_private (self);
}

static void
tuba_widgets_hashtag_bar_finalize (GObject * obj)
{
	TubaWidgetsHashtagBar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_WIDGETS_TYPE_HASHTAG_BAR, TubaWidgetsHashtagBar);
	_g_object_unref0 (self->priv->wrapbox);
	_g_object_unref0 (self->priv->show_more);
	G_OBJECT_CLASS (tuba_widgets_hashtag_bar_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_widgets_hashtag_bar_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaWidgetsHashtagBarClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_widgets_hashtag_bar_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaWidgetsHashtagBar), 0, (GInstanceInitFunc) tuba_widgets_hashtag_bar_instance_init, NULL };
	GType tuba_widgets_hashtag_bar_type_id;
	tuba_widgets_hashtag_bar_type_id = g_type_register_static (adw_bin_get_type (), "TubaWidgetsHashtagBar", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaWidgetsHashtagBar_private_offset = g_type_add_instance_private (tuba_widgets_hashtag_bar_type_id, sizeof (TubaWidgetsHashtagBarPrivate));
	return tuba_widgets_hashtag_bar_type_id;
}

GType
tuba_widgets_hashtag_bar_get_type (void)
{
	static GType tuba_widgets_hashtag_bar_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_widgets_hashtag_bar_type_id__once)) {
		GType tuba_widgets_hashtag_bar_type_id;
		tuba_widgets_hashtag_bar_type_id = tuba_widgets_hashtag_bar_get_type_once ();
		g_once_init_leave_pointer (&tuba_widgets_hashtag_bar_type_id__once, tuba_widgets_hashtag_bar_type_id);
	}
	return tuba_widgets_hashtag_bar_type_id__once;
}

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

