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

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


#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <tepl/tepl.h>
#include <glib/gi18n-lib.h>
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <gee.h>
#include <gobject/gvaluecollector.h>


#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;
typedef struct _MainWindowDocumentsPrivate MainWindowDocumentsPrivate;

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

typedef struct _MainWindow MainWindow;
typedef struct _MainWindowClass MainWindowClass;

#define TYPE_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 _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

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

typedef struct _DocumentTab DocumentTab;
typedef struct _DocumentTabClass DocumentTabClass;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_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_GLATEX_APP (glatex_app_get_type ())
#define GLATEX_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_GLATEX_APP, GlatexApp))
#define GLATEX_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GLATEX_APP, GlatexAppClass))
#define IS_GLATEX_APP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_GLATEX_APP))
#define IS_GLATEX_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GLATEX_APP))
#define GLATEX_APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_GLATEX_APP, GlatexAppClass))

typedef struct _GlatexApp GlatexApp;
typedef struct _GlatexAppClass GlatexAppClass;

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

struct _MainWindowDocuments {
	GTypeInstance parent_instance;
	volatile int ref_count;
	MainWindowDocumentsPrivate * priv;
};

struct _MainWindowDocumentsClass {
	GTypeClass parent_class;
	void (*finalize) (MainWindowDocuments *self);
};

struct _MainWindowDocumentsPrivate {
	MainWindow* _main_window;
	GtkUIManager* _ui_manager;
	DocumentsPanel* _documents_panel;
	GtkActionGroup* _static_action_group;
	GtkActionGroup* _list_action_group;
	guint _list_id;
};

struct _ParamSpecMainWindowDocuments {
	GParamSpec parent_instance;
};


static gpointer main_window_documents_parent_class = NULL;

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;
GType main_window_get_type (void) G_GNUC_CONST;
GType documents_panel_get_type (void) G_GNUC_CONST;
#define MAIN_WINDOW_DOCUMENTS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_MAIN_WINDOW_DOCUMENTS, MainWindowDocumentsPrivate))
void main_window_documents_on_save_all (MainWindowDocuments* self);
static void _main_window_documents_on_save_all_gtk_action_callback (GtkAction* action,
                                                             gpointer self);
void main_window_documents_on_close_all (MainWindowDocuments* self);
static void _main_window_documents_on_close_all_gtk_action_callback (GtkAction* action,
                                                              gpointer self);
void main_window_documents_on_previous (MainWindowDocuments* self);
static void _main_window_documents_on_previous_gtk_action_callback (GtkAction* action,
                                                             gpointer self);
void main_window_documents_on_next (MainWindowDocuments* self);
static void _main_window_documents_on_next_gtk_action_callback (GtkAction* action,
                                                         gpointer self);
void main_window_documents_on_move_to_new_window (MainWindowDocuments* self);
static void _main_window_documents_on_move_to_new_window_gtk_action_callback (GtkAction* action,
                                                                       gpointer self);
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);
void main_window_documents_set_documents_panel (MainWindowDocuments* self,
                                                DocumentsPanel* documents_panel);
static void main_window_documents_connect_signals (MainWindowDocuments* self);
static void main_window_documents_update_sensitivity (MainWindowDocuments* self);
static void __lambda22_ (MainWindowDocuments* self);
static void main_window_documents_update_documents_list (MainWindowDocuments* self);
static void ___lambda22__gtk_notebook_page_reordered (GtkNotebook* _sender,
                                               GtkWidget* child,
                                               guint page_num,
                                               gpointer self);
static void __lambda23_ (MainWindowDocuments* self,
                  GtkWidget* pg,
                  guint page_num);
static void main_window_documents_set_active_document (MainWindowDocuments* self,
                                                guint doc_num);
static void ___lambda23__gtk_notebook_switch_page (GtkNotebook* _sender,
                                            GtkWidget* page,
                                            guint page_num,
                                            gpointer self);
static void __lambda24_ (MainWindowDocuments* self);
static void ___lambda24__gtk_notebook_page_removed (GtkNotebook* _sender,
                                             GtkWidget* child,
                                             guint page_num,
                                             gpointer self);
static void __lambda25_ (MainWindowDocuments* self);
static void ___lambda25__gtk_notebook_page_added (GtkNotebook* _sender,
                                           GtkWidget* child,
                                           guint page_num,
                                           gpointer self);
static void main_window_documents_list_action_activate (MainWindowDocuments* self,
                                                 GtkAction* action);
static void _main_window_documents_list_action_activate_gtk_action_activate (GtkAction* _sender,
                                                                      gpointer self);
GType document_tab_get_type (void) G_GNUC_CONST;
static gchar* main_window_documents_get_list_action_name (MainWindowDocuments* self,
                                                   guint doc_num);
gchar* document_tab_get_menu_tip (DocumentTab* self);
DocumentTab* main_window_get_active_tab (MainWindow* self);
void main_window_documents_update_document_name (MainWindowDocuments* self,
                                                 DocumentTab* tab);
static void main_window_documents_update_next_prev_doc_sensitivity (MainWindowDocuments* self);
GType document_get_type (void) G_GNUC_CONST;
GeeList* main_window_get_unsaved_documents (MainWindow* self);
void document_save (Document* self,
                    gboolean check_file_changed_on_disk,
                    gboolean force);
gboolean main_window_close_all_documents (MainWindow* self);
GType glatex_app_get_type (void) G_GNUC_CONST;
GlatexApp* glatex_app_get_instance (void);
MainWindow* glatex_app_create_window (GlatexApp* self);
GType document_view_get_type (void) G_GNUC_CONST;
DocumentView* document_tab_get_document_view (DocumentTab* self);
void documents_panel_remove_tab (DocumentsPanel* self,
                                 DocumentTab* tab);
void main_window_create_tab_with_view (MainWindow* self,
                                       DocumentView* view);
static void main_window_documents_finalize (MainWindowDocuments * obj);
static void _vala_array_destroy (gpointer array,
                          gint array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gint array_length,
                       GDestroyNotify destroy_func);

static const GtkActionEntry MAIN_WINDOW_DOCUMENTS__action_entries[6] = {{"Documents", NULL, N_ ("_Documents")}, {"DocumentsSaveAll", "document-save", N_ ("_Save All"), "<Shift><Control>L", N_ ("Save all open files"), (GCallback) _main_window_documents_on_save_all_gtk_action_callback}, {"DocumentsCloseAll", "window-close", N_ ("_Close All"), "<Shift><Control>W", N_ ("Close all open files"), (GCallback) _main_window_documents_on_close_all_gtk_action_callback}, {"DocumentsPrevious", "go-previous", N_ ("_Previous Document"), "<Control>Page_Up", N_ ("Activate previous document"), (GCallback) _main_window_documents_on_previous_gtk_action_callback}, {"DocumentsNext", "go-next", N_ ("_Next Document"), "<Control>Page_Down", N_ ("Activate next document"), (GCallback) _main_window_documents_on_next_gtk_action_callback}, {"DocumentsMoveToNewWindow", NULL, N_ ("_Move to New Window"), NULL, N_ ("Move the current document to a new window"), (GCallback) _main_window_documents_on_move_to_new_window_gtk_action_callback}};

static void
_main_window_documents_on_save_all_gtk_action_callback (GtkAction* action,
                                                        gpointer self)
{
#line 28 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	main_window_documents_on_save_all ((MainWindowDocuments*) self);
#line 250 "main_window_documents.c"
}


static void
_main_window_documents_on_close_all_gtk_action_callback (GtkAction* action,
                                                         gpointer self)
{
#line 28 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	main_window_documents_on_close_all ((MainWindowDocuments*) self);
#line 260 "main_window_documents.c"
}


static void
_main_window_documents_on_previous_gtk_action_callback (GtkAction* action,
                                                        gpointer self)
{
#line 28 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	main_window_documents_on_previous ((MainWindowDocuments*) self);
#line 270 "main_window_documents.c"
}


static void
_main_window_documents_on_next_gtk_action_callback (GtkAction* action,
                                                    gpointer self)
{
#line 28 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	main_window_documents_on_next ((MainWindowDocuments*) self);
#line 280 "main_window_documents.c"
}


static void
_main_window_documents_on_move_to_new_window_gtk_action_callback (GtkAction* action,
                                                                  gpointer self)
{
#line 28 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	main_window_documents_on_move_to_new_window ((MainWindowDocuments*) self);
#line 290 "main_window_documents.c"
}


static gpointer
_g_object_ref0 (gpointer self)
{
#line 61 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	return self ? g_object_ref (self) : NULL;
#line 299 "main_window_documents.c"
}


MainWindowDocuments*
main_window_documents_construct (GType object_type,
                                 MainWindow* main_window,
                                 GtkUIManager* ui_manager)
{
	MainWindowDocuments* self = NULL;
	GtkUIManager* _tmp0_;
	GtkActionGroup* _tmp1_;
	GtkActionGroup* _tmp2_;
	GtkActionGroup* _tmp3_;
	GtkActionGroup* _tmp4_;
	GtkActionGroup* _tmp5_;
	GtkActionGroup* _tmp6_;
#line 58 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_val_if_fail (main_window != NULL, NULL);
#line 58 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_val_if_fail (ui_manager != NULL, NULL);
#line 58 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	self = (MainWindowDocuments*) g_type_create_instance (object_type);
#line 60 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	self->priv->_main_window = main_window;
#line 61 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp0_ = _g_object_ref0 (ui_manager);
#line 61 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_g_object_unref0 (self->priv->_ui_manager);
#line 61 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	self->priv->_ui_manager = _tmp0_;
#line 63 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp1_ = gtk_action_group_new ("DocumentsMenuActionGroup");
#line 63 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_g_object_unref0 (self->priv->_static_action_group);
#line 63 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	self->priv->_static_action_group = _tmp1_;
#line 64 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp2_ = self->priv->_static_action_group;
#line 64 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	gtk_action_group_set_translation_domain (_tmp2_, GETTEXT_PACKAGE);
#line 65 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp3_ = self->priv->_static_action_group;
#line 65 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	gtk_action_group_add_actions (_tmp3_, MAIN_WINDOW_DOCUMENTS__action_entries, (guint) G_N_ELEMENTS (MAIN_WINDOW_DOCUMENTS__action_entries), self);
#line 66 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp4_ = self->priv->_static_action_group;
#line 66 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	gtk_ui_manager_insert_action_group (ui_manager, _tmp4_, 0);
#line 68 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp5_ = gtk_action_group_new ("DocumentsListActionGroup");
#line 68 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_g_object_unref0 (self->priv->_list_action_group);
#line 68 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	self->priv->_list_action_group = _tmp5_;
#line 69 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp6_ = self->priv->_list_action_group;
#line 69 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	gtk_ui_manager_insert_action_group (ui_manager, _tmp6_, 0);
#line 58 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	return self;
#line 360 "main_window_documents.c"
}


MainWindowDocuments*
main_window_documents_new (MainWindow* main_window,
                           GtkUIManager* ui_manager)
{
#line 58 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	return main_window_documents_construct (TYPE_MAIN_WINDOW_DOCUMENTS, main_window, ui_manager);
#line 370 "main_window_documents.c"
}


void
main_window_documents_set_documents_panel (MainWindowDocuments* self,
                                           DocumentsPanel* documents_panel)
{
	DocumentsPanel* _tmp0_;
#line 72 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (self != NULL);
#line 72 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (documents_panel != NULL);
#line 74 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp0_ = _g_object_ref0 (documents_panel);
#line 74 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_g_object_unref0 (self->priv->_documents_panel);
#line 74 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	self->priv->_documents_panel = _tmp0_;
#line 75 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	main_window_documents_connect_signals (self);
#line 76 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	main_window_documents_update_sensitivity (self);
#line 393 "main_window_documents.c"
}


static void
__lambda22_ (MainWindowDocuments* self)
{
#line 85 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	main_window_documents_update_sensitivity (self);
#line 86 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	main_window_documents_update_documents_list (self);
#line 404 "main_window_documents.c"
}


static void
___lambda22__gtk_notebook_page_reordered (GtkNotebook* _sender,
                                          GtkWidget* child,
                                          guint page_num,
                                          gpointer self)
{
#line 83 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	__lambda22_ ((MainWindowDocuments*) self);
#line 416 "main_window_documents.c"
}


static void
__lambda23_ (MainWindowDocuments* self,
             GtkWidget* pg,
             guint page_num)
{
#line 89 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (pg != NULL);
#line 91 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	main_window_documents_set_active_document (self, page_num);
#line 92 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	main_window_documents_update_sensitivity (self);
#line 431 "main_window_documents.c"
}


static void
___lambda23__gtk_notebook_switch_page (GtkNotebook* _sender,
                                       GtkWidget* page,
                                       guint page_num,
                                       gpointer self)
{
#line 89 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	__lambda23_ ((MainWindowDocuments*) self, page, page_num);
#line 443 "main_window_documents.c"
}


static void
__lambda24_ (MainWindowDocuments* self)
{
#line 97 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	main_window_documents_update_documents_list (self);
#line 98 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	main_window_documents_update_sensitivity (self);
#line 454 "main_window_documents.c"
}


static void
___lambda24__gtk_notebook_page_removed (GtkNotebook* _sender,
                                        GtkWidget* child,
                                        guint page_num,
                                        gpointer self)
{
#line 95 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	__lambda24_ ((MainWindowDocuments*) self);
#line 466 "main_window_documents.c"
}


static void
__lambda25_ (MainWindowDocuments* self)
{
#line 103 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	main_window_documents_update_documents_list (self);
#line 104 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	main_window_documents_update_sensitivity (self);
#line 477 "main_window_documents.c"
}


static void
___lambda25__gtk_notebook_page_added (GtkNotebook* _sender,
                                      GtkWidget* child,
                                      guint page_num,
                                      gpointer self)
{
#line 101 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	__lambda25_ ((MainWindowDocuments*) self);
#line 489 "main_window_documents.c"
}


static void
main_window_documents_connect_signals (MainWindowDocuments* self)
{
	DocumentsPanel* _tmp0_;
	DocumentsPanel* _tmp1_;
	DocumentsPanel* _tmp2_;
	DocumentsPanel* _tmp3_;
	DocumentsPanel* _tmp4_;
#line 79 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (self != NULL);
#line 81 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp0_ = self->priv->_documents_panel;
#line 81 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (_tmp0_ != NULL);
#line 83 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp1_ = self->priv->_documents_panel;
#line 83 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_signal_connect_after ((GtkNotebook*) _tmp1_, "page-reordered", (GCallback) ___lambda22__gtk_notebook_page_reordered, self);
#line 89 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp2_ = self->priv->_documents_panel;
#line 89 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_signal_connect_after ((GtkNotebook*) _tmp2_, "switch-page", (GCallback) ___lambda23__gtk_notebook_switch_page, self);
#line 95 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp3_ = self->priv->_documents_panel;
#line 95 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_signal_connect_after ((GtkNotebook*) _tmp3_, "page-removed", (GCallback) ___lambda24__gtk_notebook_page_removed, self);
#line 101 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp4_ = self->priv->_documents_panel;
#line 101 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_signal_connect_after ((GtkNotebook*) _tmp4_, "page-added", (GCallback) ___lambda25__gtk_notebook_page_added, self);
#line 523 "main_window_documents.c"
}


static void
_main_window_documents_list_action_activate_gtk_action_activate (GtkAction* _sender,
                                                                 gpointer self)
{
#line 118 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	main_window_documents_list_action_activate ((MainWindowDocuments*) self, _sender);
#line 533 "main_window_documents.c"
}


static gchar*
string_replace (const gchar* self,
                const gchar* old,
                const gchar* replacement)
{
	gchar* result = NULL;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GError * _inner_error_ = NULL;
#line 1421 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1421 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
	g_return_val_if_fail (old != NULL, NULL);
#line 1421 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
	g_return_val_if_fail (replacement != NULL, NULL);
#line 1422 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
	if ((*((gchar*) self)) == '\0') {
#line 1422 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp1_ = TRUE;
#line 556 "main_window_documents.c"
	} else {
#line 1422 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp1_ = (*((gchar*) old)) == '\0';
#line 560 "main_window_documents.c"
	}
#line 1422 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
	if (_tmp1_) {
#line 1422 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp0_ = TRUE;
#line 566 "main_window_documents.c"
	} else {
#line 1422 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp0_ = g_strcmp0 (old, replacement) == 0;
#line 570 "main_window_documents.c"
	}
#line 1422 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
	if (_tmp0_) {
#line 574 "main_window_documents.c"
		gchar* _tmp2_;
#line 1423 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp2_ = g_strdup (self);
#line 1423 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		result = _tmp2_;
#line 1423 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		return result;
#line 582 "main_window_documents.c"
	}
	{
		GRegex* regex = NULL;
		gchar* _tmp3_;
		gchar* _tmp4_;
		GRegex* _tmp5_;
		GRegex* _tmp6_;
		gchar* _tmp7_ = NULL;
		GRegex* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
#line 1426 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp3_ = g_regex_escape_string (old, -1);
#line 1426 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp4_ = _tmp3_;
#line 1426 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp5_ = g_regex_new (_tmp4_, 0, 0, &_inner_error_);
#line 1426 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp6_ = _tmp5_;
#line 1426 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		_g_free0 (_tmp4_);
#line 1426 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		regex = _tmp6_;
#line 1426 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1426 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
			if (_inner_error_->domain == G_REGEX_ERROR) {
#line 610 "main_window_documents.c"
				goto __catch29_g_regex_error;
			}
#line 1426 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1426 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
			g_clear_error (&_inner_error_);
#line 1426 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
			return NULL;
#line 619 "main_window_documents.c"
		}
#line 1427 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp8_ = regex;
#line 1427 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp9_ = g_regex_replace_literal (_tmp8_, self, (gssize) -1, 0, replacement, 0, &_inner_error_);
#line 1427 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp7_ = _tmp9_;
#line 1427 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1427 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
			_g_regex_unref0 (regex);
#line 1427 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
			if (_inner_error_->domain == G_REGEX_ERROR) {
#line 633 "main_window_documents.c"
				goto __catch29_g_regex_error;
			}
#line 1427 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
			_g_regex_unref0 (regex);
#line 1427 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1427 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
			g_clear_error (&_inner_error_);
#line 1427 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
			return NULL;
#line 644 "main_window_documents.c"
		}
#line 1427 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp10_ = _tmp7_;
#line 1427 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp7_ = NULL;
#line 1427 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		result = _tmp10_;
#line 1427 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		_g_free0 (_tmp7_);
#line 1427 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		_g_regex_unref0 (regex);
#line 1427 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		return result;
#line 658 "main_window_documents.c"
	}
	goto __finally29;
	__catch29_g_regex_error:
	{
		GError* e = NULL;
#line 1425 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		e = _inner_error_;
#line 1425 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		_inner_error_ = NULL;
#line 1429 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		g_assert_not_reached ();
#line 1425 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		_g_error_free0 (e);
#line 672 "main_window_documents.c"
	}
	__finally29:
#line 1425 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1425 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		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);
#line 1425 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		g_clear_error (&_inner_error_);
#line 1425 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		return NULL;
#line 683 "main_window_documents.c"
	}
}


static void
main_window_documents_update_documents_list (MainWindowDocuments* self)
{
	GtkActionGroup* _tmp0_;
	DocumentsPanel* _tmp1_;
	guint _tmp2_;
	GtkActionGroup* _tmp5_;
	GList* _tmp6_;
	gint nb_docs = 0;
	DocumentsPanel* _tmp12_;
	gint _tmp13_;
	GtkUIManager* _tmp14_;
	GSList* group = NULL;
#line 108 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (self != NULL);
#line 110 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp0_ = self->priv->_list_action_group;
#line 110 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (_tmp0_ != NULL);
#line 111 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp1_ = self->priv->_documents_panel;
#line 111 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (_tmp1_ != NULL);
#line 113 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp2_ = self->priv->_list_id;
#line 113 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	if (_tmp2_ != ((guint) 0)) {
#line 715 "main_window_documents.c"
		GtkUIManager* _tmp3_;
		guint _tmp4_;
#line 114 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		_tmp3_ = self->priv->_ui_manager;
#line 114 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		_tmp4_ = self->priv->_list_id;
#line 114 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		gtk_ui_manager_remove_ui (_tmp3_, _tmp4_);
#line 724 "main_window_documents.c"
	}
#line 116 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp5_ = self->priv->_list_action_group;
#line 116 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp6_ = gtk_action_group_list_actions (_tmp5_);
#line 730 "main_window_documents.c"
	{
		GList* action_collection = NULL;
		GList* action_it = NULL;
#line 116 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		action_collection = _tmp6_;
#line 116 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		for (action_it = action_collection; action_it != NULL; action_it = action_it->next) {
#line 738 "main_window_documents.c"
			GtkAction* _tmp7_;
			GtkAction* action = NULL;
#line 116 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
			_tmp7_ = _g_object_ref0 ((GtkAction*) action_it->data);
#line 116 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
			action = _tmp7_;
#line 745 "main_window_documents.c"
			{
				GtkAction* _tmp8_;
				guint _tmp9_;
				GtkActionGroup* _tmp10_;
				GtkAction* _tmp11_;
#line 118 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp8_ = action;
#line 118 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				g_signal_parse_name ("activate", gtk_action_get_type (), &_tmp9_, NULL, FALSE);
#line 118 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				g_signal_handlers_disconnect_matched (_tmp8_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp9_, 0, NULL, (GCallback) _main_window_documents_list_action_activate_gtk_action_activate, self);
#line 119 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp10_ = self->priv->_list_action_group;
#line 119 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp11_ = action;
#line 119 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				gtk_action_group_remove_action (_tmp10_, _tmp11_);
#line 116 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_g_object_unref0 (action);
#line 765 "main_window_documents.c"
			}
		}
#line 116 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		(action_collection == NULL) ? NULL : (action_collection = (g_list_free (action_collection), NULL));
#line 770 "main_window_documents.c"
	}
#line 122 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	self->priv->_list_id = (guint) 0;
#line 124 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp12_ = self->priv->_documents_panel;
#line 124 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	nb_docs = gtk_notebook_get_n_pages ((GtkNotebook*) _tmp12_);
#line 125 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp13_ = nb_docs;
#line 125 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	if (_tmp13_ == 0) {
#line 126 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		return;
#line 784 "main_window_documents.c"
	}
#line 128 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp14_ = self->priv->_ui_manager;
#line 128 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	self->priv->_list_id = gtk_ui_manager_new_merge_id (_tmp14_);
#line 130 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	group = NULL;
#line 792 "main_window_documents.c"
	{
		gint doc_num = 0;
#line 132 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		doc_num = 0;
#line 797 "main_window_documents.c"
		{
			gboolean _tmp15_ = FALSE;
#line 132 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
			_tmp15_ = TRUE;
#line 132 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
			while (TRUE) {
#line 804 "main_window_documents.c"
				gint _tmp17_;
				gint _tmp18_;
				DocumentTab* tab = NULL;
				DocumentsPanel* _tmp19_;
				gint _tmp20_;
				GtkWidget* _tmp21_;
				DocumentTab* _tmp22_;
				gchar* action_name = NULL;
				gint _tmp23_;
				gchar* _tmp24_;
				gchar* name = NULL;
				DocumentTab* _tmp25_;
				TeplBuffer* _tmp26_;
				gchar* _tmp27_;
				gchar* _tmp28_;
				gchar* _tmp29_;
				gchar* _tmp30_;
				gchar* tip = NULL;
				DocumentTab* _tmp31_;
				gchar* _tmp32_;
				gchar* accel = NULL;
				gint _tmp33_;
				GtkRadioAction* action = NULL;
				const gchar* _tmp36_;
				const gchar* _tmp37_;
				const gchar* _tmp38_;
				gint _tmp39_;
				GtkRadioAction* _tmp40_;
				GSList* _tmp41_;
				GtkRadioAction* _tmp44_;
				GSList* _tmp45_;
				GtkActionGroup* _tmp46_;
				GtkRadioAction* _tmp47_;
				const gchar* _tmp48_;
				GtkRadioAction* _tmp49_;
				GtkUIManager* _tmp50_;
				guint _tmp51_;
				const gchar* _tmp52_;
				const gchar* _tmp53_;
				DocumentTab* _tmp54_;
				MainWindow* _tmp55_;
				DocumentTab* _tmp56_;
				DocumentTab* _tmp57_;
#line 132 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				if (!_tmp15_) {
#line 850 "main_window_documents.c"
					gint _tmp16_;
#line 132 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
					_tmp16_ = doc_num;
#line 132 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
					doc_num = _tmp16_ + 1;
#line 856 "main_window_documents.c"
				}
#line 132 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp15_ = FALSE;
#line 132 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp17_ = doc_num;
#line 132 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp18_ = nb_docs;
#line 132 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				if (!(_tmp17_ < _tmp18_)) {
#line 132 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
					break;
#line 868 "main_window_documents.c"
				}
#line 134 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp19_ = self->priv->_documents_panel;
#line 134 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp20_ = doc_num;
#line 134 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp21_ = gtk_notebook_get_nth_page ((GtkNotebook*) _tmp19_, _tmp20_);
#line 134 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp22_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp21_, TYPE_DOCUMENT_TAB) ? ((DocumentTab*) _tmp21_) : NULL);
#line 134 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				tab = _tmp22_;
#line 135 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp23_ = doc_num;
#line 135 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp24_ = main_window_documents_get_list_action_name (self, (guint) _tmp23_);
#line 135 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				action_name = _tmp24_;
#line 136 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp25_ = tab;
#line 136 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp26_ = tepl_tab_get_buffer ((TeplTab*) _tmp25_);
#line 136 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp27_ = tepl_buffer_get_short_title (_tmp26_);
#line 136 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp28_ = _tmp27_;
#line 136 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp29_ = string_replace (_tmp28_, "_", "__");
#line 136 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp30_ = _tmp29_;
#line 136 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_g_free0 (_tmp28_);
#line 136 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				name = _tmp30_;
#line 137 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp31_ = tab;
#line 137 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp32_ = document_tab_get_menu_tip (_tmp31_);
#line 137 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				tip = _tmp32_;
#line 139 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				accel = NULL;
#line 140 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp33_ = doc_num;
#line 140 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				if (_tmp33_ < 10) {
#line 914 "main_window_documents.c"
					gint _tmp34_;
					gchar* _tmp35_;
#line 141 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
					_tmp34_ = doc_num;
#line 141 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
					_tmp35_ = g_strdup_printf ("<alt>%d", (_tmp34_ + 1) % 10);
#line 141 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
					_g_free0 (accel);
#line 141 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
					accel = _tmp35_;
#line 925 "main_window_documents.c"
				}
#line 143 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp36_ = action_name;
#line 143 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp37_ = name;
#line 143 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp38_ = tip;
#line 143 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp39_ = doc_num;
#line 143 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp40_ = gtk_radio_action_new (_tmp36_, _tmp37_, _tmp38_, NULL, _tmp39_);
#line 143 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				action = _tmp40_;
#line 144 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp41_ = group;
#line 144 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				if (_tmp41_ != NULL) {
#line 943 "main_window_documents.c"
					GtkRadioAction* _tmp42_;
					GSList* _tmp43_;
#line 145 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
					_tmp42_ = action;
#line 145 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
					_tmp43_ = group;
#line 145 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
					gtk_radio_action_set_group (_tmp42_, _tmp43_);
#line 952 "main_window_documents.c"
				}
#line 148 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp44_ = action;
#line 148 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp45_ = gtk_radio_action_get_group (_tmp44_);
#line 148 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				group = _tmp45_;
#line 150 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp46_ = self->priv->_list_action_group;
#line 150 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp47_ = action;
#line 150 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp48_ = accel;
#line 150 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				gtk_action_group_add_action_with_accel (_tmp46_, (GtkAction*) _tmp47_, _tmp48_);
#line 152 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp49_ = action;
#line 152 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				g_signal_connect ((GtkAction*) _tmp49_, "activate", (GCallback) _main_window_documents_list_action_activate_gtk_action_activate, self);
#line 154 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp50_ = self->priv->_ui_manager;
#line 154 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp51_ = self->priv->_list_id;
#line 154 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp52_ = action_name;
#line 154 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp53_ = action_name;
#line 154 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				gtk_ui_manager_add_ui (_tmp50_, _tmp51_, "/MainMenu/DocumentsMenu/DocumentsListPlaceholder", _tmp52_, _tmp53_, GTK_UI_MANAGER_MENUITEM, FALSE);
#line 158 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp54_ = tab;
#line 158 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp55_ = self->priv->_main_window;
#line 158 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp56_ = main_window_get_active_tab (_tmp55_);
#line 158 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp57_ = _tmp56_;
#line 158 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				if (_tmp54_ == _tmp57_) {
#line 992 "main_window_documents.c"
					GtkRadioAction* _tmp58_;
#line 159 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
					_tmp58_ = action;
#line 159 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
					gtk_toggle_action_set_active ((GtkToggleAction*) _tmp58_, TRUE);
#line 998 "main_window_documents.c"
				}
#line 132 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_g_object_unref0 (action);
#line 132 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_g_free0 (accel);
#line 132 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_g_free0 (tip);
#line 132 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_g_free0 (name);
#line 132 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_g_free0 (action_name);
#line 132 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_g_object_unref0 (tab);
#line 1012 "main_window_documents.c"
			}
		}
	}
}


static void
main_window_documents_set_active_document (MainWindowDocuments* self,
                                           guint doc_num)
{
	gchar* action_name = NULL;
	gchar* _tmp0_;
	GtkRadioAction* action = NULL;
	GtkActionGroup* _tmp1_;
	const gchar* _tmp2_;
	GtkAction* _tmp3_;
	GtkRadioAction* _tmp4_;
	GtkRadioAction* _tmp5_;
#line 163 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (self != NULL);
#line 165 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp0_ = main_window_documents_get_list_action_name (self, doc_num);
#line 165 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	action_name = _tmp0_;
#line 166 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp1_ = self->priv->_list_action_group;
#line 166 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp2_ = action_name;
#line 166 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp3_ = gtk_action_group_get_action (_tmp1_, _tmp2_);
#line 166 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp4_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, gtk_radio_action_get_type ()) ? ((GtkRadioAction*) _tmp3_) : NULL);
#line 166 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	action = _tmp4_;
#line 168 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp5_ = action;
#line 168 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	if (_tmp5_ != NULL) {
#line 1051 "main_window_documents.c"
		GtkRadioAction* _tmp6_;
		guint _tmp7_;
		GtkRadioAction* _tmp8_;
		GtkRadioAction* _tmp9_;
#line 171 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		_tmp6_ = action;
#line 171 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		g_signal_parse_name ("activate", gtk_action_get_type (), &_tmp7_, NULL, FALSE);
#line 171 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		g_signal_handlers_disconnect_matched ((GtkAction*) _tmp6_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp7_, 0, NULL, (GCallback) _main_window_documents_list_action_activate_gtk_action_activate, self);
#line 172 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		_tmp8_ = action;
#line 172 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		gtk_toggle_action_set_active ((GtkToggleAction*) _tmp8_, TRUE);
#line 173 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		_tmp9_ = action;
#line 173 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		g_signal_connect ((GtkAction*) _tmp9_, "activate", (GCallback) _main_window_documents_list_action_activate_gtk_action_activate, self);
#line 1070 "main_window_documents.c"
	}
#line 163 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_g_object_unref0 (action);
#line 163 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_g_free0 (action_name);
#line 1076 "main_window_documents.c"
}


void
main_window_documents_update_document_name (MainWindowDocuments* self,
                                            DocumentTab* tab)
{
	DocumentsPanel* _tmp0_;
	gint doc_num = 0;
	DocumentsPanel* _tmp1_;
	gchar* action_name = NULL;
	gchar* _tmp2_;
	GtkAction* action = NULL;
	GtkActionGroup* _tmp3_;
	GtkAction* _tmp4_;
	GtkAction* _tmp5_;
	TeplBuffer* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
#line 177 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (self != NULL);
#line 177 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (tab != NULL);
#line 179 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp0_ = self->priv->_documents_panel;
#line 179 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (_tmp0_ != NULL);
#line 181 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp1_ = self->priv->_documents_panel;
#line 181 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	doc_num = gtk_notebook_page_num ((GtkNotebook*) _tmp1_, (GtkWidget*) tab);
#line 182 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp2_ = main_window_documents_get_list_action_name (self, (guint) doc_num);
#line 182 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	action_name = _tmp2_;
#line 184 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp3_ = self->priv->_list_action_group;
#line 184 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp4_ = gtk_action_group_get_action (_tmp3_, action_name);
#line 184 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp5_ = _g_object_ref0 (_tmp4_);
#line 184 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	action = _tmp5_;
#line 185 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (action != NULL);
#line 187 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp6_ = tepl_tab_get_buffer ((TeplTab*) tab);
#line 187 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp7_ = tepl_buffer_get_short_title (_tmp6_);
#line 187 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp8_ = _tmp7_;
#line 187 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp9_ = string_replace (_tmp8_, "_", "__");
#line 187 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp10_ = _tmp9_;
#line 187 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	gtk_action_set_label (action, _tmp10_);
#line 187 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_g_free0 (_tmp10_);
#line 187 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_g_free0 (_tmp8_);
#line 188 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp11_ = document_tab_get_menu_tip (tab);
#line 188 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp12_ = _tmp11_;
#line 188 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	gtk_action_set_tooltip (action, _tmp12_);
#line 188 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_g_free0 (_tmp12_);
#line 177 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_g_object_unref0 (action);
#line 177 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_g_free0 (action_name);
#line 1154 "main_window_documents.c"
}


static void
main_window_documents_list_action_activate (MainWindowDocuments* self,
                                            GtkAction* action)
{
	DocumentsPanel* _tmp0_;
	GtkRadioAction* radio_action = NULL;
	GtkRadioAction* _tmp1_;
	GtkRadioAction* _tmp2_;
	DocumentsPanel* _tmp3_;
	GtkRadioAction* _tmp4_;
#line 191 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (self != NULL);
#line 191 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (action != NULL);
#line 193 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp0_ = self->priv->_documents_panel;
#line 193 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (_tmp0_ != NULL);
#line 195 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (action, gtk_radio_action_get_type ()) ? ((GtkRadioAction*) action) : NULL);
#line 195 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	radio_action = _tmp1_;
#line 196 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp2_ = radio_action;
#line 196 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	if (!gtk_toggle_action_get_active ((GtkToggleAction*) _tmp2_)) {
#line 197 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		_g_object_unref0 (radio_action);
#line 197 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		return;
#line 1188 "main_window_documents.c"
	}
#line 199 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp3_ = self->priv->_documents_panel;
#line 199 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp4_ = radio_action;
#line 199 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	gtk_notebook_set_current_page ((GtkNotebook*) _tmp3_, gtk_radio_action_get_current_value (_tmp4_));
#line 191 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_g_object_unref0 (radio_action);
#line 1198 "main_window_documents.c"
}


static gchar*
main_window_documents_get_list_action_name (MainWindowDocuments* self,
                                            guint doc_num)
{
	gchar* result = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
#line 202 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 204 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp0_ = g_strdup_printf ("%u", doc_num);
#line 204 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp1_ = _tmp0_;
#line 204 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp2_ = g_strconcat ("Tab_", _tmp1_, NULL);
#line 204 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp3_ = _tmp2_;
#line 204 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_g_free0 (_tmp1_);
#line 204 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	result = _tmp3_;
#line 204 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	return result;
#line 1227 "main_window_documents.c"
}


static void
main_window_documents_update_sensitivity (MainWindowDocuments* self)
{
	gboolean sensitive = FALSE;
	MainWindow* _tmp0_;
	DocumentTab* _tmp1_;
	DocumentTab* _tmp2_;
	gchar** action_names = NULL;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar** _tmp6_;
	gint action_names_length1;
	gint _action_names_size_;
	gchar** _tmp7_;
	gint _tmp7__length1;
#line 209 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (self != NULL);
#line 211 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp0_ = self->priv->_main_window;
#line 211 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp1_ = main_window_get_active_tab (_tmp0_);
#line 211 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp2_ = _tmp1_;
#line 211 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	sensitive = _tmp2_ != NULL;
#line 213 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp3_ = g_strdup ("DocumentsSaveAll");
#line 213 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp4_ = g_strdup ("DocumentsCloseAll");
#line 213 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp5_ = g_strdup ("DocumentsMoveToNewWindow");
#line 213 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp6_ = g_new0 (gchar*, 3 + 1);
#line 213 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp6_[0] = _tmp3_;
#line 213 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp6_[1] = _tmp4_;
#line 213 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp6_[2] = _tmp5_;
#line 213 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	action_names = _tmp6_;
#line 213 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	action_names_length1 = 3;
#line 213 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_action_names_size_ = action_names_length1;
#line 220 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp7_ = action_names;
#line 220 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp7__length1 = action_names_length1;
#line 1281 "main_window_documents.c"
	{
		gchar** action_name_collection = NULL;
		gint action_name_collection_length1 = 0;
		gint _action_name_collection_size_ = 0;
		gint action_name_it = 0;
#line 220 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		action_name_collection = _tmp7_;
#line 220 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		action_name_collection_length1 = _tmp7__length1;
#line 220 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		for (action_name_it = 0; action_name_it < _tmp7__length1; action_name_it = action_name_it + 1) {
#line 1293 "main_window_documents.c"
			gchar* _tmp8_;
			gchar* action_name = NULL;
#line 220 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
			_tmp8_ = g_strdup (action_name_collection[action_name_it]);
#line 220 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
			action_name = _tmp8_;
#line 1300 "main_window_documents.c"
			{
				GtkAction* action = NULL;
				GtkActionGroup* _tmp9_;
				const gchar* _tmp10_;
				GtkAction* _tmp11_;
				GtkAction* _tmp12_;
				GtkAction* _tmp13_;
				gboolean _tmp14_;
#line 222 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp9_ = self->priv->_static_action_group;
#line 222 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp10_ = action_name;
#line 222 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp11_ = gtk_action_group_get_action (_tmp9_, _tmp10_);
#line 222 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp12_ = _g_object_ref0 (_tmp11_);
#line 222 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				action = _tmp12_;
#line 223 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp13_ = action;
#line 223 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_tmp14_ = sensitive;
#line 223 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				gtk_action_set_sensitive (_tmp13_, _tmp14_);
#line 220 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_g_object_unref0 (action);
#line 220 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				_g_free0 (action_name);
#line 1329 "main_window_documents.c"
			}
		}
	}
#line 226 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	main_window_documents_update_next_prev_doc_sensitivity (self);
#line 209 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	action_names = (_vala_array_free (action_names, action_names_length1, (GDestroyNotify) g_free), NULL);
#line 1337 "main_window_documents.c"
}


static void
main_window_documents_update_next_prev_doc_sensitivity (MainWindowDocuments* self)
{
	DocumentsPanel* _tmp0_;
	GtkAction* action_prev = NULL;
	GtkActionGroup* _tmp1_;
	GtkAction* _tmp2_;
	GtkAction* _tmp3_;
	GtkAction* action_next = NULL;
	GtkActionGroup* _tmp4_;
	GtkAction* _tmp5_;
	GtkAction* _tmp6_;
	MainWindow* _tmp7_;
	DocumentTab* _tmp8_;
	DocumentTab* _tmp9_;
	gint current_page = 0;
	DocumentsPanel* _tmp12_;
	MainWindow* _tmp13_;
	DocumentTab* _tmp14_;
	DocumentTab* _tmp15_;
	GtkAction* _tmp16_;
	gint _tmp17_;
	gint nb_pages = 0;
	DocumentsPanel* _tmp18_;
	GtkAction* _tmp19_;
	gint _tmp20_;
	gint _tmp21_;
#line 229 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (self != NULL);
#line 231 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp0_ = self->priv->_documents_panel;
#line 231 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (_tmp0_ != NULL);
#line 233 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp1_ = self->priv->_static_action_group;
#line 233 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp2_ = gtk_action_group_get_action (_tmp1_, "DocumentsPrevious");
#line 233 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp3_ = _g_object_ref0 (_tmp2_);
#line 233 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	action_prev = _tmp3_;
#line 234 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp4_ = self->priv->_static_action_group;
#line 234 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp5_ = gtk_action_group_get_action (_tmp4_, "DocumentsNext");
#line 234 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp6_ = _g_object_ref0 (_tmp5_);
#line 234 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	action_next = _tmp6_;
#line 236 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp7_ = self->priv->_main_window;
#line 236 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp8_ = main_window_get_active_tab (_tmp7_);
#line 236 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp9_ = _tmp8_;
#line 236 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	if (_tmp9_ == NULL) {
#line 1398 "main_window_documents.c"
		GtkAction* _tmp10_;
		GtkAction* _tmp11_;
#line 238 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		_tmp10_ = action_prev;
#line 238 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		gtk_action_set_sensitive (_tmp10_, FALSE);
#line 239 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		_tmp11_ = action_next;
#line 239 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		gtk_action_set_sensitive (_tmp11_, FALSE);
#line 240 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		_g_object_unref0 (action_next);
#line 240 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		_g_object_unref0 (action_prev);
#line 240 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		return;
#line 1415 "main_window_documents.c"
	}
#line 243 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp12_ = self->priv->_documents_panel;
#line 243 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp13_ = self->priv->_main_window;
#line 243 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp14_ = main_window_get_active_tab (_tmp13_);
#line 243 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp15_ = _tmp14_;
#line 243 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	current_page = gtk_notebook_page_num ((GtkNotebook*) _tmp12_, (GtkWidget*) _tmp15_);
#line 244 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp16_ = action_prev;
#line 244 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp17_ = current_page;
#line 244 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	gtk_action_set_sensitive (_tmp16_, _tmp17_ > 0);
#line 246 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp18_ = self->priv->_documents_panel;
#line 246 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	nb_pages = gtk_notebook_get_n_pages ((GtkNotebook*) _tmp18_);
#line 247 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp19_ = action_next;
#line 247 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp20_ = current_page;
#line 247 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp21_ = nb_pages;
#line 247 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	gtk_action_set_sensitive (_tmp19_, _tmp20_ < (_tmp21_ - 1));
#line 229 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_g_object_unref0 (action_next);
#line 229 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_g_object_unref0 (action_prev);
#line 1449 "main_window_documents.c"
}


void
main_window_documents_on_save_all (MainWindowDocuments* self)
{
	MainWindow* _tmp0_;
	DocumentTab* _tmp1_;
	DocumentTab* _tmp2_;
#line 252 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (self != NULL);
#line 254 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp0_ = self->priv->_main_window;
#line 254 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp1_ = main_window_get_active_tab (_tmp0_);
#line 254 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp2_ = _tmp1_;
#line 254 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (_tmp2_ != NULL);
#line 1469 "main_window_documents.c"
	{
		GeeList* _doc_list = NULL;
		MainWindow* _tmp3_;
		GeeList* _tmp4_;
		gint _doc_size = 0;
		GeeList* _tmp5_;
		gint _tmp6_;
		gint _tmp7_;
		gint _doc_index = 0;
#line 256 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		_tmp3_ = self->priv->_main_window;
#line 256 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		_tmp4_ = main_window_get_unsaved_documents (_tmp3_);
#line 256 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		_doc_list = _tmp4_;
#line 256 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		_tmp5_ = _doc_list;
#line 256 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		_tmp6_ = gee_collection_get_size ((GeeCollection*) _tmp5_);
#line 256 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		_tmp7_ = _tmp6_;
#line 256 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		_doc_size = _tmp7_;
#line 256 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		_doc_index = -1;
#line 256 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		while (TRUE) {
#line 1497 "main_window_documents.c"
			gint _tmp8_;
			gint _tmp9_;
			gint _tmp10_;
			Document* doc = NULL;
			GeeList* _tmp11_;
			gint _tmp12_;
			gpointer _tmp13_;
			Document* _tmp14_;
#line 256 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
			_tmp8_ = _doc_index;
#line 256 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
			_doc_index = _tmp8_ + 1;
#line 256 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
			_tmp9_ = _doc_index;
#line 256 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
			_tmp10_ = _doc_size;
#line 256 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
			if (!(_tmp9_ < _tmp10_)) {
#line 256 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
				break;
#line 1518 "main_window_documents.c"
			}
#line 256 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
			_tmp11_ = _doc_list;
#line 256 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
			_tmp12_ = _doc_index;
#line 256 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
			_tmp13_ = gee_list_get (_tmp11_, _tmp12_);
#line 256 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
			doc = (Document*) _tmp13_;
#line 257 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
			_tmp14_ = doc;
#line 257 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
			document_save (_tmp14_, TRUE, FALSE);
#line 256 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
			_g_object_unref0 (doc);
#line 1534 "main_window_documents.c"
		}
#line 256 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		_g_object_unref0 (_doc_list);
#line 1538 "main_window_documents.c"
	}
}


void
main_window_documents_on_close_all (MainWindowDocuments* self)
{
	MainWindow* _tmp0_;
	DocumentTab* _tmp1_;
	DocumentTab* _tmp2_;
	MainWindow* _tmp3_;
#line 260 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (self != NULL);
#line 262 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp0_ = self->priv->_main_window;
#line 262 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp1_ = main_window_get_active_tab (_tmp0_);
#line 262 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp2_ = _tmp1_;
#line 262 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (_tmp2_ != NULL);
#line 263 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp3_ = self->priv->_main_window;
#line 263 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	main_window_close_all_documents (_tmp3_);
#line 1564 "main_window_documents.c"
}


void
main_window_documents_on_previous (MainWindowDocuments* self)
{
	MainWindow* _tmp0_;
	DocumentTab* _tmp1_;
	DocumentTab* _tmp2_;
	DocumentsPanel* _tmp3_;
	DocumentsPanel* _tmp4_;
#line 266 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (self != NULL);
#line 268 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp0_ = self->priv->_main_window;
#line 268 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp1_ = main_window_get_active_tab (_tmp0_);
#line 268 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp2_ = _tmp1_;
#line 268 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (_tmp2_ != NULL);
#line 269 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp3_ = self->priv->_documents_panel;
#line 269 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (_tmp3_ != NULL);
#line 270 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp4_ = self->priv->_documents_panel;
#line 270 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	gtk_notebook_prev_page ((GtkNotebook*) _tmp4_);
#line 1594 "main_window_documents.c"
}


void
main_window_documents_on_next (MainWindowDocuments* self)
{
	MainWindow* _tmp0_;
	DocumentTab* _tmp1_;
	DocumentTab* _tmp2_;
	DocumentsPanel* _tmp3_;
	DocumentsPanel* _tmp4_;
#line 273 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (self != NULL);
#line 275 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp0_ = self->priv->_main_window;
#line 275 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp1_ = main_window_get_active_tab (_tmp0_);
#line 275 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp2_ = _tmp1_;
#line 275 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (_tmp2_ != NULL);
#line 276 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp3_ = self->priv->_documents_panel;
#line 276 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (_tmp3_ != NULL);
#line 277 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp4_ = self->priv->_documents_panel;
#line 277 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	gtk_notebook_next_page ((GtkNotebook*) _tmp4_);
#line 1624 "main_window_documents.c"
}


void
main_window_documents_on_move_to_new_window (MainWindowDocuments* self)
{
	DocumentTab* tab = NULL;
	MainWindow* _tmp0_;
	DocumentTab* _tmp1_;
	DocumentTab* _tmp2_;
	DocumentTab* _tmp3_;
	DocumentTab* _tmp4_;
	DocumentsPanel* _tmp5_;
	MainWindow* new_window = NULL;
	GlatexApp* _tmp6_;
	GlatexApp* _tmp7_;
	MainWindow* _tmp8_;
	MainWindow* _tmp9_;
	DocumentView* view = NULL;
	DocumentTab* _tmp10_;
	DocumentView* _tmp11_;
	DocumentView* _tmp12_;
	DocumentView* _tmp13_;
	DocumentsPanel* _tmp14_;
	DocumentTab* _tmp15_;
	GtkContainer* parent = NULL;
	DocumentView* _tmp16_;
	GtkContainer* _tmp17_;
	GtkContainer* _tmp18_;
	GtkContainer* _tmp19_;
	MainWindow* _tmp22_;
	DocumentView* _tmp23_;
#line 280 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (self != NULL);
#line 282 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp0_ = self->priv->_main_window;
#line 282 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp1_ = main_window_get_active_tab (_tmp0_);
#line 282 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp2_ = _tmp1_;
#line 282 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp3_ = _g_object_ref0 (_tmp2_);
#line 282 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	tab = _tmp3_;
#line 283 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp4_ = tab;
#line 283 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (_tmp4_ != NULL);
#line 284 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp5_ = self->priv->_documents_panel;
#line 284 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (_tmp5_ != NULL);
#line 286 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp6_ = glatex_app_get_instance ();
#line 286 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp7_ = _tmp6_;
#line 286 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp8_ = glatex_app_create_window (_tmp7_);
#line 286 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp9_ = _tmp8_;
#line 286 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_g_object_unref0 (_tmp7_);
#line 286 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	new_window = _tmp9_;
#line 287 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp10_ = tab;
#line 287 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp11_ = document_tab_get_document_view (_tmp10_);
#line 287 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp12_ = _tmp11_;
#line 287 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp13_ = _g_object_ref0 (_tmp12_);
#line 287 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	view = _tmp13_;
#line 288 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp14_ = self->priv->_documents_panel;
#line 288 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp15_ = tab;
#line 288 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	documents_panel_remove_tab (_tmp14_, _tmp15_);
#line 290 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp16_ = view;
#line 290 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp17_ = gtk_widget_get_parent ((GtkWidget*) _tmp16_);
#line 290 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp18_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, gtk_container_get_type (), GtkContainer));
#line 290 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	parent = _tmp18_;
#line 291 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp19_ = parent;
#line 291 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	if (_tmp19_ != NULL) {
#line 1717 "main_window_documents.c"
		GtkContainer* _tmp20_;
		DocumentView* _tmp21_;
#line 292 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		_tmp20_ = parent;
#line 292 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		_tmp21_ = view;
#line 292 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		gtk_container_remove (_tmp20_, (GtkWidget*) _tmp21_);
#line 1726 "main_window_documents.c"
	}
#line 294 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp22_ = new_window;
#line 294 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_tmp23_ = view;
#line 294 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	main_window_create_tab_with_view (_tmp22_, _tmp23_);
#line 280 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_g_object_unref0 (parent);
#line 280 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_g_object_unref0 (view);
#line 280 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_g_object_unref0 (new_window);
#line 280 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_g_object_unref0 (tab);
#line 1742 "main_window_documents.c"
}


static void
value_main_window_documents_init (GValue* value)
{
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	value->data[0].v_pointer = NULL;
#line 1751 "main_window_documents.c"
}


static void
value_main_window_documents_free_value (GValue* value)
{
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	if (value->data[0].v_pointer) {
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		main_window_documents_unref (value->data[0].v_pointer);
#line 1762 "main_window_documents.c"
	}
}


static void
value_main_window_documents_copy_value (const GValue* src_value,
                                        GValue* dest_value)
{
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	if (src_value->data[0].v_pointer) {
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		dest_value->data[0].v_pointer = main_window_documents_ref (src_value->data[0].v_pointer);
#line 1775 "main_window_documents.c"
	} else {
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		dest_value->data[0].v_pointer = NULL;
#line 1779 "main_window_documents.c"
	}
}


static gpointer
value_main_window_documents_peek_pointer (const GValue* value)
{
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	return value->data[0].v_pointer;
#line 1789 "main_window_documents.c"
}


static gchar*
value_main_window_documents_collect_value (GValue* value,
                                           guint n_collect_values,
                                           GTypeCValue* collect_values,
                                           guint collect_flags)
{
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	if (collect_values[0].v_pointer) {
#line 1801 "main_window_documents.c"
		MainWindowDocuments * object;
		object = collect_values[0].v_pointer;
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		if (object->parent_instance.g_class == NULL) {
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 1808 "main_window_documents.c"
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 1812 "main_window_documents.c"
		}
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		value->data[0].v_pointer = main_window_documents_ref (object);
#line 1816 "main_window_documents.c"
	} else {
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		value->data[0].v_pointer = NULL;
#line 1820 "main_window_documents.c"
	}
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	return NULL;
#line 1824 "main_window_documents.c"
}


static gchar*
value_main_window_documents_lcopy_value (const GValue* value,
                                         guint n_collect_values,
                                         GTypeCValue* collect_values,
                                         guint collect_flags)
{
	MainWindowDocuments ** object_p;
	object_p = collect_values[0].v_pointer;
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	if (!object_p) {
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
#line 1840 "main_window_documents.c"
	}
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	if (!value->data[0].v_pointer) {
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		*object_p = NULL;
#line 1846 "main_window_documents.c"
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		*object_p = value->data[0].v_pointer;
#line 1850 "main_window_documents.c"
	} else {
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		*object_p = main_window_documents_ref (value->data[0].v_pointer);
#line 1854 "main_window_documents.c"
	}
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	return NULL;
#line 1858 "main_window_documents.c"
}


GParamSpec*
param_spec_main_window_documents (const gchar* name,
                                  const gchar* nick,
                                  const gchar* blurb,
                                  GType object_type,
                                  GParamFlags flags)
{
	ParamSpecMainWindowDocuments* spec;
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_val_if_fail (g_type_is_a (object_type, TYPE_MAIN_WINDOW_DOCUMENTS), NULL);
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	G_PARAM_SPEC (spec)->value_type = object_type;
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	return G_PARAM_SPEC (spec);
#line 1878 "main_window_documents.c"
}


gpointer
value_get_main_window_documents (const GValue* value)
{
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_MAIN_WINDOW_DOCUMENTS), NULL);
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	return value->data[0].v_pointer;
#line 1889 "main_window_documents.c"
}


void
value_set_main_window_documents (GValue* value,
                                 gpointer v_object)
{
	MainWindowDocuments * old;
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_MAIN_WINDOW_DOCUMENTS));
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	old = value->data[0].v_pointer;
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	if (v_object) {
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_MAIN_WINDOW_DOCUMENTS));
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		value->data[0].v_pointer = v_object;
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		main_window_documents_ref (value->data[0].v_pointer);
#line 1912 "main_window_documents.c"
	} else {
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		value->data[0].v_pointer = NULL;
#line 1916 "main_window_documents.c"
	}
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	if (old) {
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		main_window_documents_unref (old);
#line 1922 "main_window_documents.c"
	}
}


void
value_take_main_window_documents (GValue* value,
                                  gpointer v_object)
{
	MainWindowDocuments * old;
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_MAIN_WINDOW_DOCUMENTS));
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	old = value->data[0].v_pointer;
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	if (v_object) {
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_MAIN_WINDOW_DOCUMENTS));
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		value->data[0].v_pointer = v_object;
#line 1944 "main_window_documents.c"
	} else {
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		value->data[0].v_pointer = NULL;
#line 1948 "main_window_documents.c"
	}
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	if (old) {
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		main_window_documents_unref (old);
#line 1954 "main_window_documents.c"
	}
}


static void
main_window_documents_class_init (MainWindowDocumentsClass * klass)
{
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	main_window_documents_parent_class = g_type_class_peek_parent (klass);
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	((MainWindowDocumentsClass *) klass)->finalize = main_window_documents_finalize;
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_type_class_add_private (klass, sizeof (MainWindowDocumentsPrivate));
#line 1968 "main_window_documents.c"
}


static void
main_window_documents_instance_init (MainWindowDocuments * self)
{
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	self->priv = MAIN_WINDOW_DOCUMENTS_GET_PRIVATE (self);
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	self->ref_count = 1;
#line 1979 "main_window_documents.c"
}


static void
main_window_documents_finalize (MainWindowDocuments * obj)
{
	MainWindowDocuments * self;
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_MAIN_WINDOW_DOCUMENTS, MainWindowDocuments);
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_signal_handlers_destroy (self);
#line 49 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_g_object_unref0 (self->priv->_ui_manager);
#line 50 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_g_object_unref0 (self->priv->_documents_panel);
#line 52 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_g_object_unref0 (self->priv->_static_action_group);
#line 55 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	_g_object_unref0 (self->priv->_list_action_group);
#line 1999 "main_window_documents.c"
}


GType
main_window_documents_get_type (void)
{
	static volatile gsize main_window_documents_type_id__volatile = 0;
	if (g_once_init_enter (&main_window_documents_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { value_main_window_documents_init, value_main_window_documents_free_value, value_main_window_documents_copy_value, value_main_window_documents_peek_pointer, "p", value_main_window_documents_collect_value, "p", value_main_window_documents_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (MainWindowDocumentsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) main_window_documents_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MainWindowDocuments), 0, (GInstanceInitFunc) main_window_documents_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType main_window_documents_type_id;
		main_window_documents_type_id = g_type_register_fundamental (g_type_fundamental_next (), "MainWindowDocuments", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&main_window_documents_type_id__volatile, main_window_documents_type_id);
	}
	return main_window_documents_type_id__volatile;
}


gpointer
main_window_documents_ref (gpointer instance)
{
	MainWindowDocuments * self;
	self = instance;
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	g_atomic_int_inc (&self->ref_count);
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	return instance;
#line 2028 "main_window_documents.c"
}


void
main_window_documents_unref (gpointer instance)
{
	MainWindowDocuments * self;
	self = instance;
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		MAIN_WINDOW_DOCUMENTS_GET_CLASS (self)->finalize (self);
#line 26 "/home/seb/gnome/gnome-latex/src/main_window_documents.vala"
		g_type_free_instance ((GTypeInstance *) self);
#line 2043 "main_window_documents.c"
	}
}


static void
_vala_array_destroy (gpointer array,
                     gint array_length,
                     GDestroyNotify destroy_func)
{
#line 27 "/home/seb/gnome/gnome-latex/src/build_tools_preferences.vala"
	if ((array != NULL) && (destroy_func != NULL)) {
#line 2055 "main_window_documents.c"
		int i;
#line 27 "/home/seb/gnome/gnome-latex/src/build_tools_preferences.vala"
		for (i = 0; i < array_length; i = i + 1) {
#line 27 "/home/seb/gnome/gnome-latex/src/build_tools_preferences.vala"
			if (((gpointer*) array)[i] != NULL) {
#line 27 "/home/seb/gnome/gnome-latex/src/build_tools_preferences.vala"
				destroy_func (((gpointer*) array)[i]);
#line 2063 "main_window_documents.c"
			}
		}
	}
}


static void
_vala_array_free (gpointer array,
                  gint array_length,
                  GDestroyNotify destroy_func)
{
#line 27 "/home/seb/gnome/gnome-latex/src/build_tools_preferences.vala"
	_vala_array_destroy (array, array_length, destroy_func);
#line 27 "/home/seb/gnome/gnome-latex/src/build_tools_preferences.vala"
	g_free (array);
#line 2079 "main_window_documents.c"
}



