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

#include <adwaita.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <gee.h>
#include <glib.h>
#include <gdk/gdk.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.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_ATTACHMENT_TYPE_BOX (tuba_widgets_attachment_box_get_type ())
#define TUBA_WIDGETS_ATTACHMENT_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_ATTACHMENT_TYPE_BOX, TubaWidgetsAttachmentBox))
#define TUBA_WIDGETS_ATTACHMENT_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_ATTACHMENT_TYPE_BOX, TubaWidgetsAttachmentBoxClass))
#define TUBA_WIDGETS_ATTACHMENT_IS_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_ATTACHMENT_TYPE_BOX))
#define TUBA_WIDGETS_ATTACHMENT_IS_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_ATTACHMENT_TYPE_BOX))
#define TUBA_WIDGETS_ATTACHMENT_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_ATTACHMENT_TYPE_BOX, TubaWidgetsAttachmentBoxClass))

typedef struct _TubaWidgetsAttachmentBox TubaWidgetsAttachmentBox;
typedef struct _TubaWidgetsAttachmentBoxClass TubaWidgetsAttachmentBoxClass;
typedef struct _TubaWidgetsAttachmentBoxPrivate TubaWidgetsAttachmentBoxPrivate;

#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_ATTACHMENT (tuba_api_attachment_get_type ())
#define TUBA_API_ATTACHMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_ATTACHMENT, TubaAPIAttachment))
#define TUBA_API_ATTACHMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_ATTACHMENT, TubaAPIAttachmentClass))
#define TUBA_API_IS_ATTACHMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_ATTACHMENT))
#define TUBA_API_IS_ATTACHMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_ATTACHMENT))
#define TUBA_API_ATTACHMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_ATTACHMENT, TubaAPIAttachmentClass))

typedef struct _TubaAPIAttachment TubaAPIAttachment;
typedef struct _TubaAPIAttachmentClass TubaAPIAttachmentClass;

#define TUBA_WIDGETS_ATTACHMENT_TYPE_ITEM (tuba_widgets_attachment_item_get_type ())
#define TUBA_WIDGETS_ATTACHMENT_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_ATTACHMENT_TYPE_ITEM, TubaWidgetsAttachmentItem))
#define TUBA_WIDGETS_ATTACHMENT_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_ATTACHMENT_TYPE_ITEM, TubaWidgetsAttachmentItemClass))
#define TUBA_WIDGETS_ATTACHMENT_IS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_ATTACHMENT_TYPE_ITEM))
#define TUBA_WIDGETS_ATTACHMENT_IS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_ATTACHMENT_TYPE_ITEM))
#define TUBA_WIDGETS_ATTACHMENT_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_ATTACHMENT_TYPE_ITEM, TubaWidgetsAttachmentItemClass))

typedef struct _TubaWidgetsAttachmentItem TubaWidgetsAttachmentItem;
typedef struct _TubaWidgetsAttachmentItemClass TubaWidgetsAttachmentItemClass;

#define TUBA_WIDGETS_ATTACHMENT_TYPE_IMAGE (tuba_widgets_attachment_image_get_type ())
#define TUBA_WIDGETS_ATTACHMENT_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_ATTACHMENT_TYPE_IMAGE, TubaWidgetsAttachmentImage))
#define TUBA_WIDGETS_ATTACHMENT_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_ATTACHMENT_TYPE_IMAGE, TubaWidgetsAttachmentImageClass))
#define TUBA_WIDGETS_ATTACHMENT_IS_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_ATTACHMENT_TYPE_IMAGE))
#define TUBA_WIDGETS_ATTACHMENT_IS_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_ATTACHMENT_TYPE_IMAGE))
#define TUBA_WIDGETS_ATTACHMENT_IMAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_ATTACHMENT_TYPE_IMAGE, TubaWidgetsAttachmentImageClass))

typedef struct _TubaWidgetsAttachmentImage TubaWidgetsAttachmentImage;
typedef struct _TubaWidgetsAttachmentImageClass TubaWidgetsAttachmentImageClass;
enum  {
	TUBA_WIDGETS_ATTACHMENT_BOX_0_PROPERTY,
	TUBA_WIDGETS_ATTACHMENT_BOX_LIST_PROPERTY,
	TUBA_WIDGETS_ATTACHMENT_BOX_HAS_THUMBNAILESS_AUDIO_PROPERTY,
	TUBA_WIDGETS_ATTACHMENT_BOX_AUDIO_FALLBACK_PAINTABLE_PROPERTY,
	TUBA_WIDGETS_ATTACHMENT_BOX_HAS_SPOILER_PROPERTY,
	TUBA_WIDGETS_ATTACHMENT_BOX_SPOILER_REVEALED_PROPERTY,
	TUBA_WIDGETS_ATTACHMENT_BOX_USABLE_PROPERTY,
	TUBA_WIDGETS_ATTACHMENT_BOX_NUM_PROPERTIES
};
static GParamSpec* tuba_widgets_attachment_box_properties[TUBA_WIDGETS_ATTACHMENT_BOX_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (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;
typedef struct _Block105Data Block105Data;

#define TUBA_TYPE_WIDGETIZABLE (tuba_widgetizable_get_type ())
#define TUBA_WIDGETIZABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_WIDGETIZABLE, TubaWidgetizable))
#define TUBA_IS_WIDGETIZABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_WIDGETIZABLE))
#define TUBA_WIDGETIZABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TUBA_TYPE_WIDGETIZABLE, TubaWidgetizableIface))

typedef struct _TubaWidgetizable TubaWidgetizable;
typedef struct _TubaWidgetizableIface TubaWidgetizableIface;

#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;
typedef enum  {
	TUBA_ATTACHMENT_MEDIA_TYPE_IMAGE,
	TUBA_ATTACHMENT_MEDIA_TYPE_VIDEO,
	TUBA_ATTACHMENT_MEDIA_TYPE_GIFV,
	TUBA_ATTACHMENT_MEDIA_TYPE_AUDIO,
	TUBA_ATTACHMENT_MEDIA_TYPE_UNKNOWN
} TubaAttachmentMediaType;

#define TUBA_ATTACHMENT_TYPE_MEDIA_TYPE (tuba_attachment_media_type_get_type ())

#define TUBA_WIDGETS_TYPE_FOCUS_PICTURE (tuba_widgets_focus_picture_get_type ())
#define TUBA_WIDGETS_FOCUS_PICTURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_FOCUS_PICTURE, TubaWidgetsFocusPicture))
#define TUBA_WIDGETS_FOCUS_PICTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_FOCUS_PICTURE, TubaWidgetsFocusPictureClass))
#define TUBA_WIDGETS_IS_FOCUS_PICTURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_FOCUS_PICTURE))
#define TUBA_WIDGETS_IS_FOCUS_PICTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_FOCUS_PICTURE))
#define TUBA_WIDGETS_FOCUS_PICTURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_FOCUS_PICTURE, TubaWidgetsFocusPictureClass))

typedef struct _TubaWidgetsFocusPicture TubaWidgetsFocusPicture;
typedef struct _TubaWidgetsFocusPictureClass TubaWidgetsFocusPictureClass;
#define _g_free0(var) ((var == NULL) ? NULL : (var = (g_free (var), NULL)))

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

struct _TubaWidgetsAttachmentBox {
	AdwBin parent_instance;
	TubaWidgetsAttachmentBoxPrivate * priv;
	GtkFlowBox* box;
	GtkButton* reveal_btn;
	GtkLabel* reveal_text;
};

struct _TubaWidgetsAttachmentBoxClass {
	AdwBinClass parent_class;
};

struct _TubaWidgetsAttachmentBoxPrivate {
	GeeArrayList* _list;
	gboolean _has_thumbnailess_audio;
	GdkPaintable* _audio_fallback_paintable;
	gboolean _has_spoiler;
	gboolean _spoiler_revealed;
	TubaWidgetsAttachmentImage** attachment_widgets;
	gint attachment_widgets_length1;
	gint _attachment_widgets_size_;
	gboolean _usable;
};

struct _Block105Data {
	int _ref_count_;
	TubaWidgetsAttachmentBox* self;
	gboolean single_attachment;
};

struct _TubaWidgetizableIface {
	GTypeInterface parent_iface;
	GtkWidget* (*to_widget) (TubaWidgetizable* self);
	void (*open) (TubaWidgetizable* self);
	void (*resolve_open) (TubaWidgetizable* self, TubaInstanceAccount* account);
};

static gint TubaWidgetsAttachmentBox_private_offset;
static gpointer tuba_widgets_attachment_box_parent_class = NULL;
VALA_EXTERN TubaSettings* tuba_settings;
VALA_EXTERN TubaApplication* tuba_app;

VALA_EXTERN GType tuba_widgets_attachment_box_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsAttachmentBox, 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_attachment_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAttachment, g_object_unref)
VALA_EXTERN GType tuba_widgets_attachment_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsAttachmentItem, g_object_unref)
VALA_EXTERN GType tuba_widgets_attachment_image_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsAttachmentImage, g_object_unref)
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_show_sensitive_media (TubaSettings* self);
static void tuba_widgets_attachment_box_update_spoiler (TubaWidgetsAttachmentBox* self);
VALA_EXTERN gboolean tuba_widgets_attachment_box_get_has_spoiler (TubaWidgetsAttachmentBox* self);
VALA_EXTERN gboolean tuba_widgets_attachment_box_get_spoiler_revealed (TubaWidgetsAttachmentBox* self);
VALA_EXTERN void tuba_widgets_attachment_image_set_spoiler (TubaWidgetsAttachmentImage* self,
                                                gboolean value);
static void tuba_widgets_attachment_box_hide_spoilers (TubaWidgetsAttachmentBox* self);
VALA_EXTERN void tuba_widgets_attachment_box_set_spoiler_revealed (TubaWidgetsAttachmentBox* self,
                                                       gboolean value);
VALA_EXTERN void tuba_widgets_attachment_box_update (TubaWidgetsAttachmentBox* self);
static Block105Data* block105_data_ref (Block105Data* _data105_);
static void block105_data_unref (void * _userdata_);
VALA_EXTERN GeeArrayList* tuba_widgets_attachment_box_get_list (TubaWidgetsAttachmentBox* self);
static gboolean __lambda77_ (Block105Data* _data105_,
                      TubaAPIAttachment* item);
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 GType tuba_widgetizable_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetizable, g_object_unref)
VALA_EXTERN GtkWidget* tuba_widgetizable_to_widget (TubaWidgetizable* self);
static void _vala_array_add158 (TubaWidgetsAttachmentImage** * array,
                         gint* length,
                         gint* size,
                         TubaWidgetsAttachmentImage* value);
static void tuba_widgets_attachment_box_on_spoiler_reveal (TubaWidgetsAttachmentBox* self);
static void _tuba_widgets_attachment_box_on_spoiler_reveal_tuba_widgets_attachment_image_spoiler_revealed (TubaWidgetsAttachmentImage* _sender,
                                                                                                    gpointer self);
static void tuba_widgets_attachment_box_open_all_attachments (TubaWidgetsAttachmentBox* self,
                                                       const gchar* url);
static void _tuba_widgets_attachment_box_open_all_attachments_tuba_widgets_attachment_image_on_any_attachment_click (TubaWidgetsAttachmentImage* _sender,
                                                                                                              const gchar* url,
                                                                                                              gpointer self);
VALA_EXTERN gboolean tuba_widgets_attachment_box_get_has_thumbnailess_audio (TubaWidgetsAttachmentBox* self);
VALA_EXTERN GType tuba_attachment_media_type_get_type (void) G_GNUC_CONST ;
VALA_EXTERN TubaAttachmentMediaType tuba_widgets_attachment_item_get_media_kind (TubaWidgetsAttachmentItem* self);
VALA_EXTERN const gchar* tuba_api_attachment_get_blurhash (TubaAPIAttachment* self);
VALA_EXTERN GType tuba_widgets_focus_picture_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsFocusPicture, g_object_unref)
VALA_EXTERN TubaWidgetsFocusPicture* tuba_widgets_attachment_image_get_pic (TubaWidgetsAttachmentImage* self);
VALA_EXTERN GdkPaintable* tuba_widgets_focus_picture_get_paintable (TubaWidgetsFocusPicture* self);
static void tuba_widgets_attachment_box_set_has_thumbnailess_audio (TubaWidgetsAttachmentBox* self,
                                                             gboolean value);
static gboolean ___lambda77__gee_forall_func (gpointer g,
                                       gpointer self);
VALA_EXTERN gboolean tuba_widgets_attachment_box_get_usable (TubaWidgetsAttachmentBox* self);
VALA_EXTERN TubaAPIAttachment* tuba_widgets_attachment_item_get_entity (TubaWidgetsAttachmentItem* self);
VALA_EXTERN const gchar* tuba_api_attachment_get_url (TubaAPIAttachment* self);
static gboolean* _bool_dup (gboolean* self);
VALA_EXTERN GdkPaintable* tuba_widgets_attachment_box_get_audio_fallback_paintable (TubaWidgetsAttachmentBox* 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 void tuba_dialogs_main_window_show_media_viewer (TubaDialogsMainWindow* self,
                                                 const gchar* url,
                                                 TubaAttachmentMediaType media_type,
                                                 GdkPaintable* preview,
                                                 GtkWidget* source_widget,
                                                 gboolean as_is,
                                                 const gchar* alt_text,
                                                 const gchar* user_friendly_url,
                                                 const gchar* blurhash,
                                                 gboolean stream,
                                                 gboolean* load_and_scroll,
                                                 gboolean reveal_media_viewer);
VALA_EXTERN const gchar* tuba_widgets_focus_picture_get_alternative_text (TubaWidgetsFocusPicture* self);
static gboolean _bool_equal (const gboolean * s1,
                      const gboolean * s2);
VALA_EXTERN void tuba_dialogs_main_window_reveal_media_viewer_manually (TubaDialogsMainWindow* self,
                                                            GtkWidget* source_widget);
VALA_EXTERN TubaWidgetsAttachmentBox* tuba_widgets_attachment_box_new (void);
VALA_EXTERN TubaWidgetsAttachmentBox* tuba_widgets_attachment_box_construct (GType object_type);
VALA_EXTERN void tuba_widgets_attachment_box_set_list (TubaWidgetsAttachmentBox* self,
                                           GeeArrayList* value);
VALA_EXTERN void tuba_widgets_attachment_box_set_audio_fallback_paintable (TubaWidgetsAttachmentBox* self,
                                                               GdkPaintable* value);
VALA_EXTERN void tuba_widgets_attachment_box_set_has_spoiler (TubaWidgetsAttachmentBox* self,
                                                  gboolean value);
VALA_EXTERN void tuba_widgets_attachment_box_set_usable (TubaWidgetsAttachmentBox* self,
                                             gboolean value);
static GObject * tuba_widgets_attachment_box_constructor (GType type,
                                                   guint n_construct_properties,
                                                   GObjectConstructParam * construct_properties);
static void _tuba_widgets_attachment_box_hide_spoilers_gtk_button_clicked (GtkButton* _sender,
                                                                    gpointer self);
static void tuba_widgets_attachment_box_finalize (GObject * obj);
static GType tuba_widgets_attachment_box_get_type_once (void);
static void _vala_tuba_widgets_attachment_box_get_property (GObject * object,
                                                     guint property_id,
                                                     GValue * value,
                                                     GParamSpec * pspec);
static void _vala_tuba_widgets_attachment_box_set_property (GObject * object,
                                                     guint property_id,
                                                     const GValue * value,
                                                     GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static inline gpointer
tuba_widgets_attachment_box_get_instance_private (TubaWidgetsAttachmentBox* self)
{
	return G_STRUCT_MEMBER_P (self, TubaWidgetsAttachmentBox_private_offset);
}

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

static void
tuba_widgets_attachment_box_update_spoiler (TubaWidgetsAttachmentBox* self)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	TubaWidgetsAttachmentImage** _tmp2_;
	gint _tmp2__length1;
	GtkButton* _tmp7_;
	gboolean _tmp8_;
	gboolean _tmp9_;
	GtkLabel* _tmp10_;
	gboolean _tmp11_;
	gboolean _tmp12_;
	g_return_if_fail (self != NULL);
	_tmp0_ = tuba_widgets_attachment_box_get_has_spoiler (self);
	_tmp1_ = _tmp0_;
	if (!_tmp1_) {
		return;
	}
	_tmp2_ = self->priv->attachment_widgets;
	_tmp2__length1 = self->priv->attachment_widgets_length1;
	{
		TubaWidgetsAttachmentImage** attachment_w_collection = NULL;
		gint attachment_w_collection_length1 = 0;
		gint _attachment_w_collection_size_ = 0;
		gint attachment_w_it = 0;
		attachment_w_collection = _tmp2_;
		attachment_w_collection_length1 = _tmp2__length1;
		for (attachment_w_it = 0; attachment_w_it < attachment_w_collection_length1; attachment_w_it = attachment_w_it + 1) {
			TubaWidgetsAttachmentImage* _tmp3_;
			TubaWidgetsAttachmentImage* attachment_w = NULL;
			_tmp3_ = _g_object_ref0 (attachment_w_collection[attachment_w_it]);
			attachment_w = _tmp3_;
			{
				TubaWidgetsAttachmentImage* _tmp4_;
				gboolean _tmp5_;
				gboolean _tmp6_;
				_tmp4_ = attachment_w;
				_tmp5_ = tuba_widgets_attachment_box_get_spoiler_revealed (self);
				_tmp6_ = _tmp5_;
				tuba_widgets_attachment_image_set_spoiler (_tmp4_, !_tmp6_);
				_g_object_unref0 (attachment_w);
			}
		}
	}
	_tmp7_ = self->reveal_btn;
	_tmp8_ = tuba_widgets_attachment_box_get_spoiler_revealed (self);
	_tmp9_ = _tmp8_;
	gtk_widget_set_visible ((GtkWidget*) _tmp7_, _tmp9_);
	_tmp10_ = self->reveal_text;
	_tmp11_ = tuba_widgets_attachment_box_get_spoiler_revealed (self);
	_tmp12_ = _tmp11_;
	gtk_widget_set_visible ((GtkWidget*) _tmp10_, !_tmp12_);
}

static void
tuba_widgets_attachment_box_hide_spoilers (TubaWidgetsAttachmentBox* self)
{
	g_return_if_fail (self != NULL);
	tuba_widgets_attachment_box_set_spoiler_revealed (self, FALSE);
}

static Block105Data*
block105_data_ref (Block105Data* _data105_)
{
	g_atomic_int_inc (&_data105_->_ref_count_);
	return _data105_;
}

static void
block105_data_unref (void * _userdata_)
{
	Block105Data* _data105_;
	_data105_ = (Block105Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data105_->_ref_count_)) {
		TubaWidgetsAttachmentBox* self;
		self = _data105_->self;
		_g_object_unref0 (self);
		g_slice_free (Block105Data, _data105_);
	}
}

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

static void
_tuba_widgets_attachment_box_on_spoiler_reveal_tuba_widgets_attachment_image_spoiler_revealed (TubaWidgetsAttachmentImage* _sender,
                                                                                               gpointer self)
{
	tuba_widgets_attachment_box_on_spoiler_reveal ((TubaWidgetsAttachmentBox*) self);
}

static void
_tuba_widgets_attachment_box_open_all_attachments_tuba_widgets_attachment_image_on_any_attachment_click (TubaWidgetsAttachmentImage* _sender,
                                                                                                         const gchar* url,
                                                                                                         gpointer self)
{
	tuba_widgets_attachment_box_open_all_attachments ((TubaWidgetsAttachmentBox*) self, url);
}

static gboolean
__lambda77_ (Block105Data* _data105_,
             TubaAPIAttachment* item)
{
	TubaWidgetsAttachmentBox* self;
	GtkWidget* widget = NULL;
	GtkWidget* _tmp0_;
	GtkFlowBoxChild* flowboxchild = NULL;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	GtkFlowBoxChild* _tmp3_ = NULL;
	GtkFlowBox* _tmp4_;
	GtkFlowBoxChild* _tmp5_;
	GtkWidget* _tmp6_;
	TubaWidgetsAttachmentImage* _tmp7_;
	GtkWidget* _tmp8_;
	GtkWidget* _tmp10_;
	gboolean _tmp11_ = FALSE;
	gboolean _tmp12_;
	gboolean result;
	self = _data105_->self;
	g_return_val_if_fail (item != NULL, FALSE);
	_tmp0_ = tuba_widgetizable_to_widget ((TubaWidgetizable*) item);
	widget = _tmp0_;
	_tmp1_ = widget;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_tmp3_ = (GtkFlowBoxChild*) gtk_flow_box_child_new ();
	gtk_flow_box_child_set_child (_tmp3_, _tmp2_);
	_g_object_unref0 (_tmp2_);
	gtk_widget_set_focusable ((GtkWidget*) _tmp3_, FALSE);
	g_object_ref_sink (_tmp3_);
	flowboxchild = _tmp3_;
	_tmp4_ = self->box;
	_tmp5_ = flowboxchild;
	gtk_flow_box_insert (_tmp4_, (GtkWidget*) _tmp5_, -1);
	_tmp6_ = widget;
	_tmp7_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, TUBA_WIDGETS_ATTACHMENT_TYPE_IMAGE, TubaWidgetsAttachmentImage));
	_vala_array_add158 (&self->priv->attachment_widgets, &self->priv->attachment_widgets_length1, &self->priv->_attachment_widgets_size_, _tmp7_);
	_tmp8_ = widget;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, TUBA_WIDGETS_ATTACHMENT_TYPE_IMAGE, TubaWidgetsAttachmentImage), "spoiler-revealed", (GCallback) _tuba_widgets_attachment_box_on_spoiler_reveal_tuba_widgets_attachment_image_spoiler_revealed, self, 0);
	if (_data105_->single_attachment) {
		GtkWidget* _tmp9_;
		_tmp9_ = widget;
		g_object_set (_tmp9_, "height-request", 334, NULL);
	}
	_tmp10_ = widget;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, TUBA_WIDGETS_ATTACHMENT_TYPE_IMAGE, TubaWidgetsAttachmentImage), "on-any-attachment-click", (GCallback) _tuba_widgets_attachment_box_open_all_attachments_tuba_widgets_attachment_image_on_any_attachment_click, self, 0);
	_tmp12_ = self->priv->_has_thumbnailess_audio;
	if (!_tmp12_) {
		GtkWidget* _tmp13_;
		TubaAttachmentMediaType _tmp14_;
		TubaAttachmentMediaType _tmp15_;
		_tmp13_ = widget;
		_tmp14_ = tuba_widgets_attachment_item_get_media_kind ((TubaWidgetsAttachmentItem*) G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, TUBA_WIDGETS_ATTACHMENT_TYPE_IMAGE, TubaWidgetsAttachmentImage));
		_tmp15_ = _tmp14_;
		_tmp11_ = _tmp15_ == TUBA_ATTACHMENT_MEDIA_TYPE_AUDIO;
	} else {
		_tmp11_ = FALSE;
	}
	if (_tmp11_) {
		gboolean _tmp16_ = FALSE;
		gboolean _tmp17_ = FALSE;
		const gchar* _tmp18_;
		const gchar* _tmp19_;
		_tmp18_ = tuba_api_attachment_get_blurhash (item);
		_tmp19_ = _tmp18_;
		if (_tmp19_ == NULL) {
			_tmp17_ = TRUE;
		} else {
			const gchar* _tmp20_;
			const gchar* _tmp21_;
			_tmp20_ = tuba_api_attachment_get_blurhash (item);
			_tmp21_ = _tmp20_;
			_tmp17_ = g_strcmp0 (_tmp21_, "") == 0;
		}
		if (_tmp17_) {
			_tmp16_ = TRUE;
		} else {
			GtkWidget* _tmp22_;
			TubaWidgetsFocusPicture* _tmp23_;
			TubaWidgetsFocusPicture* _tmp24_;
			GdkPaintable* _tmp25_;
			GdkPaintable* _tmp26_;
			_tmp22_ = widget;
			_tmp23_ = tuba_widgets_attachment_image_get_pic (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, TUBA_WIDGETS_ATTACHMENT_TYPE_IMAGE, TubaWidgetsAttachmentImage));
			_tmp24_ = _tmp23_;
			_tmp25_ = tuba_widgets_focus_picture_get_paintable (_tmp24_);
			_tmp26_ = _tmp25_;
			_tmp16_ = _tmp26_ == NULL;
		}
		tuba_widgets_attachment_box_set_has_thumbnailess_audio (self, _tmp16_);
	}
	result = TRUE;
	_g_object_unref0 (flowboxchild);
	_g_object_unref0 (widget);
	_g_object_unref0 (item);
	return result;
}

static gboolean
___lambda77__gee_forall_func (gpointer g,
                              gpointer self)
{
	gboolean result;
	result = __lambda77_ (self, (TubaAPIAttachment*) g);
	return result;
}

void
tuba_widgets_attachment_box_update (TubaWidgetsAttachmentBox* self)
{
	Block105Data* _data105_;
	TubaWidgetsAttachmentImage** _tmp0_;
	gint _tmp0__length1;
	TubaWidgetsAttachmentImage** _tmp4_;
	gboolean _tmp5_ = FALSE;
	GeeArrayList* _tmp6_;
	GeeArrayList* _tmp7_;
	GeeArrayList* _tmp12_;
	GeeArrayList* _tmp13_;
	gint _tmp14_;
	gint _tmp15_;
	GeeArrayList* _tmp16_;
	GeeArrayList* _tmp17_;
	g_return_if_fail (self != NULL);
	_data105_ = g_slice_new0 (Block105Data);
	_data105_->_ref_count_ = 1;
	_data105_->self = g_object_ref (self);
	_tmp0_ = self->priv->attachment_widgets;
	_tmp0__length1 = self->priv->attachment_widgets_length1;
	{
		TubaWidgetsAttachmentImage** t_aw_collection = NULL;
		gint t_aw_collection_length1 = 0;
		gint _t_aw_collection_size_ = 0;
		gint t_aw_it = 0;
		t_aw_collection = _tmp0_;
		t_aw_collection_length1 = _tmp0__length1;
		for (t_aw_it = 0; t_aw_it < t_aw_collection_length1; t_aw_it = t_aw_it + 1) {
			TubaWidgetsAttachmentImage* _tmp1_;
			TubaWidgetsAttachmentImage* t_aw = NULL;
			_tmp1_ = _g_object_ref0 (t_aw_collection[t_aw_it]);
			t_aw = _tmp1_;
			{
				GtkFlowBox* _tmp2_;
				TubaWidgetsAttachmentImage* _tmp3_;
				_tmp2_ = self->box;
				_tmp3_ = t_aw;
				gtk_flow_box_remove (_tmp2_, (GtkWidget*) _tmp3_);
				_g_object_unref0 (t_aw);
			}
		}
	}
	_tmp4_ = g_new0 (TubaWidgetsAttachmentImage*, 0 + 1);
	self->priv->attachment_widgets = (_vala_array_free (self->priv->attachment_widgets, self->priv->attachment_widgets_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->attachment_widgets = _tmp4_;
	self->priv->attachment_widgets_length1 = 0;
	self->priv->_attachment_widgets_size_ = self->priv->attachment_widgets_length1;
	_tmp6_ = tuba_widgets_attachment_box_get_list (self);
	_tmp7_ = _tmp6_;
	if (_tmp7_ == NULL) {
		_tmp5_ = TRUE;
	} else {
		GeeArrayList* _tmp8_;
		GeeArrayList* _tmp9_;
		gboolean _tmp10_;
		gboolean _tmp11_;
		_tmp8_ = tuba_widgets_attachment_box_get_list (self);
		_tmp9_ = _tmp8_;
		_tmp10_ = gee_collection_get_is_empty ((GeeCollection*) _tmp9_);
		_tmp11_ = _tmp10_;
		_tmp5_ = _tmp11_;
	}
	if (_tmp5_) {
		gtk_widget_set_visible ((GtkWidget*) self, FALSE);
		block105_data_unref (_data105_);
		_data105_ = NULL;
		return;
	}
	_tmp12_ = tuba_widgets_attachment_box_get_list (self);
	_tmp13_ = _tmp12_;
	_tmp14_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp13_);
	_tmp15_ = _tmp14_;
	_data105_->single_attachment = _tmp15_ == 1;
	_tmp16_ = tuba_widgets_attachment_box_get_list (self);
	_tmp17_ = _tmp16_;
	gee_abstract_collection_foreach ((GeeAbstractCollection*) _tmp17_, ___lambda77__gee_forall_func, _data105_);
	if (_data105_->single_attachment) {
		GtkFlowBox* _tmp18_;
		GtkFlowBox* _tmp19_;
		_tmp18_ = self->box;
		gtk_flow_box_set_max_children_per_line (_tmp18_, (guint) 1);
		_tmp19_ = self->box;
		gtk_flow_box_set_min_children_per_line (_tmp19_, (guint) 1);
	} else {
		GtkFlowBox* _tmp20_;
		GtkFlowBox* _tmp21_;
		_tmp20_ = self->box;
		gtk_flow_box_set_max_children_per_line (_tmp20_, (guint) 2);
		_tmp21_ = self->box;
		gtk_flow_box_set_min_children_per_line (_tmp21_, (guint) 2);
	}
	gtk_widget_set_visible ((GtkWidget*) self, TRUE);
	block105_data_unref (_data105_);
	_data105_ = NULL;
}

static void
tuba_widgets_attachment_box_on_spoiler_reveal (TubaWidgetsAttachmentBox* self)
{
	g_return_if_fail (self != NULL);
	tuba_widgets_attachment_box_set_spoiler_revealed (self, TRUE);
}

static gboolean*
_bool_dup (gboolean* self)
{
	gboolean* dup;
	dup = g_new0 (gboolean, 1);
	memcpy (dup, self, sizeof (gboolean));
	return dup;
}

static gpointer
__bool_dup0 (gpointer self)
{
	return self ? _bool_dup (self) : NULL;
}

static gboolean
_bool_equal (const gboolean * s1,
             const gboolean * s2)
{
	if (s1 == s2) {
		return TRUE;
	}
	if (s1 == NULL) {
		return FALSE;
	}
	if (s2 == NULL) {
		return FALSE;
	}
	return (*s1) == (*s2);
}

static void
tuba_widgets_attachment_box_open_all_attachments (TubaWidgetsAttachmentBox* self,
                                                  const gchar* url)
{
	gboolean _tmp0_;
	gint attachment_length = 0;
	TubaWidgetsAttachmentImage** _tmp1_;
	gint _tmp1__length1;
	g_return_if_fail (self != NULL);
	g_return_if_fail (url != NULL);
	_tmp0_ = self->priv->_usable;
	if (!_tmp0_) {
		return;
	}
	_tmp1_ = self->priv->attachment_widgets;
	_tmp1__length1 = self->priv->attachment_widgets_length1;
	attachment_length = _tmp1__length1;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				gboolean* is_main = NULL;
				GdkPaintable* paintable = NULL;
				TubaWidgetsAttachmentImage** _tmp12_;
				gint _tmp12__length1;
				TubaWidgetsAttachmentImage* _tmp13_;
				TubaWidgetsFocusPicture* _tmp14_;
				TubaWidgetsFocusPicture* _tmp15_;
				GdkPaintable* _tmp16_;
				GdkPaintable* _tmp17_;
				GdkPaintable* _tmp18_;
				gboolean stream = FALSE;
				TubaWidgetsAttachmentImage** _tmp19_;
				gint _tmp19__length1;
				TubaWidgetsAttachmentImage* _tmp20_;
				TubaAttachmentMediaType _tmp21_;
				TubaAttachmentMediaType _tmp22_;
				TubaApplication* _tmp26_;
				TubaDialogsMainWindow* _tmp27_;
				TubaDialogsMainWindow* _tmp28_;
				TubaWidgetsAttachmentImage** _tmp29_;
				gint _tmp29__length1;
				TubaWidgetsAttachmentImage* _tmp30_;
				TubaAPIAttachment* _tmp31_;
				TubaAPIAttachment* _tmp32_;
				const gchar* _tmp33_;
				const gchar* _tmp34_;
				TubaWidgetsAttachmentImage** _tmp35_;
				gint _tmp35__length1;
				TubaWidgetsAttachmentImage* _tmp36_;
				TubaAttachmentMediaType _tmp37_;
				TubaAttachmentMediaType _tmp38_;
				GdkPaintable* _tmp39_;
				TubaWidgetsAttachmentImage** _tmp40_;
				gint _tmp40__length1;
				TubaWidgetsAttachmentImage* _tmp41_;
				TubaWidgetsAttachmentImage** _tmp42_;
				gint _tmp42__length1;
				TubaWidgetsAttachmentImage* _tmp43_;
				TubaWidgetsFocusPicture* _tmp44_;
				TubaWidgetsFocusPicture* _tmp45_;
				const gchar* _tmp46_;
				const gchar* _tmp47_;
				TubaWidgetsAttachmentImage** _tmp48_;
				gint _tmp48__length1;
				TubaWidgetsAttachmentImage* _tmp49_;
				TubaAPIAttachment* _tmp50_;
				TubaAPIAttachment* _tmp51_;
				const gchar* _tmp52_;
				const gchar* _tmp53_;
				gboolean* _tmp54_;
				gboolean* _tmp55_;
				gboolean* _tmp56_;
				gboolean _tmp57_;
				if (!_tmp2_) {
					gint _tmp3_;
					_tmp3_ = i;
					i = _tmp3_ + 1;
				}
				_tmp2_ = FALSE;
				if (!(i < attachment_length)) {
					break;
				}
				is_main = NULL;
				if (attachment_length > 1) {
					TubaWidgetsAttachmentImage** _tmp4_;
					gint _tmp4__length1;
					TubaWidgetsAttachmentImage* _tmp5_;
					TubaAPIAttachment* _tmp6_;
					TubaAPIAttachment* _tmp7_;
					const gchar* _tmp8_;
					const gchar* _tmp9_;
					gboolean _tmp10_;
					gboolean* _tmp11_;
					_tmp4_ = self->priv->attachment_widgets;
					_tmp4__length1 = self->priv->attachment_widgets_length1;
					_tmp5_ = _tmp4_[i];
					_tmp6_ = tuba_widgets_attachment_item_get_entity ((TubaWidgetsAttachmentItem*) _tmp5_);
					_tmp7_ = _tmp6_;
					_tmp8_ = tuba_api_attachment_get_url (_tmp7_);
					_tmp9_ = _tmp8_;
					_tmp10_ = g_strcmp0 (_tmp9_, url) == 0;
					_tmp11_ = __bool_dup0 (&_tmp10_);
					_g_free0 (is_main);
					is_main = _tmp11_;
				}
				_tmp12_ = self->priv->attachment_widgets;
				_tmp12__length1 = self->priv->attachment_widgets_length1;
				_tmp13_ = _tmp12_[i];
				_tmp14_ = tuba_widgets_attachment_image_get_pic (_tmp13_);
				_tmp15_ = _tmp14_;
				_tmp16_ = tuba_widgets_focus_picture_get_paintable (_tmp15_);
				_tmp17_ = _tmp16_;
				_tmp18_ = _g_object_ref0 (_tmp17_);
				paintable = _tmp18_;
				stream = FALSE;
				_tmp19_ = self->priv->attachment_widgets;
				_tmp19__length1 = self->priv->attachment_widgets_length1;
				_tmp20_ = _tmp19_[i];
				_tmp21_ = tuba_widgets_attachment_item_get_media_kind ((TubaWidgetsAttachmentItem*) _tmp20_);
				_tmp22_ = _tmp21_;
				if (_tmp22_ == TUBA_ATTACHMENT_MEDIA_TYPE_AUDIO) {
					GdkPaintable* _tmp23_;
					_tmp23_ = paintable;
					if (_tmp23_ == NULL) {
						GdkPaintable* _tmp24_;
						GdkPaintable* _tmp25_;
						_tmp24_ = self->priv->_audio_fallback_paintable;
						_tmp25_ = _g_object_ref0 (_tmp24_);
						_g_object_unref0 (paintable);
						paintable = _tmp25_;
					}
					stream = TRUE;
				}
				_tmp26_ = tuba_app;
				_tmp27_ = tuba_application_get_main_window (_tmp26_);
				_tmp28_ = _tmp27_;
				_tmp29_ = self->priv->attachment_widgets;
				_tmp29__length1 = self->priv->attachment_widgets_length1;
				_tmp30_ = _tmp29_[i];
				_tmp31_ = tuba_widgets_attachment_item_get_entity ((TubaWidgetsAttachmentItem*) _tmp30_);
				_tmp32_ = _tmp31_;
				_tmp33_ = tuba_api_attachment_get_url (_tmp32_);
				_tmp34_ = _tmp33_;
				_tmp35_ = self->priv->attachment_widgets;
				_tmp35__length1 = self->priv->attachment_widgets_length1;
				_tmp36_ = _tmp35_[i];
				_tmp37_ = tuba_widgets_attachment_item_get_media_kind ((TubaWidgetsAttachmentItem*) _tmp36_);
				_tmp38_ = _tmp37_;
				_tmp39_ = paintable;
				_tmp40_ = self->priv->attachment_widgets;
				_tmp40__length1 = self->priv->attachment_widgets_length1;
				_tmp41_ = _tmp40_[i];
				_tmp42_ = self->priv->attachment_widgets;
				_tmp42__length1 = self->priv->attachment_widgets_length1;
				_tmp43_ = _tmp42_[i];
				_tmp44_ = tuba_widgets_attachment_image_get_pic (_tmp43_);
				_tmp45_ = _tmp44_;
				_tmp46_ = tuba_widgets_focus_picture_get_alternative_text (_tmp45_);
				_tmp47_ = _tmp46_;
				_tmp48_ = self->priv->attachment_widgets;
				_tmp48__length1 = self->priv->attachment_widgets_length1;
				_tmp49_ = _tmp48_[i];
				_tmp50_ = tuba_widgets_attachment_item_get_entity ((TubaWidgetsAttachmentItem*) _tmp49_);
				_tmp51_ = _tmp50_;
				_tmp52_ = tuba_api_attachment_get_blurhash (_tmp51_);
				_tmp53_ = _tmp52_;
				_tmp54_ = is_main;
				_tmp55_ = is_main;
				tuba_dialogs_main_window_show_media_viewer (_tmp28_, _tmp34_, _tmp38_, _tmp39_, (GtkWidget*) _tmp41_, FALSE, _tmp47_, NULL, _tmp53_, stream, _tmp54_, _tmp55_ == NULL);
				_tmp56_ = is_main;
				_tmp57_ = TRUE;
				if (_bool_equal (_tmp56_, &_tmp57_) == TRUE) {
					TubaApplication* _tmp58_;
					TubaDialogsMainWindow* _tmp59_;
					TubaDialogsMainWindow* _tmp60_;
					TubaWidgetsAttachmentImage** _tmp61_;
					gint _tmp61__length1;
					TubaWidgetsAttachmentImage* _tmp62_;
					_tmp58_ = tuba_app;
					_tmp59_ = tuba_application_get_main_window (_tmp58_);
					_tmp60_ = _tmp59_;
					_tmp61_ = self->priv->attachment_widgets;
					_tmp61__length1 = self->priv->attachment_widgets_length1;
					_tmp62_ = _tmp61_[i];
					tuba_dialogs_main_window_reveal_media_viewer_manually (_tmp60_, (GtkWidget*) _tmp62_);
				}
				_g_object_unref0 (paintable);
				_g_free0 (is_main);
			}
		}
	}
}

TubaWidgetsAttachmentBox*
tuba_widgets_attachment_box_construct (GType object_type)
{
	TubaWidgetsAttachmentBox * self = NULL;
	self = (TubaWidgetsAttachmentBox*) g_object_new (object_type, NULL);
	return self;
}

TubaWidgetsAttachmentBox*
tuba_widgets_attachment_box_new (void)
{
	return tuba_widgets_attachment_box_construct (TUBA_WIDGETS_ATTACHMENT_TYPE_BOX);
}

GeeArrayList*
tuba_widgets_attachment_box_get_list (TubaWidgetsAttachmentBox* self)
{
	GeeArrayList* result;
	GeeArrayList* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_list;
	result = _tmp0_;
	return result;
}

void
tuba_widgets_attachment_box_set_list (TubaWidgetsAttachmentBox* self,
                                      GeeArrayList* value)
{
	GeeArrayList* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_list);
	self->priv->_list = _tmp0_;
	tuba_widgets_attachment_box_update (self);
	tuba_widgets_attachment_box_update_spoiler (self);
	g_object_notify_by_pspec ((GObject *) self, tuba_widgets_attachment_box_properties[TUBA_WIDGETS_ATTACHMENT_BOX_LIST_PROPERTY]);
}

gboolean
tuba_widgets_attachment_box_get_has_thumbnailess_audio (TubaWidgetsAttachmentBox* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_has_thumbnailess_audio;
	return result;
}

static void
tuba_widgets_attachment_box_set_has_thumbnailess_audio (TubaWidgetsAttachmentBox* self,
                                                        gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_widgets_attachment_box_get_has_thumbnailess_audio (self);
	if (old_value != value) {
		self->priv->_has_thumbnailess_audio = value;
		g_object_notify_by_pspec ((GObject *) self, tuba_widgets_attachment_box_properties[TUBA_WIDGETS_ATTACHMENT_BOX_HAS_THUMBNAILESS_AUDIO_PROPERTY]);
	}
}

GdkPaintable*
tuba_widgets_attachment_box_get_audio_fallback_paintable (TubaWidgetsAttachmentBox* self)
{
	GdkPaintable* result;
	GdkPaintable* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_audio_fallback_paintable;
	result = _tmp0_;
	return result;
}

void
tuba_widgets_attachment_box_set_audio_fallback_paintable (TubaWidgetsAttachmentBox* self,
                                                          GdkPaintable* value)
{
	GdkPaintable* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_widgets_attachment_box_get_audio_fallback_paintable (self);
	if (old_value != value) {
		GdkPaintable* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_audio_fallback_paintable);
		self->priv->_audio_fallback_paintable = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_widgets_attachment_box_properties[TUBA_WIDGETS_ATTACHMENT_BOX_AUDIO_FALLBACK_PAINTABLE_PROPERTY]);
	}
}

gboolean
tuba_widgets_attachment_box_get_has_spoiler (TubaWidgetsAttachmentBox* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_has_spoiler;
	return result;
}

void
tuba_widgets_attachment_box_set_has_spoiler (TubaWidgetsAttachmentBox* self,
                                             gboolean value)
{
	g_return_if_fail (self != NULL);
	self->priv->_has_spoiler = value;
	tuba_widgets_attachment_box_update_spoiler (self);
	g_object_notify_by_pspec ((GObject *) self, tuba_widgets_attachment_box_properties[TUBA_WIDGETS_ATTACHMENT_BOX_HAS_SPOILER_PROPERTY]);
}

gboolean
tuba_widgets_attachment_box_get_spoiler_revealed (TubaWidgetsAttachmentBox* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_spoiler_revealed;
	return result;
}

void
tuba_widgets_attachment_box_set_spoiler_revealed (TubaWidgetsAttachmentBox* self,
                                                  gboolean value)
{
	g_return_if_fail (self != NULL);
	self->priv->_spoiler_revealed = value;
	tuba_widgets_attachment_box_update_spoiler (self);
	g_object_notify_by_pspec ((GObject *) self, tuba_widgets_attachment_box_properties[TUBA_WIDGETS_ATTACHMENT_BOX_SPOILER_REVEALED_PROPERTY]);
}

gboolean
tuba_widgets_attachment_box_get_usable (TubaWidgetsAttachmentBox* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_usable;
	return result;
}

void
tuba_widgets_attachment_box_set_usable (TubaWidgetsAttachmentBox* self,
                                        gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_widgets_attachment_box_get_usable (self);
	if (old_value != value) {
		self->priv->_usable = value;
		g_object_notify_by_pspec ((GObject *) self, tuba_widgets_attachment_box_properties[TUBA_WIDGETS_ATTACHMENT_BOX_USABLE_PROPERTY]);
	}
}

static void
_tuba_widgets_attachment_box_hide_spoilers_gtk_button_clicked (GtkButton* _sender,
                                                               gpointer self)
{
	tuba_widgets_attachment_box_hide_spoilers ((TubaWidgetsAttachmentBox*) self);
}

static GObject *
tuba_widgets_attachment_box_constructor (GType type,
                                         guint n_construct_properties,
                                         GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	TubaWidgetsAttachmentBox * self;
	GtkFlowBox* _tmp0_ = NULL;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar** _tmp5_;
	GtkButton* _tmp6_ = NULL;
	GtkButton* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar** _tmp12_;
	GtkLabel* _tmp13_ = NULL;
	GtkOverlay* overlay = NULL;
	GtkOverlay* _tmp14_;
	GtkOverlay* _tmp15_;
	GtkFlowBox* _tmp16_;
	GtkOverlay* _tmp17_;
	GtkButton* _tmp18_;
	GtkOverlay* _tmp19_;
	GtkLabel* _tmp20_;
	GtkOverlay* _tmp21_;
	parent_class = G_OBJECT_CLASS (tuba_widgets_attachment_box_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_WIDGETS_ATTACHMENT_TYPE_BOX, TubaWidgetsAttachmentBox);
	gtk_widget_set_visible ((GtkWidget*) self, FALSE);
	gtk_widget_set_hexpand ((GtkWidget*) self, TRUE);
	_tmp0_ = (GtkFlowBox*) gtk_flow_box_new ();
	gtk_flow_box_set_homogeneous (_tmp0_, TRUE);
	gtk_flow_box_set_activate_on_single_click (_tmp0_, TRUE);
	gtk_flow_box_set_column_spacing (_tmp0_, (guint) 6);
	gtk_flow_box_set_row_spacing (_tmp0_, (guint) 6);
	gtk_flow_box_set_selection_mode (_tmp0_, GTK_SELECTION_NONE);
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->box);
	self->box = _tmp0_;
	_tmp1_ = g_strdup ("tuba-eye-not-looking-symbolic");
	_tmp2_ = g_strdup (_ ("Hide Media"));
	_tmp3_ = g_strdup ("osd");
	_tmp4_ = g_strdup ("circular");
	_tmp5_ = g_new0 (gchar*, 2 + 1);
	_tmp5_[0] = _tmp3_;
	_tmp5_[1] = _tmp4_;
	_tmp6_ = (GtkButton*) gtk_button_new ();
	gtk_button_set_icon_name (_tmp6_, _tmp1_);
	_g_free0 (_tmp1_);
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp6_, _tmp2_);
	_g_free0 (_tmp2_);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp6_, _tmp5_);
	_tmp5_ = (_vala_array_free (_tmp5_, 2, (GDestroyNotify) g_free), NULL);
	gtk_widget_set_halign ((GtkWidget*) _tmp6_, GTK_ALIGN_START);
	gtk_widget_set_valign ((GtkWidget*) _tmp6_, GTK_ALIGN_START);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp6_, 6);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp6_, 6);
	gtk_widget_set_visible ((GtkWidget*) _tmp6_, FALSE);
	g_object_ref_sink (_tmp6_);
	_g_object_unref0 (self->reveal_btn);
	self->reveal_btn = _tmp6_;
	_tmp7_ = self->reveal_btn;
	g_signal_connect_object (_tmp7_, "clicked", (GCallback) _tuba_widgets_attachment_box_hide_spoilers_gtk_button_clicked, self, 0);
	_tmp8_ = g_strdup ("osd");
	_tmp9_ = g_strdup ("heading");
	_tmp10_ = g_strdup ("ttl-status-badge");
	_tmp11_ = g_strdup ("sensitive-label");
	_tmp12_ = g_new0 (gchar*, 4 + 1);
	_tmp12_[0] = _tmp8_;
	_tmp12_[1] = _tmp9_;
	_tmp12_[2] = _tmp10_;
	_tmp12_[3] = _tmp11_;
	_tmp13_ = (GtkLabel*) gtk_label_new (_ ("Show Sensitive Content"));
	gtk_label_set_wrap (_tmp13_, TRUE);
	gtk_widget_set_halign ((GtkWidget*) _tmp13_, GTK_ALIGN_CENTER);
	gtk_widget_set_valign ((GtkWidget*) _tmp13_, GTK_ALIGN_CENTER);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp13_, TRUE);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp13_, _tmp12_);
	_tmp12_ = (_vala_array_free (_tmp12_, 4, (GDestroyNotify) g_free), NULL);
	gtk_widget_set_visible ((GtkWidget*) _tmp13_, FALSE);
	gtk_widget_set_can_target ((GtkWidget*) _tmp13_, FALSE);
	g_object_ref_sink (_tmp13_);
	_g_object_unref0 (self->reveal_text);
	self->reveal_text = _tmp13_;
	_tmp14_ = (GtkOverlay*) gtk_overlay_new ();
	g_object_ref_sink (_tmp14_);
	overlay = _tmp14_;
	_tmp15_ = overlay;
	_tmp16_ = self->box;
	gtk_overlay_set_child (_tmp15_, (GtkWidget*) _tmp16_);
	_tmp17_ = overlay;
	_tmp18_ = self->reveal_btn;
	gtk_overlay_add_overlay (_tmp17_, (GtkWidget*) _tmp18_);
	_tmp19_ = overlay;
	_tmp20_ = self->reveal_text;
	gtk_overlay_add_overlay (_tmp19_, (GtkWidget*) _tmp20_);
	_tmp21_ = overlay;
	adw_bin_set_child ((AdwBin*) self, (GtkWidget*) _tmp21_);
	_g_object_unref0 (overlay);
	return obj;
}

static void
tuba_widgets_attachment_box_class_init (TubaWidgetsAttachmentBoxClass * klass,
                                        gpointer klass_data)
{
	tuba_widgets_attachment_box_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaWidgetsAttachmentBox_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_widgets_attachment_box_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_widgets_attachment_box_set_property;
	G_OBJECT_CLASS (klass)->constructor = tuba_widgets_attachment_box_constructor;
	G_OBJECT_CLASS (klass)->finalize = tuba_widgets_attachment_box_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_ATTACHMENT_BOX_LIST_PROPERTY, tuba_widgets_attachment_box_properties[TUBA_WIDGETS_ATTACHMENT_BOX_LIST_PROPERTY] = g_param_spec_object ("list", "list", "list", GEE_TYPE_ARRAY_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_ATTACHMENT_BOX_HAS_THUMBNAILESS_AUDIO_PROPERTY, tuba_widgets_attachment_box_properties[TUBA_WIDGETS_ATTACHMENT_BOX_HAS_THUMBNAILESS_AUDIO_PROPERTY] = g_param_spec_boolean ("has-thumbnailess-audio", "has-thumbnailess-audio", "has-thumbnailess-audio", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_ATTACHMENT_BOX_AUDIO_FALLBACK_PAINTABLE_PROPERTY, tuba_widgets_attachment_box_properties[TUBA_WIDGETS_ATTACHMENT_BOX_AUDIO_FALLBACK_PAINTABLE_PROPERTY] = g_param_spec_object ("audio-fallback-paintable", "audio-fallback-paintable", "audio-fallback-paintable", gdk_paintable_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_ATTACHMENT_BOX_HAS_SPOILER_PROPERTY, tuba_widgets_attachment_box_properties[TUBA_WIDGETS_ATTACHMENT_BOX_HAS_SPOILER_PROPERTY] = g_param_spec_boolean ("has-spoiler", "has-spoiler", "has-spoiler", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_ATTACHMENT_BOX_SPOILER_REVEALED_PROPERTY, tuba_widgets_attachment_box_properties[TUBA_WIDGETS_ATTACHMENT_BOX_SPOILER_REVEALED_PROPERTY] = g_param_spec_boolean ("spoiler-revealed", "spoiler-revealed", "spoiler-revealed", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_ATTACHMENT_BOX_USABLE_PROPERTY, tuba_widgets_attachment_box_properties[TUBA_WIDGETS_ATTACHMENT_BOX_USABLE_PROPERTY] = g_param_spec_boolean ("usable", "usable", "usable", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
tuba_widgets_attachment_box_instance_init (TubaWidgetsAttachmentBox * self,
                                           gpointer klass)
{
	TubaSettings* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	self->priv = tuba_widgets_attachment_box_get_instance_private (self);
	self->priv->_list = NULL;
	self->priv->_has_thumbnailess_audio = FALSE;
	self->priv->_audio_fallback_paintable = NULL;
	self->priv->_has_spoiler = FALSE;
	_tmp0_ = tuba_settings;
	_tmp1_ = tuba_settings_get_show_sensitive_media (_tmp0_);
	_tmp2_ = _tmp1_;
	self->priv->_spoiler_revealed = _tmp2_;
	self->priv->_usable = TRUE;
}

static void
tuba_widgets_attachment_box_finalize (GObject * obj)
{
	TubaWidgetsAttachmentBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_WIDGETS_ATTACHMENT_TYPE_BOX, TubaWidgetsAttachmentBox);
	_g_object_unref0 (self->priv->_list);
	_g_object_unref0 (self->priv->_audio_fallback_paintable);
	_g_object_unref0 (self->box);
	_g_object_unref0 (self->reveal_btn);
	_g_object_unref0 (self->reveal_text);
	self->priv->attachment_widgets = (_vala_array_free (self->priv->attachment_widgets, self->priv->attachment_widgets_length1, (GDestroyNotify) g_object_unref), NULL);
	G_OBJECT_CLASS (tuba_widgets_attachment_box_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_widgets_attachment_box_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaWidgetsAttachmentBoxClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_widgets_attachment_box_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaWidgetsAttachmentBox), 0, (GInstanceInitFunc) tuba_widgets_attachment_box_instance_init, NULL };
	GType tuba_widgets_attachment_box_type_id;
	tuba_widgets_attachment_box_type_id = g_type_register_static (adw_bin_get_type (), "TubaWidgetsAttachmentBox", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaWidgetsAttachmentBox_private_offset = g_type_add_instance_private (tuba_widgets_attachment_box_type_id, sizeof (TubaWidgetsAttachmentBoxPrivate));
	return tuba_widgets_attachment_box_type_id;
}

GType
tuba_widgets_attachment_box_get_type (void)
{
	static GType tuba_widgets_attachment_box_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_widgets_attachment_box_type_id__once)) {
		GType tuba_widgets_attachment_box_type_id;
		tuba_widgets_attachment_box_type_id = tuba_widgets_attachment_box_get_type_once ();
		g_once_init_leave_pointer (&tuba_widgets_attachment_box_type_id__once, tuba_widgets_attachment_box_type_id);
	}
	return tuba_widgets_attachment_box_type_id__once;
}

static void
_vala_tuba_widgets_attachment_box_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec)
{
	TubaWidgetsAttachmentBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_WIDGETS_ATTACHMENT_TYPE_BOX, TubaWidgetsAttachmentBox);
	switch (property_id) {
		case TUBA_WIDGETS_ATTACHMENT_BOX_LIST_PROPERTY:
		g_value_set_object (value, tuba_widgets_attachment_box_get_list (self));
		break;
		case TUBA_WIDGETS_ATTACHMENT_BOX_HAS_THUMBNAILESS_AUDIO_PROPERTY:
		g_value_set_boolean (value, tuba_widgets_attachment_box_get_has_thumbnailess_audio (self));
		break;
		case TUBA_WIDGETS_ATTACHMENT_BOX_AUDIO_FALLBACK_PAINTABLE_PROPERTY:
		g_value_set_object (value, tuba_widgets_attachment_box_get_audio_fallback_paintable (self));
		break;
		case TUBA_WIDGETS_ATTACHMENT_BOX_HAS_SPOILER_PROPERTY:
		g_value_set_boolean (value, tuba_widgets_attachment_box_get_has_spoiler (self));
		break;
		case TUBA_WIDGETS_ATTACHMENT_BOX_SPOILER_REVEALED_PROPERTY:
		g_value_set_boolean (value, tuba_widgets_attachment_box_get_spoiler_revealed (self));
		break;
		case TUBA_WIDGETS_ATTACHMENT_BOX_USABLE_PROPERTY:
		g_value_set_boolean (value, tuba_widgets_attachment_box_get_usable (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_widgets_attachment_box_set_property (GObject * object,
                                                guint property_id,
                                                const GValue * value,
                                                GParamSpec * pspec)
{
	TubaWidgetsAttachmentBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_WIDGETS_ATTACHMENT_TYPE_BOX, TubaWidgetsAttachmentBox);
	switch (property_id) {
		case TUBA_WIDGETS_ATTACHMENT_BOX_LIST_PROPERTY:
		tuba_widgets_attachment_box_set_list (self, g_value_get_object (value));
		break;
		case TUBA_WIDGETS_ATTACHMENT_BOX_HAS_THUMBNAILESS_AUDIO_PROPERTY:
		tuba_widgets_attachment_box_set_has_thumbnailess_audio (self, g_value_get_boolean (value));
		break;
		case TUBA_WIDGETS_ATTACHMENT_BOX_AUDIO_FALLBACK_PAINTABLE_PROPERTY:
		tuba_widgets_attachment_box_set_audio_fallback_paintable (self, g_value_get_object (value));
		break;
		case TUBA_WIDGETS_ATTACHMENT_BOX_HAS_SPOILER_PROPERTY:
		tuba_widgets_attachment_box_set_has_spoiler (self, g_value_get_boolean (value));
		break;
		case TUBA_WIDGETS_ATTACHMENT_BOX_SPOILER_REVEALED_PROPERTY:
		tuba_widgets_attachment_box_set_spoiler_revealed (self, g_value_get_boolean (value));
		break;
		case TUBA_WIDGETS_ATTACHMENT_BOX_USABLE_PROPERTY:
		tuba_widgets_attachment_box_set_usable (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

