Renamed Xedit -> Xed (avoid name clash with x11-apps's xedit)

This commit is contained in:
Clement Lefebvre
2016-02-04 09:20:42 +00:00
parent c8dd785ea8
commit 16eacdc3f4
487 changed files with 104410 additions and 104432 deletions

View File

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

View File

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

View File

@@ -1,5 +1,5 @@
/*
* xedit-changecase-plugin.c
* xed-changecase-plugin.c
*
* Copyright (C) 2004-2005 - Paolo Borelli
*
@@ -24,16 +24,16 @@
#include <config.h>
#endif
#include "xedit-changecase-plugin.h"
#include "xed-changecase-plugin.h"
#include <glib/gi18n-lib.h>
#include <gmodule.h>
#include <xedit/xedit-debug.h>
#include <xed/xed-debug.h>
#define WINDOW_DATA_KEY "XeditChangecasePluginWindowData"
#define WINDOW_DATA_KEY "XedChangecasePluginWindowData"
XEDIT_PLUGIN_REGISTER_TYPE(XeditChangecasePlugin, xedit_changecase_plugin)
XED_PLUGIN_REGISTER_TYPE(XedChangecasePlugin, xed_changecase_plugin)
typedef enum {
TO_UPPER_CASE,
@@ -149,15 +149,15 @@ do_title_case (GtkTextBuffer *buffer,
}
static void
change_case (XeditWindow *window,
change_case (XedWindow *window,
ChangeCaseChoice choice)
{
XeditDocument *doc;
XedDocument *doc;
GtkTextIter start, end;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
doc = xedit_window_get_active_document (window);
doc = xed_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 (XeditWindow *window,
static void
upper_case_cb (GtkAction *action,
XeditWindow *window)
XedWindow *window)
{
change_case (window, TO_UPPER_CASE);
}
static void
lower_case_cb (GtkAction *action,
XeditWindow *window)
XedWindow *window)
{
change_case (window, TO_LOWER_CASE);
}
static void
invert_case_cb (GtkAction *action,
XeditWindow *window)
XedWindow *window)
{
change_case (window, INVERT_CASE);
}
static void
title_case_cb (GtkAction *action,
XeditWindow *window)
XedWindow *window)
{
change_case (window, TO_TITLE_CASE);
}
@@ -251,17 +251,17 @@ const gchar submenu[] =
"</ui>";
static void
xedit_changecase_plugin_init (XeditChangecasePlugin *plugin)
xed_changecase_plugin_init (XedChangecasePlugin *plugin)
{
xedit_debug_message (DEBUG_PLUGINS, "XeditChangecasePlugin initializing");
xed_debug_message (DEBUG_PLUGINS, "XedChangecasePlugin initializing");
}
static void
xedit_changecase_plugin_finalize (GObject *object)
xed_changecase_plugin_finalize (GObject *object)
{
G_OBJECT_CLASS (xedit_changecase_plugin_parent_class)->finalize (object);
G_OBJECT_CLASS (xed_changecase_plugin_parent_class)->finalize (object);
xedit_debug_message (DEBUG_PLUGINS, "XeditChangecasePlugin finalizing");
xed_debug_message (DEBUG_PLUGINS, "XedChangecasePlugin finalizing");
}
typedef struct
@@ -279,16 +279,16 @@ free_window_data (WindowData *data)
}
static void
update_ui_real (XeditWindow *window,
update_ui_real (XedWindow *window,
WindowData *data)
{
GtkTextView *view;
GtkAction *action;
gboolean sensitive = FALSE;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
view = GTK_TEXT_VIEW (xedit_window_get_active_view (window));
view = GTK_TEXT_VIEW (xed_window_get_active_view (window));
if (view != NULL)
{
@@ -305,20 +305,20 @@ update_ui_real (XeditWindow *window,
}
static void
impl_activate (XeditPlugin *plugin,
XeditWindow *window)
impl_activate (XedPlugin *plugin,
XedWindow *window)
{
GtkUIManager *manager;
WindowData *data;
GError *error = NULL;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
data = g_slice_new (WindowData);
manager = xedit_window_get_ui_manager (window);
manager = xed_window_get_ui_manager (window);
data->action_group = gtk_action_group_new ("XeditChangecasePluginActions");
data->action_group = gtk_action_group_new ("XedChangecasePluginActions");
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 (XeditPlugin *plugin,
}
static void
impl_deactivate (XeditPlugin *plugin,
XeditWindow *window)
impl_deactivate (XedPlugin *plugin,
XedWindow *window)
{
GtkUIManager *manager;
WindowData *data;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
manager = xedit_window_get_ui_manager (window);
manager = xed_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 (XeditPlugin *plugin,
}
static void
impl_update_ui (XeditPlugin *plugin,
XeditWindow *window)
impl_update_ui (XedPlugin *plugin,
XedWindow *window)
{
WindowData *data;
xedit_debug (DEBUG_PLUGINS);
xed_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 (XeditPlugin *plugin,
}
static void
xedit_changecase_plugin_class_init (XeditChangecasePluginClass *klass)
xed_changecase_plugin_class_init (XedChangecasePluginClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
XeditPluginClass *plugin_class = XEDIT_PLUGIN_CLASS (klass);
XedPluginClass *plugin_class = XED_PLUGIN_CLASS (klass);
object_class->finalize = xedit_changecase_plugin_finalize;
object_class->finalize = xed_changecase_plugin_finalize;
plugin_class->activate = impl_activate;
plugin_class->deactivate = impl_deactivate;

View File

@@ -0,0 +1,72 @@
/*
* xed-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 __XED_CHANGECASE_PLUGIN_H__
#define __XED_CHANGECASE_PLUGIN_H__
#include <glib.h>
#include <glib-object.h>
#include <xed/xed-plugin.h>
G_BEGIN_DECLS
/*
* Type checking and casting macros
*/
#define XED_TYPE_CHANGECASE_PLUGIN (xed_changecase_plugin_get_type ())
#define XED_CHANGECASE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XED_TYPE_CHANGECASE_PLUGIN, XedChangecasePlugin))
#define XED_CHANGECASE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XED_TYPE_CHANGECASE_PLUGIN, XedChangecasePluginClass))
#define XED_IS_CHANGECASE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XED_TYPE_CHANGECASE_PLUGIN))
#define XED_IS_CHANGECASE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XED_TYPE_CHANGECASE_PLUGIN))
#define XED_CHANGECASE_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XED_TYPE_CHANGECASE_PLUGIN, XedChangecasePluginClass))
/*
* Main object structure
*/
typedef struct _XedChangecasePlugin XedChangecasePlugin;
struct _XedChangecasePlugin
{
XedPlugin parent_instance;
};
/*
* Class definition
*/
typedef struct _XedChangecasePluginClass XedChangecasePluginClass;
struct _XedChangecasePluginClass
{
XedPluginClass parent_class;
};
/*
* Public methods
*/
GType xed_changecase_plugin_get_type (void) G_GNUC_CONST;
/* All the plugins must implement this function */
G_MODULE_EXPORT GType register_xed_plugin (GTypeModule *module);
G_END_DECLS
#endif /* __XED_CHANGECASE_PLUGIN_H__ */

View File

@@ -1,72 +0,0 @@
/*
* 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 = $(XEDIT_PLUGINS_LIBS_DIR)
plugindir = $(XED_PLUGINS_LIBS_DIR)
AM_CPPFLAGS = \
-I$(top_srcdir) \
$(XEDIT_CFLAGS) \
$(XED_CFLAGS) \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS)
plugin_LTLIBRARIES = libdocinfo.la
libdocinfo_la_SOURCES = \
xedit-docinfo-plugin.h \
xedit-docinfo-plugin.c
xed-docinfo-plugin.h \
xed-docinfo-plugin.c
libdocinfo_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
libdocinfo_la_LIBADD = $(XEDIT_LIBS)
libdocinfo_la_LIBADD = $(XED_LIBS)
uidir = $(XEDIT_PLUGINS_DATA_DIR)/docinfo
uidir = $(XED_PLUGINS_DATA_DIR)/docinfo
ui_DATA = docinfo.ui
plugin_in_files = docinfo.xedit-plugin.desktop.in
plugin_in_files = docinfo.xed-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
%.xed-plugin: %.xed-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:.xedit-plugin.desktop.in=.xedit-plugin)
plugin_DATA = $(plugin_in_files:.xed-plugin.desktop.in=.xed-plugin)
EXTRA_DIST = $(ui_DATA) $(plugin_in_files)

View File

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

View File

@@ -1,5 +1,5 @@
/*
* xedit-docinfo-plugin.c
* xed-docinfo-plugin.c
*
* Copyright (C) 2002-2005 Paolo Maggi
*
@@ -24,7 +24,7 @@
#include <config.h>
#endif
#include "xedit-docinfo-plugin.h"
#include "xed-docinfo-plugin.h"
#include <string.h> /* For strlen (...) */
@@ -32,13 +32,13 @@
#include <pango/pango-break.h>
#include <gmodule.h>
#include <xedit/xedit-debug.h>
#include <xedit/xedit-utils.h>
#include <xed/xed-debug.h>
#include <xed/xed-utils.h>
#define WINDOW_DATA_KEY "XeditDocInfoWindowData"
#define WINDOW_DATA_KEY "XedDocInfoWindowData"
#define MENU_PATH "/MenuBar/ToolsMenu/ToolsOps_2"
XEDIT_PLUGIN_REGISTER_TYPE(XeditDocInfoPlugin, xedit_docinfo_plugin)
XED_PLUGIN_REGISTER_TYPE(XedDocInfoPlugin, xed_docinfo_plugin)
typedef struct
{
@@ -59,7 +59,7 @@ typedef struct
typedef struct
{
XeditPlugin *plugin;
XedPlugin *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,
XeditWindow *window);
XedWindow *window);
static void
docinfo_dialog_destroy_cb (GObject *obj,
WindowData *data)
{
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
if (data != NULL)
{
@@ -85,7 +85,7 @@ docinfo_dialog_destroy_cb (GObject *obj,
}
static DocInfoDialog *
get_docinfo_dialog (XeditWindow *window,
get_docinfo_dialog (XedWindow *window,
WindowData *data)
{
DocInfoDialog *dialog;
@@ -95,13 +95,13 @@ get_docinfo_dialog (XeditWindow *window,
GtkWidget *error_widget;
gboolean ret;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
dialog = g_new (DocInfoDialog, 1);
data_dir = xedit_plugin_get_data_dir (data->plugin);
data_dir = xed_plugin_get_data_dir (data->plugin);
ui_file = g_build_filename (data_dir, "docinfo.ui", NULL);
ret = xedit_utils_get_ui_objects (ui_file,
ret = xed_utils_get_ui_objects (ui_file,
NULL,
&error_widget,
"dialog", &dialog->dialog,
@@ -128,7 +128,7 @@ get_docinfo_dialog (XeditWindow *window,
const gchar *err_message;
err_message = gtk_label_get_label (GTK_LABEL (error_widget));
xedit_warning (GTK_WINDOW (window), "%s", err_message);
xed_warning (GTK_WINDOW (window), "%s", err_message);
g_free (dialog);
gtk_widget_destroy (error_widget);
@@ -155,7 +155,7 @@ get_docinfo_dialog (XeditWindow *window,
}
static void
calculate_info (XeditDocument *doc,
calculate_info (XedDocument *doc,
GtkTextIter *start,
GtkTextIter *end,
gint *chars,
@@ -165,7 +165,7 @@ calculate_info (XeditDocument *doc,
{
gchar *text;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
text = gtk_text_buffer_get_slice (GTK_TEXT_BUFFER (doc),
start,
@@ -210,7 +210,7 @@ calculate_info (XeditDocument *doc,
}
static void
docinfo_real (XeditDocument *doc,
docinfo_real (XedDocument *doc,
DocInfoDialog *dialog)
{
GtkTextIter start, end;
@@ -222,7 +222,7 @@ docinfo_real (XeditDocument *doc,
gchar *tmp_str;
gchar *doc_name;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
gtk_text_buffer_get_bounds (GTK_TEXT_BUFFER (doc),
&start,
@@ -237,13 +237,13 @@ docinfo_real (XeditDocument *doc,
if (chars == 0)
lines = 0;
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);
xed_debug_message (DEBUG_PLUGINS, "Chars: %d", chars);
xed_debug_message (DEBUG_PLUGINS, "Lines: %d", lines);
xed_debug_message (DEBUG_PLUGINS, "Words: %d", words);
xed_debug_message (DEBUG_PLUGINS, "Chars non-space: %d", chars - white_chars);
xed_debug_message (DEBUG_PLUGINS, "Bytes: %d", bytes);
doc_name = xedit_document_get_short_name_for_display (doc);
doc_name = xed_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 (XeditDocument *doc,
}
static void
selectioninfo_real (XeditDocument *doc,
selectioninfo_real (XedDocument *doc,
DocInfoDialog *dialog)
{
gboolean sel;
@@ -283,7 +283,7 @@ selectioninfo_real (XeditDocument *doc,
gint bytes = 0;
gchar *tmp_str;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
sel = gtk_text_buffer_get_selection_bounds (GTK_TEXT_BUFFER (doc),
&start,
@@ -297,11 +297,11 @@ selectioninfo_real (XeditDocument *doc,
&start, &end,
&chars, &words, &white_chars, &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);
xed_debug_message (DEBUG_PLUGINS, "Selected chars: %d", chars);
xed_debug_message (DEBUG_PLUGINS, "Selected lines: %d", lines);
xed_debug_message (DEBUG_PLUGINS, "Selected words: %d", words);
xed_debug_message (DEBUG_PLUGINS, "Selected chars non-space: %d", chars - white_chars);
xed_debug_message (DEBUG_PLUGINS, "Selected bytes: %d", bytes);
gtk_widget_set_sensitive (dialog->selection_vbox, TRUE);
}
@@ -309,7 +309,7 @@ selectioninfo_real (XeditDocument *doc,
{
gtk_widget_set_sensitive (dialog->selection_vbox, FALSE);
xedit_debug_message (DEBUG_PLUGINS, "Selection empty");
xed_debug_message (DEBUG_PLUGINS, "Selection empty");
}
if (chars == 0)
@@ -338,17 +338,17 @@ selectioninfo_real (XeditDocument *doc,
static void
docinfo_cb (GtkAction *action,
XeditWindow *window)
XedWindow *window)
{
XeditDocument *doc;
XedDocument *doc;
WindowData *data;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
data = (WindowData *) g_object_get_data (G_OBJECT (window),
WINDOW_DATA_KEY);
doc = xedit_window_get_active_document (window);
doc = xed_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,
XeditWindow *window)
XedWindow *window)
{
WindowData *data;
xedit_debug (DEBUG_PLUGINS);
xed_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:
{
xedit_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_CLOSE");
xed_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:
{
XeditDocument *doc;
XedDocument *doc;
xedit_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_OK");
xed_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_OK");
doc = xedit_window_get_active_document (window);
doc = xed_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);
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
g_object_unref (data->plugin);
@@ -446,14 +446,14 @@ free_window_data (WindowData *data)
}
static void
update_ui_real (XeditWindow *window,
update_ui_real (XedWindow *window,
WindowData *data)
{
XeditView *view;
XedView *view;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
view = xedit_window_get_active_view (window);
view = xed_window_get_active_view (window);
gtk_action_group_set_sensitive (data->ui_action_group,
(view != NULL));
@@ -467,33 +467,33 @@ update_ui_real (XeditWindow *window,
}
static void
xedit_docinfo_plugin_init (XeditDocInfoPlugin *plugin)
xed_docinfo_plugin_init (XedDocInfoPlugin *plugin)
{
xedit_debug_message (DEBUG_PLUGINS, "XeditDocInfoPlugin initializing");
xed_debug_message (DEBUG_PLUGINS, "XedDocInfoPlugin initializing");
}
static void
xedit_docinfo_plugin_finalize (GObject *object)
xed_docinfo_plugin_finalize (GObject *object)
{
xedit_debug_message (DEBUG_PLUGINS, "XeditDocInfoPlugin finalizing");
xed_debug_message (DEBUG_PLUGINS, "XedDocInfoPlugin finalizing");
G_OBJECT_CLASS (xedit_docinfo_plugin_parent_class)->finalize (object);
G_OBJECT_CLASS (xed_docinfo_plugin_parent_class)->finalize (object);
}
static void
impl_activate (XeditPlugin *plugin,
XeditWindow *window)
impl_activate (XedPlugin *plugin,
XedWindow *window)
{
GtkUIManager *manager;
WindowData *data;
xedit_debug (DEBUG_PLUGINS);
xed_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 ("XeditDocInfoPluginActions");
data->ui_action_group = gtk_action_group_new ("XedDocInfoPluginActions");
gtk_action_group_set_translation_domain (data->ui_action_group,
GETTEXT_PACKAGE);
@@ -502,7 +502,7 @@ impl_activate (XeditPlugin *plugin,
G_N_ELEMENTS (action_entries),
window);
manager = xedit_window_get_ui_manager (window);
manager = xed_window_get_ui_manager (window);
gtk_ui_manager_insert_action_group (manager,
data->ui_action_group,
-1);
@@ -527,15 +527,15 @@ impl_activate (XeditPlugin *plugin,
}
static void
impl_deactivate (XeditPlugin *plugin,
XeditWindow *window)
impl_deactivate (XedPlugin *plugin,
XedWindow *window)
{
GtkUIManager *manager;
WindowData *data;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
manager = xedit_window_get_ui_manager (window);
manager = xed_window_get_ui_manager (window);
data = (WindowData *) g_object_get_data (G_OBJECT (window),
WINDOW_DATA_KEY);
@@ -552,12 +552,12 @@ impl_deactivate (XeditPlugin *plugin,
}
static void
impl_update_ui (XeditPlugin *plugin,
XeditWindow *window)
impl_update_ui (XedPlugin *plugin,
XedWindow *window)
{
WindowData *data;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
data = (WindowData *) g_object_get_data (G_OBJECT (window),
WINDOW_DATA_KEY);
@@ -568,12 +568,12 @@ impl_update_ui (XeditPlugin *plugin,
}
static void
xedit_docinfo_plugin_class_init (XeditDocInfoPluginClass *klass)
xed_docinfo_plugin_class_init (XedDocInfoPluginClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
XeditPluginClass *plugin_class = XEDIT_PLUGIN_CLASS (klass);
XedPluginClass *plugin_class = XED_PLUGIN_CLASS (klass);
object_class->finalize = xedit_docinfo_plugin_finalize;
object_class->finalize = xed_docinfo_plugin_finalize;
plugin_class->activate = impl_activate;
plugin_class->deactivate = impl_deactivate;

View File

@@ -0,0 +1,75 @@
/*
* xed-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 __XED_DOCINFO_PLUGIN_H__
#define __XED_DOCINFO_PLUGIN_H__
#include <glib.h>
#include <glib-object.h>
#include <xed/xed-plugin.h>
G_BEGIN_DECLS
/*
* Type checking and casting macros
*/
#define XED_TYPE_DOCINFO_PLUGIN (xed_docinfo_plugin_get_type ())
#define XED_DOCINFO_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XED_TYPE_DOCINFO_PLUGIN, XedDocInfoPlugin))
#define XED_DOCINFO_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XED_TYPE_DOCINFO_PLUGIN, XedDocInfoPluginClass))
#define XED_IS_DOCINFO_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XED_TYPE_DOCINFO_PLUGIN))
#define XED_IS_DOCINFO_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XED_TYPE_DOCINFO_PLUGIN))
#define XED_DOCINFO_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XED_TYPE_DOCINFO_PLUGIN, XedDocInfoPluginClass))
/* Private structure type */
typedef struct _XedDocInfoPluginPrivate XedDocInfoPluginPrivate;
/*
* Main object structure
*/
typedef struct _XedDocInfoPlugin XedDocInfoPlugin;
struct _XedDocInfoPlugin
{
XedPlugin parent_instance;
};
/*
* Class definition
*/
typedef struct _XedDocInfoPluginClass XedDocInfoPluginClass;
struct _XedDocInfoPluginClass
{
XedPluginClass parent_class;
};
/*
* Public methods
*/
GType xed_docinfo_plugin_get_type (void) G_GNUC_CONST;
/* All the plugins must implement this function */
G_MODULE_EXPORT GType register_xed_plugin (GTypeModule *module);
G_END_DECLS
#endif /* __XED_DOCINFO_PLUGIN_H__ */

View File

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

View File

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

View File

@@ -1,5 +1,5 @@
/*
* xedit-file-bookmarks-store.c - Xedit plugin providing easy file access
* xed-file-bookmarks-store.c - Xed 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 <xedit/xedit-utils.h>
#include <xedit/xedit-plugin.h>
#include <xed/xed-utils.h>
#include <xed/xed-plugin.h>
#include "xedit-file-bookmarks-store.h"
#include "xedit-file-browser-utils.h"
#include "xed-file-bookmarks-store.h"
#include "xed-file-browser-utils.h"
#define XEDIT_FILE_BOOKMARKS_STORE_GET_PRIVATE(object)( \
G_TYPE_INSTANCE_GET_PRIVATE((object), XEDIT_TYPE_FILE_BOOKMARKS_STORE, \
XeditFileBookmarksStorePrivate))
#define XED_FILE_BOOKMARKS_STORE_GET_PRIVATE(object)( \
G_TYPE_INSTANCE_GET_PRIVATE((object), XED_TYPE_FILE_BOOKMARKS_STORE, \
XedFileBookmarksStorePrivate))
struct _XeditFileBookmarksStorePrivate
struct _XedFileBookmarksStorePrivate
{
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,
XeditFileBookmarksStore *model);
XedFileBookmarksStore *model);
static void on_bookmarks_file_changed (GFileMonitor * monitor,
GFile * file,
GFile * other_file,
GFileMonitorEvent event_type,
XeditFileBookmarksStore * model);
XedFileBookmarksStore * model);
static gboolean find_with_flags (GtkTreeModel * model,
GtkTreeIter * iter,
gpointer obj,
guint flags,
guint notflags);
XEDIT_PLUGIN_DEFINE_TYPE(XeditFileBookmarksStore, xedit_file_bookmarks_store, GTK_TYPE_TREE_STORE)
XED_PLUGIN_DEFINE_TYPE(XedFileBookmarksStore, xed_file_bookmarks_store, GTK_TYPE_TREE_STORE)
static void
xedit_file_bookmarks_store_dispose (GObject * object)
xed_file_bookmarks_store_dispose (GObject * object)
{
XeditFileBookmarksStore *obj = XEDIT_FILE_BOOKMARKS_STORE (object);
XedFileBookmarksStore *obj = XED_FILE_BOOKMARKS_STORE (object);
if (obj->priv->volume_monitor != NULL) {
g_signal_handlers_disconnect_by_func (obj->priv->volume_monitor,
@@ -77,35 +77,35 @@ xedit_file_bookmarks_store_dispose (GObject * object)
obj->priv->bookmarks_monitor = NULL;
}
G_OBJECT_CLASS (xedit_file_bookmarks_store_parent_class)->dispose (object);
G_OBJECT_CLASS (xed_file_bookmarks_store_parent_class)->dispose (object);
}
static void
xedit_file_bookmarks_store_finalize (GObject * object)
xed_file_bookmarks_store_finalize (GObject * object)
{
G_OBJECT_CLASS (xedit_file_bookmarks_store_parent_class)->finalize (object);
G_OBJECT_CLASS (xed_file_bookmarks_store_parent_class)->finalize (object);
}
static void
xedit_file_bookmarks_store_class_init (XeditFileBookmarksStoreClass *klass)
xed_file_bookmarks_store_class_init (XedFileBookmarksStoreClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->dispose = xedit_file_bookmarks_store_dispose;
object_class->finalize = xedit_file_bookmarks_store_finalize;
object_class->dispose = xed_file_bookmarks_store_dispose;
object_class->finalize = xed_file_bookmarks_store_finalize;
g_type_class_add_private (object_class, sizeof (XeditFileBookmarksStorePrivate));
g_type_class_add_private (object_class, sizeof (XedFileBookmarksStorePrivate));
}
static void
xedit_file_bookmarks_store_init (XeditFileBookmarksStore * obj)
xed_file_bookmarks_store_init (XedFileBookmarksStore * obj)
{
obj->priv = XEDIT_FILE_BOOKMARKS_STORE_GET_PRIVATE (obj);
obj->priv = XED_FILE_BOOKMARKS_STORE_GET_PRIVATE (obj);
}
/* Private */
static void
add_node (XeditFileBookmarksStore *model,
add_node (XedFileBookmarksStore *model,
GdkPixbuf *pixbuf,
const gchar *name,
GObject *obj,
@@ -117,10 +117,10 @@ add_node (XeditFileBookmarksStore *model,
gtk_tree_store_append (GTK_TREE_STORE (model), &newiter, NULL);
gtk_tree_store_set (GTK_TREE_STORE (model), &newiter,
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,
XED_FILE_BOOKMARKS_STORE_COLUMN_ICON, pixbuf,
XED_FILE_BOOKMARKS_STORE_COLUMN_NAME, name,
XED_FILE_BOOKMARKS_STORE_COLUMN_OBJECT, obj,
XED_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, flags,
-1);
if (iter != NULL)
@@ -128,7 +128,7 @@ add_node (XeditFileBookmarksStore *model,
}
static gboolean
add_file (XeditFileBookmarksStore *model,
add_file (XedFileBookmarksStore *model,
GFile *file,
const gchar *name,
guint flags,
@@ -144,24 +144,24 @@ add_file (XeditFileBookmarksStore *model,
return FALSE;
}
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 (flags & XED_FILE_BOOKMARKS_STORE_IS_HOME)
pixbuf = xed_file_browser_utils_pixbuf_from_theme ("user-home", GTK_ICON_SIZE_MENU);
else if (flags & XED_FILE_BOOKMARKS_STORE_IS_DESKTOP)
pixbuf = xed_file_browser_utils_pixbuf_from_theme ("user-desktop", GTK_ICON_SIZE_MENU);
else if (flags & XED_FILE_BOOKMARKS_STORE_IS_ROOT)
pixbuf = xed_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 = xedit_file_browser_utils_pixbuf_from_file (file, GTK_ICON_SIZE_MENU);
pixbuf = xed_file_browser_utils_pixbuf_from_file (file, GTK_ICON_SIZE_MENU);
} else {
pixbuf = xedit_file_browser_utils_pixbuf_from_theme ("folder", GTK_ICON_SIZE_MENU);
pixbuf = xed_file_browser_utils_pixbuf_from_theme ("folder", GTK_ICON_SIZE_MENU);
}
}
if (name == NULL) {
newname = xedit_file_browser_utils_file_basename (file);
newname = xed_file_browser_utils_file_basename (file);
} else {
newname = g_strdup (name);
}
@@ -177,7 +177,7 @@ add_file (XeditFileBookmarksStore *model,
}
static void
check_mount_separator (XeditFileBookmarksStore * model, guint flags,
check_mount_separator (XedFileBookmarksStore * model, guint flags,
gboolean added)
{
GtkTreeIter iter;
@@ -186,12 +186,12 @@ check_mount_separator (XeditFileBookmarksStore * model, guint flags,
found =
find_with_flags (GTK_TREE_MODEL (model), &iter, NULL,
flags |
XEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR, 0);
XED_FILE_BOOKMARKS_STORE_IS_SEPARATOR, 0);
if (added && !found) {
/* Add the separator */
add_node (model, NULL, NULL, NULL,
flags | XEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR,
flags | XED_FILE_BOOKMARKS_STORE_IS_SEPARATOR,
NULL);
} else if (!added && found) {
remove_node (GTK_TREE_MODEL (model), &iter);
@@ -199,7 +199,7 @@ check_mount_separator (XeditFileBookmarksStore * model, guint flags,
}
static void
init_special_directories (XeditFileBookmarksStore * model)
init_special_directories (XedFileBookmarksStore * model)
{
gchar const *path;
GFile * file;
@@ -208,8 +208,8 @@ init_special_directories (XeditFileBookmarksStore * model)
if (path != NULL)
{
file = g_file_new_for_path (path);
add_file (model, file, NULL, XEDIT_FILE_BOOKMARKS_STORE_IS_HOME |
XEDIT_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR, NULL);
add_file (model, file, NULL, XED_FILE_BOOKMARKS_STORE_IS_HOME |
XED_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR, NULL);
g_object_unref (file);
}
@@ -217,8 +217,8 @@ init_special_directories (XeditFileBookmarksStore * model)
if (path != NULL)
{
file = g_file_new_for_path (path);
add_file (model, file, NULL, XEDIT_FILE_BOOKMARKS_STORE_IS_DESKTOP |
XEDIT_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR, NULL);
add_file (model, file, NULL, XED_FILE_BOOKMARKS_STORE_IS_DESKTOP |
XED_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR, NULL);
g_object_unref (file);
}
@@ -226,16 +226,16 @@ init_special_directories (XeditFileBookmarksStore * model)
if (path != NULL)
{
file = g_file_new_for_path (path);
add_file (model, file, NULL, XEDIT_FILE_BOOKMARKS_STORE_IS_DOCUMENTS |
XEDIT_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR, NULL);
add_file (model, file, NULL, XED_FILE_BOOKMARKS_STORE_IS_DOCUMENTS |
XED_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR, NULL);
g_object_unref (file);
}
file = g_file_new_for_uri ("file:///");
add_file (model, file, _("File System"), XEDIT_FILE_BOOKMARKS_STORE_IS_ROOT, NULL);
add_file (model, file, _("File System"), XED_FILE_BOOKMARKS_STORE_IS_ROOT, NULL);
g_object_unref (file);
check_mount_separator (model, XEDIT_FILE_BOOKMARKS_STORE_IS_ROOT, TRUE);
check_mount_separator (model, XED_FILE_BOOKMARKS_STORE_IS_ROOT, TRUE);
}
static void
@@ -246,7 +246,7 @@ get_fs_properties (gpointer fs,
{
GIcon *icon = NULL;
*flags = XEDIT_FILE_BOOKMARKS_STORE_IS_FS;
*flags = XED_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 |= XEDIT_FILE_BOOKMARKS_STORE_IS_DRIVE;
*flags |= XED_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 |= XEDIT_FILE_BOOKMARKS_STORE_IS_VOLUME;
*flags |= XED_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 |= XEDIT_FILE_BOOKMARKS_STORE_IS_MOUNT;
*flags |= XED_FILE_BOOKMARKS_STORE_IS_MOUNT;
}
if (icon)
{
*pixbuf = xedit_file_browser_utils_pixbuf_from_icon (icon, GTK_ICON_SIZE_MENU);
*pixbuf = xed_file_browser_utils_pixbuf_from_icon (icon, GTK_ICON_SIZE_MENU);
g_object_unref (icon);
}
}
static void
add_fs (XeditFileBookmarksStore *model,
add_fs (XedFileBookmarksStore *model,
gpointer fs,
guint flags,
GtkTreeIter *iter)
@@ -297,15 +297,15 @@ add_fs (XeditFileBookmarksStore *model,
g_object_unref (pixbuf);
g_free (name);
check_mount_separator (model, XEDIT_FILE_BOOKMARKS_STORE_IS_FS, TRUE);
check_mount_separator (model, XED_FILE_BOOKMARKS_STORE_IS_FS, TRUE);
}
static void
process_volume_cb (GVolume *volume,
XeditFileBookmarksStore *model)
XedFileBookmarksStore *model)
{
GMount *mount;
guint flags = XEDIT_FILE_BOOKMARKS_STORE_NONE;
guint flags = XED_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 (XeditFileBookmarksStore *model,
process_drive_novolumes (XedFileBookmarksStore *model,
GDrive *drive)
{
if (g_drive_is_media_removable (drive) &&
@@ -335,13 +335,13 @@ process_drive_novolumes (XeditFileBookmarksStore *model,
drives where media detection fails. We show the
drive and poll for media when the user activates
it */
add_fs (model, drive, XEDIT_FILE_BOOKMARKS_STORE_NONE, NULL);
add_fs (model, drive, XED_FILE_BOOKMARKS_STORE_NONE, NULL);
}
}
static void
process_drive_cb (GDrive *drive,
XeditFileBookmarksStore *model)
XedFileBookmarksStore *model)
{
GList *volumes;
@@ -360,7 +360,7 @@ process_drive_cb (GDrive *drive,
}
static void
init_drives (XeditFileBookmarksStore *model)
init_drives (XedFileBookmarksStore *model)
{
GList *drives;
@@ -373,7 +373,7 @@ init_drives (XeditFileBookmarksStore *model)
static void
process_volume_nodrive_cb (GVolume *volume,
XeditFileBookmarksStore *model)
XedFileBookmarksStore *model)
{
GDrive *drive;
@@ -389,7 +389,7 @@ process_volume_nodrive_cb (GVolume *volume,
}
static void
init_volumes (XeditFileBookmarksStore *model)
init_volumes (XedFileBookmarksStore *model)
{
GList *volumes;
@@ -402,7 +402,7 @@ init_volumes (XeditFileBookmarksStore *model)
static void
process_mount_novolume_cb (GMount *mount,
XeditFileBookmarksStore *model)
XedFileBookmarksStore *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, XEDIT_FILE_BOOKMARKS_STORE_NONE, NULL);
add_fs (model, mount, XED_FILE_BOOKMARKS_STORE_NONE, NULL);
}
}
static void
init_mounts (XeditFileBookmarksStore *model)
init_mounts (XedFileBookmarksStore *model)
{
GList *mounts;
@@ -432,7 +432,7 @@ init_mounts (XeditFileBookmarksStore *model)
}
static void
init_fs (XeditFileBookmarksStore * model)
init_fs (XedFileBookmarksStore * model)
{
if (model->priv->volume_monitor == NULL) {
const gchar **ptr;
@@ -465,21 +465,21 @@ init_fs (XeditFileBookmarksStore * model)
}
static gboolean
add_bookmark (XeditFileBookmarksStore * model,
add_bookmark (XedFileBookmarksStore * model,
gchar const * name,
gchar const * uri)
{
GFile * file;
gboolean ret;
guint flags = XEDIT_FILE_BOOKMARKS_STORE_IS_BOOKMARK;
guint flags = XED_FILE_BOOKMARKS_STORE_IS_BOOKMARK;
GtkTreeIter iter;
file = g_file_new_for_uri (uri);
if (g_file_is_native (file)) {
flags |= XEDIT_FILE_BOOKMARKS_STORE_IS_LOCAL_BOOKMARK;
flags |= XED_FILE_BOOKMARKS_STORE_IS_LOCAL_BOOKMARK;
} else {
flags |= XEDIT_FILE_BOOKMARKS_STORE_IS_REMOTE_BOOKMARK;
flags |= XED_FILE_BOOKMARKS_STORE_IS_REMOTE_BOOKMARK;
}
ret = add_file (model, file, name, flags, &iter);
@@ -490,7 +490,7 @@ add_bookmark (XeditFileBookmarksStore * model,
}
static void
init_bookmarks (XeditFileBookmarksStore * model)
init_bookmarks (XedFileBookmarksStore * model)
{
gchar *bookmarks;
GError *error = NULL;
@@ -524,7 +524,7 @@ init_bookmarks (XeditFileBookmarksStore * model)
/* the bookmarks file should contain valid
* URIs, but paranoia is good */
if (xedit_utils_is_valid_uri (*line)) {
if (xed_utils_is_valid_uri (*line)) {
added |= add_bookmark (model, name, *line);
}
}
@@ -554,20 +554,20 @@ init_bookmarks (XeditFileBookmarksStore * model)
if (added) {
/* Bookmarks separator */
add_node (model, NULL, NULL, NULL,
XEDIT_FILE_BOOKMARKS_STORE_IS_BOOKMARK |
XEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR, NULL);
XED_FILE_BOOKMARKS_STORE_IS_BOOKMARK |
XED_FILE_BOOKMARKS_STORE_IS_SEPARATOR, NULL);
}
g_free (bookmarks);
}
static gint flags_order[] = {
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,
XED_FILE_BOOKMARKS_STORE_IS_HOME,
XED_FILE_BOOKMARKS_STORE_IS_DESKTOP,
XED_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR,
XED_FILE_BOOKMARKS_STORE_IS_ROOT,
XED_FILE_BOOKMARKS_STORE_IS_FS,
XED_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,
XEDIT_FILE_BOOKMARKS_STORE_COLUMN_NAME, &n1,
XEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f1,
XED_FILE_BOOKMARKS_STORE_COLUMN_NAME, &n1,
XED_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f1,
-1);
gtk_tree_model_get (model, b,
XEDIT_FILE_BOOKMARKS_STORE_COLUMN_NAME, &n2,
XEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f2,
XED_FILE_BOOKMARKS_STORE_COLUMN_NAME, &n2,
XED_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f2,
-1);
/* do not sort actual bookmarks to keep same order as in caja */
if ((f1 & XEDIT_FILE_BOOKMARKS_STORE_IS_BOOKMARK) &&
(f2 & XEDIT_FILE_BOOKMARKS_STORE_IS_BOOKMARK))
if ((f1 & XED_FILE_BOOKMARKS_STORE_IS_BOOKMARK) &&
(f2 & XED_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 = XEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR;
sep = XED_FILE_BOOKMARKS_STORE_IS_SEPARATOR;
gtk_tree_model_get (model, a,
XEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f1,
XED_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f1,
-1);
gtk_tree_model_get (model, b,
XEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f2,
XED_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,
XEDIT_FILE_BOOKMARKS_STORE_COLUMN_OBJECT,
XED_FILE_BOOKMARKS_STORE_COLUMN_OBJECT,
&childobj,
XEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS,
XED_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,
XEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &flags,
XED_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &flags,
-1);
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,
if (!(flags & XED_FILE_BOOKMARKS_STORE_IS_SEPARATOR)) {
if (flags & XED_FILE_BOOKMARKS_STORE_IS_FS) {
check_mount_separator (XED_FILE_BOOKMARKS_STORE (model),
flags & XED_FILE_BOOKMARKS_STORE_IS_FS,
FALSE);
}
}
@@ -733,19 +733,19 @@ remove_node (GtkTreeModel * model, GtkTreeIter * iter)
}
static void
remove_bookmarks (XeditFileBookmarksStore * model)
remove_bookmarks (XedFileBookmarksStore * model)
{
GtkTreeIter iter;
while (find_with_flags (GTK_TREE_MODEL (model), &iter, NULL,
XEDIT_FILE_BOOKMARKS_STORE_IS_BOOKMARK,
XED_FILE_BOOKMARKS_STORE_IS_BOOKMARK,
0)) {
remove_node (GTK_TREE_MODEL (model), &iter);
}
}
static void
initialize_fill (XeditFileBookmarksStore * model)
initialize_fill (XedFileBookmarksStore * model)
{
init_special_directories (model);
init_fs (model);
@@ -753,10 +753,10 @@ initialize_fill (XeditFileBookmarksStore * model)
}
/* Public */
XeditFileBookmarksStore *
xedit_file_bookmarks_store_new (void)
XedFileBookmarksStore *
xed_file_bookmarks_store_new (void)
{
XeditFileBookmarksStore *model;
XedFileBookmarksStore *model;
GType column_types[] = {
GDK_TYPE_PIXBUF,
G_TYPE_STRING,
@@ -764,9 +764,9 @@ xedit_file_bookmarks_store_new (void)
G_TYPE_UINT
};
model = g_object_new (XEDIT_TYPE_FILE_BOOKMARKS_STORE, NULL);
model = g_object_new (XED_TYPE_FILE_BOOKMARKS_STORE, NULL);
gtk_tree_store_set_column_types (GTK_TREE_STORE (model),
XEDIT_FILE_BOOKMARKS_STORE_N_COLUMNS,
XED_FILE_BOOKMARKS_STORE_N_COLUMNS,
column_types);
gtk_tree_sortable_set_default_sort_func (GTK_TREE_SORTABLE (model),
@@ -782,7 +782,7 @@ xedit_file_bookmarks_store_new (void)
}
gchar *
xedit_file_bookmarks_store_get_uri (XeditFileBookmarksStore * model,
xed_file_bookmarks_store_get_uri (XedFileBookmarksStore * model,
GtkTreeIter * iter)
{
GObject * obj;
@@ -791,22 +791,22 @@ xedit_file_bookmarks_store_get_uri (XeditFileBookmarksStore * model,
gchar * ret = NULL;
gboolean isfs;
g_return_val_if_fail (XEDIT_IS_FILE_BOOKMARKS_STORE (model), NULL);
g_return_val_if_fail (XED_IS_FILE_BOOKMARKS_STORE (model), NULL);
g_return_val_if_fail (iter != NULL, NULL);
gtk_tree_model_get (GTK_TREE_MODEL (model), iter,
XEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS,
XED_FILE_BOOKMARKS_STORE_COLUMN_FLAGS,
&flags,
XEDIT_FILE_BOOKMARKS_STORE_COLUMN_OBJECT,
XED_FILE_BOOKMARKS_STORE_COLUMN_OBJECT,
&obj,
-1);
if (obj == NULL)
return NULL;
isfs = (flags & XEDIT_FILE_BOOKMARKS_STORE_IS_FS);
isfs = (flags & XED_FILE_BOOKMARKS_STORE_IS_FS);
if (isfs && (flags & XEDIT_FILE_BOOKMARKS_STORE_IS_MOUNT))
if (isfs && (flags & XED_FILE_BOOKMARKS_STORE_IS_MOUNT))
{
file = g_mount_get_root (G_MOUNT (obj));
}
@@ -827,7 +827,7 @@ xedit_file_bookmarks_store_get_uri (XeditFileBookmarksStore * model,
}
void
xedit_file_bookmarks_store_refresh (XeditFileBookmarksStore * model)
xed_file_bookmarks_store_refresh (XedFileBookmarksStore * model)
{
gtk_tree_store_clear (GTK_TREE_STORE (model));
initialize_fill (model);
@@ -836,11 +836,11 @@ xedit_file_bookmarks_store_refresh (XeditFileBookmarksStore * model)
static void
on_fs_changed (GVolumeMonitor *monitor,
GObject *object,
XeditFileBookmarksStore *model)
XedFileBookmarksStore *model)
{
GtkTreeModel *tree_model = GTK_TREE_MODEL (model);
guint flags = XEDIT_FILE_BOOKMARKS_STORE_IS_FS;
guint noflags = XEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR;
guint flags = XED_FILE_BOOKMARKS_STORE_IS_FS;
guint noflags = XED_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,
XeditFileBookmarksStore * model)
XedFileBookmarksStore * model)
{
switch (event_type) {
case G_FILE_MONITOR_EVENT_CHANGED:

View File

@@ -0,0 +1,90 @@
/*
* xed-file-bookmarks-store.h - Xed 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 __XED_FILE_BOOKMARKS_STORE_H__
#define __XED_FILE_BOOKMARKS_STORE_H__
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define XED_TYPE_FILE_BOOKMARKS_STORE (xed_file_bookmarks_store_get_type ())
#define XED_FILE_BOOKMARKS_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XED_TYPE_FILE_BOOKMARKS_STORE, XedFileBookmarksStore))
#define XED_FILE_BOOKMARKS_STORE_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XED_TYPE_FILE_BOOKMARKS_STORE, XedFileBookmarksStore const))
#define XED_FILE_BOOKMARKS_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XED_TYPE_FILE_BOOKMARKS_STORE, XedFileBookmarksStoreClass))
#define XED_IS_FILE_BOOKMARKS_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XED_TYPE_FILE_BOOKMARKS_STORE))
#define XED_IS_FILE_BOOKMARKS_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XED_TYPE_FILE_BOOKMARKS_STORE))
#define XED_FILE_BOOKMARKS_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XED_TYPE_FILE_BOOKMARKS_STORE, XedFileBookmarksStoreClass))
typedef struct _XedFileBookmarksStore XedFileBookmarksStore;
typedef struct _XedFileBookmarksStoreClass XedFileBookmarksStoreClass;
typedef struct _XedFileBookmarksStorePrivate XedFileBookmarksStorePrivate;
enum
{
XED_FILE_BOOKMARKS_STORE_COLUMN_ICON = 0,
XED_FILE_BOOKMARKS_STORE_COLUMN_NAME,
XED_FILE_BOOKMARKS_STORE_COLUMN_OBJECT,
XED_FILE_BOOKMARKS_STORE_COLUMN_FLAGS,
XED_FILE_BOOKMARKS_STORE_N_COLUMNS
};
enum
{
XED_FILE_BOOKMARKS_STORE_NONE = 0,
XED_FILE_BOOKMARKS_STORE_IS_SEPARATOR = 1 << 0, /* Separator item */
XED_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR = 1 << 1, /* Special user dir */
XED_FILE_BOOKMARKS_STORE_IS_HOME = 1 << 2, /* The special Home user directory */
XED_FILE_BOOKMARKS_STORE_IS_DESKTOP = 1 << 3, /* The special Desktop user directory */
XED_FILE_BOOKMARKS_STORE_IS_DOCUMENTS = 1 << 4, /* The special Documents user directory */
XED_FILE_BOOKMARKS_STORE_IS_FS = 1 << 5, /* A mount object */
XED_FILE_BOOKMARKS_STORE_IS_MOUNT = 1 << 6, /* A mount object */
XED_FILE_BOOKMARKS_STORE_IS_VOLUME = 1 << 7, /* A volume object */
XED_FILE_BOOKMARKS_STORE_IS_DRIVE = 1 << 8, /* A drive object */
XED_FILE_BOOKMARKS_STORE_IS_ROOT = 1 << 9, /* The root file system (file:///) */
XED_FILE_BOOKMARKS_STORE_IS_BOOKMARK = 1 << 10, /* A gtk bookmark */
XED_FILE_BOOKMARKS_STORE_IS_REMOTE_BOOKMARK = 1 << 11, /* A remote gtk bookmark */
XED_FILE_BOOKMARKS_STORE_IS_LOCAL_BOOKMARK = 1 << 12 /* A local gtk bookmark */
};
struct _XedFileBookmarksStore
{
GtkTreeStore parent;
XedFileBookmarksStorePrivate *priv;
};
struct _XedFileBookmarksStoreClass
{
GtkTreeStoreClass parent_class;
};
GType xed_file_bookmarks_store_get_type (void) G_GNUC_CONST;
GType xed_file_bookmarks_store_register_type (GTypeModule * module);
XedFileBookmarksStore *xed_file_bookmarks_store_new (void);
gchar *xed_file_bookmarks_store_get_uri (XedFileBookmarksStore * model,
GtkTreeIter * iter);
void xed_file_bookmarks_store_refresh (XedFileBookmarksStore * model);
G_END_DECLS
#endif /* __XED_FILE_BOOKMARKS_STORE_H__ */
// ex:ts=8:noet:

View File

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

View File

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

View File

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

View File

@@ -1,5 +1,5 @@
/*
* xedit-file-browser-error.h - Xedit plugin providing easy file access
* xed-file-browser-error.h - Xed 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 __XEDIT_FILE_BROWSER_ERROR_H__
#define __XEDIT_FILE_BROWSER_ERROR_H__
#ifndef __XED_FILE_BROWSER_ERROR_H__
#define __XED_FILE_BROWSER_ERROR_H__
G_BEGIN_DECLS
typedef enum {
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;
XED_FILE_BROWSER_ERROR_NONE,
XED_FILE_BROWSER_ERROR_RENAME,
XED_FILE_BROWSER_ERROR_DELETE,
XED_FILE_BROWSER_ERROR_NEW_FILE,
XED_FILE_BROWSER_ERROR_NEW_DIRECTORY,
XED_FILE_BROWSER_ERROR_OPEN_DIRECTORY,
XED_FILE_BROWSER_ERROR_SET_ROOT,
XED_FILE_BROWSER_ERROR_LOAD_DIRECTORY,
XED_FILE_BROWSER_ERROR_NUM
} XedFileBrowserError;
G_END_DECLS
#endif /* __XEDIT_FILE_BROWSER_ERROR_H__ */
#endif /* __XED_FILE_BROWSER_ERROR_H__ */

View File

@@ -1,16 +1,16 @@
#include "xedit-file-browser-messages.h"
#include "xedit-file-browser-store.h"
#include <xedit/xedit-message.h>
#include "xed-file-browser-messages.h"
#include "xed-file-browser-store.h"
#include <xed/xed-message.h>
#define MESSAGE_OBJECT_PATH "/plugins/filebrowser"
#define WINDOW_DATA_KEY "XeditFileBrowserMessagesWindowData"
#define WINDOW_DATA_KEY "XedFileBrowserMessagesWindowData"
#define BUS_CONNECT(bus, name, data) xedit_message_bus_connect(bus, MESSAGE_OBJECT_PATH, #name, (XeditMessageCallback) message_##name##_cb, data, NULL)
#define BUS_CONNECT(bus, name, data) xed_message_bus_connect(bus, MESSAGE_OBJECT_PATH, #name, (XedMessageCallback) message_##name##_cb, data, NULL)
typedef struct
{
XeditWindow *window;
XeditMessage *message;
XedWindow *window;
XedMessage *message;
} MessageCacheData;
typedef struct
@@ -24,8 +24,8 @@ typedef struct
GList *merge_ids;
GtkActionGroup *merged_actions;
XeditMessageBus *bus;
XeditFileBrowserWidget *widget;
XedMessageBus *bus;
XedFileBrowserWidget *widget;
GHashTable *row_tracking;
GHashTable *filters;
@@ -35,19 +35,19 @@ typedef struct
{
gulong id;
XeditWindow *window;
XeditMessage *message;
XedWindow *window;
XedMessage *message;
} FilterData;
static WindowData *
window_data_new (XeditWindow *window,
XeditFileBrowserWidget *widget)
window_data_new (XedWindow *window,
XedFileBrowserWidget *widget)
{
WindowData *data = g_slice_new (WindowData);
GtkUIManager *manager;
GList *groups;
data->bus = xedit_window_get_message_bus (window);
data->bus = xed_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 (XeditWindow *window,
(GDestroyNotify)g_free,
NULL);
manager = xedit_file_browser_widget_get_ui_manager (widget);
manager = xed_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 (XeditWindow *window,
}
static WindowData *
get_window_data (XeditWindow * window)
get_window_data (XedWindow * window)
{
return (WindowData *) (g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY));
}
static void
window_data_free (XeditWindow *window)
window_data_free (XedWindow *window)
{
WindowData *data = get_window_data (window);
GtkUIManager *manager;
@@ -88,7 +88,7 @@ window_data_free (XeditWindow *window)
g_hash_table_destroy (data->row_tracking);
g_hash_table_destroy (data->filters);
manager = xedit_file_browser_widget_get_ui_manager (data->widget);
manager = xed_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 (XeditWindow *window)
}
static FilterData *
filter_data_new (XeditWindow *window,
XeditMessage *message)
filter_data_new (XedWindow *window,
XedMessage *message)
{
FilterData *data = g_slice_new (FilterData);
WindowData *wdata;
@@ -116,8 +116,8 @@ filter_data_new (XeditWindow *window,
wdata = get_window_data (window);
g_hash_table_insert (wdata->filters,
xedit_message_type_identifier (xedit_message_get_object_path (message),
xedit_message_get_method (message)),
xed_message_type_identifier (xed_message_get_object_path (message),
xed_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 = xedit_message_type_identifier (xedit_message_get_object_path (data->message),
xedit_message_get_method (data->message));
identifier = xed_message_type_identifier (xed_message_get_object_path (data->message),
xed_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 (XeditWindow *window,
XeditMessage *message)
message_cache_data_new (XedWindow *window,
XedMessage *message)
{
MessageCacheData *data = g_slice_new (MessageCacheData);
@@ -173,56 +173,56 @@ message_cache_data_new (XeditWindow *window,
}
static void
message_get_root_cb (XeditMessageBus *bus,
XeditMessage *message,
message_get_root_cb (XedMessageBus *bus,
XedMessage *message,
WindowData *data)
{
XeditFileBrowserStore *store;
XedFileBrowserStore *store;
gchar *uri;
store = xedit_file_browser_widget_get_browser_store (data->widget);
uri = xedit_file_browser_store_get_virtual_root (store);
store = xed_file_browser_widget_get_browser_store (data->widget);
uri = xed_file_browser_store_get_virtual_root (store);
xedit_message_set (message, "uri", uri, NULL);
xed_message_set (message, "uri", uri, NULL);
g_free (uri);
}
static void
message_set_root_cb (XeditMessageBus *bus,
XeditMessage *message,
message_set_root_cb (XedMessageBus *bus,
XedMessage *message,
WindowData *data)
{
gchar *root = NULL;
gchar *virtual = NULL;
xedit_message_get (message, "uri", &root, NULL);
xed_message_get (message, "uri", &root, NULL);
if (!root)
return;
if (xedit_message_has_key (message, "virtual"))
xedit_message_get (message, "virtual", &virtual, NULL);
if (xed_message_has_key (message, "virtual"))
xed_message_get (message, "virtual", &virtual, NULL);
if (virtual)
xedit_file_browser_widget_set_root_and_virtual_root (data->widget, root, virtual);
xed_file_browser_widget_set_root_and_virtual_root (data->widget, root, virtual);
else
xedit_file_browser_widget_set_root (data->widget, root, TRUE);
xed_file_browser_widget_set_root (data->widget, root, TRUE);
g_free (root);
g_free (virtual);
}
static void
message_set_emblem_cb (XeditMessageBus *bus,
XeditMessage *message,
message_set_emblem_cb (XedMessageBus *bus,
XedMessage *message,
WindowData *data)
{
gchar *id = NULL;
gchar *emblem = NULL;
GtkTreePath *path;
XeditFileBrowserStore *store;
XedFileBrowserStore *store;
xedit_message_get (message, "id", &id, "emblem", &emblem, NULL);
xed_message_get (message, "id", &id, "emblem", &emblem, NULL);
if (!id || !emblem)
{
@@ -250,16 +250,16 @@ message_set_emblem_cb (XeditMessageBus *bus,
GValue value = { 0, };
GtkTreeIter iter;
store = xedit_file_browser_widget_get_browser_store (data->widget);
store = xed_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);
xedit_file_browser_store_set_value (store,
xed_file_browser_store_set_value (store,
&iter,
XEDIT_FILE_BROWSER_STORE_COLUMN_EMBLEM,
XED_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,
XeditFileBrowserStore *store,
XedFileBrowserStore *store,
GtkTreePath *path,
const gchar *uri)
{
@@ -308,18 +308,18 @@ static void
set_item_message (WindowData *data,
GtkTreeIter *iter,
GtkTreePath *path,
XeditMessage *message)
XedMessage *message)
{
XeditFileBrowserStore *store;
XedFileBrowserStore *store;
gchar *uri = NULL;
guint flags = 0;
gchar *track_id;
store = xedit_file_browser_widget_get_browser_store (data->widget);
store = xed_file_browser_widget_get_browser_store (data->widget);
gtk_tree_model_get (GTK_TREE_MODEL (store), iter,
XEDIT_FILE_BROWSER_STORE_COLUMN_URI, &uri,
XEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
XED_FILE_BROWSER_STORE_COLUMN_URI, &uri,
XED_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
-1);
if (!uri)
@@ -330,14 +330,14 @@ set_item_message (WindowData *data,
else
track_id = NULL;
xedit_message_set (message,
xed_message_set (message,
"id", track_id,
"uri", uri,
NULL);
if (xedit_message_has_key (message, "is_directory"))
if (xed_message_has_key (message, "is_directory"))
{
xedit_message_set (message,
xed_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 (XeditFileBrowserWidget *widget,
XeditFileBrowserStore *store,
custom_message_filter_func (XedFileBrowserWidget *widget,
XedFileBrowserStore *store,
GtkTreeIter *iter,
FilterData *data)
{
@@ -359,8 +359,8 @@ custom_message_filter_func (XeditFileBrowserWidget *widget,
GtkTreePath *path;
gtk_tree_model_get (GTK_TREE_MODEL (store), iter,
XEDIT_FILE_BROWSER_STORE_COLUMN_URI, &uri,
XEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
XED_FILE_BROWSER_STORE_COLUMN_URI, &uri,
XED_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
-1);
if (!uri || FILE_IS_DUMMY (flags))
@@ -373,28 +373,28 @@ custom_message_filter_func (XeditFileBrowserWidget *widget,
set_item_message (wdata, iter, path, data->message);
gtk_tree_path_free (path);
xedit_message_set (data->message, "filter", filter, NULL);
xed_message_set (data->message, "filter", filter, NULL);
xedit_message_bus_send_message_sync (wdata->bus, data->message);
xedit_message_get (data->message, "filter", &filter, NULL);
xed_message_bus_send_message_sync (wdata->bus, data->message);
xed_message_get (data->message, "filter", &filter, NULL);
return !filter;
}
static void
message_add_filter_cb (XeditMessageBus *bus,
XeditMessage *message,
XeditWindow *window)
message_add_filter_cb (XedMessageBus *bus,
XedMessage *message,
XedWindow *window)
{
gchar *object_path = NULL;
gchar *method = NULL;
gulong id;
XeditMessageType *message_type;
XeditMessage *cbmessage;
XedMessageType *message_type;
XedMessage *cbmessage;
FilterData *filter_data;
WindowData *data = get_window_data (window);
xedit_message_get (message,
xed_message_get (message,
"object_path", &object_path,
"method", &method,
NULL);
@@ -408,7 +408,7 @@ message_add_filter_cb (XeditMessageBus *bus,
return;
}
message_type = xedit_message_bus_lookup (bus, object_path, method);
message_type = xed_message_bus_lookup (bus, object_path, method);
if (!message_type)
{
@@ -419,15 +419,15 @@ message_add_filter_cb (XeditMessageBus *bus,
}
// Check if the message type has the correct arguments
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)
if (xed_message_type_lookup (message_type, "id") != G_TYPE_STRING ||
xed_message_type_lookup (message_type, "uri") != G_TYPE_STRING ||
xed_message_type_lookup (message_type, "is_directory") != G_TYPE_BOOLEAN ||
xed_message_type_lookup (message_type, "filter") != G_TYPE_BOOLEAN)
{
return;
}
cbmessage = xedit_message_type_instantiate (message_type,
cbmessage = xed_message_type_instantiate (message_type,
"id", NULL,
"uri", NULL,
"is_directory", FALSE,
@@ -436,8 +436,8 @@ message_add_filter_cb (XeditMessageBus *bus,
// Register the custom filter on the widget
filter_data = filter_data_new (window, cbmessage);
id = xedit_file_browser_widget_add_filter (data->widget,
(XeditFileBrowserWidgetFilterFunc)custom_message_filter_func,
id = xed_file_browser_widget_add_filter (data->widget,
(XedFileBrowserWidgetFilterFunc)custom_message_filter_func,
filter_data,
(GDestroyNotify)filter_data_free);
@@ -445,117 +445,117 @@ message_add_filter_cb (XeditMessageBus *bus,
}
static void
message_remove_filter_cb (XeditMessageBus *bus,
XeditMessage *message,
message_remove_filter_cb (XedMessageBus *bus,
XedMessage *message,
WindowData *data)
{
gulong id = 0;
xedit_message_get (message, "id", &id, NULL);
xed_message_get (message, "id", &id, NULL);
if (!id)
return;
xedit_file_browser_widget_remove_filter (data->widget, id);
xed_file_browser_widget_remove_filter (data->widget, id);
}
static void
message_up_cb (XeditMessageBus *bus,
XeditMessage *message,
message_up_cb (XedMessageBus *bus,
XedMessage *message,
WindowData *data)
{
XeditFileBrowserStore *store = xedit_file_browser_widget_get_browser_store (data->widget);
XedFileBrowserStore *store = xed_file_browser_widget_get_browser_store (data->widget);
xedit_file_browser_store_set_virtual_root_up (store);
xed_file_browser_store_set_virtual_root_up (store);
}
static void
message_history_back_cb (XeditMessageBus *bus,
XeditMessage *message,
message_history_back_cb (XedMessageBus *bus,
XedMessage *message,
WindowData *data)
{
xedit_file_browser_widget_history_back (data->widget);
xed_file_browser_widget_history_back (data->widget);
}
static void
message_history_forward_cb (XeditMessageBus *bus,
XeditMessage *message,
message_history_forward_cb (XedMessageBus *bus,
XedMessage *message,
WindowData *data)
{
xedit_file_browser_widget_history_forward (data->widget);
xed_file_browser_widget_history_forward (data->widget);
}
static void
message_refresh_cb (XeditMessageBus *bus,
XeditMessage *message,
message_refresh_cb (XedMessageBus *bus,
XedMessage *message,
WindowData *data)
{
xedit_file_browser_widget_refresh (data->widget);
xed_file_browser_widget_refresh (data->widget);
}
static void
message_set_show_hidden_cb (XeditMessageBus *bus,
XeditMessage *message,
message_set_show_hidden_cb (XedMessageBus *bus,
XedMessage *message,
WindowData *data)
{
gboolean active = FALSE;
XeditFileBrowserStore *store;
XeditFileBrowserStoreFilterMode mode;
XedFileBrowserStore *store;
XedFileBrowserStoreFilterMode mode;
xedit_message_get (message, "active", &active, NULL);
xed_message_get (message, "active", &active, NULL);
store = xedit_file_browser_widget_get_browser_store (data->widget);
mode = xedit_file_browser_store_get_filter_mode (store);
store = xed_file_browser_widget_get_browser_store (data->widget);
mode = xed_file_browser_store_get_filter_mode (store);
if (active)
mode &= ~XEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN;
mode &= ~XED_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN;
else
mode |= XEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN;
mode |= XED_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN;
xedit_file_browser_store_set_filter_mode (store, mode);
xed_file_browser_store_set_filter_mode (store, mode);
}
static void
message_set_show_binary_cb (XeditMessageBus *bus,
XeditMessage *message,
message_set_show_binary_cb (XedMessageBus *bus,
XedMessage *message,
WindowData *data)
{
gboolean active = FALSE;
XeditFileBrowserStore *store;
XeditFileBrowserStoreFilterMode mode;
XedFileBrowserStore *store;
XedFileBrowserStoreFilterMode mode;
xedit_message_get (message, "active", &active, NULL);
xed_message_get (message, "active", &active, NULL);
store = xedit_file_browser_widget_get_browser_store (data->widget);
mode = xedit_file_browser_store_get_filter_mode (store);
store = xed_file_browser_widget_get_browser_store (data->widget);
mode = xed_file_browser_store_get_filter_mode (store);
if (active)
mode &= ~XEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY;
mode &= ~XED_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY;
else
mode |= XEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY;
mode |= XED_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY;
xedit_file_browser_store_set_filter_mode (store, mode);
xed_file_browser_store_set_filter_mode (store, mode);
}
static void
message_show_bookmarks_cb (XeditMessageBus *bus,
XeditMessage *message,
message_show_bookmarks_cb (XedMessageBus *bus,
XedMessage *message,
WindowData *data)
{
xedit_file_browser_widget_show_bookmarks (data->widget);
xed_file_browser_widget_show_bookmarks (data->widget);
}
static void
message_show_files_cb (XeditMessageBus *bus,
XeditMessage *message,
message_show_files_cb (XedMessageBus *bus,
XedMessage *message,
WindowData *data)
{
xedit_file_browser_widget_show_files (data->widget);
xed_file_browser_widget_show_files (data->widget);
}
static void
message_add_context_item_cb (XeditMessageBus *bus,
XeditMessage *message,
message_add_context_item_cb (XedMessageBus *bus,
XedMessage *message,
WindowData *data)
{
GtkAction *action = NULL;
@@ -564,7 +564,7 @@ message_add_context_item_cb (XeditMessageBus *bus,
GtkUIManager *manager;
guint merge_id;
xedit_message_get (message,
xed_message_get (message,
"action", &action,
"path", &path,
NULL);
@@ -579,7 +579,7 @@ message_add_context_item_cb (XeditMessageBus *bus,
}
gtk_action_group_add_action (data->merged_actions, action);
manager = xedit_file_browser_widget_get_ui_manager (data->widget);
manager = xed_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 (XeditMessageBus *bus,
if (gtk_ui_manager_get_widget (manager, path))
{
data->merge_ids = g_list_prepend (data->merge_ids, GINT_TO_POINTER (merge_id));
xedit_message_set (message, "id", merge_id, NULL);
xed_message_set (message, "id", merge_id, NULL);
}
else
{
xedit_message_set (message, "id", 0, NULL);
xed_message_set (message, "id", 0, NULL);
}
g_object_unref (action);
@@ -607,64 +607,64 @@ message_add_context_item_cb (XeditMessageBus *bus,
}
static void
message_remove_context_item_cb (XeditMessageBus *bus,
XeditMessage *message,
message_remove_context_item_cb (XedMessageBus *bus,
XedMessage *message,
WindowData *data)
{
guint merge_id = 0;
GtkUIManager *manager;
xedit_message_get (message, "id", &merge_id, NULL);
xed_message_get (message, "id", &merge_id, NULL);
if (merge_id == 0)
return;
manager = xedit_file_browser_widget_get_ui_manager (data->widget);
manager = xed_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 (XeditMessageBus *bus,
XeditMessage *message,
message_get_view_cb (XedMessageBus *bus,
XedMessage *message,
WindowData *data)
{
XeditFileBrowserView *view;
view = xedit_file_browser_widget_get_browser_view (data->widget);
XedFileBrowserView *view;
view = xed_file_browser_widget_get_browser_view (data->widget);
xedit_message_set (message, "view", view, NULL);
xed_message_set (message, "view", view, NULL);
}
static void
register_methods (XeditWindow *window,
XeditFileBrowserWidget *widget)
register_methods (XedWindow *window,
XedFileBrowserWidget *widget)
{
XeditMessageBus *bus = xedit_window_get_message_bus (window);
XedMessageBus *bus = xed_window_get_message_bus (window);
WindowData *data = get_window_data (window);
/* Register method calls */
xedit_message_bus_register (bus,
xed_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "get_root",
1,
"uri", G_TYPE_STRING,
NULL);
xedit_message_bus_register (bus,
xed_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "set_root",
1,
"uri", G_TYPE_STRING,
"virtual", G_TYPE_STRING,
NULL);
xedit_message_bus_register (bus,
xed_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "set_emblem",
0,
"id", G_TYPE_STRING,
"emblem", G_TYPE_STRING,
NULL);
xedit_message_bus_register (bus,
xed_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "add_filter",
1,
"object_path", G_TYPE_STRING,
@@ -672,13 +672,13 @@ register_methods (XeditWindow *window,
"id", G_TYPE_ULONG,
NULL);
xedit_message_bus_register (bus,
xed_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "remove_filter",
0,
"id", G_TYPE_ULONG,
NULL);
xedit_message_bus_register (bus,
xed_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "add_context_item",
1,
"action", GTK_TYPE_ACTION,
@@ -686,37 +686,37 @@ register_methods (XeditWindow *window,
"id", G_TYPE_UINT,
NULL);
xedit_message_bus_register (bus,
xed_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "remove_context_item",
0,
"id", G_TYPE_UINT,
NULL);
xedit_message_bus_register (bus, MESSAGE_OBJECT_PATH, "up", 0, NULL);
xed_message_bus_register (bus, MESSAGE_OBJECT_PATH, "up", 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);
xed_message_bus_register (bus, MESSAGE_OBJECT_PATH, "history_back", 0, NULL);
xed_message_bus_register (bus, MESSAGE_OBJECT_PATH, "history_forward", 0, NULL);
xedit_message_bus_register (bus, MESSAGE_OBJECT_PATH, "refresh", 0, NULL);
xed_message_bus_register (bus, MESSAGE_OBJECT_PATH, "refresh", 0, NULL);
xedit_message_bus_register (bus,
xed_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "set_show_hidden",
0,
"active", G_TYPE_BOOLEAN,
NULL);
xedit_message_bus_register (bus,
xed_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "set_show_binary",
0,
"active", G_TYPE_BOOLEAN,
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);
xed_message_bus_register (bus, MESSAGE_OBJECT_PATH, "show_bookmarks", 0, NULL);
xed_message_bus_register (bus, MESSAGE_OBJECT_PATH, "show_files", 0, NULL);
xedit_message_bus_register (bus,
xed_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "get_view",
1,
"view", XEDIT_TYPE_FILE_BROWSER_VIEW,
"view", XED_TYPE_FILE_BROWSER_VIEW,
NULL);
BUS_CONNECT (bus, get_root, data);
@@ -744,7 +744,7 @@ register_methods (XeditWindow *window,
}
static void
store_row_inserted (XeditFileBrowserStore *store,
store_row_inserted (XedFileBrowserStore *store,
GtkTreePath *path,
GtkTreeIter *iter,
MessageCacheData *data)
@@ -753,8 +753,8 @@ store_row_inserted (XeditFileBrowserStore *store,
guint flags = 0;
gtk_tree_model_get (GTK_TREE_MODEL (store), iter,
XEDIT_FILE_BROWSER_STORE_COLUMN_URI, &uri,
XEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
XED_FILE_BROWSER_STORE_COLUMN_URI, &uri,
XED_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
-1);
if (!FILE_IS_DUMMY (flags) && !FILE_IS_FILTERED (flags))
@@ -762,14 +762,14 @@ store_row_inserted (XeditFileBrowserStore *store,
WindowData *wdata = get_window_data (data->window);
set_item_message (wdata, iter, path, data->message);
xedit_message_bus_send_message_sync (wdata->bus, data->message);
xed_message_bus_send_message_sync (wdata->bus, data->message);
}
g_free (uri);
}
static void
store_row_deleted (XeditFileBrowserStore *store,
store_row_deleted (XedFileBrowserStore *store,
GtkTreePath *path,
MessageCacheData *data)
{
@@ -781,8 +781,8 @@ store_row_deleted (XeditFileBrowserStore *store,
return;
gtk_tree_model_get (GTK_TREE_MODEL (store), &iter,
XEDIT_FILE_BROWSER_STORE_COLUMN_URI, &uri,
XEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
XED_FILE_BROWSER_STORE_COLUMN_URI, &uri,
XED_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
-1);
if (!FILE_IS_DUMMY (flags) && !FILE_IS_FILTERED (flags))
@@ -790,36 +790,36 @@ store_row_deleted (XeditFileBrowserStore *store,
WindowData *wdata = get_window_data (data->window);
set_item_message (wdata, &iter, path, data->message);
xedit_message_bus_send_message_sync (wdata->bus, data->message);
xed_message_bus_send_message_sync (wdata->bus, data->message);
}
g_free (uri);
}
static void
store_virtual_root_changed (XeditFileBrowserStore *store,
store_virtual_root_changed (XedFileBrowserStore *store,
GParamSpec *spec,
MessageCacheData *data)
{
WindowData *wdata = get_window_data (data->window);
gchar *uri;
uri = xedit_file_browser_store_get_virtual_root (store);
uri = xed_file_browser_store_get_virtual_root (store);
if (!uri)
return;
xedit_message_set (data->message,
xed_message_set (data->message,
"uri", uri,
NULL);
xedit_message_bus_send_message_sync (wdata->bus, data->message);
xed_message_bus_send_message_sync (wdata->bus, data->message);
g_free (uri);
}
static void
store_begin_loading (XeditFileBrowserStore *store,
store_begin_loading (XedFileBrowserStore *store,
GtkTreeIter *iter,
MessageCacheData *data)
{
@@ -830,12 +830,12 @@ store_begin_loading (XeditFileBrowserStore *store,
set_item_message (wdata, iter, path, data->message);
xedit_message_bus_send_message_sync (wdata->bus, data->message);
xed_message_bus_send_message_sync (wdata->bus, data->message);
gtk_tree_path_free (path);
}
static void
store_end_loading (XeditFileBrowserStore *store,
store_end_loading (XedFileBrowserStore *store,
GtkTreeIter *iter,
MessageCacheData *data)
{
@@ -846,48 +846,48 @@ store_end_loading (XeditFileBrowserStore *store,
set_item_message (wdata, iter, path, data->message);
xedit_message_bus_send_message_sync (wdata->bus, data->message);
xed_message_bus_send_message_sync (wdata->bus, data->message);
gtk_tree_path_free (path);
}
static void
register_signals (XeditWindow *window,
XeditFileBrowserWidget *widget)
register_signals (XedWindow *window,
XedFileBrowserWidget *widget)
{
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;
XedMessageBus *bus = xed_window_get_message_bus (window);
XedFileBrowserStore *store;
XedMessageType *inserted_type;
XedMessageType *deleted_type;
XedMessageType *begin_loading_type;
XedMessageType *end_loading_type;
XedMessageType *root_changed_type;
XeditMessage *message;
XedMessage *message;
WindowData *data;
/* Register signals */
root_changed_type = xedit_message_bus_register (bus,
root_changed_type = xed_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "root_changed",
0,
"id", G_TYPE_STRING,
"uri", G_TYPE_STRING,
NULL);
begin_loading_type = xedit_message_bus_register (bus,
begin_loading_type = xed_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "begin_loading",
0,
"id", G_TYPE_STRING,
"uri", G_TYPE_STRING,
NULL);
end_loading_type = xedit_message_bus_register (bus,
end_loading_type = xed_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "end_loading",
0,
"id", G_TYPE_STRING,
"uri", G_TYPE_STRING,
NULL);
inserted_type = xedit_message_bus_register (bus,
inserted_type = xed_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "inserted",
0,
"id", G_TYPE_STRING,
@@ -895,7 +895,7 @@ register_signals (XeditWindow *window,
"is_directory", G_TYPE_BOOLEAN,
NULL);
deleted_type = xedit_message_bus_register (bus,
deleted_type = xed_message_bus_register (bus,
MESSAGE_OBJECT_PATH, "deleted",
0,
"id", G_TYPE_STRING,
@@ -903,9 +903,9 @@ register_signals (XeditWindow *window,
"is_directory", G_TYPE_BOOLEAN,
NULL);
store = xedit_file_browser_widget_get_browser_store (widget);
store = xed_file_browser_widget_get_browser_store (widget);
message = xedit_message_type_instantiate (inserted_type,
message = xed_message_type_instantiate (inserted_type,
"id", NULL,
"uri", NULL,
"is_directory", FALSE,
@@ -921,7 +921,7 @@ register_signals (XeditWindow *window,
(GClosureNotify)message_cache_data_free,
0);
message = xedit_message_type_instantiate (deleted_type,
message = xed_message_type_instantiate (deleted_type,
"id", NULL,
"uri", NULL,
"is_directory", FALSE,
@@ -934,7 +934,7 @@ register_signals (XeditWindow *window,
(GClosureNotify)message_cache_data_free,
0);
message = xedit_message_type_instantiate (root_changed_type,
message = xed_message_type_instantiate (root_changed_type,
"id", NULL,
"uri", NULL,
NULL);
@@ -946,7 +946,7 @@ register_signals (XeditWindow *window,
(GClosureNotify)message_cache_data_free,
0);
message = xedit_message_type_instantiate (begin_loading_type,
message = xed_message_type_instantiate (begin_loading_type,
"id", NULL,
"uri", NULL,
NULL);
@@ -958,7 +958,7 @@ register_signals (XeditWindow *window,
(GClosureNotify)message_cache_data_free,
0);
message = xedit_message_type_instantiate (end_loading_type,
message = xed_message_type_instantiate (end_loading_type,
"id", NULL,
"uri", NULL,
NULL);
@@ -972,45 +972,45 @@ register_signals (XeditWindow *window,
}
static void
message_unregistered (XeditMessageBus *bus,
XeditMessageType *message_type,
XeditWindow *window)
message_unregistered (XedMessageBus *bus,
XedMessageType *message_type,
XedWindow *window)
{
gchar *identifier = xedit_message_type_identifier (xedit_message_type_get_object_path (message_type),
xedit_message_type_get_method (message_type));
gchar *identifier = xed_message_type_identifier (xed_message_type_get_object_path (message_type),
xed_message_type_get_method (message_type));
FilterData *data;
WindowData *wdata = get_window_data (window);
data = g_hash_table_lookup (wdata->filters, identifier);
if (data)
xedit_file_browser_widget_remove_filter (wdata->widget, data->id);
xed_file_browser_widget_remove_filter (wdata->widget, data->id);
g_free (identifier);
}
void
xedit_file_browser_messages_register (XeditWindow *window,
XeditFileBrowserWidget *widget)
xed_file_browser_messages_register (XedWindow *window,
XedFileBrowserWidget *widget)
{
window_data_new (window, widget);
register_methods (window, widget);
register_signals (window, widget);
g_signal_connect (xedit_window_get_message_bus (window),
g_signal_connect (xed_window_get_message_bus (window),
"unregistered",
G_CALLBACK (message_unregistered),
window);
}
static void
cleanup_signals (XeditWindow *window)
cleanup_signals (XedWindow *window)
{
WindowData *data = get_window_data (window);
XeditFileBrowserStore *store;
XedFileBrowserStore *store;
store = xedit_file_browser_widget_get_browser_store (data->widget);
store = xed_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 (XeditWindow *window)
}
void
xedit_file_browser_messages_unregister (XeditWindow *window)
xed_file_browser_messages_unregister (XedWindow *window)
{
XeditMessageBus *bus = xedit_window_get_message_bus (window);
XedMessageBus *bus = xed_window_get_message_bus (window);
cleanup_signals (window);
xedit_message_bus_unregister_all (bus, MESSAGE_OBJECT_PATH);
xed_message_bus_unregister_all (bus, MESSAGE_OBJECT_PATH);
window_data_free (window);
}

View File

@@ -1,5 +1,5 @@
/*
* xedit-file-browser-messages.h - Xedit plugin providing easy file access
* xed-file-browser-messages.h - Xed 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 __XEDIT_FILE_BROWSER_MESSAGES_H__
#define __XEDIT_FILE_BROWSER_MESSAGES_H__
#ifndef __XED_FILE_BROWSER_MESSAGES_H__
#define __XED_FILE_BROWSER_MESSAGES_H__
#include <xedit/xedit-window.h>
#include <xedit/xedit-message-bus.h>
#include "xedit-file-browser-widget.h"
#include <xed/xed-window.h>
#include <xed/xed-message-bus.h>
#include "xed-file-browser-widget.h"
void xedit_file_browser_messages_register (XeditWindow *window,
XeditFileBrowserWidget *widget);
void xedit_file_browser_messages_unregister (XeditWindow *window);
void xed_file_browser_messages_register (XedWindow *window,
XedFileBrowserWidget *widget);
void xed_file_browser_messages_unregister (XedWindow *window);
#endif /* __XEDIT_FILE_BROWSER_MESSAGES_H__ */
#endif /* __XED_FILE_BROWSER_MESSAGES_H__ */
// ex:ts=8:noet:

View File

@@ -1,5 +1,5 @@
/*
* xedit-file-browser-plugin.c - Xedit plugin providing easy file access
* xed-file-browser-plugin.c - Xed plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
@@ -24,36 +24,36 @@
#include <config.h>
#endif
#include <xedit/xedit-commands.h>
#include <xedit/xedit-utils.h>
#include <xedit/xedit-app.h>
#include <xed/xed-commands.h>
#include <xed/xed-utils.h>
#include <xed/xed-app.h>
#include <glib/gi18n-lib.h>
#include <xedit/xedit-debug.h>
#include <xed/xed-debug.h>
#include <gio/gio.h>
#include <string.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"
#include "xed-file-browser-enum-types.h"
#include "xed-file-browser-plugin.h"
#include "xed-file-browser-utils.h"
#include "xed-file-browser-error.h"
#include "xed-file-browser-widget.h"
#include "xed-file-browser-messages.h"
#define WINDOW_DATA_KEY "XeditFileBrowserPluginWindowData"
#define WINDOW_DATA_KEY "XedFileBrowserPluginWindowData"
#define FILE_BROWSER_SCHEMA "org.x.editor.plugins.filebrowser"
#define FILE_BROWSER_ONLOAD_SCHEMA "org.x.editor.plugins.filebrowser.on-load"
#define XEDIT_FILE_BROWSER_PLUGIN_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), XEDIT_TYPE_FILE_BROWSER_PLUGIN, XeditFileBrowserPluginPrivate))
#define XED_FILE_BROWSER_PLUGIN_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), XED_TYPE_FILE_BROWSER_PLUGIN, XedFileBrowserPluginPrivate))
struct _XeditFileBrowserPluginPrivate
struct _XedFileBrowserPluginPrivate
{
gpointer *dummy;
};
typedef struct _XeditFileBrowserPluginData
typedef struct _XedFileBrowserPluginData
{
XeditFileBrowserWidget * tree_widget;
XedFileBrowserWidget * tree_widget;
gulong merge_id;
GtkActionGroup * action_group;
GtkActionGroup * single_selection_action_group;
@@ -62,75 +62,75 @@ typedef struct _XeditFileBrowserPluginData
GSettings *settings;
GSettings *onload_settings;
} XeditFileBrowserPluginData;
} XedFileBrowserPluginData;
static void on_uri_activated_cb (XeditFileBrowserWidget * widget,
static void on_uri_activated_cb (XedFileBrowserWidget * widget,
gchar const *uri,
XeditWindow * window);
static void on_error_cb (XeditFileBrowserWidget * widget,
XedWindow * window);
static void on_error_cb (XedFileBrowserWidget * widget,
guint code,
gchar const *message,
XeditWindow * window);
static void on_model_set_cb (XeditFileBrowserView * widget,
XedWindow * window);
static void on_model_set_cb (XedFileBrowserView * widget,
GParamSpec *arg1,
XeditWindow * window);
static void on_virtual_root_changed_cb (XeditFileBrowserStore * model,
XedWindow * window);
static void on_virtual_root_changed_cb (XedFileBrowserStore * model,
GParamSpec * param,
XeditWindow * window);
static void on_filter_mode_changed_cb (XeditFileBrowserStore * model,
XedWindow * window);
static void on_filter_mode_changed_cb (XedFileBrowserStore * model,
GParamSpec * param,
XeditWindow * window);
static void on_rename_cb (XeditFileBrowserStore * model,
XedWindow * window);
static void on_rename_cb (XedFileBrowserStore * model,
const gchar * olduri,
const gchar * newuri,
XeditWindow * window);
static void on_filter_pattern_changed_cb (XeditFileBrowserWidget * widget,
XedWindow * window);
static void on_filter_pattern_changed_cb (XedFileBrowserWidget * widget,
GParamSpec * param,
XeditWindow * window);
static void on_tab_added_cb (XeditWindow * window,
XeditTab * tab,
XeditFileBrowserPluginData * data);
static gboolean on_confirm_delete_cb (XeditFileBrowserWidget * widget,
XeditFileBrowserStore * store,
XedWindow * window);
static void on_tab_added_cb (XedWindow * window,
XedTab * tab,
XedFileBrowserPluginData * data);
static gboolean on_confirm_delete_cb (XedFileBrowserWidget * widget,
XedFileBrowserStore * store,
GList * rows,
XeditWindow * window);
static gboolean on_confirm_no_trash_cb (XeditFileBrowserWidget * widget,
XedWindow * window);
static gboolean on_confirm_no_trash_cb (XedFileBrowserWidget * widget,
GList * files,
XeditWindow * window);
XedWindow * window);
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); \
XED_PLUGIN_REGISTER_TYPE_WITH_CODE (XedFileBrowserPlugin, filetree_plugin, \
xed_file_browser_enum_and_flag_register_type (type_module); \
xed_file_browser_store_register_type (type_module); \
xed_file_bookmarks_store_register_type (type_module); \
xed_file_browser_view_register_type (type_module); \
xed_file_browser_widget_register_type (type_module); \
)
static void
filetree_plugin_init (XeditFileBrowserPlugin * plugin)
filetree_plugin_init (XedFileBrowserPlugin * plugin)
{
plugin->priv = XEDIT_FILE_BROWSER_PLUGIN_GET_PRIVATE (plugin);
plugin->priv = XED_FILE_BROWSER_PLUGIN_GET_PRIVATE (plugin);
}
static void
filetree_plugin_finalize (GObject * object)
{
//XeditFileBrowserPlugin * plugin = XEDIT_FILE_BROWSER_PLUGIN (object);
//XedFileBrowserPlugin * plugin = XED_FILE_BROWSER_PLUGIN (object);
G_OBJECT_CLASS (filetree_plugin_parent_class)->finalize (object);
}
static XeditFileBrowserPluginData *
get_plugin_data (XeditWindow * window)
static XedFileBrowserPluginData *
get_plugin_data (XedWindow * window)
{
return (XeditFileBrowserPluginData *) (g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY));
return (XedFileBrowserPluginData *) (g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY));
}
static void
on_end_loading_cb (XeditFileBrowserStore * store,
on_end_loading_cb (XedFileBrowserStore * store,
GtkTreeIter * iter,
XeditFileBrowserPluginData * data)
XedFileBrowserPluginData * data)
{
/* Disconnect the signal */
g_signal_handler_disconnect (store, data->end_loading_handle);
@@ -139,13 +139,13 @@ on_end_loading_cb (XeditFileBrowserStore * store,
}
static void
prepare_auto_root (XeditFileBrowserPluginData *data)
prepare_auto_root (XedFileBrowserPluginData *data)
{
XeditFileBrowserStore *store;
XedFileBrowserStore *store;
data->auto_root = TRUE;
store = xedit_file_browser_widget_get_browser_store (data->tree_widget);
store = xed_file_browser_widget_get_browser_store (data->tree_widget);
if (data->end_loading_handle != 0) {
g_signal_handler_disconnect (store, data->end_loading_handle);
@@ -159,7 +159,7 @@ prepare_auto_root (XeditFileBrowserPluginData *data)
}
static void
restore_default_location (XeditFileBrowserPluginData *data)
restore_default_location (XedFileBrowserPluginData *data)
{
gchar * root;
gchar * virtual_root;
@@ -169,7 +169,7 @@ restore_default_location (XeditFileBrowserPluginData *data)
bookmarks = !g_settings_get_boolean (data->onload_settings, "tree-view");
if (bookmarks) {
xedit_file_browser_widget_show_bookmarks (data->tree_widget);
xed_file_browser_widget_show_bookmarks (data->tree_widget);
return;
}
@@ -186,12 +186,12 @@ restore_default_location (XeditFileBrowserPluginData *data)
if (remote || g_file_is_native (file)) {
if (virtual_root != NULL && *virtual_root != '\0') {
prepare_auto_root (data);
xedit_file_browser_widget_set_root_and_virtual_root (data->tree_widget,
xed_file_browser_widget_set_root_and_virtual_root (data->tree_widget,
root,
virtual_root);
} else {
prepare_auto_root (data);
xedit_file_browser_widget_set_root (data->tree_widget,
xed_file_browser_widget_set_root (data->tree_widget,
root,
TRUE);
}
@@ -205,41 +205,41 @@ restore_default_location (XeditFileBrowserPluginData *data)
}
static void
restore_filter (XeditFileBrowserPluginData * data)
restore_filter (XedFileBrowserPluginData * data)
{
gchar *filter_mode;
XeditFileBrowserStoreFilterMode mode;
XedFileBrowserStoreFilterMode mode;
gchar *pattern;
/* Get filter_mode */
filter_mode = g_settings_get_string (data->settings, "filter-mode");
/* Filter mode */
mode = xedit_file_browser_store_filter_mode_get_default ();
mode = xed_file_browser_store_filter_mode_get_default ();
if (filter_mode != NULL) {
if (strcmp (filter_mode, "hidden") == 0) {
mode = XEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN;
mode = XED_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN;
} else if (strcmp (filter_mode, "binary") == 0) {
mode = XEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY;
mode = XED_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY;
} else if (strcmp (filter_mode, "hidden_and_binary") == 0 ||
strcmp (filter_mode, "binary_and_hidden") == 0) {
mode = XEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN |
XEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY;
mode = XED_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN |
XED_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY;
} else if (strcmp (filter_mode, "none") == 0 ||
*filter_mode == '\0') {
mode = XEDIT_FILE_BROWSER_STORE_FILTER_MODE_NONE;
mode = XED_FILE_BROWSER_STORE_FILTER_MODE_NONE;
}
}
/* Set the filter mode */
xedit_file_browser_store_set_filter_mode (
xedit_file_browser_widget_get_browser_store (data->tree_widget),
xed_file_browser_store_set_filter_mode (
xed_file_browser_widget_get_browser_store (data->tree_widget),
mode);
pattern = g_settings_get_string (data->settings, "filter-pattern");
xedit_file_browser_widget_set_filter_pattern (data->tree_widget,
xed_file_browser_widget_set_filter_pattern (data->tree_widget,
pattern);
g_free (filter_mode);
@@ -247,8 +247,8 @@ restore_filter (XeditFileBrowserPluginData * data)
}
static void
set_root_from_doc (XeditFileBrowserPluginData * data,
XeditDocument * doc)
set_root_from_doc (XedFileBrowserPluginData * data,
XedDocument * doc)
{
GFile *file;
GFile *parent;
@@ -256,7 +256,7 @@ set_root_from_doc (XeditFileBrowserPluginData * data,
if (doc == NULL)
return;
file = xedit_document_get_location (doc);
file = xed_document_get_location (doc);
if (file == NULL)
return;
@@ -267,7 +267,7 @@ set_root_from_doc (XeditFileBrowserPluginData * data,
root = g_file_get_uri (parent);
xedit_file_browser_widget_set_root (data->tree_widget,
xed_file_browser_widget_set_root (data->tree_widget,
root,
TRUE);
@@ -280,17 +280,17 @@ set_root_from_doc (XeditFileBrowserPluginData * data,
static void
on_action_set_active_root (GtkAction * action,
XeditWindow * window)
XedWindow * window)
{
XeditFileBrowserPluginData *data;
XedFileBrowserPluginData *data;
data = get_plugin_data (window);
set_root_from_doc (data,
xedit_window_get_active_document (window));
xed_window_get_active_document (window));
}
static gchar *
get_terminal (XeditFileBrowserPluginData * data)
get_terminal (XedFileBrowserPluginData * data)
{
// TODO : Identify the DE, find the preferred terminal application (xterminal shouldn't be hardcoded here, it should be set as default in the DE prefs)
return g_strdup ("xterminal");
@@ -298,9 +298,9 @@ get_terminal (XeditFileBrowserPluginData * data)
static void
on_action_open_terminal (GtkAction * action,
XeditWindow * window)
XedWindow * window)
{
XeditFileBrowserPluginData * data;
XedFileBrowserPluginData * data;
gchar * terminal;
gchar * wd = NULL;
gchar * local;
@@ -308,18 +308,18 @@ on_action_open_terminal (GtkAction * action,
GFile * file;
GtkTreeIter iter;
XeditFileBrowserStore * store;
XedFileBrowserStore * store;
data = get_plugin_data (window);
/* Get the current directory */
if (!xedit_file_browser_widget_get_selected_directory (data->tree_widget, &iter))
if (!xed_file_browser_widget_get_selected_directory (data->tree_widget, &iter))
return;
store = xedit_file_browser_widget_get_browser_store (data->tree_widget);
store = xed_file_browser_widget_get_browser_store (data->tree_widget);
gtk_tree_model_get (GTK_TREE_MODEL (store),
&iter,
XEDIT_FILE_BROWSER_STORE_COLUMN_URI,
XED_FILE_BROWSER_STORE_COLUMN_URI,
&wd,
-1);
@@ -351,9 +351,9 @@ on_action_open_terminal (GtkAction * action,
static void
on_selection_changed_cb (GtkTreeSelection *selection,
XeditWindow *window)
XedWindow *window)
{
XeditFileBrowserPluginData * data;
XedFileBrowserPluginData * data;
GtkTreeView * tree_view;
GtkTreeModel * model;
GtkTreeIter iter;
@@ -362,20 +362,20 @@ on_selection_changed_cb (GtkTreeSelection *selection,
data = get_plugin_data (window);
tree_view = GTK_TREE_VIEW (xedit_file_browser_widget_get_browser_view (data->tree_widget));
tree_view = GTK_TREE_VIEW (xed_file_browser_widget_get_browser_view (data->tree_widget));
model = gtk_tree_view_get_model (tree_view);
if (!XEDIT_IS_FILE_BROWSER_STORE (model))
if (!XED_IS_FILE_BROWSER_STORE (model))
return;
sensitive = xedit_file_browser_widget_get_selected_directory (data->tree_widget, &iter);
sensitive = xed_file_browser_widget_get_selected_directory (data->tree_widget, &iter);
if (sensitive) {
gtk_tree_model_get (model, &iter,
XEDIT_FILE_BROWSER_STORE_COLUMN_URI,
XED_FILE_BROWSER_STORE_COLUMN_URI,
&uri, -1);
sensitive = xedit_utils_uri_has_file_scheme (uri);
sensitive = xed_utils_uri_has_file_scheme (uri);
g_free (uri);
}
@@ -418,15 +418,15 @@ static GtkActionEntry extra_single_selection_actions[] = {
};
static void
add_popup_ui (XeditWindow * window)
add_popup_ui (XedWindow * window)
{
XeditFileBrowserPluginData * data;
XedFileBrowserPluginData * data;
GtkUIManager * manager;
GtkActionGroup * action_group;
GError * error = NULL;
data = get_plugin_data (window);
manager = xedit_file_browser_widget_get_ui_manager (data->tree_widget);
manager = xed_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);
@@ -458,13 +458,13 @@ add_popup_ui (XeditWindow * window)
}
static void
remove_popup_ui (XeditWindow * window)
remove_popup_ui (XedWindow * window)
{
XeditFileBrowserPluginData * data;
XedFileBrowserPluginData * data;
GtkUIManager * manager;
data = get_plugin_data (window);
manager = xedit_file_browser_widget_get_ui_manager (data->tree_widget);
manager = xed_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);
@@ -475,37 +475,37 @@ remove_popup_ui (XeditWindow * window)
}
static void
impl_updateui (XeditPlugin * plugin, XeditWindow * window)
impl_updateui (XedPlugin * plugin, XedWindow * window)
{
XeditFileBrowserPluginData * data;
XeditDocument * doc;
XedFileBrowserPluginData * data;
XedDocument * doc;
data = get_plugin_data (window);
doc = xedit_window_get_active_document (window);
doc = xed_window_get_active_document (window);
gtk_action_set_sensitive (gtk_action_group_get_action (data->action_group,
"SetActiveRoot"),
doc != NULL &&
!xedit_document_is_untitled (doc));
!xed_document_is_untitled (doc));
}
static void
impl_activate (XeditPlugin * plugin, XeditWindow * window)
impl_activate (XedPlugin * plugin, XedWindow * window)
{
XeditPanel * panel;
XeditFileBrowserPluginData * data;
XedPanel * panel;
XedFileBrowserPluginData * data;
GtkWidget * image;
GdkPixbuf * pixbuf;
XeditFileBrowserStore * store;
XedFileBrowserStore * store;
gchar *data_dir;
GSettingsSchemaSource *schema_source;
GSettingsSchema *schema;
data = g_new0 (XeditFileBrowserPluginData, 1);
data = g_new0 (XedFileBrowserPluginData, 1);
data_dir = xedit_plugin_get_data_dir (plugin);
data->tree_widget = XEDIT_FILE_BROWSER_WIDGET (xedit_file_browser_widget_new (data_dir));
data_dir = xed_plugin_get_data_dir (plugin);
data->tree_widget = XED_FILE_BROWSER_WIDGET (xed_file_browser_widget_new (data_dir));
g_free (data_dir);
data->settings = g_settings_new (FILE_BROWSER_SCHEMA);
@@ -534,14 +534,14 @@ impl_activate (XeditPlugin * plugin, XeditWindow * window)
window);
g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW
(xedit_file_browser_widget_get_browser_view
(xed_file_browser_widget_get_browser_view
(data->tree_widget))),
"changed",
G_CALLBACK (on_selection_changed_cb),
window);
panel = xedit_window_get_side_panel (window);
pixbuf = xedit_file_browser_utils_pixbuf_from_theme("system-file-manager",
panel = xed_window_get_side_panel (window);
pixbuf = xed_file_browser_utils_pixbuf_from_theme("system-file-manager",
GTK_ICON_SIZE_MENU);
if (pixbuf) {
@@ -552,7 +552,7 @@ impl_activate (XeditPlugin * plugin, XeditWindow * window)
}
gtk_widget_show(image);
xedit_panel_add_item (panel,
xed_panel_add_item (panel,
GTK_WIDGET (data->tree_widget),
_("File Browser"),
image);
@@ -565,12 +565,12 @@ impl_activate (XeditPlugin * plugin, XeditWindow * window)
restore_filter (data);
/* Connect signals to store the last visited location */
g_signal_connect (xedit_file_browser_widget_get_browser_view (data->tree_widget),
g_signal_connect (xed_file_browser_widget_get_browser_view (data->tree_widget),
"notify::model",
G_CALLBACK (on_model_set_cb),
window);
store = xedit_file_browser_widget_get_browser_store (data->tree_widget);
store = xed_file_browser_widget_get_browser_store (data->tree_widget);
g_signal_connect (store,
"notify::virtual-root",
G_CALLBACK (on_virtual_root_changed_cb),
@@ -592,21 +592,21 @@ impl_activate (XeditPlugin * plugin, XeditWindow * window)
data);
/* Register messages on the bus */
xedit_file_browser_messages_register (window, data->tree_widget);
xed_file_browser_messages_register (window, data->tree_widget);
impl_updateui (plugin, window);
}
static void
impl_deactivate (XeditPlugin * plugin, XeditWindow * window)
impl_deactivate (XedPlugin * plugin, XedWindow * window)
{
XeditFileBrowserPluginData * data;
XeditPanel * panel;
XedFileBrowserPluginData * data;
XedPanel * panel;
data = get_plugin_data (window);
/* Unregister messages from the bus */
xedit_file_browser_messages_unregister (window);
xed_file_browser_messages_unregister (window);
/* Disconnect signals */
g_signal_handlers_disconnect_by_func (window,
@@ -618,18 +618,18 @@ impl_deactivate (XeditPlugin * plugin, XeditWindow * window)
remove_popup_ui (window);
panel = xedit_window_get_side_panel (window);
xedit_panel_remove_item (panel, GTK_WIDGET (data->tree_widget));
panel = xed_window_get_side_panel (window);
xed_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 (XeditFileBrowserPluginClass * klass)
filetree_plugin_class_init (XedFileBrowserPluginClass * klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
XeditPluginClass * plugin_class = XEDIT_PLUGIN_CLASS (klass);
XedPluginClass * plugin_class = XED_PLUGIN_CLASS (klass);
object_class->finalize = filetree_plugin_finalize;
@@ -638,64 +638,64 @@ filetree_plugin_class_init (XeditFileBrowserPluginClass * klass)
plugin_class->update_ui = impl_updateui;
g_type_class_add_private (object_class,
sizeof (XeditFileBrowserPluginPrivate));
sizeof (XedFileBrowserPluginPrivate));
}
/* Callbacks */
static void
on_uri_activated_cb (XeditFileBrowserWidget * tree_widget,
gchar const *uri, XeditWindow * window)
on_uri_activated_cb (XedFileBrowserWidget * tree_widget,
gchar const *uri, XedWindow * window)
{
xedit_commands_load_uri (window, uri, NULL, 0);
xed_commands_load_uri (window, uri, NULL, 0);
}
static void
on_error_cb (XeditFileBrowserWidget * tree_widget,
guint code, gchar const *message, XeditWindow * window)
on_error_cb (XedFileBrowserWidget * tree_widget,
guint code, gchar const *message, XedWindow * window)
{
gchar * title;
GtkWidget * dlg;
XeditFileBrowserPluginData * data;
XedFileBrowserPluginData * data;
data = get_plugin_data (window);
/* Do not show the error when the root has been set automatically */
if (data->auto_root && (code == XEDIT_FILE_BROWSER_ERROR_SET_ROOT ||
code == XEDIT_FILE_BROWSER_ERROR_LOAD_DIRECTORY))
if (data->auto_root && (code == XED_FILE_BROWSER_ERROR_SET_ROOT ||
code == XED_FILE_BROWSER_ERROR_LOAD_DIRECTORY))
{
/* Show bookmarks */
xedit_file_browser_widget_show_bookmarks (data->tree_widget);
xed_file_browser_widget_show_bookmarks (data->tree_widget);
return;
}
switch (code) {
case XEDIT_FILE_BROWSER_ERROR_NEW_DIRECTORY:
case XED_FILE_BROWSER_ERROR_NEW_DIRECTORY:
title =
_("An error occurred while creating a new directory");
break;
case XEDIT_FILE_BROWSER_ERROR_NEW_FILE:
case XED_FILE_BROWSER_ERROR_NEW_FILE:
title = _("An error occurred while creating a new file");
break;
case XEDIT_FILE_BROWSER_ERROR_RENAME:
case XED_FILE_BROWSER_ERROR_RENAME:
title =
_
("An error occurred while renaming a file or directory");
break;
case XEDIT_FILE_BROWSER_ERROR_DELETE:
case XED_FILE_BROWSER_ERROR_DELETE:
title =
_
("An error occurred while deleting a file or directory");
break;
case XEDIT_FILE_BROWSER_ERROR_OPEN_DIRECTORY:
case XED_FILE_BROWSER_ERROR_OPEN_DIRECTORY:
title =
_
("An error occurred while opening a directory in the file manager");
break;
case XEDIT_FILE_BROWSER_ERROR_SET_ROOT:
case XED_FILE_BROWSER_ERROR_SET_ROOT:
title =
_("An error occurred while setting a root directory");
break;
case XEDIT_FILE_BROWSER_ERROR_LOAD_DIRECTORY:
case XED_FILE_BROWSER_ERROR_LOAD_DIRECTORY:
title =
_("An error occurred while loading a directory");
break;
@@ -717,39 +717,39 @@ on_error_cb (XeditFileBrowserWidget * tree_widget,
}
static void
on_model_set_cb (XeditFileBrowserView * widget,
on_model_set_cb (XedFileBrowserView * widget,
GParamSpec *arg1,
XeditWindow * window)
XedWindow * window)
{
XeditFileBrowserPluginData * data = get_plugin_data (window);
XedFileBrowserPluginData * data = get_plugin_data (window);
GtkTreeModel * model;
model = gtk_tree_view_get_model (GTK_TREE_VIEW (xedit_file_browser_widget_get_browser_view (data->tree_widget)));
model = gtk_tree_view_get_model (GTK_TREE_VIEW (xed_file_browser_widget_get_browser_view (data->tree_widget)));
if (model == NULL)
return;
g_settings_set_boolean (data->onload_settings,
"tree-view",
XEDIT_IS_FILE_BROWSER_STORE (model));
XED_IS_FILE_BROWSER_STORE (model));
}
static void
on_filter_mode_changed_cb (XeditFileBrowserStore * model,
on_filter_mode_changed_cb (XedFileBrowserStore * model,
GParamSpec * param,
XeditWindow * window)
XedWindow * window)
{
XeditFileBrowserPluginData * data = get_plugin_data (window);
XeditFileBrowserStoreFilterMode mode;
XedFileBrowserPluginData * data = get_plugin_data (window);
XedFileBrowserStoreFilterMode mode;
mode = xedit_file_browser_store_get_filter_mode (model);
mode = xed_file_browser_store_get_filter_mode (model);
if ((mode & XEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN) &&
(mode & XEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY)) {
if ((mode & XED_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN) &&
(mode & XED_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY)) {
g_settings_set_string (data->settings, "filter-mode", "hidden_and_binary");
} else if (mode & XEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN) {
} else if (mode & XED_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN) {
g_settings_set_string (data->settings, "filter-mode", "hidden");
} else if (mode & XEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY) {
} else if (mode & XED_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");
@@ -757,30 +757,30 @@ on_filter_mode_changed_cb (XeditFileBrowserStore * model,
}
static void
on_rename_cb (XeditFileBrowserStore * store,
on_rename_cb (XedFileBrowserStore * store,
const gchar * olduri,
const gchar * newuri,
XeditWindow * window)
XedWindow * window)
{
XeditApp * app;
XedApp * app;
GList * documents;
GList * item;
XeditDocument * doc;
XedDocument * doc;
GFile * docfile;
GFile * oldfile;
GFile * newfile;
gchar * uri;
/* Find all documents and set its uri to newuri where it matches olduri */
app = xedit_app_get_default ();
documents = xedit_app_get_documents (app);
app = xed_app_get_default ();
documents = xed_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 = XEDIT_DOCUMENT (item->data);
uri = xedit_document_get_uri (doc);
doc = XED_DOCUMENT (item->data);
uri = xed_document_get_uri (doc);
if (!uri)
continue;
@@ -788,7 +788,7 @@ on_rename_cb (XeditFileBrowserStore * store,
docfile = g_file_new_for_uri (uri);
if (g_file_equal (docfile, oldfile)) {
xedit_document_set_uri (doc, newuri);
xed_document_set_uri (doc, newuri);
} else {
gchar *relative;
@@ -804,7 +804,7 @@ on_rename_cb (XeditFileBrowserStore * store,
docfile = g_file_get_child (newfile, relative);
uri = g_file_get_uri (docfile);
xedit_document_set_uri (doc, uri);
xed_document_set_uri (doc, uri);
}
g_free (relative);
@@ -821,11 +821,11 @@ on_rename_cb (XeditFileBrowserStore * store,
}
static void
on_filter_pattern_changed_cb (XeditFileBrowserWidget * widget,
on_filter_pattern_changed_cb (XedFileBrowserWidget * widget,
GParamSpec * param,
XeditWindow * window)
XedWindow * window)
{
XeditFileBrowserPluginData * data = get_plugin_data (window);
XedFileBrowserPluginData * data = get_plugin_data (window);
gchar * pattern;
g_object_get (G_OBJECT (widget), "filter-pattern", &pattern, NULL);
@@ -839,22 +839,22 @@ on_filter_pattern_changed_cb (XeditFileBrowserWidget * widget,
}
static void
on_virtual_root_changed_cb (XeditFileBrowserStore * store,
on_virtual_root_changed_cb (XedFileBrowserStore * store,
GParamSpec * param,
XeditWindow * window)
XedWindow * window)
{
XeditFileBrowserPluginData * data = get_plugin_data (window);
XedFileBrowserPluginData * data = get_plugin_data (window);
gchar * root;
gchar * virtual_root;
root = xedit_file_browser_store_get_root (store);
root = xed_file_browser_store_get_root (store);
if (!root)
return;
g_settings_set_string (data->onload_settings, "root", root);
virtual_root = xedit_file_browser_store_get_virtual_root (store);
virtual_root = xed_file_browser_store_get_virtual_root (store);
if (!virtual_root) {
/* Set virtual to same as root then */
@@ -872,9 +872,9 @@ on_virtual_root_changed_cb (XeditFileBrowserStore * store,
}
static void
on_tab_added_cb (XeditWindow * window,
XeditTab * tab,
XeditFileBrowserPluginData * data)
on_tab_added_cb (XedWindow * window,
XedTab * tab,
XedFileBrowserPluginData * data)
{
gboolean open;
gboolean load_default = TRUE;
@@ -882,14 +882,14 @@ on_tab_added_cb (XeditWindow * window,
open = g_settings_get_boolean (data->settings, "open-at-first-doc");
if (open) {
XeditDocument *doc;
XedDocument *doc;
gchar *uri;
doc = xedit_tab_get_document (tab);
doc = xed_tab_get_document (tab);
uri = xedit_document_get_uri (doc);
uri = xed_document_get_uri (doc);
if (uri != NULL && xedit_utils_uri_has_file_scheme (uri)) {
if (uri != NULL && xed_utils_uri_has_file_scheme (uri)) {
prepare_auto_root (data);
set_root_from_doc (data, doc);
load_default = FALSE;
@@ -915,16 +915,16 @@ get_filename_from_path (GtkTreeModel *model, GtkTreePath *path)
gtk_tree_model_get_iter (model, &iter, path);
gtk_tree_model_get (model, &iter,
XEDIT_FILE_BROWSER_STORE_COLUMN_URI, &uri,
XED_FILE_BROWSER_STORE_COLUMN_URI, &uri,
-1);
return xedit_file_browser_utils_uri_basename (uri);
return xed_file_browser_utils_uri_basename (uri);
}
static gboolean
on_confirm_no_trash_cb (XeditFileBrowserWidget * widget,
on_confirm_no_trash_cb (XedFileBrowserWidget * widget,
GList * files,
XeditWindow * window)
XedWindow * window)
{
gchar *normal;
gchar *message;
@@ -934,14 +934,14 @@ on_confirm_no_trash_cb (XeditFileBrowserWidget * widget,
message = _("Cannot move file to trash, do you\nwant to delete permanently?");
if (files->next == NULL) {
normal = xedit_file_browser_utils_file_basename (G_FILE (files->data));
normal = xed_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 = xedit_file_browser_utils_confirmation_dialog (window,
result = xed_file_browser_utils_confirmation_dialog (window,
GTK_MESSAGE_QUESTION,
message,
secondary,
@@ -953,16 +953,16 @@ on_confirm_no_trash_cb (XeditFileBrowserWidget * widget,
}
static gboolean
on_confirm_delete_cb (XeditFileBrowserWidget *widget,
XeditFileBrowserStore *store,
on_confirm_delete_cb (XedFileBrowserWidget *widget,
XedFileBrowserStore *store,
GList *paths,
XeditWindow *window)
XedWindow *window)
{
gchar *normal;
gchar *message;
gchar *secondary;
gboolean result;
XeditFileBrowserPluginData *data;
XedFileBrowserPluginData *data;
data = get_plugin_data (window);
@@ -976,7 +976,7 @@ on_confirm_delete_cb (XeditFileBrowserWidget *widget,
secondary = _("If you delete an item, it is permanently lost.");
result = xedit_file_browser_utils_confirmation_dialog (window,
result = xed_file_browser_utils_confirmation_dialog (window,
GTK_MESSAGE_QUESTION,
message,
secondary,

View File

@@ -0,0 +1,71 @@
/*
* xed-file-browser-plugin.h - Xed 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 __XED_FILE_BROWSER_PLUGIN_H__
#define __XED_FILE_BROWSER_PLUGIN_H__
#include <glib.h>
#include <glib-object.h>
#include <xed/xed-plugin.h>
G_BEGIN_DECLS
/*
* Type checking and casting macros
*/
#define XED_TYPE_FILE_BROWSER_PLUGIN (filetree_plugin_get_type ())
#define XED_FILE_BROWSER_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XED_TYPE_FILE_BROWSER_PLUGIN, XedFileBrowserPlugin))
#define XED_FILE_BROWSER_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XED_TYPE_FILE_BROWSER_PLUGIN, XedFileBrowserPluginClass))
#define XED_IS_FILE_BROWSER_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XED_TYPE_FILE_BROWSER_PLUGIN))
#define XED_IS_FILE_BROWSER_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XED_TYPE_FILE_BROWSER_PLUGIN))
#define XED_FILE_BROWSER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XED_TYPE_FILE_BROWSER_PLUGIN, XedFileBrowserPluginClass))
/* Private structure type */
typedef struct _XedFileBrowserPluginPrivate XedFileBrowserPluginPrivate;
typedef struct _XedFileBrowserPlugin XedFileBrowserPlugin;
typedef struct _XedFileBrowserPluginClass XedFileBrowserPluginClass;
struct _XedFileBrowserPlugin
{
XedPlugin parent_instance;
/*< private > */
XedFileBrowserPluginPrivate *priv;
};
struct _XedFileBrowserPluginClass
{
XedPluginClass 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_xed_plugin (GTypeModule * module);
G_END_DECLS
#endif /* __XED_FILE_BROWSER_PLUGIN_H__ */
// ex:ts=8:noet:

View File

@@ -0,0 +1,200 @@
/*
* xed-file-browser-store.h - Xed 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 __XED_FILE_BROWSER_STORE_H__
#define __XED_FILE_BROWSER_STORE_H__
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define XED_TYPE_FILE_BROWSER_STORE (xed_file_browser_store_get_type ())
#define XED_FILE_BROWSER_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XED_TYPE_FILE_BROWSER_STORE, XedFileBrowserStore))
#define XED_FILE_BROWSER_STORE_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XED_TYPE_FILE_BROWSER_STORE, XedFileBrowserStore const))
#define XED_FILE_BROWSER_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XED_TYPE_FILE_BROWSER_STORE, XedFileBrowserStoreClass))
#define XED_IS_FILE_BROWSER_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XED_TYPE_FILE_BROWSER_STORE))
#define XED_IS_FILE_BROWSER_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XED_TYPE_FILE_BROWSER_STORE))
#define XED_FILE_BROWSER_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XED_TYPE_FILE_BROWSER_STORE, XedFileBrowserStoreClass))
typedef enum
{
XED_FILE_BROWSER_STORE_COLUMN_ICON = 0,
XED_FILE_BROWSER_STORE_COLUMN_NAME,
XED_FILE_BROWSER_STORE_COLUMN_URI,
XED_FILE_BROWSER_STORE_COLUMN_FLAGS,
XED_FILE_BROWSER_STORE_COLUMN_EMBLEM,
XED_FILE_BROWSER_STORE_COLUMN_NUM
} XedFileBrowserStoreColumn;
typedef enum
{
XED_FILE_BROWSER_STORE_FLAG_IS_DIRECTORY = 1 << 0,
XED_FILE_BROWSER_STORE_FLAG_IS_HIDDEN = 1 << 1,
XED_FILE_BROWSER_STORE_FLAG_IS_TEXT = 1 << 2,
XED_FILE_BROWSER_STORE_FLAG_LOADED = 1 << 3,
XED_FILE_BROWSER_STORE_FLAG_IS_FILTERED = 1 << 4,
XED_FILE_BROWSER_STORE_FLAG_IS_DUMMY = 1 << 5
} XedFileBrowserStoreFlag;
typedef enum
{
XED_FILE_BROWSER_STORE_RESULT_OK,
XED_FILE_BROWSER_STORE_RESULT_NO_CHANGE,
XED_FILE_BROWSER_STORE_RESULT_ERROR,
XED_FILE_BROWSER_STORE_RESULT_NO_TRASH,
XED_FILE_BROWSER_STORE_RESULT_MOUNTING,
XED_FILE_BROWSER_STORE_RESULT_NUM
} XedFileBrowserStoreResult;
typedef enum
{
XED_FILE_BROWSER_STORE_FILTER_MODE_NONE = 0,
XED_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN = 1 << 0,
XED_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY = 1 << 1
} XedFileBrowserStoreFilterMode;
#define FILE_IS_DIR(flags) (flags & XED_FILE_BROWSER_STORE_FLAG_IS_DIRECTORY)
#define FILE_IS_HIDDEN(flags) (flags & XED_FILE_BROWSER_STORE_FLAG_IS_HIDDEN)
#define FILE_IS_TEXT(flags) (flags & XED_FILE_BROWSER_STORE_FLAG_IS_TEXT)
#define FILE_LOADED(flags) (flags & XED_FILE_BROWSER_STORE_FLAG_LOADED)
#define FILE_IS_FILTERED(flags) (flags & XED_FILE_BROWSER_STORE_FLAG_IS_FILTERED)
#define FILE_IS_DUMMY(flags) (flags & XED_FILE_BROWSER_STORE_FLAG_IS_DUMMY)
typedef struct _XedFileBrowserStore XedFileBrowserStore;
typedef struct _XedFileBrowserStoreClass XedFileBrowserStoreClass;
typedef struct _XedFileBrowserStorePrivate XedFileBrowserStorePrivate;
typedef gboolean (*XedFileBrowserStoreFilterFunc) (XedFileBrowserStore
* model,
GtkTreeIter * iter,
gpointer user_data);
struct _XedFileBrowserStore
{
GObject parent;
XedFileBrowserStorePrivate *priv;
};
struct _XedFileBrowserStoreClass {
GObjectClass parent_class;
/* Signals */
void (*begin_loading) (XedFileBrowserStore * model,
GtkTreeIter * iter);
void (*end_loading) (XedFileBrowserStore * model,
GtkTreeIter * iter);
void (*error) (XedFileBrowserStore * model,
guint code,
gchar * message);
gboolean (*no_trash) (XedFileBrowserStore * model,
GList * files);
void (*rename) (XedFileBrowserStore * model,
const gchar * olduri,
const gchar * newuri);
void (*begin_refresh) (XedFileBrowserStore * model);
void (*end_refresh) (XedFileBrowserStore * model);
void (*unload) (XedFileBrowserStore * model,
const gchar * uri);
};
GType xed_file_browser_store_get_type (void) G_GNUC_CONST;
GType xed_file_browser_store_register_type (GTypeModule * module);
XedFileBrowserStore *xed_file_browser_store_new (gchar const *root);
XedFileBrowserStoreResult
xed_file_browser_store_set_root_and_virtual_root (XedFileBrowserStore * model,
gchar const *root,
gchar const *virtual_root);
XedFileBrowserStoreResult
xed_file_browser_store_set_root (XedFileBrowserStore * model,
gchar const *root);
XedFileBrowserStoreResult
xed_file_browser_store_set_virtual_root (XedFileBrowserStore * model,
GtkTreeIter * iter);
XedFileBrowserStoreResult
xed_file_browser_store_set_virtual_root_from_string (XedFileBrowserStore * model,
gchar const *root);
XedFileBrowserStoreResult
xed_file_browser_store_set_virtual_root_up (XedFileBrowserStore * model);
XedFileBrowserStoreResult
xed_file_browser_store_set_virtual_root_top (XedFileBrowserStore * model);
gboolean
xed_file_browser_store_get_iter_virtual_root (XedFileBrowserStore * model,
GtkTreeIter * iter);
gboolean xed_file_browser_store_get_iter_root (XedFileBrowserStore * model,
GtkTreeIter * iter);
gchar * xed_file_browser_store_get_root (XedFileBrowserStore * model);
gchar * xed_file_browser_store_get_virtual_root (XedFileBrowserStore * model);
gboolean xed_file_browser_store_iter_equal (XedFileBrowserStore * model,
GtkTreeIter * iter1,
GtkTreeIter * iter2);
void xed_file_browser_store_set_value (XedFileBrowserStore * tree_model,
GtkTreeIter * iter,
gint column,
GValue * value);
void _xed_file_browser_store_iter_expanded (XedFileBrowserStore * model,
GtkTreeIter * iter);
void _xed_file_browser_store_iter_collapsed (XedFileBrowserStore * model,
GtkTreeIter * iter);
XedFileBrowserStoreFilterMode
xed_file_browser_store_get_filter_mode (XedFileBrowserStore * model);
void xed_file_browser_store_set_filter_mode (XedFileBrowserStore * model,
XedFileBrowserStoreFilterMode mode);
void xed_file_browser_store_set_filter_func (XedFileBrowserStore * model,
XedFileBrowserStoreFilterFunc func,
gpointer user_data);
void xed_file_browser_store_refilter (XedFileBrowserStore * model);
XedFileBrowserStoreFilterMode
xed_file_browser_store_filter_mode_get_default (void);
void xed_file_browser_store_refresh (XedFileBrowserStore * model);
gboolean xed_file_browser_store_rename (XedFileBrowserStore * model,
GtkTreeIter * iter,
gchar const *new_name,
GError ** error);
XedFileBrowserStoreResult
xed_file_browser_store_delete (XedFileBrowserStore * model,
GtkTreeIter * iter,
gboolean trash);
XedFileBrowserStoreResult
xed_file_browser_store_delete_all (XedFileBrowserStore * model,
GList *rows,
gboolean trash);
gboolean xed_file_browser_store_new_file (XedFileBrowserStore * model,
GtkTreeIter * parent,
GtkTreeIter * iter);
gboolean xed_file_browser_store_new_directory (XedFileBrowserStore * model,
GtkTreeIter * parent,
GtkTreeIter * iter);
void xed_file_browser_store_cancel_mount_operation (XedFileBrowserStore *store);
G_END_DECLS
#endif /* __XED_FILE_BROWSER_STORE_H__ */
// ex:ts=8:noet:

View File

@@ -1,5 +1,5 @@
/*
* xedit-file-bookmarks-store.c - Xedit plugin providing easy file access
* xed-file-bookmarks-store.c - Xed 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 "xedit-file-browser-utils.h"
#include <xedit/xedit-utils.h>
#include "xed-file-browser-utils.h"
#include <xed/xed-utils.h>
static GdkPixbuf *
process_icon_pixbuf (GdkPixbuf * pixbuf,
@@ -50,7 +50,7 @@ process_icon_pixbuf (GdkPixbuf * pixbuf,
}
GdkPixbuf *
xedit_file_browser_utils_pixbuf_from_theme (gchar const * name,
xed_file_browser_utils_pixbuf_from_theme (gchar const * name,
GtkIconSize size)
{
gint width;
@@ -71,7 +71,7 @@ xedit_file_browser_utils_pixbuf_from_theme (gchar const * name,
}
GdkPixbuf *
xedit_file_browser_utils_pixbuf_from_icon (GIcon * icon,
xed_file_browser_utils_pixbuf_from_icon (GIcon * icon,
GtkIconSize size)
{
GdkPixbuf * ret = NULL;
@@ -100,7 +100,7 @@ xedit_file_browser_utils_pixbuf_from_icon (GIcon * icon,
}
GdkPixbuf *
xedit_file_browser_utils_pixbuf_from_file (GFile * file,
xed_file_browser_utils_pixbuf_from_file (GFile * file,
GtkIconSize size)
{
GIcon * icon;
@@ -118,7 +118,7 @@ xedit_file_browser_utils_pixbuf_from_file (GFile * file,
icon = g_file_info_get_icon (info);
if (icon != NULL)
ret = xedit_file_browser_utils_pixbuf_from_icon (icon, size);
ret = xed_file_browser_utils_pixbuf_from_icon (icon, size);
g_object_unref (info);
@@ -126,26 +126,26 @@ xedit_file_browser_utils_pixbuf_from_file (GFile * file,
}
gchar *
xedit_file_browser_utils_file_basename (GFile * file)
xed_file_browser_utils_file_basename (GFile * file)
{
gchar *uri;
gchar *ret;
uri = g_file_get_uri (file);
ret = xedit_file_browser_utils_uri_basename (uri);
ret = xed_file_browser_utils_uri_basename (uri);
g_free (uri);
return ret;
}
gchar *
xedit_file_browser_utils_uri_basename (gchar const * uri)
xed_file_browser_utils_uri_basename (gchar const * uri)
{
return xedit_utils_basename_for_display (uri);
return xed_utils_basename_for_display (uri);
}
gboolean
xedit_file_browser_utils_confirmation_dialog (XeditWindow * window,
xed_file_browser_utils_confirmation_dialog (XedWindow * window,
GtkMessageType type,
gchar const *message,
gchar const *secondary,

View File

@@ -1,27 +1,27 @@
#ifndef __XEDIT_FILE_BROWSER_UTILS_H__
#define __XEDIT_FILE_BROWSER_UTILS_H__
#ifndef __XED_FILE_BROWSER_UTILS_H__
#define __XED_FILE_BROWSER_UTILS_H__
#include <xedit/xedit-window.h>
#include <xed/xed-window.h>
#include <gio/gio.h>
GdkPixbuf *xedit_file_browser_utils_pixbuf_from_theme (gchar const *name,
GdkPixbuf *xed_file_browser_utils_pixbuf_from_theme (gchar const *name,
GtkIconSize size);
GdkPixbuf *xedit_file_browser_utils_pixbuf_from_icon (GIcon * icon,
GdkPixbuf *xed_file_browser_utils_pixbuf_from_icon (GIcon * icon,
GtkIconSize size);
GdkPixbuf *xedit_file_browser_utils_pixbuf_from_file (GFile * file,
GdkPixbuf *xed_file_browser_utils_pixbuf_from_file (GFile * file,
GtkIconSize size);
gchar * xedit_file_browser_utils_file_basename (GFile * file);
gchar * xedit_file_browser_utils_uri_basename (gchar const * uri);
gchar * xed_file_browser_utils_file_basename (GFile * file);
gchar * xed_file_browser_utils_uri_basename (gchar const * uri);
gboolean xedit_file_browser_utils_confirmation_dialog (XeditWindow * window,
gboolean xed_file_browser_utils_confirmation_dialog (XedWindow * window,
GtkMessageType type,
gchar const *message,
gchar const *secondary,
gchar const * button_stock,
gchar const * button_label);
#endif /* __XEDIT_FILE_BROWSER_UTILS_H__ */
#endif /* __XED_FILE_BROWSER_UTILS_H__ */
// ex:ts=8:noet:

View File

@@ -1,5 +1,5 @@
/*
* xedit-file-browser-view.c - Xedit plugin providing easy file access
* xed-file-browser-view.c - Xed 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 <xedit/xedit-plugin.h>
#include <xed/xed-plugin.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.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"
#include "xed-file-browser-store.h"
#include "xed-file-bookmarks-store.h"
#include "xed-file-browser-view.h"
#include "xed-file-browser-marshal.h"
#include "xed-file-browser-enum-types.h"
#define XEDIT_FILE_BROWSER_VIEW_GET_PRIVATE(object)( \
#define XED_FILE_BROWSER_VIEW_GET_PRIVATE(object)( \
G_TYPE_INSTANCE_GET_PRIVATE((object), \
XEDIT_TYPE_FILE_BROWSER_VIEW, XeditFileBrowserViewPrivate))
XED_TYPE_FILE_BROWSER_VIEW, XedFileBrowserViewPrivate))
struct _XeditFileBrowserViewPrivate
struct _XedFileBrowserViewPrivate
{
GtkTreeViewColumn *column;
GtkCellRenderer *pixbuf_renderer;
@@ -47,7 +47,7 @@ struct _XeditFileBrowserViewPrivate
GdkCursor *busy_cursor;
/* CLick policy */
XeditFileBrowserViewClickPolicy click_policy;
XedFileBrowserViewClickPolicy 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 }
};
XEDIT_PLUGIN_DEFINE_TYPE (XeditFileBrowserView, xedit_file_browser_view,
XED_PLUGIN_DEFINE_TYPE (XedFileBrowserView, xed_file_browser_view,
GTK_TYPE_TREE_VIEW)
static void on_cell_edited (GtkCellRendererText * cell,
gchar * path,
gchar * new_text,
XeditFileBrowserView * tree_view);
XedFileBrowserView * tree_view);
static void on_begin_refresh (XeditFileBrowserStore * model,
XeditFileBrowserView * view);
static void on_end_refresh (XeditFileBrowserStore * model,
XeditFileBrowserView * view);
static void on_begin_refresh (XedFileBrowserStore * model,
XedFileBrowserView * view);
static void on_end_refresh (XedFileBrowserStore * model,
XedFileBrowserView * view);
static void on_unload (XeditFileBrowserStore * model,
static void on_unload (XedFileBrowserStore * model,
gchar const * uri,
XeditFileBrowserView * view);
XedFileBrowserView * view);
static void on_row_inserted (XeditFileBrowserStore * model,
static void on_row_inserted (XedFileBrowserStore * model,
GtkTreePath * path,
GtkTreeIter * iter,
XeditFileBrowserView * view);
XedFileBrowserView * view);
static void
xedit_file_browser_view_finalize (GObject * object)
xed_file_browser_view_finalize (GObject * object)
{
XeditFileBrowserView *obj = XEDIT_FILE_BROWSER_VIEW(object);
XedFileBrowserView *obj = XED_FILE_BROWSER_VIEW(object);
if (obj->priv->hand_cursor)
#if GTK_CHECK_VERSION (3, 0, 0)
@@ -135,12 +135,12 @@ xedit_file_browser_view_finalize (GObject * object)
gdk_cursor_unref (obj->priv->busy_cursor);
#endif
G_OBJECT_CLASS (xedit_file_browser_view_parent_class)->
G_OBJECT_CLASS (xed_file_browser_view_parent_class)->
finalize (object);
}
static void
add_expand_state (XeditFileBrowserView * view,
add_expand_state (XedFileBrowserView * view,
gchar const * uri)
{
GFile * file;
@@ -157,7 +157,7 @@ add_expand_state (XeditFileBrowserView * view,
}
static void
remove_expand_state (XeditFileBrowserView * view,
remove_expand_state (XedFileBrowserView * view,
gchar const * uri)
{
GFile * file;
@@ -178,20 +178,20 @@ row_expanded (GtkTreeView * tree_view,
GtkTreeIter * iter,
GtkTreePath * path)
{
XeditFileBrowserView *view = XEDIT_FILE_BROWSER_VIEW (tree_view);
XedFileBrowserView *view = XED_FILE_BROWSER_VIEW (tree_view);
gchar * uri;
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 (GTK_TREE_VIEW_CLASS (xed_file_browser_view_parent_class)->row_expanded)
GTK_TREE_VIEW_CLASS (xed_file_browser_view_parent_class)->row_expanded (tree_view, iter, path);
if (!XEDIT_IS_FILE_BROWSER_STORE (view->priv->model))
if (!XED_IS_FILE_BROWSER_STORE (view->priv->model))
return;
if (view->priv->restore_expand_state)
{
gtk_tree_model_get (view->priv->model,
iter,
XEDIT_FILE_BROWSER_STORE_COLUMN_URI,
XED_FILE_BROWSER_STORE_COLUMN_URI,
&uri,
-1);
@@ -199,7 +199,7 @@ row_expanded (GtkTreeView * tree_view,
g_free (uri);
}
_xedit_file_browser_store_iter_expanded (XEDIT_FILE_BROWSER_STORE (view->priv->model),
_xed_file_browser_store_iter_expanded (XED_FILE_BROWSER_STORE (view->priv->model),
iter);
}
@@ -208,20 +208,20 @@ row_collapsed (GtkTreeView * tree_view,
GtkTreeIter * iter,
GtkTreePath * path)
{
XeditFileBrowserView *view = XEDIT_FILE_BROWSER_VIEW (tree_view);
XedFileBrowserView *view = XED_FILE_BROWSER_VIEW (tree_view);
gchar * uri;
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 (GTK_TREE_VIEW_CLASS (xed_file_browser_view_parent_class)->row_collapsed)
GTK_TREE_VIEW_CLASS (xed_file_browser_view_parent_class)->row_collapsed (tree_view, iter, path);
if (!XEDIT_IS_FILE_BROWSER_STORE (view->priv->model))
if (!XED_IS_FILE_BROWSER_STORE (view->priv->model))
return;
if (view->priv->restore_expand_state)
{
gtk_tree_model_get (view->priv->model,
iter,
XEDIT_FILE_BROWSER_STORE_COLUMN_URI,
XED_FILE_BROWSER_STORE_COLUMN_URI,
&uri,
-1);
@@ -229,7 +229,7 @@ row_collapsed (GtkTreeView * tree_view,
g_free (uri);
}
_xedit_file_browser_store_iter_collapsed (XEDIT_FILE_BROWSER_STORE (view->priv->model),
_xed_file_browser_store_iter_collapsed (XED_FILE_BROWSER_STORE (view->priv->model),
iter);
}
@@ -237,25 +237,25 @@ static gboolean
leave_notify_event (GtkWidget *widget,
GdkEventCrossing *event)
{
XeditFileBrowserView *view = XEDIT_FILE_BROWSER_VIEW (widget);
XedFileBrowserView *view = XED_FILE_BROWSER_VIEW (widget);
if (view->priv->click_policy == XEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE &&
if (view->priv->click_policy == XED_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 (xedit_file_browser_view_parent_class)->leave_notify_event (widget, event);
return GTK_WIDGET_CLASS (xed_file_browser_view_parent_class)->leave_notify_event (widget, event);
}
static gboolean
enter_notify_event (GtkWidget *widget,
GdkEventCrossing *event)
{
XeditFileBrowserView *view = XEDIT_FILE_BROWSER_VIEW (widget);
XedFileBrowserView *view = XED_FILE_BROWSER_VIEW (widget);
if (view->priv->click_policy == XEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) {
if (view->priv->click_policy == XED_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 (xedit_file_browser_view_parent_class)->enter_notify_event (widget, event);
return GTK_WIDGET_CLASS (xed_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;
XeditFileBrowserView *view = XEDIT_FILE_BROWSER_VIEW (widget);
XedFileBrowserView *view = XED_FILE_BROWSER_VIEW (widget);
if (view->priv->click_policy == XEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) {
if (view->priv->click_policy == XED_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 (xedit_file_browser_view_parent_class)->motion_notify_event (widget, event);
return GTK_WIDGET_CLASS (xed_file_browser_view_parent_class)->motion_notify_event (widget, event);
}
static void
set_click_policy_property (XeditFileBrowserView *obj,
XeditFileBrowserViewClickPolicy click_policy)
set_click_policy_property (XedFileBrowserView *obj,
XedFileBrowserViewClickPolicy click_policy)
{
GtkTreeIter iter;
GdkDisplay *display;
@@ -314,7 +314,7 @@ set_click_policy_property (XeditFileBrowserView *obj,
obj->priv->click_policy = click_policy;
if (click_policy == XEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) {
if (click_policy == XED_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 (XeditFileBrowserView *obj,
#else
obj->priv->hand_cursor = gdk_cursor_new(GDK_HAND2);
#endif
} else if (click_policy == XEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE) {
} else if (click_policy == XED_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 (XeditFileBrowserView *obj,
}
static void
directory_activated (XeditFileBrowserView *view,
directory_activated (XedFileBrowserView *view,
GtkTreeIter *iter)
{
xedit_file_browser_store_set_virtual_root (XEDIT_FILE_BROWSER_STORE (view->priv->model), iter);
xed_file_browser_store_set_virtual_root (XED_FILE_BROWSER_STORE (view->priv->model), iter);
}
static void
activate_selected_files (XeditFileBrowserView *view) {
activate_selected_files (XedFileBrowserView *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;
XeditFileBrowserStoreFlag flags;
XedFileBrowserStoreFlag flags;
rows = gtk_tree_selection_get_selected_rows (selection, &view->priv->model);
@@ -380,7 +380,7 @@ activate_selected_files (XeditFileBrowserView *view) {
if (!gtk_tree_model_get_iter (view->priv->model, &iter, path))
continue;
gtk_tree_model_get (view->priv->model, &iter, XEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, -1);
gtk_tree_model_get (view->priv->model, &iter, XED_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, -1);
if (FILE_IS_DIR (flags)) {
if (directory == NULL)
@@ -401,7 +401,7 @@ activate_selected_files (XeditFileBrowserView *view) {
}
static void
activate_selected_bookmark (XeditFileBrowserView *view) {
activate_selected_bookmark (XedFileBrowserView *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 (XeditFileBrowserView *view) {
}
static void
activate_selected_items (XeditFileBrowserView *view)
activate_selected_items (XedFileBrowserView *view)
{
if (XEDIT_IS_FILE_BROWSER_STORE (view->priv->model))
if (XED_IS_FILE_BROWSER_STORE (view->priv->model))
activate_selected_files (view);
else if (XEDIT_IS_FILE_BOOKMARKS_STORE (view->priv->model))
else if (XED_IS_FILE_BOOKMARKS_STORE (view->priv->model))
activate_selected_bookmark (view);
}
static void
toggle_hidden_filter (XeditFileBrowserView *view)
toggle_hidden_filter (XedFileBrowserView *view)
{
XeditFileBrowserStoreFilterMode mode;
XedFileBrowserStoreFilterMode mode;
if (XEDIT_IS_FILE_BROWSER_STORE (view->priv->model))
if (XED_IS_FILE_BROWSER_STORE (view->priv->model))
{
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);
mode = xed_file_browser_store_get_filter_mode
(XED_FILE_BROWSER_STORE (view->priv->model));
mode ^= XED_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN;
xed_file_browser_store_set_filter_mode
(XED_FILE_BROWSER_STORE (view->priv->model), mode);
}
}
@@ -444,17 +444,17 @@ static void
drag_begin (GtkWidget *widget,
GdkDragContext *context)
{
XeditFileBrowserView *view = XEDIT_FILE_BROWSER_VIEW (widget);
XedFileBrowserView *view = XED_FILE_BROWSER_VIEW (widget);
view->priv->drag_button = 0;
view->priv->drag_started = TRUE;
/* Chain up */
GTK_WIDGET_CLASS (xedit_file_browser_view_parent_class)->drag_begin (widget, context);
GTK_WIDGET_CLASS (xed_file_browser_view_parent_class)->drag_begin (widget, context);
}
static void
did_not_drag (XeditFileBrowserView *view,
did_not_drag (XedFileBrowserView *view,
GdkEventButton *event)
{
GtkTreeView *tree_view;
@@ -466,7 +466,7 @@ did_not_drag (XeditFileBrowserView *view,
if (gtk_tree_view_get_path_at_pos (tree_view, event->x, event->y,
&path, NULL, NULL, NULL)) {
if ((view->priv->click_policy == XEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE)
if ((view->priv->click_policy == XED_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)
{
XeditFileBrowserView *view = XEDIT_FILE_BROWSER_VIEW (widget);
XedFileBrowserView *view = XED_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 (xedit_file_browser_view_parent_class)->button_release_event (widget, event);
return GTK_WIDGET_CLASS (xed_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;
XeditFileBrowserView *view;
XedFileBrowserView *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(xedit_file_browser_view_parent_class);
GtkWidgetClass *widget_parent = GTK_WIDGET_CLASS(xed_file_browser_view_parent_class);
tree_view = GTK_TREE_VIEW (widget);
view = XEDIT_FILE_BROWSER_VIEW (widget);
view = XED_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 == XEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE &&
if (view->priv->click_policy == XED_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 != XEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE;
view->priv->ignore_release = call_parent && view->priv->click_policy != XED_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)
{
XeditFileBrowserView *view;
XedFileBrowserView *view;
guint modifiers;
gboolean handled;
view = XEDIT_FILE_BROWSER_VIEW (widget);
view = XED_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 (xedit_file_browser_view_parent_class)->key_press_event (widget, event);
return GTK_WIDGET_CLASS (xed_file_browser_view_parent_class)->key_press_event (widget, event);
return TRUE;
}
static void
fill_expand_state (XeditFileBrowserView * view, GtkTreeIter * iter)
fill_expand_state (XedFileBrowserView * view, GtkTreeIter * iter)
{
GtkTreePath * path;
GtkTreeIter child;
@@ -705,7 +705,7 @@ fill_expand_state (XeditFileBrowserView * view, GtkTreeIter * iter)
{
gtk_tree_model_get (view->priv->model,
iter,
XEDIT_FILE_BROWSER_STORE_COLUMN_URI,
XED_FILE_BROWSER_STORE_COLUMN_URI,
&uri,
-1);
@@ -724,7 +724,7 @@ fill_expand_state (XeditFileBrowserView * view, GtkTreeIter * iter)
}
static void
uninstall_restore_signals (XeditFileBrowserView * tree_view,
uninstall_restore_signals (XedFileBrowserView * tree_view,
GtkTreeModel * model)
{
g_signal_handlers_disconnect_by_func (model,
@@ -745,7 +745,7 @@ uninstall_restore_signals (XeditFileBrowserView * tree_view,
}
static void
install_restore_signals (XeditFileBrowserView * tree_view,
install_restore_signals (XedFileBrowserView * tree_view,
GtkTreeModel * model)
{
g_signal_connect (model,
@@ -770,7 +770,7 @@ install_restore_signals (XeditFileBrowserView * tree_view,
}
static void
set_restore_expand_state (XeditFileBrowserView * view,
set_restore_expand_state (XedFileBrowserView * view,
gboolean state)
{
if (state == view->priv->restore_expand_state)
@@ -789,14 +789,14 @@ set_restore_expand_state (XeditFileBrowserView * view,
g_object_unref,
NULL);
if (view->priv->model && XEDIT_IS_FILE_BROWSER_STORE (view->priv->model))
if (view->priv->model && XED_IS_FILE_BROWSER_STORE (view->priv->model))
{
fill_expand_state (view, NULL);
install_restore_signals (view, view->priv->model);
}
}
else if (view->priv->model && XEDIT_IS_FILE_BROWSER_STORE (view->priv->model))
else if (view->priv->model && XED_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)
{
XeditFileBrowserView *obj = XEDIT_FILE_BROWSER_VIEW (object);
XedFileBrowserView *obj = XED_FILE_BROWSER_VIEW (object);
switch (prop_id)
{
@@ -832,7 +832,7 @@ set_property (GObject *object,
const GValue *value,
GParamSpec *pspec)
{
XeditFileBrowserView *obj = XEDIT_FILE_BROWSER_VIEW (object);
XedFileBrowserView *obj = XED_FILE_BROWSER_VIEW (object);
switch (prop_id)
{
@@ -849,13 +849,13 @@ set_property (GObject *object,
}
static void
xedit_file_browser_view_class_init (XeditFileBrowserViewClass * klass)
xed_file_browser_view_class_init (XedFileBrowserViewClass * 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 = xedit_file_browser_view_finalize;
object_class->finalize = xed_file_browser_view_finalize;
object_class->get_property = get_property;
object_class->set_property = set_property;
@@ -879,8 +879,8 @@ xedit_file_browser_view_class_init (XeditFileBrowserViewClass * klass)
g_param_spec_enum ("click-policy",
"Click Policy",
"The click policy",
XEDIT_TYPE_FILE_BROWSER_VIEW_CLICK_POLICY,
XEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE,
XED_TYPE_FILE_BROWSER_VIEW_CLICK_POLICY,
XED_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 @@ xedit_file_browser_view_class_init (XeditFileBrowserViewClass * klass)
g_signal_new ("error",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (XeditFileBrowserViewClass,
G_STRUCT_OFFSET (XedFileBrowserViewClass,
error), NULL, NULL,
xedit_file_browser_marshal_VOID__UINT_STRING,
xed_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 (XeditFileBrowserViewClass,
G_STRUCT_OFFSET (XedFileBrowserViewClass,
file_activated), NULL, NULL,
g_cclosure_marshal_VOID__BOXED,
G_TYPE_NONE, 1, GTK_TYPE_TREE_ITER);
@@ -910,7 +910,7 @@ xedit_file_browser_view_class_init (XeditFileBrowserViewClass * klass)
g_signal_new ("directory-activated",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (XeditFileBrowserViewClass,
G_STRUCT_OFFSET (XedFileBrowserViewClass,
directory_activated), NULL, NULL,
g_cclosure_marshal_VOID__BOXED,
G_TYPE_NONE, 1, GTK_TYPE_TREE_ITER);
@@ -918,19 +918,19 @@ xedit_file_browser_view_class_init (XeditFileBrowserViewClass * klass)
g_signal_new ("bookmark-activated",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (XeditFileBrowserViewClass,
G_STRUCT_OFFSET (XedFileBrowserViewClass,
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 (XeditFileBrowserViewPrivate));
sizeof (XedFileBrowserViewPrivate));
}
static void
cell_data_cb (GtkTreeViewColumn * tree_column, GtkCellRenderer * cell,
GtkTreeModel * tree_model, GtkTreeIter * iter,
XeditFileBrowserView * obj)
XedFileBrowserView * 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 == XEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) {
if (obj->priv->click_policy == XED_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 (XEDIT_IS_FILE_BROWSER_STORE (tree_model))
if (XED_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
xedit_file_browser_view_init (XeditFileBrowserView * obj)
xed_file_browser_view_init (XedFileBrowserView * obj)
{
#if GTK_CHECK_VERSION (3, 16, 0)
GdkDisplay *display;
#endif
obj->priv = XEDIT_FILE_BROWSER_VIEW_GET_PRIVATE (obj);
obj->priv = XED_FILE_BROWSER_VIEW_GET_PRIVATE (obj);
obj->priv->column = gtk_tree_view_column_new ();
@@ -976,7 +976,7 @@ xedit_file_browser_view_init (XeditFileBrowserView * obj)
gtk_tree_view_column_add_attribute (obj->priv->column,
obj->priv->pixbuf_renderer,
"pixbuf",
XEDIT_FILE_BROWSER_STORE_COLUMN_ICON);
XED_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 @@ xedit_file_browser_view_init (XeditFileBrowserView * obj)
gtk_tree_view_column_add_attribute (obj->priv->column,
obj->priv->text_renderer,
"text",
XEDIT_FILE_BROWSER_STORE_COLUMN_NAME);
XED_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,
XEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS,
XED_FILE_BOOKMARKS_STORE_COLUMN_FLAGS,
&flags, -1);
return (flags & XEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR);
return (flags & XED_FILE_BOOKMARKS_STORE_IS_SEPARATOR);
}
/* Public */
GtkWidget *
xedit_file_browser_view_new (void)
xed_file_browser_view_new (void)
{
XeditFileBrowserView *obj =
XEDIT_FILE_BROWSER_VIEW (g_object_new
(XEDIT_TYPE_FILE_BROWSER_VIEW, NULL));
XedFileBrowserView *obj =
XED_FILE_BROWSER_VIEW (g_object_new
(XED_TYPE_FILE_BROWSER_VIEW, NULL));
return GTK_WIDGET (obj);
}
void
xedit_file_browser_view_set_model (XeditFileBrowserView * tree_view,
xed_file_browser_view_set_model (XedFileBrowserView * tree_view,
GtkTreeModel * model)
{
GtkTreeSelection *selection;
@@ -1042,7 +1042,7 @@ xedit_file_browser_view_set_model (XeditFileBrowserView * tree_view,
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
if (XEDIT_IS_FILE_BOOKMARKS_STORE (model)) {
if (XED_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 @@ xedit_file_browser_view_set_model (XeditFileBrowserView * tree_view,
tree_view->priv->hover_path = NULL;
}
if (XEDIT_IS_FILE_BROWSER_STORE (tree_view->priv->model)) {
if (XED_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 @@ xedit_file_browser_view_set_model (XeditFileBrowserView * tree_view,
}
void
xedit_file_browser_view_start_rename (XeditFileBrowserView * tree_view,
xed_file_browser_view_start_rename (XedFileBrowserView * tree_view,
GtkTreeIter * iter)
{
guint flags;
GtkTreeRowReference *rowref;
GtkTreePath *path;
g_return_if_fail (XEDIT_IS_FILE_BROWSER_VIEW (tree_view));
g_return_if_fail (XEDIT_IS_FILE_BROWSER_STORE
g_return_if_fail (XED_IS_FILE_BROWSER_VIEW (tree_view));
g_return_if_fail (XED_IS_FILE_BROWSER_STORE
(tree_view->priv->model));
g_return_if_fail (iter != NULL);
gtk_tree_model_get (tree_view->priv->model, iter,
XEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
XED_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
-1);
if (!(FILE_IS_DIR (flags) || !FILE_IS_DUMMY (flags)))
@@ -1132,10 +1132,10 @@ xedit_file_browser_view_start_rename (XeditFileBrowserView * tree_view,
}
void
xedit_file_browser_view_set_click_policy (XeditFileBrowserView *tree_view,
XeditFileBrowserViewClickPolicy policy)
xed_file_browser_view_set_click_policy (XedFileBrowserView *tree_view,
XedFileBrowserViewClickPolicy policy)
{
g_return_if_fail (XEDIT_IS_FILE_BROWSER_VIEW (tree_view));
g_return_if_fail (XED_IS_FILE_BROWSER_VIEW (tree_view));
set_click_policy_property (tree_view, policy);
@@ -1143,10 +1143,10 @@ xedit_file_browser_view_set_click_policy (XeditFileBrowserView *tree_view,
}
void
xedit_file_browser_view_set_restore_expand_state (XeditFileBrowserView * tree_view,
xed_file_browser_view_set_restore_expand_state (XedFileBrowserView * tree_view,
gboolean restore_expand_state)
{
g_return_if_fail (XEDIT_IS_FILE_BROWSER_VIEW (tree_view));
g_return_if_fail (XED_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 @@ xedit_file_browser_view_set_restore_expand_state (XeditFileBrowserView * tree_vi
/* Signal handlers */
static void
on_cell_edited (GtkCellRendererText * cell, gchar * path, gchar * new_text,
XeditFileBrowserView * tree_view)
XedFileBrowserView * 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 (xedit_file_browser_store_rename (XEDIT_FILE_BROWSER_STORE (tree_view->priv->model),
if (xed_file_browser_store_rename (XED_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 (XeditFileBrowserStore * model,
XeditFileBrowserView * view)
on_begin_refresh (XedFileBrowserStore * model,
XedFileBrowserView * view)
{
/* Store the refresh state, so we can handle unloading of nodes while
refreshing properly */
@@ -1201,8 +1201,8 @@ on_begin_refresh (XeditFileBrowserStore * model,
}
static void
on_end_refresh (XeditFileBrowserStore * model,
XeditFileBrowserView * view)
on_end_refresh (XedFileBrowserStore * model,
XedFileBrowserView * view)
{
/* Store the refresh state, so we can handle unloading of nodes while
refreshing properly */
@@ -1210,9 +1210,9 @@ on_end_refresh (XeditFileBrowserStore * model,
}
static void
on_unload (XeditFileBrowserStore * model,
on_unload (XedFileBrowserStore * model,
gchar const * uri,
XeditFileBrowserView * view)
XedFileBrowserView * 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 (XeditFileBrowserStore * model,
}
static void
restore_expand_state (XeditFileBrowserView * view,
XeditFileBrowserStore * model,
restore_expand_state (XedFileBrowserView * view,
XedFileBrowserStore * model,
GtkTreeIter * iter)
{
gchar * uri;
@@ -1232,7 +1232,7 @@ restore_expand_state (XeditFileBrowserView * view,
gtk_tree_model_get (GTK_TREE_MODEL (model),
iter,
XEDIT_FILE_BROWSER_STORE_COLUMN_URI,
XED_FILE_BROWSER_STORE_COLUMN_URI,
&uri,
-1);
@@ -1256,10 +1256,10 @@ restore_expand_state (XeditFileBrowserView * view,
}
static void
on_row_inserted (XeditFileBrowserStore * model,
on_row_inserted (XedFileBrowserStore * model,
GtkTreePath * path,
GtkTreeIter * iter,
XeditFileBrowserView * view)
XedFileBrowserView * view)
{
GtkTreeIter parent;
GtkTreePath * copy;

View File

@@ -0,0 +1,84 @@
/*
* xed-file-browser-view.h - Xed 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 __XED_FILE_BROWSER_VIEW_H__
#define __XED_FILE_BROWSER_VIEW_H__
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define XED_TYPE_FILE_BROWSER_VIEW (xed_file_browser_view_get_type ())
#define XED_FILE_BROWSER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XED_TYPE_FILE_BROWSER_VIEW, XedFileBrowserView))
#define XED_FILE_BROWSER_VIEW_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XED_TYPE_FILE_BROWSER_VIEW, XedFileBrowserView const))
#define XED_FILE_BROWSER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XED_TYPE_FILE_BROWSER_VIEW, XedFileBrowserViewClass))
#define XED_IS_FILE_BROWSER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XED_TYPE_FILE_BROWSER_VIEW))
#define XED_IS_FILE_BROWSER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XED_TYPE_FILE_BROWSER_VIEW))
#define XED_FILE_BROWSER_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XED_TYPE_FILE_BROWSER_VIEW, XedFileBrowserViewClass))
typedef struct _XedFileBrowserView XedFileBrowserView;
typedef struct _XedFileBrowserViewClass XedFileBrowserViewClass;
typedef struct _XedFileBrowserViewPrivate XedFileBrowserViewPrivate;
typedef enum {
XED_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE,
XED_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE
} XedFileBrowserViewClickPolicy;
struct _XedFileBrowserView
{
GtkTreeView parent;
XedFileBrowserViewPrivate *priv;
};
struct _XedFileBrowserViewClass
{
GtkTreeViewClass parent_class;
/* Signals */
void (*error) (XedFileBrowserView * filetree,
guint code,
gchar const *message);
void (*file_activated) (XedFileBrowserView * filetree,
GtkTreeIter *iter);
void (*directory_activated) (XedFileBrowserView * filetree,
GtkTreeIter *iter);
void (*bookmark_activated) (XedFileBrowserView * filetree,
GtkTreeIter *iter);
};
GType xed_file_browser_view_get_type (void) G_GNUC_CONST;
GType xed_file_browser_view_register_type (GTypeModule * module);
GtkWidget *xed_file_browser_view_new (void);
void xed_file_browser_view_set_model (XedFileBrowserView * tree_view,
GtkTreeModel * model);
void xed_file_browser_view_start_rename (XedFileBrowserView * tree_view,
GtkTreeIter * iter);
void xed_file_browser_view_set_click_policy (XedFileBrowserView * tree_view,
XedFileBrowserViewClickPolicy policy);
void xed_file_browser_view_set_restore_expand_state (XedFileBrowserView * tree_view,
gboolean restore_expand_state);
G_END_DECLS
#endif /* __XED_FILE_BROWSER_VIEW_H__ */
// ex:ts=8:noet:

View File

@@ -0,0 +1,129 @@
/*
* xed-file-browser-widget.h - Xed 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 __XED_FILE_BROWSER_WIDGET_H__
#define __XED_FILE_BROWSER_WIDGET_H__
#include <gtk/gtk.h>
#include "xed-file-browser-store.h"
#include "xed-file-bookmarks-store.h"
#include "xed-file-browser-view.h"
G_BEGIN_DECLS
#define XED_TYPE_FILE_BROWSER_WIDGET (xed_file_browser_widget_get_type ())
#define XED_FILE_BROWSER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XED_TYPE_FILE_BROWSER_WIDGET, XedFileBrowserWidget))
#define XED_FILE_BROWSER_WIDGET_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XED_TYPE_FILE_BROWSER_WIDGET, XedFileBrowserWidget const))
#define XED_FILE_BROWSER_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XED_TYPE_FILE_BROWSER_WIDGET, XedFileBrowserWidgetClass))
#define XED_IS_FILE_BROWSER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XED_TYPE_FILE_BROWSER_WIDGET))
#define XED_IS_FILE_BROWSER_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XED_TYPE_FILE_BROWSER_WIDGET))
#define XED_FILE_BROWSER_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XED_TYPE_FILE_BROWSER_WIDGET, XedFileBrowserWidgetClass))
typedef struct _XedFileBrowserWidget XedFileBrowserWidget;
typedef struct _XedFileBrowserWidgetClass XedFileBrowserWidgetClass;
typedef struct _XedFileBrowserWidgetPrivate XedFileBrowserWidgetPrivate;
typedef
gboolean (*XedFileBrowserWidgetFilterFunc) (XedFileBrowserWidget * obj,
XedFileBrowserStore *
model, GtkTreeIter * iter,
gpointer user_data);
struct _XedFileBrowserWidget
{
#if GTK_CHECK_VERSION (3, 0, 0)
GtkBox parent;
#else
GtkVBox parent;
#endif
XedFileBrowserWidgetPrivate *priv;
};
struct _XedFileBrowserWidgetClass
{
#if GTK_CHECK_VERSION (3, 0, 0)
GtkBoxClass parent_class;
#else
GtkVBoxClass parent_class;
#endif
/* Signals */
void (*uri_activated) (XedFileBrowserWidget * widget,
gchar const *uri);
void (*error) (XedFileBrowserWidget * widget,
guint code,
gchar const *message);
gboolean (*confirm_delete) (XedFileBrowserWidget * widget,
XedFileBrowserStore * model,
GList *list);
gboolean (*confirm_no_trash) (XedFileBrowserWidget * widget,
GList *list);
};
GType xed_file_browser_widget_get_type (void) G_GNUC_CONST;
GType xed_file_browser_widget_register_type (GTypeModule * module);
GtkWidget *xed_file_browser_widget_new (const gchar *data_dir);
void xed_file_browser_widget_show_bookmarks (XedFileBrowserWidget * obj);
void xed_file_browser_widget_show_files (XedFileBrowserWidget * obj);
void xed_file_browser_widget_set_root (XedFileBrowserWidget * obj,
gchar const *root,
gboolean virtual_root);
void
xed_file_browser_widget_set_root_and_virtual_root (XedFileBrowserWidget * obj,
gchar const *root,
gchar const *virtual_root);
gboolean
xed_file_browser_widget_get_selected_directory (XedFileBrowserWidget * obj,
GtkTreeIter * iter);
XedFileBrowserStore *
xed_file_browser_widget_get_browser_store (XedFileBrowserWidget * obj);
XedFileBookmarksStore *
xed_file_browser_widget_get_bookmarks_store (XedFileBrowserWidget * obj);
XedFileBrowserView *
xed_file_browser_widget_get_browser_view (XedFileBrowserWidget * obj);
GtkWidget *
xed_file_browser_widget_get_filter_entry (XedFileBrowserWidget * obj);
GtkUIManager *
xed_file_browser_widget_get_ui_manager (XedFileBrowserWidget * obj);
gulong xed_file_browser_widget_add_filter (XedFileBrowserWidget * obj,
XedFileBrowserWidgetFilterFunc func,
gpointer user_data,
GDestroyNotify notify);
void xed_file_browser_widget_remove_filter (XedFileBrowserWidget * obj,
gulong id);
void xed_file_browser_widget_set_filter_pattern (XedFileBrowserWidget * obj,
gchar const *pattern);
void xed_file_browser_widget_refresh (XedFileBrowserWidget * obj);
void xed_file_browser_widget_history_back (XedFileBrowserWidget * obj);
void xed_file_browser_widget_history_forward (XedFileBrowserWidget * obj);
G_END_DECLS
#endif /* __XED_FILE_BROWSER_WIDGET_H__ */
// ex:ts=8:noet:

View File

@@ -1,90 +0,0 @@
/*
* 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,71 +0,0 @@
/*
* 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

@@ -1,200 +0,0 @@
/*
* 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,84 +0,0 @@
/*
* 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

@@ -1,129 +0,0 @@
/*
* 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 = $(XEDIT_PLUGINS_LIBS_DIR)
plugindir = $(XED_PLUGINS_LIBS_DIR)
AM_CPPFLAGS = \
-I$(top_srcdir) \
$(XEDIT_CFLAGS) \
$(XED_CFLAGS) \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS)
modelinesdir = $(XEDIT_PLUGINS_DATA_DIR)/modelines
modelinesdir = $(XED_PLUGINS_DATA_DIR)/modelines
modelines_DATA = \
language-mappings
plugin_LTLIBRARIES = libmodelines.la
libmodelines_la_SOURCES = \
xedit-modeline-plugin.h \
xedit-modeline-plugin.c \
xed-modeline-plugin.h \
xed-modeline-plugin.c \
modeline-parser.h \
modeline-parser.c
libmodelines_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
libmodelines_la_LIBADD = $(XEDIT_LIBS)
libmodelines_la_LIBADD = $(XED_LIBS)
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_in_files = modelines.xed-plugin.desktop.in
%.xed-plugin: %.xed-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:.xedit-plugin.desktop.in=.xedit-plugin)
plugin_DATA = $(plugin_in_files:.xed-plugin.desktop.in=.xed-plugin)
EXTRA_DIST = \
$(plugin_in_files) \

View File

@@ -1,6 +1,6 @@
/*
* modeline-parser.c
* Emacs, Kate and Vim-style modelines support for xedit.
* Emacs, Kate and Vim-style modelines support for xed.
*
* 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 <xedit/xedit-language-manager.h>
#include <xedit/xedit-prefs-manager.h>
#include <xedit/xedit-debug.h>
#include <xed/xed-language-manager.h>
#include <xed/xed-prefs-manager.h>
#include <xed/xed-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 -> Xedit language ID */
/* Mappings: language name -> Xed 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);
xedit_debug_message (DEBUG_PLUGINS,
xed_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))
{
xedit_debug_message (DEBUG_PLUGINS,
xed_debug_message (DEBUG_PLUGINS,
"Loaded language mappings from %s",
fname);
@@ -157,7 +157,7 @@ load_language_mappings (void)
}
else
{
xedit_debug_message (DEBUG_PLUGINS,
xed_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++;
}
xedit_debug_message (DEBUG_PLUGINS,
xed_debug_message (DEBUG_PLUGINS,
"Emacs modeline bit: %s = %s",
key->str, value->str);
@@ -497,7 +497,7 @@ parse_kate_modeline (gchar *s,
s++;
}
xedit_debug_message (DEBUG_PLUGINS,
xed_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))
{
xedit_debug_message (DEBUG_PLUGINS, "Vim modeline on line %d", line_number);
xed_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)
{
xedit_debug_message (DEBUG_PLUGINS, "Emacs modeline on line %d", line_number);
xed_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)
{
xedit_debug_message (DEBUG_PLUGINS, "Kate modeline on line %d", line_number);
xed_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 = xedit_get_language_manager ();
manager = xed_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,
xedit_prefs_manager_get_insert_spaces ());
xed_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,
xedit_prefs_manager_get_tabs_size ());
xed_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),
xedit_prefs_manager_get_wrap_mode ());
xed_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,
xedit_prefs_manager_get_right_margin_position ());
xed_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,
xedit_prefs_manager_get_display_right_margin ());
xed_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 xedit.
* Emacs, Kate and Vim-style modelines support for xed.
*
* Copyright (C) 2005-2007 - Steve Frécinaux <code@istique.net>
*

View File

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

View File

@@ -1,6 +1,6 @@
/*
* xedit-modeline-plugin.c
* Emacs, Kate and Vim-style modelines support for xedit.
* xed-modeline-plugin.c
* Emacs, Kate and Vim-style modelines support for xed.
*
* Copyright (C) 2005-2007 - Steve Frécinaux <code@istique.net>
*
@@ -25,14 +25,14 @@
#include <glib/gi18n-lib.h>
#include <gmodule.h>
#include "xedit-modeline-plugin.h"
#include "xed-modeline-plugin.h"
#include "modeline-parser.h"
#include <xedit/xedit-debug.h>
#include <xedit/xedit-utils.h>
#include <xed/xed-debug.h>
#include <xed/xed-utils.h>
#define WINDOW_DATA_KEY "XeditModelinePluginWindowData"
#define DOCUMENT_DATA_KEY "XeditModelinePluginDocumentData"
#define WINDOW_DATA_KEY "XedModelinePluginWindowData"
#define DOCUMENT_DATA_KEY "XedModelinePluginDocumentData"
typedef struct
{
@@ -46,12 +46,12 @@ typedef struct
gulong document_saved_handler_id;
} DocumentData;
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);
static void xed_modeline_plugin_activate (XedPlugin *plugin, XedWindow *window);
static void xed_modeline_plugin_deactivate (XedPlugin *plugin, XedWindow *window);
static GObject *xed_modeline_plugin_constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_param);
static void xed_modeline_plugin_finalize (GObject *object);
XEDIT_PLUGIN_REGISTER_TYPE(XeditModelinePlugin, xedit_modeline_plugin)
XED_PLUGIN_REGISTER_TYPE(XedModelinePlugin, xed_modeline_plugin)
static void
window_data_free (WindowData *wdata)
@@ -66,31 +66,31 @@ document_data_free (DocumentData *ddata)
}
static void
xedit_modeline_plugin_class_init (XeditModelinePluginClass *klass)
xed_modeline_plugin_class_init (XedModelinePluginClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
XeditPluginClass *plugin_class = XEDIT_PLUGIN_CLASS (klass);
XedPluginClass *plugin_class = XED_PLUGIN_CLASS (klass);
object_class->constructor = xedit_modeline_plugin_constructor;
object_class->finalize = xedit_modeline_plugin_finalize;
object_class->constructor = xed_modeline_plugin_constructor;
object_class->finalize = xed_modeline_plugin_finalize;
plugin_class->activate = xedit_modeline_plugin_activate;
plugin_class->deactivate = xedit_modeline_plugin_deactivate;
plugin_class->activate = xed_modeline_plugin_activate;
plugin_class->deactivate = xed_modeline_plugin_deactivate;
}
static GObject *
xedit_modeline_plugin_constructor (GType type,
xed_modeline_plugin_constructor (GType type,
guint n_construct_properties,
GObjectConstructParam *construct_param)
{
GObject *object;
gchar *data_dir;
object = G_OBJECT_CLASS (xedit_modeline_plugin_parent_class)->constructor (type,
object = G_OBJECT_CLASS (xed_modeline_plugin_parent_class)->constructor (type,
n_construct_properties,
construct_param);
data_dir = xedit_plugin_get_data_dir (XEDIT_PLUGIN (object));
data_dir = xed_plugin_get_data_dir (XED_PLUGIN (object));
modeline_parser_init (data_dir);
@@ -100,23 +100,23 @@ xedit_modeline_plugin_constructor (GType type,
}
static void
xedit_modeline_plugin_init (XeditModelinePlugin *plugin)
xed_modeline_plugin_init (XedModelinePlugin *plugin)
{
xedit_debug_message (DEBUG_PLUGINS, "XeditModelinePlugin initializing");
xed_debug_message (DEBUG_PLUGINS, "XedModelinePlugin initializing");
}
static void
xedit_modeline_plugin_finalize (GObject *object)
xed_modeline_plugin_finalize (GObject *object)
{
xedit_debug_message (DEBUG_PLUGINS, "XeditModelinePlugin finalizing");
xed_debug_message (DEBUG_PLUGINS, "XedModelinePlugin finalizing");
modeline_parser_shutdown ();
G_OBJECT_CLASS (xedit_modeline_plugin_parent_class)->finalize (object);
G_OBJECT_CLASS (xed_modeline_plugin_parent_class)->finalize (object);
}
static void
on_document_loaded_or_saved (XeditDocument *document,
on_document_loaded_or_saved (XedDocument *document,
const GError *error,
GtkSourceView *view)
{
@@ -124,7 +124,7 @@ on_document_loaded_or_saved (XeditDocument *document,
}
static void
connect_handlers (XeditView *view)
connect_handlers (XedView *view)
{
DocumentData *data;
GtkTextBuffer *doc;
@@ -147,7 +147,7 @@ connect_handlers (XeditView *view)
}
static void
disconnect_handlers (XeditView *view)
disconnect_handlers (XedView *view)
{
DocumentData *data;
GtkTextBuffer *doc;
@@ -170,35 +170,35 @@ disconnect_handlers (XeditView *view)
}
static void
on_window_tab_added (XeditWindow *window,
XeditTab *tab,
on_window_tab_added (XedWindow *window,
XedTab *tab,
gpointer user_data)
{
connect_handlers (xedit_tab_get_view (tab));
connect_handlers (xed_tab_get_view (tab));
}
static void
on_window_tab_removed (XeditWindow *window,
XeditTab *tab,
on_window_tab_removed (XedWindow *window,
XedTab *tab,
gpointer user_data)
{
disconnect_handlers (xedit_tab_get_view (tab));
disconnect_handlers (xed_tab_get_view (tab));
}
static void
xedit_modeline_plugin_activate (XeditPlugin *plugin,
XeditWindow *window)
xed_modeline_plugin_activate (XedPlugin *plugin,
XedWindow *window)
{
WindowData *wdata;
GList *views;
GList *l;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
views = xedit_window_get_views (window);
views = xed_window_get_views (window);
for (l = views; l != NULL; l = l->next)
{
connect_handlers (XEDIT_VIEW (l->data));
connect_handlers (XED_VIEW (l->data));
modeline_parser_apply_modeline (GTK_SOURCE_VIEW (l->data));
}
g_list_free (views);
@@ -218,14 +218,14 @@ xedit_modeline_plugin_activate (XeditPlugin *plugin,
}
static void
xedit_modeline_plugin_deactivate (XeditPlugin *plugin,
XeditWindow *window)
xed_modeline_plugin_deactivate (XedPlugin *plugin,
XedWindow *window)
{
WindowData *wdata;
GList *views;
GList *l;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
wdata = g_object_steal_data (G_OBJECT (window), WINDOW_DATA_KEY);
@@ -234,11 +234,11 @@ xedit_modeline_plugin_deactivate (XeditPlugin *plugin,
window_data_free (wdata);
views = xedit_window_get_views (window);
views = xed_window_get_views (window);
for (l = views; l != NULL; l = l->next)
{
disconnect_handlers (XEDIT_VIEW (l->data));
disconnect_handlers (XED_VIEW (l->data));
modeline_parser_deactivate (GTK_SOURCE_VIEW (l->data));
}

View File

@@ -0,0 +1,48 @@
/*
* xed-modeline-plugin.h
* Emacs, Kate and Vim-style modelines support for xed.
*
* 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 __XED_MODELINE_PLUGIN_H__
#define __XED_MODELINE_PLUGIN_H__
#include <glib.h>
#include <glib-object.h>
#include <xed/xed-plugin.h>
G_BEGIN_DECLS
#define XED_TYPE_MODELINE_PLUGIN (xed_modeline_plugin_get_type ())
#define XED_MODELINE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XED_TYPE_MODELINE_PLUGIN, XedModelinePlugin))
#define XED_MODELINE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XED_TYPE_MODELINE_PLUGIN, XedModelinePluginClass))
#define XED_IS_MODELINE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XED_TYPE_MODELINE_PLUGIN))
#define XED_IS_MODELINE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XED_TYPE_MODELINE_PLUGIN))
#define XED_MODELINE_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XED_TYPE_MODELINE_PLUGIN, XedModelinePluginClass))
/* Private structure type */
typedef XedPluginClass XedModelinePluginClass;
typedef XedPlugin XedModelinePlugin;
GType xed_modeline_plugin_get_type (void) G_GNUC_CONST;
G_MODULE_EXPORT GType register_xed_plugin (GTypeModule *module);
G_END_DECLS
#endif /* __XED_MODELINE_PLUGIN_H__ */

View File

@@ -1,48 +0,0 @@
/*
* 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,29 +1,29 @@
# sort plugin
plugindir = $(XEDIT_PLUGINS_LIBS_DIR)
plugindir = $(XED_PLUGINS_LIBS_DIR)
AM_CPPFLAGS = \
-I$(top_srcdir) \
$(XEDIT_CFLAGS) \
$(XED_CFLAGS) \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS)
plugin_LTLIBRARIES = libsort.la
libsort_la_SOURCES = \
xedit-sort-plugin.h \
xedit-sort-plugin.c
xed-sort-plugin.h \
xed-sort-plugin.c
libsort_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
libsort_la_LIBADD = $(XEDIT_LIBS)
libsort_la_LIBADD = $(XED_LIBS)
uidir = $(XEDIT_PLUGINS_DATA_DIR)/sort
uidir = $(XED_PLUGINS_DATA_DIR)/sort
ui_DATA = sort.ui
plugin_in_files = sort.xedit-plugin.desktop.in
plugin_in_files = sort.xed-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
%.xed-plugin: %.xed-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:.xedit-plugin.desktop.in=.xedit-plugin)
plugin_DATA = $(plugin_in_files:.xed-plugin.desktop.in=.xed-plugin)
EXTRA_DIST = $(ui_DATA) $(plugin_in_files)

View File

@@ -1,4 +1,4 @@
[Xedit Plugin]
[Xed Plugin]
Module=sort
IAge=2
_Name=Sort

View File

@@ -1,8 +1,8 @@
/*
* xedit-sort-plugin.c
* xed-sort-plugin.c
*
* Original author: Carlo Borreo <borreo@softhome.net>
* Ported to Xedit2 by Lee Mallabone <mate@fonicmonkey.net>
* Ported to Xed2 by Lee Mallabone <mate@fonicmonkey.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
@@ -25,25 +25,25 @@
#include <config.h>
#endif
#include "xedit-sort-plugin.h"
#include "xed-sort-plugin.h"
#include <string.h>
#include <glib/gi18n-lib.h>
#include <gmodule.h>
#include <xedit/xedit-debug.h>
#include <xedit/xedit-utils.h>
#include <xedit/xedit-help.h>
#include <xed/xed-debug.h>
#include <xed/xed-utils.h>
#include <xed/xed-help.h>
#define XEDIT_SORT_PLUGIN_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), XEDIT_TYPE_SORT_PLUGIN, XeditSortPluginPrivate))
#define XED_SORT_PLUGIN_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), XED_TYPE_SORT_PLUGIN, XedSortPluginPrivate))
/* Key in case the plugin ever needs any settings. */
#define SORT_BASE_KEY "/apps/xedit/plugins/sort"
#define SORT_BASE_KEY "/apps/xed/plugins/sort"
#define WINDOW_DATA_KEY "XeditSortPluginWindowData"
#define WINDOW_DATA_KEY "XedSortPluginWindowData"
#define MENU_PATH "/MenuBar/EditMenu/EditOps_6"
XEDIT_PLUGIN_REGISTER_TYPE(XeditSortPlugin, xedit_sort_plugin)
XED_PLUGIN_REGISTER_TYPE(XedSortPlugin, xed_sort_plugin)
typedef struct
{
@@ -53,7 +53,7 @@ typedef struct
GtkWidget *ignore_case_checkbutton;
GtkWidget *remove_dups_checkbutton;
XeditDocument *doc;
XedDocument *doc;
GtkTextIter start, end; /* selection */
} SortDialog;
@@ -66,8 +66,8 @@ typedef struct
typedef struct
{
XeditPlugin *plugin;
XeditWindow *window;
XedPlugin *plugin;
XedWindow *window;
} ActionData;
typedef struct
@@ -95,7 +95,7 @@ static void
sort_dialog_dispose (GObject *obj,
gpointer dialog_pointer)
{
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
g_slice_free (SortDialog, dialog_pointer);
}
@@ -105,7 +105,7 @@ sort_dialog_response_handler (GtkDialog *widget,
gint res_id,
SortDialog *dialog)
{
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
switch (res_id)
{
@@ -115,9 +115,9 @@ sort_dialog_response_handler (GtkDialog *widget,
break;
case GTK_RESPONSE_HELP:
xedit_help_display (GTK_WINDOW (widget),
xed_help_display (GTK_WINDOW (widget),
NULL,
"xedit-sort-plugin");
"xed-sort-plugin");
break;
case GTK_RESPONSE_CANCEL:
@@ -130,13 +130,13 @@ sort_dialog_response_handler (GtkDialog *widget,
* the text field (like the combo box) looses the documnent selection.
* Storing the selection ONLY works because the dialog is modal */
static void
get_current_selection (XeditWindow *window, SortDialog *dialog)
get_current_selection (XedWindow *window, SortDialog *dialog)
{
XeditDocument *doc;
XedDocument *doc;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
doc = xedit_window_get_active_document (window);
doc = xed_window_get_active_document (window);
if (!gtk_text_buffer_get_selection_bounds (GTK_TEXT_BUFFER (doc),
&dialog->start,
@@ -158,14 +158,14 @@ get_sort_dialog (ActionData *action_data)
gchar *data_dir;
gchar *ui_file;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
dialog = g_slice_new (SortDialog);
data_dir = xedit_plugin_get_data_dir (action_data->plugin);
data_dir = xed_plugin_get_data_dir (action_data->plugin);
ui_file = g_build_filename (data_dir, "sort.ui", NULL);
g_free (data_dir);
ret = xedit_utils_get_ui_objects (ui_file,
ret = xed_utils_get_ui_objects (ui_file,
NULL,
&error_widget,
"sort_dialog", &dialog->dialog,
@@ -181,7 +181,7 @@ get_sort_dialog (ActionData *action_data)
const gchar *err_message;
err_message = gtk_label_get_label (GTK_LABEL (error_widget));
xedit_warning (GTK_WINDOW (action_data->window),
xed_warning (GTK_WINDOW (action_data->window),
"%s", err_message);
g_slice_free (SortDialog, dialog);
@@ -212,19 +212,19 @@ static void
sort_cb (GtkAction *action,
ActionData *action_data)
{
XeditDocument *doc;
XedDocument *doc;
GtkWindowGroup *wg;
SortDialog *dialog;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
doc = xedit_window_get_active_document (action_data->window);
doc = xed_window_get_active_document (action_data->window);
g_return_if_fail (doc != NULL);
dialog = get_sort_dialog (action_data);
g_return_if_fail (dialog != NULL);
wg = xedit_window_get_group (action_data->window);
wg = xed_window_get_group (action_data->window);
gtk_window_group_add_window (wg,
GTK_WINDOW (dialog->dialog));
@@ -253,7 +253,7 @@ compare_algorithm (gconstpointer s1,
gchar *key1, *key2;
SortInfo *sort_info;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
sort_info = (SortInfo *) data;
g_return_val_if_fail (sort_info != NULL, -1);
@@ -350,7 +350,7 @@ get_line_slice (GtkTextBuffer *buf,
static void
sort_real (SortDialog *dialog)
{
XeditDocument *doc;
XedDocument *doc;
GtkTextIter start, end;
gint start_line, end_line;
gint i;
@@ -359,7 +359,7 @@ sort_real (SortDialog *dialog)
gchar **lines;
SortInfo *sort_info;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
doc = dialog->doc;
g_return_if_fail (doc != NULL);
@@ -386,7 +386,7 @@ sort_real (SortDialog *dialog)
num_lines = end_line - start_line + 1;
lines = g_new0 (gchar *, num_lines + 1);
xedit_debug_message (DEBUG_PLUGINS, "Building list...");
xed_debug_message (DEBUG_PLUGINS, "Building list...");
for (i = 0; i < num_lines; i++)
{
@@ -395,7 +395,7 @@ sort_real (SortDialog *dialog)
lines[num_lines] = NULL;
xedit_debug_message (DEBUG_PLUGINS, "Sort list...");
xed_debug_message (DEBUG_PLUGINS, "Sort list...");
g_qsort_with_data (lines,
num_lines,
@@ -403,7 +403,7 @@ sort_real (SortDialog *dialog)
compare_algorithm,
sort_info);
xedit_debug_message (DEBUG_PLUGINS, "Rebuilding document...");
xed_debug_message (DEBUG_PLUGINS, "Rebuilding document...");
gtk_source_buffer_begin_not_undoable_action (GTK_SOURCE_BUFFER (doc));
@@ -435,7 +435,7 @@ sort_real (SortDialog *dialog)
g_strfreev (lines);
g_free (sort_info);
xedit_debug_message (DEBUG_PLUGINS, "Done.");
xed_debug_message (DEBUG_PLUGINS, "Done.");
}
static void
@@ -456,14 +456,14 @@ free_action_data (ActionData *data)
}
static void
update_ui_real (XeditWindow *window,
update_ui_real (XedWindow *window,
WindowData *data)
{
XeditView *view;
XedView *view;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
view = xedit_window_get_active_view (window);
view = xed_window_get_active_view (window);
gtk_action_group_set_sensitive (data->ui_action_group,
(view != NULL) &&
@@ -471,23 +471,23 @@ update_ui_real (XeditWindow *window,
}
static void
impl_activate (XeditPlugin *plugin,
XeditWindow *window)
impl_activate (XedPlugin *plugin,
XedWindow *window)
{
GtkUIManager *manager;
WindowData *data;
ActionData *action_data;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
data = g_slice_new (WindowData);
action_data = g_slice_new (ActionData);
action_data->window = window;
action_data->plugin = plugin;
manager = xedit_window_get_ui_manager (window);
manager = xed_window_get_ui_manager (window);
data->ui_action_group = gtk_action_group_new ("XeditSortPluginActions");
data->ui_action_group = gtk_action_group_new ("XedSortPluginActions");
gtk_action_group_set_translation_domain (data->ui_action_group,
GETTEXT_PACKAGE);
gtk_action_group_add_actions_full (data->ui_action_group,
@@ -520,15 +520,15 @@ impl_activate (XeditPlugin *plugin,
}
static void
impl_deactivate (XeditPlugin *plugin,
XeditWindow *window)
impl_deactivate (XedPlugin *plugin,
XedWindow *window)
{
GtkUIManager *manager;
WindowData *data;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
manager = xedit_window_get_ui_manager (window);
manager = xed_window_get_ui_manager (window);
data = (WindowData *) g_object_get_data (G_OBJECT (window),
WINDOW_DATA_KEY);
@@ -545,12 +545,12 @@ impl_deactivate (XeditPlugin *plugin,
}
static void
impl_update_ui (XeditPlugin *plugin,
XeditWindow *window)
impl_update_ui (XedPlugin *plugin,
XedWindow *window)
{
WindowData *data;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
data = (WindowData *) g_object_get_data (G_OBJECT (window),
WINDOW_DATA_KEY);
@@ -561,26 +561,26 @@ impl_update_ui (XeditPlugin *plugin,
}
static void
xedit_sort_plugin_init (XeditSortPlugin *plugin)
xed_sort_plugin_init (XedSortPlugin *plugin)
{
xedit_debug_message (DEBUG_PLUGINS, "XeditSortPlugin initializing");
xed_debug_message (DEBUG_PLUGINS, "XedSortPlugin initializing");
}
static void
xedit_sort_plugin_finalize (GObject *object)
xed_sort_plugin_finalize (GObject *object)
{
xedit_debug_message (DEBUG_PLUGINS, "XeditSortPlugin finalizing");
xed_debug_message (DEBUG_PLUGINS, "XedSortPlugin finalizing");
G_OBJECT_CLASS (xedit_sort_plugin_parent_class)->finalize (object);
G_OBJECT_CLASS (xed_sort_plugin_parent_class)->finalize (object);
}
static void
xedit_sort_plugin_class_init (XeditSortPluginClass *klass)
xed_sort_plugin_class_init (XedSortPluginClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
XeditPluginClass *plugin_class = XEDIT_PLUGIN_CLASS (klass);
XedPluginClass *plugin_class = XED_PLUGIN_CLASS (klass);
object_class->finalize = xedit_sort_plugin_finalize;
object_class->finalize = xed_sort_plugin_finalize;
plugin_class->activate = impl_activate;
plugin_class->deactivate = impl_deactivate;

View File

@@ -0,0 +1,73 @@
/*
* xed-sort-plugin.h
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $Id$
*/
#ifndef __XED_SORT_PLUGIN_H__
#define __XED_SORT_PLUGIN_H__
#include <glib.h>
#include <glib-object.h>
#include <xed/xed-plugin.h>
G_BEGIN_DECLS
/*
* Type checking and casting macros
*/
#define XED_TYPE_SORT_PLUGIN (xed_sort_plugin_get_type ())
#define XED_SORT_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XED_TYPE_SORT_PLUGIN, XedSortPlugin))
#define XED_SORT_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XED_TYPE_SORT_PLUGIN, XedSortPluginClass))
#define XED_IS_SORT_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XED_TYPE_SORT_PLUGIN))
#define XED_IS_SORT_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XED_TYPE_SORT_PLUGIN))
#define XED_SORT_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XED_TYPE_SORT_PLUGIN, XedSortPluginClass))
/* Private structure type */
typedef struct _XedSortPluginPrivate XedSortPluginPrivate;
/*
* Main object structure
*/
typedef struct _XedSortPlugin XedSortPlugin;
struct _XedSortPlugin
{
XedPlugin parent_instance;
};
/*
* Class definition
*/
typedef struct _XedSortPluginClass XedSortPluginClass;
struct _XedSortPluginClass
{
XedPluginClass parent_class;
};
/*
* Public methods
*/
GType xed_sort_plugin_get_type (void) G_GNUC_CONST;
/* All the plugins must implement this function */
G_MODULE_EXPORT GType register_xed_plugin (GTypeModule *module);
G_END_DECLS
#endif /* __XED_SORT_PLUGIN_H__ */

View File

@@ -1,73 +0,0 @@
/*
* xedit-sort-plugin.h
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $Id$
*/
#ifndef __XEDIT_SORT_PLUGIN_H__
#define __XEDIT_SORT_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_SORT_PLUGIN (xedit_sort_plugin_get_type ())
#define XEDIT_SORT_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XEDIT_TYPE_SORT_PLUGIN, XeditSortPlugin))
#define XEDIT_SORT_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XEDIT_TYPE_SORT_PLUGIN, XeditSortPluginClass))
#define XEDIT_IS_SORT_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XEDIT_TYPE_SORT_PLUGIN))
#define XEDIT_IS_SORT_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XEDIT_TYPE_SORT_PLUGIN))
#define XEDIT_SORT_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XEDIT_TYPE_SORT_PLUGIN, XeditSortPluginClass))
/* Private structure type */
typedef struct _XeditSortPluginPrivate XeditSortPluginPrivate;
/*
* Main object structure
*/
typedef struct _XeditSortPlugin XeditSortPlugin;
struct _XeditSortPlugin
{
XeditPlugin parent_instance;
};
/*
* Class definition
*/
typedef struct _XeditSortPluginClass XeditSortPluginClass;
struct _XeditSortPluginClass
{
XeditPluginClass parent_class;
};
/*
* Public methods
*/
GType xedit_sort_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_SORT_PLUGIN_H__ */

View File

@@ -1,54 +1,54 @@
# Spell checker plugin
plugindir = $(XEDIT_PLUGINS_LIBS_DIR)
plugindir = $(XED_PLUGINS_LIBS_DIR)
AM_CPPFLAGS = \
-I$(top_srcdir) \
$(XEDIT_CFLAGS) \
$(XED_CFLAGS) \
$(ENCHANT_CFLAGS) \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS)
BUILT_SOURCES = \
xedit-spell-marshal.c \
xedit-spell-marshal.h
xed-spell-marshal.c \
xed-spell-marshal.h
plugin_LTLIBRARIES = libspell.la
libspell_la_SOURCES = \
xedit-spell-plugin.c \
xedit-spell-plugin.h \
xedit-spell-checker.c \
xedit-spell-checker.h \
xedit-spell-checker-dialog.c \
xedit-spell-checker-dialog.h \
xedit-spell-checker-language.c \
xedit-spell-checker-language.h \
xedit-spell-language-dialog.c \
xedit-spell-language-dialog.h \
xedit-automatic-spell-checker.c \
xedit-automatic-spell-checker.h \
xedit-spell-utils.c \
xedit-spell-utils.h \
xed-spell-plugin.c \
xed-spell-plugin.h \
xed-spell-checker.c \
xed-spell-checker.h \
xed-spell-checker-dialog.c \
xed-spell-checker-dialog.h \
xed-spell-checker-language.c \
xed-spell-checker-language.h \
xed-spell-language-dialog.c \
xed-spell-language-dialog.h \
xed-automatic-spell-checker.c \
xed-automatic-spell-checker.h \
xed-spell-utils.c \
xed-spell-utils.h \
$(BUILT_SOURCES)
libspell_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
libspell_la_LIBADD = $(XEDIT_LIBS) $(ENCHANT_LIBS)
libspell_la_LIBADD = $(XED_LIBS) $(ENCHANT_LIBS)
uidir = $(XEDIT_PLUGINS_DATA_DIR)/spell
ui_DATA = spell-checker.ui languages-dialog.ui xedit-spell-setup-dialog.ui
uidir = $(XED_PLUGINS_DATA_DIR)/spell
ui_DATA = spell-checker.ui languages-dialog.ui xed-spell-setup-dialog.ui
xedit-spell-marshal.h: xedit-spell-marshal.list $(GLIB_GENMARSHAL)
$(AM_V_GEN) $(GLIB_GENMARSHAL) $< --header --prefix=xedit_marshal > $@
xed-spell-marshal.h: xed-spell-marshal.list $(GLIB_GENMARSHAL)
$(AM_V_GEN) $(GLIB_GENMARSHAL) $< --header --prefix=xed_marshal > $@
xedit-spell-marshal.c: xedit-spell-marshal.list $(GLIB_GENMARSHAL)
$(AM_V_GEN) echo "#include \"xedit-spell-marshal.h\"" > $@ && \
$(GLIB_GENMARSHAL) $< --body --prefix=xedit_marshal >> $@
xed-spell-marshal.c: xed-spell-marshal.list $(GLIB_GENMARSHAL)
$(AM_V_GEN) echo "#include \"xed-spell-marshal.h\"" > $@ && \
$(GLIB_GENMARSHAL) $< --body --prefix=xed_marshal >> $@
plugin_in_files = spell.xedit-plugin.desktop.in
plugin_in_files = spell.xed-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
%.xed-plugin: %.xed-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:.xedit-plugin.desktop.in=.xedit-plugin)
plugin_DATA = $(plugin_in_files:.xed-plugin.desktop.in=.xed-plugin)
@INTLTOOL_XML_NOMERGE_RULE@
spell_gschema_in = org.x.editor.plugins.spell.gschema.xml.in
@@ -59,7 +59,7 @@ gsettings_SCHEMAS = $(spell_gschema_in:.xml.in=.xml)
EXTRA_DIST = \
$(ui_DATA) \
$(plugin_in_files) \
xedit-spell-marshal.list \
xed-spell-marshal.list \
$(spell_gschema_in)
CLEANFILES = $(BUILT_SOURCES) $(plugin_DATA) $(gsettings_SCHEMAS)

View File

@@ -1,4 +1,4 @@
[Xedit Plugin]
[Xed Plugin]
Module=spell
IAge=2
_Name=Spell Checker

View File

@@ -1,7 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* xedit-automatic-spell-checker.c
* This file is part of xedit
* xed-automatic-spell-checker.c
* This file is part of xed
*
* Copyright (C) 2002 Paolo Maggi
*
@@ -22,8 +22,8 @@
*/
/*
* Modified by the xedit Team, 2002. See the AUTHORS file for a
* list of people on the xedit Team.
* Modified by the xed Team, 2002. See the AUTHORS file for a
* list of people on the xed Team.
* See the ChangeLog files for a list of changes.
*/
@@ -40,11 +40,11 @@
#include <glib/gi18n.h>
#include "xedit-automatic-spell-checker.h"
#include "xedit-spell-utils.h"
#include "xed-automatic-spell-checker.h"
#include "xed-spell-utils.h"
struct _XeditAutomaticSpellChecker {
XeditDocument *doc;
struct _XedAutomaticSpellChecker {
XedDocument *doc;
GSList *views;
GtkTextMark *mark_insert_start;
@@ -54,22 +54,22 @@ struct _XeditAutomaticSpellChecker {
GtkTextTag *tag_highlight;
GtkTextMark *mark_click;
XeditSpellChecker *spell_checker;
XedSpellChecker *spell_checker;
};
static GQuark automatic_spell_checker_id = 0;
static GQuark suggestion_id = 0;
static void xedit_automatic_spell_checker_free_internal (XeditAutomaticSpellChecker *spell);
static void xed_automatic_spell_checker_free_internal (XedAutomaticSpellChecker *spell);
static void
view_destroy (XeditView *view, XeditAutomaticSpellChecker *spell)
view_destroy (XedView *view, XedAutomaticSpellChecker *spell)
{
xedit_automatic_spell_checker_detach_view (spell, view);
xed_automatic_spell_checker_detach_view (spell, view);
}
static void
check_word (XeditAutomaticSpellChecker *spell, GtkTextIter *start, GtkTextIter *end)
check_word (XedAutomaticSpellChecker *spell, GtkTextIter *start, GtkTextIter *end)
{
gchar *word;
@@ -80,7 +80,7 @@ check_word (XeditAutomaticSpellChecker *spell, GtkTextIter *start, GtkTextIter *
gtk_text_iter_get_offset (end));
*/
if (!xedit_spell_checker_check_word (spell->spell_checker, word, -1))
if (!xed_spell_checker_check_word (spell->spell_checker, word, -1))
{
/*
g_print ("Apply tag: [%d - %d]\n", gtk_text_iter_get_offset (start),
@@ -96,7 +96,7 @@ check_word (XeditAutomaticSpellChecker *spell, GtkTextIter *start, GtkTextIter *
}
static void
check_range (XeditAutomaticSpellChecker *spell,
check_range (XedAutomaticSpellChecker *spell,
GtkTextIter start,
GtkTextIter end,
gboolean force_all)
@@ -164,7 +164,7 @@ check_range (XeditAutomaticSpellChecker *spell,
wstart = start;
while (xedit_spell_utils_skip_no_spell_check (&wstart, &end) &&
while (xed_spell_utils_skip_no_spell_check (&wstart, &end) &&
gtk_text_iter_compare (&wstart, &end) < 0)
{
gboolean inword;
@@ -208,7 +208,7 @@ check_range (XeditAutomaticSpellChecker *spell,
}
static void
check_deferred_range (XeditAutomaticSpellChecker *spell,
check_deferred_range (XedAutomaticSpellChecker *spell,
gboolean force_all)
{
GtkTextIter start, end;
@@ -232,14 +232,14 @@ check_deferred_range (XeditAutomaticSpellChecker *spell,
static void
insert_text_before (GtkTextBuffer *buffer, GtkTextIter *iter,
gchar *text, gint len, XeditAutomaticSpellChecker *spell)
gchar *text, gint len, XedAutomaticSpellChecker *spell)
{
gtk_text_buffer_move_mark (buffer, spell->mark_insert_start, iter);
}
static void
insert_text_after (GtkTextBuffer *buffer, GtkTextIter *iter,
gchar *text, gint len, XeditAutomaticSpellChecker *spell)
gchar *text, gint len, XedAutomaticSpellChecker *spell)
{
GtkTextIter start;
@@ -260,7 +260,7 @@ insert_text_after (GtkTextBuffer *buffer, GtkTextIter *iter,
static void
delete_range_after (GtkTextBuffer *buffer, GtkTextIter *start, GtkTextIter *end,
XeditAutomaticSpellChecker *spell)
XedAutomaticSpellChecker *spell)
{
check_range (spell, *start, *end, FALSE);
}
@@ -269,7 +269,7 @@ static void
mark_set (GtkTextBuffer *buffer,
GtkTextIter *iter,
GtkTextMark *mark,
XeditAutomaticSpellChecker *spell)
XedAutomaticSpellChecker *spell)
{
/* if the cursor has moved and there is a deferred check so handle it now */
if ((mark == gtk_text_buffer_get_insert (buffer)) && spell->deferred_check)
@@ -294,7 +294,7 @@ get_word_extents_from_mark (GtkTextBuffer *buffer,
}
static void
remove_tag_to_word (XeditAutomaticSpellChecker *spell, const gchar *word)
remove_tag_to_word (XedAutomaticSpellChecker *spell, const gchar *word)
{
GtkTextIter iter;
GtkTextIter match_start, match_end;
@@ -331,7 +331,7 @@ remove_tag_to_word (XeditAutomaticSpellChecker *spell, const gchar *word)
}
static void
add_to_dictionary (GtkWidget *menuitem, XeditAutomaticSpellChecker *spell)
add_to_dictionary (GtkWidget *menuitem, XedAutomaticSpellChecker *spell)
{
gchar *word;
@@ -344,13 +344,13 @@ add_to_dictionary (GtkWidget *menuitem, XeditAutomaticSpellChecker *spell)
&end,
FALSE);
xedit_spell_checker_add_word_to_personal (spell->spell_checker, word, -1);
xed_spell_checker_add_word_to_personal (spell->spell_checker, word, -1);
g_free (word);
}
static void
ignore_all (GtkWidget *menuitem, XeditAutomaticSpellChecker *spell)
ignore_all (GtkWidget *menuitem, XedAutomaticSpellChecker *spell)
{
gchar *word;
@@ -363,13 +363,13 @@ ignore_all (GtkWidget *menuitem, XeditAutomaticSpellChecker *spell)
&end,
FALSE);
xedit_spell_checker_add_word_to_session (spell->spell_checker, word, -1);
xed_spell_checker_add_word_to_session (spell->spell_checker, word, -1);
g_free (word);
}
static void
replace_word (GtkWidget *menuitem, XeditAutomaticSpellChecker *spell)
replace_word (GtkWidget *menuitem, XedAutomaticSpellChecker *spell)
{
gchar *oldword;
const gchar *newword;
@@ -390,7 +390,7 @@ replace_word (GtkWidget *menuitem, XeditAutomaticSpellChecker *spell)
gtk_text_buffer_end_user_action (GTK_TEXT_BUFFER (spell->doc));
xedit_spell_checker_set_correction (spell->spell_checker,
xed_spell_checker_set_correction (spell->spell_checker,
oldword, strlen (oldword),
newword, strlen (newword));
@@ -398,7 +398,7 @@ replace_word (GtkWidget *menuitem, XeditAutomaticSpellChecker *spell)
}
static GtkWidget *
build_suggestion_menu (XeditAutomaticSpellChecker *spell, const gchar *word)
build_suggestion_menu (XedAutomaticSpellChecker *spell, const gchar *word)
{
GtkWidget *topmenu, *menu;
GtkWidget *mi;
@@ -408,7 +408,7 @@ build_suggestion_menu (XeditAutomaticSpellChecker *spell, const gchar *word)
topmenu = menu = gtk_menu_new();
suggestions = xedit_spell_checker_get_suggestions (spell->spell_checker, word, -1);
suggestions = xed_spell_checker_get_suggestions (spell->spell_checker, word, -1);
list = suggestions;
@@ -533,7 +533,7 @@ build_suggestion_menu (XeditAutomaticSpellChecker *spell, const gchar *word)
}
static void
populate_popup (GtkTextView *textview, GtkMenu *menu, XeditAutomaticSpellChecker *spell)
populate_popup (GtkTextView *textview, GtkMenu *menu, XedAutomaticSpellChecker *spell)
{
GtkWidget *img, *mi;
GtkTextIter start, end;
@@ -567,7 +567,7 @@ populate_popup (GtkTextView *textview, GtkMenu *menu, XeditAutomaticSpellChecker
}
void
xedit_automatic_spell_checker_recheck_all (XeditAutomaticSpellChecker *spell)
xed_automatic_spell_checker_recheck_all (XedAutomaticSpellChecker *spell)
{
GtkTextIter start, end;
@@ -579,10 +579,10 @@ xedit_automatic_spell_checker_recheck_all (XeditAutomaticSpellChecker *spell)
}
static void
add_word_signal_cb (XeditSpellChecker *checker,
add_word_signal_cb (XedSpellChecker *checker,
const gchar *word,
gint len,
XeditAutomaticSpellChecker *spell)
XedAutomaticSpellChecker *spell)
{
gchar *w;
@@ -597,18 +597,18 @@ add_word_signal_cb (XeditSpellChecker *checker,
}
static void
set_language_cb (XeditSpellChecker *checker,
const XeditSpellCheckerLanguage *lang,
XeditAutomaticSpellChecker *spell)
set_language_cb (XedSpellChecker *checker,
const XedSpellCheckerLanguage *lang,
XedAutomaticSpellChecker *spell)
{
xedit_automatic_spell_checker_recheck_all (spell);
xed_automatic_spell_checker_recheck_all (spell);
}
static void
clear_session_cb (XeditSpellChecker *checker,
XeditAutomaticSpellChecker *spell)
clear_session_cb (XedSpellChecker *checker,
XedAutomaticSpellChecker *spell)
{
xedit_automatic_spell_checker_recheck_all (spell);
xed_automatic_spell_checker_recheck_all (spell);
}
/* When the user right-clicks on a word, they want to check that word.
@@ -618,7 +618,7 @@ clear_session_cb (XeditSpellChecker *checker,
static gboolean
button_press_event (GtkTextView *view,
GdkEventButton *event,
XeditAutomaticSpellChecker *spell)
XedAutomaticSpellChecker *spell)
{
if (event->button == 3)
{
@@ -649,7 +649,7 @@ button_press_event (GtkTextView *view,
* will contain the wrong set of suggestions.
*/
static gboolean
popup_menu_event (GtkTextView *view, XeditAutomaticSpellChecker *spell)
popup_menu_event (GtkTextView *view, XedAutomaticSpellChecker *spell)
{
GtkTextIter iter;
GtkTextBuffer *buffer;
@@ -669,7 +669,7 @@ popup_menu_event (GtkTextView *view, XeditAutomaticSpellChecker *spell)
static void
tag_table_changed (GtkTextTagTable *table,
XeditAutomaticSpellChecker *spell)
XedAutomaticSpellChecker *spell)
{
g_return_if_fail (spell->tag_highlight != NULL);
@@ -680,7 +680,7 @@ tag_table_changed (GtkTextTagTable *table,
static void
tag_added_or_removed (GtkTextTagTable *table,
GtkTextTag *tag,
XeditAutomaticSpellChecker *spell)
XedAutomaticSpellChecker *spell)
{
tag_table_changed (table, spell);
}
@@ -689,7 +689,7 @@ static void
tag_changed (GtkTextTagTable *table,
GtkTextTag *tag,
gboolean size_changed,
XeditAutomaticSpellChecker *spell)
XedAutomaticSpellChecker *spell)
{
tag_table_changed (table, spell);
}
@@ -698,33 +698,33 @@ static void
highlight_updated (GtkSourceBuffer *buffer,
GtkTextIter *start,
GtkTextIter *end,
XeditAutomaticSpellChecker *spell)
XedAutomaticSpellChecker *spell)
{
check_range (spell, *start, *end, FALSE);
}
static void
spell_tag_destroyed (XeditAutomaticSpellChecker *spell,
spell_tag_destroyed (XedAutomaticSpellChecker *spell,
GObject *where_the_object_was)
{
spell->tag_highlight = NULL;
}
XeditAutomaticSpellChecker *
xedit_automatic_spell_checker_new (XeditDocument *doc,
XeditSpellChecker *checker)
XedAutomaticSpellChecker *
xed_automatic_spell_checker_new (XedDocument *doc,
XedSpellChecker *checker)
{
XeditAutomaticSpellChecker *spell;
XedAutomaticSpellChecker *spell;
GtkTextTagTable *tag_table;
GtkTextIter start, end;
g_return_val_if_fail (XEDIT_IS_DOCUMENT (doc), NULL);
g_return_val_if_fail (XEDIT_IS_SPELL_CHECKER (checker), NULL);
g_return_val_if_fail ((spell = xedit_automatic_spell_checker_get_from_document (doc)) == NULL,
g_return_val_if_fail (XED_IS_DOCUMENT (doc), NULL);
g_return_val_if_fail (XED_IS_SPELL_CHECKER (checker), NULL);
g_return_val_if_fail ((spell = xed_automatic_spell_checker_get_from_document (doc)) == NULL,
spell);
/* attach to the widget */
spell = g_new0 (XeditAutomaticSpellChecker, 1);
spell = g_new0 (XedAutomaticSpellChecker, 1);
spell->doc = doc;
spell->spell_checker = g_object_ref (checker);
@@ -732,17 +732,17 @@ xedit_automatic_spell_checker_new (XeditDocument *doc,
if (automatic_spell_checker_id == 0)
{
automatic_spell_checker_id =
g_quark_from_string ("XeditAutomaticSpellCheckerID");
g_quark_from_string ("XedAutomaticSpellCheckerID");
}
if (suggestion_id == 0)
{
suggestion_id = g_quark_from_string ("XeditAutoSuggestionID");
suggestion_id = g_quark_from_string ("XedAutoSuggestionID");
}
g_object_set_qdata_full (G_OBJECT (doc),
automatic_spell_checker_id,
spell,
(GDestroyNotify)xedit_automatic_spell_checker_free_internal);
(GDestroyNotify)xed_automatic_spell_checker_free_internal);
g_signal_connect (doc,
"insert-text",
@@ -816,13 +816,13 @@ xedit_automatic_spell_checker_new (XeditDocument *doc,
gtk_text_buffer_get_bounds (GTK_TEXT_BUFFER (doc), &start, &end);
spell->mark_insert_start = gtk_text_buffer_get_mark (GTK_TEXT_BUFFER (doc),
"xedit-automatic-spell-checker-insert-start");
"xed-automatic-spell-checker-insert-start");
if (spell->mark_insert_start == NULL)
{
spell->mark_insert_start =
gtk_text_buffer_create_mark (GTK_TEXT_BUFFER (doc),
"xedit-automatic-spell-checker-insert-start",
"xed-automatic-spell-checker-insert-start",
&start,
TRUE);
}
@@ -834,13 +834,13 @@ xedit_automatic_spell_checker_new (XeditDocument *doc,
}
spell->mark_insert_end = gtk_text_buffer_get_mark (GTK_TEXT_BUFFER (doc),
"xedit-automatic-spell-checker-insert-end");
"xed-automatic-spell-checker-insert-end");
if (spell->mark_insert_end == NULL)
{
spell->mark_insert_end =
gtk_text_buffer_create_mark (GTK_TEXT_BUFFER (doc),
"xedit-automatic-spell-checker-insert-end",
"xed-automatic-spell-checker-insert-end",
&start,
TRUE);
}
@@ -852,13 +852,13 @@ xedit_automatic_spell_checker_new (XeditDocument *doc,
}
spell->mark_click = gtk_text_buffer_get_mark (GTK_TEXT_BUFFER (doc),
"xedit-automatic-spell-checker-click");
"xed-automatic-spell-checker-click");
if (spell->mark_click == NULL)
{
spell->mark_click =
gtk_text_buffer_create_mark (GTK_TEXT_BUFFER (doc),
"xedit-automatic-spell-checker-click",
"xed-automatic-spell-checker-click",
&start,
TRUE);
}
@@ -874,10 +874,10 @@ xedit_automatic_spell_checker_new (XeditDocument *doc,
return spell;
}
XeditAutomaticSpellChecker *
xedit_automatic_spell_checker_get_from_document (const XeditDocument *doc)
XedAutomaticSpellChecker *
xed_automatic_spell_checker_get_from_document (const XedDocument *doc)
{
g_return_val_if_fail (XEDIT_IS_DOCUMENT (doc), NULL);
g_return_val_if_fail (XED_IS_DOCUMENT (doc), NULL);
if (automatic_spell_checker_id == 0)
return NULL;
@@ -886,10 +886,10 @@ xedit_automatic_spell_checker_get_from_document (const XeditDocument *doc)
}
void
xedit_automatic_spell_checker_free (XeditAutomaticSpellChecker *spell)
xed_automatic_spell_checker_free (XedAutomaticSpellChecker *spell)
{
g_return_if_fail (spell != NULL);
g_return_if_fail (xedit_automatic_spell_checker_get_from_document (spell->doc) == spell);
g_return_if_fail (xed_automatic_spell_checker_get_from_document (spell->doc) == spell);
if (automatic_spell_checker_id == 0)
return;
@@ -898,7 +898,7 @@ xedit_automatic_spell_checker_free (XeditAutomaticSpellChecker *spell)
}
static void
xedit_automatic_spell_checker_free_internal (XeditAutomaticSpellChecker *spell)
xed_automatic_spell_checker_free_internal (XedAutomaticSpellChecker *spell)
{
GtkTextTagTable *table;
GtkTextIter start, end;
@@ -941,7 +941,7 @@ xedit_automatic_spell_checker_free_internal (XeditAutomaticSpellChecker *spell)
list = spell->views;
while (list != NULL)
{
XeditView *view = XEDIT_VIEW (list->data);
XedView *view = XED_VIEW (list->data);
g_signal_handlers_disconnect_matched (G_OBJECT (view),
G_SIGNAL_MATCH_DATA,
@@ -962,12 +962,12 @@ xedit_automatic_spell_checker_free_internal (XeditAutomaticSpellChecker *spell)
}
void
xedit_automatic_spell_checker_attach_view (
XeditAutomaticSpellChecker *spell,
XeditView *view)
xed_automatic_spell_checker_attach_view (
XedAutomaticSpellChecker *spell,
XedView *view)
{
g_return_if_fail (spell != NULL);
g_return_if_fail (XEDIT_IS_VIEW (view));
g_return_if_fail (XED_IS_VIEW (view));
g_return_if_fail (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)) ==
GTK_TEXT_BUFFER (spell->doc));
@@ -993,12 +993,12 @@ xedit_automatic_spell_checker_attach_view (
}
void
xedit_automatic_spell_checker_detach_view (
XeditAutomaticSpellChecker *spell,
XeditView *view)
xed_automatic_spell_checker_detach_view (
XedAutomaticSpellChecker *spell,
XedView *view)
{
g_return_if_fail (spell != NULL);
g_return_if_fail (XEDIT_IS_VIEW (view));
g_return_if_fail (XED_IS_VIEW (view));
g_return_if_fail (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)) ==
GTK_TEXT_BUFFER (spell->doc));

View File

@@ -0,0 +1,67 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* xed-automatic-spell-checker.h
* This file is part of xed
*
* Copyright (C) 2002 Paolo Maggi
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
/*
* Modified by the xed Team, 2002. See the AUTHORS file for a
* list of people on the xed Team.
* See the ChangeLog files for a list of changes.
*/
/* This is a modified version of gtkspell 2.0.2 (gtkspell.sf.net) */
/* gtkspell - a spell-checking addon for GTK's TextView widget
* Copyright (c) 2002 Evan Martin.
*/
#ifndef __XED_AUTOMATIC_SPELL_CHECKER_H__
#define __XED_AUTOMATIC_SPELL_CHECKER_H__
#include <xed/xed-document.h>
#include <xed/xed-view.h>
#include "xed-spell-checker.h"
typedef struct _XedAutomaticSpellChecker XedAutomaticSpellChecker;
XedAutomaticSpellChecker *xed_automatic_spell_checker_new (
XedDocument *doc,
XedSpellChecker *checker);
XedAutomaticSpellChecker *xed_automatic_spell_checker_get_from_document (
const XedDocument *doc);
void xed_automatic_spell_checker_free (
XedAutomaticSpellChecker *spell);
void xed_automatic_spell_checker_attach_view (
XedAutomaticSpellChecker *spell,
XedView *view);
void xed_automatic_spell_checker_detach_view (
XedAutomaticSpellChecker *spell,
XedView *view);
void xed_automatic_spell_checker_recheck_all (
XedAutomaticSpellChecker *spell);
#endif /* __XED_AUTOMATIC_SPELL_CHECKER_H__ */

View File

@@ -1,7 +1,7 @@
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* xedit-spell-checker-dialog.c
* This file is part of xedit
* xed-spell-checker-dialog.c
* This file is part of xed
*
* Copyright (C) 2002 Paolo Maggi
*
@@ -22,8 +22,8 @@
*/
/*
* Modified by the xedit Team, 2002. See the AUTHORS file for a
* list of people on the xedit Team.
* Modified by the xed Team, 2002. See the AUTHORS file for a
* list of people on the xed Team.
* See the ChangeLog files for a list of changes.
*/
@@ -34,15 +34,15 @@
#include <string.h>
#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include <xedit/xedit-utils.h>
#include "xedit-spell-checker-dialog.h"
#include "xedit-spell-marshal.h"
#include <xed/xed-utils.h>
#include "xed-spell-checker-dialog.h"
#include "xed-spell-marshal.h"
struct _XeditSpellCheckerDialog
struct _XedSpellCheckerDialog
{
GtkWindow parent_instance;
XeditSpellChecker *spell_checker;
XedSpellChecker *spell_checker;
gchar *misspelled_word;
@@ -77,41 +77,41 @@ enum
NUM_COLUMNS
};
static void update_suggestions_list_model (XeditSpellCheckerDialog *dlg,
static void update_suggestions_list_model (XedSpellCheckerDialog *dlg,
GSList *suggestions);
static void word_entry_changed_handler (GtkEditable *editable,
XeditSpellCheckerDialog *dlg);
XedSpellCheckerDialog *dlg);
static void close_button_clicked_handler (GtkButton *button,
XeditSpellCheckerDialog *dlg);
XedSpellCheckerDialog *dlg);
static void suggestions_list_selection_changed_handler (GtkTreeSelection *selection,
XeditSpellCheckerDialog *dlg);
XedSpellCheckerDialog *dlg);
static void check_word_button_clicked_handler (GtkButton *button,
XeditSpellCheckerDialog *dlg);
XedSpellCheckerDialog *dlg);
static void add_word_button_clicked_handler (GtkButton *button,
XeditSpellCheckerDialog *dlg);
XedSpellCheckerDialog *dlg);
static void ignore_button_clicked_handler (GtkButton *button,
XeditSpellCheckerDialog *dlg);
XedSpellCheckerDialog *dlg);
static void ignore_all_button_clicked_handler (GtkButton *button,
XeditSpellCheckerDialog *dlg);
XedSpellCheckerDialog *dlg);
static void change_button_clicked_handler (GtkButton *button,
XeditSpellCheckerDialog *dlg);
XedSpellCheckerDialog *dlg);
static void change_all_button_clicked_handler (GtkButton *button,
XeditSpellCheckerDialog *dlg);
XedSpellCheckerDialog *dlg);
static void suggestions_list_row_activated_handler (GtkTreeView *view,
GtkTreePath *path,
GtkTreeViewColumn *column,
XeditSpellCheckerDialog *dlg);
XedSpellCheckerDialog *dlg);
static guint signals [LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE(XeditSpellCheckerDialog, xedit_spell_checker_dialog, GTK_TYPE_WINDOW)
G_DEFINE_TYPE(XedSpellCheckerDialog, xed_spell_checker_dialog, GTK_TYPE_WINDOW)
static void
xedit_spell_checker_dialog_dispose (GObject *object)
xed_spell_checker_dialog_dispose (GObject *object)
{
XeditSpellCheckerDialog *dlg = XEDIT_SPELL_CHECKER_DIALOG (object);
XedSpellCheckerDialog *dlg = XED_SPELL_CHECKER_DIALOG (object);
if (dlg->spell_checker != NULL)
{
@@ -125,25 +125,25 @@ xedit_spell_checker_dialog_dispose (GObject *object)
dlg->misspelled_word = NULL;
}
G_OBJECT_CLASS (xedit_spell_checker_dialog_parent_class)->dispose (object);
G_OBJECT_CLASS (xed_spell_checker_dialog_parent_class)->dispose (object);
}
static void
xedit_spell_checker_dialog_class_init (XeditSpellCheckerDialogClass * klass)
xed_spell_checker_dialog_class_init (XedSpellCheckerDialogClass * klass)
{
GObjectClass *object_class;
object_class = G_OBJECT_CLASS (klass);
object_class->dispose = xedit_spell_checker_dialog_dispose;
object_class->dispose = xed_spell_checker_dialog_dispose;
signals[IGNORE] =
g_signal_new ("ignore",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (XeditSpellCheckerDialogClass, ignore),
G_STRUCT_OFFSET (XedSpellCheckerDialogClass, ignore),
NULL, NULL,
xedit_marshal_VOID__STRING,
xed_marshal_VOID__STRING,
G_TYPE_NONE,
1,
G_TYPE_STRING);
@@ -152,9 +152,9 @@ xedit_spell_checker_dialog_class_init (XeditSpellCheckerDialogClass * klass)
g_signal_new ("ignore_all",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (XeditSpellCheckerDialogClass, ignore_all),
G_STRUCT_OFFSET (XedSpellCheckerDialogClass, ignore_all),
NULL, NULL,
xedit_marshal_VOID__STRING,
xed_marshal_VOID__STRING,
G_TYPE_NONE,
1,
G_TYPE_STRING);
@@ -163,9 +163,9 @@ xedit_spell_checker_dialog_class_init (XeditSpellCheckerDialogClass * klass)
g_signal_new ("change",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (XeditSpellCheckerDialogClass, change),
G_STRUCT_OFFSET (XedSpellCheckerDialogClass, change),
NULL, NULL,
xedit_marshal_VOID__STRING_STRING,
xed_marshal_VOID__STRING_STRING,
G_TYPE_NONE,
2,
G_TYPE_STRING,
@@ -175,9 +175,9 @@ xedit_spell_checker_dialog_class_init (XeditSpellCheckerDialogClass * klass)
g_signal_new ("change_all",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (XeditSpellCheckerDialogClass, change_all),
G_STRUCT_OFFSET (XedSpellCheckerDialogClass, change_all),
NULL, NULL,
xedit_marshal_VOID__STRING_STRING,
xed_marshal_VOID__STRING_STRING,
G_TYPE_NONE,
2,
G_TYPE_STRING,
@@ -187,16 +187,16 @@ xedit_spell_checker_dialog_class_init (XeditSpellCheckerDialogClass * klass)
g_signal_new ("add_word_to_personal",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (XeditSpellCheckerDialogClass, add_word_to_personal),
G_STRUCT_OFFSET (XedSpellCheckerDialogClass, add_word_to_personal),
NULL, NULL,
xedit_marshal_VOID__STRING,
xed_marshal_VOID__STRING,
G_TYPE_NONE,
1,
G_TYPE_STRING);
}
static void
create_dialog (XeditSpellCheckerDialog *dlg,
create_dialog (XedSpellCheckerDialog *dlg,
const gchar *data_dir)
{
GtkWidget *error_widget;
@@ -223,7 +223,7 @@ create_dialog (XeditSpellCheckerDialog *dlg,
dlg->misspelled_word = NULL;
ui_file = g_build_filename (data_dir, "spell-checker.ui", NULL);
ret = xedit_utils_get_ui_objects (ui_file,
ret = xed_utils_get_ui_objects (ui_file,
root_objects,
&error_widget,
@@ -321,17 +321,17 @@ create_dialog (XeditSpellCheckerDialog *dlg,
}
static void
xedit_spell_checker_dialog_init (XeditSpellCheckerDialog *dlg)
xed_spell_checker_dialog_init (XedSpellCheckerDialog *dlg)
{
}
GtkWidget *
xedit_spell_checker_dialog_new (const gchar *data_dir)
xed_spell_checker_dialog_new (const gchar *data_dir)
{
XeditSpellCheckerDialog *dlg;
XedSpellCheckerDialog *dlg;
dlg = XEDIT_SPELL_CHECKER_DIALOG (
g_object_new (XEDIT_TYPE_SPELL_CHECKER_DIALOG, NULL));
dlg = XED_SPELL_CHECKER_DIALOG (
g_object_new (XED_TYPE_SPELL_CHECKER_DIALOG, NULL));
g_return_val_if_fail (dlg != NULL, NULL);
@@ -341,33 +341,33 @@ xedit_spell_checker_dialog_new (const gchar *data_dir)
}
GtkWidget *
xedit_spell_checker_dialog_new_from_spell_checker (XeditSpellChecker *spell,
xed_spell_checker_dialog_new_from_spell_checker (XedSpellChecker *spell,
const gchar *data_dir)
{
XeditSpellCheckerDialog *dlg;
XedSpellCheckerDialog *dlg;
g_return_val_if_fail (spell != NULL, NULL);
dlg = XEDIT_SPELL_CHECKER_DIALOG (
g_object_new (XEDIT_TYPE_SPELL_CHECKER_DIALOG, NULL));
dlg = XED_SPELL_CHECKER_DIALOG (
g_object_new (XED_TYPE_SPELL_CHECKER_DIALOG, NULL));
g_return_val_if_fail (dlg != NULL, NULL);
create_dialog (dlg, data_dir);
xedit_spell_checker_dialog_set_spell_checker (dlg, spell);
xed_spell_checker_dialog_set_spell_checker (dlg, spell);
return GTK_WIDGET (dlg);
}
void
xedit_spell_checker_dialog_set_spell_checker (XeditSpellCheckerDialog *dlg, XeditSpellChecker *spell)
xed_spell_checker_dialog_set_spell_checker (XedSpellCheckerDialog *dlg, XedSpellChecker *spell)
{
const XeditSpellCheckerLanguage* language;
const XedSpellCheckerLanguage* language;
const gchar *lang;
gchar *tmp;
g_return_if_fail (XEDIT_IS_SPELL_CHECKER_DIALOG (dlg));
g_return_if_fail (XED_IS_SPELL_CHECKER_DIALOG (dlg));
g_return_if_fail (spell != NULL);
if (dlg->spell_checker != NULL)
@@ -376,16 +376,16 @@ xedit_spell_checker_dialog_set_spell_checker (XeditSpellCheckerDialog *dlg, Xedi
dlg->spell_checker = spell;
g_object_ref (dlg->spell_checker);
language = xedit_spell_checker_get_language (dlg->spell_checker);
language = xed_spell_checker_get_language (dlg->spell_checker);
lang = xedit_spell_checker_language_to_string (language);
lang = xed_spell_checker_language_to_string (language);
tmp = g_strdup_printf("<b>%s</b>", lang);
gtk_label_set_label (GTK_LABEL (dlg->language_label), tmp);
g_free (tmp);
if (dlg->misspelled_word != NULL)
xedit_spell_checker_dialog_set_misspelled_word (dlg, dlg->misspelled_word, -1);
xed_spell_checker_dialog_set_misspelled_word (dlg, dlg->misspelled_word, -1);
else
gtk_list_store_clear (GTK_LIST_STORE (dlg->suggestions_list_model));
@@ -393,18 +393,18 @@ xedit_spell_checker_dialog_set_spell_checker (XeditSpellCheckerDialog *dlg, Xedi
}
void
xedit_spell_checker_dialog_set_misspelled_word (XeditSpellCheckerDialog *dlg,
xed_spell_checker_dialog_set_misspelled_word (XedSpellCheckerDialog *dlg,
const gchar *word,
gint len)
{
gchar *tmp;
GSList *sug;
g_return_if_fail (XEDIT_IS_SPELL_CHECKER_DIALOG (dlg));
g_return_if_fail (XED_IS_SPELL_CHECKER_DIALOG (dlg));
g_return_if_fail (word != NULL);
g_return_if_fail (dlg->spell_checker != NULL);
g_return_if_fail (!xedit_spell_checker_check_word (dlg->spell_checker, word, -1));
g_return_if_fail (!xed_spell_checker_check_word (dlg->spell_checker, word, -1));
/* build_suggestions_list */
if (dlg->misspelled_word != NULL)
@@ -416,7 +416,7 @@ xedit_spell_checker_dialog_set_misspelled_word (XeditSpellCheckerDialog *dlg,
gtk_label_set_label (GTK_LABEL (dlg->misspelled_word_label), tmp);
g_free (tmp);
sug = xedit_spell_checker_get_suggestions (dlg->spell_checker,
sug = xed_spell_checker_get_suggestions (dlg->spell_checker,
dlg->misspelled_word,
-1);
@@ -432,13 +432,13 @@ xedit_spell_checker_dialog_set_misspelled_word (XeditSpellCheckerDialog *dlg,
}
static void
update_suggestions_list_model (XeditSpellCheckerDialog *dlg, GSList *suggestions)
update_suggestions_list_model (XedSpellCheckerDialog *dlg, GSList *suggestions)
{
GtkListStore *store;
GtkTreeIter iter;
GtkTreeSelection *sel;
g_return_if_fail (XEDIT_IS_SPELL_CHECKER_DIALOG (dlg));
g_return_if_fail (XED_IS_SPELL_CHECKER_DIALOG (dlg));
g_return_if_fail (GTK_IS_LIST_STORE (dlg->suggestions_list_model));
store = GTK_LIST_STORE (dlg->suggestions_list_model);
@@ -482,11 +482,11 @@ update_suggestions_list_model (XeditSpellCheckerDialog *dlg, GSList *suggestions
}
static void
word_entry_changed_handler (GtkEditable *editable, XeditSpellCheckerDialog *dlg)
word_entry_changed_handler (GtkEditable *editable, XedSpellCheckerDialog *dlg)
{
const gchar *text;
g_return_if_fail (XEDIT_IS_SPELL_CHECKER_DIALOG (dlg));
g_return_if_fail (XED_IS_SPELL_CHECKER_DIALOG (dlg));
text = gtk_entry_get_text (GTK_ENTRY (dlg->word_entry));
@@ -505,22 +505,22 @@ word_entry_changed_handler (GtkEditable *editable, XeditSpellCheckerDialog *dlg)
}
static void
close_button_clicked_handler (GtkButton *button, XeditSpellCheckerDialog *dlg)
close_button_clicked_handler (GtkButton *button, XedSpellCheckerDialog *dlg)
{
g_return_if_fail (XEDIT_IS_SPELL_CHECKER_DIALOG (dlg));
g_return_if_fail (XED_IS_SPELL_CHECKER_DIALOG (dlg));
gtk_widget_destroy (GTK_WIDGET (dlg));
}
static void
suggestions_list_selection_changed_handler (GtkTreeSelection *selection,
XeditSpellCheckerDialog *dlg)
XedSpellCheckerDialog *dlg)
{
GtkTreeIter iter;
GValue value = {0, };
const gchar *text;
g_return_if_fail (XEDIT_IS_SPELL_CHECKER_DIALOG (dlg));
g_return_if_fail (XED_IS_SPELL_CHECKER_DIALOG (dlg));
if (! gtk_tree_selection_get_selected (selection, NULL, &iter))
return;
@@ -537,18 +537,18 @@ suggestions_list_selection_changed_handler (GtkTreeSelection *selection,
}
static void
check_word_button_clicked_handler (GtkButton *button, XeditSpellCheckerDialog *dlg)
check_word_button_clicked_handler (GtkButton *button, XedSpellCheckerDialog *dlg)
{
const gchar *word;
gssize len;
g_return_if_fail (XEDIT_IS_SPELL_CHECKER_DIALOG (dlg));
g_return_if_fail (XED_IS_SPELL_CHECKER_DIALOG (dlg));
word = gtk_entry_get_text (GTK_ENTRY (dlg->word_entry));
len = strlen (word);
g_return_if_fail (len > 0);
if (xedit_spell_checker_check_word (dlg->spell_checker, word, len))
if (xed_spell_checker_check_word (dlg->spell_checker, word, len))
{
GtkListStore *store;
GtkTreeIter iter;
@@ -568,7 +568,7 @@ check_word_button_clicked_handler (GtkButton *button, XeditSpellCheckerDialog *d
{
GSList *sug;
sug = xedit_spell_checker_get_suggestions (dlg->spell_checker,
sug = xed_spell_checker_get_suggestions (dlg->spell_checker,
word,
len);
@@ -581,14 +581,14 @@ check_word_button_clicked_handler (GtkButton *button, XeditSpellCheckerDialog *d
}
static void
add_word_button_clicked_handler (GtkButton *button, XeditSpellCheckerDialog *dlg)
add_word_button_clicked_handler (GtkButton *button, XedSpellCheckerDialog *dlg)
{
gchar *word;
g_return_if_fail (XEDIT_IS_SPELL_CHECKER_DIALOG (dlg));
g_return_if_fail (XED_IS_SPELL_CHECKER_DIALOG (dlg));
g_return_if_fail (dlg->misspelled_word != NULL);
xedit_spell_checker_add_word_to_personal (dlg->spell_checker,
xed_spell_checker_add_word_to_personal (dlg->spell_checker,
dlg->misspelled_word,
-1);
@@ -600,11 +600,11 @@ add_word_button_clicked_handler (GtkButton *button, XeditSpellCheckerDialog *dlg
}
static void
ignore_button_clicked_handler (GtkButton *button, XeditSpellCheckerDialog *dlg)
ignore_button_clicked_handler (GtkButton *button, XedSpellCheckerDialog *dlg)
{
gchar *word;
g_return_if_fail (XEDIT_IS_SPELL_CHECKER_DIALOG (dlg));
g_return_if_fail (XED_IS_SPELL_CHECKER_DIALOG (dlg));
g_return_if_fail (dlg->misspelled_word != NULL);
word = g_strdup (dlg->misspelled_word);
@@ -615,14 +615,14 @@ ignore_button_clicked_handler (GtkButton *button, XeditSpellCheckerDialog *dlg)
}
static void
ignore_all_button_clicked_handler (GtkButton *button, XeditSpellCheckerDialog *dlg)
ignore_all_button_clicked_handler (GtkButton *button, XedSpellCheckerDialog *dlg)
{
gchar *word;
g_return_if_fail (XEDIT_IS_SPELL_CHECKER_DIALOG (dlg));
g_return_if_fail (XED_IS_SPELL_CHECKER_DIALOG (dlg));
g_return_if_fail (dlg->misspelled_word != NULL);
xedit_spell_checker_add_word_to_session (dlg->spell_checker,
xed_spell_checker_add_word_to_session (dlg->spell_checker,
dlg->misspelled_word,
-1);
@@ -634,13 +634,13 @@ ignore_all_button_clicked_handler (GtkButton *button, XeditSpellCheckerDialog *d
}
static void
change_button_clicked_handler (GtkButton *button, XeditSpellCheckerDialog *dlg)
change_button_clicked_handler (GtkButton *button, XedSpellCheckerDialog *dlg)
{
const gchar *entry_text;
gchar *change;
gchar *word;
g_return_if_fail (XEDIT_IS_SPELL_CHECKER_DIALOG (dlg));
g_return_if_fail (XED_IS_SPELL_CHECKER_DIALOG (dlg));
g_return_if_fail (dlg->misspelled_word != NULL);
entry_text = gtk_entry_get_text (GTK_ENTRY (dlg->word_entry));
@@ -648,7 +648,7 @@ change_button_clicked_handler (GtkButton *button, XeditSpellCheckerDialog *dlg)
g_return_if_fail (*entry_text != '\0');
change = g_strdup (entry_text);
xedit_spell_checker_set_correction (dlg->spell_checker,
xed_spell_checker_set_correction (dlg->spell_checker,
dlg->misspelled_word, -1,
change, -1);
@@ -665,21 +665,21 @@ static void
suggestions_list_row_activated_handler (GtkTreeView *view,
GtkTreePath *path,
GtkTreeViewColumn *column,
XeditSpellCheckerDialog *dlg)
XedSpellCheckerDialog *dlg)
{
g_return_if_fail (XEDIT_IS_SPELL_CHECKER_DIALOG (dlg));
g_return_if_fail (XED_IS_SPELL_CHECKER_DIALOG (dlg));
change_button_clicked_handler (GTK_BUTTON (dlg->change_button), dlg);
}
static void
change_all_button_clicked_handler (GtkButton *button, XeditSpellCheckerDialog *dlg)
change_all_button_clicked_handler (GtkButton *button, XedSpellCheckerDialog *dlg)
{
const gchar *entry_text;
gchar *change;
gchar *word;
g_return_if_fail (XEDIT_IS_SPELL_CHECKER_DIALOG (dlg));
g_return_if_fail (XED_IS_SPELL_CHECKER_DIALOG (dlg));
g_return_if_fail (dlg->misspelled_word != NULL);
entry_text = gtk_entry_get_text (GTK_ENTRY (dlg->word_entry));
@@ -687,7 +687,7 @@ change_all_button_clicked_handler (GtkButton *button, XeditSpellCheckerDialog *d
g_return_if_fail (*entry_text != '\0');
change = g_strdup (entry_text);
xedit_spell_checker_set_correction (dlg->spell_checker,
xed_spell_checker_set_correction (dlg->spell_checker,
dlg->misspelled_word, -1,
change, -1);
@@ -700,11 +700,11 @@ change_all_button_clicked_handler (GtkButton *button, XeditSpellCheckerDialog *d
}
void
xedit_spell_checker_dialog_set_completed (XeditSpellCheckerDialog *dlg)
xed_spell_checker_dialog_set_completed (XedSpellCheckerDialog *dlg)
{
gchar *tmp;
g_return_if_fail (XEDIT_IS_SPELL_CHECKER_DIALOG (dlg));
g_return_if_fail (XED_IS_SPELL_CHECKER_DIALOG (dlg));
tmp = g_strdup_printf("<b>%s</b>", _("Completed spell checking"));
gtk_label_set_label (GTK_LABEL (dlg->misspelled_word_label),

View File

@@ -0,0 +1,92 @@
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* xed-spell-checker-dialog.h
* This file is part of xed
*
* Copyright (C) 2002 Paolo Maggi
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
/*
* Modified by the xed Team, 2002. See the AUTHORS file for a
* list of people on the xed Team.
* See the ChangeLog files for a list of changes.
*/
#ifndef __XED_SPELL_CHECKER_DIALOG_H__
#define __XED_SPELL_CHECKER_DIALOG_H__
#include <gtk/gtk.h>
#include "xed-spell-checker.h"
G_BEGIN_DECLS
#define XED_TYPE_SPELL_CHECKER_DIALOG (xed_spell_checker_dialog_get_type ())
#define XED_SPELL_CHECKER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XED_TYPE_SPELL_CHECKER_DIALOG, XedSpellCheckerDialog))
#define XED_SPELL_CHECKER_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XED_TYPE_SPELL_CHECKER_DIALOG, XedSpellCheckerDialog))
#define XED_IS_SPELL_CHECKER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XED_TYPE_SPELL_CHECKER_DIALOG))
#define XED_IS_SPELL_CHECKER_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XED_TYPE_SPELL_CHECKER_DIALOG))
#define XED_SPELL_CHECKER_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XED_TYPE_SPELL_CHECKER_DIALOG, XedSpellCheckerDialog))
typedef struct _XedSpellCheckerDialog XedSpellCheckerDialog;
typedef struct _XedSpellCheckerDialogClass XedSpellCheckerDialogClass;
struct _XedSpellCheckerDialogClass
{
GtkWindowClass parent_class;
/* Signals */
void (*ignore) (XedSpellCheckerDialog *dlg,
const gchar *word);
void (*ignore_all) (XedSpellCheckerDialog *dlg,
const gchar *word);
void (*change) (XedSpellCheckerDialog *dlg,
const gchar *word,
const gchar *change_to);
void (*change_all) (XedSpellCheckerDialog *dlg,
const gchar *word,
const gchar *change_to);
void (*add_word_to_personal) (XedSpellCheckerDialog *dlg,
const gchar *word);
};
GType xed_spell_checker_dialog_get_type (void) G_GNUC_CONST;
/* Constructors */
GtkWidget *xed_spell_checker_dialog_new (const gchar *data_dir);
GtkWidget *xed_spell_checker_dialog_new_from_spell_checker
(XedSpellChecker *spell,
const gchar *data_dir);
void xed_spell_checker_dialog_set_spell_checker
(XedSpellCheckerDialog *dlg,
XedSpellChecker *spell);
void xed_spell_checker_dialog_set_misspelled_word
(XedSpellCheckerDialog *dlg,
const gchar* word,
gint len);
void xed_spell_checker_dialog_set_completed
(XedSpellCheckerDialog *dlg);
G_END_DECLS
#endif /* __XED_SPELL_CHECKER_DIALOG_H__ */

View File

@@ -1,7 +1,7 @@
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* xedit-spell-checker-language.c
* This file is part of xedit
* xed-spell-checker-language.c
* This file is part of xed
*
* Copyright (C) 2006 Paolo Maggi
*
@@ -22,8 +22,8 @@
*/
/*
* Modified by the xedit Team, 2006. See the AUTHORS file for a
* list of people on the xedit Team.
* Modified by the xed Team, 2006. See the AUTHORS file for a
* list of people on the xed Team.
* See the ChangeLog files for a list of changes.
*/
@@ -43,16 +43,16 @@
#include <glib/gi18n.h>
#include <libxml/xmlreader.h>
#include "xedit-spell-checker-language.h"
#include "xed-spell-checker-language.h"
#include <xedit/xedit-debug.h>
#include <xed/xed-debug.h>
#define ISO_639_DOMAIN "iso_639"
#define ISO_3166_DOMAIN "iso_3166"
#define ISOCODESLOCALEDIR ISO_CODES_PREFIX "/share/locale"
struct _XeditSpellCheckerLanguage
struct _XedSpellCheckerLanguage
{
gchar *abrev;
gchar *name;
@@ -154,7 +154,7 @@ load_iso_entries (int iso,
char *filename;
int ret = -1;
xedit_debug_message (DEBUG_PLUGINS, "Loading ISO-%d codes", iso);
xed_debug_message (DEBUG_PLUGINS, "Loading ISO-%d codes", iso);
filename = g_strdup_printf (ISO_CODES_PREFIX "/share/xml/iso-codes/iso_%d.xml", iso);
reader = xmlNewTextReaderFilename (filename);
@@ -331,8 +331,8 @@ key_cmp (gconstpointer a, gconstpointer b, gpointer user_data)
}
static gint
lang_cmp (const XeditSpellCheckerLanguage *a,
const XeditSpellCheckerLanguage *b)
lang_cmp (const XedSpellCheckerLanguage *a,
const XedSpellCheckerLanguage *b)
{
return g_utf8_collate (a->name, b->name);
}
@@ -342,7 +342,7 @@ build_langs_list (const gchar *key,
const gchar *value,
gpointer data)
{
XeditSpellCheckerLanguage *lang = g_new (XeditSpellCheckerLanguage, 1);
XedSpellCheckerLanguage *lang = g_new (XedSpellCheckerLanguage, 1);
lang->abrev = g_strdup (key);
lang->name = g_strdup (value);
@@ -355,7 +355,7 @@ build_langs_list (const gchar *key,
}
const GSList *
xedit_spell_checker_get_available_languages (void)
xed_spell_checker_get_available_languages (void)
{
EnchantBroker *broker;
GTree *dicts;
@@ -397,7 +397,7 @@ xedit_spell_checker_get_available_languages (void)
}
const gchar *
xedit_spell_checker_language_to_string (const XeditSpellCheckerLanguage *lang)
xed_spell_checker_language_to_string (const XedSpellCheckerLanguage *lang)
{
if (lang == NULL)
/* Translators: this refers the Default language used by the
@@ -409,25 +409,25 @@ xedit_spell_checker_language_to_string (const XeditSpellCheckerLanguage *lang)
}
const gchar *
xedit_spell_checker_language_to_key (const XeditSpellCheckerLanguage *lang)
xed_spell_checker_language_to_key (const XedSpellCheckerLanguage *lang)
{
g_return_val_if_fail (lang != NULL, NULL);
return lang->abrev;
}
const XeditSpellCheckerLanguage *
xedit_spell_checker_language_from_key (const gchar *key)
const XedSpellCheckerLanguage *
xed_spell_checker_language_from_key (const gchar *key)
{
const GSList *langs;
g_return_val_if_fail (key != NULL, NULL);
langs = xedit_spell_checker_get_available_languages ();
langs = xed_spell_checker_get_available_languages ();
while (langs != NULL)
{
const XeditSpellCheckerLanguage *l = (const XeditSpellCheckerLanguage *)langs->data;
const XedSpellCheckerLanguage *l = (const XedSpellCheckerLanguage *)langs->data;
if (g_ascii_strcasecmp (key, l->abrev) == 0)
return l;

View File

@@ -1,7 +1,7 @@
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* xedit-spell-checker-language.h
* This file is part of xedit
* xed-spell-checker-language.h
* This file is part of xed
*
* Copyright (C) 2006 Paolo Maggi
*
@@ -22,30 +22,30 @@
*/
/*
* Modified by the xedit Team, 2006. See the AUTHORS file for a
* list of people on the xedit Team.
* Modified by the xed Team, 2006. See the AUTHORS file for a
* list of people on the xed Team.
* See the ChangeLog files for a list of changes.
*/
#ifndef __XEDIT_SPELL_CHECKER_LANGUAGE_H__
#define __XEDIT_SPELL_CHECKER_LANGUAGE_H__
#ifndef __XED_SPELL_CHECKER_LANGUAGE_H__
#define __XED_SPELL_CHECKER_LANGUAGE_H__
#include <glib.h>
G_BEGIN_DECLS
typedef struct _XeditSpellCheckerLanguage XeditSpellCheckerLanguage;
typedef struct _XedSpellCheckerLanguage XedSpellCheckerLanguage;
const gchar *xedit_spell_checker_language_to_string (const XeditSpellCheckerLanguage *lang);
const gchar *xed_spell_checker_language_to_string (const XedSpellCheckerLanguage *lang);
const gchar *xedit_spell_checker_language_to_key (const XeditSpellCheckerLanguage *lang);
const gchar *xed_spell_checker_language_to_key (const XedSpellCheckerLanguage *lang);
const XeditSpellCheckerLanguage *xedit_spell_checker_language_from_key (const gchar *key);
const XedSpellCheckerLanguage *xed_spell_checker_language_from_key (const gchar *key);
/* GSList contains "XeditSpellCheckerLanguage*" items */
const GSList *xedit_spell_checker_get_available_languages
/* GSList contains "XedSpellCheckerLanguage*" items */
const GSList *xed_spell_checker_get_available_languages
(void);
G_END_DECLS
#endif /* __XEDIT_SPELL_CHECKER_LANGUAGE_H__ */
#endif /* __XED_SPELL_CHECKER_LANGUAGE_H__ */

View File

@@ -1,7 +1,7 @@
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* xedit-spell-checker.c
* This file is part of xedit
* xed-spell-checker.c
* This file is part of xed
*
* Copyright (C) 2002-2006 Paolo Maggi
*
@@ -22,8 +22,8 @@
*/
/*
* Modified by the xedit Team, 2002-2006. See the AUTHORS file for a
* list of people on the xedit Team.
* Modified by the xed Team, 2002-2006. See the AUTHORS file for a
* list of people on the xed Team.
* See the ChangeLog files for a list of changes.
*/
@@ -38,17 +38,17 @@
#include <glib/gi18n.h>
#include <glib.h>
#include "xedit-spell-checker.h"
#include "xedit-spell-utils.h"
#include "xedit-spell-marshal.h"
#include "xed-spell-checker.h"
#include "xed-spell-utils.h"
#include "xed-spell-marshal.h"
struct _XeditSpellChecker
struct _XedSpellChecker
{
GObject parent_instance;
EnchantDict *dict;
EnchantBroker *broker;
const XeditSpellCheckerLanguage *active_lang;
const XedSpellCheckerLanguage *active_lang;
};
/* GObject properties */
@@ -69,16 +69,16 @@ enum {
static guint signals[LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE(XeditSpellChecker, xedit_spell_checker, G_TYPE_OBJECT)
G_DEFINE_TYPE(XedSpellChecker, xed_spell_checker, G_TYPE_OBJECT)
static void
xedit_spell_checker_set_property (GObject *object,
xed_spell_checker_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
/*
XeditSpellChecker *spell = XEDIT_SPELL_CHECKER (object);
XedSpellChecker *spell = XED_SPELL_CHECKER (object);
*/
switch (prop_id)
@@ -92,13 +92,13 @@ xedit_spell_checker_set_property (GObject *object,
}
static void
xedit_spell_checker_get_property (GObject *object,
xed_spell_checker_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
/*
XeditSpellChecker *spell = XEDIT_SPELL_CHECKER (object);
XedSpellChecker *spell = XED_SPELL_CHECKER (object);
*/
switch (prop_id)
@@ -111,13 +111,13 @@ xedit_spell_checker_get_property (GObject *object,
}
static void
xedit_spell_checker_finalize (GObject *object)
xed_spell_checker_finalize (GObject *object)
{
XeditSpellChecker *spell_checker;
XedSpellChecker *spell_checker;
g_return_if_fail (XEDIT_IS_SPELL_CHECKER (object));
g_return_if_fail (XED_IS_SPELL_CHECKER (object));
spell_checker = XEDIT_SPELL_CHECKER (object);
spell_checker = XED_SPELL_CHECKER (object);
if (spell_checker->dict != NULL)
enchant_broker_free_dict (spell_checker->broker, spell_checker->dict);
@@ -125,20 +125,20 @@ xedit_spell_checker_finalize (GObject *object)
if (spell_checker->broker != NULL)
enchant_broker_free (spell_checker->broker);
G_OBJECT_CLASS (xedit_spell_checker_parent_class)->finalize (object);
G_OBJECT_CLASS (xed_spell_checker_parent_class)->finalize (object);
}
static void
xedit_spell_checker_class_init (XeditSpellCheckerClass * klass)
xed_spell_checker_class_init (XedSpellCheckerClass * klass)
{
GObjectClass *object_class;
object_class = G_OBJECT_CLASS (klass);
object_class->set_property = xedit_spell_checker_set_property;
object_class->get_property = xedit_spell_checker_get_property;
object_class->set_property = xed_spell_checker_set_property;
object_class->get_property = xed_spell_checker_get_property;
object_class->finalize = xedit_spell_checker_finalize;
object_class->finalize = xed_spell_checker_finalize;
g_object_class_install_property (object_class,
PROP_LANGUAGE,
@@ -151,9 +151,9 @@ xedit_spell_checker_class_init (XeditSpellCheckerClass * klass)
g_signal_new ("add_word_to_personal",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (XeditSpellCheckerClass, add_word_to_personal),
G_STRUCT_OFFSET (XedSpellCheckerClass, add_word_to_personal),
NULL, NULL,
xedit_marshal_VOID__STRING_INT,
xed_marshal_VOID__STRING_INT,
G_TYPE_NONE,
2,
G_TYPE_STRING,
@@ -163,9 +163,9 @@ xedit_spell_checker_class_init (XeditSpellCheckerClass * klass)
g_signal_new ("add_word_to_session",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (XeditSpellCheckerClass, add_word_to_session),
G_STRUCT_OFFSET (XedSpellCheckerClass, add_word_to_session),
NULL, NULL,
xedit_marshal_VOID__STRING_INT,
xed_marshal_VOID__STRING_INT,
G_TYPE_NONE,
2,
G_TYPE_STRING,
@@ -175,9 +175,9 @@ xedit_spell_checker_class_init (XeditSpellCheckerClass * klass)
g_signal_new ("set_language",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (XeditSpellCheckerClass, set_language),
G_STRUCT_OFFSET (XedSpellCheckerClass, set_language),
NULL, NULL,
xedit_marshal_VOID__POINTER,
xed_marshal_VOID__POINTER,
G_TYPE_NONE,
1,
G_TYPE_POINTER);
@@ -186,28 +186,28 @@ xedit_spell_checker_class_init (XeditSpellCheckerClass * klass)
g_signal_new ("clear_session",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (XeditSpellCheckerClass, clear_session),
G_STRUCT_OFFSET (XedSpellCheckerClass, clear_session),
NULL, NULL,
xedit_marshal_VOID__VOID,
xed_marshal_VOID__VOID,
G_TYPE_NONE,
0);
}
static void
xedit_spell_checker_init (XeditSpellChecker *spell_checker)
xed_spell_checker_init (XedSpellChecker *spell_checker)
{
spell_checker->broker = enchant_broker_init ();
spell_checker->dict = NULL;
spell_checker->active_lang = NULL;
}
XeditSpellChecker *
xedit_spell_checker_new (void)
XedSpellChecker *
xed_spell_checker_new (void)
{
XeditSpellChecker *spell;
XedSpellChecker *spell;
spell = XEDIT_SPELL_CHECKER (
g_object_new (XEDIT_TYPE_SPELL_CHECKER, NULL));
spell = XED_SPELL_CHECKER (
g_object_new (XED_TYPE_SPELL_CHECKER, NULL));
g_return_val_if_fail (spell != NULL, NULL);
@@ -215,8 +215,8 @@ xedit_spell_checker_new (void)
}
static gboolean
lazy_init (XeditSpellChecker *spell,
const XeditSpellCheckerLanguage *language)
lazy_init (XedSpellChecker *spell,
const XedSpellCheckerLanguage *language)
{
if (spell->dict != NULL)
return TRUE;
@@ -232,13 +232,13 @@ lazy_init (XeditSpellChecker *spell,
else
{
/* First try to get a default language */
const XeditSpellCheckerLanguage *l;
const XedSpellCheckerLanguage *l;
gint i = 0;
const gchar * const *lang_tags = g_get_language_names ();
while (lang_tags [i])
{
l = xedit_spell_checker_language_from_key (lang_tags [i]);
l = xed_spell_checker_language_from_key (lang_tags [i]);
if (l != NULL)
{
@@ -252,22 +252,22 @@ lazy_init (XeditSpellChecker *spell,
/* Second try to get a default language */
if (spell->active_lang == NULL)
spell->active_lang = xedit_spell_checker_language_from_key ("en_US");
spell->active_lang = xed_spell_checker_language_from_key ("en_US");
/* Last try to get a default language */
if (spell->active_lang == NULL)
{
const GSList *langs;
langs = xedit_spell_checker_get_available_languages ();
langs = xed_spell_checker_get_available_languages ();
if (langs != NULL)
spell->active_lang = (const XeditSpellCheckerLanguage *)langs->data;
spell->active_lang = (const XedSpellCheckerLanguage *)langs->data;
}
if (spell->active_lang != NULL)
{
const gchar *key;
key = xedit_spell_checker_language_to_key (spell->active_lang);
key = xed_spell_checker_language_to_key (spell->active_lang);
spell->dict = enchant_broker_request_dict (spell->broker,
key);
@@ -287,12 +287,12 @@ lazy_init (XeditSpellChecker *spell,
}
gboolean
xedit_spell_checker_set_language (XeditSpellChecker *spell,
const XeditSpellCheckerLanguage *language)
xed_spell_checker_set_language (XedSpellChecker *spell,
const XedSpellCheckerLanguage *language)
{
gboolean ret;
g_return_val_if_fail (XEDIT_IS_SPELL_CHECKER (spell), FALSE);
g_return_val_if_fail (XED_IS_SPELL_CHECKER (spell), FALSE);
if (spell->dict != NULL)
{
@@ -306,15 +306,15 @@ xedit_spell_checker_set_language (XeditSpellChecker *spell,
g_signal_emit (G_OBJECT (spell), signals[SET_LANGUAGE], 0, language);
else
g_warning ("Spell checker plugin: cannot use language %s.",
xedit_spell_checker_language_to_string (language));
xed_spell_checker_language_to_string (language));
return ret;
}
const XeditSpellCheckerLanguage *
xedit_spell_checker_get_language (XeditSpellChecker *spell)
const XedSpellCheckerLanguage *
xed_spell_checker_get_language (XedSpellChecker *spell)
{
g_return_val_if_fail (XEDIT_IS_SPELL_CHECKER (spell), NULL);
g_return_val_if_fail (XED_IS_SPELL_CHECKER (spell), NULL);
if (!lazy_init (spell, spell->active_lang))
return NULL;
@@ -323,14 +323,14 @@ xedit_spell_checker_get_language (XeditSpellChecker *spell)
}
gboolean
xedit_spell_checker_check_word (XeditSpellChecker *spell,
xed_spell_checker_check_word (XedSpellChecker *spell,
const gchar *word,
gssize len)
{
gint enchant_result;
gboolean res = FALSE;
g_return_val_if_fail (XEDIT_IS_SPELL_CHECKER (spell), FALSE);
g_return_val_if_fail (XED_IS_SPELL_CHECKER (spell), FALSE);
g_return_val_if_fail (word != NULL, FALSE);
if (!lazy_init (spell, spell->active_lang))
@@ -339,10 +339,10 @@ xedit_spell_checker_check_word (XeditSpellChecker *spell,
if (len < 0)
len = strlen (word);
if (strcmp (word, "xedit") == 0)
if (strcmp (word, "xed") == 0)
return TRUE;
if (xedit_spell_utils_is_digit (word, len))
if (xed_spell_utils_is_digit (word, len))
return TRUE;
g_return_val_if_fail (spell->dict != NULL, FALSE);
@@ -376,7 +376,7 @@ xedit_spell_checker_check_word (XeditSpellChecker *spell,
/* return NULL on error or if no suggestions are found */
GSList *
xedit_spell_checker_get_suggestions (XeditSpellChecker *spell,
xed_spell_checker_get_suggestions (XedSpellChecker *spell,
const gchar *word,
gssize len)
{
@@ -385,7 +385,7 @@ xedit_spell_checker_get_suggestions (XeditSpellChecker *spell,
GSList *suggestions_list = NULL;
gint i;
g_return_val_if_fail (XEDIT_IS_SPELL_CHECKER (spell), NULL);
g_return_val_if_fail (XED_IS_SPELL_CHECKER (spell), NULL);
g_return_val_if_fail (word != NULL, NULL);
if (!lazy_init (spell, spell->active_lang))
@@ -418,11 +418,11 @@ xedit_spell_checker_get_suggestions (XeditSpellChecker *spell,
}
gboolean
xedit_spell_checker_add_word_to_personal (XeditSpellChecker *spell,
xed_spell_checker_add_word_to_personal (XedSpellChecker *spell,
const gchar *word,
gssize len)
{
g_return_val_if_fail (XEDIT_IS_SPELL_CHECKER (spell), FALSE);
g_return_val_if_fail (XED_IS_SPELL_CHECKER (spell), FALSE);
g_return_val_if_fail (word != NULL, FALSE);
if (!lazy_init (spell, spell->active_lang))
@@ -441,11 +441,11 @@ xedit_spell_checker_add_word_to_personal (XeditSpellChecker *spell,
}
gboolean
xedit_spell_checker_add_word_to_session (XeditSpellChecker *spell,
xed_spell_checker_add_word_to_session (XedSpellChecker *spell,
const gchar *word,
gssize len)
{
g_return_val_if_fail (XEDIT_IS_SPELL_CHECKER (spell), FALSE);
g_return_val_if_fail (XED_IS_SPELL_CHECKER (spell), FALSE);
g_return_val_if_fail (word != NULL, FALSE);
if (!lazy_init (spell, spell->active_lang))
@@ -464,9 +464,9 @@ xedit_spell_checker_add_word_to_session (XeditSpellChecker *spell,
}
gboolean
xedit_spell_checker_clear_session (XeditSpellChecker *spell)
xed_spell_checker_clear_session (XedSpellChecker *spell)
{
g_return_val_if_fail (XEDIT_IS_SPELL_CHECKER (spell), FALSE);
g_return_val_if_fail (XED_IS_SPELL_CHECKER (spell), FALSE);
/* free and re-request dictionary */
if (spell->dict != NULL)
@@ -488,13 +488,13 @@ xedit_spell_checker_clear_session (XeditSpellChecker *spell)
* 'replacement'
*/
gboolean
xedit_spell_checker_set_correction (XeditSpellChecker *spell,
xed_spell_checker_set_correction (XedSpellChecker *spell,
const gchar *word,
gssize w_len,
const gchar *replacement,
gssize r_len)
{
g_return_val_if_fail (XEDIT_IS_SPELL_CHECKER (spell), FALSE);
g_return_val_if_fail (XED_IS_SPELL_CHECKER (spell), FALSE);
g_return_val_if_fail (word != NULL, FALSE);
g_return_val_if_fail (replacement != NULL, FALSE);

View File

@@ -0,0 +1,109 @@
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* xed-spell-checker.h
* This file is part of xed
*
* Copyright (C) 2002-2006 Paolo Maggi
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
/*
* Modified by the xed Team, 2002. See the AUTHORS file for a
* list of people on the xed Team.
* See the ChangeLog files for a list of changes.
*/
#ifndef __XED_SPELL_CHECKER_H__
#define __XED_SPELL_CHECKER_H__
#include <glib.h>
#include <glib-object.h>
#include "xed-spell-checker-language.h"
G_BEGIN_DECLS
#define XED_TYPE_SPELL_CHECKER (xed_spell_checker_get_type ())
#define XED_SPELL_CHECKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XED_TYPE_SPELL_CHECKER, XedSpellChecker))
#define XED_SPELL_CHECKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XED_TYPE_SPELL_CHECKER, XedSpellChecker))
#define XED_IS_SPELL_CHECKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XED_TYPE_SPELL_CHECKER))
#define XED_IS_SPELL_CHECKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XED_TYPE_SPELL_CHECKER))
#define XED_SPELL_CHECKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XED_TYPE_SPELL_CHECKER, XedSpellChecker))
typedef struct _XedSpellChecker XedSpellChecker;
typedef struct _XedSpellCheckerClass XedSpellCheckerClass;
struct _XedSpellCheckerClass
{
GObjectClass parent_class;
/* Signals */
void (*add_word_to_personal) (XedSpellChecker *spell,
const gchar *word,
gint len);
void (*add_word_to_session) (XedSpellChecker *spell,
const gchar *word,
gint len);
void (*set_language) (XedSpellChecker *spell,
const XedSpellCheckerLanguage *lang);
void (*clear_session) (XedSpellChecker *spell);
};
GType xed_spell_checker_get_type (void) G_GNUC_CONST;
/* Constructors */
XedSpellChecker *xed_spell_checker_new (void);
gboolean xed_spell_checker_set_language (XedSpellChecker *spell,
const XedSpellCheckerLanguage *lang);
const XedSpellCheckerLanguage
*xed_spell_checker_get_language (XedSpellChecker *spell);
gboolean xed_spell_checker_check_word (XedSpellChecker *spell,
const gchar *word,
gssize len);
GSList *xed_spell_checker_get_suggestions (XedSpellChecker *spell,
const gchar *word,
gssize len);
gboolean xed_spell_checker_add_word_to_personal
(XedSpellChecker *spell,
const gchar *word,
gssize len);
gboolean xed_spell_checker_add_word_to_session
(XedSpellChecker *spell,
const gchar *word,
gssize len);
gboolean xed_spell_checker_clear_session (XedSpellChecker *spell);
gboolean xed_spell_checker_set_correction (XedSpellChecker *spell,
const gchar *word,
gssize w_len,
const gchar *replacement,
gssize r_len);
G_END_DECLS
#endif /* __XED_SPELL_CHECKER_H__ */

View File

@@ -1,7 +1,7 @@
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* xedit-spell-language-dialog.c
* This file is part of xedit
* xed-spell-language-dialog.c
* This file is part of xed
*
* Copyright (C) 2002 Paolo Maggi
*
@@ -22,8 +22,8 @@
*/
/*
* Modified by the xedit Team, 2002. See the AUTHORS file for a
* list of people on the xedit Team.
* Modified by the xed Team, 2002. See the AUTHORS file for a
* list of people on the xed Team.
* See the ChangeLog files for a list of changes.
*/
@@ -33,10 +33,10 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include <xedit/xedit-utils.h>
#include <xedit/xedit-help.h>
#include "xedit-spell-language-dialog.h"
#include "xedit-spell-checker-language.h"
#include <xed/xed-utils.h>
#include <xed/xed-help.h>
#include "xed-spell-language-dialog.h"
#include "xed-spell-checker-language.h"
enum
@@ -47,7 +47,7 @@ enum
};
struct _XeditSpellLanguageDialog
struct _XedSpellLanguageDialog
{
GtkDialog dialog;
@@ -55,11 +55,11 @@ struct _XeditSpellLanguageDialog
GtkTreeModel *model;
};
G_DEFINE_TYPE(XeditSpellLanguageDialog, xedit_spell_language_dialog, GTK_TYPE_DIALOG)
G_DEFINE_TYPE(XedSpellLanguageDialog, xed_spell_language_dialog, GTK_TYPE_DIALOG)
static void
xedit_spell_language_dialog_class_init (XeditSpellLanguageDialogClass *klass)
xed_spell_language_dialog_class_init (XedSpellLanguageDialogClass *klass)
{
/* GObjectClass *object_class = G_OBJECT_CLASS (klass); */
}
@@ -70,9 +70,9 @@ dialog_response_handler (GtkDialog *dlg,
{
if (res_id == GTK_RESPONSE_HELP)
{
xedit_help_display (GTK_WINDOW (dlg),
xed_help_display (GTK_WINDOW (dlg),
NULL,
"xedit-spell-checker-plugin");
"xed-spell-checker-plugin");
g_signal_stop_emission_by_name (dlg, "response");
}
@@ -109,13 +109,13 @@ static void
language_row_activated (GtkTreeView *tree_view,
GtkTreePath *path,
GtkTreeViewColumn *column,
XeditSpellLanguageDialog *dialog)
XedSpellLanguageDialog *dialog)
{
gtk_dialog_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
}
static void
create_dialog (XeditSpellLanguageDialog *dlg,
create_dialog (XedSpellLanguageDialog *dlg,
const gchar *data_dir)
{
GtkWidget *error_widget;
@@ -157,7 +157,7 @@ create_dialog (XeditSpellLanguageDialog *dlg,
NULL);
ui_file = g_build_filename (data_dir, "languages-dialog.ui", NULL);
ret = xedit_utils_get_ui_objects (ui_file,
ret = xed_utils_get_ui_objects (ui_file,
root_objects,
&error_widget,
"content", &content,
@@ -215,14 +215,14 @@ create_dialog (XeditSpellLanguageDialog *dlg,
}
static void
xedit_spell_language_dialog_init (XeditSpellLanguageDialog *dlg)
xed_spell_language_dialog_init (XedSpellLanguageDialog *dlg)
{
}
static void
populate_language_list (XeditSpellLanguageDialog *dlg,
const XeditSpellCheckerLanguage *cur_lang)
populate_language_list (XedSpellLanguageDialog *dlg,
const XedSpellCheckerLanguage *cur_lang)
{
GtkListStore *store;
GtkTreeIter iter;
@@ -232,13 +232,13 @@ populate_language_list (XeditSpellLanguageDialog *dlg,
/* create list store */
store = GTK_LIST_STORE (dlg->model);
langs = xedit_spell_checker_get_available_languages ();
langs = xed_spell_checker_get_available_languages ();
while (langs)
{
const gchar *name;
name = xedit_spell_checker_language_to_string ((const XeditSpellCheckerLanguage*)langs->data);
name = xed_spell_checker_language_to_string ((const XedSpellCheckerLanguage*)langs->data);
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
@@ -261,15 +261,15 @@ populate_language_list (XeditSpellLanguageDialog *dlg,
}
GtkWidget *
xedit_spell_language_dialog_new (GtkWindow *parent,
const XeditSpellCheckerLanguage *cur_lang,
xed_spell_language_dialog_new (GtkWindow *parent,
const XedSpellCheckerLanguage *cur_lang,
const gchar *data_dir)
{
XeditSpellLanguageDialog *dlg;
XedSpellLanguageDialog *dlg;
g_return_val_if_fail (GTK_IS_WINDOW (parent), NULL);
dlg = g_object_new (XEDIT_TYPE_SPELL_LANGUAGE_DIALOG, NULL);
dlg = g_object_new (XED_TYPE_SPELL_LANGUAGE_DIALOG, NULL);
create_dialog (dlg, data_dir);
@@ -281,11 +281,11 @@ xedit_spell_language_dialog_new (GtkWindow *parent,
return GTK_WIDGET (dlg);
}
const XeditSpellCheckerLanguage *
xedit_spell_language_get_selected_language (XeditSpellLanguageDialog *dlg)
const XedSpellCheckerLanguage *
xed_spell_language_get_selected_language (XedSpellLanguageDialog *dlg)
{
GValue value = {0, };
const XeditSpellCheckerLanguage* lang;
const XedSpellCheckerLanguage* lang;
GtkTreeIter iter;
GtkTreeSelection *selection;
@@ -301,7 +301,7 @@ xedit_spell_language_get_selected_language (XeditSpellLanguageDialog *dlg)
COLUMN_LANGUAGE_POINTER,
&value);
lang = (const XeditSpellCheckerLanguage* ) g_value_get_pointer (&value);
lang = (const XedSpellCheckerLanguage* ) g_value_get_pointer (&value);
return lang;
}

View File

@@ -0,0 +1,67 @@
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* xed-spell-language-dialog.h
* This file is part of xed
*
* Copyright (C) 2002 Paolo Maggi
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
/*
* Modified by the xed Team, 2002. See the AUTHORS file for a
* list of people on the xed Team.
* See the ChangeLog files for a list of changes.
*/
#ifndef __XED_SPELL_LANGUAGE_DIALOG_H__
#define __XED_SPELL_LANGUAGE_DIALOG_H__
#include <gtk/gtk.h>
#include "xed-spell-checker-language.h"
G_BEGIN_DECLS
#define XED_TYPE_SPELL_LANGUAGE_DIALOG (xed_spell_language_dialog_get_type())
#define XED_SPELL_LANGUAGE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), XED_TYPE_SPELL_LANGUAGE_DIALOG, XedSpellLanguageDialog))
#define XED_SPELL_LANGUAGE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), XED_TYPE_SPELL_LANGUAGE_DIALOG, XedSpellLanguageDialogClass))
#define XED_IS_SPELL_LANGUAGE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), XED_TYPE_SPELL_LANGUAGE_DIALOG))
#define XED_IS_SPELL_LANGUAGE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XED_TYPE_SPELL_LANGUAGE_DIALOG))
#define XED_SPELL_LANGUAGE_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), XED_TYPE_SPELL_LANGUAGE_DIALOG, XedSpellLanguageDialogClass))
typedef struct _XedSpellLanguageDialog XedSpellLanguageDialog;
typedef struct _XedSpellLanguageDialogClass XedSpellLanguageDialogClass;
struct _XedSpellLanguageDialogClass
{
GtkDialogClass parent_class;
};
GType xed_spell_language_dialog_get_type (void) G_GNUC_CONST;
GtkWidget *xed_spell_language_dialog_new (GtkWindow *parent,
const XedSpellCheckerLanguage *cur_lang,
const gchar *data_dir);
const XedSpellCheckerLanguage *
xed_spell_language_get_selected_language (XedSpellLanguageDialog *dlg);
G_END_DECLS
#endif /* __XED_SPELL_LANGUAGE_DIALOG_H__ */

View File

@@ -0,0 +1,77 @@
/*
* xed-spell-plugin.h
*
* Copyright (C) 2002-2005 Paolo Maggi
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $Id$
*/
#ifndef __XED_SPELL_PLUGIN_H__
#define __XED_SPELL_PLUGIN_H__
#include <glib.h>
#include <glib-object.h>
#include <xed/xed-plugin.h>
G_BEGIN_DECLS
/*
* Type checking and casting macros
*/
#define XED_TYPE_SPELL_PLUGIN (xed_spell_plugin_get_type ())
#define XED_SPELL_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XED_TYPE_SPELL_PLUGIN, XedSpellPlugin))
#define XED_SPELL_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XED_TYPE_SPELL_PLUGIN, XedSpellPluginClass))
#define XED_IS_SPELL_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XED_TYPE_SPELL_PLUGIN))
#define XED_IS_SPELL_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XED_TYPE_SPELL_PLUGIN))
#define XED_SPELL_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XED_TYPE_SPELL_PLUGIN, XedSpellPluginClass))
/* Private structure type */
typedef struct _XedSpellPluginPrivate XedSpellPluginPrivate;
/*
* Main object structure
*/
typedef struct _XedSpellPlugin XedSpellPlugin;
struct _XedSpellPlugin
{
XedPlugin parent_instance;
XedSpellPluginPrivate *priv;
};
/*
* Class definition
*/
typedef struct _XedSpellPluginClass XedSpellPluginClass;
struct _XedSpellPluginClass
{
XedPluginClass parent_class;
};
/*
* Public methods
*/
GType xed_spell_plugin_get_type (void) G_GNUC_CONST;
/* All the plugins must implement this function */
G_MODULE_EXPORT GType register_xed_plugin (GTypeModule *module);
G_END_DECLS
#endif /* __XED_SPELL_PLUGIN_H__ */

View File

@@ -1,6 +1,6 @@
/*
* xedit-spell-utils.c
* This file is part of xedit
* xed-spell-utils.c
* This file is part of xed
*
* Copyright (C) 2010 - Jesse van den Kieboom
*
@@ -22,11 +22,11 @@
#include <string.h>
#include "xedit-spell-utils.h"
#include "xed-spell-utils.h"
#include <gtksourceview/gtksourcebuffer.h>
gboolean
xedit_spell_utils_is_digit (const char *text, gssize length)
xed_spell_utils_is_digit (const char *text, gssize length)
{
gunichar c;
const gchar *p;
@@ -56,7 +56,7 @@ xedit_spell_utils_is_digit (const char *text, gssize length)
}
gboolean
xedit_spell_utils_skip_no_spell_check (GtkTextIter *start,
xed_spell_utils_skip_no_spell_check (GtkTextIter *start,
GtkTextIter *end)
{
GtkSourceBuffer *buffer = GTK_SOURCE_BUFFER (gtk_text_iter_get_buffer (start));

View File

@@ -1,6 +1,6 @@
/*
* xedit-spell-utils.h
* This file is part of xedit
* xed-spell-utils.h
* This file is part of xed
*
* Copyright (C) 2010 - Jesse van den Kieboom
*
@@ -20,18 +20,18 @@
* Boston, MA 02110-1301 USA
*/
#ifndef __XEDIT_SPELL_UTILS_H__
#define __XEDIT_SPELL_UTILS_H__
#ifndef __XED_SPELL_UTILS_H__
#define __XED_SPELL_UTILS_H__
#include <gtk/gtk.h>
G_BEGIN_DECLS
gboolean xedit_spell_utils_is_digit (const char *text, gssize length);
gboolean xed_spell_utils_is_digit (const char *text, gssize length);
gboolean xedit_spell_utils_skip_no_spell_check (GtkTextIter *start, GtkTextIter *end);
gboolean xed_spell_utils_skip_no_spell_check (GtkTextIter *start, GtkTextIter *end);
G_END_DECLS
#endif /* __XEDIT_SPELL_UTILS_H__ */
#endif /* __XED_SPELL_UTILS_H__ */

View File

@@ -1,67 +0,0 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* xedit-automatic-spell-checker.h
* This file is part of xedit
*
* Copyright (C) 2002 Paolo Maggi
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
/*
* Modified by the xedit Team, 2002. See the AUTHORS file for a
* list of people on the xedit Team.
* See the ChangeLog files for a list of changes.
*/
/* This is a modified version of gtkspell 2.0.2 (gtkspell.sf.net) */
/* gtkspell - a spell-checking addon for GTK's TextView widget
* Copyright (c) 2002 Evan Martin.
*/
#ifndef __XEDIT_AUTOMATIC_SPELL_CHECKER_H__
#define __XEDIT_AUTOMATIC_SPELL_CHECKER_H__
#include <xedit/xedit-document.h>
#include <xedit/xedit-view.h>
#include "xedit-spell-checker.h"
typedef struct _XeditAutomaticSpellChecker XeditAutomaticSpellChecker;
XeditAutomaticSpellChecker *xedit_automatic_spell_checker_new (
XeditDocument *doc,
XeditSpellChecker *checker);
XeditAutomaticSpellChecker *xedit_automatic_spell_checker_get_from_document (
const XeditDocument *doc);
void xedit_automatic_spell_checker_free (
XeditAutomaticSpellChecker *spell);
void xedit_automatic_spell_checker_attach_view (
XeditAutomaticSpellChecker *spell,
XeditView *view);
void xedit_automatic_spell_checker_detach_view (
XeditAutomaticSpellChecker *spell,
XeditView *view);
void xedit_automatic_spell_checker_recheck_all (
XeditAutomaticSpellChecker *spell);
#endif /* __XEDIT_AUTOMATIC_SPELL_CHECKER_H__ */

View File

@@ -1,92 +0,0 @@
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* xedit-spell-checker-dialog.h
* This file is part of xedit
*
* Copyright (C) 2002 Paolo Maggi
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
/*
* Modified by the xedit Team, 2002. See the AUTHORS file for a
* list of people on the xedit Team.
* See the ChangeLog files for a list of changes.
*/
#ifndef __XEDIT_SPELL_CHECKER_DIALOG_H__
#define __XEDIT_SPELL_CHECKER_DIALOG_H__
#include <gtk/gtk.h>
#include "xedit-spell-checker.h"
G_BEGIN_DECLS
#define XEDIT_TYPE_SPELL_CHECKER_DIALOG (xedit_spell_checker_dialog_get_type ())
#define XEDIT_SPELL_CHECKER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XEDIT_TYPE_SPELL_CHECKER_DIALOG, XeditSpellCheckerDialog))
#define XEDIT_SPELL_CHECKER_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XEDIT_TYPE_SPELL_CHECKER_DIALOG, XeditSpellCheckerDialog))
#define XEDIT_IS_SPELL_CHECKER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XEDIT_TYPE_SPELL_CHECKER_DIALOG))
#define XEDIT_IS_SPELL_CHECKER_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XEDIT_TYPE_SPELL_CHECKER_DIALOG))
#define XEDIT_SPELL_CHECKER_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XEDIT_TYPE_SPELL_CHECKER_DIALOG, XeditSpellCheckerDialog))
typedef struct _XeditSpellCheckerDialog XeditSpellCheckerDialog;
typedef struct _XeditSpellCheckerDialogClass XeditSpellCheckerDialogClass;
struct _XeditSpellCheckerDialogClass
{
GtkWindowClass parent_class;
/* Signals */
void (*ignore) (XeditSpellCheckerDialog *dlg,
const gchar *word);
void (*ignore_all) (XeditSpellCheckerDialog *dlg,
const gchar *word);
void (*change) (XeditSpellCheckerDialog *dlg,
const gchar *word,
const gchar *change_to);
void (*change_all) (XeditSpellCheckerDialog *dlg,
const gchar *word,
const gchar *change_to);
void (*add_word_to_personal) (XeditSpellCheckerDialog *dlg,
const gchar *word);
};
GType xedit_spell_checker_dialog_get_type (void) G_GNUC_CONST;
/* Constructors */
GtkWidget *xedit_spell_checker_dialog_new (const gchar *data_dir);
GtkWidget *xedit_spell_checker_dialog_new_from_spell_checker
(XeditSpellChecker *spell,
const gchar *data_dir);
void xedit_spell_checker_dialog_set_spell_checker
(XeditSpellCheckerDialog *dlg,
XeditSpellChecker *spell);
void xedit_spell_checker_dialog_set_misspelled_word
(XeditSpellCheckerDialog *dlg,
const gchar* word,
gint len);
void xedit_spell_checker_dialog_set_completed
(XeditSpellCheckerDialog *dlg);
G_END_DECLS
#endif /* __XEDIT_SPELL_CHECKER_DIALOG_H__ */

View File

@@ -1,109 +0,0 @@
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* xedit-spell-checker.h
* This file is part of xedit
*
* Copyright (C) 2002-2006 Paolo Maggi
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
/*
* Modified by the xedit Team, 2002. See the AUTHORS file for a
* list of people on the xedit Team.
* See the ChangeLog files for a list of changes.
*/
#ifndef __XEDIT_SPELL_CHECKER_H__
#define __XEDIT_SPELL_CHECKER_H__
#include <glib.h>
#include <glib-object.h>
#include "xedit-spell-checker-language.h"
G_BEGIN_DECLS
#define XEDIT_TYPE_SPELL_CHECKER (xedit_spell_checker_get_type ())
#define XEDIT_SPELL_CHECKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XEDIT_TYPE_SPELL_CHECKER, XeditSpellChecker))
#define XEDIT_SPELL_CHECKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XEDIT_TYPE_SPELL_CHECKER, XeditSpellChecker))
#define XEDIT_IS_SPELL_CHECKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XEDIT_TYPE_SPELL_CHECKER))
#define XEDIT_IS_SPELL_CHECKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XEDIT_TYPE_SPELL_CHECKER))
#define XEDIT_SPELL_CHECKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XEDIT_TYPE_SPELL_CHECKER, XeditSpellChecker))
typedef struct _XeditSpellChecker XeditSpellChecker;
typedef struct _XeditSpellCheckerClass XeditSpellCheckerClass;
struct _XeditSpellCheckerClass
{
GObjectClass parent_class;
/* Signals */
void (*add_word_to_personal) (XeditSpellChecker *spell,
const gchar *word,
gint len);
void (*add_word_to_session) (XeditSpellChecker *spell,
const gchar *word,
gint len);
void (*set_language) (XeditSpellChecker *spell,
const XeditSpellCheckerLanguage *lang);
void (*clear_session) (XeditSpellChecker *spell);
};
GType xedit_spell_checker_get_type (void) G_GNUC_CONST;
/* Constructors */
XeditSpellChecker *xedit_spell_checker_new (void);
gboolean xedit_spell_checker_set_language (XeditSpellChecker *spell,
const XeditSpellCheckerLanguage *lang);
const XeditSpellCheckerLanguage
*xedit_spell_checker_get_language (XeditSpellChecker *spell);
gboolean xedit_spell_checker_check_word (XeditSpellChecker *spell,
const gchar *word,
gssize len);
GSList *xedit_spell_checker_get_suggestions (XeditSpellChecker *spell,
const gchar *word,
gssize len);
gboolean xedit_spell_checker_add_word_to_personal
(XeditSpellChecker *spell,
const gchar *word,
gssize len);
gboolean xedit_spell_checker_add_word_to_session
(XeditSpellChecker *spell,
const gchar *word,
gssize len);
gboolean xedit_spell_checker_clear_session (XeditSpellChecker *spell);
gboolean xedit_spell_checker_set_correction (XeditSpellChecker *spell,
const gchar *word,
gssize w_len,
const gchar *replacement,
gssize r_len);
G_END_DECLS
#endif /* __XEDIT_SPELL_CHECKER_H__ */

View File

@@ -1,67 +0,0 @@
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* xedit-spell-language-dialog.h
* This file is part of xedit
*
* Copyright (C) 2002 Paolo Maggi
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
/*
* Modified by the xedit Team, 2002. See the AUTHORS file for a
* list of people on the xedit Team.
* See the ChangeLog files for a list of changes.
*/
#ifndef __XEDIT_SPELL_LANGUAGE_DIALOG_H__
#define __XEDIT_SPELL_LANGUAGE_DIALOG_H__
#include <gtk/gtk.h>
#include "xedit-spell-checker-language.h"
G_BEGIN_DECLS
#define XEDIT_TYPE_SPELL_LANGUAGE_DIALOG (xedit_spell_language_dialog_get_type())
#define XEDIT_SPELL_LANGUAGE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), XEDIT_TYPE_SPELL_LANGUAGE_DIALOG, XeditSpellLanguageDialog))
#define XEDIT_SPELL_LANGUAGE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), XEDIT_TYPE_SPELL_LANGUAGE_DIALOG, XeditSpellLanguageDialogClass))
#define XEDIT_IS_SPELL_LANGUAGE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), XEDIT_TYPE_SPELL_LANGUAGE_DIALOG))
#define XEDIT_IS_SPELL_LANGUAGE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XEDIT_TYPE_SPELL_LANGUAGE_DIALOG))
#define XEDIT_SPELL_LANGUAGE_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), XEDIT_TYPE_SPELL_LANGUAGE_DIALOG, XeditSpellLanguageDialogClass))
typedef struct _XeditSpellLanguageDialog XeditSpellLanguageDialog;
typedef struct _XeditSpellLanguageDialogClass XeditSpellLanguageDialogClass;
struct _XeditSpellLanguageDialogClass
{
GtkDialogClass parent_class;
};
GType xedit_spell_language_dialog_get_type (void) G_GNUC_CONST;
GtkWidget *xedit_spell_language_dialog_new (GtkWindow *parent,
const XeditSpellCheckerLanguage *cur_lang,
const gchar *data_dir);
const XeditSpellCheckerLanguage *
xedit_spell_language_get_selected_language (XeditSpellLanguageDialog *dlg);
G_END_DECLS
#endif /* __XEDIT_SPELL_LANGUAGE_DIALOG_H__ */

View File

@@ -1,77 +0,0 @@
/*
* xedit-spell-plugin.h
*
* Copyright (C) 2002-2005 Paolo Maggi
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $Id$
*/
#ifndef __XEDIT_SPELL_PLUGIN_H__
#define __XEDIT_SPELL_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_SPELL_PLUGIN (xedit_spell_plugin_get_type ())
#define XEDIT_SPELL_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XEDIT_TYPE_SPELL_PLUGIN, XeditSpellPlugin))
#define XEDIT_SPELL_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XEDIT_TYPE_SPELL_PLUGIN, XeditSpellPluginClass))
#define XEDIT_IS_SPELL_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XEDIT_TYPE_SPELL_PLUGIN))
#define XEDIT_IS_SPELL_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XEDIT_TYPE_SPELL_PLUGIN))
#define XEDIT_SPELL_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XEDIT_TYPE_SPELL_PLUGIN, XeditSpellPluginClass))
/* Private structure type */
typedef struct _XeditSpellPluginPrivate XeditSpellPluginPrivate;
/*
* Main object structure
*/
typedef struct _XeditSpellPlugin XeditSpellPlugin;
struct _XeditSpellPlugin
{
XeditPlugin parent_instance;
XeditSpellPluginPrivate *priv;
};
/*
* Class definition
*/
typedef struct _XeditSpellPluginClass XeditSpellPluginClass;
struct _XeditSpellPluginClass
{
XeditPluginClass parent_class;
};
/*
* Public methods
*/
GType xedit_spell_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_SPELL_PLUGIN_H__ */

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<TagList xmlns="http://xedit.sourceforge.net/some-location">
<TagList xmlns="http://xed.sourceforge.net/some-location">
<TagGroup _name="XHTML 1.0 - Tags" sort="true">
<Tag _name="Abbreviated form">

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<TagList xmlns="http://xedit.sourceforge.net/some-location">
<TagList xmlns="http://xed.sourceforge.net/some-location">
<TagGroup _name="Latex - Tags" sort="true">
<Tag _name="Bibliography (cite)">
<Begin>\cite{ </Begin>

View File

@@ -1,7 +1,7 @@
# Tag list plugin
plugindir = $(XEDIT_PLUGINS_LIBS_DIR)
plugindir = $(XED_PLUGINS_LIBS_DIR)
taglistdir = $(XEDIT_PLUGINS_DATA_DIR)/taglist
taglistdir = $(XED_PLUGINS_DATA_DIR)/taglist
taglist_in_files = \
HTML.tags.xml.in \
@@ -13,26 +13,26 @@ taglist_DATA = $(taglist_in_files:.tags.xml.in=.tags.gz)
AM_CPPFLAGS = \
-I$(top_srcdir) \
$(XEDIT_CFLAGS) \
$(XED_CFLAGS) \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS)
plugin_LTLIBRARIES = libtaglist.la
libtaglist_la_SOURCES = \
xedit-taglist-plugin-parser.c \
xedit-taglist-plugin-parser.h \
xedit-taglist-plugin-panel.c \
xedit-taglist-plugin-panel.h \
xedit-taglist-plugin.c \
xedit-taglist-plugin.h
xed-taglist-plugin-parser.c \
xed-taglist-plugin-parser.h \
xed-taglist-plugin-panel.c \
xed-taglist-plugin-panel.h \
xed-taglist-plugin.c \
xed-taglist-plugin.h
libtaglist_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
libtaglist_la_LIBADD = $(XEDIT_LIBS)
libtaglist_la_LIBADD = $(XED_LIBS)
plugin_in_files = taglist.xedit-plugin.desktop.in
plugin_in_files = taglist.xed-plugin.desktop.in
%.xedit-plugin: %.xedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po)
%.xed-plugin: %.xed-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po)
$(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
GZIP_ENV = -9
@@ -41,7 +41,7 @@ GZIP_ENV = -9
LC_ALL=C $(INTLTOOL_MERGE) $(top_srcdir)/po $< $(@:.gz=) -x -u -c $(top_builddir)/po/.intltool-merge-cache
GZIP=$(GZIP_ENV) gzip -n -f $(@:.gz=)
plugin_DATA = $(plugin_in_files:.xedit-plugin.desktop.in=.xedit-plugin)
plugin_DATA = $(plugin_in_files:.xed-plugin.desktop.in=.xed-plugin)
EXTRA_DIST = \
$(taglist_in_files) $(taglist_DATA) \

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
XSLT Tags for xedit
XSLT Tags for xed
Jens Askengren <jensus@linux.nu>
-->
<TagList xmlns="http://xedit.sourceforge.net/some-location">
<TagList xmlns="http://xed.sourceforge.net/some-location">
<TagGroup _name="XSLT - Elements" sort="true">
<Tag name="apply-imports">
<Begin>&lt;xsl:apply-imports&gt;</Begin>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<TagList xmlns="http://xedit.sourceforge.net/some-location">
<TagList xmlns="http://xed.sourceforge.net/some-location">
<TagGroup _name="XUL - Tags" sort="true">
<Tag name="action">

View File

@@ -1,4 +1,4 @@
[Xedit Plugin]
[Xed Plugin]
Module=taglist
IAge=2
_Name=Tag list

View File

@@ -1,6 +1,6 @@
/*
* xedit-taglist-plugin-panel.c
* This file is part of xedit
* xed-taglist-plugin-panel.c
* This file is part of xed
*
* Copyright (C) 2005 - Paolo Maggi
*
@@ -21,8 +21,8 @@
*/
/*
* Modified by the xedit Team, 2005. See the AUTHORS file for a
* list of people on the xedit Team.
* Modified by the xed Team, 2005. See the AUTHORS file for a
* list of people on the xed Team.
* See the ChangeLog files for a list of changes.
*
* $Id$
@@ -34,20 +34,20 @@
#include <string.h>
#include "xedit-taglist-plugin-panel.h"
#include "xedit-taglist-plugin-parser.h"
#include "xed-taglist-plugin-panel.h"
#include "xed-taglist-plugin-parser.h"
#include <xedit/xedit-utils.h>
#include <xedit/xedit-debug.h>
#include <xedit/xedit-plugin.h>
#include <xed/xed-utils.h>
#include <xed/xed-debug.h>
#include <xed/xed-plugin.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include <glib/gi18n.h>
#define XEDIT_TAGLIST_PLUGIN_PANEL_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \
XEDIT_TYPE_TAGLIST_PLUGIN_PANEL, \
XeditTaglistPluginPanelPrivate))
#define XED_TAGLIST_PLUGIN_PANEL_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \
XED_TYPE_TAGLIST_PLUGIN_PANEL, \
XedTaglistPluginPanelPrivate))
enum
{
@@ -56,9 +56,9 @@ enum
NUM_COLUMNS
};
struct _XeditTaglistPluginPanelPrivate
struct _XedTaglistPluginPanelPrivate
{
XeditWindow *window;
XedWindow *window;
GtkWidget *tag_groups_combo;
GtkWidget *tags_list;
@@ -70,9 +70,9 @@ struct _XeditTaglistPluginPanelPrivate
};
#if GTK_CHECK_VERSION (3, 0, 0)
XEDIT_PLUGIN_DEFINE_TYPE (XeditTaglistPluginPanel, xedit_taglist_plugin_panel, GTK_TYPE_BOX)
XED_PLUGIN_DEFINE_TYPE (XedTaglistPluginPanel, xed_taglist_plugin_panel, GTK_TYPE_BOX)
#else
XEDIT_PLUGIN_DEFINE_TYPE (XeditTaglistPluginPanel, xedit_taglist_plugin_panel, GTK_TYPE_VBOX)
XED_PLUGIN_DEFINE_TYPE (XedTaglistPluginPanel, xed_taglist_plugin_panel, GTK_TYPE_VBOX)
#endif
enum
@@ -82,11 +82,11 @@ enum
};
static void
set_window (XeditTaglistPluginPanel *panel,
XeditWindow *window)
set_window (XedTaglistPluginPanel *panel,
XedWindow *window)
{
g_return_if_fail (panel->priv->window == NULL);
g_return_if_fail (XEDIT_IS_WINDOW (window));
g_return_if_fail (XED_IS_WINDOW (window));
panel->priv->window = window;
@@ -94,12 +94,12 @@ set_window (XeditTaglistPluginPanel *panel,
}
static void
xedit_taglist_plugin_panel_set_property (GObject *object,
xed_taglist_plugin_panel_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
XeditTaglistPluginPanel *panel = XEDIT_TAGLIST_PLUGIN_PANEL (object);
XedTaglistPluginPanel *panel = XED_TAGLIST_PLUGIN_PANEL (object);
switch (prop_id)
{
@@ -114,18 +114,18 @@ xedit_taglist_plugin_panel_set_property (GObject *object,
}
static void
xedit_taglist_plugin_panel_get_property (GObject *object,
xed_taglist_plugin_panel_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
XeditTaglistPluginPanel *panel = XEDIT_TAGLIST_PLUGIN_PANEL (object);
XedTaglistPluginPanel *panel = XED_TAGLIST_PLUGIN_PANEL (object);
switch (prop_id)
{
case PROP_WINDOW:
g_value_set_object (value,
XEDIT_TAGLIST_PLUGIN_PANEL_GET_PRIVATE (panel)->window);
XED_TAGLIST_PLUGIN_PANEL_GET_PRIVATE (panel)->window);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -134,50 +134,50 @@ xedit_taglist_plugin_panel_get_property (GObject *object,
}
static void
xedit_taglist_plugin_panel_finalize (GObject *object)
xed_taglist_plugin_panel_finalize (GObject *object)
{
XeditTaglistPluginPanel *panel = XEDIT_TAGLIST_PLUGIN_PANEL (object);
XedTaglistPluginPanel *panel = XED_TAGLIST_PLUGIN_PANEL (object);
g_free (panel->priv->data_dir);
G_OBJECT_CLASS (xedit_taglist_plugin_panel_parent_class)->finalize (object);
G_OBJECT_CLASS (xed_taglist_plugin_panel_parent_class)->finalize (object);
}
static void
xedit_taglist_plugin_panel_class_init (XeditTaglistPluginPanelClass *klass)
xed_taglist_plugin_panel_class_init (XedTaglistPluginPanelClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = xedit_taglist_plugin_panel_finalize;
object_class->get_property = xedit_taglist_plugin_panel_get_property;
object_class->set_property = xedit_taglist_plugin_panel_set_property;
object_class->finalize = xed_taglist_plugin_panel_finalize;
object_class->get_property = xed_taglist_plugin_panel_get_property;
object_class->set_property = xed_taglist_plugin_panel_set_property;
g_object_class_install_property (object_class,
PROP_WINDOW,
g_param_spec_object ("window",
"Window",
"The XeditWindow this XeditTaglistPluginPanel is associated with",
XEDIT_TYPE_WINDOW,
"The XedWindow this XedTaglistPluginPanel is associated with",
XED_TYPE_WINDOW,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
g_type_class_add_private (object_class, sizeof(XeditTaglistPluginPanelPrivate));
g_type_class_add_private (object_class, sizeof(XedTaglistPluginPanelPrivate));
}
static void
insert_tag (XeditTaglistPluginPanel *panel,
insert_tag (XedTaglistPluginPanel *panel,
Tag *tag,
gboolean grab_focus)
{
XeditView *view;
XedView *view;
GtkTextBuffer *buffer;
GtkTextIter start, end;
GtkTextIter cursor;
gboolean sel = FALSE;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
view = xedit_window_get_active_view (panel->priv->window);
view = xed_window_get_active_view (panel->priv->window);
g_return_if_fail (view != NULL);
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
@@ -247,13 +247,13 @@ static void
tag_list_row_activated_cb (GtkTreeView *tag_list,
GtkTreePath *path,
GtkTreeViewColumn *column,
XeditTaglistPluginPanel *panel)
XedTaglistPluginPanel *panel)
{
GtkTreeIter iter;
GtkTreeModel *model;
gint index;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
model = gtk_tree_view_get_model (tag_list);
@@ -262,7 +262,7 @@ tag_list_row_activated_cb (GtkTreeView *tag_list,
gtk_tree_model_get (model, &iter, COLUMN_TAG_INDEX_IN_GROUP, &index, -1);
xedit_debug_message (DEBUG_PLUGINS, "Index: %d", index);
xed_debug_message (DEBUG_PLUGINS, "Index: %d", index);
insert_tag (panel,
(Tag*)g_list_nth_data (panel->priv->selected_tag_group->tags, index),
@@ -272,7 +272,7 @@ tag_list_row_activated_cb (GtkTreeView *tag_list,
static gboolean
tag_list_key_press_event_cb (GtkTreeView *tag_list,
GdkEventKey *event,
XeditTaglistPluginPanel *panel)
XedTaglistPluginPanel *panel)
{
gboolean grab_focus;
@@ -285,7 +285,7 @@ tag_list_key_press_event_cb (GtkTreeView *tag_list,
GtkTreeIter iter;
gint index;
xedit_debug_message (DEBUG_PLUGINS, "RETURN Pressed");
xed_debug_message (DEBUG_PLUGINS, "RETURN Pressed");
model = gtk_tree_view_get_model (tag_list);
@@ -295,7 +295,7 @@ tag_list_key_press_event_cb (GtkTreeView *tag_list,
{
gtk_tree_model_get (model, &iter, COLUMN_TAG_INDEX_IN_GROUP, &index, -1);
xedit_debug_message (DEBUG_PLUGINS, "Index: %d", index);
xed_debug_message (DEBUG_PLUGINS, "Index: %d", index);
insert_tag (panel,
(Tag*)g_list_nth_data (panel->priv->selected_tag_group->tags, index),
@@ -309,14 +309,14 @@ tag_list_key_press_event_cb (GtkTreeView *tag_list,
}
static GtkTreeModel*
create_model (XeditTaglistPluginPanel *panel)
create_model (XedTaglistPluginPanel *panel)
{
gint i = 0;
GtkListStore *store;
GtkTreeIter iter;
GList *list;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
/* create list store */
store = gtk_list_store_new (NUM_COLUMNS, G_TYPE_STRING, G_TYPE_INT);
@@ -330,7 +330,7 @@ create_model (XeditTaglistPluginPanel *panel)
tag_name = (gchar *)((Tag*)list->data)->name;
xedit_debug_message (DEBUG_PLUGINS, "%d : %s", i, tag_name);
xed_debug_message (DEBUG_PLUGINS, "%d : %s", i, tag_name);
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
@@ -342,18 +342,18 @@ create_model (XeditTaglistPluginPanel *panel)
list = g_list_next (list);
}
xedit_debug_message (DEBUG_PLUGINS, "Rows: %d ",
xed_debug_message (DEBUG_PLUGINS, "Rows: %d ",
gtk_tree_model_iter_n_children (GTK_TREE_MODEL (store), NULL));
return GTK_TREE_MODEL (store);
}
static void
populate_tags_list (XeditTaglistPluginPanel *panel)
populate_tags_list (XedTaglistPluginPanel *panel)
{
GtkTreeModel* model;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
g_return_if_fail (taglist != NULL);
@@ -368,7 +368,7 @@ find_tag_group (const gchar *name)
{
GList *l;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
g_return_val_if_fail (taglist != NULL, NULL);
@@ -382,13 +382,13 @@ find_tag_group (const gchar *name)
}
static void
populate_tag_groups_combo (XeditTaglistPluginPanel *panel)
populate_tag_groups_combo (XedTaglistPluginPanel *panel)
{
GList *l;
GtkComboBox *combo;
GtkComboBoxText *combotext;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
combo = GTK_COMBO_BOX (panel->priv->tag_groups_combo);
combotext = GTK_COMBO_BOX_TEXT (panel->priv->tag_groups_combo);
@@ -409,11 +409,11 @@ populate_tag_groups_combo (XeditTaglistPluginPanel *panel)
static void
selected_group_changed (GtkComboBox *combo,
XeditTaglistPluginPanel *panel)
XedTaglistPluginPanel *panel)
{
gchar* group_name;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
group_name = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (combo));
@@ -429,7 +429,7 @@ selected_group_changed (GtkComboBox *combo,
panel->priv->selected_tag_group = find_tag_group (group_name);
g_return_if_fail (panel->priv->selected_tag_group != NULL);
xedit_debug_message (DEBUG_PLUGINS,
xed_debug_message (DEBUG_PLUGINS,
"New selected group: %s",
panel->priv->selected_tag_group->name);
@@ -474,7 +474,7 @@ create_preview_string (Tag *tag)
}
static void
update_preview (XeditTaglistPluginPanel *panel,
update_preview (XedTaglistPluginPanel *panel,
Tag *tag)
{
gchar *str;
@@ -496,7 +496,7 @@ tag_list_cursor_changed_cb (GtkTreeView *tag_list,
GtkTreeIter iter;
gint index;
XeditTaglistPluginPanel *panel = (XeditTaglistPluginPanel *)data;
XedTaglistPluginPanel *panel = (XedTaglistPluginPanel *)data;
model = gtk_tree_view_get_model (tag_list);
@@ -506,7 +506,7 @@ tag_list_cursor_changed_cb (GtkTreeView *tag_list,
{
gtk_tree_model_get (model, &iter, COLUMN_TAG_INDEX_IN_GROUP, &index, -1);
xedit_debug_message (DEBUG_PLUGINS, "Index: %d", index);
xed_debug_message (DEBUG_PLUGINS, "Index: %d", index);
update_preview (panel,
(Tag*)g_list_nth_data (panel->priv->selected_tag_group->tags, index));
@@ -519,7 +519,7 @@ tags_list_query_tooltip_cb (GtkWidget *widget,
gint y,
gboolean keyboard_tip,
GtkTooltip *tooltip,
XeditTaglistPluginPanel *panel)
XedTaglistPluginPanel *panel)
{
GtkTreeIter iter;
GtkTreeModel *model;
@@ -590,16 +590,16 @@ expose_event_cb (GtkWidget *panel,
#endif
gpointer user_data)
{
XeditTaglistPluginPanel *ppanel = XEDIT_TAGLIST_PLUGIN_PANEL (panel);
XedTaglistPluginPanel *ppanel = XED_TAGLIST_PLUGIN_PANEL (panel);
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
/* If needed load taglists from files at the first expose */
if (taglist == NULL)
create_taglist (ppanel->priv->data_dir);
/* And populate combo box */
populate_tag_groups_combo (XEDIT_TAGLIST_PLUGIN_PANEL (panel));
populate_tag_groups_combo (XED_TAGLIST_PLUGIN_PANEL (panel));
#if GTK_CHECK_VERSION (3, 0, 0)
/* We need to manage only the first draw -> disconnect */
@@ -633,7 +633,7 @@ realize_tag_groups_combo (GtkWidget *combo,
}
static void
add_preview_widget (XeditTaglistPluginPanel *panel)
add_preview_widget (XedTaglistPluginPanel *panel)
{
GtkWidget *expander;
GtkWidget *frame;
@@ -676,16 +676,16 @@ add_preview_widget (XeditTaglistPluginPanel *panel)
}
static void
xedit_taglist_plugin_panel_init (XeditTaglistPluginPanel *panel)
xed_taglist_plugin_panel_init (XedTaglistPluginPanel *panel)
{
GtkWidget *sw;
GtkTreeViewColumn *column;
GtkCellRenderer *cell;
GList *focus_chain = NULL;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
panel->priv = XEDIT_TAGLIST_PLUGIN_PANEL_GET_PRIVATE (panel);
panel->priv = XED_TAGLIST_PLUGIN_PANEL_GET_PRIVATE (panel);
panel->priv->data_dir = NULL;
#if GTK_CHECK_VERSION (3, 0, 0)
@@ -718,16 +718,16 @@ xedit_taglist_plugin_panel_init (XeditTaglistPluginPanel *panel)
/* Create tree view */
panel->priv->tags_list = gtk_tree_view_new ();
xedit_utils_set_atk_name_description (panel->priv->tag_groups_combo,
xed_utils_set_atk_name_description (panel->priv->tag_groups_combo,
_("Available Tag Lists"),
NULL);
xedit_utils_set_atk_name_description (panel->priv->tags_list,
xed_utils_set_atk_name_description (panel->priv->tags_list,
_("Tags"),
NULL);
xedit_utils_set_atk_relation (panel->priv->tag_groups_combo,
xed_utils_set_atk_relation (panel->priv->tag_groups_combo,
panel->priv->tags_list,
ATK_RELATION_CONTROLLER_FOR);
xedit_utils_set_atk_relation (panel->priv->tags_list,
xed_utils_set_atk_relation (panel->priv->tags_list,
panel->priv->tag_groups_combo,
ATK_RELATION_CONTROLLED_BY);
@@ -795,14 +795,14 @@ xedit_taglist_plugin_panel_init (XeditTaglistPluginPanel *panel)
}
GtkWidget *
xedit_taglist_plugin_panel_new (XeditWindow *window,
xed_taglist_plugin_panel_new (XedWindow *window,
const gchar *data_dir)
{
XeditTaglistPluginPanel *panel;
XedTaglistPluginPanel *panel;
g_return_val_if_fail (XEDIT_IS_WINDOW (window), NULL);
g_return_val_if_fail (XED_IS_WINDOW (window), NULL);
panel = g_object_new (XEDIT_TYPE_TAGLIST_PLUGIN_PANEL,
panel = g_object_new (XED_TYPE_TAGLIST_PLUGIN_PANEL,
"window", window,
NULL);

View File

@@ -0,0 +1,97 @@
/*
* xed-taglist-plugin-panel.h
* This file is part of xed
*
* Copyright (C) 2005 - Paolo Maggi
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
/*
* Modified by the xed Team, 2005. See the AUTHORS file for a
* list of people on the xed Team.
* See the ChangeLog files for a list of changes.
*
* $Id$
*/
#ifndef __XED_TAGLIST_PLUGIN_PANEL_H__
#define __XED_TAGLIST_PLUGIN_PANEL_H__
#include <gtk/gtk.h>
#include <xed/xed-window.h>
G_BEGIN_DECLS
/*
* Type checking and casting macros
*/
#define XED_TYPE_TAGLIST_PLUGIN_PANEL (xed_taglist_plugin_panel_get_type())
#define XED_TAGLIST_PLUGIN_PANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), XED_TYPE_TAGLIST_PLUGIN_PANEL, XedTaglistPluginPanel))
#define XED_TAGLIST_PLUGIN_PANEL_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), XED_TYPE_TAGLIST_PLUGIN_PANEL, XedTaglistPluginPanel const))
#define XED_TAGLIST_PLUGIN_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), XED_TYPE_TAGLIST_PLUGIN_PANEL, XedTaglistPluginPanelClass))
#define XED_IS_TAGLIST_PLUGIN_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), XED_TYPE_TAGLIST_PLUGIN_PANEL))
#define XED_IS_TAGLIST_PLUGIN_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XED_TYPE_TAGLIST_PLUGIN_PANEL))
#define XED_TAGLIST_PLUGIN_PANEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), XED_TYPE_TAGLIST_PLUGIN_PANEL, XedTaglistPluginPanelClass))
/* Private structure type */
typedef struct _XedTaglistPluginPanelPrivate XedTaglistPluginPanelPrivate;
/*
* Main object structure
*/
typedef struct _XedTaglistPluginPanel XedTaglistPluginPanel;
struct _XedTaglistPluginPanel
{
#if GTK_CHECK_VERSION (3, 0, 0)
GtkBox vbox;
#else
GtkVBox vbox;
#endif
/*< private > */
XedTaglistPluginPanelPrivate *priv;
};
/*
* Class definition
*/
typedef struct _XedTaglistPluginPanelClass XedTaglistPluginPanelClass;
struct _XedTaglistPluginPanelClass
{
#if GTK_CHECK_VERSION (3, 0, 0)
GtkBoxClass parent_class;
#else
GtkVBoxClass parent_class;
#endif
};
/*
* Public methods
*/
GType xed_taglist_plugin_panel_register_type (GTypeModule *module);
GType xed_taglist_plugin_panel_get_type (void) G_GNUC_CONST;
GtkWidget *xed_taglist_plugin_panel_new (XedWindow *window,
const gchar *data_dir);
G_END_DECLS
#endif /* __XED_TAGLIST_PLUGIN_PANEL_H__ */

View File

@@ -1,6 +1,6 @@
/*
* xedit-taglist-plugin-parser.c
* This file is part of xedit
* xed-taglist-plugin-parser.c
* This file is part of xed
*
* Copyright (C) 2002-2005 - Paolo Maggi
*
@@ -21,8 +21,8 @@
*/
/*
* Modified by the xedit Team, 2002-2005. See the AUTHORS file for a
* list of people on the xedit Team.
* Modified by the xed Team, 2002-2005. See the AUTHORS file for a
* list of people on the xed Team.
* See the ChangeLog files for a list of changes.
*
* $Id$
@@ -39,13 +39,13 @@
#include <glib.h>
#include <glib/gi18n.h>
#include <xedit/xedit-debug.h>
#include <xed/xed-debug.h>
#include "xedit-taglist-plugin-parser.h"
#include "xed-taglist-plugin-parser.h"
/* we screwed up so we still look here for compatibility */
#define USER_XEDIT_TAGLIST_PLUGIN_LOCATION_LEGACY ".xedit/plugins/taglist/"
#define USER_XEDIT_TAGLIST_PLUGIN_LOCATION "xedit/taglist/"
#define USER_XED_TAGLIST_PLUGIN_LOCATION_LEGACY ".xed/plugins/taglist/"
#define USER_XED_TAGLIST_PLUGIN_LOCATION "xed/taglist/"
TagList* taglist = NULL;
static gint taglist_ref_count = 0;
@@ -68,7 +68,7 @@ static gboolean
parse_tag (Tag *tag, xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur)
{
/*
xedit_debug_message (DEBUG_PLUGINS, " Tag name: %s", tag->name);
xed_debug_message (DEBUG_PLUGINS, " Tag name: %s", tag->name);
*/
/* We don't care what the top level element name is */
cur = cur->xmlChildrenNode;
@@ -80,7 +80,7 @@ parse_tag (Tag *tag, xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur)
{
tag->begin = xmlNodeListGetString (doc, cur->xmlChildrenNode, 1);
/*
xedit_debug_message (DEBUG_PLUGINS, " - Begin: %s", tag->begin);
xed_debug_message (DEBUG_PLUGINS, " - Begin: %s", tag->begin);
*/
}
@@ -89,7 +89,7 @@ parse_tag (Tag *tag, xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur)
{
tag->end = xmlNodeListGetString (doc, cur->xmlChildrenNode, 1);
/*
xedit_debug_message (DEBUG_PLUGINS, " - End: %s", tag->end);
xed_debug_message (DEBUG_PLUGINS, " - End: %s", tag->end);
*/
}
@@ -115,7 +115,7 @@ static gboolean
parse_tag_group (TagGroup *tg, const gchar* fn, xmlDocPtr doc,
xmlNsPtr ns, xmlNodePtr cur, gboolean sort)
{
xedit_debug_message (DEBUG_PLUGINS, "Parse TagGroup: %s", tg->name);
xed_debug_message (DEBUG_PLUGINS, "Parse TagGroup: %s", tg->name);
/* We don't care what the top level element name is */
cur = cur->xmlChildrenNode;
@@ -227,7 +227,7 @@ get_tag_group (const gchar* filename, xmlDocPtr doc,
if (strcmp (tgn, (gchar*)tag_group->name) == 0)
{
xedit_debug_message (DEBUG_PLUGINS,
xed_debug_message (DEBUG_PLUGINS,
"Tag group '%s' already exists.", tgn);
exists = TRUE;
@@ -271,15 +271,15 @@ groups_cmp (gconstpointer a, gconstpointer b)
/*
* tags file is localized by intltool-merge below.
*
* <xedit:TagGroup name="XSLT - Elements">
* </xedit:TagGroup>
* <xedit:TagGroup xml:lang="am" name="LOCALIZED TEXT">
* </xedit:TagGroup>
* <xedit:TagGroup xml:lang="ar" name="LOCALIZED TEXT">
* </xedit:TagGroup>
* <xed:TagGroup name="XSLT - Elements">
* </xed:TagGroup>
* <xed:TagGroup xml:lang="am" name="LOCALIZED TEXT">
* </xed:TagGroup>
* <xed:TagGroup xml:lang="ar" name="LOCALIZED TEXT">
* </xed:TagGroup>
* .....
* <xedit:TagGroup name="XSLT - Functions">
* </xedit:TagGroup>
* <xed:TagGroup name="XSLT - Functions">
* </xed:TagGroup>
* .....
* Therefore need to pick up the best lang on the current locale.
*/
@@ -419,7 +419,7 @@ parse_taglist_file (const gchar* filename)
xmlNsPtr ns;
xmlNodePtr cur;
xedit_debug_message (DEBUG_PLUGINS, "Parse file: %s", filename);
xed_debug_message (DEBUG_PLUGINS, "Parse file: %s", filename);
xmlKeepBlanksDefault (0);
@@ -448,12 +448,12 @@ parse_taglist_file (const gchar* filename)
}
ns = xmlSearchNsByHref (doc, cur,
(const xmlChar *) "http://xedit.sourceforge.net/some-location");
(const xmlChar *) "http://xed.sourceforge.net/some-location");
if (ns == NULL)
{
g_warning ("The tag list file '%s' is of the wrong type, "
"xedit namespace not found.", filename);
"xed namespace not found.", filename);
xmlFreeDoc (doc);
return taglist;
@@ -479,7 +479,7 @@ parse_taglist_file (const gchar* filename)
xmlFreeDoc (doc);
xedit_debug_message (DEBUG_PLUGINS, "END");
xed_debug_message (DEBUG_PLUGINS, "END");
return taglist;
}
@@ -488,7 +488,7 @@ static void
free_tag (Tag *tag)
{
/*
xedit_debug_message (DEBUG_PLUGINS, "Tag: %s", tag->name);
xed_debug_message (DEBUG_PLUGINS, "Tag: %s", tag->name);
*/
g_return_if_fail (tag != NULL);
@@ -508,7 +508,7 @@ free_tag_group (TagGroup *tag_group)
{
GList *l;
xedit_debug_message (DEBUG_PLUGINS, "Tag group: %s", tag_group->name);
xed_debug_message (DEBUG_PLUGINS, "Tag group: %s", tag_group->name);
g_return_if_fail (tag_group != NULL);
@@ -522,14 +522,14 @@ free_tag_group (TagGroup *tag_group)
g_list_free (tag_group->tags);
g_free (tag_group);
xedit_debug_message (DEBUG_PLUGINS, "END");
xed_debug_message (DEBUG_PLUGINS, "END");
}
void free_taglist(void)
{
GList* l;
xedit_debug_message(DEBUG_PLUGINS, "ref_count: %d", taglist_ref_count);
xed_debug_message(DEBUG_PLUGINS, "ref_count: %d", taglist_ref_count);
if (taglist == NULL)
{
@@ -554,7 +554,7 @@ void free_taglist(void)
g_free (taglist);
taglist = NULL;
xedit_debug_message (DEBUG_PLUGINS, "Really freed");
xed_debug_message (DEBUG_PLUGINS, "Really freed");
}
static TagList* parse_taglist_dir(const gchar* dir)
@@ -563,13 +563,13 @@ static TagList* parse_taglist_dir(const gchar* dir)
GDir* d;
const gchar* dirent;
xedit_debug_message(DEBUG_PLUGINS, "DIR: %s", dir);
xed_debug_message(DEBUG_PLUGINS, "DIR: %s", dir);
d = g_dir_open(dir, 0, &error);
if (!d)
{
xedit_debug_message(DEBUG_PLUGINS, "%s", error->message);
xed_debug_message(DEBUG_PLUGINS, "%s", error->message);
g_error_free (error);
return taglist;
}
@@ -593,7 +593,7 @@ TagList* create_taglist(const gchar* data_dir)
{
gchar* pdir;
xedit_debug_message(DEBUG_PLUGINS, "ref_count: %d", taglist_ref_count);
xed_debug_message(DEBUG_PLUGINS, "ref_count: %d", taglist_ref_count);
if (taglist_ref_count > 0)
{
@@ -612,7 +612,7 @@ TagList* create_taglist(const gchar* data_dir)
if (home != NULL)
{
pdir = g_build_filename (home,
USER_XEDIT_TAGLIST_PLUGIN_LOCATION_LEGACY,
USER_XED_TAGLIST_PLUGIN_LOCATION_LEGACY,
NULL);
parse_taglist_dir (pdir);
g_free (pdir);
@@ -623,14 +623,14 @@ TagList* create_taglist(const gchar* data_dir)
if (envvar != NULL)
{
pdir = g_build_filename (envvar,
USER_XEDIT_TAGLIST_PLUGIN_LOCATION,
USER_XED_TAGLIST_PLUGIN_LOCATION,
NULL);
parse_taglist_dir (pdir);
g_free (pdir);
}
else if (home != NULL)
{
pdir = g_build_filename(home, ".config", USER_XEDIT_TAGLIST_PLUGIN_LOCATION, NULL);
pdir = g_build_filename(home, ".config", USER_XED_TAGLIST_PLUGIN_LOCATION, NULL);
parse_taglist_dir(pdir);
g_free (pdir);
}

View File

@@ -1,6 +1,6 @@
/*
* xedit-taglist-plugin-parser.h
* This file is part of xedit
* xed-taglist-plugin-parser.h
* This file is part of xed
*
* Copyright (C) 2002-2005 - Paolo Maggi
*
@@ -21,15 +21,15 @@
*/
/*
* Modified by the xedit Team, 2002-2005. See the AUTHORS file for a
* list of people on the xedit Team.
* Modified by the xed Team, 2002-2005. See the AUTHORS file for a
* list of people on the xed Team.
* See the ChangeLog files for a list of changes.
*
* $Id$
*/
#ifndef __XEDIT_TAGLIST_PLUGIN_PARSER_H__
#define __XEDIT_TAGLIST_PLUGIN_PARSER_H__
#ifndef __XED_TAGLIST_PLUGIN_PARSER_H__
#define __XED_TAGLIST_PLUGIN_PARSER_H__
#include <libxml/tree.h>
#include <glib.h>
@@ -61,5 +61,5 @@ TagList* create_taglist(const gchar* data_dir);
void free_taglist(void);
#endif /* __XEDIT_TAGLIST_PLUGIN_PARSER_H__ */
#endif /* __XED_TAGLIST_PLUGIN_PARSER_H__ */

View File

@@ -1,5 +1,5 @@
/*
* xedit-taglist-plugin.h
* xed-taglist-plugin.h
*
* Copyright (C) 2002-2005 - Paolo Maggi
*
@@ -20,8 +20,8 @@
*/
/*
* Modified by the xedit Team, 2002-2005. See the AUTHORS file for a
* list of people on the xedit Team.
* Modified by the xed Team, 2002-2005. See the AUTHORS file for a
* list of people on the xed Team.
* See the ChangeLog files for a list of changes.
*
* $Id$
@@ -31,69 +31,69 @@
#include <config.h>
#endif
#include "xedit-taglist-plugin.h"
#include "xedit-taglist-plugin-panel.h"
#include "xedit-taglist-plugin-parser.h"
#include "xed-taglist-plugin.h"
#include "xed-taglist-plugin-panel.h"
#include "xed-taglist-plugin-parser.h"
#include <glib/gi18n-lib.h>
#include <gmodule.h>
#include <xedit/xedit-plugin.h>
#include <xedit/xedit-debug.h>
#include <xed/xed-plugin.h>
#include <xed/xed-debug.h>
#define WINDOW_DATA_KEY "XeditTaglistPluginWindowData"
#define WINDOW_DATA_KEY "XedTaglistPluginWindowData"
#define XEDIT_TAGLIST_PLUGIN_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), XEDIT_TYPE_TAGLIST_PLUGIN, XeditTaglistPluginPrivate))
#define XED_TAGLIST_PLUGIN_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), XED_TYPE_TAGLIST_PLUGIN, XedTaglistPluginPrivate))
struct _XeditTaglistPluginPrivate
struct _XedTaglistPluginPrivate
{
gpointer dummy;
};
XEDIT_PLUGIN_REGISTER_TYPE_WITH_CODE (XeditTaglistPlugin, xedit_taglist_plugin,
xedit_taglist_plugin_panel_register_type (module);
XED_PLUGIN_REGISTER_TYPE_WITH_CODE (XedTaglistPlugin, xed_taglist_plugin,
xed_taglist_plugin_panel_register_type (module);
)
static void
xedit_taglist_plugin_init (XeditTaglistPlugin *plugin)
xed_taglist_plugin_init (XedTaglistPlugin *plugin)
{
plugin->priv = XEDIT_TAGLIST_PLUGIN_GET_PRIVATE (plugin);
plugin->priv = XED_TAGLIST_PLUGIN_GET_PRIVATE (plugin);
xedit_debug_message (DEBUG_PLUGINS, "XeditTaglistPlugin initializing");
xed_debug_message (DEBUG_PLUGINS, "XedTaglistPlugin initializing");
}
static void
xedit_taglist_plugin_finalize (GObject *object)
xed_taglist_plugin_finalize (GObject *object)
{
/*
XeditTaglistPlugin *plugin = XEDIT_TAGLIST_PLUGIN (object);
XedTaglistPlugin *plugin = XED_TAGLIST_PLUGIN (object);
*/
xedit_debug_message (DEBUG_PLUGINS, "XeditTaglistPlugin finalizing");
xed_debug_message (DEBUG_PLUGINS, "XedTaglistPlugin finalizing");
free_taglist ();
G_OBJECT_CLASS (xedit_taglist_plugin_parent_class)->finalize (object);
G_OBJECT_CLASS (xed_taglist_plugin_parent_class)->finalize (object);
}
static void
impl_activate (XeditPlugin *plugin,
XeditWindow *window)
impl_activate (XedPlugin *plugin,
XedWindow *window)
{
XeditPanel *side_panel;
XedPanel *side_panel;
GtkWidget *taglist_panel;
gchar *data_dir;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
g_return_if_fail (g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY) == NULL);
side_panel = xedit_window_get_side_panel (window);
side_panel = xed_window_get_side_panel (window);
data_dir = xedit_plugin_get_data_dir (plugin);
taglist_panel = xedit_taglist_plugin_panel_new (window, data_dir);
data_dir = xed_plugin_get_data_dir (plugin);
taglist_panel = xed_taglist_plugin_panel_new (window, data_dir);
g_free (data_dir);
xedit_panel_add_item_with_stock_icon (side_panel,
xed_panel_add_item_with_stock_icon (side_panel,
taglist_panel,
_("Tags"),
GTK_STOCK_ADD);
@@ -104,20 +104,20 @@ impl_activate (XeditPlugin *plugin,
}
static void
impl_deactivate (XeditPlugin *plugin,
XeditWindow *window)
impl_deactivate (XedPlugin *plugin,
XedWindow *window)
{
XeditPanel *side_panel;
XedPanel *side_panel;
gpointer data;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
data = g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY);
g_return_if_fail (data != NULL);
side_panel = xedit_window_get_side_panel (window);
side_panel = xed_window_get_side_panel (window);
xedit_panel_remove_item (side_panel,
xed_panel_remove_item (side_panel,
GTK_WIDGET (data));
g_object_set_data (G_OBJECT (window),
@@ -126,18 +126,18 @@ impl_deactivate (XeditPlugin *plugin,
}
static void
impl_update_ui (XeditPlugin *plugin,
XeditWindow *window)
impl_update_ui (XedPlugin *plugin,
XedWindow *window)
{
gpointer data;
XeditView *view;
XedView *view;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
data = g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY);
g_return_if_fail (data != NULL);
view = xedit_window_get_active_view (window);
view = xed_window_get_active_view (window);
gtk_widget_set_sensitive (GTK_WIDGET (data),
(view != NULL) &&
@@ -145,16 +145,16 @@ impl_update_ui (XeditPlugin *plugin,
}
static void
xedit_taglist_plugin_class_init (XeditTaglistPluginClass *klass)
xed_taglist_plugin_class_init (XedTaglistPluginClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
XeditPluginClass *plugin_class = XEDIT_PLUGIN_CLASS (klass);
XedPluginClass *plugin_class = XED_PLUGIN_CLASS (klass);
object_class->finalize = xedit_taglist_plugin_finalize;
object_class->finalize = xed_taglist_plugin_finalize;
plugin_class->activate = impl_activate;
plugin_class->deactivate = impl_deactivate;
plugin_class->update_ui = impl_update_ui;
g_type_class_add_private (object_class, sizeof (XeditTaglistPluginPrivate));
g_type_class_add_private (object_class, sizeof (XedTaglistPluginPrivate));
}

View File

@@ -0,0 +1,85 @@
/*
* xed-taglist-plugin.h
*
* Copyright (C) 2002-2005 - Paolo Maggi
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
/*
* Modified by the xed Team, 2002-2005. See the AUTHORS file for a
* list of people on the xed Team.
* See the ChangeLog files for a list of changes.
*
* $Id$
*/
#ifndef __XED_TAGLIST_PLUGIN_H__
#define __XED_TAGLIST_PLUGIN_H__
#include <glib.h>
#include <glib-object.h>
#include <xed/xed-plugin.h>
G_BEGIN_DECLS
/*
* Type checking and casting macros
*/
#define XED_TYPE_TAGLIST_PLUGIN (xed_taglist_plugin_get_type ())
#define XED_TAGLIST_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XED_TYPE_TAGLIST_PLUGIN, XedTaglistPlugin))
#define XED_TAGLIST_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XED_TYPE_TAGLIST_PLUGIN, XedTaglistPluginClass))
#define XED_IS_TAGLIST_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XED_TYPE_TAGLIST_PLUGIN))
#define XED_IS_TAGLIST_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XED_TYPE_TAGLIST_PLUGIN))
#define XED_TAGLIST_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XED_TYPE_TAGLIST_PLUGIN, XedTaglistPluginClass))
/* Private structure type */
typedef struct _XedTaglistPluginPrivate XedTaglistPluginPrivate;
/*
* Main object structure
*/
typedef struct _XedTaglistPlugin XedTaglistPlugin;
struct _XedTaglistPlugin
{
XedPlugin parent_instance;
/*< private >*/
XedTaglistPluginPrivate *priv;
};
/*
* Class definition
*/
typedef struct _XedTaglistPluginClass XedTaglistPluginClass;
struct _XedTaglistPluginClass
{
XedPluginClass parent_class;
};
/*
* Public methods
*/
GType xed_taglist_plugin_get_type (void) G_GNUC_CONST;
/* All the plugins must implement this function */
G_MODULE_EXPORT GType register_xed_plugin (GTypeModule *module);
G_END_DECLS
#endif /* __XED_TAGLIST_PLUGIN_H__ */

View File

@@ -1,97 +0,0 @@
/*
* xedit-taglist-plugin-panel.h
* This file is part of xedit
*
* Copyright (C) 2005 - Paolo Maggi
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
/*
* Modified by the xedit Team, 2005. See the AUTHORS file for a
* list of people on the xedit Team.
* See the ChangeLog files for a list of changes.
*
* $Id$
*/
#ifndef __XEDIT_TAGLIST_PLUGIN_PANEL_H__
#define __XEDIT_TAGLIST_PLUGIN_PANEL_H__
#include <gtk/gtk.h>
#include <xedit/xedit-window.h>
G_BEGIN_DECLS
/*
* Type checking and casting macros
*/
#define XEDIT_TYPE_TAGLIST_PLUGIN_PANEL (xedit_taglist_plugin_panel_get_type())
#define XEDIT_TAGLIST_PLUGIN_PANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), XEDIT_TYPE_TAGLIST_PLUGIN_PANEL, XeditTaglistPluginPanel))
#define XEDIT_TAGLIST_PLUGIN_PANEL_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), XEDIT_TYPE_TAGLIST_PLUGIN_PANEL, XeditTaglistPluginPanel const))
#define XEDIT_TAGLIST_PLUGIN_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), XEDIT_TYPE_TAGLIST_PLUGIN_PANEL, XeditTaglistPluginPanelClass))
#define XEDIT_IS_TAGLIST_PLUGIN_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), XEDIT_TYPE_TAGLIST_PLUGIN_PANEL))
#define XEDIT_IS_TAGLIST_PLUGIN_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XEDIT_TYPE_TAGLIST_PLUGIN_PANEL))
#define XEDIT_TAGLIST_PLUGIN_PANEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), XEDIT_TYPE_TAGLIST_PLUGIN_PANEL, XeditTaglistPluginPanelClass))
/* Private structure type */
typedef struct _XeditTaglistPluginPanelPrivate XeditTaglistPluginPanelPrivate;
/*
* Main object structure
*/
typedef struct _XeditTaglistPluginPanel XeditTaglistPluginPanel;
struct _XeditTaglistPluginPanel
{
#if GTK_CHECK_VERSION (3, 0, 0)
GtkBox vbox;
#else
GtkVBox vbox;
#endif
/*< private > */
XeditTaglistPluginPanelPrivate *priv;
};
/*
* Class definition
*/
typedef struct _XeditTaglistPluginPanelClass XeditTaglistPluginPanelClass;
struct _XeditTaglistPluginPanelClass
{
#if GTK_CHECK_VERSION (3, 0, 0)
GtkBoxClass parent_class;
#else
GtkVBoxClass parent_class;
#endif
};
/*
* Public methods
*/
GType xedit_taglist_plugin_panel_register_type (GTypeModule *module);
GType xedit_taglist_plugin_panel_get_type (void) G_GNUC_CONST;
GtkWidget *xedit_taglist_plugin_panel_new (XeditWindow *window,
const gchar *data_dir);
G_END_DECLS
#endif /* __XEDIT_TAGLIST_PLUGIN_PANEL_H__ */

View File

@@ -1,85 +0,0 @@
/*
* xedit-taglist-plugin.h
*
* Copyright (C) 2002-2005 - Paolo Maggi
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
/*
* Modified by the xedit Team, 2002-2005. See the AUTHORS file for a
* list of people on the xedit Team.
* See the ChangeLog files for a list of changes.
*
* $Id$
*/
#ifndef __XEDIT_TAGLIST_PLUGIN_H__
#define __XEDIT_TAGLIST_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_TAGLIST_PLUGIN (xedit_taglist_plugin_get_type ())
#define XEDIT_TAGLIST_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XEDIT_TYPE_TAGLIST_PLUGIN, XeditTaglistPlugin))
#define XEDIT_TAGLIST_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XEDIT_TYPE_TAGLIST_PLUGIN, XeditTaglistPluginClass))
#define XEDIT_IS_TAGLIST_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XEDIT_TYPE_TAGLIST_PLUGIN))
#define XEDIT_IS_TAGLIST_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XEDIT_TYPE_TAGLIST_PLUGIN))
#define XEDIT_TAGLIST_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XEDIT_TYPE_TAGLIST_PLUGIN, XeditTaglistPluginClass))
/* Private structure type */
typedef struct _XeditTaglistPluginPrivate XeditTaglistPluginPrivate;
/*
* Main object structure
*/
typedef struct _XeditTaglistPlugin XeditTaglistPlugin;
struct _XeditTaglistPlugin
{
XeditPlugin parent_instance;
/*< private >*/
XeditTaglistPluginPrivate *priv;
};
/*
* Class definition
*/
typedef struct _XeditTaglistPluginClass XeditTaglistPluginClass;
struct _XeditTaglistPluginClass
{
XeditPluginClass parent_class;
};
/*
* Public methods
*/
GType xedit_taglist_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_TAGLIST_PLUGIN_H__ */

View File

@@ -1,31 +1,31 @@
# time plugin
plugindir = $(XEDIT_PLUGINS_LIBS_DIR)
plugindir = $(XED_PLUGINS_LIBS_DIR)
AM_CPPFLAGS = \
-I$(top_srcdir) \
$(XEDIT_CFLAGS) \
$(XED_CFLAGS) \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS)
plugin_LTLIBRARIES = libtime.la
libtime_la_SOURCES = \
xedit-time-plugin.h \
xedit-time-plugin.c
xed-time-plugin.h \
xed-time-plugin.c
libtime_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
libtime_la_LIBADD = $(XEDIT_LIBS)
libtime_la_LIBADD = $(XED_LIBS)
uidir = $(XEDIT_PLUGINS_DATA_DIR)/time
uidir = $(XED_PLUGINS_DATA_DIR)/time
ui_DATA = \
xedit-time-dialog.ui \
xedit-time-setup-dialog.ui
xed-time-dialog.ui \
xed-time-setup-dialog.ui
plugin_in_files = time.xedit-plugin.desktop.in
plugin_in_files = time.xed-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
%.xed-plugin: %.xed-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:.xedit-plugin.desktop.in=.xedit-plugin)
plugin_DATA = $(plugin_in_files:.xed-plugin.desktop.in=.xed-plugin)
@INTLTOOL_XML_NOMERGE_RULE@
time_gschema_in = org.x.editor.plugins.time.gschema.xml.in

View File

@@ -1,4 +1,4 @@
[Xedit Plugin]
[Xed Plugin]
Module=time
IAge=2
_Name=Insert Date/Time

View File

@@ -1,5 +1,5 @@
/*
* xedit-time-plugin.c
* xed-time-plugin.c
*
* Copyright (C) 2002-2005 - Paolo Maggi
*
@@ -21,8 +21,8 @@
*/
/*
* Modified by the xedit Team, 2002. See the AUTHORS file for a
* list of people on the xedit Team.
* Modified by the xed Team, 2002. See the AUTHORS file for a
* list of people on the xed Team.
* See the ChangeLog files for a list of changes.
*/
@@ -33,22 +33,22 @@
#include <string.h>
#include <time.h>
#include "xedit-time-plugin.h"
#include <xedit/xedit-help.h>
#include "xed-time-plugin.h"
#include <xed/xed-help.h>
#include <glib/gi18n-lib.h>
#include <glib.h>
#include <gmodule.h>
#include <gio/gio.h>
#include <xedit/xedit-debug.h>
#include <xedit/xedit-utils.h>
#include <xed/xed-debug.h>
#include <xed/xed-utils.h>
#define XEDIT_TIME_PLUGIN_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \
XEDIT_TYPE_TIME_PLUGIN, \
XeditTimePluginPrivate))
#define XED_TIME_PLUGIN_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \
XED_TYPE_TIME_PLUGIN, \
XedTimePluginPrivate))
#define WINDOW_DATA_KEY "XeditTimePluginWindowData"
#define WINDOW_DATA_KEY "XedTimePluginWindowData"
#define MENU_PATH "/MenuBar/EditMenu/EditOps_4"
/* GSettings keys */
@@ -119,7 +119,7 @@ struct _TimeConfigureDialog
GtkWidget *custom_format_example;
/* Info needed for the response handler */
XeditTimePlugin *plugin;
XedTimePlugin *plugin;
};
typedef struct _ChooseFormatDialog ChooseFormatDialog;
@@ -139,7 +139,7 @@ struct _ChooseFormatDialog
/* Info needed for the response handler */
GtkTextBuffer *buffer;
XeditTimePlugin *plugin;
XedTimePlugin *plugin;
};
typedef enum
@@ -148,14 +148,14 @@ typedef enum
PROMPT_CUSTOM_FORMAT, /* Popup dialog with entry preselected */
USE_SELECTED_FORMAT, /* Use selected format directly */
USE_CUSTOM_FORMAT /* Use custom format directly */
} XeditTimePluginPromptType;
} XedTimePluginPromptType;
struct _XeditTimePluginPrivate
struct _XedTimePluginPrivate
{
GSettings *settings;
};
XEDIT_PLUGIN_REGISTER_TYPE(XeditTimePlugin, xedit_time_plugin)
XED_PLUGIN_REGISTER_TYPE(XedTimePlugin, xed_time_plugin)
typedef struct
{
@@ -165,8 +165,8 @@ typedef struct
typedef struct
{
XeditWindow *window;
XeditTimePlugin *plugin;
XedWindow *window;
XedTimePlugin *plugin;
} ActionData;
static void time_cb (GtkAction *action, ActionData *data);
@@ -184,25 +184,25 @@ static const GtkActionEntry action_entries[] =
};
static void
xedit_time_plugin_init (XeditTimePlugin *plugin)
xed_time_plugin_init (XedTimePlugin *plugin)
{
xedit_debug_message (DEBUG_PLUGINS, "XeditTimePlugin initializing");
xed_debug_message (DEBUG_PLUGINS, "XedTimePlugin initializing");
plugin->priv = XEDIT_TIME_PLUGIN_GET_PRIVATE (plugin);
plugin->priv = XED_TIME_PLUGIN_GET_PRIVATE (plugin);
plugin->priv->settings = g_settings_new (TIME_SCHEMA);
}
static void
xedit_time_plugin_finalize (GObject *object)
xed_time_plugin_finalize (GObject *object)
{
XeditTimePlugin *plugin = XEDIT_TIME_PLUGIN (object);
XedTimePlugin *plugin = XED_TIME_PLUGIN (object);
xedit_debug_message (DEBUG_PLUGINS, "XeditTimePlugin finalizing");
xed_debug_message (DEBUG_PLUGINS, "XedTimePlugin finalizing");
g_object_unref (G_OBJECT (plugin->priv->settings));
G_OBJECT_CLASS (xedit_time_plugin_parent_class)->finalize (object);
G_OBJECT_CLASS (xed_time_plugin_parent_class)->finalize (object);
}
static void
@@ -215,17 +215,17 @@ free_window_data (WindowData *data)
}
static void
update_ui_real (XeditWindow *window,
update_ui_real (XedWindow *window,
WindowData *data)
{
XeditView *view;
XedView *view;
GtkAction *action;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
view = xedit_window_get_active_view (window);
view = xed_window_get_active_view (window);
xedit_debug_message (DEBUG_PLUGINS, "View: %p", view);
xed_debug_message (DEBUG_PLUGINS, "View: %p", view);
action = gtk_action_group_get_action (data->action_group,
"InsertDateAndTime");
@@ -235,24 +235,24 @@ update_ui_real (XeditWindow *window,
}
static void
impl_activate (XeditPlugin *plugin,
XeditWindow *window)
impl_activate (XedPlugin *plugin,
XedWindow *window)
{
GtkUIManager *manager;
WindowData *data;
ActionData *action_data;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
data = g_new (WindowData, 1);
action_data = g_new (ActionData, 1);
action_data->plugin = XEDIT_TIME_PLUGIN (plugin);
action_data->plugin = XED_TIME_PLUGIN (plugin);
action_data->window = window;
manager = xedit_window_get_ui_manager (window);
manager = xed_window_get_ui_manager (window);
data->action_group = gtk_action_group_new ("XeditTimePluginActions");
data->action_group = gtk_action_group_new ("XedTimePluginActions");
gtk_action_group_set_translation_domain (data->action_group,
GETTEXT_PACKAGE);
gtk_action_group_add_actions_full (data->action_group,
@@ -282,15 +282,15 @@ impl_activate (XeditPlugin *plugin,
}
static void
impl_deactivate (XeditPlugin *plugin,
XeditWindow *window)
impl_deactivate (XedPlugin *plugin,
XedWindow *window)
{
GtkUIManager *manager;
WindowData *data;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
manager = xedit_window_get_ui_manager (window);
manager = xed_window_get_ui_manager (window);
data = (WindowData *) g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY);
g_return_if_fail (data != NULL);
@@ -302,12 +302,12 @@ impl_deactivate (XeditPlugin *plugin,
}
static void
impl_update_ui (XeditPlugin *plugin,
XeditWindow *window)
impl_update_ui (XedPlugin *plugin,
XedWindow *window)
{
WindowData *data;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
data = (WindowData *) g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY);
g_return_if_fail (data != NULL);
@@ -316,10 +316,10 @@ impl_update_ui (XeditPlugin *plugin,
}
/* whether we should prompt the user or use the specified format */
static XeditTimePluginPromptType
get_prompt_type (XeditTimePlugin *plugin)
static XedTimePluginPromptType
get_prompt_type (XedTimePlugin *plugin)
{
XeditTimePluginPromptType prompt_type;
XedTimePluginPromptType prompt_type;
prompt_type = g_settings_get_enum (plugin->priv->settings,
PROMPT_TYPE_KEY);
@@ -328,8 +328,8 @@ get_prompt_type (XeditTimePlugin *plugin)
}
static void
set_prompt_type (XeditTimePlugin *plugin,
XeditTimePluginPromptType prompt_type)
set_prompt_type (XedTimePlugin *plugin,
XedTimePluginPromptType prompt_type)
{
if (!g_settings_is_writable (plugin->priv->settings,
PROMPT_TYPE_KEY))
@@ -344,7 +344,7 @@ set_prompt_type (XeditTimePlugin *plugin,
/* The selected format in the list */
static gchar *
get_selected_format (XeditTimePlugin *plugin)
get_selected_format (XedTimePlugin *plugin)
{
gchar *sel_format;
@@ -355,7 +355,7 @@ get_selected_format (XeditTimePlugin *plugin)
}
static void
set_selected_format (XeditTimePlugin *plugin,
set_selected_format (XedTimePlugin *plugin,
const gchar *format)
{
g_return_if_fail (format != NULL);
@@ -373,7 +373,7 @@ set_selected_format (XeditTimePlugin *plugin,
/* the custom format in the entry */
static gchar *
get_custom_format (XeditTimePlugin *plugin)
get_custom_format (XedTimePlugin *plugin)
{
gchar *format;
@@ -384,7 +384,7 @@ get_custom_format (XeditTimePlugin *plugin)
}
static void
set_custom_format (XeditTimePlugin *plugin,
set_custom_format (XedTimePlugin *plugin,
const gchar *format)
{
g_return_if_fail (format != NULL);
@@ -408,7 +408,7 @@ get_time (const gchar* format)
size_t out_length = 0;
gchar *locale_format;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
g_return_val_if_fail (format != NULL, NULL);
@@ -450,24 +450,24 @@ get_time (const gchar* format)
static void
dialog_disposed (GObject *obj, gpointer dialog_pointer)
{
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
g_free (dialog_pointer);
xedit_debug_message (DEBUG_PLUGINS, "END");
xed_debug_message (DEBUG_PLUGINS, "END");
}
static GtkTreeModel *
create_model (GtkWidget *listview,
const gchar *sel_format,
XeditTimePlugin *plugin)
XedTimePlugin *plugin)
{
gint i = 0;
GtkListStore *store;
GtkTreeSelection *selection;
GtkTreeIter iter;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
/* create list store */
store = gtk_list_store_new (NUM_COLUMNS, G_TYPE_STRING, G_TYPE_INT);
@@ -490,7 +490,7 @@ create_model (GtkWidget *listview,
str = get_time (formats[i]);
xedit_debug_message (DEBUG_PLUGINS, "%d : %s", i, str);
xed_debug_message (DEBUG_PLUGINS, "%d : %s", i, str);
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
COLUMN_FORMATS, str,
@@ -521,7 +521,7 @@ scroll_to_selected (GtkTreeView *tree_view)
GtkTreeSelection *selection;
GtkTreeIter iter;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
model = gtk_tree_view_get_model (tree_view);
g_return_if_fail (model != NULL);
@@ -546,12 +546,12 @@ scroll_to_selected (GtkTreeView *tree_view)
static void
create_formats_list (GtkWidget *listview,
const gchar *sel_format,
XeditTimePlugin *plugin)
XedTimePlugin *plugin)
{
GtkTreeViewColumn *column;
GtkCellRenderer *cell;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
g_return_if_fail (listview != NULL);
g_return_if_fail (sel_format != NULL);
@@ -585,7 +585,7 @@ updated_custom_format_example (GtkEntry *format_entry,
gchar *str;
gchar *escaped_time;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
g_return_if_fail (GTK_IS_ENTRY (format_entry));
g_return_if_fail (GTK_IS_LABEL (format_example));
@@ -608,7 +608,7 @@ static void
choose_format_dialog_button_toggled (GtkToggleButton *button,
ChooseFormatDialog *dialog)
{
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->custom)))
{
@@ -632,7 +632,7 @@ choose_format_dialog_button_toggled (GtkToggleButton *button,
static void
configure_dialog_button_toggled (GtkToggleButton *button, TimeConfigureDialog *dialog)
{
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->custom)))
{
@@ -669,7 +669,7 @@ get_format_from_list (GtkWidget *listview)
GtkTreeSelection *selection;
GtkTreeIter iter;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
model = gtk_tree_view_get_model (GTK_TREE_VIEW (listview));
g_return_val_if_fail (model != NULL, 0);
@@ -683,7 +683,7 @@ get_format_from_list (GtkWidget *listview)
gtk_tree_model_get (model, &iter, COLUMN_INDEX, &selected_value, -1);
xedit_debug_message (DEBUG_PLUGINS, "Sel value: %d", selected_value);
xed_debug_message (DEBUG_PLUGINS, "Sel value: %d", selected_value);
return selected_value;
}
@@ -692,14 +692,14 @@ get_format_from_list (GtkWidget *listview)
}
static TimeConfigureDialog *
get_configure_dialog (XeditTimePlugin *plugin)
get_configure_dialog (XedTimePlugin *plugin)
{
TimeConfigureDialog *dialog = NULL;
gchar *data_dir;
gchar *ui_file;
GtkWidget *content;
GtkWidget *viewport;
XeditTimePluginPromptType prompt_type;
XedTimePluginPromptType prompt_type;
gchar *sf, *cf;
GtkWidget *error_widget;
gboolean ret;
@@ -708,7 +708,7 @@ get_configure_dialog (XeditTimePlugin *plugin)
NULL
};
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
GtkWidget *dlg = gtk_dialog_new_with_buttons (_("Configure insert date/time plugin..."),
NULL,
@@ -735,9 +735,9 @@ get_configure_dialog (XeditTimePlugin *plugin)
gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_action_area (GTK_DIALOG (dialog->dialog))), 6);
data_dir = xedit_plugin_get_data_dir (XEDIT_PLUGIN (plugin));
ui_file = g_build_filename (data_dir, "xedit-time-setup-dialog.ui", NULL);
ret = xedit_utils_get_ui_objects (ui_file,
data_dir = xed_plugin_get_data_dir (XED_PLUGIN (plugin));
ui_file = g_build_filename (data_dir, "xed-time-setup-dialog.ui", NULL);
ret = xed_utils_get_ui_objects (ui_file,
root_objects,
&error_widget,
"time_dialog_content", &content,
@@ -844,7 +844,7 @@ static void
real_insert_time (GtkTextBuffer *buffer,
const gchar *the_time)
{
xedit_debug_message (DEBUG_PLUGINS, "Insert: %s", the_time);
xed_debug_message (DEBUG_PLUGINS, "Insert: %s", the_time);
gtk_text_buffer_begin_user_action (buffer);
@@ -878,8 +878,8 @@ choose_format_dialog_row_activated (GtkTreeView *list,
static ChooseFormatDialog *
get_choose_format_dialog (GtkWindow *parent,
XeditTimePluginPromptType prompt_type,
XeditTimePlugin *plugin)
XedTimePluginPromptType prompt_type,
XedTimePlugin *plugin)
{
ChooseFormatDialog *dialog;
gchar *data_dir;
@@ -894,9 +894,9 @@ get_choose_format_dialog (GtkWindow *parent,
dialog = g_new0 (ChooseFormatDialog, 1);
data_dir = xedit_plugin_get_data_dir (XEDIT_PLUGIN (plugin));
ui_file = g_build_filename (data_dir, "xedit-time-dialog.ui", NULL);
ret = xedit_utils_get_ui_objects (ui_file,
data_dir = xed_plugin_get_data_dir (XED_PLUGIN (plugin));
ui_file = g_build_filename (data_dir, "xed-time-dialog.ui", NULL);
ret = xed_utils_get_ui_objects (ui_file,
NULL,
&error_widget,
"choose_format_dialog", &dialog->dialog,
@@ -1017,17 +1017,17 @@ choose_format_dialog_response_cb (GtkWidget *widget,
{
case GTK_RESPONSE_HELP:
{
xedit_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_HELP");
xedit_help_display (GTK_WINDOW (widget),
xed_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_HELP");
xed_help_display (GTK_WINDOW (widget),
NULL,
"xedit-insert-date-time-plugin");
"xed-insert-date-time-plugin");
break;
}
case GTK_RESPONSE_OK:
{
gchar *the_time;
xedit_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_OK");
xed_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_OK");
/* Get the user's chosen format */
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->use_list)))
@@ -1060,7 +1060,7 @@ choose_format_dialog_response_cb (GtkWidget *widget,
break;
}
case GTK_RESPONSE_CANCEL:
xedit_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_CANCEL");
xed_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_CANCEL");
gtk_widget_destroy (dialog->dialog);
}
}
@@ -1071,11 +1071,11 @@ time_cb (GtkAction *action,
{
GtkTextBuffer *buffer;
gchar *the_time = NULL;
XeditTimePluginPromptType prompt_type;
XedTimePluginPromptType prompt_type;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
buffer = GTK_TEXT_BUFFER (xedit_window_get_active_document (data->window));
buffer = GTK_TEXT_BUFFER (xed_window_get_active_document (data->window));
g_return_if_fail (buffer != NULL);
prompt_type = get_prompt_type (data->plugin);
@@ -1128,7 +1128,7 @@ ok_button_pressed (TimeConfigureDialog *dialog)
gint sel_format;
const gchar *custom_format;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
sel_format = get_format_from_list (dialog->list);
@@ -1150,7 +1150,7 @@ ok_button_pressed (TimeConfigureDialog *dialog)
set_prompt_type (dialog->plugin, PROMPT_SELECTED_FORMAT);
}
xedit_debug_message (DEBUG_PLUGINS, "Sel: %d", sel_format);
xed_debug_message (DEBUG_PLUGINS, "Sel: %d", sel_format);
}
static void
@@ -1162,16 +1162,16 @@ configure_dialog_response_cb (GtkWidget *widget,
{
case GTK_RESPONSE_HELP:
{
xedit_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_HELP");
xed_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_HELP");
xedit_help_display (GTK_WINDOW (widget),
xed_help_display (GTK_WINDOW (widget),
NULL,
"xedit-insert-date-time-plugin#xedit-date-time-configure");
"xed-insert-date-time-plugin#xed-date-time-configure");
break;
}
case GTK_RESPONSE_OK:
{
xedit_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_OK");
xed_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_OK");
ok_button_pressed (dialog);
@@ -1180,20 +1180,20 @@ configure_dialog_response_cb (GtkWidget *widget,
}
case GTK_RESPONSE_CANCEL:
{
xedit_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_CANCEL");
xed_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_CANCEL");
gtk_widget_destroy (dialog->dialog);
}
}
}
static GtkWidget *
impl_create_configure_dialog (XeditPlugin *plugin)
impl_create_configure_dialog (XedPlugin *plugin)
{
TimeConfigureDialog *dialog;
dialog = get_configure_dialog (XEDIT_TIME_PLUGIN (plugin));
dialog = get_configure_dialog (XED_TIME_PLUGIN (plugin));
dialog->plugin = XEDIT_TIME_PLUGIN (plugin);
dialog->plugin = XED_TIME_PLUGIN (plugin);
g_signal_connect (dialog->dialog,
"response",
@@ -1204,12 +1204,12 @@ impl_create_configure_dialog (XeditPlugin *plugin)
}
static void
xedit_time_plugin_class_init (XeditTimePluginClass *klass)
xed_time_plugin_class_init (XedTimePluginClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
XeditPluginClass *plugin_class = XEDIT_PLUGIN_CLASS (klass);
XedPluginClass *plugin_class = XED_PLUGIN_CLASS (klass);
object_class->finalize = xedit_time_plugin_finalize;
object_class->finalize = xed_time_plugin_finalize;
plugin_class->activate = impl_activate;
plugin_class->deactivate = impl_deactivate;
@@ -1217,5 +1217,5 @@ xedit_time_plugin_class_init (XeditTimePluginClass *klass)
plugin_class->create_configure_dialog = impl_create_configure_dialog;
g_type_class_add_private (object_class, sizeof (XeditTimePluginPrivate));
g_type_class_add_private (object_class, sizeof (XedTimePluginPrivate));
}

View File

@@ -0,0 +1,78 @@
/*
* xed-time-plugin.h
*
* Copyright (C) 2002-2005 - Paolo Maggi
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $Id$
*/
#ifndef __XED_TIME_PLUGIN_H__
#define __XED_TIME_PLUGIN_H__
#include <glib.h>
#include <glib-object.h>
#include <xed/xed-plugin.h>
G_BEGIN_DECLS
/*
* Type checking and casting macros
*/
#define XED_TYPE_TIME_PLUGIN (xed_time_plugin_get_type ())
#define XED_TIME_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XED_TYPE_TIME_PLUGIN, XedTimePlugin))
#define XED_TIME_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XED_TYPE_TIME_PLUGIN, XedTimePluginClass))
#define XED_IS_TIME_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XED_TYPE_TIME_PLUGIN))
#define XED_IS_TIME_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XED_TYPE_TIME_PLUGIN))
#define XED_TIME_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XED_TYPE_TIME_PLUGIN, XedTimePluginClass))
/* Private structure type */
typedef struct _XedTimePluginPrivate XedTimePluginPrivate;
/*
* Main object structure
*/
typedef struct _XedTimePlugin XedTimePlugin;
struct _XedTimePlugin
{
XedPlugin parent_instance;
/*< private >*/
XedTimePluginPrivate *priv;
};
/*
* Class definition
*/
typedef struct _XedTimePluginClass XedTimePluginClass;
struct _XedTimePluginClass
{
XedPluginClass parent_class;
};
/*
* Public methods
*/
GType xed_time_plugin_get_type (void) G_GNUC_CONST;
/* All the plugins must implement this function */
G_MODULE_EXPORT GType register_xed_plugin (GTypeModule *module);
G_END_DECLS
#endif /* __XED_TIME_PLUGIN_H__ */

View File

@@ -1,78 +0,0 @@
/*
* xedit-time-plugin.h
*
* Copyright (C) 2002-2005 - Paolo Maggi
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $Id$
*/
#ifndef __XEDIT_TIME_PLUGIN_H__
#define __XEDIT_TIME_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_TIME_PLUGIN (xedit_time_plugin_get_type ())
#define XEDIT_TIME_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XEDIT_TYPE_TIME_PLUGIN, XeditTimePlugin))
#define XEDIT_TIME_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XEDIT_TYPE_TIME_PLUGIN, XeditTimePluginClass))
#define XEDIT_IS_TIME_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XEDIT_TYPE_TIME_PLUGIN))
#define XEDIT_IS_TIME_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XEDIT_TYPE_TIME_PLUGIN))
#define XEDIT_TIME_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XEDIT_TYPE_TIME_PLUGIN, XeditTimePluginClass))
/* Private structure type */
typedef struct _XeditTimePluginPrivate XeditTimePluginPrivate;
/*
* Main object structure
*/
typedef struct _XeditTimePlugin XeditTimePlugin;
struct _XeditTimePlugin
{
XeditPlugin parent_instance;
/*< private >*/
XeditTimePluginPrivate *priv;
};
/*
* Class definition
*/
typedef struct _XeditTimePluginClass XeditTimePluginClass;
struct _XeditTimePluginClass
{
XeditPluginClass parent_class;
};
/*
* Public methods
*/
GType xedit_time_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_TIME_PLUGIN_H__ */

View File

@@ -1,26 +1,26 @@
# trailsave plugin
plugindir = $(XEDIT_PLUGINS_LIBS_DIR)
plugindir = $(XED_PLUGINS_LIBS_DIR)
AM_CPPFLAGS = \
-I$(top_srcdir) \
$(XEDIT_CFLAGS) \
$(XED_CFLAGS) \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS)
plugin_LTLIBRARIES = libtrailsave.la
libtrailsave_la_SOURCES = \
xedit-trail-save-plugin.h \
xedit-trail-save-plugin.c
xed-trail-save-plugin.h \
xed-trail-save-plugin.c
libtrailsave_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
libtrailsave_la_LIBADD = $(XEDIT_LIBS)
libtrailsave_la_LIBADD = $(XED_LIBS)
plugin_in_files = trailsave.xedit-plugin.desktop.in
plugin_in_files = trailsave.xed-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
%.xed-plugin: %.xed-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:.xedit-plugin.desktop.in=.xedit-plugin)
plugin_DATA = $(plugin_in_files:.xed-plugin.desktop.in=.xed-plugin)
EXTRA_DIST = $(plugin_in_files)

View File

@@ -1,4 +1,4 @@
[Xedit Plugin]
[Xed Plugin]
Module=trailsave
IAge=2
_Name=Save Without Trailing Spaces

View File

@@ -1,5 +1,5 @@
/*
* xedit-trail-save-plugin.c
* xed-trail-save-plugin.c
*
* 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
@@ -22,9 +22,9 @@
#include <config.h>
#endif
#include "xedit-trail-save-plugin.h"
#include "xed-trail-save-plugin.h"
XEDIT_PLUGIN_REGISTER_TYPE(XeditTrailSavePlugin, xedit_trail_save_plugin)
XED_PLUGIN_REGISTER_TYPE(XedTrailSavePlugin, xed_trail_save_plugin)
static void
strip_trailing_spaces (GtkTextBuffer *text_buffer)
@@ -103,11 +103,11 @@ strip_trailing_spaces (GtkTextBuffer *text_buffer)
}
static void
on_save (XeditDocument *document,
on_save (XedDocument *document,
const gchar *uri,
XeditEncoding *encoding,
XeditDocumentSaveFlags save_flags,
XeditPlugin *plugin)
XedEncoding *encoding,
XedDocumentSaveFlags save_flags,
XedPlugin *plugin)
{
GtkTextBuffer *text_buffer = GTK_TEXT_BUFFER (document);
@@ -115,47 +115,47 @@ on_save (XeditDocument *document,
}
static void
on_tab_added (XeditWindow *window,
XeditTab *tab,
XeditPlugin *plugin)
on_tab_added (XedWindow *window,
XedTab *tab,
XedPlugin *plugin)
{
XeditDocument *document;
XedDocument *document;
document = xedit_tab_get_document (tab);
document = xed_tab_get_document (tab);
g_signal_connect (document, "save", G_CALLBACK (on_save), plugin);
}
static void
on_tab_removed (XeditWindow *window,
XeditTab *tab,
XeditPlugin *plugin)
on_tab_removed (XedWindow *window,
XedTab *tab,
XedPlugin *plugin)
{
XeditDocument *document;
XedDocument *document;
document = xedit_tab_get_document (tab);
document = xed_tab_get_document (tab);
g_signal_handlers_disconnect_by_data (document, plugin);
}
static void
impl_activate (XeditPlugin *plugin,
XeditWindow *window)
impl_activate (XedPlugin *plugin,
XedWindow *window)
{
GList *documents;
GList *documents_iter;
XeditDocument *document;
XedDocument *document;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
g_signal_connect (window, "tab_added", G_CALLBACK (on_tab_added), plugin);
g_signal_connect (window, "tab_removed", G_CALLBACK (on_tab_removed), plugin);
documents = xedit_window_get_documents (window);
documents = xed_window_get_documents (window);
for (documents_iter = documents;
documents_iter && documents_iter->data;
documents_iter = documents_iter->next)
{
document = (XeditDocument *) documents_iter->data;
document = (XedDocument *) documents_iter->data;
g_signal_connect (document, "save", G_CALLBACK (on_save), plugin);
}
@@ -163,24 +163,24 @@ impl_activate (XeditPlugin *plugin,
}
static void
impl_deactivate (XeditPlugin *plugin,
XeditWindow *window)
impl_deactivate (XedPlugin *plugin,
XedWindow *window)
{
GList *documents;
GList *documents_iter;
XeditDocument *document;
XedDocument *document;
xedit_debug (DEBUG_PLUGINS);
xed_debug (DEBUG_PLUGINS);
g_signal_handlers_disconnect_by_data (window, plugin);
documents = xedit_window_get_documents (window);
documents = xed_window_get_documents (window);
for (documents_iter = documents;
documents_iter && documents_iter->data;
documents_iter = documents_iter->next)
{
document = (XeditDocument *) documents_iter->data;
document = (XedDocument *) documents_iter->data;
g_signal_handlers_disconnect_by_data (document, plugin);
}
@@ -188,26 +188,26 @@ impl_deactivate (XeditPlugin *plugin,
}
static void
xedit_trail_save_plugin_init (XeditTrailSavePlugin *plugin)
xed_trail_save_plugin_init (XedTrailSavePlugin *plugin)
{
xedit_debug_message (DEBUG_PLUGINS, "XeditTrailSavePlugin initializing");
xed_debug_message (DEBUG_PLUGINS, "XedTrailSavePlugin initializing");
}
static void
xedit_trail_save_plugin_finalize (GObject *object)
xed_trail_save_plugin_finalize (GObject *object)
{
xedit_debug_message (DEBUG_PLUGINS, "XeditTrailSavePlugin finalizing");
xed_debug_message (DEBUG_PLUGINS, "XedTrailSavePlugin finalizing");
G_OBJECT_CLASS (xedit_trail_save_plugin_parent_class)->finalize (object);
G_OBJECT_CLASS (xed_trail_save_plugin_parent_class)->finalize (object);
}
static void
xedit_trail_save_plugin_class_init (XeditTrailSavePluginClass *klass)
xed_trail_save_plugin_class_init (XedTrailSavePluginClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
XeditPluginClass *plugin_class = XEDIT_PLUGIN_CLASS (klass);
XedPluginClass *plugin_class = XED_PLUGIN_CLASS (klass);
object_class->finalize = xedit_trail_save_plugin_finalize;
object_class->finalize = xed_trail_save_plugin_finalize;
plugin_class->activate = impl_activate;
plugin_class->deactivate = impl_deactivate;

View File

@@ -0,0 +1,70 @@
/*
* xed-trail-save-plugin.h
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $Id$
*/
#ifndef __XED_TRAIL_SAVE_PLUGIN_H__
#define __XED_TRAIL_SAVE_PLUGIN_H__
#include <glib.h>
#include <glib-object.h>
#include <xed/xed-plugin.h>
G_BEGIN_DECLS
/*
* Type checking and casting macros
*/
#define XED_TYPE_TRAIL_SAVE_PLUGIN (xed_trail_save_plugin_get_type ())
#define XED_TRAIL_SAVE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XED_TYPE_TRAIL_SAVE_PLUGIN, XedTrailSavePlugin))
#define XED_TRAIL_SAVE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XED_TYPE_TRAIL_SAVE_PLUGIN, XedTrailSavePluginClass))
#define XED_IS_TRAIL_SAVE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XED_TYPE_TRAIL_SAVE_PLUGIN))
#define XED_IS_TRAIL_SAVE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XED_TYPE_TRAIL_SAVE_PLUGIN))
#define XED_TRAIL_SAVE_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XED_TYPE_TRAIL_SAVE_PLUGIN, XedTrailSavePluginClass))
/*
* Main object structure
*/
typedef struct _XedTrailSavePlugin XedTrailSavePlugin;
struct _XedTrailSavePlugin
{
XedPlugin parent_instance;
};
/*
* Class definition
*/
typedef struct _XedTrailSavePluginClass XedTrailSavePluginClass;
struct _XedTrailSavePluginClass
{
XedPluginClass parent_class;
};
/*
* Public methods
*/
GType xed_trail_save_plugin_get_type (void) G_GNUC_CONST;
/* All the plugins must implement this function */
G_MODULE_EXPORT GType register_xed_plugin (GTypeModule *module);
G_END_DECLS
#endif /* __XED_TRAIL_SAVE_PLUGIN_H__ */

View File

@@ -1,70 +0,0 @@
/*
* xedit-trail-save-plugin.h
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $Id$
*/
#ifndef __XEDIT_TRAIL_SAVE_PLUGIN_H__
#define __XEDIT_TRAIL_SAVE_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_TRAIL_SAVE_PLUGIN (xedit_trail_save_plugin_get_type ())
#define XEDIT_TRAIL_SAVE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XEDIT_TYPE_TRAIL_SAVE_PLUGIN, XeditTrailSavePlugin))
#define XEDIT_TRAIL_SAVE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XEDIT_TYPE_TRAIL_SAVE_PLUGIN, XeditTrailSavePluginClass))
#define XEDIT_IS_TRAIL_SAVE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XEDIT_TYPE_TRAIL_SAVE_PLUGIN))
#define XEDIT_IS_TRAIL_SAVE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XEDIT_TYPE_TRAIL_SAVE_PLUGIN))
#define XEDIT_TRAIL_SAVE_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XEDIT_TYPE_TRAIL_SAVE_PLUGIN, XeditTrailSavePluginClass))
/*
* Main object structure
*/
typedef struct _XeditTrailSavePlugin XeditTrailSavePlugin;
struct _XeditTrailSavePlugin
{
XeditPlugin parent_instance;
};
/*
* Class definition
*/
typedef struct _XeditTrailSavePluginClass XeditTrailSavePluginClass;
struct _XeditTrailSavePluginClass
{
XeditPluginClass parent_class;
};
/*
* Public methods
*/
GType xedit_trail_save_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_TRAIL_SAVE_PLUGIN_H__ */