Icons in 6.7-6

Lev S Bishop lev.bishop@yale.edu
Mon Apr 26 04:35:00 GMT 2004

Earle wrote:
> Sure, I'd like to hear the cause!

When you use LoadIcon(), windows keeps track of the original source of the 
icon, so that if a different sized icon is required, it can go back to 
that resource/file and load up the appropriate sized icon from there. If 
you use loadimage, then it keeps no record of the original source, and if 
a different sized (ie small) icon is required, all it can do is attempt to 
rescale the loaded version, which generally doesn't work out to be as 
pretty as an icon specifically designed at that size.

>  Were you planning on sidestepping the
> issue by making a wrapper around the ICON/IMAGE to keep track of whether
> you LoadIcon()'d or LoadImaged()'d them, so you know how to get rid of
> them?

No, I was planning on explicitly LoadImage()ing both small and large
icons, so that _all_ icons are loaded nicely at large and small sizes, not
just the default X. 

I was also going to extend the xwinrc language to allow explicitly setting
the large and small icons should you desire them to be different.  I was
going to use the system metrics to set WM_ICON_SIZE on the root window
properly, just in case any clients actually pay attention to that.  And I
was going to look at _NET_WM_ICON for clients that adhere to that extended
ICCCM standard (gnome and kde stuff).

> I also stumbled upon the cygwin calls for converting from cygwin paths
> to Win32 paths, it may make sense to support both path types when
> specifying from where to load ICONs.
> PNG icon support would be neat and easy too, but it doesn't look like
> libpng is standard in the X tree and I wouldn't want to add 
> dependencies...

Yeah, I was also toying with adding support for other graphics formats,
filtering, porter&duff operations, etc, by adding some way to hook into
ImageMagick or GraphicsMagick (whichever it is that's supported on
cygwin), but I'd have to do it in such a way that *Magick wasn't required
if you didn't use those features. Haven't thought that aspect through yet.
Maybe I could just program the few features that would actually be
relevant to icon processing -- I haven't done any image processing for a
while so it might be fun.

Extending the xwinrc language should be easy since it's parsed with a 
yacc grammar.

The hardest part of all this will probably be writing the manual....


More information about the Cygwin-xfree mailing list