SF.net SVN: geany:[4508] trunk
eht16 at users.sourceforge.net
eht16 at xxxxx
Tue Dec 29 18:23:54 UTC 2009
Revision: 4508
http://geany.svn.sourceforge.net/geany/?rev=4508&view=rev
Author: eht16
Date: 2009-12-29 18:23:54 +0000 (Tue, 29 Dec 2009)
Log Message:
-----------
Add editor_get_eol_char_name(), editor_get_eol_char_len() and editor_get_eol_char() to the plugin API.
Modified Paths:
--------------
trunk/ChangeLog
trunk/plugins/geanyfunctions.h
trunk/src/editor.c
trunk/src/plugindata.h
trunk/src/plugins.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2009-12-26 14:13:35 UTC (rev 4507)
+++ trunk/ChangeLog 2009-12-29 18:23:54 UTC (rev 4508)
@@ -1,3 +1,11 @@
+2009-12-29 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
+
+ * src/editor.c, src/plugins.c, src/plugindata.h,
+ plugins/geanyfunctions.h:
+ Add editor_get_eol_char_name(), editor_get_eol_char_len() and
+ editor_get_eol_char() to the plugin API.
+
+
2009-12-26 Frank Lanitz <frank at frank.uvena.de>
* doc/plugins.dox:
Modified: trunk/plugins/geanyfunctions.h
===================================================================
--- trunk/plugins/geanyfunctions.h 2009-12-26 14:13:35 UTC (rev 4507)
+++ trunk/plugins/geanyfunctions.h 2009-12-29 18:23:54 UTC (rev 4508)
@@ -80,6 +80,12 @@
geany_functions->p_editor->set_indent_type
#define editor_get_word_at_pos \
geany_functions->p_editor->get_word_at_pos
+#define editor_get_eol_char_name \
+ geany_functions->p_editor->get_eol_char_name
+#define editor_get_eol_char_len \
+ geany_functions->p_editor->get_eol_char_len
+#define editor_get_eol_char \
+ geany_functions->p_editor->get_eol_char
#define scintilla_send_message \
geany_functions->p_scintilla->send_message
#define scintilla_new \
Modified: trunk/src/editor.c
===================================================================
--- trunk/src/editor.c 2009-12-26 14:13:35 UTC (rev 4507)
+++ trunk/src/editor.c 2009-12-29 18:23:54 UTC (rev 4508)
@@ -4254,6 +4254,16 @@
}
+/**
+ * Retrieves the localized name (for displaying) of the used end of line characters
+ * (LF, CR/LF, CR) in the given editor.
+ * If @a editor is @c NULL, the default end of line characters are used.
+ *
+ * @param editor The editor to operate on, or @c NULL to query the default value.
+ * @return The name of the end of line characters.
+ *
+ * @since 0.19
+ */
const gchar *editor_get_eol_char_name(GeanyEditor *editor)
{
gint mode = file_prefs.default_eol_character;
@@ -4265,7 +4275,16 @@
}
-/* returns the end-of-line character(s) length of the specified editor */
+/**
+ * Retrieves the length of the used end of line characters (LF, CR/LF, CR) in the given editor.
+ * If @a editor is @c NULL, the default end of line characters are used.
+ * The returned value is 1 for CR and LF and 2 for CR/LF.
+ *
+ * @param editor The editor to operate on, or @c NULL to query the default value.
+ * @return The length of the end of line characters.
+ *
+ * @since 0.19
+ */
gint editor_get_eol_char_len(GeanyEditor *editor)
{
gint mode = file_prefs.default_eol_character;
@@ -4281,7 +4300,16 @@
}
-/* returns the end-of-line character(s) of the specified editor */
+/**
+ * Retrieves the used end of line characters (LF, CR/LF, CR) in the given editor.
+ * If @a editor is @c NULL, the default end of line characters are used.
+ * The returned value is either "\n", "\r\n" or "\r".
+ *
+ * @param editor The editor to operate on, or @c NULL to query the default value.
+ * @return The end of line characters.
+ *
+ * @since 0.19
+ */
const gchar *editor_get_eol_char(GeanyEditor *editor)
{
gint mode = file_prefs.default_eol_character;
Modified: trunk/src/plugindata.h
===================================================================
--- trunk/src/plugindata.h 2009-12-26 14:13:35 UTC (rev 4507)
+++ trunk/src/plugindata.h 2009-12-29 18:23:54 UTC (rev 4508)
@@ -50,7 +50,7 @@
enum {
/** The Application Programming Interface (API) version, incremented
* whenever any plugin data types are modified or appended to. */
- GEANY_API_VERSION = 165,
+ GEANY_API_VERSION = 166,
/** The Application Binary Interface (ABI) version, incremented whenever
* existing fields in the plugin data types have to be changed or reordered. */
@@ -559,8 +559,9 @@
void (*set_indent_type)(struct GeanyEditor *editor, GeanyIndentType type);
gchar* (*get_word_at_pos) (struct GeanyEditor *editor, gint pos, const gchar *wordchars);
- /* Remember to convert any GeanyDocument or ScintillaObject pointers in any
- * appended functions to GeanyEditor pointers. */
+ const gchar* (*get_eol_char_name) (struct GeanyEditor *editor);
+ gint (*get_eol_char_len) (struct GeanyEditor *editor);
+ const gchar* (*get_eol_char) (struct GeanyEditor *editor);
}
EditorFuncs;
Modified: trunk/src/plugins.c
===================================================================
--- trunk/src/plugins.c 2009-12-26 14:13:35 UTC (rev 4507)
+++ trunk/src/plugins.c 2009-12-29 18:23:54 UTC (rev 4508)
@@ -117,7 +117,10 @@
&editor_indicator_set_on_line,
&editor_indicator_clear,
&editor_set_indent_type,
- &editor_get_word_at_pos
+ &editor_get_word_at_pos,
+ &editor_get_eol_char_name,
+ &editor_get_eol_char_len,
+ &editor_get_eol_char
};
static ScintillaFuncs scintilla_funcs = {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Commits
mailing list