psdrv.h 21.5 KB
Newer Older
Alexandre Julliard's avatar
Alexandre Julliard committed
1
/*
Alexandre Julliard's avatar
Alexandre Julliard committed
2
 *	PostScript driver definitions
Alexandre Julliard's avatar
Alexandre Julliard committed
3 4
 *
 *	Copyright 1998  Huw D M Davies
5 6 7 8 9 10 11 12 13 14 15 16 17
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * 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
Alexandre Julliard's avatar
Alexandre Julliard committed
19
 */
20 21 22 23

#ifndef __WINE_PSDRV_H
#define __WINE_PSDRV_H

24 25
#include <stdarg.h>

26
#include "windef.h"
27
#include "winbase.h"
28
#include "wingdi.h"
29
#include "winspool.h"
Alexandre Julliard's avatar
Alexandre Julliard committed
30

31
#include "wine/unicode.h"
32
#include "wine/gdi_driver.h"
33 34
#include "wine/list.h"

35
typedef struct {
36 37
    INT		    index;
    LPCSTR	    sz;
38 39 40
} GLYPHNAME;

typedef struct {
41
    LONG	    UV;
42
    const GLYPHNAME *name;
43 44
} UNICODEGLYPH;

Alexandre Julliard's avatar
Alexandre Julliard committed
45 46 47 48 49 50 51 52 53 54
typedef struct {
    float	llx, lly, urx, ury;
} AFMBBOX;

typedef struct _tagAFMLIGS {
    char		*successor;
    char		*ligature;
    struct _tagAFMLIGS	*next;
} AFMLIGS;

55
typedef struct {
56
    int			C;		/* character */
57 58
    LONG     	    	UV;
    float		WX;
59
    const GLYPHNAME	*N;		/* name */
60
    AFMBBOX		B;
61
    const AFMLIGS	*L;		/* Ligatures */
62 63 64 65 66 67 68
} OLD_AFMMETRICS;

typedef struct {
    INT     	    	C;  	    	    	/* AFM encoding (or -1) */
    LONG    	    	UV; 	    	    	/* Unicode value */
    FLOAT   	    	WX; 	    	    	/* Advance width */
    const GLYPHNAME 	*N; 	    	    	/* Glyph name */
Alexandre Julliard's avatar
Alexandre Julliard committed
69 70
} AFMMETRICS;

71
typedef struct {
72 73 74 75
    USHORT    	    	usUnitsPerEm; 	    	/* head:unitsPerEm */
    SHORT   	    	sAscender;  	    	/* hhea:Ascender */
    SHORT   	    	sDescender; 	    	/* hhea:Descender */
    SHORT   	    	sLineGap;   	    	/* hhea:LineGap */
76
    SHORT   	    	sAvgCharWidth;	    	/* OS/2:xAvgCharWidth */
77 78 79 80 81
    SHORT   	    	sTypoAscender;	    	/* OS/2:sTypoAscender */
    SHORT   	    	sTypoDescender;     	/* OS/2:sTypoDescender */
    SHORT   	    	sTypoLineGap;	    	/* OS/2:sTypeLineGap */
    USHORT  	    	usWinAscent;	    	/* OS/2:usWinAscent */
    USHORT  	    	usWinDescent;	    	/* OS/2:usWinDescent */
82 83
} WINMETRICS;

Alexandre Julliard's avatar
Alexandre Julliard committed
84
typedef struct _tagAFM {
85 86 87 88
    LPCSTR		FontName;
    LPCSTR		FullName;
    LPCSTR		FamilyName;
    LPCSTR		EncodingScheme;
89
    LONG		Weight;			/* FW_NORMAL etc. */
Alexandre Julliard's avatar
Alexandre Julliard committed
90
    float		ItalicAngle;
91
    BOOL		IsFixedPitch;
Alexandre Julliard's avatar
Alexandre Julliard committed
92 93 94 95 96
    float		UnderlinePosition;
    float		UnderlineThickness;
    AFMBBOX		FontBBox;
    float		Ascender;
    float		Descender;
97
    WINMETRICS	    	WinMetrics;
Alexandre Julliard's avatar
Alexandre Julliard committed
98
    int			NumofMetrics;
99
    const AFMMETRICS	*Metrics;
100
} AFM;
Alexandre Julliard's avatar
Alexandre Julliard committed
101

102
/* Note no 'next' in AFM. Use AFMLISTENTRY as a container. This allows more than
Alexandre Julliard's avatar
Alexandre Julliard committed
103 104 105 106 107
   one list to exist without having to reallocate the entire AFM structure. We
   keep a global list of all afms (PSDRV_AFMFontList) plus a list of available
   fonts for each DC (dc->physDev->Fonts) */

typedef struct _tagAFMLISTENTRY {
108
    const AFM			*afm;
Alexandre Julliard's avatar
Alexandre Julliard committed
109 110 111 112
    struct _tagAFMLISTENTRY	*next;
} AFMLISTENTRY;

typedef struct _tagFONTFAMILY {
Alexandre Julliard's avatar
Alexandre Julliard committed
113
    char			*FamilyName; /* family name */
Alexandre Julliard's avatar
Alexandre Julliard committed
114 115 116 117
    AFMLISTENTRY		*afmlist;    /* list of afms for this family */
    struct _tagFONTFAMILY	*next;       /* next family */
} FONTFAMILY;

118 119
extern FONTFAMILY   *PSDRV_AFMFontList DECLSPEC_HIDDEN;
extern const AFM    *const PSDRV_BuiltinAFMs[] DECLSPEC_HIDDEN;     /* last element is NULL */
Alexandre Julliard's avatar
Alexandre Julliard committed
120

121 122 123
typedef struct
{
    struct list          entry;
Alexandre Julliard's avatar
Alexandre Julliard committed
124 125 126 127 128 129 130 131 132 133 134
    char		*Name;
} FONTNAME;

typedef struct {
    float	llx, lly, urx, ury;
} IMAGEABLEAREA;

typedef struct {
    float	x, y;
} PAPERDIMENSION;

135 136
/* Solaris kludge */
#undef PAGESIZE
Alexandre Julliard's avatar
Alexandre Julliard committed
137
typedef struct _tagPAGESIZE {
138
    struct list         entry;
Alexandre Julliard's avatar
Alexandre Julliard committed
139 140 141 142 143 144 145 146 147
    char		*Name;
    char		*FullName;
    char		*InvocationString;
    IMAGEABLEAREA	*ImageableArea;
    PAPERDIMENSION	*PaperDimension;
    WORD		WinPage; /*eg DMPAPER_A4. Doesn't really belong here */
} PAGESIZE;


148 149 150 151 152 153 154 155
/* For BANDINFO Escape */
typedef struct _BANDINFOSTRUCT
{
    BOOL GraphicsFlag;
    BOOL TextFlag;
    RECT GraphicsRect;
} BANDINFOSTRUCT, *PBANDINFOSTRUCT;

156 157 158
typedef struct
{
    struct list                 entry;
Alexandre Julliard's avatar
Alexandre Julliard committed
159 160 161 162 163 164
    char			*Feature1;
    char			*Value1;
    char			*Feature2;
    char			*Value2;
} CONSTRAINT;

165 166 167
typedef struct
{
    struct list                 entry;
168 169
    const char			*Name;
    const char			*FullName;
Alexandre Julliard's avatar
Alexandre Julliard committed
170 171 172 173
    char			*InvocationString;
    WORD			WinBin; /* eg DMBIN_LOWER */
} INPUTSLOT;

174 175 176
typedef enum _RASTERIZEROPTION
  {RO_None, RO_Accept68K, RO_Type42, RO_TrueImage} RASTERIZEROPTION;

177 178 179
typedef struct
{
    struct list                 entry;
180 181 182 183 184 185
    char                        *Name;
    char                        *FullName;
    char                        *InvocationString;
    WORD                        WinDuplex; /* eg DMDUP_SIMPLEX */
} DUPLEX;

186 187 188 189 190 191 192
typedef struct
{
    struct list entry;
    int    resx, resy;
    char   *InvocationString;
} RESOLUTION;

193
/* Many Mac OS X based ppd files don't include a *ColorDevice line, so
194 195 196 197 198 199 200 201
   we use a tristate here rather than a boolean.  Code that
   cares is expected to treat these as if they were colour. */
typedef enum {
    CD_NotSpecified,
    CD_False,
    CD_True
} COLORDEVICE;

Alexandre Julliard's avatar
Alexandre Julliard committed
202 203 204
typedef struct {
    char		*NickName;
    int			LanguageLevel;
205
    COLORDEVICE	        ColorDevice;
206
    struct list         Resolutions;
Alexandre Julliard's avatar
Alexandre Julliard committed
207
    int			DefaultResolution;
Alexandre Julliard's avatar
Alexandre Julliard committed
208
    signed int		LandscapeOrientation;
Alexandre Julliard's avatar
Alexandre Julliard committed
209 210 211 212
    char		*JCLBegin;
    char		*JCLToPSInterpreter;
    char		*JCLEnd;
    char		*DefaultFont;
213
    struct list         InstalledFonts;
214
    struct list         PageSizes;
215
    PAGESIZE            *DefaultPageSize;
216
    struct list         Constraints;
217
    struct list         InputSlots;
218
    RASTERIZEROPTION    TTRasterizer;
219
    struct list         Duplexes;
220
    DUPLEX              *DefaultDuplex;
Alexandre Julliard's avatar
Alexandre Julliard committed
221 222 223
} PPD;

typedef struct {
224
    DEVMODEW			dmPublic;
Alexandre Julliard's avatar
Alexandre Julliard committed
225
    struct _tagdocprivate {
Patrik Stridvall's avatar
Patrik Stridvall committed
226
      int dummy;
Alexandre Julliard's avatar
Alexandre Julliard committed
227 228
    }				dmDocPrivate;
    struct _tagdrvprivate {
229
      UINT	numInstalledOptions; /* Options at end of struct */
Alexandre Julliard's avatar
Alexandre Julliard committed
230 231 232 233 234 235 236 237
    }				dmDrvPrivate;

/* Now comes:

numInstalledOptions of OPTIONs

*/

238
} PSDRV_DEVMODE;
Alexandre Julliard's avatar
Alexandre Julliard committed
239

240 241 242
typedef struct
{
    struct list             entry;
243
    WCHAR                   *friendly_name;
244
    PPD			    *ppd;
245
    PSDRV_DEVMODE	    *Devmode;
246 247 248
    FONTFAMILY		    *Fonts;
    PPRINTER_ENUM_VALUESA   FontSubTable;
    DWORD		    FontSubTableSize;
Alexandre Julliard's avatar
Alexandre Julliard committed
249
} PRINTERINFO;
Alexandre Julliard's avatar
Alexandre Julliard committed
250

Alexandre Julliard's avatar
Alexandre Julliard committed
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271
typedef struct {
    float		r, g, b;
} PSRGB;

typedef struct {
    float		i;
} PSGRAY;


/* def's for PSCOLOR.type */
#define PSCOLOR_GRAY	0
#define PSCOLOR_RGB	1

typedef struct {
    int			type;
    union {
        PSRGB  rgb;
        PSGRAY gray;
    }                   value;
} PSCOLOR;

Alexandre Julliard's avatar
Alexandre Julliard committed
272
typedef struct {
273
    const AFM           *afm;
274
    float               scale;
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299
    TEXTMETRICW         tm;
} BUILTIN;

typedef struct tagTYPE42 TYPE42;

typedef struct tagTYPE1 TYPE1;

enum downloadtype {
  Type1, Type42
};

typedef struct _tagDOWNLOAD {
  enum downloadtype type;
  union {
    TYPE1  *Type1;
    TYPE42 *Type42;
  } typeinfo;
  char *ps_name;
  struct _tagDOWNLOAD *next;
} DOWNLOAD;

enum fontloc {
  Builtin, Download
};

300 301 302 303 304
typedef struct
{
    INT xx, xy, yx, yy;
} matrix;

305 306
enum fontset { UNSET = 0, HORIZONTAL_SET, VERTICAL_SET };

307 308 309 310 311 312 313
typedef struct {
    enum fontloc        fontloc;
    union {
        BUILTIN  Builtin;
        DOWNLOAD *Download;
    }                   fontinfo;

314
    matrix              size;
315
    PSCOLOR             color;
316
    enum fontset        set;    /* Have we done a setfont yet */
317 318 319 320 321 322 323 324

  /* These are needed by PSDRV_ExtTextOut */
    int                 escapement;
    int                 underlineThickness;
    int                 underlinePosition;
    int                 strikeoutThickness;
    int                 strikeoutPosition;

Alexandre Julliard's avatar
Alexandre Julliard committed
325 326
} PSFONT;

Alexandre Julliard's avatar
Alexandre Julliard committed
327
typedef struct {
328 329 330
    PSCOLOR              color;
    BOOL                 set;
    struct brush_pattern pattern;
Alexandre Julliard's avatar
Alexandre Julliard committed
331 332
} PSBRUSH;

333 334
#define MAX_DASHLEN 16

Alexandre Julliard's avatar
Alexandre Julliard committed
335
typedef struct {
336
    INT                 style;
337 338 339
    INT                 width;
    BYTE                join;
    BYTE                endcap;
340 341
    DWORD               dash[MAX_DASHLEN];
    DWORD               dash_len;
Alexandre Julliard's avatar
Alexandre Julliard committed
342
    PSCOLOR		color;
343
    BOOL		set;
Alexandre Julliard's avatar
Alexandre Julliard committed
344 345
} PSPEN;

Alexandre Julliard's avatar
Alexandre Julliard committed
346
typedef struct {
347
    DWORD		id;             /* Job id */
348
    HANDLE              hprinter;       /* Printer handle */
349
    LPWSTR              output;	        /* Output file/port */
350
    LPWSTR              doc_name;       /* Document Name */
351 352 353
    BOOL		banding;        /* Have we received a NEXTBAND */
    BOOL		OutOfPage;      /* Page header not sent yet */
    INT			PageNo;
354
    BOOL                quiet;          /* Don't actually output anything */
355 356
    BOOL                in_passthrough; /* In PASSTHROUGH mode */
    BOOL                had_passthrough_rect; /* See the comment in PSDRV_Rectangle */
Alexandre Julliard's avatar
Alexandre Julliard committed
357 358
} JOB;

359 360
typedef struct
{
361
    struct gdi_physdev  dev;
Alexandre Julliard's avatar
Alexandre Julliard committed
362
    PSFONT		font;		/* Current PS font */
363
    DOWNLOAD            *downloaded_fonts;
Alexandre Julliard's avatar
Alexandre Julliard committed
364 365 366 367
    PSPEN		pen;
    PSBRUSH		brush;
    PSCOLOR		bkColor;
    PSCOLOR		inkColor;	/* Last colour set */
Alexandre Julliard's avatar
Alexandre Julliard committed
368
    JOB			job;
369
    PSDRV_DEVMODE	*Devmode;
Alexandre Julliard's avatar
Alexandre Julliard committed
370
    PRINTERINFO		*pi;
371 372 373 374 375 376
    SIZE                PageSize;      /* Physical page size in device units */
    RECT                ImageableArea; /* Imageable area in device units */
                                       /* NB both PageSize and ImageableArea
					  are not rotated in landscape mode,
					  so PageSize.cx is generally
					  < PageSize.cy */
377 378 379 380 381 382
    int                 horzRes;       /* device caps */
    int                 vertRes;
    int                 horzSize;
    int                 vertSize;
    int                 logPixelsX;
    int                 logPixelsY;
383 384

    int                 pathdepth;
Alexandre Julliard's avatar
Alexandre Julliard committed
385 386
} PSDRV_PDEVICE;

387 388 389 390
static inline PSDRV_PDEVICE *get_psdrv_dev( PHYSDEV dev )
{
    return (PSDRV_PDEVICE *)dev;
}
391 392 393 394

/*
 *  Every glyph name in the Adobe Glyph List and the 35 core PostScript fonts
 */
395

396
extern const INT    PSDRV_AGLGlyphNamesSize DECLSPEC_HIDDEN;
397
extern GLYPHNAME    PSDRV_AGLGlyphNames[] DECLSPEC_HIDDEN;
398 399 400 401 402


/*
 *  The AGL encoding vector
 */
403

404 405
extern const INT    	    PSDRV_AGLbyNameSize DECLSPEC_HIDDEN; /* sorted by name */
extern const UNICODEGLYPH   PSDRV_AGLbyName[] DECLSPEC_HIDDEN;	 /*  duplicates omitted  */
406

407 408
extern const INT    	    PSDRV_AGLbyUVSize DECLSPEC_HIDDEN;	 /* sorted by UV */
extern const UNICODEGLYPH   PSDRV_AGLbyUV[] DECLSPEC_HIDDEN;	 /*  duplicates included */
409

410 411 412
extern HINSTANCE PSDRV_hInstance DECLSPEC_HIDDEN;
extern HANDLE PSDRV_Heap DECLSPEC_HIDDEN;
extern char *PSDRV_ANSIVector[256] DECLSPEC_HIDDEN;
Alexandre Julliard's avatar
Alexandre Julliard committed
413

414 415 416
extern INPUTSLOT *find_slot( PPD *ppd, const PSDRV_DEVMODE *dm ) DECLSPEC_HIDDEN;
extern PAGESIZE *find_pagesize( PPD *ppd, const PSDRV_DEVMODE *dm ) DECLSPEC_HIDDEN;
extern DUPLEX *find_duplex( PPD *ppd, const PSDRV_DEVMODE *dm ) DECLSPEC_HIDDEN;
417

418
/* GDI driver functions */
419 420 421 422 423 424 425 426 427
extern BOOL PSDRV_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
                       INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
extern BOOL PSDRV_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
                         INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
extern DWORD PSDRV_DeviceCapabilities(LPSTR lpszDriver, LPCSTR lpszDevice, LPCSTR lpszPort,
                                      WORD fwCapability, LPSTR lpszOutput, LPDEVMODEA lpDevMode) DECLSPEC_HIDDEN;
extern BOOL PSDRV_Ellipse( PHYSDEV dev, INT left, INT top, INT right, INT bottom) DECLSPEC_HIDDEN;
extern INT PSDRV_EndDoc( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern INT PSDRV_EndPage( PHYSDEV dev ) DECLSPEC_HIDDEN;
428
extern BOOL PSDRV_EnumFonts( PHYSDEV dev, LPLOGFONTW plf, FONTENUMPROCW proc, LPARAM lp ) DECLSPEC_HIDDEN;
429 430 431 432 433 434 435
extern INT PSDRV_ExtDeviceMode(LPSTR lpszDriver, HWND hwnd, LPDEVMODEA lpdmOutput,
                               LPSTR lpszDevice, LPSTR lpszPort, LPDEVMODEA lpdmInput,
                               LPSTR lpszProfile, DWORD dwMode) DECLSPEC_HIDDEN;
extern INT PSDRV_ExtEscape( PHYSDEV dev, INT nEscape, INT cbInput, LPCVOID in_data,
                            INT cbOutput, LPVOID out_data ) DECLSPEC_HIDDEN;
extern BOOL PSDRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
                              const RECT *lprect, LPCWSTR str, UINT count, const INT *lpDx ) DECLSPEC_HIDDEN;
436
extern BOOL PSDRV_FillPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
437
extern BOOL PSDRV_GetCharWidth(PHYSDEV dev, UINT firstChar, UINT lastChar, LPINT buffer) DECLSPEC_HIDDEN;
438
extern BOOL PSDRV_GetTextExtentExPoint(PHYSDEV dev, LPCWSTR str, INT count, LPINT alpDx) DECLSPEC_HIDDEN;
439 440 441 442 443 444
extern BOOL PSDRV_GetTextMetrics(PHYSDEV dev, TEXTMETRICW *metrics) DECLSPEC_HIDDEN;
extern BOOL PSDRV_LineTo(PHYSDEV dev, INT x, INT y) DECLSPEC_HIDDEN;
extern BOOL PSDRV_PaintRgn( PHYSDEV dev, HRGN hrgn ) DECLSPEC_HIDDEN;
extern BOOL PSDRV_PatBlt(PHYSDEV dev, struct bitblt_coords *dst, DWORD dwRop) DECLSPEC_HIDDEN;
extern BOOL PSDRV_Pie( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
                       INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
445 446
extern BOOL PSDRV_PolyBezier( PHYSDEV dev, const POINT *pts, DWORD count ) DECLSPEC_HIDDEN;
extern BOOL PSDRV_PolyBezierTo( PHYSDEV dev, const POINT *pts, DWORD count ) DECLSPEC_HIDDEN;
447 448
extern BOOL PSDRV_PolyPolygon( PHYSDEV dev, const POINT* pts, const INT* counts, UINT polygons ) DECLSPEC_HIDDEN;
extern BOOL PSDRV_PolyPolyline( PHYSDEV dev, const POINT* pts, const DWORD* counts, DWORD polylines ) DECLSPEC_HIDDEN;
449
extern DWORD PSDRV_PutImage( PHYSDEV dev, HRGN clip, BITMAPINFO *info,
450 451
                             const struct gdi_image_bits *bits, struct bitblt_coords *src,
                             struct bitblt_coords *dst, DWORD rop ) DECLSPEC_HIDDEN;
452 453 454
extern BOOL PSDRV_Rectangle( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN;
extern BOOL PSDRV_RoundRect( PHYSDEV dev, INT left, INT top, INT right,
                             INT bottom, INT ell_width, INT ell_height ) DECLSPEC_HIDDEN;
455
extern HBRUSH PSDRV_SelectBrush( PHYSDEV dev, HBRUSH hbrush, const struct brush_pattern *pattern ) DECLSPEC_HIDDEN;
456
extern HFONT PSDRV_SelectFont( PHYSDEV dev, HFONT hfont, UINT *aa_flags ) DECLSPEC_HIDDEN;
457
extern HPEN PSDRV_SelectPen( PHYSDEV dev, HPEN hpen, const struct brush_pattern *pattern ) DECLSPEC_HIDDEN;
458 459 460 461 462 463
extern COLORREF PSDRV_SetBkColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
extern COLORREF PSDRV_SetDCBrushColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
extern COLORREF PSDRV_SetDCPenColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
extern COLORREF PSDRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color ) DECLSPEC_HIDDEN;
extern COLORREF PSDRV_SetTextColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
extern INT PSDRV_StartDoc( PHYSDEV dev, const DOCINFOW *doc ) DECLSPEC_HIDDEN;
464 465
extern BOOL PSDRV_StrokeAndFillPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern BOOL PSDRV_StrokePath( PHYSDEV dev ) DECLSPEC_HIDDEN;
466

467
extern void PSDRV_MergeDevmodes(PSDRV_DEVMODE *dm1, const PSDRV_DEVMODE *dm2,
468 469
			 PRINTERINFO *pi) DECLSPEC_HIDDEN;
extern BOOL PSDRV_GetFontMetrics(void) DECLSPEC_HIDDEN;
470
extern PPD *PSDRV_ParsePPD(const WCHAR *fname, HANDLE printer) DECLSPEC_HIDDEN;
471
extern PRINTERINFO *PSDRV_FindPrinterInfo(LPCWSTR name) DECLSPEC_HIDDEN;
472
extern const AFM *PSDRV_FindAFMinList(FONTFAMILY *head, LPCSTR name) DECLSPEC_HIDDEN;
473
extern BOOL PSDRV_AddAFMtoList(FONTFAMILY **head, const AFM *afm,
474 475
	BOOL *p_added) DECLSPEC_HIDDEN;
extern void PSDRV_FreeAFMList( FONTFAMILY *head ) DECLSPEC_HIDDEN;
Alexandre Julliard's avatar
Alexandre Julliard committed
476

477
extern INT PSDRV_XWStoDS( PHYSDEV dev, INT width ) DECLSPEC_HIDDEN;
478

479
extern BOOL PSDRV_Brush(PHYSDEV dev, BOOL EO) DECLSPEC_HIDDEN;
480
extern BOOL PSDRV_SetFont( PHYSDEV dev, BOOL vertical ) DECLSPEC_HIDDEN;
481
extern BOOL PSDRV_SetPen( PHYSDEV dev ) DECLSPEC_HIDDEN;
Alexandre Julliard's avatar
Alexandre Julliard committed
482

483
extern void PSDRV_AddClip( PHYSDEV dev, HRGN hrgn ) DECLSPEC_HIDDEN;
484 485
extern void PSDRV_SetClip( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern void PSDRV_ResetClip( PHYSDEV dev ) DECLSPEC_HIDDEN;
486

487
extern BOOL PSDRV_CopyColor(PSCOLOR *col1, PSCOLOR *col2) DECLSPEC_HIDDEN;
488
extern void PSDRV_CreateColor( PHYSDEV dev, PSCOLOR *pscolor,
489
		     COLORREF wincolor ) DECLSPEC_HIDDEN;
490
extern PSRGB rgb_to_grayscale_scale( void ) DECLSPEC_HIDDEN;
491 492
extern char PSDRV_UnicodeToANSI(int u) DECLSPEC_HIDDEN;

493
extern INT PSDRV_WriteHeader( PHYSDEV dev, LPCWSTR title ) DECLSPEC_HIDDEN;
494 495 496 497 498 499 500 501
extern INT PSDRV_WriteFooter( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern INT PSDRV_WriteNewPage( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern INT PSDRV_WriteEndPage( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern BOOL PSDRV_WriteMoveTo(PHYSDEV dev, INT x, INT y) DECLSPEC_HIDDEN;
extern BOOL PSDRV_WriteLineTo(PHYSDEV dev, INT x, INT y) DECLSPEC_HIDDEN;
extern BOOL PSDRV_WriteStroke(PHYSDEV dev) DECLSPEC_HIDDEN;
extern BOOL PSDRV_WriteRectangle(PHYSDEV dev, INT x, INT y, INT width, INT height) DECLSPEC_HIDDEN;
extern BOOL PSDRV_WriteRRectangle(PHYSDEV dev, INT x, INT y, INT width, INT height) DECLSPEC_HIDDEN;
502
extern BOOL PSDRV_WriteSetFont(PHYSDEV dev, const char *name, matrix size, INT escapement,
503
                               BOOL fake_italic) DECLSPEC_HIDDEN;
504 505 506
extern BOOL PSDRV_WriteGlyphShow(PHYSDEV dev, LPCSTR g_name) DECLSPEC_HIDDEN;
extern BOOL PSDRV_WriteSetPen(PHYSDEV dev) DECLSPEC_HIDDEN;
extern BOOL PSDRV_WriteArc(PHYSDEV dev, INT x, INT y, INT w, INT h,
507
			     double ang1, double ang2) DECLSPEC_HIDDEN;
508
extern BOOL PSDRV_WriteCurveTo(PHYSDEV dev, POINT pts[3]) DECLSPEC_HIDDEN;
509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524
extern BOOL PSDRV_WriteSetColor(PHYSDEV dev, PSCOLOR *color) DECLSPEC_HIDDEN;
extern BOOL PSDRV_WriteSetBrush(PHYSDEV dev) DECLSPEC_HIDDEN;
extern BOOL PSDRV_WriteFill(PHYSDEV dev) DECLSPEC_HIDDEN;
extern BOOL PSDRV_WriteEOFill(PHYSDEV dev) DECLSPEC_HIDDEN;
extern BOOL PSDRV_WriteGSave(PHYSDEV dev) DECLSPEC_HIDDEN;
extern BOOL PSDRV_WriteGRestore(PHYSDEV dev) DECLSPEC_HIDDEN;
extern BOOL PSDRV_WriteNewPath(PHYSDEV dev) DECLSPEC_HIDDEN;
extern BOOL PSDRV_WriteClosePath(PHYSDEV dev) DECLSPEC_HIDDEN;
extern BOOL PSDRV_WriteClip(PHYSDEV dev) DECLSPEC_HIDDEN;
extern BOOL PSDRV_WriteRectClip(PHYSDEV dev, INT x, INT y, INT w, INT h) DECLSPEC_HIDDEN;
extern BOOL PSDRV_WriteRectClip2(PHYSDEV dev, CHAR *pszArrayName) DECLSPEC_HIDDEN;
extern BOOL PSDRV_WriteEOClip(PHYSDEV dev) DECLSPEC_HIDDEN;
extern BOOL PSDRV_WriteHatch(PHYSDEV dev) DECLSPEC_HIDDEN;
extern BOOL PSDRV_WriteRotate(PHYSDEV dev, float ang) DECLSPEC_HIDDEN;
extern BOOL PSDRV_WriteIndexColorSpaceBegin(PHYSDEV dev, int size) DECLSPEC_HIDDEN;
extern BOOL PSDRV_WriteIndexColorSpaceEnd(PHYSDEV dev) DECLSPEC_HIDDEN;
525
extern BOOL PSDRV_WriteRGBQUAD(PHYSDEV dev, const RGBQUAD *rgb, int number) DECLSPEC_HIDDEN;
526
extern BOOL PSDRV_WriteImage(PHYSDEV dev, WORD depth, BOOL grayscale, INT xDst, INT yDst,
527
			     INT widthDst, INT heightDst, INT widthSrc,
528
			     INT heightSrc, BOOL mask, BOOL top_down) DECLSPEC_HIDDEN;
529 530 531
extern BOOL PSDRV_WriteBytes(PHYSDEV dev, const BYTE *bytes, DWORD number) DECLSPEC_HIDDEN;
extern BOOL PSDRV_WriteData(PHYSDEV dev, const BYTE *byte, DWORD number) DECLSPEC_HIDDEN;
extern DWORD PSDRV_WriteSpool(PHYSDEV dev, LPCSTR lpData, DWORD cch) DECLSPEC_HIDDEN;
532
extern BOOL PSDRV_WriteDIBPatternDict(PHYSDEV dev, const BITMAPINFO *bmi, BYTE *bits, UINT usage) DECLSPEC_HIDDEN;
533 534
extern BOOL PSDRV_WriteArrayPut(PHYSDEV dev, CHAR *pszArrayName, INT nIndex, LONG lCoord) DECLSPEC_HIDDEN;
extern BOOL PSDRV_WriteArrayDef(PHYSDEV dev, CHAR *pszArrayName, INT nSize) DECLSPEC_HIDDEN;
535

536
extern INT PSDRV_StartPage( PHYSDEV dev ) DECLSPEC_HIDDEN;
537 538 539 540 541 542 543

INT PSDRV_GlyphListInit(void) DECLSPEC_HIDDEN;
const GLYPHNAME *PSDRV_GlyphName(LPCSTR szName) DECLSPEC_HIDDEN;
VOID PSDRV_IndexGlyphList(void) DECLSPEC_HIDDEN;
BOOL PSDRV_GetType1Metrics(void) DECLSPEC_HIDDEN;
const AFMMETRICS *PSDRV_UVMetrics(LONG UV, const AFM *afm) DECLSPEC_HIDDEN;
SHORT PSDRV_CalcAvgCharWidth(const AFM *afm) DECLSPEC_HIDDEN;
544

545
extern BOOL PSDRV_SelectBuiltinFont(PHYSDEV dev, HFONT hfont,
546
				    LOGFONTW *plf, LPSTR FaceName) DECLSPEC_HIDDEN;
547 548
extern BOOL PSDRV_WriteSetBuiltinFont(PHYSDEV dev) DECLSPEC_HIDDEN;
extern BOOL PSDRV_WriteBuiltinGlyphShow(PHYSDEV dev, LPCWSTR str, INT count) DECLSPEC_HIDDEN;
549

550
extern BOOL PSDRV_SelectDownloadFont(PHYSDEV dev) DECLSPEC_HIDDEN;
551
extern BOOL PSDRV_WriteSetDownloadFont(PHYSDEV dev, BOOL vertical) DECLSPEC_HIDDEN;
552
extern BOOL PSDRV_WriteDownloadGlyphShow(PHYSDEV dev, const WORD *glyphs, UINT count) DECLSPEC_HIDDEN;
553
extern BOOL PSDRV_EmptyDownloadList(PHYSDEV dev, BOOL write_undef) DECLSPEC_HIDDEN;
554

555
extern DWORD write_spool( PHYSDEV dev, const void *data, DWORD num ) DECLSPEC_HIDDEN;
556 557

#define MAX_G_NAME 31 /* max length of PS glyph name */
558
extern void get_glyph_name(HDC hdc, WORD index, char *name) DECLSPEC_HIDDEN;
559

560
extern TYPE1 *T1_download_header(PHYSDEV dev, char *ps_name,
561
                                 RECT *bbox, UINT emsize) DECLSPEC_HIDDEN;
562
extern BOOL T1_download_glyph(PHYSDEV dev, DOWNLOAD *pdl,
563 564
			      DWORD index, char *glyph_name) DECLSPEC_HIDDEN;
extern void T1_free(TYPE1 *t1) DECLSPEC_HIDDEN;
565

566
extern TYPE42 *T42_download_header(PHYSDEV dev, char *ps_name,
567
                                   RECT *bbox, UINT emsize) DECLSPEC_HIDDEN;
568
extern BOOL T42_download_glyph(PHYSDEV dev, DOWNLOAD *pdl,
569 570
			       DWORD index, char *glyph_name) DECLSPEC_HIDDEN;
extern void T42_free(TYPE42 *t42) DECLSPEC_HIDDEN;
571

572 573
extern DWORD RLE_encode(BYTE *in_buf, DWORD len, BYTE *out_buf) DECLSPEC_HIDDEN;
extern DWORD ASCII85_encode(BYTE *in_buf, DWORD len, BYTE *out_buf) DECLSPEC_HIDDEN;
574

575 576 577 578 579 580 581 582
#define push_lc_numeric(x) do {					\
	const char *tmplocale = setlocale(LC_NUMERIC,NULL);	\
	setlocale(LC_NUMERIC,x);

#define pop_lc_numeric()					\
	setlocale(LC_NUMERIC,tmplocale);			\
} while (0)

583 584 585 586 587 588 589 590 591 592 593
static inline WCHAR *strdupW( const WCHAR *str )
{
    int size;
    WCHAR *ret;

    if (!str) return NULL;
    size = (strlenW( str ) + 1) * sizeof(WCHAR);
    ret = HeapAlloc( GetProcessHeap(), 0, size );
    if (ret) memcpy( ret, str, size );
    return ret;
}
594

595
#endif