What are the objectives for Xfce 4.4?
edscott wilson garcia
edscott at xfce.org
Fri Feb 4 15:39:36 CET 2005
El vie, 04-02-2005 a las 14:59 +0400, Maarten Boekhold escribió:
> Hi All,
>
> One of the design goals I would like to see is a rework of the various
> plugin interfaces. At the moment, the plugin interfaces do not work
> correctly/completely on Cygwin, and due to Windows limitations they
> cannot be made to work if we stick to the current design.
>
> Some time ago I had a brief discussion with Jasper, and the idea came up
> to populate a v-table in the application. This v-table would contain
> pointers to all functions & variables inside the application that can be
> called/used by the plugin. The v-table is passed to the module when the
> module is loaded. Xffm uses something like this already (xfce4_combo,
> xfce4_mime_icons etc.), although it does this the other way around (eg
> it creates a v-table of functions in the plugin that xffm can call).
For plugins in xffm which are not meant to be shared with other
applications, in CVS I'm currently creating a vtable, not of function
pointers, but of symbol names. This resides in the main program. To
access any function I use the following simple routine:
G_MODULE_EXPORT
void *
function_pe( const gchar *librarydir,
const gchar *module_name,
void *data,
const gchar *function_id)
{
gchar *(*function)(void);
module_info_t *module_info;
if (!librarydir || !module_name || !function_id) return NULL;
module_info=get_module_info(librarydir, module_name);
if (!module_info) return NULL;
if (!g_module_symbol (module_info->module_cm, function_id,(gpointer)
&(function)) ) return NULL;
return (*function)(data);
}
Which allows me to query the plugin about it's capabilities.
>
> I'll have to see how much time I can allocate to help out on this. If we
> can come up with a nice project plan for this, the next release date
> isn't too aggressive and we accept a temporary breakage of Xfce (we'll
> need to break the existing plugin interfaces for a while until
> everything has settled down), I might even be able to work on this...
>
> As a very quick background: on windows you cannot have a plugin
> reference a *variable* which is defined in the application that loads
> the module (but it can reference a function).
>
I see. But can the plugin reference a variable that is in a library that is
dynamically linked to the program?
Methinks it can, otherwise such common stuff as the
global variable "errno", which is defined in a dynamic library, would not be accessible
from plugins in cygwin. Is this the case?
regards,
Edscott
--
edscott wilson garcia <edscott at xfce.org>
More information about the Xfce4-dev
mailing list