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

#include <gtk/gtk.h>
#include <glib-object.h>
#include "libdino.h"
#include <gee.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include "dino_i18n.h"
#include "xmpp-vala.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_CONTACT_DIALOG (dino_ui_select_contact_dialog_get_type ())
#define DINO_UI_SELECT_CONTACT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_TYPE_SELECT_CONTACT_DIALOG, DinoUiSelectContactDialog))
#define DINO_UI_SELECT_CONTACT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_TYPE_SELECT_CONTACT_DIALOG, DinoUiSelectContactDialogClass))
#define DINO_UI_IS_SELECT_CONTACT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_TYPE_SELECT_CONTACT_DIALOG))
#define DINO_UI_IS_SELECT_CONTACT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_TYPE_SELECT_CONTACT_DIALOG))
#define DINO_UI_SELECT_CONTACT_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_TYPE_SELECT_CONTACT_DIALOG, DinoUiSelectContactDialogClass))

typedef struct _DinoUiSelectContactDialog DinoUiSelectContactDialog;
typedef struct _DinoUiSelectContactDialogClass DinoUiSelectContactDialogClass;
typedef struct _DinoUiSelectContactDialogPrivate DinoUiSelectContactDialogPrivate;

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

#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;
enum  {
	DINO_UI_SELECT_CONTACT_DIALOG_0_PROPERTY,
	DINO_UI_SELECT_CONTACT_DIALOG_NUM_PROPERTIES
};
static GParamSpec* dino_ui_select_contact_dialog_properties[DINO_UI_SELECT_CONTACT_DIALOG_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#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;
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 DINO_UI_TYPE_ADD_CONTACT_DIALOG (dino_ui_add_contact_dialog_get_type ())
#define DINO_UI_ADD_CONTACT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_TYPE_ADD_CONTACT_DIALOG, DinoUiAddContactDialog))
#define DINO_UI_ADD_CONTACT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_TYPE_ADD_CONTACT_DIALOG, DinoUiAddContactDialogClass))
#define DINO_UI_IS_ADD_CONTACT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_TYPE_ADD_CONTACT_DIALOG))
#define DINO_UI_IS_ADD_CONTACT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_TYPE_ADD_CONTACT_DIALOG))
#define DINO_UI_ADD_CONTACT_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_TYPE_ADD_CONTACT_DIALOG, DinoUiAddContactDialogClass))

typedef struct _DinoUiAddContactDialog DinoUiAddContactDialog;
typedef struct _DinoUiAddContactDialogClass DinoUiAddContactDialogClass;
enum  {
	DINO_UI_SELECT_CONTACT_DIALOG_SELECTED_SIGNAL,
	DINO_UI_SELECT_CONTACT_DIALOG_NUM_SIGNALS
};
static guint dino_ui_select_contact_dialog_signals[DINO_UI_SELECT_CONTACT_DIALOG_NUM_SIGNALS] = {0};

#define DINO_UI_TYPE_ADD_CHAT_DIALOG (dino_ui_add_chat_dialog_get_type ())
#define DINO_UI_ADD_CHAT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_TYPE_ADD_CHAT_DIALOG, DinoUiAddChatDialog))
#define DINO_UI_ADD_CHAT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_TYPE_ADD_CHAT_DIALOG, DinoUiAddChatDialogClass))
#define DINO_UI_IS_ADD_CHAT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_TYPE_ADD_CHAT_DIALOG))
#define DINO_UI_IS_ADD_CHAT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_TYPE_ADD_CHAT_DIALOG))
#define DINO_UI_ADD_CHAT_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_TYPE_ADD_CHAT_DIALOG, DinoUiAddChatDialogClass))

typedef struct _DinoUiAddChatDialog DinoUiAddChatDialog;
typedef struct _DinoUiAddChatDialogClass DinoUiAddChatDialogClass;
typedef struct _DinoUiAddChatDialogPrivate DinoUiAddChatDialogPrivate;
enum  {
	DINO_UI_ADD_CHAT_DIALOG_0_PROPERTY,
	DINO_UI_ADD_CHAT_DIALOG_NUM_PROPERTIES
};
static GParamSpec* dino_ui_add_chat_dialog_properties[DINO_UI_ADD_CHAT_DIALOG_NUM_PROPERTIES];
typedef struct _Block6Data Block6Data;
enum  {
	DINO_UI_ADD_CHAT_DIALOG_ADDED_SIGNAL,
	DINO_UI_ADD_CHAT_DIALOG_NUM_SIGNALS
};
static guint dino_ui_add_chat_dialog_signals[DINO_UI_ADD_CHAT_DIALOG_NUM_SIGNALS] = {0};

struct _DinoUiSelectContactDialog {
	GtkDialog parent_instance;
	DinoUiSelectContactDialogPrivate * priv;
	GtkButton* ok_button;
};

struct _DinoUiSelectContactDialogClass {
	GtkDialogClass parent_class;
};

struct _DinoUiSelectContactDialogPrivate {
	DinoUiRosterList* roster_list;
	GtkListBox* roster_list_box;
	DinoUiSelectJidFragment* select_jid_fragment;
	DinoStreamInteractor* stream_interactor;
	GeeList* accounts;
};

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 _DinoUiAddChatDialog {
	DinoUiSelectContactDialog parent_instance;
	DinoUiAddChatDialogPrivate * priv;
};

struct _DinoUiAddChatDialogClass {
	DinoUiSelectContactDialogClass parent_class;
};

struct _Block6Data {
	int _ref_count_;
	DinoUiAddChatDialog* self;
	DinoStreamInteractor* stream_interactor;
};

static gint DinoUiSelectContactDialog_private_offset;
static gpointer dino_ui_select_contact_dialog_parent_class = NULL;
static gpointer dino_ui_add_chat_dialog_parent_class = NULL;

VALA_EXTERN GType dino_ui_select_contact_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiSelectContactDialog, g_object_unref)
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)
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 DinoUiSelectContactDialog* dino_ui_select_contact_dialog_new (DinoStreamInteractor* stream_interactor,
                                                              GeeList* accounts);
VALA_EXTERN DinoUiSelectContactDialog* dino_ui_select_contact_dialog_construct (GType object_type,
                                                                    DinoStreamInteractor* stream_interactor,
                                                                    GeeList* accounts);
static void dino_ui_select_contact_dialog_setup_view (DinoUiSelectContactDialog* self);
static void dino_ui_select_contact_dialog_setup_headerbar (DinoUiSelectContactDialog* self);
VALA_EXTERN void dino_ui_select_contact_dialog_set_filter (DinoUiSelectContactDialog* self,
                                               const gchar* str);
VALA_EXTERN void dino_ui_select_jid_fragment_set_filter (DinoUiSelectJidFragment* self,
                                             const gchar* str);
static void __lambda97_ (DinoUiSelectContactDialog* self);
static void ___lambda97__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static void __lambda98_ (DinoUiSelectContactDialog* self);
VALA_EXTERN GType dino_ui_list_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiListRow, 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)
static void ___lambda98__gtk_button_clicked (GtkButton* _sender,
                                      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);
VALA_EXTERN GtkListBox* dino_ui_roster_list_get_list_box (DinoUiRosterList* self);
static void __lambda92_ (DinoUiSelectContactDialog* self);
static void ___lambda92__gtk_list_box_row_activated (GtkListBox* _sender,
                                              GtkListBoxRow* row,
                                              gpointer self);
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 void __lambda93_ (DinoUiSelectContactDialog* self,
                  DinoUiSelectJidFragment* row);
VALA_EXTERN GType dino_ui_add_contact_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiAddContactDialog, g_object_unref)
VALA_EXTERN DinoUiAddContactDialog* dino_ui_add_contact_dialog_new (DinoStreamInteractor* stream_interactor);
VALA_EXTERN DinoUiAddContactDialog* dino_ui_add_contact_dialog_construct (GType object_type,
                                                              DinoStreamInteractor* stream_interactor);
static void ___lambda93__dino_ui_select_jid_fragment_add_jid (DinoUiSelectJidFragment* _sender,
                                                       gpointer self);
static void __lambda95_ (DinoUiSelectContactDialog* self,
                  DinoUiListRow* row);
static void ___lambda95__dino_ui_select_jid_fragment_remove_jid (DinoUiSelectJidFragment* _sender,
                                                          DinoUiListRow* row,
                                                          gpointer self);
static void __lambda96_ (DinoUiSelectContactDialog* self);
VALA_EXTERN gboolean dino_ui_select_jid_fragment_get_done (DinoUiSelectJidFragment* self);
static void ___lambda96__g_object_notify (GObject* _sender,
                                   GParamSpec* pspec,
                                   gpointer self);
static void g_cclosure_user_marshal_VOID__OBJECT_XMPP_JID (GClosure * closure,
                                                    GValue * return_value,
                                                    guint n_param_values,
                                                    const GValue * param_values,
                                                    gpointer invocation_hint,
                                                    gpointer marshal_data);
static void dino_ui_select_contact_dialog_finalize (GObject * obj);
static GType dino_ui_select_contact_dialog_get_type_once (void);
VALA_EXTERN GType dino_ui_add_chat_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiAddChatDialog, g_object_unref)
VALA_EXTERN DinoUiAddChatDialog* dino_ui_add_chat_dialog_new (DinoStreamInteractor* stream_interactor,
                                                  GeeList* accounts);
VALA_EXTERN DinoUiAddChatDialog* dino_ui_add_chat_dialog_construct (GType object_type,
                                                        DinoStreamInteractor* stream_interactor,
                                                        GeeList* accounts);
static Block6Data* block6_data_ref (Block6Data* _data6_);
static void block6_data_unref (void * _userdata_);
static void __lambda288_ (Block6Data* _data6_,
                   DinoEntitiesAccount* account,
                   XmppJid* jid);
static void ___lambda288__dino_ui_select_contact_dialog_selected (DinoUiSelectContactDialog* _sender,
                                                           DinoEntitiesAccount* account,
                                                           XmppJid* jid,
                                                           gpointer self);
static GType dino_ui_add_chat_dialog_get_type_once (void);

static inline gpointer
dino_ui_select_contact_dialog_get_instance_private (DinoUiSelectContactDialog* self)
{
	return G_STRUCT_MEMBER_P (self, DinoUiSelectContactDialog_private_offset);
}

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

DinoUiSelectContactDialog*
dino_ui_select_contact_dialog_construct (GType object_type,
                                         DinoStreamInteractor* stream_interactor,
                                         GeeList* accounts)
{
	DinoUiSelectContactDialog * self = NULL;
	DinoStreamInteractor* _tmp0_;
	GeeList* _tmp1_;
	g_return_val_if_fail (stream_interactor != NULL, NULL);
	g_return_val_if_fail (accounts != NULL, NULL);
	self = (DinoUiSelectContactDialog*) g_object_new (object_type, "use-header-bar", 1, NULL);
	gtk_window_set_modal ((GtkWindow*) self, TRUE);
	g_object_set ((GtkWindow*) self, "default-width", 460, NULL);
	g_object_set ((GtkWindow*) self, "default-height", 550, NULL);
	_tmp0_ = _g_object_ref0 (stream_interactor);
	_g_object_unref0 (self->priv->stream_interactor);
	self->priv->stream_interactor = _tmp0_;
	_tmp1_ = _g_object_ref0 (accounts);
	_g_object_unref0 (self->priv->accounts);
	self->priv->accounts = _tmp1_;
	dino_ui_select_contact_dialog_setup_view (self);
	dino_ui_select_contact_dialog_setup_headerbar (self);
	return self;
}

DinoUiSelectContactDialog*
dino_ui_select_contact_dialog_new (DinoStreamInteractor* stream_interactor,
                                   GeeList* accounts)
{
	return dino_ui_select_contact_dialog_construct (DINO_UI_TYPE_SELECT_CONTACT_DIALOG, stream_interactor, accounts);
}

void
dino_ui_select_contact_dialog_set_filter (DinoUiSelectContactDialog* self,
                                          const gchar* str)
{
	DinoUiSelectJidFragment* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (str != NULL);
	_tmp0_ = self->priv->select_jid_fragment;
	dino_ui_select_jid_fragment_set_filter (_tmp0_, str);
}

static void
__lambda97_ (DinoUiSelectContactDialog* self)
{
	g_signal_emit_by_name ((GtkDialog*) self, "close");
}

static void
___lambda97__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda97_ ((DinoUiSelectContactDialog*) self);
}

static void
__lambda98_ (DinoUiSelectContactDialog* self)
{
	DinoUiListRow* _tmp0_ = NULL;
	GtkListBox* _tmp1_;
	GtkListBoxRow* _tmp2_;
	DinoUiListRow* selected_row = NULL;
	DinoUiListRow* _tmp6_;
	DinoUiListRow* _tmp7_;
	_tmp1_ = self->priv->roster_list_box;
	_tmp2_ = gtk_list_box_get_selected_row (_tmp1_);
	if (_tmp2_ != NULL) {
		GtkListBox* _tmp3_;
		GtkListBoxRow* _tmp4_;
		GtkWidget* _tmp5_;
		_tmp3_ = self->priv->roster_list_box;
		_tmp4_ = gtk_list_box_get_selected_row (_tmp3_);
		_tmp5_ = gtk_list_box_row_get_child (_tmp4_);
		_tmp0_ = DINO_UI_IS_LIST_ROW (_tmp5_) ? ((DinoUiListRow*) _tmp5_) : NULL;
	} else {
		_tmp0_ = NULL;
	}
	_tmp6_ = _g_object_ref0 (_tmp0_);
	selected_row = _tmp6_;
	_tmp7_ = selected_row;
	if (_tmp7_ != NULL) {
		DinoUiListRow* _tmp8_;
		DinoEntitiesAccount* _tmp9_;
		DinoUiListRow* _tmp10_;
		XmppJid* _tmp11_;
		_tmp8_ = selected_row;
		_tmp9_ = _tmp8_->account;
		_tmp10_ = selected_row;
		_tmp11_ = _tmp10_->jid;
		g_signal_emit (self, dino_ui_select_contact_dialog_signals[DINO_UI_SELECT_CONTACT_DIALOG_SELECTED_SIGNAL], 0, _tmp9_, _tmp11_);
	}
	g_signal_emit_by_name ((GtkDialog*) self, "close");
	_g_object_unref0 (selected_row);
}

static void
___lambda98__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda98_ ((DinoUiSelectContactDialog*) self);
}

static void
dino_ui_select_contact_dialog_setup_headerbar (DinoUiSelectContactDialog* self)
{
	GtkButton* cancel_button = NULL;
	GtkButton* _tmp0_;
	const gchar* _tmp1_;
	GtkButton* _tmp2_;
	GtkButton* _tmp3_;
	GtkButton* _tmp4_;
	GtkButton* _tmp5_;
	GtkHeaderBar* header_bar = NULL;
	GtkHeaderBar* _tmp6_;
	GtkHeaderBar* _tmp7_;
	GtkButton* _tmp8_;
	GtkButton* _tmp9_;
	g_return_if_fail (self != NULL);
	_tmp0_ = (GtkButton*) gtk_button_new ();
	g_object_ref_sink (_tmp0_);
	cancel_button = _tmp0_;
	_tmp1_ = dino_gettext ("Cancel");
	gtk_button_set_label (cancel_button, _tmp1_);
	gtk_widget_set_visible ((GtkWidget*) cancel_button, TRUE);
	_tmp2_ = (GtkButton*) gtk_button_new ();
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->ok_button);
	self->ok_button = _tmp2_;
	_tmp3_ = self->ok_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp3_, "suggested-action");
	_tmp4_ = self->ok_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp4_, FALSE);
	_tmp5_ = self->ok_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp5_, TRUE);
	_tmp6_ = gtk_dialog_get_header_bar ((GtkDialog*) self);
	_tmp7_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp6_, gtk_header_bar_get_type ()) ? ((GtkHeaderBar*) _tmp6_) : NULL);
	header_bar = _tmp7_;
	gtk_header_bar_set_show_title_buttons (header_bar, FALSE);
	gtk_header_bar_pack_start (header_bar, (GtkWidget*) cancel_button);
	_tmp8_ = self->ok_button;
	gtk_header_bar_pack_end (header_bar, (GtkWidget*) _tmp8_);
	g_signal_connect_object (cancel_button, "clicked", (GCallback) ___lambda97__gtk_button_clicked, self, 0);
	_tmp9_ = self->ok_button;
	g_signal_connect_object (_tmp9_, "clicked", (GCallback) ___lambda98__gtk_button_clicked, self, 0);
	_g_object_unref0 (header_bar);
	_g_object_unref0 (cancel_button);
}

static void
__lambda92_ (DinoUiSelectContactDialog* self)
{
	GtkButton* _tmp0_;
	_tmp0_ = self->ok_button;
	g_signal_emit_by_name (_tmp0_, "clicked");
}

static void
___lambda92__gtk_list_box_row_activated (GtkListBox* _sender,
                                         GtkListBoxRow* row,
                                         gpointer self)
{
	__lambda92_ ((DinoUiSelectContactDialog*) self);
}

static void
__lambda93_ (DinoUiSelectContactDialog* self,
             DinoUiSelectJidFragment* row)
{
	DinoUiAddContactDialog* add_contact_dialog = NULL;
	DinoStreamInteractor* _tmp0_;
	DinoUiAddContactDialog* _tmp1_;
	g_return_if_fail (row != NULL);
	_tmp0_ = self->priv->stream_interactor;
	_tmp1_ = dino_ui_add_contact_dialog_new (_tmp0_);
	g_object_ref_sink (_tmp1_);
	add_contact_dialog = _tmp1_;
	gtk_window_set_transient_for ((GtkWindow*) add_contact_dialog, (GtkWindow*) self);
	gtk_window_present ((GtkWindow*) add_contact_dialog);
	_g_object_unref0 (add_contact_dialog);
}

static void
___lambda93__dino_ui_select_jid_fragment_add_jid (DinoUiSelectJidFragment* _sender,
                                                  gpointer self)
{
	__lambda93_ ((DinoUiSelectContactDialog*) self, _sender);
}

static void
__lambda95_ (DinoUiSelectContactDialog* self,
             DinoUiListRow* row)
{
	DinoUiListRow* list_row = NULL;
	GtkListBox* _tmp0_;
	GtkListBoxRow* _tmp1_;
	GtkWidget* _tmp2_;
	GtkWidget* _tmp3_;
	DinoUiListRow* _tmp4_;
	DinoStreamInteractor* _tmp5_;
	DinoModuleIdentity* _tmp6_;
	gpointer _tmp7_;
	DinoRosterManager* _tmp8_;
	DinoEntitiesAccount* _tmp9_;
	XmppJid* _tmp10_;
	g_return_if_fail (row != NULL);
	_tmp0_ = self->priv->roster_list_box;
	_tmp1_ = gtk_list_box_get_selected_row (_tmp0_);
	_tmp2_ = gtk_list_box_row_get_child (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = _g_object_ref0 (DINO_UI_IS_LIST_ROW (_tmp3_) ? ((DinoUiListRow*) _tmp3_) : NULL);
	list_row = _tmp4_;
	_tmp5_ = self->priv->stream_interactor;
	_tmp6_ = dino_roster_manager_IDENTITY;
	_tmp7_ = dino_stream_interactor_get_module (_tmp5_, DINO_TYPE_ROSTER_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp6_);
	_tmp8_ = (DinoRosterManager*) _tmp7_;
	_tmp9_ = list_row->account;
	_tmp10_ = list_row->jid;
	dino_roster_manager_remove_jid (_tmp8_, _tmp9_, _tmp10_);
	_g_object_unref0 (_tmp8_);
	_g_object_unref0 (list_row);
}

static void
___lambda95__dino_ui_select_jid_fragment_remove_jid (DinoUiSelectJidFragment* _sender,
                                                     DinoUiListRow* row,
                                                     gpointer self)
{
	__lambda95_ ((DinoUiSelectContactDialog*) self, row);
}

static void
__lambda96_ (DinoUiSelectContactDialog* self)
{
	GtkButton* _tmp0_;
	DinoUiSelectJidFragment* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	_tmp0_ = self->ok_button;
	_tmp1_ = self->priv->select_jid_fragment;
	_tmp2_ = dino_ui_select_jid_fragment_get_done (_tmp1_);
	_tmp3_ = _tmp2_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp0_, _tmp3_);
}

static void
___lambda96__g_object_notify (GObject* _sender,
                              GParamSpec* pspec,
                              gpointer self)
{
	__lambda96_ ((DinoUiSelectContactDialog*) self);
}

static void
dino_ui_select_contact_dialog_setup_view (DinoUiSelectContactDialog* self)
{
	DinoStreamInteractor* _tmp0_;
	GeeList* _tmp1_;
	DinoUiRosterList* _tmp2_;
	DinoUiRosterList* _tmp3_;
	GtkListBox* _tmp4_;
	GtkListBox* _tmp5_;
	DinoStreamInteractor* _tmp6_;
	GtkListBox* _tmp7_;
	GeeList* _tmp8_;
	DinoUiSelectJidFragment* _tmp9_;
	DinoUiSelectJidFragment* _tmp10_;
	DinoUiSelectJidFragment* _tmp11_;
	DinoUiSelectJidFragment* _tmp12_;
	GtkBox* _tmp13_;
	DinoUiSelectJidFragment* _tmp14_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->stream_interactor;
	_tmp1_ = self->priv->accounts;
	_tmp2_ = dino_ui_roster_list_new (_tmp0_, _tmp1_);
	_dino_ui_roster_list_unref0 (self->priv->roster_list);
	self->priv->roster_list = _tmp2_;
	_tmp3_ = self->priv->roster_list;
	_tmp4_ = dino_ui_roster_list_get_list_box (_tmp3_);
	_g_object_unref0 (self->priv->roster_list_box);
	self->priv->roster_list_box = _tmp4_;
	_tmp5_ = self->priv->roster_list_box;
	g_signal_connect_object (_tmp5_, "row-activated", (GCallback) ___lambda92__gtk_list_box_row_activated, self, 0);
	_tmp6_ = self->priv->stream_interactor;
	_tmp7_ = self->priv->roster_list_box;
	_tmp8_ = self->priv->accounts;
	_tmp9_ = dino_ui_select_jid_fragment_new (_tmp6_, _tmp7_, _tmp8_);
	g_object_ref_sink (_tmp9_);
	_g_object_unref0 (self->priv->select_jid_fragment);
	self->priv->select_jid_fragment = _tmp9_;
	_tmp10_ = self->priv->select_jid_fragment;
	g_signal_connect_object (_tmp10_, "add-jid", (GCallback) ___lambda93__dino_ui_select_jid_fragment_add_jid, self, 0);
	_tmp11_ = self->priv->select_jid_fragment;
	g_signal_connect_object (_tmp11_, "remove-jid", (GCallback) ___lambda95__dino_ui_select_jid_fragment_remove_jid, self, 0);
	_tmp12_ = self->priv->select_jid_fragment;
	g_signal_connect_object ((GObject*) _tmp12_, "notify::done", (GCallback) ___lambda96__g_object_notify, self, 0);
	_tmp13_ = gtk_dialog_get_content_area ((GtkDialog*) self);
	_tmp14_ = self->priv->select_jid_fragment;
	gtk_box_append (_tmp13_, (GtkWidget*) _tmp14_);
}

static void
g_cclosure_user_marshal_VOID__OBJECT_XMPP_JID (GClosure * closure,
                                               GValue * return_value,
                                               guint n_param_values,
                                               const GValue * param_values,
                                               gpointer invocation_hint,
                                               gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__OBJECT_XMPP_JID) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer data2);
	register GMarshalFunc_VOID__OBJECT_XMPP_JID callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 3);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__OBJECT_XMPP_JID) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_object (param_values + 1), xmpp_value_get_jid (param_values + 2), data2);
}

static void
dino_ui_select_contact_dialog_class_init (DinoUiSelectContactDialogClass * klass,
                                          gpointer klass_data)
{
	dino_ui_select_contact_dialog_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoUiSelectContactDialog_private_offset);
	G_OBJECT_CLASS (klass)->finalize = dino_ui_select_contact_dialog_finalize;
	dino_ui_select_contact_dialog_signals[DINO_UI_SELECT_CONTACT_DIALOG_SELECTED_SIGNAL] = g_signal_new ("selected", DINO_UI_TYPE_SELECT_CONTACT_DIALOG, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_XMPP_JID, G_TYPE_NONE, 2, DINO_ENTITIES_TYPE_ACCOUNT, XMPP_TYPE_JID);
}

static void
dino_ui_select_contact_dialog_instance_init (DinoUiSelectContactDialog * self,
                                             gpointer klass)
{
	self->priv = dino_ui_select_contact_dialog_get_instance_private (self);
}

static void
dino_ui_select_contact_dialog_finalize (GObject * obj)
{
	DinoUiSelectContactDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_TYPE_SELECT_CONTACT_DIALOG, DinoUiSelectContactDialog);
	_g_object_unref0 (self->ok_button);
	_dino_ui_roster_list_unref0 (self->priv->roster_list);
	_g_object_unref0 (self->priv->roster_list_box);
	_g_object_unref0 (self->priv->select_jid_fragment);
	_g_object_unref0 (self->priv->stream_interactor);
	_g_object_unref0 (self->priv->accounts);
	G_OBJECT_CLASS (dino_ui_select_contact_dialog_parent_class)->finalize (obj);
}

static GType
dino_ui_select_contact_dialog_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoUiSelectContactDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_ui_select_contact_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoUiSelectContactDialog), 0, (GInstanceInitFunc) dino_ui_select_contact_dialog_instance_init, NULL };
	GType dino_ui_select_contact_dialog_type_id;
	dino_ui_select_contact_dialog_type_id = g_type_register_static (gtk_dialog_get_type (), "DinoUiSelectContactDialog", &g_define_type_info, 0);
	DinoUiSelectContactDialog_private_offset = g_type_add_instance_private (dino_ui_select_contact_dialog_type_id, sizeof (DinoUiSelectContactDialogPrivate));
	return dino_ui_select_contact_dialog_type_id;
}

GType
dino_ui_select_contact_dialog_get_type (void)
{
	static volatile gsize dino_ui_select_contact_dialog_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_select_contact_dialog_type_id__once)) {
		GType dino_ui_select_contact_dialog_type_id;
		dino_ui_select_contact_dialog_type_id = dino_ui_select_contact_dialog_get_type_once ();
		g_once_init_leave (&dino_ui_select_contact_dialog_type_id__once, dino_ui_select_contact_dialog_type_id);
	}
	return dino_ui_select_contact_dialog_type_id__once;
}

static Block6Data*
block6_data_ref (Block6Data* _data6_)
{
	g_atomic_int_inc (&_data6_->_ref_count_);
	return _data6_;
}

static void
block6_data_unref (void * _userdata_)
{
	Block6Data* _data6_;
	_data6_ = (Block6Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data6_->_ref_count_)) {
		DinoUiAddChatDialog* self;
		self = _data6_->self;
		_g_object_unref0 (_data6_->stream_interactor);
		_g_object_unref0 (self);
		g_slice_free (Block6Data, _data6_);
	}
}

static void
__lambda288_ (Block6Data* _data6_,
              DinoEntitiesAccount* account,
              XmppJid* jid)
{
	DinoUiAddChatDialog* self;
	DinoEntitiesConversation* conversation = NULL;
	DinoModuleIdentity* _tmp0_;
	gpointer _tmp1_;
	DinoConversationManager* _tmp2_;
	DinoEntitiesConversationType _tmp3_;
	DinoEntitiesConversation* _tmp4_;
	DinoEntitiesConversation* _tmp5_;
	DinoModuleIdentity* _tmp6_;
	gpointer _tmp7_;
	DinoConversationManager* _tmp8_;
	self = _data6_->self;
	g_return_if_fail (account != NULL);
	g_return_if_fail (jid != NULL);
	_tmp0_ = dino_conversation_manager_IDENTITY;
	_tmp1_ = dino_stream_interactor_get_module (_data6_->stream_interactor, DINO_TYPE_CONVERSATION_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp0_);
	_tmp2_ = (DinoConversationManager*) _tmp1_;
	_tmp3_ = DINO_ENTITIES_CONVERSATION_TYPE_CHAT;
	_tmp4_ = dino_conversation_manager_create_conversation (_tmp2_, jid, account, &_tmp3_);
	_tmp5_ = _tmp4_;
	_g_object_unref0 (_tmp2_);
	conversation = _tmp5_;
	_tmp6_ = dino_conversation_manager_IDENTITY;
	_tmp7_ = dino_stream_interactor_get_module (_data6_->stream_interactor, DINO_TYPE_CONVERSATION_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp6_);
	_tmp8_ = (DinoConversationManager*) _tmp7_;
	dino_conversation_manager_start_conversation (_tmp8_, conversation);
	_g_object_unref0 (_tmp8_);
	g_signal_emit (self, dino_ui_add_chat_dialog_signals[DINO_UI_ADD_CHAT_DIALOG_ADDED_SIGNAL], 0, conversation);
	_g_object_unref0 (conversation);
}

static void
___lambda288__dino_ui_select_contact_dialog_selected (DinoUiSelectContactDialog* _sender,
                                                      DinoEntitiesAccount* account,
                                                      XmppJid* jid,
                                                      gpointer self)
{
	__lambda288_ (self, account, jid);
}

DinoUiAddChatDialog*
dino_ui_add_chat_dialog_construct (GType object_type,
                                   DinoStreamInteractor* stream_interactor,
                                   GeeList* accounts)
{
	DinoUiAddChatDialog * self = NULL;
	Block6Data* _data6_;
	DinoStreamInteractor* _tmp0_;
	const gchar* _tmp1_;
	GtkButton* _tmp2_;
	const gchar* _tmp3_;
	g_return_val_if_fail (stream_interactor != NULL, NULL);
	g_return_val_if_fail (accounts != NULL, NULL);
	_data6_ = g_slice_new0 (Block6Data);
	_data6_->_ref_count_ = 1;
	_tmp0_ = _g_object_ref0 (stream_interactor);
	_g_object_unref0 (_data6_->stream_interactor);
	_data6_->stream_interactor = _tmp0_;
	self = (DinoUiAddChatDialog*) dino_ui_select_contact_dialog_construct (object_type, _data6_->stream_interactor, accounts);
	_data6_->self = g_object_ref (self);
	_tmp1_ = dino_gettext ("Start Conversation");
	gtk_window_set_title ((GtkWindow*) self, _tmp1_);
	_tmp2_ = ((DinoUiSelectContactDialog*) self)->ok_button;
	_tmp3_ = dino_gettext ("Start");
	gtk_button_set_label (_tmp2_, _tmp3_);
	g_signal_connect_data ((DinoUiSelectContactDialog*) self, "selected", (GCallback) ___lambda288__dino_ui_select_contact_dialog_selected, block6_data_ref (_data6_), (GClosureNotify) block6_data_unref, 0);
	block6_data_unref (_data6_);
	_data6_ = NULL;
	return self;
}

DinoUiAddChatDialog*
dino_ui_add_chat_dialog_new (DinoStreamInteractor* stream_interactor,
                             GeeList* accounts)
{
	return dino_ui_add_chat_dialog_construct (DINO_UI_TYPE_ADD_CHAT_DIALOG, stream_interactor, accounts);
}

static void
dino_ui_add_chat_dialog_class_init (DinoUiAddChatDialogClass * klass,
                                    gpointer klass_data)
{
	dino_ui_add_chat_dialog_parent_class = g_type_class_peek_parent (klass);
	dino_ui_add_chat_dialog_signals[DINO_UI_ADD_CHAT_DIALOG_ADDED_SIGNAL] = g_signal_new ("added", DINO_UI_TYPE_ADD_CHAT_DIALOG, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, DINO_ENTITIES_TYPE_CONVERSATION);
}

static void
dino_ui_add_chat_dialog_instance_init (DinoUiAddChatDialog * self,
                                       gpointer klass)
{
}

static GType
dino_ui_add_chat_dialog_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoUiAddChatDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_ui_add_chat_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoUiAddChatDialog), 0, (GInstanceInitFunc) dino_ui_add_chat_dialog_instance_init, NULL };
	GType dino_ui_add_chat_dialog_type_id;
	dino_ui_add_chat_dialog_type_id = g_type_register_static (DINO_UI_TYPE_SELECT_CONTACT_DIALOG, "DinoUiAddChatDialog", &g_define_type_info, 0);
	return dino_ui_add_chat_dialog_type_id;
}

GType
dino_ui_add_chat_dialog_get_type (void)
{
	static volatile gsize dino_ui_add_chat_dialog_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_add_chat_dialog_type_id__once)) {
		GType dino_ui_add_chat_dialog_type_id;
		dino_ui_add_chat_dialog_type_id = dino_ui_add_chat_dialog_get_type_once ();
		g_once_init_leave (&dino_ui_add_chat_dialog_type_id__once, dino_ui_add_chat_dialog_type_id);
	}
	return dino_ui_add_chat_dialog_type_id__once;
}

