summaryrefslogtreecommitdiff
path: root/uisimulator/x11/screenhack.h
diff options
context:
space:
mode:
Diffstat (limited to 'uisimulator/x11/screenhack.h')
-rw-r--r--uisimulator/x11/screenhack.h97
1 files changed, 97 insertions, 0 deletions
diff --git a/uisimulator/x11/screenhack.h b/uisimulator/x11/screenhack.h
new file mode 100644
index 0000000000..12cd873e22
--- /dev/null
+++ b/uisimulator/x11/screenhack.h
@@ -0,0 +1,97 @@
1/* xscreensaver, Copyright (c) 1992-1997 Jamie Zawinski <jwz@jwz.org>
2 *
3 * Permission to use, copy, modify, distribute, and sell this software and its
4 * documentation for any purpose is hereby granted without fee, provided that
5 * the above copyright notice appear in all copies and that both that
6 * copyright notice and this permission notice appear in supporting
7 * documentation. No representations are made about the suitability of this
8 * software for any purpose. It is provided "as is" without express or
9 * implied warranty.
10 */
11
12/* Found in Don Hopkins' .plan file:
13 *
14 * The color situation is a total flying circus. The X approach to
15 * device independence is to treat everything like a MicroVax framebuffer
16 * on acid. A truely portable X application is required to act like the
17 * persistent customer in the Monty Python ``Cheese Shop'' sketch. Even
18 * the simplest applications must answer many difficult questions, like:
19 *
20 * WHAT IS YOUR DISPLAY?
21 * display = XOpenDisplay("unix:0");
22 * WHAT IS YOUR ROOT?
23 * root = RootWindow(display, DefaultScreen(display));
24 * AND WHAT IS YOUR WINDOW?
25 * win = XCreateSimpleWindow(display, root, 0, 0, 256, 256, 1,
26 * BlackPixel(display, DefaultScreen(display)),
27 * WhitePixel(display, DefaultScreen(display)))
28 * OH ALL RIGHT, YOU CAN GO ON.
29 *
30 * WHAT IS YOUR DISPLAY?
31 * display = XOpenDisplay("unix:0");
32 * WHAT IS YOUR COLORMAP?
33 * cmap = DefaultColormap(display, DefaultScreen(display));
34 * AND WHAT IS YOUR FAVORITE COLOR?
35 * favorite_color = 0; / * Black. * /
36 * / * Whoops! No, I mean: * /
37 * favorite_color = BlackPixel(display, DefaultScreen(display));
38 * / * AAAYYYYEEEEE!! (client dumps core & falls into the chasm) * /
39 *
40 * WHAT IS YOUR DISPLAY?
41 * display = XOpenDisplay("unix:0");
42 * WHAT IS YOUR VISUAL?
43 * struct XVisualInfo vinfo;
44 * if (XMatchVisualInfo(display, DefaultScreen(display),
45 * 8, PseudoColor, &vinfo) != 0)
46 * visual = vinfo.visual;
47 * AND WHAT IS THE NET SPEED VELOCITY OF AN XConfigureWindow REQUEST?
48 * / * Is that a SubStructureRedirectMask or a ResizeRedirectMask? * /
49 * WHAT?! HOW AM I SUPPOSED TO KNOW THAT?
50 * AAAAUUUGGGHHH!!!! (server dumps core & falls into the chasm)
51 */
52
53#ifndef __SCREENHACK_H__
54#define __SCREENHACK_H__
55
56#include <stdlib.h>
57
58#include "config.h"
59
60#ifdef __hpux
61 /* Which of the ten billion standards does values.h belong to?
62 What systems always have it? */
63# include <values.h>
64#endif
65
66#include <stdio.h>
67
68#include <X11/Xlib.h>
69#include <X11/Xresource.h>
70#include <X11/Xos.h>
71
72/* M_PI ought to have been defined in math.h, but... */
73#ifndef M_PI
74# define M_PI 3.1415926535
75#endif
76
77#ifndef M_PI_2
78# define M_PI_2 1.5707963267
79#endif
80
81#include "resources.h"
82#include "visual.h"
83
84extern Bool mono_p;
85extern char *progname;
86extern char *progclass;
87extern XrmDatabase db;
88extern XrmOptionDescRec options [];
89extern char *defaults [];
90
91extern void screenhack (Display*,Window);
92extern int screenhack_handle_event (Display*, XEvent*);
93extern int screenhack_handle_events (void);
94extern void screen_redraw();
95extern void screen_resized();
96
97#endif /* __SCREENHACK_H__ */