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

/*
 *  vtgbuildlogview.vala - Vala developer toys for GEdit
 *  
 *  Copyright (C) 2008 - Andrea Del Signore <sejerpz@tin.it>
 *  
 *  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.
 */

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <gedit/gedit-window.h>
#include <gedit/gedit-panel.h>
#include <glib/gi18n-lib.h>
#include <gedit/gedit-view.h>
#include <gedit/gedit-tab.h>
#include <float.h>
#include <math.h>
#include <valagee.h>
#include <afrodite.h>


#define VTG_TYPE_BUILD_LOG_VIEW (vtg_build_log_view_get_type ())
#define VTG_BUILD_LOG_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VTG_TYPE_BUILD_LOG_VIEW, VtgBuildLogView))
#define VTG_BUILD_LOG_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VTG_TYPE_BUILD_LOG_VIEW, VtgBuildLogViewClass))
#define VTG_IS_BUILD_LOG_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VTG_TYPE_BUILD_LOG_VIEW))
#define VTG_IS_BUILD_LOG_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VTG_TYPE_BUILD_LOG_VIEW))
#define VTG_BUILD_LOG_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VTG_TYPE_BUILD_LOG_VIEW, VtgBuildLogViewClass))

typedef struct _VtgBuildLogView VtgBuildLogView;
typedef struct _VtgBuildLogViewClass VtgBuildLogViewClass;
typedef struct _VtgBuildLogViewPrivate VtgBuildLogViewPrivate;

#define VTG_TYPE_PLUGIN_INSTANCE (vtg_plugin_instance_get_type ())
#define VTG_PLUGIN_INSTANCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VTG_TYPE_PLUGIN_INSTANCE, VtgPluginInstance))
#define VTG_PLUGIN_INSTANCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VTG_TYPE_PLUGIN_INSTANCE, VtgPluginInstanceClass))
#define VTG_IS_PLUGIN_INSTANCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VTG_TYPE_PLUGIN_INSTANCE))
#define VTG_IS_PLUGIN_INSTANCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VTG_TYPE_PLUGIN_INSTANCE))
#define VTG_PLUGIN_INSTANCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VTG_TYPE_PLUGIN_INSTANCE, VtgPluginInstanceClass))

typedef struct _VtgPluginInstance VtgPluginInstance;
typedef struct _VtgPluginInstanceClass VtgPluginInstanceClass;

#define VTG_TYPE_PROJECT_MANAGER (vtg_project_manager_get_type ())
#define VTG_PROJECT_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VTG_TYPE_PROJECT_MANAGER, VtgProjectManager))
#define VTG_PROJECT_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VTG_TYPE_PROJECT_MANAGER, VtgProjectManagerClass))
#define VTG_IS_PROJECT_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VTG_TYPE_PROJECT_MANAGER))
#define VTG_IS_PROJECT_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VTG_TYPE_PROJECT_MANAGER))
#define VTG_PROJECT_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VTG_TYPE_PROJECT_MANAGER, VtgProjectManagerClass))

typedef struct _VtgProjectManager VtgProjectManager;
typedef struct _VtgProjectManagerClass VtgProjectManagerClass;

#define VTG_BUILD_LOG_VIEW_TYPE_COLUMNS (vtg_build_log_view_columns_get_type ())
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define VTG_TYPE_OUTPUT_VIEW (vtg_output_view_get_type ())
#define VTG_OUTPUT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VTG_TYPE_OUTPUT_VIEW, VtgOutputView))
#define VTG_OUTPUT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VTG_TYPE_OUTPUT_VIEW, VtgOutputViewClass))
#define VTG_IS_OUTPUT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VTG_TYPE_OUTPUT_VIEW))
#define VTG_IS_OUTPUT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VTG_TYPE_OUTPUT_VIEW))
#define VTG_OUTPUT_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VTG_TYPE_OUTPUT_VIEW, VtgOutputViewClass))

typedef struct _VtgOutputView VtgOutputView;
typedef struct _VtgOutputViewClass VtgOutputViewClass;

#define VTG_TYPE_OUTPUT_TYPES (vtg_output_types_get_type ())
#define _gtk_tree_path_free0(var) ((var == NULL) ? NULL : (var = (gtk_tree_path_free (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))

struct _VtgBuildLogView {
	GObject parent_instance;
	VtgBuildLogViewPrivate * priv;
};

struct _VtgBuildLogViewClass {
	GObjectClass parent_class;
};

struct _VtgBuildLogViewPrivate {
	GtkVBox* _ui;
	GtkListStore* _child_model;
	GtkTreeModelFilter* _model;
	GtkTreeView* _build_view;
	gint _current_error_row;
	gint _vala_error_count;
	gint _vala_warning_count;
	gint _c_error_count;
	gint _c_warning_count;
	VtgPluginInstance* _plugin_instance;
	VtgProjectManager* _project;
	gboolean _show_vala_warnings;
	gboolean _show_vala_errors;
	gboolean _show_c_warnings;
	gboolean _show_c_errors;
	GtkToggleToolButton* _vala_warning_button;
	GtkToggleToolButton* _vala_error_button;
	GtkToggleToolButton* _c_warning_button;
	GtkToggleToolButton* _c_error_button;
};

typedef enum  {
	VTG_BUILD_LOG_VIEW_COLUMNS_ICON,
	VTG_BUILD_LOG_VIEW_COLUMNS_MESSAGE,
	VTG_BUILD_LOG_VIEW_COLUMNS_FILENAME,
	VTG_BUILD_LOG_VIEW_COLUMNS_LINE,
	VTG_BUILD_LOG_VIEW_COLUMNS_COLUMN,
	VTG_BUILD_LOG_VIEW_COLUMNS_IS_WARNING,
	VTG_BUILD_LOG_VIEW_COLUMNS_IS_VALA_SOURCE,
	VTG_BUILD_LOG_VIEW_COLUMNS_IS_AUTO_BUILD_MESSAGE,
	VTG_BUILD_LOG_VIEW_COLUMNS_PROJECT,
	VTG_BUILD_LOG_VIEW_COLUMNS_COLUMNS_COUNT
} VtgBuildLogViewColumns;

typedef enum  {
	VTG_OUTPUT_TYPES_MESSAGE,
	VTG_OUTPUT_TYPES_ERROR,
	VTG_OUTPUT_TYPES_CHILD_PROCESS,
	VTG_OUTPUT_TYPES_BUILD,
	VTG_OUTPUT_TYPES_AUTO_BUILD,
	VTG_OUTPUT_TYPES_SEARCH
} VtgOutputTypes;


static gpointer vtg_build_log_view_parent_class = NULL;
static GType vtg_build_log_view_type_id = 0;

GType vtg_build_log_view_get_type (void) G_GNUC_CONST;
GType vtg_build_log_view_register_type (GTypeModule * module);
GType vtg_plugin_instance_get_type (void) G_GNUC_CONST;
GType vtg_plugin_instance_register_type (GTypeModule * module);
GType vtg_project_manager_get_type (void) G_GNUC_CONST;
GType vtg_project_manager_register_type (GTypeModule * module);
#define VTG_BUILD_LOG_VIEW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), VTG_TYPE_BUILD_LOG_VIEW, VtgBuildLogViewPrivate))
enum  {
	VTG_BUILD_LOG_VIEW_DUMMY_PROPERTY,
	VTG_BUILD_LOG_VIEW_ERROR_COUNT,
	VTG_BUILD_LOG_VIEW_WARNING_COUNT
};
void vtg_utils_trace (const gchar* format, ...);
static GType vtg_build_log_view_columns_get_type (void) G_GNUC_UNUSED;
VtgBuildLogView* vtg_build_log_view_new (VtgPluginInstance* plugin_instance);
VtgBuildLogView* vtg_build_log_view_construct (GType object_type, VtgPluginInstance* plugin_instance);
GeditWindow* vtg_plugin_instance_get_window (VtgPluginInstance* self);
static void vtg_build_log_view_on_toggle_vala_warnings_toggled (VtgBuildLogView* self, GtkToggleToolButton* sender);
static void _vtg_build_log_view_on_toggle_vala_warnings_toggled_gtk_toggle_tool_button_toggled (GtkToggleToolButton* _sender, gpointer self);
static void vtg_build_log_view_on_toggle_vala_errors_toggled (VtgBuildLogView* self, GtkToggleToolButton* sender);
static void _vtg_build_log_view_on_toggle_vala_errors_toggled_gtk_toggle_tool_button_toggled (GtkToggleToolButton* _sender, gpointer self);
static void vtg_build_log_view_on_toggle_c_warnings_toggled (VtgBuildLogView* self, GtkToggleToolButton* sender);
static void _vtg_build_log_view_on_toggle_c_warnings_toggled_gtk_toggle_tool_button_toggled (GtkToggleToolButton* _sender, gpointer self);
static void vtg_build_log_view_on_toggle_c_errors_toggled (VtgBuildLogView* self, GtkToggleToolButton* sender);
static void _vtg_build_log_view_on_toggle_c_errors_toggled_gtk_toggle_tool_button_toggled (GtkToggleToolButton* _sender, gpointer self);
static gboolean vtg_build_log_view_filter_model (VtgBuildLogView* self, GtkTreeModel* model, GtkTreeIter* iter);
static gboolean _vtg_build_log_view_filter_model_gtk_tree_model_filter_visible_func (GtkTreeModel* model, GtkTreeIter* iter, gpointer self);
void vtg_build_log_view_on_build_view_row_activated (VtgBuildLogView* self, GtkWidget* sender, GtkTreePath* path, GtkTreeViewColumn* column);
static void _vtg_build_log_view_on_build_view_row_activated_gtk_tree_view_row_activated (GtkTreeView* _sender, GtkTreePath* path, GtkTreeViewColumn* column, gpointer self);
GType vtg_output_view_get_type (void) G_GNUC_CONST;
GType vtg_output_view_register_type (GTypeModule * module);
VtgOutputView* vtg_plugin_instance_get_output_view (VtgPluginInstance* self);
GType vtg_output_types_get_type (void) G_GNUC_CONST;
void vtg_build_log_view_on_message_added (VtgBuildLogView* self, VtgOutputView* sender, VtgOutputTypes output_type, const gchar* message);
static void _vtg_build_log_view_on_message_added_vtg_output_view_message_added (VtgOutputView* _sender, VtgOutputTypes output_type, const gchar* message, gpointer self);
static void vtg_build_log_view_update_toolbar_button_status (VtgBuildLogView* self);
void vtg_build_log_view_destroy (VtgBuildLogView* self);
void vtg_build_log_view_initialize (VtgBuildLogView* self, VtgProjectManager* project);
void vtg_build_log_view_activate (VtgBuildLogView* self);
static void vtg_build_log_view_add_message (VtgBuildLogView* self, VtgOutputTypes output_type, const gchar* message);
static void vtg_build_log_view_activate_path (VtgBuildLogView* self, GtkTreePath* path);
gchar* vtg_project_manager_source_uri_for_name (VtgProjectManager* self, const gchar* name);
GeditTab* vtg_plugin_instance_activate_uri (VtgPluginInstance* self, const gchar* uri, gint line, gint col);
void vtg_plugin_instance_activate_display_name (VtgPluginInstance* self, const gchar* display_name, gint line, gint col);
void vtg_build_log_view_next_error (VtgBuildLogView* self);
static gint vtg_build_log_view_get_shown_messages (VtgBuildLogView* self);
void vtg_build_log_view_previous_error (VtgBuildLogView* self);
void vtg_build_log_view_clear_messages (VtgBuildLogView* self);
void vtg_build_log_view_clear_messages_for_source (VtgBuildLogView* self, const gchar* filename);
static GtkTreeIter* _gtk_tree_iter_dup (GtkTreeIter* self);
void vtg_build_log_view_update_parse_result (VtgBuildLogView* self, const gchar* filename, AfroditeParseResult* parse_result);
gboolean vtg_string_utils_is_null_or_empty (const gchar* data);
static void vtg_build_log_view_add_vala_message (VtgBuildLogView* self, const gchar* file, const gchar* message, gboolean is_auto_build_message);
static void vtg_build_log_view_add_c_message (VtgBuildLogView* self, const gchar* file, const gchar* message, gboolean is_auto_build_message);
gint vtg_build_log_view_get_error_count (VtgBuildLogView* self);
gint vtg_build_log_view_get_warning_count (VtgBuildLogView* self);
static void vtg_build_log_view_finalize (GObject* obj);
static void _vala_vtg_build_log_view_get_property (GObject * object, guint property_id, 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 GType vtg_build_log_view_columns_get_type (void) {
	static volatile gsize vtg_build_log_view_columns_type_id__volatile = 0;
	if (g_once_init_enter (&vtg_build_log_view_columns_type_id__volatile)) {
		static const GEnumValue values[] = {{VTG_BUILD_LOG_VIEW_COLUMNS_ICON, "VTG_BUILD_LOG_VIEW_COLUMNS_ICON", "icon"}, {VTG_BUILD_LOG_VIEW_COLUMNS_MESSAGE, "VTG_BUILD_LOG_VIEW_COLUMNS_MESSAGE", "message"}, {VTG_BUILD_LOG_VIEW_COLUMNS_FILENAME, "VTG_BUILD_LOG_VIEW_COLUMNS_FILENAME", "filename"}, {VTG_BUILD_LOG_VIEW_COLUMNS_LINE, "VTG_BUILD_LOG_VIEW_COLUMNS_LINE", "line"}, {VTG_BUILD_LOG_VIEW_COLUMNS_COLUMN, "VTG_BUILD_LOG_VIEW_COLUMNS_COLUMN", "column"}, {VTG_BUILD_LOG_VIEW_COLUMNS_IS_WARNING, "VTG_BUILD_LOG_VIEW_COLUMNS_IS_WARNING", "is-warning"}, {VTG_BUILD_LOG_VIEW_COLUMNS_IS_VALA_SOURCE, "VTG_BUILD_LOG_VIEW_COLUMNS_IS_VALA_SOURCE", "is-vala-source"}, {VTG_BUILD_LOG_VIEW_COLUMNS_IS_AUTO_BUILD_MESSAGE, "VTG_BUILD_LOG_VIEW_COLUMNS_IS_AUTO_BUILD_MESSAGE", "is-auto-build-message"}, {VTG_BUILD_LOG_VIEW_COLUMNS_PROJECT, "VTG_BUILD_LOG_VIEW_COLUMNS_PROJECT", "project"}, {VTG_BUILD_LOG_VIEW_COLUMNS_COLUMNS_COUNT, "VTG_BUILD_LOG_VIEW_COLUMNS_COLUMNS_COUNT", "columns-count"}, {0, NULL, NULL}};
		GType vtg_build_log_view_columns_type_id;
		vtg_build_log_view_columns_type_id = g_enum_register_static ("VtgBuildLogViewColumns", values);
		g_once_init_leave (&vtg_build_log_view_columns_type_id__volatile, vtg_build_log_view_columns_type_id);
	}
	return vtg_build_log_view_columns_type_id__volatile;
}


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


static void _vtg_build_log_view_on_toggle_vala_warnings_toggled_gtk_toggle_tool_button_toggled (GtkToggleToolButton* _sender, gpointer self) {
	vtg_build_log_view_on_toggle_vala_warnings_toggled (self, _sender);
}


static void _vtg_build_log_view_on_toggle_vala_errors_toggled_gtk_toggle_tool_button_toggled (GtkToggleToolButton* _sender, gpointer self) {
	vtg_build_log_view_on_toggle_vala_errors_toggled (self, _sender);
}


static void _vtg_build_log_view_on_toggle_c_warnings_toggled_gtk_toggle_tool_button_toggled (GtkToggleToolButton* _sender, gpointer self) {
	vtg_build_log_view_on_toggle_c_warnings_toggled (self, _sender);
}


static void _vtg_build_log_view_on_toggle_c_errors_toggled_gtk_toggle_tool_button_toggled (GtkToggleToolButton* _sender, gpointer self) {
	vtg_build_log_view_on_toggle_c_errors_toggled (self, _sender);
}


static gboolean _vtg_build_log_view_filter_model_gtk_tree_model_filter_visible_func (GtkTreeModel* model, GtkTreeIter* iter, gpointer self) {
	gboolean result;
	result = vtg_build_log_view_filter_model (self, model, iter);
	return result;
}


static void _vtg_build_log_view_on_build_view_row_activated_gtk_tree_view_row_activated (GtkTreeView* _sender, GtkTreePath* path, GtkTreeViewColumn* column, gpointer self) {
	vtg_build_log_view_on_build_view_row_activated (self, _sender, path, column);
}


static void _vtg_build_log_view_on_message_added_vtg_output_view_message_added (VtgOutputView* _sender, VtgOutputTypes output_type, const gchar* message, gpointer self) {
	vtg_build_log_view_on_message_added (self, _sender, output_type, message);
}


VtgBuildLogView* vtg_build_log_view_construct (GType object_type, VtgPluginInstance* plugin_instance) {
	VtgBuildLogView * self = NULL;
	GeditWindow* _tmp0_ = NULL;
	GeditPanel* _tmp1_ = NULL;
	GeditPanel* _tmp2_;
	GeditPanel* panel;
	GtkVBox* _tmp3_ = NULL;
	GtkToolbar* _tmp4_ = NULL;
	GtkToolbar* toolbar;
	GtkToggleToolButton* _tmp5_ = NULL;
	const gchar* _tmp6_ = NULL;
	const gchar* _tmp7_ = NULL;
	GtkToggleToolButton* _tmp8_ = NULL;
	const gchar* _tmp9_ = NULL;
	const gchar* _tmp10_ = NULL;
	GtkSeparatorToolItem* _tmp11_ = NULL;
	GtkSeparatorToolItem* separator;
	GtkToggleToolButton* _tmp12_ = NULL;
	const gchar* _tmp13_ = NULL;
	const gchar* _tmp14_ = NULL;
	GtkToggleToolButton* _tmp15_ = NULL;
	const gchar* _tmp16_ = NULL;
	const gchar* _tmp17_ = NULL;
	GtkListStore* _tmp18_ = NULL;
	GtkTreeModelFilter* _tmp19_ = NULL;
	GtkTreeModelFilter* model_tmp;
	GtkTreeView* _tmp20_ = NULL;
	GtkCellRendererPixbuf* _tmp21_ = NULL;
	GtkCellRenderer* renderer;
	GtkTreeViewColumn* _tmp22_ = NULL;
	GtkTreeViewColumn* column;
	const gchar* _tmp23_ = NULL;
	GtkCellRendererText* _tmp24_ = NULL;
	GtkCellRendererText* _tmp25_ = NULL;
	GtkTreeViewColumn* _tmp26_ = NULL;
	const gchar* _tmp27_ = NULL;
	GtkCellRendererText* _tmp28_ = NULL;
	GtkTreeViewColumn* _tmp29_ = NULL;
	const gchar* _tmp30_ = NULL;
	GtkCellRendererText* _tmp31_ = NULL;
	GtkTreeViewColumn* _tmp32_ = NULL;
	const gchar* _tmp33_ = NULL;
	GtkScrolledWindow* _tmp34_ = NULL;
	GtkScrolledWindow* scroll;
	const gchar* _tmp35_ = NULL;
	VtgOutputView* _tmp36_ = NULL;
	g_return_val_if_fail (plugin_instance != NULL, NULL);
	self = (VtgBuildLogView*) g_object_new (object_type, NULL);
	self->priv->_plugin_instance = plugin_instance;
	_tmp0_ = vtg_plugin_instance_get_window (self->priv->_plugin_instance);
	_tmp1_ = gedit_window_get_bottom_panel (_tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	panel = _tmp2_;
	_tmp3_ = (GtkVBox*) gtk_vbox_new (FALSE, 8);
	_g_object_unref0 (self->priv->_ui);
	self->priv->_ui = g_object_ref_sink (_tmp3_);
	_tmp4_ = (GtkToolbar*) gtk_toolbar_new ();
	toolbar = g_object_ref_sink (_tmp4_);
	gtk_toolbar_set_style (toolbar, GTK_TOOLBAR_BOTH_HORIZ);
	gtk_toolbar_set_icon_size (toolbar, GTK_ICON_SIZE_SMALL_TOOLBAR);
	_tmp5_ = (GtkToggleToolButton*) gtk_toggle_tool_button_new ();
	_g_object_unref0 (self->priv->_vala_warning_button);
	self->priv->_vala_warning_button = g_object_ref_sink (_tmp5_);
	_tmp6_ = _ ("Warnings");
	gtk_tool_button_set_label ((GtkToolButton*) self->priv->_vala_warning_button, _tmp6_);
	gtk_tool_item_set_is_important ((GtkToolItem*) self->priv->_vala_warning_button, TRUE);
	gtk_tool_button_set_icon_name ((GtkToolButton*) self->priv->_vala_warning_button, GTK_STOCK_DIALOG_WARNING);
	gtk_toggle_tool_button_set_active (self->priv->_vala_warning_button, TRUE);
	g_signal_connect_object (self->priv->_vala_warning_button, "toggled", (GCallback) _vtg_build_log_view_on_toggle_vala_warnings_toggled_gtk_toggle_tool_button_toggled, self, 0);
	_tmp7_ = _ ("Show or hide the warnings from the build result view");
	gtk_tool_item_set_tooltip_text ((GtkToolItem*) self->priv->_vala_warning_button, _tmp7_);
	gtk_toolbar_insert (toolbar, (GtkToolItem*) self->priv->_vala_warning_button, -1);
	_tmp8_ = (GtkToggleToolButton*) gtk_toggle_tool_button_new ();
	_g_object_unref0 (self->priv->_vala_error_button);
	self->priv->_vala_error_button = g_object_ref_sink (_tmp8_);
	_tmp9_ = _ ("Errors");
	gtk_tool_button_set_label ((GtkToolButton*) self->priv->_vala_error_button, _tmp9_);
	gtk_tool_item_set_is_important ((GtkToolItem*) self->priv->_vala_error_button, TRUE);
	gtk_tool_button_set_icon_name ((GtkToolButton*) self->priv->_vala_error_button, GTK_STOCK_DIALOG_ERROR);
	g_signal_connect_object (self->priv->_vala_error_button, "toggled", (GCallback) _vtg_build_log_view_on_toggle_vala_errors_toggled_gtk_toggle_tool_button_toggled, self, 0);
	_tmp10_ = _ ("Show or hide the errors from the build result view");
	gtk_tool_item_set_tooltip_text ((GtkToolItem*) self->priv->_vala_error_button, _tmp10_);
	gtk_toggle_tool_button_set_active (self->priv->_vala_error_button, TRUE);
	gtk_toolbar_insert (toolbar, (GtkToolItem*) self->priv->_vala_error_button, -1);
	_tmp11_ = (GtkSeparatorToolItem*) gtk_separator_tool_item_new ();
	separator = g_object_ref_sink (_tmp11_);
	gtk_toolbar_insert (toolbar, (GtkToolItem*) separator, -1);
	_tmp12_ = (GtkToggleToolButton*) gtk_toggle_tool_button_new ();
	_g_object_unref0 (self->priv->_c_warning_button);
	self->priv->_c_warning_button = g_object_ref_sink (_tmp12_);
	_tmp13_ = _ ("C Warnings");
	gtk_tool_button_set_label ((GtkToolButton*) self->priv->_c_warning_button, _tmp13_);
	gtk_tool_item_set_is_important ((GtkToolItem*) self->priv->_c_warning_button, TRUE);
	gtk_tool_button_set_icon_name ((GtkToolButton*) self->priv->_c_warning_button, GTK_STOCK_DIALOG_WARNING);
	gtk_toggle_tool_button_set_active (self->priv->_c_warning_button, self->priv->_show_c_warnings);
	g_signal_connect_object (self->priv->_c_warning_button, "toggled", (GCallback) _vtg_build_log_view_on_toggle_c_warnings_toggled_gtk_toggle_tool_button_toggled, self, 0);
	_tmp14_ = _ ("Show or hide the C warnings from the build result view");
	gtk_tool_item_set_tooltip_text ((GtkToolItem*) self->priv->_c_warning_button, _tmp14_);
	gtk_toolbar_insert (toolbar, (GtkToolItem*) self->priv->_c_warning_button, -1);
	_tmp15_ = (GtkToggleToolButton*) gtk_toggle_tool_button_new ();
	_g_object_unref0 (self->priv->_c_error_button);
	self->priv->_c_error_button = g_object_ref_sink (_tmp15_);
	_tmp16_ = _ ("C Errors");
	gtk_tool_button_set_label ((GtkToolButton*) self->priv->_c_error_button, _tmp16_);
	gtk_tool_item_set_is_important ((GtkToolItem*) self->priv->_c_error_button, TRUE);
	gtk_tool_button_set_icon_name ((GtkToolButton*) self->priv->_c_error_button, GTK_STOCK_DIALOG_ERROR);
	g_signal_connect_object (self->priv->_c_error_button, "toggled", (GCallback) _vtg_build_log_view_on_toggle_c_errors_toggled_gtk_toggle_tool_button_toggled, self, 0);
	_tmp17_ = _ ("Show or hide the C errors from the build result view");
	gtk_tool_item_set_tooltip_text ((GtkToolItem*) self->priv->_c_error_button, _tmp17_);
	gtk_toggle_tool_button_set_active (self->priv->_c_error_button, TRUE);
	gtk_toolbar_insert (toolbar, (GtkToolItem*) self->priv->_c_error_button, -1);
	gtk_box_pack_start ((GtkBox*) self->priv->_ui, (GtkWidget*) toolbar, FALSE, TRUE, (guint) 0);
	_tmp18_ = gtk_list_store_new ((gint) VTG_BUILD_LOG_VIEW_COLUMNS_COLUMNS_COUNT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_OBJECT);
	_g_object_unref0 (self->priv->_child_model);
	self->priv->_child_model = _tmp18_;
	_tmp19_ = (GtkTreeModelFilter*) gtk_tree_model_filter_new ((GtkTreeModel*) self->priv->_child_model, NULL);
	model_tmp = _tmp19_;
	self->priv->_model = model_tmp;
	gtk_tree_model_filter_set_visible_func (self->priv->_model, _vtg_build_log_view_filter_model_gtk_tree_model_filter_visible_func, g_object_ref (self), g_object_unref);
	_tmp20_ = (GtkTreeView*) gtk_tree_view_new_with_model ((GtkTreeModel*) self->priv->_model);
	_g_object_unref0 (self->priv->_build_view);
	self->priv->_build_view = g_object_ref_sink (_tmp20_);
	_tmp21_ = (GtkCellRendererPixbuf*) gtk_cell_renderer_pixbuf_new ();
	renderer = (GtkCellRenderer*) g_object_ref_sink (_tmp21_);
	_tmp22_ = gtk_tree_view_column_new ();
	column = g_object_ref_sink (_tmp22_);
	_tmp23_ = _ ("Message");
	gtk_tree_view_column_set_title (column, _tmp23_);
	gtk_cell_layout_pack_start ((GtkCellLayout*) column, renderer, FALSE);
	gtk_cell_layout_add_attribute ((GtkCellLayout*) column, renderer, "stock-id", (gint) VTG_BUILD_LOG_VIEW_COLUMNS_ICON);
	_tmp24_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	_g_object_unref0 (renderer);
	renderer = (GtkCellRenderer*) g_object_ref_sink (_tmp24_);
	gtk_cell_layout_pack_start ((GtkCellLayout*) column, renderer, TRUE);
	gtk_cell_layout_add_attribute ((GtkCellLayout*) column, renderer, "text", (gint) VTG_BUILD_LOG_VIEW_COLUMNS_MESSAGE);
	gtk_tree_view_append_column (self->priv->_build_view, column);
	_tmp25_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	_g_object_unref0 (renderer);
	renderer = (GtkCellRenderer*) g_object_ref_sink (_tmp25_);
	_tmp26_ = gtk_tree_view_column_new ();
	_g_object_unref0 (column);
	column = g_object_ref_sink (_tmp26_);
	_tmp27_ = _ ("File");
	gtk_tree_view_column_set_title (column, _tmp27_);
	gtk_cell_layout_pack_start ((GtkCellLayout*) column, renderer, FALSE);
	gtk_cell_layout_add_attribute ((GtkCellLayout*) column, renderer, "text", (gint) VTG_BUILD_LOG_VIEW_COLUMNS_FILENAME);
	gtk_tree_view_append_column (self->priv->_build_view, column);
	_tmp28_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	_g_object_unref0 (renderer);
	renderer = (GtkCellRenderer*) g_object_ref_sink (_tmp28_);
	_tmp29_ = gtk_tree_view_column_new ();
	_g_object_unref0 (column);
	column = g_object_ref_sink (_tmp29_);
	_tmp30_ = _ ("Line");
	gtk_tree_view_column_set_title (column, _tmp30_);
	gtk_cell_layout_pack_start ((GtkCellLayout*) column, renderer, FALSE);
	gtk_cell_layout_add_attribute ((GtkCellLayout*) column, renderer, "text", (gint) VTG_BUILD_LOG_VIEW_COLUMNS_LINE);
	gtk_tree_view_append_column (self->priv->_build_view, column);
	_tmp31_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	_g_object_unref0 (renderer);
	renderer = (GtkCellRenderer*) g_object_ref_sink (_tmp31_);
	_tmp32_ = gtk_tree_view_column_new ();
	_g_object_unref0 (column);
	column = g_object_ref_sink (_tmp32_);
	_tmp33_ = _ ("Column");
	gtk_tree_view_column_set_title (column, _tmp33_);
	gtk_cell_layout_pack_start ((GtkCellLayout*) column, renderer, FALSE);
	gtk_cell_layout_add_attribute ((GtkCellLayout*) column, renderer, "text", (gint) VTG_BUILD_LOG_VIEW_COLUMNS_COLUMN);
	gtk_tree_view_append_column (self->priv->_build_view, column);
	g_signal_connect_object (self->priv->_build_view, "row-activated", (GCallback) _vtg_build_log_view_on_build_view_row_activated_gtk_tree_view_row_activated, self, 0);
	gtk_tree_view_set_rules_hint (self->priv->_build_view, TRUE);
	_tmp34_ = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL);
	scroll = g_object_ref_sink (_tmp34_);
	gtk_container_add ((GtkContainer*) scroll, (GtkWidget*) self->priv->_build_view);
	gtk_box_pack_start ((GtkBox*) self->priv->_ui, (GtkWidget*) scroll, TRUE, TRUE, (guint) 0);
	gtk_widget_show_all ((GtkWidget*) self->priv->_ui);
	_tmp35_ = _ ("Build results");
	gedit_panel_add_item_with_stock_icon (panel, (GtkWidget*) self->priv->_ui, "Build results", _tmp35_, GTK_STOCK_EXECUTE);
	_tmp36_ = vtg_plugin_instance_get_output_view (self->priv->_plugin_instance);
	g_signal_connect_object (_tmp36_, "message-added", (GCallback) _vtg_build_log_view_on_message_added_vtg_output_view_message_added, self, 0);
	gtk_tree_sortable_set_sort_column_id ((GtkTreeSortable*) self->priv->_child_model, 5, GTK_SORT_ASCENDING);
	vtg_build_log_view_update_toolbar_button_status (self);
	_g_object_unref0 (scroll);
	_g_object_unref0 (column);
	_g_object_unref0 (renderer);
	_g_object_unref0 (model_tmp);
	_g_object_unref0 (separator);
	_g_object_unref0 (toolbar);
	_g_object_unref0 (panel);
	return self;
}


VtgBuildLogView* vtg_build_log_view_new (VtgPluginInstance* plugin_instance) {
	return vtg_build_log_view_construct (VTG_TYPE_BUILD_LOG_VIEW, plugin_instance);
}


void vtg_build_log_view_destroy (VtgBuildLogView* self) {
	GeditWindow* _tmp0_ = NULL;
	GeditPanel* _tmp1_ = NULL;
	GeditPanel* _tmp2_;
	GeditPanel* panel;
	g_return_if_fail (self != NULL);
	_tmp0_ = vtg_plugin_instance_get_window (self->priv->_plugin_instance);
	_tmp1_ = gedit_window_get_bottom_panel (_tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	panel = _tmp2_;
	gedit_panel_remove_item (panel, (GtkWidget*) self->priv->_ui);
	_g_object_unref0 (self->priv->_ui);
	self->priv->_ui = NULL;
	self->priv->_model = NULL;
	_g_object_unref0 (self->priv->_build_view);
	self->priv->_build_view = NULL;
	_g_object_unref0 (self->priv->_child_model);
	self->priv->_child_model = NULL;
	_g_object_unref0 (panel);
}


void vtg_build_log_view_initialize (VtgBuildLogView* self, VtgProjectManager* project) {
	g_return_if_fail (self != NULL);
	self->priv->_project = project;
	self->priv->_current_error_row = 0;
	self->priv->_vala_error_count = 0;
	self->priv->_vala_warning_count = 0;
	self->priv->_c_error_count = 0;
	self->priv->_c_warning_count = 0;
	gtk_list_store_clear (self->priv->_child_model);
	vtg_build_log_view_update_toolbar_button_status (self);
}


void vtg_build_log_view_activate (VtgBuildLogView* self) {
	GeditWindow* _tmp0_ = NULL;
	GeditPanel* _tmp1_ = NULL;
	GeditPanel* _tmp2_;
	GeditPanel* panel;
	GeditWindow* _tmp3_ = NULL;
	GeditView* _tmp4_ = NULL;
	GeditView* _tmp5_;
	GeditView* view;
	gboolean _tmp6_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = vtg_plugin_instance_get_window (self->priv->_plugin_instance);
	_tmp1_ = gedit_window_get_bottom_panel (_tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	panel = _tmp2_;
	gedit_panel_activate_item (panel, (GtkWidget*) self->priv->_ui);
	_tmp3_ = vtg_plugin_instance_get_window (self->priv->_plugin_instance);
	_tmp4_ = gedit_window_get_active_view (_tmp3_);
	_tmp5_ = _g_object_ref0 (_tmp4_);
	view = _tmp5_;
	if (view != NULL) {
		gboolean _tmp7_;
		g_object_get ((GtkWidget*) view, "is-focus", &_tmp7_, NULL);
		_tmp6_ = !_tmp7_;
	} else {
		_tmp6_ = FALSE;
	}
	if (_tmp6_) {
		gtk_widget_grab_focus ((GtkWidget*) view);
	}
	_g_object_unref0 (view);
	_g_object_unref0 (panel);
}


static void vtg_build_log_view_on_toggle_vala_warnings_toggled (VtgBuildLogView* self, GtkToggleToolButton* sender) {
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (sender != NULL);
	_tmp0_ = gtk_toggle_tool_button_get_active (sender);
	self->priv->_show_vala_warnings = _tmp0_;
	if (self->priv->_model != NULL) {
		gtk_tree_model_filter_refilter (self->priv->_model);
	}
}


static void vtg_build_log_view_on_toggle_vala_errors_toggled (VtgBuildLogView* self, GtkToggleToolButton* sender) {
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (sender != NULL);
	_tmp0_ = gtk_toggle_tool_button_get_active (sender);
	self->priv->_show_vala_errors = _tmp0_;
	if (self->priv->_model != NULL) {
		gtk_tree_model_filter_refilter (self->priv->_model);
	}
}


static void vtg_build_log_view_on_toggle_c_warnings_toggled (VtgBuildLogView* self, GtkToggleToolButton* sender) {
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (sender != NULL);
	_tmp0_ = gtk_toggle_tool_button_get_active (sender);
	self->priv->_show_c_warnings = _tmp0_;
	if (self->priv->_model != NULL) {
		gtk_tree_model_filter_refilter (self->priv->_model);
	}
}


static void vtg_build_log_view_on_toggle_c_errors_toggled (VtgBuildLogView* self, GtkToggleToolButton* sender) {
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (sender != NULL);
	_tmp0_ = gtk_toggle_tool_button_get_active (sender);
	self->priv->_show_c_errors = _tmp0_;
	if (self->priv->_model != NULL) {
		gtk_tree_model_filter_refilter (self->priv->_model);
	}
}


void vtg_build_log_view_on_message_added (VtgBuildLogView* self, VtgOutputView* sender, VtgOutputTypes output_type, const gchar* message) {
	g_return_if_fail (self != NULL);
	g_return_if_fail (sender != NULL);
	g_return_if_fail (message != NULL);
	vtg_build_log_view_add_message (self, output_type, message);
}


static gpointer _gtk_tree_path_copy0 (gpointer self) {
	return self ? gtk_tree_path_copy (self) : NULL;
}


void vtg_build_log_view_on_build_view_row_activated (VtgBuildLogView* self, GtkWidget* sender, GtkTreePath* path, GtkTreeViewColumn* column) {
	GtkTreePath* _tmp0_ = NULL;
	GtkTreePath* _tmp1_;
	GtkTreePath* child_path;
	g_return_if_fail (self != NULL);
	g_return_if_fail (sender != NULL);
	g_return_if_fail (path != NULL);
	g_return_if_fail (column != NULL);
	_tmp0_ = gtk_tree_model_filter_convert_path_to_child_path (self->priv->_model, path);
	_tmp1_ = _gtk_tree_path_copy0 (_tmp0_);
	child_path = _tmp1_;
	vtg_build_log_view_activate_path (self, child_path);
	_gtk_tree_path_free0 (child_path);
}


static glong string_strnlen (gchar* str, glong maxlen) {
	glong result = 0L;
	gchar* _tmp0_ = NULL;
	gchar* end;
	_tmp0_ = memchr (str, 0, (gsize) maxlen);
	end = _tmp0_;
	if (end == NULL) {
		result = maxlen;
		return result;
	} else {
		result = (glong) (end - str);
		return result;
	}
}


static gchar* string_substring (const gchar* self, glong offset, glong len) {
	gchar* result = NULL;
	glong string_length = 0L;
	gboolean _tmp0_ = FALSE;
	gchar* _tmp3_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	if (offset >= 0) {
		_tmp0_ = len >= 0;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		glong _tmp1_;
		_tmp1_ = string_strnlen ((gchar*) self, offset + len);
		string_length = _tmp1_;
	} else {
		gint _tmp2_;
		_tmp2_ = strlen (self);
		string_length = (glong) _tmp2_;
	}
	if (offset < 0) {
		offset = string_length + offset;
		g_return_val_if_fail (offset >= 0, NULL);
	} else {
		g_return_val_if_fail (offset <= string_length, NULL);
	}
	if (len < 0) {
		len = string_length - offset;
	}
	g_return_val_if_fail ((offset + len) <= string_length, NULL);
	_tmp3_ = g_strndup (((gchar*) self) + offset, (gsize) len);
	result = _tmp3_;
	return result;
}


static void vtg_build_log_view_activate_path (VtgBuildLogView* self, GtkTreePath* path) {
	GtkTreeIter iter = {0};
	GtkTreeIter _tmp0_ = {0};
	gboolean _tmp1_;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (path != NULL);
	_tmp1_ = gtk_tree_model_get_iter ((GtkTreeModel*) self->priv->_child_model, &_tmp0_, path);
	iter = _tmp0_;
	if (_tmp1_) {
		gchar* name = NULL;
		gint line = 0;
		gint col = 0;
		gboolean is_vala_source = FALSE;
		VtgProjectManager* proj = NULL;
		gtk_tree_model_get ((GtkTreeModel*) self->priv->_child_model, &iter, VTG_BUILD_LOG_VIEW_COLUMNS_FILENAME, &name, VTG_BUILD_LOG_VIEW_COLUMNS_LINE, &line, VTG_BUILD_LOG_VIEW_COLUMNS_COLUMN, &col, VTG_BUILD_LOG_VIEW_COLUMNS_IS_VALA_SOURCE, &is_vala_source, VTG_BUILD_LOG_VIEW_COLUMNS_PROJECT, &proj, -1);
		if (proj != NULL) {
			gchar* uri;
			uri = NULL;
			if (is_vala_source) {
				gchar* _tmp2_ = NULL;
				_tmp2_ = vtg_project_manager_source_uri_for_name (proj, name);
				_g_free0 (uri);
				uri = _tmp2_;
			} else {
				gchar* _tmp3_ = NULL;
				gchar* _tmp4_;
				gboolean _tmp5_;
				gboolean _tmp6_;
				_tmp3_ = g_strdup_printf ("%c", G_DIR_SEPARATOR);
				_tmp4_ = _tmp3_;
				_tmp5_ = g_str_has_prefix (name, _tmp4_);
				_tmp6_ = _tmp5_;
				_g_free0 (_tmp4_);
				if (_tmp6_) {
					gchar* _tmp7_ = NULL;
					gchar* _tmp8_;
					_tmp7_ = g_filename_to_uri (name, NULL, &_inner_error_);
					_tmp8_ = _tmp7_;
					if (_inner_error_ != NULL) {
						goto __catch36_g_error;
					}
					_g_free0 (uri);
					uri = _tmp8_;
					goto __finally36;
					__catch36_g_error:
					{
						GError * err;
						err = _inner_error_;
						_inner_error_ = NULL;
						g_critical ("vtgbuildlogview.vala:313: error: %s", err->message);
						_g_error_free0 (err);
					}
					__finally36:
					if (_inner_error_ != NULL) {
						_g_free0 (uri);
						_g_object_unref0 (proj);
						_g_free0 (name);
						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;
					}
				} else {
					gint _tmp9_;
					gint _tmp10_;
					gchar* _tmp11_ = NULL;
					gchar* _tmp12_;
					gchar* _tmp13_;
					gchar* _tmp14_;
					gchar* vala_name;
					gchar* _tmp15_ = NULL;
					_tmp9_ = strlen (name);
					_tmp10_ = strlen (".c");
					_tmp11_ = string_substring (name, (glong) 0, (glong) (_tmp9_ - _tmp10_));
					_tmp12_ = _tmp11_;
					_tmp13_ = g_strconcat (_tmp12_, ".vala", NULL);
					_tmp14_ = _tmp13_;
					_g_free0 (_tmp12_);
					vala_name = _tmp14_;
					_tmp15_ = vtg_project_manager_source_uri_for_name (proj, vala_name);
					_g_free0 (uri);
					uri = _tmp15_;
					if (uri == NULL) {
						gint _tmp16_;
						gint _tmp17_;
						gchar* _tmp18_ = NULL;
						gchar* _tmp19_;
						gchar* _tmp20_;
						gchar* _tmp21_ = NULL;
						_tmp16_ = strlen (name);
						_tmp17_ = strlen (".c");
						_tmp18_ = string_substring (name, (glong) 0, (glong) (_tmp16_ - _tmp17_));
						_tmp19_ = _tmp18_;
						_tmp20_ = g_strconcat (_tmp19_, ".vapi", NULL);
						_g_free0 (vala_name);
						vala_name = _tmp20_;
						_g_free0 (_tmp19_);
						_tmp21_ = vtg_project_manager_source_uri_for_name (proj, vala_name);
						_g_free0 (uri);
						uri = _tmp21_;
					}
					if (uri != NULL) {
						gchar* _tmp22_ = NULL;
						gchar* _tmp23_;
						gchar* _tmp24_ = NULL;
						_tmp22_ = g_path_get_dirname (uri);
						_tmp23_ = _tmp22_;
						_tmp24_ = g_build_filename (_tmp23_, name, NULL);
						_g_free0 (uri);
						uri = _tmp24_;
						_g_free0 (_tmp23_);
					}
					_g_free0 (vala_name);
				}
			}
			if (uri != NULL) {
				GeditTab* _tmp25_ = NULL;
				GeditTab* _tmp26_;
				_tmp25_ = vtg_plugin_instance_activate_uri (self->priv->_plugin_instance, uri, line, col);
				_tmp26_ = _tmp25_;
				_g_object_unref0 (_tmp26_);
			} else {
				g_warning ("vtgbuildlogview.vala:331: Couldn't find uri for source: %s", name);
			}
			_g_free0 (uri);
		} else {
			vtg_plugin_instance_activate_display_name (self->priv->_plugin_instance, name, line, col);
		}
		_g_object_unref0 (proj);
		_g_free0 (name);
	}
}


void vtg_build_log_view_next_error (VtgBuildLogView* self) {
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_;
	GtkTreePath* _tmp2_ = NULL;
	GtkTreePath* _tmp3_;
	GtkTreePath* path;
	gint _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup_printf ("%i", self->priv->_current_error_row);
	_tmp1_ = _tmp0_;
	_tmp2_ = gtk_tree_path_new_from_string (_tmp1_);
	_tmp3_ = _tmp2_;
	_g_free0 (_tmp1_);
	path = _tmp3_;
	if (path != NULL) {
		GtkTreePath* _tmp4_ = NULL;
		GtkTreePath* _tmp5_;
		GtkTreePath* child_path;
		GtkTreeSelection* _tmp6_ = NULL;
		_tmp4_ = gtk_tree_model_filter_convert_path_to_child_path (self->priv->_model, path);
		_tmp5_ = _gtk_tree_path_copy0 (_tmp4_);
		child_path = _tmp5_;
		vtg_build_log_view_activate_path (self, child_path);
		gtk_tree_view_scroll_to_cell (self->priv->_build_view, path, NULL, FALSE, (gfloat) 0, (gfloat) 0);
		_tmp6_ = gtk_tree_view_get_selection (self->priv->_build_view);
		gtk_tree_selection_select_path (_tmp6_, path);
		_gtk_tree_path_free0 (child_path);
	}
	_tmp7_ = vtg_build_log_view_get_shown_messages (self);
	if (self->priv->_current_error_row < (_tmp7_ - 1)) {
		self->priv->_current_error_row++;
	} else {
		self->priv->_current_error_row = 0;
	}
	_gtk_tree_path_free0 (path);
}


void vtg_build_log_view_previous_error (VtgBuildLogView* self) {
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_;
	GtkTreePath* _tmp2_ = NULL;
	GtkTreePath* _tmp3_;
	GtkTreePath* path;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup_printf ("%i", self->priv->_current_error_row);
	_tmp1_ = _tmp0_;
	_tmp2_ = gtk_tree_path_new_from_string (_tmp1_);
	_tmp3_ = _tmp2_;
	_g_free0 (_tmp1_);
	path = _tmp3_;
	if (path != NULL) {
		GtkTreePath* _tmp4_ = NULL;
		GtkTreePath* _tmp5_;
		GtkTreePath* child_path;
		GtkTreeSelection* _tmp6_ = NULL;
		_tmp4_ = gtk_tree_model_filter_convert_path_to_child_path (self->priv->_model, path);
		_tmp5_ = _gtk_tree_path_copy0 (_tmp4_);
		child_path = _tmp5_;
		vtg_build_log_view_activate_path (self, child_path);
		gtk_tree_view_scroll_to_cell (self->priv->_build_view, path, NULL, FALSE, (gfloat) 0, (gfloat) 0);
		_tmp6_ = gtk_tree_view_get_selection (self->priv->_build_view);
		gtk_tree_selection_select_path (_tmp6_, path);
		_gtk_tree_path_free0 (child_path);
	}
	if (self->priv->_current_error_row > 0) {
		self->priv->_current_error_row--;
	} else {
		gint _tmp7_;
		_tmp7_ = vtg_build_log_view_get_shown_messages (self);
		self->priv->_current_error_row = _tmp7_ - 1;
	}
	_gtk_tree_path_free0 (path);
}


void vtg_build_log_view_clear_messages (VtgBuildLogView* self) {
	g_return_if_fail (self != NULL);
	gtk_list_store_clear (self->priv->_child_model);
}


static GtkTreeIter* _gtk_tree_iter_dup (GtkTreeIter* self) {
	GtkTreeIter* dup;
	dup = g_new0 (GtkTreeIter, 1);
	memcpy (dup, self, sizeof (GtkTreeIter));
	return dup;
}


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


void vtg_build_log_view_clear_messages_for_source (VtgBuildLogView* self, const gchar* filename) {
	GtkTreeIter iter = {0};
	GtkTreeIter _tmp0_ = {0};
	gboolean _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (filename != NULL);
	_tmp1_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) self->priv->_child_model, &_tmp0_);
	iter = _tmp0_;
	if (_tmp1_) {
		ValaArrayList* _tmp2_ = NULL;
		ValaList* to_del;
		gchar* _tmp3_ = NULL;
		gchar* basename;
		_tmp2_ = vala_array_list_new (GTK_TYPE_TREE_ITER, (GBoxedCopyFunc) _gtk_tree_iter_dup, g_free, g_direct_equal);
		to_del = (ValaList*) _tmp2_;
		_tmp3_ = g_path_get_basename (filename);
		basename = _tmp3_;
		{
			gboolean _tmp4_;
			_tmp4_ = TRUE;
			while (TRUE) {
				gchar* file = NULL;
				gboolean is_warning = FALSE;
				gboolean is_auto_build = FALSE;
				gboolean _tmp6_ = FALSE;
				if (!_tmp4_) {
					gboolean _tmp5_;
					_tmp5_ = gtk_tree_model_iter_next ((GtkTreeModel*) self->priv->_child_model, &iter);
					if (!_tmp5_) {
						break;
					}
				}
				_tmp4_ = FALSE;
				gtk_tree_model_get ((GtkTreeModel*) self->priv->_child_model, &iter, VTG_BUILD_LOG_VIEW_COLUMNS_FILENAME, &file, VTG_BUILD_LOG_VIEW_COLUMNS_IS_WARNING, &is_warning, VTG_BUILD_LOG_VIEW_COLUMNS_IS_AUTO_BUILD_MESSAGE, &is_auto_build, -1);
				if (is_auto_build) {
					_tmp6_ = g_strcmp0 (file, basename) == 0;
				} else {
					_tmp6_ = FALSE;
				}
				if (_tmp6_) {
					GtkTreeIter copy;
					copy = iter;
					vala_collection_add ((ValaCollection*) to_del, &copy);
					if (is_warning) {
						self->priv->_vala_warning_count--;
					} else {
						self->priv->_vala_error_count--;
					}
				}
				_g_free0 (file);
			}
		}
		{
			ValaList* _tmp7_;
			ValaList* _item_list;
			gint _tmp8_;
			gint _item_size;
			gint _item_index;
			_tmp7_ = _vala_iterable_ref0 (to_del);
			_item_list = _tmp7_;
			_tmp8_ = vala_collection_get_size ((ValaCollection*) _item_list);
			_item_size = _tmp8_;
			_item_index = -1;
			while (TRUE) {
				gpointer _tmp9_ = NULL;
				GtkTreeIter* _tmp10_;
				GtkTreeIter _tmp11_;
				GtkTreeIter item;
				_item_index = _item_index + 1;
				if (!(_item_index < _item_size)) {
					break;
				}
				_tmp9_ = vala_list_get (_item_list, _item_index);
				_tmp10_ = (GtkTreeIter*) _tmp9_;
				_tmp11_ = *_tmp10_;
				_g_free0 (_tmp10_);
				item = _tmp11_;
				gtk_list_store_remove (self->priv->_child_model, &item);
			}
			_vala_iterable_unref0 (_item_list);
		}
		vtg_build_log_view_update_toolbar_button_status (self);
		_g_free0 (basename);
		_vala_iterable_unref0 (to_del);
	}
}


void vtg_build_log_view_update_parse_result (VtgBuildLogView* self, const gchar* filename, AfroditeParseResult* parse_result) {
	g_return_if_fail (self != NULL);
	g_return_if_fail (filename != NULL);
	g_return_if_fail (parse_result != NULL);
	{
		ValaList* _tmp0_;
		ValaList* _message_list;
		gint _tmp1_;
		gint _message_size;
		gint _message_index;
		_tmp0_ = _vala_iterable_ref0 (parse_result->errors);
		_message_list = _tmp0_;
		_tmp1_ = vala_collection_get_size ((ValaCollection*) _message_list);
		_message_size = _tmp1_;
		_message_index = -1;
		while (TRUE) {
			gpointer _tmp2_ = NULL;
			gchar* message;
			_message_index = _message_index + 1;
			if (!(_message_index < _message_size)) {
				break;
			}
			_tmp2_ = vala_list_get (_message_list, _message_index);
			message = (gchar*) _tmp2_;
			vtg_build_log_view_add_message (self, VTG_OUTPUT_TYPES_AUTO_BUILD, message);
			_g_free0 (message);
		}
		_vala_iterable_unref0 (_message_list);
	}
	{
		ValaList* _tmp3_;
		ValaList* _message_list;
		gint _tmp4_;
		gint _message_size;
		gint _message_index;
		_tmp3_ = _vala_iterable_ref0 (parse_result->warnings);
		_message_list = _tmp3_;
		_tmp4_ = vala_collection_get_size ((ValaCollection*) _message_list);
		_message_size = _tmp4_;
		_message_index = -1;
		while (TRUE) {
			gpointer _tmp5_ = NULL;
			gchar* message;
			_message_index = _message_index + 1;
			if (!(_message_index < _message_size)) {
				break;
			}
			_tmp5_ = vala_list_get (_message_list, _message_index);
			message = (gchar*) _tmp5_;
			vtg_build_log_view_add_message (self, VTG_OUTPUT_TYPES_AUTO_BUILD, message);
			_g_free0 (message);
		}
		_vala_iterable_unref0 (_message_list);
	}
	vtg_build_log_view_update_toolbar_button_status (self);
}


static void vtg_build_log_view_add_message (VtgBuildLogView* self, VtgOutputTypes output_type, const gchar* message) {
	gboolean _tmp0_ = FALSE;
	gchar** _tmp1_;
	gchar** _tmp2_ = NULL;
	gchar** lines;
	gint lines_length1;
	gint _lines_size_;
	gint idx;
	g_return_if_fail (self != NULL);
	g_return_if_fail (message != NULL);
	if (output_type != VTG_OUTPUT_TYPES_BUILD) {
		_tmp0_ = output_type != VTG_OUTPUT_TYPES_AUTO_BUILD;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		return;
	}
	_tmp2_ = _tmp1_ = g_strsplit (message, "\n", 0);
	lines = _tmp2_;
	lines_length1 = _vala_array_length (_tmp1_);
	_lines_size_ = _vala_array_length (_tmp1_);
	idx = 0;
	while (TRUE) {
		gchar** _tmp3_;
		gchar** _tmp4_ = NULL;
		gchar** tmp;
		gint tmp_length1;
		gint _tmp_size_;
		gboolean _tmp5_ = FALSE;
		gboolean _tmp6_;
		if (!(lines[idx] != NULL)) {
			break;
		}
		_tmp4_ = _tmp3_ = g_strsplit (lines[idx], ":", 2);
		tmp = _tmp4_;
		tmp_length1 = _vala_array_length (_tmp3_);
		_tmp_size_ = _vala_array_length (_tmp3_);
		_tmp6_ = vtg_string_utils_is_null_or_empty (tmp[0]);
		if (!_tmp6_) {
			gboolean _tmp7_;
			_tmp7_ = vtg_string_utils_is_null_or_empty (tmp[1]);
			_tmp5_ = !_tmp7_;
		} else {
			_tmp5_ = FALSE;
		}
		if (_tmp5_) {
			gboolean _tmp8_ = FALSE;
			gboolean _tmp9_;
			_tmp9_ = g_str_has_suffix (tmp[0], ".vala");
			if (_tmp9_) {
				_tmp8_ = TRUE;
			} else {
				gboolean _tmp10_;
				_tmp10_ = g_str_has_suffix (tmp[0], ".vapi");
				_tmp8_ = _tmp10_;
			}
			if (_tmp8_) {
				vtg_build_log_view_add_vala_message (self, tmp[0], tmp[1], output_type == VTG_OUTPUT_TYPES_AUTO_BUILD);
			} else {
				gboolean _tmp11_ = FALSE;
				gboolean _tmp12_;
				_tmp12_ = g_str_has_suffix (tmp[0], ".c");
				if (_tmp12_) {
					_tmp11_ = TRUE;
				} else {
					gboolean _tmp13_;
					_tmp13_ = g_str_has_suffix (tmp[0], ".h");
					_tmp11_ = _tmp13_;
				}
				if (_tmp11_) {
					vtg_build_log_view_add_c_message (self, tmp[0], tmp[1], output_type == VTG_OUTPUT_TYPES_AUTO_BUILD);
				}
			}
		}
		idx++;
		tmp = (_vala_array_free (tmp, tmp_length1, (GDestroyNotify) g_free), NULL);
	}
	lines = (_vala_array_free (lines, lines_length1, (GDestroyNotify) g_free), NULL);
}


static void vtg_build_log_view_add_vala_message (VtgBuildLogView* self, const gchar* file, const gchar* message, gboolean is_auto_build_message) {
	gchar** _tmp0_;
	gchar** _tmp1_ = NULL;
	gchar** parts;
	gint parts_length1;
	gint _parts_size_;
	gchar** _tmp2_;
	gchar** _tmp3_ = NULL;
	gchar** _tmp4_;
	gint _tmp4__length1;
	gchar** _tmp5_;
	gchar** _tmp6_ = NULL;
	gchar** _tmp7_;
	gchar** src_ref;
	gint src_ref_length1;
	gint _src_ref_size_;
	gint _tmp8_;
	gint line;
	gint col;
	gchar* stock_id;
	g_return_if_fail (self != NULL);
	g_return_if_fail (file != NULL);
	g_return_if_fail (message != NULL);
	_tmp1_ = _tmp0_ = g_strsplit (message, ":", 3);
	parts = _tmp1_;
	parts_length1 = _vala_array_length (_tmp0_);
	_parts_size_ = _vala_array_length (_tmp0_);
	_tmp3_ = _tmp2_ = g_strsplit (parts[0], "-", 0);
	_tmp4_ = _tmp3_;
	_tmp4__length1 = _vala_array_length (_tmp2_);
	_tmp6_ = _tmp5_ = g_strsplit (_tmp4_[0], ".", 0);
	_tmp7_ = _tmp6_;
	_tmp4_ = (_vala_array_free (_tmp4_, _tmp4__length1, (GDestroyNotify) g_free), NULL);
	src_ref = _tmp7_;
	src_ref_length1 = _vala_array_length (_tmp5_);
	_src_ref_size_ = _vala_array_length (_tmp5_);
	if (src_ref_length1 < 2) {
		src_ref = (_vala_array_free (src_ref, src_ref_length1, (GDestroyNotify) g_free), NULL);
		parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
		return;
	}
	_tmp8_ = atoi (src_ref[0]);
	line = _tmp8_;
	col = 0;
	if (src_ref[1] != NULL) {
		gint _tmp9_;
		_tmp9_ = atoi (src_ref[1]);
		col = _tmp9_;
	}
	stock_id = NULL;
	if (parts[1] != NULL) {
		if (parts[2] != NULL) {
			gint is_warning;
			gboolean _tmp10_;
			GtkTreeIter iter = {0};
			GtkTreeIter _tmp14_ = {0};
			is_warning = 0;
			_tmp10_ = g_str_has_suffix (parts[1], "error");
			if (_tmp10_) {
				gchar* _tmp11_;
				_tmp11_ = g_strdup (GTK_STOCK_DIALOG_ERROR);
				_g_free0 (stock_id);
				stock_id = _tmp11_;
				self->priv->_vala_error_count++;
				is_warning = 0;
			} else {
				gboolean _tmp12_;
				_tmp12_ = g_str_has_suffix (parts[1], "warning");
				if (_tmp12_) {
					gchar* _tmp13_;
					_tmp13_ = g_strdup (GTK_STOCK_DIALOG_WARNING);
					_g_free0 (stock_id);
					stock_id = _tmp13_;
					self->priv->_vala_warning_count++;
					is_warning = 1;
				} else {
					self->priv->_vala_error_count++;
					is_warning = 0;
				}
			}
			gtk_list_store_append (self->priv->_child_model, &_tmp14_);
			iter = _tmp14_;
			gtk_list_store_set (self->priv->_child_model, &iter, VTG_BUILD_LOG_VIEW_COLUMNS_ICON, stock_id, VTG_BUILD_LOG_VIEW_COLUMNS_MESSAGE, parts[2], VTG_BUILD_LOG_VIEW_COLUMNS_FILENAME, file, VTG_BUILD_LOG_VIEW_COLUMNS_LINE, line, VTG_BUILD_LOG_VIEW_COLUMNS_COLUMN, col, VTG_BUILD_LOG_VIEW_COLUMNS_IS_WARNING, is_warning, VTG_BUILD_LOG_VIEW_COLUMNS_IS_VALA_SOURCE, TRUE, VTG_BUILD_LOG_VIEW_COLUMNS_IS_AUTO_BUILD_MESSAGE, is_auto_build_message, VTG_BUILD_LOG_VIEW_COLUMNS_PROJECT, self->priv->_project, -1);
			vtg_build_log_view_update_toolbar_button_status (self);
		}
	}
	_g_free0 (stock_id);
	src_ref = (_vala_array_free (src_ref, src_ref_length1, (GDestroyNotify) g_free), NULL);
	parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
}


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_chomp (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_strchomp (_result_);
	result = _result_;
	return result;
}


static void vtg_build_log_view_add_c_message (VtgBuildLogView* self, const gchar* file, const gchar* message, gboolean is_auto_build_message) {
	gchar** _tmp0_;
	gchar** _tmp1_ = NULL;
	gchar** parts;
	gint parts_length1;
	gint _parts_size_;
	gchar** _tmp2_;
	gchar** _tmp3_ = NULL;
	gchar** _tmp4_;
	gint _tmp4__length1;
	gchar** _tmp5_;
	gchar** _tmp6_ = NULL;
	gchar** _tmp7_;
	gchar** src_ref;
	gint src_ref_length1;
	gint _src_ref_size_;
	gint _tmp8_;
	gint line;
	gchar* stock_id;
	g_return_if_fail (self != NULL);
	g_return_if_fail (file != NULL);
	g_return_if_fail (message != NULL);
	_tmp1_ = _tmp0_ = g_strsplit (message, ":", 3);
	parts = _tmp1_;
	parts_length1 = _vala_array_length (_tmp0_);
	_parts_size_ = _vala_array_length (_tmp0_);
	_tmp3_ = _tmp2_ = g_strsplit (parts[0], "-", 0);
	_tmp4_ = _tmp3_;
	_tmp4__length1 = _vala_array_length (_tmp2_);
	_tmp6_ = _tmp5_ = g_strsplit (_tmp4_[0], ".", 0);
	_tmp7_ = _tmp6_;
	_tmp4_ = (_vala_array_free (_tmp4_, _tmp4__length1, (GDestroyNotify) g_free), NULL);
	src_ref = _tmp7_;
	src_ref_length1 = _vala_array_length (_tmp5_);
	_src_ref_size_ = _vala_array_length (_tmp5_);
	if (src_ref_length1 > 1) {
		src_ref = (_vala_array_free (src_ref, src_ref_length1, (GDestroyNotify) g_free), NULL);
		parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
		return;
	}
	_tmp8_ = atoi (src_ref[0]);
	line = _tmp8_;
	stock_id = NULL;
	if (parts[1] != NULL) {
		if (parts[2] != NULL) {
			gchar* message_type = NULL;
			gchar* message_text = NULL;
			gint is_warning;
			gint _tmp9_;
			gboolean _tmp16_;
			GtkTreeIter iter = {0};
			GtkTreeIter _tmp24_ = {0};
			is_warning = 0;
			_tmp9_ = atoi (parts[1]);
			if (_tmp9_ != 0) {
				gchar** _tmp10_;
				gchar** _tmp11_ = NULL;
				gchar** tmp;
				gint tmp_length1;
				gint _tmp_size_;
				gchar* _tmp12_ = NULL;
				gchar* _tmp13_;
				_tmp11_ = _tmp10_ = g_strsplit (parts[2], ":", 2);
				tmp = _tmp11_;
				tmp_length1 = _vala_array_length (_tmp10_);
				_tmp_size_ = _vala_array_length (_tmp10_);
				_tmp12_ = string_strip (tmp[0]);
				_g_free0 (message_type);
				message_type = _tmp12_;
				_tmp13_ = g_strdup (tmp[1]);
				_g_free0 (message_text);
				message_text = _tmp13_;
				tmp = (_vala_array_free (tmp, tmp_length1, (GDestroyNotify) g_free), NULL);
			} else {
				gchar* _tmp14_;
				gchar* _tmp15_;
				_tmp14_ = g_strdup (parts[1]);
				_g_free0 (message_type);
				message_type = _tmp14_;
				_tmp15_ = g_strdup (parts[2]);
				_g_free0 (message_text);
				message_text = _tmp15_;
			}
			_tmp16_ = g_str_has_suffix (message_type, "error");
			if (_tmp16_) {
				gchar* _tmp17_;
				_tmp17_ = g_strdup (GTK_STOCK_DIALOG_ERROR);
				_g_free0 (stock_id);
				stock_id = _tmp17_;
				self->priv->_c_error_count++;
				is_warning = 0;
			} else {
				gboolean _tmp18_;
				_tmp18_ = g_str_has_suffix (message_type, "warning");
				if (_tmp18_) {
					gchar* _tmp19_;
					_tmp19_ = g_strdup (GTK_STOCK_DIALOG_WARNING);
					_g_free0 (stock_id);
					stock_id = _tmp19_;
					self->priv->_c_warning_count++;
					is_warning = 1;
				} else {
					gchar* _tmp20_ = NULL;
					gchar* _tmp21_;
					gboolean _tmp22_;
					gboolean _tmp23_;
					_tmp20_ = string_chomp (message_type);
					_tmp21_ = _tmp20_;
					_tmp22_ = g_str_has_suffix (_tmp21_, "note");
					_tmp23_ = !_tmp22_;
					_g_free0 (_tmp21_);
					if (_tmp23_) {
						vtg_utils_trace ("vtgbuildlogview.vala:552: unrecognized message category, default to er" \
"ror for %s: '%s' ---> '%s' '%s' '%s'", file, message, parts[0], message_type, message_text);
						self->priv->_c_error_count++;
						is_warning = 0;
					} else {
						_g_free0 (message_text);
						_g_free0 (message_type);
						_g_free0 (stock_id);
						src_ref = (_vala_array_free (src_ref, src_ref_length1, (GDestroyNotify) g_free), NULL);
						parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
						return;
					}
				}
			}
			gtk_list_store_append (self->priv->_child_model, &_tmp24_);
			iter = _tmp24_;
			gtk_list_store_set (self->priv->_child_model, &iter, VTG_BUILD_LOG_VIEW_COLUMNS_ICON, stock_id, VTG_BUILD_LOG_VIEW_COLUMNS_MESSAGE, message_text, VTG_BUILD_LOG_VIEW_COLUMNS_FILENAME, file, VTG_BUILD_LOG_VIEW_COLUMNS_LINE, line, VTG_BUILD_LOG_VIEW_COLUMNS_COLUMN, 0, VTG_BUILD_LOG_VIEW_COLUMNS_IS_WARNING, is_warning, VTG_BUILD_LOG_VIEW_COLUMNS_IS_VALA_SOURCE, FALSE, VTG_BUILD_LOG_VIEW_COLUMNS_IS_AUTO_BUILD_MESSAGE, is_auto_build_message, VTG_BUILD_LOG_VIEW_COLUMNS_PROJECT, self->priv->_project, -1);
			vtg_build_log_view_update_toolbar_button_status (self);
			_g_free0 (message_text);
			_g_free0 (message_type);
		}
	}
	_g_free0 (stock_id);
	src_ref = (_vala_array_free (src_ref, src_ref_length1, (GDestroyNotify) g_free), NULL);
	parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
}


static void vtg_build_log_view_update_toolbar_button_status (VtgBuildLogView* self) {
	g_return_if_fail (self != NULL);
	if (self->priv->_vala_warning_count == 0) {
		const gchar* _tmp0_ = NULL;
		_tmp0_ = _ ("Warnings");
		gtk_tool_button_set_label ((GtkToolButton*) self->priv->_vala_warning_button, _tmp0_);
		gtk_widget_set_sensitive ((GtkWidget*) self->priv->_vala_warning_button, FALSE);
	} else {
		const gchar* _tmp1_ = NULL;
		gchar* _tmp2_ = NULL;
		gchar* _tmp3_;
		_tmp1_ = _ ("Warnings");
		_tmp2_ = g_strdup_printf ("%s (%d)", _tmp1_, self->priv->_vala_warning_count);
		_tmp3_ = _tmp2_;
		gtk_tool_button_set_label ((GtkToolButton*) self->priv->_vala_warning_button, _tmp3_);
		_g_free0 (_tmp3_);
		gtk_widget_set_sensitive ((GtkWidget*) self->priv->_vala_warning_button, TRUE);
	}
	if (self->priv->_vala_error_count == 0) {
		const gchar* _tmp4_ = NULL;
		_tmp4_ = _ ("Errors");
		gtk_tool_button_set_label ((GtkToolButton*) self->priv->_vala_error_button, _tmp4_);
		gtk_widget_set_sensitive ((GtkWidget*) self->priv->_vala_error_button, FALSE);
	} else {
		const gchar* _tmp5_ = NULL;
		gchar* _tmp6_ = NULL;
		gchar* _tmp7_;
		_tmp5_ = _ ("Errors");
		_tmp6_ = g_strdup_printf ("%s (%d)", _tmp5_, self->priv->_vala_error_count);
		_tmp7_ = _tmp6_;
		gtk_tool_button_set_label ((GtkToolButton*) self->priv->_vala_error_button, _tmp7_);
		_g_free0 (_tmp7_);
		gtk_widget_set_sensitive ((GtkWidget*) self->priv->_vala_error_button, TRUE);
	}
	if (self->priv->_c_warning_count == 0) {
		const gchar* _tmp8_ = NULL;
		_tmp8_ = _ ("C Warnings");
		gtk_tool_button_set_label ((GtkToolButton*) self->priv->_c_warning_button, _tmp8_);
		gtk_widget_set_sensitive ((GtkWidget*) self->priv->_c_warning_button, FALSE);
	} else {
		const gchar* _tmp9_ = NULL;
		gchar* _tmp10_ = NULL;
		gchar* _tmp11_;
		_tmp9_ = _ ("C Warnings");
		_tmp10_ = g_strdup_printf ("%s (%d)", _tmp9_, self->priv->_c_warning_count);
		_tmp11_ = _tmp10_;
		gtk_tool_button_set_label ((GtkToolButton*) self->priv->_c_warning_button, _tmp11_);
		_g_free0 (_tmp11_);
		gtk_widget_set_sensitive ((GtkWidget*) self->priv->_c_warning_button, TRUE);
	}
	if (self->priv->_c_error_count == 0) {
		const gchar* _tmp12_ = NULL;
		_tmp12_ = _ ("C Errors");
		gtk_tool_button_set_label ((GtkToolButton*) self->priv->_c_error_button, _tmp12_);
		gtk_widget_set_sensitive ((GtkWidget*) self->priv->_c_error_button, FALSE);
	} else {
		const gchar* _tmp13_ = NULL;
		gchar* _tmp14_ = NULL;
		gchar* _tmp15_;
		_tmp13_ = _ ("C Errors");
		_tmp14_ = g_strdup_printf ("%s (%d)", _tmp13_, self->priv->_c_error_count);
		_tmp15_ = _tmp14_;
		gtk_tool_button_set_label ((GtkToolButton*) self->priv->_c_error_button, _tmp15_);
		_g_free0 (_tmp15_);
		gtk_widget_set_sensitive ((GtkWidget*) self->priv->_c_error_button, TRUE);
	}
}


static gboolean vtg_build_log_view_filter_model (VtgBuildLogView* self, GtkTreeModel* model, GtkTreeIter* iter) {
	gboolean result = FALSE;
	gboolean is_vala_source = FALSE;
	gint val = 0;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (model != NULL, FALSE);
	gtk_tree_model_get (model, iter, VTG_BUILD_LOG_VIEW_COLUMNS_IS_VALA_SOURCE, &is_vala_source, VTG_BUILD_LOG_VIEW_COLUMNS_IS_WARNING, &val, -1);
	if (is_vala_source) {
		gboolean _tmp0_ = FALSE;
		gboolean _tmp1_ = FALSE;
		if (self->priv->_show_vala_warnings) {
			_tmp0_ = self->priv->_show_vala_errors;
		} else {
			_tmp0_ = FALSE;
		}
		if (_tmp0_) {
			result = TRUE;
			return result;
		}
		if (val == 0) {
			_tmp1_ = self->priv->_show_vala_errors;
		} else {
			_tmp1_ = FALSE;
		}
		if (_tmp1_) {
			result = TRUE;
			return result;
		} else {
			gboolean _tmp2_ = FALSE;
			if (val == 1) {
				_tmp2_ = self->priv->_show_vala_warnings;
			} else {
				_tmp2_ = FALSE;
			}
			if (_tmp2_) {
				result = TRUE;
				return result;
			}
		}
	} else {
		gboolean _tmp3_ = FALSE;
		gboolean _tmp4_ = FALSE;
		if (self->priv->_show_c_warnings) {
			_tmp3_ = self->priv->_show_c_errors;
		} else {
			_tmp3_ = FALSE;
		}
		if (_tmp3_) {
			result = TRUE;
			return result;
		}
		if (val == 0) {
			_tmp4_ = self->priv->_show_c_errors;
		} else {
			_tmp4_ = FALSE;
		}
		if (_tmp4_) {
			result = TRUE;
			return result;
		} else {
			gboolean _tmp5_ = FALSE;
			if (val == 1) {
				_tmp5_ = self->priv->_show_c_warnings;
			} else {
				_tmp5_ = FALSE;
			}
			if (_tmp5_) {
				result = TRUE;
				return result;
			}
		}
	}
	result = FALSE;
	return result;
}


gint vtg_build_log_view_get_error_count (VtgBuildLogView* self) {
	gint result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_vala_error_count + self->priv->_c_error_count;
	return result;
}


gint vtg_build_log_view_get_warning_count (VtgBuildLogView* self) {
	gint result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_vala_warning_count + self->priv->_c_warning_count;
	return result;
}


static gint vtg_build_log_view_get_shown_messages (VtgBuildLogView* self) {
	gint result;
	gint count;
	g_return_val_if_fail (self != NULL, 0);
	count = 0;
	if (self->priv->_show_vala_warnings) {
		count = count + self->priv->_vala_warning_count;
	}
	if (self->priv->_show_vala_errors) {
		count = count + self->priv->_vala_error_count;
	}
	if (self->priv->_show_c_warnings) {
		count = count + self->priv->_c_warning_count;
	}
	if (self->priv->_show_c_errors) {
		count = count + self->priv->_c_error_count;
	}
	result = count;
	return result;
}


static void vtg_build_log_view_class_init (VtgBuildLogViewClass * klass) {
	vtg_build_log_view_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (VtgBuildLogViewPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_vtg_build_log_view_get_property;
	G_OBJECT_CLASS (klass)->finalize = vtg_build_log_view_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), VTG_BUILD_LOG_VIEW_ERROR_COUNT, g_param_spec_int ("error-count", "error-count", "error-count", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), VTG_BUILD_LOG_VIEW_WARNING_COUNT, g_param_spec_int ("warning-count", "warning-count", "warning-count", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
}


static void vtg_build_log_view_instance_init (VtgBuildLogView * self) {
	self->priv = VTG_BUILD_LOG_VIEW_GET_PRIVATE (self);
	self->priv->_child_model = NULL;
	self->priv->_build_view = NULL;
	self->priv->_current_error_row = 0;
	self->priv->_vala_error_count = 0;
	self->priv->_vala_warning_count = 0;
	self->priv->_c_error_count = 0;
	self->priv->_c_warning_count = 0;
	self->priv->_plugin_instance = NULL;
	self->priv->_show_vala_warnings = TRUE;
	self->priv->_show_vala_errors = TRUE;
	self->priv->_show_c_warnings = FALSE;
	self->priv->_show_c_errors = TRUE;
	self->priv->_vala_warning_button = NULL;
	self->priv->_vala_error_button = NULL;
	self->priv->_c_warning_button = NULL;
	self->priv->_c_error_button = NULL;
}


static void vtg_build_log_view_finalize (GObject* obj) {
	VtgBuildLogView * self;
	self = VTG_BUILD_LOG_VIEW (obj);
	vtg_utils_trace ("vtgbuildlogview.vala:209: BuildLogView destroying");
	vtg_utils_trace ("vtgbuildlogview.vala:210: BuildLogView destroyed");
	_g_object_unref0 (self->priv->_ui);
	_g_object_unref0 (self->priv->_child_model);
	_g_object_unref0 (self->priv->_build_view);
	_g_object_unref0 (self->priv->_vala_warning_button);
	_g_object_unref0 (self->priv->_vala_error_button);
	_g_object_unref0 (self->priv->_c_warning_button);
	_g_object_unref0 (self->priv->_c_error_button);
	G_OBJECT_CLASS (vtg_build_log_view_parent_class)->finalize (obj);
}


GType vtg_build_log_view_get_type (void) {
	return vtg_build_log_view_type_id;
}


GType vtg_build_log_view_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (VtgBuildLogViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vtg_build_log_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (VtgBuildLogView), 0, (GInstanceInitFunc) vtg_build_log_view_instance_init, NULL };
	vtg_build_log_view_type_id = g_type_module_register_type (module, G_TYPE_OBJECT, "VtgBuildLogView", &g_define_type_info, 0);
	return vtg_build_log_view_type_id;
}


static void _vala_vtg_build_log_view_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	VtgBuildLogView * self;
	self = VTG_BUILD_LOG_VIEW (object);
	switch (property_id) {
		case VTG_BUILD_LOG_VIEW_ERROR_COUNT:
		g_value_set_int (value, vtg_build_log_view_get_error_count (self));
		break;
		case VTG_BUILD_LOG_VIEW_WARNING_COUNT:
		g_value_set_int (value, vtg_build_log_view_get_warning_count (self));
		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;
}



