PageRenderTime 41ms CodeModel.GetById 13ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
C Header | 304 lines | 171 code | 83 blank | 50 comment | 2 complexity | 367ad82b9fe50c8b01e5ac7057842edf MD5 | raw file
Possible License(s): BSD-3-Clause, GPL-2.0, LGPL-2.0
  1. /*
  2. * XDPSlib.h - client header file for DPS library. This file describes the
  3. * Xlib interface to the Display Postscript extension. It should be used only
  4. * by that interface and by code that actually uses this interface (e.g., the
  5. * client library interface).
  6. *
  7. * Copyright (C) 1988-1994 by Adobe Systems Incorporated and Digital Equipment
  8. * Corporation
  9. * All rights reserved.
  10. *
  11. * Permission to use, copy, modify, and distribute this software and
  12. * its documentation for any purpose and without fee is hereby granted,
  13. * provided that the above copyright notices appear in all copies and
  14. * that both those copyright notices and this permission notice appear
  15. * in supporting documentation, and that the names of Adobe Systems
  16. * Incorporated and Digital Equipment Corporation not be used in
  17. * advertising or publicity pertaining to distribution of the software
  18. * without specific, written prior permission. Adobe Systems Incorporated
  19. * and Digital Equipment Corporation make no representations about the
  20. * suitability of this software for any purpose. It is provided "as is"
  21. * without express or implied warranty.
  22. *
  23. * ADOBE SYSTEMS INCORPORATED AND DIGITAL EQUIPMENT CORPORATION DISCLAIM
  24. * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
  25. * WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL ADOBE
  26. * SYSTEMS INCORPORATED AND DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR
  27. * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  28. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  29. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
  30. * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  31. *
  32. * PostScript, Display PostScript, and Adobe are trademarks of Adobe Systems
  33. * Incorporated registered in the U.S.A. and other countries.
  34. *
  35. * Author: Adobe Systems Incorporated and Digital Equipment Corporation
  36. */
  37. /* $XFree86$ */
  38. #ifndef _XDPSlib_h
  39. #define _XDPSlib_h
  40. #undef _XEVENT_
  41. #include <X11/Xlib.h>
  42. #include <DPS/XDPS.h>
  43. #include <X11/Xutil.h>
  44. /*
  45. * Default standard colormap type.
  46. */
  47. #define DefaultStdCMap ((XStandardColormap *) -1)
  48. /*
  49. * event masks defined for convenience
  50. */
  51. #define XDPSL_ALL_EVENTS \
  52. (PSRUNNINGMASK|PSNEEDSINPUTMASK|PSZOMBIEMASK|PSFROZENMASK)
  53. typedef enum {
  54. csdps_not,
  55. csdps_noop,
  56. csdps_output,
  57. csdps_output_with_len,
  58. csdps_status,
  59. csdps_ready /* L2-DPS/PROTO 9 addition */
  60. } CSDPSFakeEventTypes;
  61. typedef enum {
  62. not_pserror,
  63. pserror_badcontext,
  64. pserror_badspace,
  65. pserror_abort
  66. } XDPSLPSErrors;
  67. #define DPSCAP_SYNCMASK_NONE 0x00
  68. #define DPSCAP_SYNCMASK_SYNC (1<<0)
  69. #define DPSCAP_SYNCMASK_RECONCILE (1<<1)
  70. #define DPSCAP_SYNCMASK_BUFFER (1<<2)
  71. #define DPSCAP_SYNCMASK_DFLT DPSCAP_SYNCMASK_RECONCILE
  72. typedef void (*XDPSLEventHandler)(XEvent *event);
  73. #if defined(__cplusplus) || defined(c_plusplus)
  74. extern "C" {
  75. #endif
  76. /*
  77. * XDPSLInit returns the first event number for the extension.
  78. */
  79. extern int XDPSLInit(Display *dpy,
  80. int *numberType_return,
  81. char **floatingName_return);
  82. extern ContextXID XDPSLCreateContext(Display *dpy,
  83. SpaceXID sxid,
  84. Drawable drawable,
  85. GC gc,
  86. int x, int y,
  87. unsigned int eventMask,
  88. XStandardColormap *grayRamp,
  89. XStandardColormap *colorCube,
  90. unsigned int actual,
  91. ContextPSID *cpsid_return,
  92. Bool secure); /* L2-DPS/PROTO 9 */
  93. extern ContextXID XDPSLCreateContextAndSpace(Display *dpy,
  94. Drawable drawable,
  95. GC gc,
  96. int x, int y,
  97. unsigned int eventMask,
  98. XStandardColormap *grayRamp,
  99. XStandardColormap *colorCube,
  100. unsigned int actual,
  101. ContextPSID *cpsid_return,
  102. SpaceXID *sxid_return,
  103. Bool secure); /* L2-DPS/PROTO 9 */
  104. extern SpaceXID XDPSLCreateSpace(Display *dpy);
  105. extern void XDPSLGiveInput(Display *dpy, ContextXID cxid,
  106. char *data, int length);
  107. extern int XDPSLGetStatus(Display *dpy, ContextXID cxid);
  108. extern void XDPSLDestroySpace(Display *dpy, SpaceXID sxid);
  109. extern void XDPSLReset(Display *dpy, ContextXID cxid);
  110. extern void XDPSLNotifyContext(Display *dpy, ContextXID cxid, int type);
  111. extern ContextXID XDPSLCreateContextFromID(Display *dpy,
  112. ContextPSID cpsid,
  113. SpaceXID *sxid_return);
  114. extern Status XDPSLIDFromContext(Display *dpy,
  115. ContextPSID cpsid,
  116. ContextXID *cxid_return,
  117. SpaceXID *sxid_return);
  118. /* Returns 1 on success, 0 on failure (cpsid not a valid context). */
  119. extern ContextPSID XDPSLContextFromXID(Display *dpy, ContextXID cxid);
  120. extern void XDPSLSetStatusMask(Display *dpy, ContextXID cxid,
  121. unsigned int enableMask,
  122. unsigned int disableMask,
  123. unsigned int nextMask);
  124. extern XExtCodes *XDPSLGetCodes(Display *dpy);
  125. extern void XDPSLSetTextEventHandler(Display *dpy,
  126. XDPSLEventHandler proc);
  127. extern void XDPSLCallOutputEventHandler(Display *dpy, XEvent *event);
  128. extern void XDPSLSetStatusEventHandler(Display *dpy,
  129. XDPSLEventHandler proc);
  130. extern void XDPSLCallStatusEventHandler(Display *dpy, XEvent *event);
  131. extern void XDPSLInitDisplayFlags(Display *dpy);
  132. extern Bool XDPSLGetPassEventsFlag(Display *dpy);
  133. extern void XDPSLSetPassEventsFlag(Display *dpy, Bool flag);
  134. extern Bool XDPSLGetWrapWaitingFlag(Display *dpy);
  135. extern void XDPSLSetWrapWaitingFlag(Display *dpy, Bool flag);
  136. /* L2-DPS/PROTO 9 additions */
  137. extern void XDPSLNotifyWhenReady(Display *dpy, ContextXID cxid, int val[4]);
  138. extern XDPSLPSErrors XDPSLTestErrorCode(Display *dpy, int ecode);
  139. extern int XDPSLGetVersion(Display *dpy);
  140. extern void XDPSLSetReadyEventHandler(Display *dpy,
  141. XDPSLEventHandler proc);
  142. extern void XDPSLCallReadyEventHandler(Display *dpy, XEvent *event);
  143. /* DPS NX additions */
  144. extern char * XDPSLSetAgentName(Display *dpy, char *name, int deflt);
  145. extern void XDPSLSetCodes(Display *dpy, XExtCodes *codes);
  146. extern Display * XDPSLGetShunt(Display *dpy_in);
  147. extern void XDPSLSetShunt(Display *dpy_in, Display *dpy_out);
  148. extern void XDPSLSetVersion(Display *dpy, unsigned ver);
  149. extern void XDPSLSetClientMessageHandler(Display *dpy);
  150. extern CSDPSFakeEventTypes XDPSLGetCSDPSFakeEventType(Display *dpy,
  151. XEvent *event);
  152. extern Bool XDPSLDispatchCSDPSFakeEvent(Display *dpy,
  153. XEvent *event, CSDPSFakeEventTypes t);
  154. extern void XDPSLGetCSDPSStatus(Display *dpy,
  155. XEvent *event,
  156. void **ret_ctxt,
  157. int *ret_status);
  158. extern void XDPSLSetXErrorConvertProc(Display *dpy);
  159. extern void XDPSLCAPNotify(Display *xdpy,
  160. ContextXID cxid,
  161. unsigned int ntype,
  162. unsigned int data,
  163. unsigned int extra);
  164. extern void XDPSLSync(Display *xdpy);
  165. extern void *XDPSLEnumerateEvents(Display *dpy,
  166. XEvent *event,
  167. Bool (*predicate)(Display *pdpy,
  168. XEvent *ev,
  169. char *a),
  170. char *arg,
  171. void *next);
  172. extern void XDPSLSetAfterProc(Display *dpy);
  173. extern int XDPSLGetSyncMask(Display *dpy);
  174. extern void XDPSLSetSyncMask(Display *dpy, int mask);
  175. extern void XDPSLFlush(Display *dpy);
  176. extern void XDPSLSyncGCClip(Display *xdpy, GC gc);
  177. extern void XDPSLGetCSDPSReady(Display *xdpy,
  178. XEvent *event,
  179. void **ret_ctxt,
  180. int *ret_val);
  181. extern void XDPSLReconcileRequests(Display *xdpy, ContextXID cxid);
  182. extern Status XDPSLSetAgentArg(Display *xdpy, int arg, int val);
  183. extern void XDPSLCleanAll(Display *xdpy);
  184. extern void XDPSLUpdateAgentArgs(Display *xdpy);
  185. extern void XDPSLCleanContext(Display *xdpy, ContextXID cxid);
  186. #ifdef VMS
  187. extern void XDPSLSetDisplay(Display *dpy);
  188. #endif /* VMS */
  189. /* DPS NX 2.0 */
  190. extern void XDPSLFlushGC(Display *dpy, GC gc);
  191. extern void XDPSLSetGCFlushMode(Display *dpy, int value);
  192. extern int XDPSLGetGCFlushMode(Display *dpy);
  193. #if defined(__cplusplus) || defined(c_plusplus)
  194. }
  195. #endif
  196. typedef struct _XDPSLOutputEvent {
  197. int type; /* of event. */
  198. unsigned long serial; /* # of last request processed by server. */
  199. Bool send_event; /* True if this came from a SendEvent req. */
  200. Display *display; /* Display the event was read from. */
  201. ContextXID cxid; /* Context from which data comes. */
  202. int length; /* Number of characters of data. */
  203. char data[24]; /* Data received. */
  204. } XDPSLOutputEvent;
  205. typedef struct _XDPSLStatusEvent {
  206. int type; /* of event. */
  207. unsigned long serial; /* # of last request processed by server. */
  208. Bool send_event; /* True if this came from a SendEvent req. */
  209. Display *display; /* Display the event was read from. */
  210. ContextXID cxid; /* Context whose status we're reporting. */
  211. int status; /* Status of context. */
  212. } XDPSLStatusEvent;
  213. typedef struct _XDPSLReadyEvent {
  214. int type; /* of event. */
  215. unsigned long serial; /* # of last request processed by server. */
  216. Bool send_event; /* True if this came from a SendEvent req. */
  217. Display *display; /* Display the event was read from. */
  218. ContextXID cxid; /* Context whose status we're reporting. */
  219. int val[4]; /* Array of client defined integer values */
  220. } XDPSLReadyEvent;
  221. #endif /* _XDPSlib_h */