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

/*
 * This file is part of LaTeXila.
 *
 * Copyright © 2010-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 <gdk/gdk.h>
#include "config.h"
#include <glib/gi18n-lib.h>
#include <latexila.h>
#include <gio/gio.h>
#include <gee.h>
#include <gtksourceview/gtksource.h>
#include <gdk-pixbuf/gdk-pixbuf.h>


#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;
typedef struct _MainWindowPrivate MainWindowPrivate;

#define TYPE_DOCUMENTS_PANEL (documents_panel_get_type ())
#define DOCUMENTS_PANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DOCUMENTS_PANEL, DocumentsPanel))
#define DOCUMENTS_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DOCUMENTS_PANEL, DocumentsPanelClass))
#define IS_DOCUMENTS_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DOCUMENTS_PANEL))
#define IS_DOCUMENTS_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DOCUMENTS_PANEL))
#define DOCUMENTS_PANEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DOCUMENTS_PANEL, DocumentsPanelClass))

typedef struct _DocumentsPanel DocumentsPanel;
typedef struct _DocumentsPanelClass DocumentsPanelClass;

#define TYPE_CUSTOM_STATUSBAR (custom_statusbar_get_type ())
#define CUSTOM_STATUSBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CUSTOM_STATUSBAR, CustomStatusbar))
#define CUSTOM_STATUSBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CUSTOM_STATUSBAR, CustomStatusbarClass))
#define IS_CUSTOM_STATUSBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CUSTOM_STATUSBAR))
#define IS_CUSTOM_STATUSBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CUSTOM_STATUSBAR))
#define CUSTOM_STATUSBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CUSTOM_STATUSBAR, CustomStatusbarClass))

typedef struct _CustomStatusbar CustomStatusbar;
typedef struct _CustomStatusbarClass CustomStatusbarClass;

#define TYPE_GOTO_LINE (goto_line_get_type ())
#define GOTO_LINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_GOTO_LINE, GotoLine))
#define GOTO_LINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GOTO_LINE, GotoLineClass))
#define IS_GOTO_LINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_GOTO_LINE))
#define IS_GOTO_LINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GOTO_LINE))
#define GOTO_LINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_GOTO_LINE, GotoLineClass))

typedef struct _GotoLine GotoLine;
typedef struct _GotoLineClass GotoLineClass;

#define TYPE_SEARCH_AND_REPLACE (search_and_replace_get_type ())
#define SEARCH_AND_REPLACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SEARCH_AND_REPLACE, SearchAndReplace))
#define SEARCH_AND_REPLACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SEARCH_AND_REPLACE, SearchAndReplaceClass))
#define IS_SEARCH_AND_REPLACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SEARCH_AND_REPLACE))
#define IS_SEARCH_AND_REPLACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SEARCH_AND_REPLACE))
#define SEARCH_AND_REPLACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SEARCH_AND_REPLACE, SearchAndReplaceClass))

typedef struct _SearchAndReplace SearchAndReplace;
typedef struct _SearchAndReplaceClass SearchAndReplaceClass;

#define TYPE_MAIN_WINDOW_FILE (main_window_file_get_type ())
#define MAIN_WINDOW_FILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAIN_WINDOW_FILE, MainWindowFile))
#define MAIN_WINDOW_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAIN_WINDOW_FILE, MainWindowFileClass))
#define IS_MAIN_WINDOW_FILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAIN_WINDOW_FILE))
#define IS_MAIN_WINDOW_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAIN_WINDOW_FILE))
#define MAIN_WINDOW_FILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAIN_WINDOW_FILE, MainWindowFileClass))

typedef struct _MainWindowFile MainWindowFile;
typedef struct _MainWindowFileClass MainWindowFileClass;

#define TYPE_MAIN_WINDOW_EDIT (main_window_edit_get_type ())
#define MAIN_WINDOW_EDIT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAIN_WINDOW_EDIT, MainWindowEdit))
#define MAIN_WINDOW_EDIT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAIN_WINDOW_EDIT, MainWindowEditClass))
#define IS_MAIN_WINDOW_EDIT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAIN_WINDOW_EDIT))
#define IS_MAIN_WINDOW_EDIT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAIN_WINDOW_EDIT))
#define MAIN_WINDOW_EDIT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAIN_WINDOW_EDIT, MainWindowEditClass))

typedef struct _MainWindowEdit MainWindowEdit;
typedef struct _MainWindowEditClass MainWindowEditClass;

#define TYPE_MAIN_WINDOW_BUILD_TOOLS (main_window_build_tools_get_type ())
#define MAIN_WINDOW_BUILD_TOOLS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAIN_WINDOW_BUILD_TOOLS, MainWindowBuildTools))
#define MAIN_WINDOW_BUILD_TOOLS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAIN_WINDOW_BUILD_TOOLS, MainWindowBuildToolsClass))
#define IS_MAIN_WINDOW_BUILD_TOOLS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAIN_WINDOW_BUILD_TOOLS))
#define IS_MAIN_WINDOW_BUILD_TOOLS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAIN_WINDOW_BUILD_TOOLS))
#define MAIN_WINDOW_BUILD_TOOLS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAIN_WINDOW_BUILD_TOOLS, MainWindowBuildToolsClass))

typedef struct _MainWindowBuildTools MainWindowBuildTools;
typedef struct _MainWindowBuildToolsClass MainWindowBuildToolsClass;

#define TYPE_MAIN_WINDOW_STRUCTURE (main_window_structure_get_type ())
#define MAIN_WINDOW_STRUCTURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAIN_WINDOW_STRUCTURE, MainWindowStructure))
#define MAIN_WINDOW_STRUCTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAIN_WINDOW_STRUCTURE, MainWindowStructureClass))
#define IS_MAIN_WINDOW_STRUCTURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAIN_WINDOW_STRUCTURE))
#define IS_MAIN_WINDOW_STRUCTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAIN_WINDOW_STRUCTURE))
#define MAIN_WINDOW_STRUCTURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAIN_WINDOW_STRUCTURE, MainWindowStructureClass))

typedef struct _MainWindowStructure MainWindowStructure;
typedef struct _MainWindowStructureClass MainWindowStructureClass;

#define TYPE_MAIN_WINDOW_DOCUMENTS (main_window_documents_get_type ())
#define MAIN_WINDOW_DOCUMENTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAIN_WINDOW_DOCUMENTS, MainWindowDocuments))
#define MAIN_WINDOW_DOCUMENTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAIN_WINDOW_DOCUMENTS, MainWindowDocumentsClass))
#define IS_MAIN_WINDOW_DOCUMENTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAIN_WINDOW_DOCUMENTS))
#define IS_MAIN_WINDOW_DOCUMENTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAIN_WINDOW_DOCUMENTS))
#define MAIN_WINDOW_DOCUMENTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAIN_WINDOW_DOCUMENTS, MainWindowDocumentsClass))

typedef struct _MainWindowDocuments MainWindowDocuments;
typedef struct _MainWindowDocumentsClass MainWindowDocumentsClass;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _main_window_file_unref0(var) ((var == NULL) ? NULL : (var = (main_window_file_unref (var), NULL)))
#define _main_window_edit_unref0(var) ((var == NULL) ? NULL : (var = (main_window_edit_unref (var), NULL)))
#define _main_window_build_tools_unref0(var) ((var == NULL) ? NULL : (var = (main_window_build_tools_unref (var), NULL)))
#define _main_window_structure_unref0(var) ((var == NULL) ? NULL : (var = (main_window_structure_unref (var), NULL)))
#define _main_window_documents_unref0(var) ((var == NULL) ? NULL : (var = (main_window_documents_unref (var), NULL)))

#define TYPE_SIDE_PANEL (side_panel_get_type ())
#define SIDE_PANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SIDE_PANEL, SidePanel))
#define SIDE_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SIDE_PANEL, SidePanelClass))
#define IS_SIDE_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SIDE_PANEL))
#define IS_SIDE_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SIDE_PANEL))
#define SIDE_PANEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SIDE_PANEL, SidePanelClass))

typedef struct _SidePanel SidePanel;
typedef struct _SidePanelClass SidePanelClass;

#define TYPE_BOTTOM_PANEL (bottom_panel_get_type ())
#define BOTTOM_PANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BOTTOM_PANEL, BottomPanel))
#define BOTTOM_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BOTTOM_PANEL, BottomPanelClass))
#define IS_BOTTOM_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BOTTOM_PANEL))
#define IS_BOTTOM_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BOTTOM_PANEL))
#define BOTTOM_PANEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BOTTOM_PANEL, BottomPanelClass))

typedef struct _BottomPanel BottomPanel;
typedef struct _BottomPanelClass BottomPanelClass;
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))

#define TYPE_LATEX_MENU (latex_menu_get_type ())
#define LATEX_MENU(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LATEX_MENU, LatexMenu))
#define LATEX_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LATEX_MENU, LatexMenuClass))
#define IS_LATEX_MENU(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LATEX_MENU))
#define IS_LATEX_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LATEX_MENU))
#define LATEX_MENU_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LATEX_MENU, LatexMenuClass))

typedef struct _LatexMenu LatexMenu;
typedef struct _LatexMenuClass LatexMenuClass;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define TYPE_SYMBOLS_VIEW (symbols_view_get_type ())
#define SYMBOLS_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SYMBOLS_VIEW, SymbolsView))
#define SYMBOLS_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SYMBOLS_VIEW, SymbolsViewClass))
#define IS_SYMBOLS_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SYMBOLS_VIEW))
#define IS_SYMBOLS_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SYMBOLS_VIEW))
#define SYMBOLS_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SYMBOLS_VIEW, SymbolsViewClass))

typedef struct _SymbolsView SymbolsView;
typedef struct _SymbolsViewClass SymbolsViewClass;

#define TYPE_FILE_BROWSER (file_browser_get_type ())
#define FILE_BROWSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FILE_BROWSER, FileBrowser))
#define FILE_BROWSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FILE_BROWSER, FileBrowserClass))
#define IS_FILE_BROWSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FILE_BROWSER))
#define IS_FILE_BROWSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FILE_BROWSER))
#define FILE_BROWSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FILE_BROWSER, FileBrowserClass))

typedef struct _FileBrowser FileBrowser;
typedef struct _FileBrowserClass FileBrowserClass;

#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;

#define TYPE_LATEXILA_APP (latexila_app_get_type ())
#define LATEXILA_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LATEXILA_APP, LatexilaApp))
#define LATEXILA_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LATEXILA_APP, LatexilaAppClass))
#define IS_LATEXILA_APP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LATEXILA_APP))
#define IS_LATEXILA_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LATEXILA_APP))
#define LATEXILA_APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LATEXILA_APP, LatexilaAppClass))

typedef struct _LatexilaApp LatexilaApp;
typedef struct _LatexilaAppClass LatexilaAppClass;
#define __vala_GdkEventWindowState_free0(var) ((var == NULL) ? NULL : (var = (_vala_GdkEventWindowState_free (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 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;

#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;
typedef struct _Block21Data Block21Data;
typedef struct _DocumentPrivate DocumentPrivate;

#define TYPE_TAB_INFO_BAR (tab_info_bar_get_type ())
#define TAB_INFO_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TAB_INFO_BAR, TabInfoBar))
#define TAB_INFO_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TAB_INFO_BAR, TabInfoBarClass))
#define IS_TAB_INFO_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TAB_INFO_BAR))
#define IS_TAB_INFO_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TAB_INFO_BAR))
#define TAB_INFO_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TAB_INFO_BAR, TabInfoBarClass))

typedef struct _TabInfoBar TabInfoBar;
typedef struct _TabInfoBarClass TabInfoBarClass;
typedef struct _Block22Data Block22Data;

struct _MainWindow {
	GtkWindow parent_instance;
	MainWindowPrivate * priv;
	gchar* default_location;
};

struct _MainWindowClass {
	GtkWindowClass parent_class;
};

struct _MainWindowPrivate {
	DocumentsPanel* _documents_panel;
	CustomStatusbar* _statusbar;
	GotoLine* _goto_line;
	SearchAndReplace* _search_and_replace;
	GtkPaned* _main_hpaned;
	GtkPaned* _vpaned;
	GtkUIManager* _ui_manager;
	GtkActionGroup* _action_group;
	GtkActionGroup* _latex_action_group;
	MainWindowFile* _main_window_file;
	MainWindowEdit* _main_window_edit;
	MainWindowBuildTools* _main_window_build_tools;
	MainWindowStructure* _main_window_structure;
	MainWindowDocuments* _main_window_documents;
	guint _tip_message_cid;
};

struct _Block21Data {
	int _ref_count_;
	MainWindow* self;
	DocumentTab* tab;
	GtkInfoBar* infobar;
};

struct _Document {
	GtkSourceBuffer parent_instance;
	DocumentPrivate * priv;
	DocumentTab* tab;
	guint _unsaved_doc_num;
};

struct _DocumentClass {
	GtkSourceBufferClass parent_class;
};

struct _Block22Data {
	int _ref_count_;
	MainWindow* self;
	DocumentTab* tab;
};


static gpointer main_window_parent_class = NULL;

GType main_window_get_type (void) G_GNUC_CONST;
GType documents_panel_get_type (void) G_GNUC_CONST;
GType custom_statusbar_get_type (void) G_GNUC_CONST;
GType goto_line_get_type (void) G_GNUC_CONST;
GType search_and_replace_get_type (void) G_GNUC_CONST;
gpointer main_window_file_ref (gpointer instance);
void main_window_file_unref (gpointer instance);
GParamSpec* param_spec_main_window_file (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_main_window_file (GValue* value, gpointer v_object);
void value_take_main_window_file (GValue* value, gpointer v_object);
gpointer value_get_main_window_file (const GValue* value);
GType main_window_file_get_type (void) G_GNUC_CONST;
gpointer main_window_edit_ref (gpointer instance);
void main_window_edit_unref (gpointer instance);
GParamSpec* param_spec_main_window_edit (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_main_window_edit (GValue* value, gpointer v_object);
void value_take_main_window_edit (GValue* value, gpointer v_object);
gpointer value_get_main_window_edit (const GValue* value);
GType main_window_edit_get_type (void) G_GNUC_CONST;
gpointer main_window_build_tools_ref (gpointer instance);
void main_window_build_tools_unref (gpointer instance);
GParamSpec* param_spec_main_window_build_tools (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_main_window_build_tools (GValue* value, gpointer v_object);
void value_take_main_window_build_tools (GValue* value, gpointer v_object);
gpointer value_get_main_window_build_tools (const GValue* value);
GType main_window_build_tools_get_type (void) G_GNUC_CONST;
gpointer main_window_structure_ref (gpointer instance);
void main_window_structure_unref (gpointer instance);
GParamSpec* param_spec_main_window_structure (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_main_window_structure (GValue* value, gpointer v_object);
void value_take_main_window_structure (GValue* value, gpointer v_object);
gpointer value_get_main_window_structure (const GValue* value);
GType main_window_structure_get_type (void) G_GNUC_CONST;
gpointer main_window_documents_ref (gpointer instance);
void main_window_documents_unref (gpointer instance);
GParamSpec* param_spec_main_window_documents (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_main_window_documents (GValue* value, gpointer v_object);
void value_take_main_window_documents (GValue* value, gpointer v_object);
gpointer value_get_main_window_documents (const GValue* value);
GType main_window_documents_get_type (void) G_GNUC_CONST;
#define MAIN_WINDOW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_MAIN_WINDOW, MainWindowPrivate))
enum  {
	MAIN_WINDOW_DUMMY_PROPERTY,
	MAIN_WINDOW_ACTIVE_TAB,
	MAIN_WINDOW_ACTIVE_VIEW,
	MAIN_WINDOW_ACTIVE_DOCUMENT
};
void main_window_on_quit (MainWindow* self);
static void _main_window_on_quit_gtk_action_callback (GtkAction* action, gpointer self);
void main_window_on_view_zoom_in (MainWindow* self);
static void _main_window_on_view_zoom_in_gtk_action_callback (GtkAction* action, gpointer self);
void main_window_on_view_zoom_out (MainWindow* self);
static void _main_window_on_view_zoom_out_gtk_action_callback (GtkAction* action, gpointer self);
void main_window_on_view_zoom_reset (MainWindow* self);
static void _main_window_on_view_zoom_reset_gtk_action_callback (GtkAction* action, gpointer self);
void main_window_on_search_find (MainWindow* self);
static void _main_window_on_search_find_gtk_action_callback (GtkAction* action, gpointer self);
void main_window_on_search_replace (MainWindow* self);
static void _main_window_on_search_replace_gtk_action_callback (GtkAction* action, gpointer self);
void main_window_on_search_goto_line (MainWindow* self);
static void _main_window_on_search_goto_line_gtk_action_callback (GtkAction* action, gpointer self);
void main_window_on_search_forward (MainWindow* self);
static void _main_window_on_search_forward_gtk_action_callback (GtkAction* action, gpointer self);
void main_window_on_projects_new (MainWindow* self);
static void _main_window_on_projects_new_gtk_action_callback (GtkAction* action, gpointer self);
void main_window_on_projects_config_current (MainWindow* self);
static void _main_window_on_projects_config_current_gtk_action_callback (GtkAction* action, gpointer self);
void main_window_on_projects_manage (MainWindow* self);
static void _main_window_on_projects_manage_gtk_action_callback (GtkAction* action, gpointer self);
void main_window_on_help_contents (MainWindow* self);
static void _main_window_on_help_contents_gtk_action_callback (GtkAction* action, gpointer self);
void main_window_on_help_latex_reference (MainWindow* self);
static void _main_window_on_help_latex_reference_gtk_action_callback (GtkAction* action, gpointer self);
void main_window_on_help_donate (MainWindow* self);
static void _main_window_on_help_donate_gtk_action_callback (GtkAction* action, gpointer self);
void main_window_on_about_dialog (MainWindow* self);
static void _main_window_on_about_dialog_gtk_action_callback (GtkAction* action, gpointer self);
MainWindow* main_window_new (void);
MainWindow* main_window_construct (GType object_type);
static void main_window_initialize_ui_manager (MainWindow* self);
MainWindowFile* main_window_file_new (MainWindow* main_window, GtkUIManager* ui_manager);
MainWindowFile* main_window_file_construct (GType object_type, MainWindow* main_window, GtkUIManager* ui_manager);
MainWindowEdit* main_window_edit_new (MainWindow* main_window, GtkUIManager* ui_manager);
MainWindowEdit* main_window_edit_construct (GType object_type, MainWindow* main_window, GtkUIManager* ui_manager);
MainWindowBuildTools* main_window_build_tools_new (MainWindow* main_window, GtkUIManager* ui_manager);
MainWindowBuildTools* main_window_build_tools_construct (GType object_type, MainWindow* main_window, GtkUIManager* ui_manager);
MainWindowDocuments* main_window_documents_new (MainWindow* main_window, GtkUIManager* ui_manager);
MainWindowDocuments* main_window_documents_construct (GType object_type, MainWindow* main_window, GtkUIManager* ui_manager);
MainWindowStructure* main_window_structure_new (GtkUIManager* ui_manager);
MainWindowStructure* main_window_structure_construct (GType object_type, GtkUIManager* ui_manager);
static void main_window_show_images_in_menu (MainWindow* self);
static void main_window_set_file_actions_sensitivity (MainWindow* self, gboolean sensitive);
static GtkToolbar* main_window_get_main_toolbar (MainWindow* self);
static GtkToolbar* main_window_get_edit_toolbar (MainWindow* self);
GType side_panel_get_type (void) G_GNUC_CONST;
static SidePanel* main_window_get_side_panel (MainWindow* self);
static void main_window_init_documents_panel (MainWindow* self);
GotoLine* goto_line_new (MainWindow* main_window);
GotoLine* goto_line_construct (GType object_type, MainWindow* main_window);
SearchAndReplace* search_and_replace_new (MainWindow* main_window);
SearchAndReplace* search_and_replace_construct (GType object_type, MainWindow* main_window);
GtkWidget* search_and_replace_get_widget (SearchAndReplace* self);
GType bottom_panel_get_type (void) G_GNUC_CONST;
static BottomPanel* main_window_get_bottom_panel (MainWindow* self);
void main_window_build_tools_set_bottom_panel (MainWindowBuildTools* self, BottomPanel* bottom_panel);
CustomStatusbar* custom_statusbar_new (void);
CustomStatusbar* custom_statusbar_construct (GType object_type);
static void main_window_support_drag_and_drop (MainWindow* self);
static void main_window_shrink_window_when_unmaximized (MainWindow* self);
static gboolean __lambda125_ (MainWindow* self);
static gboolean ___lambda125__gtk_widget_delete_event (GtkWidget* _sender, GdkEventAny* event, gpointer self);
static void main_window_restore_state (MainWindow* self);
static void main_window_show_or_hide_widgets (MainWindow* self);
LatexMenu* latex_menu_new (MainWindow* main_window);
LatexMenu* latex_menu_construct (GType object_type, MainWindow* main_window);
GType latex_menu_get_type (void) G_GNUC_CONST;
static void __lambda104_ (MainWindow* self, GtkAction* action, GtkWidget* p);
static void main_window_on_menu_item_select (MainWindow* self, GtkMenuItem* proxy);
static void _main_window_on_menu_item_select_gtk_menu_item_select (GtkMenuItem* _sender, gpointer self);
static void main_window_on_menu_item_deselect (MainWindow* self, GtkMenuItem* proxy);
static void _main_window_on_menu_item_deselect_gtk_menu_item_deselect (GtkMenuItem* _sender, gpointer self);
static void ___lambda104__gtk_ui_manager_connect_proxy (GtkUIManager* _sender, GtkAction* action, GtkWidget* proxy, gpointer self);
static void __lambda105_ (MainWindow* self, GtkAction* action, GtkWidget* p);
static void ___lambda105__gtk_ui_manager_disconnect_proxy (GtkUIManager* _sender, GtkAction* action, GtkWidget* proxy, gpointer self);
GtkToolItem* main_window_file_get_toolbar_open_button (MainWindowFile* self);
SidePanel* side_panel_new (void);
SidePanel* side_panel_construct (GType object_type);
GType symbols_view_get_type (void) G_GNUC_CONST;
SymbolsView* symbols_view_new (MainWindow* main_window);
SymbolsView* symbols_view_construct (GType object_type, MainWindow* main_window);
void side_panel_add_component (SidePanel* self, const gchar* name, const gchar* stock_id, GtkGrid* component);
GType file_browser_get_type (void) G_GNUC_CONST;
FileBrowser* file_browser_new (MainWindow* main_window);
FileBrowser* file_browser_construct (GType object_type, MainWindow* main_window);
GType structure_get_type (void) G_GNUC_CONST;
Structure* structure_new (MainWindow* main_window);
Structure* structure_construct (GType object_type, MainWindow* main_window);
void main_window_structure_set_structure (MainWindowStructure* self, Structure* structure);
void side_panel_restore_state (SidePanel* self);
DocumentsPanel* documents_panel_new (MainWindow* main_window);
DocumentsPanel* documents_panel_construct (GType object_type, MainWindow* main_window);
void main_window_documents_set_documents_panel (MainWindowDocuments* self, DocumentsPanel* documents_panel);
static void __lambda119_ (MainWindow* self, GdkEventButton* event);
static void ___lambda119__documents_panel_right_click (DocumentsPanel* _sender, GdkEventButton* event, gpointer self);
static void __lambda120_ (MainWindow* self);
static void ___lambda120__gtk_notebook_page_added (GtkNotebook* _sender, GtkWidget* child, guint page_num, gpointer self);
static void __lambda121_ (MainWindow* self);
void custom_statusbar_set_cursor_position (CustomStatusbar* self, gint line, gint col);
void search_and_replace_hide (SearchAndReplace* self);
static void main_window_my_set_title (MainWindow* self);
static void ___lambda121__gtk_notebook_page_removed (GtkNotebook* _sender, GtkWidget* child, guint page_num, gpointer self);
static void __lambda122_ (MainWindow* self, GtkWidget* pg, guint page_num);
void main_window_edit_update_sensitivity (MainWindowEdit* self);
void main_window_build_tools_update_sensitivity (MainWindowBuildTools* self);
void main_window_update_config_project_sensitivity (MainWindow* self);
static void main_window_update_cursor_position_statusbar (MainWindow* self);
static void ___lambda122__gtk_notebook_switch_page (GtkNotebook* _sender, GtkWidget* page, guint page_num, gpointer self);
void main_window_build_tools_set_build_view (MainWindowBuildTools* self, LatexilaBuildView* build_view);
BottomPanel* bottom_panel_new (LatexilaBuildView* build_view, GtkToolbar* toolbar);
BottomPanel* bottom_panel_construct (GType object_type, LatexilaBuildView* build_view, GtkToolbar* toolbar);
static void __lambda123_ (MainWindow* self, GdkDragContext* dc, gint x, gint y, GtkSelectionData* selection_data, guint info, guint time);
GType latexila_app_get_type (void) G_GNUC_CONST;
LatexilaApp* latexila_app_get_instance (void);
static void _vala_array_add8 (GFile*** array, int* length, int* size, GFile* value);
void latexila_app_open_documents (LatexilaApp* self, GFile** files, int files_length1);
static void ___lambda123__gtk_widget_drag_data_received (GtkWidget* _sender, GdkDragContext* context, gint x, gint y, GtkSelectionData* selection_data, guint info, guint time_, gpointer self);
static gboolean __lambda124_ (MainWindow* self, GdkEventWindowState* e);
static GdkEventWindowState* _vala_GdkEventWindowState_copy (GdkEventWindowState* self);
static void _vala_GdkEventWindowState_free (GdkEventWindowState* self);
static gboolean ___lambda124__gtk_widget_window_state_event (GtkWidget* _sender, GdkEventWindowState* event, gpointer self);
GType document_get_type (void) G_GNUC_CONST;
GeeList* main_window_get_documents (MainWindow* self);
GType document_tab_get_type (void) G_GNUC_CONST;
Document* document_tab_get_document (DocumentTab* self);
GeeList* main_window_get_unsaved_documents (MainWindow* self);
gboolean document_get_modified (Document* self);
GType document_view_get_type (void) G_GNUC_CONST;
GeeList* main_window_get_views (MainWindow* self);
DocumentView* document_tab_get_view (DocumentTab* self);
DocumentTab* main_window_open_document (MainWindow* self, GFile* location, gboolean jump_to);
static Block21Data* block21_data_ref (Block21Data* _data21_);
static void block21_data_unref (void * _userdata_);
GFile* document_get_location (Document* self);
void main_window_set_active_tab (MainWindow* self, DocumentTab* value);
static DocumentTab* main_window_create_tab_from_location (MainWindow* self, GFile* location, gboolean jump_to);
void document_set_readonly (Document* self, gboolean value);
GType tab_info_bar_get_type (void) G_GNUC_CONST;
TabInfoBar* document_tab_add_message (DocumentTab* self, const gchar* primary_msg, const gchar* secondary_msg, GtkMessageType msg_type);
static void ______lambda77_ (Block21Data* _data21_, gint response_id);
static void _______lambda77__gtk_info_bar_response (GtkInfoBar* _sender, gint response_id, gpointer self);
DocumentTab* main_window_create_tab (MainWindow* self, gboolean jump_to);
DocumentTab* document_tab_new (void);
DocumentTab* document_tab_construct (GType object_type);
static DocumentTab* main_window_process_create_tab (MainWindow* self, DocumentTab* tab, gboolean jump_to);
DocumentTab* document_tab_new_from_location (GFile* location);
DocumentTab* document_tab_construct_from_location (GType object_type, GFile* location);
void main_window_create_tab_with_view (MainWindow* self, DocumentView* view);
DocumentTab* document_tab_new_with_view (DocumentView* view);
DocumentTab* document_tab_construct_with_view (GType object_type, DocumentView* view);
static Block22Data* block22_data_ref (Block22Data* _data22_);
static void block22_data_unref (void * _userdata_);
static void __lambda16_ (Block22Data* _data22_);
gboolean main_window_close_tab (MainWindow* self, DocumentTab* tab, gboolean force_close);
static void ___lambda16__document_tab_close_document (DocumentTab* _sender, gpointer self);
static void __lambda19_ (Block22Data* _data22_);
DocumentTab* main_window_get_active_tab (MainWindow* self);
static void ___lambda19__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void __lambda30_ (Block22Data* _data22_);
static void ___lambda30__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void __lambda31_ (Block22Data* _data22_);
static void ___lambda31__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void __lambda32_ (Block22Data* _data22_);
static void main_window_sync_name (MainWindow* self, DocumentTab* tab);
static void ___lambda32__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void __lambda73_ (MainWindow* self);
static void ___lambda73__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void __lambda74_ (Block22Data* _data22_);
static void ___lambda74__gtk_text_buffer_modified_changed (GtkTextBuffer* _sender, gpointer self);
static void __lambda75_ (Block22Data* _data22_);
static void ___lambda75__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void _main_window_update_cursor_position_statusbar_document_cursor_moved (Document* _sender, gpointer self);
void documents_panel_add_tab (DocumentsPanel* self, DocumentTab* tab, gint position, gboolean jump_to);
const gchar* document_tab_get_label_text (DocumentTab* self);
gboolean main_window_save_document (MainWindow* self, Document* doc, gboolean force_save_as);
void documents_panel_remove_tab (DocumentsPanel* self, DocumentTab* tab);
void main_window_documents_update_document_name (MainWindowDocuments* self, DocumentTab* tab);
Document* main_window_get_active_document (MainWindow* self);
gchar* document_get_short_name_for_display (Document* self);
gchar* utils_str_middle_truncate (const gchar* str, guint max_length);
gchar* utils_get_dirname_for_display (GFile* location);
gboolean document_get_readonly (Document* self);
void document_save (Document* self, gboolean check_file_changed_on_disk, gboolean force);
void main_window_structure_refresh (MainWindowStructure* self);
void document_set_location (Document* self, GFile* value);
gboolean main_window_close_all_documents (MainWindow* self);
void documents_panel_remove_all_tabs (DocumentsPanel* self);
void dialogs_close_several_unsaved_documents (MainWindow* window, GeeList* unsaved_docs);
void main_window_remove_all_tabs (MainWindow* self);
DocumentView* main_window_get_active_view (MainWindow* self);
void main_window_save_state (MainWindow* self);
void main_window_structure_save_state (MainWindowStructure* self);
void main_window_build_tools_save_state (MainWindowBuildTools* self);
void main_window_jump_to_file_position (MainWindow* self, GFile* file, gint start_line, gint end_line);
void utils_flush_queue (void);
void document_select_lines (Document* self, gint start, gint end);
void main_window_file_update_sensitivity (MainWindowFile* self, gboolean sensitive);
gint document_get_project_id (Document* self);
static void _vala_array_add9 (gchar*** array, int* length, int* size, gchar* value);
void document_view_enlarge_font (DocumentView* self);
void document_view_shrink_font (DocumentView* self);
void document_view_set_font_from_settings (DocumentView* self);
void search_and_replace_show_search (SearchAndReplace* self);
void search_and_replace_show_search_and_replace (SearchAndReplace* self);
void goto_line_show (GotoLine* self);
GFile* document_get_main_file (Document* self);
void project_dialogs_new_project (MainWindow* main_window);
gboolean project_dialogs_configure_project (GtkWindow* main_window, gint project_id);
void project_dialogs_manage_projects (MainWindow* main_window);
DocumentTab* documents_panel_get_active_tab (DocumentsPanel* self);
static void main_window_finalize (GObject* obj);
static void _vala_main_window_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_main_window_set_property (GObject * object, guint property_id, const 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 const GtkActionEntry MAIN_WINDOW__action_entries[19] = {{"FileQuit", GTK_STOCK_QUIT, NULL, NULL, "Quit the program", (GCallback) _main_window_on_quit_gtk_action_callback}, {"View", NULL, "_View"}, {"ViewZoomIn", GTK_STOCK_ZOOM_IN, "Zoom _In", "<Control>plus", "Enlarge the font", (GCallback) _main_window_on_view_zoom_in_gtk_action_callback}, {"ViewZoomOut", GTK_STOCK_ZOOM_OUT, "Zoom _Out", "<Control>minus", "Shrink the font", (GCallback) _main_window_on_view_zoom_out_gtk_action_callback}, {"ViewZoomReset", GTK_STOCK_ZOOM_100, "_Reset Zoom", "<Control>0", "Reset the size of the font", (GCallback) _main_window_on_view_zoom_reset_gtk_action_callback}, {"Search", NULL, "_Search"}, {"SearchFind", GTK_STOCK_FIND, NULL, NULL, "Search for text", (GCallback) _main_window_on_search_find_gtk_action_callback}, {"SearchReplace", GTK_STOCK_FIND_AND_REPLACE, NULL, NULL, "Search for and replace text", (GCallback) _main_window_on_search_replace_gtk_action_callback}, {"SearchGoToLine", GTK_STOCK_JUMP_TO, "_Go to Line...", "<Control>G", "Go to a specific line", (GCallback) _main_window_on_search_goto_line_gtk_action_callback}, {"SearchForward", NULL, "_Search Forward", "<Control><Alt>F", "Jump to the associated position in the PDF file", (GCallback) _main_window_on_search_forward_gtk_action_callback}, {"Projects", NULL, "_Projects"}, {"ProjectsNew", GTK_STOCK_NEW, "_New Project", NULL, "Create a new project", (GCallback) _main_window_on_projects_new_gtk_action_callback}, {"ProjectsConfigCurrent", GTK_STOCK_PROPERTIES, "_Configure Current Project", NULL, "Change the main file of the current project", (GCallback) _main_window_on_projects_config_current_gtk_action_callback}, {"ProjectsManage", GTK_STOCK_PREFERENCES, "_Manage Projects", NULL, "Manage Projects", (GCallback) _main_window_on_projects_manage_gtk_action_callback}, {"Help", NULL, "_Help"}, {"HelpContents", GTK_STOCK_HELP, "_Contents", "<Release>F1", "Open the LaTeXila documentation", (GCallback) _main_window_on_help_contents_gtk_action_callback}, {"HelpLatexReference", NULL, "_LaTeX Reference", NULL, "The Kile LaTeX Reference", (GCallback) _main_window_on_help_latex_reference_gtk_action_callback}, {"HelpDonate", NULL, "_Donate", NULL, "Donate to demonstrate your appreciation of LaTeXila and help its futur" \
"e development", (GCallback) _main_window_on_help_donate_gtk_action_callback}, {"HelpAbout", GTK_STOCK_ABOUT, NULL, NULL, "About LaTeXila", (GCallback) _main_window_on_about_dialog_gtk_action_callback}};
static const GtkToggleActionEntry MAIN_WINDOW__toggle_action_entries[4] = {{"ViewMainToolbar", NULL, "_Main Toolbar", NULL, "Show or hide the main toolbar", (GCallback) NULL}, {"ViewEditToolbar", NULL, "_Edit Toolbar", NULL, "Show or hide the edit toolbar", (GCallback) NULL}, {"ViewSidePanel", NULL, "_Side panel", "<Release>F12", "Show or hide the side panel", (GCallback) NULL}, {"ViewBottomPanel", NULL, "_Bottom panel", NULL, "Show or hide the bottom panel", (GCallback) NULL}};

static void _main_window_on_quit_gtk_action_callback (GtkAction* action, gpointer self) {
	main_window_on_quit ((MainWindow*) self);
}


static void _main_window_on_view_zoom_in_gtk_action_callback (GtkAction* action, gpointer self) {
	main_window_on_view_zoom_in ((MainWindow*) self);
}


static void _main_window_on_view_zoom_out_gtk_action_callback (GtkAction* action, gpointer self) {
	main_window_on_view_zoom_out ((MainWindow*) self);
}


static void _main_window_on_view_zoom_reset_gtk_action_callback (GtkAction* action, gpointer self) {
	main_window_on_view_zoom_reset ((MainWindow*) self);
}


static void _main_window_on_search_find_gtk_action_callback (GtkAction* action, gpointer self) {
	main_window_on_search_find ((MainWindow*) self);
}


static void _main_window_on_search_replace_gtk_action_callback (GtkAction* action, gpointer self) {
	main_window_on_search_replace ((MainWindow*) self);
}


static void _main_window_on_search_goto_line_gtk_action_callback (GtkAction* action, gpointer self) {
	main_window_on_search_goto_line ((MainWindow*) self);
}


static void _main_window_on_search_forward_gtk_action_callback (GtkAction* action, gpointer self) {
	main_window_on_search_forward ((MainWindow*) self);
}


static void _main_window_on_projects_new_gtk_action_callback (GtkAction* action, gpointer self) {
	main_window_on_projects_new ((MainWindow*) self);
}


static void _main_window_on_projects_config_current_gtk_action_callback (GtkAction* action, gpointer self) {
	main_window_on_projects_config_current ((MainWindow*) self);
}


static void _main_window_on_projects_manage_gtk_action_callback (GtkAction* action, gpointer self) {
	main_window_on_projects_manage ((MainWindow*) self);
}


static void _main_window_on_help_contents_gtk_action_callback (GtkAction* action, gpointer self) {
	main_window_on_help_contents ((MainWindow*) self);
}


static void _main_window_on_help_latex_reference_gtk_action_callback (GtkAction* action, gpointer self) {
	main_window_on_help_latex_reference ((MainWindow*) self);
}


static void _main_window_on_help_donate_gtk_action_callback (GtkAction* action, gpointer self) {
	main_window_on_help_donate ((MainWindow*) self);
}


static void _main_window_on_about_dialog_gtk_action_callback (GtkAction* action, gpointer self) {
	main_window_on_about_dialog ((MainWindow*) self);
}


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


static gboolean __lambda125_ (MainWindow* self) {
	gboolean result = FALSE;
	main_window_on_quit (self);
	result = TRUE;
	return result;
}


static gboolean ___lambda125__gtk_widget_delete_event (GtkWidget* _sender, GdkEventAny* event, gpointer self) {
	gboolean result;
	result = __lambda125_ ((MainWindow*) self);
	return result;
}


MainWindow* main_window_construct (GType object_type) {
	MainWindow * self = NULL;
	GtkUIManager* _tmp0_ = NULL;
	MainWindowFile* _tmp1_ = NULL;
	GtkUIManager* _tmp2_ = NULL;
	MainWindowEdit* _tmp3_ = NULL;
	GtkUIManager* _tmp4_ = NULL;
	MainWindowBuildTools* _tmp5_ = NULL;
	GtkUIManager* _tmp6_ = NULL;
	MainWindowDocuments* _tmp7_ = NULL;
	GtkUIManager* _tmp8_ = NULL;
	MainWindowStructure* _tmp9_ = NULL;
	GtkGrid* main_vgrid = NULL;
	GtkGrid* _tmp10_ = NULL;
	GtkWidget* menu = NULL;
	GtkUIManager* _tmp11_ = NULL;
	GtkWidget* _tmp12_ = NULL;
	GtkWidget* _tmp13_ = NULL;
	GtkPaned* menu_paned = NULL;
	GtkPaned* _tmp14_ = NULL;
	GtkViewport* viewport = NULL;
	GtkViewport* _tmp15_ = NULL;
	GdkRGBA transparent = {0};
	GdkRGBA _tmp16_ = {0};
	GtkToolbar* main_toolbar = NULL;
	GtkToolbar* _tmp17_ = NULL;
	GtkToolbar* edit_toolbar = NULL;
	GtkToolbar* _tmp18_ = NULL;
	GtkPaned* _tmp19_ = NULL;
	GtkPaned* _tmp20_ = NULL;
	GtkPaned* _tmp21_ = NULL;
	SidePanel* side_panel = NULL;
	SidePanel* _tmp22_ = NULL;
	GtkPaned* _tmp23_ = NULL;
	GtkPaned* _tmp24_ = NULL;
	GtkPaned* _tmp25_ = NULL;
	GtkPaned* _tmp26_ = NULL;
	GtkPaned* _tmp27_ = NULL;
	GtkGrid* docs_vgrid = NULL;
	GtkGrid* _tmp28_ = NULL;
	DocumentsPanel* _tmp29_ = NULL;
	GotoLine* _tmp30_ = NULL;
	GotoLine* _tmp31_ = NULL;
	SearchAndReplace* _tmp32_ = NULL;
	SearchAndReplace* _tmp33_ = NULL;
	GtkWidget* _tmp34_ = NULL;
	GtkWidget* _tmp35_ = NULL;
	BottomPanel* bottom_panel = NULL;
	BottomPanel* _tmp36_ = NULL;
	MainWindowBuildTools* _tmp37_ = NULL;
	GtkPaned* _tmp38_ = NULL;
	GtkPaned* _tmp39_ = NULL;
	CustomStatusbar* _tmp40_ = NULL;
	CustomStatusbar* _tmp41_ = NULL;
	CustomStatusbar* _tmp42_ = NULL;
	CustomStatusbar* _tmp43_ = NULL;
	guint _tmp44_ = 0U;
	self = (MainWindow*) g_object_new (object_type, NULL);
	gtk_window_set_title ((GtkWindow*) self, "LaTeXila");
	main_window_initialize_ui_manager (self);
	_tmp0_ = self->priv->_ui_manager;
	_tmp1_ = main_window_file_new (self, _tmp0_);
	_main_window_file_unref0 (self->priv->_main_window_file);
	self->priv->_main_window_file = _tmp1_;
	_tmp2_ = self->priv->_ui_manager;
	_tmp3_ = main_window_edit_new (self, _tmp2_);
	_main_window_edit_unref0 (self->priv->_main_window_edit);
	self->priv->_main_window_edit = _tmp3_;
	_tmp4_ = self->priv->_ui_manager;
	_tmp5_ = main_window_build_tools_new (self, _tmp4_);
	_main_window_build_tools_unref0 (self->priv->_main_window_build_tools);
	self->priv->_main_window_build_tools = _tmp5_;
	_tmp6_ = self->priv->_ui_manager;
	_tmp7_ = main_window_documents_new (self, _tmp6_);
	_main_window_documents_unref0 (self->priv->_main_window_documents);
	self->priv->_main_window_documents = _tmp7_;
	_tmp8_ = self->priv->_ui_manager;
	_tmp9_ = main_window_structure_new (_tmp8_);
	_main_window_structure_unref0 (self->priv->_main_window_structure);
	self->priv->_main_window_structure = _tmp9_;
	main_window_show_images_in_menu (self);
	main_window_set_file_actions_sensitivity (self, FALSE);
	_tmp10_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp10_);
	main_vgrid = _tmp10_;
	gtk_orientable_set_orientation ((GtkOrientable*) main_vgrid, GTK_ORIENTATION_VERTICAL);
	gtk_widget_show ((GtkWidget*) main_vgrid);
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) main_vgrid);
	_tmp11_ = self->priv->_ui_manager;
	_tmp12_ = gtk_ui_manager_get_widget (_tmp11_, "/MainMenu");
	_tmp13_ = _g_object_ref0 (_tmp12_);
	menu = _tmp13_;
	_tmp14_ = (GtkPaned*) gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
	g_object_ref_sink (_tmp14_);
	menu_paned = _tmp14_;
	_tmp15_ = (GtkViewport*) gtk_viewport_new (NULL, NULL);
	g_object_ref_sink (_tmp15_);
	viewport = _tmp15_;
	gtk_viewport_set_shadow_type (viewport, GTK_SHADOW_NONE);
	memset (&transparent, 0, sizeof (GdkRGBA));
	transparent.alpha = 0.0;
	_tmp16_ = transparent;
	gtk_widget_override_background_color ((GtkWidget*) viewport, GTK_STATE_FLAG_NORMAL, &_tmp16_);
	gtk_container_add ((GtkContainer*) viewport, menu);
	gtk_paned_add1 (menu_paned, (GtkWidget*) viewport);
	gtk_widget_show_all ((GtkWidget*) menu_paned);
	gtk_container_add ((GtkContainer*) main_vgrid, (GtkWidget*) menu_paned);
	_tmp17_ = main_window_get_main_toolbar (self);
	main_toolbar = _tmp17_;
	_tmp18_ = main_window_get_edit_toolbar (self);
	edit_toolbar = _tmp18_;
	gtk_container_add ((GtkContainer*) main_vgrid, (GtkWidget*) main_toolbar);
	gtk_container_add ((GtkContainer*) main_vgrid, (GtkWidget*) edit_toolbar);
	_tmp19_ = (GtkPaned*) gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
	g_object_ref_sink (_tmp19_);
	_g_object_unref0 (self->priv->_main_hpaned);
	self->priv->_main_hpaned = _tmp19_;
	_tmp20_ = self->priv->_main_hpaned;
	gtk_widget_show ((GtkWidget*) _tmp20_);
	_tmp21_ = self->priv->_main_hpaned;
	gtk_container_add ((GtkContainer*) main_vgrid, (GtkWidget*) _tmp21_);
	_tmp22_ = main_window_get_side_panel (self);
	side_panel = _tmp22_;
	_tmp23_ = self->priv->_main_hpaned;
	gtk_paned_pack1 (_tmp23_, (GtkWidget*) side_panel, FALSE, FALSE);
	_tmp24_ = (GtkPaned*) gtk_paned_new (GTK_ORIENTATION_VERTICAL);
	g_object_ref_sink (_tmp24_);
	_g_object_unref0 (self->priv->_vpaned);
	self->priv->_vpaned = _tmp24_;
	_tmp25_ = self->priv->_vpaned;
	gtk_widget_show ((GtkWidget*) _tmp25_);
	_tmp26_ = self->priv->_main_hpaned;
	_tmp27_ = self->priv->_vpaned;
	gtk_paned_add2 (_tmp26_, (GtkWidget*) _tmp27_);
	_tmp28_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp28_);
	docs_vgrid = _tmp28_;
	gtk_orientable_set_orientation ((GtkOrientable*) docs_vgrid, GTK_ORIENTATION_VERTICAL);
	gtk_grid_set_row_spacing (docs_vgrid, (guint) 2);
	gtk_widget_show ((GtkWidget*) docs_vgrid);
	main_window_init_documents_panel (self);
	_tmp29_ = self->priv->_documents_panel;
	gtk_container_add ((GtkContainer*) docs_vgrid, (GtkWidget*) _tmp29_);
	_tmp30_ = goto_line_new (self);
	g_object_ref_sink (_tmp30_);
	_g_object_unref0 (self->priv->_goto_line);
	self->priv->_goto_line = _tmp30_;
	_tmp31_ = self->priv->_goto_line;
	gtk_container_add ((GtkContainer*) docs_vgrid, (GtkWidget*) _tmp31_);
	_tmp32_ = search_and_replace_new (self);
	_g_object_unref0 (self->priv->_search_and_replace);
	self->priv->_search_and_replace = _tmp32_;
	_tmp33_ = self->priv->_search_and_replace;
	_tmp34_ = search_and_replace_get_widget (_tmp33_);
	_tmp35_ = _tmp34_;
	gtk_container_add ((GtkContainer*) docs_vgrid, _tmp35_);
	_g_object_unref0 (_tmp35_);
	_tmp36_ = main_window_get_bottom_panel (self);
	bottom_panel = _tmp36_;
	_tmp37_ = self->priv->_main_window_build_tools;
	main_window_build_tools_set_bottom_panel (_tmp37_, bottom_panel);
	_tmp38_ = self->priv->_vpaned;
	gtk_paned_pack1 (_tmp38_, (GtkWidget*) docs_vgrid, TRUE, TRUE);
	_tmp39_ = self->priv->_vpaned;
	gtk_paned_pack2 (_tmp39_, (GtkWidget*) bottom_panel, FALSE, FALSE);
	_tmp40_ = custom_statusbar_new ();
	g_object_ref_sink (_tmp40_);
	_g_object_unref0 (self->priv->_statusbar);
	self->priv->_statusbar = _tmp40_;
	_tmp41_ = self->priv->_statusbar;
	gtk_widget_show_all ((GtkWidget*) _tmp41_);
	_tmp42_ = self->priv->_statusbar;
	gtk_container_add ((GtkContainer*) main_vgrid, (GtkWidget*) _tmp42_);
	_tmp43_ = self->priv->_statusbar;
	_tmp44_ = gtk_statusbar_get_context_id ((GtkStatusbar*) _tmp43_, "tip_message");
	self->priv->_tip_message_cid = _tmp44_;
	main_window_support_drag_and_drop (self);
	main_window_shrink_window_when_unmaximized (self);
	g_signal_connect_object ((GtkWidget*) self, "delete-event", (GCallback) ___lambda125__gtk_widget_delete_event, self, 0);
	main_window_restore_state (self);
	main_window_show_or_hide_widgets (self);
	gtk_widget_show ((GtkWidget*) self);
	_g_object_unref0 (bottom_panel);
	_g_object_unref0 (docs_vgrid);
	_g_object_unref0 (side_panel);
	_g_object_unref0 (edit_toolbar);
	_g_object_unref0 (main_toolbar);
	_g_object_unref0 (viewport);
	_g_object_unref0 (menu_paned);
	_g_object_unref0 (menu);
	_g_object_unref0 (main_vgrid);
	return self;
}


MainWindow* main_window_new (void) {
	return main_window_construct (TYPE_MAIN_WINDOW);
}


static void main_window_show_images_in_menu (MainWindow* self) {
	GtkUIManager* _tmp0_ = NULL;
	GList* _tmp1_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_ui_manager;
	_tmp1_ = gtk_ui_manager_get_action_groups (_tmp0_);
	{
		GList* action_group_collection = NULL;
		GList* action_group_it = NULL;
		action_group_collection = _tmp1_;
		for (action_group_it = action_group_collection; action_group_it != NULL; action_group_it = action_group_it->next) {
			GtkActionGroup* _tmp2_ = NULL;
			GtkActionGroup* action_group = NULL;
			_tmp2_ = _g_object_ref0 ((GtkActionGroup*) action_group_it->data);
			action_group = _tmp2_;
			{
				GtkActionGroup* _tmp3_ = NULL;
				GList* _tmp4_ = NULL;
				_tmp3_ = action_group;
				_tmp4_ = gtk_action_group_list_actions (_tmp3_);
				{
					GList* action_collection = NULL;
					GList* action_it = NULL;
					action_collection = _tmp4_;
					for (action_it = action_collection; action_it != NULL; action_it = action_it->next) {
						GtkAction* _tmp5_ = NULL;
						GtkAction* action = NULL;
						_tmp5_ = _g_object_ref0 ((GtkAction*) action_it->data);
						action = _tmp5_;
						{
							GtkAction* _tmp6_ = NULL;
							_tmp6_ = action;
							gtk_action_set_always_show_image (_tmp6_, TRUE);
							_g_object_unref0 (action);
						}
					}
					_g_list_free0 (action_collection);
				}
				_g_object_unref0 (action_group);
			}
		}
	}
}


static void _main_window_on_menu_item_select_gtk_menu_item_select (GtkMenuItem* _sender, gpointer self) {
	main_window_on_menu_item_select ((MainWindow*) self, _sender);
}


static void _main_window_on_menu_item_deselect_gtk_menu_item_deselect (GtkMenuItem* _sender, gpointer self) {
	main_window_on_menu_item_deselect ((MainWindow*) self, _sender);
}


static void __lambda104_ (MainWindow* self, GtkAction* action, GtkWidget* p) {
	GtkWidget* _tmp0_ = NULL;
	g_return_if_fail (action != NULL);
	g_return_if_fail (p != NULL);
	_tmp0_ = p;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, gtk_menu_item_get_type ())) {
		GtkMenuItem* proxy = NULL;
		GtkWidget* _tmp1_ = NULL;
		GtkMenuItem* _tmp2_ = NULL;
		GtkMenuItem* _tmp3_ = NULL;
		GtkMenuItem* _tmp4_ = NULL;
		_tmp1_ = p;
		_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, gtk_menu_item_get_type ()) ? ((GtkMenuItem*) _tmp1_) : NULL);
		proxy = _tmp2_;
		_tmp3_ = proxy;
		g_signal_connect_object (_tmp3_, "select", (GCallback) _main_window_on_menu_item_select_gtk_menu_item_select, self, 0);
		_tmp4_ = proxy;
		g_signal_connect_object (_tmp4_, "deselect", (GCallback) _main_window_on_menu_item_deselect_gtk_menu_item_deselect, self, 0);
		_g_object_unref0 (proxy);
	}
}


static void ___lambda104__gtk_ui_manager_connect_proxy (GtkUIManager* _sender, GtkAction* action, GtkWidget* proxy, gpointer self) {
	__lambda104_ ((MainWindow*) self, action, proxy);
}


static void __lambda105_ (MainWindow* self, GtkAction* action, GtkWidget* p) {
	GtkWidget* _tmp0_ = NULL;
	g_return_if_fail (action != NULL);
	g_return_if_fail (p != NULL);
	_tmp0_ = p;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, gtk_menu_item_get_type ())) {
		GtkMenuItem* proxy = NULL;
		GtkWidget* _tmp1_ = NULL;
		GtkMenuItem* _tmp2_ = NULL;
		GtkMenuItem* _tmp3_ = NULL;
		guint _tmp4_ = 0U;
		GtkMenuItem* _tmp5_ = NULL;
		guint _tmp6_ = 0U;
		_tmp1_ = p;
		_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, gtk_menu_item_get_type ()) ? ((GtkMenuItem*) _tmp1_) : NULL);
		proxy = _tmp2_;
		_tmp3_ = proxy;
		g_signal_parse_name ("select", gtk_menu_item_get_type (), &_tmp4_, NULL, FALSE);
		g_signal_handlers_disconnect_matched (_tmp3_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp4_, 0, NULL, (GCallback) _main_window_on_menu_item_select_gtk_menu_item_select, self);
		_tmp5_ = proxy;
		g_signal_parse_name ("deselect", gtk_menu_item_get_type (), &_tmp6_, NULL, FALSE);
		g_signal_handlers_disconnect_matched (_tmp5_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp6_, 0, NULL, (GCallback) _main_window_on_menu_item_deselect_gtk_menu_item_deselect, self);
		_g_object_unref0 (proxy);
	}
}


static void ___lambda105__gtk_ui_manager_disconnect_proxy (GtkUIManager* _sender, GtkAction* action, GtkWidget* proxy, gpointer self) {
	__lambda105_ ((MainWindow*) self, action, proxy);
}


static void main_window_initialize_ui_manager (MainWindow* self) {
	GtkActionGroup* _tmp0_ = NULL;
	GtkActionGroup* _tmp1_ = NULL;
	GtkActionGroup* _tmp2_ = NULL;
	GtkActionGroup* _tmp3_ = NULL;
	LatexMenu* _tmp4_ = NULL;
	GtkUIManager* _tmp5_ = NULL;
	GtkUIManager* _tmp6_ = NULL;
	GtkActionGroup* _tmp7_ = NULL;
	GtkUIManager* _tmp8_ = NULL;
	GtkActionGroup* _tmp9_ = NULL;
	GtkUIManager* _tmp13_ = NULL;
	GtkAccelGroup* _tmp14_ = NULL;
	GtkUIManager* _tmp15_ = NULL;
	GtkUIManager* _tmp16_ = NULL;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_action_group_new ("ActionGroup");
	_g_object_unref0 (self->priv->_action_group);
	self->priv->_action_group = _tmp0_;
	_tmp1_ = self->priv->_action_group;
	gtk_action_group_set_translation_domain (_tmp1_, GETTEXT_PACKAGE);
	_tmp2_ = self->priv->_action_group;
	gtk_action_group_add_actions (_tmp2_, MAIN_WINDOW__action_entries, G_N_ELEMENTS (MAIN_WINDOW__action_entries), self);
	_tmp3_ = self->priv->_action_group;
	gtk_action_group_add_toggle_actions (_tmp3_, MAIN_WINDOW__toggle_action_entries, G_N_ELEMENTS (MAIN_WINDOW__toggle_action_entries), self);
	_tmp4_ = latex_menu_new (self);
	_g_object_unref0 (self->priv->_latex_action_group);
	self->priv->_latex_action_group = (GtkActionGroup*) _tmp4_;
	_tmp5_ = gtk_ui_manager_new ();
	_g_object_unref0 (self->priv->_ui_manager);
	self->priv->_ui_manager = _tmp5_;
	_tmp6_ = self->priv->_ui_manager;
	_tmp7_ = self->priv->_action_group;
	gtk_ui_manager_insert_action_group (_tmp6_, _tmp7_, 0);
	_tmp8_ = self->priv->_ui_manager;
	_tmp9_ = self->priv->_latex_action_group;
	gtk_ui_manager_insert_action_group (_tmp8_, _tmp9_, 0);
	{
		gchar* path = NULL;
		gchar* _tmp10_ = NULL;
		GtkUIManager* _tmp11_ = NULL;
		_tmp10_ = g_build_filename (DATA_DIR, "ui", "ui.xml", NULL);
		path = _tmp10_;
		_tmp11_ = self->priv->_ui_manager;
		gtk_ui_manager_add_ui_from_file (_tmp11_, path, &_inner_error_);
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			_g_free0 (path);
			goto __catch27_g_error;
		}
		_g_free0 (path);
	}
	goto __finally27;
	__catch27_g_error:
	{
		GError* err = NULL;
		const gchar* _tmp12_ = NULL;
		err = _inner_error_;
		_inner_error_ = NULL;
		_tmp12_ = err->message;
		g_error ("main_window.vala:306: %s", _tmp12_);
		_g_error_free0 (err);
	}
	__finally27:
	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;
	}
	_tmp13_ = self->priv->_ui_manager;
	_tmp14_ = gtk_ui_manager_get_accel_group (_tmp13_);
	gtk_window_add_accel_group ((GtkWindow*) self, _tmp14_);
	_tmp15_ = self->priv->_ui_manager;
	g_signal_connect_object (_tmp15_, "connect-proxy", (GCallback) ___lambda104__gtk_ui_manager_connect_proxy, self, 0);
	_tmp16_ = self->priv->_ui_manager;
	g_signal_connect_object (_tmp16_, "disconnect-proxy", (GCallback) ___lambda105__gtk_ui_manager_disconnect_proxy, self, 0);
}


static void main_window_on_menu_item_select (MainWindow* self, GtkMenuItem* proxy) {
	GtkAction* action = NULL;
	GtkMenuItem* _tmp0_ = NULL;
	GtkAction* _tmp1_ = NULL;
	GtkAction* _tmp2_ = NULL;
	GtkAction* _tmp3_ = NULL;
	GtkAction* _tmp4_ = NULL;
	const gchar* _tmp5_ = NULL;
	const gchar* _tmp6_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (proxy != NULL);
	_tmp0_ = proxy;
	_tmp1_ = gtk_activatable_get_related_action ((GtkActivatable*) _tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	action = _tmp2_;
	_tmp3_ = action;
	g_return_if_fail (_tmp3_ != NULL);
	_tmp4_ = action;
	_tmp5_ = gtk_action_get_tooltip (_tmp4_);
	_tmp6_ = _tmp5_;
	if (_tmp6_ != NULL) {
		CustomStatusbar* _tmp7_ = NULL;
		guint _tmp8_ = 0U;
		GtkAction* _tmp9_ = NULL;
		const gchar* _tmp10_ = NULL;
		const gchar* _tmp11_ = NULL;
		_tmp7_ = self->priv->_statusbar;
		_tmp8_ = self->priv->_tip_message_cid;
		_tmp9_ = action;
		_tmp10_ = gtk_action_get_tooltip (_tmp9_);
		_tmp11_ = _tmp10_;
		gtk_statusbar_push ((GtkStatusbar*) _tmp7_, _tmp8_, _tmp11_);
	}
	_g_object_unref0 (action);
}


static void main_window_on_menu_item_deselect (MainWindow* self, GtkMenuItem* proxy) {
	CustomStatusbar* _tmp0_ = NULL;
	guint _tmp1_ = 0U;
	g_return_if_fail (self != NULL);
	g_return_if_fail (proxy != NULL);
	_tmp0_ = self->priv->_statusbar;
	_tmp1_ = self->priv->_tip_message_cid;
	gtk_statusbar_pop ((GtkStatusbar*) _tmp0_, _tmp1_);
}


static GtkToolbar* main_window_get_main_toolbar (MainWindow* self) {
	GtkToolbar* result = NULL;
	GtkToolbar* main_toolbar = NULL;
	GtkUIManager* _tmp0_ = NULL;
	GtkWidget* _tmp1_ = NULL;
	GtkToolbar* _tmp2_ = NULL;
	GtkToolItem* open_button = NULL;
	MainWindowFile* _tmp3_ = NULL;
	GtkToolItem* _tmp4_ = NULL;
	GtkStyleContext* context = NULL;
	GtkStyleContext* _tmp5_ = NULL;
	GtkStyleContext* _tmp6_ = NULL;
	GtkToggleAction* action = NULL;
	GtkActionGroup* _tmp7_ = NULL;
	GtkAction* _tmp8_ = NULL;
	GtkToggleAction* _tmp9_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_ui_manager;
	_tmp1_ = gtk_ui_manager_get_widget (_tmp0_, "/MainToolbar");
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, gtk_toolbar_get_type ()) ? ((GtkToolbar*) _tmp1_) : NULL);
	main_toolbar = _tmp2_;
	_tmp3_ = self->priv->_main_window_file;
	_tmp4_ = main_window_file_get_toolbar_open_button (_tmp3_);
	open_button = _tmp4_;
	gtk_toolbar_insert (main_toolbar, open_button, 1);
	gtk_toolbar_set_style (main_toolbar, GTK_TOOLBAR_ICONS);
	_tmp5_ = gtk_widget_get_style_context ((GtkWidget*) main_toolbar);
	_tmp6_ = _g_object_ref0 (_tmp5_);
	context = _tmp6_;
	gtk_style_context_add_class (context, GTK_STYLE_CLASS_PRIMARY_TOOLBAR);
	gtk_widget_show_all ((GtkWidget*) main_toolbar);
	_tmp7_ = self->priv->_action_group;
	_tmp8_ = gtk_action_group_get_action (_tmp7_, "ViewMainToolbar");
	_tmp9_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, gtk_toggle_action_get_type ()) ? ((GtkToggleAction*) _tmp8_) : NULL);
	action = _tmp9_;
	gtk_toggle_action_set_active (action, TRUE);
	g_object_bind_property_with_closures ((GObject*) main_toolbar, "visible", (GObject*) action, "active", G_BINDING_BIDIRECTIONAL, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, NULL)));
	result = main_toolbar;
	_g_object_unref0 (action);
	_g_object_unref0 (context);
	_g_object_unref0 (open_button);
	return result;
}


static GtkToolbar* main_window_get_edit_toolbar (MainWindow* self) {
	GtkToolbar* result = NULL;
	GtkToolbar* edit_toolbar = NULL;
	GtkUIManager* _tmp0_ = NULL;
	GtkWidget* _tmp1_ = NULL;
	GtkToolbar* _tmp2_ = NULL;
	GtkStyleContext* context = NULL;
	GtkStyleContext* _tmp3_ = NULL;
	GtkStyleContext* _tmp4_ = NULL;
	GtkToggleAction* action = NULL;
	GtkActionGroup* _tmp5_ = NULL;
	GtkAction* _tmp6_ = NULL;
	GtkToggleAction* _tmp7_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_ui_manager;
	_tmp1_ = gtk_ui_manager_get_widget (_tmp0_, "/EditToolbar");
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, gtk_toolbar_get_type ()) ? ((GtkToolbar*) _tmp1_) : NULL);
	edit_toolbar = _tmp2_;
	gtk_toolbar_set_style (edit_toolbar, GTK_TOOLBAR_ICONS);
	_tmp3_ = gtk_widget_get_style_context ((GtkWidget*) edit_toolbar);
	_tmp4_ = _g_object_ref0 (_tmp3_);
	context = _tmp4_;
	gtk_style_context_add_class (context, "latexila-edit-toolbar");
	gtk_widget_show_all ((GtkWidget*) edit_toolbar);
	_tmp5_ = self->priv->_action_group;
	_tmp6_ = gtk_action_group_get_action (_tmp5_, "ViewEditToolbar");
	_tmp7_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp6_, gtk_toggle_action_get_type ()) ? ((GtkToggleAction*) _tmp6_) : NULL);
	action = _tmp7_;
	gtk_toggle_action_set_active (action, TRUE);
	g_object_bind_property_with_closures ((GObject*) edit_toolbar, "visible", (GObject*) action, "active", G_BINDING_BIDIRECTIONAL, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, NULL)));
	result = edit_toolbar;
	_g_object_unref0 (action);
	_g_object_unref0 (context);
	return result;
}


static SidePanel* main_window_get_side_panel (MainWindow* self) {
	SidePanel* result = NULL;
	SidePanel* side_panel = NULL;
	SidePanel* _tmp0_ = NULL;
	GtkToggleAction* action = NULL;
	GtkActionGroup* _tmp1_ = NULL;
	GtkAction* _tmp2_ = NULL;
	GtkToggleAction* _tmp3_ = NULL;
	SymbolsView* symbols = NULL;
	SymbolsView* _tmp4_ = NULL;
	const gchar* _tmp5_ = NULL;
	FileBrowser* file_browser = NULL;
	FileBrowser* _tmp6_ = NULL;
	const gchar* _tmp7_ = NULL;
	Structure* structure = NULL;
	Structure* _tmp8_ = NULL;
	MainWindowStructure* _tmp9_ = NULL;
	const gchar* _tmp10_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = side_panel_new ();
	g_object_ref_sink (_tmp0_);
	side_panel = _tmp0_;
	gtk_widget_show ((GtkWidget*) side_panel);
	_tmp1_ = self->priv->_action_group;
	_tmp2_ = gtk_action_group_get_action (_tmp1_, "ViewSidePanel");
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, gtk_toggle_action_get_type ()) ? ((GtkToggleAction*) _tmp2_) : NULL);
	action = _tmp3_;
	gtk_toggle_action_set_active (action, TRUE);
	g_object_bind_property_with_closures ((GObject*) side_panel, "visible", (GObject*) action, "active", G_BINDING_BIDIRECTIONAL, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, NULL)));
	_tmp4_ = symbols_view_new (self);
	g_object_ref_sink (_tmp4_);
	symbols = _tmp4_;
	_tmp5_ = _ ("Symbols");
	side_panel_add_component (side_panel, _tmp5_, "symbol_greek", (GtkGrid*) symbols);
	_tmp6_ = file_browser_new (self);
	g_object_ref_sink (_tmp6_);
	file_browser = _tmp6_;
	_tmp7_ = _ ("File Browser");
	side_panel_add_component (side_panel, _tmp7_, GTK_STOCK_OPEN, (GtkGrid*) file_browser);
	_tmp8_ = structure_new (self);
	g_object_ref_sink (_tmp8_);
	structure = _tmp8_;
	_tmp9_ = self->priv->_main_window_structure;
	main_window_structure_set_structure (_tmp9_, structure);
	_tmp10_ = _ ("Structure");
	side_panel_add_component (side_panel, _tmp10_, GTK_STOCK_INDEX, (GtkGrid*) structure);
	side_panel_restore_state (side_panel);
	result = side_panel;
	_g_object_unref0 (structure);
	_g_object_unref0 (file_browser);
	_g_object_unref0 (symbols);
	_g_object_unref0 (action);
	return result;
}


static void __lambda119_ (MainWindow* self, GdkEventButton* event) {
	GtkMenu* popup_menu = NULL;
	GtkUIManager* _tmp0_ = NULL;
	GtkWidget* _tmp1_ = NULL;
	GtkMenu* _tmp2_ = NULL;
	GdkEventButton* _tmp3_ = NULL;
	guint _tmp4_ = 0U;
	GdkEventButton* _tmp5_ = NULL;
	guint32 _tmp6_ = 0U;
	g_return_if_fail (event != NULL);
	_tmp0_ = self->priv->_ui_manager;
	_tmp1_ = gtk_ui_manager_get_widget (_tmp0_, "/NotebookPopup");
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, gtk_menu_get_type ()) ? ((GtkMenu*) _tmp1_) : NULL);
	popup_menu = _tmp2_;
	_tmp3_ = event;
	_tmp4_ = _tmp3_->button;
	_tmp5_ = event;
	_tmp6_ = _tmp5_->time;
	gtk_menu_popup (popup_menu, NULL, NULL, NULL, NULL, _tmp4_, _tmp6_);
	_g_object_unref0 (popup_menu);
}


static void ___lambda119__documents_panel_right_click (DocumentsPanel* _sender, GdkEventButton* event, gpointer self) {
	__lambda119_ ((MainWindow*) self, event);
}


static void __lambda120_ (MainWindow* self) {
	gint nb_pages = 0;
	DocumentsPanel* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
	_tmp0_ = self->priv->_documents_panel;
	_tmp1_ = gtk_notebook_get_n_pages ((GtkNotebook*) _tmp0_);
	nb_pages = _tmp1_;
	_tmp2_ = nb_pages;
	if (_tmp2_ == 1) {
		main_window_set_file_actions_sensitivity (self, TRUE);
	}
}


static void ___lambda120__gtk_notebook_page_added (GtkNotebook* _sender, GtkWidget* child, guint page_num, gpointer self) {
	__lambda120_ ((MainWindow*) self);
}


static void __lambda121_ (MainWindow* self) {
	gint nb_pages = 0;
	DocumentsPanel* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
	_tmp0_ = self->priv->_documents_panel;
	_tmp1_ = gtk_notebook_get_n_pages ((GtkNotebook*) _tmp0_);
	nb_pages = _tmp1_;
	_tmp2_ = nb_pages;
	if (_tmp2_ == 0) {
		CustomStatusbar* _tmp3_ = NULL;
		GotoLine* _tmp4_ = NULL;
		SearchAndReplace* _tmp5_ = NULL;
		_tmp3_ = self->priv->_statusbar;
		custom_statusbar_set_cursor_position (_tmp3_, -1, -1);
		main_window_set_file_actions_sensitivity (self, FALSE);
		_tmp4_ = self->priv->_goto_line;
		gtk_widget_hide ((GtkWidget*) _tmp4_);
		_tmp5_ = self->priv->_search_and_replace;
		search_and_replace_hide (_tmp5_);
		g_object_notify ((GObject*) self, "active-tab");
		g_object_notify ((GObject*) self, "active-document");
		g_object_notify ((GObject*) self, "active-view");
	}
	main_window_my_set_title (self);
}


static void ___lambda121__gtk_notebook_page_removed (GtkNotebook* _sender, GtkWidget* child, guint page_num, gpointer self) {
	__lambda121_ ((MainWindow*) self);
}


static void __lambda122_ (MainWindow* self, GtkWidget* pg, guint page_num) {
	MainWindowEdit* _tmp0_ = NULL;
	MainWindowBuildTools* _tmp1_ = NULL;
	g_return_if_fail (pg != NULL);
	_tmp0_ = self->priv->_main_window_edit;
	main_window_edit_update_sensitivity (_tmp0_);
	_tmp1_ = self->priv->_main_window_build_tools;
	main_window_build_tools_update_sensitivity (_tmp1_);
	main_window_update_config_project_sensitivity (self);
	main_window_my_set_title (self);
	main_window_update_cursor_position_statusbar (self);
	g_object_notify ((GObject*) self, "active-tab");
	g_object_notify ((GObject*) self, "active-document");
	g_object_notify ((GObject*) self, "active-view");
}


static void ___lambda122__gtk_notebook_switch_page (GtkNotebook* _sender, GtkWidget* page, guint page_num, gpointer self) {
	__lambda122_ ((MainWindow*) self, page, page_num);
}


static void main_window_init_documents_panel (MainWindow* self) {
	DocumentsPanel* _tmp0_ = NULL;
	DocumentsPanel* _tmp1_ = NULL;
	MainWindowDocuments* _tmp2_ = NULL;
	DocumentsPanel* _tmp3_ = NULL;
	DocumentsPanel* _tmp4_ = NULL;
	DocumentsPanel* _tmp5_ = NULL;
	DocumentsPanel* _tmp6_ = NULL;
	DocumentsPanel* _tmp7_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = documents_panel_new (self);
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->_documents_panel);
	self->priv->_documents_panel = _tmp0_;
	_tmp1_ = self->priv->_documents_panel;
	gtk_widget_show_all ((GtkWidget*) _tmp1_);
	_tmp2_ = self->priv->_main_window_documents;
	_tmp3_ = self->priv->_documents_panel;
	main_window_documents_set_documents_panel (_tmp2_, _tmp3_);
	_tmp4_ = self->priv->_documents_panel;
	g_signal_connect_object (_tmp4_, "right-click", (GCallback) ___lambda119__documents_panel_right_click, self, 0);
	_tmp5_ = self->priv->_documents_panel;
	g_signal_connect_object ((GtkNotebook*) _tmp5_, "page-added", (GCallback) ___lambda120__gtk_notebook_page_added, self, 0);
	_tmp6_ = self->priv->_documents_panel;
	g_signal_connect_object ((GtkNotebook*) _tmp6_, "page-removed", (GCallback) ___lambda121__gtk_notebook_page_removed, self, 0);
	_tmp7_ = self->priv->_documents_panel;
	g_signal_connect_object ((GtkNotebook*) _tmp7_, "switch-page", (GCallback) ___lambda122__gtk_notebook_switch_page, self, 0);
}


static BottomPanel* main_window_get_bottom_panel (MainWindow* self) {
	BottomPanel* result = NULL;
	LatexilaBuildView* build_view = NULL;
	LatexilaBuildView* _tmp0_ = NULL;
	MainWindowBuildTools* _tmp1_ = NULL;
	GtkToolbar* build_toolbar = NULL;
	GtkUIManager* _tmp2_ = NULL;
	GtkWidget* _tmp3_ = NULL;
	GtkToolbar* _tmp4_ = NULL;
	BottomPanel* bottom_panel = NULL;
	BottomPanel* _tmp5_ = NULL;
	GtkToggleAction* action = NULL;
	GtkActionGroup* _tmp6_ = NULL;
	GtkAction* _tmp7_ = NULL;
	GtkToggleAction* _tmp8_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = latexila_build_view_new ();
	g_object_ref_sink (_tmp0_);
	build_view = _tmp0_;
	_tmp1_ = self->priv->_main_window_build_tools;
	main_window_build_tools_set_build_view (_tmp1_, build_view);
	_tmp2_ = self->priv->_ui_manager;
	_tmp3_ = gtk_ui_manager_get_widget (_tmp2_, "/BuildToolbar");
	_tmp4_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, gtk_toolbar_get_type ()) ? ((GtkToolbar*) _tmp3_) : NULL);
	build_toolbar = _tmp4_;
	gtk_toolbar_set_style (build_toolbar, GTK_TOOLBAR_ICONS);
	gtk_toolbar_set_icon_size (build_toolbar, GTK_ICON_SIZE_MENU);
	gtk_orientable_set_orientation ((GtkOrientable*) build_toolbar, GTK_ORIENTATION_VERTICAL);
	_tmp5_ = bottom_panel_new (build_view, build_toolbar);
	g_object_ref_sink (_tmp5_);
	bottom_panel = _tmp5_;
	_tmp6_ = self->priv->_action_group;
	_tmp7_ = gtk_action_group_get_action (_tmp6_, "ViewBottomPanel");
	_tmp8_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp7_, gtk_toggle_action_get_type ()) ? ((GtkToggleAction*) _tmp7_) : NULL);
	action = _tmp8_;
	gtk_toggle_action_set_active (action, FALSE);
	g_object_bind_property_with_closures ((GObject*) bottom_panel, "visible", (GObject*) action, "active", G_BINDING_BIDIRECTIONAL, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, NULL)));
	result = bottom_panel;
	_g_object_unref0 (action);
	_g_object_unref0 (build_toolbar);
	_g_object_unref0 (build_view);
	return result;
}


static void main_window_restore_state (MainWindow* self) {
	GSettings* settings = NULL;
	GSettings* _tmp0_ = NULL;
	gint width = 0;
	gint height = 0;
	GSettings* _tmp1_ = NULL;
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
	GdkWindowState state = 0;
	GSettings* _tmp4_ = NULL;
	gint _tmp5_ = 0;
	GdkWindowState _tmp6_ = 0;
	GdkWindowState _tmp7_ = 0;
	GtkPaned* _tmp8_ = NULL;
	GSettings* _tmp9_ = NULL;
	gint _tmp10_ = 0;
	GtkPaned* _tmp11_ = NULL;
	GSettings* _tmp12_ = NULL;
	gint _tmp13_ = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_settings_new ("org.gnome.latexila.state.window");
	settings = _tmp0_;
	_tmp1_ = settings;
	g_settings_get (_tmp1_, "size", "(ii)", &width, &height);
	_tmp2_ = width;
	_tmp3_ = height;
	gtk_window_set_default_size ((GtkWindow*) self, _tmp2_, _tmp3_);
	_tmp4_ = settings;
	_tmp5_ = g_settings_get_int (_tmp4_, "state");
	state = (GdkWindowState) _tmp5_;
	_tmp6_ = state;
	if ((_tmp6_ & GDK_WINDOW_STATE_MAXIMIZED) == GDK_WINDOW_STATE_MAXIMIZED) {
		gtk_window_maximize ((GtkWindow*) self);
	} else {
		gtk_window_unmaximize ((GtkWindow*) self);
	}
	_tmp7_ = state;
	if ((_tmp7_ & GDK_WINDOW_STATE_STICKY) == GDK_WINDOW_STATE_STICKY) {
		gtk_window_stick ((GtkWindow*) self);
	} else {
		gtk_window_unstick ((GtkWindow*) self);
	}
	_tmp8_ = self->priv->_main_hpaned;
	_tmp9_ = settings;
	_tmp10_ = g_settings_get_int (_tmp9_, "side-panel-size");
	gtk_paned_set_position (_tmp8_, _tmp10_);
	_tmp11_ = self->priv->_vpaned;
	_tmp12_ = settings;
	_tmp13_ = g_settings_get_int (_tmp12_, "vertical-paned-position");
	gtk_paned_set_position (_tmp11_, _tmp13_);
	_g_object_unref0 (settings);
}


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


static void __lambda123_ (MainWindow* self, GdkDragContext* dc, gint x, gint y, GtkSelectionData* selection_data, guint info, guint time) {
	LatexilaApp* app = NULL;
	LatexilaApp* _tmp0_ = NULL;
	GFile** files = NULL;
	GFile** _tmp1_ = NULL;
	gint files_length1 = 0;
	gint _files_size_ = 0;
	GtkSelectionData* _tmp2_ = NULL;
	gchar** _tmp3_ = NULL;
	gchar** _tmp4_ = NULL;
	LatexilaApp* _tmp12_ = NULL;
	GFile** _tmp13_ = NULL;
	gint _tmp13__length1 = 0;
	GdkDragContext* _tmp14_ = NULL;
	guint _tmp15_ = 0U;
	g_return_if_fail (dc != NULL);
	g_return_if_fail (selection_data != NULL);
	_tmp0_ = latexila_app_get_instance ();
	app = _tmp0_;
	_tmp1_ = g_new0 (GFile*, 0 + 1);
	files = _tmp1_;
	files_length1 = 0;
	_files_size_ = files_length1;
	_tmp2_ = selection_data;
	_tmp4_ = _tmp3_ = gtk_selection_data_get_uris (_tmp2_);
	{
		gchar** uri_collection = NULL;
		gint uri_collection_length1 = 0;
		gint _uri_collection_size_ = 0;
		gint uri_it = 0;
		uri_collection = _tmp4_;
		uri_collection_length1 = _vala_array_length (_tmp3_);
		for (uri_it = 0; uri_it < _vala_array_length (_tmp3_); uri_it = uri_it + 1) {
			gchar* _tmp5_ = NULL;
			gchar* uri = NULL;
			_tmp5_ = g_strdup (uri_collection[uri_it]);
			uri = _tmp5_;
			{
				const gchar* _tmp6_ = NULL;
				gint _tmp7_ = 0;
				gint _tmp8_ = 0;
				_tmp6_ = uri;
				_tmp7_ = strlen (_tmp6_);
				_tmp8_ = _tmp7_;
				if (0 < _tmp8_) {
					GFile** _tmp9_ = NULL;
					gint _tmp9__length1 = 0;
					const gchar* _tmp10_ = NULL;
					GFile* _tmp11_ = NULL;
					_tmp9_ = files;
					_tmp9__length1 = files_length1;
					_tmp10_ = uri;
					_tmp11_ = g_file_new_for_uri (_tmp10_);
					_vala_array_add8 (&files, &files_length1, &_files_size_, _tmp11_);
				}
				_g_free0 (uri);
			}
		}
		uri_collection = (_vala_array_free (uri_collection, uri_collection_length1, (GDestroyNotify) g_free), NULL);
	}
	_tmp12_ = app;
	_tmp13_ = files;
	_tmp13__length1 = files_length1;
	latexila_app_open_documents (_tmp12_, _tmp13_, _tmp13__length1);
	_tmp14_ = dc;
	_tmp15_ = time;
	gtk_drag_finish (_tmp14_, TRUE, TRUE, (guint32) _tmp15_);
	files = (_vala_array_free (files, files_length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (app);
}


static void ___lambda123__gtk_widget_drag_data_received (GtkWidget* _sender, GdkDragContext* context, gint x, gint y, GtkSelectionData* selection_data, guint info, guint time_, gpointer self) {
	__lambda123_ ((MainWindow*) self, context, x, y, selection_data, info, time_);
}


static void main_window_support_drag_and_drop (MainWindow* self) {
	GtkTargetEntry* _tmp0_ = NULL;
	GtkTargetEntry* _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_new0 (GtkTargetEntry, 0);
	_tmp1_ = _tmp0_;
	_tmp1__length1 = 0;
	gtk_drag_dest_set ((GtkWidget*) self, GTK_DEST_DEFAULT_ALL, _tmp1_, 0, GDK_ACTION_COPY);
	_tmp1_ = (g_free (_tmp1_), NULL);
	gtk_drag_dest_add_uri_targets ((GtkWidget*) self);
	g_signal_connect_object ((GtkWidget*) self, "drag-data-received", (GCallback) ___lambda123__gtk_widget_drag_data_received, self, 0);
}


static GdkEventWindowState* _vala_GdkEventWindowState_copy (GdkEventWindowState* self) {
	return g_boxed_copy (gdk_event_get_type (), self);
}


static gpointer __vala_GdkEventWindowState_copy0 (gpointer self) {
	return self ? _vala_GdkEventWindowState_copy (self) : NULL;
}


static void _vala_GdkEventWindowState_free (GdkEventWindowState* self) {
	g_boxed_free (gdk_event_get_type (), self);
}


static gboolean __lambda124_ (MainWindow* self, GdkEventWindowState* e) {
	gboolean result = FALSE;
	GdkEventWindowState* event = NULL;
	GdkEventWindowState* _tmp0_ = NULL;
	GdkEventWindowState* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	GdkEventWindowState* _tmp3_ = NULL;
	GdkWindowState _tmp4_ = 0;
	g_return_val_if_fail (e != NULL, FALSE);
	_tmp0_ = e;
	_tmp1_ = __vala_GdkEventWindowState_copy0 (_tmp0_);
	event = _tmp1_;
	_tmp3_ = event;
	_tmp4_ = _tmp3_->changed_mask;
	if ((_tmp4_ & GDK_WINDOW_STATE_MAXIMIZED) == GDK_WINDOW_STATE_MAXIMIZED) {
		GdkEventWindowState* _tmp5_ = NULL;
		GdkWindowState _tmp6_ = 0;
		_tmp5_ = event;
		_tmp6_ = _tmp5_->new_window_state;
		_tmp2_ = !((_tmp6_ & GDK_WINDOW_STATE_MAXIMIZED) == GDK_WINDOW_STATE_MAXIMIZED);
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		gint width = 0;
		GdkScreen* _tmp7_ = NULL;
		GdkScreen* _tmp8_ = NULL;
		gint _tmp9_ = 0;
		gint height = 0;
		GdkScreen* _tmp10_ = NULL;
		GdkScreen* _tmp11_ = NULL;
		gint _tmp12_ = 0;
		gint _tmp13_ = 0;
		gint _tmp14_ = 0;
		_tmp7_ = gtk_window_get_screen ((GtkWindow*) self);
		_tmp8_ = _tmp7_;
		_tmp9_ = gdk_screen_get_width (_tmp8_);
		width = _tmp9_;
		_tmp10_ = gtk_window_get_screen ((GtkWindow*) self);
		_tmp11_ = _tmp10_;
		_tmp12_ = gdk_screen_get_height (_tmp11_);
		height = _tmp12_;
		_tmp13_ = width;
		_tmp14_ = height;
		gtk_window_resize ((GtkWindow*) self, _tmp13_ - 100, _tmp14_ - 100);
		result = TRUE;
		__vala_GdkEventWindowState_free0 (event);
		return result;
	}
	result = FALSE;
	__vala_GdkEventWindowState_free0 (event);
	return result;
}


static gboolean ___lambda124__gtk_widget_window_state_event (GtkWidget* _sender, GdkEventWindowState* event, gpointer self) {
	gboolean result;
	result = __lambda124_ ((MainWindow*) self, event);
	return result;
}


static void main_window_shrink_window_when_unmaximized (MainWindow* self) {
	g_return_if_fail (self != NULL);
	g_signal_connect_object ((GtkWidget*) self, "window-state-event", (GCallback) ___lambda124__gtk_widget_window_state_event, self, 0);
}


static void main_window_show_or_hide_widgets (MainWindow* self) {
	GSettings* settings = NULL;
	GSettings* _tmp0_ = NULL;
	GtkToggleAction* action = NULL;
	GtkActionGroup* _tmp1_ = NULL;
	GtkAction* _tmp2_ = NULL;
	GtkToggleAction* _tmp3_ = NULL;
	GtkToggleAction* _tmp4_ = NULL;
	gboolean _tmp5_ = FALSE;
	GtkActionGroup* _tmp6_ = NULL;
	GtkAction* _tmp7_ = NULL;
	GtkToggleAction* _tmp8_ = NULL;
	GtkToggleAction* _tmp9_ = NULL;
	gboolean _tmp10_ = FALSE;
	GtkActionGroup* _tmp11_ = NULL;
	GtkAction* _tmp12_ = NULL;
	GtkToggleAction* _tmp13_ = NULL;
	GtkToggleAction* _tmp14_ = NULL;
	gboolean _tmp15_ = FALSE;
	GtkActionGroup* _tmp16_ = NULL;
	GtkAction* _tmp17_ = NULL;
	GtkToggleAction* _tmp18_ = NULL;
	GtkToggleAction* _tmp19_ = NULL;
	gboolean _tmp20_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_settings_new ("org.gnome.latexila.preferences.ui");
	settings = _tmp0_;
	_tmp1_ = self->priv->_action_group;
	_tmp2_ = gtk_action_group_get_action (_tmp1_, "ViewMainToolbar");
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, gtk_toggle_action_get_type ()) ? ((GtkToggleAction*) _tmp2_) : NULL);
	action = _tmp3_;
	_tmp4_ = action;
	_tmp5_ = g_settings_get_boolean (settings, "main-toolbar-visible");
	gtk_toggle_action_set_active (_tmp4_, _tmp5_);
	_tmp6_ = self->priv->_action_group;
	_tmp7_ = gtk_action_group_get_action (_tmp6_, "ViewEditToolbar");
	_tmp8_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp7_, gtk_toggle_action_get_type ()) ? ((GtkToggleAction*) _tmp7_) : NULL);
	_g_object_unref0 (action);
	action = _tmp8_;
	_tmp9_ = action;
	_tmp10_ = g_settings_get_boolean (settings, "edit-toolbar-visible");
	gtk_toggle_action_set_active (_tmp9_, _tmp10_);
	_tmp11_ = self->priv->_action_group;
	_tmp12_ = gtk_action_group_get_action (_tmp11_, "ViewSidePanel");
	_tmp13_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp12_, gtk_toggle_action_get_type ()) ? ((GtkToggleAction*) _tmp12_) : NULL);
	_g_object_unref0 (action);
	action = _tmp13_;
	_tmp14_ = action;
	_tmp15_ = g_settings_get_boolean (settings, "side-panel-visible");
	gtk_toggle_action_set_active (_tmp14_, _tmp15_);
	_tmp16_ = self->priv->_action_group;
	_tmp17_ = gtk_action_group_get_action (_tmp16_, "ViewBottomPanel");
	_tmp18_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp17_, gtk_toggle_action_get_type ()) ? ((GtkToggleAction*) _tmp17_) : NULL);
	_g_object_unref0 (action);
	action = _tmp18_;
	_tmp19_ = action;
	_tmp20_ = g_settings_get_boolean (settings, "bottom-panel-visible");
	gtk_toggle_action_set_active (_tmp19_, _tmp20_);
	_g_object_unref0 (action);
	_g_object_unref0 (settings);
}


/*************************************************************************/
GeeList* main_window_get_documents (MainWindow* self) {
	GeeList* result = NULL;
	GeeList* all_documents = NULL;
	GeeLinkedList* _tmp0_ = NULL;
	gint nb_documents = 0;
	DocumentsPanel* _tmp1_ = NULL;
	gint _tmp2_ = 0;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = gee_linked_list_new (TYPE_DOCUMENT, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL);
	all_documents = (GeeList*) _tmp0_;
	_tmp1_ = self->priv->_documents_panel;
	_tmp2_ = gtk_notebook_get_n_pages ((GtkNotebook*) _tmp1_);
	nb_documents = _tmp2_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp3_ = FALSE;
			_tmp3_ = TRUE;
			while (TRUE) {
				gint _tmp5_ = 0;
				gint _tmp6_ = 0;
				DocumentTab* tab = NULL;
				DocumentsPanel* _tmp7_ = NULL;
				gint _tmp8_ = 0;
				GtkWidget* _tmp9_ = NULL;
				DocumentTab* _tmp10_ = NULL;
				GeeList* _tmp11_ = NULL;
				DocumentTab* _tmp12_ = NULL;
				Document* _tmp13_ = NULL;
				Document* _tmp14_ = NULL;
				if (!_tmp3_) {
					gint _tmp4_ = 0;
					_tmp4_ = i;
					i = _tmp4_ + 1;
				}
				_tmp3_ = FALSE;
				_tmp5_ = i;
				_tmp6_ = nb_documents;
				if (!(_tmp5_ < _tmp6_)) {
					break;
				}
				_tmp7_ = self->priv->_documents_panel;
				_tmp8_ = i;
				_tmp9_ = gtk_notebook_get_nth_page ((GtkNotebook*) _tmp7_, _tmp8_);
				_tmp10_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp9_, TYPE_DOCUMENT_TAB) ? ((DocumentTab*) _tmp9_) : NULL);
				tab = _tmp10_;
				_tmp11_ = all_documents;
				_tmp12_ = tab;
				_tmp13_ = document_tab_get_document (_tmp12_);
				_tmp14_ = _tmp13_;
				gee_collection_add ((GeeCollection*) _tmp11_, _tmp14_);
				_g_object_unref0 (tab);
			}
		}
	}
	result = all_documents;
	return result;
}


GeeList* main_window_get_unsaved_documents (MainWindow* self) {
	GeeList* result = NULL;
	GeeList* unsaved_documents = NULL;
	GeeLinkedList* _tmp0_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = gee_linked_list_new (TYPE_DOCUMENT, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL);
	unsaved_documents = (GeeList*) _tmp0_;
	{
		GeeList* _doc_list = NULL;
		GeeList* _tmp1_ = NULL;
		gint _doc_size = 0;
		GeeList* _tmp2_ = NULL;
		gint _tmp3_ = 0;
		gint _tmp4_ = 0;
		gint _doc_index = 0;
		_tmp1_ = main_window_get_documents (self);
		_doc_list = _tmp1_;
		_tmp2_ = _doc_list;
		_tmp3_ = gee_collection_get_size ((GeeCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_doc_size = _tmp4_;
		_doc_index = -1;
		while (TRUE) {
			gint _tmp5_ = 0;
			gint _tmp6_ = 0;
			gint _tmp7_ = 0;
			Document* doc = NULL;
			GeeList* _tmp8_ = NULL;
			gint _tmp9_ = 0;
			gpointer _tmp10_ = NULL;
			Document* _tmp11_ = NULL;
			gboolean _tmp12_ = FALSE;
			_tmp5_ = _doc_index;
			_doc_index = _tmp5_ + 1;
			_tmp6_ = _doc_index;
			_tmp7_ = _doc_size;
			if (!(_tmp6_ < _tmp7_)) {
				break;
			}
			_tmp8_ = _doc_list;
			_tmp9_ = _doc_index;
			_tmp10_ = gee_list_get (_tmp8_, _tmp9_);
			doc = (Document*) _tmp10_;
			_tmp11_ = doc;
			_tmp12_ = document_get_modified (_tmp11_);
			if (_tmp12_) {
				GeeList* _tmp13_ = NULL;
				Document* _tmp14_ = NULL;
				_tmp13_ = unsaved_documents;
				_tmp14_ = doc;
				gee_collection_add ((GeeCollection*) _tmp13_, _tmp14_);
			}
			_g_object_unref0 (doc);
		}
		_g_object_unref0 (_doc_list);
	}
	result = unsaved_documents;
	return result;
}


GeeList* main_window_get_views (MainWindow* self) {
	GeeList* result = NULL;
	GeeList* all_views = NULL;
	GeeLinkedList* _tmp0_ = NULL;
	DocumentsPanel* _tmp1_ = NULL;
	gint nb_documents = 0;
	DocumentsPanel* _tmp2_ = NULL;
	gint _tmp3_ = 0;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = gee_linked_list_new (TYPE_DOCUMENT, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL);
	all_views = (GeeList*) _tmp0_;
	_tmp1_ = self->priv->_documents_panel;
	if (_tmp1_ == NULL) {
		result = all_views;
		return result;
	}
	_tmp2_ = self->priv->_documents_panel;
	_tmp3_ = gtk_notebook_get_n_pages ((GtkNotebook*) _tmp2_);
	nb_documents = _tmp3_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp4_ = FALSE;
			_tmp4_ = TRUE;
			while (TRUE) {
				gint _tmp6_ = 0;
				gint _tmp7_ = 0;
				DocumentTab* tab = NULL;
				DocumentsPanel* _tmp8_ = NULL;
				gint _tmp9_ = 0;
				GtkWidget* _tmp10_ = NULL;
				DocumentTab* _tmp11_ = NULL;
				GeeList* _tmp12_ = NULL;
				DocumentTab* _tmp13_ = NULL;
				DocumentView* _tmp14_ = NULL;
				DocumentView* _tmp15_ = NULL;
				if (!_tmp4_) {
					gint _tmp5_ = 0;
					_tmp5_ = i;
					i = _tmp5_ + 1;
				}
				_tmp4_ = FALSE;
				_tmp6_ = i;
				_tmp7_ = nb_documents;
				if (!(_tmp6_ < _tmp7_)) {
					break;
				}
				_tmp8_ = self->priv->_documents_panel;
				_tmp9_ = i;
				_tmp10_ = gtk_notebook_get_nth_page ((GtkNotebook*) _tmp8_, _tmp9_);
				_tmp11_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp10_, TYPE_DOCUMENT_TAB) ? ((DocumentTab*) _tmp10_) : NULL);
				tab = _tmp11_;
				_tmp12_ = all_views;
				_tmp13_ = tab;
				_tmp14_ = document_tab_get_view (_tmp13_);
				_tmp15_ = _tmp14_;
				gee_collection_add ((GeeCollection*) _tmp12_, _tmp15_);
				_g_object_unref0 (tab);
			}
		}
	}
	result = all_views;
	return result;
}


static Block21Data* block21_data_ref (Block21Data* _data21_) {
	g_atomic_int_inc (&_data21_->_ref_count_);
	return _data21_;
}


static void block21_data_unref (void * _userdata_) {
	Block21Data* _data21_;
	_data21_ = (Block21Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data21_->_ref_count_)) {
		MainWindow* self;
		self = _data21_->self;
		_g_object_unref0 (_data21_->infobar);
		_g_object_unref0 (_data21_->tab);
		_g_object_unref0 (self);
		g_slice_free (Block21Data, _data21_);
	}
}


static void ______lambda77_ (Block21Data* _data21_, gint response_id) {
	MainWindow* self;
	gint _tmp0_ = 0;
	GtkInfoBar* _tmp4_ = NULL;
	DocumentTab* _tmp5_ = NULL;
	DocumentView* _tmp6_ = NULL;
	DocumentView* _tmp7_ = NULL;
	self = _data21_->self;
	_tmp0_ = response_id;
	if (_tmp0_ == ((gint) GTK_RESPONSE_YES)) {
		DocumentTab* _tmp1_ = NULL;
		Document* _tmp2_ = NULL;
		Document* _tmp3_ = NULL;
		_tmp1_ = _data21_->tab;
		_tmp2_ = document_tab_get_document (_tmp1_);
		_tmp3_ = _tmp2_;
		document_set_readonly (_tmp3_, FALSE);
	}
	_tmp4_ = _data21_->infobar;
	gtk_widget_destroy ((GtkWidget*) _tmp4_);
	_tmp5_ = _data21_->tab;
	_tmp6_ = document_tab_get_view (_tmp5_);
	_tmp7_ = _tmp6_;
	gtk_widget_grab_focus ((GtkWidget*) _tmp7_);
}


static void _______lambda77__gtk_info_bar_response (GtkInfoBar* _sender, gint response_id, gpointer self) {
	______lambda77_ (self, response_id);
}


DocumentTab* main_window_open_document (MainWindow* self, GFile* location, gboolean jump_to) {
	DocumentTab* result = NULL;
	LatexilaApp* _tmp0_ = NULL;
	LatexilaApp* _tmp1_ = NULL;
	GList* _tmp2_ = NULL;
	GList* _tmp3_ = NULL;
	GFile* _tmp59_ = NULL;
	gboolean _tmp60_ = FALSE;
	DocumentTab* _tmp61_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (location != NULL, NULL);
	_tmp0_ = latexila_app_get_instance ();
	_tmp1_ = _tmp0_;
	_tmp2_ = gtk_application_get_windows ((GtkApplication*) _tmp1_);
	_tmp3_ = _tmp2_;
	_g_object_unref0 (_tmp1_);
	{
		GList* window_collection = NULL;
		GList* window_it = NULL;
		window_collection = _tmp3_;
		for (window_it = window_collection; window_it != NULL; window_it = window_it->next) {
			GtkWindow* _tmp4_ = NULL;
			GtkWindow* window = NULL;
			_tmp4_ = _g_object_ref0 ((GtkWindow*) window_it->data);
			window = _tmp4_;
			{
				MainWindow* w = NULL;
				GtkWindow* _tmp5_ = NULL;
				MainWindow* _tmp6_ = NULL;
				_tmp5_ = window;
				_tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, TYPE_MAIN_WINDOW) ? ((MainWindow*) _tmp5_) : NULL);
				w = _tmp6_;
				{
					GeeList* _doc_list = NULL;
					MainWindow* _tmp7_ = NULL;
					GeeList* _tmp8_ = NULL;
					gint _doc_size = 0;
					GeeList* _tmp9_ = NULL;
					gint _tmp10_ = 0;
					gint _tmp11_ = 0;
					gint _doc_index = 0;
					_tmp7_ = w;
					_tmp8_ = main_window_get_documents (_tmp7_);
					_doc_list = _tmp8_;
					_tmp9_ = _doc_list;
					_tmp10_ = gee_collection_get_size ((GeeCollection*) _tmp9_);
					_tmp11_ = _tmp10_;
					_doc_size = _tmp11_;
					_doc_index = -1;
					while (TRUE) {
						Block21Data* _data21_;
						gint _tmp12_ = 0;
						gint _tmp13_ = 0;
						gint _tmp14_ = 0;
						Document* doc = NULL;
						GeeList* _tmp15_ = NULL;
						gint _tmp16_ = 0;
						gpointer _tmp17_ = NULL;
						gboolean _tmp18_ = FALSE;
						Document* _tmp19_ = NULL;
						GFile* _tmp20_ = NULL;
						GFile* _tmp21_ = NULL;
						MainWindow* _tmp27_ = NULL;
						GFile* _tmp34_ = NULL;
						gboolean _tmp35_ = FALSE;
						DocumentTab* _tmp36_ = NULL;
						DocumentTab* _tmp37_ = NULL;
						Document* _tmp38_ = NULL;
						Document* _tmp39_ = NULL;
						gchar* primary_msg = NULL;
						const gchar* _tmp40_ = NULL;
						GFile* _tmp41_ = NULL;
						gchar* _tmp42_ = NULL;
						gchar* _tmp43_ = NULL;
						gchar* _tmp44_ = NULL;
						gchar* _tmp45_ = NULL;
						gchar* secondary_msg = NULL;
						const gchar* _tmp46_ = NULL;
						gchar* _tmp47_ = NULL;
						DocumentTab* _tmp48_ = NULL;
						const gchar* _tmp49_ = NULL;
						const gchar* _tmp50_ = NULL;
						TabInfoBar* _tmp51_ = NULL;
						GtkInfoBar* _tmp52_ = NULL;
						const gchar* _tmp53_ = NULL;
						GtkInfoBar* _tmp54_ = NULL;
						const gchar* _tmp55_ = NULL;
						GtkInfoBar* _tmp56_ = NULL;
						DocumentTab* _tmp57_ = NULL;
						DocumentTab* _tmp58_ = NULL;
						_data21_ = g_slice_new0 (Block21Data);
						_data21_->_ref_count_ = 1;
						_data21_->self = g_object_ref (self);
						_tmp12_ = _doc_index;
						_doc_index = _tmp12_ + 1;
						_tmp13_ = _doc_index;
						_tmp14_ = _doc_size;
						if (!(_tmp13_ < _tmp14_)) {
							block21_data_unref (_data21_);
							_data21_ = NULL;
							break;
						}
						_tmp15_ = _doc_list;
						_tmp16_ = _doc_index;
						_tmp17_ = gee_list_get (_tmp15_, _tmp16_);
						doc = (Document*) _tmp17_;
						_tmp19_ = doc;
						_tmp20_ = document_get_location (_tmp19_);
						_tmp21_ = _tmp20_;
						if (_tmp21_ == NULL) {
							_tmp18_ = TRUE;
						} else {
							GFile* _tmp22_ = NULL;
							Document* _tmp23_ = NULL;
							GFile* _tmp24_ = NULL;
							GFile* _tmp25_ = NULL;
							gboolean _tmp26_ = FALSE;
							_tmp22_ = location;
							_tmp23_ = doc;
							_tmp24_ = document_get_location (_tmp23_);
							_tmp25_ = _tmp24_;
							_tmp26_ = g_file_equal (_tmp22_, _tmp25_);
							_tmp18_ = !_tmp26_;
						}
						if (_tmp18_) {
							_g_object_unref0 (doc);
							block21_data_unref (_data21_);
							_data21_ = NULL;
							continue;
						}
						_tmp27_ = w;
						if (self == _tmp27_) {
							gboolean _tmp28_ = FALSE;
							Document* _tmp31_ = NULL;
							DocumentTab* _tmp32_ = NULL;
							DocumentTab* _tmp33_ = NULL;
							_tmp28_ = jump_to;
							if (_tmp28_) {
								Document* _tmp29_ = NULL;
								DocumentTab* _tmp30_ = NULL;
								_tmp29_ = doc;
								_tmp30_ = _tmp29_->tab;
								main_window_set_active_tab (self, _tmp30_);
							}
							_tmp31_ = doc;
							_tmp32_ = _tmp31_->tab;
							_tmp33_ = _g_object_ref0 (_tmp32_);
							result = _tmp33_;
							_g_object_unref0 (doc);
							block21_data_unref (_data21_);
							_data21_ = NULL;
							_g_object_unref0 (_doc_list);
							_g_object_unref0 (w);
							_g_object_unref0 (window);
							return result;
						}
						_tmp34_ = location;
						_tmp35_ = jump_to;
						_tmp36_ = main_window_create_tab_from_location (self, _tmp34_, _tmp35_);
						_data21_->tab = _tmp36_;
						_tmp37_ = _data21_->tab;
						_tmp38_ = document_tab_get_document (_tmp37_);
						_tmp39_ = _tmp38_;
						document_set_readonly (_tmp39_, TRUE);
						_tmp40_ = _ ("This file (%s) is already opened in another LaTeXila window.");
						_tmp41_ = location;
						_tmp42_ = g_file_get_parse_name (_tmp41_);
						_tmp43_ = _tmp42_;
						_tmp44_ = g_strdup_printf (_tmp40_, _tmp43_);
						_tmp45_ = _tmp44_;
						_g_free0 (_tmp43_);
						primary_msg = _tmp45_;
						_tmp46_ = _ ("LaTeXila opened this instance of the file in a non-editable way. Do yo" \
"u want to edit it anyway?");
						_tmp47_ = g_strdup (_tmp46_);
						secondary_msg = _tmp47_;
						_tmp48_ = _data21_->tab;
						_tmp49_ = primary_msg;
						_tmp50_ = secondary_msg;
						_tmp51_ = document_tab_add_message (_tmp48_, _tmp49_, _tmp50_, GTK_MESSAGE_WARNING);
						_data21_->infobar = (GtkInfoBar*) _tmp51_;
						_tmp52_ = _data21_->infobar;
						_tmp53_ = _ ("Edit Anyway");
						gtk_info_bar_add_button (_tmp52_, _tmp53_, (gint) GTK_RESPONSE_YES);
						_tmp54_ = _data21_->infobar;
						_tmp55_ = _ ("Don't Edit");
						gtk_info_bar_add_button (_tmp54_, _tmp55_, (gint) GTK_RESPONSE_NO);
						_tmp56_ = _data21_->infobar;
						g_signal_connect_data (_tmp56_, "response", (GCallback) _______lambda77__gtk_info_bar_response, block21_data_ref (_data21_), (GClosureNotify) block21_data_unref, 0);
						_tmp57_ = _data21_->tab;
						_tmp58_ = _g_object_ref0 (_tmp57_);
						result = _tmp58_;
						_g_free0 (secondary_msg);
						_g_free0 (primary_msg);
						_g_object_unref0 (doc);
						block21_data_unref (_data21_);
						_data21_ = NULL;
						_g_object_unref0 (_doc_list);
						_g_object_unref0 (w);
						_g_object_unref0 (window);
						return result;
					}
					_g_object_unref0 (_doc_list);
				}
				_g_object_unref0 (w);
				_g_object_unref0 (window);
			}
		}
	}
	_tmp59_ = location;
	_tmp60_ = jump_to;
	_tmp61_ = main_window_create_tab_from_location (self, _tmp59_, _tmp60_);
	result = _tmp61_;
	return result;
}


DocumentTab* main_window_create_tab (MainWindow* self, gboolean jump_to) {
	DocumentTab* result = NULL;
	DocumentTab* tab = NULL;
	DocumentTab* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	DocumentTab* _tmp2_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = document_tab_new ();
	g_object_ref_sink (_tmp0_);
	tab = _tmp0_;
	_tmp1_ = jump_to;
	_tmp2_ = main_window_process_create_tab (self, tab, _tmp1_);
	result = _tmp2_;
	_g_object_unref0 (tab);
	return result;
}


static DocumentTab* main_window_create_tab_from_location (MainWindow* self, GFile* location, gboolean jump_to) {
	DocumentTab* result = NULL;
	DocumentTab* tab = NULL;
	GFile* _tmp0_ = NULL;
	DocumentTab* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	DocumentTab* _tmp3_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (location != NULL, NULL);
	_tmp0_ = location;
	_tmp1_ = document_tab_new_from_location (_tmp0_);
	g_object_ref_sink (_tmp1_);
	tab = _tmp1_;
	_tmp2_ = jump_to;
	_tmp3_ = main_window_process_create_tab (self, tab, _tmp2_);
	result = _tmp3_;
	_g_object_unref0 (tab);
	return result;
}


void main_window_create_tab_with_view (MainWindow* self, DocumentView* view) {
	DocumentTab* tab = NULL;
	DocumentView* _tmp0_ = NULL;
	DocumentTab* _tmp1_ = NULL;
	DocumentTab* _tmp2_ = NULL;
	DocumentTab* _tmp3_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (view != NULL);
	_tmp0_ = view;
	_tmp1_ = document_tab_new_with_view (_tmp0_);
	g_object_ref_sink (_tmp1_);
	tab = _tmp1_;
	_tmp2_ = main_window_process_create_tab (self, tab, TRUE);
	_tmp3_ = _tmp2_;
	_g_object_unref0 (_tmp3_);
	_g_object_unref0 (tab);
}


static Block22Data* block22_data_ref (Block22Data* _data22_) {
	g_atomic_int_inc (&_data22_->_ref_count_);
	return _data22_;
}


static void block22_data_unref (void * _userdata_) {
	Block22Data* _data22_;
	_data22_ = (Block22Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data22_->_ref_count_)) {
		MainWindow* self;
		self = _data22_->self;
		_g_object_unref0 (_data22_->tab);
		_g_object_unref0 (self);
		g_slice_free (Block22Data, _data22_);
	}
}


static void __lambda16_ (Block22Data* _data22_) {
	MainWindow* self;
	DocumentTab* _tmp0_ = NULL;
	self = _data22_->self;
	_tmp0_ = _data22_->tab;
	main_window_close_tab (self, _tmp0_, FALSE);
}


static void ___lambda16__document_tab_close_document (DocumentTab* _sender, gpointer self) {
	__lambda16_ (self);
}


static void __lambda19_ (Block22Data* _data22_) {
	MainWindow* self;
	DocumentTab* _tmp0_ = NULL;
	DocumentTab* _tmp1_ = NULL;
	DocumentTab* _tmp2_ = NULL;
	self = _data22_->self;
	_tmp0_ = _data22_->tab;
	_tmp1_ = main_window_get_active_tab (self);
	_tmp2_ = _tmp1_;
	if (_tmp0_ == _tmp2_) {
		MainWindowEdit* _tmp3_ = NULL;
		_tmp3_ = self->priv->_main_window_edit;
		main_window_edit_update_sensitivity (_tmp3_);
	}
}


static void ___lambda19__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda19_ (self);
}


static void __lambda30_ (Block22Data* _data22_) {
	MainWindow* self;
	DocumentTab* _tmp0_ = NULL;
	DocumentTab* _tmp1_ = NULL;
	DocumentTab* _tmp2_ = NULL;
	self = _data22_->self;
	_tmp0_ = _data22_->tab;
	_tmp1_ = main_window_get_active_tab (self);
	_tmp2_ = _tmp1_;
	if (_tmp0_ == _tmp2_) {
		MainWindowEdit* _tmp3_ = NULL;
		_tmp3_ = self->priv->_main_window_edit;
		main_window_edit_update_sensitivity (_tmp3_);
	}
}


static void ___lambda30__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda30_ (self);
}


static void __lambda31_ (Block22Data* _data22_) {
	MainWindow* self;
	DocumentTab* _tmp0_ = NULL;
	DocumentTab* _tmp1_ = NULL;
	DocumentTab* _tmp2_ = NULL;
	self = _data22_->self;
	_tmp0_ = _data22_->tab;
	_tmp1_ = main_window_get_active_tab (self);
	_tmp2_ = _tmp1_;
	if (_tmp0_ == _tmp2_) {
		MainWindowEdit* _tmp3_ = NULL;
		_tmp3_ = self->priv->_main_window_edit;
		main_window_edit_update_sensitivity (_tmp3_);
	}
}


static void ___lambda31__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda31_ (self);
}


static void __lambda32_ (Block22Data* _data22_) {
	MainWindow* self;
	DocumentTab* _tmp0_ = NULL;
	MainWindowBuildTools* _tmp1_ = NULL;
	self = _data22_->self;
	_tmp0_ = _data22_->tab;
	main_window_sync_name (self, _tmp0_);
	_tmp1_ = self->priv->_main_window_build_tools;
	main_window_build_tools_update_sensitivity (_tmp1_);
}


static void ___lambda32__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda32_ (self);
}


static void __lambda73_ (MainWindow* self) {
	MainWindowBuildTools* _tmp0_ = NULL;
	_tmp0_ = self->priv->_main_window_build_tools;
	main_window_build_tools_update_sensitivity (_tmp0_);
}


static void ___lambda73__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda73_ ((MainWindow*) self);
}


static void __lambda74_ (Block22Data* _data22_) {
	MainWindow* self;
	DocumentTab* _tmp0_ = NULL;
	self = _data22_->self;
	_tmp0_ = _data22_->tab;
	main_window_sync_name (self, _tmp0_);
}


static void ___lambda74__gtk_text_buffer_modified_changed (GtkTextBuffer* _sender, gpointer self) {
	__lambda74_ (self);
}


static void __lambda75_ (Block22Data* _data22_) {
	MainWindow* self;
	DocumentTab* _tmp0_ = NULL;
	self = _data22_->self;
	_tmp0_ = _data22_->tab;
	main_window_sync_name (self, _tmp0_);
}


static void ___lambda75__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda75_ (self);
}


static void _main_window_update_cursor_position_statusbar_document_cursor_moved (Document* _sender, gpointer self) {
	main_window_update_cursor_position_statusbar ((MainWindow*) self);
}


static DocumentTab* main_window_process_create_tab (MainWindow* self, DocumentTab* tab, gboolean jump_to) {
	DocumentTab* result = NULL;
	Block22Data* _data22_;
	DocumentTab* _tmp0_ = NULL;
	DocumentTab* _tmp1_ = NULL;
	DocumentTab* _tmp2_ = NULL;
	DocumentTab* _tmp3_ = NULL;
	DocumentTab* _tmp4_ = NULL;
	Document* _tmp5_ = NULL;
	Document* _tmp6_ = NULL;
	DocumentTab* _tmp7_ = NULL;
	Document* _tmp8_ = NULL;
	Document* _tmp9_ = NULL;
	DocumentTab* _tmp10_ = NULL;
	Document* _tmp11_ = NULL;
	Document* _tmp12_ = NULL;
	DocumentTab* _tmp13_ = NULL;
	Document* _tmp14_ = NULL;
	Document* _tmp15_ = NULL;
	DocumentTab* _tmp16_ = NULL;
	Document* _tmp17_ = NULL;
	Document* _tmp18_ = NULL;
	DocumentTab* _tmp19_ = NULL;
	Document* _tmp20_ = NULL;
	Document* _tmp21_ = NULL;
	DocumentTab* _tmp22_ = NULL;
	Document* _tmp23_ = NULL;
	Document* _tmp24_ = NULL;
	DocumentTab* _tmp25_ = NULL;
	Document* _tmp26_ = NULL;
	Document* _tmp27_ = NULL;
	DocumentTab* _tmp28_ = NULL;
	DocumentsPanel* _tmp29_ = NULL;
	DocumentTab* _tmp30_ = NULL;
	gboolean _tmp31_ = FALSE;
	MainWindowEdit* _tmp32_ = NULL;
	gboolean _tmp33_ = FALSE;
	DocumentTab* _tmp34_ = NULL;
	DocumentTab* _tmp35_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_data22_ = g_slice_new0 (Block22Data);
	_data22_->_ref_count_ = 1;
	_data22_->self = g_object_ref (self);
	_tmp0_ = tab;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data22_->tab);
	_data22_->tab = _tmp1_;
	_tmp2_ = _data22_->tab;
	if (_tmp2_ == NULL) {
		result = NULL;
		block22_data_unref (_data22_);
		_data22_ = NULL;
		return result;
	}
	_tmp3_ = _data22_->tab;
	g_signal_connect_data (_tmp3_, "close-document", (GCallback) ___lambda16__document_tab_close_document, block22_data_ref (_data22_), (GClosureNotify) block22_data_unref, 0);
	_tmp4_ = _data22_->tab;
	_tmp5_ = document_tab_get_document (_tmp4_);
	_tmp6_ = _tmp5_;
	g_signal_connect_data ((GObject*) _tmp6_, "notify::can-undo", (GCallback) ___lambda19__g_object_notify, block22_data_ref (_data22_), (GClosureNotify) block22_data_unref, 0);
	_tmp7_ = _data22_->tab;
	_tmp8_ = document_tab_get_document (_tmp7_);
	_tmp9_ = _tmp8_;
	g_signal_connect_data ((GObject*) _tmp9_, "notify::can-redo", (GCallback) ___lambda30__g_object_notify, block22_data_ref (_data22_), (GClosureNotify) block22_data_unref, 0);
	_tmp10_ = _data22_->tab;
	_tmp11_ = document_tab_get_document (_tmp10_);
	_tmp12_ = _tmp11_;
	g_signal_connect_data ((GObject*) _tmp12_, "notify::has-selection", (GCallback) ___lambda31__g_object_notify, block22_data_ref (_data22_), (GClosureNotify) block22_data_unref, 0);
	_tmp13_ = _data22_->tab;
	_tmp14_ = document_tab_get_document (_tmp13_);
	_tmp15_ = _tmp14_;
	g_signal_connect_data ((GObject*) _tmp15_, "notify::location", (GCallback) ___lambda32__g_object_notify, block22_data_ref (_data22_), (GClosureNotify) block22_data_unref, 0);
	_tmp16_ = _data22_->tab;
	_tmp17_ = document_tab_get_document (_tmp16_);
	_tmp18_ = _tmp17_;
	g_signal_connect_object ((GObject*) _tmp18_, "notify::project-id", (GCallback) ___lambda73__g_object_notify, self, 0);
	_tmp19_ = _data22_->tab;
	_tmp20_ = document_tab_get_document (_tmp19_);
	_tmp21_ = _tmp20_;
	g_signal_connect_data ((GtkTextBuffer*) _tmp21_, "modified-changed", (GCallback) ___lambda74__gtk_text_buffer_modified_changed, block22_data_ref (_data22_), (GClosureNotify) block22_data_unref, 0);
	_tmp22_ = _data22_->tab;
	_tmp23_ = document_tab_get_document (_tmp22_);
	_tmp24_ = _tmp23_;
	g_signal_connect_data ((GObject*) _tmp24_, "notify::readonly", (GCallback) ___lambda75__g_object_notify, block22_data_ref (_data22_), (GClosureNotify) block22_data_unref, 0);
	_tmp25_ = _data22_->tab;
	_tmp26_ = document_tab_get_document (_tmp25_);
	_tmp27_ = _tmp26_;
	g_signal_connect_object (_tmp27_, "cursor-moved", (GCallback) _main_window_update_cursor_position_statusbar_document_cursor_moved, self, 0);
	_tmp28_ = _data22_->tab;
	gtk_widget_show ((GtkWidget*) _tmp28_);
	_tmp29_ = self->priv->_documents_panel;
	_tmp30_ = _data22_->tab;
	_tmp31_ = jump_to;
	documents_panel_add_tab (_tmp29_, _tmp30_, -1, _tmp31_);
	_tmp32_ = self->priv->_main_window_edit;
	main_window_edit_update_sensitivity (_tmp32_);
	_tmp33_ = gtk_widget_get_visible ((GtkWidget*) self);
	if (!_tmp33_) {
		gtk_window_present ((GtkWindow*) self);
	}
	_tmp34_ = _data22_->tab;
	_tmp35_ = _g_object_ref0 (_tmp34_);
	result = _tmp35_;
	block22_data_unref (_data22_);
	_data22_ = NULL;
	return result;
}


gboolean main_window_close_tab (MainWindow* self, DocumentTab* tab, gboolean force_close) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	DocumentsPanel* _tmp30_ = NULL;
	DocumentTab* _tmp31_ = NULL;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (tab != NULL, FALSE);
	_tmp1_ = force_close;
	if (!_tmp1_) {
		DocumentTab* _tmp2_ = NULL;
		Document* _tmp3_ = NULL;
		Document* _tmp4_ = NULL;
		gboolean _tmp5_ = FALSE;
		_tmp2_ = tab;
		_tmp3_ = document_tab_get_document (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = document_get_modified (_tmp4_);
		_tmp0_ = _tmp5_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GtkDialog* dialog = NULL;
		const gchar* _tmp6_ = NULL;
		DocumentTab* _tmp7_ = NULL;
		const gchar* _tmp8_ = NULL;
		const gchar* _tmp9_ = NULL;
		GtkMessageDialog* _tmp10_ = NULL;
		GtkDialog* _tmp11_ = NULL;
		const gchar* _tmp12_ = NULL;
		DocumentTab* _tmp13_ = NULL;
		Document* _tmp14_ = NULL;
		Document* _tmp15_ = NULL;
		GFile* _tmp16_ = NULL;
		GFile* _tmp17_ = NULL;
		GtkDialog* _tmp29_ = NULL;
		_tmp6_ = _ ("Save changes to document \"%s\" before closing?");
		_tmp7_ = tab;
		_tmp8_ = document_tab_get_label_text (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = (GtkMessageDialog*) gtk_message_dialog_new ((GtkWindow*) self, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, _tmp6_, _tmp9_);
		g_object_ref_sink (_tmp10_);
		dialog = (GtkDialog*) _tmp10_;
		_tmp11_ = dialog;
		_tmp12_ = _ ("Close without Saving");
		gtk_dialog_add_buttons (_tmp11_, _tmp12_, GTK_RESPONSE_CLOSE, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, NULL);
		_tmp13_ = tab;
		_tmp14_ = document_tab_get_document (_tmp13_);
		_tmp15_ = _tmp14_;
		_tmp16_ = document_get_location (_tmp15_);
		_tmp17_ = _tmp16_;
		if (_tmp17_ == NULL) {
			GtkDialog* _tmp18_ = NULL;
			_tmp18_ = dialog;
			gtk_dialog_add_button (_tmp18_, GTK_STOCK_SAVE_AS, (gint) GTK_RESPONSE_ACCEPT);
		} else {
			GtkDialog* _tmp19_ = NULL;
			_tmp19_ = dialog;
			gtk_dialog_add_button (_tmp19_, GTK_STOCK_SAVE, (gint) GTK_RESPONSE_ACCEPT);
		}
		while (TRUE) {
			gint res = 0;
			GtkDialog* _tmp20_ = NULL;
			gint _tmp21_ = 0;
			gint _tmp22_ = 0;
			_tmp20_ = dialog;
			_tmp21_ = gtk_dialog_run (_tmp20_);
			res = _tmp21_;
			_tmp22_ = res;
			if (_tmp22_ == ((gint) GTK_RESPONSE_CLOSE)) {
				break;
			} else {
				gint _tmp23_ = 0;
				_tmp23_ = res;
				if (_tmp23_ == ((gint) GTK_RESPONSE_ACCEPT)) {
					DocumentTab* _tmp24_ = NULL;
					Document* _tmp25_ = NULL;
					Document* _tmp26_ = NULL;
					gboolean _tmp27_ = FALSE;
					_tmp24_ = tab;
					_tmp25_ = document_tab_get_document (_tmp24_);
					_tmp26_ = _tmp25_;
					_tmp27_ = main_window_save_document (self, _tmp26_, FALSE);
					if (_tmp27_) {
						break;
					}
					continue;
				} else {
					GtkDialog* _tmp28_ = NULL;
					_tmp28_ = dialog;
					gtk_widget_destroy ((GtkWidget*) _tmp28_);
					result = FALSE;
					_g_object_unref0 (dialog);
					return result;
				}
			}
		}
		_tmp29_ = dialog;
		gtk_widget_destroy ((GtkWidget*) _tmp29_);
		_g_object_unref0 (dialog);
	}
	_tmp30_ = self->priv->_documents_panel;
	_tmp31_ = tab;
	documents_panel_remove_tab (_tmp30_, _tmp31_);
	result = TRUE;
	return result;
}


static void main_window_sync_name (MainWindow* self, DocumentTab* tab) {
	DocumentTab* _tmp0_ = NULL;
	DocumentTab* _tmp1_ = NULL;
	DocumentTab* _tmp2_ = NULL;
	MainWindowDocuments* _tmp3_ = NULL;
	DocumentTab* _tmp4_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (tab != NULL);
	_tmp0_ = tab;
	_tmp1_ = main_window_get_active_tab (self);
	_tmp2_ = _tmp1_;
	if (_tmp0_ == _tmp2_) {
		main_window_my_set_title (self);
	}
	_tmp3_ = self->priv->_main_window_documents;
	_tmp4_ = tab;
	main_window_documents_update_document_name (_tmp3_, _tmp4_);
}


static void main_window_my_set_title (MainWindow* self) {
	DocumentTab* _tmp0_ = NULL;
	DocumentTab* _tmp1_ = NULL;
	guint max_title_length = 0U;
	gchar* title = NULL;
	gchar* dirname = NULL;
	GFile* loc = NULL;
	Document* _tmp2_ = NULL;
	Document* _tmp3_ = NULL;
	GFile* _tmp4_ = NULL;
	GFile* _tmp5_ = NULL;
	GFile* _tmp6_ = NULL;
	GFile* _tmp7_ = NULL;
	const gchar* _tmp31_ = NULL;
	Document* _tmp32_ = NULL;
	Document* _tmp33_ = NULL;
	gboolean _tmp34_ = FALSE;
	gchar* _tmp35_ = NULL;
	Document* _tmp36_ = NULL;
	Document* _tmp37_ = NULL;
	gboolean _tmp38_ = FALSE;
	gboolean _tmp39_ = FALSE;
	gchar* _tmp45_ = NULL;
	const gchar* _tmp46_ = NULL;
	const gchar* _tmp52_ = NULL;
	gchar* _tmp53_ = NULL;
	gchar* _tmp54_ = NULL;
	gchar* _tmp55_ = NULL;
	gchar* _tmp56_ = NULL;
	gchar* _tmp57_ = NULL;
	gchar* _tmp58_ = NULL;
	gchar* _tmp59_ = NULL;
	gchar* _tmp60_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = main_window_get_active_tab (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == NULL) {
		gtk_window_set_title ((GtkWindow*) self, "LaTeXila");
		return;
	}
	max_title_length = (guint) 100;
	title = NULL;
	dirname = NULL;
	_tmp2_ = main_window_get_active_document (self);
	_tmp3_ = _tmp2_;
	_tmp4_ = document_get_location (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = _g_object_ref0 (_tmp5_);
	loc = _tmp6_;
	_tmp7_ = loc;
	if (_tmp7_ == NULL) {
		Document* _tmp8_ = NULL;
		Document* _tmp9_ = NULL;
		gchar* _tmp10_ = NULL;
		_tmp8_ = main_window_get_active_document (self);
		_tmp9_ = _tmp8_;
		_tmp10_ = document_get_short_name_for_display (_tmp9_);
		_g_free0 (title);
		title = _tmp10_;
	} else {
		gchar* basename = NULL;
		GFile* _tmp11_ = NULL;
		gchar* _tmp12_ = NULL;
		const gchar* _tmp13_ = NULL;
		gint _tmp14_ = 0;
		gint _tmp15_ = 0;
		guint _tmp16_ = 0U;
		_tmp11_ = loc;
		_tmp12_ = g_file_get_basename (_tmp11_);
		basename = _tmp12_;
		_tmp13_ = basename;
		_tmp14_ = strlen (_tmp13_);
		_tmp15_ = _tmp14_;
		_tmp16_ = max_title_length;
		if (((guint) _tmp15_) > _tmp16_) {
			const gchar* _tmp17_ = NULL;
			guint _tmp18_ = 0U;
			gchar* _tmp19_ = NULL;
			_tmp17_ = basename;
			_tmp18_ = max_title_length;
			_tmp19_ = utils_str_middle_truncate (_tmp17_, _tmp18_);
			_g_free0 (title);
			title = _tmp19_;
		} else {
			const gchar* _tmp20_ = NULL;
			gchar* _tmp21_ = NULL;
			GFile* _tmp22_ = NULL;
			gchar* _tmp23_ = NULL;
			gchar* _tmp24_ = NULL;
			guint _tmp25_ = 0U;
			const gchar* _tmp26_ = NULL;
			gint _tmp27_ = 0;
			gint _tmp28_ = 0;
			glong _tmp29_ = 0L;
			gchar* _tmp30_ = NULL;
			_tmp20_ = basename;
			_tmp21_ = g_strdup (_tmp20_);
			_g_free0 (title);
			title = _tmp21_;
			_tmp22_ = loc;
			_tmp23_ = utils_get_dirname_for_display (_tmp22_);
			_tmp24_ = _tmp23_;
			_tmp25_ = max_title_length;
			_tmp26_ = basename;
			_tmp27_ = strlen (_tmp26_);
			_tmp28_ = _tmp27_;
			_tmp29_ = MAX ((glong) 20, (glong) (_tmp25_ - _tmp28_));
			_tmp30_ = utils_str_middle_truncate (_tmp24_, (guint) _tmp29_);
			_g_free0 (dirname);
			dirname = _tmp30_;
			_g_free0 (_tmp24_);
		}
		_g_free0 (basename);
	}
	_tmp32_ = main_window_get_active_document (self);
	_tmp33_ = _tmp32_;
	_tmp34_ = document_get_modified (_tmp33_);
	if (_tmp34_) {
		_tmp31_ = "*";
	} else {
		_tmp31_ = "";
	}
	_tmp36_ = main_window_get_active_document (self);
	_tmp37_ = _tmp36_;
	_tmp38_ = document_get_readonly (_tmp37_);
	_tmp39_ = _tmp38_;
	if (_tmp39_) {
		const gchar* _tmp40_ = NULL;
		gchar* _tmp41_ = NULL;
		gchar* _tmp42_ = NULL;
		gchar* _tmp43_ = NULL;
		_tmp40_ = _ ("Read-Only");
		_tmp41_ = g_strconcat (" [", _tmp40_, NULL);
		_tmp42_ = _tmp41_;
		_tmp43_ = g_strconcat (_tmp42_, "]", NULL);
		_g_free0 (_tmp35_);
		_tmp35_ = _tmp43_;
		_g_free0 (_tmp42_);
	} else {
		gchar* _tmp44_ = NULL;
		_tmp44_ = g_strdup ("");
		_g_free0 (_tmp35_);
		_tmp35_ = _tmp44_;
	}
	_tmp46_ = dirname;
	if (_tmp46_ != NULL) {
		const gchar* _tmp47_ = NULL;
		gchar* _tmp48_ = NULL;
		gchar* _tmp49_ = NULL;
		gchar* _tmp50_ = NULL;
		_tmp47_ = dirname;
		_tmp48_ = g_strconcat (" (", _tmp47_, NULL);
		_tmp49_ = _tmp48_;
		_tmp50_ = g_strconcat (_tmp49_, ")", NULL);
		_g_free0 (_tmp45_);
		_tmp45_ = _tmp50_;
		_g_free0 (_tmp49_);
	} else {
		gchar* _tmp51_ = NULL;
		_tmp51_ = g_strdup ("");
		_g_free0 (_tmp45_);
		_tmp45_ = _tmp51_;
	}
	_tmp52_ = title;
	_tmp53_ = g_strconcat (_tmp31_, _tmp52_, NULL);
	_tmp54_ = _tmp53_;
	_tmp55_ = g_strconcat (_tmp54_, _tmp35_, NULL);
	_tmp56_ = _tmp55_;
	_tmp57_ = g_strconcat (_tmp56_, _tmp45_, NULL);
	_tmp58_ = _tmp57_;
	_tmp59_ = g_strconcat (_tmp58_, " - LaTeXila", NULL);
	_tmp60_ = _tmp59_;
	gtk_window_set_title ((GtkWindow*) self, _tmp60_);
	_g_free0 (_tmp60_);
	_g_free0 (_tmp58_);
	_g_free0 (_tmp56_);
	_g_free0 (_tmp54_);
	_g_free0 (_tmp45_);
	_g_free0 (_tmp35_);
	_g_object_unref0 (loc);
	_g_free0 (dirname);
	_g_free0 (title);
}


gboolean main_window_save_document (MainWindow* self, Document* doc, gboolean force_save_as) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GtkFileChooserDialog* file_chooser = NULL;
	const gchar* _tmp10_ = NULL;
	GtkFileChooserDialog* _tmp11_ = NULL;
	Document* _tmp12_ = NULL;
	GFile* _tmp13_ = NULL;
	GFile* _tmp14_ = NULL;
	const gchar* _tmp27_ = NULL;
	Document* _tmp30_ = NULL;
	GFile* _tmp31_ = NULL;
	GFile* _tmp32_ = NULL;
	GtkFileChooserDialog* _tmp64_ = NULL;
	gchar* _tmp65_ = NULL;
	GtkFileChooserDialog* _tmp66_ = NULL;
	Document* _tmp67_ = NULL;
	GFile* _tmp68_ = NULL;
	GFile* _tmp69_ = NULL;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (doc != NULL, FALSE);
	_tmp1_ = force_save_as;
	if (!_tmp1_) {
		Document* _tmp2_ = NULL;
		GFile* _tmp3_ = NULL;
		GFile* _tmp4_ = NULL;
		_tmp2_ = doc;
		_tmp3_ = document_get_location (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp0_ = _tmp4_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		Document* _tmp5_ = NULL;
		Document* _tmp6_ = NULL;
		Document* _tmp7_ = NULL;
		Document* _tmp8_ = NULL;
		_tmp5_ = doc;
		document_save (_tmp5_, TRUE, FALSE);
		_tmp6_ = doc;
		_tmp7_ = main_window_get_active_document (self);
		_tmp8_ = _tmp7_;
		if (_tmp6_ == _tmp8_) {
			MainWindowStructure* _tmp9_ = NULL;
			_tmp9_ = self->priv->_main_window_structure;
			main_window_structure_refresh (_tmp9_);
		}
		result = TRUE;
		return result;
	}
	_tmp10_ = _ ("Save File");
	_tmp11_ = (GtkFileChooserDialog*) gtk_file_chooser_dialog_new (_tmp10_, (GtkWindow*) self, GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL);
	g_object_ref_sink (_tmp11_);
	file_chooser = _tmp11_;
	_tmp12_ = doc;
	_tmp13_ = document_get_location (_tmp12_);
	_tmp14_ = _tmp13_;
	if (_tmp14_ == NULL) {
		GtkFileChooserDialog* _tmp15_ = NULL;
		Document* _tmp16_ = NULL;
		DocumentTab* _tmp17_ = NULL;
		const gchar* _tmp18_ = NULL;
		const gchar* _tmp19_ = NULL;
		gchar* _tmp20_ = NULL;
		gchar* _tmp21_ = NULL;
		_tmp15_ = file_chooser;
		_tmp16_ = doc;
		_tmp17_ = _tmp16_->tab;
		_tmp18_ = document_tab_get_label_text (_tmp17_);
		_tmp19_ = _tmp18_;
		_tmp20_ = g_strconcat (_tmp19_, ".tex", NULL);
		_tmp21_ = _tmp20_;
		gtk_file_chooser_set_current_name ((GtkFileChooser*) _tmp15_, _tmp21_);
		_g_free0 (_tmp21_);
	} else {
		GtkFileChooserDialog* _tmp22_ = NULL;
		Document* _tmp23_ = NULL;
		DocumentTab* _tmp24_ = NULL;
		const gchar* _tmp25_ = NULL;
		const gchar* _tmp26_ = NULL;
		_tmp22_ = file_chooser;
		_tmp23_ = doc;
		_tmp24_ = _tmp23_->tab;
		_tmp25_ = document_tab_get_label_text (_tmp24_);
		_tmp26_ = _tmp25_;
		gtk_file_chooser_set_current_name ((GtkFileChooser*) _tmp22_, _tmp26_);
	}
	_tmp27_ = self->default_location;
	if (_tmp27_ != NULL) {
		GtkFileChooserDialog* _tmp28_ = NULL;
		const gchar* _tmp29_ = NULL;
		_tmp28_ = file_chooser;
		_tmp29_ = self->default_location;
		gtk_file_chooser_set_current_folder ((GtkFileChooser*) _tmp28_, _tmp29_);
	}
	_tmp30_ = doc;
	_tmp31_ = document_get_location (_tmp30_);
	_tmp32_ = _tmp31_;
	if (_tmp32_ != NULL) {
		{
			GtkFileChooserDialog* _tmp33_ = NULL;
			Document* _tmp34_ = NULL;
			GFile* _tmp35_ = NULL;
			GFile* _tmp36_ = NULL;
			_tmp33_ = file_chooser;
			_tmp34_ = doc;
			_tmp35_ = document_get_location (_tmp34_);
			_tmp36_ = _tmp35_;
			gtk_file_chooser_set_file ((GtkFileChooser*) _tmp33_, _tmp36_, &_inner_error_);
			if (G_UNLIKELY (_inner_error_ != NULL)) {
				goto __catch28_g_error;
			}
		}
		goto __finally28;
		__catch28_g_error:
		{
			GError* e = NULL;
			e = _inner_error_;
			_inner_error_ = NULL;
			_g_error_free0 (e);
		}
		__finally28:
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			_g_object_unref0 (file_chooser);
			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 FALSE;
		}
	}
	while (TRUE) {
		GtkFileChooserDialog* _tmp37_ = NULL;
		gint _tmp38_ = 0;
		GFile* file = NULL;
		GtkFileChooserDialog* _tmp39_ = NULL;
		GFile* _tmp40_ = NULL;
		GFile* _tmp41_ = NULL;
		gboolean _tmp42_ = FALSE;
		Document* _tmp62_ = NULL;
		GFile* _tmp63_ = NULL;
		_tmp37_ = file_chooser;
		_tmp38_ = gtk_dialog_run ((GtkDialog*) _tmp37_);
		if (!(_tmp38_ == ((gint) GTK_RESPONSE_ACCEPT))) {
			break;
		}
		_tmp39_ = file_chooser;
		_tmp40_ = gtk_file_chooser_get_file ((GtkFileChooser*) _tmp39_);
		file = _tmp40_;
		_tmp41_ = file;
		_tmp42_ = g_file_query_exists (_tmp41_, NULL);
		if (_tmp42_) {
			GtkMessageDialog* confirmation = NULL;
			const gchar* _tmp43_ = NULL;
			GFile* _tmp44_ = NULL;
			gchar* _tmp45_ = NULL;
			gchar* _tmp46_ = NULL;
			GtkMessageDialog* _tmp47_ = NULL;
			GtkMessageDialog* _tmp48_ = NULL;
			GtkMessageDialog* _tmp49_ = NULL;
			GtkButton* button_replace = NULL;
			const gchar* _tmp50_ = NULL;
			GtkButton* _tmp51_ = NULL;
			GtkImage* icon = NULL;
			GtkImage* _tmp52_ = NULL;
			GtkButton* _tmp53_ = NULL;
			GtkImage* _tmp54_ = NULL;
			GtkMessageDialog* _tmp55_ = NULL;
			GtkButton* _tmp56_ = NULL;
			GtkButton* _tmp57_ = NULL;
			gint response = 0;
			GtkMessageDialog* _tmp58_ = NULL;
			gint _tmp59_ = 0;
			GtkMessageDialog* _tmp60_ = NULL;
			gint _tmp61_ = 0;
			_tmp43_ = _ ("A file named \"%s\" already exists. Do you want to replace it?");
			_tmp44_ = file;
			_tmp45_ = g_file_get_basename (_tmp44_);
			_tmp46_ = _tmp45_;
			_tmp47_ = (GtkMessageDialog*) gtk_message_dialog_new ((GtkWindow*) self, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, _tmp43_, _tmp46_);
			g_object_ref_sink (_tmp47_);
			_tmp48_ = _tmp47_;
			_g_free0 (_tmp46_);
			confirmation = _tmp48_;
			_tmp49_ = confirmation;
			gtk_dialog_add_button ((GtkDialog*) _tmp49_, GTK_STOCK_CANCEL, (gint) GTK_RESPONSE_CANCEL);
			_tmp50_ = _ ("Replace");
			_tmp51_ = (GtkButton*) gtk_button_new_with_label (_tmp50_);
			g_object_ref_sink (_tmp51_);
			button_replace = _tmp51_;
			_tmp52_ = (GtkImage*) gtk_image_new_from_stock (GTK_STOCK_SAVE_AS, GTK_ICON_SIZE_BUTTON);
			g_object_ref_sink (_tmp52_);
			icon = _tmp52_;
			_tmp53_ = button_replace;
			_tmp54_ = icon;
			gtk_button_set_image (_tmp53_, (GtkWidget*) _tmp54_);
			_tmp55_ = confirmation;
			_tmp56_ = button_replace;
			gtk_dialog_add_action_widget ((GtkDialog*) _tmp55_, (GtkWidget*) _tmp56_, (gint) GTK_RESPONSE_YES);
			_tmp57_ = button_replace;
			gtk_widget_show ((GtkWidget*) _tmp57_);
			_tmp58_ = confirmation;
			_tmp59_ = gtk_dialog_run ((GtkDialog*) _tmp58_);
			response = _tmp59_;
			_tmp60_ = confirmation;
			gtk_widget_destroy ((GtkWidget*) _tmp60_);
			_tmp61_ = response;
			if (_tmp61_ != ((gint) GTK_RESPONSE_YES)) {
				_g_object_unref0 (icon);
				_g_object_unref0 (button_replace);
				_g_object_unref0 (confirmation);
				_g_object_unref0 (file);
				continue;
			}
			_g_object_unref0 (icon);
			_g_object_unref0 (button_replace);
			_g_object_unref0 (confirmation);
		}
		_tmp62_ = doc;
		_tmp63_ = file;
		document_set_location (_tmp62_, _tmp63_);
		_g_object_unref0 (file);
		break;
	}
	_tmp64_ = file_chooser;
	_tmp65_ = gtk_file_chooser_get_current_folder ((GtkFileChooser*) _tmp64_);
	_g_free0 (self->default_location);
	self->default_location = _tmp65_;
	_tmp66_ = file_chooser;
	gtk_widget_destroy ((GtkWidget*) _tmp66_);
	_tmp67_ = doc;
	_tmp68_ = document_get_location (_tmp67_);
	_tmp69_ = _tmp68_;
	if (_tmp69_ != NULL) {
		Document* _tmp70_ = NULL;
		Document* _tmp71_ = NULL;
		Document* _tmp72_ = NULL;
		Document* _tmp73_ = NULL;
		_tmp70_ = doc;
		document_save (_tmp70_, FALSE, TRUE);
		_tmp71_ = doc;
		_tmp72_ = main_window_get_active_document (self);
		_tmp73_ = _tmp72_;
		if (_tmp71_ == _tmp73_) {
			MainWindowStructure* _tmp74_ = NULL;
			_tmp74_ = self->priv->_main_window_structure;
			main_window_structure_refresh (_tmp74_);
		}
		result = TRUE;
		_g_object_unref0 (file_chooser);
		return result;
	}
	result = FALSE;
	_g_object_unref0 (file_chooser);
	return result;
}


gboolean main_window_close_all_documents (MainWindow* self) {
	gboolean result = FALSE;
	GeeList* unsaved_documents = NULL;
	GeeList* _tmp0_ = NULL;
	GeeList* _tmp1_ = NULL;
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = main_window_get_unsaved_documents (self);
	unsaved_documents = _tmp0_;
	_tmp1_ = unsaved_documents;
	_tmp2_ = gee_collection_get_size ((GeeCollection*) _tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_ == 0) {
		DocumentsPanel* _tmp4_ = NULL;
		_tmp4_ = self->priv->_documents_panel;
		documents_panel_remove_all_tabs (_tmp4_);
		result = TRUE;
		_g_object_unref0 (unsaved_documents);
		return result;
	} else {
		GeeList* _tmp5_ = NULL;
		gint _tmp6_ = 0;
		gint _tmp7_ = 0;
		_tmp5_ = unsaved_documents;
		_tmp6_ = gee_collection_get_size ((GeeCollection*) _tmp5_);
		_tmp7_ = _tmp6_;
		if (_tmp7_ == 1) {
			Document* doc = NULL;
			GeeList* _tmp8_ = NULL;
			gpointer _tmp9_ = NULL;
			Document* _tmp10_ = NULL;
			DocumentTab* _tmp11_ = NULL;
			Document* _tmp12_ = NULL;
			DocumentTab* _tmp13_ = NULL;
			gboolean _tmp14_ = FALSE;
			_tmp8_ = unsaved_documents;
			_tmp9_ = gee_list_first (_tmp8_);
			doc = (Document*) _tmp9_;
			_tmp10_ = doc;
			_tmp11_ = _tmp10_->tab;
			main_window_set_active_tab (self, _tmp11_);
			_tmp12_ = doc;
			_tmp13_ = _tmp12_->tab;
			_tmp14_ = main_window_close_tab (self, _tmp13_, FALSE);
			if (_tmp14_) {
				DocumentsPanel* _tmp15_ = NULL;
				_tmp15_ = self->priv->_documents_panel;
				documents_panel_remove_all_tabs (_tmp15_);
				result = TRUE;
				_g_object_unref0 (doc);
				_g_object_unref0 (unsaved_documents);
				return result;
			}
			_g_object_unref0 (doc);
		} else {
			GeeList* _tmp16_ = NULL;
			DocumentsPanel* _tmp17_ = NULL;
			gint _tmp18_ = 0;
			_tmp16_ = unsaved_documents;
			dialogs_close_several_unsaved_documents (self, _tmp16_);
			_tmp17_ = self->priv->_documents_panel;
			_tmp18_ = gtk_notebook_get_n_pages ((GtkNotebook*) _tmp17_);
			if (_tmp18_ == 0) {
				result = TRUE;
				_g_object_unref0 (unsaved_documents);
				return result;
			}
		}
	}
	result = FALSE;
	_g_object_unref0 (unsaved_documents);
	return result;
}


void main_window_remove_all_tabs (MainWindow* self) {
	DocumentsPanel* _tmp0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_documents_panel;
	documents_panel_remove_all_tabs (_tmp0_);
}


static void main_window_update_cursor_position_statusbar (MainWindow* self) {
	GtkTextIter iter = {0};
	Document* _tmp0_ = NULL;
	Document* _tmp1_ = NULL;
	Document* _tmp2_ = NULL;
	Document* _tmp3_ = NULL;
	GtkTextMark* _tmp4_ = NULL;
	GtkTextIter _tmp5_ = {0};
	gint row = 0;
	gint _tmp6_ = 0;
	gint col = 0;
	DocumentView* _tmp7_ = NULL;
	DocumentView* _tmp8_ = NULL;
	GtkTextIter _tmp9_ = {0};
	guint _tmp10_ = 0U;
	CustomStatusbar* _tmp11_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = main_window_get_active_document (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = main_window_get_active_document (self);
	_tmp3_ = _tmp2_;
	_tmp4_ = gtk_text_buffer_get_insert ((GtkTextBuffer*) _tmp3_);
	gtk_text_buffer_get_iter_at_mark ((GtkTextBuffer*) _tmp1_, &_tmp5_, _tmp4_);
	iter = _tmp5_;
	_tmp6_ = gtk_text_iter_get_line (&iter);
	row = (gint) _tmp6_;
	_tmp7_ = main_window_get_active_view (self);
	_tmp8_ = _tmp7_;
	_tmp9_ = iter;
	_tmp10_ = gtk_source_view_get_visual_column ((GtkSourceView*) _tmp8_, &_tmp9_);
	col = (gint) _tmp10_;
	_tmp11_ = self->priv->_statusbar;
	custom_statusbar_set_cursor_position (_tmp11_, row + 1, col + 1);
}


void main_window_save_state (MainWindow* self) {
	GSettings* settings_window = NULL;
	GSettings* _tmp0_ = NULL;
	GdkWindowState state = 0;
	GdkWindow* _tmp1_ = NULL;
	GdkWindowState _tmp2_ = 0;
	gint width = 0;
	gint height = 0;
	gint _tmp3_ = 0;
	gint _tmp4_ = 0;
	GtkPaned* _tmp5_ = NULL;
	gint _tmp6_ = 0;
	GtkPaned* _tmp7_ = NULL;
	gint _tmp8_ = 0;
	MainWindowStructure* _tmp9_ = NULL;
	GSettings* settings_ui = NULL;
	GSettings* _tmp10_ = NULL;
	GtkToggleAction* action = NULL;
	GtkActionGroup* _tmp11_ = NULL;
	GtkAction* _tmp12_ = NULL;
	GtkToggleAction* _tmp13_ = NULL;
	GtkToggleAction* _tmp14_ = NULL;
	gboolean _tmp15_ = FALSE;
	gboolean _tmp16_ = FALSE;
	GtkActionGroup* _tmp17_ = NULL;
	GtkAction* _tmp18_ = NULL;
	GtkToggleAction* _tmp19_ = NULL;
	GtkToggleAction* _tmp20_ = NULL;
	gboolean _tmp21_ = FALSE;
	gboolean _tmp22_ = FALSE;
	GtkActionGroup* _tmp23_ = NULL;
	GtkAction* _tmp24_ = NULL;
	GtkToggleAction* _tmp25_ = NULL;
	GtkToggleAction* _tmp26_ = NULL;
	gboolean _tmp27_ = FALSE;
	gboolean _tmp28_ = FALSE;
	GtkActionGroup* _tmp29_ = NULL;
	GtkAction* _tmp30_ = NULL;
	GtkToggleAction* _tmp31_ = NULL;
	GtkToggleAction* _tmp32_ = NULL;
	gboolean _tmp33_ = FALSE;
	gboolean _tmp34_ = FALSE;
	MainWindowBuildTools* _tmp35_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_settings_new ("org.gnome.latexila.state.window");
	settings_window = _tmp0_;
	_tmp1_ = gtk_widget_get_window ((GtkWidget*) self);
	_tmp2_ = gdk_window_get_state (_tmp1_);
	state = _tmp2_;
	g_settings_set_int (settings_window, "state", (gint) state);
	gtk_window_get_size ((GtkWindow*) self, &_tmp3_, &_tmp4_);
	width = _tmp3_;
	height = _tmp4_;
	g_settings_set (settings_window, "size", "(ii)", width, height);
	_tmp5_ = self->priv->_main_hpaned;
	_tmp6_ = gtk_paned_get_position (_tmp5_);
	g_settings_set_int (settings_window, "side-panel-size", _tmp6_);
	_tmp7_ = self->priv->_vpaned;
	_tmp8_ = gtk_paned_get_position (_tmp7_);
	g_settings_set_int (settings_window, "vertical-paned-position", _tmp8_);
	_tmp9_ = self->priv->_main_window_structure;
	main_window_structure_save_state (_tmp9_);
	_tmp10_ = g_settings_new ("org.gnome.latexila.preferences.ui");
	settings_ui = _tmp10_;
	_tmp11_ = self->priv->_action_group;
	_tmp12_ = gtk_action_group_get_action (_tmp11_, "ViewMainToolbar");
	_tmp13_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, gtk_toggle_action_get_type (), GtkToggleAction));
	action = _tmp13_;
	_tmp14_ = action;
	_tmp15_ = gtk_toggle_action_get_active (_tmp14_);
	_tmp16_ = _tmp15_;
	g_settings_set_boolean (settings_ui, "main-toolbar-visible", _tmp16_);
	_tmp17_ = self->priv->_action_group;
	_tmp18_ = gtk_action_group_get_action (_tmp17_, "ViewEditToolbar");
	_tmp19_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, gtk_toggle_action_get_type (), GtkToggleAction));
	_g_object_unref0 (action);
	action = _tmp19_;
	_tmp20_ = action;
	_tmp21_ = gtk_toggle_action_get_active (_tmp20_);
	_tmp22_ = _tmp21_;
	g_settings_set_boolean (settings_ui, "edit-toolbar-visible", _tmp22_);
	_tmp23_ = self->priv->_action_group;
	_tmp24_ = gtk_action_group_get_action (_tmp23_, "ViewSidePanel");
	_tmp25_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, gtk_toggle_action_get_type (), GtkToggleAction));
	_g_object_unref0 (action);
	action = _tmp25_;
	_tmp26_ = action;
	_tmp27_ = gtk_toggle_action_get_active (_tmp26_);
	_tmp28_ = _tmp27_;
	g_settings_set_boolean (settings_ui, "side-panel-visible", _tmp28_);
	_tmp29_ = self->priv->_action_group;
	_tmp30_ = gtk_action_group_get_action (_tmp29_, "ViewBottomPanel");
	_tmp31_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp30_, gtk_toggle_action_get_type (), GtkToggleAction));
	_g_object_unref0 (action);
	action = _tmp31_;
	_tmp32_ = action;
	_tmp33_ = gtk_toggle_action_get_active (_tmp32_);
	_tmp34_ = _tmp33_;
	g_settings_set_boolean (settings_ui, "bottom-panel-visible", _tmp34_);
	_tmp35_ = self->priv->_main_window_build_tools;
	main_window_build_tools_save_state (_tmp35_);
	_g_object_unref0 (action);
	_g_object_unref0 (settings_ui);
	_g_object_unref0 (settings_window);
}


void main_window_jump_to_file_position (MainWindow* self, GFile* file, gint start_line, gint end_line) {
	gboolean _tmp0_ = FALSE;
	gint _tmp1_ = 0;
	DocumentTab* tab = NULL;
	GFile* _tmp3_ = NULL;
	DocumentTab* _tmp4_ = NULL;
	Document* _tmp5_ = NULL;
	Document* _tmp6_ = NULL;
	gint _tmp7_ = 0;
	gint _tmp8_ = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (file != NULL);
	_tmp1_ = start_line;
	if (_tmp1_ >= 0) {
		gint _tmp2_ = 0;
		_tmp2_ = end_line;
		_tmp0_ = _tmp2_ >= 0;
	} else {
		_tmp0_ = FALSE;
	}
	g_return_if_fail (_tmp0_);
	_tmp3_ = file;
	_tmp4_ = main_window_open_document (self, _tmp3_, TRUE);
	tab = _tmp4_;
	utils_flush_queue ();
	_tmp5_ = document_tab_get_document (tab);
	_tmp6_ = _tmp5_;
	_tmp7_ = start_line;
	_tmp8_ = end_line;
	document_select_lines (_tmp6_, _tmp7_, _tmp8_);
	_g_object_unref0 (tab);
}


/*************************************************************************/
static void main_window_set_file_actions_sensitivity (MainWindow* self, gboolean sensitive) {
	gchar** file_actions = NULL;
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	gchar* _tmp7_ = NULL;
	gchar** _tmp8_ = NULL;
	gint file_actions_length1 = 0;
	gint _file_actions_size_ = 0;
	gchar** _tmp9_ = NULL;
	gint _tmp9__length1 = 0;
	GtkActionGroup* _tmp17_ = NULL;
	gboolean _tmp18_ = FALSE;
	MainWindowFile* _tmp19_ = NULL;
	gboolean _tmp20_ = FALSE;
	MainWindowEdit* _tmp21_ = NULL;
	MainWindowBuildTools* _tmp22_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup ("ViewZoomIn");
	_tmp1_ = g_strdup ("ViewZoomOut");
	_tmp2_ = g_strdup ("ViewZoomReset");
	_tmp3_ = g_strdup ("SearchFind");
	_tmp4_ = g_strdup ("SearchReplace");
	_tmp5_ = g_strdup ("SearchGoToLine");
	_tmp6_ = g_strdup ("SearchForward");
	_tmp7_ = g_strdup ("ProjectsConfigCurrent");
	_tmp8_ = g_new0 (gchar*, 8 + 1);
	_tmp8_[0] = _tmp0_;
	_tmp8_[1] = _tmp1_;
	_tmp8_[2] = _tmp2_;
	_tmp8_[3] = _tmp3_;
	_tmp8_[4] = _tmp4_;
	_tmp8_[5] = _tmp5_;
	_tmp8_[6] = _tmp6_;
	_tmp8_[7] = _tmp7_;
	file_actions = _tmp8_;
	file_actions_length1 = 8;
	_file_actions_size_ = file_actions_length1;
	_tmp9_ = file_actions;
	_tmp9__length1 = file_actions_length1;
	{
		gchar** file_action_collection = NULL;
		gint file_action_collection_length1 = 0;
		gint _file_action_collection_size_ = 0;
		gint file_action_it = 0;
		file_action_collection = _tmp9_;
		file_action_collection_length1 = _tmp9__length1;
		for (file_action_it = 0; file_action_it < _tmp9__length1; file_action_it = file_action_it + 1) {
			gchar* _tmp10_ = NULL;
			gchar* file_action = NULL;
			_tmp10_ = g_strdup (file_action_collection[file_action_it]);
			file_action = _tmp10_;
			{
				GtkAction* action = NULL;
				GtkActionGroup* _tmp11_ = NULL;
				const gchar* _tmp12_ = NULL;
				GtkAction* _tmp13_ = NULL;
				GtkAction* _tmp14_ = NULL;
				GtkAction* _tmp15_ = NULL;
				gboolean _tmp16_ = FALSE;
				_tmp11_ = self->priv->_action_group;
				_tmp12_ = file_action;
				_tmp13_ = gtk_action_group_get_action (_tmp11_, _tmp12_);
				_tmp14_ = _g_object_ref0 (_tmp13_);
				action = _tmp14_;
				_tmp15_ = action;
				_tmp16_ = sensitive;
				gtk_action_set_sensitive (_tmp15_, _tmp16_);
				_g_object_unref0 (action);
				_g_free0 (file_action);
			}
		}
	}
	_tmp17_ = self->priv->_latex_action_group;
	_tmp18_ = sensitive;
	gtk_action_group_set_sensitive (_tmp17_, _tmp18_);
	_tmp19_ = self->priv->_main_window_file;
	_tmp20_ = sensitive;
	main_window_file_update_sensitivity (_tmp19_, _tmp20_);
	_tmp21_ = self->priv->_main_window_edit;
	main_window_edit_update_sensitivity (_tmp21_);
	_tmp22_ = self->priv->_main_window_build_tools;
	main_window_build_tools_update_sensitivity (_tmp22_);
	file_actions = (_vala_array_free (file_actions, file_actions_length1, (GDestroyNotify) g_free), NULL);
}


void main_window_update_config_project_sensitivity (MainWindow* self) {
	GtkAction* action = NULL;
	GtkActionGroup* _tmp0_ = NULL;
	GtkAction* _tmp1_ = NULL;
	GtkAction* _tmp2_ = NULL;
	gboolean _tmp3_ = FALSE;
	DocumentTab* _tmp4_ = NULL;
	DocumentTab* _tmp5_ = NULL;
	GtkAction* _tmp10_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_action_group;
	_tmp1_ = gtk_action_group_get_action (_tmp0_, "ProjectsConfigCurrent");
	_tmp2_ = _g_object_ref0 (_tmp1_);
	action = _tmp2_;
	_tmp4_ = main_window_get_active_tab (self);
	_tmp5_ = _tmp4_;
	if (_tmp5_ != NULL) {
		Document* _tmp6_ = NULL;
		Document* _tmp7_ = NULL;
		gint _tmp8_ = 0;
		gint _tmp9_ = 0;
		_tmp6_ = main_window_get_active_document (self);
		_tmp7_ = _tmp6_;
		_tmp8_ = document_get_project_id (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp3_ = _tmp9_ != (-1);
	} else {
		_tmp3_ = FALSE;
	}
	_tmp10_ = action;
	gtk_action_set_sensitive (_tmp10_, _tmp3_);
	_g_object_unref0 (action);
}


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


void main_window_on_quit (MainWindow* self) {
	gchar** list_uris = NULL;
	gchar** _tmp0_ = NULL;
	gint list_uris_length1 = 0;
	gint _list_uris_size_ = 0;
	GSettings* settings = NULL;
	GSettings* _tmp19_ = NULL;
	GSettings* _tmp20_ = NULL;
	gchar** _tmp21_ = NULL;
	gint _tmp21__length1 = 0;
	gboolean _tmp22_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_new0 (gchar*, 0 + 1);
	list_uris = _tmp0_;
	list_uris_length1 = 0;
	_list_uris_size_ = list_uris_length1;
	{
		GeeList* _doc_list = NULL;
		GeeList* _tmp1_ = NULL;
		gint _doc_size = 0;
		GeeList* _tmp2_ = NULL;
		gint _tmp3_ = 0;
		gint _tmp4_ = 0;
		gint _doc_index = 0;
		_tmp1_ = main_window_get_documents (self);
		_doc_list = _tmp1_;
		_tmp2_ = _doc_list;
		_tmp3_ = gee_collection_get_size ((GeeCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_doc_size = _tmp4_;
		_doc_index = -1;
		while (TRUE) {
			gint _tmp5_ = 0;
			gint _tmp6_ = 0;
			gint _tmp7_ = 0;
			Document* doc = NULL;
			GeeList* _tmp8_ = NULL;
			gint _tmp9_ = 0;
			gpointer _tmp10_ = NULL;
			Document* _tmp11_ = NULL;
			GFile* _tmp12_ = NULL;
			GFile* _tmp13_ = NULL;
			_tmp5_ = _doc_index;
			_doc_index = _tmp5_ + 1;
			_tmp6_ = _doc_index;
			_tmp7_ = _doc_size;
			if (!(_tmp6_ < _tmp7_)) {
				break;
			}
			_tmp8_ = _doc_list;
			_tmp9_ = _doc_index;
			_tmp10_ = gee_list_get (_tmp8_, _tmp9_);
			doc = (Document*) _tmp10_;
			_tmp11_ = doc;
			_tmp12_ = document_get_location (_tmp11_);
			_tmp13_ = _tmp12_;
			if (_tmp13_ != NULL) {
				gchar** _tmp14_ = NULL;
				gint _tmp14__length1 = 0;
				Document* _tmp15_ = NULL;
				GFile* _tmp16_ = NULL;
				GFile* _tmp17_ = NULL;
				gchar* _tmp18_ = NULL;
				_tmp14_ = list_uris;
				_tmp14__length1 = list_uris_length1;
				_tmp15_ = doc;
				_tmp16_ = document_get_location (_tmp15_);
				_tmp17_ = _tmp16_;
				_tmp18_ = g_file_get_uri (_tmp17_);
				_vala_array_add9 (&list_uris, &list_uris_length1, &_list_uris_size_, _tmp18_);
			}
			_g_object_unref0 (doc);
		}
		_g_object_unref0 (_doc_list);
	}
	_tmp19_ = g_settings_new ("org.gnome.latexila.state.window");
	settings = _tmp19_;
	_tmp20_ = settings;
	_tmp21_ = list_uris;
	_tmp21__length1 = list_uris_length1;
	g_settings_set_strv (_tmp20_, "documents", _tmp21_);
	_tmp22_ = main_window_close_all_documents (self);
	if (_tmp22_) {
		main_window_save_state (self);
		gtk_widget_destroy ((GtkWidget*) self);
	}
	_g_object_unref0 (settings);
	list_uris = (_vala_array_free (list_uris, list_uris_length1, (GDestroyNotify) g_free), NULL);
}


void main_window_on_view_zoom_in (MainWindow* self) {
	DocumentTab* _tmp0_ = NULL;
	DocumentTab* _tmp1_ = NULL;
	DocumentView* _tmp2_ = NULL;
	DocumentView* _tmp3_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = main_window_get_active_tab (self);
	_tmp1_ = _tmp0_;
	g_return_if_fail (_tmp1_ != NULL);
	_tmp2_ = main_window_get_active_view (self);
	_tmp3_ = _tmp2_;
	document_view_enlarge_font (_tmp3_);
}


void main_window_on_view_zoom_out (MainWindow* self) {
	DocumentTab* _tmp0_ = NULL;
	DocumentTab* _tmp1_ = NULL;
	DocumentView* _tmp2_ = NULL;
	DocumentView* _tmp3_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = main_window_get_active_tab (self);
	_tmp1_ = _tmp0_;
	g_return_if_fail (_tmp1_ != NULL);
	_tmp2_ = main_window_get_active_view (self);
	_tmp3_ = _tmp2_;
	document_view_shrink_font (_tmp3_);
}


void main_window_on_view_zoom_reset (MainWindow* self) {
	DocumentTab* _tmp0_ = NULL;
	DocumentTab* _tmp1_ = NULL;
	DocumentView* _tmp2_ = NULL;
	DocumentView* _tmp3_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = main_window_get_active_tab (self);
	_tmp1_ = _tmp0_;
	g_return_if_fail (_tmp1_ != NULL);
	_tmp2_ = main_window_get_active_view (self);
	_tmp3_ = _tmp2_;
	document_view_set_font_from_settings (_tmp3_);
}


void main_window_on_search_find (MainWindow* self) {
	DocumentTab* _tmp0_ = NULL;
	DocumentTab* _tmp1_ = NULL;
	SearchAndReplace* _tmp2_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = main_window_get_active_tab (self);
	_tmp1_ = _tmp0_;
	g_return_if_fail (_tmp1_ != NULL);
	_tmp2_ = self->priv->_search_and_replace;
	search_and_replace_show_search (_tmp2_);
}


void main_window_on_search_replace (MainWindow* self) {
	DocumentTab* _tmp0_ = NULL;
	DocumentTab* _tmp1_ = NULL;
	SearchAndReplace* _tmp2_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = main_window_get_active_tab (self);
	_tmp1_ = _tmp0_;
	g_return_if_fail (_tmp1_ != NULL);
	_tmp2_ = self->priv->_search_and_replace;
	search_and_replace_show_search_and_replace (_tmp2_);
}


void main_window_on_search_goto_line (MainWindow* self) {
	DocumentTab* _tmp0_ = NULL;
	DocumentTab* _tmp1_ = NULL;
	GotoLine* _tmp2_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = main_window_get_active_tab (self);
	_tmp1_ = _tmp0_;
	g_return_if_fail (_tmp1_ != NULL);
	_tmp2_ = self->priv->_goto_line;
	goto_line_show (_tmp2_);
}


void main_window_on_search_forward (MainWindow* self) {
	DocumentTab* _tmp0_ = NULL;
	DocumentTab* _tmp1_ = NULL;
	LatexilaSynctex* synctex = NULL;
	LatexilaSynctex* _tmp2_ = NULL;
	LatexilaSynctex* _tmp3_ = NULL;
	Document* _tmp4_ = NULL;
	Document* _tmp5_ = NULL;
	Document* _tmp6_ = NULL;
	Document* _tmp7_ = NULL;
	GFile* _tmp8_ = NULL;
	GFile* _tmp9_ = NULL;
	Document* _tmp10_ = NULL;
	Document* _tmp11_ = NULL;
	GFile* _tmp12_ = NULL;
	GFile* _tmp13_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = main_window_get_active_tab (self);
	_tmp1_ = _tmp0_;
	g_return_if_fail (_tmp1_ != NULL);
	_tmp2_ = latexila_synctex_get_instance ();
	_tmp3_ = _g_object_ref0 (_tmp2_);
	synctex = _tmp3_;
	_tmp4_ = main_window_get_active_document (self);
	_tmp5_ = _tmp4_;
	_tmp6_ = main_window_get_active_document (self);
	_tmp7_ = _tmp6_;
	_tmp8_ = document_get_location (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = main_window_get_active_document (self);
	_tmp11_ = _tmp10_;
	_tmp12_ = document_get_main_file (_tmp11_);
	_tmp13_ = _tmp12_;
	latexila_synctex_forward_search (synctex, (GtkTextBuffer*) _tmp5_, _tmp9_, _tmp13_);
	_g_object_unref0 (_tmp13_);
	_g_object_unref0 (synctex);
}


void main_window_on_projects_new (MainWindow* self) {
	g_return_if_fail (self != NULL);
	project_dialogs_new_project (self);
}


void main_window_on_projects_config_current (MainWindow* self) {
	DocumentTab* _tmp0_ = NULL;
	DocumentTab* _tmp1_ = NULL;
	Document* _tmp2_ = NULL;
	Document* _tmp3_ = NULL;
	gint _tmp4_ = 0;
	gint _tmp5_ = 0;
	Document* _tmp6_ = NULL;
	Document* _tmp7_ = NULL;
	gint _tmp8_ = 0;
	gint _tmp9_ = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = main_window_get_active_tab (self);
	_tmp1_ = _tmp0_;
	g_return_if_fail (_tmp1_ != NULL);
	_tmp2_ = main_window_get_active_document (self);
	_tmp3_ = _tmp2_;
	_tmp4_ = document_get_project_id (_tmp3_);
	_tmp5_ = _tmp4_;
	g_return_if_fail (_tmp5_ != (-1));
	_tmp6_ = main_window_get_active_document (self);
	_tmp7_ = _tmp6_;
	_tmp8_ = document_get_project_id (_tmp7_);
	_tmp9_ = _tmp8_;
	project_dialogs_configure_project ((GtkWindow*) self, _tmp9_);
}


void main_window_on_projects_manage (MainWindow* self) {
	g_return_if_fail (self != NULL);
	project_dialogs_manage_projects (self);
}


void main_window_on_help_contents (MainWindow* self) {
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	{
		GdkScreen* _tmp0_ = NULL;
		_tmp0_ = gtk_window_get_screen ((GtkWindow*) self);
		gtk_show_uri (_tmp0_, "help:latexila", (guint32) GDK_CURRENT_TIME, &_inner_error_);
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			goto __catch29_g_error;
		}
	}
	goto __finally29;
	__catch29_g_error:
	{
		GError* e = NULL;
		GError* _tmp1_ = NULL;
		const gchar* _tmp2_ = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp1_ = e;
		_tmp2_ = _tmp1_->message;
		g_warning ("main_window.vala:1176: Impossible to open the documentation: %s", _tmp2_);
		_g_error_free0 (e);
	}
	__finally29:
	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;
	}
}


void main_window_on_help_latex_reference (MainWindow* self) {
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	{
		gchar* uri = NULL;
		gchar* _tmp0_ = NULL;
		gchar* _tmp1_ = NULL;
		gchar* _tmp2_ = NULL;
		gchar* _tmp3_ = NULL;
		GdkScreen* _tmp4_ = NULL;
		const gchar* _tmp5_ = NULL;
		_tmp0_ = g_build_filename (DATA_DIR, "latexhelp.html", NULL, NULL);
		_tmp1_ = _tmp0_;
		_tmp2_ = g_filename_to_uri (_tmp1_, NULL, &_inner_error_);
		_tmp3_ = _tmp2_;
		_g_free0 (_tmp1_);
		uri = _tmp3_;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			goto __catch30_g_error;
		}
		_tmp4_ = gtk_window_get_screen ((GtkWindow*) self);
		_tmp5_ = uri;
		gtk_show_uri (_tmp4_, _tmp5_, (guint32) GDK_CURRENT_TIME, &_inner_error_);
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			_g_free0 (uri);
			goto __catch30_g_error;
		}
		_g_free0 (uri);
	}
	goto __finally30;
	__catch30_g_error:
	{
		GError* e = NULL;
		GError* _tmp6_ = NULL;
		const gchar* _tmp7_ = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp6_ = e;
		_tmp7_ = _tmp6_->message;
		g_warning ("main_window.vala:1190: Impossible to open the LaTeX reference: %s", _tmp7_);
		_g_error_free0 (e);
	}
	__finally30:
	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;
	}
}


void main_window_on_help_donate (MainWindow* self) {
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	{
		gchar* uri = NULL;
		gchar* _tmp0_ = NULL;
		GdkScreen* _tmp1_ = NULL;
		_tmp0_ = g_strdup ("https://wiki.gnome.org/Apps/LaTeXila/donate");
		uri = _tmp0_;
		_tmp1_ = gtk_window_get_screen ((GtkWindow*) self);
		gtk_show_uri (_tmp1_, uri, (guint32) GDK_CURRENT_TIME, &_inner_error_);
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			_g_free0 (uri);
			goto __catch31_g_error;
		}
		_g_free0 (uri);
	}
	goto __finally31;
	__catch31_g_error:
	{
		GError* e = NULL;
		GError* _tmp2_ = NULL;
		const gchar* _tmp3_ = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp2_ = e;
		_tmp3_ = _tmp2_->message;
		g_warning ("main_window.vala:1203: Impossible to open the donate page: %s", _tmp3_);
		_g_error_free0 (e);
	}
	__finally31:
	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;
	}
}


void main_window_on_about_dialog (MainWindow* self) {
	gchar* comments = NULL;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gchar* copyright = NULL;
	gchar* _tmp2_ = NULL;
	gchar* website = NULL;
	gchar* _tmp3_ = NULL;
	gchar** authors = NULL;
	gchar* _tmp4_ = NULL;
	gchar** _tmp5_ = NULL;
	gint authors_length1 = 0;
	gint _authors_size_ = 0;
	gchar** artists = NULL;
	gchar* _tmp6_ = NULL;
	gchar* _tmp7_ = NULL;
	gchar* _tmp8_ = NULL;
	gchar* _tmp9_ = NULL;
	gchar** _tmp10_ = NULL;
	gint artists_length1 = 0;
	gint _artists_size_ = 0;
	GdkPixbuf* logo = NULL;
	const gchar* _tmp16_ = NULL;
	const gchar* _tmp17_ = NULL;
	GdkPixbuf* _tmp18_ = NULL;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = _ ("LaTeXila is an Integrated LaTeX Environment for the GNOME Desktop");
	_tmp1_ = g_strdup (_tmp0_);
	comments = _tmp1_;
	_tmp2_ = g_strdup ("Copyright © 2009-2014 - Sébastien Wilmet");
	copyright = _tmp2_;
	_tmp3_ = g_strdup ("https://wiki.gnome.org/Apps/LaTeXila");
	website = _tmp3_;
	_tmp4_ = g_strdup ("Sébastien Wilmet <swilmet@gnome.org>");
	_tmp5_ = g_new0 (gchar*, 2 + 1);
	_tmp5_[0] = _tmp4_;
	_tmp5_[1] = NULL;
	authors = _tmp5_;
	authors_length1 = 2;
	_authors_size_ = authors_length1;
	_tmp6_ = g_strdup ("Eric Forgeot <e.forgeot@laposte.net>");
	_tmp7_ = g_strdup ("Sébastien Wilmet <swilmet@gnome.org>");
	_tmp8_ = g_strdup ("The Kile Team http://kile.sourceforge.net/");
	_tmp9_ = g_strdup ("Gedit LaTeX Plugin https://wiki.gnome.org/Apps/Gedit/LaTeXPlugin");
	_tmp10_ = g_new0 (gchar*, 5 + 1);
	_tmp10_[0] = _tmp6_;
	_tmp10_[1] = _tmp7_;
	_tmp10_[2] = _tmp8_;
	_tmp10_[3] = _tmp9_;
	_tmp10_[4] = NULL;
	artists = _tmp10_;
	artists_length1 = 5;
	_artists_size_ = artists_length1;
	logo = NULL;
	{
		GdkPixbuf* _tmp11_ = NULL;
		GdkPixbuf* _tmp12_ = NULL;
		GdkPixbuf* _tmp13_ = NULL;
		_tmp12_ = gdk_pixbuf_new_from_file (DATA_DIR "/images/app/logo.png", &_inner_error_);
		_tmp11_ = _tmp12_;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			goto __catch32_g_error;
		}
		_tmp13_ = _tmp11_;
		_tmp11_ = NULL;
		_g_object_unref0 (logo);
		logo = _tmp13_;
		_g_object_unref0 (_tmp11_);
	}
	goto __finally32;
	__catch32_g_error:
	{
		GError* e = NULL;
		GError* _tmp14_ = NULL;
		const gchar* _tmp15_ = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp14_ = e;
		_tmp15_ = _tmp14_->message;
		g_warning ("main_window.vala:1237: Logo: %s", _tmp15_);
		_g_error_free0 (e);
	}
	__finally32:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		_g_object_unref0 (logo);
		artists = (_vala_array_free (artists, artists_length1, (GDestroyNotify) g_free), NULL);
		authors = (_vala_array_free (authors, authors_length1, (GDestroyNotify) g_free), NULL);
		_g_free0 (website);
		_g_free0 (copyright);
		_g_free0 (comments);
		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;
	}
	_tmp16_ = _ ("About LaTeXila");
	_tmp17_ = _ ("translator-credits");
	_tmp18_ = logo;
	gtk_show_about_dialog ((GtkWindow*) self, "program-name", "LaTeXila", "version", PACKAGE_VERSION, "authors", authors, "artists", artists, "comments", comments, "copyright", copyright, "license-type", GTK_LICENSE_GPL_3_0, "title", _tmp16_, "translator-credits", _tmp17_, "website", website, "logo", _tmp18_, NULL);
	_g_object_unref0 (logo);
	artists = (_vala_array_free (artists, artists_length1, (GDestroyNotify) g_free), NULL);
	authors = (_vala_array_free (authors, authors_length1, (GDestroyNotify) g_free), NULL);
	_g_free0 (website);
	_g_free0 (copyright);
	_g_free0 (comments);
}


DocumentTab* main_window_get_active_tab (MainWindow* self) {
	DocumentTab* result;
	gboolean _tmp0_ = FALSE;
	DocumentsPanel* _tmp1_ = NULL;
	DocumentsPanel* _tmp4_ = NULL;
	DocumentTab* _tmp5_ = NULL;
	DocumentTab* _tmp6_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = self->priv->_documents_panel;
	if (_tmp1_ == NULL) {
		_tmp0_ = TRUE;
	} else {
		DocumentsPanel* _tmp2_ = NULL;
		gint _tmp3_ = 0;
		_tmp2_ = self->priv->_documents_panel;
		_tmp3_ = gtk_notebook_get_n_pages ((GtkNotebook*) _tmp2_);
		_tmp0_ = _tmp3_ == 0;
	}
	if (_tmp0_) {
		result = NULL;
		return result;
	}
	_tmp4_ = self->priv->_documents_panel;
	_tmp5_ = documents_panel_get_active_tab (_tmp4_);
	_tmp6_ = _tmp5_;
	result = _tmp6_;
	return result;
}


void main_window_set_active_tab (MainWindow* self, DocumentTab* value) {
	gint n = 0;
	DocumentsPanel* _tmp0_ = NULL;
	DocumentTab* _tmp1_ = NULL;
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_documents_panel;
	_tmp1_ = value;
	_tmp2_ = gtk_notebook_page_num ((GtkNotebook*) _tmp0_, (GtkWidget*) _tmp1_);
	n = _tmp2_;
	_tmp3_ = n;
	if (_tmp3_ != (-1)) {
		DocumentsPanel* _tmp4_ = NULL;
		gint _tmp5_ = 0;
		_tmp4_ = self->priv->_documents_panel;
		_tmp5_ = n;
		gtk_notebook_set_current_page ((GtkNotebook*) _tmp4_, _tmp5_);
	}
	g_object_notify ((GObject *) self, "active-tab");
}


DocumentView* main_window_get_active_view (MainWindow* self) {
	DocumentView* result;
	DocumentTab* _tmp0_ = NULL;
	DocumentTab* _tmp1_ = NULL;
	DocumentTab* _tmp2_ = NULL;
	DocumentTab* _tmp3_ = NULL;
	DocumentView* _tmp4_ = NULL;
	DocumentView* _tmp5_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = main_window_get_active_tab (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == NULL) {
		result = NULL;
		return result;
	}
	_tmp2_ = main_window_get_active_tab (self);
	_tmp3_ = _tmp2_;
	_tmp4_ = document_tab_get_view (_tmp3_);
	_tmp5_ = _tmp4_;
	result = _tmp5_;
	return result;
}


Document* main_window_get_active_document (MainWindow* self) {
	Document* result;
	DocumentTab* _tmp0_ = NULL;
	DocumentTab* _tmp1_ = NULL;
	DocumentTab* _tmp2_ = NULL;
	DocumentTab* _tmp3_ = NULL;
	Document* _tmp4_ = NULL;
	Document* _tmp5_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = main_window_get_active_tab (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == NULL) {
		result = NULL;
		return result;
	}
	_tmp2_ = main_window_get_active_tab (self);
	_tmp3_ = _tmp2_;
	_tmp4_ = document_tab_get_document (_tmp3_);
	_tmp5_ = _tmp4_;
	result = _tmp5_;
	return result;
}


static void main_window_class_init (MainWindowClass * klass) {
	main_window_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (MainWindowPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_main_window_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_main_window_set_property;
	G_OBJECT_CLASS (klass)->finalize = main_window_finalize;
	/*************************************************************************/
	g_object_class_install_property (G_OBJECT_CLASS (klass), MAIN_WINDOW_ACTIVE_TAB, g_param_spec_object ("active-tab", "active-tab", "active-tab", TYPE_DOCUMENT_TAB, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), MAIN_WINDOW_ACTIVE_VIEW, g_param_spec_object ("active-view", "active-view", "active-view", TYPE_DOCUMENT_VIEW, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), MAIN_WINDOW_ACTIVE_DOCUMENT, g_param_spec_object ("active-document", "active-document", "active-document", TYPE_DOCUMENT, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
}


static void main_window_instance_init (MainWindow * self) {
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	self->priv = MAIN_WINDOW_GET_PRIVATE (self);
	_tmp0_ = g_get_home_dir ();
	_tmp1_ = g_strdup (_tmp0_);
	self->default_location = _tmp1_;
}


static void main_window_finalize (GObject* obj) {
	MainWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_MAIN_WINDOW, MainWindow);
	_g_free0 (self->default_location);
	_g_object_unref0 (self->priv->_documents_panel);
	_g_object_unref0 (self->priv->_statusbar);
	_g_object_unref0 (self->priv->_goto_line);
	_g_object_unref0 (self->priv->_search_and_replace);
	_g_object_unref0 (self->priv->_main_hpaned);
	_g_object_unref0 (self->priv->_vpaned);
	_g_object_unref0 (self->priv->_ui_manager);
	_g_object_unref0 (self->priv->_action_group);
	_g_object_unref0 (self->priv->_latex_action_group);
	_main_window_file_unref0 (self->priv->_main_window_file);
	_main_window_edit_unref0 (self->priv->_main_window_edit);
	_main_window_build_tools_unref0 (self->priv->_main_window_build_tools);
	_main_window_structure_unref0 (self->priv->_main_window_structure);
	_main_window_documents_unref0 (self->priv->_main_window_documents);
	G_OBJECT_CLASS (main_window_parent_class)->finalize (obj);
}


GType main_window_get_type (void) {
	static volatile gsize main_window_type_id__volatile = 0;
	if (g_once_init_enter (&main_window_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (MainWindowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) main_window_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MainWindow), 0, (GInstanceInitFunc) main_window_instance_init, NULL };
		GType main_window_type_id;
		main_window_type_id = g_type_register_static (gtk_window_get_type (), "MainWindow", &g_define_type_info, 0);
		g_once_init_leave (&main_window_type_id__volatile, main_window_type_id);
	}
	return main_window_type_id__volatile;
}


static void _vala_main_window_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	MainWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_MAIN_WINDOW, MainWindow);
	switch (property_id) {
		case MAIN_WINDOW_ACTIVE_TAB:
		g_value_set_object (value, main_window_get_active_tab (self));
		break;
		case MAIN_WINDOW_ACTIVE_VIEW:
		g_value_set_object (value, main_window_get_active_view (self));
		break;
		case MAIN_WINDOW_ACTIVE_DOCUMENT:
		g_value_set_object (value, main_window_get_active_document (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_main_window_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	MainWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_MAIN_WINDOW, MainWindow);
	switch (property_id) {
		case MAIN_WINDOW_ACTIVE_TAB:
		main_window_set_active_tab (self, g_value_get_object (value));
		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;
}



