X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Ftestx11.c;fp=hacks%2Ftestx11.c;h=7932a3736fb483c7b98705c875cf19a761d502bf;hp=554c704e4e1bfd87b5407d10482e91bc4e30d39a;hb=39809ded547bdbb08207d3e514950425215b4410;hpb=4361b69d3178d7fc98d0388f9a223af6c2651aba diff --git a/hacks/testx11.c b/hacks/testx11.c index 554c704e..7932a373 100644 --- a/hacks/testx11.c +++ b/hacks/testx11.c @@ -16,6 +16,8 @@ #include "screenhack.h" #include "glx/rotator.h" +#include "colorbars.h" +#include "erase.h" #include #include @@ -50,6 +52,7 @@ enum mode_images, mode_copy, mode_preserve, + mode_erase, mode_count }; @@ -95,6 +98,8 @@ struct testx11 { Pixmap preserve[2]; + eraser_state *erase; + rotator *rot; }; @@ -211,6 +216,14 @@ make_clip_mask (struct testx11 *st) } +static void +colorbars (struct testx11 *st) +{ + draw_colorbars (st->xgwa.screen, st->xgwa.visual, st->win, + st->xgwa.colormap, 0, 0, st->xgwa.width, st->xgwa.height); +} + + static void * testx11_init (Display *dpy, Window win) { @@ -315,7 +328,7 @@ testx11_init (Display *dpy, Window win) { static const char text[] = "Welcome from testx11_init()."; - XClearWindow (dpy, win); + colorbars (st); XDrawString (dpy, win, st->copy_gc, 16, 16, text, countof (text) - 1); } @@ -840,6 +853,12 @@ testx11_draw (Display *dpy, Window win, void *st_raw) preserve_size, preserve_size, w - preserve_size / 2, preserve_size); break; + + case mode_erase: + if (!st->erase) + colorbars (st); + st->erase = erase_window(st->dpy, st->win, st->erase); + break; } /* Mode toggle buttons */