kwin clients - virtual colorsSupported()?
Matthew Woehlke
mw_triad at users.sourceforge.net
Tue Nov 27 22:25:25 GMT 2007
Lubos Lunak wrote:
> On Ășt 27. listopadu 2007, Matthew Woehlke wrote:
>> Lubos Lunak wrote:
>>> If all you need is querying a decoration whether it supports something,
>>> see KDecorationFactory::supports(). This is already done for buttons -
>>> there's one flag for querying whether the client supports announcing
>>> supported buttons :) and then there's one flag per button. You can have
>>> the same for window roles.
>> Ok. aseigo and I talked on IRC, and came up with two recommended solutions:
>>
>> 1. add color types to Ability
>> + no new API, BC
>> - all clients must be updated or result will be wrong
>
> "or the result will be the default". Which should make it the same like 2a
> here.
>
>> 2a. add 'virtual supports(ColorType) const;' to KDecorationFactory
>> + reuses existing enum
>
> Which can be however simple to map.
>
>> - BIC
>
> BC/BIC shouldn't matter that much, I still want to change something there.
>
>> - clients might forget to override it
>> 2b. add 'virtual supports(ColorType) const = 0;' to KDecorationFactory
>> + reuses existing enum
>> + clients must override it, more likely to do it correctly
>
> Long live copy&paste! I wonder if anybody has started writing a new windeco
> from scratch in the recent years.
>
>> - BIC
>> - all clients must be updated
>>
>> Lubos, you're the maintainer, what do you think? aseigo and I both
>> prefer 2; aseigo likes 2a, while I lean a bit toward 2b.
>
> I would actually prefer 1, since that's exactly what supports() was designed
> for and should be the one place for it. But I don't insist.
I would prefer 1 also, except that you:
= have to change all clients else have broken stuffs
...or...
= have an "understands 'supports(Color*)'" ability, and either:
- have a wrapper function to hide that from callers, or
- have to check both in callers
...or do I miss something? If you're OK with changing all clients, then
I'm OK with 1.
--
Matthew
"Still not King." -- Aragorn
(as quoted in The Very Secret Diaries by Cassandra Claire)
http://www.ealasaid.com/misc/vsd/
More information about the kde-core-devel
mailing list