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