1 | /* $Id: psdrv.h,v 1.1 1999-05-24 20:19:17 ktk Exp $ */
|
---|
2 |
|
---|
3 | #ifndef __WINE_PSDRV_H
|
---|
4 | #define __WINE_PSDRV_H
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * PostScript driver definitions
|
---|
8 | *
|
---|
9 | * Copyright 1998 Huw D M Davies
|
---|
10 | */
|
---|
11 | #include "wingdi.h"
|
---|
12 | #include "font.h"
|
---|
13 | #include "pen.h"
|
---|
14 | #include "brush.h"
|
---|
15 |
|
---|
16 | typedef struct {
|
---|
17 | float llx, lly, urx, ury;
|
---|
18 | } AFMBBOX;
|
---|
19 |
|
---|
20 | typedef struct _tagAFMLIGS {
|
---|
21 | char *successor;
|
---|
22 | char *ligature;
|
---|
23 | struct _tagAFMLIGS *next;
|
---|
24 | } AFMLIGS;
|
---|
25 |
|
---|
26 | typedef struct _tagAFMMETRICS {
|
---|
27 | int C; /* character */
|
---|
28 | float WX;
|
---|
29 | char *N; /* name */
|
---|
30 | AFMBBOX B;
|
---|
31 | AFMLIGS *L; /* Ligatures */
|
---|
32 | struct _tagAFMMETRICS *next;
|
---|
33 | } AFMMETRICS;
|
---|
34 |
|
---|
35 | typedef struct _tagAFM {
|
---|
36 | char *FontName;
|
---|
37 | char *FullName;
|
---|
38 | char *FamilyName;
|
---|
39 | char *EncodingScheme;
|
---|
40 | int Weight; /* FW_NORMAL etc. */
|
---|
41 | float ItalicAngle;
|
---|
42 | BOOL IsFixedPitch;
|
---|
43 | float UnderlinePosition;
|
---|
44 | float UnderlineThickness;
|
---|
45 | AFMBBOX FontBBox;
|
---|
46 | float CapHeight;
|
---|
47 | float XHeight;
|
---|
48 | float Ascender;
|
---|
49 | float Descender;
|
---|
50 | float FullAscender; /* Ascent of Aring character */
|
---|
51 | float CharWidths[256];
|
---|
52 | int NumofMetrics;
|
---|
53 | AFMMETRICS *Metrics;
|
---|
54 | } AFM; /* CharWidths is a shortcut to the WX values of numbered glyphs */
|
---|
55 |
|
---|
56 | /* Note no 'next' in AFM. Use AFMLISTENTRY as a container. This allow more than
|
---|
57 | one list to exist without having to reallocate the entire AFM structure. We
|
---|
58 | keep a global list of all afms (PSDRV_AFMFontList) plus a list of available
|
---|
59 | fonts for each DC (dc->physDev->Fonts) */
|
---|
60 |
|
---|
61 | typedef struct _tagAFMLISTENTRY {
|
---|
62 | AFM *afm;
|
---|
63 | struct _tagAFMLISTENTRY *next;
|
---|
64 | } AFMLISTENTRY;
|
---|
65 |
|
---|
66 | typedef struct _tagFONTFAMILY {
|
---|
67 | char *FamilyName; /* family name */
|
---|
68 | AFMLISTENTRY *afmlist; /* list of afms for this family */
|
---|
69 | struct _tagFONTFAMILY *next; /* next family */
|
---|
70 | } FONTFAMILY;
|
---|
71 |
|
---|
72 | extern FONTFAMILY *PSDRV_AFMFontList;
|
---|
73 |
|
---|
74 | typedef struct _tagFONTNAME {
|
---|
75 | char *Name;
|
---|
76 | struct _tagFONTNAME *next;
|
---|
77 | } FONTNAME;
|
---|
78 |
|
---|
79 | typedef struct {
|
---|
80 | float llx, lly, urx, ury;
|
---|
81 | } IMAGEABLEAREA;
|
---|
82 |
|
---|
83 | typedef struct {
|
---|
84 | float x, y;
|
---|
85 | } PAPERDIMENSION;
|
---|
86 |
|
---|
87 | typedef struct _tagPAGESIZE {
|
---|
88 | char *Name;
|
---|
89 | char *FullName;
|
---|
90 | char *InvocationString;
|
---|
91 | IMAGEABLEAREA *ImageableArea;
|
---|
92 | PAPERDIMENSION *PaperDimension;
|
---|
93 | WORD WinPage; /*eg DMPAPER_A4. Doesn't really belong here */
|
---|
94 | struct _tagPAGESIZE *next;
|
---|
95 | } PAGESIZE;
|
---|
96 |
|
---|
97 |
|
---|
98 | typedef struct _tagOPTIONENTRY {
|
---|
99 | char *Name; /* eg "True" */
|
---|
100 | char *FullName; /* eg "Installed" */
|
---|
101 | char *InvocationString; /* Often NULL */
|
---|
102 | struct _tagOPTIONENTRY *next;
|
---|
103 | } OPTIONENTRY;
|
---|
104 |
|
---|
105 | typedef struct _tagOPTION { /* Treat bool as a special case of pickone */
|
---|
106 | char *OptionName; /* eg "*Option1" */
|
---|
107 | char *FullName; /* eg "Envelope Feeder" */
|
---|
108 | char *DefaultOption; /* eg "False" */
|
---|
109 | OPTIONENTRY *Options;
|
---|
110 | struct _tagOPTION *next;
|
---|
111 | } OPTION;
|
---|
112 |
|
---|
113 | typedef struct _tagCONSTRAINT {
|
---|
114 | char *Feature1;
|
---|
115 | char *Value1;
|
---|
116 | char *Feature2;
|
---|
117 | char *Value2;
|
---|
118 | struct _tagCONSTRAINT *next;
|
---|
119 | } CONSTRAINT;
|
---|
120 |
|
---|
121 | typedef struct _tagINPUTSLOT {
|
---|
122 | char *Name;
|
---|
123 | char *FullName;
|
---|
124 | char *InvocationString;
|
---|
125 | WORD WinBin; /* eg DMBIN_LOWER */
|
---|
126 | struct _tagINPUTSLOT *next;
|
---|
127 | } INPUTSLOT;
|
---|
128 |
|
---|
129 | typedef struct {
|
---|
130 | char *NickName;
|
---|
131 | int LanguageLevel;
|
---|
132 | BOOL ColorDevice;
|
---|
133 | int DefaultResolution;
|
---|
134 | signed int LandscapeOrientation;
|
---|
135 | char *JCLBegin;
|
---|
136 | char *JCLToPSInterpreter;
|
---|
137 | char *JCLEnd;
|
---|
138 | char *DefaultFont;
|
---|
139 | FONTNAME *InstalledFonts; /* ptr to a list of FontNames */
|
---|
140 | PAGESIZE *PageSizes;
|
---|
141 | OPTION *InstalledOptions;
|
---|
142 | CONSTRAINT *Constraints;
|
---|
143 | INPUTSLOT *InputSlots;
|
---|
144 | } PPD;
|
---|
145 |
|
---|
146 | typedef struct {
|
---|
147 | DEVMODE16 dmPublic;
|
---|
148 | struct _tagdocprivate {
|
---|
149 | } dmDocPrivate;
|
---|
150 | struct _tagdrvprivate {
|
---|
151 | char ppdFileName[100]; /* Hack */
|
---|
152 | UINT numInstalledOptions; /* Options at end of struct */
|
---|
153 | } dmDrvPrivate;
|
---|
154 |
|
---|
155 | /* Now comes:
|
---|
156 |
|
---|
157 | numInstalledOptions of OPTIONs
|
---|
158 |
|
---|
159 | */
|
---|
160 |
|
---|
161 | } PSDRV_DEVMODE16;
|
---|
162 |
|
---|
163 | typedef struct _tagPI {
|
---|
164 | char *FriendlyName;
|
---|
165 | PPD *ppd;
|
---|
166 | PSDRV_DEVMODE16 *Devmode;
|
---|
167 | FONTFAMILY *Fonts;
|
---|
168 | struct _tagPI *next;
|
---|
169 | } PRINTERINFO;
|
---|
170 |
|
---|
171 | typedef struct {
|
---|
172 | float r, g, b;
|
---|
173 | } PSRGB;
|
---|
174 |
|
---|
175 | typedef struct {
|
---|
176 | float i;
|
---|
177 | } PSGRAY;
|
---|
178 |
|
---|
179 |
|
---|
180 | /* def's for PSCOLOR.type */
|
---|
181 | #define PSCOLOR_GRAY 0
|
---|
182 | #define PSCOLOR_RGB 1
|
---|
183 |
|
---|
184 | typedef struct {
|
---|
185 | int type;
|
---|
186 | union {
|
---|
187 | PSRGB rgb;
|
---|
188 | PSGRAY gray;
|
---|
189 | } value;
|
---|
190 | } PSCOLOR;
|
---|
191 |
|
---|
192 | typedef struct {
|
---|
193 | AFM *afm;
|
---|
194 | TEXTMETRICA tm;
|
---|
195 | INT size;
|
---|
196 | float scale;
|
---|
197 | INT escapement;
|
---|
198 | PSCOLOR color;
|
---|
199 | BOOL set; /* Have we done a setfont yet */
|
---|
200 | } PSFONT;
|
---|
201 |
|
---|
202 | typedef struct {
|
---|
203 | PSCOLOR color;
|
---|
204 | BOOL set;
|
---|
205 | } PSBRUSH;
|
---|
206 |
|
---|
207 | typedef struct {
|
---|
208 | INT width;
|
---|
209 | char *dash;
|
---|
210 | PSCOLOR color;
|
---|
211 | BOOL set;
|
---|
212 | } PSPEN;
|
---|
213 |
|
---|
214 | typedef struct {
|
---|
215 | HANDLE16 hJob;
|
---|
216 | LPSTR output; /* Output file/port */
|
---|
217 | BOOL banding; /* Have we received a NEXTBAND */
|
---|
218 | BOOL NeedPageHeader; /* Page header not sent yet */
|
---|
219 | INT PageNo;
|
---|
220 | } JOB;
|
---|
221 |
|
---|
222 | typedef struct {
|
---|
223 | PSFONT font; /* Current PS font */
|
---|
224 | PSPEN pen;
|
---|
225 | PSBRUSH brush;
|
---|
226 | PSCOLOR bkColor;
|
---|
227 | PSCOLOR inkColor; /* Last colour set */
|
---|
228 | JOB job;
|
---|
229 | PSDRV_DEVMODE16 *Devmode;
|
---|
230 | PRINTERINFO *pi;
|
---|
231 | } PSDRV_PDEVICE;
|
---|
232 |
|
---|
233 | extern HANDLE PSDRV_Heap;
|
---|
234 | extern char *PSDRV_ANSIVector[256];
|
---|
235 |
|
---|
236 | extern void PSDRV_MergeDevmodes(PSDRV_DEVMODE16 *dm1, PSDRV_DEVMODE16 *dm2,
|
---|
237 | PRINTERINFO *pi);
|
---|
238 | extern BOOL PSDRV_GetFontMetrics(void);
|
---|
239 | extern PPD *PSDRV_ParsePPD(char *fname);
|
---|
240 | extern PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name);
|
---|
241 | extern AFM *PSDRV_FindAFMinList(FONTFAMILY *head, char *name);
|
---|
242 | extern void PSDRV_AddAFMtoList(FONTFAMILY **head, AFM *afm);
|
---|
243 | extern void PSDRV_FreeAFMList( FONTFAMILY *head );
|
---|
244 |
|
---|
245 | extern BOOL PSDRV_Init(void);
|
---|
246 | extern HFONT16 PSDRV_FONT_SelectObject( DC *dc, HFONT16 hfont, FONTOBJ *font);
|
---|
247 | extern HPEN PSDRV_PEN_SelectObject( DC * dc, HPEN hpen, PENOBJ * pen );
|
---|
248 | extern HBRUSH PSDRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush,
|
---|
249 | BRUSHOBJ * brush );
|
---|
250 |
|
---|
251 | extern BOOL PSDRV_Brush(DC *dc, BOOL EO);
|
---|
252 | extern BOOL PSDRV_SetFont( DC *dc );
|
---|
253 | extern BOOL PSDRV_SetPen( DC *dc );
|
---|
254 |
|
---|
255 | extern BOOL PSDRV_CmpColor(PSCOLOR *col1, PSCOLOR *col2);
|
---|
256 | extern BOOL PSDRV_CopyColor(PSCOLOR *col1, PSCOLOR *col2);
|
---|
257 | extern void PSDRV_CreateColor( PSDRV_PDEVICE *physDev, PSCOLOR *pscolor,
|
---|
258 | COLORREF wincolor );
|
---|
259 |
|
---|
260 |
|
---|
261 | extern INT PSDRV_WriteHeader( DC *dc, char *title, int len );
|
---|
262 | extern INT PSDRV_WriteFooter( DC *dc );
|
---|
263 | extern INT PSDRV_WriteNewPage( DC *dc );
|
---|
264 | extern INT PSDRV_WriteEndPage( DC *dc );
|
---|
265 | extern BOOL PSDRV_WriteMoveTo(DC *dc, INT x, INT y);
|
---|
266 | extern BOOL PSDRV_WriteLineTo(DC *dc, INT x, INT y);
|
---|
267 | extern BOOL PSDRV_WriteStroke(DC *dc);
|
---|
268 | extern BOOL PSDRV_WriteRectangle(DC *dc, INT x, INT y, INT width,
|
---|
269 | INT height);
|
---|
270 | extern BOOL PSDRV_WriteSetFont(DC *dc, BOOL UseANSI);
|
---|
271 | extern BOOL PSDRV_WriteShow(DC *dc, char *str, INT count);
|
---|
272 | extern BOOL PSDRV_WriteReencodeFont(DC *dc);
|
---|
273 | extern BOOL PSDRV_WriteSetPen(DC *dc);
|
---|
274 | extern BOOL PSDRV_WriteArc(DC *dc, INT x, INT y, INT w, INT h,
|
---|
275 | double ang1, double ang2);
|
---|
276 | extern BOOL PSDRV_WriteSetColor(DC *dc, PSCOLOR *color);
|
---|
277 | extern BOOL PSDRV_WriteSetBrush(DC *dc);
|
---|
278 | extern BOOL PSDRV_WriteFill(DC *dc);
|
---|
279 | extern BOOL PSDRV_WriteEOFill(DC *dc);
|
---|
280 | extern BOOL PSDRV_WriteGSave(DC *dc);
|
---|
281 | extern BOOL PSDRV_WriteGRestore(DC *dc);
|
---|
282 | extern BOOL PSDRV_WriteClosePath(DC *dc);
|
---|
283 | extern BOOL PSDRV_WriteClip(DC *dc);
|
---|
284 | extern BOOL PSDRV_WriteEOClip(DC *dc);
|
---|
285 | extern BOOL PSDRV_WriteHatch(DC *dc);
|
---|
286 | extern BOOL PSDRV_WriteRotate(DC *dc, float ang);
|
---|
287 | extern BOOL PSDRV_WriteIndexColorSpaceBegin(DC *dc, int size);
|
---|
288 | extern BOOL PSDRV_WriteIndexColorSpaceEnd(DC *dc);
|
---|
289 | extern BOOL PSDRV_WriteRGB(DC *dc, COLORREF *map, int number);
|
---|
290 | extern BOOL PSDRV_WriteImageDict(DC *dc, WORD depth, INT xDst, INT yDst,
|
---|
291 | INT widthDst, INT heightDst, INT widthSrc,
|
---|
292 | INT heightSrc);
|
---|
293 | extern BOOL PSDRV_WriteBytes(DC *dc, const BYTE *bytes, int number);
|
---|
294 | extern BOOL PSDRV_WriteDIBits16(DC *dc, const WORD *words, int number);
|
---|
295 | extern BOOL PSDRV_WriteDIBits24(DC *dc, const BYTE *bits, int number);
|
---|
296 | extern BOOL PSDRV_WriteDIBits32(DC *dc, const BYTE *bits, int number);
|
---|
297 |
|
---|
298 |
|
---|
299 |
|
---|
300 | extern BOOL PSDRV_Arc( DC *dc, INT left, INT top, INT right,
|
---|
301 | INT bottom, INT xstart, INT ystart,
|
---|
302 | INT xend, INT yend );
|
---|
303 | extern BOOL PSDRV_Chord( DC *dc, INT left, INT top, INT right,
|
---|
304 | INT bottom, INT xstart, INT ystart,
|
---|
305 | INT xend, INT yend );
|
---|
306 | extern BOOL PSDRV_Ellipse( DC *dc, INT left, INT top, INT right,
|
---|
307 | INT bottom );
|
---|
308 | extern BOOL PSDRV_EnumDeviceFonts( DC* dc, LPLOGFONT16 plf,
|
---|
309 | DEVICEFONTENUMPROC proc, LPARAM lp );
|
---|
310 | extern INT PSDRV_Escape( DC *dc, INT nEscape, INT cbInput,
|
---|
311 | SEGPTR lpInData, SEGPTR lpOutData );
|
---|
312 | extern BOOL PSDRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
|
---|
313 | const RECT *lprect, LPCSTR str, UINT count,
|
---|
314 | const INT *lpDx );
|
---|
315 | extern BOOL PSDRV_GetCharWidth( DC *dc, UINT firstChar, UINT lastChar,
|
---|
316 | LPINT buffer );
|
---|
317 | extern BOOL PSDRV_GetTextExtentPoint( DC *dc, LPCSTR str, INT count,
|
---|
318 | LPSIZE size );
|
---|
319 | extern BOOL PSDRV_GetTextMetrics( DC *dc, TEXTMETRICA *metrics );
|
---|
320 | extern BOOL PSDRV_LineTo( DC *dc, INT x, INT y );
|
---|
321 | extern BOOL PSDRV_MoveToEx( DC *dc, INT x, INT y, LPPOINT pt );
|
---|
322 | extern BOOL PSDRV_Pie( DC *dc, INT left, INT top, INT right,
|
---|
323 | INT bottom, INT xstart, INT ystart,
|
---|
324 | INT xend, INT yend );
|
---|
325 | extern BOOL PSDRV_Polygon( DC *dc, const POINT* pt, INT count );
|
---|
326 | extern BOOL PSDRV_Polyline( DC *dc, const POINT* pt, INT count );
|
---|
327 | extern BOOL PSDRV_PolyPolygon( DC *dc, const POINT* pts, const INT* counts,
|
---|
328 | UINT polygons );
|
---|
329 | extern BOOL PSDRV_PolyPolyline( DC *dc, const POINT* pts, const DWORD* counts,
|
---|
330 | DWORD polylines );
|
---|
331 | extern BOOL PSDRV_Rectangle( DC *dc, INT left, INT top, INT right,
|
---|
332 | INT bottom );
|
---|
333 | extern BOOL PSDRV_RoundRect(DC *dc, INT left, INT top, INT right,
|
---|
334 | INT bottom, INT ell_width, INT ell_height);
|
---|
335 | extern HGDIOBJ PSDRV_SelectObject( DC *dc, HGDIOBJ handle );
|
---|
336 | extern COLORREF PSDRV_SetBkColor( DC *dc, COLORREF color );
|
---|
337 | extern COLORREF PSDRV_SetPixel( DC *dc, INT x, INT y, COLORREF color );
|
---|
338 | extern COLORREF PSDRV_SetTextColor( DC *dc, COLORREF color );
|
---|
339 | extern INT PSDRV_StretchDIBits( DC *dc, INT xDst, INT yDst,
|
---|
340 | INT widthDst, INT heightDst, INT xSrc,
|
---|
341 | INT ySrc, INT widthSrc, INT heightSrc,
|
---|
342 | const void *bits, const BITMAPINFO *info,
|
---|
343 | UINT wUsage, DWORD dwRop );
|
---|
344 |
|
---|
345 | #endif
|
---|
346 |
|
---|
347 |
|
---|