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

#include <gtk/gtk.h>
#include <glib-object.h>
#include <adwaita.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <gio/gio.h>
#include <float.h>
#include <math.h>
#include <gee.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_ANNOUNCEMENT (tuba_widgets_announcement_get_type ())
#define TUBA_WIDGETS_ANNOUNCEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_ANNOUNCEMENT, TubaWidgetsAnnouncement))
#define TUBA_WIDGETS_ANNOUNCEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_ANNOUNCEMENT, TubaWidgetsAnnouncementClass))
#define TUBA_WIDGETS_IS_ANNOUNCEMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_ANNOUNCEMENT))
#define TUBA_WIDGETS_IS_ANNOUNCEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_ANNOUNCEMENT))
#define TUBA_WIDGETS_ANNOUNCEMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_ANNOUNCEMENT, TubaWidgetsAnnouncementClass))

typedef struct _TubaWidgetsAnnouncement TubaWidgetsAnnouncement;
typedef struct _TubaWidgetsAnnouncementClass TubaWidgetsAnnouncementClass;
typedef struct _TubaWidgetsAnnouncementPrivate TubaWidgetsAnnouncementPrivate;

#define TUBA_WIDGETS_TYPE_RICH_LABEL (tuba_widgets_rich_label_get_type ())
#define TUBA_WIDGETS_RICH_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_RICH_LABEL, TubaWidgetsRichLabel))
#define TUBA_WIDGETS_RICH_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_RICH_LABEL, TubaWidgetsRichLabelClass))
#define TUBA_WIDGETS_IS_RICH_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_RICH_LABEL))
#define TUBA_WIDGETS_IS_RICH_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_RICH_LABEL))
#define TUBA_WIDGETS_RICH_LABEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_RICH_LABEL, TubaWidgetsRichLabelClass))

typedef struct _TubaWidgetsRichLabel TubaWidgetsRichLabel;
typedef struct _TubaWidgetsRichLabelClass TubaWidgetsRichLabelClass;

#define TUBA_WIDGETS_TYPE_MARKUP_VIEW (tuba_widgets_markup_view_get_type ())
#define TUBA_WIDGETS_MARKUP_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_MARKUP_VIEW, TubaWidgetsMarkupView))
#define TUBA_WIDGETS_MARKUP_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_MARKUP_VIEW, TubaWidgetsMarkupViewClass))
#define TUBA_WIDGETS_IS_MARKUP_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_MARKUP_VIEW))
#define TUBA_WIDGETS_IS_MARKUP_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_MARKUP_VIEW))
#define TUBA_WIDGETS_MARKUP_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_MARKUP_VIEW, TubaWidgetsMarkupViewClass))

typedef struct _TubaWidgetsMarkupView TubaWidgetsMarkupView;
typedef struct _TubaWidgetsMarkupViewClass TubaWidgetsMarkupViewClass;
enum  {
	TUBA_WIDGETS_ANNOUNCEMENT_0_PROPERTY,
	TUBA_WIDGETS_ANNOUNCEMENT_NUM_PROPERTIES
};
static GParamSpec* tuba_widgets_announcement_properties[TUBA_WIDGETS_ANNOUNCEMENT_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))

#define TUBA_TYPE_SETTINGS (tuba_settings_get_type ())
#define TUBA_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_SETTINGS, TubaSettings))
#define TUBA_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_SETTINGS, TubaSettingsClass))
#define TUBA_IS_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_SETTINGS))
#define TUBA_IS_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_SETTINGS))
#define TUBA_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_SETTINGS, TubaSettingsClass))

typedef struct _TubaSettings TubaSettings;
typedef struct _TubaSettingsClass TubaSettingsClass;

#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_ANNOUNCEMENT (tuba_api_announcement_get_type ())
#define TUBA_API_ANNOUNCEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_ANNOUNCEMENT, TubaAPIAnnouncement))
#define TUBA_API_ANNOUNCEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_ANNOUNCEMENT, TubaAPIAnnouncementClass))
#define TUBA_API_IS_ANNOUNCEMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_ANNOUNCEMENT))
#define TUBA_API_IS_ANNOUNCEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_ANNOUNCEMENT))
#define TUBA_API_ANNOUNCEMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_ANNOUNCEMENT, TubaAPIAnnouncementClass))

typedef struct _TubaAPIAnnouncement TubaAPIAnnouncement;
typedef struct _TubaAPIAnnouncementClass TubaAPIAnnouncementClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define TUBA_TYPE_ACCOUNT_STORE (tuba_account_store_get_type ())
#define TUBA_ACCOUNT_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStore))
#define TUBA_ACCOUNT_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStoreClass))
#define TUBA_IS_ACCOUNT_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_ACCOUNT_STORE))
#define TUBA_IS_ACCOUNT_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_ACCOUNT_STORE))
#define TUBA_ACCOUNT_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStoreClass))

typedef struct _TubaAccountStore TubaAccountStore;
typedef struct _TubaAccountStoreClass TubaAccountStoreClass;

#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 TUBA_TYPE_INSTANCE_ACCOUNT (tuba_instance_account_get_type ())
#define TUBA_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccount))
#define TUBA_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccountClass))
#define TUBA_IS_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_INSTANCE_ACCOUNT))
#define TUBA_IS_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_INSTANCE_ACCOUNT))
#define TUBA_INSTANCE_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccountClass))

typedef struct _TubaInstanceAccount TubaInstanceAccount;
typedef struct _TubaInstanceAccountClass TubaInstanceAccountClass;

#define TUBA_API_TYPE_INSTANCE (tuba_api_instance_get_type ())
#define TUBA_API_INSTANCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_INSTANCE, TubaAPIInstance))
#define TUBA_API_INSTANCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_INSTANCE, TubaAPIInstanceClass))
#define TUBA_API_IS_INSTANCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_INSTANCE))
#define TUBA_API_IS_INSTANCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_INSTANCE))
#define TUBA_API_INSTANCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_INSTANCE, TubaAPIInstanceClass))

typedef struct _TubaAPIInstance TubaAPIInstance;
typedef struct _TubaAPIInstanceClass TubaAPIInstanceClass;
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
typedef void (*TubaHelperImageOnItemChangedFn) (GdkPaintable* data, gpointer user_data);

#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_WIDGETS_TYPE_REACTIONS_ROW (tuba_widgets_reactions_row_get_type ())
#define TUBA_WIDGETS_REACTIONS_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_REACTIONS_ROW, TubaWidgetsReactionsRow))
#define TUBA_WIDGETS_REACTIONS_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_REACTIONS_ROW, TubaWidgetsReactionsRowClass))
#define TUBA_WIDGETS_IS_REACTIONS_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_REACTIONS_ROW))
#define TUBA_WIDGETS_IS_REACTIONS_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_REACTIONS_ROW))
#define TUBA_WIDGETS_REACTIONS_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_REACTIONS_ROW, TubaWidgetsReactionsRowClass))

typedef struct _TubaWidgetsReactionsRow TubaWidgetsReactionsRow;
typedef struct _TubaWidgetsReactionsRowClass TubaWidgetsReactionsRowClass;
enum  {
	TUBA_WIDGETS_ANNOUNCEMENT_OPEN_SIGNAL,
	TUBA_WIDGETS_ANNOUNCEMENT_NUM_SIGNALS
};
static guint tuba_widgets_announcement_signals[TUBA_WIDGETS_ANNOUNCEMENT_NUM_SIGNALS] = {0};

struct _TubaWidgetsAnnouncement {
	GtkListBoxRow parent_instance;
	TubaWidgetsAnnouncementPrivate * priv;
	AdwAvatar* avatar;
	TubaWidgetsRichLabel* name_label;
	GtkLabel* handle_label;
	GtkImage* edited_indicator;
	GtkImage* attention_indicator;
	GtkLabel* date_label;
	TubaWidgetsMarkupView* content;
	GtkBox* mainbox;
};

struct _TubaWidgetsAnnouncementClass {
	GtkListBoxRowClass parent_class;
};

struct _TubaWidgetsAnnouncementPrivate {
	gchar* announcement_date;
	gint reactions_count;
};

static gint TubaWidgetsAnnouncement_private_offset;
static gpointer tuba_widgets_announcement_parent_class = NULL;
VALA_EXTERN TubaSettings* tuba_settings;
VALA_EXTERN TubaAccountStore* tuba_accounts;

VALA_EXTERN GType tuba_widgets_announcement_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsAnnouncement, g_object_unref)
VALA_EXTERN GType tuba_widgets_rich_label_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsRichLabel, g_object_unref)
VALA_EXTERN GType tuba_widgets_markup_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsMarkupView, g_object_unref)
static void tuba_widgets_announcement_aria_describe_status (TubaWidgetsAnnouncement* self);
VALA_EXTERN gchar* tuba_widgets_rich_label_get_text (TubaWidgetsRichLabel* self);
VALA_EXTERN gchar* tuba_utils_date_time_humanize_aria (const gchar* iso8601);
static void tuba_widgets_announcement_settings_updated (TubaWidgetsAnnouncement* self);
VALA_EXTERN void tuba_toggle_css (GtkWidget* wdg,
                      gboolean state,
                      const gchar* style);
VALA_EXTERN GType tuba_settings_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaSettings, g_object_unref)
VALA_EXTERN gboolean tuba_settings_get_larger_line_height (TubaSettings* self);
VALA_EXTERN gboolean tuba_settings_get_scale_emoji_hover (TubaSettings* self);
static void tuba_widgets_announcement_font_size_updated (TubaWidgetsAnnouncement* self);
VALA_EXTERN gdouble tuba_settings_get_status_font_size (TubaSettings* self);
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_announcement_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAnnouncement, g_object_unref)
VALA_EXTERN TubaWidgetsAnnouncement* tuba_widgets_announcement_new (TubaAPIAnnouncement* t_announcement);
VALA_EXTERN TubaWidgetsAnnouncement* tuba_widgets_announcement_construct (GType object_type,
                                                              TubaAPIAnnouncement* t_announcement);
VALA_EXTERN GeeHashMap* tuba_api_announcement_get_emojis_map (TubaAPIAnnouncement* self);
VALA_EXTERN void tuba_widgets_markup_view_set_instance_emojis (TubaWidgetsMarkupView* self,
                                                   GeeHashMap* value);
VALA_EXTERN const gchar* tuba_api_announcement_get_content (TubaAPIAnnouncement* self);
VALA_EXTERN void tuba_widgets_markup_view_set_content (TubaWidgetsMarkupView* self,
                                           const gchar* value);
VALA_EXTERN gboolean tuba_api_announcement_get_read (TubaAPIAnnouncement* self);
VALA_EXTERN GType tuba_account_store_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAccountStore, g_object_unref)
VALA_EXTERN GType tuba_api_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAccount, g_object_unref)
VALA_EXTERN GType tuba_instance_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaInstanceAccount, g_object_unref)
VALA_EXTERN TubaInstanceAccount* tuba_account_store_get_active (TubaAccountStore* self);
VALA_EXTERN GType tuba_api_instance_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIInstance, g_object_unref)
VALA_EXTERN TubaAPIInstance* tuba_instance_account_get_instance_info (TubaInstanceAccount* self);
VALA_EXTERN const gchar* tuba_api_instance_get_title (TubaAPIInstance* self);
VALA_EXTERN const gchar* tuba_api_instance_get_thumbnail (TubaAPIInstance* self);
VALA_EXTERN const gchar* tuba_api_instance_get_uri (TubaAPIInstance* self);
VALA_EXTERN gchar* tuba_api_account_get_domain (TubaAPIAccount* self);
VALA_EXTERN const gchar* tuba_api_announcement_get_updated_at (TubaAPIAnnouncement* self);
VALA_EXTERN const gchar* tuba_api_announcement_get_published_at (TubaAPIAnnouncement* self);
VALA_EXTERN void tuba_widgets_announcement_update_time (TubaWidgetsAnnouncement* self);
VALA_EXTERN void tuba_widgets_rich_label_set_label (TubaWidgetsRichLabel* self,
                                        const gchar* value);
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_announcement_on_cache_response (TubaWidgetsAnnouncement* self,
                                                  GdkPaintable* data);
static void _tuba_widgets_announcement_on_cache_response_tuba_helper_image_on_item_changed_fn (GdkPaintable* data,
                                                                                        gpointer self);
VALA_EXTERN GType tuba_api_emoji_reaction_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIEmojiReaction, g_object_unref)
VALA_EXTERN GeeArrayList* tuba_api_announcement_get_reactions (TubaAPIAnnouncement* self);
VALA_EXTERN const gchar* tuba_api_announcement_get_id (TubaAPIAnnouncement* self);
VALA_EXTERN GType tuba_widgets_reactions_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsReactionsRow, g_object_unref)
VALA_EXTERN TubaWidgetsReactionsRow* tuba_widgets_reactions_row_new (const gchar* status_id,
                                                         GeeArrayList* reactions,
                                                         gboolean is_announcement);
VALA_EXTERN TubaWidgetsReactionsRow* tuba_widgets_reactions_row_construct (GType object_type,
                                                               const gchar* status_id,
                                                               GeeArrayList* reactions,
                                                               gboolean is_announcement);
VALA_EXTERN gchar* tuba_utils_date_time_humanize (const gchar* iso8601);
static GObject * tuba_widgets_announcement_constructor (GType type,
                                                 guint n_construct_properties,
                                                 GObjectConstructParam * construct_properties);
static void _tuba_widgets_announcement_font_size_updated_g_object_notify (GObject* _sender,
                                                                   GParamSpec* pspec,
                                                                   gpointer self);
static void _tuba_widgets_announcement_settings_updated_g_object_notify (GObject* _sender,
                                                                  GParamSpec* pspec,
                                                                  gpointer self);
static void tuba_widgets_announcement_finalize (GObject * obj);
static GType tuba_widgets_announcement_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 gssize _vala_array_length (gpointer array);

static inline gpointer
tuba_widgets_announcement_get_instance_private (TubaWidgetsAnnouncement* self)
{
	return G_STRUCT_MEMBER_P (self, TubaWidgetsAnnouncement_private_offset);
}

static void
tuba_widgets_announcement_aria_describe_status (TubaWidgetsAnnouncement* self)
{
	gchar* aria_post = NULL;
	TubaWidgetsRichLabel* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	GtkLabel* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* aria_date = NULL;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_ = NULL;
	GtkImage* _tmp10_;
	gboolean _tmp11_;
	gboolean _tmp12_;
	gchar* aria_date_prefixed = NULL;
	gchar* _tmp17_;
	gchar* aria_reactions = NULL;
	gchar* _tmp18_;
	const gchar* _tmp20_ = NULL;
	GtkImage* _tmp21_;
	gboolean _tmp22_;
	gboolean _tmp23_;
	gchar* aria_read = NULL;
	gchar* _tmp24_;
	const gchar* _tmp25_;
	const gchar* _tmp26_;
	const gchar* _tmp27_;
	gchar* _tmp28_;
	gchar* _tmp29_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->name_label;
	_tmp1_ = tuba_widgets_rich_label_get_text (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = self->handle_label;
	_tmp4_ = gtk_label_get_text (_tmp3_);
	_tmp5_ = g_strdup_printf (_ ("Announcement by %s (%s)."), _tmp2_, _tmp4_);
	_tmp6_ = _tmp5_;
	_g_free0 (_tmp2_);
	aria_post = _tmp6_;
	_tmp7_ = self->priv->announcement_date;
	_tmp8_ = tuba_utils_date_time_humanize_aria (_tmp7_);
	aria_date = _tmp8_;
	_tmp10_ = self->edited_indicator;
	_tmp11_ = gtk_widget_get_visible ((GtkWidget*) _tmp10_);
	_tmp12_ = _tmp11_;
	if (_tmp12_) {
		const gchar* _tmp13_;
		gchar* _tmp14_;
		_tmp13_ = aria_date;
		_tmp14_ = g_strdup_printf (_ ("Edited: %s."), _tmp13_);
		_g_free0 (_tmp9_);
		_tmp9_ = _tmp14_;
	} else {
		const gchar* _tmp15_;
		gchar* _tmp16_;
		_tmp15_ = aria_date;
		_tmp16_ = g_strdup_printf (_ ("Published: %s."), _tmp15_);
		_g_free0 (_tmp9_);
		_tmp9_ = _tmp16_;
	}
	_tmp17_ = _tmp9_;
	_tmp9_ = NULL;
	aria_date_prefixed = _tmp17_;
	_tmp18_ = g_strdup ("");
	aria_reactions = _tmp18_;
	if (self->priv->reactions_count > 0) {
		gchar* _tmp19_;
		_tmp19_ = g_strdup_printf (ngettext ("Contains %d reaction.", "Contains %d reactions.", (gulong) self->priv->reactions_count), self->priv->reactions_count);
		_g_free0 (aria_reactions);
		aria_reactions = _tmp19_;
	}
	_tmp21_ = self->attention_indicator;
	_tmp22_ = gtk_widget_get_visible ((GtkWidget*) _tmp21_);
	_tmp23_ = _tmp22_;
	if (_tmp23_) {
		_tmp20_ = _ ("Unread.");
	} else {
		_tmp20_ = "";
	}
	_tmp24_ = g_strdup (_tmp20_);
	aria_read = _tmp24_;
	_tmp25_ = aria_post;
	_tmp26_ = aria_date_prefixed;
	_tmp27_ = aria_reactions;
	_tmp28_ = g_strdup_printf ("%s %s %s %s", _tmp25_, _tmp26_, aria_read, _tmp27_);
	_tmp29_ = _tmp28_;
	gtk_accessible_update_property ((GtkAccessible*) self, GTK_ACCESSIBLE_PROPERTY_LABEL, _tmp29_, -1, -1);
	_g_free0 (_tmp29_);
	_g_free0 (aria_read);
	_g_free0 (aria_reactions);
	_g_free0 (aria_date_prefixed);
	_g_free0 (_tmp9_);
	_g_free0 (aria_date);
	_g_free0 (aria_post);
}

static void
tuba_widgets_announcement_settings_updated (TubaWidgetsAnnouncement* self)
{
	TubaSettings* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	TubaSettings* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = tuba_settings;
	_tmp1_ = tuba_settings_get_larger_line_height (_tmp0_);
	_tmp2_ = _tmp1_;
	tuba_toggle_css ((GtkWidget*) self, _tmp2_, "ttl-status-line-height-large");
	_tmp3_ = tuba_settings;
	_tmp4_ = tuba_settings_get_scale_emoji_hover (_tmp3_);
	_tmp5_ = _tmp4_;
	tuba_toggle_css ((GtkWidget*) self, _tmp5_, "lww-scale-emoji-hover");
}

static void
tuba_widgets_announcement_font_size_updated (TubaWidgetsAnnouncement* self)
{
	gchar** _tmp0_;
	gint _tmp0__length1;
	gchar** _tmp1_;
	gint _tmp1__length1;
	TubaSettings* _tmp5_;
	gdouble _tmp6_;
	gdouble _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_widget_get_css_classes ((GtkWidget*) self);
	_tmp0__length1 = _vala_array_length (_tmp0_);
	_tmp1_ = _tmp0_;
	_tmp1__length1 = _tmp0__length1;
	{
		gchar** style_collection = NULL;
		gint style_collection_length1 = 0;
		gint _style_collection_size_ = 0;
		gint style_it = 0;
		style_collection = _tmp1_;
		style_collection_length1 = _tmp1__length1;
		for (style_it = 0; style_it < style_collection_length1; style_it = style_it + 1) {
			gchar* _tmp2_;
			gchar* style = NULL;
			_tmp2_ = g_strdup (style_collection[style_it]);
			style = _tmp2_;
			{
				const gchar* _tmp3_;
				_tmp3_ = style;
				if (g_str_has_prefix (_tmp3_, "ttl-status-font-large")) {
					const gchar* _tmp4_;
					_tmp4_ = style;
					gtk_widget_remove_css_class ((GtkWidget*) self, _tmp4_);
					_g_free0 (style);
					break;
				}
				_g_free0 (style);
			}
		}
		style_collection = (_vala_array_free (style_collection, style_collection_length1, (GDestroyNotify) g_free), NULL);
	}
	_tmp5_ = tuba_settings;
	_tmp6_ = tuba_settings_get_status_font_size (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = g_strdup_printf ("%i", (gint) (_tmp7_ * 100));
	_tmp9_ = _tmp8_;
	_tmp10_ = g_strconcat ("ttl-status-font-large-", _tmp9_, NULL);
	_tmp11_ = _tmp10_;
	gtk_widget_add_css_class ((GtkWidget*) self, _tmp11_);
	_g_free0 (_tmp11_);
	_g_free0 (_tmp9_);
}

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 void
_tuba_widgets_announcement_on_cache_response_tuba_helper_image_on_item_changed_fn (GdkPaintable* data,
                                                                                   gpointer self)
{
	tuba_widgets_announcement_on_cache_response ((TubaWidgetsAnnouncement*) self, data);
}

TubaWidgetsAnnouncement*
tuba_widgets_announcement_construct (GType object_type,
                                     TubaAPIAnnouncement* t_announcement)
{
	TubaWidgetsAnnouncement * self = NULL;
	TubaWidgetsMarkupView* _tmp0_;
	GeeHashMap* _tmp1_;
	GeeHashMap* _tmp2_;
	GeeHashMap* _tmp3_;
	TubaWidgetsMarkupView* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	GtkImage* _tmp7_;
	gboolean _tmp8_;
	gboolean _tmp9_;
	gchar* instance_title = NULL;
	TubaAccountStore* _tmp10_;
	TubaInstanceAccount* _tmp11_;
	TubaInstanceAccount* _tmp12_;
	TubaAPIInstance* _tmp13_;
	TubaAPIInstance* _tmp14_;
	const gchar* _tmp15_;
	const gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* instance_thumbnail = NULL;
	TubaAccountStore* _tmp18_;
	TubaInstanceAccount* _tmp19_;
	TubaInstanceAccount* _tmp20_;
	TubaAPIInstance* _tmp21_;
	TubaAPIInstance* _tmp22_;
	const gchar* _tmp23_;
	const gchar* _tmp24_;
	gchar* _tmp25_;
	gchar* _tmp26_ = NULL;
	TubaAccountStore* _tmp27_;
	TubaInstanceAccount* _tmp28_;
	TubaInstanceAccount* _tmp29_;
	TubaAPIInstance* _tmp30_;
	TubaAPIInstance* _tmp31_;
	const gchar* _tmp32_;
	const gchar* _tmp33_;
	gchar* _tmp34_;
	gchar* instance_uri = NULL;
	gchar* _tmp40_;
	gboolean _tmp41_ = FALSE;
	const gchar* _tmp42_;
	const gchar* _tmp43_;
	GtkLabel* _tmp56_;
	const gchar* _tmp57_;
	GDateTime* _tmp58_;
	GDateTime* _tmp59_;
	gchar* _tmp60_;
	gchar* _tmp61_;
	GtkLabel* _tmp62_;
	GtkLabel* _tmp63_;
	const gchar* _tmp64_;
	const gchar* _tmp65_;
	GtkLabel* _tmp66_;
	const gchar* _tmp67_;
	const gchar* _tmp68_;
	gchar* _tmp69_;
	gchar* _tmp70_;
	AdwAvatar* _tmp71_;
	TubaWidgetsRichLabel* _tmp72_;
	const gchar* _tmp73_;
	const gchar* _tmp74_;
	const gchar* _tmp76_;
	GeeArrayList* _tmp78_;
	GeeArrayList* _tmp79_;
	gint _tmp80_;
	gint _tmp81_;
	GtkImage* _tmp89_;
	g_return_val_if_fail (t_announcement != NULL, NULL);
	self = (TubaWidgetsAnnouncement*) g_object_new (object_type, NULL);
	_tmp0_ = self->content;
	_tmp1_ = tuba_api_announcement_get_emojis_map (t_announcement);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	tuba_widgets_markup_view_set_instance_emojis (_tmp0_, _tmp3_);
	_g_object_unref0 (_tmp3_);
	_tmp4_ = self->content;
	_tmp5_ = tuba_api_announcement_get_content (t_announcement);
	_tmp6_ = _tmp5_;
	tuba_widgets_markup_view_set_content (_tmp4_, _tmp6_);
	_tmp7_ = self->attention_indicator;
	_tmp8_ = tuba_api_announcement_get_read (t_announcement);
	_tmp9_ = _tmp8_;
	gtk_widget_set_visible ((GtkWidget*) _tmp7_, !_tmp9_);
	_tmp10_ = tuba_accounts;
	_tmp11_ = tuba_account_store_get_active (_tmp10_);
	_tmp12_ = _tmp11_;
	_tmp13_ = tuba_instance_account_get_instance_info (_tmp12_);
	_tmp14_ = _tmp13_;
	_tmp15_ = tuba_api_instance_get_title (_tmp14_);
	_tmp16_ = _tmp15_;
	_tmp17_ = g_strdup (_tmp16_);
	instance_title = _tmp17_;
	_tmp18_ = tuba_accounts;
	_tmp19_ = tuba_account_store_get_active (_tmp18_);
	_tmp20_ = _tmp19_;
	_tmp21_ = tuba_instance_account_get_instance_info (_tmp20_);
	_tmp22_ = _tmp21_;
	_tmp23_ = tuba_api_instance_get_thumbnail (_tmp22_);
	_tmp24_ = _tmp23_;
	_tmp25_ = g_strdup (_tmp24_);
	instance_thumbnail = _tmp25_;
	_tmp27_ = tuba_accounts;
	_tmp28_ = tuba_account_store_get_active (_tmp27_);
	_tmp29_ = _tmp28_;
	_tmp30_ = tuba_instance_account_get_instance_info (_tmp29_);
	_tmp31_ = _tmp30_;
	_tmp32_ = tuba_api_instance_get_uri (_tmp31_);
	_tmp33_ = _tmp32_;
	_tmp34_ = g_strdup (_tmp33_);
	_tmp26_ = _tmp34_;
	if (_tmp26_ == NULL) {
		TubaAccountStore* _tmp35_;
		TubaInstanceAccount* _tmp36_;
		TubaInstanceAccount* _tmp37_;
		gchar* _tmp38_;
		gchar* _tmp39_;
		_tmp35_ = tuba_accounts;
		_tmp36_ = tuba_account_store_get_active (_tmp35_);
		_tmp37_ = _tmp36_;
		_tmp38_ = tuba_api_account_get_domain ((TubaAPIAccount*) _tmp37_);
		_tmp39_ = _tmp38_;
		_g_free0 (_tmp26_);
		_tmp26_ = _tmp39_;
	}
	_tmp40_ = _tmp26_;
	_tmp26_ = NULL;
	instance_uri = _tmp40_;
	_tmp42_ = tuba_api_announcement_get_updated_at (t_announcement);
	_tmp43_ = _tmp42_;
	if (_tmp43_ != NULL) {
		const gchar* _tmp44_;
		const gchar* _tmp45_;
		const gchar* _tmp46_;
		const gchar* _tmp47_;
		_tmp44_ = tuba_api_announcement_get_updated_at (t_announcement);
		_tmp45_ = _tmp44_;
		_tmp46_ = tuba_api_announcement_get_published_at (t_announcement);
		_tmp47_ = _tmp46_;
		_tmp41_ = g_strcmp0 (_tmp45_, _tmp47_) != 0;
	} else {
		_tmp41_ = FALSE;
	}
	if (_tmp41_) {
		const gchar* _tmp48_;
		const gchar* _tmp49_;
		gchar* _tmp50_;
		GtkImage* _tmp51_;
		_tmp48_ = tuba_api_announcement_get_updated_at (t_announcement);
		_tmp49_ = _tmp48_;
		_tmp50_ = g_strdup (_tmp49_);
		_g_free0 (self->priv->announcement_date);
		self->priv->announcement_date = _tmp50_;
		_tmp51_ = self->edited_indicator;
		gtk_widget_set_visible ((GtkWidget*) _tmp51_, TRUE);
	} else {
		const gchar* _tmp52_;
		const gchar* _tmp53_;
		gchar* _tmp54_;
		GtkImage* _tmp55_;
		_tmp52_ = tuba_api_announcement_get_published_at (t_announcement);
		_tmp53_ = _tmp52_;
		_tmp54_ = g_strdup (_tmp53_);
		_g_free0 (self->priv->announcement_date);
		self->priv->announcement_date = _tmp54_;
		_tmp55_ = self->edited_indicator;
		gtk_widget_set_visible ((GtkWidget*) _tmp55_, FALSE);
	}
	tuba_widgets_announcement_update_time (self);
	_tmp56_ = self->date_label;
	_tmp57_ = self->priv->announcement_date;
	_tmp58_ = g_date_time_new_from_iso8601 (_tmp57_, NULL);
	_tmp59_ = _tmp58_;
	_tmp60_ = g_date_time_format (_tmp59_, "%F %T");
	_tmp61_ = _tmp60_;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp56_, _tmp61_);
	_g_free0 (_tmp61_);
	_g_date_time_unref0 (_tmp59_);
	_tmp62_ = self->date_label;
	_tmp63_ = self->date_label;
	_tmp64_ = gtk_widget_get_tooltip_text ((GtkWidget*) _tmp63_);
	_tmp65_ = _tmp64_;
	gtk_accessible_update_property ((GtkAccessible*) _tmp62_, GTK_ACCESSIBLE_PROPERTY_LABEL, _tmp65_, -1, -1);
	_tmp66_ = self->handle_label;
	_tmp67_ = instance_uri;
	_tmp68_ = string_to_string (_tmp67_);
	_tmp69_ = g_strconcat ("@", _tmp68_, NULL);
	_tmp70_ = _tmp69_;
	gtk_label_set_label (_tmp66_, _tmp70_);
	_g_free0 (_tmp70_);
	_tmp71_ = self->avatar;
	_tmp72_ = self->name_label;
	_tmp73_ = instance_title;
	tuba_widgets_rich_label_set_label (_tmp72_, _tmp73_);
	adw_avatar_set_text (_tmp71_, _tmp73_);
	_tmp74_ = instance_title;
	if (g_strcmp0 (_tmp74_, "") != 0) {
		AdwAvatar* _tmp75_;
		_tmp75_ = self->avatar;
		adw_avatar_set_show_initials (_tmp75_, TRUE);
	}
	_tmp76_ = instance_thumbnail;
	if (g_strcmp0 (_tmp76_, "") != 0) {
		const gchar* _tmp77_;
		_tmp77_ = instance_thumbnail;
		tuba_helper_image_request_paintable (_tmp77_, NULL, FALSE, _tuba_widgets_announcement_on_cache_response_tuba_helper_image_on_item_changed_fn, g_object_ref (self), g_object_unref, NULL);
	}
	_tmp78_ = tuba_api_announcement_get_reactions (t_announcement);
	_tmp79_ = _tmp78_;
	_tmp80_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp79_);
	_tmp81_ = _tmp80_;
	self->priv->reactions_count = _tmp81_;
	if (self->priv->reactions_count > 0) {
		GtkBox* _tmp82_;
		const gchar* _tmp83_;
		const gchar* _tmp84_;
		GeeArrayList* _tmp85_;
		GeeArrayList* _tmp86_;
		TubaWidgetsReactionsRow* _tmp87_ = NULL;
		TubaWidgetsReactionsRow* _tmp88_;
		_tmp82_ = self->mainbox;
		_tmp83_ = tuba_api_announcement_get_id (t_announcement);
		_tmp84_ = _tmp83_;
		_tmp85_ = tuba_api_announcement_get_reactions (t_announcement);
		_tmp86_ = _tmp85_;
		_tmp87_ = tuba_widgets_reactions_row_new (_tmp84_, _tmp86_, TRUE);
		gtk_widget_set_margin_top ((GtkWidget*) _tmp87_, 16);
		g_object_ref_sink (_tmp87_);
		_tmp88_ = _tmp87_;
		gtk_box_append (_tmp82_, (GtkWidget*) _tmp88_);
		_g_object_unref0 (_tmp88_);
	}
	_tmp89_ = self->attention_indicator;
	g_object_bind_property_with_closures ((GObject*) t_announcement, "read", (GObject*) _tmp89_, "visible", G_BINDING_SYNC_CREATE | G_BINDING_INVERT_BOOLEAN, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	tuba_widgets_announcement_aria_describe_status (self);
	_g_free0 (instance_uri);
	_g_free0 (_tmp26_);
	_g_free0 (instance_thumbnail);
	_g_free0 (instance_title);
	return self;
}

TubaWidgetsAnnouncement*
tuba_widgets_announcement_new (TubaAPIAnnouncement* t_announcement)
{
	return tuba_widgets_announcement_construct (TUBA_WIDGETS_TYPE_ANNOUNCEMENT, t_announcement);
}

void
tuba_widgets_announcement_update_time (TubaWidgetsAnnouncement* self)
{
	GtkLabel* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->date_label;
	_tmp1_ = self->priv->announcement_date;
	_tmp2_ = tuba_utils_date_time_humanize (_tmp1_);
	_tmp3_ = _tmp2_;
	gtk_label_set_label (_tmp0_, _tmp3_);
	_g_free0 (_tmp3_);
}

static void
tuba_widgets_announcement_on_cache_response (TubaWidgetsAnnouncement* self,
                                             GdkPaintable* data)
{
	AdwAvatar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->avatar;
	adw_avatar_set_custom_image (_tmp0_, data);
}

static void
_tuba_widgets_announcement_font_size_updated_g_object_notify (GObject* _sender,
                                                              GParamSpec* pspec,
                                                              gpointer self)
{
	tuba_widgets_announcement_font_size_updated ((TubaWidgetsAnnouncement*) self);
}

static void
_tuba_widgets_announcement_settings_updated_g_object_notify (GObject* _sender,
                                                             GParamSpec* pspec,
                                                             gpointer self)
{
	tuba_widgets_announcement_settings_updated ((TubaWidgetsAnnouncement*) self);
}

static GObject *
tuba_widgets_announcement_constructor (GType type,
                                       guint n_construct_properties,
                                       GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	TubaWidgetsAnnouncement * self;
	GtkImage* _tmp0_;
	GtkImage* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	TubaSettings* _tmp4_;
	gdouble _tmp5_;
	gdouble _tmp6_;
	TubaSettings* _tmp14_;
	gboolean _tmp15_;
	gboolean _tmp16_;
	TubaSettings* _tmp17_;
	gboolean _tmp18_;
	gboolean _tmp19_;
	TubaSettings* _tmp20_;
	TubaSettings* _tmp21_;
	TubaSettings* _tmp22_;
	parent_class = G_OBJECT_CLASS (tuba_widgets_announcement_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_WIDGETS_TYPE_ANNOUNCEMENT, TubaWidgetsAnnouncement);
	_tmp0_ = self->edited_indicator;
	_tmp1_ = self->edited_indicator;
	_tmp2_ = gtk_widget_get_tooltip_text ((GtkWidget*) _tmp1_);
	_tmp3_ = _tmp2_;
	gtk_accessible_update_property ((GtkAccessible*) _tmp0_, GTK_ACCESSIBLE_PROPERTY_LABEL, _tmp3_, -1, -1);
	_tmp4_ = tuba_settings;
	_tmp5_ = tuba_settings_get_status_font_size (_tmp4_);
	_tmp6_ = _tmp5_;
	if (_tmp6_ != 1.0) {
		TubaSettings* _tmp7_;
		gdouble _tmp8_;
		gdouble _tmp9_;
		gchar* _tmp10_;
		gchar* _tmp11_;
		gchar* _tmp12_;
		gchar* _tmp13_;
		_tmp7_ = tuba_settings;
		_tmp8_ = tuba_settings_get_status_font_size (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = g_strdup_printf ("%i", (gint) (_tmp9_ * 100));
		_tmp11_ = _tmp10_;
		_tmp12_ = g_strconcat ("ttl-status-font-large-", _tmp11_, NULL);
		_tmp13_ = _tmp12_;
		gtk_widget_add_css_class ((GtkWidget*) self, _tmp13_);
		_g_free0 (_tmp13_);
		_g_free0 (_tmp11_);
	}
	_tmp14_ = tuba_settings;
	_tmp15_ = tuba_settings_get_larger_line_height (_tmp14_);
	_tmp16_ = _tmp15_;
	if (_tmp16_) {
		gtk_widget_add_css_class ((GtkWidget*) self, "ttl-status-line-height-large");
	}
	_tmp17_ = tuba_settings;
	_tmp18_ = tuba_settings_get_scale_emoji_hover (_tmp17_);
	_tmp19_ = _tmp18_;
	if (_tmp19_) {
		gtk_widget_add_css_class ((GtkWidget*) self, "lww-scale-emoji-hover");
	}
	_tmp20_ = tuba_settings;
	g_signal_connect_object ((GObject*) _tmp20_, "notify::status-font-size", (GCallback) _tuba_widgets_announcement_font_size_updated_g_object_notify, self, 0);
	_tmp21_ = tuba_settings;
	g_signal_connect_object ((GObject*) _tmp21_, "notify::larger-line-height", (GCallback) _tuba_widgets_announcement_settings_updated_g_object_notify, self, 0);
	_tmp22_ = tuba_settings;
	g_signal_connect_object ((GObject*) _tmp22_, "notify::scale-emoji-hover", (GCallback) _tuba_widgets_announcement_settings_updated_g_object_notify, self, 0);
	return obj;
}

static void
tuba_widgets_announcement_class_init (TubaWidgetsAnnouncementClass * klass,
                                      gpointer klass_data)
{
	tuba_widgets_announcement_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaWidgetsAnnouncement_private_offset);
	G_OBJECT_CLASS (klass)->constructor = tuba_widgets_announcement_constructor;
	G_OBJECT_CLASS (klass)->finalize = tuba_widgets_announcement_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/dev/geopjr/Tuba/ui/widgets/announcement.ui");
	tuba_widgets_announcement_signals[TUBA_WIDGETS_ANNOUNCEMENT_OPEN_SIGNAL] = g_signal_new ("open", TUBA_WIDGETS_TYPE_ANNOUNCEMENT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "avatar", FALSE, G_STRUCT_OFFSET (TubaWidgetsAnnouncement, avatar));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "name_label", FALSE, G_STRUCT_OFFSET (TubaWidgetsAnnouncement, name_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "handle_label", FALSE, G_STRUCT_OFFSET (TubaWidgetsAnnouncement, handle_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "edited_indicator", FALSE, G_STRUCT_OFFSET (TubaWidgetsAnnouncement, edited_indicator));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "attention_indicator", FALSE, G_STRUCT_OFFSET (TubaWidgetsAnnouncement, attention_indicator));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "date_label", FALSE, G_STRUCT_OFFSET (TubaWidgetsAnnouncement, date_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "content", FALSE, G_STRUCT_OFFSET (TubaWidgetsAnnouncement, content));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "mainbox", FALSE, G_STRUCT_OFFSET (TubaWidgetsAnnouncement, mainbox));
	g_type_ensure (TUBA_WIDGETS_TYPE_RICH_LABEL);
	g_type_ensure (TUBA_WIDGETS_TYPE_MARKUP_VIEW);
}

static void
tuba_widgets_announcement_instance_init (TubaWidgetsAnnouncement * self,
                                         gpointer klass)
{
	self->priv = tuba_widgets_announcement_get_instance_private (self);
	self->priv->reactions_count = 0;
	g_type_ensure (TUBA_WIDGETS_TYPE_RICH_LABEL);
	g_type_ensure (TUBA_WIDGETS_TYPE_MARKUP_VIEW);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
tuba_widgets_announcement_finalize (GObject * obj)
{
	TubaWidgetsAnnouncement * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_WIDGETS_TYPE_ANNOUNCEMENT, TubaWidgetsAnnouncement);
	_g_free0 (self->priv->announcement_date);
	G_OBJECT_CLASS (tuba_widgets_announcement_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_widgets_announcement_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaWidgetsAnnouncementClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_widgets_announcement_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaWidgetsAnnouncement), 0, (GInstanceInitFunc) tuba_widgets_announcement_instance_init, NULL };
	GType tuba_widgets_announcement_type_id;
	tuba_widgets_announcement_type_id = g_type_register_static (gtk_list_box_row_get_type (), "TubaWidgetsAnnouncement", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaWidgetsAnnouncement_private_offset = g_type_add_instance_private (tuba_widgets_announcement_type_id, sizeof (TubaWidgetsAnnouncementPrivate));
	return tuba_widgets_announcement_type_id;
}

GType
tuba_widgets_announcement_get_type (void)
{
	static GType tuba_widgets_announcement_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_widgets_announcement_type_id__once)) {
		GType tuba_widgets_announcement_type_id;
		tuba_widgets_announcement_type_id = tuba_widgets_announcement_get_type_once ();
		g_once_init_leave_pointer (&tuba_widgets_announcement_type_id__once, tuba_widgets_announcement_type_id);
	}
	return tuba_widgets_announcement_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);
}

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

