This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Custom icons per window class/name patch


Hi Ralf,

I did some checking in between packing today and it was relatively simple
to get the res_class and res_name of a window in the winCreateWin function,
but the thing is you can't use any XLib calls:  you're the server itself at
that point, and not a client!

I've done a quick-n-easy icon specifier, namely a file called
c:\windows\xwin.ini .  It's a standard old format text INI file with the
[sections] being the class and identifiers=c:\file.ico being the keys.
If a res_name isn't matched, it uses the _default key for the icon.  If
the res_class isn't matched, the default X icon is used...
Ex:
[XLoad]
_default=z:\tmp\xload.ico

[Fig]
_default=z:\tmp\xfig.ico
file_popup=z:\tmp\file.ico

Note you need Windoze paths since I call the API LoadImage() to get the ICO
into a handle.  Use "xprop" to get the res_name and res_class of a window.

There are 2 new small files, I created them in because they need special
includes that the main files don't need or want.

Feel free to use this as a base to add a nicer UI and maybe use XPMs and other
image formats instead of plain Windoze .icos...


-Earle F. Philhower, III earle@ziplabel.com cdrlabel - ZipLabel - FlpLabel http://www.cdrlabel.com

Attachment: icons_patch.tar.bz2
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]