http://ftp.ksu.edu.tw/FTP/FreeBSD/distfiles/xscreensaver-4.20.tar.gz
[xscreensaver] / hacks / glx / cubenetic.c
index e2c470d76225c2f6ee0de97f4ae5f89e6724aea2..44f2b73f9b9e28f6726dee966840a9c1195d82c5 100644 (file)
@@ -29,7 +29,7 @@ extern XtAppContext app;
 #define DEF_WAVE_SPEED  "80"
 #define DEF_WAVE_RADIUS "512"
 
-#define DEFAULTS       "*delay:        30000       \n" \
+#define DEFAULTS       "*delay:        20000       \n" \
                        "*count:        5           \n" \
                        "*showFPS:      False       \n" \
                        "*wireframe:    False       \n" \
@@ -113,8 +113,8 @@ static XrmOptionDescRec opts[] = {
   { "+spin",   ".spin",   XrmoptionNoArg, "" },
   { "-wander", ".wander", XrmoptionNoArg, "True" },
   { "+wander", ".wander", XrmoptionNoArg, "False" },
-  {"-texture", ".texture", XrmoptionNoArg, (caddr_t) "true" },
-  {"+texture", ".texture", XrmoptionNoArg, (caddr_t) "false" },
+  {"-texture", ".texture", XrmoptionNoArg, "true" },
+  {"+texture", ".texture", XrmoptionNoArg, "false" },
   {"-waves",       ".waves",      XrmoptionSepArg, 0 },
   {"-wave-speed",  ".waveSpeed",  XrmoptionSepArg, 0 },
   {"-wave-radius", ".waveRadius", XrmoptionSepArg, 0 },
@@ -349,7 +349,7 @@ cube_handle_event (ModeInfo *mi, XEvent *event)
   cube_configuration *cc = &ccs[MI_SCREEN(mi)];
 
   if (event->xany.type == ButtonPress &&
-      event->xbutton.button & Button1)
+      event->xbutton.button == Button1)
     {
       cc->button_down_p = True;
       gltrackball_start (cc->trackball,
@@ -358,11 +358,19 @@ cube_handle_event (ModeInfo *mi, XEvent *event)
       return True;
     }
   else if (event->xany.type == ButtonRelease &&
-           event->xbutton.button & Button1)
+           event->xbutton.button == Button1)
     {
       cc->button_down_p = False;
       return True;
     }
+  else if (event->xany.type == ButtonPress &&
+           (event->xbutton.button == Button4 ||
+            event->xbutton.button == Button5))
+    {
+      gltrackball_mousewheel (cc->trackball, event->xbutton.button, 10,
+                              !!event->xbutton.state);
+      return True;
+    }
   else if (event->xany.type == MotionNotify &&
            cc->button_down_p)
     {