5 * PostScript driver definitions
7 * Copyright 1998 Huw D M Davies
13 #include "wine/wingdi16.h"
16 float llx, lly, urx, ury;
19 typedef struct _tagAFMLIGS {
22 struct _tagAFMLIGS *next;
25 typedef struct _tagAFMMETRICS {
26 int C; /* character */
30 AFMLIGS *L; /* Ligatures */
31 struct _tagAFMMETRICS *next;
34 typedef struct _tagAFM {
39 int Weight; /* FW_NORMAL etc. */
42 float UnderlinePosition;
43 float UnderlineThickness;
49 float FullAscender; /* Ascent of Aring character */
50 float CharWidths[256];
53 } AFM; /* CharWidths is a shortcut to the WX values of numbered glyphs */
55 /* Note no 'next' in AFM. Use AFMLISTENTRY as a container. This allow more than
56 one list to exist without having to reallocate the entire AFM structure. We
57 keep a global list of all afms (PSDRV_AFMFontList) plus a list of available
58 fonts for each DC (dc->physDev->Fonts) */
60 typedef struct _tagAFMLISTENTRY {
62 struct _tagAFMLISTENTRY *next;
65 typedef struct _tagFONTFAMILY {
66 char *FamilyName; /* family name */
67 AFMLISTENTRY *afmlist; /* list of afms for this family */
68 struct _tagFONTFAMILY *next; /* next family */
71 extern FONTFAMILY *PSDRV_AFMFontList;
73 typedef struct _tagFONTNAME {
75 struct _tagFONTNAME *next;
79 float llx, lly, urx, ury;
86 typedef struct _tagPAGESIZE {
89 char *InvocationString;
90 IMAGEABLEAREA *ImageableArea;
91 PAPERDIMENSION *PaperDimension;
92 WORD WinPage; /*eg DMPAPER_A4. Doesn't really belong here */
93 struct _tagPAGESIZE *next;
97 typedef struct _tagOPTIONENTRY {
98 char *Name; /* eg "True" */
99 char *FullName; /* eg "Installed" */
100 char *InvocationString; /* Often NULL */
101 struct _tagOPTIONENTRY *next;
104 typedef struct _tagOPTION { /* Treat bool as a special case of pickone */
105 char *OptionName; /* eg "*Option1" */
106 char *FullName; /* eg "Envelope Feeder" */
107 char *DefaultOption; /* eg "False" */
108 OPTIONENTRY *Options;
109 struct _tagOPTION *next;
112 typedef struct _tagCONSTRAINT {
117 struct _tagCONSTRAINT *next;
120 typedef struct _tagINPUTSLOT {
123 char *InvocationString;
124 WORD WinBin; /* eg DMBIN_LOWER */
125 struct _tagINPUTSLOT *next;
132 int DefaultResolution;
133 signed int LandscapeOrientation;
135 char *JCLToPSInterpreter;
138 FONTNAME *InstalledFonts; /* ptr to a list of FontNames */
140 OPTION *InstalledOptions;
141 CONSTRAINT *Constraints;
142 INPUTSLOT *InputSlots;
147 struct _tagdocprivate {
150 struct _tagdrvprivate {
151 char ppdFileName[100]; /* Hack */
152 UINT numInstalledOptions; /* Options at end of struct */
157 numInstalledOptions of OPTIONs
163 typedef struct _tagPI {
166 PSDRV_DEVMODEA *Devmode;
180 /* def's for PSCOLOR.type */
181 #define PSCOLOR_GRAY 0
182 #define PSCOLOR_RGB 1
199 BOOL set; /* Have we done a setfont yet */
216 LPSTR output; /* Output file/port */
217 BOOL banding; /* Have we received a NEXTBAND */
218 BOOL NeedPageHeader; /* Page header not sent yet */
223 PSFONT font; /* Current PS font */
227 PSCOLOR inkColor; /* Last colour set */
229 PSDRV_DEVMODEA *Devmode;
234 extern INT16 WINAPI PSDRV_ExtDeviceMode16(HWND16 hwnd, HANDLE16 hDriver,
235 LPDEVMODEA lpdmOutput, LPSTR lpszDevice, LPSTR lpszPort,
236 LPDEVMODEA lpdmInput, LPSTR lpszProfile, WORD fwMode);
238 extern HANDLE PSDRV_Heap;
239 extern char *PSDRV_ANSIVector[256];
241 extern void PSDRV_MergeDevmodes(PSDRV_DEVMODEA *dm1, PSDRV_DEVMODEA *dm2,
243 extern BOOL PSDRV_GetFontMetrics(void);
244 extern PPD *PSDRV_ParsePPD(char *fname);
245 extern PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name);
246 extern AFM *PSDRV_FindAFMinList(FONTFAMILY *head, char *name);
247 extern void PSDRV_AddAFMtoList(FONTFAMILY **head, AFM *afm);
248 extern void PSDRV_FreeAFMList( FONTFAMILY *head );
250 extern BOOL PSDRV_Init(void);
251 extern HFONT16 PSDRV_FONT_SelectObject( DC *dc, HFONT16 hfont, FONTOBJ *font);
252 extern HPEN PSDRV_PEN_SelectObject( DC * dc, HPEN hpen, PENOBJ * pen );
253 extern HBRUSH PSDRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush,
256 extern BOOL PSDRV_Brush(DC *dc, BOOL EO);
257 extern BOOL PSDRV_SetFont( DC *dc );
258 extern BOOL PSDRV_SetPen( DC *dc );
260 extern BOOL PSDRV_CmpColor(PSCOLOR *col1, PSCOLOR *col2);
261 extern BOOL PSDRV_CopyColor(PSCOLOR *col1, PSCOLOR *col2);
262 extern void PSDRV_CreateColor( PSDRV_PDEVICE *physDev, PSCOLOR *pscolor,
266 extern INT PSDRV_WriteHeader( DC *dc, char *title, int len );
267 extern INT PSDRV_WriteFooter( DC *dc );
268 extern INT PSDRV_WriteNewPage( DC *dc );
269 extern INT PSDRV_WriteEndPage( DC *dc );
270 extern BOOL PSDRV_WriteMoveTo(DC *dc, INT x, INT y);
271 extern BOOL PSDRV_WriteLineTo(DC *dc, INT x, INT y);
272 extern BOOL PSDRV_WriteStroke(DC *dc);
273 extern BOOL PSDRV_WriteRectangle(DC *dc, INT x, INT y, INT width,
275 extern BOOL PSDRV_WriteSetFont(DC *dc, BOOL UseANSI);
276 extern BOOL PSDRV_WriteShow(DC *dc, char *str, INT count);
277 extern BOOL PSDRV_WriteReencodeFont(DC *dc);
278 extern BOOL PSDRV_WriteSetPen(DC *dc);
279 extern BOOL PSDRV_WriteArc(DC *dc, INT x, INT y, INT w, INT h,
280 double ang1, double ang2);
281 extern BOOL PSDRV_WriteSetColor(DC *dc, PSCOLOR *color);
282 extern BOOL PSDRV_WriteSetBrush(DC *dc);
283 extern BOOL PSDRV_WriteFill(DC *dc);
284 extern BOOL PSDRV_WriteEOFill(DC *dc);
285 extern BOOL PSDRV_WriteGSave(DC *dc);
286 extern BOOL PSDRV_WriteGRestore(DC *dc);
287 extern BOOL PSDRV_WriteClosePath(DC *dc);
288 extern BOOL PSDRV_WriteClip(DC *dc);
289 extern BOOL PSDRV_WriteEOClip(DC *dc);
290 extern BOOL PSDRV_WriteHatch(DC *dc);
291 extern BOOL PSDRV_WriteRotate(DC *dc, float ang);
292 extern BOOL PSDRV_WriteIndexColorSpaceBegin(DC *dc, int size);
293 extern BOOL PSDRV_WriteIndexColorSpaceEnd(DC *dc);
294 extern BOOL PSDRV_WriteRGB(DC *dc, COLORREF *map, int number);
295 extern BOOL PSDRV_WriteImageDict(DC *dc, WORD depth, INT xDst, INT yDst,
296 INT widthDst, INT heightDst, INT widthSrc,
298 extern BOOL PSDRV_WriteBytes(DC *dc, const BYTE *bytes, int number);
299 extern BOOL PSDRV_WriteDIBits16(DC *dc, const WORD *words, int number);
300 extern BOOL PSDRV_WriteDIBits24(DC *dc, const BYTE *bits, int number);
301 extern BOOL PSDRV_WriteDIBits32(DC *dc, const BYTE *bits, int number);
302 extern int PSDRV_WriteSpool(DC *dc, LPSTR lpData, WORD cch);
306 extern BOOL PSDRV_Arc( DC *dc, INT left, INT top, INT right,
307 INT bottom, INT xstart, INT ystart,
308 INT xend, INT yend );
309 extern BOOL PSDRV_Chord( DC *dc, INT left, INT top, INT right,
310 INT bottom, INT xstart, INT ystart,
311 INT xend, INT yend );
312 extern BOOL PSDRV_Ellipse( DC *dc, INT left, INT top, INT right,
314 extern BOOL PSDRV_EnumDeviceFonts( DC* dc, LPLOGFONT16 plf,
315 DEVICEFONTENUMPROC proc, LPARAM lp );
316 extern INT PSDRV_Escape( DC *dc, INT nEscape, INT cbInput,
317 SEGPTR lpInData, SEGPTR lpOutData );
318 extern BOOL PSDRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
319 const RECT *lprect, LPCSTR str, UINT count,
321 extern BOOL PSDRV_GetCharWidth( DC *dc, UINT firstChar, UINT lastChar,
323 extern BOOL PSDRV_GetTextExtentPoint( DC *dc, LPCSTR str, INT count,
325 extern BOOL PSDRV_GetTextMetrics( DC *dc, TEXTMETRICA *metrics );
326 extern BOOL PSDRV_LineTo( DC *dc, INT x, INT y );
327 extern BOOL PSDRV_MoveToEx( DC *dc, INT x, INT y, LPPOINT pt );
328 extern BOOL PSDRV_Pie( DC *dc, INT left, INT top, INT right,
329 INT bottom, INT xstart, INT ystart,
330 INT xend, INT yend );
331 extern BOOL PSDRV_Polygon( DC *dc, const POINT* pt, INT count );
332 extern BOOL PSDRV_Polyline( DC *dc, const POINT* pt, INT count );
333 extern BOOL PSDRV_PolyPolygon( DC *dc, const POINT* pts, const INT* counts,
335 extern BOOL PSDRV_PolyPolyline( DC *dc, const POINT* pts, const DWORD* counts,
337 extern BOOL PSDRV_Rectangle( DC *dc, INT left, INT top, INT right,
339 extern BOOL PSDRV_RoundRect(DC *dc, INT left, INT top, INT right,
340 INT bottom, INT ell_width, INT ell_height);
341 extern HGDIOBJ PSDRV_SelectObject( DC *dc, HGDIOBJ handle );
342 extern COLORREF PSDRV_SetBkColor( DC *dc, COLORREF color );
343 extern COLORREF PSDRV_SetPixel( DC *dc, INT x, INT y, COLORREF color );
344 extern COLORREF PSDRV_SetTextColor( DC *dc, COLORREF color );
345 extern INT PSDRV_StretchDIBits( DC *dc, INT xDst, INT yDst,
346 INT widthDst, INT heightDst, INT xSrc,
347 INT ySrc, INT widthSrc, INT heightSrc,
348 const void *bits, const BITMAPINFO *info,
349 UINT wUsage, DWORD dwRop );
350 extern INT PSDRV_ExtDeviceMode(HWND hwnd, LPDEVMODEA lpdmOutput,
351 LPSTR lpszDevice, LPSTR lpszPort,
352 LPDEVMODEA lpdmInput, LPSTR lpszProfile,
354 extern DWORD PSDRV_DeviceCapabilities(LPCSTR lpszDevice, LPCSTR lpszPort,
355 WORD fwCapability, LPSTR lpszOutput,