Revision: 1747 http://geany.svn.sourceforge.net/geany/?rev=1747&view=rev Author: ntrel Date: 2007-07-26 05:06:12 -0700 (Thu, 26 Jul 2007)
Log Message: ----------- Use a single PluginData struct for all plugins.
Modified Paths: -------------- trunk/ChangeLog trunk/src/plugins.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-07-26 12:03:14 UTC (rev 1746) +++ trunk/ChangeLog 2007-07-26 12:06:12 UTC (rev 1747) @@ -2,6 +2,8 @@
* src/highlighting.c: Ignore whitespace_chars for Haxe. + * src/plugins.c: + Use a single PluginData struct for all plugins.
2007-07-26 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/src/plugins.c =================================================================== --- trunk/src/plugins.c 2007-07-26 12:03:14 UTC (rev 1746) +++ trunk/src/plugins.c 2007-07-26 12:06:12 UTC (rev 1747) @@ -42,7 +42,6 @@ { GModule *module; gchar *filename; // plugin filename (/path/libname.so) - PluginData data; PluginFields fields;
PluginInfo* (*info) (); /* Returns plugin name, description */ @@ -86,19 +85,25 @@ &ui_frame_new_with_alignment };
+static PluginData geany_data = { + NULL, + NULL, + NULL,
+ &doc_funcs, + &sci_funcs, + &template_funcs, + &utils_funcs, + &uiutils_funcs, +}; + + static void -init_plugin_data(PluginData *data) +geany_data_init() { - data->app = app; - data->tools_menu = lookup_widget(app->window, "tools1_menu"); - data->doc_array = doc_array; - - data->document = &doc_funcs; - data->sci = &sci_funcs; - data->templates = &template_funcs; - data->utils = &utils_funcs; - data->ui = &uiutils_funcs; + geany_data.app = app; + geany_data.tools_menu = lookup_widget(app->window, "tools1_menu"); + geany_data.doc_array = doc_array; }
@@ -206,8 +211,6 @@ plugin->filename = g_strdup(fname); plugin->module = module;
- init_plugin_data(&plugin->data); - g_module_symbol(module, "plugin_fields", (void *) &plugin_fields); if (plugin_fields) *plugin_fields = &plugin->fields; @@ -222,7 +225,7 @@ }
if (plugin->init) - plugin->init(&plugin->data); + plugin->init(&geany_data);
if (plugin->fields.flags & PLUGIN_IS_DOCUMENT_SENSITIVE) { @@ -260,7 +263,8 @@ PACKAGE_DATA_DIR G_DIR_SEPARATOR_S ".." G_DIR_SEPARATOR_S "lib" \ G_DIR_SEPARATOR_S PACKAGE
-void plugins_init() +static void +load_plugins() { const gchar *path = LIBDIR; GSList *list, *item; @@ -285,6 +289,13 @@ }
+void plugins_init() +{ + geany_data_init(); + load_plugins(); +} + + void plugins_free() { if (plugin_list != NULL)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.