X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fgreynetic.c;h=0f0747d17035ea1975115d1f25fb2c317968ee55;hb=6a1da724858673ac40aa13a9612340d8bed8c7b9;hp=57840637bb70b0fd69051294a2ef5c5bd23a3120;hpb=3f9592851ce4ed76a9979bfdd6ec7dc5c457e183;p=xscreensaver diff --git a/hacks/greynetic.c b/hacks/greynetic.c index 57840637..0f0747d1 100644 --- a/hacks/greynetic.c +++ b/hacks/greynetic.c @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1992, 1995, 1996, 1997, 1998 +/* xscreensaver, Copyright (c) 1992, 1995, 1996, 1997, 1998, 2003 * Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its @@ -14,33 +14,76 @@ #define NBITS 12 -#ifndef VMS -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -#else /* VMS */ -# include "sys$common:[decw$include.bitmaps]stipple.xbm" -# include "sys$common:[decw$include.bitmaps]cross_weave.xbm" -# include "sys$common:[decw$include.bitmaps]dimple1.xbm" -# include "sys$common:[decw$include.bitmaps]dimple3.xbm" -# include "sys$common:[decw$include.bitmaps]flipped_gray.xbm" -# include "sys$common:[decw$include.bitmaps]gray1.xbm" -# include "sys$common:[decw$include.bitmaps]gray3.xbm" -# include "sys$common:[decw$include.bitmaps]hlines2.xbm" -# include "sys$common:[decw$include.bitmaps]light_gray.xbm" -# include "sys$common:[decw$include.bitmaps]root_weave.xbm" -# include "sys$common:[decw$include.bitmaps]vlines2.xbm" -# include "sys$common:[decw$include.bitmaps]vlines3.xbm" -#endif /* VMS */ +/* On some systems (notably MacOS X) these files are messed up. + * They're tiny, so we might as well just inline them here. + * + * # include + * # include + * # include + * # include + * # include + * # include + * # include + * # include + * # include + * # include + * # include + * # include +*/ + +#define stipple_width 16 +#define stipple_height 4 +static unsigned char stipple_bits[] = { + 0x55, 0x55, 0xee, 0xee, 0x55, 0x55, 0xba, 0xbb}; + +#define cross_weave_width 16 +#define cross_weave_height 16 +static unsigned char cross_weave_bits[] = { + 0x55, 0x55, 0x88, 0x88, 0x55, 0x55, 0x22, 0x22, 0x55, 0x55, 0x88, 0x88, + 0x55, 0x55, 0x22, 0x22, 0x55, 0x55, 0x88, 0x88, 0x55, 0x55, 0x22, 0x22, + 0x55, 0x55, 0x88, 0x88, 0x55, 0x55, 0x22, 0x22}; + +#define dimple1_width 16 +#define dimple1_height 16 +static unsigned char dimple1_bits[] = { + 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, + 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, + 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00}; + +#define dimple3_width 16 +#define dimple3_height 16 +static unsigned char dimple3_bits[] = { + 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + +#define flipped_gray_width 4 +#define flipped_gray_height 2 +static char flipped_gray_bits[] = { 0x07, 0x0d}; +#define gray1_width 2 +#define gray1_height 2 +static char gray1_bits[] = { 0x01, 0x02}; +#define gray3_width 4 +#define gray3_height 4 +static char gray3_bits[] = { 0x01, 0x00, 0x04, 0x00}; +#define hlines2_width 1 +#define hlines2_height 2 +static char hlines2_bits[] = { 0x01, 0x00}; +#define light_gray_width 4 +#define light_gray_height 2 +static char light_gray_bits[] = { 0x08, 0x02}; +#define root_weave_width 4 +#define root_weave_height 4 +static char root_weave_bits[] = { 0x07, 0x0d, 0x0b, 0x0e}; +#define vlines2_width 2 +#define vlines2_height 1 +static char vlines2_bits[] = { 0x01}; +#define vlines3_width 3 +#define vlines3_height 1 +static char vlines3_bits[] = { 0x02}; + + + static Pixmap pixmaps [NBITS]; static GC gc; @@ -68,7 +111,8 @@ init_greynetic (Display *dpy, Window window) i = 0; #define BITS(n,w,h) \ - pixmaps [i++] = XCreatePixmapFromBitmapData (dpy, window, n, w, h, 1, 0, 1) + pixmaps [i++] = \ + XCreatePixmapFromBitmapData (dpy, window, (char *) n, w, h, 1, 0, 1) BITS (stipple_bits, stipple_width, stipple_height); BITS (cross_weave_bits, cross_weave_width, cross_weave_height); @@ -161,7 +205,7 @@ char *progclass = "Greynetic"; char *defaults [] = { ".background: black", ".foreground: white", - "*delay: 0", + "*delay: 10000", 0 };