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

#include <adwaita.h>
#include <glib-object.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <glib/gi18n-lib.h>
#include <gee.h>
#include <stdlib.h>
#include <string.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_REACTION_ACCOUNTS (tuba_widgets_emoji_reaction_accounts_get_type ())
#define TUBA_WIDGETS_EMOJI_REACTION_ACCOUNTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_EMOJI_REACTION_ACCOUNTS, TubaWidgetsEmojiReactionAccounts))
#define TUBA_WIDGETS_EMOJI_REACTION_ACCOUNTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_EMOJI_REACTION_ACCOUNTS, TubaWidgetsEmojiReactionAccountsClass))
#define TUBA_WIDGETS_IS_EMOJI_REACTION_ACCOUNTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_EMOJI_REACTION_ACCOUNTS))
#define TUBA_WIDGETS_IS_EMOJI_REACTION_ACCOUNTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_EMOJI_REACTION_ACCOUNTS))
#define TUBA_WIDGETS_EMOJI_REACTION_ACCOUNTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_EMOJI_REACTION_ACCOUNTS, TubaWidgetsEmojiReactionAccountsClass))

typedef struct _TubaWidgetsEmojiReactionAccounts TubaWidgetsEmojiReactionAccounts;
typedef struct _TubaWidgetsEmojiReactionAccountsClass TubaWidgetsEmojiReactionAccountsClass;
typedef struct _TubaWidgetsEmojiReactionAccountsPrivate TubaWidgetsEmojiReactionAccountsPrivate;
enum  {
	TUBA_WIDGETS_EMOJI_REACTION_ACCOUNTS_0_PROPERTY,
	TUBA_WIDGETS_EMOJI_REACTION_ACCOUNTS_NUM_PROPERTIES
};
static GParamSpec* tuba_widgets_emoji_reaction_accounts_properties[TUBA_WIDGETS_EMOJI_REACTION_ACCOUNTS_NUM_PROPERTIES];

#define TUBA_TYPE_ENTITY (tuba_entity_get_type ())
#define TUBA_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_ENTITY, TubaEntity))
#define TUBA_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_ENTITY, TubaEntityClass))
#define TUBA_IS_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_ENTITY))
#define TUBA_IS_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_ENTITY))
#define TUBA_ENTITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_ENTITY, TubaEntityClass))

typedef struct _TubaEntity TubaEntity;
typedef struct _TubaEntityClass TubaEntityClass;

#define TUBA_API_TYPE_EMOJI_REACTION (tuba_api_emoji_reaction_get_type ())
#define TUBA_API_EMOJI_REACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_EMOJI_REACTION, TubaAPIEmojiReaction))
#define TUBA_API_EMOJI_REACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_EMOJI_REACTION, TubaAPIEmojiReactionClass))
#define TUBA_API_IS_EMOJI_REACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_EMOJI_REACTION))
#define TUBA_API_IS_EMOJI_REACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_EMOJI_REACTION))
#define TUBA_API_EMOJI_REACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_EMOJI_REACTION, TubaAPIEmojiReactionClass))

typedef struct _TubaAPIEmojiReaction TubaAPIEmojiReaction;
typedef struct _TubaAPIEmojiReactionClass TubaAPIEmojiReactionClass;

#define TUBA_API_TYPE_ACCOUNT (tuba_api_account_get_type ())
#define TUBA_API_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_ACCOUNT, TubaAPIAccount))
#define TUBA_API_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_ACCOUNT, TubaAPIAccountClass))
#define TUBA_API_IS_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_ACCOUNT))
#define TUBA_API_IS_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_ACCOUNT))
#define TUBA_API_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_ACCOUNT, TubaAPIAccountClass))

typedef struct _TubaAPIAccount TubaAPIAccount;
typedef struct _TubaAPIAccountClass TubaAPIAccountClass;
#define _g_free0(var) (var = (g_free (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;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define TUBA_WIDGETS_TYPE_ACCOUNT_ROW (tuba_widgets_account_row_get_type ())
#define TUBA_WIDGETS_ACCOUNT_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_ACCOUNT_ROW, TubaWidgetsAccountRow))
#define TUBA_WIDGETS_ACCOUNT_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_ACCOUNT_ROW, TubaWidgetsAccountRowClass))
#define TUBA_WIDGETS_IS_ACCOUNT_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_ACCOUNT_ROW))
#define TUBA_WIDGETS_IS_ACCOUNT_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_ACCOUNT_ROW))
#define TUBA_WIDGETS_ACCOUNT_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_ACCOUNT_ROW, TubaWidgetsAccountRowClass))

typedef struct _TubaWidgetsAccountRow TubaWidgetsAccountRow;
typedef struct _TubaWidgetsAccountRowClass TubaWidgetsAccountRowClass;

struct _TubaWidgetsEmojiReactionAccounts {
	AdwExpanderRow parent_instance;
	TubaWidgetsEmojiReactionAccountsPrivate * priv;
};

struct _TubaWidgetsEmojiReactionAccountsClass {
	AdwExpanderRowClass parent_class;
};

static gpointer tuba_widgets_emoji_reaction_accounts_parent_class = NULL;

VALA_EXTERN GType tuba_widgets_emoji_reaction_accounts_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsEmojiReactionAccounts, g_object_unref)
VALA_EXTERN GType tuba_entity_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaEntity, g_object_unref)
VALA_EXTERN GType tuba_api_emoji_reaction_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIEmojiReaction, g_object_unref)
VALA_EXTERN TubaWidgetsEmojiReactionAccounts* tuba_widgets_emoji_reaction_accounts_new (TubaAPIEmojiReaction* reaction);
VALA_EXTERN TubaWidgetsEmojiReactionAccounts* tuba_widgets_emoji_reaction_accounts_construct (GType object_type,
                                                                                  TubaAPIEmojiReaction* reaction);
VALA_EXTERN GType tuba_api_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAccount, g_object_unref)
VALA_EXTERN GeeArrayList* tuba_api_emoji_reaction_get_accounts (TubaAPIEmojiReaction* self);
VALA_EXTERN const gchar* tuba_api_emoji_reaction_get_url (TubaAPIEmojiReaction* self);
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 GType tuba_widgets_emoji_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsEmoji, g_object_unref)
VALA_EXTERN const gchar* tuba_api_emoji_reaction_get_name (TubaAPIEmojiReaction* self);
VALA_EXTERN TubaWidgetsAccountRow* tuba_widgets_account_row_new (TubaAPIAccount* account,
                                                     gboolean open_only);
VALA_EXTERN TubaWidgetsAccountRow* tuba_widgets_account_row_construct (GType object_type,
                                                           TubaAPIAccount* account,
                                                           gboolean open_only);
VALA_EXTERN GType tuba_widgets_account_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsAccountRow, g_object_unref)
static GType tuba_widgets_emoji_reaction_accounts_get_type_once (void);

TubaWidgetsEmojiReactionAccounts*
tuba_widgets_emoji_reaction_accounts_construct (GType object_type,
                                                TubaAPIEmojiReaction* reaction)
{
	TubaWidgetsEmojiReactionAccounts * self = NULL;
	GeeArrayList* _tmp0_;
	GeeArrayList* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	GeeArrayList* _tmp4_;
	GeeArrayList* _tmp5_;
	gint _tmp6_;
	gint _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	const gchar* _tmp10_;
	const gchar* _tmp11_;
	g_return_val_if_fail (reaction != NULL, NULL);
	self = (TubaWidgetsEmojiReactionAccounts*) g_object_new (object_type, NULL);
	gtk_widget_add_css_class ((GtkWidget*) self, "emoji-reaction-expander");
	_tmp0_ = tuba_api_emoji_reaction_get_accounts (reaction);
	_tmp1_ = _tmp0_;
	_tmp2_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = tuba_api_emoji_reaction_get_accounts (reaction);
	_tmp5_ = _tmp4_;
	_tmp6_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = g_strdup_printf (ngettext ("%d Reaction", "%d Reactions", (gulong) _tmp3_), _tmp7_);
	_tmp9_ = _tmp8_;
	adw_preferences_row_set_title ((AdwPreferencesRow*) self, _tmp9_);
	_g_free0 (_tmp9_);
	_tmp10_ = tuba_api_emoji_reaction_get_url (reaction);
	_tmp11_ = _tmp10_;
	if (_tmp11_ != NULL) {
		const gchar* _tmp12_;
		const gchar* _tmp13_;
		TubaWidgetsEmoji* _tmp14_;
		TubaWidgetsEmoji* _tmp15_;
		_tmp12_ = tuba_api_emoji_reaction_get_url (reaction);
		_tmp13_ = _tmp12_;
		_tmp14_ = tuba_widgets_emoji_new (_tmp13_, NULL);
		g_object_ref_sink (_tmp14_);
		_tmp15_ = _tmp14_;
		adw_expander_row_add_prefix ((AdwExpanderRow*) self, (GtkWidget*) _tmp15_);
		_g_object_unref0 (_tmp15_);
	} else {
		const gchar* _tmp16_;
		const gchar* _tmp17_;
		GtkLabel* _tmp18_;
		GtkLabel* _tmp19_;
		_tmp16_ = tuba_api_emoji_reaction_get_name (reaction);
		_tmp17_ = _tmp16_;
		_tmp18_ = (GtkLabel*) gtk_label_new (_tmp17_);
		g_object_ref_sink (_tmp18_);
		_tmp19_ = _tmp18_;
		adw_expander_row_add_prefix ((AdwExpanderRow*) self, (GtkWidget*) _tmp19_);
		_g_object_unref0 (_tmp19_);
	}
	{
		GeeArrayList* _account_list = NULL;
		GeeArrayList* _tmp20_;
		GeeArrayList* _tmp21_;
		gint _account_size = 0;
		GeeArrayList* _tmp22_;
		gint _tmp23_;
		gint _tmp24_;
		gint _account_index = 0;
		_tmp20_ = tuba_api_emoji_reaction_get_accounts (reaction);
		_tmp21_ = _tmp20_;
		_account_list = _tmp21_;
		_tmp22_ = _account_list;
		_tmp23_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp22_);
		_tmp24_ = _tmp23_;
		_account_size = _tmp24_;
		_account_index = -1;
		while (TRUE) {
			gint _tmp25_;
			gint _tmp26_;
			TubaAPIAccount* account = NULL;
			GeeArrayList* _tmp27_;
			gpointer _tmp28_;
			TubaAPIAccount* _tmp29_;
			TubaWidgetsAccountRow* _tmp30_;
			TubaWidgetsAccountRow* _tmp31_;
			_account_index = _account_index + 1;
			_tmp25_ = _account_index;
			_tmp26_ = _account_size;
			if (!(_tmp25_ < _tmp26_)) {
				break;
			}
			_tmp27_ = _account_list;
			_tmp28_ = gee_abstract_list_get ((GeeAbstractList*) _tmp27_, _account_index);
			account = (TubaAPIAccount*) _tmp28_;
			_tmp29_ = account;
			_tmp30_ = tuba_widgets_account_row_new (_tmp29_, TRUE);
			g_object_ref_sink (_tmp30_);
			_tmp31_ = _tmp30_;
			adw_expander_row_add_row ((AdwExpanderRow*) self, (GtkWidget*) _tmp31_);
			_g_object_unref0 (_tmp31_);
			_g_object_unref0 (account);
		}
	}
	return self;
}

TubaWidgetsEmojiReactionAccounts*
tuba_widgets_emoji_reaction_accounts_new (TubaAPIEmojiReaction* reaction)
{
	return tuba_widgets_emoji_reaction_accounts_construct (TUBA_WIDGETS_TYPE_EMOJI_REACTION_ACCOUNTS, reaction);
}

static void
tuba_widgets_emoji_reaction_accounts_class_init (TubaWidgetsEmojiReactionAccountsClass * klass,
                                                 gpointer klass_data)
{
	tuba_widgets_emoji_reaction_accounts_parent_class = g_type_class_peek_parent (klass);
}

static void
tuba_widgets_emoji_reaction_accounts_instance_init (TubaWidgetsEmojiReactionAccounts * self,
                                                    gpointer klass)
{
}

 G_GNUC_NO_INLINE static GType
tuba_widgets_emoji_reaction_accounts_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaWidgetsEmojiReactionAccountsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_widgets_emoji_reaction_accounts_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaWidgetsEmojiReactionAccounts), 0, (GInstanceInitFunc) tuba_widgets_emoji_reaction_accounts_instance_init, NULL };
	GType tuba_widgets_emoji_reaction_accounts_type_id;
	tuba_widgets_emoji_reaction_accounts_type_id = g_type_register_static (adw_expander_row_get_type (), "TubaWidgetsEmojiReactionAccounts", &g_define_type_info, G_TYPE_FLAG_NONE);
	return tuba_widgets_emoji_reaction_accounts_type_id;
}

GType
tuba_widgets_emoji_reaction_accounts_get_type (void)
{
	static GType tuba_widgets_emoji_reaction_accounts_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_widgets_emoji_reaction_accounts_type_id__once)) {
		GType tuba_widgets_emoji_reaction_accounts_type_id;
		tuba_widgets_emoji_reaction_accounts_type_id = tuba_widgets_emoji_reaction_accounts_get_type_once ();
		g_once_init_leave_pointer (&tuba_widgets_emoji_reaction_accounts_type_id__once, tuba_widgets_emoji_reaction_accounts_type_id);
	}
	return tuba_widgets_emoji_reaction_accounts_type_id__once;
}

