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