/* Library.c generated by valac 0.56.18, the Vala compiler
 * generated from Library.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 <gtk/gtk.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gio/gio.h>
#include <granite.h>

#define SPICE_WIDGETS_LIBRARY_LIBRARY_RESOURCE_PATH "resource:///com/github/philip-scott/spice-up/templates/%s"
#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_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;
typedef struct _SpiceWidgetsLibraryLibraryPrivate SpiceWidgetsLibraryLibraryPrivate;
enum  {
	SPICE_WIDGETS_LIBRARY_LIBRARY_0_PROPERTY,
	SPICE_WIDGETS_LIBRARY_LIBRARY_NUM_PROPERTIES
};
static GParamSpec* spice_widgets_library_library_properties[SPICE_WIDGETS_LIBRARY_LIBRARY_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))

#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_WIDGETS_LIBRARY_TYPE_LIBRARY_ITEM (spice_widgets_library_library_item_get_type ())
#define SPICE_WIDGETS_LIBRARY_LIBRARY_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPICE_WIDGETS_LIBRARY_TYPE_LIBRARY_ITEM, SpiceWidgetsLibraryLibraryItem))
#define SPICE_WIDGETS_LIBRARY_LIBRARY_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SPICE_WIDGETS_LIBRARY_TYPE_LIBRARY_ITEM, SpiceWidgetsLibraryLibraryItemClass))
#define SPICE_WIDGETS_LIBRARY_IS_LIBRARY_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SPICE_WIDGETS_LIBRARY_TYPE_LIBRARY_ITEM))
#define SPICE_WIDGETS_LIBRARY_IS_LIBRARY_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SPICE_WIDGETS_LIBRARY_TYPE_LIBRARY_ITEM))
#define SPICE_WIDGETS_LIBRARY_LIBRARY_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SPICE_WIDGETS_LIBRARY_TYPE_LIBRARY_ITEM, SpiceWidgetsLibraryLibraryItemClass))

typedef struct _SpiceWidgetsLibraryLibraryItem SpiceWidgetsLibraryLibraryItem;
typedef struct _SpiceWidgetsLibraryLibraryItemClass SpiceWidgetsLibraryLibraryItemClass;
#define _g_array_unref0(var) ((var == NULL) ? NULL : (var = (g_array_unref (var), NULL)))
enum  {
	SPICE_WIDGETS_LIBRARY_LIBRARY_ITEM_SELECTED_SIGNAL,
	SPICE_WIDGETS_LIBRARY_LIBRARY_FILE_SELECTED_SIGNAL,
	SPICE_WIDGETS_LIBRARY_LIBRARY_NUM_SIGNALS
};
static guint spice_widgets_library_library_signals[SPICE_WIDGETS_LIBRARY_LIBRARY_NUM_SIGNALS] = {0};

struct _SpiceWidgetsLibraryLibrary {
	GtkScrolledWindow parent_instance;
	SpiceWidgetsLibraryLibraryPrivate * priv;
};

struct _SpiceWidgetsLibraryLibraryClass {
	GtkScrolledWindowClass parent_class;
};

struct _SpiceWidgetsLibraryLibraryPrivate {
	GtkFlowBox* item_box;
};

static gint SpiceWidgetsLibraryLibrary_private_offset;
static gpointer spice_widgets_library_library_parent_class = NULL;
VALA_EXTERN SpiceServicesSettings* spice_settings;

VALA_EXTERN GType spice_widgets_library_library_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SpiceWidgetsLibraryLibrary, g_object_unref)
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 _g_free0_ (gpointer var);
static void _vala_gchar_free_function_content_of (gpointer data);
VALA_EXTERN void spice_widgets_library_library_add_file (SpiceWidgetsLibraryLibrary* self,
                                             GFile* file,
                                             gboolean real_file);
VALA_EXTERN GType spice_services_settings_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SpiceServicesSettings, g_object_unref)
VALA_EXTERN void spice_services_settings_set_last_files (SpiceServicesSettings* self,
                                             gchar** value,
                                             gint value_length1);
static void __lambda125_ (SpiceWidgetsLibraryLibrary* self,
                   GtkFlowBoxChild* child);
VALA_EXTERN GType spice_widgets_library_library_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SpiceWidgetsLibraryLibraryItem, g_object_unref)
VALA_EXTERN GFile* spice_widgets_library_library_item_get_file (SpiceWidgetsLibraryLibraryItem* self);
static void ___lambda125__gtk_flow_box_child_activated (GtkFlowBox* _sender,
                                                 GtkFlowBoxChild* child,
                                                 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 __lambda126_ (SpiceWidgetsLibraryLibrary* self,
                   GtkFlowBoxChild* child);
VALA_EXTERN const gchar* spice_widgets_library_library_item_get_data (SpiceWidgetsLibraryLibraryItem* self);
static void ___lambda126__gtk_flow_box_child_activated (GtkFlowBox* _sender,
                                                 GtkFlowBoxChild* child,
                                                 gpointer self);
VALA_EXTERN SpiceWidgetsLibraryLibraryItem* spice_widgets_library_library_item_new (GFile* file,
                                                                        gboolean real_file);
VALA_EXTERN SpiceWidgetsLibraryLibraryItem* spice_widgets_library_library_item_construct (GType object_type,
                                                                              GFile* file,
                                                                              gboolean real_file);
static GObject * spice_widgets_library_library_constructor (GType type,
                                                     guint n_construct_properties,
                                                     GObjectConstructParam * construct_properties);
static void spice_widgets_library_library_finalize (GObject * obj);
static GType spice_widgets_library_library_get_type_once (void);

static const gchar* SPICE_WIDGETS_LIBRARY_LIBRARY_TEMPLATES[7] = {"Black.spice", "White.spice", "Green.spice", "Spice-Up.spice", "Paper.spice", "Colorful.spice", "Landscape.spice"};

static inline gpointer
spice_widgets_library_library_get_instance_private (SpiceWidgetsLibraryLibrary* self)
{
	return G_STRUCT_MEMBER_P (self, SpiceWidgetsLibraryLibrary_private_offset);
}

static void
_g_free0_ (gpointer var)
{
#line 32 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	var = (g_free (var), NULL);
#line 172 "Library.c"
}

static void
_vala_gchar_free_function_content_of (gpointer data)
{
	gchar* self;
#line 32 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	self = *((gchar**) data);
#line 32 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	_g_free0_ (self);
#line 183 "Library.c"
}

static void
__lambda125_ (SpiceWidgetsLibraryLibrary* self,
              GtkFlowBoxChild* child)
{
	GFile* _tmp0_;
	GFile* _tmp1_;
#line 45 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	g_return_if_fail (child != NULL);
#line 46 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	_tmp0_ = spice_widgets_library_library_item_get_file (SPICE_WIDGETS_LIBRARY_IS_LIBRARY_ITEM (child) ? ((SpiceWidgetsLibraryLibraryItem*) child) : NULL);
#line 46 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	_tmp1_ = _tmp0_;
#line 46 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	g_signal_emit (self, spice_widgets_library_library_signals[SPICE_WIDGETS_LIBRARY_LIBRARY_FILE_SELECTED_SIGNAL], 0, _tmp1_);
#line 200 "Library.c"
}

static void
___lambda125__gtk_flow_box_child_activated (GtkFlowBox* _sender,
                                            GtkFlowBoxChild* child,
                                            gpointer self)
{
#line 45 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	__lambda125_ ((SpiceWidgetsLibraryLibrary*) self, child);
#line 210 "Library.c"
}

SpiceWidgetsLibraryLibrary*
spice_widgets_library_library_construct (GType object_type,
                                         gchar** files,
                                         gint files_length1)
{
	SpiceWidgetsLibraryLibrary * self = NULL;
	GArray* existing_files = NULL;
	GArray* _tmp0_;
	GtkFlowBox* _tmp9_;
	GtkFlowBox* _tmp10_;
	SpiceServicesSettings* _tmp11_;
	GArray* _tmp12_;
	gpointer* _tmp13_;
	gint _tmp13__length1;
	GtkFlowBox* _tmp14_;
#line 31 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	self = (SpiceWidgetsLibraryLibrary*) g_object_new (object_type, NULL);
#line 32 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	_tmp0_ = g_array_new (TRUE, TRUE, sizeof (gchar*));
#line 32 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	g_array_set_clear_func (_tmp0_, (GDestroyNotify) _vala_gchar_free_function_content_of);
#line 32 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	existing_files = _tmp0_;
#line 236 "Library.c"
	{
		gchar** path_collection = NULL;
		gint path_collection_length1 = 0;
		gint _path_collection_size_ = 0;
		gint path_it = 0;
#line 33 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
		path_collection = files;
#line 33 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
		path_collection_length1 = files_length1;
#line 33 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
		for (path_it = 0; path_it < path_collection_length1; path_it = path_it + 1) {
#line 248 "Library.c"
			gchar* _tmp1_;
			gchar* path = NULL;
#line 33 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
			_tmp1_ = g_strdup (path_collection[path_it]);
#line 33 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
			path = _tmp1_;
#line 255 "Library.c"
			{
				GFile* file = NULL;
				const gchar* _tmp2_;
				GFile* _tmp3_;
				GFile* _tmp4_;
#line 34 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
				_tmp2_ = path;
#line 34 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
				_tmp3_ = g_file_new_for_path (_tmp2_);
#line 34 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
				file = _tmp3_;
#line 35 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
				_tmp4_ = file;
#line 35 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
				if (g_file_query_exists (_tmp4_, NULL)) {
#line 271 "Library.c"
					GFile* _tmp5_;
					GArray* _tmp6_;
					const gchar* _tmp7_;
					gchar* _tmp8_;
#line 36 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
					_tmp5_ = file;
#line 36 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
					spice_widgets_library_library_add_file (self, _tmp5_, TRUE);
#line 37 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
					_tmp6_ = existing_files;
#line 37 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
					_tmp7_ = path;
#line 37 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
					_tmp8_ = g_strdup (_tmp7_);
#line 37 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
					g_array_append_val (_tmp6_, _tmp8_);
#line 288 "Library.c"
				}
#line 33 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
				_g_object_unref0 (file);
#line 33 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
				_g_free0 (path);
#line 294 "Library.c"
			}
		}
	}
#line 41 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	_tmp9_ = self->priv->item_box;
#line 41 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	gtk_flow_box_set_max_children_per_line (_tmp9_, (guint) 2);
#line 42 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	_tmp10_ = self->priv->item_box;
#line 42 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	gtk_flow_box_set_min_children_per_line (_tmp10_, (guint) 2);
#line 43 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	_tmp11_ = spice_settings;
#line 43 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	_tmp12_ = existing_files;
#line 43 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	_tmp13_ = _tmp12_->data;
#line 43 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	_tmp13__length1 = _tmp12_->len;
#line 43 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	spice_services_settings_set_last_files (_tmp11_, _tmp13_, _tmp13__length1);
#line 45 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	_tmp14_ = self->priv->item_box;
#line 45 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	g_signal_connect_object (_tmp14_, "child-activated", (GCallback) ___lambda125__gtk_flow_box_child_activated, self, 0);
#line 31 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	_g_array_unref0 (existing_files);
#line 31 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	return self;
#line 324 "Library.c"
}

SpiceWidgetsLibraryLibrary*
spice_widgets_library_library_new (gchar** files,
                                   gint files_length1)
{
#line 31 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	return spice_widgets_library_library_construct (SPICE_WIDGETS_LIBRARY_TYPE_LIBRARY, files, files_length1);
#line 333 "Library.c"
}

static gpointer
_g_object_ref0 (gpointer self)
{
#line 60 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	return self ? g_object_ref (self) : NULL;
#line 341 "Library.c"
}

static void
__lambda126_ (SpiceWidgetsLibraryLibrary* self,
              GtkFlowBoxChild* child)
{
	SpiceWidgetsLibraryLibraryItem* library_item = NULL;
	SpiceWidgetsLibraryLibraryItem* _tmp0_;
	SpiceWidgetsLibraryLibraryItem* _tmp1_;
	SpiceWidgetsLibraryLibraryItem* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
#line 59 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	g_return_if_fail (child != NULL);
#line 60 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	_tmp0_ = _g_object_ref0 (SPICE_WIDGETS_LIBRARY_IS_LIBRARY_ITEM (child) ? ((SpiceWidgetsLibraryLibraryItem*) child) : NULL);
#line 60 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	library_item = _tmp0_;
#line 61 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	_tmp1_ = library_item;
#line 61 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	if (_tmp1_ == NULL) {
#line 61 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
		_g_object_unref0 (library_item);
#line 61 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
		return;
#line 368 "Library.c"
	}
#line 63 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	_tmp2_ = library_item;
#line 63 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	_tmp3_ = spice_widgets_library_library_item_get_data (_tmp2_);
#line 63 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	_tmp4_ = _tmp3_;
#line 63 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	g_signal_emit (self, spice_widgets_library_library_signals[SPICE_WIDGETS_LIBRARY_LIBRARY_ITEM_SELECTED_SIGNAL], 0, _tmp4_);
#line 59 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	_g_object_unref0 (library_item);
#line 380 "Library.c"
}

static void
___lambda126__gtk_flow_box_child_activated (GtkFlowBox* _sender,
                                            GtkFlowBoxChild* child,
                                            gpointer self)
{
#line 59 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	__lambda126_ ((SpiceWidgetsLibraryLibrary*) self, child);
#line 390 "Library.c"
}

SpiceWidgetsLibraryLibrary*
spice_widgets_library_library_construct_for_templates (GType object_type)
{
	SpiceWidgetsLibraryLibrary * self = NULL;
	GtkFlowBox* _tmp6_;
	GtkFlowBox* _tmp7_;
#line 50 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	self = (SpiceWidgetsLibraryLibrary*) g_object_new (object_type, NULL);
#line 401 "Library.c"
	{
		const gchar** file_path_collection = NULL;
		gint file_path_collection_length1 = 0;
		gint _file_path_collection_size_ = 0;
		gint file_path_it = 0;
#line 51 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
		file_path_collection = SPICE_WIDGETS_LIBRARY_LIBRARY_TEMPLATES;
#line 51 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
		file_path_collection_length1 = G_N_ELEMENTS (SPICE_WIDGETS_LIBRARY_LIBRARY_TEMPLATES);
#line 51 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
		for (file_path_it = 0; file_path_it < file_path_collection_length1; file_path_it = file_path_it + 1) {
#line 413 "Library.c"
			const gchar* file_path = NULL;
#line 51 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
			file_path = file_path_collection[file_path_it];
#line 417 "Library.c"
			{
				GFile* file = NULL;
				const gchar* _tmp0_;
				gchar* _tmp1_;
				gchar* _tmp2_;
				GFile* _tmp3_;
				GFile* _tmp4_;
				GFile* _tmp5_;
#line 52 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
				_tmp0_ = file_path;
#line 52 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
				_tmp1_ = g_strdup_printf (SPICE_WIDGETS_LIBRARY_LIBRARY_RESOURCE_PATH, _tmp0_);
#line 52 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
				_tmp2_ = _tmp1_;
#line 52 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
				_tmp3_ = g_file_new_for_uri (_tmp2_);
#line 52 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
				_tmp4_ = _tmp3_;
#line 52 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
				_g_free0 (_tmp2_);
#line 52 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
				file = _tmp4_;
#line 54 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
				_tmp5_ = file;
#line 54 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
				spice_widgets_library_library_add_file (self, _tmp5_, FALSE);
#line 51 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
				_g_object_unref0 (file);
#line 446 "Library.c"
			}
		}
	}
#line 57 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	_tmp6_ = self->priv->item_box;
#line 57 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	gtk_flow_box_set_min_children_per_line (_tmp6_, (guint) 2);
#line 59 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	_tmp7_ = self->priv->item_box;
#line 59 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	g_signal_connect_object (_tmp7_, "child-activated", (GCallback) ___lambda126__gtk_flow_box_child_activated, self, 0);
#line 50 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	return self;
#line 460 "Library.c"
}

SpiceWidgetsLibraryLibrary*
spice_widgets_library_library_new_for_templates (void)
{
#line 50 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	return spice_widgets_library_library_construct_for_templates (SPICE_WIDGETS_LIBRARY_TYPE_LIBRARY);
#line 468 "Library.c"
}

void
spice_widgets_library_library_add_file (SpiceWidgetsLibraryLibrary* self,
                                        GFile* file,
                                        gboolean real_file)
{
	SpiceWidgetsLibraryLibraryItem* item = NULL;
	SpiceWidgetsLibraryLibraryItem* _tmp0_;
	GtkFlowBox* _tmp1_;
	SpiceWidgetsLibraryLibraryItem* _tmp2_;
#line 79 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	g_return_if_fail (self != NULL);
#line 79 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	g_return_if_fail (file != NULL);
#line 80 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	if (!g_file_query_exists (file, NULL)) {
#line 80 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
		return;
#line 488 "Library.c"
	}
#line 82 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	_tmp0_ = spice_widgets_library_library_item_new (file, real_file);
#line 82 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	g_object_ref_sink (_tmp0_);
#line 82 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	item = _tmp0_;
#line 83 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	_tmp1_ = self->priv->item_box;
#line 83 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	_tmp2_ = item;
#line 83 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	gtk_container_add ((GtkContainer*) _tmp1_, (GtkWidget*) _tmp2_);
#line 79 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	_g_object_unref0 (item);
#line 504 "Library.c"
}

static GObject *
spice_widgets_library_library_constructor (GType type,
                                           guint n_construct_properties,
                                           GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SpiceWidgetsLibraryLibrary * self;
	GtkFlowBox* _tmp0_;
	GtkFlowBox* _tmp1_;
	GtkFlowBox* _tmp2_;
	GtkFlowBox* _tmp3_;
	GtkFlowBox* _tmp4_;
#line 67 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	parent_class = G_OBJECT_CLASS (spice_widgets_library_library_parent_class);
#line 67 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
#line 67 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SPICE_WIDGETS_LIBRARY_TYPE_LIBRARY, SpiceWidgetsLibraryLibrary);
#line 68 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	g_object_set ((GtkScrolledWindow*) self, "hscrollbar-policy", GTK_POLICY_NEVER, NULL);
#line 70 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	_tmp0_ = (GtkFlowBox*) gtk_flow_box_new ();
#line 70 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	g_object_ref_sink (_tmp0_);
#line 70 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	_g_object_unref0 (self->priv->item_box);
#line 70 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	self->priv->item_box = _tmp0_;
#line 72 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	_tmp1_ = self->priv->item_box;
#line 72 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	gtk_widget_set_valign ((GtkWidget*) _tmp1_, GTK_ALIGN_START);
#line 73 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	_tmp2_ = self->priv->item_box;
#line 73 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	g_object_set ((GtkWidget*) _tmp2_, "margin", 12, NULL);
#line 74 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	_tmp3_ = self->priv->item_box;
#line 74 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	g_object_set ((GtkWidget*) _tmp3_, "expand", FALSE, NULL);
#line 76 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	_tmp4_ = self->priv->item_box;
#line 76 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp4_);
#line 67 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	return obj;
#line 554 "Library.c"
}

static void
spice_widgets_library_library_class_init (SpiceWidgetsLibraryLibraryClass * klass,
                                          gpointer klass_data)
{
#line 22 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	spice_widgets_library_library_parent_class = g_type_class_peek_parent (klass);
#line 22 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	g_type_class_adjust_private_offset (klass, &SpiceWidgetsLibraryLibrary_private_offset);
#line 22 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	G_OBJECT_CLASS (klass)->constructor = spice_widgets_library_library_constructor;
#line 22 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	G_OBJECT_CLASS (klass)->finalize = spice_widgets_library_library_finalize;
#line 22 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	spice_widgets_library_library_signals[SPICE_WIDGETS_LIBRARY_LIBRARY_ITEM_SELECTED_SIGNAL] = g_signal_new ("item-selected", SPICE_WIDGETS_LIBRARY_TYPE_LIBRARY, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
#line 22 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	spice_widgets_library_library_signals[SPICE_WIDGETS_LIBRARY_LIBRARY_FILE_SELECTED_SIGNAL] = g_signal_new ("file-selected", SPICE_WIDGETS_LIBRARY_TYPE_LIBRARY, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, g_file_get_type ());
#line 573 "Library.c"
}

static void
spice_widgets_library_library_instance_init (SpiceWidgetsLibraryLibrary * self,
                                             gpointer klass)
{
#line 22 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	self->priv = spice_widgets_library_library_get_instance_private (self);
#line 582 "Library.c"
}

static void
spice_widgets_library_library_finalize (GObject * obj)
{
	SpiceWidgetsLibraryLibrary * self;
#line 22 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SPICE_WIDGETS_LIBRARY_TYPE_LIBRARY, SpiceWidgetsLibraryLibrary);
#line 29 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	_g_object_unref0 (self->priv->item_box);
#line 22 "../Spice-up-1.9.1/src/Widgets/Library/Library.vala"
	G_OBJECT_CLASS (spice_widgets_library_library_parent_class)->finalize (obj);
#line 595 "Library.c"
}

static GType
spice_widgets_library_library_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SpiceWidgetsLibraryLibraryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) spice_widgets_library_library_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SpiceWidgetsLibraryLibrary), 0, (GInstanceInitFunc) spice_widgets_library_library_instance_init, NULL };
	GType spice_widgets_library_library_type_id;
	spice_widgets_library_library_type_id = g_type_register_static (gtk_scrolled_window_get_type (), "SpiceWidgetsLibraryLibrary", &g_define_type_info, 0);
	SpiceWidgetsLibraryLibrary_private_offset = g_type_add_instance_private (spice_widgets_library_library_type_id, sizeof (SpiceWidgetsLibraryLibraryPrivate));
	return spice_widgets_library_library_type_id;
}

GType
spice_widgets_library_library_get_type (void)
{
	static volatile gsize spice_widgets_library_library_type_id__once = 0;
	if (g_once_init_enter (&spice_widgets_library_library_type_id__once)) {
		GType spice_widgets_library_library_type_id;
		spice_widgets_library_library_type_id = spice_widgets_library_library_get_type_once ();
		g_once_init_leave (&spice_widgets_library_library_type_id__once, spice_widgets_library_library_type_id);
	}
	return spice_widgets_library_library_type_id__once;
}

