SF.net SVN: geany:[3309] trunk
ntrel at users.sourceforge.net
ntrel at xxxxx
Wed Dec 3 13:36:47 UTC 2008
Revision: 3309
http://geany.svn.sourceforge.net/geany/?rev=3309&view=rev
Author: ntrel
Date: 2008-12-03 13:36:45 +0000 (Wed, 03 Dec 2008)
Log Message:
-----------
Add scintilla_send_message() to the API with its own prefix, so
the geanyfunctions.h macro works.
Deprecate p_sci->send_message().
Add scintilla_new() to the plugin API.
Modified Paths:
--------------
trunk/ChangeLog
trunk/plugins/geanyfunctions.h
trunk/src/plugindata.h
trunk/src/plugins.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-12-03 12:41:05 UTC (rev 3308)
+++ trunk/ChangeLog 2008-12-03 13:36:45 UTC (rev 3309)
@@ -3,6 +3,11 @@
* plugins/Makefile.am, src/Makefile.am:
Move target for geanyfunctions.h to plugins/Makefile.am and depend
on src/plugins.c instead of all plugin API headers.
+ * src/plugindata.h, src/plugins.c, plugins/geanyfunctions.h:
+ Add scintilla_send_message() to the API with its own prefix, so
+ the geanyfunctions.h macro works.
+ Deprecate p_sci->send_message().
+ Add scintilla_new() to the plugin API.
2008-12-02 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/plugins/geanyfunctions.h
===================================================================
--- trunk/plugins/geanyfunctions.h 2008-12-03 12:41:05 UTC (rev 3308)
+++ trunk/plugins/geanyfunctions.h 2008-12-03 13:36:45 UTC (rev 3309)
@@ -50,6 +50,10 @@
p_editor->set_indent_type
#define scintilla_send_message \
p_scintilla->send_message
+#define scintilla_new \
+ p_scintilla->new
+#define dummyprefix_scintilla_send_message \
+ p_dummyprefix->scintilla_send_message
#define sci_cmd \
p_sci->cmd
#define sci_start_undo_action \
Modified: trunk/src/plugindata.h
===================================================================
--- trunk/src/plugindata.h 2008-12-03 12:41:05 UTC (rev 3308)
+++ trunk/src/plugindata.h 2008-12-03 13:36:45 UTC (rev 3309)
@@ -45,7 +45,7 @@
enum {
/** The Application Programming Interface (API) version, incremented
* whenever any plugin data types are modified or appended to. */
- GEANY_API_VERSION = 113,
+ GEANY_API_VERSION = 114,
/** The Application Binary Interface (ABI) version, incremented whenever
* existing fields in the plugin data types have to be changed or reordered. */
@@ -198,7 +198,7 @@
typedef struct GeanyFunctions
{
struct DocumentFuncs *p_document; /**< See document.h */
- struct ScintillaFuncs *p_sci; /**< See sciwrappers.h */
+ struct SciFuncs *p_sci; /**< See sciwrappers.h */
struct TemplateFuncs *p_templates; /**< See templates.h */
struct UtilsFuncs *p_utils; /**< See utils.h */
struct UIUtilsFuncs *p_ui; /**< See ui_utils.h */
@@ -216,6 +216,8 @@
struct EditorFuncs *p_editor; /**< See editor.h */
struct MainFuncs *p_main; /**< See main.h */
struct PluginFuncs *p_plugin; /**< See plugins.c */
+ /** See http://scintilla.org for the documentation. */
+ struct ScintillaFuncs *p_scintilla;
}
GeanyFunctions;
@@ -250,11 +252,23 @@
struct _ScintillaObject;
-/** See sciwrappers.h. */
+/** See http://scintilla.org for the documentation. */
typedef struct ScintillaFuncs
{
- /** Send Scintilla a message.
- * @see http://scintilla.org for the documentation. */
+ /** Send Scintilla a message. */
+ long int (*send_message) (struct _ScintillaObject* sci, unsigned int iMessage,
+ long unsigned int wParam, long int lParam);
+ /** Create a new ScintillaObject widget. */
+ GtkWidget* (*new)(void);
+}
+ScintillaFuncs;
+
+
+/** Wrapper functions for Scintilla messages.
+ * See sciwrappers.h for the list of functions. */
+typedef struct SciFuncs
+{
+ /** @deprecated Use @ref ScintillaFuncs::send_message() instead. */
long int (*send_message) (struct _ScintillaObject* sci, unsigned int iMessage,
long unsigned int wParam, long int lParam);
void (*send_command) (struct _ScintillaObject* sci, gint cmd);
@@ -296,7 +310,7 @@
void (*indicator_clear) (struct _ScintillaObject *sci, gint start, gint end);
void (*indicator_set) (struct _ScintillaObject *sci, gint indic);
}
-ScintillaFuncs;
+SciFuncs;
/* See templates.h */
Modified: trunk/src/plugins.c
===================================================================
--- trunk/src/plugins.c 2008-12-03 12:41:05 UTC (rev 3308)
+++ trunk/src/plugins.c 2008-12-03 13:36:45 UTC (rev 3309)
@@ -138,8 +138,16 @@
&editor_set_indent_type
};
-static ScintillaFuncs sci_funcs = {
+static ScintillaFuncs scintilla_funcs = {
&scintilla_send_message,
+ &scintilla_new
+};
+
+/* Macro to prevent a duplicate macro being generated in geanyfunctions.h */
+#define dummyprefix_scintilla_send_message scintilla_send_message
+
+static SciFuncs sci_funcs = {
+ &dummyprefix_scintilla_send_message,
&sci_cmd,
&sci_start_undo_action,
&sci_end_undo_action,
@@ -293,7 +301,8 @@
&navqueue_funcs,
&editor_funcs,
&main_funcs,
- &plugin_funcs
+ &plugin_funcs,
+ &scintilla_funcs
};
static GeanyData geany_data;
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