diff options
author | Perberos <[email protected]> | 2011-11-07 19:52:18 -0300 |
---|---|---|
committer | Perberos <[email protected]> | 2011-11-07 19:52:18 -0300 |
commit | 5ded9cba8563f336939400303d6a841d5089b107 (patch) | |
tree | c5676588cff26ba37e12369fe4de24b54e9f6682 /plugins | |
parent | f00b3a11a199f9f85a4d46a600f9d14179b37dbf (diff) | |
download | pluma-5ded9cba8563f336939400303d6a841d5089b107.tar.bz2 pluma-5ded9cba8563f336939400303d6a841d5089b107.tar.xz |
renaming from gedit to pluma
Diffstat (limited to 'plugins')
162 files changed, 4480 insertions, 4480 deletions
diff --git a/plugins/changecase/Makefile.am b/plugins/changecase/Makefile.am index 1f165f9e..3886dc86 100755 --- a/plugins/changecase/Makefile.am +++ b/plugins/changecase/Makefile.am @@ -1,29 +1,29 @@ # changecase plugin -plugindir = $(GEDIT_PLUGINS_LIBS_DIR) +plugindir = $(PLUMA_PLUGINS_LIBS_DIR) INCLUDES = \ -I$(top_srcdir) \ - $(GEDIT_CFLAGS) \ + $(PLUMA_CFLAGS) \ $(WARN_CFLAGS) \ $(DISABLE_DEPRECATED_CFLAGS) plugin_LTLIBRARIES = libchangecase.la libchangecase_la_SOURCES = \ - gedit-changecase-plugin.h \ - gedit-changecase-plugin.c + pluma-changecase-plugin.h \ + pluma-changecase-plugin.c libchangecase_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS) -libchangecase_la_LIBADD = $(GEDIT_LIBS) +libchangecase_la_LIBADD = $(PLUMA_LIBS) -uidir = $(GEDIT_PLUGINS_DATA_DIR)/changecase +uidir = $(PLUMA_PLUGINS_DATA_DIR)/changecase ui_DATA = -plugin_in_files = changecase.gedit-plugin.desktop.in +plugin_in_files = changecase.pluma-plugin.desktop.in -%.gedit-plugin: %.gedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache +%.pluma-plugin: %.pluma-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache -plugin_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin) +plugin_DATA = $(plugin_in_files:.pluma-plugin.desktop.in=.pluma-plugin) EXTRA_DIST = $(ui_DATA) $(plugin_in_files) diff --git a/plugins/changecase/changecase.gedit-plugin.desktop.in b/plugins/changecase/changecase.pluma-plugin.desktop.in index 52a226f4..d049a9c1 100755 --- a/plugins/changecase/changecase.gedit-plugin.desktop.in +++ b/plugins/changecase/changecase.pluma-plugin.desktop.in @@ -1,8 +1,8 @@ -[Gedit Plugin] +[Pluma Plugin] Module=changecase IAge=2 _Name=Change Case _Description=Changes the case of selected text. Authors=Paolo Borelli <[email protected]> Copyright=Copyright © 2004-2005 Paolo Borelli -Website=http://www.gedit.org +Website=http://www.pluma.org diff --git a/plugins/changecase/gedit-changecase-plugin.h b/plugins/changecase/gedit-changecase-plugin.h deleted file mode 100755 index 9587928c..00000000 --- a/plugins/changecase/gedit-changecase-plugin.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * gedit-changecase-plugin.h - * - * Copyright (C) 2004-2005 - Paolo Borelli - * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - */ - -#ifndef __GEDIT_CHANGECASE_PLUGIN_H__ -#define __GEDIT_CHANGECASE_PLUGIN_H__ - -#include <glib.h> -#include <glib-object.h> -#include <gedit/gedit-plugin.h> - -G_BEGIN_DECLS - -/* - * Type checking and casting macros - */ -#define GEDIT_TYPE_CHANGECASE_PLUGIN (gedit_changecase_plugin_get_type ()) -#define GEDIT_CHANGECASE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GEDIT_TYPE_CHANGECASE_PLUGIN, GeditChangecasePlugin)) -#define GEDIT_CHANGECASE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GEDIT_TYPE_CHANGECASE_PLUGIN, GeditChangecasePluginClass)) -#define GEDIT_IS_CHANGECASE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GEDIT_TYPE_CHANGECASE_PLUGIN)) -#define GEDIT_IS_CHANGECASE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GEDIT_TYPE_CHANGECASE_PLUGIN)) -#define GEDIT_CHANGECASE_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GEDIT_TYPE_CHANGECASE_PLUGIN, GeditChangecasePluginClass)) - -/* - * Main object structure - */ -typedef struct _GeditChangecasePlugin GeditChangecasePlugin; - -struct _GeditChangecasePlugin -{ - GeditPlugin parent_instance; -}; - -/* - * Class definition - */ -typedef struct _GeditChangecasePluginClass GeditChangecasePluginClass; - -struct _GeditChangecasePluginClass -{ - GeditPluginClass parent_class; -}; - -/* - * Public methods - */ -GType gedit_changecase_plugin_get_type (void) G_GNUC_CONST; - -/* All the plugins must implement this function */ -G_MODULE_EXPORT GType register_gedit_plugin (GTypeModule *module); - -G_END_DECLS - -#endif /* __GEDIT_CHANGECASE_PLUGIN_H__ */ diff --git a/plugins/changecase/gedit-changecase-plugin.c b/plugins/changecase/pluma-changecase-plugin.c index 8544aeb0..735a6be1 100755 --- a/plugins/changecase/gedit-changecase-plugin.c +++ b/plugins/changecase/pluma-changecase-plugin.c @@ -1,5 +1,5 @@ /* - * gedit-changecase-plugin.c + * pluma-changecase-plugin.c * * Copyright (C) 2004-2005 - Paolo Borelli * @@ -24,16 +24,16 @@ #include <config.h> #endif -#include "gedit-changecase-plugin.h" +#include "pluma-changecase-plugin.h" #include <glib/gi18n-lib.h> #include <gmodule.h> -#include <gedit/gedit-debug.h> +#include <pluma/pluma-debug.h> -#define WINDOW_DATA_KEY "GeditChangecasePluginWindowData" +#define WINDOW_DATA_KEY "PlumaChangecasePluginWindowData" -GEDIT_PLUGIN_REGISTER_TYPE(GeditChangecasePlugin, gedit_changecase_plugin) +PLUMA_PLUGIN_REGISTER_TYPE(PlumaChangecasePlugin, pluma_changecase_plugin) typedef enum { TO_UPPER_CASE, @@ -149,15 +149,15 @@ do_title_case (GtkTextBuffer *buffer, } static void -change_case (GeditWindow *window, +change_case (PlumaWindow *window, ChangeCaseChoice choice) { - GeditDocument *doc; + PlumaDocument *doc; GtkTextIter start, end; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); - doc = gedit_window_get_active_document (window); + doc = pluma_window_get_active_document (window); g_return_if_fail (doc != NULL); if (!gtk_text_buffer_get_selection_bounds (GTK_TEXT_BUFFER (doc), @@ -191,28 +191,28 @@ change_case (GeditWindow *window, static void upper_case_cb (GtkAction *action, - GeditWindow *window) + PlumaWindow *window) { change_case (window, TO_UPPER_CASE); } static void lower_case_cb (GtkAction *action, - GeditWindow *window) + PlumaWindow *window) { change_case (window, TO_LOWER_CASE); } static void invert_case_cb (GtkAction *action, - GeditWindow *window) + PlumaWindow *window) { change_case (window, INVERT_CASE); } static void title_case_cb (GtkAction *action, - GeditWindow *window) + PlumaWindow *window) { change_case (window, TO_TITLE_CASE); } @@ -251,17 +251,17 @@ const gchar submenu[] = "</ui>"; static void -gedit_changecase_plugin_init (GeditChangecasePlugin *plugin) +pluma_changecase_plugin_init (PlumaChangecasePlugin *plugin) { - gedit_debug_message (DEBUG_PLUGINS, "GeditChangecasePlugin initializing"); + pluma_debug_message (DEBUG_PLUGINS, "PlumaChangecasePlugin initializing"); } static void -gedit_changecase_plugin_finalize (GObject *object) +pluma_changecase_plugin_finalize (GObject *object) { - G_OBJECT_CLASS (gedit_changecase_plugin_parent_class)->finalize (object); + G_OBJECT_CLASS (pluma_changecase_plugin_parent_class)->finalize (object); - gedit_debug_message (DEBUG_PLUGINS, "GeditChangecasePlugin finalizing"); + pluma_debug_message (DEBUG_PLUGINS, "PlumaChangecasePlugin finalizing"); } typedef struct @@ -279,16 +279,16 @@ free_window_data (WindowData *data) } static void -update_ui_real (GeditWindow *window, +update_ui_real (PlumaWindow *window, WindowData *data) { GtkTextView *view; GtkAction *action; gboolean sensitive = FALSE; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); - view = GTK_TEXT_VIEW (gedit_window_get_active_view (window)); + view = GTK_TEXT_VIEW (pluma_window_get_active_view (window)); if (view != NULL) { @@ -305,20 +305,20 @@ update_ui_real (GeditWindow *window, } static void -impl_activate (GeditPlugin *plugin, - GeditWindow *window) +impl_activate (PlumaPlugin *plugin, + PlumaWindow *window) { GtkUIManager *manager; WindowData *data; GError *error = NULL; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); data = g_slice_new (WindowData); - manager = gedit_window_get_ui_manager (window); + manager = pluma_window_get_ui_manager (window); - data->action_group = gtk_action_group_new ("GeditChangecasePluginActions"); + data->action_group = gtk_action_group_new ("PlumaChangecasePluginActions"); gtk_action_group_set_translation_domain (data->action_group, GETTEXT_PACKAGE); gtk_action_group_add_actions (data->action_group, @@ -348,15 +348,15 @@ impl_activate (GeditPlugin *plugin, } static void -impl_deactivate (GeditPlugin *plugin, - GeditWindow *window) +impl_deactivate (PlumaPlugin *plugin, + PlumaWindow *window) { GtkUIManager *manager; WindowData *data; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); - manager = gedit_window_get_ui_manager (window); + manager = pluma_window_get_ui_manager (window); data = (WindowData *) g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY); g_return_if_fail (data != NULL); @@ -368,12 +368,12 @@ impl_deactivate (GeditPlugin *plugin, } static void -impl_update_ui (GeditPlugin *plugin, - GeditWindow *window) +impl_update_ui (PlumaPlugin *plugin, + PlumaWindow *window) { WindowData *data; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); data = (WindowData *) g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY); g_return_if_fail (data != NULL); @@ -382,12 +382,12 @@ impl_update_ui (GeditPlugin *plugin, } static void -gedit_changecase_plugin_class_init (GeditChangecasePluginClass *klass) +pluma_changecase_plugin_class_init (PlumaChangecasePluginClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - GeditPluginClass *plugin_class = GEDIT_PLUGIN_CLASS (klass); + PlumaPluginClass *plugin_class = PLUMA_PLUGIN_CLASS (klass); - object_class->finalize = gedit_changecase_plugin_finalize; + object_class->finalize = pluma_changecase_plugin_finalize; plugin_class->activate = impl_activate; plugin_class->deactivate = impl_deactivate; diff --git a/plugins/changecase/pluma-changecase-plugin.h b/plugins/changecase/pluma-changecase-plugin.h new file mode 100755 index 00000000..56604352 --- /dev/null +++ b/plugins/changecase/pluma-changecase-plugin.h @@ -0,0 +1,72 @@ +/* + * pluma-changecase-plugin.h + * + * Copyright (C) 2004-2005 - Paolo Borelli + * + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ + */ + +#ifndef __PLUMA_CHANGECASE_PLUGIN_H__ +#define __PLUMA_CHANGECASE_PLUGIN_H__ + +#include <glib.h> +#include <glib-object.h> +#include <pluma/pluma-plugin.h> + +G_BEGIN_DECLS + +/* + * Type checking and casting macros + */ +#define PLUMA_TYPE_CHANGECASE_PLUGIN (pluma_changecase_plugin_get_type ()) +#define PLUMA_CHANGECASE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PLUMA_TYPE_CHANGECASE_PLUGIN, PlumaChangecasePlugin)) +#define PLUMA_CHANGECASE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PLUMA_TYPE_CHANGECASE_PLUGIN, PlumaChangecasePluginClass)) +#define PLUMA_IS_CHANGECASE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PLUMA_TYPE_CHANGECASE_PLUGIN)) +#define PLUMA_IS_CHANGECASE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PLUMA_TYPE_CHANGECASE_PLUGIN)) +#define PLUMA_CHANGECASE_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), PLUMA_TYPE_CHANGECASE_PLUGIN, PlumaChangecasePluginClass)) + +/* + * Main object structure + */ +typedef struct _PlumaChangecasePlugin PlumaChangecasePlugin; + +struct _PlumaChangecasePlugin +{ + PlumaPlugin parent_instance; +}; + +/* + * Class definition + */ +typedef struct _PlumaChangecasePluginClass PlumaChangecasePluginClass; + +struct _PlumaChangecasePluginClass +{ + PlumaPluginClass parent_class; +}; + +/* + * Public methods + */ +GType pluma_changecase_plugin_get_type (void) G_GNUC_CONST; + +/* All the plugins must implement this function */ +G_MODULE_EXPORT GType register_pluma_plugin (GTypeModule *module); + +G_END_DECLS + +#endif /* __PLUMA_CHANGECASE_PLUGIN_H__ */ diff --git a/plugins/checkupdate/Makefile.am b/plugins/checkupdate/Makefile.am index 551b7eee..a49666ca 100755 --- a/plugins/checkupdate/Makefile.am +++ b/plugins/checkupdate/Makefile.am @@ -1,10 +1,10 @@ -# gedit win32 updater +# pluma win32 updater -plugindir = $(GEDIT_PLUGINS_LIBS_DIR) +plugindir = $(PLUMA_PLUGINS_LIBS_DIR) INCLUDES = \ -I$(top_srcdir) \ - $(GEDIT_CFLAGS) \ + $(PLUMA_CFLAGS) \ $(LIBSOUP_CFLAGS) \ $(WARN_CFLAGS) \ $(DISABLE_DEPRECATED_CFLAGS) @@ -12,20 +12,20 @@ INCLUDES = \ plugin_LTLIBRARIES = libcheckupdate.la libcheckupdate_la_SOURCES = \ - gedit-check-update-plugin.h \ - gedit-check-update-plugin.c + pluma-check-update-plugin.h \ + pluma-check-update-plugin.c libcheckupdate_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS) -libcheckupdate_la_LIBADD = $(GEDIT_LIBS) $(LIBSOUP_LIBS) +libcheckupdate_la_LIBADD = $(PLUMA_LIBS) $(LIBSOUP_LIBS) -plugin_in_files = checkupdate.gedit-plugin.desktop.in +plugin_in_files = checkupdate.pluma-plugin.desktop.in -%.gedit-plugin: %.gedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache +%.pluma-plugin: %.pluma-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache -plugin_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin) +plugin_DATA = $(plugin_in_files:.pluma-plugin.desktop.in=.pluma-plugin) schemasdir = $(MATECONF_SCHEMA_FILE_DIR) -schemas_in_files = gedit-check-update.schemas.in +schemas_in_files = pluma-check-update.schemas.in schemas_DATA = $(schemas_in_files:.schemas.in=.schemas) @INTLTOOL_SCHEMAS_RULE@ diff --git a/plugins/checkupdate/checkupdate.gedit-plugin.desktop.in b/plugins/checkupdate/checkupdate.pluma-plugin.desktop.in index 4699b6a2..9373ee47 100755 --- a/plugins/checkupdate/checkupdate.gedit-plugin.desktop.in +++ b/plugins/checkupdate/checkupdate.pluma-plugin.desktop.in @@ -1,9 +1,9 @@ -[Gedit Plugin] +[Pluma Plugin] Module=checkupdate IAge=2 _Name=Check update -_Description=Check for latest version of gedit -Icon=gedit-plugin +_Description=Check for latest version of pluma +Icon=pluma-plugin Authors=Ignacio Casal Quinteiro <[email protected]> Copyright=Copyright © 2009 Ignacio Casal Quinteiro -Website=http://www.gedit.org +Website=http://www.pluma.org diff --git a/plugins/checkupdate/gedit-check-update-plugin.h b/plugins/checkupdate/gedit-check-update-plugin.h deleted file mode 100755 index 68dc7f97..00000000 --- a/plugins/checkupdate/gedit-check-update-plugin.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2009 - Ignacio Casal Quinteiro <[email protected]> - * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef __GEDIT_CHECK_UPDATE_PLUGIN_H__ -#define __GEDIT_CHECK_UPDATE_PLUGIN_H__ - -#include <glib.h> -#include <glib-object.h> -#include <gedit/gedit-plugin.h> - -G_BEGIN_DECLS - -/* - * Type checking and casting macros - */ -#define GEDIT_TYPE_CHECK_UPDATE_PLUGIN (gedit_check_update_plugin_get_type ()) -#define GEDIT_CHECK_UPDATE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GEDIT_TYPE_CHECK_UPDATE_PLUGIN, GeditCheckUpdatePlugin)) -#define GEDIT_CHECK_UPDATE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GEDIT_TYPE_CHECK_UPDATE_PLUGIN, GeditCheckUpdatePluginClass)) -#define IS_GEDIT_CHECK_UPDATE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GEDIT_TYPE_CHECK_UPDATE_PLUGIN)) -#define IS_GEDIT_CHECK_UPDATE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GEDIT_TYPE_CHECK_UPDATE_PLUGIN)) -#define GEDIT_CHECK_UPDATE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GEDIT_TYPE_CHECK_UPDATE_PLUGIN, GeditCheckUpdatePluginClass)) - -/* Private structure type */ -typedef struct _GeditCheckUpdatePluginPrivate GeditCheckUpdatePluginPrivate; - -/* - * Main object structure - */ -typedef struct _GeditCheckUpdatePlugin GeditCheckUpdatePlugin; - -struct _GeditCheckUpdatePlugin -{ - GeditPlugin parent_instance; - - /*< private >*/ - GeditCheckUpdatePluginPrivate *priv; -}; - -/* - * Class definition - */ -typedef struct _GeditCheckUpdatePluginClass GeditCheckUpdatePluginClass; - -struct _GeditCheckUpdatePluginClass -{ - GeditPluginClass parent_class; -}; - -/* - * Public methods - */ -GType gedit_check_update_plugin_get_type (void) G_GNUC_CONST; - -/* All the plugins must implement this function */ -G_MODULE_EXPORT GType register_gedit_plugin (GTypeModule *module); - -G_END_DECLS - -#endif /* __GEDIT_CHECK_UPDATE_PLUGIN_H__ */ diff --git a/plugins/checkupdate/gedit-check-update-plugin.c b/plugins/checkupdate/pluma-check-update-plugin.c index aa9f7a5e..bf30181c 100755 --- a/plugins/checkupdate/gedit-check-update-plugin.c +++ b/plugins/checkupdate/pluma-check-update-plugin.c @@ -20,11 +20,11 @@ #include <config.h> #endif -#include "gedit-check-update-plugin.h" +#include "pluma-check-update-plugin.h" #include <glib/gi18n-lib.h> -#include <gedit/gedit-debug.h> -#include <gedit/gedit-utils.h> +#include <pluma/pluma-debug.h> +#include <pluma/pluma-utils.h> #include <libsoup/soup.h> #include <gtk/gtk.h> #include <stdlib.h> @@ -32,36 +32,36 @@ #include <mateconf/mateconf-client.h> #if !GTK_CHECK_VERSION(2, 17, 1) -#include <gedit/gedit-message-area.h> +#include <pluma/pluma-message-area.h> #endif -#define MATECONF_KEY_BASE "/apps/gedit-2/plugins/checkupdate" +#define MATECONF_KEY_BASE "/apps/pluma-2/plugins/checkupdate" #define MATECONF_KEY_IGNORE_VERSION MATECONF_KEY_BASE "/ignore_version" -#define WINDOW_DATA_KEY "GeditCheckUpdatePluginWindowData" +#define WINDOW_DATA_KEY "PlumaCheckUpdatePluginWindowData" #define VERSION_PLACE "<a href=\"[0-9]\\.[0-9]+/\">" #ifdef G_OS_WIN32 -#define GEDIT_URL "http://ftp.acc.umu.se/pub/mate/binaries/win32/gedit/" -#define FILE_REGEX "gedit\\-setup\\-[0-9]+\\.[0-9]+\\.[0-9]+(\\-[0-9]+)?\\.exe" +#define PLUMA_URL "http://ftp.acc.umu.se/pub/mate/binaries/win32/pluma/" +#define FILE_REGEX "pluma\\-setup\\-[0-9]+\\.[0-9]+\\.[0-9]+(\\-[0-9]+)?\\.exe" #else -#define GEDIT_URL "http://ftp.acc.umu.se/pub/mate/binaries/mac/gedit/" -#define FILE_REGEX "gedit\\-[0-9]+\\.[0-9]+\\.[0-9]+(\\-[0-9]+)?\\.dmg" +#define PLUMA_URL "http://ftp.acc.umu.se/pub/mate/binaries/mac/pluma/" +#define FILE_REGEX "pluma\\-[0-9]+\\.[0-9]+\\.[0-9]+(\\-[0-9]+)?\\.dmg" #endif #ifdef OS_OSX -#include "gedit/osx/gedit-osx.h" +#include "pluma/osx/pluma-osx.h" #endif -#define GEDIT_CHECK_UPDATE_PLUGIN_GET_PRIVATE(object) \ +#define PLUMA_CHECK_UPDATE_PLUGIN_GET_PRIVATE(object) \ (G_TYPE_INSTANCE_GET_PRIVATE ((object), \ - GEDIT_TYPE_CHECK_UPDATE_PLUGIN, \ - GeditCheckUpdatePluginPrivate)) + PLUMA_TYPE_CHECK_UPDATE_PLUGIN, \ + PlumaCheckUpdatePluginPrivate)) -GEDIT_PLUGIN_REGISTER_TYPE (GeditCheckUpdatePlugin, gedit_check_update_plugin) +PLUMA_PLUGIN_REGISTER_TYPE (PlumaCheckUpdatePlugin, pluma_check_update_plugin) -struct _GeditCheckUpdatePluginPrivate +struct _PlumaCheckUpdatePluginPrivate { SoupSession *session; @@ -70,7 +70,7 @@ struct _GeditCheckUpdatePluginPrivate typedef struct { - GeditCheckUpdatePlugin *plugin; + PlumaCheckUpdatePlugin *plugin; gchar *url; gchar *version; @@ -92,12 +92,12 @@ free_window_data (gpointer data) } static void -gedit_check_update_plugin_init (GeditCheckUpdatePlugin *plugin) +pluma_check_update_plugin_init (PlumaCheckUpdatePlugin *plugin) { - plugin->priv = GEDIT_CHECK_UPDATE_PLUGIN_GET_PRIVATE (plugin); + plugin->priv = PLUMA_CHECK_UPDATE_PLUGIN_GET_PRIVATE (plugin); - gedit_debug_message (DEBUG_PLUGINS, - "GeditCheckUpdatePlugin initializing"); + pluma_debug_message (DEBUG_PLUGINS, + "PlumaCheckUpdatePlugin initializing"); plugin->priv->session = soup_session_async_new (); @@ -110,9 +110,9 @@ gedit_check_update_plugin_init (GeditCheckUpdatePlugin *plugin) } static void -gedit_check_update_plugin_dispose (GObject *object) +pluma_check_update_plugin_dispose (GObject *object) { - GeditCheckUpdatePlugin *plugin = GEDIT_CHECK_UPDATE_PLUGIN (object); + PlumaCheckUpdatePlugin *plugin = PLUMA_CHECK_UPDATE_PLUGIN (object); if (plugin->priv->session != NULL) { @@ -129,19 +129,19 @@ gedit_check_update_plugin_dispose (GObject *object) plugin->priv->mateconf_client = NULL; } - gedit_debug_message (DEBUG_PLUGINS, - "GeditCheckUpdatePlugin disposing"); + pluma_debug_message (DEBUG_PLUGINS, + "PlumaCheckUpdatePlugin disposing"); - G_OBJECT_CLASS (gedit_check_update_plugin_parent_class)->dispose (object); + G_OBJECT_CLASS (pluma_check_update_plugin_parent_class)->dispose (object); } static void -gedit_check_update_plugin_finalize (GObject *object) +pluma_check_update_plugin_finalize (GObject *object) { - gedit_debug_message (DEBUG_PLUGINS, - "GeditCheckUpdatePlugin finalizing"); + pluma_debug_message (DEBUG_PLUGINS, + "PlumaCheckUpdatePlugin finalizing"); - G_OBJECT_CLASS (gedit_check_update_plugin_parent_class)->finalize (object); + G_OBJECT_CLASS (pluma_check_update_plugin_parent_class)->finalize (object); } static void @@ -149,7 +149,7 @@ set_contents (GtkWidget *infobar, GtkWidget *contents) { #if !GTK_CHECK_VERSION (2, 17, 1) - gedit_message_area_set_contents (GEDIT_MESSAGE_AREA (infobar), + pluma_message_area_set_contents (PLUMA_MESSAGE_AREA (infobar), contents); #else GtkWidget *content_area; @@ -217,7 +217,7 @@ set_message_area_text_and_icon (GtkWidget *message_area, static void on_response_cb (GtkWidget *infobar, gint response_id, - GeditWindow *window) + PlumaWindow *window) { if (response_id == GTK_RESPONSE_YES) { @@ -228,7 +228,7 @@ on_response_cb (GtkWidget *infobar, WINDOW_DATA_KEY); #ifdef OS_OSX - gedit_osx_show_url (data->url); + pluma_osx_show_url (data->url); #else gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (window)), data->url, @@ -280,24 +280,24 @@ on_response_cb (GtkWidget *infobar, } static GtkWidget * -create_infobar (GeditWindow *window, +create_infobar (PlumaWindow *window, const gchar *version) { GtkWidget *infobar; gchar *message; #if !GTK_CHECK_VERSION (2, 17, 1) - infobar = gedit_message_area_new (); + infobar = pluma_message_area_new (); - gedit_message_area_add_stock_button_with_text (GEDIT_MESSAGE_AREA (infobar), + pluma_message_area_add_stock_button_with_text (PLUMA_MESSAGE_AREA (infobar), _("_Download"), GTK_STOCK_SAVE, GTK_RESPONSE_YES); - gedit_message_area_add_stock_button_with_text (GEDIT_MESSAGE_AREA (infobar), + pluma_message_area_add_stock_button_with_text (PLUMA_MESSAGE_AREA (infobar), _("_Ignore Version"), GTK_STOCK_DISCARD, GTK_RESPONSE_NO); - gedit_message_area_add_button (GEDIT_MESSAGE_AREA (infobar), + pluma_message_area_add_button (PLUMA_MESSAGE_AREA (infobar), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); #else @@ -305,7 +305,7 @@ create_infobar (GeditWindow *window, infobar = gtk_info_bar_new (); - button = gedit_gtk_button_new_with_stock_icon (_("_Download"), + button = pluma_gtk_button_new_with_stock_icon (_("_Download"), GTK_STOCK_SAVE); gtk_widget_show (button); @@ -313,7 +313,7 @@ create_infobar (GeditWindow *window, button, GTK_RESPONSE_YES); - button = gedit_gtk_button_new_with_stock_icon (_("_Ignore Version"), + button = pluma_gtk_button_new_with_stock_icon (_("_Ignore Version"), GTK_STOCK_DISCARD); gtk_widget_show (button); @@ -329,11 +329,11 @@ create_infobar (GeditWindow *window, GTK_MESSAGE_INFO); #endif - message = g_strdup_printf ("%s (%s)", _("There is a new version of gedit"), version); + message = g_strdup_printf ("%s (%s)", _("There is a new version of pluma"), version); set_message_area_text_and_icon (infobar, "gtk-dialog-info", message, - _("You can download the new version of gedit" + _("You can download the new version of pluma" " by clicking on the download button or" " ignore that version and wait for a new one")); @@ -465,7 +465,7 @@ parse_file_version (const gchar *file) } static gchar * -get_ignore_version (GeditCheckUpdatePlugin *plugin) +get_ignore_version (PlumaCheckUpdatePlugin *plugin) { return mateconf_client_get_string (plugin->priv->mateconf_client, MATECONF_KEY_IGNORE_VERSION, @@ -475,7 +475,7 @@ get_ignore_version (GeditCheckUpdatePlugin *plugin) static void parse_page_file (SoupSession *session, SoupMessage *msg, - GeditWindow *window) + PlumaWindow *window) { if (msg->status_code == SOUP_STATUS_OK) { @@ -585,7 +585,7 @@ get_file_page_version (const gchar *text, g_match_info_free (match_info); g_regex_unref (regex); - if ((GEDIT_MINOR_VERSION % 2) == 0) + if ((PLUMA_MINOR_VERSION % 2) == 0) { g_free (unstable); @@ -612,7 +612,7 @@ get_file_page_version (const gchar *text, static void parse_page_version (SoupSession *session, SoupMessage *msg, - GeditWindow *window) + PlumaWindow *window) { if (msg->status_code == SOUP_STATUS_OK) { @@ -625,7 +625,7 @@ parse_page_version (SoupSession *session, version = get_file_page_version (msg->response_body->data, VERSION_PLACE); - data->url = g_strconcat (GEDIT_URL, version, "/", NULL); + data->url = g_strconcat (PLUMA_URL, version, "/", NULL); g_free (version); msg2 = soup_message_new ("GET", data->url); @@ -642,16 +642,16 @@ parse_page_version (SoupSession *session, } static void -impl_activate (GeditPlugin *plugin, - GeditWindow *window) +impl_activate (PlumaPlugin *plugin, + PlumaWindow *window) { SoupMessage *msg; WindowData *data; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); data = g_slice_new (WindowData); - data->plugin = GEDIT_CHECK_UPDATE_PLUGIN (plugin); + data->plugin = PLUMA_CHECK_UPDATE_PLUGIN (plugin); data->url = NULL; data->version = NULL; @@ -660,21 +660,21 @@ impl_activate (GeditPlugin *plugin, data, free_window_data); - msg = soup_message_new ("GET", GEDIT_URL); + msg = soup_message_new ("GET", PLUMA_URL); - soup_session_queue_message (GEDIT_CHECK_UPDATE_PLUGIN (plugin)->priv->session, msg, + soup_session_queue_message (PLUMA_CHECK_UPDATE_PLUGIN (plugin)->priv->session, msg, (SoupSessionCallback)parse_page_version, window); } static void -impl_deactivate (GeditPlugin *plugin, - GeditWindow *window) +impl_deactivate (PlumaPlugin *plugin, + PlumaWindow *window) { - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); - soup_session_abort (GEDIT_CHECK_UPDATE_PLUGIN (plugin)->priv->session); + soup_session_abort (PLUMA_CHECK_UPDATE_PLUGIN (plugin)->priv->session); g_object_set_data (G_OBJECT (window), WINDOW_DATA_KEY, @@ -682,15 +682,15 @@ impl_deactivate (GeditPlugin *plugin, } static void -gedit_check_update_plugin_class_init (GeditCheckUpdatePluginClass *klass) +pluma_check_update_plugin_class_init (PlumaCheckUpdatePluginClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - GeditPluginClass *plugin_class = GEDIT_PLUGIN_CLASS (klass); + PlumaPluginClass *plugin_class = PLUMA_PLUGIN_CLASS (klass); - g_type_class_add_private (object_class, sizeof (GeditCheckUpdatePluginPrivate)); + g_type_class_add_private (object_class, sizeof (PlumaCheckUpdatePluginPrivate)); - object_class->finalize = gedit_check_update_plugin_finalize; - object_class->dispose = gedit_check_update_plugin_dispose; + object_class->finalize = pluma_check_update_plugin_finalize; + object_class->dispose = pluma_check_update_plugin_dispose; plugin_class->activate = impl_activate; plugin_class->deactivate = impl_deactivate; diff --git a/plugins/checkupdate/pluma-check-update-plugin.h b/plugins/checkupdate/pluma-check-update-plugin.h new file mode 100755 index 00000000..6742d2d4 --- /dev/null +++ b/plugins/checkupdate/pluma-check-update-plugin.h @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2009 - Ignacio Casal Quinteiro <[email protected]> + * + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __PLUMA_CHECK_UPDATE_PLUGIN_H__ +#define __PLUMA_CHECK_UPDATE_PLUGIN_H__ + +#include <glib.h> +#include <glib-object.h> +#include <pluma/pluma-plugin.h> + +G_BEGIN_DECLS + +/* + * Type checking and casting macros + */ +#define PLUMA_TYPE_CHECK_UPDATE_PLUGIN (pluma_check_update_plugin_get_type ()) +#define PLUMA_CHECK_UPDATE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PLUMA_TYPE_CHECK_UPDATE_PLUGIN, PlumaCheckUpdatePlugin)) +#define PLUMA_CHECK_UPDATE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PLUMA_TYPE_CHECK_UPDATE_PLUGIN, PlumaCheckUpdatePluginClass)) +#define IS_PLUMA_CHECK_UPDATE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PLUMA_TYPE_CHECK_UPDATE_PLUGIN)) +#define IS_PLUMA_CHECK_UPDATE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PLUMA_TYPE_CHECK_UPDATE_PLUGIN)) +#define PLUMA_CHECK_UPDATE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), PLUMA_TYPE_CHECK_UPDATE_PLUGIN, PlumaCheckUpdatePluginClass)) + +/* Private structure type */ +typedef struct _PlumaCheckUpdatePluginPrivate PlumaCheckUpdatePluginPrivate; + +/* + * Main object structure + */ +typedef struct _PlumaCheckUpdatePlugin PlumaCheckUpdatePlugin; + +struct _PlumaCheckUpdatePlugin +{ + PlumaPlugin parent_instance; + + /*< private >*/ + PlumaCheckUpdatePluginPrivate *priv; +}; + +/* + * Class definition + */ +typedef struct _PlumaCheckUpdatePluginClass PlumaCheckUpdatePluginClass; + +struct _PlumaCheckUpdatePluginClass +{ + PlumaPluginClass parent_class; +}; + +/* + * Public methods + */ +GType pluma_check_update_plugin_get_type (void) G_GNUC_CONST; + +/* All the plugins must implement this function */ +G_MODULE_EXPORT GType register_pluma_plugin (GTypeModule *module); + +G_END_DECLS + +#endif /* __PLUMA_CHECK_UPDATE_PLUGIN_H__ */ diff --git a/plugins/checkupdate/gedit-check-update.schemas.in b/plugins/checkupdate/pluma-check-update.schemas.in index 67bc892b..5d4d009a 100755 --- a/plugins/checkupdate/gedit-check-update.schemas.in +++ b/plugins/checkupdate/pluma-check-update.schemas.in @@ -1,9 +1,9 @@ <mateconfschemafile> <schemalist> <schema> - <key>/schemas/apps/gedit-2/plugins/checkupdate/ignore_version</key> - <applyto>/apps/gedit-2/plugins/checkupdate/ignore_version</applyto> - <owner>gedit</owner> + <key>/schemas/apps/pluma-2/plugins/checkupdate/ignore_version</key> + <applyto>/apps/pluma-2/plugins/checkupdate/ignore_version</applyto> + <owner>pluma</owner> <type>string</type> <locale name="C"> <short>Version to ignore until the next version is released</short> diff --git a/plugins/docinfo/Makefile.am b/plugins/docinfo/Makefile.am index edf2909c..27290fc7 100755 --- a/plugins/docinfo/Makefile.am +++ b/plugins/docinfo/Makefile.am @@ -1,29 +1,29 @@ # docinfo plugin -plugindir = $(GEDIT_PLUGINS_LIBS_DIR) +plugindir = $(PLUMA_PLUGINS_LIBS_DIR) INCLUDES = \ -I$(top_srcdir) \ - $(GEDIT_CFLAGS) \ + $(PLUMA_CFLAGS) \ $(WARN_CFLAGS) \ $(DISABLE_DEPRECATED_CFLAGS) plugin_LTLIBRARIES = libdocinfo.la libdocinfo_la_SOURCES = \ - gedit-docinfo-plugin.h \ - gedit-docinfo-plugin.c + pluma-docinfo-plugin.h \ + pluma-docinfo-plugin.c libdocinfo_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS) -libdocinfo_la_LIBADD = $(GEDIT_LIBS) +libdocinfo_la_LIBADD = $(PLUMA_LIBS) -uidir = $(GEDIT_PLUGINS_DATA_DIR)/docinfo +uidir = $(PLUMA_PLUGINS_DATA_DIR)/docinfo ui_DATA = docinfo.ui -plugin_in_files = docinfo.gedit-plugin.desktop.in +plugin_in_files = docinfo.pluma-plugin.desktop.in -%.gedit-plugin: %.gedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache +%.pluma-plugin: %.pluma-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache -plugin_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin) +plugin_DATA = $(plugin_in_files:.pluma-plugin.desktop.in=.pluma-plugin) EXTRA_DIST = $(ui_DATA) $(plugin_in_files) diff --git a/plugins/docinfo/docinfo.gedit-plugin.desktop.in b/plugins/docinfo/docinfo.pluma-plugin.desktop.in index 77f2793d..990f2cd6 100755 --- a/plugins/docinfo/docinfo.gedit-plugin.desktop.in +++ b/plugins/docinfo/docinfo.pluma-plugin.desktop.in @@ -1,4 +1,4 @@ -[Gedit Plugin] +[Pluma Plugin] Module=docinfo IAge=2 _Name=Document Statistics diff --git a/plugins/docinfo/gedit-docinfo-plugin.h b/plugins/docinfo/gedit-docinfo-plugin.h deleted file mode 100755 index 36d6bddc..00000000 --- a/plugins/docinfo/gedit-docinfo-plugin.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * gedit-docinfo-plugin.h - * - * Copyright (C) 2002-2005 Paolo Maggi - * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - */ - -#ifndef __GEDIT_DOCINFO_PLUGIN_H__ -#define __GEDIT_DOCINFO_PLUGIN_H__ - -#include <glib.h> -#include <glib-object.h> -#include <gedit/gedit-plugin.h> - -G_BEGIN_DECLS - -/* - * Type checking and casting macros - */ -#define GEDIT_TYPE_DOCINFO_PLUGIN (gedit_docinfo_plugin_get_type ()) -#define GEDIT_DOCINFO_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GEDIT_TYPE_DOCINFO_PLUGIN, GeditDocInfoPlugin)) -#define GEDIT_DOCINFO_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GEDIT_TYPE_DOCINFO_PLUGIN, GeditDocInfoPluginClass)) -#define GEDIT_IS_DOCINFO_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GEDIT_TYPE_DOCINFO_PLUGIN)) -#define GEDIT_IS_DOCINFO_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GEDIT_TYPE_DOCINFO_PLUGIN)) -#define GEDIT_DOCINFO_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GEDIT_TYPE_DOCINFO_PLUGIN, GeditDocInfoPluginClass)) - -/* Private structure type */ -typedef struct _GeditDocInfoPluginPrivate GeditDocInfoPluginPrivate; - -/* - * Main object structure - */ -typedef struct _GeditDocInfoPlugin GeditDocInfoPlugin; - -struct _GeditDocInfoPlugin -{ - GeditPlugin parent_instance; -}; - -/* - * Class definition - */ -typedef struct _GeditDocInfoPluginClass GeditDocInfoPluginClass; - -struct _GeditDocInfoPluginClass -{ - GeditPluginClass parent_class; -}; - -/* - * Public methods - */ -GType gedit_docinfo_plugin_get_type (void) G_GNUC_CONST; - -/* All the plugins must implement this function */ -G_MODULE_EXPORT GType register_gedit_plugin (GTypeModule *module); - -G_END_DECLS - -#endif /* __GEDIT_DOCINFO_PLUGIN_H__ */ diff --git a/plugins/docinfo/gedit-docinfo-plugin.c b/plugins/docinfo/pluma-docinfo-plugin.c index a143a5a6..10a5af87 100755 --- a/plugins/docinfo/gedit-docinfo-plugin.c +++ b/plugins/docinfo/pluma-docinfo-plugin.c @@ -1,5 +1,5 @@ /* - * gedit-docinfo-plugin.c + * pluma-docinfo-plugin.c * * Copyright (C) 2002-2005 Paolo Maggi * @@ -24,7 +24,7 @@ #include <config.h> #endif -#include "gedit-docinfo-plugin.h" +#include "pluma-docinfo-plugin.h" #include <string.h> /* For strlen (...) */ @@ -32,13 +32,13 @@ #include <pango/pango-break.h> #include <gmodule.h> -#include <gedit/gedit-debug.h> -#include <gedit/gedit-utils.h> +#include <pluma/pluma-debug.h> +#include <pluma/pluma-utils.h> -#define WINDOW_DATA_KEY "GeditDocInfoWindowData" +#define WINDOW_DATA_KEY "PlumaDocInfoWindowData" #define MENU_PATH "/MenuBar/ToolsMenu/ToolsOps_2" -GEDIT_PLUGIN_REGISTER_TYPE(GeditDocInfoPlugin, gedit_docinfo_plugin) +PLUMA_PLUGIN_REGISTER_TYPE(PlumaDocInfoPlugin, pluma_docinfo_plugin) typedef struct { @@ -59,7 +59,7 @@ typedef struct typedef struct { - GeditPlugin *plugin; + PlumaPlugin *plugin; GtkActionGroup *ui_action_group; guint ui_id; @@ -69,13 +69,13 @@ typedef struct static void docinfo_dialog_response_cb (GtkDialog *widget, gint res_id, - GeditWindow *window); + PlumaWindow *window); static void docinfo_dialog_destroy_cb (GtkObject *obj, WindowData *data) { - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); if (data != NULL) { @@ -85,7 +85,7 @@ docinfo_dialog_destroy_cb (GtkObject *obj, } static DocInfoDialog * -get_docinfo_dialog (GeditWindow *window, +get_docinfo_dialog (PlumaWindow *window, WindowData *data) { DocInfoDialog *dialog; @@ -95,13 +95,13 @@ get_docinfo_dialog (GeditWindow *window, GtkWidget *error_widget; gboolean ret; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); dialog = g_new (DocInfoDialog, 1); - data_dir = gedit_plugin_get_data_dir (data->plugin); + data_dir = pluma_plugin_get_data_dir (data->plugin); ui_file = g_build_filename (data_dir, "docinfo.ui", NULL); - ret = gedit_utils_get_ui_objects (ui_file, + ret = pluma_utils_get_ui_objects (ui_file, NULL, &error_widget, "dialog", &dialog->dialog, @@ -128,7 +128,7 @@ get_docinfo_dialog (GeditWindow *window, const gchar *err_message; err_message = gtk_label_get_label (GTK_LABEL (error_widget)); - gedit_warning (GTK_WINDOW (window), "%s", err_message); + pluma_warning (GTK_WINDOW (window), "%s", err_message); g_free (dialog); gtk_widget_destroy (error_widget); @@ -154,7 +154,7 @@ get_docinfo_dialog (GeditWindow *window, } static void -calculate_info (GeditDocument *doc, +calculate_info (PlumaDocument *doc, GtkTextIter *start, GtkTextIter *end, gint *chars, @@ -164,7 +164,7 @@ calculate_info (GeditDocument *doc, { gchar *text; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); text = gtk_text_buffer_get_slice (GTK_TEXT_BUFFER (doc), start, @@ -209,7 +209,7 @@ calculate_info (GeditDocument *doc, } static void -docinfo_real (GeditDocument *doc, +docinfo_real (PlumaDocument *doc, DocInfoDialog *dialog) { GtkTextIter start, end; @@ -221,7 +221,7 @@ docinfo_real (GeditDocument *doc, gchar *tmp_str; gchar *doc_name; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); gtk_text_buffer_get_bounds (GTK_TEXT_BUFFER (doc), &start, @@ -236,13 +236,13 @@ docinfo_real (GeditDocument *doc, if (chars == 0) lines = 0; - gedit_debug_message (DEBUG_PLUGINS, "Chars: %d", chars); - gedit_debug_message (DEBUG_PLUGINS, "Lines: %d", lines); - gedit_debug_message (DEBUG_PLUGINS, "Words: %d", words); - gedit_debug_message (DEBUG_PLUGINS, "Chars non-space: %d", chars - white_chars); - gedit_debug_message (DEBUG_PLUGINS, "Bytes: %d", bytes); + pluma_debug_message (DEBUG_PLUGINS, "Chars: %d", chars); + pluma_debug_message (DEBUG_PLUGINS, "Lines: %d", lines); + pluma_debug_message (DEBUG_PLUGINS, "Words: %d", words); + pluma_debug_message (DEBUG_PLUGINS, "Chars non-space: %d", chars - white_chars); + pluma_debug_message (DEBUG_PLUGINS, "Bytes: %d", bytes); - doc_name = gedit_document_get_short_name_for_display (doc); + doc_name = pluma_document_get_short_name_for_display (doc); tmp_str = g_strdup_printf ("<span weight=\"bold\">%s</span>", doc_name); gtk_label_set_markup (GTK_LABEL (dialog->file_name_label), tmp_str); g_free (doc_name); @@ -270,7 +270,7 @@ docinfo_real (GeditDocument *doc, } static void -selectioninfo_real (GeditDocument *doc, +selectioninfo_real (PlumaDocument *doc, DocInfoDialog *dialog) { gboolean sel; @@ -282,7 +282,7 @@ selectioninfo_real (GeditDocument *doc, gint bytes = 0; gchar *tmp_str; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); sel = gtk_text_buffer_get_selection_bounds (GTK_TEXT_BUFFER (doc), &start, @@ -296,11 +296,11 @@ selectioninfo_real (GeditDocument *doc, &start, &end, &chars, &words, &white_chars, &bytes); - gedit_debug_message (DEBUG_PLUGINS, "Selected chars: %d", chars); - gedit_debug_message (DEBUG_PLUGINS, "Selected lines: %d", lines); - gedit_debug_message (DEBUG_PLUGINS, "Selected words: %d", words); - gedit_debug_message (DEBUG_PLUGINS, "Selected chars non-space: %d", chars - white_chars); - gedit_debug_message (DEBUG_PLUGINS, "Selected bytes: %d", bytes); + pluma_debug_message (DEBUG_PLUGINS, "Selected chars: %d", chars); + pluma_debug_message (DEBUG_PLUGINS, "Selected lines: %d", lines); + pluma_debug_message (DEBUG_PLUGINS, "Selected words: %d", words); + pluma_debug_message (DEBUG_PLUGINS, "Selected chars non-space: %d", chars - white_chars); + pluma_debug_message (DEBUG_PLUGINS, "Selected bytes: %d", bytes); gtk_widget_set_sensitive (dialog->selection_vbox, TRUE); } @@ -308,7 +308,7 @@ selectioninfo_real (GeditDocument *doc, { gtk_widget_set_sensitive (dialog->selection_vbox, FALSE); - gedit_debug_message (DEBUG_PLUGINS, "Selection empty"); + pluma_debug_message (DEBUG_PLUGINS, "Selection empty"); } if (chars == 0) @@ -337,17 +337,17 @@ selectioninfo_real (GeditDocument *doc, static void docinfo_cb (GtkAction *action, - GeditWindow *window) + PlumaWindow *window) { - GeditDocument *doc; + PlumaDocument *doc; WindowData *data; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); data = (WindowData *) g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY); - doc = gedit_window_get_active_document (window); + doc = pluma_window_get_active_document (window); g_return_if_fail (doc != NULL); if (data->dialog != NULL) @@ -376,11 +376,11 @@ docinfo_cb (GtkAction *action, static void docinfo_dialog_response_cb (GtkDialog *widget, gint res_id, - GeditWindow *window) + PlumaWindow *window) { WindowData *data; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); data = (WindowData *) g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY); @@ -389,7 +389,7 @@ docinfo_dialog_response_cb (GtkDialog *widget, { case GTK_RESPONSE_CLOSE: { - gedit_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_CLOSE"); + pluma_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_CLOSE"); gtk_widget_destroy (data->dialog->dialog); break; @@ -397,11 +397,11 @@ docinfo_dialog_response_cb (GtkDialog *widget, case GTK_RESPONSE_OK: { - GeditDocument *doc; + PlumaDocument *doc; - gedit_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_OK"); + pluma_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_OK"); - doc = gedit_window_get_active_document (window); + doc = pluma_window_get_active_document (window); g_return_if_fail (doc != NULL); docinfo_real (doc, @@ -430,7 +430,7 @@ free_window_data (WindowData *data) { g_return_if_fail (data != NULL); - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); g_object_unref (data->plugin); @@ -445,14 +445,14 @@ free_window_data (WindowData *data) } static void -update_ui_real (GeditWindow *window, +update_ui_real (PlumaWindow *window, WindowData *data) { - GeditView *view; + PlumaView *view; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); - view = gedit_window_get_active_view (window); + view = pluma_window_get_active_view (window); gtk_action_group_set_sensitive (data->ui_action_group, (view != NULL)); @@ -466,33 +466,33 @@ update_ui_real (GeditWindow *window, } static void -gedit_docinfo_plugin_init (GeditDocInfoPlugin *plugin) +pluma_docinfo_plugin_init (PlumaDocInfoPlugin *plugin) { - gedit_debug_message (DEBUG_PLUGINS, "GeditDocInfoPlugin initializing"); + pluma_debug_message (DEBUG_PLUGINS, "PlumaDocInfoPlugin initializing"); } static void -gedit_docinfo_plugin_finalize (GObject *object) +pluma_docinfo_plugin_finalize (GObject *object) { - gedit_debug_message (DEBUG_PLUGINS, "GeditDocInfoPlugin finalizing"); + pluma_debug_message (DEBUG_PLUGINS, "PlumaDocInfoPlugin finalizing"); - G_OBJECT_CLASS (gedit_docinfo_plugin_parent_class)->finalize (object); + G_OBJECT_CLASS (pluma_docinfo_plugin_parent_class)->finalize (object); } static void -impl_activate (GeditPlugin *plugin, - GeditWindow *window) +impl_activate (PlumaPlugin *plugin, + PlumaWindow *window) { GtkUIManager *manager; WindowData *data; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); data = g_new (WindowData, 1); data->plugin = g_object_ref (plugin); data->dialog = NULL; - data->ui_action_group = gtk_action_group_new ("GeditDocInfoPluginActions"); + data->ui_action_group = gtk_action_group_new ("PlumaDocInfoPluginActions"); gtk_action_group_set_translation_domain (data->ui_action_group, GETTEXT_PACKAGE); @@ -501,7 +501,7 @@ impl_activate (GeditPlugin *plugin, G_N_ELEMENTS (action_entries), window); - manager = gedit_window_get_ui_manager (window); + manager = pluma_window_get_ui_manager (window); gtk_ui_manager_insert_action_group (manager, data->ui_action_group, -1); @@ -526,15 +526,15 @@ impl_activate (GeditPlugin *plugin, } static void -impl_deactivate (GeditPlugin *plugin, - GeditWindow *window) +impl_deactivate (PlumaPlugin *plugin, + PlumaWindow *window) { GtkUIManager *manager; WindowData *data; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); - manager = gedit_window_get_ui_manager (window); + manager = pluma_window_get_ui_manager (window); data = (WindowData *) g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY); @@ -551,12 +551,12 @@ impl_deactivate (GeditPlugin *plugin, } static void -impl_update_ui (GeditPlugin *plugin, - GeditWindow *window) +impl_update_ui (PlumaPlugin *plugin, + PlumaWindow *window) { WindowData *data; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); data = (WindowData *) g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY); @@ -567,12 +567,12 @@ impl_update_ui (GeditPlugin *plugin, } static void -gedit_docinfo_plugin_class_init (GeditDocInfoPluginClass *klass) +pluma_docinfo_plugin_class_init (PlumaDocInfoPluginClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - GeditPluginClass *plugin_class = GEDIT_PLUGIN_CLASS (klass); + PlumaPluginClass *plugin_class = PLUMA_PLUGIN_CLASS (klass); - object_class->finalize = gedit_docinfo_plugin_finalize; + object_class->finalize = pluma_docinfo_plugin_finalize; plugin_class->activate = impl_activate; plugin_class->deactivate = impl_deactivate; diff --git a/plugins/docinfo/pluma-docinfo-plugin.h b/plugins/docinfo/pluma-docinfo-plugin.h new file mode 100755 index 00000000..41252ff0 --- /dev/null +++ b/plugins/docinfo/pluma-docinfo-plugin.h @@ -0,0 +1,75 @@ +/* + * pluma-docinfo-plugin.h + * + * Copyright (C) 2002-2005 Paolo Maggi + * + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ + */ + +#ifndef __PLUMA_DOCINFO_PLUGIN_H__ +#define __PLUMA_DOCINFO_PLUGIN_H__ + +#include <glib.h> +#include <glib-object.h> +#include <pluma/pluma-plugin.h> + +G_BEGIN_DECLS + +/* + * Type checking and casting macros + */ +#define PLUMA_TYPE_DOCINFO_PLUGIN (pluma_docinfo_plugin_get_type ()) +#define PLUMA_DOCINFO_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PLUMA_TYPE_DOCINFO_PLUGIN, PlumaDocInfoPlugin)) +#define PLUMA_DOCINFO_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PLUMA_TYPE_DOCINFO_PLUGIN, PlumaDocInfoPluginClass)) +#define PLUMA_IS_DOCINFO_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PLUMA_TYPE_DOCINFO_PLUGIN)) +#define PLUMA_IS_DOCINFO_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PLUMA_TYPE_DOCINFO_PLUGIN)) +#define PLUMA_DOCINFO_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), PLUMA_TYPE_DOCINFO_PLUGIN, PlumaDocInfoPluginClass)) + +/* Private structure type */ +typedef struct _PlumaDocInfoPluginPrivate PlumaDocInfoPluginPrivate; + +/* + * Main object structure + */ +typedef struct _PlumaDocInfoPlugin PlumaDocInfoPlugin; + +struct _PlumaDocInfoPlugin +{ + PlumaPlugin parent_instance; +}; + +/* + * Class definition + */ +typedef struct _PlumaDocInfoPluginClass PlumaDocInfoPluginClass; + +struct _PlumaDocInfoPluginClass +{ + PlumaPluginClass parent_class; +}; + +/* + * Public methods + */ +GType pluma_docinfo_plugin_get_type (void) G_GNUC_CONST; + +/* All the plugins must implement this function */ +G_MODULE_EXPORT GType register_pluma_plugin (GTypeModule *module); + +G_END_DECLS + +#endif /* __PLUMA_DOCINFO_PLUGIN_H__ */ diff --git a/plugins/externaltools/Makefile.am b/plugins/externaltools/Makefile.am index f529640c..bec58b63 100755 --- a/plugins/externaltools/Makefile.am +++ b/plugins/externaltools/Makefile.am @@ -1,11 +1,11 @@ # External Tools plugin SUBDIRS = tools data scripts -plugindir = $(GEDIT_PLUGINS_LIBS_DIR) +plugindir = $(PLUMA_PLUGINS_LIBS_DIR) -plugin_in_files = externaltools.gedit-plugin.desktop.in -%.gedit-plugin: %.gedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache +plugin_in_files = externaltools.pluma-plugin.desktop.in +%.pluma-plugin: %.pluma-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache -plugin_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin) +plugin_DATA = $(plugin_in_files:.pluma-plugin.desktop.in=.pluma-plugin) EXTRA_DIST = $(plugin_in_files) diff --git a/plugins/externaltools/data/Makefile.am b/plugins/externaltools/data/Makefile.am index ae3a1c66..abac77c9 100755 --- a/plugins/externaltools/data/Makefile.am +++ b/plugins/externaltools/data/Makefile.am @@ -1,4 +1,4 @@ -TOOL_MERGE=$(top_srcdir)/plugins/externaltools/scripts/gedit-tool-merge.pl +TOOL_MERGE=$(top_srcdir)/plugins/externaltools/scripts/pluma-tool-merge.pl tools_in_files = \ build.tool.in \ @@ -29,7 +29,7 @@ desktop_in_files = $(install_tools_in_files:.tool.in=.desktop.in) desktop_files = $(install_tools_in_files:.tool.in=.desktop) tools_SCRIPTS = $(install_tools_in_files:.tool.in=) -toolsdir = $(GEDIT_PLUGINS_DATA_DIR)/externaltools/tools +toolsdir = $(PLUMA_PLUGINS_DATA_DIR)/externaltools/tools all_tools_in_files = \ $(tools_in_files) \ diff --git a/plugins/externaltools/data/build.desktop.in b/plugins/externaltools/data/build.desktop.in index 13767ee7..c2a49871 100755 --- a/plugins/externaltools/data/build.desktop.in +++ b/plugins/externaltools/data/build.desktop.in @@ -1,4 +1,4 @@ -[Gedit Tool] +[Pluma Tool] _Name=Build _Comment=Run "make" in the document directory Input=nothing diff --git a/plugins/externaltools/data/build.tool.in b/plugins/externaltools/data/build.tool.in index 0b81d5b6..d4cd7f43 100755 --- a/plugins/externaltools/data/build.tool.in +++ b/plugins/externaltools/data/build.tool.in @@ -1,7 +1,7 @@ #!/bin/sh EHOME=`echo $HOME | sed "s/#/\#/"` -DIR=$GEDIT_CURRENT_DOCUMENT_DIR +DIR=$PLUMA_CURRENT_DOCUMENT_DIR while test "$DIR" != "/"; do for m in GNUmakefile makefile Makefile; do if [ -f "${DIR}/${m}" ]; then diff --git a/plugins/externaltools/data/open-terminal-here-osx.desktop.in b/plugins/externaltools/data/open-terminal-here-osx.desktop.in index 801b003c..45587ef6 100755 --- a/plugins/externaltools/data/open-terminal-here-osx.desktop.in +++ b/plugins/externaltools/data/open-terminal-here-osx.desktop.in @@ -1,4 +1,4 @@ -[Gedit Tool] +[Pluma Tool] _Name=Open terminal here _Comment=Open a terminal in the document location Input=nothing diff --git a/plugins/externaltools/data/open-terminal-here-osx.tool.in b/plugins/externaltools/data/open-terminal-here-osx.tool.in index c3360064..86d842dc 100755 --- a/plugins/externaltools/data/open-terminal-here-osx.tool.in +++ b/plugins/externaltools/data/open-terminal-here-osx.tool.in @@ -1,6 +1,6 @@ #!/usr/bin/osascript -set the_path to system attribute "GEDIT_CURRENT_DOCUMENT_DIR" +set the_path to system attribute "PLUMA_CURRENT_DOCUMENT_DIR" set cmd to "cd " & quoted form of the_path tell application "System Events" to set terminalIsRunning to exists application process "Terminal" diff --git a/plugins/externaltools/data/open-terminal-here.desktop.in b/plugins/externaltools/data/open-terminal-here.desktop.in index 801b003c..45587ef6 100755 --- a/plugins/externaltools/data/open-terminal-here.desktop.in +++ b/plugins/externaltools/data/open-terminal-here.desktop.in @@ -1,4 +1,4 @@ -[Gedit Tool] +[Pluma Tool] _Name=Open terminal here _Comment=Open a terminal in the document location Input=nothing diff --git a/plugins/externaltools/data/open-terminal-here.tool.in b/plugins/externaltools/data/open-terminal-here.tool.in index d2dda8db..af35792a 100755 --- a/plugins/externaltools/data/open-terminal-here.tool.in +++ b/plugins/externaltools/data/open-terminal-here.tool.in @@ -1,4 +1,4 @@ #!/bin/sh #TODO: use "mateconftool-2 -g /desktop/mate/applications/terminal/exec" -mate-terminal --working-directory=$GEDIT_CURRENT_DOCUMENT_DIR & +mate-terminal --working-directory=$PLUMA_CURRENT_DOCUMENT_DIR & diff --git a/plugins/externaltools/data/remove-trailing-spaces.desktop.in b/plugins/externaltools/data/remove-trailing-spaces.desktop.in index 99b8b703..70bd8fd1 100755 --- a/plugins/externaltools/data/remove-trailing-spaces.desktop.in +++ b/plugins/externaltools/data/remove-trailing-spaces.desktop.in @@ -1,4 +1,4 @@ -[Gedit Tool] +[Pluma Tool] _Name=Remove trailing spaces _Comment=Remove useless trailing spaces in your file Input=document diff --git a/plugins/externaltools/data/run-command.desktop.in b/plugins/externaltools/data/run-command.desktop.in index b58294b0..4e15e678 100755 --- a/plugins/externaltools/data/run-command.desktop.in +++ b/plugins/externaltools/data/run-command.desktop.in @@ -1,4 +1,4 @@ -[Gedit Tool] +[Pluma Tool] _Name=Run command _Comment=Execute a custom command and put its output in a new document Input=nothing diff --git a/plugins/externaltools/data/run-command.tool.in b/plugins/externaltools/data/run-command.tool.in index ee611bbb..6f08a622 100755 --- a/plugins/externaltools/data/run-command.tool.in +++ b/plugins/externaltools/data/run-command.tool.in @@ -1,4 +1,4 @@ #!/bin/sh #TODO: use "mateconftool-2 -g /desktop/mate/applications/terminal/exec" -exec `matedialog --entry --title="Run command - gedit" --text="Command to run"` +exec `matedialog --entry --title="Run command - pluma" --text="Command to run"` diff --git a/plugins/externaltools/externaltools.gedit-plugin.desktop.in b/plugins/externaltools/externaltools.pluma-plugin.desktop.in index 5212c49b..fcd15a9d 100755 --- a/plugins/externaltools/externaltools.gedit-plugin.desktop.in +++ b/plugins/externaltools/externaltools.pluma-plugin.desktop.in @@ -1,4 +1,4 @@ -[Gedit Plugin] +[Pluma Plugin] Loader=python Module=externaltools IAge=2 @@ -6,4 +6,4 @@ _Name=External Tools _Description=Execute external commands and shell scripts. Authors=Steve Frécinaux <[email protected]> Copyright=Copyright © 2005 Steve Frécinaux -Website=http://www.gedit.org +Website=http://www.pluma.org diff --git a/plugins/externaltools/scripts/Makefile.am b/plugins/externaltools/scripts/Makefile.am index 4ff8060b..237d5e58 100755 --- a/plugins/externaltools/scripts/Makefile.am +++ b/plugins/externaltools/scripts/Makefile.am @@ -1,4 +1,4 @@ -EXTRA_DIST = gedit-tool-merge.pl +EXTRA_DIST = pluma-tool-merge.pl -include $(top_srcdir)/git.mk diff --git a/plugins/externaltools/scripts/gedit-tool-merge.pl b/plugins/externaltools/scripts/pluma-tool-merge.pl index 780d95dd..37b752e7 100755 --- a/plugins/externaltools/scripts/gedit-tool-merge.pl +++ b/plugins/externaltools/scripts/pluma-tool-merge.pl @@ -1,22 +1,22 @@ #!/usr/bin/perl -# gedit-tool-merge.pl -# This file is part of gedit +# pluma-tool-merge.pl +# This file is part of pluma # # Copyright (C) 2006 - Steve Frécinaux <[email protected]> # -# gedit is free software; you can redistribute it and/or modify +# pluma 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 of the License, or # (at your option) any later version. # -# gedit is distributed in the hope that it will be useful, +# pluma 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 gedit; if not, write to the Free Software +# along with pluma; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, # Boston, MA 02110-1301 USA diff --git a/plugins/externaltools/tools/Makefile.am b/plugins/externaltools/tools/Makefile.am index 5edcab58..d90eb4aa 100755 --- a/plugins/externaltools/tools/Makefile.am +++ b/plugins/externaltools/tools/Makefile.am @@ -1,6 +1,6 @@ # Python snippets plugin -plugindir = $(GEDIT_PLUGINS_LIBS_DIR)/externaltools +plugindir = $(PLUMA_PLUGINS_LIBS_DIR)/externaltools plugin_PYTHON = \ __init__.py \ capture.py \ @@ -11,7 +11,7 @@ plugin_PYTHON = \ filelookup.py \ linkparsing.py -uidir = $(GEDIT_PLUGINS_DATA_DIR)/externaltools/ui +uidir = $(PLUMA_PLUGINS_DATA_DIR)/externaltools/ui ui_DATA = tools.ui \ outputpanel.ui diff --git a/plugins/externaltools/tools/__init__.py b/plugins/externaltools/tools/__init__.py index a46aef8f..39522ede 100755 --- a/plugins/externaltools/tools/__init__.py +++ b/plugins/externaltools/tools/__init__.py @@ -1,5 +1,5 @@ # -*- coding: UTF-8 -*- -# Gedit External Tools plugin +# Pluma External Tools plugin # Copyright (C) 2005-2006 Steve Frécinaux <[email protected]> # # This program is free software; you can redistribute it and/or modify @@ -19,7 +19,7 @@ __all__ = ('ExternalToolsPlugin', 'ExternalToolsWindowHelper', 'Manager', 'OutputPanel', 'Capture', 'UniqueById') -import gedit +import pluma import gtk from manager import Manager from library import ToolLibrary @@ -166,7 +166,7 @@ class ExternalToolsWindowHelper(object): manager = window.get_ui_manager() self._action_group = gtk.ActionGroup('ExternalToolsPluginActions') - self._action_group.set_translation_domain('gedit') + self._action_group.set_translation_domain('pluma') self._action_group.add_actions([('ExternalToolManager', None, _('Manage _External Tools...'), @@ -229,7 +229,7 @@ class ExternalToolsWindowHelper(object): def update_manager(self, tool): self._plugin.update_manager(tool) -class ExternalToolsPlugin(gedit.Plugin): +class ExternalToolsPlugin(pluma.Plugin): WINDOW_DATA_KEY = "ExternalToolsPluginWindowData" def __init__(self): @@ -263,7 +263,7 @@ class ExternalToolsPlugin(gedit.Plugin): self._manager.dialog.connect('destroy', self.on_manager_destroy) - window = gedit.app_get_default().get_active_window() + window = pluma.app_get_default().get_active_window() self._manager.run(window) return self._manager.dialog diff --git a/plugins/externaltools/tools/capture.py b/plugins/externaltools/tools/capture.py index e47862c8..2f065761 100755 --- a/plugins/externaltools/tools/capture.py +++ b/plugins/externaltools/tools/capture.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Gedit External Tools plugin +# Pluma External Tools plugin # Copyright (C) 2005-2006 Steve Frécinaux <[email protected]> # # This program is free software; you can redistribute it and/or modify diff --git a/plugins/externaltools/tools/filelookup.py b/plugins/externaltools/tools/filelookup.py index 229823b7..ce4961f9 100755 --- a/plugins/externaltools/tools/filelookup.py +++ b/plugins/externaltools/tools/filelookup.py @@ -18,7 +18,7 @@ import os import gio -import gedit +import pluma class FileLookup: """ @@ -110,7 +110,7 @@ class OpenDocumentRelPathFileLookupProvider(FileLookupProvider): if path.startswith('/'): return None - for doc in gedit.app_get_default().get_documents(): + for doc in pluma.app_get_default().get_documents(): if doc.is_local(): location = doc.get_location() if location: @@ -135,7 +135,7 @@ class OpenDocumentFileLookupProvider(FileLookupProvider): if path.startswith('/'): return None - for doc in gedit.app_get_default().get_documents(): + for doc in pluma.app_get_default().get_documents(): if doc.is_local(): location = doc.get_location() if location and location.get_uri().endswith(path): diff --git a/plugins/externaltools/tools/functions.py b/plugins/externaltools/tools/functions.py index 0d2bfdbf..b4b666f6 100755 --- a/plugins/externaltools/tools/functions.py +++ b/plugins/externaltools/tools/functions.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Gedit External Tools plugin +# Pluma External Tools plugin # Copyright (C) 2005-2006 Steve Frécinaux <[email protected]> # # This program is free software; you can redistribute it and/or modify @@ -20,7 +20,7 @@ import os import gtk from gtk import gdk import gio -import gedit +import pluma #import gtksourceview from outputpanel import OutputPanel from capture import * @@ -53,7 +53,7 @@ def run_external_tool(window, node): capture = Capture(node.command, cwd) capture.env = os.environ.copy() - capture.set_env(GEDIT_CWD = cwd) + capture.set_env(PLUMA_CWD = cwd) view = window.get_active_view() if view is not None: @@ -63,7 +63,7 @@ def run_external_tool(window, node): # Current line number piter = document.get_iter_at_mark(document.get_insert()) - capture.set_env(GEDIT_CURRENT_LINE_NUMBER=str(piter.get_line() + 1)) + capture.set_env(PLUMA_CURRENT_LINE_NUMBER=str(piter.get_line() + 1)) # Current line text piter.set_line_offset(0) @@ -72,42 +72,42 @@ def run_external_tool(window, node): if not end.ends_line(): end.forward_to_line_end() - capture.set_env(GEDIT_CURRENT_LINE=piter.get_text(end)) + capture.set_env(PLUMA_CURRENT_LINE=piter.get_text(end)) # Selected text (only if input is not selection) if node.input != 'selection' and node.input != 'selection-document': bounds = document.get_selection_bounds() if bounds: - capture.set_env(GEDIT_SELECTED_TEXT=bounds[0].get_text(bounds[1])) + capture.set_env(PLUMA_SELECTED_TEXT=bounds[0].get_text(bounds[1])) bounds = current_word(document) - capture.set_env(GEDIT_CURRENT_WORD=bounds[0].get_text(bounds[1])) + capture.set_env(PLUMA_CURRENT_WORD=bounds[0].get_text(bounds[1])) - capture.set_env(GEDIT_CURRENT_DOCUMENT_TYPE=document.get_mime_type()) + capture.set_env(PLUMA_CURRENT_DOCUMENT_TYPE=document.get_mime_type()) if uri is not None: gfile = gio.File(uri) scheme = gfile.get_uri_scheme() name = os.path.basename(uri) - capture.set_env(GEDIT_CURRENT_DOCUMENT_URI = uri, - GEDIT_CURRENT_DOCUMENT_NAME = name, - GEDIT_CURRENT_DOCUMENT_SCHEME = scheme) - if gedit.utils.uri_has_file_scheme(uri): + capture.set_env(PLUMA_CURRENT_DOCUMENT_URI = uri, + PLUMA_CURRENT_DOCUMENT_NAME = name, + PLUMA_CURRENT_DOCUMENT_SCHEME = scheme) + if pluma.utils.uri_has_file_scheme(uri): path = gfile.get_path() cwd = os.path.dirname(path) capture.set_cwd(cwd) - capture.set_env(GEDIT_CURRENT_DOCUMENT_PATH = path, - GEDIT_CURRENT_DOCUMENT_DIR = cwd) + capture.set_env(PLUMA_CURRENT_DOCUMENT_PATH = path, + PLUMA_CURRENT_DOCUMENT_DIR = cwd) documents_uri = [doc.get_uri() for doc in window.get_documents() if doc.get_uri() is not None] documents_path = [gio.File(uri).get_path() for uri in documents_uri - if gedit.utils.uri_has_file_scheme(uri)] - capture.set_env(GEDIT_DOCUMENTS_URI = ' '.join(documents_uri), - GEDIT_DOCUMENTS_PATH = ' '.join(documents_path)) + if pluma.utils.uri_has_file_scheme(uri)] + capture.set_env(PLUMA_DOCUMENTS_URI = ' '.join(documents_uri), + PLUMA_DOCUMENTS_PATH = ' '.join(documents_path)) flags = capture.CAPTURE_BOTH @@ -224,7 +224,7 @@ class MultipleDocumentsSaver: for doc in docs: signals[doc] = doc.connect('saving', self.on_document_saving) - gedit.commands.save_document(window, doc) + pluma.commands.save_document(window, doc) doc.disconnect(signals[doc]) def on_document_saving(self, doc, size, total_size): @@ -277,7 +277,7 @@ def capture_end_execute_panel(capture, exit_code, panel, view, output_type): end.forward_chars(300) mtype = gio.content_type_guess(data=doc.get_text(start, end)) - lmanager = gedit.get_language_manager() + lmanager = pluma.get_language_manager() language = lmanager.guess_language(doc.get_uri(), mtype) diff --git a/plugins/externaltools/tools/library.py b/plugins/externaltools/tools/library.py index 6eb6ff1a..e3dc624c 100755 --- a/plugins/externaltools/tools/library.py +++ b/plugins/externaltools/tools/library.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Gedit External Tools plugin +# Pluma External Tools plugin # Copyright (C) 2006 Steve Frécinaux <[email protected]> # # This program is free software; you can redistribute it and/or modify @@ -41,19 +41,19 @@ class ToolLibrary(Singleton): if platform.platform() != 'Windows': for d in self.get_xdg_data_dirs(): - self.locations.append(os.path.join(d, 'gedit-2', 'plugins', 'externaltools', 'tools')) + self.locations.append(os.path.join(d, 'pluma-2', 'plugins', 'externaltools', 'tools')) self.locations.append(datadir) # self.locations[0] is where we save the custom scripts if platform.platform() == 'Windows': - toolsdir = os.path.expanduser('~/gedit/tools') + toolsdir = os.path.expanduser('~/pluma/tools') else: userdir = os.getenv('MATE22_USER_DIR') if userdir: - toolsdir = os.path.join(userdir, 'gedit/tools') + toolsdir = os.path.join(userdir, 'pluma/tools') else: - toolsdir = os.path.expanduser('~/.mate2/gedit/tools') + toolsdir = os.path.expanduser('~/.mate2/pluma/tools') self.locations.insert(0, toolsdir); @@ -80,9 +80,9 @@ class ToolLibrary(Singleton): import xml.etree.ElementTree as et userdir = os.getenv('MATE22_USER_DIR') if userdir: - filename = os.path.join(userdir, 'gedit/gedit-tools.xml') + filename = os.path.join(userdir, 'pluma/pluma-tools.xml') else: - filename = os.path.expanduser('~/.mate2/gedit/gedit-tools.xml') + filename = os.path.expanduser('~/.mate2/pluma/pluma-tools.xml') if not os.path.isfile(filename): return @@ -250,7 +250,7 @@ class Tool(object): for line in fp: if not in_block: - in_block = line.startswith('# [Gedit Tool]') + in_block = line.startswith('# [Pluma Tool]') continue if line.startswith('##') or line.startswith('# #'): continue if not line.startswith('# '): break @@ -389,7 +389,7 @@ class Tool(object): # before entering the data block for line in fp: - if line.startswith('# [Gedit Tool]'): + if line.startswith('# [Pluma Tool]'): break lines.append(line) # in the block: @@ -407,7 +407,7 @@ class Tool(object): return lines def _dump_properties(self): - lines = ['# [Gedit Tool]'] + lines = ['# [Pluma Tool]'] for item in self._properties.iteritems(): if item[0] in self._transform: lines.append('# %s=%s' % (item[0], self._transform[item[0]][1](item[1]))) diff --git a/plugins/externaltools/tools/manager.py b/plugins/externaltools/tools/manager.py index e28a088a..4d4d50aa 100755 --- a/plugins/externaltools/tools/manager.py +++ b/plugins/externaltools/tools/manager.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Gedit External Tools plugin +# Pluma External Tools plugin # Copyright (C) 2005-2006 Steve Frécinaux <[email protected]> # # This program is free software; you can redistribute it and/or modify @@ -18,7 +18,7 @@ __all__ = ('Manager', ) -import gedit +import pluma import gtk import gtksourceview2 as gsv import os.path @@ -114,7 +114,7 @@ class LanguagesPopup(gtk.Window): def init_languages(self, languages): manager = gsv.LanguageManager() - langs = gedit.language_manager_list_languages_sorted(manager, True) + langs = pluma.language_manager_list_languages_sorted(manager, True) self.model.append([_('All languages'), None, not languages]) self.model.append(['-', None, False]) @@ -548,7 +548,7 @@ class Manager: self.script_hash = self.compute_hash(script) contenttype = gio.content_type_guess(data=script) - lmanager = gedit.get_language_manager() + lmanager = pluma.get_language_manager() language = lmanager.guess_language(content_type=contenttype) if language is not None: @@ -818,7 +818,7 @@ class Manager: def on_tool_manager_dialog_response(self, dialog, response): if response == gtk.RESPONSE_HELP: - gedit.help_display(self.dialog, 'gedit', 'gedit-external-tools-plugin') + pluma.help_display(self.dialog, 'pluma', 'pluma-external-tools-plugin') return self.on_tool_manager_dialog_focus_out(dialog, None) @@ -830,7 +830,7 @@ class Manager: def on_tool_manager_dialog_focus_out(self, dialog, event): self.save_current_tool() - for window in gedit.app_get_default().get_windows(): + for window in pluma.app_get_default().get_windows(): helper = window.get_data("ExternalToolsPluginWindowData") helper.menu.update() diff --git a/plugins/externaltools/tools/outputpanel.py b/plugins/externaltools/tools/outputpanel.py index a30aad72..9d1da65f 100755 --- a/plugins/externaltools/tools/outputpanel.py +++ b/plugins/externaltools/tools/outputpanel.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Gedit External Tools plugin +# Pluma External Tools plugin # Copyright (C) 2005-2006 Steve Frécinaux <[email protected]> # Copyright (C) 2010 Per Arneng <[email protected]> # @@ -19,7 +19,7 @@ __all__ = ('OutputPanel', 'UniqueById') -import gtk, gedit +import gtk, pluma import pango import gobject import os @@ -217,7 +217,7 @@ class OutputPanel(UniqueById): gfile = self.file_lookup.lookup(link.path) if gfile: - gedit.commands.load_uri(self.window, gfile.get_uri(), None, + pluma.commands.load_uri(self.window, gfile.get_uri(), None, link.line_nr) gobject.idle_add(self.idle_grab_focus) diff --git a/plugins/externaltools/tools/tools.ui b/plugins/externaltools/tools/tools.ui index dff7d192..8b40ad98 100755 --- a/plugins/externaltools/tools/tools.ui +++ b/plugins/externaltools/tools/tools.ui @@ -122,7 +122,7 @@ </row> </data> </object> - <object class="GeditDocument" id="commands_buffer"> + <object class="PlumaDocument" id="commands_buffer"> <property name="highlight-matching-brackets">True</property> </object> <object class="GtkDialog" id="tool-manager-dialog"> @@ -517,7 +517,7 @@ <property name="vscrollbar_policy">automatic</property> <property name="shadow_type">in</property> <child> - <object class="GeditView" id="commands"> + <object class="PlumaView" id="commands"> <property name="buffer">commands_buffer</property> <property name="visible">True</property> <property name="auto-indent">True</property> diff --git a/plugins/filebrowser/Makefile.am b/plugins/filebrowser/Makefile.am index 22301d5b..6791255a 100755 --- a/plugins/filebrowser/Makefile.am +++ b/plugins/filebrowser/Makefile.am @@ -1,72 +1,72 @@ # filebrowser -plugindir = $(GEDIT_PLUGINS_LIBS_DIR) +plugindir = $(PLUMA_PLUGINS_LIBS_DIR) INCLUDES = \ -I$(top_srcdir) \ - $(GEDIT_CFLAGS) \ + $(PLUMA_CFLAGS) \ $(WARN_CFLAGS) \ $(DISABLE_DEPRECATED_CFLAGS) BUILT_SOURCES = \ - gedit-file-browser-enum-types.h \ - gedit-file-browser-enum-types.c \ - gedit-file-browser-marshal.h \ - gedit-file-browser-marshal.c + pluma-file-browser-enum-types.h \ + pluma-file-browser-enum-types.c \ + pluma-file-browser-marshal.h \ + pluma-file-browser-marshal.c plugin_LTLIBRARIES = libfilebrowser.la NOINST_H_FILES = \ - gedit-file-bookmarks-store.h \ - gedit-file-browser-store.h \ - gedit-file-browser-view.h \ - gedit-file-browser-widget.h \ - gedit-file-browser-error.h \ - gedit-file-browser-utils.h \ - gedit-file-browser-plugin.h \ - gedit-file-browser-messages.h + pluma-file-bookmarks-store.h \ + pluma-file-browser-store.h \ + pluma-file-browser-view.h \ + pluma-file-browser-widget.h \ + pluma-file-browser-error.h \ + pluma-file-browser-utils.h \ + pluma-file-browser-plugin.h \ + pluma-file-browser-messages.h libfilebrowser_la_SOURCES = \ $(BUILT_SOURCES) \ - gedit-file-bookmarks-store.c \ - gedit-file-browser-store.c \ - gedit-file-browser-view.c \ - gedit-file-browser-widget.c \ - gedit-file-browser-utils.c \ - gedit-file-browser-plugin.c \ - gedit-file-browser-messages.c \ + pluma-file-bookmarks-store.c \ + pluma-file-browser-store.c \ + pluma-file-browser-view.c \ + pluma-file-browser-widget.c \ + pluma-file-browser-utils.c \ + pluma-file-browser-plugin.c \ + pluma-file-browser-messages.c \ $(NOINST_H_FILES) libfilebrowser_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS) -libfilebrowser_la_LIBADD = $(GEDIT_LIBS) +libfilebrowser_la_LIBADD = $(PLUMA_LIBS) # UI files (if you use ui for your plugin, list those files here) -uidir = $(GEDIT_PLUGINS_DATA_DIR)/filebrowser -ui_DATA = gedit-file-browser-widget-ui.xml +uidir = $(PLUMA_PLUGINS_DATA_DIR)/filebrowser +ui_DATA = pluma-file-browser-widget-ui.xml -plugin_in_files = filebrowser.gedit-plugin.desktop.in +plugin_in_files = filebrowser.pluma-plugin.desktop.in -%.gedit-plugin: %.gedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache +%.pluma-plugin: %.pluma-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache -gedit-file-browser-enum-types.h: gedit-file-browser-enum-types.h.template $(NOINST_H_FILES) $(GLIB_MKENUMS) - (cd $(srcdir) && $(GLIB_MKENUMS) --template gedit-file-browser-enum-types.h.template $(NOINST_H_FILES)) > $@ +pluma-file-browser-enum-types.h: pluma-file-browser-enum-types.h.template $(NOINST_H_FILES) $(GLIB_MKENUMS) + (cd $(srcdir) && $(GLIB_MKENUMS) --template pluma-file-browser-enum-types.h.template $(NOINST_H_FILES)) > $@ -gedit-file-browser-enum-types.c: gedit-file-browser-enum-types.c.template gedit-file-browser-enum-register.c.template $(NOINST_H_FILES) $(GLIB_MKENUMS) +pluma-file-browser-enum-types.c: pluma-file-browser-enum-types.c.template pluma-file-browser-enum-register.c.template $(NOINST_H_FILES) $(GLIB_MKENUMS) $(AM_V_GEN) (cd $(srcdir) && \ - $(GLIB_MKENUMS) --template gedit-file-browser-enum-types.c.template $(NOINST_H_FILES) && \ - $(GLIB_MKENUMS) --template gedit-file-browser-enum-register.c.template $(NOINST_H_FILES)) > $@ + $(GLIB_MKENUMS) --template pluma-file-browser-enum-types.c.template $(NOINST_H_FILES) && \ + $(GLIB_MKENUMS) --template pluma-file-browser-enum-register.c.template $(NOINST_H_FILES)) > $@ -gedit-file-browser-marshal.h: gedit-file-browser-marshal.list $(GLIB_GENMARSHAL) - $(AM_V_GEN) $(GLIB_GENMARSHAL) $< --header --prefix=gedit_file_browser_marshal > $@ +pluma-file-browser-marshal.h: pluma-file-browser-marshal.list $(GLIB_GENMARSHAL) + $(AM_V_GEN) $(GLIB_GENMARSHAL) $< --header --prefix=pluma_file_browser_marshal > $@ -gedit-file-browser-marshal.c: gedit-file-browser-marshal.list $(GLIB_GENMARSHAL) - $(AM_V_GEN) echo "#include \"gedit-file-browser-marshal.h\"" > $@ && \ - $(GLIB_GENMARSHAL) $< --body --prefix=gedit_file_browser_marshal >> $@ +pluma-file-browser-marshal.c: pluma-file-browser-marshal.list $(GLIB_GENMARSHAL) + $(AM_V_GEN) echo "#include \"pluma-file-browser-marshal.h\"" > $@ && \ + $(GLIB_GENMARSHAL) $< --body --prefix=pluma_file_browser_marshal >> $@ -plugin_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin) +plugin_DATA = $(plugin_in_files:.pluma-plugin.desktop.in=.pluma-plugin) schemasdir = $(MATECONF_SCHEMA_FILE_DIR) -schemas_in_files = gedit-file-browser.schemas.in +schemas_in_files = pluma-file-browser.schemas.in schemas_DATA = $(schemas_in_files:.schemas.in=.schemas) @INTLTOOL_SCHEMAS_RULE@ @@ -86,10 +86,10 @@ EXTRA_DIST = \ $(ui_DATA) \ $(plugin_in_files) \ $(schemas_in_files) \ - gedit-file-browser-enum-types.h.template \ - gedit-file-browser-enum-types.c.template \ - gedit-file-browser-enum-register.c.template \ - gedit-file-browser-marshal.list + pluma-file-browser-enum-types.h.template \ + pluma-file-browser-enum-types.c.template \ + pluma-file-browser-enum-register.c.template \ + pluma-file-browser-marshal.list CLEANFILES = \ $(plugin_DATA) \ diff --git a/plugins/filebrowser/filebrowser.gedit-plugin.desktop.in b/plugins/filebrowser/filebrowser.pluma-plugin.desktop.in index 808816c5..bf328f7a 100755 --- a/plugins/filebrowser/filebrowser.gedit-plugin.desktop.in +++ b/plugins/filebrowser/filebrowser.pluma-plugin.desktop.in @@ -1,4 +1,4 @@ -[Gedit Plugin] +[Pluma Plugin] Loader=C Module=filebrowser IAge=2 @@ -7,4 +7,4 @@ _Description=Easy file access from the side pane Icon=system-file-manager Authors=Jesse van den Kieboom <[email protected]> Copyright=Copyright © 2006 Jesse van den Kieboom -Website=http://www.gedit.org +Website=http://www.pluma.org diff --git a/plugins/filebrowser/gedit-file-bookmarks-store.h b/plugins/filebrowser/gedit-file-bookmarks-store.h deleted file mode 100755 index bd20911e..00000000 --- a/plugins/filebrowser/gedit-file-bookmarks-store.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * gedit-file-bookmarks-store.h - Gedit plugin providing easy file access - * from the sidepanel - * - * Copyright (C) 2006 - Jesse van den Kieboom <[email protected]> - * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef __GEDIT_FILE_BOOKMARKS_STORE_H__ -#define __GEDIT_FILE_BOOKMARKS_STORE_H__ - -#include <gtk/gtk.h> - -G_BEGIN_DECLS -#define GEDIT_TYPE_FILE_BOOKMARKS_STORE (gedit_file_bookmarks_store_get_type ()) -#define GEDIT_FILE_BOOKMARKS_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_FILE_BOOKMARKS_STORE, GeditFileBookmarksStore)) -#define GEDIT_FILE_BOOKMARKS_STORE_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_FILE_BOOKMARKS_STORE, GeditFileBookmarksStore const)) -#define GEDIT_FILE_BOOKMARKS_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_FILE_BOOKMARKS_STORE, GeditFileBookmarksStoreClass)) -#define GEDIT_IS_FILE_BOOKMARKS_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_FILE_BOOKMARKS_STORE)) -#define GEDIT_IS_FILE_BOOKMARKS_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_FILE_BOOKMARKS_STORE)) -#define GEDIT_FILE_BOOKMARKS_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_FILE_BOOKMARKS_STORE, GeditFileBookmarksStoreClass)) - -typedef struct _GeditFileBookmarksStore GeditFileBookmarksStore; -typedef struct _GeditFileBookmarksStoreClass GeditFileBookmarksStoreClass; -typedef struct _GeditFileBookmarksStorePrivate GeditFileBookmarksStorePrivate; - -enum -{ - GEDIT_FILE_BOOKMARKS_STORE_COLUMN_ICON = 0, - GEDIT_FILE_BOOKMARKS_STORE_COLUMN_NAME, - GEDIT_FILE_BOOKMARKS_STORE_COLUMN_OBJECT, - GEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, - GEDIT_FILE_BOOKMARKS_STORE_N_COLUMNS -}; - -enum -{ - GEDIT_FILE_BOOKMARKS_STORE_NONE = 0, - GEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR = 1 << 0, /* Separator item */ - GEDIT_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR = 1 << 1, /* Special user dir */ - GEDIT_FILE_BOOKMARKS_STORE_IS_HOME = 1 << 2, /* The special Home user directory */ - GEDIT_FILE_BOOKMARKS_STORE_IS_DESKTOP = 1 << 3, /* The special Desktop user directory */ - GEDIT_FILE_BOOKMARKS_STORE_IS_DOCUMENTS = 1 << 4, /* The special Documents user directory */ - GEDIT_FILE_BOOKMARKS_STORE_IS_FS = 1 << 5, /* A mount object */ - GEDIT_FILE_BOOKMARKS_STORE_IS_MOUNT = 1 << 6, /* A mount object */ - GEDIT_FILE_BOOKMARKS_STORE_IS_VOLUME = 1 << 7, /* A volume object */ - GEDIT_FILE_BOOKMARKS_STORE_IS_DRIVE = 1 << 8, /* A drive object */ - GEDIT_FILE_BOOKMARKS_STORE_IS_ROOT = 1 << 9, /* The root file system (file:///) */ - GEDIT_FILE_BOOKMARKS_STORE_IS_BOOKMARK = 1 << 10, /* A gtk bookmark */ - GEDIT_FILE_BOOKMARKS_STORE_IS_REMOTE_BOOKMARK = 1 << 11, /* A remote gtk bookmark */ - GEDIT_FILE_BOOKMARKS_STORE_IS_LOCAL_BOOKMARK = 1 << 12 /* A local gtk bookmark */ -}; - -struct _GeditFileBookmarksStore -{ - GtkTreeStore parent; - - GeditFileBookmarksStorePrivate *priv; -}; - -struct _GeditFileBookmarksStoreClass -{ - GtkTreeStoreClass parent_class; -}; - -GType gedit_file_bookmarks_store_get_type (void) G_GNUC_CONST; -GType gedit_file_bookmarks_store_register_type (GTypeModule * module); - -GeditFileBookmarksStore *gedit_file_bookmarks_store_new (void); -gchar *gedit_file_bookmarks_store_get_uri (GeditFileBookmarksStore * model, - GtkTreeIter * iter); -void gedit_file_bookmarks_store_refresh (GeditFileBookmarksStore * model); - -G_END_DECLS -#endif /* __GEDIT_FILE_BOOKMARKS_STORE_H__ */ - -// ex:ts=8:noet: diff --git a/plugins/filebrowser/gedit-file-browser-plugin.h b/plugins/filebrowser/gedit-file-browser-plugin.h deleted file mode 100755 index 19ca86bf..00000000 --- a/plugins/filebrowser/gedit-file-browser-plugin.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * gedit-file-browser-plugin.h - Gedit plugin providing easy file access - * from the sidepanel - * - * Copyright (C) 2006 - Jesse van den Kieboom <[email protected]> - * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef __GEDIT_FILE_BROWSER_PLUGIN_H__ -#define __GEDIT_FILE_BROWSER_PLUGIN_H__ - -#include <glib.h> -#include <glib-object.h> -#include <gedit/gedit-plugin.h> - -G_BEGIN_DECLS -/* - * Type checking and casting macros - */ -#define GEDIT_TYPE_FILE_BROWSER_PLUGIN (filetree_plugin_get_type ()) -#define GEDIT_FILE_BROWSER_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GEDIT_TYPE_FILE_BROWSER_PLUGIN, GeditFileBrowserPlugin)) -#define GEDIT_FILE_BROWSER_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GEDIT_TYPE_FILE_BROWSER_PLUGIN, GeditFileBrowserPluginClass)) -#define GEDIT_IS_FILE_BROWSER_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GEDIT_TYPE_FILE_BROWSER_PLUGIN)) -#define GEDIT_IS_FILE_BROWSER_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GEDIT_TYPE_FILE_BROWSER_PLUGIN)) -#define GEDIT_FILE_BROWSER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GEDIT_TYPE_FILE_BROWSER_PLUGIN, GeditFileBrowserPluginClass)) - -/* Private structure type */ -typedef struct _GeditFileBrowserPluginPrivate GeditFileBrowserPluginPrivate; -typedef struct _GeditFileBrowserPlugin GeditFileBrowserPlugin; -typedef struct _GeditFileBrowserPluginClass GeditFileBrowserPluginClass; - -struct _GeditFileBrowserPlugin -{ - GeditPlugin parent_instance; - - /*< private > */ - GeditFileBrowserPluginPrivate *priv; -}; - - - -struct _GeditFileBrowserPluginClass -{ - GeditPluginClass parent_class; -}; - -/* - * Public methods - */ -GType filetree_plugin_get_type (void) G_GNUC_CONST; - -/* All the plugins must implement this function */ -G_MODULE_EXPORT GType register_gedit_plugin (GTypeModule * module); - -G_END_DECLS -#endif /* __GEDIT_FILE_BROWSER_PLUGIN_H__ */ - -// ex:ts=8:noet: diff --git a/plugins/filebrowser/gedit-file-browser-store.h b/plugins/filebrowser/gedit-file-browser-store.h deleted file mode 100755 index f31da327..00000000 --- a/plugins/filebrowser/gedit-file-browser-store.h +++ /dev/null @@ -1,200 +0,0 @@ -/* - * gedit-file-browser-store.h - Gedit plugin providing easy file access - * from the sidepanel - * - * Copyright (C) 2006 - Jesse van den Kieboom <[email protected]> - * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef __GEDIT_FILE_BROWSER_STORE_H__ -#define __GEDIT_FILE_BROWSER_STORE_H__ - -#include <gtk/gtk.h> - -G_BEGIN_DECLS -#define GEDIT_TYPE_FILE_BROWSER_STORE (gedit_file_browser_store_get_type ()) -#define GEDIT_FILE_BROWSER_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_FILE_BROWSER_STORE, GeditFileBrowserStore)) -#define GEDIT_FILE_BROWSER_STORE_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_FILE_BROWSER_STORE, GeditFileBrowserStore const)) -#define GEDIT_FILE_BROWSER_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_FILE_BROWSER_STORE, GeditFileBrowserStoreClass)) -#define GEDIT_IS_FILE_BROWSER_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_FILE_BROWSER_STORE)) -#define GEDIT_IS_FILE_BROWSER_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_FILE_BROWSER_STORE)) -#define GEDIT_FILE_BROWSER_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_FILE_BROWSER_STORE, GeditFileBrowserStoreClass)) - -typedef enum -{ - GEDIT_FILE_BROWSER_STORE_COLUMN_ICON = 0, - GEDIT_FILE_BROWSER_STORE_COLUMN_NAME, - GEDIT_FILE_BROWSER_STORE_COLUMN_URI, - GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, - GEDIT_FILE_BROWSER_STORE_COLUMN_EMBLEM, - GEDIT_FILE_BROWSER_STORE_COLUMN_NUM -} GeditFileBrowserStoreColumn; - -typedef enum -{ - GEDIT_FILE_BROWSER_STORE_FLAG_IS_DIRECTORY = 1 << 0, - GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN = 1 << 1, - GEDIT_FILE_BROWSER_STORE_FLAG_IS_TEXT = 1 << 2, - GEDIT_FILE_BROWSER_STORE_FLAG_LOADED = 1 << 3, - GEDIT_FILE_BROWSER_STORE_FLAG_IS_FILTERED = 1 << 4, - GEDIT_FILE_BROWSER_STORE_FLAG_IS_DUMMY = 1 << 5 -} GeditFileBrowserStoreFlag; - -typedef enum -{ - GEDIT_FILE_BROWSER_STORE_RESULT_OK, - GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE, - GEDIT_FILE_BROWSER_STORE_RESULT_ERROR, - GEDIT_FILE_BROWSER_STORE_RESULT_NO_TRASH, - GEDIT_FILE_BROWSER_STORE_RESULT_MOUNTING, - GEDIT_FILE_BROWSER_STORE_RESULT_NUM -} GeditFileBrowserStoreResult; - -typedef enum -{ - GEDIT_FILE_BROWSER_STORE_FILTER_MODE_NONE = 0, - GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN = 1 << 0, - GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY = 1 << 1 -} GeditFileBrowserStoreFilterMode; - -#define FILE_IS_DIR(flags) (flags & GEDIT_FILE_BROWSER_STORE_FLAG_IS_DIRECTORY) -#define FILE_IS_HIDDEN(flags) (flags & GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN) -#define FILE_IS_TEXT(flags) (flags & GEDIT_FILE_BROWSER_STORE_FLAG_IS_TEXT) -#define FILE_LOADED(flags) (flags & GEDIT_FILE_BROWSER_STORE_FLAG_LOADED) -#define FILE_IS_FILTERED(flags) (flags & GEDIT_FILE_BROWSER_STORE_FLAG_IS_FILTERED) -#define FILE_IS_DUMMY(flags) (flags & GEDIT_FILE_BROWSER_STORE_FLAG_IS_DUMMY) - -typedef struct _GeditFileBrowserStore GeditFileBrowserStore; -typedef struct _GeditFileBrowserStoreClass GeditFileBrowserStoreClass; -typedef struct _GeditFileBrowserStorePrivate GeditFileBrowserStorePrivate; - -typedef gboolean (*GeditFileBrowserStoreFilterFunc) (GeditFileBrowserStore - * model, - GtkTreeIter * iter, - gpointer user_data); - -struct _GeditFileBrowserStore -{ - GObject parent; - - GeditFileBrowserStorePrivate *priv; -}; - -struct _GeditFileBrowserStoreClass { - GObjectClass parent_class; - - /* Signals */ - void (*begin_loading) (GeditFileBrowserStore * model, - GtkTreeIter * iter); - void (*end_loading) (GeditFileBrowserStore * model, - GtkTreeIter * iter); - void (*error) (GeditFileBrowserStore * model, - guint code, - gchar * message); - gboolean (*no_trash) (GeditFileBrowserStore * model, - GList * files); - void (*rename) (GeditFileBrowserStore * model, - const gchar * olduri, - const gchar * newuri); - void (*begin_refresh) (GeditFileBrowserStore * model); - void (*end_refresh) (GeditFileBrowserStore * model); - void (*unload) (GeditFileBrowserStore * model, - const gchar * uri); -}; - -GType gedit_file_browser_store_get_type (void) G_GNUC_CONST; -GType gedit_file_browser_store_register_type (GTypeModule * module); - -GeditFileBrowserStore *gedit_file_browser_store_new (gchar const *root); - -GeditFileBrowserStoreResult -gedit_file_browser_store_set_root_and_virtual_root (GeditFileBrowserStore * model, - gchar const *root, - gchar const *virtual_root); -GeditFileBrowserStoreResult -gedit_file_browser_store_set_root (GeditFileBrowserStore * model, - gchar const *root); -GeditFileBrowserStoreResult -gedit_file_browser_store_set_virtual_root (GeditFileBrowserStore * model, - GtkTreeIter * iter); -GeditFileBrowserStoreResult -gedit_file_browser_store_set_virtual_root_from_string (GeditFileBrowserStore * model, - gchar const *root); -GeditFileBrowserStoreResult -gedit_file_browser_store_set_virtual_root_up (GeditFileBrowserStore * model); -GeditFileBrowserStoreResult -gedit_file_browser_store_set_virtual_root_top (GeditFileBrowserStore * model); - -gboolean -gedit_file_browser_store_get_iter_virtual_root (GeditFileBrowserStore * model, - GtkTreeIter * iter); -gboolean gedit_file_browser_store_get_iter_root (GeditFileBrowserStore * model, - GtkTreeIter * iter); -gchar * gedit_file_browser_store_get_root (GeditFileBrowserStore * model); -gchar * gedit_file_browser_store_get_virtual_root (GeditFileBrowserStore * model); - -gboolean gedit_file_browser_store_iter_equal (GeditFileBrowserStore * model, - GtkTreeIter * iter1, - GtkTreeIter * iter2); - -void gedit_file_browser_store_set_value (GeditFileBrowserStore * tree_model, - GtkTreeIter * iter, - gint column, - GValue * value); - -void _gedit_file_browser_store_iter_expanded (GeditFileBrowserStore * model, - GtkTreeIter * iter); -void _gedit_file_browser_store_iter_collapsed (GeditFileBrowserStore * model, - GtkTreeIter * iter); - -GeditFileBrowserStoreFilterMode -gedit_file_browser_store_get_filter_mode (GeditFileBrowserStore * model); -void gedit_file_browser_store_set_filter_mode (GeditFileBrowserStore * model, - GeditFileBrowserStoreFilterMode mode); -void gedit_file_browser_store_set_filter_func (GeditFileBrowserStore * model, - GeditFileBrowserStoreFilterFunc func, - gpointer user_data); -void gedit_file_browser_store_refilter (GeditFileBrowserStore * model); -GeditFileBrowserStoreFilterMode -gedit_file_browser_store_filter_mode_get_default (void); - -void gedit_file_browser_store_refresh (GeditFileBrowserStore * model); -gboolean gedit_file_browser_store_rename (GeditFileBrowserStore * model, - GtkTreeIter * iter, - gchar const *new_name, - GError ** error); -GeditFileBrowserStoreResult -gedit_file_browser_store_delete (GeditFileBrowserStore * model, - GtkTreeIter * iter, - gboolean trash); -GeditFileBrowserStoreResult -gedit_file_browser_store_delete_all (GeditFileBrowserStore * model, - GList *rows, - gboolean trash); - -gboolean gedit_file_browser_store_new_file (GeditFileBrowserStore * model, - GtkTreeIter * parent, - GtkTreeIter * iter); -gboolean gedit_file_browser_store_new_directory (GeditFileBrowserStore * model, - GtkTreeIter * parent, - GtkTreeIter * iter); - -void gedit_file_browser_store_cancel_mount_operation (GeditFileBrowserStore *store); - -G_END_DECLS -#endif /* __GEDIT_FILE_BROWSER_STORE_H__ */ - -// ex:ts=8:noet: diff --git a/plugins/filebrowser/gedit-file-browser-view.h b/plugins/filebrowser/gedit-file-browser-view.h deleted file mode 100755 index a5ada255..00000000 --- a/plugins/filebrowser/gedit-file-browser-view.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * gedit-file-browser-view.h - Gedit plugin providing easy file access - * from the sidepanel - * - * Copyright (C) 2006 - Jesse van den Kieboom <[email protected]> - * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef __GEDIT_FILE_BROWSER_VIEW_H__ -#define __GEDIT_FILE_BROWSER_VIEW_H__ - -#include <gtk/gtk.h> - -G_BEGIN_DECLS -#define GEDIT_TYPE_FILE_BROWSER_VIEW (gedit_file_browser_view_get_type ()) -#define GEDIT_FILE_BROWSER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_FILE_BROWSER_VIEW, GeditFileBrowserView)) -#define GEDIT_FILE_BROWSER_VIEW_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_FILE_BROWSER_VIEW, GeditFileBrowserView const)) -#define GEDIT_FILE_BROWSER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_FILE_BROWSER_VIEW, GeditFileBrowserViewClass)) -#define GEDIT_IS_FILE_BROWSER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_FILE_BROWSER_VIEW)) -#define GEDIT_IS_FILE_BROWSER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_FILE_BROWSER_VIEW)) -#define GEDIT_FILE_BROWSER_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_FILE_BROWSER_VIEW, GeditFileBrowserViewClass)) - -typedef struct _GeditFileBrowserView GeditFileBrowserView; -typedef struct _GeditFileBrowserViewClass GeditFileBrowserViewClass; -typedef struct _GeditFileBrowserViewPrivate GeditFileBrowserViewPrivate; - -typedef enum { - GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE, - GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE -} GeditFileBrowserViewClickPolicy; - -struct _GeditFileBrowserView -{ - GtkTreeView parent; - - GeditFileBrowserViewPrivate *priv; -}; - -struct _GeditFileBrowserViewClass -{ - GtkTreeViewClass parent_class; - - /* Signals */ - void (*error) (GeditFileBrowserView * filetree, - guint code, - gchar const *message); - void (*file_activated) (GeditFileBrowserView * filetree, - GtkTreeIter *iter); - void (*directory_activated) (GeditFileBrowserView * filetree, - GtkTreeIter *iter); - void (*bookmark_activated) (GeditFileBrowserView * filetree, - GtkTreeIter *iter); -}; - -GType gedit_file_browser_view_get_type (void) G_GNUC_CONST; -GType gedit_file_browser_view_register_type (GTypeModule * module); - -GtkWidget *gedit_file_browser_view_new (void); -void gedit_file_browser_view_set_model (GeditFileBrowserView * tree_view, - GtkTreeModel * model); -void gedit_file_browser_view_start_rename (GeditFileBrowserView * tree_view, - GtkTreeIter * iter); -void gedit_file_browser_view_set_click_policy (GeditFileBrowserView * tree_view, - GeditFileBrowserViewClickPolicy policy); -void gedit_file_browser_view_set_restore_expand_state (GeditFileBrowserView * tree_view, - gboolean restore_expand_state); - -G_END_DECLS -#endif /* __GEDIT_FILE_BROWSER_VIEW_H__ */ - -// ex:ts=8:noet: diff --git a/plugins/filebrowser/gedit-file-browser-widget.h b/plugins/filebrowser/gedit-file-browser-widget.h deleted file mode 100755 index e9cc2a0e..00000000 --- a/plugins/filebrowser/gedit-file-browser-widget.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * gedit-file-browser-widget.h - Gedit plugin providing easy file access - * from the sidepanel - * - * Copyright (C) 2006 - Jesse van den Kieboom <[email protected]> - * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef __GEDIT_FILE_BROWSER_WIDGET_H__ -#define __GEDIT_FILE_BROWSER_WIDGET_H__ - -#include <gtk/gtk.h> -#include "gedit-file-browser-store.h" -#include "gedit-file-bookmarks-store.h" -#include "gedit-file-browser-view.h" - -G_BEGIN_DECLS -#define GEDIT_TYPE_FILE_BROWSER_WIDGET (gedit_file_browser_widget_get_type ()) -#define GEDIT_FILE_BROWSER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_FILE_BROWSER_WIDGET, GeditFileBrowserWidget)) -#define GEDIT_FILE_BROWSER_WIDGET_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_FILE_BROWSER_WIDGET, GeditFileBrowserWidget const)) -#define GEDIT_FILE_BROWSER_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_FILE_BROWSER_WIDGET, GeditFileBrowserWidgetClass)) -#define GEDIT_IS_FILE_BROWSER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_FILE_BROWSER_WIDGET)) -#define GEDIT_IS_FILE_BROWSER_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_FILE_BROWSER_WIDGET)) -#define GEDIT_FILE_BROWSER_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_FILE_BROWSER_WIDGET, GeditFileBrowserWidgetClass)) - -typedef struct _GeditFileBrowserWidget GeditFileBrowserWidget; -typedef struct _GeditFileBrowserWidgetClass GeditFileBrowserWidgetClass; -typedef struct _GeditFileBrowserWidgetPrivate GeditFileBrowserWidgetPrivate; - -typedef -gboolean (*GeditFileBrowserWidgetFilterFunc) (GeditFileBrowserWidget * obj, - GeditFileBrowserStore * - model, GtkTreeIter * iter, - gpointer user_data); - -struct _GeditFileBrowserWidget -{ - GtkVBox parent; - - GeditFileBrowserWidgetPrivate *priv; -}; - -struct _GeditFileBrowserWidgetClass -{ - GtkVBoxClass parent_class; - - /* Signals */ - void (*uri_activated) (GeditFileBrowserWidget * widget, - gchar const *uri); - void (*error) (GeditFileBrowserWidget * widget, - guint code, - gchar const *message); - gboolean (*confirm_delete) (GeditFileBrowserWidget * widget, - GeditFileBrowserStore * model, - GList *list); - gboolean (*confirm_no_trash) (GeditFileBrowserWidget * widget, - GList *list); -}; - -GType gedit_file_browser_widget_get_type (void) G_GNUC_CONST; -GType gedit_file_browser_widget_register_type (GTypeModule * module); - -GtkWidget *gedit_file_browser_widget_new (const gchar *data_dir); - -void gedit_file_browser_widget_show_bookmarks (GeditFileBrowserWidget * obj); -void gedit_file_browser_widget_show_files (GeditFileBrowserWidget * obj); - -void gedit_file_browser_widget_set_root (GeditFileBrowserWidget * obj, - gchar const *root, - gboolean virtual_root); -void -gedit_file_browser_widget_set_root_and_virtual_root (GeditFileBrowserWidget * obj, - gchar const *root, - gchar const *virtual_root); - -gboolean -gedit_file_browser_widget_get_selected_directory (GeditFileBrowserWidget * obj, - GtkTreeIter * iter); - -GeditFileBrowserStore * -gedit_file_browser_widget_get_browser_store (GeditFileBrowserWidget * obj); -GeditFileBookmarksStore * -gedit_file_browser_widget_get_bookmarks_store (GeditFileBrowserWidget * obj); -GeditFileBrowserView * -gedit_file_browser_widget_get_browser_view (GeditFileBrowserWidget * obj); -GtkWidget * -gedit_file_browser_widget_get_filter_entry (GeditFileBrowserWidget * obj); - -GtkUIManager * -gedit_file_browser_widget_get_ui_manager (GeditFileBrowserWidget * obj); - -gulong gedit_file_browser_widget_add_filter (GeditFileBrowserWidget * obj, - GeditFileBrowserWidgetFilterFunc func, - gpointer user_data, - GDestroyNotify notify); -void gedit_file_browser_widget_remove_filter (GeditFileBrowserWidget * obj, - gulong id); -void gedit_file_browser_widget_set_filter_pattern (GeditFileBrowserWidget * obj, - gchar const *pattern); - -void gedit_file_browser_widget_refresh (GeditFileBrowserWidget * obj); -void gedit_file_browser_widget_history_back (GeditFileBrowserWidget * obj); -void gedit_file_browser_widget_history_forward (GeditFileBrowserWidget * obj); - -G_END_DECLS -#endif /* __GEDIT_FILE_BROWSER_WIDGET_H__ */ - -// ex:ts=8:noet: diff --git a/plugins/filebrowser/gedit-file-bookmarks-store.c b/plugins/filebrowser/pluma-file-bookmarks-store.c index 86e7f0c8..19def257 100755 --- a/plugins/filebrowser/gedit-file-bookmarks-store.c +++ b/plugins/filebrowser/pluma-file-bookmarks-store.c @@ -1,5 +1,5 @@ /* - * gedit-file-bookmarks-store.c - Gedit plugin providing easy file access + * pluma-file-bookmarks-store.c - Pluma plugin providing easy file access * from the sidepanel * * Copyright (C) 2006 - Jesse van den Kieboom <[email protected]> @@ -22,17 +22,17 @@ #include <string.h> #include <glib/gi18n.h> #include <gio/gio.h> -#include <gedit/gedit-utils.h> -#include <gedit/gedit-plugin.h> +#include <pluma/pluma-utils.h> +#include <pluma/pluma-plugin.h> -#include "gedit-file-bookmarks-store.h" -#include "gedit-file-browser-utils.h" +#include "pluma-file-bookmarks-store.h" +#include "pluma-file-browser-utils.h" -#define GEDIT_FILE_BOOKMARKS_STORE_GET_PRIVATE(object)( \ - G_TYPE_INSTANCE_GET_PRIVATE((object), GEDIT_TYPE_FILE_BOOKMARKS_STORE, \ - GeditFileBookmarksStorePrivate)) +#define PLUMA_FILE_BOOKMARKS_STORE_GET_PRIVATE(object)( \ + G_TYPE_INSTANCE_GET_PRIVATE((object), PLUMA_TYPE_FILE_BOOKMARKS_STORE, \ + PlumaFileBookmarksStorePrivate)) -struct _GeditFileBookmarksStorePrivate +struct _PlumaFileBookmarksStorePrivate { GVolumeMonitor * volume_monitor; GFileMonitor * bookmarks_monitor; @@ -43,25 +43,25 @@ static void remove_node (GtkTreeModel * model, static void on_fs_changed (GVolumeMonitor *monitor, GObject *object, - GeditFileBookmarksStore *model); + PlumaFileBookmarksStore *model); static void on_bookmarks_file_changed (GFileMonitor * monitor, GFile * file, GFile * other_file, GFileMonitorEvent event_type, - GeditFileBookmarksStore * model); + PlumaFileBookmarksStore * model); static gboolean find_with_flags (GtkTreeModel * model, GtkTreeIter * iter, gpointer obj, guint flags, guint notflags); -GEDIT_PLUGIN_DEFINE_TYPE(GeditFileBookmarksStore, gedit_file_bookmarks_store, GTK_TYPE_TREE_STORE) +PLUMA_PLUGIN_DEFINE_TYPE(PlumaFileBookmarksStore, pluma_file_bookmarks_store, GTK_TYPE_TREE_STORE) static void -gedit_file_bookmarks_store_dispose (GObject * object) +pluma_file_bookmarks_store_dispose (GObject * object) { - GeditFileBookmarksStore *obj = GEDIT_FILE_BOOKMARKS_STORE (object); + PlumaFileBookmarksStore *obj = PLUMA_FILE_BOOKMARKS_STORE (object); if (obj->priv->volume_monitor != NULL) { g_signal_handlers_disconnect_by_func (obj->priv->volume_monitor, @@ -77,35 +77,35 @@ gedit_file_bookmarks_store_dispose (GObject * object) obj->priv->bookmarks_monitor = NULL; } - G_OBJECT_CLASS (gedit_file_bookmarks_store_parent_class)->dispose (object); + G_OBJECT_CLASS (pluma_file_bookmarks_store_parent_class)->dispose (object); } static void -gedit_file_bookmarks_store_finalize (GObject * object) +pluma_file_bookmarks_store_finalize (GObject * object) { - G_OBJECT_CLASS (gedit_file_bookmarks_store_parent_class)->finalize (object); + G_OBJECT_CLASS (pluma_file_bookmarks_store_parent_class)->finalize (object); } static void -gedit_file_bookmarks_store_class_init (GeditFileBookmarksStoreClass *klass) +pluma_file_bookmarks_store_class_init (PlumaFileBookmarksStoreClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - object_class->dispose = gedit_file_bookmarks_store_dispose; - object_class->finalize = gedit_file_bookmarks_store_finalize; + object_class->dispose = pluma_file_bookmarks_store_dispose; + object_class->finalize = pluma_file_bookmarks_store_finalize; - g_type_class_add_private (object_class, sizeof (GeditFileBookmarksStorePrivate)); + g_type_class_add_private (object_class, sizeof (PlumaFileBookmarksStorePrivate)); } static void -gedit_file_bookmarks_store_init (GeditFileBookmarksStore * obj) +pluma_file_bookmarks_store_init (PlumaFileBookmarksStore * obj) { - obj->priv = GEDIT_FILE_BOOKMARKS_STORE_GET_PRIVATE (obj); + obj->priv = PLUMA_FILE_BOOKMARKS_STORE_GET_PRIVATE (obj); } /* Private */ static void -add_node (GeditFileBookmarksStore *model, +add_node (PlumaFileBookmarksStore *model, GdkPixbuf *pixbuf, const gchar *name, GObject *obj, @@ -117,10 +117,10 @@ add_node (GeditFileBookmarksStore *model, gtk_tree_store_append (GTK_TREE_STORE (model), &newiter, NULL); gtk_tree_store_set (GTK_TREE_STORE (model), &newiter, - GEDIT_FILE_BOOKMARKS_STORE_COLUMN_ICON, pixbuf, - GEDIT_FILE_BOOKMARKS_STORE_COLUMN_NAME, name, - GEDIT_FILE_BOOKMARKS_STORE_COLUMN_OBJECT, obj, - GEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, flags, + PLUMA_FILE_BOOKMARKS_STORE_COLUMN_ICON, pixbuf, + PLUMA_FILE_BOOKMARKS_STORE_COLUMN_NAME, name, + PLUMA_FILE_BOOKMARKS_STORE_COLUMN_OBJECT, obj, + PLUMA_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, flags, -1); if (iter != NULL) @@ -128,7 +128,7 @@ add_node (GeditFileBookmarksStore *model, } static gboolean -add_file (GeditFileBookmarksStore *model, +add_file (PlumaFileBookmarksStore *model, GFile *file, const gchar *name, guint flags, @@ -144,24 +144,24 @@ add_file (GeditFileBookmarksStore *model, return FALSE; } - if (flags & GEDIT_FILE_BOOKMARKS_STORE_IS_HOME) - pixbuf = gedit_file_browser_utils_pixbuf_from_theme ("user-home", GTK_ICON_SIZE_MENU); - else if (flags & GEDIT_FILE_BOOKMARKS_STORE_IS_DESKTOP) - pixbuf = gedit_file_browser_utils_pixbuf_from_theme ("user-desktop", GTK_ICON_SIZE_MENU); - else if (flags & GEDIT_FILE_BOOKMARKS_STORE_IS_ROOT) - pixbuf = gedit_file_browser_utils_pixbuf_from_theme ("drive-harddisk", GTK_ICON_SIZE_MENU); + if (flags & PLUMA_FILE_BOOKMARKS_STORE_IS_HOME) + pixbuf = pluma_file_browser_utils_pixbuf_from_theme ("user-home", GTK_ICON_SIZE_MENU); + else if (flags & PLUMA_FILE_BOOKMARKS_STORE_IS_DESKTOP) + pixbuf = pluma_file_browser_utils_pixbuf_from_theme ("user-desktop", GTK_ICON_SIZE_MENU); + else if (flags & PLUMA_FILE_BOOKMARKS_STORE_IS_ROOT) + pixbuf = pluma_file_browser_utils_pixbuf_from_theme ("drive-harddisk", GTK_ICON_SIZE_MENU); if (pixbuf == NULL) { /* getting the icon is a sync get_info call, so we just do it for local files */ if (native) { - pixbuf = gedit_file_browser_utils_pixbuf_from_file (file, GTK_ICON_SIZE_MENU); + pixbuf = pluma_file_browser_utils_pixbuf_from_file (file, GTK_ICON_SIZE_MENU); } else { - pixbuf = gedit_file_browser_utils_pixbuf_from_theme ("folder", GTK_ICON_SIZE_MENU); + pixbuf = pluma_file_browser_utils_pixbuf_from_theme ("folder", GTK_ICON_SIZE_MENU); } } if (name == NULL) { - newname = gedit_file_browser_utils_file_basename (file); + newname = pluma_file_browser_utils_file_basename (file); } else { newname = g_strdup (name); } @@ -177,7 +177,7 @@ add_file (GeditFileBookmarksStore *model, } static void -check_mount_separator (GeditFileBookmarksStore * model, guint flags, +check_mount_separator (PlumaFileBookmarksStore * model, guint flags, gboolean added) { GtkTreeIter iter; @@ -186,12 +186,12 @@ check_mount_separator (GeditFileBookmarksStore * model, guint flags, found = find_with_flags (GTK_TREE_MODEL (model), &iter, NULL, flags | - GEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR, 0); + PLUMA_FILE_BOOKMARKS_STORE_IS_SEPARATOR, 0); if (added && !found) { /* Add the separator */ add_node (model, NULL, NULL, NULL, - flags | GEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR, + flags | PLUMA_FILE_BOOKMARKS_STORE_IS_SEPARATOR, NULL); } else if (!added && found) { remove_node (GTK_TREE_MODEL (model), &iter); @@ -199,7 +199,7 @@ check_mount_separator (GeditFileBookmarksStore * model, guint flags, } static void -init_special_directories (GeditFileBookmarksStore * model) +init_special_directories (PlumaFileBookmarksStore * model) { gchar const *path; GFile * file; @@ -208,8 +208,8 @@ init_special_directories (GeditFileBookmarksStore * model) if (path != NULL) { file = g_file_new_for_path (path); - add_file (model, file, NULL, GEDIT_FILE_BOOKMARKS_STORE_IS_HOME | - GEDIT_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR, NULL); + add_file (model, file, NULL, PLUMA_FILE_BOOKMARKS_STORE_IS_HOME | + PLUMA_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR, NULL); g_object_unref (file); } @@ -217,8 +217,8 @@ init_special_directories (GeditFileBookmarksStore * model) if (path != NULL) { file = g_file_new_for_path (path); - add_file (model, file, NULL, GEDIT_FILE_BOOKMARKS_STORE_IS_DESKTOP | - GEDIT_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR, NULL); + add_file (model, file, NULL, PLUMA_FILE_BOOKMARKS_STORE_IS_DESKTOP | + PLUMA_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR, NULL); g_object_unref (file); } @@ -226,16 +226,16 @@ init_special_directories (GeditFileBookmarksStore * model) if (path != NULL) { file = g_file_new_for_path (path); - add_file (model, file, NULL, GEDIT_FILE_BOOKMARKS_STORE_IS_DOCUMENTS | - GEDIT_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR, NULL); + add_file (model, file, NULL, PLUMA_FILE_BOOKMARKS_STORE_IS_DOCUMENTS | + PLUMA_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR, NULL); g_object_unref (file); } file = g_file_new_for_uri ("file:///"); - add_file (model, file, _("File System"), GEDIT_FILE_BOOKMARKS_STORE_IS_ROOT, NULL); + add_file (model, file, _("File System"), PLUMA_FILE_BOOKMARKS_STORE_IS_ROOT, NULL); g_object_unref (file); - check_mount_separator (model, GEDIT_FILE_BOOKMARKS_STORE_IS_ROOT, TRUE); + check_mount_separator (model, PLUMA_FILE_BOOKMARKS_STORE_IS_ROOT, TRUE); } static void @@ -246,7 +246,7 @@ get_fs_properties (gpointer fs, { GIcon *icon = NULL; - *flags = GEDIT_FILE_BOOKMARKS_STORE_IS_FS; + *flags = PLUMA_FILE_BOOKMARKS_STORE_IS_FS; *name = NULL; *pixbuf = NULL; @@ -255,33 +255,33 @@ get_fs_properties (gpointer fs, icon = g_drive_get_icon (G_DRIVE (fs)); *name = g_drive_get_name (G_DRIVE (fs)); - *flags |= GEDIT_FILE_BOOKMARKS_STORE_IS_DRIVE; + *flags |= PLUMA_FILE_BOOKMARKS_STORE_IS_DRIVE; } else if (G_IS_VOLUME (fs)) { icon = g_volume_get_icon (G_VOLUME (fs)); *name = g_volume_get_name (G_VOLUME (fs)); - *flags |= GEDIT_FILE_BOOKMARKS_STORE_IS_VOLUME; + *flags |= PLUMA_FILE_BOOKMARKS_STORE_IS_VOLUME; } else if (G_IS_MOUNT (fs)) { icon = g_mount_get_icon (G_MOUNT (fs)); *name = g_mount_get_name (G_MOUNT (fs)); - *flags |= GEDIT_FILE_BOOKMARKS_STORE_IS_MOUNT; + *flags |= PLUMA_FILE_BOOKMARKS_STORE_IS_MOUNT; } if (icon) { - *pixbuf = gedit_file_browser_utils_pixbuf_from_icon (icon, GTK_ICON_SIZE_MENU); + *pixbuf = pluma_file_browser_utils_pixbuf_from_icon (icon, GTK_ICON_SIZE_MENU); g_object_unref (icon); } } static void -add_fs (GeditFileBookmarksStore *model, +add_fs (PlumaFileBookmarksStore *model, gpointer fs, guint flags, GtkTreeIter *iter) @@ -297,15 +297,15 @@ add_fs (GeditFileBookmarksStore *model, g_object_unref (pixbuf); g_free (name); - check_mount_separator (model, GEDIT_FILE_BOOKMARKS_STORE_IS_FS, TRUE); + check_mount_separator (model, PLUMA_FILE_BOOKMARKS_STORE_IS_FS, TRUE); } static void process_volume_cb (GVolume *volume, - GeditFileBookmarksStore *model) + PlumaFileBookmarksStore *model) { GMount *mount; - guint flags = GEDIT_FILE_BOOKMARKS_STORE_NONE; + guint flags = PLUMA_FILE_BOOKMARKS_STORE_NONE; mount = g_volume_get_mount (volume); /* CHECK: should we use the LOCAL/REMOTE thing still? */ @@ -324,7 +324,7 @@ process_volume_cb (GVolume *volume, } static void -process_drive_novolumes (GeditFileBookmarksStore *model, +process_drive_novolumes (PlumaFileBookmarksStore *model, GDrive *drive) { if (g_drive_is_media_removable (drive) && @@ -335,13 +335,13 @@ process_drive_novolumes (GeditFileBookmarksStore *model, drives where media detection fails. We show the drive and poll for media when the user activates it */ - add_fs (model, drive, GEDIT_FILE_BOOKMARKS_STORE_NONE, NULL); + add_fs (model, drive, PLUMA_FILE_BOOKMARKS_STORE_NONE, NULL); } } static void process_drive_cb (GDrive *drive, - GeditFileBookmarksStore *model) + PlumaFileBookmarksStore *model) { GList *volumes; @@ -360,7 +360,7 @@ process_drive_cb (GDrive *drive, } static void -init_drives (GeditFileBookmarksStore *model) +init_drives (PlumaFileBookmarksStore *model) { GList *drives; @@ -373,7 +373,7 @@ init_drives (GeditFileBookmarksStore *model) static void process_volume_nodrive_cb (GVolume *volume, - GeditFileBookmarksStore *model) + PlumaFileBookmarksStore *model) { GDrive *drive; @@ -389,7 +389,7 @@ process_volume_nodrive_cb (GVolume *volume, } static void -init_volumes (GeditFileBookmarksStore *model) +init_volumes (PlumaFileBookmarksStore *model) { GList *volumes; @@ -402,7 +402,7 @@ init_volumes (GeditFileBookmarksStore *model) static void process_mount_novolume_cb (GMount *mount, - GeditFileBookmarksStore *model) + PlumaFileBookmarksStore *model) { GVolume *volume; @@ -415,12 +415,12 @@ process_mount_novolume_cb (GMount *mount, else if (!g_mount_is_shadowed (mount)) { /* Add the mount */ - add_fs (model, mount, GEDIT_FILE_BOOKMARKS_STORE_NONE, NULL); + add_fs (model, mount, PLUMA_FILE_BOOKMARKS_STORE_NONE, NULL); } } static void -init_mounts (GeditFileBookmarksStore *model) +init_mounts (PlumaFileBookmarksStore *model) { GList *mounts; @@ -432,7 +432,7 @@ init_mounts (GeditFileBookmarksStore *model) } static void -init_fs (GeditFileBookmarksStore * model) +init_fs (PlumaFileBookmarksStore * model) { if (model->priv->volume_monitor == NULL) { const gchar **ptr; @@ -465,21 +465,21 @@ init_fs (GeditFileBookmarksStore * model) } static gboolean -add_bookmark (GeditFileBookmarksStore * model, +add_bookmark (PlumaFileBookmarksStore * model, gchar const * name, gchar const * uri) { GFile * file; gboolean ret; - guint flags = GEDIT_FILE_BOOKMARKS_STORE_IS_BOOKMARK; + guint flags = PLUMA_FILE_BOOKMARKS_STORE_IS_BOOKMARK; GtkTreeIter iter; file = g_file_new_for_uri (uri); if (g_file_is_native (file)) { - flags |= GEDIT_FILE_BOOKMARKS_STORE_IS_LOCAL_BOOKMARK; + flags |= PLUMA_FILE_BOOKMARKS_STORE_IS_LOCAL_BOOKMARK; } else { - flags |= GEDIT_FILE_BOOKMARKS_STORE_IS_REMOTE_BOOKMARK; + flags |= PLUMA_FILE_BOOKMARKS_STORE_IS_REMOTE_BOOKMARK; } ret = add_file (model, file, name, flags, &iter); @@ -490,7 +490,7 @@ add_bookmark (GeditFileBookmarksStore * model, } static void -init_bookmarks (GeditFileBookmarksStore * model) +init_bookmarks (PlumaFileBookmarksStore * model) { gchar *bookmarks; GError *error = NULL; @@ -524,7 +524,7 @@ init_bookmarks (GeditFileBookmarksStore * model) /* the bookmarks file should contain valid * URIs, but paranoia is good */ - if (gedit_utils_is_valid_uri (*line)) { + if (pluma_utils_is_valid_uri (*line)) { added |= add_bookmark (model, name, *line); } } @@ -554,20 +554,20 @@ init_bookmarks (GeditFileBookmarksStore * model) if (added) { /* Bookmarks separator */ add_node (model, NULL, NULL, NULL, - GEDIT_FILE_BOOKMARKS_STORE_IS_BOOKMARK | - GEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR, NULL); + PLUMA_FILE_BOOKMARKS_STORE_IS_BOOKMARK | + PLUMA_FILE_BOOKMARKS_STORE_IS_SEPARATOR, NULL); } g_free (bookmarks); } static gint flags_order[] = { - GEDIT_FILE_BOOKMARKS_STORE_IS_HOME, - GEDIT_FILE_BOOKMARKS_STORE_IS_DESKTOP, - GEDIT_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR, - GEDIT_FILE_BOOKMARKS_STORE_IS_ROOT, - GEDIT_FILE_BOOKMARKS_STORE_IS_FS, - GEDIT_FILE_BOOKMARKS_STORE_IS_BOOKMARK, + PLUMA_FILE_BOOKMARKS_STORE_IS_HOME, + PLUMA_FILE_BOOKMARKS_STORE_IS_DESKTOP, + PLUMA_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR, + PLUMA_FILE_BOOKMARKS_STORE_IS_ROOT, + PLUMA_FILE_BOOKMARKS_STORE_IS_FS, + PLUMA_FILE_BOOKMARKS_STORE_IS_BOOKMARK, -1 }; @@ -600,17 +600,17 @@ bookmarks_compare_names (GtkTreeModel * model, GtkTreeIter * a, guint f2; gtk_tree_model_get (model, a, - GEDIT_FILE_BOOKMARKS_STORE_COLUMN_NAME, &n1, - GEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f1, + PLUMA_FILE_BOOKMARKS_STORE_COLUMN_NAME, &n1, + PLUMA_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f1, -1); gtk_tree_model_get (model, b, - GEDIT_FILE_BOOKMARKS_STORE_COLUMN_NAME, &n2, - GEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f2, + PLUMA_FILE_BOOKMARKS_STORE_COLUMN_NAME, &n2, + PLUMA_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f2, -1); /* do not sort actual bookmarks to keep same order as in caja */ - if ((f1 & GEDIT_FILE_BOOKMARKS_STORE_IS_BOOKMARK) && - (f2 & GEDIT_FILE_BOOKMARKS_STORE_IS_BOOKMARK)) + if ((f1 & PLUMA_FILE_BOOKMARKS_STORE_IS_BOOKMARK) && + (f2 & PLUMA_FILE_BOOKMARKS_STORE_IS_BOOKMARK)) result = 0; else if (n1 == NULL && n2 == NULL) result = 0; @@ -636,13 +636,13 @@ bookmarks_compare_flags (GtkTreeModel * model, GtkTreeIter * a, gint *flags; guint sep; - sep = GEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR; + sep = PLUMA_FILE_BOOKMARKS_STORE_IS_SEPARATOR; gtk_tree_model_get (model, a, - GEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f1, + PLUMA_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f1, -1); gtk_tree_model_get (model, b, - GEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f2, + PLUMA_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f2, -1); for (flags = flags_order; *flags != -1; ++flags) { @@ -691,9 +691,9 @@ find_with_flags (GtkTreeModel * model, GtkTreeIter * iter, gpointer obj, do { gtk_tree_model_get (model, &child, - GEDIT_FILE_BOOKMARKS_STORE_COLUMN_OBJECT, + PLUMA_FILE_BOOKMARKS_STORE_COLUMN_OBJECT, &childobj, - GEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, + PLUMA_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &childflags, -1); fequal = (obj == childobj); @@ -718,13 +718,13 @@ remove_node (GtkTreeModel * model, GtkTreeIter * iter) guint flags; gtk_tree_model_get (model, iter, - GEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &flags, + PLUMA_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &flags, -1); - if (!(flags & GEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR)) { - if (flags & GEDIT_FILE_BOOKMARKS_STORE_IS_FS) { - check_mount_separator (GEDIT_FILE_BOOKMARKS_STORE (model), - flags & GEDIT_FILE_BOOKMARKS_STORE_IS_FS, + if (!(flags & PLUMA_FILE_BOOKMARKS_STORE_IS_SEPARATOR)) { + if (flags & PLUMA_FILE_BOOKMARKS_STORE_IS_FS) { + check_mount_separator (PLUMA_FILE_BOOKMARKS_STORE (model), + flags & PLUMA_FILE_BOOKMARKS_STORE_IS_FS, FALSE); } } @@ -733,19 +733,19 @@ remove_node (GtkTreeModel * model, GtkTreeIter * iter) } static void -remove_bookmarks (GeditFileBookmarksStore * model) +remove_bookmarks (PlumaFileBookmarksStore * model) { GtkTreeIter iter; while (find_with_flags (GTK_TREE_MODEL (model), &iter, NULL, - GEDIT_FILE_BOOKMARKS_STORE_IS_BOOKMARK, + PLUMA_FILE_BOOKMARKS_STORE_IS_BOOKMARK, 0)) { remove_node (GTK_TREE_MODEL (model), &iter); } } static void -initialize_fill (GeditFileBookmarksStore * model) +initialize_fill (PlumaFileBookmarksStore * model) { init_special_directories (model); init_fs (model); @@ -753,10 +753,10 @@ initialize_fill (GeditFileBookmarksStore * model) } /* Public */ -GeditFileBookmarksStore * -gedit_file_bookmarks_store_new (void) +PlumaFileBookmarksStore * +pluma_file_bookmarks_store_new (void) { - GeditFileBookmarksStore *model; + PlumaFileBookmarksStore *model; GType column_types[] = { GDK_TYPE_PIXBUF, G_TYPE_STRING, @@ -764,9 +764,9 @@ gedit_file_bookmarks_store_new (void) G_TYPE_UINT }; - model = g_object_new (GEDIT_TYPE_FILE_BOOKMARKS_STORE, NULL); + model = g_object_new (PLUMA_TYPE_FILE_BOOKMARKS_STORE, NULL); gtk_tree_store_set_column_types (GTK_TREE_STORE (model), - GEDIT_FILE_BOOKMARKS_STORE_N_COLUMNS, + PLUMA_FILE_BOOKMARKS_STORE_N_COLUMNS, column_types); gtk_tree_sortable_set_default_sort_func (GTK_TREE_SORTABLE (model), @@ -782,7 +782,7 @@ gedit_file_bookmarks_store_new (void) } gchar * -gedit_file_bookmarks_store_get_uri (GeditFileBookmarksStore * model, +pluma_file_bookmarks_store_get_uri (PlumaFileBookmarksStore * model, GtkTreeIter * iter) { GObject * obj; @@ -791,22 +791,22 @@ gedit_file_bookmarks_store_get_uri (GeditFileBookmarksStore * model, gchar * ret = NULL; gboolean isfs; - g_return_val_if_fail (GEDIT_IS_FILE_BOOKMARKS_STORE (model), NULL); + g_return_val_if_fail (PLUMA_IS_FILE_BOOKMARKS_STORE (model), NULL); g_return_val_if_fail (iter != NULL, NULL); gtk_tree_model_get (GTK_TREE_MODEL (model), iter, - GEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, + PLUMA_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &flags, - GEDIT_FILE_BOOKMARKS_STORE_COLUMN_OBJECT, + PLUMA_FILE_BOOKMARKS_STORE_COLUMN_OBJECT, &obj, -1); if (obj == NULL) return NULL; - isfs = (flags & GEDIT_FILE_BOOKMARKS_STORE_IS_FS); + isfs = (flags & PLUMA_FILE_BOOKMARKS_STORE_IS_FS); - if (isfs && (flags & GEDIT_FILE_BOOKMARKS_STORE_IS_MOUNT)) + if (isfs && (flags & PLUMA_FILE_BOOKMARKS_STORE_IS_MOUNT)) { file = g_mount_get_root (G_MOUNT (obj)); } @@ -827,7 +827,7 @@ gedit_file_bookmarks_store_get_uri (GeditFileBookmarksStore * model, } void -gedit_file_bookmarks_store_refresh (GeditFileBookmarksStore * model) +pluma_file_bookmarks_store_refresh (PlumaFileBookmarksStore * model) { gtk_tree_store_clear (GTK_TREE_STORE (model)); initialize_fill (model); @@ -836,11 +836,11 @@ gedit_file_bookmarks_store_refresh (GeditFileBookmarksStore * model) static void on_fs_changed (GVolumeMonitor *monitor, GObject *object, - GeditFileBookmarksStore *model) + PlumaFileBookmarksStore *model) { GtkTreeModel *tree_model = GTK_TREE_MODEL (model); - guint flags = GEDIT_FILE_BOOKMARKS_STORE_IS_FS; - guint noflags = GEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR; + guint flags = PLUMA_FILE_BOOKMARKS_STORE_IS_FS; + guint noflags = PLUMA_FILE_BOOKMARKS_STORE_IS_SEPARATOR; GtkTreeIter iter; /* clear all fs items */ @@ -856,7 +856,7 @@ on_bookmarks_file_changed (GFileMonitor * monitor, GFile * file, GFile * other_file, GFileMonitorEvent event_type, - GeditFileBookmarksStore * model) + PlumaFileBookmarksStore * model) { switch (event_type) { case G_FILE_MONITOR_EVENT_CHANGED: diff --git a/plugins/filebrowser/pluma-file-bookmarks-store.h b/plugins/filebrowser/pluma-file-bookmarks-store.h new file mode 100755 index 00000000..c811f588 --- /dev/null +++ b/plugins/filebrowser/pluma-file-bookmarks-store.h @@ -0,0 +1,90 @@ +/* + * pluma-file-bookmarks-store.h - Pluma plugin providing easy file access + * from the sidepanel + * + * Copyright (C) 2006 - Jesse van den Kieboom <[email protected]> + * + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __PLUMA_FILE_BOOKMARKS_STORE_H__ +#define __PLUMA_FILE_BOOKMARKS_STORE_H__ + +#include <gtk/gtk.h> + +G_BEGIN_DECLS +#define PLUMA_TYPE_FILE_BOOKMARKS_STORE (pluma_file_bookmarks_store_get_type ()) +#define PLUMA_FILE_BOOKMARKS_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PLUMA_TYPE_FILE_BOOKMARKS_STORE, PlumaFileBookmarksStore)) +#define PLUMA_FILE_BOOKMARKS_STORE_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PLUMA_TYPE_FILE_BOOKMARKS_STORE, PlumaFileBookmarksStore const)) +#define PLUMA_FILE_BOOKMARKS_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PLUMA_TYPE_FILE_BOOKMARKS_STORE, PlumaFileBookmarksStoreClass)) +#define PLUMA_IS_FILE_BOOKMARKS_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PLUMA_TYPE_FILE_BOOKMARKS_STORE)) +#define PLUMA_IS_FILE_BOOKMARKS_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PLUMA_TYPE_FILE_BOOKMARKS_STORE)) +#define PLUMA_FILE_BOOKMARKS_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PLUMA_TYPE_FILE_BOOKMARKS_STORE, PlumaFileBookmarksStoreClass)) + +typedef struct _PlumaFileBookmarksStore PlumaFileBookmarksStore; +typedef struct _PlumaFileBookmarksStoreClass PlumaFileBookmarksStoreClass; +typedef struct _PlumaFileBookmarksStorePrivate PlumaFileBookmarksStorePrivate; + +enum +{ + PLUMA_FILE_BOOKMARKS_STORE_COLUMN_ICON = 0, + PLUMA_FILE_BOOKMARKS_STORE_COLUMN_NAME, + PLUMA_FILE_BOOKMARKS_STORE_COLUMN_OBJECT, + PLUMA_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, + PLUMA_FILE_BOOKMARKS_STORE_N_COLUMNS +}; + +enum +{ + PLUMA_FILE_BOOKMARKS_STORE_NONE = 0, + PLUMA_FILE_BOOKMARKS_STORE_IS_SEPARATOR = 1 << 0, /* Separator item */ + PLUMA_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR = 1 << 1, /* Special user dir */ + PLUMA_FILE_BOOKMARKS_STORE_IS_HOME = 1 << 2, /* The special Home user directory */ + PLUMA_FILE_BOOKMARKS_STORE_IS_DESKTOP = 1 << 3, /* The special Desktop user directory */ + PLUMA_FILE_BOOKMARKS_STORE_IS_DOCUMENTS = 1 << 4, /* The special Documents user directory */ + PLUMA_FILE_BOOKMARKS_STORE_IS_FS = 1 << 5, /* A mount object */ + PLUMA_FILE_BOOKMARKS_STORE_IS_MOUNT = 1 << 6, /* A mount object */ + PLUMA_FILE_BOOKMARKS_STORE_IS_VOLUME = 1 << 7, /* A volume object */ + PLUMA_FILE_BOOKMARKS_STORE_IS_DRIVE = 1 << 8, /* A drive object */ + PLUMA_FILE_BOOKMARKS_STORE_IS_ROOT = 1 << 9, /* The root file system (file:///) */ + PLUMA_FILE_BOOKMARKS_STORE_IS_BOOKMARK = 1 << 10, /* A gtk bookmark */ + PLUMA_FILE_BOOKMARKS_STORE_IS_REMOTE_BOOKMARK = 1 << 11, /* A remote gtk bookmark */ + PLUMA_FILE_BOOKMARKS_STORE_IS_LOCAL_BOOKMARK = 1 << 12 /* A local gtk bookmark */ +}; + +struct _PlumaFileBookmarksStore +{ + GtkTreeStore parent; + + PlumaFileBookmarksStorePrivate *priv; +}; + +struct _PlumaFileBookmarksStoreClass +{ + GtkTreeStoreClass parent_class; +}; + +GType pluma_file_bookmarks_store_get_type (void) G_GNUC_CONST; +GType pluma_file_bookmarks_store_register_type (GTypeModule * module); + +PlumaFileBookmarksStore *pluma_file_bookmarks_store_new (void); +gchar *pluma_file_bookmarks_store_get_uri (PlumaFileBookmarksStore * model, + GtkTreeIter * iter); +void pluma_file_bookmarks_store_refresh (PlumaFileBookmarksStore * model); + +G_END_DECLS +#endif /* __PLUMA_FILE_BOOKMARKS_STORE_H__ */ + +// ex:ts=8:noet: diff --git a/plugins/filebrowser/gedit-file-browser-enum-register.c.template b/plugins/filebrowser/pluma-file-browser-enum-register.c.template index 63a9c562..0bbd1018 100755 --- a/plugins/filebrowser/gedit-file-browser-enum-register.c.template +++ b/plugins/filebrowser/pluma-file-browser-enum-register.c.template @@ -1,6 +1,6 @@ /*** BEGIN file-header ***/ void -gedit_file_browser_enum_and_flag_register_type (GTypeModule * module) +pluma_file_browser_enum_and_flag_register_type (GTypeModule * module) { /*** END file-header ***/ diff --git a/plugins/filebrowser/gedit-file-browser-enum-types.c.template b/plugins/filebrowser/pluma-file-browser-enum-types.c.template index 4e89370d..dc1ac9ea 100755 --- a/plugins/filebrowser/gedit-file-browser-enum-types.c.template +++ b/plugins/filebrowser/pluma-file-browser-enum-types.c.template @@ -1,5 +1,5 @@ /*** BEGIN file-header ***/ -#include "gedit-file-browser-enum-types.h" +#include "pluma-file-browser-enum-types.h" /*** END file-header ***/ diff --git a/plugins/filebrowser/gedit-file-browser-enum-types.h.template b/plugins/filebrowser/pluma-file-browser-enum-types.h.template index aea4fad9..4f09901e 100755 --- a/plugins/filebrowser/gedit-file-browser-enum-types.h.template +++ b/plugins/filebrowser/pluma-file-browser-enum-types.h.template @@ -1,6 +1,6 @@ /*** BEGIN file-header ***/ -#ifndef __GEDIT_FILE_BROWSER_ENUM_TYPES_H__ -#define __GEDIT_FILE_BROWSER_ENUM_TYPES_H__ +#ifndef __PLUMA_FILE_BROWSER_ENUM_TYPES_H__ +#define __PLUMA_FILE_BROWSER_ENUM_TYPES_H__ #include <glib-object.h> @@ -14,16 +14,16 @@ G_BEGIN_DECLS /*** END file-production ***/ /*** BEGIN enumeration-production ***/ -#define GEDIT_TYPE_@ENUMSHORT@ (@enum_name@_get_type()) +#define PLUMA_TYPE_@ENUMSHORT@ (@enum_name@_get_type()) GType @enum_name@_get_type (void) G_GNUC_CONST; /*** END enumeration-production ***/ /*** BEGIN file-tail ***/ -void gedit_file_browser_enum_and_flag_register_type (GTypeModule * module); +void pluma_file_browser_enum_and_flag_register_type (GTypeModule * module); G_END_DECLS -#endif /* __GEDIT_FILE_BROWSER_ENUM_TYPES_H__ */ +#endif /* __PLUMA_FILE_BROWSER_ENUM_TYPES_H__ */ /*** END file-tail ***/ diff --git a/plugins/filebrowser/gedit-file-browser-error.h b/plugins/filebrowser/pluma-file-browser-error.h index ec5b8618..59f01e2a 100755 --- a/plugins/filebrowser/gedit-file-browser-error.h +++ b/plugins/filebrowser/pluma-file-browser-error.h @@ -1,5 +1,5 @@ /* - * gedit-file-browser-error.h - Gedit plugin providing easy file access + * pluma-file-browser-error.h - Pluma plugin providing easy file access * from the sidepanel * * Copyright (C) 2006 - Jesse van den Kieboom <[email protected]> @@ -19,23 +19,23 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __GEDIT_FILE_BROWSER_ERROR_H__ -#define __GEDIT_FILE_BROWSER_ERROR_H__ +#ifndef __PLUMA_FILE_BROWSER_ERROR_H__ +#define __PLUMA_FILE_BROWSER_ERROR_H__ G_BEGIN_DECLS typedef enum { - GEDIT_FILE_BROWSER_ERROR_NONE, - GEDIT_FILE_BROWSER_ERROR_RENAME, - GEDIT_FILE_BROWSER_ERROR_DELETE, - GEDIT_FILE_BROWSER_ERROR_NEW_FILE, - GEDIT_FILE_BROWSER_ERROR_NEW_DIRECTORY, - GEDIT_FILE_BROWSER_ERROR_OPEN_DIRECTORY, - GEDIT_FILE_BROWSER_ERROR_SET_ROOT, - GEDIT_FILE_BROWSER_ERROR_LOAD_DIRECTORY, - GEDIT_FILE_BROWSER_ERROR_NUM -} GeditFileBrowserError; + PLUMA_FILE_BROWSER_ERROR_NONE, + PLUMA_FILE_BROWSER_ERROR_RENAME, + PLUMA_FILE_BROWSER_ERROR_DELETE, + PLUMA_FILE_BROWSER_ERROR_NEW_FILE, + PLUMA_FILE_BROWSER_ERROR_NEW_DIRECTORY, + PLUMA_FILE_BROWSER_ERROR_OPEN_DIRECTORY, + PLUMA_FILE_BROWSER_ERROR_SET_ROOT, + PLUMA_FILE_BROWSER_ERROR_LOAD_DIRECTORY, + PLUMA_FILE_BROWSER_ERROR_NUM +} PlumaFileBrowserError; G_END_DECLS -#endif /* __GEDIT_FILE_BROWSER_ERROR_H__ */ +#endif /* __PLUMA_FILE_BROWSER_ERROR_H__ */ diff --git a/plugins/filebrowser/gedit-file-browser-marshal.list b/plugins/filebrowser/pluma-file-browser-marshal.list index 5fa72c8b..5fa72c8b 100755 --- a/plugins/filebrowser/gedit-file-browser-marshal.list +++ b/plugins/filebrowser/pluma-file-browser-marshal.list diff --git a/plugins/filebrowser/gedit-file-browser-messages.c b/plugins/filebrowser/pluma-file-browser-messages.c index b587edf1..f4b20d05 100755 --- a/plugins/filebrowser/gedit-file-browser-messages.c +++ b/plugins/filebrowser/pluma-file-browser-messages.c @@ -1,16 +1,16 @@ -#include "gedit-file-browser-messages.h" -#include "gedit-file-browser-store.h" -#include <gedit/gedit-message.h> +#include "pluma-file-browser-messages.h" +#include "pluma-file-browser-store.h" +#include <pluma/pluma-message.h> #define MESSAGE_OBJECT_PATH "/plugins/filebrowser" -#define WINDOW_DATA_KEY "GeditFileBrowserMessagesWindowData" +#define WINDOW_DATA_KEY "PlumaFileBrowserMessagesWindowData" -#define BUS_CONNECT(bus, name, data) gedit_message_bus_connect(bus, MESSAGE_OBJECT_PATH, #name, (GeditMessageCallback) message_##name##_cb, data, NULL) +#define BUS_CONNECT(bus, name, data) pluma_message_bus_connect(bus, MESSAGE_OBJECT_PATH, #name, (PlumaMessageCallback) message_##name##_cb, data, NULL) typedef struct { - GeditWindow *window; - GeditMessage *message; + PlumaWindow *window; + PlumaMessage *message; } MessageCacheData; typedef struct @@ -24,8 +24,8 @@ typedef struct GList *merge_ids; GtkActionGroup *merged_actions; - GeditMessageBus *bus; - GeditFileBrowserWidget *widget; + PlumaMessageBus *bus; + PlumaFileBrowserWidget *widget; GHashTable *row_tracking; GHashTable *filters; @@ -35,19 +35,19 @@ typedef struct { gulong id; - GeditWindow *window; - GeditMessage *message; + PlumaWindow *window; + PlumaMessage *message; } FilterData; static WindowData * -window_data_new (GeditWindow *window, - GeditFileBrowserWidget *widget) +window_data_new (PlumaWindow *window, + PlumaFileBrowserWidget *widget) { WindowData *data = g_slice_new (WindowData); GtkUIManager *manager; GList *groups; - data->bus = gedit_window_get_message_bus (window); + data->bus = pluma_window_get_message_bus (window); data->widget = widget; data->row_tracking = g_hash_table_new_full (g_str_hash, g_str_equal, @@ -59,7 +59,7 @@ window_data_new (GeditWindow *window, (GDestroyNotify)g_free, NULL); - manager = gedit_file_browser_widget_get_ui_manager (widget); + manager = pluma_file_browser_widget_get_ui_manager (widget); data->merge_ids = NULL; data->merged_actions = gtk_action_group_new ("MessageMergedActions"); @@ -73,13 +73,13 @@ window_data_new (GeditWindow *window, } static WindowData * -get_window_data (GeditWindow * window) +get_window_data (PlumaWindow * window) { return (WindowData *) (g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY)); } static void -window_data_free (GeditWindow *window) +window_data_free (PlumaWindow *window) { WindowData *data = get_window_data (window); GtkUIManager *manager; @@ -88,7 +88,7 @@ window_data_free (GeditWindow *window) g_hash_table_destroy (data->row_tracking); g_hash_table_destroy (data->filters); - manager = gedit_file_browser_widget_get_ui_manager (data->widget); + manager = pluma_file_browser_widget_get_ui_manager (data->widget); gtk_ui_manager_remove_action_group (manager, data->merged_actions); for (item = data->merge_ids; item; item = item->next) @@ -103,8 +103,8 @@ window_data_free (GeditWindow *window) } static FilterData * -filter_data_new (GeditWindow *window, - GeditMessage *message) +filter_data_new (PlumaWindow *window, + PlumaMessage *message) { FilterData *data = g_slice_new (FilterData); WindowData *wdata; @@ -116,8 +116,8 @@ filter_data_new (GeditWindow *window, wdata = get_window_data (window); g_hash_table_insert (wdata->filters, - gedit_message_type_identifier (gedit_message_get_object_path (message), - gedit_message_get_method (message)), + pluma_message_type_identifier (pluma_message_get_object_path (message), + pluma_message_get_method (message)), data); return data; @@ -129,8 +129,8 @@ filter_data_free (FilterData *data) WindowData *wdata = get_window_data (data->window); gchar *identifier; - identifier = gedit_message_type_identifier (gedit_message_get_object_path (data->message), - gedit_message_get_method (data->message)); + identifier = pluma_message_type_identifier (pluma_message_get_object_path (data->message), + pluma_message_get_method (data->message)); g_hash_table_remove (wdata->filters, identifier); g_free (identifier); @@ -161,8 +161,8 @@ message_cache_data_free (MessageCacheData *data) } static MessageCacheData * -message_cache_data_new (GeditWindow *window, - GeditMessage *message) +message_cache_data_new (PlumaWindow *window, + PlumaMessage *message) { MessageCacheData *data = g_slice_new (MessageCacheData); @@ -173,56 +173,56 @@ message_cache_data_new (GeditWindow *window, } static void -message_get_root_cb (GeditMessageBus *bus, - GeditMessage *message, +message_get_root_cb (PlumaMessageBus *bus, + PlumaMessage *message, WindowData *data) { - GeditFileBrowserStore *store; + PlumaFileBrowserStore *store; gchar *uri; - store = gedit_file_browser_widget_get_browser_store (data->widget); - uri = gedit_file_browser_store_get_virtual_root (store); + store = pluma_file_browser_widget_get_browser_store (data->widget); + uri = pluma_file_browser_store_get_virtual_root (store); - gedit_message_set (message, "uri", uri, NULL); + pluma_message_set (message, "uri", uri, NULL); g_free (uri); } static void -message_set_root_cb (GeditMessageBus *bus, - GeditMessage *message, +message_set_root_cb (PlumaMessageBus *bus, + PlumaMessage *message, WindowData *data) { gchar *root = NULL; gchar *virtual = NULL; - gedit_message_get (message, "uri", &root, NULL); + pluma_message_get (message, "uri", &root, NULL); if (!root) return; - if (gedit_message_has_key (message, "virtual")) - gedit_message_get (message, "virtual", &virtual, NULL); + if (pluma_message_has_key (message, "virtual")) + pluma_message_get (message, "virtual", &virtual, NULL); if (virtual) - gedit_file_browser_widget_set_root_and_virtual_root (data->widget, root, virtual); + pluma_file_browser_widget_set_root_and_virtual_root (data->widget, root, virtual); else - gedit_file_browser_widget_set_root (data->widget, root, TRUE); + pluma_file_browser_widget_set_root (data->widget, root, TRUE); g_free (root); g_free (virtual); } static void -message_set_emblem_cb (GeditMessageBus *bus, - GeditMessage *message, +message_set_emblem_cb (PlumaMessageBus *bus, + PlumaMessage *message, WindowData *data) { gchar *id = NULL; gchar *emblem = NULL; GtkTreePath *path; - GeditFileBrowserStore *store; + PlumaFileBrowserStore *store; - gedit_message_get (message, "id", &id, "emblem", &emblem, NULL); + pluma_message_get (message, "id", &id, "emblem", &emblem, NULL); if (!id || !emblem) { @@ -250,16 +250,16 @@ message_set_emblem_cb (GeditMessageBus *bus, GValue value = { 0, }; GtkTreeIter iter; - store = gedit_file_browser_widget_get_browser_store (data->widget); + store = pluma_file_browser_widget_get_browser_store (data->widget); if (gtk_tree_model_get_iter (GTK_TREE_MODEL (store), &iter, path)) { g_value_init (&value, GDK_TYPE_PIXBUF); g_value_set_object (&value, pixbuf); - gedit_file_browser_store_set_value (store, + pluma_file_browser_store_set_value (store, &iter, - GEDIT_FILE_BROWSER_STORE_COLUMN_EMBLEM, + PLUMA_FILE_BROWSER_STORE_COLUMN_EMBLEM, &value); g_value_unset (&value); @@ -285,7 +285,7 @@ item_id (const gchar *path, static gchar * track_row (WindowData *data, - GeditFileBrowserStore *store, + PlumaFileBrowserStore *store, GtkTreePath *path, const gchar *uri) { @@ -308,18 +308,18 @@ static void set_item_message (WindowData *data, GtkTreeIter *iter, GtkTreePath *path, - GeditMessage *message) + PlumaMessage *message) { - GeditFileBrowserStore *store; + PlumaFileBrowserStore *store; gchar *uri = NULL; guint flags = 0; gchar *track_id; - store = gedit_file_browser_widget_get_browser_store (data->widget); + store = pluma_file_browser_widget_get_browser_store (data->widget); gtk_tree_model_get (GTK_TREE_MODEL (store), iter, - GEDIT_FILE_BROWSER_STORE_COLUMN_URI, &uri, - GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, + PLUMA_FILE_BROWSER_STORE_COLUMN_URI, &uri, + PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, -1); if (!uri) @@ -330,14 +330,14 @@ set_item_message (WindowData *data, else track_id = NULL; - gedit_message_set (message, + pluma_message_set (message, "id", track_id, "uri", uri, NULL); - if (gedit_message_has_key (message, "is_directory")) + if (pluma_message_has_key (message, "is_directory")) { - gedit_message_set (message, + pluma_message_set (message, "is_directory", FILE_IS_DIR (flags), NULL); } @@ -347,8 +347,8 @@ set_item_message (WindowData *data, } static gboolean -custom_message_filter_func (GeditFileBrowserWidget *widget, - GeditFileBrowserStore *store, +custom_message_filter_func (PlumaFileBrowserWidget *widget, + PlumaFileBrowserStore *store, GtkTreeIter *iter, FilterData *data) { @@ -359,8 +359,8 @@ custom_message_filter_func (GeditFileBrowserWidget *widget, GtkTreePath *path; gtk_tree_model_get (GTK_TREE_MODEL (store), iter, - GEDIT_FILE_BROWSER_STORE_COLUMN_URI, &uri, - GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, + PLUMA_FILE_BROWSER_STORE_COLUMN_URI, &uri, + PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, -1); if (!uri || FILE_IS_DUMMY (flags)) @@ -373,28 +373,28 @@ custom_message_filter_func (GeditFileBrowserWidget *widget, set_item_message (wdata, iter, path, data->message); gtk_tree_path_free (path); - gedit_message_set (data->message, "filter", filter, NULL); + pluma_message_set (data->message, "filter", filter, NULL); - gedit_message_bus_send_message_sync (wdata->bus, data->message); - gedit_message_get (data->message, "filter", &filter, NULL); + pluma_message_bus_send_message_sync (wdata->bus, data->message); + pluma_message_get (data->message, "filter", &filter, NULL); return !filter; } static void -message_add_filter_cb (GeditMessageBus *bus, - GeditMessage *message, - GeditWindow *window) +message_add_filter_cb (PlumaMessageBus *bus, + PlumaMessage *message, + PlumaWindow *window) { gchar *object_path = NULL; gchar *method = NULL; gulong id; - GeditMessageType *message_type; - GeditMessage *cbmessage; + PlumaMessageType *message_type; + PlumaMessage *cbmessage; FilterData *filter_data; WindowData *data = get_window_data (window); - gedit_message_get (message, + pluma_message_get (message, "object_path", &object_path, "method", &method, NULL); @@ -408,7 +408,7 @@ message_add_filter_cb (GeditMessageBus *bus, return; } - message_type = gedit_message_bus_lookup (bus, object_path, method); + message_type = pluma_message_bus_lookup (bus, object_path, method); if (!message_type) { @@ -419,15 +419,15 @@ message_add_filter_cb (GeditMessageBus *bus, } // Check if the message type has the correct arguments - if (gedit_message_type_lookup (message_type, "id") != G_TYPE_STRING || - gedit_message_type_lookup (message_type, "uri") != G_TYPE_STRING || - gedit_message_type_lookup (message_type, "is_directory") != G_TYPE_BOOLEAN || - gedit_message_type_lookup (message_type, "filter") != G_TYPE_BOOLEAN) + if (pluma_message_type_lookup (message_type, "id") != G_TYPE_STRING || + pluma_message_type_lookup (message_type, "uri") != G_TYPE_STRING || + pluma_message_type_lookup (message_type, "is_directory") != G_TYPE_BOOLEAN || + pluma_message_type_lookup (message_type, "filter") != G_TYPE_BOOLEAN) { return; } - cbmessage = gedit_message_type_instantiate (message_type, + cbmessage = pluma_message_type_instantiate (message_type, "id", NULL, "uri", NULL, "is_directory", FALSE, @@ -436,8 +436,8 @@ message_add_filter_cb (GeditMessageBus *bus, // Register the custom filter on the widget filter_data = filter_data_new (window, cbmessage); - id = gedit_file_browser_widget_add_filter (data->widget, - (GeditFileBrowserWidgetFilterFunc)custom_message_filter_func, + id = pluma_file_browser_widget_add_filter (data->widget, + (PlumaFileBrowserWidgetFilterFunc)custom_message_filter_func, filter_data, (GDestroyNotify)filter_data_free); @@ -445,117 +445,117 @@ message_add_filter_cb (GeditMessageBus *bus, } static void -message_remove_filter_cb (GeditMessageBus *bus, - GeditMessage *message, +message_remove_filter_cb (PlumaMessageBus *bus, + PlumaMessage *message, WindowData *data) { gulong id = 0; - gedit_message_get (message, "id", &id, NULL); + pluma_message_get (message, "id", &id, NULL); if (!id) return; - gedit_file_browser_widget_remove_filter (data->widget, id); + pluma_file_browser_widget_remove_filter (data->widget, id); } static void -message_up_cb (GeditMessageBus *bus, - GeditMessage *message, +message_up_cb (PlumaMessageBus *bus, + PlumaMessage *message, WindowData *data) { - GeditFileBrowserStore *store = gedit_file_browser_widget_get_browser_store (data->widget); + PlumaFileBrowserStore *store = pluma_file_browser_widget_get_browser_store (data->widget); - gedit_file_browser_store_set_virtual_root_up (store); + pluma_file_browser_store_set_virtual_root_up (store); } static void -message_history_back_cb (GeditMessageBus *bus, - GeditMessage *message, +message_history_back_cb (PlumaMessageBus *bus, + PlumaMessage *message, WindowData *data) { - gedit_file_browser_widget_history_back (data->widget); + pluma_file_browser_widget_history_back (data->widget); } static void -message_history_forward_cb (GeditMessageBus *bus, - GeditMessage *message, +message_history_forward_cb (PlumaMessageBus *bus, + PlumaMessage *message, WindowData *data) { - gedit_file_browser_widget_history_forward (data->widget); + pluma_file_browser_widget_history_forward (data->widget); } static void -message_refresh_cb (GeditMessageBus *bus, - GeditMessage *message, +message_refresh_cb (PlumaMessageBus *bus, + PlumaMessage *message, WindowData *data) { - gedit_file_browser_widget_refresh (data->widget); + pluma_file_browser_widget_refresh (data->widget); } static void -message_set_show_hidden_cb (GeditMessageBus *bus, - GeditMessage *message, +message_set_show_hidden_cb (PlumaMessageBus *bus, + PlumaMessage *message, WindowData *data) { gboolean active = FALSE; - GeditFileBrowserStore *store; - GeditFileBrowserStoreFilterMode mode; + PlumaFileBrowserStore *store; + PlumaFileBrowserStoreFilterMode mode; - gedit_message_get (message, "active", &active, NULL); + pluma_message_get (message, "active", &active, NULL); - store = gedit_file_browser_widget_get_browser_store (data->widget); - mode = gedit_file_browser_store_get_filter_mode (store); + store = pluma_file_browser_widget_get_browser_store (data->widget); + mode = pluma_file_browser_store_get_filter_mode (store); if (active) - mode &= ~GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN; + mode &= ~PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN; else - mode |= GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN; + mode |= PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN; - gedit_file_browser_store_set_filter_mode (store, mode); + pluma_file_browser_store_set_filter_mode (store, mode); } static void -message_set_show_binary_cb (GeditMessageBus *bus, - GeditMessage *message, +message_set_show_binary_cb (PlumaMessageBus *bus, + PlumaMessage *message, WindowData *data) { gboolean active = FALSE; - GeditFileBrowserStore *store; - GeditFileBrowserStoreFilterMode mode; + PlumaFileBrowserStore *store; + PlumaFileBrowserStoreFilterMode mode; - gedit_message_get (message, "active", &active, NULL); + pluma_message_get (message, "active", &active, NULL); - store = gedit_file_browser_widget_get_browser_store (data->widget); - mode = gedit_file_browser_store_get_filter_mode (store); + store = pluma_file_browser_widget_get_browser_store (data->widget); + mode = pluma_file_browser_store_get_filter_mode (store); if (active) - mode &= ~GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY; + mode &= ~PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY; else - mode |= GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY; + mode |= PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY; - gedit_file_browser_store_set_filter_mode (store, mode); + pluma_file_browser_store_set_filter_mode (store, mode); } static void -message_show_bookmarks_cb (GeditMessageBus *bus, - GeditMessage *message, +message_show_bookmarks_cb (PlumaMessageBus *bus, + PlumaMessage *message, WindowData *data) { - gedit_file_browser_widget_show_bookmarks (data->widget); + pluma_file_browser_widget_show_bookmarks (data->widget); } static void -message_show_files_cb (GeditMessageBus *bus, - GeditMessage *message, +message_show_files_cb (PlumaMessageBus *bus, + PlumaMessage *message, WindowData *data) { - gedit_file_browser_widget_show_files (data->widget); + pluma_file_browser_widget_show_files (data->widget); } static void -message_add_context_item_cb (GeditMessageBus *bus, - GeditMessage *message, +message_add_context_item_cb (PlumaMessageBus *bus, + PlumaMessage *message, WindowData *data) { GtkAction *action = NULL; @@ -564,7 +564,7 @@ message_add_context_item_cb (GeditMessageBus *bus, GtkUIManager *manager; guint merge_id; - gedit_message_get (message, + pluma_message_get (message, "action", &action, "path", &path, NULL); @@ -579,7 +579,7 @@ message_add_context_item_cb (GeditMessageBus *bus, } gtk_action_group_add_action (data->merged_actions, action); - manager = gedit_file_browser_widget_get_ui_manager (data->widget); + manager = pluma_file_browser_widget_get_ui_manager (data->widget); name = g_strconcat (gtk_action_get_name (action), "MenuItem", NULL); merge_id = gtk_ui_manager_new_merge_id (manager); @@ -594,11 +594,11 @@ message_add_context_item_cb (GeditMessageBus *bus, if (gtk_ui_manager_get_widget (manager, path)) { data->merge_ids = g_list_prepend (data->merge_ids, GINT_TO_POINTER (merge_id)); - gedit_message_set (message, "id", merge_id, NULL); + pluma_message_set (message, "id", merge_id, NULL); } else { - gedit_message_set (message, "id", 0, NULL); + pluma_message_set (message, "id", 0, NULL); } g_object_unref (action); @@ -607,64 +607,64 @@ message_add_context_item_cb (GeditMessageBus *bus, } static void -message_remove_context_item_cb (GeditMessageBus *bus, - GeditMessage *message, +message_remove_context_item_cb (PlumaMessageBus *bus, + PlumaMessage *message, WindowData *data) { guint merge_id = 0; GtkUIManager *manager; - gedit_message_get (message, "id", &merge_id, NULL); + pluma_message_get (message, "id", &merge_id, NULL); if (merge_id == 0) return; - manager = gedit_file_browser_widget_get_ui_manager (data->widget); + manager = pluma_file_browser_widget_get_ui_manager (data->widget); data->merge_ids = g_list_remove (data->merge_ids, GINT_TO_POINTER (merge_id)); gtk_ui_manager_remove_ui (manager, merge_id); } static void -message_get_view_cb (GeditMessageBus *bus, - GeditMessage *message, +message_get_view_cb (PlumaMessageBus *bus, + PlumaMessage *message, WindowData *data) { - GeditFileBrowserView *view; - view = gedit_file_browser_widget_get_browser_view (data->widget); + PlumaFileBrowserView *view; + view = pluma_file_browser_widget_get_browser_view (data->widget); - gedit_message_set (message, "view", view, NULL); + pluma_message_set (message, "view", view, NULL); } static void -register_methods (GeditWindow *window, - GeditFileBrowserWidget *widget) +register_methods (PlumaWindow *window, + PlumaFileBrowserWidget *widget) { - GeditMessageBus *bus = gedit_window_get_message_bus (window); + PlumaMessageBus *bus = pluma_window_get_message_bus (window); WindowData *data = get_window_data (window); /* Register method calls */ - gedit_message_bus_register (bus, + pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "get_root", 1, "uri", G_TYPE_STRING, NULL); - gedit_message_bus_register (bus, + pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "set_root", 1, "uri", G_TYPE_STRING, "virtual", G_TYPE_STRING, NULL); - gedit_message_bus_register (bus, + pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "set_emblem", 0, "id", G_TYPE_STRING, "emblem", G_TYPE_STRING, NULL); - gedit_message_bus_register (bus, + pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "add_filter", 1, "object_path", G_TYPE_STRING, @@ -672,13 +672,13 @@ register_methods (GeditWindow *window, "id", G_TYPE_ULONG, NULL); - gedit_message_bus_register (bus, + pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "remove_filter", 0, "id", G_TYPE_ULONG, NULL); - gedit_message_bus_register (bus, + pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "add_context_item", 1, "action", GTK_TYPE_ACTION, @@ -686,37 +686,37 @@ register_methods (GeditWindow *window, "id", G_TYPE_UINT, NULL); - gedit_message_bus_register (bus, + pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "remove_context_item", 0, "id", G_TYPE_UINT, NULL); - gedit_message_bus_register (bus, MESSAGE_OBJECT_PATH, "up", 0, NULL); + pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "up", 0, NULL); - gedit_message_bus_register (bus, MESSAGE_OBJECT_PATH, "history_back", 0, NULL); - gedit_message_bus_register (bus, MESSAGE_OBJECT_PATH, "history_forward", 0, NULL); + pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "history_back", 0, NULL); + pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "history_forward", 0, NULL); - gedit_message_bus_register (bus, MESSAGE_OBJECT_PATH, "refresh", 0, NULL); + pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "refresh", 0, NULL); - gedit_message_bus_register (bus, + pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "set_show_hidden", 0, "active", G_TYPE_BOOLEAN, NULL); - gedit_message_bus_register (bus, + pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "set_show_binary", 0, "active", G_TYPE_BOOLEAN, NULL); - gedit_message_bus_register (bus, MESSAGE_OBJECT_PATH, "show_bookmarks", 0, NULL); - gedit_message_bus_register (bus, MESSAGE_OBJECT_PATH, "show_files", 0, NULL); + pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "show_bookmarks", 0, NULL); + pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "show_files", 0, NULL); - gedit_message_bus_register (bus, + pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "get_view", 1, - "view", GEDIT_TYPE_FILE_BROWSER_VIEW, + "view", PLUMA_TYPE_FILE_BROWSER_VIEW, NULL); BUS_CONNECT (bus, get_root, data); @@ -744,7 +744,7 @@ register_methods (GeditWindow *window, } static void -store_row_inserted (GeditFileBrowserStore *store, +store_row_inserted (PlumaFileBrowserStore *store, GtkTreePath *path, GtkTreeIter *iter, MessageCacheData *data) @@ -753,8 +753,8 @@ store_row_inserted (GeditFileBrowserStore *store, guint flags = 0; gtk_tree_model_get (GTK_TREE_MODEL (store), iter, - GEDIT_FILE_BROWSER_STORE_COLUMN_URI, &uri, - GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, + PLUMA_FILE_BROWSER_STORE_COLUMN_URI, &uri, + PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, -1); if (!FILE_IS_DUMMY (flags) && !FILE_IS_FILTERED (flags)) @@ -762,14 +762,14 @@ store_row_inserted (GeditFileBrowserStore *store, WindowData *wdata = get_window_data (data->window); set_item_message (wdata, iter, path, data->message); - gedit_message_bus_send_message_sync (wdata->bus, data->message); + pluma_message_bus_send_message_sync (wdata->bus, data->message); } g_free (uri); } static void -store_row_deleted (GeditFileBrowserStore *store, +store_row_deleted (PlumaFileBrowserStore *store, GtkTreePath *path, MessageCacheData *data) { @@ -781,8 +781,8 @@ store_row_deleted (GeditFileBrowserStore *store, return; gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, - GEDIT_FILE_BROWSER_STORE_COLUMN_URI, &uri, - GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, + PLUMA_FILE_BROWSER_STORE_COLUMN_URI, &uri, + PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, -1); if (!FILE_IS_DUMMY (flags) && !FILE_IS_FILTERED (flags)) @@ -790,36 +790,36 @@ store_row_deleted (GeditFileBrowserStore *store, WindowData *wdata = get_window_data (data->window); set_item_message (wdata, &iter, path, data->message); - gedit_message_bus_send_message_sync (wdata->bus, data->message); + pluma_message_bus_send_message_sync (wdata->bus, data->message); } g_free (uri); } static void -store_virtual_root_changed (GeditFileBrowserStore *store, +store_virtual_root_changed (PlumaFileBrowserStore *store, GParamSpec *spec, MessageCacheData *data) { WindowData *wdata = get_window_data (data->window); gchar *uri; - uri = gedit_file_browser_store_get_virtual_root (store); + uri = pluma_file_browser_store_get_virtual_root (store); if (!uri) return; - gedit_message_set (data->message, + pluma_message_set (data->message, "uri", uri, NULL); - gedit_message_bus_send_message_sync (wdata->bus, data->message); + pluma_message_bus_send_message_sync (wdata->bus, data->message); g_free (uri); } static void -store_begin_loading (GeditFileBrowserStore *store, +store_begin_loading (PlumaFileBrowserStore *store, GtkTreeIter *iter, MessageCacheData *data) { @@ -830,12 +830,12 @@ store_begin_loading (GeditFileBrowserStore *store, set_item_message (wdata, iter, path, data->message); - gedit_message_bus_send_message_sync (wdata->bus, data->message); + pluma_message_bus_send_message_sync (wdata->bus, data->message); gtk_tree_path_free (path); } static void -store_end_loading (GeditFileBrowserStore *store, +store_end_loading (PlumaFileBrowserStore *store, GtkTreeIter *iter, MessageCacheData *data) { @@ -846,48 +846,48 @@ store_end_loading (GeditFileBrowserStore *store, set_item_message (wdata, iter, path, data->message); - gedit_message_bus_send_message_sync (wdata->bus, data->message); + pluma_message_bus_send_message_sync (wdata->bus, data->message); gtk_tree_path_free (path); } static void -register_signals (GeditWindow *window, - GeditFileBrowserWidget *widget) +register_signals (PlumaWindow *window, + PlumaFileBrowserWidget *widget) { - GeditMessageBus *bus = gedit_window_get_message_bus (window); - GeditFileBrowserStore *store; - GeditMessageType *inserted_type; - GeditMessageType *deleted_type; - GeditMessageType *begin_loading_type; - GeditMessageType *end_loading_type; - GeditMessageType *root_changed_type; - - GeditMessage *message; + PlumaMessageBus *bus = pluma_window_get_message_bus (window); + PlumaFileBrowserStore *store; + PlumaMessageType *inserted_type; + PlumaMessageType *deleted_type; + PlumaMessageType *begin_loading_type; + PlumaMessageType *end_loading_type; + PlumaMessageType *root_changed_type; + + PlumaMessage *message; WindowData *data; /* Register signals */ - root_changed_type = gedit_message_bus_register (bus, + root_changed_type = pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "root_changed", 0, "id", G_TYPE_STRING, "uri", G_TYPE_STRING, NULL); - begin_loading_type = gedit_message_bus_register (bus, + begin_loading_type = pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "begin_loading", 0, "id", G_TYPE_STRING, "uri", G_TYPE_STRING, NULL); - end_loading_type = gedit_message_bus_register (bus, + end_loading_type = pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "end_loading", 0, "id", G_TYPE_STRING, "uri", G_TYPE_STRING, NULL); - inserted_type = gedit_message_bus_register (bus, + inserted_type = pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "inserted", 0, "id", G_TYPE_STRING, @@ -895,7 +895,7 @@ register_signals (GeditWindow *window, "is_directory", G_TYPE_BOOLEAN, NULL); - deleted_type = gedit_message_bus_register (bus, + deleted_type = pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "deleted", 0, "id", G_TYPE_STRING, @@ -903,9 +903,9 @@ register_signals (GeditWindow *window, "is_directory", G_TYPE_BOOLEAN, NULL); - store = gedit_file_browser_widget_get_browser_store (widget); + store = pluma_file_browser_widget_get_browser_store (widget); - message = gedit_message_type_instantiate (inserted_type, + message = pluma_message_type_instantiate (inserted_type, "id", NULL, "uri", NULL, "is_directory", FALSE, @@ -921,7 +921,7 @@ register_signals (GeditWindow *window, (GClosureNotify)message_cache_data_free, 0); - message = gedit_message_type_instantiate (deleted_type, + message = pluma_message_type_instantiate (deleted_type, "id", NULL, "uri", NULL, "is_directory", FALSE, @@ -934,7 +934,7 @@ register_signals (GeditWindow *window, (GClosureNotify)message_cache_data_free, 0); - message = gedit_message_type_instantiate (root_changed_type, + message = pluma_message_type_instantiate (root_changed_type, "id", NULL, "uri", NULL, NULL); @@ -946,7 +946,7 @@ register_signals (GeditWindow *window, (GClosureNotify)message_cache_data_free, 0); - message = gedit_message_type_instantiate (begin_loading_type, + message = pluma_message_type_instantiate (begin_loading_type, "id", NULL, "uri", NULL, NULL); @@ -958,7 +958,7 @@ register_signals (GeditWindow *window, (GClosureNotify)message_cache_data_free, 0); - message = gedit_message_type_instantiate (end_loading_type, + message = pluma_message_type_instantiate (end_loading_type, "id", NULL, "uri", NULL, NULL); @@ -972,45 +972,45 @@ register_signals (GeditWindow *window, } static void -message_unregistered (GeditMessageBus *bus, - GeditMessageType *message_type, - GeditWindow *window) +message_unregistered (PlumaMessageBus *bus, + PlumaMessageType *message_type, + PlumaWindow *window) { - gchar *identifier = gedit_message_type_identifier (gedit_message_type_get_object_path (message_type), - gedit_message_type_get_method (message_type)); + gchar *identifier = pluma_message_type_identifier (pluma_message_type_get_object_path (message_type), + pluma_message_type_get_method (message_type)); FilterData *data; WindowData *wdata = get_window_data (window); data = g_hash_table_lookup (wdata->filters, identifier); if (data) - gedit_file_browser_widget_remove_filter (wdata->widget, data->id); + pluma_file_browser_widget_remove_filter (wdata->widget, data->id); g_free (identifier); } void -gedit_file_browser_messages_register (GeditWindow *window, - GeditFileBrowserWidget *widget) +pluma_file_browser_messages_register (PlumaWindow *window, + PlumaFileBrowserWidget *widget) { window_data_new (window, widget); register_methods (window, widget); register_signals (window, widget); - g_signal_connect (gedit_window_get_message_bus (window), + g_signal_connect (pluma_window_get_message_bus (window), "unregistered", G_CALLBACK (message_unregistered), window); } static void -cleanup_signals (GeditWindow *window) +cleanup_signals (PlumaWindow *window) { WindowData *data = get_window_data (window); - GeditFileBrowserStore *store; + PlumaFileBrowserStore *store; - store = gedit_file_browser_widget_get_browser_store (data->widget); + store = pluma_file_browser_widget_get_browser_store (data->widget); g_signal_handler_disconnect (store, data->row_inserted_id); g_signal_handler_disconnect (store, data->row_deleted_id); @@ -1022,12 +1022,12 @@ cleanup_signals (GeditWindow *window) } void -gedit_file_browser_messages_unregister (GeditWindow *window) +pluma_file_browser_messages_unregister (PlumaWindow *window) { - GeditMessageBus *bus = gedit_window_get_message_bus (window); + PlumaMessageBus *bus = pluma_window_get_message_bus (window); cleanup_signals (window); - gedit_message_bus_unregister_all (bus, MESSAGE_OBJECT_PATH); + pluma_message_bus_unregister_all (bus, MESSAGE_OBJECT_PATH); window_data_free (window); } diff --git a/plugins/filebrowser/gedit-file-browser-messages.h b/plugins/filebrowser/pluma-file-browser-messages.h index e62094e8..8f5c2ba4 100755 --- a/plugins/filebrowser/gedit-file-browser-messages.h +++ b/plugins/filebrowser/pluma-file-browser-messages.h @@ -1,5 +1,5 @@ /* - * gedit-file-browser-messages.h - Gedit plugin providing easy file access + * pluma-file-browser-messages.h - Pluma plugin providing easy file access * from the sidepanel * * Copyright (C) 2008 - Jesse van den Kieboom <[email protected]> @@ -19,17 +19,17 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __GEDIT_FILE_BROWSER_MESSAGES_H__ -#define __GEDIT_FILE_BROWSER_MESSAGES_H__ +#ifndef __PLUMA_FILE_BROWSER_MESSAGES_H__ +#define __PLUMA_FILE_BROWSER_MESSAGES_H__ -#include <gedit/gedit-window.h> -#include <gedit/gedit-message-bus.h> -#include "gedit-file-browser-widget.h" +#include <pluma/pluma-window.h> +#include <pluma/pluma-message-bus.h> +#include "pluma-file-browser-widget.h" -void gedit_file_browser_messages_register (GeditWindow *window, - GeditFileBrowserWidget *widget); -void gedit_file_browser_messages_unregister (GeditWindow *window); +void pluma_file_browser_messages_register (PlumaWindow *window, + PlumaFileBrowserWidget *widget); +void pluma_file_browser_messages_unregister (PlumaWindow *window); -#endif /* __GEDIT_FILE_BROWSER_MESSAGES_H__ */ +#endif /* __PLUMA_FILE_BROWSER_MESSAGES_H__ */ // ex:ts=8:noet: diff --git a/plugins/filebrowser/gedit-file-browser-plugin.c b/plugins/filebrowser/pluma-file-browser-plugin.c index f2da19f5..b9ac96d3 100755 --- a/plugins/filebrowser/gedit-file-browser-plugin.c +++ b/plugins/filebrowser/pluma-file-browser-plugin.c @@ -1,5 +1,5 @@ /* - * gedit-file-browser-plugin.c - Gedit plugin providing easy file access + * pluma-file-browser-plugin.c - Pluma plugin providing easy file access * from the sidepanel * * Copyright (C) 2006 - Jesse van den Kieboom <[email protected]> @@ -24,39 +24,39 @@ #include <config.h> #endif -#include <gedit/gedit-commands.h> -#include <gedit/gedit-utils.h> -#include <gedit/gedit-app.h> +#include <pluma/pluma-commands.h> +#include <pluma/pluma-utils.h> +#include <pluma/pluma-app.h> #include <glib/gi18n-lib.h> -#include <gedit/gedit-debug.h> +#include <pluma/pluma-debug.h> #include <mateconf/mateconf-client.h> #include <string.h> -#include "gedit-file-browser-enum-types.h" -#include "gedit-file-browser-plugin.h" -#include "gedit-file-browser-utils.h" -#include "gedit-file-browser-error.h" -#include "gedit-file-browser-widget.h" -#include "gedit-file-browser-messages.h" +#include "pluma-file-browser-enum-types.h" +#include "pluma-file-browser-plugin.h" +#include "pluma-file-browser-utils.h" +#include "pluma-file-browser-error.h" +#include "pluma-file-browser-widget.h" +#include "pluma-file-browser-messages.h" -#define WINDOW_DATA_KEY "GeditFileBrowserPluginWindowData" -#define FILE_BROWSER_BASE_KEY "/apps/gedit-2/plugins/filebrowser" +#define WINDOW_DATA_KEY "PlumaFileBrowserPluginWindowData" +#define FILE_BROWSER_BASE_KEY "/apps/pluma-2/plugins/filebrowser" #define CAJA_CLICK_POLICY_BASE_KEY "/apps/caja/preferences" #define CAJA_CLICK_POLICY_KEY "click_policy" #define CAJA_ENABLE_DELETE_KEY "enable_delete" #define CAJA_CONFIRM_TRASH_KEY "confirm_trash" #define TERMINAL_EXEC_KEY "/desktop/mate/applications/terminal/exec" -#define GEDIT_FILE_BROWSER_PLUGIN_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), GEDIT_TYPE_FILE_BROWSER_PLUGIN, GeditFileBrowserPluginPrivate)) +#define PLUMA_FILE_BROWSER_PLUGIN_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), PLUMA_TYPE_FILE_BROWSER_PLUGIN, PlumaFileBrowserPluginPrivate)) -struct _GeditFileBrowserPluginPrivate +struct _PlumaFileBrowserPluginPrivate { gpointer dummy; }; -typedef struct _GeditFileBrowserPluginData +typedef struct _PlumaFileBrowserPluginData { - GeditFileBrowserWidget * tree_widget; + PlumaFileBrowserWidget * tree_widget; gulong merge_id; GtkActionGroup * action_group; GtkActionGroup * single_selection_action_group; @@ -67,75 +67,75 @@ typedef struct _GeditFileBrowserPluginData guint click_policy_handle; guint enable_delete_handle; guint confirm_trash_handle; -} GeditFileBrowserPluginData; +} PlumaFileBrowserPluginData; -static void on_uri_activated_cb (GeditFileBrowserWidget * widget, +static void on_uri_activated_cb (PlumaFileBrowserWidget * widget, gchar const *uri, - GeditWindow * window); -static void on_error_cb (GeditFileBrowserWidget * widget, + PlumaWindow * window); +static void on_error_cb (PlumaFileBrowserWidget * widget, guint code, gchar const *message, - GeditWindow * window); -static void on_model_set_cb (GeditFileBrowserView * widget, + PlumaWindow * window); +static void on_model_set_cb (PlumaFileBrowserView * widget, GParamSpec *arg1, - GeditWindow * window); -static void on_virtual_root_changed_cb (GeditFileBrowserStore * model, + PlumaWindow * window); +static void on_virtual_root_changed_cb (PlumaFileBrowserStore * model, GParamSpec * param, - GeditWindow * window); -static void on_filter_mode_changed_cb (GeditFileBrowserStore * model, + PlumaWindow * window); +static void on_filter_mode_changed_cb (PlumaFileBrowserStore * model, GParamSpec * param, - GeditWindow * window); -static void on_rename_cb (GeditFileBrowserStore * model, + PlumaWindow * window); +static void on_rename_cb (PlumaFileBrowserStore * model, const gchar * olduri, const gchar * newuri, - GeditWindow * window); -static void on_filter_pattern_changed_cb (GeditFileBrowserWidget * widget, + PlumaWindow * window); +static void on_filter_pattern_changed_cb (PlumaFileBrowserWidget * widget, GParamSpec * param, - GeditWindow * window); -static void on_tab_added_cb (GeditWindow * window, - GeditTab * tab, - GeditFileBrowserPluginData * data); -static gboolean on_confirm_delete_cb (GeditFileBrowserWidget * widget, - GeditFileBrowserStore * store, + PlumaWindow * window); +static void on_tab_added_cb (PlumaWindow * window, + PlumaTab * tab, + PlumaFileBrowserPluginData * data); +static gboolean on_confirm_delete_cb (PlumaFileBrowserWidget * widget, + PlumaFileBrowserStore * store, GList * rows, - GeditWindow * window); -static gboolean on_confirm_no_trash_cb (GeditFileBrowserWidget * widget, + PlumaWindow * window); +static gboolean on_confirm_no_trash_cb (PlumaFileBrowserWidget * widget, GList * files, - GeditWindow * window); - -GEDIT_PLUGIN_REGISTER_TYPE_WITH_CODE (GeditFileBrowserPlugin, filetree_plugin, \ - gedit_file_browser_enum_and_flag_register_type (type_module); \ - gedit_file_browser_store_register_type (type_module); \ - gedit_file_bookmarks_store_register_type (type_module); \ - gedit_file_browser_view_register_type (type_module); \ - gedit_file_browser_widget_register_type (type_module); \ + PlumaWindow * window); + +PLUMA_PLUGIN_REGISTER_TYPE_WITH_CODE (PlumaFileBrowserPlugin, filetree_plugin, \ + pluma_file_browser_enum_and_flag_register_type (type_module); \ + pluma_file_browser_store_register_type (type_module); \ + pluma_file_bookmarks_store_register_type (type_module); \ + pluma_file_browser_view_register_type (type_module); \ + pluma_file_browser_widget_register_type (type_module); \ ) static void -filetree_plugin_init (GeditFileBrowserPlugin * plugin) +filetree_plugin_init (PlumaFileBrowserPlugin * plugin) { - plugin->priv = GEDIT_FILE_BROWSER_PLUGIN_GET_PRIVATE (plugin); + plugin->priv = PLUMA_FILE_BROWSER_PLUGIN_GET_PRIVATE (plugin); } static void filetree_plugin_finalize (GObject * object) { - //GeditFileBrowserPlugin * plugin = GEDIT_FILE_BROWSER_PLUGIN (object); + //PlumaFileBrowserPlugin * plugin = PLUMA_FILE_BROWSER_PLUGIN (object); G_OBJECT_CLASS (filetree_plugin_parent_class)->finalize (object); } -static GeditFileBrowserPluginData * -get_plugin_data (GeditWindow * window) +static PlumaFileBrowserPluginData * +get_plugin_data (PlumaWindow * window) { - return (GeditFileBrowserPluginData *) (g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY)); + return (PlumaFileBrowserPluginData *) (g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY)); } static void -on_end_loading_cb (GeditFileBrowserStore * store, +on_end_loading_cb (PlumaFileBrowserStore * store, GtkTreeIter * iter, - GeditFileBrowserPluginData * data) + PlumaFileBrowserPluginData * data) { /* Disconnect the signal */ g_signal_handler_disconnect (store, data->end_loading_handle); @@ -144,13 +144,13 @@ on_end_loading_cb (GeditFileBrowserStore * store, } static void -prepare_auto_root (GeditFileBrowserPluginData *data) +prepare_auto_root (PlumaFileBrowserPluginData *data) { - GeditFileBrowserStore *store; + PlumaFileBrowserStore *store; data->auto_root = TRUE; - store = gedit_file_browser_widget_get_browser_store (data->tree_widget); + store = pluma_file_browser_widget_get_browser_store (data->tree_widget); if (data->end_loading_handle != 0) { g_signal_handler_disconnect (store, data->end_loading_handle); @@ -164,7 +164,7 @@ prepare_auto_root (GeditFileBrowserPluginData *data) } static void -restore_default_location (GeditFileBrowserPluginData *data) +restore_default_location (PlumaFileBrowserPluginData *data) { gchar * root; gchar * virtual_root; @@ -182,7 +182,7 @@ restore_default_location (GeditFileBrowserPluginData *data) if (bookmarks) { g_object_unref (client); - gedit_file_browser_widget_show_bookmarks (data->tree_widget); + pluma_file_browser_widget_show_bookmarks (data->tree_widget); return; } @@ -205,12 +205,12 @@ restore_default_location (GeditFileBrowserPluginData *data) if (remote || g_file_is_native (file)) { if (virtual_root != NULL && *virtual_root != '\0') { prepare_auto_root (data); - gedit_file_browser_widget_set_root_and_virtual_root (data->tree_widget, + pluma_file_browser_widget_set_root_and_virtual_root (data->tree_widget, root, virtual_root); } else { prepare_auto_root (data); - gedit_file_browser_widget_set_root (data->tree_widget, + pluma_file_browser_widget_set_root (data->tree_widget, root, TRUE); } @@ -225,11 +225,11 @@ restore_default_location (GeditFileBrowserPluginData *data) } static void -restore_filter (GeditFileBrowserPluginData * data) +restore_filter (PlumaFileBrowserPluginData * data) { MateConfClient * client; gchar *filter_mode; - GeditFileBrowserStoreFilterMode mode; + PlumaFileBrowserStoreFilterMode mode; gchar *pattern; client = mateconf_client_get_default (); @@ -242,33 +242,33 @@ restore_filter (GeditFileBrowserPluginData * data) NULL); /* Filter mode */ - mode = gedit_file_browser_store_filter_mode_get_default (); + mode = pluma_file_browser_store_filter_mode_get_default (); if (filter_mode != NULL) { if (strcmp (filter_mode, "hidden") == 0) { - mode = GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN; + mode = PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN; } else if (strcmp (filter_mode, "binary") == 0) { - mode = GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY; + mode = PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY; } else if (strcmp (filter_mode, "hidden_and_binary") == 0 || strcmp (filter_mode, "binary_and_hidden") == 0) { - mode = GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN | - GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY; + mode = PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN | + PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY; } else if (strcmp (filter_mode, "none") == 0 || *filter_mode == '\0') { - mode = GEDIT_FILE_BROWSER_STORE_FILTER_MODE_NONE; + mode = PLUMA_FILE_BROWSER_STORE_FILTER_MODE_NONE; } } /* Set the filter mode */ - gedit_file_browser_store_set_filter_mode ( - gedit_file_browser_widget_get_browser_store (data->tree_widget), + pluma_file_browser_store_set_filter_mode ( + pluma_file_browser_widget_get_browser_store (data->tree_widget), mode); pattern = mateconf_client_get_string (client, FILE_BROWSER_BASE_KEY "/filter_pattern", NULL); - gedit_file_browser_widget_set_filter_pattern (data->tree_widget, + pluma_file_browser_widget_set_filter_pattern (data->tree_widget, pattern); g_object_unref (client); @@ -276,13 +276,13 @@ restore_filter (GeditFileBrowserPluginData * data) g_free (pattern); } -static GeditFileBrowserViewClickPolicy +static PlumaFileBrowserViewClickPolicy click_policy_from_string (gchar const *click_policy) { if (click_policy && strcmp (click_policy, "single") == 0) - return GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE; + return PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE; else - return GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE; + return PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE; } static void @@ -292,12 +292,12 @@ on_click_policy_changed (MateConfClient *client, gpointer user_data) { MateConfValue *value; - GeditFileBrowserPluginData * data; + PlumaFileBrowserPluginData * data; gchar const *click_policy; - GeditFileBrowserViewClickPolicy policy = GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE; - GeditFileBrowserView *view; + PlumaFileBrowserViewClickPolicy policy = PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE; + PlumaFileBrowserView *view; - data = (GeditFileBrowserPluginData *)(user_data); + data = (PlumaFileBrowserPluginData *)(user_data); value = mateconf_entry_get_value (entry); if (value && value->type == MATECONF_VALUE_STRING) { @@ -306,8 +306,8 @@ on_click_policy_changed (MateConfClient *client, policy = click_policy_from_string (click_policy); } - view = gedit_file_browser_widget_get_browser_view (data->tree_widget); - gedit_file_browser_view_set_click_policy (view, policy); + view = pluma_file_browser_widget_get_browser_view (data->tree_widget); + pluma_file_browser_view_set_click_policy (view, policy); } static void @@ -317,10 +317,10 @@ on_enable_delete_changed (MateConfClient *client, gpointer user_data) { MateConfValue *value; - GeditFileBrowserPluginData *data; + PlumaFileBrowserPluginData *data; gboolean enable = FALSE; - data = (GeditFileBrowserPluginData *)(user_data); + data = (PlumaFileBrowserPluginData *)(user_data); value = mateconf_entry_get_value (entry); if (value && value->type == MATECONF_VALUE_BOOL) @@ -336,10 +336,10 @@ on_confirm_trash_changed (MateConfClient *client, gpointer user_data) { MateConfValue *value; - GeditFileBrowserPluginData *data; + PlumaFileBrowserPluginData *data; gboolean enable = FALSE; - data = (GeditFileBrowserPluginData *)(user_data); + data = (PlumaFileBrowserPluginData *)(user_data); value = mateconf_entry_get_value (entry); if (value && value->type == MATECONF_VALUE_BOOL) @@ -349,13 +349,13 @@ on_confirm_trash_changed (MateConfClient *client, } static void -install_caja_prefs (GeditFileBrowserPluginData *data) +install_caja_prefs (PlumaFileBrowserPluginData *data) { MateConfClient *client; gchar *pref; gboolean prefb; - GeditFileBrowserViewClickPolicy policy; - GeditFileBrowserView *view; + PlumaFileBrowserViewClickPolicy policy; + PlumaFileBrowserView *view; client = mateconf_client_get_default (); if (!client) @@ -373,8 +373,8 @@ install_caja_prefs (GeditFileBrowserPluginData *data) policy = click_policy_from_string (pref); - view = gedit_file_browser_widget_get_browser_view (data->tree_widget); - gedit_file_browser_view_set_click_policy (view, policy); + view = pluma_file_browser_widget_get_browser_view (data->tree_widget); + pluma_file_browser_view_set_click_policy (view, policy); if (pref) { data->click_policy_handle = @@ -420,8 +420,8 @@ install_caja_prefs (GeditFileBrowserPluginData *data) } static void -set_root_from_doc (GeditFileBrowserPluginData * data, - GeditDocument * doc) +set_root_from_doc (PlumaFileBrowserPluginData * data, + PlumaDocument * doc) { GFile *file; GFile *parent; @@ -429,7 +429,7 @@ set_root_from_doc (GeditFileBrowserPluginData * data, if (doc == NULL) return; - file = gedit_document_get_location (doc); + file = pluma_document_get_location (doc); if (file == NULL) return; @@ -440,7 +440,7 @@ set_root_from_doc (GeditFileBrowserPluginData * data, root = g_file_get_uri (parent); - gedit_file_browser_widget_set_root (data->tree_widget, + pluma_file_browser_widget_set_root (data->tree_widget, root, TRUE); @@ -453,13 +453,13 @@ set_root_from_doc (GeditFileBrowserPluginData * data, static void on_action_set_active_root (GtkAction * action, - GeditWindow * window) + PlumaWindow * window) { - GeditFileBrowserPluginData *data; + PlumaFileBrowserPluginData *data; data = get_plugin_data (window); set_root_from_doc (data, - gedit_window_get_active_document (window)); + pluma_window_get_active_document (window)); } static gchar * @@ -488,9 +488,9 @@ get_terminal (void) static void on_action_open_terminal (GtkAction * action, - GeditWindow * window) + PlumaWindow * window) { - GeditFileBrowserPluginData * data; + PlumaFileBrowserPluginData * data; gchar * terminal; gchar * wd = NULL; gchar * local; @@ -498,18 +498,18 @@ on_action_open_terminal (GtkAction * action, GFile * file; GtkTreeIter iter; - GeditFileBrowserStore * store; + PlumaFileBrowserStore * store; data = get_plugin_data (window); /* Get the current directory */ - if (!gedit_file_browser_widget_get_selected_directory (data->tree_widget, &iter)) + if (!pluma_file_browser_widget_get_selected_directory (data->tree_widget, &iter)) return; - store = gedit_file_browser_widget_get_browser_store (data->tree_widget); + store = pluma_file_browser_widget_get_browser_store (data->tree_widget); gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, - GEDIT_FILE_BROWSER_STORE_COLUMN_URI, + PLUMA_FILE_BROWSER_STORE_COLUMN_URI, &wd, -1); @@ -541,9 +541,9 @@ on_action_open_terminal (GtkAction * action, static void on_selection_changed_cb (GtkTreeSelection *selection, - GeditWindow *window) + PlumaWindow *window) { - GeditFileBrowserPluginData * data; + PlumaFileBrowserPluginData * data; GtkTreeView * tree_view; GtkTreeModel * model; GtkTreeIter iter; @@ -552,20 +552,20 @@ on_selection_changed_cb (GtkTreeSelection *selection, data = get_plugin_data (window); - tree_view = GTK_TREE_VIEW (gedit_file_browser_widget_get_browser_view (data->tree_widget)); + tree_view = GTK_TREE_VIEW (pluma_file_browser_widget_get_browser_view (data->tree_widget)); model = gtk_tree_view_get_model (tree_view); - if (!GEDIT_IS_FILE_BROWSER_STORE (model)) + if (!PLUMA_IS_FILE_BROWSER_STORE (model)) return; - sensitive = gedit_file_browser_widget_get_selected_directory (data->tree_widget, &iter); + sensitive = pluma_file_browser_widget_get_selected_directory (data->tree_widget, &iter); if (sensitive) { gtk_tree_model_get (model, &iter, - GEDIT_FILE_BROWSER_STORE_COLUMN_URI, + PLUMA_FILE_BROWSER_STORE_COLUMN_URI, &uri, -1); - sensitive = gedit_utils_uri_has_file_scheme (uri); + sensitive = pluma_utils_uri_has_file_scheme (uri); g_free (uri); } @@ -608,15 +608,15 @@ static GtkActionEntry extra_single_selection_actions[] = { }; static void -add_popup_ui (GeditWindow * window) +add_popup_ui (PlumaWindow * window) { - GeditFileBrowserPluginData * data; + PlumaFileBrowserPluginData * data; GtkUIManager * manager; GtkActionGroup * action_group; GError * error = NULL; data = get_plugin_data (window); - manager = gedit_file_browser_widget_get_ui_manager (data->tree_widget); + manager = pluma_file_browser_widget_get_ui_manager (data->tree_widget); action_group = gtk_action_group_new ("FileBrowserPluginExtra"); gtk_action_group_set_translation_domain (action_group, NULL); @@ -648,13 +648,13 @@ add_popup_ui (GeditWindow * window) } static void -remove_popup_ui (GeditWindow * window) +remove_popup_ui (PlumaWindow * window) { - GeditFileBrowserPluginData * data; + PlumaFileBrowserPluginData * data; GtkUIManager * manager; data = get_plugin_data (window); - manager = gedit_file_browser_widget_get_ui_manager (data->tree_widget); + manager = pluma_file_browser_widget_get_ui_manager (data->tree_widget); gtk_ui_manager_remove_ui (manager, data->merge_id); gtk_ui_manager_remove_action_group (manager, data->action_group); @@ -665,35 +665,35 @@ remove_popup_ui (GeditWindow * window) } static void -impl_updateui (GeditPlugin * plugin, GeditWindow * window) +impl_updateui (PlumaPlugin * plugin, PlumaWindow * window) { - GeditFileBrowserPluginData * data; - GeditDocument * doc; + PlumaFileBrowserPluginData * data; + PlumaDocument * doc; data = get_plugin_data (window); - doc = gedit_window_get_active_document (window); + doc = pluma_window_get_active_document (window); gtk_action_set_sensitive (gtk_action_group_get_action (data->action_group, "SetActiveRoot"), doc != NULL && - !gedit_document_is_untitled (doc)); + !pluma_document_is_untitled (doc)); } static void -impl_activate (GeditPlugin * plugin, GeditWindow * window) +impl_activate (PlumaPlugin * plugin, PlumaWindow * window) { - GeditPanel * panel; - GeditFileBrowserPluginData * data; + PlumaPanel * panel; + PlumaFileBrowserPluginData * data; GtkWidget * image; GdkPixbuf * pixbuf; - GeditFileBrowserStore * store; + PlumaFileBrowserStore * store; gchar *data_dir; - data = g_new0 (GeditFileBrowserPluginData, 1); + data = g_new0 (PlumaFileBrowserPluginData, 1); - data_dir = gedit_plugin_get_data_dir (plugin); - data->tree_widget = GEDIT_FILE_BROWSER_WIDGET (gedit_file_browser_widget_new (data_dir)); + data_dir = pluma_plugin_get_data_dir (plugin); + data->tree_widget = PLUMA_FILE_BROWSER_WIDGET (pluma_file_browser_widget_new (data_dir)); g_free (data_dir); g_signal_connect (data->tree_widget, @@ -719,14 +719,14 @@ impl_activate (GeditPlugin * plugin, GeditWindow * window) window); g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW - (gedit_file_browser_widget_get_browser_view + (pluma_file_browser_widget_get_browser_view (data->tree_widget))), "changed", G_CALLBACK (on_selection_changed_cb), window); - panel = gedit_window_get_side_panel (window); - pixbuf = gedit_file_browser_utils_pixbuf_from_theme("system-file-manager", + panel = pluma_window_get_side_panel (window); + pixbuf = pluma_file_browser_utils_pixbuf_from_theme("system-file-manager", GTK_ICON_SIZE_MENU); if (pixbuf) { @@ -737,7 +737,7 @@ impl_activate (GeditPlugin * plugin, GeditWindow * window) } gtk_widget_show(image); - gedit_panel_add_item (panel, + pluma_panel_add_item (panel, GTK_WIDGET (data->tree_widget), _("File Browser"), image); @@ -753,12 +753,12 @@ impl_activate (GeditPlugin * plugin, GeditWindow * window) install_caja_prefs (data); /* Connect signals to store the last visited location */ - g_signal_connect (gedit_file_browser_widget_get_browser_view (data->tree_widget), + g_signal_connect (pluma_file_browser_widget_get_browser_view (data->tree_widget), "notify::model", G_CALLBACK (on_model_set_cb), window); - store = gedit_file_browser_widget_get_browser_store (data->tree_widget); + store = pluma_file_browser_widget_get_browser_store (data->tree_widget); g_signal_connect (store, "notify::virtual-root", G_CALLBACK (on_virtual_root_changed_cb), @@ -780,22 +780,22 @@ impl_activate (GeditPlugin * plugin, GeditWindow * window) data); /* Register messages on the bus */ - gedit_file_browser_messages_register (window, data->tree_widget); + pluma_file_browser_messages_register (window, data->tree_widget); impl_updateui (plugin, window); } static void -impl_deactivate (GeditPlugin * plugin, GeditWindow * window) +impl_deactivate (PlumaPlugin * plugin, PlumaWindow * window) { - GeditFileBrowserPluginData * data; - GeditPanel * panel; + PlumaFileBrowserPluginData * data; + PlumaPanel * panel; MateConfClient *client; data = get_plugin_data (window); /* Unregister messages from the bus */ - gedit_file_browser_messages_unregister (window); + pluma_file_browser_messages_unregister (window); /* Disconnect signals */ g_signal_handlers_disconnect_by_func (window, @@ -817,18 +817,18 @@ impl_deactivate (GeditPlugin * plugin, GeditWindow * window) g_object_unref (client); remove_popup_ui (window); - panel = gedit_window_get_side_panel (window); - gedit_panel_remove_item (panel, GTK_WIDGET (data->tree_widget)); + panel = pluma_window_get_side_panel (window); + pluma_panel_remove_item (panel, GTK_WIDGET (data->tree_widget)); g_free (data); g_object_set_data (G_OBJECT (window), WINDOW_DATA_KEY, NULL); } static void -filetree_plugin_class_init (GeditFileBrowserPluginClass * klass) +filetree_plugin_class_init (PlumaFileBrowserPluginClass * klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - GeditPluginClass * plugin_class = GEDIT_PLUGIN_CLASS (klass); + PlumaPluginClass * plugin_class = PLUMA_PLUGIN_CLASS (klass); object_class->finalize = filetree_plugin_finalize; @@ -837,64 +837,64 @@ filetree_plugin_class_init (GeditFileBrowserPluginClass * klass) plugin_class->update_ui = impl_updateui; g_type_class_add_private (object_class, - sizeof (GeditFileBrowserPluginPrivate)); + sizeof (PlumaFileBrowserPluginPrivate)); } /* Callbacks */ static void -on_uri_activated_cb (GeditFileBrowserWidget * tree_widget, - gchar const *uri, GeditWindow * window) +on_uri_activated_cb (PlumaFileBrowserWidget * tree_widget, + gchar const *uri, PlumaWindow * window) { - gedit_commands_load_uri (window, uri, NULL, 0); + pluma_commands_load_uri (window, uri, NULL, 0); } static void -on_error_cb (GeditFileBrowserWidget * tree_widget, - guint code, gchar const *message, GeditWindow * window) +on_error_cb (PlumaFileBrowserWidget * tree_widget, + guint code, gchar const *message, PlumaWindow * window) { gchar * title; GtkWidget * dlg; - GeditFileBrowserPluginData * data; + PlumaFileBrowserPluginData * data; data = get_plugin_data (window); /* Do not show the error when the root has been set automatically */ - if (data->auto_root && (code == GEDIT_FILE_BROWSER_ERROR_SET_ROOT || - code == GEDIT_FILE_BROWSER_ERROR_LOAD_DIRECTORY)) + if (data->auto_root && (code == PLUMA_FILE_BROWSER_ERROR_SET_ROOT || + code == PLUMA_FILE_BROWSER_ERROR_LOAD_DIRECTORY)) { /* Show bookmarks */ - gedit_file_browser_widget_show_bookmarks (data->tree_widget); + pluma_file_browser_widget_show_bookmarks (data->tree_widget); return; } switch (code) { - case GEDIT_FILE_BROWSER_ERROR_NEW_DIRECTORY: + case PLUMA_FILE_BROWSER_ERROR_NEW_DIRECTORY: title = _("An error occurred while creating a new directory"); break; - case GEDIT_FILE_BROWSER_ERROR_NEW_FILE: + case PLUMA_FILE_BROWSER_ERROR_NEW_FILE: title = _("An error occurred while creating a new file"); break; - case GEDIT_FILE_BROWSER_ERROR_RENAME: + case PLUMA_FILE_BROWSER_ERROR_RENAME: title = _ ("An error occurred while renaming a file or directory"); break; - case GEDIT_FILE_BROWSER_ERROR_DELETE: + case PLUMA_FILE_BROWSER_ERROR_DELETE: title = _ ("An error occurred while deleting a file or directory"); break; - case GEDIT_FILE_BROWSER_ERROR_OPEN_DIRECTORY: + case PLUMA_FILE_BROWSER_ERROR_OPEN_DIRECTORY: title = _ ("An error occurred while opening a directory in the file manager"); break; - case GEDIT_FILE_BROWSER_ERROR_SET_ROOT: + case PLUMA_FILE_BROWSER_ERROR_SET_ROOT: title = _("An error occurred while setting a root directory"); break; - case GEDIT_FILE_BROWSER_ERROR_LOAD_DIRECTORY: + case PLUMA_FILE_BROWSER_ERROR_LOAD_DIRECTORY: title = _("An error occurred while loading a directory"); break; @@ -916,15 +916,15 @@ on_error_cb (GeditFileBrowserWidget * tree_widget, } static void -on_model_set_cb (GeditFileBrowserView * widget, +on_model_set_cb (PlumaFileBrowserView * widget, GParamSpec *arg1, - GeditWindow * window) + PlumaWindow * window) { - GeditFileBrowserPluginData * data = get_plugin_data (window); + PlumaFileBrowserPluginData * data = get_plugin_data (window); GtkTreeModel * model; MateConfClient * client; - model = gtk_tree_view_get_model (GTK_TREE_VIEW (gedit_file_browser_widget_get_browser_view (data->tree_widget))); + model = gtk_tree_view_get_model (GTK_TREE_VIEW (pluma_file_browser_widget_get_browser_view (data->tree_widget))); if (model == NULL) return; @@ -932,38 +932,38 @@ on_model_set_cb (GeditFileBrowserView * widget, client = mateconf_client_get_default (); mateconf_client_set_bool (client, FILE_BROWSER_BASE_KEY "/on_load/tree_view", - GEDIT_IS_FILE_BROWSER_STORE (model), + PLUMA_IS_FILE_BROWSER_STORE (model), NULL); g_object_unref (client); } static void -on_filter_mode_changed_cb (GeditFileBrowserStore * model, +on_filter_mode_changed_cb (PlumaFileBrowserStore * model, GParamSpec * param, - GeditWindow * window) + PlumaWindow * window) { MateConfClient * client; - GeditFileBrowserStoreFilterMode mode; + PlumaFileBrowserStoreFilterMode mode; client = mateconf_client_get_default (); if (!client) return; - mode = gedit_file_browser_store_get_filter_mode (model); + mode = pluma_file_browser_store_get_filter_mode (model); - if ((mode & GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN) && - (mode & GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY)) { + if ((mode & PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN) && + (mode & PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY)) { mateconf_client_set_string (client, FILE_BROWSER_BASE_KEY "/filter_mode", "hidden_and_binary", NULL); - } else if (mode & GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN) { + } else if (mode & PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN) { mateconf_client_set_string (client, FILE_BROWSER_BASE_KEY "/filter_mode", "hidden", NULL); - } else if (mode & GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY) { + } else if (mode & PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY) { mateconf_client_set_string (client, FILE_BROWSER_BASE_KEY "/filter_mode", "binary", @@ -980,30 +980,30 @@ on_filter_mode_changed_cb (GeditFileBrowserStore * model, } static void -on_rename_cb (GeditFileBrowserStore * store, +on_rename_cb (PlumaFileBrowserStore * store, const gchar * olduri, const gchar * newuri, - GeditWindow * window) + PlumaWindow * window) { - GeditApp * app; + PlumaApp * app; GList * documents; GList * item; - GeditDocument * doc; + PlumaDocument * doc; GFile * docfile; GFile * oldfile; GFile * newfile; gchar * uri; /* Find all documents and set its uri to newuri where it matches olduri */ - app = gedit_app_get_default (); - documents = gedit_app_get_documents (app); + app = pluma_app_get_default (); + documents = pluma_app_get_documents (app); oldfile = g_file_new_for_uri (olduri); newfile = g_file_new_for_uri (newuri); for (item = documents; item; item = item->next) { - doc = GEDIT_DOCUMENT (item->data); - uri = gedit_document_get_uri (doc); + doc = PLUMA_DOCUMENT (item->data); + uri = pluma_document_get_uri (doc); if (!uri) continue; @@ -1011,7 +1011,7 @@ on_rename_cb (GeditFileBrowserStore * store, docfile = g_file_new_for_uri (uri); if (g_file_equal (docfile, oldfile)) { - gedit_document_set_uri (doc, newuri); + pluma_document_set_uri (doc, newuri); } else { gchar *relative; @@ -1027,7 +1027,7 @@ on_rename_cb (GeditFileBrowserStore * store, docfile = g_file_get_child (newfile, relative); uri = g_file_get_uri (docfile); - gedit_document_set_uri (doc, uri); + pluma_document_set_uri (doc, uri); } g_free (relative); @@ -1044,9 +1044,9 @@ on_rename_cb (GeditFileBrowserStore * store, } static void -on_filter_pattern_changed_cb (GeditFileBrowserWidget * widget, +on_filter_pattern_changed_cb (PlumaFileBrowserWidget * widget, GParamSpec * param, - GeditWindow * window) + PlumaWindow * window) { MateConfClient * client; gchar * pattern; @@ -1073,16 +1073,16 @@ on_filter_pattern_changed_cb (GeditFileBrowserWidget * widget, } static void -on_virtual_root_changed_cb (GeditFileBrowserStore * store, +on_virtual_root_changed_cb (PlumaFileBrowserStore * store, GParamSpec * param, - GeditWindow * window) + PlumaWindow * window) { - GeditFileBrowserPluginData * data = get_plugin_data (window); + PlumaFileBrowserPluginData * data = get_plugin_data (window); gchar * root; gchar * virtual_root; MateConfClient * client; - root = gedit_file_browser_store_get_root (store); + root = pluma_file_browser_store_get_root (store); if (!root) return; @@ -1097,7 +1097,7 @@ on_virtual_root_changed_cb (GeditFileBrowserStore * store, root, NULL); - virtual_root = gedit_file_browser_store_get_virtual_root (store); + virtual_root = pluma_file_browser_store_get_virtual_root (store); if (!virtual_root) { /* Set virtual to same as root then */ @@ -1122,9 +1122,9 @@ on_virtual_root_changed_cb (GeditFileBrowserStore * store, } static void -on_tab_added_cb (GeditWindow * window, - GeditTab * tab, - GeditFileBrowserPluginData * data) +on_tab_added_cb (PlumaWindow * window, + PlumaTab * tab, + PlumaFileBrowserPluginData * data) { MateConfClient *client; gboolean open; @@ -1140,14 +1140,14 @@ on_tab_added_cb (GeditWindow * window, NULL); if (open) { - GeditDocument *doc; + PlumaDocument *doc; gchar *uri; - doc = gedit_tab_get_document (tab); + doc = pluma_tab_get_document (tab); - uri = gedit_document_get_uri (doc); + uri = pluma_document_get_uri (doc); - if (uri != NULL && gedit_utils_uri_has_file_scheme (uri)) { + if (uri != NULL && pluma_utils_uri_has_file_scheme (uri)) { prepare_auto_root (data); set_root_from_doc (data, doc); load_default = FALSE; @@ -1175,16 +1175,16 @@ get_filename_from_path (GtkTreeModel *model, GtkTreePath *path) gtk_tree_model_get_iter (model, &iter, path); gtk_tree_model_get (model, &iter, - GEDIT_FILE_BROWSER_STORE_COLUMN_URI, &uri, + PLUMA_FILE_BROWSER_STORE_COLUMN_URI, &uri, -1); - return gedit_file_browser_utils_uri_basename (uri); + return pluma_file_browser_utils_uri_basename (uri); } static gboolean -on_confirm_no_trash_cb (GeditFileBrowserWidget * widget, +on_confirm_no_trash_cb (PlumaFileBrowserWidget * widget, GList * files, - GeditWindow * window) + PlumaWindow * window) { gchar *normal; gchar *message; @@ -1194,14 +1194,14 @@ on_confirm_no_trash_cb (GeditFileBrowserWidget * widget, message = _("Cannot move file to trash, do you\nwant to delete permanently?"); if (files->next == NULL) { - normal = gedit_file_browser_utils_file_basename (G_FILE (files->data)); + normal = pluma_file_browser_utils_file_basename (G_FILE (files->data)); secondary = g_strdup_printf (_("The file \"%s\" cannot be moved to the trash."), normal); g_free (normal); } else { secondary = g_strdup (_("The selected files cannot be moved to the trash.")); } - result = gedit_file_browser_utils_confirmation_dialog (window, + result = pluma_file_browser_utils_confirmation_dialog (window, GTK_MESSAGE_QUESTION, message, secondary, @@ -1213,16 +1213,16 @@ on_confirm_no_trash_cb (GeditFileBrowserWidget * widget, } static gboolean -on_confirm_delete_cb (GeditFileBrowserWidget *widget, - GeditFileBrowserStore *store, +on_confirm_delete_cb (PlumaFileBrowserWidget *widget, + PlumaFileBrowserStore *store, GList *paths, - GeditWindow *window) + PlumaWindow *window) { gchar *normal; gchar *message; gchar *secondary; gboolean result; - GeditFileBrowserPluginData *data; + PlumaFileBrowserPluginData *data; data = get_plugin_data (window); @@ -1239,7 +1239,7 @@ on_confirm_delete_cb (GeditFileBrowserWidget *widget, secondary = _("If you delete an item, it is permanently lost."); - result = gedit_file_browser_utils_confirmation_dialog (window, + result = pluma_file_browser_utils_confirmation_dialog (window, GTK_MESSAGE_QUESTION, message, secondary, diff --git a/plugins/filebrowser/pluma-file-browser-plugin.h b/plugins/filebrowser/pluma-file-browser-plugin.h new file mode 100755 index 00000000..634c56af --- /dev/null +++ b/plugins/filebrowser/pluma-file-browser-plugin.h @@ -0,0 +1,71 @@ +/* + * pluma-file-browser-plugin.h - Pluma plugin providing easy file access + * from the sidepanel + * + * Copyright (C) 2006 - Jesse van den Kieboom <[email protected]> + * + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __PLUMA_FILE_BROWSER_PLUGIN_H__ +#define __PLUMA_FILE_BROWSER_PLUGIN_H__ + +#include <glib.h> +#include <glib-object.h> +#include <pluma/pluma-plugin.h> + +G_BEGIN_DECLS +/* + * Type checking and casting macros + */ +#define PLUMA_TYPE_FILE_BROWSER_PLUGIN (filetree_plugin_get_type ()) +#define PLUMA_FILE_BROWSER_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PLUMA_TYPE_FILE_BROWSER_PLUGIN, PlumaFileBrowserPlugin)) +#define PLUMA_FILE_BROWSER_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PLUMA_TYPE_FILE_BROWSER_PLUGIN, PlumaFileBrowserPluginClass)) +#define PLUMA_IS_FILE_BROWSER_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PLUMA_TYPE_FILE_BROWSER_PLUGIN)) +#define PLUMA_IS_FILE_BROWSER_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PLUMA_TYPE_FILE_BROWSER_PLUGIN)) +#define PLUMA_FILE_BROWSER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), PLUMA_TYPE_FILE_BROWSER_PLUGIN, PlumaFileBrowserPluginClass)) + +/* Private structure type */ +typedef struct _PlumaFileBrowserPluginPrivate PlumaFileBrowserPluginPrivate; +typedef struct _PlumaFileBrowserPlugin PlumaFileBrowserPlugin; +typedef struct _PlumaFileBrowserPluginClass PlumaFileBrowserPluginClass; + +struct _PlumaFileBrowserPlugin +{ + PlumaPlugin parent_instance; + + /*< private > */ + PlumaFileBrowserPluginPrivate *priv; +}; + + + +struct _PlumaFileBrowserPluginClass +{ + PlumaPluginClass parent_class; +}; + +/* + * Public methods + */ +GType filetree_plugin_get_type (void) G_GNUC_CONST; + +/* All the plugins must implement this function */ +G_MODULE_EXPORT GType register_pluma_plugin (GTypeModule * module); + +G_END_DECLS +#endif /* __PLUMA_FILE_BROWSER_PLUGIN_H__ */ + +// ex:ts=8:noet: diff --git a/plugins/filebrowser/gedit-file-browser-store.c b/plugins/filebrowser/pluma-file-browser-store.c index 6c4f5b51..a046fe42 100755 --- a/plugins/filebrowser/gedit-file-browser-store.c +++ b/plugins/filebrowser/pluma-file-browser-store.c @@ -1,5 +1,5 @@ /* - * gedit-file-browser-store.c - Gedit plugin providing easy file access + * pluma-file-browser-store.c - Pluma plugin providing easy file access * from the sidepanel * * Copyright (C) 2006 - Jesse van den Kieboom <[email protected]> @@ -26,18 +26,18 @@ #include <string.h> #include <glib/gi18n-lib.h> #include <gio/gio.h> -#include <gedit/gedit-plugin.h> -#include <gedit/gedit-utils.h> +#include <pluma/pluma-plugin.h> +#include <pluma/pluma-utils.h> -#include "gedit-file-browser-store.h" -#include "gedit-file-browser-marshal.h" -#include "gedit-file-browser-enum-types.h" -#include "gedit-file-browser-error.h" -#include "gedit-file-browser-utils.h" +#include "pluma-file-browser-store.h" +#include "pluma-file-browser-marshal.h" +#include "pluma-file-browser-enum-types.h" +#include "pluma-file-browser-error.h" +#include "pluma-file-browser-utils.h" -#define GEDIT_FILE_BROWSER_STORE_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), \ - GEDIT_TYPE_FILE_BROWSER_STORE, \ - GeditFileBrowserStorePrivate)) +#define PLUMA_FILE_BROWSER_STORE_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), \ + PLUMA_TYPE_FILE_BROWSER_STORE, \ + PlumaFileBrowserStorePrivate)) #define NODE_IS_DIR(node) (FILE_IS_DIR((node)->flags)) #define NODE_IS_HIDDEN(node) (FILE_IS_HIDDEN((node)->flags)) @@ -66,7 +66,7 @@ typedef gint (*SortFunc) (FileBrowserNode * node1, struct _AsyncData { - GeditFileBrowserStore * model; + PlumaFileBrowserStore * model; GCancellable * cancellable; gboolean trash; GList * files; @@ -82,7 +82,7 @@ struct _AsyncNode }; typedef struct { - GeditFileBrowserStore * model; + PlumaFileBrowserStore * model; gchar * virtual_root; GMountOperation * operation; GCancellable * cancellable; @@ -110,17 +110,17 @@ struct _FileBrowserNodeDir GCancellable *cancellable; GFileMonitor *monitor; - GeditFileBrowserStore *model; + PlumaFileBrowserStore *model; }; -struct _GeditFileBrowserStorePrivate +struct _PlumaFileBrowserStorePrivate { FileBrowserNode *root; FileBrowserNode *virtual_root; - GType column_types[GEDIT_FILE_BROWSER_STORE_COLUMN_NUM]; + GType column_types[PLUMA_FILE_BROWSER_STORE_COLUMN_NUM]; - GeditFileBrowserStoreFilterMode filter_mode; - GeditFileBrowserStoreFilterFunc filter_func; + PlumaFileBrowserStoreFilterMode filter_mode; + PlumaFileBrowserStoreFilterFunc filter_func; gpointer filter_user_data; SortFunc sort_func; @@ -129,82 +129,82 @@ struct _GeditFileBrowserStorePrivate MountInfo *mount_info; }; -static FileBrowserNode *model_find_node (GeditFileBrowserStore *model, +static FileBrowserNode *model_find_node (PlumaFileBrowserStore *model, FileBrowserNode *node, GFile *uri); -static void model_remove_node (GeditFileBrowserStore * model, +static void model_remove_node (PlumaFileBrowserStore * model, FileBrowserNode * node, GtkTreePath * path, gboolean free_nodes); -static void set_virtual_root_from_node (GeditFileBrowserStore * model, +static void set_virtual_root_from_node (PlumaFileBrowserStore * model, FileBrowserNode * node); -static void gedit_file_browser_store_iface_init (GtkTreeModelIface * iface); -static GtkTreeModelFlags gedit_file_browser_store_get_flags (GtkTreeModel * tree_model); -static gint gedit_file_browser_store_get_n_columns (GtkTreeModel * tree_model); -static GType gedit_file_browser_store_get_column_type (GtkTreeModel * tree_model, +static void pluma_file_browser_store_iface_init (GtkTreeModelIface * iface); +static GtkTreeModelFlags pluma_file_browser_store_get_flags (GtkTreeModel * tree_model); +static gint pluma_file_browser_store_get_n_columns (GtkTreeModel * tree_model); +static GType pluma_file_browser_store_get_column_type (GtkTreeModel * tree_model, gint index); -static gboolean gedit_file_browser_store_get_iter (GtkTreeModel * tree_model, +static gboolean pluma_file_browser_store_get_iter (GtkTreeModel * tree_model, GtkTreeIter * iter, GtkTreePath * path); -static GtkTreePath *gedit_file_browser_store_get_path (GtkTreeModel * tree_model, +static GtkTreePath *pluma_file_browser_store_get_path (GtkTreeModel * tree_model, GtkTreeIter * iter); -static void gedit_file_browser_store_get_value (GtkTreeModel * tree_model, +static void pluma_file_browser_store_get_value (GtkTreeModel * tree_model, GtkTreeIter * iter, gint column, GValue * value); -static gboolean gedit_file_browser_store_iter_next (GtkTreeModel * tree_model, +static gboolean pluma_file_browser_store_iter_next (GtkTreeModel * tree_model, GtkTreeIter * iter); -static gboolean gedit_file_browser_store_iter_children (GtkTreeModel * tree_model, +static gboolean pluma_file_browser_store_iter_children (GtkTreeModel * tree_model, GtkTreeIter * iter, GtkTreeIter * parent); -static gboolean gedit_file_browser_store_iter_has_child (GtkTreeModel * tree_model, +static gboolean pluma_file_browser_store_iter_has_child (GtkTreeModel * tree_model, GtkTreeIter * iter); -static gint gedit_file_browser_store_iter_n_children (GtkTreeModel * tree_model, +static gint pluma_file_browser_store_iter_n_children (GtkTreeModel * tree_model, GtkTreeIter * iter); -static gboolean gedit_file_browser_store_iter_nth_child (GtkTreeModel * tree_model, +static gboolean pluma_file_browser_store_iter_nth_child (GtkTreeModel * tree_model, GtkTreeIter * iter, GtkTreeIter * parent, gint n); -static gboolean gedit_file_browser_store_iter_parent (GtkTreeModel * tree_model, +static gboolean pluma_file_browser_store_iter_parent (GtkTreeModel * tree_model, GtkTreeIter * iter, GtkTreeIter * child); -static void gedit_file_browser_store_row_inserted (GtkTreeModel * tree_model, +static void pluma_file_browser_store_row_inserted (GtkTreeModel * tree_model, GtkTreePath * path, GtkTreeIter * iter); -static void gedit_file_browser_store_drag_source_init (GtkTreeDragSourceIface * iface); -static gboolean gedit_file_browser_store_row_draggable (GtkTreeDragSource * drag_source, +static void pluma_file_browser_store_drag_source_init (GtkTreeDragSourceIface * iface); +static gboolean pluma_file_browser_store_row_draggable (GtkTreeDragSource * drag_source, GtkTreePath * path); -static gboolean gedit_file_browser_store_drag_data_delete (GtkTreeDragSource * drag_source, +static gboolean pluma_file_browser_store_drag_data_delete (GtkTreeDragSource * drag_source, GtkTreePath * path); -static gboolean gedit_file_browser_store_drag_data_get (GtkTreeDragSource * drag_source, +static gboolean pluma_file_browser_store_drag_data_get (GtkTreeDragSource * drag_source, GtkTreePath * path, GtkSelectionData * selection_data); -static void file_browser_node_free (GeditFileBrowserStore * model, +static void file_browser_node_free (PlumaFileBrowserStore * model, FileBrowserNode * node); -static void model_add_node (GeditFileBrowserStore * model, +static void model_add_node (PlumaFileBrowserStore * model, FileBrowserNode * child, FileBrowserNode * parent); -static void model_clear (GeditFileBrowserStore * model, +static void model_clear (PlumaFileBrowserStore * model, gboolean free_nodes); static gint model_sort_default (FileBrowserNode * node1, FileBrowserNode * node2); -static void model_check_dummy (GeditFileBrowserStore * model, +static void model_check_dummy (PlumaFileBrowserStore * model, FileBrowserNode * node); static void next_files_async (GFileEnumerator * enumerator, AsyncNode * async); -GEDIT_PLUGIN_DEFINE_TYPE_WITH_CODE (GeditFileBrowserStore, gedit_file_browser_store, +PLUMA_PLUGIN_DEFINE_TYPE_WITH_CODE (PlumaFileBrowserStore, pluma_file_browser_store, G_TYPE_OBJECT, - GEDIT_PLUGIN_IMPLEMENT_INTERFACE (gedit_file_browser_store_tree_model, + PLUMA_PLUGIN_IMPLEMENT_INTERFACE (pluma_file_browser_store_tree_model, GTK_TYPE_TREE_MODEL, - gedit_file_browser_store_iface_init) - GEDIT_PLUGIN_IMPLEMENT_INTERFACE (gedit_file_browser_store_drag_source, + pluma_file_browser_store_iface_init) + PLUMA_PLUGIN_IMPLEMENT_INTERFACE (pluma_file_browser_store_drag_source, GTK_TYPE_TREE_DRAG_SOURCE, - gedit_file_browser_store_drag_source_init)) + pluma_file_browser_store_drag_source_init)) /* Properties */ enum { @@ -232,7 +232,7 @@ enum static guint model_signals[NUM_SIGNALS] = { 0 }; static void -cancel_mount_operation (GeditFileBrowserStore *obj) +cancel_mount_operation (PlumaFileBrowserStore *obj) { if (obj->priv->mount_info != NULL) { @@ -243,9 +243,9 @@ cancel_mount_operation (GeditFileBrowserStore *obj) } static void -gedit_file_browser_store_finalize (GObject * object) +pluma_file_browser_store_finalize (GObject * object) { - GeditFileBrowserStore *obj = GEDIT_FILE_BROWSER_STORE (object); + PlumaFileBrowserStore *obj = PLUMA_FILE_BROWSER_STORE (object); GSList *item; /* Free all the nodes */ @@ -263,7 +263,7 @@ gedit_file_browser_store_finalize (GObject * object) cancel_mount_operation (obj); g_slist_free (obj->priv->async_handles); - G_OBJECT_CLASS (gedit_file_browser_store_parent_class)->finalize (object); + G_OBJECT_CLASS (pluma_file_browser_store_parent_class)->finalize (object); } static void @@ -281,12 +281,12 @@ set_gvalue_from_node (GValue *value, } static void -gedit_file_browser_store_get_property (GObject *object, +pluma_file_browser_store_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { - GeditFileBrowserStore *obj = GEDIT_FILE_BROWSER_STORE (object); + PlumaFileBrowserStore *obj = PLUMA_FILE_BROWSER_STORE (object); switch (prop_id) { @@ -306,17 +306,17 @@ gedit_file_browser_store_get_property (GObject *object, } static void -gedit_file_browser_store_set_property (GObject *object, +pluma_file_browser_store_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { - GeditFileBrowserStore *obj = GEDIT_FILE_BROWSER_STORE (object); + PlumaFileBrowserStore *obj = PLUMA_FILE_BROWSER_STORE (object); switch (prop_id) { case PROP_FILTER_MODE: - gedit_file_browser_store_set_filter_mode (obj, + pluma_file_browser_store_set_filter_mode (obj, g_value_get_flags (value)); break; default: @@ -326,14 +326,14 @@ gedit_file_browser_store_set_property (GObject *object, } static void -gedit_file_browser_store_class_init (GeditFileBrowserStoreClass * klass) +pluma_file_browser_store_class_init (PlumaFileBrowserStoreClass * klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - object_class->finalize = gedit_file_browser_store_finalize; + object_class->finalize = pluma_file_browser_store_finalize; - object_class->get_property = gedit_file_browser_store_get_property; - object_class->set_property = gedit_file_browser_store_set_property; + object_class->get_property = pluma_file_browser_store_get_property; + object_class->set_property = pluma_file_browser_store_set_property; g_object_class_install_property (object_class, PROP_ROOT, g_param_spec_string ("root", @@ -353,15 +353,15 @@ gedit_file_browser_store_class_init (GeditFileBrowserStoreClass * klass) g_param_spec_flags ("filter-mode", "Filter Mode", "The filter mode", - GEDIT_TYPE_FILE_BROWSER_STORE_FILTER_MODE, - gedit_file_browser_store_filter_mode_get_default (), + PLUMA_TYPE_FILE_BROWSER_STORE_FILTER_MODE, + pluma_file_browser_store_filter_mode_get_default (), G_PARAM_READWRITE)); model_signals[BEGIN_LOADING] = g_signal_new ("begin-loading", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GeditFileBrowserStoreClass, + G_STRUCT_OFFSET (PlumaFileBrowserStoreClass, begin_loading), NULL, NULL, g_cclosure_marshal_VOID__BOXED, G_TYPE_NONE, 1, GTK_TYPE_TREE_ITER); @@ -369,31 +369,31 @@ gedit_file_browser_store_class_init (GeditFileBrowserStoreClass * klass) g_signal_new ("end-loading", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GeditFileBrowserStoreClass, + G_STRUCT_OFFSET (PlumaFileBrowserStoreClass, end_loading), NULL, NULL, g_cclosure_marshal_VOID__BOXED, G_TYPE_NONE, 1, GTK_TYPE_TREE_ITER); model_signals[ERROR] = g_signal_new ("error", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GeditFileBrowserStoreClass, + G_STRUCT_OFFSET (PlumaFileBrowserStoreClass, error), NULL, NULL, - gedit_file_browser_marshal_VOID__UINT_STRING, + pluma_file_browser_marshal_VOID__UINT_STRING, G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_STRING); model_signals[NO_TRASH] = g_signal_new ("no-trash", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GeditFileBrowserStoreClass, + G_STRUCT_OFFSET (PlumaFileBrowserStoreClass, no_trash), g_signal_accumulator_true_handled, NULL, - gedit_file_browser_marshal_BOOL__POINTER, + pluma_file_browser_marshal_BOOL__POINTER, G_TYPE_BOOLEAN, 1, G_TYPE_POINTER); model_signals[RENAME] = g_signal_new ("rename", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GeditFileBrowserStoreClass, + G_STRUCT_OFFSET (PlumaFileBrowserStoreClass, rename), NULL, NULL, - gedit_file_browser_marshal_VOID__STRING_STRING, + pluma_file_browser_marshal_VOID__STRING_STRING, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING); @@ -401,7 +401,7 @@ gedit_file_browser_store_class_init (GeditFileBrowserStoreClass * klass) g_signal_new ("begin-refresh", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GeditFileBrowserStoreClass, + G_STRUCT_OFFSET (PlumaFileBrowserStoreClass, begin_refresh), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); @@ -409,7 +409,7 @@ gedit_file_browser_store_class_init (GeditFileBrowserStoreClass * klass) g_signal_new ("end-refresh", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GeditFileBrowserStoreClass, + G_STRUCT_OFFSET (PlumaFileBrowserStoreClass, end_refresh), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); @@ -417,60 +417,60 @@ gedit_file_browser_store_class_init (GeditFileBrowserStoreClass * klass) g_signal_new ("unload", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GeditFileBrowserStoreClass, + G_STRUCT_OFFSET (PlumaFileBrowserStoreClass, unload), NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); g_type_class_add_private (object_class, - sizeof (GeditFileBrowserStorePrivate)); + sizeof (PlumaFileBrowserStorePrivate)); } static void -gedit_file_browser_store_iface_init (GtkTreeModelIface * iface) -{ - iface->get_flags = gedit_file_browser_store_get_flags; - iface->get_n_columns = gedit_file_browser_store_get_n_columns; - iface->get_column_type = gedit_file_browser_store_get_column_type; - iface->get_iter = gedit_file_browser_store_get_iter; - iface->get_path = gedit_file_browser_store_get_path; - iface->get_value = gedit_file_browser_store_get_value; - iface->iter_next = gedit_file_browser_store_iter_next; - iface->iter_children = gedit_file_browser_store_iter_children; - iface->iter_has_child = gedit_file_browser_store_iter_has_child; - iface->iter_n_children = gedit_file_browser_store_iter_n_children; - iface->iter_nth_child = gedit_file_browser_store_iter_nth_child; - iface->iter_parent = gedit_file_browser_store_iter_parent; - iface->row_inserted = gedit_file_browser_store_row_inserted; +pluma_file_browser_store_iface_init (GtkTreeModelIface * iface) +{ + iface->get_flags = pluma_file_browser_store_get_flags; + iface->get_n_columns = pluma_file_browser_store_get_n_columns; + iface->get_column_type = pluma_file_browser_store_get_column_type; + iface->get_iter = pluma_file_browser_store_get_iter; + iface->get_path = pluma_file_browser_store_get_path; + iface->get_value = pluma_file_browser_store_get_value; + iface->iter_next = pluma_file_browser_store_iter_next; + iface->iter_children = pluma_file_browser_store_iter_children; + iface->iter_has_child = pluma_file_browser_store_iter_has_child; + iface->iter_n_children = pluma_file_browser_store_iter_n_children; + iface->iter_nth_child = pluma_file_browser_store_iter_nth_child; + iface->iter_parent = pluma_file_browser_store_iter_parent; + iface->row_inserted = pluma_file_browser_store_row_inserted; } static void -gedit_file_browser_store_drag_source_init (GtkTreeDragSourceIface * iface) +pluma_file_browser_store_drag_source_init (GtkTreeDragSourceIface * iface) { - iface->row_draggable = gedit_file_browser_store_row_draggable; - iface->drag_data_delete = gedit_file_browser_store_drag_data_delete; - iface->drag_data_get = gedit_file_browser_store_drag_data_get; + iface->row_draggable = pluma_file_browser_store_row_draggable; + iface->drag_data_delete = pluma_file_browser_store_drag_data_delete; + iface->drag_data_get = pluma_file_browser_store_drag_data_get; } static void -gedit_file_browser_store_init (GeditFileBrowserStore * obj) +pluma_file_browser_store_init (PlumaFileBrowserStore * obj) { - obj->priv = GEDIT_FILE_BROWSER_STORE_GET_PRIVATE (obj); + obj->priv = PLUMA_FILE_BROWSER_STORE_GET_PRIVATE (obj); - obj->priv->column_types[GEDIT_FILE_BROWSER_STORE_COLUMN_URI] = + obj->priv->column_types[PLUMA_FILE_BROWSER_STORE_COLUMN_URI] = G_TYPE_STRING; - obj->priv->column_types[GEDIT_FILE_BROWSER_STORE_COLUMN_NAME] = + obj->priv->column_types[PLUMA_FILE_BROWSER_STORE_COLUMN_NAME] = G_TYPE_STRING; - obj->priv->column_types[GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS] = + obj->priv->column_types[PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS] = G_TYPE_UINT; - obj->priv->column_types[GEDIT_FILE_BROWSER_STORE_COLUMN_ICON] = + obj->priv->column_types[PLUMA_FILE_BROWSER_STORE_COLUMN_ICON] = GDK_TYPE_PIXBUF; - obj->priv->column_types[GEDIT_FILE_BROWSER_STORE_COLUMN_EMBLEM] = + obj->priv->column_types[PLUMA_FILE_BROWSER_STORE_COLUMN_EMBLEM] = GDK_TYPE_PIXBUF; // Default filter mode is hiding the hidden files - obj->priv->filter_mode = gedit_file_browser_store_filter_mode_get_default (); + obj->priv->filter_mode = pluma_file_browser_store_filter_mode_get_default (); obj->priv->sort_func = model_sort_default; } @@ -487,13 +487,13 @@ node_has_parent (FileBrowserNode * node, FileBrowserNode * parent) } static gboolean -node_in_tree (GeditFileBrowserStore * model, FileBrowserNode * node) +node_in_tree (PlumaFileBrowserStore * model, FileBrowserNode * node) { return node_has_parent (node, model->priv->virtual_root); } static gboolean -model_node_visibility (GeditFileBrowserStore * model, +model_node_visibility (PlumaFileBrowserStore * model, FileBrowserNode * node) { if (node == NULL) @@ -512,7 +512,7 @@ model_node_visibility (GeditFileBrowserStore * model, } static gboolean -model_node_inserted (GeditFileBrowserStore * model, +model_node_inserted (PlumaFileBrowserStore * model, FileBrowserNode * node) { return node == model->priv->virtual_root || (model_node_visibility (model, node) && node->inserted); @@ -521,46 +521,46 @@ model_node_inserted (GeditFileBrowserStore * model, /* Interface implementation */ static GtkTreeModelFlags -gedit_file_browser_store_get_flags (GtkTreeModel * tree_model) +pluma_file_browser_store_get_flags (GtkTreeModel * tree_model) { - g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (tree_model), + g_return_val_if_fail (PLUMA_IS_FILE_BROWSER_STORE (tree_model), (GtkTreeModelFlags) 0); return GTK_TREE_MODEL_ITERS_PERSIST; } static gint -gedit_file_browser_store_get_n_columns (GtkTreeModel * tree_model) +pluma_file_browser_store_get_n_columns (GtkTreeModel * tree_model) { - g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (tree_model), 0); + g_return_val_if_fail (PLUMA_IS_FILE_BROWSER_STORE (tree_model), 0); - return GEDIT_FILE_BROWSER_STORE_COLUMN_NUM; + return PLUMA_FILE_BROWSER_STORE_COLUMN_NUM; } static GType -gedit_file_browser_store_get_column_type (GtkTreeModel * tree_model, gint idx) +pluma_file_browser_store_get_column_type (GtkTreeModel * tree_model, gint idx) { - g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (tree_model), + g_return_val_if_fail (PLUMA_IS_FILE_BROWSER_STORE (tree_model), G_TYPE_INVALID); - g_return_val_if_fail (idx < GEDIT_FILE_BROWSER_STORE_COLUMN_NUM && + g_return_val_if_fail (idx < PLUMA_FILE_BROWSER_STORE_COLUMN_NUM && idx >= 0, G_TYPE_INVALID); - return GEDIT_FILE_BROWSER_STORE (tree_model)->priv->column_types[idx]; + return PLUMA_FILE_BROWSER_STORE (tree_model)->priv->column_types[idx]; } static gboolean -gedit_file_browser_store_get_iter (GtkTreeModel * tree_model, +pluma_file_browser_store_get_iter (GtkTreeModel * tree_model, GtkTreeIter * iter, GtkTreePath * path) { gint * indices, depth, i; FileBrowserNode * node; - GeditFileBrowserStore * model; + PlumaFileBrowserStore * model; gint num; - g_assert (GEDIT_IS_FILE_BROWSER_STORE (tree_model)); + g_assert (PLUMA_IS_FILE_BROWSER_STORE (tree_model)); g_assert (path != NULL); - model = GEDIT_FILE_BROWSER_STORE (tree_model); + model = PLUMA_FILE_BROWSER_STORE (tree_model); indices = gtk_tree_path_get_indices (path); depth = gtk_tree_path_get_depth (path); node = model->priv->virtual_root; @@ -605,7 +605,7 @@ gedit_file_browser_store_get_iter (GtkTreeModel * tree_model, } static GtkTreePath * -gedit_file_browser_store_get_path_real (GeditFileBrowserStore * model, +pluma_file_browser_store_get_path_real (PlumaFileBrowserStore * model, FileBrowserNode * node) { GtkTreePath *path; @@ -652,47 +652,47 @@ gedit_file_browser_store_get_path_real (GeditFileBrowserStore * model, } static GtkTreePath * -gedit_file_browser_store_get_path (GtkTreeModel * tree_model, +pluma_file_browser_store_get_path (GtkTreeModel * tree_model, GtkTreeIter * iter) { - g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (tree_model), NULL); + g_return_val_if_fail (PLUMA_IS_FILE_BROWSER_STORE (tree_model), NULL); g_return_val_if_fail (iter != NULL, NULL); g_return_val_if_fail (iter->user_data != NULL, NULL); - return gedit_file_browser_store_get_path_real (GEDIT_FILE_BROWSER_STORE (tree_model), + return pluma_file_browser_store_get_path_real (PLUMA_FILE_BROWSER_STORE (tree_model), (FileBrowserNode *) (iter->user_data)); } static void -gedit_file_browser_store_get_value (GtkTreeModel * tree_model, +pluma_file_browser_store_get_value (GtkTreeModel * tree_model, GtkTreeIter * iter, gint column, GValue * value) { FileBrowserNode *node; - g_return_if_fail (GEDIT_IS_FILE_BROWSER_STORE (tree_model)); + g_return_if_fail (PLUMA_IS_FILE_BROWSER_STORE (tree_model)); g_return_if_fail (iter != NULL); g_return_if_fail (iter->user_data != NULL); node = (FileBrowserNode *) (iter->user_data); - g_value_init (value, GEDIT_FILE_BROWSER_STORE (tree_model)->priv->column_types[column]); + g_value_init (value, PLUMA_FILE_BROWSER_STORE (tree_model)->priv->column_types[column]); switch (column) { - case GEDIT_FILE_BROWSER_STORE_COLUMN_URI: + case PLUMA_FILE_BROWSER_STORE_COLUMN_URI: set_gvalue_from_node (value, node); break; - case GEDIT_FILE_BROWSER_STORE_COLUMN_NAME: + case PLUMA_FILE_BROWSER_STORE_COLUMN_NAME: g_value_set_string (value, node->name); break; - case GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS: + case PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS: g_value_set_uint (value, node->flags); break; - case GEDIT_FILE_BROWSER_STORE_COLUMN_ICON: + case PLUMA_FILE_BROWSER_STORE_COLUMN_ICON: g_value_set_object (value, node->icon); break; - case GEDIT_FILE_BROWSER_STORE_COLUMN_EMBLEM: + case PLUMA_FILE_BROWSER_STORE_COLUMN_EMBLEM: g_value_set_object (value, node->emblem); break; default: @@ -701,20 +701,20 @@ gedit_file_browser_store_get_value (GtkTreeModel * tree_model, } static gboolean -gedit_file_browser_store_iter_next (GtkTreeModel * tree_model, +pluma_file_browser_store_iter_next (GtkTreeModel * tree_model, GtkTreeIter * iter) { - GeditFileBrowserStore * model; + PlumaFileBrowserStore * model; FileBrowserNode * node; GSList * item; GSList * first; - g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (tree_model), + g_return_val_if_fail (PLUMA_IS_FILE_BROWSER_STORE (tree_model), FALSE); g_return_val_if_fail (iter != NULL, FALSE); g_return_val_if_fail (iter->user_data != NULL, FALSE); - model = GEDIT_FILE_BROWSER_STORE (tree_model); + model = PLUMA_FILE_BROWSER_STORE (tree_model); node = (FileBrowserNode *) (iter->user_data); if (node->parent == NULL) @@ -733,20 +733,20 @@ gedit_file_browser_store_iter_next (GtkTreeModel * tree_model, } static gboolean -gedit_file_browser_store_iter_children (GtkTreeModel * tree_model, +pluma_file_browser_store_iter_children (GtkTreeModel * tree_model, GtkTreeIter * iter, GtkTreeIter * parent) { FileBrowserNode * node; - GeditFileBrowserStore * model; + PlumaFileBrowserStore * model; GSList * item; - g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (tree_model), + g_return_val_if_fail (PLUMA_IS_FILE_BROWSER_STORE (tree_model), FALSE); g_return_val_if_fail (parent == NULL || parent->user_data != NULL, FALSE); - model = GEDIT_FILE_BROWSER_STORE (tree_model); + model = PLUMA_FILE_BROWSER_STORE (tree_model); if (parent == NULL) node = model->priv->virtual_root; @@ -770,7 +770,7 @@ gedit_file_browser_store_iter_children (GtkTreeModel * tree_model, } static gboolean -filter_tree_model_iter_has_child_real (GeditFileBrowserStore * model, +filter_tree_model_iter_has_child_real (PlumaFileBrowserStore * model, FileBrowserNode * node) { GSList *item; @@ -787,18 +787,18 @@ filter_tree_model_iter_has_child_real (GeditFileBrowserStore * model, } static gboolean -gedit_file_browser_store_iter_has_child (GtkTreeModel * tree_model, +pluma_file_browser_store_iter_has_child (GtkTreeModel * tree_model, GtkTreeIter * iter) { FileBrowserNode *node; - GeditFileBrowserStore *model; + PlumaFileBrowserStore *model; - g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (tree_model), + g_return_val_if_fail (PLUMA_IS_FILE_BROWSER_STORE (tree_model), FALSE); g_return_val_if_fail (iter == NULL || iter->user_data != NULL, FALSE); - model = GEDIT_FILE_BROWSER_STORE (tree_model); + model = PLUMA_FILE_BROWSER_STORE (tree_model); if (iter == NULL) node = model->priv->virtual_root; @@ -809,20 +809,20 @@ gedit_file_browser_store_iter_has_child (GtkTreeModel * tree_model, } static gint -gedit_file_browser_store_iter_n_children (GtkTreeModel * tree_model, +pluma_file_browser_store_iter_n_children (GtkTreeModel * tree_model, GtkTreeIter * iter) { FileBrowserNode *node; - GeditFileBrowserStore *model; + PlumaFileBrowserStore *model; GSList *item; gint num = 0; - g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (tree_model), + g_return_val_if_fail (PLUMA_IS_FILE_BROWSER_STORE (tree_model), FALSE); g_return_val_if_fail (iter == NULL || iter->user_data != NULL, FALSE); - model = GEDIT_FILE_BROWSER_STORE (tree_model); + model = PLUMA_FILE_BROWSER_STORE (tree_model); if (iter == NULL) node = model->priv->virtual_root; @@ -840,21 +840,21 @@ gedit_file_browser_store_iter_n_children (GtkTreeModel * tree_model, } static gboolean -gedit_file_browser_store_iter_nth_child (GtkTreeModel * tree_model, +pluma_file_browser_store_iter_nth_child (GtkTreeModel * tree_model, GtkTreeIter * iter, GtkTreeIter * parent, gint n) { FileBrowserNode *node; - GeditFileBrowserStore *model; + PlumaFileBrowserStore *model; GSList *item; gint num = 0; - g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (tree_model), + g_return_val_if_fail (PLUMA_IS_FILE_BROWSER_STORE (tree_model), FALSE); g_return_val_if_fail (parent == NULL || parent->user_data != NULL, FALSE); - model = GEDIT_FILE_BROWSER_STORE (tree_model); + model = PLUMA_FILE_BROWSER_STORE (tree_model); if (parent == NULL) node = model->priv->virtual_root; @@ -880,19 +880,19 @@ gedit_file_browser_store_iter_nth_child (GtkTreeModel * tree_model, } static gboolean -gedit_file_browser_store_iter_parent (GtkTreeModel * tree_model, +pluma_file_browser_store_iter_parent (GtkTreeModel * tree_model, GtkTreeIter * iter, GtkTreeIter * child) { FileBrowserNode *node; - GeditFileBrowserStore *model; + PlumaFileBrowserStore *model; - g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (tree_model), FALSE); + g_return_val_if_fail (PLUMA_IS_FILE_BROWSER_STORE (tree_model), FALSE); g_return_val_if_fail (child != NULL, FALSE); g_return_val_if_fail (child->user_data != NULL, FALSE); node = (FileBrowserNode *) (child->user_data); - model = GEDIT_FILE_BROWSER_STORE (tree_model); + model = PLUMA_FILE_BROWSER_STORE (tree_model); if (!node_in_tree (model, node)) return FALSE; @@ -905,7 +905,7 @@ gedit_file_browser_store_iter_parent (GtkTreeModel * tree_model, } static void -gedit_file_browser_store_row_inserted (GtkTreeModel * tree_model, +pluma_file_browser_store_row_inserted (GtkTreeModel * tree_model, GtkTreePath * path, GtkTreeIter * iter) { @@ -915,11 +915,11 @@ gedit_file_browser_store_row_inserted (GtkTreeModel * tree_model, } static gboolean -gedit_file_browser_store_row_draggable (GtkTreeDragSource * drag_source, +pluma_file_browser_store_row_draggable (GtkTreeDragSource * drag_source, GtkTreePath * path) { GtkTreeIter iter; - GeditFileBrowserStoreFlag flags; + PlumaFileBrowserStoreFlag flags; if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (drag_source), &iter, path)) @@ -928,21 +928,21 @@ gedit_file_browser_store_row_draggable (GtkTreeDragSource * drag_source, } gtk_tree_model_get (GTK_TREE_MODEL (drag_source), &iter, - GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, + PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, -1); return !FILE_IS_DUMMY(flags); } static gboolean -gedit_file_browser_store_drag_data_delete (GtkTreeDragSource * drag_source, +pluma_file_browser_store_drag_data_delete (GtkTreeDragSource * drag_source, GtkTreePath * path) { return FALSE; } static gboolean -gedit_file_browser_store_drag_data_get (GtkTreeDragSource * drag_source, +pluma_file_browser_store_drag_data_get (GtkTreeDragSource * drag_source, GtkTreePath * path, GtkSelectionData * selection_data) { @@ -958,7 +958,7 @@ gedit_file_browser_store_drag_data_get (GtkTreeDragSource * drag_source, } gtk_tree_model_get (GTK_TREE_MODEL (drag_source), &iter, - GEDIT_FILE_BROWSER_STORE_COLUMN_URI, &uri, + PLUMA_FILE_BROWSER_STORE_COLUMN_URI, &uri, -1); g_assert (uri); @@ -971,12 +971,12 @@ gedit_file_browser_store_drag_data_get (GtkTreeDragSource * drag_source, return ret; } -#define FILTER_HIDDEN(mode) (mode & GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN) -#define FILTER_BINARY(mode) (mode & GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY) +#define FILTER_HIDDEN(mode) (mode & PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN) +#define FILTER_BINARY(mode) (mode & PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY) /* Private */ static void -model_begin_loading (GeditFileBrowserStore * model, FileBrowserNode * node) +model_begin_loading (PlumaFileBrowserStore * model, FileBrowserNode * node) { GtkTreeIter iter; @@ -985,7 +985,7 @@ model_begin_loading (GeditFileBrowserStore * model, FileBrowserNode * node) } static void -model_end_loading (GeditFileBrowserStore * model, FileBrowserNode * node) +model_end_loading (PlumaFileBrowserStore * model, FileBrowserNode * node) { GtkTreeIter iter; @@ -994,19 +994,19 @@ model_end_loading (GeditFileBrowserStore * model, FileBrowserNode * node) } static void -model_node_update_visibility (GeditFileBrowserStore * model, +model_node_update_visibility (PlumaFileBrowserStore * model, FileBrowserNode * node) { GtkTreeIter iter; - node->flags &= ~GEDIT_FILE_BROWSER_STORE_FLAG_IS_FILTERED; + node->flags &= ~PLUMA_FILE_BROWSER_STORE_FLAG_IS_FILTERED; if (FILTER_HIDDEN (model->priv->filter_mode) && NODE_IS_HIDDEN (node)) - node->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_IS_FILTERED; + node->flags |= PLUMA_FILE_BROWSER_STORE_FLAG_IS_FILTERED; else if (FILTER_BINARY (model->priv->filter_mode) && (!NODE_IS_TEXT (node) && !NODE_IS_DIR (node))) - node->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_IS_FILTERED; + node->flags |= PLUMA_FILE_BROWSER_STORE_FLAG_IS_FILTERED; else if (model->priv->filter_func) { iter.user_data = node; @@ -1014,7 +1014,7 @@ model_node_update_visibility (GeditFileBrowserStore * model, filter_func (model, &iter, model->priv->filter_user_data)) node->flags |= - GEDIT_FILE_BROWSER_STORE_FLAG_IS_FILTERED; + PLUMA_FILE_BROWSER_STORE_FLAG_IS_FILTERED; } } @@ -1079,7 +1079,7 @@ model_sort_default (FileBrowserNode * node1, FileBrowserNode * node2) } static void -model_resort_node (GeditFileBrowserStore * model, FileBrowserNode * node) +model_resort_node (PlumaFileBrowserStore * model, FileBrowserNode * node) { FileBrowserNodeDir *dir; GSList *item; @@ -1121,7 +1121,7 @@ model_resort_node (GeditFileBrowserStore * model, FileBrowserNode * node) iter.user_data = node->parent; path = - gedit_file_browser_store_get_path_real (model, + pluma_file_browser_store_get_path_real (model, node->parent); gtk_tree_model_rows_reordered (GTK_TREE_MODEL (model), @@ -1133,7 +1133,7 @@ model_resort_node (GeditFileBrowserStore * model, FileBrowserNode * node) } static void -row_changed (GeditFileBrowserStore * model, +row_changed (PlumaFileBrowserStore * model, GtkTreePath ** path, GtkTreeIter * iter) { @@ -1149,7 +1149,7 @@ row_changed (GeditFileBrowserStore * model, } static void -row_inserted (GeditFileBrowserStore * model, +row_inserted (PlumaFileBrowserStore * model, GtkTreePath ** path, GtkTreeIter * iter) { @@ -1180,7 +1180,7 @@ row_inserted (GeditFileBrowserStore * model, } static void -row_deleted (GeditFileBrowserStore * model, +row_deleted (PlumaFileBrowserStore * model, const GtkTreePath * path) { GtkTreePath *copy = gtk_tree_path_copy (path); @@ -1192,7 +1192,7 @@ row_deleted (GeditFileBrowserStore * model, } static void -model_refilter_node (GeditFileBrowserStore * model, +model_refilter_node (PlumaFileBrowserStore * model, FileBrowserNode * node, GtkTreePath ** path) { @@ -1215,7 +1215,7 @@ model_refilter_node (GeditFileBrowserStore * model, if (path == NULL) { if (in_tree) - tmppath = gedit_file_browser_store_get_path_real (model, + tmppath = pluma_file_browser_store_get_path_real (model, node); else tmppath = gtk_tree_path_new_first (); @@ -1263,7 +1263,7 @@ model_refilter_node (GeditFileBrowserStore * model, } static void -model_refilter (GeditFileBrowserStore * model) +model_refilter (PlumaFileBrowserStore * model) { model_refilter_node (model, model->priv->root, NULL); } @@ -1274,7 +1274,7 @@ file_browser_node_set_name (FileBrowserNode * node) g_free (node->name); if (node->file) { - node->name = gedit_file_browser_utils_file_basename (node->file); + node->name = pluma_file_browser_utils_file_basename (node->file); } else { node->name = NULL; } @@ -1302,7 +1302,7 @@ file_browser_node_new (GFile * file, FileBrowserNode * parent) } static FileBrowserNode * -file_browser_node_dir_new (GeditFileBrowserStore * model, +file_browser_node_dir_new (PlumaFileBrowserStore * model, GFile * file, FileBrowserNode * parent) { FileBrowserNode *node = @@ -1310,7 +1310,7 @@ file_browser_node_dir_new (GeditFileBrowserStore * model, file_browser_node_init (node, file, parent); - node->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_IS_DIRECTORY; + node->flags |= PLUMA_FILE_BROWSER_STORE_FLAG_IS_DIRECTORY; FILE_BROWSER_NODE_DIR (node)->model = model; @@ -1318,7 +1318,7 @@ file_browser_node_dir_new (GeditFileBrowserStore * model, } static void -file_browser_node_free_children (GeditFileBrowserStore * model, +file_browser_node_free_children (PlumaFileBrowserStore * model, FileBrowserNode * node) { GSList *item; @@ -1337,12 +1337,12 @@ file_browser_node_free_children (GeditFileBrowserStore * model, FILE_BROWSER_NODE_DIR (node)->children = NULL; /* This node is no longer loaded */ - node->flags &= ~GEDIT_FILE_BROWSER_STORE_FLAG_LOADED; + node->flags &= ~PLUMA_FILE_BROWSER_STORE_FLAG_LOADED; } } static void -file_browser_node_free (GeditFileBrowserStore * model, +file_browser_node_free (PlumaFileBrowserStore * model, FileBrowserNode * node) { gchar *uri; @@ -1399,7 +1399,7 @@ file_browser_node_free (GeditFileBrowserStore * model, /** * model_remove_node_children: - * @model: the #GeditFileBrowserStore + * @model: the #PlumaFileBrowserStore * @node: the FileBrowserNode to remove * @path: the path of the node, or NULL to let the path be calculated * @free_nodes: whether to also remove the nodes from memory @@ -1409,7 +1409,7 @@ file_browser_node_free (GeditFileBrowserStore * model, * a node. **/ static void -model_remove_node_children (GeditFileBrowserStore * model, +model_remove_node_children (PlumaFileBrowserStore * model, FileBrowserNode * node, GtkTreePath * path, gboolean free_nodes) @@ -1438,7 +1438,7 @@ model_remove_node_children (GeditFileBrowserStore * model, if (path == NULL) path_child = - gedit_file_browser_store_get_path_real (model, node); + pluma_file_browser_store_get_path_real (model, node); else path_child = gtk_tree_path_copy (path); @@ -1457,7 +1457,7 @@ model_remove_node_children (GeditFileBrowserStore * model, /** * model_remove_node: - * @model: the #GeditFileBrowserStore + * @model: the #PlumaFileBrowserStore * @node: the FileBrowserNode to remove * @path: the path to use to remove this node, or NULL to use the path * calculated from the node itself @@ -1468,7 +1468,7 @@ model_remove_node_children (GeditFileBrowserStore * model, * a node. **/ static void -model_remove_node (GeditFileBrowserStore * model, +model_remove_node (PlumaFileBrowserStore * model, FileBrowserNode * node, GtkTreePath * path, gboolean free_nodes) @@ -1478,7 +1478,7 @@ model_remove_node (GeditFileBrowserStore * model, if (path == NULL) { path = - gedit_file_browser_store_get_path_real (model, node); + pluma_file_browser_store_get_path_real (model, node); free_path = TRUE; } @@ -1519,7 +1519,7 @@ model_remove_node (GeditFileBrowserStore * model, /** * model_clear: - * @model: the #GeditFileBrowserStore + * @model: the #PlumaFileBrowserStore * @free_nodes: whether to also remove the nodes from memory * * Removes all nodes from the model. This function is used @@ -1527,7 +1527,7 @@ model_remove_node (GeditFileBrowserStore * model, * nodes in the model. **/ static void -model_clear (GeditFileBrowserStore * model, gboolean free_nodes) +model_clear (PlumaFileBrowserStore * model, gboolean free_nodes) { GtkTreePath *path; FileBrowserNodeDir *dir; @@ -1558,7 +1558,7 @@ model_clear (GeditFileBrowserStore * model, gboolean free_nodes) } static void -file_browser_node_unload (GeditFileBrowserStore * model, +file_browser_node_unload (PlumaFileBrowserStore * model, FileBrowserNode * node, gboolean remove_children) { FileBrowserNodeDir *dir; @@ -1589,17 +1589,17 @@ file_browser_node_unload (GeditFileBrowserStore * model, dir->monitor = NULL; } - node->flags &= ~GEDIT_FILE_BROWSER_STORE_FLAG_LOADED; + node->flags &= ~PLUMA_FILE_BROWSER_STORE_FLAG_LOADED; } static void -model_recomposite_icon_real (GeditFileBrowserStore * tree_model, +model_recomposite_icon_real (PlumaFileBrowserStore * tree_model, FileBrowserNode * node, GFileInfo * info) { GdkPixbuf *icon; - g_return_if_fail (GEDIT_IS_FILE_BROWSER_STORE (tree_model)); + g_return_if_fail (PLUMA_IS_FILE_BROWSER_STORE (tree_model)); g_return_if_fail (node != NULL); if (node->file == NULL) @@ -1608,11 +1608,11 @@ model_recomposite_icon_real (GeditFileBrowserStore * tree_model, if (info) { GIcon *gicon = g_file_info_get_icon (info); if (gicon != NULL) - icon = gedit_file_browser_utils_pixbuf_from_icon (gicon, GTK_ICON_SIZE_MENU); + icon = pluma_file_browser_utils_pixbuf_from_icon (gicon, GTK_ICON_SIZE_MENU); else icon = NULL; } else { - icon = gedit_file_browser_utils_pixbuf_from_file (node->file, GTK_ICON_SIZE_MENU); + icon = pluma_file_browser_utils_pixbuf_from_file (node->file, GTK_ICON_SIZE_MENU); } if (node->icon) @@ -1645,10 +1645,10 @@ model_recomposite_icon_real (GeditFileBrowserStore * tree_model, } static void -model_recomposite_icon (GeditFileBrowserStore * tree_model, +model_recomposite_icon (PlumaFileBrowserStore * tree_model, GtkTreeIter * iter) { - g_return_if_fail (GEDIT_IS_FILE_BROWSER_STORE (tree_model)); + g_return_if_fail (PLUMA_IS_FILE_BROWSER_STORE (tree_model)); g_return_if_fail (iter != NULL); g_return_if_fail (iter->user_data != NULL); @@ -1658,7 +1658,7 @@ model_recomposite_icon (GeditFileBrowserStore * tree_model, } static FileBrowserNode * -model_create_dummy_node (GeditFileBrowserStore * model, +model_create_dummy_node (PlumaFileBrowserStore * model, FileBrowserNode * parent) { FileBrowserNode *dummy; @@ -1666,14 +1666,14 @@ model_create_dummy_node (GeditFileBrowserStore * model, dummy = file_browser_node_new (NULL, parent); dummy->name = g_strdup (_("(Empty)")); - dummy->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_IS_DUMMY; - dummy->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN; + dummy->flags |= PLUMA_FILE_BROWSER_STORE_FLAG_IS_DUMMY; + dummy->flags |= PLUMA_FILE_BROWSER_STORE_FLAG_IS_HIDDEN; return dummy; } static FileBrowserNode * -model_add_dummy_node (GeditFileBrowserStore * model, +model_add_dummy_node (PlumaFileBrowserStore * model, FileBrowserNode * parent) { FileBrowserNode *dummy; @@ -1681,7 +1681,7 @@ model_add_dummy_node (GeditFileBrowserStore * model, dummy = model_create_dummy_node (model, parent); if (model_node_visibility (model, parent)) - dummy->flags &= ~GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN; + dummy->flags &= ~PLUMA_FILE_BROWSER_STORE_FLAG_IS_HIDDEN; model_add_node (model, dummy, parent); @@ -1689,7 +1689,7 @@ model_add_dummy_node (GeditFileBrowserStore * model, } static void -model_check_dummy (GeditFileBrowserStore * model, FileBrowserNode * node) +model_check_dummy (PlumaFileBrowserStore * model, FileBrowserNode * node) { // Hide the dummy child if needed if (NODE_IS_DIR (node)) { @@ -1715,24 +1715,24 @@ model_check_dummy (GeditFileBrowserStore * model, FileBrowserNode * node) if (!model_node_visibility (model, node)) { dummy->flags |= - GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN; + PLUMA_FILE_BROWSER_STORE_FLAG_IS_HIDDEN; return; } /* Temporarily set the node to invisible to check * for real children */ flags = dummy->flags; - dummy->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN; + dummy->flags |= PLUMA_FILE_BROWSER_STORE_FLAG_IS_HIDDEN; if (!filter_tree_model_iter_has_child_real (model, node)) { dummy->flags &= - ~GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN; + ~PLUMA_FILE_BROWSER_STORE_FLAG_IS_HIDDEN; if (FILE_IS_HIDDEN (flags)) { // Was hidden, needs to be inserted iter.user_data = dummy; path = - gedit_file_browser_store_get_path_real + pluma_file_browser_store_get_path_real (model, dummy); row_inserted (model, &path, &iter); @@ -1744,12 +1744,12 @@ model_check_dummy (GeditFileBrowserStore * model, FileBrowserNode * node) // To get the path we need to set it to visible temporarily dummy->flags &= - ~GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN; + ~PLUMA_FILE_BROWSER_STORE_FLAG_IS_HIDDEN; path = - gedit_file_browser_store_get_path_real + pluma_file_browser_store_get_path_real (model, dummy); dummy->flags |= - GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN; + PLUMA_FILE_BROWSER_STORE_FLAG_IS_HIDDEN; dummy->inserted = FALSE; row_deleted (model, path); @@ -1760,7 +1760,7 @@ model_check_dummy (GeditFileBrowserStore * model, FileBrowserNode * node) } static void -insert_node_sorted (GeditFileBrowserStore * model, +insert_node_sorted (PlumaFileBrowserStore * model, FileBrowserNode * child, FileBrowserNode * parent) { @@ -1779,7 +1779,7 @@ insert_node_sorted (GeditFileBrowserStore * model, } static void -model_add_node (GeditFileBrowserStore * model, FileBrowserNode * child, +model_add_node (PlumaFileBrowserStore * model, FileBrowserNode * child, FileBrowserNode * parent) { /* Add child to parents children */ @@ -1791,7 +1791,7 @@ model_add_node (GeditFileBrowserStore * model, FileBrowserNode * child, GtkTreePath *path; iter.user_data = child; - path = gedit_file_browser_store_get_path_real (model, child); + path = pluma_file_browser_store_get_path_real (model, child); /* Emit row inserted */ row_inserted (model, &path, &iter); @@ -1803,7 +1803,7 @@ model_add_node (GeditFileBrowserStore * model, FileBrowserNode * child, } static void -model_add_nodes_batch (GeditFileBrowserStore * model, +model_add_nodes_batch (PlumaFileBrowserStore * model, GSList * children, FileBrowserNode * parent) { @@ -1837,7 +1837,7 @@ model_add_nodes_batch (GeditFileBrowserStore * model, if (model_node_visibility (model, parent) && model_node_visibility (model, l->data)) { iter.user_data = l->data; - path = gedit_file_browser_store_get_path_real (model, l->data); + path = pluma_file_browser_store_get_path_real (model, l->data); // Emit row inserted row_inserted (model, &path, &iter); @@ -1868,7 +1868,7 @@ model_add_nodes_batch (GeditFileBrowserStore * model, if (model_node_visibility (model, parent) && model_node_visibility (model, node)) { iter.user_data = node; - path = gedit_file_browser_store_get_path_real (model, node); + path = pluma_file_browser_store_get_path_real (model, node); // Emit row inserted row_inserted (model, &path, &iter); @@ -1905,7 +1905,7 @@ backup_content_type (GFileInfo * info) } static void -file_browser_node_set_from_info (GeditFileBrowserStore * model, +file_browser_node_set_from_info (PlumaFileBrowserStore * model, FileBrowserNode * node, GFileInfo * info, gboolean isadded) @@ -1943,13 +1943,13 @@ file_browser_node_set_from_info (GeditFileBrowserStore * model, name = g_file_info_get_name (info); if (g_file_info_get_is_hidden (info) || g_file_info_get_is_backup (info)) - node->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN; + node->flags |= PLUMA_FILE_BROWSER_STORE_FLAG_IS_HIDDEN; else if (dir != NULL && dir->hidden_file_hash != NULL && g_hash_table_lookup (dir->hidden_file_hash, name) != NULL) - node->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN; + node->flags |= PLUMA_FILE_BROWSER_STORE_FLAG_IS_HIDDEN; if (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY) - node->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_IS_DIRECTORY; + node->flags |= PLUMA_FILE_BROWSER_STORE_FLAG_IS_DIRECTORY; else { if (!(content = backup_content_type (info))) content = g_file_info_get_content_type (info); @@ -1957,7 +1957,7 @@ file_browser_node_set_from_info (GeditFileBrowserStore * model, if (!content || g_content_type_is_unknown (content) || g_content_type_is_a (content, "text/plain")) - node->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_IS_TEXT; + node->flags |= PLUMA_FILE_BROWSER_STORE_FLAG_IS_TEXT; } model_recomposite_icon_real (model, node, info); @@ -1966,7 +1966,7 @@ file_browser_node_set_from_info (GeditFileBrowserStore * model, g_object_unref (info); if (isadded) { - path = gedit_file_browser_store_get_path_real (model, node); + path = pluma_file_browser_store_get_path_real (model, node); model_refilter_node (model, node, &path); gtk_tree_path_free (path); @@ -1995,7 +1995,7 @@ node_list_contains_file (GSList *children, GFile * file) } static FileBrowserNode * -model_add_node_from_file (GeditFileBrowserStore * model, +model_add_node_from_file (PlumaFileBrowserStore * model, FileBrowserNode * parent, GFile * file, GFileInfo * info) @@ -2040,7 +2040,7 @@ model_add_node_from_file (GeditFileBrowserStore * model, * not have to check if a file already exists among the ones we just * added */ static void -model_add_nodes_from_files (GeditFileBrowserStore * model, +model_add_nodes_from_files (PlumaFileBrowserStore * model, FileBrowserNode * parent, GSList * original_children, GList * files) @@ -2098,7 +2098,7 @@ model_add_nodes_from_files (GeditFileBrowserStore * model, } static FileBrowserNode * -model_add_node_from_dir (GeditFileBrowserStore * model, +model_add_node_from_dir (PlumaFileBrowserStore * model, FileBrowserNode * parent, GFile * file) { @@ -2114,7 +2114,7 @@ model_add_node_from_dir (GeditFileBrowserStore * model, } if (node->icon == NULL) { - node->icon = gedit_file_browser_utils_pixbuf_from_theme ("folder", GTK_ICON_SIZE_MENU); + node->icon = pluma_file_browser_utils_pixbuf_from_theme ("folder", GTK_ICON_SIZE_MENU); } model_add_node (model, node, parent); @@ -2255,7 +2255,7 @@ model_iterate_next_files_cb (GFileEnumerator * enumerator, /* * FIXME: This is temporarly, it is a bug in gio: - * http://bugzilla.mate.org/show_bug.cgi?id=565924 + * http://bugzilla.gnome.org/show_bug.cgi?id=565924 */ #ifndef G_OS_WIN32 if (g_file_is_native (parent->file) && dir->monitor == NULL) { @@ -2284,7 +2284,7 @@ model_iterate_next_files_cb (GFileEnumerator * enumerator, g_signal_emit (dir->model, model_signals[ERROR], 0, - GEDIT_FILE_BROWSER_ERROR_LOAD_DIRECTORY, + PLUMA_FILE_BROWSER_ERROR_LOAD_DIRECTORY, error->message); file_browser_node_unload (dir->model, (FileBrowserNode *)parent, TRUE); @@ -2338,7 +2338,7 @@ model_iterate_children_cb (GFile * file, g_signal_emit (dir->model, model_signals[ERROR], 0, - GEDIT_FILE_BROWSER_ERROR_LOAD_DIRECTORY, + PLUMA_FILE_BROWSER_ERROR_LOAD_DIRECTORY, error->message); file_browser_node_unload (dir->model, (FileBrowserNode *)dir, TRUE); @@ -2350,7 +2350,7 @@ model_iterate_children_cb (GFile * file, } static void -model_load_directory (GeditFileBrowserStore * model, +model_load_directory (PlumaFileBrowserStore * model, FileBrowserNode * node) { FileBrowserNodeDir *dir; @@ -2365,7 +2365,7 @@ model_load_directory (GeditFileBrowserStore * model, file_browser_node_unload (dir->model, node, TRUE); } - node->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_LOADED; + node->flags |= PLUMA_FILE_BROWSER_STORE_FLAG_LOADED; model_begin_loading (model, node); /* Read the '.hidden' file first (if any) */ @@ -2389,7 +2389,7 @@ model_load_directory (GeditFileBrowserStore * model, } static GList * -get_parent_files (GeditFileBrowserStore * model, GFile * file) +get_parent_files (PlumaFileBrowserStore * model, GFile * file) { GList * result = NULL; @@ -2408,7 +2408,7 @@ get_parent_files (GeditFileBrowserStore * model, GFile * file) } static void -model_fill (GeditFileBrowserStore * model, FileBrowserNode * node, +model_fill (PlumaFileBrowserStore * model, FileBrowserNode * node, GtkTreePath ** path) { gboolean free_path = FALSE; @@ -2424,7 +2424,7 @@ model_fill (GeditFileBrowserStore * model, FileBrowserNode * node, if (*path == NULL) { *path = - gedit_file_browser_store_get_path_real (model, node); + pluma_file_browser_store_get_path_real (model, node); free_path = TRUE; } @@ -2469,7 +2469,7 @@ model_fill (GeditFileBrowserStore * model, FileBrowserNode * node, } static void -set_virtual_root_from_node (GeditFileBrowserStore * model, +set_virtual_root_from_node (PlumaFileBrowserStore * model, FileBrowserNode * node) { FileBrowserNode *next; @@ -2537,7 +2537,7 @@ set_virtual_root_from_node (GeditFileBrowserStore * model, } } else if (NODE_IS_DUMMY (check)) { check->flags |= - GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN; + PLUMA_FILE_BROWSER_STORE_FLAG_IS_HIDDEN; } } @@ -2555,7 +2555,7 @@ set_virtual_root_from_node (GeditFileBrowserStore * model, } static void -set_virtual_root_from_file (GeditFileBrowserStore * model, +set_virtual_root_from_file (PlumaFileBrowserStore * model, GFile * file) { GList * files; @@ -2582,7 +2582,7 @@ set_virtual_root_from_file (GeditFileBrowserStore * model, } static FileBrowserNode * -model_find_node_children (GeditFileBrowserStore * model, +model_find_node_children (PlumaFileBrowserStore * model, FileBrowserNode * parent, GFile * file) { @@ -2609,7 +2609,7 @@ model_find_node_children (GeditFileBrowserStore * model, } static FileBrowserNode * -model_find_node (GeditFileBrowserStore * model, +model_find_node (PlumaFileBrowserStore * model, FileBrowserNode * node, GFile * file) { @@ -2626,12 +2626,12 @@ model_find_node (GeditFileBrowserStore * model, } static GQuark -gedit_file_browser_store_error_quark (void) +pluma_file_browser_store_error_quark (void) { static GQuark quark = 0; if (G_UNLIKELY (quark == 0)) { - quark = g_quark_from_string ("gedit_file_browser_store_error"); + quark = g_quark_from_string ("pluma_file_browser_store_error"); } return quark; @@ -2662,32 +2662,32 @@ unique_new_name (GFile * directory, gchar const * name) return newuri; } -static GeditFileBrowserStoreResult -model_root_mounted (GeditFileBrowserStore * model, gchar const * virtual_root) +static PlumaFileBrowserStoreResult +model_root_mounted (PlumaFileBrowserStore * model, gchar const * virtual_root) { model_check_dummy (model, model->priv->root); g_object_notify (G_OBJECT (model), "root"); if (virtual_root != NULL) return - gedit_file_browser_store_set_virtual_root_from_string + pluma_file_browser_store_set_virtual_root_from_string (model, virtual_root); else set_virtual_root_from_node (model, model->priv->root); - return GEDIT_FILE_BROWSER_STORE_RESULT_OK; + return PLUMA_FILE_BROWSER_STORE_RESULT_OK; } static void -handle_root_error (GeditFileBrowserStore * model, GError *error) +handle_root_error (PlumaFileBrowserStore * model, GError *error) { FileBrowserNode * root; g_signal_emit (model, model_signals[ERROR], 0, - GEDIT_FILE_BROWSER_ERROR_SET_ROOT, + PLUMA_FILE_BROWSER_ERROR_SET_ROOT, error->message); /* Set the virtual root to the root */ @@ -2695,7 +2695,7 @@ handle_root_error (GeditFileBrowserStore * model, GError *error) model->priv->virtual_root = root; /* Set the root to be loaded */ - root->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_LOADED; + root->flags |= PLUMA_FILE_BROWSER_STORE_FLAG_LOADED; /* Check the dummy */ model_check_dummy (model, root); @@ -2711,7 +2711,7 @@ mount_cb (GFile * file, { gboolean mounted; GError * error = NULL; - GeditFileBrowserStore * model = mount_info->model; + PlumaFileBrowserStore * model = mount_info->model; mounted = g_file_mount_enclosing_volume_finish (file, res, &error); @@ -2745,8 +2745,8 @@ mount_cb (GFile * file, g_free (mount_info); } -static GeditFileBrowserStoreResult -model_mount_root (GeditFileBrowserStore * model, gchar const * virtual_root) +static PlumaFileBrowserStoreResult +model_mount_root (PlumaFileBrowserStore * model, gchar const * virtual_root) { GFileInfo * info; GError * error = NULL; @@ -2780,7 +2780,7 @@ model_mount_root (GeditFileBrowserStore * model, gchar const * virtual_root) mount_info); model->priv->mount_info = mount_info; - return GEDIT_FILE_BROWSER_STORE_RESULT_MOUNTING; + return PLUMA_FILE_BROWSER_STORE_RESULT_MOUNTING; } else { @@ -2794,24 +2794,24 @@ model_mount_root (GeditFileBrowserStore * model, gchar const * virtual_root) return model_root_mounted (model, virtual_root); } - return GEDIT_FILE_BROWSER_STORE_RESULT_OK; + return PLUMA_FILE_BROWSER_STORE_RESULT_OK; } /* Public */ -GeditFileBrowserStore * -gedit_file_browser_store_new (gchar const *root) +PlumaFileBrowserStore * +pluma_file_browser_store_new (gchar const *root) { - GeditFileBrowserStore *obj = - GEDIT_FILE_BROWSER_STORE (g_object_new - (GEDIT_TYPE_FILE_BROWSER_STORE, + PlumaFileBrowserStore *obj = + PLUMA_FILE_BROWSER_STORE (g_object_new + (PLUMA_TYPE_FILE_BROWSER_STORE, NULL)); - gedit_file_browser_store_set_root (obj, root); + pluma_file_browser_store_set_root (obj, root); return obj; } void -gedit_file_browser_store_set_value (GeditFileBrowserStore * tree_model, +pluma_file_browser_store_set_value (PlumaFileBrowserStore * tree_model, GtkTreeIter * iter, gint column, GValue * value) { @@ -2819,9 +2819,9 @@ gedit_file_browser_store_set_value (GeditFileBrowserStore * tree_model, FileBrowserNode *node; GtkTreePath *path; - g_return_if_fail (GEDIT_IS_FILE_BROWSER_STORE (tree_model)); + g_return_if_fail (PLUMA_IS_FILE_BROWSER_STORE (tree_model)); g_return_if_fail (column == - GEDIT_FILE_BROWSER_STORE_COLUMN_EMBLEM); + PLUMA_FILE_BROWSER_STORE_COLUMN_EMBLEM); g_return_if_fail (G_VALUE_HOLDS_OBJECT (value)); g_return_if_fail (iter != NULL); g_return_if_fail (iter->user_data != NULL); @@ -2844,23 +2844,23 @@ gedit_file_browser_store_set_value (GeditFileBrowserStore * tree_model, model_recomposite_icon (tree_model, iter); if (model_node_visibility (tree_model, node)) { - path = gedit_file_browser_store_get_path (GTK_TREE_MODEL (tree_model), + path = pluma_file_browser_store_get_path (GTK_TREE_MODEL (tree_model), iter); row_changed (tree_model, &path, iter); gtk_tree_path_free (path); } } -GeditFileBrowserStoreResult -gedit_file_browser_store_set_virtual_root (GeditFileBrowserStore * model, +PlumaFileBrowserStoreResult +pluma_file_browser_store_set_virtual_root (PlumaFileBrowserStore * model, GtkTreeIter * iter) { - g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), - GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE); + g_return_val_if_fail (PLUMA_IS_FILE_BROWSER_STORE (model), + PLUMA_FILE_BROWSER_STORE_RESULT_NO_CHANGE); g_return_val_if_fail (iter != NULL, - GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE); + PLUMA_FILE_BROWSER_STORE_RESULT_NO_CHANGE); g_return_val_if_fail (iter->user_data != NULL, - GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE); + PLUMA_FILE_BROWSER_STORE_RESULT_NO_CHANGE); model_clear (model, FALSE); set_virtual_root_from_node (model, @@ -2869,25 +2869,25 @@ gedit_file_browser_store_set_virtual_root (GeditFileBrowserStore * model, return TRUE; } -GeditFileBrowserStoreResult -gedit_file_browser_store_set_virtual_root_from_string - (GeditFileBrowserStore * model, gchar const *root) { +PlumaFileBrowserStoreResult +pluma_file_browser_store_set_virtual_root_from_string + (PlumaFileBrowserStore * model, gchar const *root) { GFile *file; - g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), - GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE); + g_return_val_if_fail (PLUMA_IS_FILE_BROWSER_STORE (model), + PLUMA_FILE_BROWSER_STORE_RESULT_NO_CHANGE); file = g_file_new_for_uri (root); if (file == NULL) { g_warning ("Invalid uri (%s)", root); - return GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE; + return PLUMA_FILE_BROWSER_STORE_RESULT_NO_CHANGE; } /* Check if uri is already the virtual root */ if (model->priv->virtual_root && g_file_equal (model->priv->virtual_root->file, file)) { g_object_unref (file); - return GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE; + return PLUMA_FILE_BROWSER_STORE_RESULT_NO_CHANGE; } /* Check if uri is the root itself */ @@ -2897,7 +2897,7 @@ gedit_file_browser_store_set_virtual_root_from_string /* Always clear the model before altering the nodes */ model_clear (model, FALSE); set_virtual_root_from_node (model, model->priv->root); - return GEDIT_FILE_BROWSER_STORE_RESULT_OK; + return PLUMA_FILE_BROWSER_STORE_RESULT_OK; } if (!g_file_has_prefix (file, model->priv->root->file)) { @@ -2914,53 +2914,53 @@ gedit_file_browser_store_set_virtual_root_from_string g_free (str1); g_object_unref (file); - return GEDIT_FILE_BROWSER_STORE_RESULT_ERROR; + return PLUMA_FILE_BROWSER_STORE_RESULT_ERROR; } set_virtual_root_from_file (model, file); g_object_unref (file); - return GEDIT_FILE_BROWSER_STORE_RESULT_OK; + return PLUMA_FILE_BROWSER_STORE_RESULT_OK; } -GeditFileBrowserStoreResult -gedit_file_browser_store_set_virtual_root_top (GeditFileBrowserStore * +PlumaFileBrowserStoreResult +pluma_file_browser_store_set_virtual_root_top (PlumaFileBrowserStore * model) { - g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), - GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE); + g_return_val_if_fail (PLUMA_IS_FILE_BROWSER_STORE (model), + PLUMA_FILE_BROWSER_STORE_RESULT_NO_CHANGE); if (model->priv->virtual_root == model->priv->root) - return GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE; + return PLUMA_FILE_BROWSER_STORE_RESULT_NO_CHANGE; model_clear (model, FALSE); set_virtual_root_from_node (model, model->priv->root); - return GEDIT_FILE_BROWSER_STORE_RESULT_OK; + return PLUMA_FILE_BROWSER_STORE_RESULT_OK; } -GeditFileBrowserStoreResult -gedit_file_browser_store_set_virtual_root_up (GeditFileBrowserStore * +PlumaFileBrowserStoreResult +pluma_file_browser_store_set_virtual_root_up (PlumaFileBrowserStore * model) { - g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), - GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE); + g_return_val_if_fail (PLUMA_IS_FILE_BROWSER_STORE (model), + PLUMA_FILE_BROWSER_STORE_RESULT_NO_CHANGE); if (model->priv->virtual_root == model->priv->root) - return GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE; + return PLUMA_FILE_BROWSER_STORE_RESULT_NO_CHANGE; model_clear (model, FALSE); set_virtual_root_from_node (model, model->priv->virtual_root->parent); - return GEDIT_FILE_BROWSER_STORE_RESULT_OK; + return PLUMA_FILE_BROWSER_STORE_RESULT_OK; } gboolean -gedit_file_browser_store_get_iter_virtual_root (GeditFileBrowserStore * +pluma_file_browser_store_get_iter_virtual_root (PlumaFileBrowserStore * model, GtkTreeIter * iter) { - g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), FALSE); + g_return_val_if_fail (PLUMA_IS_FILE_BROWSER_STORE (model), FALSE); g_return_val_if_fail (iter != NULL, FALSE); if (model->priv->virtual_root == NULL) @@ -2971,10 +2971,10 @@ gedit_file_browser_store_get_iter_virtual_root (GeditFileBrowserStore * } gboolean -gedit_file_browser_store_get_iter_root (GeditFileBrowserStore * model, +pluma_file_browser_store_get_iter_root (PlumaFileBrowserStore * model, GtkTreeIter * iter) { - g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), FALSE); + g_return_val_if_fail (PLUMA_IS_FILE_BROWSER_STORE (model), FALSE); g_return_val_if_fail (iter != NULL, FALSE); if (model->priv->root == NULL) @@ -2985,11 +2985,11 @@ gedit_file_browser_store_get_iter_root (GeditFileBrowserStore * model, } gboolean -gedit_file_browser_store_iter_equal (GeditFileBrowserStore * model, +pluma_file_browser_store_iter_equal (PlumaFileBrowserStore * model, GtkTreeIter * iter1, GtkTreeIter * iter2) { - g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), FALSE); + g_return_val_if_fail (PLUMA_IS_FILE_BROWSER_STORE (model), FALSE); g_return_val_if_fail (iter1 != NULL, FALSE); g_return_val_if_fail (iter2 != NULL, FALSE); g_return_val_if_fail (iter1->user_data != NULL, FALSE); @@ -2999,15 +2999,15 @@ gedit_file_browser_store_iter_equal (GeditFileBrowserStore * model, } void -gedit_file_browser_store_cancel_mount_operation (GeditFileBrowserStore *store) +pluma_file_browser_store_cancel_mount_operation (PlumaFileBrowserStore *store) { - g_return_if_fail (GEDIT_IS_FILE_BROWSER_STORE (store)); + g_return_if_fail (PLUMA_IS_FILE_BROWSER_STORE (store)); cancel_mount_operation (store); } -GeditFileBrowserStoreResult -gedit_file_browser_store_set_root_and_virtual_root (GeditFileBrowserStore * +PlumaFileBrowserStoreResult +pluma_file_browser_store_set_root_and_virtual_root (PlumaFileBrowserStore * model, gchar const *root, gchar const *virtual_root) @@ -3017,11 +3017,11 @@ gedit_file_browser_store_set_root_and_virtual_root (GeditFileBrowserStore * FileBrowserNode * node; gboolean equal = FALSE; - g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), - GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE); + g_return_val_if_fail (PLUMA_IS_FILE_BROWSER_STORE (model), + PLUMA_FILE_BROWSER_STORE_RESULT_NO_CHANGE); if (root == NULL && model->priv->root == NULL) - return GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE; + return PLUMA_FILE_BROWSER_STORE_RESULT_NO_CHANGE; if (root != NULL) { file = g_file_new_for_uri (root); @@ -3032,7 +3032,7 @@ gedit_file_browser_store_set_root_and_virtual_root (GeditFileBrowserStore * if (equal && virtual_root == NULL) { g_object_unref (file); - return GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE; + return PLUMA_FILE_BROWSER_STORE_RESULT_NO_CHANGE; } } @@ -3044,7 +3044,7 @@ gedit_file_browser_store_set_root_and_virtual_root (GeditFileBrowserStore * g_object_unref (file); g_object_unref (vfile); - return GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE; + return PLUMA_FILE_BROWSER_STORE_RESULT_NO_CHANGE; } g_object_unref (vfile); @@ -3073,24 +3073,24 @@ gedit_file_browser_store_set_root_and_virtual_root (GeditFileBrowserStore * g_object_notify (G_OBJECT (model), "virtual-root"); } - return GEDIT_FILE_BROWSER_STORE_RESULT_OK; + return PLUMA_FILE_BROWSER_STORE_RESULT_OK; } -GeditFileBrowserStoreResult -gedit_file_browser_store_set_root (GeditFileBrowserStore * model, +PlumaFileBrowserStoreResult +pluma_file_browser_store_set_root (PlumaFileBrowserStore * model, gchar const *root) { - g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), - GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE); - return gedit_file_browser_store_set_root_and_virtual_root (model, + g_return_val_if_fail (PLUMA_IS_FILE_BROWSER_STORE (model), + PLUMA_FILE_BROWSER_STORE_RESULT_NO_CHANGE); + return pluma_file_browser_store_set_root_and_virtual_root (model, root, NULL); } gchar * -gedit_file_browser_store_get_root (GeditFileBrowserStore * model) +pluma_file_browser_store_get_root (PlumaFileBrowserStore * model) { - g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), NULL); + g_return_val_if_fail (PLUMA_IS_FILE_BROWSER_STORE (model), NULL); if (model->priv->root == NULL || model->priv->root->file == NULL) return NULL; @@ -3099,9 +3099,9 @@ gedit_file_browser_store_get_root (GeditFileBrowserStore * model) } gchar * -gedit_file_browser_store_get_virtual_root (GeditFileBrowserStore * model) +pluma_file_browser_store_get_virtual_root (PlumaFileBrowserStore * model) { - g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), NULL); + g_return_val_if_fail (PLUMA_IS_FILE_BROWSER_STORE (model), NULL); if (model->priv->virtual_root == NULL || model->priv->virtual_root->file == NULL) return NULL; @@ -3110,12 +3110,12 @@ gedit_file_browser_store_get_virtual_root (GeditFileBrowserStore * model) } void -_gedit_file_browser_store_iter_expanded (GeditFileBrowserStore * model, +_pluma_file_browser_store_iter_expanded (PlumaFileBrowserStore * model, GtkTreeIter * iter) { FileBrowserNode *node; - g_return_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model)); + g_return_if_fail (PLUMA_IS_FILE_BROWSER_STORE (model)); g_return_if_fail (iter != NULL); g_return_if_fail (iter->user_data != NULL); @@ -3128,13 +3128,13 @@ _gedit_file_browser_store_iter_expanded (GeditFileBrowserStore * model, } void -_gedit_file_browser_store_iter_collapsed (GeditFileBrowserStore * model, +_pluma_file_browser_store_iter_collapsed (PlumaFileBrowserStore * model, GtkTreeIter * iter) { FileBrowserNode *node; GSList *item; - g_return_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model)); + g_return_if_fail (PLUMA_IS_FILE_BROWSER_STORE (model)); g_return_if_fail (iter != NULL); g_return_if_fail (iter->user_data != NULL); @@ -3156,18 +3156,18 @@ _gedit_file_browser_store_iter_collapsed (GeditFileBrowserStore * model, } } -GeditFileBrowserStoreFilterMode -gedit_file_browser_store_get_filter_mode (GeditFileBrowserStore * model) +PlumaFileBrowserStoreFilterMode +pluma_file_browser_store_get_filter_mode (PlumaFileBrowserStore * model) { return model->priv->filter_mode; } void -gedit_file_browser_store_set_filter_mode (GeditFileBrowserStore * model, - GeditFileBrowserStoreFilterMode +pluma_file_browser_store_set_filter_mode (PlumaFileBrowserStore * model, + PlumaFileBrowserStoreFilterMode mode) { - g_return_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model)); + g_return_if_fail (PLUMA_IS_FILE_BROWSER_STORE (model)); if (model->priv->filter_mode == mode) return; @@ -3179,11 +3179,11 @@ gedit_file_browser_store_set_filter_mode (GeditFileBrowserStore * model, } void -gedit_file_browser_store_set_filter_func (GeditFileBrowserStore * model, - GeditFileBrowserStoreFilterFunc +pluma_file_browser_store_set_filter_func (PlumaFileBrowserStore * model, + PlumaFileBrowserStoreFilterFunc func, gpointer user_data) { - g_return_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model)); + g_return_if_fail (PLUMA_IS_FILE_BROWSER_STORE (model)); model->priv->filter_func = func; model->priv->filter_user_data = user_data; @@ -3191,21 +3191,21 @@ gedit_file_browser_store_set_filter_func (GeditFileBrowserStore * model, } void -gedit_file_browser_store_refilter (GeditFileBrowserStore * model) +pluma_file_browser_store_refilter (PlumaFileBrowserStore * model) { model_refilter (model); } -GeditFileBrowserStoreFilterMode -gedit_file_browser_store_filter_mode_get_default (void) +PlumaFileBrowserStoreFilterMode +pluma_file_browser_store_filter_mode_get_default (void) { - return GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN; + return PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN; } void -gedit_file_browser_store_refresh (GeditFileBrowserStore * model) +pluma_file_browser_store_refresh (PlumaFileBrowserStore * model) { - g_return_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model)); + g_return_if_fail (PLUMA_IS_FILE_BROWSER_STORE (model)); if (model->priv->root == NULL || model->priv->virtual_root == NULL) return; @@ -3248,7 +3248,7 @@ reparent_node (FileBrowserNode * node, gboolean reparent) } gboolean -gedit_file_browser_store_rename (GeditFileBrowserStore * model, +pluma_file_browser_store_rename (PlumaFileBrowserStore * model, GtkTreeIter * iter, const gchar * new_name, GError ** error) @@ -3262,7 +3262,7 @@ gedit_file_browser_store_rename (GeditFileBrowserStore * model, gchar * newuri; GtkTreePath *path; - g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), FALSE); + g_return_val_if_fail (PLUMA_IS_FILE_BROWSER_STORE (model), FALSE); g_return_val_if_fail (iter != NULL, FALSE); g_return_val_if_fail (iter->user_data != NULL, FALSE); @@ -3290,7 +3290,7 @@ gedit_file_browser_store_rename (GeditFileBrowserStore * model, reparent_node (node, FALSE); if (model_node_visibility (model, node)) { - path = gedit_file_browser_store_get_path_real (model, node); + path = pluma_file_browser_store_get_path_real (model, node); row_changed (model, &path, iter); gtk_tree_path_free (path); @@ -3300,8 +3300,8 @@ gedit_file_browser_store_rename (GeditFileBrowserStore * model, g_object_unref (previous); if (error != NULL) - *error = g_error_new_literal (gedit_file_browser_store_error_quark (), - GEDIT_FILE_BROWSER_ERROR_RENAME, + *error = g_error_new_literal (pluma_file_browser_store_error_quark (), + PLUMA_FILE_BROWSER_ERROR_RENAME, _("The renamed file is currently filtered out. You need to adjust your filter settings to make the file visible")); return FALSE; } @@ -3323,8 +3323,8 @@ gedit_file_browser_store_rename (GeditFileBrowserStore * model, if (error != NULL) { *error = g_error_new_literal - (gedit_file_browser_store_error_quark (), - GEDIT_FILE_BROWSER_ERROR_RENAME, + (pluma_file_browser_store_error_quark (), + PLUMA_FILE_BROWSER_ERROR_RENAME, err->message); } @@ -3360,7 +3360,7 @@ emit_no_trash (AsyncData * data) } typedef struct { - GeditFileBrowserStore * model; + PlumaFileBrowserStore * model; GFile * file; } IdleDelete; @@ -3433,8 +3433,8 @@ delete_files (GIOSchedulerJob * job, return TRUE; } -GeditFileBrowserStoreResult -gedit_file_browser_store_delete_all (GeditFileBrowserStore *model, +PlumaFileBrowserStoreResult +pluma_file_browser_store_delete_all (PlumaFileBrowserStore *model, GList *rows, gboolean trash) { FileBrowserNode * node; @@ -3445,10 +3445,10 @@ gedit_file_browser_store_delete_all (GeditFileBrowserStore *model, GtkTreePath * prev = NULL; GtkTreePath * path; - g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE); + g_return_val_if_fail (PLUMA_IS_FILE_BROWSER_STORE (model), PLUMA_FILE_BROWSER_STORE_RESULT_NO_CHANGE); if (rows == NULL) - return GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE; + return PLUMA_FILE_BROWSER_STORE_RESULT_NO_CHANGE; /* First we sort the paths so that we can later on remove any files/directories that are actually subfiles/directories of @@ -3490,28 +3490,28 @@ gedit_file_browser_store_delete_all (GeditFileBrowserStore *model, data->cancellable); g_list_free (rows); - return GEDIT_FILE_BROWSER_STORE_RESULT_OK; + return PLUMA_FILE_BROWSER_STORE_RESULT_OK; } -GeditFileBrowserStoreResult -gedit_file_browser_store_delete (GeditFileBrowserStore * model, +PlumaFileBrowserStoreResult +pluma_file_browser_store_delete (PlumaFileBrowserStore * model, GtkTreeIter * iter, gboolean trash) { FileBrowserNode *node; GList *rows = NULL; - GeditFileBrowserStoreResult result; + PlumaFileBrowserStoreResult result; - g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE); - g_return_val_if_fail (iter != NULL, GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE); - g_return_val_if_fail (iter->user_data != NULL, GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE); + g_return_val_if_fail (PLUMA_IS_FILE_BROWSER_STORE (model), PLUMA_FILE_BROWSER_STORE_RESULT_NO_CHANGE); + g_return_val_if_fail (iter != NULL, PLUMA_FILE_BROWSER_STORE_RESULT_NO_CHANGE); + g_return_val_if_fail (iter->user_data != NULL, PLUMA_FILE_BROWSER_STORE_RESULT_NO_CHANGE); node = (FileBrowserNode *) (iter->user_data); if (NODE_IS_DUMMY (node)) - return GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE; + return PLUMA_FILE_BROWSER_STORE_RESULT_NO_CHANGE; - rows = g_list_append(NULL, gedit_file_browser_store_get_path_real (model, node)); - result = gedit_file_browser_store_delete_all (model, rows, trash); + rows = g_list_append(NULL, pluma_file_browser_store_get_path_real (model, node)); + result = pluma_file_browser_store_delete_all (model, rows, trash); g_list_foreach (rows, (GFunc)gtk_tree_path_free, NULL); g_list_free (rows); @@ -3520,7 +3520,7 @@ gedit_file_browser_store_delete (GeditFileBrowserStore * model, } gboolean -gedit_file_browser_store_new_file (GeditFileBrowserStore * model, +pluma_file_browser_store_new_file (PlumaFileBrowserStore * model, GtkTreeIter * parent, GtkTreeIter * iter) { @@ -3531,7 +3531,7 @@ gedit_file_browser_store_new_file (GeditFileBrowserStore * model, FileBrowserNode *node; GError * error = NULL; - g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), FALSE); + g_return_val_if_fail (PLUMA_IS_FILE_BROWSER_STORE (model), FALSE); g_return_val_if_fail (parent != NULL, FALSE); g_return_val_if_fail (parent->user_data != NULL, FALSE); g_return_val_if_fail (NODE_IS_DIR @@ -3548,7 +3548,7 @@ gedit_file_browser_store_new_file (GeditFileBrowserStore * model, if (!stream) { g_signal_emit (model, model_signals[ERROR], 0, - GEDIT_FILE_BROWSER_ERROR_NEW_FILE, + PLUMA_FILE_BROWSER_ERROR_NEW_FILE, error->message); g_error_free (error); } else { @@ -3563,7 +3563,7 @@ gedit_file_browser_store_new_file (GeditFileBrowserStore * model, result = TRUE; } else { g_signal_emit (model, model_signals[ERROR], 0, - GEDIT_FILE_BROWSER_ERROR_NEW_FILE, + PLUMA_FILE_BROWSER_ERROR_NEW_FILE, _ ("The new file is currently filtered out. You need to adjust your filter settings to make the file visible")); } @@ -3574,7 +3574,7 @@ gedit_file_browser_store_new_file (GeditFileBrowserStore * model, } gboolean -gedit_file_browser_store_new_directory (GeditFileBrowserStore * model, +pluma_file_browser_store_new_directory (PlumaFileBrowserStore * model, GtkTreeIter * parent, GtkTreeIter * iter) { @@ -3584,7 +3584,7 @@ gedit_file_browser_store_new_directory (GeditFileBrowserStore * model, FileBrowserNode *node; gboolean result = FALSE; - g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), FALSE); + g_return_val_if_fail (PLUMA_IS_FILE_BROWSER_STORE (model), FALSE); g_return_val_if_fail (parent != NULL, FALSE); g_return_val_if_fail (parent->user_data != NULL, FALSE); g_return_val_if_fail (NODE_IS_DIR @@ -3598,7 +3598,7 @@ gedit_file_browser_store_new_directory (GeditFileBrowserStore * model, if (!g_file_make_directory (file, NULL, &error)) { g_signal_emit (model, model_signals[ERROR], 0, - GEDIT_FILE_BROWSER_ERROR_NEW_DIRECTORY, + PLUMA_FILE_BROWSER_ERROR_NEW_DIRECTORY, error->message); g_error_free (error); } else { @@ -3612,7 +3612,7 @@ gedit_file_browser_store_new_directory (GeditFileBrowserStore * model, result = TRUE; } else { g_signal_emit (model, model_signals[ERROR], 0, - GEDIT_FILE_BROWSER_ERROR_NEW_FILE, + PLUMA_FILE_BROWSER_ERROR_NEW_FILE, _ ("The new directory is currently filtered out. You need to adjust your filter settings to make the directory visible")); } diff --git a/plugins/filebrowser/pluma-file-browser-store.h b/plugins/filebrowser/pluma-file-browser-store.h new file mode 100755 index 00000000..65b75e08 --- /dev/null +++ b/plugins/filebrowser/pluma-file-browser-store.h @@ -0,0 +1,200 @@ +/* + * pluma-file-browser-store.h - Pluma plugin providing easy file access + * from the sidepanel + * + * Copyright (C) 2006 - Jesse van den Kieboom <[email protected]> + * + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __PLUMA_FILE_BROWSER_STORE_H__ +#define __PLUMA_FILE_BROWSER_STORE_H__ + +#include <gtk/gtk.h> + +G_BEGIN_DECLS +#define PLUMA_TYPE_FILE_BROWSER_STORE (pluma_file_browser_store_get_type ()) +#define PLUMA_FILE_BROWSER_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PLUMA_TYPE_FILE_BROWSER_STORE, PlumaFileBrowserStore)) +#define PLUMA_FILE_BROWSER_STORE_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PLUMA_TYPE_FILE_BROWSER_STORE, PlumaFileBrowserStore const)) +#define PLUMA_FILE_BROWSER_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PLUMA_TYPE_FILE_BROWSER_STORE, PlumaFileBrowserStoreClass)) +#define PLUMA_IS_FILE_BROWSER_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PLUMA_TYPE_FILE_BROWSER_STORE)) +#define PLUMA_IS_FILE_BROWSER_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PLUMA_TYPE_FILE_BROWSER_STORE)) +#define PLUMA_FILE_BROWSER_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PLUMA_TYPE_FILE_BROWSER_STORE, PlumaFileBrowserStoreClass)) + +typedef enum +{ + PLUMA_FILE_BROWSER_STORE_COLUMN_ICON = 0, + PLUMA_FILE_BROWSER_STORE_COLUMN_NAME, + PLUMA_FILE_BROWSER_STORE_COLUMN_URI, + PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS, + PLUMA_FILE_BROWSER_STORE_COLUMN_EMBLEM, + PLUMA_FILE_BROWSER_STORE_COLUMN_NUM +} PlumaFileBrowserStoreColumn; + +typedef enum +{ + PLUMA_FILE_BROWSER_STORE_FLAG_IS_DIRECTORY = 1 << 0, + PLUMA_FILE_BROWSER_STORE_FLAG_IS_HIDDEN = 1 << 1, + PLUMA_FILE_BROWSER_STORE_FLAG_IS_TEXT = 1 << 2, + PLUMA_FILE_BROWSER_STORE_FLAG_LOADED = 1 << 3, + PLUMA_FILE_BROWSER_STORE_FLAG_IS_FILTERED = 1 << 4, + PLUMA_FILE_BROWSER_STORE_FLAG_IS_DUMMY = 1 << 5 +} PlumaFileBrowserStoreFlag; + +typedef enum +{ + PLUMA_FILE_BROWSER_STORE_RESULT_OK, + PLUMA_FILE_BROWSER_STORE_RESULT_NO_CHANGE, + PLUMA_FILE_BROWSER_STORE_RESULT_ERROR, + PLUMA_FILE_BROWSER_STORE_RESULT_NO_TRASH, + PLUMA_FILE_BROWSER_STORE_RESULT_MOUNTING, + PLUMA_FILE_BROWSER_STORE_RESULT_NUM +} PlumaFileBrowserStoreResult; + +typedef enum +{ + PLUMA_FILE_BROWSER_STORE_FILTER_MODE_NONE = 0, + PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN = 1 << 0, + PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY = 1 << 1 +} PlumaFileBrowserStoreFilterMode; + +#define FILE_IS_DIR(flags) (flags & PLUMA_FILE_BROWSER_STORE_FLAG_IS_DIRECTORY) +#define FILE_IS_HIDDEN(flags) (flags & PLUMA_FILE_BROWSER_STORE_FLAG_IS_HIDDEN) +#define FILE_IS_TEXT(flags) (flags & PLUMA_FILE_BROWSER_STORE_FLAG_IS_TEXT) +#define FILE_LOADED(flags) (flags & PLUMA_FILE_BROWSER_STORE_FLAG_LOADED) +#define FILE_IS_FILTERED(flags) (flags & PLUMA_FILE_BROWSER_STORE_FLAG_IS_FILTERED) +#define FILE_IS_DUMMY(flags) (flags & PLUMA_FILE_BROWSER_STORE_FLAG_IS_DUMMY) + +typedef struct _PlumaFileBrowserStore PlumaFileBrowserStore; +typedef struct _PlumaFileBrowserStoreClass PlumaFileBrowserStoreClass; +typedef struct _PlumaFileBrowserStorePrivate PlumaFileBrowserStorePrivate; + +typedef gboolean (*PlumaFileBrowserStoreFilterFunc) (PlumaFileBrowserStore + * model, + GtkTreeIter * iter, + gpointer user_data); + +struct _PlumaFileBrowserStore +{ + GObject parent; + + PlumaFileBrowserStorePrivate *priv; +}; + +struct _PlumaFileBrowserStoreClass { + GObjectClass parent_class; + + /* Signals */ + void (*begin_loading) (PlumaFileBrowserStore * model, + GtkTreeIter * iter); + void (*end_loading) (PlumaFileBrowserStore * model, + GtkTreeIter * iter); + void (*error) (PlumaFileBrowserStore * model, + guint code, + gchar * message); + gboolean (*no_trash) (PlumaFileBrowserStore * model, + GList * files); + void (*rename) (PlumaFileBrowserStore * model, + const gchar * olduri, + const gchar * newuri); + void (*begin_refresh) (PlumaFileBrowserStore * model); + void (*end_refresh) (PlumaFileBrowserStore * model); + void (*unload) (PlumaFileBrowserStore * model, + const gchar * uri); +}; + +GType pluma_file_browser_store_get_type (void) G_GNUC_CONST; +GType pluma_file_browser_store_register_type (GTypeModule * module); + +PlumaFileBrowserStore *pluma_file_browser_store_new (gchar const *root); + +PlumaFileBrowserStoreResult +pluma_file_browser_store_set_root_and_virtual_root (PlumaFileBrowserStore * model, + gchar const *root, + gchar const *virtual_root); +PlumaFileBrowserStoreResult +pluma_file_browser_store_set_root (PlumaFileBrowserStore * model, + gchar const *root); +PlumaFileBrowserStoreResult +pluma_file_browser_store_set_virtual_root (PlumaFileBrowserStore * model, + GtkTreeIter * iter); +PlumaFileBrowserStoreResult +pluma_file_browser_store_set_virtual_root_from_string (PlumaFileBrowserStore * model, + gchar const *root); +PlumaFileBrowserStoreResult +pluma_file_browser_store_set_virtual_root_up (PlumaFileBrowserStore * model); +PlumaFileBrowserStoreResult +pluma_file_browser_store_set_virtual_root_top (PlumaFileBrowserStore * model); + +gboolean +pluma_file_browser_store_get_iter_virtual_root (PlumaFileBrowserStore * model, + GtkTreeIter * iter); +gboolean pluma_file_browser_store_get_iter_root (PlumaFileBrowserStore * model, + GtkTreeIter * iter); +gchar * pluma_file_browser_store_get_root (PlumaFileBrowserStore * model); +gchar * pluma_file_browser_store_get_virtual_root (PlumaFileBrowserStore * model); + +gboolean pluma_file_browser_store_iter_equal (PlumaFileBrowserStore * model, + GtkTreeIter * iter1, + GtkTreeIter * iter2); + +void pluma_file_browser_store_set_value (PlumaFileBrowserStore * tree_model, + GtkTreeIter * iter, + gint column, + GValue * value); + +void _pluma_file_browser_store_iter_expanded (PlumaFileBrowserStore * model, + GtkTreeIter * iter); +void _pluma_file_browser_store_iter_collapsed (PlumaFileBrowserStore * model, + GtkTreeIter * iter); + +PlumaFileBrowserStoreFilterMode +pluma_file_browser_store_get_filter_mode (PlumaFileBrowserStore * model); +void pluma_file_browser_store_set_filter_mode (PlumaFileBrowserStore * model, + PlumaFileBrowserStoreFilterMode mode); +void pluma_file_browser_store_set_filter_func (PlumaFileBrowserStore * model, + PlumaFileBrowserStoreFilterFunc func, + gpointer user_data); +void pluma_file_browser_store_refilter (PlumaFileBrowserStore * model); +PlumaFileBrowserStoreFilterMode +pluma_file_browser_store_filter_mode_get_default (void); + +void pluma_file_browser_store_refresh (PlumaFileBrowserStore * model); +gboolean pluma_file_browser_store_rename (PlumaFileBrowserStore * model, + GtkTreeIter * iter, + gchar const *new_name, + GError ** error); +PlumaFileBrowserStoreResult +pluma_file_browser_store_delete (PlumaFileBrowserStore * model, + GtkTreeIter * iter, + gboolean trash); +PlumaFileBrowserStoreResult +pluma_file_browser_store_delete_all (PlumaFileBrowserStore * model, + GList *rows, + gboolean trash); + +gboolean pluma_file_browser_store_new_file (PlumaFileBrowserStore * model, + GtkTreeIter * parent, + GtkTreeIter * iter); +gboolean pluma_file_browser_store_new_directory (PlumaFileBrowserStore * model, + GtkTreeIter * parent, + GtkTreeIter * iter); + +void pluma_file_browser_store_cancel_mount_operation (PlumaFileBrowserStore *store); + +G_END_DECLS +#endif /* __PLUMA_FILE_BROWSER_STORE_H__ */ + +// ex:ts=8:noet: diff --git a/plugins/filebrowser/gedit-file-browser-utils.c b/plugins/filebrowser/pluma-file-browser-utils.c index d8f4028a..6949486d 100755 --- a/plugins/filebrowser/gedit-file-browser-utils.c +++ b/plugins/filebrowser/pluma-file-browser-utils.c @@ -1,5 +1,5 @@ /* - * gedit-file-bookmarks-store.c - Gedit plugin providing easy file access + * pluma-file-bookmarks-store.c - Pluma plugin providing easy file access * from the sidepanel * * Copyright (C) 2006 - Jesse van den Kieboom <[email protected]> @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gedit-file-browser-utils.h" -#include <gedit/gedit-utils.h> +#include "pluma-file-browser-utils.h" +#include <pluma/pluma-utils.h> static GdkPixbuf * process_icon_pixbuf (GdkPixbuf * pixbuf, @@ -50,7 +50,7 @@ process_icon_pixbuf (GdkPixbuf * pixbuf, } GdkPixbuf * -gedit_file_browser_utils_pixbuf_from_theme (gchar const * name, +pluma_file_browser_utils_pixbuf_from_theme (gchar const * name, GtkIconSize size) { gint width; @@ -71,7 +71,7 @@ gedit_file_browser_utils_pixbuf_from_theme (gchar const * name, } GdkPixbuf * -gedit_file_browser_utils_pixbuf_from_icon (GIcon * icon, +pluma_file_browser_utils_pixbuf_from_icon (GIcon * icon, GtkIconSize size) { GdkPixbuf * ret = NULL; @@ -100,7 +100,7 @@ gedit_file_browser_utils_pixbuf_from_icon (GIcon * icon, } GdkPixbuf * -gedit_file_browser_utils_pixbuf_from_file (GFile * file, +pluma_file_browser_utils_pixbuf_from_file (GFile * file, GtkIconSize size) { GIcon * icon; @@ -118,7 +118,7 @@ gedit_file_browser_utils_pixbuf_from_file (GFile * file, icon = g_file_info_get_icon (info); if (icon != NULL) - ret = gedit_file_browser_utils_pixbuf_from_icon (icon, size); + ret = pluma_file_browser_utils_pixbuf_from_icon (icon, size); g_object_unref (info); @@ -126,26 +126,26 @@ gedit_file_browser_utils_pixbuf_from_file (GFile * file, } gchar * -gedit_file_browser_utils_file_basename (GFile * file) +pluma_file_browser_utils_file_basename (GFile * file) { gchar *uri; gchar *ret; uri = g_file_get_uri (file); - ret = gedit_file_browser_utils_uri_basename (uri); + ret = pluma_file_browser_utils_uri_basename (uri); g_free (uri); return ret; } gchar * -gedit_file_browser_utils_uri_basename (gchar const * uri) +pluma_file_browser_utils_uri_basename (gchar const * uri) { - return gedit_utils_basename_for_display (uri); + return pluma_utils_basename_for_display (uri); } gboolean -gedit_file_browser_utils_confirmation_dialog (GeditWindow * window, +pluma_file_browser_utils_confirmation_dialog (PlumaWindow * window, GtkMessageType type, gchar const *message, gchar const *secondary, diff --git a/plugins/filebrowser/gedit-file-browser-utils.h b/plugins/filebrowser/pluma-file-browser-utils.h index fc9acbce..0ac4296a 100755 --- a/plugins/filebrowser/gedit-file-browser-utils.h +++ b/plugins/filebrowser/pluma-file-browser-utils.h @@ -1,27 +1,27 @@ -#ifndef __GEDIT_FILE_BROWSER_UTILS_H__ -#define __GEDIT_FILE_BROWSER_UTILS_H__ +#ifndef __PLUMA_FILE_BROWSER_UTILS_H__ +#define __PLUMA_FILE_BROWSER_UTILS_H__ -#include <gedit/gedit-window.h> +#include <pluma/pluma-window.h> #include <gio/gio.h> -GdkPixbuf *gedit_file_browser_utils_pixbuf_from_theme (gchar const *name, +GdkPixbuf *pluma_file_browser_utils_pixbuf_from_theme (gchar const *name, GtkIconSize size); -GdkPixbuf *gedit_file_browser_utils_pixbuf_from_icon (GIcon * icon, +GdkPixbuf *pluma_file_browser_utils_pixbuf_from_icon (GIcon * icon, GtkIconSize size); -GdkPixbuf *gedit_file_browser_utils_pixbuf_from_file (GFile * file, +GdkPixbuf *pluma_file_browser_utils_pixbuf_from_file (GFile * file, GtkIconSize size); -gchar * gedit_file_browser_utils_file_basename (GFile * file); -gchar * gedit_file_browser_utils_uri_basename (gchar const * uri); +gchar * pluma_file_browser_utils_file_basename (GFile * file); +gchar * pluma_file_browser_utils_uri_basename (gchar const * uri); -gboolean gedit_file_browser_utils_confirmation_dialog (GeditWindow * window, +gboolean pluma_file_browser_utils_confirmation_dialog (PlumaWindow * window, GtkMessageType type, gchar const *message, gchar const *secondary, gchar const * button_stock, gchar const * button_label); -#endif /* __GEDIT_FILE_BROWSER_UTILS_H__ */ +#endif /* __PLUMA_FILE_BROWSER_UTILS_H__ */ // ex:ts=8:noet: diff --git a/plugins/filebrowser/gedit-file-browser-view.c b/plugins/filebrowser/pluma-file-browser-view.c index 05733da1..64e90c28 100755 --- a/plugins/filebrowser/gedit-file-browser-view.c +++ b/plugins/filebrowser/pluma-file-browser-view.c @@ -1,5 +1,5 @@ /* - * gedit-file-browser-view.c - Gedit plugin providing easy file access + * pluma-file-browser-view.c - Pluma plugin providing easy file access * from the sidepanel * * Copyright (C) 2006 - Jesse van den Kieboom <[email protected]> @@ -21,20 +21,20 @@ #include <string.h> #include <gio/gio.h> -#include <gedit/gedit-plugin.h> +#include <pluma/pluma-plugin.h> #include <gdk/gdkkeysyms.h> -#include "gedit-file-browser-store.h" -#include "gedit-file-bookmarks-store.h" -#include "gedit-file-browser-view.h" -#include "gedit-file-browser-marshal.h" -#include "gedit-file-browser-enum-types.h" +#include "pluma-file-browser-store.h" +#include "pluma-file-bookmarks-store.h" +#include "pluma-file-browser-view.h" +#include "pluma-file-browser-marshal.h" +#include "pluma-file-browser-enum-types.h" -#define GEDIT_FILE_BROWSER_VIEW_GET_PRIVATE(object)( \ +#define PLUMA_FILE_BROWSER_VIEW_GET_PRIVATE(object)( \ G_TYPE_INSTANCE_GET_PRIVATE((object), \ - GEDIT_TYPE_FILE_BROWSER_VIEW, GeditFileBrowserViewPrivate)) + PLUMA_TYPE_FILE_BROWSER_VIEW, PlumaFileBrowserViewPrivate)) -struct _GeditFileBrowserViewPrivate +struct _PlumaFileBrowserViewPrivate { GtkTreeViewColumn *column; GtkCellRenderer *pixbuf_renderer; @@ -46,7 +46,7 @@ struct _GeditFileBrowserViewPrivate GdkCursor *busy_cursor; /* CLick policy */ - GeditFileBrowserViewClickPolicy click_policy; + PlumaFileBrowserViewClickPolicy click_policy; GtkTreePath *double_click_path[2]; /* Both clicks in a double click need to be on the same row */ GtkTreePath *hover_path; GdkCursor *hand_cursor; @@ -85,32 +85,32 @@ static const GtkTargetEntry drag_source_targets[] = { { "text/uri-list", 0, 0 } }; -GEDIT_PLUGIN_DEFINE_TYPE (GeditFileBrowserView, gedit_file_browser_view, +PLUMA_PLUGIN_DEFINE_TYPE (PlumaFileBrowserView, pluma_file_browser_view, GTK_TYPE_TREE_VIEW) static void on_cell_edited (GtkCellRendererText * cell, gchar * path, gchar * new_text, - GeditFileBrowserView * tree_view); + PlumaFileBrowserView * tree_view); -static void on_begin_refresh (GeditFileBrowserStore * model, - GeditFileBrowserView * view); -static void on_end_refresh (GeditFileBrowserStore * model, - GeditFileBrowserView * view); +static void on_begin_refresh (PlumaFileBrowserStore * model, + PlumaFileBrowserView * view); +static void on_end_refresh (PlumaFileBrowserStore * model, + PlumaFileBrowserView * view); -static void on_unload (GeditFileBrowserStore * model, +static void on_unload (PlumaFileBrowserStore * model, gchar const * uri, - GeditFileBrowserView * view); + PlumaFileBrowserView * view); -static void on_row_inserted (GeditFileBrowserStore * model, +static void on_row_inserted (PlumaFileBrowserStore * model, GtkTreePath * path, GtkTreeIter * iter, - GeditFileBrowserView * view); + PlumaFileBrowserView * view); static void -gedit_file_browser_view_finalize (GObject * object) +pluma_file_browser_view_finalize (GObject * object) { - GeditFileBrowserView *obj = GEDIT_FILE_BROWSER_VIEW(object); + PlumaFileBrowserView *obj = PLUMA_FILE_BROWSER_VIEW(object); if (obj->priv->hand_cursor) gdk_cursor_unref(obj->priv->hand_cursor); @@ -126,12 +126,12 @@ gedit_file_browser_view_finalize (GObject * object) gdk_cursor_unref (obj->priv->busy_cursor); - G_OBJECT_CLASS (gedit_file_browser_view_parent_class)-> + G_OBJECT_CLASS (pluma_file_browser_view_parent_class)-> finalize (object); } static void -add_expand_state (GeditFileBrowserView * view, +add_expand_state (PlumaFileBrowserView * view, gchar const * uri) { GFile * file; @@ -148,7 +148,7 @@ add_expand_state (GeditFileBrowserView * view, } static void -remove_expand_state (GeditFileBrowserView * view, +remove_expand_state (PlumaFileBrowserView * view, gchar const * uri) { GFile * file; @@ -169,20 +169,20 @@ row_expanded (GtkTreeView * tree_view, GtkTreeIter * iter, GtkTreePath * path) { - GeditFileBrowserView *view = GEDIT_FILE_BROWSER_VIEW (tree_view); + PlumaFileBrowserView *view = PLUMA_FILE_BROWSER_VIEW (tree_view); gchar * uri; - if (GTK_TREE_VIEW_CLASS (gedit_file_browser_view_parent_class)->row_expanded) - GTK_TREE_VIEW_CLASS (gedit_file_browser_view_parent_class)->row_expanded (tree_view, iter, path); + if (GTK_TREE_VIEW_CLASS (pluma_file_browser_view_parent_class)->row_expanded) + GTK_TREE_VIEW_CLASS (pluma_file_browser_view_parent_class)->row_expanded (tree_view, iter, path); - if (!GEDIT_IS_FILE_BROWSER_STORE (view->priv->model)) + if (!PLUMA_IS_FILE_BROWSER_STORE (view->priv->model)) return; if (view->priv->restore_expand_state) { gtk_tree_model_get (view->priv->model, iter, - GEDIT_FILE_BROWSER_STORE_COLUMN_URI, + PLUMA_FILE_BROWSER_STORE_COLUMN_URI, &uri, -1); @@ -190,7 +190,7 @@ row_expanded (GtkTreeView * tree_view, g_free (uri); } - _gedit_file_browser_store_iter_expanded (GEDIT_FILE_BROWSER_STORE (view->priv->model), + _pluma_file_browser_store_iter_expanded (PLUMA_FILE_BROWSER_STORE (view->priv->model), iter); } @@ -199,20 +199,20 @@ row_collapsed (GtkTreeView * tree_view, GtkTreeIter * iter, GtkTreePath * path) { - GeditFileBrowserView *view = GEDIT_FILE_BROWSER_VIEW (tree_view); + PlumaFileBrowserView *view = PLUMA_FILE_BROWSER_VIEW (tree_view); gchar * uri; - if (GTK_TREE_VIEW_CLASS (gedit_file_browser_view_parent_class)->row_collapsed) - GTK_TREE_VIEW_CLASS (gedit_file_browser_view_parent_class)->row_collapsed (tree_view, iter, path); + if (GTK_TREE_VIEW_CLASS (pluma_file_browser_view_parent_class)->row_collapsed) + GTK_TREE_VIEW_CLASS (pluma_file_browser_view_parent_class)->row_collapsed (tree_view, iter, path); - if (!GEDIT_IS_FILE_BROWSER_STORE (view->priv->model)) + if (!PLUMA_IS_FILE_BROWSER_STORE (view->priv->model)) return; if (view->priv->restore_expand_state) { gtk_tree_model_get (view->priv->model, iter, - GEDIT_FILE_BROWSER_STORE_COLUMN_URI, + PLUMA_FILE_BROWSER_STORE_COLUMN_URI, &uri, -1); @@ -220,7 +220,7 @@ row_collapsed (GtkTreeView * tree_view, g_free (uri); } - _gedit_file_browser_store_iter_collapsed (GEDIT_FILE_BROWSER_STORE (view->priv->model), + _pluma_file_browser_store_iter_collapsed (PLUMA_FILE_BROWSER_STORE (view->priv->model), iter); } @@ -228,25 +228,25 @@ static gboolean leave_notify_event (GtkWidget *widget, GdkEventCrossing *event) { - GeditFileBrowserView *view = GEDIT_FILE_BROWSER_VIEW (widget); + PlumaFileBrowserView *view = PLUMA_FILE_BROWSER_VIEW (widget); - if (view->priv->click_policy == GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE && + if (view->priv->click_policy == PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE && view->priv->hover_path != NULL) { gtk_tree_path_free (view->priv->hover_path); view->priv->hover_path = NULL; } // Chainup - return GTK_WIDGET_CLASS (gedit_file_browser_view_parent_class)->leave_notify_event (widget, event); + return GTK_WIDGET_CLASS (pluma_file_browser_view_parent_class)->leave_notify_event (widget, event); } static gboolean enter_notify_event (GtkWidget *widget, GdkEventCrossing *event) { - GeditFileBrowserView *view = GEDIT_FILE_BROWSER_VIEW (widget); + PlumaFileBrowserView *view = PLUMA_FILE_BROWSER_VIEW (widget); - if (view->priv->click_policy == GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) { + if (view->priv->click_policy == PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) { if (view->priv->hover_path != NULL) gtk_tree_path_free (view->priv->hover_path); @@ -261,7 +261,7 @@ enter_notify_event (GtkWidget *widget, } // Chainup - return GTK_WIDGET_CLASS (gedit_file_browser_view_parent_class)->enter_notify_event (widget, event); + return GTK_WIDGET_CLASS (pluma_file_browser_view_parent_class)->enter_notify_event (widget, event); } static gboolean @@ -269,9 +269,9 @@ motion_notify_event (GtkWidget * widget, GdkEventMotion * event) { GtkTreePath *old_hover_path; - GeditFileBrowserView *view = GEDIT_FILE_BROWSER_VIEW (widget); + PlumaFileBrowserView *view = PLUMA_FILE_BROWSER_VIEW (widget); - if (view->priv->click_policy == GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) { + if (view->priv->click_policy == PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) { old_hover_path = view->priv->hover_path; gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget), event->x, event->y, @@ -292,12 +292,12 @@ motion_notify_event (GtkWidget * widget, } // Chainup - return GTK_WIDGET_CLASS (gedit_file_browser_view_parent_class)->motion_notify_event (widget, event); + return GTK_WIDGET_CLASS (pluma_file_browser_view_parent_class)->motion_notify_event (widget, event); } static void -set_click_policy_property (GeditFileBrowserView *obj, - GeditFileBrowserViewClickPolicy click_policy) +set_click_policy_property (PlumaFileBrowserView *obj, + PlumaFileBrowserViewClickPolicy click_policy) { GtkTreeIter iter; GdkDisplay *display; @@ -305,10 +305,10 @@ set_click_policy_property (GeditFileBrowserView *obj, obj->priv->click_policy = click_policy; - if (click_policy == GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) { + if (click_policy == PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) { if (obj->priv->hand_cursor == NULL) obj->priv->hand_cursor = gdk_cursor_new(GDK_HAND2); - } else if (click_policy == GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE) { + } else if (click_policy == PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE) { if (obj->priv->hover_path != NULL) { if (gtk_tree_model_get_iter (GTK_TREE_MODEL (obj->priv->model), &iter, obj->priv->hover_path)) @@ -337,21 +337,21 @@ set_click_policy_property (GeditFileBrowserView *obj, } static void -directory_activated (GeditFileBrowserView *view, +directory_activated (PlumaFileBrowserView *view, GtkTreeIter *iter) { - gedit_file_browser_store_set_virtual_root (GEDIT_FILE_BROWSER_STORE (view->priv->model), iter); + pluma_file_browser_store_set_virtual_root (PLUMA_FILE_BROWSER_STORE (view->priv->model), iter); } static void -activate_selected_files (GeditFileBrowserView *view) { +activate_selected_files (PlumaFileBrowserView *view) { GtkTreeView *tree_view = GTK_TREE_VIEW (view); GtkTreeSelection *selection = gtk_tree_view_get_selection (tree_view); GList *rows, *row; GtkTreePath *directory = NULL; GtkTreePath *path; GtkTreeIter iter; - GeditFileBrowserStoreFlag flags; + PlumaFileBrowserStoreFlag flags; rows = gtk_tree_selection_get_selected_rows (selection, &view->priv->model); @@ -362,7 +362,7 @@ activate_selected_files (GeditFileBrowserView *view) { if (!gtk_tree_model_get_iter (view->priv->model, &iter, path)) continue; - gtk_tree_model_get (view->priv->model, &iter, GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, -1); + gtk_tree_model_get (view->priv->model, &iter, PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, -1); if (FILE_IS_DIR (flags)) { if (directory == NULL) @@ -383,7 +383,7 @@ activate_selected_files (GeditFileBrowserView *view) { } static void -activate_selected_bookmark (GeditFileBrowserView *view) { +activate_selected_bookmark (PlumaFileBrowserView *view) { GtkTreeView *tree_view = GTK_TREE_VIEW (view); GtkTreeSelection *selection = gtk_tree_view_get_selection (tree_view); GtkTreeIter iter; @@ -393,26 +393,26 @@ activate_selected_bookmark (GeditFileBrowserView *view) { } static void -activate_selected_items (GeditFileBrowserView *view) +activate_selected_items (PlumaFileBrowserView *view) { - if (GEDIT_IS_FILE_BROWSER_STORE (view->priv->model)) + if (PLUMA_IS_FILE_BROWSER_STORE (view->priv->model)) activate_selected_files (view); - else if (GEDIT_IS_FILE_BOOKMARKS_STORE (view->priv->model)) + else if (PLUMA_IS_FILE_BOOKMARKS_STORE (view->priv->model)) activate_selected_bookmark (view); } static void -toggle_hidden_filter (GeditFileBrowserView *view) +toggle_hidden_filter (PlumaFileBrowserView *view) { - GeditFileBrowserStoreFilterMode mode; + PlumaFileBrowserStoreFilterMode mode; - if (GEDIT_IS_FILE_BROWSER_STORE (view->priv->model)) + if (PLUMA_IS_FILE_BROWSER_STORE (view->priv->model)) { - mode = gedit_file_browser_store_get_filter_mode - (GEDIT_FILE_BROWSER_STORE (view->priv->model)); - mode ^= GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN; - gedit_file_browser_store_set_filter_mode - (GEDIT_FILE_BROWSER_STORE (view->priv->model), mode); + mode = pluma_file_browser_store_get_filter_mode + (PLUMA_FILE_BROWSER_STORE (view->priv->model)); + mode ^= PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN; + pluma_file_browser_store_set_filter_mode + (PLUMA_FILE_BROWSER_STORE (view->priv->model), mode); } } @@ -426,17 +426,17 @@ static void drag_begin (GtkWidget *widget, GdkDragContext *context) { - GeditFileBrowserView *view = GEDIT_FILE_BROWSER_VIEW (widget); + PlumaFileBrowserView *view = PLUMA_FILE_BROWSER_VIEW (widget); view->priv->drag_button = 0; view->priv->drag_started = TRUE; /* Chain up */ - GTK_WIDGET_CLASS (gedit_file_browser_view_parent_class)->drag_begin (widget, context); + GTK_WIDGET_CLASS (pluma_file_browser_view_parent_class)->drag_begin (widget, context); } static void -did_not_drag (GeditFileBrowserView *view, +did_not_drag (PlumaFileBrowserView *view, GdkEventButton *event) { GtkTreeView *tree_view; @@ -448,7 +448,7 @@ did_not_drag (GeditFileBrowserView *view, if (gtk_tree_view_get_path_at_pos (tree_view, event->x, event->y, &path, NULL, NULL, NULL)) { - if ((view->priv->click_policy == GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) + if ((view->priv->click_policy == PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) && !button_event_modifies_selection(event) && (event->button == 1 || event->button == 2)) { /* Activate all selected items, and leave them selected */ @@ -473,7 +473,7 @@ static gboolean button_release_event (GtkWidget *widget, GdkEventButton *event) { - GeditFileBrowserView *view = GEDIT_FILE_BROWSER_VIEW (widget); + PlumaFileBrowserView *view = PLUMA_FILE_BROWSER_VIEW (widget); if (event->button == view->priv->drag_button) { view->priv->drag_button = 0; @@ -484,7 +484,7 @@ button_release_event (GtkWidget *widget, } /* Chain up */ - return GTK_WIDGET_CLASS (gedit_file_browser_view_parent_class)->button_release_event (widget, event); + return GTK_WIDGET_CLASS (pluma_file_browser_view_parent_class)->button_release_event (widget, event); } static gboolean @@ -494,7 +494,7 @@ button_press_event (GtkWidget *widget, int double_click_time; static int click_count = 0; static guint32 last_click_time = 0; - GeditFileBrowserView *view; + PlumaFileBrowserView *view; GtkTreeView *tree_view; GtkTreeSelection *selection; GtkTreePath *path; @@ -503,10 +503,10 @@ button_press_event (GtkWidget *widget, gboolean on_expander; gboolean call_parent; gboolean selected; - GtkWidgetClass *widget_parent = GTK_WIDGET_CLASS(gedit_file_browser_view_parent_class); + GtkWidgetClass *widget_parent = GTK_WIDGET_CLASS(pluma_file_browser_view_parent_class); tree_view = GTK_TREE_VIEW (widget); - view = GEDIT_FILE_BROWSER_VIEW (widget); + view = PLUMA_FILE_BROWSER_VIEW (widget); selection = gtk_tree_view_get_selection (tree_view); /* Get double click time */ @@ -523,7 +523,7 @@ button_press_event (GtkWidget *widget, last_click_time = event->time; /* Ignore double click if we are in single click mode */ - if (view->priv->click_policy == GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE && + if (view->priv->click_policy == PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE && click_count >= 2) { return TRUE; } @@ -576,7 +576,7 @@ button_press_event (GtkWidget *widget, if (selected) { call_parent = on_expander || gtk_tree_selection_count_selected_rows (selection) == 1; - view->priv->ignore_release = call_parent && view->priv->click_policy != GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE; + view->priv->ignore_release = call_parent && view->priv->click_policy != PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE; } else if ((event->state & GDK_CONTROL_MASK) != 0) { call_parent = FALSE; gtk_tree_selection_select_path (selection, path); @@ -623,11 +623,11 @@ static gboolean key_press_event (GtkWidget *widget, GdkEventKey *event) { - GeditFileBrowserView *view; + PlumaFileBrowserView *view; guint modifiers; gboolean handled; - view = GEDIT_FILE_BROWSER_VIEW (widget); + view = PLUMA_FILE_BROWSER_VIEW (widget); handled = FALSE; modifiers = gtk_accelerator_get_default_mod_mask (); @@ -666,13 +666,13 @@ key_press_event (GtkWidget *widget, /* Chain up */ if (!handled) - return GTK_WIDGET_CLASS (gedit_file_browser_view_parent_class)->key_press_event (widget, event); + return GTK_WIDGET_CLASS (pluma_file_browser_view_parent_class)->key_press_event (widget, event); return TRUE; } static void -fill_expand_state (GeditFileBrowserView * view, GtkTreeIter * iter) +fill_expand_state (PlumaFileBrowserView * view, GtkTreeIter * iter) { GtkTreePath * path; GtkTreeIter child; @@ -687,7 +687,7 @@ fill_expand_state (GeditFileBrowserView * view, GtkTreeIter * iter) { gtk_tree_model_get (view->priv->model, iter, - GEDIT_FILE_BROWSER_STORE_COLUMN_URI, + PLUMA_FILE_BROWSER_STORE_COLUMN_URI, &uri, -1); @@ -706,7 +706,7 @@ fill_expand_state (GeditFileBrowserView * view, GtkTreeIter * iter) } static void -uninstall_restore_signals (GeditFileBrowserView * tree_view, +uninstall_restore_signals (PlumaFileBrowserView * tree_view, GtkTreeModel * model) { g_signal_handlers_disconnect_by_func (model, @@ -727,7 +727,7 @@ uninstall_restore_signals (GeditFileBrowserView * tree_view, } static void -install_restore_signals (GeditFileBrowserView * tree_view, +install_restore_signals (PlumaFileBrowserView * tree_view, GtkTreeModel * model) { g_signal_connect (model, @@ -752,7 +752,7 @@ install_restore_signals (GeditFileBrowserView * tree_view, } static void -set_restore_expand_state (GeditFileBrowserView * view, +set_restore_expand_state (PlumaFileBrowserView * view, gboolean state) { if (state == view->priv->restore_expand_state) @@ -771,14 +771,14 @@ set_restore_expand_state (GeditFileBrowserView * view, g_object_unref, NULL); - if (view->priv->model && GEDIT_IS_FILE_BROWSER_STORE (view->priv->model)) + if (view->priv->model && PLUMA_IS_FILE_BROWSER_STORE (view->priv->model)) { fill_expand_state (view, NULL); install_restore_signals (view, view->priv->model); } } - else if (view->priv->model && GEDIT_IS_FILE_BROWSER_STORE (view->priv->model)) + else if (view->priv->model && PLUMA_IS_FILE_BROWSER_STORE (view->priv->model)) { uninstall_restore_signals (view, view->priv->model); } @@ -792,7 +792,7 @@ get_property (GObject *object, GValue *value, GParamSpec *pspec) { - GeditFileBrowserView *obj = GEDIT_FILE_BROWSER_VIEW (object); + PlumaFileBrowserView *obj = PLUMA_FILE_BROWSER_VIEW (object); switch (prop_id) { @@ -814,7 +814,7 @@ set_property (GObject *object, const GValue *value, GParamSpec *pspec) { - GeditFileBrowserView *obj = GEDIT_FILE_BROWSER_VIEW (object); + PlumaFileBrowserView *obj = PLUMA_FILE_BROWSER_VIEW (object); switch (prop_id) { @@ -831,13 +831,13 @@ set_property (GObject *object, } static void -gedit_file_browser_view_class_init (GeditFileBrowserViewClass * klass) +pluma_file_browser_view_class_init (PlumaFileBrowserViewClass * klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); GtkTreeViewClass *tree_view_class = GTK_TREE_VIEW_CLASS (klass); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); - object_class->finalize = gedit_file_browser_view_finalize; + object_class->finalize = pluma_file_browser_view_finalize; object_class->get_property = get_property; object_class->set_property = set_property; @@ -861,8 +861,8 @@ gedit_file_browser_view_class_init (GeditFileBrowserViewClass * klass) g_param_spec_enum ("click-policy", "Click Policy", "The click policy", - GEDIT_TYPE_FILE_BROWSER_VIEW_CLICK_POLICY, - GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE, + PLUMA_TYPE_FILE_BROWSER_VIEW_CLICK_POLICY, + PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); g_object_class_install_property (object_class, PROP_RESTORE_EXPAND_STATE, @@ -876,15 +876,15 @@ gedit_file_browser_view_class_init (GeditFileBrowserViewClass * klass) g_signal_new ("error", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GeditFileBrowserViewClass, + G_STRUCT_OFFSET (PlumaFileBrowserViewClass, error), NULL, NULL, - gedit_file_browser_marshal_VOID__UINT_STRING, + pluma_file_browser_marshal_VOID__UINT_STRING, G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_STRING); signals[FILE_ACTIVATED] = g_signal_new ("file-activated", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GeditFileBrowserViewClass, + G_STRUCT_OFFSET (PlumaFileBrowserViewClass, file_activated), NULL, NULL, g_cclosure_marshal_VOID__BOXED, G_TYPE_NONE, 1, GTK_TYPE_TREE_ITER); @@ -892,7 +892,7 @@ gedit_file_browser_view_class_init (GeditFileBrowserViewClass * klass) g_signal_new ("directory-activated", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GeditFileBrowserViewClass, + G_STRUCT_OFFSET (PlumaFileBrowserViewClass, directory_activated), NULL, NULL, g_cclosure_marshal_VOID__BOXED, G_TYPE_NONE, 1, GTK_TYPE_TREE_ITER); @@ -900,19 +900,19 @@ gedit_file_browser_view_class_init (GeditFileBrowserViewClass * klass) g_signal_new ("bookmark-activated", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GeditFileBrowserViewClass, + G_STRUCT_OFFSET (PlumaFileBrowserViewClass, bookmark_activated), NULL, NULL, g_cclosure_marshal_VOID__BOXED, G_TYPE_NONE, 1, GTK_TYPE_TREE_ITER); g_type_class_add_private (object_class, - sizeof (GeditFileBrowserViewPrivate)); + sizeof (PlumaFileBrowserViewPrivate)); } static void cell_data_cb (GtkTreeViewColumn * tree_column, GtkCellRenderer * cell, GtkTreeModel * tree_model, GtkTreeIter * iter, - GeditFileBrowserView * obj) + PlumaFileBrowserView * obj) { GtkTreePath *path; PangoUnderline underline = PANGO_UNDERLINE_NONE; @@ -920,13 +920,13 @@ cell_data_cb (GtkTreeViewColumn * tree_column, GtkCellRenderer * cell, path = gtk_tree_model_get_path (tree_model, iter); - if (obj->priv->click_policy == GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) { + if (obj->priv->click_policy == PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) { if (obj->priv->hover_path != NULL && gtk_tree_path_compare (path, obj->priv->hover_path) == 0) underline = PANGO_UNDERLINE_SINGLE; } - if (GEDIT_IS_FILE_BROWSER_STORE (tree_model)) + if (PLUMA_IS_FILE_BROWSER_STORE (tree_model)) { if (obj->priv->editable != NULL && gtk_tree_row_reference_valid (obj->priv->editable)) @@ -942,9 +942,9 @@ cell_data_cb (GtkTreeViewColumn * tree_column, GtkCellRenderer * cell, } static void -gedit_file_browser_view_init (GeditFileBrowserView * obj) +pluma_file_browser_view_init (PlumaFileBrowserView * obj) { - obj->priv = GEDIT_FILE_BROWSER_VIEW_GET_PRIVATE (obj); + obj->priv = PLUMA_FILE_BROWSER_VIEW_GET_PRIVATE (obj); obj->priv->column = gtk_tree_view_column_new (); @@ -955,7 +955,7 @@ gedit_file_browser_view_init (GeditFileBrowserView * obj) gtk_tree_view_column_add_attribute (obj->priv->column, obj->priv->pixbuf_renderer, "pixbuf", - GEDIT_FILE_BROWSER_STORE_COLUMN_ICON); + PLUMA_FILE_BROWSER_STORE_COLUMN_ICON); obj->priv->text_renderer = gtk_cell_renderer_text_new (); gtk_tree_view_column_pack_start (obj->priv->column, @@ -963,7 +963,7 @@ gedit_file_browser_view_init (GeditFileBrowserView * obj) gtk_tree_view_column_add_attribute (obj->priv->column, obj->priv->text_renderer, "text", - GEDIT_FILE_BROWSER_STORE_COLUMN_NAME); + PLUMA_FILE_BROWSER_STORE_COLUMN_NAME); g_signal_connect (obj->priv->text_renderer, "edited", G_CALLBACK (on_cell_edited), obj); @@ -988,25 +988,25 @@ bookmarks_separator_func (GtkTreeModel * model, GtkTreeIter * iter, guint flags; gtk_tree_model_get (model, iter, - GEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, + PLUMA_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &flags, -1); - return (flags & GEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR); + return (flags & PLUMA_FILE_BOOKMARKS_STORE_IS_SEPARATOR); } /* Public */ GtkWidget * -gedit_file_browser_view_new (void) +pluma_file_browser_view_new (void) { - GeditFileBrowserView *obj = - GEDIT_FILE_BROWSER_VIEW (g_object_new - (GEDIT_TYPE_FILE_BROWSER_VIEW, NULL)); + PlumaFileBrowserView *obj = + PLUMA_FILE_BROWSER_VIEW (g_object_new + (PLUMA_TYPE_FILE_BROWSER_VIEW, NULL)); return GTK_WIDGET (obj); } void -gedit_file_browser_view_set_model (GeditFileBrowserView * tree_view, +pluma_file_browser_view_set_model (PlumaFileBrowserView * tree_view, GtkTreeModel * model) { GtkTreeSelection *selection; @@ -1016,7 +1016,7 @@ gedit_file_browser_view_set_model (GeditFileBrowserView * tree_view, selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view)); - if (GEDIT_IS_FILE_BOOKMARKS_STORE (model)) { + if (PLUMA_IS_FILE_BOOKMARKS_STORE (model)) { gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE); gtk_tree_view_set_row_separator_func (GTK_TREE_VIEW (tree_view), @@ -1052,7 +1052,7 @@ gedit_file_browser_view_set_model (GeditFileBrowserView * tree_view, tree_view->priv->hover_path = NULL; } - if (GEDIT_IS_FILE_BROWSER_STORE (tree_view->priv->model)) { + if (PLUMA_IS_FILE_BROWSER_STORE (tree_view->priv->model)) { if (tree_view->priv->restore_expand_state) uninstall_restore_signals (tree_view, tree_view->priv->model); @@ -1063,20 +1063,20 @@ gedit_file_browser_view_set_model (GeditFileBrowserView * tree_view, } void -gedit_file_browser_view_start_rename (GeditFileBrowserView * tree_view, +pluma_file_browser_view_start_rename (PlumaFileBrowserView * tree_view, GtkTreeIter * iter) { guint flags; GtkTreeRowReference *rowref; GtkTreePath *path; - g_return_if_fail (GEDIT_IS_FILE_BROWSER_VIEW (tree_view)); - g_return_if_fail (GEDIT_IS_FILE_BROWSER_STORE + g_return_if_fail (PLUMA_IS_FILE_BROWSER_VIEW (tree_view)); + g_return_if_fail (PLUMA_IS_FILE_BROWSER_STORE (tree_view->priv->model)); g_return_if_fail (iter != NULL); gtk_tree_model_get (tree_view->priv->model, iter, - GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, + PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, -1); if (!(FILE_IS_DIR (flags) || !FILE_IS_DUMMY (flags))) @@ -1106,10 +1106,10 @@ gedit_file_browser_view_start_rename (GeditFileBrowserView * tree_view, } void -gedit_file_browser_view_set_click_policy (GeditFileBrowserView *tree_view, - GeditFileBrowserViewClickPolicy policy) +pluma_file_browser_view_set_click_policy (PlumaFileBrowserView *tree_view, + PlumaFileBrowserViewClickPolicy policy) { - g_return_if_fail (GEDIT_IS_FILE_BROWSER_VIEW (tree_view)); + g_return_if_fail (PLUMA_IS_FILE_BROWSER_VIEW (tree_view)); set_click_policy_property (tree_view, policy); @@ -1117,10 +1117,10 @@ gedit_file_browser_view_set_click_policy (GeditFileBrowserView *tree_view, } void -gedit_file_browser_view_set_restore_expand_state (GeditFileBrowserView * tree_view, +pluma_file_browser_view_set_restore_expand_state (PlumaFileBrowserView * tree_view, gboolean restore_expand_state) { - g_return_if_fail (GEDIT_IS_FILE_BROWSER_VIEW (tree_view)); + g_return_if_fail (PLUMA_IS_FILE_BROWSER_VIEW (tree_view)); set_restore_expand_state (tree_view, restore_expand_state); g_object_notify (G_OBJECT (tree_view), "restore-expand-state"); @@ -1129,7 +1129,7 @@ gedit_file_browser_view_set_restore_expand_state (GeditFileBrowserView * tree_vi /* Signal handlers */ static void on_cell_edited (GtkCellRendererText * cell, gchar * path, gchar * new_text, - GeditFileBrowserView * tree_view) + PlumaFileBrowserView * tree_view) { GtkTreePath * treepath; GtkTreeIter iter; @@ -1147,7 +1147,7 @@ on_cell_edited (GtkCellRendererText * cell, gchar * path, gchar * new_text, gtk_tree_path_free (treepath); if (ret) { - if (gedit_file_browser_store_rename (GEDIT_FILE_BROWSER_STORE (tree_view->priv->model), + if (pluma_file_browser_store_rename (PLUMA_FILE_BROWSER_STORE (tree_view->priv->model), &iter, new_text, &error)) { treepath = gtk_tree_model_get_path (GTK_TREE_MODEL (tree_view->priv->model), &iter); gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (tree_view), @@ -1166,8 +1166,8 @@ on_cell_edited (GtkCellRendererText * cell, gchar * path, gchar * new_text, } static void -on_begin_refresh (GeditFileBrowserStore * model, - GeditFileBrowserView * view) +on_begin_refresh (PlumaFileBrowserStore * model, + PlumaFileBrowserView * view) { /* Store the refresh state, so we can handle unloading of nodes while refreshing properly */ @@ -1175,8 +1175,8 @@ on_begin_refresh (GeditFileBrowserStore * model, } static void -on_end_refresh (GeditFileBrowserStore * model, - GeditFileBrowserView * view) +on_end_refresh (PlumaFileBrowserStore * model, + PlumaFileBrowserView * view) { /* Store the refresh state, so we can handle unloading of nodes while refreshing properly */ @@ -1184,9 +1184,9 @@ on_end_refresh (GeditFileBrowserStore * model, } static void -on_unload (GeditFileBrowserStore * model, +on_unload (PlumaFileBrowserStore * model, gchar const * uri, - GeditFileBrowserView * view) + PlumaFileBrowserView * view) { /* Don't remove the expand state if we are refreshing */ if (!view->priv->restore_expand_state || view->priv->is_refresh) @@ -1196,8 +1196,8 @@ on_unload (GeditFileBrowserStore * model, } static void -restore_expand_state (GeditFileBrowserView * view, - GeditFileBrowserStore * model, +restore_expand_state (PlumaFileBrowserView * view, + PlumaFileBrowserStore * model, GtkTreeIter * iter) { gchar * uri; @@ -1206,7 +1206,7 @@ restore_expand_state (GeditFileBrowserView * view, gtk_tree_model_get (GTK_TREE_MODEL (model), iter, - GEDIT_FILE_BROWSER_STORE_COLUMN_URI, + PLUMA_FILE_BROWSER_STORE_COLUMN_URI, &uri, -1); @@ -1230,10 +1230,10 @@ restore_expand_state (GeditFileBrowserView * view, } static void -on_row_inserted (GeditFileBrowserStore * model, +on_row_inserted (PlumaFileBrowserStore * model, GtkTreePath * path, GtkTreeIter * iter, - GeditFileBrowserView * view) + PlumaFileBrowserView * view) { GtkTreeIter parent; GtkTreePath * copy; diff --git a/plugins/filebrowser/pluma-file-browser-view.h b/plugins/filebrowser/pluma-file-browser-view.h new file mode 100755 index 00000000..04e64953 --- /dev/null +++ b/plugins/filebrowser/pluma-file-browser-view.h @@ -0,0 +1,84 @@ +/* + * pluma-file-browser-view.h - Pluma plugin providing easy file access + * from the sidepanel + * + * Copyright (C) 2006 - Jesse van den Kieboom <[email protected]> + * + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __PLUMA_FILE_BROWSER_VIEW_H__ +#define __PLUMA_FILE_BROWSER_VIEW_H__ + +#include <gtk/gtk.h> + +G_BEGIN_DECLS +#define PLUMA_TYPE_FILE_BROWSER_VIEW (pluma_file_browser_view_get_type ()) +#define PLUMA_FILE_BROWSER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PLUMA_TYPE_FILE_BROWSER_VIEW, PlumaFileBrowserView)) +#define PLUMA_FILE_BROWSER_VIEW_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PLUMA_TYPE_FILE_BROWSER_VIEW, PlumaFileBrowserView const)) +#define PLUMA_FILE_BROWSER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PLUMA_TYPE_FILE_BROWSER_VIEW, PlumaFileBrowserViewClass)) +#define PLUMA_IS_FILE_BROWSER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PLUMA_TYPE_FILE_BROWSER_VIEW)) +#define PLUMA_IS_FILE_BROWSER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PLUMA_TYPE_FILE_BROWSER_VIEW)) +#define PLUMA_FILE_BROWSER_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PLUMA_TYPE_FILE_BROWSER_VIEW, PlumaFileBrowserViewClass)) + +typedef struct _PlumaFileBrowserView PlumaFileBrowserView; +typedef struct _PlumaFileBrowserViewClass PlumaFileBrowserViewClass; +typedef struct _PlumaFileBrowserViewPrivate PlumaFileBrowserViewPrivate; + +typedef enum { + PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE, + PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE +} PlumaFileBrowserViewClickPolicy; + +struct _PlumaFileBrowserView +{ + GtkTreeView parent; + + PlumaFileBrowserViewPrivate *priv; +}; + +struct _PlumaFileBrowserViewClass +{ + GtkTreeViewClass parent_class; + + /* Signals */ + void (*error) (PlumaFileBrowserView * filetree, + guint code, + gchar const *message); + void (*file_activated) (PlumaFileBrowserView * filetree, + GtkTreeIter *iter); + void (*directory_activated) (PlumaFileBrowserView * filetree, + GtkTreeIter *iter); + void (*bookmark_activated) (PlumaFileBrowserView * filetree, + GtkTreeIter *iter); +}; + +GType pluma_file_browser_view_get_type (void) G_GNUC_CONST; +GType pluma_file_browser_view_register_type (GTypeModule * module); + +GtkWidget *pluma_file_browser_view_new (void); +void pluma_file_browser_view_set_model (PlumaFileBrowserView * tree_view, + GtkTreeModel * model); +void pluma_file_browser_view_start_rename (PlumaFileBrowserView * tree_view, + GtkTreeIter * iter); +void pluma_file_browser_view_set_click_policy (PlumaFileBrowserView * tree_view, + PlumaFileBrowserViewClickPolicy policy); +void pluma_file_browser_view_set_restore_expand_state (PlumaFileBrowserView * tree_view, + gboolean restore_expand_state); + +G_END_DECLS +#endif /* __PLUMA_FILE_BROWSER_VIEW_H__ */ + +// ex:ts=8:noet: diff --git a/plugins/filebrowser/gedit-file-browser-widget-ui.xml b/plugins/filebrowser/pluma-file-browser-widget-ui.xml index 472fd185..472fd185 100755 --- a/plugins/filebrowser/gedit-file-browser-widget-ui.xml +++ b/plugins/filebrowser/pluma-file-browser-widget-ui.xml diff --git a/plugins/filebrowser/gedit-file-browser-widget.c b/plugins/filebrowser/pluma-file-browser-widget.c index e8a73cce..969c2ae4 100755 --- a/plugins/filebrowser/gedit-file-browser-widget.c +++ b/plugins/filebrowser/pluma-file-browser-widget.c @@ -1,5 +1,5 @@ /* - * gedit-file-browser-widget.c - Gedit plugin providing easy file access + * pluma-file-browser-widget.c - Pluma plugin providing easy file access * from the sidepanel * * Copyright (C) 2006 - Jesse van den Kieboom <[email protected]> @@ -29,24 +29,24 @@ #include <glib.h> #include <glib/gi18n-lib.h> #include <gdk/gdkkeysyms.h> -#include <gedit/gedit-utils.h> -#include <gedit/gedit-plugin.h> +#include <pluma/pluma-utils.h> +#include <pluma/pluma-plugin.h> -#include "gedit-file-browser-utils.h" -#include "gedit-file-browser-error.h" -#include "gedit-file-browser-widget.h" -#include "gedit-file-browser-view.h" -#include "gedit-file-browser-store.h" -#include "gedit-file-bookmarks-store.h" -#include "gedit-file-browser-marshal.h" -#include "gedit-file-browser-enum-types.h" +#include "pluma-file-browser-utils.h" +#include "pluma-file-browser-error.h" +#include "pluma-file-browser-widget.h" +#include "pluma-file-browser-view.h" +#include "pluma-file-browser-store.h" +#include "pluma-file-bookmarks-store.h" +#include "pluma-file-browser-marshal.h" +#include "pluma-file-browser-enum-types.h" -#define GEDIT_FILE_BROWSER_WIDGET_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), \ - GEDIT_TYPE_FILE_BROWSER_WIDGET, \ - GeditFileBrowserWidgetPrivate)) +#define PLUMA_FILE_BROWSER_WIDGET_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), \ + PLUMA_TYPE_FILE_BROWSER_WIDGET, \ + PlumaFileBrowserWidgetPrivate)) -#define XML_UI_FILE "gedit-file-browser-widget-ui.xml" -#define LOCATION_DATA_KEY "gedit-file-browser-widget-location" +#define XML_UI_FILE "pluma-file-browser-widget-ui.xml" +#define LOCATION_DATA_KEY "pluma-file-browser-widget-location" enum { @@ -97,7 +97,7 @@ typedef struct _SignalNode typedef struct { gulong id; - GeditFileBrowserWidgetFilterFunc func; + PlumaFileBrowserWidgetFilterFunc func; gpointer user_data; GDestroyNotify destroy_notify; } FilterFunc; @@ -114,11 +114,11 @@ typedef struct GdkPixbuf *icon; } NameIcon; -struct _GeditFileBrowserWidgetPrivate +struct _PlumaFileBrowserWidgetPrivate { - GeditFileBrowserView *treeview; - GeditFileBrowserStore *file_store; - GeditFileBookmarksStore *bookmarks_store; + PlumaFileBrowserView *treeview; + PlumaFileBrowserStore *file_store; + PlumaFileBookmarksStore *bookmarks_store; GHashTable *bookmarks_hash; @@ -159,82 +159,82 @@ struct _GeditFileBrowserWidgetPrivate GdkCursor *busy_cursor; }; -static void set_enable_delete (GeditFileBrowserWidget *obj, +static void set_enable_delete (PlumaFileBrowserWidget *obj, gboolean enable); static void on_model_set (GObject * gobject, GParamSpec * arg1, - GeditFileBrowserWidget * obj); -static void on_treeview_error (GeditFileBrowserView * tree_view, + PlumaFileBrowserWidget * obj); +static void on_treeview_error (PlumaFileBrowserView * tree_view, guint code, gchar * message, - GeditFileBrowserWidget * obj); -static void on_file_store_error (GeditFileBrowserStore * store, + PlumaFileBrowserWidget * obj); +static void on_file_store_error (PlumaFileBrowserStore * store, guint code, gchar * message, - GeditFileBrowserWidget * obj); -static gboolean on_file_store_no_trash (GeditFileBrowserStore * store, + PlumaFileBrowserWidget * obj); +static gboolean on_file_store_no_trash (PlumaFileBrowserStore * store, GList * files, - GeditFileBrowserWidget * obj); + PlumaFileBrowserWidget * obj); static void on_combo_changed (GtkComboBox * combo, - GeditFileBrowserWidget * obj); -static gboolean on_treeview_popup_menu (GeditFileBrowserView * treeview, - GeditFileBrowserWidget * obj); -static gboolean on_treeview_button_press_event (GeditFileBrowserView * treeview, + PlumaFileBrowserWidget * obj); +static gboolean on_treeview_popup_menu (PlumaFileBrowserView * treeview, + PlumaFileBrowserWidget * obj); +static gboolean on_treeview_button_press_event (PlumaFileBrowserView * treeview, GdkEventButton * event, - GeditFileBrowserWidget * obj); -static gboolean on_treeview_key_press_event (GeditFileBrowserView * treeview, + PlumaFileBrowserWidget * obj); +static gboolean on_treeview_key_press_event (PlumaFileBrowserView * treeview, GdkEventKey * event, - GeditFileBrowserWidget * obj); + PlumaFileBrowserWidget * obj); static void on_selection_changed (GtkTreeSelection * selection, - GeditFileBrowserWidget * obj); + PlumaFileBrowserWidget * obj); -static void on_virtual_root_changed (GeditFileBrowserStore * model, +static void on_virtual_root_changed (PlumaFileBrowserStore * model, GParamSpec *param, - GeditFileBrowserWidget * obj); + PlumaFileBrowserWidget * obj); -static gboolean on_entry_filter_activate (GeditFileBrowserWidget * obj); +static gboolean on_entry_filter_activate (PlumaFileBrowserWidget * obj); static void on_location_jump_activate (GtkMenuItem * item, - GeditFileBrowserWidget * obj); + PlumaFileBrowserWidget * obj); static void on_bookmarks_row_changed (GtkTreeModel * model, GtkTreePath * path, GtkTreeIter * iter, - GeditFileBrowserWidget * obj); + PlumaFileBrowserWidget * obj); static void on_bookmarks_row_deleted (GtkTreeModel * model, GtkTreePath * path, - GeditFileBrowserWidget * obj); -static void on_filter_mode_changed (GeditFileBrowserStore * model, + PlumaFileBrowserWidget * obj); +static void on_filter_mode_changed (PlumaFileBrowserStore * model, GParamSpec * param, - GeditFileBrowserWidget * obj); + PlumaFileBrowserWidget * obj); static void on_action_directory_previous (GtkAction * action, - GeditFileBrowserWidget * obj); + PlumaFileBrowserWidget * obj); static void on_action_directory_next (GtkAction * action, - GeditFileBrowserWidget * obj); + PlumaFileBrowserWidget * obj); static void on_action_directory_up (GtkAction * action, - GeditFileBrowserWidget * obj); + PlumaFileBrowserWidget * obj); static void on_action_directory_new (GtkAction * action, - GeditFileBrowserWidget * obj); + PlumaFileBrowserWidget * obj); static void on_action_file_open (GtkAction * action, - GeditFileBrowserWidget * obj); + PlumaFileBrowserWidget * obj); static void on_action_file_new (GtkAction * action, - GeditFileBrowserWidget * obj); + PlumaFileBrowserWidget * obj); static void on_action_file_rename (GtkAction * action, - GeditFileBrowserWidget * obj); + PlumaFileBrowserWidget * obj); static void on_action_file_delete (GtkAction * action, - GeditFileBrowserWidget * obj); + PlumaFileBrowserWidget * obj); static void on_action_file_move_to_trash (GtkAction * action, - GeditFileBrowserWidget * obj); + PlumaFileBrowserWidget * obj); static void on_action_directory_refresh (GtkAction * action, - GeditFileBrowserWidget * obj); + PlumaFileBrowserWidget * obj); static void on_action_directory_open (GtkAction * action, - GeditFileBrowserWidget * obj); + PlumaFileBrowserWidget * obj); static void on_action_filter_hidden (GtkAction * action, - GeditFileBrowserWidget * obj); + PlumaFileBrowserWidget * obj); static void on_action_filter_binary (GtkAction * action, - GeditFileBrowserWidget * obj); + PlumaFileBrowserWidget * obj); static void on_action_bookmark_open (GtkAction * action, - GeditFileBrowserWidget * obj); + PlumaFileBrowserWidget * obj); -GEDIT_PLUGIN_DEFINE_TYPE (GeditFileBrowserWidget, gedit_file_browser_widget, +PLUMA_PLUGIN_DEFINE_TYPE (PlumaFileBrowserWidget, pluma_file_browser_widget, GTK_TYPE_VBOX) static void @@ -256,8 +256,8 @@ free_name_icon (gpointer data) } static FilterFunc * -filter_func_new (GeditFileBrowserWidget * obj, - GeditFileBrowserWidgetFilterFunc func, +filter_func_new (PlumaFileBrowserWidget * obj, + PlumaFileBrowserWidgetFilterFunc func, gpointer user_data, GDestroyNotify notify) { @@ -285,7 +285,7 @@ location_free (Location * loc) } static gboolean -combo_find_by_id (GeditFileBrowserWidget * obj, guint id, +combo_find_by_id (PlumaFileBrowserWidget * obj, guint id, GtkTreeIter * iter) { guint checkid; @@ -308,7 +308,7 @@ combo_find_by_id (GeditFileBrowserWidget * obj, guint id, } static void -remove_path_items (GeditFileBrowserWidget * obj) +remove_path_items (PlumaFileBrowserWidget * obj) { GtkTreeIter iter; @@ -317,7 +317,7 @@ remove_path_items (GeditFileBrowserWidget * obj) } static void -cancel_async_operation (GeditFileBrowserWidget *widget) +cancel_async_operation (PlumaFileBrowserWidget *widget) { if (!widget->priv->cancellable) return; @@ -329,13 +329,13 @@ cancel_async_operation (GeditFileBrowserWidget *widget) } static void -gedit_file_browser_widget_finalize (GObject * object) +pluma_file_browser_widget_finalize (GObject * object) { - GeditFileBrowserWidget *obj = GEDIT_FILE_BROWSER_WIDGET (object); + PlumaFileBrowserWidget *obj = PLUMA_FILE_BROWSER_WIDGET (object); GList *loc; remove_path_items (obj); - gedit_file_browser_store_set_filter_func (obj->priv->file_store, + pluma_file_browser_store_set_filter_func (obj->priv->file_store, NULL, NULL); g_object_unref (obj->priv->manager); @@ -360,16 +360,16 @@ gedit_file_browser_widget_finalize (GObject * object) gdk_cursor_unref (obj->priv->busy_cursor); - G_OBJECT_CLASS (gedit_file_browser_widget_parent_class)->finalize (object); + G_OBJECT_CLASS (pluma_file_browser_widget_parent_class)->finalize (object); } static void -gedit_file_browser_widget_get_property (GObject *object, +pluma_file_browser_widget_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { - GeditFileBrowserWidget *obj = GEDIT_FILE_BROWSER_WIDGET (object); + PlumaFileBrowserWidget *obj = PLUMA_FILE_BROWSER_WIDGET (object); switch (prop_id) { @@ -386,17 +386,17 @@ gedit_file_browser_widget_get_property (GObject *object, } static void -gedit_file_browser_widget_set_property (GObject *object, +pluma_file_browser_widget_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { - GeditFileBrowserWidget *obj = GEDIT_FILE_BROWSER_WIDGET (object); + PlumaFileBrowserWidget *obj = PLUMA_FILE_BROWSER_WIDGET (object); switch (prop_id) { case PROP_FILTER_PATTERN: - gedit_file_browser_widget_set_filter_pattern (obj, + pluma_file_browser_widget_set_filter_pattern (obj, g_value_get_string (value)); break; case PROP_ENABLE_DELETE: @@ -409,14 +409,14 @@ gedit_file_browser_widget_set_property (GObject *object, } static void -gedit_file_browser_widget_class_init (GeditFileBrowserWidgetClass * klass) +pluma_file_browser_widget_class_init (PlumaFileBrowserWidgetClass * klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - object_class->finalize = gedit_file_browser_widget_finalize; + object_class->finalize = pluma_file_browser_widget_finalize; - object_class->get_property = gedit_file_browser_widget_get_property; - object_class->set_property = gedit_file_browser_widget_set_property; + object_class->get_property = pluma_file_browser_widget_get_property; + object_class->set_property = pluma_file_browser_widget_set_property; g_object_class_install_property (object_class, PROP_FILTER_PATTERN, g_param_spec_string ("filter-pattern", @@ -436,26 +436,26 @@ gedit_file_browser_widget_class_init (GeditFileBrowserWidgetClass * klass) g_signal_new ("uri-activated", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GeditFileBrowserWidgetClass, + G_STRUCT_OFFSET (PlumaFileBrowserWidgetClass, uri_activated), NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); signals[ERROR] = g_signal_new ("error", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GeditFileBrowserWidgetClass, + G_STRUCT_OFFSET (PlumaFileBrowserWidgetClass, error), NULL, NULL, - gedit_file_browser_marshal_VOID__UINT_STRING, + pluma_file_browser_marshal_VOID__UINT_STRING, G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_STRING); signals[CONFIRM_DELETE] = g_signal_new ("confirm-delete", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GeditFileBrowserWidgetClass, + G_STRUCT_OFFSET (PlumaFileBrowserWidgetClass, confirm_delete), g_signal_accumulator_true_handled, NULL, - gedit_file_browser_marshal_BOOL__OBJECT_POINTER, + pluma_file_browser_marshal_BOOL__OBJECT_POINTER, G_TYPE_BOOLEAN, 2, G_TYPE_OBJECT, @@ -464,21 +464,21 @@ gedit_file_browser_widget_class_init (GeditFileBrowserWidgetClass * klass) signals[CONFIRM_NO_TRASH] = g_signal_new ("confirm-no-trash", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GeditFileBrowserWidgetClass, + G_STRUCT_OFFSET (PlumaFileBrowserWidgetClass, confirm_no_trash), g_signal_accumulator_true_handled, NULL, - gedit_file_browser_marshal_BOOL__POINTER, + pluma_file_browser_marshal_BOOL__POINTER, G_TYPE_BOOLEAN, 1, G_TYPE_POINTER); g_type_class_add_private (object_class, - sizeof (GeditFileBrowserWidgetPrivate)); + sizeof (PlumaFileBrowserWidgetPrivate)); } static void -add_signal (GeditFileBrowserWidget * obj, gpointer object, gulong id) +add_signal (PlumaFileBrowserWidget * obj, gpointer object, gulong id) { SignalNode *node = g_new (SignalNode, 1); @@ -490,7 +490,7 @@ add_signal (GeditFileBrowserWidget * obj, gpointer object, gulong id) } static void -clear_signals (GeditFileBrowserWidget * obj) +clear_signals (PlumaFileBrowserWidget * obj) { GSList *item; SignalNode *node; @@ -517,7 +517,7 @@ separator_func (GtkTreeModel * model, GtkTreeIter * iter, gpointer data) } static gboolean -get_from_bookmark_file (GeditFileBrowserWidget * obj, GFile * file, +get_from_bookmark_file (PlumaFileBrowserWidget * obj, GFile * file, gchar ** name, GdkPixbuf ** icon) { gpointer data; @@ -542,7 +542,7 @@ get_from_bookmark_file (GeditFileBrowserWidget * obj, GFile * file, } static void -insert_path_item (GeditFileBrowserWidget * obj, +insert_path_item (PlumaFileBrowserWidget * obj, GFile * file, GtkTreeIter * after, GtkTreeIter * iter, @@ -554,10 +554,10 @@ insert_path_item (GeditFileBrowserWidget * obj, /* Try to get the icon and name from the bookmarks hash */ if (!get_from_bookmark_file (obj, file, &unescape, &icon)) { /* It's not a bookmark, fetch the name and the icon ourselves */ - unescape = gedit_file_browser_utils_file_basename (file); + unescape = pluma_file_browser_utils_file_basename (file); /* Get the icon */ - icon = gedit_file_browser_utils_pixbuf_from_file (file, GTK_ICON_SIZE_MENU); + icon = pluma_file_browser_utils_pixbuf_from_file (file, GTK_ICON_SIZE_MENU); } gtk_tree_store_insert_after (obj->priv->combo_model, iter, NULL, @@ -579,7 +579,7 @@ insert_path_item (GeditFileBrowserWidget * obj, } static void -insert_separator_item (GeditFileBrowserWidget * obj) +insert_separator_item (PlumaFileBrowserWidget * obj) { GtkTreeIter iter; @@ -591,7 +591,7 @@ insert_separator_item (GeditFileBrowserWidget * obj) } static void -combo_set_active_by_id (GeditFileBrowserWidget * obj, guint id) +combo_set_active_by_id (PlumaFileBrowserWidget * obj, guint id) { GtkTreeIter iter; @@ -624,7 +624,7 @@ uri_num_parents (GFile * from, GFile * to) } static void -insert_location_path (GeditFileBrowserWidget * obj) +insert_location_path (PlumaFileBrowserWidget * obj) { Location *loc; GFile *current = NULL; @@ -661,7 +661,7 @@ insert_location_path (GeditFileBrowserWidget * obj) obj); } - if (g_file_equal (current, loc->root) || !gedit_utils_file_has_parent (current)) { + if (g_file_equal (current, loc->root) || !pluma_utils_file_has_parent (current)) { if (current != loc->virtual_root) g_object_unref (current); break; @@ -677,7 +677,7 @@ insert_location_path (GeditFileBrowserWidget * obj) } static void -check_current_item (GeditFileBrowserWidget * obj, gboolean show_path) +check_current_item (PlumaFileBrowserWidget * obj, gboolean show_path) { GtkTreeIter separator; gboolean has_sep; @@ -695,13 +695,13 @@ check_current_item (GeditFileBrowserWidget * obj, gboolean show_path) } static void -fill_combo_model (GeditFileBrowserWidget * obj) +fill_combo_model (PlumaFileBrowserWidget * obj) { GtkTreeStore *store = obj->priv->combo_model; GtkTreeIter iter; GdkPixbuf *icon; - icon = gedit_file_browser_utils_pixbuf_from_theme (GTK_STOCK_HOME, GTK_ICON_SIZE_MENU); + icon = pluma_file_browser_utils_pixbuf_from_theme (GTK_STOCK_HOME, GTK_ICON_SIZE_MENU); gtk_tree_store_append (store, &iter, NULL); gtk_tree_store_set (store, &iter, @@ -738,7 +738,7 @@ indent_cell_data_func (GtkCellLayout * cell_layout, } static void -create_combo (GeditFileBrowserWidget * obj) +create_combo (PlumaFileBrowserWidget * obj) { GtkCellRenderer *renderer; @@ -862,7 +862,7 @@ static const GtkActionEntry bookmark_actions[] = }; static void -create_toolbar (GeditFileBrowserWidget * obj, +create_toolbar (PlumaFileBrowserWidget * obj, const gchar *data_dir) { GtkUIManager *manager; @@ -1024,7 +1024,7 @@ create_toolbar (GeditFileBrowserWidget * obj, } static void -set_enable_delete (GeditFileBrowserWidget *obj, +set_enable_delete (PlumaFileBrowserWidget *obj, gboolean enable) { GtkAction *action; @@ -1041,8 +1041,8 @@ set_enable_delete (GeditFileBrowserWidget *obj, } static gboolean -filter_real (GeditFileBrowserStore * model, GtkTreeIter * iter, - GeditFileBrowserWidget * obj) +filter_real (PlumaFileBrowserStore * model, GtkTreeIter * iter, + PlumaFileBrowserWidget * obj) { GSList *item; FilterFunc *func; @@ -1058,7 +1058,7 @@ filter_real (GeditFileBrowserStore * model, GtkTreeIter * iter, } static void -add_bookmark_hash (GeditFileBrowserWidget * obj, +add_bookmark_hash (PlumaFileBrowserWidget * obj, GtkTreeIter * iter) { GtkTreeModel *model; @@ -1070,7 +1070,7 @@ add_bookmark_hash (GeditFileBrowserWidget * obj, model = GTK_TREE_MODEL (obj->priv->bookmarks_store); - uri = gedit_file_bookmarks_store_get_uri (obj->priv-> + uri = pluma_file_bookmarks_store_get_uri (obj->priv-> bookmarks_store, iter); @@ -1081,9 +1081,9 @@ add_bookmark_hash (GeditFileBrowserWidget * obj, g_free (uri); gtk_tree_model_get (model, iter, - GEDIT_FILE_BOOKMARKS_STORE_COLUMN_ICON, + PLUMA_FILE_BOOKMARKS_STORE_COLUMN_ICON, &pixbuf, - GEDIT_FILE_BOOKMARKS_STORE_COLUMN_NAME, + PLUMA_FILE_BOOKMARKS_STORE_COLUMN_NAME, &name, -1); item = g_new (NameIcon, 1); @@ -1096,7 +1096,7 @@ add_bookmark_hash (GeditFileBrowserWidget * obj, } static void -init_bookmarks_hash (GeditFileBrowserWidget * obj) +init_bookmarks_hash (PlumaFileBrowserWidget * obj) { GtkTreeIter iter; GtkTreeModel *model; @@ -1122,9 +1122,9 @@ init_bookmarks_hash (GeditFileBrowserWidget * obj) } static void -on_begin_loading (GeditFileBrowserStore *model, +on_begin_loading (PlumaFileBrowserStore *model, GtkTreeIter *iter, - GeditFileBrowserWidget *obj) + PlumaFileBrowserWidget *obj) { if (!GDK_IS_WINDOW (gtk_widget_get_window (GTK_WIDGET (obj->priv->treeview)))) return; @@ -1134,9 +1134,9 @@ on_begin_loading (GeditFileBrowserStore *model, } static void -on_end_loading (GeditFileBrowserStore *model, +on_end_loading (PlumaFileBrowserStore *model, GtkTreeIter *iter, - GeditFileBrowserWidget *obj) + PlumaFileBrowserWidget *obj) { if (!GDK_IS_WINDOW (gtk_widget_get_window (GTK_WIDGET (obj->priv->treeview)))) return; @@ -1145,23 +1145,23 @@ on_end_loading (GeditFileBrowserStore *model, } static void -create_tree (GeditFileBrowserWidget * obj) +create_tree (PlumaFileBrowserWidget * obj) { GtkWidget *sw; - obj->priv->file_store = gedit_file_browser_store_new (NULL); - obj->priv->bookmarks_store = gedit_file_bookmarks_store_new (); + obj->priv->file_store = pluma_file_browser_store_new (NULL); + obj->priv->bookmarks_store = pluma_file_bookmarks_store_new (); obj->priv->treeview = - GEDIT_FILE_BROWSER_VIEW (gedit_file_browser_view_new ()); + PLUMA_FILE_BROWSER_VIEW (pluma_file_browser_view_new ()); - gedit_file_browser_view_set_restore_expand_state (obj->priv->treeview, TRUE); + pluma_file_browser_view_set_restore_expand_state (obj->priv->treeview, TRUE); - gedit_file_browser_store_set_filter_mode (obj->priv->file_store, - GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN + pluma_file_browser_store_set_filter_mode (obj->priv->file_store, + PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN | - GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY); - gedit_file_browser_store_set_filter_func (obj->priv->file_store, - (GeditFileBrowserStoreFilterFunc) + PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY); + pluma_file_browser_store_set_filter_func (obj->priv->file_store, + (PlumaFileBrowserStoreFilterFunc) filter_real, obj); sw = gtk_scrolled_window_new (NULL, NULL); @@ -1212,7 +1212,7 @@ create_tree (GeditFileBrowserWidget * obj) } static void -create_filter (GeditFileBrowserWidget * obj) +create_filter (PlumaFileBrowserWidget * obj) { GtkWidget *expander; GtkWidget *vbox; @@ -1244,9 +1244,9 @@ create_filter (GeditFileBrowserWidget * obj) } static void -gedit_file_browser_widget_init (GeditFileBrowserWidget * obj) +pluma_file_browser_widget_init (PlumaFileBrowserWidget * obj) { - obj->priv = GEDIT_FILE_BROWSER_WIDGET_GET_PRIVATE (obj); + obj->priv = PLUMA_FILE_BROWSER_WIDGET_GET_PRIVATE (obj); obj->priv->bookmarks_hash = g_hash_table_new_full (g_file_hash, (GEqualFunc)g_file_equal, @@ -1261,30 +1261,30 @@ gedit_file_browser_widget_init (GeditFileBrowserWidget * obj) /* Private */ static void -update_sensitivity (GeditFileBrowserWidget * obj) +update_sensitivity (PlumaFileBrowserWidget * obj) { GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview)); GtkAction *action; gint mode; - if (GEDIT_IS_FILE_BROWSER_STORE (model)) { + if (PLUMA_IS_FILE_BROWSER_STORE (model)) { gtk_action_group_set_sensitive (obj->priv->action_group, TRUE); gtk_action_group_set_sensitive (obj->priv->bookmark_action_group, FALSE); mode = - gedit_file_browser_store_get_filter_mode - (GEDIT_FILE_BROWSER_STORE (model)); + pluma_file_browser_store_get_filter_mode + (PLUMA_FILE_BROWSER_STORE (model)); action = gtk_action_group_get_action (obj->priv->action_group, "FilterHidden"); gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), !(mode & - GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN)); - } else if (GEDIT_IS_FILE_BOOKMARKS_STORE (model)) { + PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN)); + } else if (PLUMA_IS_FILE_BOOKMARKS_STORE (model)) { gtk_action_group_set_sensitive (obj->priv->action_group, FALSE); gtk_action_group_set_sensitive (obj->priv->bookmark_action_group, @@ -1303,7 +1303,7 @@ update_sensitivity (GeditFileBrowserWidget * obj) } static gboolean -gedit_file_browser_widget_get_first_selected (GeditFileBrowserWidget *obj, +pluma_file_browser_widget_get_first_selected (PlumaFileBrowserWidget *obj, GtkTreeIter *iter) { GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (obj->priv->treeview)); @@ -1323,13 +1323,13 @@ gedit_file_browser_widget_get_first_selected (GeditFileBrowserWidget *obj, } static gboolean -popup_menu (GeditFileBrowserWidget * obj, GdkEventButton * event, GtkTreeModel * model) +popup_menu (PlumaFileBrowserWidget * obj, GdkEventButton * event, GtkTreeModel * model) { GtkWidget *menu; - if (GEDIT_IS_FILE_BROWSER_STORE (model)) + if (PLUMA_IS_FILE_BROWSER_STORE (model)) menu = gtk_ui_manager_get_widget (obj->priv->manager, "/FilePopup"); - else if (GEDIT_IS_FILE_BOOKMARKS_STORE (model)) + else if (PLUMA_IS_FILE_BOOKMARKS_STORE (model)) menu = gtk_ui_manager_get_widget (obj->priv->manager, "/BookmarkPopup"); else return FALSE; @@ -1357,7 +1357,7 @@ popup_menu (GeditFileBrowserWidget * obj, GdkEventButton * event, GtkTreeModel * event->button, event->time); } else { gtk_menu_popup (GTK_MENU (menu), NULL, NULL, - gedit_utils_menu_position_under_tree_view, + pluma_utils_menu_position_under_tree_view, obj->priv->treeview, 0, gtk_get_current_event_time ()); gtk_menu_shell_select_first (GTK_MENU_SHELL (menu), FALSE); @@ -1367,7 +1367,7 @@ popup_menu (GeditFileBrowserWidget * obj, GdkEventButton * event, GtkTreeModel * } static gboolean -filter_glob (GeditFileBrowserWidget * obj, GeditFileBrowserStore * store, +filter_glob (PlumaFileBrowserWidget * obj, PlumaFileBrowserStore * store, GtkTreeIter * iter, gpointer user_data) { gchar *name; @@ -1378,8 +1378,8 @@ filter_glob (GeditFileBrowserWidget * obj, GeditFileBrowserStore * store, return TRUE; gtk_tree_model_get (GTK_TREE_MODEL (store), iter, - GEDIT_FILE_BROWSER_STORE_COLUMN_NAME, &name, - GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, + PLUMA_FILE_BROWSER_STORE_COLUMN_NAME, &name, + PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, -1); if (FILE_IS_DIR (flags) || FILE_IS_DUMMY (flags)) @@ -1395,23 +1395,23 @@ filter_glob (GeditFileBrowserWidget * obj, GeditFileBrowserStore * store, } static void -rename_selected_file (GeditFileBrowserWidget * obj) +rename_selected_file (PlumaFileBrowserWidget * obj) { GtkTreeModel *model; GtkTreeIter iter; model = gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview)); - if (!GEDIT_IS_FILE_BROWSER_STORE (model)) + if (!PLUMA_IS_FILE_BROWSER_STORE (model)) return; - if (gedit_file_browser_widget_get_first_selected (obj, &iter)) - gedit_file_browser_view_start_rename (obj->priv->treeview, + if (pluma_file_browser_widget_get_first_selected (obj, &iter)) + pluma_file_browser_view_start_rename (obj->priv->treeview, &iter); } static GList * -get_deletable_files (GeditFileBrowserWidget *obj) { +get_deletable_files (PlumaFileBrowserWidget *obj) { GtkTreeSelection *selection; GtkTreeModel *model; GList *rows; @@ -1434,7 +1434,7 @@ get_deletable_files (GeditFileBrowserWidget *obj) { continue; gtk_tree_model_get (model, &iter, - GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, + PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, -1); if (FILE_IS_DUMMY (flags)) @@ -1450,16 +1450,16 @@ get_deletable_files (GeditFileBrowserWidget *obj) { } static gboolean -delete_selected_files (GeditFileBrowserWidget * obj, gboolean trash) +delete_selected_files (PlumaFileBrowserWidget * obj, gboolean trash) { GtkTreeModel *model; gboolean confirm; - GeditFileBrowserStoreResult result; + PlumaFileBrowserStoreResult result; GList *rows; model = gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview)); - if (!GEDIT_IS_FILE_BROWSER_STORE (model)) + if (!PLUMA_IS_FILE_BROWSER_STORE (model)) return FALSE; rows = get_deletable_files (obj); @@ -1474,19 +1474,19 @@ delete_selected_files (GeditFileBrowserWidget * obj, gboolean trash) return FALSE; } - result = gedit_file_browser_store_delete_all (GEDIT_FILE_BROWSER_STORE (model), + result = pluma_file_browser_store_delete_all (PLUMA_FILE_BROWSER_STORE (model), rows, trash); g_list_foreach (rows, (GFunc)gtk_tree_path_free, NULL); g_list_free (rows); - return result == GEDIT_FILE_BROWSER_STORE_RESULT_OK; + return result == PLUMA_FILE_BROWSER_STORE_RESULT_OK; } static gboolean -on_file_store_no_trash (GeditFileBrowserStore * store, +on_file_store_no_trash (PlumaFileBrowserStore * store, GList * files, - GeditFileBrowserWidget * obj) + PlumaFileBrowserWidget * obj) { gboolean confirm = FALSE; @@ -1512,7 +1512,7 @@ get_topmost_file (GFile * file) } static GtkWidget * -create_goto_menu_item (GeditFileBrowserWidget * obj, GList * item, +create_goto_menu_item (PlumaFileBrowserWidget * obj, GList * item, GdkPixbuf * icon) { GtkWidget *result; @@ -1524,7 +1524,7 @@ create_goto_menu_item (GeditFileBrowserWidget * obj, GList * item, loc = (Location *) (item->data); if (!get_from_bookmark_file (obj, loc->virtual_root, &unescape, &pixbuf)) { - unescape = gedit_file_browser_utils_file_basename (loc->virtual_root); + unescape = pluma_file_browser_utils_file_basename (loc->virtual_root); if (icon) pixbuf = g_object_ref (icon); @@ -1573,7 +1573,7 @@ list_prev_iterator (GList * list) } static void -jump_to_location (GeditFileBrowserWidget * obj, GList * item, +jump_to_location (PlumaFileBrowserWidget * obj, GList * item, gboolean previous) { Location *loc; @@ -1646,7 +1646,7 @@ jump_to_location (GeditFileBrowserWidget * obj, GList * item, root = g_file_get_uri (loc->root); virtual_root = g_file_get_uri (loc->virtual_root); - gedit_file_browser_widget_set_root_and_virtual_root (obj, + pluma_file_browser_widget_set_root_and_virtual_root (obj, root, virtual_root); @@ -1657,7 +1657,7 @@ jump_to_location (GeditFileBrowserWidget * obj, GList * item, } static void -clear_next_locations (GeditFileBrowserWidget * obj) +clear_next_locations (PlumaFileBrowserWidget * obj) { GList *children; GList *item; @@ -1691,9 +1691,9 @@ clear_next_locations (GeditFileBrowserWidget * obj) } static void -update_filter_mode (GeditFileBrowserWidget * obj, +update_filter_mode (PlumaFileBrowserWidget * obj, GtkAction * action, - GeditFileBrowserStoreFilterMode mode) + PlumaFileBrowserStoreFilterMode mode) { gboolean active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)); @@ -1701,23 +1701,23 @@ update_filter_mode (GeditFileBrowserWidget * obj, gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview)); gint now; - if (GEDIT_IS_FILE_BROWSER_STORE (model)) { + if (PLUMA_IS_FILE_BROWSER_STORE (model)) { now = - gedit_file_browser_store_get_filter_mode - (GEDIT_FILE_BROWSER_STORE (model)); + pluma_file_browser_store_get_filter_mode + (PLUMA_FILE_BROWSER_STORE (model)); if (active) now &= ~mode; else now |= mode; - gedit_file_browser_store_set_filter_mode - (GEDIT_FILE_BROWSER_STORE (model), now); + pluma_file_browser_store_set_filter_mode + (PLUMA_FILE_BROWSER_STORE (model), now); } } static void -set_filter_pattern_real (GeditFileBrowserWidget * obj, +set_filter_pattern_real (PlumaFileBrowserWidget * obj, gchar const * pattern, gboolean update_entry) { @@ -1747,7 +1747,7 @@ set_filter_pattern_real (GeditFileBrowserWidget * obj, if (pattern == NULL) { if (obj->priv->glob_filter_id != 0) { - gedit_file_browser_widget_remove_filter (obj, + pluma_file_browser_widget_remove_filter (obj, obj-> priv-> glob_filter_id); @@ -1758,7 +1758,7 @@ set_filter_pattern_real (GeditFileBrowserWidget * obj, if (obj->priv->glob_filter_id == 0) obj->priv->glob_filter_id = - gedit_file_browser_widget_add_filter (obj, + pluma_file_browser_widget_add_filter (obj, filter_glob, NULL, NULL); @@ -1777,8 +1777,8 @@ set_filter_pattern_real (GeditFileBrowserWidget * obj, } } - if (GEDIT_IS_FILE_BROWSER_STORE (model)) - gedit_file_browser_store_refilter (GEDIT_FILE_BROWSER_STORE + if (PLUMA_IS_FILE_BROWSER_STORE (model)) + pluma_file_browser_store_refilter (PLUMA_FILE_BROWSER_STORE (model)); g_object_notify (G_OBJECT (obj), "filter-pattern"); @@ -1788,23 +1788,23 @@ set_filter_pattern_real (GeditFileBrowserWidget * obj, /* Public */ GtkWidget * -gedit_file_browser_widget_new (const gchar *data_dir) +pluma_file_browser_widget_new (const gchar *data_dir) { - GeditFileBrowserWidget *obj = - g_object_new (GEDIT_TYPE_FILE_BROWSER_WIDGET, NULL); + PlumaFileBrowserWidget *obj = + g_object_new (PLUMA_TYPE_FILE_BROWSER_WIDGET, NULL); create_toolbar (obj, data_dir); create_combo (obj); create_tree (obj); create_filter (obj); - gedit_file_browser_widget_show_bookmarks (obj); + pluma_file_browser_widget_show_bookmarks (obj); return GTK_WIDGET (obj); } void -gedit_file_browser_widget_show_bookmarks (GeditFileBrowserWidget * obj) +pluma_file_browser_widget_show_bookmarks (PlumaFileBrowserWidget * obj) { /* Select bookmarks in the combo box */ g_signal_handlers_block_by_func (obj->priv->combo, @@ -1815,16 +1815,16 @@ gedit_file_browser_widget_show_bookmarks (GeditFileBrowserWidget * obj) check_current_item (obj, FALSE); - gedit_file_browser_view_set_model (obj->priv->treeview, + pluma_file_browser_view_set_model (obj->priv->treeview, GTK_TREE_MODEL (obj->priv-> bookmarks_store)); } static void -show_files_real (GeditFileBrowserWidget *obj, +show_files_real (PlumaFileBrowserWidget *obj, gboolean do_root_changed) { - gedit_file_browser_view_set_model (obj->priv->treeview, + pluma_file_browser_view_set_model (obj->priv->treeview, GTK_TREE_MODEL (obj->priv-> file_store)); @@ -1833,33 +1833,33 @@ show_files_real (GeditFileBrowserWidget *obj, } void -gedit_file_browser_widget_show_files (GeditFileBrowserWidget * obj) +pluma_file_browser_widget_show_files (PlumaFileBrowserWidget * obj) { show_files_real (obj, TRUE); } void -gedit_file_browser_widget_set_root_and_virtual_root (GeditFileBrowserWidget *obj, +pluma_file_browser_widget_set_root_and_virtual_root (PlumaFileBrowserWidget *obj, gchar const *root, gchar const *virtual_root) { - GeditFileBrowserStoreResult result; + PlumaFileBrowserStoreResult result; if (!virtual_root) result = - gedit_file_browser_store_set_root_and_virtual_root + pluma_file_browser_store_set_root_and_virtual_root (obj->priv->file_store, root, root); else result = - gedit_file_browser_store_set_root_and_virtual_root + pluma_file_browser_store_set_root_and_virtual_root (obj->priv->file_store, root, virtual_root); - if (result == GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE) + if (result == PLUMA_FILE_BROWSER_STORE_RESULT_NO_CHANGE) show_files_real (obj, TRUE); } void -gedit_file_browser_widget_set_root (GeditFileBrowserWidget * obj, +pluma_file_browser_widget_set_root (PlumaFileBrowserWidget * obj, gchar const *root, gboolean virtual_root) { @@ -1868,7 +1868,7 @@ gedit_file_browser_widget_set_root (GeditFileBrowserWidget * obj, gchar *str; if (!virtual_root) { - gedit_file_browser_widget_set_root_and_virtual_root (obj, + pluma_file_browser_widget_set_root_and_virtual_root (obj, root, NULL); return; @@ -1881,7 +1881,7 @@ gedit_file_browser_widget_set_root (GeditFileBrowserWidget * obj, parent = get_topmost_file (file); str = g_file_get_uri (parent); - gedit_file_browser_widget_set_root_and_virtual_root + pluma_file_browser_widget_set_root_and_virtual_root (obj, str, root); g_free (str); @@ -1890,39 +1890,39 @@ gedit_file_browser_widget_set_root (GeditFileBrowserWidget * obj, g_object_unref (parent); } -GeditFileBrowserStore * -gedit_file_browser_widget_get_browser_store (GeditFileBrowserWidget * obj) +PlumaFileBrowserStore * +pluma_file_browser_widget_get_browser_store (PlumaFileBrowserWidget * obj) { return obj->priv->file_store; } -GeditFileBookmarksStore * -gedit_file_browser_widget_get_bookmarks_store (GeditFileBrowserWidget * obj) +PlumaFileBookmarksStore * +pluma_file_browser_widget_get_bookmarks_store (PlumaFileBrowserWidget * obj) { return obj->priv->bookmarks_store; } -GeditFileBrowserView * -gedit_file_browser_widget_get_browser_view (GeditFileBrowserWidget * obj) +PlumaFileBrowserView * +pluma_file_browser_widget_get_browser_view (PlumaFileBrowserWidget * obj) { return obj->priv->treeview; } GtkUIManager * -gedit_file_browser_widget_get_ui_manager (GeditFileBrowserWidget * obj) +pluma_file_browser_widget_get_ui_manager (PlumaFileBrowserWidget * obj) { return obj->priv->manager; } GtkWidget * -gedit_file_browser_widget_get_filter_entry (GeditFileBrowserWidget * obj) +pluma_file_browser_widget_get_filter_entry (PlumaFileBrowserWidget * obj) { return obj->priv->filter_entry; } gulong -gedit_file_browser_widget_add_filter (GeditFileBrowserWidget * obj, - GeditFileBrowserWidgetFilterFunc func, +pluma_file_browser_widget_add_filter (PlumaFileBrowserWidget * obj, + PlumaFileBrowserWidgetFilterFunc func, gpointer user_data, GDestroyNotify notify) { @@ -1934,15 +1934,15 @@ gedit_file_browser_widget_add_filter (GeditFileBrowserWidget * obj, obj->priv->filter_funcs = g_slist_append (obj->priv->filter_funcs, f); - if (GEDIT_IS_FILE_BROWSER_STORE (model)) - gedit_file_browser_store_refilter (GEDIT_FILE_BROWSER_STORE + if (PLUMA_IS_FILE_BROWSER_STORE (model)) + pluma_file_browser_store_refilter (PLUMA_FILE_BROWSER_STORE (model)); return f->id; } void -gedit_file_browser_widget_remove_filter (GeditFileBrowserWidget * obj, +pluma_file_browser_widget_remove_filter (PlumaFileBrowserWidget * obj, gulong id) { GSList *item; @@ -1967,14 +1967,14 @@ gedit_file_browser_widget_remove_filter (GeditFileBrowserWidget * obj, } void -gedit_file_browser_widget_set_filter_pattern (GeditFileBrowserWidget * obj, +pluma_file_browser_widget_set_filter_pattern (PlumaFileBrowserWidget * obj, gchar const *pattern) { set_filter_pattern_real (obj, pattern, TRUE); } gboolean -gedit_file_browser_widget_get_selected_directory (GeditFileBrowserWidget * obj, +pluma_file_browser_widget_get_selected_directory (PlumaFileBrowserWidget * obj, GtkTreeIter * iter) { GtkTreeModel *model = @@ -1982,17 +1982,17 @@ gedit_file_browser_widget_get_selected_directory (GeditFileBrowserWidget * obj, GtkTreeIter parent; guint flags; - if (!GEDIT_IS_FILE_BROWSER_STORE (model)) + if (!PLUMA_IS_FILE_BROWSER_STORE (model)) return FALSE; - if (!gedit_file_browser_widget_get_first_selected (obj, iter)) { - if (!gedit_file_browser_store_get_iter_virtual_root - (GEDIT_FILE_BROWSER_STORE (model), iter)) + if (!pluma_file_browser_widget_get_first_selected (obj, iter)) { + if (!pluma_file_browser_store_get_iter_virtual_root + (PLUMA_FILE_BROWSER_STORE (model), iter)) return FALSE; } gtk_tree_model_get (model, iter, - GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, + PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, -1); if (!FILE_IS_DIR (flags)) { @@ -2005,14 +2005,14 @@ gedit_file_browser_widget_get_selected_directory (GeditFileBrowserWidget * obj, } static guint -gedit_file_browser_widget_get_num_selected_files_or_directories (GeditFileBrowserWidget *obj, +pluma_file_browser_widget_get_num_selected_files_or_directories (PlumaFileBrowserWidget *obj, guint *files, guint *dirs) { GList *rows, *row; GtkTreePath *path; GtkTreeIter iter; - GeditFileBrowserStoreFlag flags; + PlumaFileBrowserStoreFlag flags; guint result = 0; GtkTreeSelection *selection; GtkTreeModel *model; @@ -2020,7 +2020,7 @@ gedit_file_browser_widget_get_num_selected_files_or_directories (GeditFileBrowse selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (obj->priv->treeview)); model = gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview)); - if (GEDIT_IS_FILE_BOOKMARKS_STORE (model)) + if (PLUMA_IS_FILE_BOOKMARKS_STORE (model)) return 0; rows = gtk_tree_selection_get_selected_rows (selection, &model); @@ -2033,7 +2033,7 @@ gedit_file_browser_widget_get_num_selected_files_or_directories (GeditFileBrowse continue; gtk_tree_model_get (model, &iter, - GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, + PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, -1); if (!FILE_IS_DUMMY (flags)) { @@ -2054,12 +2054,12 @@ gedit_file_browser_widget_get_num_selected_files_or_directories (GeditFileBrowse typedef struct { - GeditFileBrowserWidget *widget; + PlumaFileBrowserWidget *widget; GCancellable *cancellable; } AsyncData; static AsyncData * -async_data_new (GeditFileBrowserWidget *widget) +async_data_new (PlumaFileBrowserWidget *widget) { AsyncData *ret; @@ -2082,7 +2082,7 @@ async_free (AsyncData *async) } static void -set_busy (GeditFileBrowserWidget *obj, gboolean busy) +set_busy (PlumaFileBrowserWidget *obj, gboolean busy) { GdkCursor *cursor; GdkWindow *window; @@ -2104,10 +2104,10 @@ set_busy (GeditFileBrowserWidget *obj, gboolean busy) } } -static void try_mount_volume (GeditFileBrowserWidget *widget, GVolume *volume); +static void try_mount_volume (PlumaFileBrowserWidget *widget, GVolume *volume); static void -activate_mount (GeditFileBrowserWidget *widget, +activate_mount (PlumaFileBrowserWidget *widget, GVolume *volume, GMount *mount) { @@ -2125,7 +2125,7 @@ activate_mount (GeditFileBrowserWidget *widget, g_signal_emit (widget, signals[ERROR], 0, - GEDIT_FILE_BROWSER_ERROR_SET_ROOT, + PLUMA_FILE_BROWSER_ERROR_SET_ROOT, message); g_free (name); @@ -2136,14 +2136,14 @@ activate_mount (GeditFileBrowserWidget *widget, root = g_mount_get_root (mount); uri = g_file_get_uri (root); - gedit_file_browser_widget_set_root (widget, uri, FALSE); + pluma_file_browser_widget_set_root (widget, uri, FALSE); g_free (uri); g_object_unref (root); } static void -try_activate_drive (GeditFileBrowserWidget *widget, +try_activate_drive (PlumaFileBrowserWidget *widget, GDrive *drive) { GList *volumes; @@ -2205,7 +2205,7 @@ poll_for_media_cb (GDrive *drive, g_signal_emit (async->widget, signals[ERROR], 0, - GEDIT_FILE_BROWSER_ERROR_SET_ROOT, + PLUMA_FILE_BROWSER_ERROR_SET_ROOT, message); g_free (name); @@ -2252,7 +2252,7 @@ mount_volume_cb (GVolume *volume, g_signal_emit (async->widget, signals[ERROR], 0, - GEDIT_FILE_BROWSER_ERROR_SET_ROOT, + PLUMA_FILE_BROWSER_ERROR_SET_ROOT, message); g_free (name); @@ -2266,14 +2266,14 @@ mount_volume_cb (GVolume *volume, } static void -activate_drive (GeditFileBrowserWidget *obj, +activate_drive (PlumaFileBrowserWidget *obj, GtkTreeIter *iter) { GDrive *drive; AsyncData *async; gtk_tree_model_get (GTK_TREE_MODEL (obj->priv->bookmarks_store), iter, - GEDIT_FILE_BOOKMARKS_STORE_COLUMN_OBJECT, + PLUMA_FILE_BOOKMARKS_STORE_COLUMN_OBJECT, &drive, -1); /* most common use case is a floppy drive, we'll poll for media and @@ -2289,7 +2289,7 @@ activate_drive (GeditFileBrowserWidget *obj, } static void -try_mount_volume (GeditFileBrowserWidget *widget, +try_mount_volume (PlumaFileBrowserWidget *widget, GVolume *volume) { GMountOperation *operation; @@ -2310,13 +2310,13 @@ try_mount_volume (GeditFileBrowserWidget *widget, } static void -activate_volume (GeditFileBrowserWidget *obj, +activate_volume (PlumaFileBrowserWidget *obj, GtkTreeIter *iter) { GVolume *volume; gtk_tree_model_get (GTK_TREE_MODEL (obj->priv->bookmarks_store), iter, - GEDIT_FILE_BOOKMARKS_STORE_COLUMN_OBJECT, + PLUMA_FILE_BOOKMARKS_STORE_COLUMN_OBJECT, &volume, -1); /* see if we can mount the volume */ @@ -2325,25 +2325,25 @@ activate_volume (GeditFileBrowserWidget *obj, } void -gedit_file_browser_widget_refresh (GeditFileBrowserWidget *obj) +pluma_file_browser_widget_refresh (PlumaFileBrowserWidget *obj) { GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview)); - if (GEDIT_IS_FILE_BROWSER_STORE (model)) - gedit_file_browser_store_refresh (GEDIT_FILE_BROWSER_STORE + if (PLUMA_IS_FILE_BROWSER_STORE (model)) + pluma_file_browser_store_refresh (PLUMA_FILE_BROWSER_STORE (model)); - else if (GEDIT_IS_FILE_BOOKMARKS_STORE (model)) { + else if (PLUMA_IS_FILE_BOOKMARKS_STORE (model)) { g_hash_table_ref (obj->priv->bookmarks_hash); g_hash_table_destroy (obj->priv->bookmarks_hash); - gedit_file_bookmarks_store_refresh - (GEDIT_FILE_BOOKMARKS_STORE (model)); + pluma_file_bookmarks_store_refresh + (PLUMA_FILE_BOOKMARKS_STORE (model)); } } void -gedit_file_browser_widget_history_back (GeditFileBrowserWidget *obj) +pluma_file_browser_widget_history_back (PlumaFileBrowserWidget *obj) { if (obj->priv->locations) { if (obj->priv->current_location) @@ -2357,7 +2357,7 @@ gedit_file_browser_widget_history_back (GeditFileBrowserWidget *obj) } void -gedit_file_browser_widget_history_forward (GeditFileBrowserWidget *obj) +pluma_file_browser_widget_history_forward (PlumaFileBrowserWidget *obj) { if (obj->priv->locations) jump_to_location (obj, obj->priv->current_location->prev, @@ -2365,7 +2365,7 @@ gedit_file_browser_widget_history_forward (GeditFileBrowserWidget *obj) } static void -bookmark_open (GeditFileBrowserWidget *obj, +bookmark_open (PlumaFileBrowserWidget *obj, GtkTreeModel *model, GtkTreeIter *iter) { @@ -2373,27 +2373,27 @@ bookmark_open (GeditFileBrowserWidget *obj, gint flags; gtk_tree_model_get (model, iter, - GEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, + PLUMA_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &flags, -1); - if (flags & GEDIT_FILE_BOOKMARKS_STORE_IS_DRIVE) + if (flags & PLUMA_FILE_BOOKMARKS_STORE_IS_DRIVE) { /* handle a drive node */ - gedit_file_browser_store_cancel_mount_operation (obj->priv->file_store); + pluma_file_browser_store_cancel_mount_operation (obj->priv->file_store); activate_drive (obj, iter); return; } - else if (flags & GEDIT_FILE_BOOKMARKS_STORE_IS_VOLUME) + else if (flags & PLUMA_FILE_BOOKMARKS_STORE_IS_VOLUME) { /* handle a volume node */ - gedit_file_browser_store_cancel_mount_operation (obj->priv->file_store); + pluma_file_browser_store_cancel_mount_operation (obj->priv->file_store); activate_volume (obj, iter); return; } uri = - gedit_file_bookmarks_store_get_uri - (GEDIT_FILE_BOOKMARKS_STORE (model), iter); + pluma_file_bookmarks_store_get_uri + (PLUMA_FILE_BOOKMARKS_STORE (model), iter); if (uri) { /* here we check if the bookmark is a mount point, or if it @@ -2401,13 +2401,13 @@ bookmark_open (GeditFileBrowserWidget *obj, root to the uri of the bookmark and not try to set the topmost parent as root (since that may as well not be the mount point anymore) */ - if ((flags & GEDIT_FILE_BOOKMARKS_STORE_IS_MOUNT) || - (flags & GEDIT_FILE_BOOKMARKS_STORE_IS_REMOTE_BOOKMARK)) { - gedit_file_browser_widget_set_root (obj, + if ((flags & PLUMA_FILE_BOOKMARKS_STORE_IS_MOUNT) || + (flags & PLUMA_FILE_BOOKMARKS_STORE_IS_REMOTE_BOOKMARK)) { + pluma_file_browser_widget_set_root (obj, uri, FALSE); } else { - gedit_file_browser_widget_set_root (obj, + pluma_file_browser_widget_set_root (obj, uri, TRUE); } @@ -2419,7 +2419,7 @@ bookmark_open (GeditFileBrowserWidget *obj, } static void -file_open (GeditFileBrowserWidget *obj, +file_open (PlumaFileBrowserWidget *obj, GtkTreeModel *model, GtkTreeIter *iter) { @@ -2427,8 +2427,8 @@ file_open (GeditFileBrowserWidget *obj, gint flags; gtk_tree_model_get (model, iter, - GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, - GEDIT_FILE_BROWSER_STORE_COLUMN_URI, &uri, + PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, + PLUMA_FILE_BROWSER_STORE_COLUMN_URI, &uri, -1); if (!FILE_IS_DIR (flags) && !FILE_IS_DUMMY (flags)) { @@ -2439,18 +2439,18 @@ file_open (GeditFileBrowserWidget *obj, } static gboolean -directory_open (GeditFileBrowserWidget *obj, +directory_open (PlumaFileBrowserWidget *obj, GtkTreeModel *model, GtkTreeIter *iter) { gboolean result = FALSE; GError *error = NULL; gchar *uri = NULL; - GeditFileBrowserStoreFlag flags; + PlumaFileBrowserStoreFlag flags; gtk_tree_model_get (model, iter, - GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, - GEDIT_FILE_BROWSER_STORE_COLUMN_URI, &uri, + PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, + PLUMA_FILE_BROWSER_STORE_COLUMN_URI, &uri, -1); if (FILE_IS_DIR (flags)) { @@ -2458,7 +2458,7 @@ directory_open (GeditFileBrowserWidget *obj, if (!gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (obj)), uri, GDK_CURRENT_TIME, &error)) { g_signal_emit (obj, signals[ERROR], 0, - GEDIT_FILE_BROWSER_ERROR_OPEN_DIRECTORY, + PLUMA_FILE_BROWSER_ERROR_OPEN_DIRECTORY, error->message); g_error_free (error); @@ -2472,9 +2472,9 @@ directory_open (GeditFileBrowserWidget *obj, } static void -on_bookmark_activated (GeditFileBrowserView *tree_view, +on_bookmark_activated (PlumaFileBrowserView *tree_view, GtkTreeIter *iter, - GeditFileBrowserWidget *obj) + PlumaFileBrowserWidget *obj) { GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (tree_view)); @@ -2482,9 +2482,9 @@ on_bookmark_activated (GeditFileBrowserView *tree_view, } static void -on_file_activated (GeditFileBrowserView *tree_view, +on_file_activated (PlumaFileBrowserView *tree_view, GtkTreeIter *iter, - GeditFileBrowserWidget *obj) + PlumaFileBrowserWidget *obj) { GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (tree_view)); @@ -2492,25 +2492,25 @@ on_file_activated (GeditFileBrowserView *tree_view, } static gboolean -virtual_root_is_root (GeditFileBrowserWidget * obj, - GeditFileBrowserStore * model) +virtual_root_is_root (PlumaFileBrowserWidget * obj, + PlumaFileBrowserStore * model) { GtkTreeIter root; GtkTreeIter virtual_root; - if (!gedit_file_browser_store_get_iter_root (model, &root)) + if (!pluma_file_browser_store_get_iter_root (model, &root)) return TRUE; - if (!gedit_file_browser_store_get_iter_virtual_root (model, &virtual_root)) + if (!pluma_file_browser_store_get_iter_virtual_root (model, &virtual_root)) return TRUE; - return gedit_file_browser_store_iter_equal (model, &root, &virtual_root); + return pluma_file_browser_store_iter_equal (model, &root, &virtual_root); } static void -on_virtual_root_changed (GeditFileBrowserStore * model, +on_virtual_root_changed (PlumaFileBrowserStore * model, GParamSpec * param, - GeditFileBrowserWidget * obj) + PlumaFileBrowserWidget * obj) { GtkTreeIter iter; gchar *uri; @@ -2526,19 +2526,19 @@ on_virtual_root_changed (GeditFileBrowserStore * model, show_files_real (obj, FALSE); } - if (gedit_file_browser_store_get_iter_virtual_root (model, &iter)) { + if (pluma_file_browser_store_get_iter_virtual_root (model, &iter)) { gtk_tree_model_get (GTK_TREE_MODEL (model), &iter, - GEDIT_FILE_BROWSER_STORE_COLUMN_URI, + PLUMA_FILE_BROWSER_STORE_COLUMN_URI, &uri, -1); - if (gedit_file_browser_store_get_iter_root (model, &root)) { + if (pluma_file_browser_store_get_iter_root (model, &root)) { if (!obj->priv->changing_location) { /* Remove all items from obj->priv->current_location on */ if (obj->priv->current_location) clear_next_locations (obj); root_uri = - gedit_file_browser_store_get_root + pluma_file_browser_store_get_root (model); loc = g_new (Location, 1); @@ -2563,7 +2563,7 @@ on_virtual_root_changed (GeditFileBrowserStore * model, gtk_tree_model_get (GTK_TREE_MODEL (model), &iter, - GEDIT_FILE_BROWSER_STORE_COLUMN_ICON, + PLUMA_FILE_BROWSER_STORE_COLUMN_ICON, &pixbuf, -1); obj->priv->current_location = @@ -2621,7 +2621,7 @@ on_virtual_root_changed (GeditFileBrowserStore * model, static void on_model_set (GObject * gobject, GParamSpec * arg1, - GeditFileBrowserWidget * obj) + PlumaFileBrowserWidget * obj) { GtkTreeModel *model; @@ -2629,7 +2629,7 @@ on_model_set (GObject * gobject, GParamSpec * arg1, clear_signals (obj); - if (GEDIT_IS_FILE_BOOKMARKS_STORE (model)) { + if (PLUMA_IS_FILE_BOOKMARKS_STORE (model)) { clear_next_locations (obj); /* Add the current location to the back menu */ @@ -2654,7 +2654,7 @@ on_model_set (GObject * gobject, GParamSpec * arg1, g_signal_connect (gobject, "bookmark-activated", G_CALLBACK (on_bookmark_activated), obj)); - } else if (GEDIT_IS_FILE_BROWSER_STORE (model)) { + } else if (PLUMA_IS_FILE_BROWSER_STORE (model)) { /* make sure any async operation is cancelled */ cancel_async_operation (obj); @@ -2675,21 +2675,21 @@ on_model_set (GObject * gobject, GParamSpec * arg1, } static void -on_file_store_error (GeditFileBrowserStore * store, guint code, - gchar * message, GeditFileBrowserWidget * obj) +on_file_store_error (PlumaFileBrowserStore * store, guint code, + gchar * message, PlumaFileBrowserWidget * obj) { g_signal_emit (obj, signals[ERROR], 0, code, message); } static void -on_treeview_error (GeditFileBrowserView * tree_view, guint code, - gchar * message, GeditFileBrowserWidget * obj) +on_treeview_error (PlumaFileBrowserView * tree_view, guint code, + gchar * message, PlumaFileBrowserWidget * obj) { g_signal_emit (obj, signals[ERROR], 0, code, message); } static void -on_combo_changed (GtkComboBox * combo, GeditFileBrowserWidget * obj) +on_combo_changed (GtkComboBox * combo, PlumaFileBrowserWidget * obj) { GtkTreeIter iter; guint id; @@ -2704,7 +2704,7 @@ on_combo_changed (GtkComboBox * combo, GeditFileBrowserWidget * obj) switch (id) { case BOOKMARKS_ID: - gedit_file_browser_widget_show_bookmarks (obj); + pluma_file_browser_widget_show_bookmarks (obj); break; case PATH_ID: @@ -2713,7 +2713,7 @@ on_combo_changed (GtkComboBox * combo, GeditFileBrowserWidget * obj) COLUMN_FILE, &file, -1); uri = g_file_get_uri (file); - gedit_file_browser_store_set_virtual_root_from_string + pluma_file_browser_store_set_virtual_root_from_string (obj->priv->file_store, uri); g_free (uri); @@ -2723,16 +2723,16 @@ on_combo_changed (GtkComboBox * combo, GeditFileBrowserWidget * obj) } static gboolean -on_treeview_popup_menu (GeditFileBrowserView * treeview, - GeditFileBrowserWidget * obj) +on_treeview_popup_menu (PlumaFileBrowserView * treeview, + PlumaFileBrowserWidget * obj) { return popup_menu (obj, NULL, gtk_tree_view_get_model (GTK_TREE_VIEW (treeview))); } static gboolean -on_treeview_button_press_event (GeditFileBrowserView * treeview, +on_treeview_button_press_event (PlumaFileBrowserView * treeview, GdkEventButton * event, - GeditFileBrowserWidget * obj) + PlumaFileBrowserWidget * obj) { if (event->type == GDK_BUTTON_PRESS && event->button == 3) { return popup_menu (obj, event, @@ -2743,7 +2743,7 @@ on_treeview_button_press_event (GeditFileBrowserView * treeview, } static gboolean -do_change_directory (GeditFileBrowserWidget * obj, +do_change_directory (PlumaFileBrowserWidget * obj, GdkEventKey * event) { GtkAction * action = NULL; @@ -2787,16 +2787,16 @@ do_change_directory (GeditFileBrowserWidget * obj, } static gboolean -on_treeview_key_press_event (GeditFileBrowserView * treeview, +on_treeview_key_press_event (PlumaFileBrowserView * treeview, GdkEventKey * event, - GeditFileBrowserWidget * obj) + PlumaFileBrowserWidget * obj) { guint modifiers; if (do_change_directory (obj, event)) return TRUE; - if (!GEDIT_IS_FILE_BROWSER_STORE + if (!PLUMA_IS_FILE_BROWSER_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (treeview)))) return FALSE; @@ -2828,7 +2828,7 @@ on_treeview_key_press_event (GeditFileBrowserView * treeview, static void on_selection_changed (GtkTreeSelection * selection, - GeditFileBrowserWidget * obj) + PlumaFileBrowserWidget * obj) { GtkTreeModel *model; guint selected = 0; @@ -2837,9 +2837,9 @@ on_selection_changed (GtkTreeSelection * selection, model = gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview)); - if (GEDIT_IS_FILE_BROWSER_STORE (model)) + if (PLUMA_IS_FILE_BROWSER_STORE (model)) { - selected = gedit_file_browser_widget_get_num_selected_files_or_directories (obj, + selected = pluma_file_browser_widget_get_num_selected_files_or_directories (obj, &files, &dirs); } @@ -2855,7 +2855,7 @@ on_selection_changed (GtkTreeSelection * selection, } static gboolean -on_entry_filter_activate (GeditFileBrowserWidget * obj) +on_entry_filter_activate (PlumaFileBrowserWidget * obj) { gchar const *text; @@ -2867,7 +2867,7 @@ on_entry_filter_activate (GeditFileBrowserWidget * obj) static void on_location_jump_activate (GtkMenuItem * item, - GeditFileBrowserWidget * obj) + PlumaFileBrowserWidget * obj) { GList *location; @@ -2890,7 +2890,7 @@ static void on_bookmarks_row_changed (GtkTreeModel * model, GtkTreePath * path, GtkTreeIter * iter, - GeditFileBrowserWidget *obj) + PlumaFileBrowserWidget *obj) { add_bookmark_hash (obj, iter); } @@ -2898,7 +2898,7 @@ on_bookmarks_row_changed (GtkTreeModel * model, static void on_bookmarks_row_deleted (GtkTreeModel * model, GtkTreePath * path, - GeditFileBrowserWidget *obj) + PlumaFileBrowserWidget *obj) { GtkTreeIter iter; gchar * uri; @@ -2907,7 +2907,7 @@ on_bookmarks_row_deleted (GtkTreeModel * model, if (!gtk_tree_model_get_iter (model, &iter, path)) return; - uri = gedit_file_bookmarks_store_get_uri (obj->priv->bookmarks_store, &iter); + uri = pluma_file_bookmarks_store_get_uri (obj->priv->bookmarks_store, &iter); if (!uri) return; @@ -2920,60 +2920,60 @@ on_bookmarks_row_deleted (GtkTreeModel * model, } static void -on_filter_mode_changed (GeditFileBrowserStore * model, +on_filter_mode_changed (PlumaFileBrowserStore * model, GParamSpec * param, - GeditFileBrowserWidget * obj) + PlumaFileBrowserWidget * obj) { gint mode; GtkToggleAction * action; gboolean active; - mode = gedit_file_browser_store_get_filter_mode (model); + mode = pluma_file_browser_store_get_filter_mode (model); action = GTK_TOGGLE_ACTION (gtk_action_group_get_action (obj->priv->action_group, "FilterHidden")); - active = !(mode & GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN); + active = !(mode & PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN); if (active != gtk_toggle_action_get_active (action)) gtk_toggle_action_set_active (action, active); action = GTK_TOGGLE_ACTION (gtk_action_group_get_action (obj->priv->action_group, "FilterBinary")); - active = !(mode & GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY); + active = !(mode & PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY); if (active != gtk_toggle_action_get_active (action)) gtk_toggle_action_set_active (action, active); } static void -on_action_directory_next (GtkAction * action, GeditFileBrowserWidget * obj) +on_action_directory_next (GtkAction * action, PlumaFileBrowserWidget * obj) { - gedit_file_browser_widget_history_forward (obj); + pluma_file_browser_widget_history_forward (obj); } static void on_action_directory_previous (GtkAction * action, - GeditFileBrowserWidget * obj) + PlumaFileBrowserWidget * obj) { - gedit_file_browser_widget_history_back (obj); + pluma_file_browser_widget_history_back (obj); } static void on_action_directory_up (GtkAction * action, - GeditFileBrowserWidget * obj) + PlumaFileBrowserWidget * obj) { GtkTreeModel *model; model = gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview)); - if (!GEDIT_IS_FILE_BROWSER_STORE (model)) + if (!PLUMA_IS_FILE_BROWSER_STORE (model)) return; - gedit_file_browser_store_set_virtual_root_up (GEDIT_FILE_BROWSER_STORE (model)); + pluma_file_browser_store_set_virtual_root_up (PLUMA_FILE_BROWSER_STORE (model)); } static void -on_action_directory_new (GtkAction * action, GeditFileBrowserWidget * obj) +on_action_directory_new (GtkAction * action, PlumaFileBrowserWidget * obj) { GtkTreeModel *model; GtkTreeIter parent; @@ -2981,21 +2981,21 @@ on_action_directory_new (GtkAction * action, GeditFileBrowserWidget * obj) model = gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview)); - if (!GEDIT_IS_FILE_BROWSER_STORE (model)) + if (!PLUMA_IS_FILE_BROWSER_STORE (model)) return; - if (!gedit_file_browser_widget_get_selected_directory (obj, &parent)) + if (!pluma_file_browser_widget_get_selected_directory (obj, &parent)) return; - if (gedit_file_browser_store_new_directory - (GEDIT_FILE_BROWSER_STORE (model), &parent, &iter)) { - gedit_file_browser_view_start_rename (obj->priv->treeview, + if (pluma_file_browser_store_new_directory + (PLUMA_FILE_BROWSER_STORE (model), &parent, &iter)) { + pluma_file_browser_view_start_rename (obj->priv->treeview, &iter); } } static void -on_action_file_open (GtkAction * action, GeditFileBrowserWidget * obj) +on_action_file_open (GtkAction * action, PlumaFileBrowserWidget * obj) { GtkTreeModel *model; GtkTreeSelection *selection; @@ -3007,7 +3007,7 @@ on_action_file_open (GtkAction * action, GeditFileBrowserWidget * obj) model = gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview)); selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (obj->priv->treeview)); - if (!GEDIT_IS_FILE_BROWSER_STORE (model)) + if (!PLUMA_IS_FILE_BROWSER_STORE (model)) return; rows = gtk_tree_selection_get_selected_rows (selection, &model); @@ -3025,7 +3025,7 @@ on_action_file_open (GtkAction * action, GeditFileBrowserWidget * obj) } static void -on_action_file_new (GtkAction * action, GeditFileBrowserWidget * obj) +on_action_file_new (GtkAction * action, PlumaFileBrowserWidget * obj) { GtkTreeModel *model; GtkTreeIter parent; @@ -3033,46 +3033,46 @@ on_action_file_new (GtkAction * action, GeditFileBrowserWidget * obj) model = gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview)); - if (!GEDIT_IS_FILE_BROWSER_STORE (model)) + if (!PLUMA_IS_FILE_BROWSER_STORE (model)) return; - if (!gedit_file_browser_widget_get_selected_directory (obj, &parent)) + if (!pluma_file_browser_widget_get_selected_directory (obj, &parent)) return; - if (gedit_file_browser_store_new_file - (GEDIT_FILE_BROWSER_STORE (model), &parent, &iter)) { - gedit_file_browser_view_start_rename (obj->priv->treeview, + if (pluma_file_browser_store_new_file + (PLUMA_FILE_BROWSER_STORE (model), &parent, &iter)) { + pluma_file_browser_view_start_rename (obj->priv->treeview, &iter); } } static void -on_action_file_rename (GtkAction * action, GeditFileBrowserWidget * obj) +on_action_file_rename (GtkAction * action, PlumaFileBrowserWidget * obj) { rename_selected_file (obj); } static void -on_action_file_delete (GtkAction * action, GeditFileBrowserWidget * obj) +on_action_file_delete (GtkAction * action, PlumaFileBrowserWidget * obj) { delete_selected_files (obj, FALSE); } static void -on_action_file_move_to_trash (GtkAction * action, GeditFileBrowserWidget * obj) +on_action_file_move_to_trash (GtkAction * action, PlumaFileBrowserWidget * obj) { delete_selected_files (obj, TRUE); } static void on_action_directory_refresh (GtkAction * action, - GeditFileBrowserWidget * obj) + PlumaFileBrowserWidget * obj) { - gedit_file_browser_widget_refresh (obj); + pluma_file_browser_widget_refresh (obj); } static void -on_action_directory_open (GtkAction * action, GeditFileBrowserWidget * obj) +on_action_directory_open (GtkAction * action, PlumaFileBrowserWidget * obj) { GtkTreeModel *model; GtkTreeSelection *selection; @@ -3085,7 +3085,7 @@ on_action_directory_open (GtkAction * action, GeditFileBrowserWidget * obj) model = gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview)); selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (obj->priv->treeview)); - if (!GEDIT_IS_FILE_BROWSER_STORE (model)) + if (!PLUMA_IS_FILE_BROWSER_STORE (model)) return; rows = gtk_tree_selection_get_selected_rows (selection, &model); @@ -3100,7 +3100,7 @@ on_action_directory_open (GtkAction * action, GeditFileBrowserWidget * obj) } if (!directory_opened) { - if (gedit_file_browser_widget_get_selected_directory (obj, &iter)) + if (pluma_file_browser_widget_get_selected_directory (obj, &iter)) directory_open (obj, model, &iter); } @@ -3108,23 +3108,23 @@ on_action_directory_open (GtkAction * action, GeditFileBrowserWidget * obj) } static void -on_action_filter_hidden (GtkAction * action, GeditFileBrowserWidget * obj) +on_action_filter_hidden (GtkAction * action, PlumaFileBrowserWidget * obj) { update_filter_mode (obj, action, - GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN); + PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN); } static void -on_action_filter_binary (GtkAction * action, GeditFileBrowserWidget * obj) +on_action_filter_binary (GtkAction * action, PlumaFileBrowserWidget * obj) { update_filter_mode (obj, action, - GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY); + PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY); } static void -on_action_bookmark_open (GtkAction * action, GeditFileBrowserWidget * obj) +on_action_bookmark_open (GtkAction * action, PlumaFileBrowserWidget * obj) { GtkTreeModel *model; GtkTreeSelection *selection; @@ -3133,7 +3133,7 @@ on_action_bookmark_open (GtkAction * action, GeditFileBrowserWidget * obj) model = gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview)); selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (obj->priv->treeview)); - if (!GEDIT_IS_FILE_BOOKMARKS_STORE (model)) + if (!PLUMA_IS_FILE_BOOKMARKS_STORE (model)) return; if (gtk_tree_selection_get_selected (selection, NULL, &iter)) diff --git a/plugins/filebrowser/pluma-file-browser-widget.h b/plugins/filebrowser/pluma-file-browser-widget.h new file mode 100755 index 00000000..4d7f43ef --- /dev/null +++ b/plugins/filebrowser/pluma-file-browser-widget.h @@ -0,0 +1,121 @@ +/* + * pluma-file-browser-widget.h - Pluma plugin providing easy file access + * from the sidepanel + * + * Copyright (C) 2006 - Jesse van den Kieboom <[email protected]> + * + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __PLUMA_FILE_BROWSER_WIDGET_H__ +#define __PLUMA_FILE_BROWSER_WIDGET_H__ + +#include <gtk/gtk.h> +#include "pluma-file-browser-store.h" +#include "pluma-file-bookmarks-store.h" +#include "pluma-file-browser-view.h" + +G_BEGIN_DECLS +#define PLUMA_TYPE_FILE_BROWSER_WIDGET (pluma_file_browser_widget_get_type ()) +#define PLUMA_FILE_BROWSER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PLUMA_TYPE_FILE_BROWSER_WIDGET, PlumaFileBrowserWidget)) +#define PLUMA_FILE_BROWSER_WIDGET_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PLUMA_TYPE_FILE_BROWSER_WIDGET, PlumaFileBrowserWidget const)) +#define PLUMA_FILE_BROWSER_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PLUMA_TYPE_FILE_BROWSER_WIDGET, PlumaFileBrowserWidgetClass)) +#define PLUMA_IS_FILE_BROWSER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PLUMA_TYPE_FILE_BROWSER_WIDGET)) +#define PLUMA_IS_FILE_BROWSER_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PLUMA_TYPE_FILE_BROWSER_WIDGET)) +#define PLUMA_FILE_BROWSER_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PLUMA_TYPE_FILE_BROWSER_WIDGET, PlumaFileBrowserWidgetClass)) + +typedef struct _PlumaFileBrowserWidget PlumaFileBrowserWidget; +typedef struct _PlumaFileBrowserWidgetClass PlumaFileBrowserWidgetClass; +typedef struct _PlumaFileBrowserWidgetPrivate PlumaFileBrowserWidgetPrivate; + +typedef +gboolean (*PlumaFileBrowserWidgetFilterFunc) (PlumaFileBrowserWidget * obj, + PlumaFileBrowserStore * + model, GtkTreeIter * iter, + gpointer user_data); + +struct _PlumaFileBrowserWidget +{ + GtkVBox parent; + + PlumaFileBrowserWidgetPrivate *priv; +}; + +struct _PlumaFileBrowserWidgetClass +{ + GtkVBoxClass parent_class; + + /* Signals */ + void (*uri_activated) (PlumaFileBrowserWidget * widget, + gchar const *uri); + void (*error) (PlumaFileBrowserWidget * widget, + guint code, + gchar const *message); + gboolean (*confirm_delete) (PlumaFileBrowserWidget * widget, + PlumaFileBrowserStore * model, + GList *list); + gboolean (*confirm_no_trash) (PlumaFileBrowserWidget * widget, + GList *list); +}; + +GType pluma_file_browser_widget_get_type (void) G_GNUC_CONST; +GType pluma_file_browser_widget_register_type (GTypeModule * module); + +GtkWidget *pluma_file_browser_widget_new (const gchar *data_dir); + +void pluma_file_browser_widget_show_bookmarks (PlumaFileBrowserWidget * obj); +void pluma_file_browser_widget_show_files (PlumaFileBrowserWidget * obj); + +void pluma_file_browser_widget_set_root (PlumaFileBrowserWidget * obj, + gchar const *root, + gboolean virtual_root); +void +pluma_file_browser_widget_set_root_and_virtual_root (PlumaFileBrowserWidget * obj, + gchar const *root, + gchar const *virtual_root); + +gboolean +pluma_file_browser_widget_get_selected_directory (PlumaFileBrowserWidget * obj, + GtkTreeIter * iter); + +PlumaFileBrowserStore * +pluma_file_browser_widget_get_browser_store (PlumaFileBrowserWidget * obj); +PlumaFileBookmarksStore * +pluma_file_browser_widget_get_bookmarks_store (PlumaFileBrowserWidget * obj); +PlumaFileBrowserView * +pluma_file_browser_widget_get_browser_view (PlumaFileBrowserWidget * obj); +GtkWidget * +pluma_file_browser_widget_get_filter_entry (PlumaFileBrowserWidget * obj); + +GtkUIManager * +pluma_file_browser_widget_get_ui_manager (PlumaFileBrowserWidget * obj); + +gulong pluma_file_browser_widget_add_filter (PlumaFileBrowserWidget * obj, + PlumaFileBrowserWidgetFilterFunc func, + gpointer user_data, + GDestroyNotify notify); +void pluma_file_browser_widget_remove_filter (PlumaFileBrowserWidget * obj, + gulong id); +void pluma_file_browser_widget_set_filter_pattern (PlumaFileBrowserWidget * obj, + gchar const *pattern); + +void pluma_file_browser_widget_refresh (PlumaFileBrowserWidget * obj); +void pluma_file_browser_widget_history_back (PlumaFileBrowserWidget * obj); +void pluma_file_browser_widget_history_forward (PlumaFileBrowserWidget * obj); + +G_END_DECLS +#endif /* __PLUMA_FILE_BROWSER_WIDGET_H__ */ + +// ex:ts=8:noet: diff --git a/plugins/filebrowser/gedit-file-browser.schemas.in b/plugins/filebrowser/pluma-file-browser.schemas.in index c80c8eec..0ae807d6 100755 --- a/plugins/filebrowser/gedit-file-browser.schemas.in +++ b/plugins/filebrowser/pluma-file-browser.schemas.in @@ -1,9 +1,9 @@ <mateconfschemafile> <schemalist> <schema> - <key>/schemas/apps/gedit-2/plugins/filebrowser/on_load/tree_view</key> - <applyto>/apps/gedit-2/plugins/filebrowser/on_load/tree_view</applyto> - <owner>gedit</owner> + <key>/schemas/apps/pluma-2/plugins/filebrowser/on_load/tree_view</key> + <applyto>/apps/pluma-2/plugins/filebrowser/on_load/tree_view</applyto> + <owner>pluma</owner> <type>bool</type> <default>TRUE</default> <locale name="C"> @@ -13,9 +13,9 @@ </schema> <schema> - <key>/schemas/apps/gedit-2/plugins/filebrowser/on_load/root</key> - <applyto>/apps/gedit-2/plugins/filebrowser/on_load/root</applyto> - <owner>gedit</owner> + <key>/schemas/apps/pluma-2/plugins/filebrowser/on_load/root</key> + <applyto>/apps/pluma-2/plugins/filebrowser/on_load/root</applyto> + <owner>pluma</owner> <type>string</type> <default></default> <locale name="C"> @@ -26,9 +26,9 @@ </schema> <schema> - <key>/schemas/apps/gedit-2/plugins/filebrowser/on_load/virtual_root</key> - <applyto>/apps/gedit-2/plugins/filebrowser/on_load/virtual_root</applyto> - <owner>gedit</owner> + <key>/schemas/apps/pluma-2/plugins/filebrowser/on_load/virtual_root</key> + <applyto>/apps/pluma-2/plugins/filebrowser/on_load/virtual_root</applyto> + <owner>pluma</owner> <type>string</type> <default></default> <locale name="C"> @@ -40,9 +40,9 @@ </schema> <schema> - <key>/schemas/apps/gedit-2/plugins/filebrowser/on_load/enable_remote</key> - <applyto>/apps/gedit-2/plugins/filebrowser/on_load/enable_remote</applyto> - <owner>gedit</owner> + <key>/schemas/apps/pluma-2/plugins/filebrowser/on_load/enable_remote</key> + <applyto>/apps/pluma-2/plugins/filebrowser/on_load/enable_remote</applyto> + <owner>pluma</owner> <type>bool</type> <default>FALSE</default> <locale name="C"> @@ -52,9 +52,9 @@ </schema> <schema> - <key>/schemas/apps/gedit-2/plugins/filebrowser/open_at_first_doc</key> - <applyto>/apps/gedit-2/plugins/filebrowser/open_at_first_doc</applyto> - <owner>gedit</owner> + <key>/schemas/apps/pluma-2/plugins/filebrowser/open_at_first_doc</key> + <applyto>/apps/pluma-2/plugins/filebrowser/open_at_first_doc</applyto> + <owner>pluma</owner> <type>bool</type> <default>TRUE</default> <locale name="C"> @@ -67,9 +67,9 @@ </schema> <schema> - <key>/schemas/apps/gedit-2/plugins/filebrowser/filter_mode</key> - <applyto>/apps/gedit-2/plugins/filebrowser/filter_mode</applyto> - <owner>gedit</owner> + <key>/schemas/apps/pluma-2/plugins/filebrowser/filter_mode</key> + <applyto>/apps/pluma-2/plugins/filebrowser/filter_mode</applyto> + <owner>pluma</owner> <type>string</type> <default>hidden_and_binary</default> <locale name="C"> @@ -82,9 +82,9 @@ </schema> <schema> - <key>/schemas/apps/gedit-2/plugins/filebrowser/filter_pattern</key> - <applyto>/apps/gedit-2/plugins/filebrowser/filter_pattern</applyto> - <owner>gedit</owner> + <key>/schemas/apps/pluma-2/plugins/filebrowser/filter_pattern</key> + <applyto>/apps/pluma-2/plugins/filebrowser/filter_pattern</applyto> + <owner>pluma</owner> <type>string</type> <default></default> <locale name="C"> diff --git a/plugins/modelines/Makefile.am b/plugins/modelines/Makefile.am index ddcfccc8..d1b59b85 100755 --- a/plugins/modelines/Makefile.am +++ b/plugins/modelines/Makefile.am @@ -1,31 +1,31 @@ # Modelines Plugin -plugindir = $(GEDIT_PLUGINS_LIBS_DIR) +plugindir = $(PLUMA_PLUGINS_LIBS_DIR) INCLUDES = \ -I$(top_srcdir) \ - $(GEDIT_CFLAGS) \ + $(PLUMA_CFLAGS) \ $(WARN_CFLAGS) \ $(DISABLE_DEPRECATED_CFLAGS) -modelinesdir = $(GEDIT_PLUGINS_DATA_DIR)/modelines +modelinesdir = $(PLUMA_PLUGINS_DATA_DIR)/modelines modelines_DATA = \ language-mappings plugin_LTLIBRARIES = libmodelines.la libmodelines_la_SOURCES = \ - gedit-modeline-plugin.h \ - gedit-modeline-plugin.c \ + pluma-modeline-plugin.h \ + pluma-modeline-plugin.c \ modeline-parser.h \ modeline-parser.c libmodelines_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS) -libmodelines_la_LIBADD = $(GEDIT_LIBS) +libmodelines_la_LIBADD = $(PLUMA_LIBS) -plugin_in_files = modelines.gedit-plugin.desktop.in -%.gedit-plugin: %.gedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache +plugin_in_files = modelines.pluma-plugin.desktop.in +%.pluma-plugin: %.pluma-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache -plugin_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin) +plugin_DATA = $(plugin_in_files:.pluma-plugin.desktop.in=.pluma-plugin) EXTRA_DIST = \ $(plugin_in_files) \ diff --git a/plugins/modelines/gedit-modeline-plugin.h b/plugins/modelines/gedit-modeline-plugin.h deleted file mode 100755 index 92b01e70..00000000 --- a/plugins/modelines/gedit-modeline-plugin.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * gedit-modeline-plugin.h - * Emacs, Kate and Vim-style modelines support for gedit. - * - * Copyright (C) 2005-2007 - Steve Frécinaux <[email protected]> - * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef __GEDIT_MODELINE_PLUGIN_H__ -#define __GEDIT_MODELINE_PLUGIN_H__ - -#include <glib.h> -#include <glib-object.h> -#include <gedit/gedit-plugin.h> - -G_BEGIN_DECLS - -#define GEDIT_TYPE_MODELINE_PLUGIN (gedit_modeline_plugin_get_type ()) -#define GEDIT_MODELINE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GEDIT_TYPE_MODELINE_PLUGIN, GeditModelinePlugin)) -#define GEDIT_MODELINE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GEDIT_TYPE_MODELINE_PLUGIN, GeditModelinePluginClass)) -#define GEDIT_IS_MODELINE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GEDIT_TYPE_MODELINE_PLUGIN)) -#define GEDIT_IS_MODELINE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GEDIT_TYPE_MODELINE_PLUGIN)) -#define GEDIT_MODELINE_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GEDIT_TYPE_MODELINE_PLUGIN, GeditModelinePluginClass)) - -/* Private structure type */ -typedef GeditPluginClass GeditModelinePluginClass; -typedef GeditPlugin GeditModelinePlugin; - -GType gedit_modeline_plugin_get_type (void) G_GNUC_CONST; - -G_MODULE_EXPORT GType register_gedit_plugin (GTypeModule *module); - -G_END_DECLS - -#endif /* __GEDIT_MODELINE_PLUGIN_H__ */ diff --git a/plugins/modelines/modeline-parser.c b/plugins/modelines/modeline-parser.c index 6feafc55..23304e38 100755 --- a/plugins/modelines/modeline-parser.c +++ b/plugins/modelines/modeline-parser.c @@ -1,6 +1,6 @@ /* * modeline-parser.c - * Emacs, Kate and Vim-style modelines support for gedit. + * Emacs, Kate and Vim-style modelines support for pluma. * * Copyright (C) 2005-2007 - Steve Frécinaux <[email protected]> * @@ -22,9 +22,9 @@ #include <string.h> #include <stdlib.h> #include <stdio.h> -#include <gedit/gedit-language-manager.h> -#include <gedit/gedit-prefs-manager.h> -#include <gedit/gedit-debug.h> +#include <pluma/pluma-language-manager.h> +#include <pluma/pluma-prefs-manager.h> +#include <pluma/pluma-debug.h> #include "modeline-parser.h" #define MODELINES_LANGUAGE_MAPPINGS_FILE "language-mappings" @@ -32,7 +32,7 @@ /* base dir to lookup configuration files */ static gchar *modelines_data_dir; -/* Mappings: language name -> Gedit language ID */ +/* Mappings: language name -> Pluma language ID */ static GHashTable *vim_languages; static GHashTable *emacs_languages; static GHashTable *kate_languages; @@ -112,7 +112,7 @@ load_language_mappings_group (GKeyFile *key_file, const gchar *group) keys = g_key_file_get_keys (key_file, group, &length, NULL); - gedit_debug_message (DEBUG_PLUGINS, + pluma_debug_message (DEBUG_PLUGINS, "%" G_GSIZE_FORMAT " mappings in group %s", length, group); @@ -143,7 +143,7 @@ load_language_mappings (void) if (g_key_file_load_from_file (mappings, fname, 0, &error)) { - gedit_debug_message (DEBUG_PLUGINS, + pluma_debug_message (DEBUG_PLUGINS, "Loaded language mappings from %s", fname); @@ -153,7 +153,7 @@ load_language_mappings (void) } else { - gedit_debug_message (DEBUG_PLUGINS, + pluma_debug_message (DEBUG_PLUGINS, "Failed to loaded language mappings from %s: %s", fname, error->message); @@ -395,7 +395,7 @@ parse_emacs_modeline (gchar *s, s++; } - gedit_debug_message (DEBUG_PLUGINS, + pluma_debug_message (DEBUG_PLUGINS, "Emacs modeline bit: %s = %s", key->str, value->str); @@ -493,7 +493,7 @@ parse_kate_modeline (gchar *s, s++; } - gedit_debug_message (DEBUG_PLUGINS, + pluma_debug_message (DEBUG_PLUGINS, "Kate modeline bit: %s = %s", key->str, value->str); @@ -582,21 +582,21 @@ parse_modeline (gchar *s, strncmp (s, "vi:", 3) == 0 || strncmp (s, "vim:", 4) == 0)) { - gedit_debug_message (DEBUG_PLUGINS, "Vim modeline on line %d", line_number); + pluma_debug_message (DEBUG_PLUGINS, "Vim modeline on line %d", line_number); while (*s != ':') s++; s = parse_vim_modeline (s + 1, options); } else if (line_number <= 2 && strncmp (s, "-*-", 3) == 0) { - gedit_debug_message (DEBUG_PLUGINS, "Emacs modeline on line %d", line_number); + pluma_debug_message (DEBUG_PLUGINS, "Emacs modeline on line %d", line_number); s = parse_emacs_modeline (s + 3, options); } else if ((line_number <= 10 || line_number > line_count - 10) && strncmp (s, "kate:", 5) == 0) { - gedit_debug_message (DEBUG_PLUGINS, "Kate modeline on line %d", line_number); + pluma_debug_message (DEBUG_PLUGINS, "Kate modeline on line %d", line_number); s = parse_kate_modeline (s + 5, options); } @@ -744,7 +744,7 @@ modeline_parser_apply_modeline (GtkSourceView *view) GtkSourceLanguageManager *manager; GtkSourceLanguage *language; - manager = gedit_get_language_manager (); + manager = pluma_get_language_manager (); language = gtk_source_language_manager_get_language (manager, options.language_id); @@ -769,7 +769,7 @@ modeline_parser_apply_modeline (GtkSourceView *view) { gtk_source_view_set_insert_spaces_instead_of_tabs (view, - gedit_prefs_manager_get_insert_spaces ()); + pluma_prefs_manager_get_insert_spaces ()); } if (has_option (&options, MODELINE_SET_TAB_WIDTH)) @@ -779,7 +779,7 @@ modeline_parser_apply_modeline (GtkSourceView *view) else if (check_previous (view, previous, MODELINE_SET_TAB_WIDTH)) { gtk_source_view_set_tab_width (view, - gedit_prefs_manager_get_tabs_size ()); + pluma_prefs_manager_get_tabs_size ()); } if (has_option (&options, MODELINE_SET_INDENT_WIDTH)) @@ -798,7 +798,7 @@ modeline_parser_apply_modeline (GtkSourceView *view) else if (check_previous (view, previous, MODELINE_SET_WRAP_MODE)) { gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (view), - gedit_prefs_manager_get_wrap_mode ()); + pluma_prefs_manager_get_wrap_mode ()); } if (has_option (&options, MODELINE_SET_RIGHT_MARGIN_POSITION)) @@ -808,7 +808,7 @@ modeline_parser_apply_modeline (GtkSourceView *view) else if (check_previous (view, previous, MODELINE_SET_RIGHT_MARGIN_POSITION)) { gtk_source_view_set_right_margin_position (view, - gedit_prefs_manager_get_right_margin_position ()); + pluma_prefs_manager_get_right_margin_position ()); } if (has_option (&options, MODELINE_SET_SHOW_RIGHT_MARGIN)) @@ -818,7 +818,7 @@ modeline_parser_apply_modeline (GtkSourceView *view) else if (check_previous (view, previous, MODELINE_SET_SHOW_RIGHT_MARGIN)) { gtk_source_view_set_show_right_margin (view, - gedit_prefs_manager_get_display_right_margin ()); + pluma_prefs_manager_get_display_right_margin ()); } if (previous) diff --git a/plugins/modelines/modeline-parser.h b/plugins/modelines/modeline-parser.h index 2e8559e4..11e06c34 100755 --- a/plugins/modelines/modeline-parser.h +++ b/plugins/modelines/modeline-parser.h @@ -1,6 +1,6 @@ /* * modelie-parser.h - * Emacs, Kate and Vim-style modelines support for gedit. + * Emacs, Kate and Vim-style modelines support for pluma. * * Copyright (C) 2005-2007 - Steve Frécinaux <[email protected]> * diff --git a/plugins/modelines/modelines.gedit-plugin.desktop.in b/plugins/modelines/modelines.pluma-plugin.desktop.in index c72f0199..0d5f8389 100755 --- a/plugins/modelines/modelines.gedit-plugin.desktop.in +++ b/plugins/modelines/modelines.pluma-plugin.desktop.in @@ -1,8 +1,8 @@ -[Gedit Plugin] +[Pluma Plugin] Module=modelines IAge=2 _Name=Modelines -_Description=Emacs, Kate and Vim-style modelines support for gedit. +_Description=Emacs, Kate and Vim-style modelines support for pluma. Authors=Steve Frécinaux <[email protected]> Copyright=Copyright © 2005 Steve Frécinaux -Website=http://www.gedit.org +Website=http://www.pluma.org diff --git a/plugins/modelines/gedit-modeline-plugin.c b/plugins/modelines/pluma-modeline-plugin.c index 49fc2f69..db5fc1e3 100755 --- a/plugins/modelines/gedit-modeline-plugin.c +++ b/plugins/modelines/pluma-modeline-plugin.c @@ -1,6 +1,6 @@ /* - * gedit-modeline-plugin.c - * Emacs, Kate and Vim-style modelines support for gedit. + * pluma-modeline-plugin.c + * Emacs, Kate and Vim-style modelines support for pluma. * * Copyright (C) 2005-2007 - Steve Frécinaux <[email protected]> * @@ -25,14 +25,14 @@ #include <glib/gi18n-lib.h> #include <gmodule.h> -#include "gedit-modeline-plugin.h" +#include "pluma-modeline-plugin.h" #include "modeline-parser.h" -#include <gedit/gedit-debug.h> -#include <gedit/gedit-utils.h> +#include <pluma/pluma-debug.h> +#include <pluma/pluma-utils.h> -#define WINDOW_DATA_KEY "GeditModelinePluginWindowData" -#define DOCUMENT_DATA_KEY "GeditModelinePluginDocumentData" +#define WINDOW_DATA_KEY "PlumaModelinePluginWindowData" +#define DOCUMENT_DATA_KEY "PlumaModelinePluginDocumentData" typedef struct { @@ -46,12 +46,12 @@ typedef struct gulong document_saved_handler_id; } DocumentData; -static void gedit_modeline_plugin_activate (GeditPlugin *plugin, GeditWindow *window); -static void gedit_modeline_plugin_deactivate (GeditPlugin *plugin, GeditWindow *window); -static GObject *gedit_modeline_plugin_constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_param); -static void gedit_modeline_plugin_finalize (GObject *object); +static void pluma_modeline_plugin_activate (PlumaPlugin *plugin, PlumaWindow *window); +static void pluma_modeline_plugin_deactivate (PlumaPlugin *plugin, PlumaWindow *window); +static GObject *pluma_modeline_plugin_constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_param); +static void pluma_modeline_plugin_finalize (GObject *object); -GEDIT_PLUGIN_REGISTER_TYPE(GeditModelinePlugin, gedit_modeline_plugin) +PLUMA_PLUGIN_REGISTER_TYPE(PlumaModelinePlugin, pluma_modeline_plugin) static void window_data_free (WindowData *wdata) @@ -66,31 +66,31 @@ document_data_free (DocumentData *ddata) } static void -gedit_modeline_plugin_class_init (GeditModelinePluginClass *klass) +pluma_modeline_plugin_class_init (PlumaModelinePluginClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - GeditPluginClass *plugin_class = GEDIT_PLUGIN_CLASS (klass); + PlumaPluginClass *plugin_class = PLUMA_PLUGIN_CLASS (klass); - object_class->constructor = gedit_modeline_plugin_constructor; - object_class->finalize = gedit_modeline_plugin_finalize; + object_class->constructor = pluma_modeline_plugin_constructor; + object_class->finalize = pluma_modeline_plugin_finalize; - plugin_class->activate = gedit_modeline_plugin_activate; - plugin_class->deactivate = gedit_modeline_plugin_deactivate; + plugin_class->activate = pluma_modeline_plugin_activate; + plugin_class->deactivate = pluma_modeline_plugin_deactivate; } static GObject * -gedit_modeline_plugin_constructor (GType type, +pluma_modeline_plugin_constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_param) { GObject *object; gchar *data_dir; - object = G_OBJECT_CLASS (gedit_modeline_plugin_parent_class)->constructor (type, + object = G_OBJECT_CLASS (pluma_modeline_plugin_parent_class)->constructor (type, n_construct_properties, construct_param); - data_dir = gedit_plugin_get_data_dir (GEDIT_PLUGIN (object)); + data_dir = pluma_plugin_get_data_dir (PLUMA_PLUGIN (object)); modeline_parser_init (data_dir); @@ -100,23 +100,23 @@ gedit_modeline_plugin_constructor (GType type, } static void -gedit_modeline_plugin_init (GeditModelinePlugin *plugin) +pluma_modeline_plugin_init (PlumaModelinePlugin *plugin) { - gedit_debug_message (DEBUG_PLUGINS, "GeditModelinePlugin initializing"); + pluma_debug_message (DEBUG_PLUGINS, "PlumaModelinePlugin initializing"); } static void -gedit_modeline_plugin_finalize (GObject *object) +pluma_modeline_plugin_finalize (GObject *object) { - gedit_debug_message (DEBUG_PLUGINS, "GeditModelinePlugin finalizing"); + pluma_debug_message (DEBUG_PLUGINS, "PlumaModelinePlugin finalizing"); modeline_parser_shutdown (); - G_OBJECT_CLASS (gedit_modeline_plugin_parent_class)->finalize (object); + G_OBJECT_CLASS (pluma_modeline_plugin_parent_class)->finalize (object); } static void -on_document_loaded_or_saved (GeditDocument *document, +on_document_loaded_or_saved (PlumaDocument *document, const GError *error, GtkSourceView *view) { @@ -124,7 +124,7 @@ on_document_loaded_or_saved (GeditDocument *document, } static void -connect_handlers (GeditView *view) +connect_handlers (PlumaView *view) { DocumentData *data; GtkTextBuffer *doc; @@ -147,7 +147,7 @@ connect_handlers (GeditView *view) } static void -disconnect_handlers (GeditView *view) +disconnect_handlers (PlumaView *view) { DocumentData *data; GtkTextBuffer *doc; @@ -170,35 +170,35 @@ disconnect_handlers (GeditView *view) } static void -on_window_tab_added (GeditWindow *window, - GeditTab *tab, +on_window_tab_added (PlumaWindow *window, + PlumaTab *tab, gpointer user_data) { - connect_handlers (gedit_tab_get_view (tab)); + connect_handlers (pluma_tab_get_view (tab)); } static void -on_window_tab_removed (GeditWindow *window, - GeditTab *tab, +on_window_tab_removed (PlumaWindow *window, + PlumaTab *tab, gpointer user_data) { - disconnect_handlers (gedit_tab_get_view (tab)); + disconnect_handlers (pluma_tab_get_view (tab)); } static void -gedit_modeline_plugin_activate (GeditPlugin *plugin, - GeditWindow *window) +pluma_modeline_plugin_activate (PlumaPlugin *plugin, + PlumaWindow *window) { WindowData *wdata; GList *views; GList *l; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); - views = gedit_window_get_views (window); + views = pluma_window_get_views (window); for (l = views; l != NULL; l = l->next) { - connect_handlers (GEDIT_VIEW (l->data)); + connect_handlers (PLUMA_VIEW (l->data)); modeline_parser_apply_modeline (GTK_SOURCE_VIEW (l->data)); } g_list_free (views); @@ -218,14 +218,14 @@ gedit_modeline_plugin_activate (GeditPlugin *plugin, } static void -gedit_modeline_plugin_deactivate (GeditPlugin *plugin, - GeditWindow *window) +pluma_modeline_plugin_deactivate (PlumaPlugin *plugin, + PlumaWindow *window) { WindowData *wdata; GList *views; GList *l; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); wdata = g_object_steal_data (G_OBJECT (window), WINDOW_DATA_KEY); @@ -234,11 +234,11 @@ gedit_modeline_plugin_deactivate (GeditPlugin *plugin, window_data_free (wdata); - views = gedit_window_get_views (window); + views = pluma_window_get_views (window); for (l = views; l != NULL; l = l->next) { - disconnect_handlers (GEDIT_VIEW (l->data)); + disconnect_handlers (PLUMA_VIEW (l->data)); modeline_parser_deactivate (GTK_SOURCE_VIEW (l->data)); } diff --git a/plugins/modelines/pluma-modeline-plugin.h b/plugins/modelines/pluma-modeline-plugin.h new file mode 100755 index 00000000..cdd77b20 --- /dev/null +++ b/plugins/modelines/pluma-modeline-plugin.h @@ -0,0 +1,48 @@ +/* + * pluma-modeline-plugin.h + * Emacs, Kate and Vim-style modelines support for pluma. + * + * Copyright (C) 2005-2007 - Steve Frécinaux <[email protected]> + * + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __PLUMA_MODELINE_PLUGIN_H__ +#define __PLUMA_MODELINE_PLUGIN_H__ + +#include <glib.h> +#include <glib-object.h> +#include <pluma/pluma-plugin.h> + +G_BEGIN_DECLS + +#define PLUMA_TYPE_MODELINE_PLUGIN (pluma_modeline_plugin_get_type ()) +#define PLUMA_MODELINE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PLUMA_TYPE_MODELINE_PLUGIN, PlumaModelinePlugin)) +#define PLUMA_MODELINE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PLUMA_TYPE_MODELINE_PLUGIN, PlumaModelinePluginClass)) +#define PLUMA_IS_MODELINE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PLUMA_TYPE_MODELINE_PLUGIN)) +#define PLUMA_IS_MODELINE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PLUMA_TYPE_MODELINE_PLUGIN)) +#define PLUMA_MODELINE_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), PLUMA_TYPE_MODELINE_PLUGIN, PlumaModelinePluginClass)) + +/* Private structure type */ +typedef PlumaPluginClass PlumaModelinePluginClass; +typedef PlumaPlugin PlumaModelinePlugin; + +GType pluma_modeline_plugin_get_type (void) G_GNUC_CONST; + +G_MODULE_EXPORT GType register_pluma_plugin (GTypeModule *module); + +G_END_DECLS + +#endif /* __PLUMA_MODELINE_PLUGIN_H__ */ diff --git a/plugins/pythonconsole/Makefile.am b/plugins/pythonconsole/Makefile.am index c27227f3..53361183 100755 --- a/plugins/pythonconsole/Makefile.am +++ b/plugins/pythonconsole/Makefile.am @@ -1,11 +1,11 @@ # Python Console Plugin SUBDIRS = pythonconsole -plugindir = $(GEDIT_PLUGINS_LIBS_DIR) +plugindir = $(PLUMA_PLUGINS_LIBS_DIR) -plugin_in_files = pythonconsole.gedit-plugin.desktop.in -%.gedit-plugin: %.gedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache +plugin_in_files = pythonconsole.pluma-plugin.desktop.in +%.pluma-plugin: %.pluma-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache -plugin_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin) +plugin_DATA = $(plugin_in_files:.pluma-plugin.desktop.in=.pluma-plugin) EXTRA_DIST = $(plugin_in_files) diff --git a/plugins/pythonconsole/pythonconsole.gedit-plugin.desktop.in b/plugins/pythonconsole/pythonconsole.pluma-plugin.desktop.in index 8cc65648..ca941412 100755 --- a/plugins/pythonconsole/pythonconsole.gedit-plugin.desktop.in +++ b/plugins/pythonconsole/pythonconsole.pluma-plugin.desktop.in @@ -1,4 +1,4 @@ -[Gedit Plugin] +[Pluma Plugin] Loader=python Module=pythonconsole IAge=2 @@ -7,4 +7,4 @@ _Description=Interactive Python console standing in the bottom panel Icon=mate-mime-text-x-python Authors=Steve Frécinaux <[email protected]> Copyright=Copyright © 2006 Steve Frécinaux -Website=http://www.gedit.org +Website=http://www.pluma.org diff --git a/plugins/pythonconsole/pythonconsole/Makefile.am b/plugins/pythonconsole/pythonconsole/Makefile.am index 7aa91fe9..05327ed6 100755 --- a/plugins/pythonconsole/pythonconsole/Makefile.am +++ b/plugins/pythonconsole/pythonconsole/Makefile.am @@ -1,12 +1,12 @@ # Python console plugin -plugindir = $(GEDIT_PLUGINS_LIBS_DIR)/pythonconsole +plugindir = $(PLUMA_PLUGINS_LIBS_DIR)/pythonconsole plugin_PYTHON = \ __init__.py \ console.py \ config.py -uidir = $(GEDIT_PLUGINS_DATA_DIR)/pythonconsole/ui +uidir = $(PLUMA_PLUGINS_DATA_DIR)/pythonconsole/ui ui_DATA = config.ui EXTRA_DIST = $(ui_DATA) diff --git a/plugins/pythonconsole/pythonconsole/__init__.py b/plugins/pythonconsole/pythonconsole/__init__.py index 60f70e9f..699225f0 100755 --- a/plugins/pythonconsole/pythonconsole/__init__.py +++ b/plugins/pythonconsole/pythonconsole/__init__.py @@ -21,11 +21,11 @@ # Parts from "Interactive Python-GTK Console" (stolen from epiphany's console.py) # Copyright (C), 1998 James Henstridge <[email protected]> # Copyright (C), 2005 Adam Hooper <[email protected]> -# Bits from gedit Python Console Plugin +# Bits from pluma Python Console Plugin # Copyrignt (C), 2005 Raphaël Slinckx import gtk -import gedit +import pluma from console import PythonConsole from config import PythonConsoleConfigDialog @@ -33,14 +33,14 @@ from config import PythonConsoleConfig PYTHON_ICON = 'mate-mime-text-x-python' -class PythonConsolePlugin(gedit.Plugin): +class PythonConsolePlugin(pluma.Plugin): def __init__(self): - gedit.Plugin.__init__(self) + pluma.Plugin.__init__(self) self.dlg = None def activate(self, window): console = PythonConsole(namespace = {'__builtins__' : __builtins__, - 'gedit' : gedit, + 'pluma' : pluma, 'window' : window}) console.eval('print "You can access the main window through ' \ '\'window\' :\\n%s" % window', False) @@ -63,14 +63,14 @@ def create_configure_dialog(self): self.dlg = PythonConsoleConfigDialog(self.get_data_dir()) dialog = self.dlg.dialog() - window = gedit.app_get_default().get_active_window() + window = pluma.app_get_default().get_active_window() if window: dialog.set_transient_for(window) return dialog # Here we dynamically insert create_configure_dialog based on if configuration -# is enabled. This has to be done like this because gedit checks if a plugin +# is enabled. This has to be done like this because pluma checks if a plugin # is configurable solely on the fact that it has this member defined or not if PythonConsoleConfig.enabled(): PythonConsolePlugin.create_configure_dialog = create_configure_dialog diff --git a/plugins/pythonconsole/pythonconsole/config.py b/plugins/pythonconsole/pythonconsole/config.py index fed4699b..ac0e599c 100755 --- a/plugins/pythonconsole/pythonconsole/config.py +++ b/plugins/pythonconsole/pythonconsole/config.py @@ -21,7 +21,7 @@ # Parts from "Interactive Python-GTK Console" (stolen from epiphany's console.py) # Copyright (C), 1998 James Henstridge <[email protected]> # Copyright (C), 2005 Adam Hooper <[email protected]> -# Bits from gedit Python Console Plugin +# Bits from pluma Python Console Plugin # Copyrignt (C), 2005 Raphaël Slinckx import os @@ -29,7 +29,7 @@ import gtk __all__ = ('PythonConsoleConfig', 'PythonConsoleConfigDialog') -MATECONF_KEY_BASE = '/apps/gedit-2/plugins/pythonconsole' +MATECONF_KEY_BASE = '/apps/pluma-2/plugins/pythonconsole' MATECONF_KEY_COMMAND_COLOR = MATECONF_KEY_BASE + '/command-color' MATECONF_KEY_ERROR_COLOR = MATECONF_KEY_BASE + '/error-color' diff --git a/plugins/pythonconsole/pythonconsole/console.py b/plugins/pythonconsole/pythonconsole/console.py index e9d7a331..5e818727 100755 --- a/plugins/pythonconsole/pythonconsole/console.py +++ b/plugins/pythonconsole/pythonconsole/console.py @@ -21,7 +21,7 @@ # Parts from "Interactive Python-GTK Console" (stolen from epiphany's console.py) # Copyright (C), 1998 James Henstridge <[email protected]> # Copyright (C), 2005 Adam Hooper <[email protected]> -# Bits from gedit Python Console Plugin +# Bits from pluma Python Console Plugin # Copyrignt (C), 2005 Raphaël Slinckx import string diff --git a/plugins/quickopen/Makefile.am b/plugins/quickopen/Makefile.am index 4b5faf00..74cc89a0 100755 --- a/plugins/quickopen/Makefile.am +++ b/plugins/quickopen/Makefile.am @@ -1,11 +1,11 @@ # Quick Open Plugin SUBDIRS = quickopen -plugindir = $(GEDIT_PLUGINS_LIBS_DIR) +plugindir = $(PLUMA_PLUGINS_LIBS_DIR) -plugin_in_files = quickopen.gedit-plugin.desktop.in -%.gedit-plugin: %.gedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache +plugin_in_files = quickopen.pluma-plugin.desktop.in +%.pluma-plugin: %.pluma-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache -plugin_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin) +plugin_DATA = $(plugin_in_files:.pluma-plugin.desktop.in=.pluma-plugin) EXTRA_DIST = $(plugin_in_files) diff --git a/plugins/quickopen/quickopen.gedit-plugin.desktop.in b/plugins/quickopen/quickopen.pluma-plugin.desktop.in index 40f7f040..8f0f4b98 100755 --- a/plugins/quickopen/quickopen.gedit-plugin.desktop.in +++ b/plugins/quickopen/quickopen.pluma-plugin.desktop.in @@ -1,4 +1,4 @@ -[Gedit Plugin] +[Pluma Plugin] Loader=python Module=quickopen IAge=2 @@ -7,4 +7,4 @@ _Description=Quickly open files Icon=gtk-open Authors=Jesse van den Kieboom <[email protected]> Copyright=Copyright © 2009 Jesse van den Kieboom -Website=http://www.gedit.org +Website=http://www.pluma.org diff --git a/plugins/quickopen/quickopen/Makefile.am b/plugins/quickopen/quickopen/Makefile.am index 88882fdf..7d4fa069 100755 --- a/plugins/quickopen/quickopen/Makefile.am +++ b/plugins/quickopen/quickopen/Makefile.am @@ -1,6 +1,6 @@ # Quick Open Plugin -plugindir = $(GEDIT_PLUGINS_LIBS_DIR)/quickopen +plugindir = $(PLUMA_PLUGINS_LIBS_DIR)/quickopen plugin_PYTHON = \ __init__.py \ popup.py \ diff --git a/plugins/quickopen/quickopen/__init__.py b/plugins/quickopen/quickopen/__init__.py index a41c9400..75623a37 100755 --- a/plugins/quickopen/quickopen/__init__.py +++ b/plugins/quickopen/quickopen/__init__.py @@ -17,12 +17,12 @@ # Foundation, Inc., 59 Temple Place, Suite 330, # Boston, MA 02111-1307, USA. -import gedit +import pluma from windowhelper import WindowHelper -class QuickOpenPlugin(gedit.Plugin): +class QuickOpenPlugin(pluma.Plugin): def __init__(self): - gedit.Plugin.__init__(self) + pluma.Plugin.__init__(self) self._popup_size = (450, 300) self._helpers = {} diff --git a/plugins/quickopen/quickopen/popup.py b/plugins/quickopen/quickopen/popup.py index a80caf31..5aa83725 100755 --- a/plugins/quickopen/quickopen/popup.py +++ b/plugins/quickopen/quickopen/popup.py @@ -25,7 +25,7 @@ import gio import pango import glib import fnmatch -import gedit +import pluma import xml.sax.saxutils from virtualdirs import VirtualDirectory @@ -418,7 +418,7 @@ class Popup(gtk.Dialog): uri = self._entry.get_text() gfile = None - if gedit.utils.uri_is_valid(uri): + if pluma.utils.uri_is_valid(uri): gfile = gio.File(uri) elif os.path.isabs(uri): f = gio.File(uri) diff --git a/plugins/quickopen/quickopen/virtualdirs.py b/plugins/quickopen/quickopen/virtualdirs.py index ef0b8dc4..13c5c3a3 100755 --- a/plugins/quickopen/quickopen/virtualdirs.py +++ b/plugins/quickopen/quickopen/virtualdirs.py @@ -65,7 +65,7 @@ class RecentDocumentsDirectory(VirtualDirectory): added = 0 for item in items: - if item.has_group('gedit'): + if item.has_group('pluma'): self.append(gio.File(item.get_uri())) added += 1 diff --git a/plugins/quickopen/quickopen/windowhelper.py b/plugins/quickopen/quickopen/windowhelper.py index 70ea26f0..0d87550e 100755 --- a/plugins/quickopen/quickopen/windowhelper.py +++ b/plugins/quickopen/quickopen/windowhelper.py @@ -17,11 +17,11 @@ # Foundation, Inc., 59 Temple Place, Suite 330, # Boston, MA 02111-1307, USA. -import gedit +import pluma import gtk from popup import Popup import os -import gedit.commands +import pluma.commands import gio import glib from virtualdirs import RecentDocumentsDirectory @@ -64,7 +64,7 @@ class WindowHelper: def _install_menu(self): manager = self._window.get_ui_manager() - self._action_group = gtk.ActionGroup("GeditQuickOpenPluginActions") + self._action_group = gtk.ActionGroup("PlumaQuickOpenPluginActions") self._action_group.add_actions([ ("QuickOpen", gtk.STOCK_OPEN, _("Quick open"), '<Ctrl><Alt>O', _("Quickly open documents"), @@ -88,7 +88,7 @@ class WindowHelper: paths.append(gfile.get_parent()) # File browser root directory - if gedit.version[0] > 2 or (gedit.version[0] == 2 and (gedit.version[1] > 26 or (gedit.version[1] == 26 and gedit.version[2] >= 2))): + if pluma.version[0] > 2 or (pluma.version[0] == 2 and (pluma.version[1] > 26 or (pluma.version[1] == 26 and pluma.version[2] >= 2))): bus = self._window.get_message_bus() try: @@ -192,7 +192,7 @@ class WindowHelper: self._popup = None def on_activated(self, gfile): - gedit.commands.load_uri(self._window, gfile.get_uri(), None, -1) + pluma.commands.load_uri(self._window, gfile.get_uri(), None, -1) return True # ex:ts=8:et: diff --git a/plugins/snippets/Makefile.am b/plugins/snippets/Makefile.am index 06f0009b..7d536d25 100755 --- a/plugins/snippets/Makefile.am +++ b/plugins/snippets/Makefile.am @@ -1,11 +1,11 @@ # Python snippets plugin SUBDIRS = snippets data -plugindir = $(GEDIT_PLUGINS_LIBS_DIR) +plugindir = $(PLUMA_PLUGINS_LIBS_DIR) -plugin_in_files = snippets.gedit-plugin.desktop.in -%.gedit-plugin: %.gedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache +plugin_in_files = snippets.pluma-plugin.desktop.in +%.pluma-plugin: %.pluma-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache -plugin_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin) +plugin_DATA = $(plugin_in_files:.pluma-plugin.desktop.in=.pluma-plugin) EXTRA_DIST = $(plugin_in_files) diff --git a/plugins/snippets/data/Makefile.am b/plugins/snippets/data/Makefile.am index 8ec40419..0859f602 100755 --- a/plugins/snippets/data/Makefile.am +++ b/plugins/snippets/data/Makefile.am @@ -26,7 +26,7 @@ snippets_DATA = \ xml.xml \ xslt.xml -snippetsdir = $(GEDIT_PLUGINS_DATA_DIR)/snippets +snippetsdir = $(PLUMA_PLUGINS_DATA_DIR)/snippets EXTRA_DIST = $(snippets_DATA) diff --git a/plugins/snippets/data/c.xml b/plugins/snippets/data/c.xml index 61171cb8..60188bd3 100755 --- a/plugins/snippets/data/c.xml +++ b/plugins/snippets/data/c.xml @@ -2,7 +2,7 @@ <snippets language="C"> <snippet id="gpl"> <text><![CDATA[/* - * ${1:[$GEDIT_CURRENT_DOCUMENT_NAME,<filename>]} + * ${1:[$PLUMA_CURRENT_DOCUMENT_NAME,<filename>]} * This file is part of ${2:<program name>} * * Copyright (C) $<3: import datetime; return str(datetime.date.today().year)> - $<4: @@ -34,7 +34,7 @@ $0]]></text> </snippet> <snippet id="lgpl"> <text><![CDATA[/* - * ${1:[$GEDIT_CURRENT_DOCUMENT_NAME,<filename>]} + * ${1:[$PLUMA_CURRENT_DOCUMENT_NAME,<filename>]} * This file is part of ${2:<library name>} * * Copyright (C) $<3: import datetime; return str(datetime.date.today().year)> - $<4: diff --git a/plugins/snippets/data/chdr.xml b/plugins/snippets/data/chdr.xml index f71ea901..b88f2274 100755 --- a/plugins/snippets/data/chdr.xml +++ b/plugins/snippets/data/chdr.xml @@ -34,7 +34,7 @@ $0]]></text> </snippet> <snippet id="gpl"> <text><![CDATA[/* - * ${1:[$GEDIT_CURRENT_DOCUMENT_NAME,<filename>]} + * ${1:[$PLUMA_CURRENT_DOCUMENT_NAME,<filename>]} * This file is part of ${2:<program name>} * * Copyright (C) $<3: import datetime; return str(datetime.date.today().year)> - $<4: @@ -66,7 +66,7 @@ $0]]></text> </snippet> <snippet id="lgpl"> <text><![CDATA[/* - * ${1:[$GEDIT_CURRENT_DOCUMENT_NAME,<filename>]} + * ${1:[$PLUMA_CURRENT_DOCUMENT_NAME,<filename>]} * This file is part of ${2:<library name>} * * Copyright (C) $<3: import datetime; return str(datetime.date.today().year)> - $<4: diff --git a/plugins/snippets/data/cpp.xml b/plugins/snippets/data/cpp.xml index 7c7ccabd..e514a3e3 100755 --- a/plugins/snippets/data/cpp.xml +++ b/plugins/snippets/data/cpp.xml @@ -105,7 +105,7 @@ $0]]></text> </snippet> <snippet id="gpl"> <text><![CDATA[/* - * ${1:[$GEDIT_CURRENT_DOCUMENT_NAME,<filename>]} + * ${1:[$PLUMA_CURRENT_DOCUMENT_NAME,<filename>]} * This file is part of ${2:<program name>} * * Copyright (C) $<3: import datetime; return str(datetime.date.today().year)> - $<4: @@ -137,7 +137,7 @@ except KeyError: </snippet> <snippet id="lgpl"> <text><![CDATA[/* - * ${1:[$GEDIT_CURRENT_DOCUMENT_NAME,<filename>]} + * ${1:[$PLUMA_CURRENT_DOCUMENT_NAME,<filename>]} * This file is part of ${2:<library name>} * * Copyright (C) $<3: import datetime; return str(datetime.date.today().year)> - $<4: diff --git a/plugins/snippets/data/docbook.xml b/plugins/snippets/data/docbook.xml index 3159b603..8a96a059 100755 --- a/plugins/snippets/data/docbook.xml +++ b/plugins/snippets/data/docbook.xml @@ -34,13 +34,13 @@ <accelerator/> </snippet> <snippet id="appwrap"> - <text><![CDATA[<application>$GEDIT_SELECTED_TEXT</application>]]></text> + <text><![CDATA[<application>$PLUMA_SELECTED_TEXT</application>]]></text> <tag>application</tag> <description>application tag</description> <accelerator/> </snippet> <snippet id="enclose"> - <text><![CDATA[<${1}>$GEDIT_SELECTED_TEXT</${1}>]]></text> + <text><![CDATA[<${1}>$PLUMA_SELECTED_TEXT</${1}>]]></text> <tag>enclose</tag> <description>enclose selected text</description> <accelerator/> diff --git a/plugins/snippets/data/html.xml b/plugins/snippets/data/html.xml index d294f934..3c35e599 100755 --- a/plugins/snippets/data/html.xml +++ b/plugins/snippets/data/html.xml @@ -54,14 +54,14 @@ $0]]></text> <description>Date</description> </snippet> <snippet id="ref"> - <text><![CDATA[<a href="${1:http://somesite.com/}">${2:$GEDIT_SELECTED_TEXT}</a> + <text><![CDATA[<a href="${1:http://somesite.com/}">${2:$PLUMA_SELECTED_TEXT}</a> ]]></text> <accelerator><![CDATA[<Shift><Alt>l]]></accelerator> <description>Wrap Selection as Link</description> <tag>ref</tag> </snippet> <snippet id="open/close"> - <text><![CDATA[<${1:p}>$GEDIT_SELECTED_TEXT</${1}>]]></text> + <text><![CDATA[<${1:p}>$PLUMA_SELECTED_TEXT</${1}>]]></text> <accelerator><![CDATA[<Shift><Alt>w]]></accelerator> <description>Wrap Selection in Open/Close Tag</description> </snippet> @@ -96,7 +96,7 @@ $0]]></text> </snippet> <snippet id="div"> <text><![CDATA[<div ${1}> - ${0:$GEDIT_SELECTED_TEXT} + ${0:$PLUMA_SELECTED_TEXT} </div>]]></text> <description>Div</description> <tag>div</tag> @@ -117,7 +117,7 @@ $0]]></text> <tag>form</tag> </snippet> <snippet id="h"> - <text><![CDATA[<h${1:1} id="${2}">${3:$GEDIT_SELECTED_TEXT}</h${1}> + <text><![CDATA[<h${1:1} id="${2}">${3:$PLUMA_SELECTED_TEXT}</h${1}> $0]]></text> <description>Heading</description> <tag>h</tag> diff --git a/plugins/snippets/data/java.xml b/plugins/snippets/data/java.xml index 043a5dd3..fce31859 100755 --- a/plugins/snippets/data/java.xml +++ b/plugins/snippets/data/java.xml @@ -69,7 +69,7 @@ $0 </snippet> <snippet id="try/catch"> <text><![CDATA[try { - $GEDIT_SELECTED_TEXT + $PLUMA_SELECTED_TEXT } catch (Exception e) { ${1:e.printStackTrace();} diff --git a/plugins/snippets/data/lang/Makefile.am b/plugins/snippets/data/lang/Makefile.am index 8a497c12..d63e44e6 100755 --- a/plugins/snippets/data/lang/Makefile.am +++ b/plugins/snippets/data/lang/Makefile.am @@ -2,7 +2,7 @@ lang_DATA = \ snippets.lang -langdir = $(GEDIT_PLUGINS_DATA_DIR)/snippets/lang +langdir = $(PLUMA_PLUGINS_DATA_DIR)/snippets/lang EXTRA_DIST = $(lang_DATA) diff --git a/plugins/snippets/data/latex.xml b/plugins/snippets/data/latex.xml index 71672ec8..bfa1934f 100755 --- a/plugins/snippets/data/latex.xml +++ b/plugins/snippets/data/latex.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <snippets language="LaTeX"> <snippet id="command"> - <text><![CDATA[{\\${1:bf} $GEDIT_SELECTED_TEXT}]]></text> + <text><![CDATA[{\\${1:bf} $PLUMA_SELECTED_TEXT}]]></text> <accelerator><![CDATA[<Shift><Alt>w]]></accelerator> <description>Wrap Selection in Command</description> </snippet> diff --git a/plugins/snippets/data/python.xml b/plugins/snippets/data/python.xml index a25617b8..3829c3a0 100755 --- a/plugins/snippets/data/python.xml +++ b/plugins/snippets/data/python.xml @@ -74,12 +74,12 @@ $0]]></text> <description>while loop</description> </snippet> <snippet id="insert"> - <text><![CDATA["${1:$GEDIT_SELECTED_TEXT}"]]></text> + <text><![CDATA["${1:$PLUMA_SELECTED_TEXT}"]]></text> <accelerator><![CDATA[<Control>2]]></accelerator> <description>Inside String: Insert "…"</description> </snippet> <snippet id="insert-1"> - <text><![CDATA['${1:$GEDIT_SELECTED_TEXT}']]></text> + <text><![CDATA['${1:$PLUMA_SELECTED_TEXT}']]></text> <accelerator><![CDATA[<Control>apostrophe]]></accelerator> <description>Inside String: Insert '…'</description> </snippet> diff --git a/plugins/snippets/data/snippets.xml b/plugins/snippets/data/snippets.xml index ee405e6d..2718461b 100755 --- a/plugins/snippets/data/snippets.xml +++ b/plugins/snippets/data/snippets.xml @@ -26,73 +26,73 @@ <tag>regex</tag> </snippet> <snippet id="$-CURRENT_DOCUMENT_PATH"> - <text><![CDATA[\$GEDIT_CURRENT_DOCUMENT_PATH]]></text> - <description>Gedit Current Document Path Variable</description> + <text><![CDATA[\$PLUMA_CURRENT_DOCUMENT_PATH]]></text> + <description>Pluma Current Document Path Variable</description> <tag>$</tag> </snippet> <snippet id="$-CURRENT_DOCUMENT_NAME"> - <text><![CDATA[\$GEDIT_CURRENT_DOCUMENT_NAME]]></text> - <description>Gedit Current Document Name Variable</description> + <text><![CDATA[\$PLUMA_CURRENT_DOCUMENT_NAME]]></text> + <description>Pluma Current Document Name Variable</description> <tag>$</tag> </snippet> <snippet id="$-CURRENT_DOCUMENT_URI"> - <text><![CDATA[\$GEDIT_CURRENT_DOCUMENT_URI]]></text> - <description>Gedit Current Document Uri Variable</description> + <text><![CDATA[\$PLUMA_CURRENT_DOCUMENT_URI]]></text> + <description>Pluma Current Document Uri Variable</description> <tag>$</tag> </snippet> <snippet id="$-CURRENT_DOCUMENT_SCHEME"> - <text><![CDATA[\$GEDIT_CURRENT_DOCUMENT_SCHEME]]></text> - <description>Gedit Current Document Scheme Variable</description> + <text><![CDATA[\$PLUMA_CURRENT_DOCUMENT_SCHEME]]></text> + <description>Pluma Current Document Scheme Variable</description> <tag>$</tag> </snippet> <snippet id="$-CURRENT_DOCUMENT_TYPE"> - <text><![CDATA[\$GEDIT_CURRENT_DOCUMENT_TYPE]]></text> - <description>Gedit Current Document Type Variable</description> + <text><![CDATA[\$PLUMA_CURRENT_DOCUMENT_TYPE]]></text> + <description>Pluma Current Document Type Variable</description> <tag>$</tag> </snippet> <snippet id="$-DOCUMENTS_URI"> - <text><![CDATA[\$GEDIT_DOCUMENTS_URI]]></text> - <description>Gedit Documents Uri Variable</description> + <text><![CDATA[\$PLUMA_DOCUMENTS_URI]]></text> + <description>Pluma Documents Uri Variable</description> <tag>$</tag> </snippet> <snippet id="$-DOCUMENTS_PATH"> - <text><![CDATA[\$GEDIT_DOCUMENTS_PATH]]></text> - <description>Gedit Documents Path Variable</description> + <text><![CDATA[\$PLUMA_DOCUMENTS_PATH]]></text> + <description>Pluma Documents Path Variable</description> <tag>$</tag> </snippet> <snippet id="$-SELECTED_TEXT"> - <text><![CDATA[\$GEDIT_SELECTED_TEXT]]></text> - <description>Gedit Selected Text Variable</description> + <text><![CDATA[\$PLUMA_SELECTED_TEXT]]></text> + <description>Pluma Selected Text Variable</description> <tag>$</tag> </snippet> <snippet id="$-CURRENT_WORD"> - <text><![CDATA[\$GEDIT_CURRENT_WORD]]></text> - <description>Gedit Current Word Variable</description> + <text><![CDATA[\$PLUMA_CURRENT_WORD]]></text> + <description>Pluma Current Word Variable</description> <tag>$</tag> </snippet> <snippet id="$-CURRENT_LINE"> - <text><![CDATA[\$GEDIT_CURRENT_LINE]]></text> - <description>Gedit Current Line Variable</description> + <text><![CDATA[\$PLUMA_CURRENT_LINE]]></text> + <description>Pluma Current Line Variable</description> <tag>$</tag> </snippet> <snippet id="$-CURRENT_LINE_NUMBER"> - <text><![CDATA[\$GEDIT_CURRENT_LINE_NUMBER]]></text> - <description>Gedit Current Line Number Variable</description> + <text><![CDATA[\$PLUMA_CURRENT_LINE_NUMBER]]></text> + <description>Pluma Current Line Number Variable</description> <tag>$</tag> </snippet> <snippet id="$-DROP_FILENAME"> - <text><![CDATA[\$GEDIT_DROP_FILENAME]]></text> - <description>Gedit Drop Filename Variable</description> + <text><![CDATA[\$PLUMA_DROP_FILENAME]]></text> + <description>Pluma Drop Filename Variable</description> <tag>$</tag> </snippet> <snippet id="$-DROP_REL_FILENAME"> - <text><![CDATA[\$GEDIT_DROP_REL_FILENAME]]></text> - <description>Gedit Drop Relative Filename Variable</description> + <text><![CDATA[\$PLUMA_DROP_REL_FILENAME]]></text> + <description>Pluma Drop Relative Filename Variable</description> <tag>$</tag> </snippet> <snippet id="$-DROP_MIME_TYPE"> - <text><![CDATA[\$GEDIT_DROP_MIME_TYPE]]></text> - <description>Gedit Drop Mime Type Variable</description> + <text><![CDATA[\$PLUMA_DROP_MIME_TYPE]]></text> + <description>Pluma Drop Mime Type Variable</description> <tag>$</tag> </snippet> </snippets> diff --git a/plugins/snippets/data/xslt.xml b/plugins/snippets/data/xslt.xml index 0ff5cc15..9a470b18 100755 --- a/plugins/snippets/data/xslt.xml +++ b/plugins/snippets/data/xslt.xml @@ -103,13 +103,13 @@ $0]]></text> <tag>attr</tag> </snippet> <snippet id="text"> - <text><![CDATA[<xsl:text>${1:$GEDIT_SELECTED_TEXT}</xsl:text> + <text><![CDATA[<xsl:text>${1:$PLUMA_SELECTED_TEXT}</xsl:text> ]]></text> <description>Text</description> <tag>text</tag> </snippet> <snippet id="comment"> - <text><![CDATA[<xsl:comment>${1:$GEDIT_SELECTED_TEXT}</xsl:comment> + <text><![CDATA[<xsl:comment>${1:$PLUMA_SELECTED_TEXT}</xsl:comment> ]]></text> <description>Comment</description> <tag>comment</tag> diff --git a/plugins/snippets/snippets.gedit-plugin.desktop.in b/plugins/snippets/snippets.pluma-plugin.desktop.in index dc3c8281..4813fe7d 100755 --- a/plugins/snippets/snippets.gedit-plugin.desktop.in +++ b/plugins/snippets/snippets.pluma-plugin.desktop.in @@ -1,4 +1,4 @@ -[Gedit Plugin] +[Pluma Plugin] Loader=python Module=snippets IAge=2 @@ -6,4 +6,4 @@ _Name=Snippets _Description=Insert often-used pieces of text in a fast way Authors=Jesse van den Kieboom <[email protected]> Copyright=Copyright © 2005 Jesse van den Kieboom -Website=http://www.gedit.org +Website=http://www.pluma.org diff --git a/plugins/snippets/snippets/Completion.py b/plugins/snippets/snippets/Completion.py index d83915a5..4f24150c 100755 --- a/plugins/snippets/snippets/Completion.py +++ b/plugins/snippets/snippets/Completion.py @@ -1,6 +1,6 @@ import gtksourceview2 as gsv import gobject -import gedit +import pluma import gtk from Library import Library @@ -102,7 +102,7 @@ class Provider(gobject.GObject, gsv.CompletionProvider): def do_get_info_widget(self, proposal): if not self.info_widget: - view = gedit.View(gedit.Document()) + view = pluma.View(pluma.Document()) manager = get_language_manager() lang = manager.get_language('snippets') diff --git a/plugins/snippets/snippets/Document.py b/plugins/snippets/snippets/Document.py index da166668..368e0f5c 100755 --- a/plugins/snippets/snippets/Document.py +++ b/plugins/snippets/snippets/Document.py @@ -1,4 +1,4 @@ -# Gedit snippets plugin +# Pluma snippets plugin # Copyright (C) 2005-2006 Jesse van den Kieboom <[email protected]> # # This program is free software; you can redistribute it and/or modify @@ -21,7 +21,7 @@ import re import gtk from gtk import gdk import gio -import gedit +import pluma import gtksourceview2 as gsv import gobject @@ -433,7 +433,7 @@ class Document: def env_get_documents_uri(self, buf): toplevel = self.view.get_toplevel() - if isinstance(toplevel, gedit.Window): + if isinstance(toplevel, pluma.Window): documents_uri = [doc.get_location().get_uri() for doc in toplevel.get_documents() if doc.get_location() is not None] @@ -445,14 +445,14 @@ class Document: def env_get_documents_path(self, buf): toplevel = self.view.get_toplevel() - if isinstance(toplevel, gedit.Window): + if isinstance(toplevel, pluma.Window): documents_location = [doc.get_location() for doc in toplevel.get_documents() if doc.get_location() is not None] documents_path = [location.get_path() for location in documents_location - if gedit.utils.uri_has_file_scheme(location.get_uri())] + if pluma.utils.uri_has_file_scheme(location.get_uri())] else: documents_path = [] @@ -461,25 +461,25 @@ class Document: def update_environment(self): buf = self.view.get_buffer() - variables = {'GEDIT_SELECTED_TEXT': self.env_get_selected_text, - 'GEDIT_CURRENT_WORD': self.env_get_current_word, - 'GEDIT_CURRENT_LINE': self.env_get_current_line, - 'GEDIT_CURRENT_LINE_NUMBER': self.env_get_current_line_number, - 'GEDIT_CURRENT_DOCUMENT_URI': self.env_get_document_uri, - 'GEDIT_CURRENT_DOCUMENT_NAME': self.env_get_document_name, - 'GEDIT_CURRENT_DOCUMENT_SCHEME': self.env_get_document_scheme, - 'GEDIT_CURRENT_DOCUMENT_PATH': self.env_get_document_path, - 'GEDIT_CURRENT_DOCUMENT_DIR': self.env_get_document_dir, - 'GEDIT_CURRENT_DOCUMENT_TYPE': self.env_get_document_type, - 'GEDIT_DOCUMENTS_URI': self.env_get_documents_uri, - 'GEDIT_DOCUMENTS_PATH': self.env_get_documents_path, + variables = {'PLUMA_SELECTED_TEXT': self.env_get_selected_text, + 'PLUMA_CURRENT_WORD': self.env_get_current_word, + 'PLUMA_CURRENT_LINE': self.env_get_current_line, + 'PLUMA_CURRENT_LINE_NUMBER': self.env_get_current_line_number, + 'PLUMA_CURRENT_DOCUMENT_URI': self.env_get_document_uri, + 'PLUMA_CURRENT_DOCUMENT_NAME': self.env_get_document_name, + 'PLUMA_CURRENT_DOCUMENT_SCHEME': self.env_get_document_scheme, + 'PLUMA_CURRENT_DOCUMENT_PATH': self.env_get_document_path, + 'PLUMA_CURRENT_DOCUMENT_DIR': self.env_get_document_dir, + 'PLUMA_CURRENT_DOCUMENT_TYPE': self.env_get_document_type, + 'PLUMA_DOCUMENTS_URI': self.env_get_documents_uri, + 'PLUMA_DOCUMENTS_PATH': self.env_get_documents_path, } for var in variables: os.environ[var] = variables[var](buf) def uses_current_word(self, snippet): - matches = re.findall('(\\\\*)\\$GEDIT_CURRENT_WORD', snippet['text']) + matches = re.findall('(\\\\*)\\$PLUMA_CURRENT_WORD', snippet['text']) for match in matches: if len(match) % 2 == 0: @@ -488,7 +488,7 @@ class Document: return False def uses_current_line(self, snippet): - matches = re.findall('(\\\\*)\\$GEDIT_CURRENT_LINE', snippet['text']) + matches = re.findall('(\\\\*)\\$PLUMA_CURRENT_LINE', snippet['text']) for match in matches: if len(match) % 2 == 0: @@ -865,19 +865,19 @@ class Document: dirname = '' ruri = '' - if gedit.utils.uri_has_file_scheme(uri): + if pluma.utils.uri_has_file_scheme(uri): pathname = gfile.get_path() dirname = gfile.get_parent().get_path() name = os.path.basename(uri) scheme = gfile.get_uri_scheme() - os.environ['GEDIT_DROP_DOCUMENT_URI'] = uri - os.environ['GEDIT_DROP_DOCUMENT_NAME'] = name - os.environ['GEDIT_DROP_DOCUMENT_SCHEME'] = scheme - os.environ['GEDIT_DROP_DOCUMENT_PATH'] = pathname - os.environ['GEDIT_DROP_DOCUMENT_DIR'] = dirname - os.environ['GEDIT_DROP_DOCUMENT_TYPE'] = mime + os.environ['PLUMA_DROP_DOCUMENT_URI'] = uri + os.environ['PLUMA_DROP_DOCUMENT_NAME'] = name + os.environ['PLUMA_DROP_DOCUMENT_SCHEME'] = scheme + os.environ['PLUMA_DROP_DOCUMENT_PATH'] = pathname + os.environ['PLUMA_DROP_DOCUMENT_DIR'] = dirname + os.environ['PLUMA_DROP_DOCUMENT_TYPE'] = mime buf = self.view.get_buffer() location = buf.get_location() @@ -886,7 +886,7 @@ class Document: relpath = self.relative_path(ruri, uri, mime) - os.environ['GEDIT_DROP_DOCUMENT_RELATIVE_PATH'] = relpath + os.environ['PLUMA_DROP_DOCUMENT_RELATIVE_PATH'] = relpath mark = buf.get_mark('gtk_drag_target') diff --git a/plugins/snippets/snippets/Helper.py b/plugins/snippets/snippets/Helper.py index de363360..60ae1c79 100755 --- a/plugins/snippets/snippets/Helper.py +++ b/plugins/snippets/snippets/Helper.py @@ -1,4 +1,4 @@ -# Gedit snippets plugin +# Pluma snippets plugin # Copyright (C) 2005-2006 Jesse van den Kieboom <[email protected]> # # This program is free software; you can redistribute it and/or modify @@ -62,7 +62,7 @@ def insert_with_indent(view, piter, text, indentfirst = True, context = None): text = spaces_instead_of_tabs(view, text) lines = text.split('\n') - view.get_buffer().set_data('GeditSnippetsPluginContext', context) + view.get_buffer().set_data('PlumaSnippetsPluginContext', context) if len(lines) == 1: view.get_buffer().insert(piter, text) @@ -79,10 +79,10 @@ def insert_with_indent(view, piter, text, indentfirst = True, context = None): view.get_buffer().insert(piter, text[:-1]) - view.get_buffer().set_data('GeditSnippetsPluginContext', None) + view.get_buffer().set_data('PlumaSnippetsPluginContext', None) def get_buffer_context(buf): - return buf.get_data('GeditSnippetsPluginContext') + return buf.get_data('PlumaSnippetsPluginContext') def snippets_debug(*s): return diff --git a/plugins/snippets/snippets/Library.py b/plugins/snippets/snippets/Library.py index 4717280c..792f0f7e 100755 --- a/plugins/snippets/snippets/Library.py +++ b/plugins/snippets/snippets/Library.py @@ -1,4 +1,4 @@ -# Gedit snippets plugin +# Pluma snippets plugin # Copyright (C) 2005-2006 Jesse van den Kieboom <[email protected]> # # This program is free software; you can redistribute it and/or modify diff --git a/plugins/snippets/snippets/Makefile.am b/plugins/snippets/snippets/Makefile.am index 7a05b562..086b5968 100755 --- a/plugins/snippets/snippets/Makefile.am +++ b/plugins/snippets/snippets/Makefile.am @@ -1,5 +1,5 @@ # Python snippets plugin -plugindir = $(GEDIT_PLUGINS_LIBS_DIR)/snippets +plugindir = $(PLUMA_PLUGINS_LIBS_DIR)/snippets plugin_PYTHON = \ __init__.py \ @@ -17,7 +17,7 @@ plugin_PYTHON = \ LanguageManager.py \ Completion.py -uidir = $(GEDIT_PLUGINS_DATA_DIR)/snippets/ui +uidir = $(PLUMA_PLUGINS_DATA_DIR)/snippets/ui ui_DATA = snippets.ui EXTRA_DIST = $(ui_DATA) diff --git a/plugins/snippets/snippets/Manager.py b/plugins/snippets/snippets/Manager.py index 16acbdb4..96220c6e 100755 --- a/plugins/snippets/snippets/Manager.py +++ b/plugins/snippets/snippets/Manager.py @@ -1,4 +1,4 @@ -# Gedit snippets plugin +# Pluma snippets plugin # Copyright (C) 2005-2006 Jesse van den Kieboom <[email protected]> # # This program is free software; you can redistribute it and/or modify @@ -24,7 +24,7 @@ import gtk from gtk import gdk import gtksourceview2 as gsv import pango -import gedit +import pluma import gio from Snippet import Snippet @@ -95,7 +95,7 @@ class Manager: self.tree_view.expand_row(path, False) def build_model(self, force_reload = False): - window = gedit.app_get_default().get_active_window() + window = pluma.app_get_default().get_active_window() if window: view = window.get_active_view() @@ -116,7 +116,7 @@ class Manager: self.model = gtk.TreeStore(str, str, object) self.model.set_sort_column_id(self.SORT_COLUMN, gtk.SORT_ASCENDING) manager = get_language_manager() - langs = gedit.language_manager_list_languages_sorted(manager, True) + langs = pluma.language_manager_list_languages_sorted(manager, True) piter = self.model.append(None, (_('Global'), '', None)) # Add dummy node @@ -618,7 +618,7 @@ class Manager: def on_dialog_snippets_response(self, dlg, resp): if resp == gtk.RESPONSE_HELP: - gedit.help_display(self.dlg, 'gedit', 'gedit-snippets-plugin') + pluma.help_display(self.dlg, 'pluma', 'pluma-snippets-plugin') return self.dlg.destroy() @@ -765,7 +765,7 @@ class Manager: success = True for filename in filenames: - if not gedit.utils.uri_has_file_scheme(filename): + if not pluma.utils.uri_has_file_scheme(filename): continue # Remove file:// diff --git a/plugins/snippets/snippets/Parser.py b/plugins/snippets/snippets/Parser.py index 3bbaf6e7..0c638df7 100755 --- a/plugins/snippets/snippets/Parser.py +++ b/plugins/snippets/snippets/Parser.py @@ -1,4 +1,4 @@ -# Gedit snippets plugin +# Pluma snippets plugin # Copyright (C) 2006-2007 Jesse van den Kieboom <[email protected]> # # This program is free software; you can redistribute it and/or modify diff --git a/plugins/snippets/snippets/Placeholder.py b/plugins/snippets/snippets/Placeholder.py index c43eecac..45b5b508 100755 --- a/plugins/snippets/snippets/Placeholder.py +++ b/plugins/snippets/snippets/Placeholder.py @@ -1,4 +1,4 @@ -# Gedit snippets plugin +# Pluma snippets plugin # Copyright (C) 2005-2006 Jesse van den Kieboom <[email protected]> # # This program is free software; you can redistribute it and/or modify @@ -524,7 +524,7 @@ class PlaceholderEval(PlaceholderExpand): # SIGALRM is not supported on all platforms (e.g. windows). Timeout # with SIGALRM will not be used on those platforms. This will - # potentially block gedit if you have a placeholder which gets stuck, + # potentially block pluma if you have a placeholder which gets stuck, # but it's better than not supporting them at all. At some point we # might have proper thread support and we can fix this in a better way def timeout_supported(self): @@ -577,9 +577,9 @@ class PlaceholderEval(PlaceholderExpand): if 'process_snippet' in self.namespace: try: # Install a sigalarm signal. This is a HACK to make sure - # gedit doesn't get freezed by someone creating a python + # pluma doesn't get freezed by someone creating a python # placeholder which for instance loops indefinately. Since - # the code is executed synchronously it will hang gedit. With + # the code is executed synchronously it will hang pluma. With # the alarm signal we raise an exception and catch this # (see below). We show an error message and return False. # ___this is a HACK___ and should be fixed properly (I just diff --git a/plugins/snippets/snippets/Snippet.py b/plugins/snippets/snippets/Snippet.py index d7baead5..ae81fcfc 100755 --- a/plugins/snippets/snippets/Snippet.py +++ b/plugins/snippets/snippets/Snippet.py @@ -1,4 +1,4 @@ -# Gedit snippets plugin +# Pluma snippets plugin # Copyright (C) 2005-2006 Jesse van den Kieboom <[email protected]> # # This program is free software; you can redistribute it and/or modify diff --git a/plugins/snippets/snippets/SubstitutionParser.py b/plugins/snippets/snippets/SubstitutionParser.py index 6522222b..a41f5a6a 100755 --- a/plugins/snippets/snippets/SubstitutionParser.py +++ b/plugins/snippets/snippets/SubstitutionParser.py @@ -1,4 +1,4 @@ -# Gedit snippets plugin +# Pluma snippets plugin # Copyright (C) 2006-2007 Jesse van den Kieboom <[email protected]> # # This program is free software; you can redistribute it and/or modify diff --git a/plugins/snippets/snippets/WindowHelper.py b/plugins/snippets/snippets/WindowHelper.py index 29bf3a58..a5f238ae 100755 --- a/plugins/snippets/snippets/WindowHelper.py +++ b/plugins/snippets/snippets/WindowHelper.py @@ -1,4 +1,4 @@ -# Gedit snippets plugin +# Pluma snippets plugin # Copyright (C) 2005-2006 Jesse van den Kieboom <[email protected]> # # This program is free software; you can redistribute it and/or modify @@ -21,7 +21,7 @@ import gettext import gtk from gtk import gdk -import gedit +import pluma from Document import Document from Library import Library @@ -46,7 +46,7 @@ class WindowHelper: # Add controllers to all the current views for view in self.window.get_views(): - if isinstance(view, gedit.View) and not self.has_controller(view): + if isinstance(view, pluma.View) and not self.has_controller(view): view._snippet_controller = Document(self, view) self.update() @@ -61,7 +61,7 @@ class WindowHelper: # Iterate over all the tabs and remove every controller for view in self.window.get_views(): - if isinstance(view, gedit.View) and self.has_controller(view): + if isinstance(view, pluma.View) and self.has_controller(view): view._snippet_controller.stop() view._snippet_controller = None @@ -72,8 +72,8 @@ class WindowHelper: bus = self.window.get_message_bus() self.messages = { - 'activate': bus.register('/plugins/snippets', 'activate', ('view', 'iter'), trigger=str, view=gedit.View, iter=gtk.TextIter), - 'parse-and-activate': bus.register('/plugins/snippets', 'parse-and-activate', ('view', 'iter'), snippet=str, view=gedit.View, iter=gtk.TextIter) + 'activate': bus.register('/plugins/snippets', 'activate', ('view', 'iter'), trigger=str, view=pluma.View, iter=gtk.TextIter), + 'parse-and-activate': bus.register('/plugins/snippets', 'parse-and-activate', ('view', 'iter'), snippet=str, view=pluma.View, iter=gtk.TextIter) } bus.connect('/plugins/snippets', 'activate', self.on_message_activate) @@ -124,8 +124,8 @@ class WindowHelper: def insert_menu(self): manager = self.window.get_ui_manager() - self.action_group = gtk.ActionGroup("GeditSnippetPluginActions") - self.action_group.set_translation_domain('gedit') + self.action_group = gtk.ActionGroup("PlumaSnippetPluginActions") + self.action_group.set_translation_domain('pluma') self.action_group.add_actions([('ManageSnippets', None, _('Manage _Snippets...'), \ None, _('Manage snippets'), \ @@ -192,10 +192,10 @@ class WindowHelper: # Callbacks def on_tab_added(self, window, tab): - # Create a new controller for this tab if it has a standard gedit view + # Create a new controller for this tab if it has a standard pluma view view = tab.get_view() - if isinstance(view, gedit.View) and not self.has_controller(view): + if isinstance(view, pluma.View) and not self.has_controller(view): view._snippet_controller = Document(self, view) self.update() diff --git a/plugins/snippets/snippets/__init__.py b/plugins/snippets/snippets/__init__.py index b21da508..609e3c0c 100755 --- a/plugins/snippets/snippets/__init__.py +++ b/plugins/snippets/snippets/__init__.py @@ -1,4 +1,4 @@ -# Gedit snippets plugin +# Pluma snippets plugin # Copyright (C) 2005-2006 Jesse van den Kieboom <[email protected]> # # This program is free software; you can redistribute it and/or modify @@ -21,7 +21,7 @@ import shutil import gtk from gtk import gdk -import gedit +import pluma import platform from WindowHelper import WindowHelper @@ -29,9 +29,9 @@ from Library import Library from Manager import Manager from Snippet import Snippet -class SnippetsPlugin(gedit.Plugin): +class SnippetsPlugin(pluma.Plugin): def __init__(self): - gedit.Plugin.__init__(self) + pluma.Plugin.__init__(self) self.dlg = None @@ -39,13 +39,13 @@ class SnippetsPlugin(gedit.Plugin): library.set_accelerator_callback(self.accelerator_activated) if platform.platform() == 'Windows': - snippetsdir = os.path.expanduser('~/gedit/snippets') + snippetsdir = os.path.expanduser('~/pluma/snippets') else: userdir = os.getenv('MATE22_USER_DIR') if userdir: - snippetsdir = os.path.join(userdir, 'gedit/snippets') + snippetsdir = os.path.join(userdir, 'pluma/snippets') else: - snippetsdir = os.path.expanduser('~/.mate2/gedit/snippets') + snippetsdir = os.path.expanduser('~/.mate2/pluma/snippets') library.set_dirs(snippetsdir, self.system_dirs()) @@ -59,7 +59,7 @@ class SnippetsPlugin(gedit.Plugin): dirs = [] for d in datadirs.split(os.pathsep): - d = os.path.join(d, 'gedit-2', 'plugins', 'snippets') + d = os.path.join(d, 'pluma-2', 'plugins', 'snippets') if os.path.isdir(d): dirs.append(d) @@ -85,7 +85,7 @@ class SnippetsPlugin(gedit.Plugin): else: self.dlg.run() - window = gedit.app_get_default().get_active_window() + window = pluma.app_get_default().get_active_window() if window: self.dlg.dlg.set_transient_for(window) diff --git a/plugins/snippets/snippets/snippets.ui b/plugins/snippets/snippets/snippets.ui index 426df886..b90324c2 100755 --- a/plugins/snippets/snippets/snippets.ui +++ b/plugins/snippets/snippets/snippets.ui @@ -32,7 +32,7 @@ </row> </data> </object> - <object class="GeditDocument" id="source_buffer"> + <object class="PlumaDocument" id="source_buffer"> <property name="highlight-matching-brackets">True</property> </object> <object class="GtkDialog" id="dialog_snippets"> @@ -331,7 +331,7 @@ <property name="shadow_type">GTK_SHADOW_IN</property> <property name="window_placement">GTK_CORNER_TOP_LEFT</property> <child> - <object class="GeditView" id="source_view_snippet"> + <object class="PlumaView" id="source_view_snippet"> <property name="buffer">source_buffer</property> <property name="visible">True</property> <property name="auto-indent">True</property> diff --git a/plugins/sort/Makefile.am b/plugins/sort/Makefile.am index 8fa39143..52274688 100755 --- a/plugins/sort/Makefile.am +++ b/plugins/sort/Makefile.am @@ -1,29 +1,29 @@ # sort plugin -plugindir = $(GEDIT_PLUGINS_LIBS_DIR) +plugindir = $(PLUMA_PLUGINS_LIBS_DIR) INCLUDES = \ -I$(top_srcdir) \ - $(GEDIT_CFLAGS) \ + $(PLUMA_CFLAGS) \ $(WARN_CFLAGS) \ $(DISABLE_DEPRECATED_CFLAGS) plugin_LTLIBRARIES = libsort.la libsort_la_SOURCES = \ - gedit-sort-plugin.h \ - gedit-sort-plugin.c + pluma-sort-plugin.h \ + pluma-sort-plugin.c libsort_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS) -libsort_la_LIBADD = $(GEDIT_LIBS) +libsort_la_LIBADD = $(PLUMA_LIBS) -uidir = $(GEDIT_PLUGINS_DATA_DIR)/sort +uidir = $(PLUMA_PLUGINS_DATA_DIR)/sort ui_DATA = sort.ui -plugin_in_files = sort.gedit-plugin.desktop.in +plugin_in_files = sort.pluma-plugin.desktop.in -%.gedit-plugin: %.gedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache +%.pluma-plugin: %.pluma-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache -plugin_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin) +plugin_DATA = $(plugin_in_files:.pluma-plugin.desktop.in=.pluma-plugin) EXTRA_DIST = $(ui_DATA) $(plugin_in_files) diff --git a/plugins/sort/gedit-sort-plugin.h b/plugins/sort/gedit-sort-plugin.h deleted file mode 100755 index c10280bf..00000000 --- a/plugins/sort/gedit-sort-plugin.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * gedit-sort-plugin.h - * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - */ - -#ifndef __GEDIT_SORT_PLUGIN_H__ -#define __GEDIT_SORT_PLUGIN_H__ - -#include <glib.h> -#include <glib-object.h> -#include <gedit/gedit-plugin.h> - -G_BEGIN_DECLS - -/* - * Type checking and casting macros - */ -#define GEDIT_TYPE_SORT_PLUGIN (gedit_sort_plugin_get_type ()) -#define GEDIT_SORT_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GEDIT_TYPE_SORT_PLUGIN, GeditSortPlugin)) -#define GEDIT_SORT_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GEDIT_TYPE_SORT_PLUGIN, GeditSortPluginClass)) -#define GEDIT_IS_SORT_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GEDIT_TYPE_SORT_PLUGIN)) -#define GEDIT_IS_SORT_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GEDIT_TYPE_SORT_PLUGIN)) -#define GEDIT_SORT_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GEDIT_TYPE_SORT_PLUGIN, GeditSortPluginClass)) - -/* Private structure type */ -typedef struct _GeditSortPluginPrivate GeditSortPluginPrivate; - -/* - * Main object structure - */ -typedef struct _GeditSortPlugin GeditSortPlugin; - -struct _GeditSortPlugin -{ - GeditPlugin parent_instance; -}; - -/* - * Class definition - */ -typedef struct _GeditSortPluginClass GeditSortPluginClass; - -struct _GeditSortPluginClass -{ - GeditPluginClass parent_class; -}; - -/* - * Public methods - */ -GType gedit_sort_plugin_get_type (void) G_GNUC_CONST; - -/* All the plugins must implement this function */ -G_MODULE_EXPORT GType register_gedit_plugin (GTypeModule *module); - -G_END_DECLS - -#endif /* __GEDIT_SORT_PLUGIN_H__ */ diff --git a/plugins/sort/gedit-sort-plugin.c b/plugins/sort/pluma-sort-plugin.c index 8fc6c959..e1e5cf5e 100755 --- a/plugins/sort/gedit-sort-plugin.c +++ b/plugins/sort/pluma-sort-plugin.c @@ -1,8 +1,8 @@ /* - * gedit-sort-plugin.c + * pluma-sort-plugin.c * * Original author: Carlo Borreo <[email protected]> - * Ported to Gedit2 by Lee Mallabone <[email protected]> + * Ported to Pluma2 by Lee Mallabone <[email protected]> * * 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 @@ -25,25 +25,25 @@ #include <config.h> #endif -#include "gedit-sort-plugin.h" +#include "pluma-sort-plugin.h" #include <string.h> #include <glib/gi18n-lib.h> #include <gmodule.h> -#include <gedit/gedit-debug.h> -#include <gedit/gedit-utils.h> -#include <gedit/gedit-help.h> +#include <pluma/pluma-debug.h> +#include <pluma/pluma-utils.h> +#include <pluma/pluma-help.h> -#define GEDIT_SORT_PLUGIN_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GEDIT_TYPE_SORT_PLUGIN, GeditSortPluginPrivate)) +#define PLUMA_SORT_PLUGIN_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), PLUMA_TYPE_SORT_PLUGIN, PlumaSortPluginPrivate)) /* Key in case the plugin ever needs any settings. */ -#define SORT_BASE_KEY "/apps/gedit-2/plugins/sort" +#define SORT_BASE_KEY "/apps/pluma-2/plugins/sort" -#define WINDOW_DATA_KEY "GeditSortPluginWindowData" +#define WINDOW_DATA_KEY "PlumaSortPluginWindowData" #define MENU_PATH "/MenuBar/EditMenu/EditOps_6" -GEDIT_PLUGIN_REGISTER_TYPE(GeditSortPlugin, gedit_sort_plugin) +PLUMA_PLUGIN_REGISTER_TYPE(PlumaSortPlugin, pluma_sort_plugin) typedef struct { @@ -53,7 +53,7 @@ typedef struct GtkWidget *ignore_case_checkbutton; GtkWidget *remove_dups_checkbutton; - GeditDocument *doc; + PlumaDocument *doc; GtkTextIter start, end; /* selection */ } SortDialog; @@ -66,8 +66,8 @@ typedef struct typedef struct { - GeditPlugin *plugin; - GeditWindow *window; + PlumaPlugin *plugin; + PlumaWindow *window; } ActionData; typedef struct @@ -95,7 +95,7 @@ static void sort_dialog_destroy (GtkObject *obj, gpointer dialog_pointer) { - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); g_slice_free (SortDialog, dialog_pointer); } @@ -105,7 +105,7 @@ sort_dialog_response_handler (GtkDialog *widget, gint res_id, SortDialog *dialog) { - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); switch (res_id) { @@ -115,9 +115,9 @@ sort_dialog_response_handler (GtkDialog *widget, break; case GTK_RESPONSE_HELP: - gedit_help_display (GTK_WINDOW (widget), + pluma_help_display (GTK_WINDOW (widget), NULL, - "gedit-sort-plugin"); + "pluma-sort-plugin"); break; case GTK_RESPONSE_CANCEL: @@ -130,13 +130,13 @@ sort_dialog_response_handler (GtkDialog *widget, * the text field (like the combo box) looses the documnent selection. * Storing the selection ONLY works because the dialog is modal */ static void -get_current_selection (GeditWindow *window, SortDialog *dialog) +get_current_selection (PlumaWindow *window, SortDialog *dialog) { - GeditDocument *doc; + PlumaDocument *doc; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); - doc = gedit_window_get_active_document (window); + doc = pluma_window_get_active_document (window); if (!gtk_text_buffer_get_selection_bounds (GTK_TEXT_BUFFER (doc), &dialog->start, @@ -158,14 +158,14 @@ get_sort_dialog (ActionData *action_data) gchar *data_dir; gchar *ui_file; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); dialog = g_slice_new (SortDialog); - data_dir = gedit_plugin_get_data_dir (action_data->plugin); + data_dir = pluma_plugin_get_data_dir (action_data->plugin); ui_file = g_build_filename (data_dir, "sort.ui", NULL); g_free (data_dir); - ret = gedit_utils_get_ui_objects (ui_file, + ret = pluma_utils_get_ui_objects (ui_file, NULL, &error_widget, "sort_dialog", &dialog->dialog, @@ -181,7 +181,7 @@ get_sort_dialog (ActionData *action_data) const gchar *err_message; err_message = gtk_label_get_label (GTK_LABEL (error_widget)); - gedit_warning (GTK_WINDOW (action_data->window), + pluma_warning (GTK_WINDOW (action_data->window), "%s", err_message); g_free (dialog); @@ -212,19 +212,19 @@ static void sort_cb (GtkAction *action, ActionData *action_data) { - GeditDocument *doc; + PlumaDocument *doc; GtkWindowGroup *wg; SortDialog *dialog; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); - doc = gedit_window_get_active_document (action_data->window); + doc = pluma_window_get_active_document (action_data->window); g_return_if_fail (doc != NULL); dialog = get_sort_dialog (action_data); g_return_if_fail (dialog != NULL); - wg = gedit_window_get_group (action_data->window); + wg = pluma_window_get_group (action_data->window); gtk_window_group_add_window (wg, GTK_WINDOW (dialog->dialog)); @@ -253,7 +253,7 @@ compare_algorithm (gconstpointer s1, gchar *key1, *key2; SortInfo *sort_info; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); sort_info = (SortInfo *) data; g_return_val_if_fail (sort_info != NULL, -1); @@ -350,7 +350,7 @@ get_line_slice (GtkTextBuffer *buf, static void sort_real (SortDialog *dialog) { - GeditDocument *doc; + PlumaDocument *doc; GtkTextIter start, end; gint start_line, end_line; gint i; @@ -359,7 +359,7 @@ sort_real (SortDialog *dialog) gchar **lines; SortInfo *sort_info; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); doc = dialog->doc; g_return_if_fail (doc != NULL); @@ -386,7 +386,7 @@ sort_real (SortDialog *dialog) num_lines = end_line - start_line + 1; lines = g_new0 (gchar *, num_lines + 1); - gedit_debug_message (DEBUG_PLUGINS, "Building list..."); + pluma_debug_message (DEBUG_PLUGINS, "Building list..."); for (i = 0; i < num_lines; i++) { @@ -395,7 +395,7 @@ sort_real (SortDialog *dialog) lines[num_lines] = NULL; - gedit_debug_message (DEBUG_PLUGINS, "Sort list..."); + pluma_debug_message (DEBUG_PLUGINS, "Sort list..."); g_qsort_with_data (lines, num_lines, @@ -403,7 +403,7 @@ sort_real (SortDialog *dialog) compare_algorithm, sort_info); - gedit_debug_message (DEBUG_PLUGINS, "Rebuilding document..."); + pluma_debug_message (DEBUG_PLUGINS, "Rebuilding document..."); gtk_source_buffer_begin_not_undoable_action (GTK_SOURCE_BUFFER (doc)); @@ -435,7 +435,7 @@ sort_real (SortDialog *dialog) g_strfreev (lines); g_free (sort_info); - gedit_debug_message (DEBUG_PLUGINS, "Done."); + pluma_debug_message (DEBUG_PLUGINS, "Done."); } static void @@ -456,14 +456,14 @@ free_action_data (ActionData *data) } static void -update_ui_real (GeditWindow *window, +update_ui_real (PlumaWindow *window, WindowData *data) { - GeditView *view; + PlumaView *view; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); - view = gedit_window_get_active_view (window); + view = pluma_window_get_active_view (window); gtk_action_group_set_sensitive (data->ui_action_group, (view != NULL) && @@ -471,23 +471,23 @@ update_ui_real (GeditWindow *window, } static void -impl_activate (GeditPlugin *plugin, - GeditWindow *window) +impl_activate (PlumaPlugin *plugin, + PlumaWindow *window) { GtkUIManager *manager; WindowData *data; ActionData *action_data; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); data = g_slice_new (WindowData); action_data = g_slice_new (ActionData); action_data->window = window; action_data->plugin = plugin; - manager = gedit_window_get_ui_manager (window); + manager = pluma_window_get_ui_manager (window); - data->ui_action_group = gtk_action_group_new ("GeditSortPluginActions"); + data->ui_action_group = gtk_action_group_new ("PlumaSortPluginActions"); gtk_action_group_set_translation_domain (data->ui_action_group, GETTEXT_PACKAGE); gtk_action_group_add_actions_full (data->ui_action_group, @@ -520,15 +520,15 @@ impl_activate (GeditPlugin *plugin, } static void -impl_deactivate (GeditPlugin *plugin, - GeditWindow *window) +impl_deactivate (PlumaPlugin *plugin, + PlumaWindow *window) { GtkUIManager *manager; WindowData *data; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); - manager = gedit_window_get_ui_manager (window); + manager = pluma_window_get_ui_manager (window); data = (WindowData *) g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY); @@ -545,12 +545,12 @@ impl_deactivate (GeditPlugin *plugin, } static void -impl_update_ui (GeditPlugin *plugin, - GeditWindow *window) +impl_update_ui (PlumaPlugin *plugin, + PlumaWindow *window) { WindowData *data; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); data = (WindowData *) g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY); @@ -561,26 +561,26 @@ impl_update_ui (GeditPlugin *plugin, } static void -gedit_sort_plugin_init (GeditSortPlugin *plugin) +pluma_sort_plugin_init (PlumaSortPlugin *plugin) { - gedit_debug_message (DEBUG_PLUGINS, "GeditSortPlugin initializing"); + pluma_debug_message (DEBUG_PLUGINS, "PlumaSortPlugin initializing"); } static void -gedit_sort_plugin_finalize (GObject *object) +pluma_sort_plugin_finalize (GObject *object) { - gedit_debug_message (DEBUG_PLUGINS, "GeditSortPlugin finalizing"); + pluma_debug_message (DEBUG_PLUGINS, "PlumaSortPlugin finalizing"); - G_OBJECT_CLASS (gedit_sort_plugin_parent_class)->finalize (object); + G_OBJECT_CLASS (pluma_sort_plugin_parent_class)->finalize (object); } static void -gedit_sort_plugin_class_init (GeditSortPluginClass *klass) +pluma_sort_plugin_class_init (PlumaSortPluginClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - GeditPluginClass *plugin_class = GEDIT_PLUGIN_CLASS (klass); + PlumaPluginClass *plugin_class = PLUMA_PLUGIN_CLASS (klass); - object_class->finalize = gedit_sort_plugin_finalize; + object_class->finalize = pluma_sort_plugin_finalize; plugin_class->activate = impl_activate; plugin_class->deactivate = impl_deactivate; diff --git a/plugins/sort/pluma-sort-plugin.h b/plugins/sort/pluma-sort-plugin.h new file mode 100755 index 00000000..f359d4f7 --- /dev/null +++ b/plugins/sort/pluma-sort-plugin.h @@ -0,0 +1,73 @@ +/* + * pluma-sort-plugin.h + * + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ + */ + +#ifndef __PLUMA_SORT_PLUGIN_H__ +#define __PLUMA_SORT_PLUGIN_H__ + +#include <glib.h> +#include <glib-object.h> +#include <pluma/pluma-plugin.h> + +G_BEGIN_DECLS + +/* + * Type checking and casting macros + */ +#define PLUMA_TYPE_SORT_PLUGIN (pluma_sort_plugin_get_type ()) +#define PLUMA_SORT_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PLUMA_TYPE_SORT_PLUGIN, PlumaSortPlugin)) +#define PLUMA_SORT_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PLUMA_TYPE_SORT_PLUGIN, PlumaSortPluginClass)) +#define PLUMA_IS_SORT_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PLUMA_TYPE_SORT_PLUGIN)) +#define PLUMA_IS_SORT_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PLUMA_TYPE_SORT_PLUGIN)) +#define PLUMA_SORT_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), PLUMA_TYPE_SORT_PLUGIN, PlumaSortPluginClass)) + +/* Private structure type */ +typedef struct _PlumaSortPluginPrivate PlumaSortPluginPrivate; + +/* + * Main object structure + */ +typedef struct _PlumaSortPlugin PlumaSortPlugin; + +struct _PlumaSortPlugin +{ + PlumaPlugin parent_instance; +}; + +/* + * Class definition + */ +typedef struct _PlumaSortPluginClass PlumaSortPluginClass; + +struct _PlumaSortPluginClass +{ + PlumaPluginClass parent_class; +}; + +/* + * Public methods + */ +GType pluma_sort_plugin_get_type (void) G_GNUC_CONST; + +/* All the plugins must implement this function */ +G_MODULE_EXPORT GType register_pluma_plugin (GTypeModule *module); + +G_END_DECLS + +#endif /* __PLUMA_SORT_PLUGIN_H__ */ diff --git a/plugins/sort/sort.gedit-plugin.desktop.in b/plugins/sort/sort.pluma-plugin.desktop.in index 9ee9634a..c312cbaf 100755 --- a/plugins/sort/sort.gedit-plugin.desktop.in +++ b/plugins/sort/sort.pluma-plugin.desktop.in @@ -1,4 +1,4 @@ -[Gedit Plugin] +[Pluma Plugin] Module=sort IAge=2 _Name=Sort @@ -6,4 +6,4 @@ _Description=Sorts a document or selected text. Icon=gtk-sort-ascending Authors=Carlo Borreo <[email protected]>;Lee Mallabone <[email protected]>;Paolo Maggi <[email protected]>;Jorge Alberto Torres H. <[email protected]> Copyright=Copyright © 2001 Carlo Borreo\nCopyright © 2002-2003 Lee Mallabone, Paolo Maggi\nCopyright © 2004-2005 Paolo Maggi -Website=http://www.gedit.org +Website=http://www.pluma.org diff --git a/plugins/spell/Makefile.am b/plugins/spell/Makefile.am index 9d332f95..24299165 100755 --- a/plugins/spell/Makefile.am +++ b/plugins/spell/Makefile.am @@ -1,59 +1,59 @@ # Spell checker plugin -plugindir = $(GEDIT_PLUGINS_LIBS_DIR) +plugindir = $(PLUMA_PLUGINS_LIBS_DIR) INCLUDES = \ -I$(top_srcdir) \ - $(GEDIT_CFLAGS) \ + $(PLUMA_CFLAGS) \ $(ENCHANT_CFLAGS) \ $(WARN_CFLAGS) \ $(DISABLE_DEPRECATED_CFLAGS) BUILT_SOURCES = \ - gedit-spell-marshal.c \ - gedit-spell-marshal.h + pluma-spell-marshal.c \ + pluma-spell-marshal.h plugin_LTLIBRARIES = libspell.la libspell_la_SOURCES = \ - gedit-spell-plugin.c \ - gedit-spell-plugin.h \ - gedit-spell-checker.c \ - gedit-spell-checker.h \ - gedit-spell-checker-dialog.c \ - gedit-spell-checker-dialog.h \ - gedit-spell-checker-language.c \ - gedit-spell-checker-language.h \ - gedit-spell-language-dialog.c \ - gedit-spell-language-dialog.h \ - gedit-automatic-spell-checker.c \ - gedit-automatic-spell-checker.h \ - gedit-spell-utils.c \ - gedit-spell-utils.h \ + pluma-spell-plugin.c \ + pluma-spell-plugin.h \ + pluma-spell-checker.c \ + pluma-spell-checker.h \ + pluma-spell-checker-dialog.c \ + pluma-spell-checker-dialog.h \ + pluma-spell-checker-language.c \ + pluma-spell-checker-language.h \ + pluma-spell-language-dialog.c \ + pluma-spell-language-dialog.h \ + pluma-automatic-spell-checker.c \ + pluma-automatic-spell-checker.h \ + pluma-spell-utils.c \ + pluma-spell-utils.h \ $(BUILT_SOURCES) libspell_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS) -libspell_la_LIBADD = $(GEDIT_LIBS) $(ENCHANT_LIBS) +libspell_la_LIBADD = $(PLUMA_LIBS) $(ENCHANT_LIBS) -uidir = $(GEDIT_PLUGINS_DATA_DIR)/spell +uidir = $(PLUMA_PLUGINS_DATA_DIR)/spell ui_DATA = spell-checker.ui languages-dialog.ui -gedit-spell-marshal.h: gedit-spell-marshal.list $(GLIB_GENMARSHAL) - $(AM_V_GEN) $(GLIB_GENMARSHAL) $< --header --prefix=gedit_marshal > $@ +pluma-spell-marshal.h: pluma-spell-marshal.list $(GLIB_GENMARSHAL) + $(AM_V_GEN) $(GLIB_GENMARSHAL) $< --header --prefix=pluma_marshal > $@ -gedit-spell-marshal.c: gedit-spell-marshal.list $(GLIB_GENMARSHAL) - $(AM_V_GEN) echo "#include \"gedit-spell-marshal.h\"" > $@ && \ - $(GLIB_GENMARSHAL) $< --body --prefix=gedit_marshal >> $@ +pluma-spell-marshal.c: pluma-spell-marshal.list $(GLIB_GENMARSHAL) + $(AM_V_GEN) echo "#include \"pluma-spell-marshal.h\"" > $@ && \ + $(GLIB_GENMARSHAL) $< --body --prefix=pluma_marshal >> $@ -plugin_in_files = spell.gedit-plugin.desktop.in +plugin_in_files = spell.pluma-plugin.desktop.in -%.gedit-plugin: %.gedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache +%.pluma-plugin: %.pluma-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache -plugin_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin) +plugin_DATA = $(plugin_in_files:.pluma-plugin.desktop.in=.pluma-plugin) EXTRA_DIST = \ $(ui_DATA) \ $(plugin_in_files) \ - gedit-spell-marshal.list + pluma-spell-marshal.list CLEANFILES = $(BUILT_SOURCES) $(plugin_DATA) diff --git a/plugins/spell/gedit-automatic-spell-checker.h b/plugins/spell/gedit-automatic-spell-checker.h deleted file mode 100755 index cc634424..00000000 --- a/plugins/spell/gedit-automatic-spell-checker.h +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * gedit-automatic-spell-checker.h - * This file is part of gedit - * - * Copyright (C) 2002 Paolo Maggi - * - * 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 of the License, 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., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the gedit Team, 2002. See the AUTHORS file for a - * list of people on the gedit Team. - * See the ChangeLog files for a list of changes. - */ - -/* This is a modified version of gtkspell 2.0.2 (gtkspell.sf.net) */ -/* gtkspell - a spell-checking addon for GTK's TextView widget - * Copyright (c) 2002 Evan Martin. - */ - -#ifndef __GEDIT_AUTOMATIC_SPELL_CHECKER_H__ -#define __GEDIT_AUTOMATIC_SPELL_CHECKER_H__ - -#include <gedit/gedit-document.h> -#include <gedit/gedit-view.h> - -#include "gedit-spell-checker.h" - -typedef struct _GeditAutomaticSpellChecker GeditAutomaticSpellChecker; - -GeditAutomaticSpellChecker *gedit_automatic_spell_checker_new ( - GeditDocument *doc, - GeditSpellChecker *checker); - -GeditAutomaticSpellChecker *gedit_automatic_spell_checker_get_from_document ( - const GeditDocument *doc); - -void gedit_automatic_spell_checker_free ( - GeditAutomaticSpellChecker *spell); - -void gedit_automatic_spell_checker_attach_view ( - GeditAutomaticSpellChecker *spell, - GeditView *view); - -void gedit_automatic_spell_checker_detach_view ( - GeditAutomaticSpellChecker *spell, - GeditView *view); - -void gedit_automatic_spell_checker_recheck_all ( - GeditAutomaticSpellChecker *spell); - -#endif /* __GEDIT_AUTOMATIC_SPELL_CHECKER_H__ */ - diff --git a/plugins/spell/gedit-spell-checker-dialog.h b/plugins/spell/gedit-spell-checker-dialog.h deleted file mode 100755 index 257c2b75..00000000 --- a/plugins/spell/gedit-spell-checker-dialog.h +++ /dev/null @@ -1,92 +0,0 @@ -/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * gedit-spell-checker-dialog.h - * This file is part of gedit - * - * Copyright (C) 2002 Paolo Maggi - * - * 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 of the License, 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., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the gedit Team, 2002. See the AUTHORS file for a - * list of people on the gedit Team. - * See the ChangeLog files for a list of changes. - */ - -#ifndef __GEDIT_SPELL_CHECKER_DIALOG_H__ -#define __GEDIT_SPELL_CHECKER_DIALOG_H__ - -#include <gtk/gtk.h> -#include "gedit-spell-checker.h" - -G_BEGIN_DECLS - -#define GEDIT_TYPE_SPELL_CHECKER_DIALOG (gedit_spell_checker_dialog_get_type ()) -#define GEDIT_SPELL_CHECKER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_SPELL_CHECKER_DIALOG, GeditSpellCheckerDialog)) -#define GEDIT_SPELL_CHECKER_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_SPELL_CHECKER_DIALOG, GeditSpellCheckerDialog)) -#define GEDIT_IS_SPELL_CHECKER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_SPELL_CHECKER_DIALOG)) -#define GEDIT_IS_SPELL_CHECKER_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_SPELL_CHECKER_DIALOG)) -#define GEDIT_SPELL_CHECKER_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_SPELL_CHECKER_DIALOG, GeditSpellCheckerDialog)) - - -typedef struct _GeditSpellCheckerDialog GeditSpellCheckerDialog; - -typedef struct _GeditSpellCheckerDialogClass GeditSpellCheckerDialogClass; - -struct _GeditSpellCheckerDialogClass -{ - GtkWindowClass parent_class; - - /* Signals */ - void (*ignore) (GeditSpellCheckerDialog *dlg, - const gchar *word); - void (*ignore_all) (GeditSpellCheckerDialog *dlg, - const gchar *word); - void (*change) (GeditSpellCheckerDialog *dlg, - const gchar *word, - const gchar *change_to); - void (*change_all) (GeditSpellCheckerDialog *dlg, - const gchar *word, - const gchar *change_to); - void (*add_word_to_personal) (GeditSpellCheckerDialog *dlg, - const gchar *word); - -}; - -GType gedit_spell_checker_dialog_get_type (void) G_GNUC_CONST; - -/* Constructors */ -GtkWidget *gedit_spell_checker_dialog_new (const gchar *data_dir); -GtkWidget *gedit_spell_checker_dialog_new_from_spell_checker - (GeditSpellChecker *spell, - const gchar *data_dir); - -void gedit_spell_checker_dialog_set_spell_checker - (GeditSpellCheckerDialog *dlg, - GeditSpellChecker *spell); -void gedit_spell_checker_dialog_set_misspelled_word - (GeditSpellCheckerDialog *dlg, - const gchar* word, - gint len); - -void gedit_spell_checker_dialog_set_completed - (GeditSpellCheckerDialog *dlg); - -G_END_DECLS - -#endif /* __GEDIT_SPELL_CHECKER_DIALOG_H__ */ - diff --git a/plugins/spell/gedit-spell-checker.h b/plugins/spell/gedit-spell-checker.h deleted file mode 100755 index 0cc69d31..00000000 --- a/plugins/spell/gedit-spell-checker.h +++ /dev/null @@ -1,109 +0,0 @@ -/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * gedit-spell-checker.h - * This file is part of gedit - * - * Copyright (C) 2002-2006 Paolo Maggi - * - * 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 of the License, 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., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the gedit Team, 2002. See the AUTHORS file for a - * list of people on the gedit Team. - * See the ChangeLog files for a list of changes. - */ - -#ifndef __GEDIT_SPELL_CHECKER_H__ -#define __GEDIT_SPELL_CHECKER_H__ - -#include <glib.h> -#include <glib-object.h> - -#include "gedit-spell-checker-language.h" - -G_BEGIN_DECLS - -#define GEDIT_TYPE_SPELL_CHECKER (gedit_spell_checker_get_type ()) -#define GEDIT_SPELL_CHECKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_SPELL_CHECKER, GeditSpellChecker)) -#define GEDIT_SPELL_CHECKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_SPELL_CHECKER, GeditSpellChecker)) -#define GEDIT_IS_SPELL_CHECKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_SPELL_CHECKER)) -#define GEDIT_IS_SPELL_CHECKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_SPELL_CHECKER)) -#define GEDIT_SPELL_CHECKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_SPELL_CHECKER, GeditSpellChecker)) - -typedef struct _GeditSpellChecker GeditSpellChecker; - -typedef struct _GeditSpellCheckerClass GeditSpellCheckerClass; - -struct _GeditSpellCheckerClass -{ - GObjectClass parent_class; - - /* Signals */ - void (*add_word_to_personal) (GeditSpellChecker *spell, - const gchar *word, - gint len); - - void (*add_word_to_session) (GeditSpellChecker *spell, - const gchar *word, - gint len); - - void (*set_language) (GeditSpellChecker *spell, - const GeditSpellCheckerLanguage *lang); - - void (*clear_session) (GeditSpellChecker *spell); -}; - - -GType gedit_spell_checker_get_type (void) G_GNUC_CONST; - -/* Constructors */ -GeditSpellChecker *gedit_spell_checker_new (void); - -gboolean gedit_spell_checker_set_language (GeditSpellChecker *spell, - const GeditSpellCheckerLanguage *lang); -const GeditSpellCheckerLanguage - *gedit_spell_checker_get_language (GeditSpellChecker *spell); - -gboolean gedit_spell_checker_check_word (GeditSpellChecker *spell, - const gchar *word, - gssize len); - -GSList *gedit_spell_checker_get_suggestions (GeditSpellChecker *spell, - const gchar *word, - gssize len); - -gboolean gedit_spell_checker_add_word_to_personal - (GeditSpellChecker *spell, - const gchar *word, - gssize len); - -gboolean gedit_spell_checker_add_word_to_session - (GeditSpellChecker *spell, - const gchar *word, - gssize len); - -gboolean gedit_spell_checker_clear_session (GeditSpellChecker *spell); - -gboolean gedit_spell_checker_set_correction (GeditSpellChecker *spell, - const gchar *word, - gssize w_len, - const gchar *replacement, - gssize r_len); -G_END_DECLS - -#endif /* __GEDIT_SPELL_CHECKER_H__ */ - diff --git a/plugins/spell/gedit-spell-language-dialog.h b/plugins/spell/gedit-spell-language-dialog.h deleted file mode 100755 index 4ae9c97d..00000000 --- a/plugins/spell/gedit-spell-language-dialog.h +++ /dev/null @@ -1,67 +0,0 @@ -/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * gedit-spell-language-dialog.h - * This file is part of gedit - * - * Copyright (C) 2002 Paolo Maggi - * - * 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 of the License, 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., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the gedit Team, 2002. See the AUTHORS file for a - * list of people on the gedit Team. - * See the ChangeLog files for a list of changes. - */ - -#ifndef __GEDIT_SPELL_LANGUAGE_DIALOG_H__ -#define __GEDIT_SPELL_LANGUAGE_DIALOG_H__ - -#include <gtk/gtk.h> -#include "gedit-spell-checker-language.h" - -G_BEGIN_DECLS - -#define GEDIT_TYPE_SPELL_LANGUAGE_DIALOG (gedit_spell_language_dialog_get_type()) -#define GEDIT_SPELL_LANGUAGE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_SPELL_LANGUAGE_DIALOG, GeditSpellLanguageDialog)) -#define GEDIT_SPELL_LANGUAGE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GEDIT_TYPE_SPELL_LANGUAGE_DIALOG, GeditSpellLanguageDialogClass)) -#define GEDIT_IS_SPELL_LANGUAGE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GEDIT_TYPE_SPELL_LANGUAGE_DIALOG)) -#define GEDIT_IS_SPELL_LANGUAGE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_SPELL_LANGUAGE_DIALOG)) -#define GEDIT_SPELL_LANGUAGE_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GEDIT_TYPE_SPELL_LANGUAGE_DIALOG, GeditSpellLanguageDialogClass)) - - -typedef struct _GeditSpellLanguageDialog GeditSpellLanguageDialog; - -typedef struct _GeditSpellLanguageDialogClass GeditSpellLanguageDialogClass; - -struct _GeditSpellLanguageDialogClass -{ - GtkDialogClass parent_class; -}; - -GType gedit_spell_language_dialog_get_type (void) G_GNUC_CONST; - -GtkWidget *gedit_spell_language_dialog_new (GtkWindow *parent, - const GeditSpellCheckerLanguage *cur_lang, - const gchar *data_dir); - -const GeditSpellCheckerLanguage * - gedit_spell_language_get_selected_language (GeditSpellLanguageDialog *dlg); - -G_END_DECLS - -#endif /* __GEDIT_SPELL_LANGUAGE_DIALOG_H__ */ - diff --git a/plugins/spell/gedit-spell-plugin.h b/plugins/spell/gedit-spell-plugin.h deleted file mode 100755 index 7de5807a..00000000 --- a/plugins/spell/gedit-spell-plugin.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * gedit-spell-plugin.h - * - * Copyright (C) 2002-2005 Paolo Maggi - * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - */ - -#ifndef __GEDIT_SPELL_PLUGIN_H__ -#define __GEDIT_SPELL_PLUGIN_H__ - -#include <glib.h> -#include <glib-object.h> -#include <gedit/gedit-plugin.h> - -G_BEGIN_DECLS - -/* - * Type checking and casting macros - */ -#define GEDIT_TYPE_SPELL_PLUGIN (gedit_spell_plugin_get_type ()) -#define GEDIT_SPELL_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GEDIT_TYPE_SPELL_PLUGIN, GeditSpellPlugin)) -#define GEDIT_SPELL_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GEDIT_TYPE_SPELL_PLUGIN, GeditSpellPluginClass)) -#define GEDIT_IS_SPELL_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GEDIT_TYPE_SPELL_PLUGIN)) -#define GEDIT_IS_SPELL_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GEDIT_TYPE_SPELL_PLUGIN)) -#define GEDIT_SPELL_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GEDIT_TYPE_SPELL_PLUGIN, GeditSpellPluginClass)) - -/* Private structure type */ -typedef struct _GeditSpellPluginPrivate GeditSpellPluginPrivate; - -/* - * Main object structure - */ -typedef struct _GeditSpellPlugin GeditSpellPlugin; - -struct _GeditSpellPlugin -{ - GeditPlugin parent_instance; -}; - -/* - * Class definition - */ -typedef struct _GeditSpellPluginClass GeditSpellPluginClass; - -struct _GeditSpellPluginClass -{ - GeditPluginClass parent_class; -}; - -/* - * Public methods - */ -GType gedit_spell_plugin_get_type (void) G_GNUC_CONST; - -/* All the plugins must implement this function */ -G_MODULE_EXPORT GType register_gedit_plugin (GTypeModule *module); - -G_END_DECLS - -#endif /* __GEDIT_SPELL_PLUGIN_H__ */ diff --git a/plugins/spell/gedit-automatic-spell-checker.c b/plugins/spell/pluma-automatic-spell-checker.c index 96b2fae9..88393379 100755 --- a/plugins/spell/gedit-automatic-spell-checker.c +++ b/plugins/spell/pluma-automatic-spell-checker.c @@ -1,7 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* - * gedit-automatic-spell-checker.c - * This file is part of gedit + * pluma-automatic-spell-checker.c + * This file is part of pluma * * Copyright (C) 2002 Paolo Maggi * @@ -22,8 +22,8 @@ */ /* - * Modified by the gedit Team, 2002. See the AUTHORS file for a - * list of people on the gedit Team. + * Modified by the pluma Team, 2002. See the AUTHORS file for a + * list of people on the pluma Team. * See the ChangeLog files for a list of changes. */ @@ -40,11 +40,11 @@ #include <glib/gi18n.h> -#include "gedit-automatic-spell-checker.h" -#include "gedit-spell-utils.h" +#include "pluma-automatic-spell-checker.h" +#include "pluma-spell-utils.h" -struct _GeditAutomaticSpellChecker { - GeditDocument *doc; +struct _PlumaAutomaticSpellChecker { + PlumaDocument *doc; GSList *views; GtkTextMark *mark_insert_start; @@ -54,22 +54,22 @@ struct _GeditAutomaticSpellChecker { GtkTextTag *tag_highlight; GtkTextMark *mark_click; - GeditSpellChecker *spell_checker; + PlumaSpellChecker *spell_checker; }; static GQuark automatic_spell_checker_id = 0; static GQuark suggestion_id = 0; -static void gedit_automatic_spell_checker_free_internal (GeditAutomaticSpellChecker *spell); +static void pluma_automatic_spell_checker_free_internal (PlumaAutomaticSpellChecker *spell); static void -view_destroy (GeditView *view, GeditAutomaticSpellChecker *spell) +view_destroy (PlumaView *view, PlumaAutomaticSpellChecker *spell) { - gedit_automatic_spell_checker_detach_view (spell, view); + pluma_automatic_spell_checker_detach_view (spell, view); } static void -check_word (GeditAutomaticSpellChecker *spell, GtkTextIter *start, GtkTextIter *end) +check_word (PlumaAutomaticSpellChecker *spell, GtkTextIter *start, GtkTextIter *end) { gchar *word; @@ -80,7 +80,7 @@ check_word (GeditAutomaticSpellChecker *spell, GtkTextIter *start, GtkTextIter * gtk_text_iter_get_offset (end)); */ - if (!gedit_spell_checker_check_word (spell->spell_checker, word, -1)) + if (!pluma_spell_checker_check_word (spell->spell_checker, word, -1)) { /* g_print ("Apply tag: [%d - %d]\n", gtk_text_iter_get_offset (start), @@ -96,7 +96,7 @@ check_word (GeditAutomaticSpellChecker *spell, GtkTextIter *start, GtkTextIter * } static void -check_range (GeditAutomaticSpellChecker *spell, +check_range (PlumaAutomaticSpellChecker *spell, GtkTextIter start, GtkTextIter end, gboolean force_all) @@ -164,7 +164,7 @@ check_range (GeditAutomaticSpellChecker *spell, wstart = start; - while (gedit_spell_utils_skip_no_spell_check (&wstart, &end) && + while (pluma_spell_utils_skip_no_spell_check (&wstart, &end) && gtk_text_iter_compare (&wstart, &end) < 0) { gboolean inword; @@ -208,7 +208,7 @@ check_range (GeditAutomaticSpellChecker *spell, } static void -check_deferred_range (GeditAutomaticSpellChecker *spell, +check_deferred_range (PlumaAutomaticSpellChecker *spell, gboolean force_all) { GtkTextIter start, end; @@ -232,14 +232,14 @@ check_deferred_range (GeditAutomaticSpellChecker *spell, static void insert_text_before (GtkTextBuffer *buffer, GtkTextIter *iter, - gchar *text, gint len, GeditAutomaticSpellChecker *spell) + gchar *text, gint len, PlumaAutomaticSpellChecker *spell) { gtk_text_buffer_move_mark (buffer, spell->mark_insert_start, iter); } static void insert_text_after (GtkTextBuffer *buffer, GtkTextIter *iter, - gchar *text, gint len, GeditAutomaticSpellChecker *spell) + gchar *text, gint len, PlumaAutomaticSpellChecker *spell) { GtkTextIter start; @@ -260,7 +260,7 @@ insert_text_after (GtkTextBuffer *buffer, GtkTextIter *iter, static void delete_range_after (GtkTextBuffer *buffer, GtkTextIter *start, GtkTextIter *end, - GeditAutomaticSpellChecker *spell) + PlumaAutomaticSpellChecker *spell) { check_range (spell, *start, *end, FALSE); } @@ -269,7 +269,7 @@ static void mark_set (GtkTextBuffer *buffer, GtkTextIter *iter, GtkTextMark *mark, - GeditAutomaticSpellChecker *spell) + PlumaAutomaticSpellChecker *spell) { /* if the cursor has moved and there is a deferred check so handle it now */ if ((mark == gtk_text_buffer_get_insert (buffer)) && spell->deferred_check) @@ -294,7 +294,7 @@ get_word_extents_from_mark (GtkTextBuffer *buffer, } static void -remove_tag_to_word (GeditAutomaticSpellChecker *spell, const gchar *word) +remove_tag_to_word (PlumaAutomaticSpellChecker *spell, const gchar *word) { GtkTextIter iter; GtkTextIter match_start, match_end; @@ -331,7 +331,7 @@ remove_tag_to_word (GeditAutomaticSpellChecker *spell, const gchar *word) } static void -add_to_dictionary (GtkWidget *menuitem, GeditAutomaticSpellChecker *spell) +add_to_dictionary (GtkWidget *menuitem, PlumaAutomaticSpellChecker *spell) { gchar *word; @@ -344,13 +344,13 @@ add_to_dictionary (GtkWidget *menuitem, GeditAutomaticSpellChecker *spell) &end, FALSE); - gedit_spell_checker_add_word_to_personal (spell->spell_checker, word, -1); + pluma_spell_checker_add_word_to_personal (spell->spell_checker, word, -1); g_free (word); } static void -ignore_all (GtkWidget *menuitem, GeditAutomaticSpellChecker *spell) +ignore_all (GtkWidget *menuitem, PlumaAutomaticSpellChecker *spell) { gchar *word; @@ -363,13 +363,13 @@ ignore_all (GtkWidget *menuitem, GeditAutomaticSpellChecker *spell) &end, FALSE); - gedit_spell_checker_add_word_to_session (spell->spell_checker, word, -1); + pluma_spell_checker_add_word_to_session (spell->spell_checker, word, -1); g_free (word); } static void -replace_word (GtkWidget *menuitem, GeditAutomaticSpellChecker *spell) +replace_word (GtkWidget *menuitem, PlumaAutomaticSpellChecker *spell) { gchar *oldword; const gchar *newword; @@ -390,7 +390,7 @@ replace_word (GtkWidget *menuitem, GeditAutomaticSpellChecker *spell) gtk_text_buffer_end_user_action (GTK_TEXT_BUFFER (spell->doc)); - gedit_spell_checker_set_correction (spell->spell_checker, + pluma_spell_checker_set_correction (spell->spell_checker, oldword, strlen (oldword), newword, strlen (newword)); @@ -398,7 +398,7 @@ replace_word (GtkWidget *menuitem, GeditAutomaticSpellChecker *spell) } static GtkWidget * -build_suggestion_menu (GeditAutomaticSpellChecker *spell, const gchar *word) +build_suggestion_menu (PlumaAutomaticSpellChecker *spell, const gchar *word) { GtkWidget *topmenu, *menu; GtkWidget *mi; @@ -408,7 +408,7 @@ build_suggestion_menu (GeditAutomaticSpellChecker *spell, const gchar *word) topmenu = menu = gtk_menu_new(); - suggestions = gedit_spell_checker_get_suggestions (spell->spell_checker, word, -1); + suggestions = pluma_spell_checker_get_suggestions (spell->spell_checker, word, -1); list = suggestions; @@ -529,7 +529,7 @@ build_suggestion_menu (GeditAutomaticSpellChecker *spell, const gchar *word) } static void -populate_popup (GtkTextView *textview, GtkMenu *menu, GeditAutomaticSpellChecker *spell) +populate_popup (GtkTextView *textview, GtkMenu *menu, PlumaAutomaticSpellChecker *spell) { GtkWidget *img, *mi; GtkTextIter start, end; @@ -563,7 +563,7 @@ populate_popup (GtkTextView *textview, GtkMenu *menu, GeditAutomaticSpellChecker } void -gedit_automatic_spell_checker_recheck_all (GeditAutomaticSpellChecker *spell) +pluma_automatic_spell_checker_recheck_all (PlumaAutomaticSpellChecker *spell) { GtkTextIter start, end; @@ -575,10 +575,10 @@ gedit_automatic_spell_checker_recheck_all (GeditAutomaticSpellChecker *spell) } static void -add_word_signal_cb (GeditSpellChecker *checker, +add_word_signal_cb (PlumaSpellChecker *checker, const gchar *word, gint len, - GeditAutomaticSpellChecker *spell) + PlumaAutomaticSpellChecker *spell) { gchar *w; @@ -593,18 +593,18 @@ add_word_signal_cb (GeditSpellChecker *checker, } static void -set_language_cb (GeditSpellChecker *checker, - const GeditSpellCheckerLanguage *lang, - GeditAutomaticSpellChecker *spell) +set_language_cb (PlumaSpellChecker *checker, + const PlumaSpellCheckerLanguage *lang, + PlumaAutomaticSpellChecker *spell) { - gedit_automatic_spell_checker_recheck_all (spell); + pluma_automatic_spell_checker_recheck_all (spell); } static void -clear_session_cb (GeditSpellChecker *checker, - GeditAutomaticSpellChecker *spell) +clear_session_cb (PlumaSpellChecker *checker, + PlumaAutomaticSpellChecker *spell) { - gedit_automatic_spell_checker_recheck_all (spell); + pluma_automatic_spell_checker_recheck_all (spell); } /* When the user right-clicks on a word, they want to check that word. @@ -614,7 +614,7 @@ clear_session_cb (GeditSpellChecker *checker, static gboolean button_press_event (GtkTextView *view, GdkEventButton *event, - GeditAutomaticSpellChecker *spell) + PlumaAutomaticSpellChecker *spell) { if (event->button == 3) { @@ -645,7 +645,7 @@ button_press_event (GtkTextView *view, * will contain the wrong set of suggestions. */ static gboolean -popup_menu_event (GtkTextView *view, GeditAutomaticSpellChecker *spell) +popup_menu_event (GtkTextView *view, PlumaAutomaticSpellChecker *spell) { GtkTextIter iter; GtkTextBuffer *buffer; @@ -665,7 +665,7 @@ popup_menu_event (GtkTextView *view, GeditAutomaticSpellChecker *spell) static void tag_table_changed (GtkTextTagTable *table, - GeditAutomaticSpellChecker *spell) + PlumaAutomaticSpellChecker *spell) { g_return_if_fail (spell->tag_highlight != NULL); @@ -676,7 +676,7 @@ tag_table_changed (GtkTextTagTable *table, static void tag_added_or_removed (GtkTextTagTable *table, GtkTextTag *tag, - GeditAutomaticSpellChecker *spell) + PlumaAutomaticSpellChecker *spell) { tag_table_changed (table, spell); } @@ -685,7 +685,7 @@ static void tag_changed (GtkTextTagTable *table, GtkTextTag *tag, gboolean size_changed, - GeditAutomaticSpellChecker *spell) + PlumaAutomaticSpellChecker *spell) { tag_table_changed (table, spell); } @@ -694,33 +694,33 @@ static void highlight_updated (GtkSourceBuffer *buffer, GtkTextIter *start, GtkTextIter *end, - GeditAutomaticSpellChecker *spell) + PlumaAutomaticSpellChecker *spell) { check_range (spell, *start, *end, FALSE); } static void -spell_tag_destroyed (GeditAutomaticSpellChecker *spell, +spell_tag_destroyed (PlumaAutomaticSpellChecker *spell, GObject *where_the_object_was) { spell->tag_highlight = NULL; } -GeditAutomaticSpellChecker * -gedit_automatic_spell_checker_new (GeditDocument *doc, - GeditSpellChecker *checker) +PlumaAutomaticSpellChecker * +pluma_automatic_spell_checker_new (PlumaDocument *doc, + PlumaSpellChecker *checker) { - GeditAutomaticSpellChecker *spell; + PlumaAutomaticSpellChecker *spell; GtkTextTagTable *tag_table; GtkTextIter start, end; - g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), NULL); - g_return_val_if_fail (GEDIT_IS_SPELL_CHECKER (checker), NULL); - g_return_val_if_fail ((spell = gedit_automatic_spell_checker_get_from_document (doc)) == NULL, + g_return_val_if_fail (PLUMA_IS_DOCUMENT (doc), NULL); + g_return_val_if_fail (PLUMA_IS_SPELL_CHECKER (checker), NULL); + g_return_val_if_fail ((spell = pluma_automatic_spell_checker_get_from_document (doc)) == NULL, spell); /* attach to the widget */ - spell = g_new0 (GeditAutomaticSpellChecker, 1); + spell = g_new0 (PlumaAutomaticSpellChecker, 1); spell->doc = doc; spell->spell_checker = g_object_ref (checker); @@ -728,17 +728,17 @@ gedit_automatic_spell_checker_new (GeditDocument *doc, if (automatic_spell_checker_id == 0) { automatic_spell_checker_id = - g_quark_from_string ("GeditAutomaticSpellCheckerID"); + g_quark_from_string ("PlumaAutomaticSpellCheckerID"); } if (suggestion_id == 0) { - suggestion_id = g_quark_from_string ("GeditAutoSuggestionID"); + suggestion_id = g_quark_from_string ("PlumaAutoSuggestionID"); } g_object_set_qdata_full (G_OBJECT (doc), automatic_spell_checker_id, spell, - (GDestroyNotify)gedit_automatic_spell_checker_free_internal); + (GDestroyNotify)pluma_automatic_spell_checker_free_internal); g_signal_connect (doc, "insert-text", @@ -812,13 +812,13 @@ gedit_automatic_spell_checker_new (GeditDocument *doc, gtk_text_buffer_get_bounds (GTK_TEXT_BUFFER (doc), &start, &end); spell->mark_insert_start = gtk_text_buffer_get_mark (GTK_TEXT_BUFFER (doc), - "gedit-automatic-spell-checker-insert-start"); + "pluma-automatic-spell-checker-insert-start"); if (spell->mark_insert_start == NULL) { spell->mark_insert_start = gtk_text_buffer_create_mark (GTK_TEXT_BUFFER (doc), - "gedit-automatic-spell-checker-insert-start", + "pluma-automatic-spell-checker-insert-start", &start, TRUE); } @@ -830,13 +830,13 @@ gedit_automatic_spell_checker_new (GeditDocument *doc, } spell->mark_insert_end = gtk_text_buffer_get_mark (GTK_TEXT_BUFFER (doc), - "gedit-automatic-spell-checker-insert-end"); + "pluma-automatic-spell-checker-insert-end"); if (spell->mark_insert_end == NULL) { spell->mark_insert_end = gtk_text_buffer_create_mark (GTK_TEXT_BUFFER (doc), - "gedit-automatic-spell-checker-insert-end", + "pluma-automatic-spell-checker-insert-end", &start, TRUE); } @@ -848,13 +848,13 @@ gedit_automatic_spell_checker_new (GeditDocument *doc, } spell->mark_click = gtk_text_buffer_get_mark (GTK_TEXT_BUFFER (doc), - "gedit-automatic-spell-checker-click"); + "pluma-automatic-spell-checker-click"); if (spell->mark_click == NULL) { spell->mark_click = gtk_text_buffer_create_mark (GTK_TEXT_BUFFER (doc), - "gedit-automatic-spell-checker-click", + "pluma-automatic-spell-checker-click", &start, TRUE); } @@ -870,10 +870,10 @@ gedit_automatic_spell_checker_new (GeditDocument *doc, return spell; } -GeditAutomaticSpellChecker * -gedit_automatic_spell_checker_get_from_document (const GeditDocument *doc) +PlumaAutomaticSpellChecker * +pluma_automatic_spell_checker_get_from_document (const PlumaDocument *doc) { - g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), NULL); + g_return_val_if_fail (PLUMA_IS_DOCUMENT (doc), NULL); if (automatic_spell_checker_id == 0) return NULL; @@ -882,10 +882,10 @@ gedit_automatic_spell_checker_get_from_document (const GeditDocument *doc) } void -gedit_automatic_spell_checker_free (GeditAutomaticSpellChecker *spell) +pluma_automatic_spell_checker_free (PlumaAutomaticSpellChecker *spell) { g_return_if_fail (spell != NULL); - g_return_if_fail (gedit_automatic_spell_checker_get_from_document (spell->doc) == spell); + g_return_if_fail (pluma_automatic_spell_checker_get_from_document (spell->doc) == spell); if (automatic_spell_checker_id == 0) return; @@ -894,7 +894,7 @@ gedit_automatic_spell_checker_free (GeditAutomaticSpellChecker *spell) } static void -gedit_automatic_spell_checker_free_internal (GeditAutomaticSpellChecker *spell) +pluma_automatic_spell_checker_free_internal (PlumaAutomaticSpellChecker *spell) { GtkTextTagTable *table; GtkTextIter start, end; @@ -937,7 +937,7 @@ gedit_automatic_spell_checker_free_internal (GeditAutomaticSpellChecker *spell) list = spell->views; while (list != NULL) { - GeditView *view = GEDIT_VIEW (list->data); + PlumaView *view = PLUMA_VIEW (list->data); g_signal_handlers_disconnect_matched (G_OBJECT (view), G_SIGNAL_MATCH_DATA, @@ -958,12 +958,12 @@ gedit_automatic_spell_checker_free_internal (GeditAutomaticSpellChecker *spell) } void -gedit_automatic_spell_checker_attach_view ( - GeditAutomaticSpellChecker *spell, - GeditView *view) +pluma_automatic_spell_checker_attach_view ( + PlumaAutomaticSpellChecker *spell, + PlumaView *view) { g_return_if_fail (spell != NULL); - g_return_if_fail (GEDIT_IS_VIEW (view)); + g_return_if_fail (PLUMA_IS_VIEW (view)); g_return_if_fail (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)) == GTK_TEXT_BUFFER (spell->doc)); @@ -989,12 +989,12 @@ gedit_automatic_spell_checker_attach_view ( } void -gedit_automatic_spell_checker_detach_view ( - GeditAutomaticSpellChecker *spell, - GeditView *view) +pluma_automatic_spell_checker_detach_view ( + PlumaAutomaticSpellChecker *spell, + PlumaView *view) { g_return_if_fail (spell != NULL); - g_return_if_fail (GEDIT_IS_VIEW (view)); + g_return_if_fail (PLUMA_IS_VIEW (view)); g_return_if_fail (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)) == GTK_TEXT_BUFFER (spell->doc)); diff --git a/plugins/spell/pluma-automatic-spell-checker.h b/plugins/spell/pluma-automatic-spell-checker.h new file mode 100755 index 00000000..3a5f2487 --- /dev/null +++ b/plugins/spell/pluma-automatic-spell-checker.h @@ -0,0 +1,67 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * pluma-automatic-spell-checker.h + * This file is part of pluma + * + * Copyright (C) 2002 Paolo Maggi + * + * 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 of the License, 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., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* + * Modified by the pluma Team, 2002. See the AUTHORS file for a + * list of people on the pluma Team. + * See the ChangeLog files for a list of changes. + */ + +/* This is a modified version of gtkspell 2.0.2 (gtkspell.sf.net) */ +/* gtkspell - a spell-checking addon for GTK's TextView widget + * Copyright (c) 2002 Evan Martin. + */ + +#ifndef __PLUMA_AUTOMATIC_SPELL_CHECKER_H__ +#define __PLUMA_AUTOMATIC_SPELL_CHECKER_H__ + +#include <pluma/pluma-document.h> +#include <pluma/pluma-view.h> + +#include "pluma-spell-checker.h" + +typedef struct _PlumaAutomaticSpellChecker PlumaAutomaticSpellChecker; + +PlumaAutomaticSpellChecker *pluma_automatic_spell_checker_new ( + PlumaDocument *doc, + PlumaSpellChecker *checker); + +PlumaAutomaticSpellChecker *pluma_automatic_spell_checker_get_from_document ( + const PlumaDocument *doc); + +void pluma_automatic_spell_checker_free ( + PlumaAutomaticSpellChecker *spell); + +void pluma_automatic_spell_checker_attach_view ( + PlumaAutomaticSpellChecker *spell, + PlumaView *view); + +void pluma_automatic_spell_checker_detach_view ( + PlumaAutomaticSpellChecker *spell, + PlumaView *view); + +void pluma_automatic_spell_checker_recheck_all ( + PlumaAutomaticSpellChecker *spell); + +#endif /* __PLUMA_AUTOMATIC_SPELL_CHECKER_H__ */ + diff --git a/plugins/spell/gedit-spell-checker-dialog.c b/plugins/spell/pluma-spell-checker-dialog.c index 0488d160..067e79e7 100755 --- a/plugins/spell/gedit-spell-checker-dialog.c +++ b/plugins/spell/pluma-spell-checker-dialog.c @@ -1,7 +1,7 @@ /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* - * gedit-spell-checker-dialog.c - * This file is part of gedit + * pluma-spell-checker-dialog.c + * This file is part of pluma * * Copyright (C) 2002 Paolo Maggi * @@ -22,8 +22,8 @@ */ /* - * Modified by the gedit Team, 2002. See the AUTHORS file for a - * list of people on the gedit Team. + * Modified by the pluma Team, 2002. See the AUTHORS file for a + * list of people on the pluma Team. * See the ChangeLog files for a list of changes. */ @@ -34,15 +34,15 @@ #include <string.h> #include <glib/gi18n.h> #include <gtk/gtk.h> -#include <gedit/gedit-utils.h> -#include "gedit-spell-checker-dialog.h" -#include "gedit-spell-marshal.h" +#include <pluma/pluma-utils.h> +#include "pluma-spell-checker-dialog.h" +#include "pluma-spell-marshal.h" -struct _GeditSpellCheckerDialog +struct _PlumaSpellCheckerDialog { GtkWindow parent_instance; - GeditSpellChecker *spell_checker; + PlumaSpellChecker *spell_checker; gchar *misspelled_word; @@ -77,41 +77,41 @@ enum NUM_COLUMNS }; -static void update_suggestions_list_model (GeditSpellCheckerDialog *dlg, +static void update_suggestions_list_model (PlumaSpellCheckerDialog *dlg, GSList *suggestions); static void word_entry_changed_handler (GtkEditable *editable, - GeditSpellCheckerDialog *dlg); + PlumaSpellCheckerDialog *dlg); static void close_button_clicked_handler (GtkButton *button, - GeditSpellCheckerDialog *dlg); + PlumaSpellCheckerDialog *dlg); static void suggestions_list_selection_changed_handler (GtkTreeSelection *selection, - GeditSpellCheckerDialog *dlg); + PlumaSpellCheckerDialog *dlg); static void check_word_button_clicked_handler (GtkButton *button, - GeditSpellCheckerDialog *dlg); + PlumaSpellCheckerDialog *dlg); static void add_word_button_clicked_handler (GtkButton *button, - GeditSpellCheckerDialog *dlg); + PlumaSpellCheckerDialog *dlg); static void ignore_button_clicked_handler (GtkButton *button, - GeditSpellCheckerDialog *dlg); + PlumaSpellCheckerDialog *dlg); static void ignore_all_button_clicked_handler (GtkButton *button, - GeditSpellCheckerDialog *dlg); + PlumaSpellCheckerDialog *dlg); static void change_button_clicked_handler (GtkButton *button, - GeditSpellCheckerDialog *dlg); + PlumaSpellCheckerDialog *dlg); static void change_all_button_clicked_handler (GtkButton *button, - GeditSpellCheckerDialog *dlg); + PlumaSpellCheckerDialog *dlg); static void suggestions_list_row_activated_handler (GtkTreeView *view, GtkTreePath *path, GtkTreeViewColumn *column, - GeditSpellCheckerDialog *dlg); + PlumaSpellCheckerDialog *dlg); static guint signals [LAST_SIGNAL] = { 0 }; -G_DEFINE_TYPE(GeditSpellCheckerDialog, gedit_spell_checker_dialog, GTK_TYPE_WINDOW) +G_DEFINE_TYPE(PlumaSpellCheckerDialog, pluma_spell_checker_dialog, GTK_TYPE_WINDOW) static void -gedit_spell_checker_dialog_destroy (GtkObject *object) +pluma_spell_checker_dialog_destroy (GtkObject *object) { - GeditSpellCheckerDialog *dlg = GEDIT_SPELL_CHECKER_DIALOG (object); + PlumaSpellCheckerDialog *dlg = PLUMA_SPELL_CHECKER_DIALOG (object); if (dlg->spell_checker != NULL) { @@ -125,25 +125,25 @@ gedit_spell_checker_dialog_destroy (GtkObject *object) dlg->misspelled_word = NULL; } - GTK_OBJECT_CLASS (gedit_spell_checker_dialog_parent_class)->destroy (object); + GTK_OBJECT_CLASS (pluma_spell_checker_dialog_parent_class)->destroy (object); } static void -gedit_spell_checker_dialog_class_init (GeditSpellCheckerDialogClass * klass) +pluma_spell_checker_dialog_class_init (PlumaSpellCheckerDialogClass * klass) { GObjectClass *object_class; object_class = G_OBJECT_CLASS (klass); - GTK_OBJECT_CLASS (object_class)->destroy = gedit_spell_checker_dialog_destroy; + GTK_OBJECT_CLASS (object_class)->destroy = pluma_spell_checker_dialog_destroy; signals[IGNORE] = g_signal_new ("ignore", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GeditSpellCheckerDialogClass, ignore), + G_STRUCT_OFFSET (PlumaSpellCheckerDialogClass, ignore), NULL, NULL, - gedit_marshal_VOID__STRING, + pluma_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); @@ -152,9 +152,9 @@ gedit_spell_checker_dialog_class_init (GeditSpellCheckerDialogClass * klass) g_signal_new ("ignore_all", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GeditSpellCheckerDialogClass, ignore_all), + G_STRUCT_OFFSET (PlumaSpellCheckerDialogClass, ignore_all), NULL, NULL, - gedit_marshal_VOID__STRING, + pluma_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); @@ -163,9 +163,9 @@ gedit_spell_checker_dialog_class_init (GeditSpellCheckerDialogClass * klass) g_signal_new ("change", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GeditSpellCheckerDialogClass, change), + G_STRUCT_OFFSET (PlumaSpellCheckerDialogClass, change), NULL, NULL, - gedit_marshal_VOID__STRING_STRING, + pluma_marshal_VOID__STRING_STRING, G_TYPE_NONE, 2, G_TYPE_STRING, @@ -175,9 +175,9 @@ gedit_spell_checker_dialog_class_init (GeditSpellCheckerDialogClass * klass) g_signal_new ("change_all", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GeditSpellCheckerDialogClass, change_all), + G_STRUCT_OFFSET (PlumaSpellCheckerDialogClass, change_all), NULL, NULL, - gedit_marshal_VOID__STRING_STRING, + pluma_marshal_VOID__STRING_STRING, G_TYPE_NONE, 2, G_TYPE_STRING, @@ -187,16 +187,16 @@ gedit_spell_checker_dialog_class_init (GeditSpellCheckerDialogClass * klass) g_signal_new ("add_word_to_personal", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GeditSpellCheckerDialogClass, add_word_to_personal), + G_STRUCT_OFFSET (PlumaSpellCheckerDialogClass, add_word_to_personal), NULL, NULL, - gedit_marshal_VOID__STRING, + pluma_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); } static void -create_dialog (GeditSpellCheckerDialog *dlg, +create_dialog (PlumaSpellCheckerDialog *dlg, const gchar *data_dir) { GtkWidget *error_widget; @@ -223,7 +223,7 @@ create_dialog (GeditSpellCheckerDialog *dlg, dlg->misspelled_word = NULL; ui_file = g_build_filename (data_dir, "spell-checker.ui", NULL); - ret = gedit_utils_get_ui_objects (ui_file, + ret = pluma_utils_get_ui_objects (ui_file, root_objects, &error_widget, @@ -321,17 +321,17 @@ create_dialog (GeditSpellCheckerDialog *dlg, } static void -gedit_spell_checker_dialog_init (GeditSpellCheckerDialog *dlg) +pluma_spell_checker_dialog_init (PlumaSpellCheckerDialog *dlg) { } GtkWidget * -gedit_spell_checker_dialog_new (const gchar *data_dir) +pluma_spell_checker_dialog_new (const gchar *data_dir) { - GeditSpellCheckerDialog *dlg; + PlumaSpellCheckerDialog *dlg; - dlg = GEDIT_SPELL_CHECKER_DIALOG ( - g_object_new (GEDIT_TYPE_SPELL_CHECKER_DIALOG, NULL)); + dlg = PLUMA_SPELL_CHECKER_DIALOG ( + g_object_new (PLUMA_TYPE_SPELL_CHECKER_DIALOG, NULL)); g_return_val_if_fail (dlg != NULL, NULL); @@ -341,33 +341,33 @@ gedit_spell_checker_dialog_new (const gchar *data_dir) } GtkWidget * -gedit_spell_checker_dialog_new_from_spell_checker (GeditSpellChecker *spell, +pluma_spell_checker_dialog_new_from_spell_checker (PlumaSpellChecker *spell, const gchar *data_dir) { - GeditSpellCheckerDialog *dlg; + PlumaSpellCheckerDialog *dlg; g_return_val_if_fail (spell != NULL, NULL); - dlg = GEDIT_SPELL_CHECKER_DIALOG ( - g_object_new (GEDIT_TYPE_SPELL_CHECKER_DIALOG, NULL)); + dlg = PLUMA_SPELL_CHECKER_DIALOG ( + g_object_new (PLUMA_TYPE_SPELL_CHECKER_DIALOG, NULL)); g_return_val_if_fail (dlg != NULL, NULL); create_dialog (dlg, data_dir); - gedit_spell_checker_dialog_set_spell_checker (dlg, spell); + pluma_spell_checker_dialog_set_spell_checker (dlg, spell); return GTK_WIDGET (dlg); } void -gedit_spell_checker_dialog_set_spell_checker (GeditSpellCheckerDialog *dlg, GeditSpellChecker *spell) +pluma_spell_checker_dialog_set_spell_checker (PlumaSpellCheckerDialog *dlg, PlumaSpellChecker *spell) { - const GeditSpellCheckerLanguage* language; + const PlumaSpellCheckerLanguage* language; const gchar *lang; gchar *tmp; - g_return_if_fail (GEDIT_IS_SPELL_CHECKER_DIALOG (dlg)); + g_return_if_fail (PLUMA_IS_SPELL_CHECKER_DIALOG (dlg)); g_return_if_fail (spell != NULL); if (dlg->spell_checker != NULL) @@ -376,16 +376,16 @@ gedit_spell_checker_dialog_set_spell_checker (GeditSpellCheckerDialog *dlg, Gedi dlg->spell_checker = spell; g_object_ref (dlg->spell_checker); - language = gedit_spell_checker_get_language (dlg->spell_checker); + language = pluma_spell_checker_get_language (dlg->spell_checker); - lang = gedit_spell_checker_language_to_string (language); + lang = pluma_spell_checker_language_to_string (language); tmp = g_strdup_printf("<b>%s</b>", lang); gtk_label_set_label (GTK_LABEL (dlg->language_label), tmp); g_free (tmp); if (dlg->misspelled_word != NULL) - gedit_spell_checker_dialog_set_misspelled_word (dlg, dlg->misspelled_word, -1); + pluma_spell_checker_dialog_set_misspelled_word (dlg, dlg->misspelled_word, -1); else gtk_list_store_clear (GTK_LIST_STORE (dlg->suggestions_list_model)); @@ -393,18 +393,18 @@ gedit_spell_checker_dialog_set_spell_checker (GeditSpellCheckerDialog *dlg, Gedi } void -gedit_spell_checker_dialog_set_misspelled_word (GeditSpellCheckerDialog *dlg, +pluma_spell_checker_dialog_set_misspelled_word (PlumaSpellCheckerDialog *dlg, const gchar *word, gint len) { gchar *tmp; GSList *sug; - g_return_if_fail (GEDIT_IS_SPELL_CHECKER_DIALOG (dlg)); + g_return_if_fail (PLUMA_IS_SPELL_CHECKER_DIALOG (dlg)); g_return_if_fail (word != NULL); g_return_if_fail (dlg->spell_checker != NULL); - g_return_if_fail (!gedit_spell_checker_check_word (dlg->spell_checker, word, -1)); + g_return_if_fail (!pluma_spell_checker_check_word (dlg->spell_checker, word, -1)); /* build_suggestions_list */ if (dlg->misspelled_word != NULL) @@ -416,7 +416,7 @@ gedit_spell_checker_dialog_set_misspelled_word (GeditSpellCheckerDialog *dlg, gtk_label_set_label (GTK_LABEL (dlg->misspelled_word_label), tmp); g_free (tmp); - sug = gedit_spell_checker_get_suggestions (dlg->spell_checker, + sug = pluma_spell_checker_get_suggestions (dlg->spell_checker, dlg->misspelled_word, -1); @@ -432,13 +432,13 @@ gedit_spell_checker_dialog_set_misspelled_word (GeditSpellCheckerDialog *dlg, } static void -update_suggestions_list_model (GeditSpellCheckerDialog *dlg, GSList *suggestions) +update_suggestions_list_model (PlumaSpellCheckerDialog *dlg, GSList *suggestions) { GtkListStore *store; GtkTreeIter iter; GtkTreeSelection *sel; - g_return_if_fail (GEDIT_IS_SPELL_CHECKER_DIALOG (dlg)); + g_return_if_fail (PLUMA_IS_SPELL_CHECKER_DIALOG (dlg)); g_return_if_fail (GTK_IS_LIST_STORE (dlg->suggestions_list_model)); store = GTK_LIST_STORE (dlg->suggestions_list_model); @@ -482,11 +482,11 @@ update_suggestions_list_model (GeditSpellCheckerDialog *dlg, GSList *suggestions } static void -word_entry_changed_handler (GtkEditable *editable, GeditSpellCheckerDialog *dlg) +word_entry_changed_handler (GtkEditable *editable, PlumaSpellCheckerDialog *dlg) { const gchar *text; - g_return_if_fail (GEDIT_IS_SPELL_CHECKER_DIALOG (dlg)); + g_return_if_fail (PLUMA_IS_SPELL_CHECKER_DIALOG (dlg)); text = gtk_entry_get_text (GTK_ENTRY (dlg->word_entry)); @@ -505,22 +505,22 @@ word_entry_changed_handler (GtkEditable *editable, GeditSpellCheckerDialog *dlg) } static void -close_button_clicked_handler (GtkButton *button, GeditSpellCheckerDialog *dlg) +close_button_clicked_handler (GtkButton *button, PlumaSpellCheckerDialog *dlg) { - g_return_if_fail (GEDIT_IS_SPELL_CHECKER_DIALOG (dlg)); + g_return_if_fail (PLUMA_IS_SPELL_CHECKER_DIALOG (dlg)); gtk_widget_destroy (GTK_WIDGET (dlg)); } static void suggestions_list_selection_changed_handler (GtkTreeSelection *selection, - GeditSpellCheckerDialog *dlg) + PlumaSpellCheckerDialog *dlg) { GtkTreeIter iter; GValue value = {0, }; const gchar *text; - g_return_if_fail (GEDIT_IS_SPELL_CHECKER_DIALOG (dlg)); + g_return_if_fail (PLUMA_IS_SPELL_CHECKER_DIALOG (dlg)); if (! gtk_tree_selection_get_selected (selection, NULL, &iter)) return; @@ -537,18 +537,18 @@ suggestions_list_selection_changed_handler (GtkTreeSelection *selection, } static void -check_word_button_clicked_handler (GtkButton *button, GeditSpellCheckerDialog *dlg) +check_word_button_clicked_handler (GtkButton *button, PlumaSpellCheckerDialog *dlg) { const gchar *word; gssize len; - g_return_if_fail (GEDIT_IS_SPELL_CHECKER_DIALOG (dlg)); + g_return_if_fail (PLUMA_IS_SPELL_CHECKER_DIALOG (dlg)); word = gtk_entry_get_text (GTK_ENTRY (dlg->word_entry)); len = strlen (word); g_return_if_fail (len > 0); - if (gedit_spell_checker_check_word (dlg->spell_checker, word, len)) + if (pluma_spell_checker_check_word (dlg->spell_checker, word, len)) { GtkListStore *store; GtkTreeIter iter; @@ -568,7 +568,7 @@ check_word_button_clicked_handler (GtkButton *button, GeditSpellCheckerDialog *d { GSList *sug; - sug = gedit_spell_checker_get_suggestions (dlg->spell_checker, + sug = pluma_spell_checker_get_suggestions (dlg->spell_checker, word, len); @@ -581,14 +581,14 @@ check_word_button_clicked_handler (GtkButton *button, GeditSpellCheckerDialog *d } static void -add_word_button_clicked_handler (GtkButton *button, GeditSpellCheckerDialog *dlg) +add_word_button_clicked_handler (GtkButton *button, PlumaSpellCheckerDialog *dlg) { gchar *word; - g_return_if_fail (GEDIT_IS_SPELL_CHECKER_DIALOG (dlg)); + g_return_if_fail (PLUMA_IS_SPELL_CHECKER_DIALOG (dlg)); g_return_if_fail (dlg->misspelled_word != NULL); - gedit_spell_checker_add_word_to_personal (dlg->spell_checker, + pluma_spell_checker_add_word_to_personal (dlg->spell_checker, dlg->misspelled_word, -1); @@ -600,11 +600,11 @@ add_word_button_clicked_handler (GtkButton *button, GeditSpellCheckerDialog *dlg } static void -ignore_button_clicked_handler (GtkButton *button, GeditSpellCheckerDialog *dlg) +ignore_button_clicked_handler (GtkButton *button, PlumaSpellCheckerDialog *dlg) { gchar *word; - g_return_if_fail (GEDIT_IS_SPELL_CHECKER_DIALOG (dlg)); + g_return_if_fail (PLUMA_IS_SPELL_CHECKER_DIALOG (dlg)); g_return_if_fail (dlg->misspelled_word != NULL); word = g_strdup (dlg->misspelled_word); @@ -615,14 +615,14 @@ ignore_button_clicked_handler (GtkButton *button, GeditSpellCheckerDialog *dlg) } static void -ignore_all_button_clicked_handler (GtkButton *button, GeditSpellCheckerDialog *dlg) +ignore_all_button_clicked_handler (GtkButton *button, PlumaSpellCheckerDialog *dlg) { gchar *word; - g_return_if_fail (GEDIT_IS_SPELL_CHECKER_DIALOG (dlg)); + g_return_if_fail (PLUMA_IS_SPELL_CHECKER_DIALOG (dlg)); g_return_if_fail (dlg->misspelled_word != NULL); - gedit_spell_checker_add_word_to_session (dlg->spell_checker, + pluma_spell_checker_add_word_to_session (dlg->spell_checker, dlg->misspelled_word, -1); @@ -634,19 +634,19 @@ ignore_all_button_clicked_handler (GtkButton *button, GeditSpellCheckerDialog *d } static void -change_button_clicked_handler (GtkButton *button, GeditSpellCheckerDialog *dlg) +change_button_clicked_handler (GtkButton *button, PlumaSpellCheckerDialog *dlg) { gchar *word; gchar *change; - g_return_if_fail (GEDIT_IS_SPELL_CHECKER_DIALOG (dlg)); + g_return_if_fail (PLUMA_IS_SPELL_CHECKER_DIALOG (dlg)); g_return_if_fail (dlg->misspelled_word != NULL); change = g_strdup (gtk_entry_get_text (GTK_ENTRY (dlg->word_entry))); g_return_if_fail (change != NULL); g_return_if_fail (*change != '\0'); - gedit_spell_checker_set_correction (dlg->spell_checker, + pluma_spell_checker_set_correction (dlg->spell_checker, dlg->misspelled_word, -1, change, -1); @@ -663,27 +663,27 @@ static void suggestions_list_row_activated_handler (GtkTreeView *view, GtkTreePath *path, GtkTreeViewColumn *column, - GeditSpellCheckerDialog *dlg) + PlumaSpellCheckerDialog *dlg) { - g_return_if_fail (GEDIT_IS_SPELL_CHECKER_DIALOG (dlg)); + g_return_if_fail (PLUMA_IS_SPELL_CHECKER_DIALOG (dlg)); change_button_clicked_handler (GTK_BUTTON (dlg->change_button), dlg); } static void -change_all_button_clicked_handler (GtkButton *button, GeditSpellCheckerDialog *dlg) +change_all_button_clicked_handler (GtkButton *button, PlumaSpellCheckerDialog *dlg) { gchar *word; gchar *change; - g_return_if_fail (GEDIT_IS_SPELL_CHECKER_DIALOG (dlg)); + g_return_if_fail (PLUMA_IS_SPELL_CHECKER_DIALOG (dlg)); g_return_if_fail (dlg->misspelled_word != NULL); change = g_strdup (gtk_entry_get_text (GTK_ENTRY (dlg->word_entry))); g_return_if_fail (change != NULL); g_return_if_fail (*change != '\0'); - gedit_spell_checker_set_correction (dlg->spell_checker, + pluma_spell_checker_set_correction (dlg->spell_checker, dlg->misspelled_word, -1, change, -1); @@ -696,11 +696,11 @@ change_all_button_clicked_handler (GtkButton *button, GeditSpellCheckerDialog *d } void -gedit_spell_checker_dialog_set_completed (GeditSpellCheckerDialog *dlg) +pluma_spell_checker_dialog_set_completed (PlumaSpellCheckerDialog *dlg) { gchar *tmp; - g_return_if_fail (GEDIT_IS_SPELL_CHECKER_DIALOG (dlg)); + g_return_if_fail (PLUMA_IS_SPELL_CHECKER_DIALOG (dlg)); tmp = g_strdup_printf("<b>%s</b>", _("Completed spell checking")); gtk_label_set_label (GTK_LABEL (dlg->misspelled_word_label), diff --git a/plugins/spell/pluma-spell-checker-dialog.h b/plugins/spell/pluma-spell-checker-dialog.h new file mode 100755 index 00000000..5a4082e3 --- /dev/null +++ b/plugins/spell/pluma-spell-checker-dialog.h @@ -0,0 +1,92 @@ +/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * pluma-spell-checker-dialog.h + * This file is part of pluma + * + * Copyright (C) 2002 Paolo Maggi + * + * 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 of the License, 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., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* + * Modified by the pluma Team, 2002. See the AUTHORS file for a + * list of people on the pluma Team. + * See the ChangeLog files for a list of changes. + */ + +#ifndef __PLUMA_SPELL_CHECKER_DIALOG_H__ +#define __PLUMA_SPELL_CHECKER_DIALOG_H__ + +#include <gtk/gtk.h> +#include "pluma-spell-checker.h" + +G_BEGIN_DECLS + +#define PLUMA_TYPE_SPELL_CHECKER_DIALOG (pluma_spell_checker_dialog_get_type ()) +#define PLUMA_SPELL_CHECKER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PLUMA_TYPE_SPELL_CHECKER_DIALOG, PlumaSpellCheckerDialog)) +#define PLUMA_SPELL_CHECKER_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PLUMA_TYPE_SPELL_CHECKER_DIALOG, PlumaSpellCheckerDialog)) +#define PLUMA_IS_SPELL_CHECKER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PLUMA_TYPE_SPELL_CHECKER_DIALOG)) +#define PLUMA_IS_SPELL_CHECKER_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PLUMA_TYPE_SPELL_CHECKER_DIALOG)) +#define PLUMA_SPELL_CHECKER_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PLUMA_TYPE_SPELL_CHECKER_DIALOG, PlumaSpellCheckerDialog)) + + +typedef struct _PlumaSpellCheckerDialog PlumaSpellCheckerDialog; + +typedef struct _PlumaSpellCheckerDialogClass PlumaSpellCheckerDialogClass; + +struct _PlumaSpellCheckerDialogClass +{ + GtkWindowClass parent_class; + + /* Signals */ + void (*ignore) (PlumaSpellCheckerDialog *dlg, + const gchar *word); + void (*ignore_all) (PlumaSpellCheckerDialog *dlg, + const gchar *word); + void (*change) (PlumaSpellCheckerDialog *dlg, + const gchar *word, + const gchar *change_to); + void (*change_all) (PlumaSpellCheckerDialog *dlg, + const gchar *word, + const gchar *change_to); + void (*add_word_to_personal) (PlumaSpellCheckerDialog *dlg, + const gchar *word); + +}; + +GType pluma_spell_checker_dialog_get_type (void) G_GNUC_CONST; + +/* Constructors */ +GtkWidget *pluma_spell_checker_dialog_new (const gchar *data_dir); +GtkWidget *pluma_spell_checker_dialog_new_from_spell_checker + (PlumaSpellChecker *spell, + const gchar *data_dir); + +void pluma_spell_checker_dialog_set_spell_checker + (PlumaSpellCheckerDialog *dlg, + PlumaSpellChecker *spell); +void pluma_spell_checker_dialog_set_misspelled_word + (PlumaSpellCheckerDialog *dlg, + const gchar* word, + gint len); + +void pluma_spell_checker_dialog_set_completed + (PlumaSpellCheckerDialog *dlg); + +G_END_DECLS + +#endif /* __PLUMA_SPELL_CHECKER_DIALOG_H__ */ + diff --git a/plugins/spell/gedit-spell-checker-language.c b/plugins/spell/pluma-spell-checker-language.c index ae7e2422..042e7706 100755 --- a/plugins/spell/gedit-spell-checker-language.c +++ b/plugins/spell/pluma-spell-checker-language.c @@ -1,7 +1,7 @@ /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* - * gedit-spell-checker-language.c - * This file is part of gedit + * pluma-spell-checker-language.c + * This file is part of pluma * * Copyright (C) 2006 Paolo Maggi * @@ -22,8 +22,8 @@ */ /* - * Modified by the gedit Team, 2006. See the AUTHORS file for a - * list of people on the gedit Team. + * Modified by the pluma Team, 2006. See the AUTHORS file for a + * list of people on the pluma Team. * See the ChangeLog files for a list of changes. */ @@ -43,16 +43,16 @@ #include <glib/gi18n.h> #include <libxml/xmlreader.h> -#include "gedit-spell-checker-language.h" +#include "pluma-spell-checker-language.h" -#include <gedit/gedit-debug.h> +#include <pluma/pluma-debug.h> #define ISO_639_DOMAIN "iso_639" #define ISO_3166_DOMAIN "iso_3166" #define ISOCODESLOCALEDIR ISO_CODES_PREFIX "/share/locale" -struct _GeditSpellCheckerLanguage +struct _PlumaSpellCheckerLanguage { gchar *abrev; gchar *name; @@ -154,7 +154,7 @@ load_iso_entries (int iso, char *filename; int ret = -1; - gedit_debug_message (DEBUG_PLUGINS, "Loading ISO-%d codes", iso); + pluma_debug_message (DEBUG_PLUGINS, "Loading ISO-%d codes", iso); filename = g_strdup_printf (ISO_CODES_PREFIX "/share/xml/iso-codes/iso_%d.xml", iso); reader = xmlNewTextReaderFilename (filename); @@ -331,8 +331,8 @@ key_cmp (gconstpointer a, gconstpointer b, gpointer user_data) } static gint -lang_cmp (const GeditSpellCheckerLanguage *a, - const GeditSpellCheckerLanguage *b) +lang_cmp (const PlumaSpellCheckerLanguage *a, + const PlumaSpellCheckerLanguage *b) { return g_utf8_collate (a->name, b->name); } @@ -342,7 +342,7 @@ build_langs_list (const gchar *key, const gchar *value, gpointer data) { - GeditSpellCheckerLanguage *lang = g_new (GeditSpellCheckerLanguage, 1); + PlumaSpellCheckerLanguage *lang = g_new (PlumaSpellCheckerLanguage, 1); lang->abrev = g_strdup (key); lang->name = g_strdup (value); @@ -355,7 +355,7 @@ build_langs_list (const gchar *key, } const GSList * -gedit_spell_checker_get_available_languages (void) +pluma_spell_checker_get_available_languages (void) { EnchantBroker *broker; GTree *dicts; @@ -397,7 +397,7 @@ gedit_spell_checker_get_available_languages (void) } const gchar * -gedit_spell_checker_language_to_string (const GeditSpellCheckerLanguage *lang) +pluma_spell_checker_language_to_string (const PlumaSpellCheckerLanguage *lang) { if (lang == NULL) /* Translators: this refers the Default language used by the @@ -409,25 +409,25 @@ gedit_spell_checker_language_to_string (const GeditSpellCheckerLanguage *lang) } const gchar * -gedit_spell_checker_language_to_key (const GeditSpellCheckerLanguage *lang) +pluma_spell_checker_language_to_key (const PlumaSpellCheckerLanguage *lang) { g_return_val_if_fail (lang != NULL, NULL); return lang->abrev; } -const GeditSpellCheckerLanguage * -gedit_spell_checker_language_from_key (const gchar *key) +const PlumaSpellCheckerLanguage * +pluma_spell_checker_language_from_key (const gchar *key) { const GSList *langs; g_return_val_if_fail (key != NULL, NULL); - langs = gedit_spell_checker_get_available_languages (); + langs = pluma_spell_checker_get_available_languages (); while (langs != NULL) { - const GeditSpellCheckerLanguage *l = (const GeditSpellCheckerLanguage *)langs->data; + const PlumaSpellCheckerLanguage *l = (const PlumaSpellCheckerLanguage *)langs->data; if (g_ascii_strcasecmp (key, l->abrev) == 0) return l; diff --git a/plugins/spell/gedit-spell-checker-language.h b/plugins/spell/pluma-spell-checker-language.h index 7e62de65..8bae47a4 100755 --- a/plugins/spell/gedit-spell-checker-language.h +++ b/plugins/spell/pluma-spell-checker-language.h @@ -1,7 +1,7 @@ /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* - * gedit-spell-checker-language.h - * This file is part of gedit + * pluma-spell-checker-language.h + * This file is part of pluma * * Copyright (C) 2006 Paolo Maggi * @@ -22,30 +22,30 @@ */ /* - * Modified by the gedit Team, 2006. See the AUTHORS file for a - * list of people on the gedit Team. + * Modified by the pluma Team, 2006. See the AUTHORS file for a + * list of people on the pluma Team. * See the ChangeLog files for a list of changes. */ -#ifndef __GEDIT_SPELL_CHECKER_LANGUAGE_H__ -#define __GEDIT_SPELL_CHECKER_LANGUAGE_H__ +#ifndef __PLUMA_SPELL_CHECKER_LANGUAGE_H__ +#define __PLUMA_SPELL_CHECKER_LANGUAGE_H__ #include <glib.h> G_BEGIN_DECLS -typedef struct _GeditSpellCheckerLanguage GeditSpellCheckerLanguage; +typedef struct _PlumaSpellCheckerLanguage PlumaSpellCheckerLanguage; -const gchar *gedit_spell_checker_language_to_string (const GeditSpellCheckerLanguage *lang); +const gchar *pluma_spell_checker_language_to_string (const PlumaSpellCheckerLanguage *lang); -const gchar *gedit_spell_checker_language_to_key (const GeditSpellCheckerLanguage *lang); +const gchar *pluma_spell_checker_language_to_key (const PlumaSpellCheckerLanguage *lang); -const GeditSpellCheckerLanguage *gedit_spell_checker_language_from_key (const gchar *key); +const PlumaSpellCheckerLanguage *pluma_spell_checker_language_from_key (const gchar *key); -/* GSList contains "GeditSpellCheckerLanguage*" items */ -const GSList *gedit_spell_checker_get_available_languages +/* GSList contains "PlumaSpellCheckerLanguage*" items */ +const GSList *pluma_spell_checker_get_available_languages (void); G_END_DECLS -#endif /* __GEDIT_SPELL_CHECKER_LANGUAGE_H__ */ +#endif /* __PLUMA_SPELL_CHECKER_LANGUAGE_H__ */ diff --git a/plugins/spell/gedit-spell-checker.c b/plugins/spell/pluma-spell-checker.c index 51b8d8a8..24cfcdd5 100755 --- a/plugins/spell/gedit-spell-checker.c +++ b/plugins/spell/pluma-spell-checker.c @@ -1,7 +1,7 @@ /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* - * gedit-spell-checker.c - * This file is part of gedit + * pluma-spell-checker.c + * This file is part of pluma * * Copyright (C) 2002-2006 Paolo Maggi * @@ -22,8 +22,8 @@ */ /* - * Modified by the gedit Team, 2002-2006. See the AUTHORS file for a - * list of people on the gedit Team. + * Modified by the pluma Team, 2002-2006. See the AUTHORS file for a + * list of people on the pluma Team. * See the ChangeLog files for a list of changes. */ @@ -38,17 +38,17 @@ #include <glib/gi18n.h> #include <glib.h> -#include "gedit-spell-checker.h" -#include "gedit-spell-utils.h" -#include "gedit-spell-marshal.h" +#include "pluma-spell-checker.h" +#include "pluma-spell-utils.h" +#include "pluma-spell-marshal.h" -struct _GeditSpellChecker +struct _PlumaSpellChecker { GObject parent_instance; EnchantDict *dict; EnchantBroker *broker; - const GeditSpellCheckerLanguage *active_lang; + const PlumaSpellCheckerLanguage *active_lang; }; /* GObject properties */ @@ -69,16 +69,16 @@ enum { static guint signals[LAST_SIGNAL] = { 0 }; -G_DEFINE_TYPE(GeditSpellChecker, gedit_spell_checker, G_TYPE_OBJECT) +G_DEFINE_TYPE(PlumaSpellChecker, pluma_spell_checker, G_TYPE_OBJECT) static void -gedit_spell_checker_set_property (GObject *object, +pluma_spell_checker_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { /* - GeditSpellChecker *spell = GEDIT_SPELL_CHECKER (object); + PlumaSpellChecker *spell = PLUMA_SPELL_CHECKER (object); */ switch (prop_id) @@ -92,13 +92,13 @@ gedit_spell_checker_set_property (GObject *object, } static void -gedit_spell_checker_get_property (GObject *object, +pluma_spell_checker_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { /* - GeditSpellChecker *spell = GEDIT_SPELL_CHECKER (object); + PlumaSpellChecker *spell = PLUMA_SPELL_CHECKER (object); */ switch (prop_id) @@ -111,13 +111,13 @@ gedit_spell_checker_get_property (GObject *object, } static void -gedit_spell_checker_finalize (GObject *object) +pluma_spell_checker_finalize (GObject *object) { - GeditSpellChecker *spell_checker; + PlumaSpellChecker *spell_checker; - g_return_if_fail (GEDIT_IS_SPELL_CHECKER (object)); + g_return_if_fail (PLUMA_IS_SPELL_CHECKER (object)); - spell_checker = GEDIT_SPELL_CHECKER (object); + spell_checker = PLUMA_SPELL_CHECKER (object); if (spell_checker->dict != NULL) enchant_broker_free_dict (spell_checker->broker, spell_checker->dict); @@ -125,20 +125,20 @@ gedit_spell_checker_finalize (GObject *object) if (spell_checker->broker != NULL) enchant_broker_free (spell_checker->broker); - G_OBJECT_CLASS (gedit_spell_checker_parent_class)->finalize (object); + G_OBJECT_CLASS (pluma_spell_checker_parent_class)->finalize (object); } static void -gedit_spell_checker_class_init (GeditSpellCheckerClass * klass) +pluma_spell_checker_class_init (PlumaSpellCheckerClass * klass) { GObjectClass *object_class; object_class = G_OBJECT_CLASS (klass); - object_class->set_property = gedit_spell_checker_set_property; - object_class->get_property = gedit_spell_checker_get_property; + object_class->set_property = pluma_spell_checker_set_property; + object_class->get_property = pluma_spell_checker_get_property; - object_class->finalize = gedit_spell_checker_finalize; + object_class->finalize = pluma_spell_checker_finalize; g_object_class_install_property (object_class, PROP_LANGUAGE, @@ -151,9 +151,9 @@ gedit_spell_checker_class_init (GeditSpellCheckerClass * klass) g_signal_new ("add_word_to_personal", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GeditSpellCheckerClass, add_word_to_personal), + G_STRUCT_OFFSET (PlumaSpellCheckerClass, add_word_to_personal), NULL, NULL, - gedit_marshal_VOID__STRING_INT, + pluma_marshal_VOID__STRING_INT, G_TYPE_NONE, 2, G_TYPE_STRING, @@ -163,9 +163,9 @@ gedit_spell_checker_class_init (GeditSpellCheckerClass * klass) g_signal_new ("add_word_to_session", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GeditSpellCheckerClass, add_word_to_session), + G_STRUCT_OFFSET (PlumaSpellCheckerClass, add_word_to_session), NULL, NULL, - gedit_marshal_VOID__STRING_INT, + pluma_marshal_VOID__STRING_INT, G_TYPE_NONE, 2, G_TYPE_STRING, @@ -175,9 +175,9 @@ gedit_spell_checker_class_init (GeditSpellCheckerClass * klass) g_signal_new ("set_language", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GeditSpellCheckerClass, set_language), + G_STRUCT_OFFSET (PlumaSpellCheckerClass, set_language), NULL, NULL, - gedit_marshal_VOID__POINTER, + pluma_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER); @@ -186,28 +186,28 @@ gedit_spell_checker_class_init (GeditSpellCheckerClass * klass) g_signal_new ("clear_session", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GeditSpellCheckerClass, clear_session), + G_STRUCT_OFFSET (PlumaSpellCheckerClass, clear_session), NULL, NULL, - gedit_marshal_VOID__VOID, + pluma_marshal_VOID__VOID, G_TYPE_NONE, 0); } static void -gedit_spell_checker_init (GeditSpellChecker *spell_checker) +pluma_spell_checker_init (PlumaSpellChecker *spell_checker) { spell_checker->broker = enchant_broker_init (); spell_checker->dict = NULL; spell_checker->active_lang = NULL; } -GeditSpellChecker * -gedit_spell_checker_new (void) +PlumaSpellChecker * +pluma_spell_checker_new (void) { - GeditSpellChecker *spell; + PlumaSpellChecker *spell; - spell = GEDIT_SPELL_CHECKER ( - g_object_new (GEDIT_TYPE_SPELL_CHECKER, NULL)); + spell = PLUMA_SPELL_CHECKER ( + g_object_new (PLUMA_TYPE_SPELL_CHECKER, NULL)); g_return_val_if_fail (spell != NULL, NULL); @@ -215,8 +215,8 @@ gedit_spell_checker_new (void) } static gboolean -lazy_init (GeditSpellChecker *spell, - const GeditSpellCheckerLanguage *language) +lazy_init (PlumaSpellChecker *spell, + const PlumaSpellCheckerLanguage *language) { if (spell->dict != NULL) return TRUE; @@ -232,13 +232,13 @@ lazy_init (GeditSpellChecker *spell, else { /* First try to get a default language */ - const GeditSpellCheckerLanguage *l; + const PlumaSpellCheckerLanguage *l; gint i = 0; const gchar * const *lang_tags = g_get_language_names (); while (lang_tags [i]) { - l = gedit_spell_checker_language_from_key (lang_tags [i]); + l = pluma_spell_checker_language_from_key (lang_tags [i]); if (l != NULL) { @@ -252,22 +252,22 @@ lazy_init (GeditSpellChecker *spell, /* Second try to get a default language */ if (spell->active_lang == NULL) - spell->active_lang = gedit_spell_checker_language_from_key ("en_US"); + spell->active_lang = pluma_spell_checker_language_from_key ("en_US"); /* Last try to get a default language */ if (spell->active_lang == NULL) { const GSList *langs; - langs = gedit_spell_checker_get_available_languages (); + langs = pluma_spell_checker_get_available_languages (); if (langs != NULL) - spell->active_lang = (const GeditSpellCheckerLanguage *)langs->data; + spell->active_lang = (const PlumaSpellCheckerLanguage *)langs->data; } if (spell->active_lang != NULL) { const gchar *key; - key = gedit_spell_checker_language_to_key (spell->active_lang); + key = pluma_spell_checker_language_to_key (spell->active_lang); spell->dict = enchant_broker_request_dict (spell->broker, key); @@ -287,12 +287,12 @@ lazy_init (GeditSpellChecker *spell, } gboolean -gedit_spell_checker_set_language (GeditSpellChecker *spell, - const GeditSpellCheckerLanguage *language) +pluma_spell_checker_set_language (PlumaSpellChecker *spell, + const PlumaSpellCheckerLanguage *language) { gboolean ret; - g_return_val_if_fail (GEDIT_IS_SPELL_CHECKER (spell), FALSE); + g_return_val_if_fail (PLUMA_IS_SPELL_CHECKER (spell), FALSE); if (spell->dict != NULL) { @@ -306,15 +306,15 @@ gedit_spell_checker_set_language (GeditSpellChecker *spell, g_signal_emit (G_OBJECT (spell), signals[SET_LANGUAGE], 0, language); else g_warning ("Spell checker plugin: cannot use language %s.", - gedit_spell_checker_language_to_string (language)); + pluma_spell_checker_language_to_string (language)); return ret; } -const GeditSpellCheckerLanguage * -gedit_spell_checker_get_language (GeditSpellChecker *spell) +const PlumaSpellCheckerLanguage * +pluma_spell_checker_get_language (PlumaSpellChecker *spell) { - g_return_val_if_fail (GEDIT_IS_SPELL_CHECKER (spell), NULL); + g_return_val_if_fail (PLUMA_IS_SPELL_CHECKER (spell), NULL); if (!lazy_init (spell, spell->active_lang)) return NULL; @@ -323,14 +323,14 @@ gedit_spell_checker_get_language (GeditSpellChecker *spell) } gboolean -gedit_spell_checker_check_word (GeditSpellChecker *spell, +pluma_spell_checker_check_word (PlumaSpellChecker *spell, const gchar *word, gssize len) { gint enchant_result; gboolean res = FALSE; - g_return_val_if_fail (GEDIT_IS_SPELL_CHECKER (spell), FALSE); + g_return_val_if_fail (PLUMA_IS_SPELL_CHECKER (spell), FALSE); g_return_val_if_fail (word != NULL, FALSE); if (!lazy_init (spell, spell->active_lang)) @@ -339,10 +339,10 @@ gedit_spell_checker_check_word (GeditSpellChecker *spell, if (len < 0) len = strlen (word); - if (strcmp (word, "gedit") == 0) + if (strcmp (word, "pluma") == 0) return TRUE; - if (gedit_spell_utils_is_digit (word, len)) + if (pluma_spell_utils_is_digit (word, len)) return TRUE; g_return_val_if_fail (spell->dict != NULL, FALSE); @@ -376,7 +376,7 @@ gedit_spell_checker_check_word (GeditSpellChecker *spell, /* return NULL on error or if no suggestions are found */ GSList * -gedit_spell_checker_get_suggestions (GeditSpellChecker *spell, +pluma_spell_checker_get_suggestions (PlumaSpellChecker *spell, const gchar *word, gssize len) { @@ -385,7 +385,7 @@ gedit_spell_checker_get_suggestions (GeditSpellChecker *spell, GSList *suggestions_list = NULL; gint i; - g_return_val_if_fail (GEDIT_IS_SPELL_CHECKER (spell), NULL); + g_return_val_if_fail (PLUMA_IS_SPELL_CHECKER (spell), NULL); g_return_val_if_fail (word != NULL, NULL); if (!lazy_init (spell, spell->active_lang)) @@ -418,11 +418,11 @@ gedit_spell_checker_get_suggestions (GeditSpellChecker *spell, } gboolean -gedit_spell_checker_add_word_to_personal (GeditSpellChecker *spell, +pluma_spell_checker_add_word_to_personal (PlumaSpellChecker *spell, const gchar *word, gssize len) { - g_return_val_if_fail (GEDIT_IS_SPELL_CHECKER (spell), FALSE); + g_return_val_if_fail (PLUMA_IS_SPELL_CHECKER (spell), FALSE); g_return_val_if_fail (word != NULL, FALSE); if (!lazy_init (spell, spell->active_lang)) @@ -441,11 +441,11 @@ gedit_spell_checker_add_word_to_personal (GeditSpellChecker *spell, } gboolean -gedit_spell_checker_add_word_to_session (GeditSpellChecker *spell, +pluma_spell_checker_add_word_to_session (PlumaSpellChecker *spell, const gchar *word, gssize len) { - g_return_val_if_fail (GEDIT_IS_SPELL_CHECKER (spell), FALSE); + g_return_val_if_fail (PLUMA_IS_SPELL_CHECKER (spell), FALSE); g_return_val_if_fail (word != NULL, FALSE); if (!lazy_init (spell, spell->active_lang)) @@ -464,9 +464,9 @@ gedit_spell_checker_add_word_to_session (GeditSpellChecker *spell, } gboolean -gedit_spell_checker_clear_session (GeditSpellChecker *spell) +pluma_spell_checker_clear_session (PlumaSpellChecker *spell) { - g_return_val_if_fail (GEDIT_IS_SPELL_CHECKER (spell), FALSE); + g_return_val_if_fail (PLUMA_IS_SPELL_CHECKER (spell), FALSE); /* free and re-request dictionary */ if (spell->dict != NULL) @@ -488,13 +488,13 @@ gedit_spell_checker_clear_session (GeditSpellChecker *spell) * 'replacement' */ gboolean -gedit_spell_checker_set_correction (GeditSpellChecker *spell, +pluma_spell_checker_set_correction (PlumaSpellChecker *spell, const gchar *word, gssize w_len, const gchar *replacement, gssize r_len) { - g_return_val_if_fail (GEDIT_IS_SPELL_CHECKER (spell), FALSE); + g_return_val_if_fail (PLUMA_IS_SPELL_CHECKER (spell), FALSE); g_return_val_if_fail (word != NULL, FALSE); g_return_val_if_fail (replacement != NULL, FALSE); diff --git a/plugins/spell/pluma-spell-checker.h b/plugins/spell/pluma-spell-checker.h new file mode 100755 index 00000000..ed8c1756 --- /dev/null +++ b/plugins/spell/pluma-spell-checker.h @@ -0,0 +1,109 @@ +/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * pluma-spell-checker.h + * This file is part of pluma + * + * Copyright (C) 2002-2006 Paolo Maggi + * + * 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 of the License, 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., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* + * Modified by the pluma Team, 2002. See the AUTHORS file for a + * list of people on the pluma Team. + * See the ChangeLog files for a list of changes. + */ + +#ifndef __PLUMA_SPELL_CHECKER_H__ +#define __PLUMA_SPELL_CHECKER_H__ + +#include <glib.h> +#include <glib-object.h> + +#include "pluma-spell-checker-language.h" + +G_BEGIN_DECLS + +#define PLUMA_TYPE_SPELL_CHECKER (pluma_spell_checker_get_type ()) +#define PLUMA_SPELL_CHECKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PLUMA_TYPE_SPELL_CHECKER, PlumaSpellChecker)) +#define PLUMA_SPELL_CHECKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PLUMA_TYPE_SPELL_CHECKER, PlumaSpellChecker)) +#define PLUMA_IS_SPELL_CHECKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PLUMA_TYPE_SPELL_CHECKER)) +#define PLUMA_IS_SPELL_CHECKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PLUMA_TYPE_SPELL_CHECKER)) +#define PLUMA_SPELL_CHECKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PLUMA_TYPE_SPELL_CHECKER, PlumaSpellChecker)) + +typedef struct _PlumaSpellChecker PlumaSpellChecker; + +typedef struct _PlumaSpellCheckerClass PlumaSpellCheckerClass; + +struct _PlumaSpellCheckerClass +{ + GObjectClass parent_class; + + /* Signals */ + void (*add_word_to_personal) (PlumaSpellChecker *spell, + const gchar *word, + gint len); + + void (*add_word_to_session) (PlumaSpellChecker *spell, + const gchar *word, + gint len); + + void (*set_language) (PlumaSpellChecker *spell, + const PlumaSpellCheckerLanguage *lang); + + void (*clear_session) (PlumaSpellChecker *spell); +}; + + +GType pluma_spell_checker_get_type (void) G_GNUC_CONST; + +/* Constructors */ +PlumaSpellChecker *pluma_spell_checker_new (void); + +gboolean pluma_spell_checker_set_language (PlumaSpellChecker *spell, + const PlumaSpellCheckerLanguage *lang); +const PlumaSpellCheckerLanguage + *pluma_spell_checker_get_language (PlumaSpellChecker *spell); + +gboolean pluma_spell_checker_check_word (PlumaSpellChecker *spell, + const gchar *word, + gssize len); + +GSList *pluma_spell_checker_get_suggestions (PlumaSpellChecker *spell, + const gchar *word, + gssize len); + +gboolean pluma_spell_checker_add_word_to_personal + (PlumaSpellChecker *spell, + const gchar *word, + gssize len); + +gboolean pluma_spell_checker_add_word_to_session + (PlumaSpellChecker *spell, + const gchar *word, + gssize len); + +gboolean pluma_spell_checker_clear_session (PlumaSpellChecker *spell); + +gboolean pluma_spell_checker_set_correction (PlumaSpellChecker *spell, + const gchar *word, + gssize w_len, + const gchar *replacement, + gssize r_len); +G_END_DECLS + +#endif /* __PLUMA_SPELL_CHECKER_H__ */ + diff --git a/plugins/spell/gedit-spell-language-dialog.c b/plugins/spell/pluma-spell-language-dialog.c index 1abba17f..22a14373 100755 --- a/plugins/spell/gedit-spell-language-dialog.c +++ b/plugins/spell/pluma-spell-language-dialog.c @@ -1,7 +1,7 @@ /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* - * gedit-spell-language-dialog.c - * This file is part of gedit + * pluma-spell-language-dialog.c + * This file is part of pluma * * Copyright (C) 2002 Paolo Maggi * @@ -22,8 +22,8 @@ */ /* - * Modified by the gedit Team, 2002. See the AUTHORS file for a - * list of people on the gedit Team. + * Modified by the pluma Team, 2002. See the AUTHORS file for a + * list of people on the pluma Team. * See the ChangeLog files for a list of changes. */ @@ -33,10 +33,10 @@ #include <glib/gi18n.h> #include <gtk/gtk.h> -#include <gedit/gedit-utils.h> -#include <gedit/gedit-help.h> -#include "gedit-spell-language-dialog.h" -#include "gedit-spell-checker-language.h" +#include <pluma/pluma-utils.h> +#include <pluma/pluma-help.h> +#include "pluma-spell-language-dialog.h" +#include "pluma-spell-checker-language.h" enum @@ -47,7 +47,7 @@ enum }; -struct _GeditSpellLanguageDialog +struct _PlumaSpellLanguageDialog { GtkDialog dialog; @@ -55,11 +55,11 @@ struct _GeditSpellLanguageDialog GtkTreeModel *model; }; -G_DEFINE_TYPE(GeditSpellLanguageDialog, gedit_spell_language_dialog, GTK_TYPE_DIALOG) +G_DEFINE_TYPE(PlumaSpellLanguageDialog, pluma_spell_language_dialog, GTK_TYPE_DIALOG) static void -gedit_spell_language_dialog_class_init (GeditSpellLanguageDialogClass *klass) +pluma_spell_language_dialog_class_init (PlumaSpellLanguageDialogClass *klass) { /* GObjectClass *object_class = G_OBJECT_CLASS (klass); */ } @@ -70,9 +70,9 @@ dialog_response_handler (GtkDialog *dlg, { if (res_id == GTK_RESPONSE_HELP) { - gedit_help_display (GTK_WINDOW (dlg), + pluma_help_display (GTK_WINDOW (dlg), NULL, - "gedit-spell-checker-plugin"); + "pluma-spell-checker-plugin"); g_signal_stop_emission_by_name (dlg, "response"); } @@ -109,13 +109,13 @@ static void language_row_activated (GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *column, - GeditSpellLanguageDialog *dialog) + PlumaSpellLanguageDialog *dialog) { gtk_dialog_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK); } static void -create_dialog (GeditSpellLanguageDialog *dlg, +create_dialog (PlumaSpellLanguageDialog *dlg, const gchar *data_dir) { GtkWidget *error_widget; @@ -158,7 +158,7 @@ create_dialog (GeditSpellLanguageDialog *dlg, NULL); ui_file = g_build_filename (data_dir, "languages-dialog.ui", NULL); - ret = gedit_utils_get_ui_objects (ui_file, + ret = pluma_utils_get_ui_objects (ui_file, root_objects, &error_widget, "content", &content, @@ -216,14 +216,14 @@ create_dialog (GeditSpellLanguageDialog *dlg, } static void -gedit_spell_language_dialog_init (GeditSpellLanguageDialog *dlg) +pluma_spell_language_dialog_init (PlumaSpellLanguageDialog *dlg) { } static void -populate_language_list (GeditSpellLanguageDialog *dlg, - const GeditSpellCheckerLanguage *cur_lang) +populate_language_list (PlumaSpellLanguageDialog *dlg, + const PlumaSpellCheckerLanguage *cur_lang) { GtkListStore *store; GtkTreeIter iter; @@ -233,13 +233,13 @@ populate_language_list (GeditSpellLanguageDialog *dlg, /* create list store */ store = GTK_LIST_STORE (dlg->model); - langs = gedit_spell_checker_get_available_languages (); + langs = pluma_spell_checker_get_available_languages (); while (langs) { const gchar *name; - name = gedit_spell_checker_language_to_string ((const GeditSpellCheckerLanguage*)langs->data); + name = pluma_spell_checker_language_to_string ((const PlumaSpellCheckerLanguage*)langs->data); gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, @@ -262,15 +262,15 @@ populate_language_list (GeditSpellLanguageDialog *dlg, } GtkWidget * -gedit_spell_language_dialog_new (GtkWindow *parent, - const GeditSpellCheckerLanguage *cur_lang, +pluma_spell_language_dialog_new (GtkWindow *parent, + const PlumaSpellCheckerLanguage *cur_lang, const gchar *data_dir) { - GeditSpellLanguageDialog *dlg; + PlumaSpellLanguageDialog *dlg; g_return_val_if_fail (GTK_IS_WINDOW (parent), NULL); - dlg = g_object_new (GEDIT_TYPE_SPELL_LANGUAGE_DIALOG, NULL); + dlg = g_object_new (PLUMA_TYPE_SPELL_LANGUAGE_DIALOG, NULL); create_dialog (dlg, data_dir); @@ -282,11 +282,11 @@ gedit_spell_language_dialog_new (GtkWindow *parent, return GTK_WIDGET (dlg); } -const GeditSpellCheckerLanguage * -gedit_spell_language_get_selected_language (GeditSpellLanguageDialog *dlg) +const PlumaSpellCheckerLanguage * +pluma_spell_language_get_selected_language (PlumaSpellLanguageDialog *dlg) { GValue value = {0, }; - const GeditSpellCheckerLanguage* lang; + const PlumaSpellCheckerLanguage* lang; GtkTreeIter iter; GtkTreeSelection *selection; @@ -302,7 +302,7 @@ gedit_spell_language_get_selected_language (GeditSpellLanguageDialog *dlg) COLUMN_LANGUAGE_POINTER, &value); - lang = (const GeditSpellCheckerLanguage* ) g_value_get_pointer (&value); + lang = (const PlumaSpellCheckerLanguage* ) g_value_get_pointer (&value); return lang; } diff --git a/plugins/spell/pluma-spell-language-dialog.h b/plugins/spell/pluma-spell-language-dialog.h new file mode 100755 index 00000000..3fc32a0b --- /dev/null +++ b/plugins/spell/pluma-spell-language-dialog.h @@ -0,0 +1,67 @@ +/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * pluma-spell-language-dialog.h + * This file is part of pluma + * + * Copyright (C) 2002 Paolo Maggi + * + * 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 of the License, 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., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* + * Modified by the pluma Team, 2002. See the AUTHORS file for a + * list of people on the pluma Team. + * See the ChangeLog files for a list of changes. + */ + +#ifndef __PLUMA_SPELL_LANGUAGE_DIALOG_H__ +#define __PLUMA_SPELL_LANGUAGE_DIALOG_H__ + +#include <gtk/gtk.h> +#include "pluma-spell-checker-language.h" + +G_BEGIN_DECLS + +#define PLUMA_TYPE_SPELL_LANGUAGE_DIALOG (pluma_spell_language_dialog_get_type()) +#define PLUMA_SPELL_LANGUAGE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PLUMA_TYPE_SPELL_LANGUAGE_DIALOG, PlumaSpellLanguageDialog)) +#define PLUMA_SPELL_LANGUAGE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PLUMA_TYPE_SPELL_LANGUAGE_DIALOG, PlumaSpellLanguageDialogClass)) +#define PLUMA_IS_SPELL_LANGUAGE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PLUMA_TYPE_SPELL_LANGUAGE_DIALOG)) +#define PLUMA_IS_SPELL_LANGUAGE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PLUMA_TYPE_SPELL_LANGUAGE_DIALOG)) +#define PLUMA_SPELL_LANGUAGE_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PLUMA_TYPE_SPELL_LANGUAGE_DIALOG, PlumaSpellLanguageDialogClass)) + + +typedef struct _PlumaSpellLanguageDialog PlumaSpellLanguageDialog; + +typedef struct _PlumaSpellLanguageDialogClass PlumaSpellLanguageDialogClass; + +struct _PlumaSpellLanguageDialogClass +{ + GtkDialogClass parent_class; +}; + +GType pluma_spell_language_dialog_get_type (void) G_GNUC_CONST; + +GtkWidget *pluma_spell_language_dialog_new (GtkWindow *parent, + const PlumaSpellCheckerLanguage *cur_lang, + const gchar *data_dir); + +const PlumaSpellCheckerLanguage * + pluma_spell_language_get_selected_language (PlumaSpellLanguageDialog *dlg); + +G_END_DECLS + +#endif /* __PLUMA_SPELL_LANGUAGE_DIALOG_H__ */ + diff --git a/plugins/spell/gedit-spell-marshal.list b/plugins/spell/pluma-spell-marshal.list index 007dcf7d..007dcf7d 100755 --- a/plugins/spell/gedit-spell-marshal.list +++ b/plugins/spell/pluma-spell-marshal.list diff --git a/plugins/spell/gedit-spell-plugin.c b/plugins/spell/pluma-spell-plugin.c index 6ef78e75..e7dab44a 100755 --- a/plugins/spell/gedit-spell-plugin.c +++ b/plugins/spell/pluma-spell-plugin.c @@ -1,5 +1,5 @@ /* - * gedit-spell-plugin.c + * pluma-spell-plugin.c * * Copyright (C) 2002-2005 Paolo Maggi * @@ -24,40 +24,40 @@ #include <config.h> #endif -#include "gedit-spell-plugin.h" -#include "gedit-spell-utils.h" +#include "pluma-spell-plugin.h" +#include "pluma-spell-utils.h" #include <string.h> /* For strlen */ #include <glib/gi18n.h> #include <gmodule.h> -#include <gedit/gedit-debug.h> -#include <gedit/gedit-prefs-manager.h> -#include <gedit/gedit-statusbar.h> +#include <pluma/pluma-debug.h> +#include <pluma/pluma-prefs-manager.h> +#include <pluma/pluma-statusbar.h> -#include "gedit-spell-checker.h" -#include "gedit-spell-checker-dialog.h" -#include "gedit-spell-language-dialog.h" -#include "gedit-automatic-spell-checker.h" +#include "pluma-spell-checker.h" +#include "pluma-spell-checker-dialog.h" +#include "pluma-spell-language-dialog.h" +#include "pluma-automatic-spell-checker.h" #ifdef G_OS_WIN32 -#include <gedit/gedit-metadata-manager.h> -#define GEDIT_METADATA_ATTRIBUTE_SPELL_LANGUAGE "spell-language" -#define GEDIT_METADATA_ATTRIBUTE_SPELL_ENABLED "spell-enabled" +#include <pluma/pluma-metadata-manager.h> +#define PLUMA_METADATA_ATTRIBUTE_SPELL_LANGUAGE "spell-language" +#define PLUMA_METADATA_ATTRIBUTE_SPELL_ENABLED "spell-enabled" #else -#define GEDIT_METADATA_ATTRIBUTE_SPELL_LANGUAGE "metadata::gedit-spell-language" -#define GEDIT_METADATA_ATTRIBUTE_SPELL_ENABLED "metadata::gedit-spell-enabled" +#define PLUMA_METADATA_ATTRIBUTE_SPELL_LANGUAGE "metadata::pluma-spell-language" +#define PLUMA_METADATA_ATTRIBUTE_SPELL_ENABLED "metadata::pluma-spell-enabled" #endif -#define WINDOW_DATA_KEY "GeditSpellPluginWindowData" +#define WINDOW_DATA_KEY "PlumaSpellPluginWindowData" #define MENU_PATH "/MenuBar/ToolsMenu/ToolsOps_1" -#define GEDIT_SPELL_PLUGIN_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \ - GEDIT_TYPE_SPELL_PLUGIN, \ - GeditSpellPluginPrivate)) +#define PLUMA_SPELL_PLUGIN_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \ + PLUMA_TYPE_SPELL_PLUGIN, \ + PlumaSpellPluginPrivate)) -GEDIT_PLUGIN_REGISTER_TYPE(GeditSpellPlugin, gedit_spell_plugin) +PLUMA_PLUGIN_REGISTER_TYPE(PlumaSpellPlugin, pluma_spell_plugin) typedef struct { @@ -70,13 +70,13 @@ typedef struct typedef struct { - GeditPlugin *plugin; - GeditWindow *window; + PlumaPlugin *plugin; + PlumaWindow *window; } ActionData; static void spell_cb (GtkAction *action, ActionData *action_data); static void set_language_cb (GtkAction *action, ActionData *action_data); -static void auto_spell_cb (GtkAction *action, GeditWindow *window); +static void auto_spell_cb (GtkAction *action, PlumaWindow *window); /* UI actions. */ static const GtkActionEntry action_entries[] = @@ -127,66 +127,66 @@ static GQuark spell_checker_id = 0; static GQuark check_range_id = 0; static void -gedit_spell_plugin_init (GeditSpellPlugin *plugin) +pluma_spell_plugin_init (PlumaSpellPlugin *plugin) { - gedit_debug_message (DEBUG_PLUGINS, "GeditSpellPlugin initializing"); + pluma_debug_message (DEBUG_PLUGINS, "PlumaSpellPlugin initializing"); } static void -gedit_spell_plugin_finalize (GObject *object) +pluma_spell_plugin_finalize (GObject *object) { - gedit_debug_message (DEBUG_PLUGINS, "GeditSpellPlugin finalizing"); + pluma_debug_message (DEBUG_PLUGINS, "PlumaSpellPlugin finalizing"); - G_OBJECT_CLASS (gedit_spell_plugin_parent_class)->finalize (object); + G_OBJECT_CLASS (pluma_spell_plugin_parent_class)->finalize (object); } static void -set_spell_language_cb (GeditSpellChecker *spell, - const GeditSpellCheckerLanguage *lang, - GeditDocument *doc) +set_spell_language_cb (PlumaSpellChecker *spell, + const PlumaSpellCheckerLanguage *lang, + PlumaDocument *doc) { const gchar *key; - g_return_if_fail (GEDIT_IS_DOCUMENT (doc)); + g_return_if_fail (PLUMA_IS_DOCUMENT (doc)); g_return_if_fail (lang != NULL); - key = gedit_spell_checker_language_to_key (lang); + key = pluma_spell_checker_language_to_key (lang); g_return_if_fail (key != NULL); - gedit_document_set_metadata (doc, GEDIT_METADATA_ATTRIBUTE_SPELL_LANGUAGE, + pluma_document_set_metadata (doc, PLUMA_METADATA_ATTRIBUTE_SPELL_LANGUAGE, key, NULL); } static void -set_language_from_metadata (GeditSpellChecker *spell, - GeditDocument *doc) +set_language_from_metadata (PlumaSpellChecker *spell, + PlumaDocument *doc) { - const GeditSpellCheckerLanguage *lang = NULL; + const PlumaSpellCheckerLanguage *lang = NULL; gchar *value = NULL; - value = gedit_document_get_metadata (doc, GEDIT_METADATA_ATTRIBUTE_SPELL_LANGUAGE); + value = pluma_document_get_metadata (doc, PLUMA_METADATA_ATTRIBUTE_SPELL_LANGUAGE); if (value != NULL) { - lang = gedit_spell_checker_language_from_key (value); + lang = pluma_spell_checker_language_from_key (value); g_free (value); } if (lang != NULL) { g_signal_handlers_block_by_func (spell, set_spell_language_cb, doc); - gedit_spell_checker_set_language (spell, lang); + pluma_spell_checker_set_language (spell, lang); g_signal_handlers_unblock_by_func (spell, set_spell_language_cb, doc); } } -static GeditSpellChecker * -get_spell_checker_from_document (GeditDocument *doc) +static PlumaSpellChecker * +get_spell_checker_from_document (PlumaDocument *doc) { - GeditSpellChecker *spell; + PlumaSpellChecker *spell; gpointer data; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); g_return_val_if_fail (doc != NULL, NULL); @@ -194,7 +194,7 @@ get_spell_checker_from_document (GeditDocument *doc) if (data == NULL) { - spell = gedit_spell_checker_new (); + spell = pluma_spell_checker_new (); set_language_from_metadata (spell, doc); @@ -210,19 +210,19 @@ get_spell_checker_from_document (GeditDocument *doc) } else { - g_return_val_if_fail (GEDIT_IS_SPELL_CHECKER (data), NULL); - spell = GEDIT_SPELL_CHECKER (data); + g_return_val_if_fail (PLUMA_IS_SPELL_CHECKER (data), NULL); + spell = PLUMA_SPELL_CHECKER (data); } return spell; } static CheckRange * -get_check_range (GeditDocument *doc) +get_check_range (PlumaDocument *doc) { CheckRange *range; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); g_return_val_if_fail (doc != NULL, NULL); @@ -232,14 +232,14 @@ get_check_range (GeditDocument *doc) } static void -update_current (GeditDocument *doc, +update_current (PlumaDocument *doc, gint current) { CheckRange *range; GtkTextIter iter; GtkTextIter end_iter; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); g_return_if_fail (doc != NULL); g_return_if_fail (current >= 0); @@ -286,20 +286,20 @@ update_current (GeditDocument *doc, } static void -set_check_range (GeditDocument *doc, +set_check_range (PlumaDocument *doc, GtkTextIter *start, GtkTextIter *end) { CheckRange *range; GtkTextIter iter; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); range = get_check_range (doc); if (range == NULL) { - gedit_debug_message (DEBUG_PLUGINS, "There was not a previous check range"); + pluma_debug_message (DEBUG_PLUGINS, "There was not a previous check range"); gtk_text_buffer_get_end_iter (GTK_TEXT_BUFFER (doc), &iter); @@ -320,7 +320,7 @@ set_check_range (GeditDocument *doc, (GDestroyNotify)g_free); } - if (gedit_spell_utils_skip_no_spell_check (start, end)) + if (pluma_spell_utils_skip_no_spell_check (start, end)) { if (!gtk_text_iter_inside_word (end)) { @@ -359,14 +359,14 @@ set_check_range (GeditDocument *doc, } static gchar * -get_current_word (GeditDocument *doc, gint *start, gint *end) +get_current_word (PlumaDocument *doc, gint *start, gint *end) { const CheckRange *range; GtkTextIter end_iter; GtkTextIter current_iter; gint range_end; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); g_return_val_if_fail (doc != NULL, NULL); g_return_val_if_fail (start != NULL, NULL); @@ -387,7 +387,7 @@ get_current_word (GeditDocument *doc, gint *start, gint *end) if (!gtk_text_iter_is_end (&end_iter)) { - gedit_debug_message (DEBUG_PLUGINS, "Current is not end"); + pluma_debug_message (DEBUG_PLUGINS, "Current is not end"); gtk_text_iter_forward_word_end (&end_iter); } @@ -395,7 +395,7 @@ get_current_word (GeditDocument *doc, gint *start, gint *end) *start = gtk_text_iter_get_offset (¤t_iter); *end = MIN (gtk_text_iter_get_offset (&end_iter), range_end); - gedit_debug_message (DEBUG_PLUGINS, "Current word extends [%d, %d]", *start, *end); + pluma_debug_message (DEBUG_PLUGINS, "Current word extends [%d, %d]", *start, *end); if (!(*start < *end)) return NULL; @@ -407,14 +407,14 @@ get_current_word (GeditDocument *doc, gint *start, gint *end) } static gboolean -goto_next_word (GeditDocument *doc) +goto_next_word (PlumaDocument *doc) { CheckRange *range; GtkTextIter current_iter; GtkTextIter old_current_iter; GtkTextIter end_iter; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); g_return_val_if_fail (doc != NULL, FALSE); @@ -431,7 +431,7 @@ goto_next_word (GeditDocument *doc) gtk_text_iter_forward_word_ends (¤t_iter, 2); gtk_text_iter_backward_word_start (¤t_iter); - if (gedit_spell_utils_skip_no_spell_check (¤t_iter, &end_iter) && + if (pluma_spell_utils_skip_no_spell_check (¤t_iter, &end_iter) && (gtk_text_iter_compare (&old_current_iter, ¤t_iter) < 0) && (gtk_text_iter_compare (¤t_iter, &end_iter) < 0)) { @@ -443,17 +443,17 @@ goto_next_word (GeditDocument *doc) } static gchar * -get_next_misspelled_word (GeditView *view) +get_next_misspelled_word (PlumaView *view) { - GeditDocument *doc; + PlumaDocument *doc; CheckRange *range; gint start, end; gchar *word; - GeditSpellChecker *spell; + PlumaSpellChecker *spell; g_return_val_if_fail (view != NULL, NULL); - doc = GEDIT_DOCUMENT (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view))); + doc = PLUMA_DOCUMENT (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view))); g_return_val_if_fail (doc != NULL, NULL); range = get_check_range (doc); @@ -466,9 +466,9 @@ get_next_misspelled_word (GeditView *view) if (word == NULL) return NULL; - gedit_debug_message (DEBUG_PLUGINS, "Word to check: %s", word); + pluma_debug_message (DEBUG_PLUGINS, "Word to check: %s", word); - while (gedit_spell_checker_check_word (spell, word, -1)) + while (pluma_spell_checker_check_word (spell, word, -1)) { g_free (word); @@ -480,7 +480,7 @@ get_next_misspelled_word (GeditView *view) if (word == NULL) return NULL; - gedit_debug_message (DEBUG_PLUGINS, "Word to check: %s", word); + pluma_debug_message (DEBUG_PLUGINS, "Word to check: %s", word); } if (!goto_next_word (doc)) @@ -493,14 +493,14 @@ get_next_misspelled_word (GeditView *view) range->mw_start = start; range->mw_end = end; - gedit_debug_message (DEBUG_PLUGINS, "Select [%d, %d]", start, end); + pluma_debug_message (DEBUG_PLUGINS, "Select [%d, %d]", start, end); gtk_text_buffer_get_iter_at_offset (GTK_TEXT_BUFFER (doc), &s, start); gtk_text_buffer_get_iter_at_offset (GTK_TEXT_BUFFER (doc), &e, end); gtk_text_buffer_select_range (GTK_TEXT_BUFFER (doc), &s, &e); - gedit_view_scroll_to_cursor (view); + pluma_view_scroll_to_cursor (view); } else { @@ -512,13 +512,13 @@ get_next_misspelled_word (GeditView *view) } static void -ignore_cb (GeditSpellCheckerDialog *dlg, +ignore_cb (PlumaSpellCheckerDialog *dlg, const gchar *w, - GeditView *view) + PlumaView *view) { gchar *word = NULL; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); g_return_if_fail (w != NULL); g_return_if_fail (view != NULL); @@ -526,12 +526,12 @@ ignore_cb (GeditSpellCheckerDialog *dlg, word = get_next_misspelled_word (view); if (word == NULL) { - gedit_spell_checker_dialog_set_completed (dlg); + pluma_spell_checker_dialog_set_completed (dlg); return; } - gedit_spell_checker_dialog_set_misspelled_word (GEDIT_SPELL_CHECKER_DIALOG (dlg), + pluma_spell_checker_dialog_set_misspelled_word (PLUMA_SPELL_CHECKER_DIALOG (dlg), word, -1); @@ -539,23 +539,23 @@ ignore_cb (GeditSpellCheckerDialog *dlg, } static void -change_cb (GeditSpellCheckerDialog *dlg, +change_cb (PlumaSpellCheckerDialog *dlg, const gchar *word, const gchar *change, - GeditView *view) + PlumaView *view) { - GeditDocument *doc; + PlumaDocument *doc; CheckRange *range; gchar *w = NULL; GtkTextIter start, end; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); g_return_if_fail (view != NULL); g_return_if_fail (word != NULL); g_return_if_fail (change != NULL); - doc = GEDIT_DOCUMENT (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view))); + doc = PLUMA_DOCUMENT (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view))); g_return_if_fail (doc != NULL); range = get_check_range (doc); @@ -592,24 +592,24 @@ change_cb (GeditSpellCheckerDialog *dlg, } static void -change_all_cb (GeditSpellCheckerDialog *dlg, +change_all_cb (PlumaSpellCheckerDialog *dlg, const gchar *word, const gchar *change, - GeditView *view) + PlumaView *view) { - GeditDocument *doc; + PlumaDocument *doc; CheckRange *range; gchar *w = NULL; GtkTextIter start, end; gint flags = 0; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); g_return_if_fail (view != NULL); g_return_if_fail (word != NULL); g_return_if_fail (change != NULL); - doc = GEDIT_DOCUMENT (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view))); + doc = PLUMA_DOCUMENT (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view))); g_return_if_fail (doc != NULL); range = get_check_range (doc); @@ -632,11 +632,11 @@ change_all_cb (GeditSpellCheckerDialog *dlg, g_free (w); - GEDIT_SEARCH_SET_CASE_SENSITIVE (flags, TRUE); - GEDIT_SEARCH_SET_ENTIRE_WORD (flags, TRUE); + PLUMA_SEARCH_SET_CASE_SENSITIVE (flags, TRUE); + PLUMA_SEARCH_SET_ENTIRE_WORD (flags, TRUE); /* CHECK: currently this function does escaping etc */ - gedit_document_replace_all (doc, word, change, flags); + pluma_document_replace_all (doc, word, change, flags); update_current (doc, range->mw_start + g_utf8_strlen (change, -1)); @@ -645,9 +645,9 @@ change_all_cb (GeditSpellCheckerDialog *dlg, } static void -add_word_cb (GeditSpellCheckerDialog *dlg, +add_word_cb (PlumaSpellCheckerDialog *dlg, const gchar *word, - GeditView *view) + PlumaView *view) { g_return_if_fail (view != NULL); g_return_if_fail (word != NULL); @@ -659,15 +659,15 @@ add_word_cb (GeditSpellCheckerDialog *dlg, static void language_dialog_response (GtkDialog *dlg, gint res_id, - GeditSpellChecker *spell) + PlumaSpellChecker *spell) { if (res_id == GTK_RESPONSE_OK) { - const GeditSpellCheckerLanguage *lang; + const PlumaSpellCheckerLanguage *lang; - lang = gedit_spell_language_get_selected_language (GEDIT_SPELL_LANGUAGE_DIALOG (dlg)); + lang = pluma_spell_language_get_selected_language (PLUMA_SPELL_LANGUAGE_DIALOG (dlg)); if (lang != NULL) - gedit_spell_checker_set_language (spell, lang); + pluma_spell_checker_set_language (spell, lang); } gtk_widget_destroy (GTK_WIDGET (dlg)); @@ -677,30 +677,30 @@ static void set_language_cb (GtkAction *action, ActionData *action_data) { - GeditDocument *doc; - GeditSpellChecker *spell; - const GeditSpellCheckerLanguage *lang; + PlumaDocument *doc; + PlumaSpellChecker *spell; + const PlumaSpellCheckerLanguage *lang; GtkWidget *dlg; GtkWindowGroup *wg; gchar *data_dir; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); - doc = gedit_window_get_active_document (action_data->window); + doc = pluma_window_get_active_document (action_data->window); g_return_if_fail (doc != NULL); spell = get_spell_checker_from_document (doc); g_return_if_fail (spell != NULL); - lang = gedit_spell_checker_get_language (spell); + lang = pluma_spell_checker_get_language (spell); - data_dir = gedit_plugin_get_data_dir (action_data->plugin); - dlg = gedit_spell_language_dialog_new (GTK_WINDOW (action_data->window), + data_dir = pluma_plugin_get_data_dir (action_data->plugin); + dlg = pluma_spell_language_dialog_new (GTK_WINDOW (action_data->window), lang, data_dir); g_free (data_dir); - wg = gedit_window_get_group (action_data->window); + wg = pluma_window_get_group (action_data->window); gtk_window_group_add_window (wg, GTK_WINDOW (dlg)); @@ -718,20 +718,20 @@ static void spell_cb (GtkAction *action, ActionData *action_data) { - GeditView *view; - GeditDocument *doc; - GeditSpellChecker *spell; + PlumaView *view; + PlumaDocument *doc; + PlumaSpellChecker *spell; GtkWidget *dlg; GtkTextIter start, end; gchar *word; gchar *data_dir; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); - view = gedit_window_get_active_view (action_data->window); + view = pluma_window_get_active_view (action_data->window); g_return_if_fail (view != NULL); - doc = GEDIT_DOCUMENT (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view))); + doc = PLUMA_DOCUMENT (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view))); g_return_if_fail (doc != NULL); spell = get_spell_checker_from_document (doc); @@ -746,8 +746,8 @@ spell_cb (GtkAction *action, WINDOW_DATA_KEY); g_return_if_fail (data != NULL); - statusbar = gedit_window_get_statusbar (action_data->window); - gedit_statusbar_flash_message (GEDIT_STATUSBAR (statusbar), + statusbar = pluma_window_get_statusbar (action_data->window); + pluma_statusbar_flash_message (PLUMA_STATUSBAR (statusbar), data->message_cid, _("The document is empty.")); @@ -776,16 +776,16 @@ spell_cb (GtkAction *action, WINDOW_DATA_KEY); g_return_if_fail (data != NULL); - statusbar = gedit_window_get_statusbar (action_data->window); - gedit_statusbar_flash_message (GEDIT_STATUSBAR (statusbar), + statusbar = pluma_window_get_statusbar (action_data->window); + pluma_statusbar_flash_message (PLUMA_STATUSBAR (statusbar), data->message_cid, _("No misspelled words")); return; } - data_dir = gedit_plugin_get_data_dir (action_data->plugin); - dlg = gedit_spell_checker_dialog_new_from_spell_checker (spell, data_dir); + data_dir = pluma_plugin_get_data_dir (action_data->plugin); + dlg = pluma_spell_checker_dialog_new_from_spell_checker (spell, data_dir); g_free (data_dir); gtk_window_set_modal (GTK_WINDOW (dlg), TRUE); gtk_window_set_transient_for (GTK_WINDOW (dlg), @@ -799,7 +799,7 @@ spell_cb (GtkAction *action, g_signal_connect (dlg, "add_word_to_personal", G_CALLBACK (add_word_cb), view); - gedit_spell_checker_dialog_set_misspelled_word (GEDIT_SPELL_CHECKER_DIALOG (dlg), + pluma_spell_checker_dialog_set_misspelled_word (PLUMA_SPELL_CHECKER_DIALOG (dlg), word, -1); @@ -809,59 +809,59 @@ spell_cb (GtkAction *action, } static void -set_auto_spell (GeditWindow *window, - GeditDocument *doc, +set_auto_spell (PlumaWindow *window, + PlumaDocument *doc, gboolean active) { - GeditAutomaticSpellChecker *autospell; - GeditSpellChecker *spell; + PlumaAutomaticSpellChecker *autospell; + PlumaSpellChecker *spell; spell = get_spell_checker_from_document (doc); g_return_if_fail (spell != NULL); - autospell = gedit_automatic_spell_checker_get_from_document (doc); + autospell = pluma_automatic_spell_checker_get_from_document (doc); if (active) { if (autospell == NULL) { - GeditView *active_view; + PlumaView *active_view; - active_view = gedit_window_get_active_view (window); + active_view = pluma_window_get_active_view (window); g_return_if_fail (active_view != NULL); - autospell = gedit_automatic_spell_checker_new (doc, spell); - gedit_automatic_spell_checker_attach_view (autospell, active_view); - gedit_automatic_spell_checker_recheck_all (autospell); + autospell = pluma_automatic_spell_checker_new (doc, spell); + pluma_automatic_spell_checker_attach_view (autospell, active_view); + pluma_automatic_spell_checker_recheck_all (autospell); } } else { if (autospell != NULL) - gedit_automatic_spell_checker_free (autospell); + pluma_automatic_spell_checker_free (autospell); } } static void auto_spell_cb (GtkAction *action, - GeditWindow *window) + PlumaWindow *window) { - GeditDocument *doc; + PlumaDocument *doc; gboolean active; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)); - gedit_debug_message (DEBUG_PLUGINS, active ? "Auto Spell activated" : "Auto Spell deactivated"); + pluma_debug_message (DEBUG_PLUGINS, active ? "Auto Spell activated" : "Auto Spell deactivated"); - doc = gedit_window_get_active_document (window); + doc = pluma_window_get_active_document (window); if (doc == NULL) return; - gedit_document_set_metadata (doc, - GEDIT_METADATA_ATTRIBUTE_SPELL_ENABLED, + pluma_document_set_metadata (doc, + PLUMA_METADATA_ATTRIBUTE_SPELL_ENABLED, active ? "1" : NULL, NULL); set_auto_spell (window, doc, active); @@ -885,33 +885,33 @@ free_action_data (gpointer data) } static void -update_ui_real (GeditWindow *window, +update_ui_real (PlumaWindow *window, WindowData *data) { - GeditDocument *doc; - GeditView *view; + PlumaDocument *doc; + PlumaView *view; gboolean autospell; GtkAction *action; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); - doc = gedit_window_get_active_document (window); - view = gedit_window_get_active_view (window); + doc = pluma_window_get_active_document (window); + view = pluma_window_get_active_view (window); autospell = (doc != NULL && - gedit_automatic_spell_checker_get_from_document (doc) != NULL); + pluma_automatic_spell_checker_get_from_document (doc) != NULL); if (doc != NULL) { - GeditTab *tab; - GeditTabState state; + PlumaTab *tab; + PlumaTabState state; - tab = gedit_window_get_active_tab (window); - state = gedit_tab_get_state (tab); + tab = pluma_window_get_active_tab (window); + state = pluma_tab_get_state (tab); /* If the document is loading we can't get the metadata so we endup with an useless speller */ - if (state == GEDIT_TAB_STATE_NORMAL) + if (state == PLUMA_TAB_STATE_NORMAL) { action = gtk_action_group_get_action (data->action_group, "AutoSpell"); @@ -932,16 +932,16 @@ update_ui_real (GeditWindow *window, } static void -set_auto_spell_from_metadata (GeditWindow *window, - GeditDocument *doc, +set_auto_spell_from_metadata (PlumaWindow *window, + PlumaDocument *doc, GtkActionGroup *action_group) { gboolean active = FALSE; gchar *active_str; - GeditDocument *active_doc; + PlumaDocument *active_doc; - active_str = gedit_document_get_metadata (doc, - GEDIT_METADATA_ATTRIBUTE_SPELL_ENABLED); + active_str = pluma_document_get_metadata (doc, + PLUMA_METADATA_ATTRIBUTE_SPELL_ENABLED); if (active_str) { @@ -953,7 +953,7 @@ set_auto_spell_from_metadata (GeditWindow *window, set_auto_spell (window, doc, active); /* In case that the doc is the active one we mark the spell action */ - active_doc = gedit_window_get_active_document (window); + active_doc = pluma_window_get_active_document (window); if (active_doc == doc && action_group != NULL) { @@ -972,16 +972,16 @@ set_auto_spell_from_metadata (GeditWindow *window, } static void -on_document_loaded (GeditDocument *doc, +on_document_loaded (PlumaDocument *doc, const GError *error, - GeditWindow *window) + PlumaWindow *window) { if (error == NULL) { WindowData *data; - GeditSpellChecker *spell; + PlumaSpellChecker *spell; - spell = GEDIT_SPELL_CHECKER (g_object_get_qdata (G_OBJECT (doc), + spell = PLUMA_SPELL_CHECKER (g_object_get_qdata (G_OBJECT (doc), spell_checker_id)); if (spell != NULL) { @@ -996,12 +996,12 @@ on_document_loaded (GeditDocument *doc, } static void -on_document_saved (GeditDocument *doc, +on_document_saved (PlumaDocument *doc, const GError *error, - GeditWindow *window) + PlumaWindow *window) { - GeditAutomaticSpellChecker *autospell; - GeditSpellChecker *spell; + PlumaAutomaticSpellChecker *autospell; + PlumaSpellChecker *spell; const gchar *key; if (error != NULL) @@ -1010,36 +1010,36 @@ on_document_saved (GeditDocument *doc, } /* Make sure to save the metadata here too */ - autospell = gedit_automatic_spell_checker_get_from_document (doc); - spell = GEDIT_SPELL_CHECKER (g_object_get_qdata (G_OBJECT (doc), spell_checker_id)); + autospell = pluma_automatic_spell_checker_get_from_document (doc); + spell = PLUMA_SPELL_CHECKER (g_object_get_qdata (G_OBJECT (doc), spell_checker_id)); if (spell != NULL) { - key = gedit_spell_checker_language_to_key (gedit_spell_checker_get_language (spell)); + key = pluma_spell_checker_language_to_key (pluma_spell_checker_get_language (spell)); } else { key = NULL; } - gedit_document_set_metadata (doc, - GEDIT_METADATA_ATTRIBUTE_SPELL_ENABLED, + pluma_document_set_metadata (doc, + PLUMA_METADATA_ATTRIBUTE_SPELL_ENABLED, autospell != NULL ? "1" : NULL, - GEDIT_METADATA_ATTRIBUTE_SPELL_LANGUAGE, + PLUMA_METADATA_ATTRIBUTE_SPELL_LANGUAGE, key, NULL); } static void -tab_added_cb (GeditWindow *window, - GeditTab *tab, +tab_added_cb (PlumaWindow *window, + PlumaTab *tab, gpointer useless) { - GeditDocument *doc; - GeditView *view; + PlumaDocument *doc; + PlumaView *view; - doc = gedit_tab_get_document (tab); - view = gedit_tab_get_view (tab); + doc = pluma_tab_get_document (tab); + view = pluma_tab_get_view (tab); g_signal_connect (doc, "loaded", G_CALLBACK (on_document_loaded), @@ -1051,39 +1051,39 @@ tab_added_cb (GeditWindow *window, } static void -tab_removed_cb (GeditWindow *window, - GeditTab *tab, +tab_removed_cb (PlumaWindow *window, + PlumaTab *tab, gpointer useless) { - GeditDocument *doc; - GeditView *view; + PlumaDocument *doc; + PlumaView *view; - doc = gedit_tab_get_document (tab); - view = gedit_tab_get_view (tab); + doc = pluma_tab_get_document (tab); + view = pluma_tab_get_view (tab); g_signal_handlers_disconnect_by_func (doc, on_document_loaded, window); g_signal_handlers_disconnect_by_func (doc, on_document_saved, window); } static void -impl_activate (GeditPlugin *plugin, - GeditWindow *window) +impl_activate (PlumaPlugin *plugin, + PlumaWindow *window) { GtkUIManager *manager; WindowData *data; ActionData *action_data; GList *docs, *l; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); data = g_slice_new (WindowData); action_data = g_slice_new (ActionData); action_data->plugin = plugin; action_data->window = window; - manager = gedit_window_get_ui_manager (window); + manager = pluma_window_get_ui_manager (window); - data->action_group = gtk_action_group_new ("GeditSpellPluginActions"); + data->action_group = gtk_action_group_new ("PlumaSpellPluginActions"); gtk_action_group_set_translation_domain (data->action_group, GETTEXT_PACKAGE); gtk_action_group_add_actions_full (data->action_group, @@ -1101,7 +1101,7 @@ impl_activate (GeditPlugin *plugin, data->ui_id = gtk_ui_manager_new_merge_id (manager); data->message_cid = gtk_statusbar_get_context_id - (GTK_STATUSBAR (gedit_window_get_statusbar (window)), + (GTK_STATUSBAR (pluma_window_get_statusbar (window)), "spell_plugin_message"); g_object_set_data_full (G_OBJECT (window), @@ -1135,10 +1135,10 @@ impl_activate (GeditPlugin *plugin, update_ui_real (window, data); - docs = gedit_window_get_documents (window); + docs = pluma_window_get_documents (window); for (l = docs; l != NULL; l = g_list_next (l)) { - GeditDocument *doc = GEDIT_DOCUMENT (l->data); + PlumaDocument *doc = PLUMA_DOCUMENT (l->data); set_auto_spell_from_metadata (window, doc, data->action_group); @@ -1161,15 +1161,15 @@ impl_activate (GeditPlugin *plugin, } static void -impl_deactivate (GeditPlugin *plugin, - GeditWindow *window) +impl_deactivate (PlumaPlugin *plugin, + PlumaWindow *window) { GtkUIManager *manager; WindowData *data; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); - manager = gedit_window_get_ui_manager (window); + manager = pluma_window_get_ui_manager (window); data = (WindowData *) g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY); g_return_if_fail (data != NULL); @@ -1184,12 +1184,12 @@ impl_deactivate (GeditPlugin *plugin, } static void -impl_update_ui (GeditPlugin *plugin, - GeditWindow *window) +impl_update_ui (PlumaPlugin *plugin, + PlumaWindow *window) { WindowData *data; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); data = (WindowData *) g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY); g_return_if_fail (data != NULL); @@ -1198,19 +1198,19 @@ impl_update_ui (GeditPlugin *plugin, } static void -gedit_spell_plugin_class_init (GeditSpellPluginClass *klass) +pluma_spell_plugin_class_init (PlumaSpellPluginClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - GeditPluginClass *plugin_class = GEDIT_PLUGIN_CLASS (klass); + PlumaPluginClass *plugin_class = PLUMA_PLUGIN_CLASS (klass); - object_class->finalize = gedit_spell_plugin_finalize; + object_class->finalize = pluma_spell_plugin_finalize; plugin_class->activate = impl_activate; plugin_class->deactivate = impl_deactivate; plugin_class->update_ui = impl_update_ui; if (spell_checker_id == 0) - spell_checker_id = g_quark_from_string ("GeditSpellCheckerID"); + spell_checker_id = g_quark_from_string ("PlumaSpellCheckerID"); if (check_range_id == 0) check_range_id = g_quark_from_string ("CheckRangeID"); diff --git a/plugins/spell/pluma-spell-plugin.h b/plugins/spell/pluma-spell-plugin.h new file mode 100755 index 00000000..44e70a66 --- /dev/null +++ b/plugins/spell/pluma-spell-plugin.h @@ -0,0 +1,75 @@ +/* + * pluma-spell-plugin.h + * + * Copyright (C) 2002-2005 Paolo Maggi + * + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ + */ + +#ifndef __PLUMA_SPELL_PLUGIN_H__ +#define __PLUMA_SPELL_PLUGIN_H__ + +#include <glib.h> +#include <glib-object.h> +#include <pluma/pluma-plugin.h> + +G_BEGIN_DECLS + +/* + * Type checking and casting macros + */ +#define PLUMA_TYPE_SPELL_PLUGIN (pluma_spell_plugin_get_type ()) +#define PLUMA_SPELL_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PLUMA_TYPE_SPELL_PLUGIN, PlumaSpellPlugin)) +#define PLUMA_SPELL_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PLUMA_TYPE_SPELL_PLUGIN, PlumaSpellPluginClass)) +#define PLUMA_IS_SPELL_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PLUMA_TYPE_SPELL_PLUGIN)) +#define PLUMA_IS_SPELL_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PLUMA_TYPE_SPELL_PLUGIN)) +#define PLUMA_SPELL_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), PLUMA_TYPE_SPELL_PLUGIN, PlumaSpellPluginClass)) + +/* Private structure type */ +typedef struct _PlumaSpellPluginPrivate PlumaSpellPluginPrivate; + +/* + * Main object structure + */ +typedef struct _PlumaSpellPlugin PlumaSpellPlugin; + +struct _PlumaSpellPlugin +{ + PlumaPlugin parent_instance; +}; + +/* + * Class definition + */ +typedef struct _PlumaSpellPluginClass PlumaSpellPluginClass; + +struct _PlumaSpellPluginClass +{ + PlumaPluginClass parent_class; +}; + +/* + * Public methods + */ +GType pluma_spell_plugin_get_type (void) G_GNUC_CONST; + +/* All the plugins must implement this function */ +G_MODULE_EXPORT GType register_pluma_plugin (GTypeModule *module); + +G_END_DECLS + +#endif /* __PLUMA_SPELL_PLUGIN_H__ */ diff --git a/plugins/spell/gedit-spell-utils.c b/plugins/spell/pluma-spell-utils.c index 0782d37a..504cf042 100755 --- a/plugins/spell/gedit-spell-utils.c +++ b/plugins/spell/pluma-spell-utils.c @@ -1,6 +1,6 @@ /* - * gedit-spell-utils.c - * This file is part of gedit + * pluma-spell-utils.c + * This file is part of pluma * * Copyright (C) 2010 - Jesse van den Kieboom * @@ -22,11 +22,11 @@ #include <string.h> -#include "gedit-spell-utils.h" +#include "pluma-spell-utils.h" #include <gtksourceview/gtksourcebuffer.h> gboolean -gedit_spell_utils_is_digit (const char *text, gssize length) +pluma_spell_utils_is_digit (const char *text, gssize length) { gunichar c; const gchar *p; @@ -56,7 +56,7 @@ gedit_spell_utils_is_digit (const char *text, gssize length) } gboolean -gedit_spell_utils_skip_no_spell_check (GtkTextIter *start, +pluma_spell_utils_skip_no_spell_check (GtkTextIter *start, GtkTextIter *end) { GtkSourceBuffer *buffer = GTK_SOURCE_BUFFER (gtk_text_iter_get_buffer (start)); diff --git a/plugins/spell/gedit-spell-utils.h b/plugins/spell/pluma-spell-utils.h index fbfe4b1b..a9d2eaf2 100755 --- a/plugins/spell/gedit-spell-utils.h +++ b/plugins/spell/pluma-spell-utils.h @@ -1,6 +1,6 @@ /* - * gedit-spell-utils.h - * This file is part of gedit + * pluma-spell-utils.h + * This file is part of pluma * * Copyright (C) 2010 - Jesse van den Kieboom * @@ -20,18 +20,18 @@ * Boston, MA 02110-1301 USA */ -#ifndef __GEDIT_SPELL_UTILS_H__ -#define __GEDIT_SPELL_UTILS_H__ +#ifndef __PLUMA_SPELL_UTILS_H__ +#define __PLUMA_SPELL_UTILS_H__ #include <gtk/gtk.h> G_BEGIN_DECLS -gboolean gedit_spell_utils_is_digit (const char *text, gssize length); +gboolean pluma_spell_utils_is_digit (const char *text, gssize length); -gboolean gedit_spell_utils_skip_no_spell_check (GtkTextIter *start, GtkTextIter *end); +gboolean pluma_spell_utils_skip_no_spell_check (GtkTextIter *start, GtkTextIter *end); G_END_DECLS -#endif /* __GEDIT_SPELL_UTILS_H__ */ +#endif /* __PLUMA_SPELL_UTILS_H__ */ diff --git a/plugins/spell/spell.gedit-plugin.desktop.in b/plugins/spell/spell.pluma-plugin.desktop.in index c75c9eee..c4400dc3 100755 --- a/plugins/spell/spell.gedit-plugin.desktop.in +++ b/plugins/spell/spell.pluma-plugin.desktop.in @@ -1,4 +1,4 @@ -[Gedit Plugin] +[Pluma Plugin] Module=spell IAge=2 _Name=Spell Checker @@ -6,4 +6,4 @@ _Description=Checks the spelling of the current document. Icon=gtk-spell-check Authors=Paolo Maggi <[email protected]> Copyright=Copyright © 2002-2005 Paolo Maggi -Website=http://www.gedit.org +Website=http://www.pluma.org diff --git a/plugins/taglist/HTML.tags.xml.in b/plugins/taglist/HTML.tags.xml.in index 116cc247..5eedb254 100755 --- a/plugins/taglist/HTML.tags.xml.in +++ b/plugins/taglist/HTML.tags.xml.in @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<TagList xmlns="http://gedit.sourceforge.net/some-location"> +<TagList xmlns="http://pluma.sourceforge.net/some-location"> <TagGroup _name="XHTML 1.0 - Tags" sort="true"> <Tag _name="Abbreviated form"> diff --git a/plugins/taglist/Latex.tags.xml.in b/plugins/taglist/Latex.tags.xml.in index 5ac71c0d..78242fe3 100755 --- a/plugins/taglist/Latex.tags.xml.in +++ b/plugins/taglist/Latex.tags.xml.in @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<TagList xmlns="http://gedit.sourceforge.net/some-location"> +<TagList xmlns="http://pluma.sourceforge.net/some-location"> <TagGroup _name="Latex - Tags" sort="true"> <Tag _name="Bibliography (cite)"> <Begin>\cite{ </Begin> diff --git a/plugins/taglist/Makefile.am b/plugins/taglist/Makefile.am index b04f4584..dd3306f0 100755 --- a/plugins/taglist/Makefile.am +++ b/plugins/taglist/Makefile.am @@ -1,7 +1,7 @@ # Tag list plugin -plugindir = $(GEDIT_PLUGINS_LIBS_DIR) +plugindir = $(PLUMA_PLUGINS_LIBS_DIR) -taglistdir = $(GEDIT_PLUGINS_DATA_DIR)/taglist +taglistdir = $(PLUMA_PLUGINS_DATA_DIR)/taglist taglist_in_files = \ HTML.tags.xml.in \ @@ -13,26 +13,26 @@ taglist_DATA = $(taglist_in_files:.tags.xml.in=.tags.gz) INCLUDES = \ -I$(top_srcdir) \ - $(GEDIT_CFLAGS) \ + $(PLUMA_CFLAGS) \ $(WARN_CFLAGS) \ $(DISABLE_DEPRECATED_CFLAGS) plugin_LTLIBRARIES = libtaglist.la libtaglist_la_SOURCES = \ - gedit-taglist-plugin-parser.c \ - gedit-taglist-plugin-parser.h \ - gedit-taglist-plugin-panel.c \ - gedit-taglist-plugin-panel.h \ - gedit-taglist-plugin.c \ - gedit-taglist-plugin.h + pluma-taglist-plugin-parser.c \ + pluma-taglist-plugin-parser.h \ + pluma-taglist-plugin-panel.c \ + pluma-taglist-plugin-panel.h \ + pluma-taglist-plugin.c \ + pluma-taglist-plugin.h libtaglist_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS) -libtaglist_la_LIBADD = $(GEDIT_LIBS) +libtaglist_la_LIBADD = $(PLUMA_LIBS) -plugin_in_files = taglist.gedit-plugin.desktop.in +plugin_in_files = taglist.pluma-plugin.desktop.in -%.gedit-plugin: %.gedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) +%.pluma-plugin: %.pluma-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache GZIP_ENV = -9 @@ -41,7 +41,7 @@ GZIP_ENV = -9 LC_ALL=C $(INTLTOOL_MERGE) $(top_srcdir)/po $< $(@:.gz=) -x -u -c $(top_builddir)/po/.intltool-merge-cache GZIP=$(GZIP_ENV) gzip -f $(@:.gz=) -plugin_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin) +plugin_DATA = $(plugin_in_files:.pluma-plugin.desktop.in=.pluma-plugin) EXTRA_DIST = \ $(taglist_in_files) $(taglist_DATA) \ diff --git a/plugins/taglist/XSLT.tags.xml.in b/plugins/taglist/XSLT.tags.xml.in index f9591a25..e625f6ca 100755 --- a/plugins/taglist/XSLT.tags.xml.in +++ b/plugins/taglist/XSLT.tags.xml.in @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - XSLT Tags for gedit + XSLT Tags for pluma Jens Askengren <[email protected]> --> -<TagList xmlns="http://gedit.sourceforge.net/some-location"> +<TagList xmlns="http://pluma.sourceforge.net/some-location"> <TagGroup _name="XSLT - Elements" sort="true"> <Tag name="apply-imports"> <Begin><xsl:apply-imports></Begin> diff --git a/plugins/taglist/XUL.tags.xml.in b/plugins/taglist/XUL.tags.xml.in index fc4c26a7..3d5d3c8c 100755 --- a/plugins/taglist/XUL.tags.xml.in +++ b/plugins/taglist/XUL.tags.xml.in @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<TagList xmlns="http://gedit.sourceforge.net/some-location"> +<TagList xmlns="http://pluma.sourceforge.net/some-location"> <TagGroup _name="XUL - Tags" sort="true"> <Tag name="action"> diff --git a/plugins/taglist/gedit-taglist-plugin-panel.h b/plugins/taglist/gedit-taglist-plugin-panel.h deleted file mode 100755 index 3f8e82d0..00000000 --- a/plugins/taglist/gedit-taglist-plugin-panel.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * gedit-taglist-plugin-panel.h - * This file is part of gedit - * - * Copyright (C) 2005 - Paolo Maggi - * - * 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 of the License, 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., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the gedit Team, 2005. See the AUTHORS file for a - * list of people on the gedit Team. - * See the ChangeLog files for a list of changes. - * - * $Id$ - */ - -#ifndef __GEDIT_TAGLIST_PLUGIN_PANEL_H__ -#define __GEDIT_TAGLIST_PLUGIN_PANEL_H__ - -#include <gtk/gtk.h> - -#include <gedit/gedit-window.h> - -G_BEGIN_DECLS - -/* - * Type checking and casting macros - */ -#define GEDIT_TYPE_TAGLIST_PLUGIN_PANEL (gedit_taglist_plugin_panel_get_type()) -#define GEDIT_TAGLIST_PLUGIN_PANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_TAGLIST_PLUGIN_PANEL, GeditTaglistPluginPanel)) -#define GEDIT_TAGLIST_PLUGIN_PANEL_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_TAGLIST_PLUGIN_PANEL, GeditTaglistPluginPanel const)) -#define GEDIT_TAGLIST_PLUGIN_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GEDIT_TYPE_TAGLIST_PLUGIN_PANEL, GeditTaglistPluginPanelClass)) -#define GEDIT_IS_TAGLIST_PLUGIN_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GEDIT_TYPE_TAGLIST_PLUGIN_PANEL)) -#define GEDIT_IS_TAGLIST_PLUGIN_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_TAGLIST_PLUGIN_PANEL)) -#define GEDIT_TAGLIST_PLUGIN_PANEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GEDIT_TYPE_TAGLIST_PLUGIN_PANEL, GeditTaglistPluginPanelClass)) - -/* Private structure type */ -typedef struct _GeditTaglistPluginPanelPrivate GeditTaglistPluginPanelPrivate; - -/* - * Main object structure - */ -typedef struct _GeditTaglistPluginPanel GeditTaglistPluginPanel; - -struct _GeditTaglistPluginPanel -{ - GtkVBox vbox; - - /*< private > */ - GeditTaglistPluginPanelPrivate *priv; -}; - -/* - * Class definition - */ -typedef struct _GeditTaglistPluginPanelClass GeditTaglistPluginPanelClass; - -struct _GeditTaglistPluginPanelClass -{ - GtkVBoxClass parent_class; -}; - -/* - * Public methods - */ -GType gedit_taglist_plugin_panel_register_type (GTypeModule *module); - -GType gedit_taglist_plugin_panel_get_type (void) G_GNUC_CONST; - -GtkWidget *gedit_taglist_plugin_panel_new (GeditWindow *window, - const gchar *data_dir); - -G_END_DECLS - -#endif /* __GEDIT_TAGLIST_PLUGIN_PANEL_H__ */ diff --git a/plugins/taglist/gedit-taglist-plugin.h b/plugins/taglist/gedit-taglist-plugin.h deleted file mode 100755 index d0444e76..00000000 --- a/plugins/taglist/gedit-taglist-plugin.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * gedit-taglist-plugin.h - * - * Copyright (C) 2002-2005 - Paolo Maggi - * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ - -/* - * Modified by the gedit Team, 2002-2005. See the AUTHORS file for a - * list of people on the gedit Team. - * See the ChangeLog files for a list of changes. - * - * $Id$ - */ - -#ifndef __GEDIT_TAGLIST_PLUGIN_H__ -#define __GEDIT_TAGLIST_PLUGIN_H__ - -#include <glib.h> -#include <glib-object.h> -#include <gedit/gedit-plugin.h> - -G_BEGIN_DECLS - -/* - * Type checking and casting macros - */ -#define GEDIT_TYPE_TAGLIST_PLUGIN (gedit_taglist_plugin_get_type ()) -#define GEDIT_TAGLIST_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GEDIT_TYPE_TAGLIST_PLUGIN, GeditTaglistPlugin)) -#define GEDIT_TAGLIST_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GEDIT_TYPE_TAGLIST_PLUGIN, GeditTaglistPluginClass)) -#define GEDIT_IS_TAGLIST_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GEDIT_TYPE_TAGLIST_PLUGIN)) -#define GEDIT_IS_TAGLIST_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GEDIT_TYPE_TAGLIST_PLUGIN)) -#define GEDIT_TAGLIST_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GEDIT_TYPE_TAGLIST_PLUGIN, GeditTaglistPluginClass)) - -/* Private structure type */ -typedef struct _GeditTaglistPluginPrivate GeditTaglistPluginPrivate; - -/* - * Main object structure - */ -typedef struct _GeditTaglistPlugin GeditTaglistPlugin; - -struct _GeditTaglistPlugin -{ - GeditPlugin parent_instance; - - /*< private >*/ - GeditTaglistPluginPrivate *priv; -}; - -/* - * Class definition - */ -typedef struct _GeditTaglistPluginClass GeditTaglistPluginClass; - -struct _GeditTaglistPluginClass -{ - GeditPluginClass parent_class; -}; - -/* - * Public methods - */ -GType gedit_taglist_plugin_get_type (void) G_GNUC_CONST; - -/* All the plugins must implement this function */ -G_MODULE_EXPORT GType register_gedit_plugin (GTypeModule *module); - -G_END_DECLS - -#endif /* __GEDIT_TAGLIST_PLUGIN_H__ */ diff --git a/plugins/taglist/gedit-taglist-plugin-panel.c b/plugins/taglist/pluma-taglist-plugin-panel.c index d66acc08..513bf070 100755 --- a/plugins/taglist/gedit-taglist-plugin-panel.c +++ b/plugins/taglist/pluma-taglist-plugin-panel.c @@ -1,6 +1,6 @@ /* - * gedit-taglist-plugin-panel.c - * This file is part of gedit + * pluma-taglist-plugin-panel.c + * This file is part of pluma * * Copyright (C) 2005 - Paolo Maggi * @@ -21,8 +21,8 @@ */ /* - * Modified by the gedit Team, 2005. See the AUTHORS file for a - * list of people on the gedit Team. + * Modified by the pluma Team, 2005. See the AUTHORS file for a + * list of people on the pluma Team. * See the ChangeLog files for a list of changes. * * $Id$ @@ -34,19 +34,19 @@ #include <string.h> -#include "gedit-taglist-plugin-panel.h" -#include "gedit-taglist-plugin-parser.h" +#include "pluma-taglist-plugin-panel.h" +#include "pluma-taglist-plugin-parser.h" -#include <gedit/gedit-utils.h> -#include <gedit/gedit-debug.h> -#include <gedit/gedit-plugin.h> +#include <pluma/pluma-utils.h> +#include <pluma/pluma-debug.h> +#include <pluma/pluma-plugin.h> #include <gdk/gdkkeysyms.h> #include <glib/gi18n.h> -#define GEDIT_TAGLIST_PLUGIN_PANEL_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \ - GEDIT_TYPE_TAGLIST_PLUGIN_PANEL, \ - GeditTaglistPluginPanelPrivate)) +#define PLUMA_TAGLIST_PLUGIN_PANEL_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \ + PLUMA_TYPE_TAGLIST_PLUGIN_PANEL, \ + PlumaTaglistPluginPanelPrivate)) enum { @@ -55,9 +55,9 @@ enum NUM_COLUMNS }; -struct _GeditTaglistPluginPanelPrivate +struct _PlumaTaglistPluginPanelPrivate { - GeditWindow *window; + PlumaWindow *window; GtkWidget *tag_groups_combo; GtkWidget *tags_list; @@ -68,7 +68,7 @@ struct _GeditTaglistPluginPanelPrivate gchar *data_dir; }; -GEDIT_PLUGIN_DEFINE_TYPE (GeditTaglistPluginPanel, gedit_taglist_plugin_panel, GTK_TYPE_VBOX) +PLUMA_PLUGIN_DEFINE_TYPE (PlumaTaglistPluginPanel, pluma_taglist_plugin_panel, GTK_TYPE_VBOX) enum { @@ -77,11 +77,11 @@ enum }; static void -set_window (GeditTaglistPluginPanel *panel, - GeditWindow *window) +set_window (PlumaTaglistPluginPanel *panel, + PlumaWindow *window) { g_return_if_fail (panel->priv->window == NULL); - g_return_if_fail (GEDIT_IS_WINDOW (window)); + g_return_if_fail (PLUMA_IS_WINDOW (window)); panel->priv->window = window; @@ -89,12 +89,12 @@ set_window (GeditTaglistPluginPanel *panel, } static void -gedit_taglist_plugin_panel_set_property (GObject *object, +pluma_taglist_plugin_panel_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { - GeditTaglistPluginPanel *panel = GEDIT_TAGLIST_PLUGIN_PANEL (object); + PlumaTaglistPluginPanel *panel = PLUMA_TAGLIST_PLUGIN_PANEL (object); switch (prop_id) { @@ -109,18 +109,18 @@ gedit_taglist_plugin_panel_set_property (GObject *object, } static void -gedit_taglist_plugin_panel_get_property (GObject *object, +pluma_taglist_plugin_panel_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { - GeditTaglistPluginPanel *panel = GEDIT_TAGLIST_PLUGIN_PANEL (object); + PlumaTaglistPluginPanel *panel = PLUMA_TAGLIST_PLUGIN_PANEL (object); switch (prop_id) { case PROP_WINDOW: g_value_set_object (value, - GEDIT_TAGLIST_PLUGIN_PANEL_GET_PRIVATE (panel)->window); + PLUMA_TAGLIST_PLUGIN_PANEL_GET_PRIVATE (panel)->window); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -129,50 +129,50 @@ gedit_taglist_plugin_panel_get_property (GObject *object, } static void -gedit_taglist_plugin_panel_finalize (GObject *object) +pluma_taglist_plugin_panel_finalize (GObject *object) { - GeditTaglistPluginPanel *panel = GEDIT_TAGLIST_PLUGIN_PANEL (object); + PlumaTaglistPluginPanel *panel = PLUMA_TAGLIST_PLUGIN_PANEL (object); g_free (panel->priv->data_dir); - G_OBJECT_CLASS (gedit_taglist_plugin_panel_parent_class)->finalize (object); + G_OBJECT_CLASS (pluma_taglist_plugin_panel_parent_class)->finalize (object); } static void -gedit_taglist_plugin_panel_class_init (GeditTaglistPluginPanelClass *klass) +pluma_taglist_plugin_panel_class_init (PlumaTaglistPluginPanelClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - object_class->finalize = gedit_taglist_plugin_panel_finalize; - object_class->get_property = gedit_taglist_plugin_panel_get_property; - object_class->set_property = gedit_taglist_plugin_panel_set_property; + object_class->finalize = pluma_taglist_plugin_panel_finalize; + object_class->get_property = pluma_taglist_plugin_panel_get_property; + object_class->set_property = pluma_taglist_plugin_panel_set_property; g_object_class_install_property (object_class, PROP_WINDOW, g_param_spec_object ("window", "Window", - "The GeditWindow this GeditTaglistPluginPanel is associated with", - GEDIT_TYPE_WINDOW, + "The PlumaWindow this PlumaTaglistPluginPanel is associated with", + PLUMA_TYPE_WINDOW, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); - g_type_class_add_private (object_class, sizeof(GeditTaglistPluginPanelPrivate)); + g_type_class_add_private (object_class, sizeof(PlumaTaglistPluginPanelPrivate)); } static void -insert_tag (GeditTaglistPluginPanel *panel, +insert_tag (PlumaTaglistPluginPanel *panel, Tag *tag, gboolean grab_focus) { - GeditView *view; + PlumaView *view; GtkTextBuffer *buffer; GtkTextIter start, end; GtkTextIter cursor; gboolean sel = FALSE; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); - view = gedit_window_get_active_view (panel->priv->window); + view = pluma_window_get_active_view (panel->priv->window); g_return_if_fail (view != NULL); buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)); @@ -242,13 +242,13 @@ static void tag_list_row_activated_cb (GtkTreeView *tag_list, GtkTreePath *path, GtkTreeViewColumn *column, - GeditTaglistPluginPanel *panel) + PlumaTaglistPluginPanel *panel) { GtkTreeIter iter; GtkTreeModel *model; gint index; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); model = gtk_tree_view_get_model (tag_list); @@ -257,7 +257,7 @@ tag_list_row_activated_cb (GtkTreeView *tag_list, gtk_tree_model_get (model, &iter, COLUMN_TAG_INDEX_IN_GROUP, &index, -1); - gedit_debug_message (DEBUG_PLUGINS, "Index: %d", index); + pluma_debug_message (DEBUG_PLUGINS, "Index: %d", index); insert_tag (panel, (Tag*)g_list_nth_data (panel->priv->selected_tag_group->tags, index), @@ -267,7 +267,7 @@ tag_list_row_activated_cb (GtkTreeView *tag_list, static gboolean tag_list_key_press_event_cb (GtkTreeView *tag_list, GdkEventKey *event, - GeditTaglistPluginPanel *panel) + PlumaTaglistPluginPanel *panel) { gboolean grab_focus; @@ -280,7 +280,7 @@ tag_list_key_press_event_cb (GtkTreeView *tag_list, GtkTreeIter iter; gint index; - gedit_debug_message (DEBUG_PLUGINS, "RETURN Pressed"); + pluma_debug_message (DEBUG_PLUGINS, "RETURN Pressed"); model = gtk_tree_view_get_model (tag_list); @@ -290,7 +290,7 @@ tag_list_key_press_event_cb (GtkTreeView *tag_list, { gtk_tree_model_get (model, &iter, COLUMN_TAG_INDEX_IN_GROUP, &index, -1); - gedit_debug_message (DEBUG_PLUGINS, "Index: %d", index); + pluma_debug_message (DEBUG_PLUGINS, "Index: %d", index); insert_tag (panel, (Tag*)g_list_nth_data (panel->priv->selected_tag_group->tags, index), @@ -304,14 +304,14 @@ tag_list_key_press_event_cb (GtkTreeView *tag_list, } static GtkTreeModel* -create_model (GeditTaglistPluginPanel *panel) +create_model (PlumaTaglistPluginPanel *panel) { gint i = 0; GtkListStore *store; GtkTreeIter iter; GList *list; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); /* create list store */ store = gtk_list_store_new (NUM_COLUMNS, G_TYPE_STRING, G_TYPE_INT); @@ -325,7 +325,7 @@ create_model (GeditTaglistPluginPanel *panel) tag_name = (gchar *)((Tag*)list->data)->name; - gedit_debug_message (DEBUG_PLUGINS, "%d : %s", i, tag_name); + pluma_debug_message (DEBUG_PLUGINS, "%d : %s", i, tag_name); gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, @@ -337,18 +337,18 @@ create_model (GeditTaglistPluginPanel *panel) list = g_list_next (list); } - gedit_debug_message (DEBUG_PLUGINS, "Rows: %d ", + pluma_debug_message (DEBUG_PLUGINS, "Rows: %d ", gtk_tree_model_iter_n_children (GTK_TREE_MODEL (store), NULL)); return GTK_TREE_MODEL (store); } static void -populate_tags_list (GeditTaglistPluginPanel *panel) +populate_tags_list (PlumaTaglistPluginPanel *panel) { GtkTreeModel* model; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); g_return_if_fail (taglist != NULL); @@ -363,7 +363,7 @@ find_tag_group (const gchar *name) { GList *l; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); g_return_val_if_fail (taglist != NULL, NULL); @@ -377,12 +377,12 @@ find_tag_group (const gchar *name) } static void -populate_tag_groups_combo (GeditTaglistPluginPanel *panel) +populate_tag_groups_combo (PlumaTaglistPluginPanel *panel) { GList *l; GtkComboBox *combo; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); combo = GTK_COMBO_BOX (panel->priv->tag_groups_combo); @@ -402,11 +402,11 @@ populate_tag_groups_combo (GeditTaglistPluginPanel *panel) static void selected_group_changed (GtkComboBox *combo, - GeditTaglistPluginPanel *panel) + PlumaTaglistPluginPanel *panel) { gchar* group_name; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); group_name = gtk_combo_box_get_active_text (combo); @@ -422,7 +422,7 @@ selected_group_changed (GtkComboBox *combo, panel->priv->selected_tag_group = find_tag_group (group_name); g_return_if_fail (panel->priv->selected_tag_group != NULL); - gedit_debug_message (DEBUG_PLUGINS, + pluma_debug_message (DEBUG_PLUGINS, "New selected group: %s", panel->priv->selected_tag_group->name); @@ -467,7 +467,7 @@ create_preview_string (Tag *tag) } static void -update_preview (GeditTaglistPluginPanel *panel, +update_preview (PlumaTaglistPluginPanel *panel, Tag *tag) { gchar *str; @@ -489,7 +489,7 @@ tag_list_cursor_changed_cb (GtkTreeView *tag_list, GtkTreeIter iter; gint index; - GeditTaglistPluginPanel *panel = (GeditTaglistPluginPanel *)data; + PlumaTaglistPluginPanel *panel = (PlumaTaglistPluginPanel *)data; model = gtk_tree_view_get_model (tag_list); @@ -499,7 +499,7 @@ tag_list_cursor_changed_cb (GtkTreeView *tag_list, { gtk_tree_model_get (model, &iter, COLUMN_TAG_INDEX_IN_GROUP, &index, -1); - gedit_debug_message (DEBUG_PLUGINS, "Index: %d", index); + pluma_debug_message (DEBUG_PLUGINS, "Index: %d", index); update_preview (panel, (Tag*)g_list_nth_data (panel->priv->selected_tag_group->tags, index)); @@ -512,7 +512,7 @@ tags_list_query_tooltip_cb (GtkWidget *widget, gint y, gboolean keyboard_tip, GtkTooltip *tooltip, - GeditTaglistPluginPanel *panel) + PlumaTaglistPluginPanel *panel) { GtkTreeIter iter; GtkTreeModel *model; @@ -578,16 +578,16 @@ expose_event_cb (GtkWidget *panel, GdkEventExpose *event, gpointer user_data) { - GeditTaglistPluginPanel *ppanel = GEDIT_TAGLIST_PLUGIN_PANEL (panel); + PlumaTaglistPluginPanel *ppanel = PLUMA_TAGLIST_PLUGIN_PANEL (panel); - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); /* If needed load taglists from files at the first expose */ if (taglist == NULL) create_taglist (ppanel->priv->data_dir); /* And populate combo box */ - populate_tag_groups_combo (GEDIT_TAGLIST_PLUGIN_PANEL (panel)); + populate_tag_groups_combo (PLUMA_TAGLIST_PLUGIN_PANEL (panel)); /* We need to manage only the first expose event -> disconnect */ g_signal_handlers_disconnect_by_func (panel, expose_event_cb, NULL); @@ -616,7 +616,7 @@ realize_tag_groups_combo (GtkWidget *combo, } static void -add_preview_widget (GeditTaglistPluginPanel *panel) +add_preview_widget (PlumaTaglistPluginPanel *panel) { GtkWidget *expander; GtkWidget *frame; @@ -650,16 +650,16 @@ add_preview_widget (GeditTaglistPluginPanel *panel) } static void -gedit_taglist_plugin_panel_init (GeditTaglistPluginPanel *panel) +pluma_taglist_plugin_panel_init (PlumaTaglistPluginPanel *panel) { GtkWidget *sw; GtkTreeViewColumn *column; GtkCellRenderer *cell; GList *focus_chain = NULL; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); - panel->priv = GEDIT_TAGLIST_PLUGIN_PANEL_GET_PRIVATE (panel); + panel->priv = PLUMA_TAGLIST_PLUGIN_PANEL_GET_PRIVATE (panel); panel->priv->data_dir = NULL; /* Build the window content */ @@ -687,16 +687,16 @@ gedit_taglist_plugin_panel_init (GeditTaglistPluginPanel *panel) /* Create tree view */ panel->priv->tags_list = gtk_tree_view_new (); - gedit_utils_set_atk_name_description (panel->priv->tag_groups_combo, + pluma_utils_set_atk_name_description (panel->priv->tag_groups_combo, _("Available Tag Lists"), NULL); - gedit_utils_set_atk_name_description (panel->priv->tags_list, + pluma_utils_set_atk_name_description (panel->priv->tags_list, _("Tags"), NULL); - gedit_utils_set_atk_relation (panel->priv->tag_groups_combo, + pluma_utils_set_atk_relation (panel->priv->tag_groups_combo, panel->priv->tags_list, ATK_RELATION_CONTROLLER_FOR); - gedit_utils_set_atk_relation (panel->priv->tags_list, + pluma_utils_set_atk_relation (panel->priv->tags_list, panel->priv->tag_groups_combo, ATK_RELATION_CONTROLLED_BY); @@ -759,14 +759,14 @@ gedit_taglist_plugin_panel_init (GeditTaglistPluginPanel *panel) } GtkWidget * -gedit_taglist_plugin_panel_new (GeditWindow *window, +pluma_taglist_plugin_panel_new (PlumaWindow *window, const gchar *data_dir) { - GeditTaglistPluginPanel *panel; + PlumaTaglistPluginPanel *panel; - g_return_val_if_fail (GEDIT_IS_WINDOW (window), NULL); + g_return_val_if_fail (PLUMA_IS_WINDOW (window), NULL); - panel = g_object_new (GEDIT_TYPE_TAGLIST_PLUGIN_PANEL, + panel = g_object_new (PLUMA_TYPE_TAGLIST_PLUGIN_PANEL, "window", window, NULL); diff --git a/plugins/taglist/pluma-taglist-plugin-panel.h b/plugins/taglist/pluma-taglist-plugin-panel.h new file mode 100755 index 00000000..cfeddfdd --- /dev/null +++ b/plugins/taglist/pluma-taglist-plugin-panel.h @@ -0,0 +1,89 @@ +/* + * pluma-taglist-plugin-panel.h + * This file is part of pluma + * + * Copyright (C) 2005 - Paolo Maggi + * + * 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 of the License, 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., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* + * Modified by the pluma Team, 2005. See the AUTHORS file for a + * list of people on the pluma Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __PLUMA_TAGLIST_PLUGIN_PANEL_H__ +#define __PLUMA_TAGLIST_PLUGIN_PANEL_H__ + +#include <gtk/gtk.h> + +#include <pluma/pluma-window.h> + +G_BEGIN_DECLS + +/* + * Type checking and casting macros + */ +#define PLUMA_TYPE_TAGLIST_PLUGIN_PANEL (pluma_taglist_plugin_panel_get_type()) +#define PLUMA_TAGLIST_PLUGIN_PANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PLUMA_TYPE_TAGLIST_PLUGIN_PANEL, PlumaTaglistPluginPanel)) +#define PLUMA_TAGLIST_PLUGIN_PANEL_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PLUMA_TYPE_TAGLIST_PLUGIN_PANEL, PlumaTaglistPluginPanel const)) +#define PLUMA_TAGLIST_PLUGIN_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PLUMA_TYPE_TAGLIST_PLUGIN_PANEL, PlumaTaglistPluginPanelClass)) +#define PLUMA_IS_TAGLIST_PLUGIN_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PLUMA_TYPE_TAGLIST_PLUGIN_PANEL)) +#define PLUMA_IS_TAGLIST_PLUGIN_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PLUMA_TYPE_TAGLIST_PLUGIN_PANEL)) +#define PLUMA_TAGLIST_PLUGIN_PANEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PLUMA_TYPE_TAGLIST_PLUGIN_PANEL, PlumaTaglistPluginPanelClass)) + +/* Private structure type */ +typedef struct _PlumaTaglistPluginPanelPrivate PlumaTaglistPluginPanelPrivate; + +/* + * Main object structure + */ +typedef struct _PlumaTaglistPluginPanel PlumaTaglistPluginPanel; + +struct _PlumaTaglistPluginPanel +{ + GtkVBox vbox; + + /*< private > */ + PlumaTaglistPluginPanelPrivate *priv; +}; + +/* + * Class definition + */ +typedef struct _PlumaTaglistPluginPanelClass PlumaTaglistPluginPanelClass; + +struct _PlumaTaglistPluginPanelClass +{ + GtkVBoxClass parent_class; +}; + +/* + * Public methods + */ +GType pluma_taglist_plugin_panel_register_type (GTypeModule *module); + +GType pluma_taglist_plugin_panel_get_type (void) G_GNUC_CONST; + +GtkWidget *pluma_taglist_plugin_panel_new (PlumaWindow *window, + const gchar *data_dir); + +G_END_DECLS + +#endif /* __PLUMA_TAGLIST_PLUGIN_PANEL_H__ */ diff --git a/plugins/taglist/gedit-taglist-plugin-parser.c b/plugins/taglist/pluma-taglist-plugin-parser.c index e09c0e25..bc7767d0 100755 --- a/plugins/taglist/gedit-taglist-plugin-parser.c +++ b/plugins/taglist/pluma-taglist-plugin-parser.c @@ -1,6 +1,6 @@ /* - * gedit-taglist-plugin-parser.c - * This file is part of gedit + * pluma-taglist-plugin-parser.c + * This file is part of pluma * * Copyright (C) 2002-2005 - Paolo Maggi * @@ -21,8 +21,8 @@ */ /* - * Modified by the gedit Team, 2002-2005. See the AUTHORS file for a - * list of people on the gedit Team. + * Modified by the pluma Team, 2002-2005. See the AUTHORS file for a + * list of people on the pluma Team. * See the ChangeLog files for a list of changes. * * $Id$ @@ -39,13 +39,13 @@ #include <glib.h> #include <glib/gi18n.h> -#include <gedit/gedit-debug.h> +#include <pluma/pluma-debug.h> -#include "gedit-taglist-plugin-parser.h" +#include "pluma-taglist-plugin-parser.h" /* we screwed up so we still look here for compatibility */ -#define USER_GEDIT_TAGLIST_PLUGIN_LOCATION_LEGACY ".gedit-2/plugins/taglist/" -#define USER_GEDIT_TAGLIST_PLUGIN_LOCATION "gedit/taglist/" +#define USER_PLUMA_TAGLIST_PLUGIN_LOCATION_LEGACY ".pluma-2/plugins/taglist/" +#define USER_PLUMA_TAGLIST_PLUGIN_LOCATION "pluma/taglist/" TagList *taglist = NULL; static gint taglist_ref_count = 0; @@ -68,7 +68,7 @@ static gboolean parse_tag (Tag *tag, xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) { /* - gedit_debug_message (DEBUG_PLUGINS, " Tag name: %s", tag->name); + pluma_debug_message (DEBUG_PLUGINS, " Tag name: %s", tag->name); */ /* We don't care what the top level element name is */ cur = cur->xmlChildrenNode; @@ -80,7 +80,7 @@ parse_tag (Tag *tag, xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) { tag->begin = xmlNodeListGetString (doc, cur->xmlChildrenNode, 1); /* - gedit_debug_message (DEBUG_PLUGINS, " - Begin: %s", tag->begin); + pluma_debug_message (DEBUG_PLUGINS, " - Begin: %s", tag->begin); */ } @@ -89,7 +89,7 @@ parse_tag (Tag *tag, xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) { tag->end = xmlNodeListGetString (doc, cur->xmlChildrenNode, 1); /* - gedit_debug_message (DEBUG_PLUGINS, " - End: %s", tag->end); + pluma_debug_message (DEBUG_PLUGINS, " - End: %s", tag->end); */ } @@ -115,7 +115,7 @@ static gboolean parse_tag_group (TagGroup *tg, const gchar* fn, xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, gboolean sort) { - gedit_debug_message (DEBUG_PLUGINS, "Parse TagGroup: %s", tg->name); + pluma_debug_message (DEBUG_PLUGINS, "Parse TagGroup: %s", tg->name); /* We don't care what the top level element name is */ cur = cur->xmlChildrenNode; @@ -227,7 +227,7 @@ get_tag_group (const gchar* filename, xmlDocPtr doc, if (strcmp (tgn, (gchar*)tag_group->name) == 0) { - gedit_debug_message (DEBUG_PLUGINS, + pluma_debug_message (DEBUG_PLUGINS, "Tag group '%s' already exists.", tgn); exists = TRUE; @@ -271,15 +271,15 @@ groups_cmp (gconstpointer a, gconstpointer b) /* * tags file is localized by intltool-merge below. * - * <gedit:TagGroup name="XSLT - Elements"> - * </gedit:TagGroup> - * <gedit:TagGroup xml:lang="am" name="LOCALIZED TEXT"> - * </gedit:TagGroup> - * <gedit:TagGroup xml:lang="ar" name="LOCALIZED TEXT"> - * </gedit:TagGroup> + * <pluma:TagGroup name="XSLT - Elements"> + * </pluma:TagGroup> + * <pluma:TagGroup xml:lang="am" name="LOCALIZED TEXT"> + * </pluma:TagGroup> + * <pluma:TagGroup xml:lang="ar" name="LOCALIZED TEXT"> + * </pluma:TagGroup> * ..... - * <gedit:TagGroup name="XSLT - Functions"> - * </gedit:TagGroup> + * <pluma:TagGroup name="XSLT - Functions"> + * </pluma:TagGroup> * ..... * Therefore need to pick up the best lang on the current locale. */ @@ -419,7 +419,7 @@ parse_taglist_file (const gchar* filename) xmlNsPtr ns; xmlNodePtr cur; - gedit_debug_message (DEBUG_PLUGINS, "Parse file: %s", filename); + pluma_debug_message (DEBUG_PLUGINS, "Parse file: %s", filename); xmlKeepBlanksDefault (0); @@ -448,12 +448,12 @@ parse_taglist_file (const gchar* filename) } ns = xmlSearchNsByHref (doc, cur, - (const xmlChar *) "http://gedit.sourceforge.net/some-location"); + (const xmlChar *) "http://pluma.sourceforge.net/some-location"); if (ns == NULL) { g_warning ("The tag list file '%s' is of the wrong type, " - "gedit namespace not found.", filename); + "pluma namespace not found.", filename); xmlFreeDoc (doc); return taglist; @@ -479,7 +479,7 @@ parse_taglist_file (const gchar* filename) xmlFreeDoc (doc); - gedit_debug_message (DEBUG_PLUGINS, "END"); + pluma_debug_message (DEBUG_PLUGINS, "END"); return taglist; } @@ -488,7 +488,7 @@ static void free_tag (Tag *tag) { /* - gedit_debug_message (DEBUG_PLUGINS, "Tag: %s", tag->name); + pluma_debug_message (DEBUG_PLUGINS, "Tag: %s", tag->name); */ g_return_if_fail (tag != NULL); @@ -508,7 +508,7 @@ free_tag_group (TagGroup *tag_group) { GList *l; - gedit_debug_message (DEBUG_PLUGINS, "Tag group: %s", tag_group->name); + pluma_debug_message (DEBUG_PLUGINS, "Tag group: %s", tag_group->name); g_return_if_fail (tag_group != NULL); @@ -522,7 +522,7 @@ free_tag_group (TagGroup *tag_group) g_list_free (tag_group->tags); g_free (tag_group); - gedit_debug_message (DEBUG_PLUGINS, "END"); + pluma_debug_message (DEBUG_PLUGINS, "END"); } void @@ -530,7 +530,7 @@ free_taglist (void) { GList *l; - gedit_debug_message (DEBUG_PLUGINS, "ref_count: %d", taglist_ref_count); + pluma_debug_message (DEBUG_PLUGINS, "ref_count: %d", taglist_ref_count); if (taglist == NULL) return; @@ -550,7 +550,7 @@ free_taglist (void) g_free (taglist); taglist = NULL; - gedit_debug_message (DEBUG_PLUGINS, "Really freed"); + pluma_debug_message (DEBUG_PLUGINS, "Really freed"); } static TagList * @@ -560,12 +560,12 @@ parse_taglist_dir (const gchar *dir) GDir *d; const gchar *dirent; - gedit_debug_message (DEBUG_PLUGINS, "DIR: %s", dir); + pluma_debug_message (DEBUG_PLUGINS, "DIR: %s", dir); d = g_dir_open (dir, 0, &error); if (!d) { - gedit_debug_message (DEBUG_PLUGINS, "%s", error->message); + pluma_debug_message (DEBUG_PLUGINS, "%s", error->message); g_error_free (error); return taglist; } @@ -590,7 +590,7 @@ TagList* create_taglist (const gchar *data_dir) { gchar *pdir; - gedit_debug_message (DEBUG_PLUGINS, "ref_count: %d", taglist_ref_count); + pluma_debug_message (DEBUG_PLUGINS, "ref_count: %d", taglist_ref_count); if (taglist_ref_count > 0) { @@ -610,7 +610,7 @@ TagList* create_taglist (const gchar *data_dir) if (home != NULL) { pdir = g_build_filename (home, - USER_GEDIT_TAGLIST_PLUGIN_LOCATION_LEGACY, + USER_PLUMA_TAGLIST_PLUGIN_LOCATION_LEGACY, NULL); parse_taglist_dir (pdir); g_free (pdir); @@ -621,7 +621,7 @@ TagList* create_taglist (const gchar *data_dir) if (envvar != NULL) { pdir = g_build_filename (envvar, - USER_GEDIT_TAGLIST_PLUGIN_LOCATION, + USER_PLUMA_TAGLIST_PLUGIN_LOCATION, NULL); parse_taglist_dir (pdir); g_free (pdir); @@ -630,7 +630,7 @@ TagList* create_taglist (const gchar *data_dir) { pdir = g_build_filename (home, ".mate2", - USER_GEDIT_TAGLIST_PLUGIN_LOCATION, + USER_PLUMA_TAGLIST_PLUGIN_LOCATION, NULL); parse_taglist_dir (pdir); g_free (pdir); @@ -638,7 +638,7 @@ TagList* create_taglist (const gchar *data_dir) #else pdir = g_build_filename (g_get_user_config_dir (), - "gedit", + "pluma", "taglist", NULL); parse_taglist_dir (pdir); diff --git a/plugins/taglist/gedit-taglist-plugin-parser.h b/plugins/taglist/pluma-taglist-plugin-parser.h index d008836e..42a8d3ff 100755 --- a/plugins/taglist/gedit-taglist-plugin-parser.h +++ b/plugins/taglist/pluma-taglist-plugin-parser.h @@ -1,6 +1,6 @@ /* - * gedit-taglist-plugin-parser.h - * This file is part of gedit + * pluma-taglist-plugin-parser.h + * This file is part of pluma * * Copyright (C) 2002-2005 - Paolo Maggi * @@ -21,15 +21,15 @@ */ /* - * Modified by the gedit Team, 2002-2005. See the AUTHORS file for a - * list of people on the gedit Team. + * Modified by the pluma Team, 2002-2005. See the AUTHORS file for a + * list of people on the pluma Team. * See the ChangeLog files for a list of changes. * * $Id$ */ -#ifndef __GEDIT_TAGLIST_PLUGIN_PARSER_H__ -#define __GEDIT_TAGLIST_PLUGIN_PARSER_H__ +#ifndef __PLUMA_TAGLIST_PLUGIN_PARSER_H__ +#define __PLUMA_TAGLIST_PLUGIN_PARSER_H__ #include <libxml/tree.h> #include <glib.h> @@ -64,5 +64,5 @@ TagList* create_taglist (const gchar *data_dir); void free_taglist (void); -#endif /* __GEDIT_TAGLIST_PLUGIN_PARSER_H__ */ +#endif /* __PLUMA_TAGLIST_PLUGIN_PARSER_H__ */ diff --git a/plugins/taglist/gedit-taglist-plugin.c b/plugins/taglist/pluma-taglist-plugin.c index 081fefcb..202ab12e 100755 --- a/plugins/taglist/gedit-taglist-plugin.c +++ b/plugins/taglist/pluma-taglist-plugin.c @@ -1,5 +1,5 @@ /* - * gedit-taglist-plugin.h + * pluma-taglist-plugin.h * * Copyright (C) 2002-2005 - Paolo Maggi * @@ -20,8 +20,8 @@ */ /* - * Modified by the gedit Team, 2002-2005. See the AUTHORS file for a - * list of people on the gedit Team. + * Modified by the pluma Team, 2002-2005. See the AUTHORS file for a + * list of people on the pluma Team. * See the ChangeLog files for a list of changes. * * $Id$ @@ -31,69 +31,69 @@ #include <config.h> #endif -#include "gedit-taglist-plugin.h" -#include "gedit-taglist-plugin-panel.h" -#include "gedit-taglist-plugin-parser.h" +#include "pluma-taglist-plugin.h" +#include "pluma-taglist-plugin-panel.h" +#include "pluma-taglist-plugin-parser.h" #include <glib/gi18n-lib.h> #include <gmodule.h> -#include <gedit/gedit-plugin.h> -#include <gedit/gedit-debug.h> +#include <pluma/pluma-plugin.h> +#include <pluma/pluma-debug.h> -#define WINDOW_DATA_KEY "GeditTaglistPluginWindowData" +#define WINDOW_DATA_KEY "PlumaTaglistPluginWindowData" -#define GEDIT_TAGLIST_PLUGIN_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GEDIT_TYPE_TAGLIST_PLUGIN, GeditTaglistPluginPrivate)) +#define PLUMA_TAGLIST_PLUGIN_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), PLUMA_TYPE_TAGLIST_PLUGIN, PlumaTaglistPluginPrivate)) -struct _GeditTaglistPluginPrivate +struct _PlumaTaglistPluginPrivate { gpointer dummy; }; -GEDIT_PLUGIN_REGISTER_TYPE_WITH_CODE (GeditTaglistPlugin, gedit_taglist_plugin, - gedit_taglist_plugin_panel_register_type (module); +PLUMA_PLUGIN_REGISTER_TYPE_WITH_CODE (PlumaTaglistPlugin, pluma_taglist_plugin, + pluma_taglist_plugin_panel_register_type (module); ) static void -gedit_taglist_plugin_init (GeditTaglistPlugin *plugin) +pluma_taglist_plugin_init (PlumaTaglistPlugin *plugin) { - plugin->priv = GEDIT_TAGLIST_PLUGIN_GET_PRIVATE (plugin); + plugin->priv = PLUMA_TAGLIST_PLUGIN_GET_PRIVATE (plugin); - gedit_debug_message (DEBUG_PLUGINS, "GeditTaglistPlugin initializing"); + pluma_debug_message (DEBUG_PLUGINS, "PlumaTaglistPlugin initializing"); } static void -gedit_taglist_plugin_finalize (GObject *object) +pluma_taglist_plugin_finalize (GObject *object) { /* - GeditTaglistPlugin *plugin = GEDIT_TAGLIST_PLUGIN (object); + PlumaTaglistPlugin *plugin = PLUMA_TAGLIST_PLUGIN (object); */ - gedit_debug_message (DEBUG_PLUGINS, "GeditTaglistPlugin finalizing"); + pluma_debug_message (DEBUG_PLUGINS, "PlumaTaglistPlugin finalizing"); free_taglist (); - G_OBJECT_CLASS (gedit_taglist_plugin_parent_class)->finalize (object); + G_OBJECT_CLASS (pluma_taglist_plugin_parent_class)->finalize (object); } static void -impl_activate (GeditPlugin *plugin, - GeditWindow *window) +impl_activate (PlumaPlugin *plugin, + PlumaWindow *window) { - GeditPanel *side_panel; + PlumaPanel *side_panel; GtkWidget *taglist_panel; gchar *data_dir; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); g_return_if_fail (g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY) == NULL); - side_panel = gedit_window_get_side_panel (window); + side_panel = pluma_window_get_side_panel (window); - data_dir = gedit_plugin_get_data_dir (plugin); - taglist_panel = gedit_taglist_plugin_panel_new (window, data_dir); + data_dir = pluma_plugin_get_data_dir (plugin); + taglist_panel = pluma_taglist_plugin_panel_new (window, data_dir); g_free (data_dir); - gedit_panel_add_item_with_stock_icon (side_panel, + pluma_panel_add_item_with_stock_icon (side_panel, taglist_panel, _("Tags"), GTK_STOCK_ADD); @@ -104,20 +104,20 @@ impl_activate (GeditPlugin *plugin, } static void -impl_deactivate (GeditPlugin *plugin, - GeditWindow *window) +impl_deactivate (PlumaPlugin *plugin, + PlumaWindow *window) { - GeditPanel *side_panel; + PlumaPanel *side_panel; gpointer data; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); data = g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY); g_return_if_fail (data != NULL); - side_panel = gedit_window_get_side_panel (window); + side_panel = pluma_window_get_side_panel (window); - gedit_panel_remove_item (side_panel, + pluma_panel_remove_item (side_panel, GTK_WIDGET (data)); g_object_set_data (G_OBJECT (window), @@ -126,18 +126,18 @@ impl_deactivate (GeditPlugin *plugin, } static void -impl_update_ui (GeditPlugin *plugin, - GeditWindow *window) +impl_update_ui (PlumaPlugin *plugin, + PlumaWindow *window) { gpointer data; - GeditView *view; + PlumaView *view; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); data = g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY); g_return_if_fail (data != NULL); - view = gedit_window_get_active_view (window); + view = pluma_window_get_active_view (window); gtk_widget_set_sensitive (GTK_WIDGET (data), (view != NULL) && @@ -145,16 +145,16 @@ impl_update_ui (GeditPlugin *plugin, } static void -gedit_taglist_plugin_class_init (GeditTaglistPluginClass *klass) +pluma_taglist_plugin_class_init (PlumaTaglistPluginClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - GeditPluginClass *plugin_class = GEDIT_PLUGIN_CLASS (klass); + PlumaPluginClass *plugin_class = PLUMA_PLUGIN_CLASS (klass); - object_class->finalize = gedit_taglist_plugin_finalize; + object_class->finalize = pluma_taglist_plugin_finalize; plugin_class->activate = impl_activate; plugin_class->deactivate = impl_deactivate; plugin_class->update_ui = impl_update_ui; - g_type_class_add_private (object_class, sizeof (GeditTaglistPluginPrivate)); + g_type_class_add_private (object_class, sizeof (PlumaTaglistPluginPrivate)); } diff --git a/plugins/taglist/pluma-taglist-plugin.h b/plugins/taglist/pluma-taglist-plugin.h new file mode 100755 index 00000000..3ec8e088 --- /dev/null +++ b/plugins/taglist/pluma-taglist-plugin.h @@ -0,0 +1,85 @@ +/* + * pluma-taglist-plugin.h + * + * Copyright (C) 2002-2005 - Paolo Maggi + * + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +/* + * Modified by the pluma Team, 2002-2005. See the AUTHORS file for a + * list of people on the pluma Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __PLUMA_TAGLIST_PLUGIN_H__ +#define __PLUMA_TAGLIST_PLUGIN_H__ + +#include <glib.h> +#include <glib-object.h> +#include <pluma/pluma-plugin.h> + +G_BEGIN_DECLS + +/* + * Type checking and casting macros + */ +#define PLUMA_TYPE_TAGLIST_PLUGIN (pluma_taglist_plugin_get_type ()) +#define PLUMA_TAGLIST_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PLUMA_TYPE_TAGLIST_PLUGIN, PlumaTaglistPlugin)) +#define PLUMA_TAGLIST_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PLUMA_TYPE_TAGLIST_PLUGIN, PlumaTaglistPluginClass)) +#define PLUMA_IS_TAGLIST_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PLUMA_TYPE_TAGLIST_PLUGIN)) +#define PLUMA_IS_TAGLIST_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PLUMA_TYPE_TAGLIST_PLUGIN)) +#define PLUMA_TAGLIST_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), PLUMA_TYPE_TAGLIST_PLUGIN, PlumaTaglistPluginClass)) + +/* Private structure type */ +typedef struct _PlumaTaglistPluginPrivate PlumaTaglistPluginPrivate; + +/* + * Main object structure + */ +typedef struct _PlumaTaglistPlugin PlumaTaglistPlugin; + +struct _PlumaTaglistPlugin +{ + PlumaPlugin parent_instance; + + /*< private >*/ + PlumaTaglistPluginPrivate *priv; +}; + +/* + * Class definition + */ +typedef struct _PlumaTaglistPluginClass PlumaTaglistPluginClass; + +struct _PlumaTaglistPluginClass +{ + PlumaPluginClass parent_class; +}; + +/* + * Public methods + */ +GType pluma_taglist_plugin_get_type (void) G_GNUC_CONST; + +/* All the plugins must implement this function */ +G_MODULE_EXPORT GType register_pluma_plugin (GTypeModule *module); + +G_END_DECLS + +#endif /* __PLUMA_TAGLIST_PLUGIN_H__ */ diff --git a/plugins/taglist/taglist.gedit-plugin.desktop.in b/plugins/taglist/taglist.pluma-plugin.desktop.in index 09d0f2d0..7337358a 100755 --- a/plugins/taglist/taglist.gedit-plugin.desktop.in +++ b/plugins/taglist/taglist.pluma-plugin.desktop.in @@ -1,8 +1,8 @@ -[Gedit Plugin] +[Pluma Plugin] Module=taglist IAge=2 _Name=Tag list _Description=Provides a method to easily insert commonly used tags/strings into a document without having to type them. Authors=Paolo Maggi <[email protected]> Copyright=Copyright © 2002-2005 Paolo Maggi -Website=http://www.gedit.org +Website=http://www.pluma.org diff --git a/plugins/time/Makefile.am b/plugins/time/Makefile.am index c532f7d4..bfb442b6 100755 --- a/plugins/time/Makefile.am +++ b/plugins/time/Makefile.am @@ -1,31 +1,31 @@ # time plugin -plugindir = $(GEDIT_PLUGINS_LIBS_DIR) +plugindir = $(PLUMA_PLUGINS_LIBS_DIR) INCLUDES = \ -I$(top_srcdir) \ - $(GEDIT_CFLAGS) \ + $(PLUMA_CFLAGS) \ $(WARN_CFLAGS) \ $(DISABLE_DEPRECATED_CFLAGS) plugin_LTLIBRARIES = libtime.la libtime_la_SOURCES = \ - gedit-time-plugin.h \ - gedit-time-plugin.c + pluma-time-plugin.h \ + pluma-time-plugin.c libtime_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS) -libtime_la_LIBADD = $(GEDIT_LIBS) +libtime_la_LIBADD = $(PLUMA_LIBS) -uidir = $(GEDIT_PLUGINS_DATA_DIR)/time +uidir = $(PLUMA_PLUGINS_DATA_DIR)/time ui_DATA = \ - gedit-time-dialog.ui \ - gedit-time-setup-dialog.ui + pluma-time-dialog.ui \ + pluma-time-setup-dialog.ui -plugin_in_files = time.gedit-plugin.desktop.in +plugin_in_files = time.pluma-plugin.desktop.in -%.gedit-plugin: %.gedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache +%.pluma-plugin: %.pluma-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache -plugin_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin) +plugin_DATA = $(plugin_in_files:.pluma-plugin.desktop.in=.pluma-plugin) EXTRA_DIST = $(ui_DATA) $(plugin_in_files) diff --git a/plugins/time/gedit-time-plugin.h b/plugins/time/gedit-time-plugin.h deleted file mode 100755 index 6d598264..00000000 --- a/plugins/time/gedit-time-plugin.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * gedit-time-plugin.h - * - * Copyright (C) 2002-2005 - Paolo Maggi - * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - */ - -#ifndef __GEDIT_TIME_PLUGIN_H__ -#define __GEDIT_TIME_PLUGIN_H__ - -#include <glib.h> -#include <glib-object.h> -#include <gedit/gedit-plugin.h> - -G_BEGIN_DECLS - -/* - * Type checking and casting macros - */ -#define GEDIT_TYPE_TIME_PLUGIN (gedit_time_plugin_get_type ()) -#define GEDIT_TIME_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GEDIT_TYPE_TIME_PLUGIN, GeditTimePlugin)) -#define GEDIT_TIME_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GEDIT_TYPE_TIME_PLUGIN, GeditTimePluginClass)) -#define GEDIT_IS_TIME_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GEDIT_TYPE_TIME_PLUGIN)) -#define GEDIT_IS_TIME_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GEDIT_TYPE_TIME_PLUGIN)) -#define GEDIT_TIME_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GEDIT_TYPE_TIME_PLUGIN, GeditTimePluginClass)) - -/* Private structure type */ -typedef struct _GeditTimePluginPrivate GeditTimePluginPrivate; - -/* - * Main object structure - */ -typedef struct _GeditTimePlugin GeditTimePlugin; - -struct _GeditTimePlugin -{ - GeditPlugin parent_instance; - - /*< private >*/ - GeditTimePluginPrivate *priv; -}; - -/* - * Class definition - */ -typedef struct _GeditTimePluginClass GeditTimePluginClass; - -struct _GeditTimePluginClass -{ - GeditPluginClass parent_class; -}; - -/* - * Public methods - */ -GType gedit_time_plugin_get_type (void) G_GNUC_CONST; - -/* All the plugins must implement this function */ -G_MODULE_EXPORT GType register_gedit_plugin (GTypeModule *module); - -G_END_DECLS - -#endif /* __GEDIT_TIME_PLUGIN_H__ */ diff --git a/plugins/time/gedit-time-dialog.ui b/plugins/time/pluma-time-dialog.ui index 398e9b98..398e9b98 100755 --- a/plugins/time/gedit-time-dialog.ui +++ b/plugins/time/pluma-time-dialog.ui diff --git a/plugins/time/gedit-time-plugin.c b/plugins/time/pluma-time-plugin.c index 42bf6cb9..d504bdf4 100755 --- a/plugins/time/gedit-time-plugin.c +++ b/plugins/time/pluma-time-plugin.c @@ -1,5 +1,5 @@ /* - * gedit-time-plugin.c + * pluma-time-plugin.c * * Copyright (C) 2002-2005 - Paolo Maggi * @@ -21,8 +21,8 @@ */ /* - * Modified by the gedit Team, 2002. See the AUTHORS file for a - * list of people on the gedit Team. + * Modified by the pluma Team, 2002. See the AUTHORS file for a + * list of people on the pluma Team. * See the ChangeLog files for a list of changes. */ @@ -35,25 +35,25 @@ #include <mateconf/mateconf-client.h> -#include "gedit-time-plugin.h" -#include <gedit/gedit-help.h> +#include "pluma-time-plugin.h" +#include <pluma/pluma-help.h> #include <glib/gi18n-lib.h> #include <glib.h> #include <gmodule.h> -#include <gedit/gedit-debug.h> -#include <gedit/gedit-utils.h> +#include <pluma/pluma-debug.h> +#include <pluma/pluma-utils.h> -#define GEDIT_TIME_PLUGIN_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \ - GEDIT_TYPE_TIME_PLUGIN, \ - GeditTimePluginPrivate)) +#define PLUMA_TIME_PLUGIN_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \ + PLUMA_TYPE_TIME_PLUGIN, \ + PlumaTimePluginPrivate)) -#define WINDOW_DATA_KEY "GeditTimePluginWindowData" +#define WINDOW_DATA_KEY "PlumaTimePluginWindowData" #define MENU_PATH "/MenuBar/EditMenu/EditOps_4" /* mateconf keys */ -#define TIME_BASE_KEY "/apps/gedit-2/plugins/time" +#define TIME_BASE_KEY "/apps/pluma-2/plugins/time" #define PROMPT_TYPE_KEY TIME_BASE_KEY "/prompt_type" #define SELECTED_FORMAT_KEY TIME_BASE_KEY "/selected_format" #define CUSTOM_FORMAT_KEY TIME_BASE_KEY "/custom_format" @@ -122,7 +122,7 @@ struct _TimeConfigureDialog GtkWidget *custom_format_example; /* Info needed for the response handler */ - GeditTimePlugin *plugin; + PlumaTimePlugin *plugin; }; typedef struct _ChooseFormatDialog ChooseFormatDialog; @@ -142,7 +142,7 @@ struct _ChooseFormatDialog /* Info needed for the response handler */ GtkTextBuffer *buffer; - GeditTimePlugin *plugin; + PlumaTimePlugin *plugin; }; typedef enum @@ -151,14 +151,14 @@ typedef enum PROMPT_CUSTOM_FORMAT, /* Popup dialog with entry preselected */ USE_SELECTED_FORMAT, /* Use selected format directly */ USE_CUSTOM_FORMAT /* Use custom format directly */ -} GeditTimePluginPromptType; +} PlumaTimePluginPromptType; -struct _GeditTimePluginPrivate +struct _PlumaTimePluginPrivate { MateConfClient *mateconf_client; }; -GEDIT_PLUGIN_REGISTER_TYPE(GeditTimePlugin, gedit_time_plugin) +PLUMA_PLUGIN_REGISTER_TYPE(PlumaTimePlugin, pluma_time_plugin) typedef struct { @@ -168,8 +168,8 @@ typedef struct typedef struct { - GeditWindow *window; - GeditTimePlugin *plugin; + PlumaWindow *window; + PlumaTimePlugin *plugin; } ActionData; static void time_cb (GtkAction *action, ActionData *data); @@ -187,11 +187,11 @@ static const GtkActionEntry action_entries[] = }; static void -gedit_time_plugin_init (GeditTimePlugin *plugin) +pluma_time_plugin_init (PlumaTimePlugin *plugin) { - gedit_debug_message (DEBUG_PLUGINS, "GeditTimePlugin initializing"); + pluma_debug_message (DEBUG_PLUGINS, "PlumaTimePlugin initializing"); - plugin->priv = GEDIT_TIME_PLUGIN_GET_PRIVATE (plugin); + plugin->priv = PLUMA_TIME_PLUGIN_GET_PRIVATE (plugin); plugin->priv->mateconf_client = mateconf_client_get_default (); @@ -202,17 +202,17 @@ gedit_time_plugin_init (GeditTimePlugin *plugin) } static void -gedit_time_plugin_finalize (GObject *object) +pluma_time_plugin_finalize (GObject *object) { - GeditTimePlugin *plugin = GEDIT_TIME_PLUGIN (object); + PlumaTimePlugin *plugin = PLUMA_TIME_PLUGIN (object); - gedit_debug_message (DEBUG_PLUGINS, "GeditTimePlugin finalizing"); + pluma_debug_message (DEBUG_PLUGINS, "PlumaTimePlugin finalizing"); mateconf_client_suggest_sync (plugin->priv->mateconf_client, NULL); g_object_unref (G_OBJECT (plugin->priv->mateconf_client)); - G_OBJECT_CLASS (gedit_time_plugin_parent_class)->finalize (object); + G_OBJECT_CLASS (pluma_time_plugin_parent_class)->finalize (object); } static void @@ -225,17 +225,17 @@ free_window_data (WindowData *data) } static void -update_ui_real (GeditWindow *window, +update_ui_real (PlumaWindow *window, WindowData *data) { - GeditView *view; + PlumaView *view; GtkAction *action; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); - view = gedit_window_get_active_view (window); + view = pluma_window_get_active_view (window); - gedit_debug_message (DEBUG_PLUGINS, "View: %p", view); + pluma_debug_message (DEBUG_PLUGINS, "View: %p", view); action = gtk_action_group_get_action (data->action_group, "InsertDateAndTime"); @@ -245,24 +245,24 @@ update_ui_real (GeditWindow *window, } static void -impl_activate (GeditPlugin *plugin, - GeditWindow *window) +impl_activate (PlumaPlugin *plugin, + PlumaWindow *window) { GtkUIManager *manager; WindowData *data; ActionData *action_data; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); data = g_new (WindowData, 1); action_data = g_new (ActionData, 1); - action_data->plugin = GEDIT_TIME_PLUGIN (plugin); + action_data->plugin = PLUMA_TIME_PLUGIN (plugin); action_data->window = window; - manager = gedit_window_get_ui_manager (window); + manager = pluma_window_get_ui_manager (window); - data->action_group = gtk_action_group_new ("GeditTimePluginActions"); + data->action_group = gtk_action_group_new ("PlumaTimePluginActions"); gtk_action_group_set_translation_domain (data->action_group, GETTEXT_PACKAGE); gtk_action_group_add_actions_full (data->action_group, @@ -292,15 +292,15 @@ impl_activate (GeditPlugin *plugin, } static void -impl_deactivate (GeditPlugin *plugin, - GeditWindow *window) +impl_deactivate (PlumaPlugin *plugin, + PlumaWindow *window) { GtkUIManager *manager; WindowData *data; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); - manager = gedit_window_get_ui_manager (window); + manager = pluma_window_get_ui_manager (window); data = (WindowData *) g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY); g_return_if_fail (data != NULL); @@ -312,12 +312,12 @@ impl_deactivate (GeditPlugin *plugin, } static void -impl_update_ui (GeditPlugin *plugin, - GeditWindow *window) +impl_update_ui (PlumaPlugin *plugin, + PlumaWindow *window) { WindowData *data; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); data = (WindowData *) g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY); g_return_if_fail (data != NULL); @@ -326,11 +326,11 @@ impl_update_ui (GeditPlugin *plugin, } /* whether we should prompt the user or use the specified format */ -static GeditTimePluginPromptType -get_prompt_type (GeditTimePlugin *plugin) +static PlumaTimePluginPromptType +get_prompt_type (PlumaTimePlugin *plugin) { gchar *prompt_type; - GeditTimePluginPromptType res; + PlumaTimePluginPromptType res; prompt_type = mateconf_client_get_string (plugin->priv->mateconf_client, PROMPT_TYPE_KEY, @@ -354,8 +354,8 @@ get_prompt_type (GeditTimePlugin *plugin) } static void -set_prompt_type (GeditTimePlugin *plugin, - GeditTimePluginPromptType prompt_type) +set_prompt_type (PlumaTimePlugin *plugin, + PlumaTimePluginPromptType prompt_type) { const gchar * str; @@ -389,7 +389,7 @@ set_prompt_type (GeditTimePlugin *plugin, /* The selected format in the list */ static gchar * -get_selected_format (GeditTimePlugin *plugin) +get_selected_format (PlumaTimePlugin *plugin) { gchar *sel_format; @@ -401,7 +401,7 @@ get_selected_format (GeditTimePlugin *plugin) } static void -set_selected_format (GeditTimePlugin *plugin, +set_selected_format (PlumaTimePlugin *plugin, const gchar *format) { g_return_if_fail (format != NULL); @@ -421,7 +421,7 @@ set_selected_format (GeditTimePlugin *plugin, /* the custom format in the entry */ static gchar * -get_custom_format (GeditTimePlugin *plugin) +get_custom_format (PlumaTimePlugin *plugin) { gchar *format; @@ -433,7 +433,7 @@ get_custom_format (GeditTimePlugin *plugin) } static void -set_custom_format (GeditTimePlugin *plugin, +set_custom_format (PlumaTimePlugin *plugin, const gchar *format) { g_return_if_fail (format != NULL); @@ -459,7 +459,7 @@ get_time (const gchar* format) size_t out_length = 0; gchar *locale_format; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); g_return_val_if_fail (format != NULL, NULL); @@ -501,24 +501,24 @@ get_time (const gchar* format) static void dialog_destroyed (GtkObject *obj, gpointer dialog_pointer) { - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); g_free (dialog_pointer); - gedit_debug_message (DEBUG_PLUGINS, "END"); + pluma_debug_message (DEBUG_PLUGINS, "END"); } static GtkTreeModel * create_model (GtkWidget *listview, const gchar *sel_format, - GeditTimePlugin *plugin) + PlumaTimePlugin *plugin) { gint i = 0; GtkListStore *store; GtkTreeSelection *selection; GtkTreeIter iter; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); /* create list store */ store = gtk_list_store_new (NUM_COLUMNS, G_TYPE_STRING, G_TYPE_INT); @@ -541,7 +541,7 @@ create_model (GtkWidget *listview, str = get_time (formats[i]); - gedit_debug_message (DEBUG_PLUGINS, "%d : %s", i, str); + pluma_debug_message (DEBUG_PLUGINS, "%d : %s", i, str); gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, COLUMN_FORMATS, str, @@ -572,7 +572,7 @@ scroll_to_selected (GtkTreeView *tree_view) GtkTreeSelection *selection; GtkTreeIter iter; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); model = gtk_tree_view_get_model (tree_view); g_return_if_fail (model != NULL); @@ -597,12 +597,12 @@ scroll_to_selected (GtkTreeView *tree_view) static void create_formats_list (GtkWidget *listview, const gchar *sel_format, - GeditTimePlugin *plugin) + PlumaTimePlugin *plugin) { GtkTreeViewColumn *column; GtkCellRenderer *cell; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); g_return_if_fail (listview != NULL); g_return_if_fail (sel_format != NULL); @@ -636,7 +636,7 @@ updated_custom_format_example (GtkEntry *format_entry, gchar *str; gchar *escaped_time; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); g_return_if_fail (GTK_IS_ENTRY (format_entry)); g_return_if_fail (GTK_IS_LABEL (format_example)); @@ -659,7 +659,7 @@ static void choose_format_dialog_button_toggled (GtkToggleButton *button, ChooseFormatDialog *dialog) { - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->custom))) { @@ -683,7 +683,7 @@ choose_format_dialog_button_toggled (GtkToggleButton *button, static void configure_dialog_button_toggled (GtkToggleButton *button, TimeConfigureDialog *dialog) { - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->custom))) { @@ -720,7 +720,7 @@ get_format_from_list (GtkWidget *listview) GtkTreeSelection *selection; GtkTreeIter iter; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); model = gtk_tree_view_get_model (GTK_TREE_VIEW (listview)); g_return_val_if_fail (model != NULL, 0); @@ -734,7 +734,7 @@ get_format_from_list (GtkWidget *listview) gtk_tree_model_get (model, &iter, COLUMN_INDEX, &selected_value, -1); - gedit_debug_message (DEBUG_PLUGINS, "Sel value: %d", selected_value); + pluma_debug_message (DEBUG_PLUGINS, "Sel value: %d", selected_value); return selected_value; } @@ -743,14 +743,14 @@ get_format_from_list (GtkWidget *listview) } static TimeConfigureDialog * -get_configure_dialog (GeditTimePlugin *plugin) +get_configure_dialog (PlumaTimePlugin *plugin) { TimeConfigureDialog *dialog = NULL; gchar *data_dir; gchar *ui_file; GtkWidget *content; GtkWidget *viewport; - GeditTimePluginPromptType prompt_type; + PlumaTimePluginPromptType prompt_type; gchar *sf, *cf; GtkWidget *error_widget; gboolean ret; @@ -759,7 +759,7 @@ get_configure_dialog (GeditTimePlugin *plugin) NULL }; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); dialog = g_new0 (TimeConfigureDialog, 1); @@ -784,9 +784,9 @@ get_configure_dialog (GeditTimePlugin *plugin) g_return_val_if_fail (dialog->dialog != NULL, NULL); - data_dir = gedit_plugin_get_data_dir (GEDIT_PLUGIN (plugin)); - ui_file = g_build_filename (data_dir, "gedit-time-setup-dialog.ui", NULL); - ret = gedit_utils_get_ui_objects (ui_file, + data_dir = pluma_plugin_get_data_dir (PLUMA_PLUGIN (plugin)); + ui_file = g_build_filename (data_dir, "pluma-time-setup-dialog.ui", NULL); + ret = pluma_utils_get_ui_objects (ui_file, root_objects, &error_widget, "time_dialog_content", &content, @@ -894,7 +894,7 @@ static void real_insert_time (GtkTextBuffer *buffer, const gchar *the_time) { - gedit_debug_message (DEBUG_PLUGINS, "Insert: %s", the_time); + pluma_debug_message (DEBUG_PLUGINS, "Insert: %s", the_time); gtk_text_buffer_begin_user_action (buffer); @@ -928,8 +928,8 @@ choose_format_dialog_row_activated (GtkTreeView *list, static ChooseFormatDialog * get_choose_format_dialog (GtkWindow *parent, - GeditTimePluginPromptType prompt_type, - GeditTimePlugin *plugin) + PlumaTimePluginPromptType prompt_type, + PlumaTimePlugin *plugin) { ChooseFormatDialog *dialog; gchar *data_dir; @@ -944,9 +944,9 @@ get_choose_format_dialog (GtkWindow *parent, dialog = g_new0 (ChooseFormatDialog, 1); - data_dir = gedit_plugin_get_data_dir (GEDIT_PLUGIN (plugin)); - ui_file = g_build_filename (data_dir, "gedit-time-dialog.ui", NULL); - ret = gedit_utils_get_ui_objects (ui_file, + data_dir = pluma_plugin_get_data_dir (PLUMA_PLUGIN (plugin)); + ui_file = g_build_filename (data_dir, "pluma-time-dialog.ui", NULL); + ret = pluma_utils_get_ui_objects (ui_file, NULL, &error_widget, "choose_format_dialog", &dialog->dialog, @@ -1068,17 +1068,17 @@ choose_format_dialog_response_cb (GtkWidget *widget, { case GTK_RESPONSE_HELP: { - gedit_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_HELP"); - gedit_help_display (GTK_WINDOW (widget), + pluma_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_HELP"); + pluma_help_display (GTK_WINDOW (widget), NULL, - "gedit-insert-date-time-plugin"); + "pluma-insert-date-time-plugin"); break; } case GTK_RESPONSE_OK: { gchar *the_time; - gedit_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_OK"); + pluma_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_OK"); /* Get the user's chosen format */ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->use_list))) @@ -1111,7 +1111,7 @@ choose_format_dialog_response_cb (GtkWidget *widget, break; } case GTK_RESPONSE_CANCEL: - gedit_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_CANCEL"); + pluma_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_CANCEL"); gtk_widget_destroy (dialog->dialog); } } @@ -1122,11 +1122,11 @@ time_cb (GtkAction *action, { GtkTextBuffer *buffer; gchar *the_time = NULL; - GeditTimePluginPromptType prompt_type; + PlumaTimePluginPromptType prompt_type; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); - buffer = GTK_TEXT_BUFFER (gedit_window_get_active_document (data->window)); + buffer = GTK_TEXT_BUFFER (pluma_window_get_active_document (data->window)); g_return_if_fail (buffer != NULL); prompt_type = get_prompt_type (data->plugin); @@ -1179,7 +1179,7 @@ ok_button_pressed (TimeConfigureDialog *dialog) gint sel_format; const gchar *custom_format; - gedit_debug (DEBUG_PLUGINS); + pluma_debug (DEBUG_PLUGINS); sel_format = get_format_from_list (dialog->list); @@ -1201,7 +1201,7 @@ ok_button_pressed (TimeConfigureDialog *dialog) set_prompt_type (dialog->plugin, PROMPT_SELECTED_FORMAT); } - gedit_debug_message (DEBUG_PLUGINS, "Sel: %d", sel_format); + pluma_debug_message (DEBUG_PLUGINS, "Sel: %d", sel_format); } static void @@ -1213,16 +1213,16 @@ configure_dialog_response_cb (GtkWidget *widget, { case GTK_RESPONSE_HELP: { - gedit_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_HELP"); + pluma_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_HELP"); - gedit_help_display (GTK_WINDOW (dialog), + pluma_help_display (GTK_WINDOW (dialog), NULL, - "gedit-date-time-configure"); + "pluma-date-time-configure"); break; } case GTK_RESPONSE_OK: { - gedit_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_OK"); + pluma_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_OK"); ok_button_pressed (dialog); @@ -1231,20 +1231,20 @@ configure_dialog_response_cb (GtkWidget *widget, } case GTK_RESPONSE_CANCEL: { - gedit_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_CANCEL"); + pluma_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_CANCEL"); gtk_widget_destroy (dialog->dialog); } } } static GtkWidget * -impl_create_configure_dialog (GeditPlugin *plugin) +impl_create_configure_dialog (PlumaPlugin *plugin) { TimeConfigureDialog *dialog; - dialog = get_configure_dialog (GEDIT_TIME_PLUGIN (plugin)); + dialog = get_configure_dialog (PLUMA_TIME_PLUGIN (plugin)); - dialog->plugin = GEDIT_TIME_PLUGIN (plugin); + dialog->plugin = PLUMA_TIME_PLUGIN (plugin); g_signal_connect (dialog->dialog, "response", @@ -1255,12 +1255,12 @@ impl_create_configure_dialog (GeditPlugin *plugin) } static void -gedit_time_plugin_class_init (GeditTimePluginClass *klass) +pluma_time_plugin_class_init (PlumaTimePluginClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - GeditPluginClass *plugin_class = GEDIT_PLUGIN_CLASS (klass); + PlumaPluginClass *plugin_class = PLUMA_PLUGIN_CLASS (klass); - object_class->finalize = gedit_time_plugin_finalize; + object_class->finalize = pluma_time_plugin_finalize; plugin_class->activate = impl_activate; plugin_class->deactivate = impl_deactivate; @@ -1268,5 +1268,5 @@ gedit_time_plugin_class_init (GeditTimePluginClass *klass) plugin_class->create_configure_dialog = impl_create_configure_dialog; - g_type_class_add_private (object_class, sizeof (GeditTimePluginPrivate)); + g_type_class_add_private (object_class, sizeof (PlumaTimePluginPrivate)); } diff --git a/plugins/time/pluma-time-plugin.h b/plugins/time/pluma-time-plugin.h new file mode 100755 index 00000000..e7b66909 --- /dev/null +++ b/plugins/time/pluma-time-plugin.h @@ -0,0 +1,78 @@ +/* + * pluma-time-plugin.h + * + * Copyright (C) 2002-2005 - Paolo Maggi + * + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ + */ + +#ifndef __PLUMA_TIME_PLUGIN_H__ +#define __PLUMA_TIME_PLUGIN_H__ + +#include <glib.h> +#include <glib-object.h> +#include <pluma/pluma-plugin.h> + +G_BEGIN_DECLS + +/* + * Type checking and casting macros + */ +#define PLUMA_TYPE_TIME_PLUGIN (pluma_time_plugin_get_type ()) +#define PLUMA_TIME_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PLUMA_TYPE_TIME_PLUGIN, PlumaTimePlugin)) +#define PLUMA_TIME_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PLUMA_TYPE_TIME_PLUGIN, PlumaTimePluginClass)) +#define PLUMA_IS_TIME_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PLUMA_TYPE_TIME_PLUGIN)) +#define PLUMA_IS_TIME_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PLUMA_TYPE_TIME_PLUGIN)) +#define PLUMA_TIME_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), PLUMA_TYPE_TIME_PLUGIN, PlumaTimePluginClass)) + +/* Private structure type */ +typedef struct _PlumaTimePluginPrivate PlumaTimePluginPrivate; + +/* + * Main object structure + */ +typedef struct _PlumaTimePlugin PlumaTimePlugin; + +struct _PlumaTimePlugin +{ + PlumaPlugin parent_instance; + + /*< private >*/ + PlumaTimePluginPrivate *priv; +}; + +/* + * Class definition + */ +typedef struct _PlumaTimePluginClass PlumaTimePluginClass; + +struct _PlumaTimePluginClass +{ + PlumaPluginClass parent_class; +}; + +/* + * Public methods + */ +GType pluma_time_plugin_get_type (void) G_GNUC_CONST; + +/* All the plugins must implement this function */ +G_MODULE_EXPORT GType register_pluma_plugin (GTypeModule *module); + +G_END_DECLS + +#endif /* __PLUMA_TIME_PLUGIN_H__ */ diff --git a/plugins/time/gedit-time-setup-dialog.ui b/plugins/time/pluma-time-setup-dialog.ui index 46fb5b9d..46fb5b9d 100755 --- a/plugins/time/gedit-time-setup-dialog.ui +++ b/plugins/time/pluma-time-setup-dialog.ui diff --git a/plugins/time/time.gedit-plugin.desktop.in b/plugins/time/time.pluma-plugin.desktop.in index ba06854a..a6dbc791 100755 --- a/plugins/time/time.gedit-plugin.desktop.in +++ b/plugins/time/time.pluma-plugin.desktop.in @@ -1,8 +1,8 @@ -[Gedit Plugin] +[Pluma Plugin] Module=time IAge=2 _Name=Insert Date/Time _Description=Inserts current date and time at the cursor position. Authors=Paolo Maggi <[email protected]>;Lee Mallabone <[email protected]> Copyright=Copyright © 2002-2005 Paolo Maggi -Website=http://www.gedit.org +Website=http://www.pluma.org |