/* games-extra-button.c generated by valac 0.56.19, the Vala compiler
 * generated from games-extra-button.vala, do not modify */

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

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

enum  {
	PROTON_PLUS_WIDGETS_GAMES_EXTRA_BUTTON_0_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_EXTRA_BUTTON_BUTTON_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_EXTRA_BUTTON_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_games_extra_button_properties[PROTON_PLUS_WIDGETS_GAMES_EXTRA_BUTTON_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block44Data Block44Data;
typedef void (*ProtonPlusWidgetsGamesExtraButtonActionCallback) (gpointer user_data);
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block45Data Block45Data;
typedef struct _Block46Data Block46Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _Block47Data Block47Data;

struct _ProtonPlusWidgetsGamesExtraButtonPrivate {
	GtkMenuButton* _button;
	ProtonPlusWidgetsGamesGameActionTarget* target;
	ProtonPlusWidgetsGamesGameActionAvailability* availability;
	GtkPopoverMenu* actions_popover;
	GtkButton* anticheat_button;
	GtkLabel* anticheat_button_label;
	GSimpleAction* custom_executable_action;
	GSimpleAction* open_install_directory_action;
	GSimpleAction* open_prefix_directory_action;
	GSimpleAction* open_protontricks_action;
	GSimpleAction* open_protondb_action;
	GSimpleAction* open_anticheat_action;
	gulong awacy_status_handler;
	gulong awacy_lookup_complete_handler;
	gboolean bound;
};

struct _Block44Data {
	int _ref_count_;
	ProtonPlusWidgetsGamesExtraButton* self;
	ProtonPlusWidgetsGamesGameActionTarget* target;
};

struct _Block45Data {
	int _ref_count_;
	ProtonPlusWidgetsGamesExtraButtonActionCallback callback;
	gpointer callback_target;
	GDestroyNotify callback_target_destroy_notify;
};

struct _Block46Data {
	int _ref_count_;
	ProtonPlusWidgetsGamesExtraButton* self;
	ProtonPlusWidgetsGamesGameListItem* expected;
	GtkWindow* root;
	GtkFileDialog* file_dialog;
};

struct _Block47Data {
	int _ref_count_;
	ProtonPlusModelsGame* game;
	GtkWindow* root;
};

static gint ProtonPlusWidgetsGamesExtraButton_private_offset;
static gpointer proton_plus_widgets_games_extra_button_parent_class = NULL;

static Block44Data* block44_data_ref (Block44Data* _data44_);
static void block44_data_unref (void * _userdata_);
static void proton_plus_widgets_games_extra_button_set_button (ProtonPlusWidgetsGamesExtraButton* self,
                                                        GtkMenuButton* value);
static GSimpleAction* proton_plus_widgets_games_extra_button_create_action (GSimpleActionGroup* group,
                                                                     const gchar* name,
                                                                     ProtonPlusWidgetsGamesExtraButtonActionCallback callback,
                                                                     gpointer callback_target,
                                                                     GDestroyNotify callback_target_destroy_notify);
static void proton_plus_widgets_games_extra_button_open_custom_executable (ProtonPlusWidgetsGamesExtraButton* self);
static void _proton_plus_widgets_games_extra_button_open_custom_executable_proton_plus_widgets_games_extra_button_action_callback (gpointer self);
static void proton_plus_widgets_games_extra_button_open_install_directory (ProtonPlusWidgetsGamesExtraButton* self);
static void _proton_plus_widgets_games_extra_button_open_install_directory_proton_plus_widgets_games_extra_button_action_callback (gpointer self);
static void proton_plus_widgets_games_extra_button_open_prefix_directory (ProtonPlusWidgetsGamesExtraButton* self);
static void _proton_plus_widgets_games_extra_button_open_prefix_directory_proton_plus_widgets_games_extra_button_action_callback (gpointer self);
static void proton_plus_widgets_games_extra_button_open_protontricks (ProtonPlusWidgetsGamesExtraButton* self);
static void _proton_plus_widgets_games_extra_button_open_protontricks_proton_plus_widgets_games_extra_button_action_callback (gpointer self);
static void proton_plus_widgets_games_extra_button_open_protondb (ProtonPlusWidgetsGamesExtraButton* self);
static void _proton_plus_widgets_games_extra_button_open_protondb_proton_plus_widgets_games_extra_button_action_callback (gpointer self);
static void proton_plus_widgets_games_extra_button_open_anticheat_from_popover (ProtonPlusWidgetsGamesExtraButton* self);
static void _proton_plus_widgets_games_extra_button_open_anticheat_from_popover_proton_plus_widgets_games_extra_button_action_callback (gpointer self);
static void __lambda191_ (Block44Data* _data44_);
static void ___lambda191__gtk_popover_closed (GtkPopover* _sender,
                                       gpointer self);
static void proton_plus_widgets_games_extra_button_disconnect_anticheat (ProtonPlusWidgetsGamesExtraButton* self);
static void proton_plus_widgets_games_extra_button_refresh (ProtonPlusWidgetsGamesExtraButton* self);
static void _proton_plus_widgets_games_extra_button_refresh_g_object_notify (GObject* _sender,
                                                                      GParamSpec* pspec,
                                                                      gpointer self);
static gboolean* _bool_dup (gboolean* self);
static gchar* proton_plus_widgets_games_extra_button_anticheat_label (ProtonPlusWidgetsGamesExtraButton* self,
                                                               ProtonPlusWidgetsGamesGameAntiCheatState state);
static Block45Data* block45_data_ref (Block45Data* _data45_);
static void block45_data_unref (void * _userdata_);
static void __lambda188_ (Block45Data* _data45_,
                   GVariant* parameter);
static void ___lambda188__g_simple_action_activate (GSimpleAction* _sender,
                                             GVariant* parameter,
                                             gpointer self);
static Block46Data* block46_data_ref (Block46Data* _data46_);
static void block46_data_unref (void * _userdata_);
static void __lambda189_ (Block46Data* _data46_,
                   GObject* object,
                   GAsyncResult* _result_);
static void proton_plus_widgets_games_extra_button_run_custom_executable (ProtonPlusWidgetsGamesGameListItem* expected,
                                                                   const gchar* exe_path,
                                                                   GtkWindow* root);
static void ___lambda189__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
static Block47Data* block47_data_ref (Block47Data* _data47_);
static void block47_data_unref (void * _userdata_);
static void proton_plus_widgets_games_extra_button_present_error_dialog (GtkWindow* root,
                                                                  AdwAlertDialog* dialog);
static void __lambda190_ (Block47Data* _data47_,
                   GObject* object,
                   GAsyncResult* _result_);
static void ___lambda190__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
static void proton_plus_widgets_games_extra_button_open_anticheat (ProtonPlusWidgetsGamesExtraButton* self);
static void proton_plus_widgets_games_extra_button_real_dispose (GObject* base);
static void proton_plus_widgets_games_extra_button_finalize (GObject * obj);
static GType proton_plus_widgets_games_extra_button_get_type_once (void);
static void _vala_proton_plus_widgets_games_extra_button_get_property (GObject * object,
                                                                guint property_id,
                                                                GValue * value,
                                                                GParamSpec * pspec);
static void _vala_proton_plus_widgets_games_extra_button_set_property (GObject * object,
                                                                guint property_id,
                                                                const GValue * value,
                                                                GParamSpec * pspec);

static inline gpointer
proton_plus_widgets_games_extra_button_get_instance_private (ProtonPlusWidgetsGamesExtraButton* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsGamesExtraButton_private_offset);
}

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

static Block44Data*
block44_data_ref (Block44Data* _data44_)
{
	g_atomic_int_inc (&_data44_->_ref_count_);
	return _data44_;
}

static void
block44_data_unref (void * _userdata_)
{
	Block44Data* _data44_;
	_data44_ = (Block44Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data44_->_ref_count_)) {
		ProtonPlusWidgetsGamesExtraButton* self;
		self = _data44_->self;
		_g_object_unref0 (_data44_->target);
		_g_object_unref0 (self);
		g_slice_free (Block44Data, _data44_);
	}
}

static void
_proton_plus_widgets_games_extra_button_open_custom_executable_proton_plus_widgets_games_extra_button_action_callback (gpointer self)
{
	proton_plus_widgets_games_extra_button_open_custom_executable ((ProtonPlusWidgetsGamesExtraButton*) self);
}

static void
_proton_plus_widgets_games_extra_button_open_install_directory_proton_plus_widgets_games_extra_button_action_callback (gpointer self)
{
	proton_plus_widgets_games_extra_button_open_install_directory ((ProtonPlusWidgetsGamesExtraButton*) self);
}

static void
_proton_plus_widgets_games_extra_button_open_prefix_directory_proton_plus_widgets_games_extra_button_action_callback (gpointer self)
{
	proton_plus_widgets_games_extra_button_open_prefix_directory ((ProtonPlusWidgetsGamesExtraButton*) self);
}

static void
_proton_plus_widgets_games_extra_button_open_protontricks_proton_plus_widgets_games_extra_button_action_callback (gpointer self)
{
	proton_plus_widgets_games_extra_button_open_protontricks ((ProtonPlusWidgetsGamesExtraButton*) self);
}

static void
_proton_plus_widgets_games_extra_button_open_protondb_proton_plus_widgets_games_extra_button_action_callback (gpointer self)
{
	proton_plus_widgets_games_extra_button_open_protondb ((ProtonPlusWidgetsGamesExtraButton*) self);
}

static void
_proton_plus_widgets_games_extra_button_open_anticheat_from_popover_proton_plus_widgets_games_extra_button_action_callback (gpointer self)
{
	proton_plus_widgets_games_extra_button_open_anticheat_from_popover ((ProtonPlusWidgetsGamesExtraButton*) self);
}

static void
__lambda191_ (Block44Data* _data44_)
{
	ProtonPlusWidgetsGamesExtraButton* self;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	self = _data44_->self;
	if (self->priv->bound) {
		ProtonPlusWidgetsGamesGameListItem* _tmp3_;
		ProtonPlusWidgetsGamesGameListItem* _tmp4_;
		_tmp3_ = proton_plus_widgets_games_game_action_target_get_item (_data44_->target);
		_tmp4_ = _tmp3_;
		_tmp2_ = _tmp4_ != NULL;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		GtkMenuButton* _tmp5_;
		_tmp5_ = self->priv->_button;
		_tmp1_ = gtk_widget_get_mapped ((GtkWidget*) _tmp5_);
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		GtkMenuButton* _tmp6_;
		_tmp6_ = self->priv->_button;
		_tmp0_ = gtk_widget_is_sensitive ((GtkWidget*) _tmp6_);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GtkMenuButton* _tmp7_;
		_tmp7_ = self->priv->_button;
		gtk_widget_grab_focus ((GtkWidget*) _tmp7_);
	}
}

static void
___lambda191__gtk_popover_closed (GtkPopover* _sender,
                                  gpointer self)
{
	__lambda191_ (self);
}

ProtonPlusWidgetsGamesExtraButton*
proton_plus_widgets_games_extra_button_construct (GType object_type,
                                                  ProtonPlusWidgetsGamesGameActionTarget* target)
{
	ProtonPlusWidgetsGamesExtraButton * self = NULL;
	Block44Data* _data44_;
	ProtonPlusWidgetsGamesGameActionTarget* _tmp0_;
	ProtonPlusWidgetsGamesGameActionTarget* _tmp1_;
	GtkMenuButton* _tmp2_;
	GtkMenuButton* _tmp3_;
	GSimpleActionGroup* action_group = NULL;
	GSimpleActionGroup* _tmp4_;
	GSimpleAction* _tmp5_;
	GSimpleAction* _tmp6_;
	GSimpleAction* _tmp7_;
	GSimpleAction* _tmp8_;
	GSimpleAction* _tmp9_;
	GSimpleAction* _tmp10_;
	GtkMenuButton* _tmp11_;
	GtkLabel* _tmp12_ = NULL;
	gchar* _tmp13_;
	GtkLabel* _tmp14_;
	GtkWidget* _tmp15_;
	gchar* _tmp16_;
	GtkButton* _tmp17_ = NULL;
	GtkButton* _tmp18_;
	GtkButton* _tmp19_;
	GMenu* _tmp20_;
	GMenu* _tmp21_;
	GtkPopoverMenu* _tmp22_;
	GtkPopoverMenu* _tmp23_;
	GtkMenuButton* _tmp24_;
	GtkPopoverMenu* _tmp25_;
	GtkPopoverMenu* _tmp26_;
	GtkMenuButton* _tmp27_;
	GtkMenuButton* _tmp28_;
	GtkMenuButton* _tmp29_;
	GtkMenuButton* _tmp30_;
	GtkMenuButton* _tmp31_;
	g_return_val_if_fail (target != NULL, NULL);
	_data44_ = g_slice_new0 (Block44Data);
	_data44_->_ref_count_ = 1;
	_tmp0_ = _g_object_ref0 (target);
	_g_object_unref0 (_data44_->target);
	_data44_->target = _tmp0_;
	self = (ProtonPlusWidgetsGamesExtraButton*) g_object_new (object_type, NULL);
	_data44_->self = g_object_ref (self);
	_tmp1_ = _g_object_ref0 (_data44_->target);
	_g_object_unref0 (self->priv->target);
	self->priv->target = _tmp1_;
	_tmp2_ = (GtkMenuButton*) gtk_menu_button_new ();
	g_object_ref_sink (_tmp2_);
	_tmp3_ = _tmp2_;
	proton_plus_widgets_games_extra_button_set_button (self, _tmp3_);
	_g_object_unref0 (_tmp3_);
	_tmp4_ = g_simple_action_group_new ();
	action_group = _tmp4_;
	_tmp5_ = proton_plus_widgets_games_extra_button_create_action (action_group, "custom-executable", _proton_plus_widgets_games_extra_button_open_custom_executable_proton_plus_widgets_games_extra_button_action_callback, g_object_ref (self), g_object_unref);
	_g_object_unref0 (self->priv->custom_executable_action);
	self->priv->custom_executable_action = _tmp5_;
	_tmp6_ = proton_plus_widgets_games_extra_button_create_action (action_group, "open-install-directory", _proton_plus_widgets_games_extra_button_open_install_directory_proton_plus_widgets_games_extra_button_action_callback, g_object_ref (self), g_object_unref);
	_g_object_unref0 (self->priv->open_install_directory_action);
	self->priv->open_install_directory_action = _tmp6_;
	_tmp7_ = proton_plus_widgets_games_extra_button_create_action (action_group, "open-prefix-directory", _proton_plus_widgets_games_extra_button_open_prefix_directory_proton_plus_widgets_games_extra_button_action_callback, g_object_ref (self), g_object_unref);
	_g_object_unref0 (self->priv->open_prefix_directory_action);
	self->priv->open_prefix_directory_action = _tmp7_;
	_tmp8_ = proton_plus_widgets_games_extra_button_create_action (action_group, "open-protontricks", _proton_plus_widgets_games_extra_button_open_protontricks_proton_plus_widgets_games_extra_button_action_callback, g_object_ref (self), g_object_unref);
	_g_object_unref0 (self->priv->open_protontricks_action);
	self->priv->open_protontricks_action = _tmp8_;
	_tmp9_ = proton_plus_widgets_games_extra_button_create_action (action_group, "open-protondb", _proton_plus_widgets_games_extra_button_open_protondb_proton_plus_widgets_games_extra_button_action_callback, g_object_ref (self), g_object_unref);
	_g_object_unref0 (self->priv->open_protondb_action);
	self->priv->open_protondb_action = _tmp9_;
	_tmp10_ = proton_plus_widgets_games_extra_button_create_action (action_group, "open-anticheat", _proton_plus_widgets_games_extra_button_open_anticheat_from_popover_proton_plus_widgets_games_extra_button_action_callback, g_object_ref (self), g_object_unref);
	_g_object_unref0 (self->priv->open_anticheat_action);
	self->priv->open_anticheat_action = _tmp10_;
	_tmp11_ = self->priv->_button;
	gtk_widget_insert_action_group ((GtkWidget*) _tmp11_, "game", (GActionGroup*) action_group);
	_tmp12_ = (GtkLabel*) gtk_label_new (NULL);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp12_, TRUE);
	gtk_label_set_xalign (_tmp12_, (gfloat) 0);
	g_object_ref_sink (_tmp12_);
	_g_object_unref0 (self->priv->anticheat_button_label);
	self->priv->anticheat_button_label = _tmp12_;
	_tmp13_ = g_strdup ("game.open-anticheat");
	_tmp14_ = self->priv->anticheat_button_label;
	_tmp15_ = _g_object_ref0 ((GtkWidget*) _tmp14_);
	_tmp16_ = g_strdup ("AreWeAntiCheatYet");
	_tmp17_ = (GtkButton*) gtk_button_new ();
	gtk_actionable_set_action_name ((GtkActionable*) _tmp17_, _tmp13_);
	_g_free0 (_tmp13_);
	gtk_button_set_child (_tmp17_, _tmp15_);
	_g_object_unref0 (_tmp15_);
	gtk_button_set_has_frame (_tmp17_, FALSE);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp17_, TRUE);
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp17_, _tmp16_);
	_g_free0 (_tmp16_);
	g_object_ref_sink (_tmp17_);
	_g_object_unref0 (self->priv->anticheat_button);
	self->priv->anticheat_button = _tmp17_;
	_tmp18_ = self->priv->anticheat_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp18_, "flat");
	_tmp19_ = self->priv->anticheat_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp19_, "model");
	_tmp20_ = g_menu_new ();
	_tmp21_ = _tmp20_;
	_tmp22_ = (GtkPopoverMenu*) gtk_popover_menu_new_from_model ((GMenuModel*) _tmp21_);
	g_object_ref_sink (_tmp22_);
	_g_object_unref0 (self->priv->actions_popover);
	self->priv->actions_popover = _tmp22_;
	_g_object_unref0 (_tmp21_);
	_tmp23_ = self->priv->actions_popover;
	g_signal_connect_data ((GtkPopover*) _tmp23_, "closed", (GCallback) ___lambda191__gtk_popover_closed, block44_data_ref (_data44_), (GClosureNotify) block44_data_unref, 0);
	_tmp24_ = self->priv->_button;
	_tmp25_ = self->priv->actions_popover;
	gtk_menu_button_set_popover (_tmp24_, (GtkPopover*) _tmp25_);
	_tmp26_ = self->priv->actions_popover;
	_tmp27_ = self->priv->_button;
	proton_plus_widgets_window_register_popover_for_controller ((GtkPopover*) _tmp26_, (GtkWidget*) _tmp27_, NULL);
	_tmp28_ = self->priv->_button;
	gtk_menu_button_set_icon_name (_tmp28_, "view-more-symbolic");
	_tmp29_ = self->priv->_button;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp29_, _ ("Game Actions"));
	_tmp30_ = self->priv->_button;
	gtk_menu_button_set_has_frame (_tmp30_, FALSE);
	_tmp31_ = self->priv->_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp31_, "flat");
	proton_plus_widgets_games_extra_button_unbind (self);
	_g_object_unref0 (action_group);
	block44_data_unref (_data44_);
	_data44_ = NULL;
	return self;
}

ProtonPlusWidgetsGamesExtraButton*
proton_plus_widgets_games_extra_button_new (ProtonPlusWidgetsGamesGameActionTarget* target)
{
	return proton_plus_widgets_games_extra_button_construct (PROTON_PLUS_WIDGETS_GAMES_TYPE_EXTRA_BUTTON, target);
}

static void
_proton_plus_widgets_games_extra_button_refresh_g_object_notify (GObject* _sender,
                                                                 GParamSpec* pspec,
                                                                 gpointer self)
{
	proton_plus_widgets_games_extra_button_refresh ((ProtonPlusWidgetsGamesExtraButton*) self);
}

void
proton_plus_widgets_games_extra_button_bind (ProtonPlusWidgetsGamesExtraButton* self,
                                             ProtonPlusWidgetsGamesGameListItem* item)
{
	ProtonPlusModelsGamesSteam* steam_game = NULL;
	ProtonPlusModelsGame* _tmp0_;
	ProtonPlusModelsGame* _tmp1_;
	ProtonPlusModelsGamesSteam* _tmp2_;
	ProtonPlusModelsGamesSteam* _tmp3_;
	GtkMenuButton* _tmp8_;
	ProtonPlusModelsGame* _tmp9_;
	ProtonPlusModelsGame* _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	proton_plus_widgets_games_extra_button_disconnect_anticheat (self);
	self->priv->bound = TRUE;
	_tmp0_ = proton_plus_widgets_games_game_list_item_get_game (item);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (PROTON_PLUS_MODELS_GAMES_IS_STEAM (_tmp1_) ? ((ProtonPlusModelsGamesSteam*) _tmp1_) : NULL);
	steam_game = _tmp2_;
	_tmp3_ = steam_game;
	if (_tmp3_ != NULL) {
		ProtonPlusModelsGamesSteam* _tmp4_;
		gulong _tmp5_;
		ProtonPlusModelsGamesSteam* _tmp6_;
		gulong _tmp7_;
		_tmp4_ = steam_game;
		_tmp5_ = g_signal_connect_object ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, PROTON_PLUS_MODELS_GAMES_TYPE_STEAM, ProtonPlusModelsGamesSteam), "notify::awacy-status", (GCallback) _proton_plus_widgets_games_extra_button_refresh_g_object_notify, self, 0);
		self->priv->awacy_status_handler = _tmp5_;
		_tmp6_ = steam_game;
		_tmp7_ = g_signal_connect_object ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, PROTON_PLUS_MODELS_GAMES_TYPE_STEAM, ProtonPlusModelsGamesSteam), "notify::awacy-lookup-complete", (GCallback) _proton_plus_widgets_games_extra_button_refresh_g_object_notify, self, 0);
		self->priv->awacy_lookup_complete_handler = _tmp7_;
	}
	proton_plus_widgets_games_extra_button_refresh (self);
	_tmp8_ = self->priv->_button;
	_tmp9_ = proton_plus_widgets_games_game_list_item_get_game (item);
	_tmp10_ = _tmp9_;
	_tmp11_ = proton_plus_models_game_get_name (_tmp10_);
	_tmp12_ = _tmp11_;
	_tmp13_ = g_strdup_printf (_ ("Actions for %s"), _tmp12_);
	_tmp14_ = _tmp13_;
	gtk_accessible_update_property ((GtkAccessible*) _tmp8_, GTK_ACCESSIBLE_PROPERTY_LABEL, _tmp14_, -1, -1);
	_g_free0 (_tmp14_);
	_g_object_unref0 (steam_game);
}

void
proton_plus_widgets_games_extra_button_unbind (ProtonPlusWidgetsGamesExtraButton* self)
{
	GtkMenuButton* _tmp0_;
	GtkMenuButton* _tmp1_;
	GtkMenuButton* _tmp2_;
	GtkButton* _tmp3_;
	GtkWidget* _tmp4_;
	GtkPopoverMenu* _tmp7_;
	GMenu* _tmp8_;
	GMenu* _tmp9_;
	GtkMenuButton* _tmp10_;
	g_return_if_fail (self != NULL);
	self->priv->bound = FALSE;
	_tmp0_ = self->priv->_button;
	gtk_menu_button_popdown (_tmp0_);
	proton_plus_widgets_games_extra_button_disconnect_anticheat (self);
	_g_object_unref0 (self->priv->availability);
	self->priv->availability = NULL;
	_tmp1_ = self->priv->_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp1_, FALSE);
	_tmp2_ = self->priv->_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp2_, FALSE);
	_tmp3_ = self->priv->anticheat_button;
	_tmp4_ = gtk_widget_get_parent ((GtkWidget*) _tmp3_);
	if (_tmp4_ != NULL) {
		GtkPopoverMenu* _tmp5_;
		GtkButton* _tmp6_;
		_tmp5_ = self->priv->actions_popover;
		_tmp6_ = self->priv->anticheat_button;
		gtk_popover_menu_remove_child (_tmp5_, (GtkWidget*) _tmp6_);
	}
	_tmp7_ = self->priv->actions_popover;
	_tmp8_ = g_menu_new ();
	_tmp9_ = _tmp8_;
	gtk_popover_menu_set_menu_model (_tmp7_, (GMenuModel*) _tmp9_);
	_g_object_unref0 (_tmp9_);
	_tmp10_ = self->priv->_button;
	gtk_accessible_reset_property ((GtkAccessible*) _tmp10_, GTK_ACCESSIBLE_PROPERTY_LABEL);
}

static gboolean*
_bool_dup (gboolean* self)
{
	gboolean* dup;
	dup = g_new0 (gboolean, 1);
	memcpy (dup, self, sizeof (gboolean));
	return dup;
}

static gpointer
__bool_dup0 (gpointer self)
{
	return self ? _bool_dup (self) : NULL;
}

static void
proton_plus_widgets_games_extra_button_refresh (ProtonPlusWidgetsGamesExtraButton* self)
{
	ProtonPlusWidgetsGamesGameListItem* item = NULL;
	ProtonPlusWidgetsGamesGameActionTarget* _tmp0_;
	ProtonPlusWidgetsGamesGameListItem* _tmp1_;
	ProtonPlusWidgetsGamesGameListItem* _tmp2_;
	ProtonPlusWidgetsGamesGameListItem* _tmp3_;
	ProtonPlusWidgetsGamesGameListItem* _tmp4_;
	ProtonPlusModelsGamesSteam* steam_game = NULL;
	ProtonPlusWidgetsGamesGameListItem* _tmp5_;
	ProtonPlusModelsGame* _tmp6_;
	ProtonPlusModelsGame* _tmp7_;
	ProtonPlusModelsGamesSteam* _tmp8_;
	gboolean _tmp9_ = FALSE;
	ProtonPlusModelsGamesSteam* _tmp10_ = NULL;
	ProtonPlusModelsGamesSteam* _tmp11_;
	const gchar* _tmp12_ = NULL;
	ProtonPlusModelsGamesSteam* _tmp15_ = NULL;
	ProtonPlusModelsGamesSteam* _tmp16_;
	const gchar* _tmp17_ = NULL;
	ProtonPlusModelsGamesSteam* _tmp20_ = NULL;
	ProtonPlusModelsGamesSteam* _tmp21_;
	gboolean* _tmp22_ = NULL;
	gboolean* _tmp26_ = NULL;
	gboolean* _tmp27_;
	ProtonPlusModelsGamesSteam* _tmp30_;
	ProtonPlusWidgetsGamesGameListItem* _tmp31_;
	gboolean _tmp32_;
	gboolean _tmp33_;
	ProtonPlusWidgetsGamesGameListItem* _tmp34_;
	gboolean _tmp35_;
	gboolean _tmp36_;
	ProtonPlusWidgetsGamesGameListItem* _tmp37_;
	gboolean _tmp38_;
	gboolean _tmp39_;
	ProtonPlusWidgetsGamesGameListItem* _tmp40_;
	gboolean _tmp41_;
	gboolean _tmp42_;
	ProtonPlusWidgetsGamesGameActionAvailability* _tmp43_;
	ProtonPlusWidgetsGamesGameActionAvailability* current = NULL;
	ProtonPlusWidgetsGamesGameActionAvailability* _tmp44_;
	ProtonPlusWidgetsGamesGameActionAvailability* _tmp45_;
	GSimpleAction* _tmp46_;
	ProtonPlusWidgetsGamesGameActionAvailability* _tmp47_;
	gboolean _tmp48_;
	gboolean _tmp49_;
	GSimpleAction* _tmp50_;
	ProtonPlusWidgetsGamesGameActionAvailability* _tmp51_;
	gboolean _tmp52_;
	gboolean _tmp53_;
	GSimpleAction* _tmp54_;
	ProtonPlusWidgetsGamesGameActionAvailability* _tmp55_;
	gboolean _tmp56_;
	gboolean _tmp57_;
	GSimpleAction* _tmp58_;
	ProtonPlusWidgetsGamesGameActionAvailability* _tmp59_;
	gboolean _tmp60_;
	gboolean _tmp61_;
	GSimpleAction* _tmp62_;
	ProtonPlusWidgetsGamesGameActionAvailability* _tmp63_;
	gboolean _tmp64_;
	gboolean _tmp65_;
	GSimpleAction* _tmp66_;
	ProtonPlusWidgetsGamesGameActionAvailability* _tmp67_;
	gboolean _tmp68_;
	gboolean _tmp69_;
	GMenu* menu = NULL;
	GMenu* _tmp70_;
	ProtonPlusWidgetsGamesGameActionAvailability* _tmp71_;
	gboolean _tmp72_;
	gboolean _tmp73_;
	ProtonPlusWidgetsGamesGameActionAvailability* _tmp75_;
	gboolean _tmp76_;
	gboolean _tmp77_;
	ProtonPlusWidgetsGamesGameActionAvailability* _tmp79_;
	gboolean _tmp80_;
	gboolean _tmp81_;
	ProtonPlusWidgetsGamesGameActionAvailability* _tmp83_;
	gboolean _tmp84_;
	gboolean _tmp85_;
	ProtonPlusWidgetsGamesGameActionAvailability* _tmp87_;
	gboolean _tmp88_;
	gboolean _tmp89_;
	ProtonPlusWidgetsGamesGameActionAvailability* _tmp91_;
	gboolean _tmp92_;
	gboolean _tmp93_;
	GtkButton* _tmp108_;
	GtkWidget* _tmp109_;
	GtkPopoverMenu* _tmp112_;
	GMenu* _tmp113_;
	ProtonPlusWidgetsGamesGameActionAvailability* _tmp114_;
	gboolean _tmp115_;
	gboolean _tmp116_;
	GtkMenuButton* _tmp119_;
	ProtonPlusWidgetsGamesGameActionAvailability* _tmp120_;
	gboolean _tmp121_;
	gboolean _tmp122_;
	GtkMenuButton* _tmp123_;
	ProtonPlusWidgetsGamesGameActionAvailability* _tmp124_;
	gboolean _tmp125_;
	gboolean _tmp126_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->target;
	_tmp1_ = proton_plus_widgets_games_game_action_target_get_item (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	item = _tmp3_;
	_tmp4_ = item;
	if (_tmp4_ == NULL) {
		_g_object_unref0 (item);
		return;
	}
	_tmp5_ = item;
	_tmp6_ = proton_plus_widgets_games_game_list_item_get_game (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem));
	_tmp7_ = _tmp6_;
	_tmp8_ = _g_object_ref0 (PROTON_PLUS_MODELS_GAMES_IS_STEAM (_tmp7_) ? ((ProtonPlusModelsGamesSteam*) _tmp7_) : NULL);
	steam_game = _tmp8_;
	if (proton_plus_globals_PROTONTRICKS_INSTALLED) {
		_tmp9_ = TRUE;
	} else {
		_tmp9_ = proton_plus_globals_PROTONTRICKS_FLATPAK_INSTALLED;
	}
	_tmp11_ = steam_game;
	_tmp10_ = _tmp11_;
	_tmp12_ = NULL;
	if (_tmp10_ != NULL) {
		const gchar* _tmp13_;
		const gchar* _tmp14_;
		_tmp13_ = proton_plus_models_games_steam_get_awacy_status (_tmp10_);
		_tmp14_ = _tmp13_;
		_tmp12_ = _tmp14_;
	}
	_tmp16_ = steam_game;
	_tmp15_ = _tmp16_;
	_tmp17_ = NULL;
	if (_tmp15_ != NULL) {
		const gchar* _tmp18_;
		const gchar* _tmp19_;
		_tmp18_ = proton_plus_models_games_steam_get_awacy_name (_tmp15_);
		_tmp19_ = _tmp18_;
		_tmp17_ = _tmp19_;
	}
	_tmp21_ = steam_game;
	_tmp20_ = _tmp21_;
	_tmp22_ = NULL;
	if (_tmp20_ != NULL) {
		gboolean _tmp23_;
		gboolean _tmp24_;
		gboolean* _tmp25_;
		_tmp23_ = proton_plus_models_games_steam_get_awacy_lookup_complete (_tmp20_);
		_tmp24_ = _tmp23_;
		_tmp25_ = __bool_dup0 (&_tmp24_);
		_g_free0 (_tmp22_);
		_tmp22_ = _tmp25_;
	}
	_tmp27_ = __bool_dup0 (_tmp22_);
	_tmp26_ = _tmp27_;
	if (_tmp26_ == NULL) {
		gboolean _tmp28_;
		gboolean* _tmp29_;
		_tmp28_ = FALSE;
		_tmp29_ = __bool_dup0 (&_tmp28_);
		_g_free0 (_tmp26_);
		_tmp26_ = _tmp29_;
	}
	_tmp30_ = steam_game;
	_tmp31_ = item;
	_tmp32_ = proton_plus_widgets_games_game_list_item_get_is_non_steam (G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem));
	_tmp33_ = _tmp32_;
	_tmp34_ = item;
	_tmp35_ = proton_plus_widgets_games_game_list_item_get_is_native (G_TYPE_CHECK_INSTANCE_CAST (_tmp34_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem));
	_tmp36_ = _tmp35_;
	_tmp37_ = item;
	_tmp38_ = proton_plus_widgets_games_game_list_item_get_has_install_directory (G_TYPE_CHECK_INSTANCE_CAST (_tmp37_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem));
	_tmp39_ = _tmp38_;
	_tmp40_ = item;
	_tmp41_ = proton_plus_widgets_games_game_list_item_get_has_prefix_directory (G_TYPE_CHECK_INSTANCE_CAST (_tmp40_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem));
	_tmp42_ = _tmp41_;
	_tmp43_ = proton_plus_widgets_games_game_action_availability_evaluate (_tmp30_ != NULL, _tmp33_, _tmp36_, _tmp39_, _tmp42_, _tmp9_, _tmp12_, _tmp17_ != NULL, *_tmp26_);
	_g_object_unref0 (self->priv->availability);
	self->priv->availability = _tmp43_;
	_tmp44_ = self->priv->availability;
	_tmp45_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp44_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_ACTION_AVAILABILITY, ProtonPlusWidgetsGamesGameActionAvailability));
	current = _tmp45_;
	_tmp46_ = self->priv->custom_executable_action;
	_tmp47_ = current;
	_tmp48_ = proton_plus_widgets_games_game_action_availability_get_enable_custom_executable (_tmp47_);
	_tmp49_ = _tmp48_;
	g_simple_action_set_enabled (_tmp46_, _tmp49_);
	_tmp50_ = self->priv->open_install_directory_action;
	_tmp51_ = current;
	_tmp52_ = proton_plus_widgets_games_game_action_availability_get_show_install_directory (_tmp51_);
	_tmp53_ = _tmp52_;
	g_simple_action_set_enabled (_tmp50_, _tmp53_);
	_tmp54_ = self->priv->open_prefix_directory_action;
	_tmp55_ = current;
	_tmp56_ = proton_plus_widgets_games_game_action_availability_get_show_prefix_directory (_tmp55_);
	_tmp57_ = _tmp56_;
	g_simple_action_set_enabled (_tmp54_, _tmp57_);
	_tmp58_ = self->priv->open_protontricks_action;
	_tmp59_ = current;
	_tmp60_ = proton_plus_widgets_games_game_action_availability_get_show_protontricks (_tmp59_);
	_tmp61_ = _tmp60_;
	g_simple_action_set_enabled (_tmp58_, _tmp61_);
	_tmp62_ = self->priv->open_protondb_action;
	_tmp63_ = current;
	_tmp64_ = proton_plus_widgets_games_game_action_availability_get_show_protondb (_tmp63_);
	_tmp65_ = _tmp64_;
	g_simple_action_set_enabled (_tmp62_, _tmp65_);
	_tmp66_ = self->priv->open_anticheat_action;
	_tmp67_ = current;
	_tmp68_ = proton_plus_widgets_games_game_action_availability_get_enable_anticheat (_tmp67_);
	_tmp69_ = _tmp68_;
	g_simple_action_set_enabled (_tmp66_, _tmp69_);
	_tmp70_ = g_menu_new ();
	menu = _tmp70_;
	_tmp71_ = current;
	_tmp72_ = proton_plus_widgets_games_game_action_availability_get_show_custom_executable (_tmp71_);
	_tmp73_ = _tmp72_;
	if (_tmp73_) {
		GMenu* _tmp74_;
		_tmp74_ = menu;
		g_menu_append (_tmp74_, _ ("_Run Custom Executable…"), "game.custom-executable");
	}
	_tmp75_ = current;
	_tmp76_ = proton_plus_widgets_games_game_action_availability_get_show_install_directory (_tmp75_);
	_tmp77_ = _tmp76_;
	if (_tmp77_) {
		GMenu* _tmp78_;
		_tmp78_ = menu;
		g_menu_append (_tmp78_, _ ("Open _Game Folder"), "game.open-install-directory");
	}
	_tmp79_ = current;
	_tmp80_ = proton_plus_widgets_games_game_action_availability_get_show_prefix_directory (_tmp79_);
	_tmp81_ = _tmp80_;
	if (_tmp81_) {
		GMenu* _tmp82_;
		_tmp82_ = menu;
		g_menu_append (_tmp82_, _ ("Open _Prefix Folder"), "game.open-prefix-directory");
	}
	_tmp83_ = current;
	_tmp84_ = proton_plus_widgets_games_game_action_availability_get_show_protontricks (_tmp83_);
	_tmp85_ = _tmp84_;
	if (_tmp85_) {
		GMenu* _tmp86_;
		_tmp86_ = menu;
		g_menu_append (_tmp86_, _ ("Open in Proton_tricks"), "game.open-protontricks");
	}
	_tmp87_ = current;
	_tmp88_ = proton_plus_widgets_games_game_action_availability_get_show_protondb (_tmp87_);
	_tmp89_ = _tmp88_;
	if (_tmp89_) {
		GMenu* _tmp90_;
		_tmp90_ = menu;
		g_menu_append (_tmp90_, _ ("Open Proton_DB"), "game.open-protondb");
	}
	_tmp91_ = current;
	_tmp92_ = proton_plus_widgets_games_game_action_availability_get_show_anticheat (_tmp91_);
	_tmp93_ = _tmp92_;
	if (_tmp93_) {
		GMenuItem* anticheat_item = NULL;
		GMenuItem* _tmp94_;
		GMenuItem* _tmp95_;
		GMenu* _tmp96_;
		GMenuItem* _tmp97_;
		GtkLabel* _tmp98_;
		ProtonPlusWidgetsGamesGameActionAvailability* _tmp99_;
		ProtonPlusWidgetsGamesGameAntiCheatState _tmp100_;
		ProtonPlusWidgetsGamesGameAntiCheatState _tmp101_;
		gchar* _tmp102_;
		gchar* _tmp103_;
		GtkButton* _tmp104_;
		ProtonPlusWidgetsGamesGameActionAvailability* _tmp105_;
		gboolean _tmp106_;
		gboolean _tmp107_;
		_tmp94_ = g_menu_item_new (NULL, NULL);
		anticheat_item = _tmp94_;
		_tmp95_ = anticheat_item;
		g_menu_item_set_attribute (_tmp95_, "custom", "s", "anticheat", NULL);
		_tmp96_ = menu;
		_tmp97_ = anticheat_item;
		g_menu_append_item (_tmp96_, _tmp97_);
		_tmp98_ = self->priv->anticheat_button_label;
		_tmp99_ = current;
		_tmp100_ = proton_plus_widgets_games_game_action_availability_get_anticheat_state (_tmp99_);
		_tmp101_ = _tmp100_;
		_tmp102_ = proton_plus_widgets_games_extra_button_anticheat_label (self, _tmp101_);
		_tmp103_ = _tmp102_;
		gtk_label_set_label (_tmp98_, _tmp103_);
		_g_free0 (_tmp103_);
		_tmp104_ = self->priv->anticheat_button;
		_tmp105_ = current;
		_tmp106_ = proton_plus_widgets_games_game_action_availability_get_enable_anticheat (_tmp105_);
		_tmp107_ = _tmp106_;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp104_, _tmp107_);
		_g_object_unref0 (anticheat_item);
	}
	_tmp108_ = self->priv->anticheat_button;
	_tmp109_ = gtk_widget_get_parent ((GtkWidget*) _tmp108_);
	if (_tmp109_ != NULL) {
		GtkPopoverMenu* _tmp110_;
		GtkButton* _tmp111_;
		_tmp110_ = self->priv->actions_popover;
		_tmp111_ = self->priv->anticheat_button;
		gtk_popover_menu_remove_child (_tmp110_, (GtkWidget*) _tmp111_);
	}
	_tmp112_ = self->priv->actions_popover;
	_tmp113_ = menu;
	gtk_popover_menu_set_menu_model (_tmp112_, (GMenuModel*) _tmp113_);
	_tmp114_ = current;
	_tmp115_ = proton_plus_widgets_games_game_action_availability_get_show_anticheat (_tmp114_);
	_tmp116_ = _tmp115_;
	if (_tmp116_) {
		GtkPopoverMenu* _tmp117_;
		GtkButton* _tmp118_;
		_tmp117_ = self->priv->actions_popover;
		_tmp118_ = self->priv->anticheat_button;
		gtk_popover_menu_add_child (_tmp117_, (GtkWidget*) _tmp118_, "anticheat");
	}
	_tmp119_ = self->priv->_button;
	_tmp120_ = current;
	_tmp121_ = proton_plus_widgets_games_game_action_availability_get_has_secondary_actions (_tmp120_);
	_tmp122_ = _tmp121_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp119_, _tmp122_);
	_tmp123_ = self->priv->_button;
	_tmp124_ = current;
	_tmp125_ = proton_plus_widgets_games_game_action_availability_get_has_secondary_actions (_tmp124_);
	_tmp126_ = _tmp125_;
	gtk_widget_set_visible ((GtkWidget*) _tmp123_, _tmp126_);
	_g_object_unref0 (menu);
	_g_object_unref0 (current);
	_g_free0 (_tmp26_);
	_g_free0 (_tmp22_);
	_g_object_unref0 (steam_game);
	_g_object_unref0 (item);
}

static Block45Data*
block45_data_ref (Block45Data* _data45_)
{
	g_atomic_int_inc (&_data45_->_ref_count_);
	return _data45_;
}

static void
block45_data_unref (void * _userdata_)
{
	Block45Data* _data45_;
	_data45_ = (Block45Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data45_->_ref_count_)) {
		(_data45_->callback_target_destroy_notify == NULL) ? NULL : (_data45_->callback_target_destroy_notify (_data45_->callback_target), NULL);
		_data45_->callback = NULL;
		_data45_->callback_target = NULL;
		_data45_->callback_target_destroy_notify = NULL;
		g_slice_free (Block45Data, _data45_);
	}
}

static void
__lambda188_ (Block45Data* _data45_,
              GVariant* parameter)
{
	_data45_->callback (_data45_->callback_target);
}

static void
___lambda188__g_simple_action_activate (GSimpleAction* _sender,
                                        GVariant* parameter,
                                        gpointer self)
{
	__lambda188_ (self, parameter);
}

static GSimpleAction*
proton_plus_widgets_games_extra_button_create_action (GSimpleActionGroup* group,
                                                      const gchar* name,
                                                      ProtonPlusWidgetsGamesExtraButtonActionCallback callback,
                                                      gpointer callback_target,
                                                      GDestroyNotify callback_target_destroy_notify)
{
	Block45Data* _data45_;
	GSimpleAction* action = NULL;
	GSimpleAction* _tmp0_;
	GSimpleAction* result;
	g_return_val_if_fail (group != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	_data45_ = g_slice_new0 (Block45Data);
	_data45_->_ref_count_ = 1;
	(_data45_->callback_target_destroy_notify == NULL) ? NULL : (_data45_->callback_target_destroy_notify (_data45_->callback_target), NULL);
	_data45_->callback = NULL;
	_data45_->callback_target = NULL;
	_data45_->callback_target_destroy_notify = NULL;
	_data45_->callback = callback;
	_data45_->callback_target = callback_target;
	_data45_->callback_target_destroy_notify = callback_target_destroy_notify;
	_tmp0_ = g_simple_action_new (name, NULL);
	action = _tmp0_;
	g_signal_connect_data (action, "activate", (GCallback) ___lambda188__g_simple_action_activate, block45_data_ref (_data45_), (GClosureNotify) block45_data_unref, 0);
	g_action_map_add_action ((GActionMap*) group, (GAction*) action);
	result = action;
	block45_data_unref (_data45_);
	_data45_ = NULL;
	return result;
}

static gchar*
proton_plus_widgets_games_extra_button_anticheat_label (ProtonPlusWidgetsGamesExtraButton* self,
                                                        ProtonPlusWidgetsGamesGameAntiCheatState state)
{
	gchar* status = NULL;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	switch (state) {
		case PROTON_PLUS_WIDGETS_GAMES_GAME_ANTI_CHEAT_STATE_SUPPORTED:
		{
			gchar* _tmp0_;
			_tmp0_ = g_strdup (_ ("Supported"));
			_g_free0 (status);
			status = _tmp0_;
			break;
		}
		case PROTON_PLUS_WIDGETS_GAMES_GAME_ANTI_CHEAT_STATE_RUNNING:
		{
			gchar* _tmp1_;
			_tmp1_ = g_strdup (_ ("Running"));
			_g_free0 (status);
			status = _tmp1_;
			break;
		}
		case PROTON_PLUS_WIDGETS_GAMES_GAME_ANTI_CHEAT_STATE_PLANNED:
		{
			gchar* _tmp2_;
			_tmp2_ = g_strdup (_ ("Planned"));
			_g_free0 (status);
			status = _tmp2_;
			break;
		}
		case PROTON_PLUS_WIDGETS_GAMES_GAME_ANTI_CHEAT_STATE_BROKEN:
		{
			gchar* _tmp3_;
			_tmp3_ = g_strdup (_ ("Broken"));
			_g_free0 (status);
			status = _tmp3_;
			break;
		}
		case PROTON_PLUS_WIDGETS_GAMES_GAME_ANTI_CHEAT_STATE_DENIED:
		{
			gchar* _tmp4_;
			_tmp4_ = g_strdup (_ ("Denied"));
			_g_free0 (status);
			status = _tmp4_;
			break;
		}
		case PROTON_PLUS_WIDGETS_GAMES_GAME_ANTI_CHEAT_STATE_LOADING:
		{
			gchar* _tmp5_;
			_tmp5_ = g_strdup (_ ("Loading…"));
			_g_free0 (status);
			status = _tmp5_;
			break;
		}
		default:
		{
			gchar* _tmp6_;
			_tmp6_ = g_strdup (_ ("Unknown"));
			_g_free0 (status);
			status = _tmp6_;
			break;
		}
	}
	_tmp7_ = status;
	_tmp8_ = g_strdup_printf (_ ("Anti-Cheat: %s"), _tmp7_);
	result = _tmp8_;
	_g_free0 (status);
	return result;
}

static Block46Data*
block46_data_ref (Block46Data* _data46_)
{
	g_atomic_int_inc (&_data46_->_ref_count_);
	return _data46_;
}

static void
block46_data_unref (void * _userdata_)
{
	Block46Data* _data46_;
	_data46_ = (Block46Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data46_->_ref_count_)) {
		ProtonPlusWidgetsGamesExtraButton* self;
		self = _data46_->self;
		_g_object_unref0 (_data46_->file_dialog);
		_g_object_unref0 (_data46_->root);
		_g_object_unref0 (_data46_->expected);
		_g_object_unref0 (self);
		g_slice_free (Block46Data, _data46_);
	}
}

static void
__lambda189_ (Block46Data* _data46_,
              GObject* object,
              GAsyncResult* _result_)
{
	ProtonPlusWidgetsGamesExtraButton* self;
	GError* _inner_error0_ = NULL;
	self = _data46_->self;
	g_return_if_fail (_result_ != NULL);
	{
		GFile* file = NULL;
		GtkFileDialog* _tmp0_;
		GFile* _tmp1_;
		GFile* _tmp2_ = NULL;
		gchar* _tmp3_ = NULL;
		gchar* path = NULL;
		gchar* _tmp5_;
		const gchar* _tmp6_;
		_tmp0_ = _data46_->file_dialog;
		_tmp1_ = gtk_file_dialog_open_finish (_tmp0_, _result_, &_inner_error0_);
		file = _tmp1_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp2_ = file;
		_tmp3_ = NULL;
		if (_tmp2_ != NULL) {
			gchar* _tmp4_;
			_tmp4_ = g_file_get_path (_tmp2_);
			_g_free0 (_tmp3_);
			_tmp3_ = _tmp4_;
		}
		_tmp5_ = _tmp3_;
		_tmp3_ = NULL;
		path = _tmp5_;
		_tmp6_ = path;
		if (_tmp6_ != NULL) {
			ProtonPlusWidgetsGamesGameListItem* _tmp7_;
			const gchar* _tmp8_;
			GtkWindow* _tmp9_;
			_tmp7_ = _data46_->expected;
			_tmp8_ = path;
			_tmp9_ = _data46_->root;
			proton_plus_widgets_games_extra_button_run_custom_executable (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem), (const gchar*) _tmp8_, G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_window_get_type (), GtkWindow));
		}
		_g_free0 (path);
		_g_free0 (_tmp3_);
		_g_object_unref0 (file);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		GError* _tmp10_;
		const gchar* _tmp11_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp10_ = _error_;
		_tmp11_ = _tmp10_->message;
		g_warning ("games-extra-button.vala:235: %s", _tmp11_);
		_g_error_free0 (_error_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
___lambda189__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	__lambda189_ (self, source_object, res);
	block46_data_unref (self);
}

static void
proton_plus_widgets_games_extra_button_open_custom_executable (ProtonPlusWidgetsGamesExtraButton* self)
{
	Block46Data* _data46_;
	ProtonPlusWidgetsGamesGameActionTarget* _tmp0_;
	ProtonPlusWidgetsGamesGameListItem* _tmp1_;
	ProtonPlusWidgetsGamesGameListItem* _tmp2_;
	ProtonPlusWidgetsGamesGameListItem* _tmp3_;
	ProtonPlusWidgetsGamesGameListItem* _tmp4_;
	GtkMenuButton* _tmp5_;
	GtkRoot* _tmp6_;
	GtkWindow* _tmp7_;
	GtkWindow* _tmp8_;
	gchar* _tmp9_;
	GtkFileDialog* _tmp10_ = NULL;
	GListStore* filters = NULL;
	GListStore* _tmp11_;
	GtkFileFilter* filter = NULL;
	gchar* _tmp12_;
	GtkFileFilter* _tmp13_ = NULL;
	GtkFileFilter* _tmp14_;
	GtkFileFilter* _tmp15_;
	GtkFileFilter* _tmp16_;
	GtkFileFilter* _tmp17_;
	GListStore* _tmp18_;
	GtkFileFilter* _tmp19_;
	GtkFileDialog* _tmp20_;
	GListStore* _tmp21_;
	GtkFileDialog* _tmp22_;
	GtkWindow* _tmp23_;
	g_return_if_fail (self != NULL);
	_data46_ = g_slice_new0 (Block46Data);
	_data46_->_ref_count_ = 1;
	_data46_->self = g_object_ref (self);
	_tmp0_ = self->priv->target;
	_tmp1_ = proton_plus_widgets_games_game_action_target_get_item (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_data46_->expected = _tmp3_;
	_tmp4_ = _data46_->expected;
	if (_tmp4_ == NULL) {
		block46_data_unref (_data46_);
		_data46_ = NULL;
		return;
	}
	_tmp5_ = self->priv->_button;
	_tmp6_ = gtk_widget_get_root ((GtkWidget*) _tmp5_);
	_tmp7_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp6_, gtk_window_get_type ()) ? ((GtkWindow*) _tmp6_) : NULL);
	_data46_->root = _tmp7_;
	_tmp8_ = _data46_->root;
	if (_tmp8_ == NULL) {
		block46_data_unref (_data46_);
		_data46_ = NULL;
		return;
	}
	_tmp9_ = g_strdup (_ ("Select executable"));
	_tmp10_ = gtk_file_dialog_new ();
	gtk_file_dialog_set_title (_tmp10_, _tmp9_);
	_g_free0 (_tmp9_);
	_data46_->file_dialog = _tmp10_;
	_tmp11_ = g_list_store_new (gtk_file_filter_get_type ());
	filters = _tmp11_;
	_tmp12_ = g_strdup (_ ("Executables (*.exe, *.msi, *.msu, *.bat)"));
	_tmp13_ = gtk_file_filter_new ();
	g_object_set (_tmp13_, "name", _tmp12_, NULL);
	_g_free0 (_tmp12_);
	filter = _tmp13_;
	_tmp14_ = filter;
	gtk_file_filter_add_pattern (_tmp14_, "*.exe");
	_tmp15_ = filter;
	gtk_file_filter_add_pattern (_tmp15_, "*.msi");
	_tmp16_ = filter;
	gtk_file_filter_add_pattern (_tmp16_, "*.msu");
	_tmp17_ = filter;
	gtk_file_filter_add_pattern (_tmp17_, "*.bat");
	_tmp18_ = filters;
	_tmp19_ = filter;
	g_list_store_append (_tmp18_, (GObject*) _tmp19_);
	_tmp20_ = _data46_->file_dialog;
	_tmp21_ = filters;
	gtk_file_dialog_set_filters (_tmp20_, (GListModel*) _tmp21_);
	_tmp22_ = _data46_->file_dialog;
	_tmp23_ = _data46_->root;
	gtk_file_dialog_open (_tmp22_, G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, gtk_window_get_type (), GtkWindow), NULL, ___lambda189__gasync_ready_callback, block46_data_ref (_data46_));
	_g_object_unref0 (filter);
	_g_object_unref0 (filters);
	block46_data_unref (_data46_);
	_data46_ = NULL;
}

static Block47Data*
block47_data_ref (Block47Data* _data47_)
{
	g_atomic_int_inc (&_data47_->_ref_count_);
	return _data47_;
}

static void
block47_data_unref (void * _userdata_)
{
	Block47Data* _data47_;
	_data47_ = (Block47Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data47_->_ref_count_)) {
		_g_object_unref0 (_data47_->game);
		_g_object_unref0 (_data47_->root);
		g_slice_free (Block47Data, _data47_);
	}
}

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
__lambda190_ (Block47Data* _data47_,
              GObject* object,
              GAsyncResult* _result_)
{
	ProtonPlusUtilsCommandResult* command_result = NULL;
	ProtonPlusUtilsCommandResult* _tmp0_;
	ProtonPlusUtilsCommandResult* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gchar* diagnostic = NULL;
	ProtonPlusUtilsCommandResult* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	const gchar* _tmp8_;
	gchar* details = NULL;
	ProtonPlusUtilsCommandResult* _tmp13_;
	gint _tmp14_;
	gint _tmp15_;
	gchar* _tmp16_;
	const gchar* _tmp17_;
	ProtonPlusModelsGame* _tmp21_;
	const gchar* _tmp22_;
	const gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	const gchar* _tmp26_;
	ProtonPlusWidgetsMainErrorDialog* _tmp27_;
	ProtonPlusWidgetsMainErrorDialog* _tmp28_;
	g_return_if_fail (_result_ != NULL);
	_tmp0_ = proton_plus_utils_system_run_command_finish (_result_);
	command_result = _tmp0_;
	_tmp1_ = command_result;
	_tmp2_ = proton_plus_utils_command_result_get_exit_status (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_ == 0) {
		_g_object_unref0 (command_result);
		return;
	}
	_tmp4_ = command_result;
	_tmp5_ = proton_plus_utils_command_result_get_stderr (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = string_strip (_tmp6_);
	diagnostic = _tmp7_;
	_tmp8_ = diagnostic;
	if (g_strcmp0 (_tmp8_, "") == 0) {
		ProtonPlusUtilsCommandResult* _tmp9_;
		const gchar* _tmp10_;
		const gchar* _tmp11_;
		gchar* _tmp12_;
		_tmp9_ = command_result;
		_tmp10_ = proton_plus_utils_command_result_get_stdout (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp12_ = string_strip (_tmp11_);
		_g_free0 (diagnostic);
		diagnostic = _tmp12_;
	}
	_tmp13_ = command_result;
	_tmp14_ = proton_plus_utils_command_result_get_exit_status (_tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = g_strdup_printf (_ ("Exit status: %d"), _tmp15_);
	details = _tmp16_;
	_tmp17_ = diagnostic;
	if (g_strcmp0 (_tmp17_, "") != 0) {
		const gchar* _tmp18_;
		const gchar* _tmp19_;
		gchar* _tmp20_;
		_tmp18_ = details;
		_tmp19_ = diagnostic;
		_tmp20_ = g_strdup_printf ("%s\n\n%s", _tmp18_, _tmp19_);
		_g_free0 (details);
		details = _tmp20_;
	}
	_tmp21_ = _data47_->game;
	_tmp22_ = proton_plus_models_game_get_name (_tmp21_);
	_tmp23_ = _tmp22_;
	_tmp24_ = g_strdup_printf (_ ("The custom executable for %s could not be launched."), _tmp23_);
	_tmp25_ = _tmp24_;
	_tmp26_ = details;
	_tmp27_ = proton_plus_widgets_main_error_dialog_new (_ ("Custom Executable Failed"), _tmp25_, _tmp26_);
	g_object_ref_sink (_tmp27_);
	_tmp28_ = _tmp27_;
	proton_plus_widgets_games_extra_button_present_error_dialog (_data47_->root, (AdwAlertDialog*) _tmp28_);
	_g_object_unref0 (_tmp28_);
	_g_free0 (_tmp25_);
	_g_free0 (details);
	_g_free0 (diagnostic);
	_g_object_unref0 (command_result);
}

static void
___lambda190__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	__lambda190_ (self, source_object, res);
	block47_data_unref (self);
}

static void
proton_plus_widgets_games_extra_button_run_custom_executable (ProtonPlusWidgetsGamesGameListItem* expected,
                                                              const gchar* exe_path,
                                                              GtkWindow* root)
{
	Block47Data* _data47_;
	GtkWindow* _tmp0_;
	ProtonPlusModelsGame* _tmp1_;
	ProtonPlusModelsGame* _tmp2_;
	ProtonPlusModelsGame* _tmp3_;
	ProtonPlusModelsLaunchersSteam* steam = NULL;
	ProtonPlusModelsGame* _tmp4_;
	ProtonPlusModelsLauncher* _tmp5_;
	ProtonPlusModelsLauncher* _tmp6_;
	ProtonPlusModelsLaunchersSteam* _tmp7_;
	ProtonPlusModelsLaunchersSteam* _tmp8_ = NULL;
	ProtonPlusModelsLaunchersSteam* _tmp9_;
	gchar* _tmp10_ = NULL;
	gchar* proton_path = NULL;
	gchar* _tmp15_;
	const gchar* _tmp16_;
	gchar* inner_command = NULL;
	ProtonPlusModelsGame* _tmp24_;
	const gchar* _tmp25_;
	const gchar* _tmp26_;
	gchar* _tmp27_;
	gchar* _tmp28_;
	ProtonPlusModelsGame* _tmp29_;
	ProtonPlusModelsLauncher* _tmp30_;
	ProtonPlusModelsLauncher* _tmp31_;
	const gchar* _tmp32_;
	gchar* _tmp33_;
	gchar* _tmp34_;
	const gchar* _tmp35_;
	gchar* _tmp36_;
	gchar* _tmp37_;
	gchar* _tmp38_;
	gchar* _tmp39_;
	gchar* _tmp40_;
	gchar* _tmp41_;
	const gchar* _tmp42_;
	gchar* _tmp43_;
	gchar* _tmp44_;
	gchar* _tmp45_;
	gchar* _tmp46_;
	g_return_if_fail (expected != NULL);
	g_return_if_fail (exe_path != NULL);
	g_return_if_fail (root != NULL);
	_data47_ = g_slice_new0 (Block47Data);
	_data47_->_ref_count_ = 1;
	_tmp0_ = _g_object_ref0 (root);
	_g_object_unref0 (_data47_->root);
	_data47_->root = _tmp0_;
	_tmp1_ = proton_plus_widgets_games_game_list_item_get_game (expected);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_data47_->game = _tmp3_;
	_tmp4_ = _data47_->game;
	_tmp5_ = proton_plus_models_game_get_launcher (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = _g_object_ref0 (PROTON_PLUS_MODELS_LAUNCHERS_IS_STEAM (_tmp6_) ? ((ProtonPlusModelsLaunchersSteam*) _tmp6_) : NULL);
	steam = _tmp7_;
	_tmp9_ = steam;
	_tmp8_ = _tmp9_;
	_tmp10_ = NULL;
	if (_tmp8_ != NULL) {
		ProtonPlusModelsGame* _tmp11_;
		const gchar* _tmp12_;
		const gchar* _tmp13_;
		gchar* _tmp14_;
		_tmp11_ = _data47_->game;
		_tmp12_ = proton_plus_models_game_get_compatibility_tool (_tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = proton_plus_models_launchers_steam_resolve_effective_proton_executable (_tmp8_, _tmp13_);
		_g_free0 (_tmp10_);
		_tmp10_ = _tmp14_;
	}
	_tmp15_ = _tmp10_;
	_tmp10_ = NULL;
	proton_path = _tmp15_;
	_tmp16_ = proton_path;
	if (_tmp16_ == NULL) {
		ProtonPlusModelsGame* _tmp17_;
		const gchar* _tmp18_;
		const gchar* _tmp19_;
		gchar* _tmp20_;
		gchar* _tmp21_;
		ProtonPlusWidgetsMainErrorDialog* _tmp22_;
		ProtonPlusWidgetsMainErrorDialog* _tmp23_;
		_tmp17_ = _data47_->game;
		_tmp18_ = proton_plus_models_game_get_name (_tmp17_);
		_tmp19_ = _tmp18_;
		_tmp20_ = g_strdup_printf (_ ("The compatibility tool required for %s is missing from your system. Pl" \
"ease ensure it is correctly installed."), _tmp19_);
		_tmp21_ = _tmp20_;
		_tmp22_ = proton_plus_widgets_main_error_dialog_new (_ ("Compatibility Tool Not Found"), _tmp21_, "");
		g_object_ref_sink (_tmp22_);
		_tmp23_ = _tmp22_;
		proton_plus_widgets_games_extra_button_present_error_dialog (_data47_->root, (AdwAlertDialog*) _tmp23_);
		_g_object_unref0 (_tmp23_);
		_g_free0 (_tmp21_);
		_g_free0 (proton_path);
		_g_free0 (_tmp10_);
		_g_object_unref0 (steam);
		block47_data_unref (_data47_);
		_data47_ = NULL;
		return;
	}
	_tmp24_ = _data47_->game;
	_tmp25_ = proton_plus_models_game_get_prefixdir (_tmp24_);
	_tmp26_ = _tmp25_;
	_tmp27_ = g_shell_quote (_tmp26_);
	_tmp28_ = _tmp27_;
	_tmp29_ = _data47_->game;
	_tmp30_ = proton_plus_models_game_get_launcher (_tmp29_);
	_tmp31_ = _tmp30_;
	_tmp32_ = _tmp31_->directory;
	_tmp33_ = g_shell_quote (_tmp32_);
	_tmp34_ = _tmp33_;
	_tmp35_ = proton_path;
	_tmp36_ = g_shell_quote ((const gchar*) _tmp35_);
	_tmp37_ = _tmp36_;
	_tmp38_ = g_shell_quote (exe_path);
	_tmp39_ = _tmp38_;
	_tmp40_ = g_strdup_printf ("STEAM_COMPAT_DATA_PATH=%s STEAM_COMPAT_CLIENT_INSTALL_PATH=%s %s run %" \
"s", _tmp28_, _tmp34_, _tmp37_, _tmp39_);
	_tmp41_ = _tmp40_;
	_g_free0 (_tmp39_);
	_g_free0 (_tmp37_);
	_g_free0 (_tmp34_);
	_g_free0 (_tmp28_);
	inner_command = _tmp41_;
	_tmp42_ = inner_command;
	_tmp43_ = g_shell_quote (_tmp42_);
	_tmp44_ = _tmp43_;
	_tmp45_ = g_strconcat ("sh -c ", _tmp44_, NULL);
	_tmp46_ = _tmp45_;
	proton_plus_utils_system_run_command (_tmp46_, ___lambda190__gasync_ready_callback, block47_data_ref (_data47_));
	_g_free0 (_tmp46_);
	_g_free0 (_tmp44_);
	_g_free0 (inner_command);
	_g_free0 (proton_path);
	_g_free0 (_tmp10_);
	_g_object_unref0 (steam);
	block47_data_unref (_data47_);
	_data47_ = NULL;
}

static void
proton_plus_widgets_games_extra_button_present_error_dialog (GtkWindow* root,
                                                             AdwAlertDialog* dialog)
{
	GtkRoot* _tmp0_;
	g_return_if_fail (root != NULL);
	g_return_if_fail (dialog != NULL);
	_tmp0_ = gtk_widget_get_root ((GtkWidget*) root);
	if (_tmp0_ == NULL) {
		return;
	}
	proton_plus_widgets_window_present_dialog_for_controller ((AdwDialog*) dialog, (GtkWidget*) root);
}

static void
proton_plus_widgets_games_extra_button_open_install_directory (ProtonPlusWidgetsGamesExtraButton* self)
{
	ProtonPlusWidgetsGamesGameListItem* item = NULL;
	ProtonPlusWidgetsGamesGameActionTarget* _tmp0_;
	ProtonPlusWidgetsGamesGameListItem* _tmp1_;
	ProtonPlusWidgetsGamesGameListItem* _tmp2_;
	ProtonPlusWidgetsGamesGameListItem* _tmp3_;
	gboolean _tmp4_ = FALSE;
	ProtonPlusWidgetsGamesGameListItem* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->target;
	_tmp1_ = proton_plus_widgets_games_game_action_target_get_item (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	item = _tmp3_;
	_tmp5_ = item;
	if (_tmp5_ != NULL) {
		ProtonPlusWidgetsGamesGameListItem* _tmp6_;
		gboolean _tmp7_;
		gboolean _tmp8_;
		_tmp6_ = item;
		_tmp7_ = proton_plus_widgets_games_game_list_item_get_has_install_directory (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem));
		_tmp8_ = _tmp7_;
		_tmp4_ = _tmp8_;
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		ProtonPlusWidgetsGamesGameListItem* _tmp9_;
		ProtonPlusModelsGame* _tmp10_;
		ProtonPlusModelsGame* _tmp11_;
		const gchar* _tmp12_;
		const gchar* _tmp13_;
		_tmp9_ = item;
		_tmp10_ = proton_plus_widgets_games_game_list_item_get_game (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem));
		_tmp11_ = _tmp10_;
		_tmp12_ = proton_plus_models_game_get_installdir (_tmp11_);
		_tmp13_ = _tmp12_;
		proton_plus_utils_system_open_path (_tmp13_);
	}
	_g_object_unref0 (item);
}

static void
proton_plus_widgets_games_extra_button_open_prefix_directory (ProtonPlusWidgetsGamesExtraButton* self)
{
	ProtonPlusWidgetsGamesGameListItem* item = NULL;
	ProtonPlusWidgetsGamesGameActionTarget* _tmp0_;
	ProtonPlusWidgetsGamesGameListItem* _tmp1_;
	ProtonPlusWidgetsGamesGameListItem* _tmp2_;
	ProtonPlusWidgetsGamesGameListItem* _tmp3_;
	gboolean _tmp4_ = FALSE;
	ProtonPlusWidgetsGamesGameListItem* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->target;
	_tmp1_ = proton_plus_widgets_games_game_action_target_get_item (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	item = _tmp3_;
	_tmp5_ = item;
	if (_tmp5_ != NULL) {
		ProtonPlusWidgetsGamesGameListItem* _tmp6_;
		gboolean _tmp7_;
		gboolean _tmp8_;
		_tmp6_ = item;
		_tmp7_ = proton_plus_widgets_games_game_list_item_get_has_prefix_directory (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem));
		_tmp8_ = _tmp7_;
		_tmp4_ = _tmp8_;
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		ProtonPlusWidgetsGamesGameListItem* _tmp9_;
		ProtonPlusModelsGame* _tmp10_;
		ProtonPlusModelsGame* _tmp11_;
		const gchar* _tmp12_;
		const gchar* _tmp13_;
		_tmp9_ = item;
		_tmp10_ = proton_plus_widgets_games_game_list_item_get_game (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem));
		_tmp11_ = _tmp10_;
		_tmp12_ = proton_plus_models_game_get_prefixdir (_tmp11_);
		_tmp13_ = _tmp12_;
		proton_plus_utils_system_open_path (_tmp13_);
	}
	_g_object_unref0 (item);
}

static void
proton_plus_widgets_games_extra_button_open_protontricks (ProtonPlusWidgetsGamesExtraButton* self)
{
	ProtonPlusWidgetsGamesGameListItem* _tmp0_ = NULL;
	ProtonPlusWidgetsGamesGameActionTarget* _tmp1_;
	ProtonPlusWidgetsGamesGameListItem* _tmp2_;
	ProtonPlusWidgetsGamesGameListItem* _tmp3_;
	ProtonPlusModelsGame* _tmp4_ = NULL;
	ProtonPlusModelsGamesSteam* steam_game = NULL;
	ProtonPlusModelsGamesSteam* _tmp7_;
	gboolean _tmp8_ = FALSE;
	ProtonPlusModelsGamesSteam* _tmp9_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->target;
	_tmp2_ = proton_plus_widgets_games_game_action_target_get_item (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp0_ = _tmp3_;
	_tmp4_ = NULL;
	if (_tmp0_ != NULL) {
		ProtonPlusModelsGame* _tmp5_;
		ProtonPlusModelsGame* _tmp6_;
		_tmp5_ = proton_plus_widgets_games_game_list_item_get_game (_tmp0_);
		_tmp6_ = _tmp5_;
		_tmp4_ = _tmp6_;
	}
	_tmp7_ = _g_object_ref0 (PROTON_PLUS_MODELS_GAMES_IS_STEAM (_tmp4_) ? ((ProtonPlusModelsGamesSteam*) _tmp4_) : NULL);
	steam_game = _tmp7_;
	_tmp9_ = steam_game;
	if (_tmp9_ == NULL) {
		_tmp8_ = TRUE;
	} else {
		ProtonPlusModelsGamesSteam* _tmp10_;
		gboolean _tmp11_;
		gboolean _tmp12_;
		_tmp10_ = steam_game;
		_tmp11_ = proton_plus_models_games_steam_get_is_non_steam (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, PROTON_PLUS_MODELS_GAMES_TYPE_STEAM, ProtonPlusModelsGamesSteam));
		_tmp12_ = _tmp11_;
		_tmp8_ = _tmp12_;
	}
	if (_tmp8_) {
		_g_object_unref0 (steam_game);
		return;
	}
	if (proton_plus_globals_PROTONTRICKS_INSTALLED) {
		ProtonPlusModelsGamesSteam* _tmp13_;
		guint _tmp14_;
		guint _tmp15_;
		gchar* _tmp16_;
		gchar* _tmp17_;
		_tmp13_ = steam_game;
		_tmp14_ = proton_plus_models_games_steam_get_appid (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, PROTON_PLUS_MODELS_GAMES_TYPE_STEAM, ProtonPlusModelsGamesSteam));
		_tmp15_ = _tmp14_;
		_tmp16_ = g_strdup_printf ("protontricks %u --gui", _tmp15_);
		_tmp17_ = _tmp16_;
		proton_plus_utils_system_run_command (_tmp17_, NULL, NULL);
		_g_free0 (_tmp17_);
	} else {
		if (proton_plus_globals_PROTONTRICKS_FLATPAK_INSTALLED) {
			ProtonPlusModelsGamesSteam* _tmp18_;
			guint _tmp19_;
			guint _tmp20_;
			gchar* _tmp21_;
			gchar* _tmp22_;
			_tmp18_ = steam_game;
			_tmp19_ = proton_plus_models_games_steam_get_appid (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, PROTON_PLUS_MODELS_GAMES_TYPE_STEAM, ProtonPlusModelsGamesSteam));
			_tmp20_ = _tmp19_;
			_tmp21_ = g_strdup_printf ("flatpak run com.github.Matoking.protontricks %u --gui", _tmp20_);
			_tmp22_ = _tmp21_;
			proton_plus_utils_system_run_command (_tmp22_, NULL, NULL);
			_g_free0 (_tmp22_);
		}
	}
	_g_object_unref0 (steam_game);
}

static void
proton_plus_widgets_games_extra_button_open_protondb (ProtonPlusWidgetsGamesExtraButton* self)
{
	ProtonPlusWidgetsGamesGameListItem* _tmp0_ = NULL;
	ProtonPlusWidgetsGamesGameActionTarget* _tmp1_;
	ProtonPlusWidgetsGamesGameListItem* _tmp2_;
	ProtonPlusWidgetsGamesGameListItem* _tmp3_;
	ProtonPlusModelsGame* _tmp4_ = NULL;
	ProtonPlusModelsGamesSteam* steam_game = NULL;
	ProtonPlusModelsGamesSteam* _tmp7_;
	gboolean _tmp8_ = FALSE;
	ProtonPlusModelsGamesSteam* _tmp9_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->target;
	_tmp2_ = proton_plus_widgets_games_game_action_target_get_item (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp0_ = _tmp3_;
	_tmp4_ = NULL;
	if (_tmp0_ != NULL) {
		ProtonPlusModelsGame* _tmp5_;
		ProtonPlusModelsGame* _tmp6_;
		_tmp5_ = proton_plus_widgets_games_game_list_item_get_game (_tmp0_);
		_tmp6_ = _tmp5_;
		_tmp4_ = _tmp6_;
	}
	_tmp7_ = _g_object_ref0 (PROTON_PLUS_MODELS_GAMES_IS_STEAM (_tmp4_) ? ((ProtonPlusModelsGamesSteam*) _tmp4_) : NULL);
	steam_game = _tmp7_;
	_tmp9_ = steam_game;
	if (_tmp9_ != NULL) {
		ProtonPlusModelsGamesSteam* _tmp10_;
		gboolean _tmp11_;
		gboolean _tmp12_;
		_tmp10_ = steam_game;
		_tmp11_ = proton_plus_models_games_steam_get_is_non_steam (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, PROTON_PLUS_MODELS_GAMES_TYPE_STEAM, ProtonPlusModelsGamesSteam));
		_tmp12_ = _tmp11_;
		_tmp8_ = !_tmp12_;
	} else {
		_tmp8_ = FALSE;
	}
	if (_tmp8_) {
		ProtonPlusModelsGamesSteam* _tmp13_;
		guint _tmp14_;
		guint _tmp15_;
		gchar* _tmp16_;
		gchar* _tmp17_;
		_tmp13_ = steam_game;
		_tmp14_ = proton_plus_models_games_steam_get_appid (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, PROTON_PLUS_MODELS_GAMES_TYPE_STEAM, ProtonPlusModelsGamesSteam));
		_tmp15_ = _tmp14_;
		_tmp16_ = g_strdup_printf ("https://www.protondb.com/app/%u", _tmp15_);
		_tmp17_ = _tmp16_;
		proton_plus_utils_system_open_uri (_tmp17_);
		_g_free0 (_tmp17_);
	}
	_g_object_unref0 (steam_game);
}

static void
proton_plus_widgets_games_extra_button_open_anticheat (ProtonPlusWidgetsGamesExtraButton* self)
{
	ProtonPlusWidgetsGamesGameListItem* _tmp0_ = NULL;
	ProtonPlusWidgetsGamesGameActionTarget* _tmp1_;
	ProtonPlusWidgetsGamesGameListItem* _tmp2_;
	ProtonPlusWidgetsGamesGameListItem* _tmp3_;
	ProtonPlusModelsGame* _tmp4_ = NULL;
	ProtonPlusModelsGamesSteam* steam_game = NULL;
	ProtonPlusModelsGamesSteam* _tmp7_;
	gboolean _tmp8_ = FALSE;
	ProtonPlusModelsGamesSteam* _tmp9_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->target;
	_tmp2_ = proton_plus_widgets_games_game_action_target_get_item (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp0_ = _tmp3_;
	_tmp4_ = NULL;
	if (_tmp0_ != NULL) {
		ProtonPlusModelsGame* _tmp5_;
		ProtonPlusModelsGame* _tmp6_;
		_tmp5_ = proton_plus_widgets_games_game_list_item_get_game (_tmp0_);
		_tmp6_ = _tmp5_;
		_tmp4_ = _tmp6_;
	}
	_tmp7_ = _g_object_ref0 (PROTON_PLUS_MODELS_GAMES_IS_STEAM (_tmp4_) ? ((ProtonPlusModelsGamesSteam*) _tmp4_) : NULL);
	steam_game = _tmp7_;
	_tmp9_ = steam_game;
	if (_tmp9_ != NULL) {
		ProtonPlusModelsGamesSteam* _tmp10_;
		const gchar* _tmp11_;
		const gchar* _tmp12_;
		_tmp10_ = steam_game;
		_tmp11_ = proton_plus_models_games_steam_get_awacy_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, PROTON_PLUS_MODELS_GAMES_TYPE_STEAM, ProtonPlusModelsGamesSteam));
		_tmp12_ = _tmp11_;
		_tmp8_ = _tmp12_ != NULL;
	} else {
		_tmp8_ = FALSE;
	}
	if (_tmp8_) {
		ProtonPlusModelsGamesSteam* _tmp13_;
		const gchar* _tmp14_;
		const gchar* _tmp15_;
		gchar* _tmp16_;
		gchar* _tmp17_;
		_tmp13_ = steam_game;
		_tmp14_ = proton_plus_models_games_steam_get_awacy_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, PROTON_PLUS_MODELS_GAMES_TYPE_STEAM, ProtonPlusModelsGamesSteam));
		_tmp15_ = _tmp14_;
		_tmp16_ = g_strdup_printf ("https://areweanticheatyet.com/game/%s", _tmp15_);
		_tmp17_ = _tmp16_;
		proton_plus_utils_system_open_uri (_tmp17_);
		_g_free0 (_tmp17_);
	}
	_g_object_unref0 (steam_game);
}

static void
proton_plus_widgets_games_extra_button_open_anticheat_from_popover (ProtonPlusWidgetsGamesExtraButton* self)
{
	GtkPopoverMenu* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->actions_popover;
	gtk_popover_popdown ((GtkPopover*) _tmp0_);
	proton_plus_widgets_games_extra_button_open_anticheat (self);
}

static void
proton_plus_widgets_games_extra_button_disconnect_anticheat (ProtonPlusWidgetsGamesExtraButton* self)
{
	ProtonPlusWidgetsGamesGameListItem* _tmp0_ = NULL;
	ProtonPlusWidgetsGamesGameActionTarget* _tmp1_;
	ProtonPlusWidgetsGamesGameListItem* _tmp2_;
	ProtonPlusWidgetsGamesGameListItem* _tmp3_;
	ProtonPlusModelsGame* _tmp4_ = NULL;
	ProtonPlusModelsGame* game = NULL;
	ProtonPlusModelsGame* _tmp7_;
	gboolean _tmp8_ = FALSE;
	gboolean _tmp11_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->target;
	_tmp2_ = proton_plus_widgets_games_game_action_target_get_item (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp0_ = _tmp3_;
	_tmp4_ = NULL;
	if (_tmp0_ != NULL) {
		ProtonPlusModelsGame* _tmp5_;
		ProtonPlusModelsGame* _tmp6_;
		_tmp5_ = proton_plus_widgets_games_game_list_item_get_game (_tmp0_);
		_tmp6_ = _tmp5_;
		_tmp4_ = _tmp6_;
	}
	_tmp7_ = _g_object_ref0 (_tmp4_);
	game = _tmp7_;
	if (self->priv->awacy_status_handler != ((gulong) 0)) {
		ProtonPlusModelsGame* _tmp9_;
		_tmp9_ = game;
		_tmp8_ = _tmp9_ != NULL;
	} else {
		_tmp8_ = FALSE;
	}
	if (_tmp8_) {
		ProtonPlusModelsGame* _tmp10_;
		_tmp10_ = game;
		g_signal_handler_disconnect ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, PROTON_PLUS_MODELS_TYPE_GAME, ProtonPlusModelsGame), self->priv->awacy_status_handler);
		self->priv->awacy_status_handler = (gulong) 0;
	}
	if (self->priv->awacy_lookup_complete_handler != ((gulong) 0)) {
		ProtonPlusModelsGame* _tmp12_;
		_tmp12_ = game;
		_tmp11_ = _tmp12_ != NULL;
	} else {
		_tmp11_ = FALSE;
	}
	if (_tmp11_) {
		ProtonPlusModelsGame* _tmp13_;
		_tmp13_ = game;
		g_signal_handler_disconnect ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, PROTON_PLUS_MODELS_TYPE_GAME, ProtonPlusModelsGame), self->priv->awacy_lookup_complete_handler);
		self->priv->awacy_lookup_complete_handler = (gulong) 0;
	}
	_g_object_unref0 (game);
}

static void
proton_plus_widgets_games_extra_button_real_dispose (GObject* base)
{
	ProtonPlusWidgetsGamesExtraButton * self;
	self = (ProtonPlusWidgetsGamesExtraButton*) base;
	proton_plus_widgets_games_extra_button_unbind (self);
	G_OBJECT_CLASS (proton_plus_widgets_games_extra_button_parent_class)->dispose (G_TYPE_CHECK_INSTANCE_CAST (self, G_TYPE_OBJECT, GObject));
}

GtkMenuButton*
proton_plus_widgets_games_extra_button_get_button (ProtonPlusWidgetsGamesExtraButton* self)
{
	GtkMenuButton* result;
	GtkMenuButton* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_button;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_extra_button_set_button (ProtonPlusWidgetsGamesExtraButton* self,
                                                   GtkMenuButton* value)
{
	GtkMenuButton* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_games_extra_button_get_button (self);
	if (old_value != value) {
		GtkMenuButton* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_button);
		self->priv->_button = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_games_extra_button_properties[PROTON_PLUS_WIDGETS_GAMES_EXTRA_BUTTON_BUTTON_PROPERTY]);
	}
}

static void
proton_plus_widgets_games_extra_button_class_init (ProtonPlusWidgetsGamesExtraButtonClass * klass,
                                                   gpointer klass_data)
{
	proton_plus_widgets_games_extra_button_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsGamesExtraButton_private_offset);
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) proton_plus_widgets_games_extra_button_real_dispose;
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_widgets_games_extra_button_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_widgets_games_extra_button_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_games_extra_button_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_GAMES_EXTRA_BUTTON_BUTTON_PROPERTY, proton_plus_widgets_games_extra_button_properties[PROTON_PLUS_WIDGETS_GAMES_EXTRA_BUTTON_BUTTON_PROPERTY] = g_param_spec_object ("button", "button", "button", gtk_menu_button_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
proton_plus_widgets_games_extra_button_instance_init (ProtonPlusWidgetsGamesExtraButton * self,
                                                      gpointer klass)
{
	self->priv = proton_plus_widgets_games_extra_button_get_instance_private (self);
	self->priv->awacy_status_handler = (gulong) 0;
	self->priv->awacy_lookup_complete_handler = (gulong) 0;
	self->priv->bound = FALSE;
}

static void
proton_plus_widgets_games_extra_button_finalize (GObject * obj)
{
	ProtonPlusWidgetsGamesExtraButton * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_GAMES_TYPE_EXTRA_BUTTON, ProtonPlusWidgetsGamesExtraButton);
	_g_object_unref0 (self->priv->_button);
	_g_object_unref0 (self->priv->target);
	_g_object_unref0 (self->priv->availability);
	_g_object_unref0 (self->priv->actions_popover);
	_g_object_unref0 (self->priv->anticheat_button);
	_g_object_unref0 (self->priv->anticheat_button_label);
	_g_object_unref0 (self->priv->custom_executable_action);
	_g_object_unref0 (self->priv->open_install_directory_action);
	_g_object_unref0 (self->priv->open_prefix_directory_action);
	_g_object_unref0 (self->priv->open_protontricks_action);
	_g_object_unref0 (self->priv->open_protondb_action);
	_g_object_unref0 (self->priv->open_anticheat_action);
	G_OBJECT_CLASS (proton_plus_widgets_games_extra_button_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_games_extra_button_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsGamesExtraButtonClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_games_extra_button_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsGamesExtraButton), 0, (GInstanceInitFunc) proton_plus_widgets_games_extra_button_instance_init, NULL };
	GType proton_plus_widgets_games_extra_button_type_id;
	proton_plus_widgets_games_extra_button_type_id = g_type_register_static (G_TYPE_OBJECT, "ProtonPlusWidgetsGamesExtraButton", &g_define_type_info, 0);
	ProtonPlusWidgetsGamesExtraButton_private_offset = g_type_add_instance_private (proton_plus_widgets_games_extra_button_type_id, sizeof (ProtonPlusWidgetsGamesExtraButtonPrivate));
	return proton_plus_widgets_games_extra_button_type_id;
}

GType
proton_plus_widgets_games_extra_button_get_type (void)
{
	static volatile gsize proton_plus_widgets_games_extra_button_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_games_extra_button_type_id__once)) {
		GType proton_plus_widgets_games_extra_button_type_id;
		proton_plus_widgets_games_extra_button_type_id = proton_plus_widgets_games_extra_button_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_games_extra_button_type_id__once, proton_plus_widgets_games_extra_button_type_id);
	}
	return proton_plus_widgets_games_extra_button_type_id__once;
}

static void
_vala_proton_plus_widgets_games_extra_button_get_property (GObject * object,
                                                           guint property_id,
                                                           GValue * value,
                                                           GParamSpec * pspec)
{
	ProtonPlusWidgetsGamesExtraButton * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_GAMES_TYPE_EXTRA_BUTTON, ProtonPlusWidgetsGamesExtraButton);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_GAMES_EXTRA_BUTTON_BUTTON_PROPERTY:
		g_value_set_object (value, proton_plus_widgets_games_extra_button_get_button (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_widgets_games_extra_button_set_property (GObject * object,
                                                           guint property_id,
                                                           const GValue * value,
                                                           GParamSpec * pspec)
{
	ProtonPlusWidgetsGamesExtraButton * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_GAMES_TYPE_EXTRA_BUTTON, ProtonPlusWidgetsGamesExtraButton);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_GAMES_EXTRA_BUTTON_BUTTON_PROPERTY:
		proton_plus_widgets_games_extra_button_set_button (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

