From http://www.jwz.org/xscreensaver/xscreensaver-5.30.tar.gz
[xscreensaver] / hacks / swirl.c
index ba959ac692045fc483901291d73a469433863312..d647b0432dc4c4c892ba6feab3a96bc23b24b4d5 100644 (file)
@@ -35,10 +35,10 @@ static const char sccsid[] = "@(#)swirl.c   4.00 97/01/01 xlockmore";
                                        "*ncolors:              200     \n"                     \
                                        "*useSHM:               True    \n" \
                                        "*fpsSolid:             true    \n" \
+                                       "*ignoreRotation: True \n" \
 
 # define SMOOTH_COLORS
 # define WRITABLE_COLORS
-# define swirl_handle_event 0
 # include "xlockmore.h"                                /* from the xscreensaver distribution */
 # ifdef HAVE_XSHM_EXTENSION
 #  include "xshm.h"
@@ -1352,7 +1352,7 @@ draw_swirl(ModeInfo * mi)
                if (swirl->drawing) {
 #ifdef STANDALONE
                  if (mi->writable_p)
-                       rotate_colors(MI_DISPLAY(mi), MI_COLORMAP(mi),
+                       rotate_colors(mi->xgwa.screen, MI_COLORMAP(mi),
                                                  swirl->rgb_values, swirl->colours, 1);
 #else  /* !STANDALONE */
                        /* rotate the colours */
@@ -1374,7 +1374,7 @@ draw_swirl(ModeInfo * mi)
                } else {
 #ifdef STANDALONE
                  if (mi->writable_p)
-                       rotate_colors(MI_DISPLAY(mi), MI_COLORMAP(mi),
+                       rotate_colors(mi->xgwa.screen, MI_COLORMAP(mi),
                                                  swirl->rgb_values, swirl->colours, 1);
 #else  /* !STANDALONE */
                        /* rotate the colours */
@@ -1412,10 +1412,9 @@ draw_swirl(ModeInfo * mi)
 #ifdef STANDALONE
                                        /* Pick a new colormap! */
                                        XClearWindow (MI_DISPLAY(mi), MI_WINDOW(mi));
-                                       free_colors (MI_DISPLAY(mi), MI_COLORMAP(mi),
+                                       free_colors (mi->xgwa.screen, MI_COLORMAP(mi),
                                                                 mi->colors, mi->npixels);
-                                       make_smooth_colormap (MI_DISPLAY(mi),
-                                                                                 MI_VISUAL(mi),
+                                       make_smooth_colormap (mi->xgwa.screen, MI_VISUAL(mi),
                                                                                  MI_COLORMAP(mi),
                                                                                  mi->colors, &mi->npixels, True,
                                                                                  &mi->writable_p, True);
@@ -1485,4 +1484,15 @@ refresh_swirl (ModeInfo * mi)
        }
 }
 
+ENTRYPOINT Bool
+swirl_handle_event (ModeInfo *mi, XEvent *event)
+{
+  if (screenhack_event_helper (MI_DISPLAY(mi), MI_WINDOW(mi), event))
+    {
+      reshape_swirl (mi, MI_WIDTH(mi), MI_HEIGHT(mi));
+      return True;
+    }
+  return False;
+}
+
 XSCREENSAVER_MODULE ("Swirl", swirl)