/* default-tool-view.c generated by valac 0.56.19, the Vala compiler
 * generated from default-tool-view.vala, do not modify */

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

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define PROTON_PLUS_WIDGETS_TYPE_DEFAULT_TOOL_VIEW (proton_plus_widgets_default_tool_view_get_type ())
#define PROTON_PLUS_WIDGETS_DEFAULT_TOOL_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_TYPE_DEFAULT_TOOL_VIEW, ProtonPlusWidgetsDefaultToolView))
#define PROTON_PLUS_WIDGETS_DEFAULT_TOOL_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_TYPE_DEFAULT_TOOL_VIEW, ProtonPlusWidgetsDefaultToolViewClass))
#define PROTON_PLUS_WIDGETS_IS_DEFAULT_TOOL_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_TYPE_DEFAULT_TOOL_VIEW))
#define PROTON_PLUS_WIDGETS_IS_DEFAULT_TOOL_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_TYPE_DEFAULT_TOOL_VIEW))
#define PROTON_PLUS_WIDGETS_DEFAULT_TOOL_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_TYPE_DEFAULT_TOOL_VIEW, ProtonPlusWidgetsDefaultToolViewClass))

typedef struct _ProtonPlusWidgetsDefaultToolView ProtonPlusWidgetsDefaultToolView;
typedef struct _ProtonPlusWidgetsDefaultToolViewClass ProtonPlusWidgetsDefaultToolViewClass;
typedef struct _ProtonPlusWidgetsDefaultToolViewPrivate ProtonPlusWidgetsDefaultToolViewPrivate;

#define PROTON_PLUS_WIDGETS_TYPE_COMPATIBILITY_TOOL_ROW (proton_plus_widgets_compatibility_tool_row_get_type ())
#define PROTON_PLUS_WIDGETS_COMPATIBILITY_TOOL_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_TYPE_COMPATIBILITY_TOOL_ROW, ProtonPlusWidgetsCompatibilityToolRow))
#define PROTON_PLUS_WIDGETS_COMPATIBILITY_TOOL_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_TYPE_COMPATIBILITY_TOOL_ROW, ProtonPlusWidgetsCompatibilityToolRowClass))
#define PROTON_PLUS_WIDGETS_IS_COMPATIBILITY_TOOL_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_TYPE_COMPATIBILITY_TOOL_ROW))
#define PROTON_PLUS_WIDGETS_IS_COMPATIBILITY_TOOL_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_TYPE_COMPATIBILITY_TOOL_ROW))
#define PROTON_PLUS_WIDGETS_COMPATIBILITY_TOOL_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_TYPE_COMPATIBILITY_TOOL_ROW, ProtonPlusWidgetsCompatibilityToolRowClass))

typedef struct _ProtonPlusWidgetsCompatibilityToolRow ProtonPlusWidgetsCompatibilityToolRow;
typedef struct _ProtonPlusWidgetsCompatibilityToolRowClass ProtonPlusWidgetsCompatibilityToolRowClass;

#define PROTON_PLUS_MODELS_TYPE_LAUNCHER (proton_plus_models_launcher_get_type ())
#define PROTON_PLUS_MODELS_LAUNCHER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_MODELS_TYPE_LAUNCHER, ProtonPlusModelsLauncher))
#define PROTON_PLUS_MODELS_LAUNCHER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_MODELS_TYPE_LAUNCHER, ProtonPlusModelsLauncherClass))
#define PROTON_PLUS_MODELS_IS_LAUNCHER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_MODELS_TYPE_LAUNCHER))
#define PROTON_PLUS_MODELS_IS_LAUNCHER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_MODELS_TYPE_LAUNCHER))
#define PROTON_PLUS_MODELS_LAUNCHER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_MODELS_TYPE_LAUNCHER, ProtonPlusModelsLauncherClass))

typedef struct _ProtonPlusModelsLauncher ProtonPlusModelsLauncher;
typedef struct _ProtonPlusModelsLauncherClass ProtonPlusModelsLauncherClass;

#define PROTON_PLUS_MODELS_LAUNCHERS_TYPE_STEAM (proton_plus_models_launchers_steam_get_type ())
#define PROTON_PLUS_MODELS_LAUNCHERS_STEAM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_MODELS_LAUNCHERS_TYPE_STEAM, ProtonPlusModelsLaunchersSteam))
#define PROTON_PLUS_MODELS_LAUNCHERS_STEAM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_MODELS_LAUNCHERS_TYPE_STEAM, ProtonPlusModelsLaunchersSteamClass))
#define PROTON_PLUS_MODELS_LAUNCHERS_IS_STEAM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_MODELS_LAUNCHERS_TYPE_STEAM))
#define PROTON_PLUS_MODELS_LAUNCHERS_IS_STEAM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_MODELS_LAUNCHERS_TYPE_STEAM))
#define PROTON_PLUS_MODELS_LAUNCHERS_STEAM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_MODELS_LAUNCHERS_TYPE_STEAM, ProtonPlusModelsLaunchersSteamClass))

typedef struct _ProtonPlusModelsLaunchersSteam ProtonPlusModelsLaunchersSteam;
typedef struct _ProtonPlusModelsLaunchersSteamClass ProtonPlusModelsLaunchersSteamClass;
enum  {
	PROTON_PLUS_WIDGETS_DEFAULT_TOOL_VIEW_0_PROPERTY,
	PROTON_PLUS_WIDGETS_DEFAULT_TOOL_VIEW_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_default_tool_view_properties[PROTON_PLUS_WIDGETS_DEFAULT_TOOL_VIEW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define PROTON_PLUS_MODELS_TYPE_SIMPLE_RUNNER (proton_plus_models_simple_runner_get_type ())
#define PROTON_PLUS_MODELS_SIMPLE_RUNNER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_MODELS_TYPE_SIMPLE_RUNNER, ProtonPlusModelsSimpleRunner))
#define PROTON_PLUS_MODELS_SIMPLE_RUNNER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_MODELS_TYPE_SIMPLE_RUNNER, ProtonPlusModelsSimpleRunnerClass))
#define PROTON_PLUS_MODELS_IS_SIMPLE_RUNNER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_MODELS_TYPE_SIMPLE_RUNNER))
#define PROTON_PLUS_MODELS_IS_SIMPLE_RUNNER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_MODELS_TYPE_SIMPLE_RUNNER))
#define PROTON_PLUS_MODELS_SIMPLE_RUNNER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_MODELS_TYPE_SIMPLE_RUNNER, ProtonPlusModelsSimpleRunnerClass))

typedef struct _ProtonPlusModelsSimpleRunner ProtonPlusModelsSimpleRunner;
typedef struct _ProtonPlusModelsSimpleRunnerClass ProtonPlusModelsSimpleRunnerClass;
typedef struct _ProtonPlusModelsLauncherPrivate ProtonPlusModelsLauncherPrivate;

#define PROTON_PLUS_MODELS_TYPE_GAME (proton_plus_models_game_get_type ())
#define PROTON_PLUS_MODELS_GAME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_MODELS_TYPE_GAME, ProtonPlusModelsGame))
#define PROTON_PLUS_MODELS_GAME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_MODELS_TYPE_GAME, ProtonPlusModelsGameClass))
#define PROTON_PLUS_MODELS_IS_GAME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_MODELS_TYPE_GAME))
#define PROTON_PLUS_MODELS_IS_GAME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_MODELS_TYPE_GAME))
#define PROTON_PLUS_MODELS_GAME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_MODELS_TYPE_GAME, ProtonPlusModelsGameClass))

typedef struct _ProtonPlusModelsGame ProtonPlusModelsGame;
typedef struct _ProtonPlusModelsGameClass ProtonPlusModelsGameClass;

#define PROTON_PLUS_MODELS_TYPE_GROUP (proton_plus_models_group_get_type ())
#define PROTON_PLUS_MODELS_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_MODELS_TYPE_GROUP, ProtonPlusModelsGroup))
#define PROTON_PLUS_MODELS_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_MODELS_TYPE_GROUP, ProtonPlusModelsGroupClass))
#define PROTON_PLUS_MODELS_IS_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_MODELS_TYPE_GROUP))
#define PROTON_PLUS_MODELS_IS_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_MODELS_TYPE_GROUP))
#define PROTON_PLUS_MODELS_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_MODELS_TYPE_GROUP, ProtonPlusModelsGroupClass))

typedef struct _ProtonPlusModelsGroup ProtonPlusModelsGroup;
typedef struct _ProtonPlusModelsGroupClass ProtonPlusModelsGroupClass;
typedef enum  {
	PROTON_PLUS_MODELS_LAUNCHER_INSTALLATION_TYPES_SYSTEM,
	PROTON_PLUS_MODELS_LAUNCHER_INSTALLATION_TYPES_FLATPAK,
	PROTON_PLUS_MODELS_LAUNCHER_INSTALLATION_TYPES_SNAP
} ProtonPlusModelsLauncherInstallationTypes;

#define PROTON_PLUS_MODELS_LAUNCHER_TYPE_INSTALLATION_TYPES (proton_plus_models_launcher_installation_types_get_type ())
#define _gtk_expression_unref0(var) ((var == NULL) ? NULL : (var = (gtk_expression_unref (var), NULL)))

#define PROTON_PLUS_WIDGETS_TYPE_ERROR_DIALOG (proton_plus_widgets_error_dialog_get_type ())
#define PROTON_PLUS_WIDGETS_ERROR_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_TYPE_ERROR_DIALOG, ProtonPlusWidgetsErrorDialog))
#define PROTON_PLUS_WIDGETS_ERROR_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_TYPE_ERROR_DIALOG, ProtonPlusWidgetsErrorDialogClass))
#define PROTON_PLUS_WIDGETS_IS_ERROR_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_TYPE_ERROR_DIALOG))
#define PROTON_PLUS_WIDGETS_IS_ERROR_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_TYPE_ERROR_DIALOG))
#define PROTON_PLUS_WIDGETS_ERROR_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_TYPE_ERROR_DIALOG, ProtonPlusWidgetsErrorDialogClass))

typedef struct _ProtonPlusWidgetsErrorDialog ProtonPlusWidgetsErrorDialog;
typedef struct _ProtonPlusWidgetsErrorDialogClass ProtonPlusWidgetsErrorDialogClass;

#define PROTON_PLUS_WIDGETS_TYPE_WINDOW (proton_plus_widgets_window_get_type ())
#define PROTON_PLUS_WIDGETS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_TYPE_WINDOW, ProtonPlusWidgetsWindow))
#define PROTON_PLUS_WIDGETS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_TYPE_WINDOW, ProtonPlusWidgetsWindowClass))
#define PROTON_PLUS_WIDGETS_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_TYPE_WINDOW))
#define PROTON_PLUS_WIDGETS_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_TYPE_WINDOW))
#define PROTON_PLUS_WIDGETS_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_TYPE_WINDOW, ProtonPlusWidgetsWindowClass))

typedef struct _ProtonPlusWidgetsWindow ProtonPlusWidgetsWindow;
typedef struct _ProtonPlusWidgetsWindowClass ProtonPlusWidgetsWindowClass;
enum  {
	PROTON_PLUS_WIDGETS_DEFAULT_TOOL_VIEW_BACK_REQUESTED_SIGNAL,
	PROTON_PLUS_WIDGETS_DEFAULT_TOOL_VIEW_NUM_SIGNALS
};
static guint proton_plus_widgets_default_tool_view_signals[PROTON_PLUS_WIDGETS_DEFAULT_TOOL_VIEW_NUM_SIGNALS] = {0};

struct _ProtonPlusWidgetsDefaultToolView {
	GtkBox parent_instance;
	ProtonPlusWidgetsDefaultToolViewPrivate * priv;
};

struct _ProtonPlusWidgetsDefaultToolViewClass {
	GtkBoxClass parent_class;
};

struct _ProtonPlusWidgetsDefaultToolViewPrivate {
	AdwWindowTitle* _window_title;
	GtkButton* _back_button;
	GtkButton* _clear_button;
	GtkButton* _apply_button;
	AdwHeaderBar* _header_bar;
	AdwToolbarView* _toolbar_view;
	AdwPreferencesGroup* _content_group;
	ProtonPlusWidgetsCompatibilityToolRow* _compatibility_tool_row;
	ProtonPlusModelsLaunchersSteam* _launcher;
	guint _applied_selected_index;
	gboolean _applied_verified;
};

struct _ProtonPlusModelsLauncher {
	GObject parent_instance;
	ProtonPlusModelsLauncherPrivate * priv;
	gchar* title;
	gchar* icon_path;
	gchar* directory;
	gboolean installed;
	gboolean has_library_support;
	GList* games;
	GeeArrayList* compatibility_tools;
	ProtonPlusModelsGroup** groups;
	gint groups_length1;
	ProtonPlusModelsLauncherInstallationTypes installation_type;
};

struct _ProtonPlusModelsLauncherClass {
	GObjectClass parent_class;
	void (*load_game_library) (ProtonPlusModelsLauncher* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	gboolean (*load_game_library_finish) (ProtonPlusModelsLauncher* self, GAsyncResult* _res_);
	gint (*get_compatibility_tool_usage_count) (ProtonPlusModelsLauncher* self, const gchar* compatibility_tool_name);
};

static gint ProtonPlusWidgetsDefaultToolView_private_offset;
static gpointer proton_plus_widgets_default_tool_view_parent_class = NULL;
VALA_EXTERN ProtonPlusWidgetsWindow* proton_plus_widgets_application_window;

VALA_EXTERN GType proton_plus_widgets_default_tool_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusWidgetsDefaultToolView, g_object_unref)
VALA_EXTERN GType proton_plus_widgets_compatibility_tool_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusWidgetsCompatibilityToolRow, g_object_unref)
VALA_EXTERN GType proton_plus_models_launcher_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusModelsLauncher, g_object_unref)
VALA_EXTERN GType proton_plus_models_launchers_steam_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusModelsLaunchersSteam, g_object_unref)
VALA_EXTERN void proton_plus_widgets_default_tool_view_load (ProtonPlusWidgetsDefaultToolView* self,
                                                 ProtonPlusModelsLaunchersSteam* launcher);
static void proton_plus_widgets_default_tool_view_set_launcher (ProtonPlusWidgetsDefaultToolView* self,
                                                         ProtonPlusModelsLaunchersSteam* value);
static ProtonPlusWidgetsCompatibilityToolRow* proton_plus_widgets_default_tool_view_get_compatibility_tool_row (ProtonPlusWidgetsDefaultToolView* self);
static AdwPreferencesGroup* proton_plus_widgets_default_tool_view_get_content_group (ProtonPlusWidgetsDefaultToolView* self);
VALA_EXTERN GType proton_plus_models_simple_runner_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusModelsSimpleRunner, g_object_unref)
VALA_EXTERN GType proton_plus_models_game_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusModelsGame, g_object_unref)
VALA_EXTERN GType proton_plus_models_group_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusModelsGroup, g_object_unref)
VALA_EXTERN GType proton_plus_models_launcher_installation_types_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ProtonPlusWidgetsCompatibilityToolRow* proton_plus_widgets_compatibility_tool_row_new (GListStore* model,
                                                                                       GtkPropertyExpression* expression);
VALA_EXTERN ProtonPlusWidgetsCompatibilityToolRow* proton_plus_widgets_compatibility_tool_row_construct (GType object_type,
                                                                                             GListStore* model,
                                                                                             GtkPropertyExpression* expression);
static void proton_plus_widgets_default_tool_view_set_compatibility_tool_row (ProtonPlusWidgetsDefaultToolView* self,
                                                                       ProtonPlusWidgetsCompatibilityToolRow* value);
static void proton_plus_widgets_default_tool_view_compatibility_tool_selection_changed (ProtonPlusWidgetsDefaultToolView* self);
static void _proton_plus_widgets_default_tool_view_compatibility_tool_selection_changed_g_object_notify (GObject* _sender,
                                                                                                  GParamSpec* pspec,
                                                                                                  gpointer self);
static void proton_plus_widgets_default_tool_view_select_current_default_tool (ProtonPlusWidgetsDefaultToolView* self);
static void proton_plus_widgets_default_tool_view_set_applied_selected_index (ProtonPlusWidgetsDefaultToolView* self,
                                                                       guint value);
static void proton_plus_widgets_default_tool_view_set_applied_verified (ProtonPlusWidgetsDefaultToolView* self,
                                                                 gboolean value);
static void proton_plus_widgets_default_tool_view_refresh_apply_button (ProtonPlusWidgetsDefaultToolView* self);
static ProtonPlusModelsLaunchersSteam* proton_plus_widgets_default_tool_view_get_launcher (ProtonPlusWidgetsDefaultToolView* self);
VALA_EXTERN const gchar* proton_plus_models_simple_runner_get_internal_title (ProtonPlusModelsSimpleRunner* self);
VALA_EXTERN const gchar* proton_plus_models_launchers_steam_get_default_compatibility_tool (ProtonPlusModelsLaunchersSteam* self);
static void proton_plus_widgets_default_tool_view_clear_button_clicked (ProtonPlusWidgetsDefaultToolView* self);
static guint proton_plus_widgets_default_tool_view_get_applied_selected_index (ProtonPlusWidgetsDefaultToolView* self);
static void proton_plus_widgets_default_tool_view_apply_button_clicked (ProtonPlusWidgetsDefaultToolView* self);
VALA_EXTERN gboolean proton_plus_models_launchers_steam_change_default_compatibility_tool (ProtonPlusModelsLaunchersSteam* self,
                                                                               const gchar* compatibility_tool);
VALA_EXTERN GType proton_plus_widgets_error_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusWidgetsErrorDialog, g_object_unref)
VALA_EXTERN ProtonPlusWidgetsErrorDialog* proton_plus_widgets_error_dialog_new (const gchar* heading,
                                                                    const gchar* body);
VALA_EXTERN ProtonPlusWidgetsErrorDialog* proton_plus_widgets_error_dialog_construct (GType object_type,
                                                                          const gchar* heading,
                                                                          const gchar* body);
VALA_EXTERN GType proton_plus_widgets_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusWidgetsWindow, g_object_unref)
static GtkButton* proton_plus_widgets_default_tool_view_get_clear_button (ProtonPlusWidgetsDefaultToolView* self);
static GtkButton* proton_plus_widgets_default_tool_view_get_apply_button (ProtonPlusWidgetsDefaultToolView* self);
VALA_EXTERN ProtonPlusWidgetsDefaultToolView* proton_plus_widgets_default_tool_view_new (void);
VALA_EXTERN ProtonPlusWidgetsDefaultToolView* proton_plus_widgets_default_tool_view_construct (GType object_type);
static AdwWindowTitle* proton_plus_widgets_default_tool_view_get_window_title (ProtonPlusWidgetsDefaultToolView* self);
static void proton_plus_widgets_default_tool_view_set_window_title (ProtonPlusWidgetsDefaultToolView* self,
                                                             AdwWindowTitle* value);
static GtkButton* proton_plus_widgets_default_tool_view_get_back_button (ProtonPlusWidgetsDefaultToolView* self);
static void proton_plus_widgets_default_tool_view_set_back_button (ProtonPlusWidgetsDefaultToolView* self,
                                                            GtkButton* value);
static void proton_plus_widgets_default_tool_view_set_clear_button (ProtonPlusWidgetsDefaultToolView* self,
                                                             GtkButton* value);
static void proton_plus_widgets_default_tool_view_set_apply_button (ProtonPlusWidgetsDefaultToolView* self,
                                                             GtkButton* value);
static AdwHeaderBar* proton_plus_widgets_default_tool_view_get_header_bar (ProtonPlusWidgetsDefaultToolView* self);
static void proton_plus_widgets_default_tool_view_set_header_bar (ProtonPlusWidgetsDefaultToolView* self,
                                                           AdwHeaderBar* value);
static AdwToolbarView* proton_plus_widgets_default_tool_view_get_toolbar_view (ProtonPlusWidgetsDefaultToolView* self);
static void proton_plus_widgets_default_tool_view_set_toolbar_view (ProtonPlusWidgetsDefaultToolView* self,
                                                             AdwToolbarView* value);
static void proton_plus_widgets_default_tool_view_set_content_group (ProtonPlusWidgetsDefaultToolView* self,
                                                              AdwPreferencesGroup* value);
static gboolean proton_plus_widgets_default_tool_view_get_applied_verified (ProtonPlusWidgetsDefaultToolView* self);
static GObject * proton_plus_widgets_default_tool_view_constructor (GType type,
                                                             guint n_construct_properties,
                                                             GObjectConstructParam * construct_properties);
static void _proton_plus_widgets_default_tool_view___lambda48_ (ProtonPlusWidgetsDefaultToolView* self);
static void __proton_plus_widgets_default_tool_view___lambda48__gtk_button_clicked (GtkButton* _sender,
                                                                             gpointer self);
static void _proton_plus_widgets_default_tool_view_clear_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                     gpointer self);
static void _proton_plus_widgets_default_tool_view_apply_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                     gpointer self);
static void proton_plus_widgets_default_tool_view_finalize (GObject * obj);
static GType proton_plus_widgets_default_tool_view_get_type_once (void);
static void _vala_proton_plus_widgets_default_tool_view_get_property (GObject * object,
                                                               guint property_id,
                                                               GValue * value,
                                                               GParamSpec * pspec);
static void _vala_proton_plus_widgets_default_tool_view_set_property (GObject * object,
                                                               guint property_id,
                                                               const GValue * value,
                                                               GParamSpec * pspec);

static inline gpointer
proton_plus_widgets_default_tool_view_get_instance_private (ProtonPlusWidgetsDefaultToolView* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsDefaultToolView_private_offset);
}

static void
_proton_plus_widgets_default_tool_view_compatibility_tool_selection_changed_g_object_notify (GObject* _sender,
                                                                                             GParamSpec* pspec,
                                                                                             gpointer self)
{
	proton_plus_widgets_default_tool_view_compatibility_tool_selection_changed ((ProtonPlusWidgetsDefaultToolView*) self);
}

void
proton_plus_widgets_default_tool_view_load (ProtonPlusWidgetsDefaultToolView* self,
                                            ProtonPlusModelsLaunchersSteam* launcher)
{
	ProtonPlusWidgetsCompatibilityToolRow* _tmp0_;
	GListStore* model = NULL;
	GListStore* _tmp3_;
	GtkPropertyExpression* expression = NULL;
	GtkPropertyExpression* _tmp14_;
	GListStore* _tmp15_;
	ProtonPlusWidgetsCompatibilityToolRow* _tmp16_;
	ProtonPlusWidgetsCompatibilityToolRow* _tmp17_;
	ProtonPlusWidgetsCompatibilityToolRow* _tmp18_;
	ProtonPlusWidgetsCompatibilityToolRow* _tmp19_;
	ProtonPlusWidgetsCompatibilityToolRow* _tmp20_;
	AdwPreferencesGroup* _tmp21_;
	ProtonPlusWidgetsCompatibilityToolRow* _tmp22_;
	ProtonPlusWidgetsCompatibilityToolRow* _tmp23_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (launcher != NULL);
	proton_plus_widgets_default_tool_view_set_launcher (self, launcher);
	_tmp0_ = self->priv->_compatibility_tool_row;
	if (_tmp0_ != NULL) {
		AdwPreferencesGroup* _tmp1_;
		ProtonPlusWidgetsCompatibilityToolRow* _tmp2_;
		_tmp1_ = self->priv->_content_group;
		_tmp2_ = self->priv->_compatibility_tool_row;
		adw_preferences_group_remove (_tmp1_, (GtkWidget*) _tmp2_);
	}
	_tmp3_ = g_list_store_new (PROTON_PLUS_MODELS_TYPE_SIMPLE_RUNNER);
	model = _tmp3_;
	{
		GeeArrayList* _compatibility_tool_list = NULL;
		GeeArrayList* _tmp4_;
		gint _compatibility_tool_size = 0;
		GeeArrayList* _tmp5_;
		gint _tmp6_;
		gint _tmp7_;
		gint _compatibility_tool_index = 0;
		_tmp4_ = ((ProtonPlusModelsLauncher*) launcher)->compatibility_tools;
		_compatibility_tool_list = _tmp4_;
		_tmp5_ = _compatibility_tool_list;
		_tmp6_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp5_);
		_tmp7_ = _tmp6_;
		_compatibility_tool_size = _tmp7_;
		_compatibility_tool_index = -1;
		while (TRUE) {
			gint _tmp8_;
			gint _tmp9_;
			ProtonPlusModelsSimpleRunner* compatibility_tool = NULL;
			GeeArrayList* _tmp10_;
			gpointer _tmp11_;
			GListStore* _tmp12_;
			ProtonPlusModelsSimpleRunner* _tmp13_;
			_compatibility_tool_index = _compatibility_tool_index + 1;
			_tmp8_ = _compatibility_tool_index;
			_tmp9_ = _compatibility_tool_size;
			if (!(_tmp8_ < _tmp9_)) {
				break;
			}
			_tmp10_ = _compatibility_tool_list;
			_tmp11_ = gee_abstract_list_get ((GeeAbstractList*) _tmp10_, _compatibility_tool_index);
			compatibility_tool = (ProtonPlusModelsSimpleRunner*) _tmp11_;
			_tmp12_ = model;
			_tmp13_ = compatibility_tool;
			g_list_store_append (_tmp12_, (GObject*) _tmp13_);
			_g_object_unref0 (compatibility_tool);
		}
	}
	_tmp14_ = (GtkPropertyExpression*) gtk_property_expression_new (PROTON_PLUS_MODELS_TYPE_SIMPLE_RUNNER, NULL, "display_title");
	expression = _tmp14_;
	_tmp15_ = model;
	_tmp16_ = proton_plus_widgets_compatibility_tool_row_new (_tmp15_, expression);
	g_object_ref_sink (_tmp16_);
	_tmp17_ = _tmp16_;
	proton_plus_widgets_default_tool_view_set_compatibility_tool_row (self, _tmp17_);
	_g_object_unref0 (_tmp17_);
	_tmp18_ = self->priv->_compatibility_tool_row;
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp18_, _ ("Compatibility tool"));
	_tmp19_ = self->priv->_compatibility_tool_row;
	adw_action_row_set_subtitle ((AdwActionRow*) _tmp19_, _ ("Choose the default compatibility tool Steam should use for games witho" \
"ut an explicit override."));
	_tmp20_ = self->priv->_compatibility_tool_row;
	g_signal_connect_object ((GObject*) _tmp20_, "notify::selected", (GCallback) _proton_plus_widgets_default_tool_view_compatibility_tool_selection_changed_g_object_notify, self, 0);
	_tmp21_ = self->priv->_content_group;
	_tmp22_ = self->priv->_compatibility_tool_row;
	adw_preferences_group_add (_tmp21_, (GtkWidget*) _tmp22_);
	proton_plus_widgets_default_tool_view_select_current_default_tool (self);
	_tmp23_ = self->priv->_compatibility_tool_row;
	proton_plus_widgets_default_tool_view_set_applied_selected_index (self, adw_combo_row_get_selected ((AdwComboRow*) _tmp23_));
	proton_plus_widgets_default_tool_view_set_applied_verified (self, FALSE);
	proton_plus_widgets_default_tool_view_refresh_apply_button (self);
	_gtk_expression_unref0 (expression);
	_g_object_unref0 (model);
}

static void
proton_plus_widgets_default_tool_view_compatibility_tool_selection_changed (ProtonPlusWidgetsDefaultToolView* self)
{
	g_return_if_fail (self != NULL);
	proton_plus_widgets_default_tool_view_refresh_apply_button (self);
}

static void
proton_plus_widgets_default_tool_view_select_current_default_tool (ProtonPlusWidgetsDefaultToolView* self)
{
	ProtonPlusWidgetsCompatibilityToolRow* _tmp17_;
	g_return_if_fail (self != NULL);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				ProtonPlusModelsLaunchersSteam* _tmp2_;
				GeeArrayList* _tmp3_;
				gint _tmp4_;
				gint _tmp5_;
				ProtonPlusModelsLaunchersSteam* _tmp6_;
				GeeArrayList* _tmp7_;
				gpointer _tmp8_;
				ProtonPlusModelsSimpleRunner* _tmp9_;
				const gchar* _tmp10_;
				const gchar* _tmp11_;
				ProtonPlusModelsLaunchersSteam* _tmp12_;
				const gchar* _tmp13_;
				const gchar* _tmp14_;
				gboolean _tmp15_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp2_ = self->priv->_launcher;
				_tmp3_ = ((ProtonPlusModelsLauncher*) _tmp2_)->compatibility_tools;
				_tmp4_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp3_);
				_tmp5_ = _tmp4_;
				if (!(i < _tmp5_)) {
					break;
				}
				_tmp6_ = self->priv->_launcher;
				_tmp7_ = ((ProtonPlusModelsLauncher*) _tmp6_)->compatibility_tools;
				_tmp8_ = gee_abstract_list_get ((GeeAbstractList*) _tmp7_, i);
				_tmp9_ = (ProtonPlusModelsSimpleRunner*) _tmp8_;
				_tmp10_ = proton_plus_models_simple_runner_get_internal_title (_tmp9_);
				_tmp11_ = _tmp10_;
				_tmp12_ = self->priv->_launcher;
				_tmp13_ = proton_plus_models_launchers_steam_get_default_compatibility_tool (_tmp12_);
				_tmp14_ = _tmp13_;
				_tmp15_ = g_strcmp0 (_tmp11_, _tmp14_) == 0;
				_g_object_unref0 (_tmp9_);
				if (_tmp15_) {
					ProtonPlusWidgetsCompatibilityToolRow* _tmp16_;
					_tmp16_ = self->priv->_compatibility_tool_row;
					adw_combo_row_set_selected ((AdwComboRow*) _tmp16_, (guint) i);
					return;
				}
			}
		}
	}
	_tmp17_ = self->priv->_compatibility_tool_row;
	adw_combo_row_set_selected ((AdwComboRow*) _tmp17_, (guint) 0);
}

static void
proton_plus_widgets_default_tool_view_clear_button_clicked (ProtonPlusWidgetsDefaultToolView* self)
{
	ProtonPlusWidgetsCompatibilityToolRow* _tmp0_;
	ProtonPlusWidgetsCompatibilityToolRow* _tmp1_;
	guint _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_compatibility_tool_row;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->priv->_compatibility_tool_row;
	_tmp2_ = self->priv->_applied_selected_index;
	adw_combo_row_set_selected ((AdwComboRow*) _tmp1_, _tmp2_);
	proton_plus_widgets_default_tool_view_refresh_apply_button (self);
}

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

static void
proton_plus_widgets_default_tool_view_apply_button_clicked (ProtonPlusWidgetsDefaultToolView* self)
{
	gboolean _tmp0_ = FALSE;
	ProtonPlusModelsLaunchersSteam* _tmp1_;
	ProtonPlusModelsSimpleRunner* item = NULL;
	ProtonPlusWidgetsCompatibilityToolRow* _tmp3_;
	GObject* _tmp4_;
	ProtonPlusModelsSimpleRunner* _tmp5_;
	ProtonPlusModelsSimpleRunner* _tmp6_;
	gboolean success = FALSE;
	ProtonPlusModelsLaunchersSteam* _tmp7_;
	ProtonPlusModelsSimpleRunner* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	ProtonPlusWidgetsCompatibilityToolRow* _tmp14_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->_launcher;
	if (_tmp1_ == NULL) {
		_tmp0_ = TRUE;
	} else {
		ProtonPlusWidgetsCompatibilityToolRow* _tmp2_;
		_tmp2_ = self->priv->_compatibility_tool_row;
		_tmp0_ = _tmp2_ == NULL;
	}
	if (_tmp0_) {
		return;
	}
	_tmp3_ = self->priv->_compatibility_tool_row;
	_tmp4_ = adw_combo_row_get_selected_item ((AdwComboRow*) _tmp3_);
	_tmp5_ = _g_object_ref0 (PROTON_PLUS_MODELS_IS_SIMPLE_RUNNER (_tmp4_) ? ((ProtonPlusModelsSimpleRunner*) _tmp4_) : NULL);
	item = _tmp5_;
	_tmp6_ = item;
	if (_tmp6_ == NULL) {
		_g_object_unref0 (item);
		return;
	}
	_tmp7_ = self->priv->_launcher;
	_tmp8_ = item;
	_tmp9_ = proton_plus_models_simple_runner_get_internal_title (_tmp8_);
	_tmp10_ = _tmp9_;
	success = proton_plus_models_launchers_steam_change_default_compatibility_tool (_tmp7_, _tmp10_);
	if (!success) {
		ProtonPlusWidgetsErrorDialog* dialog = NULL;
		ProtonPlusWidgetsErrorDialog* _tmp11_;
		ProtonPlusWidgetsErrorDialog* _tmp12_;
		ProtonPlusWidgetsWindow* _tmp13_;
		_tmp11_ = proton_plus_widgets_error_dialog_new (_ ("Couldn't change the default compatibility tool"), _ ("Please report this issue on GitHub."));
		g_object_ref_sink (_tmp11_);
		dialog = _tmp11_;
		_tmp12_ = dialog;
		_tmp13_ = proton_plus_widgets_application_window;
		adw_dialog_present ((AdwDialog*) _tmp12_, (GtkWidget*) _tmp13_);
		_g_object_unref0 (dialog);
		_g_object_unref0 (item);
		return;
	}
	_tmp14_ = self->priv->_compatibility_tool_row;
	proton_plus_widgets_default_tool_view_set_applied_selected_index (self, adw_combo_row_get_selected ((AdwComboRow*) _tmp14_));
	proton_plus_widgets_default_tool_view_set_applied_verified (self, TRUE);
	proton_plus_widgets_default_tool_view_refresh_apply_button (self);
	_g_object_unref0 (item);
}

static void
proton_plus_widgets_default_tool_view_refresh_apply_button (ProtonPlusWidgetsDefaultToolView* self)
{
	gboolean _tmp0_ = FALSE;
	ProtonPlusWidgetsCompatibilityToolRow* _tmp1_;
	gboolean has_changes = FALSE;
	GtkButton* _tmp4_;
	GtkButton* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->_compatibility_tool_row;
	if (_tmp1_ != NULL) {
		ProtonPlusWidgetsCompatibilityToolRow* _tmp2_;
		guint _tmp3_;
		_tmp2_ = self->priv->_compatibility_tool_row;
		_tmp3_ = self->priv->_applied_selected_index;
		_tmp0_ = adw_combo_row_get_selected ((AdwComboRow*) _tmp2_) != _tmp3_;
	} else {
		_tmp0_ = FALSE;
	}
	has_changes = _tmp0_;
	_tmp4_ = self->priv->_clear_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp4_, has_changes);
	_tmp5_ = self->priv->_apply_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp5_, has_changes);
}

ProtonPlusWidgetsDefaultToolView*
proton_plus_widgets_default_tool_view_construct (GType object_type)
{
	ProtonPlusWidgetsDefaultToolView * self = NULL;
	self = (ProtonPlusWidgetsDefaultToolView*) g_object_new (object_type, NULL);
	return self;
}

ProtonPlusWidgetsDefaultToolView*
proton_plus_widgets_default_tool_view_new (void)
{
	return proton_plus_widgets_default_tool_view_construct (PROTON_PLUS_WIDGETS_TYPE_DEFAULT_TOOL_VIEW);
}

static AdwWindowTitle*
proton_plus_widgets_default_tool_view_get_window_title (ProtonPlusWidgetsDefaultToolView* self)
{
	AdwWindowTitle* result;
	AdwWindowTitle* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_window_title;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_default_tool_view_set_window_title (ProtonPlusWidgetsDefaultToolView* self,
                                                        AdwWindowTitle* value)
{
	AdwWindowTitle* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_window_title);
	self->priv->_window_title = _tmp0_;
}

static GtkButton*
proton_plus_widgets_default_tool_view_get_back_button (ProtonPlusWidgetsDefaultToolView* self)
{
	GtkButton* result;
	GtkButton* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_back_button;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_default_tool_view_set_back_button (ProtonPlusWidgetsDefaultToolView* self,
                                                       GtkButton* value)
{
	GtkButton* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_back_button);
	self->priv->_back_button = _tmp0_;
}

static GtkButton*
proton_plus_widgets_default_tool_view_get_clear_button (ProtonPlusWidgetsDefaultToolView* self)
{
	GtkButton* result;
	GtkButton* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_clear_button;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_default_tool_view_set_clear_button (ProtonPlusWidgetsDefaultToolView* self,
                                                        GtkButton* value)
{
	GtkButton* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_clear_button);
	self->priv->_clear_button = _tmp0_;
}

static GtkButton*
proton_plus_widgets_default_tool_view_get_apply_button (ProtonPlusWidgetsDefaultToolView* self)
{
	GtkButton* result;
	GtkButton* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_apply_button;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_default_tool_view_set_apply_button (ProtonPlusWidgetsDefaultToolView* self,
                                                        GtkButton* value)
{
	GtkButton* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_apply_button);
	self->priv->_apply_button = _tmp0_;
}

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

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

static AdwToolbarView*
proton_plus_widgets_default_tool_view_get_toolbar_view (ProtonPlusWidgetsDefaultToolView* self)
{
	AdwToolbarView* result;
	AdwToolbarView* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_toolbar_view;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_default_tool_view_set_toolbar_view (ProtonPlusWidgetsDefaultToolView* self,
                                                        AdwToolbarView* value)
{
	AdwToolbarView* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_toolbar_view);
	self->priv->_toolbar_view = _tmp0_;
}

static AdwPreferencesGroup*
proton_plus_widgets_default_tool_view_get_content_group (ProtonPlusWidgetsDefaultToolView* self)
{
	AdwPreferencesGroup* result;
	AdwPreferencesGroup* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_content_group;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_default_tool_view_set_content_group (ProtonPlusWidgetsDefaultToolView* self,
                                                         AdwPreferencesGroup* value)
{
	AdwPreferencesGroup* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_content_group);
	self->priv->_content_group = _tmp0_;
}

static ProtonPlusWidgetsCompatibilityToolRow*
proton_plus_widgets_default_tool_view_get_compatibility_tool_row (ProtonPlusWidgetsDefaultToolView* self)
{
	ProtonPlusWidgetsCompatibilityToolRow* result;
	ProtonPlusWidgetsCompatibilityToolRow* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_compatibility_tool_row;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_default_tool_view_set_compatibility_tool_row (ProtonPlusWidgetsDefaultToolView* self,
                                                                  ProtonPlusWidgetsCompatibilityToolRow* value)
{
	ProtonPlusWidgetsCompatibilityToolRow* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_compatibility_tool_row);
	self->priv->_compatibility_tool_row = _tmp0_;
}

static ProtonPlusModelsLaunchersSteam*
proton_plus_widgets_default_tool_view_get_launcher (ProtonPlusWidgetsDefaultToolView* self)
{
	ProtonPlusModelsLaunchersSteam* result;
	ProtonPlusModelsLaunchersSteam* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_launcher;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_default_tool_view_set_launcher (ProtonPlusWidgetsDefaultToolView* self,
                                                    ProtonPlusModelsLaunchersSteam* value)
{
	ProtonPlusModelsLaunchersSteam* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_launcher);
	self->priv->_launcher = _tmp0_;
}

static guint
proton_plus_widgets_default_tool_view_get_applied_selected_index (ProtonPlusWidgetsDefaultToolView* self)
{
	guint result;
	g_return_val_if_fail (self != NULL, 0U);
	result = self->priv->_applied_selected_index;
	return result;
}

static void
proton_plus_widgets_default_tool_view_set_applied_selected_index (ProtonPlusWidgetsDefaultToolView* self,
                                                                  guint value)
{
	g_return_if_fail (self != NULL);
	self->priv->_applied_selected_index = value;
}

static gboolean
proton_plus_widgets_default_tool_view_get_applied_verified (ProtonPlusWidgetsDefaultToolView* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_applied_verified;
	return result;
}

static void
proton_plus_widgets_default_tool_view_set_applied_verified (ProtonPlusWidgetsDefaultToolView* self,
                                                            gboolean value)
{
	g_return_if_fail (self != NULL);
	self->priv->_applied_verified = value;
}

static void
_proton_plus_widgets_default_tool_view___lambda48_ (ProtonPlusWidgetsDefaultToolView* self)
{
	g_signal_emit (self, proton_plus_widgets_default_tool_view_signals[PROTON_PLUS_WIDGETS_DEFAULT_TOOL_VIEW_BACK_REQUESTED_SIGNAL], 0);
}

static void
__proton_plus_widgets_default_tool_view___lambda48__gtk_button_clicked (GtkButton* _sender,
                                                                        gpointer self)
{
	_proton_plus_widgets_default_tool_view___lambda48_ ((ProtonPlusWidgetsDefaultToolView*) self);
}

static void
_proton_plus_widgets_default_tool_view_clear_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                gpointer self)
{
	proton_plus_widgets_default_tool_view_clear_button_clicked ((ProtonPlusWidgetsDefaultToolView*) self);
}

static void
_proton_plus_widgets_default_tool_view_apply_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                gpointer self)
{
	proton_plus_widgets_default_tool_view_apply_button_clicked ((ProtonPlusWidgetsDefaultToolView*) self);
}

static GObject *
proton_plus_widgets_default_tool_view_constructor (GType type,
                                                   guint n_construct_properties,
                                                   GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ProtonPlusWidgetsDefaultToolView * self;
	AdwWindowTitle* _tmp0_;
	AdwWindowTitle* _tmp1_;
	GtkButton* _tmp2_;
	GtkButton* _tmp3_;
	GtkButton* _tmp4_;
	GtkButton* _tmp5_;
	GtkButton* _tmp6_;
	GtkButton* _tmp7_;
	GtkButton* _tmp8_;
	GtkButton* _tmp9_;
	GtkButton* _tmp10_;
	GtkButton* _tmp11_;
	GtkButton* _tmp12_;
	GtkButton* _tmp13_;
	GtkButton* _tmp14_;
	GtkButton* _tmp15_;
	GtkButton* _tmp16_;
	GtkButton* _tmp17_;
	AdwHeaderBar* _tmp18_;
	AdwHeaderBar* _tmp19_;
	AdwHeaderBar* _tmp20_;
	AdwWindowTitle* _tmp21_;
	AdwHeaderBar* _tmp22_;
	GtkButton* _tmp23_;
	AdwHeaderBar* _tmp24_;
	GtkButton* _tmp25_;
	AdwHeaderBar* _tmp26_;
	GtkButton* _tmp27_;
	AdwPreferencesGroup* _tmp28_;
	AdwPreferencesGroup* _tmp29_;
	AdwPreferencesGroup* _tmp30_;
	AdwClamp* content_clamp = NULL;
	AdwClamp* _tmp31_;
	AdwClamp* _tmp32_;
	AdwClamp* _tmp33_;
	AdwPreferencesGroup* _tmp34_;
	AdwToolbarView* _tmp35_;
	AdwToolbarView* _tmp36_;
	AdwToolbarView* _tmp37_;
	AdwHeaderBar* _tmp38_;
	AdwToolbarView* _tmp39_;
	AdwClamp* _tmp40_;
	AdwToolbarView* _tmp41_;
	parent_class = G_OBJECT_CLASS (proton_plus_widgets_default_tool_view_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_TYPE_DEFAULT_TOOL_VIEW, ProtonPlusWidgetsDefaultToolView);
	gtk_orientable_set_orientation ((GtkOrientable*) self, GTK_ORIENTATION_VERTICAL);
	_tmp0_ = (AdwWindowTitle*) adw_window_title_new (_ ("Set the default compatibility tool"), "");
	g_object_ref_sink (_tmp0_);
	_tmp1_ = _tmp0_;
	proton_plus_widgets_default_tool_view_set_window_title (self, _tmp1_);
	_g_object_unref0 (_tmp1_);
	_tmp2_ = (GtkButton*) gtk_button_new_from_icon_name ("go-previous-symbolic");
	g_object_ref_sink (_tmp2_);
	_tmp3_ = _tmp2_;
	proton_plus_widgets_default_tool_view_set_back_button (self, _tmp3_);
	_g_object_unref0 (_tmp3_);
	_tmp4_ = self->priv->_back_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp4_, "flat");
	_tmp5_ = self->priv->_back_button;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp5_, _ ("Back"));
	_tmp6_ = self->priv->_back_button;
	g_signal_connect_object (_tmp6_, "clicked", (GCallback) __proton_plus_widgets_default_tool_view___lambda48__gtk_button_clicked, self, 0);
	_tmp7_ = (GtkButton*) gtk_button_new_from_icon_name ("eraser-symbolic");
	g_object_ref_sink (_tmp7_);
	_tmp8_ = _tmp7_;
	proton_plus_widgets_default_tool_view_set_clear_button (self, _tmp8_);
	_g_object_unref0 (_tmp8_);
	_tmp9_ = self->priv->_clear_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp9_, "flat");
	_tmp10_ = self->priv->_clear_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp10_, "clear-button");
	_tmp11_ = self->priv->_clear_button;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp11_, _ ("Reset to the current default compatibility tool"));
	_tmp12_ = self->priv->_clear_button;
	g_signal_connect_object (_tmp12_, "clicked", (GCallback) _proton_plus_widgets_default_tool_view_clear_button_clicked_gtk_button_clicked, self, 0);
	_tmp13_ = (GtkButton*) gtk_button_new_from_icon_name ("floppy-disk-symbolic");
	g_object_ref_sink (_tmp13_);
	_tmp14_ = _tmp13_;
	proton_plus_widgets_default_tool_view_set_apply_button (self, _tmp14_);
	_g_object_unref0 (_tmp14_);
	_tmp15_ = self->priv->_apply_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp15_, "suggested-action");
	_tmp16_ = self->priv->_apply_button;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp16_, _ ("Apply the current modification"));
	_tmp17_ = self->priv->_apply_button;
	g_signal_connect_object (_tmp17_, "clicked", (GCallback) _proton_plus_widgets_default_tool_view_apply_button_clicked_gtk_button_clicked, self, 0);
	_tmp18_ = (AdwHeaderBar*) adw_header_bar_new ();
	g_object_ref_sink (_tmp18_);
	_tmp19_ = _tmp18_;
	proton_plus_widgets_default_tool_view_set_header_bar (self, _tmp19_);
	_g_object_unref0 (_tmp19_);
	_tmp20_ = self->priv->_header_bar;
	_tmp21_ = self->priv->_window_title;
	adw_header_bar_set_title_widget (_tmp20_, (GtkWidget*) _tmp21_);
	_tmp22_ = self->priv->_header_bar;
	_tmp23_ = self->priv->_back_button;
	adw_header_bar_pack_start (_tmp22_, (GtkWidget*) _tmp23_);
	_tmp24_ = self->priv->_header_bar;
	_tmp25_ = self->priv->_clear_button;
	adw_header_bar_pack_start (_tmp24_, (GtkWidget*) _tmp25_);
	_tmp26_ = self->priv->_header_bar;
	_tmp27_ = self->priv->_apply_button;
	adw_header_bar_pack_end (_tmp26_, (GtkWidget*) _tmp27_);
	_tmp28_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	g_object_ref_sink (_tmp28_);
	_tmp29_ = _tmp28_;
	proton_plus_widgets_default_tool_view_set_content_group (self, _tmp29_);
	_g_object_unref0 (_tmp29_);
	_tmp30_ = self->priv->_content_group;
	gtk_widget_set_margin_top ((GtkWidget*) _tmp30_, 7);
	_tmp31_ = (AdwClamp*) adw_clamp_new ();
	g_object_ref_sink (_tmp31_);
	content_clamp = _tmp31_;
	_tmp32_ = content_clamp;
	adw_clamp_set_maximum_size (_tmp32_, 975);
	_tmp33_ = content_clamp;
	_tmp34_ = self->priv->_content_group;
	adw_clamp_set_child (_tmp33_, (GtkWidget*) _tmp34_);
	_tmp35_ = (AdwToolbarView*) adw_toolbar_view_new ();
	g_object_ref_sink (_tmp35_);
	_tmp36_ = _tmp35_;
	proton_plus_widgets_default_tool_view_set_toolbar_view (self, _tmp36_);
	_g_object_unref0 (_tmp36_);
	_tmp37_ = self->priv->_toolbar_view;
	_tmp38_ = self->priv->_header_bar;
	adw_toolbar_view_add_top_bar (_tmp37_, (GtkWidget*) _tmp38_);
	_tmp39_ = self->priv->_toolbar_view;
	_tmp40_ = content_clamp;
	adw_toolbar_view_set_content (_tmp39_, (GtkWidget*) _tmp40_);
	_tmp41_ = self->priv->_toolbar_view;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp41_);
	_g_object_unref0 (content_clamp);
	return obj;
}

static void
proton_plus_widgets_default_tool_view_class_init (ProtonPlusWidgetsDefaultToolViewClass * klass,
                                                  gpointer klass_data)
{
	proton_plus_widgets_default_tool_view_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsDefaultToolView_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_widgets_default_tool_view_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_widgets_default_tool_view_set_property;
	G_OBJECT_CLASS (klass)->constructor = proton_plus_widgets_default_tool_view_constructor;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_default_tool_view_finalize;
	proton_plus_widgets_default_tool_view_signals[PROTON_PLUS_WIDGETS_DEFAULT_TOOL_VIEW_BACK_REQUESTED_SIGNAL] = g_signal_new ("back-requested", PROTON_PLUS_WIDGETS_TYPE_DEFAULT_TOOL_VIEW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
proton_plus_widgets_default_tool_view_instance_init (ProtonPlusWidgetsDefaultToolView * self,
                                                     gpointer klass)
{
	self->priv = proton_plus_widgets_default_tool_view_get_instance_private (self);
}

static void
proton_plus_widgets_default_tool_view_finalize (GObject * obj)
{
	ProtonPlusWidgetsDefaultToolView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_TYPE_DEFAULT_TOOL_VIEW, ProtonPlusWidgetsDefaultToolView);
	_g_object_unref0 (self->priv->_window_title);
	_g_object_unref0 (self->priv->_back_button);
	_g_object_unref0 (self->priv->_clear_button);
	_g_object_unref0 (self->priv->_apply_button);
	_g_object_unref0 (self->priv->_header_bar);
	_g_object_unref0 (self->priv->_toolbar_view);
	_g_object_unref0 (self->priv->_content_group);
	_g_object_unref0 (self->priv->_compatibility_tool_row);
	_g_object_unref0 (self->priv->_launcher);
	G_OBJECT_CLASS (proton_plus_widgets_default_tool_view_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_default_tool_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsDefaultToolViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_default_tool_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsDefaultToolView), 0, (GInstanceInitFunc) proton_plus_widgets_default_tool_view_instance_init, NULL };
	GType proton_plus_widgets_default_tool_view_type_id;
	proton_plus_widgets_default_tool_view_type_id = g_type_register_static (gtk_box_get_type (), "ProtonPlusWidgetsDefaultToolView", &g_define_type_info, 0);
	ProtonPlusWidgetsDefaultToolView_private_offset = g_type_add_instance_private (proton_plus_widgets_default_tool_view_type_id, sizeof (ProtonPlusWidgetsDefaultToolViewPrivate));
	return proton_plus_widgets_default_tool_view_type_id;
}

GType
proton_plus_widgets_default_tool_view_get_type (void)
{
	static volatile gsize proton_plus_widgets_default_tool_view_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_default_tool_view_type_id__once)) {
		GType proton_plus_widgets_default_tool_view_type_id;
		proton_plus_widgets_default_tool_view_type_id = proton_plus_widgets_default_tool_view_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_default_tool_view_type_id__once, proton_plus_widgets_default_tool_view_type_id);
	}
	return proton_plus_widgets_default_tool_view_type_id__once;
}

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

static void
_vala_proton_plus_widgets_default_tool_view_set_property (GObject * object,
                                                          guint property_id,
                                                          const GValue * value,
                                                          GParamSpec * pspec)
{
	ProtonPlusWidgetsDefaultToolView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_TYPE_DEFAULT_TOOL_VIEW, ProtonPlusWidgetsDefaultToolView);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

