ftp://ftp.krokus.ru/pub/OpenBSD/distfiles/xscreensaver-4.21.tar.gz
[xscreensaver] / hacks / glx / cubestorm.c
index fd5c9d2165a2df9a2021c8e1584bd9bc56e423b8..0b22987304ec286af06701d3f69f7041b64422ee 100644 (file)
@@ -1,4 +1,4 @@
-/* cubestorm, Copyright (c) 2003 Jamie Zawinski <jwz@jwz.org>
+/* cubestorm, Copyright (c) 2003, 2004 Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -28,15 +28,10 @@ extern XtAppContext app;
 #define DEF_COUNT       "4"
 
 #define DEFAULTS       "*delay:        30000       \n" \
-                       "*count:        30          \n" \
+                       "*count:      " DEF_COUNT   "\n" \
                        "*showFPS:      False       \n" \
                        "*fpsSolid:     True        \n" \
                        "*wireframe:    False       \n" \
-                       "*speed:      " DEF_SPEED " \n" \
-                       "*spin:       " DEF_SPIN   "\n" \
-                       "*wander:     " DEF_WANDER "\n" \
-                       "*thickness:  " DEF_THICKNESS "\n" \
-                       "*count:      " DEF_COUNT   "\n" \
 
 
 #undef countof
@@ -196,7 +191,7 @@ cube_handle_event (ModeInfo *mi, XEvent *event)
   cube_configuration *bp = &bps[MI_SCREEN(mi)];
 
   if (event->xany.type == ButtonPress &&
-      event->xbutton.button & Button1)
+      event->xbutton.button == Button1)
     {
       bp->button_down_p = True;
       gltrackball_start (bp->trackball,
@@ -205,11 +200,19 @@ cube_handle_event (ModeInfo *mi, XEvent *event)
       return True;
     }
   else if (event->xany.type == ButtonRelease &&
-           event->xbutton.button & Button1)
+           event->xbutton.button == Button1)
     {
       bp->button_down_p = False;
       return True;
     }
+  else if (event->xany.type == ButtonPress &&
+           (event->xbutton.button == Button4 ||
+            event->xbutton.button == Button5))
+    {
+      gltrackball_mousewheel (bp->trackball, event->xbutton.button, 10,
+                              !!event->xbutton.state);
+      return True;
+    }
   else if (event->xany.type == MotionNotify &&
            bp->button_down_p)
     {