/* structure.c generated by valac 0.26.0.33-c448, the Vala compiler
 * generated from structure.vala, do not modify */

/*
 * This file is part of LaTeXila.
 *
 * Copyright © 2011-2012 Sébastien Wilmet
 *
 * LaTeXila 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.
 *
 * LaTeXila 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 LaTeXila.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <gtksourceview/gtksource.h>
#include <glib/gi18n-lib.h>
#include <gio/gio.h>
#include <gdk/gdk.h>
#include <float.h>
#include <math.h>
#include <gee.h>
#include <latexila.h>


#define TYPE_STRUCT_TYPE (struct_type_get_type ())

#define TYPE_STRUCT_ACTION (struct_action_get_type ())

#define TYPE_STRUCTURE (structure_get_type ())
#define STRUCTURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_STRUCTURE, Structure))
#define STRUCTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_STRUCTURE, StructureClass))
#define IS_STRUCTURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_STRUCTURE))
#define IS_STRUCTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_STRUCTURE))
#define STRUCTURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_STRUCTURE, StructureClass))

typedef struct _Structure Structure;
typedef struct _StructureClass StructureClass;
typedef struct _StructurePrivate StructurePrivate;

#define TYPE_MAIN_WINDOW (main_window_get_type ())
#define MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAIN_WINDOW, MainWindow))
#define MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAIN_WINDOW, MainWindowClass))
#define IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAIN_WINDOW))
#define IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAIN_WINDOW))
#define MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAIN_WINDOW, MainWindowClass))

typedef struct _MainWindow MainWindow;
typedef struct _MainWindowClass MainWindowClass;

#define TYPE_DOCUMENT_STRUCTURE (document_structure_get_type ())
#define DOCUMENT_STRUCTURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DOCUMENT_STRUCTURE, DocumentStructure))
#define DOCUMENT_STRUCTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DOCUMENT_STRUCTURE, DocumentStructureClass))
#define IS_DOCUMENT_STRUCTURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DOCUMENT_STRUCTURE))
#define IS_DOCUMENT_STRUCTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DOCUMENT_STRUCTURE))
#define DOCUMENT_STRUCTURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DOCUMENT_STRUCTURE, DocumentStructureClass))

typedef struct _DocumentStructure DocumentStructure;
typedef struct _DocumentStructureClass DocumentStructureClass;

#define TYPE_STRUCTURE_MODEL (structure_model_get_type ())
#define STRUCTURE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_STRUCTURE_MODEL, StructureModel))
#define STRUCTURE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_STRUCTURE_MODEL, StructureModelClass))
#define IS_STRUCTURE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_STRUCTURE_MODEL))
#define IS_STRUCTURE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_STRUCTURE_MODEL))
#define STRUCTURE_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_STRUCTURE_MODEL, StructureModelClass))

typedef struct _StructureModel StructureModel;
typedef struct _StructureModelClass StructureModelClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define TYPE_DOCUMENT (document_get_type ())
#define DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DOCUMENT, Document))
#define DOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DOCUMENT, DocumentClass))
#define IS_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DOCUMENT))
#define IS_DOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DOCUMENT))
#define DOCUMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DOCUMENT, DocumentClass))

typedef struct _Document Document;
typedef struct _DocumentClass DocumentClass;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block30Data Block30Data;
#define __g_list_free__gtk_tree_path_free0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__gtk_tree_path_free0_ (var), NULL)))
#define _gtk_tree_path_free0(var) ((var == NULL) ? NULL : (var = (gtk_tree_path_free (var), NULL)))

#define TYPE_STRUCT_LIST_COLUMN (struct_list_column_get_type ())

#define TYPE_STRUCT_COLUMN (struct_column_get_type ())

#define TYPE_DOCUMENT_VIEW (document_view_get_type ())
#define DOCUMENT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DOCUMENT_VIEW, DocumentView))
#define DOCUMENT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DOCUMENT_VIEW, DocumentViewClass))
#define IS_DOCUMENT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DOCUMENT_VIEW))
#define IS_DOCUMENT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DOCUMENT_VIEW))
#define DOCUMENT_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DOCUMENT_VIEW, DocumentViewClass))

typedef struct _DocumentView DocumentView;
typedef struct _DocumentViewClass DocumentViewClass;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define TYPE_DOCUMENT_TAB (document_tab_get_type ())
#define DOCUMENT_TAB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DOCUMENT_TAB, DocumentTab))
#define DOCUMENT_TAB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DOCUMENT_TAB, DocumentTabClass))
#define IS_DOCUMENT_TAB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DOCUMENT_TAB))
#define IS_DOCUMENT_TAB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DOCUMENT_TAB))
#define DOCUMENT_TAB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DOCUMENT_TAB, DocumentTabClass))

typedef struct _DocumentTab DocumentTab;
typedef struct _DocumentTabClass DocumentTabClass;

typedef enum  {
	STRUCT_TYPE_BEGIN_COMMON_TYPES,
	STRUCT_TYPE_PART,
	STRUCT_TYPE_CHAPTER,
	STRUCT_TYPE_SECTION,
	STRUCT_TYPE_SUBSECTION,
	STRUCT_TYPE_SUBSUBSECTION,
	STRUCT_TYPE_PARAGRAPH,
	STRUCT_TYPE_SUBPARAGRAPH,
	STRUCT_TYPE_LABEL,
	STRUCT_TYPE_INCLUDE,
	STRUCT_TYPE_IMAGE,
	STRUCT_TYPE_TODO,
	STRUCT_TYPE_FIXME,
	STRUCT_TYPE_END_COMMON_TYPES,
	STRUCT_TYPE_BEGIN_LOW_LEVEL_TYPES,
	STRUCT_TYPE_BEGIN_FIGURE,
	STRUCT_TYPE_END_FIGURE,
	STRUCT_TYPE_BEGIN_TABLE,
	STRUCT_TYPE_END_TABLE,
	STRUCT_TYPE_BEGIN_VERBATIM,
	STRUCT_TYPE_END_VERBATIM,
	STRUCT_TYPE_END_DOCUMENT,
	STRUCT_TYPE_CAPTION,
	STRUCT_TYPE_END_LOW_LEVEL_TYPES,
	STRUCT_TYPE_BEGIN_HIGH_LEVEL_TYPES,
	STRUCT_TYPE_TABLE,
	STRUCT_TYPE_FIGURE,
	STRUCT_TYPE_END_HIGH_LEVEL_TYPES,
	STRUCT_TYPE_NB_TYPES
} StructType;

typedef enum  {
	STRUCT_ACTION_CUT,
	STRUCT_ACTION_COPY,
	STRUCT_ACTION_DELETE,
	STRUCT_ACTION_SELECT,
	STRUCT_ACTION_COMMENT,
	STRUCT_ACTION_SHIFT_LEFT,
	STRUCT_ACTION_SHIFT_RIGHT,
	STRUCT_ACTION_OPEN_FILE,
	STRUCT_ACTION_NB_ACTIONS
} StructAction;

struct _Structure {
	GtkGrid parent_instance;
	StructurePrivate * priv;
};

struct _StructureClass {
	GtkGridClass parent_class;
};

struct _StructurePrivate {
	MainWindow* _main_window;
	GtkToggleToolButton** _simple_list_buttons;
	gint _simple_list_buttons_length1;
	gint __simple_list_buttons_size_;
	GtkPaned* _vpaned;
	GtkTreeView* _tree_view;
	DocumentStructure* _document_structure;
	StructureModel* _model;
	GtkTreeView* _list_view;
	GtkScrolledWindow* _list_view_sw;
	GtkListStore* _list_store;
	StructType _current_list_type;
	gboolean _list_is_hidden;
	gboolean _first_select;
};

struct _Block30Data {
	int _ref_count_;
	Structure* self;
	GtkToggleToolButton* button;
	StructType type;
};

typedef enum  {
	STRUCT_LIST_COLUMN_PIXBUF,
	STRUCT_LIST_COLUMN_TEXT,
	STRUCT_LIST_COLUMN_TOOLTIP,
	STRUCT_LIST_COLUMN_N_COLUMNS
} StructListColumn;

typedef enum  {
	STRUCT_COLUMN_PIXBUF,
	STRUCT_COLUMN_TEXT,
	STRUCT_COLUMN_TOOLTIP,
	STRUCT_COLUMN_START_MARK,
	STRUCT_COLUMN_END_MARK,
	STRUCT_COLUMN_TYPE,
	STRUCT_COLUMN_N_COLUMNS
} StructColumn;

typedef enum  {
	STRUCT_ERROR_GENERAL,
	STRUCT_ERROR_DATA_OUTDATED
} StructError;
#define STRUCT_ERROR struct_error_quark ()

static gpointer structure_parent_class = NULL;
static gchar** structure__icons;
static gint structure__icons_length1;
static gchar** structure__icons = NULL;
static gint structure__icons_length1 = 0;
static gint _structure__icons_size_ = 0;
static gchar** structure__names;
static gint structure__names_length1;
static gchar** structure__names = NULL;
static gint structure__names_length1 = 0;
static gint _structure__names_size_ = 0;
static gchar** structure__action_names;
static gint structure__action_names_length1;
static gchar** structure__action_names = NULL;
static gint structure__action_names_length1 = 0;
static gint _structure__action_names_size_ = 0;

GType struct_type_get_type (void) G_GNUC_CONST;
GType struct_action_get_type (void) G_GNUC_CONST;
GType structure_get_type (void) G_GNUC_CONST;
GType main_window_get_type (void) G_GNUC_CONST;
GType document_structure_get_type (void) G_GNUC_CONST;
GType structure_model_get_type (void) G_GNUC_CONST;
#define STRUCTURE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_STRUCTURE, StructurePrivate))
enum  {
	STRUCTURE_DUMMY_PROPERTY
};
Structure* structure_new (MainWindow* main_window);
Structure* structure_construct (GType object_type, MainWindow* main_window);
static void structure_init_toolbar (Structure* self);
static void structure_init_vpaned (Structure* self);
static void structure_init_list_view (Structure* self);
static void structure_init_tree_view (Structure* self);
void structure_connect_parsing (Structure* self);
static void _structure_connect_parsing_gtk_widget_show (GtkWidget* _sender, gpointer self);
void structure_disconnect_parsing (Structure* self);
static void _structure_disconnect_parsing_gtk_widget_hide (GtkWidget* _sender, gpointer self);
void structure_refresh (Structure* self);
GType document_get_type (void) G_GNUC_CONST;
static void structure_show_document (Structure* self, Document* doc, gboolean force_parse);
Document* main_window_get_active_document (MainWindow* self);
static GtkToolButton* structure_get_refresh_button (Structure* self);
static GtkToolButton* structure_get_collapse_all_button (Structure* self);
static void structure_init_simple_list_buttons (Structure* self);
static void __lambda5_ (Structure* self);
static void ___lambda5__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self);
static void __lambda7_ (Structure* self);
static void ___lambda7__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self);
static GtkToggleToolButton* structure_create_simple_list_button (Structure* self, StructType type, const gchar* tooltip);
static Block30Data* block30_data_ref (Block30Data* _data30_);
static void block30_data_unref (void * _userdata_);
gchar* structure_get_icon_from_type (StructType type);
static void _vala_array_add10 (GtkToggleToolButton*** array, int* length, int* size, GtkToggleToolButton* value);
static void __lambda8_ (Block30Data* _data30_);
static void structure_populate_simple_list (Structure* self);
static void ___lambda8__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self);
void structure_model_populate_list (StructureModel* self, GtkListStore* store, StructType type);
static void _gtk_tree_path_free0_ (gpointer var);
static void _g_list_free__gtk_tree_path_free0_ (GList* self);
static void structure_select_simple_list_item (Structure* self, GtkTreeIter* tree_iter);
void structure_save_state (Structure* self);
static GtkTreeView* structure_get_new_tree_view (Structure* self, gint pixbuf_col, gint text_col, gint tooltip_col);
GType struct_list_column_get_type (void) G_GNUC_CONST;
static gboolean __lambda9_ (Structure* self, GtkTreeSelection* select, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected);
static gboolean structure_select_list_row (Structure* self, GtkTreePath* list_path);
static gboolean ___lambda9__gtk_tree_selection_func (GtkTreeSelection* selection, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected, gpointer self);
static void __lambda10_ (Structure* self, GtkTreePath* path);
static void ___lambda10__gtk_tree_view_row_activated (GtkTreeView* _sender, GtkTreePath* path, GtkTreeViewColumn* column, gpointer self);
GtkScrolledWindow* utils_add_scrollbar (GtkWidget* child);
GType struct_column_get_type (void) G_GNUC_CONST;
static gboolean __lambda11_ (Structure* self, GtkTreeSelection* select, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected);
static gboolean structure_select_tree_row (Structure* self, GtkTreePath* tree_path);
static gboolean ___lambda11__gtk_tree_selection_func (GtkTreeSelection* selection, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected, gpointer self);
static void __lambda12_ (Structure* self, GtkTreePath* path);
static void ___lambda12__gtk_tree_view_row_activated (GtkTreeView* _sender, GtkTreePath* path, GtkTreeViewColumn* column, gpointer self);
static gboolean __lambda13_ (Structure* self, GdkEventButton* event);
static gboolean ___lambda13__gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self);
static gboolean __lambda14_ (Structure* self);
static gboolean ___lambda14__gtk_widget_popup_menu (GtkWidget* _sender, gpointer self);
GtkTreePath* structure_model_get_tree_path_from_list_num (StructureModel* self, StructType list_type, gint num);
GType document_view_get_type (void) G_GNUC_CONST;
DocumentView* main_window_get_active_view (MainWindow* self);
static GeeArrayList* structure_get_simple_list_types (Structure* self, StructType type);
gint structure_model_get_list_num_from_tree_iter (StructureModel* self, GtkTreeIter* tree_iter);
gboolean structure_is_section (StructType type);
static void structure_show_active_document (Structure* self);
static void structure_set_model (Structure* self, StructureModel* model);
static void structure_on_parsing_done (Structure* self);
static void _structure_on_parsing_done_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
DocumentStructure* document_get_structure (Document* self);
void document_structure_parse (DocumentStructure* self);
gboolean document_structure_get_parsing_done (DocumentStructure* self);
StructureModel* document_structure_get_model (DocumentStructure* self);
void structure_model_set_emit_signals (StructureModel* self, gboolean value);
guint structure_model_get_nb_items (StructureModel* self);
static void _structure_show_active_document_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
gboolean structure_is_common_type (StructType type);
void structure_do_action (Structure* self, StructAction action_type);
gint utils_get_selected_row (GtkTreeView* view, GtkTreeIter* iter);
static void structure_open_referenced_file (Structure* self, GtkTreeIter* iter);
GQuark struct_error_quark (void);
void document_structure_do_action (DocumentStructure* self, StructAction action_type, GtkTreeIter* tree_iter, gboolean* refresh_simple_list, GError** error);
static gchar* structure_get_action_name (StructAction action_type);
GFile* document_get_location (Document* self);
static void structure_open_included_file (Structure* self, GFile* referenced_file);
static void structure_open_image (Structure* self, GFile* referenced_file);
GType document_tab_get_type (void) G_GNUC_CONST;
DocumentTab* main_window_open_document (MainWindow* self, GFile* location, gboolean jump_to);
gchar* structure_get_type_name (StructType type);
static void g_cclosure_user_marshal_VOID__BOXED (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
static void structure_finalize (GObject* obj);
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);


GType struct_type_get_type (void) {
	static volatile gsize struct_type_type_id__volatile = 0;
	if (g_once_init_enter (&struct_type_type_id__volatile)) {
		static const GEnumValue values[] = {{STRUCT_TYPE_BEGIN_COMMON_TYPES, "STRUCT_TYPE_BEGIN_COMMON_TYPES", "begin-common-types"}, {STRUCT_TYPE_PART, "STRUCT_TYPE_PART", "part"}, {STRUCT_TYPE_CHAPTER, "STRUCT_TYPE_CHAPTER", "chapter"}, {STRUCT_TYPE_SECTION, "STRUCT_TYPE_SECTION", "section"}, {STRUCT_TYPE_SUBSECTION, "STRUCT_TYPE_SUBSECTION", "subsection"}, {STRUCT_TYPE_SUBSUBSECTION, "STRUCT_TYPE_SUBSUBSECTION", "subsubsection"}, {STRUCT_TYPE_PARAGRAPH, "STRUCT_TYPE_PARAGRAPH", "paragraph"}, {STRUCT_TYPE_SUBPARAGRAPH, "STRUCT_TYPE_SUBPARAGRAPH", "subparagraph"}, {STRUCT_TYPE_LABEL, "STRUCT_TYPE_LABEL", "label"}, {STRUCT_TYPE_INCLUDE, "STRUCT_TYPE_INCLUDE", "include"}, {STRUCT_TYPE_IMAGE, "STRUCT_TYPE_IMAGE", "image"}, {STRUCT_TYPE_TODO, "STRUCT_TYPE_TODO", "todo"}, {STRUCT_TYPE_FIXME, "STRUCT_TYPE_FIXME", "fixme"}, {STRUCT_TYPE_END_COMMON_TYPES, "STRUCT_TYPE_END_COMMON_TYPES", "end-common-types"}, {STRUCT_TYPE_BEGIN_LOW_LEVEL_TYPES, "STRUCT_TYPE_BEGIN_LOW_LEVEL_TYPES", "begin-low-level-types"}, {STRUCT_TYPE_BEGIN_FIGURE, "STRUCT_TYPE_BEGIN_FIGURE", "begin-figure"}, {STRUCT_TYPE_END_FIGURE, "STRUCT_TYPE_END_FIGURE", "end-figure"}, {STRUCT_TYPE_BEGIN_TABLE, "STRUCT_TYPE_BEGIN_TABLE", "begin-table"}, {STRUCT_TYPE_END_TABLE, "STRUCT_TYPE_END_TABLE", "end-table"}, {STRUCT_TYPE_BEGIN_VERBATIM, "STRUCT_TYPE_BEGIN_VERBATIM", "begin-verbatim"}, {STRUCT_TYPE_END_VERBATIM, "STRUCT_TYPE_END_VERBATIM", "end-verbatim"}, {STRUCT_TYPE_END_DOCUMENT, "STRUCT_TYPE_END_DOCUMENT", "end-document"}, {STRUCT_TYPE_CAPTION, "STRUCT_TYPE_CAPTION", "caption"}, {STRUCT_TYPE_END_LOW_LEVEL_TYPES, "STRUCT_TYPE_END_LOW_LEVEL_TYPES", "end-low-level-types"}, {STRUCT_TYPE_BEGIN_HIGH_LEVEL_TYPES, "STRUCT_TYPE_BEGIN_HIGH_LEVEL_TYPES", "begin-high-level-types"}, {STRUCT_TYPE_TABLE, "STRUCT_TYPE_TABLE", "table"}, {STRUCT_TYPE_FIGURE, "STRUCT_TYPE_FIGURE", "figure"}, {STRUCT_TYPE_END_HIGH_LEVEL_TYPES, "STRUCT_TYPE_END_HIGH_LEVEL_TYPES", "end-high-level-types"}, {STRUCT_TYPE_NB_TYPES, "STRUCT_TYPE_NB_TYPES", "nb-types"}, {0, NULL, NULL}};
		GType struct_type_type_id;
		struct_type_type_id = g_enum_register_static ("StructType", values);
		g_once_init_leave (&struct_type_type_id__volatile, struct_type_type_id);
	}
	return struct_type_type_id__volatile;
}


GType struct_action_get_type (void) {
	static volatile gsize struct_action_type_id__volatile = 0;
	if (g_once_init_enter (&struct_action_type_id__volatile)) {
		static const GEnumValue values[] = {{STRUCT_ACTION_CUT, "STRUCT_ACTION_CUT", "cut"}, {STRUCT_ACTION_COPY, "STRUCT_ACTION_COPY", "copy"}, {STRUCT_ACTION_DELETE, "STRUCT_ACTION_DELETE", "delete"}, {STRUCT_ACTION_SELECT, "STRUCT_ACTION_SELECT", "select"}, {STRUCT_ACTION_COMMENT, "STRUCT_ACTION_COMMENT", "comment"}, {STRUCT_ACTION_SHIFT_LEFT, "STRUCT_ACTION_SHIFT_LEFT", "shift-left"}, {STRUCT_ACTION_SHIFT_RIGHT, "STRUCT_ACTION_SHIFT_RIGHT", "shift-right"}, {STRUCT_ACTION_OPEN_FILE, "STRUCT_ACTION_OPEN_FILE", "open-file"}, {STRUCT_ACTION_NB_ACTIONS, "STRUCT_ACTION_NB_ACTIONS", "nb-actions"}, {0, NULL, NULL}};
		GType struct_action_type_id;
		struct_action_type_id = g_enum_register_static ("StructAction", values);
		g_once_init_leave (&struct_action_type_id__volatile, struct_action_type_id);
	}
	return struct_action_type_id__volatile;
}


static void _structure_connect_parsing_gtk_widget_show (GtkWidget* _sender, gpointer self) {
	structure_connect_parsing ((Structure*) self);
}


static void _structure_disconnect_parsing_gtk_widget_hide (GtkWidget* _sender, gpointer self) {
	structure_disconnect_parsing ((Structure*) self);
}


Structure* structure_construct (GType object_type, MainWindow* main_window) {
	Structure * self = NULL;
	MainWindow* _tmp0_ = NULL;
	GtkScrolledWindow* _tmp1_ = NULL;
	g_return_val_if_fail (main_window != NULL, NULL);
	self = (Structure*) g_object_new (object_type, NULL);
	gtk_orientable_set_orientation ((GtkOrientable*) self, GTK_ORIENTATION_VERTICAL);
	_tmp0_ = main_window;
	self->priv->_main_window = _tmp0_;
	structure_init_toolbar (self);
	structure_init_vpaned (self);
	structure_init_list_view (self);
	structure_init_tree_view (self);
	gtk_widget_show_all ((GtkWidget*) self);
	_tmp1_ = self->priv->_list_view_sw;
	gtk_widget_hide ((GtkWidget*) _tmp1_);
	g_signal_connect_object ((GtkWidget*) self, "show", (GCallback) _structure_connect_parsing_gtk_widget_show, self, 0);
	g_signal_connect_object ((GtkWidget*) self, "hide", (GCallback) _structure_disconnect_parsing_gtk_widget_hide, self, 0);
	return self;
}


Structure* structure_new (MainWindow* main_window) {
	return structure_construct (TYPE_STRUCTURE, main_window);
}


void structure_refresh (Structure* self) {
	MainWindow* _tmp0_ = NULL;
	Document* _tmp1_ = NULL;
	Document* _tmp2_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_main_window;
	_tmp1_ = main_window_get_active_document (_tmp0_);
	_tmp2_ = _tmp1_;
	structure_show_document (self, _tmp2_, TRUE);
}


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


static void structure_init_toolbar (Structure* self) {
	GtkToolbar* toolbar = NULL;
	GtkToolbar* _tmp0_ = NULL;
	GtkToolbar* _tmp1_ = NULL;
	GtkToolbar* _tmp2_ = NULL;
	GtkToolbar* _tmp3_ = NULL;
	GtkToolbar* _tmp4_ = NULL;
	GtkToolButton* _tmp5_ = NULL;
	GtkToolButton* _tmp6_ = NULL;
	GtkToolbar* _tmp7_ = NULL;
	GtkToolButton* _tmp8_ = NULL;
	GtkToolButton* _tmp9_ = NULL;
	GtkToolbar* _tmp10_ = NULL;
	GtkSeparatorToolItem* _tmp11_ = NULL;
	GtkSeparatorToolItem* _tmp12_ = NULL;
	GtkToggleToolButton** _tmp13_ = NULL;
	gint _tmp13__length1 = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = (GtkToolbar*) gtk_toolbar_new ();
	g_object_ref_sink (_tmp0_);
	toolbar = _tmp0_;
	_tmp1_ = toolbar;
	gtk_toolbar_set_icon_size (_tmp1_, GTK_ICON_SIZE_MENU);
	_tmp2_ = toolbar;
	gtk_toolbar_set_style (_tmp2_, GTK_TOOLBAR_ICONS);
	_tmp3_ = toolbar;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp3_);
	_tmp4_ = toolbar;
	_tmp5_ = structure_get_refresh_button (self);
	_tmp6_ = _tmp5_;
	gtk_toolbar_insert (_tmp4_, (GtkToolItem*) _tmp6_, -1);
	_g_object_unref0 (_tmp6_);
	_tmp7_ = toolbar;
	_tmp8_ = structure_get_collapse_all_button (self);
	_tmp9_ = _tmp8_;
	gtk_toolbar_insert (_tmp7_, (GtkToolItem*) _tmp9_, -1);
	_g_object_unref0 (_tmp9_);
	_tmp10_ = toolbar;
	_tmp11_ = (GtkSeparatorToolItem*) gtk_separator_tool_item_new ();
	g_object_ref_sink (_tmp11_);
	_tmp12_ = _tmp11_;
	gtk_toolbar_insert (_tmp10_, (GtkToolItem*) _tmp12_, -1);
	_g_object_unref0 (_tmp12_);
	structure_init_simple_list_buttons (self);
	_tmp13_ = self->priv->_simple_list_buttons;
	_tmp13__length1 = self->priv->_simple_list_buttons_length1;
	{
		GtkToggleToolButton** simple_list_button_collection = NULL;
		gint simple_list_button_collection_length1 = 0;
		gint _simple_list_button_collection_size_ = 0;
		gint simple_list_button_it = 0;
		simple_list_button_collection = _tmp13_;
		simple_list_button_collection_length1 = _tmp13__length1;
		for (simple_list_button_it = 0; simple_list_button_it < _tmp13__length1; simple_list_button_it = simple_list_button_it + 1) {
			GtkToggleToolButton* _tmp14_ = NULL;
			GtkToggleToolButton* simple_list_button = NULL;
			_tmp14_ = _g_object_ref0 (simple_list_button_collection[simple_list_button_it]);
			simple_list_button = _tmp14_;
			{
				GtkToolbar* _tmp15_ = NULL;
				GtkToggleToolButton* _tmp16_ = NULL;
				_tmp15_ = toolbar;
				_tmp16_ = simple_list_button;
				gtk_toolbar_insert (_tmp15_, (GtkToolItem*) _tmp16_, -1);
				_g_object_unref0 (simple_list_button);
			}
		}
	}
	_g_object_unref0 (toolbar);
}


static void __lambda5_ (Structure* self) {
	structure_refresh (self);
}


static void ___lambda5__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self) {
	__lambda5_ ((Structure*) self);
}


static GtkToolButton* structure_get_refresh_button (Structure* self) {
	GtkToolButton* result = NULL;
	GtkToolButton* refresh_button = NULL;
	GtkToolButton* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = (GtkToolButton*) gtk_tool_button_new_from_stock (GTK_STOCK_REFRESH);
	g_object_ref_sink (_tmp0_);
	refresh_button = _tmp0_;
	_tmp1_ = _ ("Refresh");
	gtk_widget_set_tooltip_text ((GtkWidget*) refresh_button, _tmp1_);
	_tmp2_ = gtk_widget_get_tooltip_text ((GtkWidget*) refresh_button);
	_tmp3_ = _tmp2_;
	_tmp4_ = _tmp3_;
	gtk_tool_button_set_label (refresh_button, _tmp4_);
	_g_free0 (_tmp4_);
	g_signal_connect_object (refresh_button, "clicked", (GCallback) ___lambda5__gtk_tool_button_clicked, self, 0);
	result = refresh_button;
	return result;
}


static void __lambda7_ (Structure* self) {
	GtkTreeView* _tmp0_ = NULL;
	_tmp0_ = self->priv->_tree_view;
	gtk_tree_view_collapse_all (_tmp0_);
}


static void ___lambda7__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self) {
	__lambda7_ ((Structure*) self);
}


static GtkToolButton* structure_get_collapse_all_button (Structure* self) {
	GtkToolButton* result = NULL;
	GtkToolButton* collapse_button = NULL;
	GtkToolButton* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = (GtkToolButton*) gtk_tool_button_new_from_stock (GTK_STOCK_ZOOM_OUT);
	g_object_ref_sink (_tmp0_);
	collapse_button = _tmp0_;
	_tmp1_ = _ ("Collapse All");
	gtk_widget_set_tooltip_text ((GtkWidget*) collapse_button, _tmp1_);
	_tmp2_ = gtk_widget_get_tooltip_text ((GtkWidget*) collapse_button);
	_tmp3_ = _tmp2_;
	_tmp4_ = _tmp3_;
	gtk_tool_button_set_label (collapse_button, _tmp4_);
	_g_free0 (_tmp4_);
	g_signal_connect_object (collapse_button, "clicked", (GCallback) ___lambda7__gtk_tool_button_clicked, self, 0);
	result = collapse_button;
	return result;
}


static void structure_init_simple_list_buttons (Structure* self) {
	const gchar* _tmp0_ = NULL;
	GtkToggleToolButton* _tmp1_ = NULL;
	GtkToggleToolButton* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	GtkToggleToolButton* _tmp4_ = NULL;
	GtkToggleToolButton* _tmp5_ = NULL;
	const gchar* _tmp6_ = NULL;
	GtkToggleToolButton* _tmp7_ = NULL;
	GtkToggleToolButton* _tmp8_ = NULL;
	const gchar* _tmp9_ = NULL;
	GtkToggleToolButton* _tmp10_ = NULL;
	GtkToggleToolButton* _tmp11_ = NULL;
	const gchar* _tmp12_ = NULL;
	GtkToggleToolButton* _tmp13_ = NULL;
	GtkToggleToolButton* _tmp14_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = _ ("Show labels");
	_tmp1_ = structure_create_simple_list_button (self, STRUCT_TYPE_LABEL, _tmp0_);
	_tmp2_ = _tmp1_;
	_g_object_unref0 (_tmp2_);
	_tmp3_ = _ ("Show included files");
	_tmp4_ = structure_create_simple_list_button (self, STRUCT_TYPE_INCLUDE, _tmp3_);
	_tmp5_ = _tmp4_;
	_g_object_unref0 (_tmp5_);
	_tmp6_ = _ ("Show tables");
	_tmp7_ = structure_create_simple_list_button (self, STRUCT_TYPE_TABLE, _tmp6_);
	_tmp8_ = _tmp7_;
	_g_object_unref0 (_tmp8_);
	_tmp9_ = _ ("Show figures and images");
	_tmp10_ = structure_create_simple_list_button (self, STRUCT_TYPE_FIGURE, _tmp9_);
	_tmp11_ = _tmp10_;
	_g_object_unref0 (_tmp11_);
	_tmp12_ = _ ("Show TODOs and FIXMEs");
	_tmp13_ = structure_create_simple_list_button (self, STRUCT_TYPE_TODO, _tmp12_);
	_tmp14_ = _tmp13_;
	_g_object_unref0 (_tmp14_);
}


static Block30Data* block30_data_ref (Block30Data* _data30_) {
	g_atomic_int_inc (&_data30_->_ref_count_);
	return _data30_;
}


static void block30_data_unref (void * _userdata_) {
	Block30Data* _data30_;
	_data30_ = (Block30Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data30_->_ref_count_)) {
		Structure* self;
		self = _data30_->self;
		_g_object_unref0 (_data30_->button);
		_g_object_unref0 (self);
		g_slice_free (Block30Data, _data30_);
	}
}


static void _vala_array_add10 (GtkToggleToolButton*** array, int* length, int* size, GtkToggleToolButton* value) {
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkToggleToolButton*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}


static void __lambda8_ (Block30Data* _data30_) {
	Structure* self;
	gboolean _tmp0_ = FALSE;
	StructType _tmp6_ = 0;
	GtkScrolledWindow* _tmp7_ = NULL;
	GtkToggleToolButton** _tmp8_ = NULL;
	gint _tmp8__length1 = 0;
	self = _data30_->self;
	_tmp0_ = gtk_toggle_tool_button_get_active (_data30_->button);
	if (!_tmp0_) {
		gboolean _tmp1_ = FALSE;
		gboolean _tmp2_ = FALSE;
		_tmp2_ = self->priv->_list_is_hidden;
		if (!_tmp2_) {
			StructType _tmp3_ = 0;
			StructType _tmp4_ = 0;
			_tmp3_ = _data30_->type;
			_tmp4_ = self->priv->_current_list_type;
			_tmp1_ = _tmp3_ == _tmp4_;
		} else {
			_tmp1_ = FALSE;
		}
		if (_tmp1_) {
			GtkScrolledWindow* _tmp5_ = NULL;
			self->priv->_list_is_hidden = TRUE;
			_tmp5_ = self->priv->_list_view_sw;
			gtk_widget_hide ((GtkWidget*) _tmp5_);
		}
		return;
	}
	_tmp6_ = _data30_->type;
	self->priv->_current_list_type = _tmp6_;
	self->priv->_list_is_hidden = FALSE;
	_tmp7_ = self->priv->_list_view_sw;
	gtk_widget_show_all ((GtkWidget*) _tmp7_);
	structure_populate_simple_list (self);
	_tmp8_ = self->priv->_simple_list_buttons;
	_tmp8__length1 = self->priv->_simple_list_buttons_length1;
	{
		GtkToggleToolButton** simple_list_button_collection = NULL;
		gint simple_list_button_collection_length1 = 0;
		gint _simple_list_button_collection_size_ = 0;
		gint simple_list_button_it = 0;
		simple_list_button_collection = _tmp8_;
		simple_list_button_collection_length1 = _tmp8__length1;
		for (simple_list_button_it = 0; simple_list_button_it < _tmp8__length1; simple_list_button_it = simple_list_button_it + 1) {
			GtkToggleToolButton* _tmp9_ = NULL;
			GtkToggleToolButton* simple_list_button = NULL;
			_tmp9_ = _g_object_ref0 (simple_list_button_collection[simple_list_button_it]);
			simple_list_button = _tmp9_;
			{
				GtkToggleToolButton* _tmp10_ = NULL;
				GtkToggleToolButton* _tmp11_ = NULL;
				_tmp10_ = simple_list_button;
				if (_tmp10_ == _data30_->button) {
					_g_object_unref0 (simple_list_button);
					continue;
				}
				_tmp11_ = simple_list_button;
				gtk_toggle_tool_button_set_active (_tmp11_, FALSE);
				_g_object_unref0 (simple_list_button);
			}
		}
	}
}


static void ___lambda8__gtk_tool_button_clicked (GtkToolButton* _sender, gpointer self) {
	__lambda8_ (self);
}


static GtkToggleToolButton* structure_create_simple_list_button (Structure* self, StructType type, const gchar* tooltip) {
	GtkToggleToolButton* result = NULL;
	Block30Data* _data30_;
	StructType _tmp0_ = 0;
	StructType _tmp1_ = 0;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	GtkToggleToolButton* _tmp4_ = NULL;
	GtkToggleToolButton* _tmp5_ = NULL;
	const gchar* _tmp6_ = NULL;
	const gchar* _tmp7_ = NULL;
	GtkToggleToolButton** _tmp8_ = NULL;
	gint _tmp8__length1 = 0;
	GtkToggleToolButton* _tmp9_ = NULL;
	GtkToggleToolButton* _tmp10_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (tooltip != NULL, NULL);
	_data30_ = g_slice_new0 (Block30Data);
	_data30_->_ref_count_ = 1;
	_data30_->self = g_object_ref (self);
	_tmp0_ = type;
	_data30_->type = _tmp0_;
	_tmp1_ = _data30_->type;
	_tmp2_ = structure_get_icon_from_type (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = (GtkToggleToolButton*) gtk_toggle_tool_button_new_from_stock (_tmp3_);
	g_object_ref_sink (_tmp4_);
	_tmp5_ = _tmp4_;
	_g_free0 (_tmp3_);
	_data30_->button = _tmp5_;
	_tmp6_ = tooltip;
	gtk_widget_set_tooltip_text ((GtkWidget*) _data30_->button, _tmp6_);
	_tmp7_ = tooltip;
	gtk_tool_button_set_label ((GtkToolButton*) _data30_->button, _tmp7_);
	_tmp8_ = self->priv->_simple_list_buttons;
	_tmp8__length1 = self->priv->_simple_list_buttons_length1;
	_tmp9_ = _g_object_ref0 (_data30_->button);
	_vala_array_add10 (&self->priv->_simple_list_buttons, &self->priv->_simple_list_buttons_length1, &self->priv->__simple_list_buttons_size_, _tmp9_);
	g_signal_connect_data ((GtkToolButton*) _data30_->button, "clicked", (GCallback) ___lambda8__gtk_tool_button_clicked, block30_data_ref (_data30_), (GClosureNotify) block30_data_unref, 0);
	_tmp10_ = _g_object_ref0 (_data30_->button);
	result = _tmp10_;
	block30_data_unref (_data30_);
	_data30_ = NULL;
	return result;
}


static void _gtk_tree_path_free0_ (gpointer var) {
	(var == NULL) ? NULL : (var = (gtk_tree_path_free (var), NULL));
}


static void _g_list_free__gtk_tree_path_free0_ (GList* self) {
	g_list_foreach (self, (GFunc) _gtk_tree_path_free0_, NULL);
	g_list_free (self);
}


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


static void structure_populate_simple_list (Structure* self) {
	GtkListStore* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	StructureModel* _tmp2_ = NULL;
	StructureModel* _tmp4_ = NULL;
	GtkListStore* _tmp5_ = NULL;
	StructType _tmp6_ = 0;
	GtkTreeSelection* tree_select = NULL;
	GtkTreeView* _tmp7_ = NULL;
	GtkTreeSelection* _tmp8_ = NULL;
	GtkTreeSelection* _tmp9_ = NULL;
	GList* selected_rows = NULL;
	GtkTreeSelection* _tmp10_ = NULL;
	GList* _tmp11_ = NULL;
	GList* _tmp12_ = NULL;
	guint _tmp13_ = 0U;
	GtkTreePath* tree_path = NULL;
	GList* _tmp14_ = NULL;
	gconstpointer _tmp15_ = NULL;
	GtkTreePath* _tmp16_ = NULL;
	GtkTreeIter tree_iter = {0};
	StructureModel* _tmp17_ = NULL;
	GtkTreePath* _tmp18_ = NULL;
	GtkTreeIter _tmp19_ = {0};
	gboolean _tmp20_ = FALSE;
	GtkTreeIter _tmp21_ = {0};
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_list_store;
	gtk_list_store_clear (_tmp0_);
	_tmp2_ = self->priv->_model;
	if (_tmp2_ == NULL) {
		_tmp1_ = TRUE;
	} else {
		gboolean _tmp3_ = FALSE;
		_tmp3_ = self->priv->_list_is_hidden;
		_tmp1_ = _tmp3_;
	}
	if (_tmp1_) {
		return;
	}
	_tmp4_ = self->priv->_model;
	_tmp5_ = self->priv->_list_store;
	_tmp6_ = self->priv->_current_list_type;
	structure_model_populate_list (_tmp4_, _tmp5_, _tmp6_);
	_tmp7_ = self->priv->_tree_view;
	_tmp8_ = gtk_tree_view_get_selection (_tmp7_);
	_tmp9_ = _g_object_ref0 (_tmp8_);
	tree_select = _tmp9_;
	_tmp10_ = tree_select;
	_tmp11_ = gtk_tree_selection_get_selected_rows (_tmp10_, NULL);
	selected_rows = _tmp11_;
	_tmp12_ = selected_rows;
	_tmp13_ = g_list_length (_tmp12_);
	if (_tmp13_ != ((guint) 1)) {
		__g_list_free__gtk_tree_path_free0_0 (selected_rows);
		_g_object_unref0 (tree_select);
		return;
	}
	_tmp14_ = selected_rows;
	_tmp15_ = g_list_nth_data (_tmp14_, (guint) 0);
	_tmp16_ = _gtk_tree_path_copy0 ((GtkTreePath*) _tmp15_);
	tree_path = _tmp16_;
	_tmp17_ = self->priv->_model;
	_tmp18_ = tree_path;
	_tmp20_ = gtk_tree_model_get_iter ((GtkTreeModel*) _tmp17_, &_tmp19_, _tmp18_);
	tree_iter = _tmp19_;
	if (!_tmp20_) {
		g_return_if_reached ();
	}
	_tmp21_ = tree_iter;
	structure_select_simple_list_item (self, &_tmp21_);
	_gtk_tree_path_free0 (tree_path);
	__g_list_free__gtk_tree_path_free0_0 (selected_rows);
	_g_object_unref0 (tree_select);
}


static void structure_init_vpaned (Structure* self) {
	GtkPaned* _tmp0_ = NULL;
	GtkPaned* _tmp1_ = NULL;
	GtkPaned* _tmp2_ = NULL;
	GSettings* settings = NULL;
	GSettings* _tmp3_ = NULL;
	GtkPaned* _tmp4_ = NULL;
	gint _tmp5_ = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = (GtkPaned*) gtk_paned_new (GTK_ORIENTATION_VERTICAL);
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->_vpaned);
	self->priv->_vpaned = _tmp0_;
	_tmp1_ = self->priv->_vpaned;
	g_object_set ((GtkWidget*) _tmp1_, "expand", TRUE, NULL);
	_tmp2_ = self->priv->_vpaned;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp2_);
	_tmp3_ = g_settings_new ("org.gnome.latexila.state.window");
	settings = _tmp3_;
	_tmp4_ = self->priv->_vpaned;
	_tmp5_ = g_settings_get_int (settings, "structure-paned-position");
	gtk_paned_set_position (_tmp4_, _tmp5_);
	_g_object_unref0 (settings);
}


void structure_save_state (Structure* self) {
	GSettings* settings = NULL;
	GSettings* _tmp0_ = NULL;
	GtkPaned* _tmp1_ = NULL;
	gint _tmp2_ = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_settings_new ("org.gnome.latexila.state.window");
	settings = _tmp0_;
	_tmp1_ = self->priv->_vpaned;
	_tmp2_ = gtk_paned_get_position (_tmp1_);
	g_settings_set_int (settings, "structure-paned-position", _tmp2_);
	_g_object_unref0 (settings);
}


static gboolean __lambda9_ (Structure* self, GtkTreeSelection* select, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	GtkTreePath* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	g_return_val_if_fail (select != NULL, FALSE);
	g_return_val_if_fail (model != NULL, FALSE);
	g_return_val_if_fail (path != NULL, FALSE);
	_tmp0_ = path_currently_selected;
	if (_tmp0_) {
		result = TRUE;
		return result;
	}
	_tmp1_ = path;
	_tmp2_ = structure_select_list_row (self, _tmp1_);
	result = _tmp2_;
	return result;
}


static gboolean ___lambda9__gtk_tree_selection_func (GtkTreeSelection* selection, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected, gpointer self) {
	gboolean result;
	result = __lambda9_ ((Structure*) self, selection, model, path, path_currently_selected);
	return result;
}


static void __lambda10_ (Structure* self, GtkTreePath* path) {
	GtkTreePath* _tmp0_ = NULL;
	g_return_if_fail (path != NULL);
	_tmp0_ = path;
	structure_select_list_row (self, _tmp0_);
}


static void ___lambda10__gtk_tree_view_row_activated (GtkTreeView* _sender, GtkTreePath* path, GtkTreeViewColumn* column, gpointer self) {
	__lambda10_ ((Structure*) self, path);
}


static void structure_init_list_view (Structure* self) {
	GtkTreeView* _tmp0_ = NULL;
	GtkListStore* _tmp1_ = NULL;
	GtkTreeView* _tmp2_ = NULL;
	GtkListStore* _tmp3_ = NULL;
	GtkTreeSelection* list_select = NULL;
	GtkTreeView* _tmp4_ = NULL;
	GtkTreeSelection* _tmp5_ = NULL;
	GtkTreeSelection* _tmp6_ = NULL;
	GtkTreeView* _tmp7_ = NULL;
	GtkTreeView* _tmp8_ = NULL;
	GtkScrolledWindow* _tmp9_ = NULL;
	GtkScrolledWindow* _tmp10_ = NULL;
	GtkPaned* _tmp11_ = NULL;
	GtkScrolledWindow* _tmp12_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = structure_get_new_tree_view (self, (gint) STRUCT_LIST_COLUMN_PIXBUF, (gint) STRUCT_LIST_COLUMN_TEXT, (gint) STRUCT_LIST_COLUMN_TOOLTIP);
	_g_object_unref0 (self->priv->_list_view);
	self->priv->_list_view = _tmp0_;
	_tmp1_ = gtk_list_store_new ((gint) STRUCT_LIST_COLUMN_N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, -1);
	_g_object_unref0 (self->priv->_list_store);
	self->priv->_list_store = _tmp1_;
	_tmp2_ = self->priv->_list_view;
	_tmp3_ = self->priv->_list_store;
	gtk_tree_view_set_model (_tmp2_, (GtkTreeModel*) _tmp3_);
	_tmp4_ = self->priv->_list_view;
	_tmp5_ = gtk_tree_view_get_selection (_tmp4_);
	_tmp6_ = _g_object_ref0 (_tmp5_);
	list_select = _tmp6_;
	gtk_tree_selection_set_select_function (list_select, ___lambda9__gtk_tree_selection_func, g_object_ref (self), g_object_unref);
	_tmp7_ = self->priv->_list_view;
	g_signal_connect_object (_tmp7_, "row-activated", (GCallback) ___lambda10__gtk_tree_view_row_activated, self, 0);
	_tmp8_ = self->priv->_list_view;
	_tmp9_ = utils_add_scrollbar ((GtkWidget*) _tmp8_);
	_g_object_unref0 (self->priv->_list_view_sw);
	self->priv->_list_view_sw = _tmp9_;
	_tmp10_ = self->priv->_list_view_sw;
	gtk_scrolled_window_set_shadow_type (_tmp10_, GTK_SHADOW_IN);
	_tmp11_ = self->priv->_vpaned;
	_tmp12_ = self->priv->_list_view_sw;
	gtk_paned_add1 (_tmp11_, (GtkWidget*) _tmp12_);
	_g_object_unref0 (list_select);
}


static gboolean __lambda11_ (Structure* self, GtkTreeSelection* select, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	GtkTreePath* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	g_return_val_if_fail (select != NULL, FALSE);
	g_return_val_if_fail (model != NULL, FALSE);
	g_return_val_if_fail (path != NULL, FALSE);
	_tmp0_ = path_currently_selected;
	if (_tmp0_) {
		g_signal_emit_by_name (self, "no-items-selected");
		result = TRUE;
		return result;
	}
	_tmp1_ = path;
	_tmp2_ = structure_select_tree_row (self, _tmp1_);
	result = _tmp2_;
	return result;
}


static gboolean ___lambda11__gtk_tree_selection_func (GtkTreeSelection* selection, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected, gpointer self) {
	gboolean result;
	result = __lambda11_ ((Structure*) self, selection, model, path, path_currently_selected);
	return result;
}


static void __lambda12_ (Structure* self, GtkTreePath* path) {
	GtkTreePath* _tmp0_ = NULL;
	g_return_if_fail (path != NULL);
	_tmp0_ = path;
	structure_select_tree_row (self, _tmp0_);
}


static void ___lambda12__gtk_tree_view_row_activated (GtkTreeView* _sender, GtkTreePath* path, GtkTreeViewColumn* column, gpointer self) {
	__lambda12_ ((Structure*) self, path);
}


static gboolean __lambda13_ (Structure* self, GdkEventButton* event) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	GdkEventButton* _tmp1_ = NULL;
	guint _tmp2_ = 0U;
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp1_ = event;
	_tmp2_ = _tmp1_->button;
	if (_tmp2_ == ((guint) 3)) {
		GdkEventButton* _tmp3_ = NULL;
		GdkEventType _tmp4_ = 0;
		_tmp3_ = event;
		_tmp4_ = _tmp3_->type;
		_tmp0_ = _tmp4_ == GDK_BUTTON_PRESS;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GdkEventButton* _tmp5_ = NULL;
		_tmp5_ = event;
		g_signal_emit_by_name (self, "show-popup-menu", _tmp5_);
	}
	result = FALSE;
	return result;
}


static gboolean ___lambda13__gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self) {
	gboolean result;
	result = __lambda13_ ((Structure*) self, event);
	return result;
}


static gboolean __lambda14_ (Structure* self) {
	gboolean result = FALSE;
	g_signal_emit_by_name (self, "show-popup-menu", NULL);
	result = TRUE;
	return result;
}


static gboolean ___lambda14__gtk_widget_popup_menu (GtkWidget* _sender, gpointer self) {
	gboolean result;
	result = __lambda14_ ((Structure*) self);
	return result;
}


static void structure_init_tree_view (Structure* self) {
	GtkTreeView* _tmp0_ = NULL;
	GtkTreeView* _tmp1_ = NULL;
	GtkTreeSelection* tree_select = NULL;
	GtkTreeView* _tmp2_ = NULL;
	GtkTreeSelection* _tmp3_ = NULL;
	GtkTreeSelection* _tmp4_ = NULL;
	GtkTreeView* _tmp5_ = NULL;
	GtkTreeView* _tmp6_ = NULL;
	GtkTreeView* _tmp7_ = NULL;
	GtkScrolledWindow* sw = NULL;
	GtkTreeView* _tmp8_ = NULL;
	GtkScrolledWindow* _tmp9_ = NULL;
	GtkPaned* _tmp10_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = structure_get_new_tree_view (self, (gint) STRUCT_COLUMN_PIXBUF, (gint) STRUCT_COLUMN_TEXT, (gint) STRUCT_COLUMN_TOOLTIP);
	_g_object_unref0 (self->priv->_tree_view);
	self->priv->_tree_view = _tmp0_;
	_tmp1_ = self->priv->_tree_view;
	gtk_tree_view_set_enable_tree_lines (_tmp1_, TRUE);
	_tmp2_ = self->priv->_tree_view;
	_tmp3_ = gtk_tree_view_get_selection (_tmp2_);
	_tmp4_ = _g_object_ref0 (_tmp3_);
	tree_select = _tmp4_;
	gtk_tree_selection_set_select_function (tree_select, ___lambda11__gtk_tree_selection_func, g_object_ref (self), g_object_unref);
	_tmp5_ = self->priv->_tree_view;
	g_signal_connect_object (_tmp5_, "row-activated", (GCallback) ___lambda12__gtk_tree_view_row_activated, self, 0);
	_tmp6_ = self->priv->_tree_view;
	g_signal_connect_object ((GtkWidget*) _tmp6_, "button-press-event", (GCallback) ___lambda13__gtk_widget_button_press_event, self, 0);
	_tmp7_ = self->priv->_tree_view;
	g_signal_connect_object ((GtkWidget*) _tmp7_, "popup-menu", (GCallback) ___lambda14__gtk_widget_popup_menu, self, 0);
	_tmp8_ = self->priv->_tree_view;
	_tmp9_ = utils_add_scrollbar ((GtkWidget*) _tmp8_);
	sw = _tmp9_;
	gtk_scrolled_window_set_shadow_type (sw, GTK_SHADOW_IN);
	_tmp10_ = self->priv->_vpaned;
	gtk_paned_add2 (_tmp10_, (GtkWidget*) sw);
	_g_object_unref0 (sw);
	_g_object_unref0 (tree_select);
}


static GtkTreeView* structure_get_new_tree_view (Structure* self, gint pixbuf_col, gint text_col, gint tooltip_col) {
	GtkTreeView* result = NULL;
	GtkTreeView* tree_view = NULL;
	GtkTreeView* _tmp0_ = NULL;
	GtkTreeViewColumn* column = NULL;
	GtkTreeViewColumn* _tmp1_ = NULL;
	GtkCellRendererPixbuf* pixbuf_renderer = NULL;
	GtkCellRendererPixbuf* _tmp2_ = NULL;
	gint _tmp3_ = 0;
	GtkCellRendererText* text_renderer = NULL;
	GtkCellRendererText* _tmp4_ = NULL;
	gint _tmp5_ = 0;
	gint _tmp6_ = 0;
	GtkTreeSelection* select = NULL;
	GtkTreeSelection* _tmp7_ = NULL;
	GtkTreeSelection* _tmp8_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = (GtkTreeView*) gtk_tree_view_new ();
	g_object_ref_sink (_tmp0_);
	tree_view = _tmp0_;
	gtk_tree_view_set_headers_visible (tree_view, FALSE);
	_tmp1_ = gtk_tree_view_column_new ();
	g_object_ref_sink (_tmp1_);
	column = _tmp1_;
	gtk_tree_view_append_column (tree_view, column);
	_tmp2_ = (GtkCellRendererPixbuf*) gtk_cell_renderer_pixbuf_new ();
	g_object_ref_sink (_tmp2_);
	pixbuf_renderer = _tmp2_;
	gtk_cell_layout_pack_start ((GtkCellLayout*) column, (GtkCellRenderer*) pixbuf_renderer, FALSE);
	_tmp3_ = pixbuf_col;
	gtk_tree_view_column_set_attributes (column, (GtkCellRenderer*) pixbuf_renderer, "stock-id", _tmp3_, NULL, NULL);
	_tmp4_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	g_object_ref_sink (_tmp4_);
	text_renderer = _tmp4_;
	gtk_cell_layout_pack_start ((GtkCellLayout*) column, (GtkCellRenderer*) text_renderer, TRUE);
	_tmp5_ = text_col;
	gtk_tree_view_column_set_attributes (column, (GtkCellRenderer*) text_renderer, "text", _tmp5_, NULL, NULL);
	_tmp6_ = tooltip_col;
	gtk_tree_view_set_tooltip_column (tree_view, _tmp6_);
	_tmp7_ = gtk_tree_view_get_selection (tree_view);
	_tmp8_ = _g_object_ref0 (_tmp7_);
	select = _tmp8_;
	gtk_tree_selection_set_mode (select, GTK_SELECTION_SINGLE);
	result = tree_view;
	_g_object_unref0 (select);
	_g_object_unref0 (text_renderer);
	_g_object_unref0 (pixbuf_renderer);
	_g_object_unref0 (column);
	return result;
}


static gboolean structure_select_list_row (Structure* self, GtkTreePath* list_path) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	StructureModel* _tmp1_ = NULL;
	GtkTreeSelection* tree_select = NULL;
	GtkTreeView* _tmp2_ = NULL;
	GtkTreeSelection* _tmp3_ = NULL;
	GtkTreeSelection* _tmp4_ = NULL;
	GtkTreeSelection* _tmp5_ = NULL;
	gint row_num = 0;
	GtkTreePath* _tmp6_ = NULL;
	gint _tmp7_ = 0;
	gint* _tmp8_ = NULL;
	gint _tmp9_ = 0;
	GtkTreePath* tree_path = NULL;
	StructureModel* _tmp10_ = NULL;
	StructType _tmp11_ = 0;
	gint _tmp12_ = 0;
	GtkTreePath* _tmp13_ = NULL;
	GtkTreePath* _tmp14_ = NULL;
	GtkTreeView* _tmp15_ = NULL;
	GtkTreePath* _tmp16_ = NULL;
	GtkTreeSelection* _tmp17_ = NULL;
	GtkTreePath* _tmp18_ = NULL;
	GtkTreeView* _tmp19_ = NULL;
	GtkTreePath* _tmp20_ = NULL;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (list_path != NULL, FALSE);
	_tmp0_ = self->priv->_first_select;
	if (!_tmp0_) {
		self->priv->_first_select = TRUE;
		result = TRUE;
		return result;
	}
	_tmp1_ = self->priv->_model;
	g_return_val_if_fail (_tmp1_ != NULL, FALSE);
	_tmp2_ = self->priv->_tree_view;
	_tmp3_ = gtk_tree_view_get_selection (_tmp2_);
	_tmp4_ = _g_object_ref0 (_tmp3_);
	tree_select = _tmp4_;
	_tmp5_ = tree_select;
	gtk_tree_selection_unselect_all (_tmp5_);
	_tmp6_ = list_path;
	_tmp8_ = gtk_tree_path_get_indices_with_depth (_tmp6_, &_tmp7_);
	_tmp9_ = _tmp8_[0];
	row_num = _tmp9_;
	_tmp10_ = self->priv->_model;
	_tmp11_ = self->priv->_current_list_type;
	_tmp12_ = row_num;
	_tmp13_ = structure_model_get_tree_path_from_list_num (_tmp10_, _tmp11_, _tmp12_);
	tree_path = _tmp13_;
	_tmp14_ = tree_path;
	g_return_val_if_fail (_tmp14_ != NULL, FALSE);
	_tmp15_ = self->priv->_tree_view;
	_tmp16_ = tree_path;
	gtk_tree_view_expand_to_path (_tmp15_, _tmp16_);
	self->priv->_first_select = FALSE;
	_tmp17_ = tree_select;
	_tmp18_ = tree_path;
	gtk_tree_selection_select_path (_tmp17_, _tmp18_);
	_tmp19_ = self->priv->_tree_view;
	_tmp20_ = tree_path;
	gtk_tree_view_scroll_to_cell (_tmp19_, _tmp20_, NULL, TRUE, (gfloat) 0.5, (gfloat) 0);
	result = TRUE;
	_gtk_tree_path_free0 (tree_path);
	_g_object_unref0 (tree_select);
	return result;
}


static gboolean structure_select_tree_row (Structure* self, GtkTreePath* tree_path) {
	gboolean result = FALSE;
	gboolean first_select = FALSE;
	gboolean _tmp0_ = FALSE;
	GtkTreeIter tree_iter = {0};
	StructureModel* _tmp1_ = NULL;
	GtkTreePath* _tmp2_ = NULL;
	GtkTreeIter _tmp3_ = {0};
	gboolean _tmp4_ = FALSE;
	GtkTextMark* mark = NULL;
	StructType type = 0;
	StructureModel* _tmp5_ = NULL;
	GtkTreeIter _tmp6_ = {0};
	GtkTextBuffer* doc = NULL;
	GtkTextMark* _tmp7_ = NULL;
	GtkTextBuffer* _tmp8_ = NULL;
	GtkTextBuffer* _tmp9_ = NULL;
	GtkTextBuffer* _tmp10_ = NULL;
	MainWindow* _tmp11_ = NULL;
	Document* _tmp12_ = NULL;
	Document* _tmp13_ = NULL;
	GtkTextIter text_iter = {0};
	GtkTextBuffer* _tmp14_ = NULL;
	GtkTextMark* _tmp15_ = NULL;
	GtkTextIter _tmp16_ = {0};
	GtkTextBuffer* _tmp17_ = NULL;
	GtkTextIter _tmp18_ = {0};
	MainWindow* _tmp19_ = NULL;
	DocumentView* _tmp20_ = NULL;
	DocumentView* _tmp21_ = NULL;
	GtkTextBuffer* _tmp22_ = NULL;
	GtkTextMark* _tmp23_ = NULL;
	StructType _tmp24_ = 0;
	GtkTreeIter _tmp25_ = {0};
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (tree_path != NULL, FALSE);
	_tmp0_ = self->priv->_first_select;
	first_select = _tmp0_;
	self->priv->_first_select = TRUE;
	_tmp1_ = self->priv->_model;
	_tmp2_ = tree_path;
	_tmp4_ = gtk_tree_model_get_iter ((GtkTreeModel*) _tmp1_, &_tmp3_, _tmp2_);
	tree_iter = _tmp3_;
	if (!_tmp4_) {
		g_return_val_if_reached (FALSE);
	}
	_tmp5_ = self->priv->_model;
	_tmp6_ = tree_iter;
	gtk_tree_model_get ((GtkTreeModel*) _tmp5_, &_tmp6_, STRUCT_COLUMN_START_MARK, &mark, STRUCT_COLUMN_TYPE, &type, -1);
	_tmp7_ = mark;
	_tmp8_ = gtk_text_mark_get_buffer (_tmp7_);
	_tmp9_ = _g_object_ref0 (_tmp8_);
	doc = _tmp9_;
	_tmp10_ = doc;
	_tmp11_ = self->priv->_main_window;
	_tmp12_ = main_window_get_active_document (_tmp11_);
	_tmp13_ = _tmp12_;
	g_return_val_if_fail (_tmp10_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, gtk_text_buffer_get_type (), GtkTextBuffer), FALSE);
	_tmp14_ = doc;
	_tmp15_ = mark;
	gtk_text_buffer_get_iter_at_mark (_tmp14_, &_tmp16_, _tmp15_);
	text_iter = _tmp16_;
	_tmp17_ = doc;
	_tmp18_ = text_iter;
	gtk_text_buffer_place_cursor (_tmp17_, &_tmp18_);
	_tmp19_ = self->priv->_main_window;
	_tmp20_ = main_window_get_active_view (_tmp19_);
	_tmp21_ = _tmp20_;
	_tmp22_ = doc;
	_tmp23_ = gtk_text_buffer_get_insert (_tmp22_);
	gtk_text_view_scroll_to_mark ((GtkTextView*) _tmp21_, _tmp23_, (gdouble) 0, TRUE, (gdouble) 1, (gdouble) 0);
	_tmp24_ = type;
	g_signal_emit_by_name (self, "item-selected", _tmp24_);
	if (!first_select) {
		result = TRUE;
		_g_object_unref0 (doc);
		_g_object_unref0 (mark);
		return result;
	}
	_tmp25_ = tree_iter;
	structure_select_simple_list_item (self, &_tmp25_);
	result = TRUE;
	_g_object_unref0 (doc);
	_g_object_unref0 (mark);
	return result;
}


static void structure_select_simple_list_item (Structure* self, GtkTreeIter* tree_iter) {
	gboolean _tmp0_ = FALSE;
	GtkTreeSelection* list_select = NULL;
	GtkTreeView* _tmp1_ = NULL;
	GtkTreeSelection* _tmp2_ = NULL;
	GtkTreeSelection* _tmp3_ = NULL;
	GtkTreeSelection* _tmp4_ = NULL;
	StructType type = 0;
	StructureModel* _tmp5_ = NULL;
	GtkTreeIter _tmp6_ = {0};
	GeeArrayList* current_list_types = NULL;
	StructType _tmp7_ = 0;
	GeeArrayList* _tmp8_ = NULL;
	GeeArrayList* _tmp9_ = NULL;
	StructType _tmp10_ = 0;
	gboolean _tmp11_ = FALSE;
	gint row_num = 0;
	StructureModel* _tmp12_ = NULL;
	GtkTreeIter _tmp13_ = {0};
	gint _tmp14_ = 0;
	gint _tmp15_ = 0;
	GtkTreePath* list_path = NULL;
	gint _tmp16_ = 0;
	GtkTreePath* _tmp17_ = NULL;
	GtkTreeSelection* _tmp18_ = NULL;
	GtkTreePath* _tmp19_ = NULL;
	GtkTreeView* _tmp20_ = NULL;
	GtkTreePath* _tmp21_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (tree_iter != NULL);
	_tmp0_ = self->priv->_list_is_hidden;
	if (_tmp0_) {
		return;
	}
	_tmp1_ = self->priv->_list_view;
	_tmp2_ = gtk_tree_view_get_selection (_tmp1_);
	_tmp3_ = _g_object_ref0 (_tmp2_);
	list_select = _tmp3_;
	_tmp4_ = list_select;
	gtk_tree_selection_unselect_all (_tmp4_);
	_tmp5_ = self->priv->_model;
	_tmp6_ = *tree_iter;
	gtk_tree_model_get ((GtkTreeModel*) _tmp5_, &_tmp6_, STRUCT_COLUMN_TYPE, &type, -1, -1);
	_tmp7_ = self->priv->_current_list_type;
	_tmp8_ = structure_get_simple_list_types (self, _tmp7_);
	current_list_types = _tmp8_;
	_tmp9_ = current_list_types;
	_tmp10_ = type;
	_tmp11_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp9_, (gpointer) ((gintptr) _tmp10_));
	if (!_tmp11_) {
		_g_object_unref0 (current_list_types);
		_g_object_unref0 (list_select);
		return;
	}
	_tmp12_ = self->priv->_model;
	_tmp13_ = *tree_iter;
	_tmp14_ = structure_model_get_list_num_from_tree_iter (_tmp12_, &_tmp13_);
	row_num = _tmp14_;
	_tmp15_ = row_num;
	if (_tmp15_ == (-1)) {
		_g_object_unref0 (current_list_types);
		_g_object_unref0 (list_select);
		return;
	}
	_tmp16_ = row_num;
	_tmp17_ = gtk_tree_path_new_from_indices (_tmp16_, -1, -1);
	list_path = _tmp17_;
	self->priv->_first_select = FALSE;
	_tmp18_ = list_select;
	_tmp19_ = list_path;
	gtk_tree_selection_select_path (_tmp18_, _tmp19_);
	_tmp20_ = self->priv->_list_view;
	_tmp21_ = list_path;
	gtk_tree_view_scroll_to_cell (_tmp20_, _tmp21_, NULL, FALSE, (gfloat) 0, (gfloat) 0);
	_gtk_tree_path_free0 (list_path);
	_g_object_unref0 (current_list_types);
	_g_object_unref0 (list_select);
}


static GeeArrayList* structure_get_simple_list_types (Structure* self, StructType type) {
	GeeArrayList* result = NULL;
	StructType _tmp0_ = 0;
	gboolean _tmp1_ = FALSE;
	GeeArrayList* types = NULL;
	GeeArrayList* _tmp2_ = NULL;
	StructType _tmp3_ = 0;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = type;
	_tmp1_ = structure_is_section (_tmp0_);
	g_return_val_if_fail (!_tmp1_, NULL);
	_tmp2_ = gee_array_list_new (TYPE_STRUCT_TYPE, NULL, NULL, NULL, NULL, NULL);
	types = _tmp2_;
	_tmp3_ = type;
	switch (_tmp3_) {
		case STRUCT_TYPE_FIGURE:
		case STRUCT_TYPE_IMAGE:
		{
			GeeArrayList* _tmp4_ = NULL;
			GeeArrayList* _tmp5_ = NULL;
			_tmp4_ = types;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp4_, (gpointer) ((gintptr) STRUCT_TYPE_FIGURE));
			_tmp5_ = types;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp5_, (gpointer) ((gintptr) STRUCT_TYPE_IMAGE));
			break;
		}
		case STRUCT_TYPE_TODO:
		case STRUCT_TYPE_FIXME:
		{
			GeeArrayList* _tmp6_ = NULL;
			GeeArrayList* _tmp7_ = NULL;
			_tmp6_ = types;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp6_, (gpointer) ((gintptr) STRUCT_TYPE_TODO));
			_tmp7_ = types;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp7_, (gpointer) ((gintptr) STRUCT_TYPE_FIXME));
			break;
		}
		default:
		{
			GeeArrayList* _tmp8_ = NULL;
			StructType _tmp9_ = 0;
			_tmp8_ = types;
			_tmp9_ = type;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp8_, (gpointer) ((gintptr) _tmp9_));
			break;
		}
	}
	result = types;
	return result;
}


static void structure_show_active_document (Structure* self) {
	MainWindow* _tmp0_ = NULL;
	Document* _tmp1_ = NULL;
	Document* _tmp2_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_main_window;
	_tmp1_ = main_window_get_active_document (_tmp0_);
	_tmp2_ = _tmp1_;
	structure_show_document (self, _tmp2_, FALSE);
}


static void _structure_on_parsing_done_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	structure_on_parsing_done ((Structure*) self);
}


static void structure_show_document (Structure* self, Document* doc, gboolean force_parse) {
	GtkTreeView* _tmp0_ = NULL;
	DocumentStructure* _tmp1_ = NULL;
	Document* _tmp5_ = NULL;
	Document* _tmp6_ = NULL;
	DocumentStructure* _tmp7_ = NULL;
	gboolean _tmp8_ = FALSE;
	DocumentStructure* _tmp10_ = NULL;
	gboolean _tmp11_ = FALSE;
	gboolean _tmp12_ = FALSE;
	g_return_if_fail (self != NULL);
	structure_set_model (self, NULL);
	_tmp0_ = self->priv->_tree_view;
	gtk_tree_view_columns_autosize (_tmp0_);
	_tmp1_ = self->priv->_document_structure;
	if (_tmp1_ != NULL) {
		DocumentStructure* _tmp2_ = NULL;
		guint _tmp3_ = 0U;
		GQuark _tmp4_ = 0U;
		_tmp2_ = self->priv->_document_structure;
		g_signal_parse_name ("notify::parsing-done", G_TYPE_OBJECT, &_tmp3_, &_tmp4_, TRUE);
		g_signal_handlers_disconnect_matched ((GObject*) _tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, _tmp4_, NULL, (GCallback) _structure_on_parsing_done_g_object_notify, self);
	}
	_tmp5_ = doc;
	if (_tmp5_ == NULL) {
		_g_object_unref0 (self->priv->_document_structure);
		self->priv->_document_structure = NULL;
		return;
	}
	_tmp6_ = doc;
	_tmp7_ = document_get_structure (_tmp6_);
	_g_object_unref0 (self->priv->_document_structure);
	self->priv->_document_structure = _tmp7_;
	_tmp8_ = force_parse;
	if (_tmp8_) {
		DocumentStructure* _tmp9_ = NULL;
		_tmp9_ = self->priv->_document_structure;
		document_structure_parse (_tmp9_);
	}
	_tmp10_ = self->priv->_document_structure;
	_tmp11_ = document_structure_get_parsing_done (_tmp10_);
	_tmp12_ = _tmp11_;
	if (_tmp12_) {
		structure_on_parsing_done (self);
	} else {
		DocumentStructure* _tmp13_ = NULL;
		_tmp13_ = self->priv->_document_structure;
		g_signal_connect_object ((GObject*) _tmp13_, "notify::parsing-done", (GCallback) _structure_on_parsing_done_g_object_notify, self, 0);
	}
}


static void structure_on_parsing_done (Structure* self) {
	DocumentStructure* _tmp0_ = NULL;
	DocumentStructure* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_document_structure;
	g_return_if_fail (_tmp0_ != NULL);
	_tmp1_ = self->priv->_document_structure;
	_tmp2_ = document_structure_get_parsing_done (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_) {
		DocumentStructure* _tmp4_ = NULL;
		StructureModel* _tmp5_ = NULL;
		StructureModel* _tmp6_ = NULL;
		_tmp4_ = self->priv->_document_structure;
		_tmp5_ = document_structure_get_model (_tmp4_);
		_tmp6_ = _tmp5_;
		structure_set_model (self, _tmp6_);
		_g_object_unref0 (_tmp6_);
	}
}


static void structure_set_model (Structure* self, StructureModel* model) {
	StructureModel* _tmp0_ = NULL;
	StructureModel* _tmp2_ = NULL;
	StructureModel* _tmp3_ = NULL;
	GtkTreeView* _tmp4_ = NULL;
	StructureModel* _tmp5_ = NULL;
	gboolean _tmp6_ = FALSE;
	StructureModel* _tmp7_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = model;
	if (_tmp0_ != NULL) {
		StructureModel* _tmp1_ = NULL;
		_tmp1_ = model;
		structure_model_set_emit_signals (_tmp1_, TRUE);
	}
	_tmp2_ = model;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_g_object_unref0 (self->priv->_model);
	self->priv->_model = _tmp3_;
	_tmp4_ = self->priv->_tree_view;
	_tmp5_ = model;
	gtk_tree_view_set_model (_tmp4_, (GtkTreeModel*) _tmp5_);
	_tmp7_ = model;
	if (_tmp7_ != NULL) {
		StructureModel* _tmp8_ = NULL;
		guint _tmp9_ = 0U;
		_tmp8_ = model;
		_tmp9_ = structure_model_get_nb_items (_tmp8_);
		_tmp6_ = _tmp9_ <= ((guint) 2000);
	} else {
		_tmp6_ = FALSE;
	}
	if (_tmp6_) {
		GtkTreeView* _tmp10_ = NULL;
		_tmp10_ = self->priv->_tree_view;
		gtk_tree_view_expand_all (_tmp10_);
	}
	structure_populate_simple_list (self);
}


static void _structure_show_active_document_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	structure_show_active_document ((Structure*) self);
}


void structure_connect_parsing (Structure* self) {
	MainWindow* _tmp0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_main_window;
	g_signal_connect_object ((GObject*) _tmp0_, "notify::active-document", (GCallback) _structure_show_active_document_g_object_notify, self, 0);
	structure_show_active_document (self);
}


void structure_disconnect_parsing (Structure* self) {
	MainWindow* _tmp0_ = NULL;
	guint _tmp1_ = 0U;
	GQuark _tmp2_ = 0U;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_main_window;
	g_signal_parse_name ("notify::active-document", G_TYPE_OBJECT, &_tmp1_, &_tmp2_, TRUE);
	g_signal_handlers_disconnect_matched ((GObject*) _tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, _tmp2_, NULL, (GCallback) _structure_show_active_document_g_object_notify, self);
}


gboolean structure_is_section (StructType type) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	StructType _tmp1_ = 0;
	_tmp1_ = type;
	if (STRUCT_TYPE_PART <= _tmp1_) {
		StructType _tmp2_ = 0;
		_tmp2_ = type;
		_tmp0_ = _tmp2_ <= STRUCT_TYPE_SUBPARAGRAPH;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}


gboolean structure_is_common_type (StructType type) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	StructType _tmp1_ = 0;
	_tmp1_ = type;
	if (STRUCT_TYPE_BEGIN_COMMON_TYPES < _tmp1_) {
		StructType _tmp2_ = 0;
		_tmp2_ = type;
		_tmp0_ = _tmp2_ < STRUCT_TYPE_END_COMMON_TYPES;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}


/*************************************************************************/
void structure_do_action (Structure* self, StructAction action_type) {
	GtkTreeIter selected_iter = {0};
	gint selected_row = 0;
	GtkTreeView* _tmp0_ = NULL;
	GtkTreeIter _tmp1_ = {0};
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
	StructAction _tmp4_ = 0;
	gboolean refresh_simple_list = FALSE;
	gboolean _tmp25_ = FALSE;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_tree_view;
	_tmp2_ = utils_get_selected_row (_tmp0_, &_tmp1_);
	selected_iter = _tmp1_;
	selected_row = _tmp2_;
	_tmp3_ = selected_row;
	g_return_if_fail (_tmp3_ != (-1));
	_tmp4_ = action_type;
	if (_tmp4_ == STRUCT_ACTION_OPEN_FILE) {
		GtkTreeIter _tmp5_ = {0};
		_tmp5_ = selected_iter;
		structure_open_referenced_file (self, &_tmp5_);
		return;
	}
	refresh_simple_list = FALSE;
	{
		DocumentStructure* _tmp6_ = NULL;
		StructAction _tmp7_ = 0;
		GtkTreeIter _tmp8_ = {0};
		gboolean _tmp9_ = FALSE;
		_tmp6_ = self->priv->_document_structure;
		_tmp7_ = action_type;
		_tmp8_ = selected_iter;
		document_structure_do_action (_tmp6_, _tmp7_, &_tmp8_, &_tmp9_, &_inner_error_);
		refresh_simple_list = _tmp9_;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			if (_inner_error_->domain == STRUCT_ERROR) {
				goto __catch43_struct_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return;
		}
	}
	goto __finally43;
	__catch43_struct_error:
	{
		GError* e = NULL;
		GtkMessageDialog* dialog = NULL;
		MainWindow* _tmp10_ = NULL;
		const gchar* _tmp11_ = NULL;
		StructAction _tmp12_ = 0;
		gchar* _tmp13_ = NULL;
		gchar* _tmp14_ = NULL;
		GtkMessageDialog* _tmp15_ = NULL;
		GtkMessageDialog* _tmp16_ = NULL;
		GError* _tmp17_ = NULL;
		GtkMessageDialog* _tmp23_ = NULL;
		GtkMessageDialog* _tmp24_ = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp10_ = self->priv->_main_window;
		_tmp11_ = _ ("Structure action error: %s");
		_tmp12_ = action_type;
		_tmp13_ = structure_get_action_name (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp15_ = (GtkMessageDialog*) gtk_message_dialog_new ((GtkWindow*) _tmp10_, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, _tmp11_, _tmp14_);
		g_object_ref_sink (_tmp15_);
		_tmp16_ = _tmp15_;
		_g_free0 (_tmp14_);
		dialog = _tmp16_;
		_tmp17_ = e;
		if (g_error_matches (_tmp17_, STRUCT_ERROR, STRUCT_ERROR_DATA_OUTDATED)) {
			GtkMessageDialog* _tmp18_ = NULL;
			const gchar* _tmp19_ = NULL;
			_tmp18_ = dialog;
			_tmp19_ = _ ("The structure data seems outdated. Please refresh the structure.");
			g_object_set (_tmp18_, "secondary-text", _tmp19_, NULL);
		} else {
			GtkMessageDialog* _tmp20_ = NULL;
			GError* _tmp21_ = NULL;
			const gchar* _tmp22_ = NULL;
			_tmp20_ = dialog;
			_tmp21_ = e;
			_tmp22_ = _tmp21_->message;
			g_object_set (_tmp20_, "secondary-text", _tmp22_, NULL);
		}
		_tmp23_ = dialog;
		gtk_dialog_run ((GtkDialog*) _tmp23_);
		_tmp24_ = dialog;
		gtk_widget_destroy ((GtkWidget*) _tmp24_);
		_g_object_unref0 (dialog);
		_g_error_free0 (e);
		return;
	}
	__finally43:
	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;
	}
	_tmp25_ = refresh_simple_list;
	if (_tmp25_) {
		structure_populate_simple_list (self);
	}
}


static void structure_open_referenced_file (Structure* self, GtkTreeIter* iter) {
	MainWindow* _tmp0_ = NULL;
	Document* _tmp1_ = NULL;
	Document* _tmp2_ = NULL;
	StructType type = 0;
	gchar* filename = NULL;
	StructureModel* _tmp3_ = NULL;
	GtkTreeIter _tmp4_ = {0};
	GFile* doc_location = NULL;
	MainWindow* _tmp5_ = NULL;
	Document* _tmp6_ = NULL;
	Document* _tmp7_ = NULL;
	GFile* _tmp8_ = NULL;
	GFile* _tmp9_ = NULL;
	GFile* _tmp10_ = NULL;
	GFile* _tmp11_ = NULL;
	GFile* parent = NULL;
	GFile* _tmp12_ = NULL;
	GFile* _tmp13_ = NULL;
	GFile* _tmp14_ = NULL;
	GFile* referenced_file = NULL;
	GFile* _tmp15_ = NULL;
	const gchar* _tmp16_ = NULL;
	GFile* _tmp17_ = NULL;
	StructType _tmp18_ = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (iter != NULL);
	_tmp0_ = self->priv->_main_window;
	_tmp1_ = main_window_get_active_document (_tmp0_);
	_tmp2_ = _tmp1_;
	g_return_if_fail (_tmp2_ != NULL);
	_tmp3_ = self->priv->_model;
	_tmp4_ = *iter;
	gtk_tree_model_get ((GtkTreeModel*) _tmp3_, &_tmp4_, STRUCT_COLUMN_TYPE, &type, STRUCT_COLUMN_TEXT, &filename, -1);
	_tmp5_ = self->priv->_main_window;
	_tmp6_ = main_window_get_active_document (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = document_get_location (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = _g_object_ref0 (_tmp9_);
	doc_location = _tmp10_;
	_tmp11_ = doc_location;
	if (_tmp11_ == NULL) {
		_g_object_unref0 (doc_location);
		_g_free0 (filename);
		return;
	}
	_tmp12_ = doc_location;
	_tmp13_ = g_file_get_parent (_tmp12_);
	parent = _tmp13_;
	_tmp14_ = parent;
	g_return_if_fail (_tmp14_ != NULL);
	_tmp15_ = parent;
	_tmp16_ = filename;
	_tmp17_ = g_file_get_child (_tmp15_, _tmp16_);
	referenced_file = _tmp17_;
	_tmp18_ = type;
	switch (_tmp18_) {
		case STRUCT_TYPE_INCLUDE:
		{
			GFile* _tmp19_ = NULL;
			_tmp19_ = referenced_file;
			structure_open_included_file (self, _tmp19_);
			break;
		}
		case STRUCT_TYPE_IMAGE:
		{
			GFile* _tmp20_ = NULL;
			_tmp20_ = referenced_file;
			structure_open_image (self, _tmp20_);
			break;
		}
		default:
		{
			g_return_if_reached ();
		}
	}
	_g_object_unref0 (referenced_file);
	_g_object_unref0 (parent);
	_g_object_unref0 (doc_location);
	_g_free0 (filename);
}


static void structure_open_included_file (Structure* self, GFile* referenced_file) {
	GFile* file_to_open = NULL;
	GFile* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	MainWindow* _tmp15_ = NULL;
	GFile* _tmp16_ = NULL;
	DocumentTab* _tmp17_ = NULL;
	DocumentTab* _tmp18_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (referenced_file != NULL);
	_tmp0_ = referenced_file;
	_tmp1_ = g_file_query_exists (_tmp0_, NULL);
	if (_tmp1_) {
		GFile* _tmp2_ = NULL;
		GFile* _tmp3_ = NULL;
		_tmp2_ = referenced_file;
		_tmp3_ = _g_object_ref0 (_tmp2_);
		_g_object_unref0 (file_to_open);
		file_to_open = _tmp3_;
	} else {
		gchar* uri = NULL;
		GFile* _tmp4_ = NULL;
		gchar* _tmp5_ = NULL;
		const gchar* _tmp6_ = NULL;
		gchar* _tmp7_ = NULL;
		gchar* _tmp8_ = NULL;
		GFile* _tmp9_ = NULL;
		GFile* _tmp10_ = NULL;
		gboolean _tmp11_ = FALSE;
		_tmp4_ = referenced_file;
		_tmp5_ = g_file_get_uri (_tmp4_);
		uri = _tmp5_;
		_tmp6_ = uri;
		_tmp7_ = g_strconcat (_tmp6_, ".tex", NULL);
		_tmp8_ = _tmp7_;
		_tmp9_ = g_file_new_for_uri (_tmp8_);
		_g_object_unref0 (file_to_open);
		file_to_open = _tmp9_;
		_g_free0 (_tmp8_);
		_tmp10_ = file_to_open;
		_tmp11_ = g_file_query_exists (_tmp10_, NULL);
		if (!_tmp11_) {
			GFile* _tmp12_ = NULL;
			gchar* _tmp13_ = NULL;
			gchar* _tmp14_ = NULL;
			_tmp12_ = file_to_open;
			_tmp13_ = g_file_get_parse_name (_tmp12_);
			_tmp14_ = _tmp13_;
			g_warning ("structure.vala:702: Structure: the file '%s' doesn't exist.", _tmp14_);
			_g_free0 (_tmp14_);
			_g_free0 (uri);
			_g_object_unref0 (file_to_open);
			return;
		}
		_g_free0 (uri);
	}
	_tmp15_ = self->priv->_main_window;
	_tmp16_ = file_to_open;
	_tmp17_ = main_window_open_document (_tmp15_, _tmp16_, TRUE);
	_tmp18_ = _tmp17_;
	_g_object_unref0 (_tmp18_);
	_g_object_unref0 (file_to_open);
}


static void structure_open_image (Structure* self, GFile* referenced_file) {
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (referenced_file != NULL);
	{
		GdkScreen* _tmp0_ = NULL;
		GFile* _tmp1_ = NULL;
		gchar* _tmp2_ = NULL;
		gchar* _tmp3_ = NULL;
		_tmp0_ = gtk_widget_get_screen ((GtkWidget*) self);
		_tmp1_ = referenced_file;
		_tmp2_ = g_file_get_uri (_tmp1_);
		_tmp3_ = _tmp2_;
		latexila_utils_show_uri (_tmp0_, _tmp3_, &_inner_error_);
		_g_free0 (_tmp3_);
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			goto __catch44_g_error;
		}
	}
	goto __finally44;
	__catch44_g_error:
	{
		GError* e = NULL;
		GError* _tmp4_ = NULL;
		const gchar* _tmp5_ = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp4_ = e;
		_tmp5_ = _tmp4_->message;
		g_warning ("structure.vala:719: Structure: can not open image: %s", _tmp5_);
		_g_error_free0 (e);
	}
	__finally44:
	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 gchar* structure_get_action_name (StructAction action_type) {
	gchar* result = NULL;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gchar** _tmp34_ = NULL;
	gint _tmp34__length1 = 0;
	StructAction _tmp35_ = 0;
	const gchar* _tmp36_ = NULL;
	gchar* _tmp37_ = NULL;
	_tmp0_ = structure__action_names;
	_tmp0__length1 = structure__action_names_length1;
	if (_tmp0_ == NULL) {
		gchar** _tmp1_ = NULL;
		gchar** _tmp2_ = NULL;
		gint _tmp2__length1 = 0;
		const gchar* _tmp3_ = NULL;
		gchar* _tmp4_ = NULL;
		gchar* _tmp5_ = NULL;
		gchar** _tmp6_ = NULL;
		gint _tmp6__length1 = 0;
		const gchar* _tmp7_ = NULL;
		gchar* _tmp8_ = NULL;
		gchar* _tmp9_ = NULL;
		gchar** _tmp10_ = NULL;
		gint _tmp10__length1 = 0;
		const gchar* _tmp11_ = NULL;
		gchar* _tmp12_ = NULL;
		gchar* _tmp13_ = NULL;
		gchar** _tmp14_ = NULL;
		gint _tmp14__length1 = 0;
		const gchar* _tmp15_ = NULL;
		gchar* _tmp16_ = NULL;
		gchar* _tmp17_ = NULL;
		gchar** _tmp18_ = NULL;
		gint _tmp18__length1 = 0;
		const gchar* _tmp19_ = NULL;
		gchar* _tmp20_ = NULL;
		gchar* _tmp21_ = NULL;
		gchar** _tmp22_ = NULL;
		gint _tmp22__length1 = 0;
		const gchar* _tmp23_ = NULL;
		gchar* _tmp24_ = NULL;
		gchar* _tmp25_ = NULL;
		gchar** _tmp26_ = NULL;
		gint _tmp26__length1 = 0;
		const gchar* _tmp27_ = NULL;
		gchar* _tmp28_ = NULL;
		gchar* _tmp29_ = NULL;
		gchar** _tmp30_ = NULL;
		gint _tmp30__length1 = 0;
		const gchar* _tmp31_ = NULL;
		gchar* _tmp32_ = NULL;
		gchar* _tmp33_ = NULL;
		_tmp1_ = g_new0 (gchar*, STRUCT_ACTION_NB_ACTIONS + 1);
		structure__action_names = (_vala_array_free (structure__action_names, structure__action_names_length1, (GDestroyNotify) g_free), NULL);
		structure__action_names = _tmp1_;
		structure__action_names_length1 = STRUCT_ACTION_NB_ACTIONS;
		_structure__action_names_size_ = structure__action_names_length1;
		_tmp2_ = structure__action_names;
		_tmp2__length1 = structure__action_names_length1;
		_tmp3_ = _ ("cut");
		_tmp4_ = g_strdup (_tmp3_);
		_g_free0 (_tmp2_[STRUCT_ACTION_CUT]);
		_tmp2_[STRUCT_ACTION_CUT] = _tmp4_;
		_tmp5_ = _tmp2_[STRUCT_ACTION_CUT];
		_tmp6_ = structure__action_names;
		_tmp6__length1 = structure__action_names_length1;
		_tmp7_ = _ ("copy");
		_tmp8_ = g_strdup (_tmp7_);
		_g_free0 (_tmp6_[STRUCT_ACTION_COPY]);
		_tmp6_[STRUCT_ACTION_COPY] = _tmp8_;
		_tmp9_ = _tmp6_[STRUCT_ACTION_COPY];
		_tmp10_ = structure__action_names;
		_tmp10__length1 = structure__action_names_length1;
		_tmp11_ = _ ("delete");
		_tmp12_ = g_strdup (_tmp11_);
		_g_free0 (_tmp10_[STRUCT_ACTION_DELETE]);
		_tmp10_[STRUCT_ACTION_DELETE] = _tmp12_;
		_tmp13_ = _tmp10_[STRUCT_ACTION_DELETE];
		_tmp14_ = structure__action_names;
		_tmp14__length1 = structure__action_names_length1;
		_tmp15_ = _ ("select");
		_tmp16_ = g_strdup (_tmp15_);
		_g_free0 (_tmp14_[STRUCT_ACTION_SELECT]);
		_tmp14_[STRUCT_ACTION_SELECT] = _tmp16_;
		_tmp17_ = _tmp14_[STRUCT_ACTION_SELECT];
		_tmp18_ = structure__action_names;
		_tmp18__length1 = structure__action_names_length1;
		_tmp19_ = _ ("comment");
		_tmp20_ = g_strdup (_tmp19_);
		_g_free0 (_tmp18_[STRUCT_ACTION_COMMENT]);
		_tmp18_[STRUCT_ACTION_COMMENT] = _tmp20_;
		_tmp21_ = _tmp18_[STRUCT_ACTION_COMMENT];
		_tmp22_ = structure__action_names;
		_tmp22__length1 = structure__action_names_length1;
		_tmp23_ = _ ("shift left");
		_tmp24_ = g_strdup (_tmp23_);
		_g_free0 (_tmp22_[STRUCT_ACTION_SHIFT_LEFT]);
		_tmp22_[STRUCT_ACTION_SHIFT_LEFT] = _tmp24_;
		_tmp25_ = _tmp22_[STRUCT_ACTION_SHIFT_LEFT];
		_tmp26_ = structure__action_names;
		_tmp26__length1 = structure__action_names_length1;
		_tmp27_ = _ ("shift right");
		_tmp28_ = g_strdup (_tmp27_);
		_g_free0 (_tmp26_[STRUCT_ACTION_SHIFT_RIGHT]);
		_tmp26_[STRUCT_ACTION_SHIFT_RIGHT] = _tmp28_;
		_tmp29_ = _tmp26_[STRUCT_ACTION_SHIFT_RIGHT];
		_tmp30_ = structure__action_names;
		_tmp30__length1 = structure__action_names_length1;
		_tmp31_ = _ ("open file");
		_tmp32_ = g_strdup (_tmp31_);
		_g_free0 (_tmp30_[STRUCT_ACTION_OPEN_FILE]);
		_tmp30_[STRUCT_ACTION_OPEN_FILE] = _tmp32_;
		_tmp33_ = _tmp30_[STRUCT_ACTION_OPEN_FILE];
	}
	_tmp34_ = structure__action_names;
	_tmp34__length1 = structure__action_names_length1;
	_tmp35_ = action_type;
	_tmp36_ = _tmp34_[_tmp35_];
	_tmp37_ = g_strdup (_tmp36_);
	result = _tmp37_;
	return result;
}


gchar* structure_get_icon_from_type (StructType type) {
	gchar* result = NULL;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gchar** _tmp44_ = NULL;
	gint _tmp44__length1 = 0;
	StructType _tmp45_ = 0;
	const gchar* _tmp46_ = NULL;
	gchar* _tmp47_ = NULL;
	_tmp0_ = structure__icons;
	_tmp0__length1 = structure__icons_length1;
	if (_tmp0_ == NULL) {
		gchar** _tmp1_ = NULL;
		gchar** _tmp2_ = NULL;
		gint _tmp2__length1 = 0;
		gchar* _tmp3_ = NULL;
		gchar* _tmp4_ = NULL;
		gchar** _tmp5_ = NULL;
		gint _tmp5__length1 = 0;
		gchar* _tmp6_ = NULL;
		gchar* _tmp7_ = NULL;
		gchar** _tmp8_ = NULL;
		gint _tmp8__length1 = 0;
		gchar* _tmp9_ = NULL;
		gchar* _tmp10_ = NULL;
		gchar** _tmp11_ = NULL;
		gint _tmp11__length1 = 0;
		gchar* _tmp12_ = NULL;
		gchar* _tmp13_ = NULL;
		gchar** _tmp14_ = NULL;
		gint _tmp14__length1 = 0;
		gchar* _tmp15_ = NULL;
		gchar* _tmp16_ = NULL;
		gchar** _tmp17_ = NULL;
		gint _tmp17__length1 = 0;
		gchar* _tmp18_ = NULL;
		gchar* _tmp19_ = NULL;
		gchar** _tmp20_ = NULL;
		gint _tmp20__length1 = 0;
		gchar* _tmp21_ = NULL;
		gchar* _tmp22_ = NULL;
		gchar** _tmp23_ = NULL;
		gint _tmp23__length1 = 0;
		gchar* _tmp24_ = NULL;
		gchar* _tmp25_ = NULL;
		gchar** _tmp26_ = NULL;
		gint _tmp26__length1 = 0;
		gchar* _tmp27_ = NULL;
		gchar* _tmp28_ = NULL;
		gchar** _tmp29_ = NULL;
		gint _tmp29__length1 = 0;
		gchar* _tmp30_ = NULL;
		gchar* _tmp31_ = NULL;
		gchar** _tmp32_ = NULL;
		gint _tmp32__length1 = 0;
		gchar* _tmp33_ = NULL;
		gchar* _tmp34_ = NULL;
		gchar** _tmp35_ = NULL;
		gint _tmp35__length1 = 0;
		gchar* _tmp36_ = NULL;
		gchar* _tmp37_ = NULL;
		gchar** _tmp38_ = NULL;
		gint _tmp38__length1 = 0;
		gchar* _tmp39_ = NULL;
		gchar* _tmp40_ = NULL;
		gchar** _tmp41_ = NULL;
		gint _tmp41__length1 = 0;
		gchar* _tmp42_ = NULL;
		gchar* _tmp43_ = NULL;
		_tmp1_ = g_new0 (gchar*, STRUCT_TYPE_NB_TYPES + 1);
		structure__icons = (_vala_array_free (structure__icons, structure__icons_length1, (GDestroyNotify) g_free), NULL);
		structure__icons = _tmp1_;
		structure__icons_length1 = STRUCT_TYPE_NB_TYPES;
		_structure__icons_size_ = structure__icons_length1;
		_tmp2_ = structure__icons;
		_tmp2__length1 = structure__icons_length1;
		_tmp3_ = g_strdup ("tree_part");
		_g_free0 (_tmp2_[STRUCT_TYPE_PART]);
		_tmp2_[STRUCT_TYPE_PART] = _tmp3_;
		_tmp4_ = _tmp2_[STRUCT_TYPE_PART];
		_tmp5_ = structure__icons;
		_tmp5__length1 = structure__icons_length1;
		_tmp6_ = g_strdup ("tree_chapter");
		_g_free0 (_tmp5_[STRUCT_TYPE_CHAPTER]);
		_tmp5_[STRUCT_TYPE_CHAPTER] = _tmp6_;
		_tmp7_ = _tmp5_[STRUCT_TYPE_CHAPTER];
		_tmp8_ = structure__icons;
		_tmp8__length1 = structure__icons_length1;
		_tmp9_ = g_strdup ("tree_section");
		_g_free0 (_tmp8_[STRUCT_TYPE_SECTION]);
		_tmp8_[STRUCT_TYPE_SECTION] = _tmp9_;
		_tmp10_ = _tmp8_[STRUCT_TYPE_SECTION];
		_tmp11_ = structure__icons;
		_tmp11__length1 = structure__icons_length1;
		_tmp12_ = g_strdup ("tree_subsection");
		_g_free0 (_tmp11_[STRUCT_TYPE_SUBSECTION]);
		_tmp11_[STRUCT_TYPE_SUBSECTION] = _tmp12_;
		_tmp13_ = _tmp11_[STRUCT_TYPE_SUBSECTION];
		_tmp14_ = structure__icons;
		_tmp14__length1 = structure__icons_length1;
		_tmp15_ = g_strdup ("tree_subsubsection");
		_g_free0 (_tmp14_[STRUCT_TYPE_SUBSUBSECTION]);
		_tmp14_[STRUCT_TYPE_SUBSUBSECTION] = _tmp15_;
		_tmp16_ = _tmp14_[STRUCT_TYPE_SUBSUBSECTION];
		_tmp17_ = structure__icons;
		_tmp17__length1 = structure__icons_length1;
		_tmp18_ = g_strdup ("tree_paragraph");
		_g_free0 (_tmp17_[STRUCT_TYPE_PARAGRAPH]);
		_tmp17_[STRUCT_TYPE_PARAGRAPH] = _tmp18_;
		_tmp19_ = _tmp17_[STRUCT_TYPE_PARAGRAPH];
		_tmp20_ = structure__icons;
		_tmp20__length1 = structure__icons_length1;
		_tmp21_ = g_strdup ("tree_paragraph");
		_g_free0 (_tmp20_[STRUCT_TYPE_SUBPARAGRAPH]);
		_tmp20_[STRUCT_TYPE_SUBPARAGRAPH] = _tmp21_;
		_tmp22_ = _tmp20_[STRUCT_TYPE_SUBPARAGRAPH];
		_tmp23_ = structure__icons;
		_tmp23__length1 = structure__icons_length1;
		_tmp24_ = g_strdup ("tree_label");
		_g_free0 (_tmp23_[STRUCT_TYPE_LABEL]);
		_tmp23_[STRUCT_TYPE_LABEL] = _tmp24_;
		_tmp25_ = _tmp23_[STRUCT_TYPE_LABEL];
		_tmp26_ = structure__icons;
		_tmp26__length1 = structure__icons_length1;
		_tmp27_ = g_strdup ("tree_todo");
		_g_free0 (_tmp26_[STRUCT_TYPE_TODO]);
		_tmp26_[STRUCT_TYPE_TODO] = _tmp27_;
		_tmp28_ = _tmp26_[STRUCT_TYPE_TODO];
		_tmp29_ = structure__icons;
		_tmp29__length1 = structure__icons_length1;
		_tmp30_ = g_strdup ("tree_todo");
		_g_free0 (_tmp29_[STRUCT_TYPE_FIXME]);
		_tmp29_[STRUCT_TYPE_FIXME] = _tmp30_;
		_tmp31_ = _tmp29_[STRUCT_TYPE_FIXME];
		_tmp32_ = structure__icons;
		_tmp32__length1 = structure__icons_length1;
		_tmp33_ = g_strdup ("table-size16");
		_g_free0 (_tmp32_[STRUCT_TYPE_TABLE]);
		_tmp32_[STRUCT_TYPE_TABLE] = _tmp33_;
		_tmp34_ = _tmp32_[STRUCT_TYPE_TABLE];
		_tmp35_ = structure__icons;
		_tmp35__length1 = structure__icons_length1;
		_tmp36_ = g_strdup ("image");
		_g_free0 (_tmp35_[STRUCT_TYPE_FIGURE]);
		_tmp35_[STRUCT_TYPE_FIGURE] = _tmp36_;
		_tmp37_ = _tmp35_[STRUCT_TYPE_FIGURE];
		_tmp38_ = structure__icons;
		_tmp38__length1 = structure__icons_length1;
		_tmp39_ = g_strdup ("image");
		_g_free0 (_tmp38_[STRUCT_TYPE_IMAGE]);
		_tmp38_[STRUCT_TYPE_IMAGE] = _tmp39_;
		_tmp40_ = _tmp38_[STRUCT_TYPE_IMAGE];
		_tmp41_ = structure__icons;
		_tmp41__length1 = structure__icons_length1;
		_tmp42_ = g_strdup (GTK_STOCK_FILE);
		_g_free0 (_tmp41_[STRUCT_TYPE_INCLUDE]);
		_tmp41_[STRUCT_TYPE_INCLUDE] = _tmp42_;
		_tmp43_ = _tmp41_[STRUCT_TYPE_INCLUDE];
	}
	_tmp44_ = structure__icons;
	_tmp44__length1 = structure__icons_length1;
	_tmp45_ = type;
	_tmp46_ = _tmp44_[_tmp45_];
	_tmp47_ = g_strdup (_tmp46_);
	result = _tmp47_;
	return result;
}


gchar* structure_get_type_name (StructType type) {
	gchar* result = NULL;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gchar** _tmp56_ = NULL;
	gint _tmp56__length1 = 0;
	StructType _tmp57_ = 0;
	const gchar* _tmp58_ = NULL;
	gchar* _tmp59_ = NULL;
	_tmp0_ = structure__names;
	_tmp0__length1 = structure__names_length1;
	if (_tmp0_ == NULL) {
		gchar** _tmp1_ = NULL;
		gchar** _tmp2_ = NULL;
		gint _tmp2__length1 = 0;
		const gchar* _tmp3_ = NULL;
		gchar* _tmp4_ = NULL;
		gchar* _tmp5_ = NULL;
		gchar** _tmp6_ = NULL;
		gint _tmp6__length1 = 0;
		const gchar* _tmp7_ = NULL;
		gchar* _tmp8_ = NULL;
		gchar* _tmp9_ = NULL;
		gchar** _tmp10_ = NULL;
		gint _tmp10__length1 = 0;
		const gchar* _tmp11_ = NULL;
		gchar* _tmp12_ = NULL;
		gchar* _tmp13_ = NULL;
		gchar** _tmp14_ = NULL;
		gint _tmp14__length1 = 0;
		const gchar* _tmp15_ = NULL;
		gchar* _tmp16_ = NULL;
		gchar* _tmp17_ = NULL;
		gchar** _tmp18_ = NULL;
		gint _tmp18__length1 = 0;
		const gchar* _tmp19_ = NULL;
		gchar* _tmp20_ = NULL;
		gchar* _tmp21_ = NULL;
		gchar** _tmp22_ = NULL;
		gint _tmp22__length1 = 0;
		const gchar* _tmp23_ = NULL;
		gchar* _tmp24_ = NULL;
		gchar* _tmp25_ = NULL;
		gchar** _tmp26_ = NULL;
		gint _tmp26__length1 = 0;
		const gchar* _tmp27_ = NULL;
		gchar* _tmp28_ = NULL;
		gchar* _tmp29_ = NULL;
		gchar** _tmp30_ = NULL;
		gint _tmp30__length1 = 0;
		const gchar* _tmp31_ = NULL;
		gchar* _tmp32_ = NULL;
		gchar* _tmp33_ = NULL;
		gchar** _tmp34_ = NULL;
		gint _tmp34__length1 = 0;
		gchar* _tmp35_ = NULL;
		gchar* _tmp36_ = NULL;
		gchar** _tmp37_ = NULL;
		gint _tmp37__length1 = 0;
		gchar* _tmp38_ = NULL;
		gchar* _tmp39_ = NULL;
		gchar** _tmp40_ = NULL;
		gint _tmp40__length1 = 0;
		const gchar* _tmp41_ = NULL;
		gchar* _tmp42_ = NULL;
		gchar* _tmp43_ = NULL;
		gchar** _tmp44_ = NULL;
		gint _tmp44__length1 = 0;
		const gchar* _tmp45_ = NULL;
		gchar* _tmp46_ = NULL;
		gchar* _tmp47_ = NULL;
		gchar** _tmp48_ = NULL;
		gint _tmp48__length1 = 0;
		const gchar* _tmp49_ = NULL;
		gchar* _tmp50_ = NULL;
		gchar* _tmp51_ = NULL;
		gchar** _tmp52_ = NULL;
		gint _tmp52__length1 = 0;
		const gchar* _tmp53_ = NULL;
		gchar* _tmp54_ = NULL;
		gchar* _tmp55_ = NULL;
		_tmp1_ = g_new0 (gchar*, STRUCT_TYPE_NB_TYPES + 1);
		structure__names = (_vala_array_free (structure__names, structure__names_length1, (GDestroyNotify) g_free), NULL);
		structure__names = _tmp1_;
		structure__names_length1 = STRUCT_TYPE_NB_TYPES;
		_structure__names_size_ = structure__names_length1;
		_tmp2_ = structure__names;
		_tmp2__length1 = structure__names_length1;
		_tmp3_ = _ ("Part");
		_tmp4_ = g_strdup (_tmp3_);
		_g_free0 (_tmp2_[STRUCT_TYPE_PART]);
		_tmp2_[STRUCT_TYPE_PART] = _tmp4_;
		_tmp5_ = _tmp2_[STRUCT_TYPE_PART];
		_tmp6_ = structure__names;
		_tmp6__length1 = structure__names_length1;
		_tmp7_ = _ ("Chapter");
		_tmp8_ = g_strdup (_tmp7_);
		_g_free0 (_tmp6_[STRUCT_TYPE_CHAPTER]);
		_tmp6_[STRUCT_TYPE_CHAPTER] = _tmp8_;
		_tmp9_ = _tmp6_[STRUCT_TYPE_CHAPTER];
		_tmp10_ = structure__names;
		_tmp10__length1 = structure__names_length1;
		_tmp11_ = _ ("Section");
		_tmp12_ = g_strdup (_tmp11_);
		_g_free0 (_tmp10_[STRUCT_TYPE_SECTION]);
		_tmp10_[STRUCT_TYPE_SECTION] = _tmp12_;
		_tmp13_ = _tmp10_[STRUCT_TYPE_SECTION];
		_tmp14_ = structure__names;
		_tmp14__length1 = structure__names_length1;
		_tmp15_ = _ ("Sub-section");
		_tmp16_ = g_strdup (_tmp15_);
		_g_free0 (_tmp14_[STRUCT_TYPE_SUBSECTION]);
		_tmp14_[STRUCT_TYPE_SUBSECTION] = _tmp16_;
		_tmp17_ = _tmp14_[STRUCT_TYPE_SUBSECTION];
		_tmp18_ = structure__names;
		_tmp18__length1 = structure__names_length1;
		_tmp19_ = _ ("Sub-sub-section");
		_tmp20_ = g_strdup (_tmp19_);
		_g_free0 (_tmp18_[STRUCT_TYPE_SUBSUBSECTION]);
		_tmp18_[STRUCT_TYPE_SUBSUBSECTION] = _tmp20_;
		_tmp21_ = _tmp18_[STRUCT_TYPE_SUBSUBSECTION];
		_tmp22_ = structure__names;
		_tmp22__length1 = structure__names_length1;
		_tmp23_ = _ ("Paragraph");
		_tmp24_ = g_strdup (_tmp23_);
		_g_free0 (_tmp22_[STRUCT_TYPE_PARAGRAPH]);
		_tmp22_[STRUCT_TYPE_PARAGRAPH] = _tmp24_;
		_tmp25_ = _tmp22_[STRUCT_TYPE_PARAGRAPH];
		_tmp26_ = structure__names;
		_tmp26__length1 = structure__names_length1;
		_tmp27_ = _ ("Sub-paragraph");
		_tmp28_ = g_strdup (_tmp27_);
		_g_free0 (_tmp26_[STRUCT_TYPE_SUBPARAGRAPH]);
		_tmp26_[STRUCT_TYPE_SUBPARAGRAPH] = _tmp28_;
		_tmp29_ = _tmp26_[STRUCT_TYPE_SUBPARAGRAPH];
		_tmp30_ = structure__names;
		_tmp30__length1 = structure__names_length1;
		_tmp31_ = _ ("Label");
		_tmp32_ = g_strdup (_tmp31_);
		_g_free0 (_tmp30_[STRUCT_TYPE_LABEL]);
		_tmp30_[STRUCT_TYPE_LABEL] = _tmp32_;
		_tmp33_ = _tmp30_[STRUCT_TYPE_LABEL];
		_tmp34_ = structure__names;
		_tmp34__length1 = structure__names_length1;
		_tmp35_ = g_strdup ("TODO");
		_g_free0 (_tmp34_[STRUCT_TYPE_TODO]);
		_tmp34_[STRUCT_TYPE_TODO] = _tmp35_;
		_tmp36_ = _tmp34_[STRUCT_TYPE_TODO];
		_tmp37_ = structure__names;
		_tmp37__length1 = structure__names_length1;
		_tmp38_ = g_strdup ("FIXME");
		_g_free0 (_tmp37_[STRUCT_TYPE_FIXME]);
		_tmp37_[STRUCT_TYPE_FIXME] = _tmp38_;
		_tmp39_ = _tmp37_[STRUCT_TYPE_FIXME];
		_tmp40_ = structure__names;
		_tmp40__length1 = structure__names_length1;
		_tmp41_ = _ ("Table");
		_tmp42_ = g_strdup (_tmp41_);
		_g_free0 (_tmp40_[STRUCT_TYPE_TABLE]);
		_tmp40_[STRUCT_TYPE_TABLE] = _tmp42_;
		_tmp43_ = _tmp40_[STRUCT_TYPE_TABLE];
		_tmp44_ = structure__names;
		_tmp44__length1 = structure__names_length1;
		_tmp45_ = _ ("Figure");
		_tmp46_ = g_strdup (_tmp45_);
		_g_free0 (_tmp44_[STRUCT_TYPE_FIGURE]);
		_tmp44_[STRUCT_TYPE_FIGURE] = _tmp46_;
		_tmp47_ = _tmp44_[STRUCT_TYPE_FIGURE];
		_tmp48_ = structure__names;
		_tmp48__length1 = structure__names_length1;
		_tmp49_ = _ ("Image");
		_tmp50_ = g_strdup (_tmp49_);
		_g_free0 (_tmp48_[STRUCT_TYPE_IMAGE]);
		_tmp48_[STRUCT_TYPE_IMAGE] = _tmp50_;
		_tmp51_ = _tmp48_[STRUCT_TYPE_IMAGE];
		_tmp52_ = structure__names;
		_tmp52__length1 = structure__names_length1;
		_tmp53_ = _ ("File included");
		_tmp54_ = g_strdup (_tmp53_);
		_g_free0 (_tmp52_[STRUCT_TYPE_INCLUDE]);
		_tmp52_[STRUCT_TYPE_INCLUDE] = _tmp54_;
		_tmp55_ = _tmp52_[STRUCT_TYPE_INCLUDE];
	}
	_tmp56_ = structure__names;
	_tmp56__length1 = structure__names_length1;
	_tmp57_ = type;
	_tmp58_ = _tmp56_[_tmp57_];
	_tmp59_ = g_strdup (_tmp58_);
	result = _tmp59_;
	return result;
}


static void g_cclosure_user_marshal_VOID__BOXED (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
	typedef void (*GMarshalFunc_VOID__BOXED) (gpointer data1, gpointer arg_1, gpointer data2);
	register GMarshalFunc_VOID__BOXED callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 2);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__BOXED) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_boxed (param_values + 1), data2);
}


static void structure_class_init (StructureClass * klass) {
	structure_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (StructurePrivate));
	G_OBJECT_CLASS (klass)->finalize = structure_finalize;
	g_signal_new ("no_items_selected", TYPE_STRUCTURE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	g_signal_new ("item_selected", TYPE_STRUCTURE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__ENUM, G_TYPE_NONE, 1, TYPE_STRUCT_TYPE);
	g_signal_new ("show_popup_menu", TYPE_STRUCTURE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__BOXED, G_TYPE_NONE, 1, gdk_event_get_type ());
}


static void structure_instance_init (Structure * self) {
	GtkToggleToolButton** _tmp0_ = NULL;
	self->priv = STRUCTURE_GET_PRIVATE (self);
	_tmp0_ = g_new0 (GtkToggleToolButton*, 0 + 1);
	self->priv->_simple_list_buttons = _tmp0_;
	self->priv->_simple_list_buttons_length1 = 0;
	self->priv->__simple_list_buttons_size_ = self->priv->_simple_list_buttons_length1;
	self->priv->_document_structure = NULL;
	self->priv->_model = NULL;
	self->priv->_list_is_hidden = TRUE;
	self->priv->_first_select = TRUE;
}


static void structure_finalize (GObject* obj) {
	Structure * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_STRUCTURE, Structure);
	self->priv->_simple_list_buttons = (_vala_array_free (self->priv->_simple_list_buttons, self->priv->_simple_list_buttons_length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (self->priv->_vpaned);
	_g_object_unref0 (self->priv->_tree_view);
	_g_object_unref0 (self->priv->_document_structure);
	_g_object_unref0 (self->priv->_model);
	_g_object_unref0 (self->priv->_list_view);
	_g_object_unref0 (self->priv->_list_view_sw);
	_g_object_unref0 (self->priv->_list_store);
	G_OBJECT_CLASS (structure_parent_class)->finalize (obj);
}


GType structure_get_type (void) {
	static volatile gsize structure_type_id__volatile = 0;
	if (g_once_init_enter (&structure_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (StructureClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) structure_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Structure), 0, (GInstanceInitFunc) structure_instance_init, NULL };
		GType structure_type_id;
		structure_type_id = g_type_register_static (gtk_grid_get_type (), "Structure", &g_define_type_info, 0);
		g_once_init_leave (&structure_type_id__volatile, structure_type_id);
	}
	return structure_type_id__volatile;
}


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);
}



