X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fmoebius.c;h=d05e8c65e3149167c41c11316eff4e921f518e34;hb=2d04c4f22466851aedb6ed0f2919d148f726b889;hp=f9693ae16f348ed4cc4f5c4224c0475c942fee48;hpb=96a411663168b0ba5432b407a83be55f3df0c802;p=xscreensaver diff --git a/hacks/glx/moebius.c b/hacks/glx/moebius.c index f9693ae1..d05e8c65 100644 --- a/hacks/glx/moebius.c +++ b/hacks/glx/moebius.c @@ -115,21 +115,21 @@ static int noants; static XrmOptionDescRec opts[] = { - {(char *) "-solidmoebius", (char *) ".moebius.solidmoebius", XrmoptionNoArg, (caddr_t) "on"}, - {(char *) "+solidmoebius", (char *) ".moebius.solidmoebius", XrmoptionNoArg, (caddr_t) "off"}, - {(char *) "-noants", (char *) ".moebius.noants", XrmoptionNoArg, (caddr_t) "on"}, - {(char *) "+noants", (char *) ".moebius.noants", XrmoptionNoArg, (caddr_t) "off"} + {"-solidmoebius", ".moebius.solidmoebius", XrmoptionNoArg, "on"}, + {"+solidmoebius", ".moebius.solidmoebius", XrmoptionNoArg, "off"}, + {"-noants", ".moebius.noants", XrmoptionNoArg, "on"}, + {"+noants", ".moebius.noants", XrmoptionNoArg, "off"} }; static argtype vars[] = { - {(caddr_t *) & solidmoebius, (char *) "solidmoebius", (char *) "Solidmoebius", (char *) DEF_SOLIDMOEBIUS, t_Bool}, - {(caddr_t *) & noants, (char *) "noants", (char *) "Noants", (char *) DEF_NOANTS, t_Bool} + {&solidmoebius, "solidmoebius", "Solidmoebius", DEF_SOLIDMOEBIUS, t_Bool}, + {&noants, "noants", "Noants", DEF_NOANTS, t_Bool} }; static OptionStruct desc[] = { - {(char *) "-/+solidmoebius", (char *) "select between a SOLID or a NET Moebius Strip"}, - {(char *) "-/+noants", (char *) "turn on/off walking ants"} + {"-/+solidmoebius", "select between a SOLID or a NET Moebius Strip"}, + {"-/+noants", "turn on/off walking ants"} }; ModeSpecOpt moebius_opts = @@ -643,7 +643,7 @@ moebius_handle_event (ModeInfo *mi, XEvent *event) moebiusstruct *mp = &moebius[MI_SCREEN(mi)]; if (event->xany.type == ButtonPress && - event->xbutton.button & Button1) + event->xbutton.button == Button1) { mp->button_down_p = True; gltrackball_start (mp->trackball, @@ -652,11 +652,19 @@ moebius_handle_event (ModeInfo *mi, XEvent *event) return True; } else if (event->xany.type == ButtonRelease && - event->xbutton.button & Button1) + event->xbutton.button == Button1) { mp->button_down_p = False; return True; } + else if (event->xany.type == ButtonPress && + (event->xbutton.button == Button4 || + event->xbutton.button == Button5)) + { + gltrackball_mousewheel (mp->trackball, event->xbutton.button, 10, + !!event->xbutton.state); + return True; + } else if (event->xany.type == MotionNotify && mp->button_down_p) {