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

#include <adwaita.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <gtk/gtk.h>
#include <glib.h>
#include <stdlib.h>
#include <string.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 DC_TYPE_QUICK_SWITCH_DIALOG (dc_quick_switch_dialog_get_type ())
#define DC_QUICK_SWITCH_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_QUICK_SWITCH_DIALOG, DcQuickSwitchDialog))
#define DC_QUICK_SWITCH_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_QUICK_SWITCH_DIALOG, DcQuickSwitchDialogClass))
#define DC_IS_QUICK_SWITCH_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_QUICK_SWITCH_DIALOG))
#define DC_IS_QUICK_SWITCH_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_QUICK_SWITCH_DIALOG))
#define DC_QUICK_SWITCH_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_QUICK_SWITCH_DIALOG, DcQuickSwitchDialogClass))

typedef struct _DcQuickSwitchDialog DcQuickSwitchDialog;
typedef struct _DcQuickSwitchDialogClass DcQuickSwitchDialogClass;
typedef struct _DcQuickSwitchDialogPrivate DcQuickSwitchDialogPrivate;
enum  {
	DC_QUICK_SWITCH_DIALOG_0_PROPERTY,
	DC_QUICK_SWITCH_DIALOG_NUM_PROPERTIES
};
static GParamSpec* dc_quick_switch_dialog_properties[DC_QUICK_SWITCH_DIALOG_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block91Data Block91Data;

#define DC_TYPE_CHAT_ENTRY (dc_chat_entry_get_type ())
#define DC_CHAT_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_CHAT_ENTRY, DcChatEntry))
#define DC_CHAT_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_CHAT_ENTRY, DcChatEntryClass))
#define DC_IS_CHAT_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_CHAT_ENTRY))
#define DC_IS_CHAT_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_CHAT_ENTRY))
#define DC_CHAT_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_CHAT_ENTRY, DcChatEntryClass))

typedef struct _DcChatEntry DcChatEntry;
typedef struct _DcChatEntryClass DcChatEntryClass;
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	DC_QUICK_SWITCH_DIALOG_CHAT_SELECTED_SIGNAL,
	DC_QUICK_SWITCH_DIALOG_NUM_SIGNALS
};
static guint dc_quick_switch_dialog_signals[DC_QUICK_SWITCH_DIALOG_NUM_SIGNALS] = {0};

struct _DcQuickSwitchDialog {
	AdwDialog parent_instance;
	DcQuickSwitchDialogPrivate * priv;
};

struct _DcQuickSwitchDialogClass {
	AdwDialogClass parent_class;
};

struct _DcQuickSwitchDialogPrivate {
	GListStore* chat_store;
	GtkSearchEntry* entry;
	GtkListBox* listbox;
};

struct _Block91Data {
	int _ref_count_;
	DcQuickSwitchDialog* self;
	GListStore* chat_store;
};

static gint DcQuickSwitchDialog_private_offset;
static gpointer dc_quick_switch_dialog_parent_class = NULL;

VALA_EXTERN GType dc_quick_switch_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcQuickSwitchDialog, g_object_unref)
VALA_EXTERN DcQuickSwitchDialog* dc_quick_switch_dialog_new (GListStore* chat_store);
VALA_EXTERN DcQuickSwitchDialog* dc_quick_switch_dialog_construct (GType object_type,
                                                       GListStore* chat_store);
static Block91Data* block91_data_ref (Block91Data* _data91_);
static void block91_data_unref (void * _userdata_);
VALA_EXTERN GType dc_chat_entry_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcChatEntry, g_object_unref)
VALA_EXTERN AdwActionRow* dc_chat_pick_row (DcChatEntry* chat);
static gboolean __lambda425_ (DcQuickSwitchDialog* self,
                       GtkListBoxRow* row);
static gboolean ___lambda425__gtk_list_box_filter_func (GtkListBoxRow* row,
                                                 gpointer self);
static void __lambda426_ (DcQuickSwitchDialog* self);
static void ___lambda426__gtk_search_entry_search_changed (GtkSearchEntry* _sender,
                                                    gpointer self);
static void __lambda427_ (Block91Data* _data91_);
VALA_EXTERN const gchar* dc_chat_entry_get_name (DcChatEntry* self);
VALA_EXTERN gint dc_chat_entry_get_id (DcChatEntry* self);
static void ___lambda427__gtk_search_entry_activate (GtkSearchEntry* _sender,
                                              gpointer self);
static void __lambda428_ (DcQuickSwitchDialog* self,
                   GtkListBoxRow* row);
static void ___lambda428__gtk_list_box_row_activated (GtkListBox* _sender,
                                               GtkListBoxRow* row,
                                               gpointer self);
VALA_EXTERN void dc_install_escape_close (AdwDialog* dialog);
VALA_EXTERN void dc_quick_switch_dialog_focus_entry (DcQuickSwitchDialog* self);
static void dc_quick_switch_dialog_finalize (GObject * obj);
static GType dc_quick_switch_dialog_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
dc_quick_switch_dialog_get_instance_private (DcQuickSwitchDialog* self)
{
	return G_STRUCT_MEMBER_P (self, DcQuickSwitchDialog_private_offset);
}

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

static Block91Data*
block91_data_ref (Block91Data* _data91_)
{
	g_atomic_int_inc (&_data91_->_ref_count_);
	return _data91_;
}

static void
block91_data_unref (void * _userdata_)
{
	Block91Data* _data91_;
	_data91_ = (Block91Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data91_->_ref_count_)) {
		DcQuickSwitchDialog* self;
		self = _data91_->self;
		_g_object_unref0 (_data91_->chat_store);
		_g_object_unref0 (self);
		g_slice_free (Block91Data, _data91_);
	}
}

static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strstrip (_result_);
	result = _result_;
	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
__lambda425_ (DcQuickSwitchDialog* self,
              GtkListBoxRow* row)
{
	gchar* query = NULL;
	GtkSearchEntry* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	const gchar* _tmp7_;
	gint _tmp8_;
	gint _tmp9_;
	AdwActionRow* action_row = NULL;
	AdwActionRow* _tmp10_;
	AdwActionRow* _tmp11_;
	AdwActionRow* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	const gchar* _tmp17_;
	gboolean _tmp18_;
	gboolean result;
	g_return_val_if_fail (row != NULL, FALSE);
	_tmp0_ = self->priv->entry;
	_tmp1_ = gtk_editable_get_text ((GtkEditable*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = string_strip (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_utf8_strdown (_tmp4_, (gssize) -1);
	_tmp6_ = _tmp5_;
	_g_free0 (_tmp4_);
	query = _tmp6_;
	_tmp7_ = query;
	_tmp8_ = strlen (_tmp7_);
	_tmp9_ = _tmp8_;
	if (_tmp9_ == 0) {
		result = TRUE;
		_g_free0 (query);
		return result;
	}
	_tmp10_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (row, adw_action_row_get_type ()) ? ((AdwActionRow*) row) : NULL);
	action_row = _tmp10_;
	_tmp11_ = action_row;
	if (_tmp11_ == NULL) {
		result = TRUE;
		_g_object_unref0 (action_row);
		_g_free0 (query);
		return result;
	}
	_tmp12_ = action_row;
	_tmp13_ = adw_preferences_row_get_title ((AdwPreferencesRow*) _tmp12_);
	_tmp14_ = _tmp13_;
	_tmp15_ = g_utf8_strdown (_tmp14_, (gssize) -1);
	_tmp16_ = _tmp15_;
	_tmp17_ = query;
	_tmp18_ = string_contains (_tmp16_, _tmp17_);
	_g_free0 (_tmp16_);
	result = _tmp18_;
	_g_object_unref0 (action_row);
	_g_free0 (query);
	return result;
}

static gboolean
___lambda425__gtk_list_box_filter_func (GtkListBoxRow* row,
                                        gpointer self)
{
	gboolean result;
	result = __lambda425_ ((DcQuickSwitchDialog*) self, row);
	return result;
}

static void
__lambda426_ (DcQuickSwitchDialog* self)
{
	GtkListBox* _tmp0_;
	_tmp0_ = self->priv->listbox;
	gtk_list_box_invalidate_filter (_tmp0_);
}

static void
___lambda426__gtk_search_entry_search_changed (GtkSearchEntry* _sender,
                                               gpointer self)
{
	__lambda426_ ((DcQuickSwitchDialog*) self);
}

static void
__lambda427_ (Block91Data* _data91_)
{
	DcQuickSwitchDialog* self;
	gchar* query = NULL;
	GtkSearchEntry* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	self = _data91_->self;
	_tmp0_ = self->priv->entry;
	_tmp1_ = gtk_editable_get_text ((GtkEditable*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = string_strip (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_utf8_strdown (_tmp4_, (gssize) -1);
	_tmp6_ = _tmp5_;
	_g_free0 (_tmp4_);
	query = _tmp6_;
	{
		guint i = 0U;
		i = (guint) 0;
		{
			gboolean _tmp7_ = FALSE;
			_tmp7_ = TRUE;
			while (TRUE) {
				DcChatEntry* chat = NULL;
				GObject* _tmp9_;
				gboolean _tmp10_ = FALSE;
				const gchar* _tmp11_;
				gint _tmp12_;
				gint _tmp13_;
				if (!_tmp7_) {
					guint _tmp8_;
					_tmp8_ = i;
					i = _tmp8_ + 1;
				}
				_tmp7_ = FALSE;
				if (!(i < g_list_model_get_n_items ((GListModel*) _data91_->chat_store))) {
					break;
				}
				_tmp9_ = g_list_model_get_item ((GListModel*) _data91_->chat_store, i);
				chat = G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, DC_TYPE_CHAT_ENTRY, DcChatEntry);
				_tmp11_ = query;
				_tmp12_ = strlen (_tmp11_);
				_tmp13_ = _tmp12_;
				if (_tmp13_ == 0) {
					_tmp10_ = TRUE;
				} else {
					DcChatEntry* _tmp14_;
					const gchar* _tmp15_;
					const gchar* _tmp16_;
					gchar* _tmp17_;
					gchar* _tmp18_;
					const gchar* _tmp19_;
					_tmp14_ = chat;
					_tmp15_ = dc_chat_entry_get_name (_tmp14_);
					_tmp16_ = _tmp15_;
					_tmp17_ = g_utf8_strdown (_tmp16_, (gssize) -1);
					_tmp18_ = _tmp17_;
					_tmp19_ = query;
					_tmp10_ = string_contains (_tmp18_, _tmp19_);
					_g_free0 (_tmp18_);
				}
				if (_tmp10_) {
					DcChatEntry* _tmp20_;
					gint _tmp21_;
					gint _tmp22_;
					adw_dialog_close ((AdwDialog*) self);
					_tmp20_ = chat;
					_tmp21_ = dc_chat_entry_get_id (_tmp20_);
					_tmp22_ = _tmp21_;
					g_signal_emit (self, dc_quick_switch_dialog_signals[DC_QUICK_SWITCH_DIALOG_CHAT_SELECTED_SIGNAL], 0, _tmp22_);
					_g_object_unref0 (chat);
					_g_free0 (query);
					return;
				}
				_g_object_unref0 (chat);
			}
		}
	}
	_g_free0 (query);
}

static void
___lambda427__gtk_search_entry_activate (GtkSearchEntry* _sender,
                                         gpointer self)
{
	__lambda427_ (self);
}

static void
__lambda428_ (DcQuickSwitchDialog* self,
              GtkListBoxRow* row)
{
	AdwActionRow* action_row = NULL;
	AdwActionRow* _tmp0_;
	AdwActionRow* _tmp1_;
	gint cid = 0;
	AdwActionRow* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	g_return_if_fail (row != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (row, adw_action_row_get_type ()) ? ((AdwActionRow*) row) : NULL);
	action_row = _tmp0_;
	_tmp1_ = action_row;
	if (_tmp1_ == NULL) {
		_g_object_unref0 (action_row);
		return;
	}
	_tmp2_ = action_row;
	_tmp3_ = gtk_widget_get_name ((GtkWidget*) _tmp2_);
	_tmp4_ = _tmp3_;
	cid = atoi (_tmp4_);
	adw_dialog_close ((AdwDialog*) self);
	g_signal_emit (self, dc_quick_switch_dialog_signals[DC_QUICK_SWITCH_DIALOG_CHAT_SELECTED_SIGNAL], 0, cid);
	_g_object_unref0 (action_row);
}

static void
___lambda428__gtk_list_box_row_activated (GtkListBox* _sender,
                                          GtkListBoxRow* row,
                                          gpointer self)
{
	__lambda428_ ((DcQuickSwitchDialog*) self, row);
}

DcQuickSwitchDialog*
dc_quick_switch_dialog_construct (GType object_type,
                                  GListStore* chat_store)
{
	DcQuickSwitchDialog * self = NULL;
	Block91Data* _data91_;
	GListStore* _tmp0_;
	GListStore* _tmp1_;
	GtkBox* box = NULL;
	GtkBox* _tmp2_;
	AdwHeaderBar* header = NULL;
	AdwHeaderBar* _tmp3_;
	GtkBox* _tmp4_;
	AdwHeaderBar* _tmp5_;
	GtkBox* inner = NULL;
	GtkBox* _tmp6_;
	GtkBox* _tmp7_;
	GtkBox* _tmp8_;
	GtkBox* _tmp9_;
	GtkBox* _tmp10_;
	GtkSearchEntry* _tmp11_;
	GtkSearchEntry* _tmp12_;
	GtkSearchEntry* _tmp13_;
	GtkBox* _tmp14_;
	GtkSearchEntry* _tmp15_;
	GtkScrolledWindow* scroll = NULL;
	GtkScrolledWindow* _tmp16_;
	GtkScrolledWindow* _tmp17_;
	GtkScrolledWindow* _tmp18_;
	GtkListBox* _tmp19_;
	GtkListBox* _tmp20_;
	GtkListBox* _tmp21_;
	GtkScrolledWindow* _tmp22_;
	GtkListBox* _tmp23_;
	GtkBox* _tmp24_;
	GtkScrolledWindow* _tmp25_;
	GtkListBox* _tmp33_;
	GtkSearchEntry* _tmp34_;
	GtkSearchEntry* _tmp35_;
	GtkListBox* _tmp36_;
	GtkBox* _tmp37_;
	GtkBox* _tmp38_;
	GtkBox* _tmp39_;
	g_return_val_if_fail (chat_store != NULL, NULL);
	_data91_ = g_slice_new0 (Block91Data);
	_data91_->_ref_count_ = 1;
	_tmp0_ = _g_object_ref0 (chat_store);
	_g_object_unref0 (_data91_->chat_store);
	_data91_->chat_store = _tmp0_;
	self = (DcQuickSwitchDialog*) g_object_new (object_type, NULL);
	_data91_->self = g_object_ref (self);
	_tmp1_ = _g_object_ref0 (_data91_->chat_store);
	_g_object_unref0 (self->priv->chat_store);
	self->priv->chat_store = _tmp1_;
	adw_dialog_set_title ((AdwDialog*) self, "Switch Chat");
	adw_dialog_set_content_width ((AdwDialog*) self, 360);
	adw_dialog_set_content_height ((AdwDialog*) self, 400);
	_tmp2_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	g_object_ref_sink (_tmp2_);
	box = _tmp2_;
	_tmp3_ = (AdwHeaderBar*) adw_header_bar_new ();
	g_object_ref_sink (_tmp3_);
	header = _tmp3_;
	_tmp4_ = box;
	_tmp5_ = header;
	gtk_box_append (_tmp4_, (GtkWidget*) _tmp5_);
	_tmp6_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
	g_object_ref_sink (_tmp6_);
	inner = _tmp6_;
	_tmp7_ = inner;
	gtk_widget_set_margin_start ((GtkWidget*) _tmp7_, 12);
	_tmp8_ = inner;
	gtk_widget_set_margin_end ((GtkWidget*) _tmp8_, 12);
	_tmp9_ = inner;
	gtk_widget_set_margin_top ((GtkWidget*) _tmp9_, 8);
	_tmp10_ = inner;
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp10_, 12);
	_tmp11_ = (GtkSearchEntry*) gtk_search_entry_new ();
	g_object_ref_sink (_tmp11_);
	_g_object_unref0 (self->priv->entry);
	self->priv->entry = _tmp11_;
	_tmp12_ = self->priv->entry;
	g_object_set (_tmp12_, "placeholder-text", "Type to filter chats\u2026", NULL);
	_tmp13_ = self->priv->entry;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp13_, TRUE);
	_tmp14_ = inner;
	_tmp15_ = self->priv->entry;
	gtk_box_append (_tmp14_, (GtkWidget*) _tmp15_);
	_tmp16_ = (GtkScrolledWindow*) gtk_scrolled_window_new ();
	g_object_ref_sink (_tmp16_);
	scroll = _tmp16_;
	_tmp17_ = scroll;
	gtk_widget_set_vexpand ((GtkWidget*) _tmp17_, TRUE);
	_tmp18_ = scroll;
	g_object_set (_tmp18_, "hscrollbar-policy", GTK_POLICY_NEVER, NULL);
	_tmp19_ = (GtkListBox*) gtk_list_box_new ();
	g_object_ref_sink (_tmp19_);
	_g_object_unref0 (self->priv->listbox);
	self->priv->listbox = _tmp19_;
	_tmp20_ = self->priv->listbox;
	gtk_list_box_set_selection_mode (_tmp20_, GTK_SELECTION_SINGLE);
	_tmp21_ = self->priv->listbox;
	gtk_widget_add_css_class ((GtkWidget*) _tmp21_, "boxed-list");
	_tmp22_ = scroll;
	_tmp23_ = self->priv->listbox;
	gtk_scrolled_window_set_child (_tmp22_, (GtkWidget*) _tmp23_);
	_tmp24_ = inner;
	_tmp25_ = scroll;
	gtk_box_append (_tmp24_, (GtkWidget*) _tmp25_);
	{
		guint i = 0U;
		i = (guint) 0;
		{
			gboolean _tmp26_ = FALSE;
			_tmp26_ = TRUE;
			while (TRUE) {
				DcChatEntry* chat = NULL;
				GObject* _tmp28_;
				GtkListBox* _tmp29_;
				DcChatEntry* _tmp30_;
				AdwActionRow* _tmp31_;
				AdwActionRow* _tmp32_;
				if (!_tmp26_) {
					guint _tmp27_;
					_tmp27_ = i;
					i = _tmp27_ + 1;
				}
				_tmp26_ = FALSE;
				if (!(i < g_list_model_get_n_items ((GListModel*) _data91_->chat_store))) {
					break;
				}
				_tmp28_ = g_list_model_get_item ((GListModel*) _data91_->chat_store, i);
				chat = G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, DC_TYPE_CHAT_ENTRY, DcChatEntry);
				_tmp29_ = self->priv->listbox;
				_tmp30_ = chat;
				_tmp31_ = dc_chat_pick_row (_tmp30_);
				_tmp32_ = _tmp31_;
				gtk_list_box_append (_tmp29_, (GtkWidget*) _tmp32_);
				_g_object_unref0 (_tmp32_);
				_g_object_unref0 (chat);
			}
		}
	}
	_tmp33_ = self->priv->listbox;
	gtk_list_box_set_filter_func (_tmp33_, ___lambda425__gtk_list_box_filter_func, g_object_ref (self), g_object_unref);
	_tmp34_ = self->priv->entry;
	g_signal_connect_object (_tmp34_, "search-changed", (GCallback) ___lambda426__gtk_search_entry_search_changed, self, 0);
	_tmp35_ = self->priv->entry;
	g_signal_connect_data (_tmp35_, "activate", (GCallback) ___lambda427__gtk_search_entry_activate, block91_data_ref (_data91_), (GClosureNotify) block91_data_unref, 0);
	_tmp36_ = self->priv->listbox;
	g_signal_connect_object (_tmp36_, "row-activated", (GCallback) ___lambda428__gtk_list_box_row_activated, self, 0);
	dc_install_escape_close ((AdwDialog*) self);
	_tmp37_ = box;
	_tmp38_ = inner;
	gtk_box_append (_tmp37_, (GtkWidget*) _tmp38_);
	_tmp39_ = box;
	adw_dialog_set_child ((AdwDialog*) self, (GtkWidget*) _tmp39_);
	_g_object_unref0 (scroll);
	_g_object_unref0 (inner);
	_g_object_unref0 (header);
	_g_object_unref0 (box);
	block91_data_unref (_data91_);
	_data91_ = NULL;
	return self;
}

DcQuickSwitchDialog*
dc_quick_switch_dialog_new (GListStore* chat_store)
{
	return dc_quick_switch_dialog_construct (DC_TYPE_QUICK_SWITCH_DIALOG, chat_store);
}

void
dc_quick_switch_dialog_focus_entry (DcQuickSwitchDialog* self)
{
	GtkSearchEntry* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->entry;
	gtk_widget_grab_focus ((GtkWidget*) _tmp0_);
}

static void
dc_quick_switch_dialog_class_init (DcQuickSwitchDialogClass * klass,
                                   gpointer klass_data)
{
	dc_quick_switch_dialog_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DcQuickSwitchDialog_private_offset);
	G_OBJECT_CLASS (klass)->finalize = dc_quick_switch_dialog_finalize;
	dc_quick_switch_dialog_signals[DC_QUICK_SWITCH_DIALOG_CHAT_SELECTED_SIGNAL] = g_signal_new ("chat-selected", DC_TYPE_QUICK_SWITCH_DIALOG, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
}

static void
dc_quick_switch_dialog_instance_init (DcQuickSwitchDialog * self,
                                      gpointer klass)
{
	self->priv = dc_quick_switch_dialog_get_instance_private (self);
}

static void
dc_quick_switch_dialog_finalize (GObject * obj)
{
	DcQuickSwitchDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DC_TYPE_QUICK_SWITCH_DIALOG, DcQuickSwitchDialog);
	_g_object_unref0 (self->priv->chat_store);
	_g_object_unref0 (self->priv->entry);
	_g_object_unref0 (self->priv->listbox);
	G_OBJECT_CLASS (dc_quick_switch_dialog_parent_class)->finalize (obj);
}

static GType
dc_quick_switch_dialog_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DcQuickSwitchDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dc_quick_switch_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DcQuickSwitchDialog), 0, (GInstanceInitFunc) dc_quick_switch_dialog_instance_init, NULL };
	GType dc_quick_switch_dialog_type_id;
	dc_quick_switch_dialog_type_id = g_type_register_static (adw_dialog_get_type (), "DcQuickSwitchDialog", &g_define_type_info, 0);
	DcQuickSwitchDialog_private_offset = g_type_add_instance_private (dc_quick_switch_dialog_type_id, sizeof (DcQuickSwitchDialogPrivate));
	return dc_quick_switch_dialog_type_id;
}

GType
dc_quick_switch_dialog_get_type (void)
{
	static volatile gsize dc_quick_switch_dialog_type_id__once = 0;
	if (g_once_init_enter (&dc_quick_switch_dialog_type_id__once)) {
		GType dc_quick_switch_dialog_type_id;
		dc_quick_switch_dialog_type_id = dc_quick_switch_dialog_get_type_once ();
		g_once_init_leave (&dc_quick_switch_dialog_type_id__once, dc_quick_switch_dialog_type_id);
	}
	return dc_quick_switch_dialog_type_id__once;
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

