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

#include "protonplus_core.h"
#include <adwaita.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gio/gio.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <glib/gi18n-lib.h>
#include <float.h>
#include <math.h>
#include <gee.h>
#include <libnotify/notify.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_MAIN_BOX_0_PROPERTY,
	PROTON_PLUS_WIDGETS_MAIN_BOX_VIEW_STACK_PROPERTY,
	PROTON_PLUS_WIDGETS_MAIN_BOX_VIEW_SWITCHER_PROPERTY,
	PROTON_PLUS_WIDGETS_MAIN_BOX_VIEW_SWITCHER_BAR_PROPERTY,
	PROTON_PLUS_WIDGETS_MAIN_BOX_NARROW_NAVIGATION_PROPERTY,
	PROTON_PLUS_WIDGETS_MAIN_BOX_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_main_box_properties[PROTON_PLUS_WIDGETS_MAIN_BOX_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block11Data Block11Data;
typedef struct _Block12Data Block12Data;
typedef struct _Block13Data Block13Data;
typedef struct _Block14Data Block14Data;
typedef struct _Block15Data Block15Data;
typedef struct _ProtonPlusWidgetsMainBoxCheckForUpdatesData ProtonPlusWidgetsMainBoxCheckForUpdatesData;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
enum  {
	PROTON_PLUS_WIDGETS_MAIN_BOX_HEADER_PRESENTATION_CHANGED_SIGNAL,
	PROTON_PLUS_WIDGETS_MAIN_BOX_SEARCH_AVAILABILITY_CHANGED_SIGNAL,
	PROTON_PLUS_WIDGETS_MAIN_BOX_NUM_SIGNALS
};
static guint proton_plus_widgets_main_box_signals[PROTON_PLUS_WIDGETS_MAIN_BOX_NUM_SIGNALS] = {0};

struct _ProtonPlusWidgetsMainBoxPrivate {
	AdwViewStack* _view_stack;
	AdwViewSwitcher* _view_switcher;
	AdwViewSwitcherBar* _view_switcher_bar;
	AdwToastOverlay* _toast_overlay;
	gchar* _previous_view_name;
	gchar* _view_switcher_pressed_page;
	ProtonPlusWidgetsToolsBox* _tools_box;
	ProtonPlusWidgetsGamesBox* _games_box;
	ProtonPlusWidgetsMangoHudBox* _mangohud_box;
	ProtonPlusServicesSteamRestartManager* restart_manager;
	ProtonPlusServicesSteamRestartOrchestrator* restart_orchestrator;
	ProtonPlusWidgetsMainSteamRestartBanner* restart_banner;
	ProtonPlusWidgetsMainSteamRestartToastPolicy* restart_toasts;
	ProtonPlusWidgetsMainSteamRestartNotificationCoordinator* restart_notifications;
	guint previous_restart_count;
	gulong pending_changed_handler_id;
	gulong persistence_failed_handler_id;
	gulong state_changed_handler_id;
	gulong operation_completed_handler_id;
	GCancellable* restart_cancellable;
	AdwDialog* active_restart_dialog;
	gboolean persistence_toast_shown;
	gboolean load_warning_shown;
	ProtonPlusWidgetsHeaderPresentation* current_header_presentation;
	gulong tools_header_handler_id;
	gulong games_header_handler_id;
	gboolean view_switcher_bar_ready;
	gboolean _narrow_navigation;
};

struct _Block11Data {
	int _ref_count_;
	ProtonPlusWidgetsMainBox* self;
	gchar* pressed_page;
};

struct _Block12Data {
	int _ref_count_;
	ProtonPlusWidgetsMainBox* self;
	ProtonPlusServicesSteamRestartManager* manager;
	ProtonPlusServicesSteamRestartOrchestrator* orchestrator;
};

struct _Block13Data {
	int _ref_count_;
	ProtonPlusWidgetsMainBox* self;
	ProtonPlusWidgetsMainSteamRestartTargetSummary* summary;
	AdwAlertDialog* dialog;
};

struct _Block14Data {
	int _ref_count_;
	Block13Data * _data13_;
	ProtonPlusWidgetsMainSteamRestartReviewDialog* review;
};

struct _Block15Data {
	int _ref_count_;
	ProtonPlusWidgetsMainBox* self;
	AdwAlertDialog* dialog;
	ProtonPlusModelsSteamRestartTarget* target;
};

struct _ProtonPlusWidgetsMainBoxCheckForUpdatesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusWidgetsMainBox* self;
	GeeLinkedList* launchers;
	GList* list;
	GeeLinkedList* _launcher_list;
	gint _launcher_size;
	GeeLinkedList* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gint _launcher_index;
	gint _tmp3_;
	gint _tmp4_;
	ProtonPlusModelsLauncher* launcher;
	GeeLinkedList* _tmp5_;
	gpointer _tmp6_;
	ProtonPlusModelsLauncher* _tmp7_;
	ProtonPlusModelsLauncher* _tmp8_;
	ProtonPlusReturnCode code;
	ProtonPlusServicesInstallationService* _tmp9_;
	ProtonPlusServicesInstallationService* _tmp10_;
	GList* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
};

static gint ProtonPlusWidgetsMainBox_private_offset;
static gpointer proton_plus_widgets_main_box_parent_class = NULL;
static ProtonPlusUtilsControllerNavigationHostIface * proton_plus_widgets_main_box_proton_plus_utils_controller_navigation_host_parent_iface = NULL;
static ProtonPlusUtilsControllerPageShortcutsIface * proton_plus_widgets_main_box_proton_plus_utils_controller_page_shortcuts_parent_iface = NULL;

static void proton_plus_widgets_main_box_set_tools_box (ProtonPlusWidgetsMainBox* self,
                                                 ProtonPlusWidgetsToolsBox* value);
static ProtonPlusWidgetsToolsBox* proton_plus_widgets_main_box_get_tools_box (ProtonPlusWidgetsMainBox* self);
static void _proton_plus_widgets_main_box_send_toast_proton_plus_widgets_tools_box_toast_sent (ProtonPlusWidgetsToolsBox* _sender,
                                                                                        const gchar* title,
                                                                                        gpointer self);
static void __lambda349_ (ProtonPlusWidgetsMainBox* self);
static void proton_plus_widgets_main_box_update_header_presentation (ProtonPlusWidgetsMainBox* self);
static void ___lambda349__proton_plus_widgets_tools_box_header_presentation_changed (ProtonPlusWidgetsToolsBox* _sender,
                                                                              ProtonPlusWidgetsHeaderPresentation* presentation,
                                                                              gpointer self);
static void proton_plus_widgets_main_box_set_games_box (ProtonPlusWidgetsMainBox* self,
                                                 ProtonPlusWidgetsGamesBox* value);
static ProtonPlusWidgetsGamesBox* proton_plus_widgets_main_box_get_games_box (ProtonPlusWidgetsMainBox* self);
static void __lambda350_ (ProtonPlusWidgetsMainBox* self);
static void ___lambda350__proton_plus_widgets_games_box_header_presentation_changed (ProtonPlusWidgetsGamesBox* _sender,
                                                                              ProtonPlusWidgetsHeaderPresentation* presentation,
                                                                              gpointer self);
static void proton_plus_widgets_main_box_set_mangohud_box (ProtonPlusWidgetsMainBox* self,
                                                    ProtonPlusWidgetsMangoHudBox* value);
static void proton_plus_widgets_main_box_view_stack_visible_child_name_changed (ProtonPlusWidgetsMainBox* self);
static void _proton_plus_widgets_main_box_view_stack_visible_child_name_changed_g_object_notify (GObject* _sender,
                                                                                          GParamSpec* pspec,
                                                                                          gpointer self);
static ProtonPlusWidgetsMangoHudBox* proton_plus_widgets_main_box_get_mangohud_box (ProtonPlusWidgetsMainBox* self);
static void proton_plus_widgets_main_box_update_view_switcher_bar (ProtonPlusWidgetsMainBox* self);
static void proton_plus_widgets_main_box_add_view_switcher_reset_controller (ProtonPlusWidgetsMainBox* self,
                                                                      GtkWidget* switcher);
static void proton_plus_widgets_main_box_set_toast_overlay (ProtonPlusWidgetsMainBox* self,
                                                     AdwToastOverlay* value);
static AdwToastOverlay* proton_plus_widgets_main_box_get_toast_overlay (ProtonPlusWidgetsMainBox* self);
static void proton_plus_widgets_main_box_setup_steam_restart_presentation (ProtonPlusWidgetsMainBox* self,
                                                                    ProtonPlusServicesSteamRestartManager* manager,
                                                                    ProtonPlusServicesSteamRestartOrchestrator* orchestrator,
                                                                    ProtonPlusWidgetsMainSteamRestartNotificationSender* notification_sender);
static void proton_plus_widgets_main_box_on_download_added (ProtonPlusWidgetsMainBox* self,
                                                     ProtonPlusServicesInstallJob* job);
static void _proton_plus_widgets_main_box_on_download_added_proton_plus_utils_download_manager_download_added (ProtonPlusUtilsDownloadManager* _sender,
                                                                                                        ProtonPlusServicesInstallJob* job,
                                                                                                        gpointer self);
static void proton_plus_widgets_main_box_on_download_finished (ProtonPlusWidgetsMainBox* self,
                                                        ProtonPlusServicesInstallJob* job,
                                                        gboolean success);
static void _proton_plus_widgets_main_box_on_download_finished_proton_plus_utils_download_manager_download_finished (ProtonPlusUtilsDownloadManager* _sender,
                                                                                                              ProtonPlusServicesInstallJob* job,
                                                                                                              gboolean success,
                                                                                                              gpointer self);
static void proton_plus_widgets_main_box_on_tool_updated (ProtonPlusWidgetsMainBox* self,
                                                   ProtonPlusServicesInstallJob* job,
                                                   gboolean updated);
static void _proton_plus_widgets_main_box_on_tool_updated_proton_plus_utils_download_manager_tool_updated (ProtonPlusUtilsDownloadManager* _sender,
                                                                                                    ProtonPlusServicesInstallJob* job,
                                                                                                    gboolean updated,
                                                                                                    gpointer self);
static void proton_plus_widgets_main_box_on_tool_removed (ProtonPlusWidgetsMainBox* self,
                                                   ProtonPlusServicesInstallJob* job);
static void _proton_plus_widgets_main_box_on_tool_removed_proton_plus_utils_download_manager_tool_removed (ProtonPlusUtilsDownloadManager* _sender,
                                                                                                    ProtonPlusServicesInstallJob* job,
                                                                                                    gpointer self);
static void __lambda351_ (ProtonPlusWidgetsMainBox* self,
                   GtkGestureClick* gesture,
                   gint n_press,
                   gdouble x,
                   gdouble y);
static void proton_plus_widgets_main_box_set_view_switcher_pressed_page (ProtonPlusWidgetsMainBox* self,
                                                                  const gchar* value);
static void ___lambda351__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                              gint n_press,
                                              gdouble x,
                                              gdouble y,
                                              gpointer self);
static void __lambda352_ (ProtonPlusWidgetsMainBox* self,
                   GtkGestureClick* gesture,
                   gint n_press,
                   gdouble x,
                   gdouble y);
static Block11Data* block11_data_ref (Block11Data* _data11_);
static void block11_data_unref (void * _userdata_);
static const gchar* proton_plus_widgets_main_box_get_view_switcher_pressed_page (ProtonPlusWidgetsMainBox* self);
static gboolean __lambda353_ (Block11Data* _data11_);
static void proton_plus_widgets_main_box_reset_visible_page (ProtonPlusWidgetsMainBox* self);
static gboolean ___lambda353__gsource_func (gpointer self);
static void ___lambda352__gtk_gesture_click_released (GtkGestureClick* _sender,
                                               gint n_press,
                                               gdouble x,
                                               gdouble y,
                                               gpointer self);
static void _proton_plus_widgets_games_box_load_games_g_object_notify (GObject* _sender,
                                                                GParamSpec* pspec,
                                                                gpointer self);
static Block12Data* block12_data_ref (Block12Data* _data12_);
static void block12_data_unref (void * _userdata_);
static void proton_plus_widgets_main_box_show_restart_review (ProtonPlusWidgetsMainBox* self);
static void _proton_plus_widgets_main_box_show_restart_review_proton_plus_widgets_main_steam_restart_banner_restart_requested (ProtonPlusWidgetsMainSteamRestartBanner* _sender,
                                                                                                                        gpointer self);
static void proton_plus_widgets_main_box_update_restart_banner (ProtonPlusWidgetsMainBox* self);
static void __lambda361_ (Block12Data* _data12_);
static void ___lambda361__proton_plus_services_steam_restart_manager_pending_changed (ProtonPlusServicesSteamRestartManager* _sender,
                                                                               gpointer self);
static void __lambda362_ (ProtonPlusWidgetsMainBox* self,
                   const gchar* message);
static void ___lambda362__proton_plus_services_steam_restart_manager_persistence_failed (ProtonPlusServicesSteamRestartManager* _sender,
                                                                                  const gchar* message,
                                                                                  gpointer self);
static void __lambda363_ (Block12Data* _data12_,
                   ProtonPlusModelsSteamRestartOperationState state);
static void ___lambda363__proton_plus_services_steam_restart_orchestrator_state_changed (ProtonPlusServicesSteamRestartOrchestrator* _sender,
                                                                                  ProtonPlusModelsSteamRestartOperationState state,
                                                                                  gpointer self);
static void proton_plus_widgets_main_box_on_restart_completed (ProtonPlusWidgetsMainBox* self,
                                                        ProtonPlusModelsSteamRestartOperationResult* _result_);
static void _proton_plus_widgets_main_box_on_restart_completed_proton_plus_services_steam_restart_orchestrator_operation_completed (ProtonPlusServicesSteamRestartOrchestrator* _sender,
                                                                                                                             ProtonPlusModelsSteamRestartOperationResult* _result_,
                                                                                                                             gpointer self);
static gboolean ___lambda366_ (ProtonPlusWidgetsMainBox* self);
static gboolean ____lambda366__gsource_func (gpointer self);
static Block13Data* block13_data_ref (Block13Data* _data13_);
static void block13_data_unref (void * _userdata_);
static Block14Data* block14_data_ref (Block14Data* _data14_);
static void block14_data_unref (void * _userdata_);
static void ___lambda356_ (ProtonPlusWidgetsMainBox* self,
                    ProtonPlusModelsSteamRestartTarget* target);
static void proton_plus_widgets_main_box_start_steam_restart (ProtonPlusWidgetsMainBox* self,
                                                       ProtonPlusModelsSteamRestartTarget* target);
static void ____lambda356__proton_plus_widgets_main_steam_restart_review_dialog_restart_requested (ProtonPlusWidgetsMainSteamRestartReviewDialog* _sender,
                                                                                            ProtonPlusModelsSteamRestartTarget* target,
                                                                                            gpointer self);
static void ___lambda358_ (Block14Data* _data14_);
static void ____lambda358__adw_dialog_closed (AdwDialog* _sender,
                                       gpointer self);
static void __lambda359_ (Block13Data* _data13_,
                   const gchar* response);
static void ___lambda359__adw_alert_dialog_response (AdwAlertDialog* _sender,
                                              const gchar* response,
                                              gpointer self);
static void __lambda360_ (Block13Data* _data13_);
static void ___lambda360__adw_dialog_closed (AdwDialog* _sender,
                                      gpointer self);
static void __lambda357_ (ProtonPlusWidgetsMainBox* self,
                   GObject* obj,
                   GAsyncResult* response);
static void ___lambda357__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
static void proton_plus_widgets_main_box_show_restart_message (ProtonPlusWidgetsMainBox* self,
                                                        ProtonPlusWidgetsMainSteamRestartMessage* message,
                                                        ProtonPlusModelsSteamRestartTarget* target);
static Block15Data* block15_data_ref (Block15Data* _data15_);
static void block15_data_unref (void * _userdata_);
static void ___lambda364_ (Block15Data* _data15_,
                    const gchar* response);
static void ____lambda364__adw_alert_dialog_response (AdwAlertDialog* _sender,
                                               const gchar* response,
                                               gpointer self);
static void __lambda365_ (Block15Data* _data15_);
static void ___lambda365__adw_dialog_closed (AdwDialog* _sender,
                                      gpointer self);
static void proton_plus_widgets_main_box_real_dispose (GObject* base);
static void proton_plus_widgets_main_box_check_for_updates_data_free (gpointer _data);
static gboolean proton_plus_widgets_main_box_check_for_updates_co (ProtonPlusWidgetsMainBoxCheckForUpdatesData* _data_);
static void proton_plus_widgets_main_box_check_for_updates_ready (GObject* source_object,
                                                           GAsyncResult* _res_,
                                                           gpointer _user_data_);
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
static void proton_plus_widgets_main_box_send_notification (ProtonPlusWidgetsMainBox* self,
                                                     const gchar* title,
                                                     const gchar* body,
                                                     const gchar* icon);
static void proton_plus_widgets_main_box_send_background_notification (ProtonPlusWidgetsMainBox* self,
                                                                const gchar* title,
                                                                const gchar* body,
                                                                const gchar* icon);
static const gchar* proton_plus_widgets_main_box_get_previous_view_name (ProtonPlusWidgetsMainBox* self);
static void proton_plus_widgets_main_box_set_previous_view_name (ProtonPlusWidgetsMainBox* self,
                                                          const gchar* value);
static ProtonPlusUtilsControllerNavigationHost* proton_plus_widgets_main_box_get_visible_controller_host (ProtonPlusWidgetsMainBox* self);
static gchar* proton_plus_widgets_main_box_real_get_controller_page_id (ProtonPlusUtilsControllerNavigationHost* base);
static GObject* proton_plus_widgets_main_box_real_get_controller_page_root (ProtonPlusUtilsControllerNavigationHost* base);
static GObject* proton_plus_widgets_main_box_real_get_controller_initial_focus (ProtonPlusUtilsControllerNavigationHost* base);
static gboolean proton_plus_widgets_main_box_real_controller_navigate_back (ProtonPlusUtilsControllerNavigationHost* base);
static gboolean proton_plus_widgets_main_box_real_controller_can_navigate_back (ProtonPlusUtilsControllerNavigationHost* base);
static gboolean proton_plus_widgets_main_box_real_controller_can_switch_page (ProtonPlusUtilsControllerNavigationHost* base);
static gboolean proton_plus_widgets_main_box_real_controller_prefers_initial_focus_after_switch (ProtonPlusUtilsControllerNavigationHost* base);
static gboolean proton_plus_widgets_main_box_real_controller_switch_page (ProtonPlusUtilsControllerNavigationHost* base,
                                                                   gint delta);
static ProtonPlusUtilsControllerPageShortcuts* proton_plus_widgets_main_box_get_visible_controller_shortcuts (ProtonPlusWidgetsMainBox* self);
static gboolean proton_plus_widgets_main_box_real_controller_can_open_search (ProtonPlusUtilsControllerPageShortcuts* base);
static gboolean proton_plus_widgets_main_box_real_controller_can_open_filter (ProtonPlusUtilsControllerPageShortcuts* base);
static gboolean proton_plus_widgets_main_box_real_controller_open_search (ProtonPlusUtilsControllerPageShortcuts* base);
static gboolean proton_plus_widgets_main_box_real_controller_open_filter (ProtonPlusUtilsControllerPageShortcuts* base);
static void proton_plus_widgets_main_box_finalize (GObject * obj);
static GType proton_plus_widgets_main_box_get_type_once (void);
static void _vala_proton_plus_widgets_main_box_get_property (GObject * object,
                                                      guint property_id,
                                                      GValue * value,
                                                      GParamSpec * pspec);
static void _vala_proton_plus_widgets_main_box_set_property (GObject * object,
                                                      guint property_id,
                                                      const GValue * value,
                                                      GParamSpec * pspec);

static inline gpointer
proton_plus_widgets_main_box_get_instance_private (ProtonPlusWidgetsMainBox* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsMainBox_private_offset);
}

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

static void
_proton_plus_widgets_main_box_send_toast_proton_plus_widgets_tools_box_toast_sent (ProtonPlusWidgetsToolsBox* _sender,
                                                                                   const gchar* title,
                                                                                   gpointer self)
{
	proton_plus_widgets_main_box_send_toast ((ProtonPlusWidgetsMainBox*) self, title);
}

static void
__lambda349_ (ProtonPlusWidgetsMainBox* self)
{
	proton_plus_widgets_main_box_update_header_presentation (self);
	g_signal_emit (self, proton_plus_widgets_main_box_signals[PROTON_PLUS_WIDGETS_MAIN_BOX_SEARCH_AVAILABILITY_CHANGED_SIGNAL], 0, proton_plus_widgets_main_box_search_available (self));
}

static void
___lambda349__proton_plus_widgets_tools_box_header_presentation_changed (ProtonPlusWidgetsToolsBox* _sender,
                                                                         ProtonPlusWidgetsHeaderPresentation* presentation,
                                                                         gpointer self)
{
	__lambda349_ ((ProtonPlusWidgetsMainBox*) self);
}

static void
__lambda350_ (ProtonPlusWidgetsMainBox* self)
{
	proton_plus_widgets_main_box_update_header_presentation (self);
	g_signal_emit (self, proton_plus_widgets_main_box_signals[PROTON_PLUS_WIDGETS_MAIN_BOX_SEARCH_AVAILABILITY_CHANGED_SIGNAL], 0, proton_plus_widgets_main_box_search_available (self));
}

static void
___lambda350__proton_plus_widgets_games_box_header_presentation_changed (ProtonPlusWidgetsGamesBox* _sender,
                                                                         ProtonPlusWidgetsHeaderPresentation* presentation,
                                                                         gpointer self)
{
	__lambda350_ ((ProtonPlusWidgetsMainBox*) self);
}

static void
_proton_plus_widgets_main_box_view_stack_visible_child_name_changed_g_object_notify (GObject* _sender,
                                                                                     GParamSpec* pspec,
                                                                                     gpointer self)
{
	proton_plus_widgets_main_box_view_stack_visible_child_name_changed ((ProtonPlusWidgetsMainBox*) self);
}

static void
_proton_plus_widgets_main_box_on_download_added_proton_plus_utils_download_manager_download_added (ProtonPlusUtilsDownloadManager* _sender,
                                                                                                   ProtonPlusServicesInstallJob* job,
                                                                                                   gpointer self)
{
	proton_plus_widgets_main_box_on_download_added ((ProtonPlusWidgetsMainBox*) self, job);
}

static void
_proton_plus_widgets_main_box_on_download_finished_proton_plus_utils_download_manager_download_finished (ProtonPlusUtilsDownloadManager* _sender,
                                                                                                         ProtonPlusServicesInstallJob* job,
                                                                                                         gboolean success,
                                                                                                         gpointer self)
{
	proton_plus_widgets_main_box_on_download_finished ((ProtonPlusWidgetsMainBox*) self, job, success);
}

static void
_proton_plus_widgets_main_box_on_tool_updated_proton_plus_utils_download_manager_tool_updated (ProtonPlusUtilsDownloadManager* _sender,
                                                                                               ProtonPlusServicesInstallJob* job,
                                                                                               gboolean updated,
                                                                                               gpointer self)
{
	proton_plus_widgets_main_box_on_tool_updated ((ProtonPlusWidgetsMainBox*) self, job, updated);
}

static void
_proton_plus_widgets_main_box_on_tool_removed_proton_plus_utils_download_manager_tool_removed (ProtonPlusUtilsDownloadManager* _sender,
                                                                                               ProtonPlusServicesInstallJob* job,
                                                                                               gpointer self)
{
	proton_plus_widgets_main_box_on_tool_removed ((ProtonPlusWidgetsMainBox*) self, job);
}

ProtonPlusWidgetsMainBox*
proton_plus_widgets_main_box_construct (GType object_type,
                                        ProtonPlusServicesSteamRestartManager* restart_manager,
                                        ProtonPlusServicesSteamRestartOrchestrator* restart_orchestrator,
                                        ProtonPlusWidgetsMainSteamRestartNotificationSender* restart_notification_sender)
{
	ProtonPlusWidgetsMainBox * self = NULL;
	ProtonPlusServicesSteamRestartManager* _tmp0_;
	ProtonPlusServicesSteamRestartOrchestrator* _tmp1_;
	ProtonPlusWidgetsToolsBox* _tmp2_;
	ProtonPlusWidgetsToolsBox* _tmp3_;
	ProtonPlusWidgetsToolsBox* _tmp4_;
	ProtonPlusWidgetsToolsBox* _tmp5_;
	gulong _tmp6_;
	ProtonPlusWidgetsGamesBox* _tmp7_;
	ProtonPlusWidgetsGamesBox* _tmp8_;
	ProtonPlusWidgetsGamesBox* _tmp9_;
	gulong _tmp10_;
	ProtonPlusWidgetsMangoHudBox* _tmp11_;
	ProtonPlusWidgetsMangoHudBox* _tmp12_;
	AdwViewStack* _tmp13_;
	AdwViewStack* _tmp14_;
	AdwViewStack* _tmp15_;
	AdwViewStack* _tmp16_;
	ProtonPlusWidgetsToolsBox* _tmp17_;
	AdwViewStack* _tmp18_;
	ProtonPlusWidgetsGamesBox* _tmp19_;
	AdwViewStackPage* mangohud_page = NULL;
	AdwViewStack* _tmp20_;
	ProtonPlusWidgetsMangoHudBox* _tmp21_;
	AdwViewStackPage* _tmp22_;
	AdwViewStackPage* _tmp23_;
	gboolean _tmp24_ = FALSE;
	AdwViewSwitcher* _tmp28_;
	AdwViewSwitcher* _tmp29_;
	AdwViewSwitcher* _tmp30_;
	AdwViewStack* _tmp31_;
	AdwViewSwitcher* _tmp32_;
	AdwViewSwitcherBar* _tmp33_;
	AdwViewSwitcherBar* _tmp34_;
	AdwViewSwitcherBar* _tmp35_;
	AdwViewStack* _tmp36_;
	AdwViewSwitcherBar* _tmp37_;
	AdwViewSwitcher* _tmp38_;
	AdwViewSwitcherBar* _tmp39_;
	AdwToastOverlay* _tmp40_;
	AdwToastOverlay* _tmp41_;
	AdwToastOverlay* _tmp42_;
	AdwViewStack* _tmp43_;
	gboolean _tmp44_ = FALSE;
	AdwToastOverlay* _tmp48_;
	ProtonPlusUtilsDownloadManager* _tmp49_;
	ProtonPlusUtilsDownloadManager* _tmp50_;
	ProtonPlusUtilsDownloadManager* _tmp51_;
	ProtonPlusUtilsDownloadManager* _tmp52_;
	ProtonPlusUtilsDownloadManager* _tmp53_;
	ProtonPlusUtilsDownloadManager* _tmp54_;
	ProtonPlusUtilsDownloadManager* _tmp55_;
	ProtonPlusUtilsDownloadManager* _tmp56_;
	self = (ProtonPlusWidgetsMainBox*) g_object_new (object_type, "orientation", GTK_ORIENTATION_VERTICAL, "spacing", 0, NULL);
	_tmp0_ = _g_object_ref0 (restart_manager);
	_g_object_unref0 (self->priv->restart_manager);
	self->priv->restart_manager = _tmp0_;
	_tmp1_ = _g_object_ref0 (restart_orchestrator);
	_g_object_unref0 (self->priv->restart_orchestrator);
	self->priv->restart_orchestrator = _tmp1_;
	_tmp2_ = proton_plus_widgets_tools_box_new ();
	g_object_ref_sink (_tmp2_);
	_tmp3_ = _tmp2_;
	proton_plus_widgets_main_box_set_tools_box (self, _tmp3_);
	_g_object_unref0 (_tmp3_);
	_tmp4_ = self->priv->_tools_box;
	g_signal_connect_object (_tmp4_, "toast-sent", (GCallback) _proton_plus_widgets_main_box_send_toast_proton_plus_widgets_tools_box_toast_sent, self, 0);
	_tmp5_ = self->priv->_tools_box;
	_tmp6_ = g_signal_connect_object (_tmp5_, "header-presentation-changed", (GCallback) ___lambda349__proton_plus_widgets_tools_box_header_presentation_changed, self, 0);
	self->priv->tools_header_handler_id = _tmp6_;
	_tmp7_ = proton_plus_widgets_games_box_new ();
	g_object_ref_sink (_tmp7_);
	_tmp8_ = _tmp7_;
	proton_plus_widgets_main_box_set_games_box (self, _tmp8_);
	_g_object_unref0 (_tmp8_);
	_tmp9_ = self->priv->_games_box;
	_tmp10_ = g_signal_connect_object (_tmp9_, "header-presentation-changed", (GCallback) ___lambda350__proton_plus_widgets_games_box_header_presentation_changed, self, 0);
	self->priv->games_header_handler_id = _tmp10_;
	_tmp11_ = proton_plus_widgets_mango_hud_box_new ();
	g_object_ref_sink (_tmp11_);
	_tmp12_ = _tmp11_;
	proton_plus_widgets_main_box_set_mangohud_box (self, _tmp12_);
	_g_object_unref0 (_tmp12_);
	_tmp13_ = (AdwViewStack*) adw_view_stack_new ();
	g_object_ref_sink (_tmp13_);
	_tmp14_ = _tmp13_;
	proton_plus_widgets_main_box_set_view_stack (self, _tmp14_);
	_g_object_unref0 (_tmp14_);
	_tmp15_ = self->priv->_view_stack;
	g_signal_connect_object ((GObject*) _tmp15_, "notify::visible-child-name", (GCallback) _proton_plus_widgets_main_box_view_stack_visible_child_name_changed_g_object_notify, self, 0);
	_tmp16_ = self->priv->_view_stack;
	_tmp17_ = self->priv->_tools_box;
	adw_view_stack_add_titled_with_icon (_tmp16_, (GtkWidget*) _tmp17_, "tools", _ ("Tools"), "toolbox-symbolic");
	_tmp18_ = self->priv->_view_stack;
	_tmp19_ = self->priv->_games_box;
	adw_view_stack_add_titled_with_icon (_tmp18_, (GtkWidget*) _tmp19_, "games", _ ("Games"), "gamepad-symbolic");
	_tmp20_ = self->priv->_view_stack;
	_tmp21_ = self->priv->_mangohud_box;
	_tmp22_ = adw_view_stack_add_titled_with_icon (_tmp20_, (GtkWidget*) _tmp21_, "mangohud", _ ("MangoHud"), "layer-group-symbolic");
	_tmp23_ = _g_object_ref0 (_tmp22_);
	mangohud_page = _tmp23_;
	if (proton_plus_globals_MANGOHUD_INSTALLED) {
		_tmp24_ = TRUE;
	} else {
		_tmp24_ = proton_plus_globals_MANGOHUD_FLATPAK_INSTALLED;
	}
	if (_tmp24_) {
		GSettings* _tmp25_;
		AdwViewStackPage* _tmp26_;
		_tmp25_ = proton_plus_globals_SETTINGS;
		_tmp26_ = mangohud_page;
		g_settings_bind (_tmp25_, "experimental-features", (GObject*) _tmp26_, "visible", G_SETTINGS_BIND_DEFAULT);
	} else {
		AdwViewStackPage* _tmp27_;
		_tmp27_ = mangohud_page;
		adw_view_stack_page_set_visible (_tmp27_, FALSE);
	}
	_tmp28_ = (AdwViewSwitcher*) adw_view_switcher_new ();
	g_object_ref_sink (_tmp28_);
	_tmp29_ = _tmp28_;
	proton_plus_widgets_main_box_set_view_switcher (self, _tmp29_);
	_g_object_unref0 (_tmp29_);
	_tmp30_ = self->priv->_view_switcher;
	_tmp31_ = self->priv->_view_stack;
	adw_view_switcher_set_stack (_tmp30_, _tmp31_);
	_tmp32_ = self->priv->_view_switcher;
	adw_view_switcher_set_policy (_tmp32_, ADW_VIEW_SWITCHER_POLICY_WIDE);
	_tmp33_ = (AdwViewSwitcherBar*) adw_view_switcher_bar_new ();
	g_object_ref_sink (_tmp33_);
	_tmp34_ = _tmp33_;
	proton_plus_widgets_main_box_set_view_switcher_bar (self, _tmp34_);
	_g_object_unref0 (_tmp34_);
	_tmp35_ = self->priv->_view_switcher_bar;
	_tmp36_ = self->priv->_view_stack;
	adw_view_switcher_bar_set_stack (_tmp35_, _tmp36_);
	_tmp37_ = self->priv->_view_switcher_bar;
	adw_view_switcher_bar_set_reveal (_tmp37_, FALSE);
	self->priv->view_switcher_bar_ready = TRUE;
	proton_plus_widgets_main_box_update_view_switcher_bar (self);
	_tmp38_ = self->priv->_view_switcher;
	proton_plus_widgets_main_box_add_view_switcher_reset_controller (self, (GtkWidget*) _tmp38_);
	_tmp39_ = self->priv->_view_switcher_bar;
	proton_plus_widgets_main_box_add_view_switcher_reset_controller (self, (GtkWidget*) _tmp39_);
	_tmp40_ = (AdwToastOverlay*) adw_toast_overlay_new ();
	g_object_ref_sink (_tmp40_);
	_tmp41_ = _tmp40_;
	proton_plus_widgets_main_box_set_toast_overlay (self, _tmp41_);
	_g_object_unref0 (_tmp41_);
	_tmp42_ = self->priv->_toast_overlay;
	_tmp43_ = self->priv->_view_stack;
	adw_toast_overlay_set_child (_tmp42_, (GtkWidget*) _tmp43_);
	if (restart_manager != NULL) {
		_tmp44_ = restart_orchestrator != NULL;
	} else {
		_tmp44_ = FALSE;
	}
	if (_tmp44_) {
		ProtonPlusWidgetsMainSteamRestartNotificationSender* _tmp45_ = NULL;
		ProtonPlusWidgetsMainSteamRestartNotificationSender* _tmp46_;
		_tmp46_ = _g_object_ref0 (restart_notification_sender);
		_tmp45_ = _tmp46_;
		if (_tmp45_ == NULL) {
			ProtonPlusWidgetsMainLibnotifySteamRestartNotificationSender* _tmp47_;
			_tmp47_ = proton_plus_widgets_main_libnotify_steam_restart_notification_sender_new ();
			_g_object_unref0 (_tmp45_);
			_tmp45_ = (ProtonPlusWidgetsMainSteamRestartNotificationSender*) _tmp47_;
		}
		proton_plus_widgets_main_box_setup_steam_restart_presentation (self, G_TYPE_CHECK_INSTANCE_CAST (restart_manager, PROTON_PLUS_SERVICES_TYPE_STEAM_RESTART_MANAGER, ProtonPlusServicesSteamRestartManager), G_TYPE_CHECK_INSTANCE_CAST (restart_orchestrator, PROTON_PLUS_SERVICES_TYPE_STEAM_RESTART_ORCHESTRATOR, ProtonPlusServicesSteamRestartOrchestrator), _tmp45_);
		_g_object_unref0 (_tmp45_);
	}
	_tmp48_ = self->priv->_toast_overlay;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp48_);
	_tmp49_ = proton_plus_utils_download_manager_get_instance ();
	_tmp50_ = _tmp49_;
	g_signal_connect_object (_tmp50_, "download-added", (GCallback) _proton_plus_widgets_main_box_on_download_added_proton_plus_utils_download_manager_download_added, self, 0);
	_tmp51_ = proton_plus_utils_download_manager_get_instance ();
	_tmp52_ = _tmp51_;
	g_signal_connect_object (_tmp52_, "download-finished", (GCallback) _proton_plus_widgets_main_box_on_download_finished_proton_plus_utils_download_manager_download_finished, self, 0);
	_tmp53_ = proton_plus_utils_download_manager_get_instance ();
	_tmp54_ = _tmp53_;
	g_signal_connect_object (_tmp54_, "tool-updated", (GCallback) _proton_plus_widgets_main_box_on_tool_updated_proton_plus_utils_download_manager_tool_updated, self, 0);
	_tmp55_ = proton_plus_utils_download_manager_get_instance ();
	_tmp56_ = _tmp55_;
	g_signal_connect_object (_tmp56_, "tool-removed", (GCallback) _proton_plus_widgets_main_box_on_tool_removed_proton_plus_utils_download_manager_tool_removed, self, 0);
	_g_object_unref0 (mangohud_page);
	return self;
}

ProtonPlusWidgetsMainBox*
proton_plus_widgets_main_box_new (ProtonPlusServicesSteamRestartManager* restart_manager,
                                  ProtonPlusServicesSteamRestartOrchestrator* restart_orchestrator,
                                  ProtonPlusWidgetsMainSteamRestartNotificationSender* restart_notification_sender)
{
	return proton_plus_widgets_main_box_construct (PROTON_PLUS_WIDGETS_MAIN_TYPE_BOX, restart_manager, restart_orchestrator, restart_notification_sender);
}

static void
__lambda351_ (ProtonPlusWidgetsMainBox* self,
              GtkGestureClick* gesture,
              gint n_press,
              gdouble x,
              gdouble y)
{
	g_return_if_fail (gesture != NULL);
	if (n_press == 1) {
		AdwViewStack* _tmp0_;
		const gchar* _tmp1_;
		_tmp0_ = self->priv->_view_stack;
		_tmp1_ = adw_view_stack_get_visible_child_name (_tmp0_);
		proton_plus_widgets_main_box_set_view_switcher_pressed_page (self, _tmp1_);
	}
}

static void
___lambda351__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                         gint n_press,
                                         gdouble x,
                                         gdouble y,
                                         gpointer self)
{
	__lambda351_ ((ProtonPlusWidgetsMainBox*) self, _sender, n_press, x, y);
}

static Block11Data*
block11_data_ref (Block11Data* _data11_)
{
	g_atomic_int_inc (&_data11_->_ref_count_);
	return _data11_;
}

static void
block11_data_unref (void * _userdata_)
{
	Block11Data* _data11_;
	_data11_ = (Block11Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data11_->_ref_count_)) {
		ProtonPlusWidgetsMainBox* self;
		self = _data11_->self;
		_g_free0 (_data11_->pressed_page);
		_g_object_unref0 (self);
		g_slice_free (Block11Data, _data11_);
	}
}

static gboolean
__lambda353_ (Block11Data* _data11_)
{
	ProtonPlusWidgetsMainBox* self;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_;
	gboolean result;
	self = _data11_->self;
	_tmp1_ = _data11_->pressed_page;
	if (_tmp1_ != NULL) {
		const gchar* _tmp2_;
		AdwViewStack* _tmp3_;
		const gchar* _tmp4_;
		_tmp2_ = _data11_->pressed_page;
		_tmp3_ = self->priv->_view_stack;
		_tmp4_ = adw_view_stack_get_visible_child_name (_tmp3_);
		_tmp0_ = g_strcmp0 (_tmp2_, _tmp4_) == 0;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		proton_plus_widgets_main_box_reset_visible_page (self);
	}
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda353__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda353_ (self);
	return result;
}

static void
__lambda352_ (ProtonPlusWidgetsMainBox* self,
              GtkGestureClick* gesture,
              gint n_press,
              gdouble x,
              gdouble y)
{
	Block11Data* _data11_;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (gesture != NULL);
	_data11_ = g_slice_new0 (Block11Data);
	_data11_->_ref_count_ = 1;
	_data11_->self = g_object_ref (self);
	if (n_press != 1) {
		block11_data_unref (_data11_);
		_data11_ = NULL;
		return;
	}
	_tmp0_ = self->priv->_view_switcher_pressed_page;
	_tmp1_ = g_strdup (_tmp0_);
	_data11_->pressed_page = _tmp1_;
	proton_plus_widgets_main_box_set_view_switcher_pressed_page (self, NULL);
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda353__gsource_func, block11_data_ref (_data11_), block11_data_unref);
	block11_data_unref (_data11_);
	_data11_ = NULL;
}

static void
___lambda352__gtk_gesture_click_released (GtkGestureClick* _sender,
                                          gint n_press,
                                          gdouble x,
                                          gdouble y,
                                          gpointer self)
{
	__lambda352_ ((ProtonPlusWidgetsMainBox*) self, _sender, n_press, x, y);
}

static void
proton_plus_widgets_main_box_add_view_switcher_reset_controller (ProtonPlusWidgetsMainBox* self,
                                                                 GtkWidget* switcher)
{
	GtkGestureClick* reset_controller = NULL;
	GtkGestureClick* _tmp0_;
	GtkEventController* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (switcher != NULL);
	_tmp0_ = (GtkGestureClick*) gtk_gesture_click_new ();
	reset_controller = _tmp0_;
	gtk_event_controller_set_propagation_phase ((GtkEventController*) reset_controller, GTK_PHASE_CAPTURE);
	g_signal_connect_object (reset_controller, "pressed", (GCallback) ___lambda351__gtk_gesture_click_pressed, self, 0);
	g_signal_connect_object (reset_controller, "released", (GCallback) ___lambda352__gtk_gesture_click_released, self, 0);
	_tmp1_ = _g_object_ref0 ((GtkEventController*) reset_controller);
	gtk_widget_add_controller (switcher, _tmp1_);
	_g_object_unref0 (reset_controller);
}

static void
_proton_plus_widgets_games_box_load_games_g_object_notify (GObject* _sender,
                                                           GParamSpec* pspec,
                                                           gpointer self)
{
	proton_plus_widgets_games_box_load_games ((ProtonPlusWidgetsGamesBox*) self);
}

void
proton_plus_widgets_main_box_initialize (ProtonPlusWidgetsMainBox* self,
                                         GeeLinkedList* launchers)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (launchers != NULL);
	{
		GeeLinkedList* _launcher_list = NULL;
		gint _launcher_size = 0;
		GeeLinkedList* _tmp0_;
		gint _tmp1_;
		gint _tmp2_;
		gint _launcher_index = 0;
		_launcher_list = launchers;
		_tmp0_ = _launcher_list;
		_tmp1_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp0_);
		_tmp2_ = _tmp1_;
		_launcher_size = _tmp2_;
		_launcher_index = -1;
		while (TRUE) {
			gint _tmp3_;
			gint _tmp4_;
			ProtonPlusModelsLauncher* launcher = NULL;
			GeeLinkedList* _tmp5_;
			gpointer _tmp6_;
			ProtonPlusModelsLauncher* _tmp7_;
			_launcher_index = _launcher_index + 1;
			_tmp3_ = _launcher_index;
			_tmp4_ = _launcher_size;
			if (!(_tmp3_ < _tmp4_)) {
				break;
			}
			_tmp5_ = _launcher_list;
			_tmp6_ = gee_abstract_list_get ((GeeAbstractList*) _tmp5_, _launcher_index);
			launcher = (ProtonPlusModelsLauncher*) _tmp6_;
			_tmp7_ = launcher;
			if (PROTON_PLUS_MODELS_LAUNCHERS_IS_STEAM (_tmp7_)) {
				ProtonPlusModelsLaunchersSteam* steam_launcher = NULL;
				ProtonPlusModelsLauncher* _tmp8_;
				ProtonPlusModelsLaunchersSteam* _tmp9_;
				ProtonPlusModelsLaunchersSteam* _tmp10_;
				ProtonPlusWidgetsGamesBox* _tmp11_;
				_tmp8_ = launcher;
				_tmp9_ = _g_object_ref0 (PROTON_PLUS_MODELS_LAUNCHERS_IS_STEAM (_tmp8_) ? ((ProtonPlusModelsLaunchersSteam*) _tmp8_) : NULL);
				steam_launcher = _tmp9_;
				_tmp10_ = steam_launcher;
				_tmp11_ = self->priv->_games_box;
				g_signal_connect_object ((GObject*) _tmp10_, "notify::profile", (GCallback) _proton_plus_widgets_games_box_load_games_g_object_notify, _tmp11_, 0);
				_g_object_unref0 (steam_launcher);
				_g_object_unref0 (launcher);
				break;
			}
			_g_object_unref0 (launcher);
		}
	}
}

void
proton_plus_widgets_main_box_set_selected_launcher (ProtonPlusWidgetsMainBox* self,
                                                    ProtonPlusModelsLauncher* launcher)
{
	ProtonPlusWidgetsToolsBox* _tmp0_;
	ProtonPlusWidgetsGamesBox* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (launcher != NULL);
	_tmp0_ = self->priv->_tools_box;
	proton_plus_widgets_tools_box_set_selected_launcher (_tmp0_, launcher);
	_tmp1_ = self->priv->_games_box;
	proton_plus_widgets_games_box_set_selected_launcher (_tmp1_, launcher);
	g_signal_emit (self, proton_plus_widgets_main_box_signals[PROTON_PLUS_WIDGETS_MAIN_BOX_SEARCH_AVAILABILITY_CHANGED_SIGNAL], 0, proton_plus_widgets_main_box_search_available (self));
}

void
proton_plus_widgets_main_box_navigate_to_download (ProtonPlusWidgetsMainBox* self,
                                                   ProtonPlusServicesInstallJob* job)
{
	AdwViewStack* _tmp0_;
	ProtonPlusWidgetsToolsBox* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (job != NULL);
	_tmp0_ = self->priv->_view_stack;
	adw_view_stack_set_visible_child_name (_tmp0_, "tools");
	_tmp1_ = self->priv->_tools_box;
	proton_plus_widgets_tools_box_show_download (_tmp1_, job);
}

void
proton_plus_widgets_main_box_send_toast (ProtonPlusWidgetsMainBox* self,
                                         const gchar* title)
{
	AdwToast* toast = NULL;
	AdwToast* _tmp0_;
	AdwToastOverlay* _tmp1_;
	AdwToast* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (title != NULL);
	_tmp0_ = adw_toast_new (title);
	toast = _tmp0_;
	_tmp1_ = self->priv->_toast_overlay;
	_tmp2_ = _g_object_ref0 (toast);
	adw_toast_overlay_add_toast (_tmp1_, _tmp2_);
	_g_object_unref0 (toast);
}

void
proton_plus_widgets_main_box_cancel_steam_restart (ProtonPlusWidgetsMainBox* self)
{
	GCancellable* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->restart_cancellable;
	if (_tmp0_ != NULL) {
		GCancellable* _tmp1_;
		_tmp1_ = self->priv->restart_cancellable;
		g_cancellable_cancel (_tmp1_);
	}
}

static Block12Data*
block12_data_ref (Block12Data* _data12_)
{
	g_atomic_int_inc (&_data12_->_ref_count_);
	return _data12_;
}

static void
block12_data_unref (void * _userdata_)
{
	Block12Data* _data12_;
	_data12_ = (Block12Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data12_->_ref_count_)) {
		ProtonPlusWidgetsMainBox* self;
		self = _data12_->self;
		_g_object_unref0 (_data12_->manager);
		_g_object_unref0 (_data12_->orchestrator);
		_g_object_unref0 (self);
		g_slice_free (Block12Data, _data12_);
	}
}

static void
_proton_plus_widgets_main_box_show_restart_review_proton_plus_widgets_main_steam_restart_banner_restart_requested (ProtonPlusWidgetsMainSteamRestartBanner* _sender,
                                                                                                                   gpointer self)
{
	proton_plus_widgets_main_box_show_restart_review ((ProtonPlusWidgetsMainBox*) self);
}

static void
__lambda361_ (Block12Data* _data12_)
{
	ProtonPlusWidgetsMainBox* self;
	guint current = 0U;
	GtkWindow* window = NULL;
	GtkRoot* _tmp0_;
	GtkWindow* _tmp1_;
	gboolean _tmp2_ = FALSE;
	GtkWindow* _tmp3_;
	gboolean active = FALSE;
	gchar* toast = NULL;
	ProtonPlusWidgetsMainSteamRestartToastPolicy* _tmp7_;
	gchar* _tmp8_;
	ProtonPlusWidgetsMainSteamRestartNotificationCoordinator* _tmp9_;
	gboolean _tmp10_ = FALSE;
	self = _data12_->self;
	current = (guint) proton_plus_services_steam_restart_manager_pending_count (_data12_->manager);
	_tmp0_ = gtk_widget_get_root ((GtkWidget*) self);
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, gtk_window_get_type ()) ? ((GtkWindow*) _tmp0_) : NULL);
	window = _tmp1_;
	_tmp3_ = window;
	if (_tmp3_ != NULL) {
		GtkWindow* _tmp4_;
		gboolean _tmp5_;
		gboolean _tmp6_;
		_tmp4_ = window;
		g_object_get (_tmp4_, "is-active", &_tmp5_, NULL);
		_tmp6_ = _tmp5_;
		_tmp2_ = _tmp6_;
	} else {
		_tmp2_ = FALSE;
	}
	active = _tmp2_;
	_tmp7_ = self->priv->restart_toasts;
	_tmp8_ = proton_plus_widgets_main_steam_restart_toast_policy_update (_tmp7_, self->priv->previous_restart_count, current, FALSE);
	toast = _tmp8_;
	_tmp9_ = self->priv->restart_notifications;
	proton_plus_widgets_main_steam_restart_notification_coordinator_update (_tmp9_, self->priv->previous_restart_count, current, active, FALSE);
	self->priv->previous_restart_count = current;
	if (current == ((guint) 0)) {
		self->priv->persistence_toast_shown = FALSE;
	}
	proton_plus_widgets_main_box_update_restart_banner (self);
	if (active) {
		const gchar* _tmp11_;
		_tmp11_ = toast;
		_tmp10_ = _tmp11_ != NULL;
	} else {
		_tmp10_ = FALSE;
	}
	if (_tmp10_) {
		const gchar* _tmp12_;
		_tmp12_ = toast;
		proton_plus_widgets_main_box_send_toast (self, (const gchar*) _tmp12_);
	}
	_g_free0 (toast);
	_g_object_unref0 (window);
}

static void
___lambda361__proton_plus_services_steam_restart_manager_pending_changed (ProtonPlusServicesSteamRestartManager* _sender,
                                                                          gpointer self)
{
	__lambda361_ (self);
}

static void
__lambda362_ (ProtonPlusWidgetsMainBox* self,
              const gchar* message)
{
	g_return_if_fail (message != NULL);
	g_warning ("main-box.vala:188: Unable to save Steam restart reminder: %s", message);
	if (!self->priv->persistence_toast_shown) {
		self->priv->persistence_toast_shown = TRUE;
		proton_plus_widgets_main_box_send_toast (self, _ ("Couldn’t save the Steam restart reminder"));
	}
}

static void
___lambda362__proton_plus_services_steam_restart_manager_persistence_failed (ProtonPlusServicesSteamRestartManager* _sender,
                                                                             const gchar* message,
                                                                             gpointer self)
{
	__lambda362_ ((ProtonPlusWidgetsMainBox*) self, message);
}

static void
__lambda363_ (Block12Data* _data12_,
              ProtonPlusModelsSteamRestartOperationState state)
{
	ProtonPlusWidgetsMainBox* self;
	gboolean _tmp0_;
	gboolean _tmp1_;
	self = _data12_->self;
	_tmp0_ = proton_plus_services_steam_restart_orchestrator_get_is_operation_active (_data12_->orchestrator);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		ProtonPlusWidgetsMainSteamRestartBanner* _tmp2_;
		_tmp2_ = self->priv->restart_banner;
		proton_plus_widgets_main_steam_restart_banner_show_progress (_tmp2_, state);
	}
}

static void
___lambda363__proton_plus_services_steam_restart_orchestrator_state_changed (ProtonPlusServicesSteamRestartOrchestrator* _sender,
                                                                             ProtonPlusModelsSteamRestartOperationState state,
                                                                             gpointer self)
{
	__lambda363_ (self, state);
}

static void
_proton_plus_widgets_main_box_on_restart_completed_proton_plus_services_steam_restart_orchestrator_operation_completed (ProtonPlusServicesSteamRestartOrchestrator* _sender,
                                                                                                                        ProtonPlusModelsSteamRestartOperationResult* _result_,
                                                                                                                        gpointer self)
{
	proton_plus_widgets_main_box_on_restart_completed ((ProtonPlusWidgetsMainBox*) self, _result_);
}

static gboolean
___lambda366_ (ProtonPlusWidgetsMainBox* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean result;
	if (!self->priv->load_warning_shown) {
		GtkRoot* _tmp1_;
		_tmp1_ = gtk_widget_get_root ((GtkWidget*) self);
		_tmp0_ = _tmp1_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		self->priv->load_warning_shown = TRUE;
		proton_plus_widgets_main_box_send_toast (self, _ ("Saved Steam restart reminders couldn’t be loaded"));
	}
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
____lambda366__gsource_func (gpointer self)
{
	gboolean result;
	result = ___lambda366_ ((ProtonPlusWidgetsMainBox*) self);
	return result;
}

static void
proton_plus_widgets_main_box_setup_steam_restart_presentation (ProtonPlusWidgetsMainBox* self,
                                                               ProtonPlusServicesSteamRestartManager* manager,
                                                               ProtonPlusServicesSteamRestartOrchestrator* orchestrator,
                                                               ProtonPlusWidgetsMainSteamRestartNotificationSender* notification_sender)
{
	Block12Data* _data12_;
	ProtonPlusServicesSteamRestartManager* _tmp0_;
	ProtonPlusServicesSteamRestartOrchestrator* _tmp1_;
	ProtonPlusWidgetsMainSteamRestartBanner* _tmp2_;
	ProtonPlusWidgetsMainSteamRestartBanner* _tmp3_;
	ProtonPlusWidgetsMainSteamRestartBanner* _tmp4_;
	ProtonPlusWidgetsMainSteamRestartToastPolicy* _tmp5_;
	ProtonPlusWidgetsMainSteamRestartNotificationCoordinator* _tmp6_;
	gulong _tmp7_;
	gulong _tmp8_;
	gulong _tmp9_;
	gulong _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (manager != NULL);
	g_return_if_fail (orchestrator != NULL);
	g_return_if_fail (notification_sender != NULL);
	_data12_ = g_slice_new0 (Block12Data);
	_data12_->_ref_count_ = 1;
	_data12_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (manager);
	_g_object_unref0 (_data12_->manager);
	_data12_->manager = _tmp0_;
	_tmp1_ = _g_object_ref0 (orchestrator);
	_g_object_unref0 (_data12_->orchestrator);
	_data12_->orchestrator = _tmp1_;
	_tmp2_ = proton_plus_widgets_main_steam_restart_banner_new ();
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->restart_banner);
	self->priv->restart_banner = _tmp2_;
	_tmp3_ = self->priv->restart_banner;
	g_signal_connect_object (_tmp3_, "restart-requested", (GCallback) _proton_plus_widgets_main_box_show_restart_review_proton_plus_widgets_main_steam_restart_banner_restart_requested, self, 0);
	_tmp4_ = self->priv->restart_banner;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp4_);
	_tmp5_ = proton_plus_widgets_main_steam_restart_toast_policy_new ();
	_g_object_unref0 (self->priv->restart_toasts);
	self->priv->restart_toasts = _tmp5_;
	_tmp6_ = proton_plus_widgets_main_steam_restart_notification_coordinator_new (notification_sender, NULL);
	_g_object_unref0 (self->priv->restart_notifications);
	self->priv->restart_notifications = _tmp6_;
	self->priv->previous_restart_count = (guint) proton_plus_services_steam_restart_manager_pending_count (_data12_->manager);
	proton_plus_widgets_main_box_update_restart_banner (self);
	_tmp7_ = g_signal_connect_data (_data12_->manager, "pending-changed", (GCallback) ___lambda361__proton_plus_services_steam_restart_manager_pending_changed, block12_data_ref (_data12_), (GClosureNotify) block12_data_unref, 0);
	self->priv->pending_changed_handler_id = _tmp7_;
	_tmp8_ = g_signal_connect_object (_data12_->manager, "persistence-failed", (GCallback) ___lambda362__proton_plus_services_steam_restart_manager_persistence_failed, self, 0);
	self->priv->persistence_failed_handler_id = _tmp8_;
	_tmp9_ = g_signal_connect_data (_data12_->orchestrator, "state-changed", (GCallback) ___lambda363__proton_plus_services_steam_restart_orchestrator_state_changed, block12_data_ref (_data12_), (GClosureNotify) block12_data_unref, 0);
	self->priv->state_changed_handler_id = _tmp9_;
	_tmp10_ = g_signal_connect_object (_data12_->orchestrator, "operation-completed", (GCallback) _proton_plus_widgets_main_box_on_restart_completed_proton_plus_services_steam_restart_orchestrator_operation_completed, self, 0);
	self->priv->operation_completed_handler_id = _tmp10_;
	_tmp11_ = proton_plus_services_steam_restart_manager_get_last_load_error (_data12_->manager);
	_tmp12_ = _tmp11_;
	if (_tmp12_ != NULL) {
		g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ____lambda366__gsource_func, g_object_ref (self), g_object_unref);
	}
	block12_data_unref (_data12_);
	_data12_ = NULL;
}

static void
proton_plus_widgets_main_box_update_restart_banner (ProtonPlusWidgetsMainBox* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	ProtonPlusServicesSteamRestartManager* _tmp2_;
	ProtonPlusServicesSteamRestartOrchestrator* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	ProtonPlusWidgetsMainSteamRestartBanner* _tmp12_;
	ProtonPlusServicesSteamRestartManager* _tmp13_;
	GeeList* _tmp14_;
	GeeList* _tmp15_;
	ProtonPlusWidgetsMainSteamRestartBannerState* _tmp16_;
	ProtonPlusWidgetsMainSteamRestartBannerState* _tmp17_;
	g_return_if_fail (self != NULL);
	_tmp2_ = self->priv->restart_manager;
	if (_tmp2_ == NULL) {
		_tmp1_ = TRUE;
	} else {
		ProtonPlusWidgetsMainSteamRestartBanner* _tmp3_;
		_tmp3_ = self->priv->restart_banner;
		_tmp1_ = _tmp3_ == NULL;
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		ProtonPlusServicesSteamRestartOrchestrator* _tmp4_;
		_tmp4_ = self->priv->restart_orchestrator;
		_tmp0_ = _tmp4_ == NULL;
	}
	if (_tmp0_) {
		return;
	}
	_tmp5_ = self->priv->restart_orchestrator;
	_tmp6_ = proton_plus_services_steam_restart_orchestrator_get_is_operation_active (_tmp5_);
	_tmp7_ = _tmp6_;
	if (_tmp7_) {
		ProtonPlusWidgetsMainSteamRestartBanner* _tmp8_;
		ProtonPlusServicesSteamRestartOrchestrator* _tmp9_;
		ProtonPlusModelsSteamRestartOperationState _tmp10_;
		ProtonPlusModelsSteamRestartOperationState _tmp11_;
		_tmp8_ = self->priv->restart_banner;
		_tmp9_ = self->priv->restart_orchestrator;
		_tmp10_ = proton_plus_services_steam_restart_orchestrator_get_state (_tmp9_);
		_tmp11_ = _tmp10_;
		proton_plus_widgets_main_steam_restart_banner_show_progress (_tmp8_, _tmp11_);
		return;
	}
	_tmp12_ = self->priv->restart_banner;
	_tmp13_ = self->priv->restart_manager;
	_tmp14_ = proton_plus_services_steam_restart_manager_get_pending_changes (_tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = proton_plus_widgets_main_steam_restart_presentation_banner_state (_tmp15_);
	_tmp17_ = _tmp16_;
	proton_plus_widgets_main_steam_restart_banner_show_pending (_tmp12_, _tmp17_);
	_g_object_unref0 (_tmp17_);
	_g_object_unref0 (_tmp15_);
}

static Block13Data*
block13_data_ref (Block13Data* _data13_)
{
	g_atomic_int_inc (&_data13_->_ref_count_);
	return _data13_;
}

static void
block13_data_unref (void * _userdata_)
{
	Block13Data* _data13_;
	_data13_ = (Block13Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data13_->_ref_count_)) {
		ProtonPlusWidgetsMainBox* self;
		self = _data13_->self;
		_g_object_unref0 (_data13_->dialog);
		_g_object_unref0 (_data13_->summary);
		_g_object_unref0 (self);
		g_slice_free (Block13Data, _data13_);
	}
}

static Block14Data*
block14_data_ref (Block14Data* _data14_)
{
	g_atomic_int_inc (&_data14_->_ref_count_);
	return _data14_;
}

static void
block14_data_unref (void * _userdata_)
{
	Block14Data* _data14_;
	_data14_ = (Block14Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data14_->_ref_count_)) {
		ProtonPlusWidgetsMainBox* self;
		self = _data14_->_data13_->self;
		_g_object_unref0 (_data14_->review);
		block13_data_unref (_data14_->_data13_);
		_data14_->_data13_ = NULL;
		g_slice_free (Block14Data, _data14_);
	}
}

static void
___lambda356_ (ProtonPlusWidgetsMainBox* self,
               ProtonPlusModelsSteamRestartTarget* target)
{
	g_return_if_fail (target != NULL);
	proton_plus_widgets_main_box_start_steam_restart (self, target);
}

static void
____lambda356__proton_plus_widgets_main_steam_restart_review_dialog_restart_requested (ProtonPlusWidgetsMainSteamRestartReviewDialog* _sender,
                                                                                       ProtonPlusModelsSteamRestartTarget* target,
                                                                                       gpointer self)
{
	___lambda356_ ((ProtonPlusWidgetsMainBox*) self, target);
}

static void
___lambda358_ (Block14Data* _data14_)
{
	Block13Data* _data13_;
	ProtonPlusWidgetsMainBox* self;
	AdwDialog* _tmp0_;
	ProtonPlusWidgetsMainSteamRestartReviewDialog* _tmp1_;
	_data13_ = _data14_->_data13_;
	self = _data13_->self;
	_tmp0_ = self->priv->active_restart_dialog;
	_tmp1_ = _data14_->review;
	if (_tmp0_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, adw_dialog_get_type (), AdwDialog)) {
		_g_object_unref0 (self->priv->active_restart_dialog);
		self->priv->active_restart_dialog = NULL;
	}
}

static void
____lambda358__adw_dialog_closed (AdwDialog* _sender,
                                  gpointer self)
{
	___lambda358_ (self);
}

static void
__lambda359_ (Block13Data* _data13_,
              const gchar* response)
{
	ProtonPlusWidgetsMainBox* self;
	self = _data13_->self;
	g_return_if_fail (response != NULL);
	if (g_strcmp0 (response, "restart") == 0) {
		ProtonPlusWidgetsMainSteamRestartTargetSummary* _tmp0_;
		ProtonPlusModelsSteamRestartTarget* _tmp1_;
		ProtonPlusModelsSteamRestartTarget* _tmp2_;
		_tmp0_ = _data13_->summary;
		_tmp1_ = proton_plus_widgets_main_steam_restart_target_summary_get_target (_tmp0_);
		_tmp2_ = _tmp1_;
		proton_plus_widgets_main_box_start_steam_restart (self, _tmp2_);
	}
}

static void
___lambda359__adw_alert_dialog_response (AdwAlertDialog* _sender,
                                         const gchar* response,
                                         gpointer self)
{
	__lambda359_ (self, response);
}

static void
__lambda360_ (Block13Data* _data13_)
{
	ProtonPlusWidgetsMainBox* self;
	AdwDialog* _tmp0_;
	AdwAlertDialog* _tmp1_;
	self = _data13_->self;
	_tmp0_ = self->priv->active_restart_dialog;
	_tmp1_ = _data13_->dialog;
	if (_tmp0_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, adw_dialog_get_type (), AdwDialog)) {
		_g_object_unref0 (self->priv->active_restart_dialog);
		self->priv->active_restart_dialog = NULL;
	}
}

static void
___lambda360__adw_dialog_closed (AdwDialog* _sender,
                                 gpointer self)
{
	__lambda360_ (self);
}

static void
proton_plus_widgets_main_box_show_restart_review (ProtonPlusWidgetsMainBox* self)
{
	Block13Data* _data13_;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	ProtonPlusServicesSteamRestartManager* _tmp2_;
	AdwDialog* _tmp7_;
	GeeList* summaries = NULL;
	ProtonPlusServicesSteamRestartManager* _tmp9_;
	GeeList* _tmp10_;
	GeeList* _tmp11_;
	GeeList* _tmp12_;
	GeeList* _tmp13_;
	GeeList* _tmp14_;
	gint _tmp15_;
	gint _tmp16_;
	GeeList* _tmp17_;
	gint _tmp18_;
	gint _tmp19_;
	GeeList* _tmp27_;
	gpointer _tmp28_;
	gchar* body = NULL;
	ProtonPlusWidgetsMainSteamRestartTargetSummary* _tmp29_;
	guint _tmp30_;
	guint _tmp31_;
	ProtonPlusWidgetsMainSteamRestartTargetSummary* _tmp32_;
	guint _tmp33_;
	guint _tmp34_;
	gchar* _tmp35_;
	const gchar* _tmp36_;
	gchar* _tmp37_;
	gchar* _tmp38_;
	gchar* _tmp39_;
	const gchar* _tmp40_;
	AdwAlertDialog* _tmp41_;
	AdwAlertDialog* _tmp42_;
	AdwAlertDialog* _tmp43_;
	AdwAlertDialog* _tmp44_;
	AdwAlertDialog* _tmp45_;
	AdwAlertDialog* _tmp46_;
	AdwAlertDialog* _tmp47_;
	AdwDialog* _tmp48_;
	AdwAlertDialog* _tmp49_;
	AdwAlertDialog* _tmp50_;
	AdwAlertDialog* _tmp51_;
	g_return_if_fail (self != NULL);
	_data13_ = g_slice_new0 (Block13Data);
	_data13_->_ref_count_ = 1;
	_data13_->self = g_object_ref (self);
	_tmp2_ = self->priv->restart_manager;
	if (_tmp2_ == NULL) {
		_tmp1_ = TRUE;
	} else {
		ProtonPlusServicesSteamRestartOrchestrator* _tmp3_;
		_tmp3_ = self->priv->restart_orchestrator;
		_tmp1_ = _tmp3_ == NULL;
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		ProtonPlusServicesSteamRestartOrchestrator* _tmp4_;
		gboolean _tmp5_;
		gboolean _tmp6_;
		_tmp4_ = self->priv->restart_orchestrator;
		_tmp5_ = proton_plus_services_steam_restart_orchestrator_get_is_operation_active (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp0_ = _tmp6_;
	}
	if (_tmp0_) {
		block13_data_unref (_data13_);
		_data13_ = NULL;
		return;
	}
	_tmp7_ = self->priv->active_restart_dialog;
	if (_tmp7_ != NULL) {
		AdwDialog* _tmp8_;
		_tmp8_ = self->priv->active_restart_dialog;
		proton_plus_widgets_window_present_dialog_for_controller (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, adw_dialog_get_type (), AdwDialog), (GtkWidget*) self);
		block13_data_unref (_data13_);
		_data13_ = NULL;
		return;
	}
	_tmp9_ = self->priv->restart_manager;
	_tmp10_ = proton_plus_services_steam_restart_manager_get_pending_changes (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = proton_plus_widgets_main_steam_restart_presentation_summarize (_tmp11_);
	_tmp13_ = _tmp12_;
	_g_object_unref0 (_tmp11_);
	summaries = _tmp13_;
	_tmp14_ = summaries;
	_tmp15_ = gee_collection_get_size ((GeeCollection*) _tmp14_);
	_tmp16_ = _tmp15_;
	if (_tmp16_ == 0) {
		_g_object_unref0 (summaries);
		block13_data_unref (_data13_);
		_data13_ = NULL;
		return;
	}
	_tmp17_ = summaries;
	_tmp18_ = gee_collection_get_size ((GeeCollection*) _tmp17_);
	_tmp19_ = _tmp18_;
	if (_tmp19_ > 1) {
		Block14Data* _data14_;
		GeeList* _tmp20_;
		ProtonPlusWidgetsMainSteamRestartReviewDialog* _tmp21_;
		ProtonPlusWidgetsMainSteamRestartReviewDialog* _tmp22_;
		AdwDialog* _tmp23_;
		ProtonPlusWidgetsMainSteamRestartReviewDialog* _tmp24_;
		ProtonPlusWidgetsMainSteamRestartReviewDialog* _tmp25_;
		ProtonPlusWidgetsMainSteamRestartReviewDialog* _tmp26_;
		_data14_ = g_slice_new0 (Block14Data);
		_data14_->_ref_count_ = 1;
		_data14_->_data13_ = block13_data_ref (_data13_);
		_tmp20_ = summaries;
		_tmp21_ = proton_plus_widgets_main_steam_restart_review_dialog_new (_tmp20_);
		g_object_ref_sink (_tmp21_);
		_data14_->review = _tmp21_;
		_tmp22_ = _data14_->review;
		_tmp23_ = _g_object_ref0 ((AdwDialog*) _tmp22_);
		_g_object_unref0 (self->priv->active_restart_dialog);
		self->priv->active_restart_dialog = _tmp23_;
		_tmp24_ = _data14_->review;
		g_signal_connect_object (_tmp24_, "restart-requested", (GCallback) ____lambda356__proton_plus_widgets_main_steam_restart_review_dialog_restart_requested, self, 0);
		_tmp25_ = _data14_->review;
		g_signal_connect_data ((AdwDialog*) _tmp25_, "closed", (GCallback) ____lambda358__adw_dialog_closed, block14_data_ref (_data14_), (GClosureNotify) block14_data_unref, 0);
		_tmp26_ = _data14_->review;
		proton_plus_widgets_window_present_dialog_for_controller ((AdwDialog*) _tmp26_, (GtkWidget*) self);
		block14_data_unref (_data14_);
		_data14_ = NULL;
		_g_object_unref0 (summaries);
		block13_data_unref (_data13_);
		_data13_ = NULL;
		return;
	}
	_tmp27_ = summaries;
	_tmp28_ = gee_list_get (_tmp27_, 0);
	_data13_->summary = (ProtonPlusWidgetsMainSteamRestartTargetSummary*) _tmp28_;
	_tmp29_ = _data13_->summary;
	_tmp30_ = proton_plus_widgets_main_steam_restart_target_summary_get_pending_count (_tmp29_);
	_tmp31_ = _tmp30_;
	_tmp32_ = _data13_->summary;
	_tmp33_ = proton_plus_widgets_main_steam_restart_target_summary_get_pending_count (_tmp32_);
	_tmp34_ = _tmp33_;
	_tmp35_ = g_strdup_printf (ngettext ("Steam needs to restart before this change takes effect.", "Steam needs to restart before these %u changes take effect.", (gulong) _tmp31_), _tmp34_);
	body = _tmp35_;
	_tmp36_ = body;
	_tmp37_ = g_strconcat ("\n\n", _ ("Save your progress and close any running games before continuing. In S" \
"teamOS Gaming Mode, Steam, running games, and ProtonPlus will close wh" \
"ile Steam restarts."), NULL);
	_tmp38_ = _tmp37_;
	_tmp39_ = g_strconcat (_tmp36_, _tmp38_, NULL);
	_g_free0 (body);
	body = _tmp39_;
	_g_free0 (_tmp38_);
	_tmp40_ = body;
	_tmp41_ = (AdwAlertDialog*) adw_alert_dialog_new (_ ("Restart Steam?"), _tmp40_);
	g_object_ref_sink (_tmp41_);
	_data13_->dialog = _tmp41_;
	_tmp42_ = _data13_->dialog;
	adw_alert_dialog_add_response (_tmp42_, "later", _ ("Later"));
	_tmp43_ = _data13_->dialog;
	adw_alert_dialog_add_response (_tmp43_, "restart", _ ("Restart Steam"));
	_tmp44_ = _data13_->dialog;
	adw_alert_dialog_set_default_response (_tmp44_, "later");
	_tmp45_ = _data13_->dialog;
	adw_alert_dialog_set_close_response (_tmp45_, "later");
	_tmp46_ = _data13_->dialog;
	adw_alert_dialog_set_response_appearance (_tmp46_, "restart", ADW_RESPONSE_SUGGESTED);
	_tmp47_ = _data13_->dialog;
	_tmp48_ = _g_object_ref0 ((AdwDialog*) _tmp47_);
	_g_object_unref0 (self->priv->active_restart_dialog);
	self->priv->active_restart_dialog = _tmp48_;
	_tmp49_ = _data13_->dialog;
	g_signal_connect_data (_tmp49_, "response", (GCallback) ___lambda359__adw_alert_dialog_response, block13_data_ref (_data13_), (GClosureNotify) block13_data_unref, 0);
	_tmp50_ = _data13_->dialog;
	g_signal_connect_data ((AdwDialog*) _tmp50_, "closed", (GCallback) ___lambda360__adw_dialog_closed, block13_data_ref (_data13_), (GClosureNotify) block13_data_unref, 0);
	_tmp51_ = _data13_->dialog;
	proton_plus_widgets_window_present_dialog_for_controller ((AdwDialog*) _tmp51_, (GtkWidget*) self);
	_g_free0 (body);
	_g_object_unref0 (summaries);
	block13_data_unref (_data13_);
	_data13_ = NULL;
}

static void
__lambda357_ (ProtonPlusWidgetsMainBox* self,
              GObject* obj,
              GAsyncResult* response)
{
	ProtonPlusServicesSteamRestartOrchestrator* _tmp0_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp1_;
	ProtonPlusModelsSteamRestartOperationResult* _tmp2_;
	g_return_if_fail (response != NULL);
	_tmp0_ = self->priv->restart_orchestrator;
	_tmp1_ = proton_plus_services_steam_restart_orchestrator_restart_target_finish (_tmp0_, response);
	_tmp2_ = _tmp1_;
	_g_object_unref0 (_tmp2_);
}

static void
___lambda357__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	__lambda357_ ((ProtonPlusWidgetsMainBox*) self, source_object, res);
	g_object_unref (self);
}

static void
proton_plus_widgets_main_box_start_steam_restart (ProtonPlusWidgetsMainBox* self,
                                                  ProtonPlusModelsSteamRestartTarget* target)
{
	gboolean _tmp0_ = FALSE;
	ProtonPlusServicesSteamRestartOrchestrator* _tmp1_;
	AdwDialog* _tmp5_;
	GCancellable* _tmp7_;
	ProtonPlusServicesSteamRestartOrchestrator* _tmp8_;
	GCancellable* _tmp9_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (target != NULL);
	_tmp1_ = self->priv->restart_orchestrator;
	if (_tmp1_ == NULL) {
		_tmp0_ = TRUE;
	} else {
		ProtonPlusServicesSteamRestartOrchestrator* _tmp2_;
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp2_ = self->priv->restart_orchestrator;
		_tmp3_ = proton_plus_services_steam_restart_orchestrator_get_is_operation_active (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp0_ = _tmp4_;
	}
	if (_tmp0_) {
		return;
	}
	_tmp5_ = self->priv->active_restart_dialog;
	if (_tmp5_ != NULL) {
		AdwDialog* _tmp6_;
		_tmp6_ = self->priv->active_restart_dialog;
		adw_dialog_close (_tmp6_);
	}
	_tmp7_ = g_cancellable_new ();
	_g_object_unref0 (self->priv->restart_cancellable);
	self->priv->restart_cancellable = _tmp7_;
	_tmp8_ = self->priv->restart_orchestrator;
	_tmp9_ = self->priv->restart_cancellable;
	proton_plus_services_steam_restart_orchestrator_restart_target (_tmp8_, target, (GObject*) _tmp9_, ___lambda357__gasync_ready_callback, g_object_ref (self));
}

static void
proton_plus_widgets_main_box_on_restart_completed (ProtonPlusWidgetsMainBox* self,
                                                   ProtonPlusModelsSteamRestartOperationResult* _result_)
{
	ProtonPlusModelsSteamRestartOperationState _tmp0_;
	ProtonPlusModelsSteamRestartOperationState _tmp1_;
	ProtonPlusModelsSteamRestartOperationState _tmp9_;
	ProtonPlusModelsSteamRestartOperationState _tmp10_;
	ProtonPlusWidgetsMainSteamRestartMessage* failure = NULL;
	ProtonPlusModelsSteamRestartFailureReason _tmp33_;
	ProtonPlusModelsSteamRestartFailureReason _tmp34_;
	gboolean _tmp35_;
	gboolean _tmp36_;
	ProtonPlusWidgetsMainSteamRestartMessage* _tmp37_;
	ProtonPlusWidgetsMainSteamRestartMessage* _tmp38_;
	const gchar* _tmp39_;
	const gchar* _tmp40_;
	ProtonPlusWidgetsMainSteamRestartMessage* _tmp52_;
	const gchar* _tmp53_;
	const gchar* _tmp54_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (_result_ != NULL);
	_g_object_unref0 (self->priv->restart_cancellable);
	self->priv->restart_cancellable = NULL;
	proton_plus_widgets_main_box_update_restart_banner (self);
	_tmp0_ = proton_plus_models_steam_restart_operation_result_get_final_state (_result_);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == PROTON_PLUS_MODELS_STEAM_RESTART_OPERATION_STATE_STEAMOS_HANDOFF_REQUESTED) {
		ProtonPlusWidgetsMainSteamRestartMessage* handoff = NULL;
		ProtonPlusWidgetsMainSteamRestartMessage* _tmp2_;
		ProtonPlusWidgetsMainSteamRestartMessage* _tmp3_;
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		_tmp2_ = proton_plus_widgets_main_steam_restart_presentation_steamos_handoff_message ();
		handoff = _tmp2_;
		_tmp3_ = handoff;
		_tmp4_ = proton_plus_widgets_main_steam_restart_message_get_toast (_tmp3_);
		_tmp5_ = _tmp4_;
		if (_tmp5_ != NULL) {
			ProtonPlusWidgetsMainSteamRestartMessage* _tmp6_;
			const gchar* _tmp7_;
			const gchar* _tmp8_;
			_tmp6_ = handoff;
			_tmp7_ = proton_plus_widgets_main_steam_restart_message_get_toast (_tmp6_);
			_tmp8_ = _tmp7_;
			proton_plus_widgets_main_box_send_toast (self, (const gchar*) _tmp8_);
		}
		_g_object_unref0 (handoff);
		return;
	}
	_tmp9_ = proton_plus_models_steam_restart_operation_result_get_final_state (_result_);
	_tmp10_ = _tmp9_;
	if (_tmp10_ == PROTON_PLUS_MODELS_STEAM_RESTART_OPERATION_STATE_SUCCEEDED) {
		gboolean _tmp11_ = FALSE;
		ProtonPlusServicesSteamRestartManager* _tmp12_;
		ProtonPlusWidgetsMainSteamRestartMessage* message = NULL;
		gboolean _tmp18_;
		gboolean _tmp19_;
		ProtonPlusWidgetsMainSteamRestartMessage* _tmp20_;
		ProtonPlusWidgetsMainSteamRestartMessage* _tmp21_;
		const gchar* _tmp22_;
		const gchar* _tmp23_;
		_tmp12_ = self->priv->restart_manager;
		if (_tmp12_ != NULL) {
			ProtonPlusServicesSteamRestartManager* _tmp13_;
			GeeList* _tmp14_;
			GeeList* _tmp15_;
			gint _tmp16_;
			gint _tmp17_;
			_tmp13_ = self->priv->restart_manager;
			_tmp14_ = proton_plus_services_steam_restart_manager_get_pending_targets (_tmp13_);
			_tmp15_ = _tmp14_;
			_tmp16_ = gee_collection_get_size ((GeeCollection*) _tmp15_);
			_tmp17_ = _tmp16_;
			_tmp11_ = _tmp17_ > 0;
			_g_object_unref0 (_tmp15_);
		} else {
			_tmp11_ = FALSE;
		}
		_tmp18_ = proton_plus_models_steam_restart_operation_result_get_persistence_failed (_result_);
		_tmp19_ = _tmp18_;
		_tmp20_ = proton_plus_widgets_main_steam_restart_presentation_success_message (_tmp11_, _tmp19_);
		message = _tmp20_;
		_tmp21_ = message;
		_tmp22_ = proton_plus_widgets_main_steam_restart_message_get_toast (_tmp21_);
		_tmp23_ = _tmp22_;
		if (_tmp23_ != NULL) {
			ProtonPlusWidgetsMainSteamRestartMessage* _tmp24_;
			const gchar* _tmp25_;
			const gchar* _tmp26_;
			_tmp24_ = message;
			_tmp25_ = proton_plus_widgets_main_steam_restart_message_get_toast (_tmp24_);
			_tmp26_ = _tmp25_;
			proton_plus_widgets_main_box_send_toast (self, (const gchar*) _tmp26_);
		} else {
			ProtonPlusWidgetsMainSteamRestartMessage* _tmp27_;
			const gchar* _tmp28_;
			const gchar* _tmp29_;
			_tmp27_ = message;
			_tmp28_ = proton_plus_widgets_main_steam_restart_message_get_heading (_tmp27_);
			_tmp29_ = _tmp28_;
			if (_tmp29_ != NULL) {
				ProtonPlusWidgetsMainSteamRestartMessage* _tmp30_;
				ProtonPlusModelsSteamRestartTarget* _tmp31_;
				ProtonPlusModelsSteamRestartTarget* _tmp32_;
				_tmp30_ = message;
				_tmp31_ = proton_plus_models_steam_restart_operation_result_get_target (_result_);
				_tmp32_ = _tmp31_;
				proton_plus_widgets_main_box_show_restart_message (self, _tmp30_, _tmp32_);
			}
		}
		_g_object_unref0 (message);
		return;
	}
	_tmp33_ = proton_plus_models_steam_restart_operation_result_get_reason (_result_);
	_tmp34_ = _tmp33_;
	_tmp35_ = proton_plus_models_steam_restart_operation_result_get_steam_confirmed_stopped (_result_);
	_tmp36_ = _tmp35_;
	_tmp37_ = proton_plus_widgets_main_steam_restart_presentation_failure_message (_tmp34_, _tmp36_);
	failure = _tmp37_;
	_tmp38_ = failure;
	_tmp39_ = proton_plus_widgets_main_steam_restart_message_get_toast (_tmp38_);
	_tmp40_ = _tmp39_;
	if (_tmp40_ != NULL) {
		gboolean _tmp41_ = FALSE;
		gboolean _tmp42_ = FALSE;
		ProtonPlusModelsSteamRestartFailureReason _tmp43_;
		ProtonPlusModelsSteamRestartFailureReason _tmp44_;
		_tmp43_ = proton_plus_models_steam_restart_operation_result_get_reason (_result_);
		_tmp44_ = _tmp43_;
		if (_tmp44_ != PROTON_PLUS_MODELS_STEAM_RESTART_FAILURE_REASON_CANCELLED) {
			_tmp42_ = TRUE;
		} else {
			gboolean _tmp45_;
			gboolean _tmp46_;
			_tmp45_ = proton_plus_models_steam_restart_operation_result_get_shutdown_request_sent (_result_);
			_tmp46_ = _tmp45_;
			_tmp42_ = _tmp46_;
		}
		if (_tmp42_) {
			_tmp41_ = TRUE;
		} else {
			gboolean _tmp47_;
			gboolean _tmp48_;
			_tmp47_ = proton_plus_models_steam_restart_operation_result_get_launch_request_sent (_result_);
			_tmp48_ = _tmp47_;
			_tmp41_ = _tmp48_;
		}
		if (_tmp41_) {
			ProtonPlusWidgetsMainSteamRestartMessage* _tmp49_;
			const gchar* _tmp50_;
			const gchar* _tmp51_;
			_tmp49_ = failure;
			_tmp50_ = proton_plus_widgets_main_steam_restart_message_get_toast (_tmp49_);
			_tmp51_ = _tmp50_;
			proton_plus_widgets_main_box_send_toast (self, (const gchar*) _tmp51_);
		}
		_g_object_unref0 (failure);
		return;
	}
	_tmp52_ = failure;
	_tmp53_ = proton_plus_widgets_main_steam_restart_message_get_heading (_tmp52_);
	_tmp54_ = _tmp53_;
	if (_tmp54_ != NULL) {
		ProtonPlusWidgetsMainSteamRestartMessage* _tmp55_;
		ProtonPlusModelsSteamRestartTarget* _tmp56_;
		ProtonPlusModelsSteamRestartTarget* _tmp57_;
		_tmp55_ = failure;
		_tmp56_ = proton_plus_models_steam_restart_operation_result_get_target (_result_);
		_tmp57_ = _tmp56_;
		proton_plus_widgets_main_box_show_restart_message (self, _tmp55_, _tmp57_);
	}
	_g_object_unref0 (failure);
}

static Block15Data*
block15_data_ref (Block15Data* _data15_)
{
	g_atomic_int_inc (&_data15_->_ref_count_);
	return _data15_;
}

static void
block15_data_unref (void * _userdata_)
{
	Block15Data* _data15_;
	_data15_ = (Block15Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data15_->_ref_count_)) {
		ProtonPlusWidgetsMainBox* self;
		self = _data15_->self;
		_g_object_unref0 (_data15_->dialog);
		_g_object_unref0 (_data15_->target);
		_g_object_unref0 (self);
		g_slice_free (Block15Data, _data15_);
	}
}

static void
___lambda364_ (Block15Data* _data15_,
               const gchar* response)
{
	ProtonPlusWidgetsMainBox* self;
	self = _data15_->self;
	g_return_if_fail (response != NULL);
	if (g_strcmp0 (response, "retry") == 0) {
		proton_plus_widgets_main_box_start_steam_restart (self, _data15_->target);
	}
}

static void
____lambda364__adw_alert_dialog_response (AdwAlertDialog* _sender,
                                          const gchar* response,
                                          gpointer self)
{
	___lambda364_ (self, response);
}

static void
__lambda365_ (Block15Data* _data15_)
{
	ProtonPlusWidgetsMainBox* self;
	AdwDialog* _tmp0_;
	AdwAlertDialog* _tmp1_;
	self = _data15_->self;
	_tmp0_ = self->priv->active_restart_dialog;
	_tmp1_ = _data15_->dialog;
	if (_tmp0_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, adw_dialog_get_type (), AdwDialog)) {
		_g_object_unref0 (self->priv->active_restart_dialog);
		self->priv->active_restart_dialog = NULL;
	}
}

static void
___lambda365__adw_dialog_closed (AdwDialog* _sender,
                                 gpointer self)
{
	__lambda365_ (self);
}

static void
proton_plus_widgets_main_box_show_restart_message (ProtonPlusWidgetsMainBox* self,
                                                   ProtonPlusWidgetsMainSteamRestartMessage* message,
                                                   ProtonPlusModelsSteamRestartTarget* target)
{
	Block15Data* _data15_;
	ProtonPlusModelsSteamRestartTarget* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	AdwAlertDialog* _tmp5_;
	AdwAlertDialog* _tmp6_;
	AdwAlertDialog* _tmp7_;
	AdwAlertDialog* _tmp8_;
	gboolean _tmp9_;
	gboolean _tmp10_;
	AdwAlertDialog* _tmp14_;
	AdwDialog* _tmp15_;
	AdwAlertDialog* _tmp16_;
	AdwAlertDialog* _tmp17_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (message != NULL);
	g_return_if_fail (target != NULL);
	_data15_ = g_slice_new0 (Block15Data);
	_data15_->_ref_count_ = 1;
	_data15_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (target);
	_g_object_unref0 (_data15_->target);
	_data15_->target = _tmp0_;
	_tmp1_ = proton_plus_widgets_main_steam_restart_message_get_heading (message);
	_tmp2_ = _tmp1_;
	_tmp3_ = proton_plus_widgets_main_steam_restart_message_get_body (message);
	_tmp4_ = _tmp3_;
	_tmp5_ = (AdwAlertDialog*) adw_alert_dialog_new (_tmp2_, _tmp4_);
	g_object_ref_sink (_tmp5_);
	_data15_->dialog = _tmp5_;
	_tmp6_ = _data15_->dialog;
	adw_alert_dialog_add_response (_tmp6_, "later", _ ("Later"));
	_tmp7_ = _data15_->dialog;
	adw_alert_dialog_set_close_response (_tmp7_, "later");
	_tmp8_ = _data15_->dialog;
	adw_alert_dialog_set_default_response (_tmp8_, "later");
	_tmp9_ = proton_plus_widgets_main_steam_restart_message_get_can_retry (message);
	_tmp10_ = _tmp9_;
	if (_tmp10_) {
		AdwAlertDialog* _tmp11_;
		AdwAlertDialog* _tmp12_;
		AdwAlertDialog* _tmp13_;
		_tmp11_ = _data15_->dialog;
		adw_alert_dialog_add_response (_tmp11_, "retry", _ ("Try Again"));
		_tmp12_ = _data15_->dialog;
		adw_alert_dialog_set_response_appearance (_tmp12_, "retry", ADW_RESPONSE_SUGGESTED);
		_tmp13_ = _data15_->dialog;
		g_signal_connect_data (_tmp13_, "response", (GCallback) ____lambda364__adw_alert_dialog_response, block15_data_ref (_data15_), (GClosureNotify) block15_data_unref, 0);
	}
	_tmp14_ = _data15_->dialog;
	_tmp15_ = _g_object_ref0 ((AdwDialog*) _tmp14_);
	_g_object_unref0 (self->priv->active_restart_dialog);
	self->priv->active_restart_dialog = _tmp15_;
	_tmp16_ = _data15_->dialog;
	g_signal_connect_data ((AdwDialog*) _tmp16_, "closed", (GCallback) ___lambda365__adw_dialog_closed, block15_data_ref (_data15_), (GClosureNotify) block15_data_unref, 0);
	_tmp17_ = _data15_->dialog;
	proton_plus_widgets_window_present_dialog_for_controller ((AdwDialog*) _tmp17_, (GtkWidget*) self);
	block15_data_unref (_data15_);
	_data15_ = NULL;
}

static void
proton_plus_widgets_main_box_real_dispose (GObject* base)
{
	ProtonPlusWidgetsMainBox * self;
	AdwDialog* _tmp2_;
	ProtonPlusServicesSteamRestartManager* _tmp4_;
	ProtonPlusServicesSteamRestartOrchestrator* _tmp7_;
	self = (ProtonPlusWidgetsMainBox*) base;
	self->priv->view_switcher_bar_ready = FALSE;
	if (self->priv->tools_header_handler_id != ((gulong) 0)) {
		ProtonPlusWidgetsToolsBox* _tmp0_;
		_tmp0_ = self->priv->_tools_box;
		g_signal_handler_disconnect ((GObject*) _tmp0_, self->priv->tools_header_handler_id);
		self->priv->tools_header_handler_id = (gulong) 0;
	}
	if (self->priv->games_header_handler_id != ((gulong) 0)) {
		ProtonPlusWidgetsGamesBox* _tmp1_;
		_tmp1_ = self->priv->_games_box;
		g_signal_handler_disconnect ((GObject*) _tmp1_, self->priv->games_header_handler_id);
		self->priv->games_header_handler_id = (gulong) 0;
	}
	proton_plus_widgets_main_box_cancel_steam_restart (self);
	_tmp2_ = self->priv->active_restart_dialog;
	if (_tmp2_ != NULL) {
		AdwDialog* _tmp3_;
		_tmp3_ = self->priv->active_restart_dialog;
		adw_dialog_close (_tmp3_);
	}
	_g_object_unref0 (self->priv->active_restart_dialog);
	self->priv->active_restart_dialog = NULL;
	_tmp4_ = self->priv->restart_manager;
	if (_tmp4_ != NULL) {
		if (self->priv->pending_changed_handler_id != ((gulong) 0)) {
			ProtonPlusServicesSteamRestartManager* _tmp5_;
			_tmp5_ = self->priv->restart_manager;
			g_signal_handler_disconnect ((GObject*) _tmp5_, self->priv->pending_changed_handler_id);
		}
		if (self->priv->persistence_failed_handler_id != ((gulong) 0)) {
			ProtonPlusServicesSteamRestartManager* _tmp6_;
			_tmp6_ = self->priv->restart_manager;
			g_signal_handler_disconnect ((GObject*) _tmp6_, self->priv->persistence_failed_handler_id);
		}
	}
	_tmp7_ = self->priv->restart_orchestrator;
	if (_tmp7_ != NULL) {
		if (self->priv->state_changed_handler_id != ((gulong) 0)) {
			ProtonPlusServicesSteamRestartOrchestrator* _tmp8_;
			_tmp8_ = self->priv->restart_orchestrator;
			g_signal_handler_disconnect ((GObject*) _tmp8_, self->priv->state_changed_handler_id);
		}
		if (self->priv->operation_completed_handler_id != ((gulong) 0)) {
			ProtonPlusServicesSteamRestartOrchestrator* _tmp9_;
			_tmp9_ = self->priv->restart_orchestrator;
			g_signal_handler_disconnect ((GObject*) _tmp9_, self->priv->operation_completed_handler_id);
		}
	}
	G_OBJECT_CLASS (proton_plus_widgets_main_box_parent_class)->dispose ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_box_get_type (), GtkBox));
}

static void
proton_plus_widgets_main_box_check_for_updates_data_free (gpointer _data)
{
	ProtonPlusWidgetsMainBoxCheckForUpdatesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->launchers);
	_g_object_unref0 (_data_->self);
	g_slice_free (ProtonPlusWidgetsMainBoxCheckForUpdatesData, _data_);
}

void
proton_plus_widgets_main_box_check_for_updates (ProtonPlusWidgetsMainBox* self,
                                                GeeLinkedList* launchers,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_)
{
	ProtonPlusWidgetsMainBoxCheckForUpdatesData* _data_;
	ProtonPlusWidgetsMainBox* _tmp0_;
	GeeLinkedList* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (launchers != NULL);
	_data_ = g_slice_new0 (ProtonPlusWidgetsMainBoxCheckForUpdatesData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_widgets_main_box_check_for_updates_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (launchers);
	_g_object_unref0 (_data_->launchers);
	_data_->launchers = _tmp1_;
	proton_plus_widgets_main_box_check_for_updates_co (_data_);
}

void
proton_plus_widgets_main_box_check_for_updates_finish (ProtonPlusWidgetsMainBox* self,
                                                       GAsyncResult* _res_)
{
	ProtonPlusWidgetsMainBoxCheckForUpdatesData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
proton_plus_widgets_main_box_check_for_updates_ready (GObject* source_object,
                                                      GAsyncResult* _res_,
                                                      gpointer _user_data_)
{
	ProtonPlusWidgetsMainBoxCheckForUpdatesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_widgets_main_box_check_for_updates_co (_data_);
}

static void
_g_object_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}

static inline void
_g_list_free__g_object_unref0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) _g_object_unref0_);
}

static gboolean
proton_plus_widgets_main_box_check_for_updates_co (ProtonPlusWidgetsMainBoxCheckForUpdatesData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	proton_plus_widgets_main_box_send_toast (_data_->self, _ ("Checking for updates"));
	_data_->list = NULL;
	{
		_data_->_launcher_list = _data_->launchers;
		_data_->_tmp0_ = _data_->_launcher_list;
		_data_->_tmp1_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _data_->_tmp0_);
		_data_->_tmp2_ = _data_->_tmp1_;
		_data_->_launcher_size = _data_->_tmp2_;
		_data_->_launcher_index = -1;
		while (TRUE) {
			_data_->_launcher_index = _data_->_launcher_index + 1;
			_data_->_tmp3_ = _data_->_launcher_index;
			_data_->_tmp4_ = _data_->_launcher_size;
			if (!(_data_->_tmp3_ < _data_->_tmp4_)) {
				break;
			}
			_data_->_tmp5_ = _data_->_launcher_list;
			_data_->_tmp6_ = gee_abstract_list_get ((GeeAbstractList*) _data_->_tmp5_, _data_->_launcher_index);
			_data_->launcher = (ProtonPlusModelsLauncher*) _data_->_tmp6_;
			_data_->_tmp7_ = _data_->launcher;
			_data_->_tmp8_ = _g_object_ref0 (_data_->_tmp7_);
			_data_->list = g_list_append (_data_->list, _data_->_tmp8_);
			_g_object_unref0 (_data_->launcher);
		}
	}
	_data_->_tmp9_ = proton_plus_services_installation_service_get_instance ();
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_tmp11_ = _data_->list;
	_data_->_state_ = 1;
	proton_plus_services_installation_service_check_for_updates (_data_->_tmp10_, _data_->_tmp11_, proton_plus_widgets_main_box_check_for_updates_ready, _data_);
	return FALSE;
	_state_1:
	_data_->code = proton_plus_services_installation_service_check_for_updates_finish (_data_->_tmp10_, _data_->_res_);
	switch (_data_->code) {
		case PROTON_PLUS_RETURN_CODE_RUNNERS_IN_USE:
		{
			proton_plus_widgets_main_box_send_toast (_data_->self, _ ("Can't update while a game is running"));
			break;
		}
		case PROTON_PLUS_RETURN_CODE_NOTHING_TO_UPDATE:
		{
			proton_plus_widgets_main_box_send_toast (_data_->self, _ ("Nothing to update"));
			break;
		}
		case PROTON_PLUS_RETURN_CODE_RUNNERS_UPDATED:
		case PROTON_PLUS_RETURN_CODE_RUNNER_UPDATED:
		{
			proton_plus_widgets_main_box_send_toast (_data_->self, _ ("Everything is now up-to-date"));
			break;
		}
		default:
		{
			_data_->_tmp12_ = proton_plus_get_return_code_message (_data_->code);
			_data_->_tmp13_ = _data_->_tmp12_;
			_data_->_tmp14_ = g_strdup_printf (_ ("Couldn't check for updates (Reason: %s)"), _data_->_tmp13_);
			_data_->_tmp15_ = _data_->_tmp14_;
			proton_plus_widgets_main_box_send_toast (_data_->self, _data_->_tmp15_);
			_g_free0 (_data_->_tmp15_);
			_g_free0 (_data_->_tmp13_);
			break;
		}
	}
	(_data_->list == NULL) ? NULL : (_data_->list = (_g_list_free__g_object_unref0_ (_data_->list), NULL));
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
proton_plus_widgets_main_box_on_download_added (ProtonPlusWidgetsMainBox* self,
                                                ProtonPlusServicesInstallJob* job)
{
	ProtonPlusServicesInstallJobState _tmp0_;
	ProtonPlusServicesInstallJobState _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (job != NULL);
	_tmp0_ = proton_plus_services_install_job_get_state (job);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == PROTON_PLUS_SERVICES_INSTALL_JOB_STATE_BUSY_UPDATING) {
		gchar* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		_tmp2_ = proton_plus_services_install_job_get_displayed_title (job);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		proton_plus_widgets_main_box_send_notification (self, _ ("Update started"), _tmp4_, "folder-download-symbolic");
		_g_free0 (_tmp4_);
	} else {
		gchar* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		_tmp5_ = proton_plus_services_install_job_get_displayed_title (job);
		_tmp6_ = _tmp5_;
		_tmp7_ = _tmp6_;
		proton_plus_widgets_main_box_send_notification (self, _ ("Download started"), _tmp7_, "folder-download-symbolic");
		_g_free0 (_tmp7_);
	}
}

static void
proton_plus_widgets_main_box_on_download_finished (ProtonPlusWidgetsMainBox* self,
                                                   ProtonPlusServicesInstallJob* job,
                                                   gboolean success)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (job != NULL);
	if (success) {
		gchar* _tmp0_;
		gchar* _tmp1_;
		gchar* _tmp2_;
		_tmp0_ = proton_plus_services_install_job_get_displayed_title (job);
		_tmp1_ = _tmp0_;
		_tmp2_ = _tmp1_;
		proton_plus_widgets_main_box_send_notification (self, _ ("Download finished"), _tmp2_, "folder-download-symbolic");
		_g_free0 (_tmp2_);
	} else {
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp3_ = proton_plus_services_install_job_get_canceled (job);
		_tmp4_ = _tmp3_;
		if (_tmp4_) {
			gchar* _tmp5_;
			gchar* _tmp6_;
			gchar* _tmp7_;
			_tmp5_ = proton_plus_services_install_job_get_displayed_title (job);
			_tmp6_ = _tmp5_;
			_tmp7_ = _tmp6_;
			proton_plus_widgets_main_box_send_notification (self, _ ("Download canceled"), _tmp7_, "folder-download-symbolic");
			_g_free0 (_tmp7_);
		} else {
			gchar* body = NULL;
			gchar* _tmp8_;
			gchar* _tmp9_;
			gboolean _tmp10_ = FALSE;
			const gchar* _tmp11_;
			const gchar* _tmp12_;
			const gchar* _tmp21_;
			_tmp8_ = proton_plus_services_install_job_get_displayed_title (job);
			_tmp9_ = _tmp8_;
			body = _tmp9_;
			_tmp11_ = proton_plus_services_install_job_get_error_message (job);
			_tmp12_ = _tmp11_;
			if (_tmp12_ != NULL) {
				const gchar* _tmp13_;
				const gchar* _tmp14_;
				_tmp13_ = proton_plus_services_install_job_get_error_message (job);
				_tmp14_ = _tmp13_;
				_tmp10_ = g_strcmp0 (_tmp14_, "") != 0;
			} else {
				_tmp10_ = FALSE;
			}
			if (_tmp10_) {
				gchar* _tmp15_;
				gchar* _tmp16_;
				gchar* _tmp17_;
				const gchar* _tmp18_;
				const gchar* _tmp19_;
				gchar* _tmp20_;
				_tmp15_ = proton_plus_services_install_job_get_displayed_title (job);
				_tmp16_ = _tmp15_;
				_tmp17_ = _tmp16_;
				_tmp18_ = proton_plus_services_install_job_get_error_message (job);
				_tmp19_ = _tmp18_;
				_tmp20_ = g_strdup_printf ("%s (%s)", _tmp17_, _tmp19_);
				_g_free0 (body);
				body = _tmp20_;
				_g_free0 (_tmp17_);
			}
			_tmp21_ = body;
			proton_plus_widgets_main_box_send_background_notification (self, _ ("Download failed"), _tmp21_, "folder-download-symbolic");
			_g_free0 (body);
		}
	}
}

static void
proton_plus_widgets_main_box_send_background_notification (ProtonPlusWidgetsMainBox* self,
                                                           const gchar* title,
                                                           const gchar* body,
                                                           const gchar* icon)
{
	GtkWindow* window = NULL;
	GtkRoot* _tmp0_;
	GtkWindow* _tmp1_;
	gboolean _tmp2_ = FALSE;
	GtkWindow* _tmp3_;
	NotifyNotification* notification = NULL;
	NotifyNotification* _tmp7_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (title != NULL);
	g_return_if_fail (body != NULL);
	g_return_if_fail (icon != NULL);
	_tmp0_ = gtk_widget_get_root ((GtkWidget*) self);
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, gtk_window_get_type ()) ? ((GtkWindow*) _tmp0_) : NULL);
	window = _tmp1_;
	_tmp3_ = window;
	if (_tmp3_ != NULL) {
		GtkWindow* _tmp4_;
		gboolean _tmp5_;
		gboolean _tmp6_;
		_tmp4_ = window;
		g_object_get (_tmp4_, "is-active", &_tmp5_, NULL);
		_tmp6_ = _tmp5_;
		_tmp2_ = _tmp6_;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		_g_object_unref0 (window);
		return;
	}
	_tmp7_ = notify_notification_new (title, body, icon);
	notification = _tmp7_;
	{
		NotifyNotification* _tmp8_;
		_tmp8_ = notification;
		notify_notification_show (_tmp8_, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		GError* _tmp9_;
		const gchar* _tmp10_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp9_ = _error_;
		_tmp10_ = _tmp9_->message;
		g_warning ("main-box.vala:389: Unable to show notification: %s", _tmp10_);
		_g_error_free0 (_error_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (notification);
		_g_object_unref0 (window);
		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;
	}
	_g_object_unref0 (notification);
	_g_object_unref0 (window);
}

static void
proton_plus_widgets_main_box_on_tool_updated (ProtonPlusWidgetsMainBox* self,
                                              ProtonPlusServicesInstallJob* job,
                                              gboolean updated)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (job != NULL);
	if (updated) {
		gchar* _tmp0_;
		gchar* _tmp1_;
		gchar* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		_tmp0_ = proton_plus_services_install_job_get_displayed_title (job);
		_tmp1_ = _tmp0_;
		_tmp2_ = _tmp1_;
		_tmp3_ = g_strdup_printf (_ ("%s is now up-to-date"), _tmp2_);
		_tmp4_ = _tmp3_;
		proton_plus_widgets_main_box_send_notification (self, _ ("Update finished"), _tmp4_, "folder-download-symbolic");
		_g_free0 (_tmp4_);
		_g_free0 (_tmp2_);
	} else {
		gchar* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
		_tmp5_ = proton_plus_services_install_job_get_displayed_title (job);
		_tmp6_ = _tmp5_;
		_tmp7_ = _tmp6_;
		_tmp8_ = g_strdup_printf (_ ("%s is already up-to-date"), _tmp7_);
		_tmp9_ = _tmp8_;
		proton_plus_widgets_main_box_send_notification (self, _ ("Update finished"), _tmp9_, "folder-download-symbolic");
		_g_free0 (_tmp9_);
		_g_free0 (_tmp7_);
	}
}

static void
proton_plus_widgets_main_box_on_tool_removed (ProtonPlusWidgetsMainBox* self,
                                              ProtonPlusServicesInstallJob* job)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (job != NULL);
	_tmp0_ = proton_plus_services_install_job_get_displayed_title (job);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	proton_plus_widgets_main_box_send_notification (self, _ ("Deleted"), _tmp2_, "user-trash-symbolic");
	_g_free0 (_tmp2_);
}

static void
proton_plus_widgets_main_box_send_notification (ProtonPlusWidgetsMainBox* self,
                                                const gchar* title,
                                                const gchar* body,
                                                const gchar* icon)
{
	GtkWindow* window = NULL;
	GtkRoot* _tmp0_;
	GtkWindow* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gboolean _tmp4_ = FALSE;
	GtkWindow* _tmp5_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (title != NULL);
	g_return_if_fail (body != NULL);
	g_return_if_fail (icon != NULL);
	_tmp0_ = gtk_widget_get_root ((GtkWidget*) self);
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, gtk_window_get_type ()) ? ((GtkWindow*) _tmp0_) : NULL);
	window = _tmp1_;
	_tmp2_ = g_strdup_printf ("%s: %s", title, body);
	_tmp3_ = _tmp2_;
	proton_plus_widgets_main_box_send_toast (self, _tmp3_);
	_g_free0 (_tmp3_);
	_tmp5_ = window;
	if (_tmp5_ == NULL) {
		_tmp4_ = TRUE;
	} else {
		GtkWindow* _tmp6_;
		gboolean _tmp7_;
		gboolean _tmp8_;
		_tmp6_ = window;
		g_object_get (_tmp6_, "is-active", &_tmp7_, NULL);
		_tmp8_ = _tmp7_;
		_tmp4_ = !_tmp8_;
	}
	if (_tmp4_) {
		NotifyNotification* notification = NULL;
		NotifyNotification* _tmp9_;
		_tmp9_ = notify_notification_new (title, body, icon);
		notification = _tmp9_;
		{
			NotifyNotification* _tmp10_;
			_tmp10_ = notification;
			notify_notification_show (_tmp10_, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
		}
		goto __finally0;
		__catch0_g_error:
		{
			GError* e = NULL;
			GError* _tmp11_;
			const gchar* _tmp12_;
			e = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp11_ = e;
			_tmp12_ = _tmp11_->message;
			g_warning ("main-box.vala:415: Failed to send notification: %s", _tmp12_);
			_g_error_free0 (e);
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (notification);
			_g_object_unref0 (window);
			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;
		}
		_g_object_unref0 (notification);
	}
	_g_object_unref0 (window);
}

static void
proton_plus_widgets_main_box_view_stack_visible_child_name_changed (ProtonPlusWidgetsMainBox* self)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GQuark _tmp3_ = 0U;
	static GQuark _tmp2_label0 = 0;
	static GQuark _tmp2_label1 = 0;
	static GQuark _tmp2_label2 = 0;
	AdwViewStack* _tmp7_;
	const gchar* _tmp8_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_previous_view_name;
	_tmp1_ = _tmp0_;
	_tmp3_ = (NULL == _tmp1_) ? 0 : g_quark_from_string (_tmp1_);
	if (_tmp3_ == ((0 != _tmp2_label0) ? _tmp2_label0 : (_tmp2_label0 = g_quark_from_static_string ("tools")))) {
		switch (0) {
			default:
			{
				ProtonPlusWidgetsToolsBox* _tmp4_;
				_tmp4_ = self->priv->_tools_box;
				proton_plus_widgets_tools_box_show_groups_page (_tmp4_);
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label1) ? _tmp2_label1 : (_tmp2_label1 = g_quark_from_static_string ("games")))) {
		switch (0) {
			default:
			{
				ProtonPlusWidgetsGamesBox* _tmp5_;
				_tmp5_ = self->priv->_games_box;
				proton_plus_widgets_games_box_show_games_list_page (_tmp5_);
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label2) ? _tmp2_label2 : (_tmp2_label2 = g_quark_from_static_string ("mangohud")))) {
		switch (0) {
			default:
			{
				ProtonPlusWidgetsMangoHudBox* _tmp6_;
				_tmp6_ = self->priv->_mangohud_box;
				proton_plus_widgets_mango_hud_box_show_presets_page (_tmp6_);
				break;
			}
		}
	}
	_tmp7_ = self->priv->_view_stack;
	_tmp8_ = adw_view_stack_get_visible_child_name (_tmp7_);
	proton_plus_widgets_main_box_set_previous_view_name (self, _tmp8_);
	proton_plus_widgets_main_box_update_header_presentation (self);
	g_signal_emit (self, proton_plus_widgets_main_box_signals[PROTON_PLUS_WIDGETS_MAIN_BOX_SEARCH_AVAILABILITY_CHANGED_SIGNAL], 0, proton_plus_widgets_main_box_search_available (self));
}

static void
proton_plus_widgets_main_box_update_header_presentation (ProtonPlusWidgetsMainBox* self)
{
	ProtonPlusWidgetsHeaderPresentation* presentation = NULL;
	AdwViewStack* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	GQuark _tmp4_ = 0U;
	static GQuark _tmp3_label0 = 0;
	static GQuark _tmp3_label1 = 0;
	ProtonPlusWidgetsHeaderPresentation* _tmp9_;
	ProtonPlusWidgetsHeaderPresentation* _tmp10_;
	ProtonPlusWidgetsHeaderPresentation* _tmp11_;
	g_return_if_fail (self != NULL);
	presentation = NULL;
	_tmp0_ = self->priv->_view_stack;
	_tmp1_ = adw_view_stack_get_visible_child_name (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp4_ = (NULL == _tmp2_) ? 0 : g_quark_from_string (_tmp2_);
	if (_tmp4_ == ((0 != _tmp3_label0) ? _tmp3_label0 : (_tmp3_label0 = g_quark_from_static_string ("tools")))) {
		switch (0) {
			default:
			{
				ProtonPlusWidgetsToolsBox* _tmp5_;
				ProtonPlusWidgetsHeaderPresentation* _tmp6_;
				_tmp5_ = self->priv->_tools_box;
				_tmp6_ = proton_plus_widgets_tools_box_get_header_presentation (_tmp5_);
				_g_object_unref0 (presentation);
				presentation = _tmp6_;
				break;
			}
		}
	} else if (_tmp4_ == ((0 != _tmp3_label1) ? _tmp3_label1 : (_tmp3_label1 = g_quark_from_static_string ("games")))) {
		switch (0) {
			default:
			{
				ProtonPlusWidgetsGamesBox* _tmp7_;
				ProtonPlusWidgetsHeaderPresentation* _tmp8_;
				_tmp7_ = self->priv->_games_box;
				_tmp8_ = proton_plus_widgets_games_box_get_header_presentation (_tmp7_);
				_g_object_unref0 (presentation);
				presentation = _tmp8_;
				break;
			}
		}
	}
	_tmp9_ = presentation;
	_tmp10_ = _g_object_ref0 (_tmp9_);
	_g_object_unref0 (self->priv->current_header_presentation);
	self->priv->current_header_presentation = _tmp10_;
	proton_plus_widgets_main_box_update_view_switcher_bar (self);
	_tmp11_ = presentation;
	g_signal_emit (self, proton_plus_widgets_main_box_signals[PROTON_PLUS_WIDGETS_MAIN_BOX_HEADER_PRESENTATION_CHANGED_SIGNAL], 0, _tmp11_);
	_g_object_unref0 (presentation);
}

static void
proton_plus_widgets_main_box_update_view_switcher_bar (ProtonPlusWidgetsMainBox* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	gboolean _tmp2_;
	AdwViewSwitcherBar* _tmp4_;
	g_return_if_fail (self != NULL);
	if (!self->priv->view_switcher_bar_ready) {
		return;
	}
	_tmp1_ = proton_plus_widgets_main_box_get_narrow_navigation (self);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		ProtonPlusWidgetsHeaderPresentation* _tmp3_;
		_tmp3_ = self->priv->current_header_presentation;
		_tmp0_ = _tmp3_ == NULL;
	} else {
		_tmp0_ = FALSE;
	}
	_tmp4_ = self->priv->_view_switcher_bar;
	adw_view_switcher_bar_set_reveal (_tmp4_, _tmp0_);
}

static void
proton_plus_widgets_main_box_reset_visible_page (ProtonPlusWidgetsMainBox* self)
{
	AdwViewStack* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	GQuark _tmp4_ = 0U;
	static GQuark _tmp3_label0 = 0;
	static GQuark _tmp3_label1 = 0;
	static GQuark _tmp3_label2 = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_view_stack;
	_tmp1_ = adw_view_stack_get_visible_child_name (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp4_ = (NULL == _tmp2_) ? 0 : g_quark_from_string (_tmp2_);
	if (_tmp4_ == ((0 != _tmp3_label0) ? _tmp3_label0 : (_tmp3_label0 = g_quark_from_static_string ("tools")))) {
		switch (0) {
			default:
			{
				ProtonPlusWidgetsToolsBox* _tmp5_;
				_tmp5_ = self->priv->_tools_box;
				proton_plus_widgets_tools_box_show_groups_page (_tmp5_);
				break;
			}
		}
	} else if (_tmp4_ == ((0 != _tmp3_label1) ? _tmp3_label1 : (_tmp3_label1 = g_quark_from_static_string ("games")))) {
		switch (0) {
			default:
			{
				ProtonPlusWidgetsGamesBox* _tmp6_;
				_tmp6_ = self->priv->_games_box;
				proton_plus_widgets_games_box_show_games_list_page (_tmp6_);
				break;
			}
		}
	} else if (_tmp4_ == ((0 != _tmp3_label2) ? _tmp3_label2 : (_tmp3_label2 = g_quark_from_static_string ("mangohud")))) {
		switch (0) {
			default:
			{
				ProtonPlusWidgetsMangoHudBox* _tmp7_;
				_tmp7_ = self->priv->_mangohud_box;
				proton_plus_widgets_mango_hud_box_show_presets_page (_tmp7_);
				break;
			}
		}
	}
}

static ProtonPlusUtilsControllerNavigationHost*
proton_plus_widgets_main_box_get_visible_controller_host (ProtonPlusWidgetsMainBox* self)
{
	AdwViewStack* _tmp0_;
	GtkWidget* _tmp1_;
	ProtonPlusUtilsControllerNavigationHost* _tmp2_;
	ProtonPlusUtilsControllerNavigationHost* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_view_stack;
	_tmp1_ = adw_view_stack_get_visible_child (_tmp0_);
	_tmp2_ = _g_object_ref0 (PROTON_PLUS_UTILS_IS_CONTROLLER_NAVIGATION_HOST (_tmp1_) ? ((ProtonPlusUtilsControllerNavigationHost*) _tmp1_) : NULL);
	result = _tmp2_;
	return result;
}

static gchar*
proton_plus_widgets_main_box_real_get_controller_page_id (ProtonPlusUtilsControllerNavigationHost* base)
{
	ProtonPlusWidgetsMainBox * self;
	ProtonPlusUtilsControllerNavigationHost* host = NULL;
	ProtonPlusUtilsControllerNavigationHost* _tmp0_;
	ProtonPlusUtilsControllerNavigationHost* _tmp1_;
	const gchar* _tmp4_ = NULL;
	AdwViewStack* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* result;
	self = (ProtonPlusWidgetsMainBox*) base;
	_tmp0_ = proton_plus_widgets_main_box_get_visible_controller_host (self);
	host = _tmp0_;
	_tmp1_ = host;
	if (_tmp1_ != NULL) {
		ProtonPlusUtilsControllerNavigationHost* _tmp2_;
		gchar* _tmp3_;
		_tmp2_ = host;
		_tmp3_ = proton_plus_utils_controller_navigation_host_get_controller_page_id (_tmp2_);
		result = _tmp3_;
		_g_object_unref0 (host);
		return result;
	}
	_tmp5_ = self->priv->_view_stack;
	_tmp6_ = adw_view_stack_get_visible_child_name (_tmp5_);
	_tmp4_ = _tmp6_;
	if (_tmp4_ == NULL) {
		_tmp4_ = "unknown";
	}
	_tmp7_ = g_strdup_printf ("main:%s", _tmp4_);
	result = _tmp7_;
	_g_object_unref0 (host);
	return result;
}

static GObject*
proton_plus_widgets_main_box_real_get_controller_page_root (ProtonPlusUtilsControllerNavigationHost* base)
{
	ProtonPlusWidgetsMainBox * self;
	ProtonPlusUtilsControllerNavigationHost* host = NULL;
	ProtonPlusUtilsControllerNavigationHost* _tmp0_;
	ProtonPlusUtilsControllerNavigationHost* _tmp1_;
	AdwViewStack* _tmp4_;
	GtkWidget* _tmp5_;
	GObject* _tmp6_;
	GObject* result;
	self = (ProtonPlusWidgetsMainBox*) base;
	_tmp0_ = proton_plus_widgets_main_box_get_visible_controller_host (self);
	host = _tmp0_;
	_tmp1_ = host;
	if (_tmp1_ != NULL) {
		ProtonPlusUtilsControllerNavigationHost* _tmp2_;
		GObject* _tmp3_;
		_tmp2_ = host;
		_tmp3_ = proton_plus_utils_controller_navigation_host_get_controller_page_root (_tmp2_);
		result = _tmp3_;
		_g_object_unref0 (host);
		return result;
	}
	_tmp4_ = self->priv->_view_stack;
	_tmp5_ = adw_view_stack_get_visible_child (_tmp4_);
	_tmp6_ = _g_object_ref0 ((GObject*) _tmp5_);
	result = _tmp6_;
	_g_object_unref0 (host);
	return result;
}

static GObject*
proton_plus_widgets_main_box_real_get_controller_initial_focus (ProtonPlusUtilsControllerNavigationHost* base)
{
	ProtonPlusWidgetsMainBox * self;
	ProtonPlusUtilsControllerNavigationHost* host = NULL;
	ProtonPlusUtilsControllerNavigationHost* _tmp0_;
	ProtonPlusUtilsControllerNavigationHost* _tmp1_ = NULL;
	ProtonPlusUtilsControllerNavigationHost* _tmp2_;
	GObject* _tmp3_ = NULL;
	GObject* _tmp5_;
	GObject* result;
	self = (ProtonPlusWidgetsMainBox*) base;
	_tmp0_ = proton_plus_widgets_main_box_get_visible_controller_host (self);
	host = _tmp0_;
	_tmp2_ = host;
	_tmp1_ = _tmp2_;
	_tmp3_ = NULL;
	if (_tmp1_ != NULL) {
		GObject* _tmp4_;
		_tmp4_ = proton_plus_utils_controller_navigation_host_get_controller_initial_focus (_tmp1_);
		_g_object_unref0 (_tmp3_);
		_tmp3_ = _tmp4_;
	}
	_tmp5_ = _tmp3_;
	_tmp3_ = NULL;
	result = _tmp5_;
	_g_object_unref0 (_tmp3_);
	_g_object_unref0 (host);
	return result;
}

static gboolean
proton_plus_widgets_main_box_real_controller_navigate_back (ProtonPlusUtilsControllerNavigationHost* base)
{
	ProtonPlusWidgetsMainBox * self;
	ProtonPlusUtilsControllerNavigationHost* host = NULL;
	ProtonPlusUtilsControllerNavigationHost* _tmp0_;
	gboolean _tmp1_ = FALSE;
	ProtonPlusUtilsControllerNavigationHost* _tmp2_;
	gboolean result;
	self = (ProtonPlusWidgetsMainBox*) base;
	_tmp0_ = proton_plus_widgets_main_box_get_visible_controller_host (self);
	host = _tmp0_;
	_tmp2_ = host;
	if (_tmp2_ != NULL) {
		ProtonPlusUtilsControllerNavigationHost* _tmp3_;
		_tmp3_ = host;
		_tmp1_ = proton_plus_utils_controller_navigation_host_controller_navigate_back (_tmp3_);
	} else {
		_tmp1_ = FALSE;
	}
	result = _tmp1_;
	_g_object_unref0 (host);
	return result;
}

static gboolean
proton_plus_widgets_main_box_real_controller_can_navigate_back (ProtonPlusUtilsControllerNavigationHost* base)
{
	ProtonPlusWidgetsMainBox * self;
	ProtonPlusUtilsControllerNavigationHost* host = NULL;
	ProtonPlusUtilsControllerNavigationHost* _tmp0_;
	gboolean _tmp1_ = FALSE;
	ProtonPlusUtilsControllerNavigationHost* _tmp2_;
	gboolean result;
	self = (ProtonPlusWidgetsMainBox*) base;
	_tmp0_ = proton_plus_widgets_main_box_get_visible_controller_host (self);
	host = _tmp0_;
	_tmp2_ = host;
	if (_tmp2_ != NULL) {
		ProtonPlusUtilsControllerNavigationHost* _tmp3_;
		_tmp3_ = host;
		_tmp1_ = proton_plus_utils_controller_navigation_host_controller_can_navigate_back (_tmp3_);
	} else {
		_tmp1_ = FALSE;
	}
	result = _tmp1_;
	_g_object_unref0 (host);
	return result;
}

static gboolean
proton_plus_widgets_main_box_real_controller_can_switch_page (ProtonPlusUtilsControllerNavigationHost* base)
{
	ProtonPlusWidgetsMainBox * self;
	GtkSelectionModel* model = NULL;
	AdwViewStack* _tmp0_;
	GtkSelectionModel* _tmp1_;
	GtkSelectionModel* _tmp2_;
	gint visible_count = 0;
	gboolean result;
	self = (ProtonPlusWidgetsMainBox*) base;
	_tmp0_ = self->priv->_view_stack;
	_tmp1_ = adw_view_stack_get_pages (_tmp0_);
	_tmp2_ = _tmp1_;
	model = _tmp2_;
	visible_count = 0;
	{
		guint i = 0U;
		i = (guint) 0;
		{
			gboolean _tmp3_ = FALSE;
			_tmp3_ = TRUE;
			while (TRUE) {
				GtkSelectionModel* _tmp5_;
				AdwViewStackPage* page = NULL;
				GtkSelectionModel* _tmp6_;
				GObject* _tmp7_;
				AdwViewStackPage* _tmp8_;
				gboolean _tmp9_;
				gboolean _tmp10_;
				if (!_tmp3_) {
					guint _tmp4_;
					_tmp4_ = i;
					i = _tmp4_ + 1;
				}
				_tmp3_ = FALSE;
				_tmp5_ = model;
				if (!(i < g_list_model_get_n_items ((GListModel*) _tmp5_))) {
					break;
				}
				_tmp6_ = model;
				_tmp7_ = g_list_model_get_item ((GListModel*) _tmp6_, i);
				page = G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, adw_view_stack_page_get_type (), AdwViewStackPage);
				_tmp8_ = page;
				_tmp9_ = adw_view_stack_page_get_visible (_tmp8_);
				_tmp10_ = _tmp9_;
				if (_tmp10_) {
					gint _tmp11_;
					_tmp11_ = visible_count;
					visible_count = _tmp11_ + 1;
				}
				_g_object_unref0 (page);
			}
		}
	}
	result = visible_count >= 2;
	_g_object_unref0 (model);
	return result;
}

static gboolean
proton_plus_widgets_main_box_real_controller_prefers_initial_focus_after_switch (ProtonPlusUtilsControllerNavigationHost* base)
{
	ProtonPlusWidgetsMainBox * self;
	gchar* page = NULL;
	AdwViewStack* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gboolean _tmp3_ = FALSE;
	const gchar* _tmp4_;
	gboolean result;
	self = (ProtonPlusWidgetsMainBox*) base;
	_tmp0_ = self->priv->_view_stack;
	_tmp1_ = adw_view_stack_get_visible_child_name (_tmp0_);
	_tmp2_ = g_strdup (_tmp1_);
	page = _tmp2_;
	_tmp4_ = page;
	if (g_strcmp0 (_tmp4_, "games") == 0) {
		_tmp3_ = TRUE;
	} else {
		const gchar* _tmp5_;
		_tmp5_ = page;
		_tmp3_ = g_strcmp0 (_tmp5_, "tools") == 0;
	}
	result = _tmp3_;
	_g_free0 (page);
	return result;
}

static gboolean
proton_plus_widgets_main_box_real_controller_switch_page (ProtonPlusUtilsControllerNavigationHost* base,
                                                          gint delta)
{
	ProtonPlusWidgetsMainBox * self;
	GtkSelectionModel* model = NULL;
	AdwViewStack* _tmp0_;
	GtkSelectionModel* _tmp1_;
	GtkSelectionModel* _tmp2_;
	gint count = 0;
	GtkSelectionModel* _tmp3_;
	gchar* current = NULL;
	AdwViewStack* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gint current_index = 0;
	gboolean result;
	self = (ProtonPlusWidgetsMainBox*) base;
	_tmp0_ = self->priv->_view_stack;
	_tmp1_ = adw_view_stack_get_pages (_tmp0_);
	_tmp2_ = _tmp1_;
	model = _tmp2_;
	_tmp3_ = model;
	count = (gint) g_list_model_get_n_items ((GListModel*) _tmp3_);
	if (count < 2) {
		result = FALSE;
		_g_object_unref0 (model);
		return result;
	}
	_tmp4_ = self->priv->_view_stack;
	_tmp5_ = adw_view_stack_get_visible_child_name (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = g_strdup (_tmp6_);
	current = _tmp7_;
	current_index = 0;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp8_ = FALSE;
			_tmp8_ = TRUE;
			while (TRUE) {
				AdwViewStackPage* page = NULL;
				GtkSelectionModel* _tmp10_;
				GObject* _tmp11_;
				AdwViewStackPage* _tmp12_;
				const gchar* _tmp13_;
				const gchar* _tmp14_;
				const gchar* _tmp15_;
				if (!_tmp8_) {
					gint _tmp9_;
					_tmp9_ = i;
					i = _tmp9_ + 1;
				}
				_tmp8_ = FALSE;
				if (!(i < count)) {
					break;
				}
				_tmp10_ = model;
				_tmp11_ = g_list_model_get_item ((GListModel*) _tmp10_, (guint) i);
				page = G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, adw_view_stack_page_get_type (), AdwViewStackPage);
				_tmp12_ = page;
				_tmp13_ = adw_view_stack_page_get_name (_tmp12_);
				_tmp14_ = _tmp13_;
				_tmp15_ = current;
				if (g_strcmp0 (_tmp14_, _tmp15_) == 0) {
					current_index = i;
					_g_object_unref0 (page);
					break;
				}
				_g_object_unref0 (page);
			}
		}
	}
	{
		gint step = 0;
		step = 1;
		{
			gboolean _tmp16_ = FALSE;
			_tmp16_ = TRUE;
			while (TRUE) {
				gint index = 0;
				AdwViewStackPage* page = NULL;
				GtkSelectionModel* _tmp18_;
				GObject* _tmp19_;
				gboolean _tmp20_ = FALSE;
				AdwViewStackPage* _tmp21_;
				gboolean _tmp22_;
				gboolean _tmp23_;
				if (!_tmp16_) {
					gint _tmp17_;
					_tmp17_ = step;
					step = _tmp17_ + 1;
				}
				_tmp16_ = FALSE;
				if (!(step <= count)) {
					break;
				}
				index = (((current_index + (delta * step)) % count) + count) % count;
				_tmp18_ = model;
				_tmp19_ = g_list_model_get_item ((GListModel*) _tmp18_, (guint) index);
				page = G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, adw_view_stack_page_get_type (), AdwViewStackPage);
				_tmp21_ = page;
				_tmp22_ = adw_view_stack_page_get_visible (_tmp21_);
				_tmp23_ = _tmp22_;
				if (_tmp23_) {
					AdwViewStackPage* _tmp24_;
					const gchar* _tmp25_;
					const gchar* _tmp26_;
					const gchar* _tmp27_;
					_tmp24_ = page;
					_tmp25_ = adw_view_stack_page_get_name (_tmp24_);
					_tmp26_ = _tmp25_;
					_tmp27_ = current;
					_tmp20_ = g_strcmp0 (_tmp26_, _tmp27_) != 0;
				} else {
					_tmp20_ = FALSE;
				}
				if (_tmp20_) {
					AdwViewStack* _tmp28_;
					AdwViewStackPage* _tmp29_;
					const gchar* _tmp30_;
					const gchar* _tmp31_;
					_tmp28_ = self->priv->_view_stack;
					_tmp29_ = page;
					_tmp30_ = adw_view_stack_page_get_name (_tmp29_);
					_tmp31_ = _tmp30_;
					adw_view_stack_set_visible_child_name (_tmp28_, _tmp31_);
					result = TRUE;
					_g_object_unref0 (page);
					_g_free0 (current);
					_g_object_unref0 (model);
					return result;
				}
				_g_object_unref0 (page);
			}
		}
	}
	result = FALSE;
	_g_free0 (current);
	_g_object_unref0 (model);
	return result;
}

static ProtonPlusUtilsControllerPageShortcuts*
proton_plus_widgets_main_box_get_visible_controller_shortcuts (ProtonPlusWidgetsMainBox* self)
{
	AdwViewStack* _tmp0_;
	GtkWidget* _tmp1_;
	ProtonPlusUtilsControllerPageShortcuts* _tmp2_;
	ProtonPlusUtilsControllerPageShortcuts* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_view_stack;
	_tmp1_ = adw_view_stack_get_visible_child (_tmp0_);
	_tmp2_ = _g_object_ref0 (PROTON_PLUS_UTILS_IS_CONTROLLER_PAGE_SHORTCUTS (_tmp1_) ? ((ProtonPlusUtilsControllerPageShortcuts*) _tmp1_) : NULL);
	result = _tmp2_;
	return result;
}

static gboolean
proton_plus_widgets_main_box_real_controller_can_open_search (ProtonPlusUtilsControllerPageShortcuts* base)
{
	ProtonPlusWidgetsMainBox * self;
	ProtonPlusUtilsControllerPageShortcuts* shortcuts = NULL;
	ProtonPlusUtilsControllerPageShortcuts* _tmp0_;
	gboolean _tmp1_ = FALSE;
	ProtonPlusUtilsControllerPageShortcuts* _tmp2_;
	gboolean result;
	self = (ProtonPlusWidgetsMainBox*) base;
	_tmp0_ = proton_plus_widgets_main_box_get_visible_controller_shortcuts (self);
	shortcuts = _tmp0_;
	_tmp2_ = shortcuts;
	if (_tmp2_ != NULL) {
		ProtonPlusUtilsControllerPageShortcuts* _tmp3_;
		_tmp3_ = shortcuts;
		_tmp1_ = proton_plus_utils_controller_page_shortcuts_controller_can_open_search (_tmp3_);
	} else {
		_tmp1_ = FALSE;
	}
	result = _tmp1_;
	_g_object_unref0 (shortcuts);
	return result;
}

static gboolean
proton_plus_widgets_main_box_real_controller_can_open_filter (ProtonPlusUtilsControllerPageShortcuts* base)
{
	ProtonPlusWidgetsMainBox * self;
	ProtonPlusUtilsControllerPageShortcuts* shortcuts = NULL;
	ProtonPlusUtilsControllerPageShortcuts* _tmp0_;
	gboolean _tmp1_ = FALSE;
	ProtonPlusUtilsControllerPageShortcuts* _tmp2_;
	gboolean result;
	self = (ProtonPlusWidgetsMainBox*) base;
	_tmp0_ = proton_plus_widgets_main_box_get_visible_controller_shortcuts (self);
	shortcuts = _tmp0_;
	_tmp2_ = shortcuts;
	if (_tmp2_ != NULL) {
		ProtonPlusUtilsControllerPageShortcuts* _tmp3_;
		_tmp3_ = shortcuts;
		_tmp1_ = proton_plus_utils_controller_page_shortcuts_controller_can_open_filter (_tmp3_);
	} else {
		_tmp1_ = FALSE;
	}
	result = _tmp1_;
	_g_object_unref0 (shortcuts);
	return result;
}

static gboolean
proton_plus_widgets_main_box_real_controller_open_search (ProtonPlusUtilsControllerPageShortcuts* base)
{
	ProtonPlusWidgetsMainBox * self;
	ProtonPlusUtilsControllerPageShortcuts* shortcuts = NULL;
	ProtonPlusUtilsControllerPageShortcuts* _tmp0_;
	gboolean _tmp1_ = FALSE;
	ProtonPlusUtilsControllerPageShortcuts* _tmp2_;
	gboolean result;
	self = (ProtonPlusWidgetsMainBox*) base;
	_tmp0_ = proton_plus_widgets_main_box_get_visible_controller_shortcuts (self);
	shortcuts = _tmp0_;
	_tmp2_ = shortcuts;
	if (_tmp2_ != NULL) {
		ProtonPlusUtilsControllerPageShortcuts* _tmp3_;
		_tmp3_ = shortcuts;
		_tmp1_ = proton_plus_utils_controller_page_shortcuts_controller_open_search (_tmp3_);
	} else {
		_tmp1_ = FALSE;
	}
	result = _tmp1_;
	_g_object_unref0 (shortcuts);
	return result;
}

gboolean
proton_plus_widgets_main_box_search_available (ProtonPlusWidgetsMainBox* self)
{
	AdwViewStack* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	GQuark _tmp4_ = 0U;
	static GQuark _tmp3_label0 = 0;
	static GQuark _tmp3_label1 = 0;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_view_stack;
	_tmp1_ = adw_view_stack_get_visible_child_name (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp4_ = (NULL == _tmp2_) ? 0 : g_quark_from_string (_tmp2_);
	if (_tmp4_ == ((0 != _tmp3_label0) ? _tmp3_label0 : (_tmp3_label0 = g_quark_from_static_string ("tools")))) {
		switch (0) {
			default:
			{
				ProtonPlusWidgetsToolsBox* _tmp5_;
				_tmp5_ = self->priv->_tools_box;
				result = proton_plus_widgets_tools_box_search_available (_tmp5_);
				return result;
			}
		}
	} else if (_tmp4_ == ((0 != _tmp3_label1) ? _tmp3_label1 : (_tmp3_label1 = g_quark_from_static_string ("games")))) {
		switch (0) {
			default:
			{
				ProtonPlusWidgetsGamesBox* _tmp6_;
				_tmp6_ = self->priv->_games_box;
				result = proton_plus_widgets_games_box_search_available (_tmp6_);
				return result;
			}
		}
	} else {
		switch (0) {
			default:
			{
				result = FALSE;
				return result;
			}
		}
	}
}

static gboolean
proton_plus_widgets_main_box_real_controller_open_filter (ProtonPlusUtilsControllerPageShortcuts* base)
{
	ProtonPlusWidgetsMainBox * self;
	ProtonPlusUtilsControllerPageShortcuts* shortcuts = NULL;
	ProtonPlusUtilsControllerPageShortcuts* _tmp0_;
	gboolean _tmp1_ = FALSE;
	ProtonPlusUtilsControllerPageShortcuts* _tmp2_;
	gboolean result;
	self = (ProtonPlusWidgetsMainBox*) base;
	_tmp0_ = proton_plus_widgets_main_box_get_visible_controller_shortcuts (self);
	shortcuts = _tmp0_;
	_tmp2_ = shortcuts;
	if (_tmp2_ != NULL) {
		ProtonPlusUtilsControllerPageShortcuts* _tmp3_;
		_tmp3_ = shortcuts;
		_tmp1_ = proton_plus_utils_controller_page_shortcuts_controller_open_filter (_tmp3_);
	} else {
		_tmp1_ = FALSE;
	}
	result = _tmp1_;
	_g_object_unref0 (shortcuts);
	return result;
}

AdwViewStack*
proton_plus_widgets_main_box_get_view_stack (ProtonPlusWidgetsMainBox* self)
{
	AdwViewStack* result;
	AdwViewStack* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_view_stack;
	result = _tmp0_;
	return result;
}

void
proton_plus_widgets_main_box_set_view_stack (ProtonPlusWidgetsMainBox* self,
                                             AdwViewStack* value)
{
	AdwViewStack* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_main_box_get_view_stack (self);
	if (old_value != value) {
		AdwViewStack* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_view_stack);
		self->priv->_view_stack = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_main_box_properties[PROTON_PLUS_WIDGETS_MAIN_BOX_VIEW_STACK_PROPERTY]);
	}
}

AdwViewSwitcher*
proton_plus_widgets_main_box_get_view_switcher (ProtonPlusWidgetsMainBox* self)
{
	AdwViewSwitcher* result;
	AdwViewSwitcher* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_view_switcher;
	result = _tmp0_;
	return result;
}

void
proton_plus_widgets_main_box_set_view_switcher (ProtonPlusWidgetsMainBox* self,
                                                AdwViewSwitcher* value)
{
	AdwViewSwitcher* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_main_box_get_view_switcher (self);
	if (old_value != value) {
		AdwViewSwitcher* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_view_switcher);
		self->priv->_view_switcher = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_main_box_properties[PROTON_PLUS_WIDGETS_MAIN_BOX_VIEW_SWITCHER_PROPERTY]);
	}
}

AdwViewSwitcherBar*
proton_plus_widgets_main_box_get_view_switcher_bar (ProtonPlusWidgetsMainBox* self)
{
	AdwViewSwitcherBar* result;
	AdwViewSwitcherBar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_view_switcher_bar;
	result = _tmp0_;
	return result;
}

void
proton_plus_widgets_main_box_set_view_switcher_bar (ProtonPlusWidgetsMainBox* self,
                                                    AdwViewSwitcherBar* value)
{
	AdwViewSwitcherBar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_main_box_get_view_switcher_bar (self);
	if (old_value != value) {
		AdwViewSwitcherBar* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_view_switcher_bar);
		self->priv->_view_switcher_bar = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_main_box_properties[PROTON_PLUS_WIDGETS_MAIN_BOX_VIEW_SWITCHER_BAR_PROPERTY]);
	}
}

static AdwToastOverlay*
proton_plus_widgets_main_box_get_toast_overlay (ProtonPlusWidgetsMainBox* self)
{
	AdwToastOverlay* result;
	AdwToastOverlay* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_toast_overlay;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_main_box_set_toast_overlay (ProtonPlusWidgetsMainBox* self,
                                                AdwToastOverlay* value)
{
	AdwToastOverlay* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_toast_overlay);
	self->priv->_toast_overlay = _tmp0_;
}

static const gchar*
proton_plus_widgets_main_box_get_previous_view_name (ProtonPlusWidgetsMainBox* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_previous_view_name;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_main_box_set_previous_view_name (ProtonPlusWidgetsMainBox* self,
                                                     const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_previous_view_name);
	self->priv->_previous_view_name = _tmp0_;
}

static const gchar*
proton_plus_widgets_main_box_get_view_switcher_pressed_page (ProtonPlusWidgetsMainBox* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_view_switcher_pressed_page;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_main_box_set_view_switcher_pressed_page (ProtonPlusWidgetsMainBox* self,
                                                             const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_view_switcher_pressed_page);
	self->priv->_view_switcher_pressed_page = _tmp0_;
}

static ProtonPlusWidgetsToolsBox*
proton_plus_widgets_main_box_get_tools_box (ProtonPlusWidgetsMainBox* self)
{
	ProtonPlusWidgetsToolsBox* result;
	ProtonPlusWidgetsToolsBox* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_tools_box;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_main_box_set_tools_box (ProtonPlusWidgetsMainBox* self,
                                            ProtonPlusWidgetsToolsBox* value)
{
	ProtonPlusWidgetsToolsBox* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_tools_box);
	self->priv->_tools_box = _tmp0_;
}

static ProtonPlusWidgetsGamesBox*
proton_plus_widgets_main_box_get_games_box (ProtonPlusWidgetsMainBox* self)
{
	ProtonPlusWidgetsGamesBox* result;
	ProtonPlusWidgetsGamesBox* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_games_box;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_main_box_set_games_box (ProtonPlusWidgetsMainBox* self,
                                            ProtonPlusWidgetsGamesBox* value)
{
	ProtonPlusWidgetsGamesBox* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_games_box);
	self->priv->_games_box = _tmp0_;
}

static ProtonPlusWidgetsMangoHudBox*
proton_plus_widgets_main_box_get_mangohud_box (ProtonPlusWidgetsMainBox* self)
{
	ProtonPlusWidgetsMangoHudBox* result;
	ProtonPlusWidgetsMangoHudBox* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_mangohud_box;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_main_box_set_mangohud_box (ProtonPlusWidgetsMainBox* self,
                                               ProtonPlusWidgetsMangoHudBox* value)
{
	ProtonPlusWidgetsMangoHudBox* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_mangohud_box);
	self->priv->_mangohud_box = _tmp0_;
}

gboolean
proton_plus_widgets_main_box_get_narrow_navigation (ProtonPlusWidgetsMainBox* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_narrow_navigation;
	return result;
}

void
proton_plus_widgets_main_box_set_narrow_navigation (ProtonPlusWidgetsMainBox* self,
                                                    gboolean value)
{
	g_return_if_fail (self != NULL);
	if (self->priv->_narrow_navigation == value) {
		return;
	}
	self->priv->_narrow_navigation = value;
	proton_plus_widgets_main_box_update_view_switcher_bar (self);
	g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_main_box_properties[PROTON_PLUS_WIDGETS_MAIN_BOX_NARROW_NAVIGATION_PROPERTY]);
}

static void
proton_plus_widgets_main_box_class_init (ProtonPlusWidgetsMainBoxClass * klass,
                                         gpointer klass_data)
{
	proton_plus_widgets_main_box_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsMainBox_private_offset);
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) proton_plus_widgets_main_box_real_dispose;
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_widgets_main_box_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_widgets_main_box_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_main_box_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_MAIN_BOX_VIEW_STACK_PROPERTY, proton_plus_widgets_main_box_properties[PROTON_PLUS_WIDGETS_MAIN_BOX_VIEW_STACK_PROPERTY] = g_param_spec_object ("view-stack", "view-stack", "view-stack", adw_view_stack_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_MAIN_BOX_VIEW_SWITCHER_PROPERTY, proton_plus_widgets_main_box_properties[PROTON_PLUS_WIDGETS_MAIN_BOX_VIEW_SWITCHER_PROPERTY] = g_param_spec_object ("view-switcher", "view-switcher", "view-switcher", adw_view_switcher_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_MAIN_BOX_VIEW_SWITCHER_BAR_PROPERTY, proton_plus_widgets_main_box_properties[PROTON_PLUS_WIDGETS_MAIN_BOX_VIEW_SWITCHER_BAR_PROPERTY] = g_param_spec_object ("view-switcher-bar", "view-switcher-bar", "view-switcher-bar", adw_view_switcher_bar_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_MAIN_BOX_NARROW_NAVIGATION_PROPERTY, proton_plus_widgets_main_box_properties[PROTON_PLUS_WIDGETS_MAIN_BOX_NARROW_NAVIGATION_PROPERTY] = g_param_spec_boolean ("narrow-navigation", "narrow-navigation", "narrow-navigation", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	proton_plus_widgets_main_box_signals[PROTON_PLUS_WIDGETS_MAIN_BOX_HEADER_PRESENTATION_CHANGED_SIGNAL] = g_signal_new ("header-presentation-changed", PROTON_PLUS_WIDGETS_MAIN_TYPE_BOX, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, PROTON_PLUS_WIDGETS_HEADER_TYPE_PRESENTATION);
	proton_plus_widgets_main_box_signals[PROTON_PLUS_WIDGETS_MAIN_BOX_SEARCH_AVAILABILITY_CHANGED_SIGNAL] = g_signal_new ("search-availability-changed", PROTON_PLUS_WIDGETS_MAIN_TYPE_BOX, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
}

static void
proton_plus_widgets_main_box_proton_plus_utils_controller_navigation_host_interface_init (ProtonPlusUtilsControllerNavigationHostIface * iface,
                                                                                          gpointer iface_data)
{
	proton_plus_widgets_main_box_proton_plus_utils_controller_navigation_host_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_controller_page_id = (gchar* (*) (ProtonPlusUtilsControllerNavigationHost*)) proton_plus_widgets_main_box_real_get_controller_page_id;
	iface->get_controller_page_root = (GObject* (*) (ProtonPlusUtilsControllerNavigationHost*)) proton_plus_widgets_main_box_real_get_controller_page_root;
	iface->get_controller_initial_focus = (GObject* (*) (ProtonPlusUtilsControllerNavigationHost*)) proton_plus_widgets_main_box_real_get_controller_initial_focus;
	iface->controller_navigate_back = (gboolean (*) (ProtonPlusUtilsControllerNavigationHost*)) proton_plus_widgets_main_box_real_controller_navigate_back;
	iface->controller_can_navigate_back = (gboolean (*) (ProtonPlusUtilsControllerNavigationHost*)) proton_plus_widgets_main_box_real_controller_can_navigate_back;
	iface->controller_can_switch_page = (gboolean (*) (ProtonPlusUtilsControllerNavigationHost*)) proton_plus_widgets_main_box_real_controller_can_switch_page;
	iface->controller_prefers_initial_focus_after_switch = (gboolean (*) (ProtonPlusUtilsControllerNavigationHost*)) proton_plus_widgets_main_box_real_controller_prefers_initial_focus_after_switch;
	iface->controller_switch_page = (gboolean (*) (ProtonPlusUtilsControllerNavigationHost*, gint)) proton_plus_widgets_main_box_real_controller_switch_page;
}

static void
proton_plus_widgets_main_box_proton_plus_utils_controller_page_shortcuts_interface_init (ProtonPlusUtilsControllerPageShortcutsIface * iface,
                                                                                         gpointer iface_data)
{
	proton_plus_widgets_main_box_proton_plus_utils_controller_page_shortcuts_parent_iface = g_type_interface_peek_parent (iface);
	iface->controller_can_open_search = (gboolean (*) (ProtonPlusUtilsControllerPageShortcuts*)) proton_plus_widgets_main_box_real_controller_can_open_search;
	iface->controller_can_open_filter = (gboolean (*) (ProtonPlusUtilsControllerPageShortcuts*)) proton_plus_widgets_main_box_real_controller_can_open_filter;
	iface->controller_open_search = (gboolean (*) (ProtonPlusUtilsControllerPageShortcuts*)) proton_plus_widgets_main_box_real_controller_open_search;
	iface->controller_open_filter = (gboolean (*) (ProtonPlusUtilsControllerPageShortcuts*)) proton_plus_widgets_main_box_real_controller_open_filter;
}

static void
proton_plus_widgets_main_box_instance_init (ProtonPlusWidgetsMainBox * self,
                                            gpointer klass)
{
	self->priv = proton_plus_widgets_main_box_get_instance_private (self);
	self->priv->previous_restart_count = (guint) 0;
	self->priv->pending_changed_handler_id = (gulong) 0;
	self->priv->persistence_failed_handler_id = (gulong) 0;
	self->priv->state_changed_handler_id = (gulong) 0;
	self->priv->operation_completed_handler_id = (gulong) 0;
	self->priv->restart_cancellable = NULL;
	self->priv->active_restart_dialog = NULL;
	self->priv->persistence_toast_shown = FALSE;
	self->priv->load_warning_shown = FALSE;
	self->priv->tools_header_handler_id = (gulong) 0;
	self->priv->games_header_handler_id = (gulong) 0;
	self->priv->view_switcher_bar_ready = FALSE;
	self->priv->_narrow_navigation = FALSE;
}

static void
proton_plus_widgets_main_box_finalize (GObject * obj)
{
	ProtonPlusWidgetsMainBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_MAIN_TYPE_BOX, ProtonPlusWidgetsMainBox);
	_g_object_unref0 (self->priv->_view_stack);
	_g_object_unref0 (self->priv->_view_switcher);
	_g_object_unref0 (self->priv->_view_switcher_bar);
	_g_object_unref0 (self->priv->_toast_overlay);
	_g_free0 (self->priv->_previous_view_name);
	_g_free0 (self->priv->_view_switcher_pressed_page);
	_g_object_unref0 (self->priv->_tools_box);
	_g_object_unref0 (self->priv->_games_box);
	_g_object_unref0 (self->priv->_mangohud_box);
	_g_object_unref0 (self->priv->restart_manager);
	_g_object_unref0 (self->priv->restart_orchestrator);
	_g_object_unref0 (self->priv->restart_banner);
	_g_object_unref0 (self->priv->restart_toasts);
	_g_object_unref0 (self->priv->restart_notifications);
	_g_object_unref0 (self->priv->restart_cancellable);
	_g_object_unref0 (self->priv->active_restart_dialog);
	_g_object_unref0 (self->priv->current_header_presentation);
	G_OBJECT_CLASS (proton_plus_widgets_main_box_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_main_box_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsMainBoxClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_main_box_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsMainBox), 0, (GInstanceInitFunc) proton_plus_widgets_main_box_instance_init, NULL };
	static const GInterfaceInfo proton_plus_utils_controller_navigation_host_info = { (GInterfaceInitFunc) proton_plus_widgets_main_box_proton_plus_utils_controller_navigation_host_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo proton_plus_utils_controller_page_shortcuts_info = { (GInterfaceInitFunc) proton_plus_widgets_main_box_proton_plus_utils_controller_page_shortcuts_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType proton_plus_widgets_main_box_type_id;
	proton_plus_widgets_main_box_type_id = g_type_register_static (gtk_box_get_type (), "ProtonPlusWidgetsMainBox", &g_define_type_info, 0);
	g_type_add_interface_static (proton_plus_widgets_main_box_type_id, PROTON_PLUS_UTILS_TYPE_CONTROLLER_NAVIGATION_HOST, &proton_plus_utils_controller_navigation_host_info);
	g_type_add_interface_static (proton_plus_widgets_main_box_type_id, PROTON_PLUS_UTILS_TYPE_CONTROLLER_PAGE_SHORTCUTS, &proton_plus_utils_controller_page_shortcuts_info);
	ProtonPlusWidgetsMainBox_private_offset = g_type_add_instance_private (proton_plus_widgets_main_box_type_id, sizeof (ProtonPlusWidgetsMainBoxPrivate));
	return proton_plus_widgets_main_box_type_id;
}

GType
proton_plus_widgets_main_box_get_type (void)
{
	static volatile gsize proton_plus_widgets_main_box_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_main_box_type_id__once)) {
		GType proton_plus_widgets_main_box_type_id;
		proton_plus_widgets_main_box_type_id = proton_plus_widgets_main_box_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_main_box_type_id__once, proton_plus_widgets_main_box_type_id);
	}
	return proton_plus_widgets_main_box_type_id__once;
}

static void
_vala_proton_plus_widgets_main_box_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec)
{
	ProtonPlusWidgetsMainBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_MAIN_TYPE_BOX, ProtonPlusWidgetsMainBox);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_MAIN_BOX_VIEW_STACK_PROPERTY:
		g_value_set_object (value, proton_plus_widgets_main_box_get_view_stack (self));
		break;
		case PROTON_PLUS_WIDGETS_MAIN_BOX_VIEW_SWITCHER_PROPERTY:
		g_value_set_object (value, proton_plus_widgets_main_box_get_view_switcher (self));
		break;
		case PROTON_PLUS_WIDGETS_MAIN_BOX_VIEW_SWITCHER_BAR_PROPERTY:
		g_value_set_object (value, proton_plus_widgets_main_box_get_view_switcher_bar (self));
		break;
		case PROTON_PLUS_WIDGETS_MAIN_BOX_NARROW_NAVIGATION_PROPERTY:
		g_value_set_boolean (value, proton_plus_widgets_main_box_get_narrow_navigation (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_widgets_main_box_set_property (GObject * object,
                                                 guint property_id,
                                                 const GValue * value,
                                                 GParamSpec * pspec)
{
	ProtonPlusWidgetsMainBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_MAIN_TYPE_BOX, ProtonPlusWidgetsMainBox);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_MAIN_BOX_VIEW_STACK_PROPERTY:
		proton_plus_widgets_main_box_set_view_stack (self, g_value_get_object (value));
		break;
		case PROTON_PLUS_WIDGETS_MAIN_BOX_VIEW_SWITCHER_PROPERTY:
		proton_plus_widgets_main_box_set_view_switcher (self, g_value_get_object (value));
		break;
		case PROTON_PLUS_WIDGETS_MAIN_BOX_VIEW_SWITCHER_BAR_PROPERTY:
		proton_plus_widgets_main_box_set_view_switcher_bar (self, g_value_get_object (value));
		break;
		case PROTON_PLUS_WIDGETS_MAIN_BOX_NARROW_NAVIGATION_PROPERTY:
		proton_plus_widgets_main_box_set_narrow_navigation (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

