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

#include <gtk/gtk.h>
#include <glib-object.h>
#include "libdino.h"
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "xmpp-vala.h"
#include <gio/gio.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_SELECT_JID_FRAGMENT (dino_ui_select_jid_fragment_get_type ())
#define DINO_UI_SELECT_JID_FRAGMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_TYPE_SELECT_JID_FRAGMENT, DinoUiSelectJidFragment))
#define DINO_UI_SELECT_JID_FRAGMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_TYPE_SELECT_JID_FRAGMENT, DinoUiSelectJidFragmentClass))
#define DINO_UI_IS_SELECT_JID_FRAGMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_TYPE_SELECT_JID_FRAGMENT))
#define DINO_UI_IS_SELECT_JID_FRAGMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_TYPE_SELECT_JID_FRAGMENT))
#define DINO_UI_SELECT_JID_FRAGMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_TYPE_SELECT_JID_FRAGMENT, DinoUiSelectJidFragmentClass))

typedef struct _DinoUiSelectJidFragment DinoUiSelectJidFragment;
typedef struct _DinoUiSelectJidFragmentClass DinoUiSelectJidFragmentClass;
typedef struct _DinoUiSelectJidFragmentPrivate DinoUiSelectJidFragmentPrivate;
enum  {
	DINO_UI_SELECT_JID_FRAGMENT_0_PROPERTY,
	DINO_UI_SELECT_JID_FRAGMENT_DONE_PROPERTY,
	DINO_UI_SELECT_JID_FRAGMENT_NUM_PROPERTIES
};
static GParamSpec* dino_ui_select_jid_fragment_properties[DINO_UI_SELECT_JID_FRAGMENT_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block7Data Block7Data;

#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 DINO_UI_SELECT_JID_FRAGMENT_TYPE_ADD_LIST_ROW (dino_ui_select_jid_fragment_add_list_row_get_type ())
#define DINO_UI_SELECT_JID_FRAGMENT_ADD_LIST_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_SELECT_JID_FRAGMENT_TYPE_ADD_LIST_ROW, DinoUiSelectJidFragmentAddListRow))
#define DINO_UI_SELECT_JID_FRAGMENT_ADD_LIST_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_SELECT_JID_FRAGMENT_TYPE_ADD_LIST_ROW, DinoUiSelectJidFragmentAddListRowClass))
#define DINO_UI_SELECT_JID_FRAGMENT_IS_ADD_LIST_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_SELECT_JID_FRAGMENT_TYPE_ADD_LIST_ROW))
#define DINO_UI_SELECT_JID_FRAGMENT_IS_ADD_LIST_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_SELECT_JID_FRAGMENT_TYPE_ADD_LIST_ROW))
#define DINO_UI_SELECT_JID_FRAGMENT_ADD_LIST_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_SELECT_JID_FRAGMENT_TYPE_ADD_LIST_ROW, DinoUiSelectJidFragmentAddListRowClass))

typedef struct _DinoUiSelectJidFragmentAddListRow DinoUiSelectJidFragmentAddListRow;
typedef struct _DinoUiSelectJidFragmentAddListRowClass DinoUiSelectJidFragmentAddListRowClass;
#define _xmpp_jid_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_jid_unref (var), NULL)))
typedef struct _DinoUiListRowPrivate DinoUiListRowPrivate;

#define DINO_UI_TYPE_AVATAR_PICTURE (dino_ui_avatar_picture_get_type ())
#define DINO_UI_AVATAR_PICTURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_TYPE_AVATAR_PICTURE, DinoUiAvatarPicture))
#define DINO_UI_AVATAR_PICTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_TYPE_AVATAR_PICTURE, DinoUiAvatarPictureClass))
#define DINO_UI_IS_AVATAR_PICTURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_TYPE_AVATAR_PICTURE))
#define DINO_UI_IS_AVATAR_PICTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_TYPE_AVATAR_PICTURE))
#define DINO_UI_AVATAR_PICTURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_TYPE_AVATAR_PICTURE, DinoUiAvatarPictureClass))

typedef struct _DinoUiAvatarPicture DinoUiAvatarPicture;
typedef struct _DinoUiAvatarPictureClass DinoUiAvatarPictureClass;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _DinoUiSelectJidFragmentAddListRowPrivate DinoUiSelectJidFragmentAddListRowPrivate;
enum  {
	DINO_UI_SELECT_JID_FRAGMENT_ADD_LIST_ROW_0_PROPERTY,
	DINO_UI_SELECT_JID_FRAGMENT_ADD_LIST_ROW_NUM_PROPERTIES
};
static GParamSpec* dino_ui_select_jid_fragment_add_list_row_properties[DINO_UI_SELECT_JID_FRAGMENT_ADD_LIST_ROW_NUM_PROPERTIES];

#define DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_MODEL (dino_ui_view_model_avatar_picture_model_get_type ())
#define DINO_UI_VIEW_MODEL_AVATAR_PICTURE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_MODEL, DinoUiViewModelAvatarPictureModel))
#define DINO_UI_VIEW_MODEL_AVATAR_PICTURE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_MODEL, DinoUiViewModelAvatarPictureModelClass))
#define DINO_UI_VIEW_MODEL_IS_AVATAR_PICTURE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_MODEL))
#define DINO_UI_VIEW_MODEL_IS_AVATAR_PICTURE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_MODEL))
#define DINO_UI_VIEW_MODEL_AVATAR_PICTURE_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_MODEL, DinoUiViewModelAvatarPictureModelClass))

typedef struct _DinoUiViewModelAvatarPictureModel DinoUiViewModelAvatarPictureModel;
typedef struct _DinoUiViewModelAvatarPictureModelClass DinoUiViewModelAvatarPictureModelClass;

#define DINO_UI_VIEW_MODEL_TYPE_COMPAT_AVATAR_PICTURE_MODEL (dino_ui_view_model_compat_avatar_picture_model_get_type ())
#define DINO_UI_VIEW_MODEL_COMPAT_AVATAR_PICTURE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_VIEW_MODEL_TYPE_COMPAT_AVATAR_PICTURE_MODEL, DinoUiViewModelCompatAvatarPictureModel))
#define DINO_UI_VIEW_MODEL_COMPAT_AVATAR_PICTURE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_VIEW_MODEL_TYPE_COMPAT_AVATAR_PICTURE_MODEL, DinoUiViewModelCompatAvatarPictureModelClass))
#define DINO_UI_VIEW_MODEL_IS_COMPAT_AVATAR_PICTURE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_VIEW_MODEL_TYPE_COMPAT_AVATAR_PICTURE_MODEL))
#define DINO_UI_VIEW_MODEL_IS_COMPAT_AVATAR_PICTURE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_VIEW_MODEL_TYPE_COMPAT_AVATAR_PICTURE_MODEL))
#define DINO_UI_VIEW_MODEL_COMPAT_AVATAR_PICTURE_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_VIEW_MODEL_TYPE_COMPAT_AVATAR_PICTURE_MODEL, DinoUiViewModelCompatAvatarPictureModelClass))

typedef struct _DinoUiViewModelCompatAvatarPictureModel DinoUiViewModelCompatAvatarPictureModel;
typedef struct _DinoUiViewModelCompatAvatarPictureModelClass DinoUiViewModelCompatAvatarPictureModelClass;
enum  {
	DINO_UI_SELECT_JID_FRAGMENT_ADD_JID_SIGNAL,
	DINO_UI_SELECT_JID_FRAGMENT_REMOVE_JID_SIGNAL,
	DINO_UI_SELECT_JID_FRAGMENT_NUM_SIGNALS
};
static guint dino_ui_select_jid_fragment_signals[DINO_UI_SELECT_JID_FRAGMENT_NUM_SIGNALS] = {0};

struct _DinoUiSelectJidFragment {
	GtkBox parent_instance;
	DinoUiSelectJidFragmentPrivate * priv;
};

struct _DinoUiSelectJidFragmentClass {
	GtkBoxClass parent_class;
};

struct _DinoUiSelectJidFragmentPrivate {
	GtkEntry* entry;
	GtkBox* box;
	GtkButton* add_button;
	GtkButton* remove_button;
	DinoStreamInteractor* stream_interactor;
	GeeList* accounts;
	GeeArrayList* added_rows;
	GtkListBox* list;
	gchar** filter_values;
	gint filter_values_length1;
	gint _filter_values_size_;
};

struct _Block7Data {
	int _ref_count_;
	DinoUiSelectJidFragment* self;
	GtkListBox* list;
};

struct _DinoUiListRow {
	GtkWidget parent_instance;
	DinoUiListRowPrivate * priv;
	GtkBox* outer_box;
	DinoUiAvatarPicture* picture;
	GtkLabel* name_label;
	GtkImage* status_dot;
	GtkLabel* via_label;
	DinoStreamInteractor* stream_interactor;
	XmppJid* jid;
	DinoEntitiesAccount* account;
};

struct _DinoUiListRowClass {
	GtkWidgetClass parent_class;
};

struct _DinoUiSelectJidFragmentAddListRow {
	DinoUiListRow parent_instance;
	DinoUiSelectJidFragmentAddListRowPrivate * priv;
};

struct _DinoUiSelectJidFragmentAddListRowClass {
	DinoUiListRowClass parent_class;
};

static gint DinoUiSelectJidFragment_private_offset;
static gpointer dino_ui_select_jid_fragment_parent_class = NULL;
static gpointer dino_ui_select_jid_fragment_add_list_row_parent_class = NULL;

VALA_EXTERN GType dino_ui_select_jid_fragment_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiSelectJidFragment, g_object_unref)
VALA_EXTERN DinoUiSelectJidFragment* dino_ui_select_jid_fragment_new (DinoStreamInteractor* stream_interactor,
                                                          GtkListBox* list,
                                                          GeeList* accounts);
VALA_EXTERN DinoUiSelectJidFragment* dino_ui_select_jid_fragment_construct (GType object_type,
                                                                DinoStreamInteractor* stream_interactor,
                                                                GtkListBox* list,
                                                                GeeList* accounts);
static Block7Data* block7_data_ref (Block7Data* _data7_);
static void block7_data_unref (void * _userdata_);
static gint dino_ui_select_jid_fragment_sort (DinoUiSelectJidFragment* self,
                                       GtkListBoxRow* row1,
                                       GtkListBoxRow* row2);
static gint _dino_ui_select_jid_fragment_sort_gtk_list_box_sort_func (GtkListBoxRow* row1,
                                                               GtkListBoxRow* row2,
                                                               gpointer self);
static gboolean dino_ui_select_jid_fragment_filter (DinoUiSelectJidFragment* self,
                                             GtkListBoxRow* r);
static gboolean _dino_ui_select_jid_fragment_filter_gtk_list_box_filter_func (GtkListBoxRow* row,
                                                                       gpointer self);
static void dino_ui_select_jid_fragment_header (DinoUiSelectJidFragment* self,
                                         GtkListBoxRow* row,
                                         GtkListBoxRow* before_row);
static void _dino_ui_select_jid_fragment_header_gtk_list_box_update_header_func (GtkListBoxRow* row,
                                                                          GtkListBoxRow* before,
                                                                          gpointer self);
static void dino_ui_select_jid_fragment_check_buttons_active (DinoUiSelectJidFragment* self);
static void _dino_ui_select_jid_fragment_check_buttons_active_gtk_list_box_row_selected (GtkListBox* _sender,
                                                                                  GtkListBoxRow* row,
                                                                                  gpointer self);
static void __lambda88_ (DinoUiSelectJidFragment* self);
static void dino_ui_select_jid_fragment_set_done (DinoUiSelectJidFragment* self,
                                           gboolean value);
static void ___lambda88__gtk_list_box_row_selected (GtkListBox* _sender,
                                             GtkListBoxRow* row,
                                             gpointer self);
static void __lambda89_ (DinoUiSelectJidFragment* self);
VALA_EXTERN void dino_ui_select_jid_fragment_set_filter (DinoUiSelectJidFragment* self,
                                             const gchar* str);
static void ___lambda89__gtk_editable_changed (GtkEditable* _sender,
                                        gpointer self);
static void __lambda90_ (DinoUiSelectJidFragment* self);
static void ___lambda90__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static void __lambda91_ (Block7Data* _data7_);
VALA_EXTERN GType dino_ui_list_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiListRow, g_object_unref)
static void ___lambda91__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static DinoUiSelectJidFragmentAddListRow* dino_ui_select_jid_fragment_add_list_row_new (DinoStreamInteractor* stream_interactor,
                                                                                 XmppJid* jid,
                                                                                 DinoEntitiesAccount* account);
static DinoUiSelectJidFragmentAddListRow* dino_ui_select_jid_fragment_add_list_row_construct (GType object_type,
                                                                                       DinoStreamInteractor* stream_interactor,
                                                                                       XmppJid* jid,
                                                                                       DinoEntitiesAccount* account);
static GType dino_ui_select_jid_fragment_add_list_row_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiSelectJidFragmentAddListRow, g_object_unref)
VALA_EXTERN GType dino_ui_avatar_picture_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiAvatarPicture, g_object_unref)
VALA_EXTERN gboolean dino_ui_select_jid_fragment_get_done (DinoUiSelectJidFragment* self);
VALA_EXTERN DinoUiListRow* dino_ui_list_row_new (void);
VALA_EXTERN DinoUiListRow* dino_ui_list_row_construct (GType object_type);
VALA_EXTERN DinoUiViewModelCompatAvatarPictureModel* dino_ui_view_model_compat_avatar_picture_model_new (DinoStreamInteractor* stream_interactor);
VALA_EXTERN DinoUiViewModelCompatAvatarPictureModel* dino_ui_view_model_compat_avatar_picture_model_construct (GType object_type,
                                                                                                   DinoStreamInteractor* stream_interactor);
VALA_EXTERN GType dino_ui_view_model_avatar_picture_model_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiViewModelAvatarPictureModel, g_object_unref)
VALA_EXTERN GType dino_ui_view_model_compat_avatar_picture_model_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiViewModelCompatAvatarPictureModel, g_object_unref)
VALA_EXTERN DinoUiViewModelCompatAvatarPictureModel* dino_ui_view_model_compat_avatar_picture_model_add (DinoUiViewModelCompatAvatarPictureModel* self,
                                                                                             const gchar* display,
                                                                                             const gchar* color_id,
                                                                                             GFile* image_file);
VALA_EXTERN void dino_ui_avatar_picture_set_model (DinoUiAvatarPicture* self,
                                       DinoUiViewModelAvatarPictureModel* value);
static GType dino_ui_select_jid_fragment_add_list_row_get_type_once (void);
static void dino_ui_select_jid_fragment_finalize (GObject * obj);
static GType dino_ui_select_jid_fragment_get_type_once (void);
static void _vala_dino_ui_select_jid_fragment_get_property (GObject * object,
                                                     guint property_id,
                                                     GValue * value,
                                                     GParamSpec * pspec);
static void _vala_dino_ui_select_jid_fragment_set_property (GObject * object,
                                                     guint property_id,
                                                     const GValue * value,
                                                     GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);

static inline gpointer
dino_ui_select_jid_fragment_get_instance_private (DinoUiSelectJidFragment* self)
{
	return G_STRUCT_MEMBER_P (self, DinoUiSelectJidFragment_private_offset);
}

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

static Block7Data*
block7_data_ref (Block7Data* _data7_)
{
	g_atomic_int_inc (&_data7_->_ref_count_);
	return _data7_;
}

static void
block7_data_unref (void * _userdata_)
{
	Block7Data* _data7_;
	_data7_ = (Block7Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data7_->_ref_count_)) {
		DinoUiSelectJidFragment* self;
		self = _data7_->self;
		_g_object_unref0 (_data7_->list);
		_g_object_unref0 (self);
		g_slice_free (Block7Data, _data7_);
	}
}

static gint
_dino_ui_select_jid_fragment_sort_gtk_list_box_sort_func (GtkListBoxRow* row1,
                                                          GtkListBoxRow* row2,
                                                          gpointer self)
{
	gint result;
	result = dino_ui_select_jid_fragment_sort ((DinoUiSelectJidFragment*) self, row1, row2);
	return result;
}

static gboolean
_dino_ui_select_jid_fragment_filter_gtk_list_box_filter_func (GtkListBoxRow* row,
                                                              gpointer self)
{
	gboolean result;
	result = dino_ui_select_jid_fragment_filter ((DinoUiSelectJidFragment*) self, row);
	return result;
}

static void
_dino_ui_select_jid_fragment_header_gtk_list_box_update_header_func (GtkListBoxRow* row,
                                                                     GtkListBoxRow* before,
                                                                     gpointer self)
{
	dino_ui_select_jid_fragment_header ((DinoUiSelectJidFragment*) self, row, before);
}

static void
_dino_ui_select_jid_fragment_check_buttons_active_gtk_list_box_row_selected (GtkListBox* _sender,
                                                                             GtkListBoxRow* row,
                                                                             gpointer self)
{
	dino_ui_select_jid_fragment_check_buttons_active ((DinoUiSelectJidFragment*) self);
}

static void
__lambda88_ (DinoUiSelectJidFragment* self)
{
	dino_ui_select_jid_fragment_set_done (self, TRUE);
}

static void
___lambda88__gtk_list_box_row_selected (GtkListBox* _sender,
                                        GtkListBoxRow* row,
                                        gpointer self)
{
	__lambda88_ ((DinoUiSelectJidFragment*) self);
}

static void
__lambda89_ (DinoUiSelectJidFragment* self)
{
	GtkEntry* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	_tmp0_ = self->priv->entry;
	_tmp1_ = gtk_editable_get_text ((GtkEditable*) _tmp0_);
	_tmp2_ = _tmp1_;
	dino_ui_select_jid_fragment_set_filter (self, _tmp2_);
}

static void
___lambda89__gtk_editable_changed (GtkEditable* _sender,
                                   gpointer self)
{
	__lambda89_ ((DinoUiSelectJidFragment*) self);
}

static void
__lambda90_ (DinoUiSelectJidFragment* self)
{
	g_signal_emit (self, dino_ui_select_jid_fragment_signals[DINO_UI_SELECT_JID_FRAGMENT_ADD_JID_SIGNAL], 0);
}

static void
___lambda90__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda90_ ((DinoUiSelectJidFragment*) self);
}

static void
__lambda91_ (Block7Data* _data7_)
{
	DinoUiSelectJidFragment* self;
	GtkListBoxRow* list_row = NULL;
	GtkListBoxRow* _tmp0_;
	GtkListBoxRow* _tmp1_;
	GtkListBoxRow* _tmp2_;
	GtkListBoxRow* _tmp3_;
	GtkWidget* _tmp4_;
	GtkWidget* _tmp5_;
	self = _data7_->self;
	_tmp0_ = gtk_list_box_get_selected_row (_data7_->list);
	_tmp1_ = _g_object_ref0 (_tmp0_);
	list_row = _tmp1_;
	_tmp2_ = list_row;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (list_row);
		return;
	}
	_tmp3_ = list_row;
	_tmp4_ = gtk_list_box_row_get_child (_tmp3_);
	_tmp5_ = _tmp4_;
	g_signal_emit (self, dino_ui_select_jid_fragment_signals[DINO_UI_SELECT_JID_FRAGMENT_REMOVE_JID_SIGNAL], 0, DINO_UI_IS_LIST_ROW (_tmp5_) ? ((DinoUiListRow*) _tmp5_) : NULL);
	_g_object_unref0 (list_row);
}

static void
___lambda91__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda91_ (self);
}

DinoUiSelectJidFragment*
dino_ui_select_jid_fragment_construct (GType object_type,
                                       DinoStreamInteractor* stream_interactor,
                                       GtkListBox* list,
                                       GeeList* accounts)
{
	DinoUiSelectJidFragment * self = NULL;
	Block7Data* _data7_;
	GtkListBox* _tmp0_;
	DinoStreamInteractor* _tmp1_;
	GtkListBox* _tmp2_;
	GeeList* _tmp3_;
	GtkBox* _tmp4_;
	GtkEntry* _tmp5_;
	GtkButton* _tmp6_;
	GtkButton* _tmp7_;
	g_return_val_if_fail (stream_interactor != NULL, NULL);
	g_return_val_if_fail (list != NULL, NULL);
	g_return_val_if_fail (accounts != NULL, NULL);
	_data7_ = g_slice_new0 (Block7Data);
	_data7_->_ref_count_ = 1;
	_tmp0_ = _g_object_ref0 (list);
	_g_object_unref0 (_data7_->list);
	_data7_->list = _tmp0_;
	self = (DinoUiSelectJidFragment*) g_object_new (object_type, NULL);
	_data7_->self = g_object_ref (self);
	_tmp1_ = _g_object_ref0 (stream_interactor);
	_g_object_unref0 (self->priv->stream_interactor);
	self->priv->stream_interactor = _tmp1_;
	_tmp2_ = _g_object_ref0 (_data7_->list);
	_g_object_unref0 (self->priv->list);
	self->priv->list = _tmp2_;
	_tmp3_ = _g_object_ref0 (accounts);
	_g_object_unref0 (self->priv->accounts);
	self->priv->accounts = _tmp3_;
	gtk_list_box_set_activate_on_single_click (_data7_->list, FALSE);
	gtk_widget_set_vexpand ((GtkWidget*) _data7_->list, TRUE);
	_tmp4_ = self->priv->box;
	gtk_box_append (_tmp4_, (GtkWidget*) _data7_->list);
	gtk_list_box_set_sort_func (_data7_->list, _dino_ui_select_jid_fragment_sort_gtk_list_box_sort_func, g_object_ref (self), g_object_unref);
	gtk_list_box_set_filter_func (_data7_->list, _dino_ui_select_jid_fragment_filter_gtk_list_box_filter_func, g_object_ref (self), g_object_unref);
	gtk_list_box_set_header_func (_data7_->list, _dino_ui_select_jid_fragment_header_gtk_list_box_update_header_func, g_object_ref (self), g_object_unref);
	g_signal_connect_object (_data7_->list, "row-selected", (GCallback) _dino_ui_select_jid_fragment_check_buttons_active_gtk_list_box_row_selected, self, 0);
	g_signal_connect_object (_data7_->list, "row-selected", (GCallback) ___lambda88__gtk_list_box_row_selected, self, 0);
	_tmp5_ = self->priv->entry;
	g_signal_connect_object ((GtkEditable*) _tmp5_, "changed", (GCallback) ___lambda89__gtk_editable_changed, self, 0);
	_tmp6_ = self->priv->add_button;
	g_signal_connect_object (_tmp6_, "clicked", (GCallback) ___lambda90__gtk_button_clicked, self, 0);
	_tmp7_ = self->priv->remove_button;
	g_signal_connect_data (_tmp7_, "clicked", (GCallback) ___lambda91__gtk_button_clicked, block7_data_ref (_data7_), (GClosureNotify) block7_data_unref, 0);
	block7_data_unref (_data7_);
	_data7_ = NULL;
	return self;
}

DinoUiSelectJidFragment*
dino_ui_select_jid_fragment_new (DinoStreamInteractor* stream_interactor,
                                 GtkListBox* list,
                                 GeeList* accounts)
{
	return dino_ui_select_jid_fragment_construct (DINO_UI_TYPE_SELECT_JID_FRAGMENT, stream_interactor, list, accounts);
}

void
dino_ui_select_jid_fragment_set_filter (DinoUiSelectJidFragment* self,
                                        const gchar* str)
{
	GtkEntry* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	GeeArrayList* _tmp14_;
	gchar** _tmp15_ = NULL;
	gint _tmp15__length1 = 0;
	gint __tmp15__size_ = 0;
	gchar** _tmp18_;
	gint _tmp18__length1;
	GtkListBox* _tmp19_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (str != NULL);
	_tmp0_ = self->priv->entry;
	_tmp1_ = gtk_editable_get_text ((GtkEditable*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (g_strcmp0 (_tmp2_, str) != 0) {
		GtkEntry* _tmp3_;
		_tmp3_ = self->priv->entry;
		gtk_editable_set_text ((GtkEditable*) _tmp3_, str);
	}
	{
		GeeArrayList* _row_list = NULL;
		GeeArrayList* _tmp4_;
		gint _row_size = 0;
		GeeArrayList* _tmp5_;
		gint _tmp6_;
		gint _tmp7_;
		gint _row_index = 0;
		_tmp4_ = self->priv->added_rows;
		_row_list = _tmp4_;
		_tmp5_ = _row_list;
		_tmp6_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp5_);
		_tmp7_ = _tmp6_;
		_row_size = _tmp7_;
		_row_index = -1;
		while (TRUE) {
			gint _tmp8_;
			gint _tmp9_;
			GtkWidget* row = NULL;
			GeeArrayList* _tmp10_;
			gpointer _tmp11_;
			GtkListBox* _tmp12_;
			GtkWidget* _tmp13_;
			_row_index = _row_index + 1;
			_tmp8_ = _row_index;
			_tmp9_ = _row_size;
			if (!(_tmp8_ < _tmp9_)) {
				break;
			}
			_tmp10_ = _row_list;
			_tmp11_ = gee_abstract_list_get ((GeeAbstractList*) _tmp10_, _row_index);
			row = (GtkWidget*) _tmp11_;
			_tmp12_ = self->priv->list;
			_tmp13_ = row;
			gtk_list_box_remove (_tmp12_, _tmp13_);
			_g_object_unref0 (row);
		}
	}
	_tmp14_ = self->priv->added_rows;
	gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp14_);
	if (g_strcmp0 (str, "") == 0) {
		_tmp15_ = (_vala_array_free (_tmp15_, _tmp15__length1, (GDestroyNotify) g_free), NULL);
		_tmp15_ = NULL;
		_tmp15__length1 = 0;
		__tmp15__size_ = _tmp15__length1;
	} else {
		gchar** _tmp16_;
		gchar** _tmp17_;
		_tmp17_ = _tmp16_ = g_strsplit (str, " ", 0);
		_tmp15_ = (_vala_array_free (_tmp15_, _tmp15__length1, (GDestroyNotify) g_free), NULL);
		_tmp15_ = _tmp17_;
		_tmp15__length1 = _vala_array_length (_tmp16_);
		__tmp15__size_ = _tmp15__length1;
	}
	_tmp18_ = _tmp15_;
	_tmp18__length1 = _tmp15__length1;
	_tmp15_ = NULL;
	_tmp15__length1 = 0;
	self->priv->filter_values = (_vala_array_free (self->priv->filter_values, self->priv->filter_values_length1, (GDestroyNotify) g_free), NULL);
	self->priv->filter_values = _tmp18_;
	self->priv->filter_values_length1 = _tmp18__length1;
	self->priv->_filter_values_size_ = self->priv->filter_values_length1;
	_tmp19_ = self->priv->list;
	gtk_list_box_invalidate_filter (_tmp19_);
	{
		XmppJid* parsed_jid = NULL;
		XmppJid* _tmp20_;
		gboolean _tmp21_ = FALSE;
		_tmp20_ = xmpp_jid_new (str, &_inner_error0_);
		parsed_jid = _tmp20_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
				goto __catch0_xmpp_invalid_jid_error;
			}
			_tmp15_ = (_vala_array_free (_tmp15_, _tmp15__length1, (GDestroyNotify) g_free), NULL);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
		if (parsed_jid != NULL) {
			const gchar* _tmp22_;
			_tmp22_ = parsed_jid->localpart;
			_tmp21_ = _tmp22_ != NULL;
		} else {
			_tmp21_ = FALSE;
		}
		if (_tmp21_) {
			{
				GeeList* _account_list = NULL;
				GeeList* _tmp23_;
				gint _account_size = 0;
				GeeList* _tmp24_;
				gint _tmp25_;
				gint _tmp26_;
				gint _account_index = 0;
				_tmp23_ = self->priv->accounts;
				_account_list = _tmp23_;
				_tmp24_ = _account_list;
				_tmp25_ = gee_collection_get_size ((GeeCollection*) _tmp24_);
				_tmp26_ = _tmp25_;
				_account_size = _tmp26_;
				_account_index = -1;
				while (TRUE) {
					gint _tmp27_;
					gint _tmp28_;
					DinoEntitiesAccount* account = NULL;
					GeeList* _tmp29_;
					gpointer _tmp30_;
					GtkListBoxRow* list_row = NULL;
					GtkListBoxRow* _tmp31_;
					GtkListBoxRow* _tmp32_;
					DinoStreamInteractor* _tmp33_;
					DinoEntitiesAccount* _tmp34_;
					DinoUiSelectJidFragmentAddListRow* _tmp35_;
					DinoUiSelectJidFragmentAddListRow* _tmp36_;
					GtkListBox* _tmp37_;
					GtkListBoxRow* _tmp38_;
					GeeArrayList* _tmp39_;
					GtkListBoxRow* _tmp40_;
					_account_index = _account_index + 1;
					_tmp27_ = _account_index;
					_tmp28_ = _account_size;
					if (!(_tmp27_ < _tmp28_)) {
						break;
					}
					_tmp29_ = _account_list;
					_tmp30_ = gee_list_get (_tmp29_, _account_index);
					account = (DinoEntitiesAccount*) _tmp30_;
					_tmp31_ = (GtkListBoxRow*) gtk_list_box_row_new ();
					g_object_ref_sink (_tmp31_);
					list_row = _tmp31_;
					_tmp32_ = list_row;
					_tmp33_ = self->priv->stream_interactor;
					_tmp34_ = account;
					_tmp35_ = dino_ui_select_jid_fragment_add_list_row_new (_tmp33_, parsed_jid, _tmp34_);
					g_object_ref_sink (_tmp35_);
					_tmp36_ = _tmp35_;
					gtk_list_box_row_set_child (_tmp32_, (GtkWidget*) _tmp36_);
					_g_object_unref0 (_tmp36_);
					_tmp37_ = self->priv->list;
					_tmp38_ = list_row;
					gtk_list_box_append (_tmp37_, (GtkWidget*) _tmp38_);
					_tmp39_ = self->priv->added_rows;
					_tmp40_ = list_row;
					gee_abstract_collection_add ((GeeAbstractCollection*) _tmp39_, (GtkWidget*) _tmp40_);
					_g_object_unref0 (list_row);
					_g_object_unref0 (account);
				}
			}
		}
		_xmpp_jid_unref0 (parsed_jid);
	}
	goto __finally0;
	__catch0_xmpp_invalid_jid_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_tmp15_ = (_vala_array_free (_tmp15_, _tmp15__length1, (GDestroyNotify) g_free), NULL);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_tmp15_ = (_vala_array_free (_tmp15_, _tmp15__length1, (GDestroyNotify) g_free), NULL);
}

static void
dino_ui_select_jid_fragment_check_buttons_active (DinoUiSelectJidFragment* self)
{
	GtkListBoxRow* row = NULL;
	GtkListBox* _tmp0_;
	GtkListBoxRow* _tmp1_;
	GtkListBoxRow* _tmp2_;
	gboolean _tmp3_ = FALSE;
	GtkListBoxRow* _tmp4_;
	gboolean active = FALSE;
	GtkButton* _tmp6_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->list;
	_tmp1_ = gtk_list_box_get_selected_row (_tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	row = _tmp2_;
	_tmp4_ = row;
	if (_tmp4_ != NULL) {
		GtkListBoxRow* _tmp5_;
		_tmp5_ = row;
		_tmp3_ = !g_type_is_a (G_TYPE_FROM_INSTANCE ((GObject*) _tmp5_), DINO_UI_SELECT_JID_FRAGMENT_TYPE_ADD_LIST_ROW);
	} else {
		_tmp3_ = FALSE;
	}
	active = _tmp3_;
	_tmp6_ = self->priv->remove_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp6_, active);
	_g_object_unref0 (row);
}

static gint
dino_ui_select_jid_fragment_sort (DinoUiSelectJidFragment* self,
                                  GtkListBoxRow* row1,
                                  GtkListBoxRow* row2)
{
	DinoUiSelectJidFragmentAddListRow* al1 = NULL;
	DinoUiSelectJidFragmentAddListRow* _tmp0_;
	DinoUiSelectJidFragmentAddListRow* al2 = NULL;
	DinoUiSelectJidFragmentAddListRow* _tmp1_;
	gboolean _tmp2_ = FALSE;
	DinoUiSelectJidFragmentAddListRow* _tmp3_;
	DinoUiListRow* c1 = NULL;
	GtkWidget* _tmp8_;
	GtkWidget* _tmp9_;
	DinoUiListRow* _tmp10_;
	DinoUiListRow* c2 = NULL;
	GtkWidget* _tmp11_;
	GtkWidget* _tmp12_;
	DinoUiListRow* _tmp13_;
	gboolean _tmp14_ = FALSE;
	DinoUiListRow* _tmp15_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	g_return_val_if_fail (row1 != NULL, -1);
	g_return_val_if_fail (row2 != NULL, -1);
	_tmp0_ = _g_object_ref0 (DINO_UI_SELECT_JID_FRAGMENT_IS_ADD_LIST_ROW (row1) ? ((DinoUiSelectJidFragmentAddListRow*) row1) : NULL);
	al1 = _tmp0_;
	_tmp1_ = _g_object_ref0 (DINO_UI_SELECT_JID_FRAGMENT_IS_ADD_LIST_ROW (row2) ? ((DinoUiSelectJidFragmentAddListRow*) row2) : NULL);
	al2 = _tmp1_;
	_tmp3_ = al1;
	if (_tmp3_ != NULL) {
		DinoUiSelectJidFragmentAddListRow* _tmp4_;
		_tmp4_ = al2;
		_tmp2_ = _tmp4_ == NULL;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		result = -1;
		_g_object_unref0 (al2);
		_g_object_unref0 (al1);
		return result;
	} else {
		gboolean _tmp5_ = FALSE;
		DinoUiSelectJidFragmentAddListRow* _tmp6_;
		_tmp6_ = al2;
		if (_tmp6_ != NULL) {
			DinoUiSelectJidFragmentAddListRow* _tmp7_;
			_tmp7_ = al1;
			_tmp5_ = _tmp7_ == NULL;
		} else {
			_tmp5_ = FALSE;
		}
		if (_tmp5_) {
			result = 1;
			_g_object_unref0 (al2);
			_g_object_unref0 (al1);
			return result;
		}
	}
	_tmp8_ = gtk_list_box_row_get_child (row1);
	_tmp9_ = _tmp8_;
	_tmp10_ = _g_object_ref0 (DINO_UI_IS_LIST_ROW (_tmp9_) ? ((DinoUiListRow*) _tmp9_) : NULL);
	c1 = _tmp10_;
	_tmp11_ = gtk_list_box_row_get_child (row2);
	_tmp12_ = _tmp11_;
	_tmp13_ = _g_object_ref0 (DINO_UI_IS_LIST_ROW (_tmp12_) ? ((DinoUiListRow*) _tmp12_) : NULL);
	c2 = _tmp13_;
	_tmp15_ = c1;
	if (_tmp15_ != NULL) {
		DinoUiListRow* _tmp16_;
		_tmp16_ = c2;
		_tmp14_ = _tmp16_ != NULL;
	} else {
		_tmp14_ = FALSE;
	}
	if (_tmp14_) {
		DinoUiListRow* _tmp17_;
		GtkLabel* _tmp18_;
		const gchar* _tmp19_;
		const gchar* _tmp20_;
		DinoUiListRow* _tmp21_;
		GtkLabel* _tmp22_;
		const gchar* _tmp23_;
		const gchar* _tmp24_;
		_tmp17_ = c1;
		_tmp18_ = _tmp17_->name_label;
		_tmp19_ = gtk_label_get_label (_tmp18_);
		_tmp20_ = _tmp19_;
		_tmp21_ = c2;
		_tmp22_ = _tmp21_->name_label;
		_tmp23_ = gtk_label_get_label (_tmp22_);
		_tmp24_ = _tmp23_;
		result = g_utf8_collate (_tmp20_, _tmp24_);
		_g_object_unref0 (c2);
		_g_object_unref0 (c1);
		_g_object_unref0 (al2);
		_g_object_unref0 (al1);
		return result;
	}
	result = 0;
	_g_object_unref0 (c2);
	_g_object_unref0 (c1);
	_g_object_unref0 (al2);
	_g_object_unref0 (al1);
	return result;
}

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

static gboolean
dino_ui_select_jid_fragment_filter (DinoUiSelectJidFragment* self,
                                    GtkListBoxRow* r)
{
	DinoUiListRow* row = NULL;
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	DinoUiListRow* _tmp2_;
	DinoUiListRow* _tmp3_;
	gchar** _tmp4_;
	gint _tmp4__length1;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (r != NULL, FALSE);
	_tmp0_ = gtk_list_box_row_get_child (r);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (DINO_UI_IS_LIST_ROW (_tmp1_) ? ((DinoUiListRow*) _tmp1_) : NULL);
	row = _tmp2_;
	_tmp3_ = row;
	if (_tmp3_ == NULL) {
		result = TRUE;
		_g_object_unref0 (row);
		return result;
	}
	_tmp4_ = self->priv->filter_values;
	_tmp4__length1 = self->priv->filter_values_length1;
	if (_tmp4_ != NULL) {
		gchar** _tmp5_;
		gint _tmp5__length1;
		_tmp5_ = self->priv->filter_values;
		_tmp5__length1 = self->priv->filter_values_length1;
		{
			gchar** filter_collection = NULL;
			gint filter_collection_length1 = 0;
			gint _filter_collection_size_ = 0;
			gint filter_it = 0;
			filter_collection = _tmp5_;
			filter_collection_length1 = _tmp5__length1;
			for (filter_it = 0; filter_it < filter_collection_length1; filter_it = filter_it + 1) {
				gchar* _tmp6_;
				gchar* filter = NULL;
				_tmp6_ = g_strdup (filter_collection[filter_it]);
				filter = _tmp6_;
				{
					gboolean _tmp7_ = FALSE;
					DinoUiListRow* _tmp8_;
					GtkLabel* _tmp9_;
					const gchar* _tmp10_;
					const gchar* _tmp11_;
					gchar* _tmp12_;
					gchar* _tmp13_;
					const gchar* _tmp14_;
					gchar* _tmp15_;
					gchar* _tmp16_;
					gboolean _tmp17_;
					_tmp8_ = row;
					_tmp9_ = _tmp8_->name_label;
					_tmp10_ = gtk_label_get_label (_tmp9_);
					_tmp11_ = _tmp10_;
					_tmp12_ = g_utf8_strdown (_tmp11_, (gssize) -1);
					_tmp13_ = _tmp12_;
					_tmp14_ = filter;
					_tmp15_ = g_utf8_strdown (_tmp14_, (gssize) -1);
					_tmp16_ = _tmp15_;
					_tmp17_ = string_contains (_tmp13_, _tmp16_);
					_g_free0 (_tmp16_);
					_g_free0 (_tmp13_);
					if (_tmp17_) {
						_tmp7_ = TRUE;
					} else {
						DinoUiListRow* _tmp18_;
						XmppJid* _tmp19_;
						gchar* _tmp20_;
						gchar* _tmp21_;
						gchar* _tmp22_;
						gchar* _tmp23_;
						const gchar* _tmp24_;
						gchar* _tmp25_;
						gchar* _tmp26_;
						_tmp18_ = row;
						_tmp19_ = _tmp18_->jid;
						_tmp20_ = xmpp_jid_to_string (_tmp19_);
						_tmp21_ = _tmp20_;
						_tmp22_ = g_utf8_strdown (_tmp21_, (gssize) -1);
						_tmp23_ = _tmp22_;
						_tmp24_ = filter;
						_tmp25_ = g_utf8_strdown (_tmp24_, (gssize) -1);
						_tmp26_ = _tmp25_;
						_tmp7_ = string_contains (_tmp23_, _tmp26_);
						_g_free0 (_tmp26_);
						_g_free0 (_tmp23_);
						_g_free0 (_tmp21_);
					}
					if (!_tmp7_) {
						result = FALSE;
						_g_free0 (filter);
						_g_object_unref0 (row);
						return result;
					}
					_g_free0 (filter);
				}
			}
		}
	}
	result = TRUE;
	_g_object_unref0 (row);
	return result;
}

static void
dino_ui_select_jid_fragment_header (DinoUiSelectJidFragment* self,
                                    GtkListBoxRow* row,
                                    GtkListBoxRow* before_row)
{
	gboolean _tmp0_ = FALSE;
	GtkWidget* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (row != NULL);
	_tmp1_ = gtk_list_box_row_get_header (row);
	if (_tmp1_ == NULL) {
		_tmp0_ = before_row != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GtkSeparator* _tmp2_;
		GtkSeparator* _tmp3_;
		_tmp2_ = (GtkSeparator*) gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
		g_object_ref_sink (_tmp2_);
		_tmp3_ = _tmp2_;
		gtk_list_box_row_set_header (row, (GtkWidget*) _tmp3_);
		_g_object_unref0 (_tmp3_);
	}
}

gboolean
dino_ui_select_jid_fragment_get_done (DinoUiSelectJidFragment* self)
{
	gboolean result;
	GtkListBox* _tmp0_;
	GtkListBoxRow* _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->list;
	_tmp1_ = gtk_list_box_get_selected_row (_tmp0_);
	result = _tmp1_ != NULL;
	return result;
}

static void
dino_ui_select_jid_fragment_set_done (DinoUiSelectJidFragment* self,
                                      gboolean value)
{
	g_return_if_fail (self != NULL);
	g_object_notify_by_pspec ((GObject *) self, dino_ui_select_jid_fragment_properties[DINO_UI_SELECT_JID_FRAGMENT_DONE_PROPERTY]);
}

static gpointer
_xmpp_jid_ref0 (gpointer self)
{
	return self ? xmpp_jid_ref (self) : NULL;
}

static DinoUiSelectJidFragmentAddListRow*
dino_ui_select_jid_fragment_add_list_row_construct (GType object_type,
                                                    DinoStreamInteractor* stream_interactor,
                                                    XmppJid* jid,
                                                    DinoEntitiesAccount* account)
{
	DinoUiSelectJidFragmentAddListRow * self = NULL;
	DinoEntitiesAccount* _tmp0_;
	XmppJid* _tmp1_;
	GtkLabel* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	GeeArrayList* _tmp5_;
	GeeArrayList* _tmp6_;
	gint _tmp7_;
	gint _tmp8_;
	gboolean _tmp9_;
	DinoUiAvatarPicture* _tmp17_;
	DinoUiViewModelCompatAvatarPictureModel* _tmp18_;
	DinoUiViewModelCompatAvatarPictureModel* _tmp19_;
	DinoUiViewModelCompatAvatarPictureModel* _tmp20_;
	DinoUiViewModelCompatAvatarPictureModel* _tmp21_;
	g_return_val_if_fail (stream_interactor != NULL, NULL);
	g_return_val_if_fail (jid != NULL, NULL);
	g_return_val_if_fail (account != NULL, NULL);
	self = (DinoUiSelectJidFragmentAddListRow*) dino_ui_list_row_construct (object_type);
	_tmp0_ = _g_object_ref0 (account);
	_g_object_unref0 (((DinoUiListRow*) self)->account);
	((DinoUiListRow*) self)->account = _tmp0_;
	_tmp1_ = _xmpp_jid_ref0 (jid);
	_xmpp_jid_unref0 (((DinoUiListRow*) self)->jid);
	((DinoUiListRow*) self)->jid = _tmp1_;
	_tmp2_ = ((DinoUiListRow*) self)->name_label;
	_tmp3_ = xmpp_jid_to_string (jid);
	_tmp4_ = _tmp3_;
	gtk_label_set_label (_tmp2_, _tmp4_);
	_g_free0 (_tmp4_);
	_tmp5_ = dino_stream_interactor_get_accounts (stream_interactor);
	_tmp6_ = _tmp5_;
	_tmp7_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = _tmp8_ > 1;
	_g_object_unref0 (_tmp6_);
	if (_tmp9_) {
		GtkLabel* _tmp10_;
		XmppJid* _tmp11_;
		XmppJid* _tmp12_;
		XmppJid* _tmp13_;
		gchar* _tmp14_;
		gchar* _tmp15_;
		_tmp10_ = ((DinoUiListRow*) self)->via_label;
		_tmp11_ = dino_entities_account_get_bare_jid (account);
		_tmp12_ = _tmp11_;
		_tmp13_ = _tmp12_;
		_tmp14_ = xmpp_jid_to_string (_tmp13_);
		_tmp15_ = _tmp14_;
		gtk_label_set_label (_tmp10_, _tmp15_);
		_g_free0 (_tmp15_);
		_xmpp_jid_unref0 (_tmp13_);
	} else {
		GtkLabel* _tmp16_;
		_tmp16_ = ((DinoUiListRow*) self)->via_label;
		gtk_widget_set_visible ((GtkWidget*) _tmp16_, FALSE);
	}
	_tmp17_ = ((DinoUiListRow*) self)->picture;
	_tmp18_ = dino_ui_view_model_compat_avatar_picture_model_new (stream_interactor);
	_tmp19_ = _tmp18_;
	_tmp20_ = dino_ui_view_model_compat_avatar_picture_model_add (_tmp19_, "+", NULL, NULL);
	_tmp21_ = _tmp20_;
	dino_ui_avatar_picture_set_model (_tmp17_, (DinoUiViewModelAvatarPictureModel*) _tmp21_);
	_g_object_unref0 (_tmp21_);
	_g_object_unref0 (_tmp19_);
	return self;
}

static DinoUiSelectJidFragmentAddListRow*
dino_ui_select_jid_fragment_add_list_row_new (DinoStreamInteractor* stream_interactor,
                                              XmppJid* jid,
                                              DinoEntitiesAccount* account)
{
	return dino_ui_select_jid_fragment_add_list_row_construct (DINO_UI_SELECT_JID_FRAGMENT_TYPE_ADD_LIST_ROW, stream_interactor, jid, account);
}

static void
dino_ui_select_jid_fragment_add_list_row_class_init (DinoUiSelectJidFragmentAddListRowClass * klass,
                                                     gpointer klass_data)
{
	dino_ui_select_jid_fragment_add_list_row_parent_class = g_type_class_peek_parent (klass);
}

static void
dino_ui_select_jid_fragment_add_list_row_instance_init (DinoUiSelectJidFragmentAddListRow * self,
                                                        gpointer klass)
{
}

static GType
dino_ui_select_jid_fragment_add_list_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoUiSelectJidFragmentAddListRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_ui_select_jid_fragment_add_list_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoUiSelectJidFragmentAddListRow), 0, (GInstanceInitFunc) dino_ui_select_jid_fragment_add_list_row_instance_init, NULL };
	GType dino_ui_select_jid_fragment_add_list_row_type_id;
	dino_ui_select_jid_fragment_add_list_row_type_id = g_type_register_static (DINO_UI_TYPE_LIST_ROW, "DinoUiSelectJidFragmentAddListRow", &g_define_type_info, 0);
	return dino_ui_select_jid_fragment_add_list_row_type_id;
}

static GType
dino_ui_select_jid_fragment_add_list_row_get_type (void)
{
	static volatile gsize dino_ui_select_jid_fragment_add_list_row_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_select_jid_fragment_add_list_row_type_id__once)) {
		GType dino_ui_select_jid_fragment_add_list_row_type_id;
		dino_ui_select_jid_fragment_add_list_row_type_id = dino_ui_select_jid_fragment_add_list_row_get_type_once ();
		g_once_init_leave (&dino_ui_select_jid_fragment_add_list_row_type_id__once, dino_ui_select_jid_fragment_add_list_row_type_id);
	}
	return dino_ui_select_jid_fragment_add_list_row_type_id__once;
}

static void
dino_ui_select_jid_fragment_class_init (DinoUiSelectJidFragmentClass * klass,
                                        gpointer klass_data)
{
	dino_ui_select_jid_fragment_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoUiSelectJidFragment_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_ui_select_jid_fragment_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dino_ui_select_jid_fragment_set_property;
	G_OBJECT_CLASS (klass)->finalize = dino_ui_select_jid_fragment_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_SELECT_JID_FRAGMENT_DONE_PROPERTY, dino_ui_select_jid_fragment_properties[DINO_UI_SELECT_JID_FRAGMENT_DONE_PROPERTY] = g_param_spec_boolean ("done", "done", "done", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/im/dino/Dino/add_conversation/select_jid_fragment.ui");
	dino_ui_select_jid_fragment_signals[DINO_UI_SELECT_JID_FRAGMENT_ADD_JID_SIGNAL] = g_signal_new ("add-jid", DINO_UI_TYPE_SELECT_JID_FRAGMENT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	dino_ui_select_jid_fragment_signals[DINO_UI_SELECT_JID_FRAGMENT_REMOVE_JID_SIGNAL] = g_signal_new ("remove-jid", DINO_UI_TYPE_SELECT_JID_FRAGMENT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, DINO_UI_TYPE_LIST_ROW);
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "entry", FALSE, DinoUiSelectJidFragment_private_offset + G_STRUCT_OFFSET (DinoUiSelectJidFragmentPrivate, entry));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "box", FALSE, DinoUiSelectJidFragment_private_offset + G_STRUCT_OFFSET (DinoUiSelectJidFragmentPrivate, box));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "add_button", FALSE, DinoUiSelectJidFragment_private_offset + G_STRUCT_OFFSET (DinoUiSelectJidFragmentPrivate, add_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "remove_button", FALSE, DinoUiSelectJidFragment_private_offset + G_STRUCT_OFFSET (DinoUiSelectJidFragmentPrivate, remove_button));
}

static void
dino_ui_select_jid_fragment_instance_init (DinoUiSelectJidFragment * self,
                                           gpointer klass)
{
	GeeArrayList* _tmp0_;
	self->priv = dino_ui_select_jid_fragment_get_instance_private (self);
	_tmp0_ = gee_array_list_new (gtk_widget_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	self->priv->added_rows = _tmp0_;
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
dino_ui_select_jid_fragment_finalize (GObject * obj)
{
	DinoUiSelectJidFragment * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_TYPE_SELECT_JID_FRAGMENT, DinoUiSelectJidFragment);
	_g_object_unref0 (self->priv->stream_interactor);
	_g_object_unref0 (self->priv->accounts);
	_g_object_unref0 (self->priv->added_rows);
	_g_object_unref0 (self->priv->list);
	self->priv->filter_values = (_vala_array_free (self->priv->filter_values, self->priv->filter_values_length1, (GDestroyNotify) g_free), NULL);
	G_OBJECT_CLASS (dino_ui_select_jid_fragment_parent_class)->finalize (obj);
}

static GType
dino_ui_select_jid_fragment_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoUiSelectJidFragmentClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_ui_select_jid_fragment_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoUiSelectJidFragment), 0, (GInstanceInitFunc) dino_ui_select_jid_fragment_instance_init, NULL };
	GType dino_ui_select_jid_fragment_type_id;
	dino_ui_select_jid_fragment_type_id = g_type_register_static (gtk_box_get_type (), "DinoUiSelectJidFragment", &g_define_type_info, 0);
	DinoUiSelectJidFragment_private_offset = g_type_add_instance_private (dino_ui_select_jid_fragment_type_id, sizeof (DinoUiSelectJidFragmentPrivate));
	return dino_ui_select_jid_fragment_type_id;
}

GType
dino_ui_select_jid_fragment_get_type (void)
{
	static volatile gsize dino_ui_select_jid_fragment_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_select_jid_fragment_type_id__once)) {
		GType dino_ui_select_jid_fragment_type_id;
		dino_ui_select_jid_fragment_type_id = dino_ui_select_jid_fragment_get_type_once ();
		g_once_init_leave (&dino_ui_select_jid_fragment_type_id__once, dino_ui_select_jid_fragment_type_id);
	}
	return dino_ui_select_jid_fragment_type_id__once;
}

static void
_vala_dino_ui_select_jid_fragment_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec)
{
	DinoUiSelectJidFragment * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_UI_TYPE_SELECT_JID_FRAGMENT, DinoUiSelectJidFragment);
	switch (property_id) {
		case DINO_UI_SELECT_JID_FRAGMENT_DONE_PROPERTY:
		g_value_set_boolean (value, dino_ui_select_jid_fragment_get_done (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dino_ui_select_jid_fragment_set_property (GObject * object,
                                                guint property_id,
                                                const GValue * value,
                                                GParamSpec * pspec)
{
	DinoUiSelectJidFragment * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_UI_TYPE_SELECT_JID_FRAGMENT, DinoUiSelectJidFragment);
	switch (property_id) {
		case DINO_UI_SELECT_JID_FRAGMENT_DONE_PROPERTY:
		dino_ui_select_jid_fragment_set_done (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

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

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

