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

/*
* Copyright (c) 2017 Felipe Escoto (https://github.com/Philip-Scott/Spice-up)
*
* 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 2 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, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Authored by: Felipe Escoto <felescoto95@hotmail.com>
*/

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

#define SPICE_APPLICATION_PROGRAM_NAME N_ ("Spice-Up")
#define SPICE_APPLICATION_ABOUT_STOCK N_ ("About Spice-Up")
#define SPICE_APPLICATION_APP_ID "com.github.philip_scott.spice-up"
#define SPICE_APPLICATION_RESOURCE_PATH "/com/github/philip-scott/spice-up/"
#define SPICE_APPLICATION_APP_NAME "Spice-Up"
#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 SPICE_SERVICES_TYPE_SETTINGS (spice_services_settings_get_type ())
#define SPICE_SERVICES_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPICE_SERVICES_TYPE_SETTINGS, SpiceServicesSettings))
#define SPICE_SERVICES_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SPICE_SERVICES_TYPE_SETTINGS, SpiceServicesSettingsClass))
#define SPICE_SERVICES_IS_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SPICE_SERVICES_TYPE_SETTINGS))
#define SPICE_SERVICES_IS_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SPICE_SERVICES_TYPE_SETTINGS))
#define SPICE_SERVICES_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SPICE_SERVICES_TYPE_SETTINGS, SpiceServicesSettingsClass))

typedef struct _SpiceServicesSettings SpiceServicesSettings;
typedef struct _SpiceServicesSettingsClass SpiceServicesSettingsClass;

#define SPICE_TYPE_APPLICATION (spice_application_get_type ())
#define SPICE_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPICE_TYPE_APPLICATION, SpiceApplication))
#define SPICE_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SPICE_TYPE_APPLICATION, SpiceApplicationClass))
#define SPICE_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SPICE_TYPE_APPLICATION))
#define SPICE_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SPICE_TYPE_APPLICATION))
#define SPICE_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SPICE_TYPE_APPLICATION, SpiceApplicationClass))

typedef struct _SpiceApplication SpiceApplication;
typedef struct _SpiceApplicationClass SpiceApplicationClass;
typedef struct _SpiceApplicationPrivate SpiceApplicationPrivate;

#define SPICE_TYPE_WINDOW (spice_window_get_type ())
#define SPICE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPICE_TYPE_WINDOW, SpiceWindow))
#define SPICE_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SPICE_TYPE_WINDOW, SpiceWindowClass))
#define SPICE_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SPICE_TYPE_WINDOW))
#define SPICE_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SPICE_TYPE_WINDOW))
#define SPICE_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SPICE_TYPE_WINDOW, SpiceWindowClass))

typedef struct _SpiceWindow SpiceWindow;
typedef struct _SpiceWindowClass SpiceWindowClass;
enum  {
	SPICE_APPLICATION_0_PROPERTY,
	SPICE_APPLICATION_NUM_PROPERTIES
};
static GParamSpec* spice_application_properties[SPICE_APPLICATION_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

struct _SpiceApplication {
	GtkApplication parent_instance;
	SpiceApplicationPrivate * priv;
	gboolean running;
};

struct _SpiceApplicationClass {
	GtkApplicationClass parent_class;
};

struct _SpiceApplicationPrivate {
	GeeHashMap* opened_files;
};

VALA_EXTERN gboolean DEBUG;
gboolean DEBUG = FALSE;
VALA_EXTERN SpiceServicesSettings* spice_settings;
SpiceServicesSettings* spice_settings = NULL;
VALA_EXTERN gchar* spice_DATA_DIR;
gchar* spice_DATA_DIR = NULL;
static gint SpiceApplication_private_offset;
static gpointer spice_application_parent_class = NULL;
VALA_EXTERN SpiceApplication* spice_application__instance;
SpiceApplication* spice_application__instance = NULL;

VALA_EXTERN GType spice_services_settings_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SpiceServicesSettings, g_object_unref)
VALA_EXTERN GType spice_application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SpiceApplication, g_object_unref)
VALA_EXTERN GType spice_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SpiceWindow, g_object_unref)
static void spice_application_real_open (GApplication* base,
                                  GFile** files,
                                  gint files_length1,
                                  const gchar* hint);
static void spice_application_init (SpiceApplication* self);
VALA_EXTERN gboolean spice_application_is_file_opened (SpiceApplication* self,
                                           GFile* file);
VALA_EXTERN SpiceWindow* spice_application_get_window_from_file (SpiceApplication* self,
                                                     GFile* file);
VALA_EXTERN void spice_window_show_app (SpiceWindow* self);
VALA_EXTERN SpiceWindow* spice_window_new (GtkApplication* app);
VALA_EXTERN SpiceWindow* spice_window_construct (GType object_type,
                                     GtkApplication* app);
VALA_EXTERN void spice_window_open_file (SpiceWindow* self,
                             GFile* file);
static void spice_application_real_activate (GApplication* base);
VALA_EXTERN void spice_window_show_welcome (SpiceWindow* self);
VALA_EXTERN SpiceWindow* spice_application_get_active_spice_window (void);
VALA_EXTERN SpiceApplication* spice_application_get_instance (void);
VALA_EXTERN void spice_application_unregister_file_from_window (SpiceApplication* self,
                                                    GFile* file);
VALA_EXTERN void spice_application_register_file_to_window (SpiceApplication* self,
                                                GFile* file,
                                                SpiceWindow* window);
static gint spice_application_main (gchar** args,
                             gint args_length1);
static gboolean _vala_string_array_contains (gchar* * stack,
                                      gssize stack_length,
                                      const gchar* needle);
VALA_EXTERN SpiceApplication* spice_application_new (void);
VALA_EXTERN SpiceApplication* spice_application_construct (GType object_type);
static GObject * spice_application_constructor (GType type,
                                         guint n_construct_properties,
                                         GObjectConstructParam * construct_properties);
VALA_EXTERN SpiceServicesSettings* spice_services_settings_get_instance (void);
static void spice_application_finalize (GObject * obj);
static GType spice_application_get_type_once (void);
static void _vala_spice_application_get_property (GObject * object,
                                           guint property_id,
                                           GValue * value,
                                           GParamSpec * pspec);
static gssize _vala_array_length (gpointer array);

static inline gpointer
spice_application_get_instance_private (SpiceApplication* self)
{
	return G_STRUCT_MEMBER_P (self, SpiceApplication_private_offset);
}

static gpointer
_g_object_ref0 (gpointer self)
{
#line 62 "../Spice-up-1.9.1/src/Application.vala"
	return self ? g_object_ref (self) : NULL;
#line 183 "Application.c"
}

static void
spice_application_real_open (GApplication* base,
                             GFile** files,
                             gint files_length1,
                             const gchar* hint)
{
	SpiceApplication * self;
#line 60 "../Spice-up-1.9.1/src/Application.vala"
	self = (SpiceApplication*) base;
#line 60 "../Spice-up-1.9.1/src/Application.vala"
	g_return_if_fail (hint != NULL);
#line 61 "../Spice-up-1.9.1/src/Application.vala"
	spice_application_init (self);
#line 199 "Application.c"
	{
		GFile** file_collection = NULL;
		gint file_collection_length1 = 0;
		gint _file_collection_size_ = 0;
		gint file_it = 0;
#line 62 "../Spice-up-1.9.1/src/Application.vala"
		file_collection = files;
#line 62 "../Spice-up-1.9.1/src/Application.vala"
		file_collection_length1 = files_length1;
#line 62 "../Spice-up-1.9.1/src/Application.vala"
		for (file_it = 0; file_it < file_collection_length1; file_it = file_it + 1) {
#line 211 "Application.c"
			GFile* _tmp0_;
			GFile* file = NULL;
#line 62 "../Spice-up-1.9.1/src/Application.vala"
			_tmp0_ = _g_object_ref0 (file_collection[file_it]);
#line 62 "../Spice-up-1.9.1/src/Application.vala"
			file = _tmp0_;
#line 218 "Application.c"
			{
				GFile* _tmp1_;
#line 63 "../Spice-up-1.9.1/src/Application.vala"
				_tmp1_ = file;
#line 63 "../Spice-up-1.9.1/src/Application.vala"
				if (spice_application_is_file_opened (self, _tmp1_)) {
#line 225 "Application.c"
					SpiceWindow* window = NULL;
					GFile* _tmp2_;
					SpiceWindow* _tmp3_;
					SpiceWindow* _tmp4_;
#line 65 "../Spice-up-1.9.1/src/Application.vala"
					_tmp2_ = file;
#line 65 "../Spice-up-1.9.1/src/Application.vala"
					_tmp3_ = spice_application_get_window_from_file (self, _tmp2_);
#line 65 "../Spice-up-1.9.1/src/Application.vala"
					window = _tmp3_;
#line 66 "../Spice-up-1.9.1/src/Application.vala"
					_tmp4_ = window;
#line 66 "../Spice-up-1.9.1/src/Application.vala"
					spice_window_show_app (_tmp4_);
#line 63 "../Spice-up-1.9.1/src/Application.vala"
					_g_object_unref0 (window);
#line 242 "Application.c"
				} else {
					SpiceWindow* window = NULL;
					SpiceWindow* _tmp5_;
					SpiceWindow* _tmp6_;
					SpiceWindow* _tmp7_;
					GFile* _tmp8_;
					SpiceWindow* _tmp9_;
#line 69 "../Spice-up-1.9.1/src/Application.vala"
					_tmp5_ = spice_window_new ((GtkApplication*) self);
#line 69 "../Spice-up-1.9.1/src/Application.vala"
					g_object_ref_sink (_tmp5_);
#line 69 "../Spice-up-1.9.1/src/Application.vala"
					window = _tmp5_;
#line 70 "../Spice-up-1.9.1/src/Application.vala"
					_tmp6_ = window;
#line 70 "../Spice-up-1.9.1/src/Application.vala"
					gtk_application_add_window ((GtkApplication*) self, (GtkWindow*) _tmp6_);
#line 72 "../Spice-up-1.9.1/src/Application.vala"
					_tmp7_ = window;
#line 72 "../Spice-up-1.9.1/src/Application.vala"
					_tmp8_ = file;
#line 72 "../Spice-up-1.9.1/src/Application.vala"
					spice_window_open_file (_tmp7_, _tmp8_);
#line 73 "../Spice-up-1.9.1/src/Application.vala"
					_tmp9_ = window;
#line 73 "../Spice-up-1.9.1/src/Application.vala"
					spice_window_show_app (_tmp9_);
#line 63 "../Spice-up-1.9.1/src/Application.vala"
					_g_object_unref0 (window);
#line 272 "Application.c"
				}
#line 62 "../Spice-up-1.9.1/src/Application.vala"
				_g_object_unref0 (file);
#line 276 "Application.c"
			}
		}
	}
}

static void
spice_application_init (SpiceApplication* self)
{
#line 78 "../Spice-up-1.9.1/src/Application.vala"
	g_return_if_fail (self != NULL);
#line 79 "../Spice-up-1.9.1/src/Application.vala"
	if (!self->running) {
#line 289 "Application.c"
		GtkSettings* _tmp0_;
		GtkIconTheme* default_theme = NULL;
		GtkIconTheme* _tmp1_;
		GtkIconTheme* _tmp2_;
#line 80 "../Spice-up-1.9.1/src/Application.vala"
		_tmp0_ = gtk_settings_get_default ();
#line 80 "../Spice-up-1.9.1/src/Application.vala"
		g_object_set (_tmp0_, "gtk-application-prefer-dark-theme", TRUE, NULL);
#line 81 "../Spice-up-1.9.1/src/Application.vala"
		_tmp1_ = gtk_icon_theme_get_default ();
#line 81 "../Spice-up-1.9.1/src/Application.vala"
		default_theme = _tmp1_;
#line 82 "../Spice-up-1.9.1/src/Application.vala"
		_tmp2_ = default_theme;
#line 82 "../Spice-up-1.9.1/src/Application.vala"
		gtk_icon_theme_add_resource_path (_tmp2_, SPICE_APPLICATION_RESOURCE_PATH);
#line 83 "../Spice-up-1.9.1/src/Application.vala"
		self->running = TRUE;
#line 308 "Application.c"
	}
}

static void
spice_application_real_activate (GApplication* base)
{
	SpiceApplication * self;
	SpiceWindow* window = NULL;
	SpiceWindow* _tmp0_;
	SpiceWindow* _tmp1_;
#line 87 "../Spice-up-1.9.1/src/Application.vala"
	self = (SpiceApplication*) base;
#line 88 "../Spice-up-1.9.1/src/Application.vala"
	spice_application_init (self);
#line 90 "../Spice-up-1.9.1/src/Application.vala"
	_tmp0_ = spice_window_new ((GtkApplication*) self);
#line 90 "../Spice-up-1.9.1/src/Application.vala"
	g_object_ref_sink (_tmp0_);
#line 90 "../Spice-up-1.9.1/src/Application.vala"
	window = _tmp0_;
#line 91 "../Spice-up-1.9.1/src/Application.vala"
	gtk_application_add_window ((GtkApplication*) self, (GtkWindow*) window);
#line 92 "../Spice-up-1.9.1/src/Application.vala"
	spice_window_show_welcome (window);
#line 94 "../Spice-up-1.9.1/src/Application.vala"
	_tmp1_ = spice_application_get_active_spice_window ();
#line 94 "../Spice-up-1.9.1/src/Application.vala"
	spice_window_show_app (_tmp1_);
#line 87 "../Spice-up-1.9.1/src/Application.vala"
	_g_object_unref0 (window);
#line 339 "Application.c"
}

SpiceWindow*
spice_application_get_active_spice_window (void)
{
	SpiceApplication* _tmp0_;
	SpiceApplication* _tmp1_;
	GtkWindow* _tmp2_;
	SpiceWindow* result;
#line 98 "../Spice-up-1.9.1/src/Application.vala"
	_tmp0_ = spice_application_get_instance ();
#line 98 "../Spice-up-1.9.1/src/Application.vala"
	_tmp1_ = _tmp0_;
#line 98 "../Spice-up-1.9.1/src/Application.vala"
	_tmp2_ = gtk_application_get_active_window ((GtkApplication*) _tmp1_);
#line 98 "../Spice-up-1.9.1/src/Application.vala"
	result = G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, SPICE_TYPE_WINDOW, SpiceWindow);
#line 98 "../Spice-up-1.9.1/src/Application.vala"
	return result;
#line 359 "Application.c"
}

gboolean
spice_application_is_file_opened (SpiceApplication* self,
                                  GFile* file)
{
	GeeHashMap* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gboolean _tmp3_;
	gboolean result;
#line 101 "../Spice-up-1.9.1/src/Application.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 101 "../Spice-up-1.9.1/src/Application.vala"
	g_return_val_if_fail (file != NULL, FALSE);
#line 102 "../Spice-up-1.9.1/src/Application.vala"
	_tmp0_ = self->priv->opened_files;
#line 102 "../Spice-up-1.9.1/src/Application.vala"
	_tmp1_ = g_file_get_uri (file);
#line 102 "../Spice-up-1.9.1/src/Application.vala"
	_tmp2_ = _tmp1_;
#line 102 "../Spice-up-1.9.1/src/Application.vala"
	_tmp3_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, _tmp2_);
#line 102 "../Spice-up-1.9.1/src/Application.vala"
	_g_free0 (_tmp2_);
#line 102 "../Spice-up-1.9.1/src/Application.vala"
	result = _tmp3_;
#line 102 "../Spice-up-1.9.1/src/Application.vala"
	return result;
#line 389 "Application.c"
}

void
spice_application_unregister_file_from_window (SpiceApplication* self,
                                               GFile* file)
{
#line 105 "../Spice-up-1.9.1/src/Application.vala"
	g_return_if_fail (self != NULL);
#line 105 "../Spice-up-1.9.1/src/Application.vala"
	g_return_if_fail (file != NULL);
#line 106 "../Spice-up-1.9.1/src/Application.vala"
	if (spice_application_is_file_opened (self, file)) {
#line 402 "Application.c"
		GeeHashMap* _tmp0_;
		gchar* _tmp1_;
		gchar* _tmp2_;
#line 107 "../Spice-up-1.9.1/src/Application.vala"
		_tmp0_ = self->priv->opened_files;
#line 107 "../Spice-up-1.9.1/src/Application.vala"
		_tmp1_ = g_file_get_uri (file);
#line 107 "../Spice-up-1.9.1/src/Application.vala"
		_tmp2_ = _tmp1_;
#line 107 "../Spice-up-1.9.1/src/Application.vala"
		gee_abstract_map_unset ((GeeAbstractMap*) _tmp0_, _tmp2_, NULL);
#line 107 "../Spice-up-1.9.1/src/Application.vala"
		_g_free0 (_tmp2_);
#line 416 "Application.c"
	}
}

void
spice_application_register_file_to_window (SpiceApplication* self,
                                           GFile* file,
                                           SpiceWindow* window)
{
#line 111 "../Spice-up-1.9.1/src/Application.vala"
	g_return_if_fail (self != NULL);
#line 111 "../Spice-up-1.9.1/src/Application.vala"
	g_return_if_fail (file != NULL);
#line 111 "../Spice-up-1.9.1/src/Application.vala"
	g_return_if_fail (window != NULL);
#line 112 "../Spice-up-1.9.1/src/Application.vala"
	if (!spice_application_is_file_opened (self, file)) {
#line 433 "Application.c"
		GeeHashMap* _tmp0_;
		gchar* _tmp1_;
		gchar* _tmp2_;
#line 113 "../Spice-up-1.9.1/src/Application.vala"
		_tmp0_ = self->priv->opened_files;
#line 113 "../Spice-up-1.9.1/src/Application.vala"
		_tmp1_ = g_file_get_uri (file);
#line 113 "../Spice-up-1.9.1/src/Application.vala"
		_tmp2_ = _tmp1_;
#line 113 "../Spice-up-1.9.1/src/Application.vala"
		gee_abstract_map_set ((GeeAbstractMap*) _tmp0_, _tmp2_, window);
#line 113 "../Spice-up-1.9.1/src/Application.vala"
		_g_free0 (_tmp2_);
#line 447 "Application.c"
	} else {
#line 115 "../Spice-up-1.9.1/src/Application.vala"
		g_warning ("Application.vala:115: File was opened in two separate windows");
#line 451 "Application.c"
	}
}

SpiceWindow*
spice_application_get_window_from_file (SpiceApplication* self,
                                        GFile* file)
{
	GeeHashMap* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gpointer _tmp3_;
	SpiceWindow* _tmp4_;
	SpiceWindow* result;
#line 119 "../Spice-up-1.9.1/src/Application.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 119 "../Spice-up-1.9.1/src/Application.vala"
	g_return_val_if_fail (file != NULL, NULL);
#line 120 "../Spice-up-1.9.1/src/Application.vala"
	_tmp0_ = self->priv->opened_files;
#line 120 "../Spice-up-1.9.1/src/Application.vala"
	_tmp1_ = g_file_get_uri (file);
#line 120 "../Spice-up-1.9.1/src/Application.vala"
	_tmp2_ = _tmp1_;
#line 120 "../Spice-up-1.9.1/src/Application.vala"
	_tmp3_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp0_, _tmp2_);
#line 120 "../Spice-up-1.9.1/src/Application.vala"
	_tmp4_ = (SpiceWindow*) _tmp3_;
#line 120 "../Spice-up-1.9.1/src/Application.vala"
	_g_free0 (_tmp2_);
#line 120 "../Spice-up-1.9.1/src/Application.vala"
	result = _tmp4_;
#line 120 "../Spice-up-1.9.1/src/Application.vala"
	return result;
#line 485 "Application.c"
}

static gboolean
_vala_string_array_contains (gchar* * stack,
                             gssize stack_length,
                             const gchar* needle)
{
	gssize i;
#line 124 "../Spice-up-1.9.1/src/Application.vala"
	for (i = 0; i < stack_length; i++) {
#line 124 "../Spice-up-1.9.1/src/Application.vala"
		if (g_strcmp0 (stack[i], needle) == 0) {
#line 124 "../Spice-up-1.9.1/src/Application.vala"
			return TRUE;
#line 500 "Application.c"
		}
	}
#line 124 "../Spice-up-1.9.1/src/Application.vala"
	return FALSE;
#line 505 "Application.c"
}

static gint
spice_application_main (gchar** args,
                        gint args_length1)
{
	gchar** _tmp0_;
	gchar** _tmp1_;
	const gchar* _tmp2_;
	SpiceApplication* application = NULL;
	SpiceApplication* _tmp3_;
	SpiceApplication* _tmp4_;
	SpiceApplication* _tmp5_;
	gint result;
#line 124 "../Spice-up-1.9.1/src/Application.vala"
	DEBUG = _vala_string_array_contains (args, args_length1, "-d");
#line 127 "../Spice-up-1.9.1/src/Application.vala"
	_tmp1_ = _tmp0_ = g_get_language_names ();
#line 127 "../Spice-up-1.9.1/src/Application.vala"
	_tmp2_ = _tmp1_[0];
#line 127 "../Spice-up-1.9.1/src/Application.vala"
	setlocale (LC_ALL, _tmp2_);
#line 131 "../Spice-up-1.9.1/src/Application.vala"
	g_set_application_name (SPICE_APPLICATION_APP_NAME);
#line 132 "../Spice-up-1.9.1/src/Application.vala"
	g_set_prgname (SPICE_APPLICATION_APP_NAME);
#line 134 "../Spice-up-1.9.1/src/Application.vala"
	_tmp3_ = spice_application_get_instance ();
#line 134 "../Spice-up-1.9.1/src/Application.vala"
	_tmp4_ = _tmp3_;
#line 134 "../Spice-up-1.9.1/src/Application.vala"
	_tmp5_ = _g_object_ref0 (_tmp4_);
#line 134 "../Spice-up-1.9.1/src/Application.vala"
	application = _tmp5_;
#line 136 "../Spice-up-1.9.1/src/Application.vala"
	result = g_application_run ((GApplication*) application, (gint) args_length1, args);
#line 136 "../Spice-up-1.9.1/src/Application.vala"
	_g_object_unref0 (application);
#line 136 "../Spice-up-1.9.1/src/Application.vala"
	return result;
#line 546 "Application.c"
}

int
main (int argc,
      char ** argv)
{
#line 123 "../Spice-up-1.9.1/src/Application.vala"
	return spice_application_main (argv, argc);
#line 555 "Application.c"
}

SpiceApplication*
spice_application_construct (GType object_type)
{
	SpiceApplication * self = NULL;
#line 29 "../Spice-up-1.9.1/src/Application.vala"
	self = (SpiceApplication*) g_object_new (object_type, NULL);
#line 29 "../Spice-up-1.9.1/src/Application.vala"
	return self;
#line 566 "Application.c"
}

SpiceApplication*
spice_application_new (void)
{
#line 29 "../Spice-up-1.9.1/src/Application.vala"
	return spice_application_construct (SPICE_TYPE_APPLICATION);
#line 574 "Application.c"
}

SpiceApplication*
spice_application_get_instance (void)
{
	SpiceApplication* result;
	SpiceApplication* _tmp0_;
	SpiceApplication* _tmp2_;
#line 42 "../Spice-up-1.9.1/src/Application.vala"
	_tmp0_ = spice_application__instance;
#line 42 "../Spice-up-1.9.1/src/Application.vala"
	if (_tmp0_ == NULL) {
#line 587 "Application.c"
		SpiceApplication* _tmp1_;
#line 43 "../Spice-up-1.9.1/src/Application.vala"
		_tmp1_ = spice_application_new ();
#line 43 "../Spice-up-1.9.1/src/Application.vala"
		_g_object_unref0 (spice_application__instance);
#line 43 "../Spice-up-1.9.1/src/Application.vala"
		spice_application__instance = _tmp1_;
#line 595 "Application.c"
	}
#line 45 "../Spice-up-1.9.1/src/Application.vala"
	_tmp2_ = spice_application__instance;
#line 45 "../Spice-up-1.9.1/src/Application.vala"
	result = _tmp2_;
#line 45 "../Spice-up-1.9.1/src/Application.vala"
	return result;
#line 603 "Application.c"
}

static GObject *
spice_application_constructor (GType type,
                               guint n_construct_properties,
                               GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SpiceApplication * self;
	GApplicationFlags _tmp0_;
	GApplicationFlags _tmp1_;
	GeeHashMap* _tmp2_;
	SpiceServicesSettings* _tmp3_;
#line 51 "../Spice-up-1.9.1/src/Application.vala"
	parent_class = G_OBJECT_CLASS (spice_application_parent_class);
#line 51 "../Spice-up-1.9.1/src/Application.vala"
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
#line 51 "../Spice-up-1.9.1/src/Application.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SPICE_TYPE_APPLICATION, SpiceApplication);
#line 52 "../Spice-up-1.9.1/src/Application.vala"
	_tmp0_ = g_application_get_flags ((GApplication*) self);
#line 52 "../Spice-up-1.9.1/src/Application.vala"
	_tmp1_ = _tmp0_;
#line 52 "../Spice-up-1.9.1/src/Application.vala"
	g_application_set_flags ((GApplication*) self, _tmp1_ | G_APPLICATION_HANDLES_OPEN);
#line 54 "../Spice-up-1.9.1/src/Application.vala"
	g_application_set_application_id ((GApplication*) self, SPICE_APPLICATION_APP_ID);
#line 56 "../Spice-up-1.9.1/src/Application.vala"
	_tmp2_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, SPICE_TYPE_WINDOW, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
#line 56 "../Spice-up-1.9.1/src/Application.vala"
	_g_object_unref0 (self->priv->opened_files);
#line 56 "../Spice-up-1.9.1/src/Application.vala"
	self->priv->opened_files = _tmp2_;
#line 57 "../Spice-up-1.9.1/src/Application.vala"
	_tmp3_ = spice_services_settings_get_instance ();
#line 57 "../Spice-up-1.9.1/src/Application.vala"
	_g_object_unref0 (spice_settings);
#line 57 "../Spice-up-1.9.1/src/Application.vala"
	spice_settings = _tmp3_;
#line 51 "../Spice-up-1.9.1/src/Application.vala"
	return obj;
#line 646 "Application.c"
}

static void
spice_application_class_init (SpiceApplicationClass * klass,
                              gpointer klass_data)
{
#line 29 "../Spice-up-1.9.1/src/Application.vala"
	spice_application_parent_class = g_type_class_peek_parent (klass);
#line 29 "../Spice-up-1.9.1/src/Application.vala"
	g_type_class_adjust_private_offset (klass, &SpiceApplication_private_offset);
#line 29 "../Spice-up-1.9.1/src/Application.vala"
	((GApplicationClass *) klass)->open = (void (*) (GApplication*, GFile**, gint, const gchar*)) spice_application_real_open;
#line 29 "../Spice-up-1.9.1/src/Application.vala"
	((GApplicationClass *) klass)->activate = (void (*) (GApplication*)) spice_application_real_activate;
#line 29 "../Spice-up-1.9.1/src/Application.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_spice_application_get_property;
#line 29 "../Spice-up-1.9.1/src/Application.vala"
	G_OBJECT_CLASS (klass)->constructor = spice_application_constructor;
#line 29 "../Spice-up-1.9.1/src/Application.vala"
	G_OBJECT_CLASS (klass)->finalize = spice_application_finalize;
#line 667 "Application.c"
}

static void
spice_application_instance_init (SpiceApplication * self,
                                 gpointer klass)
{
#line 29 "../Spice-up-1.9.1/src/Application.vala"
	self->priv = spice_application_get_instance_private (self);
#line 37 "../Spice-up-1.9.1/src/Application.vala"
	self->running = FALSE;
#line 678 "Application.c"
}

static void
spice_application_finalize (GObject * obj)
{
	SpiceApplication * self;
#line 29 "../Spice-up-1.9.1/src/Application.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SPICE_TYPE_APPLICATION, SpiceApplication);
#line 49 "../Spice-up-1.9.1/src/Application.vala"
	_g_object_unref0 (self->priv->opened_files);
#line 29 "../Spice-up-1.9.1/src/Application.vala"
	G_OBJECT_CLASS (spice_application_parent_class)->finalize (obj);
#line 691 "Application.c"
}

static GType
spice_application_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SpiceApplicationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) spice_application_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SpiceApplication), 0, (GInstanceInitFunc) spice_application_instance_init, NULL };
	GType spice_application_type_id;
	spice_application_type_id = g_type_register_static (gtk_application_get_type (), "SpiceApplication", &g_define_type_info, 0);
	SpiceApplication_private_offset = g_type_add_instance_private (spice_application_type_id, sizeof (SpiceApplicationPrivate));
	return spice_application_type_id;
}

GType
spice_application_get_type (void)
{
	static volatile gsize spice_application_type_id__once = 0;
	if (g_once_init_enter (&spice_application_type_id__once)) {
		GType spice_application_type_id;
		spice_application_type_id = spice_application_get_type_once ();
		g_once_init_leave (&spice_application_type_id__once, spice_application_type_id);
	}
	return spice_application_type_id__once;
}

static void
_vala_spice_application_get_property (GObject * object,
                                      guint property_id,
                                      GValue * value,
                                      GParamSpec * pspec)
{
	SpiceApplication * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SPICE_TYPE_APPLICATION, SpiceApplication);
#line 29 "../Spice-up-1.9.1/src/Application.vala"
	switch (property_id) {
#line 726 "Application.c"
		default:
#line 29 "../Spice-up-1.9.1/src/Application.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 29 "../Spice-up-1.9.1/src/Application.vala"
		break;
#line 732 "Application.c"
	}
}

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

