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

#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <glib.h>
#include "protonplus_core.h"
#include <gio/gio.h>
#include <glib-object.h>
#include <libnotify/notify.h>
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <adwaita.h>
#include <gee.h>
#include <glib/gi18n-lib.h>

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

enum  {
	PROTON_PLUS_WIDGETS_APPLICATION_0_PROPERTY,
	PROTON_PLUS_WIDGETS_APPLICATION_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_application_properties[PROTON_PLUS_WIDGETS_APPLICATION_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_INTRODUCTION (proton_plus_widgets_introduction_introduction_get_type ())
#define PROTON_PLUS_WIDGETS_INTRODUCTION_INTRODUCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_INTRODUCTION, ProtonPlusWidgetsIntroductionIntroduction))
#define PROTON_PLUS_WIDGETS_INTRODUCTION_INTRODUCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_INTRODUCTION, ProtonPlusWidgetsIntroductionIntroductionClass))
#define PROTON_PLUS_WIDGETS_INTRODUCTION_IS_INTRODUCTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_INTRODUCTION))
#define PROTON_PLUS_WIDGETS_INTRODUCTION_IS_INTRODUCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_INTRODUCTION))
#define PROTON_PLUS_WIDGETS_INTRODUCTION_INTRODUCTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_INTRODUCTION_TYPE_INTRODUCTION, ProtonPlusWidgetsIntroductionIntroductionClass))

typedef struct _ProtonPlusWidgetsIntroductionIntroduction ProtonPlusWidgetsIntroductionIntroduction;
typedef struct _ProtonPlusWidgetsIntroductionIntroductionClass ProtonPlusWidgetsIntroductionIntroductionClass;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))

struct _ProtonPlusWidgetsApplicationPrivate {
	ProtonPlusWidgetsPreferencesPreferencesDialog* active_preferences_dialog;
	gboolean reopen_preferences_after_close;
	ProtonPlusServicesMigrationsManager* migration_manager;
	ProtonPlusServicesSteamSessionService* steam_session_service;
	ProtonPlusServicesSteamRestartManager* steam_restart_manager;
	ProtonPlusServicesSteamRestartOrchestrator* steam_restart_orchestrator;
	ProtonPlusServicesSteamConfigurationService* steam_configuration_service;
	gboolean show_introduction;
};

static gint ProtonPlusWidgetsApplication_private_offset;
static gpointer proton_plus_widgets_application_parent_class = NULL;

static void proton_plus_widgets_application_real_activate (GApplication* base);
static void proton_plus_widgets_application_present_introduction (ProtonPlusWidgetsApplication* self,
                                                           ProtonPlusWidgetsWindow* window);
static void proton_plus_widgets_application_real_startup (GApplication* base);
static void _proton_plus_utils_system_systemd_handler_g_settings_changed (GSettings* _sender,
                                                                   const gchar* key,
                                                                   gpointer self);
static void _proton_plus_utils_web_update_proxy_settings_g_settings_changed (GSettings* _sender,
                                                                      const gchar* key,
                                                                      gpointer self);
static void proton_plus_widgets_application_real_shutdown (GApplication* base);
static void proton_plus_widgets_application_on_introduction_action (ProtonPlusWidgetsApplication* self);
VALA_EXTERN GType proton_plus_widgets_introduction_introduction_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ProtonPlusWidgetsIntroductionIntroduction* proton_plus_widgets_introduction_introduction_new (void);
VALA_EXTERN ProtonPlusWidgetsIntroductionIntroduction* proton_plus_widgets_introduction_introduction_construct (GType object_type);
static void proton_plus_widgets_application_on_report_action (ProtonPlusWidgetsApplication* self);
static void proton_plus_widgets_application_on_preferences_action (ProtonPlusWidgetsApplication* self);
static void proton_plus_widgets_application_on_preferences_dialog_closed (ProtonPlusWidgetsApplication* self);
static void _proton_plus_widgets_application_on_preferences_dialog_closed_adw_dialog_closed (AdwDialog* _sender,
                                                                                      gpointer self);
static void proton_plus_widgets_application_on_donate_action (ProtonPlusWidgetsApplication* self);
static void proton_plus_widgets_application_on_reload_action (ProtonPlusWidgetsApplication* self);
static void proton_plus_widgets_application_on_quit_action (ProtonPlusWidgetsApplication* self);
static void proton_plus_widgets_application_on_about_action (ProtonPlusWidgetsApplication* self);
static gchar* proton_plus_widgets_application_get_copyright (void);
static GObject * proton_plus_widgets_application_constructor (GType type,
                                                       guint n_construct_properties,
                                                       GObjectConstructParam * construct_properties);
static void _proton_plus_widgets_application_on_report_action_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                         GVariant* parameter,
                                                                                         gpointer self);
static void _proton_plus_widgets_application_on_preferences_action_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                              GVariant* parameter,
                                                                                              gpointer self);
static void _proton_plus_widgets_application_on_about_action_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                        GVariant* parameter,
                                                                                        gpointer self);
static void _proton_plus_widgets_application_on_donate_action_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                         GVariant* parameter,
                                                                                         gpointer self);
static void _proton_plus_widgets_application_on_reload_action_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                         GVariant* parameter,
                                                                                         gpointer self);
static void _proton_plus_widgets_application_on_introduction_action_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                               GVariant* parameter,
                                                                                               gpointer self);
static void _proton_plus_widgets_application_on_language_change_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                           GVariant* parameter,
                                                                                           gpointer self);
static void _proton_plus_widgets_application_on_quit_action_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                       GVariant* parameter,
                                                                                       gpointer self);
static void proton_plus_widgets_application_finalize (GObject * obj);
static GType proton_plus_widgets_application_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static inline gpointer
proton_plus_widgets_application_get_instance_private (ProtonPlusWidgetsApplication* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsApplication_private_offset);
}

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

static void
proton_plus_widgets_application_real_activate (GApplication* base)
{
	ProtonPlusWidgetsApplication * self;
	ProtonPlusWidgetsWindow* window = NULL;
	GtkWindow* _tmp0_;
	GtkWindow* _tmp1_;
	ProtonPlusWidgetsWindow* _tmp2_;
	ProtonPlusWidgetsWindow* _tmp3_;
	ProtonPlusServicesSteamRestartManager* _tmp5_;
	ProtonPlusServicesSteamRestartOrchestrator* _tmp6_;
	ProtonPlusWidgetsWindow* _tmp7_;
	GSettings* _tmp8_;
	ProtonPlusWidgetsWindow* _tmp9_;
	GSettings* _tmp10_;
	ProtonPlusWidgetsWindow* _tmp11_;
	GSettings* _tmp12_;
	ProtonPlusWidgetsWindow* _tmp13_;
	GSettings* _tmp14_;
	ProtonPlusWidgetsWindow* _tmp15_;
	ProtonPlusWidgetsWindow* _tmp16_;
	ProtonPlusServicesMigrationsManager* _tmp18_;
	self = (ProtonPlusWidgetsApplication*) base;
	G_APPLICATION_CLASS (proton_plus_widgets_application_parent_class)->activate ((GApplication*) G_TYPE_CHECK_INSTANCE_CAST (self, adw_application_get_type (), AdwApplication));
	_tmp0_ = gtk_application_get_active_window ((GtkApplication*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_IS_WINDOW (_tmp1_) ? ((ProtonPlusWidgetsWindow*) _tmp1_) : NULL);
	window = _tmp2_;
	_tmp3_ = window;
	if (_tmp3_ != NULL) {
		ProtonPlusWidgetsWindow* _tmp4_;
		_tmp4_ = window;
		gtk_window_present ((GtkWindow*) _tmp4_);
		_g_object_unref0 (window);
		return;
	}
	_tmp5_ = self->priv->steam_restart_manager;
	_tmp6_ = self->priv->steam_restart_orchestrator;
	_tmp7_ = proton_plus_widgets_window_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, PROTON_PLUS_SERVICES_TYPE_STEAM_RESTART_MANAGER, ProtonPlusServicesSteamRestartManager), G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, PROTON_PLUS_SERVICES_TYPE_STEAM_RESTART_ORCHESTRATOR, ProtonPlusServicesSteamRestartOrchestrator));
	g_object_ref_sink (_tmp7_);
	_g_object_unref0 (window);
	window = _tmp7_;
	_tmp8_ = proton_plus_globals_SETTINGS;
	_tmp9_ = window;
	g_settings_bind (_tmp8_, "width", (GObject*) _tmp9_, "default-width", G_SETTINGS_BIND_DEFAULT);
	_tmp10_ = proton_plus_globals_SETTINGS;
	_tmp11_ = window;
	g_settings_bind (_tmp10_, "height", (GObject*) _tmp11_, "default-height", G_SETTINGS_BIND_DEFAULT);
	_tmp12_ = proton_plus_globals_SETTINGS;
	_tmp13_ = window;
	g_settings_bind (_tmp12_, "is-maximized", (GObject*) _tmp13_, "maximized", G_SETTINGS_BIND_DEFAULT);
	_tmp14_ = proton_plus_globals_SETTINGS;
	_tmp15_ = window;
	g_settings_bind (_tmp14_, "is-fullscreen", (GObject*) _tmp15_, "fullscreened", G_SETTINGS_BIND_DEFAULT);
	_tmp16_ = window;
	gtk_window_present ((GtkWindow*) _tmp16_);
	if (self->priv->show_introduction) {
		ProtonPlusWidgetsWindow* _tmp17_;
		self->priv->show_introduction = FALSE;
		_tmp17_ = window;
		proton_plus_widgets_application_present_introduction (self, _tmp17_);
	}
	_tmp18_ = self->priv->migration_manager;
	if (_tmp18_ != NULL) {
		ProtonPlusServicesMigrationsManager* _tmp19_;
		ProtonPlusWidgetsWindow* _tmp20_;
		ProtonPlusServicesMigrationsMigrationContext* _tmp21_;
		ProtonPlusServicesMigrationsMigrationContext* _tmp22_;
		_tmp19_ = self->priv->migration_manager;
		_tmp20_ = window;
		_tmp21_ = proton_plus_services_migrations_migration_context_new (_tmp20_);
		_tmp22_ = _tmp21_;
		proton_plus_services_migrations_manager_post_migrate (_tmp19_, _tmp22_);
		_g_object_unref0 (_tmp22_);
		_g_object_unref0 (self->priv->migration_manager);
		self->priv->migration_manager = NULL;
	}
	_g_object_unref0 (window);
}

static void
_proton_plus_utils_system_systemd_handler_g_settings_changed (GSettings* _sender,
                                                              const gchar* key,
                                                              gpointer self)
{
	proton_plus_utils_system_systemd_handler ();
}

static void
_proton_plus_utils_web_update_proxy_settings_g_settings_changed (GSettings* _sender,
                                                                 const gchar* key,
                                                                 gpointer self)
{
	proton_plus_utils_web_update_proxy_settings ();
}

static void
proton_plus_widgets_application_real_startup (GApplication* base)
{
	ProtonPlusWidgetsApplication * self;
	GdkDisplay* display = NULL;
	GdkDisplay* _tmp0_;
	GdkDisplay* _tmp1_;
	GtkIconTheme* _tmp2_;
	GtkCssProvider* provider = NULL;
	GtkCssProvider* _tmp3_;
	GtkCssProvider* status_provider = NULL;
	GtkCssProvider* _tmp4_;
	ProtonPlusServicesSteamSessionService* _tmp5_;
	ProtonPlusServicesSteamSessionService* _tmp6_;
	ProtonPlusServicesSteamRestartStateStore* _tmp7_;
	ProtonPlusServicesSteamRestartStateStore* _tmp8_;
	ProtonPlusServicesSteamRestartManager* _tmp9_;
	ProtonPlusServicesSteamSessionService* _tmp10_;
	ProtonPlusServicesSteamRestartManager* _tmp11_;
	ProtonPlusServicesSteamConfigurationService* _tmp12_;
	ProtonPlusServicesSteamRestartManager* _tmp13_;
	ProtonPlusServicesSteamConfigurationService* _tmp14_;
	ProtonPlusServicesSteamConfigurationService* _tmp15_;
	ProtonPlusServicesSteamSessionService* _tmp16_;
	ProtonPlusServicesSteamRestartManager* _tmp17_;
	ProtonPlusServicesSteamConfigurationService* _tmp18_;
	ProtonPlusServicesSteamRestartOrchestrator* _tmp19_;
	ProtonPlusServicesInstallationService* _tmp20_;
	ProtonPlusServicesInstallationService* _tmp21_;
	ProtonPlusServicesSteamRestartManager* _tmp22_;
	ProtonPlusServicesSteamRestartManager* _tmp23_;
	GSettings* _tmp24_;
	self = (ProtonPlusWidgetsApplication*) base;
	G_APPLICATION_CLASS (proton_plus_widgets_application_parent_class)->startup ((GApplication*) G_TYPE_CHECK_INSTANCE_CAST (self, adw_application_get_type (), AdwApplication));
	_tmp0_ = gdk_display_get_default ();
	_tmp1_ = _g_object_ref0 (_tmp0_);
	display = _tmp1_;
	_tmp2_ = gtk_icon_theme_get_for_display (display);
	gtk_icon_theme_add_resource_path (_tmp2_, "/com/vysp3r/ProtonPlus/icons");
	_tmp3_ = gtk_css_provider_new ();
	provider = _tmp3_;
	gtk_css_provider_load_from_resource (provider, "/com/vysp3r/ProtonPlus/style.css");
	gtk_style_context_add_provider_for_display (display, (GtkStyleProvider*) provider, (guint) GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
	_tmp4_ = gtk_css_provider_new ();
	status_provider = _tmp4_;
	gtk_css_provider_load_from_resource (status_provider, "/com/vysp3r/ProtonPlus/status.css");
	gtk_style_context_add_provider_for_display (display, (GtkStyleProvider*) status_provider, (guint) (GTK_STYLE_PROVIDER_PRIORITY_APPLICATION + 2));
	proton_plus_globals_load ();
	proton_plus_globals_setupLanguage ();
	notify_init (APP_NAME);
	_tmp5_ = proton_plus_services_steam_session_service_new (NULL);
	_g_object_unref0 (self->priv->steam_session_service);
	self->priv->steam_session_service = _tmp5_;
	_tmp6_ = self->priv->steam_session_service;
	_tmp7_ = proton_plus_services_steam_restart_state_store_new (NULL);
	_tmp8_ = _tmp7_;
	_tmp9_ = proton_plus_services_steam_restart_manager_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, PROTON_PLUS_SERVICES_TYPE_STEAM_SESSION_SERVICE, ProtonPlusServicesSteamSessionService), _tmp8_, NULL);
	_g_object_unref0 (self->priv->steam_restart_manager);
	self->priv->steam_restart_manager = _tmp9_;
	_g_object_unref0 (_tmp8_);
	_tmp10_ = self->priv->steam_session_service;
	_tmp11_ = self->priv->steam_restart_manager;
	_tmp12_ = proton_plus_services_steam_configuration_service_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, PROTON_PLUS_SERVICES_TYPE_STEAM_SESSION_SERVICE, ProtonPlusServicesSteamSessionService), G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, PROTON_PLUS_SERVICES_TYPE_STEAM_RESTART_MANAGER, ProtonPlusServicesSteamRestartManager), NULL);
	_g_object_unref0 (self->priv->steam_configuration_service);
	self->priv->steam_configuration_service = _tmp12_;
	_tmp13_ = self->priv->steam_restart_manager;
	_tmp14_ = self->priv->steam_configuration_service;
	proton_plus_services_steam_restart_manager_configure_configuration_reconciler (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, PROTON_PLUS_SERVICES_TYPE_STEAM_RESTART_MANAGER, ProtonPlusServicesSteamRestartManager), (ProtonPlusServicesSteamConfigurationReconciler*) G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, PROTON_PLUS_SERVICES_TYPE_STEAM_CONFIGURATION_SERVICE, ProtonPlusServicesSteamConfigurationService));
	_tmp15_ = self->priv->steam_configuration_service;
	proton_plus_services_steam_configuration_service_configure (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, PROTON_PLUS_SERVICES_TYPE_STEAM_CONFIGURATION_SERVICE, ProtonPlusServicesSteamConfigurationService));
	_tmp16_ = self->priv->steam_session_service;
	_tmp17_ = self->priv->steam_restart_manager;
	_tmp18_ = self->priv->steam_configuration_service;
	_tmp19_ = proton_plus_services_steam_restart_orchestrator_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, PROTON_PLUS_SERVICES_TYPE_STEAM_SESSION_SERVICE, ProtonPlusServicesSteamSessionService), G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, PROTON_PLUS_SERVICES_TYPE_STEAM_RESTART_MANAGER, ProtonPlusServicesSteamRestartManager), NULL, (guint) 500, (guint) 40, (guint) 60, (ProtonPlusServicesSteamConfigurationReconciler*) G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, PROTON_PLUS_SERVICES_TYPE_STEAM_CONFIGURATION_SERVICE, ProtonPlusServicesSteamConfigurationService));
	_g_object_unref0 (self->priv->steam_restart_orchestrator);
	self->priv->steam_restart_orchestrator = _tmp19_;
	_tmp20_ = proton_plus_services_installation_service_get_instance ();
	_tmp21_ = _tmp20_;
	_tmp22_ = self->priv->steam_restart_manager;
	proton_plus_services_installation_service_configure_steam_change_recorder (_tmp21_, (ProtonPlusServicesSteamChangeRecorder*) G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, PROTON_PLUS_SERVICES_TYPE_STEAM_RESTART_MANAGER, ProtonPlusServicesSteamRestartManager));
	_tmp23_ = self->priv->steam_restart_manager;
	proton_plus_services_steam_restart_manager_start_observation (_tmp23_);
	_tmp24_ = proton_plus_globals_SETTINGS;
	if (_tmp24_ != NULL) {
		ProtonPlusServicesMigrationsManager* _tmp25_;
		ProtonPlusServicesMigrationsManager* _tmp26_;
		GSettings* _tmp27_;
		ProtonPlusUtilsThemeManager* _tmp29_;
		ProtonPlusUtilsThemeManager* _tmp30_;
		GSettings* _tmp31_;
		GSettings* _tmp32_;
		GSettings* _tmp33_;
		GSettings* _tmp34_;
		GSettings* _tmp35_;
		ProtonPlusUtilsDownloadManager* _tmp36_;
		ProtonPlusUtilsDownloadManager* _tmp37_;
		_tmp25_ = proton_plus_services_migrations_manager_new ();
		_g_object_unref0 (self->priv->migration_manager);
		self->priv->migration_manager = _tmp25_;
		_tmp26_ = self->priv->migration_manager;
		proton_plus_services_migrations_manager_check_and_migrate_sync (_tmp26_, APP_VERSION);
		_tmp27_ = proton_plus_globals_SETTINGS;
		self->priv->show_introduction = g_settings_get_boolean (_tmp27_, "first-run");
		if (self->priv->show_introduction) {
			GSettings* _tmp28_;
			_tmp28_ = proton_plus_globals_SETTINGS;
			g_settings_set_boolean (_tmp28_, "first-run", FALSE);
		}
		_tmp29_ = proton_plus_utils_theme_manager_get_default ();
		_tmp30_ = _tmp29_;
		proton_plus_utils_theme_manager_apply_theme (_tmp30_);
		_g_object_unref0 (_tmp30_);
		_tmp31_ = proton_plus_globals_SETTINGS;
		g_signal_connect (_tmp31_, "changed::check-updates-on-boot", (GCallback) _proton_plus_utils_system_systemd_handler_g_settings_changed, NULL);
		_tmp32_ = proton_plus_globals_SETTINGS;
		g_signal_connect (_tmp32_, "changed::background-updates", (GCallback) _proton_plus_utils_system_systemd_handler_g_settings_changed, NULL);
		_tmp33_ = proton_plus_globals_SETTINGS;
		g_signal_connect (_tmp33_, "changed::background-updates-frequency", (GCallback) _proton_plus_utils_system_systemd_handler_g_settings_changed, NULL);
		proton_plus_utils_system_systemd_handler ();
		_tmp34_ = proton_plus_globals_SETTINGS;
		g_signal_connect (_tmp34_, "changed::proxy-mode", (GCallback) _proton_plus_utils_web_update_proxy_settings_g_settings_changed, NULL);
		_tmp35_ = proton_plus_globals_SETTINGS;
		g_signal_connect (_tmp35_, "changed::proxy-url", (GCallback) _proton_plus_utils_web_update_proxy_settings_g_settings_changed, NULL);
		_tmp36_ = proton_plus_utils_download_manager_get_instance ();
		_tmp37_ = _tmp36_;
		proton_plus_utils_download_manager_sync_speed_limit_from_settings (_tmp37_);
	} else {
		g_error ("application.vala:124: GSettings schema not found or invalid: 'com.vysp" \
"3r.ProtonPlus.State'");
	}
	_g_object_unref0 (status_provider);
	_g_object_unref0 (provider);
	_g_object_unref0 (display);
}

static void
proton_plus_widgets_application_real_shutdown (GApplication* base)
{
	ProtonPlusWidgetsApplication * self;
	ProtonPlusWidgetsWindow* window = NULL;
	GtkWindow* _tmp0_;
	GtkWindow* _tmp1_;
	ProtonPlusWidgetsWindow* _tmp2_;
	ProtonPlusWidgetsWindow* _tmp3_;
	ProtonPlusServicesSteamRestartManager* _tmp7_;
	ProtonPlusServicesInstallationService* _tmp9_;
	ProtonPlusServicesInstallationService* _tmp10_;
	self = (ProtonPlusWidgetsApplication*) base;
	_tmp0_ = gtk_application_get_active_window ((GtkApplication*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_IS_WINDOW (_tmp1_) ? ((ProtonPlusWidgetsWindow*) _tmp1_) : NULL);
	window = _tmp2_;
	_tmp3_ = window;
	if (_tmp3_ != NULL) {
		ProtonPlusWidgetsWindow* _tmp4_;
		ProtonPlusWidgetsMainBox* _tmp5_;
		ProtonPlusWidgetsMainBox* _tmp6_;
		_tmp4_ = window;
		_tmp5_ = proton_plus_widgets_window_get_main_box (_tmp4_);
		_tmp6_ = _tmp5_;
		proton_plus_widgets_main_box_cancel_steam_restart (_tmp6_);
	}
	_tmp7_ = self->priv->steam_restart_manager;
	if (_tmp7_ != NULL) {
		ProtonPlusServicesSteamRestartManager* _tmp8_;
		_tmp8_ = self->priv->steam_restart_manager;
		proton_plus_services_steam_restart_manager_stop_observation (_tmp8_);
	}
	_tmp9_ = proton_plus_services_installation_service_get_instance ();
	_tmp10_ = _tmp9_;
	proton_plus_services_installation_service_reset_lifecycle_configuration (_tmp10_);
	proton_plus_services_steam_configuration_service_reset_configuration ();
	notify_uninit ();
	G_APPLICATION_CLASS (proton_plus_widgets_application_parent_class)->shutdown ((GApplication*) G_TYPE_CHECK_INSTANCE_CAST (self, adw_application_get_type (), AdwApplication));
	_g_object_unref0 (window);
}

static void
proton_plus_widgets_application_on_introduction_action (ProtonPlusWidgetsApplication* self)
{
	ProtonPlusWidgetsWindow* window = NULL;
	GtkWindow* _tmp0_;
	GtkWindow* _tmp1_;
	ProtonPlusWidgetsWindow* _tmp2_;
	ProtonPlusWidgetsWindow* _tmp3_;
	ProtonPlusWidgetsWindow* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_application_get_active_window ((GtkApplication*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_IS_WINDOW (_tmp1_) ? ((ProtonPlusWidgetsWindow*) _tmp1_) : NULL);
	window = _tmp2_;
	_tmp3_ = window;
	if (_tmp3_ == NULL) {
		_g_object_unref0 (window);
		return;
	}
	_tmp4_ = window;
	proton_plus_widgets_application_present_introduction (self, _tmp4_);
	_g_object_unref0 (window);
}

static void
proton_plus_widgets_application_present_introduction (ProtonPlusWidgetsApplication* self,
                                                      ProtonPlusWidgetsWindow* window)
{
	ProtonPlusWidgetsIntroductionIntroduction* dialog = NULL;
	ProtonPlusWidgetsIntroductionIntroduction* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (window != NULL);
	_tmp0_ = proton_plus_widgets_introduction_introduction_new ();
	g_object_ref_sink (_tmp0_);
	dialog = _tmp0_;
	proton_plus_widgets_window_present_controller_dialog (window, (AdwDialog*) dialog, NULL);
	_g_object_unref0 (dialog);
}

static void
proton_plus_widgets_application_on_report_action (ProtonPlusWidgetsApplication* self)
{
	g_return_if_fail (self != NULL);
	proton_plus_utils_system_open_uri ("https://github.com/Vysp3r/ProtonPlus/issues/new?template=bug_report.md");
}

static void
_proton_plus_widgets_application_on_preferences_dialog_closed_adw_dialog_closed (AdwDialog* _sender,
                                                                                 gpointer self)
{
	proton_plus_widgets_application_on_preferences_dialog_closed ((ProtonPlusWidgetsApplication*) self);
}

static void
proton_plus_widgets_application_on_preferences_action (ProtonPlusWidgetsApplication* self)
{
	ProtonPlusWidgetsWindow* window = NULL;
	GtkWindow* _tmp0_;
	GtkWindow* _tmp1_;
	ProtonPlusWidgetsWindow* _tmp2_;
	gboolean _tmp3_ = FALSE;
	ProtonPlusWidgetsWindow* _tmp4_;
	ProtonPlusWidgetsPreferencesPreferencesDialog* preferences_dialog = NULL;
	ProtonPlusWidgetsWindow* _tmp6_;
	GeeLinkedList* _tmp7_;
	GeeLinkedList* _tmp8_;
	ProtonPlusWidgetsPreferencesPreferencesDialog* _tmp9_;
	ProtonPlusWidgetsPreferencesPreferencesDialog* _tmp10_;
	ProtonPlusWidgetsPreferencesPreferencesDialog* _tmp11_;
	ProtonPlusWidgetsPreferencesPreferencesDialog* _tmp12_;
	ProtonPlusWidgetsWindow* _tmp13_;
	ProtonPlusWidgetsPreferencesPreferencesDialog* _tmp14_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_application_get_active_window ((GtkApplication*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_IS_WINDOW (_tmp1_) ? ((ProtonPlusWidgetsWindow*) _tmp1_) : NULL);
	window = _tmp2_;
	_tmp4_ = window;
	if (_tmp4_ == NULL) {
		_tmp3_ = TRUE;
	} else {
		ProtonPlusWidgetsPreferencesPreferencesDialog* _tmp5_;
		_tmp5_ = self->priv->active_preferences_dialog;
		_tmp3_ = _tmp5_ != NULL;
	}
	if (_tmp3_) {
		_g_object_unref0 (window);
		return;
	}
	_tmp6_ = window;
	_tmp7_ = proton_plus_widgets_window_get_launchers (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = proton_plus_widgets_preferences_preferences_dialog_new (_tmp8_);
	g_object_ref_sink (_tmp9_);
	preferences_dialog = _tmp9_;
	_tmp10_ = preferences_dialog;
	_tmp11_ = _g_object_ref0 (_tmp10_);
	_g_object_unref0 (self->priv->active_preferences_dialog);
	self->priv->active_preferences_dialog = _tmp11_;
	_tmp12_ = preferences_dialog;
	g_signal_connect_object ((AdwDialog*) _tmp12_, "closed", (GCallback) _proton_plus_widgets_application_on_preferences_dialog_closed_adw_dialog_closed, self, 0);
	_tmp13_ = window;
	_tmp14_ = preferences_dialog;
	proton_plus_widgets_window_present_controller_dialog (_tmp13_, (AdwDialog*) _tmp14_, NULL);
	_g_object_unref0 (preferences_dialog);
	_g_object_unref0 (window);
}

static void
proton_plus_widgets_application_on_preferences_dialog_closed (ProtonPlusWidgetsApplication* self)
{
	g_return_if_fail (self != NULL);
	_g_object_unref0 (self->priv->active_preferences_dialog);
	self->priv->active_preferences_dialog = NULL;
	if (self->priv->reopen_preferences_after_close) {
		self->priv->reopen_preferences_after_close = FALSE;
		proton_plus_widgets_application_on_preferences_action (self);
	}
}

static void
proton_plus_widgets_application_on_donate_action (ProtonPlusWidgetsApplication* self)
{
	g_return_if_fail (self != NULL);
	proton_plus_utils_system_open_uri ("https://protonplus.vysp3r.com/#donate");
}

static void
proton_plus_widgets_application_on_reload_action (ProtonPlusWidgetsApplication* self)
{
	ProtonPlusWidgetsWindow* _tmp0_ = NULL;
	GtkWindow* _tmp1_;
	GtkWindow* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp1_ = gtk_application_get_active_window ((GtkApplication*) self);
	_tmp2_ = _tmp1_;
	_tmp0_ = PROTON_PLUS_WIDGETS_IS_WINDOW (_tmp2_) ? ((ProtonPlusWidgetsWindow*) _tmp2_) : NULL;
	if (_tmp0_ != NULL) {
		proton_plus_widgets_window_reload (_tmp0_);
	}
}

static void
proton_plus_widgets_application_on_quit_action (ProtonPlusWidgetsApplication* self)
{
	ProtonPlusWidgetsWindow* window = NULL;
	GtkWindow* _tmp0_;
	GtkWindow* _tmp1_;
	ProtonPlusWidgetsWindow* _tmp2_;
	ProtonPlusWidgetsWindow* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_application_get_active_window ((GtkApplication*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_IS_WINDOW (_tmp1_) ? ((ProtonPlusWidgetsWindow*) _tmp1_) : NULL);
	window = _tmp2_;
	_tmp3_ = window;
	if (_tmp3_ != NULL) {
		ProtonPlusWidgetsWindow* _tmp4_;
		_tmp4_ = window;
		gtk_window_close ((GtkWindow*) _tmp4_);
	} else {
		g_application_quit ((GApplication*) self);
	}
	_g_object_unref0 (window);
}

void
proton_plus_widgets_application_on_language_change (ProtonPlusWidgetsApplication* self)
{
	ProtonPlusWidgetsWindow* main_window = NULL;
	GtkWindow* _tmp0_;
	GtkWindow* _tmp1_;
	ProtonPlusWidgetsWindow* _tmp2_;
	ProtonPlusWidgetsWindow* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_application_get_active_window ((GtkApplication*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_IS_WINDOW (_tmp1_) ? ((ProtonPlusWidgetsWindow*) _tmp1_) : NULL);
	main_window = _tmp2_;
	_tmp3_ = main_window;
	if (_tmp3_ != NULL) {
		ProtonPlusWidgetsWindow* _tmp4_;
		ProtonPlusWidgetsWindow* _tmp5_;
		ProtonPlusWidgetsPreferencesPreferencesDialog* _tmp6_;
		_tmp4_ = main_window;
		proton_plus_widgets_window_reload_ui (_tmp4_);
		_tmp5_ = main_window;
		proton_plus_widgets_window_reload (_tmp5_);
		_tmp6_ = self->priv->active_preferences_dialog;
		if (_tmp6_ != NULL) {
			ProtonPlusWidgetsPreferencesPreferencesDialog* _tmp7_;
			self->priv->reopen_preferences_after_close = TRUE;
			_tmp7_ = self->priv->active_preferences_dialog;
			adw_dialog_close ((AdwDialog*) _tmp7_);
		}
	}
	_g_object_unref0 (main_window);
}

static void
proton_plus_widgets_application_on_about_action (ProtonPlusWidgetsApplication* self)
{
	static const gchar* devs[5] = {"Vysp3r https://github.com/Vysp3r", "nick.exe https://github.com/nickexe", "windblows95 https://github.com/windblows95", "JanGalek https://github.com/JanGalek", NULL};
	static const gchar* thanks[5] = {"GNOME Project https://www.gnome.org/", "ProtonUp-Qt Project https://davidotek.github.io/protonup-qt/", "LUG Helper Project https://github.com/starcitizen-lug/lug-helper/", "Font Awesome https://fontawesome.com/", NULL};
	ProtonPlusUtilsInternalMetaInfoLoader* meta = NULL;
	ProtonPlusUtilsInternalMetaInfoLoader* _tmp0_;
	ProtonPlusModelsInternalMetaInfo* model = NULL;
	ProtonPlusUtilsInternalMetaInfoLoader* _tmp1_;
	ProtonPlusModelsInternalMetaInfo* _tmp2_;
	AdwAboutDialog* about_dialog = NULL;
	AdwAboutDialog* _tmp3_;
	AdwAboutDialog* _tmp4_;
	AdwAboutDialog* _tmp5_;
	AdwAboutDialog* _tmp6_;
	AdwAboutDialog* _tmp7_;
	AdwAboutDialog* _tmp8_;
	AdwAboutDialog* _tmp9_;
	AdwAboutDialog* _tmp10_;
	AdwAboutDialog* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	AdwAboutDialog* _tmp14_;
	AdwAboutDialog* _tmp15_;
	AdwAboutDialog* _tmp16_;
	AdwAboutDialog* _tmp17_;
	ProtonPlusModelsInternalMetaInfo* _tmp18_;
	AdwAboutDialog* _tmp27_;
	GtkWindow* _tmp28_;
	GtkWindow* _tmp29_;
	g_return_if_fail (self != NULL);
	_tmp0_ = proton_plus_utils_internal_meta_info_loader_new ();
	meta = _tmp0_;
	_tmp1_ = meta;
	_tmp2_ = proton_plus_utils_internal_meta_info_loader_load (_tmp1_);
	model = _tmp2_;
	_tmp3_ = (AdwAboutDialog*) adw_about_dialog_new ();
	g_object_ref_sink (_tmp3_);
	about_dialog = _tmp3_;
	_tmp4_ = about_dialog;
	adw_about_dialog_set_application_name (_tmp4_, APP_NAME);
	_tmp5_ = about_dialog;
	adw_about_dialog_set_application_icon (_tmp5_, APP_ID);
	_tmp6_ = about_dialog;
	adw_about_dialog_set_version (_tmp6_, "v" APP_VERSION);
	_tmp7_ = about_dialog;
	adw_about_dialog_set_comments (_tmp7_, _ ("A modern compatibility tools manager"));
	_tmp8_ = about_dialog;
	adw_about_dialog_add_link (_tmp8_, "GitHub", "https://github.com/Vysp3r/ProtonPlus");
	_tmp9_ = about_dialog;
	adw_about_dialog_add_link (_tmp9_, _ ("Website"), "https://protonplus.vysp3r.com/");
	_tmp10_ = about_dialog;
	adw_about_dialog_set_issue_url (_tmp10_, "https://github.com/Vysp3r/ProtonPlus/issues/new/choose");
	_tmp11_ = about_dialog;
	_tmp12_ = proton_plus_widgets_application_get_copyright ();
	_tmp13_ = _tmp12_;
	adw_about_dialog_set_copyright (_tmp11_, _tmp13_);
	_g_free0 (_tmp13_);
	_tmp14_ = about_dialog;
	adw_about_dialog_set_license_type (_tmp14_, GTK_LICENSE_GPL_3_0);
	_tmp15_ = about_dialog;
	adw_about_dialog_set_developers (_tmp15_, devs);
	_tmp16_ = about_dialog;
	adw_about_dialog_set_translator_credits (_tmp16_, _ ("translator-credits"));
	_tmp17_ = about_dialog;
	adw_about_dialog_add_credit_section (_tmp17_, _ ("Special thanks to"), thanks);
	_tmp18_ = model;
	if (_tmp18_ != NULL) {
		ProtonPlusModelsInternalMetaInfoRelease* last_release = NULL;
		ProtonPlusModelsInternalMetaInfo* _tmp19_;
		ProtonPlusModelsInternalMetaInfoRelease* _tmp20_;
		AdwAboutDialog* _tmp21_;
		ProtonPlusModelsInternalMetaInfoRelease* _tmp22_;
		const gchar* _tmp23_;
		AdwAboutDialog* _tmp24_;
		ProtonPlusModelsInternalMetaInfoRelease* _tmp25_;
		const gchar* _tmp26_;
		_tmp19_ = model;
		_tmp20_ = proton_plus_models_internal_meta_info_get_last_release (_tmp19_);
		last_release = _tmp20_;
		_tmp21_ = about_dialog;
		_tmp22_ = last_release;
		_tmp23_ = _tmp22_->description;
		adw_about_dialog_set_release_notes (_tmp21_, _tmp23_);
		_tmp24_ = about_dialog;
		_tmp25_ = last_release;
		_tmp26_ = _tmp25_->version;
		adw_about_dialog_set_release_notes_version (_tmp24_, _tmp26_);
		_g_object_unref0 (last_release);
	}
	_tmp27_ = about_dialog;
	_tmp28_ = gtk_application_get_active_window ((GtkApplication*) self);
	_tmp29_ = _tmp28_;
	proton_plus_widgets_window_present_dialog_for_controller ((AdwDialog*) _tmp27_, (GtkWidget*) _tmp29_);
	_g_object_unref0 (about_dialog);
	_g_object_unref0 (model);
	_g_object_unref0 (meta);
}

static gchar*
proton_plus_widgets_application_get_copyright (void)
{
	GDateTime* current = NULL;
	GDateTime* _tmp0_;
	GDateTime* _tmp1_;
	gint current_year = 0;
	GDateTime* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* result;
	_tmp0_ = g_date_time_new_now_local ();
	current = _tmp0_;
	_tmp1_ = current;
	if (_tmp1_ == NULL) {
		gchar* _tmp2_;
		_tmp2_ = g_strdup ("© 2022 Vysp3r");
		result = _tmp2_;
		_g_date_time_unref0 (current);
		return result;
	}
	_tmp3_ = current;
	current_year = g_date_time_get_year (_tmp3_);
	_tmp4_ = g_strdup_printf ("%i", current_year);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_strconcat ("© 2022-", _tmp5_, NULL);
	_tmp7_ = _tmp6_;
	_tmp8_ = g_strconcat (_tmp7_, " Vysp3r", NULL);
	_tmp9_ = _tmp8_;
	_g_free0 (_tmp7_);
	_g_free0 (_tmp5_);
	result = _tmp9_;
	_g_date_time_unref0 (current);
	return result;
}

ProtonPlusWidgetsApplication*
proton_plus_widgets_application_construct (GType object_type)
{
	ProtonPlusWidgetsApplication * self = NULL;
	self = (ProtonPlusWidgetsApplication*) g_object_new (object_type, NULL);
	return self;
}

ProtonPlusWidgetsApplication*
proton_plus_widgets_application_new (void)
{
	return proton_plus_widgets_application_construct (PROTON_PLUS_WIDGETS_TYPE_APPLICATION);
}

static void
_proton_plus_widgets_application_on_report_action_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                    GVariant* parameter,
                                                                                    gpointer self)
{
	proton_plus_widgets_application_on_report_action ((ProtonPlusWidgetsApplication*) self);
}

static void
_proton_plus_widgets_application_on_preferences_action_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                         GVariant* parameter,
                                                                                         gpointer self)
{
	proton_plus_widgets_application_on_preferences_action ((ProtonPlusWidgetsApplication*) self);
}

static void
_proton_plus_widgets_application_on_about_action_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                   GVariant* parameter,
                                                                                   gpointer self)
{
	proton_plus_widgets_application_on_about_action ((ProtonPlusWidgetsApplication*) self);
}

static void
_proton_plus_widgets_application_on_donate_action_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                    GVariant* parameter,
                                                                                    gpointer self)
{
	proton_plus_widgets_application_on_donate_action ((ProtonPlusWidgetsApplication*) self);
}

static void
_proton_plus_widgets_application_on_reload_action_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                    GVariant* parameter,
                                                                                    gpointer self)
{
	proton_plus_widgets_application_on_reload_action ((ProtonPlusWidgetsApplication*) self);
}

static void
_proton_plus_widgets_application_on_introduction_action_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                          GVariant* parameter,
                                                                                          gpointer self)
{
	proton_plus_widgets_application_on_introduction_action ((ProtonPlusWidgetsApplication*) self);
}

static void
_proton_plus_widgets_application_on_language_change_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                      GVariant* parameter,
                                                                                      gpointer self)
{
	proton_plus_widgets_application_on_language_change ((ProtonPlusWidgetsApplication*) self);
}

static void
_proton_plus_widgets_application_on_quit_action_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                  GVariant* parameter,
                                                                                  gpointer self)
{
	proton_plus_widgets_application_on_quit_action ((ProtonPlusWidgetsApplication*) self);
}

static GObject *
proton_plus_widgets_application_constructor (GType type,
                                             guint n_construct_properties,
                                             GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ProtonPlusWidgetsApplication * self;
	GApplicationFlags _tmp0_;
	GApplicationFlags _tmp1_;
	GActionEntry* action_entries = NULL;
	GActionEntry _tmp2_ = {0};
	GActionEntry _tmp3_ = {0};
	GActionEntry _tmp4_ = {0};
	GActionEntry _tmp5_ = {0};
	GActionEntry _tmp6_ = {0};
	GActionEntry _tmp7_ = {0};
	GActionEntry _tmp8_ = {0};
	GActionEntry _tmp9_ = {0};
	GActionEntry* _tmp10_;
	gint action_entries_length1;
	gint _action_entries_size_;
	GActionEntry* _tmp11_;
	gint _tmp11__length1;
	gchar* _tmp12_;
	gchar** _tmp13_;
	gchar** _tmp14_;
	gint _tmp14__length1;
	gchar* _tmp15_;
	gchar** _tmp16_;
	gchar** _tmp17_;
	gint _tmp17__length1;
	gchar* _tmp18_;
	gchar** _tmp19_;
	gchar** _tmp20_;
	gint _tmp20__length1;
	parent_class = G_OBJECT_CLASS (proton_plus_widgets_application_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_TYPE_APPLICATION, ProtonPlusWidgetsApplication);
	g_application_set_application_id ((GApplication*) self, APP_ID);
	_tmp0_ = g_application_get_flags ((GApplication*) self);
	_tmp1_ = _tmp0_;
	g_application_set_flags ((GApplication*) self, _tmp1_ | G_APPLICATION_FLAGS_NONE);
	memset (&_tmp2_, 0, sizeof (GActionEntry));
	_tmp2_.name = "report";
	_tmp2_.activate = _proton_plus_widgets_application_on_report_action_gsimple_action_activate_callback;
	memset (&_tmp3_, 0, sizeof (GActionEntry));
	_tmp3_.name = "preferences";
	_tmp3_.activate = _proton_plus_widgets_application_on_preferences_action_gsimple_action_activate_callback;
	memset (&_tmp4_, 0, sizeof (GActionEntry));
	_tmp4_.name = "about";
	_tmp4_.activate = _proton_plus_widgets_application_on_about_action_gsimple_action_activate_callback;
	memset (&_tmp5_, 0, sizeof (GActionEntry));
	_tmp5_.name = "donate";
	_tmp5_.activate = _proton_plus_widgets_application_on_donate_action_gsimple_action_activate_callback;
	memset (&_tmp6_, 0, sizeof (GActionEntry));
	_tmp6_.name = "reload";
	_tmp6_.activate = _proton_plus_widgets_application_on_reload_action_gsimple_action_activate_callback;
	memset (&_tmp7_, 0, sizeof (GActionEntry));
	_tmp7_.name = "introduction";
	_tmp7_.activate = _proton_plus_widgets_application_on_introduction_action_gsimple_action_activate_callback;
	memset (&_tmp8_, 0, sizeof (GActionEntry));
	_tmp8_.name = "on_language_change";
	_tmp8_.activate = _proton_plus_widgets_application_on_language_change_gsimple_action_activate_callback;
	memset (&_tmp9_, 0, sizeof (GActionEntry));
	_tmp9_.name = "quit";
	_tmp9_.activate = _proton_plus_widgets_application_on_quit_action_gsimple_action_activate_callback;
	_tmp10_ = g_new0 (GActionEntry, 8);
	_tmp10_[0] = _tmp2_;
	_tmp10_[1] = _tmp3_;
	_tmp10_[2] = _tmp4_;
	_tmp10_[3] = _tmp5_;
	_tmp10_[4] = _tmp6_;
	_tmp10_[5] = _tmp7_;
	_tmp10_[6] = _tmp8_;
	_tmp10_[7] = _tmp9_;
	action_entries = _tmp10_;
	action_entries_length1 = 8;
	_action_entries_size_ = action_entries_length1;
	_tmp11_ = action_entries;
	_tmp11__length1 = action_entries_length1;
	g_action_map_add_action_entries ((GActionMap*) self, _tmp11_, (gint) _tmp11__length1, self);
	_tmp12_ = g_strdup ("<Ctrl>Q");
	_tmp13_ = g_new0 (gchar*, 1 + 1);
	_tmp13_[0] = _tmp12_;
	_tmp14_ = _tmp13_;
	_tmp14__length1 = 1;
	gtk_application_set_accels_for_action ((GtkApplication*) self, "app.quit", _tmp14_);
	_tmp14_ = (_vala_array_free (_tmp14_, _tmp14__length1, (GDestroyNotify) g_free), NULL);
	_tmp15_ = g_strdup ("<Ctrl>comma");
	_tmp16_ = g_new0 (gchar*, 1 + 1);
	_tmp16_[0] = _tmp15_;
	_tmp17_ = _tmp16_;
	_tmp17__length1 = 1;
	gtk_application_set_accels_for_action ((GtkApplication*) self, "app.preferences", _tmp17_);
	_tmp17_ = (_vala_array_free (_tmp17_, _tmp17__length1, (GDestroyNotify) g_free), NULL);
	_tmp18_ = g_strdup ("<Alt>Left");
	_tmp19_ = g_new0 (gchar*, 1 + 1);
	_tmp19_[0] = _tmp18_;
	_tmp20_ = _tmp19_;
	_tmp20__length1 = 1;
	gtk_application_set_accels_for_action ((GtkApplication*) self, "win.navigate-back", _tmp20_);
	_tmp20_ = (_vala_array_free (_tmp20_, _tmp20__length1, (GDestroyNotify) g_free), NULL);
	action_entries = (g_free (action_entries), NULL);
	return obj;
}

static void
proton_plus_widgets_application_class_init (ProtonPlusWidgetsApplicationClass * klass,
                                            gpointer klass_data)
{
	proton_plus_widgets_application_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsApplication_private_offset);
	((GApplicationClass *) klass)->activate = (void (*) (GApplication*)) proton_plus_widgets_application_real_activate;
	((GApplicationClass *) klass)->startup = (void (*) (GApplication*)) proton_plus_widgets_application_real_startup;
	((GApplicationClass *) klass)->shutdown = (void (*) (GApplication*)) proton_plus_widgets_application_real_shutdown;
	G_OBJECT_CLASS (klass)->constructor = proton_plus_widgets_application_constructor;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_application_finalize;
}

static void
proton_plus_widgets_application_instance_init (ProtonPlusWidgetsApplication * self,
                                               gpointer klass)
{
	self->priv = proton_plus_widgets_application_get_instance_private (self);
	self->priv->active_preferences_dialog = NULL;
	self->priv->reopen_preferences_after_close = FALSE;
	self->priv->migration_manager = NULL;
	self->priv->steam_session_service = NULL;
	self->priv->steam_restart_manager = NULL;
	self->priv->steam_restart_orchestrator = NULL;
	self->priv->steam_configuration_service = NULL;
	self->priv->show_introduction = FALSE;
}

static void
proton_plus_widgets_application_finalize (GObject * obj)
{
	ProtonPlusWidgetsApplication * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_TYPE_APPLICATION, ProtonPlusWidgetsApplication);
	_g_object_unref0 (self->priv->active_preferences_dialog);
	_g_object_unref0 (self->priv->migration_manager);
	_g_object_unref0 (self->priv->steam_session_service);
	_g_object_unref0 (self->priv->steam_restart_manager);
	_g_object_unref0 (self->priv->steam_restart_orchestrator);
	_g_object_unref0 (self->priv->steam_configuration_service);
	G_OBJECT_CLASS (proton_plus_widgets_application_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_application_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsApplicationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_application_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsApplication), 0, (GInstanceInitFunc) proton_plus_widgets_application_instance_init, NULL };
	GType proton_plus_widgets_application_type_id;
	proton_plus_widgets_application_type_id = g_type_register_static (adw_application_get_type (), "ProtonPlusWidgetsApplication", &g_define_type_info, 0);
	ProtonPlusWidgetsApplication_private_offset = g_type_add_instance_private (proton_plus_widgets_application_type_id, sizeof (ProtonPlusWidgetsApplicationPrivate));
	return proton_plus_widgets_application_type_id;
}

GType
proton_plus_widgets_application_get_type (void)
{
	static volatile gsize proton_plus_widgets_application_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_application_type_id__once)) {
		GType proton_plus_widgets_application_type_id;
		proton_plus_widgets_application_type_id = proton_plus_widgets_application_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_application_type_id__once, proton_plus_widgets_application_type_id);
	}
	return proton_plus_widgets_application_type_id__once;
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

