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

#include <adwaita.h>
#include <glib-object.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include <gio/gio.h>
#include <gee.h>
#include <json-glib/json-glib.h>
#include <float.h>
#include <math.h>
#include <glib/gi18n-lib.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define TUBA_VIEWS_TYPE_BASE (tuba_views_base_get_type ())
#define TUBA_VIEWS_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_VIEWS_TYPE_BASE, TubaViewsBase))
#define TUBA_VIEWS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_VIEWS_TYPE_BASE, TubaViewsBaseClass))
#define TUBA_VIEWS_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_VIEWS_TYPE_BASE))
#define TUBA_VIEWS_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_VIEWS_TYPE_BASE))
#define TUBA_VIEWS_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_VIEWS_TYPE_BASE, TubaViewsBaseClass))

typedef struct _TubaViewsBase TubaViewsBase;
typedef struct _TubaViewsBaseClass TubaViewsBaseClass;
typedef struct _TubaViewsBasePrivate TubaViewsBasePrivate;

#define TUBA_VIEWS_TYPE_CONTENT_BASE (tuba_views_content_base_get_type ())
#define TUBA_VIEWS_CONTENT_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_VIEWS_TYPE_CONTENT_BASE, TubaViewsContentBase))
#define TUBA_VIEWS_CONTENT_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_VIEWS_TYPE_CONTENT_BASE, TubaViewsContentBaseClass))
#define TUBA_VIEWS_IS_CONTENT_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_VIEWS_TYPE_CONTENT_BASE))
#define TUBA_VIEWS_IS_CONTENT_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_VIEWS_TYPE_CONTENT_BASE))
#define TUBA_VIEWS_CONTENT_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_VIEWS_TYPE_CONTENT_BASE, TubaViewsContentBaseClass))

typedef struct _TubaViewsContentBase TubaViewsContentBase;
typedef struct _TubaViewsContentBaseClass TubaViewsContentBaseClass;
typedef struct _TubaViewsContentBasePrivate TubaViewsContentBasePrivate;

#define TUBA_TYPE_ACCOUNT_HOLDER (tuba_account_holder_get_type ())
#define TUBA_ACCOUNT_HOLDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_ACCOUNT_HOLDER, TubaAccountHolder))
#define TUBA_IS_ACCOUNT_HOLDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_ACCOUNT_HOLDER))
#define TUBA_ACCOUNT_HOLDER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TUBA_TYPE_ACCOUNT_HOLDER, TubaAccountHolderIface))

typedef struct _TubaAccountHolder TubaAccountHolder;
typedef struct _TubaAccountHolderIface TubaAccountHolderIface;

#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_TYPE_STREAMABLE (tuba_streamable_get_type ())
#define TUBA_STREAMABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_STREAMABLE, TubaStreamable))
#define TUBA_IS_STREAMABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_STREAMABLE))
#define TUBA_STREAMABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TUBA_TYPE_STREAMABLE, TubaStreamableIface))

typedef struct _TubaStreamable TubaStreamable;
typedef struct _TubaStreamableIface TubaStreamableIface;

#define TUBA_VIEWS_TYPE_TIMELINE (tuba_views_timeline_get_type ())
#define TUBA_VIEWS_TIMELINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_VIEWS_TYPE_TIMELINE, TubaViewsTimeline))
#define TUBA_VIEWS_TIMELINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_VIEWS_TYPE_TIMELINE, TubaViewsTimelineClass))
#define TUBA_VIEWS_IS_TIMELINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_VIEWS_TYPE_TIMELINE))
#define TUBA_VIEWS_IS_TIMELINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_VIEWS_TYPE_TIMELINE))
#define TUBA_VIEWS_TIMELINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_VIEWS_TYPE_TIMELINE, TubaViewsTimelineClass))

typedef struct _TubaViewsTimeline TubaViewsTimeline;
typedef struct _TubaViewsTimelineClass TubaViewsTimelineClass;
typedef struct _TubaViewsTimelinePrivate TubaViewsTimelinePrivate;

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

#define TUBA_STREAMABLE_TYPE_EVENT (tuba_streamable_event_get_type ())
typedef struct _TubaStreamableEvent TubaStreamableEvent;

#define TUBA_VIEWS_TYPE_HOME (tuba_views_home_get_type ())
#define TUBA_VIEWS_HOME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_VIEWS_TYPE_HOME, TubaViewsHome))
#define TUBA_VIEWS_HOME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_VIEWS_TYPE_HOME, TubaViewsHomeClass))
#define TUBA_VIEWS_IS_HOME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_VIEWS_TYPE_HOME))
#define TUBA_VIEWS_IS_HOME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_VIEWS_TYPE_HOME))
#define TUBA_VIEWS_HOME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_VIEWS_TYPE_HOME, TubaViewsHomeClass))

typedef struct _TubaViewsHome TubaViewsHome;
typedef struct _TubaViewsHomeClass TubaViewsHomeClass;
typedef struct _TubaViewsHomePrivate TubaViewsHomePrivate;
enum  {
	TUBA_VIEWS_HOME_0_PROPERTY,
	TUBA_VIEWS_HOME_NUM_PROPERTIES
};
static GParamSpec* tuba_views_home_properties[TUBA_VIEWS_HOME_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

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

typedef struct _TubaSettings TubaSettings;
typedef struct _TubaSettingsClass TubaSettingsClass;

#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_VIEWS_HOME_TYPE_SUGGESTION_OBJECT (tuba_views_home_suggestion_object_get_type ())
#define TUBA_VIEWS_HOME_SUGGESTION_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_VIEWS_HOME_TYPE_SUGGESTION_OBJECT, TubaViewsHomeSuggestionObject))
#define TUBA_VIEWS_HOME_SUGGESTION_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_VIEWS_HOME_TYPE_SUGGESTION_OBJECT, TubaViewsHomeSuggestionObjectClass))
#define TUBA_VIEWS_HOME_IS_SUGGESTION_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_VIEWS_HOME_TYPE_SUGGESTION_OBJECT))
#define TUBA_VIEWS_HOME_IS_SUGGESTION_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_VIEWS_HOME_TYPE_SUGGESTION_OBJECT))
#define TUBA_VIEWS_HOME_SUGGESTION_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_VIEWS_HOME_TYPE_SUGGESTION_OBJECT, TubaViewsHomeSuggestionObjectClass))

typedef struct _TubaViewsHomeSuggestionObject TubaViewsHomeSuggestionObject;
typedef struct _TubaViewsHomeSuggestionObjectClass TubaViewsHomeSuggestionObjectClass;

#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 _g_free0(var) (var = (g_free (var), NULL))

#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;
typedef struct _TubaViewsHomeSuggestionObjectPrivate TubaViewsHomeSuggestionObjectPrivate;
enum  {
	TUBA_VIEWS_HOME_SUGGESTION_OBJECT_0_PROPERTY,
	TUBA_VIEWS_HOME_SUGGESTION_OBJECT_NUM_PROPERTIES
};
static GParamSpec* tuba_views_home_suggestion_object_properties[TUBA_VIEWS_HOME_SUGGESTION_OBJECT_NUM_PROPERTIES];

#define TUBA_WIDGETS_TYPE_ACCOUNT_SUGGESTIONS (tuba_widgets_account_suggestions_get_type ())
#define TUBA_WIDGETS_ACCOUNT_SUGGESTIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_ACCOUNT_SUGGESTIONS, TubaWidgetsAccountSuggestions))
#define TUBA_WIDGETS_ACCOUNT_SUGGESTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_ACCOUNT_SUGGESTIONS, TubaWidgetsAccountSuggestionsClass))
#define TUBA_WIDGETS_IS_ACCOUNT_SUGGESTIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_ACCOUNT_SUGGESTIONS))
#define TUBA_WIDGETS_IS_ACCOUNT_SUGGESTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_ACCOUNT_SUGGESTIONS))
#define TUBA_WIDGETS_ACCOUNT_SUGGESTIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_ACCOUNT_SUGGESTIONS, TubaWidgetsAccountSuggestionsClass))

typedef struct _TubaWidgetsAccountSuggestions TubaWidgetsAccountSuggestions;
typedef struct _TubaWidgetsAccountSuggestionsClass TubaWidgetsAccountSuggestionsClass;

#define TUBA_TYPE_PLACE (tuba_place_get_type ())
#define TUBA_PLACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_PLACE, TubaPlace))
#define TUBA_PLACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_PLACE, TubaPlaceClass))
#define TUBA_IS_PLACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_PLACE))
#define TUBA_IS_PLACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_PLACE))
#define TUBA_PLACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_PLACE, TubaPlaceClass))

typedef struct _TubaPlace TubaPlace;
typedef struct _TubaPlaceClass TubaPlaceClass;

struct _TubaViewsBase {
	AdwBreakpointBin parent_instance;
	TubaViewsBasePrivate * priv;
	AdwHeaderBar* header;
	AdwToolbarView* toolbar_view;
	GtkScrolledWindow* scrolled;
	GtkOverlay* scrolled_overlay;
	GtkRevealer* scroll_to_top_rev;
	GtkButton* scroll_to_top;
	GtkStack* states;
	AdwClamp* content_box;
	GtkButton* status_button;
};

struct _TubaViewsBaseClass {
	AdwBreakpointBinClass parent_class;
	void (*scroll_page) (TubaViewsBase* self, gboolean up);
	void (*unbind_listboxes) (TubaViewsBase* self);
	void (*build_actions) (TubaViewsBase* self);
	void (*build_header) (TubaViewsBase* self);
	void (*clear) (TubaViewsBase* self);
	void (*on_shown) (TubaViewsBase* self);
	void (*on_hidden) (TubaViewsBase* self);
	void (*on_content_changed) (TubaViewsBase* self);
	void (*on_error) (TubaViewsBase* self, gint32 code, const gchar* reason);
};

struct _TubaViewsContentBase {
	TubaViewsBase parent_instance;
	TubaViewsContentBasePrivate * priv;
	GtkListBox* content;
	GListStore* model;
};

struct _TubaViewsContentBaseClass {
	TubaViewsBaseClass parent_class;
	void (*on_scrolled_vadjustment_value_change) (TubaViewsContentBase* self);
	void (*clear_all_but_first) (TubaViewsContentBase* self, gint i);
	void (*attempt_focus_grab) (TubaViewsContentBase* self);
	GtkWidget* (*on_create_model_widget) (TubaViewsContentBase* self, GObject* obj);
	void (*on_bottom_reached) (TubaViewsContentBase* self);
	void (*on_content_item_activated) (TubaViewsContentBase* self, GtkListBoxRow* row);
	gboolean (*get_empty) (TubaViewsContentBase* self);
};

struct _TubaAccountHolderIface {
	GTypeInterface parent_iface;
	void (*on_account_changed) (TubaAccountHolder* self, TubaInstanceAccount* acc);
	void (*on_accounts_changed) (TubaAccountHolder* self, GeeArrayList* accounts);
	TubaInstanceAccount* (*get_account) (TubaAccountHolder* self);
	void (*set_account) (TubaAccountHolder* self, TubaInstanceAccount* value);
};

struct _TubaStreamableIface {
	GTypeInterface parent_iface;
	gchar* (*get_stream_url) (TubaStreamable* self);
	void (*on_streaming_policy_changed) (TubaStreamable* self);
	const gchar* (*get_t_connection_url) (TubaStreamable* self);
	void (*set_t_connection_url) (TubaStreamable* self, const gchar* value);
	gboolean (*get_subscribed) (TubaStreamable* self);
	void (*set_subscribed) (TubaStreamable* self, gboolean value);
};

struct _TubaStreamableEvent {
	gchar* type;
	JsonNode* payload;
};

struct _TubaViewsTimeline {
	TubaViewsContentBase parent_instance;
	TubaViewsTimelinePrivate * priv;
};

struct _TubaViewsTimelineClass {
	TubaViewsContentBaseClass parent_class;
	gchar* (*get_req_url) (TubaViewsTimeline* self);
	void (*append_params_v2) (TubaViewsTimeline* self, TubaRequestV2* req);
	void (*on_request_finish) (TubaViewsTimeline* self);
	void (*request) (TubaViewsTimeline* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*request_finish) (TubaViewsTimeline* self, GAsyncResult* _res_);
	void (*on_refresh) (TubaViewsTimeline* self);
	void (*on_manual_refresh) (TubaViewsTimeline* self);
	void (*on_account_changed) (TubaViewsTimeline* self, TubaInstanceAccount* acc);
	gchar* (*get_stream_url) (TubaViewsTimeline* self);
	gboolean (*should_hide) (TubaViewsTimeline* self, TubaEntity* entity);
	void (*on_new_post) (TubaViewsTimeline* self, TubaStreamableEvent* ev);
	void (*on_edit_post) (TubaViewsTimeline* self, TubaStreamableEvent* ev);
	void (*on_delete_post) (TubaViewsTimeline* self, TubaStreamableEvent* ev);
	void (*on_remove_user) (TubaViewsTimeline* self, const gchar* user_id);
};

struct _TubaViewsHome {
	TubaViewsTimeline parent_instance;
	TubaViewsHomePrivate * priv;
};

struct _TubaViewsHomeClass {
	TubaViewsTimelineClass parent_class;
};

struct _TubaViewsHomePrivate {
	GtkRevealer* compose_button_rev;
	GtkButton* compose_button;
	gboolean has_account_suggestions;
	gdouble last_adjustment;
	gdouble show_on_adjustment;
	gboolean last_direction_down;
};

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

struct _TubaViewsHomeSuggestionObject {
	GObject parent_instance;
	TubaViewsHomeSuggestionObjectPrivate * priv;
};

struct _TubaViewsHomeSuggestionObjectClass {
	GObjectClass parent_class;
};

static gint TubaViewsHome_private_offset;
static gpointer tuba_views_home_parent_class = NULL;
VALA_EXTERN TubaSettings* tuba_settings;
VALA_EXTERN TubaAccountStore* tuba_accounts;
VALA_EXTERN TubaApplication* tuba_app;
static gpointer tuba_views_home_suggestion_object_parent_class = NULL;
static TubaWidgetizableIface * tuba_views_home_suggestion_object_tuba_widgetizable_parent_iface = NULL;
VALA_EXTERN TubaPlace* tuba_mastodon_account_PLACE_HOME;

VALA_EXTERN GType tuba_views_base_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaViewsBase, g_object_unref)
VALA_EXTERN GType tuba_views_content_base_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaViewsContentBase, 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 GType tuba_account_holder_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAccountHolder, g_object_unref)
VALA_EXTERN GType tuba_streamable_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaStreamable, g_object_unref)
VALA_EXTERN GType tuba_views_timeline_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaViewsTimeline, g_object_unref)
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_streamable_event_get_type (void) G_GNUC_CONST ;
VALA_EXTERN TubaStreamableEvent* tuba_streamable_event_dup (const TubaStreamableEvent* self);
VALA_EXTERN void tuba_streamable_event_free (TubaStreamableEvent* self);
VALA_EXTERN void tuba_streamable_event_copy (const TubaStreamableEvent* self,
                                 TubaStreamableEvent* dest);
VALA_EXTERN void tuba_streamable_event_destroy (TubaStreamableEvent* self);
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (TubaStreamableEvent, tuba_streamable_event_destroy)
VALA_EXTERN GType tuba_views_home_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaViewsHome, g_object_unref)
VALA_EXTERN void tuba_views_base_on_content_changed (TubaViewsBase* self);
VALA_EXTERN void tuba_views_timeline_on_refresh (TubaViewsTimeline* self);
VALA_EXTERN void tuba_views_content_base_on_scrolled_vadjustment_value_change (TubaViewsContentBase* self);
VALA_EXTERN gchar* tuba_views_timeline_get_stream_url (TubaViewsTimeline* self);
VALA_EXTERN void tuba_views_timeline_on_edit_post (TubaViewsTimeline* self,
                                       TubaStreamableEvent* ev);
VALA_EXTERN void tuba_views_timeline_on_delete_post (TubaViewsTimeline* self,
                                         TubaStreamableEvent* ev);
VALA_EXTERN TubaViewsHome* tuba_views_home_new (void);
VALA_EXTERN TubaViewsHome* tuba_views_home_construct (GType object_type);
static void tuba_views_home_toggle_scroll_to_top_margin (TubaViewsHome* self);
VALA_EXTERN void tuba_toggle_css (GtkWidget* wdg,
                      gboolean state,
                      const gchar* style);
static void tuba_views_home_set_compose_button_reveal_child (TubaViewsHome* self,
                                                      gboolean reveal);
static void tuba_views_home_on_child_revealed (TubaViewsHome* self);
static void tuba_views_home_real_on_content_changed (TubaViewsBase* base);
VALA_EXTERN GType tuba_settings_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaSettings, g_object_unref)
VALA_EXTERN gboolean tuba_settings_get_account_suggestions (TubaSettings* self);
VALA_EXTERN gboolean tuba_views_content_base_get_empty (TubaViewsContentBase* self);
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 gint64 tuba_api_account_get_following_count (TubaAPIAccount* self);
VALA_EXTERN TubaViewsHomeSuggestionObject* tuba_views_home_suggestion_object_new (void);
VALA_EXTERN TubaViewsHomeSuggestionObject* tuba_views_home_suggestion_object_construct (GType object_type);
VALA_EXTERN GType tuba_views_home_suggestion_object_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaViewsHomeSuggestionObject, g_object_unref)
static void tuba_views_home_real_on_refresh (TubaViewsTimeline* base);
static void tuba_views_home_real_on_scrolled_vadjustment_value_change (TubaViewsContentBase* base);
VALA_EXTERN GType tuba_application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaApplication, g_object_unref)
VALA_EXTERN gboolean tuba_application_get_is_mobile (TubaApplication* self);
static gchar* tuba_views_home_real_get_stream_url (TubaViewsTimeline* base);
VALA_EXTERN TubaInstanceAccount* tuba_account_holder_get_account (TubaAccountHolder* self);
VALA_EXTERN const gchar* tuba_instance_account_get_tuba_streaming_url (TubaInstanceAccount* self);
VALA_EXTERN const gchar* tuba_instance_account_get_access_token (TubaInstanceAccount* self);
static void tuba_views_home_real_on_edit_post (TubaViewsTimeline* base,
                                        TubaStreamableEvent* ev);
static void tuba_views_home_forward_to_notifications (TubaViewsHome* self,
                                               TubaStreamableEvent* ev);
static void tuba_views_home_real_on_delete_post (TubaViewsTimeline* base,
                                          TubaStreamableEvent* ev);
VALA_EXTERN void tuba_streamable_forward (TubaStreamable* self,
                              const gchar* url,
                              TubaStreamableEvent* ev);
VALA_EXTERN GType tuba_widgetizable_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetizable, g_object_unref)
static GtkWidget* tuba_views_home_suggestion_object_real_to_widget (TubaWidgetizable* base);
VALA_EXTERN TubaWidgetsAccountSuggestions* tuba_widgets_account_suggestions_new (void);
VALA_EXTERN TubaWidgetsAccountSuggestions* tuba_widgets_account_suggestions_construct (GType object_type);
VALA_EXTERN GType tuba_widgets_account_suggestions_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsAccountSuggestions, g_object_unref)
VALA_EXTERN GtkWidget* tuba_widgetizable_to_widget (TubaWidgetizable* self);
static GType tuba_views_home_suggestion_object_get_type_once (void);
static GObject * tuba_views_home_constructor (GType type,
                                       guint n_construct_properties,
                                       GObjectConstructParam * construct_properties);
static void _tuba_views_home_toggle_scroll_to_top_margin_g_object_notify (GObject* _sender,
                                                                   GParamSpec* pspec,
                                                                   gpointer self);
static void _tuba_views_home_on_child_revealed_g_object_notify (GObject* _sender,
                                                         GParamSpec* pspec,
                                                         gpointer self);
static void _tuba_views_home___lambda213_ (TubaViewsHome* self);
static void __tuba_views_home___lambda213__g_object_notify (GObject* _sender,
                                                     GParamSpec* pspec,
                                                     gpointer self);
VALA_EXTERN GType tuba_place_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaPlace, g_object_unref)
VALA_EXTERN void tuba_views_timeline_on_remove_user (TubaViewsTimeline* self,
                                         const gchar* user_id);
static void _tuba_views_timeline_on_remove_user_tuba_application_remove_user_id (TubaApplication* _sender,
                                                                          const gchar* user_id,
                                                                          gpointer self);
static void tuba_views_home_finalize (GObject * obj);
static GType tuba_views_home_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static inline gpointer
tuba_views_home_get_instance_private (TubaViewsHome* self)
{
	return G_STRUCT_MEMBER_P (self, TubaViewsHome_private_offset);
}

TubaViewsHome*
tuba_views_home_construct (GType object_type)
{
	TubaViewsHome * self = NULL;
	self = (TubaViewsHome*) g_object_new (object_type, "url", "/api/v1/timelines/home", "label", _ ("Home"), "icon", "tuba-user-home-symbolic", "badge-number", 0, "needs-attention", FALSE, NULL);
	return self;
}

TubaViewsHome*
tuba_views_home_new (void)
{
	return tuba_views_home_construct (TUBA_VIEWS_TYPE_HOME);
}

static void
tuba_views_home_toggle_scroll_to_top_margin (TubaViewsHome* self)
{
	GtkRevealer* _tmp0_;
	GtkRevealer* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = ((TubaViewsBase*) self)->scroll_to_top_rev;
	_tmp1_ = self->priv->compose_button_rev;
	_tmp2_ = gtk_revealer_get_reveal_child (_tmp1_);
	_tmp3_ = _tmp2_;
	tuba_toggle_css ((GtkWidget*) _tmp0_, _tmp3_, "composer-btn-revealed");
}

static void
tuba_views_home_set_compose_button_reveal_child (TubaViewsHome* self,
                                                 gboolean reveal)
{
	GtkRevealer* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	GtkButton* _tmp3_;
	GtkRevealer* _tmp4_;
	GtkRevealer* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->compose_button_rev;
	_tmp1_ = gtk_revealer_get_reveal_child (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ == reveal) {
		return;
	}
	_tmp3_ = self->priv->compose_button;
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp3_, 24);
	_tmp4_ = self->priv->compose_button_rev;
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp4_, 0);
	_tmp5_ = self->priv->compose_button_rev;
	gtk_revealer_set_reveal_child (_tmp5_, reveal);
}

static void
tuba_views_home_on_child_revealed (TubaViewsHome* self)
{
	GtkButton* _tmp0_;
	GtkRevealer* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->compose_button;
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp0_, 0);
	_tmp1_ = self->priv->compose_button_rev;
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp1_, 24);
}

static void
tuba_views_home_real_on_content_changed (TubaViewsBase* base)
{
	TubaViewsHome * self;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	TubaSettings* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	self = (TubaViewsHome*) base;
	TUBA_VIEWS_BASE_CLASS (tuba_views_home_parent_class)->on_content_changed ((TubaViewsBase*) G_TYPE_CHECK_INSTANCE_CAST (self, TUBA_VIEWS_TYPE_TIMELINE, TubaViewsTimeline));
	_tmp3_ = tuba_settings;
	_tmp4_ = tuba_settings_get_account_suggestions (_tmp3_);
	_tmp5_ = _tmp4_;
	if (_tmp5_) {
		_tmp2_ = !self->priv->has_account_suggestions;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		gboolean _tmp6_;
		gboolean _tmp7_;
		_tmp6_ = tuba_views_content_base_get_empty ((TubaViewsContentBase*) self);
		_tmp7_ = _tmp6_;
		_tmp1_ = !_tmp7_;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		TubaAccountStore* _tmp8_;
		TubaInstanceAccount* _tmp9_;
		TubaInstanceAccount* _tmp10_;
		gint64 _tmp11_;
		gint64 _tmp12_;
		_tmp8_ = tuba_accounts;
		_tmp9_ = tuba_account_store_get_active (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = tuba_api_account_get_following_count ((TubaAPIAccount*) _tmp10_);
		_tmp12_ = _tmp11_;
		_tmp0_ = _tmp12_ <= ((gint64) 10);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GListStore* _tmp13_;
		TubaViewsHomeSuggestionObject* _tmp14_;
		TubaViewsHomeSuggestionObject* _tmp15_;
		self->priv->has_account_suggestions = TRUE;
		_tmp13_ = ((TubaViewsContentBase*) self)->model;
		_tmp14_ = tuba_views_home_suggestion_object_new ();
		_tmp15_ = _tmp14_;
		g_list_store_append (_tmp13_, (GObject*) _tmp15_);
		_g_object_unref0 (_tmp15_);
	}
}

static void
tuba_views_home_real_on_refresh (TubaViewsTimeline* base)
{
	TubaViewsHome * self;
	self = (TubaViewsHome*) base;
	self->priv->has_account_suggestions = FALSE;
	TUBA_VIEWS_TIMELINE_CLASS (tuba_views_home_parent_class)->on_refresh (G_TYPE_CHECK_INSTANCE_CAST (self, TUBA_VIEWS_TYPE_TIMELINE, TubaViewsTimeline));
}

static void
tuba_views_home_real_on_scrolled_vadjustment_value_change (TubaViewsContentBase* base)
{
	TubaViewsHome * self;
	TubaApplication* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gdouble trunced = 0.0;
	GtkScrolledWindow* _tmp3_;
	GtkAdjustment* _tmp4_;
	GtkAdjustment* _tmp5_;
	gdouble _tmp6_;
	gdouble _tmp7_;
	gboolean _tmp8_ = FALSE;
	gboolean direction_down = FALSE;
	gboolean _tmp9_ = FALSE;
	gboolean _tmp10_ = FALSE;
	GtkRevealer* _tmp11_;
	gboolean _tmp12_;
	gboolean _tmp13_;
	self = (TubaViewsHome*) base;
	TUBA_VIEWS_CONTENT_BASE_CLASS (tuba_views_home_parent_class)->on_scrolled_vadjustment_value_change ((TubaViewsContentBase*) G_TYPE_CHECK_INSTANCE_CAST (self, TUBA_VIEWS_TYPE_TIMELINE, TubaViewsTimeline));
	_tmp0_ = tuba_app;
	_tmp1_ = tuba_application_get_is_mobile (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ != TRUE) {
		return;
	}
	_tmp3_ = ((TubaViewsBase*) self)->scrolled;
	_tmp4_ = gtk_scrolled_window_get_vadjustment (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = gtk_adjustment_get_value (_tmp5_);
	_tmp7_ = _tmp6_;
	trunced = trunc (_tmp7_);
	if (trunced == self->priv->last_adjustment) {
		_tmp8_ = self->priv->last_direction_down;
	} else {
		_tmp8_ = trunced > self->priv->last_adjustment;
	}
	direction_down = _tmp8_;
	self->priv->last_direction_down = direction_down;
	if (!direction_down) {
		_tmp9_ = self->priv->show_on_adjustment == ((gdouble) -1);
	} else {
		_tmp9_ = FALSE;
	}
	if (_tmp9_) {
		self->priv->show_on_adjustment = self->priv->last_adjustment - 200;
		if (self->priv->show_on_adjustment <= ((gdouble) 0)) {
			self->priv->show_on_adjustment = self->priv->last_adjustment;
		}
	} else {
		if (direction_down) {
			self->priv->show_on_adjustment = (gdouble) -1;
		}
	}
	_tmp11_ = self->priv->compose_button_rev;
	_tmp12_ = gtk_revealer_get_reveal_child (_tmp11_);
	_tmp13_ = _tmp12_;
	if (_tmp13_) {
		_tmp10_ = direction_down;
	} else {
		_tmp10_ = FALSE;
	}
	if (_tmp10_) {
		tuba_views_home_set_compose_button_reveal_child (self, FALSE);
	} else {
		gboolean _tmp14_ = FALSE;
		gboolean _tmp15_ = FALSE;
		GtkRevealer* _tmp16_;
		gboolean _tmp17_;
		gboolean _tmp18_;
		_tmp16_ = self->priv->compose_button_rev;
		_tmp17_ = gtk_revealer_get_reveal_child (_tmp16_);
		_tmp18_ = _tmp17_;
		if (!_tmp18_) {
			_tmp15_ = !direction_down;
		} else {
			_tmp15_ = FALSE;
		}
		if (_tmp15_) {
			_tmp14_ = trunced <= self->priv->show_on_adjustment;
		} else {
			_tmp14_ = FALSE;
		}
		if (_tmp14_) {
			tuba_views_home_set_compose_button_reveal_child (self, TRUE);
		}
	}
	self->priv->last_adjustment = trunced;
}

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 gchar*
tuba_views_home_real_get_stream_url (TubaViewsTimeline* base)
{
	TubaViewsHome * self;
	gchar* _tmp0_ = NULL;
	TubaInstanceAccount* _tmp1_;
	TubaInstanceAccount* _tmp2_;
	gchar* _tmp14_;
	gchar* result;
	self = (TubaViewsHome*) base;
	_tmp1_ = tuba_account_holder_get_account ((TubaAccountHolder*) self);
	_tmp2_ = _tmp1_;
	if (_tmp2_ != NULL) {
		TubaInstanceAccount* _tmp3_;
		TubaInstanceAccount* _tmp4_;
		const gchar* _tmp5_;
		const gchar* _tmp6_;
		const gchar* _tmp7_;
		TubaInstanceAccount* _tmp8_;
		TubaInstanceAccount* _tmp9_;
		const gchar* _tmp10_;
		const gchar* _tmp11_;
		const gchar* _tmp12_;
		gchar* _tmp13_;
		_tmp3_ = tuba_account_holder_get_account ((TubaAccountHolder*) self);
		_tmp4_ = _tmp3_;
		_tmp5_ = tuba_instance_account_get_tuba_streaming_url (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = string_to_string (_tmp6_);
		_tmp8_ = tuba_account_holder_get_account ((TubaAccountHolder*) self);
		_tmp9_ = _tmp8_;
		_tmp10_ = tuba_instance_account_get_access_token (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp12_ = string_to_string (_tmp11_);
		_tmp13_ = g_strconcat (_tmp7_, "/api/v1/streaming?stream=user&access_token=", _tmp12_, NULL);
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp13_;
	} else {
		_g_free0 (_tmp0_);
		_tmp0_ = NULL;
	}
	_tmp14_ = _tmp0_;
	_tmp0_ = NULL;
	result = _tmp14_;
	_g_free0 (_tmp0_);
	return result;
}

static void
tuba_views_home_real_on_edit_post (TubaViewsTimeline* base,
                                   TubaStreamableEvent* ev)
{
	TubaViewsHome * self;
	TubaStreamableEvent _tmp0_;
	TubaStreamableEvent _tmp1_;
	self = (TubaViewsHome*) base;
	g_return_if_fail (ev != NULL);
	_tmp0_ = *ev;
	TUBA_VIEWS_TIMELINE_CLASS (tuba_views_home_parent_class)->on_edit_post (G_TYPE_CHECK_INSTANCE_CAST (self, TUBA_VIEWS_TYPE_TIMELINE, TubaViewsTimeline), &_tmp0_);
	_tmp1_ = *ev;
	tuba_views_home_forward_to_notifications (self, &_tmp1_);
}

static void
tuba_views_home_real_on_delete_post (TubaViewsTimeline* base,
                                     TubaStreamableEvent* ev)
{
	TubaViewsHome * self;
	TubaStreamableEvent _tmp0_;
	TubaStreamableEvent _tmp1_;
	self = (TubaViewsHome*) base;
	g_return_if_fail (ev != NULL);
	_tmp0_ = *ev;
	TUBA_VIEWS_TIMELINE_CLASS (tuba_views_home_parent_class)->on_delete_post (G_TYPE_CHECK_INSTANCE_CAST (self, TUBA_VIEWS_TYPE_TIMELINE, TubaViewsTimeline), &_tmp0_);
	_tmp1_ = *ev;
	tuba_views_home_forward_to_notifications (self, &_tmp1_);
}

static void
tuba_views_home_forward_to_notifications (TubaViewsHome* self,
                                          TubaStreamableEvent* ev)
{
	TubaInstanceAccount* _tmp0_;
	TubaInstanceAccount* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	TubaInstanceAccount* _tmp5_;
	TubaInstanceAccount* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	TubaStreamableEvent _tmp12_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (ev != NULL);
	_tmp0_ = tuba_account_holder_get_account ((TubaAccountHolder*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = tuba_instance_account_get_tuba_streaming_url (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = string_to_string (_tmp3_);
	_tmp5_ = tuba_account_holder_get_account ((TubaAccountHolder*) self);
	_tmp6_ = _tmp5_;
	_tmp7_ = tuba_instance_account_get_access_token (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = string_to_string (_tmp8_);
	_tmp10_ = g_strconcat (_tmp4_, "/api/v1/streaming?stream=user:notification&access_token=", _tmp9_, NULL);
	_tmp11_ = _tmp10_;
	_tmp12_ = *ev;
	tuba_streamable_forward ((TubaStreamable*) self, _tmp11_, &_tmp12_);
	_g_free0 (_tmp11_);
}

static GtkWidget*
tuba_views_home_suggestion_object_real_to_widget (TubaWidgetizable* base)
{
	TubaViewsHomeSuggestionObject * self;
	TubaWidgetsAccountSuggestions* _tmp0_;
	GtkWidget* result;
	self = (TubaViewsHomeSuggestionObject*) base;
	_tmp0_ = tuba_widgets_account_suggestions_new ();
	g_object_ref_sink (_tmp0_);
	result = (GtkWidget*) _tmp0_;
	return result;
}

TubaViewsHomeSuggestionObject*
tuba_views_home_suggestion_object_construct (GType object_type)
{
	TubaViewsHomeSuggestionObject * self = NULL;
	self = (TubaViewsHomeSuggestionObject*) g_object_new (object_type, NULL);
	return self;
}

TubaViewsHomeSuggestionObject*
tuba_views_home_suggestion_object_new (void)
{
	return tuba_views_home_suggestion_object_construct (TUBA_VIEWS_HOME_TYPE_SUGGESTION_OBJECT);
}

static void
tuba_views_home_suggestion_object_class_init (TubaViewsHomeSuggestionObjectClass * klass,
                                              gpointer klass_data)
{
	tuba_views_home_suggestion_object_parent_class = g_type_class_peek_parent (klass);
}

static void
tuba_views_home_suggestion_object_tuba_widgetizable_interface_init (TubaWidgetizableIface * iface,
                                                                    gpointer iface_data)
{
	tuba_views_home_suggestion_object_tuba_widgetizable_parent_iface = g_type_interface_peek_parent (iface);
	iface->to_widget = (GtkWidget* (*) (TubaWidgetizable*)) tuba_views_home_suggestion_object_real_to_widget;
}

static void
tuba_views_home_suggestion_object_instance_init (TubaViewsHomeSuggestionObject * self,
                                                 gpointer klass)
{
}

 G_GNUC_NO_INLINE static GType
tuba_views_home_suggestion_object_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaViewsHomeSuggestionObjectClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_views_home_suggestion_object_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaViewsHomeSuggestionObject), 0, (GInstanceInitFunc) tuba_views_home_suggestion_object_instance_init, NULL };
	static const GInterfaceInfo tuba_widgetizable_info = { (GInterfaceInitFunc) tuba_views_home_suggestion_object_tuba_widgetizable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType tuba_views_home_suggestion_object_type_id;
	tuba_views_home_suggestion_object_type_id = g_type_register_static (G_TYPE_OBJECT, "TubaViewsHomeSuggestionObject", &g_define_type_info, G_TYPE_FLAG_NONE);
	g_type_add_interface_static (tuba_views_home_suggestion_object_type_id, TUBA_TYPE_WIDGETIZABLE, &tuba_widgetizable_info);
	return tuba_views_home_suggestion_object_type_id;
}

GType
tuba_views_home_suggestion_object_get_type (void)
{
	static GType tuba_views_home_suggestion_object_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_views_home_suggestion_object_type_id__once)) {
		GType tuba_views_home_suggestion_object_type_id;
		tuba_views_home_suggestion_object_type_id = tuba_views_home_suggestion_object_get_type_once ();
		g_once_init_leave_pointer (&tuba_views_home_suggestion_object_type_id__once, tuba_views_home_suggestion_object_type_id);
	}
	return tuba_views_home_suggestion_object_type_id__once;
}

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

static void
_tuba_views_home_toggle_scroll_to_top_margin_g_object_notify (GObject* _sender,
                                                              GParamSpec* pspec,
                                                              gpointer self)
{
	tuba_views_home_toggle_scroll_to_top_margin ((TubaViewsHome*) self);
}

static void
_tuba_views_home_on_child_revealed_g_object_notify (GObject* _sender,
                                                    GParamSpec* pspec,
                                                    gpointer self)
{
	tuba_views_home_on_child_revealed ((TubaViewsHome*) self);
}

static void
_tuba_views_home___lambda213_ (TubaViewsHome* self)
{
	TubaApplication* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	_tmp0_ = tuba_app;
	_tmp1_ = tuba_application_get_is_mobile (_tmp0_);
	_tmp2_ = _tmp1_;
	if (!_tmp2_) {
		tuba_views_home_set_compose_button_reveal_child (self, TRUE);
	}
}

static void
__tuba_views_home___lambda213__g_object_notify (GObject* _sender,
                                                GParamSpec* pspec,
                                                gpointer self)
{
	_tuba_views_home___lambda213_ ((TubaViewsHome*) self);
}

static void
_tuba_views_timeline_on_remove_user_tuba_application_remove_user_id (TubaApplication* _sender,
                                                                     const gchar* user_id,
                                                                     gpointer self)
{
	tuba_views_timeline_on_remove_user ((TubaViewsTimeline*) self, user_id);
}

static GObject *
tuba_views_home_constructor (GType type,
                             guint n_construct_properties,
                             GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	TubaViewsHome * self;
	GtkRevealer* _tmp0_;
	GtkRevealer* _tmp1_;
	GtkRevealer* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar** _tmp8_;
	GtkButton* _tmp9_ = NULL;
	GtkAlign _tmp10_ = 0;
	GtkButton* _tmp11_;
	GtkWidget* _tmp12_;
	GtkRevealer* _tmp13_ = NULL;
	GtkRevealer* _tmp14_;
	GtkRevealer* _tmp15_;
	GtkOverlay* _tmp16_;
	GtkRevealer* _tmp17_;
	TubaApplication* _tmp18_;
	TubaPlace* _tmp19_;
	TubaApplication* _tmp20_;
	parent_class = G_OBJECT_CLASS (tuba_views_home_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_VIEWS_TYPE_HOME, TubaViewsHome);
	_tmp0_ = ((TubaViewsBase*) self)->scroll_to_top_rev;
	gtk_widget_set_margin_end ((GtkWidget*) _tmp0_, 32);
	_tmp1_ = ((TubaViewsBase*) self)->scroll_to_top_rev;
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp1_, 24);
	_tmp2_ = ((TubaViewsBase*) self)->scroll_to_top_rev;
	gtk_widget_add_css_class ((GtkWidget*) _tmp2_, "scroll-to-top-btn");
	_tmp3_ = g_strdup ("app.compose");
	_tmp4_ = g_strdup (_ ("Compose"));
	_tmp5_ = g_strdup ("circular");
	_tmp6_ = g_strdup ("compose-button");
	_tmp7_ = g_strdup ("suggested-action");
	_tmp8_ = g_new0 (gchar*, 3 + 1);
	_tmp8_[0] = _tmp5_;
	_tmp8_[1] = _tmp6_;
	_tmp8_[2] = _tmp7_;
	_tmp9_ = (GtkButton*) gtk_button_new_from_icon_name ("document-edit-symbolic");
	gtk_actionable_set_action_name ((GtkActionable*) _tmp9_, _tmp3_);
	_g_free0 (_tmp3_);
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp9_, _tmp4_);
	_g_free0 (_tmp4_);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp9_, _tmp8_);
	_tmp8_ = (_vala_array_free (_tmp8_, 3, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp9_);
	_g_object_unref0 (self->priv->compose_button);
	self->priv->compose_button = _tmp9_;
	_tmp10_ = GTK_ALIGN_END;
	_tmp11_ = self->priv->compose_button;
	_tmp12_ = _g_object_ref0 ((GtkWidget*) _tmp11_);
	_tmp13_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_transition_type (_tmp13_, GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP);
	gtk_widget_set_halign ((GtkWidget*) _tmp13_, _tmp10_);
	gtk_widget_set_valign ((GtkWidget*) _tmp13_, _tmp10_);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp13_, 24);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp13_, 24);
	gtk_revealer_set_reveal_child (_tmp13_, TRUE);
	gtk_widget_set_overflow ((GtkWidget*) _tmp13_, GTK_OVERFLOW_VISIBLE);
	gtk_revealer_set_child (_tmp13_, _tmp12_);
	_g_object_unref0 (_tmp12_);
	g_object_ref_sink (_tmp13_);
	_g_object_unref0 (self->priv->compose_button_rev);
	self->priv->compose_button_rev = _tmp13_;
	_tmp14_ = self->priv->compose_button_rev;
	g_signal_connect_object ((GObject*) _tmp14_, "notify::reveal-child", (GCallback) _tuba_views_home_toggle_scroll_to_top_margin_g_object_notify, self, 0);
	_tmp15_ = self->priv->compose_button_rev;
	g_signal_connect_object ((GObject*) _tmp15_, "notify::child-revealed", (GCallback) _tuba_views_home_on_child_revealed_g_object_notify, self, 0);
	tuba_views_home_toggle_scroll_to_top_margin (self);
	_tmp16_ = ((TubaViewsBase*) self)->scrolled_overlay;
	_tmp17_ = self->priv->compose_button_rev;
	gtk_overlay_add_overlay (_tmp16_, (GtkWidget*) _tmp17_);
	_tmp18_ = tuba_app;
	g_signal_connect_object ((GObject*) _tmp18_, "notify::is-mobile", (GCallback) __tuba_views_home___lambda213__g_object_notify, self, 0);
	g_object_bind_property_with_closures ((GObject*) self, "entity-queue-size", (GObject*) self, "badge-number", 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)));
	_tmp19_ = tuba_mastodon_account_PLACE_HOME;
	g_object_bind_property_with_closures ((GObject*) self, "badge-number", (GObject*) _tmp19_, "badge", 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)));
	_tmp20_ = tuba_app;
	g_signal_connect_object (_tmp20_, "remove-user-id", (GCallback) _tuba_views_timeline_on_remove_user_tuba_application_remove_user_id, (TubaViewsTimeline*) self, 0);
	return obj;
}

static void
tuba_views_home_class_init (TubaViewsHomeClass * klass,
                            gpointer klass_data)
{
	tuba_views_home_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaViewsHome_private_offset);
	((TubaViewsBaseClass *) klass)->on_content_changed = (void (*) (TubaViewsBase*)) tuba_views_home_real_on_content_changed;
	((TubaViewsTimelineClass *) klass)->on_refresh = (void (*) (TubaViewsTimeline*)) tuba_views_home_real_on_refresh;
	((TubaViewsContentBaseClass *) klass)->on_scrolled_vadjustment_value_change = (void (*) (TubaViewsContentBase*)) tuba_views_home_real_on_scrolled_vadjustment_value_change;
	((TubaViewsTimelineClass *) klass)->get_stream_url = (gchar* (*) (TubaViewsTimeline*)) tuba_views_home_real_get_stream_url;
	((TubaViewsTimelineClass *) klass)->on_edit_post = (void (*) (TubaViewsTimeline*, TubaStreamableEvent*)) tuba_views_home_real_on_edit_post;
	((TubaViewsTimelineClass *) klass)->on_delete_post = (void (*) (TubaViewsTimeline*, TubaStreamableEvent*)) tuba_views_home_real_on_delete_post;
	G_OBJECT_CLASS (klass)->constructor = tuba_views_home_constructor;
	G_OBJECT_CLASS (klass)->finalize = tuba_views_home_finalize;
}

static void
tuba_views_home_instance_init (TubaViewsHome * self,
                               gpointer klass)
{
	self->priv = tuba_views_home_get_instance_private (self);
	self->priv->has_account_suggestions = FALSE;
	self->priv->last_adjustment = (gdouble) 0;
	self->priv->show_on_adjustment = (gdouble) -1;
	self->priv->last_direction_down = FALSE;
}

static void
tuba_views_home_finalize (GObject * obj)
{
	TubaViewsHome * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_VIEWS_TYPE_HOME, TubaViewsHome);
	_g_object_unref0 (self->priv->compose_button_rev);
	_g_object_unref0 (self->priv->compose_button);
	G_OBJECT_CLASS (tuba_views_home_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_views_home_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaViewsHomeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_views_home_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaViewsHome), 0, (GInstanceInitFunc) tuba_views_home_instance_init, NULL };
	GType tuba_views_home_type_id;
	tuba_views_home_type_id = g_type_register_static (TUBA_VIEWS_TYPE_TIMELINE, "TubaViewsHome", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaViewsHome_private_offset = g_type_add_instance_private (tuba_views_home_type_id, sizeof (TubaViewsHomePrivate));
	return tuba_views_home_type_id;
}

GType
tuba_views_home_get_type (void)
{
	static GType tuba_views_home_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_views_home_type_id__once)) {
		GType tuba_views_home_type_id;
		tuba_views_home_type_id = tuba_views_home_get_type_once ();
		g_once_init_leave_pointer (&tuba_views_home_type_id__once, tuba_views_home_type_id);
	}
	return tuba_views_home_type_id__once;
}

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

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

