X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fjigglypuff.c;h=d95fea3f9b25ec5dac837e576a55190c71817278;hb=2d04c4f22466851aedb6ed0f2919d148f726b889;hp=ae8891f739cb743dc95a68e7a8c38afba8b2ea68;hpb=6a1da724858673ac40aa13a9612340d8bed8c7b9;p=xscreensaver diff --git a/hacks/glx/jigglypuff.c b/hacks/glx/jigglypuff.c index ae8891f7..d95fea3f 100644 --- a/hacks/glx/jigglypuff.c +++ b/hacks/glx/jigglypuff.c @@ -138,33 +138,33 @@ typedef struct { static jigglystruct *jss = NULL; static XrmOptionDescRec opts[] = { - {"-random", ".Jigglypuff.random", XrmoptionNoArg, (caddr_t)"true"}, - {"+random", ".Jigglypuff.random", XrmoptionNoArg, (caddr_t)"false"}, - {"-tetra", ".Jigglypuff.tetra", XrmoptionNoArg, (caddr_t)"true"}, - {"+tetra", ".Jigglypuff.tetra", XrmoptionNoArg, (caddr_t)"false"}, - {"-spooky", ".Jigglypuff.spooky", XrmoptionSepArg, (caddr_t)"0"}, - {"-color", ".Jigglypuff.color", XrmoptionSepArg, (caddr_t)DEF_COLOR}, - {"-shininess", ".Jigglypuff.shininess", XrmoptionSepArg, (caddr_t)DEF_SHININESS}, - {"-complexity", ".Jigglypuff.complexity", XrmoptionSepArg, (caddr_t)DEF_COMPLEXITY}, - {"-speed", ".Jigglypuff.speed", XrmoptionSepArg, (caddr_t)DEF_SPEED}, - {"-spherism", ".Jigglypuff.spherism", XrmoptionSepArg, (caddr_t)DEF_SPHERISM}, - {"-hold", ".Jigglypuff.hold", XrmoptionSepArg, (caddr_t)DEF_HOLD}, - {"-distance", "Jigglypuff.distance", XrmoptionSepArg, (caddr_t)DEF_DISTANCE}, - {"-damping", "Jigglypuff.damping", XrmoptionSepArg, (caddr_t)DEF_DAMPING} + {"-random", ".Jigglypuff.random", XrmoptionNoArg, "true"}, + {"+random", ".Jigglypuff.random", XrmoptionNoArg, "false"}, + {"-tetra", ".Jigglypuff.tetra", XrmoptionNoArg, "true"}, + {"+tetra", ".Jigglypuff.tetra", XrmoptionNoArg, "false"}, + {"-spooky", ".Jigglypuff.spooky", XrmoptionSepArg, "0"}, + {"-color", ".Jigglypuff.color", XrmoptionSepArg, DEF_COLOR}, + {"-shininess", ".Jigglypuff.shininess", XrmoptionSepArg, DEF_SHININESS}, + {"-complexity", ".Jigglypuff.complexity", XrmoptionSepArg, DEF_COMPLEXITY}, + {"-speed", ".Jigglypuff.speed", XrmoptionSepArg, DEF_SPEED}, + {"-spherism", ".Jigglypuff.spherism", XrmoptionSepArg, DEF_SPHERISM}, + {"-hold", ".Jigglypuff.hold", XrmoptionSepArg, DEF_HOLD}, + {"-distance", "Jigglypuff.distance", XrmoptionSepArg, DEF_DISTANCE}, + {"-damping", "Jigglypuff.damping", XrmoptionSepArg, DEF_DAMPING} }; static argtype vars[] = { - {(caddr_t*)&random_parms, "random", "Random", "False", t_Bool}, - {(caddr_t*)&do_tetrahedron, "tetra", "Tetra", "False", t_Bool}, - {(caddr_t*)&spooky, "spooky", "Spooky", "0", t_Int}, - {(caddr_t*)&color, "color", "Color", DEF_COLOR, t_String}, - {(caddr_t*)&shininess, "shininess", "Shininess", DEF_SHININESS, t_Int}, - {(caddr_t*)&complexity, "complexity", "Complexity", DEF_COMPLEXITY, t_Int}, - {(caddr_t*)&speed, "speed", "Speed", DEF_SPEED, t_Int}, - {(caddr_t*)&spherism, "spherism", "Spherism", DEF_SPHERISM, t_Int}, - {(caddr_t*)&hold, "hold", "Hold", DEF_HOLD, t_Int}, - {(caddr_t*)&distance, "distance", "Distance", DEF_DISTANCE, t_Int}, - {(caddr_t*)&damping, "damping", "Damping", DEF_DAMPING, t_Int} + {&random_parms, "random", "Random", "False", t_Bool}, + {&do_tetrahedron, "tetra", "Tetra", "False", t_Bool}, + {&spooky, "spooky", "Spooky", "0", t_Int}, + {&color, "color", "Color", DEF_COLOR, t_String}, + {&shininess, "shininess", "Shininess", DEF_SHININESS, t_Int}, + {&complexity, "complexity", "Complexity", DEF_COMPLEXITY, t_Int}, + {&speed, "speed", "Speed", DEF_SPEED, t_Int}, + {&spherism, "spherism", "Spherism", DEF_SPHERISM, t_Int}, + {&hold, "hold", "Hold", DEF_HOLD, t_Int}, + {&distance, "distance", "Distance", DEF_DISTANCE, t_Int}, + {&damping, "damping", "Damping", DEF_DAMPING, t_Int} }; #undef countof @@ -931,17 +931,25 @@ Bool jigglypuff_handle_event(ModeInfo *mi, XEvent *event) jigglystruct *js = &jss[MI_SCREEN(mi)]; if(event->xany.type == ButtonPress && - event->xbutton.button & Button1) { + event->xbutton.button == Button1) { js->button_down = 1; gltrackball_start(js->trackball, event->xbutton.x, event->xbutton.y, MI_WIDTH(mi), MI_HEIGHT(mi)); return True; } else if(event->xany.type == ButtonRelease && - event->xbutton.button & Button1) { + event->xbutton.button == Button1) { js->button_down = 0; return True; } + else if (event->xany.type == ButtonPress && + (event->xbutton.button == Button4 || + event->xbutton.button == Button5)) + { + gltrackball_mousewheel (js->trackball, event->xbutton.button, 10, + !!event->xbutton.state); + return True; + } else if(event->xany.type == MotionNotify && js->button_down) { gltrackball_track(js->trackball, event->xmotion.x, event->xmotion.y, MI_WIDTH(mi), MI_HEIGHT(mi));