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

/*
 * This file is part of GNOME LaTeX.
 *
 * Copyright © 2010-2012, 2017 Sébastien Wilmet
 *
 * GNOME LaTeX is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * GNOME LaTeX is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GNOME LaTeX.  If not, see <http://www.gnu.org/licenses/>.
 */


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


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

typedef struct _GotoLine GotoLine;
typedef struct _GotoLineClass GotoLineClass;
typedef struct _GotoLinePrivate GotoLinePrivate;

#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;
enum  {
	GOTO_LINE_0_PROPERTY,
	GOTO_LINE_NUM_PROPERTIES
};
static GParamSpec* goto_line_properties[GOTO_LINE_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 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_SEARCH_AND_REPLACE (search_and_replace_get_type ())
#define SEARCH_AND_REPLACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SEARCH_AND_REPLACE, SearchAndReplace))
#define SEARCH_AND_REPLACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SEARCH_AND_REPLACE, SearchAndReplaceClass))
#define IS_SEARCH_AND_REPLACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SEARCH_AND_REPLACE))
#define IS_SEARCH_AND_REPLACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SEARCH_AND_REPLACE))
#define SEARCH_AND_REPLACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SEARCH_AND_REPLACE, SearchAndReplaceClass))

typedef struct _SearchAndReplace SearchAndReplace;
typedef struct _SearchAndReplaceClass SearchAndReplaceClass;
typedef struct _SearchAndReplacePrivate SearchAndReplacePrivate;
enum  {
	SEARCH_AND_REPLACE_0_PROPERTY,
	SEARCH_AND_REPLACE_NUM_PROPERTIES
};
static GParamSpec* search_and_replace_properties[SEARCH_AND_REPLACE_NUM_PROPERTIES];

#define SEARCH_AND_REPLACE_TYPE_MODE (search_and_replace_mode_get_type ())
typedef struct _Block29Data Block29Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _Block30Data Block30Data;

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

typedef struct _DocumentTab DocumentTab;
typedef struct _DocumentTabClass DocumentTabClass;

#define TYPE_DOCUMENT (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;

struct _GotoLine {
	GtkGrid parent_instance;
	GotoLinePrivate * priv;
};

struct _GotoLineClass {
	GtkGridClass parent_class;
};

struct _GotoLinePrivate {
	MainWindow* main_window;
	GtkEntry* entry;
};

struct _SearchAndReplace {
	GObject parent_instance;
	SearchAndReplacePrivate * priv;
};

struct _SearchAndReplaceClass {
	GObjectClass parent_class;
};

struct _SearchAndReplacePrivate {
	MainWindow* _main_window;
	GtkGrid* _main_grid;
	GtkGrid* _replace_grid;
	GtkArrow* _arrow;
	GtkSearchEntry* _entry_find;
	GtkSearchEntry* _entry_replace;
	GtkLabel* _info_label;
	GtkSourceSearchSettings* _search_settings;
	GtkSourceSearchContext* _search_context;
};

typedef enum  {
	SEARCH_AND_REPLACE_MODE_SEARCH,
	SEARCH_AND_REPLACE_MODE_SEARCH_AND_REPLACE
} SearchAndReplaceMode;

struct _Block29Data {
	int _ref_count_;
	SearchAndReplace* self;
	GtkButton* button_previous;
	GtkButton* button_next;
	GtkButton* button_replace;
	GtkButton* button_replace_all;
};

struct _Block30Data {
	int _ref_count_;
	SearchAndReplace* self;
	GtkMenu* menu;
};

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

struct _DocumentClass {
	TeplBufferClass parent_class;
};


static gpointer goto_line_parent_class = NULL;
static gpointer search_and_replace_parent_class = NULL;

GType goto_line_get_type (void) G_GNUC_CONST;
GType main_window_get_type (void) G_GNUC_CONST;
#define GOTO_LINE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_GOTO_LINE, GotoLinePrivate))
GotoLine* goto_line_new (MainWindow* main_window);
GotoLine* goto_line_construct (GType object_type,
                               MainWindow* main_window);
static void __lambda51_ (GotoLine* self);
static void ___lambda51__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static void __lambda52_ (GotoLine* self);
static void ___lambda52__gtk_entry_activate (GtkEntry* _sender,
                                      gpointer self);
static void __lambda53_ (GotoLine* self);
static void ___lambda53__gtk_entry_icon_press (GtkEntry* _sender,
                                        GtkEntryIconPosition icon_pos,
                                        GdkEventButton* event,
                                        gpointer self);
static void goto_line_on_changed (GotoLine* self);
static void _goto_line_on_changed_gtk_editable_changed (GtkEditable* _sender,
                                                 gpointer self);
void goto_line_show (GotoLine* self);
void error_entry_remove_error (GtkWidget* widget);
void error_entry_add_error (GtkWidget* widget);
GType document_view_get_type (void) G_GNUC_CONST;
DocumentView* main_window_get_active_view (MainWindow* self);
static void goto_line_finalize (GObject * obj);
GType search_and_replace_get_type (void) G_GNUC_CONST;
#define SEARCH_AND_REPLACE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_SEARCH_AND_REPLACE, SearchAndReplacePrivate))
static GType search_and_replace_mode_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static SearchAndReplaceMode search_and_replace_get_mode (SearchAndReplace* self);
SearchAndReplace* search_and_replace_new (MainWindow* main_window);
SearchAndReplace* search_and_replace_construct (GType object_type,
                                                MainWindow* main_window);
static Block29Data* block29_data_ref (Block29Data* _data29_);
static void block29_data_unref (void * _userdata_);
static void search_and_replace_init_find_entry (SearchAndReplace* self);
static GtkButton* search_and_replace_get_button (SearchAndReplace* self,
                                          const gchar* icon_name);
static void __lambda55_ (SearchAndReplace* self);
static void ___lambda55__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
void search_and_replace_hide (SearchAndReplace* self);
static void _search_and_replace_hide_gtk_button_clicked (GtkButton* _sender,
                                                  gpointer self);
static void search_and_replace_search_forward (SearchAndReplace* self);
static void _search_and_replace_search_forward_gtk_button_clicked (GtkButton* _sender,
                                                            gpointer self);
static void _search_and_replace_search_forward_gtk_entry_activate (GtkEntry* _sender,
                                                            gpointer self);
static void _search_and_replace_search_forward_gtk_search_entry_next_match (GtkSearchEntry* _sender,
                                                                     gpointer self);
static void search_and_replace_search_backward (SearchAndReplace* self);
static void _search_and_replace_search_backward_gtk_button_clicked (GtkButton* _sender,
                                                             gpointer self);
static void _search_and_replace_search_backward_gtk_search_entry_previous_match (GtkSearchEntry* _sender,
                                                                          gpointer self);
static void __lambda57_ (Block29Data* _data29_);
static void ___lambda57__gtk_editable_changed (GtkEditable* _sender,
                                        gpointer self);
static void search_and_replace_replace (SearchAndReplace* self);
static void _search_and_replace_replace_gtk_button_clicked (GtkButton* _sender,
                                                     gpointer self);
static void _search_and_replace_replace_gtk_entry_activate (GtkEntry* _sender,
                                                     gpointer self);
static void __lambda58_ (SearchAndReplace* self);
static void ___lambda58__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static void _search_and_replace_hide_gtk_search_entry_stop_search (GtkSearchEntry* _sender,
                                                            gpointer self);
static gboolean __lambda59_ (SearchAndReplace* self,
                      GdkEventKey* event);
void search_and_replace_show_search_and_replace (SearchAndReplace* self);
static gboolean ___lambda59__gtk_widget_key_press_event (GtkWidget* _sender,
                                                  GdkEventKey* event,
                                                  gpointer self);
static Block30Data* block30_data_ref (Block30Data* _data30_);
static void block30_data_unref (void * _userdata_);
static void __lambda54_ (Block30Data* _data30_,
                  GtkEntryIconPosition icon_pos,
                  GdkEventButton* event);
static void ___lambda54__gtk_entry_icon_press (GtkEntry* _sender,
                                        GtkEntryIconPosition icon_pos,
                                        GdkEventButton* event,
                                        gpointer self);
GtkWidget* search_and_replace_get_widget (SearchAndReplace* self);
void search_and_replace_show_search (SearchAndReplace* self);
static void search_and_replace_show (SearchAndReplace* self);
GType document_tab_get_type (void) G_GNUC_CONST;
DocumentTab* main_window_get_active_tab (MainWindow* self);
GType document_get_type (void) G_GNUC_CONST;
Document* main_window_get_active_document (MainWindow* self);
static void search_and_replace_connect_active_document (SearchAndReplace* self);
static void _search_and_replace_connect_active_document_g_object_notify (GObject* _sender,
                                                                  GParamSpec* pspec,
                                                                  gpointer self);
static void search_and_replace_destroy_search_context (SearchAndReplace* self);
static void search_and_replace_mark_set_cb (SearchAndReplace* self,
                                     GtkTextBuffer* buffer,
                                     GtkTextIter* location,
                                     GtkTextMark* mark);
static void _search_and_replace_mark_set_cb_gtk_text_buffer_mark_set (GtkTextBuffer* _sender,
                                                               GtkTextIter* location,
                                                               GtkTextMark* mark,
                                                               gpointer self);
static void __lambda56_ (SearchAndReplace* self);
static void search_and_replace_update_info_label (SearchAndReplace* self);
static void ___lambda56__g_object_notify (GObject* _sender,
                                   GParamSpec* pspec,
                                   gpointer self);
gboolean document_get_readonly (Document* self);
TeplView* tepl_tab_get_view (TeplTab* self);
static void search_and_replace_finalize (GObject * obj);


static void
__lambda51_ (GotoLine* self)
{
#line 38 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_widget_hide ((GtkWidget*) self);
#line 305 "search.c"
}


static void
___lambda51__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
#line 38 "/home/seb/gnome/gnome-latex/src/search.vala"
	__lambda51_ ((GotoLine*) self);
#line 315 "search.c"
}


static void
__lambda52_ (GotoLine* self)
{
#line 52 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_widget_hide ((GtkWidget*) self);
#line 324 "search.c"
}


static void
___lambda52__gtk_entry_activate (GtkEntry* _sender,
                                 gpointer self)
{
#line 52 "/home/seb/gnome/gnome-latex/src/search.vala"
	__lambda52_ ((GotoLine*) self);
#line 334 "search.c"
}


static void
__lambda53_ (GotoLine* self)
{
#line 53 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_widget_hide ((GtkWidget*) self);
#line 343 "search.c"
}


static void
___lambda53__gtk_entry_icon_press (GtkEntry* _sender,
                                   GtkEntryIconPosition icon_pos,
                                   GdkEventButton* event,
                                   gpointer self)
{
#line 53 "/home/seb/gnome/gnome-latex/src/search.vala"
	__lambda53_ ((GotoLine*) self);
#line 355 "search.c"
}


static void
_goto_line_on_changed_gtk_editable_changed (GtkEditable* _sender,
                                            gpointer self)
{
#line 54 "/home/seb/gnome/gnome-latex/src/search.vala"
	goto_line_on_changed ((GotoLine*) self);
#line 365 "search.c"
}


GotoLine*
goto_line_construct (GType object_type,
                     MainWindow* main_window)
{
	GotoLine * self = NULL;
	GtkButton* close_button = NULL;
	GtkButton* _tmp0_;
	GtkImage* img = NULL;
	GtkImage* _tmp1_;
	GtkLabel* label = NULL;
	GtkLabel* _tmp2_;
	GtkEntry* _tmp3_;
	GtkEntry* _tmp4_;
	GIcon* icon = NULL;
	GThemedIcon* _tmp5_;
	GtkEntry* _tmp6_;
	GtkEntry* _tmp7_;
	GtkEntry* _tmp8_;
	GtkEntry* _tmp9_;
	GtkEntry* _tmp10_;
	GtkEntry* _tmp11_;
	GtkEntry* _tmp12_;
#line 27 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_return_val_if_fail (main_window != NULL, NULL);
#line 27 "/home/seb/gnome/gnome-latex/src/search.vala"
	self = (GotoLine*) g_object_new (object_type, NULL);
#line 29 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_orientable_set_orientation ((GtkOrientable*) self, GTK_ORIENTATION_HORIZONTAL);
#line 30 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_grid_set_column_spacing ((GtkGrid*) self, (guint) 3);
#line 31 "/home/seb/gnome/gnome-latex/src/search.vala"
	self->priv->main_window = main_window;
#line 33 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp0_ = (GtkButton*) gtk_button_new ();
#line 33 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_object_ref_sink (_tmp0_);
#line 33 "/home/seb/gnome/gnome-latex/src/search.vala"
	close_button = _tmp0_;
#line 34 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) close_button);
#line 35 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_button_set_relief (close_button, GTK_RELIEF_NONE);
#line 36 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp1_ = (GtkImage*) gtk_image_new_from_icon_name ("window-close", (GtkIconSize) GTK_ICON_SIZE_MENU);
#line 36 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_object_ref_sink (_tmp1_);
#line 36 "/home/seb/gnome/gnome-latex/src/search.vala"
	img = _tmp1_;
#line 37 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_container_add ((GtkContainer*) close_button, (GtkWidget*) img);
#line 38 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_signal_connect_object (close_button, "clicked", (GCallback) ___lambda51__gtk_button_clicked, self, 0);
#line 40 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp2_ = (GtkLabel*) gtk_label_new (_ ("Go to Line:"));
#line 40 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_object_ref_sink (_tmp2_);
#line 40 "/home/seb/gnome/gnome-latex/src/search.vala"
	label = _tmp2_;
#line 41 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_widget_set_margin_start ((GtkWidget*) label, 2);
#line 42 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_widget_set_margin_end ((GtkWidget*) label, 2);
#line 43 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) label);
#line 45 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp3_ = (GtkEntry*) gtk_entry_new ();
#line 45 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_object_ref_sink (_tmp3_);
#line 45 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (self->priv->entry);
#line 45 "/home/seb/gnome/gnome-latex/src/search.vala"
	self->priv->entry = _tmp3_;
#line 46 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp4_ = self->priv->entry;
#line 46 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp4_);
#line 47 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp5_ = (GThemedIcon*) g_themed_icon_new_with_default_fallbacks ("go-jump-symbolic");
#line 47 "/home/seb/gnome/gnome-latex/src/search.vala"
	icon = (GIcon*) _tmp5_;
#line 48 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp6_ = self->priv->entry;
#line 48 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_entry_set_icon_from_gicon (_tmp6_, GTK_ENTRY_ICON_SECONDARY, icon);
#line 49 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp7_ = self->priv->entry;
#line 49 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_entry_set_icon_activatable (_tmp7_, GTK_ENTRY_ICON_SECONDARY, TRUE);
#line 50 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp8_ = self->priv->entry;
#line 50 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp8_, _ ("Line you want to move the cursor to"));
#line 51 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp9_ = self->priv->entry;
#line 51 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_widget_set_size_request ((GtkWidget*) _tmp9_, 100, -1);
#line 52 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp10_ = self->priv->entry;
#line 52 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_signal_connect_object (_tmp10_, "activate", (GCallback) ___lambda52__gtk_entry_activate, self, 0);
#line 53 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp11_ = self->priv->entry;
#line 53 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_signal_connect_object (_tmp11_, "icon-press", (GCallback) ___lambda53__gtk_entry_icon_press, self, 0);
#line 54 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp12_ = self->priv->entry;
#line 54 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_signal_connect_object ((GtkEditable*) _tmp12_, "changed", (GCallback) _goto_line_on_changed_gtk_editable_changed, self, 0);
#line 27 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (icon);
#line 27 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (label);
#line 27 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (img);
#line 27 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (close_button);
#line 27 "/home/seb/gnome/gnome-latex/src/search.vala"
	return self;
#line 487 "search.c"
}


GotoLine*
goto_line_new (MainWindow* main_window)
{
#line 27 "/home/seb/gnome/gnome-latex/src/search.vala"
	return goto_line_construct (TYPE_GOTO_LINE, main_window);
#line 496 "search.c"
}


void
goto_line_show (GotoLine* self)
{
	GtkEntry* _tmp0_;
	GtkEntry* _tmp1_;
#line 57 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_return_if_fail (self != NULL);
#line 59 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp0_ = self->priv->entry;
#line 59 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_entry_set_text (_tmp0_, "");
#line 60 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_widget_show_all ((GtkWidget*) self);
#line 61 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp1_ = self->priv->entry;
#line 61 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_widget_grab_focus ((GtkWidget*) _tmp1_);
#line 517 "search.c"
}


static gchar
string_get (const gchar* self,
            glong index)
{
	gchar result = '\0';
	gchar _tmp0_;
#line 1180 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, '\0');
#line 1181 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
	_tmp0_ = ((gchar*) self)[index];
#line 1181 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
	result = _tmp0_;
#line 1181 "/home/seb/jhbuild/share/vala-0.40/vapi/glib-2.0.vapi"
	return result;
#line 535 "search.c"
}


static void
goto_line_on_changed (GotoLine* self)
{
	GtkEntry* _tmp0_;
	guint _tmp1_;
	guint _tmp2_;
	gchar* text = NULL;
	GtkEntry* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	gint line = 0;
	const gchar* _tmp17_;
	MainWindow* _tmp18_;
	DocumentView* _tmp19_;
	DocumentView* _tmp20_;
	gint _tmp21_;
#line 64 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_return_if_fail (self != NULL);
#line 66 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp0_ = self->priv->entry;
#line 66 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp1_ = gtk_entry_get_text_length (_tmp0_);
#line 66 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp2_ = _tmp1_;
#line 66 "/home/seb/gnome/gnome-latex/src/search.vala"
	if (_tmp2_ == ((guint) 0)) {
#line 565 "search.c"
		GtkEntry* _tmp3_;
#line 68 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp3_ = self->priv->entry;
#line 68 "/home/seb/gnome/gnome-latex/src/search.vala"
		error_entry_remove_error ((GtkWidget*) _tmp3_);
#line 69 "/home/seb/gnome/gnome-latex/src/search.vala"
		return;
#line 573 "search.c"
	}
#line 72 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp4_ = self->priv->entry;
#line 72 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp5_ = gtk_entry_get_text (_tmp4_);
#line 72 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp6_ = g_strdup (_tmp5_);
#line 72 "/home/seb/gnome/gnome-latex/src/search.vala"
	text = _tmp6_;
#line 583 "search.c"
	{
		gint i = 0;
#line 75 "/home/seb/gnome/gnome-latex/src/search.vala"
		i = 0;
#line 588 "search.c"
		{
			gboolean _tmp7_ = FALSE;
#line 75 "/home/seb/gnome/gnome-latex/src/search.vala"
			_tmp7_ = TRUE;
#line 75 "/home/seb/gnome/gnome-latex/src/search.vala"
			while (TRUE) {
#line 595 "search.c"
				gint _tmp9_;
				const gchar* _tmp10_;
				gint _tmp11_;
				gint _tmp12_;
				gunichar c = 0U;
				const gchar* _tmp13_;
				gint _tmp14_;
				gunichar _tmp15_;
#line 75 "/home/seb/gnome/gnome-latex/src/search.vala"
				if (!_tmp7_) {
#line 606 "search.c"
					gint _tmp8_;
#line 75 "/home/seb/gnome/gnome-latex/src/search.vala"
					_tmp8_ = i;
#line 75 "/home/seb/gnome/gnome-latex/src/search.vala"
					i = _tmp8_ + 1;
#line 612 "search.c"
				}
#line 75 "/home/seb/gnome/gnome-latex/src/search.vala"
				_tmp7_ = FALSE;
#line 75 "/home/seb/gnome/gnome-latex/src/search.vala"
				_tmp9_ = i;
#line 75 "/home/seb/gnome/gnome-latex/src/search.vala"
				_tmp10_ = text;
#line 75 "/home/seb/gnome/gnome-latex/src/search.vala"
				_tmp11_ = strlen (_tmp10_);
#line 75 "/home/seb/gnome/gnome-latex/src/search.vala"
				_tmp12_ = _tmp11_;
#line 75 "/home/seb/gnome/gnome-latex/src/search.vala"
				if (!(_tmp9_ < _tmp12_)) {
#line 75 "/home/seb/gnome/gnome-latex/src/search.vala"
					break;
#line 628 "search.c"
				}
#line 77 "/home/seb/gnome/gnome-latex/src/search.vala"
				_tmp13_ = text;
#line 77 "/home/seb/gnome/gnome-latex/src/search.vala"
				_tmp14_ = i;
#line 77 "/home/seb/gnome/gnome-latex/src/search.vala"
				c = (gunichar) string_get (_tmp13_, (glong) _tmp14_);
#line 78 "/home/seb/gnome/gnome-latex/src/search.vala"
				_tmp15_ = c;
#line 78 "/home/seb/gnome/gnome-latex/src/search.vala"
				if (!g_unichar_isdigit (_tmp15_)) {
#line 640 "search.c"
					GtkEntry* _tmp16_;
#line 80 "/home/seb/gnome/gnome-latex/src/search.vala"
					_tmp16_ = self->priv->entry;
#line 80 "/home/seb/gnome/gnome-latex/src/search.vala"
					error_entry_add_error ((GtkWidget*) _tmp16_);
#line 81 "/home/seb/gnome/gnome-latex/src/search.vala"
					_g_free0 (text);
#line 81 "/home/seb/gnome/gnome-latex/src/search.vala"
					return;
#line 650 "search.c"
				}
			}
		}
	}
#line 85 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp17_ = text;
#line 85 "/home/seb/gnome/gnome-latex/src/search.vala"
	line = atoi (_tmp17_) - 1;
#line 87 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp18_ = self->priv->main_window;
#line 87 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp19_ = main_window_get_active_view (_tmp18_);
#line 87 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp20_ = _tmp19_;
#line 87 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp21_ = line;
#line 87 "/home/seb/gnome/gnome-latex/src/search.vala"
	if (tepl_view_goto_line ((TeplView*) _tmp20_, _tmp21_)) {
#line 669 "search.c"
		GtkEntry* _tmp22_;
#line 88 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp22_ = self->priv->entry;
#line 88 "/home/seb/gnome/gnome-latex/src/search.vala"
		error_entry_remove_error ((GtkWidget*) _tmp22_);
#line 675 "search.c"
	} else {
		GtkEntry* _tmp23_;
#line 90 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp23_ = self->priv->entry;
#line 90 "/home/seb/gnome/gnome-latex/src/search.vala"
		error_entry_add_error ((GtkWidget*) _tmp23_);
#line 682 "search.c"
	}
#line 64 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_free0 (text);
#line 686 "search.c"
}


static void
goto_line_class_init (GotoLineClass * klass)
{
#line 22 "/home/seb/gnome/gnome-latex/src/search.vala"
	goto_line_parent_class = g_type_class_peek_parent (klass);
#line 22 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_type_class_add_private (klass, sizeof (GotoLinePrivate));
#line 22 "/home/seb/gnome/gnome-latex/src/search.vala"
	G_OBJECT_CLASS (klass)->finalize = goto_line_finalize;
#line 699 "search.c"
}


static void
goto_line_instance_init (GotoLine * self)
{
#line 22 "/home/seb/gnome/gnome-latex/src/search.vala"
	self->priv = GOTO_LINE_GET_PRIVATE (self);
#line 708 "search.c"
}


static void
goto_line_finalize (GObject * obj)
{
	GotoLine * self;
#line 22 "/home/seb/gnome/gnome-latex/src/search.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_GOTO_LINE, GotoLine);
#line 25 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (self->priv->entry);
#line 22 "/home/seb/gnome/gnome-latex/src/search.vala"
	G_OBJECT_CLASS (goto_line_parent_class)->finalize (obj);
#line 722 "search.c"
}


GType
goto_line_get_type (void)
{
	static volatile gsize goto_line_type_id__volatile = 0;
	if (g_once_init_enter (&goto_line_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GotoLineClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) goto_line_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GotoLine), 0, (GInstanceInitFunc) goto_line_instance_init, NULL };
		GType goto_line_type_id;
		goto_line_type_id = g_type_register_static (gtk_grid_get_type (), "GotoLine", &g_define_type_info, 0);
		g_once_init_leave (&goto_line_type_id__volatile, goto_line_type_id);
	}
	return goto_line_type_id__volatile;
}


static GType
search_and_replace_mode_get_type (void)
{
	static volatile gsize search_and_replace_mode_type_id__volatile = 0;
	if (g_once_init_enter (&search_and_replace_mode_type_id__volatile)) {
		static const GEnumValue values[] = {{SEARCH_AND_REPLACE_MODE_SEARCH, "SEARCH_AND_REPLACE_MODE_SEARCH", "search"}, {SEARCH_AND_REPLACE_MODE_SEARCH_AND_REPLACE, "SEARCH_AND_REPLACE_MODE_SEARCH_AND_REPLACE", "search-and-replace"}, {0, NULL, NULL}};
		GType search_and_replace_mode_type_id;
		search_and_replace_mode_type_id = g_enum_register_static ("SearchAndReplaceMode", values);
		g_once_init_leave (&search_and_replace_mode_type_id__volatile, search_and_replace_mode_type_id);
	}
	return search_and_replace_mode_type_id__volatile;
}


static SearchAndReplaceMode
search_and_replace_get_mode (SearchAndReplace* self)
{
	SearchAndReplaceMode result = 0;
	SearchAndReplaceMode _tmp0_ = 0;
	GtkArrow* _tmp1_;
	GtkArrowType _tmp2_;
	GtkArrowType _tmp3_;
#line 117 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_return_val_if_fail (self != NULL, 0);
#line 119 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp1_ = self->priv->_arrow;
#line 119 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_object_get (_tmp1_, "arrow-type", &_tmp2_, NULL);
#line 119 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp3_ = _tmp2_;
#line 119 "/home/seb/gnome/gnome-latex/src/search.vala"
	if (_tmp3_ == GTK_ARROW_UP) {
#line 119 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp0_ = SEARCH_AND_REPLACE_MODE_SEARCH_AND_REPLACE;
#line 774 "search.c"
	} else {
#line 119 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp0_ = SEARCH_AND_REPLACE_MODE_SEARCH;
#line 778 "search.c"
	}
#line 119 "/home/seb/gnome/gnome-latex/src/search.vala"
	result = _tmp0_;
#line 119 "/home/seb/gnome/gnome-latex/src/search.vala"
	return result;
#line 784 "search.c"
}


static Block29Data*
block29_data_ref (Block29Data* _data29_)
{
#line 122 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_atomic_int_inc (&_data29_->_ref_count_);
#line 122 "/home/seb/gnome/gnome-latex/src/search.vala"
	return _data29_;
#line 795 "search.c"
}


static void
block29_data_unref (void * _userdata_)
{
	Block29Data* _data29_;
	_data29_ = (Block29Data*) _userdata_;
#line 122 "/home/seb/gnome/gnome-latex/src/search.vala"
	if (g_atomic_int_dec_and_test (&_data29_->_ref_count_)) {
#line 806 "search.c"
		SearchAndReplace* self;
#line 122 "/home/seb/gnome/gnome-latex/src/search.vala"
		self = _data29_->self;
#line 122 "/home/seb/gnome/gnome-latex/src/search.vala"
		_g_object_unref0 (_data29_->button_replace_all);
#line 122 "/home/seb/gnome/gnome-latex/src/search.vala"
		_g_object_unref0 (_data29_->button_replace);
#line 122 "/home/seb/gnome/gnome-latex/src/search.vala"
		_g_object_unref0 (_data29_->button_next);
#line 122 "/home/seb/gnome/gnome-latex/src/search.vala"
		_g_object_unref0 (_data29_->button_previous);
#line 122 "/home/seb/gnome/gnome-latex/src/search.vala"
		_g_object_unref0 (self);
#line 122 "/home/seb/gnome/gnome-latex/src/search.vala"
		g_slice_free (Block29Data, _data29_);
#line 822 "search.c"
	}
}


static void
__lambda55_ (SearchAndReplace* self)
{
#line 209 "/home/seb/gnome/gnome-latex/src/search.vala"
	if (search_and_replace_get_mode (self) == SEARCH_AND_REPLACE_MODE_SEARCH_AND_REPLACE) {
#line 832 "search.c"
		GtkArrow* _tmp0_;
		GtkGrid* _tmp1_;
#line 211 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp0_ = self->priv->_arrow;
#line 211 "/home/seb/gnome/gnome-latex/src/search.vala"
		g_object_set (_tmp0_, "arrow-type", GTK_ARROW_DOWN, NULL);
#line 212 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp1_ = self->priv->_replace_grid;
#line 212 "/home/seb/gnome/gnome-latex/src/search.vala"
		gtk_widget_hide ((GtkWidget*) _tmp1_);
#line 843 "search.c"
	} else {
		GtkArrow* _tmp2_;
		GtkGrid* _tmp3_;
#line 218 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp2_ = self->priv->_arrow;
#line 218 "/home/seb/gnome/gnome-latex/src/search.vala"
		g_object_set (_tmp2_, "arrow-type", GTK_ARROW_UP, NULL);
#line 219 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp3_ = self->priv->_replace_grid;
#line 219 "/home/seb/gnome/gnome-latex/src/search.vala"
		gtk_widget_show ((GtkWidget*) _tmp3_);
#line 855 "search.c"
	}
}


static void
___lambda55__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
#line 206 "/home/seb/gnome/gnome-latex/src/search.vala"
	__lambda55_ ((SearchAndReplace*) self);
#line 866 "search.c"
}


static void
_search_and_replace_hide_gtk_button_clicked (GtkButton* _sender,
                                             gpointer self)
{
#line 223 "/home/seb/gnome/gnome-latex/src/search.vala"
	search_and_replace_hide ((SearchAndReplace*) self);
#line 876 "search.c"
}


static void
_search_and_replace_search_forward_gtk_button_clicked (GtkButton* _sender,
                                                       gpointer self)
{
#line 225 "/home/seb/gnome/gnome-latex/src/search.vala"
	search_and_replace_search_forward ((SearchAndReplace*) self);
#line 886 "search.c"
}


static void
_search_and_replace_search_forward_gtk_entry_activate (GtkEntry* _sender,
                                                       gpointer self)
{
#line 226 "/home/seb/gnome/gnome-latex/src/search.vala"
	search_and_replace_search_forward ((SearchAndReplace*) self);
#line 896 "search.c"
}


static void
_search_and_replace_search_forward_gtk_search_entry_next_match (GtkSearchEntry* _sender,
                                                                gpointer self)
{
#line 227 "/home/seb/gnome/gnome-latex/src/search.vala"
	search_and_replace_search_forward ((SearchAndReplace*) self);
#line 906 "search.c"
}


static void
_search_and_replace_search_backward_gtk_button_clicked (GtkButton* _sender,
                                                        gpointer self)
{
#line 229 "/home/seb/gnome/gnome-latex/src/search.vala"
	search_and_replace_search_backward ((SearchAndReplace*) self);
#line 916 "search.c"
}


static void
_search_and_replace_search_backward_gtk_search_entry_previous_match (GtkSearchEntry* _sender,
                                                                     gpointer self)
{
#line 230 "/home/seb/gnome/gnome-latex/src/search.vala"
	search_and_replace_search_backward ((SearchAndReplace*) self);
#line 926 "search.c"
}


static void
__lambda57_ (Block29Data* _data29_)
{
	SearchAndReplace* self;
	gboolean sensitive = FALSE;
	GtkSearchEntry* _tmp0_;
	guint _tmp1_;
	guint _tmp2_;
#line 232 "/home/seb/gnome/gnome-latex/src/search.vala"
	self = _data29_->self;
#line 234 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp0_ = self->priv->_entry_find;
#line 234 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp1_ = gtk_entry_get_text_length ((GtkEntry*) _tmp0_);
#line 234 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp2_ = _tmp1_;
#line 234 "/home/seb/gnome/gnome-latex/src/search.vala"
	sensitive = _tmp2_ > ((guint) 0);
#line 235 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_widget_set_sensitive ((GtkWidget*) _data29_->button_previous, sensitive);
#line 236 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_widget_set_sensitive ((GtkWidget*) _data29_->button_next, sensitive);
#line 237 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_widget_set_sensitive ((GtkWidget*) _data29_->button_replace, sensitive);
#line 238 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_widget_set_sensitive ((GtkWidget*) _data29_->button_replace_all, sensitive);
#line 956 "search.c"
}


static void
___lambda57__gtk_editable_changed (GtkEditable* _sender,
                                   gpointer self)
{
#line 232 "/home/seb/gnome/gnome-latex/src/search.vala"
	__lambda57_ (self);
#line 966 "search.c"
}


static void
_search_and_replace_replace_gtk_button_clicked (GtkButton* _sender,
                                                gpointer self)
{
#line 241 "/home/seb/gnome/gnome-latex/src/search.vala"
	search_and_replace_replace ((SearchAndReplace*) self);
#line 976 "search.c"
}


static void
_search_and_replace_replace_gtk_entry_activate (GtkEntry* _sender,
                                                gpointer self)
{
#line 242 "/home/seb/gnome/gnome-latex/src/search.vala"
	search_and_replace_replace ((SearchAndReplace*) self);
#line 986 "search.c"
}


static void
__lambda58_ (SearchAndReplace* self)
{
	GtkSourceSearchContext* _tmp0_;
	GError * _inner_error_ = NULL;
#line 246 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp0_ = self->priv->_search_context;
#line 246 "/home/seb/gnome/gnome-latex/src/search.vala"
	if (_tmp0_ != NULL) {
#line 999 "search.c"
		MainWindow* _tmp1_;
		DocumentView* _tmp2_;
		DocumentView* _tmp3_;
		GtkSourceCompletion* _tmp4_;
		GtkSourceCompletion* _tmp5_;
		MainWindow* _tmp10_;
		DocumentView* _tmp11_;
		DocumentView* _tmp12_;
		GtkSourceCompletion* _tmp13_;
		GtkSourceCompletion* _tmp14_;
#line 248 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp1_ = self->priv->_main_window;
#line 248 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp2_ = main_window_get_active_view (_tmp1_);
#line 248 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp3_ = _tmp2_;
#line 248 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp4_ = gtk_source_view_get_completion ((GtkSourceView*) _tmp3_);
#line 248 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp5_ = _tmp4_;
#line 248 "/home/seb/gnome/gnome-latex/src/search.vala"
		gtk_source_completion_block_interactive (_tmp5_);
#line 1022 "search.c"
		{
			GtkSourceSearchContext* _tmp6_;
			GtkSearchEntry* _tmp7_;
			const gchar* _tmp8_;
			const gchar* _tmp9_;
#line 252 "/home/seb/gnome/gnome-latex/src/search.vala"
			_tmp6_ = self->priv->_search_context;
#line 252 "/home/seb/gnome/gnome-latex/src/search.vala"
			_tmp7_ = self->priv->_entry_replace;
#line 252 "/home/seb/gnome/gnome-latex/src/search.vala"
			_tmp8_ = gtk_entry_get_text ((GtkEntry*) _tmp7_);
#line 252 "/home/seb/gnome/gnome-latex/src/search.vala"
			_tmp9_ = _tmp8_;
#line 252 "/home/seb/gnome/gnome-latex/src/search.vala"
			gtk_source_search_context_replace_all (_tmp6_, _tmp9_, -1, &_inner_error_);
#line 252 "/home/seb/gnome/gnome-latex/src/search.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1040 "search.c"
				goto __catch39_g_error;
			}
		}
		goto __finally39;
		__catch39_g_error:
		{
			GError* e = NULL;
#line 250 "/home/seb/gnome/gnome-latex/src/search.vala"
			e = _inner_error_;
#line 250 "/home/seb/gnome/gnome-latex/src/search.vala"
			_inner_error_ = NULL;
#line 250 "/home/seb/gnome/gnome-latex/src/search.vala"
			_g_error_free0 (e);
#line 1054 "search.c"
		}
		__finally39:
#line 250 "/home/seb/gnome/gnome-latex/src/search.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 250 "/home/seb/gnome/gnome-latex/src/search.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 250 "/home/seb/gnome/gnome-latex/src/search.vala"
			g_clear_error (&_inner_error_);
#line 250 "/home/seb/gnome/gnome-latex/src/search.vala"
			return;
#line 1065 "search.c"
		}
#line 259 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp10_ = self->priv->_main_window;
#line 259 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp11_ = main_window_get_active_view (_tmp10_);
#line 259 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp12_ = _tmp11_;
#line 259 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp13_ = gtk_source_view_get_completion ((GtkSourceView*) _tmp12_);
#line 259 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp14_ = _tmp13_;
#line 259 "/home/seb/gnome/gnome-latex/src/search.vala"
		gtk_source_completion_unblock_interactive (_tmp14_);
#line 1079 "search.c"
	}
}


static void
___lambda58__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
#line 244 "/home/seb/gnome/gnome-latex/src/search.vala"
	__lambda58_ ((SearchAndReplace*) self);
#line 1090 "search.c"
}


static void
_search_and_replace_hide_gtk_search_entry_stop_search (GtkSearchEntry* _sender,
                                                       gpointer self)
{
#line 263 "/home/seb/gnome/gnome-latex/src/search.vala"
	search_and_replace_hide ((SearchAndReplace*) self);
#line 1100 "search.c"
}


static gboolean
__lambda59_ (SearchAndReplace* self,
             GdkEventKey* event)
{
	gboolean result = FALSE;
	guint _tmp0_;
#line 264 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_return_val_if_fail (event != NULL, FALSE);
#line 266 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp0_ = event->keyval;
#line 266 "/home/seb/gnome/gnome-latex/src/search.vala"
	switch (_tmp0_) {
#line 266 "/home/seb/gnome/gnome-latex/src/search.vala"
		case GDK_KEY_Tab:
#line 1118 "search.c"
		{
			GtkSearchEntry* _tmp1_;
#line 270 "/home/seb/gnome/gnome-latex/src/search.vala"
			search_and_replace_show_search_and_replace (self);
#line 271 "/home/seb/gnome/gnome-latex/src/search.vala"
			_tmp1_ = self->priv->_entry_replace;
#line 271 "/home/seb/gnome/gnome-latex/src/search.vala"
			gtk_widget_grab_focus ((GtkWidget*) _tmp1_);
#line 272 "/home/seb/gnome/gnome-latex/src/search.vala"
			result = TRUE;
#line 272 "/home/seb/gnome/gnome-latex/src/search.vala"
			return result;
#line 1131 "search.c"
		}
		default:
		{
#line 276 "/home/seb/gnome/gnome-latex/src/search.vala"
			result = FALSE;
#line 276 "/home/seb/gnome/gnome-latex/src/search.vala"
			return result;
#line 1139 "search.c"
		}
	}
}


static gboolean
___lambda59__gtk_widget_key_press_event (GtkWidget* _sender,
                                         GdkEventKey* event,
                                         gpointer self)
{
	gboolean result;
	result = __lambda59_ ((SearchAndReplace*) self, event);
#line 264 "/home/seb/gnome/gnome-latex/src/search.vala"
	return result;
#line 1154 "search.c"
}


SearchAndReplace*
search_and_replace_construct (GType object_type,
                              MainWindow* main_window)
{
	SearchAndReplace * self = NULL;
	Block29Data* _data29_;
	GtkSourceSearchSettings* _tmp0_;
	GtkSourceSearchSettings* _tmp1_;
	GtkGrid* _tmp2_;
	GtkGrid* _tmp3_;
	GtkGrid* _tmp4_;
	GtkButton* button_arrow = NULL;
	GtkButton* _tmp5_;
	GtkArrow* _tmp6_;
	GtkArrow* _tmp7_;
	GtkGrid* _tmp8_;
	GtkGrid* find_grid = NULL;
	GtkGrid* _tmp9_;
	GtkGrid* _tmp10_;
	GtkSearchEntry* _tmp11_;
	GtkButton* _tmp12_;
	GtkButton* _tmp13_;
	GtkButton* button_close = NULL;
	GtkButton* _tmp14_;
	GtkLabel* _tmp15_;
	GtkLabel* _tmp16_;
	GtkLabel* _tmp17_;
	GtkGrid* _tmp18_;
	GtkGrid* _tmp19_;
	GtkGrid* _tmp20_;
	GtkGrid* _tmp21_;
	GtkGrid* _tmp22_;
	GtkSearchEntry* _tmp23_;
	GtkSearchEntry* _tmp24_;
	GtkSearchEntry* _tmp25_;
	GtkSearchEntry* _tmp26_;
	GtkSearchEntry* _tmp27_;
	GtkGrid* _tmp28_;
	GtkSearchEntry* _tmp29_;
	GtkButton* _tmp30_;
	GtkButton* _tmp31_;
	GtkGrid* replace_all_grid = NULL;
	GtkGrid* _tmp32_;
	GtkImage* image = NULL;
	GtkImage* _tmp33_;
	GtkLabel* label = NULL;
	GtkLabel* _tmp34_;
	GtkGrid* _tmp35_;
	GtkGrid* _tmp36_;
	GtkSearchEntry* _tmp37_;
	GtkSearchEntry* _tmp38_;
	GtkSearchEntry* _tmp39_;
	GtkSearchEntry* _tmp40_;
	GtkSearchEntry* _tmp41_;
	GtkSearchEntry* _tmp42_;
	GtkSearchEntry* _tmp43_;
	GtkGrid* _tmp44_;
#line 122 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_return_val_if_fail (main_window != NULL, NULL);
#line 122 "/home/seb/gnome/gnome-latex/src/search.vala"
	_data29_ = g_slice_new0 (Block29Data);
#line 122 "/home/seb/gnome/gnome-latex/src/search.vala"
	_data29_->_ref_count_ = 1;
#line 122 "/home/seb/gnome/gnome-latex/src/search.vala"
	self = (SearchAndReplace*) g_object_new (object_type, NULL);
#line 122 "/home/seb/gnome/gnome-latex/src/search.vala"
	_data29_->self = g_object_ref (self);
#line 124 "/home/seb/gnome/gnome-latex/src/search.vala"
	self->priv->_main_window = main_window;
#line 126 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp0_ = gtk_source_search_settings_new ();
#line 126 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (self->priv->_search_settings);
#line 126 "/home/seb/gnome/gnome-latex/src/search.vala"
	self->priv->_search_settings = _tmp0_;
#line 127 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp1_ = self->priv->_search_settings;
#line 127 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_source_search_settings_set_wrap_around (_tmp1_, TRUE);
#line 129 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp2_ = (GtkGrid*) gtk_grid_new ();
#line 129 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_object_ref_sink (_tmp2_);
#line 129 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (self->priv->_main_grid);
#line 129 "/home/seb/gnome/gnome-latex/src/search.vala"
	self->priv->_main_grid = _tmp2_;
#line 130 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp3_ = self->priv->_main_grid;
#line 130 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_grid_set_column_spacing (_tmp3_, (guint) 3);
#line 131 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp4_ = self->priv->_main_grid;
#line 131 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_grid_set_row_spacing (_tmp4_, (guint) 3);
#line 134 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp5_ = (GtkButton*) gtk_button_new ();
#line 134 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_object_ref_sink (_tmp5_);
#line 134 "/home/seb/gnome/gnome-latex/src/search.vala"
	button_arrow = _tmp5_;
#line 135 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp6_ = (GtkArrow*) gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_OUT);
#line 135 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_object_ref_sink (_tmp6_);
#line 135 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (self->priv->_arrow);
#line 135 "/home/seb/gnome/gnome-latex/src/search.vala"
	self->priv->_arrow = _tmp6_;
#line 136 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp7_ = self->priv->_arrow;
#line 136 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_container_add ((GtkContainer*) button_arrow, (GtkWidget*) _tmp7_);
#line 137 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp8_ = self->priv->_main_grid;
#line 137 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_grid_attach (_tmp8_, (GtkWidget*) button_arrow, 0, 0, 1, 1);
#line 140 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp9_ = (GtkGrid*) gtk_grid_new ();
#line 140 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_object_ref_sink (_tmp9_);
#line 140 "/home/seb/gnome/gnome-latex/src/search.vala"
	find_grid = _tmp9_;
#line 141 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_orientable_set_orientation ((GtkOrientable*) find_grid, GTK_ORIENTATION_HORIZONTAL);
#line 142 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_grid_set_column_spacing (find_grid, (guint) 2);
#line 143 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp10_ = self->priv->_main_grid;
#line 143 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_grid_attach (_tmp10_, (GtkWidget*) find_grid, 1, 0, 1, 1);
#line 145 "/home/seb/gnome/gnome-latex/src/search.vala"
	search_and_replace_init_find_entry (self);
#line 146 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp11_ = self->priv->_entry_find;
#line 146 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_container_add ((GtkContainer*) find_grid, (GtkWidget*) _tmp11_);
#line 149 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp12_ = search_and_replace_get_button (self, "go-up");
#line 149 "/home/seb/gnome/gnome-latex/src/search.vala"
	_data29_->button_previous = _tmp12_;
#line 150 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp13_ = search_and_replace_get_button (self, "go-down");
#line 150 "/home/seb/gnome/gnome-latex/src/search.vala"
	_data29_->button_next = _tmp13_;
#line 151 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp14_ = search_and_replace_get_button (self, "window-close");
#line 151 "/home/seb/gnome/gnome-latex/src/search.vala"
	button_close = _tmp14_;
#line 153 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_container_add ((GtkContainer*) find_grid, (GtkWidget*) _data29_->button_previous);
#line 154 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_container_add ((GtkContainer*) find_grid, (GtkWidget*) _data29_->button_next);
#line 155 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_container_add ((GtkContainer*) find_grid, (GtkWidget*) button_close);
#line 157 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_widget_set_sensitive ((GtkWidget*) _data29_->button_previous, FALSE);
#line 158 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_widget_set_sensitive ((GtkWidget*) _data29_->button_next, FALSE);
#line 161 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp15_ = (GtkLabel*) gtk_label_new (NULL);
#line 161 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_object_ref_sink (_tmp15_);
#line 161 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (self->priv->_info_label);
#line 161 "/home/seb/gnome/gnome-latex/src/search.vala"
	self->priv->_info_label = _tmp15_;
#line 162 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp16_ = self->priv->_info_label;
#line 162 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_widget_set_margin_start ((GtkWidget*) _tmp16_, 12);
#line 163 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp17_ = self->priv->_info_label;
#line 163 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_container_add ((GtkContainer*) find_grid, (GtkWidget*) _tmp17_);
#line 166 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp18_ = (GtkGrid*) gtk_grid_new ();
#line 166 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_object_ref_sink (_tmp18_);
#line 166 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (self->priv->_replace_grid);
#line 166 "/home/seb/gnome/gnome-latex/src/search.vala"
	self->priv->_replace_grid = _tmp18_;
#line 167 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp19_ = self->priv->_replace_grid;
#line 167 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_orientable_set_orientation ((GtkOrientable*) _tmp19_, GTK_ORIENTATION_HORIZONTAL);
#line 168 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp20_ = self->priv->_replace_grid;
#line 168 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_grid_set_column_spacing (_tmp20_, (guint) 2);
#line 169 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp21_ = self->priv->_main_grid;
#line 169 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp22_ = self->priv->_replace_grid;
#line 169 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_grid_attach (_tmp21_, (GtkWidget*) _tmp22_, 1, 1, 1, 1);
#line 171 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp23_ = (GtkSearchEntry*) gtk_search_entry_new ();
#line 171 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_object_ref_sink (_tmp23_);
#line 171 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (self->priv->_entry_replace);
#line 171 "/home/seb/gnome/gnome-latex/src/search.vala"
	self->priv->_entry_replace = _tmp23_;
#line 172 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp24_ = self->priv->_entry_replace;
#line 172 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp24_, _ ("Replace with"));
#line 173 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp25_ = self->priv->_entry_replace;
#line 173 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_widget_set_can_focus ((GtkWidget*) _tmp25_, TRUE);
#line 174 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp26_ = self->priv->_entry_replace;
#line 174 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_entry_set_width_chars ((GtkEntry*) _tmp26_, 25);
#line 175 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp27_ = self->priv->_entry_replace;
#line 175 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_object_set ((GtkEntry*) _tmp27_, "primary-icon-gicon", NULL, NULL);
#line 176 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp28_ = self->priv->_replace_grid;
#line 176 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp29_ = self->priv->_entry_replace;
#line 176 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_container_add ((GtkContainer*) _tmp28_, (GtkWidget*) _tmp29_);
#line 179 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp30_ = search_and_replace_get_button (self, "edit-find-replace");
#line 179 "/home/seb/gnome/gnome-latex/src/search.vala"
	_data29_->button_replace = _tmp30_;
#line 180 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_widget_set_tooltip_text ((GtkWidget*) _data29_->button_replace, _ ("Replace"));
#line 183 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp31_ = (GtkButton*) gtk_button_new ();
#line 183 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_object_ref_sink (_tmp31_);
#line 183 "/home/seb/gnome/gnome-latex/src/search.vala"
	_data29_->button_replace_all = _tmp31_;
#line 184 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_widget_set_tooltip_text ((GtkWidget*) _data29_->button_replace_all, _ ("Replace All"));
#line 185 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_button_set_relief (_data29_->button_replace_all, GTK_RELIEF_NONE);
#line 186 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp32_ = (GtkGrid*) gtk_grid_new ();
#line 186 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_object_ref_sink (_tmp32_);
#line 186 "/home/seb/gnome/gnome-latex/src/search.vala"
	replace_all_grid = _tmp32_;
#line 187 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_orientable_set_orientation ((GtkOrientable*) replace_all_grid, GTK_ORIENTATION_HORIZONTAL);
#line 188 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_grid_set_column_spacing (replace_all_grid, (guint) 8);
#line 189 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_widget_set_valign ((GtkWidget*) replace_all_grid, GTK_ALIGN_CENTER);
#line 191 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp33_ = (GtkImage*) gtk_image_new_from_icon_name ("edit-find-replace", (GtkIconSize) GTK_ICON_SIZE_MENU);
#line 191 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_object_ref_sink (_tmp33_);
#line 191 "/home/seb/gnome/gnome-latex/src/search.vala"
	image = _tmp33_;
#line 192 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_container_add ((GtkContainer*) replace_all_grid, (GtkWidget*) image);
#line 194 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp34_ = (GtkLabel*) gtk_label_new (_ ("All"));
#line 194 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_object_ref_sink (_tmp34_);
#line 194 "/home/seb/gnome/gnome-latex/src/search.vala"
	label = _tmp34_;
#line 195 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_container_add ((GtkContainer*) replace_all_grid, (GtkWidget*) label);
#line 196 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_container_add ((GtkContainer*) _data29_->button_replace_all, (GtkWidget*) replace_all_grid);
#line 198 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp35_ = self->priv->_replace_grid;
#line 198 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_container_add ((GtkContainer*) _tmp35_, (GtkWidget*) _data29_->button_replace);
#line 199 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp36_ = self->priv->_replace_grid;
#line 199 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_container_add ((GtkContainer*) _tmp36_, (GtkWidget*) _data29_->button_replace_all);
#line 201 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_widget_set_sensitive ((GtkWidget*) _data29_->button_replace, FALSE);
#line 202 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_widget_set_sensitive ((GtkWidget*) _data29_->button_replace_all, FALSE);
#line 206 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_signal_connect_object (button_arrow, "clicked", (GCallback) ___lambda55__gtk_button_clicked, self, 0);
#line 223 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_signal_connect_object (button_close, "clicked", (GCallback) _search_and_replace_hide_gtk_button_clicked, self, 0);
#line 225 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_signal_connect_object (_data29_->button_next, "clicked", (GCallback) _search_and_replace_search_forward_gtk_button_clicked, self, 0);
#line 226 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp37_ = self->priv->_entry_find;
#line 226 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_signal_connect_object ((GtkEntry*) _tmp37_, "activate", (GCallback) _search_and_replace_search_forward_gtk_entry_activate, self, 0);
#line 227 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp38_ = self->priv->_entry_find;
#line 227 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_signal_connect_object (_tmp38_, "next-match", (GCallback) _search_and_replace_search_forward_gtk_search_entry_next_match, self, 0);
#line 229 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_signal_connect_object (_data29_->button_previous, "clicked", (GCallback) _search_and_replace_search_backward_gtk_button_clicked, self, 0);
#line 230 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp39_ = self->priv->_entry_find;
#line 230 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_signal_connect_object (_tmp39_, "previous-match", (GCallback) _search_and_replace_search_backward_gtk_search_entry_previous_match, self, 0);
#line 232 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp40_ = self->priv->_entry_find;
#line 232 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_signal_connect_data ((GtkEditable*) _tmp40_, "changed", (GCallback) ___lambda57__gtk_editable_changed, block29_data_ref (_data29_), (GClosureNotify) block29_data_unref, 0);
#line 241 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_signal_connect_object (_data29_->button_replace, "clicked", (GCallback) _search_and_replace_replace_gtk_button_clicked, self, 0);
#line 242 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp41_ = self->priv->_entry_replace;
#line 242 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_signal_connect_object ((GtkEntry*) _tmp41_, "activate", (GCallback) _search_and_replace_replace_gtk_entry_activate, self, 0);
#line 244 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_signal_connect_object (_data29_->button_replace_all, "clicked", (GCallback) ___lambda58__gtk_button_clicked, self, 0);
#line 263 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp42_ = self->priv->_entry_find;
#line 263 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_signal_connect_object (_tmp42_, "stop-search", (GCallback) _search_and_replace_hide_gtk_search_entry_stop_search, self, 0);
#line 264 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp43_ = self->priv->_entry_find;
#line 264 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_signal_connect_object ((GtkWidget*) _tmp43_, "key-press-event", (GCallback) ___lambda59__gtk_widget_key_press_event, self, 0);
#line 280 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp44_ = self->priv->_main_grid;
#line 280 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_widget_hide ((GtkWidget*) _tmp44_);
#line 122 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (label);
#line 122 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (image);
#line 122 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (replace_all_grid);
#line 122 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (button_close);
#line 122 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (find_grid);
#line 122 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (button_arrow);
#line 122 "/home/seb/gnome/gnome-latex/src/search.vala"
	block29_data_unref (_data29_);
#line 122 "/home/seb/gnome/gnome-latex/src/search.vala"
	_data29_ = NULL;
#line 122 "/home/seb/gnome/gnome-latex/src/search.vala"
	return self;
#line 1505 "search.c"
}


SearchAndReplace*
search_and_replace_new (MainWindow* main_window)
{
#line 122 "/home/seb/gnome/gnome-latex/src/search.vala"
	return search_and_replace_construct (TYPE_SEARCH_AND_REPLACE, main_window);
#line 1514 "search.c"
}


static Block30Data*
block30_data_ref (Block30Data* _data30_)
{
#line 283 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_atomic_int_inc (&_data30_->_ref_count_);
#line 283 "/home/seb/gnome/gnome-latex/src/search.vala"
	return _data30_;
#line 1525 "search.c"
}


static void
block30_data_unref (void * _userdata_)
{
	Block30Data* _data30_;
	_data30_ = (Block30Data*) _userdata_;
#line 283 "/home/seb/gnome/gnome-latex/src/search.vala"
	if (g_atomic_int_dec_and_test (&_data30_->_ref_count_)) {
#line 1536 "search.c"
		SearchAndReplace* self;
#line 283 "/home/seb/gnome/gnome-latex/src/search.vala"
		self = _data30_->self;
#line 283 "/home/seb/gnome/gnome-latex/src/search.vala"
		_g_object_unref0 (_data30_->menu);
#line 283 "/home/seb/gnome/gnome-latex/src/search.vala"
		_g_object_unref0 (self);
#line 283 "/home/seb/gnome/gnome-latex/src/search.vala"
		g_slice_free (Block30Data, _data30_);
#line 1546 "search.c"
	}
}


static void
__lambda54_ (Block30Data* _data30_,
             GtkEntryIconPosition icon_pos,
             GdkEventButton* event)
{
	SearchAndReplace* self;
#line 318 "/home/seb/gnome/gnome-latex/src/search.vala"
	self = _data30_->self;
#line 318 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_return_if_fail (event != NULL);
#line 320 "/home/seb/gnome/gnome-latex/src/search.vala"
	if (icon_pos == GTK_ENTRY_ICON_PRIMARY) {
#line 1563 "search.c"
		GtkSearchEntry* _tmp0_;
#line 321 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp0_ = self->priv->_entry_find;
#line 321 "/home/seb/gnome/gnome-latex/src/search.vala"
		gtk_menu_popup_at_widget (_data30_->menu, (GtkWidget*) _tmp0_, GDK_GRAVITY_SOUTH_WEST, GDK_GRAVITY_NORTH_WEST, (GdkEvent*) event);
#line 1569 "search.c"
	}
}


static void
___lambda54__gtk_entry_icon_press (GtkEntry* _sender,
                                   GtkEntryIconPosition icon_pos,
                                   GdkEventButton* event,
                                   gpointer self)
{
#line 318 "/home/seb/gnome/gnome-latex/src/search.vala"
	__lambda54_ (self, icon_pos, event);
#line 1582 "search.c"
}


static void
search_and_replace_init_find_entry (SearchAndReplace* self)
{
	Block30Data* _data30_;
	GtkSearchEntry* _tmp0_;
	GtkSearchEntry* _tmp1_;
	GThemedIcon* _tmp2_;
	GThemedIcon* _tmp3_;
	GtkSearchEntry* _tmp4_;
	GtkSearchEntry* _tmp5_;
	GtkSearchEntry* _tmp6_;
	GtkSearchEntry* _tmp7_;
	GtkSearchEntry* _tmp8_;
	GtkSearchEntry* _tmp9_;
	GtkSourceSearchSettings* _tmp10_;
	GtkMenu* _tmp11_;
	GtkCheckMenuItem* check_case_sensitive = NULL;
	GtkCheckMenuItem* _tmp12_;
	GtkCheckMenuItem* check_entire_word = NULL;
	GtkCheckMenuItem* _tmp13_;
	GtkSourceSearchSettings* _tmp14_;
	GtkSourceSearchSettings* _tmp15_;
	GtkSearchEntry* _tmp16_;
#line 283 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_return_if_fail (self != NULL);
#line 283 "/home/seb/gnome/gnome-latex/src/search.vala"
	_data30_ = g_slice_new0 (Block30Data);
#line 283 "/home/seb/gnome/gnome-latex/src/search.vala"
	_data30_->_ref_count_ = 1;
#line 283 "/home/seb/gnome/gnome-latex/src/search.vala"
	_data30_->self = g_object_ref (self);
#line 285 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp0_ = (GtkSearchEntry*) gtk_search_entry_new ();
#line 285 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_object_ref_sink (_tmp0_);
#line 285 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (self->priv->_entry_find);
#line 285 "/home/seb/gnome/gnome-latex/src/search.vala"
	self->priv->_entry_find = _tmp0_;
#line 286 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp1_ = self->priv->_entry_find;
#line 286 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp2_ = (GThemedIcon*) g_themed_icon_new_with_default_fallbacks ("document-properties-symbolic");
#line 286 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp3_ = _tmp2_;
#line 286 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_object_set ((GtkEntry*) _tmp1_, "primary-icon-gicon", (GIcon*) _tmp3_, NULL);
#line 286 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (_tmp3_);
#line 288 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp4_ = self->priv->_entry_find;
#line 288 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_object_set ((GtkEntry*) _tmp4_, "primary-icon-activatable", TRUE, NULL);
#line 289 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp5_ = self->priv->_entry_find;
#line 289 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_object_set ((GtkEntry*) _tmp5_, "primary-icon-sensitive", TRUE, NULL);
#line 290 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp6_ = self->priv->_entry_find;
#line 290 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp6_, _ ("Search for"));
#line 291 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp7_ = self->priv->_entry_find;
#line 291 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_widget_set_can_focus ((GtkWidget*) _tmp7_, TRUE);
#line 292 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp8_ = self->priv->_entry_find;
#line 292 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_entry_set_width_chars ((GtkEntry*) _tmp8_, 25);
#line 294 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp9_ = self->priv->_entry_find;
#line 294 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp10_ = self->priv->_search_settings;
#line 294 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_object_bind_property_with_closures ((GObject*) _tmp9_, "text", (GObject*) _tmp10_, "search-text", G_BINDING_DEFAULT, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
#line 298 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp11_ = (GtkMenu*) gtk_menu_new ();
#line 298 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_object_ref_sink (_tmp11_);
#line 298 "/home/seb/gnome/gnome-latex/src/search.vala"
	_data30_->menu = _tmp11_;
#line 300 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp12_ = (GtkCheckMenuItem*) gtk_check_menu_item_new_with_label (_ ("Case sensitive"));
#line 300 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_object_ref_sink (_tmp12_);
#line 300 "/home/seb/gnome/gnome-latex/src/search.vala"
	check_case_sensitive = _tmp12_;
#line 303 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp13_ = (GtkCheckMenuItem*) gtk_check_menu_item_new_with_label (_ ("Entire words only"));
#line 303 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_object_ref_sink (_tmp13_);
#line 303 "/home/seb/gnome/gnome-latex/src/search.vala"
	check_entire_word = _tmp13_;
#line 306 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_menu_shell_append ((GtkMenuShell*) _data30_->menu, (GtkMenuItem*) check_case_sensitive);
#line 307 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_menu_shell_append ((GtkMenuShell*) _data30_->menu, (GtkMenuItem*) check_entire_word);
#line 308 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_widget_show_all ((GtkWidget*) _data30_->menu);
#line 310 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp14_ = self->priv->_search_settings;
#line 310 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_object_bind_property_with_closures ((GObject*) check_case_sensitive, "active", (GObject*) _tmp14_, "case-sensitive", G_BINDING_DEFAULT, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
#line 314 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp15_ = self->priv->_search_settings;
#line 314 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_object_bind_property_with_closures ((GObject*) check_entire_word, "active", (GObject*) _tmp15_, "at-word-boundaries", G_BINDING_DEFAULT, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
#line 318 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp16_ = self->priv->_entry_find;
#line 318 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_signal_connect_data ((GtkEntry*) _tmp16_, "icon-press", (GCallback) ___lambda54__gtk_entry_icon_press, block30_data_ref (_data30_), (GClosureNotify) block30_data_unref, 0);
#line 283 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (check_entire_word);
#line 283 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (check_case_sensitive);
#line 283 "/home/seb/gnome/gnome-latex/src/search.vala"
	block30_data_unref (_data30_);
#line 283 "/home/seb/gnome/gnome-latex/src/search.vala"
	_data30_ = NULL;
#line 1705 "search.c"
}


static GtkButton*
search_and_replace_get_button (SearchAndReplace* self,
                               const gchar* icon_name)
{
	GtkButton* result = NULL;
	GtkButton* button = NULL;
	GtkButton* _tmp0_;
	GtkImage* image = NULL;
	GtkImage* _tmp1_;
#line 326 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 326 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_return_val_if_fail (icon_name != NULL, NULL);
#line 328 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp0_ = (GtkButton*) gtk_button_new ();
#line 328 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_object_ref_sink (_tmp0_);
#line 328 "/home/seb/gnome/gnome-latex/src/search.vala"
	button = _tmp0_;
#line 329 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp1_ = (GtkImage*) gtk_image_new_from_icon_name (icon_name, (GtkIconSize) GTK_ICON_SIZE_MENU);
#line 329 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_object_ref_sink (_tmp1_);
#line 329 "/home/seb/gnome/gnome-latex/src/search.vala"
	image = _tmp1_;
#line 330 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_container_add ((GtkContainer*) button, (GtkWidget*) image);
#line 331 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_button_set_relief (button, GTK_RELIEF_NONE);
#line 332 "/home/seb/gnome/gnome-latex/src/search.vala"
	result = button;
#line 332 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (image);
#line 332 "/home/seb/gnome/gnome-latex/src/search.vala"
	return result;
#line 1744 "search.c"
}


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


GtkWidget*
search_and_replace_get_widget (SearchAndReplace* self)
{
	GtkWidget* result = NULL;
	GtkGrid* _tmp0_;
	GtkWidget* _tmp1_;
#line 335 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 337 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp0_ = self->priv->_main_grid;
#line 337 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp1_ = _g_object_ref0 ((GtkWidget*) _tmp0_);
#line 337 "/home/seb/gnome/gnome-latex/src/search.vala"
	result = _tmp1_;
#line 337 "/home/seb/gnome/gnome-latex/src/search.vala"
	return result;
#line 1773 "search.c"
}


void
search_and_replace_show_search (SearchAndReplace* self)
{
	GtkArrow* _tmp0_;
	GtkGrid* _tmp1_;
#line 340 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_return_if_fail (self != NULL);
#line 342 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp0_ = self->priv->_arrow;
#line 342 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_object_set (_tmp0_, "arrow-type", GTK_ARROW_DOWN, NULL);
#line 343 "/home/seb/gnome/gnome-latex/src/search.vala"
	search_and_replace_show (self);
#line 344 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp1_ = self->priv->_replace_grid;
#line 344 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_widget_hide ((GtkWidget*) _tmp1_);
#line 1794 "search.c"
}


void
search_and_replace_show_search_and_replace (SearchAndReplace* self)
{
	GtkArrow* _tmp0_;
#line 347 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_return_if_fail (self != NULL);
#line 349 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp0_ = self->priv->_arrow;
#line 349 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_object_set (_tmp0_, "arrow-type", GTK_ARROW_UP, NULL);
#line 350 "/home/seb/gnome/gnome-latex/src/search.vala"
	search_and_replace_show (self);
#line 1810 "search.c"
}


static void
_search_and_replace_connect_active_document_g_object_notify (GObject* _sender,
                                                             GParamSpec* pspec,
                                                             gpointer self)
{
#line 370 "/home/seb/gnome/gnome-latex/src/search.vala"
	search_and_replace_connect_active_document ((SearchAndReplace*) self);
#line 1821 "search.c"
}


static void
search_and_replace_show (SearchAndReplace* self)
{
	MainWindow* _tmp0_;
	DocumentTab* _tmp1_;
	DocumentTab* _tmp2_;
	GtkGrid* _tmp3_;
	GtkSearchEntry* _tmp4_;
	Document* doc = NULL;
	MainWindow* _tmp5_;
	Document* _tmp6_;
	Document* _tmp7_;
	Document* _tmp8_;
	Document* _tmp9_;
	MainWindow* _tmp19_;
#line 353 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_return_if_fail (self != NULL);
#line 355 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp0_ = self->priv->_main_window;
#line 355 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp1_ = main_window_get_active_tab (_tmp0_);
#line 355 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp2_ = _tmp1_;
#line 355 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_return_if_fail (_tmp2_ != NULL);
#line 357 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp3_ = self->priv->_main_grid;
#line 357 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_widget_show_all ((GtkWidget*) _tmp3_);
#line 358 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp4_ = self->priv->_entry_find;
#line 358 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_widget_grab_focus ((GtkWidget*) _tmp4_);
#line 362 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp5_ = self->priv->_main_window;
#line 362 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp6_ = main_window_get_active_document (_tmp5_);
#line 362 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp7_ = _tmp6_;
#line 362 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp8_ = _g_object_ref0 (_tmp7_);
#line 362 "/home/seb/gnome/gnome-latex/src/search.vala"
	doc = _tmp8_;
#line 363 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp9_ = doc;
#line 363 "/home/seb/gnome/gnome-latex/src/search.vala"
	if (tepl_buffer_get_selection_type ((TeplBuffer*) _tmp9_) == TEPL_SELECTION_TYPE_ON_SAME_LINE) {
#line 1872 "search.c"
		GtkTextIter start = {0};
		GtkTextIter end = {0};
		Document* _tmp10_;
		GtkTextIter _tmp11_ = {0};
		GtkTextIter _tmp12_ = {0};
		GtkSearchEntry* _tmp13_;
		Document* _tmp14_;
		GtkTextIter _tmp15_;
		GtkTextIter _tmp16_;
		gchar* _tmp17_;
		gchar* _tmp18_;
#line 366 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp10_ = doc;
#line 366 "/home/seb/gnome/gnome-latex/src/search.vala"
		gtk_text_buffer_get_selection_bounds ((GtkTextBuffer*) _tmp10_, &_tmp11_, &_tmp12_);
#line 366 "/home/seb/gnome/gnome-latex/src/search.vala"
		start = _tmp11_;
#line 366 "/home/seb/gnome/gnome-latex/src/search.vala"
		end = _tmp12_;
#line 367 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp13_ = self->priv->_entry_find;
#line 367 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp14_ = doc;
#line 367 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp15_ = start;
#line 367 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp16_ = end;
#line 367 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp17_ = gtk_text_buffer_get_text ((GtkTextBuffer*) _tmp14_, &_tmp15_, &_tmp16_, FALSE);
#line 367 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp18_ = _tmp17_;
#line 367 "/home/seb/gnome/gnome-latex/src/search.vala"
		gtk_entry_set_text ((GtkEntry*) _tmp13_, _tmp18_);
#line 367 "/home/seb/gnome/gnome-latex/src/search.vala"
		_g_free0 (_tmp18_);
#line 1908 "search.c"
	}
#line 370 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp19_ = self->priv->_main_window;
#line 370 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_signal_connect_object ((GObject*) _tmp19_, "notify::active-document", (GCallback) _search_and_replace_connect_active_document_g_object_notify, self, 0);
#line 371 "/home/seb/gnome/gnome-latex/src/search.vala"
	search_and_replace_connect_active_document (self);
#line 353 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (doc);
#line 1918 "search.c"
}


void
search_and_replace_hide (SearchAndReplace* self)
{
	MainWindow* _tmp0_;
	guint _tmp1_;
	GQuark _tmp2_;
	GtkGrid* _tmp3_;
	MainWindow* _tmp4_;
	DocumentView* _tmp5_;
	DocumentView* _tmp6_;
#line 374 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_return_if_fail (self != NULL);
#line 376 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp0_ = self->priv->_main_window;
#line 376 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_signal_parse_name ("notify::active-document", G_TYPE_OBJECT, &_tmp1_, &_tmp2_, TRUE);
#line 376 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_signal_handlers_disconnect_matched ((GObject*) _tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, _tmp2_, NULL, (GCallback) _search_and_replace_connect_active_document_g_object_notify, self);
#line 377 "/home/seb/gnome/gnome-latex/src/search.vala"
	search_and_replace_destroy_search_context (self);
#line 379 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp3_ = self->priv->_main_grid;
#line 379 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_widget_hide ((GtkWidget*) _tmp3_);
#line 381 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp4_ = self->priv->_main_window;
#line 381 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp5_ = main_window_get_active_view (_tmp4_);
#line 381 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp6_ = _tmp5_;
#line 381 "/home/seb/gnome/gnome-latex/src/search.vala"
	if (_tmp6_ != NULL) {
#line 1954 "search.c"
		MainWindow* _tmp7_;
		DocumentView* _tmp8_;
		DocumentView* _tmp9_;
#line 382 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp7_ = self->priv->_main_window;
#line 382 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp8_ = main_window_get_active_view (_tmp7_);
#line 382 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp9_ = _tmp8_;
#line 382 "/home/seb/gnome/gnome-latex/src/search.vala"
		gtk_widget_grab_focus ((GtkWidget*) _tmp9_);
#line 1966 "search.c"
	}
}


static void
_search_and_replace_mark_set_cb_gtk_text_buffer_mark_set (GtkTextBuffer* _sender,
                                                          GtkTextIter* location,
                                                          GtkTextMark* mark,
                                                          gpointer self)
{
#line 391 "/home/seb/gnome/gnome-latex/src/search.vala"
	search_and_replace_mark_set_cb ((SearchAndReplace*) self, _sender, location, mark);
#line 1979 "search.c"
}


static void
search_and_replace_destroy_search_context (SearchAndReplace* self)
{
	GtkSourceSearchContext* _tmp0_;
	GtkSourceBuffer* buffer = NULL;
	GtkSourceSearchContext* _tmp1_;
	GtkSourceBuffer* _tmp2_;
	GtkSourceBuffer* _tmp3_;
	GtkSourceBuffer* _tmp4_;
	guint _tmp5_;
#line 385 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_return_if_fail (self != NULL);
#line 387 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp0_ = self->priv->_search_context;
#line 387 "/home/seb/gnome/gnome-latex/src/search.vala"
	if (_tmp0_ == NULL) {
#line 388 "/home/seb/gnome/gnome-latex/src/search.vala"
		return;
#line 2001 "search.c"
	}
#line 390 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp1_ = self->priv->_search_context;
#line 390 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp2_ = gtk_source_search_context_get_buffer (_tmp1_);
#line 390 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp3_ = _g_object_ref0 (_tmp2_);
#line 390 "/home/seb/gnome/gnome-latex/src/search.vala"
	buffer = _tmp3_;
#line 391 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp4_ = buffer;
#line 391 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_signal_parse_name ("mark-set", gtk_text_buffer_get_type (), &_tmp5_, NULL, FALSE);
#line 391 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_signal_handlers_disconnect_matched ((GtkTextBuffer*) _tmp4_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp5_, 0, NULL, (GCallback) _search_and_replace_mark_set_cb_gtk_text_buffer_mark_set, self);
#line 393 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (self->priv->_search_context);
#line 393 "/home/seb/gnome/gnome-latex/src/search.vala"
	self->priv->_search_context = NULL;
#line 385 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (buffer);
#line 2023 "search.c"
}


static void
__lambda56_ (SearchAndReplace* self)
{
	gboolean _tmp0_ = FALSE;
	GtkSourceSearchContext* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
#line 409 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp1_ = self->priv->_search_context;
#line 409 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp2_ = gtk_source_search_context_get_occurrences_count (_tmp1_);
#line 409 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp3_ = _tmp2_;
#line 409 "/home/seb/gnome/gnome-latex/src/search.vala"
	if (_tmp3_ == 0) {
#line 2042 "search.c"
		GtkSourceSearchSettings* _tmp4_;
		const gchar* _tmp5_;
#line 410 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp4_ = self->priv->_search_settings;
#line 410 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp5_ = gtk_source_search_settings_get_search_text (_tmp4_);
#line 410 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp0_ = _tmp5_ != NULL;
#line 2051 "search.c"
	} else {
#line 409 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp0_ = FALSE;
#line 2055 "search.c"
	}
#line 409 "/home/seb/gnome/gnome-latex/src/search.vala"
	if (_tmp0_) {
#line 2059 "search.c"
		GtkSearchEntry* _tmp6_;
#line 411 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp6_ = self->priv->_entry_find;
#line 411 "/home/seb/gnome/gnome-latex/src/search.vala"
		error_entry_add_error ((GtkWidget*) _tmp6_);
#line 2065 "search.c"
	} else {
		GtkSourceSearchContext* _tmp7_;
		gint _tmp8_;
		gint _tmp9_;
#line 413 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp7_ = self->priv->_search_context;
#line 413 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp8_ = gtk_source_search_context_get_occurrences_count (_tmp7_);
#line 413 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp9_ = _tmp8_;
#line 413 "/home/seb/gnome/gnome-latex/src/search.vala"
		if (_tmp9_ >= 0) {
#line 2078 "search.c"
			GtkSearchEntry* _tmp10_;
#line 414 "/home/seb/gnome/gnome-latex/src/search.vala"
			_tmp10_ = self->priv->_entry_find;
#line 414 "/home/seb/gnome/gnome-latex/src/search.vala"
			error_entry_remove_error ((GtkWidget*) _tmp10_);
#line 2084 "search.c"
		}
	}
#line 416 "/home/seb/gnome/gnome-latex/src/search.vala"
	search_and_replace_update_info_label (self);
#line 2089 "search.c"
}


static void
___lambda56__g_object_notify (GObject* _sender,
                              GParamSpec* pspec,
                              gpointer self)
{
#line 407 "/home/seb/gnome/gnome-latex/src/search.vala"
	__lambda56_ ((SearchAndReplace*) self);
#line 2100 "search.c"
}


static void
search_and_replace_connect_active_document (SearchAndReplace* self)
{
	Document* doc = NULL;
	MainWindow* _tmp0_;
	Document* _tmp1_;
	Document* _tmp2_;
	Document* _tmp3_;
	Document* _tmp4_;
	Document* _tmp5_;
	GtkSourceSearchSettings* _tmp6_;
	GtkSourceSearchContext* _tmp7_;
	GtkSourceSearchContext* _tmp8_;
	gboolean readonly = FALSE;
	MainWindow* _tmp9_;
	Document* _tmp10_;
	Document* _tmp11_;
	gboolean _tmp12_;
	gboolean _tmp13_;
	GtkGrid* _tmp14_;
	gboolean _tmp15_;
	Document* _tmp16_;
#line 396 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_return_if_fail (self != NULL);
#line 398 "/home/seb/gnome/gnome-latex/src/search.vala"
	search_and_replace_destroy_search_context (self);
#line 400 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp0_ = self->priv->_main_window;
#line 400 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp1_ = main_window_get_active_document (_tmp0_);
#line 400 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp2_ = _tmp1_;
#line 400 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp3_ = _g_object_ref0 (_tmp2_);
#line 400 "/home/seb/gnome/gnome-latex/src/search.vala"
	doc = _tmp3_;
#line 402 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp4_ = doc;
#line 402 "/home/seb/gnome/gnome-latex/src/search.vala"
	if (_tmp4_ == NULL) {
#line 403 "/home/seb/gnome/gnome-latex/src/search.vala"
		_g_object_unref0 (doc);
#line 403 "/home/seb/gnome/gnome-latex/src/search.vala"
		return;
#line 2148 "search.c"
	}
#line 405 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp5_ = doc;
#line 405 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp6_ = self->priv->_search_settings;
#line 405 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp7_ = gtk_source_search_context_new ((GtkSourceBuffer*) _tmp5_, _tmp6_);
#line 405 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (self->priv->_search_context);
#line 405 "/home/seb/gnome/gnome-latex/src/search.vala"
	self->priv->_search_context = _tmp7_;
#line 407 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp8_ = self->priv->_search_context;
#line 407 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_signal_connect_object ((GObject*) _tmp8_, "notify::occurrences-count", (GCallback) ___lambda56__g_object_notify, self, 0);
#line 419 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp9_ = self->priv->_main_window;
#line 419 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp10_ = main_window_get_active_document (_tmp9_);
#line 419 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp11_ = _tmp10_;
#line 419 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp12_ = document_get_readonly (_tmp11_);
#line 419 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp13_ = _tmp12_;
#line 419 "/home/seb/gnome/gnome-latex/src/search.vala"
	readonly = _tmp13_;
#line 420 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp14_ = self->priv->_replace_grid;
#line 420 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp15_ = readonly;
#line 420 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_widget_set_sensitive ((GtkWidget*) _tmp14_, !_tmp15_);
#line 422 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp16_ = doc;
#line 422 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_signal_connect_object ((GtkTextBuffer*) _tmp16_, "mark-set", (GCallback) _search_and_replace_mark_set_cb_gtk_text_buffer_mark_set, self, 0);
#line 396 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (doc);
#line 2188 "search.c"
}


static void
search_and_replace_mark_set_cb (SearchAndReplace* self,
                                GtkTextBuffer* buffer,
                                GtkTextIter* location,
                                GtkTextMark* mark)
{
	gboolean _tmp0_ = FALSE;
	GtkTextMark* _tmp1_;
#line 425 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_return_if_fail (self != NULL);
#line 425 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_return_if_fail (buffer != NULL);
#line 425 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_return_if_fail (location != NULL);
#line 425 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_return_if_fail (mark != NULL);
#line 427 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp1_ = gtk_text_buffer_get_insert (buffer);
#line 427 "/home/seb/gnome/gnome-latex/src/search.vala"
	if (mark == _tmp1_) {
#line 427 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp0_ = TRUE;
#line 2214 "search.c"
	} else {
		GtkTextMark* _tmp2_;
#line 427 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp2_ = gtk_text_buffer_get_selection_bound (buffer);
#line 427 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp0_ = mark == _tmp2_;
#line 2221 "search.c"
	}
#line 427 "/home/seb/gnome/gnome-latex/src/search.vala"
	if (_tmp0_) {
#line 429 "/home/seb/gnome/gnome-latex/src/search.vala"
		search_and_replace_update_info_label (self);
#line 2227 "search.c"
	}
}


static void
search_and_replace_update_info_label (SearchAndReplace* self)
{
	gboolean _tmp0_ = FALSE;
	GtkSourceSearchContext* _tmp1_;
	gint count = 0;
	GtkSourceSearchContext* _tmp5_;
	gint _tmp6_;
	gint _tmp7_;
	gint _tmp8_;
	gint _tmp9_;
	GtkTextBuffer* buffer = NULL;
	GtkSourceSearchContext* _tmp11_;
	GtkSourceBuffer* _tmp12_;
	GtkTextBuffer* _tmp13_;
	GtkTextIter start = {0};
	GtkTextIter end = {0};
	GtkTextBuffer* _tmp14_;
	GtkTextIter _tmp15_ = {0};
	GtkTextIter _tmp16_ = {0};
	gint pos = 0;
	GtkSourceSearchContext* _tmp17_;
	GtkTextIter _tmp18_;
	GtkTextIter _tmp19_;
	gint _tmp20_;
#line 433 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_return_if_fail (self != NULL);
#line 435 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp1_ = self->priv->_search_context;
#line 435 "/home/seb/gnome/gnome-latex/src/search.vala"
	if (_tmp1_ == NULL) {
#line 435 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp0_ = TRUE;
#line 2265 "search.c"
	} else {
		GtkSourceSearchSettings* _tmp2_;
		const gchar* _tmp3_;
#line 436 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp2_ = self->priv->_search_settings;
#line 436 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp3_ = gtk_source_search_settings_get_search_text (_tmp2_);
#line 436 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp0_ = _tmp3_ == NULL;
#line 2275 "search.c"
	}
#line 435 "/home/seb/gnome/gnome-latex/src/search.vala"
	if (_tmp0_) {
#line 2279 "search.c"
		GtkLabel* _tmp4_;
#line 438 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp4_ = self->priv->_info_label;
#line 438 "/home/seb/gnome/gnome-latex/src/search.vala"
		gtk_label_set_text (_tmp4_, "");
#line 439 "/home/seb/gnome/gnome-latex/src/search.vala"
		return;
#line 2287 "search.c"
	}
#line 442 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp5_ = self->priv->_search_context;
#line 442 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp6_ = gtk_source_search_context_get_occurrences_count (_tmp5_);
#line 442 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp7_ = _tmp6_;
#line 442 "/home/seb/gnome/gnome-latex/src/search.vala"
	count = _tmp7_;
#line 444 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp8_ = count;
#line 444 "/home/seb/gnome/gnome-latex/src/search.vala"
	if (_tmp8_ == -1) {
#line 446 "/home/seb/gnome/gnome-latex/src/search.vala"
		return;
#line 2303 "search.c"
	}
#line 449 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp9_ = count;
#line 449 "/home/seb/gnome/gnome-latex/src/search.vala"
	if (_tmp9_ == 0) {
#line 2309 "search.c"
		GtkLabel* _tmp10_;
#line 451 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp10_ = self->priv->_info_label;
#line 451 "/home/seb/gnome/gnome-latex/src/search.vala"
		gtk_label_set_text (_tmp10_, _ ("Not found"));
#line 452 "/home/seb/gnome/gnome-latex/src/search.vala"
		return;
#line 2317 "search.c"
	}
#line 455 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp11_ = self->priv->_search_context;
#line 455 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp12_ = gtk_source_search_context_get_buffer (_tmp11_);
#line 455 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp13_ = _g_object_ref0 ((GtkTextBuffer*) _tmp12_);
#line 455 "/home/seb/gnome/gnome-latex/src/search.vala"
	buffer = _tmp13_;
#line 459 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp14_ = buffer;
#line 459 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_text_buffer_get_selection_bounds (_tmp14_, &_tmp15_, &_tmp16_);
#line 459 "/home/seb/gnome/gnome-latex/src/search.vala"
	start = _tmp15_;
#line 459 "/home/seb/gnome/gnome-latex/src/search.vala"
	end = _tmp16_;
#line 461 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp17_ = self->priv->_search_context;
#line 461 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp18_ = start;
#line 461 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp19_ = end;
#line 461 "/home/seb/gnome/gnome-latex/src/search.vala"
	pos = gtk_source_search_context_get_occurrence_position (_tmp17_, &_tmp18_, &_tmp19_);
#line 463 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp20_ = pos;
#line 463 "/home/seb/gnome/gnome-latex/src/search.vala"
	if (_tmp20_ > 0) {
#line 2347 "search.c"
		GtkLabel* _tmp21_;
		gint _tmp22_;
		gint _tmp23_;
		gchar* _tmp24_;
		gchar* _tmp25_;
#line 468 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp21_ = self->priv->_info_label;
#line 468 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp22_ = pos;
#line 468 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp23_ = count;
#line 468 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp24_ = g_strdup_printf (_ ("Match %d of %d"), _tmp22_, _tmp23_);
#line 468 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp25_ = _tmp24_;
#line 468 "/home/seb/gnome/gnome-latex/src/search.vala"
		gtk_label_set_text (_tmp21_, _tmp25_);
#line 468 "/home/seb/gnome/gnome-latex/src/search.vala"
		_g_free0 (_tmp25_);
#line 2367 "search.c"
	} else {
		gchar* text = NULL;
		gint _tmp26_;
		gint _tmp27_;
		gchar* _tmp28_;
		GtkLabel* _tmp29_;
		const gchar* _tmp30_;
#line 473 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp26_ = count;
#line 473 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp27_ = count;
#line 473 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp28_ = g_strdup_printf (ngettext ("%d match", "%d matches", (gulong) _tmp26_), _tmp27_);
#line 473 "/home/seb/gnome/gnome-latex/src/search.vala"
		text = _tmp28_;
#line 474 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp29_ = self->priv->_info_label;
#line 474 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp30_ = text;
#line 474 "/home/seb/gnome/gnome-latex/src/search.vala"
		gtk_label_set_text (_tmp29_, _tmp30_);
#line 463 "/home/seb/gnome/gnome-latex/src/search.vala"
		_g_free0 (text);
#line 2391 "search.c"
	}
#line 433 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (buffer);
#line 2395 "search.c"
}


static void
search_and_replace_search_forward (SearchAndReplace* self)
{
	GtkSourceSearchContext* _tmp0_;
	GtkTextIter iter = {0};
	GtkTextIter match_start = {0};
	GtkTextIter match_end = {0};
	Document* doc = NULL;
	GtkSourceSearchContext* _tmp1_;
	GtkSourceBuffer* _tmp2_;
	Document* _tmp3_;
	Document* _tmp4_;
	GtkTextIter _tmp5_ = {0};
	GtkSourceSearchContext* _tmp6_;
	GtkTextIter _tmp7_;
	GtkTextIter _tmp8_ = {0};
	GtkTextIter _tmp9_ = {0};
	gboolean _tmp10_;
#line 478 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_return_if_fail (self != NULL);
#line 480 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp0_ = self->priv->_search_context;
#line 480 "/home/seb/gnome/gnome-latex/src/search.vala"
	if (_tmp0_ == NULL) {
#line 481 "/home/seb/gnome/gnome-latex/src/search.vala"
		return;
#line 2425 "search.c"
	}
#line 487 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp1_ = self->priv->_search_context;
#line 487 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp2_ = gtk_source_search_context_get_buffer (_tmp1_);
#line 487 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, TYPE_DOCUMENT) ? ((Document*) _tmp2_) : NULL);
#line 487 "/home/seb/gnome/gnome-latex/src/search.vala"
	doc = _tmp3_;
#line 488 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp4_ = doc;
#line 488 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_text_buffer_get_selection_bounds ((GtkTextBuffer*) _tmp4_, NULL, &_tmp5_);
#line 488 "/home/seb/gnome/gnome-latex/src/search.vala"
	iter = _tmp5_;
#line 490 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp6_ = self->priv->_search_context;
#line 490 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp7_ = iter;
#line 490 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp10_ = gtk_source_search_context_forward (_tmp6_, &_tmp7_, &_tmp8_, &_tmp9_, NULL);
#line 490 "/home/seb/gnome/gnome-latex/src/search.vala"
	match_start = _tmp8_;
#line 490 "/home/seb/gnome/gnome-latex/src/search.vala"
	match_end = _tmp9_;
#line 490 "/home/seb/gnome/gnome-latex/src/search.vala"
	if (_tmp10_) {
#line 2453 "search.c"
		Document* _tmp11_;
		GtkTextIter _tmp12_;
		GtkTextIter _tmp13_;
		Document* _tmp14_;
		DocumentTab* _tmp15_;
		TeplView* _tmp16_;
		TeplView* _tmp17_;
#line 492 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp11_ = doc;
#line 492 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp12_ = match_start;
#line 492 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp13_ = match_end;
#line 492 "/home/seb/gnome/gnome-latex/src/search.vala"
		gtk_text_buffer_select_range ((GtkTextBuffer*) _tmp11_, &_tmp12_, &_tmp13_);
#line 493 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp14_ = doc;
#line 493 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp15_ = _tmp14_->tab;
#line 493 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp16_ = tepl_tab_get_view ((TeplTab*) _tmp15_);
#line 493 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp17_ = _tmp16_;
#line 493 "/home/seb/gnome/gnome-latex/src/search.vala"
		tepl_view_scroll_to_cursor (_tmp17_);
#line 2479 "search.c"
	}
#line 478 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (doc);
#line 2483 "search.c"
}


static void
search_and_replace_search_backward (SearchAndReplace* self)
{
	GtkSourceSearchContext* _tmp0_;
	GtkTextIter iter = {0};
	GtkTextIter match_start = {0};
	GtkTextIter match_end = {0};
	Document* doc = NULL;
	GtkSourceSearchContext* _tmp1_;
	GtkSourceBuffer* _tmp2_;
	Document* _tmp3_;
	Document* _tmp4_;
	GtkTextIter _tmp5_ = {0};
	GtkSourceSearchContext* _tmp6_;
	GtkTextIter _tmp7_;
	GtkTextIter _tmp8_ = {0};
	GtkTextIter _tmp9_ = {0};
	gboolean _tmp10_;
#line 497 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_return_if_fail (self != NULL);
#line 499 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp0_ = self->priv->_search_context;
#line 499 "/home/seb/gnome/gnome-latex/src/search.vala"
	if (_tmp0_ == NULL) {
#line 500 "/home/seb/gnome/gnome-latex/src/search.vala"
		return;
#line 2513 "search.c"
	}
#line 506 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp1_ = self->priv->_search_context;
#line 506 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp2_ = gtk_source_search_context_get_buffer (_tmp1_);
#line 506 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, TYPE_DOCUMENT) ? ((Document*) _tmp2_) : NULL);
#line 506 "/home/seb/gnome/gnome-latex/src/search.vala"
	doc = _tmp3_;
#line 507 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp4_ = doc;
#line 507 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_text_buffer_get_selection_bounds ((GtkTextBuffer*) _tmp4_, &_tmp5_, NULL);
#line 507 "/home/seb/gnome/gnome-latex/src/search.vala"
	iter = _tmp5_;
#line 509 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp6_ = self->priv->_search_context;
#line 509 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp7_ = iter;
#line 509 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp10_ = gtk_source_search_context_backward (_tmp6_, &_tmp7_, &_tmp8_, &_tmp9_, NULL);
#line 509 "/home/seb/gnome/gnome-latex/src/search.vala"
	match_start = _tmp8_;
#line 509 "/home/seb/gnome/gnome-latex/src/search.vala"
	match_end = _tmp9_;
#line 509 "/home/seb/gnome/gnome-latex/src/search.vala"
	if (_tmp10_) {
#line 2541 "search.c"
		Document* _tmp11_;
		GtkTextIter _tmp12_;
		GtkTextIter _tmp13_;
		Document* _tmp14_;
		DocumentTab* _tmp15_;
		TeplView* _tmp16_;
		TeplView* _tmp17_;
#line 511 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp11_ = doc;
#line 511 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp12_ = match_start;
#line 511 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp13_ = match_end;
#line 511 "/home/seb/gnome/gnome-latex/src/search.vala"
		gtk_text_buffer_select_range ((GtkTextBuffer*) _tmp11_, &_tmp12_, &_tmp13_);
#line 512 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp14_ = doc;
#line 512 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp15_ = _tmp14_->tab;
#line 512 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp16_ = tepl_tab_get_view ((TeplTab*) _tmp15_);
#line 512 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp17_ = _tmp16_;
#line 512 "/home/seb/gnome/gnome-latex/src/search.vala"
		tepl_view_scroll_to_cursor (_tmp17_);
#line 2567 "search.c"
	}
#line 497 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (doc);
#line 2571 "search.c"
}


static void
search_and_replace_replace (SearchAndReplace* self)
{
	GtkSourceSearchContext* _tmp0_;
	GtkTextIter match_start = {0};
	GtkTextIter match_end = {0};
	GtkSourceBuffer* buffer = NULL;
	GtkSourceSearchContext* _tmp1_;
	GtkSourceBuffer* _tmp2_;
	GtkSourceBuffer* _tmp3_;
	GtkSourceBuffer* _tmp4_;
	GtkTextIter _tmp5_ = {0};
	GtkTextIter _tmp6_ = {0};
	MainWindow* _tmp7_;
	DocumentView* _tmp8_;
	DocumentView* _tmp9_;
	GtkSourceCompletion* _tmp10_;
	GtkSourceCompletion* _tmp11_;
	MainWindow* _tmp19_;
	DocumentView* _tmp20_;
	DocumentView* _tmp21_;
	GtkSourceCompletion* _tmp22_;
	GtkSourceCompletion* _tmp23_;
	GError * _inner_error_ = NULL;
#line 516 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_return_if_fail (self != NULL);
#line 518 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp0_ = self->priv->_search_context;
#line 518 "/home/seb/gnome/gnome-latex/src/search.vala"
	if (_tmp0_ == NULL) {
#line 519 "/home/seb/gnome/gnome-latex/src/search.vala"
		return;
#line 2607 "search.c"
	}
#line 523 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp1_ = self->priv->_search_context;
#line 523 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp2_ = gtk_source_search_context_get_buffer (_tmp1_);
#line 523 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp3_ = _g_object_ref0 (_tmp2_);
#line 523 "/home/seb/gnome/gnome-latex/src/search.vala"
	buffer = _tmp3_;
#line 524 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp4_ = buffer;
#line 524 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_text_buffer_get_selection_bounds ((GtkTextBuffer*) _tmp4_, &_tmp5_, &_tmp6_);
#line 524 "/home/seb/gnome/gnome-latex/src/search.vala"
	match_start = _tmp5_;
#line 524 "/home/seb/gnome/gnome-latex/src/search.vala"
	match_end = _tmp6_;
#line 526 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp7_ = self->priv->_main_window;
#line 526 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp8_ = main_window_get_active_view (_tmp7_);
#line 526 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp9_ = _tmp8_;
#line 526 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp10_ = gtk_source_view_get_completion ((GtkSourceView*) _tmp9_);
#line 526 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp11_ = _tmp10_;
#line 526 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_source_completion_block_interactive (_tmp11_);
#line 2637 "search.c"
	{
		gboolean _tmp12_ = FALSE;
		GtkSourceSearchContext* _tmp13_;
		GtkTextIter _tmp14_;
		GtkTextIter _tmp15_;
		GtkSearchEntry* _tmp16_;
		const gchar* _tmp17_;
		const gchar* _tmp18_;
#line 530 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp13_ = self->priv->_search_context;
#line 530 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp14_ = match_start;
#line 530 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp15_ = match_end;
#line 530 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp16_ = self->priv->_entry_replace;
#line 530 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp17_ = gtk_entry_get_text ((GtkEntry*) _tmp16_);
#line 530 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp18_ = _tmp17_;
#line 530 "/home/seb/gnome/gnome-latex/src/search.vala"
		_tmp12_ = gtk_source_search_context_replace (_tmp13_, &_tmp14_, &_tmp15_, _tmp18_, -1, &_inner_error_);
#line 530 "/home/seb/gnome/gnome-latex/src/search.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2662 "search.c"
			goto __catch40_g_error;
		}
#line 530 "/home/seb/gnome/gnome-latex/src/search.vala"
		if (!_tmp12_) {
#line 532 "/home/seb/gnome/gnome-latex/src/search.vala"
			search_and_replace_search_forward (self);
#line 2669 "search.c"
		}
	}
	goto __finally40;
	__catch40_g_error:
	{
		GError* e = NULL;
#line 528 "/home/seb/gnome/gnome-latex/src/search.vala"
		e = _inner_error_;
#line 528 "/home/seb/gnome/gnome-latex/src/search.vala"
		_inner_error_ = NULL;
#line 528 "/home/seb/gnome/gnome-latex/src/search.vala"
		_g_error_free0 (e);
#line 2682 "search.c"
	}
	__finally40:
#line 528 "/home/seb/gnome/gnome-latex/src/search.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 528 "/home/seb/gnome/gnome-latex/src/search.vala"
		_g_object_unref0 (buffer);
#line 528 "/home/seb/gnome/gnome-latex/src/search.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 528 "/home/seb/gnome/gnome-latex/src/search.vala"
		g_clear_error (&_inner_error_);
#line 528 "/home/seb/gnome/gnome-latex/src/search.vala"
		return;
#line 2695 "search.c"
	}
#line 539 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp19_ = self->priv->_main_window;
#line 539 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp20_ = main_window_get_active_view (_tmp19_);
#line 539 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp21_ = _tmp20_;
#line 539 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp22_ = gtk_source_view_get_completion ((GtkSourceView*) _tmp21_);
#line 539 "/home/seb/gnome/gnome-latex/src/search.vala"
	_tmp23_ = _tmp22_;
#line 539 "/home/seb/gnome/gnome-latex/src/search.vala"
	gtk_source_completion_unblock_interactive (_tmp23_);
#line 516 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (buffer);
#line 2711 "search.c"
}


static void
search_and_replace_class_init (SearchAndReplaceClass * klass)
{
#line 94 "/home/seb/gnome/gnome-latex/src/search.vala"
	search_and_replace_parent_class = g_type_class_peek_parent (klass);
#line 94 "/home/seb/gnome/gnome-latex/src/search.vala"
	g_type_class_add_private (klass, sizeof (SearchAndReplacePrivate));
#line 94 "/home/seb/gnome/gnome-latex/src/search.vala"
	G_OBJECT_CLASS (klass)->finalize = search_and_replace_finalize;
#line 2724 "search.c"
}


static void
search_and_replace_instance_init (SearchAndReplace * self)
{
#line 94 "/home/seb/gnome/gnome-latex/src/search.vala"
	self->priv = SEARCH_AND_REPLACE_GET_PRIVATE (self);
#line 109 "/home/seb/gnome/gnome-latex/src/search.vala"
	self->priv->_search_context = NULL;
#line 2735 "search.c"
}


static void
search_and_replace_finalize (GObject * obj)
{
	SearchAndReplace * self;
#line 94 "/home/seb/gnome/gnome-latex/src/search.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_SEARCH_AND_REPLACE, SearchAndReplace);
#line 98 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (self->priv->_main_grid);
#line 99 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (self->priv->_replace_grid);
#line 101 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (self->priv->_arrow);
#line 103 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (self->priv->_entry_find);
#line 104 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (self->priv->_entry_replace);
#line 106 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (self->priv->_info_label);
#line 108 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (self->priv->_search_settings);
#line 109 "/home/seb/gnome/gnome-latex/src/search.vala"
	_g_object_unref0 (self->priv->_search_context);
#line 94 "/home/seb/gnome/gnome-latex/src/search.vala"
	G_OBJECT_CLASS (search_and_replace_parent_class)->finalize (obj);
#line 2763 "search.c"
}


GType
search_and_replace_get_type (void)
{
	static volatile gsize search_and_replace_type_id__volatile = 0;
	if (g_once_init_enter (&search_and_replace_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (SearchAndReplaceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) search_and_replace_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SearchAndReplace), 0, (GInstanceInitFunc) search_and_replace_instance_init, NULL };
		GType search_and_replace_type_id;
		search_and_replace_type_id = g_type_register_static (G_TYPE_OBJECT, "SearchAndReplace", &g_define_type_info, 0);
		g_once_init_leave (&search_and_replace_type_id__volatile, search_and_replace_type_id);
	}
	return search_and_replace_type_id__volatile;
}



