1
/* $Xorg: PEXprotost.h,v 1.4 2001/02/09 02:03:27 xorgcvs Exp $ */
4
Copyright 1992, 1998 The Open Group
6
Permission to use, copy, modify, distribute, and sell this software and its
7
documentation for any purpose is hereby granted without fee, provided that
8
the above copyright notice appear in all copies and that both that
9
copyright notice and this permission notice appear in supporting
12
The above copyright notice and this permission notice shall be included
13
in all copies or substantial portions of the Software.
15
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
19
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21
OTHER DEALINGS IN THE SOFTWARE.
23
Except as contained in this notice, the name of The Open Group shall
24
not be used in advertising or otherwise to promote the sale, use or
25
other dealings in this Software without prior written authorization
31
/******************************************************************************
32
Copyright 1989, 1990, 1991 by Sun Microsystems, Inc.
36
Permission to use, copy, modify, distribute, and sell this software and its
37
documentation for any purpose is hereby granted without fee, provided that
38
the above copyright notice appear in all copies and that both that copyright
39
notice and this permission notice appear in supporting documentation, and that
40
the name of Sun Microsystems not be used in advertising or publicity
41
pertaining to distribution of the software without specific, written prior
42
permission. Sun Microsystems makes no representations about the
43
suitability of this software for any purpose. It is provided "as is" without
44
express or implied warranty.
46
SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
47
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
48
SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
49
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
50
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
51
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
53
******************************************************************************/
55
#ifndef _PEXPROTOST_H_
56
#define _PEXPROTOST_H_
58
/* Matches revision 5.1C */
60
#include <X11/Xmd.h> /* defines things like CARD32 */
63
/* This is FLOAT as defined and used by the Protocol Encoding */
65
typedef float PEXFLOAT;
67
typedef CARD32 PEXFLOAT;
71
typedef CARD32 pexAsfAttribute;
72
typedef CARD8 pexAsfValue;
73
typedef CARD32 pexBitmask;
74
typedef CARD16 pexBitmaskShort;
75
typedef CARD16 pexCoordType; /* rational, nonrational */
76
typedef CARD16 pexComposition;
77
typedef CARD16 pexCullMode;
78
typedef BYTE pexDynamicType;
79
typedef INT16 pexEnumTypeIndex;
80
typedef XID pexLookupTable;
81
typedef CARD32 pexName;
82
typedef XID pexNameSet;
87
typedef PEXFLOAT pexMatrix[4][4];
88
typedef PEXFLOAT pexMatrix3X3[3][3];
90
typedef CARD8 pexMatrix[64];
91
typedef CARD8 pexMatrix3X3[36];
94
typedef XID pexPhigsWks;
95
typedef XID pexPickMeasure;
96
typedef XID pexRenderer;
98
typedef XID pexStructure;
99
typedef CARD8 pexSwitch;
100
typedef CARD16 pexTableIndex;
101
typedef CARD16 pexTableType; /* could be smaller if it ever helps */
102
typedef CARD16 pexTextHAlignment;
103
typedef CARD16 pexTextVAlignment;
104
typedef CARD16 pexTypeOrTableIndex;
105
typedef pexEnumTypeIndex pexColorType; /* ColorType */
107
/* included in others */
110
/* list of CARD8 -- don't swap */
114
pexStructure sid B32;
115
PEXFLOAT priority B32;
129
/* Coord structures */
150
/* Color structures */
159
PEXFLOAT saturation B32;
165
PEXFLOAT lightness B32;
166
PEXFLOAT saturation B32;
190
pexTableIndex index B16;
196
pexIndexedColor indexed;
199
pexRgbFloatColor rgbFloat;
200
pexHsvColor hsvFloat;
201
pexHlsColor hlsFloat;
202
pexCieColor cieFloat;
213
pexColorType colorType B16; /* ColorType enumerated type */
215
/* SINGLE COLOR(colorType) */
220
pexEnumTypeIndex approxMethod B16;
222
PEXFLOAT tolerance B32;
223
} pexCurveApproxData;
244
CARD16 elementType B16;
255
pexElementPos position1; /* pexElementPos is 8 bytes long */
256
pexElementPos position2;
260
pexStructure structure B32;
265
PEXFLOAT lowerLeft_x B32;
266
PEXFLOAT lowerLeft_y B32;
267
PEXFLOAT upperRight_x B32;
268
PEXFLOAT upperRight_y B32;
269
PEXFLOAT concatpoint_x B32;
270
PEXFLOAT concatpoint_y B32;
274
pexEnumTypeIndex index B16;
275
CARD16 descriptor_length B16;
279
PEXFLOAT point_x B32;
280
PEXFLOAT point_y B32;
281
PEXFLOAT point_z B32;
282
PEXFLOAT vector_x B32;
283
PEXFLOAT vector_y B32;
284
PEXFLOAT vector_z B32;
293
PEXFLOAT point_x B32;
294
PEXFLOAT point_y B32;
295
PEXFLOAT vector_x B32;
296
PEXFLOAT vector_y B32;
300
CARD16 composition B16;
303
} pexLocalTransform3DData;
306
CARD16 composition B16;
309
} pexLocalTransform2DData;
320
/* an OPT_DATA structure cannot be defined because it has variable content
321
* and size. An union structure could be used to define a template for
322
* the data. However, since unions pad to a fixed amount of space and the
323
* protocol uses variable lengths, this is not appropriate for protocol
324
* data types. The most correct way of defining this data is to define
325
* one data structure for every possible combination of color, normal and
326
* edge data that could be given with a vertex or facet.
330
pexStructure sid B32;
335
/* pexPickPath is the old name of the above strucutre.
336
This is wrong, since the above is a Pick Element Ref
337
a Pick Path is a list of Pick Element Refs so naming
338
this structure pexPickPath was wrong, but it can't just
339
be changed without effecting lots of other code....... */
341
typedef pexPickElementRef pexPickPath;
344
pexTextVAlignment vertical B16;
345
pexTextHAlignment horizontal B16;
346
} pexTextAlignmentData;
349
pexSwitch visibility;
352
pexCoordType type B16;
353
INT16 approxMethod B16;
354
PEXFLOAT tolerance B32;
359
/* LISTof FLOAT(numKnots) -- length = order + number of coords */
360
/* LISTof {pexCoord3D|pexCoord4D}(numCoord) */
371
pexEnumTypeIndex pickType B16;
373
/* SINGLE HITBOX() */
377
PEXFLOAT ambient B32;
378
PEXFLOAT diffuse B32;
379
PEXFLOAT specular B32;
380
PEXFLOAT specularConc B32;
381
PEXFLOAT transmission B32; /* 0.0 = opaque, 1.0 = transparent */
382
pexColorType specular_colorType B16;
388
pexEnumTypeIndex approxMethod B16;
390
PEXFLOAT uTolerance B32;
391
PEXFLOAT vTolerance B32;
392
} pexSurfaceApproxData;
396
PEXFLOAT point_x B32;
397
PEXFLOAT point_y B32;
398
PEXFLOAT point_z B32;
399
/* SINGLE OPT_DATA() */
410
pexSwitch useDrawable;
415
CARD16 clipFlags B16;
417
PEXFLOAT clipLimits_xmin B32;
418
PEXFLOAT clipLimits_ymin B32;
419
PEXFLOAT clipLimits_zmin B32;
420
PEXFLOAT clipLimits_xmax B32;
421
PEXFLOAT clipLimits_ymax B32;
422
PEXFLOAT clipLimits_zmax B32;
423
pexMatrix orientation;
428
pexTableIndex index B16;
430
CARD16 clipFlags B16;
432
PEXFLOAT clipLimits_xmin B32;
433
PEXFLOAT clipLimits_ymin B32;
434
PEXFLOAT clipLimits_zmin B32;
435
PEXFLOAT clipLimits_xmax B32;
436
PEXFLOAT clipLimits_ymax B32;
437
PEXFLOAT clipLimits_zmax B32;
438
pexMatrix orientation;
443
* typedefs for lookup tables
447
CARD16 definableEntries B16;
448
CARD16 numPredefined B16;
449
CARD16 predefinedMin B16;
450
CARD16 predefinedMax B16;
454
pexEnumTypeIndex lineType B16;
455
pexEnumTypeIndex polylineInterp B16;
456
pexEnumTypeIndex curveApprox_method B16;
458
PEXFLOAT curveApprox_tolerance B32;
459
PEXFLOAT lineWidth B32;
460
pexColorType lineColorType B16;
462
/* SINGLE COLOR(lineColorType) */
463
} pexLineBundleEntry;
466
pexEnumTypeIndex markerType B16;
468
PEXFLOAT markerScale B32;
469
pexColorType markerColorType B16;
471
/* SINGLE COLOR(markerColorType) */
472
} pexMarkerBundleEntry;
475
CARD16 textFontIndex B16;
476
CARD16 textPrecision B16;
477
PEXFLOAT charExpansion B32;
478
PEXFLOAT charSpacing B32;
479
pexColorType textColorType B16;
481
/* SINGLE COLOR(textColorType) */
482
} pexTextBundleEntry;
486
Note that since an InteriorBundleEntry contains 4 embedded instances of
487
pexColorSpecifier, a variable-sized item, a data structure cannot be
491
pexEnumTypeIndex interiorStyle B16;
492
INT16 interiorStyleIndex B16;
493
pexEnumTypeIndex reflectionModel B16;
494
pexEnumTypeIndex surfaceInterp B16;
495
pexEnumTypeIndex bfInteriorStyle B16;
496
INT16 bfInteriorStyleIndex B16;
497
pexEnumTypeIndex bfReflectionModel B16;
498
pexEnumTypeIndex bfSurfaceInterp B16;
499
pexEnumTypeIndex surfaceApprox_method B16;
501
PEXFLOAT surfaceApproxuTolerance B32;
502
PEXFLOAT surfaceApproxvTolerance B32;
503
/* SINGLE pexColorSpecifier surfaceColor */
504
/* SINGLE pexReflectionAttr reflectionAttr */
505
/* SINGLE pexColorSpecifier bfSurfaceColor */
506
/* SINGLE pexReflectionAttr bfReflectionAttr */
507
} pexInteriorBundleEntry;
512
pexEnumTypeIndex edgeType B16;
513
PEXFLOAT edgeWidth B32;
514
pexColorType edgeColorType B16;
516
/* SINGLE COLOR(edgeColorType) */
517
} pexEdgeBundleEntry;
520
pexColorType colorType B16;
524
/* LISTof Color(numx, numy) 2D array of colors */
527
/* a pexColorEntry is just a pexColorSpecifier
532
/* LISTof pexFont( numFonts ) */
535
/* a pexViewEntry is defined above */
538
pexEnumTypeIndex lightType B16;
540
PEXFLOAT direction_x B32;
541
PEXFLOAT direction_y B32;
542
PEXFLOAT direction_z B32;
543
PEXFLOAT point_x B32;
544
PEXFLOAT point_y B32;
545
PEXFLOAT point_z B32;
546
PEXFLOAT concentration B32;
547
PEXFLOAT spreadAngle B32;
548
PEXFLOAT attenuation1 B32;
549
PEXFLOAT attenuation2 B32;
550
pexColorType lightColorType B16;
552
/* SINGLE COLOR(lightColorType) */
559
PEXFLOAT frontPlane B32;
560
PEXFLOAT backPlane B32;
561
PEXFLOAT frontScaling B32;
562
PEXFLOAT backScaling B32;
563
pexColorType depthCueColorType B16;
565
/* SINGLE COLOR(depthCueColorType) */
569
INT16 approxType B16;
570
INT16 approxModel B16;
579
PEXFLOAT weight1 B32;
580
PEXFLOAT weight2 B32;
581
PEXFLOAT weight3 B32;
582
CARD32 basePixel B32;
583
} pexColorApproxEntry;
586
/* Font structures */
594
CARD32 firstGlyph B32;
595
CARD32 lastGlyph B32;
596
CARD32 defaultGlyph B32;
598
pexSwitch strokeFont;
601
/* LISTof pexFontProp(numProps) */
605
/* Text Structures */
608
INT16 characterSet B16;
609
CARD8 characterSetWidth;
613
/* LISTof CHARACTER( numChars ) */
617
/* CHARACTER is either a CARD8, a CARD16, or a CARD32 */
620
/* Parametric Surface Characteristics types */
624
/* type 2 Implementation Dependent */
627
CARD16 placementType B16;
629
CARD16 numUcurves B16;
630
CARD16 numVcurves B16;
631
} pexPSC_IsoparametricCurves; /* type 3 */
634
PEXFLOAT origin_x B32;
635
PEXFLOAT origin_y B32;
636
PEXFLOAT origin_z B32;
637
PEXFLOAT direction_x B32;
638
PEXFLOAT direction_y B32;
639
PEXFLOAT direction_z B32;
640
CARD16 numberIntersections B16;
642
/* LISTof pexCoord3D( numIntersections ) */
643
} pexPSC_LevelCurves; /* type 4: MC
646
/* Pick Device data records */
649
INT16 position_x B16;
650
INT16 position_y B16;
651
PEXFLOAT distance B32;
652
} pexPD_DC_HitBox; /* pick device 1 */
654
typedef pexNpcSubvolume pexPD_NPC_HitVolume; /* pick device 2 */
657
/* Output Command errors */
661
CARD8 errorCode; /* 14 */
662
CARD16 sequenceNumber B16;
663
CARD32 resourceId B32; /* renderer or structure */
664
CARD16 minorCode B16;
667
CARD16 opcode B16; /* opcode of failed output command */
668
CARD16 numCommands B16; /* number successfully done before error */
670
} pexOutputCommandError;
673
/* Registered PEX Escapes */
678
CARD32 rdr B32; /* renderer ID */
679
/* SINGLE ColorSpecifier() */
680
} pexEscapeSetEchoColorData;
682
#endif /* _PEXPROTOST_H_ */