SF.net SVN: geany: [2610] trunk
ntrel at users.sourceforge.net
ntrel at xxxxx
Fri May 23 12:29:32 UTC 2008
Revision: 2610
http://geany.svn.sourceforge.net/geany/?rev=2610&view=rev
Author: ntrel
Date: 2008-05-23 05:29:32 -0700 (Fri, 23 May 2008)
Log Message:
-----------
Make GeanyCallback, geany_callbacks deprecated, and replace with
PluginCallback, plugin_callbacks. This is because the array is owned
by the plugin, not Geany.
Modified Paths:
--------------
trunk/ChangeLog
trunk/doc/plugin-symbols.c
trunk/doc/plugins.dox
trunk/src/plugindata.h
trunk/src/plugins.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-05-22 14:41:28 UTC (rev 2609)
+++ trunk/ChangeLog 2008-05-23 12:29:32 UTC (rev 2610)
@@ -1,3 +1,12 @@
+2008-05-23 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * src/plugindata.h, src/plugins.c, doc/plugin-symbols.c,
+ doc/plugins.dox:
+ Make GeanyCallback, geany_callbacks deprecated, and replace with
+ PluginCallback, plugin_callbacks. This is because the array is owned
+ by the plugin, not Geany.
+
+
2008-05-22 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/templates.c, src/build.c, src/utils.c, src/ui_utils.h,
Modified: trunk/doc/plugin-symbols.c
===================================================================
--- trunk/doc/plugin-symbols.c 2008-05-22 14:41:28 UTC (rev 2609)
+++ trunk/doc/plugin-symbols.c 2008-05-23 12:29:32 UTC (rev 2610)
@@ -53,7 +53,7 @@
/** An array for connecting GeanyObject events, which should be terminated with
* @c {NULL, NULL, FALSE, NULL}. See @link signals Signal documentation @endlink. */
-GeanyCallback geany_callbacks[];
+PluginCallback plugin_callbacks[];
/** Most plugins should use the PLUGIN_KEY_GROUP() macro to define it. However,
* its fields are not read until after init() is called for the plugin, so it
Modified: trunk/doc/plugins.dox
===================================================================
--- trunk/doc/plugins.dox 2008-05-22 14:41:28 UTC (rev 2609)
+++ trunk/doc/plugins.dox 2008-05-23 12:29:32 UTC (rev 2610)
@@ -55,9 +55,9 @@
*
* @section Usage
*
- * To use plugin signals in Geany, you simply create a GeanyCallback array, list the signals
+ * To use plugin signals in Geany, you simply create a PluginCallback array, list the signals
* you want to listen to and create the appropiate signal callbacks for each signal.
- * @note The GeanyCallback array has to be ended with a final NULL entry.
+ * @note The PluginCallback array has to be ended with a final NULL entry.
*
* The following code demonstrates how to use signals in Geany plugins. The code can be inserted
* in your plugin code at any desired position.
@@ -68,7 +68,7 @@
printf("Example: %s was opened\n", DOC_FILENAME(idx));
}
-GeanyCallback geany_callbacks[] =
+PluginCallback plugin_callbacks[] =
{
{ "document-open", (GCallback) &on_document_open, FALSE, NULL },
{ NULL, NULL, FALSE, NULL }
Modified: trunk/src/plugindata.h
===================================================================
--- trunk/src/plugindata.h 2008-05-22 14:41:28 UTC (rev 2609)
+++ trunk/src/plugindata.h 2008-05-23 12:29:32 UTC (rev 2610)
@@ -111,7 +111,7 @@
/** callback array entry */
-typedef struct GeanyCallback
+typedef struct PluginCallback
{
/** The name of signal, must be an existing signal. For a list of available signals,
* please see the @link signals Signal documentation @endlink. */
@@ -123,7 +123,7 @@
/** The user data passed to the signal handler. */
gpointer user_data;
}
-GeanyCallback;
+PluginCallback;
@@ -442,13 +442,15 @@
#define GEANY_MAX_FILE_TYPES \
filetypes_array->len
-
#define GEANY_FILETYPES_ALL \
GEANY_FILETYPES_NONE
typedef struct _GeanyDocument document;
typedef struct _GeanyFiletype filetype;
+typedef PluginCallback GeanyCallback;
+#define geany_callbacks plugin_callbacks
+
#endif /* GEANY_DISABLE_DEPRECATED */
#endif
Modified: trunk/src/plugins.c
===================================================================
--- trunk/src/plugins.c 2008-05-22 14:41:28 UTC (rev 2609)
+++ trunk/src/plugins.c 2008-05-23 12:29:32 UTC (rev 2610)
@@ -378,9 +378,9 @@
}
-static void add_callbacks(Plugin *plugin, GeanyCallback *callbacks)
+static void add_callbacks(Plugin *plugin, PluginCallback *callbacks)
{
- GeanyCallback *cb;
+ PluginCallback *cb;
guint i, len = 0;
while (TRUE)
@@ -428,7 +428,7 @@
static void
plugin_init(Plugin *plugin)
{
- GeanyCallback *callbacks;
+ PluginCallback *callbacks;
if (plugin->init)
plugin->init(&geany_data);
@@ -439,7 +439,7 @@
gtk_widget_set_sensitive(plugin->fields.menu_item, enable);
}
- g_module_symbol(plugin->module, "geany_callbacks", (void *) &callbacks);
+ g_module_symbol(plugin->module, "plugin_callbacks", (void *) &callbacks);
if (callbacks)
add_callbacks(plugin, callbacks);
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