2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
26 * Mach Operating System
27 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
28 * All Rights Reserved.
30 * Permission to use, copy, modify and distribute this software and its
31 * documentation is hereby granted, provided that both the copyright
32 * notice and this permission notice appear in all copies of the
33 * software, derivative works or modified versions, and any portions
34 * thereof, and that both notices appear in supporting documentation.
36 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
37 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
38 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
40 * Carnegie Mellon requests users of this software to return to
42 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
43 * School of Computer Science
44 * Carnegie Mellon University
45 * Pittsburgh PA 15213-3890
47 * any improvements or extensions that they make and grant Carnegie Mellon
48 * the rights to redistribute these changes.
54 * Author: Alessandro Forin, Carnegie Mellon University
57 * Definitions for the Generic Screen Driver.
64 * Most of these structures are defined so that the
65 * resulting structure mapped to user space appears
66 * to be compatible with the one used by the DEC X
67 * servers (pm_info..). Keep it that way and the
68 * X servers will keep on running.
72 * Generic structures and defines
89 unsigned int Bg_rgb
[3];
90 unsigned int Fg_rgb
[3];
93 /* generic input event */
95 short x
; /* x position */
96 short y
; /* y position */
97 unsigned int time
; /* 1 millisecond units */
99 unsigned char type
; /* button up/down/raw or motion */
100 # define EVT_BUTTON_UP 0
101 # define EVT_BUTTON_DOWN 1
102 # define EVT_BUTTON_RAW 2
103 # define EVT_PTR_MOTION 3
105 unsigned char key
; /* the key (button only) */
106 # define KEY_LEFT_BUTTON 1
107 # define KEY_MIDDLE_BUTTON 2
108 # define KEY_RIGHT_BUTTON 3
109 # define KEY_TBL_LEFT_BUTTON 0
110 # define KEY_TBL_FRONT_BUTTON 1
111 # define KEY_TBL_RIGHT_BUTTON 2
112 # define KEY_TBL_BACK_BUTTON 3
114 unsigned char index
; /* which instance of device */
116 unsigned char device
; /* which device */
120 # define DEV_TABLET 3
122 # define DEV_CONSOLE 5
124 # define DEV_JOYSTICK 9
128 /* timed coordinate info */
132 } screen_timed_point_t
;
134 /* queue of input events, and ring of mouse motions track */
136 screen_event_t
*events
;
140 unsigned long timestamp
;
141 screen_timed_point_t
*track
;
146 /* mouse/cursor position */
152 /* mouse motion bounding boxes */
161 * Here it is, each field is marked as
163 * Kset : kernel sets it unconditionally
164 * Kuse : kernel uses it, safely
165 * Kdep : kernel might depend on it
168 screen_evque_t evque
; /* Kset, Kuse */
169 short mouse_buttons
; /* Kset */
170 screen_point_t xx3
/*tablet*/;
171 short xx4
/*tswitches*/;
172 screen_point_t cursor
; /* Kset */
173 short row
; /* Kdep */
174 short col
; /* Kdep */
175 short max_row
; /* Kdep */
176 short max_col
; /* Kdep */
177 short max_x
; /* Kset */
178 short max_y
; /* Kset */
179 short max_cur_x
; /* Kdep */
180 short max_cur_y
; /* Kdep */
181 int version
; /* Kset */
184 unsigned char * bitmap
; /* Kset */
185 short * x16
/*scanmap*/;
186 short * x17
/*cursorbits*/;
187 short * x18
/*pmaddr*/;
188 unsigned char * planemask
; /* Kset */
192 int * gram
/* Kset */;
193 int * rb_addr
/* Kset */;
194 int rb_phys
/* Kset */;
195 int rb_size
/* Kset */;
198 screen_point_t mouse_loc
; /* Kdep */
199 screen_rect_t mouse_box
; /* Kdep */
200 short mouse_threshold
;/* Kuse */
201 short mouse_scale
; /* Kuse */
202 short min_cur_x
; /* Kdep */
203 short min_cur_y
; /* Kdep */
206 int x26
/*dev_type*/;
207 char * x27
/*framebuffer*/;
208 char * x28
/*volatile struct bt459 *bt459*/;
210 char cursor_sprite
[1024];/* Kset */
211 unsigned char Bg_color
[3]; /* Kset */
212 unsigned char Fg_color
[3]; /* Kset */
213 int tablet_scale_x
; /* Kuse */
214 int tablet_scale_y
; /* Kuse */
217 char * gxo
/* Kset */;
218 char stamp_width
/* Kset */;
219 char stamp_height
/* Kset */;
220 char nplanes
/* Kset */;
221 char x27_4
/* n10_present */;
222 char x28_1
/* dplanes */;
223 char zplanes
/* Kset */;
224 char zzplanes
/* Kset */;
225 unsigned char cursor_sprite
[1024] /* Kuse */;
226 char x285_0
/* padding for next, which was int */;
227 unsigned char Fg_color
[4] /* Kuse */;
228 unsigned char Bg_color
[4] /* Kuse */;
229 unsigned short cmap_index
/* Kuse */;
230 unsigned short cmap_count
/* Kuse */;
231 unsigned int colormap
[256] /* Kuse */;
232 int * stic_dma_rb
/* Kset */;
233 int * stic_reg
/* Kset */;
234 int ptpt_phys
/* Kdep */;
235 int ptpt_size
/* Kdep */;
236 int * ptpt_pgin
/* Kset */;
239 short frame_scanline_width
; /* in pixels, Kset */
240 short frame_height
; /* in scanlines, Kset */
242 * Event queues are allocated right after that
244 #define MAX_EVENTS 64
245 #define MAX_TRACK 100
246 screen_event_t event_queue
[MAX_EVENTS
]; /* Kset */
247 screen_timed_point_t point_track
[MAX_TRACK
]; /* Kset */
251 unsigned int event_id
;
257 * Screen get_status codes and arguments
259 #include <sys/ioctl.h>
261 /* Get size (and offset) of mapped info */
262 #define SCREEN_GET_OFFSETS _IOR('q', 6, unsigned **)
264 /* Get screen status flags */
265 #define SCREEN_STATUS_FLAGS _IOR('q', 22, int *)
266 # define MONO_SCREEN 0x01
267 # define COLOR_SCREEN 0x02
268 # define SCREEN_BEING_UPDATED 0x04
271 * Screen set_status codes and arguments
274 /* start/stop screen saver, control fading interval */
275 #define SCREEN_FADE _IOW('q', 114, int) /* fade screen */
278 /* Turn video on/off manually */
279 #define SCREEN_ON _IO('q', 10)
280 #define SCREEN_OFF _IO('q', 11)
282 /* Fixup pointers inside mapped info structure */
283 #define SCREEN_ADJ_MAPPED_INFO _IOR('q', 1, user_info_t *)
285 /* Initialize anything that needs to, hw-wise */
286 #define SCREEN_INIT _IO('q', 4)
288 /* Position cursor to a specific spot */
289 #define SCREEN_SET_CURSOR _IOW('q', 2, screen_point_t)
291 /* Load Bg/Fg colors for cursor */
292 #define SCREEN_SET_CURSOR_COLOR _IOW('q', 3, cursor_color_t)
294 /* Load cursor sprite, small cursor form */
295 typedef unsigned short cursor_sprite_t
[32];
297 #define SCREEN_LOAD_CURSOR _IOW('q', 7, cursor_sprite_t)
299 /* Load cursor sprite, large 64x64 cursor form */
300 typedef char cursor_sprite_long_t
[1024];
302 #define SCREEN_LOAD_CURSOR_LONG _IOW('q', 13, cursor_sprite_long_t)
304 /* Modify a given entry in the color map (VDAC) */
305 #define SCREEN_SET_CMAP_ENTRY _IOW('q', 12, color_map_entry_t)
307 /* Return some other information about hardware (optional) */
311 int frame_visible_width
;
312 int frame_visible_height
;
314 #define SCREEN_HARDWARE_INFO _IOR('q', 23, screen_hw_info_t)
316 /* Screen-dependent, unspecified (and despised) */
317 #define SCREEN_HARDWARE_DEP _IO('q', 24)
319 #endif /* _SCREEN_H_ */