X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fbouncingcow.c;h=7df6ad8c0857dd953fc52ef6a2890719c0ff10d4;hb=447db08c956099b3b183886729108bf5b364c4b8;hp=a12beca6ccf19e1898fc60efe1808c46b0324844;hpb=e4fa2ac140f7bc56571373a7b7eb585fa4500e38;p=xscreensaver diff --git a/hacks/glx/bouncingcow.c b/hacks/glx/bouncingcow.c index a12beca6..7df6ad8c 100644 --- a/hacks/glx/bouncingcow.c +++ b/hacks/glx/bouncingcow.c @@ -1,4 +1,4 @@ -/* bouncingcow, Copyright (c) 2003 Jamie Zawinski +/* bouncingcow, Copyright (c) 2003, 2004 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -23,15 +23,13 @@ extern XtAppContext app; #define EVENT_MASK PointerMotionMask #define sws_opts xlockmore_opts -#define DEF_SPEED "1.0" +#define DEF_SPEED "0.7" #define DEF_TEXTURE "(none)" #define DEFAULTS "*delay: 30000 \n" \ "*count: 1 \n" \ "*showFPS: False \n" \ "*wireframe: False \n" \ - "*speed: " DEF_SPEED " \n" \ - "*texture: " DEF_TEXTURE "\n" \ /* #define DEBUG */ @@ -100,7 +98,7 @@ static const char *do_texture; static XrmOptionDescRec opts[] = { { "-speed", ".speed", XrmoptionSepArg, 0 }, {"-texture", ".texture", XrmoptionSepArg, 0 }, - {"+texture", ".texture", XrmoptionNoArg, (caddr_t) "(none)" }, + {"+texture", ".texture", XrmoptionNoArg, "(none)" }, }; static argtype vars[] = { @@ -196,7 +194,7 @@ cow_handle_event (ModeInfo *mi, XEvent *event) cow_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 +203,19 @@ cow_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) {