2 * $XConsortium: DviP.h,v 1.5 89/07/22 19:44:08 keith Exp $
6 * DviP.h - Private definitions for Dvi widget
15 /***********************************************************************
17 * Dvi Widget Private Data
19 ***********************************************************************/
21 /************************************
25 ***********************************/
28 * New fields for the Dvi widget class record
31 typedef struct _DviClass
{
32 int makes_compiler_happy
; /* not used */
36 * Full class record declaration
39 typedef struct _DviClassRec
{
40 CoreClassPart core_class
;
41 DviClassPart command_class
;
44 extern DviClassRec dviClassRec
;
46 /***************************************
48 * Instance (widget) structure
50 **************************************/
53 * a list of fonts we've used for this widget
56 typedef struct _dviFontSizeList
{
57 struct _dviFontSizeList
*next
;
64 typedef struct _dviFontList
{
65 struct _dviFontList
*next
;
69 DviFontSizeList
*sizes
;
70 DviCharNameMap
*char_map
;
73 typedef struct _dviFontMap
{
74 struct _dviFontMap
*next
;
79 #define DVI_TEXT_CACHE_SIZE 256
80 #define DVI_CHAR_CACHE_SIZE 1024
82 typedef struct _dviCharCache
{
83 XTextItem cache
[DVI_TEXT_CACHE_SIZE
];
84 char char_cache
[DVI_CHAR_CACHE_SIZE
];
95 typedef struct _dviState
{
96 struct _dviState
*next
;
103 typedef struct _dviFileMap
{
104 struct _dviFileMap
*next
;
110 * New fields for the Dvi widget record
115 * resource specifiable items
117 char *font_map_string
;
118 unsigned long foreground
;
119 unsigned long background
;
122 XFontStruct
*default_font
;
125 Boolean seek
; /* file is "seekable" */
129 FILE *tmpFile
; /* used when reading stdin */
130 char readingTmp
; /* reading now from tmp */
131 char ungot
; /* have ungetc'd a char */
134 DviFileMap
*file_map
;
136 DviFontMap
*font_map
;
140 int device_resolution
;
144 #define DVI_FILL_MAX 1000
147 #define DVI_FILL_WHITE 0
148 #define DVI_FILL_GRAY 1
149 #define DVI_FILL_BLACK 2
155 struct ExposedExtents
{
162 #define DviGetIn(dw,cp)\
163 (dw->dvi.tmpFile ? (\
164 DviGetAndPut (dw, cp) \
166 (*cp = getc (dw->dvi.file))\
169 #define DviGetC(dw, cp)\
170 (dw->dvi.readingTmp ? (\
171 ((*cp = getc (dw->dvi.tmpFile)) == EOF) ? (\
172 fseek (dw->dvi.tmpFile, 0l, 2),\
173 (dw->dvi.readingTmp = 0),\
183 #define DviUngetC(dw, c)\
184 (dw->dvi.readingTmp ? (\
185 ungetc (c, dw->dvi.tmpFile)\
187 (dw->dvi.ungot = 1),\
188 ungetc (c, dw->dvi.file)))
191 * Full widget declaration
194 typedef struct _DviRec
{
199 extern XFontStruct
*QueryFont ();
201 extern DviCharNameMap
*QueryFontMap ();
202 #endif /* _XtDviP_h */