/* launch-options-editor-box.c generated by valac 0.56.19, the Vala compiler
 * generated from launch-options-editor-box.vala, do not modify */

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

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

#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_PREVIEW_FIELD (proton_plus_widgets_games_launch_options_editor_launch_option_preview_field_get_type ())
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_PREVIEW_FIELD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_PREVIEW_FIELD, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPreviewField))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_PREVIEW_FIELD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_PREVIEW_FIELD, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPreviewFieldClass))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_IS_LAUNCH_OPTION_PREVIEW_FIELD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_PREVIEW_FIELD))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_IS_LAUNCH_OPTION_PREVIEW_FIELD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_PREVIEW_FIELD))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_PREVIEW_FIELD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_PREVIEW_FIELD, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPreviewFieldClass))

typedef struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPreviewField ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPreviewField;
typedef struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPreviewFieldClass ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPreviewFieldClass;
enum  {
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_0_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_PROJECTION_STATE_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_MANAGED_CANDIDATE_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_HAS_MANAGED_CANDIDATE_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_PROJECTION_DIAGNOSTICS_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_PROJECTION_COMPOSITION_DIAGNOSTICS_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_IS_DIRTY_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_WRITING_ALLOWED_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_WRITE_DIAGNOSTICS_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_games_launch_options_editor_box_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_CONTENT_CHANGED_SIGNAL,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_NUM_SIGNALS
};
static guint proton_plus_widgets_games_launch_options_editor_box_signals[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_NUM_SIGNALS] = {0};
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _ProtonPlusWidgetsGamesLaunchOptionsEditorBoxPrivate {
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsProtonOptionsGroup* _proton_options_group;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup* _audio_group;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsMoreOptionsGroup* _more_options_group;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGameArgumentsGroup* _game_arguments_group;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroup* _advanced_options_group;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsCommonOptionsGroup* _common_group;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsDxvkOptionsGroup* _dxvk_options_group;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsVkd3dOptionsGroup* vkd3d_options_group;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorOptionsGroup* gpu_vendor_group;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsWrapperGroup* wrapper_group;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPreviewField* _preview_field;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionsList* launch_option_handlers;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCatalog* catalog;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* presentations;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandEditorProjection* projection;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriter* writer;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCapabilityResolver* capability_resolver;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandCapabilityContext* capability_context;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandEditState* edit_state;
	gchar* loaded_source;
	GeeArrayList* preview_source_labels;
	GeeArrayList* preview_sources;
	AdwEntryRow* _search_entry;
	AdwComboRow* _category_filter;
	GeeArrayList* category_filter_views;
	GtkLabel* _no_results_label;
	GtkBox* _categories_box;
	GeeHashMap* category_boxes;
	GeeHashMap* subsection_groups;
	gboolean refreshing_controls;
	gboolean updating_category_filter;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCategory* canonical_categories;
	gint canonical_categories_length1;
	gint _canonical_categories_size_;
};

static gint ProtonPlusWidgetsGamesLaunchOptionsEditorBox_private_offset;
static gpointer proton_plus_widgets_games_launch_options_editor_box_parent_class = NULL;

VALA_EXTERN GType proton_plus_widgets_games_launch_options_editor_launch_option_preview_field_get_type (void) G_GNUC_CONST ;
static GtkWidget* proton_plus_widgets_games_launch_options_editor_box_create_navigation (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self);
static void proton_plus_widgets_games_launch_options_editor_box_set_search_entry (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                           AdwEntryRow* value);
static AdwEntryRow* proton_plus_widgets_games_launch_options_editor_box_get_search_entry (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self);
static void proton_plus_widgets_games_launch_options_editor_box_refresh_filters (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self);
static void _proton_plus_widgets_games_launch_options_editor_box_refresh_filters_gtk_editable_changed (GtkEditable* _sender,
                                                                                                gpointer self);
static void proton_plus_widgets_games_launch_options_editor_box_set_category_filter (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                              AdwComboRow* value);
static void __lambda161_ (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                   GObject* object);
static void ___lambda161__gtk_signal_list_item_factory_setup (GtkSignalListItemFactory* _sender,
                                                       GObject* object,
                                                       gpointer self);
static void __lambda162_ (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                   GObject* object);
static void ___lambda162__gtk_signal_list_item_factory_bind (GtkSignalListItemFactory* _sender,
                                                      GObject* object,
                                                      gpointer self);
static AdwComboRow* proton_plus_widgets_games_launch_options_editor_box_get_category_filter (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self);
static void __lambda163_ (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self);
static void ___lambda163__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPreviewField* proton_plus_widgets_games_launch_options_editor_box_get_preview_field (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self);
static void proton_plus_widgets_games_launch_options_editor_box_build_task_categories (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self);
static GtkBox* proton_plus_widgets_games_launch_options_editor_box_get_categories_box (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self);
static GtkBox* proton_plus_widgets_games_launch_options_editor_box_create_category_box (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                                 ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCategory category);
static AdwPreferencesGroup* proton_plus_widgets_games_launch_options_editor_box_get_subsection_group (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                                               ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCategory category,
                                                                                               const gchar* subsection);
static void proton_plus_widgets_games_launch_options_editor_box_move_display_rows_into_backend_group (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self);
static void proton_plus_widgets_games_launch_options_editor_box_collapse_raw_command_control (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self);
VALA_EXTERN void proton_plus_widgets_games_launch_options_editor_groups_wrapper_group_reset_controls (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsWrapperGroup* self);
VALA_EXTERN void proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_options_group_normalize_dependencies (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorOptionsGroup* self);
static GeeArrayList* proton_plus_widgets_games_launch_options_editor_box_collect_sources (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                                   gboolean exclude_unavailable);
static void proton_plus_widgets_games_launch_options_editor_box_refresh_state (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                        gboolean notify_change);
static GeeArrayList* proton_plus_widgets_games_launch_options_editor_box_collect_managed_selections (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                                              GeeCollection* diagnostics);
VALA_EXTERN void proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_options_group_reset_controls (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorOptionsGroup* self);
static ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroup* proton_plus_widgets_games_launch_options_editor_box_get_advanced_options_group (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self);
VALA_EXTERN void proton_plus_widgets_games_launch_options_editor_groups_wrapper_group_normalize_selection (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsWrapperGroup* self);
static void proton_plus_widgets_games_launch_options_editor_box_refresh_preview (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self);
static void proton_plus_widgets_games_launch_options_editor_box_standard_control_changed (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self);
static void proton_plus_widgets_games_launch_options_editor_box_refresh_projection (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self);
static ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionView proton_plus_widgets_games_launch_options_editor_box_get_selected_view (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self);
VALA_EXTERN void proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_options_group_set_presentation_visible (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorOptionsGroup* self,
                                                                                                               gboolean visible);
static GtkLabel* proton_plus_widgets_games_launch_options_editor_box_get_no_results_label (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self);
static gboolean proton_plus_widgets_games_launch_options_editor_box_update_category_filter_options (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                                             ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionView preferred_view);
static gboolean proton_plus_widgets_games_launch_options_editor_box_category_has_dropdown_content (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                                            ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCategory category);
static gboolean proton_plus_widgets_games_launch_options_editor_box_views_equal (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                          GeeList* first,
                                                                          GeeList* second);
VALA_EXTERN GtkLabel* proton_plus_widgets_games_launch_options_editor_launch_option_preview_field_get_preview_label (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPreviewField* self);
VALA_EXTERN void proton_plus_widgets_games_launch_options_editor_launch_option_preview_field_set_empty (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPreviewField* self,
                                                                                            gboolean empty);
VALA_EXTERN void proton_plus_widgets_games_launch_options_editor_launch_option_preview_field_set_attention_required (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPreviewField* self,
                                                                                                         gboolean required,
                                                                                                         const gchar* reason);
static ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsProtonOptionsGroup* proton_plus_widgets_games_launch_options_editor_box_get_proton_options_group (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self);
static void proton_plus_widgets_games_launch_options_editor_box_set_proton_options_group (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                                   ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsProtonOptionsGroup* value);
static ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup* proton_plus_widgets_games_launch_options_editor_box_get_audio_group (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self);
static void proton_plus_widgets_games_launch_options_editor_box_set_audio_group (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                          ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup* value);
static ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsMoreOptionsGroup* proton_plus_widgets_games_launch_options_editor_box_get_more_options_group (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self);
static void proton_plus_widgets_games_launch_options_editor_box_set_more_options_group (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                                 ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsMoreOptionsGroup* value);
static ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGameArgumentsGroup* proton_plus_widgets_games_launch_options_editor_box_get_game_arguments_group (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self);
static void proton_plus_widgets_games_launch_options_editor_box_set_game_arguments_group (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                                   ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGameArgumentsGroup* value);
static void proton_plus_widgets_games_launch_options_editor_box_set_advanced_options_group (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                                     ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroup* value);
static ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsCommonOptionsGroup* proton_plus_widgets_games_launch_options_editor_box_get_common_group (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self);
static void proton_plus_widgets_games_launch_options_editor_box_set_common_group (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                           ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsCommonOptionsGroup* value);
static ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsDxvkOptionsGroup* proton_plus_widgets_games_launch_options_editor_box_get_dxvk_options_group (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self);
static void proton_plus_widgets_games_launch_options_editor_box_set_dxvk_options_group (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                                 ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsDxvkOptionsGroup* value);
static void proton_plus_widgets_games_launch_options_editor_box_set_preview_field (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                            ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPreviewField* value);
static void proton_plus_widgets_games_launch_options_editor_box_set_no_results_label (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                               GtkLabel* value);
static void proton_plus_widgets_games_launch_options_editor_box_set_categories_box (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                             GtkBox* value);
static GObject * proton_plus_widgets_games_launch_options_editor_box_constructor (GType type,
                                                                           guint n_construct_properties,
                                                                           GObjectConstructParam * construct_properties);
VALA_EXTERN ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPreviewField* proton_plus_widgets_games_launch_options_editor_launch_option_preview_field_new (const gchar* title);
VALA_EXTERN ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPreviewField* proton_plus_widgets_games_launch_options_editor_launch_option_preview_field_construct (GType object_type,
                                                                                                                                                          const gchar* title);
static void _proton_plus_widgets_games_launch_options_editor_box_standard_control_changed_proton_plus_widgets_games_launch_options_editor_groups_base_options_group_changed (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup* _sender,
                                                                                                                                                                      gpointer self);
static void _proton_plus_widgets_games_launch_options_editor_box_standard_control_changed_proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_options_group_changed (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorOptionsGroup* _sender,
                                                                                                                                                                            gpointer self);
VALA_EXTERN void proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_options_group_set_advanced_visible (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorOptionsGroup* self,
                                                                                                           gboolean visible);
static void proton_plus_widgets_games_launch_options_editor_box_finalize (GObject * obj);
static GType proton_plus_widgets_games_launch_options_editor_box_get_type_once (void);
static void _vala_proton_plus_widgets_games_launch_options_editor_box_get_property (GObject * object,
                                                                             guint property_id,
                                                                             GValue * value,
                                                                             GParamSpec * pspec);
static void _vala_proton_plus_widgets_games_launch_options_editor_box_set_property (GObject * object,
                                                                             guint property_id,
                                                                             const GValue * value,
                                                                             GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
proton_plus_widgets_games_launch_options_editor_box_get_instance_private (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsGamesLaunchOptionsEditorBox_private_offset);
}

static void
_proton_plus_widgets_games_launch_options_editor_box_refresh_filters_gtk_editable_changed (GtkEditable* _sender,
                                                                                           gpointer self)
{
	proton_plus_widgets_games_launch_options_editor_box_refresh_filters ((ProtonPlusWidgetsGamesLaunchOptionsEditorBox*) self);
}

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

static void
__lambda161_ (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
              GObject* object)
{
	GtkListItem* list_item = NULL;
	GtkListItem* _tmp0_;
	GtkLabel* label = NULL;
	GtkLabel* _tmp1_;
	GtkLabel* _tmp2_;
	g_return_if_fail (object != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (object, gtk_list_item_get_type ()) ? ((GtkListItem*) object) : NULL);
	list_item = _tmp0_;
	_tmp1_ = (GtkLabel*) gtk_label_new (NULL);
	g_object_ref_sink (_tmp1_);
	label = _tmp1_;
	gtk_label_set_xalign (label, (gfloat) 0);
	gtk_label_set_ellipsize (label, PANGO_ELLIPSIZE_END);
	gtk_widget_set_hexpand ((GtkWidget*) label, TRUE);
	_tmp2_ = _g_object_ref0 (label);
	g_object_set_data_full (object, "category-label", _tmp2_, g_object_unref);
	gtk_list_item_set_child (list_item, (GtkWidget*) label);
	_g_object_unref0 (label);
	_g_object_unref0 (list_item);
}

static void
___lambda161__gtk_signal_list_item_factory_setup (GtkSignalListItemFactory* _sender,
                                                  GObject* object,
                                                  gpointer self)
{
	__lambda161_ ((ProtonPlusWidgetsGamesLaunchOptionsEditorBox*) self, object);
}

static void
__lambda162_ (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
              GObject* object)
{
	GtkListItem* list_item = NULL;
	GtkListItem* _tmp0_;
	GtkStringObject* category = NULL;
	GtkListItem* _tmp1_;
	GObject* _tmp2_;
	GtkStringObject* _tmp3_;
	GtkLabel* label = NULL;
	gconstpointer _tmp4_;
	GtkLabel* _tmp5_;
	gboolean _tmp6_ = FALSE;
	GtkStringObject* _tmp7_;
	GtkLabel* _tmp9_;
	GtkStringObject* _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	GtkLabel* _tmp13_;
	GtkStringObject* _tmp14_;
	const gchar* _tmp15_;
	const gchar* _tmp16_;
	g_return_if_fail (object != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (object, gtk_list_item_get_type ()) ? ((GtkListItem*) object) : NULL);
	list_item = _tmp0_;
	_tmp1_ = list_item;
	_tmp2_ = gtk_list_item_get_item (_tmp1_);
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, gtk_string_object_get_type ()) ? ((GtkStringObject*) _tmp2_) : NULL);
	category = _tmp3_;
	_tmp4_ = g_object_get_data (object, "category-label");
	_tmp5_ = _g_object_ref0 ((GtkLabel*) _tmp4_);
	label = _tmp5_;
	_tmp7_ = category;
	if (_tmp7_ == NULL) {
		_tmp6_ = TRUE;
	} else {
		GtkLabel* _tmp8_;
		_tmp8_ = label;
		_tmp6_ = _tmp8_ == NULL;
	}
	if (_tmp6_) {
		_g_object_unref0 (label);
		_g_object_unref0 (category);
		_g_object_unref0 (list_item);
		return;
	}
	_tmp9_ = label;
	_tmp10_ = category;
	_tmp11_ = gtk_string_object_get_string (_tmp10_);
	_tmp12_ = _tmp11_;
	gtk_label_set_label (_tmp9_, _tmp12_);
	_tmp13_ = label;
	_tmp14_ = category;
	_tmp15_ = gtk_string_object_get_string (_tmp14_);
	_tmp16_ = _tmp15_;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp13_, _tmp16_);
	_g_object_unref0 (label);
	_g_object_unref0 (category);
	_g_object_unref0 (list_item);
}

static void
___lambda162__gtk_signal_list_item_factory_bind (GtkSignalListItemFactory* _sender,
                                                 GObject* object,
                                                 gpointer self)
{
	__lambda162_ ((ProtonPlusWidgetsGamesLaunchOptionsEditorBox*) self, object);
}

static void
__lambda163_ (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	if (!self->priv->updating_category_filter) {
		proton_plus_widgets_games_launch_options_editor_box_refresh_filters (self);
	}
}

static void
___lambda163__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda163_ ((ProtonPlusWidgetsGamesLaunchOptionsEditorBox*) self);
}

static GtkWidget*
proton_plus_widgets_games_launch_options_editor_box_create_navigation (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	AdwPreferencesGroup* group = NULL;
	gchar* _tmp0_;
	AdwPreferencesGroup* _tmp1_ = NULL;
	gchar* _tmp2_;
	AdwEntryRow* _tmp3_ = NULL;
	AdwEntryRow* _tmp4_;
	AdwEntryRow* _tmp5_;
	AdwEntryRow* _tmp6_;
	AdwEntryRow* _tmp7_;
	AdwPreferencesGroup* _tmp8_;
	AdwEntryRow* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar** _tmp14_;
	gchar** _tmp15_;
	gint _tmp15__length1;
	GtkStringList* _tmp16_;
	AdwComboRow* _tmp17_ = NULL;
	AdwComboRow* _tmp18_;
	GeeArrayList* _tmp19_;
	GeeArrayList* _tmp20_;
	GeeArrayList* _tmp21_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCategory* _tmp22_;
	gint _tmp22__length1;
	GtkSignalListItemFactory* category_factory = NULL;
	GtkSignalListItemFactory* _tmp24_;
	AdwComboRow* _tmp25_;
	AdwComboRow* _tmp26_;
	AdwComboRow* _tmp27_;
	const gchar* _tmp28_;
	const gchar* _tmp29_;
	AdwComboRow* _tmp30_;
	AdwPreferencesGroup* _tmp31_;
	AdwComboRow* _tmp32_;
	AdwPreferencesGroup* _tmp33_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPreviewField* _tmp34_;
	GtkWidget* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (_ ("Launch options"));
	_tmp1_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	adw_preferences_group_set_title (_tmp1_, _tmp0_);
	_g_free0 (_tmp0_);
	g_object_ref_sink (_tmp1_);
	group = _tmp1_;
	_tmp2_ = g_strdup (_ ("Search all options"));
	_tmp3_ = (AdwEntryRow*) adw_entry_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp3_, _tmp2_);
	_g_free0 (_tmp2_);
	g_object_ref_sink (_tmp3_);
	_tmp4_ = _tmp3_;
	proton_plus_widgets_games_launch_options_editor_box_set_search_entry (self, _tmp4_);
	_g_object_unref0 (_tmp4_);
	_tmp5_ = self->priv->_search_entry;
	proton_plus_utils_text_input_metadata_policy_apply ((GtkWidget*) _tmp5_, PROTON_PLUS_UTILS_TEXT_INPUT_FIELD_KIND_SEARCH);
	_tmp6_ = self->priv->_search_entry;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp6_, _ ("Search launch options"));
	_tmp7_ = self->priv->_search_entry;
	g_signal_connect_object ((GtkEditable*) _tmp7_, "changed", (GCallback) _proton_plus_widgets_games_launch_options_editor_box_refresh_filters_gtk_editable_changed, self, 0);
	_tmp8_ = group;
	_tmp9_ = self->priv->_search_entry;
	adw_preferences_group_add (_tmp8_, (GtkWidget*) _tmp9_);
	_tmp10_ = g_strdup (_ ("Browse"));
	_tmp11_ = g_strdup (_ ("Quick settings"));
	_tmp12_ = g_strdup (_ ("Active options"));
	_tmp13_ = g_strdup (_ ("All options"));
	_tmp14_ = g_new0 (gchar*, 3 + 1);
	_tmp14_[0] = _tmp11_;
	_tmp14_[1] = _tmp12_;
	_tmp14_[2] = _tmp13_;
	_tmp15_ = _tmp14_;
	_tmp15__length1 = 3;
	_tmp16_ = gtk_string_list_new (_tmp15_);
	_tmp17_ = (AdwComboRow*) adw_combo_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp17_, _tmp10_);
	_g_free0 (_tmp10_);
	adw_combo_row_set_model (_tmp17_, (GListModel*) _tmp16_);
	_g_object_unref0 (_tmp16_);
	adw_combo_row_set_selected (_tmp17_, (guint) 0);
	g_object_ref_sink (_tmp17_);
	_tmp18_ = _tmp17_;
	proton_plus_widgets_games_launch_options_editor_box_set_category_filter (self, _tmp18_);
	_g_object_unref0 (_tmp18_);
	_tmp15_ = (_vala_array_free (_tmp15_, _tmp15__length1, (GDestroyNotify) g_free), NULL);
	_tmp19_ = self->priv->category_filter_views;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp19_, (gpointer) ((gintptr) PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_VIEW_QUICK));
	_tmp20_ = self->priv->category_filter_views;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp20_, (gpointer) ((gintptr) PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_VIEW_ACTIVE));
	_tmp21_ = self->priv->category_filter_views;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp21_, (gpointer) ((gintptr) PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_VIEW_ALL));
	_tmp22_ = self->priv->canonical_categories;
	_tmp22__length1 = self->priv->canonical_categories_length1;
	{
		ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCategory* category_collection = NULL;
		gint category_collection_length1 = 0;
		gint _category_collection_size_ = 0;
		gint category_it = 0;
		category_collection = _tmp22_;
		category_collection_length1 = _tmp22__length1;
		for (category_it = 0; category_it < category_collection_length1; category_it = category_it + 1) {
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCategory category = 0;
			category = category_collection[category_it];
			{
				GeeArrayList* _tmp23_;
				_tmp23_ = self->priv->category_filter_views;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp23_, (gpointer) ((gintptr) proton_plus_widgets_games_launch_options_editor_launch_option_catalog_category_view (category)));
			}
		}
	}
	_tmp24_ = (GtkSignalListItemFactory*) gtk_signal_list_item_factory_new ();
	category_factory = _tmp24_;
	g_signal_connect_object (category_factory, "setup", (GCallback) ___lambda161__gtk_signal_list_item_factory_setup, self, 0);
	g_signal_connect_object (category_factory, "bind", (GCallback) ___lambda162__gtk_signal_list_item_factory_bind, self, 0);
	_tmp25_ = self->priv->_category_filter;
	adw_combo_row_set_list_factory (_tmp25_, (GtkListItemFactory*) category_factory);
	_tmp26_ = self->priv->_category_filter;
	_tmp27_ = self->priv->_category_filter;
	_tmp28_ = adw_preferences_row_get_title ((AdwPreferencesRow*) _tmp27_);
	_tmp29_ = _tmp28_;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp26_, _tmp29_);
	_tmp30_ = self->priv->_category_filter;
	g_signal_connect_object ((GObject*) _tmp30_, "notify::selected", (GCallback) ___lambda163__g_object_notify, self, 0);
	_tmp31_ = group;
	_tmp32_ = self->priv->_category_filter;
	adw_preferences_group_add (_tmp31_, (GtkWidget*) _tmp32_);
	_tmp33_ = group;
	_tmp34_ = self->priv->_preview_field;
	adw_preferences_group_add (_tmp33_, (GtkWidget*) _tmp34_);
	result = (GtkWidget*) group;
	_g_object_unref0 (category_factory);
	return result;
}

static void
proton_plus_widgets_games_launch_options_editor_box_build_task_categories (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCategory* _tmp0_;
	gint _tmp0__length1;
	GeeHashMap* _tmp40_;
	gpointer _tmp41_;
	GtkBox* _tmp42_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsWrapperGroup* _tmp43_;
	GeeHashMap* _tmp44_;
	gpointer _tmp45_;
	GtkBox* _tmp46_;
	GtkWidget* _tmp47_;
	GeeHashMap* _tmp48_;
	gpointer _tmp49_;
	GtkBox* _tmp50_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorOptionsGroup* _tmp51_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->canonical_categories;
	_tmp0__length1 = self->priv->canonical_categories_length1;
	{
		ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCategory* category_collection = NULL;
		gint category_collection_length1 = 0;
		gint _category_collection_size_ = 0;
		gint category_it = 0;
		category_collection = _tmp0_;
		category_collection_length1 = _tmp0__length1;
		for (category_it = 0; category_it < category_collection_length1; category_it = category_it + 1) {
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCategory category = 0;
			category = category_collection[category_it];
			{
				GtkBox* _tmp1_;
				GtkBox* _tmp2_;
				GtkBox* _tmp3_;
				_tmp1_ = self->priv->_categories_box;
				_tmp2_ = proton_plus_widgets_games_launch_options_editor_box_create_category_box (self, category);
				_tmp3_ = _tmp2_;
				gtk_box_append (_tmp1_, (GtkWidget*) _tmp3_);
				_g_object_unref0 (_tmp3_);
			}
		}
	}
	{
		GeeList* _presentation_list = NULL;
		ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* _tmp4_;
		GeeList* _tmp5_;
		gint _presentation_size = 0;
		GeeList* _tmp6_;
		gint _tmp7_;
		gint _tmp8_;
		gint _presentation_index = 0;
		_tmp4_ = self->priv->presentations;
		_tmp5_ = proton_plus_widgets_games_launch_options_editor_launch_option_presentation_registry_get_ordered (_tmp4_);
		_presentation_list = _tmp5_;
		_tmp6_ = _presentation_list;
		_tmp7_ = gee_collection_get_size ((GeeCollection*) _tmp6_);
		_tmp8_ = _tmp7_;
		_presentation_size = _tmp8_;
		_presentation_index = -1;
		while (TRUE) {
			gint _tmp9_;
			gint _tmp10_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentation* presentation = NULL;
			GeeList* _tmp11_;
			gpointer _tmp12_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentation* _tmp13_;
			gboolean _tmp14_;
			gboolean _tmp15_;
			AdwPreferencesGroup* section = NULL;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentation* _tmp16_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionMetadata* _tmp17_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionMetadata* _tmp18_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCategory _tmp19_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCategory _tmp20_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentation* _tmp21_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionMetadata* _tmp22_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionMetadata* _tmp23_;
			const gchar* _tmp24_;
			const gchar* _tmp25_;
			AdwPreferencesGroup* _tmp26_;
			_presentation_index = _presentation_index + 1;
			_tmp9_ = _presentation_index;
			_tmp10_ = _presentation_size;
			if (!(_tmp9_ < _tmp10_)) {
				break;
			}
			_tmp11_ = _presentation_list;
			_tmp12_ = gee_list_get (_tmp11_, _presentation_index);
			presentation = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentation*) _tmp12_;
			_tmp13_ = presentation;
			_tmp14_ = proton_plus_widgets_games_launch_options_editor_launch_option_presentation_get_movable (_tmp13_);
			_tmp15_ = _tmp14_;
			if (!_tmp15_) {
				_g_object_unref0 (presentation);
				continue;
			}
			_tmp16_ = presentation;
			_tmp17_ = proton_plus_widgets_games_launch_options_editor_launch_option_presentation_get_metadata (_tmp16_);
			_tmp18_ = _tmp17_;
			_tmp19_ = proton_plus_widgets_games_launch_options_editor_launch_option_metadata_get_category (_tmp18_);
			_tmp20_ = _tmp19_;
			_tmp21_ = presentation;
			_tmp22_ = proton_plus_widgets_games_launch_options_editor_launch_option_presentation_get_metadata (_tmp21_);
			_tmp23_ = _tmp22_;
			_tmp24_ = proton_plus_widgets_games_launch_options_editor_launch_option_metadata_get_subsection (_tmp23_);
			_tmp25_ = _tmp24_;
			_tmp26_ = proton_plus_widgets_games_launch_options_editor_box_get_subsection_group (self, _tmp20_, _tmp25_);
			section = _tmp26_;
			{
				GeeArrayList* _widget_list = NULL;
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentation* _tmp27_;
				GeeArrayList* _tmp28_;
				GeeArrayList* _tmp29_;
				gint _widget_size = 0;
				GeeArrayList* _tmp30_;
				gint _tmp31_;
				gint _tmp32_;
				gint _widget_index = 0;
				_tmp27_ = presentation;
				_tmp28_ = proton_plus_widgets_games_launch_options_editor_launch_option_presentation_get_widgets (_tmp27_);
				_tmp29_ = _tmp28_;
				_widget_list = _tmp29_;
				_tmp30_ = _widget_list;
				_tmp31_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp30_);
				_tmp32_ = _tmp31_;
				_widget_size = _tmp32_;
				_widget_index = -1;
				while (TRUE) {
					gint _tmp33_;
					gint _tmp34_;
					GtkWidget* widget = NULL;
					GeeArrayList* _tmp35_;
					gpointer _tmp36_;
					GtkWidget* _tmp37_;
					AdwPreferencesGroup* _tmp38_;
					GtkWidget* _tmp39_;
					_widget_index = _widget_index + 1;
					_tmp33_ = _widget_index;
					_tmp34_ = _widget_size;
					if (!(_tmp33_ < _tmp34_)) {
						break;
					}
					_tmp35_ = _widget_list;
					_tmp36_ = gee_abstract_list_get ((GeeAbstractList*) _tmp35_, _widget_index);
					widget = (GtkWidget*) _tmp36_;
					_tmp37_ = widget;
					gtk_widget_unparent (_tmp37_);
					_tmp38_ = section;
					_tmp39_ = widget;
					adw_preferences_group_add (_tmp38_, _tmp39_);
					_g_object_unref0 (widget);
				}
			}
			_g_object_unref0 (section);
			_g_object_unref0 (presentation);
		}
		_g_object_unref0 (_presentation_list);
	}
	proton_plus_widgets_games_launch_options_editor_box_move_display_rows_into_backend_group (self);
	proton_plus_widgets_games_launch_options_editor_box_collapse_raw_command_control (self);
	_tmp40_ = self->priv->category_boxes;
	_tmp41_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp40_, (gpointer) ((gintptr) PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CATEGORY_DISPLAY));
	_tmp42_ = (GtkBox*) _tmp41_;
	_tmp43_ = self->priv->wrapper_group;
	_tmp44_ = self->priv->category_boxes;
	_tmp45_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp44_, (gpointer) ((gintptr) PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CATEGORY_DISPLAY));
	_tmp46_ = (GtkBox*) _tmp45_;
	_tmp47_ = gtk_widget_get_first_child ((GtkWidget*) _tmp46_);
	gtk_box_insert_child_after (_tmp42_, (GtkWidget*) _tmp43_, _tmp47_);
	_g_object_unref0 (_tmp46_);
	_g_object_unref0 (_tmp42_);
	_tmp48_ = self->priv->category_boxes;
	_tmp49_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp48_, (gpointer) ((gintptr) PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CATEGORY_HARDWARE));
	_tmp50_ = (GtkBox*) _tmp49_;
	_tmp51_ = self->priv->gpu_vendor_group;
	gtk_box_append (_tmp50_, (GtkWidget*) _tmp51_);
	_g_object_unref0 (_tmp50_);
}

static void
proton_plus_widgets_games_launch_options_editor_box_move_display_rows_into_backend_group (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	gchar** display_rows = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar** _tmp3_;
	gint display_rows_length1;
	gint _display_rows_size_;
	gchar** _tmp4_;
	gint _tmp4__length1;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup ("native-wayland");
	_tmp1_ = g_strdup ("desktop-game-profile");
	_tmp2_ = g_strdup ("vkbasalt");
	_tmp3_ = g_new0 (gchar*, 3 + 1);
	_tmp3_[0] = _tmp0_;
	_tmp3_[1] = _tmp1_;
	_tmp3_[2] = _tmp2_;
	display_rows = _tmp3_;
	display_rows_length1 = 3;
	_display_rows_size_ = display_rows_length1;
	_tmp4_ = display_rows;
	_tmp4__length1 = display_rows_length1;
	{
		gchar** id_collection = NULL;
		gint id_collection_length1 = 0;
		gint _id_collection_size_ = 0;
		gint id_it = 0;
		id_collection = _tmp4_;
		id_collection_length1 = _tmp4__length1;
		for (id_it = 0; id_it < id_collection_length1; id_it = id_it + 1) {
			gchar* _tmp5_;
			gchar* id = NULL;
			_tmp5_ = g_strdup (id_collection[id_it]);
			id = _tmp5_;
			{
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentation* presentation = NULL;
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* _tmp6_;
				const gchar* _tmp7_;
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentation* _tmp8_;
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentation* _tmp9_;
				_tmp6_ = self->priv->presentations;
				_tmp7_ = id;
				_tmp8_ = proton_plus_widgets_games_launch_options_editor_launch_option_presentation_registry_lookup (_tmp6_, _tmp7_);
				presentation = _tmp8_;
				_tmp9_ = presentation;
				if (_tmp9_ == NULL) {
					_g_object_unref0 (presentation);
					_g_free0 (id);
					continue;
				}
				{
					GeeArrayList* _widget_list = NULL;
					ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentation* _tmp10_;
					GeeArrayList* _tmp11_;
					GeeArrayList* _tmp12_;
					gint _widget_size = 0;
					GeeArrayList* _tmp13_;
					gint _tmp14_;
					gint _tmp15_;
					gint _widget_index = 0;
					_tmp10_ = presentation;
					_tmp11_ = proton_plus_widgets_games_launch_options_editor_launch_option_presentation_get_widgets (_tmp10_);
					_tmp12_ = _tmp11_;
					_widget_list = _tmp12_;
					_tmp13_ = _widget_list;
					_tmp14_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp13_);
					_tmp15_ = _tmp14_;
					_widget_size = _tmp15_;
					_widget_index = -1;
					while (TRUE) {
						gint _tmp16_;
						gint _tmp17_;
						GtkWidget* widget = NULL;
						GeeArrayList* _tmp18_;
						gpointer _tmp19_;
						GtkWidget* _tmp20_;
						ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsWrapperGroup* _tmp21_;
						GtkWidget* _tmp22_;
						_widget_index = _widget_index + 1;
						_tmp16_ = _widget_index;
						_tmp17_ = _widget_size;
						if (!(_tmp16_ < _tmp17_)) {
							break;
						}
						_tmp18_ = _widget_list;
						_tmp19_ = gee_abstract_list_get ((GeeAbstractList*) _tmp18_, _widget_index);
						widget = (GtkWidget*) _tmp19_;
						_tmp20_ = widget;
						gtk_widget_unparent (_tmp20_);
						_tmp21_ = self->priv->wrapper_group;
						_tmp22_ = widget;
						proton_plus_widgets_games_launch_options_editor_groups_wrapper_group_insert_before_backend_options (_tmp21_, _tmp22_);
						_g_object_unref0 (widget);
					}
				}
				_g_object_unref0 (presentation);
				_g_free0 (id);
			}
		}
	}
	display_rows = (_vala_array_free (display_rows, display_rows_length1, (GDestroyNotify) g_free), NULL);
}

static void
proton_plus_widgets_games_launch_options_editor_box_collapse_raw_command_control (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentation* command = NULL;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* _tmp0_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentation* _tmp1_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentation* _tmp2_;
	AdwExpanderRow* disclosure = NULL;
	gchar* _tmp3_;
	gchar* _tmp4_;
	AdwExpanderRow* _tmp5_ = NULL;
	AdwExpanderRow* _tmp6_;
	AdwExpanderRow* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* _tmp23_;
	AdwExpanderRow* _tmp24_;
	AdwPreferencesGroup* _tmp25_;
	AdwPreferencesGroup* _tmp26_;
	AdwExpanderRow* _tmp27_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->presentations;
	_tmp1_ = proton_plus_widgets_games_launch_options_editor_launch_option_presentation_registry_lookup (_tmp0_, "steam-command");
	command = _tmp1_;
	_tmp2_ = command;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (command);
		return;
	}
	_tmp3_ = g_strdup (_ ("Raw command controls"));
	_tmp4_ = g_strdup (_ ("Change the Steam command placeholder only when a game requires it."));
	_tmp5_ = (AdwExpanderRow*) adw_expander_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp5_, _tmp3_);
	_g_free0 (_tmp3_);
	adw_expander_row_set_subtitle (_tmp5_, _tmp4_);
	_g_free0 (_tmp4_);
	adw_expander_row_set_expanded (_tmp5_, FALSE);
	g_object_ref_sink (_tmp5_);
	disclosure = _tmp5_;
	_tmp6_ = disclosure;
	_tmp7_ = disclosure;
	_tmp8_ = adw_expander_row_get_subtitle (_tmp7_);
	_tmp9_ = _tmp8_;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp6_, _tmp9_);
	{
		GeeArrayList* _widget_list = NULL;
		ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentation* _tmp10_;
		GeeArrayList* _tmp11_;
		GeeArrayList* _tmp12_;
		gint _widget_size = 0;
		GeeArrayList* _tmp13_;
		gint _tmp14_;
		gint _tmp15_;
		gint _widget_index = 0;
		_tmp10_ = command;
		_tmp11_ = proton_plus_widgets_games_launch_options_editor_launch_option_presentation_get_widgets (_tmp10_);
		_tmp12_ = _tmp11_;
		_widget_list = _tmp12_;
		_tmp13_ = _widget_list;
		_tmp14_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp13_);
		_tmp15_ = _tmp14_;
		_widget_size = _tmp15_;
		_widget_index = -1;
		while (TRUE) {
			gint _tmp16_;
			gint _tmp17_;
			GtkWidget* widget = NULL;
			GeeArrayList* _tmp18_;
			gpointer _tmp19_;
			GtkWidget* _tmp20_;
			AdwExpanderRow* _tmp21_;
			GtkWidget* _tmp22_;
			_widget_index = _widget_index + 1;
			_tmp16_ = _widget_index;
			_tmp17_ = _widget_size;
			if (!(_tmp16_ < _tmp17_)) {
				break;
			}
			_tmp18_ = _widget_list;
			_tmp19_ = gee_abstract_list_get ((GeeAbstractList*) _tmp18_, _widget_index);
			widget = (GtkWidget*) _tmp19_;
			_tmp20_ = widget;
			gtk_widget_unparent (_tmp20_);
			_tmp21_ = disclosure;
			_tmp22_ = widget;
			adw_expander_row_add_row (_tmp21_, _tmp22_);
			_g_object_unref0 (widget);
		}
	}
	_tmp23_ = self->priv->presentations;
	_tmp24_ = disclosure;
	proton_plus_widgets_games_launch_options_editor_launch_option_presentation_registry_register (_tmp23_, "steam-command", (GtkWidget*) _tmp24_, NULL, TRUE);
	_tmp25_ = proton_plus_widgets_games_launch_options_editor_box_get_subsection_group (self, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CATEGORY_DIAGNOSTICS, "");
	_tmp26_ = _tmp25_;
	_tmp27_ = disclosure;
	adw_preferences_group_add (_tmp26_, (GtkWidget*) _tmp27_);
	_g_object_unref0 (_tmp26_);
	_g_object_unref0 (disclosure);
	_g_object_unref0 (command);
}

static GtkBox*
proton_plus_widgets_games_launch_options_editor_box_create_category_box (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                         ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCategory category)
{
	GtkBox* box = NULL;
	GtkBox* _tmp0_;
	GtkLabel* header = NULL;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar** _tmp4_;
	GtkLabel* _tmp5_ = NULL;
	GtkLabel* _tmp6_;
	GeeHashMap* _tmp7_;
	GtkBox* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
	g_object_ref_sink (_tmp0_);
	box = _tmp0_;
	_tmp1_ = proton_plus_widgets_games_launch_options_editor_launch_option_catalog_category_title (category);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strdup ("title-3");
	_tmp4_ = g_new0 (gchar*, 1 + 1);
	_tmp4_[0] = _tmp3_;
	_tmp5_ = (GtkLabel*) gtk_label_new (_tmp2_);
	gtk_widget_set_halign ((GtkWidget*) _tmp5_, GTK_ALIGN_START);
	gtk_label_set_xalign (_tmp5_, (gfloat) 0);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp5_, _tmp4_);
	_tmp4_ = (_vala_array_free (_tmp4_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp5_);
	_tmp6_ = _tmp5_;
	_g_free0 (_tmp2_);
	header = _tmp6_;
	gtk_box_append (box, (GtkWidget*) header);
	_tmp7_ = self->priv->category_boxes;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp7_, (gpointer) ((gintptr) category), box);
	result = box;
	_g_object_unref0 (header);
	return result;
}

static AdwPreferencesGroup*
proton_plus_widgets_games_launch_options_editor_box_get_subsection_group (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                          ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCategory category,
                                                                          const gchar* subsection)
{
	gchar* key = NULL;
	gchar* _tmp0_;
	AdwPreferencesGroup* group = NULL;
	GeeHashMap* _tmp1_;
	const gchar* _tmp2_;
	gpointer _tmp3_;
	AdwPreferencesGroup* _tmp4_;
	AdwPreferencesGroup* _tmp5_;
	AdwPreferencesGroup* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	GeeHashMap* _tmp10_;
	const gchar* _tmp11_;
	AdwPreferencesGroup* _tmp12_;
	GeeHashMap* _tmp13_;
	gpointer _tmp14_;
	GtkBox* _tmp15_;
	AdwPreferencesGroup* _tmp16_;
	AdwPreferencesGroup* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (subsection != NULL, NULL);
	_tmp0_ = g_strdup_printf ("%d:%s", (gint) category, subsection);
	key = _tmp0_;
	_tmp1_ = self->priv->subsection_groups;
	_tmp2_ = key;
	_tmp3_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp1_, _tmp2_);
	group = (AdwPreferencesGroup*) _tmp3_;
	_tmp4_ = group;
	if (_tmp4_ != NULL) {
		result = group;
		_g_free0 (key);
		return result;
	}
	_tmp5_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	g_object_ref_sink (_tmp5_);
	_g_object_unref0 (group);
	group = _tmp5_;
	if (g_strcmp0 (subsection, "") != 0) {
		AdwPreferencesGroup* _tmp6_;
		_tmp6_ = group;
		adw_preferences_group_set_title (_tmp6_, subsection);
	}
	_tmp7_ = group;
	_tmp8_ = key;
	_tmp9_ = g_strdup (_tmp8_);
	g_object_set_data_full ((GObject*) _tmp7_, "launch-options-subsection-key", _tmp9_, g_free);
	_tmp10_ = self->priv->subsection_groups;
	_tmp11_ = key;
	_tmp12_ = group;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp10_, _tmp11_, _tmp12_);
	_tmp13_ = self->priv->category_boxes;
	_tmp14_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp13_, (gpointer) ((gintptr) category));
	_tmp15_ = (GtkBox*) _tmp14_;
	_tmp16_ = group;
	gtk_box_append (_tmp15_, (GtkWidget*) _tmp16_);
	_g_object_unref0 (_tmp15_);
	result = group;
	_g_free0 (key);
	return result;
}

void
proton_plus_widgets_games_launch_options_editor_box_clear (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionsList* _tmp0_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsWrapperGroup* _tmp1_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorOptionsGroup* _tmp2_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandEditState* _tmp3_;
	GeeArrayList* _tmp4_;
	GeeArrayList* _tmp5_;
	g_return_if_fail (self != NULL);
	self->priv->refreshing_controls = TRUE;
	_tmp0_ = self->priv->launch_option_handlers;
	proton_plus_widgets_games_launch_options_editor_launch_options_list_clear_all (_tmp0_);
	_tmp1_ = self->priv->wrapper_group;
	proton_plus_widgets_games_launch_options_editor_groups_wrapper_group_reset_controls (_tmp1_);
	_tmp2_ = self->priv->gpu_vendor_group;
	proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_options_group_normalize_dependencies (_tmp2_);
	self->priv->refreshing_controls = FALSE;
	_tmp3_ = self->priv->edit_state;
	_tmp4_ = proton_plus_widgets_games_launch_options_editor_box_collect_sources (self, FALSE);
	_tmp5_ = _tmp4_;
	proton_plus_widgets_games_launch_options_editor_launch_command_edit_state_mark_explicit_clear (_tmp3_, (GeeCollection*) _tmp5_);
	_g_object_unref0 (_tmp5_);
	proton_plus_widgets_games_launch_options_editor_box_refresh_state (self, TRUE);
}

gboolean
proton_plus_widgets_games_launch_options_editor_box_has_clearable_state (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandEditState* _tmp6_;
	gboolean _tmp7_;
	gboolean _tmp8_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	{
		GeeIterator* _handler_it = NULL;
		ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionsList* _tmp0_;
		GeeIterator* _tmp1_;
		_tmp0_ = self->priv->launch_option_handlers;
		_tmp1_ = proton_plus_widgets_games_launch_options_editor_launch_options_list_iterator (_tmp0_);
		_handler_it = _tmp1_;
		while (TRUE) {
			GeeIterator* _tmp2_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* handler = NULL;
			GeeIterator* _tmp3_;
			gpointer _tmp4_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* _tmp5_;
			_tmp2_ = _handler_it;
			if (!gee_iterator_next (_tmp2_)) {
				break;
			}
			_tmp3_ = _handler_it;
			_tmp4_ = gee_iterator_get (_tmp3_);
			handler = (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*) _tmp4_;
			_tmp5_ = handler;
			if (proton_plus_widgets_games_launch_options_editor_ilaunch_option_is_active (_tmp5_)) {
				result = TRUE;
				_g_object_unref0 (handler);
				_g_object_unref0 (_handler_it);
				return result;
			}
			_g_object_unref0 (handler);
		}
		_g_object_unref0 (_handler_it);
	}
	_tmp6_ = self->priv->edit_state;
	_tmp7_ = proton_plus_widgets_games_launch_options_editor_launch_command_edit_state_get_explicit_clear (_tmp6_);
	_tmp8_ = _tmp7_;
	if (!_tmp8_) {
		{
			GeeArrayList* _source_list = NULL;
			GeeArrayList* _tmp9_;
			gint _source_size = 0;
			GeeArrayList* _tmp10_;
			gint _tmp11_;
			gint _tmp12_;
			gint _source_index = 0;
			_tmp9_ = self->priv->preview_sources;
			_source_list = _tmp9_;
			_tmp10_ = _source_list;
			_tmp11_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp10_);
			_tmp12_ = _tmp11_;
			_source_size = _tmp12_;
			_source_index = -1;
			while (TRUE) {
				gint _tmp13_;
				gint _tmp14_;
				gchar* source = NULL;
				GeeArrayList* _tmp15_;
				gpointer _tmp16_;
				const gchar* _tmp17_;
				_source_index = _source_index + 1;
				_tmp13_ = _source_index;
				_tmp14_ = _source_size;
				if (!(_tmp13_ < _tmp14_)) {
					break;
				}
				_tmp15_ = _source_list;
				_tmp16_ = gee_abstract_list_get ((GeeAbstractList*) _tmp15_, _source_index);
				source = (gchar*) _tmp16_;
				_tmp17_ = source;
				if (g_strcmp0 (_tmp17_, "") != 0) {
					result = TRUE;
					_g_free0 (source);
					return result;
				}
				_g_free0 (source);
			}
		}
	}
	result = FALSE;
	return result;
}

ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult*
proton_plus_widgets_games_launch_options_editor_box_prepare_write (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	const gchar* _tmp0_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp1_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->loaded_source;
	_tmp1_ = proton_plus_widgets_games_launch_options_editor_box_prepare_write_for_source (self, _tmp0_);
	result = _tmp1_;
	return result;
}

ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult*
proton_plus_widgets_games_launch_options_editor_box_prepare_write_for_source (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                              const gchar* source)
{
	GeeList* diagnostics = NULL;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* _tmp0_;
	GeeList* _tmp1_;
	GeeArrayList* selections = NULL;
	GeeArrayList* _tmp2_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriter* _tmp3_;
	gint _tmp4_ = 0;
	gpointer* _tmp5_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandSelection** _tmp6_;
	gint _tmp6__length1;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandEditState* _tmp7_;
	gint _tmp8_ = 0;
	gchar** _tmp9_;
	gchar** _tmp10_;
	gint _tmp10__length1;
	gint _tmp11_ = 0;
	gpointer* _tmp12_;
	gchar** _tmp13_;
	gint _tmp13__length1;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandCapabilityContext* _tmp14_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandEditState* _tmp15_;
	gboolean _tmp16_;
	gboolean _tmp17_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp18_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp19_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (source != NULL, NULL);
	_tmp0_ = self->priv->presentations;
	_tmp1_ = proton_plus_widgets_games_launch_options_editor_launch_option_presentation_registry_validate_selection_sources (_tmp0_);
	diagnostics = _tmp1_;
	_tmp2_ = proton_plus_widgets_games_launch_options_editor_box_collect_managed_selections (self, (GeeCollection*) diagnostics);
	selections = _tmp2_;
	_tmp3_ = self->priv->writer;
	_tmp5_ = gee_collection_to_array ((GeeCollection*) selections, &_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp6__length1 = _tmp4_;
	_tmp7_ = self->priv->edit_state;
	_tmp9_ = proton_plus_widgets_games_launch_options_editor_launch_command_edit_state_get_modified_option_ids (_tmp7_, &_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp10__length1 = _tmp8_;
	_tmp12_ = gee_collection_to_array ((GeeCollection*) diagnostics, &_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp13__length1 = _tmp11_;
	_tmp14_ = self->priv->capability_context;
	_tmp15_ = self->priv->edit_state;
	_tmp16_ = proton_plus_widgets_games_launch_options_editor_launch_command_edit_state_get_explicit_clear (_tmp15_);
	_tmp17_ = _tmp16_;
	_tmp18_ = proton_plus_widgets_games_launch_options_editor_launch_command_writer_prepare_source (_tmp3_, source, _tmp6_, (gint) _tmp4_, _tmp10_, (gint) _tmp8_, _tmp13_, (gint) _tmp11_, _tmp14_, _tmp17_, FALSE);
	_tmp19_ = _tmp18_;
	_tmp13_ = (_vala_array_free (_tmp13_, _tmp13__length1, (GDestroyNotify) g_free), NULL);
	_tmp10_ = (_vala_array_free (_tmp10_, _tmp10__length1, (GDestroyNotify) g_free), NULL);
	_tmp6_ = (_vala_array_free (_tmp6_, _tmp6__length1, (GDestroyNotify) g_object_unref), NULL);
	result = _tmp19_;
	_g_object_unref0 (selections);
	_g_object_unref0 (diagnostics);
	return result;
}

void
proton_plus_widgets_games_launch_options_editor_box_set_capability_context (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                            ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandCapabilityContext* context)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandCapabilityContext* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (context);
	_g_object_unref0 (self->priv->capability_context);
	self->priv->capability_context = _tmp0_;
	proton_plus_widgets_games_launch_options_editor_box_refresh_state (self, FALSE);
}

void
proton_plus_widgets_games_launch_options_editor_box_set_text (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                              const gchar* launch_options)
{
	gchar* _tmp0_;
	GeeArrayList* _tmp1_;
	GeeArrayList* _tmp2_;
	GeeArrayList* _tmp3_;
	GeeArrayList* _tmp4_;
	const gchar* _tmp5_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorOptionsGroup* _tmp6_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionsList* _tmp7_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroup* _tmp8_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCatalog* _tmp9_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandParser* _tmp10_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandParser* _tmp11_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandParseResult* _tmp12_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandParseResult* _tmp13_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsWrapperGroup* _tmp14_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorOptionsGroup* _tmp15_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandEditState* _tmp16_;
	GeeArrayList* _tmp17_;
	GeeArrayList* _tmp18_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (launch_options != NULL);
	self->priv->refreshing_controls = TRUE;
	_tmp0_ = g_strdup (launch_options);
	_g_free0 (self->priv->loaded_source);
	self->priv->loaded_source = _tmp0_;
	_tmp1_ = self->priv->preview_source_labels;
	gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp1_);
	_tmp2_ = self->priv->preview_sources;
	gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp2_);
	_tmp3_ = self->priv->preview_source_labels;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp3_, "");
	_tmp4_ = self->priv->preview_sources;
	_tmp5_ = self->priv->loaded_source;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp4_, _tmp5_);
	_tmp6_ = self->priv->gpu_vendor_group;
	proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_options_group_reset_controls (_tmp6_);
	_tmp7_ = self->priv->launch_option_handlers;
	proton_plus_widgets_games_launch_options_editor_launch_options_list_load_from_string (_tmp7_, launch_options);
	_tmp8_ = self->priv->_advanced_options_group;
	_tmp9_ = self->priv->catalog;
	_tmp10_ = proton_plus_widgets_games_launch_options_editor_launch_command_parser_new (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = proton_plus_widgets_games_launch_options_editor_launch_command_parser_parse (_tmp11_, launch_options);
	_tmp13_ = _tmp12_;
	proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_load_custom_arguments (_tmp8_, _tmp13_);
	_g_object_unref0 (_tmp13_);
	_g_object_unref0 (_tmp11_);
	_tmp14_ = self->priv->wrapper_group;
	proton_plus_widgets_games_launch_options_editor_groups_wrapper_group_normalize_selection (_tmp14_);
	_tmp15_ = self->priv->gpu_vendor_group;
	proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_options_group_normalize_dependencies (_tmp15_);
	_tmp16_ = self->priv->edit_state;
	_tmp17_ = proton_plus_widgets_games_launch_options_editor_box_collect_sources (self, FALSE);
	_tmp18_ = _tmp17_;
	proton_plus_widgets_games_launch_options_editor_launch_command_edit_state_record_baseline (_tmp16_, (GeeCollection*) _tmp18_);
	_g_object_unref0 (_tmp18_);
	self->priv->refreshing_controls = FALSE;
	proton_plus_widgets_games_launch_options_editor_box_refresh_state (self, FALSE);
}

void
proton_plus_widgets_games_launch_options_editor_box_set_preview_sources (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                         gchar** labels,
                                                                         gint labels_length1,
                                                                         gchar** sources,
                                                                         gint sources_length1)
{
	GeeArrayList* _tmp0_;
	GeeArrayList* _tmp1_;
	GeeArrayList* _tmp8_;
	gint _tmp9_;
	gint _tmp10_;
	g_return_if_fail (self != NULL);
	_vala_assert (labels_length1 == sources_length1, "labels.length == sources.length");
	_tmp0_ = self->priv->preview_source_labels;
	gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp0_);
	_tmp1_ = self->priv->preview_sources;
	gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp1_);
	{
		gchar** label_collection = NULL;
		gint label_collection_length1 = 0;
		gint _label_collection_size_ = 0;
		gint label_it = 0;
		label_collection = labels;
		label_collection_length1 = labels_length1;
		for (label_it = 0; label_it < label_collection_length1; label_it = label_it + 1) {
			gchar* _tmp2_;
			gchar* label = NULL;
			_tmp2_ = g_strdup (label_collection[label_it]);
			label = _tmp2_;
			{
				GeeArrayList* _tmp3_;
				const gchar* _tmp4_;
				_tmp3_ = self->priv->preview_source_labels;
				_tmp4_ = label;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp3_, _tmp4_);
				_g_free0 (label);
			}
		}
	}
	{
		gchar** source_collection = NULL;
		gint source_collection_length1 = 0;
		gint _source_collection_size_ = 0;
		gint source_it = 0;
		source_collection = sources;
		source_collection_length1 = sources_length1;
		for (source_it = 0; source_it < source_collection_length1; source_it = source_it + 1) {
			gchar* _tmp5_;
			gchar* source = NULL;
			_tmp5_ = g_strdup (source_collection[source_it]);
			source = _tmp5_;
			{
				GeeArrayList* _tmp6_;
				const gchar* _tmp7_;
				_tmp6_ = self->priv->preview_sources;
				_tmp7_ = source;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp6_, _tmp7_);
				_g_free0 (source);
			}
		}
	}
	_tmp8_ = self->priv->preview_sources;
	_tmp9_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp8_);
	_tmp10_ = _tmp9_;
	if (_tmp10_ == 0) {
		GeeArrayList* _tmp11_;
		GeeArrayList* _tmp12_;
		const gchar* _tmp13_;
		_tmp11_ = self->priv->preview_source_labels;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp11_, "");
		_tmp12_ = self->priv->preview_sources;
		_tmp13_ = self->priv->loaded_source;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp12_, _tmp13_);
	}
	proton_plus_widgets_games_launch_options_editor_box_refresh_preview (self);
}

static void
proton_plus_widgets_games_launch_options_editor_box_standard_control_changed (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionsList* _tmp0_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandEditState* _tmp1_;
	GeeArrayList* _tmp2_;
	GeeArrayList* _tmp3_;
	g_return_if_fail (self != NULL);
	if (self->priv->refreshing_controls) {
		return;
	}
	_tmp0_ = self->priv->launch_option_handlers;
	proton_plus_widgets_games_launch_options_editor_launch_options_list_mark_modified (_tmp0_);
	_tmp1_ = self->priv->edit_state;
	_tmp2_ = proton_plus_widgets_games_launch_options_editor_box_collect_sources (self, FALSE);
	_tmp3_ = _tmp2_;
	proton_plus_widgets_games_launch_options_editor_launch_command_edit_state_update (_tmp1_, (GeeCollection*) _tmp3_);
	_g_object_unref0 (_tmp3_);
	proton_plus_widgets_games_launch_options_editor_box_refresh_state (self, TRUE);
}

static void
proton_plus_widgets_games_launch_options_editor_box_refresh_state (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                   gboolean notify_change)
{
	g_return_if_fail (self != NULL);
	proton_plus_widgets_games_launch_options_editor_box_refresh_filters (self);
	proton_plus_widgets_games_launch_options_editor_box_refresh_projection (self);
	proton_plus_widgets_games_launch_options_editor_box_refresh_preview (self);
	if (notify_change) {
		g_signal_emit (self, proton_plus_widgets_games_launch_options_editor_box_signals[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_CONTENT_CHANGED_SIGNAL], 0);
	}
}

static void
proton_plus_widgets_games_launch_options_editor_box_refresh_projection (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	GeeArrayList* sources = NULL;
	GeeArrayList* _tmp0_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandEditorProjection* _tmp1_;
	const gchar* _tmp2_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* _tmp3_;
	GeeList* _tmp4_;
	GeeList* _tmp5_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandCapabilityContext* _tmp6_;
	g_return_if_fail (self != NULL);
	_tmp0_ = proton_plus_widgets_games_launch_options_editor_box_collect_sources (self, TRUE);
	sources = _tmp0_;
	_tmp1_ = self->priv->projection;
	_tmp2_ = self->priv->loaded_source;
	_tmp3_ = self->priv->presentations;
	_tmp4_ = proton_plus_widgets_games_launch_options_editor_launch_option_presentation_registry_validate_selection_sources (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = self->priv->capability_context;
	proton_plus_widgets_games_launch_options_editor_launch_command_editor_projection_update (_tmp1_, _tmp2_, (GeeCollection*) sources, (GeeCollection*) _tmp5_, _tmp6_);
	_g_object_unref0 (_tmp5_);
	_g_object_unref0 (sources);
}

static GeeArrayList*
proton_plus_widgets_games_launch_options_editor_box_collect_sources (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                     gboolean exclude_unavailable)
{
	GeeArrayList* sources = NULL;
	GeeArrayList* _tmp0_;
	GeeArrayList* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = gee_array_list_new (PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_ILAUNCH_COMMAND_SELECTION_SOURCE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	sources = _tmp0_;
	{
		GeeList* _source_list = NULL;
		ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* _tmp1_;
		GeeList* _tmp2_;
		gint _source_size = 0;
		GeeList* _tmp3_;
		gint _tmp4_;
		gint _tmp5_;
		gint _source_index = 0;
		_tmp1_ = self->priv->presentations;
		_tmp2_ = proton_plus_widgets_games_launch_options_editor_launch_option_presentation_registry_get_selection_sources (_tmp1_);
		_source_list = _tmp2_;
		_tmp3_ = _source_list;
		_tmp4_ = gee_collection_get_size ((GeeCollection*) _tmp3_);
		_tmp5_ = _tmp4_;
		_source_size = _tmp5_;
		_source_index = -1;
		while (TRUE) {
			gint _tmp6_;
			gint _tmp7_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchCommandSelectionSource* source = NULL;
			GeeList* _tmp8_;
			gpointer _tmp9_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchCommandSelectionSource* _tmp10_;
			const gchar* _tmp11_;
			const gchar* _tmp12_;
			GeeArrayList* _tmp45_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchCommandSelectionSource* _tmp46_;
			_source_index = _source_index + 1;
			_tmp6_ = _source_index;
			_tmp7_ = _source_size;
			if (!(_tmp6_ < _tmp7_)) {
				break;
			}
			_tmp8_ = _source_list;
			_tmp9_ = gee_list_get (_tmp8_, _source_index);
			source = (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchCommandSelectionSource*) _tmp9_;
			_tmp10_ = source;
			_tmp11_ = proton_plus_widgets_games_launch_options_editor_ilaunch_command_selection_source_get_option_id (_tmp10_);
			_tmp12_ = _tmp11_;
			if (g_strcmp0 (_tmp12_, "launch-backend") == 0) {
				gchar* selected = NULL;
				ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsWrapperGroup* _tmp13_;
				gchar* _tmp14_;
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandSelection* _tmp15_ = NULL;
				const gchar* _tmp16_;
				GeeArrayList* _tmp23_;
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandStaticSelectionSource* _tmp24_;
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandStaticSelectionSource* _tmp25_;
				_tmp13_ = self->priv->wrapper_group;
				_tmp14_ = proton_plus_widgets_games_launch_options_editor_groups_wrapper_group_get_selected_backend_id (_tmp13_);
				selected = _tmp14_;
				_tmp16_ = selected;
				if (g_strcmp0 (_tmp16_, "") != 0) {
					gchar** _tmp17_;
					gchar** _tmp18_;
					gint _tmp18__length1;
					const gchar* _tmp19_;
					gchar** _tmp20_;
					gchar** _tmp21_;
					gint _tmp21__length1;
					ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandSelection* _tmp22_;
					_tmp17_ = g_new0 (gchar*, 0 + 1);
					_tmp18_ = _tmp17_;
					_tmp18__length1 = 0;
					_tmp19_ = selected;
					_tmp20_ = g_new0 (gchar*, 0 + 1);
					_tmp21_ = _tmp20_;
					_tmp21__length1 = 0;
					_tmp22_ = proton_plus_widgets_games_launch_options_editor_launch_command_selection_new ("launch-backend", _tmp18_, 0, _tmp19_, _tmp21_, 0, FALSE, NULL, 0, "");
					_g_object_unref0 (_tmp15_);
					_tmp15_ = _tmp22_;
					_tmp21_ = (_vala_array_free (_tmp21_, _tmp21__length1, (GDestroyNotify) g_free), NULL);
					_tmp18_ = (_vala_array_free (_tmp18_, _tmp18__length1, (GDestroyNotify) g_free), NULL);
				} else {
					_g_object_unref0 (_tmp15_);
					_tmp15_ = NULL;
				}
				_tmp23_ = sources;
				_tmp24_ = proton_plus_widgets_games_launch_options_editor_launch_command_static_selection_source_new ("launch-backend", _tmp15_, NULL);
				_tmp25_ = _tmp24_;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp23_, (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchCommandSelectionSource*) _tmp25_);
				_g_object_unref0 (_tmp25_);
				_g_object_unref0 (_tmp15_);
				_g_free0 (selected);
				_g_object_unref0 (source);
				continue;
			}
			if (exclude_unavailable) {
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandSelection* selection = NULL;
				ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchCommandSelectionSource* _tmp26_;
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandSelection* _tmp27_;
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionMetadata* metadata = NULL;
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCatalog* _tmp28_;
				ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchCommandSelectionSource* _tmp29_;
				const gchar* _tmp30_;
				const gchar* _tmp31_;
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionMetadata* _tmp32_;
				gboolean _tmp33_ = FALSE;
				gboolean _tmp34_ = FALSE;
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandSelection* _tmp35_;
				_tmp26_ = source;
				_tmp27_ = proton_plus_widgets_games_launch_options_editor_ilaunch_command_selection_source_get_selection (_tmp26_);
				selection = _tmp27_;
				_tmp28_ = self->priv->catalog;
				_tmp29_ = source;
				_tmp30_ = proton_plus_widgets_games_launch_options_editor_ilaunch_command_selection_source_get_option_id (_tmp29_);
				_tmp31_ = _tmp30_;
				_tmp32_ = proton_plus_widgets_games_launch_options_editor_launch_option_catalog_lookup (_tmp28_, _tmp31_);
				metadata = _tmp32_;
				_tmp35_ = selection;
				if (_tmp35_ != NULL) {
					ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionMetadata* _tmp36_;
					_tmp36_ = metadata;
					_tmp34_ = _tmp36_ != NULL;
				} else {
					_tmp34_ = FALSE;
				}
				if (_tmp34_) {
					ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCapabilityResolver* _tmp37_;
					ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionMetadata* _tmp38_;
					ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandSelection* _tmp39_;
					ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandCapabilityContext* _tmp40_;
					ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEligibility* _tmp41_;
					ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEligibility* _tmp42_;
					gboolean _tmp43_;
					gboolean _tmp44_;
					_tmp37_ = self->priv->capability_resolver;
					_tmp38_ = metadata;
					_tmp39_ = selection;
					_tmp40_ = self->priv->capability_context;
					_tmp41_ = proton_plus_widgets_games_launch_options_editor_launch_option_capability_resolver_evaluate_selection (_tmp37_, _tmp38_, _tmp39_, _tmp40_, TRUE);
					_tmp42_ = _tmp41_;
					_tmp43_ = proton_plus_widgets_games_launch_options_editor_launch_option_eligibility_get_may_activate (_tmp42_);
					_tmp44_ = _tmp43_;
					_tmp33_ = !_tmp44_;
					_g_object_unref0 (_tmp42_);
				} else {
					_tmp33_ = FALSE;
				}
				if (_tmp33_) {
					_g_object_unref0 (metadata);
					_g_object_unref0 (selection);
					_g_object_unref0 (source);
					continue;
				}
				_g_object_unref0 (metadata);
				_g_object_unref0 (selection);
			}
			_tmp45_ = sources;
			_tmp46_ = source;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp45_, _tmp46_);
			_g_object_unref0 (source);
		}
		_g_object_unref0 (_source_list);
	}
	result = sources;
	return result;
}

static GeeArrayList*
proton_plus_widgets_games_launch_options_editor_box_collect_managed_selections (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                                GeeCollection* diagnostics)
{
	GeeArrayList* selections = NULL;
	GeeArrayList* _tmp0_;
	GeeArrayList* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (diagnostics != NULL, NULL);
	_tmp0_ = gee_array_list_new (PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_COMMAND_SELECTION, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	selections = _tmp0_;
	{
		GeeArrayList* _source_list = NULL;
		GeeArrayList* _tmp1_;
		gint _source_size = 0;
		GeeArrayList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _source_index = 0;
		_tmp1_ = proton_plus_widgets_games_launch_options_editor_box_collect_sources (self, FALSE);
		_source_list = _tmp1_;
		_tmp2_ = _source_list;
		_tmp3_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_source_size = _tmp4_;
		_source_index = -1;
		while (TRUE) {
			gint _tmp5_;
			gint _tmp6_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchCommandSelectionSource* source = NULL;
			GeeArrayList* _tmp7_;
			gpointer _tmp8_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandSelection* selection = NULL;
			ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchCommandSelectionSource* _tmp9_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandSelection* _tmp10_;
			gchar* source_diagnostic = NULL;
			ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchCommandSelectionSource* _tmp11_;
			gchar* _tmp12_;
			const gchar* _tmp13_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandSelection* _tmp15_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionMetadata* metadata = NULL;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCatalog* _tmp16_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandSelection* _tmp17_;
			const gchar* _tmp18_;
			const gchar* _tmp19_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionMetadata* _tmp20_;
			gboolean _tmp21_ = FALSE;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionMetadata* _tmp22_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSemantics* semantics = NULL;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionMetadata* _tmp31_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSemantics* _tmp32_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSemantics* _tmp33_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSemantics* _tmp34_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEligibility* eligibility = NULL;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCapabilityResolver* _tmp35_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionMetadata* _tmp36_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandSelection* _tmp37_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandCapabilityContext* _tmp38_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEligibility* _tmp39_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEligibility* _tmp40_;
			gboolean _tmp41_;
			gboolean _tmp42_;
			gboolean _tmp50_ = FALSE;
			gboolean _tmp51_ = FALSE;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSemantics* _tmp52_;
			gboolean _tmp53_;
			gboolean _tmp54_;
			_source_index = _source_index + 1;
			_tmp5_ = _source_index;
			_tmp6_ = _source_size;
			if (!(_tmp5_ < _tmp6_)) {
				break;
			}
			_tmp7_ = _source_list;
			_tmp8_ = gee_abstract_list_get ((GeeAbstractList*) _tmp7_, _source_index);
			source = (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchCommandSelectionSource*) _tmp8_;
			_tmp9_ = source;
			_tmp10_ = proton_plus_widgets_games_launch_options_editor_ilaunch_command_selection_source_get_selection (_tmp9_);
			selection = _tmp10_;
			_tmp11_ = source;
			_tmp12_ = proton_plus_widgets_games_launch_options_editor_ilaunch_command_selection_source_get_diagnostic (_tmp11_);
			source_diagnostic = _tmp12_;
			_tmp13_ = source_diagnostic;
			if (_tmp13_ != NULL) {
				const gchar* _tmp14_;
				_tmp14_ = source_diagnostic;
				gee_collection_add (diagnostics, _tmp14_);
			}
			_tmp15_ = selection;
			if (_tmp15_ == NULL) {
				_g_free0 (source_diagnostic);
				_g_object_unref0 (selection);
				_g_object_unref0 (source);
				continue;
			}
			_tmp16_ = self->priv->catalog;
			_tmp17_ = selection;
			_tmp18_ = proton_plus_widgets_games_launch_options_editor_launch_command_selection_get_option_id (_tmp17_);
			_tmp19_ = _tmp18_;
			_tmp20_ = proton_plus_widgets_games_launch_options_editor_launch_option_catalog_lookup (_tmp16_, _tmp19_);
			metadata = _tmp20_;
			_tmp22_ = metadata;
			if (_tmp22_ == NULL) {
				_tmp21_ = TRUE;
			} else {
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionMetadata* _tmp23_;
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSemantics* _tmp24_;
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSemantics* _tmp25_;
				_tmp23_ = metadata;
				_tmp24_ = proton_plus_widgets_games_launch_options_editor_launch_option_metadata_get_semantics (_tmp23_);
				_tmp25_ = _tmp24_;
				_tmp21_ = _tmp25_ == NULL;
			}
			if (_tmp21_) {
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandSelection* _tmp26_;
				const gchar* _tmp27_;
				const gchar* _tmp28_;
				gchar* _tmp29_;
				gchar* _tmp30_;
				_tmp26_ = selection;
				_tmp27_ = proton_plus_widgets_games_launch_options_editor_launch_command_selection_get_option_id (_tmp26_);
				_tmp28_ = _tmp27_;
				_tmp29_ = g_strdup_printf ("Selection source '%s' returned an unknown option.", _tmp28_);
				_tmp30_ = _tmp29_;
				gee_collection_add (diagnostics, _tmp30_);
				_g_free0 (_tmp30_);
				_g_object_unref0 (metadata);
				_g_free0 (source_diagnostic);
				_g_object_unref0 (selection);
				_g_object_unref0 (source);
				continue;
			}
			_tmp31_ = metadata;
			_tmp32_ = proton_plus_widgets_games_launch_options_editor_launch_option_metadata_get_semantics (_tmp31_);
			_tmp33_ = _tmp32_;
			_tmp34_ = _g_object_ref0 (_tmp33_);
			semantics = _tmp34_;
			_tmp35_ = self->priv->capability_resolver;
			_tmp36_ = metadata;
			_tmp37_ = selection;
			_tmp38_ = self->priv->capability_context;
			_tmp39_ = proton_plus_widgets_games_launch_options_editor_launch_option_capability_resolver_evaluate_selection (_tmp35_, _tmp36_, _tmp37_, _tmp38_, TRUE);
			eligibility = _tmp39_;
			_tmp40_ = eligibility;
			_tmp41_ = proton_plus_widgets_games_launch_options_editor_launch_option_eligibility_get_may_activate (_tmp40_);
			_tmp42_ = _tmp41_;
			if (!_tmp42_) {
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandEditState* _tmp43_;
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandSelection* _tmp44_;
				const gchar* _tmp45_;
				const gchar* _tmp46_;
				_tmp43_ = self->priv->edit_state;
				_tmp44_ = selection;
				_tmp45_ = proton_plus_widgets_games_launch_options_editor_launch_command_selection_get_option_id (_tmp44_);
				_tmp46_ = _tmp45_;
				if (proton_plus_widgets_games_launch_options_editor_launch_command_edit_state_is_option_modified (_tmp43_, _tmp46_)) {
					ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEligibility* _tmp47_;
					const gchar* _tmp48_;
					const gchar* _tmp49_;
					_tmp47_ = eligibility;
					_tmp48_ = proton_plus_widgets_games_launch_options_editor_launch_option_eligibility_get_reason (_tmp47_);
					_tmp49_ = _tmp48_;
					gee_collection_add (diagnostics, _tmp49_);
				}
				_g_object_unref0 (eligibility);
				_g_object_unref0 (semantics);
				_g_object_unref0 (metadata);
				_g_free0 (source_diagnostic);
				_g_object_unref0 (selection);
				_g_object_unref0 (source);
				continue;
			}
			_tmp52_ = semantics;
			_tmp53_ = proton_plus_widgets_games_launch_options_editor_launch_option_semantics_get_managed_emission (_tmp52_);
			_tmp54_ = _tmp53_;
			if (_tmp54_) {
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSemantics* _tmp55_;
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSemanticKind _tmp56_;
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSemanticKind _tmp57_;
				_tmp55_ = semantics;
				_tmp56_ = proton_plus_widgets_games_launch_options_editor_launch_option_semantics_get_kind (_tmp55_);
				_tmp57_ = _tmp56_;
				_tmp51_ = _tmp57_ != PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SEMANTIC_KIND_COMMAND_BOUNDARY;
			} else {
				_tmp51_ = FALSE;
			}
			if (_tmp51_) {
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSemantics* _tmp58_;
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSemanticKind _tmp59_;
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSemanticKind _tmp60_;
				_tmp58_ = semantics;
				_tmp59_ = proton_plus_widgets_games_launch_options_editor_launch_option_semantics_get_kind (_tmp58_);
				_tmp60_ = _tmp59_;
				_tmp50_ = _tmp60_ != PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SEMANTIC_KIND_OPAQUE_CONTEXT_DEPENDENT;
			} else {
				_tmp50_ = FALSE;
			}
			if (_tmp50_) {
				GeeArrayList* _tmp61_;
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandSelection* _tmp62_;
				_tmp61_ = selections;
				_tmp62_ = selection;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp61_, _tmp62_);
			} else {
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandEditState* _tmp63_;
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandSelection* _tmp64_;
				const gchar* _tmp65_;
				const gchar* _tmp66_;
				_tmp63_ = self->priv->edit_state;
				_tmp64_ = selection;
				_tmp65_ = proton_plus_widgets_games_launch_options_editor_launch_command_selection_get_option_id (_tmp64_);
				_tmp66_ = _tmp65_;
				if (proton_plus_widgets_games_launch_options_editor_launch_command_edit_state_is_option_modified (_tmp63_, _tmp66_)) {
					ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandSelection* _tmp67_;
					const gchar* _tmp68_;
					const gchar* _tmp69_;
					gchar* _tmp70_;
					gchar* _tmp71_;
					_tmp67_ = selection;
					_tmp68_ = proton_plus_widgets_games_launch_options_editor_launch_command_selection_get_option_id (_tmp67_);
					_tmp69_ = _tmp68_;
					_tmp70_ = g_strdup_printf ("Launch option '%s' cannot be newly enabled.", _tmp69_);
					_tmp71_ = _tmp70_;
					gee_collection_add (diagnostics, _tmp71_);
					_g_free0 (_tmp71_);
				}
			}
			_g_object_unref0 (eligibility);
			_g_object_unref0 (semantics);
			_g_object_unref0 (metadata);
			_g_free0 (source_diagnostic);
			_g_object_unref0 (selection);
			_g_object_unref0 (source);
		}
		_g_object_unref0 (_source_list);
	}
	result = selections;
	return result;
}

static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strstrip (_result_);
	result = _result_;
	return result;
}

static void
proton_plus_widgets_games_launch_options_editor_box_refresh_filters (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	gchar* query = NULL;
	AdwEntryRow* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionView view = 0;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* _tmp4_;
	const gchar* _tmp5_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCapabilityResolver* _tmp6_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandCapabilityContext* _tmp7_;
	gboolean _tmp27_ = FALSE;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* _tmp28_;
	gboolean display_visible = FALSE;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsWrapperGroup* _tmp30_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorOptionsGroup* _tmp31_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* _tmp32_;
	gboolean any_visible = FALSE;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCategory* _tmp33_;
	gint _tmp33__length1;
	GtkLabel* _tmp42_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_search_entry;
	_tmp1_ = gtk_editable_get_text ((GtkEditable*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = string_strip (_tmp2_);
	query = _tmp3_;
	view = proton_plus_widgets_games_launch_options_editor_box_get_selected_view (self);
	_tmp4_ = self->priv->presentations;
	_tmp5_ = query;
	_tmp6_ = self->priv->capability_resolver;
	_tmp7_ = self->priv->capability_context;
	proton_plus_widgets_games_launch_options_editor_launch_option_presentation_registry_apply_filter (_tmp4_, view, _tmp5_, _tmp6_, _tmp7_);
	{
		GeeIterator* _group_it = NULL;
		GeeHashMap* _tmp8_;
		GeeCollection* _tmp9_;
		GeeCollection* _tmp10_;
		GeeCollection* _tmp11_;
		GeeIterator* _tmp12_;
		GeeIterator* _tmp13_;
		_tmp8_ = self->priv->subsection_groups;
		_tmp9_ = gee_abstract_map_get_values ((GeeAbstractMap*) _tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = _tmp10_;
		_tmp12_ = gee_iterable_iterator ((GeeIterable*) _tmp11_);
		_tmp13_ = _tmp12_;
		_g_object_unref0 (_tmp11_);
		_group_it = _tmp13_;
		while (TRUE) {
			GeeIterator* _tmp14_;
			AdwPreferencesGroup* group = NULL;
			GeeIterator* _tmp15_;
			gpointer _tmp16_;
			gchar** parts = NULL;
			AdwPreferencesGroup* _tmp17_;
			gconstpointer _tmp18_;
			gchar** _tmp19_;
			gchar** _tmp20_;
			gint parts_length1;
			gint _parts_size_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCategory category = 0;
			gchar** _tmp21_;
			gint _tmp21__length1;
			const gchar* _tmp22_;
			AdwPreferencesGroup* _tmp23_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* _tmp24_;
			gchar** _tmp25_;
			gint _tmp25__length1;
			const gchar* _tmp26_;
			_tmp14_ = _group_it;
			if (!gee_iterator_next (_tmp14_)) {
				break;
			}
			_tmp15_ = _group_it;
			_tmp16_ = gee_iterator_get (_tmp15_);
			group = (AdwPreferencesGroup*) _tmp16_;
			_tmp17_ = group;
			_tmp18_ = g_object_get_data ((GObject*) _tmp17_, "launch-options-subsection-key");
			_tmp20_ = _tmp19_ = g_strsplit ((const gchar*) _tmp18_, ":", 2);
			parts = _tmp20_;
			parts_length1 = _vala_array_length (_tmp19_);
			_parts_size_ = parts_length1;
			_tmp21_ = parts;
			_tmp21__length1 = parts_length1;
			_tmp22_ = _tmp21_[0];
			category = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCategory) atoi (_tmp22_);
			_tmp23_ = group;
			_tmp24_ = self->priv->presentations;
			_tmp25_ = parts;
			_tmp25__length1 = parts_length1;
			_tmp26_ = _tmp25_[1];
			gtk_widget_set_visible ((GtkWidget*) _tmp23_, proton_plus_widgets_games_launch_options_editor_launch_option_presentation_registry_has_visible_in_subsection (_tmp24_, category, _tmp26_));
			parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
			_g_object_unref0 (group);
		}
		_g_object_unref0 (_group_it);
	}
	_tmp28_ = self->priv->presentations;
	if (proton_plus_widgets_games_launch_options_editor_launch_option_presentation_registry_has_visible_in_category (_tmp28_, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CATEGORY_DISPLAY)) {
		_tmp27_ = TRUE;
	} else {
		ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsWrapperGroup* _tmp29_;
		_tmp29_ = self->priv->wrapper_group;
		_tmp27_ = proton_plus_widgets_games_launch_options_editor_groups_wrapper_group_has_active_non_default_backend (_tmp29_);
	}
	display_visible = _tmp27_;
	_tmp30_ = self->priv->wrapper_group;
	proton_plus_widgets_games_launch_options_editor_groups_wrapper_group_set_presentation_visible (_tmp30_, display_visible);
	_tmp31_ = self->priv->gpu_vendor_group;
	_tmp32_ = self->priv->presentations;
	proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_options_group_set_presentation_visible (_tmp31_, proton_plus_widgets_games_launch_options_editor_launch_option_presentation_registry_has_visible_in_category (_tmp32_, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CATEGORY_HARDWARE));
	any_visible = FALSE;
	_tmp33_ = self->priv->canonical_categories;
	_tmp33__length1 = self->priv->canonical_categories_length1;
	{
		ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCategory* category_collection = NULL;
		gint category_collection_length1 = 0;
		gint _category_collection_size_ = 0;
		gint category_it = 0;
		category_collection = _tmp33_;
		category_collection_length1 = _tmp33__length1;
		for (category_it = 0; category_it < category_collection_length1; category_it = category_it + 1) {
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCategory category = 0;
			category = category_collection[category_it];
			{
				GtkBox* category_box = NULL;
				GeeHashMap* _tmp34_;
				gpointer _tmp35_;
				gboolean visible = FALSE;
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* _tmp36_;
				GtkBox* _tmp40_;
				gboolean _tmp41_ = FALSE;
				_tmp34_ = self->priv->category_boxes;
				_tmp35_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp34_, (gpointer) ((gintptr) category));
				category_box = (GtkBox*) _tmp35_;
				_tmp36_ = self->priv->presentations;
				visible = proton_plus_widgets_games_launch_options_editor_launch_option_presentation_registry_has_visible_in_category (_tmp36_, category);
				if (category == PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CATEGORY_DISPLAY) {
					ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsWrapperGroup* _tmp37_;
					gboolean _tmp38_;
					gboolean _tmp39_;
					_tmp37_ = self->priv->wrapper_group;
					_tmp38_ = gtk_widget_get_visible ((GtkWidget*) _tmp37_);
					_tmp39_ = _tmp38_;
					visible = _tmp39_;
				}
				_tmp40_ = category_box;
				gtk_widget_set_visible ((GtkWidget*) _tmp40_, visible);
				if (any_visible) {
					_tmp41_ = TRUE;
				} else {
					_tmp41_ = visible;
				}
				any_visible = _tmp41_;
				_g_object_unref0 (category_box);
			}
		}
	}
	_tmp42_ = self->priv->_no_results_label;
	gtk_widget_set_visible ((GtkWidget*) _tmp42_, !any_visible);
	if (proton_plus_widgets_games_launch_options_editor_box_update_category_filter_options (self, view)) {
		proton_plus_widgets_games_launch_options_editor_box_refresh_filters (self);
	}
	_g_free0 (query);
}

static ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionView
proton_plus_widgets_games_launch_options_editor_box_get_selected_view (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	AdwComboRow* _tmp0_;
	guint _tmp1_;
	guint _tmp2_;
	GeeArrayList* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionView result;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->priv->_category_filter;
	_tmp1_ = adw_combo_row_get_selected (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->category_filter_views;
	_tmp4_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp3_);
	_tmp5_ = _tmp4_;
	if (_tmp2_ < ((guint) _tmp5_)) {
		GeeArrayList* _tmp6_;
		AdwComboRow* _tmp7_;
		guint _tmp8_;
		guint _tmp9_;
		gpointer _tmp10_;
		_tmp6_ = self->priv->category_filter_views;
		_tmp7_ = self->priv->_category_filter;
		_tmp8_ = adw_combo_row_get_selected (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = gee_abstract_list_get ((GeeAbstractList*) _tmp6_, (gint) _tmp9_);
		result = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionView) ((gintptr) _tmp10_);
		return result;
	}
	result = PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_VIEW_QUICK;
	return result;
}

static gboolean
proton_plus_widgets_games_launch_options_editor_box_update_category_filter_options (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                                    ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionView preferred_view)
{
	GeeArrayList* labels = NULL;
	GeeArrayList* _tmp0_;
	GeeArrayList* views = NULL;
	GeeArrayList* _tmp1_;
	GeeArrayList* _tmp2_;
	GeeArrayList* _tmp3_;
	GeeArrayList* _tmp4_;
	GeeArrayList* _tmp5_;
	GeeArrayList* _tmp6_;
	GeeArrayList* _tmp7_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCategory* _tmp8_;
	gint _tmp8__length1;
	GeeArrayList* _tmp13_;
	GeeArrayList* _tmp14_;
	guint selected = 0U;
	GeeArrayList* _tmp22_;
	GeeArrayList* _tmp23_;
	gchar** label_values = NULL;
	GeeArrayList* _tmp24_;
	gint _tmp25_;
	gint _tmp26_;
	gchar** _tmp27_;
	gint label_values_length1;
	gint _label_values_size_;
	AdwComboRow* _tmp36_;
	gchar** _tmp37_;
	gint _tmp37__length1;
	GtkStringList* _tmp38_;
	GtkStringList* _tmp39_;
	AdwComboRow* _tmp40_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL);
	labels = _tmp0_;
	_tmp1_ = gee_array_list_new (PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_VIEW, NULL, NULL, NULL, NULL, NULL);
	views = _tmp1_;
	_tmp2_ = labels;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp2_, _ ("Quick settings"));
	_tmp3_ = views;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp3_, (gpointer) ((gintptr) PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_VIEW_QUICK));
	_tmp4_ = labels;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp4_, _ ("Active options"));
	_tmp5_ = views;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp5_, (gpointer) ((gintptr) PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_VIEW_ACTIVE));
	_tmp6_ = labels;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp6_, _ ("All options"));
	_tmp7_ = views;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp7_, (gpointer) ((gintptr) PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_VIEW_ALL));
	_tmp8_ = self->priv->canonical_categories;
	_tmp8__length1 = self->priv->canonical_categories_length1;
	{
		ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCategory* category_collection = NULL;
		gint category_collection_length1 = 0;
		gint _category_collection_size_ = 0;
		gint category_it = 0;
		category_collection = _tmp8_;
		category_collection_length1 = _tmp8__length1;
		for (category_it = 0; category_it < category_collection_length1; category_it = category_it + 1) {
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCategory category = 0;
			category = category_collection[category_it];
			{
				GeeArrayList* _tmp9_;
				gchar* _tmp10_;
				gchar* _tmp11_;
				GeeArrayList* _tmp12_;
				if (!proton_plus_widgets_games_launch_options_editor_box_category_has_dropdown_content (self, category)) {
					continue;
				}
				_tmp9_ = labels;
				_tmp10_ = proton_plus_widgets_games_launch_options_editor_launch_option_catalog_category_title (category);
				_tmp11_ = _tmp10_;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp9_, _tmp11_);
				_g_free0 (_tmp11_);
				_tmp12_ = views;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp12_, (gpointer) ((gintptr) proton_plus_widgets_games_launch_options_editor_launch_option_catalog_category_view (category)));
			}
		}
	}
	_tmp13_ = self->priv->category_filter_views;
	_tmp14_ = views;
	if (proton_plus_widgets_games_launch_options_editor_box_views_equal (self, (GeeList*) _tmp13_, (GeeList*) _tmp14_)) {
		result = FALSE;
		_g_object_unref0 (views);
		_g_object_unref0 (labels);
		return result;
	}
	selected = (guint) 0;
	{
		gint index = 0;
		index = 0;
		{
			gboolean _tmp15_ = FALSE;
			_tmp15_ = TRUE;
			while (TRUE) {
				GeeArrayList* _tmp17_;
				gint _tmp18_;
				gint _tmp19_;
				GeeArrayList* _tmp20_;
				gpointer _tmp21_;
				if (!_tmp15_) {
					gint _tmp16_;
					_tmp16_ = index;
					index = _tmp16_ + 1;
				}
				_tmp15_ = FALSE;
				_tmp17_ = views;
				_tmp18_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp17_);
				_tmp19_ = _tmp18_;
				if (!(index < _tmp19_)) {
					break;
				}
				_tmp20_ = views;
				_tmp21_ = gee_abstract_list_get ((GeeAbstractList*) _tmp20_, index);
				if (((ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionView) ((gintptr) _tmp21_)) == preferred_view) {
					selected = (guint) index;
					break;
				}
			}
		}
	}
	self->priv->updating_category_filter = TRUE;
	_tmp22_ = views;
	_tmp23_ = _g_object_ref0 (_tmp22_);
	_g_object_unref0 (self->priv->category_filter_views);
	self->priv->category_filter_views = _tmp23_;
	_tmp24_ = labels;
	_tmp25_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp24_);
	_tmp26_ = _tmp25_;
	_tmp27_ = g_new0 (gchar*, _tmp26_ + 1);
	label_values = _tmp27_;
	label_values_length1 = _tmp26_;
	_label_values_size_ = label_values_length1;
	{
		gint index = 0;
		index = 0;
		{
			gboolean _tmp28_ = FALSE;
			_tmp28_ = TRUE;
			while (TRUE) {
				GeeArrayList* _tmp30_;
				gint _tmp31_;
				gint _tmp32_;
				gchar** _tmp33_;
				gint _tmp33__length1;
				GeeArrayList* _tmp34_;
				gpointer _tmp35_;
				if (!_tmp28_) {
					gint _tmp29_;
					_tmp29_ = index;
					index = _tmp29_ + 1;
				}
				_tmp28_ = FALSE;
				_tmp30_ = labels;
				_tmp31_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp30_);
				_tmp32_ = _tmp31_;
				if (!(index < _tmp32_)) {
					break;
				}
				_tmp33_ = label_values;
				_tmp33__length1 = label_values_length1;
				_tmp34_ = labels;
				_tmp35_ = gee_abstract_list_get ((GeeAbstractList*) _tmp34_, index);
				_g_free0 (_tmp33_[index]);
				_tmp33_[index] = (gchar*) _tmp35_;
			}
		}
	}
	_tmp36_ = self->priv->_category_filter;
	_tmp37_ = label_values;
	_tmp37__length1 = label_values_length1;
	_tmp38_ = gtk_string_list_new (_tmp37_);
	_tmp39_ = _tmp38_;
	adw_combo_row_set_model (_tmp36_, (GListModel*) _tmp39_);
	_g_object_unref0 (_tmp39_);
	_tmp40_ = self->priv->_category_filter;
	adw_combo_row_set_selected (_tmp40_, selected);
	self->priv->updating_category_filter = FALSE;
	result = proton_plus_widgets_games_launch_options_editor_box_get_selected_view (self) != preferred_view;
	label_values = (_vala_array_free (label_values, label_values_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (views);
	_g_object_unref0 (labels);
	return result;
}

static gboolean
proton_plus_widgets_games_launch_options_editor_box_category_has_dropdown_content (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                                   ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCategory category)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* _tmp3_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	if (category == PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CATEGORY_DISPLAY) {
		gboolean _tmp0_ = FALSE;
		ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* _tmp1_;
		_tmp1_ = self->priv->presentations;
		if (proton_plus_widgets_games_launch_options_editor_launch_option_presentation_registry_has_presentable_in_category (_tmp1_, category)) {
			_tmp0_ = TRUE;
		} else {
			ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsWrapperGroup* _tmp2_;
			_tmp2_ = self->priv->wrapper_group;
			_tmp0_ = proton_plus_widgets_games_launch_options_editor_groups_wrapper_group_has_active_non_default_backend (_tmp2_);
		}
		result = _tmp0_;
		return result;
	}
	_tmp3_ = self->priv->presentations;
	result = proton_plus_widgets_games_launch_options_editor_launch_option_presentation_registry_has_presentable_in_category (_tmp3_, category);
	return result;
}

static gboolean
proton_plus_widgets_games_launch_options_editor_box_views_equal (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                 GeeList* first,
                                                                 GeeList* second)
{
	gint _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (first != NULL, FALSE);
	g_return_val_if_fail (second != NULL, FALSE);
	_tmp0_ = gee_collection_get_size ((GeeCollection*) first);
	_tmp1_ = _tmp0_;
	_tmp2_ = gee_collection_get_size ((GeeCollection*) second);
	_tmp3_ = _tmp2_;
	if (_tmp1_ != _tmp3_) {
		result = FALSE;
		return result;
	}
	{
		gint index = 0;
		index = 0;
		{
			gboolean _tmp4_ = FALSE;
			_tmp4_ = TRUE;
			while (TRUE) {
				gint _tmp6_;
				gint _tmp7_;
				gpointer _tmp8_;
				gpointer _tmp9_;
				if (!_tmp4_) {
					gint _tmp5_;
					_tmp5_ = index;
					index = _tmp5_ + 1;
				}
				_tmp4_ = FALSE;
				_tmp6_ = gee_collection_get_size ((GeeCollection*) first);
				_tmp7_ = _tmp6_;
				if (!(index < _tmp7_)) {
					break;
				}
				_tmp8_ = gee_list_get (first, index);
				_tmp9_ = gee_list_get (second, index);
				if (((ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionView) ((gintptr) _tmp8_)) != ((ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionView) ((gintptr) _tmp9_))) {
					result = FALSE;
					return result;
				}
			}
		}
	}
	result = TRUE;
	return result;
}

static void
proton_plus_widgets_games_launch_options_editor_box_refresh_preview (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	GeeArrayList* results = NULL;
	GeeArrayList* _tmp0_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* blocked_result = NULL;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp26_ = NULL;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp27_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp28_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _result_ = NULL;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp31_;
	const gchar* _tmp32_ = NULL;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp33_;
	gboolean _tmp34_;
	gboolean _tmp35_;
	gchar* preview = NULL;
	gchar* _tmp40_;
	gchar* reason = NULL;
	gchar* _tmp41_;
	gboolean _tmp59_ = FALSE;
	const gchar* _tmp60_;
	gboolean _tmp70_ = FALSE;
	gboolean _tmp71_ = FALSE;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp72_;
	gboolean _tmp73_;
	gboolean _tmp74_;
	gboolean same_output = FALSE;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp79_;
	gchar** commands = NULL;
	GeeArrayList* _tmp80_;
	gint _tmp81_;
	gint _tmp82_;
	gchar** _tmp83_;
	gint commands_length1;
	gint _commands_size_;
	gboolean _tmp101_ = FALSE;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp102_;
	gboolean _tmp122_ = FALSE;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp123_;
	gboolean _tmp124_;
	gboolean _tmp125_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPreviewField* _tmp128_;
	const gchar* _tmp129_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gee_array_list_new (PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_COMMAND_WRITE_RESULT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	results = _tmp0_;
	{
		GeeArrayList* _source_list = NULL;
		GeeArrayList* _tmp1_;
		gint _source_size = 0;
		GeeArrayList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _source_index = 0;
		_tmp1_ = self->priv->preview_sources;
		_source_list = _tmp1_;
		_tmp2_ = _source_list;
		_tmp3_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_source_size = _tmp4_;
		_source_index = -1;
		while (TRUE) {
			gint _tmp5_;
			gint _tmp6_;
			gchar* source = NULL;
			GeeArrayList* _tmp7_;
			gpointer _tmp8_;
			GeeArrayList* _tmp9_;
			const gchar* _tmp10_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp11_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp12_;
			_source_index = _source_index + 1;
			_tmp5_ = _source_index;
			_tmp6_ = _source_size;
			if (!(_tmp5_ < _tmp6_)) {
				break;
			}
			_tmp7_ = _source_list;
			_tmp8_ = gee_abstract_list_get ((GeeAbstractList*) _tmp7_, _source_index);
			source = (gchar*) _tmp8_;
			_tmp9_ = results;
			_tmp10_ = source;
			_tmp11_ = proton_plus_widgets_games_launch_options_editor_box_prepare_write_for_source (self, _tmp10_);
			_tmp12_ = _tmp11_;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp9_, _tmp12_);
			_g_object_unref0 (_tmp12_);
			_g_free0 (source);
		}
	}
	blocked_result = NULL;
	{
		GeeArrayList* _candidate_list = NULL;
		GeeArrayList* _tmp13_;
		gint _candidate_size = 0;
		GeeArrayList* _tmp14_;
		gint _tmp15_;
		gint _tmp16_;
		gint _candidate_index = 0;
		_tmp13_ = results;
		_candidate_list = _tmp13_;
		_tmp14_ = _candidate_list;
		_tmp15_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp14_);
		_tmp16_ = _tmp15_;
		_candidate_size = _tmp16_;
		_candidate_index = -1;
		while (TRUE) {
			gint _tmp17_;
			gint _tmp18_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* candidate = NULL;
			GeeArrayList* _tmp19_;
			gpointer _tmp20_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp21_;
			gboolean _tmp22_;
			gboolean _tmp23_;
			_candidate_index = _candidate_index + 1;
			_tmp17_ = _candidate_index;
			_tmp18_ = _candidate_size;
			if (!(_tmp17_ < _tmp18_)) {
				break;
			}
			_tmp19_ = _candidate_list;
			_tmp20_ = gee_abstract_list_get ((GeeAbstractList*) _tmp19_, _candidate_index);
			candidate = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult*) _tmp20_;
			_tmp21_ = candidate;
			_tmp22_ = proton_plus_widgets_games_launch_options_editor_launch_command_write_result_get_writing_allowed (_tmp21_);
			_tmp23_ = _tmp22_;
			if (!_tmp23_) {
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp24_;
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp25_;
				_tmp24_ = candidate;
				_tmp25_ = _g_object_ref0 (_tmp24_);
				_g_object_unref0 (blocked_result);
				blocked_result = _tmp25_;
				_g_object_unref0 (candidate);
				break;
			}
			_g_object_unref0 (candidate);
		}
	}
	_tmp27_ = blocked_result;
	_tmp28_ = _g_object_ref0 (_tmp27_);
	_tmp26_ = _tmp28_;
	if (_tmp26_ == NULL) {
		GeeArrayList* _tmp29_;
		gpointer _tmp30_;
		_tmp29_ = results;
		_tmp30_ = gee_abstract_list_get ((GeeAbstractList*) _tmp29_, 0);
		_g_object_unref0 (_tmp26_);
		_tmp26_ = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult*) _tmp30_;
	}
	_tmp31_ = _tmp26_;
	_tmp26_ = NULL;
	_result_ = _tmp31_;
	_tmp33_ = _result_;
	_tmp34_ = proton_plus_widgets_games_launch_options_editor_launch_command_write_result_get_writing_allowed (_tmp33_);
	_tmp35_ = _tmp34_;
	if (_tmp35_) {
		ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp36_;
		const gchar* _tmp37_;
		const gchar* _tmp38_;
		_tmp36_ = _result_;
		_tmp37_ = proton_plus_widgets_games_launch_options_editor_launch_command_write_result_get_launch_line (_tmp36_);
		_tmp38_ = _tmp37_;
		_tmp32_ = _tmp38_;
	} else {
		const gchar* _tmp39_;
		_tmp39_ = self->priv->loaded_source;
		_tmp32_ = _tmp39_;
	}
	_tmp40_ = g_strdup (_tmp32_);
	preview = _tmp40_;
	_tmp41_ = g_strdup ("");
	reason = _tmp41_;
	{
		GeeArrayList* _diagnostic_list = NULL;
		ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp42_;
		GeeArrayList* _tmp43_;
		GeeArrayList* _tmp44_;
		gint _diagnostic_size = 0;
		GeeArrayList* _tmp45_;
		gint _tmp46_;
		gint _tmp47_;
		gint _diagnostic_index = 0;
		_tmp42_ = _result_;
		_tmp43_ = proton_plus_widgets_games_launch_options_editor_launch_command_write_result_get_composition_diagnostics (_tmp42_);
		_tmp44_ = _tmp43_;
		_diagnostic_list = _tmp44_;
		_tmp45_ = _diagnostic_list;
		_tmp46_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp45_);
		_tmp47_ = _tmp46_;
		_diagnostic_size = _tmp47_;
		_diagnostic_index = -1;
		while (TRUE) {
			gint _tmp48_;
			gint _tmp49_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandCompositionDiagnostic* diagnostic = NULL;
			GeeArrayList* _tmp50_;
			gpointer _tmp51_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandCompositionDiagnostic* _tmp52_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandCompositionDiagnosticCode _tmp53_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandCompositionDiagnosticCode _tmp54_;
			_diagnostic_index = _diagnostic_index + 1;
			_tmp48_ = _diagnostic_index;
			_tmp49_ = _diagnostic_size;
			if (!(_tmp48_ < _tmp49_)) {
				break;
			}
			_tmp50_ = _diagnostic_list;
			_tmp51_ = gee_abstract_list_get ((GeeAbstractList*) _tmp50_, _diagnostic_index);
			diagnostic = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandCompositionDiagnostic*) _tmp51_;
			_tmp52_ = diagnostic;
			_tmp53_ = proton_plus_widgets_games_launch_options_editor_launch_command_composition_diagnostic_get_code (_tmp52_);
			_tmp54_ = _tmp53_;
			if (_tmp54_ == PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_COMMAND_COMPOSITION_DIAGNOSTIC_CODE_MISSING_REQUIRED_CAPABILITY) {
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandCompositionDiagnostic* _tmp55_;
				const gchar* _tmp56_;
				const gchar* _tmp57_;
				gchar* _tmp58_;
				_tmp55_ = diagnostic;
				_tmp56_ = proton_plus_widgets_games_launch_options_editor_launch_command_composition_diagnostic_get_message (_tmp55_);
				_tmp57_ = _tmp56_;
				_tmp58_ = g_strdup (_tmp57_);
				_g_free0 (reason);
				reason = _tmp58_;
				_g_object_unref0 (diagnostic);
				break;
			}
			_g_object_unref0 (diagnostic);
		}
	}
	_tmp60_ = reason;
	if (g_strcmp0 (_tmp60_, "") == 0) {
		ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp61_;
		GeeArrayList* _tmp62_;
		GeeArrayList* _tmp63_;
		gint _tmp64_;
		gint _tmp65_;
		_tmp61_ = _result_;
		_tmp62_ = proton_plus_widgets_games_launch_options_editor_launch_command_write_result_get_writer_diagnostics (_tmp61_);
		_tmp63_ = _tmp62_;
		_tmp64_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp63_);
		_tmp65_ = _tmp64_;
		_tmp59_ = _tmp65_ > 0;
	} else {
		_tmp59_ = FALSE;
	}
	if (_tmp59_) {
		ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp66_;
		GeeArrayList* _tmp67_;
		GeeArrayList* _tmp68_;
		gpointer _tmp69_;
		_tmp66_ = _result_;
		_tmp67_ = proton_plus_widgets_games_launch_options_editor_launch_command_write_result_get_writer_diagnostics (_tmp66_);
		_tmp68_ = _tmp67_;
		_tmp69_ = gee_abstract_list_get ((GeeAbstractList*) _tmp68_, 0);
		_g_free0 (reason);
		reason = (gchar*) _tmp69_;
	}
	_tmp72_ = _result_;
	_tmp73_ = proton_plus_widgets_games_launch_options_editor_launch_command_write_result_get_writing_allowed (_tmp72_);
	_tmp74_ = _tmp73_;
	if (!_tmp74_) {
		gboolean _tmp75_;
		gboolean _tmp76_;
		_tmp75_ = proton_plus_widgets_games_launch_options_editor_box_get_is_dirty (self);
		_tmp76_ = _tmp75_;
		_tmp71_ = _tmp76_;
	} else {
		_tmp71_ = FALSE;
	}
	if (_tmp71_) {
		const gchar* _tmp77_;
		_tmp77_ = reason;
		_tmp70_ = g_strcmp0 (_tmp77_, "") == 0;
	} else {
		_tmp70_ = FALSE;
	}
	if (_tmp70_) {
		gchar* _tmp78_;
		_tmp78_ = g_strdup (_ ("Unable to safely prepare these launch options."));
		_g_free0 (preview);
		preview = _tmp78_;
	}
	_tmp79_ = blocked_result;
	same_output = _tmp79_ == NULL;
	_tmp80_ = results;
	_tmp81_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp80_);
	_tmp82_ = _tmp81_;
	_tmp83_ = g_new0 (gchar*, _tmp82_ + 1);
	commands = _tmp83_;
	commands_length1 = _tmp82_;
	_commands_size_ = commands_length1;
	{
		gint index = 0;
		index = 0;
		{
			gboolean _tmp84_ = FALSE;
			_tmp84_ = TRUE;
			while (TRUE) {
				GeeArrayList* _tmp86_;
				gint _tmp87_;
				gint _tmp88_;
				gchar** _tmp89_;
				gint _tmp89__length1;
				GeeArrayList* _tmp90_;
				gpointer _tmp91_;
				ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp92_;
				const gchar* _tmp93_;
				const gchar* _tmp94_;
				gchar* _tmp95_;
				gboolean _tmp96_ = FALSE;
				if (!_tmp84_) {
					gint _tmp85_;
					_tmp85_ = index;
					index = _tmp85_ + 1;
				}
				_tmp84_ = FALSE;
				_tmp86_ = results;
				_tmp87_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp86_);
				_tmp88_ = _tmp87_;
				if (!(index < _tmp88_)) {
					break;
				}
				_tmp89_ = commands;
				_tmp89__length1 = commands_length1;
				_tmp90_ = results;
				_tmp91_ = gee_abstract_list_get ((GeeAbstractList*) _tmp90_, index);
				_tmp92_ = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult*) _tmp91_;
				_tmp93_ = proton_plus_widgets_games_launch_options_editor_launch_command_write_result_get_launch_line (_tmp92_);
				_tmp94_ = _tmp93_;
				_tmp95_ = g_strdup (_tmp94_);
				_g_free0 (_tmp89_[index]);
				_tmp89_[index] = _tmp95_;
				_g_object_unref0 (_tmp92_);
				if (index > 0) {
					gchar** _tmp97_;
					gint _tmp97__length1;
					const gchar* _tmp98_;
					gchar** _tmp99_;
					gint _tmp99__length1;
					const gchar* _tmp100_;
					_tmp97_ = commands;
					_tmp97__length1 = commands_length1;
					_tmp98_ = _tmp97_[index];
					_tmp99_ = commands;
					_tmp99__length1 = commands_length1;
					_tmp100_ = _tmp99_[0];
					_tmp96_ = g_strcmp0 (_tmp98_, _tmp100_) != 0;
				} else {
					_tmp96_ = FALSE;
				}
				if (_tmp96_) {
					same_output = FALSE;
				}
			}
		}
	}
	_tmp102_ = blocked_result;
	if (_tmp102_ == NULL) {
		_tmp101_ = !same_output;
	} else {
		_tmp101_ = FALSE;
	}
	if (_tmp101_) {
		ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPreviewField* _tmp103_;
		GtkLabel* _tmp104_;
		GtkLabel* _tmp105_;
		GeeArrayList* _tmp106_;
		gint _tmp107_ = 0;
		gpointer* _tmp108_;
		gchar** _tmp109_;
		gint _tmp109__length1;
		gchar** _tmp110_;
		gint _tmp110__length1;
		gchar* _tmp111_;
		gchar* _tmp112_;
		ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPreviewField* _tmp113_;
		_tmp103_ = self->priv->_preview_field;
		_tmp104_ = proton_plus_widgets_games_launch_options_editor_launch_option_preview_field_get_preview_label (_tmp103_);
		_tmp105_ = _tmp104_;
		_tmp106_ = self->priv->preview_source_labels;
		_tmp108_ = gee_collection_to_array ((GeeCollection*) _tmp106_, &_tmp107_);
		_tmp109_ = _tmp108_;
		_tmp109__length1 = _tmp107_;
		_tmp110_ = commands;
		_tmp110__length1 = commands_length1;
		_tmp111_ = proton_plus_widgets_games_launch_options_editor_launch_options_list_build_labeled_command_preview_markup (_tmp109_, (gint) _tmp107_, _tmp110_, (gint) _tmp110__length1);
		_tmp112_ = _tmp111_;
		gtk_label_set_markup (_tmp105_, _tmp112_);
		_g_free0 (_tmp112_);
		_tmp109_ = (_vala_array_free (_tmp109_, _tmp109__length1, (GDestroyNotify) g_free), NULL);
		_tmp113_ = self->priv->_preview_field;
		proton_plus_widgets_games_launch_options_editor_launch_option_preview_field_set_empty (_tmp113_, FALSE);
	} else {
		ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPreviewField* _tmp114_;
		GtkLabel* _tmp115_;
		GtkLabel* _tmp116_;
		const gchar* _tmp117_;
		gchar* _tmp118_;
		gchar* _tmp119_;
		ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPreviewField* _tmp120_;
		const gchar* _tmp121_;
		_tmp114_ = self->priv->_preview_field;
		_tmp115_ = proton_plus_widgets_games_launch_options_editor_launch_option_preview_field_get_preview_label (_tmp114_);
		_tmp116_ = _tmp115_;
		_tmp117_ = preview;
		_tmp118_ = proton_plus_widgets_games_launch_options_editor_launch_options_list_build_command_preview_markup (_tmp117_);
		_tmp119_ = _tmp118_;
		gtk_label_set_markup (_tmp116_, _tmp119_);
		_g_free0 (_tmp119_);
		_tmp120_ = self->priv->_preview_field;
		_tmp121_ = preview;
		proton_plus_widgets_games_launch_options_editor_launch_option_preview_field_set_empty (_tmp120_, g_strcmp0 (_tmp121_, "") == 0);
	}
	_tmp123_ = _result_;
	_tmp124_ = proton_plus_widgets_games_launch_options_editor_launch_command_write_result_get_writing_allowed (_tmp123_);
	_tmp125_ = _tmp124_;
	if (!_tmp125_) {
		gboolean _tmp126_;
		gboolean _tmp127_;
		_tmp126_ = proton_plus_widgets_games_launch_options_editor_box_get_is_dirty (self);
		_tmp127_ = _tmp126_;
		_tmp122_ = _tmp127_;
	} else {
		_tmp122_ = FALSE;
	}
	_tmp128_ = self->priv->_preview_field;
	_tmp129_ = reason;
	proton_plus_widgets_games_launch_options_editor_launch_option_preview_field_set_attention_required (_tmp128_, _tmp122_, _tmp129_);
	commands = (_vala_array_free (commands, commands_length1, (GDestroyNotify) g_free), NULL);
	_g_free0 (reason);
	_g_free0 (preview);
	_g_object_unref0 (_result_);
	_g_object_unref0 (_tmp26_);
	_g_object_unref0 (blocked_result);
	_g_object_unref0 (results);
}

ProtonPlusWidgetsGamesLaunchOptionsEditorBox*
proton_plus_widgets_games_launch_options_editor_box_construct (GType object_type)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorBox * self = NULL;
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorBox*) g_object_new (object_type, NULL);
	return self;
}

ProtonPlusWidgetsGamesLaunchOptionsEditorBox*
proton_plus_widgets_games_launch_options_editor_box_new (void)
{
	return proton_plus_widgets_games_launch_options_editor_box_construct (PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_BOX);
}

static ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsProtonOptionsGroup*
proton_plus_widgets_games_launch_options_editor_box_get_proton_options_group (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsProtonOptionsGroup* result;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsProtonOptionsGroup* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_proton_options_group;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_launch_options_editor_box_set_proton_options_group (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                              ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsProtonOptionsGroup* value)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsProtonOptionsGroup* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_proton_options_group);
	self->priv->_proton_options_group = _tmp0_;
}

static ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup*
proton_plus_widgets_games_launch_options_editor_box_get_audio_group (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup* result;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_audio_group;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_launch_options_editor_box_set_audio_group (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                     ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup* value)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_audio_group);
	self->priv->_audio_group = _tmp0_;
}

static ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsMoreOptionsGroup*
proton_plus_widgets_games_launch_options_editor_box_get_more_options_group (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsMoreOptionsGroup* result;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsMoreOptionsGroup* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_more_options_group;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_launch_options_editor_box_set_more_options_group (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                            ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsMoreOptionsGroup* value)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsMoreOptionsGroup* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_more_options_group);
	self->priv->_more_options_group = _tmp0_;
}

static ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGameArgumentsGroup*
proton_plus_widgets_games_launch_options_editor_box_get_game_arguments_group (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGameArgumentsGroup* result;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGameArgumentsGroup* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_game_arguments_group;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_launch_options_editor_box_set_game_arguments_group (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                              ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGameArgumentsGroup* value)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGameArgumentsGroup* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_game_arguments_group);
	self->priv->_game_arguments_group = _tmp0_;
}

static ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroup*
proton_plus_widgets_games_launch_options_editor_box_get_advanced_options_group (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroup* result;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroup* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_advanced_options_group;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_launch_options_editor_box_set_advanced_options_group (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                                ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroup* value)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroup* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_advanced_options_group);
	self->priv->_advanced_options_group = _tmp0_;
}

static ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsCommonOptionsGroup*
proton_plus_widgets_games_launch_options_editor_box_get_common_group (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsCommonOptionsGroup* result;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsCommonOptionsGroup* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_common_group;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_launch_options_editor_box_set_common_group (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                      ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsCommonOptionsGroup* value)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsCommonOptionsGroup* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_common_group);
	self->priv->_common_group = _tmp0_;
}

static ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsDxvkOptionsGroup*
proton_plus_widgets_games_launch_options_editor_box_get_dxvk_options_group (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsDxvkOptionsGroup* result;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsDxvkOptionsGroup* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_dxvk_options_group;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_launch_options_editor_box_set_dxvk_options_group (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                            ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsDxvkOptionsGroup* value)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsDxvkOptionsGroup* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_dxvk_options_group);
	self->priv->_dxvk_options_group = _tmp0_;
}

static ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPreviewField*
proton_plus_widgets_games_launch_options_editor_box_get_preview_field (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPreviewField* result;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPreviewField* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_preview_field;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_launch_options_editor_box_set_preview_field (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                       ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPreviewField* value)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPreviewField* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_preview_field);
	self->priv->_preview_field = _tmp0_;
}

static AdwEntryRow*
proton_plus_widgets_games_launch_options_editor_box_get_search_entry (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	AdwEntryRow* result;
	AdwEntryRow* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_search_entry;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_launch_options_editor_box_set_search_entry (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                      AdwEntryRow* value)
{
	AdwEntryRow* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_search_entry);
	self->priv->_search_entry = _tmp0_;
}

static AdwComboRow*
proton_plus_widgets_games_launch_options_editor_box_get_category_filter (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	AdwComboRow* result;
	AdwComboRow* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_category_filter;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_launch_options_editor_box_set_category_filter (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                         AdwComboRow* value)
{
	AdwComboRow* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_category_filter);
	self->priv->_category_filter = _tmp0_;
}

static GtkLabel*
proton_plus_widgets_games_launch_options_editor_box_get_no_results_label (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	GtkLabel* result;
	GtkLabel* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_no_results_label;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_launch_options_editor_box_set_no_results_label (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                          GtkLabel* value)
{
	GtkLabel* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_no_results_label);
	self->priv->_no_results_label = _tmp0_;
}

static GtkBox*
proton_plus_widgets_games_launch_options_editor_box_get_categories_box (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	GtkBox* result;
	GtkBox* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_categories_box;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_launch_options_editor_box_set_categories_box (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self,
                                                                        GtkBox* value)
{
	GtkBox* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_categories_box);
	self->priv->_categories_box = _tmp0_;
}

ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandEditorProjectionState
proton_plus_widgets_games_launch_options_editor_box_get_projection_state (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandEditorProjectionState result;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandEditorProjection* _tmp0_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandEditorProjectionState _tmp1_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandEditorProjectionState _tmp2_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->priv->projection;
	_tmp1_ = proton_plus_widgets_games_launch_options_editor_launch_command_editor_projection_get_state (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

const gchar*
proton_plus_widgets_games_launch_options_editor_box_get_managed_candidate (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	const gchar* result;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandEditorProjection* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->projection;
	_tmp1_ = proton_plus_widgets_games_launch_options_editor_launch_command_editor_projection_get_managed_candidate (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

gboolean
proton_plus_widgets_games_launch_options_editor_box_get_has_managed_candidate (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	gboolean result;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandEditorProjection* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->projection;
	_tmp1_ = proton_plus_widgets_games_launch_options_editor_launch_command_editor_projection_get_has_managed_candidate (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

GeeList*
proton_plus_widgets_games_launch_options_editor_box_get_projection_diagnostics (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	GeeList* result;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandEditorProjection* _tmp0_;
	GeeArrayList* _tmp1_;
	GeeArrayList* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->projection;
	_tmp1_ = proton_plus_widgets_games_launch_options_editor_launch_command_editor_projection_get_adapter_diagnostics (_tmp0_);
	_tmp2_ = _tmp1_;
	result = (GeeList*) _tmp2_;
	return result;
}

GeeList*
proton_plus_widgets_games_launch_options_editor_box_get_projection_composition_diagnostics (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	GeeList* result;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandEditorProjection* _tmp0_;
	GeeArrayList* _tmp1_;
	GeeArrayList* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->projection;
	_tmp1_ = proton_plus_widgets_games_launch_options_editor_launch_command_editor_projection_get_composition_diagnostics (_tmp0_);
	_tmp2_ = _tmp1_;
	result = (GeeList*) _tmp2_;
	return result;
}

gboolean
proton_plus_widgets_games_launch_options_editor_box_get_is_dirty (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	gboolean result;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandEditState* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->edit_state;
	_tmp1_ = proton_plus_widgets_games_launch_options_editor_launch_command_edit_state_get_is_dirty (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

gboolean
proton_plus_widgets_games_launch_options_editor_box_get_writing_allowed (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	{
		GeeArrayList* _source_list = NULL;
		GeeArrayList* _tmp0_;
		gint _source_size = 0;
		GeeArrayList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		gint _source_index = 0;
		_tmp0_ = self->priv->preview_sources;
		_source_list = _tmp0_;
		_tmp1_ = _source_list;
		_tmp2_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp1_);
		_tmp3_ = _tmp2_;
		_source_size = _tmp3_;
		_source_index = -1;
		while (TRUE) {
			gint _tmp4_;
			gint _tmp5_;
			gchar* source = NULL;
			GeeArrayList* _tmp6_;
			gpointer _tmp7_;
			const gchar* _tmp8_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp9_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp10_;
			gboolean _tmp11_;
			gboolean _tmp12_;
			gboolean _tmp13_;
			_source_index = _source_index + 1;
			_tmp4_ = _source_index;
			_tmp5_ = _source_size;
			if (!(_tmp4_ < _tmp5_)) {
				break;
			}
			_tmp6_ = _source_list;
			_tmp7_ = gee_abstract_list_get ((GeeAbstractList*) _tmp6_, _source_index);
			source = (gchar*) _tmp7_;
			_tmp8_ = source;
			_tmp9_ = proton_plus_widgets_games_launch_options_editor_box_prepare_write_for_source (self, _tmp8_);
			_tmp10_ = _tmp9_;
			_tmp11_ = proton_plus_widgets_games_launch_options_editor_launch_command_write_result_get_writing_allowed (_tmp10_);
			_tmp12_ = _tmp11_;
			_tmp13_ = !_tmp12_;
			_g_object_unref0 (_tmp10_);
			if (_tmp13_) {
				result = FALSE;
				_g_free0 (source);
				return result;
			}
			_g_free0 (source);
		}
	}
	result = TRUE;
	return result;
}

GeeList*
proton_plus_widgets_games_launch_options_editor_box_get_write_diagnostics (ProtonPlusWidgetsGamesLaunchOptionsEditorBox* self)
{
	GeeList* result;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp0_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriteResult* _tmp1_;
	GeeArrayList* _tmp2_;
	GeeArrayList* _tmp3_;
	GeeList* _tmp4_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = proton_plus_widgets_games_launch_options_editor_box_prepare_write (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = proton_plus_widgets_games_launch_options_editor_launch_command_write_result_get_writer_diagnostics (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = (GeeList*) _tmp3_;
	_g_object_unref0 (_tmp1_);
	result = _tmp4_;
	return result;
}

static void
_proton_plus_widgets_games_launch_options_editor_box_standard_control_changed_proton_plus_widgets_games_launch_options_editor_groups_base_options_group_changed (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup* _sender,
                                                                                                                                                                 gpointer self)
{
	proton_plus_widgets_games_launch_options_editor_box_standard_control_changed ((ProtonPlusWidgetsGamesLaunchOptionsEditorBox*) self);
}

static void
_proton_plus_widgets_games_launch_options_editor_box_standard_control_changed_proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_options_group_changed (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorOptionsGroup* _sender,
                                                                                                                                                                       gpointer self)
{
	proton_plus_widgets_games_launch_options_editor_box_standard_control_changed ((ProtonPlusWidgetsGamesLaunchOptionsEditorBox*) self);
}

static GObject *
proton_plus_widgets_games_launch_options_editor_box_constructor (GType type,
                                                                 guint n_construct_properties,
                                                                 GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ProtonPlusWidgetsGamesLaunchOptionsEditorBox * self;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionsList* _tmp0_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCatalog* _tmp1_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCatalog* _tmp2_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* _tmp3_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCatalog* _tmp4_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandEditorProjection* _tmp5_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCatalog* _tmp6_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandWriter* _tmp7_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCatalog* _tmp8_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCapabilityResolver* _tmp9_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandEditState* _tmp10_;
	gchar* _tmp11_;
	GeeArrayList* _tmp12_;
	GeeArrayList* _tmp13_;
	GeeArrayList* _tmp14_;
	GeeArrayList* _tmp15_;
	const gchar* _tmp16_;
	GeeHashMap* _tmp17_;
	GeeHashMap* _tmp18_;
	GeeArrayList* _tmp19_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPreviewField* _tmp20_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPreviewField* _tmp21_;
	GtkWidget* _tmp22_;
	GtkWidget* _tmp23_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionsList* _tmp24_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* _tmp25_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsCommonOptionsGroup* _tmp26_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsCommonOptionsGroup* _tmp27_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsCommonOptionsGroup* _tmp28_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionsList* _tmp29_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* _tmp30_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsWrapperGroup* _tmp31_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* _tmp32_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandStaticSelectionSource* _tmp33_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandStaticSelectionSource* _tmp34_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsWrapperGroup* _tmp35_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionsList* _tmp36_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* _tmp37_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorOptionsGroup* _tmp38_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorOptionsGroup* _tmp39_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionsList* _tmp40_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* _tmp41_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsDxvkOptionsGroup* _tmp42_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsDxvkOptionsGroup* _tmp43_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsDxvkOptionsGroup* _tmp44_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionsList* _tmp45_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* _tmp46_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsVkd3dOptionsGroup* _tmp47_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsVkd3dOptionsGroup* _tmp48_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionsList* _tmp49_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* _tmp50_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsMoreOptionsGroup* _tmp51_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsMoreOptionsGroup* _tmp52_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsMoreOptionsGroup* _tmp53_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionsList* _tmp54_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* _tmp55_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsProtonOptionsGroup* _tmp56_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsProtonOptionsGroup* _tmp57_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsProtonOptionsGroup* _tmp58_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionsList* _tmp59_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* _tmp60_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup* _tmp61_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup* _tmp62_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup* _tmp63_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionsList* _tmp64_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* _tmp65_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGameArgumentsGroup* _tmp66_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGameArgumentsGroup* _tmp67_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGameArgumentsGroup* _tmp68_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionsList* _tmp69_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* _tmp70_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroup* _tmp71_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroup* _tmp72_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroup* _tmp73_;
	GtkBox* _tmp74_;
	GtkBox* _tmp75_;
	GtkBox* _tmp76_;
	gchar* _tmp77_;
	gchar** _tmp78_;
	GtkLabel* _tmp79_ = NULL;
	GtkLabel* _tmp80_;
	GtkLabel* _tmp81_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorOptionsGroup* _tmp82_;
	parent_class = G_OBJECT_CLASS (proton_plus_widgets_games_launch_options_editor_box_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_BOX, ProtonPlusWidgetsGamesLaunchOptionsEditorBox);
	_tmp0_ = proton_plus_widgets_games_launch_options_editor_launch_options_list_new ();
	_g_object_unref0 (self->priv->launch_option_handlers);
	self->priv->launch_option_handlers = _tmp0_;
	_tmp1_ = proton_plus_widgets_games_launch_options_editor_launch_option_catalog_new ();
	_g_object_unref0 (self->priv->catalog);
	self->priv->catalog = _tmp1_;
	_tmp2_ = self->priv->catalog;
	_tmp3_ = proton_plus_widgets_games_launch_options_editor_launch_option_presentation_registry_new (_tmp2_);
	_g_object_unref0 (self->priv->presentations);
	self->priv->presentations = _tmp3_;
	_tmp4_ = self->priv->catalog;
	_tmp5_ = proton_plus_widgets_games_launch_options_editor_launch_command_editor_projection_new (_tmp4_, NULL, NULL);
	_g_object_unref0 (self->priv->projection);
	self->priv->projection = _tmp5_;
	_tmp6_ = self->priv->catalog;
	_tmp7_ = proton_plus_widgets_games_launch_options_editor_launch_command_writer_new (_tmp6_, NULL, NULL);
	_g_object_unref0 (self->priv->writer);
	self->priv->writer = _tmp7_;
	_tmp8_ = self->priv->catalog;
	_tmp9_ = proton_plus_widgets_games_launch_options_editor_launch_option_capability_resolver_new (_tmp8_);
	_g_object_unref0 (self->priv->capability_resolver);
	self->priv->capability_resolver = _tmp9_;
	_tmp10_ = proton_plus_widgets_games_launch_options_editor_launch_command_edit_state_new ();
	_g_object_unref0 (self->priv->edit_state);
	self->priv->edit_state = _tmp10_;
	_tmp11_ = g_strdup ("");
	_g_free0 (self->priv->loaded_source);
	self->priv->loaded_source = _tmp11_;
	_tmp12_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->preview_source_labels);
	self->priv->preview_source_labels = _tmp12_;
	_tmp13_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->preview_sources);
	self->priv->preview_sources = _tmp13_;
	_tmp14_ = self->priv->preview_source_labels;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp14_, "");
	_tmp15_ = self->priv->preview_sources;
	_tmp16_ = self->priv->loaded_source;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp15_, _tmp16_);
	_tmp17_ = gee_hash_map_new (G_TYPE_INT, NULL, NULL, gtk_box_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->category_boxes);
	self->priv->category_boxes = _tmp17_;
	_tmp18_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, adw_preferences_group_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->subsection_groups);
	self->priv->subsection_groups = _tmp18_;
	_tmp19_ = gee_array_list_new (PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_VIEW, NULL, NULL, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->category_filter_views);
	self->priv->category_filter_views = _tmp19_;
	self->priv->refreshing_controls = TRUE;
	gtk_orientable_set_orientation ((GtkOrientable*) self, GTK_ORIENTATION_VERTICAL);
	gtk_box_set_spacing ((GtkBox*) self, 15);
	_tmp20_ = proton_plus_widgets_games_launch_options_editor_launch_option_preview_field_new (_ ("Command preview"));
	g_object_ref_sink (_tmp20_);
	_tmp21_ = _tmp20_;
	proton_plus_widgets_games_launch_options_editor_box_set_preview_field (self, _tmp21_);
	_g_object_unref0 (_tmp21_);
	_tmp22_ = proton_plus_widgets_games_launch_options_editor_box_create_navigation (self);
	_tmp23_ = _tmp22_;
	gtk_box_append ((GtkBox*) self, _tmp23_);
	_g_object_unref0 (_tmp23_);
	_tmp24_ = self->priv->launch_option_handlers;
	_tmp25_ = self->priv->presentations;
	_tmp26_ = proton_plus_widgets_games_launch_options_editor_groups_common_options_group_new (_tmp24_, _tmp25_);
	g_object_ref_sink (_tmp26_);
	_tmp27_ = _tmp26_;
	proton_plus_widgets_games_launch_options_editor_box_set_common_group (self, _tmp27_);
	_g_object_unref0 (_tmp27_);
	_tmp28_ = self->priv->_common_group;
	g_signal_connect_object ((ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup*) _tmp28_, "changed", (GCallback) _proton_plus_widgets_games_launch_options_editor_box_standard_control_changed_proton_plus_widgets_games_launch_options_editor_groups_base_options_group_changed, self, 0);
	_tmp29_ = self->priv->launch_option_handlers;
	_tmp30_ = self->priv->presentations;
	_tmp31_ = proton_plus_widgets_games_launch_options_editor_groups_wrapper_group_new (_tmp29_, _tmp30_);
	g_object_ref_sink (_tmp31_);
	_g_object_unref0 (self->priv->wrapper_group);
	self->priv->wrapper_group = _tmp31_;
	_tmp32_ = self->priv->presentations;
	_tmp33_ = proton_plus_widgets_games_launch_options_editor_launch_command_static_selection_source_new ("launch-backend", NULL, NULL);
	_tmp34_ = _tmp33_;
	proton_plus_widgets_games_launch_options_editor_launch_option_presentation_registry_register_selection_source (_tmp32_, "launch-backend", (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchCommandSelectionSource*) _tmp34_);
	_g_object_unref0 (_tmp34_);
	_tmp35_ = self->priv->wrapper_group;
	g_signal_connect_object ((ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup*) _tmp35_, "changed", (GCallback) _proton_plus_widgets_games_launch_options_editor_box_standard_control_changed_proton_plus_widgets_games_launch_options_editor_groups_base_options_group_changed, self, 0);
	_tmp36_ = self->priv->launch_option_handlers;
	_tmp37_ = self->priv->presentations;
	_tmp38_ = proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_options_group_new (_tmp36_, _tmp37_);
	g_object_ref_sink (_tmp38_);
	_g_object_unref0 (self->priv->gpu_vendor_group);
	self->priv->gpu_vendor_group = _tmp38_;
	_tmp39_ = self->priv->gpu_vendor_group;
	g_signal_connect_object (_tmp39_, "changed", (GCallback) _proton_plus_widgets_games_launch_options_editor_box_standard_control_changed_proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_options_group_changed, self, 0);
	_tmp40_ = self->priv->launch_option_handlers;
	_tmp41_ = self->priv->presentations;
	_tmp42_ = proton_plus_widgets_games_launch_options_editor_groups_dxvk_options_group_new (_tmp40_, _tmp41_);
	g_object_ref_sink (_tmp42_);
	_tmp43_ = _tmp42_;
	proton_plus_widgets_games_launch_options_editor_box_set_dxvk_options_group (self, _tmp43_);
	_g_object_unref0 (_tmp43_);
	_tmp44_ = self->priv->_dxvk_options_group;
	g_signal_connect_object ((ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup*) _tmp44_, "changed", (GCallback) _proton_plus_widgets_games_launch_options_editor_box_standard_control_changed_proton_plus_widgets_games_launch_options_editor_groups_base_options_group_changed, self, 0);
	_tmp45_ = self->priv->launch_option_handlers;
	_tmp46_ = self->priv->presentations;
	_tmp47_ = proton_plus_widgets_games_launch_options_editor_groups_vkd3d_options_group_new (_tmp45_, _tmp46_);
	g_object_ref_sink (_tmp47_);
	_g_object_unref0 (self->priv->vkd3d_options_group);
	self->priv->vkd3d_options_group = _tmp47_;
	_tmp48_ = self->priv->vkd3d_options_group;
	g_signal_connect_object ((ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup*) _tmp48_, "changed", (GCallback) _proton_plus_widgets_games_launch_options_editor_box_standard_control_changed_proton_plus_widgets_games_launch_options_editor_groups_base_options_group_changed, self, 0);
	_tmp49_ = self->priv->launch_option_handlers;
	_tmp50_ = self->priv->presentations;
	_tmp51_ = proton_plus_widgets_games_launch_options_editor_groups_more_options_group_new (_tmp49_, _tmp50_);
	g_object_ref_sink (_tmp51_);
	_tmp52_ = _tmp51_;
	proton_plus_widgets_games_launch_options_editor_box_set_more_options_group (self, _tmp52_);
	_g_object_unref0 (_tmp52_);
	_tmp53_ = self->priv->_more_options_group;
	g_signal_connect_object ((ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup*) _tmp53_, "changed", (GCallback) _proton_plus_widgets_games_launch_options_editor_box_standard_control_changed_proton_plus_widgets_games_launch_options_editor_groups_base_options_group_changed, self, 0);
	_tmp54_ = self->priv->launch_option_handlers;
	_tmp55_ = self->priv->presentations;
	_tmp56_ = proton_plus_widgets_games_launch_options_editor_groups_proton_options_group_new (_tmp54_, _tmp55_);
	g_object_ref_sink (_tmp56_);
	_tmp57_ = _tmp56_;
	proton_plus_widgets_games_launch_options_editor_box_set_proton_options_group (self, _tmp57_);
	_g_object_unref0 (_tmp57_);
	_tmp58_ = self->priv->_proton_options_group;
	g_signal_connect_object ((ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup*) _tmp58_, "changed", (GCallback) _proton_plus_widgets_games_launch_options_editor_box_standard_control_changed_proton_plus_widgets_games_launch_options_editor_groups_base_options_group_changed, self, 0);
	_tmp59_ = self->priv->launch_option_handlers;
	_tmp60_ = self->priv->presentations;
	_tmp61_ = proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_new (_tmp59_, _tmp60_);
	g_object_ref_sink (_tmp61_);
	_tmp62_ = _tmp61_;
	proton_plus_widgets_games_launch_options_editor_box_set_audio_group (self, _tmp62_);
	_g_object_unref0 (_tmp62_);
	_tmp63_ = self->priv->_audio_group;
	g_signal_connect_object ((ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup*) _tmp63_, "changed", (GCallback) _proton_plus_widgets_games_launch_options_editor_box_standard_control_changed_proton_plus_widgets_games_launch_options_editor_groups_base_options_group_changed, self, 0);
	_tmp64_ = self->priv->launch_option_handlers;
	_tmp65_ = self->priv->presentations;
	_tmp66_ = proton_plus_widgets_games_launch_options_editor_groups_game_arguments_group_new (_tmp64_, _tmp65_);
	g_object_ref_sink (_tmp66_);
	_tmp67_ = _tmp66_;
	proton_plus_widgets_games_launch_options_editor_box_set_game_arguments_group (self, _tmp67_);
	_g_object_unref0 (_tmp67_);
	_tmp68_ = self->priv->_game_arguments_group;
	g_signal_connect_object ((ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup*) _tmp68_, "changed", (GCallback) _proton_plus_widgets_games_launch_options_editor_box_standard_control_changed_proton_plus_widgets_games_launch_options_editor_groups_base_options_group_changed, self, 0);
	_tmp69_ = self->priv->launch_option_handlers;
	_tmp70_ = self->priv->presentations;
	_tmp71_ = proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_new (_tmp69_, _tmp70_);
	g_object_ref_sink (_tmp71_);
	_tmp72_ = _tmp71_;
	proton_plus_widgets_games_launch_options_editor_box_set_advanced_options_group (self, _tmp72_);
	_g_object_unref0 (_tmp72_);
	_tmp73_ = self->priv->_advanced_options_group;
	g_signal_connect_object ((ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup*) _tmp73_, "changed", (GCallback) _proton_plus_widgets_games_launch_options_editor_box_standard_control_changed_proton_plus_widgets_games_launch_options_editor_groups_base_options_group_changed, self, 0);
	_tmp74_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 18);
	g_object_ref_sink (_tmp74_);
	_tmp75_ = _tmp74_;
	proton_plus_widgets_games_launch_options_editor_box_set_categories_box (self, _tmp75_);
	_g_object_unref0 (_tmp75_);
	proton_plus_widgets_games_launch_options_editor_box_build_task_categories (self);
	_tmp76_ = self->priv->_categories_box;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp76_);
	_tmp77_ = g_strdup ("dim-label");
	_tmp78_ = g_new0 (gchar*, 1 + 1);
	_tmp78_[0] = _tmp77_;
	_tmp79_ = (GtkLabel*) gtk_label_new (_ ("No matching launch options."));
	gtk_widget_set_halign ((GtkWidget*) _tmp79_, GTK_ALIGN_CENTER);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp79_, 12);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp79_, 12);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp79_, _tmp78_);
	_tmp78_ = (_vala_array_free (_tmp78_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp79_);
	_tmp80_ = _tmp79_;
	proton_plus_widgets_games_launch_options_editor_box_set_no_results_label (self, _tmp80_);
	_g_object_unref0 (_tmp80_);
	_tmp81_ = self->priv->_no_results_label;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp81_);
	_tmp82_ = self->priv->gpu_vendor_group;
	proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_options_group_set_advanced_visible (_tmp82_, TRUE);
	self->priv->refreshing_controls = FALSE;
	proton_plus_widgets_games_launch_options_editor_box_refresh_state (self, FALSE);
	return obj;
}

static void
proton_plus_widgets_games_launch_options_editor_box_class_init (ProtonPlusWidgetsGamesLaunchOptionsEditorBoxClass * klass,
                                                                gpointer klass_data)
{
	proton_plus_widgets_games_launch_options_editor_box_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsGamesLaunchOptionsEditorBox_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_widgets_games_launch_options_editor_box_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_widgets_games_launch_options_editor_box_set_property;
	G_OBJECT_CLASS (klass)->constructor = proton_plus_widgets_games_launch_options_editor_box_constructor;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_games_launch_options_editor_box_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_PROJECTION_STATE_PROPERTY, proton_plus_widgets_games_launch_options_editor_box_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_PROJECTION_STATE_PROPERTY] = g_param_spec_enum ("projection-state", "projection-state", "projection-state", PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_COMMAND_EDITOR_PROJECTION_STATE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_MANAGED_CANDIDATE_PROPERTY, proton_plus_widgets_games_launch_options_editor_box_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_MANAGED_CANDIDATE_PROPERTY] = g_param_spec_string ("managed-candidate", "managed-candidate", "managed-candidate", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_HAS_MANAGED_CANDIDATE_PROPERTY, proton_plus_widgets_games_launch_options_editor_box_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_HAS_MANAGED_CANDIDATE_PROPERTY] = g_param_spec_boolean ("has-managed-candidate", "has-managed-candidate", "has-managed-candidate", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_PROJECTION_DIAGNOSTICS_PROPERTY, proton_plus_widgets_games_launch_options_editor_box_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_PROJECTION_DIAGNOSTICS_PROPERTY] = g_param_spec_object ("projection-diagnostics", "projection-diagnostics", "projection-diagnostics", GEE_TYPE_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_PROJECTION_COMPOSITION_DIAGNOSTICS_PROPERTY, proton_plus_widgets_games_launch_options_editor_box_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_PROJECTION_COMPOSITION_DIAGNOSTICS_PROPERTY] = g_param_spec_object ("projection-composition-diagnostics", "projection-composition-diagnostics", "projection-composition-diagnostics", GEE_TYPE_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_IS_DIRTY_PROPERTY, proton_plus_widgets_games_launch_options_editor_box_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_IS_DIRTY_PROPERTY] = g_param_spec_boolean ("is-dirty", "is-dirty", "is-dirty", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_WRITING_ALLOWED_PROPERTY, proton_plus_widgets_games_launch_options_editor_box_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_WRITING_ALLOWED_PROPERTY] = g_param_spec_boolean ("writing-allowed", "writing-allowed", "writing-allowed", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_WRITE_DIAGNOSTICS_PROPERTY, proton_plus_widgets_games_launch_options_editor_box_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_WRITE_DIAGNOSTICS_PROPERTY] = g_param_spec_object ("write-diagnostics", "write-diagnostics", "write-diagnostics", GEE_TYPE_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	proton_plus_widgets_games_launch_options_editor_box_signals[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_CONTENT_CHANGED_SIGNAL] = g_signal_new ("content-changed", PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_BOX, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
proton_plus_widgets_games_launch_options_editor_box_instance_init (ProtonPlusWidgetsGamesLaunchOptionsEditorBox * self,
                                                                   gpointer klass)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCategory* _tmp0_;
	self->priv = proton_plus_widgets_games_launch_options_editor_box_get_instance_private (self);
	_tmp0_ = g_new0 (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCategory, 8);
	_tmp0_[0] = PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CATEGORY_PERFORMANCE;
	_tmp0_[1] = PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CATEGORY_DISPLAY;
	_tmp0_[2] = PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CATEGORY_PROTON;
	_tmp0_[3] = PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CATEGORY_GRAPHICS;
	_tmp0_[4] = PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CATEGORY_HARDWARE;
	_tmp0_[5] = PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CATEGORY_INPUT_AUDIO;
	_tmp0_[6] = PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CATEGORY_GAME_ARGUMENTS;
	_tmp0_[7] = PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CATEGORY_DIAGNOSTICS;
	self->priv->canonical_categories = _tmp0_;
	self->priv->canonical_categories_length1 = 8;
	self->priv->_canonical_categories_size_ = self->priv->canonical_categories_length1;
}

static void
proton_plus_widgets_games_launch_options_editor_box_finalize (GObject * obj)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_BOX, ProtonPlusWidgetsGamesLaunchOptionsEditorBox);
	_g_object_unref0 (self->priv->_proton_options_group);
	_g_object_unref0 (self->priv->_audio_group);
	_g_object_unref0 (self->priv->_more_options_group);
	_g_object_unref0 (self->priv->_game_arguments_group);
	_g_object_unref0 (self->priv->_advanced_options_group);
	_g_object_unref0 (self->priv->_common_group);
	_g_object_unref0 (self->priv->_dxvk_options_group);
	_g_object_unref0 (self->priv->vkd3d_options_group);
	_g_object_unref0 (self->priv->gpu_vendor_group);
	_g_object_unref0 (self->priv->wrapper_group);
	_g_object_unref0 (self->priv->_preview_field);
	_g_object_unref0 (self->priv->launch_option_handlers);
	_g_object_unref0 (self->priv->catalog);
	_g_object_unref0 (self->priv->presentations);
	_g_object_unref0 (self->priv->projection);
	_g_object_unref0 (self->priv->writer);
	_g_object_unref0 (self->priv->capability_resolver);
	_g_object_unref0 (self->priv->capability_context);
	_g_object_unref0 (self->priv->edit_state);
	_g_free0 (self->priv->loaded_source);
	_g_object_unref0 (self->priv->preview_source_labels);
	_g_object_unref0 (self->priv->preview_sources);
	_g_object_unref0 (self->priv->_search_entry);
	_g_object_unref0 (self->priv->_category_filter);
	_g_object_unref0 (self->priv->category_filter_views);
	_g_object_unref0 (self->priv->_no_results_label);
	_g_object_unref0 (self->priv->_categories_box);
	_g_object_unref0 (self->priv->category_boxes);
	_g_object_unref0 (self->priv->subsection_groups);
	self->priv->canonical_categories = (g_free (self->priv->canonical_categories), NULL);
	G_OBJECT_CLASS (proton_plus_widgets_games_launch_options_editor_box_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_games_launch_options_editor_box_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorBoxClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_games_launch_options_editor_box_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorBox), 0, (GInstanceInitFunc) proton_plus_widgets_games_launch_options_editor_box_instance_init, NULL };
	GType proton_plus_widgets_games_launch_options_editor_box_type_id;
	proton_plus_widgets_games_launch_options_editor_box_type_id = g_type_register_static (gtk_box_get_type (), "ProtonPlusWidgetsGamesLaunchOptionsEditorBox", &g_define_type_info, 0);
	ProtonPlusWidgetsGamesLaunchOptionsEditorBox_private_offset = g_type_add_instance_private (proton_plus_widgets_games_launch_options_editor_box_type_id, sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorBoxPrivate));
	return proton_plus_widgets_games_launch_options_editor_box_type_id;
}

GType
proton_plus_widgets_games_launch_options_editor_box_get_type (void)
{
	static volatile gsize proton_plus_widgets_games_launch_options_editor_box_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_games_launch_options_editor_box_type_id__once)) {
		GType proton_plus_widgets_games_launch_options_editor_box_type_id;
		proton_plus_widgets_games_launch_options_editor_box_type_id = proton_plus_widgets_games_launch_options_editor_box_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_games_launch_options_editor_box_type_id__once, proton_plus_widgets_games_launch_options_editor_box_type_id);
	}
	return proton_plus_widgets_games_launch_options_editor_box_type_id__once;
}

static void
_vala_proton_plus_widgets_games_launch_options_editor_box_get_property (GObject * object,
                                                                        guint property_id,
                                                                        GValue * value,
                                                                        GParamSpec * pspec)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_BOX, ProtonPlusWidgetsGamesLaunchOptionsEditorBox);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_PROJECTION_STATE_PROPERTY:
		g_value_set_enum (value, proton_plus_widgets_games_launch_options_editor_box_get_projection_state (self));
		break;
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_MANAGED_CANDIDATE_PROPERTY:
		g_value_set_string (value, proton_plus_widgets_games_launch_options_editor_box_get_managed_candidate (self));
		break;
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_HAS_MANAGED_CANDIDATE_PROPERTY:
		g_value_set_boolean (value, proton_plus_widgets_games_launch_options_editor_box_get_has_managed_candidate (self));
		break;
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_PROJECTION_DIAGNOSTICS_PROPERTY:
		g_value_set_object (value, proton_plus_widgets_games_launch_options_editor_box_get_projection_diagnostics (self));
		break;
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_PROJECTION_COMPOSITION_DIAGNOSTICS_PROPERTY:
		g_value_set_object (value, proton_plus_widgets_games_launch_options_editor_box_get_projection_composition_diagnostics (self));
		break;
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_IS_DIRTY_PROPERTY:
		g_value_set_boolean (value, proton_plus_widgets_games_launch_options_editor_box_get_is_dirty (self));
		break;
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_WRITING_ALLOWED_PROPERTY:
		g_value_set_boolean (value, proton_plus_widgets_games_launch_options_editor_box_get_writing_allowed (self));
		break;
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BOX_WRITE_DIAGNOSTICS_PROPERTY:
		g_value_set_object (value, proton_plus_widgets_games_launch_options_editor_box_get_write_diagnostics (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

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

