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

#include <glib-object.h>
#include <gtk/gtk.h>
#include <json-glib/json-glib.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <libsoup/soup.h>
#include <adwaita.h>
#include <float.h>
#include <math.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_TYPE_WIDGETIZABLE (tuba_widgetizable_get_type ())
#define TUBA_WIDGETIZABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_WIDGETIZABLE, TubaWidgetizable))
#define TUBA_IS_WIDGETIZABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_WIDGETIZABLE))
#define TUBA_WIDGETIZABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TUBA_TYPE_WIDGETIZABLE, TubaWidgetizableIface))

typedef struct _TubaWidgetizable TubaWidgetizable;
typedef struct _TubaWidgetizableIface TubaWidgetizableIface;

#define TUBA_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;
typedef struct _TubaEntityPrivate TubaEntityPrivate;

#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 struct _TubaAPIAttachmentPrivate TubaAPIAttachmentPrivate;

#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;
enum  {
	TUBA_API_ATTACHMENT_0_PROPERTY,
	TUBA_API_ATTACHMENT_ID_PROPERTY,
	TUBA_API_ATTACHMENT_KIND_PROPERTY,
	TUBA_API_ATTACHMENT_URL_PROPERTY,
	TUBA_API_ATTACHMENT_DESCRIPTION_PROPERTY,
	TUBA_API_ATTACHMENT_META_PROPERTY,
	TUBA_API_ATTACHMENT_BLURHASH_PROPERTY,
	TUBA_API_ATTACHMENT_PREVIEW_URL_PROPERTY,
	TUBA_API_ATTACHMENT_REMOTE_URL_PROPERTY,
	TUBA_API_ATTACHMENT_TUBA_TRANSLATED_ALT_TEXT_PROPERTY,
	TUBA_API_ATTACHMENT_TUBA_IS_REPORT_PROPERTY,
	TUBA_API_ATTACHMENT_SOURCE_FILE_PROPERTY,
	TUBA_API_ATTACHMENT_IS_PUBLISHED_PROPERTY,
	TUBA_API_ATTACHMENT_NUM_PROPERTIES
};
static GParamSpec* tuba_api_attachment_properties[TUBA_API_ATTACHMENT_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_bytes_unref0(var) ((var == NULL) ? NULL : (var = (g_bytes_unref (var), NULL)))

#define TUBA_TYPE_OOPSIE (tuba_oopsie_get_type ())
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#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_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_NETWORK (tuba_network_get_type ())
#define TUBA_NETWORK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_NETWORK, TubaNetwork))
#define TUBA_NETWORK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_NETWORK, TubaNetworkClass))
#define TUBA_IS_NETWORK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_NETWORK))
#define TUBA_IS_NETWORK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_NETWORK))
#define TUBA_NETWORK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_NETWORK, TubaNetworkClass))

typedef struct _TubaNetwork TubaNetwork;
typedef struct _TubaNetworkClass TubaNetworkClass;
#define __vala_JsonNode_free0(var) ((var == NULL) ? NULL : (var = (_vala_JsonNode_free (var), NULL)))
typedef struct _TubaApiAttachmentUploadData TubaApiAttachmentUploadData;

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

typedef struct _TubaWidgetsAttachmentItem TubaWidgetsAttachmentItem;
typedef struct _TubaWidgetsAttachmentItemClass TubaWidgetsAttachmentItemClass;

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

typedef struct _TubaWidgetsAttachmentImage TubaWidgetsAttachmentImage;
typedef struct _TubaWidgetsAttachmentImageClass TubaWidgetsAttachmentImageClass;
typedef struct _TubaAPIAttachmentMetaPrivate TubaAPIAttachmentMetaPrivate;

#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;
enum  {
	TUBA_API_ATTACHMENT_META_0_PROPERTY,
	TUBA_API_ATTACHMENT_META_FOCUS_PROPERTY,
	TUBA_API_ATTACHMENT_META_NUM_PROPERTIES
};
static GParamSpec* tuba_api_attachment_meta_properties[TUBA_API_ATTACHMENT_META_NUM_PROPERTIES];
typedef struct _TubaAPIAttachmentMetaFocusPrivate TubaAPIAttachmentMetaFocusPrivate;
enum  {
	TUBA_API_ATTACHMENT_META_FOCUS_0_PROPERTY,
	TUBA_API_ATTACHMENT_META_FOCUS_X_PROPERTY,
	TUBA_API_ATTACHMENT_META_FOCUS_Y_PROPERTY,
	TUBA_API_ATTACHMENT_META_FOCUS_NUM_PROPERTIES
};
static GParamSpec* tuba_api_attachment_meta_focus_properties[TUBA_API_ATTACHMENT_META_FOCUS_NUM_PROPERTIES];

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

struct _TubaEntity {
	GObject parent_instance;
	TubaEntityPrivate * priv;
};

struct _TubaEntityClass {
	GObjectClass parent_class;
	gboolean (*is_local) (TubaEntity* self, TubaInstanceAccount* account);
	GType (*deserialize_array_type) (TubaEntity* self, const gchar* prop);
};

struct _TubaAPIAttachment {
	TubaEntity parent_instance;
	TubaAPIAttachmentPrivate * priv;
};

struct _TubaAPIAttachmentClass {
	TubaEntityClass parent_class;
};

struct _TubaAPIAttachmentPrivate {
	gchar* _id;
	gchar* _kind;
	gchar* _url;
	gchar* _description;
	TubaAPIAttachmentMeta* _meta;
	gchar* _blurhash;
	gchar* _t_preview_url;
	gchar* _remote_url;
	gchar* _tuba_translated_alt_text;
	gboolean _tuba_is_report;
	GFile* _source_file;
};

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 _TubaApiAttachmentUploadData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	gchar* uri;
	GBytes* bytes;
	gchar* mime_type;
	TubaAPIAttachment* result;
	gboolean _tmp0_;
	gboolean _tmp1_;
	GBytes* buffer;
	gchar* mime;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	guint8* contents;
	gint contents_length1;
	gint _contents_size_;
	GFile* file;
	GFile* _tmp5_;
	GFile* _tmp6_;
	guint8* _tmp7_;
	gsize _tmp8_;
	GFileInfo* type;
	GFile* _tmp9_;
	GFileInfo* _tmp10_;
	GFileInfo* _tmp11_;
	const gchar* _tmp12_;
	gchar* _tmp13_;
	GError* e;
	GError* _tmp14_;
	const gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	GError* _tmp18_;
	GError* _tmp19_;
	guint8* _tmp20_;
	gint _tmp20__length1;
	guint8* _tmp21_;
	gint _tmp21__length1;
	GBytes* _tmp22_;
	GBytes* _tmp23_;
	gchar* _tmp24_;
	TubaRequestV2* msg;
	TubaAccountStore* _tmp25_;
	TubaInstanceAccount* _tmp26_;
	TubaInstanceAccount* _tmp27_;
	TubaInstanceAccount* _tmp28_;
	TubaRequestV2* _tmp29_;
	TubaRequestV2* _tmp30_;
	const gchar* _tmp31_;
	GBytes* _tmp32_;
	GInputStream* in_stream;
	TubaRequestV2* _tmp33_;
	GInputStream* _tmp34_;
	GInputStream* _tmp35_;
	GError* _tmp36_;
	JsonParser* parser;
	GInputStream* _tmp37_;
	JsonParser* _tmp38_;
	JsonNode* node;
	TubaNetwork* _tmp39_;
	JsonParser* _tmp40_;
	JsonNode* _tmp41_;
	TubaAPIAttachment* entity;
	TubaAccountStore* _tmp42_;
	TubaInstanceAccount* _tmp43_;
	TubaInstanceAccount* _tmp44_;
	JsonNode* _tmp45_;
	gpointer _tmp46_;
	TubaAPIAttachment* _tmp47_;
	const gchar* _tmp48_;
	const gchar* _tmp49_;
	gchar* _tmp50_;
	gchar* _tmp51_;
	GError* _inner_error0_;
};

struct _TubaAPIAttachmentMeta {
	TubaEntity parent_instance;
	TubaAPIAttachmentMetaPrivate * priv;
};

struct _TubaAPIAttachmentMetaClass {
	TubaEntityClass parent_class;
};

struct _TubaAPIAttachmentMetaPrivate {
	TubaAPIAttachmentMetaFocus* _focus;
};

struct _TubaAPIAttachmentMetaFocus {
	TubaEntity parent_instance;
	TubaAPIAttachmentMetaFocusPrivate * priv;
};

struct _TubaAPIAttachmentMetaFocusClass {
	TubaEntityClass parent_class;
};

struct _TubaAPIAttachmentMetaFocusPrivate {
	gfloat _x;
	gfloat _y;
};

static gint TubaAPIAttachment_private_offset;
static gpointer tuba_api_attachment_parent_class = NULL;
VALA_EXTERN TubaAccountStore* tuba_accounts;
VALA_EXTERN TubaNetwork* tuba_network;
static gint TubaAPIAttachmentMeta_private_offset;
static gpointer tuba_api_attachment_meta_parent_class = NULL;
static gint TubaAPIAttachmentMetaFocus_private_offset;
static gpointer tuba_api_attachment_meta_focus_parent_class = NULL;
static TubaWidgetizableIface * tuba_api_attachment_tuba_widgetizable_parent_iface = NULL;

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 GType tuba_widgetizable_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetizable, g_object_unref)
VALA_EXTERN GType tuba_api_attachment_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAttachment, g_object_unref)
VALA_EXTERN GType tuba_api_attachment_meta_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAttachmentMeta, g_object_unref)
static void tuba_api_attachment_upload_data_free (gpointer _data);
VALA_EXTERN void tuba_api_attachment_upload (const gchar* uri,
                                 GBytes* bytes,
                                 const gchar* mime_type,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_);
VALA_EXTERN TubaAPIAttachment* tuba_api_attachment_upload_finish (GAsyncResult* _res_,
                                                      GError** error);
static gboolean tuba_api_attachment_upload_co (TubaApiAttachmentUploadData* _data_);
VALA_EXTERN GQuark tuba_oopsie_quark (void);
VALA_EXTERN GType tuba_oopsie_get_type (void) G_GNUC_CONST ;
static guint8* _vala_array_dup5 (guint8* self,
                          gssize length);
VALA_EXTERN GType tuba_request_v2_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaRequestV2, g_object_unref)
VALA_EXTERN GType tuba_request_v2_method_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType tuba_account_store_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAccountStore, g_object_unref)
VALA_EXTERN TubaInstanceAccount* tuba_account_store_get_active (TubaAccountStore* self);
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_add_form_data_file (TubaRequestV2* self,
                                         const gchar* name,
                                         const gchar* mime,
                                         GBytes* buffer);
VALA_EXTERN void tuba_request_v2_exec (TubaRequestV2* self,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_);
VALA_EXTERN GInputStream* tuba_request_v2_exec_finish (TubaRequestV2* self,
                                           GAsyncResult* _res_,
                                           SoupMessageHeaders** response_headers,
                                           GError** error);
static void tuba_api_attachment_upload_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_);
VALA_EXTERN void tuba_network_get_parser_from_inputstream_async (GInputStream* in_stream,
                                                     GCancellable* cancellable,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_);
VALA_EXTERN JsonParser* tuba_network_get_parser_from_inputstream_finish (GAsyncResult* _res_,
                                                             GError** error);
VALA_EXTERN GType tuba_network_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaNetwork, g_object_unref)
VALA_EXTERN JsonNode* tuba_network_parse_node (TubaNetwork* self,
                                   JsonParser* parser);
VALA_EXTERN gpointer tuba_instance_account_create_entity (TubaInstanceAccount* self,
                                              GType t_type,
                                              GBoxedCopyFunc t_dup_func,
                                              GDestroyNotify t_destroy_func,
                                              JsonNode* node,
                                              GError** error);
static void _vala_JsonNode_free (JsonNode* self);
VALA_EXTERN const gchar* tuba_api_attachment_get_id (TubaAPIAttachment* self);
static GtkWidget* tuba_api_attachment_real_to_widget (TubaWidgetizable* base);
VALA_EXTERN const gchar* tuba_api_attachment_get_preview_url (TubaAPIAttachment* self);
VALA_EXTERN GType tuba_widgets_attachment_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsAttachmentItem, g_object_unref)
VALA_EXTERN GType tuba_widgets_attachment_image_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsAttachmentImage, g_object_unref)
VALA_EXTERN TubaWidgetsAttachmentImage* tuba_widgets_attachment_image_new (void);
VALA_EXTERN TubaWidgetsAttachmentImage* tuba_widgets_attachment_image_construct (GType object_type);
VALA_EXTERN void tuba_widgets_attachment_item_set_entity (TubaWidgetsAttachmentItem* self,
                                              TubaAPIAttachment* value);
VALA_EXTERN TubaWidgetsAttachmentItem* tuba_widgets_attachment_item_new (void);
VALA_EXTERN TubaWidgetsAttachmentItem* tuba_widgets_attachment_item_construct (GType object_type);
VALA_EXTERN TubaAPIAttachment* tuba_api_attachment_new (void);
VALA_EXTERN TubaAPIAttachment* tuba_api_attachment_construct (GType object_type);
VALA_EXTERN TubaEntity* tuba_entity_new (void);
VALA_EXTERN TubaEntity* tuba_entity_construct (GType object_type);
VALA_EXTERN void tuba_api_attachment_set_id (TubaAPIAttachment* self,
                                 const gchar* value);
VALA_EXTERN const gchar* tuba_api_attachment_get_kind (TubaAPIAttachment* self);
VALA_EXTERN void tuba_api_attachment_set_kind (TubaAPIAttachment* self,
                                   const gchar* value);
VALA_EXTERN const gchar* tuba_api_attachment_get_url (TubaAPIAttachment* self);
VALA_EXTERN void tuba_api_attachment_set_url (TubaAPIAttachment* self,
                                  const gchar* value);
VALA_EXTERN const gchar* tuba_api_attachment_get_description (TubaAPIAttachment* self);
VALA_EXTERN void tuba_api_attachment_set_description (TubaAPIAttachment* self,
                                          const gchar* value);
VALA_EXTERN TubaAPIAttachmentMeta* tuba_api_attachment_get_meta (TubaAPIAttachment* self);
VALA_EXTERN void tuba_api_attachment_set_meta (TubaAPIAttachment* self,
                                   TubaAPIAttachmentMeta* value);
VALA_EXTERN const gchar* tuba_api_attachment_get_blurhash (TubaAPIAttachment* self);
VALA_EXTERN void tuba_api_attachment_set_blurhash (TubaAPIAttachment* self,
                                       const gchar* value);
static const gchar* tuba_api_attachment_get_t_preview_url (TubaAPIAttachment* self);
static void tuba_api_attachment_set_t_preview_url (TubaAPIAttachment* self,
                                            const gchar* value);
VALA_EXTERN void tuba_api_attachment_set_preview_url (TubaAPIAttachment* self,
                                          const gchar* value);
VALA_EXTERN const gchar* tuba_api_attachment_get_remote_url (TubaAPIAttachment* self);
VALA_EXTERN void tuba_api_attachment_set_remote_url (TubaAPIAttachment* self,
                                         const gchar* value);
VALA_EXTERN const gchar* tuba_api_attachment_get_tuba_translated_alt_text (TubaAPIAttachment* self);
VALA_EXTERN void tuba_api_attachment_set_tuba_translated_alt_text (TubaAPIAttachment* self,
                                                       const gchar* value);
VALA_EXTERN gboolean tuba_api_attachment_get_tuba_is_report (TubaAPIAttachment* self);
VALA_EXTERN void tuba_api_attachment_set_tuba_is_report (TubaAPIAttachment* self,
                                             gboolean value);
VALA_EXTERN GFile* tuba_api_attachment_get_source_file (TubaAPIAttachment* self);
VALA_EXTERN void tuba_api_attachment_set_source_file (TubaAPIAttachment* self,
                                          GFile* value);
VALA_EXTERN gboolean tuba_api_attachment_get_is_published (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 TubaAPIAttachmentMeta* tuba_api_attachment_meta_new (void);
VALA_EXTERN TubaAPIAttachmentMeta* tuba_api_attachment_meta_construct (GType object_type);
VALA_EXTERN TubaAPIAttachmentMetaFocus* tuba_api_attachment_meta_get_focus (TubaAPIAttachmentMeta* self);
VALA_EXTERN void tuba_api_attachment_meta_set_focus (TubaAPIAttachmentMeta* self,
                                         TubaAPIAttachmentMetaFocus* value);
VALA_EXTERN TubaAPIAttachmentMetaFocus* tuba_api_attachment_meta_focus_new (void);
VALA_EXTERN TubaAPIAttachmentMetaFocus* tuba_api_attachment_meta_focus_construct (GType object_type);
VALA_EXTERN gfloat tuba_api_attachment_meta_focus_get_x (TubaAPIAttachmentMetaFocus* self);
VALA_EXTERN void tuba_api_attachment_meta_focus_set_x (TubaAPIAttachmentMetaFocus* self,
                                           gfloat value);
VALA_EXTERN gfloat tuba_api_attachment_meta_focus_get_y (TubaAPIAttachmentMetaFocus* self);
VALA_EXTERN void tuba_api_attachment_meta_focus_set_y (TubaAPIAttachmentMetaFocus* self,
                                           gfloat value);
static void tuba_api_attachment_meta_focus_finalize (GObject * obj);
static GType tuba_api_attachment_meta_focus_get_type_once (void);
static void _vala_tuba_api_attachment_meta_focus_get_property (GObject * object,
                                                        guint property_id,
                                                        GValue * value,
                                                        GParamSpec * pspec);
static void _vala_tuba_api_attachment_meta_focus_set_property (GObject * object,
                                                        guint property_id,
                                                        const GValue * value,
                                                        GParamSpec * pspec);
static void tuba_api_attachment_meta_finalize (GObject * obj);
static GType tuba_api_attachment_meta_get_type_once (void);
static void _vala_tuba_api_attachment_meta_get_property (GObject * object,
                                                  guint property_id,
                                                  GValue * value,
                                                  GParamSpec * pspec);
static void _vala_tuba_api_attachment_meta_set_property (GObject * object,
                                                  guint property_id,
                                                  const GValue * value,
                                                  GParamSpec * pspec);
VALA_EXTERN GtkWidget* tuba_widgetizable_to_widget (TubaWidgetizable* self);
static void tuba_api_attachment_finalize (GObject * obj);
static GType tuba_api_attachment_get_type_once (void);
static void _vala_tuba_api_attachment_get_property (GObject * object,
                                             guint property_id,
                                             GValue * value,
                                             GParamSpec * pspec);
static void _vala_tuba_api_attachment_set_property (GObject * object,
                                             guint property_id,
                                             const GValue * value,
                                             GParamSpec * pspec);

static inline gpointer
tuba_api_attachment_get_instance_private (TubaAPIAttachment* self)
{
	return G_STRUCT_MEMBER_P (self, TubaAPIAttachment_private_offset);
}

static void
tuba_api_attachment_upload_data_free (gpointer _data)
{
	TubaApiAttachmentUploadData* _data_;
	_data_ = _data;
	_g_free0 (_data_->uri);
	_g_bytes_unref0 (_data_->bytes);
	_g_free0 (_data_->mime_type);
	_g_object_unref0 (_data_->result);
	g_slice_free (TubaApiAttachmentUploadData, _data_);
}

static gpointer
_g_bytes_ref0 (gpointer self)
{
	return self ? g_bytes_ref (self) : NULL;
}

void
tuba_api_attachment_upload (const gchar* uri,
                            GBytes* bytes,
                            const gchar* mime_type,
                            GAsyncReadyCallback _callback_,
                            gpointer _user_data_)
{
	TubaApiAttachmentUploadData* _data_;
	gchar* _tmp0_;
	GBytes* _tmp1_;
	gchar* _tmp2_;
	_data_ = g_slice_new0 (TubaApiAttachmentUploadData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_api_attachment_upload_data_free);
	_tmp0_ = g_strdup (uri);
	_g_free0 (_data_->uri);
	_data_->uri = _tmp0_;
	_tmp1_ = _g_bytes_ref0 (bytes);
	_g_bytes_unref0 (_data_->bytes);
	_data_->bytes = _tmp1_;
	_tmp2_ = g_strdup (mime_type);
	_g_free0 (_data_->mime_type);
	_data_->mime_type = _tmp2_;
	tuba_api_attachment_upload_co (_data_);
}

TubaAPIAttachment*
tuba_api_attachment_upload_finish (GAsyncResult* _res_,
                                   GError** error)
{
	TubaAPIAttachment* result;
	TubaApiAttachmentUploadData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

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 guint8*
_vala_array_dup5 (guint8* self,
                  gssize length)
{
	if (length > 0) {
		return g_memdup2 (self, length * sizeof (guint8));
	}
	return NULL;
}

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

static void
tuba_api_attachment_upload_ready (GObject* source_object,
                                  GAsyncResult* _res_,
                                  gpointer _user_data_)
{
	TubaApiAttachmentUploadData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_api_attachment_upload_co (_data_);
}

static void
_vala_JsonNode_free (JsonNode* self)
{
	g_boxed_free (json_node_get_type (), self);
}

static gboolean
tuba_api_attachment_upload_co (TubaApiAttachmentUploadData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->uri != NULL) {
		_data_->_tmp0_ = TRUE;
	} else {
		if (_data_->bytes != NULL) {
			_data_->_tmp1_ = _data_->mime_type != NULL;
		} else {
			_data_->_tmp1_ = FALSE;
		}
		_data_->_tmp0_ = _data_->_tmp1_;
	}
	g_assert_true (_data_->_tmp0_);
	if (_data_->uri != NULL) {
		_data_->_tmp2_ = string_to_string (_data_->uri);
		_data_->_tmp3_ = g_strconcat ("Uploading new media: ", _data_->_tmp2_, "…", NULL);
		_data_->_tmp4_ = _data_->_tmp3_;
		g_debug ("Attachment.vala:47: %s", _data_->_tmp4_);
		_g_free0 (_data_->_tmp4_);
		_data_->contents_length1 = 0;
		_data_->_contents_size_ = 0;
		{
			_data_->_tmp5_ = g_file_new_for_uri (_data_->uri);
			_data_->file = _data_->_tmp5_;
			_data_->_tmp6_ = _data_->file;
			_data_->_tmp7_ = NULL;
			_data_->_tmp8_ = 0;
			g_file_load_contents (_data_->_tmp6_, NULL, &_data_->_tmp7_, &_data_->_tmp8_, NULL, &_data_->_inner_error0_);
			_data_->contents = (g_free (_data_->contents), NULL);
			_data_->contents = _data_->_tmp7_;
			_data_->contents_length1 = _data_->_tmp8_;
			_data_->_contents_size_ = _data_->contents_length1;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_g_object_unref0 (_data_->file);
				goto __catch0_g_error;
			}
			_data_->_tmp9_ = _data_->file;
			_data_->_tmp10_ = g_file_query_info (_data_->_tmp9_, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, 0, NULL, &_data_->_inner_error0_);
			_data_->type = _data_->_tmp10_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_g_object_unref0 (_data_->file);
				goto __catch0_g_error;
			}
			_data_->_tmp11_ = _data_->type;
			_data_->_tmp12_ = g_file_info_get_content_type (_data_->_tmp11_);
			_data_->_tmp13_ = g_strdup (_data_->_tmp12_);
			_g_free0 (_data_->mime);
			_data_->mime = _data_->_tmp13_;
			_g_object_unref0 (_data_->type);
			_g_object_unref0 (_data_->file);
		}
		goto __finally0;
		__catch0_g_error:
		{
			_data_->e = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp14_ = _data_->e;
			_data_->_tmp15_ = _data_->_tmp14_->message;
			_data_->_tmp16_ = g_strdup_printf ("Can't open file %s:\n%s", _data_->uri, _data_->_tmp15_);
			_data_->_tmp17_ = _data_->_tmp16_;
			_data_->_tmp18_ = g_error_new_literal (TUBA_OOPSIE, TUBA_OOPSIE_USER, _data_->_tmp17_);
			_data_->_tmp19_ = _data_->_tmp18_;
			_g_free0 (_data_->_tmp17_);
			_data_->_inner_error0_ = _data_->_tmp19_;
			_g_error_free0 (_data_->e);
			goto __finally0;
		}
		__finally0:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_data_->contents = (g_free (_data_->contents), NULL);
			_g_free0 (_data_->mime);
			_g_bytes_unref0 (_data_->buffer);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp20_ = _data_->contents;
		_data_->_tmp20__length1 = _data_->contents_length1;
		_data_->_tmp21_ = (_data_->_tmp20_ != NULL) ? _vala_array_dup5 (_data_->_tmp20_, _data_->_tmp20__length1) : _data_->_tmp20_;
		_data_->_tmp21__length1 = _data_->_tmp20__length1;
		_data_->_tmp22_ = g_bytes_new_take (_data_->_tmp21_, _data_->_tmp21__length1);
		_g_bytes_unref0 (_data_->buffer);
		_data_->buffer = _data_->_tmp22_;
		_data_->contents = (g_free (_data_->contents), NULL);
	} else {
		_data_->_tmp23_ = _g_bytes_ref0 (_data_->bytes);
		_g_bytes_unref0 (_data_->buffer);
		_data_->buffer = _data_->_tmp23_;
		_data_->_tmp24_ = g_strdup (_data_->mime_type);
		_g_free0 (_data_->mime);
		_data_->mime = _data_->_tmp24_;
	}
	_data_->_tmp25_ = tuba_accounts;
	_data_->_tmp26_ = tuba_account_store_get_active (_data_->_tmp25_);
	_data_->_tmp27_ = _data_->_tmp26_;
	_data_->_tmp28_ = _g_object_ref0 (_data_->_tmp27_);
	_data_->_tmp29_ = NULL;
	_data_->_tmp29_ = tuba_request_v2_new ("/api/v1/media", TUBA_REQUEST_V2_METHOD_POST);
	tuba_request_v2_set_account (_data_->_tmp29_, _data_->_tmp28_);
	_g_object_unref0 (_data_->_tmp28_);
	_data_->msg = _data_->_tmp29_;
	_data_->_tmp30_ = _data_->msg;
	_data_->_tmp31_ = _data_->mime;
	_data_->_tmp32_ = _data_->buffer;
	tuba_request_v2_add_form_data_file (_data_->_tmp30_, "file", _data_->_tmp31_, _data_->_tmp32_);
	_data_->_tmp33_ = _data_->msg;
	_data_->_state_ = 1;
	tuba_request_v2_exec (_data_->_tmp33_, tuba_api_attachment_upload_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp34_ = tuba_request_v2_exec_finish (_data_->_tmp33_, _data_->_res_, NULL, &_data_->_inner_error0_);
	_data_->in_stream = _data_->_tmp34_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->msg);
		_g_free0 (_data_->mime);
		_g_bytes_unref0 (_data_->buffer);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp35_ = _data_->in_stream;
	if (_data_->_tmp35_ == NULL) {
		_data_->_tmp36_ = g_error_new_literal (TUBA_OOPSIE, TUBA_OOPSIE_INSTANCE, "Broken Stream");
		_data_->_inner_error0_ = _data_->_tmp36_;
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->in_stream);
		_g_object_unref0 (_data_->msg);
		_g_free0 (_data_->mime);
		_g_bytes_unref0 (_data_->buffer);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp37_ = _data_->in_stream;
	_data_->_state_ = 2;
	tuba_network_get_parser_from_inputstream_async (_data_->_tmp37_, NULL, tuba_api_attachment_upload_ready, _data_);
	return FALSE;
	_state_2:
	_data_->_tmp38_ = tuba_network_get_parser_from_inputstream_finish (_data_->_res_, &_data_->_inner_error0_);
	_data_->parser = _data_->_tmp38_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->in_stream);
		_g_object_unref0 (_data_->msg);
		_g_free0 (_data_->mime);
		_g_bytes_unref0 (_data_->buffer);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp39_ = tuba_network;
	_data_->_tmp40_ = _data_->parser;
	_data_->_tmp41_ = tuba_network_parse_node (_data_->_tmp39_, _data_->_tmp40_);
	_data_->node = _data_->_tmp41_;
	_data_->_tmp42_ = tuba_accounts;
	_data_->_tmp43_ = tuba_account_store_get_active (_data_->_tmp42_);
	_data_->_tmp44_ = _data_->_tmp43_;
	_data_->_tmp45_ = _data_->node;
	_data_->_tmp46_ = tuba_instance_account_create_entity (_data_->_tmp44_, TUBA_API_TYPE_ATTACHMENT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp45_, &_data_->_inner_error0_);
	_data_->entity = (TubaAPIAttachment*) _data_->_tmp46_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		__vala_JsonNode_free0 (_data_->node);
		_g_object_unref0 (_data_->parser);
		_g_object_unref0 (_data_->in_stream);
		_g_object_unref0 (_data_->msg);
		_g_free0 (_data_->mime);
		_g_bytes_unref0 (_data_->buffer);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp47_ = _data_->entity;
	_data_->_tmp48_ = _data_->_tmp47_->priv->_id;
	_data_->_tmp49_ = string_to_string (_data_->_tmp48_);
	_data_->_tmp50_ = g_strconcat ("OK! ID ", _data_->_tmp49_, NULL);
	_data_->_tmp51_ = _data_->_tmp50_;
	g_debug ("Attachment.vala:75: %s", _data_->_tmp51_);
	_g_free0 (_data_->_tmp51_);
	_data_->result = _data_->entity;
	__vala_JsonNode_free0 (_data_->node);
	_g_object_unref0 (_data_->parser);
	_g_object_unref0 (_data_->in_stream);
	_g_object_unref0 (_data_->msg);
	_g_free0 (_data_->mime);
	_g_bytes_unref0 (_data_->buffer);
	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 GtkWidget*
tuba_api_attachment_real_to_widget (TubaWidgetizable* base)
{
	TubaAPIAttachment * self;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	TubaAPIAttachment* _tmp4_;
	TubaWidgetsAttachmentItem* _tmp5_ = NULL;
	GtkWidget* result;
	self = (TubaAPIAttachment*) base;
	_tmp0_ = tuba_api_attachment_get_preview_url (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		TubaAPIAttachment* _tmp2_;
		TubaWidgetsAttachmentImage* _tmp3_ = NULL;
		_tmp2_ = _g_object_ref0 (self);
		_tmp3_ = tuba_widgets_attachment_image_new ();
		tuba_widgets_attachment_item_set_entity ((TubaWidgetsAttachmentItem*) _tmp3_, _tmp2_);
		_g_object_unref0 (_tmp2_);
		g_object_ref_sink (_tmp3_);
		result = (GtkWidget*) _tmp3_;
		return result;
	}
	_tmp4_ = _g_object_ref0 (self);
	_tmp5_ = tuba_widgets_attachment_item_new ();
	tuba_widgets_attachment_item_set_entity (_tmp5_, _tmp4_);
	_g_object_unref0 (_tmp4_);
	g_object_ref_sink (_tmp5_);
	result = (GtkWidget*) _tmp5_;
	return result;
}

TubaAPIAttachment*
tuba_api_attachment_construct (GType object_type)
{
	TubaAPIAttachment * self = NULL;
	self = (TubaAPIAttachment*) tuba_entity_construct (object_type);
	return self;
}

TubaAPIAttachment*
tuba_api_attachment_new (void)
{
	return tuba_api_attachment_construct (TUBA_API_TYPE_ATTACHMENT);
}

const gchar*
tuba_api_attachment_get_id (TubaAPIAttachment* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_id;
	result = _tmp0_;
	return result;
}

void
tuba_api_attachment_set_id (TubaAPIAttachment* self,
                            const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_attachment_get_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_id);
		self->priv->_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_attachment_properties[TUBA_API_ATTACHMENT_ID_PROPERTY]);
	}
}

const gchar*
tuba_api_attachment_get_kind (TubaAPIAttachment* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_kind;
	result = _tmp0_;
	return result;
}

void
tuba_api_attachment_set_kind (TubaAPIAttachment* self,
                              const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_attachment_get_kind (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_kind);
		self->priv->_kind = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_attachment_properties[TUBA_API_ATTACHMENT_KIND_PROPERTY]);
	}
}

const gchar*
tuba_api_attachment_get_url (TubaAPIAttachment* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_url;
	result = _tmp0_;
	return result;
}

void
tuba_api_attachment_set_url (TubaAPIAttachment* self,
                             const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_attachment_get_url (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_url);
		self->priv->_url = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_attachment_properties[TUBA_API_ATTACHMENT_URL_PROPERTY]);
	}
}

const gchar*
tuba_api_attachment_get_description (TubaAPIAttachment* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_description;
	result = _tmp0_;
	return result;
}

void
tuba_api_attachment_set_description (TubaAPIAttachment* self,
                                     const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_attachment_get_description (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_description);
		self->priv->_description = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_attachment_properties[TUBA_API_ATTACHMENT_DESCRIPTION_PROPERTY]);
	}
}

TubaAPIAttachmentMeta*
tuba_api_attachment_get_meta (TubaAPIAttachment* self)
{
	TubaAPIAttachmentMeta* result;
	TubaAPIAttachmentMeta* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_meta;
	result = _tmp0_;
	return result;
}

void
tuba_api_attachment_set_meta (TubaAPIAttachment* self,
                              TubaAPIAttachmentMeta* value)
{
	TubaAPIAttachmentMeta* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_attachment_get_meta (self);
	if (old_value != value) {
		TubaAPIAttachmentMeta* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_meta);
		self->priv->_meta = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_attachment_properties[TUBA_API_ATTACHMENT_META_PROPERTY]);
	}
}

const gchar*
tuba_api_attachment_get_blurhash (TubaAPIAttachment* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_blurhash;
	result = _tmp0_;
	return result;
}

void
tuba_api_attachment_set_blurhash (TubaAPIAttachment* self,
                                  const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_attachment_get_blurhash (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_blurhash);
		self->priv->_blurhash = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_attachment_properties[TUBA_API_ATTACHMENT_BLURHASH_PROPERTY]);
	}
}

static const gchar*
tuba_api_attachment_get_t_preview_url (TubaAPIAttachment* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_t_preview_url;
	result = _tmp0_;
	return result;
}

static void
tuba_api_attachment_set_t_preview_url (TubaAPIAttachment* self,
                                       const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_t_preview_url);
	self->priv->_t_preview_url = _tmp0_;
}

const gchar*
tuba_api_attachment_get_preview_url (TubaAPIAttachment* self)
{
	const gchar* result;
	const gchar* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	const gchar* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp2_ = self->priv->_t_preview_url;
	if (_tmp2_ == NULL) {
		_tmp1_ = TRUE;
	} else {
		const gchar* _tmp3_;
		_tmp3_ = self->priv->_t_preview_url;
		_tmp1_ = g_strcmp0 (_tmp3_, "") == 0;
	}
	if (_tmp1_) {
		const gchar* _tmp4_;
		_tmp4_ = self->priv->_url;
		_tmp0_ = _tmp4_;
	} else {
		const gchar* _tmp5_;
		_tmp5_ = self->priv->_t_preview_url;
		_tmp0_ = _tmp5_;
	}
	result = _tmp0_;
	return result;
}

void
tuba_api_attachment_set_preview_url (TubaAPIAttachment* self,
                                     const gchar* value)
{
	g_return_if_fail (self != NULL);
	tuba_api_attachment_set_t_preview_url (self, value);
	g_object_notify_by_pspec ((GObject *) self, tuba_api_attachment_properties[TUBA_API_ATTACHMENT_PREVIEW_URL_PROPERTY]);
}

const gchar*
tuba_api_attachment_get_remote_url (TubaAPIAttachment* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_remote_url;
	result = _tmp0_;
	return result;
}

void
tuba_api_attachment_set_remote_url (TubaAPIAttachment* self,
                                    const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_attachment_get_remote_url (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_remote_url);
		self->priv->_remote_url = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_attachment_properties[TUBA_API_ATTACHMENT_REMOTE_URL_PROPERTY]);
	}
}

const gchar*
tuba_api_attachment_get_tuba_translated_alt_text (TubaAPIAttachment* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_tuba_translated_alt_text;
	result = _tmp0_;
	return result;
}

void
tuba_api_attachment_set_tuba_translated_alt_text (TubaAPIAttachment* self,
                                                  const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_attachment_get_tuba_translated_alt_text (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_tuba_translated_alt_text);
		self->priv->_tuba_translated_alt_text = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_attachment_properties[TUBA_API_ATTACHMENT_TUBA_TRANSLATED_ALT_TEXT_PROPERTY]);
	}
}

gboolean
tuba_api_attachment_get_tuba_is_report (TubaAPIAttachment* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_tuba_is_report;
	return result;
}

void
tuba_api_attachment_set_tuba_is_report (TubaAPIAttachment* self,
                                        gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_attachment_get_tuba_is_report (self);
	if (old_value != value) {
		self->priv->_tuba_is_report = value;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_attachment_properties[TUBA_API_ATTACHMENT_TUBA_IS_REPORT_PROPERTY]);
	}
}

GFile*
tuba_api_attachment_get_source_file (TubaAPIAttachment* self)
{
	GFile* result;
	GFile* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_source_file;
	result = _tmp0_;
	return result;
}

void
tuba_api_attachment_set_source_file (TubaAPIAttachment* self,
                                     GFile* value)
{
	GFile* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_attachment_get_source_file (self);
	if (old_value != value) {
		GFile* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_source_file);
		self->priv->_source_file = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_attachment_properties[TUBA_API_ATTACHMENT_SOURCE_FILE_PROPERTY]);
	}
}

gboolean
tuba_api_attachment_get_is_published (TubaAPIAttachment* self)
{
	gboolean result;
	GFile* _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_source_file;
	result = _tmp0_ == NULL;
	return result;
}

static inline gpointer
tuba_api_attachment_meta_get_instance_private (TubaAPIAttachmentMeta* self)
{
	return G_STRUCT_MEMBER_P (self, TubaAPIAttachmentMeta_private_offset);
}

TubaAPIAttachmentMeta*
tuba_api_attachment_meta_construct (GType object_type)
{
	TubaAPIAttachmentMeta * self = NULL;
	self = (TubaAPIAttachmentMeta*) tuba_entity_construct (object_type);
	return self;
}

TubaAPIAttachmentMeta*
tuba_api_attachment_meta_new (void)
{
	return tuba_api_attachment_meta_construct (TUBA_API_ATTACHMENT_TYPE_META);
}

TubaAPIAttachmentMetaFocus*
tuba_api_attachment_meta_get_focus (TubaAPIAttachmentMeta* self)
{
	TubaAPIAttachmentMetaFocus* result;
	TubaAPIAttachmentMetaFocus* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_focus;
	result = _tmp0_;
	return result;
}

void
tuba_api_attachment_meta_set_focus (TubaAPIAttachmentMeta* self,
                                    TubaAPIAttachmentMetaFocus* value)
{
	TubaAPIAttachmentMetaFocus* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_attachment_meta_get_focus (self);
	if (old_value != value) {
		TubaAPIAttachmentMetaFocus* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_focus);
		self->priv->_focus = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_attachment_meta_properties[TUBA_API_ATTACHMENT_META_FOCUS_PROPERTY]);
	}
}

static inline gpointer
tuba_api_attachment_meta_focus_get_instance_private (TubaAPIAttachmentMetaFocus* self)
{
	return G_STRUCT_MEMBER_P (self, TubaAPIAttachmentMetaFocus_private_offset);
}

TubaAPIAttachmentMetaFocus*
tuba_api_attachment_meta_focus_construct (GType object_type)
{
	TubaAPIAttachmentMetaFocus * self = NULL;
	self = (TubaAPIAttachmentMetaFocus*) tuba_entity_construct (object_type);
	return self;
}

TubaAPIAttachmentMetaFocus*
tuba_api_attachment_meta_focus_new (void)
{
	return tuba_api_attachment_meta_focus_construct (TUBA_API_ATTACHMENT_META_TYPE_FOCUS);
}

gfloat
tuba_api_attachment_meta_focus_get_x (TubaAPIAttachmentMetaFocus* self)
{
	gfloat result;
	g_return_val_if_fail (self != NULL, -1.0F);
	result = self->priv->_x;
	return result;
}

void
tuba_api_attachment_meta_focus_set_x (TubaAPIAttachmentMetaFocus* self,
                                      gfloat value)
{
	gfloat old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_attachment_meta_focus_get_x (self);
	if (old_value != value) {
		self->priv->_x = value;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_attachment_meta_focus_properties[TUBA_API_ATTACHMENT_META_FOCUS_X_PROPERTY]);
	}
}

gfloat
tuba_api_attachment_meta_focus_get_y (TubaAPIAttachmentMetaFocus* self)
{
	gfloat result;
	g_return_val_if_fail (self != NULL, -1.0F);
	result = self->priv->_y;
	return result;
}

void
tuba_api_attachment_meta_focus_set_y (TubaAPIAttachmentMetaFocus* self,
                                      gfloat value)
{
	gfloat old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_attachment_meta_focus_get_y (self);
	if (old_value != value) {
		self->priv->_y = value;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_attachment_meta_focus_properties[TUBA_API_ATTACHMENT_META_FOCUS_Y_PROPERTY]);
	}
}

static void
tuba_api_attachment_meta_focus_class_init (TubaAPIAttachmentMetaFocusClass * klass,
                                           gpointer klass_data)
{
	tuba_api_attachment_meta_focus_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaAPIAttachmentMetaFocus_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_api_attachment_meta_focus_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_api_attachment_meta_focus_set_property;
	G_OBJECT_CLASS (klass)->finalize = tuba_api_attachment_meta_focus_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_ATTACHMENT_META_FOCUS_X_PROPERTY, tuba_api_attachment_meta_focus_properties[TUBA_API_ATTACHMENT_META_FOCUS_X_PROPERTY] = g_param_spec_float ("x", "x", "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_API_ATTACHMENT_META_FOCUS_Y_PROPERTY, tuba_api_attachment_meta_focus_properties[TUBA_API_ATTACHMENT_META_FOCUS_Y_PROPERTY] = g_param_spec_float ("y", "y", "y", -G_MAXFLOAT, G_MAXFLOAT, 0.0F, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
tuba_api_attachment_meta_focus_instance_init (TubaAPIAttachmentMetaFocus * self,
                                              gpointer klass)
{
	self->priv = tuba_api_attachment_meta_focus_get_instance_private (self);
}

static void
tuba_api_attachment_meta_focus_finalize (GObject * obj)
{
	TubaAPIAttachmentMetaFocus * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_API_ATTACHMENT_META_TYPE_FOCUS, TubaAPIAttachmentMetaFocus);
	G_OBJECT_CLASS (tuba_api_attachment_meta_focus_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_api_attachment_meta_focus_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaAPIAttachmentMetaFocusClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_api_attachment_meta_focus_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaAPIAttachmentMetaFocus), 0, (GInstanceInitFunc) tuba_api_attachment_meta_focus_instance_init, NULL };
	GType tuba_api_attachment_meta_focus_type_id;
	tuba_api_attachment_meta_focus_type_id = g_type_register_static (TUBA_TYPE_ENTITY, "TubaAPIAttachmentMetaFocus", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaAPIAttachmentMetaFocus_private_offset = g_type_add_instance_private (tuba_api_attachment_meta_focus_type_id, sizeof (TubaAPIAttachmentMetaFocusPrivate));
	return tuba_api_attachment_meta_focus_type_id;
}

GType
tuba_api_attachment_meta_focus_get_type (void)
{
	static GType tuba_api_attachment_meta_focus_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_api_attachment_meta_focus_type_id__once)) {
		GType tuba_api_attachment_meta_focus_type_id;
		tuba_api_attachment_meta_focus_type_id = tuba_api_attachment_meta_focus_get_type_once ();
		g_once_init_leave_pointer (&tuba_api_attachment_meta_focus_type_id__once, tuba_api_attachment_meta_focus_type_id);
	}
	return tuba_api_attachment_meta_focus_type_id__once;
}

static void
_vala_tuba_api_attachment_meta_focus_get_property (GObject * object,
                                                   guint property_id,
                                                   GValue * value,
                                                   GParamSpec * pspec)
{
	TubaAPIAttachmentMetaFocus * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_API_ATTACHMENT_META_TYPE_FOCUS, TubaAPIAttachmentMetaFocus);
	switch (property_id) {
		case TUBA_API_ATTACHMENT_META_FOCUS_X_PROPERTY:
		g_value_set_float (value, tuba_api_attachment_meta_focus_get_x (self));
		break;
		case TUBA_API_ATTACHMENT_META_FOCUS_Y_PROPERTY:
		g_value_set_float (value, tuba_api_attachment_meta_focus_get_y (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_api_attachment_meta_focus_set_property (GObject * object,
                                                   guint property_id,
                                                   const GValue * value,
                                                   GParamSpec * pspec)
{
	TubaAPIAttachmentMetaFocus * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_API_ATTACHMENT_META_TYPE_FOCUS, TubaAPIAttachmentMetaFocus);
	switch (property_id) {
		case TUBA_API_ATTACHMENT_META_FOCUS_X_PROPERTY:
		tuba_api_attachment_meta_focus_set_x (self, g_value_get_float (value));
		break;
		case TUBA_API_ATTACHMENT_META_FOCUS_Y_PROPERTY:
		tuba_api_attachment_meta_focus_set_y (self, g_value_get_float (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
tuba_api_attachment_meta_class_init (TubaAPIAttachmentMetaClass * klass,
                                     gpointer klass_data)
{
	tuba_api_attachment_meta_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaAPIAttachmentMeta_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_api_attachment_meta_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_api_attachment_meta_set_property;
	G_OBJECT_CLASS (klass)->finalize = tuba_api_attachment_meta_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_ATTACHMENT_META_FOCUS_PROPERTY, tuba_api_attachment_meta_properties[TUBA_API_ATTACHMENT_META_FOCUS_PROPERTY] = g_param_spec_object ("focus", "focus", "focus", TUBA_API_ATTACHMENT_META_TYPE_FOCUS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
tuba_api_attachment_meta_instance_init (TubaAPIAttachmentMeta * self,
                                        gpointer klass)
{
	self->priv = tuba_api_attachment_meta_get_instance_private (self);
}

static void
tuba_api_attachment_meta_finalize (GObject * obj)
{
	TubaAPIAttachmentMeta * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_API_ATTACHMENT_TYPE_META, TubaAPIAttachmentMeta);
	_g_object_unref0 (self->priv->_focus);
	G_OBJECT_CLASS (tuba_api_attachment_meta_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_api_attachment_meta_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaAPIAttachmentMetaClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_api_attachment_meta_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaAPIAttachmentMeta), 0, (GInstanceInitFunc) tuba_api_attachment_meta_instance_init, NULL };
	GType tuba_api_attachment_meta_type_id;
	tuba_api_attachment_meta_type_id = g_type_register_static (TUBA_TYPE_ENTITY, "TubaAPIAttachmentMeta", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaAPIAttachmentMeta_private_offset = g_type_add_instance_private (tuba_api_attachment_meta_type_id, sizeof (TubaAPIAttachmentMetaPrivate));
	return tuba_api_attachment_meta_type_id;
}

GType
tuba_api_attachment_meta_get_type (void)
{
	static GType tuba_api_attachment_meta_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_api_attachment_meta_type_id__once)) {
		GType tuba_api_attachment_meta_type_id;
		tuba_api_attachment_meta_type_id = tuba_api_attachment_meta_get_type_once ();
		g_once_init_leave_pointer (&tuba_api_attachment_meta_type_id__once, tuba_api_attachment_meta_type_id);
	}
	return tuba_api_attachment_meta_type_id__once;
}

static void
_vala_tuba_api_attachment_meta_get_property (GObject * object,
                                             guint property_id,
                                             GValue * value,
                                             GParamSpec * pspec)
{
	TubaAPIAttachmentMeta * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_API_ATTACHMENT_TYPE_META, TubaAPIAttachmentMeta);
	switch (property_id) {
		case TUBA_API_ATTACHMENT_META_FOCUS_PROPERTY:
		g_value_set_object (value, tuba_api_attachment_meta_get_focus (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_api_attachment_meta_set_property (GObject * object,
                                             guint property_id,
                                             const GValue * value,
                                             GParamSpec * pspec)
{
	TubaAPIAttachmentMeta * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_API_ATTACHMENT_TYPE_META, TubaAPIAttachmentMeta);
	switch (property_id) {
		case TUBA_API_ATTACHMENT_META_FOCUS_PROPERTY:
		tuba_api_attachment_meta_set_focus (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
tuba_api_attachment_class_init (TubaAPIAttachmentClass * klass,
                                gpointer klass_data)
{
	tuba_api_attachment_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaAPIAttachment_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_api_attachment_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_api_attachment_set_property;
	G_OBJECT_CLASS (klass)->finalize = tuba_api_attachment_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_ATTACHMENT_ID_PROPERTY, tuba_api_attachment_properties[TUBA_API_ATTACHMENT_ID_PROPERTY] = g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_ATTACHMENT_KIND_PROPERTY, tuba_api_attachment_properties[TUBA_API_ATTACHMENT_KIND_PROPERTY] = g_param_spec_string ("kind", "kind", "kind", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_ATTACHMENT_URL_PROPERTY, tuba_api_attachment_properties[TUBA_API_ATTACHMENT_URL_PROPERTY] = g_param_spec_string ("url", "url", "url", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_ATTACHMENT_DESCRIPTION_PROPERTY, tuba_api_attachment_properties[TUBA_API_ATTACHMENT_DESCRIPTION_PROPERTY] = g_param_spec_string ("description", "description", "description", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_ATTACHMENT_META_PROPERTY, tuba_api_attachment_properties[TUBA_API_ATTACHMENT_META_PROPERTY] = g_param_spec_object ("meta", "meta", "meta", TUBA_API_ATTACHMENT_TYPE_META, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_ATTACHMENT_BLURHASH_PROPERTY, tuba_api_attachment_properties[TUBA_API_ATTACHMENT_BLURHASH_PROPERTY] = g_param_spec_string ("blurhash", "blurhash", "blurhash", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_ATTACHMENT_PREVIEW_URL_PROPERTY, tuba_api_attachment_properties[TUBA_API_ATTACHMENT_PREVIEW_URL_PROPERTY] = g_param_spec_string ("preview-url", "preview-url", "preview-url", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_ATTACHMENT_REMOTE_URL_PROPERTY, tuba_api_attachment_properties[TUBA_API_ATTACHMENT_REMOTE_URL_PROPERTY] = g_param_spec_string ("remote-url", "remote-url", "remote-url", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_ATTACHMENT_TUBA_TRANSLATED_ALT_TEXT_PROPERTY, tuba_api_attachment_properties[TUBA_API_ATTACHMENT_TUBA_TRANSLATED_ALT_TEXT_PROPERTY] = g_param_spec_string ("tuba-translated-alt-text", "tuba-translated-alt-text", "tuba-translated-alt-text", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_ATTACHMENT_TUBA_IS_REPORT_PROPERTY, tuba_api_attachment_properties[TUBA_API_ATTACHMENT_TUBA_IS_REPORT_PROPERTY] = g_param_spec_boolean ("tuba-is-report", "tuba-is-report", "tuba-is-report", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_ATTACHMENT_SOURCE_FILE_PROPERTY, tuba_api_attachment_properties[TUBA_API_ATTACHMENT_SOURCE_FILE_PROPERTY] = g_param_spec_object ("source-file", "source-file", "source-file", g_file_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_ATTACHMENT_IS_PUBLISHED_PROPERTY, tuba_api_attachment_properties[TUBA_API_ATTACHMENT_IS_PUBLISHED_PROPERTY] = g_param_spec_boolean ("is-published", "is-published", "is-published", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
tuba_api_attachment_tuba_widgetizable_interface_init (TubaWidgetizableIface * iface,
                                                      gpointer iface_data)
{
	tuba_api_attachment_tuba_widgetizable_parent_iface = g_type_interface_peek_parent (iface);
	iface->to_widget = (GtkWidget* (*) (TubaWidgetizable*)) tuba_api_attachment_real_to_widget;
}

static void
tuba_api_attachment_instance_init (TubaAPIAttachment * self,
                                   gpointer klass)
{
	gchar* _tmp0_;
	self->priv = tuba_api_attachment_get_instance_private (self);
	_tmp0_ = g_strdup ("unknown");
	self->priv->_kind = _tmp0_;
	self->priv->_blurhash = NULL;
	self->priv->_remote_url = NULL;
	self->priv->_tuba_translated_alt_text = NULL;
	self->priv->_tuba_is_report = FALSE;
}

static void
tuba_api_attachment_finalize (GObject * obj)
{
	TubaAPIAttachment * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_API_TYPE_ATTACHMENT, TubaAPIAttachment);
	_g_free0 (self->priv->_id);
	_g_free0 (self->priv->_kind);
	_g_free0 (self->priv->_url);
	_g_free0 (self->priv->_description);
	_g_object_unref0 (self->priv->_meta);
	_g_free0 (self->priv->_blurhash);
	_g_free0 (self->priv->_t_preview_url);
	_g_free0 (self->priv->_remote_url);
	_g_free0 (self->priv->_tuba_translated_alt_text);
	_g_object_unref0 (self->priv->_source_file);
	G_OBJECT_CLASS (tuba_api_attachment_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_api_attachment_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaAPIAttachmentClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_api_attachment_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaAPIAttachment), 0, (GInstanceInitFunc) tuba_api_attachment_instance_init, NULL };
	static const GInterfaceInfo tuba_widgetizable_info = { (GInterfaceInitFunc) tuba_api_attachment_tuba_widgetizable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType tuba_api_attachment_type_id;
	tuba_api_attachment_type_id = g_type_register_static (TUBA_TYPE_ENTITY, "TubaAPIAttachment", &g_define_type_info, G_TYPE_FLAG_NONE);
	g_type_add_interface_static (tuba_api_attachment_type_id, TUBA_TYPE_WIDGETIZABLE, &tuba_widgetizable_info);
	TubaAPIAttachment_private_offset = g_type_add_instance_private (tuba_api_attachment_type_id, sizeof (TubaAPIAttachmentPrivate));
	return tuba_api_attachment_type_id;
}

GType
tuba_api_attachment_get_type (void)
{
	static GType tuba_api_attachment_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_api_attachment_type_id__once)) {
		GType tuba_api_attachment_type_id;
		tuba_api_attachment_type_id = tuba_api_attachment_get_type_once ();
		g_once_init_leave_pointer (&tuba_api_attachment_type_id__once, tuba_api_attachment_type_id);
	}
	return tuba_api_attachment_type_id__once;
}

static void
_vala_tuba_api_attachment_get_property (GObject * object,
                                        guint property_id,
                                        GValue * value,
                                        GParamSpec * pspec)
{
	TubaAPIAttachment * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_API_TYPE_ATTACHMENT, TubaAPIAttachment);
	switch (property_id) {
		case TUBA_API_ATTACHMENT_ID_PROPERTY:
		g_value_set_string (value, tuba_api_attachment_get_id (self));
		break;
		case TUBA_API_ATTACHMENT_KIND_PROPERTY:
		g_value_set_string (value, tuba_api_attachment_get_kind (self));
		break;
		case TUBA_API_ATTACHMENT_URL_PROPERTY:
		g_value_set_string (value, tuba_api_attachment_get_url (self));
		break;
		case TUBA_API_ATTACHMENT_DESCRIPTION_PROPERTY:
		g_value_set_string (value, tuba_api_attachment_get_description (self));
		break;
		case TUBA_API_ATTACHMENT_META_PROPERTY:
		g_value_set_object (value, tuba_api_attachment_get_meta (self));
		break;
		case TUBA_API_ATTACHMENT_BLURHASH_PROPERTY:
		g_value_set_string (value, tuba_api_attachment_get_blurhash (self));
		break;
		case TUBA_API_ATTACHMENT_PREVIEW_URL_PROPERTY:
		g_value_set_string (value, tuba_api_attachment_get_preview_url (self));
		break;
		case TUBA_API_ATTACHMENT_REMOTE_URL_PROPERTY:
		g_value_set_string (value, tuba_api_attachment_get_remote_url (self));
		break;
		case TUBA_API_ATTACHMENT_TUBA_TRANSLATED_ALT_TEXT_PROPERTY:
		g_value_set_string (value, tuba_api_attachment_get_tuba_translated_alt_text (self));
		break;
		case TUBA_API_ATTACHMENT_TUBA_IS_REPORT_PROPERTY:
		g_value_set_boolean (value, tuba_api_attachment_get_tuba_is_report (self));
		break;
		case TUBA_API_ATTACHMENT_SOURCE_FILE_PROPERTY:
		g_value_set_object (value, tuba_api_attachment_get_source_file (self));
		break;
		case TUBA_API_ATTACHMENT_IS_PUBLISHED_PROPERTY:
		g_value_set_boolean (value, tuba_api_attachment_get_is_published (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_api_attachment_set_property (GObject * object,
                                        guint property_id,
                                        const GValue * value,
                                        GParamSpec * pspec)
{
	TubaAPIAttachment * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_API_TYPE_ATTACHMENT, TubaAPIAttachment);
	switch (property_id) {
		case TUBA_API_ATTACHMENT_ID_PROPERTY:
		tuba_api_attachment_set_id (self, g_value_get_string (value));
		break;
		case TUBA_API_ATTACHMENT_KIND_PROPERTY:
		tuba_api_attachment_set_kind (self, g_value_get_string (value));
		break;
		case TUBA_API_ATTACHMENT_URL_PROPERTY:
		tuba_api_attachment_set_url (self, g_value_get_string (value));
		break;
		case TUBA_API_ATTACHMENT_DESCRIPTION_PROPERTY:
		tuba_api_attachment_set_description (self, g_value_get_string (value));
		break;
		case TUBA_API_ATTACHMENT_META_PROPERTY:
		tuba_api_attachment_set_meta (self, g_value_get_object (value));
		break;
		case TUBA_API_ATTACHMENT_BLURHASH_PROPERTY:
		tuba_api_attachment_set_blurhash (self, g_value_get_string (value));
		break;
		case TUBA_API_ATTACHMENT_PREVIEW_URL_PROPERTY:
		tuba_api_attachment_set_preview_url (self, g_value_get_string (value));
		break;
		case TUBA_API_ATTACHMENT_REMOTE_URL_PROPERTY:
		tuba_api_attachment_set_remote_url (self, g_value_get_string (value));
		break;
		case TUBA_API_ATTACHMENT_TUBA_TRANSLATED_ALT_TEXT_PROPERTY:
		tuba_api_attachment_set_tuba_translated_alt_text (self, g_value_get_string (value));
		break;
		case TUBA_API_ATTACHMENT_TUBA_IS_REPORT_PROPERTY:
		tuba_api_attachment_set_tuba_is_report (self, g_value_get_boolean (value));
		break;
		case TUBA_API_ATTACHMENT_SOURCE_FILE_PROPERTY:
		tuba_api_attachment_set_source_file (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

