/* -*- Mode: C; tab-width: 4 -*- */
/* fadeplot --- a fading plot of sine squared */
-#if !defined( lint ) && !defined( SABER )
+#if 0
static const char sccsid[] = "@(#)fadeplot.c 5.00 2000/11/01 xlockmore";
-
#endif
/*-
*/
#ifdef STANDALONE
-#define MODE_fadeplot
-#define PROGCLASS "Fadeplot"
-#define HACK_INIT init_fadeplot
-#define HACK_DRAW draw_fadeplot
-#define fadeplot_opts xlockmore_opts
-#define DEFAULTS "*delay: 30000 \n" \
- "*count: 10 \n" \
- "*cycles: 1500 \n" \
- "*ncolors: 64 \n"
-#define BRIGHT_COLORS
-#define UNIFORM_COLORS
-#include "xlockmore.h" /* in xscreensaver distribution */
+# define MODE_fadeplot
+# define DEFAULTS "*delay: 30000 \n" \
+ "*count: 10 \n" \
+ "*cycles: 1500 \n" \
+ "*ncolors: 64 \n" \
+ "*fpsSolid: true \n" \
+ "*ignoreRotation: True \n" \
+
+# define BRIGHT_COLORS
+# define UNIFORM_COLORS
+# define fadeplot_handle_event 0
+# include "xlockmore.h" /* in xscreensaver distribution */
#else /* STANDALONE */
-#include "xlock.h" /* in xlockmore distribution */
-
+# include "xlock.h" /* in xlockmore distribution */
#endif /* STANDALONE */
#ifdef MODE_fadeplot
-ModeSpecOpt fadeplot_opts =
+ENTRYPOINT ModeSpecOpt fadeplot_opts =
{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
#ifdef USE_MODULES
return True;
}
-void
-init_fadeplot(ModeInfo * mi)
+ENTRYPOINT void
+init_fadeplot (ModeInfo * mi)
{
fadeplotstruct *fp;
MI_CLEARWINDOW(mi);
}
-void
-draw_fadeplot(ModeInfo * mi)
+ENTRYPOINT void
+draw_fadeplot (ModeInfo * mi)
{
Display *display = MI_DISPLAY(mi);
Window window = MI_WINDOW(mi);
}
}
XDrawPoints(display, window, gc, fp->pts, temp, CoordModeOrigin);
- XFlush(display);
fp->st.x = (fp->st.x + fp->speed.x) % fp->angles;
fp->st.y = (fp->st.y + fp->speed.y) % fp->angles;
fp->temps++;
if ((fp->temps % (fp->angles / 2)) == 0) {
fp->temps = fp->temps % fp->angles * 5;
if ((fp->temps % (fp->angles)) == 0)
- fp->speed.y = (fp->speed.y++) % 30 + 1;
+ fp->speed.y = (fp->speed.y + 1) % 30 + 1;
if ((fp->temps % (fp->angles * 2)) == 0)
fp->speed.x = (fp->speed.x) % 20;
if ((fp->temps % (fp->angles * 3)) == 0)
- fp->step.y = (fp->step.y++) % 2 + 1;
+ fp->step.y = (fp->step.y + 1) % 2 + 1;
MI_CLEARWINDOW(mi);
}
}
-void
-refresh_fadeplot(ModeInfo * mi)
+
+ENTRYPOINT void
+reshape_fadeplot(ModeInfo * mi, int width, int height)
+{
+ fadeplotstruct *fp = &fadeplots[MI_SCREEN(mi)];
+ fp->width = width;
+ fp->height = height;
+ fp->min = MAX(MIN(fp->width, fp->height) / 2, 1);
+ fp->factor.x = MAX(fp->width / (2 * fp->min), 1);
+ fp->factor.y = MAX(fp->height / (2 * fp->min), 1);
+}
+
+ENTRYPOINT void
+refresh_fadeplot (ModeInfo * mi)
{
- MI_CLEARWINDOW(mi);
}
-void
-release_fadeplot(ModeInfo * mi)
+ENTRYPOINT void
+release_fadeplot (ModeInfo * mi)
{
if (fadeplots != NULL) {
int screen;
}
}
+XSCREENSAVER_MODULE ("FadePlot", fadeplot)
+
#endif /* MODE_fadeplot */