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