gdevxres.c 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /* Copyright (C) 1999, 2000 Aladdin Enterprises. All rights reserved.
  2. This software is provided AS-IS with no warranty, either express or
  3. implied.
  4. This software is distributed under license and may not be copied,
  5. modified or distributed except as expressly authorized under the terms
  6. of the license contained in the file LICENSE in this distribution.
  7. For more information about licensing, please refer to
  8. http://www.ghostscript.com/licensing/. For information on
  9. commercial licensing, go to http://www.artifex.com/licensing/ or
  10. contact Artifex Software, Inc., 101 Lucas Valley Road #110,
  11. San Rafael, CA 94903, U.S.A., +1(415)492-9861.
  12. */
  13. /* $Id: gdevxres.c,v 1.5 2002/02/21 22:24:52 giles Exp $ */
  14. /* X Windows driver resource tables */
  15. #include "std.h" /* must precede any file that includes <sys/types.h> */
  16. #include "x_.h"
  17. #include "gstypes.h"
  18. #include "gsmemory.h"
  19. #include "gxdevice.h"
  20. #include "gdevx.h"
  21. /*
  22. * We segregate these tables into their own file because the definition of
  23. * the XtResource structure is botched -- it declares the strings as char *
  24. * rather than const char * -- and so compiling the statically initialized
  25. * tables with gcc -Wcast-qual produces dozens of bogus warnings.
  26. *
  27. * Astoundingly, not only does the X API specify these structures as not
  28. * being const, the Xt implementation actually writes into them.
  29. */
  30. XtResource gdev_x_resources[] = {
  31. /* (String) casts are here to suppress warnings about discarding `const' */
  32. #define RINIT(a,b,t,s,o,it,n)\
  33. {(String)(a), (String)(b), (String)t, sizeof(s),\
  34. XtOffsetOf(gx_device_X, o), (String)it, (n)}
  35. #define rpix(a,b,o,n)\
  36. RINIT(a,b,XtRPixel,Pixel,o,XtRString,(XtPointer)(n))
  37. #define rdim(a,b,o,n)\
  38. RINIT(a,b,XtRDimension,Dimension,o,XtRImmediate,(XtPointer)(n))
  39. #define rstr(a,b,o,n)\
  40. RINIT(a,b,XtRString,String,o,XtRString,(char*)(n))
  41. #define rint(a,b,o,n)\
  42. RINIT(a,b,XtRInt,int,o,XtRImmediate,(XtPointer)(n))
  43. #define rbool(a,b,o,n)\
  44. RINIT(a,b,XtRBoolean,Boolean,o,XtRImmediate,(XtPointer)(n))
  45. #define rfloat(a,b,o,n)\
  46. RINIT(a,b,XtRFloat,float,o,XtRString,(XtPointer)(n))
  47. rpix(XtNbackground, XtCBackground, background, "XtDefaultBackground"),
  48. rpix(XtNborderColor, XtCBorderColor, borderColor, "XtDefaultForeground"),
  49. rdim(XtNborderWidth, XtCBorderWidth, borderWidth, 1),
  50. rstr("dingbatFonts", "DingbatFonts", dingbatFonts,
  51. "ZapfDingbats: -Adobe-ITC Zapf Dingbats-Medium-R-Normal--"),
  52. rpix(XtNforeground, XtCForeground, foreground, "XtDefaultForeground"),
  53. rstr(XtNgeometry, XtCGeometry, geometry, NULL),
  54. rbool("logExternalFonts", "LogExternalFonts", logXFonts, False),
  55. rint("maxGrayRamp", "MaxGrayRamp", maxGrayRamp, 128),
  56. rint("maxRGBRamp", "MaxRGBRamp", maxRGBRamp, 5),
  57. rstr("palette", "Palette", palette, "Color"),
  58. /*
  59. * I had to compress the whitespace out of the default string to
  60. * satisfy certain balky compilers.
  61. */
  62. rstr("regularFonts", "RegularFonts", regularFonts, "\
  63. AvantGarde-Book:-Adobe-ITC Avant Garde Gothic-Book-R-Normal--\n\
  64. AvantGarde-BookOblique:-Adobe-ITC Avant Garde Gothic-Book-O-Normal--\n\
  65. AvantGarde-Demi:-Adobe-ITC Avant Garde Gothic-Demi-R-Normal--\n\
  66. AvantGarde-DemiOblique:-Adobe-ITC Avant Garde Gothic-Demi-O-Normal--\n\
  67. Bookman-Demi:-Adobe-ITC Bookman-Demi-R-Normal--\n\
  68. Bookman-DemiItalic:-Adobe-ITC Bookman-Demi-I-Normal--\n\
  69. Bookman-Light:-Adobe-ITC Bookman-Light-R-Normal--\n\
  70. Bookman-LightItalic:-Adobe-ITC Bookman-Light-I-Normal--\n\
  71. Courier:-Adobe-Courier-Medium-R-Normal--\n\
  72. Courier-Bold:-Adobe-Courier-Bold-R-Normal--\n\
  73. Courier-BoldOblique:-Adobe-Courier-Bold-O-Normal--\n\
  74. Courier-Oblique:-Adobe-Courier-Medium-O-Normal--\n\
  75. Helvetica:-Adobe-Helvetica-Medium-R-Normal--\n\
  76. Helvetica-Bold:-Adobe-Helvetica-Bold-R-Normal--\n\
  77. Helvetica-BoldOblique:-Adobe-Helvetica-Bold-O-Normal--\n\
  78. Helvetica-Narrow:-Adobe-Helvetica-Medium-R-Narrow--\n\
  79. Helvetica-Narrow-Bold:-Adobe-Helvetica-Bold-R-Narrow--\n\
  80. Helvetica-Narrow-BoldOblique:-Adobe-Helvetica-Bold-O-Narrow--\n\
  81. Helvetica-Narrow-Oblique:-Adobe-Helvetica-Medium-O-Narrow--\n\
  82. Helvetica-Oblique:-Adobe-Helvetica-Medium-O-Normal--\n\
  83. NewCenturySchlbk-Bold:-Adobe-New Century Schoolbook-Bold-R-Normal--\n\
  84. NewCenturySchlbk-BoldItalic:-Adobe-New Century Schoolbook-Bold-I-Normal--\n\
  85. NewCenturySchlbk-Italic:-Adobe-New Century Schoolbook-Medium-I-Normal--\n\
  86. NewCenturySchlbk-Roman:-Adobe-New Century Schoolbook-Medium-R-Normal--\n\
  87. Palatino-Bold:-Adobe-Palatino-Bold-R-Normal--\n\
  88. Palatino-BoldItalic:-Adobe-Palatino-Bold-I-Normal--\n\
  89. Palatino-Italic:-Adobe-Palatino-Medium-I-Normal--\n\
  90. Palatino-Roman:-Adobe-Palatino-Medium-R-Normal--\n\
  91. Times-Bold:-Adobe-Times-Bold-R-Normal--\n\
  92. Times-BoldItalic:-Adobe-Times-Bold-I-Normal--\n\
  93. Times-Italic:-Adobe-Times-Medium-I-Normal--\n\
  94. Times-Roman:-Adobe-Times-Medium-R-Normal--\n\
  95. Utopia-Bold:-Adobe-Utopia-Bold-R-Normal--\n\
  96. Utopia-BoldItalic:-Adobe-Utopia-Bold-I-Normal--\n\
  97. Utopia-Italic:-Adobe-Utopia-Regular-I-Normal--\n\
  98. Utopia-Regular:-Adobe-Utopia-Regular-R-Normal--\n\
  99. ZapfChancery-MediumItalic:-Adobe-ITC Zapf Chancery-Medium-I-Normal--"),
  100. rstr("symbolFonts", "SymbolFonts", symbolFonts,
  101. "Symbol: -Adobe-Symbol-Medium-R-Normal--"),
  102. rbool("useBackingPixmap", "UseBackingPixmap", useBackingPixmap, True),
  103. rbool("useExternalFonts", "UseExternalFonts", useXFonts, True),
  104. rbool("useFontExtensions", "UseFontExtensions", useFontExtensions, True),
  105. rbool("useScalableFonts", "UseScalableFonts", useScalableFonts, True),
  106. rbool("useXPutImage", "UseXPutImage", useXPutImage, True),
  107. rbool("useXSetTile", "UseXSetTile", useXSetTile, True),
  108. rfloat("xResolution", "Resolution", xResolution, "0.0"),
  109. rfloat("yResolution", "Resolution", yResolution, "0.0"),
  110. #undef RINIT
  111. #undef rpix
  112. #undef rdim
  113. #undef rstr
  114. #undef rint
  115. #undef rbool
  116. #undef rfloat
  117. };
  118. const int gdev_x_resource_count = XtNumber(gdev_x_resources);
  119. String gdev_x_fallback_resources[] = {
  120. (String) "Ghostscript*Background: white",
  121. (String) "Ghostscript*Foreground: black",
  122. NULL
  123. };