5 * PostScript driver definitions
7 * Copyright 1998 Huw D M Davies
14 #include "wine/wingdi16.h"
29 const UNICODEGLYPH *glyphs;
32 extern const INT PSDRV_AGLGlyphNamesSize;
33 extern GLYPHNAME PSDRV_AGLGlyphNames[];
34 extern UNICODEVECTOR PSDRV_AdobeGlyphList;
37 float llx, lly, urx, ury;
40 typedef struct _tagAFMLIGS {
43 struct _tagAFMLIGS *next;
46 typedef struct _tagAFMMETRICS {
47 int C; /* character */
50 GLYPHNAME *N; /* name */
52 AFMLIGS *L; /* Ligatures */
56 USHORT usUnitsPerEm; /* head:unitsPerEm */
57 SHORT sAscender; /* hhea:Ascender */
58 SHORT sDescender; /* hhea:Descender */
59 SHORT sLineGap; /* hhea:LineGap */
60 SHORT sAvgCharWidth; /* OS/2:xAvgCharWidth */
61 SHORT sTypoAscender; /* OS/2:sTypoAscender */
62 SHORT sTypoDescender; /* OS/2:sTypoDescender */
63 SHORT sTypoLineGap; /* OS/2:sTypeLineGap */
64 USHORT usWinAscent; /* OS/2:usWinAscent */
65 USHORT usWinDescent; /* OS/2:usWinDescent */
68 typedef struct _tagAFM {
73 LONG Weight; /* FW_NORMAL etc. */
76 float UnderlinePosition;
77 float UnderlineThickness;
83 float FullAscender; /* Ascent of Aring character */
84 WINMETRICS WinMetrics;
85 float CharWidths[256];
88 UNICODEVECTOR *Encoding;
89 } AFM; /* CharWidths is a shortcut to the WX values of numbered glyphs */
91 /* Note no 'next' in AFM. Use AFMLISTENTRY as a container. This allow more than
92 one list to exist without having to reallocate the entire AFM structure. We
93 keep a global list of all afms (PSDRV_AFMFontList) plus a list of available
94 fonts for each DC (dc->physDev->Fonts) */
96 typedef struct _tagAFMLISTENTRY {
98 struct _tagAFMLISTENTRY *next;
101 typedef struct _tagFONTFAMILY {
102 char *FamilyName; /* family name */
103 AFMLISTENTRY *afmlist; /* list of afms for this family */
104 struct _tagFONTFAMILY *next; /* next family */
107 extern FONTFAMILY *PSDRV_AFMFontList;
109 typedef struct _tagFONTNAME {
111 struct _tagFONTNAME *next;
115 float llx, lly, urx, ury;
124 typedef struct _tagPAGESIZE {
127 char *InvocationString;
128 IMAGEABLEAREA *ImageableArea;
129 PAPERDIMENSION *PaperDimension;
130 WORD WinPage; /*eg DMPAPER_A4. Doesn't really belong here */
131 struct _tagPAGESIZE *next;
135 typedef struct _tagOPTIONENTRY {
136 char *Name; /* eg "True" */
137 char *FullName; /* eg "Installed" */
138 char *InvocationString; /* Often NULL */
139 struct _tagOPTIONENTRY *next;
142 typedef struct _tagOPTION { /* Treat bool as a special case of pickone */
143 char *OptionName; /* eg "*Option1" */
144 char *FullName; /* eg "Envelope Feeder" */
145 char *DefaultOption; /* eg "False" */
146 OPTIONENTRY *Options;
147 struct _tagOPTION *next;
150 typedef struct _tagCONSTRAINT {
155 struct _tagCONSTRAINT *next;
158 typedef struct _tagINPUTSLOT {
161 char *InvocationString;
162 WORD WinBin; /* eg DMBIN_LOWER */
163 struct _tagINPUTSLOT *next;
170 int DefaultResolution;
171 signed int LandscapeOrientation;
173 char *JCLToPSInterpreter;
176 FONTNAME *InstalledFonts; /* ptr to a list of FontNames */
178 OPTION *InstalledOptions;
179 CONSTRAINT *Constraints;
180 INPUTSLOT *InputSlots;
185 struct _tagdocprivate {
188 struct _tagdrvprivate {
189 UINT numInstalledOptions; /* Options at end of struct */
194 numInstalledOptions of OPTIONs
200 typedef struct _tagPI {
203 PSDRV_DEVMODEA *Devmode;
205 PPRINTER_ENUM_VALUESA FontSubTable;
206 DWORD FontSubTableSize;
219 /* def's for PSCOLOR.type */
220 #define PSCOLOR_GRAY 0
221 #define PSCOLOR_RGB 1
238 BOOL set; /* Have we done a setfont yet */
256 LPSTR output; /* Output file/port */
257 BOOL banding; /* Have we received a NEXTBAND */
258 BOOL OutOfPage; /* Page header not sent yet */
263 PSFONT font; /* Current PS font */
267 PSCOLOR inkColor; /* Last colour set */
269 PSDRV_DEVMODEA *Devmode;
271 RECT PageSize; /* Imageable area in device co-ords */
276 PSDRV_DEVMODEA *dlgdm;
279 extern INT16 WINAPI PSDRV_ExtDeviceMode16(HWND16 hwnd, HANDLE16 hDriver,
280 LPDEVMODEA lpdmOutput, LPSTR lpszDevice, LPSTR lpszPort,
281 LPDEVMODEA lpdmInput, LPSTR lpszProfile, WORD fwMode);
283 extern HANDLE PSDRV_Heap;
284 extern char *PSDRV_ANSIVector[256];
286 extern void PSDRV_MergeDevmodes(PSDRV_DEVMODEA *dm1, PSDRV_DEVMODEA *dm2,
288 extern BOOL PSDRV_GetFontMetrics(void);
289 extern PPD *PSDRV_ParsePPD(char *fname);
290 extern PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name);
291 extern AFM *PSDRV_FindAFMinList(FONTFAMILY *head, char *name);
292 extern BOOL PSDRV_AddAFMtoList(FONTFAMILY **head, AFM *afm);
293 extern void PSDRV_FreeAFMList( FONTFAMILY *head );
295 extern BOOL WINAPI PSDRV_Init(HINSTANCE hinst, DWORD reason, LPVOID reserved);
296 extern HFONT16 PSDRV_FONT_SelectObject( DC *dc, HFONT16 hfont, FONTOBJ *font);
297 extern HPEN PSDRV_PEN_SelectObject( DC * dc, HPEN hpen, PENOBJ * pen );
298 extern HBRUSH PSDRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush,
301 extern BOOL PSDRV_Brush(DC *dc, BOOL EO);
302 extern BOOL PSDRV_SetFont( DC *dc );
303 extern BOOL PSDRV_SetPen( DC *dc );
305 extern BOOL PSDRV_CmpColor(PSCOLOR *col1, PSCOLOR *col2);
306 extern BOOL PSDRV_CopyColor(PSCOLOR *col1, PSCOLOR *col2);
307 extern void PSDRV_CreateColor( PSDRV_PDEVICE *physDev, PSCOLOR *pscolor,
309 extern char PSDRV_UnicodeToANSI(int u);
311 extern INT PSDRV_WriteHeader( DC *dc, LPCSTR title );
312 extern INT PSDRV_WriteFooter( DC *dc );
313 extern INT PSDRV_WriteNewPage( DC *dc );
314 extern INT PSDRV_WriteEndPage( DC *dc );
315 extern BOOL PSDRV_WriteMoveTo(DC *dc, INT x, INT y);
316 extern BOOL PSDRV_WriteLineTo(DC *dc, INT x, INT y);
317 extern BOOL PSDRV_WriteStroke(DC *dc);
318 extern BOOL PSDRV_WriteRectangle(DC *dc, INT x, INT y, INT width,
320 extern BOOL PSDRV_WriteRRectangle(DC *dc, INT x, INT y, INT width,
322 extern BOOL PSDRV_WriteSetFont(DC *dc, BOOL UseANSI);
323 extern BOOL PSDRV_WriteShow(DC *dc, LPCWSTR str, INT count);
324 extern BOOL PSDRV_WriteReencodeFont(DC *dc);
325 extern BOOL PSDRV_WriteSetPen(DC *dc);
326 extern BOOL PSDRV_WriteArc(DC *dc, INT x, INT y, INT w, INT h,
327 double ang1, double ang2);
328 extern BOOL PSDRV_WriteSetColor(DC *dc, PSCOLOR *color);
329 extern BOOL PSDRV_WriteSetBrush(DC *dc);
330 extern BOOL PSDRV_WriteFill(DC *dc);
331 extern BOOL PSDRV_WriteEOFill(DC *dc);
332 extern BOOL PSDRV_WriteGSave(DC *dc);
333 extern BOOL PSDRV_WriteGRestore(DC *dc);
334 extern BOOL PSDRV_WriteNewPath(DC *dc);
335 extern BOOL PSDRV_WriteClosePath(DC *dc);
336 extern BOOL PSDRV_WriteInitClip(DC *dc);
337 extern BOOL PSDRV_WriteClip(DC *dc);
338 extern BOOL PSDRV_WriteRectClip(DC *dc, INT x, INT y, INT w, INT h);
339 extern BOOL PSDRV_WriteRectClip2(DC *dc, CHAR *pszArrayName);
340 extern BOOL PSDRV_WriteEOClip(DC *dc);
341 extern BOOL PSDRV_WriteHatch(DC *dc);
342 extern BOOL PSDRV_WriteRotate(DC *dc, float ang);
343 extern BOOL PSDRV_WriteIndexColorSpaceBegin(DC *dc, int size);
344 extern BOOL PSDRV_WriteIndexColorSpaceEnd(DC *dc);
345 extern BOOL PSDRV_WriteRGB(DC *dc, COLORREF *map, int number);
346 extern BOOL PSDRV_WriteImageDict(DC *dc, WORD depth, INT xDst, INT yDst,
347 INT widthDst, INT heightDst, INT widthSrc,
348 INT heightSrc, char *bits);
349 extern BOOL PSDRV_WriteBytes(DC *dc, const BYTE *bytes, int number);
350 extern BOOL PSDRV_WriteDIBits16(DC *dc, const WORD *words, int number);
351 extern BOOL PSDRV_WriteDIBits24(DC *dc, const BYTE *bits, int number);
352 extern BOOL PSDRV_WriteDIBits32(DC *dc, const BYTE *bits, int number);
353 extern int PSDRV_WriteSpool(DC *dc, LPSTR lpData, WORD cch);
354 extern BOOL PSDRV_WritePatternDict(DC *dc, BITMAP *bm, BYTE *bits);
355 extern BOOL PSDRV_WriteArrayPut(DC *dc, CHAR *pszArrayName, INT nIndex, LONG lCoord);
356 extern BOOL PSDRV_WriteArrayDef(DC *dc, CHAR *pszArrayName, INT nSize);
358 extern BOOL PSDRV_Arc( DC *dc, INT left, INT top, INT right,
359 INT bottom, INT xstart, INT ystart,
360 INT xend, INT yend );
361 extern BOOL PSDRV_Chord( DC *dc, INT left, INT top, INT right,
362 INT bottom, INT xstart, INT ystart,
363 INT xend, INT yend );
364 extern BOOL PSDRV_Ellipse( DC *dc, INT left, INT top, INT right,
366 extern INT PSDRV_EndDoc( DC *dc );
367 extern INT PSDRV_EndPage( DC *dc );
368 extern BOOL PSDRV_EnumDeviceFonts( HDC hdc, LPLOGFONTW plf,
369 DEVICEFONTENUMPROC proc, LPARAM lp );
370 extern INT PSDRV_Escape( DC *dc, INT nEscape, INT cbInput,
371 SEGPTR lpInData, SEGPTR lpOutData );
372 extern BOOL PSDRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
373 const RECT *lprect, LPCWSTR str, UINT count,
375 extern BOOL PSDRV_GetCharWidth( DC *dc, UINT firstChar, UINT lastChar,
377 extern BOOL PSDRV_GetTextExtentPoint( DC *dc, LPCWSTR str, INT count,
379 extern BOOL PSDRV_GetTextMetrics( DC *dc, TEXTMETRICW *metrics );
380 extern BOOL PSDRV_LineTo( DC *dc, INT x, INT y );
381 extern BOOL PSDRV_PatBlt( DC *dc, INT x, INT y, INT width, INT height, DWORD
383 extern BOOL PSDRV_Pie( DC *dc, INT left, INT top, INT right,
384 INT bottom, INT xstart, INT ystart,
385 INT xend, INT yend );
386 extern BOOL PSDRV_Polygon( DC *dc, const POINT* pt, INT count );
387 extern BOOL PSDRV_Polyline( DC *dc, const POINT* pt, INT count );
388 extern BOOL PSDRV_PolyPolygon( DC *dc, const POINT* pts, const INT* counts,
390 extern BOOL PSDRV_PolyPolyline( DC *dc, const POINT* pts, const DWORD* counts,
392 extern BOOL PSDRV_Rectangle( DC *dc, INT left, INT top, INT right,
394 extern BOOL PSDRV_RoundRect(DC *dc, INT left, INT top, INT right,
395 INT bottom, INT ell_width, INT ell_height);
396 extern HGDIOBJ PSDRV_SelectObject( DC *dc, HGDIOBJ handle );
397 extern COLORREF PSDRV_SetBkColor( DC *dc, COLORREF color );
398 extern VOID PSDRV_SetDeviceClipping( DC *dc );
399 extern COLORREF PSDRV_SetPixel( DC *dc, INT x, INT y, COLORREF color );
400 extern COLORREF PSDRV_SetTextColor( DC *dc, COLORREF color );
401 extern INT PSDRV_StartDoc( DC *dc, const DOCINFOA *doc );
402 extern INT PSDRV_StartPage( DC *dc );
403 extern INT PSDRV_StretchDIBits( DC *dc, INT xDst, INT yDst,
404 INT widthDst, INT heightDst, INT xSrc,
405 INT ySrc, INT widthSrc, INT heightSrc,
406 const void *bits, const BITMAPINFO *info,
407 UINT wUsage, DWORD dwRop );
409 extern INT PSDRV_ExtDeviceMode(LPSTR lpszDriver, HWND hwnd,
410 LPDEVMODEA lpdmOutput,
411 LPSTR lpszDevice, LPSTR lpszPort,
412 LPDEVMODEA lpdmInput, LPSTR lpszProfile,
414 extern DWORD PSDRV_DeviceCapabilities(LPSTR lpszDriver, LPCSTR lpszDevice,
416 WORD fwCapability, LPSTR lpszOutput,
418 VOID PSDRV_DrawLine( DC *dc );
419 INT PSDRV_GlyphListInit();
420 GLYPHNAME *PSDRV_GlyphName(LPCSTR szName);
421 VOID PSDRV_IndexGlyphList();
422 BOOL PSDRV_GetTrueTypeMetrics();