/* ide-vala-diagnostics.c generated by valac 0.30.0, the Vala compiler
 * generated from ide-vala-diagnostics.vala, do not modify */

/* ide-vala-diagnostics.vala
 *
 * Copyright (C) 2015 Christian Hergert <christian@hergert.me>
 *
 * 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 3 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/>.
 */

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


#define IDE_TYPE_VALA_DIAGNOSTICS (ide_vala_diagnostics_get_type ())
#define IDE_VALA_DIAGNOSTICS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), IDE_TYPE_VALA_DIAGNOSTICS, IdeValaDiagnostics))
#define IDE_VALA_DIAGNOSTICS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), IDE_TYPE_VALA_DIAGNOSTICS, IdeValaDiagnosticsClass))
#define IDE_IS_VALA_DIAGNOSTICS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IDE_TYPE_VALA_DIAGNOSTICS))
#define IDE_IS_VALA_DIAGNOSTICS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), IDE_TYPE_VALA_DIAGNOSTICS))
#define IDE_VALA_DIAGNOSTICS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), IDE_TYPE_VALA_DIAGNOSTICS, IdeValaDiagnosticsClass))

typedef struct _IdeValaDiagnostics IdeValaDiagnostics;
typedef struct _IdeValaDiagnosticsClass IdeValaDiagnosticsClass;
typedef struct _IdeValaDiagnosticsPrivate IdeValaDiagnosticsPrivate;

#define IDE_TYPE_VALA_SOURCE_FILE (ide_vala_source_file_get_type ())
#define IDE_VALA_SOURCE_FILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), IDE_TYPE_VALA_SOURCE_FILE, IdeValaSourceFile))
#define IDE_VALA_SOURCE_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), IDE_TYPE_VALA_SOURCE_FILE, IdeValaSourceFileClass))
#define IDE_IS_VALA_SOURCE_FILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IDE_TYPE_VALA_SOURCE_FILE))
#define IDE_IS_VALA_SOURCE_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), IDE_TYPE_VALA_SOURCE_FILE))
#define IDE_VALA_SOURCE_FILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), IDE_TYPE_VALA_SOURCE_FILE, IdeValaSourceFileClass))

typedef struct _IdeValaSourceFile IdeValaSourceFile;
typedef struct _IdeValaSourceFileClass IdeValaSourceFileClass;
#define _vala_source_file_unref0(var) ((var == NULL) ? NULL : (var = (vala_source_file_unref (var), NULL)))

struct _IdeValaDiagnostics {
	ValaReport parent_instance;
	IdeValaDiagnosticsPrivate * priv;
};

struct _IdeValaDiagnosticsClass {
	ValaReportClass parent_class;
};


static gpointer ide_vala_diagnostics_parent_class = NULL;
static GType ide_vala_diagnostics_type_id = 0;

GType ide_vala_diagnostics_get_type (void) G_GNUC_CONST;
GType ide_vala_diagnostics_register_type (GTypeModule * module);
enum  {
	IDE_VALA_DIAGNOSTICS_DUMMY_PROPERTY
};
void ide_vala_diagnostics_clear (IdeValaDiagnostics* self);
static void ide_vala_diagnostics_add (IdeValaDiagnostics* self, ValaSourceReference* source_reference, const gchar* message, IdeDiagnosticSeverity severity);
GType ide_vala_source_file_get_type (void) G_GNUC_CONST;
GType ide_vala_source_file_register_type (GTypeModule * module);
void ide_vala_source_file_report (IdeValaSourceFile* self, ValaSourceReference* source_reference, const gchar* message, IdeDiagnosticSeverity severity);
static void ide_vala_diagnostics_real_note (ValaReport* base, ValaSourceReference* source_reference, const gchar* message);
static void ide_vala_diagnostics_real_depr (ValaReport* base, ValaSourceReference* source_reference, const gchar* message);
static void ide_vala_diagnostics_real_warn (ValaReport* base, ValaSourceReference* source_reference, const gchar* message);
static void ide_vala_diagnostics_real_err (ValaReport* base, ValaSourceReference* source_reference, const gchar* message);
IdeValaDiagnostics* ide_vala_diagnostics_new (void);
IdeValaDiagnostics* ide_vala_diagnostics_construct (GType object_type);


void ide_vala_diagnostics_clear (IdeValaDiagnostics* self) {
	g_return_if_fail (self != NULL);
	((ValaReport*) self)->errors = 0;
	((ValaReport*) self)->warnings = 0;
}


static gpointer _vala_source_file_ref0 (gpointer self) {
	return self ? vala_source_file_ref (self) : NULL;
}


static void ide_vala_diagnostics_add (IdeValaDiagnostics* self, ValaSourceReference* source_reference, const gchar* message, IdeDiagnosticSeverity severity) {
	ValaSourceReference* _tmp0_ = NULL;
	ValaSourceReference* _tmp1_ = NULL;
	ValaSourceFile* _tmp2_ = NULL;
	ValaSourceFile* _tmp3_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (message != NULL);
	_tmp0_ = source_reference;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = source_reference;
	_tmp2_ = vala_source_reference_get_file (_tmp1_);
	_tmp3_ = _tmp2_;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, IDE_TYPE_VALA_SOURCE_FILE)) {
		IdeValaSourceFile* file = NULL;
		ValaSourceReference* _tmp4_ = NULL;
		ValaSourceFile* _tmp5_ = NULL;
		ValaSourceFile* _tmp6_ = NULL;
		IdeValaSourceFile* _tmp7_ = NULL;
		IdeValaSourceFile* _tmp8_ = NULL;
		ValaSourceReference* _tmp9_ = NULL;
		const gchar* _tmp10_ = NULL;
		IdeDiagnosticSeverity _tmp11_ = 0;
		_tmp4_ = source_reference;
		_tmp5_ = vala_source_reference_get_file (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = _vala_source_file_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, IDE_TYPE_VALA_SOURCE_FILE, IdeValaSourceFile));
		file = _tmp7_;
		_tmp8_ = file;
		_tmp9_ = source_reference;
		_tmp10_ = message;
		_tmp11_ = severity;
		ide_vala_source_file_report (_tmp8_, _tmp9_, _tmp10_, _tmp11_);
		_vala_source_file_unref0 (file);
	}
}


static void ide_vala_diagnostics_real_note (ValaReport* base, ValaSourceReference* source_reference, const gchar* message) {
	IdeValaDiagnostics * self;
	ValaSourceReference* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	self = (IdeValaDiagnostics*) base;
	g_return_if_fail (message != NULL);
	_tmp0_ = source_reference;
	_tmp1_ = message;
	ide_vala_diagnostics_add (self, _tmp0_, _tmp1_, IDE_DIAGNOSTIC_NOTE);
}


static void ide_vala_diagnostics_real_depr (ValaReport* base, ValaSourceReference* source_reference, const gchar* message) {
	IdeValaDiagnostics * self;
	ValaSourceReference* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	self = (IdeValaDiagnostics*) base;
	g_return_if_fail (message != NULL);
	_tmp0_ = source_reference;
	_tmp1_ = message;
	ide_vala_diagnostics_add (self, _tmp0_, _tmp1_, IDE_DIAGNOSTIC_DEPRECATED);
}


static void ide_vala_diagnostics_real_warn (ValaReport* base, ValaSourceReference* source_reference, const gchar* message) {
	IdeValaDiagnostics * self;
	ValaSourceReference* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	self = (IdeValaDiagnostics*) base;
	g_return_if_fail (message != NULL);
	_tmp0_ = source_reference;
	_tmp1_ = message;
	ide_vala_diagnostics_add (self, _tmp0_, _tmp1_, IDE_DIAGNOSTIC_WARNING);
}


static void ide_vala_diagnostics_real_err (ValaReport* base, ValaSourceReference* source_reference, const gchar* message) {
	IdeValaDiagnostics * self;
	ValaSourceReference* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	self = (IdeValaDiagnostics*) base;
	g_return_if_fail (message != NULL);
	_tmp0_ = source_reference;
	_tmp1_ = message;
	ide_vala_diagnostics_add (self, _tmp0_, _tmp1_, IDE_DIAGNOSTIC_ERROR);
}


IdeValaDiagnostics* ide_vala_diagnostics_construct (GType object_type) {
	IdeValaDiagnostics * self = NULL;
	self = (IdeValaDiagnostics*) vala_report_construct (object_type);
	return self;
}


IdeValaDiagnostics* ide_vala_diagnostics_new (void) {
	return ide_vala_diagnostics_construct (IDE_TYPE_VALA_DIAGNOSTICS);
}


static void ide_vala_diagnostics_class_init (IdeValaDiagnosticsClass * klass) {
	ide_vala_diagnostics_parent_class = g_type_class_peek_parent (klass);
	((ValaReportClass *) klass)->note = ide_vala_diagnostics_real_note;
	((ValaReportClass *) klass)->depr = ide_vala_diagnostics_real_depr;
	((ValaReportClass *) klass)->warn = ide_vala_diagnostics_real_warn;
	((ValaReportClass *) klass)->err = ide_vala_diagnostics_real_err;
}


static void ide_vala_diagnostics_instance_init (IdeValaDiagnostics * self) {
}


GType ide_vala_diagnostics_get_type (void) {
	return ide_vala_diagnostics_type_id;
}


GType ide_vala_diagnostics_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (IdeValaDiagnosticsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ide_vala_diagnostics_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (IdeValaDiagnostics), 0, (GInstanceInitFunc) ide_vala_diagnostics_instance_init, NULL };
	ide_vala_diagnostics_type_id = g_type_module_register_type (module, VALA_TYPE_REPORT, "IdeValaDiagnostics", &g_define_type_info, 0);
	return ide_vala_diagnostics_type_id;
}



