From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Mon, 16 Jul 2007 16:29:28 +0200 From: Matthias Schmidt To: 9fans@cse.psu.edu Message-id: <1184596169.10886.12.camel@baldur> MIME-version: 1.0 Content-type: text/plain Content-transfer-encoding: 7BIT Cc: Subject: [9fans] Added application-Icon for drawterm X11 GUI Topicbox-Message-UUID: 955707ea-ead2-11e9-9d60-3106f5b1d025 Hi *, i've added an application icon (glenda) to the X11 GUI of drawterm. This shows an glenda thumbnail for drawterm under window systems like GNOME, etc. I found this useful while working on XWindows. cheers, Matthias > $ cat glenda.xbm > #define icon_bitmap_width 48 > #define icon_bitmap_height 48 > static unsigned short icon_bitmap_bits[] = { > 0xffff, 0xffff, 0xffff, 0xffff, 0xffe9, 0xffff, 0x7fff, 0xffae, 0xffff, > 0xffff, 0xffbe, 0xffff, 0x1fff, 0xff3f, 0xffff, 0xbfff, 0xfe6e, 0xffff, > 0xbbff, 0xfcce, 0xffff, 0xffff, 0xf98c, 0xffff, 0xe5ff, 0xf31b, 0xffff, > 0x87ff, 0xe617, 0xffff, 0x05ff, 0xdf37, 0xffff, 0x0fff, 0x7ffe, 0xffff, > 0x1bff, 0xfffc, 0xfffa, 0x37ff, 0xfffc, 0xfffb, 0xd7ff, 0xfffc, 0xfff7, > 0xcfff, 0xffff, 0xfff7, 0xcfff, 0xffff, 0xffef, 0xdfff, 0xffff, 0xffef, > 0xafff, 0xffff, 0xffdf, 0xefff, 0xffff, 0xfff3, 0xdfff, 0xefff, 0xffd3, > 0xdfff, 0xc7ff, 0xffdf, 0xefff, 0xefff, 0xffef, 0xcfff, 0xffff, 0xffcf, > 0xdfff, 0xffff, 0xffd9, 0x9fff, 0x7fff, 0xffd0, 0xbfff, 0xffff, 0xffd7, > 0x7fff, 0xbfff, 0xffd0, 0x3fff, 0x3fff, 0xffd9, 0x7fff, 0x3fff, 0xffcb, > 0x3fff, 0xffff, 0xffdc, 0x3fff, 0xffff, 0xffdf, 0x3fff, 0xffff, 0xff9f, > 0x3fff, 0xffff, 0xffdf, 0x8fff, 0xffff, 0xff9f, 0xa7ff, 0xffff, 0xffdf, > 0xe3ff, 0xffff, 0xffcf, 0xe9ff, 0xffff, 0xffcf, 0xf1ff, 0xffff, 0xffef, > 0xf3ff, 0xffff, 0xffe7, 0xf9ff, 0xffff, 0xffe7, 0x53ff, 0xffff, 0xffe1, > 0x07ff, 0x7ffc, 0xffc6, 0x17ff, 0xeff0, 0xffee, 0xffff, 0xc781, 0xffe5, > 0xffff, 0x8807, 0xffe0, 0xffff, 0x003f, 0xfff0, 0xffff, 0x1fff, 0xfffe }; > $ cat screen.diff > --- screen.c.SAVE 2007-07-07 21:46:04.000000000 +0200 > +++ screen.c 2007-07-09 09:56:22.000000000 +0200 > @@ -10,6 +10,7 @@ > #include > > #include "keysym2ucs.h" > +#include "glenda.xbm" > > /* > * alias defs for image types to overcome name conflicts > @@ -287,6 +288,10 @@ > XPixmapFormatValues *pfmt; > int n; > > + /* pixmap used to store the icon's image. */ > + Pixmap icon_pixmap; > + > + > xscreenid = 0; > xdrawable = 0; > > @@ -391,6 +396,13 @@ > xdrawable = XCreateWindow(xdisplay, rootwin, 0, 0, xsize, ysize, 0, > xscreendepth, InputOutput, xvis, CWBackPixel|CWBorderPixel|CWColormap, &attrs); > > + /* load the given bitmap data and create an X pixmap containing it. */ > + icon_pixmap = XCreateBitmapFromData(xdisplay, > + rootwin, > + (char *)icon_bitmap_bits, > + icon_bitmap_width, > + icon_bitmap_height); > + > /* > * set up property as required by ICCCM > */ > @@ -403,9 +415,11 @@ > normalhints.max_height = Dy(r); > normalhints.width = xsize; > normalhints.height = ysize; > - hints.flags = InputHint|StateHint; > + hints.flags = IconPixmapHint |InputHint|StateHint; > hints.input = 1; > hints.initial_state = NormalState; > + hints.icon_pixmap = icon_pixmap; > + > classhints.res_name = "drawterm"; > classhints.res_class = "Drawterm"; > argv[0] = "drawterm"; -- Matthias Schmidt Tel : (++49) 6227 356 236 Sun Microsystems GmbH Fax : (++49) 6227 356 222 Altrottstr. 31 Mobil : (++49) 171 5767209 D-69190 Walldorf