X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2FxlockmoreI.h;h=432e600c39f82652e29d65f0c9a504e9ec8d53ad;hp=75909784974fefa3e7bdf3cebce4839f4443b651;hb=4361b69d3178d7fc98d0388f9a223af6c2651aba;hpb=6afd6db0ae9396cd7ff897ade597cd5483f49b0e diff --git a/hacks/xlockmoreI.h b/hacks/xlockmoreI.h index 75909784..432e600c 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-2014 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,10 +18,7 @@ #include #include "screenhackI.h" - -#ifdef HAVE_XSHM_EXTENSION -# include "xshm.h" -#endif /* HAVE_XSHM_EXTENSION */ +#include "xshm.h" typedef struct ModeInfo ModeInfo; @@ -45,6 +42,8 @@ typedef struct ModeInfo ModeInfo; # include # include # endif +# elif defined(HAVE_ANDROID) +# include # else # include # include @@ -78,13 +77,11 @@ extern void xlockmore_setup (struct xscreensaver_function_table *, void *); extern void xlockmore_do_fps (Display *, Window, fps_state *, void *); -/* 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 */ +extern void xlockmore_mi_init (ModeInfo *, size_t, void **, + void (*) (ModeInfo *)); + + +/* The xlockmore RNG API is implemented in utils/yarandom.h. */ struct ModeInfo { @@ -92,7 +89,6 @@ struct ModeInfo { Display *dpy; Window window; Bool root_p; - int num_screens; int screen_number; int npixels; unsigned long *pixels; @@ -121,11 +117,6 @@ struct ModeInfo { 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; -#endif }; typedef enum { t_String, t_Float, t_Int, t_Bool } xlockmore_type; @@ -162,11 +153,21 @@ struct xlockmore_function_table { void (*hack_draw) (ModeInfo *); void (*hack_reshape) (ModeInfo *, int, int); void (*hack_refresh) (ModeInfo *); - void (*hack_free) (ModeInfo *); + void (*hack_release) (ModeInfo *); Bool (*hack_handle_events) (ModeInfo *, XEvent *); ModeSpecOpt *opts; - unsigned screen_count; /* Only used on the OS X and iOS ports. */ + size_t state_size; + void **state_array; + void (*hack_free_state) (ModeInfo *); + 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__ */