X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fslip.c;h=6537086b731aab668da321c51a8709b7a2dcaea4;hp=09d8c879936fffcbe92edb8cbcbf927fa6bfc3fe;hb=4361b69d3178d7fc98d0388f9a223af6c2651aba;hpb=49f5b54f312fe4ac2e9bc47581a72451bd0e8439 diff --git a/hacks/slip.c b/hacks/slip.c index 09d8c879..6537086b 100644 --- a/hacks/slip.c +++ b/hacks/slip.c @@ -30,9 +30,12 @@ static const char sccsid[] = "@(#)slip.c 5.00 2000/11/01 xlockmore"; # define DEFAULTS "*delay: 50000 \n" \ "*count: 35 \n" \ "*cycles: 50 \n" \ - "*ncolors: 200 \n" + "*ncolors: 200 \n" \ + "*fpsSolid: true \n" \ + "*ignoreRotation: True \n" \ + # define refresh_slip 0 -# define slip_handle_event 0 +# define release_slip 0 # include "xlockmore.h" /* in xscreensaver distribution */ #else /* STANDALONE */ # include "xlock.h" /* in xlockmore distribution */ @@ -45,7 +48,7 @@ ENTRYPOINT ModeSpecOpt slip_opts = #ifdef USE_MODULES ModStruct slip_description = -{"slip", "init_slip", "draw_slip", "release_slip", +{"slip", "init_slip", "draw_slip", (char *) NULL, "init_slip", "init_slip", (char *) NULL, &slip_opts, 50000, 35, 50, 1, 64, 1.0, "", "Shows slipping blits", 0, NULL}; @@ -208,11 +211,7 @@ init_slip (ModeInfo * mi) { slipstruct *sp; - if (slips == NULL) { - if ((slips = (slipstruct *) calloc(MI_NUM_SCREENS(mi), - sizeof (slipstruct))) == NULL) - return; - } + MI_INIT (mi, slips, 0); sp = &slips[MI_SCREEN(mi)]; sp->nblits_remaining = 0; @@ -351,13 +350,17 @@ X Error of failed request: BadDrawable (invalid Pixmap or Window parameter) } } -ENTRYPOINT void -release_slip (ModeInfo * mi) +ENTRYPOINT Bool +slip_handle_event (ModeInfo *mi, XEvent *event) { - if (slips != NULL) { - (void) free((void *) slips); - slips = (slipstruct *) NULL; - } + slipstruct *sp = &slips[MI_SCREEN(mi)]; + if (screenhack_event_helper (MI_DISPLAY(mi), MI_WINDOW(mi), event)) + { + sp->first_time = 1; + sp->nblits_remaining = 0; + return True; + } + return False; } XSCREENSAVER_MODULE ("Slip", slip)