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

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

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

#define PROTON_PLUS_WIDGETS_TYPE_APPLICATION (proton_plus_widgets_application_get_type ())
#define PROTON_PLUS_WIDGETS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_TYPE_APPLICATION, ProtonPlusWidgetsApplication))
#define PROTON_PLUS_WIDGETS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_TYPE_APPLICATION, ProtonPlusWidgetsApplicationClass))
#define PROTON_PLUS_WIDGETS_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_TYPE_APPLICATION))
#define PROTON_PLUS_WIDGETS_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_TYPE_APPLICATION))
#define PROTON_PLUS_WIDGETS_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_TYPE_APPLICATION, ProtonPlusWidgetsApplicationClass))

typedef struct _ProtonPlusWidgetsApplication ProtonPlusWidgetsApplication;
typedef struct _ProtonPlusWidgetsApplicationClass ProtonPlusWidgetsApplicationClass;
typedef struct _ProtonPlusWidgetsApplicationPrivate ProtonPlusWidgetsApplicationPrivate;
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 PROTON_PLUS_WIDGETS_TYPE_WINDOW (proton_plus_widgets_window_get_type ())
#define PROTON_PLUS_WIDGETS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_TYPE_WINDOW, ProtonPlusWidgetsWindow))
#define PROTON_PLUS_WIDGETS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_TYPE_WINDOW, ProtonPlusWidgetsWindowClass))
#define PROTON_PLUS_WIDGETS_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_TYPE_WINDOW))
#define PROTON_PLUS_WIDGETS_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_TYPE_WINDOW))
#define PROTON_PLUS_WIDGETS_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_TYPE_WINDOW, ProtonPlusWidgetsWindowClass))

typedef struct _ProtonPlusWidgetsWindow ProtonPlusWidgetsWindow;
typedef struct _ProtonPlusWidgetsWindowClass ProtonPlusWidgetsWindowClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define PROTON_PLUS_WIDGETS_TYPE_THEME_MANAGER (proton_plus_widgets_theme_manager_get_type ())
#define PROTON_PLUS_WIDGETS_THEME_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_TYPE_THEME_MANAGER, ProtonPlusWidgetsThemeManager))
#define PROTON_PLUS_WIDGETS_THEME_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_TYPE_THEME_MANAGER, ProtonPlusWidgetsThemeManagerClass))
#define PROTON_PLUS_WIDGETS_IS_THEME_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_TYPE_THEME_MANAGER))
#define PROTON_PLUS_WIDGETS_IS_THEME_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_TYPE_THEME_MANAGER))
#define PROTON_PLUS_WIDGETS_THEME_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_TYPE_THEME_MANAGER, ProtonPlusWidgetsThemeManagerClass))

typedef struct _ProtonPlusWidgetsThemeManager ProtonPlusWidgetsThemeManager;
typedef struct _ProtonPlusWidgetsThemeManagerClass ProtonPlusWidgetsThemeManagerClass;

#define PROTON_PLUS_WIDGETS_PREFERENCES_TYPE_PREFERENCES_DIALOG (proton_plus_widgets_preferences_preferences_dialog_get_type ())
#define PROTON_PLUS_WIDGETS_PREFERENCES_PREFERENCES_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_PREFERENCES_TYPE_PREFERENCES_DIALOG, ProtonPlusWidgetsPreferencesPreferencesDialog))
#define PROTON_PLUS_WIDGETS_PREFERENCES_PREFERENCES_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_PREFERENCES_TYPE_PREFERENCES_DIALOG, ProtonPlusWidgetsPreferencesPreferencesDialogClass))
#define PROTON_PLUS_WIDGETS_PREFERENCES_IS_PREFERENCES_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_PREFERENCES_TYPE_PREFERENCES_DIALOG))
#define PROTON_PLUS_WIDGETS_PREFERENCES_IS_PREFERENCES_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_PREFERENCES_TYPE_PREFERENCES_DIALOG))
#define PROTON_PLUS_WIDGETS_PREFERENCES_PREFERENCES_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_PREFERENCES_TYPE_PREFERENCES_DIALOG, ProtonPlusWidgetsPreferencesPreferencesDialogClass))

typedef struct _ProtonPlusWidgetsPreferencesPreferencesDialog ProtonPlusWidgetsPreferencesPreferencesDialog;
typedef struct _ProtonPlusWidgetsPreferencesPreferencesDialogClass ProtonPlusWidgetsPreferencesPreferencesDialogClass;
typedef void (*GSimpleActionActivateCallback) (GSimpleAction* action, GVariant* parameter, gpointer user_data);

struct _ProtonPlusWidgetsApplication {
	AdwApplication parent_instance;
	ProtonPlusWidgetsApplicationPrivate * priv;
};

struct _ProtonPlusWidgetsApplicationClass {
	AdwApplicationClass parent_class;
};

static gpointer proton_plus_widgets_application_parent_class = NULL;
VALA_EXTERN ProtonPlusWidgetsWindow* proton_plus_widgets_application_window;
ProtonPlusWidgetsWindow* proton_plus_widgets_application_window = NULL;
VALA_EXTERN GSettings* proton_plus_globals_SETTINGS;
VALA_EXTERN gboolean proton_plus_globals_IS_STEAM_OS;

VALA_EXTERN GType proton_plus_widgets_application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusWidgetsApplication, g_object_unref)
VALA_EXTERN GType proton_plus_widgets_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusWidgetsWindow, g_object_unref)
static void proton_plus_widgets_application_real_activate (GApplication* base);
VALA_EXTERN ProtonPlusWidgetsWindow* proton_plus_widgets_window_new (void);
VALA_EXTERN ProtonPlusWidgetsWindow* proton_plus_widgets_window_construct (GType object_type);
VALA_EXTERN void proton_plus_globals_load (GAsyncReadyCallback _callback_,
                               gpointer _user_data_);
VALA_EXTERN void proton_plus_globals_load_finish (GAsyncResult* _res_);
static void __lambda64_ (ProtonPlusWidgetsApplication* self,
                  GObject* obj,
                  GAsyncResult* res);
VALA_EXTERN GType proton_plus_widgets_theme_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusWidgetsThemeManager, g_object_unref)
VALA_EXTERN ProtonPlusWidgetsThemeManager* proton_plus_widgets_theme_manager_get_default (void);
VALA_EXTERN void proton_plus_widgets_theme_manager_apply_theme (ProtonPlusWidgetsThemeManager* self);
static void ___lambda64__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void proton_plus_widgets_application_on_report_action (ProtonPlusWidgetsApplication* self);
VALA_EXTERN void proton_plus_utils_system_open_uri (const gchar* uri);
static void proton_plus_widgets_application_on_preferences_action (ProtonPlusWidgetsApplication* self);
VALA_EXTERN GType proton_plus_widgets_preferences_preferences_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusWidgetsPreferencesPreferencesDialog, g_object_unref)
VALA_EXTERN ProtonPlusWidgetsPreferencesPreferencesDialog* proton_plus_widgets_preferences_preferences_dialog_new (void);
VALA_EXTERN ProtonPlusWidgetsPreferencesPreferencesDialog* proton_plus_widgets_preferences_preferences_dialog_construct (GType object_type);
static void proton_plus_widgets_application_on_about_action (ProtonPlusWidgetsApplication* self);
VALA_EXTERN ProtonPlusWidgetsApplication* proton_plus_widgets_application_new (void);
VALA_EXTERN ProtonPlusWidgetsApplication* proton_plus_widgets_application_construct (GType object_type);
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 _g_application_quit_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 gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static void
__lambda64_ (ProtonPlusWidgetsApplication* self,
             GObject* obj,
             GAsyncResult* res)
{
	GSettings* _tmp0_;
	ProtonPlusWidgetsWindow* _tmp18_;
	g_return_if_fail (res != NULL);
	_tmp0_ = proton_plus_globals_SETTINGS;
	if (_tmp0_ != NULL) {
		GSettings* _tmp1_;
		ProtonPlusWidgetsWindow* _tmp2_;
		GSettings* _tmp3_;
		ProtonPlusWidgetsWindow* _tmp4_;
		GSettings* _tmp5_;
		ProtonPlusWidgetsWindow* _tmp6_;
		GSettings* _tmp7_;
		ProtonPlusWidgetsWindow* _tmp8_;
		GSettings* _tmp9_;
		ProtonPlusWidgetsThemeManager* _tmp12_;
		ProtonPlusWidgetsThemeManager* _tmp13_;
		_tmp1_ = proton_plus_globals_SETTINGS;
		_tmp2_ = proton_plus_widgets_application_window;
		g_settings_bind (_tmp1_, "width", (GObject*) _tmp2_, "default-width", G_SETTINGS_BIND_DEFAULT);
		_tmp3_ = proton_plus_globals_SETTINGS;
		_tmp4_ = proton_plus_widgets_application_window;
		g_settings_bind (_tmp3_, "height", (GObject*) _tmp4_, "default-height", G_SETTINGS_BIND_DEFAULT);
		_tmp5_ = proton_plus_globals_SETTINGS;
		_tmp6_ = proton_plus_widgets_application_window;
		g_settings_bind (_tmp5_, "is-maximized", (GObject*) _tmp6_, "maximized", G_SETTINGS_BIND_DEFAULT);
		_tmp7_ = proton_plus_globals_SETTINGS;
		_tmp8_ = proton_plus_widgets_application_window;
		g_settings_bind (_tmp7_, "is-fullscreen", (GObject*) _tmp8_, "fullscreened", G_SETTINGS_BIND_DEFAULT);
		_tmp9_ = proton_plus_globals_SETTINGS;
		if (g_settings_get_boolean (_tmp9_, "first-run")) {
			GSettings* _tmp11_;
			if (proton_plus_globals_IS_STEAM_OS) {
				GSettings* _tmp10_;
				_tmp10_ = proton_plus_globals_SETTINGS;
				g_settings_set_enum (_tmp10_, "theme", 5);
			}
			_tmp11_ = proton_plus_globals_SETTINGS;
			g_settings_set_boolean (_tmp11_, "first-run", FALSE);
		}
		_tmp12_ = proton_plus_widgets_theme_manager_get_default ();
		_tmp13_ = _tmp12_;
		proton_plus_widgets_theme_manager_apply_theme (_tmp13_);
		_g_object_unref0 (_tmp13_);
	} else {
		ProtonPlusWidgetsWindow* _tmp14_;
		ProtonPlusWidgetsWindow* _tmp15_;
		ProtonPlusWidgetsWindow* _tmp16_;
		ProtonPlusWidgetsWindow* _tmp17_;
		g_warning ("application.vala:62: GSettings schema not found: 'com.vysp3r.ProtonPlu" \
"s.State'");
		_tmp14_ = proton_plus_widgets_application_window;
		g_object_set ((GtkWindow*) _tmp14_, "default-width", 950, NULL);
		_tmp15_ = proton_plus_widgets_application_window;
		g_object_set ((GtkWindow*) _tmp15_, "default-height", 600, NULL);
		_tmp16_ = proton_plus_widgets_application_window;
		g_object_set ((GtkWindow*) _tmp16_, "maximized", FALSE, NULL);
		_tmp17_ = proton_plus_widgets_application_window;
		g_object_set ((GtkWindow*) _tmp17_, "fullscreened", FALSE, NULL);
	}
	_tmp18_ = proton_plus_widgets_application_window;
	gtk_window_present ((GtkWindow*) _tmp18_);
}

static void
___lambda64__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda64_ ((ProtonPlusWidgetsApplication*) self, source_object, res);
	g_object_unref (self);
}

static void
proton_plus_widgets_application_real_activate (GApplication* base)
{
	ProtonPlusWidgetsApplication * self;
	GdkDisplay* display = NULL;
	GdkDisplay* _tmp0_;
	GdkDisplay* _tmp1_;
	GtkIconTheme* _tmp2_;
	GtkCssProvider* provider = NULL;
	GtkCssProvider* _tmp3_;
	ProtonPlusWidgetsWindow* _tmp4_;
	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_ = 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_ = proton_plus_widgets_window_new ();
	g_object_ref_sink (_tmp4_);
	_g_object_unref0 (proton_plus_widgets_application_window);
	proton_plus_widgets_application_window = _tmp4_;
	proton_plus_globals_load (___lambda64__gasync_ready_callback, g_object_ref (self));
	_g_object_unref0 (provider);
	_g_object_unref0 (display);
}

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_action (ProtonPlusWidgetsApplication* self)
{
	ProtonPlusWidgetsPreferencesPreferencesDialog* preferences_dialog = NULL;
	ProtonPlusWidgetsPreferencesPreferencesDialog* _tmp0_;
	ProtonPlusWidgetsWindow* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = proton_plus_widgets_preferences_preferences_dialog_new ();
	g_object_ref_sink (_tmp0_);
	preferences_dialog = _tmp0_;
	_tmp1_ = proton_plus_widgets_application_window;
	adw_dialog_present ((AdwDialog*) preferences_dialog, (GtkWidget*) _tmp1_);
	_g_object_unref0 (preferences_dialog);
}

static void
proton_plus_widgets_application_on_about_action (ProtonPlusWidgetsApplication* self)
{
	static const gchar* devs[4] = {"Vysp3r https://github.com/Vysp3r", "nick.exe https://github.com/nickexe", "windblows95 https://github.com/windblows95", NULL};
	static const gchar* thanks[4] = {"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", NULL};
	AdwAboutDialog* about_dialog = NULL;
	AdwAboutDialog* _tmp0_;
	ProtonPlusWidgetsWindow* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = (AdwAboutDialog*) adw_about_dialog_new ();
	g_object_ref_sink (_tmp0_);
	about_dialog = _tmp0_;
	adw_about_dialog_set_application_name (about_dialog, APP_NAME);
	adw_about_dialog_set_application_icon (about_dialog, APP_ID);
	adw_about_dialog_set_version (about_dialog, "v" APP_VERSION);
	adw_about_dialog_set_comments (about_dialog, _ ("A modern compatibility tools manager"));
	adw_about_dialog_add_link (about_dialog, "GitHub", "https://github.com/Vysp3r/ProtonPlus");
	adw_about_dialog_add_link (about_dialog, _ ("Website"), "https://protonplus.vysp3r.com/");
	adw_about_dialog_set_issue_url (about_dialog, "https://github.com/Vysp3r/ProtonPlus/issues/new/choose");
	adw_about_dialog_set_copyright (about_dialog, "© 2022-2025 Vysp3r");
	adw_about_dialog_set_license_type (about_dialog, GTK_LICENSE_GPL_3_0);
	adw_about_dialog_set_developers (about_dialog, devs);
	adw_about_dialog_set_translator_credits (about_dialog, _ ("translator-credits"));
	adw_about_dialog_add_credit_section (about_dialog, _ ("Special thanks to"), thanks);
	_tmp1_ = proton_plus_widgets_application_window;
	adw_dialog_present ((AdwDialog*) about_dialog, (GtkWidget*) _tmp1_);
	_g_object_unref0 (about_dialog);
}

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
_g_application_quit_gsimple_action_activate_callback (GSimpleAction* action,
                                                      GVariant* parameter,
                                                      gpointer self)
{
	g_application_quit ((GApplication*) 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_;
	gint action_entries_length1;
	gint _action_entries_size_;
	GActionEntry* _tmp7_;
	gint _tmp7__length1;
	gchar* _tmp8_;
	gchar** _tmp9_;
	gchar** _tmp10_;
	gint _tmp10__length1;
	gchar* _tmp11_;
	gchar** _tmp12_;
	gchar** _tmp13_;
	gint _tmp13__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 = "quit";
	_tmp5_.activate = _g_application_quit_gsimple_action_activate_callback;
	_tmp6_ = g_new0 (GActionEntry, 4);
	_tmp6_[0] = _tmp2_;
	_tmp6_[1] = _tmp3_;
	_tmp6_[2] = _tmp4_;
	_tmp6_[3] = _tmp5_;
	action_entries = _tmp6_;
	action_entries_length1 = 4;
	_action_entries_size_ = action_entries_length1;
	_tmp7_ = action_entries;
	_tmp7__length1 = action_entries_length1;
	g_action_map_add_action_entries ((GActionMap*) self, _tmp7_, (gint) _tmp7__length1, self);
	_tmp8_ = g_strdup ("<Ctrl>Q");
	_tmp9_ = g_new0 (gchar*, 1 + 1);
	_tmp9_[0] = _tmp8_;
	_tmp10_ = _tmp9_;
	_tmp10__length1 = 1;
	gtk_application_set_accels_for_action ((GtkApplication*) self, "app.quit", _tmp10_);
	_tmp10_ = (_vala_array_free (_tmp10_, _tmp10__length1, (GDestroyNotify) g_free), NULL);
	_tmp11_ = g_strdup ("<Ctrl>comma");
	_tmp12_ = g_new0 (gchar*, 1 + 1);
	_tmp12_[0] = _tmp11_;
	_tmp13_ = _tmp12_;
	_tmp13__length1 = 1;
	gtk_application_set_accels_for_action ((GtkApplication*) self, "app.preferences", _tmp13_);
	_tmp13_ = (_vala_array_free (_tmp13_, _tmp13__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);
	((GApplicationClass *) klass)->activate = (void (*) (GApplication*)) proton_plus_widgets_application_real_activate;
	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)
{
}

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

