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

/*
 * This file is part of GNOME LaTeX.
 *
 * Copyright © 2010-2012 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/>.
 *
 * Authors: Sébastien Wilmet
 *          Pieter Pareit
 */


#include <glib.h>
#include <glib-object.h>
#include <gtksourceview/gtksource.h>
#include <gio/gio.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gtk/gtk.h>
#include <latexila.h>
#include <glib/gi18n-lib.h>
#include <tepl/tepl.h>
#include "config.h"


#define TYPE_COMPLETION_PROVIDER (completion_provider_get_type ())
#define COMPLETION_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_COMPLETION_PROVIDER, CompletionProvider))
#define COMPLETION_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_COMPLETION_PROVIDER, CompletionProviderClass))
#define IS_COMPLETION_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_COMPLETION_PROVIDER))
#define IS_COMPLETION_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_COMPLETION_PROVIDER))
#define COMPLETION_PROVIDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_COMPLETION_PROVIDER, CompletionProviderClass))

typedef struct _CompletionProvider CompletionProvider;
typedef struct _CompletionProviderClass CompletionProviderClass;
typedef struct _CompletionProviderPrivate CompletionProviderPrivate;

#define COMPLETION_PROVIDER_TYPE_COMPLETION_COMMAND (completion_provider_completion_command_get_type ())

#define COMPLETION_PROVIDER_TYPE_COMPLETION_ARGUMENT (completion_provider_completion_argument_get_type ())

#define COMPLETION_PROVIDER_TYPE_COMPLETION_CHOICE (completion_provider_completion_choice_get_type ())
typedef struct _CompletionProviderCompletionChoice CompletionProviderCompletionChoice;
typedef struct _CompletionProviderCompletionArgument CompletionProviderCompletionArgument;
typedef struct _CompletionProviderCompletionCommand CompletionProviderCompletionCommand;
enum  {
	COMPLETION_PROVIDER_0_PROPERTY,
	COMPLETION_PROVIDER_NUM_PROPERTIES
};
static GParamSpec* completion_provider_properties[COMPLETION_PROVIDER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define COMPLETION_PROVIDER_TYPE_ARGUMENT_CONTEXT (completion_provider_argument_context_get_type ())
typedef struct _CompletionProviderArgumentContext CompletionProviderArgumentContext;
#define _completion_provider_completion_command_free0(var) ((var == NULL) ? NULL : (var = (completion_provider_completion_command_free (var), NULL)))

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

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

#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 _completion_provider_completion_choice_free0(var) ((var == NULL) ? NULL : (var = (completion_provider_completion_choice_free (var), NULL)))
#define _g_markup_parse_context_unref0(var) ((var == NULL) ? NULL : (var = (g_markup_parse_context_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

struct _CompletionProvider {
	GObject parent_instance;
	CompletionProviderPrivate * priv;
};

struct _CompletionProviderClass {
	GObjectClass parent_class;
};

struct _CompletionProviderCompletionChoice {
	gchar* name;
	gchar* package;
	gchar* insert;
	gchar* insert_after;
};

struct _CompletionProviderCompletionArgument {
	gchar* label;
	gboolean optional;
	CompletionProviderCompletionChoice* choices;
	gint choices_length1;
	gint _choices_size_;
};

struct _CompletionProviderCompletionCommand {
	gchar* name;
	gchar* package;
	CompletionProviderCompletionArgument* args;
	gint args_length1;
	gint _args_size_;
};

struct _CompletionProviderPrivate {
	GSettings* _settings;
	GList* _proposals;
	GeeHashMap* _commands;
	GeeHashMap* _environments;
	CompletionProviderCompletionCommand _current_command;
	CompletionProviderCompletionArgument _current_arg;
	CompletionProviderCompletionChoice _current_choice;
	GdkPixbuf* _icon_cmd;
	GdkPixbuf* _icon_choice;
	GdkPixbuf* _icon_package_required;
	GtkSourceCompletionInfo* _calltip_window;
	GtkLabel* _calltip_window_label;
};

struct _CompletionProviderArgumentContext {
	gchar* cmd_name;
	gchar* arg_contents;
	GeeArrayList* args_types;
};

struct _Document {
	TeplBuffer parent_instance;
	DocumentPrivate * priv;
	DocumentTab* tab;
};

struct _DocumentClass {
	TeplBufferClass parent_class;
};


static gpointer completion_provider_parent_class = NULL;
static CompletionProvider* completion_provider__instance;
static CompletionProvider* completion_provider__instance = NULL;
static GtkSourceCompletionProviderIface * completion_provider_gtk_source_completion_provider_parent_iface = NULL;

GType completion_provider_get_type (void) G_GNUC_CONST;
static GType completion_provider_completion_command_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static GType completion_provider_completion_argument_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static GType completion_provider_completion_choice_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static CompletionProviderCompletionChoice* completion_provider_completion_choice_dup (const CompletionProviderCompletionChoice* self);
static void completion_provider_completion_choice_free (CompletionProviderCompletionChoice* self);
static void completion_provider_completion_choice_copy (const CompletionProviderCompletionChoice* self,
                                                 CompletionProviderCompletionChoice* dest);
static void completion_provider_completion_choice_destroy (CompletionProviderCompletionChoice* self);
static CompletionProviderCompletionArgument* completion_provider_completion_argument_dup (const CompletionProviderCompletionArgument* self);
static void completion_provider_completion_argument_free (CompletionProviderCompletionArgument* self);
static void completion_provider_completion_argument_copy (const CompletionProviderCompletionArgument* self,
                                                   CompletionProviderCompletionArgument* dest);
static void completion_provider_completion_argument_destroy (CompletionProviderCompletionArgument* self);
static CompletionProviderCompletionCommand* completion_provider_completion_command_dup (const CompletionProviderCompletionCommand* self);
static void completion_provider_completion_command_free (CompletionProviderCompletionCommand* self);
static void completion_provider_completion_command_copy (const CompletionProviderCompletionCommand* self,
                                                  CompletionProviderCompletionCommand* dest);
static void completion_provider_completion_command_destroy (CompletionProviderCompletionCommand* self);
#define COMPLETION_PROVIDER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_COMPLETION_PROVIDER, CompletionProviderPrivate))
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
static CompletionProvider* completion_provider_new (void);
static CompletionProvider* completion_provider_construct (GType object_type);
static void completion_provider_load_data (CompletionProvider* self);
CompletionProvider* completion_provider_get_default (void);
static gchar* completion_provider_real_get_name (GtkSourceCompletionProvider* base);
static GtkSourceCompletionActivation completion_provider_real_get_activation (GtkSourceCompletionProvider* base);
static gboolean completion_provider_real_match (GtkSourceCompletionProvider* base,
                                         GtkSourceCompletionContext* context);
static gboolean completion_provider_real_get_start_iter (GtkSourceCompletionProvider* base,
                                                  GtkSourceCompletionContext* context,
                                                  GtkSourceCompletionProposal* proposal,
                                                  GtkTextIter* iter);
static gchar* completion_provider_get_latex_command_at_iter (CompletionProvider* self,
                                                      GtkTextIter* iter);
static void completion_provider_real_populate (GtkSourceCompletionProvider* base,
                                        GtkSourceCompletionContext* context);
static void completion_provider_show_no_proposals (CompletionProvider* self,
                                            GtkSourceCompletionContext* context);
static void completion_provider_populate_command (CompletionProvider* self,
                                           GtkSourceCompletionContext* context,
                                           const gchar* cmd);
static GType completion_provider_argument_context_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static CompletionProviderArgumentContext* completion_provider_argument_context_dup (const CompletionProviderArgumentContext* self);
static void completion_provider_argument_context_free (CompletionProviderArgumentContext* self);
static void completion_provider_argument_context_copy (const CompletionProviderArgumentContext* self,
                                                CompletionProviderArgumentContext* dest);
static void completion_provider_argument_context_destroy (CompletionProviderArgumentContext* self);
static gboolean completion_provider_in_latex_command_argument (CompletionProvider* self,
                                                        GtkTextIter* iter,
                                                        CompletionProviderArgumentContext* info);
static void completion_provider_populate_argument (CompletionProvider* self,
                                            GtkSourceCompletionContext* context,
                                            CompletionProviderArgumentContext* info);
static gboolean completion_provider_is_user_request (CompletionProvider* self,
                                              GtkSourceCompletionContext* context);
static void completion_provider_show_all_proposals (CompletionProvider* self,
                                             GtkSourceCompletionContext* context);
static void completion_provider_show_filtered_proposals (CompletionProvider* self,
                                                  GtkSourceCompletionContext* context,
                                                  GList* proposals_to_filter,
                                                  const gchar* prefix);
static GList* completion_provider_get_argument_proposals (CompletionProvider* self,
                                                   CompletionProviderArgumentContext* arg_context);
static void completion_provider_show_calltip_cmd_prototype (CompletionProvider* self,
                                                     const gchar* arg_cmd,
                                                     GeeArrayList* arguments);
static gchar* completion_provider_get_command_info (CompletionProvider* self,
                                             CompletionProviderCompletionCommand* cmd,
                                             gint cur_arg);
static gint completion_provider_get_argument_num (CompletionProvider* self,
                                           CompletionProviderCompletionArgument* all_args,
                                           int all_args_length1,
                                           GeeArrayList* args);
static gint completion_provider_compare_proposals (GtkSourceCompletionItem* a,
                                            GtkSourceCompletionItem* b);
static void completion_provider_init_calltip_window (CompletionProvider* self);
static void completion_provider_show_calltip_info (CompletionProvider* self,
                                            const gchar* markup);
GType main_window_get_type (void) G_GNUC_CONST;
GType glatex_app_get_type (void) G_GNUC_CONST;
GlatexApp* glatex_app_get_instance (void);
MainWindow* glatex_app_get_active_main_window (GlatexApp* self);
GType document_view_get_type (void) G_GNUC_CONST;
DocumentView* main_window_get_active_view (MainWindow* self);
static void completion_provider_get_begin_arg_pos (CompletionProvider* self,
                                            GtkTextIter* in_arg_pos,
                                            GtkTextIter* result);
void completion_provider_hide_calltip_window (CompletionProvider* self);
static gboolean completion_provider_real_activate_proposal (GtkSourceCompletionProvider* base,
                                                     GtkSourceCompletionProposal* proposal,
                                                     GtkTextIter* iter);
static void completion_provider_activate_proposal_command_name (CompletionProvider* self,
                                                         GtkSourceCompletionProposal* proposal,
                                                         GtkTextIter* iter,
                                                         const gchar* cmd);
static void completion_provider_activate_proposal_argument_choice (CompletionProvider* self,
                                                            GtkSourceCompletionProposal* proposal,
                                                            GtkTextIter* iter,
                                                            const gchar* arg_cmd,
                                                            const gchar* arg_contents);
static void completion_provider_close_environment (CompletionProvider* self,
                                            const gchar* env_name,
                                            GtkTextIter* iter);
GType document_get_type (void) G_GNUC_CONST;
GType document_tab_get_type (void) G_GNUC_CONST;
DocumentView* document_tab_get_document_view (DocumentTab* self);
void document_insert (Document* self,
                      GtkTextIter* iter,
                      const gchar* text,
                      gint len);
static gchar* completion_provider_get_text_line_to_iter (CompletionProvider* self,
                                                  GtkTextIter* iter);
gboolean utils_char_is_escaped (const gchar* text,
                                glong char_index);
static gchar* completion_provider_get_latex_command_at_index (CompletionProvider* self,
                                                       const gchar* text,
                                                       gint index);
static gchar* completion_provider_get_command_text_to_insert (CompletionProvider* self,
                                                       CompletionProviderCompletionCommand* cmd);
gchar* utils_load_file (GFile* file);
static void completion_provider_parser_start (CompletionProvider* self,
                                       GMarkupParseContext* context,
                                       const gchar* name,
                                       gchar** attr_names,
                                       int attr_names_length1,
                                       gchar** attr_values,
                                       int attr_values_length1,
                                       GError** error);
static void _completion_provider_parser_start_gmarkup_parser_start_element_func (GMarkupParseContext* context,
                                                                          const gchar* element_name,
                                                                          gchar** attribute_names,
                                                                          gchar** attribute_values,
                                                                          gpointer self,
                                                                          GError** error);
static void completion_provider_parser_end (CompletionProvider* self,
                                     GMarkupParseContext* context,
                                     const gchar* name,
                                     GError** error);
static void _completion_provider_parser_end_gmarkup_parser_end_element_func (GMarkupParseContext* context,
                                                                      const gchar* element_name,
                                                                      gpointer self,
                                                                      GError** error);
static void completion_provider_parser_text (CompletionProvider* self,
                                      GMarkupParseContext* context,
                                      const gchar* text,
                                      gsize text_len,
                                      GError** error);
static void _completion_provider_parser_text_gmarkup_parser_text_func (GMarkupParseContext* context,
                                                                const gchar* text,
                                                                gsize text_len,
                                                                gpointer self,
                                                                GError** error);
static void completion_provider_parser_add_command (CompletionProvider* self,
                                             gchar** attr_names,
                                             int attr_names_length1,
                                             gchar** attr_values,
                                             int attr_values_length1,
                                             GError** error);
static void completion_provider_parser_add_argument (CompletionProvider* self,
                                              gchar** attr_names,
                                              int attr_names_length1,
                                              gchar** attr_values,
                                              int attr_values_length1,
                                              GError** error);
static void completion_provider_parser_add_choice (CompletionProvider* self,
                                            gchar** attr_names,
                                            int attr_names_length1,
                                            gchar** attr_values,
                                            int attr_values_length1,
                                            GError** error);
static void _vala_array_add2 (CompletionProviderCompletionArgument* * array,
                       int* length,
                       int* size,
                       const CompletionProviderCompletionArgument* value);
static void _vala_array_add3 (CompletionProviderCompletionChoice* * array,
                       int* length,
                       int* size,
                       const CompletionProviderCompletionChoice* value);
static void _vala_CompletionProviderCompletionArgument_array_free (CompletionProviderCompletionArgument * array,
                                                            gint array_length);
static CompletionProviderCompletionArgument* _vala_array_dup1 (CompletionProviderCompletionArgument* self,
                                                        int length);
static void _vala_CompletionProviderCompletionChoice_array_free (CompletionProviderCompletionChoice * array,
                                                          gint array_length);
static CompletionProviderCompletionChoice* _vala_array_dup2 (CompletionProviderCompletionChoice* self,
                                                      int length);
static void completion_provider_finalize (GObject * obj);
static gint _vala_array_length (gpointer array);


static void
_g_object_unref0_ (gpointer var)
{
#line 64 "/home/seb/gnome/gnome-latex/src/completion.vala"
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
#line 394 "completion.c"
}


static inline void
_g_list_free__g_object_unref0_ (GList* self)
{
#line 64 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_list_free_full (self, (GDestroyNotify) _g_object_unref0_);
#line 403 "completion.c"
}


static CompletionProvider*
completion_provider_construct (GType object_type)
{
	CompletionProvider * self = NULL;
	GSettings* _tmp0_;
	GdkPixbuf* _tmp1_;
	GdkPixbuf* _tmp2_;
	GdkPixbuf* _tmp3_;
#line 82 "/home/seb/gnome/gnome-latex/src/completion.vala"
	self = (CompletionProvider*) g_object_new (object_type, NULL);
#line 84 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp0_ = g_settings_new ("org.gnome.gnome-latex.preferences.latex");
#line 84 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_object_unref0 (self->priv->_settings);
#line 84 "/home/seb/gnome/gnome-latex/src/completion.vala"
	self->priv->_settings = _tmp0_;
#line 87 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp1_ = latexila_utils_get_pixbuf_from_icon_name ("completion_cmd", GTK_ICON_SIZE_MENU);
#line 87 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_object_unref0 (self->priv->_icon_cmd);
#line 87 "/home/seb/gnome/gnome-latex/src/completion.vala"
	self->priv->_icon_cmd = _tmp1_;
#line 89 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp2_ = latexila_utils_get_pixbuf_from_icon_name ("gray-square", GTK_ICON_SIZE_MENU);
#line 89 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_object_unref0 (self->priv->_icon_choice);
#line 89 "/home/seb/gnome/gnome-latex/src/completion.vala"
	self->priv->_icon_choice = _tmp2_;
#line 91 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp3_ = latexila_utils_get_pixbuf_from_icon_name ("dialog-warning", GTK_ICON_SIZE_MENU);
#line 91 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_object_unref0 (self->priv->_icon_package_required);
#line 91 "/home/seb/gnome/gnome-latex/src/completion.vala"
	self->priv->_icon_package_required = _tmp3_;
#line 94 "/home/seb/gnome/gnome-latex/src/completion.vala"
	completion_provider_load_data (self);
#line 82 "/home/seb/gnome/gnome-latex/src/completion.vala"
	return self;
#line 445 "completion.c"
}


static CompletionProvider*
completion_provider_new (void)
{
#line 82 "/home/seb/gnome/gnome-latex/src/completion.vala"
	return completion_provider_construct (TYPE_COMPLETION_PROVIDER);
#line 454 "completion.c"
}


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


CompletionProvider*
completion_provider_get_default (void)
{
	CompletionProvider* result = NULL;
	CompletionProvider* _tmp0_;
	CompletionProvider* _tmp2_;
	CompletionProvider* _tmp3_;
#line 99 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp0_ = completion_provider__instance;
#line 99 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (_tmp0_ == NULL) {
#line 478 "completion.c"
		CompletionProvider* _tmp1_;
#line 100 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp1_ = completion_provider_new ();
#line 100 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_g_object_unref0 (completion_provider__instance);
#line 100 "/home/seb/gnome/gnome-latex/src/completion.vala"
		completion_provider__instance = _tmp1_;
#line 486 "completion.c"
	}
#line 102 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp2_ = completion_provider__instance;
#line 102 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp3_ = _g_object_ref0 (_tmp2_);
#line 102 "/home/seb/gnome/gnome-latex/src/completion.vala"
	result = _tmp3_;
#line 102 "/home/seb/gnome/gnome-latex/src/completion.vala"
	return result;
#line 496 "completion.c"
}


static gchar*
completion_provider_real_get_name (GtkSourceCompletionProvider* base)
{
	CompletionProvider * self;
	gchar* result = NULL;
	gchar* _tmp0_;
#line 105 "/home/seb/gnome/gnome-latex/src/completion.vala"
	self = (CompletionProvider*) base;
#line 107 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp0_ = g_strdup ("LaTeX");
#line 107 "/home/seb/gnome/gnome-latex/src/completion.vala"
	result = _tmp0_;
#line 107 "/home/seb/gnome/gnome-latex/src/completion.vala"
	return result;
#line 514 "completion.c"
}


static GtkSourceCompletionActivation
completion_provider_real_get_activation (GtkSourceCompletionProvider* base)
{
	CompletionProvider * self;
	GtkSourceCompletionActivation result = 0;
	GtkSourceCompletionActivation activation = 0;
	GSettings* _tmp0_;
#line 110 "/home/seb/gnome/gnome-latex/src/completion.vala"
	self = (CompletionProvider*) base;
#line 112 "/home/seb/gnome/gnome-latex/src/completion.vala"
	activation = GTK_SOURCE_COMPLETION_ACTIVATION_USER_REQUESTED;
#line 114 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp0_ = self->priv->_settings;
#line 114 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (g_settings_get_boolean (_tmp0_, "interactive-completion")) {
#line 533 "completion.c"
		GtkSourceCompletionActivation _tmp1_;
#line 115 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp1_ = activation;
#line 115 "/home/seb/gnome/gnome-latex/src/completion.vala"
		activation = _tmp1_ | GTK_SOURCE_COMPLETION_ACTIVATION_INTERACTIVE;
#line 539 "completion.c"
	}
#line 117 "/home/seb/gnome/gnome-latex/src/completion.vala"
	result = activation;
#line 117 "/home/seb/gnome/gnome-latex/src/completion.vala"
	return result;
#line 545 "completion.c"
}


static gboolean
completion_provider_real_match (GtkSourceCompletionProvider* base,
                                GtkSourceCompletionContext* context)
{
	CompletionProvider * self;
	gboolean result = FALSE;
	GtkTextIter iter = {0};
	GtkTextIter _tmp0_ = {0};
	gboolean _tmp1_;
	GtkTextBuffer* buf = NULL;
	GtkTextBuffer* _tmp2_;
	GtkTextBuffer* _tmp3_;
	GtkTextBuffer* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
#line 120 "/home/seb/gnome/gnome-latex/src/completion.vala"
	self = (CompletionProvider*) base;
#line 120 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_val_if_fail (context != NULL, FALSE);
#line 124 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp1_ = gtk_source_completion_context_get_iter (context, &_tmp0_);
#line 124 "/home/seb/gnome/gnome-latex/src/completion.vala"
	iter = _tmp0_;
#line 124 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (!_tmp1_) {
#line 125 "/home/seb/gnome/gnome-latex/src/completion.vala"
		result = FALSE;
#line 125 "/home/seb/gnome/gnome-latex/src/completion.vala"
		return result;
#line 578 "completion.c"
	}
#line 128 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp2_ = gtk_text_iter_get_buffer (&iter);
#line 128 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp3_ = _g_object_ref0 (_tmp2_);
#line 128 "/home/seb/gnome/gnome-latex/src/completion.vala"
	buf = _tmp3_;
#line 129 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp4_ = buf;
#line 129 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp5_ = gtk_text_buffer_get_has_selection (_tmp4_);
#line 129 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp6_ = _tmp5_;
#line 129 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (_tmp6_) {
#line 130 "/home/seb/gnome/gnome-latex/src/completion.vala"
		result = FALSE;
#line 130 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_g_object_unref0 (buf);
#line 130 "/home/seb/gnome/gnome-latex/src/completion.vala"
		return result;
#line 600 "completion.c"
	}
#line 132 "/home/seb/gnome/gnome-latex/src/completion.vala"
	result = TRUE;
#line 132 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_object_unref0 (buf);
#line 132 "/home/seb/gnome/gnome-latex/src/completion.vala"
	return result;
#line 608 "completion.c"
}


static gboolean
completion_provider_real_get_start_iter (GtkSourceCompletionProvider* base,
                                         GtkSourceCompletionContext* context,
                                         GtkSourceCompletionProposal* proposal,
                                         GtkTextIter* iter)
{
	CompletionProvider * self;
	GtkTextIter _vala_iter = {0};
	gboolean result = FALSE;
	GtkTextIter _tmp0_ = {0};
	gchar* cmd = NULL;
	GtkTextIter* _tmp1_;
	GtkTextIter* _tmp2_;
	GtkTextIter _tmp3_;
	gchar* _tmp4_;
	const gchar* _tmp5_;
	GtkTextIter* _tmp6_;
	GtkTextIter* _tmp7_;
	GtkTextIter prev = {0};
	GtkTextIter _tmp8_;
	gboolean _tmp9_ = FALSE;
	GtkTextIter _tmp11_;
	gboolean _tmp12_ = FALSE;
#line 135 "/home/seb/gnome/gnome-latex/src/completion.vala"
	self = (CompletionProvider*) base;
#line 135 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_val_if_fail (context != NULL, FALSE);
#line 135 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_val_if_fail (proposal != NULL, FALSE);
#line 138 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_vala_iter = _tmp0_;
#line 139 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_object_get (context, "iter", &_tmp1_, NULL);
#line 139 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp2_ = _tmp1_;
#line 139 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp3_ = *_tmp2_;
#line 139 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp4_ = completion_provider_get_latex_command_at_iter (self, &_tmp3_);
#line 139 "/home/seb/gnome/gnome-latex/src/completion.vala"
	cmd = _tmp4_;
#line 142 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp5_ = cmd;
#line 142 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (_tmp5_ == NULL) {
#line 143 "/home/seb/gnome/gnome-latex/src/completion.vala"
		result = FALSE;
#line 143 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_g_free0 (cmd);
#line 143 "/home/seb/gnome/gnome-latex/src/completion.vala"
		if (iter) {
#line 143 "/home/seb/gnome/gnome-latex/src/completion.vala"
			*iter = _vala_iter;
#line 665 "completion.c"
		}
#line 143 "/home/seb/gnome/gnome-latex/src/completion.vala"
		return result;
#line 669 "completion.c"
	}
#line 146 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_object_get (context, "iter", &_tmp6_, NULL);
#line 146 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp7_ = _tmp6_;
#line 146 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_vala_iter = *_tmp7_;
#line 148 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp8_ = _vala_iter;
#line 148 "/home/seb/gnome/gnome-latex/src/completion.vala"
	prev = _tmp8_;
#line 149 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (gtk_text_iter_backward_char (&prev)) {
#line 149 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp9_ = gtk_text_iter_get_char (&prev) == ((gunichar) '\\');
#line 685 "completion.c"
	} else {
#line 149 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp9_ = FALSE;
#line 689 "completion.c"
	}
#line 149 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (_tmp9_) {
#line 693 "completion.c"
		GtkTextIter _tmp10_;
#line 151 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp10_ = prev;
#line 151 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_vala_iter = _tmp10_;
#line 152 "/home/seb/gnome/gnome-latex/src/completion.vala"
		result = TRUE;
#line 152 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_g_free0 (cmd);
#line 152 "/home/seb/gnome/gnome-latex/src/completion.vala"
		if (iter) {
#line 152 "/home/seb/gnome/gnome-latex/src/completion.vala"
			*iter = _vala_iter;
#line 707 "completion.c"
		}
#line 152 "/home/seb/gnome/gnome-latex/src/completion.vala"
		return result;
#line 711 "completion.c"
	}
#line 155 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (!gtk_text_iter_starts_word (&_vala_iter)) {
#line 156 "/home/seb/gnome/gnome-latex/src/completion.vala"
		gtk_text_iter_backward_visible_word_start (&_vala_iter);
#line 717 "completion.c"
	}
#line 158 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp11_ = _vala_iter;
#line 158 "/home/seb/gnome/gnome-latex/src/completion.vala"
	prev = _tmp11_;
#line 159 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (gtk_text_iter_backward_char (&prev)) {
#line 159 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp12_ = gtk_text_iter_get_char (&prev) == ((gunichar) '\\');
#line 727 "completion.c"
	} else {
#line 159 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp12_ = FALSE;
#line 731 "completion.c"
	}
#line 159 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (_tmp12_) {
#line 735 "completion.c"
		GtkTextIter _tmp13_;
#line 160 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp13_ = prev;
#line 160 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_vala_iter = _tmp13_;
#line 741 "completion.c"
	}
#line 162 "/home/seb/gnome/gnome-latex/src/completion.vala"
	result = TRUE;
#line 162 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 (cmd);
#line 162 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (iter) {
#line 162 "/home/seb/gnome/gnome-latex/src/completion.vala"
		*iter = _vala_iter;
#line 751 "completion.c"
	}
#line 162 "/home/seb/gnome/gnome-latex/src/completion.vala"
	return result;
#line 755 "completion.c"
}


/*************************************************************************/
static void
completion_provider_real_populate (GtkSourceCompletionProvider* base,
                                   GtkSourceCompletionContext* context)
{
	CompletionProvider * self;
	GtkTextIter iter = {0};
	GtkTextIter _tmp0_ = {0};
	gboolean _tmp1_;
	gchar* cmd = NULL;
	GtkTextIter _tmp2_;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	CompletionProviderArgumentContext info = {0};
	gboolean in_arg = FALSE;
	GtkTextIter _tmp6_;
	CompletionProviderArgumentContext _tmp7_ = {0};
	gboolean _tmp8_;
	gboolean _tmp9_;
#line 168 "/home/seb/gnome/gnome-latex/src/completion.vala"
	self = (CompletionProvider*) base;
#line 168 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (context != NULL);
#line 172 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp1_ = gtk_source_completion_context_get_iter (context, &_tmp0_);
#line 172 "/home/seb/gnome/gnome-latex/src/completion.vala"
	iter = _tmp0_;
#line 172 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (!_tmp1_) {
#line 174 "/home/seb/gnome/gnome-latex/src/completion.vala"
		completion_provider_show_no_proposals (self, context);
#line 175 "/home/seb/gnome/gnome-latex/src/completion.vala"
		return;
#line 792 "completion.c"
	}
#line 179 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp2_ = iter;
#line 179 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp3_ = completion_provider_get_latex_command_at_iter (self, &_tmp2_);
#line 179 "/home/seb/gnome/gnome-latex/src/completion.vala"
	cmd = _tmp3_;
#line 181 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp4_ = cmd;
#line 181 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (_tmp4_ != NULL) {
#line 804 "completion.c"
		const gchar* _tmp5_;
#line 183 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp5_ = cmd;
#line 183 "/home/seb/gnome/gnome-latex/src/completion.vala"
		completion_provider_populate_command (self, context, _tmp5_);
#line 184 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_g_free0 (cmd);
#line 184 "/home/seb/gnome/gnome-latex/src/completion.vala"
		return;
#line 814 "completion.c"
	}
#line 189 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp6_ = iter;
#line 189 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp8_ = completion_provider_in_latex_command_argument (self, &_tmp6_, &_tmp7_);
#line 189 "/home/seb/gnome/gnome-latex/src/completion.vala"
	completion_provider_argument_context_destroy (&info);
#line 189 "/home/seb/gnome/gnome-latex/src/completion.vala"
	info = _tmp7_;
#line 189 "/home/seb/gnome/gnome-latex/src/completion.vala"
	in_arg = _tmp8_;
#line 191 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp9_ = in_arg;
#line 191 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (_tmp9_) {
#line 830 "completion.c"
		CompletionProviderArgumentContext _tmp10_;
#line 193 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp10_ = info;
#line 193 "/home/seb/gnome/gnome-latex/src/completion.vala"
		completion_provider_populate_argument (self, context, &_tmp10_);
#line 194 "/home/seb/gnome/gnome-latex/src/completion.vala"
		completion_provider_argument_context_destroy (&info);
#line 194 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_g_free0 (cmd);
#line 194 "/home/seb/gnome/gnome-latex/src/completion.vala"
		return;
#line 842 "completion.c"
	}
#line 198 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (completion_provider_is_user_request (self, context)) {
#line 199 "/home/seb/gnome/gnome-latex/src/completion.vala"
		completion_provider_show_all_proposals (self, context);
#line 848 "completion.c"
	} else {
#line 201 "/home/seb/gnome/gnome-latex/src/completion.vala"
		completion_provider_show_no_proposals (self, context);
#line 852 "completion.c"
	}
#line 168 "/home/seb/gnome/gnome-latex/src/completion.vala"
	completion_provider_argument_context_destroy (&info);
#line 168 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 (cmd);
#line 858 "completion.c"
}


static void
completion_provider_populate_command (CompletionProvider* self,
                                      GtkSourceCompletionContext* context,
                                      const gchar* cmd)
{
	GList* _tmp4_;
#line 204 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (self != NULL);
#line 204 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (context != NULL);
#line 204 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (cmd != NULL);
#line 206 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (!completion_provider_is_user_request (self, context)) {
#line 876 "completion.c"
		guint min_nb_chars = 0U;
		GSettings* _tmp0_;
		gint _tmp1_;
		gint _tmp2_;
		guint _tmp3_;
#line 209 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp0_ = self->priv->_settings;
#line 209 "/home/seb/gnome/gnome-latex/src/completion.vala"
		g_settings_get (_tmp0_, "interactive-completion-num", "u", &min_nb_chars);
#line 211 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp1_ = strlen (cmd);
#line 211 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp2_ = _tmp1_;
#line 211 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp3_ = min_nb_chars;
#line 211 "/home/seb/gnome/gnome-latex/src/completion.vala"
		if (((guint) _tmp2_) <= _tmp3_) {
#line 213 "/home/seb/gnome/gnome-latex/src/completion.vala"
			completion_provider_show_no_proposals (self, context);
#line 214 "/home/seb/gnome/gnome-latex/src/completion.vala"
			return;
#line 898 "completion.c"
		}
	}
#line 218 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (g_strcmp0 (cmd, "\\") == 0) {
#line 220 "/home/seb/gnome/gnome-latex/src/completion.vala"
		completion_provider_show_all_proposals (self, context);
#line 221 "/home/seb/gnome/gnome-latex/src/completion.vala"
		return;
#line 907 "completion.c"
	}
#line 224 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp4_ = self->priv->_proposals;
#line 224 "/home/seb/gnome/gnome-latex/src/completion.vala"
	completion_provider_show_filtered_proposals (self, context, _tmp4_, cmd);
#line 913 "completion.c"
}


static void
completion_provider_populate_argument (CompletionProvider* self,
                                       GtkSourceCompletionContext* context,
                                       CompletionProviderArgumentContext* info)
{
	GeeHashMap* _tmp0_;
	CompletionProviderArgumentContext _tmp1_;
	const gchar* _tmp2_;
	GList* proposals_to_filter = NULL;
	CompletionProviderArgumentContext _tmp3_;
	GList* _tmp4_;
	GList* _tmp5_;
	GList* _tmp10_;
	CompletionProviderArgumentContext _tmp11_;
	const gchar* _tmp12_;
#line 227 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (self != NULL);
#line 227 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (context != NULL);
#line 227 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (info != NULL);
#line 230 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp0_ = self->priv->_commands;
#line 230 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp1_ = *info;
#line 230 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp2_ = _tmp1_.cmd_name;
#line 230 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (!gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, _tmp2_)) {
#line 232 "/home/seb/gnome/gnome-latex/src/completion.vala"
		completion_provider_show_no_proposals (self, context);
#line 233 "/home/seb/gnome/gnome-latex/src/completion.vala"
		return;
#line 950 "completion.c"
	}
#line 236 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp3_ = *info;
#line 236 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp4_ = completion_provider_get_argument_proposals (self, &_tmp3_);
#line 236 "/home/seb/gnome/gnome-latex/src/completion.vala"
	proposals_to_filter = _tmp4_;
#line 239 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp5_ = proposals_to_filter;
#line 239 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (_tmp5_ == NULL) {
#line 241 "/home/seb/gnome/gnome-latex/src/completion.vala"
		if (completion_provider_is_user_request (self, context)) {
#line 964 "completion.c"
			CompletionProviderArgumentContext _tmp6_;
			const gchar* _tmp7_;
			CompletionProviderArgumentContext _tmp8_;
			GeeArrayList* _tmp9_;
#line 242 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp6_ = *info;
#line 242 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp7_ = _tmp6_.cmd_name;
#line 242 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp8_ = *info;
#line 242 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp9_ = _tmp8_.args_types;
#line 242 "/home/seb/gnome/gnome-latex/src/completion.vala"
			completion_provider_show_calltip_cmd_prototype (self, _tmp7_, _tmp9_);
#line 979 "completion.c"
		} else {
#line 244 "/home/seb/gnome/gnome-latex/src/completion.vala"
			completion_provider_show_no_proposals (self, context);
#line 983 "completion.c"
		}
#line 245 "/home/seb/gnome/gnome-latex/src/completion.vala"
		return;
#line 987 "completion.c"
	}
#line 248 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp10_ = proposals_to_filter;
#line 248 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp11_ = *info;
#line 248 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp12_ = _tmp11_.arg_contents;
#line 248 "/home/seb/gnome/gnome-latex/src/completion.vala"
	completion_provider_show_filtered_proposals (self, context, _tmp10_, _tmp12_);
#line 997 "completion.c"
}


static GList*
completion_provider_get_argument_proposals (CompletionProvider* self,
                                            CompletionProviderArgumentContext* arg_context)
{
	GList* result = NULL;
	GeeHashMap* _tmp0_;
	CompletionProviderArgumentContext _tmp1_;
	const gchar* _tmp2_;
	CompletionProviderCompletionCommand cmd = {0};
	GeeHashMap* _tmp3_;
	CompletionProviderArgumentContext _tmp4_;
	const gchar* _tmp5_;
	gpointer _tmp6_;
	CompletionProviderCompletionCommand* _tmp7_;
	CompletionProviderCompletionCommand _tmp8_ = {0};
	CompletionProviderCompletionCommand _tmp9_;
	gchar* cmd_info = NULL;
	CompletionProviderCompletionCommand _tmp10_;
	gchar* _tmp11_;
	gint arg_num = 0;
	CompletionProviderCompletionCommand _tmp12_;
	CompletionProviderCompletionArgument* _tmp13_;
	gint _tmp13__length1;
	CompletionProviderArgumentContext _tmp14_;
	GeeArrayList* _tmp15_;
	gint _tmp16_;
	CompletionProviderCompletionArgument arg = {0};
	CompletionProviderCompletionCommand _tmp17_;
	CompletionProviderCompletionArgument* _tmp18_;
	gint _tmp18__length1;
	gint _tmp19_;
	CompletionProviderCompletionArgument _tmp20_;
	CompletionProviderCompletionArgument _tmp21_ = {0};
	GList* items = NULL;
	CompletionProviderCompletionArgument _tmp22_;
	CompletionProviderCompletionChoice* _tmp23_;
	gint _tmp23__length1;
	GList* _tmp52_;
	GList* _tmp53_;
#line 251 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 251 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_val_if_fail (arg_context != NULL, NULL);
#line 254 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp0_ = self->priv->_commands;
#line 254 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp1_ = *arg_context;
#line 254 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp2_ = _tmp1_.cmd_name;
#line 254 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_val_if_fail (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, _tmp2_), NULL);
#line 256 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp3_ = self->priv->_commands;
#line 256 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp4_ = *arg_context;
#line 256 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp5_ = _tmp4_.cmd_name;
#line 256 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp6_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp3_, _tmp5_);
#line 256 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp7_ = (CompletionProviderCompletionCommand*) _tmp6_;
#line 256 "/home/seb/gnome/gnome-latex/src/completion.vala"
	completion_provider_completion_command_copy (_tmp7_, &_tmp8_);
#line 256 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp9_ = _tmp8_;
#line 256 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_completion_provider_completion_command_free0 (_tmp7_);
#line 256 "/home/seb/gnome/gnome-latex/src/completion.vala"
	cmd = _tmp9_;
#line 257 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp10_ = cmd;
#line 257 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp11_ = completion_provider_get_command_info (self, &_tmp10_, -1);
#line 257 "/home/seb/gnome/gnome-latex/src/completion.vala"
	cmd_info = _tmp11_;
#line 259 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp12_ = cmd;
#line 259 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp13_ = _tmp12_.args;
#line 259 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp13__length1 = _tmp12_.args_length1;
#line 259 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp14_ = *arg_context;
#line 259 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp15_ = _tmp14_.args_types;
#line 259 "/home/seb/gnome/gnome-latex/src/completion.vala"
	arg_num = completion_provider_get_argument_num (self, _tmp13_, _tmp13__length1, _tmp15_);
#line 260 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp16_ = arg_num;
#line 260 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (_tmp16_ == -1) {
#line 261 "/home/seb/gnome/gnome-latex/src/completion.vala"
		result = NULL;
#line 261 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_g_free0 (cmd_info);
#line 261 "/home/seb/gnome/gnome-latex/src/completion.vala"
		completion_provider_completion_command_destroy (&cmd);
#line 261 "/home/seb/gnome/gnome-latex/src/completion.vala"
		return result;
#line 1100 "completion.c"
	}
#line 263 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp17_ = cmd;
#line 263 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp18_ = _tmp17_.args;
#line 263 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp18__length1 = _tmp17_.args_length1;
#line 263 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp19_ = arg_num;
#line 263 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp20_ = _tmp18_[_tmp19_ - 1];
#line 263 "/home/seb/gnome/gnome-latex/src/completion.vala"
	completion_provider_completion_argument_copy (&_tmp20_, &_tmp21_);
#line 263 "/home/seb/gnome/gnome-latex/src/completion.vala"
	arg = _tmp21_;
#line 264 "/home/seb/gnome/gnome-latex/src/completion.vala"
	items = NULL;
#line 266 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp22_ = arg;
#line 266 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp23_ = _tmp22_.choices;
#line 266 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp23__length1 = _tmp22_.choices_length1;
#line 1124 "completion.c"
	{
		CompletionProviderCompletionChoice* choice_collection = NULL;
		gint choice_collection_length1 = 0;
		gint _choice_collection_size_ = 0;
		gint choice_it = 0;
#line 266 "/home/seb/gnome/gnome-latex/src/completion.vala"
		choice_collection = _tmp23_;
#line 266 "/home/seb/gnome/gnome-latex/src/completion.vala"
		choice_collection_length1 = _tmp23__length1;
#line 266 "/home/seb/gnome/gnome-latex/src/completion.vala"
		for (choice_it = 0; choice_it < _tmp23__length1; choice_it = choice_it + 1) {
#line 1136 "completion.c"
			CompletionProviderCompletionChoice _tmp24_ = {0};
			CompletionProviderCompletionChoice choice = {0};
#line 266 "/home/seb/gnome/gnome-latex/src/completion.vala"
			completion_provider_completion_choice_copy (&choice_collection[choice_it], &_tmp24_);
#line 266 "/home/seb/gnome/gnome-latex/src/completion.vala"
			choice = _tmp24_;
#line 1143 "completion.c"
			{
				GdkPixbuf* pixbuf = NULL;
				gchar* arg_info = NULL;
				CompletionProviderCompletionChoice _tmp25_;
				const gchar* _tmp26_;
				GtkSourceCompletionItem* item = NULL;
				GtkSourceCompletionItem* _tmp37_;
				GtkSourceCompletionItem* _tmp38_;
				CompletionProviderCompletionChoice _tmp39_;
				const gchar* _tmp40_;
				GtkSourceCompletionItem* _tmp41_;
				CompletionProviderCompletionChoice _tmp42_;
				const gchar* _tmp43_;
				GtkSourceCompletionItem* _tmp44_;
				GdkPixbuf* _tmp45_;
				const gchar* _tmp46_ = NULL;
				const gchar* _tmp47_;
				GtkSourceCompletionItem* _tmp49_;
				GtkSourceCompletionItem* _tmp50_;
				GtkSourceCompletionItem* _tmp51_;
#line 269 "/home/seb/gnome/gnome-latex/src/completion.vala"
				arg_info = NULL;
#line 270 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp25_ = choice;
#line 270 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp26_ = _tmp25_.package;
#line 270 "/home/seb/gnome/gnome-latex/src/completion.vala"
				if (_tmp26_ != NULL) {
#line 1172 "completion.c"
					GdkPixbuf* _tmp27_;
					GdkPixbuf* _tmp28_;
					const gchar* _tmp29_;
					gchar* _tmp30_;
					gchar* _tmp31_;
					CompletionProviderCompletionChoice _tmp32_;
					const gchar* _tmp33_;
					gchar* _tmp34_;
#line 272 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp27_ = self->priv->_icon_package_required;
#line 272 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp28_ = _g_object_ref0 (_tmp27_);
#line 272 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_g_object_unref0 (pixbuf);
#line 272 "/home/seb/gnome/gnome-latex/src/completion.vala"
					pixbuf = _tmp28_;
#line 273 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp29_ = cmd_info;
#line 273 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp30_ = g_strconcat (_tmp29_, "\nPackage: ", NULL);
#line 273 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp31_ = _tmp30_;
#line 273 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp32_ = choice;
#line 273 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp33_ = _tmp32_.package;
#line 273 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp34_ = g_strconcat (_tmp31_, _tmp33_, NULL);
#line 273 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_g_free0 (arg_info);
#line 273 "/home/seb/gnome/gnome-latex/src/completion.vala"
					arg_info = _tmp34_;
#line 273 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_g_free0 (_tmp31_);
#line 1207 "completion.c"
				} else {
					GdkPixbuf* _tmp35_;
					GdkPixbuf* _tmp36_;
#line 276 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp35_ = self->priv->_icon_choice;
#line 276 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp36_ = _g_object_ref0 (_tmp35_);
#line 276 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_g_object_unref0 (pixbuf);
#line 276 "/home/seb/gnome/gnome-latex/src/completion.vala"
					pixbuf = _tmp36_;
#line 1219 "completion.c"
				}
#line 278 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp37_ = gtk_source_completion_item_new ();
#line 278 "/home/seb/gnome/gnome-latex/src/completion.vala"
				item = _tmp37_;
#line 279 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp38_ = item;
#line 279 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp39_ = choice;
#line 279 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp40_ = _tmp39_.name;
#line 279 "/home/seb/gnome/gnome-latex/src/completion.vala"
				gtk_source_completion_item_set_label (_tmp38_, _tmp40_);
#line 280 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp41_ = item;
#line 280 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp42_ = choice;
#line 280 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp43_ = _tmp42_.name;
#line 280 "/home/seb/gnome/gnome-latex/src/completion.vala"
				gtk_source_completion_item_set_text (_tmp41_, _tmp43_);
#line 281 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp44_ = item;
#line 281 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp45_ = pixbuf;
#line 281 "/home/seb/gnome/gnome-latex/src/completion.vala"
				gtk_source_completion_item_set_icon (_tmp44_, _tmp45_);
#line 282 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp47_ = arg_info;
#line 282 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp46_ = _tmp47_;
#line 282 "/home/seb/gnome/gnome-latex/src/completion.vala"
				if (_tmp46_ == NULL) {
#line 1253 "completion.c"
					const gchar* _tmp48_;
#line 282 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp48_ = cmd_info;
#line 282 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp46_ = _tmp48_;
#line 1259 "completion.c"
				}
#line 282 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp49_ = item;
#line 282 "/home/seb/gnome/gnome-latex/src/completion.vala"
				gtk_source_completion_item_set_info (_tmp49_, _tmp46_);
#line 283 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp50_ = item;
#line 283 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp51_ = _g_object_ref0 (_tmp50_);
#line 283 "/home/seb/gnome/gnome-latex/src/completion.vala"
				items = g_list_prepend (items, _tmp51_);
#line 266 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_g_object_unref0 (item);
#line 266 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_g_free0 (arg_info);
#line 266 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_g_object_unref0 (pixbuf);
#line 266 "/home/seb/gnome/gnome-latex/src/completion.vala"
				completion_provider_completion_choice_destroy (&choice);
#line 1279 "completion.c"
			}
		}
	}
#line 286 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp52_ = items;
#line 286 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (_tmp52_ == NULL) {
#line 287 "/home/seb/gnome/gnome-latex/src/completion.vala"
		result = NULL;
#line 287 "/home/seb/gnome/gnome-latex/src/completion.vala"
		completion_provider_completion_argument_destroy (&arg);
#line 287 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_g_free0 (cmd_info);
#line 287 "/home/seb/gnome/gnome-latex/src/completion.vala"
		completion_provider_completion_command_destroy (&cmd);
#line 287 "/home/seb/gnome/gnome-latex/src/completion.vala"
		return result;
#line 1297 "completion.c"
	}
#line 289 "/home/seb/gnome/gnome-latex/src/completion.vala"
	items = g_list_sort (items, (GCompareFunc) completion_provider_compare_proposals);
#line 290 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp53_ = items;
#line 290 "/home/seb/gnome/gnome-latex/src/completion.vala"
	result = _tmp53_;
#line 290 "/home/seb/gnome/gnome-latex/src/completion.vala"
	completion_provider_completion_argument_destroy (&arg);
#line 290 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 (cmd_info);
#line 290 "/home/seb/gnome/gnome-latex/src/completion.vala"
	completion_provider_completion_command_destroy (&cmd);
#line 290 "/home/seb/gnome/gnome-latex/src/completion.vala"
	return result;
#line 1313 "completion.c"
}


static void
completion_provider_show_no_proposals (CompletionProvider* self,
                                       GtkSourceCompletionContext* context)
{
#line 294 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (self != NULL);
#line 294 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (context != NULL);
#line 296 "/home/seb/gnome/gnome-latex/src/completion.vala"
	gtk_source_completion_context_add_proposals (context, G_TYPE_CHECK_INSTANCE_CAST (self, gtk_source_completion_provider_get_type (), GtkSourceCompletionProvider), NULL, TRUE);
#line 1327 "completion.c"
}


static void
completion_provider_show_all_proposals (CompletionProvider* self,
                                        GtkSourceCompletionContext* context)
{
	GList* _tmp0_;
#line 299 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (self != NULL);
#line 299 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (context != NULL);
#line 301 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp0_ = self->priv->_proposals;
#line 301 "/home/seb/gnome/gnome-latex/src/completion.vala"
	gtk_source_completion_context_add_proposals (context, G_TYPE_CHECK_INSTANCE_CAST (self, gtk_source_completion_provider_get_type (), GtkSourceCompletionProvider), _tmp0_, TRUE);
#line 1344 "completion.c"
}


static void
completion_provider_show_filtered_proposals (CompletionProvider* self,
                                             GtkSourceCompletionContext* context,
                                             GList* proposals_to_filter,
                                             const gchar* prefix)
{
	gboolean _tmp0_ = FALSE;
	GList* filtered_proposals = NULL;
	GList* _tmp9_;
	GList* _tmp15_;
#line 304 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (self != NULL);
#line 304 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (context != NULL);
#line 308 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (prefix == NULL) {
#line 308 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp0_ = TRUE;
#line 1366 "completion.c"
	} else {
#line 308 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp0_ = g_strcmp0 (prefix, "") == 0;
#line 1370 "completion.c"
	}
#line 308 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (_tmp0_) {
#line 310 "/home/seb/gnome/gnome-latex/src/completion.vala"
		gtk_source_completion_context_add_proposals (context, G_TYPE_CHECK_INSTANCE_CAST (self, gtk_source_completion_provider_get_type (), GtkSourceCompletionProvider), proposals_to_filter, TRUE);
#line 312 "/home/seb/gnome/gnome-latex/src/completion.vala"
		return;
#line 1378 "completion.c"
	}
#line 318 "/home/seb/gnome/gnome-latex/src/completion.vala"
	filtered_proposals = NULL;
#line 1382 "completion.c"
	{
		GList* item_collection = NULL;
		GList* item_it = NULL;
#line 319 "/home/seb/gnome/gnome-latex/src/completion.vala"
		item_collection = proposals_to_filter;
#line 319 "/home/seb/gnome/gnome-latex/src/completion.vala"
		for (item_it = item_collection; item_it != NULL; item_it = item_it->next) {
#line 1390 "completion.c"
			GtkSourceCompletionItem* _tmp1_;
			GtkSourceCompletionItem* item = NULL;
#line 319 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp1_ = _g_object_ref0 ((GtkSourceCompletionItem*) item_it->data);
#line 319 "/home/seb/gnome/gnome-latex/src/completion.vala"
			item = _tmp1_;
#line 1397 "completion.c"
			{
				GtkSourceCompletionItem* _tmp2_;
				gchar* _tmp3_;
				gchar* _tmp4_;
				gchar* _tmp5_;
				gboolean _tmp6_;
#line 321 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp2_ = item;
#line 321 "/home/seb/gnome/gnome-latex/src/completion.vala"
				g_object_get (_tmp2_, "text", &_tmp3_, NULL);
#line 321 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp4_ = _tmp3_;
#line 321 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp5_ = _tmp4_;
#line 321 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp6_ = g_str_has_prefix (_tmp5_, prefix);
#line 321 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_g_free0 (_tmp5_);
#line 321 "/home/seb/gnome/gnome-latex/src/completion.vala"
				if (_tmp6_) {
#line 1418 "completion.c"
					GtkSourceCompletionItem* _tmp7_;
					GtkSourceCompletionItem* _tmp8_;
#line 322 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp7_ = item;
#line 322 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp8_ = _g_object_ref0 (_tmp7_);
#line 322 "/home/seb/gnome/gnome-latex/src/completion.vala"
					filtered_proposals = g_list_prepend (filtered_proposals, _tmp8_);
#line 1427 "completion.c"
				}
#line 319 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_g_object_unref0 (item);
#line 1431 "completion.c"
			}
		}
	}
#line 327 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp9_ = filtered_proposals;
#line 327 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (_tmp9_ != NULL) {
#line 328 "/home/seb/gnome/gnome-latex/src/completion.vala"
		filtered_proposals = g_list_reverse (filtered_proposals);
#line 1441 "completion.c"
	} else {
		GtkSourceCompletionItem* dummy_proposal = NULL;
		GtkSourceCompletionItem* _tmp10_;
		GtkSourceCompletionItem* _tmp11_;
		GtkSourceCompletionItem* _tmp12_;
		GtkSourceCompletionItem* _tmp13_;
		GtkSourceCompletionItem* _tmp14_;
#line 333 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp10_ = gtk_source_completion_item_new ();
#line 333 "/home/seb/gnome/gnome-latex/src/completion.vala"
		dummy_proposal = _tmp10_;
#line 334 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp11_ = dummy_proposal;
#line 334 "/home/seb/gnome/gnome-latex/src/completion.vala"
		gtk_source_completion_item_set_label (_tmp11_, _ ("No matching proposal"));
#line 335 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp12_ = dummy_proposal;
#line 335 "/home/seb/gnome/gnome-latex/src/completion.vala"
		gtk_source_completion_item_set_text (_tmp12_, "");
#line 336 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp13_ = dummy_proposal;
#line 336 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp14_ = _g_object_ref0 (_tmp13_);
#line 336 "/home/seb/gnome/gnome-latex/src/completion.vala"
		filtered_proposals = g_list_prepend (filtered_proposals, _tmp14_);
#line 327 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_g_object_unref0 (dummy_proposal);
#line 1469 "completion.c"
	}
#line 339 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp15_ = filtered_proposals;
#line 339 "/home/seb/gnome/gnome-latex/src/completion.vala"
	gtk_source_completion_context_add_proposals (context, G_TYPE_CHECK_INSTANCE_CAST (self, gtk_source_completion_provider_get_type (), GtkSourceCompletionProvider), _tmp15_, TRUE);
#line 304 "/home/seb/gnome/gnome-latex/src/completion.vala"
	(filtered_proposals == NULL) ? NULL : (filtered_proposals = (_g_list_free__g_object_unref0_ (filtered_proposals), NULL));
#line 1477 "completion.c"
}


/*************************************************************************/
static void
completion_provider_init_calltip_window (CompletionProvider* self)
{
	GtkSourceCompletionInfo* _tmp0_;
	GtkLabel* _tmp1_;
	GtkSourceCompletionInfo* _tmp2_;
	GtkLabel* _tmp3_;
#line 345 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (self != NULL);
#line 347 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp0_ = gtk_source_completion_info_new ();
#line 347 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_object_ref_sink (_tmp0_);
#line 347 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_object_unref0 (self->priv->_calltip_window);
#line 347 "/home/seb/gnome/gnome-latex/src/completion.vala"
	self->priv->_calltip_window = _tmp0_;
#line 348 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp1_ = (GtkLabel*) gtk_label_new (NULL);
#line 348 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_object_ref_sink (_tmp1_);
#line 348 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_object_unref0 (self->priv->_calltip_window_label);
#line 348 "/home/seb/gnome/gnome-latex/src/completion.vala"
	self->priv->_calltip_window_label = _tmp1_;
#line 349 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp2_ = self->priv->_calltip_window;
#line 349 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp3_ = self->priv->_calltip_window_label;
#line 349 "/home/seb/gnome/gnome-latex/src/completion.vala"
	gtk_container_add ((GtkContainer*) _tmp2_, (GtkWidget*) _tmp3_);
#line 1513 "completion.c"
}


static void
completion_provider_show_calltip_cmd_prototype (CompletionProvider* self,
                                                const gchar* arg_cmd,
                                                GeeArrayList* arguments)
{
	GeeHashMap* _tmp0_;
	CompletionProviderCompletionCommand command = {0};
	GeeHashMap* _tmp1_;
	gpointer _tmp2_;
	CompletionProviderCompletionCommand* _tmp3_;
	CompletionProviderCompletionCommand _tmp4_ = {0};
	CompletionProviderCompletionCommand _tmp5_;
	gint arg_num = 0;
	CompletionProviderCompletionCommand _tmp6_;
	CompletionProviderCompletionArgument* _tmp7_;
	gint _tmp7__length1;
	gint _tmp8_;
#line 353 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (self != NULL);
#line 353 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (arg_cmd != NULL);
#line 353 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (arguments != NULL);
#line 356 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp0_ = self->priv->_commands;
#line 356 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, arg_cmd));
#line 358 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp1_ = self->priv->_commands;
#line 358 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp2_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp1_, arg_cmd);
#line 358 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp3_ = (CompletionProviderCompletionCommand*) _tmp2_;
#line 358 "/home/seb/gnome/gnome-latex/src/completion.vala"
	completion_provider_completion_command_copy (_tmp3_, &_tmp4_);
#line 358 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp5_ = _tmp4_;
#line 358 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_completion_provider_completion_command_free0 (_tmp3_);
#line 358 "/home/seb/gnome/gnome-latex/src/completion.vala"
	command = _tmp5_;
#line 359 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp6_ = command;
#line 359 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp7_ = _tmp6_.args;
#line 359 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp7__length1 = _tmp6_.args_length1;
#line 359 "/home/seb/gnome/gnome-latex/src/completion.vala"
	arg_num = completion_provider_get_argument_num (self, _tmp7_, _tmp7__length1, arguments);
#line 360 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp8_ = arg_num;
#line 360 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (_tmp8_ != -1) {
#line 1570 "completion.c"
		gchar* info = NULL;
		CompletionProviderCompletionCommand _tmp9_;
		gint _tmp10_;
		gchar* _tmp11_;
		const gchar* _tmp12_;
#line 362 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp9_ = command;
#line 362 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp10_ = arg_num;
#line 362 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp11_ = completion_provider_get_command_info (self, &_tmp9_, _tmp10_);
#line 362 "/home/seb/gnome/gnome-latex/src/completion.vala"
		info = _tmp11_;
#line 363 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp12_ = info;
#line 363 "/home/seb/gnome/gnome-latex/src/completion.vala"
		completion_provider_show_calltip_info (self, _tmp12_);
#line 360 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_g_free0 (info);
#line 1590 "completion.c"
	}
#line 353 "/home/seb/gnome/gnome-latex/src/completion.vala"
	completion_provider_completion_command_destroy (&command);
#line 1594 "completion.c"
}


static void
completion_provider_show_calltip_info (CompletionProvider* self,
                                       const gchar* markup)
{
	GtkSourceCompletionInfo* _tmp0_;
	GtkLabel* _tmp1_;
	MainWindow* window = NULL;
	GlatexApp* _tmp2_;
	GlatexApp* _tmp3_;
	MainWindow* _tmp4_;
	MainWindow* _tmp5_;
	GtkSourceCompletionInfo* _tmp6_;
	GtkSourceCompletionInfo* _tmp7_;
	DocumentView* _tmp8_;
	DocumentView* _tmp9_;
	GtkTextIter cursor_pos = {0};
	GtkTextBuffer* buffer = NULL;
	DocumentView* _tmp10_;
	DocumentView* _tmp11_;
	GtkTextBuffer* _tmp12_;
	GtkTextBuffer* _tmp13_;
	GtkTextBuffer* _tmp14_;
	GtkTextMark* _tmp15_;
	GtkTextIter _tmp16_ = {0};
	GtkTextIter begin_arg_pos = {0};
	GtkTextIter _tmp17_;
	GtkTextIter _tmp18_ = {0};
	GtkSourceCompletionInfo* _tmp19_;
	DocumentView* _tmp20_;
	DocumentView* _tmp21_;
	GtkTextIter _tmp22_;
	GtkSourceCompletionInfo* _tmp23_;
#line 367 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (self != NULL);
#line 367 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (markup != NULL);
#line 369 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp0_ = self->priv->_calltip_window;
#line 369 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (_tmp0_ == NULL) {
#line 370 "/home/seb/gnome/gnome-latex/src/completion.vala"
		completion_provider_init_calltip_window (self);
#line 1640 "completion.c"
	}
#line 372 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp1_ = self->priv->_calltip_window_label;
#line 372 "/home/seb/gnome/gnome-latex/src/completion.vala"
	gtk_label_set_markup (_tmp1_, markup);
#line 374 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp2_ = glatex_app_get_instance ();
#line 374 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp3_ = _tmp2_;
#line 374 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp4_ = glatex_app_get_active_main_window (_tmp3_);
#line 374 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp5_ = _tmp4_;
#line 374 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_object_unref0 (_tmp3_);
#line 374 "/home/seb/gnome/gnome-latex/src/completion.vala"
	window = _tmp5_;
#line 375 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (window != NULL);
#line 377 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp6_ = self->priv->_calltip_window;
#line 377 "/home/seb/gnome/gnome-latex/src/completion.vala"
	gtk_window_set_transient_for ((GtkWindow*) _tmp6_, (GtkWindow*) window);
#line 378 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp7_ = self->priv->_calltip_window;
#line 378 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp8_ = main_window_get_active_view (window);
#line 378 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp9_ = _tmp8_;
#line 378 "/home/seb/gnome/gnome-latex/src/completion.vala"
	gtk_window_set_attached_to ((GtkWindow*) _tmp7_, (GtkWidget*) _tmp9_);
#line 382 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp10_ = main_window_get_active_view (window);
#line 382 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp11_ = _tmp10_;
#line 382 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp12_ = gtk_text_view_get_buffer ((GtkTextView*) _tmp11_);
#line 382 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp13_ = _tmp12_;
#line 382 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp14_ = _g_object_ref0 (_tmp13_);
#line 382 "/home/seb/gnome/gnome-latex/src/completion.vala"
	buffer = _tmp14_;
#line 383 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp15_ = gtk_text_buffer_get_insert (buffer);
#line 383 "/home/seb/gnome/gnome-latex/src/completion.vala"
	gtk_text_buffer_get_iter_at_mark (buffer, &_tmp16_, _tmp15_);
#line 383 "/home/seb/gnome/gnome-latex/src/completion.vala"
	cursor_pos = _tmp16_;
#line 384 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp17_ = cursor_pos;
#line 384 "/home/seb/gnome/gnome-latex/src/completion.vala"
	completion_provider_get_begin_arg_pos (self, &_tmp17_, &_tmp18_);
#line 384 "/home/seb/gnome/gnome-latex/src/completion.vala"
	begin_arg_pos = _tmp18_;
#line 385 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp19_ = self->priv->_calltip_window;
#line 385 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp20_ = main_window_get_active_view (window);
#line 385 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp21_ = _tmp20_;
#line 385 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp22_ = begin_arg_pos;
#line 385 "/home/seb/gnome/gnome-latex/src/completion.vala"
	gtk_source_completion_info_move_to_iter (_tmp19_, (GtkTextView*) _tmp21_, &_tmp22_);
#line 387 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp23_ = self->priv->_calltip_window;
#line 387 "/home/seb/gnome/gnome-latex/src/completion.vala"
	gtk_widget_show_all ((GtkWidget*) _tmp23_);
#line 367 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_object_unref0 (buffer);
#line 367 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_object_unref0 (window);
#line 1714 "completion.c"
}


void
completion_provider_hide_calltip_window (CompletionProvider* self)
{
	GtkSourceCompletionInfo* _tmp0_;
#line 390 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (self != NULL);
#line 392 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp0_ = self->priv->_calltip_window;
#line 392 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (_tmp0_ != NULL) {
#line 1728 "completion.c"
		GtkSourceCompletionInfo* _tmp1_;
#line 393 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp1_ = self->priv->_calltip_window;
#line 393 "/home/seb/gnome/gnome-latex/src/completion.vala"
		gtk_widget_hide ((GtkWidget*) _tmp1_);
#line 1734 "completion.c"
	}
}


/*************************************************************************/
static gboolean
completion_provider_real_activate_proposal (GtkSourceCompletionProvider* base,
                                            GtkSourceCompletionProposal* proposal,
                                            GtkTextIter* iter)
{
	CompletionProvider * self;
	gboolean result = FALSE;
	gchar* text = NULL;
	gchar* _tmp0_;
	gboolean _tmp1_ = FALSE;
	const gchar* _tmp2_;
	gchar* cmd = NULL;
	GtkTextIter _tmp4_;
	gchar* _tmp5_;
	gboolean _tmp6_ = FALSE;
	const gchar* _tmp7_;
#line 399 "/home/seb/gnome/gnome-latex/src/completion.vala"
	self = (CompletionProvider*) base;
#line 399 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_val_if_fail (proposal != NULL, FALSE);
#line 399 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_val_if_fail (iter != NULL, FALSE);
#line 401 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp0_ = gtk_source_completion_proposal_get_text (proposal);
#line 401 "/home/seb/gnome/gnome-latex/src/completion.vala"
	text = _tmp0_;
#line 402 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp2_ = text;
#line 402 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (_tmp2_ == NULL) {
#line 402 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp1_ = TRUE;
#line 1772 "completion.c"
	} else {
		const gchar* _tmp3_;
#line 402 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp3_ = text;
#line 402 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp1_ = g_strcmp0 (_tmp3_, "") == 0;
#line 1779 "completion.c"
	}
#line 402 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (_tmp1_) {
#line 403 "/home/seb/gnome/gnome-latex/src/completion.vala"
		result = TRUE;
#line 403 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_g_free0 (text);
#line 403 "/home/seb/gnome/gnome-latex/src/completion.vala"
		return result;
#line 1789 "completion.c"
	}
#line 405 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp4_ = *iter;
#line 405 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp5_ = completion_provider_get_latex_command_at_iter (self, &_tmp4_);
#line 405 "/home/seb/gnome/gnome-latex/src/completion.vala"
	cmd = _tmp5_;
#line 408 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp7_ = cmd;
#line 408 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (_tmp7_ != NULL) {
#line 408 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp6_ = TRUE;
#line 1803 "completion.c"
	} else {
		const gchar* _tmp8_;
#line 408 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp8_ = text;
#line 408 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp6_ = g_str_has_prefix (_tmp8_, "\\");
#line 1810 "completion.c"
	}
#line 408 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (_tmp6_) {
#line 1814 "completion.c"
		GtkTextIter _tmp9_;
		const gchar* _tmp10_;
#line 409 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp9_ = *iter;
#line 409 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp10_ = cmd;
#line 409 "/home/seb/gnome/gnome-latex/src/completion.vala"
		completion_provider_activate_proposal_command_name (self, proposal, &_tmp9_, _tmp10_);
#line 1823 "completion.c"
	} else {
		CompletionProviderArgumentContext info = {0};
		GtkTextIter _tmp11_;
		CompletionProviderArgumentContext _tmp12_ = {0};
		gboolean _tmp13_;
#line 415 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp11_ = *iter;
#line 415 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp13_ = completion_provider_in_latex_command_argument (self, &_tmp11_, &_tmp12_);
#line 415 "/home/seb/gnome/gnome-latex/src/completion.vala"
		completion_provider_argument_context_destroy (&info);
#line 415 "/home/seb/gnome/gnome-latex/src/completion.vala"
		info = _tmp12_;
#line 415 "/home/seb/gnome/gnome-latex/src/completion.vala"
		if (_tmp13_) {
#line 1839 "completion.c"
			GtkTextIter _tmp14_;
			CompletionProviderArgumentContext _tmp15_;
			const gchar* _tmp16_;
			CompletionProviderArgumentContext _tmp17_;
			const gchar* _tmp18_;
#line 417 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp14_ = *iter;
#line 417 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp15_ = info;
#line 417 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp16_ = _tmp15_.cmd_name;
#line 417 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp17_ = info;
#line 417 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp18_ = _tmp17_.arg_contents;
#line 417 "/home/seb/gnome/gnome-latex/src/completion.vala"
			completion_provider_activate_proposal_argument_choice (self, proposal, &_tmp14_, _tmp16_, _tmp18_);
#line 1857 "completion.c"
		} else {
#line 421 "/home/seb/gnome/gnome-latex/src/completion.vala"
			g_warning ("completion.vala:421: Not in a LaTeX command argument.");
#line 1861 "completion.c"
		}
#line 408 "/home/seb/gnome/gnome-latex/src/completion.vala"
		completion_provider_argument_context_destroy (&info);
#line 1865 "completion.c"
	}
#line 424 "/home/seb/gnome/gnome-latex/src/completion.vala"
	result = TRUE;
#line 424 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 (cmd);
#line 424 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 (text);
#line 424 "/home/seb/gnome/gnome-latex/src/completion.vala"
	return result;
#line 1875 "completion.c"
}


static gchar*
string_slice (const gchar* self,
              glong start,
              glong end)
{
	gchar* result = NULL;
	glong string_length = 0L;
	gint _tmp0_;
	gint _tmp1_;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp6_ = FALSE;
	gchar* _tmp8_;
#line 1369 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1370 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
	_tmp0_ = strlen (self);
#line 1370 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
	_tmp1_ = _tmp0_;
#line 1370 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
	string_length = (glong) _tmp1_;
#line 1371 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
	if (start < ((glong) 0)) {
#line 1901 "completion.c"
		glong _tmp2_;
#line 1372 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp2_ = string_length;
#line 1372 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		start = _tmp2_ + start;
#line 1907 "completion.c"
	}
#line 1374 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
	if (end < ((glong) 0)) {
#line 1911 "completion.c"
		glong _tmp3_;
#line 1375 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp3_ = string_length;
#line 1375 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		end = _tmp3_ + end;
#line 1917 "completion.c"
	}
#line 1377 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
	if (start >= ((glong) 0)) {
#line 1921 "completion.c"
		glong _tmp5_;
#line 1377 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp5_ = string_length;
#line 1377 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp4_ = start <= _tmp5_;
#line 1927 "completion.c"
	} else {
#line 1377 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp4_ = FALSE;
#line 1931 "completion.c"
	}
#line 1377 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
	g_return_val_if_fail (_tmp4_, NULL);
#line 1378 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
	if (end >= ((glong) 0)) {
#line 1937 "completion.c"
		glong _tmp7_;
#line 1378 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp7_ = string_length;
#line 1378 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp6_ = end <= _tmp7_;
#line 1943 "completion.c"
	} else {
#line 1378 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp6_ = FALSE;
#line 1947 "completion.c"
	}
#line 1378 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
	g_return_val_if_fail (_tmp6_, NULL);
#line 1379 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
	g_return_val_if_fail (start <= end, NULL);
#line 1380 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
	_tmp8_ = g_strndup (((gchar*) self) + start, (gsize) (end - start));
#line 1380 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
	result = _tmp8_;
#line 1380 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
	return result;
#line 1959 "completion.c"
}


static void
completion_provider_activate_proposal_command_name (CompletionProvider* self,
                                                    GtkSourceCompletionProposal* proposal,
                                                    GtkTextIter* iter,
                                                    const gchar* cmd)
{
	gchar* text = NULL;
	gchar* _tmp0_;
	gint _tmp1_ = 0;
	glong index_start = 0L;
	gchar* text_to_insert = NULL;
	const gchar* _tmp4_;
	glong _tmp5_;
	const gchar* _tmp6_;
	gint _tmp7_;
	gint _tmp8_;
	gchar* _tmp9_;
	GtkTextBuffer* doc = NULL;
	GtkTextBuffer* _tmp10_;
	GtkTextBuffer* _tmp11_;
	GtkTextMark* old_pos_mark = NULL;
	GtkTextBuffer* _tmp12_;
	GtkTextIter _tmp13_;
	GtkTextMark* _tmp14_;
	GtkTextMark* _tmp15_;
	GtkTextBuffer* _tmp16_;
	GtkTextBuffer* _tmp17_;
	const gchar* _tmp18_;
	GtkTextBuffer* _tmp19_;
	GtkTextIter old_pos_iter = {0};
	GtkTextBuffer* _tmp20_;
	GtkTextMark* _tmp21_;
	GtkTextIter _tmp22_ = {0};
	GtkTextBuffer* _tmp23_;
	GtkTextMark* _tmp24_;
	GtkTextIter match_end = {0};
	GtkTextIter _tmp25_;
	GtkTextIter _tmp26_ = {0};
	gboolean _tmp27_;
#line 427 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (self != NULL);
#line 427 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (proposal != NULL);
#line 427 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (iter != NULL);
#line 430 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp0_ = gtk_source_completion_proposal_get_text (proposal);
#line 430 "/home/seb/gnome/gnome-latex/src/completion.vala"
	text = _tmp0_;
#line 432 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (cmd != NULL) {
#line 2014 "completion.c"
		gint _tmp2_;
		gint _tmp3_;
#line 432 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp2_ = strlen (cmd);
#line 432 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp3_ = _tmp2_;
#line 432 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp1_ = _tmp3_;
#line 2023 "completion.c"
	} else {
#line 432 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp1_ = 0;
#line 2027 "completion.c"
	}
#line 432 "/home/seb/gnome/gnome-latex/src/completion.vala"
	index_start = (glong) _tmp1_;
#line 433 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp4_ = text;
#line 433 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp5_ = index_start;
#line 433 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp6_ = text;
#line 433 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp7_ = strlen (_tmp6_);
#line 433 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp8_ = _tmp7_;
#line 433 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp9_ = string_slice (_tmp4_, _tmp5_, (glong) _tmp8_);
#line 433 "/home/seb/gnome/gnome-latex/src/completion.vala"
	text_to_insert = _tmp9_;
#line 436 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp10_ = gtk_text_iter_get_buffer (iter);
#line 436 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp11_ = _g_object_ref0 (_tmp10_);
#line 436 "/home/seb/gnome/gnome-latex/src/completion.vala"
	doc = _tmp11_;
#line 437 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp12_ = doc;
#line 437 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp13_ = *iter;
#line 437 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp14_ = gtk_text_buffer_create_mark (_tmp12_, NULL, &_tmp13_, TRUE);
#line 437 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp15_ = _g_object_ref0 (_tmp14_);
#line 437 "/home/seb/gnome/gnome-latex/src/completion.vala"
	old_pos_mark = _tmp15_;
#line 439 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp16_ = doc;
#line 439 "/home/seb/gnome/gnome-latex/src/completion.vala"
	gtk_text_buffer_begin_user_action (_tmp16_);
#line 440 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp17_ = doc;
#line 440 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp18_ = text_to_insert;
#line 440 "/home/seb/gnome/gnome-latex/src/completion.vala"
	gtk_text_buffer_insert (_tmp17_, iter, _tmp18_, -1);
#line 441 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp19_ = doc;
#line 441 "/home/seb/gnome/gnome-latex/src/completion.vala"
	gtk_text_buffer_end_user_action (_tmp19_);
#line 445 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp20_ = doc;
#line 445 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp21_ = old_pos_mark;
#line 445 "/home/seb/gnome/gnome-latex/src/completion.vala"
	gtk_text_buffer_get_iter_at_mark (_tmp20_, &_tmp22_, _tmp21_);
#line 445 "/home/seb/gnome/gnome-latex/src/completion.vala"
	old_pos_iter = _tmp22_;
#line 446 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp23_ = doc;
#line 446 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp24_ = old_pos_mark;
#line 446 "/home/seb/gnome/gnome-latex/src/completion.vala"
	gtk_text_buffer_delete_mark (_tmp23_, _tmp24_);
#line 449 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp25_ = *iter;
#line 449 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp27_ = gtk_text_iter_forward_search (&old_pos_iter, "{", GTK_TEXT_SEARCH_TEXT_ONLY | GTK_TEXT_SEARCH_VISIBLE_ONLY, NULL, &_tmp26_, &_tmp25_);
#line 449 "/home/seb/gnome/gnome-latex/src/completion.vala"
	match_end = _tmp26_;
#line 449 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (_tmp27_) {
#line 2097 "completion.c"
		GtkTextBuffer* _tmp28_;
		GtkTextIter _tmp29_;
#line 453 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp28_ = doc;
#line 453 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp29_ = match_end;
#line 453 "/home/seb/gnome/gnome-latex/src/completion.vala"
		gtk_text_buffer_place_cursor (_tmp28_, &_tmp29_);
#line 2106 "completion.c"
	}
#line 427 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_object_unref0 (old_pos_mark);
#line 427 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_object_unref0 (doc);
#line 427 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 (text_to_insert);
#line 427 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 (text);
#line 2116 "completion.c"
}


static void
completion_provider_activate_proposal_argument_choice (CompletionProvider* self,
                                                       GtkSourceCompletionProposal* proposal,
                                                       GtkTextIter* iter,
                                                       const gchar* arg_cmd,
                                                       const gchar* arg_contents)
{
	gchar* text = NULL;
	gchar* _tmp0_;
	gint _tmp1_ = 0;
	glong index_start = 0L;
	gchar* text_to_insert = NULL;
	const gchar* _tmp4_;
	glong _tmp5_;
	const gchar* _tmp6_;
	gint _tmp7_;
	gint _tmp8_;
	gchar* _tmp9_;
	GtkTextBuffer* doc = NULL;
	GtkTextBuffer* _tmp10_;
	GtkTextBuffer* _tmp11_;
	GtkTextBuffer* _tmp12_;
	GtkTextBuffer* _tmp13_;
	const gchar* _tmp14_;
	GtkTextBuffer* _tmp20_;
#line 457 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (self != NULL);
#line 457 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (proposal != NULL);
#line 457 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (iter != NULL);
#line 457 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (arg_cmd != NULL);
#line 460 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp0_ = gtk_source_completion_proposal_get_text (proposal);
#line 460 "/home/seb/gnome/gnome-latex/src/completion.vala"
	text = _tmp0_;
#line 462 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (arg_contents != NULL) {
#line 2159 "completion.c"
		gint _tmp2_;
		gint _tmp3_;
#line 462 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp2_ = strlen (arg_contents);
#line 462 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp3_ = _tmp2_;
#line 462 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp1_ = _tmp3_;
#line 2168 "completion.c"
	} else {
#line 462 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp1_ = 0;
#line 2172 "completion.c"
	}
#line 462 "/home/seb/gnome/gnome-latex/src/completion.vala"
	index_start = (glong) _tmp1_;
#line 463 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp4_ = text;
#line 463 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp5_ = index_start;
#line 463 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp6_ = text;
#line 463 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp7_ = strlen (_tmp6_);
#line 463 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp8_ = _tmp7_;
#line 463 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp9_ = string_slice (_tmp4_, _tmp5_, (glong) _tmp8_);
#line 463 "/home/seb/gnome/gnome-latex/src/completion.vala"
	text_to_insert = _tmp9_;
#line 465 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp10_ = gtk_text_iter_get_buffer (iter);
#line 465 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp11_ = _g_object_ref0 (_tmp10_);
#line 465 "/home/seb/gnome/gnome-latex/src/completion.vala"
	doc = _tmp11_;
#line 466 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp12_ = doc;
#line 466 "/home/seb/gnome/gnome-latex/src/completion.vala"
	gtk_text_buffer_begin_user_action (_tmp12_);
#line 467 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp13_ = doc;
#line 467 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp14_ = text_to_insert;
#line 467 "/home/seb/gnome/gnome-latex/src/completion.vala"
	gtk_text_buffer_insert (_tmp13_, iter, _tmp14_, -1);
#line 470 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (g_strcmp0 (arg_cmd, "\\begin") == 0) {
#line 2208 "completion.c"
		GtkTextBuffer* _tmp16_;
		GtkTextBuffer* _tmp17_;
		const gchar* _tmp18_;
		GtkTextIter _tmp19_;
#line 473 "/home/seb/gnome/gnome-latex/src/completion.vala"
		if (gtk_text_iter_get_char (iter) == ((gunichar) '}')) {
#line 474 "/home/seb/gnome/gnome-latex/src/completion.vala"
			gtk_text_iter_forward_char (iter);
#line 2217 "completion.c"
		} else {
			GtkTextBuffer* _tmp15_;
#line 476 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp15_ = doc;
#line 476 "/home/seb/gnome/gnome-latex/src/completion.vala"
			gtk_text_buffer_insert (_tmp15_, iter, "}", -1);
#line 2224 "completion.c"
		}
#line 481 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp16_ = doc;
#line 481 "/home/seb/gnome/gnome-latex/src/completion.vala"
		gtk_text_buffer_end_user_action (_tmp16_);
#line 482 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp17_ = doc;
#line 482 "/home/seb/gnome/gnome-latex/src/completion.vala"
		gtk_text_buffer_begin_user_action (_tmp17_);
#line 483 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp18_ = text;
#line 483 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp19_ = *iter;
#line 483 "/home/seb/gnome/gnome-latex/src/completion.vala"
		completion_provider_close_environment (self, _tmp18_, &_tmp19_);
#line 2240 "completion.c"
	} else {
	}
#line 491 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp20_ = doc;
#line 491 "/home/seb/gnome/gnome-latex/src/completion.vala"
	gtk_text_buffer_end_user_action (_tmp20_);
#line 457 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_object_unref0 (doc);
#line 457 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 (text_to_insert);
#line 457 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 (text);
#line 2253 "completion.c"
}


static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result = NULL;
#line 1456 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1457 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
	result = self;
#line 1457 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
	return result;
#line 2267 "completion.c"
}


static void
completion_provider_close_environment (CompletionProvider* self,
                                       const gchar* env_name,
                                       GtkTextIter* iter)
{
	Document* doc = NULL;
	GtkTextBuffer* _tmp0_;
	Document* _tmp1_;
	gchar* cur_indent = NULL;
	GtkTextIter _tmp2_;
	gchar* _tmp3_;
	gchar* indent = NULL;
	Document* _tmp4_;
	DocumentTab* _tmp5_;
	DocumentView* _tmp6_;
	DocumentView* _tmp7_;
	gchar* _tmp8_;
	CompletionProviderCompletionChoice* env = NULL;
	GeeHashMap* _tmp9_;
	gpointer _tmp10_;
	Document* _tmp11_;
	Document* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	const gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gboolean _tmp19_ = FALSE;
	CompletionProviderCompletionChoice* _tmp20_;
	GtkTextMark* cursor_pos = NULL;
	Document* _tmp26_;
	GtkTextIter _tmp27_;
	GtkTextMark* _tmp28_;
	GtkTextMark* _tmp29_;
	gboolean _tmp30_ = FALSE;
	CompletionProviderCompletionChoice* _tmp31_;
	Document* _tmp37_;
	const gchar* _tmp38_;
	const gchar* _tmp39_;
	const gchar* _tmp40_;
	gchar* _tmp41_;
	gchar* _tmp42_;
	Document* _tmp43_;
	GtkTextMark* _tmp44_;
	GtkTextIter _tmp45_ = {0};
	Document* _tmp46_;
	GtkTextMark* _tmp47_;
	Document* _tmp48_;
	GtkTextIter _tmp49_;
	Document* _tmp50_;
#line 494 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (self != NULL);
#line 494 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (env_name != NULL);
#line 494 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (iter != NULL);
#line 496 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp0_ = gtk_text_iter_get_buffer (iter);
#line 496 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, TYPE_DOCUMENT) ? ((Document*) _tmp0_) : NULL);
#line 496 "/home/seb/gnome/gnome-latex/src/completion.vala"
	doc = _tmp1_;
#line 498 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp2_ = *iter;
#line 498 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp3_ = tepl_iter_get_line_indentation (&_tmp2_);
#line 498 "/home/seb/gnome/gnome-latex/src/completion.vala"
	cur_indent = _tmp3_;
#line 499 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp4_ = doc;
#line 499 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp5_ = _tmp4_->tab;
#line 499 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp6_ = document_tab_get_document_view (_tmp5_);
#line 499 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp7_ = _tmp6_;
#line 499 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp8_ = latexila_view_get_indentation_style ((GtkSourceView*) _tmp7_);
#line 499 "/home/seb/gnome/gnome-latex/src/completion.vala"
	indent = _tmp8_;
#line 501 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp9_ = self->priv->_environments;
#line 501 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp10_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp9_, env_name);
#line 501 "/home/seb/gnome/gnome-latex/src/completion.vala"
	env = (CompletionProviderCompletionChoice*) _tmp10_;
#line 503 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp11_ = doc;
#line 503 "/home/seb/gnome/gnome-latex/src/completion.vala"
	gtk_text_buffer_begin_user_action ((GtkTextBuffer*) _tmp11_);
#line 505 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp12_ = doc;
#line 505 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp13_ = cur_indent;
#line 505 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp14_ = string_to_string (_tmp13_);
#line 505 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp15_ = indent;
#line 505 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp16_ = string_to_string (_tmp15_);
#line 505 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp17_ = g_strconcat ("\n", _tmp14_, _tmp16_, NULL);
#line 505 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp18_ = _tmp17_;
#line 505 "/home/seb/gnome/gnome-latex/src/completion.vala"
	document_insert (_tmp12_, iter, _tmp18_, -1);
#line 505 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 (_tmp18_);
#line 507 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp20_ = env;
#line 507 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (_tmp20_ != NULL) {
#line 2384 "completion.c"
		CompletionProviderCompletionChoice* _tmp21_;
		const gchar* _tmp22_;
#line 507 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp21_ = env;
#line 507 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp22_ = (*_tmp21_).insert;
#line 507 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp19_ = _tmp22_ != NULL;
#line 2393 "completion.c"
	} else {
#line 507 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp19_ = FALSE;
#line 2397 "completion.c"
	}
#line 507 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (_tmp19_) {
#line 2401 "completion.c"
		Document* _tmp23_;
		CompletionProviderCompletionChoice* _tmp24_;
		const gchar* _tmp25_;
#line 508 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp23_ = doc;
#line 508 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp24_ = env;
#line 508 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp25_ = (*_tmp24_).insert;
#line 508 "/home/seb/gnome/gnome-latex/src/completion.vala"
		document_insert (_tmp23_, iter, _tmp25_, -1);
#line 2413 "completion.c"
	}
#line 510 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp26_ = doc;
#line 510 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp27_ = *iter;
#line 510 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp28_ = gtk_text_buffer_create_mark ((GtkTextBuffer*) _tmp26_, NULL, &_tmp27_, TRUE);
#line 510 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp29_ = _g_object_ref0 (_tmp28_);
#line 510 "/home/seb/gnome/gnome-latex/src/completion.vala"
	cursor_pos = _tmp29_;
#line 512 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp31_ = env;
#line 512 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (_tmp31_ != NULL) {
#line 2429 "completion.c"
		CompletionProviderCompletionChoice* _tmp32_;
		const gchar* _tmp33_;
#line 512 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp32_ = env;
#line 512 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp33_ = (*_tmp32_).insert_after;
#line 512 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp30_ = _tmp33_ != NULL;
#line 2438 "completion.c"
	} else {
#line 512 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp30_ = FALSE;
#line 2442 "completion.c"
	}
#line 512 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (_tmp30_) {
#line 2446 "completion.c"
		Document* _tmp34_;
		CompletionProviderCompletionChoice* _tmp35_;
		const gchar* _tmp36_;
#line 513 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp34_ = doc;
#line 513 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp35_ = env;
#line 513 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp36_ = (*_tmp35_).insert_after;
#line 513 "/home/seb/gnome/gnome-latex/src/completion.vala"
		document_insert (_tmp34_, iter, _tmp36_, -1);
#line 2458 "completion.c"
	}
#line 515 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp37_ = doc;
#line 515 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp38_ = cur_indent;
#line 515 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp39_ = string_to_string (_tmp38_);
#line 515 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp40_ = string_to_string (env_name);
#line 515 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp41_ = g_strconcat ("\n", _tmp39_, "\\end{", _tmp40_, "}", NULL);
#line 515 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp42_ = _tmp41_;
#line 515 "/home/seb/gnome/gnome-latex/src/completion.vala"
	document_insert (_tmp37_, iter, _tmp42_, -1);
#line 515 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 (_tmp42_);
#line 518 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp43_ = doc;
#line 518 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp44_ = cursor_pos;
#line 518 "/home/seb/gnome/gnome-latex/src/completion.vala"
	gtk_text_buffer_get_iter_at_mark ((GtkTextBuffer*) _tmp43_, &_tmp45_, _tmp44_);
#line 518 "/home/seb/gnome/gnome-latex/src/completion.vala"
	*iter = _tmp45_;
#line 519 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp46_ = doc;
#line 519 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp47_ = cursor_pos;
#line 519 "/home/seb/gnome/gnome-latex/src/completion.vala"
	gtk_text_buffer_delete_mark ((GtkTextBuffer*) _tmp46_, _tmp47_);
#line 520 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp48_ = doc;
#line 520 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp49_ = *iter;
#line 520 "/home/seb/gnome/gnome-latex/src/completion.vala"
	gtk_text_buffer_place_cursor ((GtkTextBuffer*) _tmp48_, &_tmp49_);
#line 522 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp50_ = doc;
#line 522 "/home/seb/gnome/gnome-latex/src/completion.vala"
	gtk_text_buffer_end_user_action ((GtkTextBuffer*) _tmp50_);
#line 494 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_object_unref0 (cursor_pos);
#line 494 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_completion_provider_completion_choice_free0 (env);
#line 494 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 (indent);
#line 494 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 (cur_indent);
#line 494 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_object_unref0 (doc);
#line 2510 "completion.c"
}


/*************************************************************************/
static gboolean
string_get_prev_char (const gchar* self,
                      gint* index,
                      gunichar* c)
{
	gunichar _vala_c = 0U;
	gboolean result = FALSE;
#line 1182 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, FALSE);
#line 1183 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
	if (0 < (*index)) {
#line 2526 "completion.c"
		gchar* _tmp0_;
#line 1184 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp0_ = g_utf8_prev_char (((gchar*) self) + (*index));
#line 1184 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		*index = (gint) (_tmp0_ - ((gchar*) self));
#line 1185 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		_vala_c = g_utf8_get_char (((gchar*) self) + (*index));
#line 1186 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		result = TRUE;
#line 1186 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		if (c) {
#line 1186 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
			*c = _vala_c;
#line 2540 "completion.c"
		}
#line 1186 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		return result;
#line 2544 "completion.c"
	} else {
#line 1188 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		_vala_c = (gunichar) 0;
#line 1189 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		result = FALSE;
#line 1189 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		if (c) {
#line 1189 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
			*c = _vala_c;
#line 2554 "completion.c"
		}
#line 1189 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		return result;
#line 2558 "completion.c"
	}
#line 1182 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
	if (c) {
#line 1182 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
		*c = _vala_c;
#line 2564 "completion.c"
	}
}


static void
completion_provider_get_begin_arg_pos (CompletionProvider* self,
                                       GtkTextIter* in_arg_pos,
                                       GtkTextIter* result)
{
	gchar* text = NULL;
	GtkTextIter _tmp0_;
	gchar* _tmp1_;
	gint index = 0;
	const gchar* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	gunichar cur_char = 0U;
	GtkTextIter begin_arg_pos = {0};
	GtkTextIter _tmp14_;
	gint _tmp15_;
#line 531 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (self != NULL);
#line 531 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (in_arg_pos != NULL);
#line 533 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp0_ = *in_arg_pos;
#line 533 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp1_ = completion_provider_get_text_line_to_iter (self, &_tmp0_);
#line 533 "/home/seb/gnome/gnome-latex/src/completion.vala"
	text = _tmp1_;
#line 534 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp2_ = text;
#line 534 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp3_ = strlen (_tmp2_);
#line 534 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp4_ = _tmp3_;
#line 534 "/home/seb/gnome/gnome-latex/src/completion.vala"
	index = _tmp4_;
#line 537 "/home/seb/gnome/gnome-latex/src/completion.vala"
	while (TRUE) {
#line 2605 "completion.c"
		const gchar* _tmp5_;
		gunichar _tmp6_ = 0U;
		gboolean _tmp7_;
		gboolean _tmp8_ = FALSE;
		gboolean _tmp9_ = FALSE;
		gunichar _tmp10_;
#line 537 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp5_ = text;
#line 537 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp7_ = string_get_prev_char (_tmp5_, &index, &_tmp6_);
#line 537 "/home/seb/gnome/gnome-latex/src/completion.vala"
		cur_char = _tmp6_;
#line 537 "/home/seb/gnome/gnome-latex/src/completion.vala"
		if (!_tmp7_) {
#line 537 "/home/seb/gnome/gnome-latex/src/completion.vala"
			break;
#line 2622 "completion.c"
		}
#line 539 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp10_ = cur_char;
#line 539 "/home/seb/gnome/gnome-latex/src/completion.vala"
		if (_tmp10_ == ((gunichar) '[')) {
#line 539 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp9_ = TRUE;
#line 2630 "completion.c"
		} else {
			gunichar _tmp11_;
#line 539 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp11_ = cur_char;
#line 539 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp9_ = _tmp11_ == ((gunichar) '{');
#line 2637 "completion.c"
		}
#line 539 "/home/seb/gnome/gnome-latex/src/completion.vala"
		if (_tmp9_) {
#line 2641 "completion.c"
			const gchar* _tmp12_;
			gint _tmp13_;
#line 540 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp12_ = text;
#line 540 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp13_ = index;
#line 540 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp8_ = !utils_char_is_escaped (_tmp12_, (glong) _tmp13_);
#line 2650 "completion.c"
		} else {
#line 539 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp8_ = FALSE;
#line 2654 "completion.c"
		}
#line 539 "/home/seb/gnome/gnome-latex/src/completion.vala"
		if (_tmp8_) {
#line 542 "/home/seb/gnome/gnome-latex/src/completion.vala"
			break;
#line 2660 "completion.c"
		}
	}
#line 546 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp14_ = *in_arg_pos;
#line 546 "/home/seb/gnome/gnome-latex/src/completion.vala"
	begin_arg_pos = _tmp14_;
#line 547 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp15_ = index;
#line 547 "/home/seb/gnome/gnome-latex/src/completion.vala"
	gtk_text_iter_set_visible_line_index (&begin_arg_pos, _tmp15_);
#line 548 "/home/seb/gnome/gnome-latex/src/completion.vala"
	gtk_text_iter_forward_char (&begin_arg_pos);
#line 550 "/home/seb/gnome/gnome-latex/src/completion.vala"
	*result = begin_arg_pos;
#line 550 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 (text);
#line 550 "/home/seb/gnome/gnome-latex/src/completion.vala"
	return;
#line 2679 "completion.c"
}


static gchar*
completion_provider_get_latex_command_at_iter (CompletionProvider* self,
                                               GtkTextIter* iter)
{
	gchar* result = NULL;
	gchar* text = NULL;
	GtkTextIter _tmp0_;
	gchar* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gchar* _tmp4_;
#line 553 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 553 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_val_if_fail (iter != NULL, NULL);
#line 555 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp0_ = *iter;
#line 555 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp1_ = completion_provider_get_text_line_to_iter (self, &_tmp0_);
#line 555 "/home/seb/gnome/gnome-latex/src/completion.vala"
	text = _tmp1_;
#line 556 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp2_ = strlen (text);
#line 556 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp3_ = _tmp2_;
#line 556 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp4_ = completion_provider_get_latex_command_at_index (self, text, _tmp3_);
#line 556 "/home/seb/gnome/gnome-latex/src/completion.vala"
	result = _tmp4_;
#line 556 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 (text);
#line 556 "/home/seb/gnome/gnome-latex/src/completion.vala"
	return result;
#line 2716 "completion.c"
}


static gchar*
completion_provider_get_latex_command_at_index (CompletionProvider* self,
                                                const gchar* text,
                                                gint index)
{
	gchar* result = NULL;
	gint _tmp0_;
	gint _tmp1_;
	gint cur_index = 0;
	gunichar cur_char = 0U;
#line 563 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 563 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_val_if_fail (text != NULL, NULL);
#line 565 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp0_ = strlen (text);
#line 565 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp1_ = _tmp0_;
#line 565 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_val_if_fail (index <= _tmp1_, NULL);
#line 567 "/home/seb/gnome/gnome-latex/src/completion.vala"
	cur_index = index;
#line 569 "/home/seb/gnome/gnome-latex/src/completion.vala"
	while (TRUE) {
#line 2744 "completion.c"
		gunichar _tmp2_ = 0U;
		gboolean _tmp3_;
		gunichar _tmp4_;
		gboolean _tmp8_ = FALSE;
		gunichar _tmp9_;
#line 569 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp3_ = string_get_prev_char (text, &cur_index, &_tmp2_);
#line 569 "/home/seb/gnome/gnome-latex/src/completion.vala"
		cur_char = _tmp2_;
#line 569 "/home/seb/gnome/gnome-latex/src/completion.vala"
		if (!_tmp3_) {
#line 569 "/home/seb/gnome/gnome-latex/src/completion.vala"
			break;
#line 2758 "completion.c"
		}
#line 571 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp4_ = cur_char;
#line 571 "/home/seb/gnome/gnome-latex/src/completion.vala"
		if (_tmp4_ == ((gunichar) '\\')) {
#line 2764 "completion.c"
			gint _tmp5_;
			gint _tmp6_;
			gchar* _tmp7_;
#line 574 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp5_ = cur_index;
#line 574 "/home/seb/gnome/gnome-latex/src/completion.vala"
			if (utils_char_is_escaped (text, (glong) _tmp5_)) {
#line 575 "/home/seb/gnome/gnome-latex/src/completion.vala"
				break;
#line 2774 "completion.c"
			}
#line 577 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp6_ = cur_index;
#line 577 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp7_ = string_slice (text, (glong) _tmp6_, (glong) index);
#line 577 "/home/seb/gnome/gnome-latex/src/completion.vala"
			result = _tmp7_;
#line 577 "/home/seb/gnome/gnome-latex/src/completion.vala"
			return result;
#line 2784 "completion.c"
		}
#line 581 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp9_ = cur_char;
#line 581 "/home/seb/gnome/gnome-latex/src/completion.vala"
		if (!g_unichar_isalpha (_tmp9_)) {
#line 2790 "completion.c"
			gunichar _tmp10_;
#line 581 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp10_ = cur_char;
#line 581 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp8_ = _tmp10_ != ((gunichar) '*');
#line 2796 "completion.c"
		} else {
#line 581 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp8_ = FALSE;
#line 2800 "completion.c"
		}
#line 581 "/home/seb/gnome/gnome-latex/src/completion.vala"
		if (_tmp8_) {
#line 582 "/home/seb/gnome/gnome-latex/src/completion.vala"
			break;
#line 2806 "completion.c"
		}
	}
#line 585 "/home/seb/gnome/gnome-latex/src/completion.vala"
	result = NULL;
#line 585 "/home/seb/gnome/gnome-latex/src/completion.vala"
	return result;
#line 2813 "completion.c"
}


static gboolean
completion_provider_in_latex_command_argument (CompletionProvider* self,
                                               GtkTextIter* iter,
                                               CompletionProviderArgumentContext* info)
{
	CompletionProviderArgumentContext _vala_info = {0};
	gboolean result = FALSE;
	GeeArrayList* _tmp0_;
	gchar* text = NULL;
	GtkTextIter _tmp1_;
	gchar* _tmp2_;
	gint last_index = 0;
	const gchar* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	gint cur_index = 0;
	gint _tmp6_;
	gboolean in_prev_arg = FALSE;
	gunichar prev_arg_opening_bracket = 0U;
#line 588 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 588 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_val_if_fail (iter != NULL, FALSE);
#line 590 "/home/seb/gnome/gnome-latex/src/completion.vala"
	completion_provider_argument_context_destroy (&_vala_info);
#line 590 "/home/seb/gnome/gnome-latex/src/completion.vala"
	memset (&_vala_info, 0, sizeof (CompletionProviderArgumentContext));
#line 591 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 (_vala_info.cmd_name);
#line 591 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_vala_info.cmd_name = NULL;
#line 592 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 (_vala_info.arg_contents);
#line 592 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_vala_info.arg_contents = NULL;
#line 593 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp0_ = gee_array_list_new (G_TYPE_BOOLEAN, NULL, NULL, NULL, NULL, NULL);
#line 593 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_object_unref0 (_vala_info.args_types);
#line 593 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_vala_info.args_types = _tmp0_;
#line 595 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp1_ = *iter;
#line 595 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp2_ = completion_provider_get_text_line_to_iter (self, &_tmp1_);
#line 595 "/home/seb/gnome/gnome-latex/src/completion.vala"
	text = _tmp2_;
#line 596 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp3_ = text;
#line 596 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp4_ = strlen (_tmp3_);
#line 596 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp5_ = _tmp4_;
#line 596 "/home/seb/gnome/gnome-latex/src/completion.vala"
	last_index = _tmp5_;
#line 597 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp6_ = last_index;
#line 597 "/home/seb/gnome/gnome-latex/src/completion.vala"
	cur_index = _tmp6_;
#line 600 "/home/seb/gnome/gnome-latex/src/completion.vala"
	while (TRUE) {
#line 2878 "completion.c"
		gunichar cur_char = 0U;
		const gchar* _tmp7_;
		gunichar _tmp8_ = 0U;
		gboolean _tmp9_;
		gboolean _tmp10_ = FALSE;
		gunichar _tmp11_;
		gboolean opening_bracket = FALSE;
		gboolean _tmp13_ = FALSE;
		gboolean _tmp14_;
#line 603 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp7_ = text;
#line 603 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp9_ = string_get_prev_char (_tmp7_, &cur_index, &_tmp8_);
#line 603 "/home/seb/gnome/gnome-latex/src/completion.vala"
		cur_char = _tmp8_;
#line 603 "/home/seb/gnome/gnome-latex/src/completion.vala"
		if (!_tmp9_) {
#line 604 "/home/seb/gnome/gnome-latex/src/completion.vala"
			result = FALSE;
#line 604 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_g_free0 (text);
#line 604 "/home/seb/gnome/gnome-latex/src/completion.vala"
			if (info) {
#line 604 "/home/seb/gnome/gnome-latex/src/completion.vala"
				*info = _vala_info;
#line 2904 "completion.c"
			} else {
#line 604 "/home/seb/gnome/gnome-latex/src/completion.vala"
				completion_provider_argument_context_destroy (&_vala_info);
#line 2908 "completion.c"
			}
#line 604 "/home/seb/gnome/gnome-latex/src/completion.vala"
			return result;
#line 2912 "completion.c"
		}
#line 607 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp11_ = cur_char;
#line 607 "/home/seb/gnome/gnome-latex/src/completion.vala"
		if (_tmp11_ == ((gunichar) '{')) {
#line 607 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp10_ = TRUE;
#line 2920 "completion.c"
		} else {
			gunichar _tmp12_;
#line 607 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp12_ = cur_char;
#line 607 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp10_ = _tmp12_ == ((gunichar) '[');
#line 2927 "completion.c"
		}
#line 607 "/home/seb/gnome/gnome-latex/src/completion.vala"
		opening_bracket = _tmp10_;
#line 608 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp14_ = opening_bracket;
#line 608 "/home/seb/gnome/gnome-latex/src/completion.vala"
		if (_tmp14_) {
#line 2935 "completion.c"
			const gchar* _tmp15_;
			gint _tmp16_;
#line 608 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp15_ = text;
#line 608 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp16_ = cur_index;
#line 608 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp13_ = !utils_char_is_escaped (_tmp15_, (glong) _tmp16_);
#line 2944 "completion.c"
		} else {
#line 608 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp13_ = FALSE;
#line 2948 "completion.c"
		}
#line 608 "/home/seb/gnome/gnome-latex/src/completion.vala"
		if (_tmp13_) {
#line 2952 "completion.c"
			CompletionProviderArgumentContext _tmp17_;
			GeeArrayList* _tmp18_;
			gunichar _tmp19_;
			const gchar* _tmp20_;
			gint _tmp21_;
			gint _tmp22_;
			gchar* _tmp23_;
#line 610 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp17_ = _vala_info;
#line 610 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp18_ = _tmp17_.args_types;
#line 610 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp19_ = cur_char;
#line 610 "/home/seb/gnome/gnome-latex/src/completion.vala"
			gee_abstract_list_insert ((GeeAbstractList*) _tmp18_, 0, (gpointer) ((gintptr) (_tmp19_ == ((gunichar) '['))));
#line 611 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp20_ = text;
#line 611 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp21_ = cur_index;
#line 611 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp22_ = last_index;
#line 611 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp23_ = string_slice (_tmp20_, (glong) (_tmp21_ + 1), (glong) _tmp22_);
#line 611 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_g_free0 (_vala_info.arg_contents);
#line 611 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_vala_info.arg_contents = _tmp23_;
#line 612 "/home/seb/gnome/gnome-latex/src/completion.vala"
			break;
#line 2982 "completion.c"
		}
	}
#line 617 "/home/seb/gnome/gnome-latex/src/completion.vala"
	in_prev_arg = FALSE;
#line 618 "/home/seb/gnome/gnome-latex/src/completion.vala"
	prev_arg_opening_bracket = (gunichar) '{';
#line 620 "/home/seb/gnome/gnome-latex/src/completion.vala"
	while (TRUE) {
#line 2991 "completion.c"
		gunichar cur_char = 0U;
		const gchar* _tmp24_;
		gunichar _tmp25_ = 0U;
		gboolean _tmp26_;
		gboolean _tmp27_;
#line 623 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp24_ = text;
#line 623 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp26_ = string_get_prev_char (_tmp24_, &cur_index, &_tmp25_);
#line 623 "/home/seb/gnome/gnome-latex/src/completion.vala"
		cur_char = _tmp25_;
#line 623 "/home/seb/gnome/gnome-latex/src/completion.vala"
		if (!_tmp26_) {
#line 624 "/home/seb/gnome/gnome-latex/src/completion.vala"
			result = FALSE;
#line 624 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_g_free0 (text);
#line 624 "/home/seb/gnome/gnome-latex/src/completion.vala"
			if (info) {
#line 624 "/home/seb/gnome/gnome-latex/src/completion.vala"
				*info = _vala_info;
#line 3013 "completion.c"
			} else {
#line 624 "/home/seb/gnome/gnome-latex/src/completion.vala"
				completion_provider_argument_context_destroy (&_vala_info);
#line 3017 "completion.c"
			}
#line 624 "/home/seb/gnome/gnome-latex/src/completion.vala"
			return result;
#line 3021 "completion.c"
		}
#line 627 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp27_ = in_prev_arg;
#line 627 "/home/seb/gnome/gnome-latex/src/completion.vala"
		if (_tmp27_) {
#line 3027 "completion.c"
			gunichar _tmp28_;
			gunichar _tmp29_;
#line 629 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp28_ = cur_char;
#line 629 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp29_ = prev_arg_opening_bracket;
#line 629 "/home/seb/gnome/gnome-latex/src/completion.vala"
			if (_tmp28_ == _tmp29_) {
#line 3036 "completion.c"
				const gchar* _tmp30_;
				gint _tmp31_;
#line 630 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp30_ = text;
#line 630 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp31_ = cur_index;
#line 630 "/home/seb/gnome/gnome-latex/src/completion.vala"
				in_prev_arg = utils_char_is_escaped (_tmp30_, (glong) _tmp31_);
#line 3045 "completion.c"
			}
		} else {
			gboolean _tmp32_ = FALSE;
			gunichar _tmp33_;
#line 634 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp33_ = cur_char;
#line 634 "/home/seb/gnome/gnome-latex/src/completion.vala"
			if (_tmp33_ == ((gunichar) '}')) {
#line 634 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp32_ = TRUE;
#line 3056 "completion.c"
			} else {
				gunichar _tmp34_;
#line 634 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp34_ = cur_char;
#line 634 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp32_ = _tmp34_ == ((gunichar) ']');
#line 3063 "completion.c"
			}
#line 634 "/home/seb/gnome/gnome-latex/src/completion.vala"
			if (_tmp32_) {
#line 3067 "completion.c"
				const gchar* _tmp35_;
				gint _tmp36_;
				gchar _tmp37_ = '\0';
				gunichar _tmp38_;
				CompletionProviderArgumentContext _tmp39_;
				GeeArrayList* _tmp40_;
				gunichar _tmp41_;
#line 636 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp35_ = text;
#line 636 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp36_ = cur_index;
#line 636 "/home/seb/gnome/gnome-latex/src/completion.vala"
				if (utils_char_is_escaped (_tmp35_, (glong) _tmp36_)) {
#line 637 "/home/seb/gnome/gnome-latex/src/completion.vala"
					result = FALSE;
#line 637 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_g_free0 (text);
#line 637 "/home/seb/gnome/gnome-latex/src/completion.vala"
					if (info) {
#line 637 "/home/seb/gnome/gnome-latex/src/completion.vala"
						*info = _vala_info;
#line 3089 "completion.c"
					} else {
#line 637 "/home/seb/gnome/gnome-latex/src/completion.vala"
						completion_provider_argument_context_destroy (&_vala_info);
#line 3093 "completion.c"
					}
#line 637 "/home/seb/gnome/gnome-latex/src/completion.vala"
					return result;
#line 3097 "completion.c"
				}
#line 639 "/home/seb/gnome/gnome-latex/src/completion.vala"
				in_prev_arg = TRUE;
#line 640 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp38_ = cur_char;
#line 640 "/home/seb/gnome/gnome-latex/src/completion.vala"
				if (_tmp38_ == ((gunichar) '}')) {
#line 640 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp37_ = '{';
#line 3107 "completion.c"
				} else {
#line 640 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp37_ = '[';
#line 3111 "completion.c"
				}
#line 640 "/home/seb/gnome/gnome-latex/src/completion.vala"
				prev_arg_opening_bracket = (gunichar) _tmp37_;
#line 642 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp39_ = _vala_info;
#line 642 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp40_ = _tmp39_.args_types;
#line 642 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp41_ = cur_char;
#line 642 "/home/seb/gnome/gnome-latex/src/completion.vala"
				gee_abstract_list_insert ((GeeAbstractList*) _tmp40_, 0, (gpointer) ((gintptr) (_tmp41_ == ((gunichar) ']'))));
#line 3123 "completion.c"
			} else {
				gboolean _tmp42_ = FALSE;
				gunichar _tmp43_;
#line 646 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp43_ = cur_char;
#line 646 "/home/seb/gnome/gnome-latex/src/completion.vala"
				if (g_unichar_isalpha (_tmp43_)) {
#line 646 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp42_ = TRUE;
#line 3133 "completion.c"
				} else {
					gunichar _tmp44_;
#line 646 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp44_ = cur_char;
#line 646 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp42_ = _tmp44_ == ((gunichar) '*');
#line 3140 "completion.c"
				}
#line 646 "/home/seb/gnome/gnome-latex/src/completion.vala"
				if (_tmp42_) {
#line 3144 "completion.c"
					const gchar* _tmp45_;
					gint _tmp46_;
					gchar* _tmp47_;
					CompletionProviderArgumentContext _tmp48_;
					const gchar* _tmp49_;
#line 648 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp45_ = text;
#line 648 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp46_ = cur_index;
#line 648 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp47_ = completion_provider_get_latex_command_at_index (self, _tmp45_, _tmp46_ + 1);
#line 648 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_g_free0 (_vala_info.cmd_name);
#line 648 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_vala_info.cmd_name = _tmp47_;
#line 649 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp48_ = _vala_info;
#line 649 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp49_ = _tmp48_.cmd_name;
#line 649 "/home/seb/gnome/gnome-latex/src/completion.vala"
					result = _tmp49_ != NULL;
#line 649 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_g_free0 (text);
#line 649 "/home/seb/gnome/gnome-latex/src/completion.vala"
					if (info) {
#line 649 "/home/seb/gnome/gnome-latex/src/completion.vala"
						*info = _vala_info;
#line 3172 "completion.c"
					} else {
#line 649 "/home/seb/gnome/gnome-latex/src/completion.vala"
						completion_provider_argument_context_destroy (&_vala_info);
#line 3176 "completion.c"
					}
#line 649 "/home/seb/gnome/gnome-latex/src/completion.vala"
					return result;
#line 3180 "completion.c"
				} else {
					gunichar _tmp50_;
#line 653 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp50_ = cur_char;
#line 653 "/home/seb/gnome/gnome-latex/src/completion.vala"
					if (!g_unichar_isspace (_tmp50_)) {
#line 654 "/home/seb/gnome/gnome-latex/src/completion.vala"
						result = FALSE;
#line 654 "/home/seb/gnome/gnome-latex/src/completion.vala"
						_g_free0 (text);
#line 654 "/home/seb/gnome/gnome-latex/src/completion.vala"
						if (info) {
#line 654 "/home/seb/gnome/gnome-latex/src/completion.vala"
							*info = _vala_info;
#line 3195 "completion.c"
						} else {
#line 654 "/home/seb/gnome/gnome-latex/src/completion.vala"
							completion_provider_argument_context_destroy (&_vala_info);
#line 3199 "completion.c"
						}
#line 654 "/home/seb/gnome/gnome-latex/src/completion.vala"
						return result;
#line 3203 "completion.c"
					}
				}
			}
		}
	}
#line 588 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 (text);
#line 588 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (info) {
#line 588 "/home/seb/gnome/gnome-latex/src/completion.vala"
		*info = _vala_info;
#line 3215 "completion.c"
	} else {
#line 588 "/home/seb/gnome/gnome-latex/src/completion.vala"
		completion_provider_argument_context_destroy (&_vala_info);
#line 3219 "completion.c"
	}
}


/*************************************************************************/
static gboolean
completion_provider_is_user_request (CompletionProvider* self,
                                     GtkSourceCompletionContext* context)
{
	gboolean result = FALSE;
	GtkSourceCompletionActivation _tmp0_;
	GtkSourceCompletionActivation _tmp1_;
#line 661 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 661 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_val_if_fail (context != NULL, FALSE);
#line 663 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_object_get (context, "activation", &_tmp0_, NULL);
#line 663 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp1_ = _tmp0_;
#line 663 "/home/seb/gnome/gnome-latex/src/completion.vala"
	result = _tmp1_ == GTK_SOURCE_COMPLETION_ACTIVATION_USER_REQUESTED;
#line 663 "/home/seb/gnome/gnome-latex/src/completion.vala"
	return result;
#line 3244 "completion.c"
}


static gint
completion_provider_compare_proposals (GtkSourceCompletionItem* a,
                                       GtkSourceCompletionItem* b)
{
	gint result = 0;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gint _tmp6_;
#line 668 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_val_if_fail (a != NULL, 0);
#line 668 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_val_if_fail (b != NULL, 0);
#line 670 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_object_get (a, "text", &_tmp0_, NULL);
#line 670 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp1_ = _tmp0_;
#line 670 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp2_ = _tmp1_;
#line 670 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_object_get (b, "text", &_tmp3_, NULL);
#line 670 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp4_ = _tmp3_;
#line 670 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp5_ = _tmp4_;
#line 670 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp6_ = g_utf8_collate (_tmp2_, _tmp5_);
#line 670 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 (_tmp5_);
#line 670 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 (_tmp2_);
#line 670 "/home/seb/gnome/gnome-latex/src/completion.vala"
	result = _tmp6_;
#line 670 "/home/seb/gnome/gnome-latex/src/completion.vala"
	return result;
#line 3286 "completion.c"
}


static gchar*
completion_provider_get_text_line_to_iter (CompletionProvider* self,
                                           GtkTextIter* iter)
{
	gchar* result = NULL;
	gint line = 0;
	GtkTextBuffer* doc = NULL;
	GtkTextBuffer* _tmp0_;
	GtkTextBuffer* _tmp1_;
	GtkTextIter iter_start = {0};
	GtkTextIter _tmp2_ = {0};
	GtkTextIter _tmp3_;
	GtkTextIter _tmp4_;
	gchar* _tmp5_;
#line 674 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 674 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_val_if_fail (iter != NULL, NULL);
#line 676 "/home/seb/gnome/gnome-latex/src/completion.vala"
	line = gtk_text_iter_get_line (iter);
#line 677 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp0_ = gtk_text_iter_get_buffer (iter);
#line 677 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp1_ = _g_object_ref0 (_tmp0_);
#line 677 "/home/seb/gnome/gnome-latex/src/completion.vala"
	doc = _tmp1_;
#line 680 "/home/seb/gnome/gnome-latex/src/completion.vala"
	gtk_text_buffer_get_iter_at_line (doc, &_tmp2_, line);
#line 680 "/home/seb/gnome/gnome-latex/src/completion.vala"
	iter_start = _tmp2_;
#line 682 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp3_ = iter_start;
#line 682 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp4_ = *iter;
#line 682 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp5_ = gtk_text_buffer_get_text (doc, &_tmp3_, &_tmp4_, FALSE);
#line 682 "/home/seb/gnome/gnome-latex/src/completion.vala"
	result = _tmp5_;
#line 682 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_object_unref0 (doc);
#line 682 "/home/seb/gnome/gnome-latex/src/completion.vala"
	return result;
#line 3332 "completion.c"
}


static gchar*
completion_provider_get_command_info (CompletionProvider* self,
                                      CompletionProviderCompletionCommand* cmd,
                                      gint cur_arg)
{
	gchar* result = NULL;
	gchar* info = NULL;
	CompletionProviderCompletionCommand _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gint arg_num = 0;
	CompletionProviderCompletionCommand _tmp3_;
	CompletionProviderCompletionArgument* _tmp4_;
	gint _tmp4__length1;
	CompletionProviderCompletionCommand _tmp31_;
	const gchar* _tmp32_;
#line 688 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 688 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_val_if_fail (cmd != NULL, NULL);
#line 690 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp0_ = *cmd;
#line 690 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp1_ = _tmp0_.name;
#line 690 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp2_ = g_strdup (_tmp1_);
#line 690 "/home/seb/gnome/gnome-latex/src/completion.vala"
	info = _tmp2_;
#line 691 "/home/seb/gnome/gnome-latex/src/completion.vala"
	arg_num = 1;
#line 692 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp3_ = *cmd;
#line 692 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp4_ = _tmp3_.args;
#line 692 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp4__length1 = _tmp3_.args_length1;
#line 3372 "completion.c"
	{
		CompletionProviderCompletionArgument* arg_collection = NULL;
		gint arg_collection_length1 = 0;
		gint _arg_collection_size_ = 0;
		gint arg_it = 0;
#line 692 "/home/seb/gnome/gnome-latex/src/completion.vala"
		arg_collection = _tmp4_;
#line 692 "/home/seb/gnome/gnome-latex/src/completion.vala"
		arg_collection_length1 = _tmp4__length1;
#line 692 "/home/seb/gnome/gnome-latex/src/completion.vala"
		for (arg_it = 0; arg_it < _tmp4__length1; arg_it = arg_it + 1) {
#line 3384 "completion.c"
			CompletionProviderCompletionArgument _tmp5_ = {0};
			CompletionProviderCompletionArgument arg = {0};
#line 692 "/home/seb/gnome/gnome-latex/src/completion.vala"
			completion_provider_completion_argument_copy (&arg_collection[arg_it], &_tmp5_);
#line 692 "/home/seb/gnome/gnome-latex/src/completion.vala"
			arg = _tmp5_;
#line 3391 "completion.c"
			{
				gint _tmp6_;
				CompletionProviderCompletionArgument _tmp9_;
				gboolean _tmp10_;
				gint _tmp27_;
				gint _tmp30_;
#line 694 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp6_ = arg_num;
#line 694 "/home/seb/gnome/gnome-latex/src/completion.vala"
				if (_tmp6_ == cur_arg) {
#line 3402 "completion.c"
					const gchar* _tmp7_;
					gchar* _tmp8_;
#line 695 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp7_ = info;
#line 695 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp8_ = g_strconcat (_tmp7_, "<b>", NULL);
#line 695 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_g_free0 (info);
#line 695 "/home/seb/gnome/gnome-latex/src/completion.vala"
					info = _tmp8_;
#line 3413 "completion.c"
				}
#line 697 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp9_ = arg;
#line 697 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp10_ = _tmp9_.optional;
#line 697 "/home/seb/gnome/gnome-latex/src/completion.vala"
				if (_tmp10_) {
#line 3421 "completion.c"
					const gchar* _tmp11_;
					CompletionProviderCompletionArgument _tmp12_;
					const gchar* _tmp13_;
					gchar* _tmp14_;
					gchar* _tmp15_;
					gchar* _tmp16_;
					gchar* _tmp17_;
					gchar* _tmp18_;
#line 698 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp11_ = info;
#line 698 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp12_ = arg;
#line 698 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp13_ = _tmp12_.label;
#line 698 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp14_ = g_strconcat ("[", _tmp13_, NULL);
#line 698 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp15_ = _tmp14_;
#line 698 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp16_ = g_strconcat (_tmp15_, "]", NULL);
#line 698 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp17_ = _tmp16_;
#line 698 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp18_ = g_strconcat (_tmp11_, _tmp17_, NULL);
#line 698 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_g_free0 (info);
#line 698 "/home/seb/gnome/gnome-latex/src/completion.vala"
					info = _tmp18_;
#line 698 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_g_free0 (_tmp17_);
#line 698 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_g_free0 (_tmp15_);
#line 3454 "completion.c"
				} else {
					const gchar* _tmp19_;
					CompletionProviderCompletionArgument _tmp20_;
					const gchar* _tmp21_;
					gchar* _tmp22_;
					gchar* _tmp23_;
					gchar* _tmp24_;
					gchar* _tmp25_;
					gchar* _tmp26_;
#line 700 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp19_ = info;
#line 700 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp20_ = arg;
#line 700 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp21_ = _tmp20_.label;
#line 700 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp22_ = g_strconcat ("{", _tmp21_, NULL);
#line 700 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp23_ = _tmp22_;
#line 700 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp24_ = g_strconcat (_tmp23_, "}", NULL);
#line 700 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp25_ = _tmp24_;
#line 700 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp26_ = g_strconcat (_tmp19_, _tmp25_, NULL);
#line 700 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_g_free0 (info);
#line 700 "/home/seb/gnome/gnome-latex/src/completion.vala"
					info = _tmp26_;
#line 700 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_g_free0 (_tmp25_);
#line 700 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_g_free0 (_tmp23_);
#line 3488 "completion.c"
				}
#line 702 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp27_ = arg_num;
#line 702 "/home/seb/gnome/gnome-latex/src/completion.vala"
				if (_tmp27_ == cur_arg) {
#line 3494 "completion.c"
					const gchar* _tmp28_;
					gchar* _tmp29_;
#line 703 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp28_ = info;
#line 703 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp29_ = g_strconcat (_tmp28_, "</b>", NULL);
#line 703 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_g_free0 (info);
#line 703 "/home/seb/gnome/gnome-latex/src/completion.vala"
					info = _tmp29_;
#line 3505 "completion.c"
				}
#line 705 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp30_ = arg_num;
#line 705 "/home/seb/gnome/gnome-latex/src/completion.vala"
				arg_num = _tmp30_ + 1;
#line 692 "/home/seb/gnome/gnome-latex/src/completion.vala"
				completion_provider_completion_argument_destroy (&arg);
#line 3513 "completion.c"
			}
		}
	}
#line 708 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp31_ = *cmd;
#line 708 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp32_ = _tmp31_.package;
#line 708 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (_tmp32_ != NULL) {
#line 3523 "completion.c"
		const gchar* _tmp33_;
		CompletionProviderCompletionCommand _tmp34_;
		const gchar* _tmp35_;
		gchar* _tmp36_;
		gchar* _tmp37_;
		gchar* _tmp38_;
#line 709 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp33_ = info;
#line 709 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp34_ = *cmd;
#line 709 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp35_ = _tmp34_.package;
#line 709 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp36_ = g_strconcat ("\nPackage: ", _tmp35_, NULL);
#line 709 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp37_ = _tmp36_;
#line 709 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp38_ = g_strconcat (_tmp33_, _tmp37_, NULL);
#line 709 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_g_free0 (info);
#line 709 "/home/seb/gnome/gnome-latex/src/completion.vala"
		info = _tmp38_;
#line 709 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_g_free0 (_tmp37_);
#line 3548 "completion.c"
	}
#line 711 "/home/seb/gnome/gnome-latex/src/completion.vala"
	result = info;
#line 711 "/home/seb/gnome/gnome-latex/src/completion.vala"
	return result;
#line 3554 "completion.c"
}


static gint
completion_provider_get_argument_num (CompletionProvider* self,
                                      CompletionProviderCompletionArgument* all_args,
                                      int all_args_length1,
                                      GeeArrayList* args)
{
	gint result = 0;
	gint _tmp0_;
	gint _tmp1_;
	gint num = 0;
#line 719 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_val_if_fail (self != NULL, 0);
#line 719 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_val_if_fail (args != NULL, 0);
#line 722 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp0_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) args);
#line 722 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp1_ = _tmp0_;
#line 722 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (all_args_length1 < _tmp1_) {
#line 723 "/home/seb/gnome/gnome-latex/src/completion.vala"
		result = -1;
#line 723 "/home/seb/gnome/gnome-latex/src/completion.vala"
		return result;
#line 3582 "completion.c"
	}
#line 725 "/home/seb/gnome/gnome-latex/src/completion.vala"
	num = 0;
#line 3586 "completion.c"
	{
		GeeArrayList* _arg_list = NULL;
		GeeArrayList* _tmp2_;
		gint _arg_size = 0;
		GeeArrayList* _tmp3_;
		gint _tmp4_;
		gint _tmp5_;
		gint _arg_index = 0;
#line 726 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp2_ = _g_object_ref0 (args);
#line 726 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_arg_list = _tmp2_;
#line 726 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp3_ = _arg_list;
#line 726 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp4_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp3_);
#line 726 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp5_ = _tmp4_;
#line 726 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_arg_size = _tmp5_;
#line 726 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_arg_index = -1;
#line 726 "/home/seb/gnome/gnome-latex/src/completion.vala"
		while (TRUE) {
#line 3611 "completion.c"
			gint _tmp6_;
			gint _tmp7_;
			gint _tmp8_;
			gboolean arg = FALSE;
			GeeArrayList* _tmp9_;
			gint _tmp10_;
			gpointer _tmp11_;
			gint _tmp21_;
#line 726 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp6_ = _arg_index;
#line 726 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_arg_index = _tmp6_ + 1;
#line 726 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp7_ = _arg_index;
#line 726 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp8_ = _arg_size;
#line 726 "/home/seb/gnome/gnome-latex/src/completion.vala"
			if (!(_tmp7_ < _tmp8_)) {
#line 726 "/home/seb/gnome/gnome-latex/src/completion.vala"
				break;
#line 3632 "completion.c"
			}
#line 726 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp9_ = _arg_list;
#line 726 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp10_ = _arg_index;
#line 726 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp11_ = gee_abstract_list_get ((GeeAbstractList*) _tmp9_, _tmp10_);
#line 726 "/home/seb/gnome/gnome-latex/src/completion.vala"
			arg = (gboolean) ((gintptr) _tmp11_);
#line 728 "/home/seb/gnome/gnome-latex/src/completion.vala"
			while (TRUE) {
#line 3644 "completion.c"
				gint _tmp12_;
				gint _tmp13_;
				CompletionProviderCompletionArgument _tmp14_;
				gboolean _tmp15_;
				gboolean _tmp16_;
				gint _tmp20_;
#line 730 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp12_ = num;
#line 730 "/home/seb/gnome/gnome-latex/src/completion.vala"
				if (all_args_length1 <= _tmp12_) {
#line 731 "/home/seb/gnome/gnome-latex/src/completion.vala"
					result = -1;
#line 731 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_g_object_unref0 (_arg_list);
#line 731 "/home/seb/gnome/gnome-latex/src/completion.vala"
					return result;
#line 3661 "completion.c"
				}
#line 733 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp13_ = num;
#line 733 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp14_ = all_args[_tmp13_];
#line 733 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp15_ = _tmp14_.optional;
#line 733 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp16_ = arg;
#line 733 "/home/seb/gnome/gnome-latex/src/completion.vala"
				if (_tmp15_ == _tmp16_) {
#line 734 "/home/seb/gnome/gnome-latex/src/completion.vala"
					break;
#line 3675 "completion.c"
				} else {
					gint _tmp17_;
					CompletionProviderCompletionArgument _tmp18_;
					gboolean _tmp19_;
#line 737 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp17_ = num;
#line 737 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp18_ = all_args[_tmp17_];
#line 737 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp19_ = _tmp18_.optional;
#line 737 "/home/seb/gnome/gnome-latex/src/completion.vala"
					if (!_tmp19_) {
#line 738 "/home/seb/gnome/gnome-latex/src/completion.vala"
						result = -1;
#line 738 "/home/seb/gnome/gnome-latex/src/completion.vala"
						_g_object_unref0 (_arg_list);
#line 738 "/home/seb/gnome/gnome-latex/src/completion.vala"
						return result;
#line 3694 "completion.c"
					}
				}
#line 740 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp20_ = num;
#line 740 "/home/seb/gnome/gnome-latex/src/completion.vala"
				num = _tmp20_ + 1;
#line 3701 "completion.c"
			}
#line 742 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp21_ = num;
#line 742 "/home/seb/gnome/gnome-latex/src/completion.vala"
			num = _tmp21_ + 1;
#line 3707 "completion.c"
		}
#line 726 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_g_object_unref0 (_arg_list);
#line 3711 "completion.c"
	}
#line 746 "/home/seb/gnome/gnome-latex/src/completion.vala"
	result = num;
#line 746 "/home/seb/gnome/gnome-latex/src/completion.vala"
	return result;
#line 3717 "completion.c"
}


static gchar*
completion_provider_get_command_text_to_insert (CompletionProvider* self,
                                                CompletionProviderCompletionCommand* cmd)
{
	gchar* result = NULL;
	gchar* text_to_insert = NULL;
	CompletionProviderCompletionCommand _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	CompletionProviderCompletionCommand _tmp3_;
	CompletionProviderCompletionArgument* _tmp4_;
	gint _tmp4__length1;
#line 749 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 749 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_val_if_fail (cmd != NULL, NULL);
#line 751 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp0_ = *cmd;
#line 751 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp1_ = _tmp0_.name;
#line 751 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp2_ = g_strdup (_tmp1_);
#line 751 "/home/seb/gnome/gnome-latex/src/completion.vala"
	text_to_insert = _tmp2_;
#line 752 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp3_ = *cmd;
#line 752 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp4_ = _tmp3_.args;
#line 752 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp4__length1 = _tmp3_.args_length1;
#line 3751 "completion.c"
	{
		CompletionProviderCompletionArgument* arg_collection = NULL;
		gint arg_collection_length1 = 0;
		gint _arg_collection_size_ = 0;
		gint arg_it = 0;
#line 752 "/home/seb/gnome/gnome-latex/src/completion.vala"
		arg_collection = _tmp4_;
#line 752 "/home/seb/gnome/gnome-latex/src/completion.vala"
		arg_collection_length1 = _tmp4__length1;
#line 752 "/home/seb/gnome/gnome-latex/src/completion.vala"
		for (arg_it = 0; arg_it < _tmp4__length1; arg_it = arg_it + 1) {
#line 3763 "completion.c"
			CompletionProviderCompletionArgument _tmp5_ = {0};
			CompletionProviderCompletionArgument arg = {0};
#line 752 "/home/seb/gnome/gnome-latex/src/completion.vala"
			completion_provider_completion_argument_copy (&arg_collection[arg_it], &_tmp5_);
#line 752 "/home/seb/gnome/gnome-latex/src/completion.vala"
			arg = _tmp5_;
#line 3770 "completion.c"
			{
				CompletionProviderCompletionArgument _tmp6_;
				gboolean _tmp7_;
#line 754 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp6_ = arg;
#line 754 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp7_ = _tmp6_.optional;
#line 754 "/home/seb/gnome/gnome-latex/src/completion.vala"
				if (!_tmp7_) {
#line 3780 "completion.c"
					const gchar* _tmp8_;
					gchar* _tmp9_;
#line 755 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp8_ = text_to_insert;
#line 755 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp9_ = g_strconcat (_tmp8_, "{}", NULL);
#line 755 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_g_free0 (text_to_insert);
#line 755 "/home/seb/gnome/gnome-latex/src/completion.vala"
					text_to_insert = _tmp9_;
#line 3791 "completion.c"
				}
#line 752 "/home/seb/gnome/gnome-latex/src/completion.vala"
				completion_provider_completion_argument_destroy (&arg);
#line 3795 "completion.c"
			}
		}
	}
#line 757 "/home/seb/gnome/gnome-latex/src/completion.vala"
	result = text_to_insert;
#line 757 "/home/seb/gnome/gnome-latex/src/completion.vala"
	return result;
#line 3803 "completion.c"
}


/*************************************************************************/
static void
_completion_provider_parser_start_gmarkup_parser_start_element_func (GMarkupParseContext* context,
                                                                     const gchar* element_name,
                                                                     gchar** attribute_names,
                                                                     gchar** attribute_values,
                                                                     gpointer self,
                                                                     GError** error)
{
#line 797 "/home/seb/gnome/gnome-latex/src/completion.vala"
	completion_provider_parser_start ((CompletionProvider*) self, context, element_name, attribute_names, _vala_array_length (attribute_names), attribute_values, _vala_array_length (attribute_values), error);
#line 3818 "completion.c"
}


static void
_completion_provider_parser_end_gmarkup_parser_end_element_func (GMarkupParseContext* context,
                                                                 const gchar* element_name,
                                                                 gpointer self,
                                                                 GError** error)
{
#line 797 "/home/seb/gnome/gnome-latex/src/completion.vala"
	completion_provider_parser_end ((CompletionProvider*) self, context, element_name, error);
#line 3830 "completion.c"
}


static void
_completion_provider_parser_text_gmarkup_parser_text_func (GMarkupParseContext* context,
                                                           const gchar* text,
                                                           gsize text_len,
                                                           gpointer self,
                                                           GError** error)
{
#line 797 "/home/seb/gnome/gnome-latex/src/completion.vala"
	completion_provider_parser_text ((CompletionProvider*) self, context, text, text_len, error);
#line 3843 "completion.c"
}


static void
completion_provider_load_data (CompletionProvider* self)
{
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	GFile* file = NULL;
	gchar* _tmp2_;
	gchar* _tmp3_;
	GFile* _tmp4_;
	GFile* _tmp5_;
	gchar* contents = NULL;
	GFile* _tmp6_;
	gchar* _tmp7_;
	const gchar* _tmp8_;
	GError * _inner_error_ = NULL;
#line 783 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (self != NULL);
#line 785 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, COMPLETION_PROVIDER_TYPE_COMPLETION_COMMAND, (GBoxedCopyFunc) completion_provider_completion_command_dup, (GDestroyNotify) completion_provider_completion_command_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
#line 785 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_object_unref0 (self->priv->_commands);
#line 785 "/home/seb/gnome/gnome-latex/src/completion.vala"
	self->priv->_commands = _tmp0_;
#line 786 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp1_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, COMPLETION_PROVIDER_TYPE_COMPLETION_CHOICE, (GBoxedCopyFunc) completion_provider_completion_choice_dup, (GDestroyNotify) completion_provider_completion_choice_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
#line 786 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_object_unref0 (self->priv->_environments);
#line 786 "/home/seb/gnome/gnome-latex/src/completion.vala"
	self->priv->_environments = _tmp1_;
#line 788 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp2_ = g_build_filename (DATA_DIR, "completion.xml", NULL);
#line 788 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp3_ = _tmp2_;
#line 788 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp4_ = g_file_new_for_path (_tmp3_);
#line 788 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp5_ = _tmp4_;
#line 788 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 (_tmp3_);
#line 788 "/home/seb/gnome/gnome-latex/src/completion.vala"
	file = _tmp5_;
#line 791 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp6_ = file;
#line 791 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp7_ = utils_load_file (_tmp6_);
#line 791 "/home/seb/gnome/gnome-latex/src/completion.vala"
	contents = _tmp7_;
#line 792 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp8_ = contents;
#line 792 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (_tmp8_ == NULL) {
#line 793 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_g_free0 (contents);
#line 793 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_g_object_unref0 (file);
#line 793 "/home/seb/gnome/gnome-latex/src/completion.vala"
		return;
#line 3904 "completion.c"
	}
	{
		GMarkupParser parser = {0};
		GMarkupParser _tmp9_ = {0};
		GMarkupParseContext* context = NULL;
		GMarkupParser _tmp10_;
		GMarkupParseContext* _tmp11_;
		GMarkupParseContext* _tmp12_;
		const gchar* _tmp13_;
#line 797 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp9_.start_element = _completion_provider_parser_start_gmarkup_parser_start_element_func;
#line 797 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp9_.end_element = _completion_provider_parser_end_gmarkup_parser_end_element_func;
#line 797 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp9_.text = _completion_provider_parser_text_gmarkup_parser_text_func;
#line 797 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp9_.passthrough = NULL;
#line 797 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp9_.error = NULL;
#line 797 "/home/seb/gnome/gnome-latex/src/completion.vala"
		parser = _tmp9_;
#line 798 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp10_ = parser;
#line 798 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp11_ = g_markup_parse_context_new (&_tmp10_, 0, self, NULL);
#line 798 "/home/seb/gnome/gnome-latex/src/completion.vala"
		context = _tmp11_;
#line 799 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp12_ = context;
#line 799 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp13_ = contents;
#line 799 "/home/seb/gnome/gnome-latex/src/completion.vala"
		g_markup_parse_context_parse (_tmp12_, _tmp13_, (gssize) -1, &_inner_error_);
#line 799 "/home/seb/gnome/gnome-latex/src/completion.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 799 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_g_markup_parse_context_unref0 (context);
#line 3942 "completion.c"
			goto __catch2_g_error;
		}
#line 800 "/home/seb/gnome/gnome-latex/src/completion.vala"
		self->priv->_proposals = g_list_sort (self->priv->_proposals, (GCompareFunc) completion_provider_compare_proposals);
#line 795 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_g_markup_parse_context_unref0 (context);
#line 3949 "completion.c"
	}
	goto __finally2;
	__catch2_g_error:
	{
		GError* e = NULL;
		GError* _tmp14_;
		const gchar* _tmp15_;
#line 795 "/home/seb/gnome/gnome-latex/src/completion.vala"
		e = _inner_error_;
#line 795 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_inner_error_ = NULL;
#line 804 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp14_ = e;
#line 804 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_tmp15_ = _tmp14_->message;
#line 804 "/home/seb/gnome/gnome-latex/src/completion.vala"
		g_warning ("completion.vala:804: Impossible to load completion data: %s", _tmp15_);
#line 795 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_g_error_free0 (e);
#line 3969 "completion.c"
	}
	__finally2:
#line 795 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 795 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_g_free0 (contents);
#line 795 "/home/seb/gnome/gnome-latex/src/completion.vala"
		_g_object_unref0 (file);
#line 795 "/home/seb/gnome/gnome-latex/src/completion.vala"
		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 795 "/home/seb/gnome/gnome-latex/src/completion.vala"
		g_clear_error (&_inner_error_);
#line 795 "/home/seb/gnome/gnome-latex/src/completion.vala"
		return;
#line 3984 "completion.c"
	}
#line 783 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 (contents);
#line 783 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_object_unref0 (file);
#line 3990 "completion.c"
}


static void
completion_provider_parser_start (CompletionProvider* self,
                                  GMarkupParseContext* context,
                                  const gchar* name,
                                  gchar** attr_names,
                                  int attr_names_length1,
                                  gchar** attr_values,
                                  int attr_values_length1,
                                  GError** error)
{
	const gchar* _tmp0_;
	GQuark _tmp2_ = 0U;
#line 811 "/home/seb/gnome/gnome-latex/src/completion.vala"
	static GQuark _tmp1_label0 = 0;
#line 811 "/home/seb/gnome/gnome-latex/src/completion.vala"
	static GQuark _tmp1_label1 = 0;
#line 811 "/home/seb/gnome/gnome-latex/src/completion.vala"
	static GQuark _tmp1_label2 = 0;
#line 811 "/home/seb/gnome/gnome-latex/src/completion.vala"
	static GQuark _tmp1_label3 = 0;
#line 811 "/home/seb/gnome/gnome-latex/src/completion.vala"
	static GQuark _tmp1_label4 = 0;
#line 811 "/home/seb/gnome/gnome-latex/src/completion.vala"
	static GQuark _tmp1_label5 = 0;
#line 811 "/home/seb/gnome/gnome-latex/src/completion.vala"
	static GQuark _tmp1_label6 = 0;
#line 811 "/home/seb/gnome/gnome-latex/src/completion.vala"
	static GQuark _tmp1_label7 = 0;
#line 4022 "completion.c"
	GError * _inner_error_ = NULL;
#line 808 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (self != NULL);
#line 808 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (context != NULL);
#line 808 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (name != NULL);
#line 811 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp0_ = name;
#line 811 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp2_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_);
#line 811 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (_tmp2_ == ((0 != _tmp1_label0) ? _tmp1_label0 : (_tmp1_label0 = g_quark_from_static_string ("commands")))) {
#line 811 "/home/seb/gnome/gnome-latex/src/completion.vala"
		switch (0) {
#line 4038 "completion.c"
			default:
			{
#line 814 "/home/seb/gnome/gnome-latex/src/completion.vala"
				break;
#line 4043 "completion.c"
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label1) ? _tmp1_label1 : (_tmp1_label1 = g_quark_from_static_string ("command")))) {
#line 811 "/home/seb/gnome/gnome-latex/src/completion.vala"
		switch (0) {
#line 4049 "completion.c"
			default:
			{
#line 817 "/home/seb/gnome/gnome-latex/src/completion.vala"
				completion_provider_parser_add_command (self, attr_names, attr_names_length1, attr_values, attr_values_length1, &_inner_error_);
#line 817 "/home/seb/gnome/gnome-latex/src/completion.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 817 "/home/seb/gnome/gnome-latex/src/completion.vala"
					if (_inner_error_->domain == G_MARKUP_ERROR) {
#line 817 "/home/seb/gnome/gnome-latex/src/completion.vala"
						g_propagate_error (error, _inner_error_);
#line 817 "/home/seb/gnome/gnome-latex/src/completion.vala"
						return;
#line 4062 "completion.c"
					} else {
#line 817 "/home/seb/gnome/gnome-latex/src/completion.vala"
						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 817 "/home/seb/gnome/gnome-latex/src/completion.vala"
						g_clear_error (&_inner_error_);
#line 817 "/home/seb/gnome/gnome-latex/src/completion.vala"
						return;
#line 4070 "completion.c"
					}
				}
#line 818 "/home/seb/gnome/gnome-latex/src/completion.vala"
				break;
#line 4075 "completion.c"
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label2) ? _tmp1_label2 : (_tmp1_label2 = g_quark_from_static_string ("argument")))) {
#line 811 "/home/seb/gnome/gnome-latex/src/completion.vala"
		switch (0) {
#line 4081 "completion.c"
			default:
			{
#line 821 "/home/seb/gnome/gnome-latex/src/completion.vala"
				completion_provider_parser_add_argument (self, attr_names, attr_names_length1, attr_values, attr_values_length1, &_inner_error_);
#line 821 "/home/seb/gnome/gnome-latex/src/completion.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 821 "/home/seb/gnome/gnome-latex/src/completion.vala"
					if (_inner_error_->domain == G_MARKUP_ERROR) {
#line 821 "/home/seb/gnome/gnome-latex/src/completion.vala"
						g_propagate_error (error, _inner_error_);
#line 821 "/home/seb/gnome/gnome-latex/src/completion.vala"
						return;
#line 4094 "completion.c"
					} else {
#line 821 "/home/seb/gnome/gnome-latex/src/completion.vala"
						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 821 "/home/seb/gnome/gnome-latex/src/completion.vala"
						g_clear_error (&_inner_error_);
#line 821 "/home/seb/gnome/gnome-latex/src/completion.vala"
						return;
#line 4102 "completion.c"
					}
				}
#line 822 "/home/seb/gnome/gnome-latex/src/completion.vala"
				break;
#line 4107 "completion.c"
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label3) ? _tmp1_label3 : (_tmp1_label3 = g_quark_from_static_string ("choice")))) {
#line 811 "/home/seb/gnome/gnome-latex/src/completion.vala"
		switch (0) {
#line 4113 "completion.c"
			default:
			{
#line 825 "/home/seb/gnome/gnome-latex/src/completion.vala"
				completion_provider_parser_add_choice (self, attr_names, attr_names_length1, attr_values, attr_values_length1, &_inner_error_);
#line 825 "/home/seb/gnome/gnome-latex/src/completion.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 825 "/home/seb/gnome/gnome-latex/src/completion.vala"
					if (_inner_error_->domain == G_MARKUP_ERROR) {
#line 825 "/home/seb/gnome/gnome-latex/src/completion.vala"
						g_propagate_error (error, _inner_error_);
#line 825 "/home/seb/gnome/gnome-latex/src/completion.vala"
						return;
#line 4126 "completion.c"
					} else {
#line 825 "/home/seb/gnome/gnome-latex/src/completion.vala"
						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 825 "/home/seb/gnome/gnome-latex/src/completion.vala"
						g_clear_error (&_inner_error_);
#line 825 "/home/seb/gnome/gnome-latex/src/completion.vala"
						return;
#line 4134 "completion.c"
					}
				}
#line 826 "/home/seb/gnome/gnome-latex/src/completion.vala"
				break;
#line 4139 "completion.c"
			}
		}
	} else if ((_tmp2_ == ((0 != _tmp1_label4) ? _tmp1_label4 : (_tmp1_label4 = g_quark_from_static_string ("insert")))) || (_tmp2_ == ((0 != _tmp1_label5) ? _tmp1_label5 : (_tmp1_label5 = g_quark_from_static_string ("insert_after"))))) {
#line 811 "/home/seb/gnome/gnome-latex/src/completion.vala"
		switch (0) {
#line 4145 "completion.c"
			default:
			{
#line 832 "/home/seb/gnome/gnome-latex/src/completion.vala"
				break;
#line 4150 "completion.c"
			}
		}
	} else if ((_tmp2_ == ((0 != _tmp1_label6) ? _tmp1_label6 : (_tmp1_label6 = g_quark_from_static_string ("placeholder")))) || (_tmp2_ == ((0 != _tmp1_label7) ? _tmp1_label7 : (_tmp1_label7 = g_quark_from_static_string ("component"))))) {
#line 811 "/home/seb/gnome/gnome-latex/src/completion.vala"
		switch (0) {
#line 4156 "completion.c"
			default:
			{
#line 837 "/home/seb/gnome/gnome-latex/src/completion.vala"
				break;
#line 4161 "completion.c"
			}
		}
	} else {
#line 811 "/home/seb/gnome/gnome-latex/src/completion.vala"
		switch (0) {
#line 4167 "completion.c"
			default:
			{
				gchar* _tmp3_;
				gchar* _tmp4_;
				gchar* _tmp5_;
				gchar* _tmp6_;
				GError* _tmp7_;
				GError* _tmp8_;
#line 840 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp3_ = g_strconcat ("unknown element \"", name, NULL);
#line 840 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp4_ = _tmp3_;
#line 840 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp5_ = g_strconcat (_tmp4_, "\"", NULL);
#line 840 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp6_ = _tmp5_;
#line 840 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp7_ = g_error_new_literal (G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT, _tmp6_);
#line 840 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp8_ = _tmp7_;
#line 840 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_g_free0 (_tmp6_);
#line 840 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_g_free0 (_tmp4_);
#line 840 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_inner_error_ = _tmp8_;
#line 840 "/home/seb/gnome/gnome-latex/src/completion.vala"
				if (_inner_error_->domain == G_MARKUP_ERROR) {
#line 840 "/home/seb/gnome/gnome-latex/src/completion.vala"
					g_propagate_error (error, _inner_error_);
#line 840 "/home/seb/gnome/gnome-latex/src/completion.vala"
					return;
#line 4200 "completion.c"
				} else {
#line 840 "/home/seb/gnome/gnome-latex/src/completion.vala"
					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 840 "/home/seb/gnome/gnome-latex/src/completion.vala"
					g_clear_error (&_inner_error_);
#line 840 "/home/seb/gnome/gnome-latex/src/completion.vala"
					return;
#line 4208 "completion.c"
				}
			}
		}
	}
}


static void
completion_provider_parser_add_command (CompletionProvider* self,
                                        gchar** attr_names,
                                        int attr_names_length1,
                                        gchar** attr_values,
                                        int attr_values_length1,
                                        GError** error)
{
	GError * _inner_error_ = NULL;
#line 845 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (self != NULL);
#line 848 "/home/seb/gnome/gnome-latex/src/completion.vala"
	completion_provider_completion_command_destroy (&self->priv->_current_command);
#line 848 "/home/seb/gnome/gnome-latex/src/completion.vala"
	memset (&self->priv->_current_command, 0, sizeof (CompletionProviderCompletionCommand));
#line 4231 "completion.c"
	{
		gint attr_num = 0;
#line 849 "/home/seb/gnome/gnome-latex/src/completion.vala"
		attr_num = 0;
#line 4236 "completion.c"
		{
			gboolean _tmp0_ = FALSE;
#line 849 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp0_ = TRUE;
#line 849 "/home/seb/gnome/gnome-latex/src/completion.vala"
			while (TRUE) {
#line 4243 "completion.c"
				gint _tmp2_;
				gint _tmp3_;
				const gchar* _tmp4_;
				const gchar* _tmp5_;
				GQuark _tmp7_ = 0U;
#line 851 "/home/seb/gnome/gnome-latex/src/completion.vala"
				static GQuark _tmp6_label0 = 0;
#line 851 "/home/seb/gnome/gnome-latex/src/completion.vala"
				static GQuark _tmp6_label1 = 0;
#line 851 "/home/seb/gnome/gnome-latex/src/completion.vala"
				static GQuark _tmp6_label2 = 0;
#line 849 "/home/seb/gnome/gnome-latex/src/completion.vala"
				if (!_tmp0_) {
#line 4257 "completion.c"
					gint _tmp1_;
#line 849 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp1_ = attr_num;
#line 849 "/home/seb/gnome/gnome-latex/src/completion.vala"
					attr_num = _tmp1_ + 1;
#line 4263 "completion.c"
				}
#line 849 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp0_ = FALSE;
#line 849 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp2_ = attr_num;
#line 849 "/home/seb/gnome/gnome-latex/src/completion.vala"
				if (!(_tmp2_ < attr_names_length1)) {
#line 849 "/home/seb/gnome/gnome-latex/src/completion.vala"
					break;
#line 4273 "completion.c"
				}
#line 851 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp3_ = attr_num;
#line 851 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp4_ = attr_names[_tmp3_];
#line 851 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp5_ = _tmp4_;
#line 851 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp7_ = (NULL == _tmp5_) ? 0 : g_quark_from_string (_tmp5_);
#line 851 "/home/seb/gnome/gnome-latex/src/completion.vala"
				if (_tmp7_ == ((0 != _tmp6_label0) ? _tmp6_label0 : (_tmp6_label0 = g_quark_from_static_string ("name")))) {
#line 851 "/home/seb/gnome/gnome-latex/src/completion.vala"
					switch (0) {
#line 4287 "completion.c"
						default:
						{
							gint _tmp8_;
							const gchar* _tmp9_;
							gchar* _tmp10_;
#line 854 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp8_ = attr_num;
#line 854 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp9_ = attr_values[_tmp8_];
#line 854 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp10_ = g_strconcat ("\\", _tmp9_, NULL);
#line 854 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_g_free0 (self->priv->_current_command.name);
#line 854 "/home/seb/gnome/gnome-latex/src/completion.vala"
							self->priv->_current_command.name = _tmp10_;
#line 855 "/home/seb/gnome/gnome-latex/src/completion.vala"
							break;
#line 4305 "completion.c"
						}
					}
				} else if (_tmp7_ == ((0 != _tmp6_label1) ? _tmp6_label1 : (_tmp6_label1 = g_quark_from_static_string ("package")))) {
#line 851 "/home/seb/gnome/gnome-latex/src/completion.vala"
					switch (0) {
#line 4311 "completion.c"
						default:
						{
							gint _tmp11_;
							const gchar* _tmp12_;
							gchar* _tmp13_;
#line 858 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp11_ = attr_num;
#line 858 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp12_ = attr_values[_tmp11_];
#line 858 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp13_ = g_strdup (_tmp12_);
#line 858 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_g_free0 (self->priv->_current_command.package);
#line 858 "/home/seb/gnome/gnome-latex/src/completion.vala"
							self->priv->_current_command.package = _tmp13_;
#line 859 "/home/seb/gnome/gnome-latex/src/completion.vala"
							break;
#line 4329 "completion.c"
						}
					}
				} else if (_tmp7_ == ((0 != _tmp6_label2) ? _tmp6_label2 : (_tmp6_label2 = g_quark_from_static_string ("environment")))) {
#line 851 "/home/seb/gnome/gnome-latex/src/completion.vala"
					switch (0) {
#line 4335 "completion.c"
						default:
						{
#line 863 "/home/seb/gnome/gnome-latex/src/completion.vala"
							break;
#line 4340 "completion.c"
						}
					}
				} else {
#line 851 "/home/seb/gnome/gnome-latex/src/completion.vala"
					switch (0) {
#line 4346 "completion.c"
						default:
						{
							gint _tmp14_;
							const gchar* _tmp15_;
							gchar* _tmp16_;
							gchar* _tmp17_;
							gchar* _tmp18_;
							gchar* _tmp19_;
							GError* _tmp20_;
							GError* _tmp21_;
#line 866 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp14_ = attr_num;
#line 866 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp15_ = attr_names[_tmp14_];
#line 866 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp16_ = g_strconcat ("unknown command attribute \"", _tmp15_, NULL);
#line 866 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp17_ = _tmp16_;
#line 866 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp18_ = g_strconcat (_tmp17_, "\"", NULL);
#line 866 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp19_ = _tmp18_;
#line 866 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp20_ = g_error_new_literal (G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE, _tmp19_);
#line 866 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp21_ = _tmp20_;
#line 866 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_g_free0 (_tmp19_);
#line 866 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_g_free0 (_tmp17_);
#line 866 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_inner_error_ = _tmp21_;
#line 866 "/home/seb/gnome/gnome-latex/src/completion.vala"
							if (_inner_error_->domain == G_MARKUP_ERROR) {
#line 866 "/home/seb/gnome/gnome-latex/src/completion.vala"
								g_propagate_error (error, _inner_error_);
#line 866 "/home/seb/gnome/gnome-latex/src/completion.vala"
								return;
#line 4385 "completion.c"
							} else {
#line 866 "/home/seb/gnome/gnome-latex/src/completion.vala"
								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 866 "/home/seb/gnome/gnome-latex/src/completion.vala"
								g_clear_error (&_inner_error_);
#line 866 "/home/seb/gnome/gnome-latex/src/completion.vala"
								return;
#line 4393 "completion.c"
							}
						}
					}
				}
			}
		}
	}
}


static void
completion_provider_parser_add_argument (CompletionProvider* self,
                                         gchar** attr_names,
                                         int attr_names_length1,
                                         gchar** attr_values,
                                         int attr_values_length1,
                                         GError** error)
{
	GError * _inner_error_ = NULL;
#line 872 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (self != NULL);
#line 875 "/home/seb/gnome/gnome-latex/src/completion.vala"
	completion_provider_completion_argument_destroy (&self->priv->_current_arg);
#line 875 "/home/seb/gnome/gnome-latex/src/completion.vala"
	memset (&self->priv->_current_arg, 0, sizeof (CompletionProviderCompletionArgument));
#line 876 "/home/seb/gnome/gnome-latex/src/completion.vala"
	self->priv->_current_arg.optional = FALSE;
#line 4421 "completion.c"
	{
		gint attr_num = 0;
#line 878 "/home/seb/gnome/gnome-latex/src/completion.vala"
		attr_num = 0;
#line 4426 "completion.c"
		{
			gboolean _tmp0_ = FALSE;
#line 878 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp0_ = TRUE;
#line 878 "/home/seb/gnome/gnome-latex/src/completion.vala"
			while (TRUE) {
#line 4433 "completion.c"
				gint _tmp2_;
				gint _tmp3_;
				const gchar* _tmp4_;
				const gchar* _tmp5_;
				GQuark _tmp7_ = 0U;
#line 880 "/home/seb/gnome/gnome-latex/src/completion.vala"
				static GQuark _tmp6_label0 = 0;
#line 880 "/home/seb/gnome/gnome-latex/src/completion.vala"
				static GQuark _tmp6_label1 = 0;
#line 878 "/home/seb/gnome/gnome-latex/src/completion.vala"
				if (!_tmp0_) {
#line 4445 "completion.c"
					gint _tmp1_;
#line 878 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp1_ = attr_num;
#line 878 "/home/seb/gnome/gnome-latex/src/completion.vala"
					attr_num = _tmp1_ + 1;
#line 4451 "completion.c"
				}
#line 878 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp0_ = FALSE;
#line 878 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp2_ = attr_num;
#line 878 "/home/seb/gnome/gnome-latex/src/completion.vala"
				if (!(_tmp2_ < attr_names_length1)) {
#line 878 "/home/seb/gnome/gnome-latex/src/completion.vala"
					break;
#line 4461 "completion.c"
				}
#line 880 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp3_ = attr_num;
#line 880 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp4_ = attr_names[_tmp3_];
#line 880 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp5_ = _tmp4_;
#line 880 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp7_ = (NULL == _tmp5_) ? 0 : g_quark_from_string (_tmp5_);
#line 880 "/home/seb/gnome/gnome-latex/src/completion.vala"
				if (_tmp7_ == ((0 != _tmp6_label0) ? _tmp6_label0 : (_tmp6_label0 = g_quark_from_static_string ("label")))) {
#line 880 "/home/seb/gnome/gnome-latex/src/completion.vala"
					switch (0) {
#line 4475 "completion.c"
						default:
						{
							gint _tmp8_;
							const gchar* _tmp9_;
							gchar* _tmp10_;
#line 883 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp8_ = attr_num;
#line 883 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp9_ = attr_values[_tmp8_];
#line 883 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp10_ = g_strdup (_tmp9_);
#line 883 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_g_free0 (self->priv->_current_arg.label);
#line 883 "/home/seb/gnome/gnome-latex/src/completion.vala"
							self->priv->_current_arg.label = _tmp10_;
#line 884 "/home/seb/gnome/gnome-latex/src/completion.vala"
							break;
#line 4493 "completion.c"
						}
					}
				} else if (_tmp7_ == ((0 != _tmp6_label1) ? _tmp6_label1 : (_tmp6_label1 = g_quark_from_static_string ("type")))) {
#line 880 "/home/seb/gnome/gnome-latex/src/completion.vala"
					switch (0) {
#line 4499 "completion.c"
						default:
						{
							gint _tmp11_;
							const gchar* _tmp12_;
#line 887 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp11_ = attr_num;
#line 887 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp12_ = attr_values[_tmp11_];
#line 887 "/home/seb/gnome/gnome-latex/src/completion.vala"
							self->priv->_current_arg.optional = g_strcmp0 (_tmp12_, "optional") == 0;
#line 888 "/home/seb/gnome/gnome-latex/src/completion.vala"
							break;
#line 4512 "completion.c"
						}
					}
				} else {
#line 880 "/home/seb/gnome/gnome-latex/src/completion.vala"
					switch (0) {
#line 4518 "completion.c"
						default:
						{
							gint _tmp13_;
							const gchar* _tmp14_;
							gchar* _tmp15_;
							gchar* _tmp16_;
							gchar* _tmp17_;
							gchar* _tmp18_;
							GError* _tmp19_;
							GError* _tmp20_;
#line 891 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp13_ = attr_num;
#line 891 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp14_ = attr_names[_tmp13_];
#line 891 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp15_ = g_strconcat ("unknown argument attribute \"", _tmp14_, NULL);
#line 891 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp16_ = _tmp15_;
#line 891 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp17_ = g_strconcat (_tmp16_, "\"", NULL);
#line 891 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp18_ = _tmp17_;
#line 891 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp19_ = g_error_new_literal (G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE, _tmp18_);
#line 891 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp20_ = _tmp19_;
#line 891 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_g_free0 (_tmp18_);
#line 891 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_g_free0 (_tmp16_);
#line 891 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_inner_error_ = _tmp20_;
#line 891 "/home/seb/gnome/gnome-latex/src/completion.vala"
							if (_inner_error_->domain == G_MARKUP_ERROR) {
#line 891 "/home/seb/gnome/gnome-latex/src/completion.vala"
								g_propagate_error (error, _inner_error_);
#line 891 "/home/seb/gnome/gnome-latex/src/completion.vala"
								return;
#line 4557 "completion.c"
							} else {
#line 891 "/home/seb/gnome/gnome-latex/src/completion.vala"
								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 891 "/home/seb/gnome/gnome-latex/src/completion.vala"
								g_clear_error (&_inner_error_);
#line 891 "/home/seb/gnome/gnome-latex/src/completion.vala"
								return;
#line 4565 "completion.c"
							}
						}
					}
				}
			}
		}
	}
}


static void
completion_provider_parser_add_choice (CompletionProvider* self,
                                       gchar** attr_names,
                                       int attr_names_length1,
                                       gchar** attr_values,
                                       int attr_values_length1,
                                       GError** error)
{
	GError * _inner_error_ = NULL;
#line 897 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (self != NULL);
#line 900 "/home/seb/gnome/gnome-latex/src/completion.vala"
	completion_provider_completion_choice_destroy (&self->priv->_current_choice);
#line 900 "/home/seb/gnome/gnome-latex/src/completion.vala"
	memset (&self->priv->_current_choice, 0, sizeof (CompletionProviderCompletionChoice));
#line 4591 "completion.c"
	{
		gint attr_num = 0;
#line 902 "/home/seb/gnome/gnome-latex/src/completion.vala"
		attr_num = 0;
#line 4596 "completion.c"
		{
			gboolean _tmp0_ = FALSE;
#line 902 "/home/seb/gnome/gnome-latex/src/completion.vala"
			_tmp0_ = TRUE;
#line 902 "/home/seb/gnome/gnome-latex/src/completion.vala"
			while (TRUE) {
#line 4603 "completion.c"
				gint _tmp2_;
				gint _tmp3_;
				const gchar* _tmp4_;
				const gchar* _tmp5_;
				GQuark _tmp7_ = 0U;
#line 904 "/home/seb/gnome/gnome-latex/src/completion.vala"
				static GQuark _tmp6_label0 = 0;
#line 904 "/home/seb/gnome/gnome-latex/src/completion.vala"
				static GQuark _tmp6_label1 = 0;
#line 902 "/home/seb/gnome/gnome-latex/src/completion.vala"
				if (!_tmp0_) {
#line 4615 "completion.c"
					gint _tmp1_;
#line 902 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp1_ = attr_num;
#line 902 "/home/seb/gnome/gnome-latex/src/completion.vala"
					attr_num = _tmp1_ + 1;
#line 4621 "completion.c"
				}
#line 902 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp0_ = FALSE;
#line 902 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp2_ = attr_num;
#line 902 "/home/seb/gnome/gnome-latex/src/completion.vala"
				if (!(_tmp2_ < attr_names_length1)) {
#line 902 "/home/seb/gnome/gnome-latex/src/completion.vala"
					break;
#line 4631 "completion.c"
				}
#line 904 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp3_ = attr_num;
#line 904 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp4_ = attr_names[_tmp3_];
#line 904 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp5_ = _tmp4_;
#line 904 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp7_ = (NULL == _tmp5_) ? 0 : g_quark_from_string (_tmp5_);
#line 904 "/home/seb/gnome/gnome-latex/src/completion.vala"
				if (_tmp7_ == ((0 != _tmp6_label0) ? _tmp6_label0 : (_tmp6_label0 = g_quark_from_static_string ("name")))) {
#line 904 "/home/seb/gnome/gnome-latex/src/completion.vala"
					switch (0) {
#line 4645 "completion.c"
						default:
						{
							gint _tmp8_;
							const gchar* _tmp9_;
							gchar* _tmp10_;
#line 907 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp8_ = attr_num;
#line 907 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp9_ = attr_values[_tmp8_];
#line 907 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp10_ = g_strdup (_tmp9_);
#line 907 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_g_free0 (self->priv->_current_choice.name);
#line 907 "/home/seb/gnome/gnome-latex/src/completion.vala"
							self->priv->_current_choice.name = _tmp10_;
#line 908 "/home/seb/gnome/gnome-latex/src/completion.vala"
							break;
#line 4663 "completion.c"
						}
					}
				} else if (_tmp7_ == ((0 != _tmp6_label1) ? _tmp6_label1 : (_tmp6_label1 = g_quark_from_static_string ("package")))) {
#line 904 "/home/seb/gnome/gnome-latex/src/completion.vala"
					switch (0) {
#line 4669 "completion.c"
						default:
						{
							gint _tmp11_;
							const gchar* _tmp12_;
							gchar* _tmp13_;
#line 911 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp11_ = attr_num;
#line 911 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp12_ = attr_values[_tmp11_];
#line 911 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp13_ = g_strdup (_tmp12_);
#line 911 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_g_free0 (self->priv->_current_choice.package);
#line 911 "/home/seb/gnome/gnome-latex/src/completion.vala"
							self->priv->_current_choice.package = _tmp13_;
#line 912 "/home/seb/gnome/gnome-latex/src/completion.vala"
							break;
#line 4687 "completion.c"
						}
					}
				} else {
#line 904 "/home/seb/gnome/gnome-latex/src/completion.vala"
					switch (0) {
#line 4693 "completion.c"
						default:
						{
							gint _tmp14_;
							const gchar* _tmp15_;
							gchar* _tmp16_;
							gchar* _tmp17_;
							gchar* _tmp18_;
							gchar* _tmp19_;
							GError* _tmp20_;
							GError* _tmp21_;
#line 915 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp14_ = attr_num;
#line 915 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp15_ = attr_names[_tmp14_];
#line 915 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp16_ = g_strconcat ("unknown choice attribute \"", _tmp15_, NULL);
#line 915 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp17_ = _tmp16_;
#line 915 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp18_ = g_strconcat (_tmp17_, "\"", NULL);
#line 915 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp19_ = _tmp18_;
#line 915 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp20_ = g_error_new_literal (G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE, _tmp19_);
#line 915 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_tmp21_ = _tmp20_;
#line 915 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_g_free0 (_tmp19_);
#line 915 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_g_free0 (_tmp17_);
#line 915 "/home/seb/gnome/gnome-latex/src/completion.vala"
							_inner_error_ = _tmp21_;
#line 915 "/home/seb/gnome/gnome-latex/src/completion.vala"
							if (_inner_error_->domain == G_MARKUP_ERROR) {
#line 915 "/home/seb/gnome/gnome-latex/src/completion.vala"
								g_propagate_error (error, _inner_error_);
#line 915 "/home/seb/gnome/gnome-latex/src/completion.vala"
								return;
#line 4732 "completion.c"
							} else {
#line 915 "/home/seb/gnome/gnome-latex/src/completion.vala"
								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 915 "/home/seb/gnome/gnome-latex/src/completion.vala"
								g_clear_error (&_inner_error_);
#line 915 "/home/seb/gnome/gnome-latex/src/completion.vala"
								return;
#line 4740 "completion.c"
							}
						}
					}
				}
			}
		}
	}
}


static void
_vala_array_add2 (CompletionProviderCompletionArgument* * array,
                  int* length,
                  int* size,
                  const CompletionProviderCompletionArgument* value)
{
#line 943 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if ((*length) == (*size)) {
#line 943 "/home/seb/gnome/gnome-latex/src/completion.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 943 "/home/seb/gnome/gnome-latex/src/completion.vala"
		*array = g_renew (CompletionProviderCompletionArgument, *array, *size);
#line 4763 "completion.c"
	}
#line 943 "/home/seb/gnome/gnome-latex/src/completion.vala"
	(*array)[(*length)++] = *value;
#line 4767 "completion.c"
}


static void
_vala_array_add3 (CompletionProviderCompletionChoice* * array,
                  int* length,
                  int* size,
                  const CompletionProviderCompletionChoice* value)
{
#line 947 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if ((*length) == (*size)) {
#line 947 "/home/seb/gnome/gnome-latex/src/completion.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 947 "/home/seb/gnome/gnome-latex/src/completion.vala"
		*array = g_renew (CompletionProviderCompletionChoice, *array, *size);
#line 4783 "completion.c"
	}
#line 947 "/home/seb/gnome/gnome-latex/src/completion.vala"
	(*array)[(*length)++] = *value;
#line 4787 "completion.c"
}


static void
completion_provider_parser_end (CompletionProvider* self,
                                GMarkupParseContext* context,
                                const gchar* name,
                                GError** error)
{
	const gchar* _tmp0_;
	GQuark _tmp2_ = 0U;
#line 923 "/home/seb/gnome/gnome-latex/src/completion.vala"
	static GQuark _tmp1_label0 = 0;
#line 923 "/home/seb/gnome/gnome-latex/src/completion.vala"
	static GQuark _tmp1_label1 = 0;
#line 923 "/home/seb/gnome/gnome-latex/src/completion.vala"
	static GQuark _tmp1_label2 = 0;
#line 921 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (self != NULL);
#line 921 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (context != NULL);
#line 921 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (name != NULL);
#line 923 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp0_ = name;
#line 923 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp2_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_);
#line 923 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (_tmp2_ == ((0 != _tmp1_label0) ? _tmp1_label0 : (_tmp1_label0 = g_quark_from_static_string ("command")))) {
#line 923 "/home/seb/gnome/gnome-latex/src/completion.vala"
		switch (0) {
#line 4819 "completion.c"
			default:
			{
				GdkPixbuf* _tmp3_ = NULL;
				CompletionProviderCompletionCommand _tmp4_;
				const gchar* _tmp5_;
				GdkPixbuf* pixbuf = NULL;
				GdkPixbuf* _tmp8_;
				GtkSourceCompletionItem* item = NULL;
				GtkSourceCompletionItem* _tmp9_;
				GtkSourceCompletionItem* _tmp10_;
				CompletionProviderCompletionCommand _tmp11_;
				const gchar* _tmp12_;
				GtkSourceCompletionItem* _tmp13_;
				CompletionProviderCompletionCommand _tmp14_;
				gchar* _tmp15_;
				gchar* _tmp16_;
				GtkSourceCompletionItem* _tmp17_;
				GdkPixbuf* _tmp18_;
				GtkSourceCompletionItem* _tmp19_;
				CompletionProviderCompletionCommand _tmp20_;
				gchar* _tmp21_;
				gchar* _tmp22_;
				GtkSourceCompletionItem* _tmp23_;
				GtkSourceCompletionItem* _tmp24_;
				CompletionProviderCompletionCommand _tmp25_;
				CompletionProviderCompletionArgument* _tmp26_;
				gint _tmp26__length1;
#line 926 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp4_ = self->priv->_current_command;
#line 926 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp5_ = _tmp4_.package;
#line 926 "/home/seb/gnome/gnome-latex/src/completion.vala"
				if (_tmp5_ != NULL) {
#line 4853 "completion.c"
					GdkPixbuf* _tmp6_;
#line 927 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp6_ = self->priv->_icon_package_required;
#line 927 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp3_ = _tmp6_;
#line 4859 "completion.c"
				} else {
					GdkPixbuf* _tmp7_;
#line 927 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp7_ = self->priv->_icon_cmd;
#line 927 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp3_ = _tmp7_;
#line 4866 "completion.c"
				}
#line 926 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp8_ = _g_object_ref0 (_tmp3_);
#line 926 "/home/seb/gnome/gnome-latex/src/completion.vala"
				pixbuf = _tmp8_;
#line 929 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp9_ = gtk_source_completion_item_new ();
#line 929 "/home/seb/gnome/gnome-latex/src/completion.vala"
				item = _tmp9_;
#line 930 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp10_ = item;
#line 930 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp11_ = self->priv->_current_command;
#line 930 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp12_ = _tmp11_.name;
#line 930 "/home/seb/gnome/gnome-latex/src/completion.vala"
				gtk_source_completion_item_set_label (_tmp10_, _tmp12_);
#line 931 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp13_ = item;
#line 931 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp14_ = self->priv->_current_command;
#line 931 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp15_ = completion_provider_get_command_text_to_insert (self, &_tmp14_);
#line 931 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp16_ = _tmp15_;
#line 931 "/home/seb/gnome/gnome-latex/src/completion.vala"
				gtk_source_completion_item_set_text (_tmp13_, _tmp16_);
#line 931 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_g_free0 (_tmp16_);
#line 932 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp17_ = item;
#line 932 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp18_ = pixbuf;
#line 932 "/home/seb/gnome/gnome-latex/src/completion.vala"
				gtk_source_completion_item_set_icon (_tmp17_, _tmp18_);
#line 933 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp19_ = item;
#line 933 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp20_ = self->priv->_current_command;
#line 933 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp21_ = completion_provider_get_command_info (self, &_tmp20_, -1);
#line 933 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp22_ = _tmp21_;
#line 933 "/home/seb/gnome/gnome-latex/src/completion.vala"
				gtk_source_completion_item_set_info (_tmp19_, _tmp22_);
#line 933 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_g_free0 (_tmp22_);
#line 934 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp23_ = item;
#line 934 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp24_ = _g_object_ref0 (_tmp23_);
#line 934 "/home/seb/gnome/gnome-latex/src/completion.vala"
				self->priv->_proposals = g_list_prepend (self->priv->_proposals, _tmp24_);
#line 938 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp25_ = self->priv->_current_command;
#line 938 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp26_ = _tmp25_.args;
#line 938 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp26__length1 = _tmp25_.args_length1;
#line 938 "/home/seb/gnome/gnome-latex/src/completion.vala"
				if (0 < _tmp26__length1) {
#line 4928 "completion.c"
					GeeHashMap* _tmp27_;
					CompletionProviderCompletionCommand _tmp28_;
					const gchar* _tmp29_;
					CompletionProviderCompletionCommand _tmp30_;
#line 939 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp27_ = self->priv->_commands;
#line 939 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp28_ = self->priv->_current_command;
#line 939 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp29_ = _tmp28_.name;
#line 939 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp30_ = self->priv->_current_command;
#line 939 "/home/seb/gnome/gnome-latex/src/completion.vala"
					gee_abstract_map_set ((GeeAbstractMap*) _tmp27_, _tmp29_, &_tmp30_);
#line 4943 "completion.c"
				}
#line 940 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_g_object_unref0 (item);
#line 940 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_g_object_unref0 (pixbuf);
#line 940 "/home/seb/gnome/gnome-latex/src/completion.vala"
				break;
#line 4951 "completion.c"
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label1) ? _tmp1_label1 : (_tmp1_label1 = g_quark_from_static_string ("argument")))) {
#line 923 "/home/seb/gnome/gnome-latex/src/completion.vala"
		switch (0) {
#line 4957 "completion.c"
			default:
			{
				CompletionProviderCompletionArgument* _tmp31_;
				gint _tmp31__length1;
				CompletionProviderCompletionArgument _tmp32_;
				CompletionProviderCompletionArgument _tmp33_ = {0};
#line 943 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp31_ = self->priv->_current_command.args;
#line 943 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp31__length1 = self->priv->_current_command.args_length1;
#line 943 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp32_ = self->priv->_current_arg;
#line 943 "/home/seb/gnome/gnome-latex/src/completion.vala"
				completion_provider_completion_argument_copy (&_tmp32_, &_tmp33_);
#line 943 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_vala_array_add2 (&self->priv->_current_command.args, &self->priv->_current_command.args_length1, &self->priv->_current_command._args_size_, &_tmp33_);
#line 944 "/home/seb/gnome/gnome-latex/src/completion.vala"
				break;
#line 4976 "completion.c"
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label2) ? _tmp1_label2 : (_tmp1_label2 = g_quark_from_static_string ("choice")))) {
#line 923 "/home/seb/gnome/gnome-latex/src/completion.vala"
		switch (0) {
#line 4982 "completion.c"
			default:
			{
				CompletionProviderCompletionChoice* _tmp34_;
				gint _tmp34__length1;
				CompletionProviderCompletionChoice _tmp35_;
				CompletionProviderCompletionChoice _tmp36_ = {0};
				gboolean _tmp37_ = FALSE;
				CompletionProviderCompletionChoice _tmp38_;
				const gchar* _tmp39_;
#line 947 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp34_ = self->priv->_current_arg.choices;
#line 947 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp34__length1 = self->priv->_current_arg.choices_length1;
#line 947 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp35_ = self->priv->_current_choice;
#line 947 "/home/seb/gnome/gnome-latex/src/completion.vala"
				completion_provider_completion_choice_copy (&_tmp35_, &_tmp36_);
#line 947 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_vala_array_add3 (&self->priv->_current_arg.choices, &self->priv->_current_arg.choices_length1, &self->priv->_current_arg._choices_size_, &_tmp36_);
#line 948 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp38_ = self->priv->_current_choice;
#line 948 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp39_ = _tmp38_.insert;
#line 948 "/home/seb/gnome/gnome-latex/src/completion.vala"
				if (_tmp39_ != NULL) {
#line 948 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp37_ = TRUE;
#line 5010 "completion.c"
				} else {
					CompletionProviderCompletionChoice _tmp40_;
					const gchar* _tmp41_;
#line 949 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp40_ = self->priv->_current_choice;
#line 949 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp41_ = _tmp40_.insert_after;
#line 949 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp37_ = _tmp41_ != NULL;
#line 5020 "completion.c"
				}
#line 948 "/home/seb/gnome/gnome-latex/src/completion.vala"
				if (_tmp37_) {
#line 5024 "completion.c"
					GeeHashMap* _tmp42_;
					CompletionProviderCompletionChoice _tmp43_;
					const gchar* _tmp44_;
					CompletionProviderCompletionChoice _tmp45_;
#line 950 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp42_ = self->priv->_environments;
#line 950 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp43_ = self->priv->_current_choice;
#line 950 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp44_ = _tmp43_.name;
#line 950 "/home/seb/gnome/gnome-latex/src/completion.vala"
					_tmp45_ = self->priv->_current_choice;
#line 950 "/home/seb/gnome/gnome-latex/src/completion.vala"
					gee_abstract_map_set ((GeeAbstractMap*) _tmp42_, _tmp44_, &_tmp45_);
#line 5039 "completion.c"
				}
#line 951 "/home/seb/gnome/gnome-latex/src/completion.vala"
				break;
#line 5043 "completion.c"
			}
		}
	}
}


static void
completion_provider_parser_text (CompletionProvider* self,
                                 GMarkupParseContext* context,
                                 const gchar* text,
                                 gsize text_len,
                                 GError** error)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GQuark _tmp3_ = 0U;
#line 958 "/home/seb/gnome/gnome-latex/src/completion.vala"
	static GQuark _tmp2_label0 = 0;
#line 958 "/home/seb/gnome/gnome-latex/src/completion.vala"
	static GQuark _tmp2_label1 = 0;
#line 955 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (self != NULL);
#line 955 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (context != NULL);
#line 955 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_return_if_fail (text != NULL);
#line 958 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp0_ = g_markup_parse_context_get_element (context);
#line 958 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp1_ = _tmp0_;
#line 958 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp3_ = (NULL == _tmp1_) ? 0 : g_quark_from_string (_tmp1_);
#line 958 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (_tmp3_ == ((0 != _tmp2_label0) ? _tmp2_label0 : (_tmp2_label0 = g_quark_from_static_string ("insert")))) {
#line 958 "/home/seb/gnome/gnome-latex/src/completion.vala"
		switch (0) {
#line 5080 "completion.c"
			default:
			{
				gchar* _tmp4_;
#line 961 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp4_ = g_strdup (text);
#line 961 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_g_free0 (self->priv->_current_choice.insert);
#line 961 "/home/seb/gnome/gnome-latex/src/completion.vala"
				self->priv->_current_choice.insert = _tmp4_;
#line 962 "/home/seb/gnome/gnome-latex/src/completion.vala"
				break;
#line 5092 "completion.c"
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label1) ? _tmp2_label1 : (_tmp2_label1 = g_quark_from_static_string ("insert_after")))) {
#line 958 "/home/seb/gnome/gnome-latex/src/completion.vala"
		switch (0) {
#line 5098 "completion.c"
			default:
			{
				gchar* _tmp5_;
#line 965 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_tmp5_ = g_strdup (text);
#line 965 "/home/seb/gnome/gnome-latex/src/completion.vala"
				_g_free0 (self->priv->_current_choice.insert_after);
#line 965 "/home/seb/gnome/gnome-latex/src/completion.vala"
				self->priv->_current_choice.insert_after = _tmp5_;
#line 966 "/home/seb/gnome/gnome-latex/src/completion.vala"
				break;
#line 5110 "completion.c"
			}
		}
	}
}


static void
_vala_CompletionProviderCompletionArgument_array_free (CompletionProviderCompletionArgument * array,
                                                       gint array_length)
{
#line 31 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (array != NULL) {
#line 5123 "completion.c"
		int i;
#line 31 "/home/seb/gnome/gnome-latex/src/completion.vala"
		for (i = 0; i < array_length; i = i + 1) {
#line 31 "/home/seb/gnome/gnome-latex/src/completion.vala"
			completion_provider_completion_argument_destroy (&array[i]);
#line 5129 "completion.c"
		}
	}
#line 31 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_free (array);
#line 5134 "completion.c"
}


static CompletionProviderCompletionArgument*
_vala_array_dup1 (CompletionProviderCompletionArgument* self,
                  int length)
{
	CompletionProviderCompletionArgument* result;
	int i;
#line 27 "/home/seb/gnome/gnome-latex/src/completion.vala"
	result = g_new0 (CompletionProviderCompletionArgument, length);
#line 27 "/home/seb/gnome/gnome-latex/src/completion.vala"
	for (i = 0; i < length; i++) {
#line 5148 "completion.c"
		CompletionProviderCompletionArgument _tmp0_ = {0};
#line 27 "/home/seb/gnome/gnome-latex/src/completion.vala"
		completion_provider_completion_argument_copy (&self[i], &_tmp0_);
#line 27 "/home/seb/gnome/gnome-latex/src/completion.vala"
		result[i] = _tmp0_;
#line 5154 "completion.c"
	}
#line 27 "/home/seb/gnome/gnome-latex/src/completion.vala"
	return result;
#line 5158 "completion.c"
}


static void
completion_provider_completion_command_copy (const CompletionProviderCompletionCommand* self,
                                             CompletionProviderCompletionCommand* dest)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	CompletionProviderCompletionArgument* _tmp4_;
	gint _tmp4__length1;
	CompletionProviderCompletionArgument* _tmp5_;
	gint _tmp5__length1;
#line 27 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp0_ = (*self).name;
#line 27 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp1_ = g_strdup (_tmp0_);
#line 27 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 ((*dest).name);
#line 27 "/home/seb/gnome/gnome-latex/src/completion.vala"
	(*dest).name = _tmp1_;
#line 27 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp2_ = (*self).package;
#line 27 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp3_ = g_strdup (_tmp2_);
#line 27 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 ((*dest).package);
#line 27 "/home/seb/gnome/gnome-latex/src/completion.vala"
	(*dest).package = _tmp3_;
#line 27 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp4_ = (*self).args;
#line 27 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp4__length1 = (*self).args_length1;
#line 27 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp5_ = (_tmp4_ != NULL) ? _vala_array_dup1 (_tmp4_, _tmp4__length1) : ((gpointer) _tmp4_);
#line 27 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp5__length1 = _tmp4__length1;
#line 27 "/home/seb/gnome/gnome-latex/src/completion.vala"
	(*dest).args = (_vala_CompletionProviderCompletionArgument_array_free ((*dest).args, (*dest).args_length1), NULL);
#line 27 "/home/seb/gnome/gnome-latex/src/completion.vala"
	(*dest).args = _tmp5_;
#line 27 "/home/seb/gnome/gnome-latex/src/completion.vala"
	(*dest).args_length1 = _tmp5__length1;
#line 27 "/home/seb/gnome/gnome-latex/src/completion.vala"
	(*dest)._args_size_ = (*dest).args_length1;
#line 5206 "completion.c"
}


static void
completion_provider_completion_command_destroy (CompletionProviderCompletionCommand* self)
{
#line 29 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 ((*self).name);
#line 30 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 ((*self).package);
#line 31 "/home/seb/gnome/gnome-latex/src/completion.vala"
	(*self).args = (_vala_CompletionProviderCompletionArgument_array_free ((*self).args, (*self).args_length1), NULL);
#line 5219 "completion.c"
}


static CompletionProviderCompletionCommand*
completion_provider_completion_command_dup (const CompletionProviderCompletionCommand* self)
{
	CompletionProviderCompletionCommand* dup;
#line 27 "/home/seb/gnome/gnome-latex/src/completion.vala"
	dup = g_new0 (CompletionProviderCompletionCommand, 1);
#line 27 "/home/seb/gnome/gnome-latex/src/completion.vala"
	completion_provider_completion_command_copy (self, dup);
#line 27 "/home/seb/gnome/gnome-latex/src/completion.vala"
	return dup;
#line 5233 "completion.c"
}


static void
completion_provider_completion_command_free (CompletionProviderCompletionCommand* self)
{
#line 27 "/home/seb/gnome/gnome-latex/src/completion.vala"
	completion_provider_completion_command_destroy (self);
#line 27 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_free (self);
#line 5244 "completion.c"
}


static GType
completion_provider_completion_command_get_type (void)
{
	static volatile gsize completion_provider_completion_command_type_id__volatile = 0;
	if (g_once_init_enter (&completion_provider_completion_command_type_id__volatile)) {
		GType completion_provider_completion_command_type_id;
		completion_provider_completion_command_type_id = g_boxed_type_register_static ("CompletionProviderCompletionCommand", (GBoxedCopyFunc) completion_provider_completion_command_dup, (GBoxedFreeFunc) completion_provider_completion_command_free);
		g_once_init_leave (&completion_provider_completion_command_type_id__volatile, completion_provider_completion_command_type_id);
	}
	return completion_provider_completion_command_type_id__volatile;
}


static void
_vala_CompletionProviderCompletionChoice_array_free (CompletionProviderCompletionChoice * array,
                                                     gint array_length)
{
#line 38 "/home/seb/gnome/gnome-latex/src/completion.vala"
	if (array != NULL) {
#line 5267 "completion.c"
		int i;
#line 38 "/home/seb/gnome/gnome-latex/src/completion.vala"
		for (i = 0; i < array_length; i = i + 1) {
#line 38 "/home/seb/gnome/gnome-latex/src/completion.vala"
			completion_provider_completion_choice_destroy (&array[i]);
#line 5273 "completion.c"
		}
	}
#line 38 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_free (array);
#line 5278 "completion.c"
}


static CompletionProviderCompletionChoice*
_vala_array_dup2 (CompletionProviderCompletionChoice* self,
                  int length)
{
	CompletionProviderCompletionChoice* result;
	int i;
#line 34 "/home/seb/gnome/gnome-latex/src/completion.vala"
	result = g_new0 (CompletionProviderCompletionChoice, length);
#line 34 "/home/seb/gnome/gnome-latex/src/completion.vala"
	for (i = 0; i < length; i++) {
#line 5292 "completion.c"
		CompletionProviderCompletionChoice _tmp0_ = {0};
#line 34 "/home/seb/gnome/gnome-latex/src/completion.vala"
		completion_provider_completion_choice_copy (&self[i], &_tmp0_);
#line 34 "/home/seb/gnome/gnome-latex/src/completion.vala"
		result[i] = _tmp0_;
#line 5298 "completion.c"
	}
#line 34 "/home/seb/gnome/gnome-latex/src/completion.vala"
	return result;
#line 5302 "completion.c"
}


static void
completion_provider_completion_argument_copy (const CompletionProviderCompletionArgument* self,
                                              CompletionProviderCompletionArgument* dest)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gboolean _tmp2_;
	CompletionProviderCompletionChoice* _tmp3_;
	gint _tmp3__length1;
	CompletionProviderCompletionChoice* _tmp4_;
	gint _tmp4__length1;
#line 34 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp0_ = (*self).label;
#line 34 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp1_ = g_strdup (_tmp0_);
#line 34 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 ((*dest).label);
#line 34 "/home/seb/gnome/gnome-latex/src/completion.vala"
	(*dest).label = _tmp1_;
#line 34 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp2_ = (*self).optional;
#line 34 "/home/seb/gnome/gnome-latex/src/completion.vala"
	(*dest).optional = _tmp2_;
#line 34 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp3_ = (*self).choices;
#line 34 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp3__length1 = (*self).choices_length1;
#line 34 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp4_ = (_tmp3_ != NULL) ? _vala_array_dup2 (_tmp3_, _tmp3__length1) : ((gpointer) _tmp3_);
#line 34 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp4__length1 = _tmp3__length1;
#line 34 "/home/seb/gnome/gnome-latex/src/completion.vala"
	(*dest).choices = (_vala_CompletionProviderCompletionChoice_array_free ((*dest).choices, (*dest).choices_length1), NULL);
#line 34 "/home/seb/gnome/gnome-latex/src/completion.vala"
	(*dest).choices = _tmp4_;
#line 34 "/home/seb/gnome/gnome-latex/src/completion.vala"
	(*dest).choices_length1 = _tmp4__length1;
#line 34 "/home/seb/gnome/gnome-latex/src/completion.vala"
	(*dest)._choices_size_ = (*dest).choices_length1;
#line 5345 "completion.c"
}


static void
completion_provider_completion_argument_destroy (CompletionProviderCompletionArgument* self)
{
#line 36 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 ((*self).label);
#line 38 "/home/seb/gnome/gnome-latex/src/completion.vala"
	(*self).choices = (_vala_CompletionProviderCompletionChoice_array_free ((*self).choices, (*self).choices_length1), NULL);
#line 5356 "completion.c"
}


static CompletionProviderCompletionArgument*
completion_provider_completion_argument_dup (const CompletionProviderCompletionArgument* self)
{
	CompletionProviderCompletionArgument* dup;
#line 34 "/home/seb/gnome/gnome-latex/src/completion.vala"
	dup = g_new0 (CompletionProviderCompletionArgument, 1);
#line 34 "/home/seb/gnome/gnome-latex/src/completion.vala"
	completion_provider_completion_argument_copy (self, dup);
#line 34 "/home/seb/gnome/gnome-latex/src/completion.vala"
	return dup;
#line 5370 "completion.c"
}


static void
completion_provider_completion_argument_free (CompletionProviderCompletionArgument* self)
{
#line 34 "/home/seb/gnome/gnome-latex/src/completion.vala"
	completion_provider_completion_argument_destroy (self);
#line 34 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_free (self);
#line 5381 "completion.c"
}


static GType
completion_provider_completion_argument_get_type (void)
{
	static volatile gsize completion_provider_completion_argument_type_id__volatile = 0;
	if (g_once_init_enter (&completion_provider_completion_argument_type_id__volatile)) {
		GType completion_provider_completion_argument_type_id;
		completion_provider_completion_argument_type_id = g_boxed_type_register_static ("CompletionProviderCompletionArgument", (GBoxedCopyFunc) completion_provider_completion_argument_dup, (GBoxedFreeFunc) completion_provider_completion_argument_free);
		g_once_init_leave (&completion_provider_completion_argument_type_id__volatile, completion_provider_completion_argument_type_id);
	}
	return completion_provider_completion_argument_type_id__volatile;
}


static void
completion_provider_completion_choice_copy (const CompletionProviderCompletionChoice* self,
                                            CompletionProviderCompletionChoice* dest)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
#line 41 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp0_ = (*self).name;
#line 41 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp1_ = g_strdup (_tmp0_);
#line 41 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 ((*dest).name);
#line 41 "/home/seb/gnome/gnome-latex/src/completion.vala"
	(*dest).name = _tmp1_;
#line 41 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp2_ = (*self).package;
#line 41 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp3_ = g_strdup (_tmp2_);
#line 41 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 ((*dest).package);
#line 41 "/home/seb/gnome/gnome-latex/src/completion.vala"
	(*dest).package = _tmp3_;
#line 41 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp4_ = (*self).insert;
#line 41 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp5_ = g_strdup (_tmp4_);
#line 41 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 ((*dest).insert);
#line 41 "/home/seb/gnome/gnome-latex/src/completion.vala"
	(*dest).insert = _tmp5_;
#line 41 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp6_ = (*self).insert_after;
#line 41 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp7_ = g_strdup (_tmp6_);
#line 41 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 ((*dest).insert_after);
#line 41 "/home/seb/gnome/gnome-latex/src/completion.vala"
	(*dest).insert_after = _tmp7_;
#line 5442 "completion.c"
}


static void
completion_provider_completion_choice_destroy (CompletionProviderCompletionChoice* self)
{
#line 43 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 ((*self).name);
#line 44 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 ((*self).package);
#line 45 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 ((*self).insert);
#line 46 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 ((*self).insert_after);
#line 5457 "completion.c"
}


static CompletionProviderCompletionChoice*
completion_provider_completion_choice_dup (const CompletionProviderCompletionChoice* self)
{
	CompletionProviderCompletionChoice* dup;
#line 41 "/home/seb/gnome/gnome-latex/src/completion.vala"
	dup = g_new0 (CompletionProviderCompletionChoice, 1);
#line 41 "/home/seb/gnome/gnome-latex/src/completion.vala"
	completion_provider_completion_choice_copy (self, dup);
#line 41 "/home/seb/gnome/gnome-latex/src/completion.vala"
	return dup;
#line 5471 "completion.c"
}


static void
completion_provider_completion_choice_free (CompletionProviderCompletionChoice* self)
{
#line 41 "/home/seb/gnome/gnome-latex/src/completion.vala"
	completion_provider_completion_choice_destroy (self);
#line 41 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_free (self);
#line 5482 "completion.c"
}


static GType
completion_provider_completion_choice_get_type (void)
{
	static volatile gsize completion_provider_completion_choice_type_id__volatile = 0;
	if (g_once_init_enter (&completion_provider_completion_choice_type_id__volatile)) {
		GType completion_provider_completion_choice_type_id;
		completion_provider_completion_choice_type_id = g_boxed_type_register_static ("CompletionProviderCompletionChoice", (GBoxedCopyFunc) completion_provider_completion_choice_dup, (GBoxedFreeFunc) completion_provider_completion_choice_free);
		g_once_init_leave (&completion_provider_completion_choice_type_id__volatile, completion_provider_completion_choice_type_id);
	}
	return completion_provider_completion_choice_type_id__volatile;
}


static void
completion_provider_argument_context_copy (const CompletionProviderArgumentContext* self,
                                           CompletionProviderArgumentContext* dest)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	GeeArrayList* _tmp4_;
	GeeArrayList* _tmp5_;
#line 49 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp0_ = (*self).cmd_name;
#line 49 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp1_ = g_strdup (_tmp0_);
#line 49 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 ((*dest).cmd_name);
#line 49 "/home/seb/gnome/gnome-latex/src/completion.vala"
	(*dest).cmd_name = _tmp1_;
#line 49 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp2_ = (*self).arg_contents;
#line 49 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp3_ = g_strdup (_tmp2_);
#line 49 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 ((*dest).arg_contents);
#line 49 "/home/seb/gnome/gnome-latex/src/completion.vala"
	(*dest).arg_contents = _tmp3_;
#line 49 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp4_ = (*self).args_types;
#line 49 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_tmp5_ = _g_object_ref0 (_tmp4_);
#line 49 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_object_unref0 ((*dest).args_types);
#line 49 "/home/seb/gnome/gnome-latex/src/completion.vala"
	(*dest).args_types = _tmp5_;
#line 5533 "completion.c"
}


static void
completion_provider_argument_context_destroy (CompletionProviderArgumentContext* self)
{
#line 51 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 ((*self).cmd_name);
#line 52 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_free0 ((*self).arg_contents);
#line 57 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_object_unref0 ((*self).args_types);
#line 5546 "completion.c"
}


static CompletionProviderArgumentContext*
completion_provider_argument_context_dup (const CompletionProviderArgumentContext* self)
{
	CompletionProviderArgumentContext* dup;
#line 49 "/home/seb/gnome/gnome-latex/src/completion.vala"
	dup = g_new0 (CompletionProviderArgumentContext, 1);
#line 49 "/home/seb/gnome/gnome-latex/src/completion.vala"
	completion_provider_argument_context_copy (self, dup);
#line 49 "/home/seb/gnome/gnome-latex/src/completion.vala"
	return dup;
#line 5560 "completion.c"
}


static void
completion_provider_argument_context_free (CompletionProviderArgumentContext* self)
{
#line 49 "/home/seb/gnome/gnome-latex/src/completion.vala"
	completion_provider_argument_context_destroy (self);
#line 49 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_free (self);
#line 5571 "completion.c"
}


static GType
completion_provider_argument_context_get_type (void)
{
	static volatile gsize completion_provider_argument_context_type_id__volatile = 0;
	if (g_once_init_enter (&completion_provider_argument_context_type_id__volatile)) {
		GType completion_provider_argument_context_type_id;
		completion_provider_argument_context_type_id = g_boxed_type_register_static ("CompletionProviderArgumentContext", (GBoxedCopyFunc) completion_provider_argument_context_dup, (GBoxedFreeFunc) completion_provider_argument_context_free);
		g_once_init_leave (&completion_provider_argument_context_type_id__volatile, completion_provider_argument_context_type_id);
	}
	return completion_provider_argument_context_type_id__volatile;
}


static void
completion_provider_class_init (CompletionProviderClass * klass)
{
#line 25 "/home/seb/gnome/gnome-latex/src/completion.vala"
	completion_provider_parent_class = g_type_class_peek_parent (klass);
#line 25 "/home/seb/gnome/gnome-latex/src/completion.vala"
	g_type_class_add_private (klass, sizeof (CompletionProviderPrivate));
#line 25 "/home/seb/gnome/gnome-latex/src/completion.vala"
	G_OBJECT_CLASS (klass)->finalize = completion_provider_finalize;
#line 5597 "completion.c"
}


static void
completion_provider_gtk_source_completion_provider_interface_init (GtkSourceCompletionProviderIface * iface)
{
#line 25 "/home/seb/gnome/gnome-latex/src/completion.vala"
	completion_provider_gtk_source_completion_provider_parent_iface = g_type_interface_peek_parent (iface);
#line 25 "/home/seb/gnome/gnome-latex/src/completion.vala"
	iface->get_name = (gchar* (*) (GtkSourceCompletionProvider *)) completion_provider_real_get_name;
#line 25 "/home/seb/gnome/gnome-latex/src/completion.vala"
	iface->get_activation = (GtkSourceCompletionActivation (*) (GtkSourceCompletionProvider *)) completion_provider_real_get_activation;
#line 25 "/home/seb/gnome/gnome-latex/src/completion.vala"
	iface->match = (gboolean (*) (GtkSourceCompletionProvider *, GtkSourceCompletionContext*)) completion_provider_real_match;
#line 25 "/home/seb/gnome/gnome-latex/src/completion.vala"
	iface->get_start_iter = (gboolean (*) (GtkSourceCompletionProvider *, GtkSourceCompletionContext*, GtkSourceCompletionProposal*, GtkTextIter*)) completion_provider_real_get_start_iter;
#line 25 "/home/seb/gnome/gnome-latex/src/completion.vala"
	iface->populate = (void (*) (GtkSourceCompletionProvider *, GtkSourceCompletionContext*)) completion_provider_real_populate;
#line 25 "/home/seb/gnome/gnome-latex/src/completion.vala"
	iface->activate_proposal = (gboolean (*) (GtkSourceCompletionProvider *, GtkSourceCompletionProposal*, GtkTextIter*)) completion_provider_real_activate_proposal;
#line 5618 "completion.c"
}


static void
completion_provider_instance_init (CompletionProvider * self)
{
#line 25 "/home/seb/gnome/gnome-latex/src/completion.vala"
	self->priv = COMPLETION_PROVIDER_GET_PRIVATE (self);
#line 78 "/home/seb/gnome/gnome-latex/src/completion.vala"
	self->priv->_calltip_window = NULL;
#line 79 "/home/seb/gnome/gnome-latex/src/completion.vala"
	self->priv->_calltip_window_label = NULL;
#line 5631 "completion.c"
}


static void
completion_provider_finalize (GObject * obj)
{
	CompletionProvider * self;
#line 25 "/home/seb/gnome/gnome-latex/src/completion.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_COMPLETION_PROVIDER, CompletionProvider);
#line 62 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_object_unref0 (self->priv->_settings);
#line 64 "/home/seb/gnome/gnome-latex/src/completion.vala"
	(self->priv->_proposals == NULL) ? NULL : (self->priv->_proposals = (_g_list_free__g_object_unref0_ (self->priv->_proposals), NULL));
#line 65 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_object_unref0 (self->priv->_commands);
#line 67 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_object_unref0 (self->priv->_environments);
#line 70 "/home/seb/gnome/gnome-latex/src/completion.vala"
	completion_provider_completion_command_destroy (&self->priv->_current_command);
#line 71 "/home/seb/gnome/gnome-latex/src/completion.vala"
	completion_provider_completion_argument_destroy (&self->priv->_current_arg);
#line 72 "/home/seb/gnome/gnome-latex/src/completion.vala"
	completion_provider_completion_choice_destroy (&self->priv->_current_choice);
#line 74 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_object_unref0 (self->priv->_icon_cmd);
#line 75 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_object_unref0 (self->priv->_icon_choice);
#line 76 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_object_unref0 (self->priv->_icon_package_required);
#line 78 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_object_unref0 (self->priv->_calltip_window);
#line 79 "/home/seb/gnome/gnome-latex/src/completion.vala"
	_g_object_unref0 (self->priv->_calltip_window_label);
#line 25 "/home/seb/gnome/gnome-latex/src/completion.vala"
	G_OBJECT_CLASS (completion_provider_parent_class)->finalize (obj);
#line 5667 "completion.c"
}


GType
completion_provider_get_type (void)
{
	static volatile gsize completion_provider_type_id__volatile = 0;
	if (g_once_init_enter (&completion_provider_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (CompletionProviderClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) completion_provider_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CompletionProvider), 0, (GInstanceInitFunc) completion_provider_instance_init, NULL };
		static const GInterfaceInfo gtk_source_completion_provider_info = { (GInterfaceInitFunc) completion_provider_gtk_source_completion_provider_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType completion_provider_type_id;
		completion_provider_type_id = g_type_register_static (G_TYPE_OBJECT, "CompletionProvider", &g_define_type_info, 0);
		g_type_add_interface_static (completion_provider_type_id, gtk_source_completion_provider_get_type (), &gtk_source_completion_provider_info);
		g_once_init_leave (&completion_provider_type_id__volatile, completion_provider_type_id);
	}
	return completion_provider_type_id__volatile;
}


static gint
_vala_array_length (gpointer array)
{
	int length;
	length = 0;
#line 27 "/home/seb/gnome/gnome-latex/src/build_tools_preferences.vala"
	if (array) {
#line 27 "/home/seb/gnome/gnome-latex/src/build_tools_preferences.vala"
		while (((gpointer*) array)[length]) {
#line 27 "/home/seb/gnome/gnome-latex/src/build_tools_preferences.vala"
			length++;
#line 5698 "completion.c"
		}
	}
#line 27 "/home/seb/gnome/gnome-latex/src/build_tools_preferences.vala"
	return length;
#line 5703 "completion.c"
}



