5 * PostScript driver definitions
7 * Copyright 1998 Huw D M Davies
15 float llx, lly, urx, ury;
18 typedef struct _tagAFMLIGS {
21 struct _tagAFMLIGS *next;
24 typedef struct _tagAFMMETRICS {
25 int C; /* character */
29 AFMLIGS *L; /* Ligatures */
30 struct _tagAFMMETRICS *next;
33 typedef struct _tagAFM {
38 int Weight; /* FW_NORMAL etc. */
41 float UnderlinePosition;
42 float UnderlineThickness;
48 float FullAscender; /* Ascent of Aring character */
49 float CharWidths[256];
52 } AFM; /* CharWidths is a shortcut to the WX values of numbered glyphs */
54 /* Note no 'next' in AFM. Use AFMLISTENTRY as a container. This allow more than
55 one list to exist without having to reallocate the entire AFM structure. We
56 keep a global list of all afms (PSDRV_AFMFontList) plus a list of available
57 fonts for each DC (dc->physDev->Fonts) */
59 typedef struct _tagAFMLISTENTRY {
61 struct _tagAFMLISTENTRY *next;
64 typedef struct _tagFONTFAMILY {
65 char *FamilyName; /* family name */
66 AFMLISTENTRY *afmlist; /* list of afms for this family */
67 struct _tagFONTFAMILY *next; /* next family */
70 extern FONTFAMILY *PSDRV_AFMFontList;
72 typedef struct _tagFONTNAME {
74 struct _tagFONTNAME *next;
78 float llx, lly, urx, ury;
85 typedef struct _tagPAGESIZE {
88 char *InvocationString;
89 IMAGEABLEAREA *ImageableArea;
90 PAPERDIMENSION *PaperDimension;
91 WORD WinPage; /*eg DMPAPER_A4. Doesn't really belong here */
92 struct _tagPAGESIZE *next;
96 typedef struct _tagOPTIONENTRY {
97 char *Name; /* eg "True" */
98 char *FullName; /* eg "Installed" */
99 char *InvocationString; /* Often NULL */
100 struct _tagOPTIONENTRY *next;
103 typedef struct _tagOPTION { /* Treat bool as a special case of pickone */
104 char *OptionName; /* eg "*Option1" */
105 char *FullName; /* eg "Envelope Feeder" */
106 char *DefaultOption; /* eg "False" */
107 OPTIONENTRY *Options;
108 struct _tagOPTION *next;
111 typedef struct _tagCONSTRAINT {
116 struct _tagCONSTRAINT *next;
119 typedef struct _tagINPUTSLOT {
122 char *InvocationString;
123 WORD WinBin; /* eg DMBIN_LOWER */
124 struct _tagINPUTSLOT *next;
131 int DefaultResolution;
132 signed int LandscapeOrientation;
134 char *JCLToPSInterpreter;
137 FONTNAME *InstalledFonts; /* ptr to a list of FontNames */
139 OPTION *InstalledOptions;
140 CONSTRAINT *Constraints;
141 INPUTSLOT *InputSlots;
146 struct _tagdocprivate {
148 struct _tagdrvprivate {
149 char ppdFileName[100]; /* Hack */
150 UINT numInstalledOptions; /* Options at end of struct */
155 numInstalledOptions of OPTIONs
161 typedef struct _tagPI {
164 PSDRV_DEVMODE16 *Devmode;
178 /* def's for PSCOLOR.type */
179 #define PSCOLOR_GRAY 0
180 #define PSCOLOR_RGB 1
197 BOOL set; /* Have we done a setfont yet */
214 LPSTR output; /* Output file/port */
215 BOOL banding; /* Have we received a NEXTBAND */
216 BOOL NeedPageHeader; /* Page header not sent yet */
221 PSFONT font; /* Current PS font */
225 PSCOLOR inkColor; /* Last colour set */
227 PSDRV_DEVMODE16 *Devmode;
231 extern HANDLE PSDRV_Heap;
232 extern char *PSDRV_ANSIVector[256];
234 extern void PSDRV_MergeDevmodes(PSDRV_DEVMODE16 *dm1, PSDRV_DEVMODE16 *dm2,
236 extern BOOL PSDRV_GetFontMetrics(void);
237 extern PPD *PSDRV_ParsePPD(char *fname);
238 extern PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name);
239 extern AFM *PSDRV_FindAFMinList(FONTFAMILY *head, char *name);
240 extern void PSDRV_AddAFMtoList(FONTFAMILY **head, AFM *afm);
241 extern void PSDRV_FreeAFMList( FONTFAMILY *head );
243 extern BOOL PSDRV_Init(void);
244 extern HFONT16 PSDRV_FONT_SelectObject( DC *dc, HFONT16 hfont, FONTOBJ *font);
245 extern HPEN PSDRV_PEN_SelectObject( DC * dc, HPEN hpen, PENOBJ * pen );
246 extern HBRUSH PSDRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush,
249 extern BOOL PSDRV_Brush(DC *dc, BOOL EO);
250 extern BOOL PSDRV_SetFont( DC *dc );
251 extern BOOL PSDRV_SetPen( DC *dc );
253 extern BOOL PSDRV_CmpColor(PSCOLOR *col1, PSCOLOR *col2);
254 extern BOOL PSDRV_CopyColor(PSCOLOR *col1, PSCOLOR *col2);
255 extern void PSDRV_CreateColor( PSDRV_PDEVICE *physDev, PSCOLOR *pscolor,
259 extern INT PSDRV_WriteHeader( DC *dc, char *title, int len );
260 extern INT PSDRV_WriteFooter( DC *dc );
261 extern INT PSDRV_WriteNewPage( DC *dc );
262 extern INT PSDRV_WriteEndPage( DC *dc );
263 extern BOOL PSDRV_WriteMoveTo(DC *dc, INT x, INT y);
264 extern BOOL PSDRV_WriteLineTo(DC *dc, INT x, INT y);
265 extern BOOL PSDRV_WriteStroke(DC *dc);
266 extern BOOL PSDRV_WriteRectangle(DC *dc, INT x, INT y, INT width,
268 extern BOOL PSDRV_WriteSetFont(DC *dc, BOOL UseANSI);
269 extern BOOL PSDRV_WriteShow(DC *dc, char *str, INT count);
270 extern BOOL PSDRV_WriteReencodeFont(DC *dc);
271 extern BOOL PSDRV_WriteSetPen(DC *dc);
272 extern BOOL PSDRV_WriteArc(DC *dc, INT x, INT y, INT w, INT h,
273 double ang1, double ang2);
274 extern BOOL PSDRV_WriteSetColor(DC *dc, PSCOLOR *color);
275 extern BOOL PSDRV_WriteSetBrush(DC *dc);
276 extern BOOL PSDRV_WriteFill(DC *dc);
277 extern BOOL PSDRV_WriteEOFill(DC *dc);
278 extern BOOL PSDRV_WriteGSave(DC *dc);
279 extern BOOL PSDRV_WriteGRestore(DC *dc);
280 extern BOOL PSDRV_WriteClosePath(DC *dc);
281 extern BOOL PSDRV_WriteClip(DC *dc);
282 extern BOOL PSDRV_WriteEOClip(DC *dc);
283 extern BOOL PSDRV_WriteHatch(DC *dc);
284 extern BOOL PSDRV_WriteRotate(DC *dc, float ang);
285 extern BOOL PSDRV_WriteIndexColorSpaceBegin(DC *dc, int size);
286 extern BOOL PSDRV_WriteIndexColorSpaceEnd(DC *dc);
287 extern BOOL PSDRV_WriteRGB(DC *dc, COLORREF *map, int number);
288 extern BOOL PSDRV_WriteImageDict(DC *dc, WORD depth, INT xDst, INT yDst,
289 INT widthDst, INT heightDst, INT widthSrc,
291 extern BOOL PSDRV_WriteBytes(DC *dc, const BYTE *bytes, int number);
292 extern BOOL PSDRV_WriteDIBits16(DC *dc, const WORD *words, int number);
293 extern BOOL PSDRV_WriteDIBits24(DC *dc, const BYTE *bits, int number);
294 extern BOOL PSDRV_WriteDIBits32(DC *dc, const BYTE *bits, int number);
298 extern BOOL PSDRV_Arc( DC *dc, INT left, INT top, INT right,
299 INT bottom, INT xstart, INT ystart,
300 INT xend, INT yend );
301 extern BOOL PSDRV_Chord( DC *dc, INT left, INT top, INT right,
302 INT bottom, INT xstart, INT ystart,
303 INT xend, INT yend );
304 extern BOOL PSDRV_Ellipse( DC *dc, INT left, INT top, INT right,
306 extern BOOL PSDRV_EnumDeviceFonts( DC* dc, LPLOGFONT16 plf,
307 DEVICEFONTENUMPROC proc, LPARAM lp );
308 extern INT PSDRV_Escape( DC *dc, INT nEscape, INT cbInput,
309 SEGPTR lpInData, SEGPTR lpOutData );
310 extern BOOL PSDRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
311 const RECT *lprect, LPCSTR str, UINT count,
313 extern BOOL PSDRV_GetCharWidth( DC *dc, UINT firstChar, UINT lastChar,
315 extern BOOL PSDRV_GetTextExtentPoint( DC *dc, LPCSTR str, INT count,
317 extern BOOL PSDRV_GetTextMetrics( DC *dc, TEXTMETRICA *metrics );
318 extern BOOL PSDRV_LineTo( DC *dc, INT x, INT y );
319 extern BOOL PSDRV_MoveToEx( DC *dc, INT x, INT y, LPPOINT pt );
320 extern BOOL PSDRV_Pie( DC *dc, INT left, INT top, INT right,
321 INT bottom, INT xstart, INT ystart,
322 INT xend, INT yend );
323 extern BOOL PSDRV_Polygon( DC *dc, const POINT* pt, INT count );
324 extern BOOL PSDRV_Polyline( DC *dc, const POINT* pt, INT count );
325 extern BOOL PSDRV_PolyPolygon( DC *dc, const POINT* pts, const INT* counts,
327 extern BOOL PSDRV_PolyPolyline( DC *dc, const POINT* pts, const DWORD* counts,
329 extern BOOL PSDRV_Rectangle( DC *dc, INT left, INT top, INT right,
331 extern BOOL PSDRV_RoundRect(DC *dc, INT left, INT top, INT right,
332 INT bottom, INT ell_width, INT ell_height);
333 extern HGDIOBJ PSDRV_SelectObject( DC *dc, HGDIOBJ handle );
334 extern COLORREF PSDRV_SetBkColor( DC *dc, COLORREF color );
335 extern COLORREF PSDRV_SetPixel( DC *dc, INT x, INT y, COLORREF color );
336 extern COLORREF PSDRV_SetTextColor( DC *dc, COLORREF color );
337 extern INT PSDRV_StretchDIBits( DC *dc, INT xDst, INT yDst,
338 INT widthDst, INT heightDst, INT xSrc,
339 INT ySrc, INT widthSrc, INT heightSrc,
340 const void *bits, const BITMAPINFO *info,
341 UINT wUsage, DWORD dwRop );