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

/*
 * Copyright © 2023 Alain M. (https://github.com/alainm23/planify)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301 USA
 *
 * Authored by: Alain M. <alainmh23@gmail.com>
 */

#include <adwaita.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <gio/gio.h>
#include <glib.h>
#include <gdk/gdk.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include <math.h>
#include "planify.h"
#include <gee.h>
#include <glib/gi18n-lib.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 DIALOGS_QUICK_FIND_TYPE_QUICK_FIND (dialogs_quick_find_quick_find_get_type ())
#define DIALOGS_QUICK_FIND_QUICK_FIND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DIALOGS_QUICK_FIND_TYPE_QUICK_FIND, DialogsQuickFindQuickFind))
#define DIALOGS_QUICK_FIND_QUICK_FIND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DIALOGS_QUICK_FIND_TYPE_QUICK_FIND, DialogsQuickFindQuickFindClass))
#define DIALOGS_QUICK_FIND_IS_QUICK_FIND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DIALOGS_QUICK_FIND_TYPE_QUICK_FIND))
#define DIALOGS_QUICK_FIND_IS_QUICK_FIND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DIALOGS_QUICK_FIND_TYPE_QUICK_FIND))
#define DIALOGS_QUICK_FIND_QUICK_FIND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DIALOGS_QUICK_FIND_TYPE_QUICK_FIND, DialogsQuickFindQuickFindClass))

typedef struct _DialogsQuickFindQuickFind DialogsQuickFindQuickFind;
typedef struct _DialogsQuickFindQuickFindClass DialogsQuickFindQuickFindClass;
typedef struct _DialogsQuickFindQuickFindPrivate DialogsQuickFindQuickFindPrivate;
enum  {
	DIALOGS_QUICK_FIND_QUICK_FIND_0_PROPERTY,
	DIALOGS_QUICK_FIND_QUICK_FIND_NUM_PROPERTIES
};
static GParamSpec* dialogs_quick_find_quick_find_properties[DIALOGS_QUICK_FIND_QUICK_FIND_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))

#define DIALOGS_QUICK_FIND_TYPE_QUICK_FIND_ITEM (dialogs_quick_find_quick_find_item_get_type ())
#define DIALOGS_QUICK_FIND_QUICK_FIND_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DIALOGS_QUICK_FIND_TYPE_QUICK_FIND_ITEM, DialogsQuickFindQuickFindItem))
#define DIALOGS_QUICK_FIND_QUICK_FIND_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DIALOGS_QUICK_FIND_TYPE_QUICK_FIND_ITEM, DialogsQuickFindQuickFindItemClass))
#define DIALOGS_QUICK_FIND_IS_QUICK_FIND_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DIALOGS_QUICK_FIND_TYPE_QUICK_FIND_ITEM))
#define DIALOGS_QUICK_FIND_IS_QUICK_FIND_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DIALOGS_QUICK_FIND_TYPE_QUICK_FIND_ITEM))
#define DIALOGS_QUICK_FIND_QUICK_FIND_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DIALOGS_QUICK_FIND_TYPE_QUICK_FIND_ITEM, DialogsQuickFindQuickFindItemClass))

typedef struct _DialogsQuickFindQuickFindItem DialogsQuickFindQuickFindItem;
typedef struct _DialogsQuickFindQuickFindItemClass DialogsQuickFindQuickFindItemClass;
typedef struct _Block93Data Block93Data;

#define DIALOGS_QUICK_FIND_TYPE_QUICK_FIND_SECTION_SORTER (dialogs_quick_find_quick_find_section_sorter_get_type ())
#define DIALOGS_QUICK_FIND_QUICK_FIND_SECTION_SORTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DIALOGS_QUICK_FIND_TYPE_QUICK_FIND_SECTION_SORTER, DialogsQuickFindQuickFindSectionSorter))
#define DIALOGS_QUICK_FIND_QUICK_FIND_SECTION_SORTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DIALOGS_QUICK_FIND_TYPE_QUICK_FIND_SECTION_SORTER, DialogsQuickFindQuickFindSectionSorterClass))
#define DIALOGS_QUICK_FIND_IS_QUICK_FIND_SECTION_SORTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DIALOGS_QUICK_FIND_TYPE_QUICK_FIND_SECTION_SORTER))
#define DIALOGS_QUICK_FIND_IS_QUICK_FIND_SECTION_SORTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DIALOGS_QUICK_FIND_TYPE_QUICK_FIND_SECTION_SORTER))
#define DIALOGS_QUICK_FIND_QUICK_FIND_SECTION_SORTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DIALOGS_QUICK_FIND_TYPE_QUICK_FIND_SECTION_SORTER, DialogsQuickFindQuickFindSectionSorterClass))

typedef struct _DialogsQuickFindQuickFindSectionSorter DialogsQuickFindQuickFindSectionSorter;
typedef struct _DialogsQuickFindQuickFindSectionSorterClass DialogsQuickFindQuickFindSectionSorterClass;

struct _DialogsQuickFindQuickFind {
	AdwDialog parent_instance;
	DialogsQuickFindQuickFindPrivate * priv;
};

struct _DialogsQuickFindQuickFindClass {
	AdwDialogClass parent_class;
};

struct _DialogsQuickFindQuickFindPrivate {
	GtkSearchEntry* search_entry;
	GtkListView* list_view;
	GtkScrolledWindow* list_view_scrolled;
	GListStore* list_store;
	GtkFilterListModel* filter_model;
	GtkCustomFilter* custom_filter;
	GtkSingleSelection* selection_model;
	GtkSignalListItemFactory* list_item_factory;
	GtkSignalListItemFactory* header_factory;
	GtkStack* stack;
};

struct _Block93Data {
	int _ref_count_;
	DialogsQuickFindQuickFind* self;
	ObjectsBaseObject* base_object;
};

static gint DialogsQuickFindQuickFind_private_offset;
static gpointer dialogs_quick_find_quick_find_parent_class = NULL;

VALA_EXTERN GType dialogs_quick_find_quick_find_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DialogsQuickFindQuickFind, g_object_unref)
VALA_EXTERN DialogsQuickFindQuickFind* dialogs_quick_find_quick_find_new (void);
VALA_EXTERN DialogsQuickFindQuickFind* dialogs_quick_find_quick_find_construct (GType object_type);
static gboolean dialogs_quick_find_quick_find_key_pressed (DialogsQuickFindQuickFind* self,
                                                    guint keyval,
                                                    guint keycode,
                                                    GdkModifierType state);
VALA_EXTERN GType dialogs_quick_find_quick_find_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DialogsQuickFindQuickFindItem, g_object_unref)
static void dialogs_quick_find_quick_find_activate_item (DialogsQuickFindQuickFind* self,
                                                  DialogsQuickFindQuickFindItem* item);
static void dialogs_quick_find_quick_find_search_changed (DialogsQuickFindQuickFind* self);
VALA_EXTERN void dialogs_quick_find_quick_find_item_set_pattern (DialogsQuickFindQuickFindItem* self,
                                                     const gchar* value);
static gboolean ___lambda893_ (DialogsQuickFindQuickFind* self);
static gboolean ____lambda893__gsource_func (gpointer self);
static void dialogs_quick_find_quick_find_populate_store (DialogsQuickFindQuickFind* self);
VALA_EXTERN DialogsQuickFindQuickFindItem* dialogs_quick_find_quick_find_item_new (ObjectsBaseObject* base_object,
                                                                       const gchar* pattern);
VALA_EXTERN DialogsQuickFindQuickFindItem* dialogs_quick_find_quick_find_item_construct (GType object_type,
                                                                             ObjectsBaseObject* base_object,
                                                                             const gchar* pattern);
static gboolean dialogs_quick_find_quick_find_item_matches_search (DialogsQuickFindQuickFind* self,
                                                            DialogsQuickFindQuickFindItem* item,
                                                            const gchar* search_text_lower);
VALA_EXTERN ObjectsBaseObject* dialogs_quick_find_quick_find_item_get_base_object (DialogsQuickFindQuickFindItem* self);
static GtkWidget* dialogs_quick_find_quick_find_get_placeholder (DialogsQuickFindQuickFind* self);
static Block93Data* block93_data_ref (Block93Data* _data93_);
static void block93_data_unref (void * _userdata_);
static gboolean _____lambda892_ (Block93Data* _data93_);
static gboolean ______lambda892__gsource_func (gpointer self);
static void dialogs_quick_find_quick_find_hide_destroy (DialogsQuickFindQuickFind* self);
static GObject * dialogs_quick_find_quick_find_constructor (GType type,
                                                     guint n_construct_properties,
                                                     GObjectConstructParam * construct_properties);
static gboolean _dialogs_quick_find_quick_find___lambda894_ (DialogsQuickFindQuickFind* self,
                                                      GObject* obj);
static gboolean __dialogs_quick_find_quick_find___lambda894__gtk_custom_filter_func (GObject* item,
                                                                              gpointer self);
VALA_EXTERN DialogsQuickFindQuickFindSectionSorter* dialogs_quick_find_quick_find_section_sorter_new (void);
VALA_EXTERN DialogsQuickFindQuickFindSectionSorter* dialogs_quick_find_quick_find_section_sorter_construct (GType object_type);
VALA_EXTERN GType dialogs_quick_find_quick_find_section_sorter_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DialogsQuickFindQuickFindSectionSorter, g_object_unref)
VALA_EXTERN GtkSignalListItemFactory* dialogs_quick_find_quick_find_factory_create_list_item_factory (void);
VALA_EXTERN GtkSignalListItemFactory* dialogs_quick_find_quick_find_factory_create_header_factory (void);
static void _dialogs_quick_find_quick_find___lambda896_ (DialogsQuickFindQuickFind* self,
                                                  guint position);
static void __dialogs_quick_find_quick_find___lambda896__gtk_list_view_activate (GtkListView* _sender,
                                                                          guint position,
                                                                          gpointer self);
static void _dialogs_quick_find_quick_find___lambda897_ (DialogsQuickFindQuickFind* self);
static void __dialogs_quick_find_quick_find___lambda897__gtk_search_entry_search_changed (GtkSearchEntry* _sender,
                                                                                   gpointer self);
static void _dialogs_quick_find_quick_find___lambda898_ (DialogsQuickFindQuickFind* self);
static void __dialogs_quick_find_quick_find___lambda898__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                                             gint n_press,
                                                                             gdouble x,
                                                                             gdouble y,
                                                                             gpointer self);
static gboolean _dialogs_quick_find_quick_find_key_pressed_gtk_event_controller_key_key_pressed (GtkEventControllerKey* _sender,
                                                                                          guint keyval,
                                                                                          guint keycode,
                                                                                          GdkModifierType state,
                                                                                          gpointer self);
static gboolean _dialogs_quick_find_quick_find___lambda899_ (DialogsQuickFindQuickFind* self,
                                                      guint keyval,
                                                      guint keycode,
                                                      GdkModifierType state);
static gboolean __dialogs_quick_find_quick_find___lambda899__gtk_event_controller_key_key_pressed (GtkEventControllerKey* _sender,
                                                                                            guint keyval,
                                                                                            guint keycode,
                                                                                            GdkModifierType state,
                                                                                            gpointer self);
static gboolean _dialogs_quick_find_quick_find___lambda900_ (DialogsQuickFindQuickFind* self,
                                                      guint keyval,
                                                      guint keycode,
                                                      GdkModifierType state);
static gboolean __dialogs_quick_find_quick_find___lambda900__gtk_event_controller_key_key_pressed (GtkEventControllerKey* _sender,
                                                                                            guint keyval,
                                                                                            guint keycode,
                                                                                            GdkModifierType state,
                                                                                            gpointer self);
static void _dialogs_quick_find_quick_find___lambda901_ (DialogsQuickFindQuickFind* self);
static void __dialogs_quick_find_quick_find___lambda901__gtk_button_clicked (GtkButton* _sender,
                                                                      gpointer self);
static void _dialogs_quick_find_quick_find___lambda902_ (DialogsQuickFindQuickFind* self);
static void __dialogs_quick_find_quick_find___lambda902__adw_dialog_closed (AdwDialog* _sender,
                                                                     gpointer self);
static void dialogs_quick_find_quick_find_finalize (GObject * obj);
static GType dialogs_quick_find_quick_find_get_type_once (void);
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 inline gpointer
dialogs_quick_find_quick_find_get_instance_private (DialogsQuickFindQuickFind* self)
{
	return G_STRUCT_MEMBER_P (self, DialogsQuickFindQuickFind_private_offset);
}

DialogsQuickFindQuickFind*
dialogs_quick_find_quick_find_construct (GType object_type)
{
	DialogsQuickFindQuickFind * self = NULL;
	self = (DialogsQuickFindQuickFind*) g_object_new (object_type, "content-width", 425, "content-height", 350, "presentation-mode", ADW_DIALOG_FLOATING, NULL);
	return self;
}

DialogsQuickFindQuickFind*
dialogs_quick_find_quick_find_new (void)
{
	return dialogs_quick_find_quick_find_construct (DIALOGS_QUICK_FIND_TYPE_QUICK_FIND);
}

static gchar*
string_replace (const gchar* self,
                const gchar* old,
                const gchar* replacement)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (old != NULL, NULL);
	g_return_val_if_fail (replacement != NULL, NULL);
	if ((*((gchar*) self)) == '\0') {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = (*((gchar*) old)) == '\0';
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = g_strcmp0 (old, replacement) == 0;
	}
	if (_tmp0_) {
		gchar* _tmp2_;
		_tmp2_ = g_strdup (self);
		result = _tmp2_;
		return result;
	}
	{
		GRegex* regex = NULL;
		gchar* _tmp3_;
		gchar* _tmp4_;
		GRegex* _tmp5_;
		GRegex* _tmp6_;
		gchar* _tmp7_ = NULL;
		GRegex* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		_tmp3_ = g_regex_escape_string (old, -1);
		_tmp4_ = _tmp3_;
		_tmp5_ = g_regex_new (_tmp4_, 0, 0, &_inner_error0_);
		_tmp6_ = _tmp5_;
		_g_free0 (_tmp4_);
		regex = _tmp6_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			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 NULL;
		}
		_tmp8_ = regex;
		_tmp9_ = g_regex_replace_literal (_tmp8_, self, (gssize) -1, 0, replacement, 0, &_inner_error0_);
		_tmp7_ = _tmp9_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_regex_unref0 (regex);
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			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 NULL;
		}
		_tmp10_ = _tmp7_;
		_tmp7_ = NULL;
		result = _tmp10_;
		_g_free0 (_tmp7_);
		_g_regex_unref0 (regex);
		return result;
	}
	goto __finally0;
	__catch0_g_regex_error:
	{
		g_clear_error (&_inner_error0_);
		g_assert_not_reached ();
	}
	__finally0:
	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 NULL;
}

static gchar*
g_unichar_to_string (gunichar self)
{
	gchar* str = NULL;
	gchar* _tmp0_;
	gchar* result;
	_tmp0_ = g_new0 (gchar, 7);
	str = (gchar*) _tmp0_;
	g_unichar_to_utf8 (self, str);
	result = str;
	return result;
}

static gboolean
dialogs_quick_find_quick_find_key_pressed (DialogsQuickFindQuickFind* self,
                                           guint keyval,
                                           guint keycode,
                                           GdkModifierType state)
{
	gchar* key = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = gdk_keyval_name (keyval);
	_tmp1_ = string_replace (_tmp0_, "KP_", "");
	key = _tmp1_;
	_tmp2_ = key;
	if (g_strcmp0 (_tmp2_, "Up") == 0) {
		guint selected = 0U;
		GtkSingleSelection* _tmp3_;
		_tmp3_ = self->priv->selection_model;
		selected = gtk_single_selection_get_selected (_tmp3_);
		if (selected == ((guint) 0)) {
			GtkSearchEntry* _tmp4_;
			GtkSearchEntry* _tmp5_;
			GtkSearchEntry* _tmp6_;
			const gchar* _tmp7_;
			const gchar* _tmp8_;
			gint _tmp9_;
			gint _tmp10_;
			_tmp4_ = self->priv->search_entry;
			gtk_widget_grab_focus ((GtkWidget*) _tmp4_);
			_tmp5_ = self->priv->search_entry;
			_tmp6_ = self->priv->search_entry;
			_tmp7_ = gtk_editable_get_text ((GtkEditable*) _tmp6_);
			_tmp8_ = _tmp7_;
			_tmp9_ = strlen (_tmp8_);
			_tmp10_ = _tmp9_;
			gtk_editable_set_position ((GtkEditable*) _tmp5_, _tmp10_);
			result = TRUE;
			_g_free0 (key);
			return result;
		}
	} else {
		const gchar* _tmp11_;
		_tmp11_ = key;
		if (g_strcmp0 (_tmp11_, "Down") == 0) {
		} else {
			gboolean _tmp12_ = FALSE;
			gboolean _tmp13_ = FALSE;
			const gchar* _tmp14_;
			_tmp14_ = key;
			if (g_strcmp0 (_tmp14_, "Enter") == 0) {
				_tmp13_ = TRUE;
			} else {
				const gchar* _tmp15_;
				_tmp15_ = key;
				_tmp13_ = g_strcmp0 (_tmp15_, "Return") == 0;
			}
			if (_tmp13_) {
				_tmp12_ = TRUE;
			} else {
				const gchar* _tmp16_;
				_tmp16_ = key;
				_tmp12_ = g_strcmp0 (_tmp16_, "KP_Enter") == 0;
			}
			if (_tmp12_) {
				guint selected = 0U;
				GtkSingleSelection* _tmp17_;
				_tmp17_ = self->priv->selection_model;
				selected = gtk_single_selection_get_selected (_tmp17_);
				if (selected != GTK_INVALID_LIST_POSITION) {
					GObject* item = NULL;
					GtkSingleSelection* _tmp18_;
					GObject* _tmp19_;
					GObject* _tmp20_;
					_tmp18_ = self->priv->selection_model;
					_tmp19_ = g_list_model_get_item ((GListModel*) _tmp18_, selected);
					item = _tmp19_;
					_tmp20_ = item;
					if (_tmp20_ != NULL) {
						GObject* _tmp21_;
						_tmp21_ = item;
						dialogs_quick_find_quick_find_activate_item (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, DIALOGS_QUICK_FIND_TYPE_QUICK_FIND_ITEM, DialogsQuickFindQuickFindItem));
					}
					_g_object_unref0 (item);
				}
			} else {
				const gchar* _tmp22_;
				_tmp22_ = key;
				if (g_strcmp0 (_tmp22_, "BackSpace") == 0) {
					gboolean _tmp23_ = FALSE;
					GtkSearchEntry* _tmp24_;
					gboolean _tmp25_;
					gboolean _tmp26_;
					_tmp24_ = self->priv->search_entry;
					g_object_get ((GtkWidget*) _tmp24_, "has-focus", &_tmp25_, NULL);
					_tmp26_ = _tmp25_;
					if (!_tmp26_) {
						GtkSearchEntry* _tmp27_;
						const gchar* _tmp28_;
						const gchar* _tmp29_;
						gint _tmp30_;
						gint _tmp31_;
						_tmp27_ = self->priv->search_entry;
						_tmp28_ = gtk_editable_get_text ((GtkEditable*) _tmp27_);
						_tmp29_ = _tmp28_;
						_tmp30_ = strlen (_tmp29_);
						_tmp31_ = _tmp30_;
						_tmp23_ = _tmp31_ > 0;
					} else {
						_tmp23_ = FALSE;
					}
					if (_tmp23_) {
						GtkSearchEntry* _tmp32_;
						gint pos = 0;
						GtkSearchEntry* _tmp33_;
						const gchar* _tmp34_;
						const gchar* _tmp35_;
						gint _tmp36_;
						gint _tmp37_;
						GtkSearchEntry* _tmp38_;
						GtkSearchEntry* _tmp39_;
						_tmp32_ = self->priv->search_entry;
						gtk_widget_grab_focus ((GtkWidget*) _tmp32_);
						_tmp33_ = self->priv->search_entry;
						_tmp34_ = gtk_editable_get_text ((GtkEditable*) _tmp33_);
						_tmp35_ = _tmp34_;
						_tmp36_ = strlen (_tmp35_);
						_tmp37_ = _tmp36_;
						pos = _tmp37_;
						_tmp38_ = self->priv->search_entry;
						g_signal_emit_by_name ((GtkEditable*) _tmp38_, "delete-text", pos - 1, pos);
						_tmp39_ = self->priv->search_entry;
						gtk_editable_set_position ((GtkEditable*) _tmp39_, pos - 1);
						result = TRUE;
						_g_free0 (key);
						return result;
					}
				} else {
					GtkSearchEntry* _tmp40_;
					gboolean _tmp41_;
					gboolean _tmp42_;
					_tmp40_ = self->priv->search_entry;
					g_object_get ((GtkWidget*) _tmp40_, "has-focus", &_tmp41_, NULL);
					_tmp42_ = _tmp41_;
					if (!_tmp42_) {
						gunichar c = 0U;
						c = (gunichar) gdk_keyval_to_unicode (keyval);
						if (g_unichar_isprint (c)) {
							GtkSearchEntry* _tmp43_;
							gint pos = 0;
							GtkSearchEntry* _tmp44_;
							const gchar* _tmp45_;
							const gchar* _tmp46_;
							gint _tmp47_;
							gint _tmp48_;
							GtkSearchEntry* _tmp49_;
							gchar* _tmp50_;
							gchar* _tmp51_;
							GtkSearchEntry* _tmp52_;
							_tmp43_ = self->priv->search_entry;
							gtk_widget_grab_focus ((GtkWidget*) _tmp43_);
							_tmp44_ = self->priv->search_entry;
							_tmp45_ = gtk_editable_get_text ((GtkEditable*) _tmp44_);
							_tmp46_ = _tmp45_;
							_tmp47_ = strlen (_tmp46_);
							_tmp48_ = _tmp47_;
							pos = _tmp48_;
							_tmp49_ = self->priv->search_entry;
							_tmp50_ = g_unichar_to_string (c);
							_tmp51_ = _tmp50_;
							g_signal_emit_by_name ((GtkEditable*) _tmp49_, "insert-text", _tmp51_, -1, &pos);
							_g_free0 (_tmp51_);
							_tmp52_ = self->priv->search_entry;
							gtk_editable_set_position ((GtkEditable*) _tmp52_, pos);
							result = TRUE;
							_g_free0 (key);
							return result;
						}
					}
				}
			}
		}
	}
	result = FALSE;
	_g_free0 (key);
	return result;
}

static gboolean
___lambda893_ (DialogsQuickFindQuickFind* self)
{
	GtkScrolledWindow* _tmp0_;
	GtkAdjustment* _tmp1_;
	GtkAdjustment* _tmp2_;
	gboolean result;
	_tmp0_ = self->priv->list_view_scrolled;
	_tmp1_ = gtk_scrolled_window_get_vadjustment (_tmp0_);
	_tmp2_ = _tmp1_;
	gtk_adjustment_set_value (_tmp2_, (gdouble) 0);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
____lambda893__gsource_func (gpointer self)
{
	gboolean result;
	result = ___lambda893_ ((DialogsQuickFindQuickFind*) self);
	return result;
}

static void
dialogs_quick_find_quick_find_search_changed (DialogsQuickFindQuickFind* self)
{
	guint n_items = 0U;
	GListStore* _tmp0_;
	GtkCustomFilter* _tmp9_;
	gboolean has_results = FALSE;
	GtkFilterListModel* _tmp10_;
	const gchar* _tmp11_ = NULL;
	GtkStack* _tmp12_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->list_store;
	n_items = g_list_model_get_n_items ((GListModel*) _tmp0_);
	{
		guint i = 0U;
		i = (guint) 0;
		{
			gboolean _tmp1_ = FALSE;
			_tmp1_ = TRUE;
			while (TRUE) {
				DialogsQuickFindQuickFindItem* item = NULL;
				GListStore* _tmp3_;
				GObject* _tmp4_;
				DialogsQuickFindQuickFindItem* _tmp5_;
				GtkSearchEntry* _tmp6_;
				const gchar* _tmp7_;
				const gchar* _tmp8_;
				if (!_tmp1_) {
					guint _tmp2_;
					_tmp2_ = i;
					i = _tmp2_ + 1;
				}
				_tmp1_ = FALSE;
				if (!(i < n_items)) {
					break;
				}
				_tmp3_ = self->priv->list_store;
				_tmp4_ = g_list_model_get_item ((GListModel*) _tmp3_, i);
				item = G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, DIALOGS_QUICK_FIND_TYPE_QUICK_FIND_ITEM, DialogsQuickFindQuickFindItem);
				_tmp5_ = item;
				_tmp6_ = self->priv->search_entry;
				_tmp7_ = gtk_editable_get_text ((GtkEditable*) _tmp6_);
				_tmp8_ = _tmp7_;
				dialogs_quick_find_quick_find_item_set_pattern (_tmp5_, _tmp8_);
				_g_object_unref0 (item);
			}
		}
	}
	_tmp9_ = self->priv->custom_filter;
	gtk_filter_changed ((GtkFilter*) _tmp9_, GTK_FILTER_CHANGE_DIFFERENT);
	_tmp10_ = self->priv->filter_model;
	has_results = g_list_model_get_n_items ((GListModel*) _tmp10_) > ((guint) 0);
	if (has_results) {
		_tmp11_ = "list";
	} else {
		_tmp11_ = "placeholder";
	}
	_tmp12_ = self->priv->stack;
	gtk_stack_set_visible_child_name (_tmp12_, _tmp11_);
	if (has_results) {
		g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ____lambda893__gsource_func, g_object_ref (self), g_object_unref);
	}
}

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

static void
dialogs_quick_find_quick_find_populate_store (DialogsQuickFindQuickFind* self)
{
	ObjectsBaseObject** filters = NULL;
	ObjectsFiltersInbox* _tmp0_;
	ObjectsFiltersToday* _tmp1_;
	ObjectsFiltersScheduled* _tmp2_;
	ObjectsFiltersPinboard* _tmp3_;
	ObjectsFiltersPriority* _tmp4_;
	ObjectsFiltersPriority* _tmp5_;
	ObjectsFiltersPriority* _tmp6_;
	ObjectsFiltersPriority* _tmp7_;
	ObjectsFiltersLabels* _tmp8_;
	ObjectsFiltersCompleted* _tmp9_;
	ObjectsFiltersTomorrow* _tmp10_;
	ObjectsFiltersAnytime* _tmp11_;
	ObjectsFiltersRepeating* _tmp12_;
	ObjectsFiltersUnlabeled* _tmp13_;
	ObjectsFiltersAllItems* _tmp14_;
	ObjectsBaseObject** _tmp15_;
	gint filters_length1;
	gint _filters_size_;
	ObjectsBaseObject** _tmp16_;
	gint _tmp16__length1;
	g_return_if_fail (self != NULL);
	_tmp0_ = objects_filters_inbox_get_default ();
	_tmp1_ = objects_filters_today_get_default ();
	_tmp2_ = objects_filters_scheduled_get_default ();
	_tmp3_ = objects_filters_pinboard_get_default ();
	_tmp4_ = objects_filters_priority_high ();
	_tmp5_ = objects_filters_priority_medium ();
	_tmp6_ = objects_filters_priority_low ();
	_tmp7_ = objects_filters_priority_none ();
	_tmp8_ = objects_filters_labels_get_default ();
	_tmp9_ = objects_filters_completed_get_default ();
	_tmp10_ = objects_filters_tomorrow_get_default ();
	_tmp11_ = objects_filters_anytime_get_default ();
	_tmp12_ = objects_filters_repeating_get_default ();
	_tmp13_ = objects_filters_unlabeled_get_default ();
	_tmp14_ = objects_filters_all_items_get_default ();
	_tmp15_ = g_new0 (ObjectsBaseObject*, 15 + 1);
	_tmp15_[0] = (ObjectsBaseObject*) _tmp0_;
	_tmp15_[1] = (ObjectsBaseObject*) _tmp1_;
	_tmp15_[2] = (ObjectsBaseObject*) _tmp2_;
	_tmp15_[3] = (ObjectsBaseObject*) _tmp3_;
	_tmp15_[4] = (ObjectsBaseObject*) _tmp4_;
	_tmp15_[5] = (ObjectsBaseObject*) _tmp5_;
	_tmp15_[6] = (ObjectsBaseObject*) _tmp6_;
	_tmp15_[7] = (ObjectsBaseObject*) _tmp7_;
	_tmp15_[8] = (ObjectsBaseObject*) _tmp8_;
	_tmp15_[9] = (ObjectsBaseObject*) _tmp9_;
	_tmp15_[10] = (ObjectsBaseObject*) _tmp10_;
	_tmp15_[11] = (ObjectsBaseObject*) _tmp11_;
	_tmp15_[12] = (ObjectsBaseObject*) _tmp12_;
	_tmp15_[13] = (ObjectsBaseObject*) _tmp13_;
	_tmp15_[14] = (ObjectsBaseObject*) _tmp14_;
	filters = _tmp15_;
	filters_length1 = 15;
	_filters_size_ = filters_length1;
	_tmp16_ = filters;
	_tmp16__length1 = filters_length1;
	{
		ObjectsBaseObject** obj_collection = NULL;
		gint obj_collection_length1 = 0;
		gint _obj_collection_size_ = 0;
		gint obj_it = 0;
		obj_collection = _tmp16_;
		obj_collection_length1 = _tmp16__length1;
		for (obj_it = 0; obj_it < obj_collection_length1; obj_it = obj_it + 1) {
			ObjectsBaseObject* _tmp17_;
			ObjectsBaseObject* obj = NULL;
			_tmp17_ = _g_object_ref0 (obj_collection[obj_it]);
			obj = _tmp17_;
			{
				DialogsQuickFindQuickFindItem* item = NULL;
				ObjectsBaseObject* _tmp18_;
				DialogsQuickFindQuickFindItem* _tmp19_;
				GListStore* _tmp20_;
				DialogsQuickFindQuickFindItem* _tmp21_;
				_tmp18_ = obj;
				_tmp19_ = dialogs_quick_find_quick_find_item_new (_tmp18_, "");
				item = _tmp19_;
				_tmp20_ = self->priv->list_store;
				_tmp21_ = item;
				g_list_store_append (_tmp20_, (GObject*) _tmp21_);
				_g_object_unref0 (item);
				_g_object_unref0 (obj);
			}
		}
	}
	{
		GeeArrayList* _project_list = NULL;
		ServicesStore* _tmp22_;
		GeeArrayList* _tmp23_;
		GeeArrayList* _tmp24_;
		gint _project_size = 0;
		GeeArrayList* _tmp25_;
		gint _tmp26_;
		gint _tmp27_;
		gint _project_index = 0;
		_tmp22_ = services_store_instance ();
		_tmp23_ = services_store_get_projects (_tmp22_);
		_tmp24_ = _tmp23_;
		_project_list = _tmp24_;
		_tmp25_ = _project_list;
		_tmp26_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp25_);
		_tmp27_ = _tmp26_;
		_project_size = _tmp27_;
		_project_index = -1;
		while (TRUE) {
			gint _tmp28_;
			gint _tmp29_;
			ObjectsProject* project = NULL;
			GeeArrayList* _tmp30_;
			gpointer _tmp31_;
			DialogsQuickFindQuickFindItem* item = NULL;
			ObjectsProject* _tmp32_;
			DialogsQuickFindQuickFindItem* _tmp33_;
			GListStore* _tmp34_;
			DialogsQuickFindQuickFindItem* _tmp35_;
			_project_index = _project_index + 1;
			_tmp28_ = _project_index;
			_tmp29_ = _project_size;
			if (!(_tmp28_ < _tmp29_)) {
				break;
			}
			_tmp30_ = _project_list;
			_tmp31_ = gee_abstract_list_get ((GeeAbstractList*) _tmp30_, _project_index);
			project = (ObjectsProject*) _tmp31_;
			_tmp32_ = project;
			_tmp33_ = dialogs_quick_find_quick_find_item_new ((ObjectsBaseObject*) _tmp32_, "");
			item = _tmp33_;
			_tmp34_ = self->priv->list_store;
			_tmp35_ = item;
			g_list_store_append (_tmp34_, (GObject*) _tmp35_);
			_g_object_unref0 (item);
			_g_object_unref0 (project);
		}
	}
	{
		GeeArrayList* _section_list = NULL;
		ServicesStore* _tmp36_;
		GeeArrayList* _tmp37_;
		GeeArrayList* _tmp38_;
		gint _section_size = 0;
		GeeArrayList* _tmp39_;
		gint _tmp40_;
		gint _tmp41_;
		gint _section_index = 0;
		_tmp36_ = services_store_instance ();
		_tmp37_ = services_store_get_sections (_tmp36_);
		_tmp38_ = _tmp37_;
		_section_list = _tmp38_;
		_tmp39_ = _section_list;
		_tmp40_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp39_);
		_tmp41_ = _tmp40_;
		_section_size = _tmp41_;
		_section_index = -1;
		while (TRUE) {
			gint _tmp42_;
			gint _tmp43_;
			ObjectsSection* section = NULL;
			GeeArrayList* _tmp44_;
			gpointer _tmp45_;
			DialogsQuickFindQuickFindItem* item = NULL;
			ObjectsSection* _tmp46_;
			DialogsQuickFindQuickFindItem* _tmp47_;
			GListStore* _tmp48_;
			DialogsQuickFindQuickFindItem* _tmp49_;
			_section_index = _section_index + 1;
			_tmp42_ = _section_index;
			_tmp43_ = _section_size;
			if (!(_tmp42_ < _tmp43_)) {
				break;
			}
			_tmp44_ = _section_list;
			_tmp45_ = gee_abstract_list_get ((GeeAbstractList*) _tmp44_, _section_index);
			section = (ObjectsSection*) _tmp45_;
			_tmp46_ = section;
			_tmp47_ = dialogs_quick_find_quick_find_item_new ((ObjectsBaseObject*) _tmp46_, "");
			item = _tmp47_;
			_tmp48_ = self->priv->list_store;
			_tmp49_ = item;
			g_list_store_append (_tmp48_, (GObject*) _tmp49_);
			_g_object_unref0 (item);
			_g_object_unref0 (section);
		}
	}
	{
		GeeArrayList* _item_obj_list = NULL;
		ServicesStore* _tmp50_;
		GeeArrayList* _tmp51_;
		GeeArrayList* _tmp52_;
		gint _item_obj_size = 0;
		GeeArrayList* _tmp53_;
		gint _tmp54_;
		gint _tmp55_;
		gint _item_obj_index = 0;
		_tmp50_ = services_store_instance ();
		_tmp51_ = services_store_get_items (_tmp50_);
		_tmp52_ = _tmp51_;
		_item_obj_list = _tmp52_;
		_tmp53_ = _item_obj_list;
		_tmp54_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp53_);
		_tmp55_ = _tmp54_;
		_item_obj_size = _tmp55_;
		_item_obj_index = -1;
		while (TRUE) {
			gint _tmp56_;
			gint _tmp57_;
			ObjectsItem* item_obj = NULL;
			GeeArrayList* _tmp58_;
			gpointer _tmp59_;
			ObjectsItem* _tmp60_;
			ObjectsProject* _tmp61_;
			ObjectsProject* _tmp62_;
			_item_obj_index = _item_obj_index + 1;
			_tmp56_ = _item_obj_index;
			_tmp57_ = _item_obj_size;
			if (!(_tmp56_ < _tmp57_)) {
				break;
			}
			_tmp58_ = _item_obj_list;
			_tmp59_ = gee_abstract_list_get ((GeeAbstractList*) _tmp58_, _item_obj_index);
			item_obj = (ObjectsItem*) _tmp59_;
			_tmp60_ = item_obj;
			_tmp61_ = objects_item_get_project (_tmp60_);
			_tmp62_ = _tmp61_;
			if (_tmp62_ != NULL) {
				DialogsQuickFindQuickFindItem* item = NULL;
				ObjectsItem* _tmp63_;
				DialogsQuickFindQuickFindItem* _tmp64_;
				GListStore* _tmp65_;
				DialogsQuickFindQuickFindItem* _tmp66_;
				_tmp63_ = item_obj;
				_tmp64_ = dialogs_quick_find_quick_find_item_new ((ObjectsBaseObject*) _tmp63_, "");
				item = _tmp64_;
				_tmp65_ = self->priv->list_store;
				_tmp66_ = item;
				g_list_store_append (_tmp65_, (GObject*) _tmp66_);
				_g_object_unref0 (item);
			}
			_g_object_unref0 (item_obj);
		}
	}
	{
		GeeArrayList* _label_list = NULL;
		ServicesStore* _tmp67_;
		GeeArrayList* _tmp68_;
		GeeArrayList* _tmp69_;
		gint _label_size = 0;
		GeeArrayList* _tmp70_;
		gint _tmp71_;
		gint _tmp72_;
		gint _label_index = 0;
		_tmp67_ = services_store_instance ();
		_tmp68_ = services_store_get_labels (_tmp67_);
		_tmp69_ = _tmp68_;
		_label_list = _tmp69_;
		_tmp70_ = _label_list;
		_tmp71_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp70_);
		_tmp72_ = _tmp71_;
		_label_size = _tmp72_;
		_label_index = -1;
		while (TRUE) {
			gint _tmp73_;
			gint _tmp74_;
			ObjectsLabel* label = NULL;
			GeeArrayList* _tmp75_;
			gpointer _tmp76_;
			DialogsQuickFindQuickFindItem* item = NULL;
			ObjectsLabel* _tmp77_;
			DialogsQuickFindQuickFindItem* _tmp78_;
			GListStore* _tmp79_;
			DialogsQuickFindQuickFindItem* _tmp80_;
			_label_index = _label_index + 1;
			_tmp73_ = _label_index;
			_tmp74_ = _label_size;
			if (!(_tmp73_ < _tmp74_)) {
				break;
			}
			_tmp75_ = _label_list;
			_tmp76_ = gee_abstract_list_get ((GeeAbstractList*) _tmp75_, _label_index);
			label = (ObjectsLabel*) _tmp76_;
			_tmp77_ = label;
			_tmp78_ = dialogs_quick_find_quick_find_item_new ((ObjectsBaseObject*) _tmp77_, "");
			item = _tmp78_;
			_tmp79_ = self->priv->list_store;
			_tmp80_ = item;
			g_list_store_append (_tmp79_, (GObject*) _tmp80_);
			_g_object_unref0 (item);
			_g_object_unref0 (label);
		}
	}
	filters = (_vala_array_free (filters, filters_length1, (GDestroyNotify) g_object_unref), NULL);
}

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
dialogs_quick_find_quick_find_item_matches_search (DialogsQuickFindQuickFind* self,
                                                   DialogsQuickFindQuickFindItem* item,
                                                   const gchar* search_text_lower)
{
	ObjectsBaseObject* base_object = NULL;
	ObjectsBaseObject* _tmp0_;
	ObjectsBaseObject* _tmp1_;
	ObjectsBaseObject* _tmp2_;
	gboolean matches = FALSE;
	ObjectsBaseObject* _tmp3_;
	ObjectType _tmp4_;
	ObjectType _tmp5_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (item != NULL, FALSE);
	g_return_val_if_fail (search_text_lower != NULL, FALSE);
	_tmp0_ = dialogs_quick_find_quick_find_item_get_base_object (item);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	base_object = _tmp2_;
	matches = FALSE;
	_tmp3_ = base_object;
	_tmp4_ = objects_base_object_get_object_type (_tmp3_);
	_tmp5_ = _tmp4_;
	if (_tmp5_ == OBJECT_TYPE_FILTER) {
		gchar* filter_name = NULL;
		ObjectsBaseObject* _tmp6_;
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		gchar* _tmp9_;
		gboolean _tmp10_ = FALSE;
		const gchar* _tmp11_;
		_tmp6_ = base_object;
		_tmp7_ = objects_base_object_get_name (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = g_utf8_strdown (_tmp8_, (gssize) -1);
		filter_name = _tmp9_;
		_tmp11_ = filter_name;
		if (string_contains (_tmp11_, search_text_lower)) {
			_tmp10_ = TRUE;
		} else {
			ObjectsBaseObject* _tmp12_;
			const gchar* _tmp13_;
			const gchar* _tmp14_;
			gchar* _tmp15_;
			gchar* _tmp16_;
			_tmp12_ = base_object;
			_tmp13_ = objects_base_object_get_keywords (_tmp12_);
			_tmp14_ = _tmp13_;
			_tmp15_ = g_utf8_strdown (_tmp14_, (gssize) -1);
			_tmp16_ = _tmp15_;
			_tmp10_ = string_contains (_tmp16_, search_text_lower);
			_g_free0 (_tmp16_);
		}
		matches = _tmp10_;
		_g_free0 (filter_name);
	} else {
		ObjectsBaseObject* _tmp17_;
		_tmp17_ = base_object;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp17_, OBJECTS_TYPE_ITEM)) {
			ObjectsItem* item_obj = NULL;
			ObjectsBaseObject* _tmp18_;
			ObjectsItem* _tmp19_;
			gchar* item_content = NULL;
			ObjectsItem* _tmp20_;
			const gchar* _tmp21_;
			const gchar* _tmp22_;
			gchar* _tmp23_;
			const gchar* _tmp24_;
			_tmp18_ = base_object;
			_tmp19_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, OBJECTS_TYPE_ITEM, ObjectsItem));
			item_obj = _tmp19_;
			_tmp20_ = item_obj;
			_tmp21_ = objects_item_get_content (_tmp20_);
			_tmp22_ = _tmp21_;
			_tmp23_ = g_utf8_strdown (_tmp22_, (gssize) -1);
			item_content = _tmp23_;
			_tmp24_ = item_content;
			matches = string_contains (_tmp24_, search_text_lower);
			_g_free0 (item_content);
			_g_object_unref0 (item_obj);
		} else {
			ObjectsBaseObject* _tmp25_;
			const gchar* _tmp26_;
			const gchar* _tmp27_;
			gchar* _tmp28_;
			gchar* _tmp29_;
			_tmp25_ = base_object;
			_tmp26_ = objects_base_object_get_name (_tmp25_);
			_tmp27_ = _tmp26_;
			_tmp28_ = g_utf8_strdown (_tmp27_, (gssize) -1);
			_tmp29_ = _tmp28_;
			matches = string_contains (_tmp29_, search_text_lower);
			_g_free0 (_tmp29_);
		}
	}
	result = matches;
	_g_object_unref0 (base_object);
	return result;
}

static GtkWidget*
dialogs_quick_find_quick_find_get_placeholder (DialogsQuickFindQuickFind* self)
{
	GtkLabel* message_label = NULL;
	GtkLabel* _tmp0_ = NULL;
	GtkGrid* placeholder_grid = NULL;
	GtkGrid* _tmp1_ = NULL;
	GtkWidget* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = (GtkLabel*) gtk_label_new (_ ("Quickly switch projects and views, find tasks, search by labels"));
	gtk_label_set_wrap (_tmp0_, TRUE);
	gtk_label_set_justify (_tmp0_, GTK_JUSTIFY_CENTER);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp0_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp0_, TRUE);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp0_, 6);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp0_, 6);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp0_, 6);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp0_, 6);
	g_object_ref_sink (_tmp0_);
	message_label = _tmp0_;
	_tmp1_ = (GtkGrid*) gtk_grid_new ();
	gtk_widget_set_hexpand ((GtkWidget*) _tmp1_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp1_, TRUE);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp1_, 24);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp1_, 24);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp1_, 24);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp1_, 24);
	g_object_ref_sink (_tmp1_);
	placeholder_grid = _tmp1_;
	gtk_grid_attach (placeholder_grid, (GtkWidget*) message_label, 0, 0, 1, 1);
	result = (GtkWidget*) placeholder_grid;
	_g_object_unref0 (message_label);
	return result;
}

static Block93Data*
block93_data_ref (Block93Data* _data93_)
{
	g_atomic_int_inc (&_data93_->_ref_count_);
	return _data93_;
}

static void
block93_data_unref (void * _userdata_)
{
	Block93Data* _data93_;
	_data93_ = (Block93Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data93_->_ref_count_)) {
		DialogsQuickFindQuickFind* self;
		self = _data93_->self;
		_g_object_unref0 (_data93_->base_object);
		_g_object_unref0 (self);
		g_slice_free (Block93Data, _data93_);
	}
}

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

static gboolean
_____lambda892_ (Block93Data* _data93_)
{
	DialogsQuickFindQuickFind* self;
	ServicesEventBus* _tmp0_;
	ServicesEventBus* _tmp1_;
	ObjectsBaseObject* _tmp2_;
	gboolean result;
	self = _data93_->self;
	_tmp0_ = services_event_bus_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = _data93_->base_object;
	g_signal_emit_by_name (_tmp1_, "open-item", G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, OBJECTS_TYPE_ITEM, ObjectsItem));
	_g_object_unref0 (_tmp1_);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
______lambda892__gsource_func (gpointer self)
{
	gboolean result;
	result = _____lambda892_ (self);
	return result;
}

static void
dialogs_quick_find_quick_find_activate_item (DialogsQuickFindQuickFind* self,
                                             DialogsQuickFindQuickFindItem* item)
{
	Block93Data* _data93_;
	ObjectsBaseObject* _tmp0_;
	ObjectsBaseObject* _tmp1_;
	ObjectsBaseObject* _tmp2_;
	ObjectsBaseObject* _tmp3_;
	ObjectType _tmp4_;
	ObjectType _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	_data93_ = g_slice_new0 (Block93Data);
	_data93_->_ref_count_ = 1;
	_data93_->self = g_object_ref (self);
	_tmp0_ = dialogs_quick_find_quick_find_item_get_base_object (item);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data93_->base_object = _tmp2_;
	_tmp3_ = _data93_->base_object;
	_tmp4_ = objects_base_object_get_object_type (_tmp3_);
	_tmp5_ = _tmp4_;
	if (_tmp5_ == OBJECT_TYPE_PROJECT) {
		ServicesEventBus* _tmp6_;
		ServicesEventBus* _tmp7_;
		ObjectsBaseObject* _tmp8_;
		const gchar* _tmp9_;
		const gchar* _tmp10_;
		_tmp6_ = services_event_bus_get_default ();
		_tmp7_ = _tmp6_;
		_tmp8_ = _data93_->base_object;
		_tmp9_ = objects_base_object_get_id_string (_tmp8_);
		_tmp10_ = _tmp9_;
		g_signal_emit_by_name (_tmp7_, "pane-selected", PANE_TYPE_PROJECT, _tmp10_);
		_g_object_unref0 (_tmp7_);
	} else {
		ObjectsBaseObject* _tmp11_;
		ObjectType _tmp12_;
		ObjectType _tmp13_;
		_tmp11_ = _data93_->base_object;
		_tmp12_ = objects_base_object_get_object_type (_tmp11_);
		_tmp13_ = _tmp12_;
		if (_tmp13_ == OBJECT_TYPE_SECTION) {
			ServicesEventBus* _tmp14_;
			ServicesEventBus* _tmp15_;
			ObjectsBaseObject* _tmp16_;
			const gchar* _tmp17_;
			const gchar* _tmp18_;
			const gchar* _tmp19_;
			_tmp14_ = services_event_bus_get_default ();
			_tmp15_ = _tmp14_;
			_tmp16_ = _data93_->base_object;
			_tmp17_ = objects_section_get_project_id (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, OBJECTS_TYPE_SECTION, ObjectsSection));
			_tmp18_ = _tmp17_;
			_tmp19_ = string_to_string (_tmp18_);
			g_signal_emit_by_name (_tmp15_, "pane-selected", PANE_TYPE_PROJECT, _tmp19_);
			_g_object_unref0 (_tmp15_);
		} else {
			ObjectsBaseObject* _tmp20_;
			ObjectType _tmp21_;
			ObjectType _tmp22_;
			_tmp20_ = _data93_->base_object;
			_tmp21_ = objects_base_object_get_object_type (_tmp20_);
			_tmp22_ = _tmp21_;
			if (_tmp22_ == OBJECT_TYPE_ITEM) {
				ServicesEventBus* _tmp23_;
				ServicesEventBus* _tmp24_;
				ObjectsBaseObject* _tmp25_;
				const gchar* _tmp26_;
				const gchar* _tmp27_;
				const gchar* _tmp28_;
				_tmp23_ = services_event_bus_get_default ();
				_tmp24_ = _tmp23_;
				_tmp25_ = _data93_->base_object;
				_tmp26_ = objects_item_get_project_id (G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, OBJECTS_TYPE_ITEM, ObjectsItem));
				_tmp27_ = _tmp26_;
				_tmp28_ = string_to_string (_tmp27_);
				g_signal_emit_by_name (_tmp24_, "pane-selected", PANE_TYPE_PROJECT, _tmp28_);
				_g_object_unref0 (_tmp24_);
				g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 275, ______lambda892__gsource_func, block93_data_ref (_data93_), block93_data_unref);
			} else {
				ObjectsBaseObject* _tmp29_;
				ObjectType _tmp30_;
				ObjectType _tmp31_;
				_tmp29_ = _data93_->base_object;
				_tmp30_ = objects_base_object_get_object_type (_tmp29_);
				_tmp31_ = _tmp30_;
				if (_tmp31_ == OBJECT_TYPE_LABEL) {
					ServicesEventBus* _tmp32_;
					ServicesEventBus* _tmp33_;
					ObjectsBaseObject* _tmp34_;
					const gchar* _tmp35_;
					const gchar* _tmp36_;
					_tmp32_ = services_event_bus_get_default ();
					_tmp33_ = _tmp32_;
					_tmp34_ = _data93_->base_object;
					_tmp35_ = objects_base_object_get_id_string ((ObjectsBaseObject*) G_TYPE_CHECK_INSTANCE_CAST (_tmp34_, OBJECTS_TYPE_LABEL, ObjectsLabel));
					_tmp36_ = _tmp35_;
					g_signal_emit_by_name (_tmp33_, "pane-selected", PANE_TYPE_LABEL, _tmp36_);
					_g_object_unref0 (_tmp33_);
				} else {
					ObjectsBaseObject* _tmp37_;
					ObjectType _tmp38_;
					ObjectType _tmp39_;
					_tmp37_ = _data93_->base_object;
					_tmp38_ = objects_base_object_get_object_type (_tmp37_);
					_tmp39_ = _tmp38_;
					if (_tmp39_ == OBJECT_TYPE_FILTER) {
						ServicesEventBus* _tmp40_;
						ServicesEventBus* _tmp41_;
						ObjectsBaseObject* _tmp42_;
						const gchar* _tmp43_;
						const gchar* _tmp44_;
						_tmp40_ = services_event_bus_get_default ();
						_tmp41_ = _tmp40_;
						_tmp42_ = _data93_->base_object;
						_tmp43_ = objects_base_object_get_view_id (_tmp42_);
						_tmp44_ = _tmp43_;
						g_signal_emit_by_name (_tmp41_, "pane-selected", PANE_TYPE_FILTER, _tmp44_);
						_g_object_unref0 (_tmp41_);
					}
				}
			}
		}
	}
	dialogs_quick_find_quick_find_hide_destroy (self);
	block93_data_unref (_data93_);
	_data93_ = NULL;
}

static void
dialogs_quick_find_quick_find_hide_destroy (DialogsQuickFindQuickFind* self)
{
	g_return_if_fail (self != NULL);
	adw_dialog_close ((AdwDialog*) self);
}

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
_dialogs_quick_find_quick_find___lambda894_ (DialogsQuickFindQuickFind* self,
                                             GObject* obj)
{
	DialogsQuickFindQuickFindItem* item = NULL;
	DialogsQuickFindQuickFindItem* _tmp0_;
	GtkSearchEntry* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gboolean _tmp6_;
	gboolean matches = FALSE;
	DialogsQuickFindQuickFindItem* _tmp7_;
	GtkSearchEntry* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gboolean _tmp13_;
	gboolean result;
	g_return_val_if_fail (obj != NULL, FALSE);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (obj, DIALOGS_QUICK_FIND_TYPE_QUICK_FIND_ITEM, DialogsQuickFindQuickFindItem));
	item = _tmp0_;
	_tmp1_ = self->priv->search_entry;
	_tmp2_ = gtk_editable_get_text ((GtkEditable*) _tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = string_strip (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_strcmp0 (_tmp5_, "") == 0;
	_g_free0 (_tmp5_);
	if (_tmp6_) {
		result = FALSE;
		_g_object_unref0 (item);
		return result;
	}
	_tmp7_ = item;
	_tmp8_ = self->priv->search_entry;
	_tmp9_ = gtk_editable_get_text ((GtkEditable*) _tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = g_utf8_strdown (_tmp10_, (gssize) -1);
	_tmp12_ = _tmp11_;
	_tmp13_ = dialogs_quick_find_quick_find_item_matches_search (self, _tmp7_, _tmp12_);
	_g_free0 (_tmp12_);
	matches = _tmp13_;
	result = matches;
	_g_object_unref0 (item);
	return result;
}

static gboolean
__dialogs_quick_find_quick_find___lambda894__gtk_custom_filter_func (GObject* item,
                                                                     gpointer self)
{
	gboolean result;
	result = _dialogs_quick_find_quick_find___lambda894_ ((DialogsQuickFindQuickFind*) self, item);
	return result;
}

static void
_dialogs_quick_find_quick_find___lambda896_ (DialogsQuickFindQuickFind* self,
                                             guint position)
{
	GObject* item = NULL;
	GtkSingleSelection* _tmp0_;
	GObject* _tmp1_;
	GObject* _tmp2_;
	_tmp0_ = self->priv->selection_model;
	_tmp1_ = g_list_model_get_item ((GListModel*) _tmp0_, position);
	item = _tmp1_;
	_tmp2_ = item;
	if (_tmp2_ != NULL) {
		DialogsQuickFindQuickFindItem* quick_find_item = NULL;
		GObject* _tmp3_;
		DialogsQuickFindQuickFindItem* _tmp4_;
		DialogsQuickFindQuickFindItem* _tmp5_;
		_tmp3_ = item;
		_tmp4_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, DIALOGS_QUICK_FIND_TYPE_QUICK_FIND_ITEM, DialogsQuickFindQuickFindItem));
		quick_find_item = _tmp4_;
		_tmp5_ = quick_find_item;
		dialogs_quick_find_quick_find_activate_item (self, _tmp5_);
		_g_object_unref0 (quick_find_item);
	}
	_g_object_unref0 (item);
}

static void
__dialogs_quick_find_quick_find___lambda896__gtk_list_view_activate (GtkListView* _sender,
                                                                     guint position,
                                                                     gpointer self)
{
	_dialogs_quick_find_quick_find___lambda896_ ((DialogsQuickFindQuickFind*) self, position);
}

static void
_dialogs_quick_find_quick_find___lambda897_ (DialogsQuickFindQuickFind* self)
{
	dialogs_quick_find_quick_find_search_changed (self);
}

static void
__dialogs_quick_find_quick_find___lambda897__gtk_search_entry_search_changed (GtkSearchEntry* _sender,
                                                                              gpointer self)
{
	_dialogs_quick_find_quick_find___lambda897_ ((DialogsQuickFindQuickFind*) self);
}

static void
_dialogs_quick_find_quick_find___lambda898_ (DialogsQuickFindQuickFind* self)
{
	guint selected = 0U;
	GtkSingleSelection* _tmp0_;
	_tmp0_ = self->priv->selection_model;
	selected = gtk_single_selection_get_selected (_tmp0_);
	if (selected != GTK_INVALID_LIST_POSITION) {
		GObject* item = NULL;
		GtkSingleSelection* _tmp1_;
		GObject* _tmp2_;
		GObject* _tmp3_;
		_tmp1_ = self->priv->selection_model;
		_tmp2_ = g_list_model_get_item ((GListModel*) _tmp1_, selected);
		item = _tmp2_;
		_tmp3_ = item;
		if (_tmp3_ != NULL) {
			GObject* _tmp4_;
			_tmp4_ = item;
			dialogs_quick_find_quick_find_activate_item (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, DIALOGS_QUICK_FIND_TYPE_QUICK_FIND_ITEM, DialogsQuickFindQuickFindItem));
		}
		_g_object_unref0 (item);
	}
}

static void
__dialogs_quick_find_quick_find___lambda898__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                                        gint n_press,
                                                                        gdouble x,
                                                                        gdouble y,
                                                                        gpointer self)
{
	_dialogs_quick_find_quick_find___lambda898_ ((DialogsQuickFindQuickFind*) self);
}

static gboolean
_dialogs_quick_find_quick_find_key_pressed_gtk_event_controller_key_key_pressed (GtkEventControllerKey* _sender,
                                                                                 guint keyval,
                                                                                 guint keycode,
                                                                                 GdkModifierType state,
                                                                                 gpointer self)
{
	gboolean result;
	result = dialogs_quick_find_quick_find_key_pressed ((DialogsQuickFindQuickFind*) self, keyval, keycode, state);
	return result;
}

static gboolean
_dialogs_quick_find_quick_find___lambda899_ (DialogsQuickFindQuickFind* self,
                                             guint keyval,
                                             guint keycode,
                                             GdkModifierType state)
{
	gchar* key = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gboolean result;
	_tmp0_ = gdk_keyval_name (keyval);
	_tmp1_ = string_replace (_tmp0_, "KP_", "");
	key = _tmp1_;
	if (keyval == GDK_KEY_Escape) {
		dialogs_quick_find_quick_find_hide_destroy (self);
	} else {
		const gchar* _tmp2_;
		_tmp2_ = key;
		if (g_strcmp0 (_tmp2_, "Down") == 0) {
			GtkListView* _tmp3_;
			_tmp3_ = self->priv->list_view;
			gtk_widget_grab_focus ((GtkWidget*) _tmp3_);
			result = TRUE;
			_g_free0 (key);
			return result;
		}
	}
	result = FALSE;
	_g_free0 (key);
	return result;
}

static gboolean
__dialogs_quick_find_quick_find___lambda899__gtk_event_controller_key_key_pressed (GtkEventControllerKey* _sender,
                                                                                   guint keyval,
                                                                                   guint keycode,
                                                                                   GdkModifierType state,
                                                                                   gpointer self)
{
	gboolean result;
	result = _dialogs_quick_find_quick_find___lambda899_ ((DialogsQuickFindQuickFind*) self, keyval, keycode, state);
	return result;
}

static gboolean
_dialogs_quick_find_quick_find___lambda900_ (DialogsQuickFindQuickFind* self,
                                             guint keyval,
                                             guint keycode,
                                             GdkModifierType state)
{
	gboolean result;
	if (keyval == GDK_KEY_Escape) {
		dialogs_quick_find_quick_find_hide_destroy (self);
	}
	result = FALSE;
	return result;
}

static gboolean
__dialogs_quick_find_quick_find___lambda900__gtk_event_controller_key_key_pressed (GtkEventControllerKey* _sender,
                                                                                   guint keyval,
                                                                                   guint keycode,
                                                                                   GdkModifierType state,
                                                                                   gpointer self)
{
	gboolean result;
	result = _dialogs_quick_find_quick_find___lambda900_ ((DialogsQuickFindQuickFind*) self, keyval, keycode, state);
	return result;
}

static void
_dialogs_quick_find_quick_find___lambda901_ (DialogsQuickFindQuickFind* self)
{
	dialogs_quick_find_quick_find_hide_destroy (self);
}

static void
__dialogs_quick_find_quick_find___lambda901__gtk_button_clicked (GtkButton* _sender,
                                                                 gpointer self)
{
	_dialogs_quick_find_quick_find___lambda901_ ((DialogsQuickFindQuickFind*) self);
}

static void
_dialogs_quick_find_quick_find___lambda902_ (DialogsQuickFindQuickFind* self)
{
	ServicesEventBus* _tmp0_;
	ServicesEventBus* _tmp1_;
	_tmp0_ = services_event_bus_get_default ();
	_tmp1_ = _tmp0_;
	g_signal_emit_by_name (_tmp1_, "connect-typing-accel");
	_g_object_unref0 (_tmp1_);
}

static void
__dialogs_quick_find_quick_find___lambda902__adw_dialog_closed (AdwDialog* _sender,
                                                                gpointer self)
{
	_dialogs_quick_find_quick_find___lambda902_ ((DialogsQuickFindQuickFind*) self);
}

static GObject *
dialogs_quick_find_quick_find_constructor (GType type,
                                           guint n_construct_properties,
                                           GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	DialogsQuickFindQuickFind * self;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar** _tmp2_;
	GtkSearchEntry* _tmp3_ = NULL;
	GtkButton* cancel_button = NULL;
	gchar* _tmp4_;
	gchar** _tmp5_;
	GtkButton* _tmp6_ = NULL;
	GtkBox* headerbar_box = NULL;
	GtkBox* _tmp7_ = NULL;
	GtkBox* _tmp8_;
	GtkSearchEntry* _tmp9_;
	GtkBox* _tmp10_;
	GtkButton* _tmp11_;
	AdwHeaderBar* headerbar = NULL;
	GtkBox* _tmp12_;
	GtkWidget* _tmp13_;
	gchar* _tmp14_;
	gchar** _tmp15_;
	AdwHeaderBar* _tmp16_ = NULL;
	GListStore* _tmp17_;
	GtkCustomFilter* _tmp18_;
	GListStore* _tmp19_;
	GListModel* _tmp20_;
	GtkCustomFilter* _tmp21_;
	GtkFilter* _tmp22_;
	GtkFilterListModel* _tmp23_ = NULL;
	GtkSortListModel* sort_model = NULL;
	GtkFilterListModel* _tmp24_;
	GListModel* _tmp25_;
	DialogsQuickFindQuickFindSectionSorter* _tmp26_;
	GtkSortListModel* _tmp27_;
	GtkSortListModel* _tmp28_;
	DialogsQuickFindQuickFindSectionSorter* _tmp29_;
	DialogsQuickFindQuickFindSectionSorter* _tmp30_;
	GtkSortListModel* _tmp31_;
	GListModel* _tmp32_;
	GtkSingleSelection* _tmp33_;
	GtkSignalListItemFactory* _tmp34_;
	GtkSignalListItemFactory* _tmp35_;
	GtkSingleSelection* _tmp36_;
	GtkSelectionModel* _tmp37_;
	GtkSignalListItemFactory* _tmp38_;
	GtkListItemFactory* _tmp39_;
	gchar* _tmp40_;
	gchar* _tmp41_;
	gchar** _tmp42_;
	GtkListView* _tmp43_ = NULL;
	GtkListView* _tmp44_;
	GtkSignalListItemFactory* _tmp45_;
	GtkListView* _tmp46_;
	GtkListView* _tmp47_;
	GtkWidget* _tmp48_;
	GtkScrolledWindow* _tmp49_ = NULL;
	GtkStack* _tmp50_;
	GtkStack* _tmp51_;
	GtkWidget* _tmp52_;
	GtkWidget* _tmp53_;
	GtkStack* _tmp54_;
	GtkScrolledWindow* _tmp55_;
	AdwToolbarView* toolbar_view = NULL;
	AdwToolbarView* _tmp56_;
	AdwToolbarView* _tmp57_;
	AdwHeaderBar* _tmp58_;
	AdwToolbarView* _tmp59_;
	GtkStack* _tmp60_;
	AdwToolbarView* _tmp61_;
	GtkSearchEntry* _tmp62_;
	ServicesEventBus* _tmp63_;
	ServicesEventBus* _tmp64_;
	GtkSearchEntry* _tmp65_;
	GtkGestureClick* click_gesture = NULL;
	GtkGestureClick* _tmp66_;
	GtkGestureClick* _tmp67_;
	GtkListView* _tmp68_;
	GtkGestureClick* _tmp69_;
	GtkEventController* _tmp70_;
	GtkEventControllerKey* list_view_controller_key = NULL;
	GtkEventControllerKey* _tmp71_;
	GtkListView* _tmp72_;
	GtkEventControllerKey* _tmp73_;
	GtkEventController* _tmp74_;
	GtkEventControllerKey* _tmp75_;
	GtkEventControllerKey* search_entry_ctrl_key = NULL;
	GtkEventControllerKey* _tmp76_;
	GtkSearchEntry* _tmp77_;
	GtkEventControllerKey* _tmp78_;
	GtkEventController* _tmp79_;
	GtkEventControllerKey* _tmp80_;
	GtkEventControllerKey* event_controller_key = NULL;
	GtkEventControllerKey* _tmp81_;
	GtkEventControllerKey* _tmp82_;
	GtkEventController* _tmp83_;
	GtkEventControllerKey* _tmp84_;
	GtkButton* _tmp85_;
	parent_class = G_OBJECT_CLASS (dialogs_quick_find_quick_find_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DIALOGS_QUICK_FIND_TYPE_QUICK_FIND, DialogsQuickFindQuickFind);
	_tmp0_ = g_strdup (_ ("Quick Find"));
	_tmp1_ = g_strdup ("border-radius-9");
	_tmp2_ = g_new0 (gchar*, 1 + 1);
	_tmp2_[0] = _tmp1_;
	_tmp3_ = (GtkSearchEntry*) gtk_search_entry_new ();
	g_object_set (_tmp3_, "placeholder-text", _tmp0_, NULL);
	_g_free0 (_tmp0_);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp3_, TRUE);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp3_, _tmp2_);
	_tmp2_ = (_vala_array_free (_tmp2_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp3_);
	_g_object_unref0 (self->priv->search_entry);
	self->priv->search_entry = _tmp3_;
	_tmp4_ = g_strdup ("flat");
	_tmp5_ = g_new0 (gchar*, 1 + 1);
	_tmp5_[0] = _tmp4_;
	_tmp6_ = (GtkButton*) gtk_button_new_with_label (_ ("Cancel"));
	gtk_widget_set_css_classes ((GtkWidget*) _tmp6_, _tmp5_);
	_tmp5_ = (_vala_array_free (_tmp5_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp6_);
	cancel_button = _tmp6_;
	_tmp7_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp7_, TRUE);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp7_, 6);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp7_, 6);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp7_, 6);
	g_object_ref_sink (_tmp7_);
	headerbar_box = _tmp7_;
	_tmp8_ = headerbar_box;
	_tmp9_ = self->priv->search_entry;
	gtk_box_append (_tmp8_, (GtkWidget*) _tmp9_);
	_tmp10_ = headerbar_box;
	_tmp11_ = cancel_button;
	gtk_box_append (_tmp10_, (GtkWidget*) _tmp11_);
	_tmp12_ = headerbar_box;
	_tmp13_ = _g_object_ref0 ((GtkWidget*) _tmp12_);
	_tmp14_ = g_strdup ("flat");
	_tmp15_ = g_new0 (gchar*, 1 + 1);
	_tmp15_[0] = _tmp14_;
	_tmp16_ = (AdwHeaderBar*) adw_header_bar_new ();
	adw_header_bar_set_title_widget (_tmp16_, _tmp13_);
	_g_object_unref0 (_tmp13_);
	adw_header_bar_set_show_start_title_buttons (_tmp16_, FALSE);
	adw_header_bar_set_show_end_title_buttons (_tmp16_, FALSE);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp16_, _tmp15_);
	_tmp15_ = (_vala_array_free (_tmp15_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp16_);
	headerbar = _tmp16_;
	_tmp17_ = g_list_store_new (DIALOGS_QUICK_FIND_TYPE_QUICK_FIND_ITEM);
	_g_object_unref0 (self->priv->list_store);
	self->priv->list_store = _tmp17_;
	_tmp18_ = gtk_custom_filter_new (__dialogs_quick_find_quick_find___lambda894__gtk_custom_filter_func, g_object_ref (self), g_object_unref);
	_g_object_unref0 (self->priv->custom_filter);
	self->priv->custom_filter = _tmp18_;
	_tmp19_ = self->priv->list_store;
	_tmp20_ = _g_object_ref0 ((GListModel*) _tmp19_);
	_tmp21_ = self->priv->custom_filter;
	_tmp22_ = _g_object_ref0 ((GtkFilter*) _tmp21_);
	_tmp23_ = gtk_filter_list_model_new (_tmp20_, _tmp22_);
	gtk_filter_list_model_set_incremental (_tmp23_, FALSE);
	_g_object_unref0 (self->priv->filter_model);
	self->priv->filter_model = _tmp23_;
	_tmp24_ = self->priv->filter_model;
	_tmp25_ = _g_object_ref0 ((GListModel*) _tmp24_);
	_tmp26_ = dialogs_quick_find_quick_find_section_sorter_new ();
	_tmp27_ = gtk_sort_list_model_new (_tmp25_, (GtkSorter*) _tmp26_);
	sort_model = _tmp27_;
	_tmp28_ = sort_model;
	_tmp29_ = dialogs_quick_find_quick_find_section_sorter_new ();
	_tmp30_ = _tmp29_;
	gtk_sort_list_model_set_section_sorter (_tmp28_, (GtkSorter*) _tmp30_);
	_g_object_unref0 (_tmp30_);
	_tmp31_ = sort_model;
	_tmp32_ = _g_object_ref0 ((GListModel*) _tmp31_);
	_tmp33_ = gtk_single_selection_new (_tmp32_);
	_g_object_unref0 (self->priv->selection_model);
	self->priv->selection_model = _tmp33_;
	_tmp34_ = dialogs_quick_find_quick_find_factory_create_list_item_factory ();
	_g_object_unref0 (self->priv->list_item_factory);
	self->priv->list_item_factory = _tmp34_;
	_tmp35_ = dialogs_quick_find_quick_find_factory_create_header_factory ();
	_g_object_unref0 (self->priv->header_factory);
	self->priv->header_factory = _tmp35_;
	_tmp36_ = self->priv->selection_model;
	_tmp37_ = _g_object_ref0 ((GtkSelectionModel*) _tmp36_);
	_tmp38_ = self->priv->list_item_factory;
	_tmp39_ = _g_object_ref0 ((GtkListItemFactory*) _tmp38_);
	_tmp40_ = g_strdup ("listbox-background");
	_tmp41_ = g_strdup ("quick-find-list");
	_tmp42_ = g_new0 (gchar*, 2 + 1);
	_tmp42_[0] = _tmp40_;
	_tmp42_[1] = _tmp41_;
	_tmp43_ = (GtkListView*) gtk_list_view_new (_tmp37_, _tmp39_);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp43_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp43_, TRUE);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp43_, _tmp42_);
	_tmp42_ = (_vala_array_free (_tmp42_, 2, (GDestroyNotify) g_free), NULL);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp43_, 6);
	g_object_ref_sink (_tmp43_);
	_g_object_unref0 (self->priv->list_view);
	self->priv->list_view = _tmp43_;
	_tmp44_ = self->priv->list_view;
	_tmp45_ = self->priv->header_factory;
	gtk_list_view_set_header_factory (_tmp44_, (GtkListItemFactory*) _tmp45_);
	_tmp46_ = self->priv->list_view;
	g_signal_connect_object (_tmp46_, "activate", (GCallback) __dialogs_quick_find_quick_find___lambda896__gtk_list_view_activate, self, 0);
	_tmp47_ = self->priv->list_view;
	_tmp48_ = _g_object_ref0 ((GtkWidget*) _tmp47_);
	_tmp49_ = (GtkScrolledWindow*) gtk_scrolled_window_new ();
	gtk_widget_set_hexpand ((GtkWidget*) _tmp49_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp49_, TRUE);
	g_object_set (_tmp49_, "hscrollbar-policy", GTK_POLICY_NEVER, NULL);
	gtk_scrolled_window_set_child (_tmp49_, _tmp48_);
	_g_object_unref0 (_tmp48_);
	g_object_ref_sink (_tmp49_);
	_g_object_unref0 (self->priv->list_view_scrolled);
	self->priv->list_view_scrolled = _tmp49_;
	_tmp50_ = (GtkStack*) gtk_stack_new ();
	g_object_ref_sink (_tmp50_);
	_g_object_unref0 (self->priv->stack);
	self->priv->stack = _tmp50_;
	_tmp51_ = self->priv->stack;
	_tmp52_ = dialogs_quick_find_quick_find_get_placeholder (self);
	_tmp53_ = _tmp52_;
	gtk_stack_add_titled (_tmp51_, _tmp53_, "placeholder", "Placeholder");
	_g_object_unref0 (_tmp53_);
	_tmp54_ = self->priv->stack;
	_tmp55_ = self->priv->list_view_scrolled;
	gtk_stack_add_titled (_tmp54_, (GtkWidget*) _tmp55_, "list", "List");
	_tmp56_ = (AdwToolbarView*) adw_toolbar_view_new ();
	g_object_ref_sink (_tmp56_);
	toolbar_view = _tmp56_;
	_tmp57_ = toolbar_view;
	_tmp58_ = headerbar;
	adw_toolbar_view_add_top_bar (_tmp57_, (GtkWidget*) _tmp58_);
	_tmp59_ = toolbar_view;
	_tmp60_ = self->priv->stack;
	adw_toolbar_view_set_content (_tmp59_, (GtkWidget*) _tmp60_);
	_tmp61_ = toolbar_view;
	adw_dialog_set_child ((AdwDialog*) self, (GtkWidget*) _tmp61_);
	_tmp62_ = self->priv->search_entry;
	adw_dialog_set_default_widget ((AdwDialog*) self, (GtkWidget*) _tmp62_);
	_tmp63_ = services_event_bus_get_default ();
	_tmp64_ = _tmp63_;
	g_signal_emit_by_name (_tmp64_, "disconnect-typing-accel");
	_g_object_unref0 (_tmp64_);
	dialogs_quick_find_quick_find_populate_store (self);
	_tmp65_ = self->priv->search_entry;
	g_signal_connect_object (_tmp65_, "search-changed", (GCallback) __dialogs_quick_find_quick_find___lambda897__gtk_search_entry_search_changed, self, 0);
	_tmp66_ = (GtkGestureClick*) gtk_gesture_click_new ();
	click_gesture = _tmp66_;
	_tmp67_ = click_gesture;
	g_signal_connect_object (_tmp67_, "pressed", (GCallback) __dialogs_quick_find_quick_find___lambda898__gtk_gesture_click_pressed, self, 0);
	_tmp68_ = self->priv->list_view;
	_tmp69_ = click_gesture;
	_tmp70_ = _g_object_ref0 ((GtkEventController*) _tmp69_);
	gtk_widget_add_controller ((GtkWidget*) _tmp68_, _tmp70_);
	_tmp71_ = (GtkEventControllerKey*) gtk_event_controller_key_new ();
	list_view_controller_key = _tmp71_;
	_tmp72_ = self->priv->list_view;
	_tmp73_ = list_view_controller_key;
	_tmp74_ = _g_object_ref0 ((GtkEventController*) _tmp73_);
	gtk_widget_add_controller ((GtkWidget*) _tmp72_, _tmp74_);
	_tmp75_ = list_view_controller_key;
	g_signal_connect_object (_tmp75_, "key-pressed", (GCallback) _dialogs_quick_find_quick_find_key_pressed_gtk_event_controller_key_key_pressed, self, 0);
	_tmp76_ = (GtkEventControllerKey*) gtk_event_controller_key_new ();
	search_entry_ctrl_key = _tmp76_;
	_tmp77_ = self->priv->search_entry;
	_tmp78_ = search_entry_ctrl_key;
	_tmp79_ = _g_object_ref0 ((GtkEventController*) _tmp78_);
	gtk_widget_add_controller ((GtkWidget*) _tmp77_, _tmp79_);
	_tmp80_ = search_entry_ctrl_key;
	g_signal_connect_object (_tmp80_, "key-pressed", (GCallback) __dialogs_quick_find_quick_find___lambda899__gtk_event_controller_key_key_pressed, self, 0);
	_tmp81_ = (GtkEventControllerKey*) gtk_event_controller_key_new ();
	event_controller_key = _tmp81_;
	_tmp82_ = event_controller_key;
	_tmp83_ = _g_object_ref0 ((GtkEventController*) _tmp82_);
	gtk_widget_add_controller (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), _tmp83_);
	_tmp84_ = event_controller_key;
	g_signal_connect_object (_tmp84_, "key-pressed", (GCallback) __dialogs_quick_find_quick_find___lambda900__gtk_event_controller_key_key_pressed, self, 0);
	_tmp85_ = cancel_button;
	g_signal_connect_object (_tmp85_, "clicked", (GCallback) __dialogs_quick_find_quick_find___lambda901__gtk_button_clicked, self, 0);
	g_signal_connect_object ((AdwDialog*) self, "closed", (GCallback) __dialogs_quick_find_quick_find___lambda902__adw_dialog_closed, self, 0);
	_g_object_unref0 (event_controller_key);
	_g_object_unref0 (search_entry_ctrl_key);
	_g_object_unref0 (list_view_controller_key);
	_g_object_unref0 (click_gesture);
	_g_object_unref0 (toolbar_view);
	_g_object_unref0 (sort_model);
	_g_object_unref0 (headerbar);
	_g_object_unref0 (headerbar_box);
	_g_object_unref0 (cancel_button);
	return obj;
}

static void
dialogs_quick_find_quick_find_class_init (DialogsQuickFindQuickFindClass * klass,
                                          gpointer klass_data)
{
	dialogs_quick_find_quick_find_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DialogsQuickFindQuickFind_private_offset);
	G_OBJECT_CLASS (klass)->constructor = dialogs_quick_find_quick_find_constructor;
	G_OBJECT_CLASS (klass)->finalize = dialogs_quick_find_quick_find_finalize;
}

static void
dialogs_quick_find_quick_find_instance_init (DialogsQuickFindQuickFind * self,
                                             gpointer klass)
{
	self->priv = dialogs_quick_find_quick_find_get_instance_private (self);
}

static void
dialogs_quick_find_quick_find_finalize (GObject * obj)
{
	DialogsQuickFindQuickFind * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DIALOGS_QUICK_FIND_TYPE_QUICK_FIND, DialogsQuickFindQuickFind);
	g_debug ("QuickFind.vala:43: Destroying Dialogs.QuickFind.QuickFind\n");
	_g_object_unref0 (self->priv->search_entry);
	_g_object_unref0 (self->priv->list_view);
	_g_object_unref0 (self->priv->list_view_scrolled);
	_g_object_unref0 (self->priv->list_store);
	_g_object_unref0 (self->priv->filter_model);
	_g_object_unref0 (self->priv->custom_filter);
	_g_object_unref0 (self->priv->selection_model);
	_g_object_unref0 (self->priv->list_item_factory);
	_g_object_unref0 (self->priv->header_factory);
	_g_object_unref0 (self->priv->stack);
	G_OBJECT_CLASS (dialogs_quick_find_quick_find_parent_class)->finalize (obj);
}

static GType
dialogs_quick_find_quick_find_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DialogsQuickFindQuickFindClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dialogs_quick_find_quick_find_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DialogsQuickFindQuickFind), 0, (GInstanceInitFunc) dialogs_quick_find_quick_find_instance_init, NULL };
	GType dialogs_quick_find_quick_find_type_id;
	dialogs_quick_find_quick_find_type_id = g_type_register_static (adw_dialog_get_type (), "DialogsQuickFindQuickFind", &g_define_type_info, 0);
	DialogsQuickFindQuickFind_private_offset = g_type_add_instance_private (dialogs_quick_find_quick_find_type_id, sizeof (DialogsQuickFindQuickFindPrivate));
	return dialogs_quick_find_quick_find_type_id;
}

GType
dialogs_quick_find_quick_find_get_type (void)
{
	static volatile gsize dialogs_quick_find_quick_find_type_id__once = 0;
	if (g_once_init_enter (&dialogs_quick_find_quick_find_type_id__once)) {
		GType dialogs_quick_find_quick_find_type_id;
		dialogs_quick_find_quick_find_type_id = dialogs_quick_find_quick_find_get_type_once ();
		g_once_init_leave (&dialogs_quick_find_quick_find_type_id__once, dialogs_quick_find_quick_find_type_id);
	}
	return dialogs_quick_find_quick_find_type_id__once;
}

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);
}

