Filter:   InfoImg
download screen.h
Language: C
Copyright: Copyright 1991-1998 by Open Software Foundation, Inc. (c) 1991,1990,1989 Carnegie Mellon University
LOC: 177
Project Info
Hurd on Mach on PowerPC(hurdppc)
Server: Savannah NonGNU
Type: cvs
...pc\hurdppc\gnu‑osfmach\ppc\
   _setjmp.S
   alignment.c
   asm.h
   ast.h
   ast_types.h
   bcopy.S
   bits.S
   boot.h
   bzero.S
   cache.S
   clock.h
   console_feed.c
   console_feed_entries.h
   cpu_number.h
   cswtch.S
   db_disasm.c
   db_interface.c
   db_low_trace.c
   db_low_trace.h
   db_machdep.h
   db_trace.c
   endian.h
   exception.h
   Firmware.h
   Firmware.S
   FirmwareCalls.h
   fpu_protos.h
   gdb_defs.h
   genassym.c
   go.c
   hardclock_entries.h
   hw_exception.S
   hw_lock.S
   interrupt.c
   io_map.c
   io_map_entries.h
   iobus.h
   iso_font.h
   kgdb_defs.h
   kgdb_interface.c
   kgdb_setjmp.h
   klglue.S
   lock.h
   low_trace.h
   lowmem_vectors.S
   mach_param.h
   machine_routines.h
   machine_rpc.h
   machlimits.h
   machparam.h
   mem.c
   mem.h
   misc.c
   misc_asm.S
   misc_protos.h
   model_dep.c
   movc.S
   mp.h
   MPinterfaces.S
   ndr_def.h
   net_filter.c
   new_screen.h
   pcb.c
   pmap.c
   pmap.c-broken
   pmap.h
   pmap_internals.h
   ppc_disasm.i
   ppc_init.c
   ppc_rpc.c
   proc_reg.h
   screen.h
   screen_defs.h
   screen_switch.h
   serial_console.c
   serial_defs.h
   setjmp.h
   spl.h
   start.S
   status.c
   strlen.c
   stubs.c
   syscall_subr.h
   task.h
   testjump.c
   thread.h
   thread_act.h
   trap.c
   trap.h
   vm_tuning.h
   xpr.h

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
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
/*
 * Copyright 1991-1998 by Open Software Foundation, Inc. 
 *              All Rights Reserved 
 *  
 * Permission to use, copy, modify, and distribute this software and 
 * its documentation for any purpose and without fee is hereby granted, 
 * provided that the above copyright notice appears in all copies and 
 * that both the copyright notice and this permission notice appear in 
 * supporting documentation. 
 *  
 * OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE 
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
 * FOR A PARTICULAR PURPOSE. 
 *  
 * IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR 
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 
 * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT, 
 * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 
 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 
 */
/*
 * MkLinux
 */
/* CMU_HIST */
/*
 * Revision 2.8  91/08/24  11:53:04  af
 * 	Added frame size related defs, and get_status call.
 * 	[91/08/02  02:05:23  af]
 * 
 * Revision 2.7  91/06/19  11:54:17  rvb
 * 	File moved here from mips/PMAX since it tries to be generic;
 * 	it is used on the PMAX and the Vax3100.
 * 	[91/06/04            rvb]
 * 
 * Revision 2.6  91/05/14  17:27:25  mrt
 * 	Correcting copyright
 * 
 * Revision 2.5  91/03/16  14:54:40  rpd
 * 	Fixed ioctl definitions for ANSI C.
 * 	[91/02/20            rpd]
 * 
 * Revision 2.4  91/02/05  17:44:13  mrt
 * 	Added author notices
 * 	[91/02/04  11:17:36  mrt]
 * 
 * 	Changed to use new Mach copyright
 * 	[91/02/02  12:16:09  mrt]
 * 
 * Revision 2.3  90/12/05  23:34:10  af
 * 	Works on both 3maxen and pmaxen.
 * 	[90/12/03  23:35:23  af]
 * 
 * Revision 2.1.1.1  90/11/01  03:41:33  af
 * 	Created.
 * 	[90/09/03            af]
 */
/* CMU_ENDHIST */
/* 
 * Mach Operating System
 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
 * All Rights Reserved.
 * 
 * Permission to use, copy, modify and distribute this software and its
 * documentation is hereby granted, provided that both the copyright
 * notice and this permission notice appear in all copies of the
 * software, derivative works or modified versions, and any portions
 * thereof, and that both notices appear in supporting documentation.
 * 
 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
 * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
 * 
 * Carnegie Mellon requests users of this software to return to
 * 
 *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
 *  School of Computer Science
 *  Carnegie Mellon University
 *  Pittsburgh PA 15213-3890
 * 
 * any improvements or extensions that they make and grant Carnegie Mellon
 * the rights to redistribute these changes.
 */
/*
 */
/*
 *	File: screen.h
 * 	Author: Alessandro Forin, Carnegie Mellon University
 *	Date:	9/90
 *
 *	Definitions for the Generic Screen Driver.
 */

#ifndef _SCREEN_H_
#define _SCREEN_H_

/*
 * Most of these structures are defined so that the
 * resulting structure mapped to user space appears
 * to be compatible with the one used by the DEC X
 * servers (pm_info..). Keep it that way and the
 * X servers will keep on running.
 */

/*
 * Generic structures and defines
 */

/* colors */
typedef struct {
	unsigned short	red;
	unsigned short	green;
	unsigned short	blue;
} color_map_t;

typedef struct {
	short		unused;
	unsigned short	index;
	color_map_t	value;
} color_map_entry_t;

typedef struct {
	unsigned int	Bg_rgb[3];
	unsigned int	Fg_rgb[3];
} cursor_color_t;

/* generic input event */
typedef struct {
        short	        x;		/* x position */
        short 	        y;		/* y position */
        unsigned int    time;		/* 1 millisecond units */

        unsigned char   type;		/* button up/down/raw or motion */
#	define	EVT_BUTTON_UP		0
#	define	EVT_BUTTON_DOWN		1
#	define	EVT_BUTTON_RAW		2
#	define	EVT_PTR_MOTION		3

        unsigned char   key;		/* the key (button only) */
#	define	KEY_LEFT_BUTTON		1
#	define	KEY_MIDDLE_BUTTON	2
#	define	KEY_RIGHT_BUTTON	3
#	define	KEY_TBL_LEFT_BUTTON	0
#	define	KEY_TBL_FRONT_BUTTON	1
#	define	KEY_TBL_RIGHT_BUTTON	2
#	define	KEY_TBL_BACK_BUTTON	3

        unsigned char   index;		/* which instance of device */

        unsigned char   device;		/* which device */
#	define	DEV_NULL		0
#	define	DEV_MOUSE		1
#	define	DEV_KEYBD		2
#	define	DEV_TABLET		3
#	define	DEV_AUX			4
#	define	DEV_CONSOLE		5
#	define	DEV_KNOB		8
#	define	DEV_JOYSTICK		9

} screen_event_t;

/* timed coordinate info */
typedef struct {
	unsigned int	time;
	short		x, y;
} screen_timed_point_t;

/* queue of input events, and ring of mouse motions track */
typedef struct {
	screen_event_t 	*events;
	unsigned int 	q_size;
        unsigned int    q_head;
        unsigned int    q_tail;
	unsigned	long	timestamp;
	screen_timed_point_t	*track;
	unsigned int	t_size;
	unsigned int	t_next;
} screen_evque_t;

/* mouse/cursor position */
typedef struct {
        short x;
        short y;
} screen_point_t;

/* mouse motion bounding boxes */
typedef struct {
        short bottom;
        short right;
        short left;
        short top;
} screen_rect_t;

/*
 * Here it is, each field is marked as
 *
 * Kset	: kernel sets it unconditionally
 * Kuse : kernel uses it, safely
 * Kdep : kernel might depend on it
 */
typedef struct {
  screen_evque_t	evque;		/* Kset, Kuse */
  short			mouse_buttons;	/* Kset */
  screen_point_t 	xx3	/*tablet*/;
  short			xx4	/*tswitches*/;
  screen_point_t 	cursor;		/* Kset */
  short			row;		/* Kdep */
  short			col;		/* Kdep */
  short			max_row;	/* Kdep */
  short			max_col;	/* Kdep */
  short			max_x;		/* Kset */
  short			max_y;		/* Kset */
  short			max_cur_x;	/* Kdep */
  short			max_cur_y;	/* Kdep */
  int			version;	/* Kset */
  union {
    struct {
	unsigned char *	bitmap;		/* Kset */
	short *		x16	/*scanmap*/;
	short *		x17	/*cursorbits*/;
	short *		x18	/*pmaddr*/;
	unsigned char *	planemask;	/* Kset */
    } pm;
    struct {
	int		x15	/* flags */;
	int *		gram	/* Kset */;
	int *		rb_addr	/* Kset */;
	int		rb_phys	/* Kset */;
	int		rb_size	/* Kset */;
    } gx;
  } dev_dep_1;
  screen_point_t 	mouse_loc;	/* Kdep */
  screen_rect_t		mouse_box;	/* Kdep */
  short			mouse_threshold;/* Kuse */
  short			mouse_scale;	/* Kuse */
  short			min_cur_x;	/* Kdep */
  short			min_cur_y;	/* Kdep */
  union {
    struct {
	int		x26	/*dev_type*/;
	char *		x27	/*framebuffer*/;
	char *		x28	/*volatile struct bt459 *bt459*/;
	int		x29	/*slot*/;
	char		cursor_sprite[1024];/* Kset */
	unsigned char	Bg_color[3];	/* Kset */
	unsigned char	Fg_color[3];	/* Kset */
	int		tablet_scale_x;	/* Kuse */
	int 		tablet_scale_y;	/* Kuse */
    } pm;
    struct {
	char *		gxo		/* Kset */;
	char		stamp_width	/* Kset */;
	char		stamp_height	/* Kset */;
	char		nplanes		/* Kset */;
	char		x27_4	/* n10_present */;
	char		x28_1	/* dplanes */;
	char		zplanes		/* Kset */;
	char		zzplanes	/* Kset */;
	unsigned char	cursor_sprite[1024]	/* Kuse */;
	char		x285_0		/* padding for next, which was int */;
	unsigned char	Fg_color[4]	/* Kuse */;
	unsigned char	Bg_color[4]	/* Kuse */;
	unsigned short	cmap_index	/* Kuse */;
	unsigned short	cmap_count	/* Kuse */;
	unsigned int	colormap[256]	/* Kuse */;
	int *		stic_dma_rb	/* Kset */;
	int *		stic_reg	/* Kset */;
	int		ptpt_phys	/* Kdep */;
	int		ptpt_size	/* Kdep */;
	int *		ptpt_pgin	/* Kset */;
    } gx;
  } dev_dep_2;
  short		frame_scanline_width;	/* in pixels, Kset */
  short		frame_height;		/* in scanlines, Kset */
  /*
   * Event queues are allocated right after that
   */
#define	MAX_EVENTS	64
#define	MAX_TRACK	100
  screen_event_t	event_queue[MAX_EVENTS]; /* Kset */
  screen_timed_point_t	point_track[MAX_TRACK];  /* Kset */
  /*
   * Some like it hot
   */
  unsigned int		event_id;
  int			interrupt_info;
} user_info_t;


/*
 * Screen get_status codes and arguments
 */
#include <sys/ioctl.h>

	/* Get size (and offset) of mapped info */
#define	SCREEN_GET_OFFSETS	_IOR('q', 6, unsigned **)

	/* Get screen status flags */
#define SCREEN_STATUS_FLAGS	_IOR('q', 22, int *)
#	define	MONO_SCREEN	0x01
#	define	COLOR_SCREEN	0x02
#	define	SCREEN_BEING_UPDATED 0x04

/*
 * Screen set_status codes and arguments
 */

	/* start/stop screen saver, control fading interval */
#define	SCREEN_FADE		_IOW('q', 114, int)	/* fade screen */
#	define	NO_FADE		-1

	/* Turn video on/off manually */
#define SCREEN_ON		_IO('q', 10)
#define	SCREEN_OFF		_IO('q', 11)

	/* Fixup pointers inside mapped info structure */
#define	SCREEN_ADJ_MAPPED_INFO 	_IOR('q', 1, user_info_t *)

	/* Initialize anything that needs to, hw-wise */
#define SCREEN_INIT		_IO('q', 4)

	/* Position cursor to a specific spot */
#define SCREEN_SET_CURSOR	_IOW('q', 2, screen_point_t)

	/* Load Bg/Fg colors for cursor */
#define	SCREEN_SET_CURSOR_COLOR	_IOW('q', 3, cursor_color_t)

	/* Load cursor sprite, small cursor form */
typedef unsigned short cursor_sprite_t[32];

#define	SCREEN_LOAD_CURSOR	_IOW('q', 7, cursor_sprite_t)

	/* Load cursor sprite, large 64x64 cursor form */
typedef char cursor_sprite_long_t[1024];

#define	SCREEN_LOAD_CURSOR_LONG	_IOW('q', 13, cursor_sprite_long_t)

	/* Modify a given entry in the color map (VDAC) */
#define	SCREEN_SET_CMAP_ENTRY	_IOW('q', 12, color_map_entry_t)

	/* Return some other information about hardware (optional) */
typedef struct {
	int	frame_width;
	int	frame_height;
	int	frame_visible_width;
	int	frame_visible_height;
} screen_hw_info_t;
#define	SCREEN_HARDWARE_INFO	_IOR('q', 23, screen_hw_info_t)

	/* Screen-dependent, unspecified (and despised) */
#define	SCREEN_HARDWARE_DEP	_IO('q', 24)

#endif /* _SCREEN_H_ */