/* games-mass-edit-view.c generated by valac 0.56.19, the Vala compiler
 * generated from games-mass-edit-view.vala, do not modify */

#include "protonplus_core.h"
#include <gtk/gtk.h>
#include <adwaita.h>
#include <gee.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <float.h>
#include <math.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_GAMES_MASS_EDIT_VIEW_0_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_MASS_EDIT_VIEW_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_games_mass_edit_view_properties[PROTON_PLUS_WIDGETS_GAMES_MASS_EDIT_VIEW_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))
enum  {
	PROTON_PLUS_WIDGETS_GAMES_MASS_EDIT_VIEW_BACK_REQUESTED_SIGNAL,
	PROTON_PLUS_WIDGETS_GAMES_MASS_EDIT_VIEW_NUM_SIGNALS
};
static guint proton_plus_widgets_games_mass_edit_view_signals[PROTON_PLUS_WIDGETS_GAMES_MASS_EDIT_VIEW_NUM_SIGNALS] = {0};

struct _ProtonPlusWidgetsGamesMassEditViewPrivate {
	GtkButton* clear_button;
	GtkButton* apply_button;
	GtkMenuButton* selection_button;
	AdwHeaderBar* _header_bar;
	AdwClamp* _content_clamp;
	GtkScrolledWindow* _scrolled_window;
	ProtonPlusWidgetsGamesCompatibilityToolRow* _compatibility_tool_row;
	AdwPreferencesGroup* _compatibility_tool_group;
	AdwPreferencesGroup* _launch_options_group;
	GtkSwitch* _compatibility_tool_switch;
	GtkSwitch* _launch_options_switch;
	ProtonPlusWidgetsGamesLaunchOptionsEditorBox* _launch_options_editor;
	GtkBox* _content_box;
	GtkLabel* _batch_hint;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCapabilityResolver* capability_resolver;
	GeeHashMap* compatibility_tools_by_id;
	ProtonPlusUtilsGpuVendor gpu_vendor;
};

static gint ProtonPlusWidgetsGamesMassEditView_private_offset;
static gpointer proton_plus_widgets_games_mass_edit_view_parent_class = NULL;

static void proton_plus_widgets_games_mass_edit_view_clear_button_clicked (ProtonPlusWidgetsGamesMassEditView* self);
static void _proton_plus_widgets_games_mass_edit_view_clear_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                        gpointer self);
static void proton_plus_widgets_games_mass_edit_view_apply_button_clicked (ProtonPlusWidgetsGamesMassEditView* self);
static void _proton_plus_widgets_games_mass_edit_view_apply_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                        gpointer self);
static void proton_plus_widgets_games_mass_edit_view_set_compatibility_tool_group (ProtonPlusWidgetsGamesMassEditView* self,
                                                                            AdwPreferencesGroup* value);
static AdwPreferencesGroup* proton_plus_widgets_games_mass_edit_view_get_compatibility_tool_group (ProtonPlusWidgetsGamesMassEditView* self);
static void proton_plus_widgets_games_mass_edit_view_set_compatibility_tool_switch (ProtonPlusWidgetsGamesMassEditView* self,
                                                                             GtkSwitch* value);
static GtkSwitch* proton_plus_widgets_games_mass_edit_view_get_compatibility_tool_switch (ProtonPlusWidgetsGamesMassEditView* self);
static void __lambda164_ (ProtonPlusWidgetsGamesMassEditView* self);
static ProtonPlusWidgetsGamesCompatibilityToolRow* proton_plus_widgets_games_mass_edit_view_get_compatibility_tool_row (ProtonPlusWidgetsGamesMassEditView* self);
static void proton_plus_widgets_games_mass_edit_view_refresh_capability_context (ProtonPlusWidgetsGamesMassEditView* self);
static void proton_plus_widgets_games_mass_edit_view_refresh (ProtonPlusWidgetsGamesMassEditView* self);
static void ___lambda164__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void proton_plus_widgets_games_mass_edit_view_set_launch_options_editor (ProtonPlusWidgetsGamesMassEditView* self,
                                                                         ProtonPlusWidgetsGamesLaunchOptionsEditorBox* value);
static ProtonPlusWidgetsGamesLaunchOptionsEditorBox* proton_plus_widgets_games_mass_edit_view_get_launch_options_editor (ProtonPlusWidgetsGamesMassEditView* self);
static void _proton_plus_widgets_games_mass_edit_view_refresh_proton_plus_widgets_games_launch_options_editor_box_content_changed (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* _sender,
                                                                                                                            gpointer self);
static void proton_plus_widgets_games_mass_edit_view_set_launch_options_group (ProtonPlusWidgetsGamesMassEditView* self,
                                                                        AdwPreferencesGroup* value);
static void proton_plus_widgets_games_mass_edit_view_set_launch_options_switch (ProtonPlusWidgetsGamesMassEditView* self,
                                                                         GtkSwitch* value);
static GtkSwitch* proton_plus_widgets_games_mass_edit_view_get_launch_options_switch (ProtonPlusWidgetsGamesMassEditView* self);
static AdwPreferencesGroup* proton_plus_widgets_games_mass_edit_view_get_launch_options_group (ProtonPlusWidgetsGamesMassEditView* self);
static void __lambda165_ (ProtonPlusWidgetsGamesMassEditView* self);
static void ___lambda165__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void proton_plus_widgets_games_mass_edit_view_set_batch_hint (ProtonPlusWidgetsGamesMassEditView* self,
                                                              GtkLabel* value);
static void proton_plus_widgets_games_mass_edit_view_set_content_box (ProtonPlusWidgetsGamesMassEditView* self,
                                                               GtkBox* value);
static GtkBox* proton_plus_widgets_games_mass_edit_view_get_content_box (ProtonPlusWidgetsGamesMassEditView* self);
static GtkLabel* proton_plus_widgets_games_mass_edit_view_get_batch_hint (ProtonPlusWidgetsGamesMassEditView* self);
static void proton_plus_widgets_games_mass_edit_view_set_content_clamp (ProtonPlusWidgetsGamesMassEditView* self,
                                                                 AdwClamp* value);
static AdwClamp* proton_plus_widgets_games_mass_edit_view_get_content_clamp (ProtonPlusWidgetsGamesMassEditView* self);
static void proton_plus_widgets_games_mass_edit_view_set_scrolled_window (ProtonPlusWidgetsGamesMassEditView* self,
                                                                   GtkScrolledWindow* value);
static GtkScrolledWindow* proton_plus_widgets_games_mass_edit_view_get_scrolled_window (ProtonPlusWidgetsGamesMassEditView* self);
static void proton_plus_widgets_games_mass_edit_view_set_header_bar (ProtonPlusWidgetsGamesMassEditView* self,
                                                              AdwHeaderBar* value);
static AdwHeaderBar* proton_plus_widgets_games_mass_edit_view_get_header_bar (ProtonPlusWidgetsGamesMassEditView* self);
static ProtonPlusWidgetsGamesGameRow** _vala_array_dup1 (ProtonPlusWidgetsGamesGameRow** self,
                                                  gssize length);
static gint __lambda166_ (ProtonPlusWidgetsGamesMassEditView* self,
                   ProtonPlusModelsCompatibilityTool* a,
                   ProtonPlusModelsCompatibilityTool* b);
static gint ___lambda166__gcompare_data_func (gconstpointer a,
                                       gconstpointer b,
                                       gpointer self);
static void proton_plus_widgets_games_mass_edit_view_set_compatibility_tool_row (ProtonPlusWidgetsGamesMassEditView* self,
                                                                          ProtonPlusWidgetsGamesCompatibilityToolRow* value);
static void _vala_array_add2 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static void _vala_array_add3 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static void __lambda167_ (ProtonPlusWidgetsGamesMassEditView* self);
static void ___lambda167__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void __lambda168_ (ProtonPlusWidgetsGamesMassEditView* self,
                   GObject* obj,
                   GAsyncResult* _result_);
static void ___lambda168__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
static void _g_free0_ (gpointer var);
static inline void _g_list_free__g_free0_ (GList* self);
static ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandCapabilityContext* proton_plus_widgets_games_mass_edit_view_resolve_launch_option_capabilities (ProtonPlusWidgetsGamesMassEditView* self);
static ProtonPlusModelsCompatibilityTool* proton_plus_widgets_games_mass_edit_view_resolve_effective_tool (ProtonPlusWidgetsGamesMassEditView* self,
                                                                                                    ProtonPlusWidgetsGamesGameRow* row,
                                                                                                    ProtonPlusModelsCompatibilityTool* selected);
static void proton_plus_widgets_games_mass_edit_view_finalize (GObject * obj);
static GType proton_plus_widgets_games_mass_edit_view_get_type_once (void);
static void _vala_proton_plus_widgets_games_mass_edit_view_get_property (GObject * object,
                                                                  guint property_id,
                                                                  GValue * value,
                                                                  GParamSpec * pspec);
static void _vala_proton_plus_widgets_games_mass_edit_view_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_games_mass_edit_view_get_instance_private (ProtonPlusWidgetsGamesMassEditView* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsGamesMassEditView_private_offset);
}

gchar*
proton_plus_widgets_games_mass_edit_view_get_selection_text (ProtonPlusWidgetsGamesMassEditView* self)
{
	gchar* _tmp0_ = NULL;
	ProtonPlusWidgetsGamesGameRow** _tmp1_;
	gint _tmp1__length1;
	gchar* _tmp5_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = self->rows;
	_tmp1__length1 = self->rows_length1;
	if (_tmp1__length1 == 1) {
		gchar* _tmp2_;
		_tmp2_ = g_strdup (_ ("1 game selected"));
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp2_;
	} else {
		ProtonPlusWidgetsGamesGameRow** _tmp3_;
		gint _tmp3__length1;
		gchar* _tmp4_;
		_tmp3_ = self->rows;
		_tmp3__length1 = self->rows_length1;
		_tmp4_ = g_strdup_printf (_ ("%u games selected"), (guint) _tmp3__length1);
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp4_;
	}
	_tmp5_ = _tmp0_;
	_tmp0_ = NULL;
	result = _tmp5_;
	_g_free0 (_tmp0_);
	return result;
}

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

static void
_proton_plus_widgets_games_mass_edit_view_clear_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                   gpointer self)
{
	proton_plus_widgets_games_mass_edit_view_clear_button_clicked ((ProtonPlusWidgetsGamesMassEditView*) self);
}

static void
_proton_plus_widgets_games_mass_edit_view_apply_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                   gpointer self)
{
	proton_plus_widgets_games_mass_edit_view_apply_button_clicked ((ProtonPlusWidgetsGamesMassEditView*) self);
}

static void
__lambda164_ (ProtonPlusWidgetsGamesMassEditView* self)
{
	ProtonPlusWidgetsGamesCompatibilityToolRow* _tmp0_;
	_tmp0_ = self->priv->_compatibility_tool_row;
	if (_tmp0_ != NULL) {
		ProtonPlusWidgetsGamesCompatibilityToolRow* _tmp1_;
		GtkSwitch* _tmp2_;
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp1_ = self->priv->_compatibility_tool_row;
		_tmp2_ = self->priv->_compatibility_tool_switch;
		_tmp3_ = gtk_switch_get_active (_tmp2_);
		_tmp4_ = _tmp3_;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp1_, _tmp4_);
	}
	proton_plus_widgets_games_mass_edit_view_refresh_capability_context (self);
	proton_plus_widgets_games_mass_edit_view_refresh (self);
}

static void
___lambda164__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda164_ ((ProtonPlusWidgetsGamesMassEditView*) self);
}

static void
_proton_plus_widgets_games_mass_edit_view_refresh_proton_plus_widgets_games_launch_options_editor_box_content_changed (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* _sender,
                                                                                                                       gpointer self)
{
	proton_plus_widgets_games_mass_edit_view_refresh ((ProtonPlusWidgetsGamesMassEditView*) self);
}

static void
__lambda165_ (ProtonPlusWidgetsGamesMassEditView* self)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorBox* _tmp0_;
	GtkSwitch* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	_tmp0_ = self->priv->_launch_options_editor;
	_tmp1_ = self->priv->_launch_options_switch;
	_tmp2_ = gtk_switch_get_active (_tmp1_);
	_tmp3_ = _tmp2_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp0_, _tmp3_);
	proton_plus_widgets_games_mass_edit_view_refresh (self);
}

static void
___lambda165__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda165_ ((ProtonPlusWidgetsGamesMassEditView*) self);
}

ProtonPlusWidgetsGamesMassEditView*
proton_plus_widgets_games_mass_edit_view_construct (GType object_type,
                                                    GtkMenuButton* selection_button)
{
	ProtonPlusWidgetsGamesMassEditView * self = NULL;
	GtkMenuButton* _tmp0_;
	GtkButton* _tmp1_;
	GtkButton* _tmp2_;
	GtkButton* _tmp3_;
	GtkButton* _tmp4_;
	GtkButton* _tmp5_;
	GtkButton* _tmp6_;
	GtkButton* _tmp7_;
	GtkButton* _tmp8_;
	AdwPreferencesGroup* _tmp9_;
	AdwPreferencesGroup* _tmp10_;
	AdwPreferencesGroup* _tmp11_;
	GtkSwitch* _tmp12_ = NULL;
	GtkSwitch* _tmp13_;
	AdwActionRow* compatibility_tool_header = NULL;
	gchar* _tmp14_;
	gchar* _tmp15_;
	GtkSwitch* _tmp16_;
	GtkWidget* _tmp17_;
	AdwActionRow* _tmp18_ = NULL;
	GtkSwitch* _tmp19_;
	AdwPreferencesGroup* _tmp20_;
	GtkSwitch* _tmp21_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorBox* _tmp22_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorBox* _tmp23_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCapabilityResolver* _tmp24_;
	GeeHashMap* _tmp25_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorBox* _tmp26_;
	AdwPreferencesGroup* _tmp27_;
	AdwPreferencesGroup* _tmp28_;
	GtkSwitch* _tmp29_ = NULL;
	GtkSwitch* _tmp30_;
	AdwActionRow* launch_options_header = NULL;
	gchar* _tmp31_;
	gchar* _tmp32_;
	GtkSwitch* _tmp33_;
	GtkWidget* _tmp34_;
	AdwActionRow* _tmp35_ = NULL;
	GtkSwitch* _tmp36_;
	AdwPreferencesGroup* _tmp37_;
	GtkSwitch* _tmp38_;
	gchar* _tmp39_;
	gchar** _tmp40_;
	GtkLabel* _tmp41_ = NULL;
	GtkLabel* _tmp42_;
	GtkBox* _tmp43_;
	GtkBox* _tmp44_;
	GtkBox* _tmp45_;
	GtkLabel* _tmp46_;
	GtkBox* _tmp47_;
	AdwPreferencesGroup* _tmp48_;
	GtkBox* _tmp49_;
	AdwPreferencesGroup* _tmp50_;
	GtkBox* _tmp51_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorBox* _tmp52_;
	AdwClamp* _tmp53_;
	AdwClamp* _tmp54_;
	AdwClamp* _tmp55_;
	AdwClamp* _tmp56_;
	AdwClamp* _tmp57_;
	AdwClamp* _tmp58_;
	AdwClamp* _tmp59_;
	AdwClamp* _tmp60_;
	GtkBox* _tmp61_;
	GtkScrolledWindow* _tmp62_;
	GtkScrolledWindow* _tmp63_;
	GtkScrolledWindow* _tmp64_;
	GtkScrolledWindow* _tmp65_;
	GtkScrolledWindow* _tmp66_;
	GtkScrolledWindow* _tmp67_;
	AdwClamp* _tmp68_;
	GtkWidget* _tmp69_;
	AdwHeaderBar* _tmp70_ = NULL;
	AdwHeaderBar* _tmp71_;
	GtkBox* action_buttons = NULL;
	GtkBox* _tmp72_;
	GtkButton* _tmp73_;
	GtkButton* _tmp74_;
	AdwHeaderBar* _tmp75_;
	AdwHeaderBar* _tmp76_;
	GtkScrolledWindow* _tmp77_;
	g_return_val_if_fail (selection_button != NULL, NULL);
	self = (ProtonPlusWidgetsGamesMassEditView*) g_object_new (object_type, NULL);
	gtk_orientable_set_orientation ((GtkOrientable*) self, GTK_ORIENTATION_VERTICAL);
	_tmp0_ = _g_object_ref0 (selection_button);
	_g_object_unref0 (self->priv->selection_button);
	self->priv->selection_button = _tmp0_;
	_tmp1_ = (GtkButton*) gtk_button_new_from_icon_name ("eraser-symbolic");
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->clear_button);
	self->priv->clear_button = _tmp1_;
	_tmp2_ = self->priv->clear_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp2_, "destructive-action");
	_tmp3_ = self->priv->clear_button;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp3_, _ ("Clear the current launch options"));
	_tmp4_ = self->priv->clear_button;
	g_signal_connect_object (_tmp4_, "clicked", (GCallback) _proton_plus_widgets_games_mass_edit_view_clear_button_clicked_gtk_button_clicked, self, 0);
	_tmp5_ = (GtkButton*) gtk_button_new_from_icon_name ("floppy-disk-symbolic");
	g_object_ref_sink (_tmp5_);
	_g_object_unref0 (self->priv->apply_button);
	self->priv->apply_button = _tmp5_;
	_tmp6_ = self->priv->apply_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp6_, "suggested-action");
	_tmp7_ = self->priv->apply_button;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp7_, _ ("Apply the current modification"));
	_tmp8_ = self->priv->apply_button;
	g_signal_connect_object (_tmp8_, "clicked", (GCallback) _proton_plus_widgets_games_mass_edit_view_apply_button_clicked_gtk_button_clicked, self, 0);
	_tmp9_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	g_object_ref_sink (_tmp9_);
	_tmp10_ = _tmp9_;
	proton_plus_widgets_games_mass_edit_view_set_compatibility_tool_group (self, _tmp10_);
	_g_object_unref0 (_tmp10_);
	_tmp11_ = self->priv->_compatibility_tool_group;
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp11_, 12);
	_tmp12_ = (GtkSwitch*) gtk_switch_new ();
	gtk_widget_set_valign ((GtkWidget*) _tmp12_, GTK_ALIGN_CENTER);
	g_object_ref_sink (_tmp12_);
	_tmp13_ = _tmp12_;
	proton_plus_widgets_games_mass_edit_view_set_compatibility_tool_switch (self, _tmp13_);
	_g_object_unref0 (_tmp13_);
	_tmp14_ = g_strdup (_ ("Apply compatibility tool"));
	_tmp15_ = g_strdup (_ ("Set the same tool for every selected game."));
	_tmp16_ = self->priv->_compatibility_tool_switch;
	_tmp17_ = _g_object_ref0 ((GtkWidget*) _tmp16_);
	_tmp18_ = (AdwActionRow*) adw_action_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp18_, _tmp14_);
	_g_free0 (_tmp14_);
	adw_action_row_set_subtitle (_tmp18_, _tmp15_);
	_g_free0 (_tmp15_);
	adw_action_row_set_activatable_widget (_tmp18_, _tmp17_);
	_g_object_unref0 (_tmp17_);
	g_object_ref_sink (_tmp18_);
	compatibility_tool_header = _tmp18_;
	_tmp19_ = self->priv->_compatibility_tool_switch;
	adw_action_row_add_suffix (compatibility_tool_header, (GtkWidget*) _tmp19_);
	_tmp20_ = self->priv->_compatibility_tool_group;
	adw_preferences_group_add (_tmp20_, (GtkWidget*) compatibility_tool_header);
	_tmp21_ = self->priv->_compatibility_tool_switch;
	g_signal_connect_object ((GObject*) _tmp21_, "notify::active", (GCallback) ___lambda164__g_object_notify, self, 0);
	_tmp22_ = proton_plus_widgets_games_launch_options_editor_box_new ();
	g_object_ref_sink (_tmp22_);
	_tmp23_ = _tmp22_;
	proton_plus_widgets_games_mass_edit_view_set_launch_options_editor (self, _tmp23_);
	_g_object_unref0 (_tmp23_);
	_tmp24_ = proton_plus_widgets_games_launch_options_editor_launch_option_capability_resolver_new (NULL);
	_g_object_unref0 (self->priv->capability_resolver);
	self->priv->capability_resolver = _tmp24_;
	_tmp25_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, PROTON_PLUS_MODELS_TYPE_COMPATIBILITY_TOOL, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->compatibility_tools_by_id);
	self->priv->compatibility_tools_by_id = _tmp25_;
	_tmp26_ = self->priv->_launch_options_editor;
	g_signal_connect_object (_tmp26_, "content-changed", (GCallback) _proton_plus_widgets_games_mass_edit_view_refresh_proton_plus_widgets_games_launch_options_editor_box_content_changed, self, 0);
	_tmp27_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	g_object_ref_sink (_tmp27_);
	_tmp28_ = _tmp27_;
	proton_plus_widgets_games_mass_edit_view_set_launch_options_group (self, _tmp28_);
	_g_object_unref0 (_tmp28_);
	_tmp29_ = (GtkSwitch*) gtk_switch_new ();
	gtk_widget_set_valign ((GtkWidget*) _tmp29_, GTK_ALIGN_CENTER);
	g_object_ref_sink (_tmp29_);
	_tmp30_ = _tmp29_;
	proton_plus_widgets_games_mass_edit_view_set_launch_options_switch (self, _tmp30_);
	_g_object_unref0 (_tmp30_);
	_tmp31_ = g_strdup (_ ("Apply launch options"));
	_tmp32_ = g_strdup (_ ("Set the same options for every selected Steam game."));
	_tmp33_ = self->priv->_launch_options_switch;
	_tmp34_ = _g_object_ref0 ((GtkWidget*) _tmp33_);
	_tmp35_ = (AdwActionRow*) adw_action_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp35_, _tmp31_);
	_g_free0 (_tmp31_);
	adw_action_row_set_subtitle (_tmp35_, _tmp32_);
	_g_free0 (_tmp32_);
	adw_action_row_set_activatable_widget (_tmp35_, _tmp34_);
	_g_object_unref0 (_tmp34_);
	g_object_ref_sink (_tmp35_);
	launch_options_header = _tmp35_;
	_tmp36_ = self->priv->_launch_options_switch;
	adw_action_row_add_suffix (launch_options_header, (GtkWidget*) _tmp36_);
	_tmp37_ = self->priv->_launch_options_group;
	adw_preferences_group_add (_tmp37_, (GtkWidget*) launch_options_header);
	_tmp38_ = self->priv->_launch_options_switch;
	g_signal_connect_object ((GObject*) _tmp38_, "notify::active", (GCallback) ___lambda165__g_object_notify, self, 0);
	_tmp39_ = g_strdup ("dim-label");
	_tmp40_ = g_new0 (gchar*, 1 + 1);
	_tmp40_[0] = _tmp39_;
	_tmp41_ = (GtkLabel*) gtk_label_new (_ ("Enable the sections you want to change. Disabled sections leave the se" \
"lected games unchanged."));
	gtk_widget_set_halign ((GtkWidget*) _tmp41_, GTK_ALIGN_START);
	gtk_label_set_wrap (_tmp41_, TRUE);
	gtk_label_set_xalign (_tmp41_, (gfloat) 0);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp41_, _tmp40_);
	_tmp40_ = (_vala_array_free (_tmp40_, 1, (GDestroyNotify) g_free), NULL);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp41_, 6);
	g_object_ref_sink (_tmp41_);
	_tmp42_ = _tmp41_;
	proton_plus_widgets_games_mass_edit_view_set_batch_hint (self, _tmp42_);
	_g_object_unref0 (_tmp42_);
	_tmp43_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
	g_object_ref_sink (_tmp43_);
	_tmp44_ = _tmp43_;
	proton_plus_widgets_games_mass_edit_view_set_content_box (self, _tmp44_);
	_g_object_unref0 (_tmp44_);
	_tmp45_ = self->priv->_content_box;
	_tmp46_ = self->priv->_batch_hint;
	gtk_box_append (_tmp45_, (GtkWidget*) _tmp46_);
	_tmp47_ = self->priv->_content_box;
	_tmp48_ = self->priv->_compatibility_tool_group;
	gtk_box_append (_tmp47_, (GtkWidget*) _tmp48_);
	_tmp49_ = self->priv->_content_box;
	_tmp50_ = self->priv->_launch_options_group;
	gtk_box_append (_tmp49_, (GtkWidget*) _tmp50_);
	_tmp51_ = self->priv->_content_box;
	_tmp52_ = self->priv->_launch_options_editor;
	gtk_box_append (_tmp51_, (GtkWidget*) _tmp52_);
	_tmp53_ = (AdwClamp*) adw_clamp_new ();
	g_object_ref_sink (_tmp53_);
	_tmp54_ = _tmp53_;
	proton_plus_widgets_games_mass_edit_view_set_content_clamp (self, _tmp54_);
	_g_object_unref0 (_tmp54_);
	_tmp55_ = self->priv->_content_clamp;
	adw_clamp_set_maximum_size (_tmp55_, 975);
	_tmp56_ = self->priv->_content_clamp;
	gtk_widget_set_margin_top ((GtkWidget*) _tmp56_, 12);
	_tmp57_ = self->priv->_content_clamp;
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp57_, 12);
	_tmp58_ = self->priv->_content_clamp;
	gtk_widget_set_margin_start ((GtkWidget*) _tmp58_, 12);
	_tmp59_ = self->priv->_content_clamp;
	gtk_widget_set_margin_end ((GtkWidget*) _tmp59_, 12);
	_tmp60_ = self->priv->_content_clamp;
	_tmp61_ = self->priv->_content_box;
	adw_clamp_set_child (_tmp60_, (GtkWidget*) _tmp61_);
	_tmp62_ = (GtkScrolledWindow*) gtk_scrolled_window_new ();
	g_object_ref_sink (_tmp62_);
	_tmp63_ = _tmp62_;
	proton_plus_widgets_games_mass_edit_view_set_scrolled_window (self, _tmp63_);
	_g_object_unref0 (_tmp63_);
	_tmp64_ = self->priv->_scrolled_window;
	gtk_scrolled_window_set_policy (_tmp64_, GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
	_tmp65_ = self->priv->_scrolled_window;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp65_, TRUE);
	_tmp66_ = self->priv->_scrolled_window;
	gtk_widget_set_vexpand ((GtkWidget*) _tmp66_, TRUE);
	_tmp67_ = self->priv->_scrolled_window;
	_tmp68_ = self->priv->_content_clamp;
	gtk_scrolled_window_set_child (_tmp67_, (GtkWidget*) _tmp68_);
	_tmp69_ = _g_object_ref0 ((GtkWidget*) selection_button);
	_tmp70_ = (AdwHeaderBar*) adw_header_bar_new ();
	adw_header_bar_set_show_start_title_buttons (_tmp70_, FALSE);
	adw_header_bar_set_show_end_title_buttons (_tmp70_, FALSE);
	adw_header_bar_set_show_title (_tmp70_, TRUE);
	adw_header_bar_set_title_widget (_tmp70_, _tmp69_);
	_g_object_unref0 (_tmp69_);
	g_object_ref_sink (_tmp70_);
	_tmp71_ = _tmp70_;
	proton_plus_widgets_games_mass_edit_view_set_header_bar (self, _tmp71_);
	_g_object_unref0 (_tmp71_);
	_tmp72_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
	g_object_ref_sink (_tmp72_);
	action_buttons = _tmp72_;
	_tmp73_ = self->priv->clear_button;
	gtk_box_append (action_buttons, (GtkWidget*) _tmp73_);
	_tmp74_ = self->priv->apply_button;
	gtk_box_append (action_buttons, (GtkWidget*) _tmp74_);
	_tmp75_ = self->priv->_header_bar;
	adw_header_bar_pack_end (_tmp75_, (GtkWidget*) action_buttons);
	_tmp76_ = self->priv->_header_bar;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp76_);
	_tmp77_ = self->priv->_scrolled_window;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp77_);
	_g_object_unref0 (action_buttons);
	_g_object_unref0 (launch_options_header);
	_g_object_unref0 (compatibility_tool_header);
	return self;
}

ProtonPlusWidgetsGamesMassEditView*
proton_plus_widgets_games_mass_edit_view_new (GtkMenuButton* selection_button)
{
	return proton_plus_widgets_games_mass_edit_view_construct (PROTON_PLUS_WIDGETS_GAMES_TYPE_MASS_EDIT_VIEW, selection_button);
}

GtkWidget*
proton_plus_widgets_games_mass_edit_view_get_controller_initial_focus (ProtonPlusWidgetsGamesMassEditView* self)
{
	GtkMenuButton* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->selection_button;
	_tmp1_ = _g_object_ref0 ((GtkWidget*) _tmp0_);
	result = _tmp1_;
	return result;
}

static ProtonPlusWidgetsGamesGameRow**
_vala_array_dup1 (ProtonPlusWidgetsGamesGameRow** self,
                  gssize length)
{
	if (length >= 0) {
		ProtonPlusWidgetsGamesGameRow** result;
		gssize i;
		result = g_new0 (ProtonPlusWidgetsGamesGameRow*, length + 1);
		for (i = 0; i < length; i++) {
			ProtonPlusWidgetsGamesGameRow* _tmp0_;
			_tmp0_ = _g_object_ref0 (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static gint
__lambda166_ (ProtonPlusWidgetsGamesMassEditView* self,
              ProtonPlusModelsCompatibilityTool* a,
              ProtonPlusModelsCompatibilityTool* b)
{
	gboolean a_is_default = FALSE;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gboolean b_is_default = FALSE;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	GCompareFunc _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	const gchar* _tmp10_;
	const gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gint _tmp14_;
	gint result;
	g_return_val_if_fail (a != NULL, -1);
	g_return_val_if_fail (b != NULL, -1);
	_tmp0_ = proton_plus_models_compatibility_tool_get_internal_title (a);
	_tmp1_ = _tmp0_;
	a_is_default = g_strcmp0 (_tmp1_, "Default") == 0;
	_tmp2_ = proton_plus_models_compatibility_tool_get_internal_title (b);
	_tmp3_ = _tmp2_;
	b_is_default = g_strcmp0 (_tmp3_, "Default") == 0;
	if (a_is_default != b_is_default) {
		gint _tmp4_ = 0;
		if (a_is_default) {
			_tmp4_ = -1;
		} else {
			_tmp4_ = 1;
		}
		result = _tmp4_;
		return result;
	}
	_tmp5_ = ((GCompareFunc) g_strcmp0);
	_tmp6_ = proton_plus_models_compatibility_tool_get_display_title (b);
	_tmp7_ = _tmp6_;
	_tmp8_ = g_utf8_collate_key_for_filename (_tmp7_, (gssize) -1);
	_tmp9_ = _tmp8_;
	_tmp10_ = proton_plus_models_compatibility_tool_get_display_title (a);
	_tmp11_ = _tmp10_;
	_tmp12_ = g_utf8_collate_key_for_filename (_tmp11_, (gssize) -1);
	_tmp13_ = _tmp12_;
	_tmp14_ = _tmp5_ (_tmp9_, _tmp13_);
	_g_free0 (_tmp13_);
	_g_free0 (_tmp9_);
	result = _tmp14_;
	return result;
}

static gint
___lambda166__gcompare_data_func (gconstpointer a,
                                  gconstpointer b,
                                  gpointer self)
{
	gint result;
	result = __lambda166_ ((ProtonPlusWidgetsGamesMassEditView*) self, (ProtonPlusModelsCompatibilityTool*) a, (ProtonPlusModelsCompatibilityTool*) b);
	return result;
}

static void
_vala_array_add2 (gchar** * array,
                  gint* length,
                  gint* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add3 (gchar** * array,
                  gint* length,
                  gint* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
__lambda167_ (ProtonPlusWidgetsGamesMassEditView* self)
{
	proton_plus_widgets_games_mass_edit_view_refresh_capability_context (self);
	proton_plus_widgets_games_mass_edit_view_refresh (self);
}

static void
___lambda167__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda167_ ((ProtonPlusWidgetsGamesMassEditView*) self);
}

static void
__lambda168_ (ProtonPlusWidgetsGamesMassEditView* self,
              GObject* obj,
              GAsyncResult* _result_)
{
	g_return_if_fail (_result_ != NULL);
	self->priv->gpu_vendor = proton_plus_utils_system_detect_gpu_vendor_finish (_result_);
	proton_plus_widgets_games_mass_edit_view_refresh_capability_context (self);
}

static void
___lambda168__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	__lambda168_ ((ProtonPlusWidgetsGamesMassEditView*) self, source_object, res);
	g_object_unref (self);
}

void
proton_plus_widgets_games_mass_edit_view_load (ProtonPlusWidgetsGamesMassEditView* self,
                                               ProtonPlusWidgetsGamesGameRow** rows,
                                               gint rows_length1,
                                               GListStore* model,
                                               GtkPropertyExpression* expression)
{
	ProtonPlusWidgetsGamesGameRow** _tmp0_;
	gint _tmp0__length1;
	gboolean has_steam_launch_options = FALSE;
	gboolean all_native = FALSE;
	gboolean all_steam_linux_runtime_compatible = FALSE;
	ProtonPlusWidgetsGamesCompatibilityToolRow* _tmp15_;
	GeeArrayList* compatibility_tools = NULL;
	GeeArrayList* _tmp18_;
	GeeHashMap* _tmp19_;
	guint n_items = 0U;
	GeeArrayList* _tmp44_;
	GListStore* filtered_model = NULL;
	GListStore* _tmp45_;
	GListStore* _tmp61_;
	ProtonPlusWidgetsGamesCompatibilityToolRow* _tmp62_;
	ProtonPlusWidgetsGamesCompatibilityToolRow* _tmp63_;
	AdwPreferencesGroup* _tmp64_;
	ProtonPlusWidgetsGamesCompatibilityToolRow* _tmp65_;
	gchar** preview_labels = NULL;
	gchar** _tmp85_;
	gint preview_labels_length1;
	gint _preview_labels_size_;
	gchar** preview_sources = NULL;
	gchar** _tmp86_;
	gint preview_sources_length1;
	gint _preview_sources_size_;
	gchar* common_source = NULL;
	gchar* _tmp87_;
	gboolean sources_match = FALSE;
	const gchar* _tmp110_ = NULL;
	ProtonPlusWidgetsGamesLaunchOptionsEditorBox* _tmp112_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorBox* _tmp113_;
	gchar** _tmp114_;
	gint _tmp114__length1;
	gchar** _tmp115_;
	gint _tmp115__length1;
	AdwPreferencesGroup* _tmp116_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorBox* _tmp117_;
	GtkSwitch* _tmp118_;
	GtkSwitch* _tmp119_;
	ProtonPlusWidgetsGamesCompatibilityToolRow* _tmp120_;
	GtkSwitch* _tmp121_;
	gboolean _tmp122_;
	gboolean _tmp123_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorBox* _tmp124_;
	GtkSwitch* _tmp125_;
	gboolean _tmp126_;
	gboolean _tmp127_;
	ProtonPlusWidgetsGamesCompatibilityToolRow* _tmp128_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (model != NULL);
	g_return_if_fail (expression != NULL);
	_tmp0_ = (rows != NULL) ? _vala_array_dup1 (rows, rows_length1) : rows;
	_tmp0__length1 = rows_length1;
	self->rows = (_vala_array_free (self->rows, self->rows_length1, (GDestroyNotify) g_object_unref), NULL);
	self->rows = _tmp0_;
	self->rows_length1 = _tmp0__length1;
	has_steam_launch_options = FALSE;
	all_native = rows_length1 > 0;
	all_steam_linux_runtime_compatible = rows_length1 > 0;
	{
		ProtonPlusWidgetsGamesGameRow** row_collection = NULL;
		gint row_collection_length1 = 0;
		gint _row_collection_size_ = 0;
		gint row_it = 0;
		row_collection = rows;
		row_collection_length1 = rows_length1;
		for (row_it = 0; row_it < row_collection_length1; row_it = row_it + 1) {
			ProtonPlusWidgetsGamesGameRow* _tmp1_;
			ProtonPlusWidgetsGamesGameRow* row = NULL;
			_tmp1_ = _g_object_ref0 (row_collection[row_it]);
			row = _tmp1_;
			{
				ProtonPlusWidgetsGamesGameRow* _tmp2_;
				ProtonPlusModelsGame* _tmp3_;
				ProtonPlusModelsGame* _tmp4_;
				ProtonPlusModelsLauncher* _tmp5_;
				ProtonPlusModelsLauncher* _tmp6_;
				ProtonPlusWidgetsGamesGameRow* _tmp7_;
				ProtonPlusModelsGame* _tmp8_;
				ProtonPlusModelsGame* _tmp9_;
				gboolean _tmp10_;
				gboolean _tmp11_;
				ProtonPlusWidgetsGamesGameRow* _tmp12_;
				ProtonPlusModelsGame* _tmp13_;
				ProtonPlusModelsGame* _tmp14_;
				_tmp2_ = row;
				_tmp3_ = proton_plus_widgets_games_game_row_get_game (_tmp2_);
				_tmp4_ = _tmp3_;
				_tmp5_ = proton_plus_models_game_get_launcher (_tmp4_);
				_tmp6_ = _tmp5_;
				if (PROTON_PLUS_MODELS_LAUNCHERS_IS_STEAM (_tmp6_)) {
					has_steam_launch_options = TRUE;
				}
				_tmp7_ = row;
				_tmp8_ = proton_plus_widgets_games_game_row_get_game (_tmp7_);
				_tmp9_ = _tmp8_;
				_tmp10_ = proton_plus_models_game_get_is_native (_tmp9_);
				_tmp11_ = _tmp10_;
				if (!_tmp11_) {
					all_native = FALSE;
				}
				_tmp12_ = row;
				_tmp13_ = proton_plus_widgets_games_game_row_get_game (_tmp12_);
				_tmp14_ = _tmp13_;
				if (!proton_plus_models_launchers_steam_is_game_steam_linux_runtime_compatible (_tmp14_)) {
					all_steam_linux_runtime_compatible = FALSE;
				}
				_g_object_unref0 (row);
			}
		}
	}
	_tmp15_ = self->priv->_compatibility_tool_row;
	if (_tmp15_ != NULL) {
		AdwPreferencesGroup* _tmp16_;
		ProtonPlusWidgetsGamesCompatibilityToolRow* _tmp17_;
		_tmp16_ = self->priv->_compatibility_tool_group;
		_tmp17_ = self->priv->_compatibility_tool_row;
		adw_preferences_group_remove (_tmp16_, (GtkWidget*) _tmp17_);
	}
	_tmp18_ = gee_array_list_new (PROTON_PLUS_MODELS_TYPE_COMPATIBILITY_TOOL, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	compatibility_tools = _tmp18_;
	_tmp19_ = self->priv->compatibility_tools_by_id;
	gee_abstract_map_clear ((GeeAbstractMap*) _tmp19_);
	n_items = g_list_model_get_n_items ((GListModel*) model);
	{
		guint i = 0U;
		i = (guint) 0;
		{
			gboolean _tmp20_ = FALSE;
			_tmp20_ = TRUE;
			while (TRUE) {
				ProtonPlusModelsCompatibilityTool* runner = NULL;
				GObject* _tmp22_;
				ProtonPlusModelsCompatibilityTool* _tmp23_;
				ProtonPlusModelsCompatibilityTool* _tmp24_;
				gboolean _tmp25_ = FALSE;
				ProtonPlusModelsCompatibilityTool* _tmp26_;
				const gchar* _tmp27_;
				const gchar* _tmp28_;
				ProtonPlusModelsCompatibilityTool* _tmp29_;
				const gchar* _tmp30_;
				const gchar* _tmp31_;
				gboolean _tmp32_ = FALSE;
				if (!_tmp20_) {
					guint _tmp21_;
					_tmp21_ = i;
					i = _tmp21_ + 1;
				}
				_tmp20_ = FALSE;
				if (!(i < n_items)) {
					break;
				}
				_tmp22_ = g_list_model_get_item ((GListModel*) model, i);
				_tmp23_ = PROTON_PLUS_MODELS_IS_COMPATIBILITY_TOOL (_tmp22_) ? ((ProtonPlusModelsCompatibilityTool*) _tmp22_) : NULL;
				if (_tmp23_ == NULL) {
					_g_object_unref0 (_tmp22_);
				}
				runner = _tmp23_;
				_tmp24_ = runner;
				if (_tmp24_ == NULL) {
					_g_object_unref0 (runner);
					continue;
				}
				_tmp26_ = runner;
				_tmp27_ = proton_plus_models_compatibility_tool_get_display_title (_tmp26_);
				_tmp28_ = _tmp27_;
				_tmp29_ = runner;
				_tmp30_ = proton_plus_models_compatibility_tool_get_internal_title (_tmp29_);
				_tmp31_ = _tmp30_;
				if (proton_plus_models_launchers_steam_is_steam_linux_runtime (_tmp28_, _tmp31_)) {
					_tmp25_ = !all_steam_linux_runtime_compatible;
				} else {
					_tmp25_ = FALSE;
				}
				if (_tmp25_) {
					_g_object_unref0 (runner);
					continue;
				}
				if (all_native) {
					ProtonPlusModelsCompatibilityTool* _tmp33_;
					const gchar* _tmp34_;
					const gchar* _tmp35_;
					_tmp33_ = runner;
					_tmp34_ = proton_plus_models_compatibility_tool_get_internal_title (_tmp33_);
					_tmp35_ = _tmp34_;
					_tmp32_ = g_strcmp0 (_tmp35_, "Default") == 0;
				} else {
					_tmp32_ = FALSE;
				}
				if (_tmp32_) {
					GeeArrayList* _tmp36_;
					ProtonPlusModelsCompatibilityTool* _tmp37_;
					const gchar* _tmp38_;
					const gchar* _tmp39_;
					ProtonPlusModelsCompatibilityTool* _tmp40_;
					ProtonPlusModelsCompatibilityTool* _tmp41_;
					_tmp36_ = compatibility_tools;
					_tmp37_ = runner;
					_tmp38_ = proton_plus_models_compatibility_tool_get_internal_title (_tmp37_);
					_tmp39_ = _tmp38_;
					_tmp40_ = proton_plus_models_compatibility_tool_new (_ ("Native"), _tmp39_, "", PROTON_PLUS_MODELS_COMPATIBILITY_TOOL_RUNTIME_KIND_NATIVE, "", FALSE);
					_tmp41_ = _tmp40_;
					gee_abstract_collection_add ((GeeAbstractCollection*) _tmp36_, _tmp41_);
					_g_object_unref0 (_tmp41_);
				} else {
					GeeArrayList* _tmp42_;
					ProtonPlusModelsCompatibilityTool* _tmp43_;
					_tmp42_ = compatibility_tools;
					_tmp43_ = runner;
					gee_abstract_collection_add ((GeeAbstractCollection*) _tmp42_, _tmp43_);
				}
				_g_object_unref0 (runner);
			}
		}
	}
	_tmp44_ = compatibility_tools;
	gee_list_sort ((GeeList*) _tmp44_, ___lambda166__gcompare_data_func, g_object_ref (self), g_object_unref);
	_tmp45_ = g_list_store_new (PROTON_PLUS_MODELS_TYPE_COMPATIBILITY_TOOL);
	filtered_model = _tmp45_;
	{
		GeeArrayList* _compatibility_tool_list = NULL;
		GeeArrayList* _tmp46_;
		gint _compatibility_tool_size = 0;
		GeeArrayList* _tmp47_;
		gint _tmp48_;
		gint _tmp49_;
		gint _compatibility_tool_index = 0;
		_tmp46_ = compatibility_tools;
		_compatibility_tool_list = _tmp46_;
		_tmp47_ = _compatibility_tool_list;
		_tmp48_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp47_);
		_tmp49_ = _tmp48_;
		_compatibility_tool_size = _tmp49_;
		_compatibility_tool_index = -1;
		while (TRUE) {
			gint _tmp50_;
			gint _tmp51_;
			ProtonPlusModelsCompatibilityTool* compatibility_tool = NULL;
			GeeArrayList* _tmp52_;
			gpointer _tmp53_;
			GListStore* _tmp54_;
			ProtonPlusModelsCompatibilityTool* _tmp55_;
			GeeHashMap* _tmp56_;
			ProtonPlusModelsCompatibilityTool* _tmp57_;
			const gchar* _tmp58_;
			const gchar* _tmp59_;
			ProtonPlusModelsCompatibilityTool* _tmp60_;
			_compatibility_tool_index = _compatibility_tool_index + 1;
			_tmp50_ = _compatibility_tool_index;
			_tmp51_ = _compatibility_tool_size;
			if (!(_tmp50_ < _tmp51_)) {
				break;
			}
			_tmp52_ = _compatibility_tool_list;
			_tmp53_ = gee_abstract_list_get ((GeeAbstractList*) _tmp52_, _compatibility_tool_index);
			compatibility_tool = (ProtonPlusModelsCompatibilityTool*) _tmp53_;
			_tmp54_ = filtered_model;
			_tmp55_ = compatibility_tool;
			g_list_store_append (_tmp54_, (GObject*) _tmp55_);
			_tmp56_ = self->priv->compatibility_tools_by_id;
			_tmp57_ = compatibility_tool;
			_tmp58_ = proton_plus_models_compatibility_tool_get_internal_title (_tmp57_);
			_tmp59_ = _tmp58_;
			_tmp60_ = compatibility_tool;
			gee_abstract_map_set ((GeeAbstractMap*) _tmp56_, _tmp59_, _tmp60_);
			_g_object_unref0 (compatibility_tool);
		}
	}
	_tmp61_ = filtered_model;
	_tmp62_ = proton_plus_widgets_games_compatibility_tool_row_new (_tmp61_, expression);
	g_object_ref_sink (_tmp62_);
	_tmp63_ = _tmp62_;
	proton_plus_widgets_games_mass_edit_view_set_compatibility_tool_row (self, _tmp63_);
	_g_object_unref0 (_tmp63_);
	_tmp64_ = self->priv->_compatibility_tool_group;
	_tmp65_ = self->priv->_compatibility_tool_row;
	adw_preferences_group_add (_tmp64_, (GtkWidget*) _tmp65_);
	if (rows_length1 == 1) {
		ProtonPlusModelsGame* game = NULL;
		ProtonPlusWidgetsGamesGameRow* _tmp66_;
		ProtonPlusModelsGame* _tmp67_;
		ProtonPlusModelsGame* _tmp68_;
		ProtonPlusModelsGame* _tmp69_;
		guint filtered_n_items = 0U;
		GListStore* _tmp70_;
		_tmp66_ = rows[0];
		_tmp67_ = proton_plus_widgets_games_game_row_get_game (_tmp66_);
		_tmp68_ = _tmp67_;
		_tmp69_ = _g_object_ref0 (_tmp68_);
		game = _tmp69_;
		_tmp70_ = filtered_model;
		filtered_n_items = g_list_model_get_n_items ((GListModel*) _tmp70_);
		{
			guint i = 0U;
			i = (guint) 0;
			{
				gboolean _tmp71_ = FALSE;
				_tmp71_ = TRUE;
				while (TRUE) {
					ProtonPlusModelsCompatibilityTool* runner = NULL;
					GListStore* _tmp73_;
					GObject* _tmp74_;
					ProtonPlusModelsCompatibilityTool* _tmp75_;
					gboolean _tmp76_ = FALSE;
					ProtonPlusModelsCompatibilityTool* _tmp77_;
					if (!_tmp71_) {
						guint _tmp72_;
						_tmp72_ = i;
						i = _tmp72_ + 1;
					}
					_tmp71_ = FALSE;
					if (!(i < filtered_n_items)) {
						break;
					}
					_tmp73_ = filtered_model;
					_tmp74_ = g_list_model_get_item ((GListModel*) _tmp73_, i);
					_tmp75_ = PROTON_PLUS_MODELS_IS_COMPATIBILITY_TOOL (_tmp74_) ? ((ProtonPlusModelsCompatibilityTool*) _tmp74_) : NULL;
					if (_tmp75_ == NULL) {
						_g_object_unref0 (_tmp74_);
					}
					runner = _tmp75_;
					_tmp77_ = runner;
					if (_tmp77_ != NULL) {
						ProtonPlusModelsCompatibilityTool* _tmp78_;
						const gchar* _tmp79_;
						const gchar* _tmp80_;
						ProtonPlusModelsGame* _tmp81_;
						const gchar* _tmp82_;
						const gchar* _tmp83_;
						_tmp78_ = runner;
						_tmp79_ = proton_plus_models_compatibility_tool_get_internal_title (_tmp78_);
						_tmp80_ = _tmp79_;
						_tmp81_ = game;
						_tmp82_ = proton_plus_models_game_get_compatibility_tool (_tmp81_);
						_tmp83_ = _tmp82_;
						_tmp76_ = g_strcmp0 (_tmp80_, _tmp83_) == 0;
					} else {
						_tmp76_ = FALSE;
					}
					if (_tmp76_) {
						ProtonPlusWidgetsGamesCompatibilityToolRow* _tmp84_;
						_tmp84_ = self->priv->_compatibility_tool_row;
						adw_combo_row_set_selected ((AdwComboRow*) _tmp84_, i);
						_g_object_unref0 (runner);
						break;
					}
					_g_object_unref0 (runner);
				}
			}
		}
		_g_object_unref0 (game);
	}
	_tmp85_ = g_new0 (gchar*, 0 + 1);
	preview_labels = _tmp85_;
	preview_labels_length1 = 0;
	_preview_labels_size_ = preview_labels_length1;
	_tmp86_ = g_new0 (gchar*, 0 + 1);
	preview_sources = _tmp86_;
	preview_sources_length1 = 0;
	_preview_sources_size_ = preview_sources_length1;
	_tmp87_ = g_strdup ("");
	common_source = _tmp87_;
	sources_match = TRUE;
	{
		ProtonPlusWidgetsGamesGameRow** row_collection = NULL;
		gint row_collection_length1 = 0;
		gint _row_collection_size_ = 0;
		gint row_it = 0;
		row_collection = rows;
		row_collection_length1 = rows_length1;
		for (row_it = 0; row_it < row_collection_length1; row_it = row_it + 1) {
			ProtonPlusWidgetsGamesGameRow* _tmp88_;
			ProtonPlusWidgetsGamesGameRow* row = NULL;
			_tmp88_ = _g_object_ref0 (row_collection[row_it]);
			row = _tmp88_;
			{
				ProtonPlusModelsGamesSteam* steam_game = NULL;
				ProtonPlusWidgetsGamesGameRow* _tmp89_;
				ProtonPlusModelsGame* _tmp90_;
				ProtonPlusModelsGame* _tmp91_;
				ProtonPlusModelsGamesSteam* _tmp92_;
				ProtonPlusModelsGamesSteam* _tmp93_;
				const gchar* _tmp94_ = NULL;
				ProtonPlusModelsGamesSteam* _tmp95_;
				const gchar* _tmp96_;
				const gchar* _tmp97_;
				gchar* source = NULL;
				gchar* _tmp98_;
				ProtonPlusModelsGamesSteam* _tmp99_;
				const gchar* _tmp100_;
				const gchar* _tmp101_;
				gchar* _tmp102_;
				const gchar* _tmp103_;
				gchar* _tmp104_;
				gchar** _tmp105_;
				gint _tmp105__length1;
				_tmp89_ = row;
				_tmp90_ = proton_plus_widgets_games_game_row_get_game (_tmp89_);
				_tmp91_ = _tmp90_;
				_tmp92_ = _g_object_ref0 (PROTON_PLUS_MODELS_GAMES_IS_STEAM (_tmp91_) ? ((ProtonPlusModelsGamesSteam*) _tmp91_) : NULL);
				steam_game = _tmp92_;
				_tmp93_ = steam_game;
				if (_tmp93_ == NULL) {
					_g_object_unref0 (steam_game);
					_g_object_unref0 (row);
					continue;
				}
				_tmp95_ = steam_game;
				_tmp96_ = proton_plus_models_games_steam_get_launch_options (_tmp95_);
				_tmp97_ = _tmp96_;
				_tmp94_ = _tmp97_;
				if (_tmp94_ == NULL) {
					_tmp94_ = "";
				}
				_tmp98_ = g_strdup (_tmp94_);
				source = _tmp98_;
				_tmp99_ = steam_game;
				_tmp100_ = proton_plus_models_game_get_name ((ProtonPlusModelsGame*) _tmp99_);
				_tmp101_ = _tmp100_;
				_tmp102_ = g_strdup (_tmp101_);
				_vala_array_add2 (&preview_labels, &preview_labels_length1, &_preview_labels_size_, _tmp102_);
				_tmp103_ = source;
				_tmp104_ = g_strdup (_tmp103_);
				_vala_array_add3 (&preview_sources, &preview_sources_length1, &_preview_sources_size_, _tmp104_);
				_tmp105_ = preview_sources;
				_tmp105__length1 = preview_sources_length1;
				if (_tmp105__length1 == 1) {
					const gchar* _tmp106_;
					gchar* _tmp107_;
					_tmp106_ = source;
					_tmp107_ = g_strdup (_tmp106_);
					_g_free0 (common_source);
					common_source = _tmp107_;
				} else {
					const gchar* _tmp108_;
					const gchar* _tmp109_;
					_tmp108_ = source;
					_tmp109_ = common_source;
					if (g_strcmp0 (_tmp108_, _tmp109_) != 0) {
						sources_match = FALSE;
					}
				}
				_g_free0 (source);
				_g_object_unref0 (steam_game);
				_g_object_unref0 (row);
			}
		}
	}
	if (sources_match) {
		const gchar* _tmp111_;
		_tmp111_ = common_source;
		_tmp110_ = _tmp111_;
	} else {
		_tmp110_ = "";
	}
	_tmp112_ = self->priv->_launch_options_editor;
	proton_plus_widgets_games_launch_options_editor_box_set_text (_tmp112_, _tmp110_);
	_tmp113_ = self->priv->_launch_options_editor;
	_tmp114_ = preview_labels;
	_tmp114__length1 = preview_labels_length1;
	_tmp115_ = preview_sources;
	_tmp115__length1 = preview_sources_length1;
	proton_plus_widgets_games_launch_options_editor_box_set_preview_sources (_tmp113_, _tmp114_, (gint) _tmp114__length1, _tmp115_, (gint) _tmp115__length1);
	_tmp116_ = self->priv->_launch_options_group;
	gtk_widget_set_visible ((GtkWidget*) _tmp116_, has_steam_launch_options);
	_tmp117_ = self->priv->_launch_options_editor;
	gtk_widget_set_visible ((GtkWidget*) _tmp117_, has_steam_launch_options);
	_tmp118_ = self->priv->_compatibility_tool_switch;
	gtk_switch_set_active (_tmp118_, FALSE);
	_tmp119_ = self->priv->_launch_options_switch;
	gtk_switch_set_active (_tmp119_, FALSE);
	_tmp120_ = self->priv->_compatibility_tool_row;
	_tmp121_ = self->priv->_compatibility_tool_switch;
	_tmp122_ = gtk_switch_get_active (_tmp121_);
	_tmp123_ = _tmp122_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp120_, _tmp123_);
	_tmp124_ = self->priv->_launch_options_editor;
	_tmp125_ = self->priv->_launch_options_switch;
	_tmp126_ = gtk_switch_get_active (_tmp125_);
	_tmp127_ = _tmp126_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp124_, _tmp127_);
	_tmp128_ = self->priv->_compatibility_tool_row;
	g_signal_connect_object ((GObject*) _tmp128_, "notify::selected-item", (GCallback) ___lambda167__g_object_notify, self, 0);
	proton_plus_utils_system_detect_gpu_vendor (___lambda168__gasync_ready_callback, g_object_ref (self));
	proton_plus_widgets_games_mass_edit_view_refresh_capability_context (self);
	proton_plus_widgets_games_mass_edit_view_refresh (self);
	_g_free0 (common_source);
	preview_sources = (_vala_array_free (preview_sources, preview_sources_length1, (GDestroyNotify) g_free), NULL);
	preview_labels = (_vala_array_free (preview_labels, preview_labels_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (filtered_model);
	_g_object_unref0 (compatibility_tools);
}

static void
proton_plus_widgets_games_mass_edit_view_refresh (ProtonPlusWidgetsGamesMassEditView* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GtkSwitch* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	gboolean tool_changed = FALSE;
	gboolean _tmp8_ = FALSE;
	GtkSwitch* _tmp9_;
	gboolean _tmp10_;
	gboolean _tmp11_;
	gboolean launch_options_changed = FALSE;
	GtkButton* _tmp15_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorBox* _tmp16_;
	gboolean _tmp17_;
	gboolean _tmp18_;
	gboolean _tmp19_ = FALSE;
	GtkButton* _tmp20_;
	g_return_if_fail (self != NULL);
	_tmp2_ = self->priv->_compatibility_tool_switch;
	_tmp3_ = gtk_switch_get_active (_tmp2_);
	_tmp4_ = _tmp3_;
	if (_tmp4_) {
		ProtonPlusWidgetsGamesCompatibilityToolRow* _tmp5_;
		_tmp5_ = self->priv->_compatibility_tool_row;
		_tmp1_ = _tmp5_ != NULL;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		ProtonPlusWidgetsGamesCompatibilityToolRow* _tmp6_;
		GObject* _tmp7_;
		_tmp6_ = self->priv->_compatibility_tool_row;
		_tmp7_ = adw_combo_row_get_selected_item ((AdwComboRow*) _tmp6_);
		_tmp0_ = _tmp7_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	tool_changed = _tmp0_;
	_tmp9_ = self->priv->_launch_options_switch;
	_tmp10_ = gtk_switch_get_active (_tmp9_);
	_tmp11_ = _tmp10_;
	if (_tmp11_) {
		ProtonPlusWidgetsGamesLaunchOptionsEditorBox* _tmp12_;
		gboolean _tmp13_;
		gboolean _tmp14_;
		_tmp12_ = self->priv->_launch_options_editor;
		_tmp13_ = proton_plus_widgets_games_launch_options_editor_box_get_is_dirty (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp8_ = _tmp14_;
	} else {
		_tmp8_ = FALSE;
	}
	launch_options_changed = _tmp8_;
	_tmp15_ = self->priv->clear_button;
	_tmp16_ = self->priv->_launch_options_editor;
	_tmp17_ = proton_plus_widgets_games_launch_options_editor_box_get_is_dirty (_tmp16_);
	_tmp18_ = _tmp17_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp15_, _tmp18_);
	if (launch_options_changed) {
		_tmp19_ = TRUE;
	} else {
		_tmp19_ = tool_changed;
	}
	_tmp20_ = self->priv->apply_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp20_, _tmp19_);
}

static void
proton_plus_widgets_games_mass_edit_view_clear_button_clicked (ProtonPlusWidgetsGamesMassEditView* self)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorBox* _tmp0_;
	GtkSwitch* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_launch_options_editor;
	proton_plus_widgets_games_launch_options_editor_box_clear (_tmp0_);
	_tmp1_ = self->priv->_launch_options_switch;
	gtk_switch_set_active (_tmp1_, TRUE);
	proton_plus_widgets_games_mass_edit_view_refresh (self);
}

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

static inline void
_g_list_free__g_free0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) _g_free0_);
}

static void
proton_plus_widgets_games_mass_edit_view_apply_button_clicked (ProtonPlusWidgetsGamesMassEditView* self)
{
	ProtonPlusModelsCompatibilityTool* item = NULL;
	ProtonPlusWidgetsGamesCompatibilityToolRow* _tmp0_;
	GObject* _tmp1_;
	ProtonPlusModelsCompatibilityTool* _tmp2_;
	gboolean _tmp3_ = FALSE;
	GtkSwitch* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	GtkSwitch* _tmp11_;
	gboolean _tmp12_;
	gboolean _tmp13_;
	GList* invalids = NULL;
	GeeHashMap* launch_writes = NULL;
	GeeHashMap* _tmp31_;
	gboolean _tmp32_ = FALSE;
	GtkSwitch* _tmp33_;
	gboolean _tmp34_;
	gboolean _tmp35_;
	ProtonPlusWidgetsGamesGameRow** _tmp74_;
	gint _tmp74__length1;
	GList* _tmp142_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_compatibility_tool_row;
	_tmp1_ = adw_combo_row_get_selected_item ((AdwComboRow*) _tmp0_);
	_tmp2_ = _g_object_ref0 (PROTON_PLUS_MODELS_IS_COMPATIBILITY_TOOL (_tmp1_) ? ((ProtonPlusModelsCompatibilityTool*) _tmp1_) : NULL);
	item = _tmp2_;
	_tmp4_ = self->priv->_compatibility_tool_switch;
	_tmp5_ = gtk_switch_get_active (_tmp4_);
	_tmp6_ = _tmp5_;
	if (_tmp6_) {
		ProtonPlusModelsCompatibilityTool* _tmp7_;
		_tmp7_ = item;
		_tmp3_ = _tmp7_ == NULL;
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		ProtonPlusWidgetsMainErrorDialog* dialog = NULL;
		ProtonPlusWidgetsMainErrorDialog* _tmp8_;
		ProtonPlusWidgetsMainErrorDialog* _tmp9_;
		GtkRoot* _tmp10_;
		_tmp8_ = proton_plus_widgets_main_error_dialog_new (_ ("Compatibility tool cannot be applied"), _ ("No games were changed because no compatibility tool is selected."), "");
		g_object_ref_sink (_tmp8_);
		dialog = _tmp8_;
		_tmp9_ = dialog;
		_tmp10_ = gtk_widget_get_root ((GtkWidget*) self);
		proton_plus_widgets_window_present_dialog_for_controller ((AdwDialog*) _tmp9_, (GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, gtk_window_get_type (), GtkWindow));
		_g_object_unref0 (dialog);
		_g_object_unref0 (item);
		return;
	}
	_tmp11_ = self->priv->_compatibility_tool_switch;
	_tmp12_ = gtk_switch_get_active (_tmp11_);
	_tmp13_ = _tmp12_;
	if (_tmp13_) {
		ProtonPlusWidgetsGamesGameRow** _tmp14_;
		gint _tmp14__length1;
		_tmp14_ = self->rows;
		_tmp14__length1 = self->rows_length1;
		{
			ProtonPlusWidgetsGamesGameRow** row_collection = NULL;
			gint row_collection_length1 = 0;
			gint _row_collection_size_ = 0;
			gint row_it = 0;
			row_collection = _tmp14_;
			row_collection_length1 = _tmp14__length1;
			for (row_it = 0; row_it < row_collection_length1; row_it = row_it + 1) {
				ProtonPlusWidgetsGamesGameRow* _tmp15_;
				ProtonPlusWidgetsGamesGameRow* row = NULL;
				_tmp15_ = _g_object_ref0 (row_collection[row_it]);
				row = _tmp15_;
				{
					ProtonPlusModelsLaunchersSteam* steam = NULL;
					ProtonPlusWidgetsGamesGameRow* _tmp16_;
					ProtonPlusModelsGame* _tmp17_;
					ProtonPlusModelsGame* _tmp18_;
					ProtonPlusModelsLauncher* _tmp19_;
					ProtonPlusModelsLauncher* _tmp20_;
					ProtonPlusModelsLaunchersSteam* _tmp21_;
					gboolean _tmp22_ = FALSE;
					ProtonPlusModelsLaunchersSteam* _tmp23_;
					_tmp16_ = row;
					_tmp17_ = proton_plus_widgets_games_game_row_get_game (_tmp16_);
					_tmp18_ = _tmp17_;
					_tmp19_ = proton_plus_models_game_get_launcher (_tmp18_);
					_tmp20_ = _tmp19_;
					_tmp21_ = _g_object_ref0 (PROTON_PLUS_MODELS_LAUNCHERS_IS_STEAM (_tmp20_) ? ((ProtonPlusModelsLaunchersSteam*) _tmp20_) : NULL);
					steam = _tmp21_;
					_tmp23_ = steam;
					if (_tmp23_ != NULL) {
						ProtonPlusModelsLaunchersSteam* _tmp24_;
						ProtonPlusModelsCompatibilityTool* _tmp25_;
						const gchar* _tmp26_;
						const gchar* _tmp27_;
						_tmp24_ = steam;
						_tmp25_ = item;
						_tmp26_ = proton_plus_models_compatibility_tool_get_internal_title (_tmp25_);
						_tmp27_ = _tmp26_;
						_tmp22_ = !proton_plus_models_launchers_steam_can_assign_compatibility_tool (G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, PROTON_PLUS_MODELS_LAUNCHERS_TYPE_STEAM, ProtonPlusModelsLaunchersSteam), _tmp27_);
					} else {
						_tmp22_ = FALSE;
					}
					if (_tmp22_) {
						ProtonPlusWidgetsMainErrorDialog* dialog = NULL;
						ProtonPlusWidgetsMainErrorDialog* _tmp28_;
						ProtonPlusWidgetsMainErrorDialog* _tmp29_;
						GtkRoot* _tmp30_;
						_tmp28_ = proton_plus_widgets_main_error_dialog_new (_ ("Compatibility tool cannot be applied"), _ ("No games were changed because the selected compatibility tool is no lo" \
"nger available."), "");
						g_object_ref_sink (_tmp28_);
						dialog = _tmp28_;
						_tmp29_ = dialog;
						_tmp30_ = gtk_widget_get_root ((GtkWidget*) self);
						proton_plus_widgets_window_present_dialog_for_controller ((AdwDialog*) _tmp29_, (GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (_tmp30_, gtk_window_get_type (), GtkWindow));
						_g_object_unref0 (dialog);
						_g_object_unref0 (steam);
						_g_object_unref0 (row);
						_g_object_unref0 (item);
						return;
					}
					_g_object_unref0 (steam);
					_g_object_unref0 (row);
				}
			}
		}
	}
	invalids = NULL;
	_tmp31_ = gee_hash_map_new (PROTON_PLUS_MODELS_GAMES_TYPE_STEAM, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_COMMAND_WRITE_RESULT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	launch_writes = _tmp31_;
	_tmp33_ = self->priv->_launch_options_switch;
	_tmp34_ = gtk_switch_get_active (_tmp33_);
	_tmp35_ = _tmp34_;
	if (_tmp35_) {
		ProtonPlusWidgetsGamesLaunchOptionsEditorBox* _tmp36_;
		gboolean _tmp37_;
		gboolean _tmp38_;
		_tmp36_ = self->priv->_launch_options_editor;
		_tmp37_ = proton_plus_widgets_games_launch_options_editor_box_get_is_dirty (_tmp36_);
		_tmp38_ = _tmp37_;
		_tmp32_ = _tmp38_;
	} else {
		_tmp32_ = FALSE;
	}
	if (_tmp32_) {
		ProtonPlusWidgetsGamesGameRow** _tmp39_;
		gint _tmp39__length1;
		proton_plus_widgets_games_mass_edit_view_refresh_capability_context (self);
		_tmp39_ = self->rows;
		_tmp39__length1 = self->rows_length1;
		{
			ProtonPlusWidgetsGamesGameRow** row_collection = NULL;
			gint row_collection_length1 = 0;
			gint _row_collection_size_ = 0;
			gint row_it = 0;
			row_collection = _tmp39_;
			row_collection_length1 = _tmp39__length1;
			for (row_it = 0; row_it < row_collection_length1; row_it = row_it + 1) {
				ProtonPlusWidgetsGamesGameRow* _tmp40_;
				ProtonPlusWidgetsGamesGameRow* row = NULL;
				_tmp40_ = _g_object_ref0 (row_collection[row_it]);
				row = _tmp40_;
				{
					ProtonPlusModelsGamesSteam* steam_game = NULL;
					ProtonPlusWidgetsGamesGameRow* _tmp41_;
					ProtonPlusModelsGame* _tmp42_;
					ProtonPlusModelsGame* _tmp43_;
					ProtonPlusModelsGamesSteam* _tmp44_;
					ProtonPlusModelsGamesSteam* _tmp45_;
					const gchar* _tmp46_ = NULL;
					ProtonPlusModelsGamesSteam* _tmp47_;
					const gchar* _tmp48_;
					const gchar* _tmp49_;
					ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* launch_write = NULL;
					ProtonPlusWidgetsGamesLaunchOptionsEditorBox* _tmp50_;
					ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp51_;
					ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp52_;
					gboolean _tmp53_;
					gboolean _tmp54_;
					GeeHashMap* _tmp71_;
					ProtonPlusModelsGamesSteam* _tmp72_;
					ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp73_;
					_tmp41_ = row;
					_tmp42_ = proton_plus_widgets_games_game_row_get_game (_tmp41_);
					_tmp43_ = _tmp42_;
					_tmp44_ = _g_object_ref0 (PROTON_PLUS_MODELS_GAMES_IS_STEAM (_tmp43_) ? ((ProtonPlusModelsGamesSteam*) _tmp43_) : NULL);
					steam_game = _tmp44_;
					_tmp45_ = steam_game;
					if (_tmp45_ == NULL) {
						_g_object_unref0 (steam_game);
						_g_object_unref0 (row);
						continue;
					}
					_tmp47_ = steam_game;
					_tmp48_ = proton_plus_models_games_steam_get_launch_options (_tmp47_);
					_tmp49_ = _tmp48_;
					_tmp46_ = _tmp49_;
					if (_tmp46_ == NULL) {
						_tmp46_ = "";
					}
					_tmp50_ = self->priv->_launch_options_editor;
					_tmp51_ = proton_plus_widgets_games_launch_options_editor_box_prepare_write_for_source (_tmp50_, _tmp46_);
					launch_write = _tmp51_;
					_tmp52_ = launch_write;
					_tmp53_ = proton_plus_widgets_games_launch_options_editor_launch_command_write_result_get_writing_allowed (_tmp52_);
					_tmp54_ = _tmp53_;
					if (!_tmp54_) {
						gchar* _tmp55_ = NULL;
						ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp56_;
						GeeArrayList* _tmp57_;
						GeeArrayList* _tmp58_;
						gint _tmp59_;
						gint _tmp60_;
						gchar* detail = NULL;
						gchar* _tmp66_;
						ProtonPlusWidgetsMainErrorDialog* dialog = NULL;
						const gchar* _tmp67_;
						ProtonPlusWidgetsMainErrorDialog* _tmp68_;
						ProtonPlusWidgetsMainErrorDialog* _tmp69_;
						GtkRoot* _tmp70_;
						_tmp56_ = launch_write;
						_tmp57_ = proton_plus_widgets_games_launch_options_editor_launch_command_write_result_get_writer_diagnostics (_tmp56_);
						_tmp58_ = _tmp57_;
						_tmp59_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp58_);
						_tmp60_ = _tmp59_;
						if (_tmp60_ > 0) {
							ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp61_;
							GeeArrayList* _tmp62_;
							GeeArrayList* _tmp63_;
							gpointer _tmp64_;
							_tmp61_ = launch_write;
							_tmp62_ = proton_plus_widgets_games_launch_options_editor_launch_command_write_result_get_writer_diagnostics (_tmp61_);
							_tmp63_ = _tmp62_;
							_tmp64_ = gee_abstract_list_get ((GeeAbstractList*) _tmp63_, 0);
							_g_free0 (_tmp55_);
							_tmp55_ = (gchar*) _tmp64_;
						} else {
							gchar* _tmp65_;
							_tmp65_ = g_strdup (_ ("The selected launch options are incomplete or unsupported for these ga" \
"mes."));
							_g_free0 (_tmp55_);
							_tmp55_ = _tmp65_;
						}
						_tmp66_ = _tmp55_;
						_tmp55_ = NULL;
						detail = _tmp66_;
						_tmp67_ = detail;
						_tmp68_ = proton_plus_widgets_main_error_dialog_new (_ ("Launch options cannot be applied"), _ ("No games were changed because the launch command could not be prepared" \
" safely."), _tmp67_);
						g_object_ref_sink (_tmp68_);
						dialog = _tmp68_;
						_tmp69_ = dialog;
						_tmp70_ = gtk_widget_get_root ((GtkWidget*) self);
						proton_plus_widgets_window_present_dialog_for_controller ((AdwDialog*) _tmp69_, (GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (_tmp70_, gtk_window_get_type (), GtkWindow));
						_g_object_unref0 (dialog);
						_g_free0 (detail);
						_g_free0 (_tmp55_);
						_g_object_unref0 (launch_write);
						_g_object_unref0 (steam_game);
						_g_object_unref0 (row);
						_g_object_unref0 (launch_writes);
						(invalids == NULL) ? NULL : (invalids = (_g_list_free__g_free0_ (invalids), NULL));
						_g_object_unref0 (item);
						return;
					}
					_tmp71_ = launch_writes;
					_tmp72_ = steam_game;
					_tmp73_ = launch_write;
					gee_abstract_map_set ((GeeAbstractMap*) _tmp71_, _tmp72_, _tmp73_);
					_g_object_unref0 (launch_write);
					_g_object_unref0 (steam_game);
					_g_object_unref0 (row);
				}
			}
		}
	}
	_tmp74_ = self->rows;
	_tmp74__length1 = self->rows_length1;
	{
		ProtonPlusWidgetsGamesGameRow** row_collection = NULL;
		gint row_collection_length1 = 0;
		gint _row_collection_size_ = 0;
		gint row_it = 0;
		row_collection = _tmp74_;
		row_collection_length1 = _tmp74__length1;
		for (row_it = 0; row_it < row_collection_length1; row_it = row_it + 1) {
			ProtonPlusWidgetsGamesGameRow* _tmp75_;
			ProtonPlusWidgetsGamesGameRow* row = NULL;
			_tmp75_ = _g_object_ref0 (row_collection[row_it]);
			row = _tmp75_;
			{
				gboolean compatibility_applied = FALSE;
				GtkSwitch* _tmp76_;
				gboolean _tmp77_;
				gboolean _tmp78_;
				ProtonPlusModelsGamesSteam* steam_game = NULL;
				ProtonPlusWidgetsGamesGameRow* _tmp99_;
				ProtonPlusModelsGame* _tmp100_;
				ProtonPlusModelsGame* _tmp101_;
				ProtonPlusModelsGamesSteam* _tmp102_;
				gboolean _tmp103_ = FALSE;
				ProtonPlusModelsGamesSteam* _tmp104_;
				compatibility_applied = TRUE;
				_tmp76_ = self->priv->_compatibility_tool_switch;
				_tmp77_ = gtk_switch_get_active (_tmp76_);
				_tmp78_ = _tmp77_;
				if (_tmp78_) {
					gboolean success = FALSE;
					ProtonPlusWidgetsGamesGameRow* _tmp79_;
					ProtonPlusModelsGame* _tmp80_;
					ProtonPlusModelsGame* _tmp81_;
					ProtonPlusModelsCompatibilityTool* _tmp82_;
					const gchar* _tmp83_;
					const gchar* _tmp84_;
					_tmp79_ = row;
					_tmp80_ = proton_plus_widgets_games_game_row_get_game (_tmp79_);
					_tmp81_ = _tmp80_;
					_tmp82_ = item;
					_tmp83_ = proton_plus_models_compatibility_tool_get_internal_title (_tmp82_);
					_tmp84_ = _tmp83_;
					success = proton_plus_models_game_change_compatibility_tool (_tmp81_, _tmp84_);
					if (!success) {
						GList* _tmp85_;
						ProtonPlusWidgetsGamesGameRow* _tmp86_;
						ProtonPlusModelsGame* _tmp87_;
						ProtonPlusModelsGame* _tmp88_;
						const gchar* _tmp89_;
						const gchar* _tmp90_;
						GList* _tmp91_;
						compatibility_applied = FALSE;
						_tmp85_ = invalids;
						_tmp86_ = row;
						_tmp87_ = proton_plus_widgets_games_game_row_get_game (_tmp86_);
						_tmp88_ = _tmp87_;
						_tmp89_ = proton_plus_models_game_get_name (_tmp88_);
						_tmp90_ = _tmp89_;
						_tmp91_ = g_list_find (_tmp85_, _tmp90_);
						if (_tmp91_ == NULL) {
							ProtonPlusWidgetsGamesGameRow* _tmp92_;
							ProtonPlusModelsGame* _tmp93_;
							ProtonPlusModelsGame* _tmp94_;
							const gchar* _tmp95_;
							const gchar* _tmp96_;
							gchar* _tmp97_;
							_tmp92_ = row;
							_tmp93_ = proton_plus_widgets_games_game_row_get_game (_tmp92_);
							_tmp94_ = _tmp93_;
							_tmp95_ = proton_plus_models_game_get_name (_tmp94_);
							_tmp96_ = _tmp95_;
							_tmp97_ = g_strdup (_tmp96_);
							invalids = g_list_append (invalids, _tmp97_);
						}
					} else {
						ProtonPlusWidgetsGamesGameRow* _tmp98_;
						_tmp98_ = row;
						proton_plus_widgets_games_game_row_refresh_tool_label (_tmp98_);
					}
				}
				if (!compatibility_applied) {
					_g_object_unref0 (row);
					continue;
				}
				_tmp99_ = row;
				_tmp100_ = proton_plus_widgets_games_game_row_get_game (_tmp99_);
				_tmp101_ = _tmp100_;
				_tmp102_ = _g_object_ref0 (PROTON_PLUS_MODELS_GAMES_IS_STEAM (_tmp101_) ? ((ProtonPlusModelsGamesSteam*) _tmp101_) : NULL);
				steam_game = _tmp102_;
				_tmp104_ = steam_game;
				if (_tmp104_ != NULL) {
					GeeHashMap* _tmp105_;
					ProtonPlusModelsGamesSteam* _tmp106_;
					_tmp105_ = launch_writes;
					_tmp106_ = steam_game;
					_tmp103_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp105_, _tmp106_);
				} else {
					_tmp103_ = FALSE;
				}
				if (_tmp103_) {
					ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* launch_write = NULL;
					GeeHashMap* _tmp107_;
					ProtonPlusModelsGamesSteam* _tmp108_;
					gpointer _tmp109_;
					gboolean _tmp110_ = FALSE;
					ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp111_;
					ProtonPlusModelsLaunchersSteam* steam_launcher = NULL;
					ProtonPlusModelsGamesSteam* _tmp115_;
					ProtonPlusModelsLauncher* _tmp116_;
					ProtonPlusModelsLauncher* _tmp117_;
					ProtonPlusModelsLaunchersSteam* _tmp118_;
					gboolean success = FALSE;
					ProtonPlusModelsGamesSteam* _tmp119_;
					ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp120_;
					const gchar* _tmp121_;
					const gchar* _tmp122_;
					ProtonPlusModelsLaunchersSteam* _tmp123_;
					ProtonPlusModelsSteamProfile* _tmp124_;
					ProtonPlusModelsSteamProfile* _tmp125_;
					const gchar* _tmp126_;
					const gchar* _tmp127_;
					gboolean _tmp128_ = FALSE;
					_tmp107_ = launch_writes;
					_tmp108_ = steam_game;
					_tmp109_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp107_, _tmp108_);
					launch_write = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult*) _tmp109_;
					_tmp111_ = launch_write;
					if (_tmp111_ == NULL) {
						_tmp110_ = TRUE;
					} else {
						ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp112_;
						gboolean _tmp113_;
						gboolean _tmp114_;
						_tmp112_ = launch_write;
						_tmp113_ = proton_plus_widgets_games_launch_options_editor_launch_command_write_result_get_requires_persistence (_tmp112_);
						_tmp114_ = _tmp113_;
						_tmp110_ = !_tmp114_;
					}
					if (_tmp110_) {
						_g_object_unref0 (launch_write);
						_g_object_unref0 (steam_game);
						_g_object_unref0 (row);
						continue;
					}
					_tmp115_ = steam_game;
					_tmp116_ = proton_plus_models_game_get_launcher ((ProtonPlusModelsGame*) _tmp115_);
					_tmp117_ = _tmp116_;
					_tmp118_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp117_, PROTON_PLUS_MODELS_LAUNCHERS_TYPE_STEAM, ProtonPlusModelsLaunchersSteam));
					steam_launcher = _tmp118_;
					_tmp119_ = steam_game;
					_tmp120_ = launch_write;
					_tmp121_ = proton_plus_widgets_games_launch_options_editor_launch_command_write_result_get_launch_line (_tmp120_);
					_tmp122_ = _tmp121_;
					_tmp123_ = steam_launcher;
					_tmp124_ = proton_plus_models_launchers_steam_get_profile (_tmp123_);
					_tmp125_ = _tmp124_;
					_tmp126_ = proton_plus_models_steam_profile_get_localconfig_path (_tmp125_);
					_tmp127_ = _tmp126_;
					success = proton_plus_models_games_steam_change_launch_options (_tmp119_, _tmp122_, _tmp127_);
					if (!success) {
						GList* _tmp129_;
						ProtonPlusWidgetsGamesGameRow* _tmp130_;
						ProtonPlusModelsGame* _tmp131_;
						ProtonPlusModelsGame* _tmp132_;
						const gchar* _tmp133_;
						const gchar* _tmp134_;
						GList* _tmp135_;
						_tmp129_ = invalids;
						_tmp130_ = row;
						_tmp131_ = proton_plus_widgets_games_game_row_get_game (_tmp130_);
						_tmp132_ = _tmp131_;
						_tmp133_ = proton_plus_models_game_get_name (_tmp132_);
						_tmp134_ = _tmp133_;
						_tmp135_ = g_list_find (_tmp129_, _tmp134_);
						_tmp128_ = _tmp135_ == NULL;
					} else {
						_tmp128_ = FALSE;
					}
					if (_tmp128_) {
						ProtonPlusWidgetsGamesGameRow* _tmp136_;
						ProtonPlusModelsGame* _tmp137_;
						ProtonPlusModelsGame* _tmp138_;
						const gchar* _tmp139_;
						const gchar* _tmp140_;
						gchar* _tmp141_;
						_tmp136_ = row;
						_tmp137_ = proton_plus_widgets_games_game_row_get_game (_tmp136_);
						_tmp138_ = _tmp137_;
						_tmp139_ = proton_plus_models_game_get_name (_tmp138_);
						_tmp140_ = _tmp139_;
						_tmp141_ = g_strdup (_tmp140_);
						invalids = g_list_append (invalids, _tmp141_);
					}
					_g_object_unref0 (steam_launcher);
					_g_object_unref0 (launch_write);
				}
				_g_object_unref0 (steam_game);
				_g_object_unref0 (row);
			}
		}
	}
	_tmp142_ = invalids;
	if (g_list_length (_tmp142_) > ((guint) 0)) {
		gchar* names = NULL;
		gchar* _tmp143_;
		ProtonPlusWidgetsMainErrorDialog* dialog = NULL;
		const gchar* _tmp156_;
		ProtonPlusWidgetsMainErrorDialog* _tmp157_;
		ProtonPlusWidgetsMainErrorDialog* _tmp158_;
		GtkRoot* _tmp159_;
		_tmp143_ = g_strdup ("");
		names = _tmp143_;
		{
			gint i = 0;
			i = 0;
			{
				gboolean _tmp144_ = FALSE;
				_tmp144_ = TRUE;
				while (TRUE) {
					GList* _tmp146_;
					const gchar* _tmp147_;
					GList* _tmp148_;
					gconstpointer _tmp149_;
					gchar* _tmp150_;
					gchar* _tmp151_;
					gchar* _tmp152_;
					GList* _tmp153_;
					if (!_tmp144_) {
						gint _tmp145_;
						_tmp145_ = i;
						i = _tmp145_ + 1;
					}
					_tmp144_ = FALSE;
					_tmp146_ = invalids;
					if (!(((guint) i) < g_list_length (_tmp146_))) {
						break;
					}
					_tmp147_ = names;
					_tmp148_ = invalids;
					_tmp149_ = g_list_nth_data (_tmp148_, (guint) i);
					_tmp150_ = g_strdup_printf ("- %s", (const gchar*) _tmp149_);
					_tmp151_ = _tmp150_;
					_tmp152_ = g_strconcat (_tmp147_, _tmp151_, NULL);
					_g_free0 (names);
					names = _tmp152_;
					_g_free0 (_tmp151_);
					_tmp153_ = invalids;
					if (((guint) i) != (g_list_length (_tmp153_) - 1)) {
						const gchar* _tmp154_;
						gchar* _tmp155_;
						_tmp154_ = names;
						_tmp155_ = g_strconcat (_tmp154_, "\n", NULL);
						_g_free0 (names);
						names = _tmp155_;
					}
				}
			}
		}
		_tmp156_ = names;
		_tmp157_ = proton_plus_widgets_main_error_dialog_new (_ ("Batch Update Failed"), _ ("Some games could not be updated with the new compatibility tool or lau" \
"nch options. This may be due to missing permissions or file access iss" \
"ues."), _tmp156_);
		g_object_ref_sink (_tmp157_);
		dialog = _tmp157_;
		_tmp158_ = dialog;
		_tmp159_ = gtk_widget_get_root ((GtkWidget*) self);
		proton_plus_widgets_window_present_dialog_for_controller ((AdwDialog*) _tmp158_, (GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (_tmp159_, gtk_window_get_type (), GtkWindow));
		_g_object_unref0 (dialog);
		_g_free0 (names);
	}
	g_signal_emit (self, proton_plus_widgets_games_mass_edit_view_signals[PROTON_PLUS_WIDGETS_GAMES_MASS_EDIT_VIEW_BACK_REQUESTED_SIGNAL], 0);
	_g_object_unref0 (launch_writes);
	(invalids == NULL) ? NULL : (invalids = (_g_list_free__g_free0_ (invalids), NULL));
	_g_object_unref0 (item);
}

static void
proton_plus_widgets_games_mass_edit_view_refresh_capability_context (ProtonPlusWidgetsGamesMassEditView* self)
{
	ProtonPlusWidgetsGamesGameRow** _tmp0_;
	gint _tmp0__length1;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->rows;
	_tmp0__length1 = self->rows_length1;
	if (_tmp0_ != NULL) {
		ProtonPlusWidgetsGamesLaunchOptionsEditorBox* _tmp1_;
		ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandCapabilityContext* _tmp2_;
		ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandCapabilityContext* _tmp3_;
		_tmp1_ = self->priv->_launch_options_editor;
		_tmp2_ = proton_plus_widgets_games_mass_edit_view_resolve_launch_option_capabilities (self);
		_tmp3_ = _tmp2_;
		proton_plus_widgets_games_launch_options_editor_box_set_capability_context (_tmp1_, _tmp3_);
		_g_object_unref0 (_tmp3_);
	}
}

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 ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandCapabilityContext*
proton_plus_widgets_games_mass_edit_view_resolve_launch_option_capabilities (ProtonPlusWidgetsGamesMassEditView* self)
{
	ProtonPlusModelsCompatibilityToolRuntimeKind* runtimes = NULL;
	ProtonPlusWidgetsGamesGameRow** _tmp0_;
	gint _tmp0__length1;
	ProtonPlusModelsCompatibilityToolRuntimeKind* _tmp1_;
	gint runtimes_length1;
	gint _runtimes_size_;
	GeeArrayList* selected_tools = NULL;
	GeeArrayList* _tmp2_;
	gboolean all_tools_known = FALSE;
	gint runtime_index = 0;
	gboolean all_steam = FALSE;
	ProtonPlusWidgetsGamesGameRow** _tmp3_;
	gint _tmp3__length1;
	ProtonPlusWidgetsGamesGameRow** _tmp4_;
	gint _tmp4__length1;
	ProtonPlusModelsCompatibilityTool* proposed = NULL;
	gboolean _tmp9_ = FALSE;
	GtkSwitch* _tmp10_;
	gboolean _tmp11_;
	gboolean _tmp12_;
	ProtonPlusModelsCompatibilityTool* _tmp17_;
	gboolean _tmp72_ = FALSE;
	gboolean _tmp73_ = FALSE;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionInstalledComponents* components = NULL;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionInstalledComponents* _tmp75_;
	ProtonPlusModelsCompatibilityTool** _tmp76_ = NULL;
	gint _tmp76__length1 = 0;
	gint __tmp76__size_ = 0;
	ProtonPlusModelsCompatibilityTool** tools = NULL;
	ProtonPlusModelsCompatibilityTool** _tmp81_;
	gint _tmp81__length1;
	gint tools_length1;
	gint _tools_size_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCapabilityResolver* _tmp82_;
	ProtonPlusModelsCompatibilityToolRuntimeKind* _tmp83_;
	gint _tmp83__length1;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionInstalledComponents* _tmp84_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandCapabilityContext* _tmp85_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandCapabilityContext* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->rows;
	_tmp0__length1 = self->rows_length1;
	_tmp1_ = g_new0 (ProtonPlusModelsCompatibilityToolRuntimeKind, _tmp0__length1);
	runtimes = _tmp1_;
	runtimes_length1 = _tmp0__length1;
	_runtimes_size_ = runtimes_length1;
	_tmp2_ = gee_array_list_new (PROTON_PLUS_MODELS_TYPE_COMPATIBILITY_TOOL, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	selected_tools = _tmp2_;
	all_tools_known = TRUE;
	runtime_index = 0;
	_tmp3_ = self->rows;
	_tmp3__length1 = self->rows_length1;
	all_steam = _tmp3__length1 > 0;
	_tmp4_ = self->rows;
	_tmp4__length1 = self->rows_length1;
	{
		ProtonPlusWidgetsGamesGameRow** row_collection = NULL;
		gint row_collection_length1 = 0;
		gint _row_collection_size_ = 0;
		gint row_it = 0;
		row_collection = _tmp4_;
		row_collection_length1 = _tmp4__length1;
		for (row_it = 0; row_it < row_collection_length1; row_it = row_it + 1) {
			ProtonPlusWidgetsGamesGameRow* _tmp5_;
			ProtonPlusWidgetsGamesGameRow* row = NULL;
			_tmp5_ = _g_object_ref0 (row_collection[row_it]);
			row = _tmp5_;
			{
				ProtonPlusWidgetsGamesGameRow* _tmp6_;
				ProtonPlusModelsGame* _tmp7_;
				ProtonPlusModelsGame* _tmp8_;
				_tmp6_ = row;
				_tmp7_ = proton_plus_widgets_games_game_row_get_game (_tmp6_);
				_tmp8_ = _tmp7_;
				if (!PROTON_PLUS_MODELS_GAMES_IS_STEAM (_tmp8_)) {
					all_steam = FALSE;
				}
				_g_object_unref0 (row);
			}
		}
	}
	proposed = NULL;
	_tmp10_ = self->priv->_compatibility_tool_switch;
	_tmp11_ = gtk_switch_get_active (_tmp10_);
	_tmp12_ = _tmp11_;
	if (_tmp12_) {
		ProtonPlusWidgetsGamesCompatibilityToolRow* _tmp13_;
		_tmp13_ = self->priv->_compatibility_tool_row;
		_tmp9_ = _tmp13_ != NULL;
	} else {
		_tmp9_ = FALSE;
	}
	if (_tmp9_) {
		ProtonPlusWidgetsGamesCompatibilityToolRow* _tmp14_;
		GObject* _tmp15_;
		ProtonPlusModelsCompatibilityTool* _tmp16_;
		_tmp14_ = self->priv->_compatibility_tool_row;
		_tmp15_ = adw_combo_row_get_selected_item ((AdwComboRow*) _tmp14_);
		_tmp16_ = _g_object_ref0 (PROTON_PLUS_MODELS_IS_COMPATIBILITY_TOOL (_tmp15_) ? ((ProtonPlusModelsCompatibilityTool*) _tmp15_) : NULL);
		_g_object_unref0 (proposed);
		proposed = _tmp16_;
	}
	_tmp17_ = proposed;
	if (_tmp17_ != NULL) {
		ProtonPlusWidgetsGamesGameRow** _tmp18_;
		gint _tmp18__length1;
		_tmp18_ = self->rows;
		_tmp18__length1 = self->rows_length1;
		{
			ProtonPlusWidgetsGamesGameRow** row_collection = NULL;
			gint row_collection_length1 = 0;
			gint _row_collection_size_ = 0;
			gint row_it = 0;
			row_collection = _tmp18_;
			row_collection_length1 = _tmp18__length1;
			for (row_it = 0; row_it < row_collection_length1; row_it = row_it + 1) {
				ProtonPlusWidgetsGamesGameRow* _tmp19_;
				ProtonPlusWidgetsGamesGameRow* row = NULL;
				_tmp19_ = _g_object_ref0 (row_collection[row_it]);
				row = _tmp19_;
				{
					ProtonPlusModelsCompatibilityTool* effective = NULL;
					ProtonPlusWidgetsGamesGameRow* _tmp20_;
					ProtonPlusModelsCompatibilityTool* _tmp21_;
					ProtonPlusModelsCompatibilityTool* _tmp22_;
					ProtonPlusModelsCompatibilityTool* _tmp23_ = NULL;
					ProtonPlusModelsCompatibilityTool* _tmp24_;
					ProtonPlusModelsCompatibilityToolRuntimeKind* _tmp26_;
					gint _tmp26__length1;
					gint _tmp27_;
					ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCapabilityResolver* _tmp28_;
					gboolean _tmp29_ = FALSE;
					ProtonPlusModelsCompatibilityTool* _tmp30_;
					_tmp20_ = row;
					_tmp21_ = proposed;
					_tmp22_ = proton_plus_widgets_games_mass_edit_view_resolve_effective_tool (self, _tmp20_, _tmp21_);
					effective = _tmp22_;
					_tmp24_ = effective;
					_tmp23_ = _tmp24_;
					if (_tmp23_ == NULL) {
						ProtonPlusModelsCompatibilityTool* _tmp25_;
						_tmp25_ = proposed;
						_tmp23_ = _tmp25_;
					}
					_tmp26_ = runtimes;
					_tmp26__length1 = runtimes_length1;
					_tmp27_ = runtime_index;
					runtime_index = _tmp27_ + 1;
					_tmp28_ = self->priv->capability_resolver;
					_tmp26_[_tmp27_] = proton_plus_widgets_games_launch_options_editor_launch_option_capability_resolver_runtime_for_tool (_tmp28_, _tmp23_);
					_tmp30_ = effective;
					if (_tmp30_ == NULL) {
						_tmp29_ = TRUE;
					} else {
						ProtonPlusModelsCompatibilityTool* _tmp31_;
						const gchar* _tmp32_;
						const gchar* _tmp33_;
						gchar* _tmp34_;
						gchar* _tmp35_;
						_tmp31_ = effective;
						_tmp32_ = proton_plus_models_compatibility_tool_get_path (_tmp31_);
						_tmp33_ = _tmp32_;
						_tmp34_ = string_strip (_tmp33_);
						_tmp35_ = _tmp34_;
						_tmp29_ = g_strcmp0 (_tmp35_, "") == 0;
						_g_free0 (_tmp35_);
					}
					if (_tmp29_) {
						all_tools_known = FALSE;
					} else {
						GeeArrayList* _tmp36_;
						ProtonPlusModelsCompatibilityTool* _tmp37_;
						_tmp36_ = selected_tools;
						_tmp37_ = effective;
						gee_abstract_collection_add ((GeeAbstractCollection*) _tmp36_, _tmp37_);
					}
					_g_object_unref0 (effective);
					_g_object_unref0 (row);
				}
			}
		}
	} else {
		ProtonPlusWidgetsGamesGameRow** _tmp38_;
		gint _tmp38__length1;
		_tmp38_ = self->rows;
		_tmp38__length1 = self->rows_length1;
		{
			ProtonPlusWidgetsGamesGameRow** row_collection = NULL;
			gint row_collection_length1 = 0;
			gint _row_collection_size_ = 0;
			gint row_it = 0;
			row_collection = _tmp38_;
			row_collection_length1 = _tmp38__length1;
			for (row_it = 0; row_it < row_collection_length1; row_it = row_it + 1) {
				ProtonPlusWidgetsGamesGameRow* _tmp39_;
				ProtonPlusWidgetsGamesGameRow* row = NULL;
				_tmp39_ = _g_object_ref0 (row_collection[row_it]);
				row = _tmp39_;
				{
					ProtonPlusWidgetsGamesGameRow* _tmp40_;
					ProtonPlusModelsGame* _tmp41_;
					ProtonPlusModelsGame* _tmp42_;
					gboolean _tmp43_;
					gboolean _tmp44_;
					ProtonPlusModelsCompatibilityTool* current = NULL;
					GeeHashMap* _tmp47_;
					ProtonPlusWidgetsGamesGameRow* _tmp48_;
					ProtonPlusModelsGame* _tmp49_;
					ProtonPlusModelsGame* _tmp50_;
					const gchar* _tmp51_;
					const gchar* _tmp52_;
					gpointer _tmp53_;
					ProtonPlusModelsCompatibilityTool* effective = NULL;
					ProtonPlusWidgetsGamesGameRow* _tmp54_;
					ProtonPlusModelsCompatibilityTool* _tmp55_;
					ProtonPlusModelsCompatibilityTool* _tmp56_;
					ProtonPlusModelsCompatibilityTool* _tmp57_ = NULL;
					ProtonPlusModelsCompatibilityTool* _tmp58_;
					ProtonPlusModelsCompatibilityToolRuntimeKind* _tmp60_;
					gint _tmp60__length1;
					gint _tmp61_;
					ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCapabilityResolver* _tmp62_;
					gboolean _tmp63_ = FALSE;
					ProtonPlusModelsCompatibilityTool* _tmp64_;
					_tmp40_ = row;
					_tmp41_ = proton_plus_widgets_games_game_row_get_game (_tmp40_);
					_tmp42_ = _tmp41_;
					_tmp43_ = proton_plus_models_game_get_is_native (_tmp42_);
					_tmp44_ = _tmp43_;
					if (_tmp44_) {
						ProtonPlusModelsCompatibilityToolRuntimeKind* _tmp45_;
						gint _tmp45__length1;
						gint _tmp46_;
						_tmp45_ = runtimes;
						_tmp45__length1 = runtimes_length1;
						_tmp46_ = runtime_index;
						runtime_index = _tmp46_ + 1;
						_tmp45_[_tmp46_] = PROTON_PLUS_MODELS_COMPATIBILITY_TOOL_RUNTIME_KIND_NATIVE;
						all_tools_known = FALSE;
						_g_object_unref0 (row);
						continue;
					}
					_tmp47_ = self->priv->compatibility_tools_by_id;
					_tmp48_ = row;
					_tmp49_ = proton_plus_widgets_games_game_row_get_game (_tmp48_);
					_tmp50_ = _tmp49_;
					_tmp51_ = proton_plus_models_game_get_compatibility_tool (_tmp50_);
					_tmp52_ = _tmp51_;
					_tmp53_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp47_, _tmp52_);
					current = (ProtonPlusModelsCompatibilityTool*) _tmp53_;
					_tmp54_ = row;
					_tmp55_ = current;
					_tmp56_ = proton_plus_widgets_games_mass_edit_view_resolve_effective_tool (self, _tmp54_, _tmp55_);
					effective = _tmp56_;
					_tmp58_ = effective;
					_tmp57_ = _tmp58_;
					if (_tmp57_ == NULL) {
						ProtonPlusModelsCompatibilityTool* _tmp59_;
						_tmp59_ = current;
						_tmp57_ = _tmp59_;
					}
					_tmp60_ = runtimes;
					_tmp60__length1 = runtimes_length1;
					_tmp61_ = runtime_index;
					runtime_index = _tmp61_ + 1;
					_tmp62_ = self->priv->capability_resolver;
					_tmp60_[_tmp61_] = proton_plus_widgets_games_launch_options_editor_launch_option_capability_resolver_runtime_for_tool (_tmp62_, _tmp57_);
					_tmp64_ = effective;
					if (_tmp64_ == NULL) {
						_tmp63_ = TRUE;
					} else {
						ProtonPlusModelsCompatibilityTool* _tmp65_;
						const gchar* _tmp66_;
						const gchar* _tmp67_;
						gchar* _tmp68_;
						gchar* _tmp69_;
						_tmp65_ = effective;
						_tmp66_ = proton_plus_models_compatibility_tool_get_path (_tmp65_);
						_tmp67_ = _tmp66_;
						_tmp68_ = string_strip (_tmp67_);
						_tmp69_ = _tmp68_;
						_tmp63_ = g_strcmp0 (_tmp69_, "") == 0;
						_g_free0 (_tmp69_);
					}
					if (_tmp63_) {
						all_tools_known = FALSE;
					} else {
						GeeArrayList* _tmp70_;
						ProtonPlusModelsCompatibilityTool* _tmp71_;
						_tmp70_ = selected_tools;
						_tmp71_ = effective;
						gee_abstract_collection_add ((GeeAbstractCollection*) _tmp70_, _tmp71_);
					}
					_g_object_unref0 (effective);
					_g_object_unref0 (current);
					_g_object_unref0 (row);
				}
			}
		}
	}
	if (proton_plus_globals_MANGOHUD_INSTALLED) {
		_tmp72_ = TRUE;
	} else {
		_tmp72_ = proton_plus_globals_MANGOHUD_FLATPAK_INSTALLED;
	}
	if (proton_plus_globals_OBS_VKCAPTURE_INSTALLED) {
		_tmp73_ = TRUE;
	} else {
		gboolean _tmp74_ = FALSE;
		if (proton_plus_globals_OBS_VKCAPTURE_FLATPAK_INSTALLED) {
			_tmp74_ = proton_plus_globals_OBS_VKCAPTURE_FLATPAK_PLUGIN_INSTALLED;
		} else {
			_tmp74_ = FALSE;
		}
		_tmp73_ = _tmp74_;
	}
	_tmp75_ = proton_plus_widgets_games_launch_options_editor_launch_option_installed_components_new (_tmp72_, proton_plus_globals_GAMEMODE_INSTALLED, proton_plus_globals_GAMESCOPE_INSTALLED, proton_plus_globals_SCOPEBUDDY_INSTALLED, proton_plus_globals_VKBASALT_INSTALLED, proton_plus_globals_GAME_PERFORMANCE_INSTALLED, _tmp73_);
	components = _tmp75_;
	if (all_tools_known) {
		GeeArrayList* _tmp77_;
		gint _tmp78_ = 0;
		gpointer* _tmp79_;
		_tmp77_ = selected_tools;
		_tmp79_ = gee_collection_to_array ((GeeCollection*) _tmp77_, &_tmp78_);
		_tmp76_ = (_vala_array_free (_tmp76_, _tmp76__length1, (GDestroyNotify) g_object_unref), NULL);
		_tmp76_ = _tmp79_;
		_tmp76__length1 = _tmp78_;
		__tmp76__size_ = _tmp76__length1;
	} else {
		ProtonPlusModelsCompatibilityTool** _tmp80_;
		_tmp80_ = g_new0 (ProtonPlusModelsCompatibilityTool*, 0 + 1);
		_tmp76_ = (_vala_array_free (_tmp76_, _tmp76__length1, (GDestroyNotify) g_object_unref), NULL);
		_tmp76_ = _tmp80_;
		_tmp76__length1 = 0;
		__tmp76__size_ = _tmp76__length1;
	}
	_tmp81_ = _tmp76_;
	_tmp81__length1 = _tmp76__length1;
	_tmp76_ = NULL;
	_tmp76__length1 = 0;
	tools = _tmp81_;
	tools_length1 = _tmp81__length1;
	_tools_size_ = tools_length1;
	_tmp82_ = self->priv->capability_resolver;
	_tmp83_ = runtimes;
	_tmp83__length1 = runtimes_length1;
	_tmp84_ = components;
	_tmp85_ = proton_plus_widgets_games_launch_options_editor_launch_option_capability_resolver_resolve (_tmp82_, _tmp83_, (gint) _tmp83__length1, all_steam, _tmp84_, self->priv->gpu_vendor, tools, (gint) tools_length1);
	result = _tmp85_;
	tools = (_vala_array_free (tools, tools_length1, (GDestroyNotify) g_object_unref), NULL);
	_tmp76_ = (_vala_array_free (_tmp76_, _tmp76__length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (components);
	_g_object_unref0 (proposed);
	_g_object_unref0 (selected_tools);
	runtimes = (g_free (runtimes), NULL);
	return result;
}

static ProtonPlusModelsCompatibilityTool*
proton_plus_widgets_games_mass_edit_view_resolve_effective_tool (ProtonPlusWidgetsGamesMassEditView* self,
                                                                 ProtonPlusWidgetsGamesGameRow* row,
                                                                 ProtonPlusModelsCompatibilityTool* selected)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	ProtonPlusModelsLaunchersSteam* steam = NULL;
	ProtonPlusModelsGame* _tmp7_;
	ProtonPlusModelsGame* _tmp8_;
	ProtonPlusModelsLauncher* _tmp9_;
	ProtonPlusModelsLauncher* _tmp10_;
	ProtonPlusModelsLaunchersSteam* _tmp11_;
	ProtonPlusModelsLaunchersSteam* _tmp12_ = NULL;
	ProtonPlusModelsLaunchersSteam* _tmp13_;
	ProtonPlusModelsCompatibilityTool* _tmp14_ = NULL;
	ProtonPlusModelsCompatibilityTool* _tmp18_;
	ProtonPlusModelsCompatibilityTool* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (row != NULL, NULL);
	if (selected == NULL) {
		_tmp1_ = TRUE;
	} else {
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		_tmp2_ = proton_plus_models_compatibility_tool_get_internal_title (selected);
		_tmp3_ = _tmp2_;
		_tmp1_ = g_strcmp0 (_tmp3_, "Default") != 0;
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		ProtonPlusModelsCompatibilityToolRuntimeKind _tmp4_;
		ProtonPlusModelsCompatibilityToolRuntimeKind _tmp5_;
		_tmp4_ = proton_plus_models_compatibility_tool_get_runtime_kind (selected);
		_tmp5_ = _tmp4_;
		_tmp0_ = _tmp5_ == PROTON_PLUS_MODELS_COMPATIBILITY_TOOL_RUNTIME_KIND_NATIVE;
	}
	if (_tmp0_) {
		ProtonPlusModelsCompatibilityTool* _tmp6_;
		_tmp6_ = _g_object_ref0 (selected);
		result = _tmp6_;
		return result;
	}
	_tmp7_ = proton_plus_widgets_games_game_row_get_game (row);
	_tmp8_ = _tmp7_;
	_tmp9_ = proton_plus_models_game_get_launcher (_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = _g_object_ref0 (PROTON_PLUS_MODELS_LAUNCHERS_IS_STEAM (_tmp10_) ? ((ProtonPlusModelsLaunchersSteam*) _tmp10_) : NULL);
	steam = _tmp11_;
	_tmp13_ = steam;
	_tmp12_ = _tmp13_;
	_tmp14_ = NULL;
	if (_tmp12_ != NULL) {
		const gchar* _tmp15_;
		const gchar* _tmp16_;
		ProtonPlusModelsCompatibilityTool* _tmp17_;
		_tmp15_ = proton_plus_models_compatibility_tool_get_internal_title (selected);
		_tmp16_ = _tmp15_;
		_tmp17_ = proton_plus_models_launchers_steam_resolve_effective_compatibility_tool (_tmp12_, _tmp16_);
		_g_object_unref0 (_tmp14_);
		_tmp14_ = _tmp17_;
	}
	_tmp18_ = _tmp14_;
	_tmp14_ = NULL;
	result = _tmp18_;
	_g_object_unref0 (_tmp14_);
	_g_object_unref0 (steam);
	return result;
}

static AdwHeaderBar*
proton_plus_widgets_games_mass_edit_view_get_header_bar (ProtonPlusWidgetsGamesMassEditView* self)
{
	AdwHeaderBar* result;
	AdwHeaderBar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_header_bar;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_mass_edit_view_set_header_bar (ProtonPlusWidgetsGamesMassEditView* self,
                                                         AdwHeaderBar* value)
{
	AdwHeaderBar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_header_bar);
	self->priv->_header_bar = _tmp0_;
}

static AdwClamp*
proton_plus_widgets_games_mass_edit_view_get_content_clamp (ProtonPlusWidgetsGamesMassEditView* self)
{
	AdwClamp* result;
	AdwClamp* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_content_clamp;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_mass_edit_view_set_content_clamp (ProtonPlusWidgetsGamesMassEditView* self,
                                                            AdwClamp* value)
{
	AdwClamp* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_content_clamp);
	self->priv->_content_clamp = _tmp0_;
}

static GtkScrolledWindow*
proton_plus_widgets_games_mass_edit_view_get_scrolled_window (ProtonPlusWidgetsGamesMassEditView* self)
{
	GtkScrolledWindow* result;
	GtkScrolledWindow* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_scrolled_window;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_mass_edit_view_set_scrolled_window (ProtonPlusWidgetsGamesMassEditView* self,
                                                              GtkScrolledWindow* value)
{
	GtkScrolledWindow* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_scrolled_window);
	self->priv->_scrolled_window = _tmp0_;
}

static ProtonPlusWidgetsGamesCompatibilityToolRow*
proton_plus_widgets_games_mass_edit_view_get_compatibility_tool_row (ProtonPlusWidgetsGamesMassEditView* self)
{
	ProtonPlusWidgetsGamesCompatibilityToolRow* result;
	ProtonPlusWidgetsGamesCompatibilityToolRow* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_compatibility_tool_row;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_mass_edit_view_set_compatibility_tool_row (ProtonPlusWidgetsGamesMassEditView* self,
                                                                     ProtonPlusWidgetsGamesCompatibilityToolRow* value)
{
	ProtonPlusWidgetsGamesCompatibilityToolRow* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_compatibility_tool_row);
	self->priv->_compatibility_tool_row = _tmp0_;
}

static AdwPreferencesGroup*
proton_plus_widgets_games_mass_edit_view_get_compatibility_tool_group (ProtonPlusWidgetsGamesMassEditView* self)
{
	AdwPreferencesGroup* result;
	AdwPreferencesGroup* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_compatibility_tool_group;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_mass_edit_view_set_compatibility_tool_group (ProtonPlusWidgetsGamesMassEditView* self,
                                                                       AdwPreferencesGroup* value)
{
	AdwPreferencesGroup* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_compatibility_tool_group);
	self->priv->_compatibility_tool_group = _tmp0_;
}

static AdwPreferencesGroup*
proton_plus_widgets_games_mass_edit_view_get_launch_options_group (ProtonPlusWidgetsGamesMassEditView* self)
{
	AdwPreferencesGroup* result;
	AdwPreferencesGroup* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_launch_options_group;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_mass_edit_view_set_launch_options_group (ProtonPlusWidgetsGamesMassEditView* self,
                                                                   AdwPreferencesGroup* value)
{
	AdwPreferencesGroup* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_launch_options_group);
	self->priv->_launch_options_group = _tmp0_;
}

static GtkSwitch*
proton_plus_widgets_games_mass_edit_view_get_compatibility_tool_switch (ProtonPlusWidgetsGamesMassEditView* self)
{
	GtkSwitch* result;
	GtkSwitch* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_compatibility_tool_switch;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_mass_edit_view_set_compatibility_tool_switch (ProtonPlusWidgetsGamesMassEditView* self,
                                                                        GtkSwitch* value)
{
	GtkSwitch* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_compatibility_tool_switch);
	self->priv->_compatibility_tool_switch = _tmp0_;
}

static GtkSwitch*
proton_plus_widgets_games_mass_edit_view_get_launch_options_switch (ProtonPlusWidgetsGamesMassEditView* self)
{
	GtkSwitch* result;
	GtkSwitch* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_launch_options_switch;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_mass_edit_view_set_launch_options_switch (ProtonPlusWidgetsGamesMassEditView* self,
                                                                    GtkSwitch* value)
{
	GtkSwitch* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_launch_options_switch);
	self->priv->_launch_options_switch = _tmp0_;
}

static ProtonPlusWidgetsGamesLaunchOptionsEditorBox*
proton_plus_widgets_games_mass_edit_view_get_launch_options_editor (ProtonPlusWidgetsGamesMassEditView* self)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorBox* result;
	ProtonPlusWidgetsGamesLaunchOptionsEditorBox* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_launch_options_editor;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_mass_edit_view_set_launch_options_editor (ProtonPlusWidgetsGamesMassEditView* self,
                                                                    ProtonPlusWidgetsGamesLaunchOptionsEditorBox* value)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorBox* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_launch_options_editor);
	self->priv->_launch_options_editor = _tmp0_;
}

static GtkBox*
proton_plus_widgets_games_mass_edit_view_get_content_box (ProtonPlusWidgetsGamesMassEditView* self)
{
	GtkBox* result;
	GtkBox* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_content_box;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_mass_edit_view_set_content_box (ProtonPlusWidgetsGamesMassEditView* self,
                                                          GtkBox* value)
{
	GtkBox* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_content_box);
	self->priv->_content_box = _tmp0_;
}

static GtkLabel*
proton_plus_widgets_games_mass_edit_view_get_batch_hint (ProtonPlusWidgetsGamesMassEditView* self)
{
	GtkLabel* result;
	GtkLabel* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_batch_hint;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_mass_edit_view_set_batch_hint (ProtonPlusWidgetsGamesMassEditView* self,
                                                         GtkLabel* value)
{
	GtkLabel* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_batch_hint);
	self->priv->_batch_hint = _tmp0_;
}

static void
proton_plus_widgets_games_mass_edit_view_class_init (ProtonPlusWidgetsGamesMassEditViewClass * klass,
                                                     gpointer klass_data)
{
	proton_plus_widgets_games_mass_edit_view_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsGamesMassEditView_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_widgets_games_mass_edit_view_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_widgets_games_mass_edit_view_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_games_mass_edit_view_finalize;
	proton_plus_widgets_games_mass_edit_view_signals[PROTON_PLUS_WIDGETS_GAMES_MASS_EDIT_VIEW_BACK_REQUESTED_SIGNAL] = g_signal_new ("back-requested", PROTON_PLUS_WIDGETS_GAMES_TYPE_MASS_EDIT_VIEW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
proton_plus_widgets_games_mass_edit_view_instance_init (ProtonPlusWidgetsGamesMassEditView * self,
                                                        gpointer klass)
{
	self->priv = proton_plus_widgets_games_mass_edit_view_get_instance_private (self);
	self->priv->gpu_vendor = PROTON_PLUS_UTILS_GPU_VENDOR_UNKNOWN;
}

static void
proton_plus_widgets_games_mass_edit_view_finalize (GObject * obj)
{
	ProtonPlusWidgetsGamesMassEditView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_GAMES_TYPE_MASS_EDIT_VIEW, ProtonPlusWidgetsGamesMassEditView);
	_g_object_unref0 (self->priv->clear_button);
	_g_object_unref0 (self->priv->apply_button);
	_g_object_unref0 (self->priv->selection_button);
	_g_object_unref0 (self->priv->_header_bar);
	_g_object_unref0 (self->priv->_content_clamp);
	_g_object_unref0 (self->priv->_scrolled_window);
	_g_object_unref0 (self->priv->_compatibility_tool_row);
	_g_object_unref0 (self->priv->_compatibility_tool_group);
	_g_object_unref0 (self->priv->_launch_options_group);
	_g_object_unref0 (self->priv->_compatibility_tool_switch);
	_g_object_unref0 (self->priv->_launch_options_switch);
	_g_object_unref0 (self->priv->_launch_options_editor);
	_g_object_unref0 (self->priv->_content_box);
	_g_object_unref0 (self->priv->_batch_hint);
	self->rows = (_vala_array_free (self->rows, self->rows_length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (self->priv->capability_resolver);
	_g_object_unref0 (self->priv->compatibility_tools_by_id);
	G_OBJECT_CLASS (proton_plus_widgets_games_mass_edit_view_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_games_mass_edit_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsGamesMassEditViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_games_mass_edit_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsGamesMassEditView), 0, (GInstanceInitFunc) proton_plus_widgets_games_mass_edit_view_instance_init, NULL };
	GType proton_plus_widgets_games_mass_edit_view_type_id;
	proton_plus_widgets_games_mass_edit_view_type_id = g_type_register_static (gtk_box_get_type (), "ProtonPlusWidgetsGamesMassEditView", &g_define_type_info, 0);
	ProtonPlusWidgetsGamesMassEditView_private_offset = g_type_add_instance_private (proton_plus_widgets_games_mass_edit_view_type_id, sizeof (ProtonPlusWidgetsGamesMassEditViewPrivate));
	return proton_plus_widgets_games_mass_edit_view_type_id;
}

GType
proton_plus_widgets_games_mass_edit_view_get_type (void)
{
	static volatile gsize proton_plus_widgets_games_mass_edit_view_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_games_mass_edit_view_type_id__once)) {
		GType proton_plus_widgets_games_mass_edit_view_type_id;
		proton_plus_widgets_games_mass_edit_view_type_id = proton_plus_widgets_games_mass_edit_view_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_games_mass_edit_view_type_id__once, proton_plus_widgets_games_mass_edit_view_type_id);
	}
	return proton_plus_widgets_games_mass_edit_view_type_id__once;
}

static void
_vala_proton_plus_widgets_games_mass_edit_view_get_property (GObject * object,
                                                             guint property_id,
                                                             GValue * value,
                                                             GParamSpec * pspec)
{
	ProtonPlusWidgetsGamesMassEditView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_GAMES_TYPE_MASS_EDIT_VIEW, ProtonPlusWidgetsGamesMassEditView);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_widgets_games_mass_edit_view_set_property (GObject * object,
                                                             guint property_id,
                                                             const GValue * value,
                                                             GParamSpec * pspec)
{
	ProtonPlusWidgetsGamesMassEditView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_GAMES_TYPE_MASS_EDIT_VIEW, ProtonPlusWidgetsGamesMassEditView);
	switch (property_id) {
		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);
}

