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

#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <adwaita.h>
#include <glib/gi18n-lib.h>
#include <float.h>
#include <math.h>
#include <gio/gio.h>
#include <gdk/gdk.h>
#include <gtksourceview/gtksource.h>
#include <json-glib/json-glib.h>
#include <libsoup/soup.h>
#include <pango/pango.h>
#include <libspelling.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_DIALOGS_COMPOSER_COMPONENTS_TYPE_ATTACHABLE (tuba_dialogs_composer_components_attachable_get_type ())
#define TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_DIALOGS_COMPOSER_COMPONENTS_TYPE_ATTACHABLE, TubaDialogsComposerComponentsAttachable))
#define TUBA_DIALOGS_COMPOSER_COMPONENTS_IS_ATTACHABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_DIALOGS_COMPOSER_COMPONENTS_TYPE_ATTACHABLE))
#define TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TUBA_DIALOGS_COMPOSER_COMPONENTS_TYPE_ATTACHABLE, TubaDialogsComposerComponentsAttachableIface))

typedef struct _TubaDialogsComposerComponentsAttachable TubaDialogsComposerComponentsAttachable;
typedef struct _TubaDialogsComposerComponentsAttachableIface TubaDialogsComposerComponentsAttachableIface;

#define TUBA_DIALOGS_COMPOSER_COMPONENTS_TYPE_ATTACHMENTS_BIN (tuba_dialogs_composer_components_attachments_bin_get_type ())
#define TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_DIALOGS_COMPOSER_COMPONENTS_TYPE_ATTACHMENTS_BIN, TubaDialogsComposerComponentsAttachmentsBin))
#define TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_DIALOGS_COMPOSER_COMPONENTS_TYPE_ATTACHMENTS_BIN, TubaDialogsComposerComponentsAttachmentsBinClass))
#define TUBA_DIALOGS_COMPOSER_COMPONENTS_IS_ATTACHMENTS_BIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_DIALOGS_COMPOSER_COMPONENTS_TYPE_ATTACHMENTS_BIN))
#define TUBA_DIALOGS_COMPOSER_COMPONENTS_IS_ATTACHMENTS_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_DIALOGS_COMPOSER_COMPONENTS_TYPE_ATTACHMENTS_BIN))
#define TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_DIALOGS_COMPOSER_COMPONENTS_TYPE_ATTACHMENTS_BIN, TubaDialogsComposerComponentsAttachmentsBinClass))

typedef struct _TubaDialogsComposerComponentsAttachmentsBin TubaDialogsComposerComponentsAttachmentsBin;
typedef struct _TubaDialogsComposerComponentsAttachmentsBinClass TubaDialogsComposerComponentsAttachmentsBinClass;
typedef struct _TubaDialogsComposerComponentsAttachmentsBinPrivate TubaDialogsComposerComponentsAttachmentsBinPrivate;

#define TUBA_DIALOGS_COMPOSER_COMPONENTS_TYPE_ATTACHMENT (tuba_dialogs_composer_components_attachment_get_type ())
#define TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_DIALOGS_COMPOSER_COMPONENTS_TYPE_ATTACHMENT, TubaDialogsComposerComponentsAttachment))
#define TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_DIALOGS_COMPOSER_COMPONENTS_TYPE_ATTACHMENT, TubaDialogsComposerComponentsAttachmentClass))
#define TUBA_DIALOGS_COMPOSER_COMPONENTS_IS_ATTACHMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_DIALOGS_COMPOSER_COMPONENTS_TYPE_ATTACHMENT))
#define TUBA_DIALOGS_COMPOSER_COMPONENTS_IS_ATTACHMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_DIALOGS_COMPOSER_COMPONENTS_TYPE_ATTACHMENT))
#define TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_DIALOGS_COMPOSER_COMPONENTS_TYPE_ATTACHMENT, TubaDialogsComposerComponentsAttachmentClass))

typedef struct _TubaDialogsComposerComponentsAttachment TubaDialogsComposerComponentsAttachment;
typedef struct _TubaDialogsComposerComponentsAttachmentClass TubaDialogsComposerComponentsAttachmentClass;
enum  {
	TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_0_PROPERTY,
	TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDIT_MODE_PROPERTY,
	TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_WORKING_PROPERTY,
	TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_IS_EMPTY_PROPERTY,
	TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_CAN_ADD_MEDIA_PROPERTY,
	TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_NUM_PROPERTIES
};
static GParamSpec* tuba_dialogs_composer_components_attachments_bin_properties[TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_TYPE_METADATA (tuba_dialogs_composer_components_attachments_bin_metadata_get_type ())
typedef struct _TubaDialogsComposerComponentsAttachmentsBinMetadata TubaDialogsComposerComponentsAttachmentsBinMetadata;

#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_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_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 TUBA_API_MASTODON_TYPE_CONFIGURATIONS (tuba_api_mastodon_configurations_get_type ())
#define TUBA_API_MASTODON_CONFIGURATIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_MASTODON_TYPE_CONFIGURATIONS, TubaAPIMastodonConfigurations))
#define TUBA_API_MASTODON_CONFIGURATIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_MASTODON_TYPE_CONFIGURATIONS, TubaAPIMastodonConfigurationsClass))
#define TUBA_API_MASTODON_IS_CONFIGURATIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_MASTODON_TYPE_CONFIGURATIONS))
#define TUBA_API_MASTODON_IS_CONFIGURATIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_MASTODON_TYPE_CONFIGURATIONS))
#define TUBA_API_MASTODON_CONFIGURATIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_MASTODON_TYPE_CONFIGURATIONS, TubaAPIMastodonConfigurationsClass))

typedef struct _TubaAPIMastodonConfigurations TubaAPIMastodonConfigurations;
typedef struct _TubaAPIMastodonConfigurationsClass TubaAPIMastodonConfigurationsClass;

#define TUBA_API_MASTODON_CONFIGURATION_TYPE_MEDIA_ATTACHMENTS (tuba_api_mastodon_configuration_media_attachments_get_type ())
#define TUBA_API_MASTODON_CONFIGURATION_MEDIA_ATTACHMENTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_MASTODON_CONFIGURATION_TYPE_MEDIA_ATTACHMENTS, TubaAPIMastodonConfigurationMediaAttachments))
#define TUBA_API_MASTODON_CONFIGURATION_MEDIA_ATTACHMENTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_MASTODON_CONFIGURATION_TYPE_MEDIA_ATTACHMENTS, TubaAPIMastodonConfigurationMediaAttachmentsClass))
#define TUBA_API_MASTODON_CONFIGURATION_IS_MEDIA_ATTACHMENTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_MASTODON_CONFIGURATION_TYPE_MEDIA_ATTACHMENTS))
#define TUBA_API_MASTODON_CONFIGURATION_IS_MEDIA_ATTACHMENTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_MASTODON_CONFIGURATION_TYPE_MEDIA_ATTACHMENTS))
#define TUBA_API_MASTODON_CONFIGURATION_MEDIA_ATTACHMENTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_MASTODON_CONFIGURATION_TYPE_MEDIA_ATTACHMENTS, TubaAPIMastodonConfigurationMediaAttachmentsClass))

typedef struct _TubaAPIMastodonConfigurationMediaAttachments TubaAPIMastodonConfigurationMediaAttachments;
typedef struct _TubaAPIMastodonConfigurationMediaAttachmentsClass TubaAPIMastodonConfigurationMediaAttachmentsClass;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _TubaDialogsComposerComponentsAttachmentsBinUploadFilesData TubaDialogsComposerComponentsAttachmentsBinUploadFilesData;
typedef struct _Block42Data Block42Data;

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

typedef struct _TubaApplication TubaApplication;
typedef struct _TubaApplicationClass TubaApplicationClass;

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

typedef struct _TubaDialogsMainWindow TubaDialogsMainWindow;
typedef struct _TubaDialogsMainWindowClass TubaDialogsMainWindowClass;

#define TUBA_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;
typedef enum  {
	TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENT_MEDIA_TYPE_IMAGE,
	TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENT_MEDIA_TYPE_VIDEO,
	TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENT_MEDIA_TYPE_GIFV,
	TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENT_MEDIA_TYPE_AUDIO
} TubaDialogsComposerComponentsAttachmentMediaType;

#define TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENT_TYPE_MEDIA_TYPE (tuba_dialogs_composer_components_attachment_media_type_get_type ())

#define TUBA_API_ATTACHMENT_TYPE_META (tuba_api_attachment_meta_get_type ())
#define TUBA_API_ATTACHMENT_META(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_ATTACHMENT_TYPE_META, TubaAPIAttachmentMeta))
#define TUBA_API_ATTACHMENT_META_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_ATTACHMENT_TYPE_META, TubaAPIAttachmentMetaClass))
#define TUBA_API_ATTACHMENT_IS_META(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_ATTACHMENT_TYPE_META))
#define TUBA_API_ATTACHMENT_IS_META_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_ATTACHMENT_TYPE_META))
#define TUBA_API_ATTACHMENT_META_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_ATTACHMENT_TYPE_META, TubaAPIAttachmentMetaClass))

typedef struct _TubaAPIAttachmentMeta TubaAPIAttachmentMeta;
typedef struct _TubaAPIAttachmentMetaClass TubaAPIAttachmentMetaClass;

#define TUBA_API_ATTACHMENT_META_TYPE_FOCUS (tuba_api_attachment_meta_focus_get_type ())
#define TUBA_API_ATTACHMENT_META_FOCUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_ATTACHMENT_META_TYPE_FOCUS, TubaAPIAttachmentMetaFocus))
#define TUBA_API_ATTACHMENT_META_FOCUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_ATTACHMENT_META_TYPE_FOCUS, TubaAPIAttachmentMetaFocusClass))
#define TUBA_API_ATTACHMENT_META_IS_FOCUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_ATTACHMENT_META_TYPE_FOCUS))
#define TUBA_API_ATTACHMENT_META_IS_FOCUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_ATTACHMENT_META_TYPE_FOCUS))
#define TUBA_API_ATTACHMENT_META_FOCUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_ATTACHMENT_META_TYPE_FOCUS, TubaAPIAttachmentMetaFocusClass))

typedef struct _TubaAPIAttachmentMetaFocus TubaAPIAttachmentMetaFocus;
typedef struct _TubaAPIAttachmentMetaFocusClass TubaAPIAttachmentMetaFocusClass;

#define TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_TYPE_EDITOR (tuba_dialogs_composer_components_attachments_bin_editor_get_type ())
#define TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_TYPE_EDITOR, TubaDialogsComposerComponentsAttachmentsBinEditor))
#define TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_TYPE_EDITOR, TubaDialogsComposerComponentsAttachmentsBinEditorClass))
#define TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_IS_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_TYPE_EDITOR))
#define TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_IS_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_TYPE_EDITOR))
#define TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_TYPE_EDITOR, TubaDialogsComposerComponentsAttachmentsBinEditorClass))

typedef struct _TubaDialogsComposerComponentsAttachmentsBinEditor TubaDialogsComposerComponentsAttachmentsBinEditor;
typedef struct _TubaDialogsComposerComponentsAttachmentsBinEditorClass TubaDialogsComposerComponentsAttachmentsBinEditorClass;

#define TUBA_DIALOGS_COMPOSER_TYPE_PREFERRED_SIZEABLE (tuba_dialogs_composer_preferred_sizeable_get_type ())
#define TUBA_DIALOGS_COMPOSER_PREFERRED_SIZEABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_DIALOGS_COMPOSER_TYPE_PREFERRED_SIZEABLE, TubaDialogsComposerPreferredSizeable))
#define TUBA_DIALOGS_COMPOSER_IS_PREFERRED_SIZEABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_DIALOGS_COMPOSER_TYPE_PREFERRED_SIZEABLE))
#define TUBA_DIALOGS_COMPOSER_PREFERRED_SIZEABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TUBA_DIALOGS_COMPOSER_TYPE_PREFERRED_SIZEABLE, TubaDialogsComposerPreferredSizeableIface))

typedef struct _TubaDialogsComposerPreferredSizeable TubaDialogsComposerPreferredSizeable;
typedef struct _TubaDialogsComposerPreferredSizeableIface TubaDialogsComposerPreferredSizeableIface;
typedef struct _TubaDialogsComposerComponentsAttachmentsBinEditorPrivate TubaDialogsComposerComponentsAttachmentsBinEditorPrivate;

#define TUBA_DIALOGS_COMPOSER_COMPONENTS_EDITOR_TYPE_PLACEHOLDER_HACK (tuba_dialogs_composer_components_editor_placeholder_hack_get_type ())
#define TUBA_DIALOGS_COMPOSER_COMPONENTS_EDITOR_PLACEHOLDER_HACK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_DIALOGS_COMPOSER_COMPONENTS_EDITOR_TYPE_PLACEHOLDER_HACK, TubaDialogsComposerComponentsEditorPlaceholderHack))
#define TUBA_DIALOGS_COMPOSER_COMPONENTS_EDITOR_PLACEHOLDER_HACK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_DIALOGS_COMPOSER_COMPONENTS_EDITOR_TYPE_PLACEHOLDER_HACK, TubaDialogsComposerComponentsEditorPlaceholderHackClass))
#define TUBA_DIALOGS_COMPOSER_COMPONENTS_EDITOR_IS_PLACEHOLDER_HACK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_DIALOGS_COMPOSER_COMPONENTS_EDITOR_TYPE_PLACEHOLDER_HACK))
#define TUBA_DIALOGS_COMPOSER_COMPONENTS_EDITOR_IS_PLACEHOLDER_HACK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_DIALOGS_COMPOSER_COMPONENTS_EDITOR_TYPE_PLACEHOLDER_HACK))
#define TUBA_DIALOGS_COMPOSER_COMPONENTS_EDITOR_PLACEHOLDER_HACK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_DIALOGS_COMPOSER_COMPONENTS_EDITOR_TYPE_PLACEHOLDER_HACK, TubaDialogsComposerComponentsEditorPlaceholderHackClass))

typedef struct _TubaDialogsComposerComponentsEditorPlaceholderHack TubaDialogsComposerComponentsEditorPlaceholderHack;
typedef struct _TubaDialogsComposerComponentsEditorPlaceholderHackClass TubaDialogsComposerComponentsEditorPlaceholderHackClass;
enum  {
	TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_0_PROPERTY,
	TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_PREFERRED_HEIGHT_PROPERTY,
	TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_PREFERRED_WIDTH_PROPERTY,
	TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_CAN_SAVE_PROPERTY,
	TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_EDIT_MODE_PROPERTY,
	TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_POS_X_PROPERTY,
	TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_POS_Y_PROPERTY,
	TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_MEDIA_ID_PROPERTY,
	TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_NUM_PROPERTIES
};
static GParamSpec* tuba_dialogs_composer_components_attachments_bin_editor_properties[TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_NUM_PROPERTIES];

#define TUBA_TYPE_REQUEST_V2 (tuba_request_v2_get_type ())
#define TUBA_REQUEST_V2(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_REQUEST_V2, TubaRequestV2))
#define TUBA_REQUEST_V2_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_REQUEST_V2, TubaRequestV2Class))
#define TUBA_IS_REQUEST_V2(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_REQUEST_V2))
#define TUBA_IS_REQUEST_V2_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_REQUEST_V2))
#define TUBA_REQUEST_V2_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_REQUEST_V2, TubaRequestV2Class))

typedef struct _TubaRequestV2 TubaRequestV2;
typedef struct _TubaRequestV2Class TubaRequestV2Class;
typedef enum  {
	TUBA_REQUEST_V2_METHOD_GET,
	TUBA_REQUEST_V2_METHOD_POST,
	TUBA_REQUEST_V2_METHOD_PUT,
	TUBA_REQUEST_V2_METHOD_DELETE,
	TUBA_REQUEST_V2_METHOD_PATCH
} TubaRequestV2Method;

#define TUBA_REQUEST_V2_TYPE_METHOD (tuba_request_v2_method_get_type ())

#define TUBA_TYPE_OOPSIE (tuba_oopsie_get_type ())
typedef struct _TubaDialogsComposerComponentsAttachmentsBinEditorPutAltTextData TubaDialogsComposerComponentsAttachmentsBinEditorPutAltTextData;

#define TUBA_WIDGETS_TYPE_FOCUS_PICKER (tuba_widgets_focus_picker_get_type ())
#define TUBA_WIDGETS_FOCUS_PICKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_FOCUS_PICKER, TubaWidgetsFocusPicker))
#define TUBA_WIDGETS_FOCUS_PICKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_FOCUS_PICKER, TubaWidgetsFocusPickerClass))
#define TUBA_WIDGETS_IS_FOCUS_PICKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_FOCUS_PICKER))
#define TUBA_WIDGETS_IS_FOCUS_PICKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_FOCUS_PICKER))
#define TUBA_WIDGETS_FOCUS_PICKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_FOCUS_PICKER, TubaWidgetsFocusPickerClass))

typedef struct _TubaWidgetsFocusPicker TubaWidgetsFocusPicker;
typedef struct _TubaWidgetsFocusPickerClass TubaWidgetsFocusPickerClass;

#define TUBA_DIALOGS_COMPOSER_TYPE_PREFERRED_SIZE_BIN (tuba_dialogs_composer_preferred_size_bin_get_type ())
#define TUBA_DIALOGS_COMPOSER_PREFERRED_SIZE_BIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_DIALOGS_COMPOSER_TYPE_PREFERRED_SIZE_BIN, TubaDialogsComposerPreferredSizeBin))
#define TUBA_DIALOGS_COMPOSER_PREFERRED_SIZE_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_DIALOGS_COMPOSER_TYPE_PREFERRED_SIZE_BIN, TubaDialogsComposerPreferredSizeBinClass))
#define TUBA_DIALOGS_COMPOSER_IS_PREFERRED_SIZE_BIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_DIALOGS_COMPOSER_TYPE_PREFERRED_SIZE_BIN))
#define TUBA_DIALOGS_COMPOSER_IS_PREFERRED_SIZE_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_DIALOGS_COMPOSER_TYPE_PREFERRED_SIZE_BIN))
#define TUBA_DIALOGS_COMPOSER_PREFERRED_SIZE_BIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_DIALOGS_COMPOSER_TYPE_PREFERRED_SIZE_BIN, TubaDialogsComposerPreferredSizeBinClass))

typedef struct _TubaDialogsComposerPreferredSizeBin TubaDialogsComposerPreferredSizeBin;
typedef struct _TubaDialogsComposerPreferredSizeBinClass TubaDialogsComposerPreferredSizeBinClass;
enum  {
	TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_SAVED_SIGNAL,
	TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_TOAST_SIGNAL,
	TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_NUM_SIGNALS
};
static guint tuba_dialogs_composer_components_attachments_bin_editor_signals[TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_NUM_SIGNALS] = {0};

struct _TubaDialogsComposerComponentsAttachableIface {
	GTypeInterface parent_iface;
	gboolean (*get_edit_mode) (TubaDialogsComposerComponentsAttachable* self);
	void (*set_edit_mode) (TubaDialogsComposerComponentsAttachable* self, gboolean value);
};

struct _TubaDialogsComposerComponentsAttachmentsBin {
	GtkGrid parent_instance;
	TubaDialogsComposerComponentsAttachmentsBinPrivate * priv;
};

struct _TubaDialogsComposerComponentsAttachmentsBinClass {
	GtkGridClass parent_class;
};

struct _TubaDialogsComposerComponentsAttachmentsBinPrivate {
	gboolean _edit_mode;
	gboolean _working;
	GtkFileFilter* filter;
	GeeArrayList* supported_mimes;
	GeeArrayList* attachment_widgets;
};

struct _TubaDialogsComposerComponentsAttachmentsBinMetadata {
	gchar* id;
	gchar* description;
	gchar* focus;
};

struct _TubaDialogsComposerComponentsAttachmentsBinUploadFilesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaDialogsComposerComponentsAttachmentsBin* self;
	GFile** files;
	gint files_length1;
	gint64 allowed_attachments_amount;
	TubaAccountStore* _tmp0_;
	TubaInstanceAccount* _tmp1_;
	TubaInstanceAccount* _tmp2_;
	TubaAPIInstance* _tmp3_;
	TubaAPIInstance* _tmp4_;
	gint64 _tmp5_;
	gint64 _tmp6_;
	GeeArrayList* _tmp7_;
	gint _tmp8_;
	gint _tmp9_;
	gboolean reached_limit;
	GFile** files_for_upload;
	GFile** _tmp10_;
	gint files_for_upload_length1;
	gint _files_for_upload_size_;
	GFile** file_collection;
	gint file_collection_length1;
	gint _file_collection_size_;
	gint file_it;
	GFile* _tmp11_;
	GFile* file;
	TubaAccountStore* _tmp12_;
	TubaInstanceAccount* _tmp13_;
	TubaInstanceAccount* _tmp14_;
	TubaAPIInstance* _tmp15_;
	TubaAPIInstance* _tmp16_;
	gint64 _tmp17_;
	gint64 _tmp18_;
	GFileInfo* file_info;
	GFile* _tmp19_;
	GFileInfo* _tmp20_;
	gchar* file_content_type;
	GFileInfo* _tmp21_;
	const gchar* _tmp22_;
	gchar* _tmp23_;
	const gchar* _tmp24_;
	const gchar* _tmp25_;
	gchar* _tmp26_;
	GeeArrayList* _tmp27_;
	const gchar* _tmp28_;
	gint64 file_size;
	GFileInfo* _tmp29_;
	gboolean _tmp30_;
	gboolean _tmp31_;
	const gchar* _tmp32_;
	TubaAccountStore* _tmp33_;
	TubaInstanceAccount* _tmp34_;
	TubaInstanceAccount* _tmp35_;
	TubaAPIInstance* _tmp36_;
	TubaAPIInstance* _tmp37_;
	gint64 _tmp38_;
	gint64 _tmp39_;
	gboolean _tmp40_;
	const gchar* _tmp41_;
	TubaAccountStore* _tmp42_;
	TubaInstanceAccount* _tmp43_;
	TubaInstanceAccount* _tmp44_;
	TubaAPIInstance* _tmp45_;
	TubaAPIInstance* _tmp46_;
	gint64 _tmp47_;
	gint64 _tmp48_;
	gboolean skip;
	GFile* _tmp49_;
	gchar* _tmp50_;
	gchar* _tmp51_;
	gchar* _tmp52_;
	gchar* _tmp53_;
	AdwToast* _tmp54_;
	AdwToast* _tmp55_;
	GError* e;
	GError* _tmp56_;
	const gchar* _tmp57_;
	GFile* _tmp58_;
	GFile* _tmp59_;
	GFile** _tmp60_;
	gint _tmp60__length1;
	TubaAccountStore* _tmp61_;
	TubaInstanceAccount* _tmp62_;
	TubaInstanceAccount* _tmp63_;
	TubaAPIInstance* _tmp64_;
	TubaAPIInstance* _tmp65_;
	gint64 _tmp66_;
	gint64 _tmp67_;
	gchar* _tmp68_;
	gchar* _tmp69_;
	AdwToast* _tmp70_;
	AdwToast* _tmp71_;
	GFile** _tmp72_;
	gint _tmp72__length1;
	gint i;
	gboolean _tmp73_;
	gint _tmp74_;
	GFile** _tmp75_;
	gint _tmp75__length1;
	GFile* file13;
	GFile** _tmp76_;
	gint _tmp76__length1;
	GFile* _tmp77_;
	GFile* _tmp78_;
	TubaDialogsComposerComponentsAttachment* attachment;
	TubaDialogsComposerComponentsAttachment* _tmp79_;
	TubaDialogsComposerComponentsAttachment* _tmp80_;
	TubaDialogsComposerComponentsAttachment* _tmp81_;
	TubaDialogsComposerComponentsAttachment* _tmp82_;
	TubaDialogsComposerComponentsAttachment* _tmp83_;
	TubaDialogsComposerComponentsAttachment* _tmp84_;
	GFile* _tmp85_;
	GError* _inner_error0_;
};

struct _Block42Data {
	int _ref_count_;
	TubaDialogsComposerComponentsAttachmentsBin* self;
	GtkFileDialog* chooser;
};

struct _TubaDialogsComposerPreferredSizeableIface {
	GTypeInterface parent_iface;
	gint (*get_preferred_height) (TubaDialogsComposerPreferredSizeable* self);
	void (*set_preferred_height) (TubaDialogsComposerPreferredSizeable* self, gint value);
	gint (*get_preferred_width) (TubaDialogsComposerPreferredSizeable* self);
	void (*set_preferred_width) (TubaDialogsComposerPreferredSizeable* self, gint value);
};

struct _TubaDialogsComposerComponentsAttachmentsBinEditor {
	AdwNavigationPage parent_instance;
	TubaDialogsComposerComponentsAttachmentsBinEditorPrivate * priv;
	gint64 alt_max_chars;
};

struct _TubaDialogsComposerComponentsAttachmentsBinEditorClass {
	AdwNavigationPageClass parent_class;
};

struct _TubaDialogsComposerComponentsAttachmentsBinEditorPrivate {
	gint _preferred_height;
	gint _preferred_width;
	gboolean _can_save;
	gboolean _edit_mode;
	gfloat _pos_x;
	gfloat _pos_y;
	gchar* _media_id;
	GtkSourceView* alt_editor;
	TubaDialogsComposerComponentsEditorPlaceholderHack* placeholder;
	GtkBox* content_box;
	GtkLabel* dialog_char_counter;
	gboolean working;
};

typedef enum  {
	TUBA_OOPSIE_USER,
	TUBA_OOPSIE_PARSING,
	TUBA_OOPSIE_INSTANCE,
	TUBA_OOPSIE_INTERNAL,
	TUBA_OOPSIE_HTTP_401 = 401,
	TUBA_OOPSIE_HTTP_403 = 403,
	TUBA_OOPSIE_HTTP_404 = 404,
	TUBA_OOPSIE_HTTP_410 = 410,
	TUBA_OOPSIE_HTTP_422 = 422,
	TUBA_OOPSIE_HTTP_429 = 429,
	TUBA_OOPSIE_HTTP_500 = 500,
	TUBA_OOPSIE_HTTP_503 = 503
} TubaOopsie;
#define TUBA_OOPSIE tuba_oopsie_quark ()

struct _TubaDialogsComposerComponentsAttachmentsBinEditorPutAltTextData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaDialogsComposerComponentsAttachmentsBinEditor* self;
	JsonBuilder* builder;
	JsonBuilder* _tmp0_;
	GtkSourceView* _tmp1_;
	GtkTextBuffer* _tmp2_;
	GtkTextBuffer* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gfloat _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gfloat _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	TubaRequestV2* req;
	const gchar* _tmp15_;
	const gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	TubaAccountStore* _tmp19_;
	TubaInstanceAccount* _tmp20_;
	TubaInstanceAccount* _tmp21_;
	TubaInstanceAccount* _tmp22_;
	TubaRequestV2* _tmp23_;
	TubaRequestV2* _tmp24_;
	GInputStream* _tmp25_;
	GInputStream* _tmp26_;
	gfloat _tmp27_;
	gfloat _tmp28_;
	GtkSourceView* _tmp29_;
	GtkTextBuffer* _tmp30_;
	GtkTextBuffer* _tmp31_;
	gchar* _tmp32_;
	gchar* _tmp33_;
	gchar* _tmp34_;
	AdwToast* _tmp35_;
	AdwToast* _tmp36_;
	GError* e;
	GError* _tmp37_;
	gchar* _tmp38_;
	gchar* _tmp39_;
	GError* _tmp40_;
	const gchar* _tmp41_;
	const gchar* _tmp42_;
	gchar* _tmp43_;
	gchar* _tmp44_;
	AdwToast* _tmp45_;
	AdwToast* _tmp46_;
	GError* _inner_error0_;
};

static gint TubaDialogsComposerComponentsAttachmentsBin_private_offset;
static gpointer tuba_dialogs_composer_components_attachments_bin_parent_class = NULL;
VALA_EXTERN TubaAccountStore* tuba_accounts;
VALA_EXTERN TubaApplication* tuba_app;
static gint TubaDialogsComposerComponentsAttachmentsBinEditor_private_offset;
static gpointer tuba_dialogs_composer_components_attachments_bin_editor_parent_class = NULL;
static TubaDialogsComposerPreferredSizeableIface * tuba_dialogs_composer_components_attachments_bin_editor_tuba_dialogs_composer_preferred_sizeable_parent_iface = NULL;
static TubaDialogsComposerComponentsAttachableIface * tuba_dialogs_composer_components_attachments_bin_tuba_dialogs_composer_components_attachable_parent_iface = NULL;

VALA_EXTERN GType tuba_dialogs_composer_components_attachable_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaDialogsComposerComponentsAttachable, g_object_unref)
VALA_EXTERN GType tuba_dialogs_composer_components_attachments_bin_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaDialogsComposerComponentsAttachmentsBin, g_object_unref)
VALA_EXTERN GType tuba_dialogs_composer_components_attachment_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaDialogsComposerComponentsAttachment, g_object_unref)
VALA_EXTERN void tuba_dialogs_composer_components_attachment_cleanup (TubaDialogsComposerComponentsAttachment* self);
static gchar** _vala_array_dup24 (gchar** self,
                           gssize length);
VALA_EXTERN gchar** tuba_dialogs_composer_components_attachments_bin_get_all_media_ids (TubaDialogsComposerComponentsAttachmentsBin* self,
                                                                            gint* result_length1);
VALA_EXTERN const gchar* tuba_dialogs_composer_components_attachment_get_media_id (TubaDialogsComposerComponentsAttachment* self);
static void _vala_array_add43 (gchar** * array,
                        gint* length,
                        gint* size,
                        gchar* value);
VALA_EXTERN GType tuba_dialogs_composer_components_attachments_bin_metadata_get_type (void) G_GNUC_CONST ;
VALA_EXTERN TubaDialogsComposerComponentsAttachmentsBinMetadata* tuba_dialogs_composer_components_attachments_bin_metadata_dup (const TubaDialogsComposerComponentsAttachmentsBinMetadata* self);
VALA_EXTERN void tuba_dialogs_composer_components_attachments_bin_metadata_free (TubaDialogsComposerComponentsAttachmentsBinMetadata* self);
VALA_EXTERN void tuba_dialogs_composer_components_attachments_bin_metadata_copy (const TubaDialogsComposerComponentsAttachmentsBinMetadata* self,
                                                                     TubaDialogsComposerComponentsAttachmentsBinMetadata* dest);
VALA_EXTERN void tuba_dialogs_composer_components_attachments_bin_metadata_destroy (TubaDialogsComposerComponentsAttachmentsBinMetadata* self);
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (TubaDialogsComposerComponentsAttachmentsBinMetadata, tuba_dialogs_composer_components_attachments_bin_metadata_destroy)
VALA_EXTERN TubaDialogsComposerComponentsAttachmentsBinMetadata* tuba_dialogs_composer_components_attachments_bin_get_all_metadata (TubaDialogsComposerComponentsAttachmentsBin* self,
                                                                                                                        gint* result_length1);
VALA_EXTERN const gchar* tuba_dialogs_composer_components_attachment_get_alt_text (TubaDialogsComposerComponentsAttachment* self);
VALA_EXTERN gchar* tuba_utils_units_float_to_2_point_string (gfloat unit);
VALA_EXTERN gdouble tuba_dialogs_composer_components_attachment_get_pos_x (TubaDialogsComposerComponentsAttachment* self);
VALA_EXTERN gdouble tuba_dialogs_composer_components_attachment_get_pos_y (TubaDialogsComposerComponentsAttachment* self);
static void _vala_array_add44 (TubaDialogsComposerComponentsAttachmentsBinMetadata* * array,
                        gint* length,
                        gint* size,
                        const TubaDialogsComposerComponentsAttachmentsBinMetadata* value);
static void tuba_dialogs_composer_components_attachments_bin_add_attachment (TubaDialogsComposerComponentsAttachmentsBin* self,
                                                                      TubaDialogsComposerComponentsAttachment* attachment);
static void tuba_dialogs_composer_components_attachments_bin_on_switch_place (TubaDialogsComposerComponentsAttachmentsBin* self,
                                                                       TubaDialogsComposerComponentsAttachment* from,
                                                                       TubaDialogsComposerComponentsAttachment* to);
static void _tuba_dialogs_composer_components_attachments_bin_on_switch_place_tuba_dialogs_composer_components_attachment_switch_place (TubaDialogsComposerComponentsAttachment* _sender,
                                                                                                                                 TubaDialogsComposerComponentsAttachment* with,
                                                                                                                                 gpointer self);
static void tuba_dialogs_composer_components_attachments_bin_on_delete (TubaDialogsComposerComponentsAttachmentsBin* self,
                                                                 TubaDialogsComposerComponentsAttachment* attachment);
static void _tuba_dialogs_composer_components_attachments_bin_on_delete_tuba_dialogs_composer_components_attachment_delete_me (TubaDialogsComposerComponentsAttachment* _sender,
                                                                                                                        gpointer self);
VALA_EXTERN void tuba_dialogs_composer_components_attachments_bin_show_editor (TubaDialogsComposerComponentsAttachmentsBin* self,
                                                                   TubaDialogsComposerComponentsAttachment* attachment);
static void _tuba_dialogs_composer_components_attachments_bin_show_editor_tuba_dialogs_composer_components_attachment_edit (TubaDialogsComposerComponentsAttachment* _sender,
                                                                                                                     gpointer self);
VALA_EXTERN void tuba_dialogs_composer_components_attachment_play_animation (TubaDialogsComposerComponentsAttachment* self,
                                                                 gboolean reverse);
static void tuba_dialogs_composer_components_attachments_bin_on_attachment_done (TubaDialogsComposerComponentsAttachmentsBin* self);
static void tuba_dialogs_composer_components_attachments_bin_populate_filter (TubaDialogsComposerComponentsAttachmentsBin* 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_entity_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaEntity, 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 GType tuba_api_mastodon_configurations_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIMastodonConfigurations, g_object_unref)
VALA_EXTERN TubaAPIMastodonConfigurations* tuba_api_instance_get_configuration (TubaAPIInstance* self);
VALA_EXTERN GType tuba_api_mastodon_configuration_media_attachments_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIMastodonConfigurationMediaAttachments, g_object_unref)
VALA_EXTERN TubaAPIMastodonConfigurationMediaAttachments* tuba_api_mastodon_configurations_get_media_attachments (TubaAPIMastodonConfigurations* self);
VALA_EXTERN GeeArrayList* tuba_api_mastodon_configuration_media_attachments_get_supported_mime_types (TubaAPIMastodonConfigurationMediaAttachments* self);
static void tuba_dialogs_composer_components_attachments_bin_upload_files_data_free (gpointer _data);
VALA_EXTERN void tuba_dialogs_composer_components_attachments_bin_upload_files (TubaDialogsComposerComponentsAttachmentsBin* self,
                                                                    GFile** files,
                                                                    gint files_length1,
                                                                    GAsyncReadyCallback _callback_,
                                                                    gpointer _user_data_);
VALA_EXTERN void tuba_dialogs_composer_components_attachments_bin_upload_files_finish (TubaDialogsComposerComponentsAttachmentsBin* self,
                                                                           GAsyncResult* _res_);
static gboolean tuba_dialogs_composer_components_attachments_bin_upload_files_co (TubaDialogsComposerComponentsAttachmentsBinUploadFilesData* _data_);
VALA_EXTERN gint64 tuba_api_instance_get_compat_status_max_media_attachments (TubaAPIInstance* self);
VALA_EXTERN gint64 tuba_api_instance_get_compat_status_max_image_size (TubaAPIInstance* self);
VALA_EXTERN gint64 tuba_api_instance_get_compat_status_max_video_size (TubaAPIInstance* self);
static void _vala_array_add45 (GFile** * array,
                        gint* length,
                        gint* size,
                        GFile* value);
VALA_EXTERN void tuba_dialogs_composer_components_attachments_bin_set_working (TubaDialogsComposerComponentsAttachmentsBin* self,
                                                                   gboolean value);
VALA_EXTERN TubaDialogsComposerComponentsAttachment* tuba_dialogs_composer_components_attachment_new (void);
VALA_EXTERN TubaDialogsComposerComponentsAttachment* tuba_dialogs_composer_components_attachment_construct (GType object_type);
static void tuba_dialogs_composer_components_attachments_bin_on_upload_error (TubaDialogsComposerComponentsAttachmentsBin* self,
                                                                       TubaDialogsComposerComponentsAttachment* attachment,
                                                                       const gchar* message);
static void _tuba_dialogs_composer_components_attachments_bin_on_upload_error_tuba_dialogs_composer_components_attachment_upload_error (TubaDialogsComposerComponentsAttachment* _sender,
                                                                                                                                 const gchar* message,
                                                                                                                                 gpointer self);
static void tuba_dialogs_composer_components_attachments_bin_on_toast (TubaDialogsComposerComponentsAttachmentsBin* self,
                                                                const gchar* message);
static void _tuba_dialogs_composer_components_attachments_bin_on_toast_tuba_dialogs_composer_components_attachment_toast (TubaDialogsComposerComponentsAttachment* _sender,
                                                                                                                   const gchar* message,
                                                                                                                   gpointer self);
static void _tuba_dialogs_composer_components_attachments_bin_on_attachment_done_g_object_notify (GObject* _sender,
                                                                                           GParamSpec* pspec,
                                                                                           gpointer self);
VALA_EXTERN void tuba_dialogs_composer_components_attachment_upload (TubaDialogsComposerComponentsAttachment* self,
                                                         GFile* file,
                                                         GAsyncReadyCallback _callback_,
                                                         gpointer _user_data_);
VALA_EXTERN void tuba_dialogs_composer_components_attachment_upload_finish (TubaDialogsComposerComponentsAttachment* self,
                                                                GAsyncResult* _res_);
VALA_EXTERN gboolean tuba_dialogs_composer_components_attachment_get_done (TubaDialogsComposerComponentsAttachment* self);
VALA_EXTERN void tuba_dialogs_composer_components_attachments_bin_show_file_selector (TubaDialogsComposerComponentsAttachmentsBin* self);
static Block42Data* block42_data_ref (Block42Data* _data42_);
static void block42_data_unref (void * _userdata_);
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);
static void __lambda73_ (Block42Data* _data42_,
                  GObject* obj,
                  GAsyncResult* res);
static void _vala_array_add46 (GFile** * array,
                        gint* length,
                        gint* size,
                        GFile* value);
static GFile** _vala_array_dup25 (GFile** self,
                           gssize length);
static void ___lambda73__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
VALA_EXTERN GType tuba_api_attachment_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAttachment, g_object_unref)
VALA_EXTERN void tuba_dialogs_composer_components_attachments_bin_preload_attachment (TubaDialogsComposerComponentsAttachmentsBin* self,
                                                                          TubaAPIAttachment* api_attachment,
                                                                          gboolean edit_mode);
VALA_EXTERN GType tuba_dialogs_composer_components_attachment_media_type_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void tuba_dialogs_composer_components_attachment_preload (TubaDialogsComposerComponentsAttachment* self,
                                                          const gchar* media_id,
                                                          const gchar* url,
                                                          const gchar* preview,
                                                          TubaDialogsComposerComponentsAttachmentMediaType kind);
VALA_EXTERN const gchar* tuba_api_attachment_get_id (TubaAPIAttachment* self);
VALA_EXTERN const gchar* tuba_api_attachment_get_url (TubaAPIAttachment* self);
VALA_EXTERN const gchar* tuba_api_attachment_get_preview_url (TubaAPIAttachment* self);
VALA_EXTERN TubaDialogsComposerComponentsAttachmentMediaType tuba_dialogs_composer_components_attachment_media_type_from_string (const gchar* kind);
VALA_EXTERN const gchar* tuba_api_attachment_get_kind (TubaAPIAttachment* self);
VALA_EXTERN void tuba_dialogs_composer_components_attachment_set_edit_mode (TubaDialogsComposerComponentsAttachment* self,
                                                                gboolean value);
VALA_EXTERN GType tuba_api_attachment_meta_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAttachmentMeta, g_object_unref)
VALA_EXTERN TubaAPIAttachmentMeta* tuba_api_attachment_get_meta (TubaAPIAttachment* self);
VALA_EXTERN GType tuba_api_attachment_meta_focus_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAttachmentMetaFocus, g_object_unref)
VALA_EXTERN TubaAPIAttachmentMetaFocus* tuba_api_attachment_meta_get_focus (TubaAPIAttachmentMeta* self);
VALA_EXTERN gfloat tuba_api_attachment_meta_focus_get_x (TubaAPIAttachmentMetaFocus* self);
VALA_EXTERN gfloat tuba_api_attachment_meta_focus_get_y (TubaAPIAttachmentMetaFocus* self);
VALA_EXTERN const gchar* tuba_api_attachment_get_description (TubaAPIAttachment* self);
VALA_EXTERN void tuba_dialogs_composer_components_attachment_saved (TubaDialogsComposerComponentsAttachment* self,
                                                        gfloat pos_x,
                                                        gfloat pos_y,
                                                        const gchar* alt_text);
VALA_EXTERN TubaDialogsComposerComponentsAttachmentMediaType tuba_dialogs_composer_components_attachment_get_kind (TubaDialogsComposerComponentsAttachment* self);
VALA_EXTERN GdkPaintable* tuba_dialogs_composer_components_attachment_get_paintable (TubaDialogsComposerComponentsAttachment* self);
VALA_EXTERN GFile* tuba_dialogs_composer_components_attachment_get_file (TubaDialogsComposerComponentsAttachment* self);
static GType tuba_dialogs_composer_components_attachments_bin_editor_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaDialogsComposerComponentsAttachmentsBinEditor, g_object_unref)
VALA_EXTERN gboolean tuba_dialogs_composer_components_attachment_get_edit_mode (TubaDialogsComposerComponentsAttachment* self);
static TubaDialogsComposerComponentsAttachmentsBinEditor* tuba_dialogs_composer_components_attachments_bin_editor_new (const gchar* media_id,
                                                                                                                GdkPaintable* paintable,
                                                                                                                GFile* video,
                                                                                                                gfloat pos_x,
                                                                                                                gfloat pos_y,
                                                                                                                const gchar* alt_text,
                                                                                                                gboolean edit_mode);
static TubaDialogsComposerComponentsAttachmentsBinEditor* tuba_dialogs_composer_components_attachments_bin_editor_construct (GType object_type,
                                                                                                                      const gchar* media_id,
                                                                                                                      GdkPaintable* paintable,
                                                                                                                      GFile* video,
                                                                                                                      gfloat pos_x,
                                                                                                                      gfloat pos_y,
                                                                                                                      const gchar* alt_text,
                                                                                                                      gboolean edit_mode);
static void _tuba_dialogs_composer_components_attachment_saved_tuba_dialogs_composer_components_attachments_bin_editor_saved (TubaDialogsComposerComponentsAttachmentsBinEditor* _sender,
                                                                                                                       gfloat pos_x,
                                                                                                                       gfloat pos_y,
                                                                                                                       const gchar* alt_text,
                                                                                                                       gpointer self);
static void tuba_dialogs_composer_components_attachments_bin_pop_req (TubaDialogsComposerComponentsAttachmentsBin* self);
static void _tuba_dialogs_composer_components_attachments_bin_pop_req_tuba_dialogs_composer_components_attachments_bin_editor_saved (TubaDialogsComposerComponentsAttachmentsBinEditor* _sender,
                                                                                                                              gfloat pos_x,
                                                                                                                              gfloat pos_y,
                                                                                                                              const gchar* alt_text,
                                                                                                                              gpointer self);
static void tuba_dialogs_composer_components_attachments_bin_toast_req (TubaDialogsComposerComponentsAttachmentsBin* self,
                                                                 AdwToast* toast_obj);
static void _tuba_dialogs_composer_components_attachments_bin_toast_req_tuba_dialogs_composer_components_attachments_bin_editor_toast (TubaDialogsComposerComponentsAttachmentsBinEditor* _sender,
                                                                                                                                AdwToast* toast,
                                                                                                                                gpointer self);
VALA_EXTERN TubaDialogsComposerComponentsAttachmentsBin* tuba_dialogs_composer_components_attachments_bin_new (void);
VALA_EXTERN TubaDialogsComposerComponentsAttachmentsBin* tuba_dialogs_composer_components_attachments_bin_construct (GType object_type);
VALA_EXTERN gboolean tuba_dialogs_composer_components_attachments_bin_get_working (TubaDialogsComposerComponentsAttachmentsBin* self);
VALA_EXTERN gboolean tuba_dialogs_composer_components_attachments_bin_get_is_empty (TubaDialogsComposerComponentsAttachmentsBin* self);
VALA_EXTERN gboolean tuba_dialogs_composer_components_attachments_bin_get_can_add_media (TubaDialogsComposerComponentsAttachmentsBin* self);
VALA_EXTERN GType tuba_dialogs_composer_preferred_sizeable_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaDialogsComposerPreferredSizeable, g_object_unref)
VALA_EXTERN GType tuba_dialogs_composer_components_editor_placeholder_hack_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaDialogsComposerComponentsEditorPlaceholderHack, g_object_unref)
VALA_EXTERN gint64 tuba_api_instance_get_tuba_max_alt_chars (TubaAPIInstance* self);
static void tuba_dialogs_composer_components_attachments_bin_editor_on_alt_editor_buffer_change (TubaDialogsComposerComponentsAttachmentsBinEditor* self);
VALA_EXTERN gint tuba_utils_counting_chars (const gchar* content,
                                const gchar* language);
static void tuba_dialogs_composer_components_attachments_bin_editor_set_can_save (TubaDialogsComposerComponentsAttachmentsBinEditor* self,
                                                                           gboolean value);
static void tuba_dialogs_composer_components_attachments_bin_editor_update_style_scheme (TubaDialogsComposerComponentsAttachmentsBinEditor* self);
static void tuba_dialogs_composer_components_attachments_bin_editor_on_save (TubaDialogsComposerComponentsAttachmentsBinEditor* self);
static gboolean tuba_dialogs_composer_components_attachments_bin_editor_get_edit_mode (TubaDialogsComposerComponentsAttachmentsBinEditor* self);
static gfloat tuba_dialogs_composer_components_attachments_bin_editor_get_pos_x (TubaDialogsComposerComponentsAttachmentsBinEditor* self);
static gfloat tuba_dialogs_composer_components_attachments_bin_editor_get_pos_y (TubaDialogsComposerComponentsAttachmentsBinEditor* self);
static void tuba_dialogs_composer_components_attachments_bin_editor_put_alt_text (TubaDialogsComposerComponentsAttachmentsBinEditor* self,
                                                                           GAsyncReadyCallback _callback_,
                                                                           gpointer _user_data_);
static void tuba_dialogs_composer_components_attachments_bin_editor_put_alt_text_finish (TubaDialogsComposerComponentsAttachmentsBinEditor* self,
                                                                                  GAsyncResult* _res_);
static void tuba_dialogs_composer_components_attachments_bin_editor_put_alt_text_data_free (gpointer _data);
static gboolean tuba_dialogs_composer_components_attachments_bin_editor_put_alt_text_co (TubaDialogsComposerComponentsAttachmentsBinEditorPutAltTextData* _data_);
VALA_EXTERN GType tuba_request_v2_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaRequestV2, g_object_unref)
static const gchar* tuba_dialogs_composer_components_attachments_bin_editor_get_media_id (TubaDialogsComposerComponentsAttachmentsBinEditor* self);
VALA_EXTERN GType tuba_request_v2_method_get_type (void) G_GNUC_CONST ;
VALA_EXTERN TubaRequestV2* tuba_request_v2_new (const gchar* url,
                                    TubaRequestV2Method method);
VALA_EXTERN TubaRequestV2* tuba_request_v2_construct (GType object_type,
                                          const gchar* url,
                                          TubaRequestV2Method method);
VALA_EXTERN void tuba_request_v2_set_account (TubaRequestV2* self,
                                  TubaInstanceAccount* value);
VALA_EXTERN void tuba_request_v2_set_body_from_json (TubaRequestV2* self,
                                         JsonBuilder* json_builder);
VALA_EXTERN void tuba_request_v2_exec (TubaRequestV2* self,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_);
VALA_EXTERN GQuark tuba_oopsie_quark (void);
VALA_EXTERN GType tuba_oopsie_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GInputStream* tuba_request_v2_exec_finish (TubaRequestV2* self,
                                           GAsyncResult* _res_,
                                           SoupMessageHeaders** response_headers,
                                           GError** error);
static void tuba_dialogs_composer_components_attachments_bin_editor_put_alt_text_ready (GObject* source_object,
                                                                                 GAsyncResult* _res_,
                                                                                 gpointer _user_data_);
static void tuba_dialogs_composer_components_attachments_bin_editor_set_media_id (TubaDialogsComposerComponentsAttachmentsBinEditor* self,
                                                                           const gchar* value);
static void tuba_dialogs_composer_components_attachments_bin_editor_set_edit_mode (TubaDialogsComposerComponentsAttachmentsBinEditor* self,
                                                                            gboolean value);
VALA_EXTERN GType tuba_widgets_focus_picker_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsFocusPicker, g_object_unref)
VALA_EXTERN TubaWidgetsFocusPicker* tuba_widgets_focus_picker_new (GdkPaintable* paintable);
VALA_EXTERN TubaWidgetsFocusPicker* tuba_widgets_focus_picker_construct (GType object_type,
                                                             GdkPaintable* paintable);
static void tuba_dialogs_composer_components_attachments_bin_editor_set_pos_x (TubaDialogsComposerComponentsAttachmentsBinEditor* self,
                                                                        gfloat value);
static void tuba_dialogs_composer_components_attachments_bin_editor_set_pos_y (TubaDialogsComposerComponentsAttachmentsBinEditor* self,
                                                                        gfloat value);
static gboolean tuba_dialogs_composer_components_attachments_bin_editor_get_can_save (TubaDialogsComposerComponentsAttachmentsBinEditor* self);
static void g_cclosure_user_marshal_VOID__FLOAT_FLOAT_STRING (GClosure * closure,
                                                       GValue * return_value,
                                                       guint n_param_values,
                                                       const GValue * param_values,
                                                       gpointer invocation_hint,
                                                       gpointer marshal_data);
static GObject * tuba_dialogs_composer_components_attachments_bin_editor_constructor (GType type,
                                                                               guint n_construct_properties,
                                                                               GObjectConstructParam * construct_properties);
VALA_EXTERN TubaDialogsComposerComponentsEditorPlaceholderHack* tuba_dialogs_composer_components_editor_placeholder_hack_new (GtkLabel* label);
VALA_EXTERN TubaDialogsComposerComponentsEditorPlaceholderHack* tuba_dialogs_composer_components_editor_placeholder_hack_construct (GType object_type,
                                                                                                                        GtkLabel* label);
static void _tuba_dialogs_composer_components_attachments_bin_editor_update_style_scheme_g_object_notify (GObject* _sender,
                                                                                                   GParamSpec* pspec,
                                                                                                   gpointer self);
static void _tuba_dialogs_composer_components_attachments_bin_editor_on_alt_editor_buffer_change_gtk_text_buffer_changed (GtkTextBuffer* _sender,
                                                                                                                   gpointer self);
VALA_EXTERN GType tuba_dialogs_composer_preferred_size_bin_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaDialogsComposerPreferredSizeBin, g_object_unref)
VALA_EXTERN TubaDialogsComposerPreferredSizeBin* tuba_dialogs_composer_preferred_size_bin_new (void);
VALA_EXTERN TubaDialogsComposerPreferredSizeBin* tuba_dialogs_composer_preferred_size_bin_construct (GType object_type);
VALA_EXTERN void tuba_dialogs_composer_preferred_size_bin_set_child (TubaDialogsComposerPreferredSizeBin* self,
                                                         GtkWidget* value);
static void _tuba_dialogs_composer_components_attachments_bin_editor_on_save_adw_navigation_page_hidden (AdwNavigationPage* _sender,
                                                                                                  gpointer self);
VALA_EXTERN gint tuba_dialogs_composer_preferred_sizeable_get_preferred_height (TubaDialogsComposerPreferredSizeable* self);
VALA_EXTERN void tuba_dialogs_composer_preferred_sizeable_set_preferred_height (TubaDialogsComposerPreferredSizeable* self,
                                                                    gint value);
VALA_EXTERN gint tuba_dialogs_composer_preferred_sizeable_get_preferred_width (TubaDialogsComposerPreferredSizeable* self);
VALA_EXTERN void tuba_dialogs_composer_preferred_sizeable_set_preferred_width (TubaDialogsComposerPreferredSizeable* self,
                                                                   gint value);
static void tuba_dialogs_composer_components_attachments_bin_editor_finalize (GObject * obj);
static GType tuba_dialogs_composer_components_attachments_bin_editor_get_type_once (void);
static void _vala_tuba_dialogs_composer_components_attachments_bin_editor_get_property (GObject * object,
                                                                                 guint property_id,
                                                                                 GValue * value,
                                                                                 GParamSpec * pspec);
static void _vala_tuba_dialogs_composer_components_attachments_bin_editor_set_property (GObject * object,
                                                                                 guint property_id,
                                                                                 const GValue * value,
                                                                                 GParamSpec * pspec);
static GObject * tuba_dialogs_composer_components_attachments_bin_constructor (GType type,
                                                                        guint n_construct_properties,
                                                                        GObjectConstructParam * construct_properties);
VALA_EXTERN gboolean tuba_dialogs_composer_components_attachable_get_edit_mode (TubaDialogsComposerComponentsAttachable* self);
VALA_EXTERN void tuba_dialogs_composer_components_attachable_set_edit_mode (TubaDialogsComposerComponentsAttachable* self,
                                                                gboolean value);
static void tuba_dialogs_composer_components_attachments_bin_finalize (GObject * obj);
static GType tuba_dialogs_composer_components_attachments_bin_get_type_once (void);
static void _vala_tuba_dialogs_composer_components_attachments_bin_get_property (GObject * object,
                                                                          guint property_id,
                                                                          GValue * value,
                                                                          GParamSpec * pspec);
static void _vala_tuba_dialogs_composer_components_attachments_bin_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);

const gchar* TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_SUPPORTED_MIMES[28] = {"image/jpeg", "image/png", "image/gif", "image/heic", "image/heif", "image/webp", "image/avif", "audio/wave", "audio/wav", "audio/x-wav", "audio/x-pn-wave", "audio/vnd.wave", "audio/ogg", "audio/vorbis", "audio/mpeg", "audio/mp3", "audio/webm", "audio/flac", "audio/aac", "audio/m4a", "audio/x-m4a", "audio/mp4", "audio/3gpp", "video/x-ms-asf", "video/quicktime", "video/webm", "video/mp4", "video/ogg"};

static inline gpointer
tuba_dialogs_composer_components_attachments_bin_get_instance_private (TubaDialogsComposerComponentsAttachmentsBin* self)
{
	return G_STRUCT_MEMBER_P (self, TubaDialogsComposerComponentsAttachmentsBin_private_offset);
}

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

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

gchar**
tuba_dialogs_composer_components_attachments_bin_get_all_media_ids (TubaDialogsComposerComponentsAttachmentsBin* self,
                                                                    gint* result_length1)
{
	gchar** _result_ = NULL;
	gchar** _tmp0_;
	gint _result__length1;
	gint __result__size_;
	gchar** _tmp16_;
	gint _tmp16__length1;
	gchar** result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_new0 (gchar*, 0 + 1);
	_result_ = _tmp0_;
	_result__length1 = 0;
	__result__size_ = _result__length1;
	{
		GeeArrayList* _attachment_list = NULL;
		GeeArrayList* _tmp1_;
		gint _attachment_size = 0;
		GeeArrayList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _attachment_index = 0;
		_tmp1_ = self->priv->attachment_widgets;
		_attachment_list = _tmp1_;
		_tmp2_ = _attachment_list;
		_tmp3_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_attachment_size = _tmp4_;
		_attachment_index = -1;
		while (TRUE) {
			gint _tmp5_;
			gint _tmp6_;
			TubaDialogsComposerComponentsAttachment* attachment = NULL;
			GeeArrayList* _tmp7_;
			gpointer _tmp8_;
			TubaDialogsComposerComponentsAttachment* _tmp9_;
			const gchar* _tmp10_;
			const gchar* _tmp11_;
			_attachment_index = _attachment_index + 1;
			_tmp5_ = _attachment_index;
			_tmp6_ = _attachment_size;
			if (!(_tmp5_ < _tmp6_)) {
				break;
			}
			_tmp7_ = _attachment_list;
			_tmp8_ = gee_abstract_list_get ((GeeAbstractList*) _tmp7_, _attachment_index);
			attachment = (TubaDialogsComposerComponentsAttachment*) _tmp8_;
			_tmp9_ = attachment;
			_tmp10_ = tuba_dialogs_composer_components_attachment_get_media_id (_tmp9_);
			_tmp11_ = _tmp10_;
			if (_tmp11_ != NULL) {
				TubaDialogsComposerComponentsAttachment* _tmp12_;
				const gchar* _tmp13_;
				const gchar* _tmp14_;
				gchar* _tmp15_;
				_tmp12_ = attachment;
				_tmp13_ = tuba_dialogs_composer_components_attachment_get_media_id (_tmp12_);
				_tmp14_ = _tmp13_;
				_tmp15_ = g_strdup (_tmp14_);
				_vala_array_add43 (&_result_, &_result__length1, &__result__size_, _tmp15_);
			}
			_g_object_unref0 (attachment);
		}
	}
	_tmp16_ = _result_;
	_tmp16__length1 = _result__length1;
	if (result_length1) {
		*result_length1 = _tmp16__length1;
	}
	result = _tmp16_;
	return result;
}

static void
_vala_array_add44 (TubaDialogsComposerComponentsAttachmentsBinMetadata* * array,
                   gint* length,
                   gint* size,
                   const TubaDialogsComposerComponentsAttachmentsBinMetadata* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (TubaDialogsComposerComponentsAttachmentsBinMetadata, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

TubaDialogsComposerComponentsAttachmentsBinMetadata*
tuba_dialogs_composer_components_attachments_bin_get_all_metadata (TubaDialogsComposerComponentsAttachmentsBin* self,
                                                                   gint* result_length1)
{
	TubaDialogsComposerComponentsAttachmentsBinMetadata* _result_ = NULL;
	TubaDialogsComposerComponentsAttachmentsBinMetadata* _tmp0_;
	gint _result__length1;
	gint __result__size_;
	TubaDialogsComposerComponentsAttachmentsBinMetadata* _tmp32_;
	gint _tmp32__length1;
	TubaDialogsComposerComponentsAttachmentsBinMetadata* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_new0 (TubaDialogsComposerComponentsAttachmentsBinMetadata, 0);
	_result_ = _tmp0_;
	_result__length1 = 0;
	__result__size_ = _result__length1;
	{
		GeeArrayList* _attachment_list = NULL;
		GeeArrayList* _tmp1_;
		gint _attachment_size = 0;
		GeeArrayList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _attachment_index = 0;
		_tmp1_ = self->priv->attachment_widgets;
		_attachment_list = _tmp1_;
		_tmp2_ = _attachment_list;
		_tmp3_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_attachment_size = _tmp4_;
		_attachment_index = -1;
		while (TRUE) {
			gint _tmp5_;
			gint _tmp6_;
			TubaDialogsComposerComponentsAttachment* attachment = NULL;
			GeeArrayList* _tmp7_;
			gpointer _tmp8_;
			TubaDialogsComposerComponentsAttachment* _tmp9_;
			const gchar* _tmp10_;
			const gchar* _tmp11_;
			_attachment_index = _attachment_index + 1;
			_tmp5_ = _attachment_index;
			_tmp6_ = _attachment_size;
			if (!(_tmp5_ < _tmp6_)) {
				break;
			}
			_tmp7_ = _attachment_list;
			_tmp8_ = gee_abstract_list_get ((GeeAbstractList*) _tmp7_, _attachment_index);
			attachment = (TubaDialogsComposerComponentsAttachment*) _tmp8_;
			_tmp9_ = attachment;
			_tmp10_ = tuba_dialogs_composer_components_attachment_get_media_id (_tmp9_);
			_tmp11_ = _tmp10_;
			if (_tmp11_ != NULL) {
				TubaDialogsComposerComponentsAttachment* _tmp12_;
				const gchar* _tmp13_;
				const gchar* _tmp14_;
				gchar* _tmp15_;
				TubaDialogsComposerComponentsAttachment* _tmp16_;
				const gchar* _tmp17_;
				const gchar* _tmp18_;
				gchar* _tmp19_;
				TubaDialogsComposerComponentsAttachment* _tmp20_;
				gdouble _tmp21_;
				gdouble _tmp22_;
				gchar* _tmp23_;
				gchar* _tmp24_;
				TubaDialogsComposerComponentsAttachment* _tmp25_;
				gdouble _tmp26_;
				gdouble _tmp27_;
				gchar* _tmp28_;
				gchar* _tmp29_;
				gchar* _tmp30_;
				TubaDialogsComposerComponentsAttachmentsBinMetadata _tmp31_ = {0};
				_tmp12_ = attachment;
				_tmp13_ = tuba_dialogs_composer_components_attachment_get_media_id (_tmp12_);
				_tmp14_ = _tmp13_;
				_tmp15_ = g_strdup (_tmp14_);
				_tmp16_ = attachment;
				_tmp17_ = tuba_dialogs_composer_components_attachment_get_alt_text (_tmp16_);
				_tmp18_ = _tmp17_;
				_tmp19_ = g_strdup (_tmp18_);
				_tmp20_ = attachment;
				_tmp21_ = tuba_dialogs_composer_components_attachment_get_pos_x (_tmp20_);
				_tmp22_ = _tmp21_;
				_tmp23_ = tuba_utils_units_float_to_2_point_string ((gfloat) _tmp22_);
				_tmp24_ = _tmp23_;
				_tmp25_ = attachment;
				_tmp26_ = tuba_dialogs_composer_components_attachment_get_pos_y (_tmp25_);
				_tmp27_ = _tmp26_;
				_tmp28_ = tuba_utils_units_float_to_2_point_string ((gfloat) _tmp27_);
				_tmp29_ = _tmp28_;
				_tmp30_ = g_strdup_printf ("%s,%s", _tmp24_, _tmp29_);
				memset (&_tmp31_, 0, sizeof (TubaDialogsComposerComponentsAttachmentsBinMetadata));
				_g_free0 (_tmp31_.id);
				_tmp31_.id = _tmp15_;
				_g_free0 (_tmp31_.description);
				_tmp31_.description = _tmp19_;
				_g_free0 (_tmp31_.focus);
				_tmp31_.focus = _tmp30_;
				_vala_array_add44 (&_result_, &_result__length1, &__result__size_, &_tmp31_);
				_g_free0 (_tmp29_);
				_g_free0 (_tmp24_);
			}
			_g_object_unref0 (attachment);
		}
	}
	_tmp32_ = _result_;
	_tmp32__length1 = _result__length1;
	if (result_length1) {
		*result_length1 = _tmp32__length1;
	}
	result = _tmp32_;
	return result;
}

static void
_tuba_dialogs_composer_components_attachments_bin_on_switch_place_tuba_dialogs_composer_components_attachment_switch_place (TubaDialogsComposerComponentsAttachment* _sender,
                                                                                                                            TubaDialogsComposerComponentsAttachment* with,
                                                                                                                            gpointer self)
{
	tuba_dialogs_composer_components_attachments_bin_on_switch_place ((TubaDialogsComposerComponentsAttachmentsBin*) self, _sender, with);
}

static void
_tuba_dialogs_composer_components_attachments_bin_on_delete_tuba_dialogs_composer_components_attachment_delete_me (TubaDialogsComposerComponentsAttachment* _sender,
                                                                                                                   gpointer self)
{
	tuba_dialogs_composer_components_attachments_bin_on_delete ((TubaDialogsComposerComponentsAttachmentsBin*) self, _sender);
}

static void
_tuba_dialogs_composer_components_attachments_bin_show_editor_tuba_dialogs_composer_components_attachment_edit (TubaDialogsComposerComponentsAttachment* _sender,
                                                                                                                gpointer self)
{
	tuba_dialogs_composer_components_attachments_bin_show_editor ((TubaDialogsComposerComponentsAttachmentsBin*) self, _sender);
}

static void
tuba_dialogs_composer_components_attachments_bin_add_attachment (TubaDialogsComposerComponentsAttachmentsBin* self,
                                                                 TubaDialogsComposerComponentsAttachment* attachment)
{
	GeeArrayList* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	GeeArrayList* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	GeeArrayList* _tmp6_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (attachment != NULL);
	g_signal_connect_object (attachment, "switch-place", (GCallback) _tuba_dialogs_composer_components_attachments_bin_on_switch_place_tuba_dialogs_composer_components_attachment_switch_place, self, 0);
	g_signal_connect_object (attachment, "delete-me", (GCallback) _tuba_dialogs_composer_components_attachments_bin_on_delete_tuba_dialogs_composer_components_attachment_delete_me, self, 0);
	g_signal_connect_object (attachment, "edit", (GCallback) _tuba_dialogs_composer_components_attachments_bin_show_editor_tuba_dialogs_composer_components_attachment_edit, self, 0);
	_tmp0_ = self->priv->attachment_widgets;
	_tmp1_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->attachment_widgets;
	_tmp4_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp3_);
	_tmp5_ = _tmp4_;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) attachment, _tmp2_ % 2, (gint) floor ((gdouble) (_tmp5_ / 2)), 1, 1);
	_tmp6_ = self->priv->attachment_widgets;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp6_, attachment);
	g_object_notify ((GObject*) self, "is-empty");
	g_object_notify ((GObject*) self, "can-add-media");
	tuba_dialogs_composer_components_attachment_play_animation (attachment, FALSE);
}

static void
tuba_dialogs_composer_components_attachments_bin_on_switch_place (TubaDialogsComposerComponentsAttachmentsBin* self,
                                                                  TubaDialogsComposerComponentsAttachment* from,
                                                                  TubaDialogsComposerComponentsAttachment* to)
{
	gint from_column = 0;
	gint from_row = 0;
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	gint to_column = 0;
	gint to_row = 0;
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
	gint from_index = 0;
	GeeArrayList* _tmp4_;
	gint to_index = 0;
	GeeArrayList* _tmp5_;
	TubaDialogsComposerComponentsAttachment* temp = NULL;
	GeeArrayList* _tmp6_;
	gpointer _tmp7_;
	GeeArrayList* _tmp8_;
	GeeArrayList* _tmp9_;
	gpointer _tmp10_;
	TubaDialogsComposerComponentsAttachment* _tmp11_;
	GeeArrayList* _tmp12_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (from != NULL);
	g_return_if_fail (to != NULL);
	gtk_grid_query_child ((GtkGrid*) self, (GtkWidget*) from, &_tmp0_, &_tmp1_, NULL, NULL);
	from_column = _tmp0_;
	from_row = _tmp1_;
	gtk_grid_query_child ((GtkGrid*) self, (GtkWidget*) to, &_tmp2_, &_tmp3_, NULL, NULL);
	to_column = _tmp2_;
	to_row = _tmp3_;
	gtk_grid_remove ((GtkGrid*) self, (GtkWidget*) from);
	gtk_grid_remove ((GtkGrid*) self, (GtkWidget*) to);
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) to, from_column, from_row, 1, 1);
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) from, to_column, to_row, 1, 1);
	_tmp4_ = self->priv->attachment_widgets;
	from_index = gee_abstract_list_index_of ((GeeAbstractList*) _tmp4_, from);
	_tmp5_ = self->priv->attachment_widgets;
	to_index = gee_abstract_list_index_of ((GeeAbstractList*) _tmp5_, to);
	_tmp6_ = self->priv->attachment_widgets;
	_tmp7_ = gee_abstract_list_get ((GeeAbstractList*) _tmp6_, from_index);
	temp = (TubaDialogsComposerComponentsAttachment*) _tmp7_;
	_tmp8_ = self->priv->attachment_widgets;
	_tmp9_ = self->priv->attachment_widgets;
	_tmp10_ = gee_abstract_list_get ((GeeAbstractList*) _tmp9_, to_index);
	_tmp11_ = (TubaDialogsComposerComponentsAttachment*) _tmp10_;
	gee_abstract_list_set ((GeeAbstractList*) _tmp8_, from_index, _tmp11_);
	_g_object_unref0 (_tmp11_);
	_tmp12_ = self->priv->attachment_widgets;
	gee_abstract_list_set ((GeeAbstractList*) _tmp12_, to_index, temp);
	_g_object_unref0 (temp);
}

static void
tuba_dialogs_composer_components_attachments_bin_on_delete (TubaDialogsComposerComponentsAttachmentsBin* self,
                                                            TubaDialogsComposerComponentsAttachment* attachment)
{
	gint removed_column = 0;
	gint removed_row = 0;
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	gint removed_index = 0;
	GeeArrayList* _tmp2_;
	GeeArrayList* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (attachment != NULL);
	gtk_grid_query_child ((GtkGrid*) self, (GtkWidget*) attachment, &_tmp0_, &_tmp1_, NULL, NULL);
	removed_column = _tmp0_;
	removed_row = _tmp1_;
	gtk_grid_remove ((GtkGrid*) self, (GtkWidget*) attachment);
	_tmp2_ = self->priv->attachment_widgets;
	removed_index = gee_abstract_list_index_of ((GeeAbstractList*) _tmp2_, attachment);
	_tmp3_ = self->priv->attachment_widgets;
	gee_abstract_collection_remove ((GeeAbstractCollection*) _tmp3_, attachment);
	tuba_dialogs_composer_components_attachment_cleanup (attachment);
	{
		gint i = 0;
		i = removed_index;
		{
			gboolean _tmp4_ = FALSE;
			_tmp4_ = TRUE;
			while (TRUE) {
				GeeArrayList* _tmp6_;
				gint _tmp7_;
				gint _tmp8_;
				TubaDialogsComposerComponentsAttachment* child = NULL;
				GeeArrayList* _tmp9_;
				gpointer _tmp10_;
				gint current_col = 0;
				gint current_row = 0;
				TubaDialogsComposerComponentsAttachment* _tmp11_;
				gint _tmp12_ = 0;
				gint _tmp13_ = 0;
				gboolean _tmp14_ = FALSE;
				if (!_tmp4_) {
					gint _tmp5_;
					_tmp5_ = i;
					i = _tmp5_ + 1;
				}
				_tmp4_ = FALSE;
				_tmp6_ = self->priv->attachment_widgets;
				_tmp7_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp6_);
				_tmp8_ = _tmp7_;
				if (!(i < _tmp8_)) {
					break;
				}
				_tmp9_ = self->priv->attachment_widgets;
				_tmp10_ = gee_abstract_list_get ((GeeAbstractList*) _tmp9_, i);
				child = (TubaDialogsComposerComponentsAttachment*) _tmp10_;
				_tmp11_ = child;
				gtk_grid_query_child ((GtkGrid*) self, (GtkWidget*) _tmp11_, &_tmp12_, &_tmp13_, NULL, NULL);
				current_col = _tmp12_;
				current_row = _tmp13_;
				if (current_row > removed_row) {
					_tmp14_ = TRUE;
				} else {
					gboolean _tmp15_ = FALSE;
					if (current_row == removed_row) {
						_tmp15_ = current_col > removed_column;
					} else {
						_tmp15_ = FALSE;
					}
					_tmp14_ = _tmp15_;
				}
				if (_tmp14_) {
					gint new_row = 0;
					gint new_col = 0;
					TubaDialogsComposerComponentsAttachment* _tmp16_;
					TubaDialogsComposerComponentsAttachment* _tmp17_;
					new_row = current_row;
					new_col = current_col;
					if (current_col == 0) {
						new_row = current_row - 1;
						new_col = 1;
					} else {
						new_col = current_col - 1;
					}
					_tmp16_ = child;
					gtk_grid_remove ((GtkGrid*) self, (GtkWidget*) _tmp16_);
					_tmp17_ = child;
					gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp17_, new_col, new_row, 1, 1);
				}
				_g_object_unref0 (child);
			}
		}
	}
	g_object_notify ((GObject*) self, "is-empty");
	g_object_notify ((GObject*) self, "can-add-media");
	tuba_dialogs_composer_components_attachments_bin_on_attachment_done (self);
}

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

static void
tuba_dialogs_composer_components_attachments_bin_populate_filter (TubaDialogsComposerComponentsAttachmentsBin* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gboolean _tmp4_ = FALSE;
	TubaAccountStore* _tmp5_;
	TubaInstanceAccount* _tmp6_;
	TubaInstanceAccount* _tmp7_;
	TubaAPIInstance* _tmp8_;
	TubaAPIInstance* _tmp9_;
	g_return_if_fail (self != NULL);
	_tmp5_ = tuba_accounts;
	_tmp6_ = tuba_account_store_get_active (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = tuba_instance_account_get_instance_info (_tmp7_);
	_tmp9_ = _tmp8_;
	if (_tmp9_ != NULL) {
		TubaAccountStore* _tmp10_;
		TubaInstanceAccount* _tmp11_;
		TubaInstanceAccount* _tmp12_;
		TubaAPIInstance* _tmp13_;
		TubaAPIInstance* _tmp14_;
		TubaAPIMastodonConfigurations* _tmp15_;
		TubaAPIMastodonConfigurations* _tmp16_;
		_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_configuration (_tmp14_);
		_tmp16_ = _tmp15_;
		_tmp4_ = _tmp16_ != NULL;
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		TubaAccountStore* _tmp17_;
		TubaInstanceAccount* _tmp18_;
		TubaInstanceAccount* _tmp19_;
		TubaAPIInstance* _tmp20_;
		TubaAPIInstance* _tmp21_;
		TubaAPIMastodonConfigurations* _tmp22_;
		TubaAPIMastodonConfigurations* _tmp23_;
		TubaAPIMastodonConfigurationMediaAttachments* _tmp24_;
		TubaAPIMastodonConfigurationMediaAttachments* _tmp25_;
		_tmp17_ = tuba_accounts;
		_tmp18_ = tuba_account_store_get_active (_tmp17_);
		_tmp19_ = _tmp18_;
		_tmp20_ = tuba_instance_account_get_instance_info (_tmp19_);
		_tmp21_ = _tmp20_;
		_tmp22_ = tuba_api_instance_get_configuration (_tmp21_);
		_tmp23_ = _tmp22_;
		_tmp24_ = tuba_api_mastodon_configurations_get_media_attachments (_tmp23_);
		_tmp25_ = _tmp24_;
		_tmp3_ = _tmp25_ != NULL;
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		TubaAccountStore* _tmp26_;
		TubaInstanceAccount* _tmp27_;
		TubaInstanceAccount* _tmp28_;
		TubaAPIInstance* _tmp29_;
		TubaAPIInstance* _tmp30_;
		TubaAPIMastodonConfigurations* _tmp31_;
		TubaAPIMastodonConfigurations* _tmp32_;
		TubaAPIMastodonConfigurationMediaAttachments* _tmp33_;
		TubaAPIMastodonConfigurationMediaAttachments* _tmp34_;
		GeeArrayList* _tmp35_;
		GeeArrayList* _tmp36_;
		_tmp26_ = tuba_accounts;
		_tmp27_ = tuba_account_store_get_active (_tmp26_);
		_tmp28_ = _tmp27_;
		_tmp29_ = tuba_instance_account_get_instance_info (_tmp28_);
		_tmp30_ = _tmp29_;
		_tmp31_ = tuba_api_instance_get_configuration (_tmp30_);
		_tmp32_ = _tmp31_;
		_tmp33_ = tuba_api_mastodon_configurations_get_media_attachments (_tmp32_);
		_tmp34_ = _tmp33_;
		_tmp35_ = tuba_api_mastodon_configuration_media_attachments_get_supported_mime_types (_tmp34_);
		_tmp36_ = _tmp35_;
		_tmp2_ = _tmp36_ != NULL;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		TubaAccountStore* _tmp37_;
		TubaInstanceAccount* _tmp38_;
		TubaInstanceAccount* _tmp39_;
		TubaAPIInstance* _tmp40_;
		TubaAPIInstance* _tmp41_;
		TubaAPIMastodonConfigurations* _tmp42_;
		TubaAPIMastodonConfigurations* _tmp43_;
		TubaAPIMastodonConfigurationMediaAttachments* _tmp44_;
		TubaAPIMastodonConfigurationMediaAttachments* _tmp45_;
		GeeArrayList* _tmp46_;
		GeeArrayList* _tmp47_;
		gint _tmp48_;
		gint _tmp49_;
		_tmp37_ = tuba_accounts;
		_tmp38_ = tuba_account_store_get_active (_tmp37_);
		_tmp39_ = _tmp38_;
		_tmp40_ = tuba_instance_account_get_instance_info (_tmp39_);
		_tmp41_ = _tmp40_;
		_tmp42_ = tuba_api_instance_get_configuration (_tmp41_);
		_tmp43_ = _tmp42_;
		_tmp44_ = tuba_api_mastodon_configurations_get_media_attachments (_tmp43_);
		_tmp45_ = _tmp44_;
		_tmp46_ = tuba_api_mastodon_configuration_media_attachments_get_supported_mime_types (_tmp45_);
		_tmp47_ = _tmp46_;
		_tmp48_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp47_);
		_tmp49_ = _tmp48_;
		_tmp1_ = _tmp49_ > 0;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		gboolean _tmp50_ = FALSE;
		TubaAccountStore* _tmp51_;
		TubaInstanceAccount* _tmp52_;
		TubaInstanceAccount* _tmp53_;
		TubaAPIInstance* _tmp54_;
		TubaAPIInstance* _tmp55_;
		TubaAPIMastodonConfigurations* _tmp56_;
		TubaAPIMastodonConfigurations* _tmp57_;
		TubaAPIMastodonConfigurationMediaAttachments* _tmp58_;
		TubaAPIMastodonConfigurationMediaAttachments* _tmp59_;
		GeeArrayList* _tmp60_;
		GeeArrayList* _tmp61_;
		gint _tmp62_;
		gint _tmp63_;
		_tmp51_ = tuba_accounts;
		_tmp52_ = tuba_account_store_get_active (_tmp51_);
		_tmp53_ = _tmp52_;
		_tmp54_ = tuba_instance_account_get_instance_info (_tmp53_);
		_tmp55_ = _tmp54_;
		_tmp56_ = tuba_api_instance_get_configuration (_tmp55_);
		_tmp57_ = _tmp56_;
		_tmp58_ = tuba_api_mastodon_configurations_get_media_attachments (_tmp57_);
		_tmp59_ = _tmp58_;
		_tmp60_ = tuba_api_mastodon_configuration_media_attachments_get_supported_mime_types (_tmp59_);
		_tmp61_ = _tmp60_;
		_tmp62_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp61_);
		_tmp63_ = _tmp62_;
		if (_tmp63_ == 1) {
			TubaAccountStore* _tmp64_;
			TubaInstanceAccount* _tmp65_;
			TubaInstanceAccount* _tmp66_;
			TubaAPIInstance* _tmp67_;
			TubaAPIInstance* _tmp68_;
			TubaAPIMastodonConfigurations* _tmp69_;
			TubaAPIMastodonConfigurations* _tmp70_;
			TubaAPIMastodonConfigurationMediaAttachments* _tmp71_;
			TubaAPIMastodonConfigurationMediaAttachments* _tmp72_;
			GeeArrayList* _tmp73_;
			GeeArrayList* _tmp74_;
			gpointer _tmp75_;
			gchar* _tmp76_;
			_tmp64_ = tuba_accounts;
			_tmp65_ = tuba_account_store_get_active (_tmp64_);
			_tmp66_ = _tmp65_;
			_tmp67_ = tuba_instance_account_get_instance_info (_tmp66_);
			_tmp68_ = _tmp67_;
			_tmp69_ = tuba_api_instance_get_configuration (_tmp68_);
			_tmp70_ = _tmp69_;
			_tmp71_ = tuba_api_mastodon_configurations_get_media_attachments (_tmp70_);
			_tmp72_ = _tmp71_;
			_tmp73_ = tuba_api_mastodon_configuration_media_attachments_get_supported_mime_types (_tmp72_);
			_tmp74_ = _tmp73_;
			_tmp75_ = gee_abstract_list_get ((GeeAbstractList*) _tmp74_, 0);
			_tmp76_ = (gchar*) _tmp75_;
			_tmp50_ = g_strcmp0 (_tmp76_, "application/octet-stream") == 0;
			_g_free0 (_tmp76_);
		} else {
			_tmp50_ = FALSE;
		}
		_tmp0_ = !_tmp50_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		TubaAccountStore* _tmp77_;
		TubaInstanceAccount* _tmp78_;
		TubaInstanceAccount* _tmp79_;
		TubaAPIInstance* _tmp80_;
		TubaAPIInstance* _tmp81_;
		TubaAPIMastodonConfigurations* _tmp82_;
		TubaAPIMastodonConfigurations* _tmp83_;
		TubaAPIMastodonConfigurationMediaAttachments* _tmp84_;
		TubaAPIMastodonConfigurationMediaAttachments* _tmp85_;
		GeeArrayList* _tmp86_;
		GeeArrayList* _tmp87_;
		GeeArrayList* _tmp88_;
		_tmp77_ = tuba_accounts;
		_tmp78_ = tuba_account_store_get_active (_tmp77_);
		_tmp79_ = _tmp78_;
		_tmp80_ = tuba_instance_account_get_instance_info (_tmp79_);
		_tmp81_ = _tmp80_;
		_tmp82_ = tuba_api_instance_get_configuration (_tmp81_);
		_tmp83_ = _tmp82_;
		_tmp84_ = tuba_api_mastodon_configurations_get_media_attachments (_tmp83_);
		_tmp85_ = _tmp84_;
		_tmp86_ = tuba_api_mastodon_configuration_media_attachments_get_supported_mime_types (_tmp85_);
		_tmp87_ = _tmp86_;
		_tmp88_ = _g_object_ref0 (_tmp87_);
		_g_object_unref0 (self->priv->supported_mimes);
		self->priv->supported_mimes = _tmp88_;
	}
	{
		GeeArrayList* _mime_type_list = NULL;
		GeeArrayList* _tmp89_;
		gint _mime_type_size = 0;
		GeeArrayList* _tmp90_;
		gint _tmp91_;
		gint _tmp92_;
		gint _mime_type_index = 0;
		_tmp89_ = self->priv->supported_mimes;
		_mime_type_list = _tmp89_;
		_tmp90_ = _mime_type_list;
		_tmp91_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp90_);
		_tmp92_ = _tmp91_;
		_mime_type_size = _tmp92_;
		_mime_type_index = -1;
		while (TRUE) {
			gint _tmp93_;
			gint _tmp94_;
			gchar* mime_type = NULL;
			GeeArrayList* _tmp95_;
			gpointer _tmp96_;
			GtkFileFilter* _tmp97_;
			const gchar* _tmp98_;
			gchar* _tmp99_;
			gchar* _tmp100_;
			_mime_type_index = _mime_type_index + 1;
			_tmp93_ = _mime_type_index;
			_tmp94_ = _mime_type_size;
			if (!(_tmp93_ < _tmp94_)) {
				break;
			}
			_tmp95_ = _mime_type_list;
			_tmp96_ = gee_abstract_list_get ((GeeAbstractList*) _tmp95_, _mime_type_index);
			mime_type = (gchar*) _tmp96_;
			_tmp97_ = self->priv->filter;
			_tmp98_ = mime_type;
			_tmp99_ = g_utf8_strdown (_tmp98_, (gssize) -1);
			_tmp100_ = _tmp99_;
			gtk_file_filter_add_mime_type (_tmp97_, _tmp100_);
			_g_free0 (_tmp100_);
			_g_free0 (mime_type);
		}
	}
}

static void
tuba_dialogs_composer_components_attachments_bin_upload_files_data_free (gpointer _data)
{
	TubaDialogsComposerComponentsAttachmentsBinUploadFilesData* _data_;
	_data_ = _data;
	_data_->files = (_vala_array_free (_data_->files, _data_->files_length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (_data_->self);
	g_slice_free (TubaDialogsComposerComponentsAttachmentsBinUploadFilesData, _data_);
}

void
tuba_dialogs_composer_components_attachments_bin_upload_files (TubaDialogsComposerComponentsAttachmentsBin* self,
                                                               GFile** files,
                                                               gint files_length1,
                                                               GAsyncReadyCallback _callback_,
                                                               gpointer _user_data_)
{
	TubaDialogsComposerComponentsAttachmentsBinUploadFilesData* _data_;
	TubaDialogsComposerComponentsAttachmentsBin* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (TubaDialogsComposerComponentsAttachmentsBinUploadFilesData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_dialogs_composer_components_attachments_bin_upload_files_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->files = (_vala_array_free (_data_->files, _data_->files_length1, (GDestroyNotify) g_object_unref), NULL);
	_data_->files = files;
	_data_->files_length1 = files_length1;
	tuba_dialogs_composer_components_attachments_bin_upload_files_co (_data_);
}

void
tuba_dialogs_composer_components_attachments_bin_upload_files_finish (TubaDialogsComposerComponentsAttachmentsBin* self,
                                                                      GAsyncResult* _res_)
{
	TubaDialogsComposerComponentsAttachmentsBinUploadFilesData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

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

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

static void
_tuba_dialogs_composer_components_attachments_bin_on_upload_error_tuba_dialogs_composer_components_attachment_upload_error (TubaDialogsComposerComponentsAttachment* _sender,
                                                                                                                            const gchar* message,
                                                                                                                            gpointer self)
{
	tuba_dialogs_composer_components_attachments_bin_on_upload_error ((TubaDialogsComposerComponentsAttachmentsBin*) self, _sender, message);
}

static void
_tuba_dialogs_composer_components_attachments_bin_on_toast_tuba_dialogs_composer_components_attachment_toast (TubaDialogsComposerComponentsAttachment* _sender,
                                                                                                              const gchar* message,
                                                                                                              gpointer self)
{
	tuba_dialogs_composer_components_attachments_bin_on_toast ((TubaDialogsComposerComponentsAttachmentsBin*) self, message);
}

static void
_tuba_dialogs_composer_components_attachments_bin_on_attachment_done_g_object_notify (GObject* _sender,
                                                                                      GParamSpec* pspec,
                                                                                      gpointer self)
{
	tuba_dialogs_composer_components_attachments_bin_on_attachment_done ((TubaDialogsComposerComponentsAttachmentsBin*) self);
}

static gboolean
tuba_dialogs_composer_components_attachments_bin_upload_files_co (TubaDialogsComposerComponentsAttachmentsBinUploadFilesData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->files_length1 == 0) {
		g_object_notify ((GObject*) _data_->self, "working");
		_data_->files = (_vala_array_free (_data_->files, _data_->files_length1, (GDestroyNotify) g_object_unref), NULL);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp0_ = tuba_accounts;
	_data_->_tmp1_ = tuba_account_store_get_active (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = tuba_instance_account_get_instance_info (_data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = tuba_api_instance_get_compat_status_max_media_attachments (_data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = _data_->self->priv->attachment_widgets;
	_data_->_tmp8_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _data_->_tmp7_);
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->allowed_attachments_amount = _data_->_tmp6_ - _data_->_tmp9_;
	_data_->reached_limit = FALSE;
	_data_->_tmp10_ = g_new0 (GFile*, 0 + 1);
	_data_->files_for_upload = _data_->_tmp10_;
	_data_->files_for_upload_length1 = 0;
	_data_->_files_for_upload_size_ = _data_->files_for_upload_length1;
	{
		_data_->file_collection_length1 = 0;
		_data_->_file_collection_size_ = 0;
		_data_->file_collection = _data_->files;
		_data_->file_collection_length1 = _data_->files_length1;
		for (_data_->file_it = 0; _data_->file_it < _data_->file_collection_length1; _data_->file_it = _data_->file_it + 1) {
			_data_->_tmp11_ = _g_object_ref0 (_data_->file_collection[_data_->file_it]);
			_data_->file = _data_->_tmp11_;
			{
				_data_->_tmp12_ = tuba_accounts;
				_data_->_tmp13_ = tuba_account_store_get_active (_data_->_tmp12_);
				_data_->_tmp14_ = _data_->_tmp13_;
				_data_->_tmp15_ = tuba_instance_account_get_instance_info (_data_->_tmp14_);
				_data_->_tmp16_ = _data_->_tmp15_;
				_data_->_tmp17_ = tuba_api_instance_get_compat_status_max_image_size (_data_->_tmp16_);
				_data_->_tmp18_ = _data_->_tmp17_;
				if (_data_->_tmp18_ > ((gint64) 0)) {
					{
						_data_->_tmp19_ = _data_->file;
						_data_->_tmp20_ = g_file_query_info (_data_->_tmp19_, "standard::size,standard::content-type", 0, NULL, &_data_->_inner_error0_);
						_data_->file_info = _data_->_tmp20_;
						if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
							goto __catch0_g_error;
						}
						_data_->_tmp21_ = _data_->file_info;
						_data_->_tmp22_ = g_file_info_get_content_type (_data_->_tmp21_);
						_data_->_tmp23_ = g_strdup (_data_->_tmp22_);
						_data_->file_content_type = _data_->_tmp23_;
						_data_->_tmp24_ = _data_->file_content_type;
						if (_data_->_tmp24_ != NULL) {
							_data_->_tmp25_ = _data_->file_content_type;
							_data_->_tmp26_ = g_utf8_strdown (_data_->_tmp25_, (gssize) -1);
							_g_free0 (_data_->file_content_type);
							_data_->file_content_type = _data_->_tmp26_;
							_data_->_tmp27_ = _data_->self->priv->supported_mimes;
							_data_->_tmp28_ = _data_->file_content_type;
							if (!gee_abstract_collection_contains ((GeeAbstractCollection*) _data_->_tmp27_, _data_->_tmp28_)) {
								_g_free0 (_data_->file_content_type);
								_g_object_unref0 (_data_->file_info);
								_g_object_unref0 (_data_->file);
								continue;
							}
							_data_->_tmp29_ = _data_->file_info;
							_data_->file_size = g_file_info_get_size (_data_->_tmp29_);
							_data_->_tmp32_ = _data_->file_content_type;
							if (string_contains (_data_->_tmp32_, "image/")) {
								_data_->_tmp33_ = tuba_accounts;
								_data_->_tmp34_ = tuba_account_store_get_active (_data_->_tmp33_);
								_data_->_tmp35_ = _data_->_tmp34_;
								_data_->_tmp36_ = tuba_instance_account_get_instance_info (_data_->_tmp35_);
								_data_->_tmp37_ = _data_->_tmp36_;
								_data_->_tmp38_ = tuba_api_instance_get_compat_status_max_image_size (_data_->_tmp37_);
								_data_->_tmp39_ = _data_->_tmp38_;
								_data_->_tmp31_ = _data_->file_size >= _data_->_tmp39_;
							} else {
								_data_->_tmp31_ = FALSE;
							}
							if (_data_->_tmp31_) {
								_data_->_tmp30_ = TRUE;
							} else {
								_data_->_tmp41_ = _data_->file_content_type;
								if (string_contains (_data_->_tmp41_, "video/")) {
									_data_->_tmp42_ = tuba_accounts;
									_data_->_tmp43_ = tuba_account_store_get_active (_data_->_tmp42_);
									_data_->_tmp44_ = _data_->_tmp43_;
									_data_->_tmp45_ = tuba_instance_account_get_instance_info (_data_->_tmp44_);
									_data_->_tmp46_ = _data_->_tmp45_;
									_data_->_tmp47_ = tuba_api_instance_get_compat_status_max_video_size (_data_->_tmp46_);
									_data_->_tmp48_ = _data_->_tmp47_;
									_data_->_tmp40_ = _data_->file_size >= _data_->_tmp48_;
								} else {
									_data_->_tmp40_ = FALSE;
								}
								_data_->_tmp30_ = _data_->_tmp40_;
							}
							_data_->skip = _data_->_tmp30_;
							if (_data_->skip) {
								_data_->_tmp49_ = _data_->file;
								_data_->_tmp50_ = g_file_get_basename (_data_->_tmp49_);
								_data_->_tmp51_ = _data_->_tmp50_;
								_data_->_tmp52_ = g_strdup_printf (_ ("File \"%s\" is bigger than the instance limit"), _data_->_tmp51_);
								_data_->_tmp53_ = _data_->_tmp52_;
								_data_->_tmp54_ = adw_toast_new (_data_->_tmp53_);
								_data_->_tmp55_ = _data_->_tmp54_;
								g_signal_emit_by_name ((TubaDialogsComposerComponentsAttachable*) _data_->self, "toast", _data_->_tmp55_);
								_g_object_unref0 (_data_->_tmp55_);
								_g_free0 (_data_->_tmp53_);
								_g_free0 (_data_->_tmp51_);
								_g_free0 (_data_->file_content_type);
								_g_object_unref0 (_data_->file_info);
								_g_object_unref0 (_data_->file);
								continue;
							}
						}
						_g_free0 (_data_->file_content_type);
						_g_object_unref0 (_data_->file_info);
					}
					goto __finally0;
					__catch0_g_error:
					{
						_data_->e = _data_->_inner_error0_;
						_data_->_inner_error0_ = NULL;
						_data_->_tmp56_ = _data_->e;
						_data_->_tmp57_ = _data_->_tmp56_->message;
						g_warning ("AttachmentsBin.vala:437: %s", _data_->_tmp57_);
						_g_error_free0 (_data_->e);
					}
					__finally0:
					if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
						_g_object_unref0 (_data_->file);
						_data_->files_for_upload = (_vala_array_free (_data_->files_for_upload, _data_->files_for_upload_length1, (GDestroyNotify) g_object_unref), NULL);
						_data_->files = (_vala_array_free (_data_->files, _data_->files_length1, (GDestroyNotify) g_object_unref), NULL);
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
						g_clear_error (&_data_->_inner_error0_);
						g_object_unref (_data_->_async_result);
						return FALSE;
					}
				}
				_data_->_tmp58_ = _data_->file;
				_data_->_tmp59_ = _g_object_ref0 (_data_->_tmp58_);
				_vala_array_add45 (&_data_->files_for_upload, &_data_->files_for_upload_length1, &_data_->_files_for_upload_size_, _data_->_tmp59_);
				_data_->_tmp60_ = _data_->files_for_upload;
				_data_->_tmp60__length1 = _data_->files_for_upload_length1;
				if (((gint64) _data_->_tmp60__length1) >= _data_->allowed_attachments_amount) {
					_data_->reached_limit = TRUE;
					_g_object_unref0 (_data_->file);
					break;
				}
				_g_object_unref0 (_data_->file);
			}
		}
	}
	if (_data_->reached_limit) {
		_data_->_tmp61_ = tuba_accounts;
		_data_->_tmp62_ = tuba_account_store_get_active (_data_->_tmp61_);
		_data_->_tmp63_ = _data_->_tmp62_;
		_data_->_tmp64_ = tuba_instance_account_get_instance_info (_data_->_tmp63_);
		_data_->_tmp65_ = _data_->_tmp64_;
		_data_->_tmp66_ = tuba_api_instance_get_compat_status_max_media_attachments (_data_->_tmp65_);
		_data_->_tmp67_ = _data_->_tmp66_;
		_data_->_tmp68_ = g_strdup_printf (_ ("Attachment limit reached (%lld)"), _data_->_tmp67_);
		_data_->_tmp69_ = _data_->_tmp68_;
		_data_->_tmp70_ = NULL;
		_data_->_tmp70_ = adw_toast_new (_data_->_tmp69_);
		adw_toast_set_timeout (_data_->_tmp70_, (guint) 3);
		_data_->_tmp71_ = _data_->_tmp70_;
		g_signal_emit_by_name ((TubaDialogsComposerComponentsAttachable*) _data_->self, "toast", _data_->_tmp71_);
		_g_object_unref0 (_data_->_tmp71_);
		_g_free0 (_data_->_tmp69_);
	}
	_data_->_tmp72_ = _data_->files_for_upload;
	_data_->_tmp72__length1 = _data_->files_for_upload_length1;
	tuba_dialogs_composer_components_attachments_bin_set_working (_data_->self, _data_->_tmp72__length1 > 0);
	g_object_notify ((GObject*) _data_->self, "working");
	{
		_data_->i = 0;
		{
			_data_->_tmp73_ = TRUE;
			while (TRUE) {
				if (!_data_->_tmp73_) {
					_data_->_tmp74_ = _data_->i;
					_data_->i = _data_->_tmp74_ + 1;
				}
				_data_->_tmp73_ = FALSE;
				_data_->_tmp75_ = _data_->files_for_upload;
				_data_->_tmp75__length1 = _data_->files_for_upload_length1;
				if (!(_data_->i < _data_->_tmp75__length1)) {
					break;
				}
				_data_->_tmp76_ = _data_->files_for_upload;
				_data_->_tmp76__length1 = _data_->files_for_upload_length1;
				_data_->_tmp77_ = _data_->_tmp76_[_data_->i];
				_data_->_tmp78_ = _g_object_ref0 (_data_->_tmp77_);
				_data_->file13 = _data_->_tmp78_;
				_data_->_tmp79_ = tuba_dialogs_composer_components_attachment_new ();
				g_object_ref_sink (_data_->_tmp79_);
				_data_->attachment = _data_->_tmp79_;
				_data_->_tmp80_ = _data_->attachment;
				g_signal_connect_object (_data_->_tmp80_, "upload-error", (GCallback) _tuba_dialogs_composer_components_attachments_bin_on_upload_error_tuba_dialogs_composer_components_attachment_upload_error, _data_->self, 0);
				_data_->_tmp81_ = _data_->attachment;
				g_signal_connect_object (_data_->_tmp81_, "toast", (GCallback) _tuba_dialogs_composer_components_attachments_bin_on_toast_tuba_dialogs_composer_components_attachment_toast, _data_->self, 0);
				_data_->_tmp82_ = _data_->attachment;
				g_signal_connect_object ((GObject*) _data_->_tmp82_, "notify::done", (GCallback) _tuba_dialogs_composer_components_attachments_bin_on_attachment_done_g_object_notify, _data_->self, 0);
				_data_->_tmp83_ = _data_->attachment;
				tuba_dialogs_composer_components_attachments_bin_add_attachment (_data_->self, _data_->_tmp83_);
				_data_->_tmp84_ = _data_->attachment;
				_data_->_tmp85_ = _data_->file13;
				tuba_dialogs_composer_components_attachment_upload (_data_->_tmp84_, _data_->_tmp85_, NULL, NULL);
				_g_object_unref0 (_data_->attachment);
				_g_object_unref0 (_data_->file13);
			}
		}
	}
	_data_->files_for_upload = (_vala_array_free (_data_->files_for_upload, _data_->files_for_upload_length1, (GDestroyNotify) g_object_unref), NULL);
	_data_->files = (_vala_array_free (_data_->files, _data_->files_length1, (GDestroyNotify) g_object_unref), NULL);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
tuba_dialogs_composer_components_attachments_bin_on_toast (TubaDialogsComposerComponentsAttachmentsBin* self,
                                                           const gchar* message)
{
	AdwToast* _tmp0_;
	AdwToast* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (message != NULL);
	_tmp0_ = adw_toast_new (message);
	_tmp1_ = _tmp0_;
	g_signal_emit_by_name ((TubaDialogsComposerComponentsAttachable*) self, "toast", _tmp1_);
	_g_object_unref0 (_tmp1_);
}

static void
tuba_dialogs_composer_components_attachments_bin_on_upload_error (TubaDialogsComposerComponentsAttachmentsBin* self,
                                                                  TubaDialogsComposerComponentsAttachment* attachment,
                                                                  const gchar* message)
{
	AdwToast* _tmp0_;
	AdwToast* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (attachment != NULL);
	g_return_if_fail (message != NULL);
	_tmp0_ = adw_toast_new (message);
	_tmp1_ = _tmp0_;
	g_signal_emit_by_name ((TubaDialogsComposerComponentsAttachable*) self, "toast", _tmp1_);
	_g_object_unref0 (_tmp1_);
	tuba_dialogs_composer_components_attachments_bin_on_delete (self, attachment);
}

static void
tuba_dialogs_composer_components_attachments_bin_on_attachment_done (TubaDialogsComposerComponentsAttachmentsBin* self)
{
	gboolean is_working = FALSE;
	g_return_if_fail (self != NULL);
	is_working = FALSE;
	{
		GeeArrayList* _attachment_list = NULL;
		GeeArrayList* _tmp0_;
		gint _attachment_size = 0;
		GeeArrayList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		gint _attachment_index = 0;
		_tmp0_ = self->priv->attachment_widgets;
		_attachment_list = _tmp0_;
		_tmp1_ = _attachment_list;
		_tmp2_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp1_);
		_tmp3_ = _tmp2_;
		_attachment_size = _tmp3_;
		_attachment_index = -1;
		while (TRUE) {
			gint _tmp4_;
			gint _tmp5_;
			TubaDialogsComposerComponentsAttachment* attachment = NULL;
			GeeArrayList* _tmp6_;
			gpointer _tmp7_;
			TubaDialogsComposerComponentsAttachment* _tmp8_;
			gboolean _tmp9_;
			gboolean _tmp10_;
			_attachment_index = _attachment_index + 1;
			_tmp4_ = _attachment_index;
			_tmp5_ = _attachment_size;
			if (!(_tmp4_ < _tmp5_)) {
				break;
			}
			_tmp6_ = _attachment_list;
			_tmp7_ = gee_abstract_list_get ((GeeAbstractList*) _tmp6_, _attachment_index);
			attachment = (TubaDialogsComposerComponentsAttachment*) _tmp7_;
			_tmp8_ = attachment;
			_tmp9_ = tuba_dialogs_composer_components_attachment_get_done (_tmp8_);
			_tmp10_ = _tmp9_;
			is_working = !_tmp10_;
			if (is_working) {
				_g_object_unref0 (attachment);
				break;
			}
			_g_object_unref0 (attachment);
		}
	}
	tuba_dialogs_composer_components_attachments_bin_set_working (self, is_working);
}

static Block42Data*
block42_data_ref (Block42Data* _data42_)
{
	g_atomic_int_inc (&_data42_->_ref_count_);
	return _data42_;
}

static void
block42_data_unref (void * _userdata_)
{
	Block42Data* _data42_;
	_data42_ = (Block42Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data42_->_ref_count_)) {
		TubaDialogsComposerComponentsAttachmentsBin* self;
		self = _data42_->self;
		_g_object_unref0 (_data42_->chooser);
		_g_object_unref0 (self);
		g_slice_free (Block42Data, _data42_);
	}
}

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

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

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

static void
__lambda73_ (Block42Data* _data42_,
             GObject* obj,
             GAsyncResult* res)
{
	TubaDialogsComposerComponentsAttachmentsBin* self;
	GError* _inner_error0_ = NULL;
	self = _data42_->self;
	g_return_if_fail (res != NULL);
	{
		GListModel* files = NULL;
		GListModel* _tmp0_;
		GFile** files_to_upload = NULL;
		GFile** _tmp1_;
		gint files_to_upload_length1;
		gint _files_to_upload_size_;
		guint amount_of_files = 0U;
		GListModel* _tmp2_;
		GFile** _tmp11_;
		gint _tmp11__length1;
		GFile** _tmp12_;
		gint _tmp12__length1;
		_tmp0_ = gtk_file_dialog_open_multiple_finish (_data42_->chooser, res, &_inner_error0_);
		files = _tmp0_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp1_ = g_new0 (GFile*, 0 + 1);
		files_to_upload = _tmp1_;
		files_to_upload_length1 = 0;
		_files_to_upload_size_ = files_to_upload_length1;
		_tmp2_ = files;
		amount_of_files = g_list_model_get_n_items (_tmp2_);
		{
			gint i = 0;
			i = 0;
			{
				gboolean _tmp3_ = FALSE;
				_tmp3_ = TRUE;
				while (TRUE) {
					GFile* file = NULL;
					GListModel* _tmp5_;
					GObject* _tmp6_;
					GFile* _tmp7_;
					GFile* _tmp8_;
					if (!_tmp3_) {
						gint _tmp4_;
						_tmp4_ = i;
						i = _tmp4_ + 1;
					}
					_tmp3_ = FALSE;
					if (!(((guint) i) < amount_of_files)) {
						break;
					}
					_tmp5_ = files;
					_tmp6_ = g_list_model_get_item (_tmp5_, (guint) i);
					_tmp7_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp6_, g_file_get_type ()) ? ((GFile*) _tmp6_) : NULL;
					if (_tmp7_ == NULL) {
						_g_object_unref0 (_tmp6_);
					}
					file = _tmp7_;
					_tmp8_ = file;
					if (_tmp8_ != NULL) {
						GFile* _tmp9_;
						GFile* _tmp10_;
						_tmp9_ = file;
						_tmp10_ = _g_object_ref0 (_tmp9_);
						_vala_array_add46 (&files_to_upload, &files_to_upload_length1, &_files_to_upload_size_, _tmp10_);
					}
					_g_object_unref0 (file);
				}
			}
		}
		_tmp11_ = files_to_upload;
		_tmp11__length1 = files_to_upload_length1;
		_tmp12_ = (_tmp11_ != NULL) ? _vala_array_dup25 (_tmp11_, _tmp11__length1) : _tmp11_;
		_tmp12__length1 = _tmp11__length1;
		tuba_dialogs_composer_components_attachments_bin_upload_files (self, _tmp12_, (gint) _tmp12__length1, NULL, NULL);
		files_to_upload = (_vala_array_free (files_to_upload, files_to_upload_length1, (GDestroyNotify) g_object_unref), NULL);
		_g_object_unref0 (files);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp13_;
		const gchar* _tmp14_;
		const gchar* _tmp15_;
		gchar* _tmp16_;
		gchar* _tmp17_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp13_ = e;
		_tmp14_ = _tmp13_->message;
		_tmp15_ = string_to_string (_tmp14_);
		_tmp16_ = g_strconcat ("Couldn't get the result of FileDialog for AttachmentsBin: ", _tmp15_, NULL);
		_tmp17_ = _tmp16_;
		g_warning ("AttachmentsBin.vala:520: %s", _tmp17_);
		_g_free0 (_tmp17_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
___lambda73__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda73_ (self, source_object, res);
	block42_data_unref (self);
}

void
tuba_dialogs_composer_components_attachments_bin_show_file_selector (TubaDialogsComposerComponentsAttachmentsBin* self)
{
	Block42Data* _data42_;
	gchar* _tmp0_;
	GtkFileFilter* _tmp1_;
	GtkFileFilter* _tmp2_;
	GtkFileDialog* _tmp3_ = NULL;
	TubaApplication* _tmp4_;
	TubaDialogsMainWindow* _tmp5_;
	TubaDialogsMainWindow* _tmp6_;
	g_return_if_fail (self != NULL);
	_data42_ = g_slice_new0 (Block42Data);
	_data42_->_ref_count_ = 1;
	_data42_->self = g_object_ref (self);
	_tmp0_ = g_strdup (_ ("Open"));
	_tmp1_ = self->priv->filter;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_tmp3_ = gtk_file_dialog_new ();
	gtk_file_dialog_set_title (_tmp3_, _tmp0_);
	_g_free0 (_tmp0_);
	gtk_file_dialog_set_modal (_tmp3_, TRUE);
	gtk_file_dialog_set_default_filter (_tmp3_, _tmp2_);
	_g_object_unref0 (_tmp2_);
	_data42_->chooser = _tmp3_;
	_tmp4_ = tuba_app;
	_tmp5_ = tuba_application_get_main_window (_tmp4_);
	_tmp6_ = _tmp5_;
	gtk_file_dialog_open_multiple (_data42_->chooser, (GtkWindow*) _tmp6_, NULL, ___lambda73__gasync_ready_callback, block42_data_ref (_data42_));
	block42_data_unref (_data42_);
	_data42_ = NULL;
}

void
tuba_dialogs_composer_components_attachments_bin_preload_attachment (TubaDialogsComposerComponentsAttachmentsBin* self,
                                                                     TubaAPIAttachment* api_attachment,
                                                                     gboolean edit_mode)
{
	TubaAccountStore* _tmp0_;
	TubaInstanceAccount* _tmp1_;
	TubaInstanceAccount* _tmp2_;
	TubaAPIInstance* _tmp3_;
	TubaAPIInstance* _tmp4_;
	gint64 _tmp5_;
	gint64 _tmp6_;
	GeeArrayList* _tmp7_;
	gint _tmp8_;
	gint _tmp9_;
	TubaDialogsComposerComponentsAttachment* attachment = NULL;
	TubaDialogsComposerComponentsAttachment* _tmp10_;
	TubaDialogsComposerComponentsAttachment* _tmp11_;
	TubaDialogsComposerComponentsAttachment* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	const gchar* _tmp16_;
	const gchar* _tmp17_;
	const gchar* _tmp18_;
	const gchar* _tmp19_;
	const gchar* _tmp20_;
	TubaDialogsComposerComponentsAttachment* _tmp21_;
	gfloat x = 0.0F;
	gfloat y = 0.0F;
	gboolean _tmp22_ = FALSE;
	TubaAPIAttachmentMeta* _tmp23_;
	TubaAPIAttachmentMeta* _tmp24_;
	const gchar* _tmp41_ = NULL;
	const gchar* _tmp42_;
	const gchar* _tmp43_;
	TubaDialogsComposerComponentsAttachment* _tmp46_;
	TubaDialogsComposerComponentsAttachment* _tmp47_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (api_attachment != NULL);
	_tmp0_ = tuba_accounts;
	_tmp1_ = tuba_account_store_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = tuba_instance_account_get_instance_info (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = tuba_api_instance_get_compat_status_max_media_attachments (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = self->priv->attachment_widgets;
	_tmp8_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp7_);
	_tmp9_ = _tmp8_;
	if ((_tmp6_ - _tmp9_) <= ((gint64) 0)) {
		return;
	}
	_tmp10_ = tuba_dialogs_composer_components_attachment_new ();
	g_object_ref_sink (_tmp10_);
	attachment = _tmp10_;
	_tmp11_ = attachment;
	g_signal_connect_object ((GObject*) _tmp11_, "notify::done", (GCallback) _tuba_dialogs_composer_components_attachments_bin_on_attachment_done_g_object_notify, self, 0);
	_tmp12_ = attachment;
	_tmp13_ = tuba_api_attachment_get_id (api_attachment);
	_tmp14_ = _tmp13_;
	_tmp15_ = tuba_api_attachment_get_url (api_attachment);
	_tmp16_ = _tmp15_;
	_tmp17_ = tuba_api_attachment_get_preview_url (api_attachment);
	_tmp18_ = _tmp17_;
	_tmp19_ = tuba_api_attachment_get_kind (api_attachment);
	_tmp20_ = _tmp19_;
	tuba_dialogs_composer_components_attachment_preload (_tmp12_, _tmp14_, _tmp16_, _tmp18_, tuba_dialogs_composer_components_attachment_media_type_from_string (_tmp20_));
	_tmp21_ = attachment;
	tuba_dialogs_composer_components_attachment_set_edit_mode (_tmp21_, edit_mode);
	x = (gfloat) 0;
	y = (gfloat) 0;
	_tmp23_ = tuba_api_attachment_get_meta (api_attachment);
	_tmp24_ = _tmp23_;
	if (_tmp24_ != NULL) {
		TubaAPIAttachmentMeta* _tmp25_;
		TubaAPIAttachmentMeta* _tmp26_;
		TubaAPIAttachmentMetaFocus* _tmp27_;
		TubaAPIAttachmentMetaFocus* _tmp28_;
		_tmp25_ = tuba_api_attachment_get_meta (api_attachment);
		_tmp26_ = _tmp25_;
		_tmp27_ = tuba_api_attachment_meta_get_focus (_tmp26_);
		_tmp28_ = _tmp27_;
		_tmp22_ = _tmp28_ != NULL;
	} else {
		_tmp22_ = FALSE;
	}
	if (_tmp22_) {
		TubaAPIAttachmentMeta* _tmp29_;
		TubaAPIAttachmentMeta* _tmp30_;
		TubaAPIAttachmentMetaFocus* _tmp31_;
		TubaAPIAttachmentMetaFocus* _tmp32_;
		gfloat _tmp33_;
		gfloat _tmp34_;
		TubaAPIAttachmentMeta* _tmp35_;
		TubaAPIAttachmentMeta* _tmp36_;
		TubaAPIAttachmentMetaFocus* _tmp37_;
		TubaAPIAttachmentMetaFocus* _tmp38_;
		gfloat _tmp39_;
		gfloat _tmp40_;
		_tmp29_ = tuba_api_attachment_get_meta (api_attachment);
		_tmp30_ = _tmp29_;
		_tmp31_ = tuba_api_attachment_meta_get_focus (_tmp30_);
		_tmp32_ = _tmp31_;
		_tmp33_ = tuba_api_attachment_meta_focus_get_x (_tmp32_);
		_tmp34_ = _tmp33_;
		x = _tmp34_;
		_tmp35_ = tuba_api_attachment_get_meta (api_attachment);
		_tmp36_ = _tmp35_;
		_tmp37_ = tuba_api_attachment_meta_get_focus (_tmp36_);
		_tmp38_ = _tmp37_;
		_tmp39_ = tuba_api_attachment_meta_focus_get_y (_tmp38_);
		_tmp40_ = _tmp39_;
		y = _tmp40_;
	}
	_tmp42_ = tuba_api_attachment_get_description (api_attachment);
	_tmp43_ = _tmp42_;
	if (_tmp43_ == NULL) {
		_tmp41_ = "";
	} else {
		const gchar* _tmp44_;
		const gchar* _tmp45_;
		_tmp44_ = tuba_api_attachment_get_description (api_attachment);
		_tmp45_ = _tmp44_;
		_tmp41_ = _tmp45_;
	}
	_tmp46_ = attachment;
	tuba_dialogs_composer_components_attachment_saved (_tmp46_, x, y, _tmp41_);
	_tmp47_ = attachment;
	tuba_dialogs_composer_components_attachments_bin_add_attachment (self, _tmp47_);
	_g_object_unref0 (attachment);
}

static void
_tuba_dialogs_composer_components_attachment_saved_tuba_dialogs_composer_components_attachments_bin_editor_saved (TubaDialogsComposerComponentsAttachmentsBinEditor* _sender,
                                                                                                                  gfloat pos_x,
                                                                                                                  gfloat pos_y,
                                                                                                                  const gchar* alt_text,
                                                                                                                  gpointer self)
{
	tuba_dialogs_composer_components_attachment_saved ((TubaDialogsComposerComponentsAttachment*) self, pos_x, pos_y, alt_text);
}

static void
_tuba_dialogs_composer_components_attachments_bin_pop_req_tuba_dialogs_composer_components_attachments_bin_editor_saved (TubaDialogsComposerComponentsAttachmentsBinEditor* _sender,
                                                                                                                         gfloat pos_x,
                                                                                                                         gfloat pos_y,
                                                                                                                         const gchar* alt_text,
                                                                                                                         gpointer self)
{
	tuba_dialogs_composer_components_attachments_bin_pop_req ((TubaDialogsComposerComponentsAttachmentsBin*) self);
}

static void
_tuba_dialogs_composer_components_attachments_bin_toast_req_tuba_dialogs_composer_components_attachments_bin_editor_toast (TubaDialogsComposerComponentsAttachmentsBinEditor* _sender,
                                                                                                                           AdwToast* toast,
                                                                                                                           gpointer self)
{
	tuba_dialogs_composer_components_attachments_bin_toast_req ((TubaDialogsComposerComponentsAttachmentsBin*) self, toast);
}

void
tuba_dialogs_composer_components_attachments_bin_show_editor (TubaDialogsComposerComponentsAttachmentsBin* self,
                                                              TubaDialogsComposerComponentsAttachment* attachment)
{
	gboolean is_image = FALSE;
	TubaDialogsComposerComponentsAttachmentMediaType _tmp0_;
	TubaDialogsComposerComponentsAttachmentMediaType _tmp1_;
	GdkPaintable* _tmp2_ = NULL;
	GFile* _tmp5_ = NULL;
	TubaDialogsComposerComponentsAttachmentsBinEditor* editor = NULL;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	gdouble _tmp10_;
	gdouble _tmp11_;
	gdouble _tmp12_;
	gdouble _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	gboolean _tmp16_;
	gboolean _tmp17_;
	TubaDialogsComposerComponentsAttachmentsBinEditor* _tmp18_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (attachment != NULL);
	_tmp0_ = tuba_dialogs_composer_components_attachment_get_kind (attachment);
	_tmp1_ = _tmp0_;
	is_image = _tmp1_ == TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENT_MEDIA_TYPE_IMAGE;
	if (is_image) {
		GdkPaintable* _tmp3_;
		GdkPaintable* _tmp4_;
		_tmp3_ = tuba_dialogs_composer_components_attachment_get_paintable (attachment);
		_tmp4_ = _tmp3_;
		_tmp2_ = _tmp4_;
	} else {
		_tmp2_ = NULL;
	}
	if (is_image) {
		_tmp5_ = NULL;
	} else {
		GFile* _tmp6_;
		GFile* _tmp7_;
		_tmp6_ = tuba_dialogs_composer_components_attachment_get_file (attachment);
		_tmp7_ = _tmp6_;
		_tmp5_ = _tmp7_;
	}
	_tmp8_ = tuba_dialogs_composer_components_attachment_get_media_id (attachment);
	_tmp9_ = _tmp8_;
	_tmp10_ = tuba_dialogs_composer_components_attachment_get_pos_x (attachment);
	_tmp11_ = _tmp10_;
	_tmp12_ = tuba_dialogs_composer_components_attachment_get_pos_y (attachment);
	_tmp13_ = _tmp12_;
	_tmp14_ = tuba_dialogs_composer_components_attachment_get_alt_text (attachment);
	_tmp15_ = _tmp14_;
	_tmp16_ = tuba_dialogs_composer_components_attachment_get_edit_mode (attachment);
	_tmp17_ = _tmp16_;
	_tmp18_ = tuba_dialogs_composer_components_attachments_bin_editor_new (_tmp9_, _tmp2_, _tmp5_, (gfloat) _tmp11_, (gfloat) _tmp13_, _tmp15_, _tmp17_);
	g_object_ref_sink (_tmp18_);
	editor = _tmp18_;
	g_signal_connect_object (editor, "saved", (GCallback) _tuba_dialogs_composer_components_attachment_saved_tuba_dialogs_composer_components_attachments_bin_editor_saved, attachment, 0);
	g_signal_connect_object (editor, "saved", (GCallback) _tuba_dialogs_composer_components_attachments_bin_pop_req_tuba_dialogs_composer_components_attachments_bin_editor_saved, self, G_CONNECT_AFTER);
	g_signal_connect_object (editor, "toast", (GCallback) _tuba_dialogs_composer_components_attachments_bin_toast_req_tuba_dialogs_composer_components_attachments_bin_editor_toast, self, 0);
	g_signal_emit_by_name ((TubaDialogsComposerComponentsAttachable*) self, "push-subpage", (AdwNavigationPage*) editor);
	_g_object_unref0 (editor);
}

static void
tuba_dialogs_composer_components_attachments_bin_pop_req (TubaDialogsComposerComponentsAttachmentsBin* self)
{
	g_return_if_fail (self != NULL);
	g_signal_emit_by_name ((TubaDialogsComposerComponentsAttachable*) self, "pop-subpage");
}

static void
tuba_dialogs_composer_components_attachments_bin_toast_req (TubaDialogsComposerComponentsAttachmentsBin* self,
                                                            AdwToast* toast_obj)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (toast_obj != NULL);
	g_signal_emit_by_name ((TubaDialogsComposerComponentsAttachable*) self, "toast", toast_obj);
}

TubaDialogsComposerComponentsAttachmentsBin*
tuba_dialogs_composer_components_attachments_bin_construct (GType object_type)
{
	TubaDialogsComposerComponentsAttachmentsBin * self = NULL;
	self = (TubaDialogsComposerComponentsAttachmentsBin*) g_object_new (object_type, NULL);
	return self;
}

TubaDialogsComposerComponentsAttachmentsBin*
tuba_dialogs_composer_components_attachments_bin_new (void)
{
	return tuba_dialogs_composer_components_attachments_bin_construct (TUBA_DIALOGS_COMPOSER_COMPONENTS_TYPE_ATTACHMENTS_BIN);
}

static gboolean
tuba_dialogs_composer_components_attachments_bin_real_get_edit_mode (TubaDialogsComposerComponentsAttachable* base)
{
	gboolean result;
	TubaDialogsComposerComponentsAttachmentsBin* self;
	self = (TubaDialogsComposerComponentsAttachmentsBin*) base;
	result = self->priv->_edit_mode;
	return result;
}

static void
tuba_dialogs_composer_components_attachments_bin_real_set_edit_mode (TubaDialogsComposerComponentsAttachable* base,
                                                                     gboolean value)
{
	TubaDialogsComposerComponentsAttachmentsBin* self;
	gboolean old_value;
	self = (TubaDialogsComposerComponentsAttachmentsBin*) base;
	old_value = tuba_dialogs_composer_components_attachments_bin_real_get_edit_mode (base);
	if (old_value != value) {
		self->priv->_edit_mode = value;
		g_object_notify_by_pspec ((GObject *) self, tuba_dialogs_composer_components_attachments_bin_properties[TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDIT_MODE_PROPERTY]);
	}
}

gboolean
tuba_dialogs_composer_components_attachments_bin_get_working (TubaDialogsComposerComponentsAttachmentsBin* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_working;
	return result;
}

void
tuba_dialogs_composer_components_attachments_bin_set_working (TubaDialogsComposerComponentsAttachmentsBin* self,
                                                              gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_dialogs_composer_components_attachments_bin_get_working (self);
	if (old_value != value) {
		self->priv->_working = value;
		g_object_notify_by_pspec ((GObject *) self, tuba_dialogs_composer_components_attachments_bin_properties[TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_WORKING_PROPERTY]);
	}
}

gboolean
tuba_dialogs_composer_components_attachments_bin_get_is_empty (TubaDialogsComposerComponentsAttachmentsBin* self)
{
	gboolean result;
	GeeArrayList* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->attachment_widgets;
	_tmp1_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_ == 0;
	return result;
}

gboolean
tuba_dialogs_composer_components_attachments_bin_get_can_add_media (TubaDialogsComposerComponentsAttachmentsBin* self)
{
	gboolean result;
	gboolean has_only_images = FALSE;
	gboolean _tmp0_ = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	has_only_images = TRUE;
	if (has_only_images) {
		GeeArrayList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		TubaAccountStore* _tmp4_;
		TubaInstanceAccount* _tmp5_;
		TubaInstanceAccount* _tmp6_;
		TubaAPIInstance* _tmp7_;
		TubaAPIInstance* _tmp8_;
		gint64 _tmp9_;
		gint64 _tmp10_;
		_tmp1_ = self->priv->attachment_widgets;
		_tmp2_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = tuba_accounts;
		_tmp5_ = tuba_account_store_get_active (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = tuba_instance_account_get_instance_info (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = tuba_api_instance_get_compat_status_max_media_attachments (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp0_ = ((gint64) _tmp3_) < _tmp10_;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static inline gpointer
tuba_dialogs_composer_components_attachments_bin_editor_get_instance_private (TubaDialogsComposerComponentsAttachmentsBinEditor* self)
{
	return G_STRUCT_MEMBER_P (self, TubaDialogsComposerComponentsAttachmentsBinEditor_private_offset);
}

static void
tuba_dialogs_composer_components_attachments_bin_editor_on_alt_editor_buffer_change (TubaDialogsComposerComponentsAttachmentsBinEditor* self)
{
	gint total_count = 0;
	GtkSourceView* _tmp0_;
	GtkTextBuffer* _tmp1_;
	GtkTextBuffer* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gint _tmp6_;
	TubaDialogsComposerComponentsEditorPlaceholderHack* _tmp7_;
	gboolean t_val = FALSE;
	GtkLabel* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->alt_editor;
	_tmp1_ = gtk_text_view_get_buffer ((GtkTextView*) _tmp0_);
	_tmp2_ = _tmp1_;
	g_object_get (_tmp2_, "text", &_tmp3_, NULL);
	_tmp4_ = _tmp3_;
	_tmp5_ = _tmp4_;
	_tmp6_ = tuba_utils_counting_chars (_tmp5_, "en");
	_g_free0 (_tmp5_);
	total_count = _tmp6_;
	_tmp7_ = self->priv->placeholder;
	gtk_widget_set_visible ((GtkWidget*) _tmp7_, total_count == 0);
	t_val = ((gint64) total_count) < self->alt_max_chars;
	tuba_dialogs_composer_components_attachments_bin_editor_set_can_save (self, t_val);
	_tmp8_ = self->priv->dialog_char_counter;
	_tmp9_ = g_strdup_printf ("%" G_GINT64_FORMAT, self->alt_max_chars - total_count);
	_tmp10_ = _tmp9_;
	gtk_label_set_label (_tmp8_, _tmp10_);
	_g_free0 (_tmp10_);
	if (t_val) {
		GtkLabel* _tmp11_;
		_tmp11_ = self->priv->dialog_char_counter;
		gtk_widget_remove_css_class ((GtkWidget*) _tmp11_, "error");
	} else {
		GtkLabel* _tmp12_;
		_tmp12_ = self->priv->dialog_char_counter;
		gtk_widget_add_css_class ((GtkWidget*) _tmp12_, "error");
	}
}

static void
tuba_dialogs_composer_components_attachments_bin_editor_update_style_scheme (TubaDialogsComposerComponentsAttachmentsBinEditor* self)
{
	GtkSourceStyleSchemeManager* manager = NULL;
	GtkSourceStyleSchemeManager* _tmp0_;
	GtkSourceStyleSchemeManager* _tmp1_;
	gchar* scheme_name = NULL;
	gchar* _tmp2_;
	AdwStyleManager* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	GtkSourceView* _tmp8_;
	GtkTextBuffer* _tmp9_;
	GtkTextBuffer* _tmp10_;
	GtkSourceStyleSchemeManager* _tmp11_;
	const gchar* _tmp12_;
	GtkSourceStyleScheme* _tmp13_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_source_style_scheme_manager_get_default ();
	_tmp1_ = _g_object_ref0 (_tmp0_);
	manager = _tmp1_;
	_tmp2_ = g_strdup ("Adwaita");
	scheme_name = _tmp2_;
	_tmp3_ = adw_style_manager_get_default ();
	_tmp4_ = adw_style_manager_get_dark (_tmp3_);
	_tmp5_ = _tmp4_;
	if (_tmp5_) {
		const gchar* _tmp6_;
		gchar* _tmp7_;
		_tmp6_ = scheme_name;
		_tmp7_ = g_strconcat (_tmp6_, "-dark", NULL);
		_g_free0 (scheme_name);
		scheme_name = _tmp7_;
	}
	_tmp8_ = self->priv->alt_editor;
	_tmp9_ = gtk_text_view_get_buffer ((GtkTextView*) _tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = manager;
	_tmp12_ = scheme_name;
	_tmp13_ = gtk_source_style_scheme_manager_get_scheme (_tmp11_, _tmp12_);
	gtk_source_buffer_set_style_scheme (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, gtk_source_buffer_get_type (), GtkSourceBuffer), _tmp13_);
	_g_free0 (scheme_name);
	_g_object_unref0 (manager);
}

static void
tuba_dialogs_composer_components_attachments_bin_editor_on_save (TubaDialogsComposerComponentsAttachmentsBinEditor* self)
{
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	if (self->priv->working) {
		return;
	}
	_tmp0_ = self->priv->_edit_mode;
	if (_tmp0_) {
		gfloat _tmp1_;
		gfloat _tmp2_;
		GtkSourceView* _tmp3_;
		GtkTextBuffer* _tmp4_;
		GtkTextBuffer* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		AdwToast* _tmp9_;
		AdwToast* _tmp10_;
		_tmp1_ = self->priv->_pos_x;
		_tmp2_ = self->priv->_pos_y;
		_tmp3_ = self->priv->alt_editor;
		_tmp4_ = gtk_text_view_get_buffer ((GtkTextView*) _tmp3_);
		_tmp5_ = _tmp4_;
		g_object_get (_tmp5_, "text", &_tmp6_, NULL);
		_tmp7_ = _tmp6_;
		_tmp8_ = _tmp7_;
		g_signal_emit (self, tuba_dialogs_composer_components_attachments_bin_editor_signals[TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_SAVED_SIGNAL], 0, _tmp1_, _tmp2_, _tmp8_);
		_g_free0 (_tmp8_);
		_tmp9_ = adw_toast_new (_ ("Saved Media Metadata"));
		_tmp10_ = _tmp9_;
		g_signal_emit (self, tuba_dialogs_composer_components_attachments_bin_editor_signals[TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_TOAST_SIGNAL], 0, _tmp10_);
		_g_object_unref0 (_tmp10_);
		return;
	}
	self->priv->working = TRUE;
	tuba_dialogs_composer_components_attachments_bin_editor_put_alt_text (self, NULL, NULL);
}

static void
tuba_dialogs_composer_components_attachments_bin_editor_put_alt_text_data_free (gpointer _data)
{
	TubaDialogsComposerComponentsAttachmentsBinEditorPutAltTextData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (TubaDialogsComposerComponentsAttachmentsBinEditorPutAltTextData, _data_);
}

static void
tuba_dialogs_composer_components_attachments_bin_editor_put_alt_text (TubaDialogsComposerComponentsAttachmentsBinEditor* self,
                                                                      GAsyncReadyCallback _callback_,
                                                                      gpointer _user_data_)
{
	TubaDialogsComposerComponentsAttachmentsBinEditorPutAltTextData* _data_;
	TubaDialogsComposerComponentsAttachmentsBinEditor* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (TubaDialogsComposerComponentsAttachmentsBinEditorPutAltTextData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_dialogs_composer_components_attachments_bin_editor_put_alt_text_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	tuba_dialogs_composer_components_attachments_bin_editor_put_alt_text_co (_data_);
}

static void
tuba_dialogs_composer_components_attachments_bin_editor_put_alt_text_finish (TubaDialogsComposerComponentsAttachmentsBinEditor* self,
                                                                             GAsyncResult* _res_)
{
	TubaDialogsComposerComponentsAttachmentsBinEditorPutAltTextData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
tuba_dialogs_composer_components_attachments_bin_editor_put_alt_text_ready (GObject* source_object,
                                                                            GAsyncResult* _res_,
                                                                            gpointer _user_data_)
{
	TubaDialogsComposerComponentsAttachmentsBinEditorPutAltTextData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_dialogs_composer_components_attachments_bin_editor_put_alt_text_co (_data_);
}

static gboolean
tuba_dialogs_composer_components_attachments_bin_editor_put_alt_text_co (TubaDialogsComposerComponentsAttachmentsBinEditorPutAltTextData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = json_builder_new ();
	_data_->builder = _data_->_tmp0_;
	json_builder_begin_object (_data_->builder);
	json_builder_set_member_name (_data_->builder, "description");
	_data_->_tmp1_ = _data_->self->priv->alt_editor;
	_data_->_tmp2_ = gtk_text_view_get_buffer ((GtkTextView*) _data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	g_object_get (_data_->_tmp3_, "text", &_data_->_tmp4_, NULL);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = _data_->_tmp5_;
	json_builder_add_string_value (_data_->builder, _data_->_tmp6_);
	_g_free0 (_data_->_tmp6_);
	json_builder_set_member_name (_data_->builder, "focus");
	_data_->_tmp7_ = _data_->self->priv->_pos_x;
	_data_->_tmp8_ = tuba_utils_units_float_to_2_point_string (_data_->_tmp7_);
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_tmp10_ = _data_->self->priv->_pos_y;
	_data_->_tmp11_ = tuba_utils_units_float_to_2_point_string (_data_->_tmp10_);
	_data_->_tmp12_ = _data_->_tmp11_;
	_data_->_tmp13_ = g_strdup_printf ("%s,%s", _data_->_tmp9_, _data_->_tmp12_);
	_data_->_tmp14_ = _data_->_tmp13_;
	json_builder_add_string_value (_data_->builder, _data_->_tmp14_);
	_g_free0 (_data_->_tmp14_);
	_g_free0 (_data_->_tmp12_);
	_g_free0 (_data_->_tmp9_);
	json_builder_end_object (_data_->builder);
	_data_->_tmp15_ = _data_->self->priv->_media_id;
	_data_->_tmp16_ = string_to_string (_data_->_tmp15_);
	_data_->_tmp17_ = g_strconcat ("/api/v1/media/", _data_->_tmp16_, NULL);
	_data_->_tmp18_ = _data_->_tmp17_;
	_data_->_tmp19_ = tuba_accounts;
	_data_->_tmp20_ = tuba_account_store_get_active (_data_->_tmp19_);
	_data_->_tmp21_ = _data_->_tmp20_;
	_data_->_tmp22_ = _g_object_ref0 (_data_->_tmp21_);
	_data_->_tmp23_ = NULL;
	_data_->_tmp23_ = tuba_request_v2_new (_data_->_tmp18_, TUBA_REQUEST_V2_METHOD_PUT);
	tuba_request_v2_set_account (_data_->_tmp23_, _data_->_tmp22_);
	_g_object_unref0 (_data_->_tmp22_);
	_data_->_tmp24_ = _data_->_tmp23_;
	_g_free0 (_data_->_tmp18_);
	_data_->req = _data_->_tmp24_;
	tuba_request_v2_set_body_from_json (_data_->req, _data_->builder);
	{
		_data_->_state_ = 1;
		tuba_request_v2_exec (_data_->req, tuba_dialogs_composer_components_attachments_bin_editor_put_alt_text_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp25_ = tuba_request_v2_exec_finish (_data_->req, _data_->_res_, NULL, &_data_->_inner_error0_);
		_data_->_tmp26_ = _data_->_tmp25_;
		_g_object_unref0 (_data_->_tmp26_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp27_ = _data_->self->priv->_pos_x;
		_data_->_tmp28_ = _data_->self->priv->_pos_y;
		_data_->_tmp29_ = _data_->self->priv->alt_editor;
		_data_->_tmp30_ = gtk_text_view_get_buffer ((GtkTextView*) _data_->_tmp29_);
		_data_->_tmp31_ = _data_->_tmp30_;
		g_object_get (_data_->_tmp31_, "text", &_data_->_tmp32_, NULL);
		_data_->_tmp33_ = _data_->_tmp32_;
		_data_->_tmp34_ = _data_->_tmp33_;
		g_signal_emit (_data_->self, tuba_dialogs_composer_components_attachments_bin_editor_signals[TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_SAVED_SIGNAL], 0, _data_->_tmp27_, _data_->_tmp28_, _data_->_tmp34_);
		_g_free0 (_data_->_tmp34_);
		_data_->_tmp35_ = adw_toast_new (_ ("Saved Media Metadata"));
		_data_->_tmp36_ = _data_->_tmp35_;
		g_signal_emit (_data_->self, tuba_dialogs_composer_components_attachments_bin_editor_signals[TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_TOAST_SIGNAL], 0, _data_->_tmp36_);
		_g_object_unref0 (_data_->_tmp36_);
		_data_->self->priv->working = FALSE;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp37_ = _data_->e;
		_data_->_tmp38_ = g_strdup_printf ("%i", _data_->_tmp37_->code);
		_data_->_tmp39_ = _data_->_tmp38_;
		_data_->_tmp40_ = _data_->e;
		_data_->_tmp41_ = _data_->_tmp40_->message;
		_data_->_tmp42_ = string_to_string (_data_->_tmp41_);
		_data_->_tmp43_ = g_strconcat (_data_->_tmp39_, " ", _data_->_tmp42_, NULL);
		_data_->_tmp44_ = _data_->_tmp43_;
		_data_->_tmp45_ = adw_toast_new (_data_->_tmp44_);
		_data_->_tmp46_ = _data_->_tmp45_;
		g_signal_emit (_data_->self, tuba_dialogs_composer_components_attachments_bin_editor_signals[TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_TOAST_SIGNAL], 0, _data_->_tmp46_);
		_g_object_unref0 (_data_->_tmp46_);
		_g_free0 (_data_->_tmp44_);
		_g_free0 (_data_->_tmp39_);
		_data_->self->priv->working = FALSE;
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_object_unref0 (_data_->req);
		_g_object_unref0 (_data_->builder);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_g_object_unref0 (_data_->req);
	_g_object_unref0 (_data_->builder);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static TubaDialogsComposerComponentsAttachmentsBinEditor*
tuba_dialogs_composer_components_attachments_bin_editor_construct (GType object_type,
                                                                   const gchar* media_id,
                                                                   GdkPaintable* paintable,
                                                                   GFile* video,
                                                                   gfloat pos_x,
                                                                   gfloat pos_y,
                                                                   const gchar* alt_text,
                                                                   gboolean edit_mode)
{
	TubaDialogsComposerComponentsAttachmentsBinEditor * self = NULL;
	GtkSourceView* _tmp9_;
	GtkTextBuffer* _tmp10_;
	GtkTextBuffer* _tmp11_;
	g_return_val_if_fail (media_id != NULL, NULL);
	g_return_val_if_fail (alt_text != NULL, NULL);
	self = (TubaDialogsComposerComponentsAttachmentsBinEditor*) g_object_new (object_type, NULL);
	tuba_dialogs_composer_components_attachments_bin_editor_set_media_id (self, media_id);
	tuba_dialogs_composer_components_attachments_bin_editor_set_edit_mode (self, edit_mode);
	if (paintable != NULL) {
		TubaWidgetsFocusPicker* focus_picker = NULL;
		TubaWidgetsFocusPicker* _tmp0_;
		TubaWidgetsFocusPicker* _tmp1_;
		TubaWidgetsFocusPicker* _tmp2_;
		TubaWidgetsFocusPicker* _tmp3_;
		GtkBox* _tmp4_;
		TubaWidgetsFocusPicker* _tmp5_;
		_tmp0_ = tuba_widgets_focus_picker_new (paintable);
		g_object_ref_sink (_tmp0_);
		focus_picker = _tmp0_;
		_tmp1_ = focus_picker;
		g_object_bind_property_with_closures ((GObject*) _tmp1_, "pos-x", (GObject*) self, "pos-x", G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp2_ = focus_picker;
		g_object_bind_property_with_closures ((GObject*) _tmp2_, "pos-y", (GObject*) self, "pos-y", G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp3_ = focus_picker;
		gtk_widget_add_css_class ((GtkWidget*) _tmp3_, "attachment-editor-picker");
		_tmp4_ = self->priv->content_box;
		_tmp5_ = focus_picker;
		gtk_box_prepend (_tmp4_, (GtkWidget*) _tmp5_);
		_g_object_unref0 (focus_picker);
	} else {
		if (video != NULL) {
			GtkBox* _tmp6_;
			GtkVideo* _tmp7_;
			GtkVideo* _tmp8_;
			_tmp6_ = self->priv->content_box;
			_tmp7_ = (GtkVideo*) gtk_video_new_for_file (video);
			g_object_ref_sink (_tmp7_);
			_tmp8_ = _tmp7_;
			gtk_box_prepend (_tmp6_, (GtkWidget*) _tmp8_);
			_g_object_unref0 (_tmp8_);
		}
	}
	tuba_dialogs_composer_components_attachments_bin_editor_set_pos_x (self, pos_x);
	tuba_dialogs_composer_components_attachments_bin_editor_set_pos_y (self, pos_y);
	_tmp9_ = self->priv->alt_editor;
	_tmp10_ = gtk_text_view_get_buffer ((GtkTextView*) _tmp9_);
	_tmp11_ = _tmp10_;
	g_object_set (_tmp11_, "text", alt_text, NULL);
	return self;
}

static TubaDialogsComposerComponentsAttachmentsBinEditor*
tuba_dialogs_composer_components_attachments_bin_editor_new (const gchar* media_id,
                                                             GdkPaintable* paintable,
                                                             GFile* video,
                                                             gfloat pos_x,
                                                             gfloat pos_y,
                                                             const gchar* alt_text,
                                                             gboolean edit_mode)
{
	return tuba_dialogs_composer_components_attachments_bin_editor_construct (TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_TYPE_EDITOR, media_id, paintable, video, pos_x, pos_y, alt_text, edit_mode);
}

static gint
tuba_dialogs_composer_components_attachments_bin_editor_real_get_preferred_height (TubaDialogsComposerPreferredSizeable* base)
{
	gint result;
	TubaDialogsComposerComponentsAttachmentsBinEditor* self;
	self = (TubaDialogsComposerComponentsAttachmentsBinEditor*) base;
	result = self->priv->_preferred_height;
	return result;
}

static void
tuba_dialogs_composer_components_attachments_bin_editor_real_set_preferred_height (TubaDialogsComposerPreferredSizeable* base,
                                                                                   gint value)
{
	TubaDialogsComposerComponentsAttachmentsBinEditor* self;
	gint old_value;
	self = (TubaDialogsComposerComponentsAttachmentsBinEditor*) base;
	old_value = tuba_dialogs_composer_components_attachments_bin_editor_real_get_preferred_height (base);
	if (old_value != value) {
		self->priv->_preferred_height = value;
		g_object_notify_by_pspec ((GObject *) self, tuba_dialogs_composer_components_attachments_bin_editor_properties[TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_PREFERRED_HEIGHT_PROPERTY]);
	}
}

static gint
tuba_dialogs_composer_components_attachments_bin_editor_real_get_preferred_width (TubaDialogsComposerPreferredSizeable* base)
{
	gint result;
	TubaDialogsComposerComponentsAttachmentsBinEditor* self;
	self = (TubaDialogsComposerComponentsAttachmentsBinEditor*) base;
	result = self->priv->_preferred_width;
	return result;
}

static void
tuba_dialogs_composer_components_attachments_bin_editor_real_set_preferred_width (TubaDialogsComposerPreferredSizeable* base,
                                                                                  gint value)
{
	TubaDialogsComposerComponentsAttachmentsBinEditor* self;
	gint old_value;
	self = (TubaDialogsComposerComponentsAttachmentsBinEditor*) base;
	old_value = tuba_dialogs_composer_components_attachments_bin_editor_real_get_preferred_width (base);
	if (old_value != value) {
		self->priv->_preferred_width = value;
		g_object_notify_by_pspec ((GObject *) self, tuba_dialogs_composer_components_attachments_bin_editor_properties[TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_PREFERRED_WIDTH_PROPERTY]);
	}
}

static gboolean
tuba_dialogs_composer_components_attachments_bin_editor_get_can_save (TubaDialogsComposerComponentsAttachmentsBinEditor* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_can_save;
	return result;
}

static void
tuba_dialogs_composer_components_attachments_bin_editor_set_can_save (TubaDialogsComposerComponentsAttachmentsBinEditor* self,
                                                                      gboolean value)
{
	g_return_if_fail (self != NULL);
	self->priv->_can_save = value;
	adw_navigation_page_set_can_pop ((AdwNavigationPage*) self, self->priv->_can_save);
	g_object_notify_by_pspec ((GObject *) self, tuba_dialogs_composer_components_attachments_bin_editor_properties[TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_CAN_SAVE_PROPERTY]);
}

static gboolean
tuba_dialogs_composer_components_attachments_bin_editor_get_edit_mode (TubaDialogsComposerComponentsAttachmentsBinEditor* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_edit_mode;
	return result;
}

static void
tuba_dialogs_composer_components_attachments_bin_editor_set_edit_mode (TubaDialogsComposerComponentsAttachmentsBinEditor* self,
                                                                       gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_dialogs_composer_components_attachments_bin_editor_get_edit_mode (self);
	if (old_value != value) {
		self->priv->_edit_mode = value;
		g_object_notify_by_pspec ((GObject *) self, tuba_dialogs_composer_components_attachments_bin_editor_properties[TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_EDIT_MODE_PROPERTY]);
	}
}

static gfloat
tuba_dialogs_composer_components_attachments_bin_editor_get_pos_x (TubaDialogsComposerComponentsAttachmentsBinEditor* self)
{
	gfloat result;
	g_return_val_if_fail (self != NULL, -1.0F);
	result = self->priv->_pos_x;
	return result;
}

static void
tuba_dialogs_composer_components_attachments_bin_editor_set_pos_x (TubaDialogsComposerComponentsAttachmentsBinEditor* self,
                                                                   gfloat value)
{
	gfloat old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_dialogs_composer_components_attachments_bin_editor_get_pos_x (self);
	if (old_value != value) {
		self->priv->_pos_x = value;
		g_object_notify_by_pspec ((GObject *) self, tuba_dialogs_composer_components_attachments_bin_editor_properties[TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_POS_X_PROPERTY]);
	}
}

static gfloat
tuba_dialogs_composer_components_attachments_bin_editor_get_pos_y (TubaDialogsComposerComponentsAttachmentsBinEditor* self)
{
	gfloat result;
	g_return_val_if_fail (self != NULL, -1.0F);
	result = self->priv->_pos_y;
	return result;
}

static void
tuba_dialogs_composer_components_attachments_bin_editor_set_pos_y (TubaDialogsComposerComponentsAttachmentsBinEditor* self,
                                                                   gfloat value)
{
	gfloat old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_dialogs_composer_components_attachments_bin_editor_get_pos_y (self);
	if (old_value != value) {
		self->priv->_pos_y = value;
		g_object_notify_by_pspec ((GObject *) self, tuba_dialogs_composer_components_attachments_bin_editor_properties[TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_POS_Y_PROPERTY]);
	}
}

static const gchar*
tuba_dialogs_composer_components_attachments_bin_editor_get_media_id (TubaDialogsComposerComponentsAttachmentsBinEditor* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_media_id;
	result = _tmp0_;
	return result;
}

static void
tuba_dialogs_composer_components_attachments_bin_editor_set_media_id (TubaDialogsComposerComponentsAttachmentsBinEditor* self,
                                                                      const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_dialogs_composer_components_attachments_bin_editor_get_media_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_media_id);
		self->priv->_media_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_dialogs_composer_components_attachments_bin_editor_properties[TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_MEDIA_ID_PROPERTY]);
	}
}

static void
g_cclosure_user_marshal_VOID__FLOAT_FLOAT_STRING (GClosure * closure,
                                                  GValue * return_value,
                                                  guint n_param_values,
                                                  const GValue * param_values,
                                                  gpointer invocation_hint,
                                                  gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__FLOAT_FLOAT_STRING) (gpointer data1, gfloat arg_1, gfloat arg_2, const char* arg_3, gpointer data2);
	register GMarshalFunc_VOID__FLOAT_FLOAT_STRING callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 4);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__FLOAT_FLOAT_STRING) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_float (param_values + 1), g_value_get_float (param_values + 2), g_value_get_string (param_values + 3), data2);
}

static void
_tuba_dialogs_composer_components_attachments_bin_editor_update_style_scheme_g_object_notify (GObject* _sender,
                                                                                              GParamSpec* pspec,
                                                                                              gpointer self)
{
	tuba_dialogs_composer_components_attachments_bin_editor_update_style_scheme ((TubaDialogsComposerComponentsAttachmentsBinEditor*) self);
}

static void
_tuba_dialogs_composer_components_attachments_bin_editor_on_alt_editor_buffer_change_gtk_text_buffer_changed (GtkTextBuffer* _sender,
                                                                                                              gpointer self)
{
	tuba_dialogs_composer_components_attachments_bin_editor_on_alt_editor_buffer_change ((TubaDialogsComposerComponentsAttachmentsBinEditor*) self);
}

static void
_tuba_dialogs_composer_components_attachments_bin_editor_on_save_adw_navigation_page_hidden (AdwNavigationPage* _sender,
                                                                                             gpointer self)
{
	tuba_dialogs_composer_components_attachments_bin_editor_on_save ((TubaDialogsComposerComponentsAttachmentsBinEditor*) self);
}

static GObject *
tuba_dialogs_composer_components_attachments_bin_editor_constructor (GType type,
                                                                     guint n_construct_properties,
                                                                     GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	TubaDialogsComposerComponentsAttachmentsBinEditor * self;
	AdwToolbarView* toolbar_view = NULL;
	AdwToolbarView* _tmp0_;
	AdwHeaderBar* headerbar = NULL;
	AdwHeaderBar* _tmp1_ = NULL;
	GtkBox* _tmp2_;
	AdwToolbarView* _tmp3_;
	GtkBox* _tmp4_;
	AdwToolbarView* _tmp5_;
	AdwHeaderBar* _tmp6_;
	GtkSourceView* _tmp7_ = NULL;
	GtkSourceView* _tmp8_;
	GtkSourceView* _tmp9_;
	GtkAlign _tmp10_ = 0;
	GtkLabel* _tmp11_ = NULL;
	GtkLabel* _tmp12_;
	TubaDialogsComposerComponentsEditorPlaceholderHack* _tmp13_;
	GtkSourceView* _tmp14_;
	TubaDialogsComposerComponentsEditorPlaceholderHack* _tmp15_;
	GtkSourceView* _tmp16_;
	AdwStyleManager* _tmp17_;
	SpellingTextBufferAdapter* adapter = NULL;
	GtkSourceView* _tmp18_;
	GtkTextBuffer* _tmp19_;
	GtkTextBuffer* _tmp20_;
	SpellingChecker* _tmp21_;
	SpellingTextBufferAdapter* _tmp22_;
	GtkSourceView* _tmp23_;
	SpellingTextBufferAdapter* _tmp24_;
	GMenuModel* _tmp25_;
	GtkSourceView* _tmp26_;
	SpellingTextBufferAdapter* _tmp27_;
	SpellingTextBufferAdapter* _tmp28_;
	GtkBox* _tmp29_;
	GtkSourceView* _tmp30_;
	GtkWidget* _tmp31_;
	GtkScrolledWindow* _tmp32_ = NULL;
	GtkScrolledWindow* _tmp33_;
	gchar* _tmp34_;
	gchar* _tmp35_;
	gchar* _tmp36_;
	gchar* _tmp37_;
	gchar* _tmp38_;
	gchar** _tmp39_;
	GtkLabel* _tmp40_ = NULL;
	AdwHeaderBar* _tmp41_;
	GtkLabel* _tmp42_;
	GtkSourceView* _tmp43_;
	GtkTextBuffer* _tmp44_;
	GtkTextBuffer* _tmp45_;
	TubaDialogsComposerPreferredSizeBin* psb = NULL;
	AdwToolbarView* _tmp46_;
	GtkWidget* _tmp47_;
	TubaDialogsComposerPreferredSizeBin* _tmp48_ = NULL;
	TubaDialogsComposerPreferredSizeBin* _tmp49_;
	TubaDialogsComposerPreferredSizeBin* _tmp50_;
	TubaDialogsComposerPreferredSizeBin* _tmp51_;
	parent_class = G_OBJECT_CLASS (tuba_dialogs_composer_components_attachments_bin_editor_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_TYPE_EDITOR, TubaDialogsComposerComponentsAttachmentsBinEditor);
	adw_navigation_page_set_title ((AdwNavigationPage*) self, _ ("Attachment Editor"));
	_tmp0_ = (AdwToolbarView*) adw_toolbar_view_new ();
	g_object_ref_sink (_tmp0_);
	toolbar_view = _tmp0_;
	_tmp1_ = (AdwHeaderBar*) adw_header_bar_new ();
	adw_header_bar_set_show_end_title_buttons (_tmp1_, FALSE);
	adw_header_bar_set_show_start_title_buttons (_tmp1_, FALSE);
	adw_header_bar_set_show_title (_tmp1_, FALSE);
	g_object_ref_sink (_tmp1_);
	headerbar = _tmp1_;
	_tmp2_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->content_box);
	self->priv->content_box = _tmp2_;
	_tmp3_ = toolbar_view;
	_tmp4_ = self->priv->content_box;
	adw_toolbar_view_set_content (_tmp3_, (GtkWidget*) _tmp4_);
	_tmp5_ = toolbar_view;
	_tmp6_ = headerbar;
	adw_toolbar_view_add_top_bar (_tmp5_, (GtkWidget*) _tmp6_);
	_tmp7_ = (GtkSourceView*) gtk_source_view_new ();
	gtk_widget_set_vexpand ((GtkWidget*) _tmp7_, TRUE);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp7_, TRUE);
	gtk_text_view_set_accepts_tab ((GtkTextView*) _tmp7_, FALSE);
	gtk_text_view_set_wrap_mode ((GtkTextView*) _tmp7_, GTK_WRAP_WORD_CHAR);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp7_, 6);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp7_, 6);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp7_, 6);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp7_, 6);
	gtk_text_view_set_input_hints ((GtkTextView*) _tmp7_, (GTK_INPUT_HINT_WORD_COMPLETION | GTK_INPUT_HINT_SPELLCHECK) | GTK_INPUT_HINT_EMOJI);
	g_object_ref_sink (_tmp7_);
	_g_object_unref0 (self->priv->alt_editor);
	self->priv->alt_editor = _tmp7_;
	_tmp8_ = self->priv->alt_editor;
	gtk_widget_remove_css_class ((GtkWidget*) _tmp8_, "view");
	_tmp9_ = self->priv->alt_editor;
	gtk_widget_add_css_class ((GtkWidget*) _tmp9_, "reset");
	if (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL) {
		_tmp10_ = GTK_ALIGN_END;
	} else {
		_tmp10_ = GTK_ALIGN_START;
	}
	_tmp11_ = (GtkLabel*) gtk_label_new (_ ("Describe the media…"));
	gtk_widget_set_valign ((GtkWidget*) _tmp11_, GTK_ALIGN_START);
	gtk_widget_set_halign ((GtkWidget*) _tmp11_, _tmp10_);
	gtk_label_set_justify (_tmp11_, GTK_JUSTIFY_FILL);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp11_, 3);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp11_, 3);
	gtk_label_set_wrap (_tmp11_, TRUE);
	gtk_label_set_wrap_mode (_tmp11_, PANGO_WRAP_WORD_CHAR);
	gtk_widget_set_sensitive ((GtkWidget*) _tmp11_, FALSE);
	g_object_ref_sink (_tmp11_);
	_tmp12_ = _tmp11_;
	_tmp13_ = tuba_dialogs_composer_components_editor_placeholder_hack_new (_tmp12_);
	g_object_ref_sink (_tmp13_);
	_g_object_unref0 (self->priv->placeholder);
	self->priv->placeholder = _tmp13_;
	_g_object_unref0 (_tmp12_);
	_tmp14_ = self->priv->alt_editor;
	_tmp15_ = self->priv->placeholder;
	gtk_text_view_add_overlay ((GtkTextView*) _tmp14_, (GtkWidget*) _tmp15_, 0, 0);
	_tmp16_ = self->priv->alt_editor;
	gtk_accessible_update_property ((GtkAccessible*) _tmp16_, GTK_ACCESSIBLE_PROPERTY_PLACEHOLDER, _ ("Describe the media…"), -1, -1);
	_tmp17_ = adw_style_manager_get_default ();
	g_signal_connect_object ((GObject*) _tmp17_, "notify::dark", (GCallback) _tuba_dialogs_composer_components_attachments_bin_editor_update_style_scheme_g_object_notify, self, 0);
	tuba_dialogs_composer_components_attachments_bin_editor_update_style_scheme (self);
	_tmp18_ = self->priv->alt_editor;
	_tmp19_ = gtk_text_view_get_buffer ((GtkTextView*) _tmp18_);
	_tmp20_ = _tmp19_;
	_tmp21_ = spelling_checker_get_default ();
	_tmp22_ = spelling_text_buffer_adapter_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, gtk_source_buffer_get_type (), GtkSourceBuffer), _tmp21_);
	adapter = _tmp22_;
	_tmp23_ = self->priv->alt_editor;
	_tmp24_ = adapter;
	_tmp25_ = spelling_text_buffer_adapter_get_menu_model (_tmp24_);
	gtk_text_view_set_extra_menu ((GtkTextView*) _tmp23_, _tmp25_);
	_tmp26_ = self->priv->alt_editor;
	_tmp27_ = adapter;
	gtk_widget_insert_action_group ((GtkWidget*) _tmp26_, "spelling", (GActionGroup*) _tmp27_);
	_tmp28_ = adapter;
	spelling_text_buffer_adapter_set_enabled (_tmp28_, TRUE);
	_tmp29_ = self->priv->content_box;
	_tmp30_ = self->priv->alt_editor;
	_tmp31_ = _g_object_ref0 ((GtkWidget*) _tmp30_);
	_tmp32_ = (GtkScrolledWindow*) gtk_scrolled_window_new ();
	gtk_widget_set_hexpand ((GtkWidget*) _tmp32_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp32_, TRUE);
	gtk_scrolled_window_set_child (_tmp32_, _tmp31_);
	_g_object_unref0 (_tmp31_);
	gtk_scrolled_window_set_propagate_natural_height (_tmp32_, TRUE);
	gtk_scrolled_window_set_max_content_height (_tmp32_, 209);
	g_object_ref_sink (_tmp32_);
	_tmp33_ = _tmp32_;
	gtk_box_append (_tmp29_, (GtkWidget*) _tmp33_);
	_g_object_unref0 (_tmp33_);
	_tmp34_ = g_strdup_printf ("%" G_GINT64_FORMAT, self->alt_max_chars);
	_tmp35_ = _tmp34_;
	_tmp36_ = g_strdup (_ ("Remaining Characters"));
	_tmp37_ = g_strdup ("numeric");
	_tmp38_ = g_strdup ("dimmed");
	_tmp39_ = g_new0 (gchar*, 2 + 1);
	_tmp39_[0] = _tmp37_;
	_tmp39_[1] = _tmp38_;
	_tmp40_ = (GtkLabel*) gtk_label_new (_tmp35_);
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp40_, _tmp36_);
	_g_free0 (_tmp36_);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp40_, _tmp39_);
	_tmp39_ = (_vala_array_free (_tmp39_, 2, (GDestroyNotify) g_free), NULL);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp40_, 6);
	g_object_ref_sink (_tmp40_);
	_g_object_unref0 (self->priv->dialog_char_counter);
	self->priv->dialog_char_counter = _tmp40_;
	_g_free0 (_tmp35_);
	_tmp41_ = headerbar;
	_tmp42_ = self->priv->dialog_char_counter;
	adw_header_bar_pack_end (_tmp41_, (GtkWidget*) _tmp42_);
	_tmp43_ = self->priv->alt_editor;
	_tmp44_ = gtk_text_view_get_buffer ((GtkTextView*) _tmp43_);
	_tmp45_ = _tmp44_;
	g_signal_connect_object (_tmp45_, "changed", (GCallback) _tuba_dialogs_composer_components_attachments_bin_editor_on_alt_editor_buffer_change_gtk_text_buffer_changed, self, 0);
	_tmp46_ = toolbar_view;
	_tmp47_ = _g_object_ref0 ((GtkWidget*) _tmp46_);
	_tmp48_ = tuba_dialogs_composer_preferred_size_bin_new ();
	tuba_dialogs_composer_preferred_size_bin_set_child (_tmp48_, _tmp47_);
	_g_object_unref0 (_tmp47_);
	g_object_ref_sink (_tmp48_);
	psb = _tmp48_;
	_tmp49_ = psb;
	g_object_bind_property_with_closures ((GObject*) self, "preferred-height", (GObject*) _tmp49_, "height", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp50_ = psb;
	g_object_bind_property_with_closures ((GObject*) self, "preferred-width", (GObject*) _tmp50_, "width", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp51_ = psb;
	adw_navigation_page_set_child ((AdwNavigationPage*) self, (GtkWidget*) _tmp51_);
	g_signal_connect_object ((AdwNavigationPage*) self, "hidden", (GCallback) _tuba_dialogs_composer_components_attachments_bin_editor_on_save_adw_navigation_page_hidden, self, 0);
	_g_object_unref0 (psb);
	_g_object_unref0 (adapter);
	_g_object_unref0 (headerbar);
	_g_object_unref0 (toolbar_view);
	return obj;
}

static void
tuba_dialogs_composer_components_attachments_bin_editor_class_init (TubaDialogsComposerComponentsAttachmentsBinEditorClass * klass,
                                                                    gpointer klass_data)
{
	tuba_dialogs_composer_components_attachments_bin_editor_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaDialogsComposerComponentsAttachmentsBinEditor_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_dialogs_composer_components_attachments_bin_editor_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_dialogs_composer_components_attachments_bin_editor_set_property;
	G_OBJECT_CLASS (klass)->constructor = tuba_dialogs_composer_components_attachments_bin_editor_constructor;
	G_OBJECT_CLASS (klass)->finalize = tuba_dialogs_composer_components_attachments_bin_editor_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_PREFERRED_HEIGHT_PROPERTY, tuba_dialogs_composer_components_attachments_bin_editor_properties[TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_PREFERRED_HEIGHT_PROPERTY] = g_param_spec_int ("preferred-height", "preferred-height", "preferred-height", G_MININT, G_MAXINT, -1, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_PREFERRED_WIDTH_PROPERTY, tuba_dialogs_composer_components_attachments_bin_editor_properties[TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_PREFERRED_WIDTH_PROPERTY] = g_param_spec_int ("preferred-width", "preferred-width", "preferred-width", G_MININT, G_MAXINT, -1, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_CAN_SAVE_PROPERTY, tuba_dialogs_composer_components_attachments_bin_editor_properties[TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_CAN_SAVE_PROPERTY] = g_param_spec_boolean ("can-save", "can-save", "can-save", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_EDIT_MODE_PROPERTY, tuba_dialogs_composer_components_attachments_bin_editor_properties[TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_EDIT_MODE_PROPERTY] = g_param_spec_boolean ("edit-mode", "edit-mode", "edit-mode", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_POS_X_PROPERTY, tuba_dialogs_composer_components_attachments_bin_editor_properties[TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_POS_X_PROPERTY] = g_param_spec_float ("pos-x", "pos-x", "pos-x", -G_MAXFLOAT, G_MAXFLOAT, 0.0f, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_POS_Y_PROPERTY, tuba_dialogs_composer_components_attachments_bin_editor_properties[TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_POS_Y_PROPERTY] = g_param_spec_float ("pos-y", "pos-y", "pos-y", -G_MAXFLOAT, G_MAXFLOAT, 0.0f, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_MEDIA_ID_PROPERTY, tuba_dialogs_composer_components_attachments_bin_editor_properties[TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_MEDIA_ID_PROPERTY] = g_param_spec_string ("media-id", "media-id", "media-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	tuba_dialogs_composer_components_attachments_bin_editor_signals[TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_SAVED_SIGNAL] = g_signal_new ("saved", TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_TYPE_EDITOR, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__FLOAT_FLOAT_STRING, G_TYPE_NONE, 3, G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_STRING);
	tuba_dialogs_composer_components_attachments_bin_editor_signals[TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_TOAST_SIGNAL] = g_signal_new ("toast", TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_TYPE_EDITOR, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, adw_toast_get_type ());
}

static void
tuba_dialogs_composer_components_attachments_bin_editor_tuba_dialogs_composer_preferred_sizeable_interface_init (TubaDialogsComposerPreferredSizeableIface * iface,
                                                                                                                 gpointer iface_data)
{
	tuba_dialogs_composer_components_attachments_bin_editor_tuba_dialogs_composer_preferred_sizeable_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_preferred_height = tuba_dialogs_composer_components_attachments_bin_editor_real_get_preferred_height;
	iface->set_preferred_height = tuba_dialogs_composer_components_attachments_bin_editor_real_set_preferred_height;
	iface->get_preferred_width = tuba_dialogs_composer_components_attachments_bin_editor_real_get_preferred_width;
	iface->set_preferred_width = tuba_dialogs_composer_components_attachments_bin_editor_real_set_preferred_width;
}

static void
tuba_dialogs_composer_components_attachments_bin_editor_instance_init (TubaDialogsComposerComponentsAttachmentsBinEditor * self,
                                                                       gpointer klass)
{
	TubaAccountStore* _tmp0_;
	TubaInstanceAccount* _tmp1_;
	TubaInstanceAccount* _tmp2_;
	TubaAPIInstance* _tmp3_;
	TubaAPIInstance* _tmp4_;
	gint64 _tmp5_;
	gint64 _tmp6_;
	self->priv = tuba_dialogs_composer_components_attachments_bin_editor_get_instance_private (self);
	self->priv->_preferred_height = -1;
	self->priv->_preferred_width = -1;
	self->priv->_can_save = FALSE;
	_tmp0_ = tuba_accounts;
	_tmp1_ = tuba_account_store_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = tuba_instance_account_get_instance_info (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = tuba_api_instance_get_tuba_max_alt_chars (_tmp4_);
	_tmp6_ = _tmp5_;
	self->alt_max_chars = _tmp6_;
	self->priv->_edit_mode = FALSE;
	self->priv->_pos_x = 0.0f;
	self->priv->_pos_y = 0.0f;
	self->priv->working = FALSE;
}

static void
tuba_dialogs_composer_components_attachments_bin_editor_finalize (GObject * obj)
{
	TubaDialogsComposerComponentsAttachmentsBinEditor * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_TYPE_EDITOR, TubaDialogsComposerComponentsAttachmentsBinEditor);
	g_debug ("AttachmentsBin.vala:67: Destroying Composer Attachment Editor");
	_g_free0 (self->priv->_media_id);
	_g_object_unref0 (self->priv->alt_editor);
	_g_object_unref0 (self->priv->placeholder);
	_g_object_unref0 (self->priv->content_box);
	_g_object_unref0 (self->priv->dialog_char_counter);
	G_OBJECT_CLASS (tuba_dialogs_composer_components_attachments_bin_editor_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_dialogs_composer_components_attachments_bin_editor_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaDialogsComposerComponentsAttachmentsBinEditorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_dialogs_composer_components_attachments_bin_editor_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaDialogsComposerComponentsAttachmentsBinEditor), 0, (GInstanceInitFunc) tuba_dialogs_composer_components_attachments_bin_editor_instance_init, NULL };
	static const GInterfaceInfo tuba_dialogs_composer_preferred_sizeable_info = { (GInterfaceInitFunc) tuba_dialogs_composer_components_attachments_bin_editor_tuba_dialogs_composer_preferred_sizeable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType tuba_dialogs_composer_components_attachments_bin_editor_type_id;
	tuba_dialogs_composer_components_attachments_bin_editor_type_id = g_type_register_static (adw_navigation_page_get_type (), "TubaDialogsComposerComponentsAttachmentsBinEditor", &g_define_type_info, G_TYPE_FLAG_NONE);
	g_type_add_interface_static (tuba_dialogs_composer_components_attachments_bin_editor_type_id, TUBA_DIALOGS_COMPOSER_TYPE_PREFERRED_SIZEABLE, &tuba_dialogs_composer_preferred_sizeable_info);
	TubaDialogsComposerComponentsAttachmentsBinEditor_private_offset = g_type_add_instance_private (tuba_dialogs_composer_components_attachments_bin_editor_type_id, sizeof (TubaDialogsComposerComponentsAttachmentsBinEditorPrivate));
	return tuba_dialogs_composer_components_attachments_bin_editor_type_id;
}

static GType
tuba_dialogs_composer_components_attachments_bin_editor_get_type (void)
{
	static GType tuba_dialogs_composer_components_attachments_bin_editor_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_dialogs_composer_components_attachments_bin_editor_type_id__once)) {
		GType tuba_dialogs_composer_components_attachments_bin_editor_type_id;
		tuba_dialogs_composer_components_attachments_bin_editor_type_id = tuba_dialogs_composer_components_attachments_bin_editor_get_type_once ();
		g_once_init_leave_pointer (&tuba_dialogs_composer_components_attachments_bin_editor_type_id__once, tuba_dialogs_composer_components_attachments_bin_editor_type_id);
	}
	return tuba_dialogs_composer_components_attachments_bin_editor_type_id__once;
}

static void
_vala_tuba_dialogs_composer_components_attachments_bin_editor_get_property (GObject * object,
                                                                            guint property_id,
                                                                            GValue * value,
                                                                            GParamSpec * pspec)
{
	TubaDialogsComposerComponentsAttachmentsBinEditor * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_TYPE_EDITOR, TubaDialogsComposerComponentsAttachmentsBinEditor);
	switch (property_id) {
		case TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_PREFERRED_HEIGHT_PROPERTY:
		g_value_set_int (value, tuba_dialogs_composer_preferred_sizeable_get_preferred_height ((TubaDialogsComposerPreferredSizeable*) self));
		break;
		case TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_PREFERRED_WIDTH_PROPERTY:
		g_value_set_int (value, tuba_dialogs_composer_preferred_sizeable_get_preferred_width ((TubaDialogsComposerPreferredSizeable*) self));
		break;
		case TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_CAN_SAVE_PROPERTY:
		g_value_set_boolean (value, tuba_dialogs_composer_components_attachments_bin_editor_get_can_save (self));
		break;
		case TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_EDIT_MODE_PROPERTY:
		g_value_set_boolean (value, tuba_dialogs_composer_components_attachments_bin_editor_get_edit_mode (self));
		break;
		case TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_POS_X_PROPERTY:
		g_value_set_float (value, tuba_dialogs_composer_components_attachments_bin_editor_get_pos_x (self));
		break;
		case TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_POS_Y_PROPERTY:
		g_value_set_float (value, tuba_dialogs_composer_components_attachments_bin_editor_get_pos_y (self));
		break;
		case TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_MEDIA_ID_PROPERTY:
		g_value_set_string (value, tuba_dialogs_composer_components_attachments_bin_editor_get_media_id (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_dialogs_composer_components_attachments_bin_editor_set_property (GObject * object,
                                                                            guint property_id,
                                                                            const GValue * value,
                                                                            GParamSpec * pspec)
{
	TubaDialogsComposerComponentsAttachmentsBinEditor * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_TYPE_EDITOR, TubaDialogsComposerComponentsAttachmentsBinEditor);
	switch (property_id) {
		case TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_PREFERRED_HEIGHT_PROPERTY:
		tuba_dialogs_composer_preferred_sizeable_set_preferred_height ((TubaDialogsComposerPreferredSizeable*) self, g_value_get_int (value));
		break;
		case TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_PREFERRED_WIDTH_PROPERTY:
		tuba_dialogs_composer_preferred_sizeable_set_preferred_width ((TubaDialogsComposerPreferredSizeable*) self, g_value_get_int (value));
		break;
		case TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_CAN_SAVE_PROPERTY:
		tuba_dialogs_composer_components_attachments_bin_editor_set_can_save (self, g_value_get_boolean (value));
		break;
		case TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_EDIT_MODE_PROPERTY:
		tuba_dialogs_composer_components_attachments_bin_editor_set_edit_mode (self, g_value_get_boolean (value));
		break;
		case TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_POS_X_PROPERTY:
		tuba_dialogs_composer_components_attachments_bin_editor_set_pos_x (self, g_value_get_float (value));
		break;
		case TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_POS_Y_PROPERTY:
		tuba_dialogs_composer_components_attachments_bin_editor_set_pos_y (self, g_value_get_float (value));
		break;
		case TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDITOR_MEDIA_ID_PROPERTY:
		tuba_dialogs_composer_components_attachments_bin_editor_set_media_id (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

void
tuba_dialogs_composer_components_attachments_bin_metadata_copy (const TubaDialogsComposerComponentsAttachmentsBinMetadata* self,
                                                                TubaDialogsComposerComponentsAttachmentsBinMetadata* dest)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	_tmp0_ = (*self).id;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 ((*dest).id);
	(*dest).id = _tmp1_;
	_tmp2_ = (*self).description;
	_tmp3_ = g_strdup (_tmp2_);
	_g_free0 ((*dest).description);
	(*dest).description = _tmp3_;
	_tmp4_ = (*self).focus;
	_tmp5_ = g_strdup (_tmp4_);
	_g_free0 ((*dest).focus);
	(*dest).focus = _tmp5_;
}

void
tuba_dialogs_composer_components_attachments_bin_metadata_destroy (TubaDialogsComposerComponentsAttachmentsBinMetadata* self)
{
	_g_free0 ((*self).id);
	_g_free0 ((*self).description);
	_g_free0 ((*self).focus);
}

TubaDialogsComposerComponentsAttachmentsBinMetadata*
tuba_dialogs_composer_components_attachments_bin_metadata_dup (const TubaDialogsComposerComponentsAttachmentsBinMetadata* self)
{
	TubaDialogsComposerComponentsAttachmentsBinMetadata* dup;
	dup = g_new0 (TubaDialogsComposerComponentsAttachmentsBinMetadata, 1);
	tuba_dialogs_composer_components_attachments_bin_metadata_copy (self, dup);
	return dup;
}

void
tuba_dialogs_composer_components_attachments_bin_metadata_free (TubaDialogsComposerComponentsAttachmentsBinMetadata* self)
{
	tuba_dialogs_composer_components_attachments_bin_metadata_destroy (self);
	g_free (self);
}

 G_GNUC_NO_INLINE static GType
tuba_dialogs_composer_components_attachments_bin_metadata_get_type_once (void)
{
	GType tuba_dialogs_composer_components_attachments_bin_metadata_type_id;
	tuba_dialogs_composer_components_attachments_bin_metadata_type_id = g_boxed_type_register_static ("TubaDialogsComposerComponentsAttachmentsBinMetadata", (GBoxedCopyFunc) tuba_dialogs_composer_components_attachments_bin_metadata_dup, (GBoxedFreeFunc) tuba_dialogs_composer_components_attachments_bin_metadata_free);
	return tuba_dialogs_composer_components_attachments_bin_metadata_type_id;
}

GType
tuba_dialogs_composer_components_attachments_bin_metadata_get_type (void)
{
	static GType tuba_dialogs_composer_components_attachments_bin_metadata_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_dialogs_composer_components_attachments_bin_metadata_type_id__once)) {
		GType tuba_dialogs_composer_components_attachments_bin_metadata_type_id;
		tuba_dialogs_composer_components_attachments_bin_metadata_type_id = tuba_dialogs_composer_components_attachments_bin_metadata_get_type_once ();
		g_once_init_leave_pointer (&tuba_dialogs_composer_components_attachments_bin_metadata_type_id__once, tuba_dialogs_composer_components_attachments_bin_metadata_type_id);
	}
	return tuba_dialogs_composer_components_attachments_bin_metadata_type_id__once;
}

static GObject *
tuba_dialogs_composer_components_attachments_bin_constructor (GType type,
                                                              guint n_construct_properties,
                                                              GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	TubaDialogsComposerComponentsAttachmentsBin * self;
	AdwBin* _tmp0_ = NULL;
	AdwBin* _tmp1_;
	AdwBin* _tmp2_ = NULL;
	AdwBin* _tmp3_;
	parent_class = G_OBJECT_CLASS (tuba_dialogs_composer_components_attachments_bin_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_DIALOGS_COMPOSER_COMPONENTS_TYPE_ATTACHMENTS_BIN, TubaDialogsComposerComponentsAttachmentsBin);
	tuba_dialogs_composer_components_attachments_bin_populate_filter (self);
	gtk_grid_set_row_spacing ((GtkGrid*) self, 12);
	gtk_grid_set_column_spacing ((GtkGrid*) self, 12);
	gtk_grid_set_column_homogeneous ((GtkGrid*) self, TRUE);
	gtk_grid_set_row_homogeneous ((GtkGrid*) self, TRUE);
	_tmp0_ = (AdwBin*) adw_bin_new ();
	gtk_widget_set_can_target ((GtkWidget*) _tmp0_, FALSE);
	gtk_widget_set_focusable ((GtkWidget*) _tmp0_, FALSE);
	gtk_widget_set_can_focus ((GtkWidget*) _tmp0_, FALSE);
	g_object_set ((GtkAccessible*) _tmp0_, "accessible-role", GTK_ACCESSIBLE_ROLE_PRESENTATION, NULL);
	g_object_ref_sink (_tmp0_);
	_tmp1_ = _tmp0_;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp1_, 0, 0, 1, 1);
	_g_object_unref0 (_tmp1_);
	_tmp2_ = (AdwBin*) adw_bin_new ();
	gtk_widget_set_can_target ((GtkWidget*) _tmp2_, FALSE);
	gtk_widget_set_focusable ((GtkWidget*) _tmp2_, FALSE);
	gtk_widget_set_can_focus ((GtkWidget*) _tmp2_, FALSE);
	g_object_set ((GtkAccessible*) _tmp2_, "accessible-role", GTK_ACCESSIBLE_ROLE_PRESENTATION, NULL);
	g_object_ref_sink (_tmp2_);
	_tmp3_ = _tmp2_;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp3_, 1, 0, 1, 1);
	_g_object_unref0 (_tmp3_);
	return obj;
}

static void
tuba_dialogs_composer_components_attachments_bin_class_init (TubaDialogsComposerComponentsAttachmentsBinClass * klass,
                                                             gpointer klass_data)
{
	tuba_dialogs_composer_components_attachments_bin_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaDialogsComposerComponentsAttachmentsBin_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_dialogs_composer_components_attachments_bin_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_dialogs_composer_components_attachments_bin_set_property;
	G_OBJECT_CLASS (klass)->constructor = tuba_dialogs_composer_components_attachments_bin_constructor;
	G_OBJECT_CLASS (klass)->finalize = tuba_dialogs_composer_components_attachments_bin_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDIT_MODE_PROPERTY, tuba_dialogs_composer_components_attachments_bin_properties[TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDIT_MODE_PROPERTY] = g_param_spec_boolean ("edit-mode", "edit-mode", "edit-mode", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_WORKING_PROPERTY, tuba_dialogs_composer_components_attachments_bin_properties[TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_WORKING_PROPERTY] = g_param_spec_boolean ("working", "working", "working", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_IS_EMPTY_PROPERTY, tuba_dialogs_composer_components_attachments_bin_properties[TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_IS_EMPTY_PROPERTY] = g_param_spec_boolean ("is-empty", "is-empty", "is-empty", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_CAN_ADD_MEDIA_PROPERTY, tuba_dialogs_composer_components_attachments_bin_properties[TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_CAN_ADD_MEDIA_PROPERTY] = g_param_spec_boolean ("can-add-media", "can-add-media", "can-add-media", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
tuba_dialogs_composer_components_attachments_bin_tuba_dialogs_composer_components_attachable_interface_init (TubaDialogsComposerComponentsAttachableIface * iface,
                                                                                                             gpointer iface_data)
{
	tuba_dialogs_composer_components_attachments_bin_tuba_dialogs_composer_components_attachable_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_edit_mode = tuba_dialogs_composer_components_attachments_bin_real_get_edit_mode;
	iface->set_edit_mode = tuba_dialogs_composer_components_attachments_bin_real_set_edit_mode;
}

static void
tuba_dialogs_composer_components_attachments_bin_instance_init (TubaDialogsComposerComponentsAttachmentsBin * self,
                                                                gpointer klass)
{
	gchar* _tmp0_;
	GtkFileFilter* _tmp1_ = NULL;
	gchar** _tmp2_;
	gint _tmp2__length1;
	GeeArrayList* _tmp3_;
	GeeArrayList* _tmp4_;
	self->priv = tuba_dialogs_composer_components_attachments_bin_get_instance_private (self);
	self->priv->_edit_mode = FALSE;
	self->priv->_working = FALSE;
	_tmp0_ = g_strdup (_ ("All Supported Files"));
	_tmp1_ = gtk_file_filter_new ();
	g_object_set (_tmp1_, "name", _tmp0_, NULL);
	_g_free0 (_tmp0_);
	self->priv->filter = _tmp1_;
	_tmp2_ = _vala_array_dup24 (TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_SUPPORTED_MIMES, G_N_ELEMENTS (TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_SUPPORTED_MIMES));
	_tmp2__length1 = G_N_ELEMENTS (TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_SUPPORTED_MIMES);
	_tmp3_ = gee_array_list_new_wrap (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp2_, _tmp2__length1, NULL, NULL, NULL);
	self->priv->supported_mimes = _tmp3_;
	_tmp4_ = gee_array_list_new (TUBA_DIALOGS_COMPOSER_COMPONENTS_TYPE_ATTACHMENT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	self->priv->attachment_widgets = _tmp4_;
}

static void
tuba_dialogs_composer_components_attachments_bin_finalize (GObject * obj)
{
	TubaDialogsComposerComponentsAttachmentsBin * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_DIALOGS_COMPOSER_COMPONENTS_TYPE_ATTACHMENTS_BIN, TubaDialogsComposerComponentsAttachmentsBin);
	g_debug ("AttachmentsBin.vala:20: Destroying Composer Component AttachmentsBin");
	{
		GeeArrayList* _attachment_list = NULL;
		GeeArrayList* _tmp0_;
		gint _attachment_size = 0;
		GeeArrayList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		gint _attachment_index = 0;
		_tmp0_ = self->priv->attachment_widgets;
		_attachment_list = _tmp0_;
		_tmp1_ = _attachment_list;
		_tmp2_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp1_);
		_tmp3_ = _tmp2_;
		_attachment_size = _tmp3_;
		_attachment_index = -1;
		while (TRUE) {
			gint _tmp4_;
			gint _tmp5_;
			TubaDialogsComposerComponentsAttachment* attachment = NULL;
			GeeArrayList* _tmp6_;
			gpointer _tmp7_;
			TubaDialogsComposerComponentsAttachment* _tmp8_;
			_attachment_index = _attachment_index + 1;
			_tmp4_ = _attachment_index;
			_tmp5_ = _attachment_size;
			if (!(_tmp4_ < _tmp5_)) {
				break;
			}
			_tmp6_ = _attachment_list;
			_tmp7_ = gee_abstract_list_get ((GeeAbstractList*) _tmp6_, _attachment_index);
			attachment = (TubaDialogsComposerComponentsAttachment*) _tmp7_;
			_tmp8_ = attachment;
			tuba_dialogs_composer_components_attachment_cleanup (_tmp8_);
			_g_object_unref0 (attachment);
		}
	}
	_g_object_unref0 (self->priv->filter);
	_g_object_unref0 (self->priv->supported_mimes);
	_g_object_unref0 (self->priv->attachment_widgets);
	G_OBJECT_CLASS (tuba_dialogs_composer_components_attachments_bin_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_dialogs_composer_components_attachments_bin_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaDialogsComposerComponentsAttachmentsBinClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_dialogs_composer_components_attachments_bin_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaDialogsComposerComponentsAttachmentsBin), 0, (GInstanceInitFunc) tuba_dialogs_composer_components_attachments_bin_instance_init, NULL };
	static const GInterfaceInfo tuba_dialogs_composer_components_attachable_info = { (GInterfaceInitFunc) tuba_dialogs_composer_components_attachments_bin_tuba_dialogs_composer_components_attachable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType tuba_dialogs_composer_components_attachments_bin_type_id;
	tuba_dialogs_composer_components_attachments_bin_type_id = g_type_register_static (gtk_grid_get_type (), "TubaDialogsComposerComponentsAttachmentsBin", &g_define_type_info, G_TYPE_FLAG_NONE);
	g_type_add_interface_static (tuba_dialogs_composer_components_attachments_bin_type_id, TUBA_DIALOGS_COMPOSER_COMPONENTS_TYPE_ATTACHABLE, &tuba_dialogs_composer_components_attachable_info);
	TubaDialogsComposerComponentsAttachmentsBin_private_offset = g_type_add_instance_private (tuba_dialogs_composer_components_attachments_bin_type_id, sizeof (TubaDialogsComposerComponentsAttachmentsBinPrivate));
	return tuba_dialogs_composer_components_attachments_bin_type_id;
}

GType
tuba_dialogs_composer_components_attachments_bin_get_type (void)
{
	static GType tuba_dialogs_composer_components_attachments_bin_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_dialogs_composer_components_attachments_bin_type_id__once)) {
		GType tuba_dialogs_composer_components_attachments_bin_type_id;
		tuba_dialogs_composer_components_attachments_bin_type_id = tuba_dialogs_composer_components_attachments_bin_get_type_once ();
		g_once_init_leave_pointer (&tuba_dialogs_composer_components_attachments_bin_type_id__once, tuba_dialogs_composer_components_attachments_bin_type_id);
	}
	return tuba_dialogs_composer_components_attachments_bin_type_id__once;
}

static void
_vala_tuba_dialogs_composer_components_attachments_bin_get_property (GObject * object,
                                                                     guint property_id,
                                                                     GValue * value,
                                                                     GParamSpec * pspec)
{
	TubaDialogsComposerComponentsAttachmentsBin * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_DIALOGS_COMPOSER_COMPONENTS_TYPE_ATTACHMENTS_BIN, TubaDialogsComposerComponentsAttachmentsBin);
	switch (property_id) {
		case TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDIT_MODE_PROPERTY:
		g_value_set_boolean (value, tuba_dialogs_composer_components_attachable_get_edit_mode ((TubaDialogsComposerComponentsAttachable*) self));
		break;
		case TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_WORKING_PROPERTY:
		g_value_set_boolean (value, tuba_dialogs_composer_components_attachments_bin_get_working (self));
		break;
		case TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_IS_EMPTY_PROPERTY:
		g_value_set_boolean (value, tuba_dialogs_composer_components_attachments_bin_get_is_empty (self));
		break;
		case TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_CAN_ADD_MEDIA_PROPERTY:
		g_value_set_boolean (value, tuba_dialogs_composer_components_attachments_bin_get_can_add_media (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_dialogs_composer_components_attachments_bin_set_property (GObject * object,
                                                                     guint property_id,
                                                                     const GValue * value,
                                                                     GParamSpec * pspec)
{
	TubaDialogsComposerComponentsAttachmentsBin * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_DIALOGS_COMPOSER_COMPONENTS_TYPE_ATTACHMENTS_BIN, TubaDialogsComposerComponentsAttachmentsBin);
	switch (property_id) {
		case TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_EDIT_MODE_PROPERTY:
		tuba_dialogs_composer_components_attachable_set_edit_mode ((TubaDialogsComposerComponentsAttachable*) self, g_value_get_boolean (value));
		break;
		case TUBA_DIALOGS_COMPOSER_COMPONENTS_ATTACHMENTS_BIN_WORKING_PROPERTY:
		tuba_dialogs_composer_components_attachments_bin_set_working (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);
}

