1 /* $Xorg: lbxstr.h,v 1.4 2001/02/13 20:14:04 pookie Exp $ */ 2 /* 3 * Copyright 1992 Network Computing Devices 4 * 5 * Permission to use, copy, modify, distribute, and sell this software and its 6 * documentation for any purpose is hereby granted without fee, provided that 7 * the above copyright notice appear in all copies and that both that 8 * copyright notice and this permission notice appear in supporting 9 * documentation, and that the name of NCD. not be used in advertising or 10 * publicity pertaining to distribution of the software without specific, 11 * written prior permission. NCD. makes no representations about the 12 * suitability of this software for any purpose. It is provided "as is" 13 * without express or implied warranty. 14 * 15 * NCD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD. 17 * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 18 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 19 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 20 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 21 * 22 */ 23 /* $XFree86: xc/include/extensions/lbxstr.h,v 1.2 2001/08/01 00:44:35 tsi Exp $ */ 24 25 #ifndef _LBXSTR_H_ 26 #define _LBXSTR_H_ 27 28 #include <X11/extensions/XLbx.h> 29 30 #define LBXNAME "LBX" 31 32 #define LBX_MAJOR_VERSION 1 33 #define LBX_MINOR_VERSION 0 34 35 /* 36 * Redefine some basic types used by structures defined herein. This removes 37 * any possibility on 64-bit architectures of one entity viewing communicated 38 * data as 32-bit quantities and another entity viewing the same data as 64-bit 39 * quantities. 40 */ 41 #define XID CARD32 42 #define Atom CARD32 43 #define Colormap CARD32 44 #define Drawable CARD32 45 #define VisualID CARD32 46 #define Window CARD32 47 48 typedef struct { 49 BOOL success; /* TRUE */ 50 BOOL changeType; 51 CARD16 majorVersion B16, 52 minorVersion B16; 53 CARD16 length B16; /* 1/4 additional bytes in setup info */ 54 CARD32 tag B32; 55 } xLbxConnSetupPrefix; 56 57 typedef struct _LbxQueryVersion { 58 CARD8 reqType; /* always LbxReqCode */ 59 CARD8 lbxReqType; /* always X_LbxQueryVersion */ 60 CARD16 length B16; 61 } xLbxQueryVersionReq; 62 #define sz_xLbxQueryVersionReq 4 63 64 typedef struct { 65 BYTE type; /* X_Reply */ 66 CARD8 unused; 67 CARD16 sequenceNumber B16; 68 CARD32 length B32; 69 CARD16 majorVersion B16; /* major version of LBX protocol */ 70 CARD16 minorVersion B16; /* minor version of LBX protocol */ 71 CARD32 pad0 B32; 72 CARD32 pad1 B32; 73 CARD32 pad2 B32; 74 CARD32 pad3 B32; 75 CARD32 pad4 B32; 76 } xLbxQueryVersionReply; 77 #define sz_xLbxQueryVersionReply 32 78 79 typedef struct _LbxStartProxy { 80 CARD8 reqType; /* always LbxReqCode */ 81 CARD8 lbxReqType; /* always X_LbxStartProxy */ 82 CARD16 length B16; 83 } xLbxStartProxyReq; 84 #define sz_xLbxStartProxyReq 4 85 86 typedef struct _LbxStopProxy { 87 CARD8 reqType; /* always LbxReqCode */ 88 CARD8 lbxReqType; /* always X_LbxStopProxy */ 89 CARD16 length B16; 90 } xLbxStopProxyReq; 91 #define sz_xLbxStopProxyReq 4 92 93 typedef struct _LbxSwitch { 94 CARD8 reqType; /* always LbxReqCode */ 95 CARD8 lbxReqType; /* always X_LbxSwitch */ 96 CARD16 length B16; 97 CARD32 client B32; /* new client */ 98 } xLbxSwitchReq; 99 #define sz_xLbxSwitchReq 8 100 101 typedef struct _LbxNewClient { 102 CARD8 reqType; /* always LbxReqCode */ 103 CARD8 lbxReqType; /* always X_LbxNewClient */ 104 CARD16 length B16; 105 CARD32 client B32; /* new client */ 106 } xLbxNewClientReq; 107 #define sz_xLbxNewClientReq 8 108 109 typedef struct _LbxCloseClient { 110 CARD8 reqType; /* always LbxReqCode */ 111 CARD8 lbxReqType; /* always X_LbxCloseClient */ 112 CARD16 length B16; 113 CARD32 client B32; /* new client */ 114 } xLbxCloseClientReq; 115 #define sz_xLbxCloseClientReq 8 116 117 typedef struct _LbxModifySequence { 118 CARD8 reqType; /* always LbxReqCode */ 119 CARD8 lbxReqType; /* always X_LbxModifySequence */ 120 CARD16 length B16; 121 CARD32 adjust B32; 122 } xLbxModifySequenceReq; 123 #define sz_xLbxModifySequenceReq 8 124 125 typedef struct _LbxAllowMotion { 126 CARD8 reqType; /* always LbxReqCode */ 127 CARD8 lbxReqType; /* always X_LbxAllowMotion */ 128 CARD16 length B16; 129 CARD32 num B32; 130 } xLbxAllowMotionReq; 131 #define sz_xLbxAllowMotionReq 8 132 133 typedef struct { 134 CARD8 reqType; /* always LbxReqCode */ 135 CARD8 lbxReqType; /* always X_LbxGrabCmap */ 136 CARD16 length B16; 137 Colormap cmap B32; 138 } xLbxGrabCmapReq; 139 #define sz_xLbxGrabCmapReq 8 140 141 #define LBX_SMART_GRAB 0x80 142 #define LBX_AUTO_RELEASE 0x40 143 #define LBX_3CHANNELS 0x20 144 #define LBX_2BYTE_PIXELS 0x10 145 #define LBX_RGB_BITS_MASK 0x0f 146 147 #define LBX_LIST_END 0 148 #define LBX_PIXEL_PRIVATE 1 149 #define LBX_PIXEL_SHARED 2 150 #define LBX_PIXEL_RANGE_PRIVATE 3 151 #define LBX_PIXEL_RANGE_SHARED 4 152 #define LBX_NEXT_CHANNEL 5 153 154 typedef struct { 155 BYTE type; /* X_Reply */ 156 CARD8 flags; 157 CARD16 sequenceNumber B16; 158 CARD32 length B32; 159 CARD32 pad0 B16; 160 CARD32 pad1 B32; 161 CARD32 pad2 B32; 162 CARD32 pad3 B32; 163 CARD32 pad4 B32; 164 CARD32 pad5 B16; 165 } xLbxGrabCmapReply; 166 #define sz_xLbxGrabCmapReply 32 167 #define sz_xLbxGrabCmapReplyHdr 8 168 169 170 typedef struct { 171 CARD8 reqType; /* always LbxReqCode */ 172 CARD8 lbxReqType; /* always X_LbxReleaseCmap */ 173 CARD16 length B16; 174 Colormap cmap B32; 175 } xLbxReleaseCmapReq; 176 #define sz_xLbxReleaseCmapReq 8 177 178 typedef struct { 179 CARD8 reqType; /* always LbxReqCode */ 180 CARD8 lbxReqType; /* always X_LbxAllocColor */ 181 CARD16 length B16; 182 Colormap cmap B32; 183 CARD32 pixel B32; 184 CARD16 red B16, green B16, blue B16; 185 CARD16 pad B16; 186 } xLbxAllocColorReq; 187 #define sz_xLbxAllocColorReq 20 188 189 typedef struct _LbxIncrementPixel { 190 CARD8 reqType; /* always LbxReqCode */ 191 CARD8 lbxReqType; /* always X_LbxIncrementPixel */ 192 CARD16 length B16; 193 CARD32 cmap B32; 194 CARD32 pixel B32; 195 } xLbxIncrementPixelReq; 196 #define sz_xLbxIncrementPixelReq 12 197 198 typedef struct _LbxDelta { 199 CARD8 reqType; /* always LbxReqCode */ 200 CARD8 lbxReqType; /* always X_LbxDelta */ 201 CARD16 length B16; 202 CARD8 diffs; /* number of diffs */ 203 CARD8 cindex; /* cache index */ 204 /* list of diffs follows */ 205 } xLbxDeltaReq; 206 #define sz_xLbxDeltaReq 6 207 208 typedef struct _LbxGetModifierMapping { 209 CARD8 reqType; /* always LbxReqCode */ 210 CARD8 lbxReqType; /* always X_LbxGetModifierMapping */ 211 CARD16 length B16; 212 } xLbxGetModifierMappingReq; 213 #define sz_xLbxGetModifierMappingReq 4 214 215 typedef struct { 216 BYTE type; /* X_Reply */ 217 CARD8 keyspermod; 218 CARD16 sequenceNumber B16; 219 CARD32 length B32; 220 CARD32 tag B32; 221 CARD32 pad0 B32; 222 CARD32 pad1 B32; 223 CARD32 pad2 B32; 224 CARD32 pad3 B32; 225 CARD32 pad4 B32; 226 } xLbxGetModifierMappingReply; 227 #define sz_xLbxGetModifierMappingReply 32 228 229 typedef struct _LbxGetKeyboardMapping { 230 CARD8 reqType; /* always LbxReqCode */ 231 CARD8 lbxReqType; /* always X_LbxGetKeyboardMapping */ 232 CARD16 length B16; 233 KeyCode firstKeyCode; 234 CARD8 count; 235 CARD16 pad1 B16; 236 } xLbxGetKeyboardMappingReq; 237 #define sz_xLbxGetKeyboardMappingReq 8 238 239 typedef struct { 240 BYTE type; /* X_Reply */ 241 CARD8 keysperkeycode; 242 CARD16 sequenceNumber B16; 243 CARD32 length B32; 244 CARD32 tag B32; 245 CARD32 pad0 B32; 246 CARD32 pad1 B32; 247 CARD32 pad2 B32; 248 CARD32 pad3 B32; 249 CARD32 pad4 B32; 250 } xLbxGetKeyboardMappingReply; 251 #define sz_xLbxGetKeyboardMappingReply 32 252 253 typedef struct _LbxQueryFont { 254 CARD8 reqType; /* always LbxReqCode */ 255 CARD8 lbxReqType; /* always X_LbxQueryFont */ 256 CARD16 length B16; 257 CARD32 fid B32; 258 } xLbxQueryFontReq; 259 #define sz_xLbxQueryFontReq 8 260 261 typedef struct _LbxInternAtoms { 262 CARD8 reqType; /* always LbxReqCode */ 263 CARD8 lbxReqType; /* always X_LbxInternAtoms */ 264 CARD16 length B16; 265 CARD16 num B16; 266 } xLbxInternAtomsReq; 267 #define sz_xLbxInternAtomsReq 6 268 269 typedef struct { 270 BYTE type; /* X_Reply */ 271 CARD8 unused; 272 CARD16 sequenceNumber B16; 273 CARD32 length B32; 274 CARD32 atomsStart B32; 275 CARD32 pad0 B32; 276 CARD32 pad1 B32; 277 CARD32 pad2 B32; 278 CARD32 pad3 B32; 279 CARD32 pad4 B32; 280 } xLbxInternAtomsReply; 281 #define sz_xLbxInternAtomsReply 32 282 #define sz_xLbxInternAtomsReplyHdr 8 283 284 285 typedef struct _LbxGetWinAttrAndGeom { 286 CARD8 reqType; /* always LbxReqCode */ 287 CARD8 lbxReqType; /* always X_LbxGetWinAttrAndGeom */ 288 CARD16 length B16; 289 CARD32 id B32; /* window id */ 290 } xLbxGetWinAttrAndGeomReq; 291 #define sz_xLbxGetWinAttrAndGeomReq 8 292 293 typedef struct { 294 BYTE type; /* X_Reply */ 295 CARD8 backingStore; 296 CARD16 sequenceNumber B16; 297 CARD32 length B32; /* NOT 0; this is an extra-large reply */ 298 VisualID visualID B32; 299 #if defined(__cplusplus) || defined(c_plusplus) 300 CARD16 c_class B16; 301 #else 302 CARD16 class B16; 303 #endif 304 CARD8 bitGravity; 305 CARD8 winGravity; 306 CARD32 backingBitPlanes B32; 307 CARD32 backingPixel B32; 308 BOOL saveUnder; 309 BOOL mapInstalled; 310 CARD8 mapState; 311 BOOL override; 312 Colormap colormap B32; 313 CARD32 allEventMasks B32; 314 CARD32 yourEventMask B32; 315 CARD16 doNotPropagateMask B16; 316 CARD16 pad1 B16; 317 Window root B32; 318 INT16 x B16, y B16; 319 CARD16 width B16, height B16; 320 CARD16 borderWidth B16; 321 CARD8 depth; 322 CARD8 pad2; 323 } xLbxGetWinAttrAndGeomReply; 324 #define sz_xLbxGetWinAttrAndGeomReply 60 325 326 327 typedef struct { 328 CARD8 reqType; /* always LbxReqCode */ 329 CARD8 lbxReqType; /* always X_LbxSync */ 330 CARD16 length B16; 331 } xLbxSyncReq; 332 #define sz_xLbxSyncReq 4 333 334 typedef struct { 335 BYTE type; /* X_Reply */ 336 CARD8 pad0; 337 CARD16 sequenceNumber B16; 338 CARD32 length B32; 339 CARD32 pad1 B32; 340 CARD32 pad2 B32; 341 CARD32 pad3 B32; 342 CARD32 pad4 B32; 343 CARD32 pad5 B32; 344 CARD32 pad6 B32; 345 } xLbxSyncReply; 346 #define sz_xLbxSyncReply 32 347 348 349 /* an LBX squished charinfo packs the data in a CARD32 as follows */ 350 #define LBX_WIDTH_SHIFT 26 351 #define LBX_LEFT_SHIFT 20 352 #define LBX_RIGHT_SHIFT 13 353 #define LBX_ASCENT_SHIFT 7 354 #define LBX_DESCENT_SHIFT 0 355 356 #define LBX_WIDTH_BITS 6 357 #define LBX_LEFT_BITS 6 358 #define LBX_RIGHT_BITS 7 359 #define LBX_ASCENT_BITS 6 360 #define LBX_DESCENT_BITS 7 361 362 #define LBX_WIDTH_MASK 0xfc000000 363 #define LBX_LEFT_MASK 0x03f00000 364 #define LBX_RIGHT_MASK 0x000fe000 365 #define LBX_ASCENT_MASK 0x00001f80 366 #define LBX_DESCENT_MASK 0x0000007f 367 368 #define LBX_MASK_BITS(val, n) ((unsigned int) ((val) & ((1 << (n)) - 1))) 369 370 typedef struct { 371 CARD32 metrics B32; 372 } xLbxCharInfo; 373 374 /* note that this is identical to xQueryFontReply except for missing 375 * first 2 words 376 */ 377 typedef struct { 378 xCharInfo minBounds; 379 /* XXX do we need to leave this gunk? */ 380 #ifndef WORD64 381 CARD32 walign1 B32; 382 #endif 383 xCharInfo maxBounds; 384 #ifndef WORD64 385 CARD32 walign2 B32; 386 #endif 387 CARD16 minCharOrByte2 B16, maxCharOrByte2 B16; 388 CARD16 defaultChar B16; 389 CARD16 nFontProps B16; /* followed by this many xFontProp structures */ 390 CARD8 drawDirection; 391 CARD8 minByte1, maxByte1; 392 BOOL allCharsExist; 393 INT16 fontAscent B16, fontDescent B16; 394 CARD32 nCharInfos B32; /* followed by this many xLbxCharInfo structures */ 395 } xLbxFontInfo; 396 397 typedef struct { 398 BYTE type; /* X_Reply */ 399 CARD8 compression; 400 CARD16 sequenceNumber B16; 401 CARD32 length B32; 402 CARD32 tag B32; 403 CARD32 pad0 B32; 404 CARD32 pad1 B32; 405 CARD32 pad2 B32; 406 CARD32 pad3 B32; 407 CARD32 pad4 B32; 408 /* X_QueryFont sticks much of the data in the base reply packet, 409 * but we hope that it won't be needed, (and it won't fit in 32 bytes 410 * with the tag anyways) 411 * 412 * if any additional data is needed, its sent in a xLbxFontInfo 413 */ 414 } xLbxQueryFontReply; 415 #define sz_xLbxQueryFontReply 32 416 417 typedef struct _LbxChangeProperty { 418 CARD8 reqType; /* always LbxReqCode */ 419 CARD8 lbxReqType; /* always X_LbxChangeProperty */ 420 CARD16 length B16; 421 Window window B32; 422 Atom property B32; 423 Atom type B32; 424 CARD8 format; 425 CARD8 mode; 426 BYTE pad[2]; 427 CARD32 nUnits B32; 428 } xLbxChangePropertyReq; 429 #define sz_xLbxChangePropertyReq 24 430 431 typedef struct { 432 BYTE type; /* X_Reply */ 433 CARD8 pad; 434 CARD16 sequenceNumber B16; 435 CARD32 length B32; 436 CARD32 tag B32; 437 CARD32 pad0 B32; 438 CARD32 pad1 B32; 439 CARD32 pad2 B32; 440 CARD32 pad3 B32; 441 CARD32 pad4 B32; 442 } xLbxChangePropertyReply; 443 #define sz_xLbxChangePropertyReply 32 444 445 typedef struct _LbxGetProperty { 446 CARD8 reqType; /* always LbxReqCode */ 447 CARD8 lbxReqType; /* always X_LbxGetProperty */ 448 CARD16 length B16; 449 Window window B32; 450 Atom property B32; 451 Atom type B32; 452 CARD8 delete; 453 BYTE pad[3]; 454 CARD32 longOffset B32; 455 CARD32 longLength B32; 456 } xLbxGetPropertyReq; 457 #define sz_xLbxGetPropertyReq 28 458 459 typedef struct { 460 BYTE type; /* X_Reply */ 461 CARD8 format; 462 CARD16 sequenceNumber B16; 463 CARD32 length B32; 464 Atom propertyType B32; 465 CARD32 bytesAfter B32; 466 CARD32 nItems B32; 467 CARD32 tag B32; 468 CARD32 pad1 B32; 469 CARD32 pad2 B32; 470 } xLbxGetPropertyReply; 471 #define sz_xLbxGetPropertyReply 32 472 473 typedef struct _LbxTagData { 474 CARD8 reqType; /* always LbxReqCode */ 475 CARD8 lbxReqType; /* always X_LbxTagData */ 476 CARD16 length B16; 477 XID tag B32; 478 CARD32 real_length B32; 479 /* data */ 480 } xLbxTagDataReq; 481 #define sz_xLbxTagDataReq 12 482 483 typedef struct _LbxInvalidateTag { 484 CARD8 reqType; /* always LbxReqCode */ 485 CARD8 lbxReqType; /* always X_LbxInvalidateTag */ 486 CARD16 length B16; 487 CARD32 tag B32; 488 } xLbxInvalidateTagReq; 489 #define sz_xLbxInvalidateTagReq 8 490 491 typedef struct _LbxPutImage { 492 CARD8 reqType; /* always LbxReqCode */ 493 CARD8 lbxReqType; /* always X_LbxPutImage */ 494 CARD16 length B16; 495 CARD8 compressionMethod; 496 CARD8 cacheEnts; 497 CARD8 bitPacked; 498 /* rest is variable */ 499 } xLbxPutImageReq; 500 #define sz_xLbxPutImageReq 7 501 502 typedef struct { 503 CARD8 reqType; /* always LbxReqCode */ 504 CARD8 lbxReqType; /* always X_LbxGetImage */ 505 CARD16 length B16; 506 Drawable drawable B32; 507 INT16 x B16, y B16; 508 CARD16 width B16, height B16; 509 CARD32 planeMask B32; 510 CARD8 format; 511 CARD8 pad1; 512 CARD16 pad2 B16; 513 } xLbxGetImageReq; 514 515 #define sz_xLbxGetImageReq 24 516 517 typedef struct { 518 BYTE type; /* X_Reply */ 519 CARD8 depth; 520 CARD16 sequenceNumber B16; 521 CARD32 lbxLength B32; 522 CARD32 xLength B32; 523 VisualID visual B32; 524 CARD8 compressionMethod; 525 CARD8 pad1; 526 CARD16 pad2 B16; 527 CARD32 pad3 B32; 528 CARD32 pad4 B32; 529 CARD32 pad5 B32; 530 } xLbxGetImageReply; 531 532 #define sz_xLbxGetImageReply 32 533 534 /* Following used for LbxPolyPoint, LbxPolyLine, LbxPolySegment, 535 LbxPolyRectangle, LbxPolyArc, LbxPolyFillRectangle and LbxPolyFillArc */ 536 537 #define GFX_CACHE_SIZE 15 538 539 #define GFXdCacheEnt(e) ((e) & 0xf) 540 #define GFXgCacheEnt(e) (((e) >> 4) & 0xf) 541 #define GFXCacheEnts(d,g) (((d) & 0xf) | (((g) & 0xf) << 4)) 542 543 #define GFXCacheNone 0xf 544 545 typedef struct _LbxPolyPoint { 546 CARD8 reqType; /* always LbxReqCode */ 547 CARD8 lbxReqType; 548 CARD16 length B16; 549 CARD8 cacheEnts; 550 CARD8 padBytes; 551 } xLbxPolyPointReq; 552 553 #define sz_xLbxPolyPointReq 6 554 555 typedef xLbxPolyPointReq xLbxPolyLineReq; 556 typedef xLbxPolyPointReq xLbxPolySegmentReq; 557 typedef xLbxPolyPointReq xLbxPolyRectangleReq; 558 typedef xLbxPolyPointReq xLbxPolyArcReq; 559 typedef xLbxPolyPointReq xLbxPolyFillRectangleReq; 560 typedef xLbxPolyPointReq xLbxPolyFillArcReq; 561 562 #define sz_xLbxPolyLineReq sz_xLbxPolyPointReq 563 #define sz_xLbxPolySegmentReq sz_xLbxPolyPointReq 564 #define sz_xLbxPolyRectangleReq sz_xLbxPolyPointReq 565 #define sz_xLbxPolyArcReq sz_xLbxPolyPointReq 566 #define sz_xLbxPolyFillRectangleReq sz_xLbxPolyPointReq 567 #define sz_xLbxPolyFillArc sz_xLbxPolyPointReq 568 569 typedef struct _LbxFillPoly { 570 CARD8 reqType; /* always LbxReqCode */ 571 CARD8 lbxReqType; 572 CARD16 length B16; 573 CARD8 cacheEnts; 574 BYTE shape; 575 CARD8 padBytes; 576 } xLbxFillPolyReq; 577 #define sz_xLbxFillPolyReq 7 578 579 typedef struct _LbxCopyArea { 580 CARD8 reqType; /* always LbxReqCode */ 581 CARD8 lbxReqType; 582 CARD16 length B16; 583 CARD8 srcCache; /* source drawable */ 584 CARD8 cacheEnts; /* dest drawable and gc */ 585 /* followed by encoded src x, src y, dst x, dst y, width, height */ 586 } xLbxCopyAreaReq; 587 588 #define sz_xLbxCopyAreaReq 6 589 590 typedef struct _LbxCopyPlane { 591 CARD8 reqType; /* always LbxReqCode */ 592 CARD8 lbxReqType; 593 CARD16 length B16; 594 CARD32 bitPlane B32; 595 CARD8 srcCache; /* source drawable */ 596 CARD8 cacheEnts; /* dest drawable and gc */ 597 /* followed by encoded src x, src y, dst x, dst y, width, height */ 598 } xLbxCopyPlaneReq; 599 600 #define sz_xLbxCopyPlaneReq 10 601 602 typedef struct _LbxPolyText { 603 CARD8 reqType; /* always LbxReqCode */ 604 CARD8 lbxReqType; 605 CARD16 length B16; 606 CARD8 cacheEnts; 607 /* followed by encoded src x, src y coordinates and text elts */ 608 } xLbxPolyTextReq; 609 610 #define sz_xLbxPolyTextReq 5 611 612 typedef xLbxPolyTextReq xLbxPolyText8Req; 613 typedef xLbxPolyTextReq xLbxPolyText16Req; 614 615 #define sz_xLbxPolyTextReq 5 616 #define sz_xLbxPolyText8Req 5 617 #define sz_xLbxPolyText16Req 5 618 619 typedef struct _LbxImageText { 620 CARD8 reqType; /* always LbxReqCode */ 621 CARD8 lbxReqType; 622 CARD16 length B16; 623 CARD8 cacheEnts; 624 CARD8 nChars; 625 /* followed by encoded src x, src y coordinates and string */ 626 } xLbxImageTextReq; 627 628 typedef xLbxImageTextReq xLbxImageText8Req; 629 typedef xLbxImageTextReq xLbxImageText16Req; 630 631 #define sz_xLbxImageTextReq 6 632 #define sz_xLbxImageText8Req 6 633 #define sz_xLbxImageText16Req 6 634 635 typedef struct { 636 CARD8 offset; 637 CARD8 diff; 638 } xLbxDiffItem; 639 #define sz_xLbxDiffItem 2 640 641 typedef struct { 642 BYTE type; /* X_Reply */ 643 CARD8 nOpts; 644 CARD16 sequenceNumber B16; 645 CARD32 length B32; 646 CARD32 optDataStart B32; 647 CARD32 pad0 B32; 648 CARD32 pad1 B32; 649 CARD32 pad2 B32; 650 CARD32 pad3 B32; 651 CARD32 pad4 B32; 652 } xLbxStartReply; 653 #define sz_xLbxStartReply 32 654 #define sz_xLbxStartReplyHdr 8 655 656 typedef struct _LbxQueryExtension { 657 CARD8 reqType; /* always LbxReqCode */ 658 CARD8 lbxReqType; /* always X_LbxQueryExtension */ 659 CARD16 length B16; 660 CARD32 nbytes B32; 661 } xLbxQueryExtensionReq; 662 #define sz_xLbxQueryExtensionReq 8 663 664 typedef struct _LbxQueryExtensionReply { 665 BYTE type; /* X_Reply */ 666 CARD8 numReqs; 667 CARD16 sequenceNumber B16; 668 CARD32 length B32; 669 BOOL present; 670 CARD8 major_opcode; 671 CARD8 first_event; 672 CARD8 first_error; 673 CARD32 pad0 B32; 674 CARD32 pad1 B32; 675 CARD32 pad2 B32; 676 CARD32 pad3 B32; 677 CARD32 pad4 B32; 678 679 /* reply & event generating requests */ 680 } xLbxQueryExtensionReply; 681 #define sz_xLbxQueryExtensionReply 32 682 683 684 typedef struct _LbxBeginLargeRequest { 685 CARD8 reqType; /* always LbxReqCode */ 686 CARD8 lbxReqType; /* always X_LbxBeginLargeRequest */ 687 CARD16 length B16; 688 CARD32 largeReqLength B32; 689 } xLbxBeginLargeRequestReq; 690 #define sz_BeginLargeRequestReq 8 691 692 typedef struct _LbxLargeRequestData { 693 CARD8 reqType; /* always LbxReqCode */ 694 CARD8 lbxReqType; /* always X_LbxLargeRequestData */ 695 CARD16 length B16; 696 /* followed by LISTofCARD8 data */ 697 } xLbxLargeRequestDataReq; 698 #define sz_LargeRequestDataReq 4 699 700 typedef struct _LbxEndLargeRequest { 701 CARD8 reqType; /* always LbxReqCode */ 702 CARD8 lbxReqType; /* always X_LbxEndLargeRequest */ 703 CARD16 length B16; 704 } xLbxEndLargeRequestReq; 705 #define sz_EndLargeRequestReq 4 706 707 708 709 typedef struct _LbxSwitchEvent { 710 BYTE type; /* always eventBase + LbxEvent */ 711 BYTE lbxType; /* LbxSwitchEvent */ 712 CARD16 pad B16; 713 CARD32 client B32; 714 } xLbxSwitchEvent; 715 #define sz_xLbxSwitchEvent 8 716 717 typedef struct _LbxCloseEvent { 718 BYTE type; /* always eventBase + LbxEvent */ 719 BYTE lbxType; /* LbxCloseEvent */ 720 CARD16 sequenceNumber B16; 721 CARD32 client B32; 722 CARD32 pad1 B32; 723 CARD32 pad2 B32; 724 CARD32 pad3 B32; 725 CARD32 pad4 B32; 726 CARD32 pad5 B32; 727 CARD32 pad6 B32; 728 } xLbxCloseEvent; 729 #define sz_xLbxCloseEvent 32 730 731 typedef struct _LbxInvalidateTagEvent { 732 BYTE type; /* always eventBase + LbxEvent */ 733 BYTE lbxType; /* LbxInvalidateTagEvent */ 734 CARD16 sequenceNumber B16; 735 CARD32 tag B32; 736 CARD32 tagType B32; 737 CARD32 pad1 B32; 738 CARD32 pad2 B32; 739 CARD32 pad3 B32; 740 CARD32 pad4 B32; 741 CARD32 pad5 B32; 742 } xLbxInvalidateTagEvent; 743 #define sz_xLbxInvalidateTagEvent 32 744 745 typedef struct _LbxSendTagDataEvent { 746 BYTE type; /* always eventBase + LbxEvent */ 747 BYTE lbxType; /* LbxSendTagDataEvent */ 748 CARD16 sequenceNumber B16; 749 CARD32 tag B32; 750 CARD32 tagType B32; 751 CARD32 pad1 B32; 752 CARD32 pad2 B32; 753 CARD32 pad3 B32; 754 CARD32 pad4 B32; 755 CARD32 pad5 B32; 756 } xLbxSendTagDataEvent; 757 #define sz_xLbxSendTagDataEvent 32 758 759 typedef struct _LbxListenToOneEvent { 760 BYTE type; /* always eventBase + LbxEvent */ 761 BYTE lbxType; /* LbxListenToOneEvent */ 762 CARD16 sequenceNumber B16; 763 CARD32 client B32; 764 CARD32 pad1 B32; 765 CARD32 pad2 B32; 766 CARD32 pad3 B32; 767 CARD32 pad4 B32; 768 CARD32 pad5 B32; 769 CARD32 pad6 B32; 770 } xLbxListenToOneEvent; 771 #define sz_xLbxListenToOneEvent 32 772 773 typedef struct _LbxListenToAllEvent { 774 BYTE type; /* always eventBase + LbxEvent */ 775 BYTE lbxType; /* LbxListenToAllEvent */ 776 CARD16 sequenceNumber B16; 777 CARD32 pad1 B32; 778 CARD32 pad2 B32; 779 CARD32 pad3 B32; 780 CARD32 pad4 B32; 781 CARD32 pad5 B32; 782 CARD32 pad6 B32; 783 CARD32 pad7 B32; 784 } xLbxListenToAllEvent; 785 #define sz_xLbxListenToOneEvent 32 786 787 typedef struct _LbxReleaseCmapEvent { 788 BYTE type; /* always eventBase + LbxEvent */ 789 BYTE lbxType; /* LbxReleaseCmapEvent */ 790 CARD16 sequenceNumber B16; 791 Colormap colormap B32; 792 CARD32 pad1 B32; 793 CARD32 pad2 B32; 794 CARD32 pad3 B32; 795 CARD32 pad4 B32; 796 CARD32 pad5 B32; 797 CARD32 pad6 B32; 798 } xLbxReleaseCmapEvent; 799 #define sz_xLbxReleaseCmapEvent 32 800 801 802 typedef struct _LbxFreeCellsEvent { 803 BYTE type; /* always eventBase + LbxEvent */ 804 BYTE lbxType; /* LbxFreeCellsEvent */ 805 CARD16 sequenceNumber B16; 806 Colormap colormap B32; 807 CARD32 pixelStart B32; 808 CARD32 pixelEnd B32; 809 CARD32 pad1 B32; 810 CARD32 pad2 B32; 811 CARD32 pad3 B32; 812 CARD32 pad4 B32; 813 } xLbxFreeCellsEvent; 814 #define sz_xLbxFreeCellsEvent 32 815 816 817 /* 818 * squished X event sizes. If these change, be sure to update lbxquish.c 819 * and unsquish.c appropriately 820 * 821 * lbxsz_* is the padded squished length 822 * lbxupsz_* is the unpadded squished length 823 */ 824 825 #define lbxsz_KeyButtonEvent 32 826 #define lbxupsz_KeyButtonEvent 31 827 828 #define lbxsz_EnterLeaveEvent 32 829 #define lbxupsz_EnterLeaveEvent 32 830 831 #define lbxsz_FocusEvent 12 832 #define lbxupsz_FocusEvent 9 833 834 #define lbxsz_KeymapEvent 32 835 #define lbxupsz_KeymapEvent 32 836 837 #define lbxsz_ExposeEvent 20 838 #define lbxupsz_ExposeEvent 18 839 840 #define lbxsz_GfxExposeEvent 24 841 #define lbxupsz_GfxExposeEvent 21 842 843 #define lbxsz_NoExposeEvent 12 844 #define lbxupsz_NoExposeEvent 11 845 846 #define lbxsz_VisibilityEvent 12 847 #define lbxupsz_VisibilityEvent 9 848 849 #define lbxsz_CreateNotifyEvent 24 850 #define lbxupsz_CreateNotifyEvent 23 851 852 #define lbxsz_DestroyNotifyEvent 12 853 #define lbxupsz_DestroyNotifyEvent 12 854 855 #define lbxsz_UnmapNotifyEvent 16 856 #define lbxupsz_UnmapNotifyEvent 13 857 858 #define lbxsz_MapNotifyEvent 16 859 #define lbxupsz_MapNotifyEvent 13 860 861 #define lbxsz_MapRequestEvent 12 862 #define lbxupsz_MapRequestEvent 12 863 864 #define lbxsz_ReparentEvent 24 865 #define lbxupsz_ReparentEvent 21 866 867 #define lbxsz_ConfigureNotifyEvent 28 868 #define lbxupsz_ConfigureNotifyEvent 27 869 870 #define lbxsz_ConfigureRequestEvent 28 871 #define lbxupsz_ConfigureRequestEvent 28 872 873 #define lbxsz_GravityEvent 16 874 #define lbxupsz_GravityEvent 16 875 876 #define lbxsz_ResizeRequestEvent 12 877 #define lbxupsz_ResizeRequestEvent 12 878 879 #define lbxsz_CirculateEvent 20 880 #define lbxupsz_CirculateEvent 17 881 882 #define lbxsz_PropertyEvent 20 883 #define lbxupsz_PropertyEvent 17 884 885 #define lbxsz_SelectionClearEvent 16 886 #define lbxupsz_SelectionClearEvent 16 887 888 #define lbxsz_SelectionRequestEvent 28 889 #define lbxupsz_SelectionRequestEvent 28 890 891 #define lbxsz_SelectionNotifyEvent 24 892 #define lbxupsz_SelectionNotifyEvent 24 893 894 #define lbxsz_ColormapEvent 16 895 #define lbxupsz_ColormapEvent 14 896 897 #define lbxsz_MappingNotifyEvent 8 898 #define lbxupsz_MappingNotifyEvent 7 899 900 #define lbxsz_ClientMessageEvent 32 901 #define lbxupsz_ClientMessageEvent 32 902 903 #define lbxsz_UnknownEvent 32 904 905 #ifdef DEBUG 906 907 #define DBG_SWITCH 0x00000001 908 #define DBG_CLOSE 0x00000002 909 #define DBG_IO 0x00000004 910 #define DBG_READ_REQ 0x00000008 911 #define DBG_LEN 0x00000010 912 #define DBG_BLOCK 0x00000020 913 #define DBG_CLIENT 0x00000040 914 #define DBG_DELTA 0x00000080 915 916 extern int lbxDebug; 917 918 #define DBG(n,m) if (lbxDebug & (n)) { fprintf m; } else 919 #else 920 #define DBG(n,m) 921 #endif 922 923 /* 924 * Cancel the previous redefinition of the basic types, thus restoring their 925 * X.h definitions. 926 */ 927 928 #undef XID 929 #undef Atom 930 #undef Colormap 931 #undef Drawable 932 #undef VisualID 933 #undef Window 934 935 #endif /* _LBXSTR_H_ */ 936