X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fspiral.c;h=3d8159beaf46e90c223710ffd92e826a6a729e86;hb=39809ded547bdbb08207d3e514950425215b4410;hp=a471acc189b05610e636e08d9f727880a8954c95;hpb=96a411663168b0ba5432b407a83be55f3df0c802;p=xscreensaver diff --git a/hacks/spiral.c b/hacks/spiral.c index a471acc1..3d8159be 100644 --- a/hacks/spiral.c +++ b/hacks/spiral.c @@ -34,30 +34,31 @@ static const char sccsid[] = "@(#)spiral.c 5.00 2000/11/01 xlockmore"; */ #ifdef STANDALONE -#define MODE_spiral -#define PROGCLASS "Spiral" -#define HACK_INIT init_spiral -#define HACK_DRAW draw_spiral -#define spiral_opts xlockmore_opts -#define DEFAULTS "*delay: 50000 \n" \ - "*count: 40 \n" \ - "*cycles: 350 \n" \ - "*ncolors: 64 \n" -#define SMOOTH_COLORS -#include "xlockmore.h" /* from the xscreensaver distribution */ +# define MODE_spiral +#define DEFAULTS "*delay: 50000 \n" \ + "*count: 40 \n" \ + "*cycles: 350 \n" \ + "*ncolors: 64 \n" \ + "*fpsSolid: true \n" \ + +# define SMOOTH_COLORS +# define release_spiral 0 +# define reshape_spiral 0 +# define spiral_handle_event 0 +# include "xlockmore.h" /* from the xscreensaver distribution */ #else /* !STANDALONE */ -#include "xlock.h" /* from the xlockmore distribution */ +# include "xlock.h" /* from the xlockmore distribution */ #endif /* !STANDALONE */ #ifdef MODE_spiral -ModeSpecOpt spiral_opts = +ENTRYPOINT ModeSpecOpt spiral_opts = {0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL}; #ifdef USE_MODULES ModStruct spiral_description = -{"spiral", "init_spiral", "draw_spiral", "release_spiral", - "refresh_spiral", "init_spiral", (char *) NULL, &spiral_opts, +{"spiral", "init_spiral", "draw_spiral", (char *) NULL, + "refresh_spiral", "init_spiral", "free_spiral", &spiral_opts, 5000, -40, 350, 1, 64, 1.0, "", "Shows a helical locus of points", 0, NULL}; @@ -121,19 +122,19 @@ draw_dots(ModeInfo * mi, int in) } } -void +ENTRYPOINT void init_spiral(ModeInfo * mi) { spiralstruct *sp; int i; - if (spirals == NULL) { - if ((spirals = (spiralstruct *) calloc(MI_NUM_SCREENS(mi), - sizeof (spiralstruct))) == NULL) - return; - } + MI_INIT (mi, spirals); sp = &spirals[MI_SCREEN(mi)]; +#ifdef HAVE_JWXYZ + jwxyz_XSetAntiAliasing (MI_DISPLAY(mi), MI_GC(mi), False); +#endif + sp->width = MI_WIDTH(mi); sp->height = MI_HEIGHT(mi); @@ -190,7 +191,7 @@ init_spiral(ModeInfo * mi) sp->dots = MINDOTS; } -void +ENTRYPOINT void draw_spiral(ModeInfo * mi) { Display *display = MI_DISPLAY(mi); @@ -295,24 +296,21 @@ draw_spiral(ModeInfo * mi) } } -void -release_spiral(ModeInfo * mi) +ENTRYPOINT void +free_spiral(ModeInfo * mi) { - if (spirals != NULL) { - int screen; + spiralstruct *sp; - for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) { - spiralstruct *sp = &spirals[screen]; + if (spirals == NULL) + return; + sp = &spirals[MI_SCREEN(mi)]; - if (sp->traildots) - (void) free((void *) sp->traildots); - } - (void) free((void *) spirals); - spirals = (spiralstruct *) NULL; - } + if (sp->traildots) + (void) free((void *) sp->traildots); } -void +#ifndef STANDALONE +ENTRYPOINT void refresh_spiral(ModeInfo * mi) { spiralstruct *sp; @@ -325,5 +323,8 @@ refresh_spiral(ModeInfo * mi) sp->redrawing = 1; sp->redrawpos = 0; } +#endif + +XSCREENSAVER_MODULE ("Spiral", spiral) #endif /* MODE_spiral */