KIconLoader loadIcon and overlays/emblems API change

Aaron J. Seigo aseigo at kde.org
Tue Jul 24 02:08:09 BST 2007


hi all...

the goal was to provide a way to have multiple overlays and not just the few 
that were defined via an emum. that isn't extensible (as in new overlays 
can't be added easily or in a back/forwards compatible way) and it also 
doesn't work very well with the icon naming spec's emblem-* icons.

i originally tried to move overlays out of KIconLoader and into KIcon and 
KIconEngine, but ran into two sets of problems:

- we don't get as good caching that way
- there are a good number of places that still call KIconLoader::loadIcon 
directly and expect overlay support.

attached is a patch that changes loadIcon to (unfortunately) take another 
optional parameter. i put it right after State since that is what used to be 
used to piggyback the overlay enum in on.

yes, this API is ugly, but KIconLoader and friends really need a rewrite that 
simply isn't going to happen for kde4 (particularly all the image<->pixmap 
conversions.. brrrrrr) ... benefits of the change are:

- we get emblem support on icons, one per corner (though that can easily be 
up'd without API changes in the future
- any emblem- icon can be used. we could change this to be simply -any- icon 
whatsoever, but the emblem- icons are meant to be used in this fashion and 
should also be shipped in tiny sizes appropriate for smaller icons.
- the artists are aware of this change, and would probably like to see even 
more things happen here =)

i wanted to get this out this morning but my desktop computer had a bit of a 
melt down. i spent a good part of the day fixing it and then rewriting the 
patch. as such i'm still waiting for kdelibs to finish building (at 45% atm) 
and kdebase to even start so i can test this version of the patch. *sigh*  
but you should get the idea from reading through it

i've made the necessary changes elsewhere in kdelibs and will port the rest of 
kde* as needed if this change is OK'd.

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Trolltech
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kiconloader_overlays.diff
Type: text/x-diff
Size: 13986 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070723/1c134efd/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070723/1c134efd/attachment.sig>


More information about the kde-core-devel mailing list