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

/*  This file is part of corebird, a Gtk+ linux Twitter client.
 *  Copyright (C) 2013 Timm Bäder
 *
 *  corebird is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  corebird is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with corebird.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include "CbTwitterItem.h"
#include <stdlib.h>
#include <string.h>
#include "rest/oauth-proxy.h"
#include "CbUserStream.h"
#include "CbUserCounter.h"
#include "CbFilter.h"
#include <cairo.h>
#include <gio/gio.h>
#include "CbBundle.h"


#define TYPE_USER_LIST_ENTRY (user_list_entry_get_type ())
#define USER_LIST_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_USER_LIST_ENTRY, UserListEntry))
#define USER_LIST_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_USER_LIST_ENTRY, UserListEntryClass))
#define IS_USER_LIST_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_USER_LIST_ENTRY))
#define IS_USER_LIST_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_USER_LIST_ENTRY))
#define USER_LIST_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_USER_LIST_ENTRY, UserListEntryClass))

typedef struct _UserListEntry UserListEntry;
typedef struct _UserListEntryClass UserListEntryClass;
typedef struct _UserListEntryPrivate UserListEntryPrivate;

#define TYPE_AVATAR_WIDGET (avatar_widget_get_type ())
#define AVATAR_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_AVATAR_WIDGET, AvatarWidget))
#define AVATAR_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_AVATAR_WIDGET, AvatarWidgetClass))
#define IS_AVATAR_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_AVATAR_WIDGET))
#define IS_AVATAR_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_AVATAR_WIDGET))
#define AVATAR_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_AVATAR_WIDGET, AvatarWidgetClass))

typedef struct _AvatarWidget AvatarWidget;
typedef struct _AvatarWidgetClass AvatarWidgetClass;

#define TYPE_ACCOUNT (account_get_type ())
#define ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ACCOUNT, Account))
#define ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ACCOUNT, AccountClass))
#define IS_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ACCOUNT))
#define IS_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ACCOUNT))
#define ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ACCOUNT, AccountClass))

typedef struct _Account Account;
typedef struct _AccountClass AccountClass;
enum  {
	USER_LIST_ENTRY_0_PROPERTY,
	USER_LIST_ENTRY_NAME_PROPERTY,
	USER_LIST_ENTRY_SCREEN_NAME_PROPERTY,
	USER_LIST_ENTRY_AVATAR_URL_PROPERTY,
	USER_LIST_ENTRY_AVATAR_SURFACE_PROPERTY,
	USER_LIST_ENTRY_VERIFIED_PROPERTY,
	USER_LIST_ENTRY_SEEN_PROPERTY,
	USER_LIST_ENTRY_SHOW_SETTINGS_PROPERTY,
	USER_LIST_ENTRY_USER_ID_PROPERTY,
	USER_LIST_ENTRY_NUM_PROPERTIES
};
static GParamSpec* user_list_entry_properties[USER_LIST_ENTRY_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block64Data Block64Data;
typedef struct _AccountPrivate AccountPrivate;

#define SQL_TYPE_DATABASE (sql_database_get_type ())
#define SQL_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SQL_TYPE_DATABASE, SqlDatabase))
#define SQL_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SQL_TYPE_DATABASE, SqlDatabaseClass))
#define SQL_IS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SQL_TYPE_DATABASE))
#define SQL_IS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SQL_TYPE_DATABASE))
#define SQL_DATABASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SQL_TYPE_DATABASE, SqlDatabaseClass))

typedef struct _SqlDatabase SqlDatabase;
typedef struct _SqlDatabaseClass SqlDatabaseClass;

#define TYPE_NOTIFICATION_MANAGER (notification_manager_get_type ())
#define NOTIFICATION_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_NOTIFICATION_MANAGER, NotificationManager))
#define NOTIFICATION_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_NOTIFICATION_MANAGER, NotificationManagerClass))
#define IS_NOTIFICATION_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_NOTIFICATION_MANAGER))
#define IS_NOTIFICATION_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_NOTIFICATION_MANAGER))
#define NOTIFICATION_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_NOTIFICATION_MANAGER, NotificationManagerClass))

typedef struct _NotificationManager NotificationManager;
typedef struct _NotificationManagerClass NotificationManagerClass;
#define _g_free0(var) (var = (g_free (var), NULL))

#define TYPE_COREBIRD (corebird_get_type ())
#define COREBIRD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_COREBIRD, Corebird))
#define COREBIRD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_COREBIRD, CorebirdClass))
#define IS_COREBIRD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_COREBIRD))
#define IS_COREBIRD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_COREBIRD))
#define COREBIRD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_COREBIRD, CorebirdClass))

typedef struct _Corebird Corebird;
typedef struct _CorebirdClass CorebirdClass;

#define TYPE_MAIN_WINDOW (main_window_get_type ())
#define MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAIN_WINDOW, MainWindow))
#define MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAIN_WINDOW, MainWindowClass))
#define IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAIN_WINDOW))
#define IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAIN_WINDOW))
#define MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAIN_WINDOW, MainWindowClass))

typedef struct _MainWindow MainWindow;
typedef struct _MainWindowClass MainWindowClass;

#define TYPE_TWITTER (twitter_get_type ())
#define TWITTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TWITTER, Twitter))
#define TWITTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TWITTER, TwitterClass))
#define IS_TWITTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TWITTER))
#define IS_TWITTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TWITTER))
#define TWITTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TWITTER, TwitterClass))

typedef struct _Twitter Twitter;
typedef struct _TwitterClass TwitterClass;
typedef struct _MainWindowPrivate MainWindowPrivate;

#define TYPE_MAIN_WIDGET (main_widget_get_type ())
#define MAIN_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAIN_WIDGET, MainWidget))
#define MAIN_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAIN_WIDGET, MainWidgetClass))
#define IS_MAIN_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAIN_WIDGET))
#define IS_MAIN_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAIN_WIDGET))
#define MAIN_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAIN_WIDGET, MainWidgetClass))

typedef struct _MainWidget MainWidget;
typedef struct _MainWidgetClass MainWidgetClass;

#define TYPE_ACCOUNT_DIALOG (account_dialog_get_type ())
#define ACCOUNT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ACCOUNT_DIALOG, AccountDialog))
#define ACCOUNT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ACCOUNT_DIALOG, AccountDialogClass))
#define IS_ACCOUNT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ACCOUNT_DIALOG))
#define IS_ACCOUNT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ACCOUNT_DIALOG))
#define ACCOUNT_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ACCOUNT_DIALOG, AccountDialogClass))

typedef struct _AccountDialog AccountDialog;
typedef struct _AccountDialogClass AccountDialogClass;

#define TYPE_PAGE (page_get_type ())
enum  {
	USER_LIST_ENTRY_ACTION_CLICKED_SIGNAL,
	USER_LIST_ENTRY_NUM_SIGNALS
};
static guint user_list_entry_signals[USER_LIST_ENTRY_NUM_SIGNALS] = {0};

struct _UserListEntry {
	GtkListBoxRow parent_instance;
	UserListEntryPrivate * priv;
};

struct _UserListEntryClass {
	GtkListBoxRowClass parent_class;
};

struct _UserListEntryPrivate {
	GtkLabel* name_label;
	GtkLabel* screen_name_label;
	AvatarWidget* avatar_image;
	GtkButton* settings_button;
	GtkButton* new_window_button;
	GtkButton* profile_button;
	gint64 _user_id;
	GTimeSpan last_timediff;
	Account* account;
};

struct _Block64Data {
	int _ref_count_;
	UserListEntry* self;
	Account* acc;
};

struct _Account {
	GObject parent_instance;
	AccountPrivate * priv;
	gint64 id;
	SqlDatabase* db;
	gchar* screen_name;
	gchar* name;
	gchar* avatar_url;
	gchar* banner_url;
	gchar* website;
	gchar* description;
	OAuthProxy* proxy;
	CbUserStream* user_stream;
	CbUserCounter* user_counter;
	NotificationManager* notifications;
	gint64* friends;
	gint friends_length1;
	gint64* blocked;
	gint blocked_length1;
	gint64* muted;
	gint muted_length1;
	gint64* disabled_rts;
	gint disabled_rts_length1;
	GPtrArray* filters;
};

struct _AccountClass {
	GObjectClass parent_class;
};

struct _MainWindow {
	GtkApplicationWindow parent_instance;
	MainWindowPrivate * priv;
	GtkButton* back_button;
	GtkToggleButton* compose_tweet_button;
	MainWidget* main_widget;
	Account* account;
};

struct _MainWindowClass {
	GtkApplicationWindowClass parent_class;
};

typedef enum  {
	PAGE_STREAM = 0,
	PAGE_MENTIONS,
	PAGE_FAVORITES,
	PAGE_DM_THREADS,
	PAGE_LISTS,
	PAGE_FILTERS,
	PAGE_SEARCH,
	PAGE_PROFILE,
	PAGE_TWEET_INFO,
	PAGE_DM,
	PAGE_LIST_STATUSES,
	PAGE_PREVIOUS = 1024,
	PAGE_NEXT = 2048
} Page;


static gpointer user_list_entry_parent_class = NULL;
static CbTwitterItemInterface * user_list_entry_cb_twitter_item_parent_iface = NULL;

GType user_list_entry_get_type (void) G_GNUC_CONST;
GType avatar_widget_get_type (void) G_GNUC_CONST;
GType account_get_type (void) G_GNUC_CONST;
#define USER_LIST_ENTRY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_USER_LIST_ENTRY, UserListEntryPrivate))
void user_list_entry_set_screen_name (UserListEntry* self, const gchar* sn);
UserListEntry* user_list_entry_new_from_account (Account* acc);
UserListEntry* user_list_entry_construct_from_account (GType object_type, Account* acc);
static Block64Data* block64_data_ref (Block64Data* _data64_);
static void block64_data_unref (void * _userdata_);
GType sql_database_get_type (void) G_GNUC_CONST;
GType notification_manager_get_type (void) G_GNUC_CONST;
void user_list_entry_set_name (UserListEntry* self, const gchar* value);
cairo_surface_t* account_get_avatar (Account* self);
void user_list_entry_set_avatar_surface (UserListEntry* self, cairo_surface_t* value);
void user_list_entry_set_user_id (UserListEntry* self, gint64 value);
static void __lambda127_ (Block64Data* _data64_, const gchar* screen_name, const gchar* name, cairo_surface_t* nop, cairo_surface_t* avatar);
static void ___lambda127__account_info_changed (Account* _sender, const gchar* screen_name, const gchar* name, cairo_surface_t* avatar_small, cairo_surface_t* avatar, gpointer self);
static void __lambda128_ (UserListEntry* self);
static void ___lambda128__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
GType corebird_get_type (void) G_GNUC_CONST;
static void __lambda129_ (UserListEntry* self, GtkWindow* window);
GType main_window_get_type (void) G_GNUC_CONST;
static void user_list_entry_update_window_button_sensitivity (UserListEntry* self, GtkWindow* window, gboolean new_value);
static void ___lambda129__gtk_application_window_added (GtkApplication* _sender, GtkWindow* window, gpointer self);
static void __lambda130_ (UserListEntry* self, GtkWindow* window);
static void ___lambda130__gtk_application_window_removed (GtkApplication* _sender, GtkWindow* window, gpointer self);
static void __lambda131_ (UserListEntry* self, gint64* old_id, gint64 new_id);
gint64 user_list_entry_get_user_id (UserListEntry* self);
static gboolean _int64_equal (const gint64 * s1, const gint64 * s2);
static void ___lambda131__corebird_account_window_changed (Corebird* _sender, gint64* old_id, gint64 new_id, gpointer self);
gboolean corebird_is_window_open_for_user_id (Corebird* self, gint64 user_id, MainWindow* * window);
static void user_list_entry_real_set_avatar (UserListEntry* self, const gchar* avatar_url);
GType twitter_get_type (void) G_GNUC_CONST;
Twitter* twitter_get (void);
void twitter_get_avatar (Twitter* self, gint64 user_id, const gchar* url, AvatarWidget* dest_widget, gint size, gboolean force_download, GAsyncReadyCallback _callback_, gpointer _user_data_);
void twitter_get_avatar_finish (Twitter* self, GAsyncResult* _res_);
static gint user_list_entry_real_update_time_delta (CbTwitterItem* base, GDateTime* now);
static gint64 user_list_entry_real_get_sort_factor (CbTwitterItem* base);
static gint64 user_list_entry_real_get_timestamp (CbTwitterItem* base);
static GTimeSpan user_list_entry_real_get_last_set_timediff (CbTwitterItem* base);
static void user_list_entry_real_set_last_set_timediff (CbTwitterItem* base, GTimeSpan span);
GType main_widget_get_type (void) G_GNUC_CONST;
static void user_list_entry_settings_button_clicked_cb (UserListEntry* self);
GType account_dialog_get_type (void) G_GNUC_CONST;
AccountDialog* account_dialog_new (Account* account);
AccountDialog* account_dialog_construct (GType object_type, Account* account);
static void _user_list_entry_settings_button_clicked_cb_gtk_button_clicked (GtkButton* _sender, gpointer self);
static void user_list_entry_new_window_button_clicked_cb (UserListEntry* self);
MainWindow* main_window_new (GtkApplication* app, Account* account);
MainWindow* main_window_construct (GType object_type, GtkApplication* app, Account* account);
static void _user_list_entry_new_window_button_clicked_cb_gtk_button_clicked (GtkButton* _sender, gpointer self);
static void user_list_entry_profile_button_clicked_cb (UserListEntry* self);
#define PROFILE_PAGE_KEY_USER_ID 1
#define PROFILE_PAGE_KEY_SCREEN_NAME 0
gchar* user_list_entry_get_screen_name (UserListEntry* self);
void main_widget_switch_page (MainWidget* self, gint page_id, CbBundle* args);
GType page_get_type (void) G_GNUC_CONST;
static void _user_list_entry_profile_button_clicked_cb_gtk_button_clicked (GtkButton* _sender, gpointer self);
UserListEntry* user_list_entry_new (void);
UserListEntry* user_list_entry_construct (GType object_type);
void user_list_entry_set_avatar_url (UserListEntry* self, const gchar* value);
void avatar_widget_set_surface (AvatarWidget* self, cairo_surface_t* value);
void user_list_entry_set_verified (UserListEntry* self, gboolean value);
void avatar_widget_set_verified (AvatarWidget* self, gboolean value);
gboolean user_list_entry_get_seen (UserListEntry* self);
void user_list_entry_set_seen (UserListEntry* self, gboolean value);
void user_list_entry_set_show_settings (UserListEntry* self, gboolean value);
static void user_list_entry_finalize (GObject * obj);
static void _vala_user_list_entry_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_user_list_entry_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);


void user_list_entry_set_screen_name (UserListEntry* self, const gchar* sn) {
	GtkLabel* _tmp0_;
	const gchar* _tmp1_;
	g_return_if_fail (IS_USER_LIST_ENTRY (self));
	g_return_if_fail (sn != NULL);
	_tmp0_ = self->priv->screen_name_label;
	_tmp1_ = sn;
	gtk_label_set_label (_tmp0_, _tmp1_);
}


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


static Block64Data* block64_data_ref (Block64Data* _data64_) {
	g_atomic_int_inc (&_data64_->_ref_count_);
	return _data64_;
}


static void block64_data_unref (void * _userdata_) {
	Block64Data* _data64_;
	_data64_ = (Block64Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data64_->_ref_count_)) {
		UserListEntry* self;
		self = _data64_->self;
		_g_object_unref0 (_data64_->acc);
		_g_object_unref0 (self);
		g_slice_free (Block64Data, _data64_);
	}
}


static void __lambda127_ (Block64Data* _data64_, const gchar* screen_name, const gchar* name, cairo_surface_t* nop, cairo_surface_t* avatar) {
	UserListEntry* self;
	GtkLabel* _tmp0_;
	Account* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	const gchar* _tmp5_;
	cairo_surface_t* _tmp6_;
	self = _data64_->self;
	g_return_if_fail (screen_name != NULL);
	g_return_if_fail (name != NULL);
	g_return_if_fail (nop != NULL);
	g_return_if_fail (avatar != NULL);
	_tmp0_ = self->priv->screen_name_label;
	_tmp1_ = _data64_->acc;
	_tmp2_ = _tmp1_->screen_name;
	_tmp3_ = g_strconcat ("@", _tmp2_, NULL);
	_tmp4_ = _tmp3_;
	gtk_label_set_label (_tmp0_, _tmp4_);
	_g_free0 (_tmp4_);
	_tmp5_ = name;
	user_list_entry_set_name (self, _tmp5_);
	_tmp6_ = avatar;
	user_list_entry_set_avatar_surface (self, _tmp6_);
}


static void ___lambda127__account_info_changed (Account* _sender, const gchar* screen_name, const gchar* name, cairo_surface_t* avatar_small, cairo_surface_t* avatar, gpointer self) {
	__lambda127_ (self, screen_name, name, avatar_small, avatar);
}


static void __lambda128_ (UserListEntry* self) {
	Account* _tmp0_;
	cairo_surface_t* _tmp1_;
	cairo_surface_t* _tmp2_;
	_tmp0_ = self->priv->account;
	_tmp1_ = account_get_avatar (_tmp0_);
	_tmp2_ = _tmp1_;
	user_list_entry_set_avatar_surface (self, _tmp2_);
}


static void ___lambda128__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda128_ ((UserListEntry*) self);
}


static void __lambda129_ (UserListEntry* self, GtkWindow* window) {
	GtkWindow* _tmp0_;
	g_return_if_fail (GTK_IS_WINDOW (window));
	_tmp0_ = window;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, TYPE_MAIN_WINDOW)) {
		GtkWindow* _tmp1_;
		_tmp1_ = window;
		user_list_entry_update_window_button_sensitivity (self, _tmp1_, FALSE);
	}
}


static void ___lambda129__gtk_application_window_added (GtkApplication* _sender, GtkWindow* window, gpointer self) {
	__lambda129_ ((UserListEntry*) self, window);
}


static void __lambda130_ (UserListEntry* self, GtkWindow* window) {
	GtkWindow* _tmp0_;
	g_return_if_fail (GTK_IS_WINDOW (window));
	_tmp0_ = window;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, TYPE_MAIN_WINDOW)) {
		GtkWindow* _tmp1_;
		_tmp1_ = window;
		user_list_entry_update_window_button_sensitivity (self, _tmp1_, TRUE);
	}
}


static void ___lambda130__gtk_application_window_removed (GtkApplication* _sender, GtkWindow* window, gpointer self) {
	__lambda130_ ((UserListEntry*) self, window);
}


static gboolean _int64_equal (const gint64 * s1, const gint64 * s2) {
	if (s1 == s2) {
		return TRUE;
	}
	if (s1 == NULL) {
		return FALSE;
	}
	if (s2 == NULL) {
		return FALSE;
	}
	return (*s1) == (*s2);
}


static void __lambda131_ (UserListEntry* self, gint64* old_id, gint64 new_id) {
	gint64* _tmp0_;
	gint64 _tmp1_;
	_tmp0_ = old_id;
	_tmp1_ = self->priv->_user_id;
	if (_int64_equal (_tmp0_, &_tmp1_) == TRUE) {
		GtkButton* _tmp2_;
		_tmp2_ = self->priv->new_window_button;
		gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_widget_get_type (), GtkWidget), TRUE);
	} else {
		gint64 _tmp3_;
		gint64 _tmp4_;
		_tmp3_ = new_id;
		_tmp4_ = self->priv->_user_id;
		if (_tmp3_ == _tmp4_) {
			GtkButton* _tmp5_;
			_tmp5_ = self->priv->new_window_button;
			gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_widget_get_type (), GtkWidget), FALSE);
		}
	}
}


static void ___lambda131__corebird_account_window_changed (Corebird* _sender, gint64* old_id, gint64 new_id, gpointer self) {
	__lambda131_ ((UserListEntry*) self, old_id, new_id);
}


UserListEntry* user_list_entry_construct_from_account (GType object_type, Account* acc) {
	UserListEntry * self = NULL;
	Block64Data* _data64_;
	Account* _tmp0_;
	Account* _tmp1_;
	GtkLabel* _tmp2_;
	Account* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	Account* _tmp7_;
	const gchar* _tmp8_;
	Account* _tmp9_;
	cairo_surface_t* _tmp10_;
	cairo_surface_t* _tmp11_;
	Account* _tmp12_;
	Account* _tmp13_;
	gint64 _tmp14_;
	Account* _tmp15_;
	Account* _tmp16_;
	Corebird* cb = NULL;
	GApplication* _tmp17_;
	Corebird* _tmp18_;
	GtkButton* _tmp19_;
	Account* _tmp20_;
	gint64 _tmp21_;
	gboolean _tmp22_;
	g_return_val_if_fail (IS_ACCOUNT (acc), NULL);
	_data64_ = g_slice_new0 (Block64Data);
	_data64_->_ref_count_ = 1;
	_tmp0_ = acc;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data64_->acc);
	_data64_->acc = _tmp1_;
	self = (UserListEntry*) g_object_new (object_type, NULL);
	_data64_->self = g_object_ref (self);
	_tmp2_ = self->priv->screen_name_label;
	_tmp3_ = _data64_->acc;
	_tmp4_ = _tmp3_->screen_name;
	_tmp5_ = g_strconcat ("@", _tmp4_, NULL);
	_tmp6_ = _tmp5_;
	gtk_label_set_label (_tmp2_, _tmp6_);
	_g_free0 (_tmp6_);
	_tmp7_ = _data64_->acc;
	_tmp8_ = _tmp7_->name;
	user_list_entry_set_name (self, _tmp8_);
	_tmp9_ = _data64_->acc;
	_tmp10_ = account_get_avatar (_tmp9_);
	_tmp11_ = _tmp10_;
	user_list_entry_set_avatar_surface (self, _tmp11_);
	_tmp12_ = _data64_->acc;
	self->priv->account = _tmp12_;
	_tmp13_ = _data64_->acc;
	_tmp14_ = _tmp13_->id;
	user_list_entry_set_user_id (self, _tmp14_);
	_tmp15_ = _data64_->acc;
	g_signal_connect_data (_tmp15_, "info-changed", (GCallback) ___lambda127__account_info_changed, block64_data_ref (_data64_), (GClosureNotify) block64_data_unref, 0);
	_tmp16_ = _data64_->acc;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, G_TYPE_OBJECT, GObject), "notify::avatar", (GCallback) ___lambda128__g_object_notify, self, 0);
	_tmp17_ = g_application_get_default ();
	_tmp18_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, TYPE_COREBIRD, Corebird));
	cb = _tmp18_;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (cb, gtk_application_get_type (), GtkApplication), "window-added", (GCallback) ___lambda129__gtk_application_window_added, self, 0);
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (cb, gtk_application_get_type (), GtkApplication), "window-removed", (GCallback) ___lambda130__gtk_application_window_removed, self, 0);
	g_signal_connect_object (cb, "account-window-changed", (GCallback) ___lambda131__corebird_account_window_changed, self, 0);
	_tmp19_ = self->priv->new_window_button;
	_tmp20_ = _data64_->acc;
	_tmp21_ = _tmp20_->id;
	_tmp22_ = corebird_is_window_open_for_user_id (cb, _tmp21_, NULL);
	gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, gtk_widget_get_type (), GtkWidget), !_tmp22_);
	_g_object_unref0 (cb);
	block64_data_unref (_data64_);
	_data64_ = NULL;
	return self;
}


UserListEntry* user_list_entry_new_from_account (Account* acc) {
	return user_list_entry_construct_from_account (TYPE_USER_LIST_ENTRY, acc);
}


static void user_list_entry_real_set_avatar (UserListEntry* self, const gchar* avatar_url) {
	Twitter* _tmp0_;
	Twitter* _tmp1_;
	gint64 _tmp2_;
	const gchar* _tmp3_;
	AvatarWidget* _tmp4_;
	gint _tmp5_;
	g_return_if_fail (IS_USER_LIST_ENTRY (self));
	g_return_if_fail (avatar_url != NULL);
	_tmp0_ = twitter_get ();
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->_user_id;
	_tmp3_ = avatar_url;
	_tmp4_ = self->priv->avatar_image;
	_tmp5_ = gtk_widget_get_scale_factor (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	twitter_get_avatar (_tmp1_, _tmp2_, _tmp3_, _tmp4_, 48 * _tmp5_, FALSE, NULL, NULL);
	_g_object_unref0 (_tmp1_);
}


static gint user_list_entry_real_update_time_delta (CbTwitterItem* base, GDateTime* now) {
	UserListEntry * self;
	gint result = 0;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_USER_LIST_ENTRY, UserListEntry);
	result = 0;
	return result;
}


static gint64 user_list_entry_real_get_sort_factor (CbTwitterItem* base) {
	UserListEntry * self;
	gint64 result = 0LL;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_USER_LIST_ENTRY, UserListEntry);
	result = G_MAXINT64 - 1;
	return result;
}


static gint64 user_list_entry_real_get_timestamp (CbTwitterItem* base) {
	UserListEntry * self;
	gint64 result = 0LL;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_USER_LIST_ENTRY, UserListEntry);
	result = (gint64) 0;
	return result;
}


static GTimeSpan user_list_entry_real_get_last_set_timediff (CbTwitterItem* base) {
	UserListEntry * self;
	GTimeSpan result = 0LL;
	GTimeSpan _tmp0_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_USER_LIST_ENTRY, UserListEntry);
	_tmp0_ = self->priv->last_timediff;
	result = _tmp0_;
	return result;
}


static void user_list_entry_real_set_last_set_timediff (CbTwitterItem* base, GTimeSpan span) {
	UserListEntry * self;
	GTimeSpan _tmp0_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_USER_LIST_ENTRY, UserListEntry);
	_tmp0_ = span;
	self->priv->last_timediff = _tmp0_;
}


static void user_list_entry_update_window_button_sensitivity (UserListEntry* self, GtkWindow* window, gboolean new_value) {
	GtkWindow* _tmp0_;
	Account* _tmp1_;
	const gchar* _tmp2_;
	Account* _tmp3_;
	const gchar* _tmp4_;
	g_return_if_fail (IS_USER_LIST_ENTRY (self));
	g_return_if_fail (GTK_IS_WINDOW (window));
	_tmp0_ = window;
	_tmp1_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_MAIN_WINDOW, MainWindow)->account;
	_tmp2_ = _tmp1_->screen_name;
	_tmp3_ = self->priv->account;
	_tmp4_ = _tmp3_->screen_name;
	if (g_strcmp0 (_tmp2_, _tmp4_) == 0) {
		GtkButton* _tmp5_;
		gboolean _tmp6_;
		_tmp5_ = self->priv->new_window_button;
		_tmp6_ = new_value;
		gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_widget_get_type (), GtkWidget), _tmp6_);
	}
}


static void user_list_entry_settings_button_clicked_cb (UserListEntry* self) {
	GtkWindow* active_window = NULL;
	GApplication* _tmp0_;
	GtkWindow* _tmp1_;
	GtkWindow* _tmp2_;
	GtkWindow* _tmp3_;
	AccountDialog* dialog = NULL;
	Account* _tmp4_;
	AccountDialog* _tmp5_;
	g_return_if_fail (IS_USER_LIST_ENTRY (self));
	g_signal_emit (self, user_list_entry_signals[USER_LIST_ENTRY_ACTION_CLICKED_SIGNAL], 0);
	_tmp0_ = g_application_get_default ();
	_tmp1_ = gtk_application_get_active_window (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_application_get_type (), GtkApplication));
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	active_window = _tmp3_;
	_tmp4_ = self->priv->account;
	_tmp5_ = account_dialog_new (_tmp4_);
	g_object_ref_sink (_tmp5_);
	dialog = _tmp5_;
	gtk_window_set_transient_for (G_TYPE_CHECK_INSTANCE_CAST (dialog, gtk_window_get_type (), GtkWindow), active_window);
	gtk_window_set_modal (G_TYPE_CHECK_INSTANCE_CAST (dialog, gtk_window_get_type (), GtkWindow), TRUE);
	gtk_widget_show (G_TYPE_CHECK_INSTANCE_CAST (dialog, gtk_widget_get_type (), GtkWidget));
	_g_object_unref0 (dialog);
	_g_object_unref0 (active_window);
}


static void _user_list_entry_settings_button_clicked_cb_gtk_button_clicked (GtkButton* _sender, gpointer self) {
	user_list_entry_settings_button_clicked_cb ((UserListEntry*) self);
}


static void user_list_entry_new_window_button_clicked_cb (UserListEntry* self) {
	Corebird* cb = NULL;
	GApplication* _tmp0_;
	Corebird* _tmp1_;
	MainWindow* window = NULL;
	Account* _tmp2_;
	MainWindow* _tmp3_;
	g_return_if_fail (IS_USER_LIST_ENTRY (self));
	_tmp0_ = g_application_get_default ();
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_COREBIRD, Corebird));
	cb = _tmp1_;
	_tmp2_ = self->priv->account;
	_tmp3_ = main_window_new (G_TYPE_CHECK_INSTANCE_CAST (cb, gtk_application_get_type (), GtkApplication), _tmp2_);
	g_object_ref_sink (_tmp3_);
	window = _tmp3_;
	gtk_application_add_window (G_TYPE_CHECK_INSTANCE_CAST (cb, gtk_application_get_type (), GtkApplication), G_TYPE_CHECK_INSTANCE_CAST (window, gtk_window_get_type (), GtkWindow));
	gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (window, gtk_widget_get_type (), GtkWidget));
	g_signal_emit (self, user_list_entry_signals[USER_LIST_ENTRY_ACTION_CLICKED_SIGNAL], 0);
	_g_object_unref0 (window);
	_g_object_unref0 (cb);
}


static void _user_list_entry_new_window_button_clicked_cb_gtk_button_clicked (GtkButton* _sender, gpointer self) {
	user_list_entry_new_window_button_clicked_cb ((UserListEntry*) self);
}


static void user_list_entry_profile_button_clicked_cb (UserListEntry* self) {
	GtkWindow* active_window = NULL;
	GApplication* _tmp0_;
	GtkWindow* _tmp1_;
	GtkWindow* _tmp2_;
	GtkWindow* _tmp3_;
	GtkWindow* _tmp4_;
	g_return_if_fail (IS_USER_LIST_ENTRY (self));
	g_signal_emit (self, user_list_entry_signals[USER_LIST_ENTRY_ACTION_CLICKED_SIGNAL], 0);
	_tmp0_ = g_application_get_default ();
	_tmp1_ = gtk_application_get_active_window (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_application_get_type (), GtkApplication));
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	active_window = _tmp3_;
	_tmp4_ = active_window;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, TYPE_MAIN_WINDOW)) {
		MainWindow* mw = NULL;
		GtkWindow* _tmp5_;
		MainWindow* _tmp6_;
		CbBundle* bundle = NULL;
		CbBundle* _tmp7_;
		CbBundle* _tmp8_;
		gint64 _tmp9_;
		CbBundle* _tmp10_;
		gchar* _tmp11_;
		gchar* _tmp12_;
		gchar* _tmp13_;
		MainWindow* _tmp14_;
		MainWidget* _tmp15_;
		CbBundle* _tmp16_;
		_tmp5_ = active_window;
		_tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, TYPE_MAIN_WINDOW, MainWindow));
		mw = _tmp6_;
		_tmp7_ = cb_bundle_new ();
		bundle = _tmp7_;
		_tmp8_ = bundle;
		_tmp9_ = self->priv->_user_id;
		cb_bundle_put_int64 (_tmp8_, PROFILE_PAGE_KEY_USER_ID, _tmp9_);
		_tmp10_ = bundle;
		_tmp11_ = user_list_entry_get_screen_name (self);
		_tmp12_ = _tmp11_;
		_tmp13_ = _tmp12_;
		cb_bundle_put_string (_tmp10_, PROFILE_PAGE_KEY_SCREEN_NAME, _tmp13_);
		_g_free0 (_tmp13_);
		_tmp14_ = mw;
		_tmp15_ = _tmp14_->main_widget;
		_tmp16_ = bundle;
		main_widget_switch_page (_tmp15_, (gint) PAGE_PROFILE, _tmp16_);
		_g_object_unref0 (bundle);
		_g_object_unref0 (mw);
	}
	_g_object_unref0 (active_window);
}


static void _user_list_entry_profile_button_clicked_cb_gtk_button_clicked (GtkButton* _sender, gpointer self) {
	user_list_entry_profile_button_clicked_cb ((UserListEntry*) self);
}


UserListEntry* user_list_entry_construct (GType object_type) {
	UserListEntry * self = NULL;
	self = (UserListEntry*) g_object_new (object_type, NULL);
	return self;
}


UserListEntry* user_list_entry_new (void) {
	return user_list_entry_construct (TYPE_USER_LIST_ENTRY);
}


void user_list_entry_set_name (UserListEntry* self, const gchar* value) {
	GtkLabel* _tmp0_;
	const gchar* _tmp1_;
	g_return_if_fail (IS_USER_LIST_ENTRY (self));
	_tmp0_ = self->priv->name_label;
	_tmp1_ = value;
	gtk_label_set_label (_tmp0_, _tmp1_);
	g_object_notify_by_pspec ((GObject *) self, user_list_entry_properties[USER_LIST_ENTRY_NAME_PROPERTY]);
}


static glong string_strnlen (gchar* str, glong maxlen) {
	glong result = 0L;
	gchar* end = NULL;
	gchar* _tmp0_;
	glong _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	_tmp0_ = str;
	_tmp1_ = maxlen;
	_tmp2_ = memchr (_tmp0_, 0, (gsize) _tmp1_);
	end = _tmp2_;
	_tmp3_ = end;
	if (_tmp3_ == NULL) {
		glong _tmp4_;
		_tmp4_ = maxlen;
		result = _tmp4_;
		return result;
	} else {
		gchar* _tmp5_;
		gchar* _tmp6_;
		_tmp5_ = end;
		_tmp6_ = str;
		result = (glong) (_tmp5_ - _tmp6_);
		return result;
	}
}


static gchar* string_substring (const gchar* self, glong offset, glong len) {
	gchar* result = NULL;
	glong string_length = 0L;
	gboolean _tmp0_ = FALSE;
	glong _tmp1_;
	glong _tmp8_;
	glong _tmp14_;
	glong _tmp17_;
	glong _tmp18_;
	glong _tmp19_;
	glong _tmp20_;
	glong _tmp21_;
	gchar* _tmp22_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = offset;
	if (_tmp1_ >= ((glong) 0)) {
		glong _tmp2_;
		_tmp2_ = len;
		_tmp0_ = _tmp2_ >= ((glong) 0);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		glong _tmp3_;
		glong _tmp4_;
		glong _tmp5_;
		_tmp3_ = offset;
		_tmp4_ = len;
		_tmp5_ = string_strnlen ((gchar*) self, _tmp3_ + _tmp4_);
		string_length = _tmp5_;
	} else {
		gint _tmp6_;
		gint _tmp7_;
		_tmp6_ = strlen (self);
		_tmp7_ = _tmp6_;
		string_length = (glong) _tmp7_;
	}
	_tmp8_ = offset;
	if (_tmp8_ < ((glong) 0)) {
		glong _tmp9_;
		glong _tmp10_;
		glong _tmp11_;
		_tmp9_ = string_length;
		_tmp10_ = offset;
		offset = _tmp9_ + _tmp10_;
		_tmp11_ = offset;
		g_return_val_if_fail (_tmp11_ >= ((glong) 0), NULL);
	} else {
		glong _tmp12_;
		glong _tmp13_;
		_tmp12_ = offset;
		_tmp13_ = string_length;
		g_return_val_if_fail (_tmp12_ <= _tmp13_, NULL);
	}
	_tmp14_ = len;
	if (_tmp14_ < ((glong) 0)) {
		glong _tmp15_;
		glong _tmp16_;
		_tmp15_ = string_length;
		_tmp16_ = offset;
		len = _tmp15_ - _tmp16_;
	}
	_tmp17_ = offset;
	_tmp18_ = len;
	_tmp19_ = string_length;
	g_return_val_if_fail ((_tmp17_ + _tmp18_) <= _tmp19_, NULL);
	_tmp20_ = offset;
	_tmp21_ = len;
	_tmp22_ = g_strndup (((gchar*) self) + _tmp20_, (gsize) _tmp21_);
	result = _tmp22_;
	return result;
}


gchar* user_list_entry_get_screen_name (UserListEntry* self) {
	gchar* result;
	GtkLabel* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	g_return_val_if_fail (IS_USER_LIST_ENTRY (self), NULL);
	_tmp0_ = self->priv->screen_name_label;
	_tmp1_ = gtk_label_get_label (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = string_substring (_tmp2_, (glong) 1, (glong) -1);
	result = _tmp3_;
	return result;
}


void user_list_entry_set_avatar_url (UserListEntry* self, const gchar* value) {
	const gchar* _tmp0_;
	g_return_if_fail (IS_USER_LIST_ENTRY (self));
	_tmp0_ = value;
	user_list_entry_real_set_avatar (self, _tmp0_);
	g_object_notify_by_pspec ((GObject *) self, user_list_entry_properties[USER_LIST_ENTRY_AVATAR_URL_PROPERTY]);
}


void user_list_entry_set_avatar_surface (UserListEntry* self, cairo_surface_t* value) {
	AvatarWidget* _tmp0_;
	cairo_surface_t* _tmp1_;
	g_return_if_fail (IS_USER_LIST_ENTRY (self));
	_tmp0_ = self->priv->avatar_image;
	_tmp1_ = value;
	avatar_widget_set_surface (_tmp0_, _tmp1_);
	g_object_notify_by_pspec ((GObject *) self, user_list_entry_properties[USER_LIST_ENTRY_AVATAR_SURFACE_PROPERTY]);
}


void user_list_entry_set_verified (UserListEntry* self, gboolean value) {
	AvatarWidget* _tmp0_;
	gboolean _tmp1_;
	g_return_if_fail (IS_USER_LIST_ENTRY (self));
	_tmp0_ = self->priv->avatar_image;
	_tmp1_ = value;
	avatar_widget_set_verified (_tmp0_, _tmp1_);
	g_object_notify_by_pspec ((GObject *) self, user_list_entry_properties[USER_LIST_ENTRY_VERIFIED_PROPERTY]);
}


gboolean user_list_entry_get_seen (UserListEntry* self) {
	gboolean result;
	g_return_val_if_fail (IS_USER_LIST_ENTRY (self), FALSE);
	result = TRUE;
	return result;
}


void user_list_entry_set_seen (UserListEntry* self, gboolean value) {
	g_return_if_fail (IS_USER_LIST_ENTRY (self));
	g_object_notify_by_pspec ((GObject *) self, user_list_entry_properties[USER_LIST_ENTRY_SEEN_PROPERTY]);
}


void user_list_entry_set_show_settings (UserListEntry* self, gboolean value) {
	GtkButton* _tmp0_;
	gboolean _tmp1_;
	GtkButton* _tmp2_;
	gboolean _tmp3_;
	GtkButton* _tmp4_;
	gboolean _tmp5_;
	g_return_if_fail (IS_USER_LIST_ENTRY (self));
	_tmp0_ = self->priv->settings_button;
	_tmp1_ = value;
	gtk_widget_set_visible (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_widget_get_type (), GtkWidget), _tmp1_);
	_tmp2_ = self->priv->new_window_button;
	_tmp3_ = value;
	gtk_widget_set_visible (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_widget_get_type (), GtkWidget), _tmp3_);
	_tmp4_ = self->priv->profile_button;
	_tmp5_ = value;
	gtk_widget_set_visible (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_widget_get_type (), GtkWidget), _tmp5_);
	g_object_notify_by_pspec ((GObject *) self, user_list_entry_properties[USER_LIST_ENTRY_SHOW_SETTINGS_PROPERTY]);
}


gint64 user_list_entry_get_user_id (UserListEntry* self) {
	gint64 result;
	gint64 _tmp0_;
	g_return_val_if_fail (IS_USER_LIST_ENTRY (self), 0LL);
	_tmp0_ = self->priv->_user_id;
	result = _tmp0_;
	return result;
}


void user_list_entry_set_user_id (UserListEntry* self, gint64 value) {
	g_return_if_fail (IS_USER_LIST_ENTRY (self));
	if (user_list_entry_get_user_id (self) != value) {
		gint64 _tmp0_;
		_tmp0_ = value;
		self->priv->_user_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, user_list_entry_properties[USER_LIST_ENTRY_USER_ID_PROPERTY]);
	}
}


static void user_list_entry_class_init (UserListEntryClass * klass) {
	gint UserListEntry_private_offset;
	user_list_entry_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (UserListEntryPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_user_list_entry_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_user_list_entry_set_property;
	G_OBJECT_CLASS (klass)->finalize = user_list_entry_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), USER_LIST_ENTRY_NAME_PROPERTY, user_list_entry_properties[USER_LIST_ENTRY_NAME_PROPERTY] = g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), USER_LIST_ENTRY_SCREEN_NAME_PROPERTY, user_list_entry_properties[USER_LIST_ENTRY_SCREEN_NAME_PROPERTY] = g_param_spec_string ("screen-name", "screen-name", "screen-name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), USER_LIST_ENTRY_AVATAR_URL_PROPERTY, user_list_entry_properties[USER_LIST_ENTRY_AVATAR_URL_PROPERTY] = g_param_spec_string ("avatar-url", "avatar-url", "avatar-url", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), USER_LIST_ENTRY_AVATAR_SURFACE_PROPERTY, user_list_entry_properties[USER_LIST_ENTRY_AVATAR_SURFACE_PROPERTY] = g_param_spec_pointer ("avatar-surface", "avatar-surface", "avatar-surface", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), USER_LIST_ENTRY_VERIFIED_PROPERTY, user_list_entry_properties[USER_LIST_ENTRY_VERIFIED_PROPERTY] = g_param_spec_boolean ("verified", "verified", "verified", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), USER_LIST_ENTRY_SEEN_PROPERTY, user_list_entry_properties[USER_LIST_ENTRY_SEEN_PROPERTY] = g_param_spec_boolean ("seen", "seen", "seen", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), USER_LIST_ENTRY_SHOW_SETTINGS_PROPERTY, user_list_entry_properties[USER_LIST_ENTRY_SHOW_SETTINGS_PROPERTY] = g_param_spec_boolean ("show-settings", "show-settings", "show-settings", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), USER_LIST_ENTRY_USER_ID_PROPERTY, user_list_entry_properties[USER_LIST_ENTRY_USER_ID_PROPERTY] = g_param_spec_int64 ("user-id", "user-id", "user-id", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	UserListEntry_private_offset = g_type_class_get_instance_private_offset (klass);
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/baedert/corebird/ui/user-list-entry.ui");
	user_list_entry_signals[USER_LIST_ENTRY_ACTION_CLICKED_SIGNAL] = g_signal_new ("action-clicked", TYPE_USER_LIST_ENTRY, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "name_label", FALSE, UserListEntry_private_offset + G_STRUCT_OFFSET (UserListEntryPrivate, name_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "screen_name_label", FALSE, UserListEntry_private_offset + G_STRUCT_OFFSET (UserListEntryPrivate, screen_name_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "avatar_image", FALSE, UserListEntry_private_offset + G_STRUCT_OFFSET (UserListEntryPrivate, avatar_image));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "settings_button", FALSE, UserListEntry_private_offset + G_STRUCT_OFFSET (UserListEntryPrivate, settings_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "new_window_button", FALSE, UserListEntry_private_offset + G_STRUCT_OFFSET (UserListEntryPrivate, new_window_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "profile_button", FALSE, UserListEntry_private_offset + G_STRUCT_OFFSET (UserListEntryPrivate, profile_button));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "settings_button_clicked_cb", G_CALLBACK(_user_list_entry_settings_button_clicked_cb_gtk_button_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "new_window_button_clicked_cb", G_CALLBACK(_user_list_entry_new_window_button_clicked_cb_gtk_button_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "profile_button_clicked_cb", G_CALLBACK(_user_list_entry_profile_button_clicked_cb_gtk_button_clicked));
}


static void user_list_entry_cb_twitter_item_interface_init (CbTwitterItemInterface * iface) {
	user_list_entry_cb_twitter_item_parent_iface = g_type_interface_peek_parent (iface);
	iface->update_time_delta = (gint (*) (CbTwitterItem *, GDateTime*)) user_list_entry_real_update_time_delta;
	iface->get_sort_factor = (gint64 (*) (CbTwitterItem *)) user_list_entry_real_get_sort_factor;
	iface->get_timestamp = (gint64 (*) (CbTwitterItem *)) user_list_entry_real_get_timestamp;
	iface->get_last_set_timediff = (GTimeSpan (*) (CbTwitterItem *)) user_list_entry_real_get_last_set_timediff;
	iface->set_last_set_timediff = (void (*) (CbTwitterItem *, GTimeSpan)) user_list_entry_real_set_last_set_timediff;
}


static void user_list_entry_instance_init (UserListEntry * self) {
	self->priv = USER_LIST_ENTRY_GET_PRIVATE (self);
	g_type_ensure (TYPE_AVATAR_WIDGET);
	gtk_widget_init_template (GTK_WIDGET (self));
}


static void user_list_entry_finalize (GObject * obj) {
	UserListEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_USER_LIST_ENTRY, UserListEntry);
	_g_object_unref0 (self->priv->name_label);
	_g_object_unref0 (self->priv->screen_name_label);
	_g_object_unref0 (self->priv->avatar_image);
	_g_object_unref0 (self->priv->settings_button);
	_g_object_unref0 (self->priv->new_window_button);
	_g_object_unref0 (self->priv->profile_button);
	G_OBJECT_CLASS (user_list_entry_parent_class)->finalize (obj);
}


GType user_list_entry_get_type (void) {
	static volatile gsize user_list_entry_type_id__volatile = 0;
	if (g_once_init_enter (&user_list_entry_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (UserListEntryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) user_list_entry_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UserListEntry), 0, (GInstanceInitFunc) user_list_entry_instance_init, NULL };
		static const GInterfaceInfo cb_twitter_item_info = { (GInterfaceInitFunc) user_list_entry_cb_twitter_item_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType user_list_entry_type_id;
		user_list_entry_type_id = g_type_register_static (gtk_list_box_row_get_type (), "UserListEntry", &g_define_type_info, 0);
		g_type_add_interface_static (user_list_entry_type_id, CB_TYPE_TWITTER_ITEM, &cb_twitter_item_info);
		g_once_init_leave (&user_list_entry_type_id__volatile, user_list_entry_type_id);
	}
	return user_list_entry_type_id__volatile;
}


static void _vala_user_list_entry_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	UserListEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_USER_LIST_ENTRY, UserListEntry);
	switch (property_id) {
		case USER_LIST_ENTRY_SCREEN_NAME_PROPERTY:
		g_value_take_string (value, user_list_entry_get_screen_name (self));
		break;
		case USER_LIST_ENTRY_SEEN_PROPERTY:
		g_value_set_boolean (value, user_list_entry_get_seen (self));
		break;
		case USER_LIST_ENTRY_USER_ID_PROPERTY:
		g_value_set_int64 (value, user_list_entry_get_user_id (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_user_list_entry_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	UserListEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_USER_LIST_ENTRY, UserListEntry);
	switch (property_id) {
		case USER_LIST_ENTRY_NAME_PROPERTY:
		user_list_entry_set_name (self, g_value_get_string (value));
		break;
		case USER_LIST_ENTRY_AVATAR_URL_PROPERTY:
		user_list_entry_set_avatar_url (self, g_value_get_string (value));
		break;
		case USER_LIST_ENTRY_AVATAR_SURFACE_PROPERTY:
		user_list_entry_set_avatar_surface (self, g_value_get_pointer (value));
		break;
		case USER_LIST_ENTRY_VERIFIED_PROPERTY:
		user_list_entry_set_verified (self, g_value_get_boolean (value));
		break;
		case USER_LIST_ENTRY_SEEN_PROPERTY:
		user_list_entry_set_seen (self, g_value_get_boolean (value));
		break;
		case USER_LIST_ENTRY_SHOW_SETTINGS_PROPERTY:
		user_list_entry_set_show_settings (self, g_value_get_boolean (value));
		break;
		case USER_LIST_ENTRY_USER_ID_PROPERTY:
		user_list_entry_set_user_id (self, g_value_get_int64 (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}



