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

/* parseresult.vala
 *
 * Copyright (C) 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, see <http://www.gnu.org/licenses/>.
 *
 * Author:
 * 	Andrea Del Signore <sejerpz@tin.it>
 */

#include <glib.h>
#include <glib-object.h>
#include <vala.h>
#include <valagee.h>
#include <stdlib.h>
#include <string.h>


#define AFRODITE_TYPE_PARSE_RESULT (afrodite_parse_result_get_type ())
#define AFRODITE_PARSE_RESULT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), AFRODITE_TYPE_PARSE_RESULT, AfroditeParseResult))
#define AFRODITE_PARSE_RESULT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), AFRODITE_TYPE_PARSE_RESULT, AfroditeParseResultClass))
#define AFRODITE_IS_PARSE_RESULT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AFRODITE_TYPE_PARSE_RESULT))
#define AFRODITE_IS_PARSE_RESULT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), AFRODITE_TYPE_PARSE_RESULT))
#define AFRODITE_PARSE_RESULT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), AFRODITE_TYPE_PARSE_RESULT, AfroditeParseResultClass))

typedef struct _AfroditeParseResult AfroditeParseResult;
typedef struct _AfroditeParseResultClass AfroditeParseResultClass;
typedef struct _AfroditeParseResultPrivate AfroditeParseResultPrivate;
#define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _vala_code_context_unref0(var) ((var == NULL) ? NULL : (var = (vala_code_context_unref (var), NULL)))

struct _AfroditeParseResult {
	ValaReport parent_instance;
	AfroditeParseResultPrivate * priv;
	ValaList* warnings;
	ValaList* errors;
	ValaList* notes;
	gchar* source_path;
	gboolean is_glib;
	ValaCodeContext* context;
	gboolean is_edited;
};

struct _AfroditeParseResultClass {
	ValaReportClass parent_class;
};


static gpointer afrodite_parse_result_parent_class = NULL;

GType afrodite_parse_result_get_type (void) G_GNUC_CONST;
enum  {
	AFRODITE_PARSE_RESULT_DUMMY_PROPERTY
};
static void afrodite_parse_result_real_warn (ValaReport* base, ValaSourceReference* source, const gchar* message);
static void afrodite_parse_result_real_err (ValaReport* base, ValaSourceReference* source, const gchar* message);
static void afrodite_parse_result_real_note (ValaReport* base, ValaSourceReference* source, const gchar* message);
AfroditeParseResult* afrodite_parse_result_new (void);
AfroditeParseResult* afrodite_parse_result_construct (GType object_type);
static void afrodite_parse_result_finalize (GObject* obj);


static void afrodite_parse_result_real_warn (ValaReport* base, ValaSourceReference* source, const gchar* message) {
	AfroditeParseResult * self;
	self = (AfroditeParseResult*) base;
	g_return_if_fail (message != NULL);
	VALA_REPORT_CLASS (afrodite_parse_result_parent_class)->warn (VALA_REPORT (self), source, message);
	if (source != NULL) {
		gchar* _tmp0_ = NULL;
		gchar* _tmp1_;
		gchar* _tmp2_ = NULL;
		gchar* _tmp3_;
		_tmp0_ = vala_source_reference_to_string (source);
		_tmp1_ = _tmp0_;
		_tmp2_ = g_strdup_printf ("%s: warning: %s\n", _tmp1_, message);
		_tmp3_ = _tmp2_;
		vala_collection_add ((ValaCollection*) self->warnings, _tmp3_);
		_g_free0 (_tmp3_);
		_g_free0 (_tmp1_);
	}
}


static void afrodite_parse_result_real_err (ValaReport* base, ValaSourceReference* source, const gchar* message) {
	AfroditeParseResult * self;
	self = (AfroditeParseResult*) base;
	g_return_if_fail (message != NULL);
	VALA_REPORT_CLASS (afrodite_parse_result_parent_class)->err (VALA_REPORT (self), source, message);
	if (source != NULL) {
		gchar* _tmp0_ = NULL;
		gchar* _tmp1_;
		gchar* _tmp2_ = NULL;
		gchar* _tmp3_;
		_tmp0_ = vala_source_reference_to_string (source);
		_tmp1_ = _tmp0_;
		_tmp2_ = g_strdup_printf ("%s: error: %s\n", _tmp1_, message);
		_tmp3_ = _tmp2_;
		vala_collection_add ((ValaCollection*) self->errors, _tmp3_);
		_g_free0 (_tmp3_);
		_g_free0 (_tmp1_);
	}
}


static void afrodite_parse_result_real_note (ValaReport* base, ValaSourceReference* source, const gchar* message) {
	AfroditeParseResult * self;
	self = (AfroditeParseResult*) base;
	g_return_if_fail (message != NULL);
	VALA_REPORT_CLASS (afrodite_parse_result_parent_class)->note (VALA_REPORT (self), source, message);
	if (source != NULL) {
		gchar* _tmp0_ = NULL;
		gchar* _tmp1_;
		gchar* _tmp2_ = NULL;
		gchar* _tmp3_;
		_tmp0_ = vala_source_reference_to_string (source);
		_tmp1_ = _tmp0_;
		_tmp2_ = g_strdup_printf ("%s: note: %s\n", _tmp1_, message);
		_tmp3_ = _tmp2_;
		vala_collection_add ((ValaCollection*) self->notes, _tmp3_);
		_g_free0 (_tmp3_);
		_g_free0 (_tmp1_);
	}
}


AfroditeParseResult* afrodite_parse_result_construct (GType object_type) {
	AfroditeParseResult * self = NULL;
	self = (AfroditeParseResult*) vala_report_construct (object_type);
	return self;
}


AfroditeParseResult* afrodite_parse_result_new (void) {
	return afrodite_parse_result_construct (AFRODITE_TYPE_PARSE_RESULT);
}


static void afrodite_parse_result_class_init (AfroditeParseResultClass * klass) {
	afrodite_parse_result_parent_class = g_type_class_peek_parent (klass);
	VALA_REPORT_CLASS (klass)->warn = afrodite_parse_result_real_warn;
	VALA_REPORT_CLASS (klass)->err = afrodite_parse_result_real_err;
	VALA_REPORT_CLASS (klass)->note = afrodite_parse_result_real_note;
	G_OBJECT_CLASS (klass)->finalize = afrodite_parse_result_finalize;
}


static void afrodite_parse_result_instance_init (AfroditeParseResult * self) {
	ValaArrayList* _tmp0_ = NULL;
	ValaArrayList* _tmp1_ = NULL;
	ValaArrayList* _tmp2_ = NULL;
	_tmp0_ = vala_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, g_direct_equal);
	self->warnings = (ValaList*) _tmp0_;
	_tmp1_ = vala_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, g_direct_equal);
	self->errors = (ValaList*) _tmp1_;
	_tmp2_ = vala_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, g_direct_equal);
	self->notes = (ValaList*) _tmp2_;
	self->source_path = NULL;
	self->is_glib = FALSE;
	self->context = NULL;
	self->is_edited = FALSE;
}


static void afrodite_parse_result_finalize (GObject* obj) {
	AfroditeParseResult * self;
	self = AFRODITE_PARSE_RESULT (obj);
	_vala_iterable_unref0 (self->warnings);
	_vala_iterable_unref0 (self->errors);
	_vala_iterable_unref0 (self->notes);
	_g_free0 (self->source_path);
	_vala_code_context_unref0 (self->context);
	G_OBJECT_CLASS (afrodite_parse_result_parent_class)->finalize (obj);
}


GType afrodite_parse_result_get_type (void) {
	static volatile gsize afrodite_parse_result_type_id__volatile = 0;
	if (g_once_init_enter (&afrodite_parse_result_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (AfroditeParseResultClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) afrodite_parse_result_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (AfroditeParseResult), 0, (GInstanceInitFunc) afrodite_parse_result_instance_init, NULL };
		GType afrodite_parse_result_type_id;
		afrodite_parse_result_type_id = g_type_register_static (VALA_TYPE_REPORT, "AfroditeParseResult", &g_define_type_info, 0);
		g_once_init_leave (&afrodite_parse_result_type_id__volatile, afrodite_parse_result_type_id);
	}
	return afrodite_parse_result_type_id__volatile;
}



