X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fgltrackball.h;h=33de09d516f8042ea58840a21b9ae3a03587f91b;hb=c1b9b55ad8d59dc05ef55e316aebf5863e7dfa56;hp=fbe2efddc1052d3362eb10480128448883092d62;hpb=13dbc569cdc6e29019722c0ef9b932a925efbcad;p=xscreensaver diff --git a/hacks/glx/gltrackball.h b/hacks/glx/gltrackball.h index fbe2efdd..33de09d5 100644 --- a/hacks/glx/gltrackball.h +++ b/hacks/glx/gltrackball.h @@ -1,4 +1,4 @@ -/* gltrackball, Copyright (c) 2002 Jamie Zawinski +/* gltrackball, Copyright (c) 2002-2008 Jamie Zawinski * GL-flavored wrapper for trackball.c * * Permission to use, copy, modify, distribute, and sell this software and its @@ -37,5 +37,23 @@ extern void gltrackball_track (trackball_state *, int x, int y, int w, int h); */ extern void gltrackball_rotate (trackball_state *); +/* Call this when a mouse-wheel click is detected. + Clicks act like horizontal or vertical drags. + Percent is the length of the drag as a percentage of the screen size. + Button is 'Button4' or 'Button5' (for the vertical wheel) + or 'Button5' or 'Button6' (for the horizontal wheel). + If `flip_p' is true, swap the horizontal and vertical axes. + */ +void gltrackball_mousewheel (trackball_state *ts, + int button, int percent, int flip_p); + +/* Return the quaternion encapsulated by the trackball state. + */ +extern void gltrackball_get_quaternion (trackball_state *ts, float q[4]); + +/* Reset the trackball to the default unrotated state. + */ +extern void gltrackball_reset (trackball_state *ts); + #endif /* __GLTRACKBALL_H__ */