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

/*
* Copyright (c) 2018 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 <gtk/gtk.h>
#include <glib-object.h>
#include <granite.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <gio/gio.h>

#define SPICE_WELCOME_TEMPLATES_URL "https://spice-up-dev.azurewebsites.net/api/get-templates"
#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_TYPE_WELCOME (spice_welcome_get_type ())
#define SPICE_WELCOME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPICE_TYPE_WELCOME, SpiceWelcome))
#define SPICE_WELCOME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SPICE_TYPE_WELCOME, SpiceWelcomeClass))
#define SPICE_IS_WELCOME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SPICE_TYPE_WELCOME))
#define SPICE_IS_WELCOME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SPICE_TYPE_WELCOME))
#define SPICE_WELCOME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SPICE_TYPE_WELCOME, SpiceWelcomeClass))

typedef struct _SpiceWelcome SpiceWelcome;
typedef struct _SpiceWelcomeClass SpiceWelcomeClass;
typedef struct _SpiceWelcomePrivate SpiceWelcomePrivate;

#define SPICE_WIDGETS_LIBRARY_TYPE_LIBRARY (spice_widgets_library_library_get_type ())
#define SPICE_WIDGETS_LIBRARY_LIBRARY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPICE_WIDGETS_LIBRARY_TYPE_LIBRARY, SpiceWidgetsLibraryLibrary))
#define SPICE_WIDGETS_LIBRARY_LIBRARY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SPICE_WIDGETS_LIBRARY_TYPE_LIBRARY, SpiceWidgetsLibraryLibraryClass))
#define SPICE_WIDGETS_LIBRARY_IS_LIBRARY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SPICE_WIDGETS_LIBRARY_TYPE_LIBRARY))
#define SPICE_WIDGETS_LIBRARY_IS_LIBRARY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SPICE_WIDGETS_LIBRARY_TYPE_LIBRARY))
#define SPICE_WIDGETS_LIBRARY_LIBRARY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SPICE_WIDGETS_LIBRARY_TYPE_LIBRARY, SpiceWidgetsLibraryLibraryClass))

typedef struct _SpiceWidgetsLibraryLibrary SpiceWidgetsLibraryLibrary;
typedef struct _SpiceWidgetsLibraryLibraryClass SpiceWidgetsLibraryLibraryClass;
enum  {
	SPICE_WELCOME_0_PROPERTY,
	SPICE_WELCOME_NUM_PROPERTIES
};
static GParamSpec* spice_welcome_properties[SPICE_WELCOME_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#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;
enum  {
	SPICE_WELCOME_OPEN_FILE_SIGNAL,
	SPICE_WELCOME_NUM_SIGNALS
};
static guint spice_welcome_signals[SPICE_WELCOME_NUM_SIGNALS] = {0};

struct _SpiceWelcome {
	GtkBox parent_instance;
	SpiceWelcomePrivate * priv;
};

struct _SpiceWelcomeClass {
	GtkBoxClass parent_class;
};

struct _SpiceWelcomePrivate {
	GraniteWidgetsWelcome* welcome;
	SpiceWidgetsLibraryLibrary* library;
	SpiceWidgetsLibraryLibrary* templates;
	GtkSeparator* separator;
	GtkStack* welcome_stack;
};

static gint SpiceWelcome_private_offset;
static gpointer spice_welcome_parent_class = NULL;
VALA_EXTERN SpiceServicesSettings* spice_settings;

VALA_EXTERN GType spice_welcome_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SpiceWelcome, g_object_unref)
VALA_EXTERN GType spice_widgets_library_library_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SpiceWidgetsLibraryLibrary, g_object_unref)
VALA_EXTERN SpiceWelcome* spice_welcome_new (void);
VALA_EXTERN SpiceWelcome* spice_welcome_construct (GType object_type);
static void __lambda127_ (SpiceWelcome* self,
                   gint index);
VALA_EXTERN void spice_welcome_show_templates (SpiceWelcome* self);
VALA_EXTERN GFile* spice_services_file_manager_open_presentation (void);
static void ___lambda127__granite_widgets_welcome_activated (GraniteWidgetsWelcome* _sender,
                                                      gint index,
                                                      gpointer self);
VALA_EXTERN SpiceWidgetsLibraryLibrary* spice_widgets_library_library_new_for_templates (void);
VALA_EXTERN SpiceWidgetsLibraryLibrary* spice_widgets_library_library_construct_for_templates (GType object_type);
static void ___lambda128_ (SpiceWelcome* self,
                    const gchar* data);
VALA_EXTERN GFile* spice_services_file_manager_new_presentation (const gchar* data);
static void ____lambda128__spice_widgets_library_library_item_selected (SpiceWidgetsLibraryLibrary* _sender,
                                                                 const gchar* data,
                                                                 gpointer self);
VALA_EXTERN void spice_welcome_reload (SpiceWelcome* self);
VALA_EXTERN GType spice_services_settings_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SpiceServicesSettings, g_object_unref)
VALA_EXTERN gchar** spice_services_settings_get_last_files (SpiceServicesSettings* self,
                                                gint* result_length1);
static gchar** _vala_array_dup3 (gchar** self,
                          gssize length);
VALA_EXTERN SpiceWidgetsLibraryLibrary* spice_widgets_library_library_new (gchar** files,
                                                               gint files_length1);
VALA_EXTERN SpiceWidgetsLibraryLibrary* spice_widgets_library_library_construct (GType object_type,
                                                                     gchar** files,
                                                                     gint files_length1);
static void ___lambda129_ (SpiceWelcome* self,
                    GFile* file);
static void ____lambda129__spice_widgets_library_library_file_selected (SpiceWidgetsLibraryLibrary* _sender,
                                                                 GFile* file,
                                                                 gpointer self);
static void spice_welcome_finalize (GObject * obj);
static GType spice_welcome_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
spice_welcome_get_instance_private (SpiceWelcome* self)
{
	return G_STRUCT_MEMBER_P (self, SpiceWelcome_private_offset);
}

static void
__lambda127_ (SpiceWelcome* self,
              gint index)
{
#line 56 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	switch (index) {
#line 56 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		case 0:
#line 178 "Welcome.c"
		{
#line 58 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
			spice_welcome_show_templates (self);
#line 59 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
			break;
#line 184 "Welcome.c"
		}
#line 56 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		case 1:
#line 188 "Welcome.c"
		{
			GFile* file = NULL;
			GFile* _tmp0_;
			GFile* _tmp1_;
#line 61 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
			_tmp0_ = spice_services_file_manager_open_presentation ();
#line 61 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
			file = _tmp0_;
#line 62 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
			_tmp1_ = file;
#line 62 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
			if (_tmp1_ != NULL) {
#line 201 "Welcome.c"
				GFile* _tmp2_;
#line 62 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
				_tmp2_ = file;
#line 62 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
				g_signal_emit (self, spice_welcome_signals[SPICE_WELCOME_OPEN_FILE_SIGNAL], 0, _tmp2_);
#line 207 "Welcome.c"
			}
#line 63 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
			_g_object_unref0 (file);
#line 63 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
			break;
#line 213 "Welcome.c"
		}
		default:
#line 56 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		break;
#line 218 "Welcome.c"
	}
}

static void
___lambda127__granite_widgets_welcome_activated (GraniteWidgetsWelcome* _sender,
                                                 gint index,
                                                 gpointer self)
{
#line 55 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	__lambda127_ ((SpiceWelcome*) self, index);
#line 229 "Welcome.c"
}

SpiceWelcome*
spice_welcome_construct (GType object_type)
{
	SpiceWelcome * self = NULL;
	GtkStyleContext* _tmp0_;
	GraniteWidgetsWelcome* _tmp1_;
	GraniteWidgetsWelcome* _tmp2_;
	GraniteWidgetsWelcome* _tmp3_;
	GraniteWidgetsWelcome* _tmp4_;
	GtkSeparator* _tmp5_;
	GtkStack* _tmp6_;
	GtkStack* _tmp7_;
	GraniteWidgetsWelcome* _tmp8_;
	GtkStack* _tmp9_;
	GraniteWidgetsWelcome* _tmp10_;
	GtkStack* _tmp11_;
	GtkSeparator* _tmp12_;
	GraniteWidgetsWelcome* _tmp13_;
#line 33 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	self = (SpiceWelcome*) g_object_new (object_type, NULL);
#line 34 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	gtk_orientable_set_orientation ((GtkOrientable*) self, GTK_ORIENTATION_HORIZONTAL);
#line 35 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_tmp0_ = gtk_widget_get_style_context ((GtkWidget*) self);
#line 35 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	gtk_style_context_add_class (_tmp0_, "view");
#line 37 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	g_object_set ((GtkWidget*) self, "width-request", 950, NULL);
#line 38 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	g_object_set ((GtkWidget*) self, "height-request", 500, NULL);
#line 40 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_tmp1_ = granite_widgets_welcome_new ("Spice-Up", _ ("Make a Simple Presentation"));
#line 40 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	g_object_ref_sink (_tmp1_);
#line 40 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_g_object_unref0 (self->priv->welcome);
#line 40 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	self->priv->welcome = _tmp1_;
#line 41 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_tmp2_ = self->priv->welcome;
#line 41 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	gtk_widget_set_hexpand ((GtkWidget*) _tmp2_, TRUE);
#line 43 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_tmp3_ = self->priv->welcome;
#line 43 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	granite_widgets_welcome_append (_tmp3_, "document-new", _ ("New Presentation"), _ ("Create a new presentation"));
#line 44 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_tmp4_ = self->priv->welcome;
#line 44 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	granite_widgets_welcome_append (_tmp4_, "folder-open", _ ("Open File"), _ ("Open a saved presentation"));
#line 46 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_tmp5_ = (GtkSeparator*) gtk_separator_new (GTK_ORIENTATION_VERTICAL);
#line 46 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	g_object_ref_sink (_tmp5_);
#line 46 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_g_object_unref0 (self->priv->separator);
#line 46 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	self->priv->separator = _tmp5_;
#line 48 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_tmp6_ = (GtkStack*) gtk_stack_new ();
#line 48 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	g_object_ref_sink (_tmp6_);
#line 48 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_g_object_unref0 (self->priv->welcome_stack);
#line 48 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	self->priv->welcome_stack = _tmp6_;
#line 49 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_tmp7_ = self->priv->welcome_stack;
#line 49 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_tmp8_ = self->priv->welcome;
#line 49 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	gtk_stack_add_named (_tmp7_, (GtkWidget*) _tmp8_, "welcome");
#line 50 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_tmp9_ = self->priv->welcome_stack;
#line 50 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_tmp10_ = self->priv->welcome;
#line 50 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	gtk_stack_set_visible_child (_tmp9_, (GtkWidget*) _tmp10_);
#line 52 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_tmp11_ = self->priv->welcome_stack;
#line 52 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp11_);
#line 53 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_tmp12_ = self->priv->separator;
#line 53 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp12_);
#line 55 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_tmp13_ = self->priv->welcome;
#line 55 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	g_signal_connect_object (_tmp13_, "activated", (GCallback) ___lambda127__granite_widgets_welcome_activated, self, 0);
#line 33 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	return self;
#line 324 "Welcome.c"
}

SpiceWelcome*
spice_welcome_new (void)
{
#line 33 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	return spice_welcome_construct (SPICE_TYPE_WELCOME);
#line 332 "Welcome.c"
}

static void
___lambda128_ (SpiceWelcome* self,
               const gchar* data)
{
	GFile* file = NULL;
	GFile* _tmp0_;
	GFile* _tmp1_;
#line 74 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	g_return_if_fail (data != NULL);
#line 75 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_tmp0_ = spice_services_file_manager_new_presentation (data);
#line 75 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	file = _tmp0_;
#line 76 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_tmp1_ = file;
#line 76 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	if (_tmp1_ != NULL) {
#line 352 "Welcome.c"
		GFile* _tmp2_;
#line 77 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		_tmp2_ = file;
#line 77 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		g_signal_emit (self, spice_welcome_signals[SPICE_WELCOME_OPEN_FILE_SIGNAL], 0, _tmp2_);
#line 358 "Welcome.c"
	}
#line 74 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_g_object_unref0 (file);
#line 362 "Welcome.c"
}

static void
____lambda128__spice_widgets_library_library_item_selected (SpiceWidgetsLibraryLibrary* _sender,
                                                            const gchar* data,
                                                            gpointer self)
{
#line 74 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	___lambda128_ ((SpiceWelcome*) self, data);
#line 372 "Welcome.c"
}

void
spice_welcome_show_templates (SpiceWelcome* self)
{
	SpiceWidgetsLibraryLibrary* _tmp0_;
	GtkStack* _tmp6_;
#line 68 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	g_return_if_fail (self != NULL);
#line 69 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_tmp0_ = self->priv->templates;
#line 69 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	if (_tmp0_ == NULL) {
#line 386 "Welcome.c"
		SpiceWidgetsLibraryLibrary* _tmp1_;
		GtkStack* _tmp2_;
		SpiceWidgetsLibraryLibrary* _tmp3_;
		GtkStack* _tmp4_;
		SpiceWidgetsLibraryLibrary* _tmp5_;
#line 70 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		_tmp1_ = spice_widgets_library_library_new_for_templates ();
#line 70 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		g_object_ref_sink (_tmp1_);
#line 70 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		_g_object_unref0 (self->priv->templates);
#line 70 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		self->priv->templates = _tmp1_;
#line 71 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		_tmp2_ = self->priv->welcome_stack;
#line 71 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		_tmp3_ = self->priv->templates;
#line 71 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		gtk_stack_add_named (_tmp2_, (GtkWidget*) _tmp3_, "templates");
#line 72 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		_tmp4_ = self->priv->welcome_stack;
#line 72 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		gtk_widget_show_all ((GtkWidget*) _tmp4_);
#line 74 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		_tmp5_ = self->priv->templates;
#line 74 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		g_signal_connect_object (_tmp5_, "item-selected", (GCallback) ____lambda128__spice_widgets_library_library_item_selected, self, 0);
#line 414 "Welcome.c"
	}
#line 82 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_tmp6_ = self->priv->welcome_stack;
#line 82 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	gtk_stack_set_visible_child_full (_tmp6_, "templates", GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT);
#line 420 "Welcome.c"
}

static gchar**
_vala_array_dup3 (gchar** self,
                  gssize length)
{
#line 86 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	if (length >= 0) {
#line 429 "Welcome.c"
		gchar** result;
		gssize i;
#line 86 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		result = g_new0 (gchar*, length + 1);
#line 86 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		for (i = 0; i < length; i++) {
#line 436 "Welcome.c"
			gchar* _tmp0_;
#line 86 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
			_tmp0_ = g_strdup (self[i]);
#line 86 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
			result[i] = _tmp0_;
#line 442 "Welcome.c"
		}
#line 86 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		return result;
#line 446 "Welcome.c"
	}
#line 86 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	return NULL;
#line 450 "Welcome.c"
}

static void
___lambda129_ (SpiceWelcome* self,
               GFile* file)
{
#line 99 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	g_return_if_fail (file != NULL);
#line 100 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	g_signal_emit (self, spice_welcome_signals[SPICE_WELCOME_OPEN_FILE_SIGNAL], 0, file);
#line 461 "Welcome.c"
}

static void
____lambda129__spice_widgets_library_library_file_selected (SpiceWidgetsLibraryLibrary* _sender,
                                                            GFile* file,
                                                            gpointer self)
{
#line 99 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	___lambda129_ ((SpiceWelcome*) self, file);
#line 471 "Welcome.c"
}

void
spice_welcome_reload (SpiceWelcome* self)
{
	gchar** files = NULL;
	SpiceServicesSettings* _tmp0_;
	gchar** _tmp1_;
	gint _tmp1__length1;
	gint _tmp2_ = 0;
	gchar** _tmp3_;
	gint _tmp3__length1;
	gchar** _tmp4_;
	gint _tmp4__length1;
	gint files_length1;
	gint _files_size_;
	GtkStack* _tmp5_;
	SpiceWidgetsLibraryLibrary* _tmp6_;
	gboolean _tmp9_ = FALSE;
	gchar** _tmp10_;
	gint _tmp10__length1;
#line 85 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	g_return_if_fail (self != NULL);
#line 86 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_tmp0_ = spice_settings;
#line 86 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_tmp1_ = spice_services_settings_get_last_files (_tmp0_, &_tmp2_);
#line 86 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_tmp1__length1 = _tmp2_;
#line 86 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_tmp3_ = _tmp1_;
#line 86 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_tmp3__length1 = _tmp1__length1;
#line 86 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_tmp4_ = (_tmp3_ != NULL) ? _vala_array_dup3 (_tmp3_, _tmp3__length1) : _tmp3_;
#line 86 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_tmp4__length1 = _tmp3__length1;
#line 86 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	files = _tmp4_;
#line 86 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	files_length1 = _tmp4__length1;
#line 86 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_files_size_ = files_length1;
#line 87 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_tmp5_ = self->priv->welcome_stack;
#line 87 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	gtk_stack_set_visible_child_full (_tmp5_, "welcome", GTK_STACK_TRANSITION_TYPE_NONE);
#line 89 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_tmp6_ = self->priv->library;
#line 89 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	if (_tmp6_ != NULL) {
#line 523 "Welcome.c"
		SpiceWidgetsLibraryLibrary* _tmp7_;
		SpiceWidgetsLibraryLibrary* _tmp8_;
#line 90 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		_tmp7_ = self->priv->library;
#line 90 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		gtk_container_remove ((GtkContainer*) self, (GtkWidget*) _tmp7_);
#line 91 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		_tmp8_ = self->priv->library;
#line 91 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		gtk_widget_destroy ((GtkWidget*) _tmp8_);
#line 92 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		_g_object_unref0 (self->priv->library);
#line 92 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		self->priv->library = NULL;
#line 538 "Welcome.c"
	}
#line 95 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_tmp10_ = files;
#line 95 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_tmp10__length1 = files_length1;
#line 95 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	if (_tmp10__length1 > 0) {
#line 95 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		_tmp9_ = granite_services_system_history_is_enabled ();
#line 548 "Welcome.c"
	} else {
#line 95 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		_tmp9_ = FALSE;
#line 552 "Welcome.c"
	}
#line 95 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	if (_tmp9_) {
#line 556 "Welcome.c"
		gchar** _tmp11_;
		gint _tmp11__length1;
		SpiceWidgetsLibraryLibrary* _tmp12_;
		SpiceWidgetsLibraryLibrary* _tmp13_;
		SpiceWidgetsLibraryLibrary* _tmp14_;
		GtkSeparator* _tmp15_;
		GtkSeparator* _tmp16_;
#line 96 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		_tmp11_ = files;
#line 96 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		_tmp11__length1 = files_length1;
#line 96 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		_tmp12_ = spice_widgets_library_library_new (_tmp11_, _tmp11__length1);
#line 96 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		g_object_ref_sink (_tmp12_);
#line 96 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		_g_object_unref0 (self->priv->library);
#line 96 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		self->priv->library = _tmp12_;
#line 97 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		_tmp13_ = self->priv->library;
#line 97 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp13_);
#line 99 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		_tmp14_ = self->priv->library;
#line 99 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		g_signal_connect_object (_tmp14_, "file-selected", (GCallback) ____lambda129__spice_widgets_library_library_file_selected, self, 0);
#line 103 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		_tmp15_ = self->priv->separator;
#line 103 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		gtk_widget_set_visible ((GtkWidget*) _tmp15_, TRUE);
#line 104 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		_tmp16_ = self->priv->separator;
#line 104 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		gtk_widget_set_no_show_all ((GtkWidget*) _tmp16_, FALSE);
#line 106 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		gtk_widget_show_all ((GtkWidget*) self);
#line 594 "Welcome.c"
	} else {
		GtkSeparator* _tmp17_;
		GtkSeparator* _tmp18_;
#line 108 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		_tmp17_ = self->priv->separator;
#line 108 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		gtk_widget_set_visible ((GtkWidget*) _tmp17_, FALSE);
#line 109 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		_tmp18_ = self->priv->separator;
#line 109 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
		gtk_widget_set_no_show_all ((GtkWidget*) _tmp18_, TRUE);
#line 606 "Welcome.c"
	}
#line 85 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	files = (_vala_array_free (files, files_length1, (GDestroyNotify) g_free), NULL);
#line 610 "Welcome.c"
}

static void
spice_welcome_class_init (SpiceWelcomeClass * klass,
                          gpointer klass_data)
{
#line 22 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	spice_welcome_parent_class = g_type_class_peek_parent (klass);
#line 22 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	g_type_class_adjust_private_offset (klass, &SpiceWelcome_private_offset);
#line 22 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	G_OBJECT_CLASS (klass)->finalize = spice_welcome_finalize;
#line 22 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	spice_welcome_signals[SPICE_WELCOME_OPEN_FILE_SIGNAL] = g_signal_new ("open-file", SPICE_TYPE_WELCOME, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, g_file_get_type ());
#line 625 "Welcome.c"
}

static void
spice_welcome_instance_init (SpiceWelcome * self,
                             gpointer klass)
{
#line 22 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	self->priv = spice_welcome_get_instance_private (self);
#line 28 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	self->priv->library = NULL;
#line 29 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	self->priv->templates = NULL;
#line 638 "Welcome.c"
}

static void
spice_welcome_finalize (GObject * obj)
{
	SpiceWelcome * self;
#line 22 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SPICE_TYPE_WELCOME, SpiceWelcome);
#line 27 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_g_object_unref0 (self->priv->welcome);
#line 28 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_g_object_unref0 (self->priv->library);
#line 29 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_g_object_unref0 (self->priv->templates);
#line 30 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_g_object_unref0 (self->priv->separator);
#line 31 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	_g_object_unref0 (self->priv->welcome_stack);
#line 22 "../Spice-up-1.9.1/src/Widgets/Welcome.vala"
	G_OBJECT_CLASS (spice_welcome_parent_class)->finalize (obj);
#line 659 "Welcome.c"
}

static GType
spice_welcome_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SpiceWelcomeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) spice_welcome_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SpiceWelcome), 0, (GInstanceInitFunc) spice_welcome_instance_init, NULL };
	GType spice_welcome_type_id;
	spice_welcome_type_id = g_type_register_static (gtk_box_get_type (), "SpiceWelcome", &g_define_type_info, 0);
	SpiceWelcome_private_offset = g_type_add_instance_private (spice_welcome_type_id, sizeof (SpiceWelcomePrivate));
	return spice_welcome_type_id;
}

GType
spice_welcome_get_type (void)
{
	static volatile gsize spice_welcome_type_id__once = 0;
	if (g_once_init_enter (&spice_welcome_type_id__once)) {
		GType spice_welcome_type_id;
		spice_welcome_type_id = spice_welcome_get_type_once ();
		g_once_init_leave (&spice_welcome_type_id__once, spice_welcome_type_id);
	}
	return spice_welcome_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);
}

