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

/* application.vala
 *
 * Copyright 2022 Vojtěch Perník
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

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

#define WG_CONSTANTS_APP_ID "app.drey.Blurble"
#define WG_CONSTANTS_RESOURCE_PATH_PREFIX "/app/drey/Blurble"
#define WG_CONSTANTS_GETTEXT_PACKAGE "blurble"
#define WG_CONSTANTS_LOCALE_DIR "/usr/share/locale"
#define WG_CONSTANTS_VERSION "0.4.0"
#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 WG_TYPE_APPLICATION (wg_application_get_type ())
#define WG_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WG_TYPE_APPLICATION, WGApplication))
#define WG_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WG_TYPE_APPLICATION, WGApplicationClass))
#define WG_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WG_TYPE_APPLICATION))
#define WG_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WG_TYPE_APPLICATION))
#define WG_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WG_TYPE_APPLICATION, WGApplicationClass))

typedef struct _WGApplication WGApplication;
typedef struct _WGApplicationClass WGApplicationClass;
typedef struct _WGApplicationPrivate WGApplicationPrivate;
enum  {
	WG_APPLICATION_0_PROPERTY,
	WG_APPLICATION_NUM_PROPERTIES
};
static GParamSpec* wg_application_properties[WG_APPLICATION_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define WG_TYPE_WINDOW (wg_window_get_type ())
#define WG_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WG_TYPE_WINDOW, WGWindow))
#define WG_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WG_TYPE_WINDOW, WGWindowClass))
#define WG_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WG_TYPE_WINDOW))
#define WG_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WG_TYPE_WINDOW))
#define WG_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WG_TYPE_WINDOW, WGWindowClass))

typedef struct _WGWindow WGWindow;
typedef struct _WGWindowClass WGWindowClass;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef void (*GSimpleActionActivateCallback) (GSimpleAction* action, GVariant* parameter, gpointer user_data);
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _WGApplication {
	AdwApplication parent_instance;
	WGApplicationPrivate * priv;
};

struct _WGApplicationClass {
	AdwApplicationClass parent_class;
};

struct _WGApplicationPrivate {
	GtkCssProvider* css_provider_hc;
	GSettings* settings;
};

static gint WGApplication_private_offset;
static gpointer wg_application_parent_class = NULL;

VALA_EXTERN GType wg_application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WGApplication, g_object_unref)
VALA_EXTERN WGApplication* wg_application_new (void);
VALA_EXTERN WGApplication* wg_application_construct (GType object_type);
static void wg_application_real_activate (GApplication* base);
static void wg_application_set_high_contrast (WGApplication* self);
static void _wg_application_set_high_contrast_g_object_notify (GObject* _sender,
                                                        GParamSpec* pspec,
                                                        gpointer self);
VALA_EXTERN WGWindow* wg_window_new (GtkApplication* app);
VALA_EXTERN WGWindow* wg_window_construct (GType object_type,
                               GtkApplication* app);
VALA_EXTERN GType wg_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WGWindow, g_object_unref)
static gint wg_application_main (gchar** args,
                          gint args_length1);
static void wg_application_on_about_action (WGApplication* self);
static GObject * wg_application_constructor (GType type,
                                      guint n_construct_properties,
                                      GObjectConstructParam * construct_properties);
static void _wg_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 _wg_application___lambda21_ (WGApplication* self);
VALA_EXTERN void wg_window_open_menu (WGWindow* self);
static void __wg_application___lambda21__g_simple_action_activate (GSimpleAction* _sender,
                                                            GVariant* parameter,
                                                            gpointer self);
static void wg_application_finalize (GObject * obj);
static GType wg_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
wg_application_get_instance_private (WGApplication* self)
{
	return G_STRUCT_MEMBER_P (self, WGApplication_private_offset);
}

WGApplication*
wg_application_construct (GType object_type)
{
	WGApplication * self = NULL;
	self = (WGApplication*) g_object_new (object_type, "application-id", WG_CONSTANTS_APP_ID, "flags", G_APPLICATION_FLAGS_NONE, NULL);
	return self;
}

WGApplication*
wg_application_new (void)
{
	return wg_application_construct (WG_TYPE_APPLICATION);
}

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

static void
_wg_application_set_high_contrast_g_object_notify (GObject* _sender,
                                                   GParamSpec* pspec,
                                                   gpointer self)
{
	wg_application_set_high_contrast ((WGApplication*) self);
}

static void
wg_application_real_activate (GApplication* base)
{
	WGApplication * self;
	GdkDisplay* display = NULL;
	GdkDisplay* _tmp0_;
	GdkDisplay* _tmp1_;
	GdkDisplay* _tmp2_;
	GtkCssProvider* css_provider = NULL;
	GtkCssProvider* _tmp3_;
	GtkCssProvider* _tmp4_;
	GdkDisplay* _tmp5_;
	GtkCssProvider* _tmp6_;
	GtkCssProvider* _tmp7_;
	AdwStyleManager* _tmp8_;
	AdwStyleManager* _tmp9_;
	GtkWindow* win = NULL;
	GtkWindow* _tmp10_;
	GtkWindow* _tmp11_;
	GtkWindow* _tmp12_;
	GtkWindow* _tmp13_;
	GtkWindow* _tmp15_;
	self = (WGApplication*) base;
	g_application_set_resource_base_path ((GApplication*) self, WG_CONSTANTS_RESOURCE_PATH_PREFIX);
	G_APPLICATION_CLASS (wg_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_ = display;
	_vala_assert (_tmp2_ != NULL, "display != null");
	_tmp3_ = gtk_css_provider_new ();
	css_provider = _tmp3_;
	_tmp4_ = css_provider;
	gtk_css_provider_load_from_resource (_tmp4_, WG_CONSTANTS_RESOURCE_PATH_PREFIX "/style.css");
	_tmp5_ = display;
	_tmp6_ = css_provider;
	gtk_style_context_add_provider_for_display (_tmp5_, (GtkStyleProvider*) _tmp6_, (guint) GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
	_tmp7_ = self->priv->css_provider_hc;
	gtk_css_provider_load_from_resource (_tmp7_, WG_CONSTANTS_RESOURCE_PATH_PREFIX "/style-hc.css");
	wg_application_set_high_contrast (self);
	_tmp8_ = adw_application_get_style_manager ((AdwApplication*) self);
	_tmp9_ = _tmp8_;
	g_signal_connect_object ((GObject*) _tmp9_, "notify::high-contrast", (GCallback) _wg_application_set_high_contrast_g_object_notify, self, 0);
	_tmp10_ = gtk_application_get_active_window ((GtkApplication*) self);
	_tmp11_ = _tmp10_;
	_tmp12_ = _g_object_ref0 (_tmp11_);
	win = _tmp12_;
	_tmp13_ = win;
	if (_tmp13_ == NULL) {
		WGWindow* _tmp14_;
		_tmp14_ = wg_window_new ((GtkApplication*) self);
		g_object_ref_sink (_tmp14_);
		_g_object_unref0 (win);
		win = (GtkWindow*) _tmp14_;
	}
	_tmp15_ = win;
	gtk_window_present (_tmp15_);
	_g_object_unref0 (win);
	_g_object_unref0 (css_provider);
	_g_object_unref0 (display);
}

static gint
wg_application_main (gchar** args,
                     gint args_length1)
{
	WGApplication* app = NULL;
	WGApplication* _tmp0_;
	gint result;
	setlocale (LC_ALL, "");
	bindtextdomain (WG_CONSTANTS_GETTEXT_PACKAGE, WG_CONSTANTS_LOCALE_DIR);
	bind_textdomain_codeset (WG_CONSTANTS_GETTEXT_PACKAGE, "UTF-8");
	textdomain (WG_CONSTANTS_GETTEXT_PACKAGE);
	_tmp0_ = wg_application_new ();
	app = _tmp0_;
	result = g_application_run ((GApplication*) app, (gint) args_length1, args);
	_g_object_unref0 (app);
	return result;
}

int
main (int argc,
      char ** argv)
{
	return wg_application_main (argv, argc);
}

static void
wg_application_on_about_action (WGApplication* self)
{
	AdwAboutWindow* dialog = NULL;
	GtkWindow* _tmp0_;
	GtkWindow* _tmp1_;
	GtkWindow* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar** _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	AdwAboutWindow* _tmp13_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_application_get_active_window ((GtkApplication*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_tmp3_ = g_strdup (WG_CONSTANTS_APP_ID);
	_tmp4_ = g_strdup (_ ("Blurble"));
	_tmp5_ = g_strdup (WG_CONSTANTS_VERSION);
	_tmp6_ = g_strdup ("Vojtěch Perník <develop@pervoj.cz>");
	_tmp7_ = g_new0 (gchar*, 1 + 1);
	_tmp7_[0] = _tmp6_;
	_tmp8_ = g_strdup ("Vojtěch Perník");
	_tmp9_ = g_strdup (_ ("translator-credits"));
	_tmp10_ = g_strdup (_ ("Copyright \xc2\xa9 2022 Vojtěch Perník"));
	_tmp11_ = g_strdup ("https://gitlab.gnome.org/World/Blurble");
	_tmp12_ = g_strdup ("https://gitlab.gnome.org/World/Blurble/-/issues");
	_tmp13_ = (AdwAboutWindow*) adw_about_window_new ();
	gtk_window_set_transient_for ((GtkWindow*) _tmp13_, _tmp2_);
	_g_object_unref0 (_tmp2_);
	adw_about_window_set_application_icon (_tmp13_, _tmp3_);
	_g_free0 (_tmp3_);
	adw_about_window_set_application_name (_tmp13_, _tmp4_);
	_g_free0 (_tmp4_);
	adw_about_window_set_version (_tmp13_, _tmp5_);
	_g_free0 (_tmp5_);
	adw_about_window_set_developers (_tmp13_, _tmp7_);
	_tmp7_ = (_vala_array_free (_tmp7_, 1, (GDestroyNotify) g_free), NULL);
	adw_about_window_set_developer_name (_tmp13_, _tmp8_);
	_g_free0 (_tmp8_);
	adw_about_window_set_translator_credits (_tmp13_, _tmp9_);
	_g_free0 (_tmp9_);
	adw_about_window_set_copyright (_tmp13_, _tmp10_);
	_g_free0 (_tmp10_);
	adw_about_window_set_license_type (_tmp13_, GTK_LICENSE_GPL_3_0);
	adw_about_window_set_website (_tmp13_, _tmp11_);
	_g_free0 (_tmp11_);
	adw_about_window_set_issue_url (_tmp13_, _tmp12_);
	_g_free0 (_tmp12_);
	g_object_ref_sink (_tmp13_);
	dialog = _tmp13_;
	gtk_window_present ((GtkWindow*) dialog);
	_g_object_unref0 (dialog);
}

static void
wg_application_set_high_contrast (WGApplication* self)
{
	GdkDisplay* display = NULL;
	GdkDisplay* _tmp0_;
	GdkDisplay* _tmp1_;
	GdkDisplay* _tmp2_;
	AdwStyleManager* _tmp3_;
	AdwStyleManager* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gdk_display_get_default ();
	_tmp1_ = _g_object_ref0 (_tmp0_);
	display = _tmp1_;
	_tmp2_ = display;
	_vala_assert (_tmp2_ != NULL, "display != null");
	_tmp3_ = adw_application_get_style_manager ((AdwApplication*) self);
	_tmp4_ = _tmp3_;
	_tmp5_ = adw_style_manager_get_high_contrast (_tmp4_);
	_tmp6_ = _tmp5_;
	if (_tmp6_) {
		GdkDisplay* _tmp7_;
		GtkCssProvider* _tmp8_;
		_tmp7_ = display;
		_tmp8_ = self->priv->css_provider_hc;
		gtk_style_context_add_provider_for_display (_tmp7_, (GtkStyleProvider*) _tmp8_, (guint) GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
	} else {
		GdkDisplay* _tmp9_;
		GtkCssProvider* _tmp10_;
		_tmp9_ = display;
		_tmp10_ = self->priv->css_provider_hc;
		gtk_style_context_remove_provider_for_display (_tmp9_, (GtkStyleProvider*) _tmp10_);
	}
	_g_object_unref0 (display);
}

static void
_wg_application_on_about_action_gsimple_action_activate_callback (GSimpleAction* action,
                                                                  GVariant* parameter,
                                                                  gpointer self)
{
	wg_application_on_about_action ((WGApplication*) self);
}

static void
_g_application_quit_gsimple_action_activate_callback (GSimpleAction* action,
                                                      GVariant* parameter,
                                                      gpointer self)
{
	g_application_quit ((GApplication*) self);
}

static void
_wg_application___lambda21_ (WGApplication* self)
{
	WGWindow* win = NULL;
	GtkWindow* _tmp0_;
	GtkWindow* _tmp1_;
	WGWindow* _tmp2_;
	WGWindow* _tmp3_;
	_tmp0_ = gtk_application_get_active_window ((GtkApplication*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, WG_TYPE_WINDOW, WGWindow));
	win = _tmp2_;
	_tmp3_ = win;
	wg_window_open_menu (_tmp3_);
	_g_object_unref0 (win);
}

static void
__wg_application___lambda21__g_simple_action_activate (GSimpleAction* _sender,
                                                       GVariant* parameter,
                                                       gpointer self)
{
	_wg_application___lambda21_ ((WGApplication*) self);
}

static GObject *
wg_application_constructor (GType type,
                            guint n_construct_properties,
                            GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	WGApplication * self;
	GActionEntry* action_entries = NULL;
	GActionEntry _tmp0_ = {0};
	GActionEntry _tmp1_ = {0};
	GActionEntry* _tmp2_;
	gint action_entries_length1;
	gint _action_entries_size_;
	GActionEntry* _tmp3_;
	gint _tmp3__length1;
	gchar* _tmp4_;
	gchar** _tmp5_;
	gchar** _tmp6_;
	gint _tmp6__length1;
	gchar* _tmp7_;
	gchar** _tmp8_;
	gchar** _tmp9_;
	gint _tmp9__length1;
	GSettings* _tmp10_;
	GAction* _tmp11_;
	GAction* _tmp12_;
	GSimpleAction* open_menu_action = NULL;
	GSimpleAction* _tmp13_;
	GSimpleAction* _tmp14_;
	gchar* _tmp15_;
	gchar** _tmp16_;
	gchar** _tmp17_;
	gint _tmp17__length1;
	GSimpleAction* _tmp18_;
	parent_class = G_OBJECT_CLASS (wg_application_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WG_TYPE_APPLICATION, WGApplication);
	memset (&_tmp0_, 0, sizeof (GActionEntry));
	_tmp0_.name = "about";
	_tmp0_.activate = _wg_application_on_about_action_gsimple_action_activate_callback;
	memset (&_tmp1_, 0, sizeof (GActionEntry));
	_tmp1_.name = "quit";
	_tmp1_.activate = _g_application_quit_gsimple_action_activate_callback;
	_tmp2_ = g_new0 (GActionEntry, 2);
	_tmp2_[0] = _tmp0_;
	_tmp2_[1] = _tmp1_;
	action_entries = _tmp2_;
	action_entries_length1 = 2;
	_action_entries_size_ = action_entries_length1;
	_tmp3_ = action_entries;
	_tmp3__length1 = action_entries_length1;
	g_action_map_add_action_entries ((GActionMap*) self, _tmp3_, (gint) _tmp3__length1, self);
	_tmp4_ = g_strdup ("<primary>q");
	_tmp5_ = g_new0 (gchar*, 1 + 1);
	_tmp5_[0] = _tmp4_;
	_tmp6_ = _tmp5_;
	_tmp6__length1 = 1;
	gtk_application_set_accels_for_action ((GtkApplication*) self, "app.quit", _tmp6_);
	_tmp6_ = (_vala_array_free (_tmp6_, _tmp6__length1, (GDestroyNotify) g_free), NULL);
	_tmp7_ = g_strdup ("F1");
	_tmp8_ = g_new0 (gchar*, 1 + 1);
	_tmp8_[0] = _tmp7_;
	_tmp9_ = _tmp8_;
	_tmp9__length1 = 1;
	gtk_application_set_accels_for_action ((GtkApplication*) self, "win.help", _tmp9_);
	_tmp9_ = (_vala_array_free (_tmp9_, _tmp9__length1, (GDestroyNotify) g_free), NULL);
	_tmp10_ = self->priv->settings;
	_tmp11_ = g_settings_create_action (_tmp10_, "show-keyboard");
	_tmp12_ = _tmp11_;
	g_action_map_add_action ((GActionMap*) self, _tmp12_);
	_g_object_unref0 (_tmp12_);
	_tmp13_ = g_simple_action_new ("open-menu", NULL);
	open_menu_action = _tmp13_;
	_tmp14_ = open_menu_action;
	g_action_map_add_action ((GActionMap*) self, (GAction*) _tmp14_);
	_tmp15_ = g_strdup ("F10");
	_tmp16_ = g_new0 (gchar*, 1 + 1);
	_tmp16_[0] = _tmp15_;
	_tmp17_ = _tmp16_;
	_tmp17__length1 = 1;
	gtk_application_set_accels_for_action ((GtkApplication*) self, "app.open-menu", _tmp17_);
	_tmp17_ = (_vala_array_free (_tmp17_, _tmp17__length1, (GDestroyNotify) g_free), NULL);
	_tmp18_ = open_menu_action;
	g_signal_connect_object (_tmp18_, "activate", (GCallback) __wg_application___lambda21__g_simple_action_activate, self, 0);
	_g_object_unref0 (open_menu_action);
	action_entries = (g_free (action_entries), NULL);
	return obj;
}

static void
wg_application_class_init (WGApplicationClass * klass,
                           gpointer klass_data)
{
	wg_application_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &WGApplication_private_offset);
	((GApplicationClass *) klass)->activate = (void (*) (GApplication*)) wg_application_real_activate;
	G_OBJECT_CLASS (klass)->constructor = wg_application_constructor;
	G_OBJECT_CLASS (klass)->finalize = wg_application_finalize;
}

static void
wg_application_instance_init (WGApplication * self,
                              gpointer klass)
{
	GtkCssProvider* _tmp0_;
	GSettings* _tmp1_;
	self->priv = wg_application_get_instance_private (self);
	_tmp0_ = gtk_css_provider_new ();
	self->priv->css_provider_hc = _tmp0_;
	_tmp1_ = g_settings_new (WG_CONSTANTS_APP_ID);
	self->priv->settings = _tmp1_;
}

static void
wg_application_finalize (GObject * obj)
{
	WGApplication * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WG_TYPE_APPLICATION, WGApplication);
	_g_object_unref0 (self->priv->css_provider_hc);
	_g_object_unref0 (self->priv->settings);
	G_OBJECT_CLASS (wg_application_parent_class)->finalize (obj);
}

static GType
wg_application_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (WGApplicationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) wg_application_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WGApplication), 0, (GInstanceInitFunc) wg_application_instance_init, NULL };
	GType wg_application_type_id;
	wg_application_type_id = g_type_register_static (adw_application_get_type (), "WGApplication", &g_define_type_info, 0);
	WGApplication_private_offset = g_type_add_instance_private (wg_application_type_id, sizeof (WGApplicationPrivate));
	return wg_application_type_id;
}

GType
wg_application_get_type (void)
{
	static volatile gsize wg_application_type_id__once = 0;
	if (g_once_init_enter (&wg_application_type_id__once)) {
		GType wg_application_type_id;
		wg_application_type_id = wg_application_get_type_once ();
		g_once_init_leave (&wg_application_type_id__once, wg_application_type_id);
	}
	return wg_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);
}

