/* xscreensaver, Copyright (c) 1992-2018 Jamie Zawinski <jwz@jwz.org>
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation. No representations are made about the suitability of this
* software for any purpose. It is provided "as is" without express or
/* Found in Don Hopkins' .plan file:
* The color situation is a total flying circus. The X approach to
* device independence is to treat everything like a MicroVax framebuffer
* on acid. A truely portable X application is required to act like the
* persistent customer in the Monty Python ``Cheese Shop'' sketch. Even
* the simplest applications must answer many difficult questions, like:
* display = XOpenDisplay("unix:0");
* root = RootWindow(display, DefaultScreen(display));
* AND WHAT IS YOUR WINDOW?
* win = XCreateSimpleWindow(display, root, 0, 0, 256, 256, 1,
* BlackPixel(display, DefaultScreen(display)),
* WhitePixel(display, DefaultScreen(display)))
* OH ALL RIGHT, YOU CAN GO ON.
* display = XOpenDisplay("unix:0");
* cmap = DefaultColormap(display, DefaultScreen(display));
* AND WHAT IS YOUR FAVORITE COLOR?
* favorite_color = 0; / * Black. * /
* / * Whoops! No, I mean: * /
* favorite_color = BlackPixel(display, DefaultScreen(display));
* / * AAAYYYYEEEEE!! (client dumps core & falls into the chasm) * /
* display = XOpenDisplay("unix:0");
* struct XVisualInfo vinfo;
* if (XMatchVisualInfo(display, DefaultScreen(display),
* 8, PseudoColor, &vinfo) != 0)
* AND WHAT IS THE NET SPEED VELOCITY OF AN XConfigureWindow REQUEST?
* / * Is that a SubStructureRedirectMask or a ResizeRedirectMask? * /
* WHAT?! HOW AM I SUPPOSED TO KNOW THAT?
* AAAAUUUGGGHHH!!!! (server dumps core & falls into the chasm)
#ifndef __SCREENHACK_I_H__
#define __SCREENHACK_I_H__
#endif /* HAVE_CONFIG_H */
/* Which of the ten billion standards does values.h belong to?
What systems always have it? */
# include <string.h> /* X11/Xos.h brings this in. */
/* From utils/visual.c. */
# define DEFAULT_VISUAL -1
# include <X11/Xresource.h>
#if defined(HAVE_IPHONE) || defined(HAVE_ANDROID)
/* So that hacks' debug output shows up in logcat... */
# define fprintf(S, ...) Log(__VA_ARGS__)
/* M_PI ought to have been defined in math.h, but... */
# define M_PI 3.1415926535
# define M_PI_2 1.5707963267
#define bzero __ERROR_use_memset_not_bzero_in_xscreensaver__
#define bcopy __ERROR_use_memcpy_not_bcopy_in_xscreensaver__
#define ftime __ERROR_use_gettimeofday_not_ftime_in_xscreensaver__
#define sleep __ERROR_do_not_sleep_in_xscreensaver__
struct xscreensaver_function_table
{
const char * const *defaults
;
const XrmOptionDescRec
*options
;
void (*setup_cb
) (struct xscreensaver_function_table
*, void *);
void * (*init_cb
) (Display
*, Window
);
unsigned long (*draw_cb
) (Display
*, Window
, void *);
void (*reshape_cb
) (Display
*, Window
, void *,
unsigned int w
, unsigned int h
);
Bool (*event_cb
) (Display
*, Window
, void *, XEvent
*);
void (*free_cb
) (Display
*, Window
, void *);
void (*fps_cb
) (Display
*, Window
, fps_state
*, void *);
void (*fps_free
) (fps_state
*);
Visual
* (*pick_visual_hook
) (Screen
*);
Bool (*validate_visual_hook
) (Screen
*, const char *, Visual
*);
extern const char *progname
;
#endif /* __SCREENHACK_I_H__ */