/* plugin.c generated by valac 0.40.2, 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;
enum {
GEDIT_FIND_IN_FILES_PLUGIN_WINDOW_0_PROPERTY,
GEDIT_FIND_IN_FILES_PLUGIN_WINDOW_WINDOW_PROPERTY,
GEDIT_FIND_IN_FILES_PLUGIN_WINDOW_NUM_PROPERTIES
};
static GParamSpec* gedit_find_in_files_plugin_window_properties[GEDIT_FIND_IN_FILES_PLUGIN_WINDOW_NUM_PROPERTIES];
#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;
enum {
GEDIT_FIND_IN_FILES_PLUGIN_APP_0_PROPERTY,
GEDIT_FIND_IN_FILES_PLUGIN_APP_APP_PROPERTY,
GEDIT_FIND_IN_FILES_PLUGIN_APP_NUM_PROPERTIES
};
static GParamSpec* gedit_find_in_files_plugin_app_properties[GEDIT_FIND_IN_FILES_PLUGIN_APP_NUM_PROPERTIES];
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;
#define GEDIT_FIND_IN_FILES_PLUGIN_WINDOW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEDIT_FIND_IN_FILES_PLUGIN_TYPE_WINDOW, GeditFindInFilesPluginWindowPrivate))
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;
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;
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;
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;
#define GEDIT_FIND_IN_FILES_PLUGIN_APP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEDIT_FIND_IN_FILES_PLUGIN_TYPE_APP, GeditFindInFilesPluginAppPrivate))
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);
GType gedit_find_in_files_plugin_find_dialog_register_type (GTypeModule * module);
GType gedit_find_in_files_plugin_find_job_register_type (GTypeModule * module);
GType gedit_find_in_files_plugin_imatcher_register_type (GTypeModule * module);
GType gedit_find_in_files_plugin_regex_find_register_type (GTypeModule * module);
GType gedit_find_in_files_plugin_boyer_moore_horspool_register_type (GTypeModule * module);
GType gedit_find_in_files_plugin_window_register_type (GTypeModule * module);
GType gedit_find_in_files_plugin_app_register_type (GTypeModule * module);
GType gedit_find_in_files_plugin_result_panel_register_type (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_;
GeditWindow* _tmp1_;
GeditWindow* _tmp2_;
GeditMessageBus* _tmp3_;
GeditMessageBus* _tmp4_;
GeditMessageBus* _tmp5_;
GeditMessageBus* _tmp6_;
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;
if (gedit_message_bus_is_registered (_tmp6_, "/plugins/filebrowser", "get_root")) {
GObject* msg = NULL;
GeditMessageBus* _tmp7_;
GObject* _tmp8_;
GObject* _tmp9_;
GeditMessageBus* _tmp10_;
GObject* _tmp11_;
GValue val = {0};
GValue _tmp12_ = {0};
GObject* _tmp13_;
GObject* _tmp14_;
GFile* _tmp15_;
_tmp7_ = bus;
_tmp8_ = g_object_new (gedit_message_bus_lookup (_tmp7_, "/plugins/filebrowser", "get_root"), "method", "get_root", "object_path", "/plugins/filebrowser", NULL);
_tmp9_ = G_IS_INITIALLY_UNOWNED (_tmp8_) ? g_object_ref_sink (_tmp8_) : _tmp8_;
msg = _tmp9_;
_tmp10_ = bus;
_tmp11_ = msg;
gedit_message_bus_send_message_sync (_tmp10_, G_TYPE_CHECK_INSTANCE_TYPE (_tmp11_, gedit_message_get_type ()) ? ((GeditMessage*) _tmp11_) : NULL);
g_value_init (&_tmp12_, G_TYPE_OBJECT);
val = _tmp12_;
_tmp13_ = msg;
g_object_get_property (_tmp13_, "location", &val);
_tmp14_ = g_value_dup_object (&val);
_tmp15_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp14_, g_file_get_type ()) ? ((GFile*) _tmp14_) : NULL;
if (_tmp15_ == NULL) {
_g_object_unref0 (_tmp14_);
}
result = _tmp15_;
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;
GeditFindInFilesPluginFindDialog* _tmp63_;
GError * _inner_error_ = NULL;
self = _data1_->self;
if (response_id == ((gint) GTK_RESPONSE_OK)) {
gchar* search_text = NULL;
GeditFindInFilesPluginFindDialog* _tmp0_;
GtkEntry* _tmp1_;
const gchar* _tmp2_;
const gchar* _tmp3_;
gchar* _tmp4_;
gchar* search_path = NULL;
GeditFindInFilesPluginFindDialog* _tmp5_;
GtkFileChooserButton* _tmp6_;
gchar* _tmp7_;
GtkStack* panel = NULL;
GeditWindow* _tmp8_;
GeditWindow* _tmp9_;
GeditWindow* _tmp10_;
GtkWidget* _tmp11_;
GtkStack* _tmp12_;
GtkStack* _tmp13_;
GtkWidget* child = NULL;
GtkStack* _tmp14_;
GtkWidget* _tmp15_;
GtkWidget* _tmp16_;
GtkWidget* _tmp17_;
GCancellable* cancellable = NULL;
GCancellable* _tmp19_;
GeditFindInFilesPluginFindJob* job = NULL;
GCancellable* _tmp20_;
GeditFindInFilesPluginFindJob* _tmp21_;
GeditFindInFilesPluginFindJob* _tmp22_;
GeditFindInFilesPluginFindDialog* _tmp23_;
GtkCheckButton* _tmp24_;
gboolean _tmp25_;
gboolean _tmp26_;
GeditFindInFilesPluginFindJob* _tmp27_;
GeditFindInFilesPluginFindDialog* _tmp28_;
GtkCheckButton* _tmp29_;
gboolean _tmp30_;
gboolean _tmp31_;
GeditFindInFilesPluginResultPanel* result_panel = NULL;
GeditFindInFilesPluginFindJob* _tmp46_;
const gchar* _tmp47_;
GeditWindow* _tmp48_;
GeditWindow* _tmp49_;
GeditWindow* _tmp50_;
GeditFindInFilesPluginResultPanel* _tmp51_;
GeditFindInFilesPluginResultPanel* _tmp52_;
GtkStack* _tmp53_;
GeditFindInFilesPluginResultPanel* _tmp54_;
const gchar* _tmp55_;
gchar* _tmp56_;
gchar* _tmp57_;
GeditFindInFilesPluginResultPanel* _tmp58_;
GtkStack* _tmp59_;
GtkStack* _tmp60_;
GeditFindInFilesPluginResultPanel* _tmp61_;
GeditFindInFilesPluginResultPanel* _tmp62_;
_tmp0_ = _data1_->dialog;
_tmp1_ = _tmp0_->search_entry;
_tmp2_ = gtk_entry_get_text (_tmp1_);
_tmp3_ = _tmp2_;
_tmp4_ = g_strdup (_tmp3_);
search_text = _tmp4_;
_tmp5_ = _data1_->dialog;
_tmp6_ = _tmp5_->sel_folder;
_tmp7_ = gtk_file_chooser_get_filename ((GtkFileChooser*) _tmp6_);
search_path = _tmp7_;
g_object_get ((GeditWindowActivatable*) self, "window", &_tmp8_, NULL);
_tmp9_ = _tmp8_;
_tmp10_ = _tmp9_;
_tmp11_ = gedit_window_get_bottom_panel (_tmp10_);
_tmp12_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, gtk_stack_get_type (), GtkStack));
_tmp13_ = _tmp12_;
_g_object_unref0 (_tmp10_);
panel = _tmp13_;
_tmp14_ = panel;
_tmp15_ = gtk_stack_get_child_by_name (_tmp14_, "find-in-files");
_tmp16_ = _g_object_ref0 (_tmp15_);
child = _tmp16_;
_tmp17_ = child;
if (_tmp17_ != NULL) {
GtkWidget* _tmp18_;
_tmp18_ = child;
gtk_widget_destroy (_tmp18_);
}
_tmp19_ = g_cancellable_new ();
cancellable = _tmp19_;
_tmp20_ = cancellable;
_tmp21_ = gedit_find_in_files_plugin_find_job_new (_tmp20_);
job = _tmp21_;
_tmp22_ = job;
_tmp23_ = _data1_->dialog;
_tmp24_ = _tmp23_->match_case_checkbutton;
_tmp25_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp24_);
_tmp26_ = _tmp25_;
_tmp22_->ignore_case = !_tmp26_;
_tmp27_ = job;
_tmp28_ = _data1_->dialog;
_tmp29_ = _tmp28_->entire_word_checkbutton;
_tmp30_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp29_);
_tmp31_ = _tmp30_;
_tmp27_->match_whole_word = _tmp31_;
{
GeditFindInFilesPluginFindJob* _tmp32_;
GeditFindInFilesPluginFindDialog* _tmp33_;
GtkEntry* _tmp34_;
const gchar* _tmp35_;
const gchar* _tmp36_;
GeditFindInFilesPluginFindDialog* _tmp37_;
GtkCheckButton* _tmp38_;
gboolean _tmp39_;
gboolean _tmp40_;
GeditFindInFilesPluginFindJob* _tmp41_;
const gchar* _tmp42_;
_tmp32_ = job;
_tmp33_ = _data1_->dialog;
_tmp34_ = _tmp33_->search_entry;
_tmp35_ = gtk_entry_get_text (_tmp34_);
_tmp36_ = _tmp35_;
_tmp37_ = _data1_->dialog;
_tmp38_ = _tmp37_->regex_checkbutton;
_tmp39_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp38_);
_tmp40_ = _tmp39_;
gedit_find_in_files_plugin_find_job_prepare (_tmp32_, _tmp36_, _tmp40_, &_inner_error_);
if (G_UNLIKELY (_inner_error_ != NULL)) {
goto __catch4_g_error;
}
_tmp41_ = job;
_tmp42_ = search_path;
gedit_find_in_files_plugin_find_job_execute (_tmp41_, _tmp42_, NULL, NULL);
}
goto __finally4;
__catch4_g_error:
{
GError* err = NULL;
GError* _tmp43_;
const gchar* _tmp44_;
GeditFindInFilesPluginFindDialog* _tmp45_;
err = _inner_error_;
_inner_error_ = NULL;
_tmp43_ = err;
_tmp44_ = _tmp43_->message;
g_warning ("plugin.vala:104: %s", _tmp44_);
_tmp45_ = _data1_->dialog;
gtk_widget_destroy ((GtkWidget*) _tmp45_);
_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;
}
_tmp46_ = job;
_tmp47_ = search_path;
g_object_get ((GeditWindowActivatable*) self, "window", &_tmp48_, NULL);
_tmp49_ = _tmp48_;
_tmp50_ = _tmp49_;
_tmp51_ = gedit_find_in_files_plugin_result_panel_new_for_job (_tmp46_, _tmp47_, _tmp50_);
g_object_ref_sink (_tmp51_);
_tmp52_ = _tmp51_;
_g_object_unref0 (_tmp50_);
result_panel = _tmp52_;
_tmp53_ = panel;
_tmp54_ = result_panel;
_tmp55_ = search_text;
_tmp56_ = g_strdup_printf ("\"%s\"", _tmp55_);
_tmp57_ = _tmp56_;
gtk_stack_add_titled (_tmp53_, (GtkWidget*) _tmp54_, "find-in-files", _tmp57_);
_g_free0 (_tmp57_);
_tmp58_ = result_panel;
gtk_widget_show_all ((GtkWidget*) _tmp58_);
_tmp59_ = panel;
gtk_widget_set_visible ((GtkWidget*) _tmp59_, TRUE);
_tmp60_ = panel;
gtk_stack_set_visible_child_name (_tmp60_, "find-in-files");
_tmp61_ = result_panel;
gedit_find_in_files_plugin_result_panel_toggle_stop_button (_tmp61_, TRUE);
_tmp62_ = result_panel;
gedit_find_in_files_plugin_result_panel_grab_focus (_tmp62_);
_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);
}
_tmp63_ = _data1_->dialog;
gtk_widget_destroy ((GtkWidget*) _tmp63_);
}
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_;
GeditWindow* _tmp1_;
GeditWindow* _tmp2_;
GeditDocument* _tmp3_;
GeditDocument* _tmp4_;
GeditDocument* _tmp5_;
GFile* root = NULL;
GFile* _tmp6_;
GFile* _tmp7_;
GFile* _tmp15_;
GFile* _tmp18_;
GeditFindInFilesPluginFindDialog* _tmp19_;
GeditFindInFilesPluginFindDialog* _tmp20_;
GeditWindow* _tmp21_;
GeditWindow* _tmp22_;
GeditWindow* _tmp23_;
GeditFindInFilesPluginFindDialog* _tmp24_;
GtkTextIter start = {0};
GtkTextIter end = {0};
GeditDocument* _tmp25_;
GtkTextIter _tmp26_ = {0};
GtkTextIter _tmp27_ = {0};
gboolean _tmp28_;
GeditFindInFilesPluginFindDialog* _tmp38_;
GeditFindInFilesPluginFindDialog* _tmp39_;
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_;
GtkSourceFile* _tmp9_;
GFile* _tmp10_;
GFile* _tmp11_;
GFile* _tmp12_;
_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_;
GFile* _tmp14_;
_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_;
GFile* _tmp17_;
_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_;
GtkTextIter _tmp30_;
GtkTextIter _tmp31_;
gchar* _tmp32_;
GeditFindInFilesPluginFindDialog* _tmp33_;
GtkEntry* _tmp34_;
const gchar* _tmp35_;
gchar* _tmp36_;
gchar* _tmp37_;
_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_;
GeditWindow* _tmp1_;
GeditWindow* _tmp2_;
GeditWindow* _tmp3_;
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_;
GeditWindow* _tmp1_;
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;
self = (GeditFindInFilesPluginWindow*) base;
if (gedit_find_in_files_plugin_window_real_get_window (base) != value) {
GeditWindow* _tmp0_;
_tmp0_ = _g_object_ref0 (value);
_g_object_unref0 (self->priv->_window);
self->priv->_window = _tmp0_;
g_object_notify_by_pspec ((GObject *) self, gedit_find_in_files_plugin_window_properties[GEDIT_FIND_IN_FILES_PLUGIN_WINDOW_WINDOW_PROPERTY]);
}
}
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_PROPERTY, gedit_find_in_files_plugin_window_properties[GEDIT_FIND_IN_FILES_PLUGIN_WINDOW_WINDOW_PROPERTY] = g_param_spec_object ("window", "window", "window", gedit_window_get_type (), G_PARAM_STATIC_STRINGS | 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_PROPERTY:
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_PROPERTY:
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_;
GMenuItem* item = NULL;
GMenuItem* _tmp1_;
GeditMenuExtension* _tmp2_;
static const gchar* accels[1] = {"<Shift><Ctrl>f"};
GeditApp* _tmp3_;
GeditApp* _tmp4_;
GeditApp* _tmp5_;
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_ = g_menu_item_new (_ ("Find in Files…"), "win.find-in-files");
item = _tmp1_;
_tmp2_ = self->priv->menu_ext;
gedit_menu_extension_append_menu_item (_tmp2_, item);
g_object_get ((GeditAppActivatable*) self, "app", &_tmp3_, NULL);
_tmp4_ = _tmp3_;
_tmp5_ = _tmp4_;
gtk_application_set_accels_for_action ((GtkApplication*) _tmp5_, "win.find-in-files", accels);
_g_object_unref0 (_tmp5_);
_g_object_unref0 (item);
}
static void
gedit_find_in_files_plugin_app_real_deactivate (GeditAppActivatable* base)
{
GeditFindInFilesPluginApp * self;
GeditMenuExtension* _tmp0_;
static const gchar* accels[0] = {};
GeditApp* _tmp1_;
GeditApp* _tmp2_;
GeditApp* _tmp3_;
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_set_accels_for_action ((GtkApplication*) _tmp3_, "win.find-in-files", accels);
_g_object_unref0 (_tmp3_);
}
static GeditApp*
gedit_find_in_files_plugin_app_real_get_app (GeditAppActivatable* base)
{
GeditApp* result;
GeditFindInFilesPluginApp* self;
GeditApp* _tmp0_;
GeditApp* _tmp1_;
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;
self = (GeditFindInFilesPluginApp*) base;
if (gedit_find_in_files_plugin_app_real_get_app (base) != value) {
GeditApp* _tmp0_;
_tmp0_ = _g_object_ref0 (value);
_g_object_unref0 (self->priv->_app);
self->priv->_app = _tmp0_;
g_object_notify_by_pspec ((GObject *) self, gedit_find_in_files_plugin_app_properties[GEDIT_FIND_IN_FILES_PLUGIN_APP_APP_PROPERTY]);
}
}
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_PROPERTY, gedit_find_in_files_plugin_app_properties[GEDIT_FIND_IN_FILES_PLUGIN_APP_APP_PROPERTY] = g_param_spec_object ("app", "app", "app", gedit_app_get_type (), G_PARAM_STATIC_STRINGS | 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_PROPERTY:
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_PROPERTY:
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;
PeasObjectModule* _tmp0_;
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_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (module, peas_object_module_get_type ()) ? ((PeasObjectModule*) module) : NULL);
objmodule = _tmp0_;
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);
}