code: drawterm

Download patch

ref: 9b112390be4362d64cfa2d75c4c7e131e38c2153
parent: 276098f816a9188c711f51ace9a92df54997b791
author: Russ Cox <rsc@swtch.com>
date: Wed Aug 22 10:36:59 EDT 2007

add glenda icon (Matthias Schmidt)

--- /dev/null
+++ b/gui-x11/glenda.xbm
@@ -1,0 +1,19 @@
+#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 };
--- a/gui-x11/screen.c
+++ b/gui-x11/screen.c
@@ -10,6 +10,7 @@
 #include <X11/keysym.h>
 
 #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,11 @@
 	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 +413,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";