summaryrefslogtreecommitdiff
path: root/xts5/include/XstDisplay.h
blob: f7c013a019a0073810fd734ef5362106cb0fb5ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
/*
Copyright (c) 2005 X.Org Foundation L.L.C.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/*
*
* Copyright (c) Applied Testing and Technology, Inc. 1995
* All Rights Reserved.
*
* Project: VSW5
*
* File: xts5/include/XstDisplay.h
*
* Description:
*	Defines used by the X tests
*
* Modifications:
* $Log: XstDisplay.h,v $
* Revision 1.3  2005-11-03 08:42:00  jmichael
* clean up all vsw5 paths to use xts5 instead.
*
* Revision 1.2  2005/04/21 09:40:42  ajosey
* resync to VSW5.1.5
*
* Revision 8.1  1999/04/03 01:23:22  mar
* req.4.W.00136: add low-level BigRequests support to Xlib-less connections
*
* Revision 8.0  1998/12/23 23:23:29  mar
* Branch point for Release 5.0.2
*
* Revision 7.0  1998/10/30 22:41:34  mar
* Branch point for Release 5.0.2b1
*
* Revision 6.0  1998/03/02 05:15:59  tbr
* Branch point for Release 5.0.1
*
* Revision 5.0  1998/01/26 03:12:31  tbr
* Branch point for Release 5.0.1b1
*
* Revision 4.0  1995/12/15 08:38:25  tbr
* Branch point for Release 5.0.0
*
* Revision 3.2  1995/12/15  00:37:52  andy
* Prepare for GA Release
*
*/

/*
Portions of this software are based on Xlib and X Protocol Test Suite.
We have used this material under the terms of its copyright, which grants
free use, subject to the conditions below.  Note however that those
portions of this software that are based on the original Test Suite have
been significantly revised and that all such revisions are copyright (c)
1995 Applied Testing and Technology, Inc.  Insomuch as the proprietary
revisions cannot be separated from the freely copyable material, the net
result is that use of this software is governed by the ApTest copyright.

Copyright (c) 1990, 1991  X Consortium

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Except as contained in this notice, the name of the X Consortium shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from the X Consortium.

Copyright 1990, 1991 by UniSoft Group Limited.

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, and that the name of UniSoft not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.  UniSoft
makes no representations about the suitability of this software for any
purpose.  It is provided "as is" without express or implied warranty.
*/

#define XstConnectionNumber(dpy) 	((dpy)->fd)
#define XstRootWindow(dpy, scr) 	(((dpy)->screens[(scr)]).root)
#define XstDefaultScreen(dpy) 	((dpy)->default_screen)
#define XstDefaultRootWindow(dpy) 	(((dpy)->screens[(dpy)->default_screen]).root)
#define XstDefaultVisual(dpy, scr) (((dpy)->screens[(scr)]).root_visual)
#define XstDefaultGC(dpy, scr) 	(((dpy)->screens[(scr)]).default_gc)
#define XstBlackPixel(dpy, scr) 	(((dpy)->screens[(scr)]).black_pixel)
#define XstWhitePixel(dpy, scr) 	(((dpy)->screens[(scr)]).white_pixel)
#define XstAllPlanes 		(~0)
#define XstQLength(dpy) 		((dpy)->qlen)
#define XstDisplayWidth(dpy, scr) 	(((dpy)->screens[(scr)]).width)
#define XstDisplayHeight(dpy, scr) (((dpy)->screens[(scr)]).height)
#define XstDisplayWidthMM(dpy, scr)(((dpy)->screens[(scr)]).mwidth)
#define XstDisplayHeightMM(dpy, scr)(((dpy)->screens[(scr)]).mheight)
#define XstDisplayPlanes(dpy, scr) (((dpy)->screens[(scr)]).root_depth)
#define XstDisplayCells(dpy, scr) 	(XstDefaultVisual((dpy), (scr))->map_entries)
#define XstScreenCount(dpy) 	((dpy)->nscreens)
#define XstServerVendor(dpy) 	((dpy)->vendor)
#define XstProtocolVersion(dpy) 	((dpy)->proto_major_version)
#define XstProtocolRevision(dpy) 	((dpy)->proto_minor_version)
#define XstVendorRelease(dpy) 	((dpy)->release)
#define XstDisplayString(dpy) 	((dpy)->display_name)
#define XstDefaultDepth(dpy, scr) 	(((dpy)->screens[(scr)]).root_depth)
#define XstDefaultColormap(dpy, scr)(((dpy)->screens[(scr)]).cmap)
#define XstBitmapUnit(dpy) 	((dpy)->bitmap_unit)
#define XstBitmapBitOrder(dpy) 	((dpy)->bitmap_bit_order)
#define XstBitmapPad(dpy) 		((dpy)->bitmap_pad)
#define XstImageByteOrder(dpy) 	((dpy)->byte_order)
#define XstNextRequest(dpy)	((dpy)->request + 1)
#define XstLastKnownRequestProcessed(dpy)	((dpy)->last_request_read)

/* macros for screen oriented applications (toolkit) */
#define XstScreenOfDisplay(dpy, scr)(&((dpy)->screens[(scr)]))
#define XstDefaultScreenOfDisplay(dpy) (&((dpy)->screens[(dpy)->default_screen]))
#define XstDisplayOfScreen(s)	((s)->display)
#define XstRootWindowOfScreen(s)	((s)->root)
#define XstBlackPixelOfScreen(s)	((s)->black_pixel)
#define XstWhitePixelOfScreen(s)	((s)->white_pixel)
#define XstDefaultColormapOfScreen(s)((s)->cmap)
#define XstDefaultDepthOfScreen(s)	((s)->root_depth)
#define XstDefaultGCOfScreen(s)	((s)->default_gc)
#define XstDefaultVisualOfScreen(s)((s)->root_visual)
#define XstWidthOfScreen(s)	((s)->width)
#define XstHeightOfScreen(s)	((s)->height)
#define XstWidthMMOfScreen(s)	((s)->mwidth)
#define XstHeightMMOfScreen(s)	((s)->mheight)
#define XstPlanesOfScreen(s)	((s)->root_depth)
#define XstCellsOfScreen(s)	(XstDefaultVisualOfScreen((s))->map_entries)
#define XstMinCmapsOfScreen(s)	((s)->min_maps)
#define XstMaxCmapsOfScreen(s)	((s)->max_maps)
#define XstDoesSaveUnders(s)	((s)->save_unders)
#define XstDoesBackingStore(s)	((s)->backing_store)
#define XstEventMaskOfScreen(s)	((s)->root_input_mask)


/*
 * Visual structure; contains information about colormapping possible.
 */
typedef struct {
	XExtData *ext_data;	/* hook for extension to hang data */
	VisualID visualid;	/* visual id of this visual */
#if defined(__cplusplus) || defined(c_plusplus)
	int c_class;		/* C++ class of screen (monochrome, etc.) */
#else
	int class;		/* class of screen (monochrome, etc.) */
#endif
	unsigned long red_mask, green_mask, blue_mask;	/* mask values */
	int bits_per_rgb;	/* log base 2 of distinct color values */
	int map_entries;	/* color map entries */
} XstVisual;

/*
 * Depth structure; contains information for each possible depth.
 */	
typedef struct {
	int depth;		/* this depth (Z) of the depth */
	int nvisuals;		/* number of Visual types at this depth */
	XstVisual *visuals;	/* list of visuals possible at this depth */
} XstDepth;

/*
 * Information about the screen.
 */
typedef struct {
	XExtData *ext_data;	/* hook for extension to hang data */
	struct _XstDisplay *display;/* back pointer to display structure */
	Window root;		/* Root window id. */
	int width, height;	/* width and height of screen */
	int mwidth, mheight;	/* width and height of  in millimeters */
	int ndepths;		/* number of depths possible */
	XstDepth *depths;		/* list of allowable depths on the screen */
	int root_depth;		/* bits per pixel */
	XstVisual *root_visual;	/* root visual */
#ifdef NotRequired
	GC default_gc;		/* GC for the root root visual */
#endif /* NotRequired */
	Colormap cmap;		/* default color map */
	unsigned long white_pixel;
	unsigned long black_pixel;	/* White and Black pixel values */
	int max_maps, min_maps;	/* max and min color maps */
	int backing_store;	/* Never, WhenMapped, Always */
	Bool save_unders;	
	long root_input_mask;	/* initial root input mask */
} XstScreen;

/*
 * Format structure; describes ZFormat data the screen will understand.
 */
typedef struct {
	XExtData *ext_data;	/* hook for extension to hang data */
	int depth;		/* depth of this image format */
	int bits_per_pixel;	/* bits/pixel at this depth */
	int scanline_pad;	/* scanline must padded to this multiple */
} XstScreenFormat;

/*
 * Display datatype maintaining display specific data.
 */
typedef struct _XstDisplay {
	XExtData *ext_data;	/* hook for extension to hang data */
	struct _XstDisplay *next; /* next open Display on list */
	int fd;			/* Network socket. */
	int lock;		/* is someone in critical section? */
	int proto_major_version;/* maj. version of server's X protocol */
	int proto_minor_version;/* minor version of servers X protocol */
	char *vendor;		/* vendor of the server hardware */
        long resource_base;	/* resource ID base */
	long resource_mask;	/* resource ID mask bits */
	long resource_id;	/* allocator current ID */
	int resource_shift;	/* allocator shift to correct bits */
	XID (*resource_alloc)(); /* allocator function */
	int byte_order;		/* screen byte order, LSBFirst, MSBFirst */
	int bitmap_unit;	/* padding and data requirements */
	int bitmap_pad;		/* padding requirements on bitmaps */
	int bitmap_bit_order;	/* LeastSignificant or MostSignificant */
	int nformats;		/* number of pixmap formats in list */
	XstScreenFormat *pixmap_format;	/* pixmap format list */
	int vnumber;		/* Xlib's X protocol version number. */
	int release;		/* release of the server */
#ifdef NotRequired
	struct _XSQEvent *head, *tail;	/* Input event queue. */
#endif /* NotRequired */
	int qlen;		/* Length of input event queue */
	unsigned long last_request_read; /* seq number of last event read */
	unsigned long request;	/* sequence number of last request. */
	char *last_req;		/* beginning of last request, or dummy */
	char *buffer;		/* Output buffer starting address. */
	char *bufptr;		/* Output buffer index pointer. */
	char *bufmax;		/* Output buffer maximum+1 address. */
	unsigned max_request_size; /* maximum number 32 bit words in request*/
#ifdef NotRequired
	struct _XrmHashBucketRec *db;
#endif /* NotRequired */
	int (*synchandler)();	/* Synchronization handler */
	char *display_name;	/* "host:display" string used on this connect*/
	int default_screen;	/* default screen for operations */
	int nscreens;		/* number of screens on this server*/
	XstScreen *screens;	/* pointer to list of screens */
	unsigned long motion_buffer;	/* size of motion buffer */
	Window current;		/* for use internally for Keymap notify */
	int min_keycode;	/* minimum defined keycode */
	int max_keycode;	/* maximum defined keycode */
	KeySym *keysyms;	/* This server's keysyms */
	XModifierKeymap *modifiermap;	/* This server's modifier keymap */
	int keysyms_per_keycode;/* number of rows */
	char *xdefaults;	/* contents of defaults from server */
	char *scratch_buffer;	/* place to hang scratch buffer */
	unsigned long scratch_length;	/* length of scratch buffer */
#ifdef NotRequired
	int ext_number;		/* extension number on this display */
	_XExtension *ext_procs;	/* extensions initialized on this display */
#endif /* NotRequired */
	/*
	 * the following can be fixed size, as the protocol defines how
	 * much address space is available. 
	 * While this could be done using the extension vector, there
	 * may be MANY events processed, so a search through the extension
	 * list to find the right procedure for each event might be
	 * expensive if many extensions are being used.
	 */
	Bool (*event_vec[128])();  /* vector for wire to event */
	Status (*wire_vec[128])(); /* vector for event to wire */
	unsigned long bigreq_size; /* max size of big requests */
#ifdef NotRequired
	KeySym lock_meaning;	   /* for XLookupString */
	struct XKeytrans *key_bindings; /* for XLookupString */
#endif /* NotRequired */
	Font cursor_font;	   /* for XCreateFontCursor */
	/*
	 * ICCCM information, version 1
	 */
	struct _DisplayAtoms *atoms;
	struct {		   /* for XReconfigureWMWindow */
	    long sequence_number;
	    int (*old_handler)();
	    Bool succeeded;
	} reconfigure_wm_window;
	/*
	 * additional connection info
	 */
	unsigned long flags;	   /* internal connection flags */
	unsigned int mode_switch;  /* keyboard group modifiers */
	/*
	 * For X Protocol Testing use only. This is where we store
	 * the Xlib Display pointer, for subsequent closing, if we
	 * had to use XOpenDisplay to get at the fd. If not it's NULL.
	 */
	Display *xlib_dpy;
} XstDisplay;