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

#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <handy.h>
#include <gee.h>
#include <libsoup/soup.h>
#include <gio/gio.h>
#include <json-glib/json-glib.h>
#include <float.h>
#include <math.h>

#define TOOTLE_VIEWS_TYPE_BASE (tootle_views_base_get_type ())
#define TOOTLE_VIEWS_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_VIEWS_TYPE_BASE, TootleViewsBase))
#define TOOTLE_VIEWS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_VIEWS_TYPE_BASE, TootleViewsBaseClass))
#define TOOTLE_VIEWS_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_VIEWS_TYPE_BASE))
#define TOOTLE_VIEWS_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_VIEWS_TYPE_BASE))
#define TOOTLE_VIEWS_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_VIEWS_TYPE_BASE, TootleViewsBaseClass))

typedef struct _TootleViewsBase TootleViewsBase;
typedef struct _TootleViewsBaseClass TootleViewsBaseClass;
typedef struct _TootleViewsBasePrivate TootleViewsBasePrivate;

#define TOOTLE_TYPE_IACCOUNT_LISTENER (tootle_iaccount_listener_get_type ())
#define TOOTLE_IACCOUNT_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_TYPE_IACCOUNT_LISTENER, TootleIAccountListener))
#define TOOTLE_IS_IACCOUNT_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_TYPE_IACCOUNT_LISTENER))
#define TOOTLE_IACCOUNT_LISTENER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TOOTLE_TYPE_IACCOUNT_LISTENER, TootleIAccountListenerIface))

typedef struct _TootleIAccountListener TootleIAccountListener;
typedef struct _TootleIAccountListenerIface TootleIAccountListenerIface;

#define TOOTLE_TYPE_ENTITY (tootle_entity_get_type ())
#define TOOTLE_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_TYPE_ENTITY, TootleEntity))
#define TOOTLE_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_TYPE_ENTITY, TootleEntityClass))
#define TOOTLE_IS_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_TYPE_ENTITY))
#define TOOTLE_IS_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_TYPE_ENTITY))
#define TOOTLE_ENTITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_TYPE_ENTITY, TootleEntityClass))

typedef struct _TootleEntity TootleEntity;
typedef struct _TootleEntityClass TootleEntityClass;

#define TOOTLE_API_TYPE_ACCOUNT (tootle_api_account_get_type ())
#define TOOTLE_API_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_API_TYPE_ACCOUNT, TootleAPIAccount))
#define TOOTLE_API_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_API_TYPE_ACCOUNT, TootleAPIAccountClass))
#define TOOTLE_API_IS_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_API_TYPE_ACCOUNT))
#define TOOTLE_API_IS_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_API_TYPE_ACCOUNT))
#define TOOTLE_API_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_API_TYPE_ACCOUNT, TootleAPIAccountClass))

typedef struct _TootleAPIAccount TootleAPIAccount;
typedef struct _TootleAPIAccountClass TootleAPIAccountClass;

#define TOOTLE_TYPE_INSTANCE_ACCOUNT (tootle_instance_account_get_type ())
#define TOOTLE_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_TYPE_INSTANCE_ACCOUNT, TootleInstanceAccount))
#define TOOTLE_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_TYPE_INSTANCE_ACCOUNT, TootleInstanceAccountClass))
#define TOOTLE_IS_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_TYPE_INSTANCE_ACCOUNT))
#define TOOTLE_IS_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_TYPE_INSTANCE_ACCOUNT))
#define TOOTLE_INSTANCE_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_TYPE_INSTANCE_ACCOUNT, TootleInstanceAccountClass))

typedef struct _TootleInstanceAccount TootleInstanceAccount;
typedef struct _TootleInstanceAccountClass TootleInstanceAccountClass;

#define TOOTLE_TYPE_ISTREAM_LISTENER (tootle_istream_listener_get_type ())
#define TOOTLE_ISTREAM_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_TYPE_ISTREAM_LISTENER, TootleIStreamListener))
#define TOOTLE_IS_ISTREAM_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_TYPE_ISTREAM_LISTENER))
#define TOOTLE_ISTREAM_LISTENER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TOOTLE_TYPE_ISTREAM_LISTENER, TootleIStreamListenerIface))

typedef struct _TootleIStreamListener TootleIStreamListener;
typedef struct _TootleIStreamListenerIface TootleIStreamListenerIface;

#define TOOTLE_VIEWS_TYPE_TIMELINE (tootle_views_timeline_get_type ())
#define TOOTLE_VIEWS_TIMELINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_VIEWS_TYPE_TIMELINE, TootleViewsTimeline))
#define TOOTLE_VIEWS_TIMELINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_VIEWS_TYPE_TIMELINE, TootleViewsTimelineClass))
#define TOOTLE_VIEWS_IS_TIMELINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_VIEWS_TYPE_TIMELINE))
#define TOOTLE_VIEWS_IS_TIMELINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_VIEWS_TYPE_TIMELINE))
#define TOOTLE_VIEWS_TIMELINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_VIEWS_TYPE_TIMELINE, TootleViewsTimelineClass))

typedef struct _TootleViewsTimeline TootleViewsTimeline;
typedef struct _TootleViewsTimelineClass TootleViewsTimelineClass;
typedef struct _TootleViewsTimelinePrivate TootleViewsTimelinePrivate;

#define TOOTLE_API_TYPE_STATUS (tootle_api_status_get_type ())
#define TOOTLE_API_STATUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_API_TYPE_STATUS, TootleAPIStatus))
#define TOOTLE_API_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_API_TYPE_STATUS, TootleAPIStatusClass))
#define TOOTLE_API_IS_STATUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_API_TYPE_STATUS))
#define TOOTLE_API_IS_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_API_TYPE_STATUS))
#define TOOTLE_API_STATUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_API_TYPE_STATUS, TootleAPIStatusClass))

typedef struct _TootleAPIStatus TootleAPIStatus;
typedef struct _TootleAPIStatusClass TootleAPIStatusClass;

#define TOOTLE_TYPE_REQUEST (tootle_request_get_type ())
#define TOOTLE_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_TYPE_REQUEST, TootleRequest))
#define TOOTLE_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_TYPE_REQUEST, TootleRequestClass))
#define TOOTLE_IS_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_TYPE_REQUEST))
#define TOOTLE_IS_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_TYPE_REQUEST))
#define TOOTLE_REQUEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_TYPE_REQUEST, TootleRequestClass))

typedef struct _TootleRequest TootleRequest;
typedef struct _TootleRequestClass TootleRequestClass;
enum  {
	TOOTLE_VIEWS_TIMELINE_0_PROPERTY,
	TOOTLE_VIEWS_TIMELINE_URL_PROPERTY,
	TOOTLE_VIEWS_TIMELINE_IS_PUBLIC_PROPERTY,
	TOOTLE_VIEWS_TIMELINE_ACCEPTS_PROPERTY,
	TOOTLE_VIEWS_TIMELINE_IS_LAST_PAGE_PROPERTY,
	TOOTLE_VIEWS_TIMELINE_PAGE_NEXT_PROPERTY,
	TOOTLE_VIEWS_TIMELINE_PAGE_PREV_PROPERTY,
	TOOTLE_VIEWS_TIMELINE_NUM_PROPERTIES
};
static GParamSpec* tootle_views_timeline_properties[TOOTLE_VIEWS_TIMELINE_NUM_PROPERTIES];

#define TOOTLE_TYPE_STREAMS (tootle_streams_get_type ())
#define TOOTLE_STREAMS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_TYPE_STREAMS, TootleStreams))
#define TOOTLE_STREAMS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_TYPE_STREAMS, TootleStreamsClass))
#define TOOTLE_IS_STREAMS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_TYPE_STREAMS))
#define TOOTLE_IS_STREAMS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_TYPE_STREAMS))
#define TOOTLE_STREAMS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_TYPE_STREAMS, TootleStreamsClass))

typedef struct _TootleStreams TootleStreams;
typedef struct _TootleStreamsClass TootleStreamsClass;
#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_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))

#define TOOTLE_TYPE_SETTINGS (tootle_settings_get_type ())
#define TOOTLE_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_TYPE_SETTINGS, TootleSettings))
#define TOOTLE_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_TYPE_SETTINGS, TootleSettingsClass))
#define TOOTLE_IS_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_TYPE_SETTINGS))
#define TOOTLE_IS_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_TYPE_SETTINGS))
#define TOOTLE_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_TYPE_SETTINGS, TootleSettingsClass))

typedef struct _TootleSettings TootleSettings;
typedef struct _TootleSettingsClass TootleSettingsClass;
typedef void (*TootleNetworkSuccessCallback) (SoupSession* session, SoupMessage* msg, gpointer user_data, GError** error);
typedef void (*TootleNetworkNodeCallback) (JsonNode* node, SoupMessage* msg, gpointer user_data, GError** error);

#define TOOTLE_TYPE_WIDGETIZABLE (tootle_widgetizable_get_type ())
#define TOOTLE_WIDGETIZABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_TYPE_WIDGETIZABLE, TootleWidgetizable))
#define TOOTLE_IS_WIDGETIZABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_TYPE_WIDGETIZABLE))
#define TOOTLE_WIDGETIZABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TOOTLE_TYPE_WIDGETIZABLE, TootleWidgetizableIface))

typedef struct _TootleWidgetizable TootleWidgetizable;
typedef struct _TootleWidgetizableIface TootleWidgetizableIface;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef void (*TootleNetworkErrorCallback) (gint32 code, const gchar* reason, gpointer user_data);
typedef struct _Block37Data Block37Data;

#define TOOTLE_WIDGETS_TYPE_STATUS (tootle_widgets_status_get_type ())
#define TOOTLE_WIDGETS_STATUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_WIDGETS_TYPE_STATUS, TootleWidgetsStatus))
#define TOOTLE_WIDGETS_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_WIDGETS_TYPE_STATUS, TootleWidgetsStatusClass))
#define TOOTLE_WIDGETS_IS_STATUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_WIDGETS_TYPE_STATUS))
#define TOOTLE_WIDGETS_IS_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_WIDGETS_TYPE_STATUS))
#define TOOTLE_WIDGETS_STATUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_WIDGETS_TYPE_STATUS, TootleWidgetsStatusClass))

typedef struct _TootleWidgetsStatus TootleWidgetsStatus;
typedef struct _TootleWidgetsStatusClass TootleWidgetsStatusClass;

#define TOOTLE_TYPE_APPLICATION (tootle_application_get_type ())
#define TOOTLE_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_TYPE_APPLICATION, TootleApplication))
#define TOOTLE_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_TYPE_APPLICATION, TootleApplicationClass))
#define TOOTLE_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_TYPE_APPLICATION))
#define TOOTLE_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_TYPE_APPLICATION))
#define TOOTLE_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_TYPE_APPLICATION, TootleApplicationClass))

typedef struct _TootleApplication TootleApplication;
typedef struct _TootleApplicationClass TootleApplicationClass;

struct _TootleViewsBase {
	GtkBox parent_instance;
	TootleViewsBasePrivate * priv;
	HdyHeaderBar* header;
	GtkButton* back_button;
	GtkScrolledWindow* scrolled;
	GtkBox* view;
	HdyClamp* clamp;
	GtkBox* column_view;
	GtkStack* states;
	GtkBox* content_box;
	GtkListBox* content_list;
	GtkButton* status_button;
};

struct _TootleViewsBaseClass {
	GtkBoxClass parent_class;
	void (*build_header) (TootleViewsBase* self);
	void (*clear) (TootleViewsBase* self);
	void (*on_bottom_reached) (TootleViewsBase* self);
	void (*on_shown) (TootleViewsBase* self);
	void (*on_hidden) (TootleViewsBase* self);
	void (*on_content_changed) (TootleViewsBase* self);
	void (*on_error) (TootleViewsBase* self, gint32 code, const gchar* reason);
	void (*on_content_item_activated) (TootleViewsBase* self, GtkListBoxRow* row);
};

struct _TootleIAccountListenerIface {
	GTypeInterface parent_iface;
	void (*on_account_changed) (TootleIAccountListener* self, TootleInstanceAccount* account);
	void (*on_accounts_changed) (TootleIAccountListener* self, GeeArrayList* accounts);
};

struct _TootleIStreamListenerIface {
	GTypeInterface parent_iface;
};

struct _TootleViewsTimeline {
	TootleViewsBase parent_instance;
	TootleViewsTimelinePrivate * priv;
	TootleInstanceAccount* account;
	gulong on_status_added_sigig;
	gchar* stream;
};

struct _TootleViewsTimelineClass {
	TootleViewsBaseClass parent_class;
	gboolean (*is_status_owned) (TootleViewsTimeline* self, TootleAPIStatus* status);
	void (*append) (TootleViewsTimeline* self, GtkWidget* w, gboolean first);
	gchar* (*get_req_url) (TootleViewsTimeline* self);
	TootleRequest* (*append_params) (TootleViewsTimeline* self, TootleRequest* req);
	void (*on_request_finish) (TootleViewsTimeline* self);
	gboolean (*request) (TootleViewsTimeline* self);
	void (*on_refresh) (TootleViewsTimeline* self);
	gchar* (*get_stream_url) (TootleViewsTimeline* self);
	void (*on_account_changed) (TootleViewsTimeline* self, TootleInstanceAccount* acc);
	void (*add_status) (TootleViewsTimeline* self, TootleAPIStatus* status);
	void (*remove_status) (TootleViewsTimeline* self, const gchar* id);
};

struct _TootleViewsTimelinePrivate {
	gchar* _url;
	gboolean _is_public;
	GType _accepts;
	gboolean _is_last_page;
	gchar* _page_next;
	gchar* _page_prev;
};

typedef enum  {
	TOOTLE_OOPSIE_USER,
	TOOTLE_OOPSIE_PARSING,
	TOOTLE_OOPSIE_INSTANCE,
	TOOTLE_OOPSIE_INTERNAL
} TootleOopsie;
#define TOOTLE_OOPSIE tootle_oopsie_quark ()
struct _TootleWidgetizableIface {
	GTypeInterface parent_iface;
	GtkWidget* (*to_widget) (TootleWidgetizable* self, GError** error);
	void (*open) (TootleWidgetizable* self);
	void (*resolve_open) (TootleWidgetizable* self, TootleInstanceAccount* account);
};

struct _Block37Data {
	int _ref_count_;
	TootleViewsTimeline* self;
	gchar* id;
};

static gint TootleViewsTimeline_private_offset;
static gpointer tootle_views_timeline_parent_class = NULL;
extern TootleStreams* tootle_streams;
extern TootleSettings* tootle_settings;
extern gchar* tootle_views_base_STATUS_LOADING;
extern TootleApplication* tootle_app;
static TootleIAccountListenerIface * tootle_views_timeline_tootle_iaccount_listener_parent_iface = NULL;
static TootleIStreamListenerIface * tootle_views_timeline_tootle_istream_listener_parent_iface = NULL;

GType tootle_views_base_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleViewsBase, g_object_unref)
GType tootle_entity_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleEntity, g_object_unref)
GType tootle_api_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleAPIAccount, g_object_unref)
GType tootle_instance_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleInstanceAccount, g_object_unref)
GType tootle_iaccount_listener_get_type (void) G_GNUC_CONST ;
GType tootle_istream_listener_get_type (void) G_GNUC_CONST ;
GType tootle_views_timeline_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleViewsTimeline, g_object_unref)
GType tootle_api_status_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleAPIStatus, g_object_unref)
GType tootle_request_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleRequest, g_object_unref)
gboolean tootle_views_timeline_is_status_owned (TootleViewsTimeline* self,
                                                TootleAPIStatus* status);
void tootle_views_timeline_append (TootleViewsTimeline* self,
                                   GtkWidget* w,
                                   gboolean first);
void tootle_views_base_clear (TootleViewsBase* self);
gchar* tootle_views_timeline_get_req_url (TootleViewsTimeline* self);
TootleRequest* tootle_views_timeline_append_params (TootleViewsTimeline* self,
                                                    TootleRequest* req);
void tootle_views_timeline_on_request_finish (TootleViewsTimeline* self);
gboolean tootle_views_timeline_request (TootleViewsTimeline* self);
void tootle_views_timeline_on_refresh (TootleViewsTimeline* self);
gchar* tootle_views_timeline_get_stream_url (TootleViewsTimeline* self);
void tootle_views_timeline_on_account_changed (TootleViewsTimeline* self,
                                               TootleInstanceAccount* acc);
void tootle_views_base_on_bottom_reached (TootleViewsBase* self);
void tootle_views_timeline_add_status (TootleViewsTimeline* self,
                                       TootleAPIStatus* status);
void tootle_views_timeline_remove_status (TootleViewsTimeline* self,
                                          const gchar* id);
GType tootle_streams_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleStreams, g_object_unref)
void tootle_streams_unsubscribe (TootleStreams* self,
                                 const gchar* cookie,
                                 TootleIStreamListener* s);
static gboolean tootle_views_timeline_real_is_status_owned (TootleViewsTimeline* self,
                                                     TootleAPIStatus* status);
gboolean tootle_api_status_is_owned (TootleAPIStatus* self);
void tootle_views_timeline_prepend (TootleViewsTimeline* self,
                                    GtkWidget* w);
static void tootle_views_timeline_real_append (TootleViewsTimeline* self,
                                        GtkWidget* w,
                                        gboolean first);
static void tootle_views_timeline_real_clear (TootleViewsBase* base);
void tootle_views_timeline_set_page_prev (TootleViewsTimeline* self,
                                          const gchar* value);
void tootle_views_timeline_set_page_next (TootleViewsTimeline* self,
                                          const gchar* value);
void tootle_views_timeline_set_is_last_page (TootleViewsTimeline* self,
                                             gboolean value);
void tootle_views_base_set_needs_attention (TootleViewsBase* self,
                                            gboolean value);
void tootle_views_timeline_get_pages (TootleViewsTimeline* self,
                                      const gchar* header);
const gchar* tootle_views_timeline_get_page_prev (TootleViewsTimeline* self);
const gchar* tootle_views_timeline_get_page_next (TootleViewsTimeline* self);
static gchar* tootle_views_timeline_real_get_req_url (TootleViewsTimeline* self);
const gchar* tootle_views_timeline_get_url (TootleViewsTimeline* self);
static TootleRequest* tootle_views_timeline_real_append_params (TootleViewsTimeline* self,
                                                         TootleRequest* req);
TootleRequest* tootle_request_with_param (TootleRequest* self,
                                          const gchar* name,
                                          const gchar* val);
GType tootle_settings_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleSettings, g_object_unref)
gint tootle_settings_get_timeline_page_size (TootleSettings* self);
static void tootle_views_timeline_real_on_request_finish (TootleViewsTimeline* self);
static gboolean tootle_views_timeline_real_request (TootleViewsTimeline* self);
TootleRequest* tootle_request_new_GET (const gchar* url);
TootleRequest* tootle_request_construct_GET (GType object_type,
                                             const gchar* url);
TootleRequest* tootle_request_with_account (TootleRequest* self,
                                            TootleInstanceAccount* account);
TootleRequest* tootle_request_with_ctx (TootleRequest* self,
                                        GtkWidget* ctx);
TootleRequest* tootle_request_then (TootleRequest* self,
                                    TootleNetworkSuccessCallback cb,
                                    gpointer cb_target,
                                    GDestroyNotify cb_target_destroy_notify);
static void __lambda70_ (TootleViewsTimeline* self,
                  SoupSession* sess,
                  SoupMessage* msg,
                  GError** error);
void tootle_network_parse_array (SoupMessage* msg,
                                 TootleNetworkNodeCallback cb,
                                 gpointer cb_target,
                                 GDestroyNotify cb_target_destroy_notify,
                                 GError** error);
static void __lambda71_ (TootleViewsTimeline* self,
                  JsonNode* node,
                  GError** error);
GQuark tootle_oopsie_quark (void);
TootleEntity* tootle_entity_from_json (GType type,
                                       JsonNode* node,
                                       GError** error);
GType tootle_views_timeline_get_accepts (TootleViewsTimeline* self);
GType tootle_widgetizable_get_type (void) G_GNUC_CONST ;
GtkWidget* tootle_widgetizable_to_widget (TootleWidgetizable* self,
                                          GError** error);
static void ___lambda71__tootle_network_node_callback (JsonNode* node,
                                                SoupMessage* msg,
                                                gpointer self,
                                                GError** error);
void tootle_views_base_on_content_changed (TootleViewsBase* self);
static void ___lambda70__tootle_network_success_callback (SoupSession* session,
                                                   SoupMessage* msg,
                                                   gpointer self,
                                                   GError** error);
TootleRequest* tootle_request_on_error (TootleRequest* self,
                                        TootleNetworkErrorCallback cb,
                                        gpointer cb_target,
                                        GDestroyNotify cb_target_destroy_notify);
void tootle_views_base_on_error (TootleViewsBase* self,
                                 gint32 code,
                                 const gchar* reason);
static void _tootle_views_base_on_error_tootle_network_error_callback (gint32 code,
                                                                const gchar* reason,
                                                                gpointer self);
TootleRequest* tootle_request_exec (TootleRequest* self);
static void tootle_views_timeline_real_on_refresh (TootleViewsTimeline* self);
void tootle_views_base_set_status_message (TootleViewsBase* self,
                                           const gchar* value);
static gboolean _tootle_views_timeline_request_gsource_func (gpointer self);
static gchar* tootle_views_timeline_real_get_stream_url (TootleViewsTimeline* self);
static void tootle_views_timeline_real_on_account_changed (TootleViewsTimeline* self,
                                                    TootleInstanceAccount* acc);
void tootle_views_timeline_reconnect_stream (TootleViewsTimeline* self);
void tootle_streams_subscribe (TootleStreams* self,
                               const gchar* url,
                               TootleIStreamListener* s,
                               gchar* * cookie);
static void tootle_views_timeline_real_on_bottom_reached (TootleViewsBase* base);
gboolean tootle_views_timeline_get_is_last_page (TootleViewsTimeline* self);
static void tootle_views_timeline_real_add_status (TootleViewsTimeline* self,
                                            TootleAPIStatus* status);
gboolean tootle_views_timeline_get_is_public (TootleViewsTimeline* self);
gboolean tootle_settings_get_public_live_updates (TootleSettings* self);
gboolean tootle_settings_get_live_updates (TootleSettings* self);
static void tootle_views_timeline_real_remove_status (TootleViewsTimeline* self,
                                               const gchar* id);
static Block37Data* block37_data_ref (Block37Data* _data37_);
static void block37_data_unref (void * _userdata_);
static void ___lambda72_ (Block37Data* _data37_,
                   GtkWidget* w);
GType tootle_widgets_status_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleWidgetsStatus, g_object_unref)
TootleAPIStatus* tootle_widgets_status_get_status (TootleWidgetsStatus* self);
const gchar* tootle_api_status_get_id (TootleAPIStatus* self);
static void ____lambda72__gfunc (gconstpointer data,
                          gpointer self);
TootleViewsTimeline* tootle_views_timeline_new (void);
TootleViewsTimeline* tootle_views_timeline_construct (GType object_type);
TootleViewsBase* tootle_views_base_new (void);
TootleViewsBase* tootle_views_base_construct (GType object_type);
void tootle_views_timeline_set_url (TootleViewsTimeline* self,
                                    const gchar* value);
void tootle_views_timeline_set_is_public (TootleViewsTimeline* self,
                                          gboolean value);
void tootle_views_timeline_set_accepts (TootleViewsTimeline* self,
                                        GType value);
static GObject * tootle_views_timeline_constructor (GType type,
                                             guint n_construct_properties,
                                             GObjectConstructParam * construct_properties);
GType tootle_application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleApplication, g_object_unref)
static void _tootle_views_timeline_on_refresh_tootle_application_refresh (TootleApplication* _sender,
                                                                   gpointer self);
static void _tootle_views_timeline_on_refresh_gtk_button_clicked (GtkButton* _sender,
                                                           gpointer self);
void tootle_iaccount_listener_account_listener_init (TootleIAccountListener* self);
static void _tootle_views_timeline_add_status_tootle_istream_listener_on_status_added (TootleIStreamListener* _sender,
                                                                                TootleAPIStatus* s,
                                                                                gpointer self);
static void _tootle_views_timeline_remove_status_tootle_istream_listener_on_status_removed (TootleIStreamListener* _sender,
                                                                                     const gchar* id,
                                                                                     gpointer self);
void tootle_iaccount_listener_on_account_changed (TootleIAccountListener* self,
                                                  TootleInstanceAccount* account);
static void tootle_views_timeline_finalize (GObject * obj);
static GType tootle_views_timeline_get_type_once (void);
static void _vala_tootle_views_timeline_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec);
static void _vala_tootle_views_timeline_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gint array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gint array_length,
                       GDestroyNotify destroy_func);
static gint _vala_array_length (gpointer array);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
tootle_views_timeline_get_instance_private (TootleViewsTimeline* self)
{
	return G_STRUCT_MEMBER_P (self, TootleViewsTimeline_private_offset);
}

static gboolean
tootle_views_timeline_real_is_status_owned (TootleViewsTimeline* self,
                                            TootleAPIStatus* status)
{
	gboolean result = FALSE;
	g_return_val_if_fail (status != NULL, FALSE);
	result = tootle_api_status_is_owned (status);
	return result;
}

gboolean
tootle_views_timeline_is_status_owned (TootleViewsTimeline* self,
                                       TootleAPIStatus* status)
{
	TootleViewsTimelineClass* _klass_;
	g_return_val_if_fail (self != NULL, FALSE);
	_klass_ = TOOTLE_VIEWS_TIMELINE_GET_CLASS (self);
	if (_klass_->is_status_owned) {
		return _klass_->is_status_owned (self, status);
	}
	return FALSE;
}

void
tootle_views_timeline_prepend (TootleViewsTimeline* self,
                               GtkWidget* w)
{
	g_return_if_fail (self != NULL);
	tootle_views_timeline_append (self, w, TRUE);
}

static void
tootle_views_timeline_real_append (TootleViewsTimeline* self,
                                   GtkWidget* w,
                                   gboolean first)
{
	if (w == NULL) {
		g_warning ("Timeline.vala:40: Attempted to add an empty widget");
		return;
	}
	if (first) {
		GtkListBox* _tmp0_;
		_tmp0_ = ((TootleViewsBase*) self)->content_list;
		gtk_list_box_prepend (_tmp0_, w);
	} else {
		GtkListBox* _tmp1_;
		_tmp1_ = ((TootleViewsBase*) self)->content_list;
		gtk_list_box_insert (_tmp1_, w, -1);
	}
}

void
tootle_views_timeline_append (TootleViewsTimeline* self,
                              GtkWidget* w,
                              gboolean first)
{
	TootleViewsTimelineClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = TOOTLE_VIEWS_TIMELINE_GET_CLASS (self);
	if (_klass_->append) {
		_klass_->append (self, w, first);
	}
}

static void
tootle_views_timeline_real_clear (TootleViewsBase* base)
{
	TootleViewsTimeline * self;
	self = (TootleViewsTimeline*) base;
	tootle_views_timeline_set_page_prev (self, NULL);
	tootle_views_timeline_set_page_next (self, NULL);
	tootle_views_timeline_set_is_last_page (self, FALSE);
	tootle_views_base_set_needs_attention ((TootleViewsBase*) self, FALSE);
	TOOTLE_VIEWS_BASE_CLASS (tootle_views_timeline_parent_class)->clear (G_TYPE_CHECK_INSTANCE_CAST (self, TOOTLE_VIEWS_TYPE_BASE, TootleViewsBase));
}

static gchar*
string_replace (const gchar* self,
                const gchar* old,
                const gchar* replacement)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GError* _inner_error0_ = NULL;
	gchar* result = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (old != NULL, NULL);
	g_return_val_if_fail (replacement != NULL, NULL);
	if ((*((gchar*) self)) == '\0') {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = (*((gchar*) old)) == '\0';
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = g_strcmp0 (old, replacement) == 0;
	}
	if (_tmp0_) {
		gchar* _tmp2_;
		_tmp2_ = g_strdup (self);
		result = _tmp2_;
		return result;
	}
	{
		GRegex* regex = NULL;
		gchar* _tmp3_;
		gchar* _tmp4_;
		GRegex* _tmp5_;
		GRegex* _tmp6_;
		gchar* _tmp7_ = NULL;
		GRegex* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		_tmp3_ = g_regex_escape_string (old, -1);
		_tmp4_ = _tmp3_;
		_tmp5_ = g_regex_new (_tmp4_, 0, 0, &_inner_error0_);
		_tmp6_ = _tmp5_;
		_g_free0 (_tmp4_);
		regex = _tmp6_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp8_ = regex;
		_tmp9_ = g_regex_replace_literal (_tmp8_, self, (gssize) -1, 0, replacement, 0, &_inner_error0_);
		_tmp7_ = _tmp9_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_regex_unref0 (regex);
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp10_ = _tmp7_;
		_tmp7_ = NULL;
		result = _tmp10_;
		_g_free0 (_tmp7_);
		_g_regex_unref0 (regex);
		return result;
	}
	goto __finally0;
	__catch0_g_regex_error:
	{
		g_clear_error (&_inner_error0_);
		g_assert_not_reached ();
	}
	__finally0:
	g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
	g_clear_error (&_inner_error0_);
	return NULL;
}

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

void
tootle_views_timeline_get_pages (TootleViewsTimeline* self,
                                 const gchar* header)
{
	gchar** pages = NULL;
	gchar** _tmp0_;
	gchar** _tmp1_;
	gint pages_length1;
	gint _pages_size_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	const gchar* _tmp18_;
	const gchar* _tmp19_;
	g_return_if_fail (self != NULL);
	tootle_views_timeline_set_page_prev (self, NULL);
	tootle_views_timeline_set_page_next (self, NULL);
	if (header == NULL) {
		return;
	}
	_tmp1_ = _tmp0_ = g_strsplit (header, ",", 0);
	pages = _tmp1_;
	pages_length1 = _vala_array_length (_tmp0_);
	_pages_size_ = pages_length1;
	_tmp2_ = pages;
	_tmp2__length1 = pages_length1;
	{
		gchar** page_collection = NULL;
		gint page_collection_length1 = 0;
		gint _page_collection_size_ = 0;
		gint page_it = 0;
		page_collection = _tmp2_;
		page_collection_length1 = _tmp2__length1;
		for (page_it = 0; page_it < page_collection_length1; page_it = page_it + 1) {
			gchar* _tmp3_;
			gchar* page = NULL;
			_tmp3_ = g_strdup (page_collection[page_it]);
			page = _tmp3_;
			{
				gchar* sanitized = NULL;
				const gchar* _tmp4_;
				gchar* _tmp5_;
				gchar* _tmp6_;
				gchar* _tmp7_;
				gchar* _tmp8_;
				gchar** _tmp9_;
				gchar** _tmp10_;
				gchar** _tmp11_;
				gint _tmp11__length1;
				const gchar* _tmp12_;
				gchar* _tmp13_;
				gchar* _tmp14_;
				const gchar* _tmp15_;
				_tmp4_ = page;
				_tmp5_ = string_replace (_tmp4_, "<", "");
				_tmp6_ = _tmp5_;
				_tmp7_ = string_replace (_tmp6_, ">", "");
				_tmp8_ = _tmp7_;
				_tmp10_ = _tmp9_ = g_strsplit (_tmp8_, ";", 0);
				_tmp11_ = _tmp10_;
				_tmp11__length1 = _vala_array_length (_tmp9_);
				_tmp12_ = _tmp11_[0];
				_tmp13_ = g_strdup (_tmp12_);
				_tmp14_ = _tmp13_;
				_tmp11_ = (_vala_array_free (_tmp11_, _tmp11__length1, (GDestroyNotify) g_free), NULL);
				_g_free0 (_tmp8_);
				_g_free0 (_tmp6_);
				sanitized = _tmp14_;
				_tmp15_ = page;
				if (string_contains (_tmp15_, "rel=\"prev\"")) {
					const gchar* _tmp16_;
					_tmp16_ = sanitized;
					tootle_views_timeline_set_page_prev (self, _tmp16_);
				} else {
					const gchar* _tmp17_;
					_tmp17_ = sanitized;
					tootle_views_timeline_set_page_next (self, _tmp17_);
				}
				_g_free0 (sanitized);
				_g_free0 (page);
			}
		}
	}
	_tmp18_ = self->priv->_page_prev;
	_tmp19_ = self->priv->_page_next;
	tootle_views_timeline_set_is_last_page (self, (_tmp18_ != NULL) & (_tmp19_ == NULL));
	pages = (_vala_array_free (pages, pages_length1, (GDestroyNotify) g_free), NULL);
}

static gchar*
tootle_views_timeline_real_get_req_url (TootleViewsTimeline* self)
{
	const gchar* _tmp0_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* result = NULL;
	_tmp0_ = self->priv->_page_next;
	if (_tmp0_ != NULL) {
		const gchar* _tmp1_;
		gchar* _tmp2_;
		_tmp1_ = self->priv->_page_next;
		_tmp2_ = g_strdup (_tmp1_);
		result = _tmp2_;
		return result;
	}
	_tmp3_ = self->priv->_url;
	_tmp4_ = g_strdup (_tmp3_);
	result = _tmp4_;
	return result;
}

gchar*
tootle_views_timeline_get_req_url (TootleViewsTimeline* self)
{
	TootleViewsTimelineClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = TOOTLE_VIEWS_TIMELINE_GET_CLASS (self);
	if (_klass_->get_req_url) {
		return _klass_->get_req_url (self);
	}
	return NULL;
}

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

static TootleRequest*
tootle_views_timeline_real_append_params (TootleViewsTimeline* self,
                                          TootleRequest* req)
{
	const gchar* _tmp0_;
	TootleRequest* result = NULL;
	g_return_val_if_fail (req != NULL, NULL);
	_tmp0_ = self->priv->_page_next;
	if (_tmp0_ == NULL) {
		TootleSettings* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		TootleRequest* _tmp6_;
		TootleRequest* _tmp7_;
		_tmp1_ = tootle_settings;
		_tmp2_ = tootle_settings_get_timeline_page_size (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = g_strdup_printf ("%i", _tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = tootle_request_with_param (req, "limit", _tmp5_);
		_tmp7_ = _tmp6_;
		_g_free0 (_tmp5_);
		result = _tmp7_;
		return result;
	} else {
		TootleRequest* _tmp8_;
		_tmp8_ = _g_object_ref0 (req);
		result = _tmp8_;
		return result;
	}
}

TootleRequest*
tootle_views_timeline_append_params (TootleViewsTimeline* self,
                                     TootleRequest* req)
{
	TootleViewsTimelineClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = TOOTLE_VIEWS_TIMELINE_GET_CLASS (self);
	if (_klass_->append_params) {
		return _klass_->append_params (self, req);
	}
	return NULL;
}

static void
tootle_views_timeline_real_on_request_finish (TootleViewsTimeline* self)
{
}

void
tootle_views_timeline_on_request_finish (TootleViewsTimeline* self)
{
	TootleViewsTimelineClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = TOOTLE_VIEWS_TIMELINE_GET_CLASS (self);
	if (_klass_->on_request_finish) {
		_klass_->on_request_finish (self);
	}
}

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

static void
__lambda71_ (TootleViewsTimeline* self,
             JsonNode* node,
             GError** error)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (node != NULL);
	{
		TootleEntity* e = NULL;
		GType _tmp0_;
		TootleEntity* _tmp1_;
		TootleWidgetizable* w = NULL;
		TootleEntity* _tmp2_;
		TootleWidgetizable* _tmp3_;
		GtkWidget* _tmp4_ = NULL;
		TootleWidgetizable* _tmp5_;
		GtkWidget* _tmp6_;
		_tmp0_ = self->priv->_accepts;
		_tmp1_ = tootle_entity_from_json (_tmp0_, node, &_inner_error0_);
		e = _tmp1_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp2_ = e;
		_tmp3_ = _g_object_ref0 (TOOTLE_IS_WIDGETIZABLE (_tmp2_) ? ((TootleWidgetizable*) _tmp2_) : NULL);
		w = _tmp3_;
		_tmp5_ = w;
		_tmp6_ = tootle_widgetizable_to_widget (_tmp5_, &_inner_error0_);
		_tmp4_ = _tmp6_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (w);
			_g_object_unref0 (e);
			goto __catch0_g_error;
		}
		tootle_views_timeline_append (self, _tmp4_, FALSE);
		_g_object_unref0 (_tmp4_);
		_g_object_unref0 (w);
		_g_object_unref0 (e);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp7_;
		const gchar* _tmp8_;
		const gchar* _tmp9_;
		gchar* _tmp10_;
		gchar* _tmp11_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp7_ = e;
		_tmp8_ = _tmp7_->message;
		_tmp9_ = string_to_string (_tmp8_);
		_tmp10_ = g_strconcat ("Timeline item parse error: ", _tmp9_, NULL);
		_tmp11_ = _tmp10_;
		g_warning ("Timeline.vala:106: %s", _tmp11_);
		_g_free0 (_tmp11_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
}

static void
___lambda71__tootle_network_node_callback (JsonNode* node,
                                           SoupMessage* msg,
                                           gpointer self,
                                           GError** error)
{
	__lambda71_ ((TootleViewsTimeline*) self, node, error);
}

static void
__lambda70_ (TootleViewsTimeline* self,
             SoupSession* sess,
             SoupMessage* msg,
             GError** error)
{
	SoupMessageHeaders* _tmp0_;
	const gchar* _tmp1_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (sess != NULL);
	g_return_if_fail (msg != NULL);
	tootle_network_parse_array (msg, ___lambda71__tootle_network_node_callback, g_object_ref (self), g_object_unref, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	_tmp0_ = msg->response_headers;
	_tmp1_ = soup_message_headers_get_one (_tmp0_, "Link");
	tootle_views_timeline_get_pages (self, _tmp1_);
	tootle_views_base_on_content_changed ((TootleViewsBase*) self);
	tootle_views_timeline_on_request_finish (self);
}

static void
___lambda70__tootle_network_success_callback (SoupSession* session,
                                              SoupMessage* msg,
                                              gpointer self,
                                              GError** error)
{
	__lambda70_ ((TootleViewsTimeline*) self, session, msg, error);
}

static void
_tootle_views_base_on_error_tootle_network_error_callback (gint32 code,
                                                           const gchar* reason,
                                                           gpointer self)
{
	tootle_views_base_on_error ((TootleViewsBase*) self, code, reason);
}

static gboolean
tootle_views_timeline_real_request (TootleViewsTimeline* self)
{
	TootleRequest* req = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	TootleRequest* _tmp2_;
	TootleRequest* _tmp3_;
	TootleRequest* _tmp4_;
	TootleRequest* _tmp5_;
	TootleInstanceAccount* _tmp6_;
	TootleRequest* _tmp7_;
	TootleRequest* _tmp8_;
	TootleRequest* _tmp9_;
	TootleRequest* _tmp10_;
	TootleRequest* _tmp11_;
	TootleRequest* _tmp12_;
	TootleRequest* _tmp13_;
	TootleRequest* _tmp14_;
	TootleRequest* _tmp15_;
	TootleRequest* _tmp16_;
	gboolean result = FALSE;
	_tmp0_ = tootle_views_timeline_get_req_url (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = tootle_request_new_GET (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = tootle_views_timeline_append_params (self, _tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = self->account;
	_tmp7_ = tootle_request_with_account (_tmp5_, _tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = tootle_request_with_ctx (_tmp8_, (GtkWidget*) self);
	_tmp10_ = _tmp9_;
	_tmp11_ = tootle_request_then (_tmp10_, ___lambda70__tootle_network_success_callback, g_object_ref (self), g_object_unref);
	_tmp12_ = _tmp11_;
	_tmp13_ = tootle_request_on_error (_tmp12_, _tootle_views_base_on_error_tootle_network_error_callback, g_object_ref ((TootleViewsBase*) self), g_object_unref);
	_tmp14_ = _tmp13_;
	_g_object_unref0 (_tmp12_);
	_g_object_unref0 (_tmp10_);
	_g_object_unref0 (_tmp8_);
	_g_object_unref0 (_tmp5_);
	_g_object_unref0 (_tmp3_);
	_g_free0 (_tmp1_);
	req = _tmp14_;
	_tmp15_ = tootle_request_exec (req);
	_tmp16_ = _tmp15_;
	_g_object_unref0 (_tmp16_);
	result = G_SOURCE_REMOVE;
	_g_object_unref0 (req);
	return result;
}

gboolean
tootle_views_timeline_request (TootleViewsTimeline* self)
{
	TootleViewsTimelineClass* _klass_;
	g_return_val_if_fail (self != NULL, FALSE);
	_klass_ = TOOTLE_VIEWS_TIMELINE_GET_CLASS (self);
	if (_klass_->request) {
		return _klass_->request (self);
	}
	return FALSE;
}

static gboolean
_tootle_views_timeline_request_gsource_func (gpointer self)
{
	gboolean result;
	result = tootle_views_timeline_request ((TootleViewsTimeline*) self);
	return result;
}

static void
tootle_views_timeline_real_on_refresh (TootleViewsTimeline* self)
{
	GtkScrolledWindow* _tmp0_;
	GtkAdjustment* _tmp1_;
	GtkAdjustment* _tmp2_;
	GtkButton* _tmp3_;
	const gchar* _tmp4_;
	_tmp0_ = ((TootleViewsBase*) self)->scrolled;
	_tmp1_ = gtk_scrolled_window_get_vadjustment (_tmp0_);
	_tmp2_ = _tmp1_;
	gtk_adjustment_set_value (_tmp2_, (gdouble) 0);
	_tmp3_ = ((TootleViewsBase*) self)->status_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp3_, FALSE);
	tootle_views_base_clear ((TootleViewsBase*) self);
	_tmp4_ = tootle_views_base_STATUS_LOADING;
	tootle_views_base_set_status_message ((TootleViewsBase*) self, _tmp4_);
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _tootle_views_timeline_request_gsource_func, g_object_ref (self), g_object_unref);
}

void
tootle_views_timeline_on_refresh (TootleViewsTimeline* self)
{
	TootleViewsTimelineClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = TOOTLE_VIEWS_TIMELINE_GET_CLASS (self);
	if (_klass_->on_refresh) {
		_klass_->on_refresh (self);
	}
}

static gchar*
tootle_views_timeline_real_get_stream_url (TootleViewsTimeline* self)
{
	gchar* result = NULL;
	result = NULL;
	return result;
}

gchar*
tootle_views_timeline_get_stream_url (TootleViewsTimeline* self)
{
	TootleViewsTimelineClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = TOOTLE_VIEWS_TIMELINE_GET_CLASS (self);
	if (_klass_->get_stream_url) {
		return _klass_->get_stream_url (self);
	}
	return NULL;
}

static void
tootle_views_timeline_real_on_account_changed (TootleViewsTimeline* self,
                                               TootleInstanceAccount* acc)
{
	TootleInstanceAccount* _tmp0_;
	_tmp0_ = _g_object_ref0 (acc);
	_g_object_unref0 (self->account);
	self->account = _tmp0_;
	tootle_views_timeline_reconnect_stream (self);
	tootle_views_timeline_on_refresh (self);
}

void
tootle_views_timeline_on_account_changed (TootleViewsTimeline* self,
                                          TootleInstanceAccount* acc)
{
	TootleViewsTimelineClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = TOOTLE_VIEWS_TIMELINE_GET_CLASS (self);
	if (_klass_->on_account_changed) {
		_klass_->on_account_changed (self, acc);
	}
}

void
tootle_views_timeline_reconnect_stream (TootleViewsTimeline* self)
{
	TootleStreams* _tmp0_;
	const gchar* _tmp1_;
	TootleStreams* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = tootle_streams;
	_tmp1_ = self->stream;
	tootle_streams_unsubscribe (_tmp0_, _tmp1_, (TootleIStreamListener*) self);
	_tmp2_ = tootle_streams;
	_tmp3_ = tootle_views_timeline_get_stream_url (self);
	_tmp4_ = _tmp3_;
	tootle_streams_subscribe (_tmp2_, _tmp4_, (TootleIStreamListener*) self, &_tmp5_);
	_g_free0 (self->stream);
	self->stream = _tmp5_;
	_g_free0 (_tmp4_);
}

static void
tootle_views_timeline_real_on_bottom_reached (TootleViewsBase* base)
{
	TootleViewsTimeline * self;
	gboolean _tmp0_;
	self = (TootleViewsTimeline*) base;
	_tmp0_ = self->priv->_is_last_page;
	if (_tmp0_) {
		g_info ("Timeline.vala:145: Last page reached");
		return;
	}
	tootle_views_timeline_request (self);
}

static void
tootle_views_timeline_real_add_status (TootleViewsTimeline* self,
                                       TootleAPIStatus* status)
{
	gboolean allow_update = FALSE;
	gboolean _tmp0_;
	gboolean _tmp4_ = FALSE;
	TootleSettings* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (status != NULL);
	allow_update = TRUE;
	_tmp0_ = self->priv->_is_public;
	if (_tmp0_) {
		TootleSettings* _tmp1_;
		gboolean _tmp2_;
		gboolean _tmp3_;
		_tmp1_ = tootle_settings;
		_tmp2_ = tootle_settings_get_public_live_updates (_tmp1_);
		_tmp3_ = _tmp2_;
		allow_update = _tmp3_;
	}
	_tmp5_ = tootle_settings;
	_tmp6_ = tootle_settings_get_live_updates (_tmp5_);
	_tmp7_ = _tmp6_;
	if (_tmp7_) {
		_tmp4_ = allow_update;
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		GtkWidget* _tmp8_ = NULL;
		GtkWidget* _tmp9_;
		_tmp9_ = tootle_widgetizable_to_widget ((TootleWidgetizable*) status, &_inner_error0_);
		_tmp8_ = _tmp9_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
		tootle_views_timeline_prepend (self, _tmp8_);
		_g_object_unref0 (_tmp8_);
	}
}

void
tootle_views_timeline_add_status (TootleViewsTimeline* self,
                                  TootleAPIStatus* status)
{
	TootleViewsTimelineClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = TOOTLE_VIEWS_TIMELINE_GET_CLASS (self);
	if (_klass_->add_status) {
		_klass_->add_status (self, status);
	}
}

static Block37Data*
block37_data_ref (Block37Data* _data37_)
{
	g_atomic_int_inc (&_data37_->_ref_count_);
	return _data37_;
}

static void
block37_data_unref (void * _userdata_)
{
	Block37Data* _data37_;
	_data37_ = (Block37Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data37_->_ref_count_)) {
		TootleViewsTimeline* self;
		self = _data37_->self;
		_g_free0 (_data37_->id);
		_g_object_unref0 (self);
		g_slice_free (Block37Data, _data37_);
	}
}

static void
___lambda72_ (Block37Data* _data37_,
              GtkWidget* w)
{
	TootleViewsTimeline* self;
	TootleWidgetsStatus* sw = NULL;
	TootleWidgetsStatus* _tmp0_;
	gboolean _tmp1_ = FALSE;
	TootleWidgetsStatus* _tmp2_;
	self = _data37_->self;
	g_return_if_fail (w != NULL);
	_tmp0_ = _g_object_ref0 (TOOTLE_WIDGETS_IS_STATUS (w) ? ((TootleWidgetsStatus*) w) : NULL);
	sw = _tmp0_;
	_tmp2_ = sw;
	if (_tmp2_ != NULL) {
		TootleWidgetsStatus* _tmp3_;
		TootleAPIStatus* _tmp4_;
		TootleAPIStatus* _tmp5_;
		const gchar* _tmp6_;
		const gchar* _tmp7_;
		_tmp3_ = sw;
		_tmp4_ = tootle_widgets_status_get_status (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = tootle_api_status_get_id (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp1_ = g_strcmp0 (_tmp7_, _data37_->id) == 0;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		TootleWidgetsStatus* _tmp8_;
		_tmp8_ = sw;
		gtk_widget_destroy ((GtkWidget*) _tmp8_);
	}
	_g_object_unref0 (sw);
}

static void
____lambda72__gfunc (gconstpointer data,
                     gpointer self)
{
	___lambda72_ (self, (GtkWidget*) data);
}

static void
tootle_views_timeline_real_remove_status (TootleViewsTimeline* self,
                                          const gchar* id)
{
	Block37Data* _data37_;
	gchar* _tmp0_;
	TootleSettings* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	g_return_if_fail (id != NULL);
	_data37_ = g_slice_new0 (Block37Data);
	_data37_->_ref_count_ = 1;
	_data37_->self = g_object_ref (self);
	_tmp0_ = g_strdup (id);
	_g_free0 (_data37_->id);
	_data37_->id = _tmp0_;
	_tmp1_ = tootle_settings;
	_tmp2_ = tootle_settings_get_live_updates (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_) {
		GtkListBox* _tmp4_;
		GList* _tmp5_;
		GList* _tmp6_;
		_tmp4_ = ((TootleViewsBase*) self)->content_list;
		_tmp5_ = gtk_container_get_children ((GtkContainer*) _tmp4_);
		_tmp6_ = _tmp5_;
		g_list_foreach (_tmp6_, ____lambda72__gfunc, _data37_);
		(_tmp6_ == NULL) ? NULL : (_tmp6_ = (g_list_free (_tmp6_), NULL));
	}
	block37_data_unref (_data37_);
	_data37_ = NULL;
}

void
tootle_views_timeline_remove_status (TootleViewsTimeline* self,
                                     const gchar* id)
{
	TootleViewsTimelineClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = TOOTLE_VIEWS_TIMELINE_GET_CLASS (self);
	if (_klass_->remove_status) {
		_klass_->remove_status (self, id);
	}
}

TootleViewsTimeline*
tootle_views_timeline_construct (GType object_type)
{
	TootleViewsTimeline * self = NULL;
	self = (TootleViewsTimeline*) tootle_views_base_construct (object_type);
	return self;
}

TootleViewsTimeline*
tootle_views_timeline_new (void)
{
	return tootle_views_timeline_construct (TOOTLE_VIEWS_TYPE_TIMELINE);
}

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

void
tootle_views_timeline_set_url (TootleViewsTimeline* self,
                               const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tootle_views_timeline_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, tootle_views_timeline_properties[TOOTLE_VIEWS_TIMELINE_URL_PROPERTY]);
	}
}

gboolean
tootle_views_timeline_get_is_public (TootleViewsTimeline* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_public;
	return result;
}

void
tootle_views_timeline_set_is_public (TootleViewsTimeline* self,
                                     gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = tootle_views_timeline_get_is_public (self);
	if (old_value != value) {
		self->priv->_is_public = value;
		g_object_notify_by_pspec ((GObject *) self, tootle_views_timeline_properties[TOOTLE_VIEWS_TIMELINE_IS_PUBLIC_PROPERTY]);
	}
}

GType
tootle_views_timeline_get_accepts (TootleViewsTimeline* self)
{
	GType result;
	g_return_val_if_fail (self != NULL, 0UL);
	result = self->priv->_accepts;
	return result;
}

void
tootle_views_timeline_set_accepts (TootleViewsTimeline* self,
                                   GType value)
{
	GType old_value;
	g_return_if_fail (self != NULL);
	old_value = tootle_views_timeline_get_accepts (self);
	if (old_value != value) {
		self->priv->_accepts = value;
		g_object_notify_by_pspec ((GObject *) self, tootle_views_timeline_properties[TOOTLE_VIEWS_TIMELINE_ACCEPTS_PROPERTY]);
	}
}

gboolean
tootle_views_timeline_get_is_last_page (TootleViewsTimeline* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_last_page;
	return result;
}

void
tootle_views_timeline_set_is_last_page (TootleViewsTimeline* self,
                                        gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = tootle_views_timeline_get_is_last_page (self);
	if (old_value != value) {
		self->priv->_is_last_page = value;
		g_object_notify_by_pspec ((GObject *) self, tootle_views_timeline_properties[TOOTLE_VIEWS_TIMELINE_IS_LAST_PAGE_PROPERTY]);
	}
}

const gchar*
tootle_views_timeline_get_page_next (TootleViewsTimeline* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_page_next;
	result = _tmp0_;
	return result;
}

void
tootle_views_timeline_set_page_next (TootleViewsTimeline* self,
                                     const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tootle_views_timeline_get_page_next (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_page_next);
		self->priv->_page_next = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tootle_views_timeline_properties[TOOTLE_VIEWS_TIMELINE_PAGE_NEXT_PROPERTY]);
	}
}

const gchar*
tootle_views_timeline_get_page_prev (TootleViewsTimeline* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_page_prev;
	result = _tmp0_;
	return result;
}

void
tootle_views_timeline_set_page_prev (TootleViewsTimeline* self,
                                     const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tootle_views_timeline_get_page_prev (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_page_prev);
		self->priv->_page_prev = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tootle_views_timeline_properties[TOOTLE_VIEWS_TIMELINE_PAGE_PREV_PROPERTY]);
	}
}

static void
_tootle_views_timeline_on_refresh_tootle_application_refresh (TootleApplication* _sender,
                                                              gpointer self)
{
	tootle_views_timeline_on_refresh ((TootleViewsTimeline*) self);
}

static void
_tootle_views_timeline_on_refresh_gtk_button_clicked (GtkButton* _sender,
                                                      gpointer self)
{
	tootle_views_timeline_on_refresh ((TootleViewsTimeline*) self);
}

static void
_tootle_views_timeline_add_status_tootle_istream_listener_on_status_added (TootleIStreamListener* _sender,
                                                                           TootleAPIStatus* s,
                                                                           gpointer self)
{
	tootle_views_timeline_add_status ((TootleViewsTimeline*) self, s);
}

static void
_tootle_views_timeline_remove_status_tootle_istream_listener_on_status_removed (TootleIStreamListener* _sender,
                                                                                const gchar* id,
                                                                                gpointer self)
{
	tootle_views_timeline_remove_status ((TootleViewsTimeline*) self, id);
}

static GObject *
tootle_views_timeline_constructor (GType type,
                                   guint n_construct_properties,
                                   GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	TootleViewsTimeline * self;
	TootleApplication* _tmp0_;
	GtkButton* _tmp1_;
	gulong _tmp2_;
	parent_class = G_OBJECT_CLASS (tootle_views_timeline_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TOOTLE_VIEWS_TYPE_TIMELINE, TootleViewsTimeline);
	_tmp0_ = tootle_app;
	g_signal_connect_object (_tmp0_, "refresh", (GCallback) _tootle_views_timeline_on_refresh_tootle_application_refresh, self, 0);
	_tmp1_ = ((TootleViewsBase*) self)->status_button;
	g_signal_connect_object (_tmp1_, "clicked", (GCallback) _tootle_views_timeline_on_refresh_gtk_button_clicked, self, 0);
	tootle_iaccount_listener_account_listener_init ((TootleIAccountListener*) self);
	_tmp2_ = g_signal_connect_object ((TootleIStreamListener*) self, "on-status-added", (GCallback) _tootle_views_timeline_add_status_tootle_istream_listener_on_status_added, self, 0);
	self->on_status_added_sigig = _tmp2_;
	g_signal_connect_object ((TootleIStreamListener*) self, "on-status-removed", (GCallback) _tootle_views_timeline_remove_status_tootle_istream_listener_on_status_removed, self, 0);
	return obj;
}

static void
tootle_views_timeline_class_init (TootleViewsTimelineClass * klass,
                                  gpointer klass_data)
{
	tootle_views_timeline_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TootleViewsTimeline_private_offset);
	((TootleViewsTimelineClass *) klass)->is_status_owned = (gboolean (*) (TootleViewsTimeline*, TootleAPIStatus*)) tootle_views_timeline_real_is_status_owned;
	((TootleViewsTimelineClass *) klass)->append = (void (*) (TootleViewsTimeline*, GtkWidget*, gboolean)) tootle_views_timeline_real_append;
	((TootleViewsBaseClass *) klass)->clear = (void (*) (TootleViewsBase*)) tootle_views_timeline_real_clear;
	((TootleViewsTimelineClass *) klass)->get_req_url = (gchar* (*) (TootleViewsTimeline*)) tootle_views_timeline_real_get_req_url;
	((TootleViewsTimelineClass *) klass)->append_params = (TootleRequest* (*) (TootleViewsTimeline*, TootleRequest*)) tootle_views_timeline_real_append_params;
	((TootleViewsTimelineClass *) klass)->on_request_finish = (void (*) (TootleViewsTimeline*)) tootle_views_timeline_real_on_request_finish;
	((TootleViewsTimelineClass *) klass)->request = (gboolean (*) (TootleViewsTimeline*)) tootle_views_timeline_real_request;
	((TootleViewsTimelineClass *) klass)->on_refresh = (void (*) (TootleViewsTimeline*)) tootle_views_timeline_real_on_refresh;
	((TootleViewsTimelineClass *) klass)->get_stream_url = (gchar* (*) (TootleViewsTimeline*)) tootle_views_timeline_real_get_stream_url;
	((TootleViewsTimelineClass *) klass)->on_account_changed = (void (*) (TootleViewsTimeline*, TootleInstanceAccount*)) tootle_views_timeline_real_on_account_changed;
	((TootleViewsBaseClass *) klass)->on_bottom_reached = (void (*) (TootleViewsBase*)) tootle_views_timeline_real_on_bottom_reached;
	((TootleViewsTimelineClass *) klass)->add_status = (void (*) (TootleViewsTimeline*, TootleAPIStatus*)) tootle_views_timeline_real_add_status;
	((TootleViewsTimelineClass *) klass)->remove_status = (void (*) (TootleViewsTimeline*, const gchar*)) tootle_views_timeline_real_remove_status;
	G_OBJECT_CLASS (klass)->get_property = _vala_tootle_views_timeline_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tootle_views_timeline_set_property;
	G_OBJECT_CLASS (klass)->constructor = tootle_views_timeline_constructor;
	G_OBJECT_CLASS (klass)->finalize = tootle_views_timeline_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_VIEWS_TIMELINE_URL_PROPERTY, tootle_views_timeline_properties[TOOTLE_VIEWS_TIMELINE_URL_PROPERTY] = g_param_spec_string ("url", "url", "url", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_VIEWS_TIMELINE_IS_PUBLIC_PROPERTY, tootle_views_timeline_properties[TOOTLE_VIEWS_TIMELINE_IS_PUBLIC_PROPERTY] = g_param_spec_boolean ("is-public", "is-public", "is-public", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_VIEWS_TIMELINE_ACCEPTS_PROPERTY, tootle_views_timeline_properties[TOOTLE_VIEWS_TIMELINE_ACCEPTS_PROPERTY] = g_param_spec_gtype ("accepts", "accepts", "accepts", TOOTLE_API_TYPE_STATUS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_VIEWS_TIMELINE_IS_LAST_PAGE_PROPERTY, tootle_views_timeline_properties[TOOTLE_VIEWS_TIMELINE_IS_LAST_PAGE_PROPERTY] = g_param_spec_boolean ("is-last-page", "is-last-page", "is-last-page", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_VIEWS_TIMELINE_PAGE_NEXT_PROPERTY, tootle_views_timeline_properties[TOOTLE_VIEWS_TIMELINE_PAGE_NEXT_PROPERTY] = g_param_spec_string ("page-next", "page-next", "page-next", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_VIEWS_TIMELINE_PAGE_PREV_PROPERTY, tootle_views_timeline_properties[TOOTLE_VIEWS_TIMELINE_PAGE_PREV_PROPERTY] = g_param_spec_string ("page-prev", "page-prev", "page-prev", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
tootle_views_timeline_tootle_iaccount_listener_interface_init (TootleIAccountListenerIface * iface,
                                                               gpointer iface_data)
{
	tootle_views_timeline_tootle_iaccount_listener_parent_iface = g_type_interface_peek_parent (iface);
	iface->on_account_changed = (void (*) (TootleIAccountListener*, TootleInstanceAccount*)) tootle_views_timeline_on_account_changed;
}

static void
tootle_views_timeline_tootle_istream_listener_interface_init (TootleIStreamListenerIface * iface,
                                                              gpointer iface_data)
{
	tootle_views_timeline_tootle_istream_listener_parent_iface = g_type_interface_peek_parent (iface);
}

static void
tootle_views_timeline_instance_init (TootleViewsTimeline * self,
                                     gpointer klass)
{
	self->priv = tootle_views_timeline_get_instance_private (self);
	self->priv->_is_public = FALSE;
	self->priv->_accepts = TOOTLE_API_TYPE_STATUS;
	self->account = NULL;
	self->priv->_is_last_page = FALSE;
	self->stream = NULL;
}

static void
tootle_views_timeline_finalize (GObject * obj)
{
	TootleViewsTimeline * self;
	TootleStreams* _tmp0_;
	const gchar* _tmp1_;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TOOTLE_VIEWS_TYPE_TIMELINE, TootleViewsTimeline);
	_tmp0_ = tootle_streams;
	_tmp1_ = self->stream;
	tootle_streams_unsubscribe (_tmp0_, _tmp1_, (TootleIStreamListener*) self);
	_g_free0 (self->priv->_url);
	_g_object_unref0 (self->account);
	_g_free0 (self->priv->_page_next);
	_g_free0 (self->priv->_page_prev);
	_g_free0 (self->stream);
	G_OBJECT_CLASS (tootle_views_timeline_parent_class)->finalize (obj);
}

static GType
tootle_views_timeline_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TootleViewsTimelineClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tootle_views_timeline_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TootleViewsTimeline), 0, (GInstanceInitFunc) tootle_views_timeline_instance_init, NULL };
	static const GInterfaceInfo tootle_iaccount_listener_info = { (GInterfaceInitFunc) tootle_views_timeline_tootle_iaccount_listener_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo tootle_istream_listener_info = { (GInterfaceInitFunc) tootle_views_timeline_tootle_istream_listener_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType tootle_views_timeline_type_id;
	tootle_views_timeline_type_id = g_type_register_static (TOOTLE_VIEWS_TYPE_BASE, "TootleViewsTimeline", &g_define_type_info, 0);
	g_type_add_interface_static (tootle_views_timeline_type_id, TOOTLE_TYPE_IACCOUNT_LISTENER, &tootle_iaccount_listener_info);
	g_type_add_interface_static (tootle_views_timeline_type_id, TOOTLE_TYPE_ISTREAM_LISTENER, &tootle_istream_listener_info);
	TootleViewsTimeline_private_offset = g_type_add_instance_private (tootle_views_timeline_type_id, sizeof (TootleViewsTimelinePrivate));
	return tootle_views_timeline_type_id;
}

GType
tootle_views_timeline_get_type (void)
{
	static volatile gsize tootle_views_timeline_type_id__volatile = 0;
	if (g_once_init_enter (&tootle_views_timeline_type_id__volatile)) {
		GType tootle_views_timeline_type_id;
		tootle_views_timeline_type_id = tootle_views_timeline_get_type_once ();
		g_once_init_leave (&tootle_views_timeline_type_id__volatile, tootle_views_timeline_type_id);
	}
	return tootle_views_timeline_type_id__volatile;
}

static void
_vala_tootle_views_timeline_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec)
{
	TootleViewsTimeline * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TOOTLE_VIEWS_TYPE_TIMELINE, TootleViewsTimeline);
	switch (property_id) {
		case TOOTLE_VIEWS_TIMELINE_URL_PROPERTY:
		g_value_set_string (value, tootle_views_timeline_get_url (self));
		break;
		case TOOTLE_VIEWS_TIMELINE_IS_PUBLIC_PROPERTY:
		g_value_set_boolean (value, tootle_views_timeline_get_is_public (self));
		break;
		case TOOTLE_VIEWS_TIMELINE_ACCEPTS_PROPERTY:
		g_value_set_gtype (value, tootle_views_timeline_get_accepts (self));
		break;
		case TOOTLE_VIEWS_TIMELINE_IS_LAST_PAGE_PROPERTY:
		g_value_set_boolean (value, tootle_views_timeline_get_is_last_page (self));
		break;
		case TOOTLE_VIEWS_TIMELINE_PAGE_NEXT_PROPERTY:
		g_value_set_string (value, tootle_views_timeline_get_page_next (self));
		break;
		case TOOTLE_VIEWS_TIMELINE_PAGE_PREV_PROPERTY:
		g_value_set_string (value, tootle_views_timeline_get_page_prev (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tootle_views_timeline_set_property (GObject * object,
                                          guint property_id,
                                          const GValue * value,
                                          GParamSpec * pspec)
{
	TootleViewsTimeline * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TOOTLE_VIEWS_TYPE_TIMELINE, TootleViewsTimeline);
	switch (property_id) {
		case TOOTLE_VIEWS_TIMELINE_URL_PROPERTY:
		tootle_views_timeline_set_url (self, g_value_get_string (value));
		break;
		case TOOTLE_VIEWS_TIMELINE_IS_PUBLIC_PROPERTY:
		tootle_views_timeline_set_is_public (self, g_value_get_boolean (value));
		break;
		case TOOTLE_VIEWS_TIMELINE_ACCEPTS_PROPERTY:
		tootle_views_timeline_set_accepts (self, g_value_get_gtype (value));
		break;
		case TOOTLE_VIEWS_TIMELINE_IS_LAST_PAGE_PROPERTY:
		tootle_views_timeline_set_is_last_page (self, g_value_get_boolean (value));
		break;
		case TOOTLE_VIEWS_TIMELINE_PAGE_NEXT_PROPERTY:
		tootle_views_timeline_set_page_next (self, g_value_get_string (value));
		break;
		case TOOTLE_VIEWS_TIMELINE_PAGE_PREV_PROPERTY:
		tootle_views_timeline_set_page_prev (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_array_destroy (gpointer array,
                     gint array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gint 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,
                  gint array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

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

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

