2 * $XConsortium: DviP.h,v 1.5 89/07/22 19:44:08 keith Exp $
6 * DviP.h - Private definitions for Dvi widget
16 /***********************************************************************
18 * Dvi Widget Private Data
20 ***********************************************************************/
22 /************************************
26 ***********************************/
28 /* Type for save method. */
30 typedef void (*DviSaveProc)();
33 * New fields for the Dvi widget class record
37 typedef struct _DviClass {
42 * Full class record declaration
45 typedef struct _DviClassRec {
46 CoreClassPart core_class;
47 DviClassPart command_class;
50 extern DviClassRec dviClassRec;
52 /***************************************
54 * Instance (widget) structure
56 **************************************/
59 * a list of fonts we've used for this widget
62 typedef struct _dviFontSizeList {
63 struct _dviFontSizeList *next;
70 typedef struct _dviFontList {
71 struct _dviFontList *next;
77 DviFontSizeList *sizes;
78 DviCharNameMap *char_map;
79 DeviceFont *device_font;
82 typedef struct _dviFontMap {
83 struct _dviFontMap *next;
88 #define DVI_TEXT_CACHE_SIZE 256
89 #define DVI_CHAR_CACHE_SIZE 1024
91 typedef struct _dviCharCache {
92 XTextItem cache[DVI_TEXT_CACHE_SIZE];
93 char adjustable[DVI_TEXT_CACHE_SIZE];
94 char char_cache[DVI_CHAR_CACHE_SIZE];
101 int start_x, start_y;
105 typedef struct _dviState {
106 struct _dviState *next;
113 typedef struct _dviFileMap {
114 struct _dviFileMap *next;
120 * New fields for the Dvi widget record
125 * resource specifiable items
127 char *font_map_string;
128 unsigned long foreground;
129 unsigned long background;
132 XFontStruct *default_font;
135 Boolean seek; /* file is "seekable" */
136 int default_resolution;
140 FILE *tmpFile; /* used when reading stdin */
141 char readingTmp; /* reading now from tmp */
142 char ungot; /* have ungetc'd a char */
145 DviFileMap *file_map;
147 DviFontMap *font_map;
151 DeviceFont *device_font;
152 int device_font_number;
155 int device_resolution;
156 int display_resolution;
159 double scale_factor; /* display res / device res */
164 #define DVI_FILL_MAX 1000
167 #define DVI_FILL_WHITE 0
168 #define DVI_FILL_GRAY 1
169 #define DVI_FILL_BLACK 2
175 struct ExposedExtents {
181 int text_device_width;
185 #define DviGetIn(dw,cp)\
186 (dw->dvi.tmpFile ? (\
187 DviGetAndPut (dw, cp) \
189 (*cp = getc (dw->dvi.file))\
192 #define DviGetC(dw, cp)\
193 (dw->dvi.readingTmp ? (\
194 ((*cp = getc (dw->dvi.tmpFile)) == EOF) ? (\
195 fseek (dw->dvi.tmpFile, 0l, 2),\
196 (dw->dvi.readingTmp = 0),\
206 #define DviUngetC(dw, c)\
207 (dw->dvi.readingTmp ? (\
208 ungetc (c, dw->dvi.tmpFile)\
210 (dw->dvi.ungot = 1),\
211 ungetc (c, dw->dvi.file)))
214 * Full widget declaration
217 typedef struct _DviRec {
222 #define InheritSaveToFile ((DviSaveProc)_XtInherit)
224 extern XFontStruct *QueryFont ();
226 extern DviCharNameMap *QueryFontMap ();
228 extern DeviceFont *QueryDeviceFont ();
230 extern char *GetWord(), *GetLine();
231 #endif /* _XtDviP_h */