Don't use .Xo/.Xc. Fix date format.
[netbsd-mini2440.git] / gnu / usr.bin / groff / libXdvi / DviP.h
blob9c073a0c628a24b38891d3c79be96bb695eafc47
1 /*
2 * $XConsortium: DviP.h,v 1.5 89/07/22 19:44:08 keith Exp $
3 */
5 /*
6 * DviP.h - Private definitions for Dvi widget
7 */
9 #ifndef _XtDviP_h
10 #define _XtDviP_h
12 #include "Dvi.h"
13 #include "DviChar.h"
15 /***********************************************************************
17 * Dvi Widget Private Data
19 ***********************************************************************/
21 /************************************
23 * Class structure
25 ***********************************/
28 * New fields for the Dvi widget class record
31 typedef struct _DviClass {
32 int makes_compiler_happy; /* not used */
33 } DviClassPart;
36 * Full class record declaration
39 typedef struct _DviClassRec {
40 CoreClassPart core_class;
41 DviClassPart command_class;
42 } DviClassRec;
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;
58 int size;
59 char *x_name;
60 XFontStruct *font;
61 int doesnt_exist;
62 } DviFontSizeList;
64 typedef struct _dviFontList {
65 struct _dviFontList *next;
66 char *dvi_name;
67 char *x_name;
68 int dvi_number;
69 DviFontSizeList *sizes;
70 DviCharNameMap *char_map;
71 } DviFontList;
73 typedef struct _dviFontMap {
74 struct _dviFontMap *next;
75 char *dvi_name;
76 char *x_name;
77 } DviFontMap;
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];
85 int index;
86 int max;
87 int char_index;
88 int font_size;
89 int font_number;
90 XFontStruct *font;
91 int start_x, start_y;
92 int x, y;
93 } DviCharCache;
95 typedef struct _dviState {
96 struct _dviState *next;
97 int font_size;
98 int font_number;
99 int x;
100 int y;
101 } DviState;
103 typedef struct _dviFileMap {
104 struct _dviFileMap *next;
105 long position;
106 int page_number;
107 } DviFileMap;
110 * New fields for the Dvi widget record
113 typedef struct {
115 * resource specifiable items
117 char *font_map_string;
118 unsigned long foreground;
119 unsigned long background;
120 int requested_page;
121 int last_page;
122 XFontStruct *default_font;
123 FILE *file;
124 Boolean noPolyText;
125 Boolean seek; /* file is "seekable" */
127 * private state
129 FILE *tmpFile; /* used when reading stdin */
130 char readingTmp; /* reading now from tmp */
131 char ungot; /* have ungetc'd a char */
132 GC normal_GC;
133 GC fill_GC;
134 DviFileMap *file_map;
135 DviFontList *fonts;
136 DviFontMap *font_map;
137 int current_page;
138 int font_size;
139 int font_number;
140 int device_resolution;
141 int line_thickness;
142 int line_width;
144 #define DVI_FILL_MAX 1000
146 int fill;
147 #define DVI_FILL_WHITE 0
148 #define DVI_FILL_GRAY 1
149 #define DVI_FILL_BLACK 2
150 int fill_type;
151 Pixmap gray;
152 int backing_store;
153 XFontStruct *font;
154 int display_enable;
155 struct ExposedExtents {
156 int x1, y1, x2, y2;
157 } extents;
158 DviState *state;
159 DviCharCache cache;
160 } DviPart;
162 #define DviGetIn(dw,cp)\
163 (dw->dvi.tmpFile ? (\
164 DviGetAndPut (dw, cp) \
165 ) :\
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),\
174 DviGetIn (dw,cp)\
175 ) : (\
176 *cp\
178 ) : (\
179 DviGetIn(dw,cp)\
183 #define DviUngetC(dw, c)\
184 (dw->dvi.readingTmp ? (\
185 ungetc (c, dw->dvi.tmpFile)\
186 ) : ( \
187 (dw->dvi.ungot = 1),\
188 ungetc (c, dw->dvi.file)))
191 * Full widget declaration
194 typedef struct _DviRec {
195 CorePart core;
196 DviPart dvi;
197 } DviRec;
199 extern XFontStruct *QueryFont ();
201 extern DviCharNameMap *QueryFontMap ();
202 #endif /* _XtDviP_h */