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[256]; /* 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 */
217 LPSTR output; /* Output file/port */
218 BOOL banding; /* Have we received a NEXTBAND */
219 BOOL OutOfPage; /* Page header not sent yet */
224 PSFONT font; /* Current PS font */
228 PSCOLOR inkColor; /* Last colour set */
230 PSDRV_DEVMODEA *Devmode;
235 extern INT16 WINAPI PSDRV_ExtDeviceMode16(HWND16 hwnd, HANDLE16 hDriver,
236 LPDEVMODEA lpdmOutput, LPSTR lpszDevice, LPSTR lpszPort,
237 LPDEVMODEA lpdmInput, LPSTR lpszProfile, WORD fwMode);
239 extern HANDLE PSDRV_Heap;
240 extern char *PSDRV_ANSIVector[256];
242 extern void PSDRV_MergeDevmodes(PSDRV_DEVMODEA *dm1, PSDRV_DEVMODEA *dm2,
244 extern BOOL PSDRV_GetFontMetrics(void);
245 extern PPD *PSDRV_ParsePPD(char *fname);
246 extern PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name);
247 extern AFM *PSDRV_FindAFMinList(FONTFAMILY *head, char *name);
248 extern void PSDRV_AddAFMtoList(FONTFAMILY **head, AFM *afm);
249 extern void PSDRV_FreeAFMList( FONTFAMILY *head );
251 extern BOOL PSDRV_Init(void);
252 extern HFONT16 PSDRV_FONT_SelectObject( DC *dc, HFONT16 hfont, FONTOBJ *font);
253 extern HPEN PSDRV_PEN_SelectObject( DC * dc, HPEN hpen, PENOBJ * pen );
254 extern HBRUSH PSDRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush,
257 extern BOOL PSDRV_Brush(DC *dc, BOOL EO);
258 extern BOOL PSDRV_SetFont( DC *dc );
259 extern BOOL PSDRV_SetPen( DC *dc );
261 extern BOOL PSDRV_CmpColor(PSCOLOR *col1, PSCOLOR *col2);
262 extern BOOL PSDRV_CopyColor(PSCOLOR *col1, PSCOLOR *col2);
263 extern void PSDRV_CreateColor( PSDRV_PDEVICE *physDev, PSCOLOR *pscolor,
267 extern INT PSDRV_WriteHeader( DC *dc, LPCSTR title );
268 extern INT PSDRV_WriteFooter( DC *dc );
269 extern INT PSDRV_WriteNewPage( DC *dc );
270 extern INT PSDRV_WriteEndPage( DC *dc );
271 extern BOOL PSDRV_WriteMoveTo(DC *dc, INT x, INT y);
272 extern BOOL PSDRV_WriteLineTo(DC *dc, INT x, INT y);
273 extern BOOL PSDRV_WriteStroke(DC *dc);
274 extern BOOL PSDRV_WriteRectangle(DC *dc, INT x, INT y, INT width,
276 extern BOOL PSDRV_WriteRRectangle(DC *dc, INT x, INT y, INT width,
278 extern BOOL PSDRV_WriteSetFont(DC *dc, BOOL UseANSI);
279 extern BOOL PSDRV_WriteShow(DC *dc, char *str, INT count);
280 extern BOOL PSDRV_WriteReencodeFont(DC *dc);
281 extern BOOL PSDRV_WriteSetPen(DC *dc);
282 extern BOOL PSDRV_WriteArc(DC *dc, INT x, INT y, INT w, INT h,
283 double ang1, double ang2);
284 extern BOOL PSDRV_WriteSetColor(DC *dc, PSCOLOR *color);
285 extern BOOL PSDRV_WriteSetBrush(DC *dc);
286 extern BOOL PSDRV_WriteFill(DC *dc);
287 extern BOOL PSDRV_WriteEOFill(DC *dc);
288 extern BOOL PSDRV_WriteGSave(DC *dc);
289 extern BOOL PSDRV_WriteGRestore(DC *dc);
290 extern BOOL PSDRV_WriteNewPath(DC *dc);
291 extern BOOL PSDRV_WriteClosePath(DC *dc);
292 extern BOOL PSDRV_WriteClip(DC *dc);
293 extern BOOL PSDRV_WriteRectClip(DC *dc, CHAR *pszArrayName);
294 extern BOOL PSDRV_WriteEOClip(DC *dc);
295 extern BOOL PSDRV_WriteHatch(DC *dc);
296 extern BOOL PSDRV_WriteRotate(DC *dc, float ang);
297 extern BOOL PSDRV_WriteIndexColorSpaceBegin(DC *dc, int size);
298 extern BOOL PSDRV_WriteIndexColorSpaceEnd(DC *dc);
299 extern BOOL PSDRV_WriteRGB(DC *dc, COLORREF *map, int number);
300 extern BOOL PSDRV_WriteImageDict(DC *dc, WORD depth, INT xDst, INT yDst,
301 INT widthDst, INT heightDst, INT widthSrc,
302 INT heightSrc, char *bits);
303 extern BOOL PSDRV_WriteBytes(DC *dc, const BYTE *bytes, int number);
304 extern BOOL PSDRV_WriteDIBits16(DC *dc, const WORD *words, int number);
305 extern BOOL PSDRV_WriteDIBits24(DC *dc, const BYTE *bits, int number);
306 extern BOOL PSDRV_WriteDIBits32(DC *dc, const BYTE *bits, int number);
307 extern int PSDRV_WriteSpool(DC *dc, LPSTR lpData, WORD cch);
308 extern BOOL PSDRV_WritePatternDict(DC *dc, BITMAP *bm, BYTE *bits);
309 extern BOOL PSDRV_WriteArrayPut(DC *dc, CHAR *pszArrayName, INT nIndex, LONG lCoord);
310 extern BOOL PSDRV_WriteArrayDef(DC *dc, CHAR *pszArrayName, INT nSize);
312 extern BOOL PSDRV_Arc( DC *dc, INT left, INT top, INT right,
313 INT bottom, INT xstart, INT ystart,
314 INT xend, INT yend );
315 extern BOOL PSDRV_Chord( DC *dc, INT left, INT top, INT right,
316 INT bottom, INT xstart, INT ystart,
317 INT xend, INT yend );
318 extern BOOL PSDRV_Ellipse( DC *dc, INT left, INT top, INT right,
320 extern INT PSDRV_EndDoc( DC *dc );
321 extern INT PSDRV_EndPage( DC *dc );
322 extern BOOL PSDRV_EnumDeviceFonts( DC* dc, LPLOGFONT16 plf,
323 DEVICEFONTENUMPROC proc, LPARAM lp );
324 extern INT PSDRV_Escape( DC *dc, INT nEscape, INT cbInput,
325 SEGPTR lpInData, SEGPTR lpOutData );
326 extern BOOL PSDRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
327 const RECT *lprect, LPCSTR str, UINT count,
329 extern BOOL PSDRV_GetCharWidth( DC *dc, UINT firstChar, UINT lastChar,
331 extern BOOL PSDRV_GetTextExtentPoint( DC *dc, LPCSTR str, INT count,
333 extern BOOL PSDRV_GetTextMetrics( DC *dc, TEXTMETRICA *metrics );
334 extern BOOL PSDRV_LineTo( DC *dc, INT x, INT y );
335 extern BOOL PSDRV_MoveToEx( DC *dc, INT x, INT y, LPPOINT pt );
336 extern BOOL PSDRV_PatBlt( DC *dc, INT x, INT y, INT width, INT height, DWORD
338 extern BOOL PSDRV_Pie( DC *dc, INT left, INT top, INT right,
339 INT bottom, INT xstart, INT ystart,
340 INT xend, INT yend );
341 extern BOOL PSDRV_Polygon( DC *dc, const POINT* pt, INT count );
342 extern BOOL PSDRV_Polyline( DC *dc, const POINT* pt, INT count );
343 extern BOOL PSDRV_PolyPolygon( DC *dc, const POINT* pts, const INT* counts,
345 extern BOOL PSDRV_PolyPolyline( DC *dc, const POINT* pts, const DWORD* counts,
347 extern BOOL PSDRV_Rectangle( DC *dc, INT left, INT top, INT right,
349 extern BOOL PSDRV_RoundRect(DC *dc, INT left, INT top, INT right,
350 INT bottom, INT ell_width, INT ell_height);
351 extern HGDIOBJ PSDRV_SelectObject( DC *dc, HGDIOBJ handle );
352 extern COLORREF PSDRV_SetBkColor( DC *dc, COLORREF color );
353 extern VOID PSDRV_SetDeviceClipping( DC *dc );
354 extern COLORREF PSDRV_SetPixel( DC *dc, INT x, INT y, COLORREF color );
355 extern COLORREF PSDRV_SetTextColor( DC *dc, COLORREF color );
356 extern INT PSDRV_StartDoc( DC *dc, const DOCINFOA *doc );
357 extern INT PSDRV_StartPage( DC *dc );
358 extern INT PSDRV_StretchDIBits( DC *dc, INT xDst, INT yDst,
359 INT widthDst, INT heightDst, INT xSrc,
360 INT ySrc, INT widthSrc, INT heightSrc,
361 const void *bits, const BITMAPINFO *info,
362 UINT wUsage, DWORD dwRop );
364 extern INT PSDRV_ExtDeviceMode(LPSTR lpszDriver, HWND hwnd,
365 LPDEVMODEA lpdmOutput,
366 LPSTR lpszDevice, LPSTR lpszPort,
367 LPDEVMODEA lpdmInput, LPSTR lpszProfile,
369 extern DWORD PSDRV_DeviceCapabilities(LPSTR lpszDriver, LPCSTR lpszDevice,
371 WORD fwCapability, LPSTR lpszOutput,
373 VOID PSDRV_DrawLine( DC *dc );