[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: klibfactory cleanup
From:       Simon Hausmann <hausmann () kde ! org>
Date:       2001-09-24 14:40:01
[Download RAW message or body]

On Mon, Sep 24, 2001 at 04:14:35PM +0200, Harri Porten wrote:
> On Mon, 24 Sep 2001, Simon Hausmann wrote:
> 
> > > #define KDE_EXPORT_COMPONENT_FACTORY( factory ) \
> > >    extern "C" void *kde_init#factory() { return new factory; }
> > > 
> > > ?
> > 
> > And how do you find out the kde_init<Factory> symbol name when all you know
> > is the dsoname? :-} (factory argument can be "MyFoo" while the libname is
> > "libblah", where only the latter you know from the dlopen'ing side)
> 
> Then let the export macro have two arguments.
> 
> > Do I understand things correctly that it comes down to the question if
> > we want to be able to statically link components and if we want to run
> > on platforms unsupported by Qt? ;-)
> 
> AFAIK Designer only works on Windows with a static built I'd be careful
> to use the word "supported" as this would leave 0 platforms for KDE ;)

;)
 
(surprises me btw, given the duplicated ucm_instantiated symbols :)

> Seriously: the main reason why I'd be against a unique symbol name is the
> limitation to one factory per library. But if that's not so much of an
> issue I wouldn't care so much.

The only place I've seen sofar where two entry points are used is kcontrol,
where a create_* symbol is used to instantiate the kcontrol module and
IIRC something like init_* is called by kcminit.

Independant from the portability question of having a fixed entry point symbol or not
I think this should be simplified as well. (we could use typelists and a template
to create factories for multiple types on the fly using one statement, for example)

Back to the kde_init* thing. As I'm apparently the only person finding this a tiny 
API problem that could be solved easily I hereby give up :) 

Unless there are further objections I'll add your KDE_EXPORT_COMPONENT_FACTORY macro 
with two arguments to kcomponentfactory.h then (after renaming KLibFactory to 
KComponentFactory - unless someone objects against it :)


Simon

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic