[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 04:53:41 CET 2012
https://bugs.freedesktop.org/show_bug.cgi?id=44649
--- Comment #11 from Olli Salli <ollisal at gmail.com> 2012-01-12 03:53:41 UTC ---
(In reply to comment #9)
> (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?
Well, this PluginConnection could be what I referred to as
ConnectionPluginServices. But I like the idea of making the GabbleConnection
operations used by plugins virtual functions in it in addition to just having
it be a fake base GType, because then it'll be much easier to avoid pulling in
the universe as dependencies to those symbols.
--
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