# define SMOOTH_COLORS
# define reshape_hop 0
# define release_hop 0
+# define hop_handle_event 0
# include "xlockmore.h" /* in xscreensaver distribution */
-# include "erase.h"
#else /* STANDALONE */
# include "xlock.h" /* in xlockmore distribution */
#endif /* STANDALONE */
#ifdef USE_MODULES
ModStruct hop_description =
{"hop", "init_hop", "draw_hop", (char *) NULL,
- "refresh_hop", "init_hop", (char *) NULL, &hop_opts,
+ "refresh_hop", "init_hop", "free_hop", &hop_opts,
10000, 1000, 2500, 1, 64, 1.0, "",
"Shows real plane iterated fractals", 0, NULL};
int count;
int bufsize;
XPoint *pointBuffer; /* pointer for XDrawPoints */
-#ifdef STANDALONE
- eraser_state *eraser;
-#endif
} hopstruct;
static hopstruct *hops = (hopstruct *) NULL;
-static void free_hop(ModeInfo * mi);
-
ENTRYPOINT void
init_hop(ModeInfo * mi)
{
double range;
hopstruct *hp;
- MI_INIT (mi, hops, free_hop);
+ MI_INIT (mi, hops);
hp = &hops[MI_SCREEN(mi)];
hp->centerx = MI_WIDTH(mi) / 2;
return;
}
-#ifndef STANDALONE
MI_CLEARWINDOW(mi);
-#endif
XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
hp->count = 0;
return;
hp = &hops[MI_SCREEN(mi)];
-#ifdef STANDALONE
- if (hp->eraser) {
- hp->eraser = erase_window (MI_DISPLAY(mi), MI_WINDOW(mi), hp->eraser);
- if (!hp->eraser)
- init_hop(mi);
- return;
- }
-#endif
-
if (hp->pointBuffer == NULL)
return;
XDrawPoints(MI_DISPLAY(mi), MI_WINDOW(mi), MI_GC(mi),
hp->pointBuffer, hp->bufsize, CoordModeOrigin);
if (++hp->count > MI_CYCLES(mi)) {
-#ifdef STANDALONE
- hp->eraser = erase_window (MI_DISPLAY(mi), MI_WINDOW(mi), hp->eraser);
-#else /* !STANDALONE */
init_hop(mi);
-#endif
}
}
-static void
+ENTRYPOINT void
free_hop(ModeInfo * mi)
{
hopstruct *hp = &hops[MI_SCREEN(mi)];
(void) free((void *) hp->pointBuffer);
}
+#ifndef STANDALONE
ENTRYPOINT void
refresh_hop(ModeInfo * mi)
{
MI_CLEARWINDOW(mi);
}
-
-ENTRYPOINT Bool
-hop_handle_event (ModeInfo *mi, XEvent *event)
-{
- if (screenhack_event_helper (MI_DISPLAY(mi), MI_WINDOW(mi), event))
- {
- MI_CLEARWINDOW(mi);
- init_hop (mi);
- return True;
- }
- return False;
-}
-
-
+#endif
XSCREENSAVER_MODULE_2 ("Hopalong", hopalong, hop)