X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fgears.c;h=2f27ba0c3fcc5e98a5201b418801313c33d6769d;hb=447db08c956099b3b183886729108bf5b364c4b8;hp=e1c08bdc35b39d64b243dbd4b66fd4011b170a06;hpb=96a411663168b0ba5432b407a83be55f3df0c802;p=xscreensaver diff --git a/hacks/glx/gears.c b/hacks/glx/gears.c index e1c08bdc..2f27ba0c 100644 --- a/hacks/glx/gears.c +++ b/hacks/glx/gears.c @@ -34,13 +34,6 @@ static const char sccsid[] = "@(#)gears.c 4.07 97/11/24 xlockmore"; * been fixed in MesaGL 2.2 and later releases. */ -/*- - * due to a Bug/feature in VMS X11/Intrinsic.h has to be placed before xlock. - * otherwise caddr_t is not defined correctly - */ - -#include - #ifdef STANDALONE # define PROGCLASS "Gears" # define HACK_INIT init_gears @@ -52,7 +45,6 @@ static const char sccsid[] = "@(#)gears.c 4.07 97/11/24 xlockmore"; # define DEFAULTS "*count: 1 \n" \ "*cycles: 2 \n" \ "*delay: 20000 \n" \ - "*planetary: False \n" \ "*showFPS: False \n" \ "*wireframe: False \n" # include "xlockmore.h" /* from the xscreensaver distribution */ @@ -73,12 +65,12 @@ static const char sccsid[] = "@(#)gears.c 4.07 97/11/24 xlockmore"; static int planetary; static XrmOptionDescRec opts[] = { - {"-planetary", ".gears.planetary", XrmoptionNoArg, (caddr_t) "true" }, - {"+planetary", ".gears.planetary", XrmoptionNoArg, (caddr_t) "false" }, + {"-planetary", ".gears.planetary", XrmoptionNoArg, "true" }, + {"+planetary", ".gears.planetary", XrmoptionNoArg, "false" }, }; static argtype vars[] = { - {(caddr_t *) &planetary, "planetary", "Planetary", DEF_PLANETARY, t_Bool}, + {&planetary, "planetary", "Planetary", DEF_PLANETARY, t_Bool}, }; ModeSpecOpt gears_opts = {countof(opts), opts, countof(vars), vars, NULL}; @@ -926,7 +918,7 @@ gears_handle_event (ModeInfo *mi, XEvent *event) gearsstruct *gp = &gears[MI_SCREEN(mi)]; if (event->xany.type == ButtonPress && - event->xbutton.button & Button1) + event->xbutton.button == Button1) { gp->button_down_p = True; gltrackball_start (gp->trackball, @@ -935,11 +927,19 @@ gears_handle_event (ModeInfo *mi, XEvent *event) return True; } else if (event->xany.type == ButtonRelease && - event->xbutton.button & Button1) + event->xbutton.button == Button1) { gp->button_down_p = False; return True; } + else if (event->xany.type == ButtonPress && + (event->xbutton.button == Button4 || + event->xbutton.button == Button5)) + { + gltrackball_mousewheel (gp->trackball, event->xbutton.button, 10, + !!event->xbutton.state); + return True; + } else if (event->xany.type == MotionNotify && gp->button_down_p) {