/* plugin.c generated by valac 0.29.1, the Vala compiler
 * generated from plugin.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 <libpeas/peas.h>
#include <gedit/gedit-window-activatable.h>
#include <gedit/gedit-window.h>
#include <gio/gio.h>
#include <gedit/gedit-message-bus.h>
#include <gedit/gedit-message.h>
#include <gtk/gtk.h>
#include <gedit/gedit-document.h>
#include <gtksourceview/gtksource.h>
#include <stdlib.h>
#include <string.h>
#include <gedit/gedit-app-activatable.h>
#include <gedit/gedit-menu-extension.h>
#include <gedit/gedit-app.h>
#include <glib/gi18n-lib.h>
#include <config.h>


#define GEDIT_FIND_IN_FILES_PLUGIN_TYPE_WINDOW (gedit_find_in_files_plugin_window_get_type ())
#define GEDIT_FIND_IN_FILES_PLUGIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_FIND_IN_FILES_PLUGIN_TYPE_WINDOW, GeditFindInFilesPluginWindow))
#define GEDIT_FIND_IN_FILES_PLUGIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_FIND_IN_FILES_PLUGIN_TYPE_WINDOW, GeditFindInFilesPluginWindowClass))
#define GEDIT_FIND_IN_FILES_PLUGIN_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_FIND_IN_FILES_PLUGIN_TYPE_WINDOW))
#define GEDIT_FIND_IN_FILES_PLUGIN_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_FIND_IN_FILES_PLUGIN_TYPE_WINDOW))
#define GEDIT_FIND_IN_FILES_PLUGIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_FIND_IN_FILES_PLUGIN_TYPE_WINDOW, GeditFindInFilesPluginWindowClass))

typedef struct _GeditFindInFilesPluginWindow GeditFindInFilesPluginWindow;
typedef struct _GeditFindInFilesPluginWindowClass GeditFindInFilesPluginWindowClass;
typedef struct _GeditFindInFilesPluginWindowPrivate GeditFindInFilesPluginWindowPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define GEDIT_FIND_IN_FILES_PLUGIN_TYPE_FIND_DIALOG (gedit_find_in_files_plugin_find_dialog_get_type ())
#define GEDIT_FIND_IN_FILES_PLUGIN_FIND_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_FIND_IN_FILES_PLUGIN_TYPE_FIND_DIALOG, GeditFindInFilesPluginFindDialog))
#define GEDIT_FIND_IN_FILES_PLUGIN_FIND_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_FIND_IN_FILES_PLUGIN_TYPE_FIND_DIALOG, GeditFindInFilesPluginFindDialogClass))
#define GEDIT_FIND_IN_FILES_PLUGIN_IS_FIND_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_FIND_IN_FILES_PLUGIN_TYPE_FIND_DIALOG))
#define GEDIT_FIND_IN_FILES_PLUGIN_IS_FIND_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_FIND_IN_FILES_PLUGIN_TYPE_FIND_DIALOG))
#define GEDIT_FIND_IN_FILES_PLUGIN_FIND_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_FIND_IN_FILES_PLUGIN_TYPE_FIND_DIALOG, GeditFindInFilesPluginFindDialogClass))

typedef struct _GeditFindInFilesPluginFindDialog GeditFindInFilesPluginFindDialog;
typedef struct _GeditFindInFilesPluginFindDialogClass GeditFindInFilesPluginFindDialogClass;
typedef struct _Block1Data Block1Data;
typedef struct _GeditFindInFilesPluginFindDialogPrivate GeditFindInFilesPluginFindDialogPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))

#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;
typedef struct _GeditFindInFilesPluginFindJobPrivate GeditFindInFilesPluginFindJobPrivate;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#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 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;

#define GEDIT_FIND_IN_FILES_PLUGIN_TYPE_APP (gedit_find_in_files_plugin_app_get_type ())
#define GEDIT_FIND_IN_FILES_PLUGIN_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_FIND_IN_FILES_PLUGIN_TYPE_APP, GeditFindInFilesPluginApp))
#define GEDIT_FIND_IN_FILES_PLUGIN_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_FIND_IN_FILES_PLUGIN_TYPE_APP, GeditFindInFilesPluginAppClass))
#define GEDIT_FIND_IN_FILES_PLUGIN_IS_APP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_FIND_IN_FILES_PLUGIN_TYPE_APP))
#define GEDIT_FIND_IN_FILES_PLUGIN_IS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_FIND_IN_FILES_PLUGIN_TYPE_APP))
#define GEDIT_FIND_IN_FILES_PLUGIN_APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_FIND_IN_FILES_PLUGIN_TYPE_APP, GeditFindInFilesPluginAppClass))

typedef struct _GeditFindInFilesPluginApp GeditFindInFilesPluginApp;
typedef struct _GeditFindInFilesPluginAppClass GeditFindInFilesPluginAppClass;
typedef struct _GeditFindInFilesPluginAppPrivate GeditFindInFilesPluginAppPrivate;

struct _GeditFindInFilesPluginWindow {
	PeasExtensionBase parent_instance;
	GeditFindInFilesPluginWindowPrivate * priv;
};

struct _GeditFindInFilesPluginWindowClass {
	PeasExtensionBaseClass parent_class;
};

struct _GeditFindInFilesPluginWindowPrivate {
	GeditWindow* _window;
};

struct _Block1Data {
	int _ref_count_;
	GeditFindInFilesPluginWindow* self;
	GeditFindInFilesPluginFindDialog* dialog;
};

struct _GeditFindInFilesPluginFindDialog {
	GtkDialog parent_instance;
	GeditFindInFilesPluginFindDialogPrivate * priv;
	GtkEntry* search_entry;
	GtkFileChooserButton* sel_folder;
	GtkCheckButton* match_case_checkbutton;
	GtkCheckButton* entire_word_checkbutton;
	GtkCheckButton* regex_checkbutton;
	GtkWidget* find_button;
};

struct _GeditFindInFilesPluginFindDialogClass {
	GtkDialogClass parent_class;
};

struct _GeditFindInFilesPluginFindJob {
	GTypeInstance parent_instance;
	volatile int ref_count;
	GeditFindInFilesPluginFindJobPrivate * priv;
	gboolean include_hidden;
	gboolean match_whole_word;
	gboolean ignore_case;
};

struct _GeditFindInFilesPluginFindJobClass {
	GTypeClass parent_class;
	void (*finalize) (GeditFindInFilesPluginFindJob *self);
};

struct _GeditFindInFilesPluginApp {
	GObject parent_instance;
	GeditFindInFilesPluginAppPrivate * priv;
};

struct _GeditFindInFilesPluginAppClass {
	GObjectClass parent_class;
};

struct _GeditFindInFilesPluginAppPrivate {
	GeditMenuExtension* menu_ext;
	GeditApp* _app;
};


static gpointer gedit_find_in_files_plugin_window_parent_class = NULL;
static GeditWindowActivatableInterface* gedit_find_in_files_plugin_window_gedit_window_activatable_parent_iface = NULL;
static GType gedit_find_in_files_plugin_window_type_id = 0;
static gpointer gedit_find_in_files_plugin_app_parent_class = NULL;
static GeditAppActivatableInterface* gedit_find_in_files_plugin_app_gedit_app_activatable_parent_iface = NULL;
static GType gedit_find_in_files_plugin_app_type_id = 0;

GType gedit_find_in_files_plugin_window_get_type (void) G_GNUC_CONST;
GType gedit_find_in_files_plugin_window_register_type (GTypeModule * module);
#define GEDIT_FIND_IN_FILES_PLUGIN_WINDOW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEDIT_FIND_IN_FILES_PLUGIN_TYPE_WINDOW, GeditFindInFilesPluginWindowPrivate))
enum  {
	GEDIT_FIND_IN_FILES_PLUGIN_WINDOW_DUMMY_PROPERTY,
	GEDIT_FIND_IN_FILES_PLUGIN_WINDOW_WINDOW
};
GeditFindInFilesPluginWindow* gedit_find_in_files_plugin_window_new (void);
GeditFindInFilesPluginWindow* gedit_find_in_files_plugin_window_construct (GType object_type);
static GFile* gedit_find_in_files_plugin_window_get_file_browser_root (GeditFindInFilesPluginWindow* self);
static void gedit_find_in_files_plugin_window_dialog_run (GeditFindInFilesPluginWindow* self);
GType gedit_find_in_files_plugin_find_dialog_get_type (void) G_GNUC_CONST;
GType gedit_find_in_files_plugin_find_dialog_register_type (GTypeModule * module);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
GeditFindInFilesPluginFindDialog* gedit_find_in_files_plugin_find_dialog_new (GFile* root);
GeditFindInFilesPluginFindDialog* gedit_find_in_files_plugin_find_dialog_construct (GType object_type, GFile* root);
static void __lambda6_ (Block1Data* _data1_, gint response_id);
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);
GeditFindInFilesPluginFindJob* gedit_find_in_files_plugin_find_job_new (GCancellable* cancellable);
GeditFindInFilesPluginFindJob* gedit_find_in_files_plugin_find_job_construct (GType object_type, GCancellable* cancellable);
void gedit_find_in_files_plugin_find_job_prepare (GeditFindInFilesPluginFindJob* self, const gchar* needle, gboolean is_regex, GError** error);
void gedit_find_in_files_plugin_find_job_execute (GeditFindInFilesPluginFindJob* self, const gchar* root, GAsyncReadyCallback _callback_, gpointer _user_data_);
void gedit_find_in_files_plugin_find_job_execute_finish (GeditFindInFilesPluginFindJob* self, GAsyncResult* _res_, GError** error);
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);
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_);
void gedit_find_in_files_plugin_result_panel_toggle_stop_button (GeditFindInFilesPluginResultPanel* self, gboolean show);
void gedit_find_in_files_plugin_result_panel_grab_focus (GeditFindInFilesPluginResultPanel* self);
static void ___lambda6__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self);
static void gedit_find_in_files_plugin_window_real_activate (GeditWindowActivatable* base);
static void _gedit_find_in_files_plugin_window_dialog_run_g_simple_action_activate (GSimpleAction* _sender, GVariant* parameter, gpointer self);
static void gedit_find_in_files_plugin_window_real_deactivate (GeditWindowActivatable* base);
static void gedit_find_in_files_plugin_window_real_update_state (GeditWindowActivatable* base);
static void gedit_find_in_files_plugin_window_finalize (GObject* obj);
static void _vala_gedit_find_in_files_plugin_window_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_gedit_find_in_files_plugin_window_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
GType gedit_find_in_files_plugin_app_get_type (void) G_GNUC_CONST;
GType gedit_find_in_files_plugin_app_register_type (GTypeModule * module);
#define GEDIT_FIND_IN_FILES_PLUGIN_APP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEDIT_FIND_IN_FILES_PLUGIN_TYPE_APP, GeditFindInFilesPluginAppPrivate))
enum  {
	GEDIT_FIND_IN_FILES_PLUGIN_APP_DUMMY_PROPERTY,
	GEDIT_FIND_IN_FILES_PLUGIN_APP_APP
};
GeditFindInFilesPluginApp* gedit_find_in_files_plugin_app_new (void);
GeditFindInFilesPluginApp* gedit_find_in_files_plugin_app_construct (GType object_type);
static void gedit_find_in_files_plugin_app_real_activate (GeditAppActivatable* base);
static void gedit_find_in_files_plugin_app_real_deactivate (GeditAppActivatable* base);
static void gedit_find_in_files_plugin_app_finalize (GObject* obj);
static void _vala_gedit_find_in_files_plugin_app_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_gedit_find_in_files_plugin_app_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
void peas_register_types (GTypeModule* module);


GeditFindInFilesPluginWindow* gedit_find_in_files_plugin_window_construct (GType object_type) {
	GeditFindInFilesPluginWindow * self = NULL;
	self = (GeditFindInFilesPluginWindow*) g_object_new (object_type, NULL);
	return self;
}


GeditFindInFilesPluginWindow* gedit_find_in_files_plugin_window_new (void) {
	return gedit_find_in_files_plugin_window_construct (GEDIT_FIND_IN_FILES_PLUGIN_TYPE_WINDOW);
}


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


static GFile* gedit_find_in_files_plugin_window_get_file_browser_root (GeditFindInFilesPluginWindow* self) {
	GFile* result = NULL;
	GeditMessageBus* bus = NULL;
	GeditWindow* _tmp0_ = NULL;
	GeditWindow* _tmp1_ = NULL;
	GeditWindow* _tmp2_ = NULL;
	GeditMessageBus* _tmp3_ = NULL;
	GeditMessageBus* _tmp4_ = NULL;
	GeditMessageBus* _tmp5_ = NULL;
	GeditMessageBus* _tmp6_ = NULL;
	gboolean _tmp7_ = FALSE;
	g_return_val_if_fail (self != NULL, NULL);
	g_object_get ((GeditWindowActivatable*) self, "window", &_tmp0_, NULL);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp3_ = gedit_window_get_message_bus (_tmp2_);
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_tmp5_ = _tmp4_;
	_g_object_unref0 (_tmp2_);
	bus = _tmp5_;
	_tmp6_ = bus;
	_tmp7_ = gedit_message_bus_is_registered (_tmp6_, "/plugins/filebrowser", "get_root");
	if (_tmp7_) {
		GObject* msg = NULL;
		GeditMessageBus* _tmp8_ = NULL;
		GType _tmp9_ = 0UL;
		GObject* _tmp10_ = NULL;
		GObject* _tmp11_ = NULL;
		GeditMessageBus* _tmp12_ = NULL;
		GObject* _tmp13_ = NULL;
		GValue val = {0};
		GValue _tmp14_ = {0};
		GObject* _tmp15_ = NULL;
		GObject* _tmp16_ = NULL;
		GFile* _tmp17_ = NULL;
		_tmp8_ = bus;
		_tmp9_ = gedit_message_bus_lookup (_tmp8_, "/plugins/filebrowser", "get_root");
		_tmp10_ = g_object_new (_tmp9_, "method", "get_root", "object_path", "/plugins/filebrowser", NULL);
		_tmp11_ = G_IS_INITIALLY_UNOWNED (_tmp10_) ? g_object_ref_sink (_tmp10_) : _tmp10_;
		msg = _tmp11_;
		_tmp12_ = bus;
		_tmp13_ = msg;
		gedit_message_bus_send_message_sync (_tmp12_, G_TYPE_CHECK_INSTANCE_TYPE (_tmp13_, gedit_message_get_type ()) ? ((GeditMessage*) _tmp13_) : NULL);
		g_value_init (&_tmp14_, G_TYPE_OBJECT);
		val = _tmp14_;
		_tmp15_ = msg;
		g_object_get_property (_tmp15_, "location", &val);
		_tmp16_ = g_value_dup_object (&val);
		_tmp17_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp16_, G_TYPE_FILE) ? ((GFile*) _tmp16_) : NULL;
		if (_tmp17_ == NULL) {
			_g_object_unref0 (_tmp16_);
		}
		result = _tmp17_;
		G_IS_VALUE (&val) ? (g_value_unset (&val), NULL) : NULL;
		_g_object_unref0 (msg);
		_g_object_unref0 (bus);
		return result;
	}
	result = NULL;
	_g_object_unref0 (bus);
	return result;
}


static Block1Data* block1_data_ref (Block1Data* _data1_) {
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}


static void block1_data_unref (void * _userdata_) {
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		GeditFindInFilesPluginWindow* self;
		self = _data1_->self;
		_g_object_unref0 (_data1_->dialog);
		_g_object_unref0 (self);
		g_slice_free (Block1Data, _data1_);
	}
}


static void __lambda6_ (Block1Data* _data1_, gint response_id) {
	GeditFindInFilesPluginWindow* self;
	gint _tmp0_ = 0;
	GeditFindInFilesPluginFindDialog* _tmp64_ = NULL;
	GError * _inner_error_ = NULL;
	self = _data1_->self;
	_tmp0_ = response_id;
	if (_tmp0_ == ((gint) GTK_RESPONSE_OK)) {
		gchar* search_text = NULL;
		GeditFindInFilesPluginFindDialog* _tmp1_ = NULL;
		GtkEntry* _tmp2_ = NULL;
		const gchar* _tmp3_ = NULL;
		const gchar* _tmp4_ = NULL;
		gchar* _tmp5_ = NULL;
		gchar* search_path = NULL;
		GeditFindInFilesPluginFindDialog* _tmp6_ = NULL;
		GtkFileChooserButton* _tmp7_ = NULL;
		gchar* _tmp8_ = NULL;
		GtkStack* panel = NULL;
		GeditWindow* _tmp9_ = NULL;
		GeditWindow* _tmp10_ = NULL;
		GeditWindow* _tmp11_ = NULL;
		GtkWidget* _tmp12_ = NULL;
		GtkStack* _tmp13_ = NULL;
		GtkStack* _tmp14_ = NULL;
		GtkWidget* child = NULL;
		GtkStack* _tmp15_ = NULL;
		GtkWidget* _tmp16_ = NULL;
		GtkWidget* _tmp17_ = NULL;
		GtkWidget* _tmp18_ = NULL;
		GCancellable* cancellable = NULL;
		GCancellable* _tmp20_ = NULL;
		GeditFindInFilesPluginFindJob* job = NULL;
		GCancellable* _tmp21_ = NULL;
		GeditFindInFilesPluginFindJob* _tmp22_ = NULL;
		GeditFindInFilesPluginFindJob* _tmp23_ = NULL;
		GeditFindInFilesPluginFindDialog* _tmp24_ = NULL;
		GtkCheckButton* _tmp25_ = NULL;
		gboolean _tmp26_ = FALSE;
		gboolean _tmp27_ = FALSE;
		GeditFindInFilesPluginFindJob* _tmp28_ = NULL;
		GeditFindInFilesPluginFindDialog* _tmp29_ = NULL;
		GtkCheckButton* _tmp30_ = NULL;
		gboolean _tmp31_ = FALSE;
		gboolean _tmp32_ = FALSE;
		GeditFindInFilesPluginResultPanel* result_panel = NULL;
		GeditFindInFilesPluginFindJob* _tmp47_ = NULL;
		const gchar* _tmp48_ = NULL;
		GeditWindow* _tmp49_ = NULL;
		GeditWindow* _tmp50_ = NULL;
		GeditWindow* _tmp51_ = NULL;
		GeditFindInFilesPluginResultPanel* _tmp52_ = NULL;
		GeditFindInFilesPluginResultPanel* _tmp53_ = NULL;
		GtkStack* _tmp54_ = NULL;
		GeditFindInFilesPluginResultPanel* _tmp55_ = NULL;
		const gchar* _tmp56_ = NULL;
		gchar* _tmp57_ = NULL;
		gchar* _tmp58_ = NULL;
		GeditFindInFilesPluginResultPanel* _tmp59_ = NULL;
		GtkStack* _tmp60_ = NULL;
		GtkStack* _tmp61_ = NULL;
		GeditFindInFilesPluginResultPanel* _tmp62_ = NULL;
		GeditFindInFilesPluginResultPanel* _tmp63_ = NULL;
		_tmp1_ = _data1_->dialog;
		_tmp2_ = _tmp1_->search_entry;
		_tmp3_ = gtk_entry_get_text (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = g_strdup (_tmp4_);
		search_text = _tmp5_;
		_tmp6_ = _data1_->dialog;
		_tmp7_ = _tmp6_->sel_folder;
		_tmp8_ = gtk_file_chooser_get_filename ((GtkFileChooser*) _tmp7_);
		search_path = _tmp8_;
		g_object_get ((GeditWindowActivatable*) self, "window", &_tmp9_, NULL);
		_tmp10_ = _tmp9_;
		_tmp11_ = _tmp10_;
		_tmp12_ = gedit_window_get_bottom_panel (_tmp11_);
		_tmp13_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, gtk_stack_get_type (), GtkStack));
		_tmp14_ = _tmp13_;
		_g_object_unref0 (_tmp11_);
		panel = _tmp14_;
		_tmp15_ = panel;
		_tmp16_ = gtk_stack_get_child_by_name (_tmp15_, "find-in-files");
		_tmp17_ = _g_object_ref0 (_tmp16_);
		child = _tmp17_;
		_tmp18_ = child;
		if (_tmp18_ != NULL) {
			GtkWidget* _tmp19_ = NULL;
			_tmp19_ = child;
			gtk_widget_destroy (_tmp19_);
		}
		_tmp20_ = g_cancellable_new ();
		cancellable = _tmp20_;
		_tmp21_ = cancellable;
		_tmp22_ = gedit_find_in_files_plugin_find_job_new (_tmp21_);
		job = _tmp22_;
		_tmp23_ = job;
		_tmp24_ = _data1_->dialog;
		_tmp25_ = _tmp24_->match_case_checkbutton;
		_tmp26_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp25_);
		_tmp27_ = _tmp26_;
		_tmp23_->ignore_case = !_tmp27_;
		_tmp28_ = job;
		_tmp29_ = _data1_->dialog;
		_tmp30_ = _tmp29_->entire_word_checkbutton;
		_tmp31_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp30_);
		_tmp32_ = _tmp31_;
		_tmp28_->match_whole_word = _tmp32_;
		{
			GeditFindInFilesPluginFindJob* _tmp33_ = NULL;
			GeditFindInFilesPluginFindDialog* _tmp34_ = NULL;
			GtkEntry* _tmp35_ = NULL;
			const gchar* _tmp36_ = NULL;
			const gchar* _tmp37_ = NULL;
			GeditFindInFilesPluginFindDialog* _tmp38_ = NULL;
			GtkCheckButton* _tmp39_ = NULL;
			gboolean _tmp40_ = FALSE;
			gboolean _tmp41_ = FALSE;
			GeditFindInFilesPluginFindJob* _tmp42_ = NULL;
			const gchar* _tmp43_ = NULL;
			_tmp33_ = job;
			_tmp34_ = _data1_->dialog;
			_tmp35_ = _tmp34_->search_entry;
			_tmp36_ = gtk_entry_get_text (_tmp35_);
			_tmp37_ = _tmp36_;
			_tmp38_ = _data1_->dialog;
			_tmp39_ = _tmp38_->regex_checkbutton;
			_tmp40_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp39_);
			_tmp41_ = _tmp40_;
			gedit_find_in_files_plugin_find_job_prepare (_tmp33_, _tmp37_, _tmp41_, &_inner_error_);
			if (G_UNLIKELY (_inner_error_ != NULL)) {
				goto __catch4_g_error;
			}
			_tmp42_ = job;
			_tmp43_ = search_path;
			gedit_find_in_files_plugin_find_job_execute (_tmp42_, _tmp43_, NULL, NULL);
		}
		goto __finally4;
		__catch4_g_error:
		{
			GError* err = NULL;
			GError* _tmp44_ = NULL;
			const gchar* _tmp45_ = NULL;
			GeditFindInFilesPluginFindDialog* _tmp46_ = NULL;
			err = _inner_error_;
			_inner_error_ = NULL;
			_tmp44_ = err;
			_tmp45_ = _tmp44_->message;
			g_warning ("plugin.vala:104: %s", _tmp45_);
			_tmp46_ = _data1_->dialog;
			gtk_widget_destroy ((GtkWidget*) _tmp46_);
			_g_error_free0 (err);
			_gedit_find_in_files_plugin_find_job_unref0 (job);
			_g_object_unref0 (cancellable);
			_g_object_unref0 (child);
			_g_object_unref0 (panel);
			_g_free0 (search_path);
			_g_free0 (search_text);
			return;
		}
		__finally4:
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			_gedit_find_in_files_plugin_find_job_unref0 (job);
			_g_object_unref0 (cancellable);
			_g_object_unref0 (child);
			_g_object_unref0 (panel);
			_g_free0 (search_path);
			_g_free0 (search_text);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return;
		}
		_tmp47_ = job;
		_tmp48_ = search_path;
		g_object_get ((GeditWindowActivatable*) self, "window", &_tmp49_, NULL);
		_tmp50_ = _tmp49_;
		_tmp51_ = _tmp50_;
		_tmp52_ = gedit_find_in_files_plugin_result_panel_new_for_job (_tmp47_, _tmp48_, _tmp51_);
		g_object_ref_sink (_tmp52_);
		_tmp53_ = _tmp52_;
		_g_object_unref0 (_tmp51_);
		result_panel = _tmp53_;
		_tmp54_ = panel;
		_tmp55_ = result_panel;
		_tmp56_ = search_text;
		_tmp57_ = g_strdup_printf ("\"%s\"", _tmp56_);
		_tmp58_ = _tmp57_;
		gtk_stack_add_titled (_tmp54_, (GtkWidget*) _tmp55_, "find-in-files", _tmp58_);
		_g_free0 (_tmp58_);
		_tmp59_ = result_panel;
		gtk_widget_show_all ((GtkWidget*) _tmp59_);
		_tmp60_ = panel;
		gtk_widget_set_visible ((GtkWidget*) _tmp60_, TRUE);
		_tmp61_ = panel;
		gtk_stack_set_visible_child_name (_tmp61_, "find-in-files");
		_tmp62_ = result_panel;
		gedit_find_in_files_plugin_result_panel_toggle_stop_button (_tmp62_, TRUE);
		_tmp63_ = result_panel;
		gedit_find_in_files_plugin_result_panel_grab_focus (_tmp63_);
		_g_object_unref0 (result_panel);
		_gedit_find_in_files_plugin_find_job_unref0 (job);
		_g_object_unref0 (cancellable);
		_g_object_unref0 (child);
		_g_object_unref0 (panel);
		_g_free0 (search_path);
		_g_free0 (search_text);
	}
	_tmp64_ = _data1_->dialog;
	gtk_widget_destroy ((GtkWidget*) _tmp64_);
}


static void ___lambda6__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self) {
	__lambda6_ (self, response_id);
}


static void gedit_find_in_files_plugin_window_dialog_run (GeditFindInFilesPluginWindow* self) {
	Block1Data* _data1_;
	GeditDocument* active_doc = NULL;
	GeditWindow* _tmp0_ = NULL;
	GeditWindow* _tmp1_ = NULL;
	GeditWindow* _tmp2_ = NULL;
	GeditDocument* _tmp3_ = NULL;
	GeditDocument* _tmp4_ = NULL;
	GeditDocument* _tmp5_ = NULL;
	GFile* root = NULL;
	GFile* _tmp6_ = NULL;
	GFile* _tmp7_ = NULL;
	GFile* _tmp15_ = NULL;
	GFile* _tmp18_ = NULL;
	GeditFindInFilesPluginFindDialog* _tmp19_ = NULL;
	GeditFindInFilesPluginFindDialog* _tmp20_ = NULL;
	GeditWindow* _tmp21_ = NULL;
	GeditWindow* _tmp22_ = NULL;
	GeditWindow* _tmp23_ = NULL;
	GeditFindInFilesPluginFindDialog* _tmp24_ = NULL;
	GtkTextIter start = {0};
	GtkTextIter end = {0};
	GeditDocument* _tmp25_ = NULL;
	GtkTextIter _tmp26_ = {0};
	GtkTextIter _tmp27_ = {0};
	gboolean _tmp28_ = FALSE;
	GeditFindInFilesPluginFindDialog* _tmp38_ = NULL;
	GeditFindInFilesPluginFindDialog* _tmp39_ = NULL;
	g_return_if_fail (self != NULL);
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	_data1_->self = g_object_ref (self);
	g_object_get ((GeditWindowActivatable*) self, "window", &_tmp0_, NULL);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp3_ = gedit_window_get_active_document (_tmp2_);
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_tmp5_ = _tmp4_;
	_g_object_unref0 (_tmp2_);
	active_doc = _tmp5_;
	_tmp6_ = gedit_find_in_files_plugin_window_get_file_browser_root (self);
	root = _tmp6_;
	_tmp7_ = root;
	if (_tmp7_ == NULL) {
		GFile* location = NULL;
		GeditDocument* _tmp8_ = NULL;
		GtkSourceFile* _tmp9_ = NULL;
		GFile* _tmp10_ = NULL;
		GFile* _tmp11_ = NULL;
		GFile* _tmp12_ = NULL;
		_tmp8_ = active_doc;
		_tmp9_ = gedit_document_get_file (_tmp8_);
		_tmp10_ = gtk_source_file_get_location (_tmp9_);
		_tmp11_ = _g_object_ref0 (_tmp10_);
		location = _tmp11_;
		_tmp12_ = location;
		if (_tmp12_ != NULL) {
			GFile* _tmp13_ = NULL;
			GFile* _tmp14_ = NULL;
			_tmp13_ = location;
			_tmp14_ = g_file_get_parent (_tmp13_);
			_g_object_unref0 (root);
			root = _tmp14_;
		}
		_g_object_unref0 (location);
	}
	_tmp15_ = root;
	if (_tmp15_ == NULL) {
		const gchar* _tmp16_ = NULL;
		GFile* _tmp17_ = NULL;
		_tmp16_ = g_get_home_dir ();
		_tmp17_ = g_file_new_for_path (_tmp16_);
		_g_object_unref0 (root);
		root = _tmp17_;
	}
	_tmp18_ = root;
	_tmp19_ = gedit_find_in_files_plugin_find_dialog_new (_tmp18_);
	g_object_ref_sink (_tmp19_);
	_data1_->dialog = _tmp19_;
	_tmp20_ = _data1_->dialog;
	g_object_get ((GeditWindowActivatable*) self, "window", &_tmp21_, NULL);
	_tmp22_ = _tmp21_;
	_tmp23_ = _tmp22_;
	gtk_window_set_transient_for ((GtkWindow*) _tmp20_, (GtkWindow*) _tmp23_);
	_g_object_unref0 (_tmp23_);
	_tmp24_ = _data1_->dialog;
	gtk_window_set_destroy_with_parent ((GtkWindow*) _tmp24_, TRUE);
	_tmp25_ = active_doc;
	_tmp28_ = gtk_text_buffer_get_selection_bounds ((GtkTextBuffer*) _tmp25_, &_tmp26_, &_tmp27_);
	start = _tmp26_;
	end = _tmp27_;
	if (_tmp28_) {
		gchar* selection = NULL;
		GeditDocument* _tmp29_ = NULL;
		GtkTextIter _tmp30_ = {0};
		GtkTextIter _tmp31_ = {0};
		gchar* _tmp32_ = NULL;
		GeditFindInFilesPluginFindDialog* _tmp33_ = NULL;
		GtkEntry* _tmp34_ = NULL;
		const gchar* _tmp35_ = NULL;
		gchar* _tmp36_ = NULL;
		gchar* _tmp37_ = NULL;
		_tmp29_ = active_doc;
		_tmp30_ = start;
		_tmp31_ = end;
		_tmp32_ = gtk_text_buffer_get_text ((GtkTextBuffer*) _tmp29_, &_tmp30_, &_tmp31_, TRUE);
		selection = _tmp32_;
		_tmp33_ = _data1_->dialog;
		_tmp34_ = _tmp33_->search_entry;
		_tmp35_ = selection;
		_tmp36_ = gtk_source_utils_escape_search_text (_tmp35_);
		_tmp37_ = _tmp36_;
		gtk_entry_set_text (_tmp34_, _tmp37_);
		_g_free0 (_tmp37_);
		_g_free0 (selection);
	}
	_tmp38_ = _data1_->dialog;
	g_signal_connect_data ((GtkDialog*) _tmp38_, "response", (GCallback) ___lambda6__gtk_dialog_response, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
	_tmp39_ = _data1_->dialog;
	gtk_widget_show_all ((GtkWidget*) _tmp39_);
	_g_object_unref0 (root);
	_g_object_unref0 (active_doc);
	block1_data_unref (_data1_);
	_data1_ = NULL;
}


static void _gedit_find_in_files_plugin_window_dialog_run_g_simple_action_activate (GSimpleAction* _sender, GVariant* parameter, gpointer self) {
	gedit_find_in_files_plugin_window_dialog_run ((GeditFindInFilesPluginWindow*) self);
}


static void gedit_find_in_files_plugin_window_real_activate (GeditWindowActivatable* base) {
	GeditFindInFilesPluginWindow * self;
	GSimpleAction* act = NULL;
	GSimpleAction* _tmp0_ = NULL;
	GeditWindow* _tmp1_ = NULL;
	GeditWindow* _tmp2_ = NULL;
	GeditWindow* _tmp3_ = NULL;
	self = (GeditFindInFilesPluginWindow*) base;
	_tmp0_ = g_simple_action_new ("find-in-files", NULL);
	act = _tmp0_;
	g_object_get ((GeditWindowActivatable*) self, "window", &_tmp1_, NULL);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	g_action_map_add_action ((GActionMap*) _tmp3_, (GAction*) act);
	_g_object_unref0 (_tmp3_);
	g_signal_connect_object (act, "activate", (GCallback) _gedit_find_in_files_plugin_window_dialog_run_g_simple_action_activate, self, 0);
	_g_object_unref0 (act);
}


static void gedit_find_in_files_plugin_window_real_deactivate (GeditWindowActivatable* base) {
	GeditFindInFilesPluginWindow * self;
	self = (GeditFindInFilesPluginWindow*) base;
}


static void gedit_find_in_files_plugin_window_real_update_state (GeditWindowActivatable* base) {
	GeditFindInFilesPluginWindow * self;
	self = (GeditFindInFilesPluginWindow*) base;
}


static GeditWindow* gedit_find_in_files_plugin_window_real_get_window (GeditWindowActivatable* base) {
	GeditWindow* result;
	GeditFindInFilesPluginWindow* self;
	GeditWindow* _tmp0_ = NULL;
	GeditWindow* _tmp1_ = NULL;
	self = (GeditFindInFilesPluginWindow*) base;
	_tmp0_ = self->priv->_window;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}


static void gedit_find_in_files_plugin_window_real_set_window (GeditWindowActivatable* base, GeditWindow* value) {
	GeditFindInFilesPluginWindow* self;
	GeditWindow* _tmp0_ = NULL;
	GeditWindow* _tmp1_ = NULL;
	self = (GeditFindInFilesPluginWindow*) base;
	_tmp0_ = value;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->_window);
	self->priv->_window = _tmp1_;
	g_object_notify ((GObject *) self, "window");
}


static void gedit_find_in_files_plugin_window_class_init (GeditFindInFilesPluginWindowClass * klass) {
	gedit_find_in_files_plugin_window_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GeditFindInFilesPluginWindowPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_gedit_find_in_files_plugin_window_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gedit_find_in_files_plugin_window_set_property;
	G_OBJECT_CLASS (klass)->finalize = gedit_find_in_files_plugin_window_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEDIT_FIND_IN_FILES_PLUGIN_WINDOW_WINDOW, g_param_spec_object ("window", "window", "window", gedit_window_get_type (), G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}


static void gedit_find_in_files_plugin_window_gedit_window_activatable_interface_init (GeditWindowActivatableInterface * iface) {
	gedit_find_in_files_plugin_window_gedit_window_activatable_parent_iface = g_type_interface_peek_parent (iface);
	iface->activate = (void (*)(GeditWindowActivatable*)) gedit_find_in_files_plugin_window_real_activate;
	iface->deactivate = (void (*)(GeditWindowActivatable*)) gedit_find_in_files_plugin_window_real_deactivate;
	iface->update_state = (void (*)(GeditWindowActivatable*)) gedit_find_in_files_plugin_window_real_update_state;
}


static void gedit_find_in_files_plugin_window_instance_init (GeditFindInFilesPluginWindow * self) {
	self->priv = GEDIT_FIND_IN_FILES_PLUGIN_WINDOW_GET_PRIVATE (self);
}


static void gedit_find_in_files_plugin_window_finalize (GObject* obj) {
	GeditFindInFilesPluginWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEDIT_FIND_IN_FILES_PLUGIN_TYPE_WINDOW, GeditFindInFilesPluginWindow);
	_g_object_unref0 (self->priv->_window);
	G_OBJECT_CLASS (gedit_find_in_files_plugin_window_parent_class)->finalize (obj);
}


GType gedit_find_in_files_plugin_window_get_type (void) {
	return gedit_find_in_files_plugin_window_type_id;
}


GType gedit_find_in_files_plugin_window_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (GeditFindInFilesPluginWindowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gedit_find_in_files_plugin_window_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeditFindInFilesPluginWindow), 0, (GInstanceInitFunc) gedit_find_in_files_plugin_window_instance_init, NULL };
	static const GInterfaceInfo gedit_window_activatable_info = { (GInterfaceInitFunc) gedit_find_in_files_plugin_window_gedit_window_activatable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	gedit_find_in_files_plugin_window_type_id = g_type_module_register_type (module, peas_extension_base_get_type (), "GeditFindInFilesPluginWindow", &g_define_type_info, 0);
	g_type_module_add_interface (module, gedit_find_in_files_plugin_window_type_id, gedit_window_activatable_get_type (), &gedit_window_activatable_info);
	return gedit_find_in_files_plugin_window_type_id;
}


static void _vala_gedit_find_in_files_plugin_window_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	GeditFindInFilesPluginWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEDIT_FIND_IN_FILES_PLUGIN_TYPE_WINDOW, GeditFindInFilesPluginWindow);
	switch (property_id) {
		case GEDIT_FIND_IN_FILES_PLUGIN_WINDOW_WINDOW:
		g_value_take_object (value, gedit_find_in_files_plugin_window_real_get_window ((GeditWindowActivatable*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_gedit_find_in_files_plugin_window_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	GeditFindInFilesPluginWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEDIT_FIND_IN_FILES_PLUGIN_TYPE_WINDOW, GeditFindInFilesPluginWindow);
	switch (property_id) {
		case GEDIT_FIND_IN_FILES_PLUGIN_WINDOW_WINDOW:
		gedit_find_in_files_plugin_window_real_set_window ((GeditWindowActivatable*) self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


GeditFindInFilesPluginApp* gedit_find_in_files_plugin_app_construct (GType object_type) {
	GeditFindInFilesPluginApp * self = NULL;
	self = (GeditFindInFilesPluginApp*) g_object_new (object_type, NULL);
	return self;
}


GeditFindInFilesPluginApp* gedit_find_in_files_plugin_app_new (void) {
	return gedit_find_in_files_plugin_app_construct (GEDIT_FIND_IN_FILES_PLUGIN_TYPE_APP);
}


static void gedit_find_in_files_plugin_app_real_activate (GeditAppActivatable* base) {
	GeditFindInFilesPluginApp * self;
	GeditMenuExtension* _tmp0_ = NULL;
	GMenuItem* item = NULL;
	const gchar* _tmp1_ = NULL;
	GMenuItem* _tmp2_ = NULL;
	GeditMenuExtension* _tmp3_ = NULL;
	GeditApp* _tmp4_ = NULL;
	GeditApp* _tmp5_ = NULL;
	GeditApp* _tmp6_ = NULL;
	self = (GeditFindInFilesPluginApp*) base;
	_tmp0_ = gedit_app_activatable_extend_menu ((GeditAppActivatable*) self, "search-section");
	_g_object_unref0 (self->priv->menu_ext);
	self->priv->menu_ext = _tmp0_;
	_tmp1_ = _ ("Find in Files…");
	_tmp2_ = g_menu_item_new (_tmp1_, "win.find-in-files");
	item = _tmp2_;
	_tmp3_ = self->priv->menu_ext;
	gedit_menu_extension_append_menu_item (_tmp3_, item);
	g_object_get ((GeditAppActivatable*) self, "app", &_tmp4_, NULL);
	_tmp5_ = _tmp4_;
	_tmp6_ = _tmp5_;
	gtk_application_add_accelerator ((GtkApplication*) _tmp6_, "<Shift><Ctrl>f", "win.find-in-files", NULL);
	_g_object_unref0 (_tmp6_);
	_g_object_unref0 (item);
}


static void gedit_find_in_files_plugin_app_real_deactivate (GeditAppActivatable* base) {
	GeditFindInFilesPluginApp * self;
	GeditMenuExtension* _tmp0_ = NULL;
	GeditApp* _tmp1_ = NULL;
	GeditApp* _tmp2_ = NULL;
	GeditApp* _tmp3_ = NULL;
	self = (GeditFindInFilesPluginApp*) base;
	_tmp0_ = self->priv->menu_ext;
	gedit_menu_extension_remove_items (_tmp0_);
	g_object_get ((GeditAppActivatable*) self, "app", &_tmp1_, NULL);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	gtk_application_remove_accelerator ((GtkApplication*) _tmp3_, "win.find-in-files", NULL);
	_g_object_unref0 (_tmp3_);
}


static GeditApp* gedit_find_in_files_plugin_app_real_get_app (GeditAppActivatable* base) {
	GeditApp* result;
	GeditFindInFilesPluginApp* self;
	GeditApp* _tmp0_ = NULL;
	GeditApp* _tmp1_ = NULL;
	self = (GeditFindInFilesPluginApp*) base;
	_tmp0_ = self->priv->_app;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}


static void gedit_find_in_files_plugin_app_real_set_app (GeditAppActivatable* base, GeditApp* value) {
	GeditFindInFilesPluginApp* self;
	GeditApp* _tmp0_ = NULL;
	GeditApp* _tmp1_ = NULL;
	self = (GeditFindInFilesPluginApp*) base;
	_tmp0_ = value;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->_app);
	self->priv->_app = _tmp1_;
	g_object_notify ((GObject *) self, "app");
}


static void gedit_find_in_files_plugin_app_class_init (GeditFindInFilesPluginAppClass * klass) {
	gedit_find_in_files_plugin_app_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GeditFindInFilesPluginAppPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_gedit_find_in_files_plugin_app_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gedit_find_in_files_plugin_app_set_property;
	G_OBJECT_CLASS (klass)->finalize = gedit_find_in_files_plugin_app_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEDIT_FIND_IN_FILES_PLUGIN_APP_APP, g_param_spec_object ("app", "app", "app", gedit_app_get_type (), G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}


static void gedit_find_in_files_plugin_app_gedit_app_activatable_interface_init (GeditAppActivatableInterface * iface) {
	gedit_find_in_files_plugin_app_gedit_app_activatable_parent_iface = g_type_interface_peek_parent (iface);
	iface->activate = (void (*)(GeditAppActivatable*)) gedit_find_in_files_plugin_app_real_activate;
	iface->deactivate = (void (*)(GeditAppActivatable*)) gedit_find_in_files_plugin_app_real_deactivate;
}


static void gedit_find_in_files_plugin_app_instance_init (GeditFindInFilesPluginApp * self) {
	self->priv = GEDIT_FIND_IN_FILES_PLUGIN_APP_GET_PRIVATE (self);
	self->priv->menu_ext = NULL;
}


static void gedit_find_in_files_plugin_app_finalize (GObject* obj) {
	GeditFindInFilesPluginApp * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEDIT_FIND_IN_FILES_PLUGIN_TYPE_APP, GeditFindInFilesPluginApp);
	_g_object_unref0 (self->priv->menu_ext);
	_g_object_unref0 (self->priv->_app);
	G_OBJECT_CLASS (gedit_find_in_files_plugin_app_parent_class)->finalize (obj);
}


GType gedit_find_in_files_plugin_app_get_type (void) {
	return gedit_find_in_files_plugin_app_type_id;
}


GType gedit_find_in_files_plugin_app_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (GeditFindInFilesPluginAppClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gedit_find_in_files_plugin_app_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeditFindInFilesPluginApp), 0, (GInstanceInitFunc) gedit_find_in_files_plugin_app_instance_init, NULL };
	static const GInterfaceInfo gedit_app_activatable_info = { (GInterfaceInitFunc) gedit_find_in_files_plugin_app_gedit_app_activatable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	gedit_find_in_files_plugin_app_type_id = g_type_module_register_type (module, G_TYPE_OBJECT, "GeditFindInFilesPluginApp", &g_define_type_info, 0);
	g_type_module_add_interface (module, gedit_find_in_files_plugin_app_type_id, gedit_app_activatable_get_type (), &gedit_app_activatable_info);
	return gedit_find_in_files_plugin_app_type_id;
}


static void _vala_gedit_find_in_files_plugin_app_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	GeditFindInFilesPluginApp * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEDIT_FIND_IN_FILES_PLUGIN_TYPE_APP, GeditFindInFilesPluginApp);
	switch (property_id) {
		case GEDIT_FIND_IN_FILES_PLUGIN_APP_APP:
		g_value_take_object (value, gedit_find_in_files_plugin_app_real_get_app ((GeditAppActivatable*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_gedit_find_in_files_plugin_app_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	GeditFindInFilesPluginApp * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEDIT_FIND_IN_FILES_PLUGIN_TYPE_APP, GeditFindInFilesPluginApp);
	switch (property_id) {
		case GEDIT_FIND_IN_FILES_PLUGIN_APP_APP:
		gedit_find_in_files_plugin_app_real_set_app ((GeditAppActivatable*) self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


void peas_register_types (GTypeModule* module) {
	PeasObjectModule* objmodule = NULL;
	GTypeModule* _tmp0_ = NULL;
	PeasObjectModule* _tmp1_ = NULL;
	g_return_if_fail (module != NULL);
	gedit_find_in_files_plugin_find_dialog_register_type (module);
	gedit_find_in_files_plugin_find_job_register_type (module);
	gedit_find_in_files_plugin_imatcher_register_type (module);
	gedit_find_in_files_plugin_regex_find_register_type (module);
	gedit_find_in_files_plugin_boyer_moore_horspool_register_type (module);
	gedit_find_in_files_plugin_window_register_type (module);
	gedit_find_in_files_plugin_app_register_type (module);
	gedit_find_in_files_plugin_result_panel_register_type (module);
	_tmp0_ = module;
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, peas_object_module_get_type ()) ? ((PeasObjectModule*) _tmp0_) : NULL);
	objmodule = _tmp1_;
	bindtextdomain (GETTEXT_PACKAGE, GP_LOCALEDIR);
	peas_object_module_register_extension_type (objmodule, gedit_window_activatable_get_type (), GEDIT_FIND_IN_FILES_PLUGIN_TYPE_WINDOW);
	peas_object_module_register_extension_type (objmodule, gedit_app_activatable_get_type (), GEDIT_FIND_IN_FILES_PLUGIN_TYPE_APP);
	_g_object_unref0 (objmodule);
}



