summaryrefslogtreecommitdiff
path: root/apps/x11_main.c
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2011-03-01 23:51:19 +0000
committerTor Andersson <tor@ghostscript.com>2011-03-01 23:51:19 +0000
commit5e59b61da17cf29ff3359c4806457aaf1e910439 (patch)
tree03a989271a80988b1047994ecefee1a7d73d128d /apps/x11_main.c
parenta34132a9d9559d46077eebdb0dfc2b8395c9f119 (diff)
downloadmupdf-5e59b61da17cf29ff3359c4806457aaf1e910439.tar.xz
Update icons.
Diffstat (limited to 'apps/x11_main.c')
-rw-r--r--apps/x11_main.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/apps/x11_main.c b/apps/x11_main.c
index 1ca6449e..2a9fd096 100644
--- a/apps/x11_main.c
+++ b/apps/x11_main.c
@@ -2,8 +2,6 @@
#include "mupdf.h"
#include "pdfapp.h"
-#include "x11_icon.xbm"
-
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
@@ -14,6 +12,20 @@
#include <sys/types.h>
#include <unistd.h>
+#define mupdf_icon_bitmap_16_width 16
+#define mupdf_icon_bitmap_16_height 16
+static unsigned char mupdf_icon_bitmap_16_bits[] = {
+ 0x00, 0x00, 0x00, 0x1e, 0x00, 0x2b, 0x80, 0x55, 0x8c, 0x62, 0x8c, 0x51,
+ 0x9c, 0x61, 0x1c, 0x35, 0x3c, 0x1f, 0x3c, 0x0f, 0xfc, 0x0f, 0xec, 0x0d,
+ 0xec, 0x0d, 0xcc, 0x0c, 0xcc, 0x0c, 0x00, 0x00 };
+
+#define mupdf_icon_bitmap_16_mask_width 16
+#define mupdf_icon_bitmap_16_mask_height 16
+static unsigned char mupdf_icon_bitmap_16_mask_bits[] = {
+ 0x00, 0x1e, 0x00, 0x3f, 0x80, 0x7f, 0xce, 0xff, 0xde, 0xff, 0xde, 0xff,
+ 0xfe, 0xff, 0xfe, 0x7f, 0xfe, 0x3f, 0xfe, 0x1f, 0xfe, 0x1f, 0xfe, 0x1f,
+ 0xfe, 0x1f, 0xfe, 0x1f, 0xfe, 0x1f, 0xce, 0x1c };
+
#ifndef timeradd
#define timeradd(a, b, result) \
do { \
@@ -55,7 +67,7 @@ static Atom WM_DELETE_WINDOW;
static int x11fd;
static int xscr;
static Window xwin;
-static Pixmap xicon;
+static Pixmap xicon, xmask;
static GC xgc;
static XEvent xevt;
static int mapped = 0;
@@ -159,12 +171,19 @@ static void winopen(void)
wmhints = XAllocWMHints();
if (wmhints)
{
- wmhints->flags = IconPixmapHint;
+ wmhints->flags = IconPixmapHint | IconMaskHint;
xicon = XCreateBitmapFromData(xdpy, xwin,
- (char *) gs_l_xbm_bits, gs_l_xbm_width, gs_l_xbm_height);
- if (xicon)
+ (char*)mupdf_icon_bitmap_16_bits,
+ mupdf_icon_bitmap_16_width,
+ mupdf_icon_bitmap_16_height);
+ xmask = XCreateBitmapFromData(xdpy, xwin,
+ (char*)mupdf_icon_bitmap_16_mask_bits,
+ mupdf_icon_bitmap_16_mask_width,
+ mupdf_icon_bitmap_16_mask_height);
+ if (xicon && xmask)
{
wmhints->icon_pixmap = xicon;
+ wmhints->icon_mask = xmask;
XSetWMHints(xdpy, xwin, wmhints);
}
XFree(wmhints);