x_.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. /* Copyright (C) 1989, 1995, 1996, 1998 Aladdin Enterprises. All rights reserved.
  2. This file is part of AFPL Ghostscript.
  3. AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND. No author or
  4. distributor accepts any responsibility for the consequences of using it, or
  5. for whether it serves any particular purpose or works at all, unless he or
  6. she says so in writing. Refer to the Aladdin Free Public License (the
  7. "License") for full details.
  8. Every copy of AFPL Ghostscript must include a copy of the License, normally
  9. in a plain ASCII text file named PUBLIC. The License grants you the right
  10. to copy, modify and redistribute AFPL Ghostscript, but only under certain
  11. conditions described in the License. Among other things, the License
  12. requires that the copyright notice and this notice be preserved on all
  13. copies.
  14. */
  15. /*$Id: x_.h,v 1.3 2001/04/20 09:56:22 joukj Exp $ */
  16. /* Header for including X library calls in Ghostscript X11 driver */
  17. #ifndef x__INCLUDED
  18. # define x__INCLUDED
  19. /* Some versions of the X library use `private' as a member name, so: */
  20. #undef private
  21. /* Most X implementations have _Xdebug, but VMS DECWindows doesn't. */
  22. #ifndef VMS
  23. # define have_Xdebug
  24. #endif
  25. #ifdef VMS
  26. # ifdef __GNUC__
  27. /* Names of external functions which contain upper case letters are
  28. * modified by the VMS GNU C compiler to prevent confusion between
  29. * names such as XOpen and xopen. GNU C does this by translating a
  30. * name like XOpen into xopen_aaaaaaaax with "aaaaaaaa" a hexadecimal
  31. * string. However, this causes problems when we link against the
  32. * X library which doesn't contain a routine named xopen_aaaaaaaax.
  33. * So, we use #define's to map all X routine names to lower case.
  34. * (Note that routines like BlackPixelOfScreen, which are [for VMS]
  35. * preprocessor macros, do not appear here.)
  36. */
  37. /*
  38. * The names redefined here are those which the current Ghostscript X11
  39. * driver happens to use: this list may grow in the future.
  40. */
  41. # define XAllocColor xalloccolor
  42. # define XAllocNamedColor xallocnamedcolor
  43. # define XCloseDisplay xclosedisplay
  44. # define XCopyArea xcopyarea
  45. # define XCreateGC xcreategc
  46. # define XCreatePixmap xcreatepixmap
  47. # define XCreateWindow xcreatewindow
  48. # define XDestroyImage xdestroyimage
  49. # define XDisplayString xdisplaystring
  50. # define XDrawLine xdrawline
  51. # define XDrawPoint xdrawpoint
  52. # define XDrawString xdrawstring
  53. # define XFillPolygon xfillpolygon
  54. # define XFillRectangle xfillrectangle
  55. # define XFillRectangles xfillrectangles
  56. # define XFlush xflush
  57. # define XFree xfree
  58. # define XFreeColors xfreecolors
  59. # define XFreeFont xfreefont
  60. # define XFreeFontNames xfreefontnames
  61. # define XFreeGC xfreegc
  62. # define XFreePixmap xfreepixmap
  63. # define XGetDefault xgetdefault
  64. # define XGetGCValues xgetgcvalues
  65. # define XGetGeometry xgetgeometry
  66. # define XGetImage xgetimage
  67. # define XGetRGBColormaps xgetrgbcolormaps
  68. # define XGetVisualInfo xgetvisualinfo
  69. # define XGetWindowAttributes xgetwindowattributes
  70. # define XGetWindowProperty xgetwindowproperty
  71. # define XInitImage xinitimage
  72. # define XInternAtom xinternatom
  73. # define XListFonts xlistfonts
  74. # define XLoadQueryFont xloadqueryfont
  75. # define XMapWindow xmapwindow
  76. # define XNextEvent xnextevent
  77. # define XOpenDisplay xopendisplay
  78. # define XPutImage xputimage
  79. # define XQueryColor xquerycolor
  80. # define XResizeWindow xresizewindow
  81. # define XSendEvent xsendevent
  82. # define XSetBackground xsetbackground
  83. # define XSetClipMask xsetclipmask
  84. # define XSetClipOrigin xsetcliporigin
  85. # define XSetErrorHandler xseterrorhandler
  86. # define XSetFillStyle xsetfillstyle
  87. # define XSetFont xsetfont
  88. # define XSetForeground xsetforeground
  89. # define XSetFunction xsetfunction
  90. # define XSetLineAttributes xsetlineattributes
  91. # define XSetTile xsettile
  92. # define XSetWindowBackgroundPixmap xsetwindowbackgroundpixmap
  93. # define XSetWMHints xsetwmhints
  94. # define XSetWMNormalHints xsetwmnormalhints
  95. # define XStoreName xstorename
  96. # define XSync xsync
  97. # define XVisualIDFromVisual xvisualidfromvisual
  98. # define XWMGeometry xwmgeometry
  99. # define XtAppCreateShell xtappcreateshell
  100. # define XtCloseDisplay xtclosedisplay
  101. # define XtCreateApplicationContext xtcreateapplicationcontext
  102. # define XtDestroyApplicationContext xtdestroyapplicationcontext
  103. # define XtDestroyWidget xtdestroywidget
  104. # define XtAppSetFallbackResources xtappsetfallbackresources
  105. # define XtGetApplicationResources xtgetapplicationresources
  106. # define XtOpenDisplay xtopendisplay
  107. # define XtToolkitInitialize xttoolkitinitialize
  108. # define CADDR_T /* Without this DEFINE, VAX GNUC */
  109. /* gets trashed reading Intrinsic.h */
  110. #else
  111. #include <vms_x_fix.h>
  112. # endif /* ifdef __GNUC__ */
  113. # include <decw$include/Xlib.h>
  114. # include <decw$include/Xproto.h>
  115. # include <decw$include/Xatom.h>
  116. # include <decw$include/Xutil.h>
  117. # include <decw$include/Intrinsic.h>
  118. # include <decw$include/StringDefs.h>
  119. # include <decw$include/Shell.h>
  120. #else /* !ifdef VMS */
  121. # include <X11/Xlib.h>
  122. # include <X11/Xproto.h>
  123. # include <X11/Xatom.h>
  124. # include <X11/Xutil.h>
  125. # include <X11/Intrinsic.h>
  126. # include <X11/StringDefs.h>
  127. # include <X11/Shell.h>
  128. #endif /* VMS */
  129. /* X11R3 doesn't have XtOffsetOf, but it has XtOffset. */
  130. #ifndef XtOffsetOf
  131. # ifdef offsetof
  132. # define XtOffsetOf(s_type,field) offsetof(s_type,field)
  133. # else
  134. # define XtOffsetOf(s_type,field) XtOffset(s_type*,field)
  135. # endif
  136. #endif
  137. /* Include standard colormap stuff only for X11R4 and later. */
  138. # if defined(XtSpecificationRelease) && (XtSpecificationRelease >= 4)
  139. # define HaveStdCMap 1
  140. # else
  141. # define HaveStdCMap 0
  142. /* This function is not defined in R3. */
  143. # undef XVisualIDFromVisual
  144. # define XVisualIDFromVisual(vis) ((vis)->visualid)
  145. # endif
  146. /* No-op XInitImage before X11R6. */
  147. # if !(defined(XtSpecificationRelease) && (XtSpecificationRelease >= 6))
  148. # undef XInitImage
  149. # define XInitImage(im) 1 /* non-zero = success */
  150. # endif
  151. /* Restore the definition of `private'. */
  152. #define private private_
  153. #endif /* x__INCLUDED */