PageRenderTime 31ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/nx-3.5.0/nx-X11/include/DPS/XDPSproto.h

#
C Header | 391 lines | 286 code | 50 blank | 55 comment | 0 complexity | f868bce9386217aa1fd783c7c69e3a25 MD5 | raw file
Possible License(s): BSD-3-Clause, GPL-2.0, LGPL-2.0
  1. /*
  2. XDPSproto.h -- protocol requests constants and alignment values,
  3. analogous to Xproto.h
  4. Copyright 1988-1994 Adobe Systems Incorporated.
  5. Portions Copyright 1988, 1989 Digital Equipment Corporation.
  6. Permission to use, copy, modify, and distribute this software and
  7. its documentation for any purpose and without fee is hereby granted,
  8. provided that the above copyright notices appear in all copies and
  9. that both those copyright notices and this permission notice appear
  10. in supporting documentation, and that the names of Adobe Systems
  11. Incorporated and Digital Equipment Corporation not be used in
  12. advertising or publicity pertaining to distribution of the software
  13. without specific, written prior permission. Adobe Systems Incorporated
  14. and Digital Equipment Corporation make no representations about the
  15. suitability of this software for any purpose. It is provided "as is"
  16. without express or implied warranty.
  17. ADOBE SYSTEMS INCORPORATED AND DIGITAL EQUIPMENT CORPORATION DISCLAIM
  18. ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
  19. WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL ADOBE
  20. SYSTEMS INCORPORATED AND DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR
  21. ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  22. WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  23. ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
  24. OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  25. Author: Adobe Systems Incorporated and Digital Equipment Corporation
  26. */
  27. #ifndef _XDPSproto_h
  28. #define _XDPSproto_h
  29. #include <X11/Xmd.h>
  30. /* For the purpose of the structure definitions in this file, we must
  31. redefine the following types in terms of Xmd.h's types, which may
  32. include bit fields. All of these are #undef'd at the end of this
  33. file, restoring the typedefs in X.h. */
  34. #define Window CARD32
  35. #define Drawable CARD32
  36. #define Font CARD32
  37. #define Pixmap CARD32
  38. #define Cursor CARD32
  39. #define Colormap CARD32
  40. #define GContext CARD32
  41. #define Atom CARD32
  42. #define VisualID CARD32
  43. #define Time CARD32
  44. #define KeyCode CARD8
  45. #define KeySym CARD32
  46. /* NOTE: The Digital UWS 2.2 DECWindows/DPS server uses "DPSExtension"
  47. for the name of the extension. The name registered with
  48. the X Consortium is "Adobe-DPS-Extension". Your client
  49. should query both names. */
  50. #define DPSNAME "Adobe-DPS-Extension"
  51. #define DECDPSNAME "DPSExtension"
  52. #define DPSPROTO_V09 9 /* L2-DPS Rel 1.0 */
  53. #define DPSPROTO_V08 8 /* L1-DPS */
  54. #define DPSPROTO_OLDEST DPSPROTO_V08
  55. #ifndef DPSPROTOCOLVERSION
  56. #define DPSPROTOCOLVERSION DPSPROTO_V09
  57. #endif
  58. #define CONTEXTXID CARD32
  59. #define SPACEXID CARD32
  60. #ifndef BYTESPEROUTPUTEVENT
  61. #define BYTESPEROUTPUTEVENT 24
  62. #endif /* Might be fewer for wide architectures with messy padding */
  63. /*
  64. * Requests:
  65. */
  66. #define X_PSInit 1
  67. #define X_PSCreateContext 2
  68. #define X_PSCreateSpace 3
  69. #define X_PSGiveInput 4
  70. #define X_PSGetStatus 5
  71. #define X_PSDestroySpace 6
  72. #define X_PSReset 7
  73. #define X_PSNotifyContext 8
  74. #define X_PSCreateContextFromID 9
  75. #define X_PSXIDFromContext 10
  76. #define X_PSContextFromXID 11
  77. #define X_PSSetStatusMask 12
  78. #define X_PSCreateSecureContext 13 /* L2-DPS/PROTO 9 addition */
  79. #define X_PSNotifyWhenReady 14 /* L2-DPS/PROTO 9 addition */
  80. #define PSLASTREQUEST X_PSNotifyWhenReady
  81. #define PSLASTREQUEST_P8 X_PSSetStatusMask
  82. typedef struct _PSInit {
  83. CARD8 reqType; /* always DPSReqCode */
  84. CARD8 dpsReqType; /* always X_PSInit */
  85. CARD16 length B16; /* length of request */
  86. CARD32 libraryversion B32; /* version of protocol implementation */
  87. } xPSInitReq;
  88. #define sz_xPSInitReq 8
  89. typedef struct _PSCreateContext {
  90. CARD8 reqType; /* always DPSReqCode */
  91. CARD8 dpsReqType; /* always X_PSCreateContext */
  92. CARD16 length B16; /* length of request */
  93. CONTEXTXID cxid B32; /* XID for context */
  94. SPACEXID sxid B32; /* XID for Space to use for new context */
  95. Drawable drawable B32; /* Drawable for new context */
  96. GContext gc B32; /* GC for new context */
  97. INT16 x B16; /* x, initial origin of context's device */
  98. INT16 y B16; /* y, initial origin of context's device */
  99. CARD32 eventmask B32; /* events that context is interested in */
  100. Colormap cmap B32; /* colormap for this context */
  101. CARD32 redmax B32; /* color cube */
  102. CARD32 redmult B32;
  103. CARD32 greenmax B32;
  104. CARD32 greenmult B32;
  105. CARD32 bluemax B32;
  106. CARD32 bluemult B32;
  107. CARD32 colorbase B32;
  108. CARD32 graymax B32; /* gray ramp */
  109. CARD32 graymult B32;
  110. CARD32 graybase B32;
  111. CARD32 actual B32; /* actual colors, if any */
  112. } xPSCreateContextReq;
  113. #define sz_xPSCreateContextReq 76
  114. typedef struct _PSCreateSpace {
  115. CARD8 reqType; /* always DPSReqCode */
  116. CARD8 dpsReqType; /* always X_PSCreateSpace */
  117. CARD16 length B16;
  118. SPACEXID sxid B32; /* Space to be created */
  119. } xPSCreateSpaceReq;
  120. #define sz_xPSCreateSpaceReq 8
  121. typedef struct _PSGiveInput {
  122. CARD8 reqType; /* always DPSReqCode */
  123. CARD8 dpsReqType; /* always X_PSGiveInput */
  124. CARD16 length B16; /* length of request */
  125. CARD16 nunits B16; /* number of bytes in following string */
  126. CARD16 pad B16;
  127. CONTEXTXID cxid B32; /* Context for input. */
  128. } xPSGiveInputReq;
  129. #define sz_xPSGiveInputReq 12
  130. typedef struct _PSGetStatus {
  131. CARD8 reqType; /* always DPSReqCode */
  132. CARD8 dpsReqType; /* always X_PSGetStatus */
  133. CARD16 length B16;
  134. CONTEXTXID cxid B32;
  135. CARD32 notifyIfChange B32; /* unused */
  136. } xPSGetStatusReq;
  137. #define sz_xPSGetStatusReq 12
  138. typedef struct _PSDestroySpace {
  139. CARD8 reqType; /* always DPSReqCode */
  140. CARD8 dpsReqType; /* always X_PSDestroySpace */
  141. CARD16 length B16;
  142. SPACEXID sxid B32;
  143. } xPSDestroySpaceReq;
  144. #define sz_xPSDestroySpaceReq 8
  145. typedef struct _PSReset {
  146. CARD8 reqType; /* always DPSReqCode */
  147. CARD8 dpsReqType; /* always X_PSReset */
  148. CARD16 length B16;
  149. CONTEXTXID cxid B32;
  150. } xPSResetReq;
  151. #define sz_xPSResetReq 8
  152. typedef struct _PSNotifyContext {
  153. CARD8 reqType; /* always DPSReqCode */
  154. CARD8 dpsReqType; /* always X_PSNotifyContext */
  155. CARD16 length B16;
  156. CONTEXTXID cxid B32;
  157. CARD8 notifyType; /* see XDPS.h */
  158. CARD8 pad1;
  159. CARD8 pad2;
  160. CARD8 pad3;
  161. } xPSNotifyContextReq;
  162. #define sz_xPSNotifyContextReq 12
  163. typedef struct _PSCreateContextFromID {
  164. CARD8 reqType; /* always DPSReqCode */
  165. CARD8 dpsReqType; /* always X_PSCreateContextFromID */
  166. CARD16 length B16;
  167. CARD32 cpsid B32; /* the PostScript context ID */
  168. CONTEXTXID cxid B32; /* resource ID to associate with cpsid */
  169. } xPSCreateContextFromIDReq;
  170. #define sz_xPSCreateContextFromIDReq 12
  171. typedef struct _PSXIDFromContext {
  172. CARD8 reqType; /* always DPSReqCode */
  173. CARD8 dpsReqType; /* always X_PSXIDFromContext */
  174. CARD16 length B16;
  175. CARD32 cpsid B32;
  176. } xPSXIDFromContextReq;
  177. #define sz_xPSXIDFromContextReq 8
  178. typedef struct _PSContextFromXID {
  179. CARD8 reqType; /* always DPSReqCode */
  180. CARD8 dpsReqType; /* always X_PSContextFromXID */
  181. CARD16 length B16;
  182. CONTEXTXID cxid B32;
  183. } xPSContextFromXIDReq;
  184. #define sz_xPSContextFromXIDReq 8
  185. typedef struct _PSSetStatusMask {
  186. CARD8 reqType; /* always DPSReqCode */
  187. CARD8 dpsReqType; /* always X_PSContextFromXID */
  188. CARD16 length B16;
  189. CONTEXTXID cxid B32;
  190. CARD32 enableMask B32;
  191. CARD32 disableMask B32;
  192. CARD32 nextMask B32;
  193. } xPSSetStatusMaskReq;
  194. #define sz_xPSSetStatusMaskReq 20
  195. /* L2-DPS/PROTO 9 addition */
  196. typedef struct _PSCreateContext xPSCreateSecureContextReq;
  197. #define sz_xPSCreateSecureContextReq sz_xPSCreateContextReq
  198. /* L2-DPS/PROTO 9 addition */
  199. typedef struct _PSNotifyWhenReady {
  200. CARD8 reqType; /* always DPSReqCode */
  201. CARD8 dpsReqType; /* always X_PSNotifyWhenReady */
  202. CARD16 length B16;
  203. CONTEXTXID cxid B32;
  204. INT32 val1 B32;
  205. INT32 val2 B32;
  206. INT32 val3 B32;
  207. INT32 val4 B32;
  208. } xPSNotifyWhenReadyReq;
  209. #define sz_xPSNotifyWhenReadyReq 24
  210. /*
  211. * Replies:
  212. */
  213. typedef struct {
  214. BYTE type; /* X_Reply */
  215. BYTE pad;
  216. CARD16 sequenceNumber B16; /* of last request received by server */
  217. CARD32 length B32; /* 4 byte quantities beyond size of GenericReply */
  218. CARD32 cpsid B32;
  219. CARD32 pad1 B32;
  220. CARD32 pad2 B32;
  221. CARD32 pad3 B32;
  222. CARD32 pad4 B32;
  223. CARD32 pad5 B32;
  224. } xPSCreateContextReply; /* use same reply for CreateSecureContext */
  225. typedef struct {
  226. BYTE type; /* X_Reply */
  227. BYTE status; /* see XDPS.h */
  228. CARD16 sequenceNumber B16; /* of last request received by server */
  229. CARD32 length B32; /* 4 byte quantities beyond size of GenericReply */
  230. CARD32 pad0 B32;
  231. CARD32 pad1 B32;
  232. CARD32 pad2 B32;
  233. CARD32 pad3 B32;
  234. CARD32 pad4 B32;
  235. CARD32 pad5 B32;
  236. } xPSGetStatusReply;
  237. typedef struct {
  238. BYTE type; /* X_Reply */
  239. BYTE pad;
  240. CARD16 sequenceNumber B16; /* of last request received by server */
  241. CARD32 length B32; /* 4 byte quantities beyond size of GenericReply */
  242. SPACEXID sxid B32;
  243. CARD32 pad1 B32;
  244. CARD32 pad2 B32;
  245. CARD32 pad3 B32;
  246. CARD32 pad4 B32;
  247. CARD32 pad5 B32;
  248. } xPSCreateContextFromIDReply;
  249. typedef struct {
  250. BYTE type; /* X_Reply */
  251. BYTE pad;
  252. CARD16 sequenceNumber B16; /* of last request received by server */
  253. CARD32 length B32; /* 4 byte quantities beyond size of GenericReply */
  254. CONTEXTXID cxid B32;
  255. SPACEXID sxid B32;
  256. CARD32 pad2 B32;
  257. CARD32 pad3 B32;
  258. CARD32 pad4 B32;
  259. CARD32 pad5 B32;
  260. } xPSXIDFromContextReply;
  261. typedef struct {
  262. BYTE type; /* X_Reply */
  263. BYTE pad;
  264. CARD16 sequenceNumber B16; /* of last request received by server */
  265. CARD32 length B32; /* 4 byte quantities beyond size of GenericReply */
  266. CARD32 cpsid B32;
  267. CARD32 pad1 B32;
  268. CARD32 pad2 B32;
  269. CARD32 pad3 B32;
  270. CARD32 pad4 B32;
  271. CARD32 pad5 B32;
  272. } xPSContextFromXIDReply;
  273. typedef struct {
  274. BYTE type; /* X_Reply */
  275. BYTE pad;
  276. CARD16 sequenceNumber B16; /* of last request received by server */
  277. CARD32 length B32; /* 4 byte quantities beyond size of GenericReply */
  278. CARD32 serverversion B32; /* version of protocol implementation */
  279. CARD32 preferredNumberFormat B32; /* that the server wants to use */
  280. CARD32 floatingNameLength B32; /* length of name of native floating fmt */
  281. CARD32 pad1 B32;
  282. CARD32 pad2 B32;
  283. CARD32 pad3 B32;
  284. } xPSInitReply; /* Followed by name of native floating fmt. */
  285. /*
  286. * Events:
  287. */
  288. /* NOTE: The useful data in DPS extension events must fit inside
  289. of the data portion of a ClientMessage event for the sake of
  290. DPS NX */
  291. typedef struct {
  292. BYTE type;
  293. CARD8 length;
  294. CARD16 sequenceNumber B16;
  295. CONTEXTXID cxid B32;
  296. CARD8 data[BYTESPEROUTPUTEVENT];
  297. } PSOutputEvent;
  298. typedef struct {
  299. BYTE type;
  300. BYTE status; /* see XDPS.h */
  301. CARD16 sequenceNumber B16;
  302. CONTEXTXID cxid B32;
  303. CARD32 pad1 B32;
  304. CARD32 pad2 B32;
  305. CARD32 pad3 B32;
  306. CARD32 pad4 B32;
  307. CARD32 pad5 B32;
  308. CARD32 pad6 B32;
  309. } PSStatusEvent;
  310. /* L2-DPS/PROTO 9 addition */
  311. typedef struct {
  312. BYTE type;
  313. BYTE pad;
  314. CARD16 sequenceNumber B16;
  315. CONTEXTXID cxid B32;
  316. INT32 val1 B32;
  317. INT32 val2 B32;
  318. INT32 val3 B32;
  319. INT32 val4 B32;
  320. CARD32 pad1 B32;
  321. CARD32 pad2 B32;
  322. } PSReadyEvent;
  323. /* restore these definitions back to the typedefs in X.h */
  324. #undef Window
  325. #undef Drawable
  326. #undef Font
  327. #undef Pixmap
  328. #undef Cursor
  329. #undef Colormap
  330. #undef GContext
  331. #undef Atom
  332. #undef VisualID
  333. #undef Time
  334. #undef KeyCode
  335. #undef KeySym
  336. #endif /* _XDPSproto_h */