/* templatedefinition.c generated by valac 0.12.1.1-323029-dirty, the Vala compiler
 * generated from templatedefinition.vala, do not modify */

/* templatedefinition.vala
 *
 * Copyright (C) 2007-2010  Andrea Del Signore
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.

 * This library 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
 * Lesser General Public License for more details.

 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Author:
 * 	Andrea Del Signore <sejerpz@tin.it>
 */

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gstdio.h>


#define GEN_PROJECT_TYPE_TEMPLATE_DEFINITION (gen_project_template_definition_get_type ())
#define GEN_PROJECT_TEMPLATE_DEFINITION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEN_PROJECT_TYPE_TEMPLATE_DEFINITION, GenProjectTemplateDefinition))
#define GEN_PROJECT_TEMPLATE_DEFINITION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEN_PROJECT_TYPE_TEMPLATE_DEFINITION, GenProjectTemplateDefinitionClass))
#define GEN_PROJECT_IS_TEMPLATE_DEFINITION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEN_PROJECT_TYPE_TEMPLATE_DEFINITION))
#define GEN_PROJECT_IS_TEMPLATE_DEFINITION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEN_PROJECT_TYPE_TEMPLATE_DEFINITION))
#define GEN_PROJECT_TEMPLATE_DEFINITION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEN_PROJECT_TYPE_TEMPLATE_DEFINITION, GenProjectTemplateDefinitionClass))

typedef struct _GenProjectTemplateDefinition GenProjectTemplateDefinition;
typedef struct _GenProjectTemplateDefinitionClass GenProjectTemplateDefinitionClass;
typedef struct _GenProjectTemplateDefinitionPrivate GenProjectTemplateDefinitionPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
#define __g_list_free__g_free0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_free0_ (var), NULL)))
#define _g_key_file_free0(var) ((var == NULL) ? NULL : (var = (g_key_file_free (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

struct _GenProjectTemplateDefinition {
	GObject parent_instance;
	GenProjectTemplateDefinitionPrivate * priv;
};

struct _GenProjectTemplateDefinitionClass {
	GObjectClass parent_class;
};

struct _GenProjectTemplateDefinitionPrivate {
	gint _id;
	gchar* _version;
	gchar* _name;
	gchar* _description;
	gchar* _details;
	gchar* _language;
	gchar* _build_system;
	gchar* _icon_filename;
	gchar* _archive_filename;
	gchar* _filename;
	GList* _tags;
};


static gpointer gen_project_template_definition_parent_class = NULL;

GType gen_project_template_definition_get_type (void) G_GNUC_CONST;
#define GEN_PROJECT_TEMPLATE_DEFINITION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEN_PROJECT_TYPE_TEMPLATE_DEFINITION, GenProjectTemplateDefinitionPrivate))
enum  {
	GEN_PROJECT_TEMPLATE_DEFINITION_DUMMY_PROPERTY,
	GEN_PROJECT_TEMPLATE_DEFINITION_ID,
	GEN_PROJECT_TEMPLATE_DEFINITION_VERSION,
	GEN_PROJECT_TEMPLATE_DEFINITION_NAME,
	GEN_PROJECT_TEMPLATE_DEFINITION_DESCRIPTION,
	GEN_PROJECT_TEMPLATE_DEFINITION_DETAILS,
	GEN_PROJECT_TEMPLATE_DEFINITION_LANGUAGE,
	GEN_PROJECT_TEMPLATE_DEFINITION_BUILD_SYSTEM,
	GEN_PROJECT_TEMPLATE_DEFINITION_TAGS,
	GEN_PROJECT_TEMPLATE_DEFINITION_ICON_FILENAME,
	GEN_PROJECT_TEMPLATE_DEFINITION_ARCHIVE_FILENAME
};
static void _g_free0_ (gpointer var);
static void _g_list_free__g_free0_ (GList* self);
static GenProjectTemplateDefinition* gen_project_template_definition_new (void);
static GenProjectTemplateDefinition* gen_project_template_definition_construct (GType object_type);
GenProjectTemplateDefinition* gen_project_template_definition_load (const gchar* filename);
static gchar* gen_project_template_definition_read_key (GKeyFile* file, const gchar* key_name, const gchar* default_value, GError** error);
static void gen_project_template_definition_set_version (GenProjectTemplateDefinition* self, const gchar* value);
static void gen_project_template_definition_set_name (GenProjectTemplateDefinition* self, const gchar* value);
static void gen_project_template_definition_set_description (GenProjectTemplateDefinition* self, const gchar* value);
static void gen_project_template_definition_set_details (GenProjectTemplateDefinition* self, const gchar* value);
static void gen_project_template_definition_set_language (GenProjectTemplateDefinition* self, const gchar* value);
static void gen_project_template_definition_set_build_system (GenProjectTemplateDefinition* self, const gchar* value);
static void gen_project_template_definition_set_icon_filename (GenProjectTemplateDefinition* self, const gchar* value);
const gchar* gen_project_template_definition_get_icon_filename (GenProjectTemplateDefinition* self);
static void gen_project_template_definition_set_archive_filename (GenProjectTemplateDefinition* self, const gchar* value);
const gchar* gen_project_template_definition_get_archive_filename (GenProjectTemplateDefinition* self);
gint gen_project_template_definition_get_id (GenProjectTemplateDefinition* self);
void gen_project_template_definition_set_id (GenProjectTemplateDefinition* self, gint value);
const gchar* gen_project_template_definition_get_version (GenProjectTemplateDefinition* self);
const gchar* gen_project_template_definition_get_name (GenProjectTemplateDefinition* self);
const gchar* gen_project_template_definition_get_description (GenProjectTemplateDefinition* self);
const gchar* gen_project_template_definition_get_details (GenProjectTemplateDefinition* self);
const gchar* gen_project_template_definition_get_language (GenProjectTemplateDefinition* self);
const gchar* gen_project_template_definition_get_build_system (GenProjectTemplateDefinition* self);
GList* gen_project_template_definition_get_tags (GenProjectTemplateDefinition* self);
static void gen_project_template_definition_finalize (GObject* obj);
static void _vala_gen_project_template_definition_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_gen_project_template_definition_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
static gint _vala_array_length (gpointer array);


static void _g_free0_ (gpointer var) {
	var = (g_free (var), NULL);
}


static void _g_list_free__g_free0_ (GList* self) {
	g_list_foreach (self, (GFunc) _g_free0_, NULL);
	g_list_free (self);
}


static GenProjectTemplateDefinition* gen_project_template_definition_construct (GType object_type) {
	GenProjectTemplateDefinition * self = NULL;
	self = (GenProjectTemplateDefinition*) g_object_new (object_type, NULL);
	return self;
}


static GenProjectTemplateDefinition* gen_project_template_definition_new (void) {
	return gen_project_template_definition_construct (GEN_PROJECT_TYPE_TEMPLATE_DEFINITION);
}


static gchar* string_strip (const gchar* self) {
	gchar* result = NULL;
	gchar* _tmp0_ = NULL;
	gchar* _result_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strstrip (_result_);
	result = _result_;
	return result;
}


static gchar* string_replace (const gchar* self, const gchar* old, const gchar* replacement) {
	gchar* result = NULL;
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_;
	GRegex* _tmp2_ = NULL;
	GRegex* _tmp3_;
	GRegex* regex;
	gchar* _tmp4_ = NULL;
	gchar* _tmp5_;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (old != NULL, NULL);
	g_return_val_if_fail (replacement != NULL, NULL);
	_tmp0_ = g_regex_escape_string (old, -1);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_regex_new (_tmp1_, 0, 0, &_inner_error_);
	_tmp3_ = _tmp2_;
	_g_free0 (_tmp1_);
	regex = _tmp3_;
	if (_inner_error_ != NULL) {
		if (_inner_error_->domain == G_REGEX_ERROR) {
			goto __catch4_g_regex_error;
		}
		g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return NULL;
	}
	_tmp4_ = g_regex_replace_literal (regex, self, (gssize) (-1), 0, replacement, 0, &_inner_error_);
	_tmp5_ = _tmp4_;
	if (_inner_error_ != NULL) {
		_g_regex_unref0 (regex);
		if (_inner_error_->domain == G_REGEX_ERROR) {
			goto __catch4_g_regex_error;
		}
		_g_regex_unref0 (regex);
		g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return NULL;
	}
	result = _tmp5_;
	_g_regex_unref0 (regex);
	return result;
	_g_regex_unref0 (regex);
	goto __finally4;
	__catch4_g_regex_error:
	{
		GError * e;
		e = _inner_error_;
		_inner_error_ = NULL;
		g_assert_not_reached ();
		_g_error_free0 (e);
	}
	__finally4:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return NULL;
	}
}


GenProjectTemplateDefinition* gen_project_template_definition_load (const gchar* filename) {
	GenProjectTemplateDefinition* result = NULL;
	GenProjectTemplateDefinition* _result_;
	GKeyFile* _tmp0_ = NULL;
	GKeyFile* file;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (filename != NULL, NULL);
	_result_ = NULL;
	_tmp0_ = g_key_file_new ();
	file = _tmp0_;
	g_key_file_load_from_file (file, filename, G_KEY_FILE_NONE, &_inner_error_);
	if (_inner_error_ != NULL) {
		_g_key_file_free0 (file);
		goto __catch3_g_error;
	}
	_tmp2_ = g_key_file_has_group (file, "Template");
	if (_tmp2_) {
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp3_ = g_key_file_has_key (file, "Template", "name", &_inner_error_);
		_tmp4_ = _tmp3_;
		if (_inner_error_ != NULL) {
			_g_key_file_free0 (file);
			goto __catch3_g_error;
		}
		_tmp1_ = _tmp4_;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		GenProjectTemplateDefinition* _tmp5_ = NULL;
		gchar* _tmp6_;
		gchar* _tmp7_ = NULL;
		gchar* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_ = NULL;
		gchar* _tmp11_;
		gchar* _tmp12_;
		gchar* _tmp13_ = NULL;
		gchar* _tmp14_;
		gchar* _tmp15_;
		gchar* _tmp16_ = NULL;
		gchar* _tmp17_;
		gchar* _tmp18_;
		gchar* _tmp19_ = NULL;
		gchar* _tmp20_;
		gchar* _tmp21_;
		gchar* _tmp22_ = NULL;
		gchar* _tmp23_;
		gchar* _tmp24_;
		gchar* _tmp25_ = NULL;
		gchar* _tmp26_;
		gchar* _tmp27_;
		gchar** _tmp28_;
		gchar** _tmp29_ = NULL;
		gchar** _tmp30_;
		gchar** tmp;
		gint tmp_length1;
		gint _tmp_size_;
		gchar* _tmp33_ = NULL;
		gchar* _tmp34_;
		gchar* _tmp35_ = NULL;
		gchar* _tmp36_;
		gchar* _tmp37_ = NULL;
		gchar* _tmp38_;
		gchar* _tmp39_ = NULL;
		gchar* _tmp40_;
		gboolean _tmp41_;
		gchar* _tmp42_ = NULL;
		gchar* _tmp43_;
		gchar* _tmp44_ = NULL;
		gchar* _tmp45_;
		gchar* _tmp46_ = NULL;
		gchar* _tmp47_;
		gchar* _tmp48_ = NULL;
		gchar* _tmp49_;
		gboolean _tmp50_;
		_tmp5_ = gen_project_template_definition_new ();
		_g_object_unref0 (_result_);
		_result_ = _tmp5_;
		_tmp6_ = g_strdup (filename);
		_g_free0 (_result_->priv->_filename);
		_result_->priv->_filename = _tmp6_;
		_tmp7_ = gen_project_template_definition_read_key (file, "version", NULL, &_inner_error_);
		_tmp8_ = _tmp7_;
		if (_inner_error_ != NULL) {
			_g_key_file_free0 (file);
			goto __catch3_g_error;
		}
		_tmp9_ = _tmp8_;
		gen_project_template_definition_set_version (_result_, _tmp9_);
		_g_free0 (_tmp9_);
		_tmp10_ = gen_project_template_definition_read_key (file, "name", NULL, &_inner_error_);
		_tmp11_ = _tmp10_;
		if (_inner_error_ != NULL) {
			_g_key_file_free0 (file);
			goto __catch3_g_error;
		}
		_tmp12_ = _tmp11_;
		gen_project_template_definition_set_name (_result_, _tmp12_);
		_g_free0 (_tmp12_);
		_tmp13_ = gen_project_template_definition_read_key (file, "description", "", &_inner_error_);
		_tmp14_ = _tmp13_;
		if (_inner_error_ != NULL) {
			_g_key_file_free0 (file);
			goto __catch3_g_error;
		}
		_tmp15_ = _tmp14_;
		gen_project_template_definition_set_description (_result_, _tmp15_);
		_g_free0 (_tmp15_);
		_tmp16_ = gen_project_template_definition_read_key (file, "details", "", &_inner_error_);
		_tmp17_ = _tmp16_;
		if (_inner_error_ != NULL) {
			_g_key_file_free0 (file);
			goto __catch3_g_error;
		}
		_tmp18_ = _tmp17_;
		gen_project_template_definition_set_details (_result_, _tmp18_);
		_g_free0 (_tmp18_);
		_tmp19_ = gen_project_template_definition_read_key (file, "language", "", &_inner_error_);
		_tmp20_ = _tmp19_;
		if (_inner_error_ != NULL) {
			_g_key_file_free0 (file);
			goto __catch3_g_error;
		}
		_tmp21_ = _tmp20_;
		gen_project_template_definition_set_language (_result_, _tmp21_);
		_g_free0 (_tmp21_);
		_tmp22_ = gen_project_template_definition_read_key (file, "build-system", "", &_inner_error_);
		_tmp23_ = _tmp22_;
		if (_inner_error_ != NULL) {
			_g_key_file_free0 (file);
			goto __catch3_g_error;
		}
		_tmp24_ = _tmp23_;
		gen_project_template_definition_set_build_system (_result_, _tmp24_);
		_g_free0 (_tmp24_);
		_tmp25_ = gen_project_template_definition_read_key (file, "tags", "", &_inner_error_);
		_tmp26_ = _tmp25_;
		if (_inner_error_ != NULL) {
			_g_key_file_free0 (file);
			goto __catch3_g_error;
		}
		_tmp27_ = _tmp26_;
		_tmp29_ = _tmp28_ = g_strsplit (_tmp27_, ",", 0);
		_tmp30_ = _tmp29_;
		_g_free0 (_tmp27_);
		tmp = _tmp30_;
		tmp_length1 = _vala_array_length (_tmp28_);
		_tmp_size_ = _vala_array_length (_tmp28_);
		{
			gchar** tag_collection;
			int tag_collection_length1;
			int tag_it;
			tag_collection = tmp;
			tag_collection_length1 = tmp_length1;
			for (tag_it = 0; tag_it < tmp_length1; tag_it = tag_it + 1) {
				gchar* _tmp31_;
				gchar* tag;
				_tmp31_ = g_strdup (tag_collection[tag_it]);
				tag = _tmp31_;
				{
					gchar* _tmp32_ = NULL;
					_tmp32_ = string_strip (tag);
					_result_->priv->_tags = g_list_append (_result_->priv->_tags, _tmp32_);
					_g_free0 (tag);
				}
			}
		}
		_tmp33_ = g_path_get_dirname (filename);
		_tmp34_ = _tmp33_;
		_tmp35_ = g_path_get_basename (filename);
		_tmp36_ = _tmp35_;
		_tmp37_ = string_replace (_tmp36_, ".ini", ".png");
		_tmp38_ = _tmp37_;
		_tmp39_ = g_build_filename (_tmp34_, _tmp38_, NULL);
		_tmp40_ = _tmp39_;
		gen_project_template_definition_set_icon_filename (_result_, _tmp40_);
		_g_free0 (_tmp40_);
		_g_free0 (_tmp38_);
		_g_free0 (_tmp36_);
		_g_free0 (_tmp34_);
		_tmp41_ = g_file_test (_result_->priv->_icon_filename, G_FILE_TEST_IS_REGULAR);
		if (!_tmp41_) {
			g_message ("templatedefinition.vala:70: no icon found for project: %s", _result_->priv->_icon_filename);
			gen_project_template_definition_set_icon_filename (_result_, NULL);
		}
		_tmp42_ = g_path_get_dirname (filename);
		_tmp43_ = _tmp42_;
		_tmp44_ = g_path_get_basename (filename);
		_tmp45_ = _tmp44_;
		_tmp46_ = string_replace (_tmp45_, ".ini", ".tar.gz");
		_tmp47_ = _tmp46_;
		_tmp48_ = g_build_filename (_tmp43_, _tmp47_, NULL);
		_tmp49_ = _tmp48_;
		gen_project_template_definition_set_archive_filename (_result_, _tmp49_);
		_g_free0 (_tmp49_);
		_g_free0 (_tmp47_);
		_g_free0 (_tmp45_);
		_g_free0 (_tmp43_);
		_tmp50_ = g_file_test (_result_->priv->_archive_filename, G_FILE_TEST_IS_REGULAR);
		if (!_tmp50_) {
			g_critical ("templatedefinition.vala:75: no archive found for project: %s", _result_->priv->_archive_filename);
			gen_project_template_definition_set_archive_filename (_result_, NULL);
		}
		tmp = (_vala_array_free (tmp, tmp_length1, (GDestroyNotify) g_free), NULL);
	}
	_g_key_file_free0 (file);
	goto __finally3;
	__catch3_g_error:
	{
		GError * err;
		err = _inner_error_;
		_inner_error_ = NULL;
		g_warning ("templatedefinition.vala:80: error loading keyfile %s: %s", filename, err->message);
		_g_error_free0 (err);
	}
	__finally3:
	if (_inner_error_ != NULL) {
		_g_object_unref0 (_result_);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return NULL;
	}
	result = _result_;
	return result;
}


static gchar* gen_project_template_definition_read_key (GKeyFile* file, const gchar* key_name, const gchar* default_value, GError** error) {
	gchar* result = NULL;
	gboolean _tmp0_;
	gboolean _tmp1_;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (file != NULL, NULL);
	g_return_val_if_fail (key_name != NULL, NULL);
	_tmp0_ = g_key_file_has_key (file, "Template", key_name, &_inner_error_);
	_tmp1_ = _tmp0_;
	if (_inner_error_ != NULL) {
		if (_inner_error_->domain == G_KEY_FILE_ERROR) {
			g_propagate_error (error, _inner_error_);
			return NULL;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
	}
	if (_tmp1_) {
		gchar* _tmp2_ = NULL;
		gchar* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_ = NULL;
		gchar* _tmp6_;
		_tmp2_ = g_key_file_get_string (file, "Template", key_name, &_inner_error_);
		_tmp3_ = _tmp2_;
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == G_KEY_FILE_ERROR) {
				g_propagate_error (error, _inner_error_);
				return NULL;
			} else {
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
				g_clear_error (&_inner_error_);
				return NULL;
			}
		}
		_tmp4_ = _tmp3_;
		_tmp5_ = string_strip (_tmp4_);
		_tmp6_ = _tmp5_;
		_g_free0 (_tmp4_);
		result = _tmp6_;
		return result;
	} else {
		gchar* _tmp7_;
		_tmp7_ = g_strdup (default_value);
		result = _tmp7_;
		return result;
	}
}


gint gen_project_template_definition_get_id (GenProjectTemplateDefinition* self) {
	gint result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_id;
	return result;
}


void gen_project_template_definition_set_id (GenProjectTemplateDefinition* self, gint value) {
	g_return_if_fail (self != NULL);
	self->priv->_id = value;
	g_object_notify ((GObject *) self, "id");
}


const gchar* gen_project_template_definition_get_version (GenProjectTemplateDefinition* self) {
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self->priv->_version;
	return result;
}


static void gen_project_template_definition_set_version (GenProjectTemplateDefinition* self, const gchar* value) {
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_version);
	self->priv->_version = _tmp0_;
	g_object_notify ((GObject *) self, "version");
}


const gchar* gen_project_template_definition_get_name (GenProjectTemplateDefinition* self) {
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self->priv->_name;
	return result;
}


static void gen_project_template_definition_set_name (GenProjectTemplateDefinition* self, const gchar* value) {
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_name);
	self->priv->_name = _tmp0_;
	g_object_notify ((GObject *) self, "name");
}


const gchar* gen_project_template_definition_get_description (GenProjectTemplateDefinition* self) {
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self->priv->_description;
	return result;
}


static void gen_project_template_definition_set_description (GenProjectTemplateDefinition* self, const gchar* value) {
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_description);
	self->priv->_description = _tmp0_;
	g_object_notify ((GObject *) self, "description");
}


const gchar* gen_project_template_definition_get_details (GenProjectTemplateDefinition* self) {
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self->priv->_details;
	return result;
}


static void gen_project_template_definition_set_details (GenProjectTemplateDefinition* self, const gchar* value) {
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_details);
	self->priv->_details = _tmp0_;
	g_object_notify ((GObject *) self, "details");
}


const gchar* gen_project_template_definition_get_language (GenProjectTemplateDefinition* self) {
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self->priv->_language;
	return result;
}


static void gen_project_template_definition_set_language (GenProjectTemplateDefinition* self, const gchar* value) {
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_language);
	self->priv->_language = _tmp0_;
	g_object_notify ((GObject *) self, "language");
}


const gchar* gen_project_template_definition_get_build_system (GenProjectTemplateDefinition* self) {
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self->priv->_build_system;
	return result;
}


static void gen_project_template_definition_set_build_system (GenProjectTemplateDefinition* self, const gchar* value) {
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_build_system);
	self->priv->_build_system = _tmp0_;
	g_object_notify ((GObject *) self, "build-system");
}


GList* gen_project_template_definition_get_tags (GenProjectTemplateDefinition* self) {
	GList* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self->priv->_tags;
	return result;
}


const gchar* gen_project_template_definition_get_icon_filename (GenProjectTemplateDefinition* self) {
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self->priv->_icon_filename;
	return result;
}


static void gen_project_template_definition_set_icon_filename (GenProjectTemplateDefinition* self, const gchar* value) {
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_icon_filename);
	self->priv->_icon_filename = _tmp0_;
	g_object_notify ((GObject *) self, "icon-filename");
}


const gchar* gen_project_template_definition_get_archive_filename (GenProjectTemplateDefinition* self) {
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self->priv->_archive_filename;
	return result;
}


static void gen_project_template_definition_set_archive_filename (GenProjectTemplateDefinition* self, const gchar* value) {
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_archive_filename);
	self->priv->_archive_filename = _tmp0_;
	g_object_notify ((GObject *) self, "archive-filename");
}


static void gen_project_template_definition_class_init (GenProjectTemplateDefinitionClass * klass) {
	gen_project_template_definition_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GenProjectTemplateDefinitionPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_gen_project_template_definition_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gen_project_template_definition_set_property;
	G_OBJECT_CLASS (klass)->finalize = gen_project_template_definition_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEN_PROJECT_TEMPLATE_DEFINITION_ID, g_param_spec_int ("id", "id", "id", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEN_PROJECT_TEMPLATE_DEFINITION_VERSION, g_param_spec_string ("version", "version", "version", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEN_PROJECT_TEMPLATE_DEFINITION_NAME, g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEN_PROJECT_TEMPLATE_DEFINITION_DESCRIPTION, g_param_spec_string ("description", "description", "description", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEN_PROJECT_TEMPLATE_DEFINITION_DETAILS, g_param_spec_string ("details", "details", "details", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEN_PROJECT_TEMPLATE_DEFINITION_LANGUAGE, g_param_spec_string ("language", "language", "language", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEN_PROJECT_TEMPLATE_DEFINITION_BUILD_SYSTEM, g_param_spec_string ("build-system", "build-system", "build-system", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEN_PROJECT_TEMPLATE_DEFINITION_TAGS, g_param_spec_pointer ("tags", "tags", "tags", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEN_PROJECT_TEMPLATE_DEFINITION_ICON_FILENAME, g_param_spec_string ("icon-filename", "icon-filename", "icon-filename", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEN_PROJECT_TEMPLATE_DEFINITION_ARCHIVE_FILENAME, g_param_spec_string ("archive-filename", "archive-filename", "archive-filename", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
}


static void gen_project_template_definition_instance_init (GenProjectTemplateDefinition * self) {
	self->priv = GEN_PROJECT_TEMPLATE_DEFINITION_GET_PRIVATE (self);
	self->priv->_name = NULL;
	self->priv->_icon_filename = NULL;
	self->priv->_archive_filename = NULL;
	self->priv->_tags = NULL;
}


static void gen_project_template_definition_finalize (GObject* obj) {
	GenProjectTemplateDefinition * self;
	self = GEN_PROJECT_TEMPLATE_DEFINITION (obj);
	_g_free0 (self->priv->_version);
	_g_free0 (self->priv->_name);
	_g_free0 (self->priv->_description);
	_g_free0 (self->priv->_details);
	_g_free0 (self->priv->_language);
	_g_free0 (self->priv->_build_system);
	_g_free0 (self->priv->_icon_filename);
	_g_free0 (self->priv->_archive_filename);
	_g_free0 (self->priv->_filename);
	__g_list_free__g_free0_0 (self->priv->_tags);
	G_OBJECT_CLASS (gen_project_template_definition_parent_class)->finalize (obj);
}


GType gen_project_template_definition_get_type (void) {
	static volatile gsize gen_project_template_definition_type_id__volatile = 0;
	if (g_once_init_enter (&gen_project_template_definition_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GenProjectTemplateDefinitionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gen_project_template_definition_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GenProjectTemplateDefinition), 0, (GInstanceInitFunc) gen_project_template_definition_instance_init, NULL };
		GType gen_project_template_definition_type_id;
		gen_project_template_definition_type_id = g_type_register_static (G_TYPE_OBJECT, "GenProjectTemplateDefinition", &g_define_type_info, 0);
		g_once_init_leave (&gen_project_template_definition_type_id__volatile, gen_project_template_definition_type_id);
	}
	return gen_project_template_definition_type_id__volatile;
}


static void _vala_gen_project_template_definition_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	GenProjectTemplateDefinition * self;
	self = GEN_PROJECT_TEMPLATE_DEFINITION (object);
	switch (property_id) {
		case GEN_PROJECT_TEMPLATE_DEFINITION_ID:
		g_value_set_int (value, gen_project_template_definition_get_id (self));
		break;
		case GEN_PROJECT_TEMPLATE_DEFINITION_VERSION:
		g_value_set_string (value, gen_project_template_definition_get_version (self));
		break;
		case GEN_PROJECT_TEMPLATE_DEFINITION_NAME:
		g_value_set_string (value, gen_project_template_definition_get_name (self));
		break;
		case GEN_PROJECT_TEMPLATE_DEFINITION_DESCRIPTION:
		g_value_set_string (value, gen_project_template_definition_get_description (self));
		break;
		case GEN_PROJECT_TEMPLATE_DEFINITION_DETAILS:
		g_value_set_string (value, gen_project_template_definition_get_details (self));
		break;
		case GEN_PROJECT_TEMPLATE_DEFINITION_LANGUAGE:
		g_value_set_string (value, gen_project_template_definition_get_language (self));
		break;
		case GEN_PROJECT_TEMPLATE_DEFINITION_BUILD_SYSTEM:
		g_value_set_string (value, gen_project_template_definition_get_build_system (self));
		break;
		case GEN_PROJECT_TEMPLATE_DEFINITION_TAGS:
		g_value_set_pointer (value, gen_project_template_definition_get_tags (self));
		break;
		case GEN_PROJECT_TEMPLATE_DEFINITION_ICON_FILENAME:
		g_value_set_string (value, gen_project_template_definition_get_icon_filename (self));
		break;
		case GEN_PROJECT_TEMPLATE_DEFINITION_ARCHIVE_FILENAME:
		g_value_set_string (value, gen_project_template_definition_get_archive_filename (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_gen_project_template_definition_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	GenProjectTemplateDefinition * self;
	self = GEN_PROJECT_TEMPLATE_DEFINITION (object);
	switch (property_id) {
		case GEN_PROJECT_TEMPLATE_DEFINITION_ID:
		gen_project_template_definition_set_id (self, g_value_get_int (value));
		break;
		case GEN_PROJECT_TEMPLATE_DEFINITION_VERSION:
		gen_project_template_definition_set_version (self, g_value_get_string (value));
		break;
		case GEN_PROJECT_TEMPLATE_DEFINITION_NAME:
		gen_project_template_definition_set_name (self, g_value_get_string (value));
		break;
		case GEN_PROJECT_TEMPLATE_DEFINITION_DESCRIPTION:
		gen_project_template_definition_set_description (self, g_value_get_string (value));
		break;
		case GEN_PROJECT_TEMPLATE_DEFINITION_DETAILS:
		gen_project_template_definition_set_details (self, g_value_get_string (value));
		break;
		case GEN_PROJECT_TEMPLATE_DEFINITION_LANGUAGE:
		gen_project_template_definition_set_language (self, g_value_get_string (value));
		break;
		case GEN_PROJECT_TEMPLATE_DEFINITION_BUILD_SYSTEM:
		gen_project_template_definition_set_build_system (self, g_value_get_string (value));
		break;
		case GEN_PROJECT_TEMPLATE_DEFINITION_ICON_FILENAME:
		gen_project_template_definition_set_icon_filename (self, g_value_get_string (value));
		break;
		case GEN_PROJECT_TEMPLATE_DEFINITION_ARCHIVE_FILENAME:
		gen_project_template_definition_set_archive_filename (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int 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, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}


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



