Hi,
sorry to not have been very present in the discussion so far..
Le 14 févr. 05, à 11:05, Quentin Mathé a écrit :
Basically, every IKIcon that is a standard icon knows its icon
identifier, and thus knows how to reload its icon image from the
corresponding image file from the current theme. To do this, you use
the -update method.
Every composited icon, OTOH, will eventually carry a pointer to the
two IKIcon objects it is based on around. That way, when the theme is
changed and e.g. the folder icon changes, all IKIcons that are badged
folders can register for the icon updated notification of the icon
they're based on and re-composite themselves with the updated icons.
We should probably implement such solution I think.
if we want "live" update we need some kind of tracking, yes..
But I don't think we're limited to two composited icons.. you can have
an icon resulting of a lot more compositions than that..
So, whenever a theme switch happens, all the icon provider will have
to do is call "update" on the icon cache, and all icons on the
display should upgrade automatically. Of course, anyone who held on
to the NSImage won't get the update, but those using the IKIcon at
least will.
Themes switch (icons included) wasn't currently planned to be instant,
it was planned to be done upon applications launch, but may be such
possibility can be studied with pixmaps themes for Camaelon or
eventually for icons retrieved with NSImage (we could hack NSImage
with such feature).
A possibility for themes supports is to have Camaelon using IKIcon for
pixmaps elements, then it would be easy to have them altered on the
fly with notifications when a theme change happens, and because
Camaelon and IconKit has been really created to be used together,
having Camaelon relying on IconKit isn't a problem, it would avoid the
need to hack NSImage (Anyway fallback on NSImage could be implemented
for Camaelon when IconKit isn't installed…)… Nicolas what do you think
?
Hmm, actually, using a separate composition object is a good idea for
Camaelon !
(instead the actual bunch of class methods used for the composition of
the pixmaps... and it should simplify the caching design...)
But I'm not sure Camaelon should use IKIcon anyway -- seems a bit
bloat, no ? IKIcon's job is doing icons.
If the only thing you want is notification, anyway, I doubt it's
efficient (for Camaelon) to have the notification handled at the
"element" level -- you want a general notification, period.
--
Nicolas Roard
"Any sufficiently advanced technology is indistinguishable from magic."
-Arthur C. Clarke