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

#include <glib-object.h>
#include "libdino.h"
#include <gee.h>
#include <glib.h>
#include <gtk/gtk.h>
#include "xmpp-vala.h"
#include <gobject/gvaluecollector.h>

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

#define DINO_UI_TYPE_ROSTER_LIST (dino_ui_roster_list_get_type ())
#define DINO_UI_ROSTER_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_TYPE_ROSTER_LIST, DinoUiRosterList))
#define DINO_UI_ROSTER_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_TYPE_ROSTER_LIST, DinoUiRosterListClass))
#define DINO_UI_IS_ROSTER_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_TYPE_ROSTER_LIST))
#define DINO_UI_IS_ROSTER_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_TYPE_ROSTER_LIST))
#define DINO_UI_ROSTER_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_TYPE_ROSTER_LIST, DinoUiRosterListClass))

typedef struct _DinoUiRosterList DinoUiRosterList;
typedef struct _DinoUiRosterListClass DinoUiRosterListClass;
typedef struct _DinoUiRosterListPrivate DinoUiRosterListPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block5Data Block5Data;
#define _dino_ui_roster_list_unref0(var) ((var == NULL) ? NULL : (var = (dino_ui_roster_list_unref (var), NULL)))

#define DINO_UI_TYPE_LIST_ROW (dino_ui_list_row_get_type ())
#define DINO_UI_LIST_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_TYPE_LIST_ROW, DinoUiListRow))
#define DINO_UI_LIST_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_TYPE_LIST_ROW, DinoUiListRowClass))
#define DINO_UI_IS_LIST_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_TYPE_LIST_ROW))
#define DINO_UI_IS_LIST_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_TYPE_LIST_ROW))
#define DINO_UI_LIST_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_TYPE_LIST_ROW, DinoUiListRowClass))

typedef struct _DinoUiListRow DinoUiListRow;
typedef struct _DinoUiListRowClass DinoUiListRowClass;
#define _xmpp_roster_item_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_roster_item_unref (var), NULL)))
typedef struct _DinoUiParamSpecRosterList DinoUiParamSpecRosterList;
enum  {
	DINO_UI_ROSTER_LIST_CONVERSATION_SELECTED_SIGNAL,
	DINO_UI_ROSTER_LIST_NUM_SIGNALS
};
static guint dino_ui_roster_list_signals[DINO_UI_ROSTER_LIST_NUM_SIGNALS] = {0};

struct _DinoUiRosterList {
	GTypeInstance parent_instance;
	volatile int ref_count;
	DinoUiRosterListPrivate * priv;
};

struct _DinoUiRosterListClass {
	GTypeClass parent_class;
	void (*finalize) (DinoUiRosterList *self);
};

struct _DinoUiRosterListPrivate {
	DinoStreamInteractor* stream_interactor;
	GeeList* accounts;
	gulong* handler_ids;
	gint handler_ids_length1;
	gint _handler_ids_size_;
	GtkListBox* list_box;
	GeeHashMap* rows;
};

struct _Block5Data {
	int _ref_count_;
	DinoUiRosterList* self;
	DinoStreamInteractor* stream_interactor;
	GeeList* accounts;
};

struct _DinoUiParamSpecRosterList {
	GParamSpec parent_instance;
};

static gint DinoUiRosterList_private_offset;
static gpointer dino_ui_roster_list_parent_class = NULL;

VALA_EXTERN gpointer dino_ui_roster_list_ref (gpointer instance);
VALA_EXTERN void dino_ui_roster_list_unref (gpointer instance);
VALA_EXTERN GParamSpec* dino_ui_param_spec_roster_list (const gchar* name,
                                            const gchar* nick,
                                            const gchar* blurb,
                                            GType object_type,
                                            GParamFlags flags);
VALA_EXTERN void dino_ui_value_set_roster_list (GValue* value,
                                    gpointer v_object);
VALA_EXTERN void dino_ui_value_take_roster_list (GValue* value,
                                     gpointer v_object);
VALA_EXTERN gpointer dino_ui_value_get_roster_list (const GValue* value);
VALA_EXTERN GType dino_ui_roster_list_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiRosterList, dino_ui_roster_list_unref)
static guint _dino_entities_account_hash_func_gee_hash_data_func (gconstpointer v,
                                                           gpointer self);
static gboolean _dino_entities_account_equals_func_gee_equal_data_func (gconstpointer a,
                                                                 gconstpointer b,
                                                                 gpointer self);
VALA_EXTERN DinoUiRosterList* dino_ui_roster_list_new (DinoStreamInteractor* stream_interactor,
                                           GeeList* accounts);
VALA_EXTERN DinoUiRosterList* dino_ui_roster_list_construct (GType object_type,
                                                 DinoStreamInteractor* stream_interactor,
                                                 GeeList* accounts);
static Block5Data* block5_data_ref (Block5Data* _data5_);
static void block5_data_unref (void * _userdata_);
static void __lambda83_ (Block5Data* _data5_,
                  DinoEntitiesAccount* account,
                  XmppJid* jid);
static void dino_ui_roster_list_remove_row (DinoUiRosterList* self,
                                     DinoEntitiesAccount* account,
                                     XmppJid* jid);
static void ___lambda83__dino_roster_manager_removed_roster_item (DinoRosterManager* _sender,
                                                           DinoEntitiesAccount* account,
                                                           XmppJid* jid,
                                                           XmppRosterItem* roster_item,
                                                           gpointer self);
static void _vala_array_add3 (gulong* * array,
                       gint* length,
                       gint* size,
                       gulong value);
static void __lambda84_ (Block5Data* _data5_,
                  DinoEntitiesAccount* account,
                  XmppJid* jid);
static void dino_ui_roster_list_update_row (DinoUiRosterList* self,
                                     DinoEntitiesAccount* account,
                                     XmppJid* jid);
static void ___lambda84__dino_roster_manager_updated_roster_item (DinoRosterManager* _sender,
                                                           DinoEntitiesAccount* account,
                                                           XmppJid* jid,
                                                           XmppRosterItem* roster_item,
                                                           gpointer self);
static void _vala_array_add4 (gulong* * array,
                       gint* length,
                       gint* size,
                       gulong value);
static void __lambda87_ (Block5Data* _data5_);
static void ___lambda87__gtk_widget_destroy (GtkWidget* _sender,
                                      gpointer self);
static void dino_ui_roster_list_fetch_roster_items (DinoUiRosterList* self,
                                             DinoEntitiesAccount* account);
VALA_EXTERN GType dino_ui_list_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiListRow, g_object_unref)
VALA_EXTERN DinoUiListRow* dino_ui_list_row_new_from_jid (DinoStreamInteractor* stream_interactor,
                                              XmppJid* jid,
                                              DinoEntitiesAccount* account,
                                              gboolean show_account);
VALA_EXTERN DinoUiListRow* dino_ui_list_row_construct_from_jid (GType object_type,
                                                    DinoStreamInteractor* stream_interactor,
                                                    XmppJid* jid,
                                                    DinoEntitiesAccount* account,
                                                    gboolean show_account);
static guint _xmpp_jid_hash_func_gee_hash_data_func (gconstpointer v,
                                              gpointer self);
static gboolean _xmpp_jid_equals_func_gee_equal_data_func (gconstpointer a,
                                                    gconstpointer b,
                                                    gpointer self);
VALA_EXTERN GtkListBox* dino_ui_roster_list_get_list_box (DinoUiRosterList* self);
static void dino_ui_roster_list_finalize (DinoUiRosterList * obj);
static GType dino_ui_roster_list_get_type_once (void);

static inline gpointer
dino_ui_roster_list_get_instance_private (DinoUiRosterList* self)
{
	return G_STRUCT_MEMBER_P (self, DinoUiRosterList_private_offset);
}

static guint
_dino_entities_account_hash_func_gee_hash_data_func (gconstpointer v,
                                                     gpointer self)
{
	guint result;
	result = dino_entities_account_hash_func ((DinoEntitiesAccount*) v);
	return result;
}

static gboolean
_dino_entities_account_equals_func_gee_equal_data_func (gconstpointer a,
                                                        gconstpointer b,
                                                        gpointer self)
{
	gboolean result;
	result = dino_entities_account_equals_func ((DinoEntitiesAccount*) a, (DinoEntitiesAccount*) b);
	return result;
}

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

static Block5Data*
block5_data_ref (Block5Data* _data5_)
{
	g_atomic_int_inc (&_data5_->_ref_count_);
	return _data5_;
}

static void
block5_data_unref (void * _userdata_)
{
	Block5Data* _data5_;
	_data5_ = (Block5Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data5_->_ref_count_)) {
		DinoUiRosterList* self;
		self = _data5_->self;
		_g_object_unref0 (_data5_->stream_interactor);
		_g_object_unref0 (_data5_->accounts);
		_dino_ui_roster_list_unref0 (self);
		g_slice_free (Block5Data, _data5_);
	}
}

static void
__lambda83_ (Block5Data* _data5_,
             DinoEntitiesAccount* account,
             XmppJid* jid)
{
	DinoUiRosterList* self;
	self = _data5_->self;
	g_return_if_fail (account != NULL);
	g_return_if_fail (jid != NULL);
	if (gee_collection_contains ((GeeCollection*) _data5_->accounts, account)) {
		dino_ui_roster_list_remove_row (self, account, jid);
	}
}

static void
___lambda83__dino_roster_manager_removed_roster_item (DinoRosterManager* _sender,
                                                      DinoEntitiesAccount* account,
                                                      XmppJid* jid,
                                                      XmppRosterItem* roster_item,
                                                      gpointer self)
{
	__lambda83_ (self, account, jid);
}

static void
_vala_array_add3 (gulong* * array,
                  gint* length,
                  gint* size,
                  gulong value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gulong, *array, *size);
	}
	(*array)[(*length)++] = value;
}

static void
__lambda84_ (Block5Data* _data5_,
             DinoEntitiesAccount* account,
             XmppJid* jid)
{
	DinoUiRosterList* self;
	self = _data5_->self;
	g_return_if_fail (account != NULL);
	g_return_if_fail (jid != NULL);
	if (gee_collection_contains ((GeeCollection*) _data5_->accounts, account)) {
		dino_ui_roster_list_update_row (self, account, jid);
	}
}

static void
___lambda84__dino_roster_manager_updated_roster_item (DinoRosterManager* _sender,
                                                      DinoEntitiesAccount* account,
                                                      XmppJid* jid,
                                                      XmppRosterItem* roster_item,
                                                      gpointer self)
{
	__lambda84_ (self, account, jid);
}

static void
_vala_array_add4 (gulong* * array,
                  gint* length,
                  gint* size,
                  gulong value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gulong, *array, *size);
	}
	(*array)[(*length)++] = value;
}

static void
__lambda87_ (Block5Data* _data5_)
{
	DinoUiRosterList* self;
	gulong* _tmp0_;
	gint _tmp0__length1;
	self = _data5_->self;
	_tmp0_ = self->priv->handler_ids;
	_tmp0__length1 = self->priv->handler_ids_length1;
	{
		gulong* handler_id_collection = NULL;
		gint handler_id_collection_length1 = 0;
		gint _handler_id_collection_size_ = 0;
		gint handler_id_it = 0;
		handler_id_collection = _tmp0_;
		handler_id_collection_length1 = _tmp0__length1;
		for (handler_id_it = 0; handler_id_it < handler_id_collection_length1; handler_id_it = handler_id_it + 1) {
			gulong handler_id = 0UL;
			handler_id = handler_id_collection[handler_id_it];
			{
				DinoModuleIdentity* _tmp1_;
				gpointer _tmp2_;
				DinoRosterManager* _tmp3_;
				_tmp1_ = dino_roster_manager_IDENTITY;
				_tmp2_ = dino_stream_interactor_get_module (_data5_->stream_interactor, DINO_TYPE_ROSTER_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp1_);
				_tmp3_ = (DinoRosterManager*) _tmp2_;
				g_signal_handler_disconnect ((GObject*) _tmp3_, handler_id);
				_g_object_unref0 (_tmp3_);
			}
		}
	}
}

static void
___lambda87__gtk_widget_destroy (GtkWidget* _sender,
                                 gpointer self)
{
	__lambda87_ (self);
}

DinoUiRosterList*
dino_ui_roster_list_construct (GType object_type,
                               DinoStreamInteractor* stream_interactor,
                               GeeList* accounts)
{
	DinoUiRosterList* self = NULL;
	Block5Data* _data5_;
	DinoStreamInteractor* _tmp0_;
	GeeList* _tmp1_;
	DinoStreamInteractor* _tmp2_;
	GeeList* _tmp3_;
	DinoModuleIdentity* _tmp4_;
	gpointer _tmp5_;
	DinoRosterManager* _tmp6_;
	gulong _tmp7_;
	DinoModuleIdentity* _tmp8_;
	gpointer _tmp9_;
	DinoRosterManager* _tmp10_;
	gulong _tmp11_;
	GtkListBox* _tmp12_;
	g_return_val_if_fail (stream_interactor != NULL, NULL);
	g_return_val_if_fail (accounts != NULL, NULL);
	self = (DinoUiRosterList*) g_type_create_instance (object_type);
	_data5_ = g_slice_new0 (Block5Data);
	_data5_->_ref_count_ = 1;
	_data5_->self = dino_ui_roster_list_ref (self);
	_tmp0_ = _g_object_ref0 (stream_interactor);
	_g_object_unref0 (_data5_->stream_interactor);
	_data5_->stream_interactor = _tmp0_;
	_tmp1_ = _g_object_ref0 (accounts);
	_g_object_unref0 (_data5_->accounts);
	_data5_->accounts = _tmp1_;
	_tmp2_ = _g_object_ref0 (_data5_->stream_interactor);
	_g_object_unref0 (self->priv->stream_interactor);
	self->priv->stream_interactor = _tmp2_;
	_tmp3_ = _g_object_ref0 (_data5_->accounts);
	_g_object_unref0 (self->priv->accounts);
	self->priv->accounts = _tmp3_;
	_tmp4_ = dino_roster_manager_IDENTITY;
	_tmp5_ = dino_stream_interactor_get_module (_data5_->stream_interactor, DINO_TYPE_ROSTER_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp4_);
	_tmp6_ = (DinoRosterManager*) _tmp5_;
	_tmp7_ = g_signal_connect_data (_tmp6_, "removed-roster-item", (GCallback) ___lambda83__dino_roster_manager_removed_roster_item, block5_data_ref (_data5_), (GClosureNotify) block5_data_unref, 0);
	_vala_array_add3 (&self->priv->handler_ids, &self->priv->handler_ids_length1, &self->priv->_handler_ids_size_, _tmp7_);
	_g_object_unref0 (_tmp6_);
	_tmp8_ = dino_roster_manager_IDENTITY;
	_tmp9_ = dino_stream_interactor_get_module (_data5_->stream_interactor, DINO_TYPE_ROSTER_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp8_);
	_tmp10_ = (DinoRosterManager*) _tmp9_;
	_tmp11_ = g_signal_connect_data (_tmp10_, "updated-roster-item", (GCallback) ___lambda84__dino_roster_manager_updated_roster_item, block5_data_ref (_data5_), (GClosureNotify) block5_data_unref, 0);
	_vala_array_add4 (&self->priv->handler_ids, &self->priv->handler_ids_length1, &self->priv->_handler_ids_size_, _tmp11_);
	_g_object_unref0 (_tmp10_);
	_tmp12_ = self->priv->list_box;
	g_signal_connect_data ((GtkWidget*) _tmp12_, "destroy", (GCallback) ___lambda87__gtk_widget_destroy, block5_data_ref (_data5_), (GClosureNotify) block5_data_unref, 0);
	{
		GeeList* _a_list = NULL;
		gint _a_size = 0;
		GeeList* _tmp13_;
		gint _tmp14_;
		gint _tmp15_;
		gint _a_index = 0;
		_a_list = _data5_->accounts;
		_tmp13_ = _a_list;
		_tmp14_ = gee_collection_get_size ((GeeCollection*) _tmp13_);
		_tmp15_ = _tmp14_;
		_a_size = _tmp15_;
		_a_index = -1;
		while (TRUE) {
			gint _tmp16_;
			gint _tmp17_;
			DinoEntitiesAccount* a = NULL;
			GeeList* _tmp18_;
			gpointer _tmp19_;
			DinoEntitiesAccount* _tmp20_;
			_a_index = _a_index + 1;
			_tmp16_ = _a_index;
			_tmp17_ = _a_size;
			if (!(_tmp16_ < _tmp17_)) {
				break;
			}
			_tmp18_ = _a_list;
			_tmp19_ = gee_list_get (_tmp18_, _a_index);
			a = (DinoEntitiesAccount*) _tmp19_;
			_tmp20_ = a;
			dino_ui_roster_list_fetch_roster_items (self, _tmp20_);
			_g_object_unref0 (a);
		}
	}
	block5_data_unref (_data5_);
	_data5_ = NULL;
	return self;
}

DinoUiRosterList*
dino_ui_roster_list_new (DinoStreamInteractor* stream_interactor,
                         GeeList* accounts)
{
	return dino_ui_roster_list_construct (DINO_UI_TYPE_ROSTER_LIST, stream_interactor, accounts);
}

static void
dino_ui_roster_list_remove_row (DinoUiRosterList* self,
                                DinoEntitiesAccount* account,
                                XmppJid* jid)
{
	gboolean _tmp0_ = FALSE;
	GeeHashMap* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (jid != NULL);
	_tmp1_ = self->priv->rows;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp1_, account)) {
		GeeHashMap* _tmp2_;
		gpointer _tmp3_;
		GeeHashMap* _tmp4_;
		_tmp2_ = self->priv->rows;
		_tmp3_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp2_, account);
		_tmp4_ = (GeeHashMap*) _tmp3_;
		_tmp0_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp4_, jid);
		_g_object_unref0 (_tmp4_);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GtkListBox* _tmp5_;
		GeeHashMap* _tmp6_;
		gpointer _tmp7_;
		GeeHashMap* _tmp8_;
		gpointer _tmp9_;
		GtkListBoxRow* _tmp10_;
		GeeHashMap* _tmp11_;
		gpointer _tmp12_;
		GeeHashMap* _tmp13_;
		_tmp5_ = self->priv->list_box;
		_tmp6_ = self->priv->rows;
		_tmp7_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp6_, account);
		_tmp8_ = (GeeHashMap*) _tmp7_;
		_tmp9_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp8_, jid);
		_tmp10_ = (GtkListBoxRow*) _tmp9_;
		gtk_list_box_remove (_tmp5_, (GtkWidget*) _tmp10_);
		_g_object_unref0 (_tmp10_);
		_g_object_unref0 (_tmp8_);
		_tmp11_ = self->priv->rows;
		_tmp12_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp11_, account);
		_tmp13_ = (GeeHashMap*) _tmp12_;
		gee_abstract_map_unset ((GeeAbstractMap*) _tmp13_, jid, NULL);
		_g_object_unref0 (_tmp13_);
	}
}

static void
dino_ui_roster_list_update_row (DinoUiRosterList* self,
                                DinoEntitiesAccount* account,
                                XmppJid* jid)
{
	DinoUiListRow* row = NULL;
	DinoStreamInteractor* _tmp0_;
	GeeList* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	DinoUiListRow* _tmp4_;
	GtkListBoxRow* list_box_row = NULL;
	GtkWidget* _tmp5_;
	GtkListBoxRow* _tmp6_ = NULL;
	GeeHashMap* _tmp7_;
	gpointer _tmp8_;
	GeeHashMap* _tmp9_;
	GtkListBox* _tmp10_;
	GtkListBox* _tmp11_;
	GtkListBox* _tmp12_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (jid != NULL);
	dino_ui_roster_list_remove_row (self, account, jid);
	_tmp0_ = self->priv->stream_interactor;
	_tmp1_ = self->priv->accounts;
	_tmp2_ = gee_collection_get_size ((GeeCollection*) _tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = dino_ui_list_row_new_from_jid (_tmp0_, jid, account, _tmp3_ > 1);
	g_object_ref_sink (_tmp4_);
	row = _tmp4_;
	_tmp5_ = _g_object_ref0 ((GtkWidget*) row);
	_tmp6_ = (GtkListBoxRow*) gtk_list_box_row_new ();
	gtk_list_box_row_set_child (_tmp6_, _tmp5_);
	_g_object_unref0 (_tmp5_);
	g_object_ref_sink (_tmp6_);
	list_box_row = _tmp6_;
	_tmp7_ = self->priv->rows;
	_tmp8_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp7_, account);
	_tmp9_ = (GeeHashMap*) _tmp8_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp9_, jid, list_box_row);
	_g_object_unref0 (_tmp9_);
	_tmp10_ = self->priv->list_box;
	gtk_list_box_append (_tmp10_, (GtkWidget*) list_box_row);
	_tmp11_ = self->priv->list_box;
	gtk_list_box_invalidate_sort (_tmp11_);
	_tmp12_ = self->priv->list_box;
	gtk_list_box_invalidate_filter (_tmp12_);
	_g_object_unref0 (list_box_row);
	_g_object_unref0 (row);
}

static guint
_xmpp_jid_hash_func_gee_hash_data_func (gconstpointer v,
                                        gpointer self)
{
	guint result;
	result = xmpp_jid_hash_func ((XmppJid*) v);
	return result;
}

static gboolean
_xmpp_jid_equals_func_gee_equal_data_func (gconstpointer a,
                                           gconstpointer b,
                                           gpointer self)
{
	gboolean result;
	result = xmpp_jid_equals_func ((XmppJid*) a, (XmppJid*) b);
	return result;
}

static void
dino_ui_roster_list_fetch_roster_items (DinoUiRosterList* self,
                                        DinoEntitiesAccount* account)
{
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	GeeHashMap* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	_tmp0_ = self->priv->rows;
	_tmp1_ = gee_hash_map_new (XMPP_TYPE_JID, (GBoxedCopyFunc) xmpp_jid_ref, (GDestroyNotify) xmpp_jid_unref, gtk_list_box_row_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _xmpp_jid_hash_func_gee_hash_data_func, NULL, NULL, _xmpp_jid_equals_func_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
	_tmp2_ = _tmp1_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp0_, account, _tmp2_);
	_g_object_unref0 (_tmp2_);
	{
		GeeIterator* _roster_item_it = NULL;
		DinoStreamInteractor* _tmp3_;
		DinoModuleIdentity* _tmp4_;
		gpointer _tmp5_;
		DinoRosterManager* _tmp6_;
		GeeCollection* _tmp7_;
		GeeCollection* _tmp8_;
		GeeIterator* _tmp9_;
		GeeIterator* _tmp10_;
		_tmp3_ = self->priv->stream_interactor;
		_tmp4_ = dino_roster_manager_IDENTITY;
		_tmp5_ = dino_stream_interactor_get_module (_tmp3_, DINO_TYPE_ROSTER_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp4_);
		_tmp6_ = (DinoRosterManager*) _tmp5_;
		_tmp7_ = dino_roster_manager_get_roster (_tmp6_, account);
		_tmp8_ = _tmp7_;
		_tmp9_ = gee_iterable_iterator ((GeeIterable*) _tmp8_);
		_tmp10_ = _tmp9_;
		_g_object_unref0 (_tmp8_);
		_g_object_unref0 (_tmp6_);
		_roster_item_it = _tmp10_;
		while (TRUE) {
			GeeIterator* _tmp11_;
			XmppRosterItem* roster_item = NULL;
			GeeIterator* _tmp12_;
			gpointer _tmp13_;
			XmppRosterItem* _tmp14_;
			XmppJid* _tmp15_;
			XmppJid* _tmp16_;
			_tmp11_ = _roster_item_it;
			if (!gee_iterator_next (_tmp11_)) {
				break;
			}
			_tmp12_ = _roster_item_it;
			_tmp13_ = gee_iterator_get (_tmp12_);
			roster_item = (XmppRosterItem*) _tmp13_;
			_tmp14_ = roster_item;
			_tmp15_ = xmpp_roster_item_get_jid (_tmp14_);
			_tmp16_ = _tmp15_;
			dino_ui_roster_list_update_row (self, account, _tmp16_);
			_xmpp_roster_item_unref0 (roster_item);
		}
		_g_object_unref0 (_roster_item_it);
	}
}

GtkListBox*
dino_ui_roster_list_get_list_box (DinoUiRosterList* self)
{
	GtkListBox* _tmp0_;
	GtkListBox* _tmp1_;
	GtkListBox* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->list_box;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
dino_ui_value_roster_list_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
dino_ui_value_roster_list_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		dino_ui_roster_list_unref (value->data[0].v_pointer);
	}
}

static void
dino_ui_value_roster_list_copy_value (const GValue* src_value,
                                      GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = dino_ui_roster_list_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
dino_ui_value_roster_list_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
dino_ui_value_roster_list_collect_value (GValue* value,
                                         guint n_collect_values,
                                         GTypeCValue* collect_values,
                                         guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		DinoUiRosterList * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = dino_ui_roster_list_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
dino_ui_value_roster_list_lcopy_value (const GValue* value,
                                       guint n_collect_values,
                                       GTypeCValue* collect_values,
                                       guint collect_flags)
{
	DinoUiRosterList ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = dino_ui_roster_list_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
dino_ui_param_spec_roster_list (const gchar* name,
                                const gchar* nick,
                                const gchar* blurb,
                                GType object_type,
                                GParamFlags flags)
{
	DinoUiParamSpecRosterList* spec;
	g_return_val_if_fail (g_type_is_a (object_type, DINO_UI_TYPE_ROSTER_LIST), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

gpointer
dino_ui_value_get_roster_list (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, DINO_UI_TYPE_ROSTER_LIST), NULL);
	return value->data[0].v_pointer;
}

void
dino_ui_value_set_roster_list (GValue* value,
                               gpointer v_object)
{
	DinoUiRosterList * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, DINO_UI_TYPE_ROSTER_LIST));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, DINO_UI_TYPE_ROSTER_LIST));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		dino_ui_roster_list_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		dino_ui_roster_list_unref (old);
	}
}

void
dino_ui_value_take_roster_list (GValue* value,
                                gpointer v_object)
{
	DinoUiRosterList * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, DINO_UI_TYPE_ROSTER_LIST));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, DINO_UI_TYPE_ROSTER_LIST));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		dino_ui_roster_list_unref (old);
	}
}

static void
dino_ui_roster_list_class_init (DinoUiRosterListClass * klass,
                                gpointer klass_data)
{
	dino_ui_roster_list_parent_class = g_type_class_peek_parent (klass);
	((DinoUiRosterListClass *) klass)->finalize = dino_ui_roster_list_finalize;
	g_type_class_adjust_private_offset (klass, &DinoUiRosterList_private_offset);
	dino_ui_roster_list_signals[DINO_UI_ROSTER_LIST_CONVERSATION_SELECTED_SIGNAL] = g_signal_new ("conversation-selected", DINO_UI_TYPE_ROSTER_LIST, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, DINO_ENTITIES_TYPE_CONVERSATION);
}

static void
dino_ui_roster_list_instance_init (DinoUiRosterList * self,
                                   gpointer klass)
{
	gulong* _tmp0_;
	GtkListBox* _tmp1_;
	GeeHashMap* _tmp2_;
	self->priv = dino_ui_roster_list_get_instance_private (self);
	_tmp0_ = g_new0 (gulong, 0);
	self->priv->handler_ids = _tmp0_;
	self->priv->handler_ids_length1 = 0;
	self->priv->_handler_ids_size_ = self->priv->handler_ids_length1;
	_tmp1_ = (GtkListBox*) gtk_list_box_new ();
	g_object_ref_sink (_tmp1_);
	self->priv->list_box = _tmp1_;
	_tmp2_ = gee_hash_map_new (DINO_ENTITIES_TYPE_ACCOUNT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, GEE_TYPE_HASH_MAP, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _dino_entities_account_hash_func_gee_hash_data_func, NULL, NULL, _dino_entities_account_equals_func_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
	self->priv->rows = _tmp2_;
	self->ref_count = 1;
}

static void
dino_ui_roster_list_finalize (DinoUiRosterList * obj)
{
	DinoUiRosterList * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_TYPE_ROSTER_LIST, DinoUiRosterList);
	g_signal_handlers_destroy (self);
	_g_object_unref0 (self->priv->stream_interactor);
	_g_object_unref0 (self->priv->accounts);
	self->priv->handler_ids = (g_free (self->priv->handler_ids), NULL);
	_g_object_unref0 (self->priv->list_box);
	_g_object_unref0 (self->priv->rows);
}

static GType
dino_ui_roster_list_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { dino_ui_value_roster_list_init, dino_ui_value_roster_list_free_value, dino_ui_value_roster_list_copy_value, dino_ui_value_roster_list_peek_pointer, "p", dino_ui_value_roster_list_collect_value, "p", dino_ui_value_roster_list_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (DinoUiRosterListClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_ui_roster_list_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoUiRosterList), 0, (GInstanceInitFunc) dino_ui_roster_list_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType dino_ui_roster_list_type_id;
	dino_ui_roster_list_type_id = g_type_register_fundamental (g_type_fundamental_next (), "DinoUiRosterList", &g_define_type_info, &g_define_type_fundamental_info, 0);
	DinoUiRosterList_private_offset = g_type_add_instance_private (dino_ui_roster_list_type_id, sizeof (DinoUiRosterListPrivate));
	return dino_ui_roster_list_type_id;
}

GType
dino_ui_roster_list_get_type (void)
{
	static volatile gsize dino_ui_roster_list_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_roster_list_type_id__once)) {
		GType dino_ui_roster_list_type_id;
		dino_ui_roster_list_type_id = dino_ui_roster_list_get_type_once ();
		g_once_init_leave (&dino_ui_roster_list_type_id__once, dino_ui_roster_list_type_id);
	}
	return dino_ui_roster_list_type_id__once;
}

gpointer
dino_ui_roster_list_ref (gpointer instance)
{
	DinoUiRosterList * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

void
dino_ui_roster_list_unref (gpointer instance)
{
	DinoUiRosterList * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		DINO_UI_ROSTER_LIST_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

