/* result-panel.c generated by valac 0.29.1, the Vala compiler
 * generated from result-panel.vala, do not modify */

/*
* Copyright (C) 2015 The Lemon Man
*
* This program 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 2, or (at your option)
* any later version.
*
* This program 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 this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <gedit/gedit-window.h>
#include <gdk/gdk.h>
#include <glib/gi18n-lib.h>
#include <gedit/gedit-commands.h>
#include <gio/gio.h>


#define GEDIT_FIND_IN_FILES_PLUGIN_TYPE_RESULT_PANEL (gedit_find_in_files_plugin_result_panel_get_type ())
#define GEDIT_FIND_IN_FILES_PLUGIN_RESULT_PANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_FIND_IN_FILES_PLUGIN_TYPE_RESULT_PANEL, GeditFindInFilesPluginResultPanel))
#define GEDIT_FIND_IN_FILES_PLUGIN_RESULT_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_FIND_IN_FILES_PLUGIN_TYPE_RESULT_PANEL, GeditFindInFilesPluginResultPanelClass))
#define GEDIT_FIND_IN_FILES_PLUGIN_IS_RESULT_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_FIND_IN_FILES_PLUGIN_TYPE_RESULT_PANEL))
#define GEDIT_FIND_IN_FILES_PLUGIN_IS_RESULT_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_FIND_IN_FILES_PLUGIN_TYPE_RESULT_PANEL))
#define GEDIT_FIND_IN_FILES_PLUGIN_RESULT_PANEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_FIND_IN_FILES_PLUGIN_TYPE_RESULT_PANEL, GeditFindInFilesPluginResultPanelClass))

typedef struct _GeditFindInFilesPluginResultPanel GeditFindInFilesPluginResultPanel;
typedef struct _GeditFindInFilesPluginResultPanelClass GeditFindInFilesPluginResultPanelClass;
typedef struct _GeditFindInFilesPluginResultPanelPrivate GeditFindInFilesPluginResultPanelPrivate;

#define GEDIT_FIND_IN_FILES_PLUGIN_TYPE_FIND_JOB (gedit_find_in_files_plugin_find_job_get_type ())
#define GEDIT_FIND_IN_FILES_PLUGIN_FIND_JOB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_FIND_IN_FILES_PLUGIN_TYPE_FIND_JOB, GeditFindInFilesPluginFindJob))
#define GEDIT_FIND_IN_FILES_PLUGIN_FIND_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_FIND_IN_FILES_PLUGIN_TYPE_FIND_JOB, GeditFindInFilesPluginFindJobClass))
#define GEDIT_FIND_IN_FILES_PLUGIN_IS_FIND_JOB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_FIND_IN_FILES_PLUGIN_TYPE_FIND_JOB))
#define GEDIT_FIND_IN_FILES_PLUGIN_IS_FIND_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_FIND_IN_FILES_PLUGIN_TYPE_FIND_JOB))
#define GEDIT_FIND_IN_FILES_PLUGIN_FIND_JOB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_FIND_IN_FILES_PLUGIN_TYPE_FIND_JOB, GeditFindInFilesPluginFindJobClass))

typedef struct _GeditFindInFilesPluginFindJob GeditFindInFilesPluginFindJob;
typedef struct _GeditFindInFilesPluginFindJobClass GeditFindInFilesPluginFindJobClass;
#define _gedit_find_in_files_plugin_find_job_unref0(var) ((var == NULL) ? NULL : (var = (gedit_find_in_files_plugin_find_job_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block2Data Block2Data;
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))

#define GEDIT_FIND_IN_FILES_PLUGIN_TYPE_RESULT (gedit_find_in_files_plugin_result_get_type ())
typedef struct _GeditFindInFilesPluginResult GeditFindInFilesPluginResult;
typedef struct _Block3Data Block3Data;

struct _GeditFindInFilesPluginResultPanel {
	GtkOverlay parent_instance;
	GeditFindInFilesPluginResultPanelPrivate * priv;
};

struct _GeditFindInFilesPluginResultPanelClass {
	GtkOverlayClass parent_class;
};

struct _GeditFindInFilesPluginResultPanelPrivate {
	GeditFindInFilesPluginFindJob* job;
	gchar* root;
	GtkTreeView* list;
	GtkTreeStore* results_model;
	GtkButton* stop_button;
	GeditWindow* win;
};

struct _Block2Data {
	int _ref_count_;
	GeditFindInFilesPluginResultPanel* self;
	GHashTable* it_table;
};

struct _GeditFindInFilesPluginResult {
	gchar* path;
	gsize line;
	gchar* context;
};

struct _Block3Data {
	int _ref_count_;
	Block2Data * _data2_;
	GeditFindInFilesPluginResult _result_;
};


static gpointer gedit_find_in_files_plugin_result_panel_parent_class = NULL;
static GType gedit_find_in_files_plugin_result_panel_type_id = 0;

void gedit_find_in_files_plugin_toggle_fold (GtkTreeView* tv, GtkTreePath* path);
GType gedit_find_in_files_plugin_result_panel_get_type (void) G_GNUC_CONST;
GType gedit_find_in_files_plugin_result_panel_register_type (GTypeModule * module);
gpointer gedit_find_in_files_plugin_find_job_ref (gpointer instance);
void gedit_find_in_files_plugin_find_job_unref (gpointer instance);
GParamSpec* gedit_find_in_files_plugin_param_spec_find_job (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void gedit_find_in_files_plugin_value_set_find_job (GValue* value, gpointer v_object);
void gedit_find_in_files_plugin_value_take_find_job (GValue* value, gpointer v_object);
gpointer gedit_find_in_files_plugin_value_get_find_job (const GValue* value);
GType gedit_find_in_files_plugin_find_job_get_type (void) G_GNUC_CONST;
GType gedit_find_in_files_plugin_find_job_register_type (GTypeModule * module);
#define GEDIT_FIND_IN_FILES_PLUGIN_RESULT_PANEL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEDIT_FIND_IN_FILES_PLUGIN_TYPE_RESULT_PANEL, GeditFindInFilesPluginResultPanelPrivate))
enum  {
	GEDIT_FIND_IN_FILES_PLUGIN_RESULT_PANEL_DUMMY_PROPERTY
};
void gedit_find_in_files_plugin_find_job_halt (GeditFindInFilesPluginFindJob* self);
void gedit_find_in_files_plugin_result_panel_grab_focus (GeditFindInFilesPluginResultPanel* self);
static gboolean gedit_find_in_files_plugin_result_panel_list_search (GeditFindInFilesPluginResultPanel* self, GtkTreeModel* model, gint column, const gchar* key, GtkTreeIter* iter);
static gboolean gedit_find_in_files_plugin_result_panel_on_button_press (GeditFindInFilesPluginResultPanel* self, GdkEventButton* event);
static void ___lambda7_ (GeditFindInFilesPluginResultPanel* self);
static void ____lambda7__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
static void gedit_find_in_files_plugin_result_panel_on_row_activated (GeditFindInFilesPluginResultPanel* self, GtkTreePath* path, GtkTreeViewColumn* column);
static gchar* gedit_find_in_files_plugin_result_panel_get_relative_path (GeditFindInFilesPluginResultPanel* self, const gchar* path, const gchar* from);
static void gedit_find_in_files_plugin_result_panel_column_data_func (GeditFindInFilesPluginResultPanel* self, GtkTreeViewColumn* column, GtkCellRenderer* cell, GtkTreeModel* model, GtkTreeIter* iter);
GeditFindInFilesPluginResultPanel* gedit_find_in_files_plugin_result_panel_new_for_job (GeditFindInFilesPluginFindJob* job_, const gchar* root_, GeditWindow* win_);
GeditFindInFilesPluginResultPanel* gedit_find_in_files_plugin_result_panel_construct_for_job (GType object_type, GeditFindInFilesPluginFindJob* job_, const gchar* root_, GeditWindow* win_);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static void _g_free0_ (gpointer var);
GType gedit_find_in_files_plugin_result_get_type (void) G_GNUC_CONST;
GeditFindInFilesPluginResult* gedit_find_in_files_plugin_result_dup (const GeditFindInFilesPluginResult* self);
void gedit_find_in_files_plugin_result_free (GeditFindInFilesPluginResult* self);
void gedit_find_in_files_plugin_result_copy (const GeditFindInFilesPluginResult* self, GeditFindInFilesPluginResult* dest);
void gedit_find_in_files_plugin_result_destroy (GeditFindInFilesPluginResult* self);
static void __lambda8_ (Block2Data* _data2_, GeditFindInFilesPluginResult* _result_);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
static gboolean __lambda9_ (Block3Data* _data3_);
static GtkTreeIter* _gtk_tree_iter_dup (GtkTreeIter* self);
static gboolean ___lambda9__gsource_func (gpointer self);
static void ___lambda8__gedit_find_in_files_plugin_find_job_on_match_found (GeditFindInFilesPluginFindJob* _sender, GeditFindInFilesPluginResult* _result_, gpointer self);
static void __lambda10_ (GeditFindInFilesPluginResultPanel* self);
static void ___lambda10__gedit_find_in_files_plugin_find_job_on_search_finished (GeditFindInFilesPluginFindJob* _sender, gpointer self);
static gboolean _gedit_find_in_files_plugin_result_panel_list_search_gtk_tree_view_search_equal_func (GtkTreeModel* model, gint column, const gchar* key, GtkTreeIter* iter, gpointer self);
static void _gedit_find_in_files_plugin_result_panel_column_data_func_gtk_tree_cell_data_func (GtkTreeViewColumn* tree_column, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer self);
static void _gedit_find_in_files_plugin_result_panel_on_row_activated_gtk_tree_view_row_activated (GtkTreeView* _sender, GtkTreePath* path, GtkTreeViewColumn* column, gpointer self);
static gboolean _gedit_find_in_files_plugin_result_panel_on_button_press_gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self);
static void __lambda11_ (GeditFindInFilesPluginResultPanel* self);
static void ___lambda11__gtk_button_clicked (GtkButton* _sender, gpointer self);
void gedit_find_in_files_plugin_result_panel_toggle_stop_button (GeditFindInFilesPluginResultPanel* self, gboolean show);
GeditFindInFilesPluginResultPanel* gedit_find_in_files_plugin_result_panel_new (void);
GeditFindInFilesPluginResultPanel* gedit_find_in_files_plugin_result_panel_construct (GType object_type);
static void gedit_find_in_files_plugin_result_panel_finalize (GObject* obj);


void gedit_find_in_files_plugin_toggle_fold (GtkTreeView* tv, GtkTreePath* path) {
	GtkTreeView* _tmp0_ = NULL;
	GtkTreePath* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	g_return_if_fail (tv != NULL);
	g_return_if_fail (path != NULL);
	_tmp0_ = tv;
	_tmp1_ = path;
	_tmp2_ = gtk_tree_view_row_expanded (_tmp0_, _tmp1_);
	if (_tmp2_) {
		GtkTreeView* _tmp3_ = NULL;
		GtkTreePath* _tmp4_ = NULL;
		_tmp3_ = tv;
		_tmp4_ = path;
		gtk_tree_view_collapse_row (_tmp3_, _tmp4_);
	} else {
		GtkTreeView* _tmp5_ = NULL;
		GtkTreePath* _tmp6_ = NULL;
		_tmp5_ = tv;
		_tmp6_ = path;
		gtk_tree_view_expand_row (_tmp5_, _tmp6_, FALSE);
	}
}


void gedit_find_in_files_plugin_result_panel_grab_focus (GeditFindInFilesPluginResultPanel* self) {
	GtkTreeView* _tmp0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->list;
	gtk_widget_grab_focus ((GtkWidget*) _tmp0_);
}


static gboolean gedit_find_in_files_plugin_result_panel_list_search (GeditFindInFilesPluginResultPanel* self, GtkTreeModel* model, gint column, const gchar* key, GtkTreeIter* iter) {
	gboolean result = FALSE;
	GValue val = {0};
	GtkTreeModel* _tmp0_ = NULL;
	GtkTreeIter _tmp1_ = {0};
	GValue _tmp2_ = {0};
	gboolean _tmp3_ = FALSE;
	const gchar* _tmp4_ = NULL;
	const gchar* _tmp5_ = NULL;
	const gchar* _tmp6_ = NULL;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (model != NULL, FALSE);
	g_return_val_if_fail (key != NULL, FALSE);
	g_return_val_if_fail (iter != NULL, FALSE);
	_tmp0_ = model;
	_tmp1_ = *iter;
	gtk_tree_model_get_value (_tmp0_, &_tmp1_, 0, &_tmp2_);
	G_IS_VALUE (&val) ? (g_value_unset (&val), NULL) : NULL;
	val = _tmp2_;
	_tmp4_ = g_value_get_string (&val);
	_tmp5_ = key;
	_tmp6_ = strstr (_tmp4_, _tmp5_);
	if (_tmp6_ != NULL) {
		_tmp3_ = FALSE;
	} else {
		_tmp3_ = TRUE;
	}
	result = _tmp3_;
	G_IS_VALUE (&val) ? (g_value_unset (&val), NULL) : NULL;
	return result;
}


static void ___lambda7_ (GeditFindInFilesPluginResultPanel* self) {
	gtk_widget_destroy ((GtkWidget*) self);
}


static void ____lambda7__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
	___lambda7_ ((GeditFindInFilesPluginResultPanel*) self);
}


static gboolean gedit_find_in_files_plugin_result_panel_on_button_press (GeditFindInFilesPluginResultPanel* self, GdkEventButton* event) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	GdkEventButton* _tmp1_ = NULL;
	GdkEventType _tmp2_ = 0;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp1_ = event;
	_tmp2_ = _tmp1_->type;
	if (_tmp2_ == GDK_BUTTON_PRESS) {
		GdkEventButton* _tmp3_ = NULL;
		guint _tmp4_ = 0U;
		_tmp3_ = event;
		_tmp4_ = _tmp3_->button;
		_tmp0_ = _tmp4_ == ((guint) 3);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GtkMenu* popup = NULL;
		GtkMenu* _tmp5_ = NULL;
		GtkMenuItem* close_item = NULL;
		const gchar* _tmp6_ = NULL;
		GtkMenuItem* _tmp7_ = NULL;
		GtkMenuItem* _tmp8_ = NULL;
		GtkMenu* _tmp9_ = NULL;
		GtkMenu* _tmp10_ = NULL;
		GtkMenuItem* _tmp11_ = NULL;
		GtkMenu* _tmp12_ = NULL;
		GtkMenu* _tmp13_ = NULL;
		GdkEventButton* _tmp14_ = NULL;
		guint _tmp15_ = 0U;
		GdkEventButton* _tmp16_ = NULL;
		guint32 _tmp17_ = 0U;
		_tmp5_ = (GtkMenu*) gtk_menu_new ();
		g_object_ref_sink (_tmp5_);
		popup = _tmp5_;
		_tmp6_ = _ ("_Close");
		_tmp7_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (_tmp6_);
		g_object_ref_sink (_tmp7_);
		close_item = _tmp7_;
		_tmp8_ = close_item;
		g_signal_connect_object (_tmp8_, "activate", (GCallback) ____lambda7__gtk_menu_item_activate, self, 0);
		_tmp9_ = popup;
		gtk_menu_attach_to_widget (_tmp9_, (GtkWidget*) self, NULL);
		_tmp10_ = popup;
		_tmp11_ = close_item;
		gtk_container_add ((GtkContainer*) _tmp10_, (GtkWidget*) _tmp11_);
		_tmp12_ = popup;
		gtk_widget_show_all ((GtkWidget*) _tmp12_);
		_tmp13_ = popup;
		_tmp14_ = event;
		_tmp15_ = _tmp14_->button;
		_tmp16_ = event;
		_tmp17_ = _tmp16_->time;
		gtk_menu_popup (_tmp13_, NULL, NULL, NULL, NULL, _tmp15_, _tmp17_);
		result = TRUE;
		_g_object_unref0 (close_item);
		_g_object_unref0 (popup);
		return result;
	}
	result = FALSE;
	return result;
}


static void gedit_find_in_files_plugin_result_panel_on_row_activated (GeditFindInFilesPluginResultPanel* self, GtkTreePath* path, GtkTreeViewColumn* column) {
	GtkTreeIter iter = {0};
	GtkTreeIter parent = {0};
	GtkTreeStore* _tmp0_ = NULL;
	GtkTreePath* _tmp1_ = NULL;
	GtkTreeIter _tmp2_ = {0};
	gboolean _tmp3_ = FALSE;
	GtkTreeStore* _tmp4_ = NULL;
	GtkTreeIter _tmp5_ = {0};
	GtkTreeIter _tmp6_ = {0};
	gboolean _tmp7_ = FALSE;
	GValue val0 = {0};
	GValue val1 = {0};
	GtkTreeStore* _tmp10_ = NULL;
	GtkTreeIter _tmp11_ = {0};
	GValue _tmp12_ = {0};
	GtkTreeStore* _tmp13_ = NULL;
	GtkTreeIter _tmp14_ = {0};
	GValue _tmp15_ = {0};
	gchar* selection_path = NULL;
	const gchar* _tmp16_ = NULL;
	gchar* _tmp17_ = NULL;
	gint selection_line = 0;
	gint _tmp18_ = 0;
	GeditWindow* _tmp19_ = NULL;
	const gchar* _tmp20_ = NULL;
	GFile* _tmp21_ = NULL;
	GFile* _tmp22_ = NULL;
	gint _tmp23_ = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (path != NULL);
	g_return_if_fail (column != NULL);
	_tmp0_ = self->priv->results_model;
	_tmp1_ = path;
	_tmp3_ = gtk_tree_model_get_iter ((GtkTreeModel*) _tmp0_, &_tmp2_, _tmp1_);
	iter = _tmp2_;
	if (!_tmp3_) {
		return;
	}
	_tmp4_ = self->priv->results_model;
	_tmp5_ = iter;
	_tmp7_ = gtk_tree_model_iter_parent ((GtkTreeModel*) _tmp4_, &_tmp6_, &_tmp5_);
	parent = _tmp6_;
	if (!_tmp7_) {
		GtkTreeView* _tmp8_ = NULL;
		GtkTreePath* _tmp9_ = NULL;
		_tmp8_ = self->priv->list;
		_tmp9_ = path;
		gedit_find_in_files_plugin_toggle_fold (_tmp8_, _tmp9_);
		return;
	}
	_tmp10_ = self->priv->results_model;
	_tmp11_ = parent;
	gtk_tree_model_get_value ((GtkTreeModel*) _tmp10_, &_tmp11_, 0, &_tmp12_);
	G_IS_VALUE (&val0) ? (g_value_unset (&val0), NULL) : NULL;
	val0 = _tmp12_;
	_tmp13_ = self->priv->results_model;
	_tmp14_ = iter;
	gtk_tree_model_get_value ((GtkTreeModel*) _tmp13_, &_tmp14_, 1, &_tmp15_);
	G_IS_VALUE (&val1) ? (g_value_unset (&val1), NULL) : NULL;
	val1 = _tmp15_;
	_tmp16_ = g_value_get_string (&val0);
	_tmp17_ = g_strdup (_tmp16_);
	selection_path = _tmp17_;
	_tmp18_ = g_value_get_int (&val1);
	selection_line = _tmp18_;
	_tmp19_ = self->priv->win;
	_tmp20_ = selection_path;
	_tmp21_ = g_file_new_for_path (_tmp20_);
	_tmp22_ = _tmp21_;
	_tmp23_ = selection_line;
	gedit_commands_load_location (_tmp19_, _tmp22_, NULL, _tmp23_, 0);
	_g_object_unref0 (_tmp22_);
	_g_free0 (selection_path);
	G_IS_VALUE (&val1) ? (g_value_unset (&val1), NULL) : NULL;
	G_IS_VALUE (&val0) ? (g_value_unset (&val0), NULL) : NULL;
}


static glong string_strnlen (gchar* str, glong maxlen) {
	glong result = 0L;
	gchar* end = NULL;
	gchar* _tmp0_ = NULL;
	glong _tmp1_ = 0L;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	_tmp0_ = str;
	_tmp1_ = maxlen;
	_tmp2_ = memchr (_tmp0_, 0, (gsize) _tmp1_);
	end = _tmp2_;
	_tmp3_ = end;
	if (_tmp3_ == NULL) {
		glong _tmp4_ = 0L;
		_tmp4_ = maxlen;
		result = _tmp4_;
		return result;
	} else {
		gchar* _tmp5_ = NULL;
		gchar* _tmp6_ = NULL;
		_tmp5_ = end;
		_tmp6_ = str;
		result = (glong) (_tmp5_ - _tmp6_);
		return result;
	}
}


static gchar* string_substring (const gchar* self, glong offset, glong len) {
	gchar* result = NULL;
	glong string_length = 0L;
	gboolean _tmp0_ = FALSE;
	glong _tmp1_ = 0L;
	glong _tmp8_ = 0L;
	glong _tmp14_ = 0L;
	glong _tmp17_ = 0L;
	glong _tmp18_ = 0L;
	glong _tmp19_ = 0L;
	glong _tmp20_ = 0L;
	glong _tmp21_ = 0L;
	gchar* _tmp22_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = offset;
	if (_tmp1_ >= ((glong) 0)) {
		glong _tmp2_ = 0L;
		_tmp2_ = len;
		_tmp0_ = _tmp2_ >= ((glong) 0);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		glong _tmp3_ = 0L;
		glong _tmp4_ = 0L;
		glong _tmp5_ = 0L;
		_tmp3_ = offset;
		_tmp4_ = len;
		_tmp5_ = string_strnlen ((gchar*) self, _tmp3_ + _tmp4_);
		string_length = _tmp5_;
	} else {
		gint _tmp6_ = 0;
		gint _tmp7_ = 0;
		_tmp6_ = strlen (self);
		_tmp7_ = _tmp6_;
		string_length = (glong) _tmp7_;
	}
	_tmp8_ = offset;
	if (_tmp8_ < ((glong) 0)) {
		glong _tmp9_ = 0L;
		glong _tmp10_ = 0L;
		glong _tmp11_ = 0L;
		_tmp9_ = string_length;
		_tmp10_ = offset;
		offset = _tmp9_ + _tmp10_;
		_tmp11_ = offset;
		g_return_val_if_fail (_tmp11_ >= ((glong) 0), NULL);
	} else {
		glong _tmp12_ = 0L;
		glong _tmp13_ = 0L;
		_tmp12_ = offset;
		_tmp13_ = string_length;
		g_return_val_if_fail (_tmp12_ <= _tmp13_, NULL);
	}
	_tmp14_ = len;
	if (_tmp14_ < ((glong) 0)) {
		glong _tmp15_ = 0L;
		glong _tmp16_ = 0L;
		_tmp15_ = string_length;
		_tmp16_ = offset;
		len = _tmp15_ - _tmp16_;
	}
	_tmp17_ = offset;
	_tmp18_ = len;
	_tmp19_ = string_length;
	g_return_val_if_fail ((_tmp17_ + _tmp18_) <= _tmp19_, NULL);
	_tmp20_ = offset;
	_tmp21_ = len;
	_tmp22_ = g_strndup (((gchar*) self) + _tmp20_, (gsize) _tmp21_);
	result = _tmp22_;
	return result;
}


static gchar* gedit_find_in_files_plugin_result_panel_get_relative_path (GeditFindInFilesPluginResultPanel* self, const gchar* path, const gchar* from) {
	gchar* result = NULL;
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	const gchar* _tmp8_ = NULL;
	gchar* _tmp9_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (path != NULL, NULL);
	g_return_val_if_fail (from != NULL, NULL);
	_tmp0_ = path;
	_tmp1_ = from;
	_tmp2_ = g_str_has_prefix (_tmp0_, _tmp1_);
	if (_tmp2_) {
		const gchar* _tmp3_ = NULL;
		const gchar* _tmp4_ = NULL;
		gint _tmp5_ = 0;
		gint _tmp6_ = 0;
		gchar* _tmp7_ = NULL;
		_tmp3_ = path;
		_tmp4_ = from;
		_tmp5_ = strlen (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = string_substring (_tmp3_, (glong) (_tmp6_ + 1), (glong) (-1));
		result = _tmp7_;
		return result;
	}
	_tmp8_ = path;
	_tmp9_ = g_strdup (_tmp8_);
	result = _tmp9_;
	return result;
}


static void gedit_find_in_files_plugin_result_panel_column_data_func (GeditFindInFilesPluginResultPanel* self, GtkTreeViewColumn* column, GtkCellRenderer* cell, GtkTreeModel* model, GtkTreeIter* iter) {
	GtkTreeIter parent = {0};
	GtkTreeStore* _tmp0_ = NULL;
	GtkTreeIter _tmp1_ = {0};
	GtkTreeIter _tmp2_ = {0};
	gboolean _tmp3_ = FALSE;
	g_return_if_fail (self != NULL);
	g_return_if_fail (column != NULL);
	g_return_if_fail (cell != NULL);
	g_return_if_fail (model != NULL);
	g_return_if_fail (iter != NULL);
	_tmp0_ = self->priv->results_model;
	_tmp1_ = *iter;
	_tmp3_ = gtk_tree_model_iter_parent ((GtkTreeModel*) _tmp0_, &_tmp2_, &_tmp1_);
	parent = _tmp2_;
	if (!_tmp3_) {
		GValue val0 = {0};
		GValue val1 = {0};
		GtkTreeModel* _tmp4_ = NULL;
		GtkTreeIter _tmp5_ = {0};
		GValue _tmp6_ = {0};
		GtkTreeModel* _tmp7_ = NULL;
		GtkTreeIter _tmp8_ = {0};
		GValue _tmp9_ = {0};
		gchar* path = NULL;
		const gchar* _tmp10_ = NULL;
		gchar* _tmp11_ = NULL;
		gint hits = 0;
		gint _tmp12_ = 0;
		const gchar* _tmp13_ = NULL;
		gint _tmp14_ = 0;
		GtkCellRenderer* _tmp15_ = NULL;
		const gchar* _tmp16_ = NULL;
		const gchar* _tmp17_ = NULL;
		gchar* _tmp18_ = NULL;
		gchar* _tmp19_ = NULL;
		gint _tmp20_ = 0;
		gchar* _tmp21_ = NULL;
		gchar* _tmp22_ = NULL;
		_tmp4_ = model;
		_tmp5_ = *iter;
		gtk_tree_model_get_value (_tmp4_, &_tmp5_, 0, &_tmp6_);
		G_IS_VALUE (&val0) ? (g_value_unset (&val0), NULL) : NULL;
		val0 = _tmp6_;
		_tmp7_ = model;
		_tmp8_ = *iter;
		gtk_tree_model_get_value (_tmp7_, &_tmp8_, 1, &_tmp9_);
		G_IS_VALUE (&val1) ? (g_value_unset (&val1), NULL) : NULL;
		val1 = _tmp9_;
		_tmp10_ = g_value_get_string (&val0);
		_tmp11_ = g_strdup (_tmp10_);
		path = _tmp11_;
		_tmp12_ = g_value_get_int (&val1);
		hits = _tmp12_;
		_tmp14_ = hits;
		if (_tmp14_ == 1) {
			_tmp13_ = "hit";
		} else {
			_tmp13_ = "hits";
		}
		_tmp15_ = cell;
		_tmp16_ = path;
		_tmp17_ = self->priv->root;
		_tmp18_ = gedit_find_in_files_plugin_result_panel_get_relative_path (self, _tmp16_, _tmp17_);
		_tmp19_ = _tmp18_;
		_tmp20_ = hits;
		_tmp21_ = g_strdup_printf ("<b>%s</b> (%d %s)", _tmp19_, _tmp20_, _tmp13_);
		_tmp22_ = _tmp21_;
		g_object_set (G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, gtk_cell_renderer_text_get_type ()) ? ((GtkCellRendererText*) _tmp15_) : NULL, "markup", _tmp22_, NULL);
		_g_free0 (_tmp22_);
		_g_free0 (_tmp19_);
		_g_free0 (path);
		G_IS_VALUE (&val1) ? (g_value_unset (&val1), NULL) : NULL;
		G_IS_VALUE (&val0) ? (g_value_unset (&val0), NULL) : NULL;
	} else {
		GValue val0 = {0};
		GValue val1 = {0};
		GtkTreeModel* _tmp23_ = NULL;
		GtkTreeIter _tmp24_ = {0};
		GValue _tmp25_ = {0};
		GtkTreeModel* _tmp26_ = NULL;
		GtkTreeIter _tmp27_ = {0};
		GValue _tmp28_ = {0};
		gint at = 0;
		gint _tmp29_ = 0;
		gchar* line = NULL;
		const gchar* _tmp30_ = NULL;
		gchar* _tmp31_ = NULL;
		GtkCellRenderer* _tmp32_ = NULL;
		gint _tmp33_ = 0;
		const gchar* _tmp34_ = NULL;
		gchar* _tmp35_ = NULL;
		gchar* _tmp36_ = NULL;
		_tmp23_ = model;
		_tmp24_ = *iter;
		gtk_tree_model_get_value (_tmp23_, &_tmp24_, 0, &_tmp25_);
		G_IS_VALUE (&val0) ? (g_value_unset (&val0), NULL) : NULL;
		val0 = _tmp25_;
		_tmp26_ = model;
		_tmp27_ = *iter;
		gtk_tree_model_get_value (_tmp26_, &_tmp27_, 1, &_tmp28_);
		G_IS_VALUE (&val1) ? (g_value_unset (&val1), NULL) : NULL;
		val1 = _tmp28_;
		_tmp29_ = g_value_get_int (&val1);
		at = _tmp29_;
		_tmp30_ = g_value_get_string (&val0);
		_tmp31_ = g_strdup (_tmp30_);
		line = _tmp31_;
		_tmp32_ = cell;
		_tmp33_ = at;
		_tmp34_ = line;
		_tmp35_ = g_strdup_printf ("%d:%s", _tmp33_, _tmp34_);
		_tmp36_ = _tmp35_;
		g_object_set (G_TYPE_CHECK_INSTANCE_TYPE (_tmp32_, gtk_cell_renderer_text_get_type ()) ? ((GtkCellRendererText*) _tmp32_) : NULL, "text", _tmp36_, NULL);
		_g_free0 (_tmp36_);
		_g_free0 (line);
		G_IS_VALUE (&val1) ? (g_value_unset (&val1), NULL) : NULL;
		G_IS_VALUE (&val0) ? (g_value_unset (&val0), NULL) : NULL;
	}
}


static Block2Data* block2_data_ref (Block2Data* _data2_) {
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}


static void block2_data_unref (void * _userdata_) {
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		GeditFindInFilesPluginResultPanel* self;
		self = _data2_->self;
		_g_hash_table_unref0 (_data2_->it_table);
		_g_object_unref0 (self);
		g_slice_free (Block2Data, _data2_);
	}
}


static gpointer _gedit_find_in_files_plugin_find_job_ref0 (gpointer self) {
	return self ? gedit_find_in_files_plugin_find_job_ref (self) : NULL;
}


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


static void _g_free0_ (gpointer var) {
	var = (g_free (var), NULL);
}


static Block3Data* block3_data_ref (Block3Data* _data3_) {
	g_atomic_int_inc (&_data3_->_ref_count_);
	return _data3_;
}


static void block3_data_unref (void * _userdata_) {
	Block3Data* _data3_;
	_data3_ = (Block3Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
		GeditFindInFilesPluginResultPanel* self;
		self = _data3_->_data2_->self;
		gedit_find_in_files_plugin_result_destroy (&_data3_->_result_);
		block2_data_unref (_data3_->_data2_);
		_data3_->_data2_ = NULL;
		g_slice_free (Block3Data, _data3_);
	}
}


static GtkTreeIter* _gtk_tree_iter_dup (GtkTreeIter* self) {
	GtkTreeIter* dup;
	dup = g_new0 (GtkTreeIter, 1);
	memcpy (dup, self, sizeof (GtkTreeIter));
	return dup;
}


static gpointer __gtk_tree_iter_dup0 (gpointer self) {
	return self ? _gtk_tree_iter_dup (self) : NULL;
}


static gboolean __lambda9_ (Block3Data* _data3_) {
	Block2Data* _data2_;
	GeditFindInFilesPluginResultPanel* self;
	gboolean result = FALSE;
	GtkTreeIter iter = {0};
	GtkTreeIter* parent = NULL;
	GeditFindInFilesPluginResult _tmp0_ = {0};
	const gchar* _tmp1_ = NULL;
	gconstpointer _tmp2_ = NULL;
	GtkTreeIter* _tmp3_ = NULL;
	GtkTreeIter* _tmp4_ = NULL;
	GValue val0 = {0};
	GtkTreeStore* _tmp19_ = NULL;
	GtkTreeIter* _tmp20_ = NULL;
	GtkTreeIter _tmp21_ = {0};
	GValue _tmp22_ = {0};
	GtkTreeStore* _tmp23_ = NULL;
	GtkTreeIter* _tmp24_ = NULL;
	gint _tmp25_ = 0;
	GtkTreeIter _tmp26_ = {0};
	GtkTreeStore* _tmp27_ = NULL;
	GtkTreeIter* _tmp28_ = NULL;
	GtkTreeIter _tmp29_ = {0};
	GtkTreeStore* _tmp30_ = NULL;
	GtkTreeIter _tmp31_ = {0};
	GeditFindInFilesPluginResult _tmp32_ = {0};
	const gchar* _tmp33_ = NULL;
	GeditFindInFilesPluginResult _tmp34_ = {0};
	gsize _tmp35_ = 0UL;
	_data2_ = _data3_->_data2_;
	self = _data2_->self;
	_tmp0_ = _data3_->_result_;
	_tmp1_ = _tmp0_.path;
	_tmp2_ = g_hash_table_lookup (_data2_->it_table, _tmp1_);
	_tmp3_ = __gtk_tree_iter_dup0 ((GtkTreeIter*) _tmp2_);
	parent = _tmp3_;
	_tmp4_ = parent;
	if (_tmp4_ == NULL) {
		GtkTreeStore* _tmp5_ = NULL;
		GtkTreeIter _tmp6_ = {0};
		GtkTreeIter _tmp7_ = {0};
		GtkTreeIter* _tmp8_ = NULL;
		GtkTreeStore* _tmp9_ = NULL;
		GtkTreeIter* _tmp10_ = NULL;
		GeditFindInFilesPluginResult _tmp11_ = {0};
		const gchar* _tmp12_ = NULL;
		GtkTreeIter _tmp13_ = {0};
		GeditFindInFilesPluginResult _tmp14_ = {0};
		const gchar* _tmp15_ = NULL;
		gchar* _tmp16_ = NULL;
		GtkTreeIter* _tmp17_ = NULL;
		GtkTreeIter* _tmp18_ = NULL;
		_tmp5_ = self->priv->results_model;
		gtk_tree_store_append (_tmp5_, &_tmp6_, NULL);
		_g_free0 (parent);
		_tmp7_ = _tmp6_;
		_tmp8_ = __gtk_tree_iter_dup0 (&_tmp7_);
		parent = _tmp8_;
		_tmp9_ = self->priv->results_model;
		_tmp10_ = parent;
		_tmp11_ = _data3_->_result_;
		_tmp12_ = _tmp11_.path;
		_tmp13_ = *_tmp10_;
		gtk_tree_store_set (_tmp9_, &_tmp13_, 0, _tmp12_, 1, 0, -1);
		_tmp14_ = _data3_->_result_;
		_tmp15_ = _tmp14_.path;
		_tmp16_ = g_strdup (_tmp15_);
		_tmp17_ = parent;
		_tmp18_ = __gtk_tree_iter_dup0 (_tmp17_);
		g_hash_table_insert (_data2_->it_table, _tmp16_, _tmp18_);
	}
	_tmp19_ = self->priv->results_model;
	_tmp20_ = parent;
	_tmp21_ = *_tmp20_;
	gtk_tree_model_get_value ((GtkTreeModel*) _tmp19_, &_tmp21_, 1, &_tmp22_);
	G_IS_VALUE (&val0) ? (g_value_unset (&val0), NULL) : NULL;
	val0 = _tmp22_;
	_tmp23_ = self->priv->results_model;
	_tmp24_ = parent;
	_tmp25_ = g_value_get_int (&val0);
	_tmp26_ = *_tmp24_;
	gtk_tree_store_set (_tmp23_, &_tmp26_, 1, _tmp25_ + 1, -1);
	_tmp27_ = self->priv->results_model;
	_tmp28_ = parent;
	gtk_tree_store_append (_tmp27_, &_tmp29_, _tmp28_);
	iter = _tmp29_;
	_tmp30_ = self->priv->results_model;
	_tmp31_ = iter;
	_tmp32_ = _data3_->_result_;
	_tmp33_ = _tmp32_.context;
	_tmp34_ = _data3_->_result_;
	_tmp35_ = _tmp34_.line;
	gtk_tree_store_set (_tmp30_, &_tmp31_, 0, _tmp33_, 1, _tmp35_, -1);
	result = FALSE;
	G_IS_VALUE (&val0) ? (g_value_unset (&val0), NULL) : NULL;
	_g_free0 (parent);
	return result;
}


static gboolean ___lambda9__gsource_func (gpointer self) {
	gboolean result;
	result = __lambda9_ (self);
	return result;
}


static void __lambda8_ (Block2Data* _data2_, GeditFindInFilesPluginResult* _result_) {
	GeditFindInFilesPluginResultPanel* self;
	Block3Data* _data3_;
	GeditFindInFilesPluginResult _tmp0_ = {0};
	GeditFindInFilesPluginResult _tmp1_ = {0};
	self = _data2_->self;
	g_return_if_fail (_result_ != NULL);
	_data3_ = g_slice_new0 (Block3Data);
	_data3_->_ref_count_ = 1;
	_data3_->_data2_ = block2_data_ref (_data2_);
	_tmp0_ = *_result_;
	gedit_find_in_files_plugin_result_copy (&_tmp0_, &_tmp1_);
	gedit_find_in_files_plugin_result_destroy (&_data3_->_result_);
	_data3_->_result_ = _tmp1_;
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda9__gsource_func, block3_data_ref (_data3_), block3_data_unref);
	block3_data_unref (_data3_);
	_data3_ = NULL;
}


static void ___lambda8__gedit_find_in_files_plugin_find_job_on_match_found (GeditFindInFilesPluginFindJob* _sender, GeditFindInFilesPluginResult* _result_, gpointer self) {
	__lambda8_ (self, _result_);
}


static void __lambda10_ (GeditFindInFilesPluginResultPanel* self) {
	GeditFindInFilesPluginFindJob* _tmp0_ = NULL;
	GtkButton* _tmp1_ = NULL;
	GtkTreeView* _tmp2_ = NULL;
	GtkTreeIter dummy = {0};
	GtkTreeStore* _tmp3_ = NULL;
	GtkTreeIter _tmp4_ = {0};
	gboolean _tmp5_ = FALSE;
	_tmp0_ = self->priv->job;
	gedit_find_in_files_plugin_find_job_halt (_tmp0_);
	_tmp1_ = self->priv->stop_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp1_, FALSE);
	_tmp2_ = self->priv->list;
	gtk_tree_view_expand_all (_tmp2_);
	_tmp3_ = self->priv->results_model;
	_tmp5_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) _tmp3_, &_tmp4_);
	dummy = _tmp4_;
	if (!_tmp5_) {
		GtkTreeStore* _tmp6_ = NULL;
		GtkTreeIter _tmp7_ = {0};
		GtkTreeStore* _tmp8_ = NULL;
		GtkTreeIter _tmp9_ = {0};
		const gchar* _tmp10_ = NULL;
		_tmp6_ = self->priv->results_model;
		gtk_tree_store_append (_tmp6_, &_tmp7_, NULL);
		dummy = _tmp7_;
		_tmp8_ = self->priv->results_model;
		_tmp9_ = dummy;
		_tmp10_ = _ ("No results found");
		gtk_tree_store_set (_tmp8_, &_tmp9_, 0, _tmp10_, -1);
	}
}


static void ___lambda10__gedit_find_in_files_plugin_find_job_on_search_finished (GeditFindInFilesPluginFindJob* _sender, gpointer self) {
	__lambda10_ ((GeditFindInFilesPluginResultPanel*) self);
}


static gboolean _gedit_find_in_files_plugin_result_panel_list_search_gtk_tree_view_search_equal_func (GtkTreeModel* model, gint column, const gchar* key, GtkTreeIter* iter, gpointer self) {
	gboolean result;
	result = gedit_find_in_files_plugin_result_panel_list_search ((GeditFindInFilesPluginResultPanel*) self, model, column, key, iter);
	return result;
}


static void _gedit_find_in_files_plugin_result_panel_column_data_func_gtk_tree_cell_data_func (GtkTreeViewColumn* tree_column, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer self) {
	gedit_find_in_files_plugin_result_panel_column_data_func ((GeditFindInFilesPluginResultPanel*) self, tree_column, cell, tree_model, iter);
}


static void _gedit_find_in_files_plugin_result_panel_on_row_activated_gtk_tree_view_row_activated (GtkTreeView* _sender, GtkTreePath* path, GtkTreeViewColumn* column, gpointer self) {
	gedit_find_in_files_plugin_result_panel_on_row_activated ((GeditFindInFilesPluginResultPanel*) self, path, column);
}


static gboolean _gedit_find_in_files_plugin_result_panel_on_button_press_gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self) {
	gboolean result;
	result = gedit_find_in_files_plugin_result_panel_on_button_press ((GeditFindInFilesPluginResultPanel*) self, event);
	return result;
}


static void __lambda11_ (GeditFindInFilesPluginResultPanel* self) {
	GtkButton* _tmp0_ = NULL;
	GeditFindInFilesPluginFindJob* _tmp1_ = NULL;
	_tmp0_ = self->priv->stop_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, FALSE);
	_tmp1_ = self->priv->job;
	gedit_find_in_files_plugin_find_job_halt (_tmp1_);
}


static void ___lambda11__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda11_ ((GeditFindInFilesPluginResultPanel*) self);
}


GeditFindInFilesPluginResultPanel* gedit_find_in_files_plugin_result_panel_construct_for_job (GType object_type, GeditFindInFilesPluginFindJob* job_, const gchar* root_, GeditWindow* win_) {
	GeditFindInFilesPluginResultPanel * self = NULL;
	Block2Data* _data2_;
	GtkTreeStore* _tmp0_ = NULL;
	GeditFindInFilesPluginFindJob* _tmp1_ = NULL;
	GeditFindInFilesPluginFindJob* _tmp2_ = NULL;
	GeditWindow* _tmp3_ = NULL;
	GeditWindow* _tmp4_ = NULL;
	const gchar* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	GHashFunc _tmp7_ = NULL;
	GEqualFunc _tmp8_ = NULL;
	GHashTable* _tmp9_ = NULL;
	GeditFindInFilesPluginFindJob* _tmp10_ = NULL;
	GeditFindInFilesPluginFindJob* _tmp11_ = NULL;
	GtkTreeStore* _tmp12_ = NULL;
	GtkTreeView* _tmp13_ = NULL;
	GtkTreeView* _tmp14_ = NULL;
	GtkTreeView* _tmp15_ = NULL;
	GtkTreeView* _tmp16_ = NULL;
	GtkCellRendererText* _tmp17_ = NULL;
	GtkCellRendererText* _tmp18_ = NULL;
	GtkTreeView* _tmp19_ = NULL;
	GtkTreeView* _tmp20_ = NULL;
	GtkButton* _tmp21_ = NULL;
	GtkButton* _tmp22_ = NULL;
	const gchar* _tmp23_ = NULL;
	GtkButton* _tmp24_ = NULL;
	GtkButton* _tmp25_ = NULL;
	GtkButton* _tmp26_ = NULL;
	GtkButton* _tmp27_ = NULL;
	GtkButton* _tmp28_ = NULL;
	GtkButton* _tmp29_ = NULL;
	GtkScrolledWindow* scroll = NULL;
	GtkScrolledWindow* _tmp30_ = NULL;
	GtkTreeView* _tmp31_ = NULL;
	GtkButton* _tmp32_ = NULL;
	g_return_val_if_fail (job_ != NULL, NULL);
	g_return_val_if_fail (root_ != NULL, NULL);
	g_return_val_if_fail (win_ != NULL, NULL);
	_data2_ = g_slice_new0 (Block2Data);
	_data2_->_ref_count_ = 1;
	self = (GeditFindInFilesPluginResultPanel*) g_object_new (object_type, NULL);
	_data2_->self = g_object_ref (self);
	_tmp0_ = gtk_tree_store_new (2, G_TYPE_STRING, G_TYPE_INT);
	_g_object_unref0 (self->priv->results_model);
	self->priv->results_model = _tmp0_;
	_tmp1_ = job_;
	_tmp2_ = _gedit_find_in_files_plugin_find_job_ref0 (_tmp1_);
	_gedit_find_in_files_plugin_find_job_unref0 (self->priv->job);
	self->priv->job = _tmp2_;
	_tmp3_ = win_;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_g_object_unref0 (self->priv->win);
	self->priv->win = _tmp4_;
	_tmp5_ = root_;
	_tmp6_ = g_strdup (_tmp5_);
	_g_free0 (self->priv->root);
	self->priv->root = _tmp6_;
	_tmp7_ = g_str_hash;
	_tmp8_ = g_str_equal;
	_tmp9_ = g_hash_table_new_full (_tmp7_, _tmp8_, _g_free0_, _g_free0_);
	_data2_->it_table = _tmp9_;
	_tmp10_ = self->priv->job;
	g_signal_connect_data (_tmp10_, "on-match-found", (GCallback) ___lambda8__gedit_find_in_files_plugin_find_job_on_match_found, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
	_tmp11_ = self->priv->job;
	g_signal_connect_object (_tmp11_, "on-search-finished", (GCallback) ___lambda10__gedit_find_in_files_plugin_find_job_on_search_finished, self, 0);
	_tmp12_ = self->priv->results_model;
	_tmp13_ = (GtkTreeView*) gtk_tree_view_new_with_model ((GtkTreeModel*) _tmp12_);
	g_object_ref_sink (_tmp13_);
	_g_object_unref0 (self->priv->list);
	self->priv->list = _tmp13_;
	_tmp14_ = self->priv->list;
	gtk_tree_view_set_search_column (_tmp14_, 0);
	_tmp15_ = self->priv->list;
	gtk_tree_view_set_search_equal_func (_tmp15_, _gedit_find_in_files_plugin_result_panel_list_search_gtk_tree_view_search_equal_func, g_object_ref (self), g_object_unref);
	_tmp16_ = self->priv->list;
	_tmp17_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	g_object_ref_sink (_tmp17_);
	_tmp18_ = _tmp17_;
	gtk_tree_view_insert_column_with_data_func (_tmp16_, -1, "File", (GtkCellRenderer*) _tmp18_, _gedit_find_in_files_plugin_result_panel_column_data_func_gtk_tree_cell_data_func, g_object_ref (self), g_object_unref);
	_g_object_unref0 (_tmp18_);
	_tmp19_ = self->priv->list;
	g_signal_connect_object (_tmp19_, "row-activated", (GCallback) _gedit_find_in_files_plugin_result_panel_on_row_activated_gtk_tree_view_row_activated, self, 0);
	_tmp20_ = self->priv->list;
	g_signal_connect_object ((GtkWidget*) _tmp20_, "button-press-event", (GCallback) _gedit_find_in_files_plugin_result_panel_on_button_press_gtk_widget_button_press_event, self, 0);
	_tmp21_ = (GtkButton*) gtk_button_new_from_icon_name ("process-stop-symbolic", GTK_ICON_SIZE_BUTTON);
	g_object_ref_sink (_tmp21_);
	_g_object_unref0 (self->priv->stop_button);
	self->priv->stop_button = _tmp21_;
	_tmp22_ = self->priv->stop_button;
	_tmp23_ = _ ("Stop the search");
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp22_, _tmp23_);
	_tmp24_ = self->priv->stop_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp24_, FALSE);
	_tmp25_ = self->priv->stop_button;
	gtk_widget_set_valign ((GtkWidget*) _tmp25_, GTK_ALIGN_END);
	_tmp26_ = self->priv->stop_button;
	gtk_widget_set_halign ((GtkWidget*) _tmp26_, GTK_ALIGN_END);
	_tmp27_ = self->priv->stop_button;
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp27_, 4);
	_tmp28_ = self->priv->stop_button;
	gtk_widget_set_margin_end ((GtkWidget*) _tmp28_, 4);
	_tmp29_ = self->priv->stop_button;
	g_signal_connect_object (_tmp29_, "clicked", (GCallback) ___lambda11__gtk_button_clicked, self, 0);
	_tmp30_ = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL);
	g_object_ref_sink (_tmp30_);
	scroll = _tmp30_;
	gtk_scrolled_window_set_policy (scroll, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
	_tmp31_ = self->priv->list;
	gtk_container_add ((GtkContainer*) scroll, (GtkWidget*) _tmp31_);
	_tmp32_ = self->priv->stop_button;
	gtk_overlay_add_overlay ((GtkOverlay*) self, (GtkWidget*) _tmp32_);
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) scroll);
	_g_object_unref0 (scroll);
	block2_data_unref (_data2_);
	_data2_ = NULL;
	return self;
}


GeditFindInFilesPluginResultPanel* gedit_find_in_files_plugin_result_panel_new_for_job (GeditFindInFilesPluginFindJob* job_, const gchar* root_, GeditWindow* win_) {
	return gedit_find_in_files_plugin_result_panel_construct_for_job (GEDIT_FIND_IN_FILES_PLUGIN_TYPE_RESULT_PANEL, job_, root_, win_);
}


void gedit_find_in_files_plugin_result_panel_toggle_stop_button (GeditFindInFilesPluginResultPanel* self, gboolean show) {
	GtkButton* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->stop_button;
	_tmp1_ = show;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, _tmp1_);
}


GeditFindInFilesPluginResultPanel* gedit_find_in_files_plugin_result_panel_construct (GType object_type) {
	GeditFindInFilesPluginResultPanel * self = NULL;
	self = (GeditFindInFilesPluginResultPanel*) g_object_new (object_type, NULL);
	return self;
}


GeditFindInFilesPluginResultPanel* gedit_find_in_files_plugin_result_panel_new (void) {
	return gedit_find_in_files_plugin_result_panel_construct (GEDIT_FIND_IN_FILES_PLUGIN_TYPE_RESULT_PANEL);
}


static void gedit_find_in_files_plugin_result_panel_class_init (GeditFindInFilesPluginResultPanelClass * klass) {
	gedit_find_in_files_plugin_result_panel_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GeditFindInFilesPluginResultPanelPrivate));
	G_OBJECT_CLASS (klass)->finalize = gedit_find_in_files_plugin_result_panel_finalize;
}


static void gedit_find_in_files_plugin_result_panel_instance_init (GeditFindInFilesPluginResultPanel * self) {
	self->priv = GEDIT_FIND_IN_FILES_PLUGIN_RESULT_PANEL_GET_PRIVATE (self);
}


static void gedit_find_in_files_plugin_result_panel_finalize (GObject* obj) {
	GeditFindInFilesPluginResultPanel * self;
	GeditFindInFilesPluginFindJob* _tmp0_ = NULL;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEDIT_FIND_IN_FILES_PLUGIN_TYPE_RESULT_PANEL, GeditFindInFilesPluginResultPanel);
	_tmp0_ = self->priv->job;
	gedit_find_in_files_plugin_find_job_halt (_tmp0_);
	_gedit_find_in_files_plugin_find_job_unref0 (self->priv->job);
	_g_free0 (self->priv->root);
	_g_object_unref0 (self->priv->list);
	_g_object_unref0 (self->priv->results_model);
	_g_object_unref0 (self->priv->stop_button);
	_g_object_unref0 (self->priv->win);
	G_OBJECT_CLASS (gedit_find_in_files_plugin_result_panel_parent_class)->finalize (obj);
}


GType gedit_find_in_files_plugin_result_panel_get_type (void) {
	return gedit_find_in_files_plugin_result_panel_type_id;
}


GType gedit_find_in_files_plugin_result_panel_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (GeditFindInFilesPluginResultPanelClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gedit_find_in_files_plugin_result_panel_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeditFindInFilesPluginResultPanel), 0, (GInstanceInitFunc) gedit_find_in_files_plugin_result_panel_instance_init, NULL };
	gedit_find_in_files_plugin_result_panel_type_id = g_type_module_register_type (module, gtk_overlay_get_type (), "GeditFindInFilesPluginResultPanel", &g_define_type_info, 0);
	return gedit_find_in_files_plugin_result_panel_type_id;
}



