*/
#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};
}
}
-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);
sp->dots = MINDOTS;
}
-void
+ENTRYPOINT void
draw_spiral(ModeInfo * mi)
{
Display *display = MI_DISPLAY(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;
sp->redrawing = 1;
sp->redrawpos = 0;
}
+#endif
+
+XSCREENSAVER_MODULE ("Spiral", spiral)
#endif /* MODE_spiral */