X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2FxlockmoreI.h;h=bf0adbf46550a4fcd67468bd659072bd5e33989a;hb=39809ded547bdbb08207d3e514950425215b4410;hp=ecf9309439de2056ea223591c5751da3d447804b;hpb=f8cf5ac7b2f53510f80a0eaf286a25298be17bfe;p=xscreensaver diff --git a/hacks/xlockmoreI.h b/hacks/xlockmoreI.h index ecf93094..bf0adbf4 100644 --- a/hacks/xlockmoreI.h +++ b/hacks/xlockmoreI.h @@ -1,5 +1,5 @@ /* xlockmore.h --- xscreensaver compatibility layer for xlockmore modules. - * xscreensaver, Copyright (c) 1997-2012 Jamie Zawinski + * xscreensaver, Copyright (c) 1997-2017 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -18,15 +18,12 @@ #include #include "screenhackI.h" - -#ifdef HAVE_XSHM_EXTENSION -# include "xshm.h" -#endif /* HAVE_XSHM_EXTENSION */ +#include "erase.h" typedef struct ModeInfo ModeInfo; -#ifdef USE_GL +#ifdef HAVE_GL /* I'm told that the Sun version of OpenGL needs to have the constant SUN_OGL_NO_VERTEX_MACROS defined in order for morph3d to compile @@ -45,6 +42,8 @@ typedef struct ModeInfo ModeInfo; # include # include # endif +# elif defined(HAVE_ANDROID) +# include # else # include # include @@ -54,8 +53,11 @@ typedef struct ModeInfo ModeInfo; # ifdef HAVE_JWZGLES # include "jwzgles.h" # endif /* HAVE_JWZGLES */ +#endif /* HAVE_GL */ +#ifdef USE_GL + extern GLXContext *init_GL (ModeInfo *); extern void xlockmore_reset_gl_state(void); extern void clear_gl_error (void); @@ -64,7 +66,7 @@ typedef struct ModeInfo ModeInfo; extern Visual *xlockmore_pick_gl_visual (Screen *); extern Bool xlockmore_validate_gl_visual (Screen *, const char *, Visual *); -#endif /* !USE_GL */ +#endif /* USE_GL */ /* These are only used in GL mode, but I don't understand why XCode isn't seeing the prototypes for them in glx/fps-gl.c... */ @@ -76,15 +78,11 @@ extern void xlockmore_gl_draw_fps (ModeInfo *); extern void xlockmore_setup (struct xscreensaver_function_table *, void *); extern void xlockmore_do_fps (Display *, Window, fps_state *, void *); +extern void xlockmore_mi_init (ModeInfo *, size_t, void **); +extern Bool xlockmore_no_events (ModeInfo *, XEvent *); -/* Compatibility with the xlockmore RNG API - (note that the xlockmore hacks never expect negative numbers.) - */ -#define LRAND() ((long) (random() & 0x7fffffff)) -#define NRAND(n) ((int) (LRAND() % (n))) -#define MAXRAND (2147483648.0) /* unsigned 1<<31 as a float */ -#define SRAND(n) /* already seeded by screenhack.c */ +/* The xlockmore RNG API is implemented in utils/yarandom.h. */ struct ModeInfo { @@ -92,7 +90,6 @@ struct ModeInfo { Display *dpy; Window window; Bool root_p; - int num_screens; int screen_number; int npixels; unsigned long *pixels; @@ -115,16 +112,16 @@ struct ModeInfo { long threed_delta; Bool wireframe_p; Bool is_drawn; + eraser_state *eraser; + Bool needs_clear; /* Used only by OpenGL programs, since FPS is tricky there. */ fps_state *fpst; Bool fps_p; unsigned long polygon_count; /* These values are for -fps display only */ double recursion_depth; - -#ifdef HAVE_XSHM_EXTENSION - Bool use_shm; - XShmSegmentInfo shm_info; +#if !defined HAVE_JWXYZ && defined HAVE_GL + GLXContext glx_context; #endif }; @@ -161,10 +158,20 @@ struct xlockmore_function_table { void (*hack_init) (ModeInfo *); void (*hack_draw) (ModeInfo *); void (*hack_reshape) (ModeInfo *, int, int); - void (*hack_refresh) (ModeInfo *); + void (*hack_release) (ModeInfo *); void (*hack_free) (ModeInfo *); Bool (*hack_handle_events) (ModeInfo *, XEvent *); ModeSpecOpt *opts; + + void **state_array; + unsigned long live_displays, got_init; }; +#ifdef HAVE_JWXYZ +# define XLOCKMORE_NUM_SCREENS \ + (sizeof(((struct xlockmore_function_table *)0)->live_displays) * 8) +#else +# define XLOCKMORE_NUM_SCREENS 2 /* For DEBUG_PAIR. */ +#endif + #endif /* __XLOCKMORE_INTERNAL_H__ */