VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.9.0/xkbgeom.h@ 81245

最後變更 在這個檔案從81245是 32163,由 vboxsync 提交於 14 年 前

Additions/x11/x11include: additional headers for building drivers for X.Org Server 1.9

  • 屬性 svn:eol-style 設為 native
檔案大小: 14.9 KB
 
1/************************************************************
2Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
3
4Permission to use, copy, modify, and distribute this
5software and its documentation for any purpose and without
6fee is hereby granted, provided that the above copyright
7notice appear in all copies and that both that copyright
8notice and this permission notice appear in supporting
9documentation, and that the name of Silicon Graphics not be
10used in advertising or publicity pertaining to distribution
11of the software without specific prior written permission.
12Silicon Graphics makes no representation about the suitability
13of this software for any purpose. It is provided "as is"
14without any express or implied warranty.
15
16SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
17SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
18AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
19GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
20DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
21DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
22OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
23THE USE OR PERFORMANCE OF THIS SOFTWARE.
24
25********************************************************/
26
27#ifndef _XKBGEOM_H_
28#define _XKBGEOM_H_
29
30#include "xkbstr.h"
31
32#define XkbAddGeomKeyAlias SrvXkbAddGeomKeyAlias
33#define XkbAddGeomColor SrvXkbAddGeomColor
34#define XkbAddGeomDoodad SrvXkbAddGeomDoodad
35#define XkbAddGeomKey SrvXkbAddGeomKey
36#define XkbAddGeomOutline SrvXkbAddGeomOutline
37#define XkbAddGeomOverlay SrvXkbAddGeomOverlay
38#define XkbAddGeomOverlayRow SrvXkbAddGeomOverlayRow
39#define XkbAddGeomOverlayKey SrvXkbAddGeomOverlayKey
40#define XkbAddGeomProperty SrvXkbAddGeomProperty
41#define XkbAddGeomRow SrvXkbAddGeomRow
42#define XkbAddGeomSection SrvXkbAddGeomSection
43#define XkbAddGeomShape SrvXkbAddGeomShape
44#define XkbAllocGeomKeyAliases SrvXkbAllocGeomKeyAliases
45#define XkbAllocGeomColors SrvXkbAllocGeomColors
46#define XkbAllocGeomDoodads SrvXkbAllocGeomDoodads
47#define XkbAllocGeomKeys SrvXkbAllocGeomKeys
48#define XkbAllocGeomOutlines SrvXkbAllocGeomOutlines
49#define XkbAllocGeomPoints SrvXkbAllocGeomPoints
50#define XkbAllocGeomProps SrvXkbAllocGeomProps
51#define XkbAllocGeomRows SrvXkbAllocGeomRows
52#define XkbAllocGeomSectionDoodads SrvXkbAllocGeomSectionDoodads
53#define XkbAllocGeomSections SrvXkbAllocGeomSections
54#define XkbAllocGeomOverlays SrvXkbAllocGeomOverlays
55#define XkbAllocGeomOverlayRows SrvXkbAllocGeomOverlayRows
56#define XkbAllocGeomOverlayKeys SrvXkbAllocGeomOverlayKeys
57#define XkbAllocGeomShapes SrvXkbAllocGeomShapes
58#define XkbAllocGeometry SrvXkbAllocGeometry
59#define XkbFreeGeomKeyAliases SrvXkbFreeGeomKeyAliases
60#define XkbFreeGeomColors SrvXkbFreeGeomColors
61#define XkbFreeGeomDoodads SrvXkbFreeGeomDoodads
62#define XkbFreeGeomProperties SrvXkbFreeGeomProperties
63#define XkbFreeGeomOverlayKeys SrvXkbFreeGeomOverlayKeys
64#define XkbFreeGeomOverlayRows SrvXkbFreeGeomOverlayRows
65#define XkbFreeGeomOverlays SrvXkbFreeGeomOverlays
66#define XkbFreeGeomKeys SrvXkbFreeGeomKeys
67#define XkbFreeGeomRows SrvXkbFreeGeomRows
68#define XkbFreeGeomSections SrvXkbFreeGeomSections
69#define XkbFreeGeomPoints SrvXkbFreeGeomPoints
70#define XkbFreeGeomOutlines SrvXkbFreeGeomOutlines
71#define XkbFreeGeomShapes SrvXkbFreeGeomShapes
72#define XkbFreeGeometry SrvXkbFreeGeometry
73
74typedef struct _XkbProperty {
75 char *name;
76 char *value;
77} XkbPropertyRec,*XkbPropertyPtr;
78
79typedef struct _XkbColor {
80 unsigned int pixel;
81 char * spec;
82} XkbColorRec,*XkbColorPtr;
83
84typedef struct _XkbPoint {
85 short x;
86 short y;
87} XkbPointRec, *XkbPointPtr;
88
89typedef struct _XkbBounds {
90 short x1,y1;
91 short x2,y2;
92} XkbBoundsRec, *XkbBoundsPtr;
93#define XkbBoundsWidth(b) (((b)->x2)-((b)->x1))
94#define XkbBoundsHeight(b) (((b)->y2)-((b)->y1))
95
96typedef struct _XkbOutline {
97 unsigned short num_points;
98 unsigned short sz_points;
99 unsigned short corner_radius;
100 XkbPointPtr points;
101} XkbOutlineRec, *XkbOutlinePtr;
102
103typedef struct _XkbShape {
104 Atom name;
105 unsigned short num_outlines;
106 unsigned short sz_outlines;
107 XkbOutlinePtr outlines;
108 XkbOutlinePtr approx;
109 XkbOutlinePtr primary;
110 XkbBoundsRec bounds;
111} XkbShapeRec, *XkbShapePtr;
112#define XkbOutlineIndex(s,o) ((int)((o)-&(s)->outlines[0]))
113
114typedef struct _XkbShapeDoodad {
115 Atom name;
116 unsigned char type;
117 unsigned char priority;
118 short top;
119 short left;
120 short angle;
121 unsigned short color_ndx;
122 unsigned short shape_ndx;
123} XkbShapeDoodadRec, *XkbShapeDoodadPtr;
124#define XkbShapeDoodadColor(g,d) (&(g)->colors[(d)->color_ndx])
125#define XkbShapeDoodadShape(g,d) (&(g)->shapes[(d)->shape_ndx])
126#define XkbSetShapeDoodadColor(g,d,c) ((d)->color_ndx= (c)-&(g)->colors[0])
127#define XkbSetShapeDoodadShape(g,d,s) ((d)->shape_ndx= (s)-&(g)->shapes[0])
128
129typedef struct _XkbTextDoodad {
130 Atom name;
131 unsigned char type;
132 unsigned char priority;
133 short top;
134 short left;
135 short angle;
136 short width;
137 short height;
138 unsigned short color_ndx;
139 char * text;
140 char * font;
141} XkbTextDoodadRec, *XkbTextDoodadPtr;
142#define XkbTextDoodadColor(g,d) (&(g)->colors[(d)->color_ndx])
143#define XkbSetTextDoodadColor(g,d,c) ((d)->color_ndx= (c)-&(g)->colors[0])
144
145typedef struct _XkbIndicatorDoodad {
146 Atom name;
147 unsigned char type;
148 unsigned char priority;
149 short top;
150 short left;
151 short angle;
152 unsigned short shape_ndx;
153 unsigned short on_color_ndx;
154 unsigned short off_color_ndx;
155} XkbIndicatorDoodadRec, *XkbIndicatorDoodadPtr;
156#define XkbIndicatorDoodadShape(g,d) (&(g)->shapes[(d)->shape_ndx])
157#define XkbIndicatorDoodadOnColor(g,d) (&(g)->colors[(d)->on_color_ndx])
158#define XkbIndicatorDoodadOffColor(g,d) (&(g)->colors[(d)->off_color_ndx])
159#define XkbSetIndicatorDoodadOnColor(g,d,c) \
160 ((d)->on_color_ndx= (c)-&(g)->colors[0])
161#define XkbSetIndicatorDoodadOffColor(g,d,c) \
162 ((d)->off_color_ndx= (c)-&(g)->colors[0])
163#define XkbSetIndicatorDoodadShape(g,d,s) \
164 ((d)->shape_ndx= (s)-&(g)->shapes[0])
165
166typedef struct _XkbLogoDoodad {
167 Atom name;
168 unsigned char type;
169 unsigned char priority;
170 short top;
171 short left;
172 short angle;
173 unsigned short color_ndx;
174 unsigned short shape_ndx;
175 char * logo_name;
176} XkbLogoDoodadRec, *XkbLogoDoodadPtr;
177#define XkbLogoDoodadColor(g,d) (&(g)->colors[(d)->color_ndx])
178#define XkbLogoDoodadShape(g,d) (&(g)->shapes[(d)->shape_ndx])
179#define XkbSetLogoDoodadColor(g,d,c) ((d)->color_ndx= (c)-&(g)->colors[0])
180#define XkbSetLogoDoodadShape(g,d,s) ((d)->shape_ndx= (s)-&(g)->shapes[0])
181
182typedef struct _XkbAnyDoodad {
183 Atom name;
184 unsigned char type;
185 unsigned char priority;
186 short top;
187 short left;
188 short angle;
189} XkbAnyDoodadRec, *XkbAnyDoodadPtr;
190
191typedef union _XkbDoodad {
192 XkbAnyDoodadRec any;
193 XkbShapeDoodadRec shape;
194 XkbTextDoodadRec text;
195 XkbIndicatorDoodadRec indicator;
196 XkbLogoDoodadRec logo;
197} XkbDoodadRec, *XkbDoodadPtr;
198
199#define XkbUnknownDoodad 0
200#define XkbOutlineDoodad 1
201#define XkbSolidDoodad 2
202#define XkbTextDoodad 3
203#define XkbIndicatorDoodad 4
204#define XkbLogoDoodad 5
205
206typedef struct _XkbKey {
207 XkbKeyNameRec name;
208 short gap;
209 unsigned char shape_ndx;
210 unsigned char color_ndx;
211} XkbKeyRec, *XkbKeyPtr;
212#define XkbKeyShape(g,k) (&(g)->shapes[(k)->shape_ndx])
213#define XkbKeyColor(g,k) (&(g)->colors[(k)->color_ndx])
214#define XkbSetKeyShape(g,k,s) ((k)->shape_ndx= (s)-&(g)->shapes[0])
215#define XkbSetKeyColor(g,k,c) ((k)->color_ndx= (c)-&(g)->colors[0])
216
217typedef struct _XkbRow {
218 short top;
219 short left;
220 unsigned short num_keys;
221 unsigned short sz_keys;
222 int vertical;
223 XkbKeyPtr keys;
224 XkbBoundsRec bounds;
225} XkbRowRec, *XkbRowPtr;
226
227typedef struct _XkbSection {
228 Atom name;
229 unsigned char priority;
230 short top;
231 short left;
232 unsigned short width;
233 unsigned short height;
234 short angle;
235 unsigned short num_rows;
236 unsigned short num_doodads;
237 unsigned short num_overlays;
238 unsigned short sz_rows;
239 unsigned short sz_doodads;
240 unsigned short sz_overlays;
241 XkbRowPtr rows;
242 XkbDoodadPtr doodads;
243 XkbBoundsRec bounds;
244 struct _XkbOverlay *overlays;
245} XkbSectionRec, *XkbSectionPtr;
246
247typedef struct _XkbOverlayKey {
248 XkbKeyNameRec over;
249 XkbKeyNameRec under;
250} XkbOverlayKeyRec,*XkbOverlayKeyPtr;
251
252typedef struct _XkbOverlayRow {
253 unsigned short row_under;
254 unsigned short num_keys;
255 unsigned short sz_keys;
256 XkbOverlayKeyPtr keys;
257} XkbOverlayRowRec,*XkbOverlayRowPtr;
258
259typedef struct _XkbOverlay {
260 Atom name;
261 XkbSectionPtr section_under;
262 unsigned short num_rows;
263 unsigned short sz_rows;
264 XkbOverlayRowPtr rows;
265 XkbBoundsPtr bounds;
266} XkbOverlayRec,*XkbOverlayPtr;
267
268typedef struct _XkbGeometry {
269 Atom name;
270 unsigned short width_mm;
271 unsigned short height_mm;
272 char * label_font;
273 XkbColorPtr label_color;
274 XkbColorPtr base_color;
275 unsigned short sz_properties;
276 unsigned short sz_colors;
277 unsigned short sz_shapes;
278 unsigned short sz_sections;
279 unsigned short sz_doodads;
280 unsigned short sz_key_aliases;
281 unsigned short num_properties;
282 unsigned short num_colors;
283 unsigned short num_shapes;
284 unsigned short num_sections;
285 unsigned short num_doodads;
286 unsigned short num_key_aliases;
287 XkbPropertyPtr properties;
288 XkbColorPtr colors;
289 XkbShapePtr shapes;
290 XkbSectionPtr sections;
291 XkbDoodadPtr doodads;
292 XkbKeyAliasPtr key_aliases;
293} XkbGeometryRec;
294#define XkbGeomColorIndex(g,c) ((int)((c)-&(g)->colors[0]))
295
296#define XkbGeomPropertiesMask (1<<0)
297#define XkbGeomColorsMask (1<<1)
298#define XkbGeomShapesMask (1<<2)
299#define XkbGeomSectionsMask (1<<3)
300#define XkbGeomDoodadsMask (1<<4)
301#define XkbGeomKeyAliasesMask (1<<5)
302#define XkbGeomAllMask (0x3f)
303
304typedef struct _XkbGeometrySizes {
305 unsigned int which;
306 unsigned short num_properties;
307 unsigned short num_colors;
308 unsigned short num_shapes;
309 unsigned short num_sections;
310 unsigned short num_doodads;
311 unsigned short num_key_aliases;
312} XkbGeometrySizesRec,*XkbGeometrySizesPtr;
313
314extern XkbPropertyPtr
315XkbAddGeomProperty(
316 XkbGeometryPtr /* geom */,
317 char * /* name */,
318 char * /* value */
319);
320
321extern XkbKeyAliasPtr
322XkbAddGeomKeyAlias(
323 XkbGeometryPtr /* geom */,
324 char * /* alias */,
325 char * /* real */
326);
327
328extern XkbColorPtr
329XkbAddGeomColor(
330 XkbGeometryPtr /* geom */,
331 char * /* spec */,
332 unsigned int /* pixel */
333);
334
335extern XkbOutlinePtr
336XkbAddGeomOutline(
337 XkbShapePtr /* shape */,
338 int /* sz_points */
339);
340
341extern XkbShapePtr
342XkbAddGeomShape(
343 XkbGeometryPtr /* geom */,
344 Atom /* name */,
345 int /* sz_outlines */
346);
347
348extern XkbKeyPtr
349XkbAddGeomKey(
350 XkbRowPtr /* row */
351);
352
353extern XkbRowPtr
354XkbAddGeomRow(
355 XkbSectionPtr /* section */,
356 int /* sz_keys */
357);
358
359extern XkbSectionPtr
360XkbAddGeomSection(
361 XkbGeometryPtr /* geom */,
362 Atom /* name */,
363 int /* sz_rows */,
364 int /* sz_doodads */,
365 int /* sz_overlays */
366);
367
368extern XkbOverlayPtr
369XkbAddGeomOverlay(
370 XkbSectionPtr /* section */,
371 Atom /* name */,
372 int /* sz_rows */
373);
374
375extern XkbOverlayRowPtr
376XkbAddGeomOverlayRow(
377 XkbOverlayPtr /* overlay */,
378 int /* row_under */,
379 int /* sz_keys */
380);
381
382extern XkbOverlayKeyPtr
383XkbAddGeomOverlayKey(
384 XkbOverlayPtr /* overlay */,
385 XkbOverlayRowPtr /* row */,
386 char * /* over */,
387 char * /* under */
388);
389
390extern XkbDoodadPtr
391XkbAddGeomDoodad(
392 XkbGeometryPtr /* geom */,
393 XkbSectionPtr /* section */,
394 Atom /* name */
395);
396
397
398extern void
399XkbFreeGeomKeyAliases(
400 XkbGeometryPtr /* geom */,
401 int /* first */,
402 int /* count */,
403 Bool /* freeAll */
404);
405
406extern void
407XkbFreeGeomColors(
408 XkbGeometryPtr /* geom */,
409 int /* first */,
410 int /* count */,
411 Bool /* freeAll */
412);
413
414extern void
415XkbFreeGeomDoodads(
416 XkbDoodadPtr /* doodads */,
417 int /* nDoodads */,
418 Bool /* freeAll */
419);
420
421
422extern void
423XkbFreeGeomProperties(
424 XkbGeometryPtr /* geom */,
425 int /* first */,
426 int /* count */,
427 Bool /* freeAll */
428);
429
430extern void
431XkbFreeGeomOverlayKeys(
432 XkbOverlayRowPtr /* row */,
433 int /* first */,
434 int /* count */,
435 Bool /* freeAll */
436);
437
438extern void
439XkbFreeGeomOverlayRows(
440 XkbOverlayPtr /* overlay */,
441 int /* first */,
442 int /* count */,
443 Bool /* freeAll */
444);
445
446extern void
447XkbFreeGeomOverlays(
448 XkbSectionPtr /* section */,
449 int /* first */,
450 int /* count */,
451 Bool /* freeAll */
452);
453
454extern void
455XkbFreeGeomKeys(
456 XkbRowPtr /* row */,
457 int /* first */,
458 int /* count */,
459 Bool /* freeAll */
460);
461
462extern void
463XkbFreeGeomRows(
464 XkbSectionPtr /* section */,
465 int /* first */,
466 int /* count */,
467 Bool /* freeAll */
468);
469
470extern void
471XkbFreeGeomSections(
472 XkbGeometryPtr /* geom */,
473 int /* first */,
474 int /* count */,
475 Bool /* freeAll */
476);
477
478
479extern void
480XkbFreeGeomPoints(
481 XkbOutlinePtr /* outline */,
482 int /* first */,
483 int /* count */,
484 Bool /* freeAll */
485);
486
487extern void
488XkbFreeGeomOutlines(
489 XkbShapePtr /* shape */,
490 int /* first */,
491 int /* count */,
492 Bool /* freeAll */
493);
494
495extern void
496XkbFreeGeomShapes(
497 XkbGeometryPtr /* geom */,
498 int /* first */,
499 int /* count */,
500 Bool /* freeAll */
501);
502
503extern void
504XkbFreeGeometry(
505 XkbGeometryPtr /* geom */,
506 unsigned int /* which */,
507 Bool /* freeMap */
508);
509
510extern Status
511XkbAllocGeomProps(
512 XkbGeometryPtr /* geom */,
513 int /* nProps */
514);
515
516extern Status
517XkbAllocGeomKeyAliases(
518 XkbGeometryPtr /* geom */,
519 int /* nAliases */
520);
521
522extern Status
523XkbAllocGeomColors(
524 XkbGeometryPtr /* geom */,
525 int /* nColors */
526);
527
528extern Status
529XkbAllocGeomShapes(
530 XkbGeometryPtr /* geom */,
531 int /* nShapes */
532);
533
534extern Status
535XkbAllocGeomSections(
536 XkbGeometryPtr /* geom */,
537 int /* nSections */
538);
539
540extern Status
541XkbAllocGeomOverlays(
542 XkbSectionPtr /* section */,
543 int /* num_needed */
544);
545
546extern Status
547XkbAllocGeomOverlayRows(
548 XkbOverlayPtr /* overlay */,
549 int /* num_needed */
550);
551
552extern Status
553XkbAllocGeomOverlayKeys(
554 XkbOverlayRowPtr /* row */,
555 int /* num_needed */
556);
557
558extern Status
559XkbAllocGeomDoodads(
560 XkbGeometryPtr /* geom */,
561 int /* nDoodads */
562);
563
564extern Status
565XkbAllocGeomSectionDoodads(
566 XkbSectionPtr /* section */,
567 int /* nDoodads */
568);
569
570extern Status
571XkbAllocGeomOutlines(
572 XkbShapePtr /* shape */,
573 int /* nOL */
574);
575
576extern Status
577XkbAllocGeomRows(
578 XkbSectionPtr /* section */,
579 int /* nRows */
580);
581
582extern Status
583XkbAllocGeomPoints(
584 XkbOutlinePtr /* ol */,
585 int /* nPts */
586);
587
588extern Status
589XkbAllocGeomKeys(
590 XkbRowPtr /* row */,
591 int /* nKeys */
592);
593
594extern Status
595XkbAllocGeometry(
596 XkbDescPtr /* xkb */,
597 XkbGeometrySizesPtr /* sizes */
598);
599
600extern Bool
601XkbComputeShapeTop(
602 XkbShapePtr /* shape */,
603 XkbBoundsPtr /* bounds */
604);
605
606extern Bool
607XkbComputeShapeBounds(
608 XkbShapePtr /* shape */
609);
610
611extern Bool
612XkbComputeRowBounds(
613 XkbGeometryPtr /* geom */,
614 XkbSectionPtr /* section */,
615 XkbRowPtr /* row */
616);
617
618extern Bool
619XkbComputeSectionBounds(
620 XkbGeometryPtr /* geom */,
621 XkbSectionPtr /* section */
622);
623
624extern char *
625XkbFindOverlayForKey(
626 XkbGeometryPtr /* geom */,
627 XkbSectionPtr /* wanted */,
628 char * /* under */
629);
630
631#endif /* _XKBGEOM_H_ */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette