/* Lists.c generated by valac 0.52.4, the Vala compiler
 * generated from Lists.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 <glib/gi18n-lib.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;

#define TOOTLE_VIEWS_TYPE_LISTS (tootle_views_lists_get_type ())
#define TOOTLE_VIEWS_LISTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_VIEWS_TYPE_LISTS, TootleViewsLists))
#define TOOTLE_VIEWS_LISTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_VIEWS_TYPE_LISTS, TootleViewsListsClass))
#define TOOTLE_VIEWS_IS_LISTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_VIEWS_TYPE_LISTS))
#define TOOTLE_VIEWS_IS_LISTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_VIEWS_TYPE_LISTS))
#define TOOTLE_VIEWS_LISTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_VIEWS_TYPE_LISTS, TootleViewsListsClass))

typedef struct _TootleViewsLists TootleViewsLists;
typedef struct _TootleViewsListsClass TootleViewsListsClass;
typedef struct _TootleViewsListsPrivate TootleViewsListsPrivate;
enum  {
	TOOTLE_VIEWS_LISTS_0_PROPERTY,
	TOOTLE_VIEWS_LISTS_EMPTY_PROPERTY,
	TOOTLE_VIEWS_LISTS_NUM_PROPERTIES
};
static GParamSpec* tootle_views_lists_properties[TOOTLE_VIEWS_LISTS_NUM_PROPERTIES];

#define TOOTLE_API_TYPE_LIST (tootle_api_list_get_type ())
#define TOOTLE_API_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_API_TYPE_LIST, TootleAPIList))
#define TOOTLE_API_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_API_TYPE_LIST, TootleAPIListClass))
#define TOOTLE_API_IS_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_API_TYPE_LIST))
#define TOOTLE_API_IS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_API_TYPE_LIST))
#define TOOTLE_API_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_API_TYPE_LIST, TootleAPIListClass))

typedef struct _TootleAPIList TootleAPIList;
typedef struct _TootleAPIListClass TootleAPIListClass;

#define TOOTLE_VIEWS_LISTS_TYPE_ROW (tootle_views_lists_row_get_type ())
#define TOOTLE_VIEWS_LISTS_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_VIEWS_LISTS_TYPE_ROW, TootleViewsListsRow))
#define TOOTLE_VIEWS_LISTS_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_VIEWS_LISTS_TYPE_ROW, TootleViewsListsRowClass))
#define TOOTLE_VIEWS_LISTS_IS_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_VIEWS_LISTS_TYPE_ROW))
#define TOOTLE_VIEWS_LISTS_IS_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_VIEWS_LISTS_TYPE_ROW))
#define TOOTLE_VIEWS_LISTS_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_VIEWS_LISTS_TYPE_ROW, TootleViewsListsRowClass))

typedef struct _TootleViewsListsRow TootleViewsListsRow;
typedef struct _TootleViewsListsRowClass TootleViewsListsRowClass;

#define TOOTLE_DIALOGS_TYPE_LIST_EDITOR (tootle_dialogs_list_editor_get_type ())
#define TOOTLE_DIALOGS_LIST_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_DIALOGS_TYPE_LIST_EDITOR, TootleDialogsListEditor))
#define TOOTLE_DIALOGS_LIST_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_DIALOGS_TYPE_LIST_EDITOR, TootleDialogsListEditorClass))
#define TOOTLE_DIALOGS_IS_LIST_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_DIALOGS_TYPE_LIST_EDITOR))
#define TOOTLE_DIALOGS_IS_LIST_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_DIALOGS_TYPE_LIST_EDITOR))
#define TOOTLE_DIALOGS_LIST_EDITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_DIALOGS_TYPE_LIST_EDITOR, TootleDialogsListEditorClass))

typedef struct _TootleDialogsListEditor TootleDialogsListEditor;
typedef struct _TootleDialogsListEditorClass TootleDialogsListEditorClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _TootleViewsListsRowPrivate TootleViewsListsRowPrivate;
enum  {
	TOOTLE_VIEWS_LISTS_ROW_0_PROPERTY,
	TOOTLE_VIEWS_LISTS_ROW_NUM_PROPERTIES
};
static GParamSpec* tootle_views_lists_row_properties[TOOTLE_VIEWS_LISTS_ROW_NUM_PROPERTIES];

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

#define TOOTLE_DIALOGS_TYPE_MAIN_WINDOW (tootle_dialogs_main_window_get_type ())
#define TOOTLE_DIALOGS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_DIALOGS_TYPE_MAIN_WINDOW, TootleDialogsMainWindow))
#define TOOTLE_DIALOGS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_DIALOGS_TYPE_MAIN_WINDOW, TootleDialogsMainWindowClass))
#define TOOTLE_DIALOGS_IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_DIALOGS_TYPE_MAIN_WINDOW))
#define TOOTLE_DIALOGS_IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_DIALOGS_TYPE_MAIN_WINDOW))
#define TOOTLE_DIALOGS_MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_DIALOGS_TYPE_MAIN_WINDOW, TootleDialogsMainWindowClass))

typedef struct _TootleDialogsMainWindow TootleDialogsMainWindow;
typedef struct _TootleDialogsMainWindowClass TootleDialogsMainWindowClass;
#define _g_free0(var) (var = (g_free (var), NULL))

#define TOOTLE_TYPE_ACCOUNTS (tootle_accounts_get_type ())
#define TOOTLE_ACCOUNTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_TYPE_ACCOUNTS, TootleAccounts))
#define TOOTLE_ACCOUNTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_TYPE_ACCOUNTS, TootleAccountsClass))
#define TOOTLE_IS_ACCOUNTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_TYPE_ACCOUNTS))
#define TOOTLE_IS_ACCOUNTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_TYPE_ACCOUNTS))
#define TOOTLE_ACCOUNTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_TYPE_ACCOUNTS, TootleAccountsClass))

typedef struct _TootleAccounts TootleAccounts;
typedef struct _TootleAccountsClass TootleAccountsClass;
typedef void (*TootleNetworkSuccessCallback) (SoupSession* session, SoupMessage* msg, gpointer user_data, GError** error);

#define TOOTLE_VIEWS_TYPE_LIST (tootle_views_list_get_type ())
#define TOOTLE_VIEWS_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_VIEWS_TYPE_LIST, TootleViewsList))
#define TOOTLE_VIEWS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_VIEWS_TYPE_LIST, TootleViewsListClass))
#define TOOTLE_VIEWS_IS_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_VIEWS_TYPE_LIST))
#define TOOTLE_VIEWS_IS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_VIEWS_TYPE_LIST))
#define TOOTLE_VIEWS_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_VIEWS_TYPE_LIST, TootleViewsListClass))

typedef struct _TootleViewsList TootleViewsList;
typedef struct _TootleViewsListClass TootleViewsListClass;
enum  {
	TOOTLE_VIEWS_LISTS_ROW_OPEN_SIGNAL,
	TOOTLE_VIEWS_LISTS_ROW_NUM_SIGNALS
};
static guint tootle_views_lists_row_signals[TOOTLE_VIEWS_LISTS_ROW_NUM_SIGNALS] = {0};

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 _TootleViewsLists {
	TootleViewsTimeline parent_instance;
	TootleViewsListsPrivate * priv;
};

struct _TootleViewsListsClass {
	TootleViewsTimelineClass parent_class;
};

struct _TootleViewsListsRow {
	GtkListBoxRow parent_instance;
	TootleViewsListsRowPrivate * priv;
};

struct _TootleViewsListsRowClass {
	GtkListBoxRowClass parent_class;
	void (*open) (TootleViewsListsRow* self);
};

struct _TootleViewsListsRowPrivate {
	TootleAPIList* list;
	GtkStack* stack;
	GtkLabel* title;
};

static gpointer tootle_views_lists_parent_class = NULL;
static gint TootleViewsListsRow_private_offset;
static gpointer tootle_views_lists_row_parent_class = NULL;
extern TootleApplication* tootle_app;
extern TootleDialogsMainWindow* tootle_window;
extern TootleAccounts* tootle_accounts;

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)
GType tootle_views_lists_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleViewsLists, g_object_unref)
void tootle_views_timeline_on_request_finish (TootleViewsTimeline* self);
TootleViewsLists* tootle_views_lists_new (void);
TootleViewsLists* tootle_views_lists_construct (GType object_type);
GType tootle_api_list_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleAPIList, g_object_unref)
void tootle_views_timeline_set_accepts (TootleViewsTimeline* self,
                                        GType value);
static void tootle_views_lists_real_on_request_finish (TootleViewsTimeline* base);
GType tootle_views_lists_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleViewsListsRow, g_object_unref)
TootleViewsListsRow* tootle_views_lists_row_new (TootleAPIList* list);
TootleViewsListsRow* tootle_views_lists_row_construct (GType object_type,
                                                       TootleAPIList* list);
static void __lambda123_ (TootleViewsLists* self);
GType tootle_dialogs_list_editor_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleDialogsListEditor, g_object_unref)
TootleDialogsListEditor* tootle_dialogs_list_editor_new_empty (void);
TootleDialogsListEditor* tootle_dialogs_list_editor_construct_empty (GType object_type);
void tootle_views_timeline_on_refresh (TootleViewsTimeline* self);
static void _tootle_views_timeline_on_refresh_tootle_dialogs_list_editor_done (TootleDialogsListEditor* _sender,
                                                                        gpointer self);
static void ___lambda123__tootle_views_lists_row_open (TootleViewsListsRow* _sender,
                                                gpointer self);
void tootle_views_timeline_append (TootleViewsTimeline* self,
                                   GtkWidget* w,
                                   gboolean first);
void tootle_views_base_on_content_changed (TootleViewsBase* self);
gboolean tootle_views_lists_get_empty (TootleViewsLists* self);
static void tootle_views_lists_row_on_edit_clicked (TootleViewsListsRow* self);
TootleDialogsListEditor* tootle_dialogs_list_editor_new (TootleAPIList* list);
TootleDialogsListEditor* tootle_dialogs_list_editor_construct (GType object_type,
                                                               TootleAPIList* list);
static void _tootle_views_lists_row_on_edit_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                 gpointer self);
static void tootle_views_lists_row_on_remove_clicked (TootleViewsListsRow* self);
GType tootle_application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleApplication, g_object_unref)
gboolean tootle_application_question (TootleApplication* self,
                                      const gchar* text,
                                      const gchar* msg,
                                      GtkWindow* win);
const gchar* tootle_api_list_get_title (TootleAPIList* self);
GType tootle_dialogs_main_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleDialogsMainWindow, g_object_unref)
const gchar* tootle_api_list_get_id (TootleAPIList* self);
TootleRequest* tootle_request_new_DELETE (const gchar* url);
TootleRequest* tootle_request_construct_DELETE (GType object_type,
                                                const gchar* url);
TootleRequest* tootle_request_with_account (TootleRequest* self,
                                            TootleInstanceAccount* account);
GType tootle_accounts_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleAccounts, g_object_unref)
TootleInstanceAccount* tootle_accounts_get_active (TootleAccounts* self);
TootleRequest* tootle_request_then (TootleRequest* self,
                                    TootleNetworkSuccessCallback cb,
                                    gpointer cb_target,
                                    GDestroyNotify cb_target_destroy_notify);
static void ___lambda122_ (TootleViewsListsRow* self,
                    GError** error);
static void ____lambda122__tootle_network_success_callback (SoupSession* session,
                                                     SoupMessage* msg,
                                                     gpointer self,
                                                     GError** error);
TootleRequest* tootle_request_exec (TootleRequest* self);
static void _tootle_views_lists_row_on_remove_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                   gpointer self);
static void tootle_views_lists_row_real_open (TootleViewsListsRow* self);
GType tootle_views_list_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleViewsList, g_object_unref)
TootleViewsList* tootle_views_list_new (TootleAPIList* l);
TootleViewsList* tootle_views_list_construct (GType object_type,
                                              TootleAPIList* l);
TootleViewsBase* tootle_dialogs_main_window_open_view (TootleDialogsMainWindow* self,
                                                       TootleViewsBase* view);
static void tootle_views_lists_row_finalize (GObject * obj);
static GType tootle_views_lists_row_get_type_once (void);
static GType tootle_views_lists_get_type_once (void);
static void _vala_tootle_views_lists_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

TootleViewsLists*
tootle_views_lists_construct (GType object_type)
{
	TootleViewsLists * self = NULL;
	self = (TootleViewsLists*) g_object_new (object_type, "url", "/api/v1/lists", "label", _ ("Lists"), "icon", "view-list-symbolic", NULL);
	tootle_views_timeline_set_accepts ((TootleViewsTimeline*) self, TOOTLE_API_TYPE_LIST);
	return self;
}

TootleViewsLists*
tootle_views_lists_new (void)
{
	return tootle_views_lists_construct (TOOTLE_VIEWS_TYPE_LISTS);
}

static void
_tootle_views_timeline_on_refresh_tootle_dialogs_list_editor_done (TootleDialogsListEditor* _sender,
                                                                   gpointer self)
{
	tootle_views_timeline_on_refresh ((TootleViewsTimeline*) self);
}

static void
__lambda123_ (TootleViewsLists* self)
{
	TootleDialogsListEditor* dlg = NULL;
	TootleDialogsListEditor* _tmp0_;
	_tmp0_ = tootle_dialogs_list_editor_new_empty ();
	g_object_ref_sink (_tmp0_);
	dlg = _tmp0_;
	g_signal_connect_object (dlg, "done", (GCallback) _tootle_views_timeline_on_refresh_tootle_dialogs_list_editor_done, (TootleViewsTimeline*) self, 0);
	_g_object_unref0 (dlg);
}

static void
___lambda123__tootle_views_lists_row_open (TootleViewsListsRow* _sender,
                                           gpointer self)
{
	__lambda123_ ((TootleViewsLists*) self);
}

static void
tootle_views_lists_real_on_request_finish (TootleViewsTimeline* base)
{
	TootleViewsLists * self;
	TootleViewsListsRow* add_row = NULL;
	TootleViewsListsRow* _tmp0_;
	self = (TootleViewsLists*) base;
	_tmp0_ = tootle_views_lists_row_new (NULL);
	g_object_ref_sink (_tmp0_);
	add_row = _tmp0_;
	g_signal_connect_object (add_row, "open", (GCallback) ___lambda123__tootle_views_lists_row_open, self, 0);
	tootle_views_timeline_append ((TootleViewsTimeline*) self, (GtkWidget*) add_row, FALSE);
	tootle_views_base_on_content_changed ((TootleViewsBase*) self);
	_g_object_unref0 (add_row);
}

gboolean
tootle_views_lists_get_empty (TootleViewsLists* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = FALSE;
	return result;
}

static inline gpointer
tootle_views_lists_row_get_instance_private (TootleViewsListsRow* self)
{
	return G_STRUCT_MEMBER_P (self, TootleViewsListsRow_private_offset);
}

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

TootleViewsListsRow*
tootle_views_lists_row_construct (GType object_type,
                                  TootleAPIList* list)
{
	TootleViewsListsRow * self = NULL;
	TootleAPIList* _tmp0_;
	self = (TootleViewsListsRow*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (list);
	_g_object_unref0 (self->priv->list);
	self->priv->list = _tmp0_;
	if (list == NULL) {
		GtkStack* _tmp1_;
		_tmp1_ = self->priv->stack;
		gtk_stack_set_visible_child_name (_tmp1_, "add");
	} else {
		GtkLabel* _tmp2_;
		_tmp2_ = self->priv->title;
		g_object_bind_property_with_closures ((GObject*) list, "title", (GObject*) _tmp2_, "label", 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)));
	}
	return self;
}

TootleViewsListsRow*
tootle_views_lists_row_new (TootleAPIList* list)
{
	return tootle_views_lists_row_construct (TOOTLE_VIEWS_LISTS_TYPE_ROW, list);
}

static void
tootle_views_lists_row_on_edit_clicked (TootleViewsListsRow* self)
{
	TootleAPIList* _tmp0_;
	TootleDialogsListEditor* _tmp1_;
	TootleDialogsListEditor* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->list;
	_tmp1_ = tootle_dialogs_list_editor_new (_tmp0_);
	g_object_ref_sink (_tmp1_);
	_tmp2_ = _tmp1_;
	_g_object_unref0 (_tmp2_);
}

static void
_tootle_views_lists_row_on_edit_clicked_gtk_button_clicked (GtkButton* _sender,
                                                            gpointer self)
{
	tootle_views_lists_row_on_edit_clicked ((TootleViewsListsRow*) 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
___lambda122_ (TootleViewsListsRow* self,
               GError** error)
{
	gtk_widget_destroy ((GtkWidget*) self);
}

static void
____lambda122__tootle_network_success_callback (SoupSession* session,
                                                SoupMessage* msg,
                                                gpointer self,
                                                GError** error)
{
	___lambda122_ ((TootleViewsListsRow*) self, error);
}

static void
tootle_views_lists_row_on_remove_clicked (TootleViewsListsRow* self)
{
	gboolean remove = FALSE;
	TootleApplication* _tmp0_;
	TootleAPIList* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	TootleDialogsMainWindow* _tmp6_;
	gboolean _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = tootle_app;
	_tmp1_ = self->priv->list;
	_tmp2_ = tootle_api_list_get_title (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_strdup_printf (_ ("Delete \"%s\"?"), _tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = tootle_window;
	_tmp7_ = tootle_application_question (_tmp0_, _tmp5_, _ ("This action cannot be reverted."), (GtkWindow*) _tmp6_);
	_g_free0 (_tmp5_);
	remove = _tmp7_;
	if (remove) {
		TootleAPIList* _tmp8_;
		const gchar* _tmp9_;
		const gchar* _tmp10_;
		const gchar* _tmp11_;
		gchar* _tmp12_;
		gchar* _tmp13_;
		TootleRequest* _tmp14_;
		TootleRequest* _tmp15_;
		TootleAccounts* _tmp16_;
		TootleInstanceAccount* _tmp17_;
		TootleInstanceAccount* _tmp18_;
		TootleRequest* _tmp19_;
		TootleRequest* _tmp20_;
		TootleRequest* _tmp21_;
		TootleRequest* _tmp22_;
		TootleRequest* _tmp23_;
		TootleRequest* _tmp24_;
		_tmp8_ = self->priv->list;
		_tmp9_ = tootle_api_list_get_id (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = string_to_string (_tmp10_);
		_tmp12_ = g_strconcat ("/api/v1/lists/", _tmp11_, NULL);
		_tmp13_ = _tmp12_;
		_tmp14_ = tootle_request_new_DELETE (_tmp13_);
		_tmp15_ = _tmp14_;
		_tmp16_ = tootle_accounts;
		_tmp17_ = tootle_accounts_get_active (_tmp16_);
		_tmp18_ = _tmp17_;
		_tmp19_ = tootle_request_with_account (_tmp15_, _tmp18_);
		_tmp20_ = _tmp19_;
		_tmp21_ = tootle_request_then (_tmp20_, ____lambda122__tootle_network_success_callback, g_object_ref (self), g_object_unref);
		_tmp22_ = _tmp21_;
		_tmp23_ = tootle_request_exec (_tmp22_);
		_tmp24_ = _tmp23_;
		_g_object_unref0 (_tmp24_);
		_g_object_unref0 (_tmp22_);
		_g_object_unref0 (_tmp20_);
		_g_object_unref0 (_tmp15_);
		_g_free0 (_tmp13_);
	}
}

static void
_tootle_views_lists_row_on_remove_clicked_gtk_button_clicked (GtkButton* _sender,
                                                              gpointer self)
{
	tootle_views_lists_row_on_remove_clicked ((TootleViewsListsRow*) self);
}

static void
tootle_views_lists_row_real_open (TootleViewsListsRow* self)
{
	TootleAPIList* _tmp0_;
	TootleViewsList* view = NULL;
	TootleAPIList* _tmp1_;
	TootleViewsList* _tmp2_;
	TootleDialogsMainWindow* _tmp3_;
	TootleViewsList* _tmp4_;
	TootleViewsBase* _tmp5_;
	TootleViewsBase* _tmp6_;
	_tmp0_ = self->priv->list;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->priv->list;
	_tmp2_ = tootle_views_list_new (_tmp1_);
	g_object_ref_sink (_tmp2_);
	view = _tmp2_;
	_tmp3_ = tootle_window;
	_tmp4_ = view;
	_tmp5_ = tootle_dialogs_main_window_open_view (_tmp3_, (TootleViewsBase*) _tmp4_);
	_tmp6_ = _tmp5_;
	_g_object_unref0 (_tmp6_);
	_g_object_unref0 (view);
}

static void
tootle_views_lists_row_class_init (TootleViewsListsRowClass * klass,
                                   gpointer klass_data)
{
	tootle_views_lists_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TootleViewsListsRow_private_offset);
	((TootleViewsListsRowClass *) klass)->open = tootle_views_lists_row_real_open;
	G_OBJECT_CLASS (klass)->finalize = tootle_views_lists_row_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/com/github/bleakgrey/tootle/ui/widgets/list_item.ui");
	tootle_views_lists_row_signals[TOOTLE_VIEWS_LISTS_ROW_OPEN_SIGNAL] = g_signal_new ("open", TOOTLE_VIEWS_LISTS_TYPE_ROW, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (TootleViewsListsRowClass, open), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "stack", FALSE, TootleViewsListsRow_private_offset + G_STRUCT_OFFSET (TootleViewsListsRowPrivate, stack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "title", FALSE, TootleViewsListsRow_private_offset + G_STRUCT_OFFSET (TootleViewsListsRowPrivate, title));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_edit_clicked", G_CALLBACK(_tootle_views_lists_row_on_edit_clicked_gtk_button_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_remove_clicked", G_CALLBACK(_tootle_views_lists_row_on_remove_clicked_gtk_button_clicked));
}

static void
tootle_views_lists_row_instance_init (TootleViewsListsRow * self,
                                      gpointer klass)
{
	self->priv = tootle_views_lists_row_get_instance_private (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
tootle_views_lists_row_finalize (GObject * obj)
{
	TootleViewsListsRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TOOTLE_VIEWS_LISTS_TYPE_ROW, TootleViewsListsRow);
	_g_object_unref0 (self->priv->list);
	G_OBJECT_CLASS (tootle_views_lists_row_parent_class)->finalize (obj);
}

static GType
tootle_views_lists_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TootleViewsListsRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tootle_views_lists_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TootleViewsListsRow), 0, (GInstanceInitFunc) tootle_views_lists_row_instance_init, NULL };
	GType tootle_views_lists_row_type_id;
	tootle_views_lists_row_type_id = g_type_register_static (gtk_list_box_row_get_type (), "TootleViewsListsRow", &g_define_type_info, 0);
	TootleViewsListsRow_private_offset = g_type_add_instance_private (tootle_views_lists_row_type_id, sizeof (TootleViewsListsRowPrivate));
	return tootle_views_lists_row_type_id;
}

GType
tootle_views_lists_row_get_type (void)
{
	static volatile gsize tootle_views_lists_row_type_id__volatile = 0;
	if (g_once_init_enter (&tootle_views_lists_row_type_id__volatile)) {
		GType tootle_views_lists_row_type_id;
		tootle_views_lists_row_type_id = tootle_views_lists_row_get_type_once ();
		g_once_init_leave (&tootle_views_lists_row_type_id__volatile, tootle_views_lists_row_type_id);
	}
	return tootle_views_lists_row_type_id__volatile;
}

static void
tootle_views_lists_class_init (TootleViewsListsClass * klass,
                               gpointer klass_data)
{
	tootle_views_lists_parent_class = g_type_class_peek_parent (klass);
	((TootleViewsTimelineClass *) klass)->on_request_finish = (void (*) (TootleViewsTimeline*)) tootle_views_lists_real_on_request_finish;
	G_OBJECT_CLASS (klass)->get_property = _vala_tootle_views_lists_get_property;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_VIEWS_LISTS_EMPTY_PROPERTY, tootle_views_lists_properties[TOOTLE_VIEWS_LISTS_EMPTY_PROPERTY] = g_param_spec_boolean ("empty", "empty", "empty", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
tootle_views_lists_instance_init (TootleViewsLists * self,
                                  gpointer klass)
{
}

static GType
tootle_views_lists_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TootleViewsListsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tootle_views_lists_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TootleViewsLists), 0, (GInstanceInitFunc) tootle_views_lists_instance_init, NULL };
	GType tootle_views_lists_type_id;
	tootle_views_lists_type_id = g_type_register_static (TOOTLE_VIEWS_TYPE_TIMELINE, "TootleViewsLists", &g_define_type_info, 0);
	return tootle_views_lists_type_id;
}

GType
tootle_views_lists_get_type (void)
{
	static volatile gsize tootle_views_lists_type_id__volatile = 0;
	if (g_once_init_enter (&tootle_views_lists_type_id__volatile)) {
		GType tootle_views_lists_type_id;
		tootle_views_lists_type_id = tootle_views_lists_get_type_once ();
		g_once_init_leave (&tootle_views_lists_type_id__volatile, tootle_views_lists_type_id);
	}
	return tootle_views_lists_type_id__volatile;
}

static void
_vala_tootle_views_lists_get_property (GObject * object,
                                       guint property_id,
                                       GValue * value,
                                       GParamSpec * pspec)
{
	TootleViewsLists * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TOOTLE_VIEWS_TYPE_LISTS, TootleViewsLists);
	switch (property_id) {
		case TOOTLE_VIEWS_LISTS_EMPTY_PROPERTY:
		g_value_set_boolean (value, tootle_views_lists_get_empty (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

