"*useSHM: True \n"
# define refresh_antspotlight 0
+# define release_antspotlight 0
#include "xlockmore.h"
#else
#include "xlock.h"
#endif
-#ifdef HAVE_COCOA
+#ifdef HAVE_JWXYZ
# include "jwxyz.h"
#else
# include <X11/Xlib.h>
#ifdef USE_MODULES
ModStruct antspotlight_description = {
"antspotlight", "init_antspotlight", "draw_antspotlight",
- "release_antspotlight", "draw_antspotlight", "change_antspotlight",
+ (char *) NULL, "draw_antspotlight", "change_antspotlight",
(char *) NULL, &antspotlight_opts, 1000, 1, 1, 1, 4, 1.0, "",
"draws an ant scoping the screen", 0, NULL
};
glEnable(GL_DEPTH_TEST);
}
-/* cleanup routine */
-ENTRYPOINT void release_antspotlight(ModeInfo * mi)
-{
-
- if(antspotlight) {
- free((void *) antspotlight);
- antspotlight = (antspotlightstruct *) NULL;
- }
-
- FreeAllGL(mi);
-}
-
#define MAX_MAGNIFICATION 10
#define max(a, b) a < b ? b : a
#define min(a, b) a < b ? a : b
{
antspotlightstruct *mp = &antspotlight[MI_SCREEN(mi)];
- switch(event->xany.type) {
- case ButtonPress:
-
- switch(event->xbutton.button) {
-
- case Button1:
- mp->button_down_p = True;
- gltrackball_start(mp->trackball,
- event->xbutton.x, event->xbutton.y,
- MI_WIDTH (mi), MI_HEIGHT (mi));
- break;
+ if (gltrackball_event_handler (event, mp->trackball,
+ MI_WIDTH (mi), MI_HEIGHT (mi),
+ &mp->button_down_p))
+ return True;
+
+ if (event->xany.type == ButtonPress)
+ {
+ switch(event->xbutton.button) {
+
+ case Button1:
+ mp->button_down_p = True;
+ gltrackball_start(mp->trackball,
+ event->xbutton.x, event->xbutton.y,
+ MI_WIDTH (mi), MI_HEIGHT (mi));
+ return True;
- case Button4:
- mp->mag = max(mp->mag-1, 1);
- break;
-
- case Button5:
- mp->mag = min(mp->mag+1, MAX_MAGNIFICATION);
- break;
- }
-
- break;
-
- case ButtonRelease:
-
- switch(event->xbutton.button) {
- case Button1:
- mp->button_down_p = False;
- break;
+ case Button4:
+ mp->mag = max(mp->mag-1, 1);
+ return True;
+
+ case Button5:
+ mp->mag = min(mp->mag+1, MAX_MAGNIFICATION);
+ return True;
+ }
}
- break;
-
- case MotionNotify:
- if(mp->button_down_p)
- gltrackball_track(mp->trackball,
- event->xmotion.x, event->xmotion.y,
- MI_WIDTH (mi), MI_HEIGHT (mi));
- break;
-
- default:
- return False;
- }
-
- return True;
+ return False;
}
static void
antspotlightstruct *mp;
- if(!antspotlight) {
- if((antspotlight = (antspotlightstruct *)
- calloc(MI_NUM_SCREENS(mi), sizeof (antspotlightstruct))) == NULL)
- return;
- }
+ MI_INIT(mi, antspotlight, NULL);
mp = &antspotlight[MI_SCREEN(mi)];
mp->rot = make_rotator (rot_speed, rot_speed, rot_speed, 1, 0, True);
- mp->trackball = gltrackball_init ();
+ mp->trackball = gltrackball_init (False);
if((mp->glx_context = init_GL(mi)) != NULL) {
reshape_antspotlight(mi, MI_WIDTH(mi), MI_HEIGHT(mi));