wineps: Store the document title as a unicode string.
[wine/multimedia.git] / dlls / wineps.drv / psdrv.h
blob13d8de215124274f34b19673d2945ea45b5aaa69
1 /*
2 * PostScript driver definitions
4 * Copyright 1998 Huw D M Davies
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __WINE_PSDRV_H
22 #define __WINE_PSDRV_H
24 #include <stdarg.h>
26 #include "windef.h"
27 #include "winbase.h"
28 #include "wingdi.h"
29 #include "winspool.h"
31 #include "wine/unicode.h"
32 #include "wine/gdi_driver.h"
33 #include "wine/list.h"
35 typedef struct {
36 INT index;
37 LPCSTR sz;
38 } GLYPHNAME;
40 typedef struct {
41 LONG UV;
42 const GLYPHNAME *name;
43 } UNICODEGLYPH;
45 typedef struct {
46 float llx, lly, urx, ury;
47 } AFMBBOX;
49 typedef struct _tagAFMLIGS {
50 char *successor;
51 char *ligature;
52 struct _tagAFMLIGS *next;
53 } AFMLIGS;
55 typedef struct {
56 int C; /* character */
57 LONG UV;
58 float WX;
59 const GLYPHNAME *N; /* name */
60 AFMBBOX B;
61 const AFMLIGS *L; /* Ligatures */
62 } OLD_AFMMETRICS;
64 typedef struct {
65 INT C; /* AFM encoding (or -1) */
66 LONG UV; /* Unicode value */
67 FLOAT WX; /* Advance width */
68 const GLYPHNAME *N; /* Glyph name */
69 } AFMMETRICS;
71 typedef struct {
72 USHORT usUnitsPerEm; /* head:unitsPerEm */
73 SHORT sAscender; /* hhea:Ascender */
74 SHORT sDescender; /* hhea:Descender */
75 SHORT sLineGap; /* hhea:LineGap */
76 SHORT sAvgCharWidth; /* OS/2:xAvgCharWidth */
77 SHORT sTypoAscender; /* OS/2:sTypoAscender */
78 SHORT sTypoDescender; /* OS/2:sTypoDescender */
79 SHORT sTypoLineGap; /* OS/2:sTypeLineGap */
80 USHORT usWinAscent; /* OS/2:usWinAscent */
81 USHORT usWinDescent; /* OS/2:usWinDescent */
82 } WINMETRICS;
84 typedef struct _tagAFM {
85 LPCSTR FontName;
86 LPCSTR FullName;
87 LPCSTR FamilyName;
88 LPCSTR EncodingScheme;
89 LONG Weight; /* FW_NORMAL etc. */
90 float ItalicAngle;
91 BOOL IsFixedPitch;
92 float UnderlinePosition;
93 float UnderlineThickness;
94 AFMBBOX FontBBox;
95 float Ascender;
96 float Descender;
97 WINMETRICS WinMetrics;
98 int NumofMetrics;
99 const AFMMETRICS *Metrics;
100 } AFM;
102 /* Note no 'next' in AFM. Use AFMLISTENTRY as a container. This allow more than
103 one list to exist without having to reallocate the entire AFM structure. We
104 keep a global list of all afms (PSDRV_AFMFontList) plus a list of available
105 fonts for each DC (dc->physDev->Fonts) */
107 typedef struct _tagAFMLISTENTRY {
108 const AFM *afm;
109 struct _tagAFMLISTENTRY *next;
110 } AFMLISTENTRY;
112 typedef struct _tagFONTFAMILY {
113 char *FamilyName; /* family name */
114 AFMLISTENTRY *afmlist; /* list of afms for this family */
115 struct _tagFONTFAMILY *next; /* next family */
116 } FONTFAMILY;
118 extern FONTFAMILY *PSDRV_AFMFontList DECLSPEC_HIDDEN;
119 extern const AFM *const PSDRV_BuiltinAFMs[] DECLSPEC_HIDDEN; /* last element is NULL */
121 typedef struct _tagFONTNAME {
122 char *Name;
123 struct _tagFONTNAME *next;
124 } FONTNAME;
126 typedef struct {
127 float llx, lly, urx, ury;
128 } IMAGEABLEAREA;
130 typedef struct {
131 float x, y;
132 } PAPERDIMENSION;
134 /* Solaris kludge */
135 #undef PAGESIZE
136 typedef struct _tagPAGESIZE {
137 struct list entry;
138 char *Name;
139 char *FullName;
140 char *InvocationString;
141 IMAGEABLEAREA *ImageableArea;
142 PAPERDIMENSION *PaperDimension;
143 WORD WinPage; /*eg DMPAPER_A4. Doesn't really belong here */
144 } PAGESIZE;
147 /* For BANDINFO Escape */
148 typedef struct _BANDINFOSTRUCT
150 BOOL GraphicsFlag;
151 BOOL TextFlag;
152 RECT GraphicsRect;
153 } BANDINFOSTRUCT, *PBANDINFOSTRUCT;
155 typedef struct _tagOPTIONENTRY {
156 char *Name; /* eg "True" */
157 char *FullName; /* eg "Installed" */
158 char *InvocationString; /* Often NULL */
159 struct _tagOPTIONENTRY *next;
160 } OPTIONENTRY;
162 typedef struct _tagOPTION { /* Treat bool as a special case of pickone */
163 char *OptionName; /* eg "*Option1" */
164 char *FullName; /* eg "Envelope Feeder" */
165 char *DefaultOption; /* eg "False" */
166 OPTIONENTRY *Options;
167 struct _tagOPTION *next;
168 } OPTION;
170 typedef struct _tagCONSTRAINT {
171 char *Feature1;
172 char *Value1;
173 char *Feature2;
174 char *Value2;
175 struct _tagCONSTRAINT *next;
176 } CONSTRAINT;
178 typedef struct _tagINPUTSLOT {
179 const char *Name;
180 const char *FullName;
181 char *InvocationString;
182 WORD WinBin; /* eg DMBIN_LOWER */
183 struct _tagINPUTSLOT *next;
184 } INPUTSLOT;
186 typedef enum _RASTERIZEROPTION
187 {RO_None, RO_Accept68K, RO_Type42, RO_TrueImage} RASTERIZEROPTION;
189 typedef struct _tagDUPLEX {
190 char *Name;
191 char *FullName;
192 char *InvocationString;
193 WORD WinDuplex; /* eg DMDUP_SIMPLEX */
194 struct _tagDUPLEX *next;
195 } DUPLEX;
197 /* Many Mac OS X based ppd files don't include a *ColorDevice line, so
198 we use a tristate here rather than a boolean. Code that
199 cares is expected to treat these as if they were colour. */
200 typedef enum {
201 CD_NotSpecified,
202 CD_False,
203 CD_True
204 } COLORDEVICE;
206 typedef struct {
207 char *NickName;
208 int LanguageLevel;
209 COLORDEVICE ColorDevice;
210 int DefaultResolution;
211 signed int LandscapeOrientation;
212 char *JCLBegin;
213 char *JCLToPSInterpreter;
214 char *JCLEnd;
215 char *DefaultFont;
216 FONTNAME *InstalledFonts; /* ptr to a list of FontNames */
217 struct list PageSizes;
218 PAGESIZE *DefaultPageSize;
219 OPTION *InstalledOptions;
220 CONSTRAINT *Constraints;
221 INPUTSLOT *InputSlots;
222 RASTERIZEROPTION TTRasterizer;
223 DUPLEX *Duplexes;
224 DUPLEX *DefaultDuplex;
225 } PPD;
227 typedef struct {
228 DEVMODEA dmPublic;
229 struct _tagdocprivate {
230 int dummy;
231 } dmDocPrivate;
232 struct _tagdrvprivate {
233 UINT numInstalledOptions; /* Options at end of struct */
234 } dmDrvPrivate;
236 /* Now comes:
238 numInstalledOptions of OPTIONs
242 } PSDRV_DEVMODEA;
244 typedef struct _tagPI {
245 char *FriendlyName;
246 PPD *ppd;
247 PSDRV_DEVMODEA *Devmode;
248 FONTFAMILY *Fonts;
249 PPRINTER_ENUM_VALUESA FontSubTable;
250 DWORD FontSubTableSize;
251 struct _tagPI *next;
252 } PRINTERINFO;
254 typedef struct {
255 float r, g, b;
256 } PSRGB;
258 typedef struct {
259 float i;
260 } PSGRAY;
263 /* def's for PSCOLOR.type */
264 #define PSCOLOR_GRAY 0
265 #define PSCOLOR_RGB 1
267 typedef struct {
268 int type;
269 union {
270 PSRGB rgb;
271 PSGRAY gray;
272 } value;
273 } PSCOLOR;
275 typedef struct {
276 const AFM *afm;
277 float scale;
278 TEXTMETRICW tm;
279 } BUILTIN;
281 typedef struct tagTYPE42 TYPE42;
283 typedef struct tagTYPE1 TYPE1;
285 enum downloadtype {
286 Type1, Type42
289 typedef struct _tagDOWNLOAD {
290 enum downloadtype type;
291 union {
292 TYPE1 *Type1;
293 TYPE42 *Type42;
294 } typeinfo;
295 char *ps_name;
296 struct _tagDOWNLOAD *next;
297 } DOWNLOAD;
299 enum fontloc {
300 Builtin, Download
303 typedef struct
305 INT xx, xy, yx, yy;
306 } matrix;
308 typedef struct {
309 enum fontloc fontloc;
310 union {
311 BUILTIN Builtin;
312 DOWNLOAD *Download;
313 } fontinfo;
315 matrix size;
316 PSCOLOR color;
317 BOOL set; /* Have we done a setfont yet */
319 /* These are needed by PSDRV_ExtTextOut */
320 int escapement;
321 int underlineThickness;
322 int underlinePosition;
323 int strikeoutThickness;
324 int strikeoutPosition;
326 } PSFONT;
328 typedef struct {
329 PSCOLOR color;
330 BOOL set;
331 struct brush_pattern pattern;
332 } PSBRUSH;
334 #define MAX_DASHLEN 16
336 typedef struct {
337 INT style;
338 INT width;
339 BYTE join;
340 BYTE endcap;
341 DWORD dash[MAX_DASHLEN];
342 DWORD dash_len;
343 PSCOLOR color;
344 BOOL set;
345 } PSPEN;
347 typedef struct {
348 DWORD id; /* Job id */
349 HANDLE hprinter; /* Printer handle */
350 LPWSTR output; /* Output file/port */
351 LPWSTR doc_name; /* Document Name */
352 BOOL banding; /* Have we received a NEXTBAND */
353 BOOL OutOfPage; /* Page header not sent yet */
354 INT PageNo;
355 BOOL quiet; /* Don't actually output anything */
356 BOOL in_passthrough; /* In PASSTHROUGH mode */
357 BOOL had_passthrough_rect; /* See the comment in PSDRV_Rectangle */
358 } JOB;
360 typedef struct
362 struct gdi_physdev dev;
363 PSFONT font; /* Current PS font */
364 DOWNLOAD *downloaded_fonts;
365 PSPEN pen;
366 PSBRUSH brush;
367 PSCOLOR bkColor;
368 PSCOLOR inkColor; /* Last colour set */
369 JOB job;
370 PSDRV_DEVMODEA *Devmode;
371 PRINTERINFO *pi;
372 SIZE PageSize; /* Physical page size in device units */
373 RECT ImageableArea; /* Imageable area in device units */
374 /* NB both PageSize and ImageableArea
375 are not rotated in landscape mode,
376 so PageSize.cx is generally
377 < PageSize.cy */
378 int horzRes; /* device caps */
379 int vertRes;
380 int horzSize;
381 int vertSize;
382 int logPixelsX;
383 int logPixelsY;
385 int pathdepth;
386 } PSDRV_PDEVICE;
388 typedef struct {
389 PRINTERINFO *pi;
390 PSDRV_DEVMODEA *dlgdm;
391 } PSDRV_DLGINFO;
393 static inline PSDRV_PDEVICE *get_psdrv_dev( PHYSDEV dev )
395 return (PSDRV_PDEVICE *)dev;
399 * Every glyph name in the Adobe Glyph List and the 35 core PostScript fonts
402 extern const INT PSDRV_AGLGlyphNamesSize;
403 extern GLYPHNAME PSDRV_AGLGlyphNames[] DECLSPEC_HIDDEN;
407 * The AGL encoding vector
410 extern const INT PSDRV_AGLbyNameSize; /* sorted by name - */
411 extern const UNICODEGLYPH PSDRV_AGLbyName[] DECLSPEC_HIDDEN; /* duplicates omitted */
413 extern const INT PSDRV_AGLbyUVSize; /* sorted by UV - */
414 extern const UNICODEGLYPH PSDRV_AGLbyUV[] DECLSPEC_HIDDEN; /* duplicates included */
416 extern HINSTANCE PSDRV_hInstance DECLSPEC_HIDDEN;
417 extern HANDLE PSDRV_Heap DECLSPEC_HIDDEN;
418 extern char *PSDRV_ANSIVector[256] DECLSPEC_HIDDEN;
420 /* GDI driver functions */
421 extern BOOL PSDRV_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
422 INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
423 extern BOOL PSDRV_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
424 INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
425 extern DWORD PSDRV_DeviceCapabilities(LPSTR lpszDriver, LPCSTR lpszDevice, LPCSTR lpszPort,
426 WORD fwCapability, LPSTR lpszOutput, LPDEVMODEA lpDevMode) DECLSPEC_HIDDEN;
427 extern BOOL PSDRV_Ellipse( PHYSDEV dev, INT left, INT top, INT right, INT bottom) DECLSPEC_HIDDEN;
428 extern INT PSDRV_EndDoc( PHYSDEV dev ) DECLSPEC_HIDDEN;
429 extern INT PSDRV_EndPage( PHYSDEV dev ) DECLSPEC_HIDDEN;
430 extern BOOL PSDRV_EnumFonts( PHYSDEV dev, LPLOGFONTW plf, FONTENUMPROCW proc, LPARAM lp ) DECLSPEC_HIDDEN;
431 extern INT PSDRV_ExtDeviceMode(LPSTR lpszDriver, HWND hwnd, LPDEVMODEA lpdmOutput,
432 LPSTR lpszDevice, LPSTR lpszPort, LPDEVMODEA lpdmInput,
433 LPSTR lpszProfile, DWORD dwMode) DECLSPEC_HIDDEN;
434 extern INT PSDRV_ExtEscape( PHYSDEV dev, INT nEscape, INT cbInput, LPCVOID in_data,
435 INT cbOutput, LPVOID out_data ) DECLSPEC_HIDDEN;
436 extern BOOL PSDRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
437 const RECT *lprect, LPCWSTR str, UINT count, const INT *lpDx ) DECLSPEC_HIDDEN;
438 extern BOOL PSDRV_FillPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
439 extern BOOL PSDRV_GetCharWidth(PHYSDEV dev, UINT firstChar, UINT lastChar, LPINT buffer) DECLSPEC_HIDDEN;
440 extern BOOL PSDRV_GetTextExtentExPoint(PHYSDEV dev, LPCWSTR str, INT count,
441 INT maxExt, LPINT lpnFit, LPINT alpDx, LPSIZE size) DECLSPEC_HIDDEN;
442 extern BOOL PSDRV_GetTextMetrics(PHYSDEV dev, TEXTMETRICW *metrics) DECLSPEC_HIDDEN;
443 extern BOOL PSDRV_LineTo(PHYSDEV dev, INT x, INT y) DECLSPEC_HIDDEN;
444 extern BOOL PSDRV_PaintRgn( PHYSDEV dev, HRGN hrgn ) DECLSPEC_HIDDEN;
445 extern BOOL PSDRV_PatBlt(PHYSDEV dev, struct bitblt_coords *dst, DWORD dwRop) DECLSPEC_HIDDEN;
446 extern BOOL PSDRV_Pie( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
447 INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
448 extern BOOL PSDRV_PolyBezier( PHYSDEV dev, const POINT *pts, DWORD count ) DECLSPEC_HIDDEN;
449 extern BOOL PSDRV_PolyBezierTo( PHYSDEV dev, const POINT *pts, DWORD count ) DECLSPEC_HIDDEN;
450 extern BOOL PSDRV_PolyPolygon( PHYSDEV dev, const POINT* pts, const INT* counts, UINT polygons ) DECLSPEC_HIDDEN;
451 extern BOOL PSDRV_PolyPolyline( PHYSDEV dev, const POINT* pts, const DWORD* counts, DWORD polylines ) DECLSPEC_HIDDEN;
452 extern DWORD PSDRV_PutImage( PHYSDEV dev, HBITMAP hbitmap, HRGN clip, BITMAPINFO *info,
453 const struct gdi_image_bits *bits, struct bitblt_coords *src,
454 struct bitblt_coords *dst, DWORD rop ) DECLSPEC_HIDDEN;
455 extern BOOL PSDRV_Rectangle( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN;
456 extern BOOL PSDRV_RoundRect( PHYSDEV dev, INT left, INT top, INT right,
457 INT bottom, INT ell_width, INT ell_height ) DECLSPEC_HIDDEN;
458 extern HBRUSH PSDRV_SelectBrush( PHYSDEV dev, HBRUSH hbrush, const struct brush_pattern *pattern ) DECLSPEC_HIDDEN;
459 extern HFONT PSDRV_SelectFont( PHYSDEV dev, HFONT hfont ) DECLSPEC_HIDDEN;
460 extern HPEN PSDRV_SelectPen( PHYSDEV dev, HPEN hpen, const struct brush_pattern *pattern ) DECLSPEC_HIDDEN;
461 extern COLORREF PSDRV_SetBkColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
462 extern COLORREF PSDRV_SetDCBrushColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
463 extern COLORREF PSDRV_SetDCPenColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
464 extern COLORREF PSDRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color ) DECLSPEC_HIDDEN;
465 extern COLORREF PSDRV_SetTextColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
466 extern INT PSDRV_StartDoc( PHYSDEV dev, const DOCINFOW *doc ) DECLSPEC_HIDDEN;
467 extern BOOL PSDRV_StrokeAndFillPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
468 extern BOOL PSDRV_StrokePath( PHYSDEV dev ) DECLSPEC_HIDDEN;
470 extern void PSDRV_MergeDevmodes(PSDRV_DEVMODEA *dm1, PSDRV_DEVMODEA *dm2,
471 PRINTERINFO *pi) DECLSPEC_HIDDEN;
472 extern BOOL PSDRV_GetFontMetrics(void) DECLSPEC_HIDDEN;
473 extern PPD *PSDRV_ParsePPD(char *fname) DECLSPEC_HIDDEN;
474 extern PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name) DECLSPEC_HIDDEN;
475 extern const AFM *PSDRV_FindAFMinList(FONTFAMILY *head, LPCSTR name) DECLSPEC_HIDDEN;
476 extern BOOL PSDRV_AddAFMtoList(FONTFAMILY **head, const AFM *afm,
477 BOOL *p_added) DECLSPEC_HIDDEN;
478 extern void PSDRV_FreeAFMList( FONTFAMILY *head ) DECLSPEC_HIDDEN;
480 extern INT PSDRV_XWStoDS( PHYSDEV dev, INT width ) DECLSPEC_HIDDEN;
482 extern BOOL PSDRV_Brush(PHYSDEV dev, BOOL EO) DECLSPEC_HIDDEN;
483 extern BOOL PSDRV_SetFont( PHYSDEV dev ) DECLSPEC_HIDDEN;
484 extern BOOL PSDRV_SetPen( PHYSDEV dev ) DECLSPEC_HIDDEN;
486 extern void PSDRV_AddClip( PHYSDEV dev, HRGN hrgn ) DECLSPEC_HIDDEN;
487 extern void PSDRV_SetClip( PHYSDEV dev ) DECLSPEC_HIDDEN;
488 extern void PSDRV_ResetClip( PHYSDEV dev ) DECLSPEC_HIDDEN;
490 extern BOOL PSDRV_CopyColor(PSCOLOR *col1, PSCOLOR *col2) DECLSPEC_HIDDEN;
491 extern void PSDRV_CreateColor( PHYSDEV dev, PSCOLOR *pscolor,
492 COLORREF wincolor ) DECLSPEC_HIDDEN;
493 extern char PSDRV_UnicodeToANSI(int u) DECLSPEC_HIDDEN;
495 extern INT PSDRV_WriteHeader( PHYSDEV dev, LPCWSTR title ) DECLSPEC_HIDDEN;
496 extern INT PSDRV_WriteFooter( PHYSDEV dev ) DECLSPEC_HIDDEN;
497 extern INT PSDRV_WriteNewPage( PHYSDEV dev ) DECLSPEC_HIDDEN;
498 extern INT PSDRV_WriteEndPage( PHYSDEV dev ) DECLSPEC_HIDDEN;
499 extern BOOL PSDRV_WriteMoveTo(PHYSDEV dev, INT x, INT y) DECLSPEC_HIDDEN;
500 extern BOOL PSDRV_WriteLineTo(PHYSDEV dev, INT x, INT y) DECLSPEC_HIDDEN;
501 extern BOOL PSDRV_WriteStroke(PHYSDEV dev) DECLSPEC_HIDDEN;
502 extern BOOL PSDRV_WriteRectangle(PHYSDEV dev, INT x, INT y, INT width, INT height) DECLSPEC_HIDDEN;
503 extern BOOL PSDRV_WriteRRectangle(PHYSDEV dev, INT x, INT y, INT width, INT height) DECLSPEC_HIDDEN;
504 extern BOOL PSDRV_WriteSetFont(PHYSDEV dev, const char *name, matrix size, INT escapement) DECLSPEC_HIDDEN;
505 extern BOOL PSDRV_WriteGlyphShow(PHYSDEV dev, LPCSTR g_name) DECLSPEC_HIDDEN;
506 extern BOOL PSDRV_WriteSetPen(PHYSDEV dev) DECLSPEC_HIDDEN;
507 extern BOOL PSDRV_WriteArc(PHYSDEV dev, INT x, INT y, INT w, INT h,
508 double ang1, double ang2) DECLSPEC_HIDDEN;
509 extern BOOL PSDRV_WriteCurveTo(PHYSDEV dev, POINT pts[3]) DECLSPEC_HIDDEN;
510 extern BOOL PSDRV_WriteSetColor(PHYSDEV dev, PSCOLOR *color) DECLSPEC_HIDDEN;
511 extern BOOL PSDRV_WriteSetBrush(PHYSDEV dev) DECLSPEC_HIDDEN;
512 extern BOOL PSDRV_WriteFill(PHYSDEV dev) DECLSPEC_HIDDEN;
513 extern BOOL PSDRV_WriteEOFill(PHYSDEV dev) DECLSPEC_HIDDEN;
514 extern BOOL PSDRV_WriteGSave(PHYSDEV dev) DECLSPEC_HIDDEN;
515 extern BOOL PSDRV_WriteGRestore(PHYSDEV dev) DECLSPEC_HIDDEN;
516 extern BOOL PSDRV_WriteNewPath(PHYSDEV dev) DECLSPEC_HIDDEN;
517 extern BOOL PSDRV_WriteClosePath(PHYSDEV dev) DECLSPEC_HIDDEN;
518 extern BOOL PSDRV_WriteClip(PHYSDEV dev) DECLSPEC_HIDDEN;
519 extern BOOL PSDRV_WriteRectClip(PHYSDEV dev, INT x, INT y, INT w, INT h) DECLSPEC_HIDDEN;
520 extern BOOL PSDRV_WriteRectClip2(PHYSDEV dev, CHAR *pszArrayName) DECLSPEC_HIDDEN;
521 extern BOOL PSDRV_WriteEOClip(PHYSDEV dev) DECLSPEC_HIDDEN;
522 extern BOOL PSDRV_WriteHatch(PHYSDEV dev) DECLSPEC_HIDDEN;
523 extern BOOL PSDRV_WriteRotate(PHYSDEV dev, float ang) DECLSPEC_HIDDEN;
524 extern BOOL PSDRV_WriteIndexColorSpaceBegin(PHYSDEV dev, int size) DECLSPEC_HIDDEN;
525 extern BOOL PSDRV_WriteIndexColorSpaceEnd(PHYSDEV dev) DECLSPEC_HIDDEN;
526 extern BOOL PSDRV_WriteRGBQUAD(PHYSDEV dev, const RGBQUAD *rgb, int number) DECLSPEC_HIDDEN;
527 extern BOOL PSDRV_WriteImage(PHYSDEV dev, WORD depth, INT xDst, INT yDst,
528 INT widthDst, INT heightDst, INT widthSrc,
529 INT heightSrc, BOOL mask, BOOL top_down) DECLSPEC_HIDDEN;
530 extern BOOL PSDRV_WriteBytes(PHYSDEV dev, const BYTE *bytes, DWORD number) DECLSPEC_HIDDEN;
531 extern BOOL PSDRV_WriteData(PHYSDEV dev, const BYTE *byte, DWORD number) DECLSPEC_HIDDEN;
532 extern DWORD PSDRV_WriteSpool(PHYSDEV dev, LPCSTR lpData, DWORD cch) DECLSPEC_HIDDEN;
533 extern BOOL PSDRV_WriteDIBPatternDict(PHYSDEV dev, const BITMAPINFO *bmi, BYTE *bits, UINT usage) DECLSPEC_HIDDEN;
534 extern BOOL PSDRV_WriteArrayPut(PHYSDEV dev, CHAR *pszArrayName, INT nIndex, LONG lCoord) DECLSPEC_HIDDEN;
535 extern BOOL PSDRV_WriteArrayDef(PHYSDEV dev, CHAR *pszArrayName, INT nSize) DECLSPEC_HIDDEN;
537 extern INT PSDRV_StartPage( PHYSDEV dev ) DECLSPEC_HIDDEN;
539 INT PSDRV_GlyphListInit(void) DECLSPEC_HIDDEN;
540 const GLYPHNAME *PSDRV_GlyphName(LPCSTR szName) DECLSPEC_HIDDEN;
541 VOID PSDRV_IndexGlyphList(void) DECLSPEC_HIDDEN;
542 BOOL PSDRV_GetType1Metrics(void) DECLSPEC_HIDDEN;
543 const AFMMETRICS *PSDRV_UVMetrics(LONG UV, const AFM *afm) DECLSPEC_HIDDEN;
544 SHORT PSDRV_CalcAvgCharWidth(const AFM *afm) DECLSPEC_HIDDEN;
546 extern BOOL PSDRV_SelectBuiltinFont(PHYSDEV dev, HFONT hfont,
547 LOGFONTW *plf, LPSTR FaceName) DECLSPEC_HIDDEN;
548 extern BOOL PSDRV_WriteSetBuiltinFont(PHYSDEV dev) DECLSPEC_HIDDEN;
549 extern BOOL PSDRV_WriteBuiltinGlyphShow(PHYSDEV dev, LPCWSTR str, INT count) DECLSPEC_HIDDEN;
551 extern BOOL PSDRV_SelectDownloadFont(PHYSDEV dev) DECLSPEC_HIDDEN;
552 extern BOOL PSDRV_WriteSetDownloadFont(PHYSDEV dev) DECLSPEC_HIDDEN;
553 extern BOOL PSDRV_WriteDownloadGlyphShow(PHYSDEV dev, WORD *glpyhs, UINT count) DECLSPEC_HIDDEN;
554 extern BOOL PSDRV_EmptyDownloadList(PHYSDEV dev, BOOL write_undef) DECLSPEC_HIDDEN;
556 extern DWORD write_spool( PHYSDEV dev, const void *data, DWORD num ) DECLSPEC_HIDDEN;
558 #define MAX_G_NAME 31 /* max length of PS glyph name */
559 extern void get_glyph_name(HDC hdc, WORD index, char *name) DECLSPEC_HIDDEN;
561 extern TYPE1 *T1_download_header(PHYSDEV dev, char *ps_name,
562 RECT *bbox, UINT emsize) DECLSPEC_HIDDEN;
563 extern BOOL T1_download_glyph(PHYSDEV dev, DOWNLOAD *pdl,
564 DWORD index, char *glyph_name) DECLSPEC_HIDDEN;
565 extern void T1_free(TYPE1 *t1) DECLSPEC_HIDDEN;
567 extern TYPE42 *T42_download_header(PHYSDEV dev, char *ps_name,
568 RECT *bbox, UINT emsize) DECLSPEC_HIDDEN;
569 extern BOOL T42_download_glyph(PHYSDEV dev, DOWNLOAD *pdl,
570 DWORD index, char *glyph_name) DECLSPEC_HIDDEN;
571 extern void T42_free(TYPE42 *t42) DECLSPEC_HIDDEN;
573 extern DWORD RLE_encode(BYTE *in_buf, DWORD len, BYTE *out_buf) DECLSPEC_HIDDEN;
574 extern DWORD ASCII85_encode(BYTE *in_buf, DWORD len, BYTE *out_buf) DECLSPEC_HIDDEN;
576 #define push_lc_numeric(x) do { \
577 const char *tmplocale = setlocale(LC_NUMERIC,NULL); \
578 setlocale(LC_NUMERIC,x);
580 #define pop_lc_numeric() \
581 setlocale(LC_NUMERIC,tmplocale); \
582 } while (0)
584 static inline WCHAR *strdupW( const WCHAR *str )
586 int size;
587 WCHAR *ret;
589 if (!str) return NULL;
590 size = (strlenW( str ) + 1) * sizeof(WCHAR);
591 ret = HeapAlloc( GetProcessHeap(), 0, size );
592 if (ret) memcpy( ret, str, size );
593 return ret;
596 #endif