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 @@
# 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__ */