Xproto.h 56 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158
  1. /* Definitions for the X window system used by server and c bindings */
  2. /*
  3. * This packet-construction scheme makes the following assumptions:
  4. *
  5. * 1. The compiler is able
  6. * to generate code which addresses one- and two-byte quantities.
  7. * In the worst case, this would be done with bit-fields. If bit-fields
  8. * are used it may be necessary to reorder the request fields in this file,
  9. * depending on the order in which the machine assigns bit fields to
  10. * machine words. There may also be a problem with sign extension,
  11. * as K+R specify that bitfields are always unsigned.
  12. *
  13. * 2. 2- and 4-byte fields in packet structures must be ordered by hand
  14. * such that they are naturally-aligned, so that no compiler will ever
  15. * insert padding bytes.
  16. *
  17. * 3. All packets are hand-padded to a multiple of 4 bytes, for
  18. * the same reason.
  19. */
  20. #ifndef XPROTO_H
  21. #define XPROTO_H
  22. /***********************************************************
  23. Copyright 1987, 1998 The Open Group
  24. Permission to use, copy, modify, distribute, and sell this software and its
  25. documentation for any purpose is hereby granted without fee, provided that
  26. the above copyright notice appear in all copies and that both that
  27. copyright notice and this permission notice appear in supporting
  28. documentation.
  29. The above copyright notice and this permission notice shall be included in
  30. all copies or substantial portions of the Software.
  31. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  32. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  33. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  34. OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  35. AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  36. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  37. Except as contained in this notice, the name of The Open Group shall not be
  38. used in advertising or otherwise to promote the sale, use or other dealings
  39. in this Software without prior written authorization from The Open Group.
  40. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
  41. All Rights Reserved
  42. Permission to use, copy, modify, and distribute this software and its
  43. documentation for any purpose and without fee is hereby granted,
  44. provided that the above copyright notice appear in all copies and that
  45. both that copyright notice and this permission notice appear in
  46. supporting documentation, and that the name of Digital not be
  47. used in advertising or publicity pertaining to distribution of the
  48. software without specific, written prior permission.
  49. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  50. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  51. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  52. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  53. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  54. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  55. SOFTWARE.
  56. ******************************************************************/
  57. #include <X11/Xmd.h>
  58. #include <X11/Xprotostr.h>
  59. /*
  60. * Define constants for the sizes of the network packets. The sz_ prefix is
  61. * used instead of something more descriptive so that the symbols are no more
  62. * than 32 characters in length (which causes problems for some compilers).
  63. */
  64. #define sz_xSegment 8
  65. #define sz_xPoint 4
  66. #define sz_xRectangle 8
  67. #define sz_xArc 12
  68. #define sz_xConnClientPrefix 12
  69. #define sz_xConnSetupPrefix 8
  70. #define sz_xConnSetup 32
  71. #define sz_xPixmapFormat 8
  72. #define sz_xDepth 8
  73. #define sz_xVisualType 24
  74. #define sz_xWindowRoot 40
  75. #define sz_xTimecoord 8
  76. #define sz_xHostEntry 4
  77. #define sz_xCharInfo 12
  78. #define sz_xFontProp 8
  79. #define sz_xTextElt 2
  80. #define sz_xColorItem 12
  81. #define sz_xrgb 8
  82. #define sz_xGenericReply 32
  83. #define sz_xGetWindowAttributesReply 44
  84. #define sz_xGetGeometryReply 32
  85. #define sz_xQueryTreeReply 32
  86. #define sz_xInternAtomReply 32
  87. #define sz_xGetAtomNameReply 32
  88. #define sz_xGetPropertyReply 32
  89. #define sz_xListPropertiesReply 32
  90. #define sz_xGetSelectionOwnerReply 32
  91. #define sz_xGrabPointerReply 32
  92. #define sz_xQueryPointerReply 32
  93. #define sz_xGetMotionEventsReply 32
  94. #define sz_xTranslateCoordsReply 32
  95. #define sz_xGetInputFocusReply 32
  96. #define sz_xQueryKeymapReply 40
  97. #define sz_xQueryFontReply 60
  98. #define sz_xQueryTextExtentsReply 32
  99. #define sz_xListFontsReply 32
  100. #define sz_xGetFontPathReply 32
  101. #define sz_xGetImageReply 32
  102. #define sz_xListInstalledColormapsReply 32
  103. #define sz_xAllocColorReply 32
  104. #define sz_xAllocNamedColorReply 32
  105. #define sz_xAllocColorCellsReply 32
  106. #define sz_xAllocColorPlanesReply 32
  107. #define sz_xQueryColorsReply 32
  108. #define sz_xLookupColorReply 32
  109. #define sz_xQueryBestSizeReply 32
  110. #define sz_xQueryExtensionReply 32
  111. #define sz_xListExtensionsReply 32
  112. #define sz_xSetMappingReply 32
  113. #define sz_xGetKeyboardControlReply 52
  114. #define sz_xGetPointerControlReply 32
  115. #define sz_xGetScreenSaverReply 32
  116. #define sz_xListHostsReply 32
  117. #define sz_xSetModifierMappingReply 32
  118. #define sz_xError 32
  119. #define sz_xEvent 32
  120. #define sz_xKeymapEvent 32
  121. #define sz_xReq 4
  122. #define sz_xResourceReq 8
  123. #define sz_xCreateWindowReq 32
  124. #define sz_xChangeWindowAttributesReq 12
  125. #define sz_xChangeSaveSetReq 8
  126. #define sz_xReparentWindowReq 16
  127. #define sz_xConfigureWindowReq 12
  128. #define sz_xCirculateWindowReq 8
  129. #define sz_xInternAtomReq 8
  130. #define sz_xChangePropertyReq 24
  131. #define sz_xDeletePropertyReq 12
  132. #define sz_xGetPropertyReq 24
  133. #define sz_xSetSelectionOwnerReq 16
  134. #define sz_xConvertSelectionReq 24
  135. #define sz_xSendEventReq 44
  136. #define sz_xGrabPointerReq 24
  137. #define sz_xGrabButtonReq 24
  138. #define sz_xUngrabButtonReq 12
  139. #define sz_xChangeActivePointerGrabReq 16
  140. #define sz_xGrabKeyboardReq 16
  141. #define sz_xGrabKeyReq 16
  142. #define sz_xUngrabKeyReq 12
  143. #define sz_xAllowEventsReq 8
  144. #define sz_xGetMotionEventsReq 16
  145. #define sz_xTranslateCoordsReq 16
  146. #define sz_xWarpPointerReq 24
  147. #define sz_xSetInputFocusReq 12
  148. #define sz_xOpenFontReq 12
  149. #define sz_xQueryTextExtentsReq 8
  150. #define sz_xListFontsReq 8
  151. #define sz_xSetFontPathReq 8
  152. #define sz_xCreatePixmapReq 16
  153. #define sz_xCreateGCReq 16
  154. #define sz_xChangeGCReq 12
  155. #define sz_xCopyGCReq 16
  156. #define sz_xSetDashesReq 12
  157. #define sz_xSetClipRectanglesReq 12
  158. #define sz_xCopyAreaReq 28
  159. #define sz_xCopyPlaneReq 32
  160. #define sz_xPolyPointReq 12
  161. #define sz_xPolySegmentReq 12
  162. #define sz_xFillPolyReq 16
  163. #define sz_xPutImageReq 24
  164. #define sz_xGetImageReq 20
  165. #define sz_xPolyTextReq 16
  166. #define sz_xImageTextReq 16
  167. #define sz_xCreateColormapReq 16
  168. #define sz_xCopyColormapAndFreeReq 12
  169. #define sz_xAllocColorReq 16
  170. #define sz_xAllocNamedColorReq 12
  171. #define sz_xAllocColorCellsReq 12
  172. #define sz_xAllocColorPlanesReq 16
  173. #define sz_xFreeColorsReq 12
  174. #define sz_xStoreColorsReq 8
  175. #define sz_xStoreNamedColorReq 16
  176. #define sz_xQueryColorsReq 8
  177. #define sz_xLookupColorReq 12
  178. #define sz_xCreateCursorReq 32
  179. #define sz_xCreateGlyphCursorReq 32
  180. #define sz_xRecolorCursorReq 20
  181. #define sz_xQueryBestSizeReq 12
  182. #define sz_xQueryExtensionReq 8
  183. #define sz_xChangeKeyboardControlReq 8
  184. #define sz_xBellReq 4
  185. #define sz_xChangePointerControlReq 12
  186. #define sz_xSetScreenSaverReq 12
  187. #define sz_xChangeHostsReq 8
  188. #define sz_xListHostsReq 4
  189. #define sz_xChangeModeReq 4
  190. #define sz_xRotatePropertiesReq 12
  191. #define sz_xReply 32
  192. #define sz_xGrabKeyboardReply 32
  193. #define sz_xListFontsWithInfoReply 60
  194. #define sz_xSetPointerMappingReply 32
  195. #define sz_xGetKeyboardMappingReply 32
  196. #define sz_xGetPointerMappingReply 32
  197. #define sz_xGetModifierMappingReply 32
  198. #define sz_xListFontsWithInfoReq 8
  199. #define sz_xPolyLineReq 12
  200. #define sz_xPolyArcReq 12
  201. #define sz_xPolyRectangleReq 12
  202. #define sz_xPolyFillRectangleReq 12
  203. #define sz_xPolyFillArcReq 12
  204. #define sz_xPolyText8Req 16
  205. #define sz_xPolyText16Req 16
  206. #define sz_xImageText8Req 16
  207. #define sz_xImageText16Req 16
  208. #define sz_xSetPointerMappingReq 4
  209. #define sz_xForceScreenSaverReq 4
  210. #define sz_xSetCloseDownModeReq 4
  211. #define sz_xClearAreaReq 16
  212. #define sz_xSetAccessControlReq 4
  213. #define sz_xGetKeyboardMappingReq 8
  214. #define sz_xSetModifierMappingReq 4
  215. #define sz_xPropIconSize 24
  216. #define sz_xChangeKeyboardMappingReq 8
  217. /* For the purpose of the structure definitions in this file,
  218. we must redefine the following types in terms of Xmd.h's types, which may
  219. include bit fields. All of these are #undef'd at the end of this file,
  220. restoring the definitions in X.h. */
  221. #define Window CARD32
  222. #define Drawable CARD32
  223. #define Font CARD32
  224. #define Pixmap CARD32
  225. #define Cursor CARD32
  226. #define Colormap CARD32
  227. #define GContext CARD32
  228. #define Atom CARD32
  229. #define VisualID CARD32
  230. #define Time CARD32
  231. #define KeyCode CARD8
  232. #define KeySym CARD32
  233. #define X_TCP_PORT 6000 /* add display number */
  234. #define xTrue 1
  235. #define xFalse 0
  236. typedef CARD16 KeyButMask;
  237. /*****************
  238. Connection setup structures. See Chapter 8: Connection Setup
  239. of the X Window System Protocol specification for details.
  240. *****************/
  241. /* Client initiates handshake with this data, followed by the strings
  242. * for the auth protocol & data.
  243. */
  244. typedef struct {
  245. CARD8 byteOrder;
  246. BYTE pad;
  247. CARD16 majorVersion B16, minorVersion B16;
  248. CARD16 nbytesAuthProto B16; /* Authorization protocol */
  249. CARD16 nbytesAuthString B16; /* Authorization string */
  250. CARD16 pad2 B16;
  251. } xConnClientPrefix;
  252. /* Server response to xConnClientPrefix.
  253. *
  254. * If success == Success, this is followed by xConnSetup and
  255. * numRoots xWindowRoot structs.
  256. *
  257. * If success == Failure, this is followed by a reason string.
  258. *
  259. * The protocol also defines a case of success == Authenticate, but
  260. * that doesn't seem to have ever been implemented by the X Consortium.
  261. */
  262. typedef struct {
  263. CARD8 success;
  264. BYTE lengthReason; /*num bytes in string following if failure */
  265. CARD16 majorVersion B16,
  266. minorVersion B16;
  267. CARD16 length B16; /* 1/4 additional bytes in setup info */
  268. } xConnSetupPrefix;
  269. typedef struct {
  270. CARD32 release B32;
  271. CARD32 ridBase B32,
  272. ridMask B32;
  273. CARD32 motionBufferSize B32;
  274. CARD16 nbytesVendor B16; /* number of bytes in vendor string */
  275. CARD16 maxRequestSize B16;
  276. CARD8 numRoots; /* number of roots structs to follow */
  277. CARD8 numFormats; /* number of pixmap formats */
  278. CARD8 imageByteOrder; /* LSBFirst, MSBFirst */
  279. CARD8 bitmapBitOrder; /* LeastSignificant, MostSign...*/
  280. CARD8 bitmapScanlineUnit, /* 8, 16, 32 */
  281. bitmapScanlinePad; /* 8, 16, 32 */
  282. KeyCode minKeyCode, maxKeyCode;
  283. CARD32 pad2 B32;
  284. } xConnSetup;
  285. typedef struct {
  286. CARD8 depth;
  287. CARD8 bitsPerPixel;
  288. CARD8 scanLinePad;
  289. CARD8 pad1;
  290. CARD32 pad2 B32;
  291. } xPixmapFormat;
  292. /* window root */
  293. typedef struct {
  294. CARD8 depth;
  295. CARD8 pad1;
  296. CARD16 nVisuals B16; /* number of xVisualType structures following */
  297. CARD32 pad2 B32;
  298. } xDepth;
  299. typedef struct {
  300. VisualID visualID B32;
  301. #if defined(__cplusplus) || defined(c_plusplus)
  302. CARD8 c_class;
  303. #else
  304. CARD8 class;
  305. #endif
  306. CARD8 bitsPerRGB;
  307. CARD16 colormapEntries B16;
  308. CARD32 redMask B32, greenMask B32, blueMask B32;
  309. CARD32 pad B32;
  310. } xVisualType;
  311. typedef struct {
  312. Window windowId B32;
  313. Colormap defaultColormap B32;
  314. CARD32 whitePixel B32, blackPixel B32;
  315. CARD32 currentInputMask B32;
  316. CARD16 pixWidth B16, pixHeight B16;
  317. CARD16 mmWidth B16, mmHeight B16;
  318. CARD16 minInstalledMaps B16, maxInstalledMaps B16;
  319. VisualID rootVisualID B32;
  320. CARD8 backingStore;
  321. BOOL saveUnders;
  322. CARD8 rootDepth;
  323. CARD8 nDepths; /* number of xDepth structures following */
  324. } xWindowRoot;
  325. /*****************************************************************
  326. * Structure Defns
  327. * Structures needed for replies
  328. *****************************************************************/
  329. /* Used in GetMotionEvents */
  330. typedef struct {
  331. CARD32 time B32;
  332. INT16 x B16, y B16;
  333. } xTimecoord;
  334. typedef struct {
  335. CARD8 family;
  336. BYTE pad;
  337. CARD16 length B16;
  338. } xHostEntry;
  339. typedef struct {
  340. INT16 leftSideBearing B16,
  341. rightSideBearing B16,
  342. characterWidth B16,
  343. ascent B16,
  344. descent B16;
  345. CARD16 attributes B16;
  346. } xCharInfo;
  347. typedef struct {
  348. Atom name B32;
  349. CARD32 value B32;
  350. } xFontProp;
  351. /*
  352. * non-aligned big-endian font ID follows this struct
  353. */
  354. typedef struct { /* followed by string */
  355. CARD8 len; /* number of *characters* in string, or FontChange (255)
  356. for font change, or 0 if just delta given */
  357. INT8 delta;
  358. } xTextElt;
  359. typedef struct {
  360. CARD32 pixel B32;
  361. CARD16 red B16, green B16, blue B16;
  362. CARD8 flags; /* DoRed, DoGreen, DoBlue booleans */
  363. CARD8 pad;
  364. } xColorItem;
  365. typedef struct {
  366. CARD16 red B16, green B16, blue B16, pad B16;
  367. } xrgb;
  368. typedef CARD8 KEYCODE;
  369. /*****************
  370. * XRep:
  371. * meant to be 32 byte quantity
  372. *****************/
  373. /* GenericReply is the common format of all replies. The "data" items
  374. are specific to each individual reply type. */
  375. typedef struct {
  376. BYTE type; /* X_Reply */
  377. BYTE data1; /* depends on reply type */
  378. CARD16 sequenceNumber B16; /* of last request received by server */
  379. CARD32 length B32; /* 4 byte quantities beyond size of GenericReply */
  380. CARD32 data00 B32;
  381. CARD32 data01 B32;
  382. CARD32 data02 B32;
  383. CARD32 data03 B32;
  384. CARD32 data04 B32;
  385. CARD32 data05 B32;
  386. } xGenericReply;
  387. /* Individual reply formats. */
  388. typedef struct {
  389. BYTE type; /* X_Reply */
  390. CARD8 backingStore;
  391. CARD16 sequenceNumber B16;
  392. CARD32 length B32; /* NOT 0; this is an extra-large reply */
  393. VisualID visualID B32;
  394. #if defined(__cplusplus) || defined(c_plusplus)
  395. CARD16 c_class B16;
  396. #else
  397. CARD16 class B16;
  398. #endif
  399. CARD8 bitGravity;
  400. CARD8 winGravity;
  401. CARD32 backingBitPlanes B32;
  402. CARD32 backingPixel B32;
  403. BOOL saveUnder;
  404. BOOL mapInstalled;
  405. CARD8 mapState;
  406. BOOL override;
  407. Colormap colormap B32;
  408. CARD32 allEventMasks B32;
  409. CARD32 yourEventMask B32;
  410. CARD16 doNotPropagateMask B16;
  411. CARD16 pad B16;
  412. } xGetWindowAttributesReply;
  413. typedef struct {
  414. BYTE type; /* X_Reply */
  415. CARD8 depth;
  416. CARD16 sequenceNumber B16;
  417. CARD32 length B32; /* 0 */
  418. Window root B32;
  419. INT16 x B16, y B16;
  420. CARD16 width B16, height B16;
  421. CARD16 borderWidth B16;
  422. CARD16 pad1 B16;
  423. CARD32 pad2 B32;
  424. CARD32 pad3 B32;
  425. } xGetGeometryReply;
  426. typedef struct {
  427. BYTE type; /* X_Reply */
  428. BYTE pad1;
  429. CARD16 sequenceNumber B16;
  430. CARD32 length B32;
  431. Window root B32, parent B32;
  432. CARD16 nChildren B16;
  433. CARD16 pad2 B16;
  434. CARD32 pad3 B32;
  435. CARD32 pad4 B32;
  436. CARD32 pad5 B32;
  437. } xQueryTreeReply;
  438. typedef struct {
  439. BYTE type; /* X_Reply */
  440. BYTE pad1;
  441. CARD16 sequenceNumber B16;
  442. CARD32 length B32; /* 0 */
  443. Atom atom B32;
  444. CARD32 pad2 B32;
  445. CARD32 pad3 B32;
  446. CARD32 pad4 B32;
  447. CARD32 pad5 B32;
  448. CARD32 pad6 B32;
  449. } xInternAtomReply;
  450. typedef struct {
  451. BYTE type; /* X_Reply */
  452. BYTE pad1;
  453. CARD16 sequenceNumber B16;
  454. CARD32 length B32; /* of additional bytes */
  455. CARD16 nameLength B16; /* # of characters in name */
  456. CARD16 pad2 B16;
  457. CARD32 pad3 B32;
  458. CARD32 pad4 B32;
  459. CARD32 pad5 B32;
  460. CARD32 pad6 B32;
  461. CARD32 pad7 B32;
  462. } xGetAtomNameReply;
  463. typedef struct {
  464. BYTE type; /* X_Reply */
  465. CARD8 format;
  466. CARD16 sequenceNumber B16;
  467. CARD32 length B32; /* of additional bytes */
  468. Atom propertyType B32;
  469. CARD32 bytesAfter B32;
  470. CARD32 nItems B32; /* # of 8, 16, or 32-bit entities in reply */
  471. CARD32 pad1 B32;
  472. CARD32 pad2 B32;
  473. CARD32 pad3 B32;
  474. } xGetPropertyReply;
  475. typedef struct {
  476. BYTE type; /* X_Reply */
  477. BYTE pad1;
  478. CARD16 sequenceNumber B16;
  479. CARD32 length B32;
  480. CARD16 nProperties B16;
  481. CARD16 pad2 B16;
  482. CARD32 pad3 B32;
  483. CARD32 pad4 B32;
  484. CARD32 pad5 B32;
  485. CARD32 pad6 B32;
  486. CARD32 pad7 B32;
  487. } xListPropertiesReply;
  488. typedef struct {
  489. BYTE type; /* X_Reply */
  490. BYTE pad1;
  491. CARD16 sequenceNumber B16;
  492. CARD32 length B32; /* 0 */
  493. Window owner B32;
  494. CARD32 pad2 B32;
  495. CARD32 pad3 B32;
  496. CARD32 pad4 B32;
  497. CARD32 pad5 B32;
  498. CARD32 pad6 B32;
  499. } xGetSelectionOwnerReply;
  500. typedef struct {
  501. BYTE type; /* X_Reply */
  502. BYTE status;
  503. CARD16 sequenceNumber B16;
  504. CARD32 length B32; /* 0 */
  505. CARD32 pad1 B32;
  506. CARD32 pad2 B32;
  507. CARD32 pad3 B32;
  508. CARD32 pad4 B32;
  509. CARD32 pad5 B32;
  510. CARD32 pad6 B32;
  511. } xGrabPointerReply;
  512. typedef xGrabPointerReply xGrabKeyboardReply;
  513. typedef struct {
  514. BYTE type; /* X_Reply */
  515. BOOL sameScreen;
  516. CARD16 sequenceNumber B16;
  517. CARD32 length B32; /* 0 */
  518. Window root B32, child B32;
  519. INT16 rootX B16, rootY B16, winX B16, winY B16;
  520. CARD16 mask B16;
  521. CARD16 pad1 B16;
  522. CARD32 pad B32;
  523. } xQueryPointerReply;
  524. typedef struct {
  525. BYTE type; /* X_Reply */
  526. BYTE pad1;
  527. CARD16 sequenceNumber B16;
  528. CARD32 length B32;
  529. CARD32 nEvents B32;
  530. CARD32 pad2 B32;
  531. CARD32 pad3 B32;
  532. CARD32 pad4 B32;
  533. CARD32 pad5 B32;
  534. CARD32 pad6 B32;
  535. } xGetMotionEventsReply;
  536. typedef struct {
  537. BYTE type; /* X_Reply */
  538. BOOL sameScreen;
  539. CARD16 sequenceNumber B16;
  540. CARD32 length B32; /* 0 */
  541. Window child B32;
  542. INT16 dstX B16, dstY B16;
  543. CARD32 pad2 B32;
  544. CARD32 pad3 B32;
  545. CARD32 pad4 B32;
  546. CARD32 pad5 B32;
  547. } xTranslateCoordsReply;
  548. typedef struct {
  549. BYTE type; /* X_Reply */
  550. CARD8 revertTo;
  551. CARD16 sequenceNumber B16;
  552. CARD32 length B32; /* 0 */
  553. Window focus B32;
  554. CARD32 pad1 B32;
  555. CARD32 pad2 B32;
  556. CARD32 pad3 B32;
  557. CARD32 pad4 B32;
  558. CARD32 pad5 B32;
  559. } xGetInputFocusReply;
  560. typedef struct {
  561. BYTE type; /* X_Reply */
  562. BYTE pad1;
  563. CARD16 sequenceNumber B16;
  564. CARD32 length B32; /* 2, NOT 0; this is an extra-large reply */
  565. BYTE map[32];
  566. } xQueryKeymapReply;
  567. /* Warning: this MUST match (up to component renaming) xListFontsWithInfoReply */
  568. typedef struct _xQueryFontReply {
  569. BYTE type; /* X_Reply */
  570. BYTE pad1;
  571. CARD16 sequenceNumber B16;
  572. CARD32 length B32; /* definitely > 0, even if "nCharInfos" is 0 */
  573. xCharInfo minBounds;
  574. CARD32 walign1 B32;
  575. xCharInfo maxBounds;
  576. CARD32 walign2 B32;
  577. CARD16 minCharOrByte2 B16, maxCharOrByte2 B16;
  578. CARD16 defaultChar B16;
  579. CARD16 nFontProps B16; /* followed by this many xFontProp structures */
  580. CARD8 drawDirection;
  581. CARD8 minByte1, maxByte1;
  582. BOOL allCharsExist;
  583. INT16 fontAscent B16, fontDescent B16;
  584. CARD32 nCharInfos B32; /* followed by this many xCharInfo structures */
  585. } xQueryFontReply;
  586. typedef struct {
  587. BYTE type; /* X_Reply */
  588. CARD8 drawDirection;
  589. CARD16 sequenceNumber B16;
  590. CARD32 length B32; /* 0 */
  591. INT16 fontAscent B16, fontDescent B16;
  592. INT16 overallAscent B16, overallDescent B16;
  593. INT32 overallWidth B32, overallLeft B32, overallRight B32;
  594. CARD32 pad B32;
  595. } xQueryTextExtentsReply;
  596. typedef struct {
  597. BYTE type; /* X_Reply */
  598. BYTE pad1;
  599. CARD16 sequenceNumber B16;
  600. CARD32 length B32;
  601. CARD16 nFonts B16;
  602. CARD16 pad2 B16;
  603. CARD32 pad3 B32;
  604. CARD32 pad4 B32;
  605. CARD32 pad5 B32;
  606. CARD32 pad6 B32;
  607. CARD32 pad7 B32;
  608. } xListFontsReply;
  609. /* Warning: this MUST match (up to component renaming) xQueryFontReply */
  610. typedef struct {
  611. BYTE type; /* X_Reply */
  612. CARD8 nameLength; /* 0 indicates end-of-reply-sequence */
  613. CARD16 sequenceNumber B16;
  614. CARD32 length B32; /* definitely > 0, even if "nameLength" is 0 */
  615. xCharInfo minBounds;
  616. CARD32 walign1 B32;
  617. xCharInfo maxBounds;
  618. CARD32 walign2 B32;
  619. CARD16 minCharOrByte2 B16, maxCharOrByte2 B16;
  620. CARD16 defaultChar B16;
  621. CARD16 nFontProps B16; /* followed by this many xFontProp structures */
  622. CARD8 drawDirection;
  623. CARD8 minByte1, maxByte1;
  624. BOOL allCharsExist;
  625. INT16 fontAscent B16, fontDescent B16;
  626. CARD32 nReplies B32; /* hint as to how many more replies might be coming */
  627. } xListFontsWithInfoReply;
  628. typedef struct {
  629. BYTE type; /* X_Reply */
  630. BYTE pad1;
  631. CARD16 sequenceNumber B16;
  632. CARD32 length B32;
  633. CARD16 nPaths B16;
  634. CARD16 pad2 B16;
  635. CARD32 pad3 B32;
  636. CARD32 pad4 B32;
  637. CARD32 pad5 B32;
  638. CARD32 pad6 B32;
  639. CARD32 pad7 B32;
  640. } xGetFontPathReply;
  641. typedef struct {
  642. BYTE type; /* X_Reply */
  643. CARD8 depth;
  644. CARD16 sequenceNumber B16;
  645. CARD32 length B32;
  646. VisualID visual B32;
  647. CARD32 pad3 B32;
  648. CARD32 pad4 B32;
  649. CARD32 pad5 B32;
  650. CARD32 pad6 B32;
  651. CARD32 pad7 B32;
  652. } xGetImageReply;
  653. typedef struct {
  654. BYTE type; /* X_Reply */
  655. BYTE pad1;
  656. CARD16 sequenceNumber B16;
  657. CARD32 length B32;
  658. CARD16 nColormaps B16;
  659. CARD16 pad2 B16;
  660. CARD32 pad3 B32;
  661. CARD32 pad4 B32;
  662. CARD32 pad5 B32;
  663. CARD32 pad6 B32;
  664. CARD32 pad7 B32;
  665. } xListInstalledColormapsReply;
  666. typedef struct {
  667. BYTE type; /* X_Reply */
  668. BYTE pad1;
  669. CARD16 sequenceNumber B16;
  670. CARD32 length B32; /* 0 */
  671. CARD16 red B16, green B16, blue B16;
  672. CARD16 pad2 B16;
  673. CARD32 pixel B32;
  674. CARD32 pad3 B32;
  675. CARD32 pad4 B32;
  676. CARD32 pad5 B32;
  677. } xAllocColorReply;
  678. typedef struct {
  679. BYTE type; /* X_Reply */
  680. BYTE pad1;
  681. CARD16 sequenceNumber B16;
  682. CARD32 length B32; /* 0 */
  683. CARD32 pixel B32;
  684. CARD16 exactRed B16, exactGreen B16, exactBlue B16;
  685. CARD16 screenRed B16, screenGreen B16, screenBlue B16;
  686. CARD32 pad2 B32;
  687. CARD32 pad3 B32;
  688. } xAllocNamedColorReply;
  689. typedef struct {
  690. BYTE type; /* X_Reply */
  691. BYTE pad1;
  692. CARD16 sequenceNumber B16;
  693. CARD32 length B32;
  694. CARD16 nPixels B16, nMasks B16;
  695. CARD32 pad3 B32;
  696. CARD32 pad4 B32;
  697. CARD32 pad5 B32;
  698. CARD32 pad6 B32;
  699. CARD32 pad7 B32;
  700. } xAllocColorCellsReply;
  701. typedef struct {
  702. BYTE type; /* X_Reply */
  703. BYTE pad1;
  704. CARD16 sequenceNumber B16;
  705. CARD32 length B32;
  706. CARD16 nPixels B16;
  707. CARD16 pad2 B16;
  708. CARD32 redMask B32, greenMask B32, blueMask B32;
  709. CARD32 pad3 B32;
  710. CARD32 pad4 B32;
  711. } xAllocColorPlanesReply;
  712. typedef struct {
  713. BYTE type; /* X_Reply */
  714. BYTE pad1;
  715. CARD16 sequenceNumber B16;
  716. CARD32 length B32;
  717. CARD16 nColors B16;
  718. CARD16 pad2 B16;
  719. CARD32 pad3 B32;
  720. CARD32 pad4 B32;
  721. CARD32 pad5 B32;
  722. CARD32 pad6 B32;
  723. CARD32 pad7 B32;
  724. } xQueryColorsReply;
  725. typedef struct {
  726. BYTE type; /* X_Reply */
  727. BYTE pad1;
  728. CARD16 sequenceNumber B16;
  729. CARD32 length B32; /* 0 */
  730. CARD16 exactRed B16, exactGreen B16, exactBlue B16;
  731. CARD16 screenRed B16, screenGreen B16, screenBlue B16;
  732. CARD32 pad3 B32;
  733. CARD32 pad4 B32;
  734. CARD32 pad5 B32;
  735. } xLookupColorReply;
  736. typedef struct {
  737. BYTE type; /* X_Reply */
  738. BYTE pad1;
  739. CARD16 sequenceNumber B16;
  740. CARD32 length B32; /* 0 */
  741. CARD16 width B16, height B16;
  742. CARD32 pad3 B32;
  743. CARD32 pad4 B32;
  744. CARD32 pad5 B32;
  745. CARD32 pad6 B32;
  746. CARD32 pad7 B32;
  747. } xQueryBestSizeReply;
  748. typedef struct {
  749. BYTE type; /* X_Reply */
  750. BYTE pad1;
  751. CARD16 sequenceNumber B16;
  752. CARD32 length B32; /* 0 */
  753. BOOL present;
  754. CARD8 major_opcode;
  755. CARD8 first_event;
  756. CARD8 first_error;
  757. CARD32 pad3 B32;
  758. CARD32 pad4 B32;
  759. CARD32 pad5 B32;
  760. CARD32 pad6 B32;
  761. CARD32 pad7 B32;
  762. } xQueryExtensionReply;
  763. typedef struct {
  764. BYTE type; /* X_Reply */
  765. CARD8 nExtensions;
  766. CARD16 sequenceNumber B16;
  767. CARD32 length B32;
  768. CARD32 pad2 B32;
  769. CARD32 pad3 B32;
  770. CARD32 pad4 B32;
  771. CARD32 pad5 B32;
  772. CARD32 pad6 B32;
  773. CARD32 pad7 B32;
  774. } xListExtensionsReply;
  775. typedef struct {
  776. BYTE type; /* X_Reply */
  777. CARD8 success;
  778. CARD16 sequenceNumber B16;
  779. CARD32 length B32;
  780. CARD32 pad2 B32;
  781. CARD32 pad3 B32;
  782. CARD32 pad4 B32;
  783. CARD32 pad5 B32;
  784. CARD32 pad6 B32;
  785. CARD32 pad7 B32;
  786. } xSetMappingReply;
  787. typedef xSetMappingReply xSetPointerMappingReply;
  788. typedef xSetMappingReply xSetModifierMappingReply;
  789. typedef struct {
  790. BYTE type; /* X_Reply */
  791. CARD8 nElts; /* how many elements does the map have */
  792. CARD16 sequenceNumber B16;
  793. CARD32 length B32;
  794. CARD32 pad2 B32;
  795. CARD32 pad3 B32;
  796. CARD32 pad4 B32;
  797. CARD32 pad5 B32;
  798. CARD32 pad6 B32;
  799. CARD32 pad7 B32;
  800. } xGetPointerMappingReply;
  801. typedef struct {
  802. BYTE type;
  803. CARD8 keySymsPerKeyCode;
  804. CARD16 sequenceNumber B16;
  805. CARD32 length B32;
  806. CARD32 pad2 B32;
  807. CARD32 pad3 B32;
  808. CARD32 pad4 B32;
  809. CARD32 pad5 B32;
  810. CARD32 pad6 B32;
  811. CARD32 pad7 B32;
  812. } xGetKeyboardMappingReply;
  813. typedef struct {
  814. BYTE type;
  815. CARD8 numKeyPerModifier;
  816. CARD16 sequenceNumber B16;
  817. CARD32 length B32;
  818. CARD32 pad1 B32;
  819. CARD32 pad2 B32;
  820. CARD32 pad3 B32;
  821. CARD32 pad4 B32;
  822. CARD32 pad5 B32;
  823. CARD32 pad6 B32;
  824. } xGetModifierMappingReply;
  825. typedef struct {
  826. BYTE type; /* X_Reply */
  827. BOOL globalAutoRepeat;
  828. CARD16 sequenceNumber B16;
  829. CARD32 length B32; /* 5 */
  830. CARD32 ledMask B32;
  831. CARD8 keyClickPercent, bellPercent;
  832. CARD16 bellPitch B16, bellDuration B16;
  833. CARD16 pad B16;
  834. BYTE map[32]; /* bit masks start here */
  835. } xGetKeyboardControlReply;
  836. typedef struct {
  837. BYTE type; /* X_Reply */
  838. BYTE pad1;
  839. CARD16 sequenceNumber B16;
  840. CARD32 length B32; /* 0 */
  841. CARD16 accelNumerator B16, accelDenominator B16;
  842. CARD16 threshold B16;
  843. CARD16 pad2 B16;
  844. CARD32 pad3 B32;
  845. CARD32 pad4 B32;
  846. CARD32 pad5 B32;
  847. CARD32 pad6 B32;
  848. } xGetPointerControlReply;
  849. typedef struct {
  850. BYTE type; /* X_Reply */
  851. BYTE pad1;
  852. CARD16 sequenceNumber B16;
  853. CARD32 length B32; /* 0 */
  854. CARD16 timeout B16, interval B16;
  855. BOOL preferBlanking;
  856. BOOL allowExposures;
  857. CARD16 pad2 B16;
  858. CARD32 pad3 B32;
  859. CARD32 pad4 B32;
  860. CARD32 pad5 B32;
  861. CARD32 pad6 B32;
  862. } xGetScreenSaverReply;
  863. typedef struct {
  864. BYTE type; /* X_Reply */
  865. BOOL enabled;
  866. CARD16 sequenceNumber B16;
  867. CARD32 length B32;
  868. CARD16 nHosts B16;
  869. CARD16 pad1 B16;
  870. CARD32 pad3 B32;
  871. CARD32 pad4 B32;
  872. CARD32 pad5 B32;
  873. CARD32 pad6 B32;
  874. CARD32 pad7 B32;
  875. } xListHostsReply;
  876. /*****************************************************************
  877. * Xerror
  878. * All errors are 32 bytes
  879. *****************************************************************/
  880. typedef struct {
  881. BYTE type; /* X_Error */
  882. BYTE errorCode;
  883. CARD16 sequenceNumber B16; /* the nth request from this client */
  884. CARD32 resourceID B32;
  885. CARD16 minorCode B16;
  886. CARD8 majorCode;
  887. BYTE pad1;
  888. CARD32 pad3 B32;
  889. CARD32 pad4 B32;
  890. CARD32 pad5 B32;
  891. CARD32 pad6 B32;
  892. CARD32 pad7 B32;
  893. } xError;
  894. /*****************************************************************
  895. * xEvent
  896. * All events are 32 bytes
  897. *****************************************************************/
  898. typedef struct _xEvent {
  899. union {
  900. struct {
  901. BYTE type;
  902. BYTE detail;
  903. CARD16 sequenceNumber B16;
  904. } u;
  905. struct {
  906. CARD32 pad00 B32;
  907. Time time B32;
  908. Window root B32, event B32, child B32;
  909. INT16 rootX B16, rootY B16, eventX B16, eventY B16;
  910. KeyButMask state B16;
  911. BOOL sameScreen;
  912. BYTE pad1;
  913. } keyButtonPointer;
  914. struct {
  915. CARD32 pad00 B32;
  916. Time time B32;
  917. Window root B32, event B32, child B32;
  918. INT16 rootX B16, rootY B16, eventX B16, eventY B16;
  919. KeyButMask state B16;
  920. BYTE mode; /* really XMode */
  921. BYTE flags; /* sameScreen and focus booleans, packed together */
  922. #define ELFlagFocus (1<<0)
  923. #define ELFlagSameScreen (1<<1)
  924. } enterLeave;
  925. struct {
  926. CARD32 pad00 B32;
  927. Window window B32;
  928. BYTE mode; /* really XMode */
  929. BYTE pad1, pad2, pad3;
  930. } focus;
  931. struct {
  932. CARD32 pad00 B32;
  933. Window window B32;
  934. CARD16 x B16, y B16, width B16, height B16;
  935. CARD16 count B16;
  936. CARD16 pad2 B16;
  937. } expose;
  938. struct {
  939. CARD32 pad00 B32;
  940. Drawable drawable B32;
  941. CARD16 x B16, y B16, width B16, height B16;
  942. CARD16 minorEvent B16;
  943. CARD16 count B16;
  944. BYTE majorEvent;
  945. BYTE pad1, pad2, pad3;
  946. } graphicsExposure;
  947. struct {
  948. CARD32 pad00 B32;
  949. Drawable drawable B32;
  950. CARD16 minorEvent B16;
  951. BYTE majorEvent;
  952. BYTE bpad;
  953. } noExposure;
  954. struct {
  955. CARD32 pad00 B32;
  956. Window window B32;
  957. CARD8 state;
  958. BYTE pad1, pad2, pad3;
  959. } visibility;
  960. struct {
  961. CARD32 pad00 B32;
  962. Window parent B32, window B32;
  963. INT16 x B16, y B16;
  964. CARD16 width B16, height B16, borderWidth B16;
  965. BOOL override;
  966. BYTE bpad;
  967. } createNotify;
  968. /*
  969. * The event fields in the structures for DestroyNotify, UnmapNotify,
  970. * MapNotify, ReparentNotify, ConfigureNotify, CirculateNotify, GravityNotify,
  971. * must be at the same offset because server internal code is depending upon
  972. * this to patch up the events before they are delivered.
  973. * Also note that MapRequest, ConfigureRequest and CirculateRequest have
  974. * the same offset for the event window.
  975. */
  976. struct {
  977. CARD32 pad00 B32;
  978. Window event B32, window B32;
  979. } destroyNotify;
  980. struct {
  981. CARD32 pad00 B32;
  982. Window event B32, window B32;
  983. BOOL fromConfigure;
  984. BYTE pad1, pad2, pad3;
  985. } unmapNotify;
  986. struct {
  987. CARD32 pad00 B32;
  988. Window event B32, window B32;
  989. BOOL override;
  990. BYTE pad1, pad2, pad3;
  991. } mapNotify;
  992. struct {
  993. CARD32 pad00 B32;
  994. Window parent B32, window B32;
  995. } mapRequest;
  996. struct {
  997. CARD32 pad00 B32;
  998. Window event B32, window B32, parent B32;
  999. INT16 x B16, y B16;
  1000. BOOL override;
  1001. BYTE pad1, pad2, pad3;
  1002. } reparent;
  1003. struct {
  1004. CARD32 pad00 B32;
  1005. Window event B32, window B32, aboveSibling B32;
  1006. INT16 x B16, y B16;
  1007. CARD16 width B16, height B16, borderWidth B16;
  1008. BOOL override;
  1009. BYTE bpad;
  1010. } configureNotify;
  1011. struct {
  1012. CARD32 pad00 B32;
  1013. Window parent B32, window B32, sibling B32;
  1014. INT16 x B16, y B16;
  1015. CARD16 width B16, height B16, borderWidth B16;
  1016. CARD16 valueMask B16;
  1017. CARD32 pad1 B32;
  1018. } configureRequest;
  1019. struct {
  1020. CARD32 pad00 B32;
  1021. Window event B32, window B32;
  1022. INT16 x B16, y B16;
  1023. CARD32 pad1 B32, pad2 B32, pad3 B32, pad4 B32;
  1024. } gravity;
  1025. struct {
  1026. CARD32 pad00 B32;
  1027. Window window B32;
  1028. CARD16 width B16, height B16;
  1029. } resizeRequest;
  1030. struct {
  1031. /* The event field in the circulate record is really the parent when this
  1032. is used as a CirculateRequest instead of a CirculateNotify */
  1033. CARD32 pad00 B32;
  1034. Window event B32, window B32, parent B32;
  1035. BYTE place; /* Top or Bottom */
  1036. BYTE pad1, pad2, pad3;
  1037. } circulate;
  1038. struct {
  1039. CARD32 pad00 B32;
  1040. Window window B32;
  1041. Atom atom B32;
  1042. Time time B32;
  1043. BYTE state; /* NewValue or Deleted */
  1044. BYTE pad1;
  1045. CARD16 pad2 B16;
  1046. } property;
  1047. struct {
  1048. CARD32 pad00 B32;
  1049. Time time B32;
  1050. Window window B32;
  1051. Atom atom B32;
  1052. } selectionClear;
  1053. struct {
  1054. CARD32 pad00 B32;
  1055. Time time B32;
  1056. Window owner B32, requestor B32;
  1057. Atom selection B32, target B32, property B32;
  1058. } selectionRequest;
  1059. struct {
  1060. CARD32 pad00 B32;
  1061. Time time B32;
  1062. Window requestor B32;
  1063. Atom selection B32, target B32, property B32;
  1064. } selectionNotify;
  1065. struct {
  1066. CARD32 pad00 B32;
  1067. Window window B32;
  1068. Colormap colormap B32;
  1069. #if defined(__cplusplus) || defined(c_plusplus)
  1070. BOOL c_new;
  1071. #else
  1072. BOOL new;
  1073. #endif
  1074. BYTE state; /* Installed or UnInstalled */
  1075. BYTE pad1, pad2;
  1076. } colormap;
  1077. struct {
  1078. CARD32 pad00 B32;
  1079. CARD8 request;
  1080. KeyCode firstKeyCode;
  1081. CARD8 count;
  1082. BYTE pad1;
  1083. } mappingNotify;
  1084. struct {
  1085. CARD32 pad00 B32;
  1086. Window window B32;
  1087. union {
  1088. struct {
  1089. Atom type B32;
  1090. INT32 longs0 B32;
  1091. INT32 longs1 B32;
  1092. INT32 longs2 B32;
  1093. INT32 longs3 B32;
  1094. INT32 longs4 B32;
  1095. } l;
  1096. struct {
  1097. Atom type B32;
  1098. INT16 shorts0 B16;
  1099. INT16 shorts1 B16;
  1100. INT16 shorts2 B16;
  1101. INT16 shorts3 B16;
  1102. INT16 shorts4 B16;
  1103. INT16 shorts5 B16;
  1104. INT16 shorts6 B16;
  1105. INT16 shorts7 B16;
  1106. INT16 shorts8 B16;
  1107. INT16 shorts9 B16;
  1108. } s;
  1109. struct {
  1110. Atom type B32;
  1111. INT8 bytes[20];
  1112. } b;
  1113. } u;
  1114. } clientMessage;
  1115. } u;
  1116. } xEvent;
  1117. /*********************************************************
  1118. *
  1119. * Generic event
  1120. *
  1121. * Those events are not part of the core protocol spec and can be used by
  1122. * various extensions.
  1123. * type is always GenericEvent
  1124. * extension is the minor opcode of the extension the event belongs to.
  1125. * evtype is the actual event type, unique __per extension__.
  1126. *
  1127. * GenericEvents can be longer than 32 bytes, with the length field
  1128. * specifying the number of 4 byte blocks after the first 32 bytes.
  1129. *
  1130. *
  1131. */
  1132. typedef struct
  1133. {
  1134. BYTE type;
  1135. CARD8 extension;
  1136. CARD16 sequenceNumber B16;
  1137. CARD32 length B32;
  1138. CARD16 evtype B16;
  1139. CARD16 pad2 B16;
  1140. CARD32 pad3 B32;
  1141. CARD32 pad4 B32;
  1142. CARD32 pad5 B32;
  1143. CARD32 pad6 B32;
  1144. CARD32 pad7 B32;
  1145. } xGenericEvent;
  1146. /* KeymapNotify events are not included in the above union because they
  1147. are different from all other events: they do not have a "detail"
  1148. or "sequenceNumber", so there is room for a 248-bit key mask. */
  1149. typedef struct {
  1150. BYTE type;
  1151. BYTE map[31];
  1152. } xKeymapEvent;
  1153. #define XEventSize (sizeof(xEvent))
  1154. /* XReply is the union of all the replies above whose "fixed part"
  1155. fits in 32 bytes. It does NOT include GetWindowAttributesReply,
  1156. QueryFontReply, QueryKeymapReply, or GetKeyboardControlReply
  1157. ListFontsWithInfoReply */
  1158. typedef union {
  1159. xGenericReply generic;
  1160. xGetGeometryReply geom;
  1161. xQueryTreeReply tree;
  1162. xInternAtomReply atom;
  1163. xGetAtomNameReply atomName;
  1164. xGetPropertyReply property;
  1165. xListPropertiesReply listProperties;
  1166. xGetSelectionOwnerReply selection;
  1167. xGrabPointerReply grabPointer;
  1168. xGrabKeyboardReply grabKeyboard;
  1169. xQueryPointerReply pointer;
  1170. xGetMotionEventsReply motionEvents;
  1171. xTranslateCoordsReply coords;
  1172. xGetInputFocusReply inputFocus;
  1173. xQueryTextExtentsReply textExtents;
  1174. xListFontsReply fonts;
  1175. xGetFontPathReply fontPath;
  1176. xGetImageReply image;
  1177. xListInstalledColormapsReply colormaps;
  1178. xAllocColorReply allocColor;
  1179. xAllocNamedColorReply allocNamedColor;
  1180. xAllocColorCellsReply colorCells;
  1181. xAllocColorPlanesReply colorPlanes;
  1182. xQueryColorsReply colors;
  1183. xLookupColorReply lookupColor;
  1184. xQueryBestSizeReply bestSize;
  1185. xQueryExtensionReply extension;
  1186. xListExtensionsReply extensions;
  1187. xSetModifierMappingReply setModifierMapping;
  1188. xGetModifierMappingReply getModifierMapping;
  1189. xSetPointerMappingReply setPointerMapping;
  1190. xGetKeyboardMappingReply getKeyboardMapping;
  1191. xGetPointerMappingReply getPointerMapping;
  1192. xGetPointerControlReply pointerControl;
  1193. xGetScreenSaverReply screenSaver;
  1194. xListHostsReply hosts;
  1195. xError error;
  1196. xEvent event;
  1197. } xReply;
  1198. /*****************************************************************
  1199. * REQUESTS
  1200. *****************************************************************/
  1201. /* Request structure */
  1202. typedef struct _xReq {
  1203. CARD8 reqType;
  1204. CARD8 data; /* meaning depends on request type */
  1205. CARD16 length B16; /* length in 4 bytes quantities
  1206. of whole request, including this header */
  1207. } xReq;
  1208. /*****************************************************************
  1209. * structures that follow request.
  1210. *****************************************************************/
  1211. /* ResourceReq is used for any request which has a resource ID
  1212. (or Atom or Time) as its one and only argument. */
  1213. typedef struct {
  1214. CARD8 reqType;
  1215. BYTE pad;
  1216. CARD16 length B16;
  1217. CARD32 id B32; /* a Window, Drawable, Font, GContext, Pixmap, etc. */
  1218. } xResourceReq;
  1219. typedef struct {
  1220. CARD8 reqType;
  1221. CARD8 depth;
  1222. CARD16 length B16;
  1223. Window wid B32, parent B32;
  1224. INT16 x B16, y B16;
  1225. CARD16 width B16, height B16, borderWidth B16;
  1226. #if defined(__cplusplus) || defined(c_plusplus)
  1227. CARD16 c_class B16;
  1228. #else
  1229. CARD16 class B16;
  1230. #endif
  1231. VisualID visual B32;
  1232. CARD32 mask B32;
  1233. } xCreateWindowReq;
  1234. typedef struct {
  1235. CARD8 reqType;
  1236. BYTE pad;
  1237. CARD16 length B16;
  1238. Window window B32;
  1239. CARD32 valueMask B32;
  1240. } xChangeWindowAttributesReq;
  1241. typedef struct {
  1242. CARD8 reqType;
  1243. BYTE mode;
  1244. CARD16 length B16;
  1245. Window window B32;
  1246. } xChangeSaveSetReq;
  1247. typedef struct {
  1248. CARD8 reqType;
  1249. BYTE pad;
  1250. CARD16 length B16;
  1251. Window window B32, parent B32;
  1252. INT16 x B16, y B16;
  1253. } xReparentWindowReq;
  1254. typedef struct {
  1255. CARD8 reqType;
  1256. CARD8 pad;
  1257. CARD16 length B16;
  1258. Window window B32;
  1259. CARD16 mask B16;
  1260. CARD16 pad2 B16;
  1261. } xConfigureWindowReq;
  1262. typedef struct {
  1263. CARD8 reqType;
  1264. CARD8 direction;
  1265. CARD16 length B16;
  1266. Window window B32;
  1267. } xCirculateWindowReq;
  1268. typedef struct { /* followed by padded string */
  1269. CARD8 reqType;
  1270. BOOL onlyIfExists;
  1271. CARD16 length B16;
  1272. CARD16 nbytes B16; /* number of bytes in string */
  1273. CARD16 pad B16;
  1274. } xInternAtomReq;
  1275. typedef struct {
  1276. CARD8 reqType;
  1277. CARD8 mode;
  1278. CARD16 length B16;
  1279. Window window B32;
  1280. Atom property B32, type B32;
  1281. CARD8 format;
  1282. BYTE pad[3];
  1283. CARD32 nUnits B32; /* length of stuff following, depends on format */
  1284. } xChangePropertyReq;
  1285. typedef struct {
  1286. CARD8 reqType;
  1287. BYTE pad;
  1288. CARD16 length B16;
  1289. Window window B32;
  1290. Atom property B32;
  1291. } xDeletePropertyReq;
  1292. typedef struct {
  1293. CARD8 reqType;
  1294. #if defined(__cplusplus) || defined(c_plusplus)
  1295. BOOL c_delete;
  1296. #else
  1297. BOOL delete;
  1298. #endif
  1299. CARD16 length B16;
  1300. Window window B32;
  1301. Atom property B32, type B32;
  1302. CARD32 longOffset B32;
  1303. CARD32 longLength B32;
  1304. } xGetPropertyReq;
  1305. typedef struct {
  1306. CARD8 reqType;
  1307. BYTE pad;
  1308. CARD16 length B16;
  1309. Window window B32;
  1310. Atom selection B32;
  1311. Time time B32;
  1312. } xSetSelectionOwnerReq;
  1313. typedef struct {
  1314. CARD8 reqType;
  1315. BYTE pad;
  1316. CARD16 length B16;
  1317. Window requestor B32;
  1318. Atom selection B32, target B32, property B32;
  1319. Time time B32;
  1320. } xConvertSelectionReq;
  1321. typedef struct {
  1322. CARD8 reqType;
  1323. BOOL propagate;
  1324. CARD16 length B16;
  1325. Window destination B32;
  1326. CARD32 eventMask B32;
  1327. xEvent event;
  1328. } xSendEventReq;
  1329. typedef struct {
  1330. CARD8 reqType;
  1331. BOOL ownerEvents;
  1332. CARD16 length B16;
  1333. Window grabWindow B32;
  1334. CARD16 eventMask B16;
  1335. BYTE pointerMode, keyboardMode;
  1336. Window confineTo B32;
  1337. Cursor cursor B32;
  1338. Time time B32;
  1339. } xGrabPointerReq;
  1340. typedef struct {
  1341. CARD8 reqType;
  1342. BOOL ownerEvents;
  1343. CARD16 length B16;
  1344. Window grabWindow B32;
  1345. CARD16 eventMask B16;
  1346. BYTE pointerMode, keyboardMode;
  1347. Window confineTo B32;
  1348. Cursor cursor B32;
  1349. CARD8 button;
  1350. BYTE pad;
  1351. CARD16 modifiers B16;
  1352. } xGrabButtonReq;
  1353. typedef struct {
  1354. CARD8 reqType;
  1355. CARD8 button;
  1356. CARD16 length B16;
  1357. Window grabWindow B32;
  1358. CARD16 modifiers B16;
  1359. CARD16 pad B16;
  1360. } xUngrabButtonReq;
  1361. typedef struct {
  1362. CARD8 reqType;
  1363. BYTE pad;
  1364. CARD16 length B16;
  1365. Cursor cursor B32;
  1366. Time time B32;
  1367. CARD16 eventMask B16;
  1368. CARD16 pad2 B16;
  1369. } xChangeActivePointerGrabReq;
  1370. typedef struct {
  1371. CARD8 reqType;
  1372. BOOL ownerEvents;
  1373. CARD16 length B16;
  1374. Window grabWindow B32;
  1375. Time time B32;
  1376. BYTE pointerMode, keyboardMode;
  1377. CARD16 pad B16;
  1378. } xGrabKeyboardReq;
  1379. typedef struct {
  1380. CARD8 reqType;
  1381. BOOL ownerEvents;
  1382. CARD16 length B16;
  1383. Window grabWindow B32;
  1384. CARD16 modifiers B16;
  1385. CARD8 key;
  1386. BYTE pointerMode, keyboardMode;
  1387. BYTE pad1, pad2, pad3;
  1388. } xGrabKeyReq;
  1389. typedef struct {
  1390. CARD8 reqType;
  1391. CARD8 key;
  1392. CARD16 length B16;
  1393. Window grabWindow B32;
  1394. CARD16 modifiers B16;
  1395. CARD16 pad B16;
  1396. } xUngrabKeyReq;
  1397. typedef struct {
  1398. CARD8 reqType;
  1399. CARD8 mode;
  1400. CARD16 length B16;
  1401. Time time B32;
  1402. } xAllowEventsReq;
  1403. typedef struct {
  1404. CARD8 reqType;
  1405. BYTE pad;
  1406. CARD16 length B16;
  1407. Window window B32;
  1408. Time start B32, stop B32;
  1409. } xGetMotionEventsReq;
  1410. typedef struct {
  1411. CARD8 reqType;
  1412. BYTE pad;
  1413. CARD16 length B16;
  1414. Window srcWid B32, dstWid B32;
  1415. INT16 srcX B16, srcY B16;
  1416. } xTranslateCoordsReq;
  1417. typedef struct {
  1418. CARD8 reqType;
  1419. BYTE pad;
  1420. CARD16 length B16;
  1421. Window srcWid B32, dstWid B32;
  1422. INT16 srcX B16, srcY B16;
  1423. CARD16 srcWidth B16, srcHeight B16;
  1424. INT16 dstX B16, dstY B16;
  1425. } xWarpPointerReq;
  1426. typedef struct {
  1427. CARD8 reqType;
  1428. CARD8 revertTo;
  1429. CARD16 length B16;
  1430. Window focus B32;
  1431. Time time B32;
  1432. } xSetInputFocusReq;
  1433. typedef struct {
  1434. CARD8 reqType;
  1435. BYTE pad;
  1436. CARD16 length B16;
  1437. Font fid B32;
  1438. CARD16 nbytes B16;
  1439. BYTE pad1, pad2; /* string follows on word boundary */
  1440. } xOpenFontReq;
  1441. typedef struct {
  1442. CARD8 reqType;
  1443. BOOL oddLength;
  1444. CARD16 length B16;
  1445. Font fid B32;
  1446. } xQueryTextExtentsReq;
  1447. typedef struct {
  1448. CARD8 reqType;
  1449. BYTE pad;
  1450. CARD16 length B16;
  1451. CARD16 maxNames B16;
  1452. CARD16 nbytes B16; /* followed immediately by string bytes */
  1453. } xListFontsReq;
  1454. typedef xListFontsReq xListFontsWithInfoReq;
  1455. typedef struct {
  1456. CARD8 reqType;
  1457. BYTE pad;
  1458. CARD16 length B16;
  1459. CARD16 nFonts B16;
  1460. BYTE pad1, pad2; /* LISTofSTRING8 follows on word boundary */
  1461. } xSetFontPathReq;
  1462. typedef struct {
  1463. CARD8 reqType;
  1464. CARD8 depth;
  1465. CARD16 length B16;
  1466. Pixmap pid B32;
  1467. Drawable drawable B32;
  1468. CARD16 width B16, height B16;
  1469. } xCreatePixmapReq;
  1470. typedef struct {
  1471. CARD8 reqType;
  1472. BYTE pad;
  1473. CARD16 length B16;
  1474. GContext gc B32;
  1475. Drawable drawable B32;
  1476. CARD32 mask B32;
  1477. } xCreateGCReq;
  1478. typedef struct {
  1479. CARD8 reqType;
  1480. BYTE pad;
  1481. CARD16 length B16;
  1482. GContext gc B32;
  1483. CARD32 mask B32;
  1484. } xChangeGCReq;
  1485. typedef struct {
  1486. CARD8 reqType;
  1487. BYTE pad;
  1488. CARD16 length B16;
  1489. GContext srcGC B32, dstGC B32;
  1490. CARD32 mask B32;
  1491. } xCopyGCReq;
  1492. typedef struct {
  1493. CARD8 reqType;
  1494. BYTE pad;
  1495. CARD16 length B16;
  1496. GContext gc B32;
  1497. CARD16 dashOffset B16;
  1498. CARD16 nDashes B16; /* length LISTofCARD8 of values following */
  1499. } xSetDashesReq;
  1500. typedef struct {
  1501. CARD8 reqType;
  1502. BYTE ordering;
  1503. CARD16 length B16;
  1504. GContext gc B32;
  1505. INT16 xOrigin B16, yOrigin B16;
  1506. } xSetClipRectanglesReq;
  1507. typedef struct {
  1508. CARD8 reqType;
  1509. BOOL exposures;
  1510. CARD16 length B16;
  1511. Window window B32;
  1512. INT16 x B16, y B16;
  1513. CARD16 width B16, height B16;
  1514. } xClearAreaReq;
  1515. typedef struct {
  1516. CARD8 reqType;
  1517. BYTE pad;
  1518. CARD16 length B16;
  1519. Drawable srcDrawable B32, dstDrawable B32;
  1520. GContext gc B32;
  1521. INT16 srcX B16, srcY B16, dstX B16, dstY B16;
  1522. CARD16 width B16, height B16;
  1523. } xCopyAreaReq;
  1524. typedef struct {
  1525. CARD8 reqType;
  1526. BYTE pad;
  1527. CARD16 length B16;
  1528. Drawable srcDrawable B32, dstDrawable B32;
  1529. GContext gc B32;
  1530. INT16 srcX B16, srcY B16, dstX B16, dstY B16;
  1531. CARD16 width B16, height B16;
  1532. CARD32 bitPlane B32;
  1533. } xCopyPlaneReq;
  1534. typedef struct {
  1535. CARD8 reqType;
  1536. BYTE coordMode;
  1537. CARD16 length B16;
  1538. Drawable drawable B32;
  1539. GContext gc B32;
  1540. } xPolyPointReq;
  1541. typedef xPolyPointReq xPolyLineReq; /* same request structure */
  1542. /* The following used for PolySegment, PolyRectangle, PolyArc, PolyFillRectangle, PolyFillArc */
  1543. typedef struct {
  1544. CARD8 reqType;
  1545. BYTE pad;
  1546. CARD16 length B16;
  1547. Drawable drawable B32;
  1548. GContext gc B32;
  1549. } xPolySegmentReq;
  1550. typedef xPolySegmentReq xPolyArcReq;
  1551. typedef xPolySegmentReq xPolyRectangleReq;
  1552. typedef xPolySegmentReq xPolyFillRectangleReq;
  1553. typedef xPolySegmentReq xPolyFillArcReq;
  1554. typedef struct _FillPolyReq {
  1555. CARD8 reqType;
  1556. BYTE pad;
  1557. CARD16 length B16;
  1558. Drawable drawable B32;
  1559. GContext gc B32;
  1560. BYTE shape;
  1561. BYTE coordMode;
  1562. CARD16 pad1 B16;
  1563. } xFillPolyReq;
  1564. typedef struct _PutImageReq {
  1565. CARD8 reqType;
  1566. CARD8 format;
  1567. CARD16 length B16;
  1568. Drawable drawable B32;
  1569. GContext gc B32;
  1570. CARD16 width B16, height B16;
  1571. INT16 dstX B16, dstY B16;
  1572. CARD8 leftPad;
  1573. CARD8 depth;
  1574. CARD16 pad B16;
  1575. } xPutImageReq;
  1576. typedef struct {
  1577. CARD8 reqType;
  1578. CARD8 format;
  1579. CARD16 length B16;
  1580. Drawable drawable B32;
  1581. INT16 x B16, y B16;
  1582. CARD16 width B16, height B16;
  1583. CARD32 planeMask B32;
  1584. } xGetImageReq;
  1585. /* the following used by PolyText8 and PolyText16 */
  1586. typedef struct {
  1587. CARD8 reqType;
  1588. CARD8 pad;
  1589. CARD16 length B16;
  1590. Drawable drawable B32;
  1591. GContext gc B32;
  1592. INT16 x B16, y B16; /* items (xTextElt) start after struct */
  1593. } xPolyTextReq;
  1594. typedef xPolyTextReq xPolyText8Req;
  1595. typedef xPolyTextReq xPolyText16Req;
  1596. typedef struct {
  1597. CARD8 reqType;
  1598. BYTE nChars;
  1599. CARD16 length B16;
  1600. Drawable drawable B32;
  1601. GContext gc B32;
  1602. INT16 x B16, y B16;
  1603. } xImageTextReq;
  1604. typedef xImageTextReq xImageText8Req;
  1605. typedef xImageTextReq xImageText16Req;
  1606. typedef struct {
  1607. CARD8 reqType;
  1608. BYTE alloc;
  1609. CARD16 length B16;
  1610. Colormap mid B32;
  1611. Window window B32;
  1612. VisualID visual B32;
  1613. } xCreateColormapReq;
  1614. typedef struct {
  1615. CARD8 reqType;
  1616. BYTE pad;
  1617. CARD16 length B16;
  1618. Colormap mid B32;
  1619. Colormap srcCmap B32;
  1620. } xCopyColormapAndFreeReq;
  1621. typedef struct {
  1622. CARD8 reqType;
  1623. BYTE pad;
  1624. CARD16 length B16;
  1625. Colormap cmap B32;
  1626. CARD16 red B16, green B16, blue B16;
  1627. CARD16 pad2 B16;
  1628. } xAllocColorReq;
  1629. typedef struct {
  1630. CARD8 reqType;
  1631. BYTE pad;
  1632. CARD16 length B16;
  1633. Colormap cmap B32;
  1634. CARD16 nbytes B16; /* followed by structure */
  1635. BYTE pad1, pad2;
  1636. } xAllocNamedColorReq;
  1637. typedef struct {
  1638. CARD8 reqType;
  1639. BOOL contiguous;
  1640. CARD16 length B16;
  1641. Colormap cmap B32;
  1642. CARD16 colors B16, planes B16;
  1643. } xAllocColorCellsReq;
  1644. typedef struct {
  1645. CARD8 reqType;
  1646. BOOL contiguous;
  1647. CARD16 length B16;
  1648. Colormap cmap B32;
  1649. CARD16 colors B16, red B16, green B16, blue B16;
  1650. } xAllocColorPlanesReq;
  1651. typedef struct {
  1652. CARD8 reqType;
  1653. BYTE pad;
  1654. CARD16 length B16;
  1655. Colormap cmap B32;
  1656. CARD32 planeMask B32;
  1657. } xFreeColorsReq;
  1658. typedef struct {
  1659. CARD8 reqType;
  1660. BYTE pad;
  1661. CARD16 length B16;
  1662. Colormap cmap B32;
  1663. } xStoreColorsReq;
  1664. typedef struct {
  1665. CARD8 reqType;
  1666. CARD8 flags; /* DoRed, DoGreen, DoBlue, as in xColorItem */
  1667. CARD16 length B16;
  1668. Colormap cmap B32;
  1669. CARD32 pixel B32;
  1670. CARD16 nbytes B16; /* number of name string bytes following structure */
  1671. BYTE pad1, pad2;
  1672. } xStoreNamedColorReq;
  1673. typedef struct {
  1674. CARD8 reqType;
  1675. BYTE pad;
  1676. CARD16 length B16;
  1677. Colormap cmap B32;
  1678. } xQueryColorsReq;
  1679. typedef struct { /* followed by string of length len */
  1680. CARD8 reqType;
  1681. BYTE pad;
  1682. CARD16 length B16;
  1683. Colormap cmap B32;
  1684. CARD16 nbytes B16; /* number of string bytes following structure*/
  1685. BYTE pad1, pad2;
  1686. } xLookupColorReq;
  1687. typedef struct {
  1688. CARD8 reqType;
  1689. BYTE pad;
  1690. CARD16 length B16;
  1691. Cursor cid B32;
  1692. Pixmap source B32, mask B32;
  1693. CARD16 foreRed B16, foreGreen B16, foreBlue B16;
  1694. CARD16 backRed B16, backGreen B16, backBlue B16;
  1695. CARD16 x B16, y B16;
  1696. } xCreateCursorReq;
  1697. typedef struct {
  1698. CARD8 reqType;
  1699. BYTE pad;
  1700. CARD16 length B16;
  1701. Cursor cid B32;
  1702. Font source B32, mask B32;
  1703. CARD16 sourceChar B16, maskChar B16;
  1704. CARD16 foreRed B16, foreGreen B16, foreBlue B16;
  1705. CARD16 backRed B16, backGreen B16, backBlue B16;
  1706. } xCreateGlyphCursorReq;
  1707. typedef struct {
  1708. CARD8 reqType;
  1709. BYTE pad;
  1710. CARD16 length B16;
  1711. Cursor cursor B32;
  1712. CARD16 foreRed B16, foreGreen B16, foreBlue B16;
  1713. CARD16 backRed B16, backGreen B16, backBlue B16;
  1714. } xRecolorCursorReq;
  1715. typedef struct {
  1716. CARD8 reqType;
  1717. #if defined(__cplusplus) || defined(c_plusplus)
  1718. CARD8 c_class;
  1719. #else
  1720. CARD8 class;
  1721. #endif
  1722. CARD16 length B16;
  1723. Drawable drawable B32;
  1724. CARD16 width B16, height B16;
  1725. } xQueryBestSizeReq;
  1726. typedef struct {
  1727. CARD8 reqType;
  1728. BYTE pad;
  1729. CARD16 length B16;
  1730. CARD16 nbytes B16; /* number of string bytes following structure */
  1731. BYTE pad1, pad2;
  1732. } xQueryExtensionReq;
  1733. typedef struct {
  1734. CARD8 reqType;
  1735. CARD8 numKeyPerModifier;
  1736. CARD16 length B16;
  1737. } xSetModifierMappingReq;
  1738. typedef struct {
  1739. CARD8 reqType;
  1740. CARD8 nElts; /* how many elements in the map */
  1741. CARD16 length B16;
  1742. } xSetPointerMappingReq;
  1743. typedef struct {
  1744. CARD8 reqType;
  1745. BYTE pad;
  1746. CARD16 length B16;
  1747. KeyCode firstKeyCode;
  1748. CARD8 count;
  1749. CARD16 pad1 B16;
  1750. } xGetKeyboardMappingReq;
  1751. typedef struct {
  1752. CARD8 reqType;
  1753. CARD8 keyCodes;
  1754. CARD16 length B16;
  1755. KeyCode firstKeyCode;
  1756. CARD8 keySymsPerKeyCode;
  1757. CARD16 pad1 B16;
  1758. } xChangeKeyboardMappingReq;
  1759. typedef struct {
  1760. CARD8 reqType;
  1761. BYTE pad;
  1762. CARD16 length B16;
  1763. CARD32 mask B32;
  1764. } xChangeKeyboardControlReq;
  1765. typedef struct {
  1766. CARD8 reqType;
  1767. INT8 percent; /* -100 to 100 */
  1768. CARD16 length B16;
  1769. } xBellReq;
  1770. typedef struct {
  1771. CARD8 reqType;
  1772. BYTE pad;
  1773. CARD16 length B16;
  1774. INT16 accelNum B16, accelDenum B16;
  1775. INT16 threshold B16;
  1776. BOOL doAccel, doThresh;
  1777. } xChangePointerControlReq;
  1778. typedef struct {
  1779. CARD8 reqType;
  1780. BYTE pad;
  1781. CARD16 length B16;
  1782. INT16 timeout B16, interval B16;
  1783. BYTE preferBlank, allowExpose;
  1784. CARD16 pad2 B16;
  1785. } xSetScreenSaverReq;
  1786. typedef struct {
  1787. CARD8 reqType;
  1788. BYTE mode;
  1789. CARD16 length B16;
  1790. CARD8 hostFamily;
  1791. BYTE pad;
  1792. CARD16 hostLength B16;
  1793. } xChangeHostsReq;
  1794. typedef struct {
  1795. CARD8 reqType;
  1796. BYTE pad;
  1797. CARD16 length B16;
  1798. } xListHostsReq;
  1799. typedef struct {
  1800. CARD8 reqType;
  1801. BYTE mode;
  1802. CARD16 length B16;
  1803. } xChangeModeReq;
  1804. typedef xChangeModeReq xSetAccessControlReq;
  1805. typedef xChangeModeReq xSetCloseDownModeReq;
  1806. typedef xChangeModeReq xForceScreenSaverReq;
  1807. typedef struct { /* followed by LIST of ATOM */
  1808. CARD8 reqType;
  1809. BYTE pad;
  1810. CARD16 length B16;
  1811. Window window B32;
  1812. CARD16 nAtoms B16;
  1813. INT16 nPositions B16;
  1814. } xRotatePropertiesReq;
  1815. /* Reply codes */
  1816. #define X_Reply 1 /* Normal reply */
  1817. #define X_Error 0 /* Error */
  1818. /* Request codes */
  1819. #define X_CreateWindow 1
  1820. #define X_ChangeWindowAttributes 2
  1821. #define X_GetWindowAttributes 3
  1822. #define X_DestroyWindow 4
  1823. #define X_DestroySubwindows 5
  1824. #define X_ChangeSaveSet 6
  1825. #define X_ReparentWindow 7
  1826. #define X_MapWindow 8
  1827. #define X_MapSubwindows 9
  1828. #define X_UnmapWindow 10
  1829. #define X_UnmapSubwindows 11
  1830. #define X_ConfigureWindow 12
  1831. #define X_CirculateWindow 13
  1832. #define X_GetGeometry 14
  1833. #define X_QueryTree 15
  1834. #define X_InternAtom 16
  1835. #define X_GetAtomName 17
  1836. #define X_ChangeProperty 18
  1837. #define X_DeleteProperty 19
  1838. #define X_GetProperty 20
  1839. #define X_ListProperties 21
  1840. #define X_SetSelectionOwner 22
  1841. #define X_GetSelectionOwner 23
  1842. #define X_ConvertSelection 24
  1843. #define X_SendEvent 25
  1844. #define X_GrabPointer 26
  1845. #define X_UngrabPointer 27
  1846. #define X_GrabButton 28
  1847. #define X_UngrabButton 29
  1848. #define X_ChangeActivePointerGrab 30
  1849. #define X_GrabKeyboard 31
  1850. #define X_UngrabKeyboard 32
  1851. #define X_GrabKey 33
  1852. #define X_UngrabKey 34
  1853. #define X_AllowEvents 35
  1854. #define X_GrabServer 36
  1855. #define X_UngrabServer 37
  1856. #define X_QueryPointer 38
  1857. #define X_GetMotionEvents 39
  1858. #define X_TranslateCoords 40
  1859. #define X_WarpPointer 41
  1860. #define X_SetInputFocus 42
  1861. #define X_GetInputFocus 43
  1862. #define X_QueryKeymap 44
  1863. #define X_OpenFont 45
  1864. #define X_CloseFont 46
  1865. #define X_QueryFont 47
  1866. #define X_QueryTextExtents 48
  1867. #define X_ListFonts 49
  1868. #define X_ListFontsWithInfo 50
  1869. #define X_SetFontPath 51
  1870. #define X_GetFontPath 52
  1871. #define X_CreatePixmap 53
  1872. #define X_FreePixmap 54
  1873. #define X_CreateGC 55
  1874. #define X_ChangeGC 56
  1875. #define X_CopyGC 57
  1876. #define X_SetDashes 58
  1877. #define X_SetClipRectangles 59
  1878. #define X_FreeGC 60
  1879. #define X_ClearArea 61
  1880. #define X_CopyArea 62
  1881. #define X_CopyPlane 63
  1882. #define X_PolyPoint 64
  1883. #define X_PolyLine 65
  1884. #define X_PolySegment 66
  1885. #define X_PolyRectangle 67
  1886. #define X_PolyArc 68
  1887. #define X_FillPoly 69
  1888. #define X_PolyFillRectangle 70
  1889. #define X_PolyFillArc 71
  1890. #define X_PutImage 72
  1891. #define X_GetImage 73
  1892. #define X_PolyText8 74
  1893. #define X_PolyText16 75
  1894. #define X_ImageText8 76
  1895. #define X_ImageText16 77
  1896. #define X_CreateColormap 78
  1897. #define X_FreeColormap 79
  1898. #define X_CopyColormapAndFree 80
  1899. #define X_InstallColormap 81
  1900. #define X_UninstallColormap 82
  1901. #define X_ListInstalledColormaps 83
  1902. #define X_AllocColor 84
  1903. #define X_AllocNamedColor 85
  1904. #define X_AllocColorCells 86
  1905. #define X_AllocColorPlanes 87
  1906. #define X_FreeColors 88
  1907. #define X_StoreColors 89
  1908. #define X_StoreNamedColor 90
  1909. #define X_QueryColors 91
  1910. #define X_LookupColor 92
  1911. #define X_CreateCursor 93
  1912. #define X_CreateGlyphCursor 94
  1913. #define X_FreeCursor 95
  1914. #define X_RecolorCursor 96
  1915. #define X_QueryBestSize 97
  1916. #define X_QueryExtension 98
  1917. #define X_ListExtensions 99
  1918. #define X_ChangeKeyboardMapping 100
  1919. #define X_GetKeyboardMapping 101
  1920. #define X_ChangeKeyboardControl 102
  1921. #define X_GetKeyboardControl 103
  1922. #define X_Bell 104
  1923. #define X_ChangePointerControl 105
  1924. #define X_GetPointerControl 106
  1925. #define X_SetScreenSaver 107
  1926. #define X_GetScreenSaver 108
  1927. #define X_ChangeHosts 109
  1928. #define X_ListHosts 110
  1929. #define X_SetAccessControl 111
  1930. #define X_SetCloseDownMode 112
  1931. #define X_KillClient 113
  1932. #define X_RotateProperties 114
  1933. #define X_ForceScreenSaver 115
  1934. #define X_SetPointerMapping 116
  1935. #define X_GetPointerMapping 117
  1936. #define X_SetModifierMapping 118
  1937. #define X_GetModifierMapping 119
  1938. #define X_NoOperation 127
  1939. /* restore these definitions back to the typedefs in X.h */
  1940. #undef Window
  1941. #undef Drawable
  1942. #undef Font
  1943. #undef Pixmap
  1944. #undef Cursor
  1945. #undef Colormap
  1946. #undef GContext
  1947. #undef Atom
  1948. #undef VisualID
  1949. #undef Time
  1950. #undef KeyCode
  1951. #undef KeySym
  1952. #endif /* XPROTO_H */