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

/*
 *  pamac-vala
 *
 *  Copyright (C) 2015-2022 Guillaume Benoit <guillaume@manjaro.org>
 *
 *  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 get of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include "pamac-gtk.h"
#include <glib-object.h>
#include <gtk/gtk.h>
#include <glib.h>
#include <gdk/gdk.h>
#include <handy.h>
#include <stdlib.h>
#include <string.h>
#include <pango/pango.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

enum  {
	PAMAC_CHOOSE_PKGS_DIALOG_0_PROPERTY,
	PAMAC_CHOOSE_PKGS_DIALOG_NUM_PROPERTIES
};
static GParamSpec* pamac_choose_pkgs_dialog_properties[PAMAC_CHOOSE_PKGS_DIALOG_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block12Data Block12Data;
#define _g_free0(var) (var = (g_free (var), NULL))

struct _Block12Data {
	int _ref_count_;
	PamacChoosePkgsDialog* self;
	gchar* search_string;
};

static gpointer pamac_choose_pkgs_dialog_parent_class = NULL;

static gboolean __lambda5_ (PamacChoosePkgsDialog* self,
                     GdkEventKey* event);
static gboolean ___lambda5__gtk_widget_key_press_event (GtkWidget* _sender,
                                                 GdkEventKey* event,
                                                 gpointer self);
static void _g_free0_ (gpointer var);
static void pamac_choose_pkgs_dialog_on_row_activated (PamacChoosePkgsDialog* self,
                                                GtkListBoxRow* row);
static void _pamac_choose_pkgs_dialog_on_row_activated_gtk_list_box_row_activated (GtkListBox* _sender,
                                                                            GtkListBoxRow* row,
                                                                            gpointer self);
static void pamac_choose_pkgs_dialog_on_search_text_changed (PamacChoosePkgsDialog* self);
static Block12Data* block12_data_ref (Block12Data* _data12_);
static void block12_data_unref (void * _userdata_);
static gboolean ___lambda6_ (Block12Data* _data12_,
                      GtkListBoxRow* row);
static gboolean ____lambda6__gtk_list_box_filter_func (GtkListBoxRow* row,
                                                gpointer self);
static void _pamac_choose_pkgs_dialog_on_search_text_changed_gtk_search_entry_search_changed (GtkSearchEntry* _sender,
                                                                                       gpointer self);
static void pamac_choose_pkgs_dialog_finalize (GObject * obj);
static GType pamac_choose_pkgs_dialog_get_type_once (void);

PamacChoosePkgsDialog*
pamac_choose_pkgs_dialog_construct (GType object_type,
                                    GtkWindow* window)
{
	PamacChoosePkgsDialog * self = NULL;
	gint use_header_bar = 0;
	GtkSettings* _tmp0_;
	gint _tmp1_ = 0;
	g_return_val_if_fail (window != NULL, NULL);
	_tmp0_ = gtk_settings_get_default ();
	g_object_get ((GObject*) _tmp0_, "gtk-dialogs-use-header", &_tmp1_, NULL);
	use_header_bar = _tmp1_;
	self = (PamacChoosePkgsDialog*) g_object_new (object_type, "transient-for", window, "use-header-bar", use_header_bar, NULL);
	return self;
}

PamacChoosePkgsDialog*
pamac_choose_pkgs_dialog_new (GtkWindow* window)
{
	return pamac_choose_pkgs_dialog_construct (PAMAC_TYPE_CHOOSE_PKGS_DIALOG, window);
}

static gboolean
__lambda5_ (PamacChoosePkgsDialog* self,
            GdkEventKey* event)
{
	GtkSearchEntry* _tmp0_;
	gboolean result;
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = self->search_entry;
	result = gtk_search_entry_handle_event (_tmp0_, (GdkEvent*) event);
	return result;
}

static gboolean
___lambda5__gtk_widget_key_press_event (GtkWidget* _sender,
                                        GdkEventKey* event,
                                        gpointer self)
{
	gboolean result;
	result = __lambda5_ ((PamacChoosePkgsDialog*) self, event);
	return result;
}

void
pamac_choose_pkgs_dialog_enable_search (PamacChoosePkgsDialog* self)
{
	GtkSearchEntry* _tmp0_;
	HdyClamp* _tmp1_;
	GtkSeparator* _tmp2_;
	g_return_if_fail (self != NULL);
	g_signal_connect_object ((GtkWidget*) self, "key-press-event", (GCallback) ___lambda5__gtk_widget_key_press_event, self, 0);
	_tmp0_ = self->search_entry;
	gtk_widget_grab_focus ((GtkWidget*) _tmp0_);
	_tmp1_ = self->search_clamp;
	gtk_widget_set_visible ((GtkWidget*) _tmp1_, TRUE);
	_tmp2_ = self->search_separator;
	gtk_widget_set_visible ((GtkWidget*) _tmp2_, TRUE);
}

void
pamac_choose_pkgs_dialog_add_pkg (PamacChoosePkgsDialog* self,
                                  const gchar* pkgname)
{
	GtkBox* box = NULL;
	GtkBox* _tmp0_;
	GtkImage* select_image = NULL;
	GtkImage* _tmp1_;
	GtkLabel* label = NULL;
	GtkLabel* _tmp2_;
	GtkListBox* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (pkgname != NULL);
	_tmp0_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
	g_object_ref_sink (_tmp0_);
	box = _tmp0_;
	gtk_widget_set_visible ((GtkWidget*) box, TRUE);
	gtk_widget_set_margin_top ((GtkWidget*) box, 12);
	gtk_widget_set_margin_bottom ((GtkWidget*) box, 12);
	gtk_widget_set_margin_start ((GtkWidget*) box, 12);
	gtk_widget_set_margin_end ((GtkWidget*) box, 12);
	_tmp1_ = (GtkImage*) gtk_image_new_from_icon_name ("object-select-symbolic", (GtkIconSize) GTK_ICON_SIZE_BUTTON);
	g_object_ref_sink (_tmp1_);
	select_image = _tmp1_;
	gtk_image_set_pixel_size (select_image, 16);
	gtk_container_add ((GtkContainer*) box, (GtkWidget*) select_image);
	_tmp2_ = (GtkLabel*) gtk_label_new (pkgname);
	g_object_ref_sink (_tmp2_);
	label = _tmp2_;
	gtk_widget_set_visible ((GtkWidget*) label, TRUE);
	gtk_widget_set_margin_start ((GtkWidget*) label, 22);
	gtk_widget_set_margin_end ((GtkWidget*) label, 22);
	gtk_widget_set_halign ((GtkWidget*) label, GTK_ALIGN_START);
	gtk_label_set_ellipsize (label, PANGO_ELLIPSIZE_END);
	gtk_container_add ((GtkContainer*) box, (GtkWidget*) label);
	_tmp3_ = self->listbox;
	gtk_container_add ((GtkContainer*) _tmp3_, (GtkWidget*) box);
	_g_object_unref0 (label);
	_g_object_unref0 (select_image);
	_g_object_unref0 (box);
}

static void
_g_free0_ (gpointer var)
{
	var = (g_free (var), NULL);
}

GPtrArray*
pamac_choose_pkgs_dialog_get_selected_pkgs (PamacChoosePkgsDialog* self)
{
	GPtrArray* selected = NULL;
	GPtrArray* _tmp0_;
	GList* list = NULL;
	GtkListBox* _tmp1_;
	GList* _tmp2_;
	GList* _tmp3_;
	GPtrArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_ptr_array_new_full ((guint) 0, _g_free0_);
	selected = _tmp0_;
	_tmp1_ = self->listbox;
	_tmp2_ = gtk_container_get_children ((GtkContainer*) _tmp1_);
	list = _tmp2_;
	_tmp3_ = list;
	{
		GList* widget_collection = NULL;
		GList* widget_it = NULL;
		widget_collection = _tmp3_;
		for (widget_it = widget_collection; widget_it != NULL; widget_it = widget_it->next) {
			GtkWidget* widget = NULL;
			widget = (GtkWidget*) widget_it->data;
			{
				GtkListBoxRow* row = NULL;
				GtkWidget* _tmp4_;
				GtkWidget* child = NULL;
				GtkListBoxRow* _tmp5_;
				GtkWidget* _tmp6_;
				GtkBox* box = NULL;
				GtkWidget* _tmp7_;
				GList* children = NULL;
				GtkBox* _tmp8_;
				GList* _tmp9_;
				gboolean select = FALSE;
				GList* _tmp10_;
				_tmp4_ = widget;
				row = G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, gtk_list_box_row_get_type ()) ? ((GtkListBoxRow*) _tmp4_) : NULL;
				_tmp5_ = row;
				_tmp6_ = gtk_bin_get_child ((GtkBin*) _tmp5_);
				child = _tmp6_;
				_tmp7_ = child;
				box = G_TYPE_CHECK_INSTANCE_TYPE (_tmp7_, gtk_box_get_type ()) ? ((GtkBox*) _tmp7_) : NULL;
				_tmp8_ = box;
				_tmp9_ = gtk_container_get_children ((GtkContainer*) _tmp8_);
				children = _tmp9_;
				select = FALSE;
				_tmp10_ = children;
				{
					GList* widget2_collection = NULL;
					GList* widget2_it = NULL;
					widget2_collection = _tmp10_;
					for (widget2_it = widget2_collection; widget2_it != NULL; widget2_it = widget2_it->next) {
						GtkWidget* widget2 = NULL;
						widget2 = (GtkWidget*) widget2_it->data;
						{
							GtkWidget* _tmp11_;
							const gchar* _tmp12_;
							const gchar* _tmp13_;
							GtkWidget* _tmp18_;
							const gchar* _tmp19_;
							const gchar* _tmp20_;
							_tmp11_ = widget2;
							_tmp12_ = gtk_widget_get_name (_tmp11_);
							_tmp13_ = _tmp12_;
							if (g_strcmp0 (_tmp13_, "GtkImage") == 0) {
								GtkImage* select_image = NULL;
								GtkWidget* _tmp14_;
								GtkImage* _tmp15_;
								gboolean _tmp16_;
								gboolean _tmp17_;
								_tmp14_ = widget2;
								select_image = G_TYPE_CHECK_INSTANCE_TYPE (_tmp14_, gtk_image_get_type ()) ? ((GtkImage*) _tmp14_) : NULL;
								_tmp15_ = select_image;
								_tmp16_ = gtk_widget_get_visible ((GtkWidget*) _tmp15_);
								_tmp17_ = _tmp16_;
								select = _tmp17_;
							}
							_tmp18_ = widget2;
							_tmp19_ = gtk_widget_get_name (_tmp18_);
							_tmp20_ = _tmp19_;
							if (g_strcmp0 (_tmp20_, "GtkLabel") == 0) {
								GtkLabel* label = NULL;
								GtkWidget* _tmp21_;
								_tmp21_ = widget2;
								label = G_TYPE_CHECK_INSTANCE_TYPE (_tmp21_, gtk_label_get_type ()) ? ((GtkLabel*) _tmp21_) : NULL;
								if (select) {
									GPtrArray* _tmp22_;
									GtkLabel* _tmp23_;
									const gchar* _tmp24_;
									const gchar* _tmp25_;
									gchar* _tmp26_;
									_tmp22_ = selected;
									_tmp23_ = label;
									_tmp24_ = gtk_label_get_label (_tmp23_);
									_tmp25_ = _tmp24_;
									_tmp26_ = g_strdup (_tmp25_);
									g_ptr_array_add (_tmp22_, _tmp26_);
									select = FALSE;
								}
							}
						}
					}
				}
				(children == NULL) ? NULL : (children = (g_list_free (children), NULL));
			}
		}
	}
	result = selected;
	(list == NULL) ? NULL : (list = (g_list_free (list), NULL));
	return result;
}

static void
pamac_choose_pkgs_dialog_on_row_activated (PamacChoosePkgsDialog* self,
                                           GtkListBoxRow* row)
{
	GtkWidget* child = NULL;
	GtkWidget* _tmp0_;
	GtkBox* box = NULL;
	GtkWidget* _tmp1_;
	GList* children = NULL;
	GtkBox* _tmp2_;
	GList* _tmp3_;
	GList* _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (row != NULL);
	_tmp0_ = gtk_bin_get_child ((GtkBin*) row);
	child = _tmp0_;
	_tmp1_ = child;
	box = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, gtk_box_get_type ()) ? ((GtkBox*) _tmp1_) : NULL;
	_tmp2_ = box;
	_tmp3_ = gtk_container_get_children ((GtkContainer*) _tmp2_);
	children = _tmp3_;
	_tmp4_ = children;
	{
		GList* widget_collection = NULL;
		GList* widget_it = NULL;
		widget_collection = _tmp4_;
		for (widget_it = widget_collection; widget_it != NULL; widget_it = widget_it->next) {
			GtkWidget* widget = NULL;
			widget = (GtkWidget*) widget_it->data;
			{
				GtkWidget* _tmp5_;
				const gchar* _tmp6_;
				const gchar* _tmp7_;
				GtkWidget* _tmp14_;
				const gchar* _tmp15_;
				const gchar* _tmp16_;
				_tmp5_ = widget;
				_tmp6_ = gtk_widget_get_name (_tmp5_);
				_tmp7_ = _tmp6_;
				if (g_strcmp0 (_tmp7_, "GtkImage") == 0) {
					GtkImage* select_image = NULL;
					GtkWidget* _tmp8_;
					GtkImage* _tmp9_;
					gboolean _tmp10_;
					gboolean _tmp11_;
					_tmp8_ = widget;
					select_image = G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, gtk_image_get_type ()) ? ((GtkImage*) _tmp8_) : NULL;
					_tmp9_ = select_image;
					_tmp10_ = gtk_widget_get_visible ((GtkWidget*) _tmp9_);
					_tmp11_ = _tmp10_;
					if (_tmp11_) {
						GtkImage* _tmp12_;
						_tmp12_ = select_image;
						gtk_widget_set_visible ((GtkWidget*) _tmp12_, FALSE);
					} else {
						GtkImage* _tmp13_;
						_tmp13_ = select_image;
						gtk_widget_set_visible ((GtkWidget*) _tmp13_, TRUE);
					}
				}
				_tmp14_ = widget;
				_tmp15_ = gtk_widget_get_name (_tmp14_);
				_tmp16_ = _tmp15_;
				if (g_strcmp0 (_tmp16_, "GtkLabel") == 0) {
					GtkLabel* label = NULL;
					GtkWidget* _tmp17_;
					GtkLabel* _tmp18_;
					gint _tmp19_;
					gint _tmp20_;
					_tmp17_ = widget;
					label = G_TYPE_CHECK_INSTANCE_TYPE (_tmp17_, gtk_label_get_type ()) ? ((GtkLabel*) _tmp17_) : NULL;
					_tmp18_ = label;
					_tmp19_ = gtk_widget_get_margin_start ((GtkWidget*) _tmp18_);
					_tmp20_ = _tmp19_;
					if (_tmp20_ == 22) {
						GtkLabel* _tmp21_;
						_tmp21_ = label;
						gtk_widget_set_margin_start ((GtkWidget*) _tmp21_, 0);
					} else {
						GtkLabel* _tmp22_;
						_tmp22_ = label;
						gtk_widget_set_margin_start ((GtkWidget*) _tmp22_, 22);
					}
				}
			}
		}
	}
	(children == NULL) ? NULL : (children = (g_list_free (children), NULL));
}

static void
_pamac_choose_pkgs_dialog_on_row_activated_gtk_list_box_row_activated (GtkListBox* _sender,
                                                                       GtkListBoxRow* row,
                                                                       gpointer self)
{
	pamac_choose_pkgs_dialog_on_row_activated ((PamacChoosePkgsDialog*) self, row);
}

static Block12Data*
block12_data_ref (Block12Data* _data12_)
{
	g_atomic_int_inc (&_data12_->_ref_count_);
	return _data12_;
}

static void
block12_data_unref (void * _userdata_)
{
	Block12Data* _data12_;
	_data12_ = (Block12Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data12_->_ref_count_)) {
		PamacChoosePkgsDialog* self;
		self = _data12_->self;
		_g_free0 (_data12_->search_string);
		_g_object_unref0 (self);
		g_slice_free (Block12Data, _data12_);
	}
}

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
___lambda6_ (Block12Data* _data12_,
             GtkListBoxRow* row)
{
	PamacChoosePkgsDialog* self;
	GtkWidget* child = NULL;
	GtkWidget* _tmp0_;
	GtkBox* box = NULL;
	GtkWidget* _tmp1_;
	GList* children = NULL;
	GtkBox* _tmp2_;
	GList* _tmp3_;
	GList* _tmp4_;
	gboolean result;
	self = _data12_->self;
	g_return_val_if_fail (row != NULL, FALSE);
	_tmp0_ = gtk_bin_get_child ((GtkBin*) row);
	child = _tmp0_;
	_tmp1_ = child;
	box = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, gtk_box_get_type ()) ? ((GtkBox*) _tmp1_) : NULL;
	_tmp2_ = box;
	_tmp3_ = gtk_container_get_children ((GtkContainer*) _tmp2_);
	children = _tmp3_;
	_tmp4_ = children;
	{
		GList* widget_collection = NULL;
		GList* widget_it = NULL;
		widget_collection = _tmp4_;
		for (widget_it = widget_collection; widget_it != NULL; widget_it = widget_it->next) {
			GtkWidget* widget = NULL;
			widget = (GtkWidget*) widget_it->data;
			{
				GtkWidget* _tmp5_;
				const gchar* _tmp6_;
				const gchar* _tmp7_;
				_tmp5_ = widget;
				_tmp6_ = gtk_widget_get_name (_tmp5_);
				_tmp7_ = _tmp6_;
				if (g_strcmp0 (_tmp7_, "GtkLabel") == 0) {
					GtkLabel* label = NULL;
					GtkWidget* _tmp8_;
					GtkLabel* _tmp9_;
					const gchar* _tmp10_;
					const gchar* _tmp11_;
					const gchar* _tmp12_;
					_tmp8_ = widget;
					label = G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, gtk_label_get_type ()) ? ((GtkLabel*) _tmp8_) : NULL;
					_tmp9_ = label;
					_tmp10_ = gtk_label_get_label (_tmp9_);
					_tmp11_ = _tmp10_;
					_tmp12_ = _data12_->search_string;
					if (g_str_has_prefix (_tmp11_, _tmp12_)) {
						result = TRUE;
						(children == NULL) ? NULL : (children = (g_list_free (children), NULL));
						return result;
					}
				}
			}
		}
	}
	result = FALSE;
	(children == NULL) ? NULL : (children = (g_list_free (children), NULL));
	return result;
}

static gboolean
____lambda6__gtk_list_box_filter_func (GtkListBoxRow* row,
                                       gpointer self)
{
	gboolean result;
	result = ___lambda6_ (self, row);
	return result;
}

static void
pamac_choose_pkgs_dialog_on_search_text_changed (PamacChoosePkgsDialog* self)
{
	Block12Data* _data12_;
	GtkSearchEntry* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	const gchar* _tmp6_;
	g_return_if_fail (self != NULL);
	_data12_ = g_slice_new0 (Block12Data);
	_data12_->_ref_count_ = 1;
	_data12_->self = g_object_ref (self);
	_tmp0_ = self->search_entry;
	_tmp1_ = gtk_entry_get_text ((GtkEntry*) _tmp0_);
	_tmp2_ = g_utf8_strdown (_tmp1_, (gssize) -1);
	_tmp3_ = _tmp2_;
	_tmp4_ = string_strip (_tmp3_);
	_tmp5_ = _tmp4_;
	_g_free0 (_tmp3_);
	_data12_->search_string = _tmp5_;
	_tmp6_ = _data12_->search_string;
	if (g_strcmp0 (_tmp6_, "") != 0) {
		GtkListBox* _tmp7_;
		_tmp7_ = self->listbox;
		gtk_list_box_set_filter_func (_tmp7_, ____lambda6__gtk_list_box_filter_func, block12_data_ref (_data12_), block12_data_unref);
	} else {
		GtkListBox* _tmp8_;
		_tmp8_ = self->listbox;
		gtk_list_box_set_filter_func (_tmp8_, NULL, NULL, NULL);
	}
	block12_data_unref (_data12_);
	_data12_ = NULL;
}

static void
_pamac_choose_pkgs_dialog_on_search_text_changed_gtk_search_entry_search_changed (GtkSearchEntry* _sender,
                                                                                  gpointer self)
{
	pamac_choose_pkgs_dialog_on_search_text_changed ((PamacChoosePkgsDialog*) self);
}

static void
pamac_choose_pkgs_dialog_class_init (PamacChoosePkgsDialogClass * klass,
                                     gpointer klass_data)
{
	pamac_choose_pkgs_dialog_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->finalize = pamac_choose_pkgs_dialog_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/manjaro/pamac/transaction/choose_pkgs_dialog.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "search_clamp", FALSE, G_STRUCT_OFFSET (PamacChoosePkgsDialog, search_clamp));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "search_entry", FALSE, G_STRUCT_OFFSET (PamacChoosePkgsDialog, search_entry));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "search_separator", FALSE, G_STRUCT_OFFSET (PamacChoosePkgsDialog, search_separator));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "listbox", FALSE, G_STRUCT_OFFSET (PamacChoosePkgsDialog, listbox));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "cancel_button", FALSE, G_STRUCT_OFFSET (PamacChoosePkgsDialog, cancel_button));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_row_activated", G_CALLBACK(_pamac_choose_pkgs_dialog_on_row_activated_gtk_list_box_row_activated));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_search_text_changed", G_CALLBACK(_pamac_choose_pkgs_dialog_on_search_text_changed_gtk_search_entry_search_changed));
}

static void
pamac_choose_pkgs_dialog_instance_init (PamacChoosePkgsDialog * self,
                                        gpointer klass)
{
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
pamac_choose_pkgs_dialog_finalize (GObject * obj)
{
	PamacChoosePkgsDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PAMAC_TYPE_CHOOSE_PKGS_DIALOG, PamacChoosePkgsDialog);
	G_OBJECT_CLASS (pamac_choose_pkgs_dialog_parent_class)->finalize (obj);
}

static GType
pamac_choose_pkgs_dialog_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PamacChoosePkgsDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pamac_choose_pkgs_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PamacChoosePkgsDialog), 0, (GInstanceInitFunc) pamac_choose_pkgs_dialog_instance_init, NULL };
	GType pamac_choose_pkgs_dialog_type_id;
	pamac_choose_pkgs_dialog_type_id = g_type_register_static (gtk_dialog_get_type (), "PamacChoosePkgsDialog", &g_define_type_info, 0);
	return pamac_choose_pkgs_dialog_type_id;
}

GType
pamac_choose_pkgs_dialog_get_type (void)
{
	static volatile gsize pamac_choose_pkgs_dialog_type_id__once = 0;
	if (g_once_init_enter (&pamac_choose_pkgs_dialog_type_id__once)) {
		GType pamac_choose_pkgs_dialog_type_id;
		pamac_choose_pkgs_dialog_type_id = pamac_choose_pkgs_dialog_get_type_once ();
		g_once_init_leave (&pamac_choose_pkgs_dialog_type_id__once, pamac_choose_pkgs_dialog_type_id);
	}
	return pamac_choose_pkgs_dialog_type_id__once;
}

