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,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__ */