Custom icons per window class/name patch

Earle F. Philhower III earle@ziplabel.com
Sat May 24 06:42:00 GMT 2003


Howdy Ralf et. al.,

It wasn't too bad starting from Ralf's code to grab the pixmap info from
the WM_HINTS property to getting working X icons.  The attached patch is 
against
the test86 release.  It converts icons in the WM_HINTS into dynamic Windows
HICONs with masks and resizing.

I've tested it against a few apps and it seems to work 100% for icon sizes of
32x32 and 48x48, and in 8, 16, and 32 bit displays under Win2K.  24-bit and
non-square icons and icons <32x32 need to be tested, but should work...


At 01:15 PM 5/21/2003 +0200, Ralf wrote:
> > Good to hear, but how to compute in detail ? Additional what about the
> > performance ?
> > Using the xclient means to transfer the image data every time icon
> > setting will
> > be performed from the server to the client, which is the server, 
> although the
> > data is directly asseccable on the server, isn't it ?
> > I assume based on the things I have learned from you, that all the 
> image data
> > will be in some property on the server, which has only to be retrieved 
> in some
> > mysteric way.
> >
>I've got a little success.
>Now I'm able to retrieve the pixmap pointer from the WM_HINTS structure 
>and the
>bitmap data, the CreateIcon returns an icon handle, but unfortunally the icon
>isn't displayed.
>...
>winCreateWindowsWindow (WindowPtr pWin)
>...add the stuff below after the following two lines in 
>winmultiwindowwindow.c:
>winCreateWindowsWindow()
>   hIcon = LoadIcon (g_hInstance, MAKEINTRESOURCE(IDI_XWIN));
>   strcpy(classStr, WINDOW_CLASS_X);
>------------------------------------------------------------------
>   {
>   xPropWMHints *hints;
>   GetWMHints(pWin, &hints);
>...

-Earle F. Philhower, III
  earle@ziplabel.com
  cdrlabel - ZipLabel - FlpLabel
  http://www.cdrlabel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: true_x_icons.tar.bz2
Type: application/octet-stream
Size: 5496 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-xfree/attachments/20030524/32929740/attachment.obj>


More information about the Cygwin-xfree mailing list