[Bug 44649] Gabble plugin API symbols should be factored out to a separate library

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Jan 12 12:47:05 CET 2012


https://bugs.freedesktop.org/show_bug.cgi?id=44649

--- Comment #9 from Simon McVittie <simon.mcvittie at collabora.co.uk> 2012-01-12 03:47:05 PST ---
(In reply to comment #6)
> A dirty hack idea:
> 
> * define a global GType variable in the plugin lib
> * make some GabbleConnection construction function which is always called
> before  plugins are given the GabbleConnection set that variable to the real
> return value of gabble_connection_get_type()
> * define GABBLE_TYPE_CONNECTION to read that variable in plugins
> * ... but leave it really calling gabble_connection_get_type() for the gabble
> internals, so that the basic things like g_object_new work in the first place.

You don't need to go that far. Just define a GABBLE_TYPE_PLUGIN_CONNECTION
GInterface (whose only implementation is GabbleConnection) in the
plugin-enabler library, and have the plugins use GABBLE_IS_PLUGIN_CONNECTION
where they would normally use GABBLE_IS_CONNECTION, etc.

You could even have:

typedef struct _GabbleConnection GabbleConnection;

#ifndef GABBLE_IN_SRC
    /* we're compiling a plugin */
#   define GABBLE_TYPE_CONNECTION GABBLE_TYPE_PLUGIN_CONNECTION
#   define GABBLE_IS_CONNECTION(x) GABBLE_IS_PLUGIN_CONNECTION(x)
#   define GABBLE_CONNECTION(x) GABBLE_PLUGIN_CONNECTION(x)
    typedef GabbleConnection GabblePluginConnection;
    /* etc. */
#endif

in the plugin-enabler header, and -DGABBLE_IN_SRC in src/Makefile.am?

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.



More information about the telepathy-bugs mailing list