/* profile-dialog.c generated by valac 0.56.19, the Vala compiler
 * generated from profile-dialog.vala, do not modify */

#include <adwaita.h>
#include <glib-object.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <glib/gi18n-lib.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <gee.h>
#include <float.h>
#include <math.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_PROFILE_DIALOG (proton_plus_widgets_profile_dialog_get_type ())
#define PROTON_PLUS_WIDGETS_PROFILE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_TYPE_PROFILE_DIALOG, ProtonPlusWidgetsProfileDialog))
#define PROTON_PLUS_WIDGETS_PROFILE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_TYPE_PROFILE_DIALOG, ProtonPlusWidgetsProfileDialogClass))
#define PROTON_PLUS_WIDGETS_IS_PROFILE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_TYPE_PROFILE_DIALOG))
#define PROTON_PLUS_WIDGETS_IS_PROFILE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_TYPE_PROFILE_DIALOG))
#define PROTON_PLUS_WIDGETS_PROFILE_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_TYPE_PROFILE_DIALOG, ProtonPlusWidgetsProfileDialogClass))

typedef struct _ProtonPlusWidgetsProfileDialog ProtonPlusWidgetsProfileDialog;
typedef struct _ProtonPlusWidgetsProfileDialogClass ProtonPlusWidgetsProfileDialogClass;
typedef struct _ProtonPlusWidgetsProfileDialogPrivate ProtonPlusWidgetsProfileDialogPrivate;

#define PROTON_PLUS_MODELS_TYPE_STEAM_PROFILE (proton_plus_models_steam_profile_get_type ())
#define PROTON_PLUS_MODELS_STEAM_PROFILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_MODELS_TYPE_STEAM_PROFILE, ProtonPlusModelsSteamProfile))
#define PROTON_PLUS_MODELS_STEAM_PROFILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_MODELS_TYPE_STEAM_PROFILE, ProtonPlusModelsSteamProfileClass))
#define PROTON_PLUS_MODELS_IS_STEAM_PROFILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_MODELS_TYPE_STEAM_PROFILE))
#define PROTON_PLUS_MODELS_IS_STEAM_PROFILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_MODELS_TYPE_STEAM_PROFILE))
#define PROTON_PLUS_MODELS_STEAM_PROFILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_MODELS_TYPE_STEAM_PROFILE, ProtonPlusModelsSteamProfileClass))

typedef struct _ProtonPlusModelsSteamProfile ProtonPlusModelsSteamProfile;
typedef struct _ProtonPlusModelsSteamProfileClass ProtonPlusModelsSteamProfileClass;
typedef void (*ProtonPlusWidgetsGamesBoxload_steam_profile_func) (ProtonPlusModelsSteamProfile* profile, gpointer user_data);

#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_PROFILE_DIALOG_0_PROPERTY,
	PROTON_PLUS_WIDGETS_PROFILE_DIALOG_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_profile_dialog_properties[PROTON_PLUS_WIDGETS_PROFILE_DIALOG_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
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_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;

#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 ())
typedef struct _ProtonPlusModelsLaunchersSteamPrivate ProtonPlusModelsLaunchersSteamPrivate;
typedef struct _Block10Data Block10Data;

#define PROTON_PLUS_WIDGETS_TYPE_PROFILE_BUTTON (proton_plus_widgets_profile_button_get_type ())
#define PROTON_PLUS_WIDGETS_PROFILE_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_TYPE_PROFILE_BUTTON, ProtonPlusWidgetsProfileButton))
#define PROTON_PLUS_WIDGETS_PROFILE_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_TYPE_PROFILE_BUTTON, ProtonPlusWidgetsProfileButtonClass))
#define PROTON_PLUS_WIDGETS_IS_PROFILE_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_TYPE_PROFILE_BUTTON))
#define PROTON_PLUS_WIDGETS_IS_PROFILE_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_TYPE_PROFILE_BUTTON))
#define PROTON_PLUS_WIDGETS_PROFILE_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_TYPE_PROFILE_BUTTON, ProtonPlusWidgetsProfileButtonClass))

typedef struct _ProtonPlusWidgetsProfileButton ProtonPlusWidgetsProfileButton;
typedef struct _ProtonPlusWidgetsProfileButtonClass ProtonPlusWidgetsProfileButtonClass;

struct _ProtonPlusWidgetsProfileDialog {
	AdwDialog parent_instance;
	ProtonPlusWidgetsProfileDialogPrivate * priv;
};

struct _ProtonPlusWidgetsProfileDialogClass {
	AdwDialogClass parent_class;
};

struct _ProtonPlusWidgetsProfileDialogPrivate {
	ProtonPlusWidgetsGamesBoxload_steam_profile_func load_steam_profile_func;
	gpointer load_steam_profile_func_target;
	GDestroyNotify load_steam_profile_func_target_destroy_notify;
	ProtonPlusModelsLaunchersSteam* _launcher;
	AdwHeaderBar* _header_bar;
	AdwToolbarView* _toolbar_view;
	AdwWindowTitle* _window_title;
	GtkBox* _content_box;
	gboolean _profile_selected;
};

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);
};

struct _ProtonPlusModelsLaunchersSteam {
	ProtonPlusModelsLauncher parent_instance;
	ProtonPlusModelsLaunchersSteamPrivate * priv;
	GList* profiles;
	GHashTable* compatibility_tool_hashtable;
};

struct _ProtonPlusModelsLaunchersSteamClass {
	ProtonPlusModelsLauncherClass parent_class;
};

struct _Block10Data {
	int _ref_count_;
	ProtonPlusWidgetsProfileDialog* self;
	ProtonPlusModelsSteamProfile* profile;
};

static gint ProtonPlusWidgetsProfileDialog_private_offset;
static gpointer proton_plus_widgets_profile_dialog_parent_class = NULL;
VALA_EXTERN GSettings* proton_plus_globals_SETTINGS;

VALA_EXTERN GType proton_plus_widgets_profile_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusWidgetsProfileDialog, g_object_unref)
VALA_EXTERN GType proton_plus_models_steam_profile_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusModelsSteamProfile, 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 ProtonPlusWidgetsProfileDialog* proton_plus_widgets_profile_dialog_new (ProtonPlusModelsLaunchersSteam* launcher,
                                                                        ProtonPlusWidgetsGamesBoxload_steam_profile_func load_steam_profile_func,
                                                                        gpointer load_steam_profile_func_target);
VALA_EXTERN ProtonPlusWidgetsProfileDialog* proton_plus_widgets_profile_dialog_construct (GType object_type,
                                                                              ProtonPlusModelsLaunchersSteam* launcher,
                                                                              ProtonPlusWidgetsGamesBoxload_steam_profile_func load_steam_profile_func,
                                                                              gpointer load_steam_profile_func_target);
static void proton_plus_widgets_profile_dialog_set_launcher (ProtonPlusWidgetsProfileDialog* self,
                                                      ProtonPlusModelsLaunchersSteam* value);
static void proton_plus_widgets_profile_dialog_set_window_title (ProtonPlusWidgetsProfileDialog* self,
                                                          AdwWindowTitle* value);
static void proton_plus_widgets_profile_dialog_set_header_bar (ProtonPlusWidgetsProfileDialog* self,
                                                        AdwHeaderBar* value);
static AdwHeaderBar* proton_plus_widgets_profile_dialog_get_header_bar (ProtonPlusWidgetsProfileDialog* self);
static AdwWindowTitle* proton_plus_widgets_profile_dialog_get_window_title (ProtonPlusWidgetsProfileDialog* self);
static void proton_plus_widgets_profile_dialog_set_content_box (ProtonPlusWidgetsProfileDialog* self,
                                                         GtkBox* value);
static GtkBox* proton_plus_widgets_profile_dialog_get_content_box (ProtonPlusWidgetsProfileDialog* self);
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_simple_runner_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusModelsSimpleRunner, 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 ;
static Block10Data* block10_data_ref (Block10Data* _data10_);
static void block10_data_unref (void * _userdata_);
VALA_EXTERN GType proton_plus_widgets_profile_button_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusWidgetsProfileButton, g_object_unref)
VALA_EXTERN ProtonPlusWidgetsProfileButton* proton_plus_widgets_profile_button_new (ProtonPlusModelsSteamProfile* profile,
                                                                        ProtonPlusWidgetsProfileDialog* profile_dialog);
VALA_EXTERN ProtonPlusWidgetsProfileButton* proton_plus_widgets_profile_button_construct (GType object_type,
                                                                              ProtonPlusModelsSteamProfile* profile,
                                                                              ProtonPlusWidgetsProfileDialog* profile_dialog);
VALA_EXTERN GtkGestureClick* proton_plus_widgets_profile_button_get_gesture_click (ProtonPlusWidgetsProfileButton* self);
static void ____lambda38_ (Block10Data* _data10_);
static void proton_plus_widgets_profile_dialog_profile_button_clicked (ProtonPlusWidgetsProfileDialog* self,
                                                                ProtonPlusModelsSteamProfile* profile);
static void _____lambda38__gtk_gesture_click_released (GtkGestureClick* _sender,
                                                gint n_press,
                                                gdouble x,
                                                gdouble y,
                                                gpointer self);
static void proton_plus_widgets_profile_dialog_set_toolbar_view (ProtonPlusWidgetsProfileDialog* self,
                                                          AdwToolbarView* value);
static AdwToolbarView* proton_plus_widgets_profile_dialog_get_toolbar_view (ProtonPlusWidgetsProfileDialog* self);
static void proton_plus_widgets_profile_dialog_set_profile_selected (ProtonPlusWidgetsProfileDialog* self,
                                                              gboolean value);
VALA_EXTERN const gchar* proton_plus_models_steam_profile_get_steam_id (ProtonPlusModelsSteamProfile* self);
static ProtonPlusModelsLaunchersSteam* proton_plus_widgets_profile_dialog_get_launcher (ProtonPlusWidgetsProfileDialog* self);
static gboolean proton_plus_widgets_profile_dialog_get_profile_selected (ProtonPlusWidgetsProfileDialog* self);
static void proton_plus_widgets_profile_dialog_finalize (GObject * obj);
static GType proton_plus_widgets_profile_dialog_get_type_once (void);
static void _vala_proton_plus_widgets_profile_dialog_get_property (GObject * object,
                                                            guint property_id,
                                                            GValue * value,
                                                            GParamSpec * pspec);
static void _vala_proton_plus_widgets_profile_dialog_set_property (GObject * object,
                                                            guint property_id,
                                                            const GValue * value,
                                                            GParamSpec * pspec);

static inline gpointer
proton_plus_widgets_profile_dialog_get_instance_private (ProtonPlusWidgetsProfileDialog* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsProfileDialog_private_offset);
}

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

static Block10Data*
block10_data_ref (Block10Data* _data10_)
{
	g_atomic_int_inc (&_data10_->_ref_count_);
	return _data10_;
}

static void
block10_data_unref (void * _userdata_)
{
	Block10Data* _data10_;
	_data10_ = (Block10Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data10_->_ref_count_)) {
		ProtonPlusWidgetsProfileDialog* self;
		self = _data10_->self;
		_g_object_unref0 (_data10_->profile);
		_g_object_unref0 (self);
		g_slice_free (Block10Data, _data10_);
	}
}

static void
____lambda38_ (Block10Data* _data10_)
{
	ProtonPlusWidgetsProfileDialog* self;
	ProtonPlusModelsSteamProfile* _tmp0_;
	self = _data10_->self;
	_tmp0_ = _data10_->profile;
	proton_plus_widgets_profile_dialog_profile_button_clicked (self, _tmp0_);
}

static void
_____lambda38__gtk_gesture_click_released (GtkGestureClick* _sender,
                                           gint n_press,
                                           gdouble x,
                                           gdouble y,
                                           gpointer self)
{
	____lambda38_ (self);
}

ProtonPlusWidgetsProfileDialog*
proton_plus_widgets_profile_dialog_construct (GType object_type,
                                              ProtonPlusModelsLaunchersSteam* launcher,
                                              ProtonPlusWidgetsGamesBoxload_steam_profile_func load_steam_profile_func,
                                              gpointer load_steam_profile_func_target)
{
	ProtonPlusWidgetsProfileDialog * self = NULL;
	AdwWindowTitle* _tmp0_;
	AdwWindowTitle* _tmp1_;
	AdwHeaderBar* _tmp2_;
	AdwHeaderBar* _tmp3_;
	AdwHeaderBar* _tmp4_;
	AdwWindowTitle* _tmp5_;
	AdwHeaderBar* _tmp6_;
	GtkBox* _tmp7_;
	GtkBox* _tmp8_;
	GtkBox* _tmp9_;
	GtkBox* _tmp10_;
	GtkBox* _tmp11_;
	GtkBox* _tmp12_;
	GList* _tmp13_;
	AdwToolbarView* _tmp22_;
	AdwToolbarView* _tmp23_;
	AdwToolbarView* _tmp24_;
	AdwHeaderBar* _tmp25_;
	AdwToolbarView* _tmp26_;
	GtkBox* _tmp27_;
	AdwToolbarView* _tmp28_;
	g_return_val_if_fail (launcher != NULL, NULL);
	self = (ProtonPlusWidgetsProfileDialog*) g_object_new (object_type, NULL);
	proton_plus_widgets_profile_dialog_set_launcher (self, launcher);
	(self->priv->load_steam_profile_func_target_destroy_notify == NULL) ? NULL : (self->priv->load_steam_profile_func_target_destroy_notify (self->priv->load_steam_profile_func_target), NULL);
	self->priv->load_steam_profile_func = NULL;
	self->priv->load_steam_profile_func_target = NULL;
	self->priv->load_steam_profile_func_target_destroy_notify = NULL;
	self->priv->load_steam_profile_func = load_steam_profile_func;
	self->priv->load_steam_profile_func_target = load_steam_profile_func_target;
	self->priv->load_steam_profile_func_target_destroy_notify = NULL;
	_tmp0_ = (AdwWindowTitle*) adw_window_title_new (_ ("Select a profile"), "");
	g_object_ref_sink (_tmp0_);
	_tmp1_ = _tmp0_;
	proton_plus_widgets_profile_dialog_set_window_title (self, _tmp1_);
	_g_object_unref0 (_tmp1_);
	_tmp2_ = (AdwHeaderBar*) adw_header_bar_new ();
	g_object_ref_sink (_tmp2_);
	_tmp3_ = _tmp2_;
	proton_plus_widgets_profile_dialog_set_header_bar (self, _tmp3_);
	_g_object_unref0 (_tmp3_);
	_tmp4_ = self->priv->_header_bar;
	_tmp5_ = self->priv->_window_title;
	adw_header_bar_set_title_widget (_tmp4_, (GtkWidget*) _tmp5_);
	_tmp6_ = self->priv->_header_bar;
	adw_header_bar_set_show_end_title_buttons (_tmp6_, FALSE);
	_tmp7_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
	g_object_ref_sink (_tmp7_);
	_tmp8_ = _tmp7_;
	proton_plus_widgets_profile_dialog_set_content_box (self, _tmp8_);
	_g_object_unref0 (_tmp8_);
	_tmp9_ = self->priv->_content_box;
	gtk_widget_set_margin_start ((GtkWidget*) _tmp9_, 10);
	_tmp10_ = self->priv->_content_box;
	gtk_widget_set_margin_end ((GtkWidget*) _tmp10_, 10);
	_tmp11_ = self->priv->_content_box;
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp11_, 10);
	_tmp12_ = self->priv->_content_box;
	gtk_widget_set_halign ((GtkWidget*) _tmp12_, GTK_ALIGN_CENTER);
	_tmp13_ = launcher->profiles;
	{
		GList* profile_collection = NULL;
		GList* profile_it = NULL;
		profile_collection = _tmp13_;
		for (profile_it = profile_collection; profile_it != NULL; profile_it = profile_it->next) {
			ProtonPlusModelsSteamProfile* _tmp14_;
			ProtonPlusModelsSteamProfile* profile = NULL;
			_tmp14_ = _g_object_ref0 ((ProtonPlusModelsSteamProfile*) profile_it->data);
			profile = _tmp14_;
			{
				Block10Data* _data10_;
				ProtonPlusWidgetsProfileButton* profile_button = NULL;
				ProtonPlusModelsSteamProfile* _tmp15_;
				ProtonPlusWidgetsProfileButton* _tmp16_;
				ProtonPlusWidgetsProfileButton* _tmp17_;
				GtkGestureClick* _tmp18_;
				GtkGestureClick* _tmp19_;
				GtkBox* _tmp20_;
				ProtonPlusWidgetsProfileButton* _tmp21_;
				_data10_ = g_slice_new0 (Block10Data);
				_data10_->_ref_count_ = 1;
				_data10_->self = g_object_ref (self);
				_data10_->profile = profile;
				_tmp15_ = _data10_->profile;
				_tmp16_ = proton_plus_widgets_profile_button_new (_tmp15_, self);
				g_object_ref_sink (_tmp16_);
				profile_button = _tmp16_;
				_tmp17_ = profile_button;
				_tmp18_ = proton_plus_widgets_profile_button_get_gesture_click (_tmp17_);
				_tmp19_ = _tmp18_;
				g_signal_connect_data (_tmp19_, "released", (GCallback) _____lambda38__gtk_gesture_click_released, block10_data_ref (_data10_), (GClosureNotify) block10_data_unref, 0);
				_tmp20_ = self->priv->_content_box;
				_tmp21_ = profile_button;
				gtk_box_append (_tmp20_, (GtkWidget*) _tmp21_);
				_g_object_unref0 (profile_button);
				block10_data_unref (_data10_);
				_data10_ = NULL;
			}
		}
	}
	_tmp22_ = (AdwToolbarView*) adw_toolbar_view_new ();
	g_object_ref_sink (_tmp22_);
	_tmp23_ = _tmp22_;
	proton_plus_widgets_profile_dialog_set_toolbar_view (self, _tmp23_);
	_g_object_unref0 (_tmp23_);
	_tmp24_ = self->priv->_toolbar_view;
	_tmp25_ = self->priv->_header_bar;
	adw_toolbar_view_add_top_bar (_tmp24_, (GtkWidget*) _tmp25_);
	_tmp26_ = self->priv->_toolbar_view;
	_tmp27_ = self->priv->_content_box;
	adw_toolbar_view_set_content (_tmp26_, (GtkWidget*) _tmp27_);
	adw_dialog_set_can_close ((AdwDialog*) self, FALSE);
	_tmp28_ = self->priv->_toolbar_view;
	adw_dialog_set_child ((AdwDialog*) self, (GtkWidget*) _tmp28_);
	return self;
}

ProtonPlusWidgetsProfileDialog*
proton_plus_widgets_profile_dialog_new (ProtonPlusModelsLaunchersSteam* launcher,
                                        ProtonPlusWidgetsGamesBoxload_steam_profile_func load_steam_profile_func,
                                        gpointer load_steam_profile_func_target)
{
	return proton_plus_widgets_profile_dialog_construct (PROTON_PLUS_WIDGETS_TYPE_PROFILE_DIALOG, launcher, load_steam_profile_func, load_steam_profile_func_target);
}

static void
proton_plus_widgets_profile_dialog_profile_button_clicked (ProtonPlusWidgetsProfileDialog* self,
                                                           ProtonPlusModelsSteamProfile* profile)
{
	ProtonPlusWidgetsGamesBoxload_steam_profile_func _tmp0_;
	gpointer _tmp0__target;
	GSettings* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (profile != NULL);
	proton_plus_widgets_profile_dialog_set_profile_selected (self, TRUE);
	_tmp0_ = self->priv->load_steam_profile_func;
	_tmp0__target = self->priv->load_steam_profile_func_target;
	_tmp0_ (profile, _tmp0__target);
	_tmp1_ = proton_plus_globals_SETTINGS;
	if (_tmp1_ != NULL) {
		GSettings* _tmp2_;
		const gchar* _tmp3_;
		const gchar* _tmp4_;
		_tmp2_ = proton_plus_globals_SETTINGS;
		_tmp3_ = proton_plus_models_steam_profile_get_steam_id (profile);
		_tmp4_ = _tmp3_;
		g_settings_set_string (_tmp2_, "steam-last-profile-id", _tmp4_);
	}
	adw_dialog_set_can_close ((AdwDialog*) self, TRUE);
	adw_dialog_close ((AdwDialog*) self);
}

static ProtonPlusModelsLaunchersSteam*
proton_plus_widgets_profile_dialog_get_launcher (ProtonPlusWidgetsProfileDialog* 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_profile_dialog_set_launcher (ProtonPlusWidgetsProfileDialog* 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 AdwHeaderBar*
proton_plus_widgets_profile_dialog_get_header_bar (ProtonPlusWidgetsProfileDialog* 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_profile_dialog_set_header_bar (ProtonPlusWidgetsProfileDialog* 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_profile_dialog_get_toolbar_view (ProtonPlusWidgetsProfileDialog* 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_profile_dialog_set_toolbar_view (ProtonPlusWidgetsProfileDialog* 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 AdwWindowTitle*
proton_plus_widgets_profile_dialog_get_window_title (ProtonPlusWidgetsProfileDialog* 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_profile_dialog_set_window_title (ProtonPlusWidgetsProfileDialog* 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 GtkBox*
proton_plus_widgets_profile_dialog_get_content_box (ProtonPlusWidgetsProfileDialog* self)
{
	GtkBox* result;
	GtkBox* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_content_box;
	result = _tmp0_;
	return result;
}

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

static gboolean
proton_plus_widgets_profile_dialog_get_profile_selected (ProtonPlusWidgetsProfileDialog* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_profile_selected;
	return result;
}

static void
proton_plus_widgets_profile_dialog_set_profile_selected (ProtonPlusWidgetsProfileDialog* self,
                                                         gboolean value)
{
	g_return_if_fail (self != NULL);
	self->priv->_profile_selected = value;
}

static void
proton_plus_widgets_profile_dialog_class_init (ProtonPlusWidgetsProfileDialogClass * klass,
                                               gpointer klass_data)
{
	proton_plus_widgets_profile_dialog_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsProfileDialog_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_widgets_profile_dialog_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_widgets_profile_dialog_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_profile_dialog_finalize;
}

static void
proton_plus_widgets_profile_dialog_instance_init (ProtonPlusWidgetsProfileDialog * self,
                                                  gpointer klass)
{
	self->priv = proton_plus_widgets_profile_dialog_get_instance_private (self);
}

static void
proton_plus_widgets_profile_dialog_finalize (GObject * obj)
{
	ProtonPlusWidgetsProfileDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_TYPE_PROFILE_DIALOG, ProtonPlusWidgetsProfileDialog);
	(self->priv->load_steam_profile_func_target_destroy_notify == NULL) ? NULL : (self->priv->load_steam_profile_func_target_destroy_notify (self->priv->load_steam_profile_func_target), NULL);
	self->priv->load_steam_profile_func = NULL;
	self->priv->load_steam_profile_func_target = NULL;
	self->priv->load_steam_profile_func_target_destroy_notify = NULL;
	_g_object_unref0 (self->priv->_launcher);
	_g_object_unref0 (self->priv->_header_bar);
	_g_object_unref0 (self->priv->_toolbar_view);
	_g_object_unref0 (self->priv->_window_title);
	_g_object_unref0 (self->priv->_content_box);
	G_OBJECT_CLASS (proton_plus_widgets_profile_dialog_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_profile_dialog_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsProfileDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_profile_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsProfileDialog), 0, (GInstanceInitFunc) proton_plus_widgets_profile_dialog_instance_init, NULL };
	GType proton_plus_widgets_profile_dialog_type_id;
	proton_plus_widgets_profile_dialog_type_id = g_type_register_static (adw_dialog_get_type (), "ProtonPlusWidgetsProfileDialog", &g_define_type_info, 0);
	ProtonPlusWidgetsProfileDialog_private_offset = g_type_add_instance_private (proton_plus_widgets_profile_dialog_type_id, sizeof (ProtonPlusWidgetsProfileDialogPrivate));
	return proton_plus_widgets_profile_dialog_type_id;
}

GType
proton_plus_widgets_profile_dialog_get_type (void)
{
	static volatile gsize proton_plus_widgets_profile_dialog_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_profile_dialog_type_id__once)) {
		GType proton_plus_widgets_profile_dialog_type_id;
		proton_plus_widgets_profile_dialog_type_id = proton_plus_widgets_profile_dialog_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_profile_dialog_type_id__once, proton_plus_widgets_profile_dialog_type_id);
	}
	return proton_plus_widgets_profile_dialog_type_id__once;
}

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

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

