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

/*
 * Copyright (C) 2008-2009 Abderrahim Kitouni
 *
 * 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, see <http://www.gnu.org/licenses/>.
 */
/* A Vala.Report subclass for reporting errors in Anjuta UI */

#include <glib.h>
#include <glib-object.h>
#include <vala.h>
#include <libanjuta/interfaces/libanjuta-interfaces.h>
#include <valagee.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>


#define TYPE_ANJUTA_REPORT (anjuta_report_get_type ())
#define ANJUTA_REPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ANJUTA_REPORT, AnjutaReport))
#define ANJUTA_REPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ANJUTA_REPORT, AnjutaReportClass))
#define IS_ANJUTA_REPORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ANJUTA_REPORT))
#define IS_ANJUTA_REPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ANJUTA_REPORT))
#define ANJUTA_REPORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ANJUTA_REPORT, AnjutaReportClass))

typedef struct _AnjutaReport AnjutaReport;
typedef struct _AnjutaReportClass AnjutaReportClass;
typedef struct _AnjutaReportPrivate AnjutaReportPrivate;

#define ANJUTA_REPORT_TYPE_ERROR (anjuta_report_error_get_type ())
typedef struct _AnjutaReportError AnjutaReportError;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))
#define _anjuta_report_error_free0(var) ((var == NULL) ? NULL : (var = (anjuta_report_error_free (var), NULL)))
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
#define _vala_source_reference_unref0(var) ((var == NULL) ? NULL : (var = (vala_source_reference_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _AnjutaReport {
	ValaReport parent_instance;
	AnjutaReportPrivate * priv;
};

struct _AnjutaReportClass {
	ValaReportClass parent_class;
};

struct _AnjutaReportError {
	ValaSourceReference* source;
	gboolean error;
	gchar* message;
};

struct _AnjutaReportPrivate {
	IAnjutaDocumentManager* _docman;
	ValaList* errors_list;
	GRecMutex __lock_errors_list;
	gboolean general_error;
};


static gpointer anjuta_report_parent_class = NULL;
static GType anjuta_report_type_id = 0;

GType anjuta_report_get_type (void) G_GNUC_CONST;
static GType anjuta_report_error_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static AnjutaReportError* anjuta_report_error_dup (const AnjutaReportError* self);
static void anjuta_report_error_free (AnjutaReportError* self);
static void anjuta_report_error_copy (const AnjutaReportError* self, AnjutaReportError* dest);
static void anjuta_report_error_destroy (AnjutaReportError* self);
#define ANJUTA_REPORT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_ANJUTA_REPORT, AnjutaReportPrivate))
void anjuta_report_update_errors (AnjutaReport* self, IAnjutaEditor* editor);
void anjuta_report_clear_error_indicators (AnjutaReport* self, ValaSourceFile* file);
IAnjutaDocumentManager* anjuta_report_get_docman (AnjutaReport* self);
static void anjuta_report_real_warn (ValaReport* base, ValaSourceReference* source, const gchar* message);
static void anjuta_report_real_err (ValaReport* base, ValaSourceReference* source, const gchar* message);
AnjutaReport* anjuta_report_new (void);
AnjutaReport* anjuta_report_construct (GType object_type);
void anjuta_report_set_docman (AnjutaReport* self, IAnjutaDocumentManager* value);
static void anjuta_report_finalize (ValaReport * obj);


static gpointer _g_object_ref0 (gpointer self) {
	return self ? g_object_ref (self) : NULL;
}


static gpointer _vala_iterable_ref0 (gpointer self) {
	return self ? vala_iterable_ref (self) : NULL;
}


void anjuta_report_update_errors (AnjutaReport* self, IAnjutaEditor* editor) {
	IAnjutaIndicable* ind = NULL;
	IAnjutaEditor* _tmp0_;
	IAnjutaIndicable* _tmp1_;
	IAnjutaMarkable* mark = NULL;
	IAnjutaEditor* _tmp2_;
	IAnjutaMarkable* _tmp3_;
	gboolean _tmp4_ = FALSE;
	IAnjutaIndicable* _tmp5_;
	IAnjutaIndicable* _tmp7_;
	IAnjutaMarkable* _tmp9_;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (editor != NULL);
	_tmp0_ = editor;
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, ianjuta_indicable_get_type ()) ? ((IAnjutaIndicable*) _tmp0_) : NULL);
	ind = _tmp1_;
	_tmp2_ = editor;
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, ianjuta_markable_get_type ()) ? ((IAnjutaMarkable*) _tmp2_) : NULL);
	mark = _tmp3_;
	_tmp5_ = ind;
	if (_tmp5_ == NULL) {
		IAnjutaMarkable* _tmp6_;
		_tmp6_ = mark;
		_tmp4_ = _tmp6_ == NULL;
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		_g_object_unref0 (mark);
		_g_object_unref0 (ind);
		return;
	}
	_tmp7_ = ind;
	if (_tmp7_ != NULL) {
		IAnjutaIndicable* _tmp8_;
		_tmp8_ = ind;
		ianjuta_indicable_clear (_tmp8_, &_inner_error_);
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			_g_object_unref0 (mark);
			_g_object_unref0 (ind);
			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;
		}
	}
	_tmp9_ = mark;
	if (_tmp9_ != NULL) {
		IAnjutaMarkable* _tmp10_;
		_tmp10_ = mark;
		ianjuta_markable_delete_all_markers (_tmp10_, IANJUTA_MARKABLE_MESSAGE, &_inner_error_);
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			_g_object_unref0 (mark);
			_g_object_unref0 (ind);
			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;
		}
	}
	{
		ValaList* _e_list = NULL;
		ValaList* _tmp11_;
		ValaList* _tmp12_;
		gint _e_size = 0;
		ValaList* _tmp13_;
		gint _tmp14_;
		gint _tmp15_;
		gint _e_index = 0;
		_tmp11_ = self->priv->errors_list;
		_tmp12_ = _vala_iterable_ref0 (_tmp11_);
		_e_list = _tmp12_;
		_tmp13_ = _e_list;
		_tmp14_ = vala_collection_get_size ((ValaCollection*) _tmp13_);
		_tmp15_ = _tmp14_;
		_e_size = _tmp15_;
		_e_index = -1;
		while (TRUE) {
			gint _tmp16_;
			gint _tmp17_;
			gint _tmp18_;
			AnjutaReportError* e = NULL;
			ValaList* _tmp19_;
			gint _tmp20_;
			gpointer _tmp21_;
			const gchar* _tmp22_ = NULL;
			IAnjutaEditor* _tmp23_;
			const gchar* _tmp24_;
			AnjutaReportError* _tmp25_;
			ValaSourceReference* _tmp26_;
			ValaSourceFile* _tmp27_;
			ValaSourceFile* _tmp28_;
			const gchar* _tmp29_;
			const gchar* _tmp30_;
			gboolean _tmp31_;
			_tmp16_ = _e_index;
			_e_index = _tmp16_ + 1;
			_tmp17_ = _e_index;
			_tmp18_ = _e_size;
			if (!(_tmp17_ < _tmp18_)) {
				break;
			}
			_tmp19_ = _e_list;
			_tmp20_ = _e_index;
			_tmp21_ = vala_list_get (_tmp19_, _tmp20_);
			e = (AnjutaReportError*) _tmp21_;
			_tmp23_ = editor;
			_tmp24_ = ianjuta_document_get_filename (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, ianjuta_document_get_type (), IAnjutaDocument), &_inner_error_);
			_tmp22_ = _tmp24_;
			if (G_UNLIKELY (_inner_error_ != NULL)) {
				_anjuta_report_error_free0 (e);
				_vala_iterable_unref0 (_e_list);
				_g_object_unref0 (mark);
				_g_object_unref0 (ind);
				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;
			}
			_tmp25_ = e;
			_tmp26_ = (*_tmp25_).source;
			_tmp27_ = vala_source_reference_get_file (_tmp26_);
			_tmp28_ = _tmp27_;
			_tmp29_ = vala_source_file_get_filename (_tmp28_);
			_tmp30_ = _tmp29_;
			_tmp31_ = g_str_has_suffix (_tmp30_, _tmp22_);
			if (_tmp31_) {
				IAnjutaIndicable* _tmp32_;
				IAnjutaEditor* _tmp71_;
				_tmp32_ = ind;
				if (_tmp32_ != NULL) {
					IAnjutaIterable* begin_iter = NULL;
					IAnjutaEditor* _tmp33_;
					AnjutaReportError* _tmp34_;
					ValaSourceReference* _tmp35_;
					ValaSourceLocation _tmp36_ = {0};
					ValaSourceLocation _tmp37_;
					gint _tmp38_;
					IAnjutaIterable* _tmp39_;
					IAnjutaIterable* end_iter = NULL;
					IAnjutaEditor* _tmp49_;
					AnjutaReportError* _tmp50_;
					ValaSourceReference* _tmp51_;
					ValaSourceLocation _tmp52_ = {0};
					ValaSourceLocation _tmp53_;
					gint _tmp54_;
					IAnjutaIterable* _tmp55_;
					IAnjutaIndicableIndicator _tmp65_ = 0;
					AnjutaReportError* _tmp66_;
					gboolean _tmp67_;
					IAnjutaIndicable* _tmp68_;
					IAnjutaIterable* _tmp69_;
					IAnjutaIterable* _tmp70_;
					_tmp33_ = editor;
					_tmp34_ = e;
					_tmp35_ = (*_tmp34_).source;
					vala_source_reference_get_begin (_tmp35_, &_tmp36_);
					_tmp37_ = _tmp36_;
					_tmp38_ = _tmp37_.line;
					_tmp39_ = ianjuta_editor_get_line_begin_position (_tmp33_, _tmp38_, &_inner_error_);
					begin_iter = _tmp39_;
					if (G_UNLIKELY (_inner_error_ != NULL)) {
						_anjuta_report_error_free0 (e);
						_vala_iterable_unref0 (_e_list);
						_g_object_unref0 (mark);
						_g_object_unref0 (ind);
						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;
					}
					{
						gint i = 0;
						i = 1;
						{
							gboolean _tmp40_ = FALSE;
							_tmp40_ = TRUE;
							while (TRUE) {
								gint _tmp42_;
								AnjutaReportError* _tmp43_;
								ValaSourceReference* _tmp44_;
								ValaSourceLocation _tmp45_ = {0};
								ValaSourceLocation _tmp46_;
								gint _tmp47_;
								IAnjutaIterable* _tmp48_;
								if (!_tmp40_) {
									gint _tmp41_;
									_tmp41_ = i;
									i = _tmp41_ + 1;
								}
								_tmp40_ = FALSE;
								_tmp42_ = i;
								_tmp43_ = e;
								_tmp44_ = (*_tmp43_).source;
								vala_source_reference_get_begin (_tmp44_, &_tmp45_);
								_tmp46_ = _tmp45_;
								_tmp47_ = _tmp46_.column;
								if (!(_tmp42_ < _tmp47_)) {
									break;
								}
								_tmp48_ = begin_iter;
								ianjuta_iterable_next (_tmp48_, &_inner_error_);
								if (G_UNLIKELY (_inner_error_ != NULL)) {
									_g_object_unref0 (begin_iter);
									_anjuta_report_error_free0 (e);
									_vala_iterable_unref0 (_e_list);
									_g_object_unref0 (mark);
									_g_object_unref0 (ind);
									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;
								}
							}
						}
					}
					_tmp49_ = editor;
					_tmp50_ = e;
					_tmp51_ = (*_tmp50_).source;
					vala_source_reference_get_end (_tmp51_, &_tmp52_);
					_tmp53_ = _tmp52_;
					_tmp54_ = _tmp53_.line;
					_tmp55_ = ianjuta_editor_get_line_begin_position (_tmp49_, _tmp54_, &_inner_error_);
					end_iter = _tmp55_;
					if (G_UNLIKELY (_inner_error_ != NULL)) {
						_g_object_unref0 (begin_iter);
						_anjuta_report_error_free0 (e);
						_vala_iterable_unref0 (_e_list);
						_g_object_unref0 (mark);
						_g_object_unref0 (ind);
						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;
					}
					{
						gint i = 0;
						i = 0;
						{
							gboolean _tmp56_ = FALSE;
							_tmp56_ = TRUE;
							while (TRUE) {
								gint _tmp58_;
								AnjutaReportError* _tmp59_;
								ValaSourceReference* _tmp60_;
								ValaSourceLocation _tmp61_ = {0};
								ValaSourceLocation _tmp62_;
								gint _tmp63_;
								IAnjutaIterable* _tmp64_;
								if (!_tmp56_) {
									gint _tmp57_;
									_tmp57_ = i;
									i = _tmp57_ + 1;
								}
								_tmp56_ = FALSE;
								_tmp58_ = i;
								_tmp59_ = e;
								_tmp60_ = (*_tmp59_).source;
								vala_source_reference_get_end (_tmp60_, &_tmp61_);
								_tmp62_ = _tmp61_;
								_tmp63_ = _tmp62_.column;
								if (!(_tmp58_ < _tmp63_)) {
									break;
								}
								_tmp64_ = end_iter;
								ianjuta_iterable_next (_tmp64_, &_inner_error_);
								if (G_UNLIKELY (_inner_error_ != NULL)) {
									_g_object_unref0 (end_iter);
									_g_object_unref0 (begin_iter);
									_anjuta_report_error_free0 (e);
									_vala_iterable_unref0 (_e_list);
									_g_object_unref0 (mark);
									_g_object_unref0 (ind);
									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;
								}
							}
						}
					}
					_tmp66_ = e;
					_tmp67_ = (*_tmp66_).error;
					if (_tmp67_) {
						_tmp65_ = IANJUTA_INDICABLE_CRITICAL;
					} else {
						_tmp65_ = IANJUTA_INDICABLE_WARNING;
					}
					_tmp68_ = ind;
					_tmp69_ = begin_iter;
					_tmp70_ = end_iter;
					ianjuta_indicable_set (_tmp68_, _tmp69_, _tmp70_, _tmp65_, &_inner_error_);
					if (G_UNLIKELY (_inner_error_ != NULL)) {
						_g_object_unref0 (end_iter);
						_g_object_unref0 (begin_iter);
						_anjuta_report_error_free0 (e);
						_vala_iterable_unref0 (_e_list);
						_g_object_unref0 (mark);
						_g_object_unref0 (ind);
						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;
					}
					_g_object_unref0 (end_iter);
					_g_object_unref0 (begin_iter);
				}
				_tmp71_ = editor;
				if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp71_, ianjuta_markable_get_type ())) {
					IAnjutaMarkable* _tmp72_;
					AnjutaReportError* _tmp73_;
					ValaSourceReference* _tmp74_;
					ValaSourceLocation _tmp75_ = {0};
					ValaSourceLocation _tmp76_;
					gint _tmp77_;
					AnjutaReportError* _tmp78_;
					const gchar* _tmp79_;
					_tmp72_ = mark;
					_tmp73_ = e;
					_tmp74_ = (*_tmp73_).source;
					vala_source_reference_get_begin (_tmp74_, &_tmp75_);
					_tmp76_ = _tmp75_;
					_tmp77_ = _tmp76_.line;
					_tmp78_ = e;
					_tmp79_ = (*_tmp78_).message;
					ianjuta_markable_mark (_tmp72_, _tmp77_, IANJUTA_MARKABLE_MESSAGE, _tmp79_, &_inner_error_);
					if (G_UNLIKELY (_inner_error_ != NULL)) {
						_anjuta_report_error_free0 (e);
						_vala_iterable_unref0 (_e_list);
						_g_object_unref0 (mark);
						_g_object_unref0 (ind);
						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;
					}
				}
			}
			_anjuta_report_error_free0 (e);
		}
		_vala_iterable_unref0 (_e_list);
	}
	_g_object_unref0 (mark);
	_g_object_unref0 (ind);
}


void anjuta_report_clear_error_indicators (AnjutaReport* self, ValaSourceFile* file) {
	ValaSourceFile* _tmp0_;
	GList* _tmp36_ = NULL;
	IAnjutaDocumentManager* _tmp37_;
	GList* _tmp38_;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = file;
	if (_tmp0_ == NULL) {
		GEqualFunc _tmp1_;
		ValaArrayList* _tmp2_;
		_tmp1_ = g_direct_equal;
		_tmp2_ = vala_array_list_new (ANJUTA_REPORT_TYPE_ERROR, (GBoxedCopyFunc) anjuta_report_error_dup, (GDestroyNotify) anjuta_report_error_free, _tmp1_);
		_vala_iterable_unref0 (self->priv->errors_list);
		self->priv->errors_list = (ValaList*) _tmp2_;
		((ValaReport*) self)->errors = 0;
	} else {
		ValaList* _tmp31_;
		gint _tmp32_;
		gint _tmp33_;
		gint _tmp34_;
		gint _tmp35_;
		{
			gint i = 0;
			i = 0;
			{
				gboolean _tmp3_ = FALSE;
				_tmp3_ = TRUE;
				while (TRUE) {
					gint _tmp5_;
					ValaList* _tmp6_;
					gint _tmp7_;
					gint _tmp8_;
					ValaList* _tmp9_;
					gint _tmp10_;
					gpointer _tmp11_;
					AnjutaReportError* _tmp12_;
					ValaSourceReference* _tmp13_;
					ValaSourceFile* _tmp14_;
					ValaSourceFile* _tmp15_;
					ValaSourceFile* _tmp16_;
					gboolean _tmp17_;
					if (!_tmp3_) {
						gint _tmp4_;
						_tmp4_ = i;
						i = _tmp4_ + 1;
					}
					_tmp3_ = FALSE;
					_tmp5_ = i;
					_tmp6_ = self->priv->errors_list;
					_tmp7_ = vala_collection_get_size ((ValaCollection*) _tmp6_);
					_tmp8_ = _tmp7_;
					if (!(_tmp5_ < _tmp8_)) {
						break;
					}
					_tmp9_ = self->priv->errors_list;
					_tmp10_ = i;
					_tmp11_ = vala_list_get (_tmp9_, _tmp10_);
					_tmp12_ = (AnjutaReportError*) _tmp11_;
					_tmp13_ = (*_tmp12_).source;
					_tmp14_ = vala_source_reference_get_file (_tmp13_);
					_tmp15_ = _tmp14_;
					_tmp16_ = file;
					_tmp17_ = _tmp15_ == _tmp16_;
					_anjuta_report_error_free0 (_tmp12_);
					if (_tmp17_) {
						ValaList* _tmp18_;
						gint _tmp19_;
						gpointer _tmp20_;
						AnjutaReportError* _tmp21_;
						gboolean _tmp22_;
						gboolean _tmp23_;
						ValaList* _tmp26_;
						gint _tmp27_;
						gpointer _tmp28_;
						AnjutaReportError* _tmp29_;
						gint _tmp30_;
						_tmp18_ = self->priv->errors_list;
						_tmp19_ = i;
						_tmp20_ = vala_list_get (_tmp18_, _tmp19_);
						_tmp21_ = (AnjutaReportError*) _tmp20_;
						_tmp22_ = (*_tmp21_).error;
						_tmp23_ = _tmp22_;
						_anjuta_report_error_free0 (_tmp21_);
						if (_tmp23_) {
							gint _tmp24_;
							_tmp24_ = ((ValaReport*) self)->errors;
							((ValaReport*) self)->errors = _tmp24_ - 1;
						} else {
							gint _tmp25_;
							_tmp25_ = ((ValaReport*) self)->warnings;
							((ValaReport*) self)->warnings = _tmp25_ - 1;
						}
						_tmp26_ = self->priv->errors_list;
						_tmp27_ = i;
						_tmp28_ = vala_list_remove_at (_tmp26_, _tmp27_);
						_tmp29_ = (AnjutaReportError*) _tmp28_;
						_anjuta_report_error_free0 (_tmp29_);
						_tmp30_ = i;
						i = _tmp30_ - 1;
					}
				}
			}
		}
		_tmp31_ = self->priv->errors_list;
		_tmp32_ = vala_collection_get_size ((ValaCollection*) _tmp31_);
		_tmp33_ = _tmp32_;
		_tmp34_ = ((ValaReport*) self)->errors;
		_tmp35_ = ((ValaReport*) self)->warnings;
		_vala_assert (_tmp33_ <= (_tmp34_ + _tmp35_), "errors_list.size <= errors + warnings");
	}
	_tmp37_ = self->priv->_docman;
	_tmp38_ = ianjuta_document_manager_get_doc_widgets (_tmp37_, &_inner_error_);
	_tmp36_ = _tmp38_;
	if (G_UNLIKELY (_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;
	}
	{
		GList* doc_collection = NULL;
		GList* doc_it = NULL;
		doc_collection = _tmp36_;
		for (doc_it = doc_collection; doc_it != NULL; doc_it = doc_it->next) {
			GtkWidget* doc = NULL;
			doc = (GtkWidget*) doc_it->data;
			{
				GtkWidget* _tmp39_;
				GtkWidget* _tmp41_;
				_tmp39_ = doc;
				if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp39_, ianjuta_indicable_get_type ())) {
					GtkWidget* _tmp40_;
					_tmp40_ = doc;
					ianjuta_indicable_clear (G_TYPE_CHECK_INSTANCE_CAST (_tmp40_, ianjuta_indicable_get_type (), IAnjutaIndicable), &_inner_error_);
					if (G_UNLIKELY (_inner_error_ != NULL)) {
						_g_list_free0 (_tmp36_);
						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;
					}
				}
				_tmp41_ = doc;
				if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp41_, ianjuta_markable_get_type ())) {
					GtkWidget* _tmp42_;
					_tmp42_ = doc;
					ianjuta_markable_delete_all_markers (G_TYPE_CHECK_INSTANCE_CAST (_tmp42_, ianjuta_markable_get_type (), IAnjutaMarkable), IANJUTA_MARKABLE_MESSAGE, &_inner_error_);
					if (G_UNLIKELY (_inner_error_ != NULL)) {
						_g_list_free0 (_tmp36_);
						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;
					}
				}
			}
		}
	}
	_g_list_free0 (_tmp36_);
}


static gpointer _vala_source_reference_ref0 (gpointer self) {
	return self ? vala_source_reference_ref (self) : NULL;
}


static void anjuta_report_real_warn (ValaReport* base, ValaSourceReference* source, const gchar* message) {
	AnjutaReport * self;
	gint _tmp0_;
	ValaSourceReference* _tmp1_;
	GError * _inner_error_ = NULL;
	self = (AnjutaReport*) base;
	g_return_if_fail (message != NULL);
	_tmp0_ = ((ValaReport*) self)->warnings;
	((ValaReport*) self)->warnings = _tmp0_ + 1;
	_tmp1_ = source;
	if (_tmp1_ == NULL) {
		return;
	}
	{
		ValaList* _tmp2_;
		_tmp2_ = self->priv->errors_list;
		g_rec_mutex_lock (&self->priv->__lock_errors_list);
		{
			ValaList* _tmp3_;
			ValaSourceReference* _tmp4_;
			ValaSourceReference* _tmp5_;
			const gchar* _tmp6_;
			gchar* _tmp7_;
			AnjutaReportError _tmp8_ = {0};
			AnjutaReportError _tmp9_;
			AnjutaReportError _tmp10_;
			_tmp3_ = self->priv->errors_list;
			_tmp4_ = source;
			_tmp5_ = _vala_source_reference_ref0 (_tmp4_);
			_tmp6_ = message;
			_tmp7_ = g_strdup (_tmp6_);
			memset (&_tmp8_, 0, sizeof (AnjutaReportError));
			_vala_source_reference_unref0 (_tmp8_.source);
			_tmp8_.source = _tmp5_;
			_g_free0 (_tmp8_.message);
			_tmp8_.message = _tmp7_;
			_tmp8_.error = FALSE;
			_tmp9_ = _tmp8_;
			_tmp10_ = _tmp9_;
			vala_collection_add ((ValaCollection*) _tmp3_, &_tmp10_);
			anjuta_report_error_destroy (&_tmp9_);
		}
		__finally11:
		{
			ValaList* _tmp11_;
			_tmp11_ = self->priv->errors_list;
			g_rec_mutex_unlock (&self->priv->__lock_errors_list);
		}
		if (G_UNLIKELY (_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;
		}
	}
}


static void anjuta_report_real_err (ValaReport* base, ValaSourceReference* source, const gchar* message) {
	AnjutaReport * self;
	gint _tmp0_;
	ValaSourceReference* _tmp1_;
	GError * _inner_error_ = NULL;
	self = (AnjutaReport*) base;
	g_return_if_fail (message != NULL);
	_tmp0_ = ((ValaReport*) self)->errors;
	((ValaReport*) self)->errors = _tmp0_ + 1;
	_tmp1_ = source;
	if (_tmp1_ == NULL) {
		self->priv->general_error = TRUE;
		return;
	}
	{
		ValaList* _tmp2_;
		_tmp2_ = self->priv->errors_list;
		g_rec_mutex_lock (&self->priv->__lock_errors_list);
		{
			ValaList* _tmp3_;
			ValaSourceReference* _tmp4_;
			ValaSourceReference* _tmp5_;
			const gchar* _tmp6_;
			gchar* _tmp7_;
			AnjutaReportError _tmp8_ = {0};
			AnjutaReportError _tmp9_;
			AnjutaReportError _tmp10_;
			_tmp3_ = self->priv->errors_list;
			_tmp4_ = source;
			_tmp5_ = _vala_source_reference_ref0 (_tmp4_);
			_tmp6_ = message;
			_tmp7_ = g_strdup (_tmp6_);
			memset (&_tmp8_, 0, sizeof (AnjutaReportError));
			_vala_source_reference_unref0 (_tmp8_.source);
			_tmp8_.source = _tmp5_;
			_g_free0 (_tmp8_.message);
			_tmp8_.message = _tmp7_;
			_tmp8_.error = TRUE;
			_tmp9_ = _tmp8_;
			_tmp10_ = _tmp9_;
			vala_collection_add ((ValaCollection*) _tmp3_, &_tmp10_);
			anjuta_report_error_destroy (&_tmp9_);
		}
		__finally12:
		{
			ValaList* _tmp11_;
			_tmp11_ = self->priv->errors_list;
			g_rec_mutex_unlock (&self->priv->__lock_errors_list);
		}
		if (G_UNLIKELY (_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;
		}
	}
}


AnjutaReport* anjuta_report_construct (GType object_type) {
	AnjutaReport* self = NULL;
	self = (AnjutaReport*) vala_report_construct (object_type);
	return self;
}


AnjutaReport* anjuta_report_new (void) {
	return anjuta_report_construct (TYPE_ANJUTA_REPORT);
}


IAnjutaDocumentManager* anjuta_report_get_docman (AnjutaReport* self) {
	IAnjutaDocumentManager* result;
	IAnjutaDocumentManager* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_docman;
	result = _tmp0_;
	return result;
}


void anjuta_report_set_docman (AnjutaReport* self, IAnjutaDocumentManager* value) {
	IAnjutaDocumentManager* _tmp0_;
	IAnjutaDocumentManager* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->_docman);
	self->priv->_docman = _tmp1_;
}


static void anjuta_report_error_copy (const AnjutaReportError* self, AnjutaReportError* dest) {
	ValaSourceReference* _tmp0_;
	ValaSourceReference* _tmp1_;
	gboolean _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	_tmp0_ = (*self).source;
	_tmp1_ = _vala_source_reference_ref0 (_tmp0_);
	_vala_source_reference_unref0 ((*dest).source);
	(*dest).source = _tmp1_;
	_tmp2_ = (*self).error;
	(*dest).error = _tmp2_;
	_tmp3_ = (*self).message;
	_tmp4_ = g_strdup (_tmp3_);
	_g_free0 ((*dest).message);
	(*dest).message = _tmp4_;
}


static void anjuta_report_error_destroy (AnjutaReportError* self) {
	_vala_source_reference_unref0 ((*self).source);
	_g_free0 ((*self).message);
}


static AnjutaReportError* anjuta_report_error_dup (const AnjutaReportError* self) {
	AnjutaReportError* dup;
	dup = g_new0 (AnjutaReportError, 1);
	anjuta_report_error_copy (self, dup);
	return dup;
}


static void anjuta_report_error_free (AnjutaReportError* self) {
	anjuta_report_error_destroy (self);
	g_free (self);
}


static GType anjuta_report_error_get_type (void) {
	static volatile gsize anjuta_report_error_type_id__volatile = 0;
	if (g_once_init_enter (&anjuta_report_error_type_id__volatile)) {
		GType anjuta_report_error_type_id;
		anjuta_report_error_type_id = g_boxed_type_register_static ("AnjutaReportError", (GBoxedCopyFunc) anjuta_report_error_dup, (GBoxedFreeFunc) anjuta_report_error_free);
		g_once_init_leave (&anjuta_report_error_type_id__volatile, anjuta_report_error_type_id);
	}
	return anjuta_report_error_type_id__volatile;
}


static void anjuta_report_class_init (AnjutaReportClass * klass) {
	anjuta_report_parent_class = g_type_class_peek_parent (klass);
	((ValaReportClass *) klass)->finalize = anjuta_report_finalize;
	g_type_class_add_private (klass, sizeof (AnjutaReportPrivate));
	((ValaReportClass *) klass)->warn = (void (*) (ValaReport *, ValaSourceReference*, const gchar*)) anjuta_report_real_warn;
	((ValaReportClass *) klass)->err = (void (*) (ValaReport *, ValaSourceReference*, const gchar*)) anjuta_report_real_err;
}


static void anjuta_report_instance_init (AnjutaReport * self) {
	GEqualFunc _tmp0_;
	ValaArrayList* _tmp1_;
	self->priv = ANJUTA_REPORT_GET_PRIVATE (self);
	g_rec_mutex_init (&self->priv->__lock_errors_list);
	_tmp0_ = g_direct_equal;
	_tmp1_ = vala_array_list_new (ANJUTA_REPORT_TYPE_ERROR, (GBoxedCopyFunc) anjuta_report_error_dup, (GDestroyNotify) anjuta_report_error_free, _tmp0_);
	self->priv->errors_list = (ValaList*) _tmp1_;
	self->priv->general_error = FALSE;
}


static void anjuta_report_finalize (ValaReport * obj) {
	AnjutaReport * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_ANJUTA_REPORT, AnjutaReport);
	_g_object_unref0 (self->priv->_docman);
	g_rec_mutex_clear (&self->priv->__lock_errors_list);
	_vala_iterable_unref0 (self->priv->errors_list);
	VALA_REPORT_CLASS (anjuta_report_parent_class)->finalize (obj);
}


GType anjuta_report_get_type (void) {
	return anjuta_report_type_id;
}


GType anjuta_report_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (AnjutaReportClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) anjuta_report_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (AnjutaReport), 0, (GInstanceInitFunc) anjuta_report_instance_init, NULL };
	anjuta_report_type_id = g_type_module_register_type (module, VALA_TYPE_REPORT, "AnjutaReport", &g_define_type_info, 0);
	return anjuta_report_type_id;
}



