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

List:       kwin
Subject:    Re: Effect API additions patch
From:       Lubos Lunak <l.lunak () suse ! cz>
Date:       2007-04-03 15:41:14
Message-ID: 200704031741.14648.l.lunak () suse ! cz
[Download RAW message or body]

On Saturday 31 of March 2007, Rivo Laks wrote:
> Ühel kenal päeval (laupäev 31 märts 2007) kirjutas Lubos Lunak:
> > The supported() check and creating
> > the config widget (which maybe should be a separate .so like it's with
> > decorations)
>
> I'm not sure about this. Most effects will likely have quite a few (if any)
> configurable properties, so it might be easier to have everything in a
> single file and class. Also, having them in a single class would likely
> mean having just one method to load config, which IMHO would simplify
> things.

 You can have it all in one .so, even with having support for having it 
separate this would just mean specifying the same .so for both.

> > maybe should be handled directly in GenericEffectFactory (or
> > whatever will be responsible for finding and loading an effect) instead
> > of having it in the class and would also avoid the init(), which looks a
> > bit fragile and is against loading on-demand.
>
> So the factory would also have  "QWidget* configWidget()"  and  "bool
> supported()"  method in addition to the  create()? But how would those
> functions be implemented? Is it ok to have the default implementation work
> the same way (i.e. construct the effect, then call corresponding method) or
> have you got some better ideas?

 I was thinking that it'd work similarly to the decorations. You open the .so 
using KLibLoader and use its resolveFunction() to 
find "create_<effectname>", "supported_<effectname>" 
and "config_<effectname>". The create function creates and returns the effect 
object, supported returns bool, config returns QWidget or whatever. No config 
or always supported means those symbols are not even there. The factory 
object just wraps around this (loading of the lib and calling the necessary 
functions). Built-in effects can skip the KlibLoader stuff.

-- 
Lubos Lunak
KDE developer
--------------------------------------------------------------
SUSE LINUX, s.r.o.   e-mail: l.lunak@suse.cz , l.lunak@kde.org
Lihovarska 1060/12   tel: +420 284 028 972
190 00 Prague 9      fax: +420 284 028 951
Czech Republic       http//www.suse.cz
_______________________________________________
Kwin mailing list
Kwin@kde.org
https://mail.kde.org/mailman/listinfo/kwin

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

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