ftp://ftp.krokus.ru/pub/OpenBSD/distfiles/xscreensaver-4.21.tar.gz
[xscreensaver] / hacks / glx / flyingtoasters.c
index e8285627887bfec08c75cf166430dc2599e07a24..934e64378bfba7c23c41011be0d1d59eb1c146f5 100644 (file)
@@ -1,4 +1,4 @@
-/* flyingtoasters, Copyright (c) 2003 Jamie Zawinski <jwz@jwz.org>
+/* flyingtoasters, 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
@@ -46,10 +46,6 @@ extern XtAppContext app;
 #define DEFAULTS       "*delay:        30000       \n" \
                        "*showFPS:      False       \n" \
                        "*wireframe:    False       \n" \
-                       "*speed:      " DEF_SPEED " \n" \
-                       "*ntoasters:  " DEF_NTOASTERS "\n" \
-                       "*nslices:    " DEF_NSLICES   "\n" \
-                       "*texture:    " DEF_TEXTURE   "\n" \
 
 /* #define DEBUG */
 
@@ -153,8 +149,8 @@ static XrmOptionDescRec opts[] = {
   { "-speed",  ".speed",  XrmoptionSepArg, 0 },
   { "-ntoasters",  ".ntoasters", XrmoptionSepArg, 0 },
   { "-nslices",    ".nslices",   XrmoptionSepArg, 0 },
-  {"-texture",     ".texture",   XrmoptionNoArg, (caddr_t) "True" },
-  {"+texture",     ".texture",   XrmoptionNoArg, (caddr_t) "False" },
+  {"-texture",     ".texture",   XrmoptionNoArg, "True" },
+  {"+texture",     ".texture",   XrmoptionNoArg, "False" },
 };
 
 static argtype vars[] = {
@@ -324,7 +320,7 @@ toaster_handle_event (ModeInfo *mi, XEvent *event)
   toaster_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->user_trackball,
@@ -333,11 +329,19 @@ toaster_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->user_trackball, event->xbutton.button, 5,
+                              !event->xbutton.state);
+      return True;
+    }
   else if (event->xany.type == MotionNotify &&
            bp->button_down_p)
     {