X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fgltrackball.h;h=72a4a62765a392d084ca78363cb2dc6c7c37f2cd;hp=33de09d516f8042ea58840a21b9ae3a03587f91b;hb=6afd6db0ae9396cd7ff897ade597cd5483f49b0e;hpb=dba664f31aa87285db4d76cf8c5e66335299703a diff --git a/hacks/glx/gltrackball.h b/hacks/glx/gltrackball.h index 33de09d5..72a4a627 100644 --- a/hacks/glx/gltrackball.h +++ b/hacks/glx/gltrackball.h @@ -1,4 +1,4 @@ -/* gltrackball, Copyright (c) 2002-2008 Jamie Zawinski +/* gltrackball, Copyright (c) 2002-2014 Jamie Zawinski * GL-flavored wrapper for trackball.c * * Permission to use, copy, modify, distribute, and sell this software and its @@ -18,7 +18,7 @@ typedef struct trackball_state trackball_state; /* Returns a trackball_state object, which encapsulates the stuff necessary to make dragging the mouse on the window of a GL program do the right thing. */ -extern trackball_state *gltrackball_init (void); +extern trackball_state *gltrackball_init (int ignore_device_rotation_p); /* Begin tracking the mouse: Call this when the mouse button goes down. x and y are the mouse position relative to the window. @@ -32,6 +32,10 @@ extern void gltrackball_start (trackball_state *, int x, int y, int w, int h); */ extern void gltrackball_track (trackball_state *, int x, int y, int w, int h); +/* Stop tracking the mouse: Call this when the mouse button goes up. + */ +extern void gltrackball_stop (trackball_state *); + /* Execute the rotations current encapsulated in the trackball_state: this does something analagous to glRotatef(). */ @@ -55,5 +59,13 @@ extern void gltrackball_get_quaternion (trackball_state *ts, float q[4]); */ extern void gltrackball_reset (trackball_state *ts); -#endif /* __GLTRACKBALL_H__ */ +/* A utility function for event-handler functions: + Handles the various motion and click events related to trackballs. + Returns True if the event was handled. + */ +extern Bool gltrackball_event_handler (XEvent *, + trackball_state *, + int window_width, int window_height, + Bool *button_down_p); +#endif /* __GLTRACKBALL_H__ */