/* tools-group-box.c generated by valac 0.56.19, the Vala compiler
 * generated from tools-group-box.vala, do not modify */

#include "protonplus_core.h"
#include <gtk/gtk.h>
#include <adwaita.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib-object.h>
#include <float.h>
#include <math.h>
#include <glib/gi18n-lib.h>
#include <gee.h>
#include <gio/gio.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	PROTON_PLUS_WIDGETS_TOOLS_GROUP_BOX_0_PROPERTY,
	PROTON_PLUS_WIDGETS_TOOLS_GROUP_BOX_HEADER_TITLE_PROPERTY,
	PROTON_PLUS_WIDGETS_TOOLS_GROUP_BOX_FILTER_PROPERTY,
	PROTON_PLUS_WIDGETS_TOOLS_GROUP_BOX_SEARCH_TEXT_PROPERTY,
	PROTON_PLUS_WIDGETS_TOOLS_GROUP_BOX_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_tools_group_box_properties[PROTON_PLUS_WIDGETS_TOOLS_GROUP_BOX_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))
typedef struct _Block17Data Block17Data;
typedef struct _Block18Data Block18Data;
enum  {
	PROTON_PLUS_WIDGETS_TOOLS_GROUP_BOX_TOOL_SELECTED_SIGNAL,
	PROTON_PLUS_WIDGETS_TOOLS_GROUP_BOX_NUM_SIGNALS
};
static guint proton_plus_widgets_tools_group_box_signals[PROTON_PLUS_WIDGETS_TOOLS_GROUP_BOX_NUM_SIGNALS] = {0};

struct _ProtonPlusWidgetsToolsGroupBoxPrivate {
	GtkBox* _header_title;
	GtkListBox* list_box;
	GtkStack* stack;
	AdwStatusPage* status_page;
	GtkWidget* controller_up_target;
	ProtonPlusWidgetsToolsFilter _filter;
	gchar* _search_text;
};

struct _Block17Data {
	int _ref_count_;
	ProtonPlusWidgetsToolsGroupBox* self;
	ProtonPlusModelsGroup* group;
};

struct _Block18Data {
	int _ref_count_;
	ProtonPlusWidgetsToolsGroupBox* self;
	ProtonPlusModelsTool* tool;
};

static gint ProtonPlusWidgetsToolsGroupBox_private_offset;
static gpointer proton_plus_widgets_tools_group_box_parent_class = NULL;
static ProtonPlusUtilsControllerDirectionalFocusIface * proton_plus_widgets_tools_group_box_proton_plus_utils_controller_directional_focus_parent_iface = NULL;

static Block17Data* block17_data_ref (Block17Data* _data17_);
static void block17_data_unref (void * _userdata_);
static void proton_plus_widgets_tools_group_box_set_header_title (ProtonPlusWidgetsToolsGroupBox* self,
                                                           GtkBox* value);
static gboolean proton_plus_widgets_tools_group_box_filter_func (ProtonPlusWidgetsToolsGroupBox* self,
                                                          GtkListBoxRow* row);
static gboolean _proton_plus_widgets_tools_group_box_filter_func_gtk_list_box_filter_func (GtkListBoxRow* row,
                                                                                    gpointer self);
static gint proton_plus_widgets_tools_group_box_sort_func (ProtonPlusWidgetsToolsGroupBox* self,
                                                    GtkListBoxRow* row1,
                                                    GtkListBoxRow* row2);
static gint _proton_plus_widgets_tools_group_box_sort_func_gtk_list_box_sort_func (GtkListBoxRow* row1,
                                                                            GtkListBoxRow* row2,
                                                                            gpointer self);
static void __lambda75_ (Block17Data* _data17_);
static void ___lambda75__proton_plus_models_group_installed_tool_index_invalidated (ProtonPlusModelsGroup* _sender,
                                                                             gpointer self);
static void __lambda76_ (ProtonPlusWidgetsToolsGroupBox* self);
static void ___lambda76__proton_plus_models_group_installed_state_refreshed (ProtonPlusModelsGroup* _sender,
                                                                      gpointer self);
static AdwActionRow* proton_plus_widgets_tools_group_box_create_tool_card (ProtonPlusWidgetsToolsGroupBox* self,
                                                                    ProtonPlusModelsTool* tool);
static void proton_plus_widgets_tools_group_box_update_visibility (ProtonPlusWidgetsToolsGroupBox* self);
static gboolean proton_plus_widgets_tools_group_box_real_controller_focus_direction (ProtonPlusUtilsControllerDirectionalFocus* base,
                                                                              GObject* focused_object,
                                                                              ProtonPlusUtilsControllerNavigationDirection direction);
static GtkListBoxRow* proton_plus_widgets_tools_group_box_find_row_ancestor (ProtonPlusWidgetsToolsGroupBox* self,
                                                                      GtkWidget* widget);
static GtkListBoxRow* proton_plus_widgets_tools_group_box_find_first_visible_row (ProtonPlusWidgetsToolsGroupBox* self);
static void proton_plus_widgets_tools_group_box_update_status_page (ProtonPlusWidgetsToolsGroupBox* self);
static void proton_plus_widgets_tools_group_box_refresh_tool_state_pills (ProtonPlusWidgetsToolsGroupBox* self);
static void proton_plus_widgets_tools_group_box_update_tool_state_pill (ProtonPlusWidgetsToolsGroupBox* self,
                                                                 GtkLabel* pill,
                                                                 ProtonPlusModelsTool* tool);
static Block18Data* block18_data_ref (Block18Data* _data18_);
static void block18_data_unref (void * _userdata_);
static void __lambda77_ (Block18Data* _data18_);
static void ___lambda77__adw_action_row_activated (AdwActionRow* _sender,
                                            gpointer self);
static void proton_plus_widgets_tools_group_box_finalize (GObject * obj);
static GType proton_plus_widgets_tools_group_box_get_type_once (void);
static void _vala_proton_plus_widgets_tools_group_box_get_property (GObject * object,
                                                             guint property_id,
                                                             GValue * value,
                                                             GParamSpec * pspec);
static void _vala_proton_plus_widgets_tools_group_box_set_property (GObject * object,
                                                             guint property_id,
                                                             const GValue * value,
                                                             GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static inline gpointer
proton_plus_widgets_tools_group_box_get_instance_private (ProtonPlusWidgetsToolsGroupBox* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsToolsGroupBox_private_offset);
}

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

static Block17Data*
block17_data_ref (Block17Data* _data17_)
{
	g_atomic_int_inc (&_data17_->_ref_count_);
	return _data17_;
}

static void
block17_data_unref (void * _userdata_)
{
	Block17Data* _data17_;
	_data17_ = (Block17Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data17_->_ref_count_)) {
		ProtonPlusWidgetsToolsGroupBox* self;
		self = _data17_->self;
		_g_object_unref0 (_data17_->group);
		_g_object_unref0 (self);
		g_slice_free (Block17Data, _data17_);
	}
}

static gboolean
_proton_plus_widgets_tools_group_box_filter_func_gtk_list_box_filter_func (GtkListBoxRow* row,
                                                                           gpointer self)
{
	gboolean result;
	result = proton_plus_widgets_tools_group_box_filter_func ((ProtonPlusWidgetsToolsGroupBox*) self, row);
	return result;
}

static gint
_proton_plus_widgets_tools_group_box_sort_func_gtk_list_box_sort_func (GtkListBoxRow* row1,
                                                                       GtkListBoxRow* row2,
                                                                       gpointer self)
{
	gint result;
	result = proton_plus_widgets_tools_group_box_sort_func ((ProtonPlusWidgetsToolsGroupBox*) self, row1, row2);
	return result;
}

static void
__lambda75_ (Block17Data* _data17_)
{
	ProtonPlusWidgetsToolsGroupBox* self;
	self = _data17_->self;
	proton_plus_models_group_refresh_installed_state (_data17_->group);
}

static void
___lambda75__proton_plus_models_group_installed_tool_index_invalidated (ProtonPlusModelsGroup* _sender,
                                                                        gpointer self)
{
	__lambda75_ (self);
}

static void
__lambda76_ (ProtonPlusWidgetsToolsGroupBox* self)
{
	proton_plus_widgets_tools_group_box_refresh (self);
}

static void
___lambda76__proton_plus_models_group_installed_state_refreshed (ProtonPlusModelsGroup* _sender,
                                                                 gpointer self)
{
	__lambda76_ ((ProtonPlusWidgetsToolsGroupBox*) self);
}

ProtonPlusWidgetsToolsGroupBox*
proton_plus_widgets_tools_group_box_construct (GType object_type,
                                               ProtonPlusModelsGroup* group,
                                               GtkWidget* controller_up_target)
{
	ProtonPlusWidgetsToolsGroupBox * self = NULL;
	Block17Data* _data17_;
	ProtonPlusModelsGroup* _tmp0_;
	GtkImage* icon = NULL;
	GtkImage* _tmp1_;
	GtkLabel* title_label = NULL;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar** _tmp5_;
	GtkLabel* _tmp6_ = NULL;
	GtkLabel* desc_label = NULL;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	gchar** _tmp10_;
	GtkLabel* _tmp11_ = NULL;
	GtkBox* title_box = NULL;
	GtkBox* _tmp12_;
	GtkBox* _tmp13_;
	GtkLabel* _tmp14_;
	GtkBox* _tmp15_;
	GtkLabel* _tmp16_;
	GtkBox* _tmp17_;
	GtkBox* _tmp18_;
	GtkBox* _tmp19_;
	GtkImage* _tmp20_;
	GtkBox* _tmp21_;
	GtkBox* _tmp22_;
	GtkListBox* _tmp23_ = NULL;
	GtkListBox* _tmp24_;
	GtkListBox* _tmp25_;
	GtkListBox* _tmp26_;
	GtkListBox* _tmp27_;
	GtkScrolledWindow* scrolled = NULL;
	GtkListBox* _tmp28_;
	GtkWidget* _tmp29_;
	GtkScrolledWindow* _tmp30_ = NULL;
	gchar* _tmp31_;
	gchar* _tmp32_;
	gchar* _tmp33_;
	AdwStatusPage* _tmp34_ = NULL;
	GtkStack* _tmp35_ = NULL;
	GtkStack* _tmp36_;
	GtkStack* _tmp37_;
	GtkScrolledWindow* _tmp38_;
	GtkStack* _tmp39_;
	AdwStatusPage* _tmp40_;
	GtkListBox* _tmp57_;
	GtkBox* group_box = NULL;
	GtkBox* _tmp58_;
	GtkStack* _tmp59_;
	AdwClamp* clamp = NULL;
	GtkWidget* _tmp60_;
	AdwClamp* _tmp61_ = NULL;
	g_return_val_if_fail (group != NULL, NULL);
	_data17_ = g_slice_new0 (Block17Data);
	_data17_->_ref_count_ = 1;
	_tmp0_ = _g_object_ref0 (group);
	_g_object_unref0 (_data17_->group);
	_data17_->group = _tmp0_;
	self = (ProtonPlusWidgetsToolsGroupBox*) g_object_new (object_type, "orientation", GTK_ORIENTATION_VERTICAL, "spacing", 0, NULL);
	_data17_->self = g_object_ref (self);
	self->priv->controller_up_target = controller_up_target;
	proton_plus_models_group_refresh_installed_state (_data17_->group);
	_tmp1_ = (GtkImage*) gtk_image_new_from_icon_name ("layer-group-symbolic");
	g_object_ref_sink (_tmp1_);
	icon = _tmp1_;
	_tmp2_ = proton_plus_models_group_get_title (_data17_->group);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_strdup ("title-4");
	_tmp5_ = g_new0 (gchar*, 1 + 1);
	_tmp5_[0] = _tmp4_;
	_tmp6_ = (GtkLabel*) gtk_label_new (_tmp3_);
	gtk_widget_set_halign ((GtkWidget*) _tmp6_, GTK_ALIGN_START);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp6_, _tmp5_);
	_tmp5_ = (_vala_array_free (_tmp5_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp6_);
	title_label = _tmp6_;
	_tmp7_ = proton_plus_models_group_get_description (_data17_->group);
	_tmp8_ = _tmp7_;
	_tmp9_ = g_strdup ("caption");
	_tmp10_ = g_new0 (gchar*, 1 + 1);
	_tmp10_[0] = _tmp9_;
	_tmp11_ = (GtkLabel*) gtk_label_new (_tmp8_);
	gtk_widget_set_halign ((GtkWidget*) _tmp11_, GTK_ALIGN_START);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp11_, _tmp10_);
	_tmp10_ = (_vala_array_free (_tmp10_, 1, (GDestroyNotify) g_free), NULL);
	gtk_label_set_wrap (_tmp11_, TRUE);
	gtk_label_set_xalign (_tmp11_, (gfloat) 0);
	g_object_ref_sink (_tmp11_);
	desc_label = _tmp11_;
	_tmp12_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	g_object_ref_sink (_tmp12_);
	title_box = _tmp12_;
	_tmp13_ = title_box;
	_tmp14_ = title_label;
	gtk_box_append (_tmp13_, (GtkWidget*) _tmp14_);
	_tmp15_ = title_box;
	_tmp16_ = desc_label;
	gtk_box_append (_tmp15_, (GtkWidget*) _tmp16_);
	_tmp17_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
	g_object_ref_sink (_tmp17_);
	_tmp18_ = _tmp17_;
	proton_plus_widgets_tools_group_box_set_header_title (self, _tmp18_);
	_g_object_unref0 (_tmp18_);
	_tmp19_ = self->priv->_header_title;
	_tmp20_ = icon;
	gtk_box_append (_tmp19_, (GtkWidget*) _tmp20_);
	_tmp21_ = self->priv->_header_title;
	_tmp22_ = title_box;
	gtk_box_append (_tmp21_, (GtkWidget*) _tmp22_);
	_tmp23_ = (GtkListBox*) gtk_list_box_new ();
	gtk_list_box_set_selection_mode (_tmp23_, GTK_SELECTION_NONE);
	g_object_ref_sink (_tmp23_);
	_g_object_unref0 (self->priv->list_box);
	self->priv->list_box = _tmp23_;
	_tmp24_ = self->priv->list_box;
	gtk_widget_add_css_class ((GtkWidget*) _tmp24_, "boxed-list");
	_tmp25_ = self->priv->list_box;
	gtk_widget_add_css_class ((GtkWidget*) _tmp25_, "tools-tools-card");
	_tmp26_ = self->priv->list_box;
	gtk_list_box_set_filter_func (_tmp26_, _proton_plus_widgets_tools_group_box_filter_func_gtk_list_box_filter_func, g_object_ref (self), g_object_unref);
	_tmp27_ = self->priv->list_box;
	gtk_list_box_set_sort_func (_tmp27_, _proton_plus_widgets_tools_group_box_sort_func_gtk_list_box_sort_func, g_object_ref (self), g_object_unref);
	g_signal_connect_data (_data17_->group, "installed-tool-index-invalidated", (GCallback) ___lambda75__proton_plus_models_group_installed_tool_index_invalidated, block17_data_ref (_data17_), (GClosureNotify) block17_data_unref, 0);
	g_signal_connect_object (_data17_->group, "installed-state-refreshed", (GCallback) ___lambda76__proton_plus_models_group_installed_state_refreshed, self, 0);
	_tmp28_ = self->priv->list_box;
	_tmp29_ = _g_object_ref0 ((GtkWidget*) _tmp28_);
	_tmp30_ = (GtkScrolledWindow*) gtk_scrolled_window_new ();
	gtk_scrolled_window_set_child (_tmp30_, _tmp29_);
	_g_object_unref0 (_tmp29_);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp30_, TRUE);
	g_object_set (_tmp30_, "hscrollbar-policy", GTK_POLICY_NEVER, NULL);
	g_object_set (_tmp30_, "vscrollbar-policy", GTK_POLICY_AUTOMATIC, NULL);
	gtk_widget_set_overflow ((GtkWidget*) _tmp30_, GTK_OVERFLOW_HIDDEN);
	g_object_ref_sink (_tmp30_);
	scrolled = _tmp30_;
	_tmp31_ = g_strdup (_ ("No tools found"));
	_tmp32_ = g_strdup (_ ("No tools match the current filter."));
	_tmp33_ = g_strdup ("magnifying-glass-symbolic");
	_tmp34_ = (AdwStatusPage*) adw_status_page_new ();
	adw_status_page_set_title (_tmp34_, _tmp31_);
	_g_free0 (_tmp31_);
	adw_status_page_set_description (_tmp34_, _tmp32_);
	_g_free0 (_tmp32_);
	adw_status_page_set_icon_name (_tmp34_, _tmp33_);
	_g_free0 (_tmp33_);
	g_object_ref_sink (_tmp34_);
	_g_object_unref0 (self->priv->status_page);
	self->priv->status_page = _tmp34_;
	_tmp35_ = (GtkStack*) gtk_stack_new ();
	gtk_widget_set_vexpand ((GtkWidget*) _tmp35_, TRUE);
	gtk_widget_set_overflow ((GtkWidget*) _tmp35_, GTK_OVERFLOW_HIDDEN);
	g_object_ref_sink (_tmp35_);
	_g_object_unref0 (self->priv->stack);
	self->priv->stack = _tmp35_;
	_tmp36_ = self->priv->stack;
	gtk_widget_add_css_class ((GtkWidget*) _tmp36_, "card");
	_tmp37_ = self->priv->stack;
	_tmp38_ = scrolled;
	gtk_stack_add_named (_tmp37_, (GtkWidget*) _tmp38_, "list");
	_tmp39_ = self->priv->stack;
	_tmp40_ = self->priv->status_page;
	gtk_stack_add_named (_tmp39_, (GtkWidget*) _tmp40_, "empty");
	{
		GeeLinkedList* _tool_list = NULL;
		GeeLinkedList* _tmp41_;
		GeeLinkedList* _tmp42_;
		gint _tool_size = 0;
		GeeLinkedList* _tmp43_;
		gint _tmp44_;
		gint _tmp45_;
		gint _tool_index = 0;
		_tmp41_ = proton_plus_models_group_get_tools (_data17_->group);
		_tmp42_ = _tmp41_;
		_tool_list = _tmp42_;
		_tmp43_ = _tool_list;
		_tmp44_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp43_);
		_tmp45_ = _tmp44_;
		_tool_size = _tmp45_;
		_tool_index = -1;
		while (TRUE) {
			gint _tmp46_;
			gint _tmp47_;
			ProtonPlusModelsTool* tool = NULL;
			GeeLinkedList* _tmp48_;
			gpointer _tmp49_;
			AdwActionRow* row = NULL;
			ProtonPlusModelsTool* _tmp50_;
			AdwActionRow* _tmp51_;
			AdwActionRow* _tmp52_;
			ProtonPlusModelsTool* _tmp53_;
			ProtonPlusModelsTool* _tmp54_;
			GtkListBox* _tmp55_;
			AdwActionRow* _tmp56_;
			_tool_index = _tool_index + 1;
			_tmp46_ = _tool_index;
			_tmp47_ = _tool_size;
			if (!(_tmp46_ < _tmp47_)) {
				break;
			}
			_tmp48_ = _tool_list;
			_tmp49_ = gee_abstract_list_get ((GeeAbstractList*) _tmp48_, _tool_index);
			tool = (ProtonPlusModelsTool*) _tmp49_;
			_tmp50_ = tool;
			_tmp51_ = proton_plus_widgets_tools_group_box_create_tool_card (self, _tmp50_);
			row = _tmp51_;
			_tmp52_ = row;
			_tmp53_ = tool;
			_tmp54_ = _g_object_ref0 (_tmp53_);
			g_object_set_data_full ((GObject*) _tmp52_, "tool", _tmp54_, g_object_unref);
			_tmp55_ = self->priv->list_box;
			_tmp56_ = row;
			gtk_list_box_append (_tmp55_, (GtkWidget*) _tmp56_);
			_g_object_unref0 (row);
			_g_object_unref0 (tool);
		}
	}
	_tmp57_ = self->priv->list_box;
	gtk_list_box_invalidate_sort (_tmp57_);
	_tmp58_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
	g_object_ref_sink (_tmp58_);
	group_box = _tmp58_;
	_tmp59_ = self->priv->stack;
	gtk_box_append (group_box, (GtkWidget*) _tmp59_);
	_tmp60_ = _g_object_ref0 ((GtkWidget*) group_box);
	_tmp61_ = (AdwClamp*) adw_clamp_new ();
	adw_clamp_set_maximum_size (_tmp61_, 975);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp61_, 12);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp61_, 12);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp61_, 12);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp61_, 12);
	adw_clamp_set_child (_tmp61_, _tmp60_);
	_g_object_unref0 (_tmp60_);
	g_object_ref_sink (_tmp61_);
	clamp = _tmp61_;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) clamp);
	proton_plus_widgets_tools_group_box_update_visibility (self);
	_g_object_unref0 (clamp);
	_g_object_unref0 (group_box);
	_g_object_unref0 (scrolled);
	_g_object_unref0 (title_box);
	_g_object_unref0 (desc_label);
	_g_object_unref0 (title_label);
	_g_object_unref0 (icon);
	block17_data_unref (_data17_);
	_data17_ = NULL;
	return self;
}

ProtonPlusWidgetsToolsGroupBox*
proton_plus_widgets_tools_group_box_new (ProtonPlusModelsGroup* group,
                                         GtkWidget* controller_up_target)
{
	return proton_plus_widgets_tools_group_box_construct (PROTON_PLUS_WIDGETS_TOOLS_TYPE_GROUP_BOX, group, controller_up_target);
}

static gboolean
proton_plus_widgets_tools_group_box_real_controller_focus_direction (ProtonPlusUtilsControllerDirectionalFocus* base,
                                                                     GObject* focused_object,
                                                                     ProtonPlusUtilsControllerNavigationDirection direction)
{
	ProtonPlusWidgetsToolsGroupBox * self;
	GtkWidget* focused = NULL;
	GtkWidget* _tmp0_;
	GtkListBoxRow* focused_row = NULL;
	GtkWidget* _tmp1_;
	GtkListBoxRow* _tmp2_;
	gboolean _tmp3_ = FALSE;
	GtkListBoxRow* _tmp4_;
	gboolean _tmp8_ = FALSE;
	gboolean _tmp9_ = FALSE;
	gboolean _tmp10_ = FALSE;
	gboolean _tmp11_ = FALSE;
	GtkWidget* _tmp12_;
	gboolean result;
	self = (ProtonPlusWidgetsToolsGroupBox*) base;
	g_return_val_if_fail (focused_object != NULL, FALSE);
	if (direction != PROTON_PLUS_UTILS_CONTROLLER_NAVIGATION_DIRECTION_UP) {
		result = FALSE;
		return result;
	}
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (focused_object, gtk_widget_get_type ()) ? ((GtkWidget*) focused_object) : NULL);
	focused = _tmp0_;
	_tmp1_ = focused;
	_tmp2_ = proton_plus_widgets_tools_group_box_find_row_ancestor (self, _tmp1_);
	focused_row = _tmp2_;
	_tmp4_ = focused_row;
	if (_tmp4_ == NULL) {
		_tmp3_ = TRUE;
	} else {
		GtkListBoxRow* _tmp5_;
		GtkListBoxRow* _tmp6_;
		GtkListBoxRow* _tmp7_;
		_tmp5_ = focused_row;
		_tmp6_ = proton_plus_widgets_tools_group_box_find_first_visible_row (self);
		_tmp7_ = _tmp6_;
		_tmp3_ = _tmp5_ != _tmp7_;
		_g_object_unref0 (_tmp7_);
	}
	if (_tmp3_) {
		result = FALSE;
		_g_object_unref0 (focused_row);
		_g_object_unref0 (focused);
		return result;
	}
	_tmp12_ = self->priv->controller_up_target;
	if (_tmp12_ != NULL) {
		GtkWidget* _tmp13_;
		_tmp13_ = self->priv->controller_up_target;
		_tmp11_ = gtk_widget_get_mapped (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, gtk_widget_get_type (), GtkWidget));
	} else {
		_tmp11_ = FALSE;
	}
	if (_tmp11_) {
		GtkWidget* _tmp14_;
		_tmp14_ = self->priv->controller_up_target;
		_tmp10_ = gtk_widget_is_visible (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, gtk_widget_get_type (), GtkWidget));
	} else {
		_tmp10_ = FALSE;
	}
	if (_tmp10_) {
		GtkWidget* _tmp15_;
		_tmp15_ = self->priv->controller_up_target;
		_tmp9_ = gtk_widget_is_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, gtk_widget_get_type (), GtkWidget));
	} else {
		_tmp9_ = FALSE;
	}
	if (_tmp9_) {
		GtkWidget* _tmp16_;
		_tmp16_ = self->priv->controller_up_target;
		_tmp8_ = gtk_widget_grab_focus (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, gtk_widget_get_type (), GtkWidget));
	} else {
		_tmp8_ = FALSE;
	}
	result = _tmp8_;
	_g_object_unref0 (focused_row);
	_g_object_unref0 (focused);
	return result;
}

static GtkListBoxRow*
proton_plus_widgets_tools_group_box_find_row_ancestor (ProtonPlusWidgetsToolsGroupBox* self,
                                                       GtkWidget* widget)
{
	GtkWidget* current = NULL;
	GtkWidget* _tmp0_;
	GtkListBoxRow* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = _g_object_ref0 (widget);
	current = _tmp0_;
	while (TRUE) {
		gboolean _tmp1_ = FALSE;
		GtkWidget* _tmp2_;
		GtkWidget* _tmp5_;
		GtkWidget* _tmp8_;
		GtkWidget* _tmp9_;
		GtkWidget* _tmp10_;
		_tmp2_ = current;
		if (_tmp2_ != NULL) {
			GtkWidget* _tmp3_;
			GtkListBox* _tmp4_;
			_tmp3_ = current;
			_tmp4_ = self->priv->list_box;
			_tmp1_ = _tmp3_ != G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_widget_get_type (), GtkWidget);
		} else {
			_tmp1_ = FALSE;
		}
		if (!_tmp1_) {
			break;
		}
		_tmp5_ = current;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, gtk_list_box_row_get_type ())) {
			GtkWidget* _tmp6_;
			GtkListBoxRow* _tmp7_;
			_tmp6_ = current;
			_tmp7_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_list_box_row_get_type (), GtkListBoxRow));
			result = _tmp7_;
			_g_object_unref0 (current);
			return result;
		}
		_tmp8_ = current;
		_tmp9_ = gtk_widget_get_parent (_tmp8_);
		_tmp10_ = _g_object_ref0 (_tmp9_);
		_g_object_unref0 (current);
		current = _tmp10_;
	}
	result = NULL;
	_g_object_unref0 (current);
	return result;
}

static GtkListBoxRow*
proton_plus_widgets_tools_group_box_find_first_visible_row (ProtonPlusWidgetsToolsGroupBox* self)
{
	GtkWidget* child = NULL;
	GtkListBox* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	GtkListBoxRow* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->list_box;
	_tmp1_ = gtk_widget_get_first_child ((GtkWidget*) _tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	child = _tmp2_;
	while (TRUE) {
		GtkWidget* _tmp3_;
		gboolean _tmp4_ = FALSE;
		gboolean _tmp5_ = FALSE;
		gboolean _tmp6_ = FALSE;
		gboolean _tmp7_ = FALSE;
		gboolean _tmp8_ = FALSE;
		GtkWidget* _tmp9_;
		GtkWidget* _tmp17_;
		GtkWidget* _tmp18_;
		GtkWidget* _tmp19_;
		_tmp3_ = child;
		if (!(_tmp3_ != NULL)) {
			break;
		}
		_tmp9_ = child;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp9_, gtk_list_box_row_get_type ())) {
			GtkWidget* _tmp10_;
			_tmp10_ = child;
			_tmp8_ = gtk_widget_get_mapped (_tmp10_);
		} else {
			_tmp8_ = FALSE;
		}
		if (_tmp8_) {
			GtkWidget* _tmp11_;
			_tmp11_ = child;
			_tmp7_ = gtk_widget_is_visible (_tmp11_);
		} else {
			_tmp7_ = FALSE;
		}
		if (_tmp7_) {
			GtkWidget* _tmp12_;
			_tmp12_ = child;
			_tmp6_ = gtk_widget_get_child_visible (_tmp12_);
		} else {
			_tmp6_ = FALSE;
		}
		if (_tmp6_) {
			GtkWidget* _tmp13_;
			_tmp13_ = child;
			_tmp5_ = gtk_widget_is_sensitive (_tmp13_);
		} else {
			_tmp5_ = FALSE;
		}
		if (_tmp5_) {
			GtkWidget* _tmp14_;
			_tmp14_ = child;
			_tmp4_ = gtk_widget_get_focusable (_tmp14_);
		} else {
			_tmp4_ = FALSE;
		}
		if (_tmp4_) {
			GtkWidget* _tmp15_;
			GtkListBoxRow* _tmp16_;
			_tmp15_ = child;
			_tmp16_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, gtk_list_box_row_get_type (), GtkListBoxRow));
			result = _tmp16_;
			_g_object_unref0 (child);
			return result;
		}
		_tmp17_ = child;
		_tmp18_ = gtk_widget_get_next_sibling (_tmp17_);
		_tmp19_ = _g_object_ref0 (_tmp18_);
		_g_object_unref0 (child);
		child = _tmp19_;
	}
	result = NULL;
	_g_object_unref0 (child);
	return result;
}

GObject*
proton_plus_widgets_tools_group_box_get_controller_initial_focus (ProtonPlusWidgetsToolsGroupBox* self)
{
	GtkListBoxRow* _tmp0_;
	GObject* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = proton_plus_widgets_tools_group_box_find_first_visible_row (self);
	result = (GObject*) _tmp0_;
	return result;
}

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 void
proton_plus_widgets_tools_group_box_update_status_page (ProtonPlusWidgetsToolsGroupBox* self)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gboolean _tmp4_;
	ProtonPlusWidgetsToolsFilter _tmp8_;
	ProtonPlusWidgetsToolsFilter _tmp9_;
	g_return_if_fail (self != NULL);
	_tmp0_ = proton_plus_widgets_tools_group_box_get_search_text (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = string_strip (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_strcmp0 (_tmp3_, "") != 0;
	_g_free0 (_tmp3_);
	if (_tmp4_) {
		AdwStatusPage* _tmp5_;
		AdwStatusPage* _tmp6_;
		AdwStatusPage* _tmp7_;
		_tmp5_ = self->priv->status_page;
		adw_status_page_set_title (_tmp5_, _ ("No matching tools"));
		_tmp6_ = self->priv->status_page;
		adw_status_page_set_description (_tmp6_, _ ("Try a different search term or clear the search."));
		_tmp7_ = self->priv->status_page;
		adw_status_page_set_icon_name (_tmp7_, "magnifying-glass-symbolic");
		return;
	}
	_tmp8_ = proton_plus_widgets_tools_group_box_get_filter (self);
	_tmp9_ = _tmp8_;
	switch (_tmp9_) {
		case PROTON_PLUS_WIDGETS_TOOLS_FILTER_INSTALLED:
		{
			AdwStatusPage* _tmp10_;
			AdwStatusPage* _tmp11_;
			AdwStatusPage* _tmp12_;
			_tmp10_ = self->priv->status_page;
			adw_status_page_set_title (_tmp10_, _ ("No installed tools"));
			_tmp11_ = self->priv->status_page;
			adw_status_page_set_description (_tmp11_, _ ("Install a compatibility tool to see it here."));
			_tmp12_ = self->priv->status_page;
			adw_status_page_set_icon_name (_tmp12_, "box-open-symbolic");
			break;
		}
		case PROTON_PLUS_WIDGETS_TOOLS_FILTER_USED:
		{
			AdwStatusPage* _tmp13_;
			AdwStatusPage* _tmp14_;
			AdwStatusPage* _tmp15_;
			_tmp13_ = self->priv->status_page;
			adw_status_page_set_title (_tmp13_, _ ("No tools in use"));
			_tmp14_ = self->priv->status_page;
			adw_status_page_set_description (_tmp14_, _ ("No games currently use a tool from this group."));
			_tmp15_ = self->priv->status_page;
			adw_status_page_set_icon_name (_tmp15_, "gamepad2-symbolic");
			break;
		}
		case PROTON_PLUS_WIDGETS_TOOLS_FILTER_UNUSED:
		{
			AdwStatusPage* _tmp16_;
			AdwStatusPage* _tmp17_;
			AdwStatusPage* _tmp18_;
			_tmp16_ = self->priv->status_page;
			adw_status_page_set_title (_tmp16_, _ ("No unused tools"));
			_tmp17_ = self->priv->status_page;
			adw_status_page_set_description (_tmp17_, _ ("Every tool in this group is currently in use."));
			_tmp18_ = self->priv->status_page;
			adw_status_page_set_icon_name (_tmp18_, "check-round-outline-symbolic");
			break;
		}
		default:
		{
			AdwStatusPage* _tmp19_;
			AdwStatusPage* _tmp20_;
			AdwStatusPage* _tmp21_;
			_tmp19_ = self->priv->status_page;
			adw_status_page_set_title (_tmp19_, _ ("No tools found"));
			_tmp20_ = self->priv->status_page;
			adw_status_page_set_description (_tmp20_, _ ("No tools are available in this group."));
			_tmp21_ = self->priv->status_page;
			adw_status_page_set_icon_name (_tmp21_, "magnifying-glass-symbolic");
			break;
		}
	}
}

static void
proton_plus_widgets_tools_group_box_update_visibility (ProtonPlusWidgetsToolsGroupBox* self)
{
	gboolean has_visible = FALSE;
	GtkWidget* child = NULL;
	GtkListBox* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	g_return_if_fail (self != NULL);
	has_visible = FALSE;
	_tmp0_ = self->priv->list_box;
	_tmp1_ = gtk_widget_get_first_child ((GtkWidget*) _tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	child = _tmp2_;
	while (TRUE) {
		GtkWidget* _tmp3_;
		GtkWidget* _tmp4_;
		GtkWidget* _tmp6_;
		GtkWidget* _tmp7_;
		GtkWidget* _tmp8_;
		_tmp3_ = child;
		if (!(_tmp3_ != NULL)) {
			break;
		}
		_tmp4_ = child;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, gtk_list_box_row_get_type ())) {
			GtkWidget* _tmp5_;
			_tmp5_ = child;
			if (proton_plus_widgets_tools_group_box_filter_func (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_list_box_row_get_type (), GtkListBoxRow))) {
				has_visible = TRUE;
				break;
			}
		}
		_tmp6_ = child;
		_tmp7_ = gtk_widget_get_next_sibling (_tmp6_);
		_tmp8_ = _g_object_ref0 (_tmp7_);
		_g_object_unref0 (child);
		child = _tmp8_;
	}
	if (has_visible) {
		GtkStack* _tmp9_;
		_tmp9_ = self->priv->stack;
		gtk_stack_set_visible_child_name (_tmp9_, "list");
	} else {
		GtkStack* _tmp10_;
		_tmp10_ = self->priv->stack;
		gtk_stack_set_visible_child_name (_tmp10_, "empty");
	}
	_g_object_unref0 (child);
}

void
proton_plus_widgets_tools_group_box_refresh (ProtonPlusWidgetsToolsGroupBox* self)
{
	GtkListBox* _tmp0_;
	GtkListBox* _tmp1_;
	g_return_if_fail (self != NULL);
	proton_plus_widgets_tools_group_box_refresh_tool_state_pills (self);
	_tmp0_ = self->priv->list_box;
	gtk_list_box_invalidate_filter (_tmp0_);
	_tmp1_ = self->priv->list_box;
	gtk_list_box_invalidate_sort (_tmp1_);
	proton_plus_widgets_tools_group_box_update_status_page (self);
	proton_plus_widgets_tools_group_box_update_visibility (self);
}

static void
proton_plus_widgets_tools_group_box_refresh_tool_state_pills (ProtonPlusWidgetsToolsGroupBox* self)
{
	GtkWidget* child = NULL;
	GtkListBox* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->list_box;
	_tmp1_ = gtk_widget_get_first_child ((GtkWidget*) _tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	child = _tmp2_;
	while (TRUE) {
		GtkWidget* _tmp3_;
		AdwActionRow* row = NULL;
		GtkWidget* _tmp4_;
		AdwActionRow* _tmp5_;
		AdwActionRow* _tmp6_;
		GtkWidget* _tmp18_;
		GtkWidget* _tmp19_;
		GtkWidget* _tmp20_;
		_tmp3_ = child;
		if (!(_tmp3_ != NULL)) {
			break;
		}
		_tmp4_ = child;
		_tmp5_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, adw_action_row_get_type ()) ? ((AdwActionRow*) _tmp4_) : NULL);
		row = _tmp5_;
		_tmp6_ = row;
		if (_tmp6_ != NULL) {
			ProtonPlusModelsTool* tool = NULL;
			AdwActionRow* _tmp7_;
			gconstpointer _tmp8_;
			ProtonPlusModelsTool* _tmp9_;
			GtkLabel* state_pill = NULL;
			AdwActionRow* _tmp10_;
			gconstpointer _tmp11_;
			GtkLabel* _tmp12_;
			gboolean _tmp13_ = FALSE;
			ProtonPlusModelsTool* _tmp14_;
			_tmp7_ = row;
			_tmp8_ = g_object_get_data ((GObject*) _tmp7_, "tool");
			_tmp9_ = _g_object_ref0 ((ProtonPlusModelsTool*) _tmp8_);
			tool = _tmp9_;
			_tmp10_ = row;
			_tmp11_ = g_object_get_data ((GObject*) _tmp10_, "state-pill");
			_tmp12_ = _g_object_ref0 ((GtkLabel*) _tmp11_);
			state_pill = _tmp12_;
			_tmp14_ = tool;
			if (_tmp14_ != NULL) {
				GtkLabel* _tmp15_;
				_tmp15_ = state_pill;
				_tmp13_ = _tmp15_ != NULL;
			} else {
				_tmp13_ = FALSE;
			}
			if (_tmp13_) {
				GtkLabel* _tmp16_;
				ProtonPlusModelsTool* _tmp17_;
				_tmp16_ = state_pill;
				_tmp17_ = tool;
				proton_plus_widgets_tools_group_box_update_tool_state_pill (self, _tmp16_, _tmp17_);
			}
			_g_object_unref0 (state_pill);
			_g_object_unref0 (tool);
		}
		_tmp18_ = child;
		_tmp19_ = gtk_widget_get_next_sibling (_tmp18_);
		_tmp20_ = _g_object_ref0 (_tmp19_);
		_g_object_unref0 (child);
		child = _tmp20_;
		_g_object_unref0 (row);
	}
	_g_object_unref0 (child);
}

static Block18Data*
block18_data_ref (Block18Data* _data18_)
{
	g_atomic_int_inc (&_data18_->_ref_count_);
	return _data18_;
}

static void
block18_data_unref (void * _userdata_)
{
	Block18Data* _data18_;
	_data18_ = (Block18Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data18_->_ref_count_)) {
		ProtonPlusWidgetsToolsGroupBox* self;
		self = _data18_->self;
		_g_object_unref0 (_data18_->tool);
		_g_object_unref0 (self);
		g_slice_free (Block18Data, _data18_);
	}
}

static void
__lambda77_ (Block18Data* _data18_)
{
	ProtonPlusWidgetsToolsGroupBox* self;
	self = _data18_->self;
	g_signal_emit (self, proton_plus_widgets_tools_group_box_signals[PROTON_PLUS_WIDGETS_TOOLS_GROUP_BOX_TOOL_SELECTED_SIGNAL], 0, _data18_->tool);
}

static void
___lambda77__adw_action_row_activated (AdwActionRow* _sender,
                                       gpointer self)
{
	__lambda77_ (self);
}

static AdwActionRow*
proton_plus_widgets_tools_group_box_create_tool_card (ProtonPlusWidgetsToolsGroupBox* self,
                                                      ProtonPlusModelsTool* tool)
{
	Block18Data* _data18_;
	ProtonPlusModelsTool* _tmp0_;
	GtkImage* icon = NULL;
	GtkImage* _tmp1_;
	AdwActionRow* row = NULL;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	AdwActionRow* _tmp8_ = NULL;
	AdwActionRow* _tmp9_;
	AdwActionRow* _tmp10_;
	GtkImage* _tmp11_;
	GtkLabel* state_pill = NULL;
	GtkLabel* _tmp41_;
	AdwActionRow* _tmp42_;
	GtkLabel* _tmp43_;
	AdwActionRow* _tmp44_;
	AdwActionRow* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (tool != NULL, NULL);
	_data18_ = g_slice_new0 (Block18Data);
	_data18_->_ref_count_ = 1;
	_data18_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (tool);
	_g_object_unref0 (_data18_->tool);
	_data18_->tool = _tmp0_;
	_tmp1_ = (GtkImage*) gtk_image_new_from_icon_name ("screwdriver-wrench-symbolic");
	g_object_ref_sink (_tmp1_);
	icon = _tmp1_;
	_tmp2_ = proton_plus_models_tool_get_title (_data18_->tool);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_strdup (_tmp3_);
	_tmp5_ = proton_plus_models_tool_get_description (_data18_->tool);
	_tmp6_ = _tmp5_;
	_tmp7_ = g_strdup (_tmp6_);
	_tmp8_ = (AdwActionRow*) adw_action_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp8_, _tmp4_);
	_g_free0 (_tmp4_);
	adw_action_row_set_subtitle (_tmp8_, _tmp7_);
	_g_free0 (_tmp7_);
	gtk_list_box_row_set_activatable ((GtkListBoxRow*) _tmp8_, TRUE);
	g_object_ref_sink (_tmp8_);
	row = _tmp8_;
	_tmp9_ = row;
	g_signal_connect_data (_tmp9_, "activated", (GCallback) ___lambda77__adw_action_row_activated, block18_data_ref (_data18_), (GClosureNotify) block18_data_unref, 0);
	_tmp10_ = row;
	_tmp11_ = icon;
	adw_action_row_add_prefix (_tmp10_, (GtkWidget*) _tmp11_);
	if (PROTON_PLUS_MODELS_TOOLS_IS_PROVIDER_TOOL (_data18_->tool)) {
		ProtonPlusModelsToolsProviderTool* provider_tool = NULL;
		ProtonPlusModelsToolsProviderTool* _tmp12_;
		gboolean _tmp13_ = FALSE;
		ProtonPlusModelsToolsProviderTool* _tmp14_;
		gchar* _tmp15_;
		gchar* _tmp16_;
		gchar* _tmp17_;
		gboolean _tmp18_;
		_tmp12_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_data18_->tool, PROTON_PLUS_MODELS_TOOLS_TYPE_PROVIDER_TOOL, ProtonPlusModelsToolsProviderTool));
		provider_tool = _tmp12_;
		_tmp14_ = provider_tool;
		_tmp15_ = proton_plus_models_tools_provider_tool_get_tag (_tmp14_);
		_tmp16_ = _tmp15_;
		_tmp17_ = _tmp16_;
		_tmp18_ = _tmp17_ != NULL;
		_g_free0 (_tmp17_);
		if (_tmp18_) {
			ProtonPlusModelsToolsProviderTool* _tmp19_;
			gchar* _tmp20_;
			gchar* _tmp21_;
			gchar* _tmp22_;
			_tmp19_ = provider_tool;
			_tmp20_ = proton_plus_models_tools_provider_tool_get_tag (_tmp19_);
			_tmp21_ = _tmp20_;
			_tmp22_ = _tmp21_;
			_tmp13_ = g_strcmp0 (_tmp22_, "") != 0;
			_g_free0 (_tmp22_);
		} else {
			_tmp13_ = FALSE;
		}
		if (_tmp13_) {
			GtkLabel* pill = NULL;
			ProtonPlusModelsToolsProviderTool* _tmp23_;
			gchar* _tmp24_;
			gchar* _tmp25_;
			gchar* _tmp26_;
			gchar* _tmp27_;
			gchar* _tmp28_;
			GtkLabel* _tmp29_;
			GtkLabel* _tmp30_;
			GtkLabel* _tmp31_;
			GtkLabel* _tmp32_;
			ProtonPlusModelsToolsProviderTool* _tmp33_;
			gchar* _tmp34_;
			gchar* _tmp35_;
			gchar* _tmp36_;
			gboolean _tmp37_;
			AdwActionRow* _tmp39_;
			GtkLabel* _tmp40_;
			_tmp23_ = provider_tool;
			_tmp24_ = proton_plus_models_tools_provider_tool_get_tag (_tmp23_);
			_tmp25_ = _tmp24_;
			_tmp26_ = _tmp25_;
			_tmp27_ = proton_plus_utils_safe_translate (_tmp26_);
			_tmp28_ = _tmp27_;
			_tmp29_ = (GtkLabel*) gtk_label_new (_tmp28_);
			g_object_ref_sink (_tmp29_);
			_tmp30_ = _tmp29_;
			_g_free0 (_tmp28_);
			_g_free0 (_tmp26_);
			pill = _tmp30_;
			_tmp31_ = pill;
			gtk_widget_add_css_class ((GtkWidget*) _tmp31_, "tag-pill");
			_tmp32_ = pill;
			gtk_widget_set_valign ((GtkWidget*) _tmp32_, GTK_ALIGN_CENTER);
			_tmp33_ = provider_tool;
			_tmp34_ = proton_plus_models_tools_provider_tool_get_tag (_tmp33_);
			_tmp35_ = _tmp34_;
			_tmp36_ = _tmp35_;
			_tmp37_ = g_strcmp0 (_tmp36_, "Recommended") == 0;
			_g_free0 (_tmp36_);
			if (_tmp37_) {
				GtkLabel* _tmp38_;
				_tmp38_ = pill;
				gtk_widget_set_tooltip_text ((GtkWidget*) _tmp38_, _ ("Recommended compatibility tool"));
			}
			_tmp39_ = row;
			_tmp40_ = pill;
			adw_action_row_add_suffix (_tmp39_, (GtkWidget*) _tmp40_);
			_g_object_unref0 (pill);
		}
		_g_object_unref0 (provider_tool);
	}
	_tmp41_ = (GtkLabel*) gtk_label_new ("");
	g_object_ref_sink (_tmp41_);
	state_pill = _tmp41_;
	gtk_widget_set_valign ((GtkWidget*) state_pill, GTK_ALIGN_CENTER);
	_tmp42_ = row;
	_tmp43_ = _g_object_ref0 (state_pill);
	g_object_set_data_full ((GObject*) _tmp42_, "state-pill", _tmp43_, g_object_unref);
	_tmp44_ = row;
	adw_action_row_add_suffix (_tmp44_, (GtkWidget*) state_pill);
	proton_plus_widgets_tools_group_box_update_tool_state_pill (self, state_pill, _data18_->tool);
	result = row;
	_g_object_unref0 (state_pill);
	_g_object_unref0 (icon);
	block18_data_unref (_data18_);
	_data18_ = NULL;
	return result;
}

static void
proton_plus_widgets_tools_group_box_update_tool_state_pill (ProtonPlusWidgetsToolsGroupBox* self,
                                                            GtkLabel* pill,
                                                            ProtonPlusModelsTool* tool)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (pill != NULL);
	g_return_if_fail (tool != NULL);
	gtk_widget_remove_css_class ((GtkWidget*) pill, "installed-pill");
	gtk_widget_remove_css_class ((GtkWidget*) pill, "in-use-pill");
	if (proton_plus_models_tool_is_used (tool)) {
		gtk_label_set_label (pill, _ ("In use"));
		gtk_widget_set_tooltip_text ((GtkWidget*) pill, _ ("One or more releases of this tool is installed and currently used by o" \
"ne or more games"));
		gtk_widget_add_css_class ((GtkWidget*) pill, "in-use-pill");
		gtk_widget_set_visible ((GtkWidget*) pill, TRUE);
	} else {
		if (proton_plus_models_tool_is_installed (tool)) {
			gtk_label_set_label (pill, _ ("Installed"));
			gtk_widget_set_tooltip_text ((GtkWidget*) pill, _ ("One or more releases of this tool is installed, but not currently used" \
" by any games"));
			gtk_widget_add_css_class ((GtkWidget*) pill, "installed-pill");
			gtk_widget_set_visible ((GtkWidget*) pill, TRUE);
		} else {
			gtk_widget_set_visible ((GtkWidget*) pill, FALSE);
		}
	}
}

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
proton_plus_widgets_tools_group_box_filter_func (ProtonPlusWidgetsToolsGroupBox* self,
                                                 GtkListBoxRow* row)
{
	ProtonPlusModelsTool* tool = NULL;
	gconstpointer _tmp0_;
	ProtonPlusModelsTool* _tmp1_;
	ProtonPlusModelsTool* _tmp2_;
	gboolean _tmp3_ = FALSE;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	gboolean _tmp15_ = FALSE;
	gboolean _tmp16_ = FALSE;
	GSettings* _tmp17_;
	ProtonPlusWidgetsToolsFilter _tmp22_;
	ProtonPlusWidgetsToolsFilter _tmp23_;
	ProtonPlusWidgetsToolsFilter _tmp24_;
	ProtonPlusWidgetsToolsFilter _tmp25_;
	ProtonPlusWidgetsToolsFilter _tmp27_;
	ProtonPlusWidgetsToolsFilter _tmp28_;
	ProtonPlusWidgetsToolsFilter _tmp30_;
	ProtonPlusWidgetsToolsFilter _tmp31_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (row != NULL, FALSE);
	_tmp0_ = g_object_get_data ((GObject*) row, "tool");
	_tmp1_ = _g_object_ref0 ((ProtonPlusModelsTool*) _tmp0_);
	tool = _tmp1_;
	_tmp2_ = tool;
	if (_tmp2_ == NULL) {
		result = TRUE;
		_g_object_unref0 (tool);
		return result;
	}
	_tmp4_ = proton_plus_widgets_tools_group_box_get_search_text (self);
	_tmp5_ = _tmp4_;
	if (g_strcmp0 (_tmp5_, "") != 0) {
		ProtonPlusModelsTool* _tmp6_;
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		const gchar* _tmp11_;
		const gchar* _tmp12_;
		gchar* _tmp13_;
		gchar* _tmp14_;
		_tmp6_ = tool;
		_tmp7_ = proton_plus_models_tool_get_title (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = g_utf8_strdown (_tmp8_, (gssize) -1);
		_tmp10_ = _tmp9_;
		_tmp11_ = proton_plus_widgets_tools_group_box_get_search_text (self);
		_tmp12_ = _tmp11_;
		_tmp13_ = g_utf8_strdown (_tmp12_, (gssize) -1);
		_tmp14_ = _tmp13_;
		_tmp3_ = !string_contains (_tmp10_, _tmp14_);
		_g_free0 (_tmp14_);
		_g_free0 (_tmp10_);
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		result = FALSE;
		_g_object_unref0 (tool);
		return result;
	}
	_tmp17_ = proton_plus_globals_SETTINGS;
	if (_tmp17_ != NULL) {
		GSettings* _tmp18_;
		_tmp18_ = proton_plus_globals_SETTINGS;
		_tmp16_ = !g_settings_get_boolean (_tmp18_, "show-legacy-tools");
	} else {
		_tmp16_ = FALSE;
	}
	if (_tmp16_) {
		ProtonPlusModelsTool* _tmp19_;
		gboolean _tmp20_;
		gboolean _tmp21_;
		_tmp19_ = tool;
		_tmp20_ = proton_plus_models_tool_get_legacy (_tmp19_);
		_tmp21_ = _tmp20_;
		_tmp15_ = _tmp21_;
	} else {
		_tmp15_ = FALSE;
	}
	if (_tmp15_) {
		result = FALSE;
		_g_object_unref0 (tool);
		return result;
	}
	_tmp22_ = proton_plus_widgets_tools_group_box_get_filter (self);
	_tmp23_ = _tmp22_;
	if (_tmp23_ == PROTON_PLUS_WIDGETS_TOOLS_FILTER_ALL) {
		result = TRUE;
		_g_object_unref0 (tool);
		return result;
	}
	_tmp24_ = proton_plus_widgets_tools_group_box_get_filter (self);
	_tmp25_ = _tmp24_;
	if (_tmp25_ == PROTON_PLUS_WIDGETS_TOOLS_FILTER_INSTALLED) {
		ProtonPlusModelsTool* _tmp26_;
		_tmp26_ = tool;
		result = proton_plus_models_tool_is_installed (_tmp26_);
		_g_object_unref0 (tool);
		return result;
	}
	_tmp27_ = proton_plus_widgets_tools_group_box_get_filter (self);
	_tmp28_ = _tmp27_;
	if (_tmp28_ == PROTON_PLUS_WIDGETS_TOOLS_FILTER_USED) {
		ProtonPlusModelsTool* _tmp29_;
		_tmp29_ = tool;
		result = proton_plus_models_tool_is_used (_tmp29_);
		_g_object_unref0 (tool);
		return result;
	}
	_tmp30_ = proton_plus_widgets_tools_group_box_get_filter (self);
	_tmp31_ = _tmp30_;
	if (_tmp31_ == PROTON_PLUS_WIDGETS_TOOLS_FILTER_UNUSED) {
		ProtonPlusModelsTool* _tmp32_;
		_tmp32_ = tool;
		result = !proton_plus_models_tool_is_used (_tmp32_);
		_g_object_unref0 (tool);
		return result;
	}
	result = TRUE;
	_g_object_unref0 (tool);
	return result;
}

static gint
proton_plus_widgets_tools_group_box_sort_func (ProtonPlusWidgetsToolsGroupBox* self,
                                               GtkListBoxRow* row1,
                                               GtkListBoxRow* row2)
{
	ProtonPlusModelsTool* tool1 = NULL;
	gconstpointer _tmp0_;
	ProtonPlusModelsTool* _tmp1_;
	ProtonPlusModelsTool* tool2 = NULL;
	gconstpointer _tmp2_;
	ProtonPlusModelsTool* _tmp3_;
	gboolean _tmp4_ = FALSE;
	ProtonPlusModelsTool* _tmp5_;
	gboolean tool1_installed = FALSE;
	ProtonPlusModelsTool* _tmp7_;
	gboolean tool2_installed = FALSE;
	ProtonPlusModelsTool* _tmp8_;
	gboolean tool1_used = FALSE;
	ProtonPlusModelsTool* _tmp9_;
	gboolean tool2_used = FALSE;
	ProtonPlusModelsTool* _tmp10_;
	gint _result_ = 0;
	ProtonPlusModelsTool* _tmp12_;
	gint _tmp13_;
	gint _tmp14_;
	ProtonPlusModelsTool* _tmp15_;
	gint _tmp16_;
	gint _tmp17_;
	GCompareFunc _tmp19_;
	ProtonPlusModelsTool* _tmp20_;
	const gchar* _tmp21_;
	const gchar* _tmp22_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	ProtonPlusModelsTool* _tmp25_;
	const gchar* _tmp26_;
	const gchar* _tmp27_;
	gchar* _tmp28_;
	gchar* _tmp29_;
	gint _tmp30_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	g_return_val_if_fail (row1 != NULL, -1);
	g_return_val_if_fail (row2 != NULL, -1);
	_tmp0_ = g_object_get_data ((GObject*) row1, "tool");
	_tmp1_ = _g_object_ref0 ((ProtonPlusModelsTool*) _tmp0_);
	tool1 = _tmp1_;
	_tmp2_ = g_object_get_data ((GObject*) row2, "tool");
	_tmp3_ = _g_object_ref0 ((ProtonPlusModelsTool*) _tmp2_);
	tool2 = _tmp3_;
	_tmp5_ = tool1;
	if (_tmp5_ == NULL) {
		_tmp4_ = TRUE;
	} else {
		ProtonPlusModelsTool* _tmp6_;
		_tmp6_ = tool2;
		_tmp4_ = _tmp6_ == NULL;
	}
	if (_tmp4_) {
		result = 0;
		_g_object_unref0 (tool2);
		_g_object_unref0 (tool1);
		return result;
	}
	_tmp7_ = tool1;
	tool1_installed = proton_plus_models_tool_is_installed (_tmp7_);
	_tmp8_ = tool2;
	tool2_installed = proton_plus_models_tool_is_installed (_tmp8_);
	_tmp9_ = tool1;
	tool1_used = proton_plus_models_tool_is_used (_tmp9_);
	_tmp10_ = tool2;
	tool2_used = proton_plus_models_tool_is_used (_tmp10_);
	_result_ = 0;
	if (tool1_installed != tool2_installed) {
		gint _tmp11_ = 0;
		if (tool1_installed) {
			_tmp11_ = -1000000;
		} else {
			_tmp11_ = 1000000;
		}
		_result_ += _tmp11_;
	}
	_tmp12_ = tool1;
	_tmp13_ = proton_plus_models_tool_get_sort_priority (_tmp12_);
	_tmp14_ = _tmp13_;
	_tmp15_ = tool2;
	_tmp16_ = proton_plus_models_tool_get_sort_priority (_tmp15_);
	_tmp17_ = _tmp16_;
	_result_ += (_tmp14_ - _tmp17_) * 1000;
	if (tool1_used != tool2_used) {
		gint _tmp18_ = 0;
		if (tool1_used) {
			_tmp18_ = -1;
		} else {
			_tmp18_ = 1;
		}
		_result_ += _tmp18_;
	}
	if (_result_ != 0) {
		result = _result_;
		_g_object_unref0 (tool2);
		_g_object_unref0 (tool1);
		return result;
	}
	_tmp19_ = ((GCompareFunc) g_strcmp0);
	_tmp20_ = tool1;
	_tmp21_ = proton_plus_models_tool_get_title (_tmp20_);
	_tmp22_ = _tmp21_;
	_tmp23_ = g_utf8_strdown (_tmp22_, (gssize) -1);
	_tmp24_ = _tmp23_;
	_tmp25_ = tool2;
	_tmp26_ = proton_plus_models_tool_get_title (_tmp25_);
	_tmp27_ = _tmp26_;
	_tmp28_ = g_utf8_strdown (_tmp27_, (gssize) -1);
	_tmp29_ = _tmp28_;
	_tmp30_ = _tmp19_ (_tmp24_, _tmp29_);
	_g_free0 (_tmp29_);
	_g_free0 (_tmp24_);
	result = _tmp30_;
	_g_object_unref0 (tool2);
	_g_object_unref0 (tool1);
	return result;
}

GtkBox*
proton_plus_widgets_tools_group_box_get_header_title (ProtonPlusWidgetsToolsGroupBox* self)
{
	GtkBox* result;
	GtkBox* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_header_title;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_tools_group_box_set_header_title (ProtonPlusWidgetsToolsGroupBox* self,
                                                      GtkBox* value)
{
	GtkBox* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_tools_group_box_get_header_title (self);
	if (old_value != value) {
		GtkBox* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_header_title);
		self->priv->_header_title = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_tools_group_box_properties[PROTON_PLUS_WIDGETS_TOOLS_GROUP_BOX_HEADER_TITLE_PROPERTY]);
	}
}

ProtonPlusWidgetsToolsFilter
proton_plus_widgets_tools_group_box_get_filter (ProtonPlusWidgetsToolsGroupBox* self)
{
	ProtonPlusWidgetsToolsFilter result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_filter;
	return result;
}

void
proton_plus_widgets_tools_group_box_set_filter (ProtonPlusWidgetsToolsGroupBox* self,
                                                ProtonPlusWidgetsToolsFilter value)
{
	GtkListBox* _tmp0_;
	g_return_if_fail (self != NULL);
	self->priv->_filter = value;
	_tmp0_ = self->priv->list_box;
	gtk_list_box_invalidate_filter (_tmp0_);
	proton_plus_widgets_tools_group_box_update_status_page (self);
	proton_plus_widgets_tools_group_box_update_visibility (self);
	g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_tools_group_box_properties[PROTON_PLUS_WIDGETS_TOOLS_GROUP_BOX_FILTER_PROPERTY]);
}

const gchar*
proton_plus_widgets_tools_group_box_get_search_text (ProtonPlusWidgetsToolsGroupBox* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_search_text;
	result = _tmp0_;
	return result;
}

void
proton_plus_widgets_tools_group_box_set_search_text (ProtonPlusWidgetsToolsGroupBox* self,
                                                     const gchar* value)
{
	gchar* _tmp0_;
	GtkListBox* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_search_text);
	self->priv->_search_text = _tmp0_;
	_tmp1_ = self->priv->list_box;
	gtk_list_box_invalidate_filter (_tmp1_);
	proton_plus_widgets_tools_group_box_update_status_page (self);
	proton_plus_widgets_tools_group_box_update_visibility (self);
	g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_tools_group_box_properties[PROTON_PLUS_WIDGETS_TOOLS_GROUP_BOX_SEARCH_TEXT_PROPERTY]);
}

static void
proton_plus_widgets_tools_group_box_class_init (ProtonPlusWidgetsToolsGroupBoxClass * klass,
                                                gpointer klass_data)
{
	proton_plus_widgets_tools_group_box_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsToolsGroupBox_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_widgets_tools_group_box_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_widgets_tools_group_box_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_tools_group_box_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_TOOLS_GROUP_BOX_HEADER_TITLE_PROPERTY, proton_plus_widgets_tools_group_box_properties[PROTON_PLUS_WIDGETS_TOOLS_GROUP_BOX_HEADER_TITLE_PROPERTY] = g_param_spec_object ("header-title", "header-title", "header-title", gtk_box_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_TOOLS_GROUP_BOX_FILTER_PROPERTY, proton_plus_widgets_tools_group_box_properties[PROTON_PLUS_WIDGETS_TOOLS_GROUP_BOX_FILTER_PROPERTY] = g_param_spec_enum ("filter", "filter", "filter", PROTON_PLUS_WIDGETS_TOOLS_TYPE_FILTER, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_TOOLS_GROUP_BOX_SEARCH_TEXT_PROPERTY, proton_plus_widgets_tools_group_box_properties[PROTON_PLUS_WIDGETS_TOOLS_GROUP_BOX_SEARCH_TEXT_PROPERTY] = g_param_spec_string ("search-text", "search-text", "search-text", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	proton_plus_widgets_tools_group_box_signals[PROTON_PLUS_WIDGETS_TOOLS_GROUP_BOX_TOOL_SELECTED_SIGNAL] = g_signal_new ("tool-selected", PROTON_PLUS_WIDGETS_TOOLS_TYPE_GROUP_BOX, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, PROTON_PLUS_MODELS_TYPE_TOOL);
}

static void
proton_plus_widgets_tools_group_box_proton_plus_utils_controller_directional_focus_interface_init (ProtonPlusUtilsControllerDirectionalFocusIface * iface,
                                                                                                   gpointer iface_data)
{
	proton_plus_widgets_tools_group_box_proton_plus_utils_controller_directional_focus_parent_iface = g_type_interface_peek_parent (iface);
	iface->controller_focus_direction = (gboolean (*) (ProtonPlusUtilsControllerDirectionalFocus*, GObject*, ProtonPlusUtilsControllerNavigationDirection)) proton_plus_widgets_tools_group_box_real_controller_focus_direction;
}

static void
proton_plus_widgets_tools_group_box_instance_init (ProtonPlusWidgetsToolsGroupBox * self,
                                                   gpointer klass)
{
	gchar* _tmp0_;
	self->priv = proton_plus_widgets_tools_group_box_get_instance_private (self);
	self->priv->_filter = PROTON_PLUS_WIDGETS_TOOLS_FILTER_ALL;
	_tmp0_ = g_strdup ("");
	self->priv->_search_text = _tmp0_;
}

static void
proton_plus_widgets_tools_group_box_finalize (GObject * obj)
{
	ProtonPlusWidgetsToolsGroupBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_TOOLS_TYPE_GROUP_BOX, ProtonPlusWidgetsToolsGroupBox);
	_g_object_unref0 (self->priv->_header_title);
	_g_object_unref0 (self->priv->list_box);
	_g_object_unref0 (self->priv->stack);
	_g_object_unref0 (self->priv->status_page);
	_g_free0 (self->priv->_search_text);
	G_OBJECT_CLASS (proton_plus_widgets_tools_group_box_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_tools_group_box_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsToolsGroupBoxClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_tools_group_box_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsToolsGroupBox), 0, (GInstanceInitFunc) proton_plus_widgets_tools_group_box_instance_init, NULL };
	static const GInterfaceInfo proton_plus_utils_controller_directional_focus_info = { (GInterfaceInitFunc) proton_plus_widgets_tools_group_box_proton_plus_utils_controller_directional_focus_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType proton_plus_widgets_tools_group_box_type_id;
	proton_plus_widgets_tools_group_box_type_id = g_type_register_static (gtk_box_get_type (), "ProtonPlusWidgetsToolsGroupBox", &g_define_type_info, 0);
	g_type_add_interface_static (proton_plus_widgets_tools_group_box_type_id, PROTON_PLUS_UTILS_TYPE_CONTROLLER_DIRECTIONAL_FOCUS, &proton_plus_utils_controller_directional_focus_info);
	ProtonPlusWidgetsToolsGroupBox_private_offset = g_type_add_instance_private (proton_plus_widgets_tools_group_box_type_id, sizeof (ProtonPlusWidgetsToolsGroupBoxPrivate));
	return proton_plus_widgets_tools_group_box_type_id;
}

GType
proton_plus_widgets_tools_group_box_get_type (void)
{
	static volatile gsize proton_plus_widgets_tools_group_box_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_tools_group_box_type_id__once)) {
		GType proton_plus_widgets_tools_group_box_type_id;
		proton_plus_widgets_tools_group_box_type_id = proton_plus_widgets_tools_group_box_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_tools_group_box_type_id__once, proton_plus_widgets_tools_group_box_type_id);
	}
	return proton_plus_widgets_tools_group_box_type_id__once;
}

static void
_vala_proton_plus_widgets_tools_group_box_get_property (GObject * object,
                                                        guint property_id,
                                                        GValue * value,
                                                        GParamSpec * pspec)
{
	ProtonPlusWidgetsToolsGroupBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_TOOLS_TYPE_GROUP_BOX, ProtonPlusWidgetsToolsGroupBox);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_TOOLS_GROUP_BOX_HEADER_TITLE_PROPERTY:
		g_value_set_object (value, proton_plus_widgets_tools_group_box_get_header_title (self));
		break;
		case PROTON_PLUS_WIDGETS_TOOLS_GROUP_BOX_FILTER_PROPERTY:
		g_value_set_enum (value, proton_plus_widgets_tools_group_box_get_filter (self));
		break;
		case PROTON_PLUS_WIDGETS_TOOLS_GROUP_BOX_SEARCH_TEXT_PROPERTY:
		g_value_set_string (value, proton_plus_widgets_tools_group_box_get_search_text (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_widgets_tools_group_box_set_property (GObject * object,
                                                        guint property_id,
                                                        const GValue * value,
                                                        GParamSpec * pspec)
{
	ProtonPlusWidgetsToolsGroupBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_TOOLS_TYPE_GROUP_BOX, ProtonPlusWidgetsToolsGroupBox);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_TOOLS_GROUP_BOX_HEADER_TITLE_PROPERTY:
		proton_plus_widgets_tools_group_box_set_header_title (self, g_value_get_object (value));
		break;
		case PROTON_PLUS_WIDGETS_TOOLS_GROUP_BOX_FILTER_PROPERTY:
		proton_plus_widgets_tools_group_box_set_filter (self, g_value_get_enum (value));
		break;
		case PROTON_PLUS_WIDGETS_TOOLS_GROUP_BOX_SEARCH_TEXT_PROPERTY:
		proton_plus_widgets_tools_group_box_set_search_text (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

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

