Kaydet (Commit) 80b93603 authored tarafından Nick Treleaven's avatar Nick Treleaven

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.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3309 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst b5ff1973
......@@ -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>
......
......@@ -50,6 +50,10 @@ This allows the use of normal API function names in plugins. */
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 \
......
......@@ -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 @@ GeanyData;
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 @@ typedef struct GeanyFunctions
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 @@ DocumentFuncs;
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 @@ typedef struct ScintillaFuncs
void (*indicator_clear) (struct _ScintillaObject *sci, gint start, gint end);
void (*indicator_set) (struct _ScintillaObject *sci, gint indic);
}
ScintillaFuncs;
SciFuncs;
/* See templates.h */
......
......@@ -138,8 +138,16 @@ static EditorFuncs editor_funcs = {
&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 @@ static GeanyFunctions geany_functions = {
&navqueue_funcs,
&editor_funcs,
&main_funcs,
&plugin_funcs
&plugin_funcs,
&scintilla_funcs
};
static GeanyData geany_data;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment