Rename Pluma to Xedit

This commit is contained in:
Clement Lefebvre
2016-01-25 14:13:49 +00:00
parent 3a62ddff64
commit 4304f9ffc1
563 changed files with 112901 additions and 112901 deletions

View File

@@ -1,29 +1,29 @@
# changecase plugin
plugindir = $(PLUMA_PLUGINS_LIBS_DIR)
plugindir = $(XEDIT_PLUGINS_LIBS_DIR)
AM_CPPFLAGS = \
-I$(top_srcdir) \
$(PLUMA_CFLAGS) \
$(XEDIT_CFLAGS) \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS)
plugin_LTLIBRARIES = libchangecase.la
libchangecase_la_SOURCES = \
pluma-changecase-plugin.h \
pluma-changecase-plugin.c
xedit-changecase-plugin.h \
xedit-changecase-plugin.c
libchangecase_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
libchangecase_la_LIBADD = $(PLUMA_LIBS)
libchangecase_la_LIBADD = $(XEDIT_LIBS)
uidir = $(PLUMA_PLUGINS_DATA_DIR)/changecase
uidir = $(XEDIT_PLUGINS_DATA_DIR)/changecase
ui_DATA =
plugin_in_files = changecase.pluma-plugin.desktop.in
plugin_in_files = changecase.xedit-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
%.xedit-plugin: %.xedit-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:.pluma-plugin.desktop.in=.pluma-plugin)
plugin_DATA = $(plugin_in_files:.xedit-plugin.desktop.in=.xedit-plugin)
EXTRA_DIST = $(ui_DATA) $(plugin_in_files)

View File

@@ -1,4 +1,4 @@
[Pluma Plugin]
[Xedit Plugin]
Module=changecase
IAge=2
_Name=Change Case

View File

@@ -1,72 +0,0 @@
/*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, 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__ */

View File

@@ -1,5 +1,5 @@
/*
* pluma-changecase-plugin.c
* xedit-changecase-plugin.c
*
* Copyright (C) 2004-2005 - Paolo Borelli
*
@@ -24,16 +24,16 @@
#include <config.h>
#endif
#include "pluma-changecase-plugin.h"
#include "xedit-changecase-plugin.h"
#include <glib/gi18n-lib.h>
#include <gmodule.h>
#include <pluma/pluma-debug.h>
#include <xedit/xedit-debug.h>
#define WINDOW_DATA_KEY "PlumaChangecasePluginWindowData"
#define WINDOW_DATA_KEY "XeditChangecasePluginWindowData"
PLUMA_PLUGIN_REGISTER_TYPE(PlumaChangecasePlugin, pluma_changecase_plugin)
XEDIT_PLUGIN_REGISTER_TYPE(XeditChangecasePlugin, xedit_changecase_plugin)
typedef enum {
TO_UPPER_CASE,
@@ -149,15 +149,15 @@ do_title_case (GtkTextBuffer *buffer,
}
static void
change_case (PlumaWindow *window,
change_case (XeditWindow *window,
ChangeCaseChoice choice)
{
PlumaDocument *doc;
XeditDocument *doc;
GtkTextIter start, end;
pluma_debug (DEBUG_PLUGINS);
xedit_debug (DEBUG_PLUGINS);
doc = pluma_window_get_active_document (window);
doc = xedit_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 (PlumaWindow *window,
static void
upper_case_cb (GtkAction *action,
PlumaWindow *window)
XeditWindow *window)
{
change_case (window, TO_UPPER_CASE);
}
static void
lower_case_cb (GtkAction *action,
PlumaWindow *window)
XeditWindow *window)
{
change_case (window, TO_LOWER_CASE);
}
static void
invert_case_cb (GtkAction *action,
PlumaWindow *window)
XeditWindow *window)
{
change_case (window, INVERT_CASE);
}
static void
title_case_cb (GtkAction *action,
PlumaWindow *window)
XeditWindow *window)
{
change_case (window, TO_TITLE_CASE);
}
@@ -251,17 +251,17 @@ const gchar submenu[] =
"</ui>";
static void
pluma_changecase_plugin_init (PlumaChangecasePlugin *plugin)
xedit_changecase_plugin_init (XeditChangecasePlugin *plugin)
{
pluma_debug_message (DEBUG_PLUGINS, "PlumaChangecasePlugin initializing");
xedit_debug_message (DEBUG_PLUGINS, "XeditChangecasePlugin initializing");
}
static void
pluma_changecase_plugin_finalize (GObject *object)
xedit_changecase_plugin_finalize (GObject *object)
{
G_OBJECT_CLASS (pluma_changecase_plugin_parent_class)->finalize (object);
G_OBJECT_CLASS (xedit_changecase_plugin_parent_class)->finalize (object);
pluma_debug_message (DEBUG_PLUGINS, "PlumaChangecasePlugin finalizing");
xedit_debug_message (DEBUG_PLUGINS, "XeditChangecasePlugin finalizing");
}
typedef struct
@@ -279,16 +279,16 @@ free_window_data (WindowData *data)
}
static void
update_ui_real (PlumaWindow *window,
update_ui_real (XeditWindow *window,
WindowData *data)
{
GtkTextView *view;
GtkAction *action;
gboolean sensitive = FALSE;
pluma_debug (DEBUG_PLUGINS);
xedit_debug (DEBUG_PLUGINS);
view = GTK_TEXT_VIEW (pluma_window_get_active_view (window));
view = GTK_TEXT_VIEW (xedit_window_get_active_view (window));
if (view != NULL)
{
@@ -305,20 +305,20 @@ update_ui_real (PlumaWindow *window,
}
static void
impl_activate (PlumaPlugin *plugin,
PlumaWindow *window)
impl_activate (XeditPlugin *plugin,
XeditWindow *window)
{
GtkUIManager *manager;
WindowData *data;
GError *error = NULL;
pluma_debug (DEBUG_PLUGINS);
xedit_debug (DEBUG_PLUGINS);
data = g_slice_new (WindowData);
manager = pluma_window_get_ui_manager (window);
manager = xedit_window_get_ui_manager (window);
data->action_group = gtk_action_group_new ("PlumaChangecasePluginActions");
data->action_group = gtk_action_group_new ("XeditChangecasePluginActions");
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 (PlumaPlugin *plugin,
}
static void
impl_deactivate (PlumaPlugin *plugin,
PlumaWindow *window)
impl_deactivate (XeditPlugin *plugin,
XeditWindow *window)
{
GtkUIManager *manager;
WindowData *data;
pluma_debug (DEBUG_PLUGINS);
xedit_debug (DEBUG_PLUGINS);
manager = pluma_window_get_ui_manager (window);
manager = xedit_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 (PlumaPlugin *plugin,
}
static void
impl_update_ui (PlumaPlugin *plugin,
PlumaWindow *window)
impl_update_ui (XeditPlugin *plugin,
XeditWindow *window)
{
WindowData *data;
pluma_debug (DEBUG_PLUGINS);
xedit_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 (PlumaPlugin *plugin,
}
static void
pluma_changecase_plugin_class_init (PlumaChangecasePluginClass *klass)
xedit_changecase_plugin_class_init (XeditChangecasePluginClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
PlumaPluginClass *plugin_class = PLUMA_PLUGIN_CLASS (klass);
XeditPluginClass *plugin_class = XEDIT_PLUGIN_CLASS (klass);
object_class->finalize = pluma_changecase_plugin_finalize;
object_class->finalize = xedit_changecase_plugin_finalize;
plugin_class->activate = impl_activate;
plugin_class->deactivate = impl_deactivate;

View File

@@ -0,0 +1,72 @@
/*
* xedit-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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $Id$
*/
#ifndef __XEDIT_CHANGECASE_PLUGIN_H__
#define __XEDIT_CHANGECASE_PLUGIN_H__
#include <glib.h>
#include <glib-object.h>
#include <xedit/xedit-plugin.h>
G_BEGIN_DECLS
/*
* Type checking and casting macros
*/
#define XEDIT_TYPE_CHANGECASE_PLUGIN (xedit_changecase_plugin_get_type ())
#define XEDIT_CHANGECASE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XEDIT_TYPE_CHANGECASE_PLUGIN, XeditChangecasePlugin))
#define XEDIT_CHANGECASE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XEDIT_TYPE_CHANGECASE_PLUGIN, XeditChangecasePluginClass))
#define XEDIT_IS_CHANGECASE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XEDIT_TYPE_CHANGECASE_PLUGIN))
#define XEDIT_IS_CHANGECASE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XEDIT_TYPE_CHANGECASE_PLUGIN))
#define XEDIT_CHANGECASE_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XEDIT_TYPE_CHANGECASE_PLUGIN, XeditChangecasePluginClass))
/*
* Main object structure
*/
typedef struct _XeditChangecasePlugin XeditChangecasePlugin;
struct _XeditChangecasePlugin
{
XeditPlugin parent_instance;
};
/*
* Class definition
*/
typedef struct _XeditChangecasePluginClass XeditChangecasePluginClass;
struct _XeditChangecasePluginClass
{
XeditPluginClass parent_class;
};
/*
* Public methods
*/
GType xedit_changecase_plugin_get_type (void) G_GNUC_CONST;
/* All the plugins must implement this function */
G_MODULE_EXPORT GType register_xedit_plugin (GTypeModule *module);
G_END_DECLS
#endif /* __XEDIT_CHANGECASE_PLUGIN_H__ */

View File

@@ -1,29 +1,29 @@
# docinfo plugin
plugindir = $(PLUMA_PLUGINS_LIBS_DIR)
plugindir = $(XEDIT_PLUGINS_LIBS_DIR)
AM_CPPFLAGS = \
-I$(top_srcdir) \
$(PLUMA_CFLAGS) \
$(XEDIT_CFLAGS) \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS)
plugin_LTLIBRARIES = libdocinfo.la
libdocinfo_la_SOURCES = \
pluma-docinfo-plugin.h \
pluma-docinfo-plugin.c
xedit-docinfo-plugin.h \
xedit-docinfo-plugin.c
libdocinfo_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
libdocinfo_la_LIBADD = $(PLUMA_LIBS)
libdocinfo_la_LIBADD = $(XEDIT_LIBS)
uidir = $(PLUMA_PLUGINS_DATA_DIR)/docinfo
uidir = $(XEDIT_PLUGINS_DATA_DIR)/docinfo
ui_DATA = docinfo.ui
plugin_in_files = docinfo.pluma-plugin.desktop.in
plugin_in_files = docinfo.xedit-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
%.xedit-plugin: %.xedit-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:.pluma-plugin.desktop.in=.pluma-plugin)
plugin_DATA = $(plugin_in_files:.xedit-plugin.desktop.in=.xedit-plugin)
EXTRA_DIST = $(ui_DATA) $(plugin_in_files)

View File

@@ -1,4 +1,4 @@
[Pluma Plugin]
[Xedit Plugin]
Module=docinfo
IAge=2
_Name=Document Statistics

View File

@@ -1,75 +0,0 @@
/*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, 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__ */

View File

@@ -1,5 +1,5 @@
/*
* pluma-docinfo-plugin.c
* xedit-docinfo-plugin.c
*
* Copyright (C) 2002-2005 Paolo Maggi
*
@@ -24,7 +24,7 @@
#include <config.h>
#endif
#include "pluma-docinfo-plugin.h"
#include "xedit-docinfo-plugin.h"
#include <string.h> /* For strlen (...) */
@@ -32,13 +32,13 @@
#include <pango/pango-break.h>
#include <gmodule.h>
#include <pluma/pluma-debug.h>
#include <pluma/pluma-utils.h>
#include <xedit/xedit-debug.h>
#include <xedit/xedit-utils.h>
#define WINDOW_DATA_KEY "PlumaDocInfoWindowData"
#define WINDOW_DATA_KEY "XeditDocInfoWindowData"
#define MENU_PATH "/MenuBar/ToolsMenu/ToolsOps_2"
PLUMA_PLUGIN_REGISTER_TYPE(PlumaDocInfoPlugin, pluma_docinfo_plugin)
XEDIT_PLUGIN_REGISTER_TYPE(XeditDocInfoPlugin, xedit_docinfo_plugin)
typedef struct
{
@@ -59,7 +59,7 @@ typedef struct
typedef struct
{
PlumaPlugin *plugin;
XeditPlugin *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,
PlumaWindow *window);
XeditWindow *window);
static void
docinfo_dialog_destroy_cb (GObject *obj,
WindowData *data)
{
pluma_debug (DEBUG_PLUGINS);
xedit_debug (DEBUG_PLUGINS);
if (data != NULL)
{
@@ -85,7 +85,7 @@ docinfo_dialog_destroy_cb (GObject *obj,
}
static DocInfoDialog *
get_docinfo_dialog (PlumaWindow *window,
get_docinfo_dialog (XeditWindow *window,
WindowData *data)
{
DocInfoDialog *dialog;
@@ -95,13 +95,13 @@ get_docinfo_dialog (PlumaWindow *window,
GtkWidget *error_widget;
gboolean ret;
pluma_debug (DEBUG_PLUGINS);
xedit_debug (DEBUG_PLUGINS);
dialog = g_new (DocInfoDialog, 1);
data_dir = pluma_plugin_get_data_dir (data->plugin);
data_dir = xedit_plugin_get_data_dir (data->plugin);
ui_file = g_build_filename (data_dir, "docinfo.ui", NULL);
ret = pluma_utils_get_ui_objects (ui_file,
ret = xedit_utils_get_ui_objects (ui_file,
NULL,
&error_widget,
"dialog", &dialog->dialog,
@@ -128,7 +128,7 @@ get_docinfo_dialog (PlumaWindow *window,
const gchar *err_message;
err_message = gtk_label_get_label (GTK_LABEL (error_widget));
pluma_warning (GTK_WINDOW (window), "%s", err_message);
xedit_warning (GTK_WINDOW (window), "%s", err_message);
g_free (dialog);
gtk_widget_destroy (error_widget);
@@ -155,7 +155,7 @@ get_docinfo_dialog (PlumaWindow *window,
}
static void
calculate_info (PlumaDocument *doc,
calculate_info (XeditDocument *doc,
GtkTextIter *start,
GtkTextIter *end,
gint *chars,
@@ -165,7 +165,7 @@ calculate_info (PlumaDocument *doc,
{
gchar *text;
pluma_debug (DEBUG_PLUGINS);
xedit_debug (DEBUG_PLUGINS);
text = gtk_text_buffer_get_slice (GTK_TEXT_BUFFER (doc),
start,
@@ -210,7 +210,7 @@ calculate_info (PlumaDocument *doc,
}
static void
docinfo_real (PlumaDocument *doc,
docinfo_real (XeditDocument *doc,
DocInfoDialog *dialog)
{
GtkTextIter start, end;
@@ -222,7 +222,7 @@ docinfo_real (PlumaDocument *doc,
gchar *tmp_str;
gchar *doc_name;
pluma_debug (DEBUG_PLUGINS);
xedit_debug (DEBUG_PLUGINS);
gtk_text_buffer_get_bounds (GTK_TEXT_BUFFER (doc),
&start,
@@ -237,13 +237,13 @@ docinfo_real (PlumaDocument *doc,
if (chars == 0)
lines = 0;
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);
xedit_debug_message (DEBUG_PLUGINS, "Chars: %d", chars);
xedit_debug_message (DEBUG_PLUGINS, "Lines: %d", lines);
xedit_debug_message (DEBUG_PLUGINS, "Words: %d", words);
xedit_debug_message (DEBUG_PLUGINS, "Chars non-space: %d", chars - white_chars);
xedit_debug_message (DEBUG_PLUGINS, "Bytes: %d", bytes);
doc_name = pluma_document_get_short_name_for_display (doc);
doc_name = xedit_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);
@@ -271,7 +271,7 @@ docinfo_real (PlumaDocument *doc,
}
static void
selectioninfo_real (PlumaDocument *doc,
selectioninfo_real (XeditDocument *doc,
DocInfoDialog *dialog)
{
gboolean sel;
@@ -283,7 +283,7 @@ selectioninfo_real (PlumaDocument *doc,
gint bytes = 0;
gchar *tmp_str;
pluma_debug (DEBUG_PLUGINS);
xedit_debug (DEBUG_PLUGINS);
sel = gtk_text_buffer_get_selection_bounds (GTK_TEXT_BUFFER (doc),
&start,
@@ -297,11 +297,11 @@ selectioninfo_real (PlumaDocument *doc,
&start, &end,
&chars, &words, &white_chars, &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);
xedit_debug_message (DEBUG_PLUGINS, "Selected chars: %d", chars);
xedit_debug_message (DEBUG_PLUGINS, "Selected lines: %d", lines);
xedit_debug_message (DEBUG_PLUGINS, "Selected words: %d", words);
xedit_debug_message (DEBUG_PLUGINS, "Selected chars non-space: %d", chars - white_chars);
xedit_debug_message (DEBUG_PLUGINS, "Selected bytes: %d", bytes);
gtk_widget_set_sensitive (dialog->selection_vbox, TRUE);
}
@@ -309,7 +309,7 @@ selectioninfo_real (PlumaDocument *doc,
{
gtk_widget_set_sensitive (dialog->selection_vbox, FALSE);
pluma_debug_message (DEBUG_PLUGINS, "Selection empty");
xedit_debug_message (DEBUG_PLUGINS, "Selection empty");
}
if (chars == 0)
@@ -338,17 +338,17 @@ selectioninfo_real (PlumaDocument *doc,
static void
docinfo_cb (GtkAction *action,
PlumaWindow *window)
XeditWindow *window)
{
PlumaDocument *doc;
XeditDocument *doc;
WindowData *data;
pluma_debug (DEBUG_PLUGINS);
xedit_debug (DEBUG_PLUGINS);
data = (WindowData *) g_object_get_data (G_OBJECT (window),
WINDOW_DATA_KEY);
doc = pluma_window_get_active_document (window);
doc = xedit_window_get_active_document (window);
g_return_if_fail (doc != NULL);
if (data->dialog != NULL)
@@ -377,11 +377,11 @@ docinfo_cb (GtkAction *action,
static void
docinfo_dialog_response_cb (GtkDialog *widget,
gint res_id,
PlumaWindow *window)
XeditWindow *window)
{
WindowData *data;
pluma_debug (DEBUG_PLUGINS);
xedit_debug (DEBUG_PLUGINS);
data = (WindowData *) g_object_get_data (G_OBJECT (window),
WINDOW_DATA_KEY);
@@ -390,7 +390,7 @@ docinfo_dialog_response_cb (GtkDialog *widget,
{
case GTK_RESPONSE_CLOSE:
{
pluma_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_CLOSE");
xedit_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_CLOSE");
gtk_widget_destroy (data->dialog->dialog);
break;
@@ -398,11 +398,11 @@ docinfo_dialog_response_cb (GtkDialog *widget,
case GTK_RESPONSE_OK:
{
PlumaDocument *doc;
XeditDocument *doc;
pluma_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_OK");
xedit_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_OK");
doc = pluma_window_get_active_document (window);
doc = xedit_window_get_active_document (window);
g_return_if_fail (doc != NULL);
docinfo_real (doc,
@@ -431,7 +431,7 @@ free_window_data (WindowData *data)
{
g_return_if_fail (data != NULL);
pluma_debug (DEBUG_PLUGINS);
xedit_debug (DEBUG_PLUGINS);
g_object_unref (data->plugin);
@@ -446,14 +446,14 @@ free_window_data (WindowData *data)
}
static void
update_ui_real (PlumaWindow *window,
update_ui_real (XeditWindow *window,
WindowData *data)
{
PlumaView *view;
XeditView *view;
pluma_debug (DEBUG_PLUGINS);
xedit_debug (DEBUG_PLUGINS);
view = pluma_window_get_active_view (window);
view = xedit_window_get_active_view (window);
gtk_action_group_set_sensitive (data->ui_action_group,
(view != NULL));
@@ -467,33 +467,33 @@ update_ui_real (PlumaWindow *window,
}
static void
pluma_docinfo_plugin_init (PlumaDocInfoPlugin *plugin)
xedit_docinfo_plugin_init (XeditDocInfoPlugin *plugin)
{
pluma_debug_message (DEBUG_PLUGINS, "PlumaDocInfoPlugin initializing");
xedit_debug_message (DEBUG_PLUGINS, "XeditDocInfoPlugin initializing");
}
static void
pluma_docinfo_plugin_finalize (GObject *object)
xedit_docinfo_plugin_finalize (GObject *object)
{
pluma_debug_message (DEBUG_PLUGINS, "PlumaDocInfoPlugin finalizing");
xedit_debug_message (DEBUG_PLUGINS, "XeditDocInfoPlugin finalizing");
G_OBJECT_CLASS (pluma_docinfo_plugin_parent_class)->finalize (object);
G_OBJECT_CLASS (xedit_docinfo_plugin_parent_class)->finalize (object);
}
static void
impl_activate (PlumaPlugin *plugin,
PlumaWindow *window)
impl_activate (XeditPlugin *plugin,
XeditWindow *window)
{
GtkUIManager *manager;
WindowData *data;
pluma_debug (DEBUG_PLUGINS);
xedit_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 ("PlumaDocInfoPluginActions");
data->ui_action_group = gtk_action_group_new ("XeditDocInfoPluginActions");
gtk_action_group_set_translation_domain (data->ui_action_group,
GETTEXT_PACKAGE);
@@ -502,7 +502,7 @@ impl_activate (PlumaPlugin *plugin,
G_N_ELEMENTS (action_entries),
window);
manager = pluma_window_get_ui_manager (window);
manager = xedit_window_get_ui_manager (window);
gtk_ui_manager_insert_action_group (manager,
data->ui_action_group,
-1);
@@ -527,15 +527,15 @@ impl_activate (PlumaPlugin *plugin,
}
static void
impl_deactivate (PlumaPlugin *plugin,
PlumaWindow *window)
impl_deactivate (XeditPlugin *plugin,
XeditWindow *window)
{
GtkUIManager *manager;
WindowData *data;
pluma_debug (DEBUG_PLUGINS);
xedit_debug (DEBUG_PLUGINS);
manager = pluma_window_get_ui_manager (window);
manager = xedit_window_get_ui_manager (window);
data = (WindowData *) g_object_get_data (G_OBJECT (window),
WINDOW_DATA_KEY);
@@ -552,12 +552,12 @@ impl_deactivate (PlumaPlugin *plugin,
}
static void
impl_update_ui (PlumaPlugin *plugin,
PlumaWindow *window)
impl_update_ui (XeditPlugin *plugin,
XeditWindow *window)
{
WindowData *data;
pluma_debug (DEBUG_PLUGINS);
xedit_debug (DEBUG_PLUGINS);
data = (WindowData *) g_object_get_data (G_OBJECT (window),
WINDOW_DATA_KEY);
@@ -568,12 +568,12 @@ impl_update_ui (PlumaPlugin *plugin,
}
static void
pluma_docinfo_plugin_class_init (PlumaDocInfoPluginClass *klass)
xedit_docinfo_plugin_class_init (XeditDocInfoPluginClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
PlumaPluginClass *plugin_class = PLUMA_PLUGIN_CLASS (klass);
XeditPluginClass *plugin_class = XEDIT_PLUGIN_CLASS (klass);
object_class->finalize = pluma_docinfo_plugin_finalize;
object_class->finalize = xedit_docinfo_plugin_finalize;
plugin_class->activate = impl_activate;
plugin_class->deactivate = impl_deactivate;

View File

@@ -0,0 +1,75 @@
/*
* xedit-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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $Id$
*/
#ifndef __XEDIT_DOCINFO_PLUGIN_H__
#define __XEDIT_DOCINFO_PLUGIN_H__
#include <glib.h>
#include <glib-object.h>
#include <xedit/xedit-plugin.h>
G_BEGIN_DECLS
/*
* Type checking and casting macros
*/
#define XEDIT_TYPE_DOCINFO_PLUGIN (xedit_docinfo_plugin_get_type ())
#define XEDIT_DOCINFO_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XEDIT_TYPE_DOCINFO_PLUGIN, XeditDocInfoPlugin))
#define XEDIT_DOCINFO_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XEDIT_TYPE_DOCINFO_PLUGIN, XeditDocInfoPluginClass))
#define XEDIT_IS_DOCINFO_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XEDIT_TYPE_DOCINFO_PLUGIN))
#define XEDIT_IS_DOCINFO_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XEDIT_TYPE_DOCINFO_PLUGIN))
#define XEDIT_DOCINFO_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XEDIT_TYPE_DOCINFO_PLUGIN, XeditDocInfoPluginClass))
/* Private structure type */
typedef struct _XeditDocInfoPluginPrivate XeditDocInfoPluginPrivate;
/*
* Main object structure
*/
typedef struct _XeditDocInfoPlugin XeditDocInfoPlugin;
struct _XeditDocInfoPlugin
{
XeditPlugin parent_instance;
};
/*
* Class definition
*/
typedef struct _XeditDocInfoPluginClass XeditDocInfoPluginClass;
struct _XeditDocInfoPluginClass
{
XeditPluginClass parent_class;
};
/*
* Public methods
*/
GType xedit_docinfo_plugin_get_type (void) G_GNUC_CONST;
/* All the plugins must implement this function */
G_MODULE_EXPORT GType register_xedit_plugin (GTypeModule *module);
G_END_DECLS
#endif /* __XEDIT_DOCINFO_PLUGIN_H__ */

View File

@@ -1,11 +1,11 @@
# External Tools plugin
SUBDIRS = tools data scripts
plugindir = $(PLUMA_PLUGINS_LIBS_DIR)
plugindir = $(XEDIT_PLUGINS_LIBS_DIR)
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_in_files = externaltools.xedit-plugin.desktop.in
%.xedit-plugin: %.xedit-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:.pluma-plugin.desktop.in=.pluma-plugin)
plugin_DATA = $(plugin_in_files:.xedit-plugin.desktop.in=.xedit-plugin)
EXTRA_DIST = $(plugin_in_files)

View File

@@ -1,4 +1,4 @@
TOOL_MERGE=$(top_srcdir)/plugins/externaltools/scripts/pluma-tool-merge.pl
TOOL_MERGE=$(top_srcdir)/plugins/externaltools/scripts/xedit-tool-merge.pl
tools_in_files = \
build.tool.in \
@@ -14,7 +14,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 = $(PLUMA_PLUGINS_DATA_DIR)/externaltools/tools
toolsdir = $(XEDIT_PLUGINS_DATA_DIR)/externaltools/tools
all_tools_in_files = \
$(tools_in_files)

View File

@@ -1,4 +1,4 @@
[Pluma Tool]
[Xedit Tool]
_Name=Build
_Comment=Run "make" in the document directory
Input=nothing

View File

@@ -1,7 +1,7 @@
#!/bin/sh
EHOME=`echo $HOME | sed "s/#/\#/"`
DIR=$PLUMA_CURRENT_DOCUMENT_DIR
DIR=$XEDIT_CURRENT_DOCUMENT_DIR
while test "$DIR" != "/"; do
for m in GNUmakefile makefile Makefile; do
if [ -f "${DIR}/${m}" ]; then

View File

@@ -1,4 +1,4 @@
[Pluma Tool]
[Xedit Tool]
_Name=Open terminal here
_Comment=Open a terminal in the document location
Input=nothing

View File

@@ -1,4 +1,4 @@
#!/bin/sh
#TODO: use "mateconftool-2 -g /desktop/mate/applications/terminal/exec"
mate-terminal --working-directory=$PLUMA_CURRENT_DOCUMENT_DIR &
mate-terminal --working-directory=$XEDIT_CURRENT_DOCUMENT_DIR &

View File

@@ -1,4 +1,4 @@
[Pluma Tool]
[Xedit Tool]
_Name=Remove trailing spaces
_Comment=Remove useless trailing spaces in your file
Input=document

View File

@@ -1,4 +1,4 @@
[Pluma Tool]
[Xedit Tool]
_Name=Run command
_Comment=Execute a custom command and put its output in a new document
Input=nothing

View File

@@ -1,4 +1,4 @@
#!/bin/sh
#TODO: use "gsettings get org.mate.applications-terminal exec"
exec `zenity --entry --title="Run command - Pluma" --text="Command to run"`
exec `zenity --entry --title="Run command - Xedit" --text="Command to run"`

View File

@@ -1,4 +1,4 @@
[Pluma Tool]
[Xedit Tool]
_Name=Search
Shortcut=<Primary><Shift>f
Languages=

View File

@@ -1,4 +1,4 @@
[Pluma Tool]
[Xedit Tool]
_Name=Switch onto a file .c and .h
Shortcut=<Shift><Alt>s
Applicability=all

View File

@@ -17,9 +17,9 @@
import os
name = os.environ["PLUMA_CURRENT_DOCUMENT_NAME"]
name = os.environ["XEDIT_CURRENT_DOCUMENT_NAME"]
if name.endswith('.c'):
os.system("pluma %s.h" % ".".join(name.split('.')[:-1]))
os.system("xedit %s.h" % ".".join(name.split('.')[:-1]))
if name.endswith('.h'):
os.system("pluma %s.c" % ".".join(name.split('.')[:-1]))
os.system("xedit %s.c" % ".".join(name.split('.')[:-1]))

View File

@@ -1,4 +1,4 @@
[Pluma Plugin]
[Xedit Plugin]
Loader=python
Module=externaltools
IAge=2

View File

@@ -1,4 +1,4 @@
EXTRA_DIST = pluma-tool-merge.pl
EXTRA_DIST = xedit-tool-merge.pl
-include $(top_srcdir)/git.mk

View File

@@ -1,22 +1,22 @@
#!/usr/bin/perl
# pluma-tool-merge.pl
# This file is part of pluma
# xedit-tool-merge.pl
# This file is part of xedit
#
# Copyright (C) 2006 - Steve Frécinaux <code@istique.net>
#
# pluma is free software; you can redistribute it and/or modify
# xedit 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.
#
# pluma is distributed in the hope that it will be useful,
# xedit 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 pluma; if not, write to the Free Software
# along with xedit; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA

View File

@@ -1,6 +1,6 @@
# Python snippets plugin
plugindir = $(PLUMA_PLUGINS_LIBS_DIR)/externaltools
plugindir = $(XEDIT_PLUGINS_LIBS_DIR)/externaltools
plugin_PYTHON = \
__init__.py \
capture.py \
@@ -11,7 +11,7 @@ plugin_PYTHON = \
filelookup.py \
linkparsing.py
uidir = $(PLUMA_PLUGINS_DATA_DIR)/externaltools/ui
uidir = $(XEDIT_PLUGINS_DATA_DIR)/externaltools/ui
ui_DATA = tools.ui \
outputpanel.ui

View File

@@ -1,5 +1,5 @@
# -*- coding: UTF-8 -*-
# Pluma External Tools plugin
# Xedit External Tools plugin
# Copyright (C) 2005-2006 Steve Frécinaux <steve@istique.net>
#
# This program is free software; you can redistribute it and/or modify
@@ -19,7 +19,7 @@
__all__ = ('ExternalToolsPlugin', 'ExternalToolsWindowHelper',
'Manager', 'OutputPanel', 'Capture', 'UniqueById')
import pluma
import xedit
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('pluma')
self._action_group.set_translation_domain('xedit')
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(pluma.Plugin):
class ExternalToolsPlugin(xedit.Plugin):
WINDOW_DATA_KEY = "ExternalToolsPluginWindowData"
def __init__(self):
@@ -263,7 +263,7 @@ class ExternalToolsPlugin(pluma.Plugin):
self._manager.dialog.connect('destroy', self.on_manager_destroy)
window = pluma.app_get_default().get_active_window()
window = xedit.app_get_default().get_active_window()
self._manager.run(window)
return self._manager.dialog

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Pluma External Tools plugin
# Xedit External Tools plugin
# Copyright (C) 2005-2006 Steve Frécinaux <steve@istique.net>
#
# This program is free software; you can redistribute it and/or modify

View File

@@ -18,7 +18,7 @@
import os
import gio
import pluma
import xedit
class FileLookup:
"""
@@ -110,7 +110,7 @@ class OpenDocumentRelPathFileLookupProvider(FileLookupProvider):
if path.startswith('/'):
return None
for doc in pluma.app_get_default().get_documents():
for doc in xedit.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 pluma.app_get_default().get_documents():
for doc in xedit.app_get_default().get_documents():
if doc.is_local():
location = doc.get_location()
if location and location.get_uri().endswith(path):

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Pluma External Tools plugin
# Xedit External Tools plugin
# Copyright (C) 2005-2006 Steve Frécinaux <steve@istique.net>
#
# 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 pluma
import xedit
#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(PLUMA_CWD = cwd)
capture.set_env(XEDIT_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(PLUMA_CURRENT_LINE_NUMBER=str(piter.get_line() + 1))
capture.set_env(XEDIT_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(PLUMA_CURRENT_LINE=piter.get_text(end))
capture.set_env(XEDIT_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(PLUMA_SELECTED_TEXT=bounds[0].get_text(bounds[1]))
capture.set_env(XEDIT_SELECTED_TEXT=bounds[0].get_text(bounds[1]))
bounds = current_word(document)
capture.set_env(PLUMA_CURRENT_WORD=bounds[0].get_text(bounds[1]))
capture.set_env(XEDIT_CURRENT_WORD=bounds[0].get_text(bounds[1]))
capture.set_env(PLUMA_CURRENT_DOCUMENT_TYPE=document.get_mime_type())
capture.set_env(XEDIT_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(PLUMA_CURRENT_DOCUMENT_URI = uri,
PLUMA_CURRENT_DOCUMENT_NAME = name,
PLUMA_CURRENT_DOCUMENT_SCHEME = scheme)
if pluma.utils.uri_has_file_scheme(uri):
capture.set_env(XEDIT_CURRENT_DOCUMENT_URI = uri,
XEDIT_CURRENT_DOCUMENT_NAME = name,
XEDIT_CURRENT_DOCUMENT_SCHEME = scheme)
if xedit.utils.uri_has_file_scheme(uri):
path = gfile.get_path()
cwd = os.path.dirname(path)
capture.set_cwd(cwd)
capture.set_env(PLUMA_CURRENT_DOCUMENT_PATH = path,
PLUMA_CURRENT_DOCUMENT_DIR = cwd)
capture.set_env(XEDIT_CURRENT_DOCUMENT_PATH = path,
XEDIT_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 pluma.utils.uri_has_file_scheme(uri)]
capture.set_env(PLUMA_DOCUMENTS_URI = ' '.join(documents_uri),
PLUMA_DOCUMENTS_PATH = ' '.join(documents_path))
if xedit.utils.uri_has_file_scheme(uri)]
capture.set_env(XEDIT_DOCUMENTS_URI = ' '.join(documents_uri),
XEDIT_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)
pluma.commands.save_document(window, doc)
xedit.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 = pluma.get_language_manager()
lmanager = xedit.get_language_manager()
language = lmanager.guess_language(doc.get_uri(), mtype)

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Pluma External Tools plugin
# Xedit External Tools plugin
# Copyright (C) 2006 Steve Frécinaux <code@istique.net>
#
# 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, 'pluma', 'plugins', 'externaltools', 'tools'))
self.locations.append(os.path.join(d, 'xedit', '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('~/pluma/tools')
toolsdir = os.path.expanduser('~/xedit/tools')
else:
userdir = os.getenv('MATE22_USER_DIR')
if userdir:
toolsdir = os.path.join(userdir, 'pluma/tools')
toolsdir = os.path.join(userdir, 'xedit/tools')
else:
toolsdir = os.path.expanduser('~/.config/pluma/tools')
toolsdir = os.path.expanduser('~/.config/xedit/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, 'pluma/pluma-tools.xml')
filename = os.path.join(userdir, 'xedit/xedit-tools.xml')
else:
filename = os.path.expanduser('~/.config/pluma/pluma-tools.xml')
filename = os.path.expanduser('~/.config/xedit/xedit-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('# [Pluma Tool]')
in_block = line.startswith('# [Xedit 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('# [Pluma Tool]'):
if line.startswith('# [Xedit Tool]'):
break
lines.append(line)
# in the block:
@@ -407,7 +407,7 @@ class Tool(object):
return lines
def _dump_properties(self):
lines = ['# [Pluma Tool]']
lines = ['# [Xedit 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])))

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Pluma External Tools plugin
# Xedit External Tools plugin
# Copyright (C) 2005-2006 Steve Frécinaux <steve@istique.net>
#
# This program is free software; you can redistribute it and/or modify
@@ -18,7 +18,7 @@
__all__ = ('Manager', )
import pluma
import xedit
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 = pluma.language_manager_list_languages_sorted(manager, True)
langs = xedit.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 = pluma.get_language_manager()
lmanager = xedit.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:
pluma.help_display(self.dialog, 'pluma', 'pluma-external-tools-plugin')
xedit.help_display(self.dialog, 'xedit', 'xedit-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 pluma.app_get_default().get_windows():
for window in xedit.app_get_default().get_windows():
helper = window.get_data("ExternalToolsPluginWindowData")
helper.menu.update()

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Pluma External Tools plugin
# Xedit External Tools plugin
# Copyright (C) 2005-2006 Steve Frécinaux <steve@istique.net>
# Copyright (C) 2010 Per Arneng <per.arneng@anyplanet.com>
#
@@ -19,7 +19,7 @@
__all__ = ('OutputPanel', 'UniqueById')
import gtk, pluma
import gtk, xedit
import pango
import gobject
import os
@@ -217,7 +217,7 @@ class OutputPanel(UniqueById):
gfile = self.file_lookup.lookup(link.path)
if gfile:
pluma.commands.load_uri(self.window, gfile.get_uri(), None,
xedit.commands.load_uri(self.window, gfile.get_uri(), None,
link.line_nr)
gobject.idle_add(self.idle_grab_focus)

View File

@@ -122,7 +122,7 @@
</row>
</data>
</object>
<object class="PlumaDocument" id="commands_buffer">
<object class="XeditDocument" id="commands_buffer">
<property name="highlight-matching-brackets">True</property>
</object>
<object class="GtkDialog" id="tool-manager-dialog">
@@ -516,7 +516,7 @@
<property name="vscrollbar_policy">automatic</property>
<property name="shadow_type">in</property>
<child>
<object class="PlumaView" id="commands">
<object class="XeditView" id="commands">
<property name="buffer">commands_buffer</property>
<property name="visible">True</property>
<property name="auto-indent">True</property>

View File

@@ -1,72 +1,72 @@
# filebrowser
plugindir = $(PLUMA_PLUGINS_LIBS_DIR)
plugindir = $(XEDIT_PLUGINS_LIBS_DIR)
AM_CPPFLAGS = \
-I$(top_srcdir) \
$(PLUMA_CFLAGS) \
$(XEDIT_CFLAGS) \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS)
BUILT_SOURCES = \
pluma-file-browser-enum-types.h \
pluma-file-browser-enum-types.c \
pluma-file-browser-marshal.h \
pluma-file-browser-marshal.c
xedit-file-browser-enum-types.h \
xedit-file-browser-enum-types.c \
xedit-file-browser-marshal.h \
xedit-file-browser-marshal.c
plugin_LTLIBRARIES = libfilebrowser.la
NOINST_H_FILES = \
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
xedit-file-bookmarks-store.h \
xedit-file-browser-store.h \
xedit-file-browser-view.h \
xedit-file-browser-widget.h \
xedit-file-browser-error.h \
xedit-file-browser-utils.h \
xedit-file-browser-plugin.h \
xedit-file-browser-messages.h
libfilebrowser_la_SOURCES = \
$(BUILT_SOURCES) \
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 \
xedit-file-bookmarks-store.c \
xedit-file-browser-store.c \
xedit-file-browser-view.c \
xedit-file-browser-widget.c \
xedit-file-browser-utils.c \
xedit-file-browser-plugin.c \
xedit-file-browser-messages.c \
$(NOINST_H_FILES)
libfilebrowser_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
libfilebrowser_la_LIBADD = $(PLUMA_LIBS)
libfilebrowser_la_LIBADD = $(XEDIT_LIBS)
# UI files (if you use ui for your plugin, list those files here)
uidir = $(PLUMA_PLUGINS_DATA_DIR)/filebrowser
ui_DATA = pluma-file-browser-widget-ui.xml
uidir = $(XEDIT_PLUGINS_DATA_DIR)/filebrowser
ui_DATA = xedit-file-browser-widget-ui.xml
plugin_in_files = filebrowser.pluma-plugin.desktop.in
plugin_in_files = filebrowser.xedit-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
%.xedit-plugin: %.xedit-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-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)) > $@
xedit-file-browser-enum-types.h: xedit-file-browser-enum-types.h.template $(NOINST_H_FILES) $(GLIB_MKENUMS)
(cd $(srcdir) && $(GLIB_MKENUMS) --template xedit-file-browser-enum-types.h.template $(NOINST_H_FILES)) > $@
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)
xedit-file-browser-enum-types.c: xedit-file-browser-enum-types.c.template xedit-file-browser-enum-register.c.template $(NOINST_H_FILES) $(GLIB_MKENUMS)
$(AM_V_GEN) (cd $(srcdir) && \
$(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)) > $@
$(GLIB_MKENUMS) --template xedit-file-browser-enum-types.c.template $(NOINST_H_FILES) && \
$(GLIB_MKENUMS) --template xedit-file-browser-enum-register.c.template $(NOINST_H_FILES)) > $@
pluma-file-browser-marshal.h: pluma-file-browser-marshal.list $(GLIB_GENMARSHAL)
$(AM_V_GEN) $(GLIB_GENMARSHAL) $< --header --prefix=pluma_file_browser_marshal > $@
xedit-file-browser-marshal.h: xedit-file-browser-marshal.list $(GLIB_GENMARSHAL)
$(AM_V_GEN) $(GLIB_GENMARSHAL) $< --header --prefix=xedit_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 >> $@
xedit-file-browser-marshal.c: xedit-file-browser-marshal.list $(GLIB_GENMARSHAL)
$(AM_V_GEN) echo "#include \"xedit-file-browser-marshal.h\"" > $@ && \
$(GLIB_GENMARSHAL) $< --body --prefix=xedit_file_browser_marshal >> $@
plugin_DATA = $(plugin_in_files:.pluma-plugin.desktop.in=.pluma-plugin)
plugin_DATA = $(plugin_in_files:.xedit-plugin.desktop.in=.xedit-plugin)
@INTLTOOL_XML_NOMERGE_RULE@
filebrowser_gschema_in = org.mate.pluma.plugins.filebrowser.gschema.xml.in
filebrowser_gschema_in = org.x.editor.plugins.filebrowser.gschema.xml.in
gsettings_SCHEMAS = $(filebrowser_gschema_in:.xml.in=.xml)
@GSETTINGS_RULES@
@@ -74,10 +74,10 @@ EXTRA_DIST = \
$(ui_DATA) \
$(plugin_in_files) \
$(filebrowser_gschema_in) \
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
xedit-file-browser-enum-types.h.template \
xedit-file-browser-enum-types.c.template \
xedit-file-browser-enum-register.c.template \
xedit-file-browser-marshal.list
CLEANFILES = \
$(plugin_DATA) \

View File

@@ -1,4 +1,4 @@
[Pluma Plugin]
[Xedit Plugin]
Loader=C
Module=filebrowser
IAge=2

View File

@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<schemalist>
<schema id="org.mate.pluma.plugins.filebrowser" path="/org/mate/pluma/plugins/filebrowser/">
<schema id="org.x.editor.plugins.filebrowser" path="/org.x.editor/plugins/filebrowser/">
<key name="open-at-first-doc" type="b">
<default>true</default>
<summary>Set Location to First Document</summary>
@@ -16,9 +16,9 @@
<summary>File Browser Filter Pattern</summary>
<description>The filter pattern to filter the file browser with. This filter works on top of the filter_mode.</description>
</key>
<child name="on-load" schema="org.mate.pluma.plugins.filebrowser.on-load"/>
<child name="on-load" schema="org.x.editor.plugins.filebrowser.on-load"/>
</schema>
<schema id="org.mate.pluma.plugins.filebrowser.on-load" path="/org/mate/pluma/plugins/filebrowser/on-load/">
<schema id="org.x.editor.plugins.filebrowser.on-load" path="/org.x.editor/plugins/filebrowser/on-load/">
<key name="tree-view" type="b">
<default>true</default>
<summary>Open With Tree View</summary>

View File

@@ -1,90 +0,0 @@
/*
* pluma-file-bookmarks-store.h - Pluma plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, 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:

View File

@@ -1,71 +0,0 @@
/*
* pluma-file-browser-plugin.h - Pluma plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, 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:

View File

@@ -1,200 +0,0 @@
/*
* pluma-file-browser-store.h - Pluma plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, 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:

View File

@@ -1,84 +0,0 @@
/*
* pluma-file-browser-view.h - Pluma plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, 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:

View File

@@ -1,129 +0,0 @@
/*
* pluma-file-browser-widget.h - Pluma plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, 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
{
#if GTK_CHECK_VERSION (3, 0, 0)
GtkBox parent;
#else
GtkVBox parent;
#endif
PlumaFileBrowserWidgetPrivate *priv;
};
struct _PlumaFileBrowserWidgetClass
{
#if GTK_CHECK_VERSION (3, 0, 0)
GtkBoxClass parent_class;
#else
GtkVBoxClass parent_class;
#endif
/* 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:

View File

@@ -1,5 +1,5 @@
/*
* pluma-file-bookmarks-store.c - Pluma plugin providing easy file access
* xedit-file-bookmarks-store.c - Xedit plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
@@ -22,17 +22,17 @@
#include <string.h>
#include <glib/gi18n.h>
#include <gio/gio.h>
#include <pluma/pluma-utils.h>
#include <pluma/pluma-plugin.h>
#include <xedit/xedit-utils.h>
#include <xedit/xedit-plugin.h>
#include "pluma-file-bookmarks-store.h"
#include "pluma-file-browser-utils.h"
#include "xedit-file-bookmarks-store.h"
#include "xedit-file-browser-utils.h"
#define PLUMA_FILE_BOOKMARKS_STORE_GET_PRIVATE(object)( \
G_TYPE_INSTANCE_GET_PRIVATE((object), PLUMA_TYPE_FILE_BOOKMARKS_STORE, \
PlumaFileBookmarksStorePrivate))
#define XEDIT_FILE_BOOKMARKS_STORE_GET_PRIVATE(object)( \
G_TYPE_INSTANCE_GET_PRIVATE((object), XEDIT_TYPE_FILE_BOOKMARKS_STORE, \
XeditFileBookmarksStorePrivate))
struct _PlumaFileBookmarksStorePrivate
struct _XeditFileBookmarksStorePrivate
{
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,
PlumaFileBookmarksStore *model);
XeditFileBookmarksStore *model);
static void on_bookmarks_file_changed (GFileMonitor * monitor,
GFile * file,
GFile * other_file,
GFileMonitorEvent event_type,
PlumaFileBookmarksStore * model);
XeditFileBookmarksStore * model);
static gboolean find_with_flags (GtkTreeModel * model,
GtkTreeIter * iter,
gpointer obj,
guint flags,
guint notflags);
PLUMA_PLUGIN_DEFINE_TYPE(PlumaFileBookmarksStore, pluma_file_bookmarks_store, GTK_TYPE_TREE_STORE)
XEDIT_PLUGIN_DEFINE_TYPE(XeditFileBookmarksStore, xedit_file_bookmarks_store, GTK_TYPE_TREE_STORE)
static void
pluma_file_bookmarks_store_dispose (GObject * object)
xedit_file_bookmarks_store_dispose (GObject * object)
{
PlumaFileBookmarksStore *obj = PLUMA_FILE_BOOKMARKS_STORE (object);
XeditFileBookmarksStore *obj = XEDIT_FILE_BOOKMARKS_STORE (object);
if (obj->priv->volume_monitor != NULL) {
g_signal_handlers_disconnect_by_func (obj->priv->volume_monitor,
@@ -77,35 +77,35 @@ pluma_file_bookmarks_store_dispose (GObject * object)
obj->priv->bookmarks_monitor = NULL;
}
G_OBJECT_CLASS (pluma_file_bookmarks_store_parent_class)->dispose (object);
G_OBJECT_CLASS (xedit_file_bookmarks_store_parent_class)->dispose (object);
}
static void
pluma_file_bookmarks_store_finalize (GObject * object)
xedit_file_bookmarks_store_finalize (GObject * object)
{
G_OBJECT_CLASS (pluma_file_bookmarks_store_parent_class)->finalize (object);
G_OBJECT_CLASS (xedit_file_bookmarks_store_parent_class)->finalize (object);
}
static void
pluma_file_bookmarks_store_class_init (PlumaFileBookmarksStoreClass *klass)
xedit_file_bookmarks_store_class_init (XeditFileBookmarksStoreClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->dispose = pluma_file_bookmarks_store_dispose;
object_class->finalize = pluma_file_bookmarks_store_finalize;
object_class->dispose = xedit_file_bookmarks_store_dispose;
object_class->finalize = xedit_file_bookmarks_store_finalize;
g_type_class_add_private (object_class, sizeof (PlumaFileBookmarksStorePrivate));
g_type_class_add_private (object_class, sizeof (XeditFileBookmarksStorePrivate));
}
static void
pluma_file_bookmarks_store_init (PlumaFileBookmarksStore * obj)
xedit_file_bookmarks_store_init (XeditFileBookmarksStore * obj)
{
obj->priv = PLUMA_FILE_BOOKMARKS_STORE_GET_PRIVATE (obj);
obj->priv = XEDIT_FILE_BOOKMARKS_STORE_GET_PRIVATE (obj);
}
/* Private */
static void
add_node (PlumaFileBookmarksStore *model,
add_node (XeditFileBookmarksStore *model,
GdkPixbuf *pixbuf,
const gchar *name,
GObject *obj,
@@ -117,10 +117,10 @@ add_node (PlumaFileBookmarksStore *model,
gtk_tree_store_append (GTK_TREE_STORE (model), &newiter, NULL);
gtk_tree_store_set (GTK_TREE_STORE (model), &newiter,
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,
XEDIT_FILE_BOOKMARKS_STORE_COLUMN_ICON, pixbuf,
XEDIT_FILE_BOOKMARKS_STORE_COLUMN_NAME, name,
XEDIT_FILE_BOOKMARKS_STORE_COLUMN_OBJECT, obj,
XEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, flags,
-1);
if (iter != NULL)
@@ -128,7 +128,7 @@ add_node (PlumaFileBookmarksStore *model,
}
static gboolean
add_file (PlumaFileBookmarksStore *model,
add_file (XeditFileBookmarksStore *model,
GFile *file,
const gchar *name,
guint flags,
@@ -144,24 +144,24 @@ add_file (PlumaFileBookmarksStore *model,
return FALSE;
}
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 (flags & XEDIT_FILE_BOOKMARKS_STORE_IS_HOME)
pixbuf = xedit_file_browser_utils_pixbuf_from_theme ("user-home", GTK_ICON_SIZE_MENU);
else if (flags & XEDIT_FILE_BOOKMARKS_STORE_IS_DESKTOP)
pixbuf = xedit_file_browser_utils_pixbuf_from_theme ("user-desktop", GTK_ICON_SIZE_MENU);
else if (flags & XEDIT_FILE_BOOKMARKS_STORE_IS_ROOT)
pixbuf = xedit_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 = pluma_file_browser_utils_pixbuf_from_file (file, GTK_ICON_SIZE_MENU);
pixbuf = xedit_file_browser_utils_pixbuf_from_file (file, GTK_ICON_SIZE_MENU);
} else {
pixbuf = pluma_file_browser_utils_pixbuf_from_theme ("folder", GTK_ICON_SIZE_MENU);
pixbuf = xedit_file_browser_utils_pixbuf_from_theme ("folder", GTK_ICON_SIZE_MENU);
}
}
if (name == NULL) {
newname = pluma_file_browser_utils_file_basename (file);
newname = xedit_file_browser_utils_file_basename (file);
} else {
newname = g_strdup (name);
}
@@ -177,7 +177,7 @@ add_file (PlumaFileBookmarksStore *model,
}
static void
check_mount_separator (PlumaFileBookmarksStore * model, guint flags,
check_mount_separator (XeditFileBookmarksStore * model, guint flags,
gboolean added)
{
GtkTreeIter iter;
@@ -186,12 +186,12 @@ check_mount_separator (PlumaFileBookmarksStore * model, guint flags,
found =
find_with_flags (GTK_TREE_MODEL (model), &iter, NULL,
flags |
PLUMA_FILE_BOOKMARKS_STORE_IS_SEPARATOR, 0);
XEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR, 0);
if (added && !found) {
/* Add the separator */
add_node (model, NULL, NULL, NULL,
flags | PLUMA_FILE_BOOKMARKS_STORE_IS_SEPARATOR,
flags | XEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR,
NULL);
} else if (!added && found) {
remove_node (GTK_TREE_MODEL (model), &iter);
@@ -199,7 +199,7 @@ check_mount_separator (PlumaFileBookmarksStore * model, guint flags,
}
static void
init_special_directories (PlumaFileBookmarksStore * model)
init_special_directories (XeditFileBookmarksStore * model)
{
gchar const *path;
GFile * file;
@@ -208,8 +208,8 @@ init_special_directories (PlumaFileBookmarksStore * model)
if (path != NULL)
{
file = g_file_new_for_path (path);
add_file (model, file, NULL, PLUMA_FILE_BOOKMARKS_STORE_IS_HOME |
PLUMA_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR, NULL);
add_file (model, file, NULL, XEDIT_FILE_BOOKMARKS_STORE_IS_HOME |
XEDIT_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR, NULL);
g_object_unref (file);
}
@@ -217,8 +217,8 @@ init_special_directories (PlumaFileBookmarksStore * model)
if (path != NULL)
{
file = g_file_new_for_path (path);
add_file (model, file, NULL, PLUMA_FILE_BOOKMARKS_STORE_IS_DESKTOP |
PLUMA_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR, NULL);
add_file (model, file, NULL, XEDIT_FILE_BOOKMARKS_STORE_IS_DESKTOP |
XEDIT_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR, NULL);
g_object_unref (file);
}
@@ -226,16 +226,16 @@ init_special_directories (PlumaFileBookmarksStore * model)
if (path != NULL)
{
file = g_file_new_for_path (path);
add_file (model, file, NULL, PLUMA_FILE_BOOKMARKS_STORE_IS_DOCUMENTS |
PLUMA_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR, NULL);
add_file (model, file, NULL, XEDIT_FILE_BOOKMARKS_STORE_IS_DOCUMENTS |
XEDIT_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR, NULL);
g_object_unref (file);
}
file = g_file_new_for_uri ("file:///");
add_file (model, file, _("File System"), PLUMA_FILE_BOOKMARKS_STORE_IS_ROOT, NULL);
add_file (model, file, _("File System"), XEDIT_FILE_BOOKMARKS_STORE_IS_ROOT, NULL);
g_object_unref (file);
check_mount_separator (model, PLUMA_FILE_BOOKMARKS_STORE_IS_ROOT, TRUE);
check_mount_separator (model, XEDIT_FILE_BOOKMARKS_STORE_IS_ROOT, TRUE);
}
static void
@@ -246,7 +246,7 @@ get_fs_properties (gpointer fs,
{
GIcon *icon = NULL;
*flags = PLUMA_FILE_BOOKMARKS_STORE_IS_FS;
*flags = XEDIT_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 |= PLUMA_FILE_BOOKMARKS_STORE_IS_DRIVE;
*flags |= XEDIT_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 |= PLUMA_FILE_BOOKMARKS_STORE_IS_VOLUME;
*flags |= XEDIT_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 |= PLUMA_FILE_BOOKMARKS_STORE_IS_MOUNT;
*flags |= XEDIT_FILE_BOOKMARKS_STORE_IS_MOUNT;
}
if (icon)
{
*pixbuf = pluma_file_browser_utils_pixbuf_from_icon (icon, GTK_ICON_SIZE_MENU);
*pixbuf = xedit_file_browser_utils_pixbuf_from_icon (icon, GTK_ICON_SIZE_MENU);
g_object_unref (icon);
}
}
static void
add_fs (PlumaFileBookmarksStore *model,
add_fs (XeditFileBookmarksStore *model,
gpointer fs,
guint flags,
GtkTreeIter *iter)
@@ -297,15 +297,15 @@ add_fs (PlumaFileBookmarksStore *model,
g_object_unref (pixbuf);
g_free (name);
check_mount_separator (model, PLUMA_FILE_BOOKMARKS_STORE_IS_FS, TRUE);
check_mount_separator (model, XEDIT_FILE_BOOKMARKS_STORE_IS_FS, TRUE);
}
static void
process_volume_cb (GVolume *volume,
PlumaFileBookmarksStore *model)
XeditFileBookmarksStore *model)
{
GMount *mount;
guint flags = PLUMA_FILE_BOOKMARKS_STORE_NONE;
guint flags = XEDIT_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 (PlumaFileBookmarksStore *model,
process_drive_novolumes (XeditFileBookmarksStore *model,
GDrive *drive)
{
if (g_drive_is_media_removable (drive) &&
@@ -335,13 +335,13 @@ process_drive_novolumes (PlumaFileBookmarksStore *model,
drives where media detection fails. We show the
drive and poll for media when the user activates
it */
add_fs (model, drive, PLUMA_FILE_BOOKMARKS_STORE_NONE, NULL);
add_fs (model, drive, XEDIT_FILE_BOOKMARKS_STORE_NONE, NULL);
}
}
static void
process_drive_cb (GDrive *drive,
PlumaFileBookmarksStore *model)
XeditFileBookmarksStore *model)
{
GList *volumes;
@@ -360,7 +360,7 @@ process_drive_cb (GDrive *drive,
}
static void
init_drives (PlumaFileBookmarksStore *model)
init_drives (XeditFileBookmarksStore *model)
{
GList *drives;
@@ -373,7 +373,7 @@ init_drives (PlumaFileBookmarksStore *model)
static void
process_volume_nodrive_cb (GVolume *volume,
PlumaFileBookmarksStore *model)
XeditFileBookmarksStore *model)
{
GDrive *drive;
@@ -389,7 +389,7 @@ process_volume_nodrive_cb (GVolume *volume,
}
static void
init_volumes (PlumaFileBookmarksStore *model)
init_volumes (XeditFileBookmarksStore *model)
{
GList *volumes;
@@ -402,7 +402,7 @@ init_volumes (PlumaFileBookmarksStore *model)
static void
process_mount_novolume_cb (GMount *mount,
PlumaFileBookmarksStore *model)
XeditFileBookmarksStore *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, PLUMA_FILE_BOOKMARKS_STORE_NONE, NULL);
add_fs (model, mount, XEDIT_FILE_BOOKMARKS_STORE_NONE, NULL);
}
}
static void
init_mounts (PlumaFileBookmarksStore *model)
init_mounts (XeditFileBookmarksStore *model)
{
GList *mounts;
@@ -432,7 +432,7 @@ init_mounts (PlumaFileBookmarksStore *model)
}
static void
init_fs (PlumaFileBookmarksStore * model)
init_fs (XeditFileBookmarksStore * model)
{
if (model->priv->volume_monitor == NULL) {
const gchar **ptr;
@@ -465,21 +465,21 @@ init_fs (PlumaFileBookmarksStore * model)
}
static gboolean
add_bookmark (PlumaFileBookmarksStore * model,
add_bookmark (XeditFileBookmarksStore * model,
gchar const * name,
gchar const * uri)
{
GFile * file;
gboolean ret;
guint flags = PLUMA_FILE_BOOKMARKS_STORE_IS_BOOKMARK;
guint flags = XEDIT_FILE_BOOKMARKS_STORE_IS_BOOKMARK;
GtkTreeIter iter;
file = g_file_new_for_uri (uri);
if (g_file_is_native (file)) {
flags |= PLUMA_FILE_BOOKMARKS_STORE_IS_LOCAL_BOOKMARK;
flags |= XEDIT_FILE_BOOKMARKS_STORE_IS_LOCAL_BOOKMARK;
} else {
flags |= PLUMA_FILE_BOOKMARKS_STORE_IS_REMOTE_BOOKMARK;
flags |= XEDIT_FILE_BOOKMARKS_STORE_IS_REMOTE_BOOKMARK;
}
ret = add_file (model, file, name, flags, &iter);
@@ -490,7 +490,7 @@ add_bookmark (PlumaFileBookmarksStore * model,
}
static void
init_bookmarks (PlumaFileBookmarksStore * model)
init_bookmarks (XeditFileBookmarksStore * model)
{
gchar *bookmarks;
GError *error = NULL;
@@ -524,7 +524,7 @@ init_bookmarks (PlumaFileBookmarksStore * model)
/* the bookmarks file should contain valid
* URIs, but paranoia is good */
if (pluma_utils_is_valid_uri (*line)) {
if (xedit_utils_is_valid_uri (*line)) {
added |= add_bookmark (model, name, *line);
}
}
@@ -554,20 +554,20 @@ init_bookmarks (PlumaFileBookmarksStore * model)
if (added) {
/* Bookmarks separator */
add_node (model, NULL, NULL, NULL,
PLUMA_FILE_BOOKMARKS_STORE_IS_BOOKMARK |
PLUMA_FILE_BOOKMARKS_STORE_IS_SEPARATOR, NULL);
XEDIT_FILE_BOOKMARKS_STORE_IS_BOOKMARK |
XEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR, NULL);
}
g_free (bookmarks);
}
static gint flags_order[] = {
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,
XEDIT_FILE_BOOKMARKS_STORE_IS_HOME,
XEDIT_FILE_BOOKMARKS_STORE_IS_DESKTOP,
XEDIT_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR,
XEDIT_FILE_BOOKMARKS_STORE_IS_ROOT,
XEDIT_FILE_BOOKMARKS_STORE_IS_FS,
XEDIT_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,
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_NAME, &n1,
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f1,
XEDIT_FILE_BOOKMARKS_STORE_COLUMN_NAME, &n1,
XEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f1,
-1);
gtk_tree_model_get (model, b,
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_NAME, &n2,
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f2,
XEDIT_FILE_BOOKMARKS_STORE_COLUMN_NAME, &n2,
XEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f2,
-1);
/* do not sort actual bookmarks to keep same order as in caja */
if ((f1 & PLUMA_FILE_BOOKMARKS_STORE_IS_BOOKMARK) &&
(f2 & PLUMA_FILE_BOOKMARKS_STORE_IS_BOOKMARK))
if ((f1 & XEDIT_FILE_BOOKMARKS_STORE_IS_BOOKMARK) &&
(f2 & XEDIT_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 = PLUMA_FILE_BOOKMARKS_STORE_IS_SEPARATOR;
sep = XEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR;
gtk_tree_model_get (model, a,
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f1,
XEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f1,
-1);
gtk_tree_model_get (model, b,
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f2,
XEDIT_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,
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_OBJECT,
XEDIT_FILE_BOOKMARKS_STORE_COLUMN_OBJECT,
&childobj,
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_FLAGS,
XEDIT_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,
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &flags,
XEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &flags,
-1);
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,
if (!(flags & XEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR)) {
if (flags & XEDIT_FILE_BOOKMARKS_STORE_IS_FS) {
check_mount_separator (XEDIT_FILE_BOOKMARKS_STORE (model),
flags & XEDIT_FILE_BOOKMARKS_STORE_IS_FS,
FALSE);
}
}
@@ -733,19 +733,19 @@ remove_node (GtkTreeModel * model, GtkTreeIter * iter)
}
static void
remove_bookmarks (PlumaFileBookmarksStore * model)
remove_bookmarks (XeditFileBookmarksStore * model)
{
GtkTreeIter iter;
while (find_with_flags (GTK_TREE_MODEL (model), &iter, NULL,
PLUMA_FILE_BOOKMARKS_STORE_IS_BOOKMARK,
XEDIT_FILE_BOOKMARKS_STORE_IS_BOOKMARK,
0)) {
remove_node (GTK_TREE_MODEL (model), &iter);
}
}
static void
initialize_fill (PlumaFileBookmarksStore * model)
initialize_fill (XeditFileBookmarksStore * model)
{
init_special_directories (model);
init_fs (model);
@@ -753,10 +753,10 @@ initialize_fill (PlumaFileBookmarksStore * model)
}
/* Public */
PlumaFileBookmarksStore *
pluma_file_bookmarks_store_new (void)
XeditFileBookmarksStore *
xedit_file_bookmarks_store_new (void)
{
PlumaFileBookmarksStore *model;
XeditFileBookmarksStore *model;
GType column_types[] = {
GDK_TYPE_PIXBUF,
G_TYPE_STRING,
@@ -764,9 +764,9 @@ pluma_file_bookmarks_store_new (void)
G_TYPE_UINT
};
model = g_object_new (PLUMA_TYPE_FILE_BOOKMARKS_STORE, NULL);
model = g_object_new (XEDIT_TYPE_FILE_BOOKMARKS_STORE, NULL);
gtk_tree_store_set_column_types (GTK_TREE_STORE (model),
PLUMA_FILE_BOOKMARKS_STORE_N_COLUMNS,
XEDIT_FILE_BOOKMARKS_STORE_N_COLUMNS,
column_types);
gtk_tree_sortable_set_default_sort_func (GTK_TREE_SORTABLE (model),
@@ -782,7 +782,7 @@ pluma_file_bookmarks_store_new (void)
}
gchar *
pluma_file_bookmarks_store_get_uri (PlumaFileBookmarksStore * model,
xedit_file_bookmarks_store_get_uri (XeditFileBookmarksStore * model,
GtkTreeIter * iter)
{
GObject * obj;
@@ -791,22 +791,22 @@ pluma_file_bookmarks_store_get_uri (PlumaFileBookmarksStore * model,
gchar * ret = NULL;
gboolean isfs;
g_return_val_if_fail (PLUMA_IS_FILE_BOOKMARKS_STORE (model), NULL);
g_return_val_if_fail (XEDIT_IS_FILE_BOOKMARKS_STORE (model), NULL);
g_return_val_if_fail (iter != NULL, NULL);
gtk_tree_model_get (GTK_TREE_MODEL (model), iter,
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_FLAGS,
XEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS,
&flags,
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_OBJECT,
XEDIT_FILE_BOOKMARKS_STORE_COLUMN_OBJECT,
&obj,
-1);
if (obj == NULL)
return NULL;
isfs = (flags & PLUMA_FILE_BOOKMARKS_STORE_IS_FS);
isfs = (flags & XEDIT_FILE_BOOKMARKS_STORE_IS_FS);
if (isfs && (flags & PLUMA_FILE_BOOKMARKS_STORE_IS_MOUNT))
if (isfs && (flags & XEDIT_FILE_BOOKMARKS_STORE_IS_MOUNT))
{
file = g_mount_get_root (G_MOUNT (obj));
}
@@ -827,7 +827,7 @@ pluma_file_bookmarks_store_get_uri (PlumaFileBookmarksStore * model,
}
void
pluma_file_bookmarks_store_refresh (PlumaFileBookmarksStore * model)
xedit_file_bookmarks_store_refresh (XeditFileBookmarksStore * model)
{
gtk_tree_store_clear (GTK_TREE_STORE (model));
initialize_fill (model);
@@ -836,11 +836,11 @@ pluma_file_bookmarks_store_refresh (PlumaFileBookmarksStore * model)
static void
on_fs_changed (GVolumeMonitor *monitor,
GObject *object,
PlumaFileBookmarksStore *model)
XeditFileBookmarksStore *model)
{
GtkTreeModel *tree_model = GTK_TREE_MODEL (model);
guint flags = PLUMA_FILE_BOOKMARKS_STORE_IS_FS;
guint noflags = PLUMA_FILE_BOOKMARKS_STORE_IS_SEPARATOR;
guint flags = XEDIT_FILE_BOOKMARKS_STORE_IS_FS;
guint noflags = XEDIT_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,
PlumaFileBookmarksStore * model)
XeditFileBookmarksStore * model)
{
switch (event_type) {
case G_FILE_MONITOR_EVENT_CHANGED:

View File

@@ -0,0 +1,90 @@
/*
* xedit-file-bookmarks-store.h - Xedit plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __XEDIT_FILE_BOOKMARKS_STORE_H__
#define __XEDIT_FILE_BOOKMARKS_STORE_H__
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define XEDIT_TYPE_FILE_BOOKMARKS_STORE (xedit_file_bookmarks_store_get_type ())
#define XEDIT_FILE_BOOKMARKS_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XEDIT_TYPE_FILE_BOOKMARKS_STORE, XeditFileBookmarksStore))
#define XEDIT_FILE_BOOKMARKS_STORE_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XEDIT_TYPE_FILE_BOOKMARKS_STORE, XeditFileBookmarksStore const))
#define XEDIT_FILE_BOOKMARKS_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XEDIT_TYPE_FILE_BOOKMARKS_STORE, XeditFileBookmarksStoreClass))
#define XEDIT_IS_FILE_BOOKMARKS_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XEDIT_TYPE_FILE_BOOKMARKS_STORE))
#define XEDIT_IS_FILE_BOOKMARKS_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XEDIT_TYPE_FILE_BOOKMARKS_STORE))
#define XEDIT_FILE_BOOKMARKS_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XEDIT_TYPE_FILE_BOOKMARKS_STORE, XeditFileBookmarksStoreClass))
typedef struct _XeditFileBookmarksStore XeditFileBookmarksStore;
typedef struct _XeditFileBookmarksStoreClass XeditFileBookmarksStoreClass;
typedef struct _XeditFileBookmarksStorePrivate XeditFileBookmarksStorePrivate;
enum
{
XEDIT_FILE_BOOKMARKS_STORE_COLUMN_ICON = 0,
XEDIT_FILE_BOOKMARKS_STORE_COLUMN_NAME,
XEDIT_FILE_BOOKMARKS_STORE_COLUMN_OBJECT,
XEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS,
XEDIT_FILE_BOOKMARKS_STORE_N_COLUMNS
};
enum
{
XEDIT_FILE_BOOKMARKS_STORE_NONE = 0,
XEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR = 1 << 0, /* Separator item */
XEDIT_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR = 1 << 1, /* Special user dir */
XEDIT_FILE_BOOKMARKS_STORE_IS_HOME = 1 << 2, /* The special Home user directory */
XEDIT_FILE_BOOKMARKS_STORE_IS_DESKTOP = 1 << 3, /* The special Desktop user directory */
XEDIT_FILE_BOOKMARKS_STORE_IS_DOCUMENTS = 1 << 4, /* The special Documents user directory */
XEDIT_FILE_BOOKMARKS_STORE_IS_FS = 1 << 5, /* A mount object */
XEDIT_FILE_BOOKMARKS_STORE_IS_MOUNT = 1 << 6, /* A mount object */
XEDIT_FILE_BOOKMARKS_STORE_IS_VOLUME = 1 << 7, /* A volume object */
XEDIT_FILE_BOOKMARKS_STORE_IS_DRIVE = 1 << 8, /* A drive object */
XEDIT_FILE_BOOKMARKS_STORE_IS_ROOT = 1 << 9, /* The root file system (file:///) */
XEDIT_FILE_BOOKMARKS_STORE_IS_BOOKMARK = 1 << 10, /* A gtk bookmark */
XEDIT_FILE_BOOKMARKS_STORE_IS_REMOTE_BOOKMARK = 1 << 11, /* A remote gtk bookmark */
XEDIT_FILE_BOOKMARKS_STORE_IS_LOCAL_BOOKMARK = 1 << 12 /* A local gtk bookmark */
};
struct _XeditFileBookmarksStore
{
GtkTreeStore parent;
XeditFileBookmarksStorePrivate *priv;
};
struct _XeditFileBookmarksStoreClass
{
GtkTreeStoreClass parent_class;
};
GType xedit_file_bookmarks_store_get_type (void) G_GNUC_CONST;
GType xedit_file_bookmarks_store_register_type (GTypeModule * module);
XeditFileBookmarksStore *xedit_file_bookmarks_store_new (void);
gchar *xedit_file_bookmarks_store_get_uri (XeditFileBookmarksStore * model,
GtkTreeIter * iter);
void xedit_file_bookmarks_store_refresh (XeditFileBookmarksStore * model);
G_END_DECLS
#endif /* __XEDIT_FILE_BOOKMARKS_STORE_H__ */
// ex:ts=8:noet:

View File

@@ -1,6 +1,6 @@
/*** BEGIN file-header ***/
void
pluma_file_browser_enum_and_flag_register_type (GTypeModule * module)
xedit_file_browser_enum_and_flag_register_type (GTypeModule * module)
{
/*** END file-header ***/

View File

@@ -1,5 +1,5 @@
/*** BEGIN file-header ***/
#include "pluma-file-browser-enum-types.h"
#include "xedit-file-browser-enum-types.h"
/*** END file-header ***/

View File

@@ -1,6 +1,6 @@
/*** BEGIN file-header ***/
#ifndef __PLUMA_FILE_BROWSER_ENUM_TYPES_H__
#define __PLUMA_FILE_BROWSER_ENUM_TYPES_H__
#ifndef __XEDIT_FILE_BROWSER_ENUM_TYPES_H__
#define __XEDIT_FILE_BROWSER_ENUM_TYPES_H__
#include <glib-object.h>
@@ -14,16 +14,16 @@ G_BEGIN_DECLS
/*** END file-production ***/
/*** BEGIN enumeration-production ***/
#define PLUMA_TYPE_@ENUMSHORT@ (@enum_name@_get_type())
#define XEDIT_TYPE_@ENUMSHORT@ (@enum_name@_get_type())
GType @enum_name@_get_type (void) G_GNUC_CONST;
/*** END enumeration-production ***/
/*** BEGIN file-tail ***/
void pluma_file_browser_enum_and_flag_register_type (GTypeModule * module);
void xedit_file_browser_enum_and_flag_register_type (GTypeModule * module);
G_END_DECLS
#endif /* __PLUMA_FILE_BROWSER_ENUM_TYPES_H__ */
#endif /* __XEDIT_FILE_BROWSER_ENUM_TYPES_H__ */
/*** END file-tail ***/

View File

@@ -1,5 +1,5 @@
/*
* pluma-file-browser-error.h - Pluma plugin providing easy file access
* xedit-file-browser-error.h - Xedit plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
@@ -19,23 +19,23 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __PLUMA_FILE_BROWSER_ERROR_H__
#define __PLUMA_FILE_BROWSER_ERROR_H__
#ifndef __XEDIT_FILE_BROWSER_ERROR_H__
#define __XEDIT_FILE_BROWSER_ERROR_H__
G_BEGIN_DECLS
typedef enum {
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;
XEDIT_FILE_BROWSER_ERROR_NONE,
XEDIT_FILE_BROWSER_ERROR_RENAME,
XEDIT_FILE_BROWSER_ERROR_DELETE,
XEDIT_FILE_BROWSER_ERROR_NEW_FILE,
XEDIT_FILE_BROWSER_ERROR_NEW_DIRECTORY,
XEDIT_FILE_BROWSER_ERROR_OPEN_DIRECTORY,
XEDIT_FILE_BROWSER_ERROR_SET_ROOT,
XEDIT_FILE_BROWSER_ERROR_LOAD_DIRECTORY,
XEDIT_FILE_BROWSER_ERROR_NUM
} XeditFileBrowserError;
G_END_DECLS
#endif /* __PLUMA_FILE_BROWSER_ERROR_H__ */
#endif /* __XEDIT_FILE_BROWSER_ERROR_H__ */

View File

@@ -1,16 +1,16 @@
#include "pluma-file-browser-messages.h"
#include "pluma-file-browser-store.h"
#include <pluma/pluma-message.h>
#include "xedit-file-browser-messages.h"
#include "xedit-file-browser-store.h"
#include <xedit/xedit-message.h>
#define MESSAGE_OBJECT_PATH "/plugins/filebrowser"
#define WINDOW_DATA_KEY "PlumaFileBrowserMessagesWindowData"
#define WINDOW_DATA_KEY "XeditFileBrowserMessagesWindowData"
#define BUS_CONNECT(bus, name, data) pluma_message_bus_connect(bus, MESSAGE_OBJECT_PATH, #name, (PlumaMessageCallback) message_##name##_cb, data, NULL)
#define BUS_CONNECT(bus, name, data) xedit_message_bus_connect(bus, MESSAGE_OBJECT_PATH, #name, (XeditMessageCallback) message_##name##_cb, data, NULL)
typedef struct
{
PlumaWindow *window;
PlumaMessage *message;
XeditWindow *window;
XeditMessage *message;
} MessageCacheData;
typedef struct
@@ -24,8 +24,8 @@ typedef struct
GList *merge_ids;
GtkActionGroup *merged_actions;
PlumaMessageBus *bus;
PlumaFileBrowserWidget *widget;
XeditMessageBus *bus;
XeditFileBrowserWidget *widget;
GHashTable *row_tracking;
GHashTable *filters;
@@ -35,19 +35,19 @@ typedef struct
{
gulong id;
PlumaWindow *window;
PlumaMessage *message;
XeditWindow *window;
XeditMessage *message;
} FilterData;
static WindowData *
window_data_new (PlumaWindow *window,
PlumaFileBrowserWidget *widget)
window_data_new (XeditWindow *window,
XeditFileBrowserWidget *widget)
{
WindowData *data = g_slice_new (WindowData);
GtkUIManager *manager;
GList *groups;
data->bus = pluma_window_get_message_bus (window);
data->bus = xedit_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 (PlumaWindow *window,
(GDestroyNotify)g_free,
NULL);
manager = pluma_file_browser_widget_get_ui_manager (widget);
manager = xedit_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 (PlumaWindow *window,
}
static WindowData *
get_window_data (PlumaWindow * window)
get_window_data (XeditWindow * window)
{
return (WindowData *) (g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY));
}
static void
window_data_free (PlumaWindow *window)
window_data_free (XeditWindow *window)
{
WindowData *data = get_window_data (window);
GtkUIManager *manager;
@@ -88,7 +88,7 @@ window_data_free (PlumaWindow *window)
g_hash_table_destroy (data->row_tracking);
g_hash_table_destroy (data->filters);
manager = pluma_file_browser_widget_get_ui_manager (data->widget);
manager = xedit_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 (PlumaWindow *window)
}
static FilterData *
filter_data_new (PlumaWindow *window,
PlumaMessage *message)
filter_data_new (XeditWindow *window,
XeditMessage *message)
{
FilterData *data = g_slice_new (FilterData);
WindowData *wdata;
@@ -116,8 +116,8 @@ filter_data_new (PlumaWindow *window,
wdata = get_window_data (window);
g_hash_table_insert (wdata->filters,
pluma_message_type_identifier (pluma_message_get_object_path (message),
pluma_message_get_method (message)),
xedit_message_type_identifier (xedit_message_get_object_path (message),
xedit_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 = pluma_message_type_identifier (pluma_message_get_object_path (data->message),
pluma_message_get_method (data->message));
identifier = xedit_message_type_identifier (xedit_message_get_object_path (data->message),
xedit_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 (PlumaWindow *window,
PlumaMessage *message)
message_cache_data_new (XeditWindow *window,
XeditMessage *message)
{
MessageCacheData *data = g_slice_new (MessageCacheData);
@@ -173,56 +173,56 @@ message_cache_data_new (PlumaWindow *window,
}
static void
message_get_root_cb (PlumaMessageBus *bus,
PlumaMessage *message,
message_get_root_cb (XeditMessageBus *bus,
XeditMessage *message,
WindowData *data)
{
PlumaFileBrowserStore *store;
XeditFileBrowserStore *store;
gchar *uri;
store = pluma_file_browser_widget_get_browser_store (data->widget);
uri = pluma_file_browser_store_get_virtual_root (store);
store = xedit_file_browser_widget_get_browser_store (data->widget);
uri = xedit_file_browser_store_get_virtual_root (store);
pluma_message_set (message, "uri", uri, NULL);
xedit_message_set (message, "uri", uri, NULL);
g_free (uri);
}
static void
message_set_root_cb (PlumaMessageBus *bus,
PlumaMessage *message,
message_set_root_cb (XeditMessageBus *bus,
XeditMessage *message,
WindowData *data)
{
gchar *root = NULL;
gchar *virtual = NULL;
pluma_message_get (message, "uri", &root, NULL);
xedit_message_get (message, "uri", &root, NULL);
if (!root)
return;
if (pluma_message_has_key (message, "virtual"))
pluma_message_get (message, "virtual", &virtual, NULL);
if (xedit_message_has_key (message, "virtual"))
xedit_message_get (message, "virtual", &virtual, NULL);
if (virtual)
pluma_file_browser_widget_set_root_and_virtual_root (data->widget, root, virtual);
xedit_file_browser_widget_set_root_and_virtual_root (data->widget, root, virtual);
else
pluma_file_browser_widget_set_root (data->widget, root, TRUE);
xedit_file_browser_widget_set_root (data->widget, root, TRUE);
g_free (root);
g_free (virtual);
}
static void
message_set_emblem_cb (PlumaMessageBus *bus,
PlumaMessage *message,
message_set_emblem_cb (XeditMessageBus *bus,
XeditMessage *message,
WindowData *data)
{
gchar *id = NULL;
gchar *emblem = NULL;
GtkTreePath *path;
PlumaFileBrowserStore *store;
XeditFileBrowserStore *store;
pluma_message_get (message, "id", &id, "emblem", &emblem, NULL);
xedit_message_get (message, "id", &id, "emblem", &emblem, NULL);
if (!id || !emblem)
{
@@ -250,16 +250,16 @@ message_set_emblem_cb (PlumaMessageBus *bus,
GValue value = { 0, };
GtkTreeIter iter;
store = pluma_file_browser_widget_get_browser_store (data->widget);
store = xedit_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);
pluma_file_browser_store_set_value (store,
xedit_file_browser_store_set_value (store,
&iter,
PLUMA_FILE_BROWSER_STORE_COLUMN_EMBLEM,
XEDIT_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,
PlumaFileBrowserStore *store,
XeditFileBrowserStore *store,
GtkTreePath *path,
const gchar *uri)
{
@@ -308,18 +308,18 @@ static void
set_item_message (WindowData *data,
GtkTreeIter *iter,
GtkTreePath *path,
PlumaMessage *message)
XeditMessage *message)
{
PlumaFileBrowserStore *store;
XeditFileBrowserStore *store;
gchar *uri = NULL;
guint flags = 0;
gchar *track_id;
store = pluma_file_browser_widget_get_browser_store (data->widget);
store = xedit_file_browser_widget_get_browser_store (data->widget);
gtk_tree_model_get (GTK_TREE_MODEL (store), iter,
PLUMA_FILE_BROWSER_STORE_COLUMN_URI, &uri,
PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
XEDIT_FILE_BROWSER_STORE_COLUMN_URI, &uri,
XEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
-1);
if (!uri)
@@ -330,14 +330,14 @@ set_item_message (WindowData *data,
else
track_id = NULL;
pluma_message_set (message,
xedit_message_set (message,
"id", track_id,
"uri", uri,
NULL);
if (pluma_message_has_key (message, "is_directory"))
if (xedit_message_has_key (message, "is_directory"))
{
pluma_message_set (message,
xedit_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 (PlumaFileBrowserWidget *widget,
PlumaFileBrowserStore *store,
custom_message_filter_func (XeditFileBrowserWidget *widget,
XeditFileBrowserStore *store,
GtkTreeIter *iter,
FilterData *data)
{
@@ -359,8 +359,8 @@ custom_message_filter_func (PlumaFileBrowserWidget *widget,
GtkTreePath *path;
gtk_tree_model_get (GTK_TREE_MODEL (store), iter,
PLUMA_FILE_BROWSER_STORE_COLUMN_URI, &uri,
PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
XEDIT_FILE_BROWSER_STORE_COLUMN_URI, &uri,
XEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
-1);
if (!uri || FILE_IS_DUMMY (flags))
@@ -373,28 +373,28 @@ custom_message_filter_func (PlumaFileBrowserWidget *widget,
set_item_message (wdata, iter, path, data->message);
gtk_tree_path_free (path);
pluma_message_set (data->message, "filter", filter, NULL);
xedit_message_set (data->message, "filter", filter, NULL);
pluma_message_bus_send_message_sync (wdata->bus, data->message);
pluma_message_get (data->message, "filter", &filter, NULL);
xedit_message_bus_send_message_sync (wdata->bus, data->message);
xedit_message_get (data->message, "filter", &filter, NULL);
return !filter;
}
static void
message_add_filter_cb (PlumaMessageBus *bus,
PlumaMessage *message,
PlumaWindow *window)
message_add_filter_cb (XeditMessageBus *bus,
XeditMessage *message,
XeditWindow *window)
{
gchar *object_path = NULL;
gchar *method = NULL;
gulong id;
PlumaMessageType *message_type;
PlumaMessage *cbmessage;
XeditMessageType *message_type;
XeditMessage *cbmessage;
FilterData *filter_data;
WindowData *data = get_window_data (window);
pluma_message_get (message,
xedit_message_get (message,
"object_path", &object_path,
"method", &method,
NULL);
@@ -408,7 +408,7 @@ message_add_filter_cb (PlumaMessageBus *bus,
return;
}
message_type = pluma_message_bus_lookup (bus, object_path, method);
message_type = xedit_message_bus_lookup (bus, object_path, method);
if (!message_type)
{
@@ -419,15 +419,15 @@ message_add_filter_cb (PlumaMessageBus *bus,
}
// Check if the message type has the correct arguments
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)
if (xedit_message_type_lookup (message_type, "id") != G_TYPE_STRING ||
xedit_message_type_lookup (message_type, "uri") != G_TYPE_STRING ||
xedit_message_type_lookup (message_type, "is_directory") != G_TYPE_BOOLEAN ||
xedit_message_type_lookup (message_type, "filter") != G_TYPE_BOOLEAN)
{
return;
}
cbmessage = pluma_message_type_instantiate (message_type,
cbmessage = xedit_message_type_instantiate (message_type,
"id", NULL,
"uri", NULL,
"is_directory", FALSE,
@@ -436,8 +436,8 @@ message_add_filter_cb (PlumaMessageBus *bus,
// Register the custom filter on the widget
filter_data = filter_data_new (window, cbmessage);
id = pluma_file_browser_widget_add_filter (data->widget,
(PlumaFileBrowserWidgetFilterFunc)custom_message_filter_func,
id = xedit_file_browser_widget_add_filter (data->widget,
(XeditFileBrowserWidgetFilterFunc)custom_message_filter_func,
filter_data,
(GDestroyNotify)filter_data_free);
@@ -445,117 +445,117 @@ message_add_filter_cb (PlumaMessageBus *bus,
}
static void
message_remove_filter_cb (PlumaMessageBus *bus,
PlumaMessage *message,
message_remove_filter_cb (XeditMessageBus *bus,
XeditMessage *message,
WindowData *data)
{
gulong id = 0;
pluma_message_get (message, "id", &id, NULL);
xedit_message_get (message, "id", &id, NULL);
if (!id)
return;
pluma_file_browser_widget_remove_filter (data->widget, id);
xedit_file_browser_widget_remove_filter (data->widget, id);
}
static void
message_up_cb (PlumaMessageBus *bus,
PlumaMessage *message,
message_up_cb (XeditMessageBus *bus,
XeditMessage *message,
WindowData *data)
{
PlumaFileBrowserStore *store = pluma_file_browser_widget_get_browser_store (data->widget);
XeditFileBrowserStore *store = xedit_file_browser_widget_get_browser_store (data->widget);
pluma_file_browser_store_set_virtual_root_up (store);
xedit_file_browser_store_set_virtual_root_up (store);
}
static void
message_history_back_cb (PlumaMessageBus *bus,
PlumaMessage *message,
message_history_back_cb (XeditMessageBus *bus,
XeditMessage *message,
WindowData *data)
{
pluma_file_browser_widget_history_back (data->widget);
xedit_file_browser_widget_history_back (data->widget);
}
static void
message_history_forward_cb (PlumaMessageBus *bus,
PlumaMessage *message,
message_history_forward_cb (XeditMessageBus *bus,
XeditMessage *message,
WindowData *data)
{
pluma_file_browser_widget_history_forward (data->widget);
xedit_file_browser_widget_history_forward (data->widget);
}
static void
message_refresh_cb (PlumaMessageBus *bus,
PlumaMessage *message,
message_refresh_cb (XeditMessageBus *bus,
XeditMessage *message,
WindowData *data)
{
pluma_file_browser_widget_refresh (data->widget);
xedit_file_browser_widget_refresh (data->widget);
}
static void
message_set_show_hidden_cb (PlumaMessageBus *bus,
PlumaMessage *message,
message_set_show_hidden_cb (XeditMessageBus *bus,
XeditMessage *message,
WindowData *data)
{
gboolean active = FALSE;
PlumaFileBrowserStore *store;
PlumaFileBrowserStoreFilterMode mode;
XeditFileBrowserStore *store;
XeditFileBrowserStoreFilterMode mode;
pluma_message_get (message, "active", &active, NULL);
xedit_message_get (message, "active", &active, NULL);
store = pluma_file_browser_widget_get_browser_store (data->widget);
mode = pluma_file_browser_store_get_filter_mode (store);
store = xedit_file_browser_widget_get_browser_store (data->widget);
mode = xedit_file_browser_store_get_filter_mode (store);
if (active)
mode &= ~PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN;
mode &= ~XEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN;
else
mode |= PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN;
mode |= XEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN;
pluma_file_browser_store_set_filter_mode (store, mode);
xedit_file_browser_store_set_filter_mode (store, mode);
}
static void
message_set_show_binary_cb (PlumaMessageBus *bus,
PlumaMessage *message,
message_set_show_binary_cb (XeditMessageBus *bus,
XeditMessage *message,
WindowData *data)
{
gboolean active = FALSE;
PlumaFileBrowserStore *store;
PlumaFileBrowserStoreFilterMode mode;
XeditFileBrowserStore *store;
XeditFileBrowserStoreFilterMode mode;
pluma_message_get (message, "active", &active, NULL);
xedit_message_get (message, "active", &active, NULL);
store = pluma_file_browser_widget_get_browser_store (data->widget);
mode = pluma_file_browser_store_get_filter_mode (store);
store = xedit_file_browser_widget_get_browser_store (data->widget);
mode = xedit_file_browser_store_get_filter_mode (store);
if (active)
mode &= ~PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY;
mode &= ~XEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY;
else
mode |= PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY;
mode |= XEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY;
pluma_file_browser_store_set_filter_mode (store, mode);
xedit_file_browser_store_set_filter_mode (store, mode);
}
static void
message_show_bookmarks_cb (PlumaMessageBus *bus,
PlumaMessage *message,
message_show_bookmarks_cb (XeditMessageBus *bus,
XeditMessage *message,
WindowData *data)
{
pluma_file_browser_widget_show_bookmarks (data->widget);
xedit_file_browser_widget_show_bookmarks (data->widget);
}
static void
message_show_files_cb (PlumaMessageBus *bus,
PlumaMessage *message,
message_show_files_cb (XeditMessageBus *bus,
XeditMessage *message,
WindowData *data)
{
pluma_file_browser_widget_show_files (data->widget);
xedit_file_browser_widget_show_files (data->widget);
}
static void
message_add_context_item_cb (PlumaMessageBus *bus,
PlumaMessage *message,
message_add_context_item_cb (XeditMessageBus *bus,
XeditMessage *message,
WindowData *data)
{
GtkAction *action = NULL;
@@ -564,7 +564,7 @@ message_add_context_item_cb (PlumaMessageBus *bus,
GtkUIManager *manager;
guint merge_id;
pluma_message_get (message,
xedit_message_get (message,
"action", &action,
"path", &path,
NULL);
@@ -579,7 +579,7 @@ message_add_context_item_cb (PlumaMessageBus *bus,
}
gtk_action_group_add_action (data->merged_actions, action);
manager = pluma_file_browser_widget_get_ui_manager (data->widget);
manager = xedit_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 (PlumaMessageBus *bus,
if (gtk_ui_manager_get_widget (manager, path))
{
data->merge_ids = g_list_prepend (data->merge_ids, GINT_TO_POINTER (merge_id));
pluma_message_set (message, "id", merge_id, NULL);
xedit_message_set (message, "id", merge_id, NULL);
}
else
{
pluma_message_set (message, "id", 0, NULL);
xedit_message_set (message, "id", 0, NULL);
}
g_object_unref (action);
@@ -607,64 +607,64 @@ message_add_context_item_cb (PlumaMessageBus *bus,
}
static void
message_remove_context_item_cb (PlumaMessageBus *bus,
PlumaMessage *message,
message_remove_context_item_cb (XeditMessageBus *bus,
XeditMessage *message,
WindowData *data)
{
guint merge_id = 0;
GtkUIManager *manager;
pluma_message_get (message, "id", &merge_id, NULL);
xedit_message_get (message, "id", &merge_id, NULL);
if (merge_id == 0)
return;
manager = pluma_file_browser_widget_get_ui_manager (data->widget);
manager = xedit_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 (PlumaMessageBus *bus,
PlumaMessage *message,
message_get_view_cb (XeditMessageBus *bus,
XeditMessage *message,
WindowData *data)
{
PlumaFileBrowserView *view;
view = pluma_file_browser_widget_get_browser_view (data->widget);
XeditFileBrowserView *view;
view = xedit_file_browser_widget_get_browser_view (data->widget);
pluma_message_set (message, "view", view, NULL);
xedit_message_set (message, "view", view, NULL);
}
static void
register_methods (PlumaWindow *window,
PlumaFileBrowserWidget *widget)
register_methods (XeditWindow *window,
XeditFileBrowserWidget *widget)
{
PlumaMessageBus *bus = pluma_window_get_message_bus (window);
XeditMessageBus *bus = xedit_window_get_message_bus (window);
WindowData *data = get_window_data (window);
/* Register method calls */
pluma_message_bus_register (bus,
xedit_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "get_root",
1,
"uri", G_TYPE_STRING,
NULL);
pluma_message_bus_register (bus,
xedit_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "set_root",
1,
"uri", G_TYPE_STRING,
"virtual", G_TYPE_STRING,
NULL);
pluma_message_bus_register (bus,
xedit_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "set_emblem",
0,
"id", G_TYPE_STRING,
"emblem", G_TYPE_STRING,
NULL);
pluma_message_bus_register (bus,
xedit_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "add_filter",
1,
"object_path", G_TYPE_STRING,
@@ -672,13 +672,13 @@ register_methods (PlumaWindow *window,
"id", G_TYPE_ULONG,
NULL);
pluma_message_bus_register (bus,
xedit_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "remove_filter",
0,
"id", G_TYPE_ULONG,
NULL);
pluma_message_bus_register (bus,
xedit_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "add_context_item",
1,
"action", GTK_TYPE_ACTION,
@@ -686,37 +686,37 @@ register_methods (PlumaWindow *window,
"id", G_TYPE_UINT,
NULL);
pluma_message_bus_register (bus,
xedit_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "remove_context_item",
0,
"id", G_TYPE_UINT,
NULL);
pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "up", 0, NULL);
xedit_message_bus_register (bus, MESSAGE_OBJECT_PATH, "up", 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);
xedit_message_bus_register (bus, MESSAGE_OBJECT_PATH, "history_back", 0, NULL);
xedit_message_bus_register (bus, MESSAGE_OBJECT_PATH, "history_forward", 0, NULL);
pluma_message_bus_register (bus, MESSAGE_OBJECT_PATH, "refresh", 0, NULL);
xedit_message_bus_register (bus, MESSAGE_OBJECT_PATH, "refresh", 0, NULL);
pluma_message_bus_register (bus,
xedit_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "set_show_hidden",
0,
"active", G_TYPE_BOOLEAN,
NULL);
pluma_message_bus_register (bus,
xedit_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "set_show_binary",
0,
"active", G_TYPE_BOOLEAN,
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);
xedit_message_bus_register (bus, MESSAGE_OBJECT_PATH, "show_bookmarks", 0, NULL);
xedit_message_bus_register (bus, MESSAGE_OBJECT_PATH, "show_files", 0, NULL);
pluma_message_bus_register (bus,
xedit_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "get_view",
1,
"view", PLUMA_TYPE_FILE_BROWSER_VIEW,
"view", XEDIT_TYPE_FILE_BROWSER_VIEW,
NULL);
BUS_CONNECT (bus, get_root, data);
@@ -744,7 +744,7 @@ register_methods (PlumaWindow *window,
}
static void
store_row_inserted (PlumaFileBrowserStore *store,
store_row_inserted (XeditFileBrowserStore *store,
GtkTreePath *path,
GtkTreeIter *iter,
MessageCacheData *data)
@@ -753,8 +753,8 @@ store_row_inserted (PlumaFileBrowserStore *store,
guint flags = 0;
gtk_tree_model_get (GTK_TREE_MODEL (store), iter,
PLUMA_FILE_BROWSER_STORE_COLUMN_URI, &uri,
PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
XEDIT_FILE_BROWSER_STORE_COLUMN_URI, &uri,
XEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
-1);
if (!FILE_IS_DUMMY (flags) && !FILE_IS_FILTERED (flags))
@@ -762,14 +762,14 @@ store_row_inserted (PlumaFileBrowserStore *store,
WindowData *wdata = get_window_data (data->window);
set_item_message (wdata, iter, path, data->message);
pluma_message_bus_send_message_sync (wdata->bus, data->message);
xedit_message_bus_send_message_sync (wdata->bus, data->message);
}
g_free (uri);
}
static void
store_row_deleted (PlumaFileBrowserStore *store,
store_row_deleted (XeditFileBrowserStore *store,
GtkTreePath *path,
MessageCacheData *data)
{
@@ -781,8 +781,8 @@ store_row_deleted (PlumaFileBrowserStore *store,
return;
gtk_tree_model_get (GTK_TREE_MODEL (store), &iter,
PLUMA_FILE_BROWSER_STORE_COLUMN_URI, &uri,
PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
XEDIT_FILE_BROWSER_STORE_COLUMN_URI, &uri,
XEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
-1);
if (!FILE_IS_DUMMY (flags) && !FILE_IS_FILTERED (flags))
@@ -790,36 +790,36 @@ store_row_deleted (PlumaFileBrowserStore *store,
WindowData *wdata = get_window_data (data->window);
set_item_message (wdata, &iter, path, data->message);
pluma_message_bus_send_message_sync (wdata->bus, data->message);
xedit_message_bus_send_message_sync (wdata->bus, data->message);
}
g_free (uri);
}
static void
store_virtual_root_changed (PlumaFileBrowserStore *store,
store_virtual_root_changed (XeditFileBrowserStore *store,
GParamSpec *spec,
MessageCacheData *data)
{
WindowData *wdata = get_window_data (data->window);
gchar *uri;
uri = pluma_file_browser_store_get_virtual_root (store);
uri = xedit_file_browser_store_get_virtual_root (store);
if (!uri)
return;
pluma_message_set (data->message,
xedit_message_set (data->message,
"uri", uri,
NULL);
pluma_message_bus_send_message_sync (wdata->bus, data->message);
xedit_message_bus_send_message_sync (wdata->bus, data->message);
g_free (uri);
}
static void
store_begin_loading (PlumaFileBrowserStore *store,
store_begin_loading (XeditFileBrowserStore *store,
GtkTreeIter *iter,
MessageCacheData *data)
{
@@ -830,12 +830,12 @@ store_begin_loading (PlumaFileBrowserStore *store,
set_item_message (wdata, iter, path, data->message);
pluma_message_bus_send_message_sync (wdata->bus, data->message);
xedit_message_bus_send_message_sync (wdata->bus, data->message);
gtk_tree_path_free (path);
}
static void
store_end_loading (PlumaFileBrowserStore *store,
store_end_loading (XeditFileBrowserStore *store,
GtkTreeIter *iter,
MessageCacheData *data)
{
@@ -846,48 +846,48 @@ store_end_loading (PlumaFileBrowserStore *store,
set_item_message (wdata, iter, path, data->message);
pluma_message_bus_send_message_sync (wdata->bus, data->message);
xedit_message_bus_send_message_sync (wdata->bus, data->message);
gtk_tree_path_free (path);
}
static void
register_signals (PlumaWindow *window,
PlumaFileBrowserWidget *widget)
register_signals (XeditWindow *window,
XeditFileBrowserWidget *widget)
{
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;
XeditMessageBus *bus = xedit_window_get_message_bus (window);
XeditFileBrowserStore *store;
XeditMessageType *inserted_type;
XeditMessageType *deleted_type;
XeditMessageType *begin_loading_type;
XeditMessageType *end_loading_type;
XeditMessageType *root_changed_type;
PlumaMessage *message;
XeditMessage *message;
WindowData *data;
/* Register signals */
root_changed_type = pluma_message_bus_register (bus,
root_changed_type = xedit_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "root_changed",
0,
"id", G_TYPE_STRING,
"uri", G_TYPE_STRING,
NULL);
begin_loading_type = pluma_message_bus_register (bus,
begin_loading_type = xedit_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "begin_loading",
0,
"id", G_TYPE_STRING,
"uri", G_TYPE_STRING,
NULL);
end_loading_type = pluma_message_bus_register (bus,
end_loading_type = xedit_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "end_loading",
0,
"id", G_TYPE_STRING,
"uri", G_TYPE_STRING,
NULL);
inserted_type = pluma_message_bus_register (bus,
inserted_type = xedit_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "inserted",
0,
"id", G_TYPE_STRING,
@@ -895,7 +895,7 @@ register_signals (PlumaWindow *window,
"is_directory", G_TYPE_BOOLEAN,
NULL);
deleted_type = pluma_message_bus_register (bus,
deleted_type = xedit_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "deleted",
0,
"id", G_TYPE_STRING,
@@ -903,9 +903,9 @@ register_signals (PlumaWindow *window,
"is_directory", G_TYPE_BOOLEAN,
NULL);
store = pluma_file_browser_widget_get_browser_store (widget);
store = xedit_file_browser_widget_get_browser_store (widget);
message = pluma_message_type_instantiate (inserted_type,
message = xedit_message_type_instantiate (inserted_type,
"id", NULL,
"uri", NULL,
"is_directory", FALSE,
@@ -921,7 +921,7 @@ register_signals (PlumaWindow *window,
(GClosureNotify)message_cache_data_free,
0);
message = pluma_message_type_instantiate (deleted_type,
message = xedit_message_type_instantiate (deleted_type,
"id", NULL,
"uri", NULL,
"is_directory", FALSE,
@@ -934,7 +934,7 @@ register_signals (PlumaWindow *window,
(GClosureNotify)message_cache_data_free,
0);
message = pluma_message_type_instantiate (root_changed_type,
message = xedit_message_type_instantiate (root_changed_type,
"id", NULL,
"uri", NULL,
NULL);
@@ -946,7 +946,7 @@ register_signals (PlumaWindow *window,
(GClosureNotify)message_cache_data_free,
0);
message = pluma_message_type_instantiate (begin_loading_type,
message = xedit_message_type_instantiate (begin_loading_type,
"id", NULL,
"uri", NULL,
NULL);
@@ -958,7 +958,7 @@ register_signals (PlumaWindow *window,
(GClosureNotify)message_cache_data_free,
0);
message = pluma_message_type_instantiate (end_loading_type,
message = xedit_message_type_instantiate (end_loading_type,
"id", NULL,
"uri", NULL,
NULL);
@@ -972,45 +972,45 @@ register_signals (PlumaWindow *window,
}
static void
message_unregistered (PlumaMessageBus *bus,
PlumaMessageType *message_type,
PlumaWindow *window)
message_unregistered (XeditMessageBus *bus,
XeditMessageType *message_type,
XeditWindow *window)
{
gchar *identifier = pluma_message_type_identifier (pluma_message_type_get_object_path (message_type),
pluma_message_type_get_method (message_type));
gchar *identifier = xedit_message_type_identifier (xedit_message_type_get_object_path (message_type),
xedit_message_type_get_method (message_type));
FilterData *data;
WindowData *wdata = get_window_data (window);
data = g_hash_table_lookup (wdata->filters, identifier);
if (data)
pluma_file_browser_widget_remove_filter (wdata->widget, data->id);
xedit_file_browser_widget_remove_filter (wdata->widget, data->id);
g_free (identifier);
}
void
pluma_file_browser_messages_register (PlumaWindow *window,
PlumaFileBrowserWidget *widget)
xedit_file_browser_messages_register (XeditWindow *window,
XeditFileBrowserWidget *widget)
{
window_data_new (window, widget);
register_methods (window, widget);
register_signals (window, widget);
g_signal_connect (pluma_window_get_message_bus (window),
g_signal_connect (xedit_window_get_message_bus (window),
"unregistered",
G_CALLBACK (message_unregistered),
window);
}
static void
cleanup_signals (PlumaWindow *window)
cleanup_signals (XeditWindow *window)
{
WindowData *data = get_window_data (window);
PlumaFileBrowserStore *store;
XeditFileBrowserStore *store;
store = pluma_file_browser_widget_get_browser_store (data->widget);
store = xedit_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 (PlumaWindow *window)
}
void
pluma_file_browser_messages_unregister (PlumaWindow *window)
xedit_file_browser_messages_unregister (XeditWindow *window)
{
PlumaMessageBus *bus = pluma_window_get_message_bus (window);
XeditMessageBus *bus = xedit_window_get_message_bus (window);
cleanup_signals (window);
pluma_message_bus_unregister_all (bus, MESSAGE_OBJECT_PATH);
xedit_message_bus_unregister_all (bus, MESSAGE_OBJECT_PATH);
window_data_free (window);
}

View File

@@ -1,5 +1,5 @@
/*
* pluma-file-browser-messages.h - Pluma plugin providing easy file access
* xedit-file-browser-messages.h - Xedit plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2008 - Jesse van den Kieboom <jesse@icecrew.nl>
@@ -19,17 +19,17 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __PLUMA_FILE_BROWSER_MESSAGES_H__
#define __PLUMA_FILE_BROWSER_MESSAGES_H__
#ifndef __XEDIT_FILE_BROWSER_MESSAGES_H__
#define __XEDIT_FILE_BROWSER_MESSAGES_H__
#include <pluma/pluma-window.h>
#include <pluma/pluma-message-bus.h>
#include "pluma-file-browser-widget.h"
#include <xedit/xedit-window.h>
#include <xedit/xedit-message-bus.h>
#include "xedit-file-browser-widget.h"
void pluma_file_browser_messages_register (PlumaWindow *window,
PlumaFileBrowserWidget *widget);
void pluma_file_browser_messages_unregister (PlumaWindow *window);
void xedit_file_browser_messages_register (XeditWindow *window,
XeditFileBrowserWidget *widget);
void xedit_file_browser_messages_unregister (XeditWindow *window);
#endif /* __PLUMA_FILE_BROWSER_MESSAGES_H__ */
#endif /* __XEDIT_FILE_BROWSER_MESSAGES_H__ */
// ex:ts=8:noet:

View File

@@ -1,5 +1,5 @@
/*
* pluma-file-browser-plugin.c - Pluma plugin providing easy file access
* xedit-file-browser-plugin.c - Xedit plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
@@ -24,25 +24,25 @@
#include <config.h>
#endif
#include <pluma/pluma-commands.h>
#include <pluma/pluma-utils.h>
#include <pluma/pluma-app.h>
#include <xedit/xedit-commands.h>
#include <xedit/xedit-utils.h>
#include <xedit/xedit-app.h>
#include <glib/gi18n-lib.h>
#include <pluma/pluma-debug.h>
#include <xedit/xedit-debug.h>
#include <gio/gio.h>
#include <string.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"
#include "xedit-file-browser-enum-types.h"
#include "xedit-file-browser-plugin.h"
#include "xedit-file-browser-utils.h"
#include "xedit-file-browser-error.h"
#include "xedit-file-browser-widget.h"
#include "xedit-file-browser-messages.h"
#define WINDOW_DATA_KEY "PlumaFileBrowserPluginWindowData"
#define WINDOW_DATA_KEY "XeditFileBrowserPluginWindowData"
#define FILE_BROWSER_SCHEMA "org.mate.pluma.plugins.filebrowser"
#define FILE_BROWSER_ONLOAD_SCHEMA "org.mate.pluma.plugins.filebrowser.on-load"
#define FILE_BROWSER_SCHEMA "org.x.editor.plugins.filebrowser"
#define FILE_BROWSER_ONLOAD_SCHEMA "org.x.editor.plugins.filebrowser.on-load"
#define CAJA_SCHEMA "org.mate.caja.preferences"
#define CAJA_CLICK_POLICY_KEY "click-policy"
#define CAJA_ENABLE_DELETE_KEY "enable-delete"
@@ -50,16 +50,16 @@
#define TERMINAL_SCHEMA "org.mate.applications-terminal"
#define TERMINAL_EXEC_KEY "exec"
#define PLUMA_FILE_BROWSER_PLUGIN_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), PLUMA_TYPE_FILE_BROWSER_PLUGIN, PlumaFileBrowserPluginPrivate))
#define XEDIT_FILE_BROWSER_PLUGIN_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), XEDIT_TYPE_FILE_BROWSER_PLUGIN, XeditFileBrowserPluginPrivate))
struct _PlumaFileBrowserPluginPrivate
struct _XeditFileBrowserPluginPrivate
{
gpointer *dummy;
};
typedef struct _PlumaFileBrowserPluginData
typedef struct _XeditFileBrowserPluginData
{
PlumaFileBrowserWidget * tree_widget;
XeditFileBrowserWidget * tree_widget;
gulong merge_id;
GtkActionGroup * action_group;
GtkActionGroup * single_selection_action_group;
@@ -71,75 +71,75 @@ typedef struct _PlumaFileBrowserPluginData
GSettings *onload_settings;
GSettings *caja_settings;
GSettings *terminal_settings;
} PlumaFileBrowserPluginData;
} XeditFileBrowserPluginData;
static void on_uri_activated_cb (PlumaFileBrowserWidget * widget,
static void on_uri_activated_cb (XeditFileBrowserWidget * widget,
gchar const *uri,
PlumaWindow * window);
static void on_error_cb (PlumaFileBrowserWidget * widget,
XeditWindow * window);
static void on_error_cb (XeditFileBrowserWidget * widget,
guint code,
gchar const *message,
PlumaWindow * window);
static void on_model_set_cb (PlumaFileBrowserView * widget,
XeditWindow * window);
static void on_model_set_cb (XeditFileBrowserView * widget,
GParamSpec *arg1,
PlumaWindow * window);
static void on_virtual_root_changed_cb (PlumaFileBrowserStore * model,
XeditWindow * window);
static void on_virtual_root_changed_cb (XeditFileBrowserStore * model,
GParamSpec * param,
PlumaWindow * window);
static void on_filter_mode_changed_cb (PlumaFileBrowserStore * model,
XeditWindow * window);
static void on_filter_mode_changed_cb (XeditFileBrowserStore * model,
GParamSpec * param,
PlumaWindow * window);
static void on_rename_cb (PlumaFileBrowserStore * model,
XeditWindow * window);
static void on_rename_cb (XeditFileBrowserStore * model,
const gchar * olduri,
const gchar * newuri,
PlumaWindow * window);
static void on_filter_pattern_changed_cb (PlumaFileBrowserWidget * widget,
XeditWindow * window);
static void on_filter_pattern_changed_cb (XeditFileBrowserWidget * widget,
GParamSpec * param,
PlumaWindow * window);
static void on_tab_added_cb (PlumaWindow * window,
PlumaTab * tab,
PlumaFileBrowserPluginData * data);
static gboolean on_confirm_delete_cb (PlumaFileBrowserWidget * widget,
PlumaFileBrowserStore * store,
XeditWindow * window);
static void on_tab_added_cb (XeditWindow * window,
XeditTab * tab,
XeditFileBrowserPluginData * data);
static gboolean on_confirm_delete_cb (XeditFileBrowserWidget * widget,
XeditFileBrowserStore * store,
GList * rows,
PlumaWindow * window);
static gboolean on_confirm_no_trash_cb (PlumaFileBrowserWidget * widget,
XeditWindow * window);
static gboolean on_confirm_no_trash_cb (XeditFileBrowserWidget * widget,
GList * files,
PlumaWindow * window);
XeditWindow * 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); \
XEDIT_PLUGIN_REGISTER_TYPE_WITH_CODE (XeditFileBrowserPlugin, filetree_plugin, \
xedit_file_browser_enum_and_flag_register_type (type_module); \
xedit_file_browser_store_register_type (type_module); \
xedit_file_bookmarks_store_register_type (type_module); \
xedit_file_browser_view_register_type (type_module); \
xedit_file_browser_widget_register_type (type_module); \
)
static void
filetree_plugin_init (PlumaFileBrowserPlugin * plugin)
filetree_plugin_init (XeditFileBrowserPlugin * plugin)
{
plugin->priv = PLUMA_FILE_BROWSER_PLUGIN_GET_PRIVATE (plugin);
plugin->priv = XEDIT_FILE_BROWSER_PLUGIN_GET_PRIVATE (plugin);
}
static void
filetree_plugin_finalize (GObject * object)
{
//PlumaFileBrowserPlugin * plugin = PLUMA_FILE_BROWSER_PLUGIN (object);
//XeditFileBrowserPlugin * plugin = XEDIT_FILE_BROWSER_PLUGIN (object);
G_OBJECT_CLASS (filetree_plugin_parent_class)->finalize (object);
}
static PlumaFileBrowserPluginData *
get_plugin_data (PlumaWindow * window)
static XeditFileBrowserPluginData *
get_plugin_data (XeditWindow * window)
{
return (PlumaFileBrowserPluginData *) (g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY));
return (XeditFileBrowserPluginData *) (g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY));
}
static void
on_end_loading_cb (PlumaFileBrowserStore * store,
on_end_loading_cb (XeditFileBrowserStore * store,
GtkTreeIter * iter,
PlumaFileBrowserPluginData * data)
XeditFileBrowserPluginData * data)
{
/* Disconnect the signal */
g_signal_handler_disconnect (store, data->end_loading_handle);
@@ -148,13 +148,13 @@ on_end_loading_cb (PlumaFileBrowserStore * store,
}
static void
prepare_auto_root (PlumaFileBrowserPluginData *data)
prepare_auto_root (XeditFileBrowserPluginData *data)
{
PlumaFileBrowserStore *store;
XeditFileBrowserStore *store;
data->auto_root = TRUE;
store = pluma_file_browser_widget_get_browser_store (data->tree_widget);
store = xedit_file_browser_widget_get_browser_store (data->tree_widget);
if (data->end_loading_handle != 0) {
g_signal_handler_disconnect (store, data->end_loading_handle);
@@ -168,7 +168,7 @@ prepare_auto_root (PlumaFileBrowserPluginData *data)
}
static void
restore_default_location (PlumaFileBrowserPluginData *data)
restore_default_location (XeditFileBrowserPluginData *data)
{
gchar * root;
gchar * virtual_root;
@@ -178,7 +178,7 @@ restore_default_location (PlumaFileBrowserPluginData *data)
bookmarks = !g_settings_get_boolean (data->onload_settings, "tree-view");
if (bookmarks) {
pluma_file_browser_widget_show_bookmarks (data->tree_widget);
xedit_file_browser_widget_show_bookmarks (data->tree_widget);
return;
}
@@ -195,12 +195,12 @@ restore_default_location (PlumaFileBrowserPluginData *data)
if (remote || g_file_is_native (file)) {
if (virtual_root != NULL && *virtual_root != '\0') {
prepare_auto_root (data);
pluma_file_browser_widget_set_root_and_virtual_root (data->tree_widget,
xedit_file_browser_widget_set_root_and_virtual_root (data->tree_widget,
root,
virtual_root);
} else {
prepare_auto_root (data);
pluma_file_browser_widget_set_root (data->tree_widget,
xedit_file_browser_widget_set_root (data->tree_widget,
root,
TRUE);
}
@@ -214,54 +214,54 @@ restore_default_location (PlumaFileBrowserPluginData *data)
}
static void
restore_filter (PlumaFileBrowserPluginData * data)
restore_filter (XeditFileBrowserPluginData * data)
{
gchar *filter_mode;
PlumaFileBrowserStoreFilterMode mode;
XeditFileBrowserStoreFilterMode mode;
gchar *pattern;
/* Get filter_mode */
filter_mode = g_settings_get_string (data->settings, "filter-mode");
/* Filter mode */
mode = pluma_file_browser_store_filter_mode_get_default ();
mode = xedit_file_browser_store_filter_mode_get_default ();
if (filter_mode != NULL) {
if (strcmp (filter_mode, "hidden") == 0) {
mode = PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN;
mode = XEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN;
} else if (strcmp (filter_mode, "binary") == 0) {
mode = PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY;
mode = XEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY;
} else if (strcmp (filter_mode, "hidden_and_binary") == 0 ||
strcmp (filter_mode, "binary_and_hidden") == 0) {
mode = PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN |
PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY;
mode = XEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN |
XEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY;
} else if (strcmp (filter_mode, "none") == 0 ||
*filter_mode == '\0') {
mode = PLUMA_FILE_BROWSER_STORE_FILTER_MODE_NONE;
mode = XEDIT_FILE_BROWSER_STORE_FILTER_MODE_NONE;
}
}
/* Set the filter mode */
pluma_file_browser_store_set_filter_mode (
pluma_file_browser_widget_get_browser_store (data->tree_widget),
xedit_file_browser_store_set_filter_mode (
xedit_file_browser_widget_get_browser_store (data->tree_widget),
mode);
pattern = g_settings_get_string (data->settings, "filter-pattern");
pluma_file_browser_widget_set_filter_pattern (data->tree_widget,
xedit_file_browser_widget_set_filter_pattern (data->tree_widget,
pattern);
g_free (filter_mode);
g_free (pattern);
}
static PlumaFileBrowserViewClickPolicy
static XeditFileBrowserViewClickPolicy
click_policy_from_string (gchar const *click_policy)
{
if (click_policy && strcmp (click_policy, "single") == 0)
return PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE;
return XEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE;
else
return PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE;
return XEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE;
}
static void
@@ -269,18 +269,18 @@ on_click_policy_changed (GSettings *settings,
gchar *key,
gpointer user_data)
{
PlumaFileBrowserPluginData * data;
XeditFileBrowserPluginData * data;
gchar *click_policy;
PlumaFileBrowserViewClickPolicy policy = PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE;
PlumaFileBrowserView *view;
XeditFileBrowserViewClickPolicy policy = XEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE;
XeditFileBrowserView *view;
data = (PlumaFileBrowserPluginData *)(user_data);
data = (XeditFileBrowserPluginData *)(user_data);
click_policy = g_settings_get_string (settings, key);
policy = click_policy_from_string (click_policy);
view = pluma_file_browser_widget_get_browser_view (data->tree_widget);
pluma_file_browser_view_set_click_policy (view, policy);
view = xedit_file_browser_widget_get_browser_view (data->tree_widget);
xedit_file_browser_view_set_click_policy (view, policy);
g_free (click_policy);
}
@@ -289,10 +289,10 @@ on_enable_delete_changed (GSettings *settings,
gchar *key,
gpointer user_data)
{
PlumaFileBrowserPluginData *data;
XeditFileBrowserPluginData *data;
gboolean enable = FALSE;
data = (PlumaFileBrowserPluginData *)(user_data);
data = (XeditFileBrowserPluginData *)(user_data);
enable = g_settings_get_boolean (settings, key);
g_object_set (G_OBJECT (data->tree_widget), "enable-delete", enable, NULL);
@@ -303,10 +303,10 @@ on_confirm_trash_changed (GSettings *settings,
gchar *key,
gpointer user_data)
{
PlumaFileBrowserPluginData *data;
XeditFileBrowserPluginData *data;
gboolean enable = FALSE;
data = (PlumaFileBrowserPluginData *)(user_data);
data = (XeditFileBrowserPluginData *)(user_data);
enable = g_settings_get_boolean (settings, key);
data->confirm_trash = enable;
@@ -325,12 +325,12 @@ have_click_policy (void)
}
static void
install_caja_prefs (PlumaFileBrowserPluginData *data)
install_caja_prefs (XeditFileBrowserPluginData *data)
{
gchar *pref;
gboolean prefb;
PlumaFileBrowserViewClickPolicy policy;
PlumaFileBrowserView *view;
XeditFileBrowserViewClickPolicy policy;
XeditFileBrowserView *view;
if (have_click_policy ()) {
g_signal_connect (data->caja_settings,
@@ -353,8 +353,8 @@ install_caja_prefs (PlumaFileBrowserPluginData *data)
policy = click_policy_from_string (pref);
g_free (pref);
view = pluma_file_browser_widget_get_browser_view (data->tree_widget);
pluma_file_browser_view_set_click_policy (view, policy);
view = xedit_file_browser_widget_get_browser_view (data->tree_widget);
xedit_file_browser_view_set_click_policy (view, policy);
prefb = g_settings_get_boolean (data->caja_settings, CAJA_ENABLE_DELETE_KEY);
g_object_set (G_OBJECT (data->tree_widget), "enable-delete", prefb, NULL);
@@ -364,8 +364,8 @@ install_caja_prefs (PlumaFileBrowserPluginData *data)
}
static void
set_root_from_doc (PlumaFileBrowserPluginData * data,
PlumaDocument * doc)
set_root_from_doc (XeditFileBrowserPluginData * data,
XeditDocument * doc)
{
GFile *file;
GFile *parent;
@@ -373,7 +373,7 @@ set_root_from_doc (PlumaFileBrowserPluginData * data,
if (doc == NULL)
return;
file = pluma_document_get_location (doc);
file = xedit_document_get_location (doc);
if (file == NULL)
return;
@@ -384,7 +384,7 @@ set_root_from_doc (PlumaFileBrowserPluginData * data,
root = g_file_get_uri (parent);
pluma_file_browser_widget_set_root (data->tree_widget,
xedit_file_browser_widget_set_root (data->tree_widget,
root,
TRUE);
@@ -397,17 +397,17 @@ set_root_from_doc (PlumaFileBrowserPluginData * data,
static void
on_action_set_active_root (GtkAction * action,
PlumaWindow * window)
XeditWindow * window)
{
PlumaFileBrowserPluginData *data;
XeditFileBrowserPluginData *data;
data = get_plugin_data (window);
set_root_from_doc (data,
pluma_window_get_active_document (window));
xedit_window_get_active_document (window));
}
static gchar *
get_terminal (PlumaFileBrowserPluginData * data)
get_terminal (XeditFileBrowserPluginData * data)
{
gchar * terminal;
@@ -428,9 +428,9 @@ get_terminal (PlumaFileBrowserPluginData * data)
static void
on_action_open_terminal (GtkAction * action,
PlumaWindow * window)
XeditWindow * window)
{
PlumaFileBrowserPluginData * data;
XeditFileBrowserPluginData * data;
gchar * terminal;
gchar * wd = NULL;
gchar * local;
@@ -438,18 +438,18 @@ on_action_open_terminal (GtkAction * action,
GFile * file;
GtkTreeIter iter;
PlumaFileBrowserStore * store;
XeditFileBrowserStore * store;
data = get_plugin_data (window);
/* Get the current directory */
if (!pluma_file_browser_widget_get_selected_directory (data->tree_widget, &iter))
if (!xedit_file_browser_widget_get_selected_directory (data->tree_widget, &iter))
return;
store = pluma_file_browser_widget_get_browser_store (data->tree_widget);
store = xedit_file_browser_widget_get_browser_store (data->tree_widget);
gtk_tree_model_get (GTK_TREE_MODEL (store),
&iter,
PLUMA_FILE_BROWSER_STORE_COLUMN_URI,
XEDIT_FILE_BROWSER_STORE_COLUMN_URI,
&wd,
-1);
@@ -481,9 +481,9 @@ on_action_open_terminal (GtkAction * action,
static void
on_selection_changed_cb (GtkTreeSelection *selection,
PlumaWindow *window)
XeditWindow *window)
{
PlumaFileBrowserPluginData * data;
XeditFileBrowserPluginData * data;
GtkTreeView * tree_view;
GtkTreeModel * model;
GtkTreeIter iter;
@@ -492,20 +492,20 @@ on_selection_changed_cb (GtkTreeSelection *selection,
data = get_plugin_data (window);
tree_view = GTK_TREE_VIEW (pluma_file_browser_widget_get_browser_view (data->tree_widget));
tree_view = GTK_TREE_VIEW (xedit_file_browser_widget_get_browser_view (data->tree_widget));
model = gtk_tree_view_get_model (tree_view);
if (!PLUMA_IS_FILE_BROWSER_STORE (model))
if (!XEDIT_IS_FILE_BROWSER_STORE (model))
return;
sensitive = pluma_file_browser_widget_get_selected_directory (data->tree_widget, &iter);
sensitive = xedit_file_browser_widget_get_selected_directory (data->tree_widget, &iter);
if (sensitive) {
gtk_tree_model_get (model, &iter,
PLUMA_FILE_BROWSER_STORE_COLUMN_URI,
XEDIT_FILE_BROWSER_STORE_COLUMN_URI,
&uri, -1);
sensitive = pluma_utils_uri_has_file_scheme (uri);
sensitive = xedit_utils_uri_has_file_scheme (uri);
g_free (uri);
}
@@ -548,15 +548,15 @@ static GtkActionEntry extra_single_selection_actions[] = {
};
static void
add_popup_ui (PlumaWindow * window)
add_popup_ui (XeditWindow * window)
{
PlumaFileBrowserPluginData * data;
XeditFileBrowserPluginData * data;
GtkUIManager * manager;
GtkActionGroup * action_group;
GError * error = NULL;
data = get_plugin_data (window);
manager = pluma_file_browser_widget_get_ui_manager (data->tree_widget);
manager = xedit_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);
@@ -588,13 +588,13 @@ add_popup_ui (PlumaWindow * window)
}
static void
remove_popup_ui (PlumaWindow * window)
remove_popup_ui (XeditWindow * window)
{
PlumaFileBrowserPluginData * data;
XeditFileBrowserPluginData * data;
GtkUIManager * manager;
data = get_plugin_data (window);
manager = pluma_file_browser_widget_get_ui_manager (data->tree_widget);
manager = xedit_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);
@@ -605,37 +605,37 @@ remove_popup_ui (PlumaWindow * window)
}
static void
impl_updateui (PlumaPlugin * plugin, PlumaWindow * window)
impl_updateui (XeditPlugin * plugin, XeditWindow * window)
{
PlumaFileBrowserPluginData * data;
PlumaDocument * doc;
XeditFileBrowserPluginData * data;
XeditDocument * doc;
data = get_plugin_data (window);
doc = pluma_window_get_active_document (window);
doc = xedit_window_get_active_document (window);
gtk_action_set_sensitive (gtk_action_group_get_action (data->action_group,
"SetActiveRoot"),
doc != NULL &&
!pluma_document_is_untitled (doc));
!xedit_document_is_untitled (doc));
}
static void
impl_activate (PlumaPlugin * plugin, PlumaWindow * window)
impl_activate (XeditPlugin * plugin, XeditWindow * window)
{
PlumaPanel * panel;
PlumaFileBrowserPluginData * data;
XeditPanel * panel;
XeditFileBrowserPluginData * data;
GtkWidget * image;
GdkPixbuf * pixbuf;
PlumaFileBrowserStore * store;
XeditFileBrowserStore * store;
gchar *data_dir;
GSettingsSchemaSource *schema_source;
GSettingsSchema *schema;
data = g_new0 (PlumaFileBrowserPluginData, 1);
data = g_new0 (XeditFileBrowserPluginData, 1);
data_dir = pluma_plugin_get_data_dir (plugin);
data->tree_widget = PLUMA_FILE_BROWSER_WIDGET (pluma_file_browser_widget_new (data_dir));
data_dir = xedit_plugin_get_data_dir (plugin);
data->tree_widget = XEDIT_FILE_BROWSER_WIDGET (xedit_file_browser_widget_new (data_dir));
g_free (data_dir);
data->settings = g_settings_new (FILE_BROWSER_SCHEMA);
@@ -665,14 +665,14 @@ impl_activate (PlumaPlugin * plugin, PlumaWindow * window)
window);
g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW
(pluma_file_browser_widget_get_browser_view
(xedit_file_browser_widget_get_browser_view
(data->tree_widget))),
"changed",
G_CALLBACK (on_selection_changed_cb),
window);
panel = pluma_window_get_side_panel (window);
pixbuf = pluma_file_browser_utils_pixbuf_from_theme("system-file-manager",
panel = xedit_window_get_side_panel (window);
pixbuf = xedit_file_browser_utils_pixbuf_from_theme("system-file-manager",
GTK_ICON_SIZE_MENU);
if (pixbuf) {
@@ -683,7 +683,7 @@ impl_activate (PlumaPlugin * plugin, PlumaWindow * window)
}
gtk_widget_show(image);
pluma_panel_add_item (panel,
xedit_panel_add_item (panel,
GTK_WIDGET (data->tree_widget),
_("File Browser"),
image);
@@ -705,12 +705,12 @@ impl_activate (PlumaPlugin * plugin, PlumaWindow * window)
}
/* Connect signals to store the last visited location */
g_signal_connect (pluma_file_browser_widget_get_browser_view (data->tree_widget),
g_signal_connect (xedit_file_browser_widget_get_browser_view (data->tree_widget),
"notify::model",
G_CALLBACK (on_model_set_cb),
window);
store = pluma_file_browser_widget_get_browser_store (data->tree_widget);
store = xedit_file_browser_widget_get_browser_store (data->tree_widget);
g_signal_connect (store,
"notify::virtual-root",
G_CALLBACK (on_virtual_root_changed_cb),
@@ -732,21 +732,21 @@ impl_activate (PlumaPlugin * plugin, PlumaWindow * window)
data);
/* Register messages on the bus */
pluma_file_browser_messages_register (window, data->tree_widget);
xedit_file_browser_messages_register (window, data->tree_widget);
impl_updateui (plugin, window);
}
static void
impl_deactivate (PlumaPlugin * plugin, PlumaWindow * window)
impl_deactivate (XeditPlugin * plugin, XeditWindow * window)
{
PlumaFileBrowserPluginData * data;
PlumaPanel * panel;
XeditFileBrowserPluginData * data;
XeditPanel * panel;
data = get_plugin_data (window);
/* Unregister messages from the bus */
pluma_file_browser_messages_unregister (window);
xedit_file_browser_messages_unregister (window);
/* Disconnect signals */
g_signal_handlers_disconnect_by_func (window,
@@ -762,18 +762,18 @@ impl_deactivate (PlumaPlugin * plugin, PlumaWindow * window)
remove_popup_ui (window);
panel = pluma_window_get_side_panel (window);
pluma_panel_remove_item (panel, GTK_WIDGET (data->tree_widget));
panel = xedit_window_get_side_panel (window);
xedit_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 (PlumaFileBrowserPluginClass * klass)
filetree_plugin_class_init (XeditFileBrowserPluginClass * klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
PlumaPluginClass * plugin_class = PLUMA_PLUGIN_CLASS (klass);
XeditPluginClass * plugin_class = XEDIT_PLUGIN_CLASS (klass);
object_class->finalize = filetree_plugin_finalize;
@@ -782,64 +782,64 @@ filetree_plugin_class_init (PlumaFileBrowserPluginClass * klass)
plugin_class->update_ui = impl_updateui;
g_type_class_add_private (object_class,
sizeof (PlumaFileBrowserPluginPrivate));
sizeof (XeditFileBrowserPluginPrivate));
}
/* Callbacks */
static void
on_uri_activated_cb (PlumaFileBrowserWidget * tree_widget,
gchar const *uri, PlumaWindow * window)
on_uri_activated_cb (XeditFileBrowserWidget * tree_widget,
gchar const *uri, XeditWindow * window)
{
pluma_commands_load_uri (window, uri, NULL, 0);
xedit_commands_load_uri (window, uri, NULL, 0);
}
static void
on_error_cb (PlumaFileBrowserWidget * tree_widget,
guint code, gchar const *message, PlumaWindow * window)
on_error_cb (XeditFileBrowserWidget * tree_widget,
guint code, gchar const *message, XeditWindow * window)
{
gchar * title;
GtkWidget * dlg;
PlumaFileBrowserPluginData * data;
XeditFileBrowserPluginData * data;
data = get_plugin_data (window);
/* Do not show the error when the root has been set automatically */
if (data->auto_root && (code == PLUMA_FILE_BROWSER_ERROR_SET_ROOT ||
code == PLUMA_FILE_BROWSER_ERROR_LOAD_DIRECTORY))
if (data->auto_root && (code == XEDIT_FILE_BROWSER_ERROR_SET_ROOT ||
code == XEDIT_FILE_BROWSER_ERROR_LOAD_DIRECTORY))
{
/* Show bookmarks */
pluma_file_browser_widget_show_bookmarks (data->tree_widget);
xedit_file_browser_widget_show_bookmarks (data->tree_widget);
return;
}
switch (code) {
case PLUMA_FILE_BROWSER_ERROR_NEW_DIRECTORY:
case XEDIT_FILE_BROWSER_ERROR_NEW_DIRECTORY:
title =
_("An error occurred while creating a new directory");
break;
case PLUMA_FILE_BROWSER_ERROR_NEW_FILE:
case XEDIT_FILE_BROWSER_ERROR_NEW_FILE:
title = _("An error occurred while creating a new file");
break;
case PLUMA_FILE_BROWSER_ERROR_RENAME:
case XEDIT_FILE_BROWSER_ERROR_RENAME:
title =
_
("An error occurred while renaming a file or directory");
break;
case PLUMA_FILE_BROWSER_ERROR_DELETE:
case XEDIT_FILE_BROWSER_ERROR_DELETE:
title =
_
("An error occurred while deleting a file or directory");
break;
case PLUMA_FILE_BROWSER_ERROR_OPEN_DIRECTORY:
case XEDIT_FILE_BROWSER_ERROR_OPEN_DIRECTORY:
title =
_
("An error occurred while opening a directory in the file manager");
break;
case PLUMA_FILE_BROWSER_ERROR_SET_ROOT:
case XEDIT_FILE_BROWSER_ERROR_SET_ROOT:
title =
_("An error occurred while setting a root directory");
break;
case PLUMA_FILE_BROWSER_ERROR_LOAD_DIRECTORY:
case XEDIT_FILE_BROWSER_ERROR_LOAD_DIRECTORY:
title =
_("An error occurred while loading a directory");
break;
@@ -861,39 +861,39 @@ on_error_cb (PlumaFileBrowserWidget * tree_widget,
}
static void
on_model_set_cb (PlumaFileBrowserView * widget,
on_model_set_cb (XeditFileBrowserView * widget,
GParamSpec *arg1,
PlumaWindow * window)
XeditWindow * window)
{
PlumaFileBrowserPluginData * data = get_plugin_data (window);
XeditFileBrowserPluginData * data = get_plugin_data (window);
GtkTreeModel * model;
model = gtk_tree_view_get_model (GTK_TREE_VIEW (pluma_file_browser_widget_get_browser_view (data->tree_widget)));
model = gtk_tree_view_get_model (GTK_TREE_VIEW (xedit_file_browser_widget_get_browser_view (data->tree_widget)));
if (model == NULL)
return;
g_settings_set_boolean (data->onload_settings,
"tree-view",
PLUMA_IS_FILE_BROWSER_STORE (model));
XEDIT_IS_FILE_BROWSER_STORE (model));
}
static void
on_filter_mode_changed_cb (PlumaFileBrowserStore * model,
on_filter_mode_changed_cb (XeditFileBrowserStore * model,
GParamSpec * param,
PlumaWindow * window)
XeditWindow * window)
{
PlumaFileBrowserPluginData * data = get_plugin_data (window);
PlumaFileBrowserStoreFilterMode mode;
XeditFileBrowserPluginData * data = get_plugin_data (window);
XeditFileBrowserStoreFilterMode mode;
mode = pluma_file_browser_store_get_filter_mode (model);
mode = xedit_file_browser_store_get_filter_mode (model);
if ((mode & PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN) &&
(mode & PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY)) {
if ((mode & XEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN) &&
(mode & XEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY)) {
g_settings_set_string (data->settings, "filter-mode", "hidden_and_binary");
} else if (mode & PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN) {
} else if (mode & XEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN) {
g_settings_set_string (data->settings, "filter-mode", "hidden");
} else if (mode & PLUMA_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY) {
} else if (mode & XEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY) {
g_settings_set_string (data->settings, "filter-mode", "binary");
} else {
g_settings_set_string (data->settings, "filter-mode", "none");
@@ -901,30 +901,30 @@ on_filter_mode_changed_cb (PlumaFileBrowserStore * model,
}
static void
on_rename_cb (PlumaFileBrowserStore * store,
on_rename_cb (XeditFileBrowserStore * store,
const gchar * olduri,
const gchar * newuri,
PlumaWindow * window)
XeditWindow * window)
{
PlumaApp * app;
XeditApp * app;
GList * documents;
GList * item;
PlumaDocument * doc;
XeditDocument * doc;
GFile * docfile;
GFile * oldfile;
GFile * newfile;
gchar * uri;
/* Find all documents and set its uri to newuri where it matches olduri */
app = pluma_app_get_default ();
documents = pluma_app_get_documents (app);
app = xedit_app_get_default ();
documents = xedit_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 = PLUMA_DOCUMENT (item->data);
uri = pluma_document_get_uri (doc);
doc = XEDIT_DOCUMENT (item->data);
uri = xedit_document_get_uri (doc);
if (!uri)
continue;
@@ -932,7 +932,7 @@ on_rename_cb (PlumaFileBrowserStore * store,
docfile = g_file_new_for_uri (uri);
if (g_file_equal (docfile, oldfile)) {
pluma_document_set_uri (doc, newuri);
xedit_document_set_uri (doc, newuri);
} else {
gchar *relative;
@@ -948,7 +948,7 @@ on_rename_cb (PlumaFileBrowserStore * store,
docfile = g_file_get_child (newfile, relative);
uri = g_file_get_uri (docfile);
pluma_document_set_uri (doc, uri);
xedit_document_set_uri (doc, uri);
}
g_free (relative);
@@ -965,11 +965,11 @@ on_rename_cb (PlumaFileBrowserStore * store,
}
static void
on_filter_pattern_changed_cb (PlumaFileBrowserWidget * widget,
on_filter_pattern_changed_cb (XeditFileBrowserWidget * widget,
GParamSpec * param,
PlumaWindow * window)
XeditWindow * window)
{
PlumaFileBrowserPluginData * data = get_plugin_data (window);
XeditFileBrowserPluginData * data = get_plugin_data (window);
gchar * pattern;
g_object_get (G_OBJECT (widget), "filter-pattern", &pattern, NULL);
@@ -983,22 +983,22 @@ on_filter_pattern_changed_cb (PlumaFileBrowserWidget * widget,
}
static void
on_virtual_root_changed_cb (PlumaFileBrowserStore * store,
on_virtual_root_changed_cb (XeditFileBrowserStore * store,
GParamSpec * param,
PlumaWindow * window)
XeditWindow * window)
{
PlumaFileBrowserPluginData * data = get_plugin_data (window);
XeditFileBrowserPluginData * data = get_plugin_data (window);
gchar * root;
gchar * virtual_root;
root = pluma_file_browser_store_get_root (store);
root = xedit_file_browser_store_get_root (store);
if (!root)
return;
g_settings_set_string (data->onload_settings, "root", root);
virtual_root = pluma_file_browser_store_get_virtual_root (store);
virtual_root = xedit_file_browser_store_get_virtual_root (store);
if (!virtual_root) {
/* Set virtual to same as root then */
@@ -1016,9 +1016,9 @@ on_virtual_root_changed_cb (PlumaFileBrowserStore * store,
}
static void
on_tab_added_cb (PlumaWindow * window,
PlumaTab * tab,
PlumaFileBrowserPluginData * data)
on_tab_added_cb (XeditWindow * window,
XeditTab * tab,
XeditFileBrowserPluginData * data)
{
gboolean open;
gboolean load_default = TRUE;
@@ -1026,14 +1026,14 @@ on_tab_added_cb (PlumaWindow * window,
open = g_settings_get_boolean (data->settings, "open-at-first-doc");
if (open) {
PlumaDocument *doc;
XeditDocument *doc;
gchar *uri;
doc = pluma_tab_get_document (tab);
doc = xedit_tab_get_document (tab);
uri = pluma_document_get_uri (doc);
uri = xedit_document_get_uri (doc);
if (uri != NULL && pluma_utils_uri_has_file_scheme (uri)) {
if (uri != NULL && xedit_utils_uri_has_file_scheme (uri)) {
prepare_auto_root (data);
set_root_from_doc (data, doc);
load_default = FALSE;
@@ -1059,16 +1059,16 @@ get_filename_from_path (GtkTreeModel *model, GtkTreePath *path)
gtk_tree_model_get_iter (model, &iter, path);
gtk_tree_model_get (model, &iter,
PLUMA_FILE_BROWSER_STORE_COLUMN_URI, &uri,
XEDIT_FILE_BROWSER_STORE_COLUMN_URI, &uri,
-1);
return pluma_file_browser_utils_uri_basename (uri);
return xedit_file_browser_utils_uri_basename (uri);
}
static gboolean
on_confirm_no_trash_cb (PlumaFileBrowserWidget * widget,
on_confirm_no_trash_cb (XeditFileBrowserWidget * widget,
GList * files,
PlumaWindow * window)
XeditWindow * window)
{
gchar *normal;
gchar *message;
@@ -1078,14 +1078,14 @@ on_confirm_no_trash_cb (PlumaFileBrowserWidget * widget,
message = _("Cannot move file to trash, do you\nwant to delete permanently?");
if (files->next == NULL) {
normal = pluma_file_browser_utils_file_basename (G_FILE (files->data));
normal = xedit_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 = pluma_file_browser_utils_confirmation_dialog (window,
result = xedit_file_browser_utils_confirmation_dialog (window,
GTK_MESSAGE_QUESTION,
message,
secondary,
@@ -1097,16 +1097,16 @@ on_confirm_no_trash_cb (PlumaFileBrowserWidget * widget,
}
static gboolean
on_confirm_delete_cb (PlumaFileBrowserWidget *widget,
PlumaFileBrowserStore *store,
on_confirm_delete_cb (XeditFileBrowserWidget *widget,
XeditFileBrowserStore *store,
GList *paths,
PlumaWindow *window)
XeditWindow *window)
{
gchar *normal;
gchar *message;
gchar *secondary;
gboolean result;
PlumaFileBrowserPluginData *data;
XeditFileBrowserPluginData *data;
data = get_plugin_data (window);
@@ -1123,7 +1123,7 @@ on_confirm_delete_cb (PlumaFileBrowserWidget *widget,
secondary = _("If you delete an item, it is permanently lost.");
result = pluma_file_browser_utils_confirmation_dialog (window,
result = xedit_file_browser_utils_confirmation_dialog (window,
GTK_MESSAGE_QUESTION,
message,
secondary,

View File

@@ -0,0 +1,71 @@
/*
* xedit-file-browser-plugin.h - Xedit plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __XEDIT_FILE_BROWSER_PLUGIN_H__
#define __XEDIT_FILE_BROWSER_PLUGIN_H__
#include <glib.h>
#include <glib-object.h>
#include <xedit/xedit-plugin.h>
G_BEGIN_DECLS
/*
* Type checking and casting macros
*/
#define XEDIT_TYPE_FILE_BROWSER_PLUGIN (filetree_plugin_get_type ())
#define XEDIT_FILE_BROWSER_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XEDIT_TYPE_FILE_BROWSER_PLUGIN, XeditFileBrowserPlugin))
#define XEDIT_FILE_BROWSER_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XEDIT_TYPE_FILE_BROWSER_PLUGIN, XeditFileBrowserPluginClass))
#define XEDIT_IS_FILE_BROWSER_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XEDIT_TYPE_FILE_BROWSER_PLUGIN))
#define XEDIT_IS_FILE_BROWSER_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XEDIT_TYPE_FILE_BROWSER_PLUGIN))
#define XEDIT_FILE_BROWSER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XEDIT_TYPE_FILE_BROWSER_PLUGIN, XeditFileBrowserPluginClass))
/* Private structure type */
typedef struct _XeditFileBrowserPluginPrivate XeditFileBrowserPluginPrivate;
typedef struct _XeditFileBrowserPlugin XeditFileBrowserPlugin;
typedef struct _XeditFileBrowserPluginClass XeditFileBrowserPluginClass;
struct _XeditFileBrowserPlugin
{
XeditPlugin parent_instance;
/*< private > */
XeditFileBrowserPluginPrivate *priv;
};
struct _XeditFileBrowserPluginClass
{
XeditPluginClass 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_xedit_plugin (GTypeModule * module);
G_END_DECLS
#endif /* __XEDIT_FILE_BROWSER_PLUGIN_H__ */
// ex:ts=8:noet:

View File

@@ -0,0 +1,200 @@
/*
* xedit-file-browser-store.h - Xedit plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __XEDIT_FILE_BROWSER_STORE_H__
#define __XEDIT_FILE_BROWSER_STORE_H__
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define XEDIT_TYPE_FILE_BROWSER_STORE (xedit_file_browser_store_get_type ())
#define XEDIT_FILE_BROWSER_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XEDIT_TYPE_FILE_BROWSER_STORE, XeditFileBrowserStore))
#define XEDIT_FILE_BROWSER_STORE_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XEDIT_TYPE_FILE_BROWSER_STORE, XeditFileBrowserStore const))
#define XEDIT_FILE_BROWSER_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XEDIT_TYPE_FILE_BROWSER_STORE, XeditFileBrowserStoreClass))
#define XEDIT_IS_FILE_BROWSER_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XEDIT_TYPE_FILE_BROWSER_STORE))
#define XEDIT_IS_FILE_BROWSER_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XEDIT_TYPE_FILE_BROWSER_STORE))
#define XEDIT_FILE_BROWSER_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XEDIT_TYPE_FILE_BROWSER_STORE, XeditFileBrowserStoreClass))
typedef enum
{
XEDIT_FILE_BROWSER_STORE_COLUMN_ICON = 0,
XEDIT_FILE_BROWSER_STORE_COLUMN_NAME,
XEDIT_FILE_BROWSER_STORE_COLUMN_URI,
XEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS,
XEDIT_FILE_BROWSER_STORE_COLUMN_EMBLEM,
XEDIT_FILE_BROWSER_STORE_COLUMN_NUM
} XeditFileBrowserStoreColumn;
typedef enum
{
XEDIT_FILE_BROWSER_STORE_FLAG_IS_DIRECTORY = 1 << 0,
XEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN = 1 << 1,
XEDIT_FILE_BROWSER_STORE_FLAG_IS_TEXT = 1 << 2,
XEDIT_FILE_BROWSER_STORE_FLAG_LOADED = 1 << 3,
XEDIT_FILE_BROWSER_STORE_FLAG_IS_FILTERED = 1 << 4,
XEDIT_FILE_BROWSER_STORE_FLAG_IS_DUMMY = 1 << 5
} XeditFileBrowserStoreFlag;
typedef enum
{
XEDIT_FILE_BROWSER_STORE_RESULT_OK,
XEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE,
XEDIT_FILE_BROWSER_STORE_RESULT_ERROR,
XEDIT_FILE_BROWSER_STORE_RESULT_NO_TRASH,
XEDIT_FILE_BROWSER_STORE_RESULT_MOUNTING,
XEDIT_FILE_BROWSER_STORE_RESULT_NUM
} XeditFileBrowserStoreResult;
typedef enum
{
XEDIT_FILE_BROWSER_STORE_FILTER_MODE_NONE = 0,
XEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN = 1 << 0,
XEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY = 1 << 1
} XeditFileBrowserStoreFilterMode;
#define FILE_IS_DIR(flags) (flags & XEDIT_FILE_BROWSER_STORE_FLAG_IS_DIRECTORY)
#define FILE_IS_HIDDEN(flags) (flags & XEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN)
#define FILE_IS_TEXT(flags) (flags & XEDIT_FILE_BROWSER_STORE_FLAG_IS_TEXT)
#define FILE_LOADED(flags) (flags & XEDIT_FILE_BROWSER_STORE_FLAG_LOADED)
#define FILE_IS_FILTERED(flags) (flags & XEDIT_FILE_BROWSER_STORE_FLAG_IS_FILTERED)
#define FILE_IS_DUMMY(flags) (flags & XEDIT_FILE_BROWSER_STORE_FLAG_IS_DUMMY)
typedef struct _XeditFileBrowserStore XeditFileBrowserStore;
typedef struct _XeditFileBrowserStoreClass XeditFileBrowserStoreClass;
typedef struct _XeditFileBrowserStorePrivate XeditFileBrowserStorePrivate;
typedef gboolean (*XeditFileBrowserStoreFilterFunc) (XeditFileBrowserStore
* model,
GtkTreeIter * iter,
gpointer user_data);
struct _XeditFileBrowserStore
{
GObject parent;
XeditFileBrowserStorePrivate *priv;
};
struct _XeditFileBrowserStoreClass {
GObjectClass parent_class;
/* Signals */
void (*begin_loading) (XeditFileBrowserStore * model,
GtkTreeIter * iter);
void (*end_loading) (XeditFileBrowserStore * model,
GtkTreeIter * iter);
void (*error) (XeditFileBrowserStore * model,
guint code,
gchar * message);
gboolean (*no_trash) (XeditFileBrowserStore * model,
GList * files);
void (*rename) (XeditFileBrowserStore * model,
const gchar * olduri,
const gchar * newuri);
void (*begin_refresh) (XeditFileBrowserStore * model);
void (*end_refresh) (XeditFileBrowserStore * model);
void (*unload) (XeditFileBrowserStore * model,
const gchar * uri);
};
GType xedit_file_browser_store_get_type (void) G_GNUC_CONST;
GType xedit_file_browser_store_register_type (GTypeModule * module);
XeditFileBrowserStore *xedit_file_browser_store_new (gchar const *root);
XeditFileBrowserStoreResult
xedit_file_browser_store_set_root_and_virtual_root (XeditFileBrowserStore * model,
gchar const *root,
gchar const *virtual_root);
XeditFileBrowserStoreResult
xedit_file_browser_store_set_root (XeditFileBrowserStore * model,
gchar const *root);
XeditFileBrowserStoreResult
xedit_file_browser_store_set_virtual_root (XeditFileBrowserStore * model,
GtkTreeIter * iter);
XeditFileBrowserStoreResult
xedit_file_browser_store_set_virtual_root_from_string (XeditFileBrowserStore * model,
gchar const *root);
XeditFileBrowserStoreResult
xedit_file_browser_store_set_virtual_root_up (XeditFileBrowserStore * model);
XeditFileBrowserStoreResult
xedit_file_browser_store_set_virtual_root_top (XeditFileBrowserStore * model);
gboolean
xedit_file_browser_store_get_iter_virtual_root (XeditFileBrowserStore * model,
GtkTreeIter * iter);
gboolean xedit_file_browser_store_get_iter_root (XeditFileBrowserStore * model,
GtkTreeIter * iter);
gchar * xedit_file_browser_store_get_root (XeditFileBrowserStore * model);
gchar * xedit_file_browser_store_get_virtual_root (XeditFileBrowserStore * model);
gboolean xedit_file_browser_store_iter_equal (XeditFileBrowserStore * model,
GtkTreeIter * iter1,
GtkTreeIter * iter2);
void xedit_file_browser_store_set_value (XeditFileBrowserStore * tree_model,
GtkTreeIter * iter,
gint column,
GValue * value);
void _xedit_file_browser_store_iter_expanded (XeditFileBrowserStore * model,
GtkTreeIter * iter);
void _xedit_file_browser_store_iter_collapsed (XeditFileBrowserStore * model,
GtkTreeIter * iter);
XeditFileBrowserStoreFilterMode
xedit_file_browser_store_get_filter_mode (XeditFileBrowserStore * model);
void xedit_file_browser_store_set_filter_mode (XeditFileBrowserStore * model,
XeditFileBrowserStoreFilterMode mode);
void xedit_file_browser_store_set_filter_func (XeditFileBrowserStore * model,
XeditFileBrowserStoreFilterFunc func,
gpointer user_data);
void xedit_file_browser_store_refilter (XeditFileBrowserStore * model);
XeditFileBrowserStoreFilterMode
xedit_file_browser_store_filter_mode_get_default (void);
void xedit_file_browser_store_refresh (XeditFileBrowserStore * model);
gboolean xedit_file_browser_store_rename (XeditFileBrowserStore * model,
GtkTreeIter * iter,
gchar const *new_name,
GError ** error);
XeditFileBrowserStoreResult
xedit_file_browser_store_delete (XeditFileBrowserStore * model,
GtkTreeIter * iter,
gboolean trash);
XeditFileBrowserStoreResult
xedit_file_browser_store_delete_all (XeditFileBrowserStore * model,
GList *rows,
gboolean trash);
gboolean xedit_file_browser_store_new_file (XeditFileBrowserStore * model,
GtkTreeIter * parent,
GtkTreeIter * iter);
gboolean xedit_file_browser_store_new_directory (XeditFileBrowserStore * model,
GtkTreeIter * parent,
GtkTreeIter * iter);
void xedit_file_browser_store_cancel_mount_operation (XeditFileBrowserStore *store);
G_END_DECLS
#endif /* __XEDIT_FILE_BROWSER_STORE_H__ */
// ex:ts=8:noet:

View File

@@ -1,5 +1,5 @@
/*
* pluma-file-bookmarks-store.c - Pluma plugin providing easy file access
* xedit-file-bookmarks-store.c - Xedit plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
@@ -19,8 +19,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "pluma-file-browser-utils.h"
#include <pluma/pluma-utils.h>
#include "xedit-file-browser-utils.h"
#include <xedit/xedit-utils.h>
static GdkPixbuf *
process_icon_pixbuf (GdkPixbuf * pixbuf,
@@ -50,7 +50,7 @@ process_icon_pixbuf (GdkPixbuf * pixbuf,
}
GdkPixbuf *
pluma_file_browser_utils_pixbuf_from_theme (gchar const * name,
xedit_file_browser_utils_pixbuf_from_theme (gchar const * name,
GtkIconSize size)
{
gint width;
@@ -71,7 +71,7 @@ pluma_file_browser_utils_pixbuf_from_theme (gchar const * name,
}
GdkPixbuf *
pluma_file_browser_utils_pixbuf_from_icon (GIcon * icon,
xedit_file_browser_utils_pixbuf_from_icon (GIcon * icon,
GtkIconSize size)
{
GdkPixbuf * ret = NULL;
@@ -100,7 +100,7 @@ pluma_file_browser_utils_pixbuf_from_icon (GIcon * icon,
}
GdkPixbuf *
pluma_file_browser_utils_pixbuf_from_file (GFile * file,
xedit_file_browser_utils_pixbuf_from_file (GFile * file,
GtkIconSize size)
{
GIcon * icon;
@@ -118,7 +118,7 @@ pluma_file_browser_utils_pixbuf_from_file (GFile * file,
icon = g_file_info_get_icon (info);
if (icon != NULL)
ret = pluma_file_browser_utils_pixbuf_from_icon (icon, size);
ret = xedit_file_browser_utils_pixbuf_from_icon (icon, size);
g_object_unref (info);
@@ -126,26 +126,26 @@ pluma_file_browser_utils_pixbuf_from_file (GFile * file,
}
gchar *
pluma_file_browser_utils_file_basename (GFile * file)
xedit_file_browser_utils_file_basename (GFile * file)
{
gchar *uri;
gchar *ret;
uri = g_file_get_uri (file);
ret = pluma_file_browser_utils_uri_basename (uri);
ret = xedit_file_browser_utils_uri_basename (uri);
g_free (uri);
return ret;
}
gchar *
pluma_file_browser_utils_uri_basename (gchar const * uri)
xedit_file_browser_utils_uri_basename (gchar const * uri)
{
return pluma_utils_basename_for_display (uri);
return xedit_utils_basename_for_display (uri);
}
gboolean
pluma_file_browser_utils_confirmation_dialog (PlumaWindow * window,
xedit_file_browser_utils_confirmation_dialog (XeditWindow * window,
GtkMessageType type,
gchar const *message,
gchar const *secondary,

View File

@@ -1,27 +1,27 @@
#ifndef __PLUMA_FILE_BROWSER_UTILS_H__
#define __PLUMA_FILE_BROWSER_UTILS_H__
#ifndef __XEDIT_FILE_BROWSER_UTILS_H__
#define __XEDIT_FILE_BROWSER_UTILS_H__
#include <pluma/pluma-window.h>
#include <xedit/xedit-window.h>
#include <gio/gio.h>
GdkPixbuf *pluma_file_browser_utils_pixbuf_from_theme (gchar const *name,
GdkPixbuf *xedit_file_browser_utils_pixbuf_from_theme (gchar const *name,
GtkIconSize size);
GdkPixbuf *pluma_file_browser_utils_pixbuf_from_icon (GIcon * icon,
GdkPixbuf *xedit_file_browser_utils_pixbuf_from_icon (GIcon * icon,
GtkIconSize size);
GdkPixbuf *pluma_file_browser_utils_pixbuf_from_file (GFile * file,
GdkPixbuf *xedit_file_browser_utils_pixbuf_from_file (GFile * file,
GtkIconSize size);
gchar * pluma_file_browser_utils_file_basename (GFile * file);
gchar * pluma_file_browser_utils_uri_basename (gchar const * uri);
gchar * xedit_file_browser_utils_file_basename (GFile * file);
gchar * xedit_file_browser_utils_uri_basename (gchar const * uri);
gboolean pluma_file_browser_utils_confirmation_dialog (PlumaWindow * window,
gboolean xedit_file_browser_utils_confirmation_dialog (XeditWindow * window,
GtkMessageType type,
gchar const *message,
gchar const *secondary,
gchar const * button_stock,
gchar const * button_label);
#endif /* __PLUMA_FILE_BROWSER_UTILS_H__ */
#endif /* __XEDIT_FILE_BROWSER_UTILS_H__ */
// ex:ts=8:noet:

View File

@@ -1,5 +1,5 @@
/*
* pluma-file-browser-view.c - Pluma plugin providing easy file access
* xedit-file-browser-view.c - Xedit plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
@@ -21,21 +21,21 @@
#include <string.h>
#include <gio/gio.h>
#include <pluma/pluma-plugin.h>
#include <xedit/xedit-plugin.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.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"
#include "xedit-file-browser-store.h"
#include "xedit-file-bookmarks-store.h"
#include "xedit-file-browser-view.h"
#include "xedit-file-browser-marshal.h"
#include "xedit-file-browser-enum-types.h"
#define PLUMA_FILE_BROWSER_VIEW_GET_PRIVATE(object)( \
#define XEDIT_FILE_BROWSER_VIEW_GET_PRIVATE(object)( \
G_TYPE_INSTANCE_GET_PRIVATE((object), \
PLUMA_TYPE_FILE_BROWSER_VIEW, PlumaFileBrowserViewPrivate))
XEDIT_TYPE_FILE_BROWSER_VIEW, XeditFileBrowserViewPrivate))
struct _PlumaFileBrowserViewPrivate
struct _XeditFileBrowserViewPrivate
{
GtkTreeViewColumn *column;
GtkCellRenderer *pixbuf_renderer;
@@ -47,7 +47,7 @@ struct _PlumaFileBrowserViewPrivate
GdkCursor *busy_cursor;
/* CLick policy */
PlumaFileBrowserViewClickPolicy click_policy;
XeditFileBrowserViewClickPolicy 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;
@@ -86,32 +86,32 @@ static const GtkTargetEntry drag_source_targets[] = {
{ "text/uri-list", 0, 0 }
};
PLUMA_PLUGIN_DEFINE_TYPE (PlumaFileBrowserView, pluma_file_browser_view,
XEDIT_PLUGIN_DEFINE_TYPE (XeditFileBrowserView, xedit_file_browser_view,
GTK_TYPE_TREE_VIEW)
static void on_cell_edited (GtkCellRendererText * cell,
gchar * path,
gchar * new_text,
PlumaFileBrowserView * tree_view);
XeditFileBrowserView * tree_view);
static void on_begin_refresh (PlumaFileBrowserStore * model,
PlumaFileBrowserView * view);
static void on_end_refresh (PlumaFileBrowserStore * model,
PlumaFileBrowserView * view);
static void on_begin_refresh (XeditFileBrowserStore * model,
XeditFileBrowserView * view);
static void on_end_refresh (XeditFileBrowserStore * model,
XeditFileBrowserView * view);
static void on_unload (PlumaFileBrowserStore * model,
static void on_unload (XeditFileBrowserStore * model,
gchar const * uri,
PlumaFileBrowserView * view);
XeditFileBrowserView * view);
static void on_row_inserted (PlumaFileBrowserStore * model,
static void on_row_inserted (XeditFileBrowserStore * model,
GtkTreePath * path,
GtkTreeIter * iter,
PlumaFileBrowserView * view);
XeditFileBrowserView * view);
static void
pluma_file_browser_view_finalize (GObject * object)
xedit_file_browser_view_finalize (GObject * object)
{
PlumaFileBrowserView *obj = PLUMA_FILE_BROWSER_VIEW(object);
XeditFileBrowserView *obj = XEDIT_FILE_BROWSER_VIEW(object);
if (obj->priv->hand_cursor)
#if GTK_CHECK_VERSION (3, 0, 0)
@@ -135,12 +135,12 @@ pluma_file_browser_view_finalize (GObject * object)
gdk_cursor_unref (obj->priv->busy_cursor);
#endif
G_OBJECT_CLASS (pluma_file_browser_view_parent_class)->
G_OBJECT_CLASS (xedit_file_browser_view_parent_class)->
finalize (object);
}
static void
add_expand_state (PlumaFileBrowserView * view,
add_expand_state (XeditFileBrowserView * view,
gchar const * uri)
{
GFile * file;
@@ -157,7 +157,7 @@ add_expand_state (PlumaFileBrowserView * view,
}
static void
remove_expand_state (PlumaFileBrowserView * view,
remove_expand_state (XeditFileBrowserView * view,
gchar const * uri)
{
GFile * file;
@@ -178,20 +178,20 @@ row_expanded (GtkTreeView * tree_view,
GtkTreeIter * iter,
GtkTreePath * path)
{
PlumaFileBrowserView *view = PLUMA_FILE_BROWSER_VIEW (tree_view);
XeditFileBrowserView *view = XEDIT_FILE_BROWSER_VIEW (tree_view);
gchar * uri;
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 (GTK_TREE_VIEW_CLASS (xedit_file_browser_view_parent_class)->row_expanded)
GTK_TREE_VIEW_CLASS (xedit_file_browser_view_parent_class)->row_expanded (tree_view, iter, path);
if (!PLUMA_IS_FILE_BROWSER_STORE (view->priv->model))
if (!XEDIT_IS_FILE_BROWSER_STORE (view->priv->model))
return;
if (view->priv->restore_expand_state)
{
gtk_tree_model_get (view->priv->model,
iter,
PLUMA_FILE_BROWSER_STORE_COLUMN_URI,
XEDIT_FILE_BROWSER_STORE_COLUMN_URI,
&uri,
-1);
@@ -199,7 +199,7 @@ row_expanded (GtkTreeView * tree_view,
g_free (uri);
}
_pluma_file_browser_store_iter_expanded (PLUMA_FILE_BROWSER_STORE (view->priv->model),
_xedit_file_browser_store_iter_expanded (XEDIT_FILE_BROWSER_STORE (view->priv->model),
iter);
}
@@ -208,20 +208,20 @@ row_collapsed (GtkTreeView * tree_view,
GtkTreeIter * iter,
GtkTreePath * path)
{
PlumaFileBrowserView *view = PLUMA_FILE_BROWSER_VIEW (tree_view);
XeditFileBrowserView *view = XEDIT_FILE_BROWSER_VIEW (tree_view);
gchar * uri;
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 (GTK_TREE_VIEW_CLASS (xedit_file_browser_view_parent_class)->row_collapsed)
GTK_TREE_VIEW_CLASS (xedit_file_browser_view_parent_class)->row_collapsed (tree_view, iter, path);
if (!PLUMA_IS_FILE_BROWSER_STORE (view->priv->model))
if (!XEDIT_IS_FILE_BROWSER_STORE (view->priv->model))
return;
if (view->priv->restore_expand_state)
{
gtk_tree_model_get (view->priv->model,
iter,
PLUMA_FILE_BROWSER_STORE_COLUMN_URI,
XEDIT_FILE_BROWSER_STORE_COLUMN_URI,
&uri,
-1);
@@ -229,7 +229,7 @@ row_collapsed (GtkTreeView * tree_view,
g_free (uri);
}
_pluma_file_browser_store_iter_collapsed (PLUMA_FILE_BROWSER_STORE (view->priv->model),
_xedit_file_browser_store_iter_collapsed (XEDIT_FILE_BROWSER_STORE (view->priv->model),
iter);
}
@@ -237,25 +237,25 @@ static gboolean
leave_notify_event (GtkWidget *widget,
GdkEventCrossing *event)
{
PlumaFileBrowserView *view = PLUMA_FILE_BROWSER_VIEW (widget);
XeditFileBrowserView *view = XEDIT_FILE_BROWSER_VIEW (widget);
if (view->priv->click_policy == PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE &&
if (view->priv->click_policy == XEDIT_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 (pluma_file_browser_view_parent_class)->leave_notify_event (widget, event);
return GTK_WIDGET_CLASS (xedit_file_browser_view_parent_class)->leave_notify_event (widget, event);
}
static gboolean
enter_notify_event (GtkWidget *widget,
GdkEventCrossing *event)
{
PlumaFileBrowserView *view = PLUMA_FILE_BROWSER_VIEW (widget);
XeditFileBrowserView *view = XEDIT_FILE_BROWSER_VIEW (widget);
if (view->priv->click_policy == PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) {
if (view->priv->click_policy == XEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) {
if (view->priv->hover_path != NULL)
gtk_tree_path_free (view->priv->hover_path);
@@ -270,7 +270,7 @@ enter_notify_event (GtkWidget *widget,
}
// Chainup
return GTK_WIDGET_CLASS (pluma_file_browser_view_parent_class)->enter_notify_event (widget, event);
return GTK_WIDGET_CLASS (xedit_file_browser_view_parent_class)->enter_notify_event (widget, event);
}
static gboolean
@@ -278,9 +278,9 @@ motion_notify_event (GtkWidget * widget,
GdkEventMotion * event)
{
GtkTreePath *old_hover_path;
PlumaFileBrowserView *view = PLUMA_FILE_BROWSER_VIEW (widget);
XeditFileBrowserView *view = XEDIT_FILE_BROWSER_VIEW (widget);
if (view->priv->click_policy == PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) {
if (view->priv->click_policy == XEDIT_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,
@@ -301,12 +301,12 @@ motion_notify_event (GtkWidget * widget,
}
// Chainup
return GTK_WIDGET_CLASS (pluma_file_browser_view_parent_class)->motion_notify_event (widget, event);
return GTK_WIDGET_CLASS (xedit_file_browser_view_parent_class)->motion_notify_event (widget, event);
}
static void
set_click_policy_property (PlumaFileBrowserView *obj,
PlumaFileBrowserViewClickPolicy click_policy)
set_click_policy_property (XeditFileBrowserView *obj,
XeditFileBrowserViewClickPolicy click_policy)
{
GtkTreeIter iter;
GdkDisplay *display;
@@ -314,7 +314,7 @@ set_click_policy_property (PlumaFileBrowserView *obj,
obj->priv->click_policy = click_policy;
if (click_policy == PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) {
if (click_policy == XEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) {
if (obj->priv->hand_cursor == NULL)
#if GTK_CHECK_VERSION (3, 16, 0)
display = gtk_widget_get_display (GTK_WIDGET (obj));
@@ -322,7 +322,7 @@ set_click_policy_property (PlumaFileBrowserView *obj,
#else
obj->priv->hand_cursor = gdk_cursor_new(GDK_HAND2);
#endif
} else if (click_policy == PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE) {
} else if (click_policy == XEDIT_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))
@@ -355,21 +355,21 @@ set_click_policy_property (PlumaFileBrowserView *obj,
}
static void
directory_activated (PlumaFileBrowserView *view,
directory_activated (XeditFileBrowserView *view,
GtkTreeIter *iter)
{
pluma_file_browser_store_set_virtual_root (PLUMA_FILE_BROWSER_STORE (view->priv->model), iter);
xedit_file_browser_store_set_virtual_root (XEDIT_FILE_BROWSER_STORE (view->priv->model), iter);
}
static void
activate_selected_files (PlumaFileBrowserView *view) {
activate_selected_files (XeditFileBrowserView *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;
PlumaFileBrowserStoreFlag flags;
XeditFileBrowserStoreFlag flags;
rows = gtk_tree_selection_get_selected_rows (selection, &view->priv->model);
@@ -380,7 +380,7 @@ activate_selected_files (PlumaFileBrowserView *view) {
if (!gtk_tree_model_get_iter (view->priv->model, &iter, path))
continue;
gtk_tree_model_get (view->priv->model, &iter, PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, -1);
gtk_tree_model_get (view->priv->model, &iter, XEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, -1);
if (FILE_IS_DIR (flags)) {
if (directory == NULL)
@@ -401,7 +401,7 @@ activate_selected_files (PlumaFileBrowserView *view) {
}
static void
activate_selected_bookmark (PlumaFileBrowserView *view) {
activate_selected_bookmark (XeditFileBrowserView *view) {
GtkTreeView *tree_view = GTK_TREE_VIEW (view);
GtkTreeSelection *selection = gtk_tree_view_get_selection (tree_view);
GtkTreeIter iter;
@@ -411,26 +411,26 @@ activate_selected_bookmark (PlumaFileBrowserView *view) {
}
static void
activate_selected_items (PlumaFileBrowserView *view)
activate_selected_items (XeditFileBrowserView *view)
{
if (PLUMA_IS_FILE_BROWSER_STORE (view->priv->model))
if (XEDIT_IS_FILE_BROWSER_STORE (view->priv->model))
activate_selected_files (view);
else if (PLUMA_IS_FILE_BOOKMARKS_STORE (view->priv->model))
else if (XEDIT_IS_FILE_BOOKMARKS_STORE (view->priv->model))
activate_selected_bookmark (view);
}
static void
toggle_hidden_filter (PlumaFileBrowserView *view)
toggle_hidden_filter (XeditFileBrowserView *view)
{
PlumaFileBrowserStoreFilterMode mode;
XeditFileBrowserStoreFilterMode mode;
if (PLUMA_IS_FILE_BROWSER_STORE (view->priv->model))
if (XEDIT_IS_FILE_BROWSER_STORE (view->priv->model))
{
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);
mode = xedit_file_browser_store_get_filter_mode
(XEDIT_FILE_BROWSER_STORE (view->priv->model));
mode ^= XEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN;
xedit_file_browser_store_set_filter_mode
(XEDIT_FILE_BROWSER_STORE (view->priv->model), mode);
}
}
@@ -444,17 +444,17 @@ static void
drag_begin (GtkWidget *widget,
GdkDragContext *context)
{
PlumaFileBrowserView *view = PLUMA_FILE_BROWSER_VIEW (widget);
XeditFileBrowserView *view = XEDIT_FILE_BROWSER_VIEW (widget);
view->priv->drag_button = 0;
view->priv->drag_started = TRUE;
/* Chain up */
GTK_WIDGET_CLASS (pluma_file_browser_view_parent_class)->drag_begin (widget, context);
GTK_WIDGET_CLASS (xedit_file_browser_view_parent_class)->drag_begin (widget, context);
}
static void
did_not_drag (PlumaFileBrowserView *view,
did_not_drag (XeditFileBrowserView *view,
GdkEventButton *event)
{
GtkTreeView *tree_view;
@@ -466,7 +466,7 @@ did_not_drag (PlumaFileBrowserView *view,
if (gtk_tree_view_get_path_at_pos (tree_view, event->x, event->y,
&path, NULL, NULL, NULL)) {
if ((view->priv->click_policy == PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE)
if ((view->priv->click_policy == XEDIT_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 */
@@ -491,7 +491,7 @@ static gboolean
button_release_event (GtkWidget *widget,
GdkEventButton *event)
{
PlumaFileBrowserView *view = PLUMA_FILE_BROWSER_VIEW (widget);
XeditFileBrowserView *view = XEDIT_FILE_BROWSER_VIEW (widget);
if (event->button == view->priv->drag_button) {
view->priv->drag_button = 0;
@@ -502,7 +502,7 @@ button_release_event (GtkWidget *widget,
}
/* Chain up */
return GTK_WIDGET_CLASS (pluma_file_browser_view_parent_class)->button_release_event (widget, event);
return GTK_WIDGET_CLASS (xedit_file_browser_view_parent_class)->button_release_event (widget, event);
}
static gboolean
@@ -512,7 +512,7 @@ button_press_event (GtkWidget *widget,
int double_click_time;
static int click_count = 0;
static guint32 last_click_time = 0;
PlumaFileBrowserView *view;
XeditFileBrowserView *view;
GtkTreeView *tree_view;
GtkTreeSelection *selection;
GtkTreePath *path;
@@ -521,10 +521,10 @@ button_press_event (GtkWidget *widget,
gboolean on_expander;
gboolean call_parent;
gboolean selected;
GtkWidgetClass *widget_parent = GTK_WIDGET_CLASS(pluma_file_browser_view_parent_class);
GtkWidgetClass *widget_parent = GTK_WIDGET_CLASS(xedit_file_browser_view_parent_class);
tree_view = GTK_TREE_VIEW (widget);
view = PLUMA_FILE_BROWSER_VIEW (widget);
view = XEDIT_FILE_BROWSER_VIEW (widget);
selection = gtk_tree_view_get_selection (tree_view);
/* Get double click time */
@@ -541,7 +541,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 == PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE &&
if (view->priv->click_policy == XEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE &&
click_count >= 2) {
return TRUE;
}
@@ -594,7 +594,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 != PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE;
view->priv->ignore_release = call_parent && view->priv->click_policy != XEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE;
} else if ((event->state & GDK_CONTROL_MASK) != 0) {
call_parent = FALSE;
gtk_tree_selection_select_path (selection, path);
@@ -641,11 +641,11 @@ static gboolean
key_press_event (GtkWidget *widget,
GdkEventKey *event)
{
PlumaFileBrowserView *view;
XeditFileBrowserView *view;
guint modifiers;
gboolean handled;
view = PLUMA_FILE_BROWSER_VIEW (widget);
view = XEDIT_FILE_BROWSER_VIEW (widget);
handled = FALSE;
modifiers = gtk_accelerator_get_default_mod_mask ();
@@ -684,13 +684,13 @@ key_press_event (GtkWidget *widget,
/* Chain up */
if (!handled)
return GTK_WIDGET_CLASS (pluma_file_browser_view_parent_class)->key_press_event (widget, event);
return GTK_WIDGET_CLASS (xedit_file_browser_view_parent_class)->key_press_event (widget, event);
return TRUE;
}
static void
fill_expand_state (PlumaFileBrowserView * view, GtkTreeIter * iter)
fill_expand_state (XeditFileBrowserView * view, GtkTreeIter * iter)
{
GtkTreePath * path;
GtkTreeIter child;
@@ -705,7 +705,7 @@ fill_expand_state (PlumaFileBrowserView * view, GtkTreeIter * iter)
{
gtk_tree_model_get (view->priv->model,
iter,
PLUMA_FILE_BROWSER_STORE_COLUMN_URI,
XEDIT_FILE_BROWSER_STORE_COLUMN_URI,
&uri,
-1);
@@ -724,7 +724,7 @@ fill_expand_state (PlumaFileBrowserView * view, GtkTreeIter * iter)
}
static void
uninstall_restore_signals (PlumaFileBrowserView * tree_view,
uninstall_restore_signals (XeditFileBrowserView * tree_view,
GtkTreeModel * model)
{
g_signal_handlers_disconnect_by_func (model,
@@ -745,7 +745,7 @@ uninstall_restore_signals (PlumaFileBrowserView * tree_view,
}
static void
install_restore_signals (PlumaFileBrowserView * tree_view,
install_restore_signals (XeditFileBrowserView * tree_view,
GtkTreeModel * model)
{
g_signal_connect (model,
@@ -770,7 +770,7 @@ install_restore_signals (PlumaFileBrowserView * tree_view,
}
static void
set_restore_expand_state (PlumaFileBrowserView * view,
set_restore_expand_state (XeditFileBrowserView * view,
gboolean state)
{
if (state == view->priv->restore_expand_state)
@@ -789,14 +789,14 @@ set_restore_expand_state (PlumaFileBrowserView * view,
g_object_unref,
NULL);
if (view->priv->model && PLUMA_IS_FILE_BROWSER_STORE (view->priv->model))
if (view->priv->model && XEDIT_IS_FILE_BROWSER_STORE (view->priv->model))
{
fill_expand_state (view, NULL);
install_restore_signals (view, view->priv->model);
}
}
else if (view->priv->model && PLUMA_IS_FILE_BROWSER_STORE (view->priv->model))
else if (view->priv->model && XEDIT_IS_FILE_BROWSER_STORE (view->priv->model))
{
uninstall_restore_signals (view, view->priv->model);
}
@@ -810,7 +810,7 @@ get_property (GObject *object,
GValue *value,
GParamSpec *pspec)
{
PlumaFileBrowserView *obj = PLUMA_FILE_BROWSER_VIEW (object);
XeditFileBrowserView *obj = XEDIT_FILE_BROWSER_VIEW (object);
switch (prop_id)
{
@@ -832,7 +832,7 @@ set_property (GObject *object,
const GValue *value,
GParamSpec *pspec)
{
PlumaFileBrowserView *obj = PLUMA_FILE_BROWSER_VIEW (object);
XeditFileBrowserView *obj = XEDIT_FILE_BROWSER_VIEW (object);
switch (prop_id)
{
@@ -849,13 +849,13 @@ set_property (GObject *object,
}
static void
pluma_file_browser_view_class_init (PlumaFileBrowserViewClass * klass)
xedit_file_browser_view_class_init (XeditFileBrowserViewClass * 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 = pluma_file_browser_view_finalize;
object_class->finalize = xedit_file_browser_view_finalize;
object_class->get_property = get_property;
object_class->set_property = set_property;
@@ -879,8 +879,8 @@ pluma_file_browser_view_class_init (PlumaFileBrowserViewClass * klass)
g_param_spec_enum ("click-policy",
"Click Policy",
"The click policy",
PLUMA_TYPE_FILE_BROWSER_VIEW_CLICK_POLICY,
PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE,
XEDIT_TYPE_FILE_BROWSER_VIEW_CLICK_POLICY,
XEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
g_object_class_install_property (object_class, PROP_RESTORE_EXPAND_STATE,
@@ -894,15 +894,15 @@ pluma_file_browser_view_class_init (PlumaFileBrowserViewClass * klass)
g_signal_new ("error",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (PlumaFileBrowserViewClass,
G_STRUCT_OFFSET (XeditFileBrowserViewClass,
error), NULL, NULL,
pluma_file_browser_marshal_VOID__UINT_STRING,
xedit_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 (PlumaFileBrowserViewClass,
G_STRUCT_OFFSET (XeditFileBrowserViewClass,
file_activated), NULL, NULL,
g_cclosure_marshal_VOID__BOXED,
G_TYPE_NONE, 1, GTK_TYPE_TREE_ITER);
@@ -910,7 +910,7 @@ pluma_file_browser_view_class_init (PlumaFileBrowserViewClass * klass)
g_signal_new ("directory-activated",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (PlumaFileBrowserViewClass,
G_STRUCT_OFFSET (XeditFileBrowserViewClass,
directory_activated), NULL, NULL,
g_cclosure_marshal_VOID__BOXED,
G_TYPE_NONE, 1, GTK_TYPE_TREE_ITER);
@@ -918,19 +918,19 @@ pluma_file_browser_view_class_init (PlumaFileBrowserViewClass * klass)
g_signal_new ("bookmark-activated",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (PlumaFileBrowserViewClass,
G_STRUCT_OFFSET (XeditFileBrowserViewClass,
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 (PlumaFileBrowserViewPrivate));
sizeof (XeditFileBrowserViewPrivate));
}
static void
cell_data_cb (GtkTreeViewColumn * tree_column, GtkCellRenderer * cell,
GtkTreeModel * tree_model, GtkTreeIter * iter,
PlumaFileBrowserView * obj)
XeditFileBrowserView * obj)
{
GtkTreePath *path;
PangoUnderline underline = PANGO_UNDERLINE_NONE;
@@ -938,13 +938,13 @@ cell_data_cb (GtkTreeViewColumn * tree_column, GtkCellRenderer * cell,
path = gtk_tree_model_get_path (tree_model, iter);
if (obj->priv->click_policy == PLUMA_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) {
if (obj->priv->click_policy == XEDIT_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 (PLUMA_IS_FILE_BROWSER_STORE (tree_model))
if (XEDIT_IS_FILE_BROWSER_STORE (tree_model))
{
if (obj->priv->editable != NULL &&
gtk_tree_row_reference_valid (obj->priv->editable))
@@ -960,12 +960,12 @@ cell_data_cb (GtkTreeViewColumn * tree_column, GtkCellRenderer * cell,
}
static void
pluma_file_browser_view_init (PlumaFileBrowserView * obj)
xedit_file_browser_view_init (XeditFileBrowserView * obj)
{
#if GTK_CHECK_VERSION (3, 16, 0)
GdkDisplay *display;
#endif
obj->priv = PLUMA_FILE_BROWSER_VIEW_GET_PRIVATE (obj);
obj->priv = XEDIT_FILE_BROWSER_VIEW_GET_PRIVATE (obj);
obj->priv->column = gtk_tree_view_column_new ();
@@ -976,7 +976,7 @@ pluma_file_browser_view_init (PlumaFileBrowserView * obj)
gtk_tree_view_column_add_attribute (obj->priv->column,
obj->priv->pixbuf_renderer,
"pixbuf",
PLUMA_FILE_BROWSER_STORE_COLUMN_ICON);
XEDIT_FILE_BROWSER_STORE_COLUMN_ICON);
obj->priv->text_renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_column_pack_start (obj->priv->column,
@@ -984,7 +984,7 @@ pluma_file_browser_view_init (PlumaFileBrowserView * obj)
gtk_tree_view_column_add_attribute (obj->priv->column,
obj->priv->text_renderer,
"text",
PLUMA_FILE_BROWSER_STORE_COLUMN_NAME);
XEDIT_FILE_BROWSER_STORE_COLUMN_NAME);
g_signal_connect (obj->priv->text_renderer, "edited",
G_CALLBACK (on_cell_edited), obj);
@@ -1014,25 +1014,25 @@ bookmarks_separator_func (GtkTreeModel * model, GtkTreeIter * iter,
guint flags;
gtk_tree_model_get (model, iter,
PLUMA_FILE_BOOKMARKS_STORE_COLUMN_FLAGS,
XEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS,
&flags, -1);
return (flags & PLUMA_FILE_BOOKMARKS_STORE_IS_SEPARATOR);
return (flags & XEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR);
}
/* Public */
GtkWidget *
pluma_file_browser_view_new (void)
xedit_file_browser_view_new (void)
{
PlumaFileBrowserView *obj =
PLUMA_FILE_BROWSER_VIEW (g_object_new
(PLUMA_TYPE_FILE_BROWSER_VIEW, NULL));
XeditFileBrowserView *obj =
XEDIT_FILE_BROWSER_VIEW (g_object_new
(XEDIT_TYPE_FILE_BROWSER_VIEW, NULL));
return GTK_WIDGET (obj);
}
void
pluma_file_browser_view_set_model (PlumaFileBrowserView * tree_view,
xedit_file_browser_view_set_model (XeditFileBrowserView * tree_view,
GtkTreeModel * model)
{
GtkTreeSelection *selection;
@@ -1042,7 +1042,7 @@ pluma_file_browser_view_set_model (PlumaFileBrowserView * tree_view,
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
if (PLUMA_IS_FILE_BOOKMARKS_STORE (model)) {
if (XEDIT_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),
@@ -1078,7 +1078,7 @@ pluma_file_browser_view_set_model (PlumaFileBrowserView * tree_view,
tree_view->priv->hover_path = NULL;
}
if (PLUMA_IS_FILE_BROWSER_STORE (tree_view->priv->model)) {
if (XEDIT_IS_FILE_BROWSER_STORE (tree_view->priv->model)) {
if (tree_view->priv->restore_expand_state)
uninstall_restore_signals (tree_view,
tree_view->priv->model);
@@ -1089,20 +1089,20 @@ pluma_file_browser_view_set_model (PlumaFileBrowserView * tree_view,
}
void
pluma_file_browser_view_start_rename (PlumaFileBrowserView * tree_view,
xedit_file_browser_view_start_rename (XeditFileBrowserView * tree_view,
GtkTreeIter * iter)
{
guint flags;
GtkTreeRowReference *rowref;
GtkTreePath *path;
g_return_if_fail (PLUMA_IS_FILE_BROWSER_VIEW (tree_view));
g_return_if_fail (PLUMA_IS_FILE_BROWSER_STORE
g_return_if_fail (XEDIT_IS_FILE_BROWSER_VIEW (tree_view));
g_return_if_fail (XEDIT_IS_FILE_BROWSER_STORE
(tree_view->priv->model));
g_return_if_fail (iter != NULL);
gtk_tree_model_get (tree_view->priv->model, iter,
PLUMA_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
XEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
-1);
if (!(FILE_IS_DIR (flags) || !FILE_IS_DUMMY (flags)))
@@ -1132,10 +1132,10 @@ pluma_file_browser_view_start_rename (PlumaFileBrowserView * tree_view,
}
void
pluma_file_browser_view_set_click_policy (PlumaFileBrowserView *tree_view,
PlumaFileBrowserViewClickPolicy policy)
xedit_file_browser_view_set_click_policy (XeditFileBrowserView *tree_view,
XeditFileBrowserViewClickPolicy policy)
{
g_return_if_fail (PLUMA_IS_FILE_BROWSER_VIEW (tree_view));
g_return_if_fail (XEDIT_IS_FILE_BROWSER_VIEW (tree_view));
set_click_policy_property (tree_view, policy);
@@ -1143,10 +1143,10 @@ pluma_file_browser_view_set_click_policy (PlumaFileBrowserView *tree_view,
}
void
pluma_file_browser_view_set_restore_expand_state (PlumaFileBrowserView * tree_view,
xedit_file_browser_view_set_restore_expand_state (XeditFileBrowserView * tree_view,
gboolean restore_expand_state)
{
g_return_if_fail (PLUMA_IS_FILE_BROWSER_VIEW (tree_view));
g_return_if_fail (XEDIT_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");
@@ -1155,7 +1155,7 @@ pluma_file_browser_view_set_restore_expand_state (PlumaFileBrowserView * tree_vi
/* Signal handlers */
static void
on_cell_edited (GtkCellRendererText * cell, gchar * path, gchar * new_text,
PlumaFileBrowserView * tree_view)
XeditFileBrowserView * tree_view)
{
GtkTreePath * treepath;
GtkTreeIter iter;
@@ -1173,7 +1173,7 @@ on_cell_edited (GtkCellRendererText * cell, gchar * path, gchar * new_text,
gtk_tree_path_free (treepath);
if (ret) {
if (pluma_file_browser_store_rename (PLUMA_FILE_BROWSER_STORE (tree_view->priv->model),
if (xedit_file_browser_store_rename (XEDIT_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),
@@ -1192,8 +1192,8 @@ on_cell_edited (GtkCellRendererText * cell, gchar * path, gchar * new_text,
}
static void
on_begin_refresh (PlumaFileBrowserStore * model,
PlumaFileBrowserView * view)
on_begin_refresh (XeditFileBrowserStore * model,
XeditFileBrowserView * view)
{
/* Store the refresh state, so we can handle unloading of nodes while
refreshing properly */
@@ -1201,8 +1201,8 @@ on_begin_refresh (PlumaFileBrowserStore * model,
}
static void
on_end_refresh (PlumaFileBrowserStore * model,
PlumaFileBrowserView * view)
on_end_refresh (XeditFileBrowserStore * model,
XeditFileBrowserView * view)
{
/* Store the refresh state, so we can handle unloading of nodes while
refreshing properly */
@@ -1210,9 +1210,9 @@ on_end_refresh (PlumaFileBrowserStore * model,
}
static void
on_unload (PlumaFileBrowserStore * model,
on_unload (XeditFileBrowserStore * model,
gchar const * uri,
PlumaFileBrowserView * view)
XeditFileBrowserView * view)
{
/* Don't remove the expand state if we are refreshing */
if (!view->priv->restore_expand_state || view->priv->is_refresh)
@@ -1222,8 +1222,8 @@ on_unload (PlumaFileBrowserStore * model,
}
static void
restore_expand_state (PlumaFileBrowserView * view,
PlumaFileBrowserStore * model,
restore_expand_state (XeditFileBrowserView * view,
XeditFileBrowserStore * model,
GtkTreeIter * iter)
{
gchar * uri;
@@ -1232,7 +1232,7 @@ restore_expand_state (PlumaFileBrowserView * view,
gtk_tree_model_get (GTK_TREE_MODEL (model),
iter,
PLUMA_FILE_BROWSER_STORE_COLUMN_URI,
XEDIT_FILE_BROWSER_STORE_COLUMN_URI,
&uri,
-1);
@@ -1256,10 +1256,10 @@ restore_expand_state (PlumaFileBrowserView * view,
}
static void
on_row_inserted (PlumaFileBrowserStore * model,
on_row_inserted (XeditFileBrowserStore * model,
GtkTreePath * path,
GtkTreeIter * iter,
PlumaFileBrowserView * view)
XeditFileBrowserView * view)
{
GtkTreeIter parent;
GtkTreePath * copy;

View File

@@ -0,0 +1,84 @@
/*
* xedit-file-browser-view.h - Xedit plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __XEDIT_FILE_BROWSER_VIEW_H__
#define __XEDIT_FILE_BROWSER_VIEW_H__
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define XEDIT_TYPE_FILE_BROWSER_VIEW (xedit_file_browser_view_get_type ())
#define XEDIT_FILE_BROWSER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XEDIT_TYPE_FILE_BROWSER_VIEW, XeditFileBrowserView))
#define XEDIT_FILE_BROWSER_VIEW_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XEDIT_TYPE_FILE_BROWSER_VIEW, XeditFileBrowserView const))
#define XEDIT_FILE_BROWSER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XEDIT_TYPE_FILE_BROWSER_VIEW, XeditFileBrowserViewClass))
#define XEDIT_IS_FILE_BROWSER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XEDIT_TYPE_FILE_BROWSER_VIEW))
#define XEDIT_IS_FILE_BROWSER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XEDIT_TYPE_FILE_BROWSER_VIEW))
#define XEDIT_FILE_BROWSER_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XEDIT_TYPE_FILE_BROWSER_VIEW, XeditFileBrowserViewClass))
typedef struct _XeditFileBrowserView XeditFileBrowserView;
typedef struct _XeditFileBrowserViewClass XeditFileBrowserViewClass;
typedef struct _XeditFileBrowserViewPrivate XeditFileBrowserViewPrivate;
typedef enum {
XEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE,
XEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE
} XeditFileBrowserViewClickPolicy;
struct _XeditFileBrowserView
{
GtkTreeView parent;
XeditFileBrowserViewPrivate *priv;
};
struct _XeditFileBrowserViewClass
{
GtkTreeViewClass parent_class;
/* Signals */
void (*error) (XeditFileBrowserView * filetree,
guint code,
gchar const *message);
void (*file_activated) (XeditFileBrowserView * filetree,
GtkTreeIter *iter);
void (*directory_activated) (XeditFileBrowserView * filetree,
GtkTreeIter *iter);
void (*bookmark_activated) (XeditFileBrowserView * filetree,
GtkTreeIter *iter);
};
GType xedit_file_browser_view_get_type (void) G_GNUC_CONST;
GType xedit_file_browser_view_register_type (GTypeModule * module);
GtkWidget *xedit_file_browser_view_new (void);
void xedit_file_browser_view_set_model (XeditFileBrowserView * tree_view,
GtkTreeModel * model);
void xedit_file_browser_view_start_rename (XeditFileBrowserView * tree_view,
GtkTreeIter * iter);
void xedit_file_browser_view_set_click_policy (XeditFileBrowserView * tree_view,
XeditFileBrowserViewClickPolicy policy);
void xedit_file_browser_view_set_restore_expand_state (XeditFileBrowserView * tree_view,
gboolean restore_expand_state);
G_END_DECLS
#endif /* __XEDIT_FILE_BROWSER_VIEW_H__ */
// ex:ts=8:noet:

View File

@@ -0,0 +1,129 @@
/*
* xedit-file-browser-widget.h - Xedit plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __XEDIT_FILE_BROWSER_WIDGET_H__
#define __XEDIT_FILE_BROWSER_WIDGET_H__
#include <gtk/gtk.h>
#include "xedit-file-browser-store.h"
#include "xedit-file-bookmarks-store.h"
#include "xedit-file-browser-view.h"
G_BEGIN_DECLS
#define XEDIT_TYPE_FILE_BROWSER_WIDGET (xedit_file_browser_widget_get_type ())
#define XEDIT_FILE_BROWSER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XEDIT_TYPE_FILE_BROWSER_WIDGET, XeditFileBrowserWidget))
#define XEDIT_FILE_BROWSER_WIDGET_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XEDIT_TYPE_FILE_BROWSER_WIDGET, XeditFileBrowserWidget const))
#define XEDIT_FILE_BROWSER_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XEDIT_TYPE_FILE_BROWSER_WIDGET, XeditFileBrowserWidgetClass))
#define XEDIT_IS_FILE_BROWSER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XEDIT_TYPE_FILE_BROWSER_WIDGET))
#define XEDIT_IS_FILE_BROWSER_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XEDIT_TYPE_FILE_BROWSER_WIDGET))
#define XEDIT_FILE_BROWSER_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XEDIT_TYPE_FILE_BROWSER_WIDGET, XeditFileBrowserWidgetClass))
typedef struct _XeditFileBrowserWidget XeditFileBrowserWidget;
typedef struct _XeditFileBrowserWidgetClass XeditFileBrowserWidgetClass;
typedef struct _XeditFileBrowserWidgetPrivate XeditFileBrowserWidgetPrivate;
typedef
gboolean (*XeditFileBrowserWidgetFilterFunc) (XeditFileBrowserWidget * obj,
XeditFileBrowserStore *
model, GtkTreeIter * iter,
gpointer user_data);
struct _XeditFileBrowserWidget
{
#if GTK_CHECK_VERSION (3, 0, 0)
GtkBox parent;
#else
GtkVBox parent;
#endif
XeditFileBrowserWidgetPrivate *priv;
};
struct _XeditFileBrowserWidgetClass
{
#if GTK_CHECK_VERSION (3, 0, 0)
GtkBoxClass parent_class;
#else
GtkVBoxClass parent_class;
#endif
/* Signals */
void (*uri_activated) (XeditFileBrowserWidget * widget,
gchar const *uri);
void (*error) (XeditFileBrowserWidget * widget,
guint code,
gchar const *message);
gboolean (*confirm_delete) (XeditFileBrowserWidget * widget,
XeditFileBrowserStore * model,
GList *list);
gboolean (*confirm_no_trash) (XeditFileBrowserWidget * widget,
GList *list);
};
GType xedit_file_browser_widget_get_type (void) G_GNUC_CONST;
GType xedit_file_browser_widget_register_type (GTypeModule * module);
GtkWidget *xedit_file_browser_widget_new (const gchar *data_dir);
void xedit_file_browser_widget_show_bookmarks (XeditFileBrowserWidget * obj);
void xedit_file_browser_widget_show_files (XeditFileBrowserWidget * obj);
void xedit_file_browser_widget_set_root (XeditFileBrowserWidget * obj,
gchar const *root,
gboolean virtual_root);
void
xedit_file_browser_widget_set_root_and_virtual_root (XeditFileBrowserWidget * obj,
gchar const *root,
gchar const *virtual_root);
gboolean
xedit_file_browser_widget_get_selected_directory (XeditFileBrowserWidget * obj,
GtkTreeIter * iter);
XeditFileBrowserStore *
xedit_file_browser_widget_get_browser_store (XeditFileBrowserWidget * obj);
XeditFileBookmarksStore *
xedit_file_browser_widget_get_bookmarks_store (XeditFileBrowserWidget * obj);
XeditFileBrowserView *
xedit_file_browser_widget_get_browser_view (XeditFileBrowserWidget * obj);
GtkWidget *
xedit_file_browser_widget_get_filter_entry (XeditFileBrowserWidget * obj);
GtkUIManager *
xedit_file_browser_widget_get_ui_manager (XeditFileBrowserWidget * obj);
gulong xedit_file_browser_widget_add_filter (XeditFileBrowserWidget * obj,
XeditFileBrowserWidgetFilterFunc func,
gpointer user_data,
GDestroyNotify notify);
void xedit_file_browser_widget_remove_filter (XeditFileBrowserWidget * obj,
gulong id);
void xedit_file_browser_widget_set_filter_pattern (XeditFileBrowserWidget * obj,
gchar const *pattern);
void xedit_file_browser_widget_refresh (XeditFileBrowserWidget * obj);
void xedit_file_browser_widget_history_back (XeditFileBrowserWidget * obj);
void xedit_file_browser_widget_history_forward (XeditFileBrowserWidget * obj);
G_END_DECLS
#endif /* __XEDIT_FILE_BROWSER_WIDGET_H__ */
// ex:ts=8:noet:

View File

@@ -1,31 +1,31 @@
# Modelines Plugin
plugindir = $(PLUMA_PLUGINS_LIBS_DIR)
plugindir = $(XEDIT_PLUGINS_LIBS_DIR)
AM_CPPFLAGS = \
-I$(top_srcdir) \
$(PLUMA_CFLAGS) \
$(XEDIT_CFLAGS) \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS)
modelinesdir = $(PLUMA_PLUGINS_DATA_DIR)/modelines
modelinesdir = $(XEDIT_PLUGINS_DATA_DIR)/modelines
modelines_DATA = \
language-mappings
plugin_LTLIBRARIES = libmodelines.la
libmodelines_la_SOURCES = \
pluma-modeline-plugin.h \
pluma-modeline-plugin.c \
xedit-modeline-plugin.h \
xedit-modeline-plugin.c \
modeline-parser.h \
modeline-parser.c
libmodelines_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
libmodelines_la_LIBADD = $(PLUMA_LIBS)
libmodelines_la_LIBADD = $(XEDIT_LIBS)
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_in_files = modelines.xedit-plugin.desktop.in
%.xedit-plugin: %.xedit-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:.pluma-plugin.desktop.in=.pluma-plugin)
plugin_DATA = $(plugin_in_files:.xedit-plugin.desktop.in=.xedit-plugin)
EXTRA_DIST = \
$(plugin_in_files) \

View File

@@ -1,6 +1,6 @@
/*
* modeline-parser.c
* Emacs, Kate and Vim-style modelines support for pluma.
* Emacs, Kate and Vim-style modelines support for xedit.
*
* Copyright (C) 2005-2007 - Steve Frécinaux <code@istique.net>
*
@@ -26,9 +26,9 @@
#if GTK_CHECK_VERSION (3, 0, 0)
#include <gtksourceview/gtksource.h>
#endif
#include <pluma/pluma-language-manager.h>
#include <pluma/pluma-prefs-manager.h>
#include <pluma/pluma-debug.h>
#include <xedit/xedit-language-manager.h>
#include <xedit/xedit-prefs-manager.h>
#include <xedit/xedit-debug.h>
#include "modeline-parser.h"
#define MODELINES_LANGUAGE_MAPPINGS_FILE "language-mappings"
@@ -36,7 +36,7 @@
/* base dir to lookup configuration files */
static gchar *modelines_data_dir;
/* Mappings: language name -> Pluma language ID */
/* Mappings: language name -> Xedit language ID */
static GHashTable *vim_languages;
static GHashTable *emacs_languages;
static GHashTable *kate_languages;
@@ -116,7 +116,7 @@ load_language_mappings_group (GKeyFile *key_file, const gchar *group)
keys = g_key_file_get_keys (key_file, group, &length, NULL);
pluma_debug_message (DEBUG_PLUGINS,
xedit_debug_message (DEBUG_PLUGINS,
"%" G_GSIZE_FORMAT " mappings in group %s",
length, group);
@@ -147,7 +147,7 @@ load_language_mappings (void)
if (g_key_file_load_from_file (mappings, fname, 0, &error))
{
pluma_debug_message (DEBUG_PLUGINS,
xedit_debug_message (DEBUG_PLUGINS,
"Loaded language mappings from %s",
fname);
@@ -157,7 +157,7 @@ load_language_mappings (void)
}
else
{
pluma_debug_message (DEBUG_PLUGINS,
xedit_debug_message (DEBUG_PLUGINS,
"Failed to loaded language mappings from %s: %s",
fname, error->message);
@@ -399,7 +399,7 @@ parse_emacs_modeline (gchar *s,
s++;
}
pluma_debug_message (DEBUG_PLUGINS,
xedit_debug_message (DEBUG_PLUGINS,
"Emacs modeline bit: %s = %s",
key->str, value->str);
@@ -497,7 +497,7 @@ parse_kate_modeline (gchar *s,
s++;
}
pluma_debug_message (DEBUG_PLUGINS,
xedit_debug_message (DEBUG_PLUGINS,
"Kate modeline bit: %s = %s",
key->str, value->str);
@@ -586,21 +586,21 @@ parse_modeline (gchar *s,
strncmp (s, "vi:", 3) == 0 ||
strncmp (s, "vim:", 4) == 0))
{
pluma_debug_message (DEBUG_PLUGINS, "Vim modeline on line %d", line_number);
xedit_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)
{
pluma_debug_message (DEBUG_PLUGINS, "Emacs modeline on line %d", line_number);
xedit_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)
{
pluma_debug_message (DEBUG_PLUGINS, "Kate modeline on line %d", line_number);
xedit_debug_message (DEBUG_PLUGINS, "Kate modeline on line %d", line_number);
s = parse_kate_modeline (s + 5, options);
}
@@ -748,7 +748,7 @@ modeline_parser_apply_modeline (GtkSourceView *view)
GtkSourceLanguageManager *manager;
GtkSourceLanguage *language;
manager = pluma_get_language_manager ();
manager = xedit_get_language_manager ();
language = gtk_source_language_manager_get_language
(manager, options.language_id);
@@ -773,7 +773,7 @@ modeline_parser_apply_modeline (GtkSourceView *view)
{
gtk_source_view_set_insert_spaces_instead_of_tabs
(view,
pluma_prefs_manager_get_insert_spaces ());
xedit_prefs_manager_get_insert_spaces ());
}
if (has_option (&options, MODELINE_SET_TAB_WIDTH))
@@ -783,7 +783,7 @@ modeline_parser_apply_modeline (GtkSourceView *view)
else if (check_previous (view, previous, MODELINE_SET_TAB_WIDTH))
{
gtk_source_view_set_tab_width (view,
pluma_prefs_manager_get_tabs_size ());
xedit_prefs_manager_get_tabs_size ());
}
if (has_option (&options, MODELINE_SET_INDENT_WIDTH))
@@ -802,7 +802,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),
pluma_prefs_manager_get_wrap_mode ());
xedit_prefs_manager_get_wrap_mode ());
}
if (has_option (&options, MODELINE_SET_RIGHT_MARGIN_POSITION))
@@ -812,7 +812,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,
pluma_prefs_manager_get_right_margin_position ());
xedit_prefs_manager_get_right_margin_position ());
}
if (has_option (&options, MODELINE_SET_SHOW_RIGHT_MARGIN))
@@ -822,7 +822,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,
pluma_prefs_manager_get_display_right_margin ());
xedit_prefs_manager_get_display_right_margin ());
}
if (previous)

View File

@@ -1,6 +1,6 @@
/*
* modelie-parser.h
* Emacs, Kate and Vim-style modelines support for pluma.
* Emacs, Kate and Vim-style modelines support for xedit.
*
* Copyright (C) 2005-2007 - Steve Frécinaux <code@istique.net>
*

View File

@@ -1,8 +1,8 @@
[Pluma Plugin]
[Xedit Plugin]
Module=modelines
IAge=2
_Name=Modelines
_Description=Emacs, Kate and Vim-style modelines support for pluma.
_Description=Emacs, Kate and Vim-style modelines support for xedit.
Authors=Steve Frécinaux <steve@istique.net>
Copyright=Copyright © 2005 Steve Frécinaux
Website=http://www.mate-desktop.org

View File

@@ -1,48 +0,0 @@
/*
* pluma-modeline-plugin.h
* Emacs, Kate and Vim-style modelines support for pluma.
*
* Copyright (C) 2005-2007 - Steve Frécinaux <code@istique.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, 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__ */

View File

@@ -1,6 +1,6 @@
/*
* pluma-modeline-plugin.c
* Emacs, Kate and Vim-style modelines support for pluma.
* xedit-modeline-plugin.c
* Emacs, Kate and Vim-style modelines support for xedit.
*
* Copyright (C) 2005-2007 - Steve Frécinaux <code@istique.net>
*
@@ -25,14 +25,14 @@
#include <glib/gi18n-lib.h>
#include <gmodule.h>
#include "pluma-modeline-plugin.h"
#include "xedit-modeline-plugin.h"
#include "modeline-parser.h"
#include <pluma/pluma-debug.h>
#include <pluma/pluma-utils.h>
#include <xedit/xedit-debug.h>
#include <xedit/xedit-utils.h>
#define WINDOW_DATA_KEY "PlumaModelinePluginWindowData"
#define DOCUMENT_DATA_KEY "PlumaModelinePluginDocumentData"
#define WINDOW_DATA_KEY "XeditModelinePluginWindowData"
#define DOCUMENT_DATA_KEY "XeditModelinePluginDocumentData"
typedef struct
{
@@ -46,12 +46,12 @@ typedef struct
gulong document_saved_handler_id;
} DocumentData;
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);
static void xedit_modeline_plugin_activate (XeditPlugin *plugin, XeditWindow *window);
static void xedit_modeline_plugin_deactivate (XeditPlugin *plugin, XeditWindow *window);
static GObject *xedit_modeline_plugin_constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_param);
static void xedit_modeline_plugin_finalize (GObject *object);
PLUMA_PLUGIN_REGISTER_TYPE(PlumaModelinePlugin, pluma_modeline_plugin)
XEDIT_PLUGIN_REGISTER_TYPE(XeditModelinePlugin, xedit_modeline_plugin)
static void
window_data_free (WindowData *wdata)
@@ -66,31 +66,31 @@ document_data_free (DocumentData *ddata)
}
static void
pluma_modeline_plugin_class_init (PlumaModelinePluginClass *klass)
xedit_modeline_plugin_class_init (XeditModelinePluginClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
PlumaPluginClass *plugin_class = PLUMA_PLUGIN_CLASS (klass);
XeditPluginClass *plugin_class = XEDIT_PLUGIN_CLASS (klass);
object_class->constructor = pluma_modeline_plugin_constructor;
object_class->finalize = pluma_modeline_plugin_finalize;
object_class->constructor = xedit_modeline_plugin_constructor;
object_class->finalize = xedit_modeline_plugin_finalize;
plugin_class->activate = pluma_modeline_plugin_activate;
plugin_class->deactivate = pluma_modeline_plugin_deactivate;
plugin_class->activate = xedit_modeline_plugin_activate;
plugin_class->deactivate = xedit_modeline_plugin_deactivate;
}
static GObject *
pluma_modeline_plugin_constructor (GType type,
xedit_modeline_plugin_constructor (GType type,
guint n_construct_properties,
GObjectConstructParam *construct_param)
{
GObject *object;
gchar *data_dir;
object = G_OBJECT_CLASS (pluma_modeline_plugin_parent_class)->constructor (type,
object = G_OBJECT_CLASS (xedit_modeline_plugin_parent_class)->constructor (type,
n_construct_properties,
construct_param);
data_dir = pluma_plugin_get_data_dir (PLUMA_PLUGIN (object));
data_dir = xedit_plugin_get_data_dir (XEDIT_PLUGIN (object));
modeline_parser_init (data_dir);
@@ -100,23 +100,23 @@ pluma_modeline_plugin_constructor (GType type,
}
static void
pluma_modeline_plugin_init (PlumaModelinePlugin *plugin)
xedit_modeline_plugin_init (XeditModelinePlugin *plugin)
{
pluma_debug_message (DEBUG_PLUGINS, "PlumaModelinePlugin initializing");
xedit_debug_message (DEBUG_PLUGINS, "XeditModelinePlugin initializing");
}
static void
pluma_modeline_plugin_finalize (GObject *object)
xedit_modeline_plugin_finalize (GObject *object)
{
pluma_debug_message (DEBUG_PLUGINS, "PlumaModelinePlugin finalizing");
xedit_debug_message (DEBUG_PLUGINS, "XeditModelinePlugin finalizing");
modeline_parser_shutdown ();
G_OBJECT_CLASS (pluma_modeline_plugin_parent_class)->finalize (object);
G_OBJECT_CLASS (xedit_modeline_plugin_parent_class)->finalize (object);
}
static void
on_document_loaded_or_saved (PlumaDocument *document,
on_document_loaded_or_saved (XeditDocument *document,
const GError *error,
GtkSourceView *view)
{
@@ -124,7 +124,7 @@ on_document_loaded_or_saved (PlumaDocument *document,
}
static void
connect_handlers (PlumaView *view)
connect_handlers (XeditView *view)
{
DocumentData *data;
GtkTextBuffer *doc;
@@ -147,7 +147,7 @@ connect_handlers (PlumaView *view)
}
static void
disconnect_handlers (PlumaView *view)
disconnect_handlers (XeditView *view)
{
DocumentData *data;
GtkTextBuffer *doc;
@@ -170,35 +170,35 @@ disconnect_handlers (PlumaView *view)
}
static void
on_window_tab_added (PlumaWindow *window,
PlumaTab *tab,
on_window_tab_added (XeditWindow *window,
XeditTab *tab,
gpointer user_data)
{
connect_handlers (pluma_tab_get_view (tab));
connect_handlers (xedit_tab_get_view (tab));
}
static void
on_window_tab_removed (PlumaWindow *window,
PlumaTab *tab,
on_window_tab_removed (XeditWindow *window,
XeditTab *tab,
gpointer user_data)
{
disconnect_handlers (pluma_tab_get_view (tab));
disconnect_handlers (xedit_tab_get_view (tab));
}
static void
pluma_modeline_plugin_activate (PlumaPlugin *plugin,
PlumaWindow *window)
xedit_modeline_plugin_activate (XeditPlugin *plugin,
XeditWindow *window)
{
WindowData *wdata;
GList *views;
GList *l;
pluma_debug (DEBUG_PLUGINS);
xedit_debug (DEBUG_PLUGINS);
views = pluma_window_get_views (window);
views = xedit_window_get_views (window);
for (l = views; l != NULL; l = l->next)
{
connect_handlers (PLUMA_VIEW (l->data));
connect_handlers (XEDIT_VIEW (l->data));
modeline_parser_apply_modeline (GTK_SOURCE_VIEW (l->data));
}
g_list_free (views);
@@ -218,14 +218,14 @@ pluma_modeline_plugin_activate (PlumaPlugin *plugin,
}
static void
pluma_modeline_plugin_deactivate (PlumaPlugin *plugin,
PlumaWindow *window)
xedit_modeline_plugin_deactivate (XeditPlugin *plugin,
XeditWindow *window)
{
WindowData *wdata;
GList *views;
GList *l;
pluma_debug (DEBUG_PLUGINS);
xedit_debug (DEBUG_PLUGINS);
wdata = g_object_steal_data (G_OBJECT (window), WINDOW_DATA_KEY);
@@ -234,11 +234,11 @@ pluma_modeline_plugin_deactivate (PlumaPlugin *plugin,
window_data_free (wdata);
views = pluma_window_get_views (window);
views = xedit_window_get_views (window);
for (l = views; l != NULL; l = l->next)
{
disconnect_handlers (PLUMA_VIEW (l->data));
disconnect_handlers (XEDIT_VIEW (l->data));
modeline_parser_deactivate (GTK_SOURCE_VIEW (l->data));
}

View File

@@ -0,0 +1,48 @@
/*
* xedit-modeline-plugin.h
* Emacs, Kate and Vim-style modelines support for xedit.
*
* Copyright (C) 2005-2007 - Steve Frécinaux <code@istique.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __XEDIT_MODELINE_PLUGIN_H__
#define __XEDIT_MODELINE_PLUGIN_H__
#include <glib.h>
#include <glib-object.h>
#include <xedit/xedit-plugin.h>
G_BEGIN_DECLS
#define XEDIT_TYPE_MODELINE_PLUGIN (xedit_modeline_plugin_get_type ())
#define XEDIT_MODELINE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XEDIT_TYPE_MODELINE_PLUGIN, XeditModelinePlugin))
#define XEDIT_MODELINE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XEDIT_TYPE_MODELINE_PLUGIN, XeditModelinePluginClass))
#define XEDIT_IS_MODELINE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XEDIT_TYPE_MODELINE_PLUGIN))
#define XEDIT_IS_MODELINE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XEDIT_TYPE_MODELINE_PLUGIN))
#define XEDIT_MODELINE_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XEDIT_TYPE_MODELINE_PLUGIN, XeditModelinePluginClass))
/* Private structure type */
typedef XeditPluginClass XeditModelinePluginClass;
typedef XeditPlugin XeditModelinePlugin;
GType xedit_modeline_plugin_get_type (void) G_GNUC_CONST;
G_MODULE_EXPORT GType register_xedit_plugin (GTypeModule *module);
G_END_DECLS
#endif /* __XEDIT_MODELINE_PLUGIN_H__ */

View File

@@ -1,11 +1,11 @@
# Python Console Plugin
SUBDIRS = pythonconsole
plugindir = $(PLUMA_PLUGINS_LIBS_DIR)
plugindir = $(XEDIT_PLUGINS_LIBS_DIR)
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_in_files = pythonconsole.xedit-plugin.desktop.in
%.xedit-plugin: %.xedit-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:.pluma-plugin.desktop.in=.pluma-plugin)
plugin_DATA = $(plugin_in_files:.xedit-plugin.desktop.in=.xedit-plugin)
EXTRA_DIST = $(plugin_in_files)

View File

@@ -1,4 +1,4 @@
[Pluma Plugin]
[Xedit Plugin]
Loader=python
Module=pythonconsole
IAge=2

View File

@@ -1,12 +1,12 @@
# Python console plugin
plugindir = $(PLUMA_PLUGINS_LIBS_DIR)/pythonconsole
plugindir = $(XEDIT_PLUGINS_LIBS_DIR)/pythonconsole
plugin_PYTHON = \
__init__.py \
console.py \
config.py
uidir = $(PLUMA_PLUGINS_DATA_DIR)/pythonconsole/ui
uidir = $(XEDIT_PLUGINS_DATA_DIR)/pythonconsole/ui
ui_DATA = config.ui
EXTRA_DIST = $(ui_DATA)

View File

@@ -21,11 +21,11 @@
# Parts from "Interactive Python-GTK Console" (stolen from epiphany's console.py)
# Copyright (C), 1998 James Henstridge <james@daa.com.au>
# Copyright (C), 2005 Adam Hooper <adamh@densi.com>
# Bits from pluma Python Console Plugin
# Bits from xedit Python Console Plugin
# Copyrignt (C), 2005 Raphaël Slinckx
import gtk
import pluma
import xedit
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(pluma.Plugin):
class PythonConsolePlugin(xedit.Plugin):
def __init__(self):
pluma.Plugin.__init__(self)
xedit.Plugin.__init__(self)
self.dlg = None
def activate(self, window):
console = PythonConsole(namespace = {'__builtins__' : __builtins__,
'pluma' : pluma,
'xedit' : xedit,
'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 = pluma.app_get_default().get_active_window()
window = xedit.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 pluma checks if a plugin
# is enabled. This has to be done like this because xedit 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

View File

@@ -21,7 +21,7 @@
# Parts from "Interactive Python-GTK Console" (stolen from epiphany's console.py)
# Copyright (C), 1998 James Henstridge <james@daa.com.au>
# Copyright (C), 2005 Adam Hooper <adamh@densi.com>
# Bits from pluma Python Console Plugin
# Bits from xedit Python Console Plugin
# Copyrignt (C), 2005 Raphaël Slinckx
import os
@@ -29,7 +29,7 @@ import gtk
__all__ = ('PythonConsoleConfig', 'PythonConsoleConfigDialog')
MATECONF_KEY_BASE = '/apps/pluma/plugins/pythonconsole'
MATECONF_KEY_BASE = '/apps/xedit/plugins/pythonconsole'
MATECONF_KEY_COMMAND_COLOR = MATECONF_KEY_BASE + '/command-color'
MATECONF_KEY_ERROR_COLOR = MATECONF_KEY_BASE + '/error-color'

View File

@@ -21,7 +21,7 @@
# Parts from "Interactive Python-GTK Console" (stolen from epiphany's console.py)
# Copyright (C), 1998 James Henstridge <james@daa.com.au>
# Copyright (C), 2005 Adam Hooper <adamh@densi.com>
# Bits from pluma Python Console Plugin
# Bits from xedit Python Console Plugin
# Copyrignt (C), 2005 Raphaël Slinckx
import string

View File

@@ -1,11 +1,11 @@
# Quick Open Plugin
SUBDIRS = quickopen
plugindir = $(PLUMA_PLUGINS_LIBS_DIR)
plugindir = $(XEDIT_PLUGINS_LIBS_DIR)
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_in_files = quickopen.xedit-plugin.desktop.in
%.xedit-plugin: %.xedit-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:.pluma-plugin.desktop.in=.pluma-plugin)
plugin_DATA = $(plugin_in_files:.xedit-plugin.desktop.in=.xedit-plugin)
EXTRA_DIST = $(plugin_in_files)

View File

@@ -1,4 +1,4 @@
[Pluma Plugin]
[Xedit Plugin]
Loader=python
Module=quickopen
IAge=2

View File

@@ -1,6 +1,6 @@
# Quick Open Plugin
plugindir = $(PLUMA_PLUGINS_LIBS_DIR)/quickopen
plugindir = $(XEDIT_PLUGINS_LIBS_DIR)/quickopen
plugin_PYTHON = \
__init__.py \
popup.py \

View File

@@ -17,12 +17,12 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
import pluma
import xedit
from windowhelper import WindowHelper
class QuickOpenPlugin(pluma.Plugin):
class QuickOpenPlugin(xedit.Plugin):
def __init__(self):
pluma.Plugin.__init__(self)
xedit.Plugin.__init__(self)
self._popup_size = (450, 300)
self._helpers = {}

View File

@@ -25,7 +25,7 @@ import gio
import pango
import glib
import fnmatch
import pluma
import xedit
import xml.sax.saxutils
from virtualdirs import VirtualDirectory
@@ -418,7 +418,7 @@ class Popup(gtk.Dialog):
uri = self._entry.get_text()
gfile = None
if pluma.utils.uri_is_valid(uri):
if xedit.utils.uri_is_valid(uri):
gfile = gio.File(uri)
elif os.path.isabs(uri):
f = gio.File(uri)

View File

@@ -65,7 +65,7 @@ class RecentDocumentsDirectory(VirtualDirectory):
added = 0
for item in items:
if item.has_group('pluma'):
if item.has_group('xedit'):
self.append(gio.File(item.get_uri()))
added += 1

View File

@@ -17,11 +17,11 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
import pluma
import xedit
import gtk
from popup import Popup
import os
import pluma.commands
import xedit.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("PlumaQuickOpenPluginActions")
self._action_group = gtk.ActionGroup("XeditQuickOpenPluginActions")
self._action_group.add_actions([
("QuickOpen", gtk.STOCK_OPEN, _("Quick open"),
'<Ctrl><Alt>O', _("Quickly open documents"),
@@ -191,7 +191,7 @@ class WindowHelper:
self._popup = None
def on_activated(self, gfile):
pluma.commands.load_uri(self._window, gfile.get_uri(), None, -1)
xedit.commands.load_uri(self._window, gfile.get_uri(), None, -1)
return True
# ex:ts=8:et:

View File

@@ -1,11 +1,11 @@
# Python snippets plugin
SUBDIRS = snippets data
plugindir = $(PLUMA_PLUGINS_LIBS_DIR)
plugindir = $(XEDIT_PLUGINS_LIBS_DIR)
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_in_files = snippets.xedit-plugin.desktop.in
%.xedit-plugin: %.xedit-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:.pluma-plugin.desktop.in=.pluma-plugin)
plugin_DATA = $(plugin_in_files:.xedit-plugin.desktop.in=.xedit-plugin)
EXTRA_DIST = $(plugin_in_files)

View File

@@ -26,7 +26,7 @@ snippets_DATA = \
xml.xml \
xslt.xml
snippetsdir = $(PLUMA_PLUGINS_DATA_DIR)/snippets
snippetsdir = $(XEDIT_PLUGINS_DATA_DIR)/snippets
EXTRA_DIST = $(snippets_DATA)

View File

@@ -2,7 +2,7 @@
<snippets language="C">
<snippet id="gpl">
<text><![CDATA[/*
* ${1:[$PLUMA_CURRENT_DOCUMENT_NAME,<filename>]}
* ${1:[$XEDIT_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:[$PLUMA_CURRENT_DOCUMENT_NAME,<filename>]}
* ${1:[$XEDIT_CURRENT_DOCUMENT_NAME,<filename>]}
* This file is part of ${2:<library name>}
*
* Copyright (C) $<3: import datetime; return str(datetime.date.today().year)> - $<4:

View File

@@ -34,7 +34,7 @@ $0]]></text>
</snippet>
<snippet id="gpl">
<text><![CDATA[/*
* ${1:[$PLUMA_CURRENT_DOCUMENT_NAME,<filename>]}
* ${1:[$XEDIT_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:[$PLUMA_CURRENT_DOCUMENT_NAME,<filename>]}
* ${1:[$XEDIT_CURRENT_DOCUMENT_NAME,<filename>]}
* This file is part of ${2:<library name>}
*
* Copyright (C) $<3: import datetime; return str(datetime.date.today().year)> - $<4:

View File

@@ -105,7 +105,7 @@ $0]]></text>
</snippet>
<snippet id="gpl">
<text><![CDATA[/*
* ${1:[$PLUMA_CURRENT_DOCUMENT_NAME,<filename>]}
* ${1:[$XEDIT_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:[$PLUMA_CURRENT_DOCUMENT_NAME,<filename>]}
* ${1:[$XEDIT_CURRENT_DOCUMENT_NAME,<filename>]}
* This file is part of ${2:<library name>}
*
* Copyright (C) $<3: import datetime; return str(datetime.date.today().year)> - $<4:

View File

@@ -34,13 +34,13 @@
<accelerator/>
</snippet>
<snippet id="appwrap">
<text><![CDATA[<application>$PLUMA_SELECTED_TEXT</application>]]></text>
<text><![CDATA[<application>$XEDIT_SELECTED_TEXT</application>]]></text>
<tag>application</tag>
<description>application tag</description>
<accelerator/>
</snippet>
<snippet id="enclose">
<text><![CDATA[<${1}>$PLUMA_SELECTED_TEXT</${1}>]]></text>
<text><![CDATA[<${1}>$XEDIT_SELECTED_TEXT</${1}>]]></text>
<tag>enclose</tag>
<description>enclose selected text</description>
<accelerator/>

View File

@@ -54,14 +54,14 @@ $0]]></text>
<description>Date</description>
</snippet>
<snippet id="ref">
<text><![CDATA[<a href="${1:http://somesite.com/}">${2:$PLUMA_SELECTED_TEXT}</a>
<text><![CDATA[<a href="${1:http://somesite.com/}">${2:$XEDIT_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}>$PLUMA_SELECTED_TEXT</${1}>]]></text>
<text><![CDATA[<${1:p}>$XEDIT_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:$PLUMA_SELECTED_TEXT}
${0:$XEDIT_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:$PLUMA_SELECTED_TEXT}</h${1}>
<text><![CDATA[<h${1:1} id="${2}">${3:$XEDIT_SELECTED_TEXT}</h${1}>
$0]]></text>
<description>Heading</description>
<tag>h</tag>

View File

@@ -69,7 +69,7 @@ $0
</snippet>
<snippet id="try/catch">
<text><![CDATA[try {
$PLUMA_SELECTED_TEXT
$XEDIT_SELECTED_TEXT
}
catch (Exception e) {
${1:e.printStackTrace();}

View File

@@ -2,7 +2,7 @@
lang_DATA = \
snippets.lang
langdir = $(PLUMA_PLUGINS_DATA_DIR)/snippets/lang
langdir = $(XEDIT_PLUGINS_DATA_DIR)/snippets/lang
EXTRA_DIST = $(lang_DATA)

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<snippets language="LaTeX">
<snippet id="command">
<text><![CDATA[{\\${1:bf} $PLUMA_SELECTED_TEXT}]]></text>
<text><![CDATA[{\\${1:bf} $XEDIT_SELECTED_TEXT}]]></text>
<accelerator><![CDATA[<Shift><Alt>w]]></accelerator>
<description>Wrap Selection in Command</description>
</snippet>

View File

@@ -74,12 +74,12 @@ $0]]></text>
<description>while loop</description>
</snippet>
<snippet id="insert">
<text><![CDATA["${1:$PLUMA_SELECTED_TEXT}"]]></text>
<text><![CDATA["${1:$XEDIT_SELECTED_TEXT}"]]></text>
<accelerator><![CDATA[<Control>2]]></accelerator>
<description>Inside String: Insert "…"</description>
</snippet>
<snippet id="insert-1">
<text><![CDATA['${1:$PLUMA_SELECTED_TEXT}']]></text>
<text><![CDATA['${1:$XEDIT_SELECTED_TEXT}']]></text>
<accelerator><![CDATA[<Control>apostrophe]]></accelerator>
<description>Inside String: Insert '…'</description>
</snippet>

View File

@@ -26,73 +26,73 @@
<tag>regex</tag>
</snippet>
<snippet id="$-CURRENT_DOCUMENT_PATH">
<text><![CDATA[\$PLUMA_CURRENT_DOCUMENT_PATH]]></text>
<description>Pluma Current Document Path Variable</description>
<text><![CDATA[\$XEDIT_CURRENT_DOCUMENT_PATH]]></text>
<description>Xedit Current Document Path Variable</description>
<tag>$</tag>
</snippet>
<snippet id="$-CURRENT_DOCUMENT_NAME">
<text><![CDATA[\$PLUMA_CURRENT_DOCUMENT_NAME]]></text>
<description>Pluma Current Document Name Variable</description>
<text><![CDATA[\$XEDIT_CURRENT_DOCUMENT_NAME]]></text>
<description>Xedit Current Document Name Variable</description>
<tag>$</tag>
</snippet>
<snippet id="$-CURRENT_DOCUMENT_URI">
<text><![CDATA[\$PLUMA_CURRENT_DOCUMENT_URI]]></text>
<description>Pluma Current Document Uri Variable</description>
<text><![CDATA[\$XEDIT_CURRENT_DOCUMENT_URI]]></text>
<description>Xedit Current Document Uri Variable</description>
<tag>$</tag>
</snippet>
<snippet id="$-CURRENT_DOCUMENT_SCHEME">
<text><![CDATA[\$PLUMA_CURRENT_DOCUMENT_SCHEME]]></text>
<description>Pluma Current Document Scheme Variable</description>
<text><![CDATA[\$XEDIT_CURRENT_DOCUMENT_SCHEME]]></text>
<description>Xedit Current Document Scheme Variable</description>
<tag>$</tag>
</snippet>
<snippet id="$-CURRENT_DOCUMENT_TYPE">
<text><![CDATA[\$PLUMA_CURRENT_DOCUMENT_TYPE]]></text>
<description>Pluma Current Document Type Variable</description>
<text><![CDATA[\$XEDIT_CURRENT_DOCUMENT_TYPE]]></text>
<description>Xedit Current Document Type Variable</description>
<tag>$</tag>
</snippet>
<snippet id="$-DOCUMENTS_URI">
<text><![CDATA[\$PLUMA_DOCUMENTS_URI]]></text>
<description>Pluma Documents Uri Variable</description>
<text><![CDATA[\$XEDIT_DOCUMENTS_URI]]></text>
<description>Xedit Documents Uri Variable</description>
<tag>$</tag>
</snippet>
<snippet id="$-DOCUMENTS_PATH">
<text><![CDATA[\$PLUMA_DOCUMENTS_PATH]]></text>
<description>Pluma Documents Path Variable</description>
<text><![CDATA[\$XEDIT_DOCUMENTS_PATH]]></text>
<description>Xedit Documents Path Variable</description>
<tag>$</tag>
</snippet>
<snippet id="$-SELECTED_TEXT">
<text><![CDATA[\$PLUMA_SELECTED_TEXT]]></text>
<description>Pluma Selected Text Variable</description>
<text><![CDATA[\$XEDIT_SELECTED_TEXT]]></text>
<description>Xedit Selected Text Variable</description>
<tag>$</tag>
</snippet>
<snippet id="$-CURRENT_WORD">
<text><![CDATA[\$PLUMA_CURRENT_WORD]]></text>
<description>Pluma Current Word Variable</description>
<text><![CDATA[\$XEDIT_CURRENT_WORD]]></text>
<description>Xedit Current Word Variable</description>
<tag>$</tag>
</snippet>
<snippet id="$-CURRENT_LINE">
<text><![CDATA[\$PLUMA_CURRENT_LINE]]></text>
<description>Pluma Current Line Variable</description>
<text><![CDATA[\$XEDIT_CURRENT_LINE]]></text>
<description>Xedit Current Line Variable</description>
<tag>$</tag>
</snippet>
<snippet id="$-CURRENT_LINE_NUMBER">
<text><![CDATA[\$PLUMA_CURRENT_LINE_NUMBER]]></text>
<description>Pluma Current Line Number Variable</description>
<text><![CDATA[\$XEDIT_CURRENT_LINE_NUMBER]]></text>
<description>Xedit Current Line Number Variable</description>
<tag>$</tag>
</snippet>
<snippet id="$-DROP_FILENAME">
<text><![CDATA[\$PLUMA_DROP_FILENAME]]></text>
<description>Pluma Drop Filename Variable</description>
<text><![CDATA[\$XEDIT_DROP_FILENAME]]></text>
<description>Xedit Drop Filename Variable</description>
<tag>$</tag>
</snippet>
<snippet id="$-DROP_REL_FILENAME">
<text><![CDATA[\$PLUMA_DROP_REL_FILENAME]]></text>
<description>Pluma Drop Relative Filename Variable</description>
<text><![CDATA[\$XEDIT_DROP_REL_FILENAME]]></text>
<description>Xedit Drop Relative Filename Variable</description>
<tag>$</tag>
</snippet>
<snippet id="$-DROP_MIME_TYPE">
<text><![CDATA[\$PLUMA_DROP_MIME_TYPE]]></text>
<description>Pluma Drop Mime Type Variable</description>
<text><![CDATA[\$XEDIT_DROP_MIME_TYPE]]></text>
<description>Xedit Drop Mime Type Variable</description>
<tag>$</tag>
</snippet>
</snippets>

View File

@@ -103,13 +103,13 @@ $0]]></text>
<tag>attr</tag>
</snippet>
<snippet id="text">
<text><![CDATA[<xsl:text>${1:$PLUMA_SELECTED_TEXT}</xsl:text>
<text><![CDATA[<xsl:text>${1:$XEDIT_SELECTED_TEXT}</xsl:text>
]]></text>
<description>Text</description>
<tag>text</tag>
</snippet>
<snippet id="comment">
<text><![CDATA[<xsl:comment>${1:$PLUMA_SELECTED_TEXT}</xsl:comment>
<text><![CDATA[<xsl:comment>${1:$XEDIT_SELECTED_TEXT}</xsl:comment>
]]></text>
<description>Comment</description>
<tag>comment</tag>

View File

@@ -1,4 +1,4 @@
[Pluma Plugin]
[Xedit Plugin]
Loader=python
Module=snippets
IAge=2

View File

@@ -1,6 +1,6 @@
import gtksourceview2 as gsv
import gobject
import pluma
import xedit
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 = pluma.View(pluma.Document())
view = xedit.View(xedit.Document())
manager = get_language_manager()
lang = manager.get_language('snippets')

View File

@@ -1,4 +1,4 @@
# Pluma snippets plugin
# Xedit snippets plugin
# Copyright (C) 2005-2006 Jesse van den Kieboom <jesse@icecrew.nl>
#
# 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 pluma
import xedit
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, pluma.Window):
if isinstance(toplevel, xedit.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, pluma.Window):
if isinstance(toplevel, xedit.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 pluma.utils.uri_has_file_scheme(location.get_uri())]
if xedit.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 = {'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,
variables = {'XEDIT_SELECTED_TEXT': self.env_get_selected_text,
'XEDIT_CURRENT_WORD': self.env_get_current_word,
'XEDIT_CURRENT_LINE': self.env_get_current_line,
'XEDIT_CURRENT_LINE_NUMBER': self.env_get_current_line_number,
'XEDIT_CURRENT_DOCUMENT_URI': self.env_get_document_uri,
'XEDIT_CURRENT_DOCUMENT_NAME': self.env_get_document_name,
'XEDIT_CURRENT_DOCUMENT_SCHEME': self.env_get_document_scheme,
'XEDIT_CURRENT_DOCUMENT_PATH': self.env_get_document_path,
'XEDIT_CURRENT_DOCUMENT_DIR': self.env_get_document_dir,
'XEDIT_CURRENT_DOCUMENT_TYPE': self.env_get_document_type,
'XEDIT_DOCUMENTS_URI': self.env_get_documents_uri,
'XEDIT_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('(\\\\*)\\$PLUMA_CURRENT_WORD', snippet['text'])
matches = re.findall('(\\\\*)\\$XEDIT_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('(\\\\*)\\$PLUMA_CURRENT_LINE', snippet['text'])
matches = re.findall('(\\\\*)\\$XEDIT_CURRENT_LINE', snippet['text'])
for match in matches:
if len(match) % 2 == 0:
@@ -865,19 +865,19 @@ class Document:
dirname = ''
ruri = ''
if pluma.utils.uri_has_file_scheme(uri):
if xedit.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['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
os.environ['XEDIT_DROP_DOCUMENT_URI'] = uri
os.environ['XEDIT_DROP_DOCUMENT_NAME'] = name
os.environ['XEDIT_DROP_DOCUMENT_SCHEME'] = scheme
os.environ['XEDIT_DROP_DOCUMENT_PATH'] = pathname
os.environ['XEDIT_DROP_DOCUMENT_DIR'] = dirname
os.environ['XEDIT_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['PLUMA_DROP_DOCUMENT_RELATIVE_PATH'] = relpath
os.environ['XEDIT_DROP_DOCUMENT_RELATIVE_PATH'] = relpath
mark = buf.get_mark('gtk_drag_target')

View File

@@ -1,4 +1,4 @@
# Pluma snippets plugin
# Xedit snippets plugin
# Copyright (C) 2005-2006 Jesse van den Kieboom <jesse@icecrew.nl>
#
# 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('PlumaSnippetsPluginContext', context)
view.get_buffer().set_data('XeditSnippetsPluginContext', 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('PlumaSnippetsPluginContext', None)
view.get_buffer().set_data('XeditSnippetsPluginContext', None)
def get_buffer_context(buf):
return buf.get_data('PlumaSnippetsPluginContext')
return buf.get_data('XeditSnippetsPluginContext')
def snippets_debug(*s):
return

View File

@@ -1,4 +1,4 @@
# Pluma snippets plugin
# Xedit snippets plugin
# Copyright (C) 2005-2006 Jesse van den Kieboom <jesse@icecrew.nl>
#
# This program is free software; you can redistribute it and/or modify

Some files were not shown because too many files have changed in this diff Show More