wineps: Don't store ImageableArea in print_ctx.
[wine.git] / dlls / wineps.drv / psdrv.h
blob389c6a5b56221ab617ddb869580672b33b661897
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 "unixlib.h"
33 #include "wine/gdi_driver.h"
34 #include "wine/list.h"
36 typedef struct {
37 INT index;
38 LPCSTR sz;
39 } GLYPHNAME;
41 typedef struct {
42 LONG UV;
43 const GLYPHNAME *name;
44 } UNICODEGLYPH;
46 typedef struct {
47 float llx, lly, urx, ury;
48 } AFMBBOX;
50 typedef struct _tagAFMLIGS {
51 char *successor;
52 char *ligature;
53 struct _tagAFMLIGS *next;
54 } AFMLIGS;
56 typedef struct {
57 int C; /* character */
58 LONG UV;
59 float WX;
60 const GLYPHNAME *N; /* name */
61 AFMBBOX B;
62 const AFMLIGS *L; /* Ligatures */
63 } OLD_AFMMETRICS;
65 typedef struct {
66 INT C; /* AFM encoding (or -1) */
67 LONG UV; /* Unicode value */
68 FLOAT WX; /* Advance width */
69 const GLYPHNAME *N; /* Glyph name */
70 } AFMMETRICS;
72 typedef struct {
73 USHORT usUnitsPerEm; /* head:unitsPerEm */
74 SHORT sAscender; /* hhea:Ascender */
75 SHORT sDescender; /* hhea:Descender */
76 SHORT sLineGap; /* hhea:LineGap */
77 SHORT sAvgCharWidth; /* OS/2:xAvgCharWidth */
78 SHORT sTypoAscender; /* OS/2:sTypoAscender */
79 SHORT sTypoDescender; /* OS/2:sTypoDescender */
80 SHORT sTypoLineGap; /* OS/2:sTypeLineGap */
81 USHORT usWinAscent; /* OS/2:usWinAscent */
82 USHORT usWinDescent; /* OS/2:usWinDescent */
83 } WINMETRICS;
85 typedef struct _tagAFM {
86 const char *FontName;
87 const WCHAR *FullName;
88 const WCHAR *FamilyName;
89 const WCHAR *EncodingScheme;
90 LONG Weight; /* FW_NORMAL etc. */
91 float ItalicAngle;
92 BOOL IsFixedPitch;
93 float UnderlinePosition;
94 float UnderlineThickness;
95 AFMBBOX FontBBox;
96 float Ascender;
97 float Descender;
98 WINMETRICS WinMetrics;
99 int NumofMetrics;
100 const AFMMETRICS *Metrics;
101 } AFM;
103 /* Note no 'next' in AFM. Use AFMLISTENTRY as a container. This allows more than
104 one list to exist without having to reallocate the entire AFM structure. We
105 keep a global list of all afms (PSDRV_AFMFontList) plus a list of available
106 fonts for each DC (dc->physDev->Fonts) */
108 typedef struct _tagAFMLISTENTRY {
109 const AFM *afm;
110 struct _tagAFMLISTENTRY *next;
111 } AFMLISTENTRY;
113 typedef struct _tagFONTFAMILY {
114 WCHAR *FamilyName; /* family name */
115 AFMLISTENTRY *afmlist; /* list of afms for this family */
116 struct _tagFONTFAMILY *next; /* next family */
117 } FONTFAMILY;
119 extern FONTFAMILY *PSDRV_AFMFontList DECLSPEC_HIDDEN;
120 extern const AFM *const PSDRV_BuiltinAFMs[] DECLSPEC_HIDDEN; /* last element is NULL */
122 typedef struct
124 struct list entry;
125 char *Name;
126 } FONTNAME;
128 typedef struct {
129 float llx, lly, urx, ury;
130 } IMAGEABLEAREA;
132 typedef struct {
133 float x, y;
134 } PAPERDIMENSION;
136 /* Solaris kludge */
137 #undef PAGESIZE
138 typedef struct _tagPAGESIZE {
139 struct list entry;
140 char *Name;
141 WCHAR *FullName;
142 char *InvocationString;
143 IMAGEABLEAREA *ImageableArea;
144 PAPERDIMENSION *PaperDimension;
145 WORD WinPage; /*eg DMPAPER_A4. Doesn't really belong here */
146 } PAGESIZE;
148 typedef struct
150 struct list entry;
151 char *Feature1;
152 char *Value1;
153 char *Feature2;
154 char *Value2;
155 } CONSTRAINT;
157 typedef struct
159 struct list entry;
160 const char *Name;
161 const char *FullName;
162 char *InvocationString;
163 WORD WinBin; /* eg DMBIN_LOWER */
164 } INPUTSLOT;
166 typedef enum _RASTERIZEROPTION
167 {RO_None, RO_Accept68K, RO_Type42, RO_TrueImage} RASTERIZEROPTION;
169 typedef struct
171 struct list entry;
172 char *Name;
173 char *FullName;
174 char *InvocationString;
175 WORD WinDuplex; /* eg DMDUP_SIMPLEX */
176 } DUPLEX;
178 typedef struct
180 struct list entry;
181 int resx, resy;
182 char *InvocationString;
183 } RESOLUTION;
185 /* Many Mac OS X based ppd files don't include a *ColorDevice line, so
186 we use a tristate here rather than a boolean. Code that
187 cares is expected to treat these as if they were colour. */
188 typedef enum {
189 CD_NotSpecified,
190 CD_False,
191 CD_True
192 } COLORDEVICE;
194 typedef struct {
195 char *NickName;
196 int LanguageLevel;
197 COLORDEVICE ColorDevice;
198 struct list Resolutions;
199 int DefaultResolution;
200 signed int LandscapeOrientation;
201 char *JCLBegin;
202 char *JCLToPSInterpreter;
203 char *JCLEnd;
204 char *DefaultFont;
205 struct list InstalledFonts;
206 struct list PageSizes;
207 PAGESIZE *DefaultPageSize;
208 struct list Constraints;
209 struct list InputSlots;
210 RASTERIZEROPTION TTRasterizer;
211 struct list Duplexes;
212 DUPLEX *DefaultDuplex;
213 } PPD;
215 typedef struct
217 struct list entry;
218 WCHAR *friendly_name;
219 PPD *ppd;
220 PSDRV_DEVMODE *Devmode;
221 FONTFAMILY *Fonts;
222 PPRINTER_ENUM_VALUESW FontSubTable;
223 DWORD FontSubTableSize;
224 } PRINTERINFO;
226 typedef struct {
227 float r, g, b;
228 } PSRGB;
230 typedef struct {
231 float i;
232 } PSGRAY;
235 /* def's for PSCOLOR.type */
236 #define PSCOLOR_GRAY 0
237 #define PSCOLOR_RGB 1
239 typedef struct {
240 int type;
241 union {
242 PSRGB rgb;
243 PSGRAY gray;
244 } value;
245 } PSCOLOR;
247 typedef struct {
248 const AFM *afm;
249 float scale;
250 TEXTMETRICW tm;
251 } BUILTIN;
253 typedef struct tagTYPE42 TYPE42;
255 typedef struct tagTYPE1 TYPE1;
257 enum downloadtype {
258 Type1, Type42
261 typedef struct _tagDOWNLOAD {
262 enum downloadtype type;
263 union {
264 TYPE1 *Type1;
265 TYPE42 *Type42;
266 } typeinfo;
267 char *ps_name;
268 struct _tagDOWNLOAD *next;
269 } DOWNLOAD;
271 enum fontloc {
272 Builtin, Download
275 typedef struct
277 INT xx, xy, yx, yy;
278 } matrix;
280 enum fontset { UNSET = 0, HORIZONTAL_SET, VERTICAL_SET };
282 typedef struct {
283 enum fontloc fontloc;
284 union {
285 BUILTIN Builtin;
286 DOWNLOAD *Download;
287 } fontinfo;
289 matrix size;
290 PSCOLOR color;
291 enum fontset set; /* Have we done a setfont yet */
293 /* These are needed by PSDRV_ExtTextOut */
294 int escapement;
295 } PSFONT;
297 typedef struct {
298 PSCOLOR color;
299 BOOL set;
300 struct brush_pattern pattern;
301 } PSBRUSH;
303 #define MAX_DASHLEN 16
305 typedef struct {
306 INT style;
307 INT width;
308 BYTE join;
309 BYTE endcap;
310 DWORD dash[MAX_DASHLEN];
311 DWORD dash_len;
312 PSCOLOR color;
313 BOOL set;
314 } PSPEN;
316 enum passthrough
318 passthrough_none,
319 passthrough_active,
320 passthrough_had_rect, /* See the comment in PSDRV_Rectangle */
323 typedef struct {
324 DWORD id; /* Job id */
325 HANDLE hprinter; /* Printer handle */
326 LPWSTR doc_name; /* Document Name */
327 BOOL OutOfPage; /* Page header not sent yet */
328 INT PageNo;
329 BOOL quiet; /* Don't actually output anything */
330 enum passthrough passthrough_state;
331 } JOB;
333 typedef struct
335 HDC hdc;
336 PSFONT font; /* Current PS font */
337 DOWNLOAD *downloaded_fonts;
338 PSPEN pen;
339 PSBRUSH brush;
340 PSCOLOR bkColor;
341 JOB job;
342 PSDRV_DEVMODE *Devmode;
343 PRINTERINFO *pi;
344 int pathdepth;
345 } print_ctx;
347 extern print_ctx *create_print_ctx( HDC hdc, const WCHAR *device,
348 const DEVMODEW *devmode ) DECLSPEC_HIDDEN;
351 * Every glyph name in the Adobe Glyph List and the 35 core PostScript fonts
354 extern const INT PSDRV_AGLGlyphNamesSize DECLSPEC_HIDDEN;
355 extern GLYPHNAME PSDRV_AGLGlyphNames[] DECLSPEC_HIDDEN;
359 * The AGL encoding vector
362 extern const INT PSDRV_AGLbyNameSize DECLSPEC_HIDDEN; /* sorted by name */
363 extern const UNICODEGLYPH PSDRV_AGLbyName[] DECLSPEC_HIDDEN; /* duplicates omitted */
365 extern const INT PSDRV_AGLbyUVSize DECLSPEC_HIDDEN; /* sorted by UV */
366 extern const UNICODEGLYPH PSDRV_AGLbyUV[] DECLSPEC_HIDDEN; /* duplicates included */
368 extern HINSTANCE PSDRV_hInstance DECLSPEC_HIDDEN;
369 extern HANDLE PSDRV_Heap DECLSPEC_HIDDEN;
370 extern char *PSDRV_ANSIVector[256] DECLSPEC_HIDDEN;
372 extern INPUTSLOT *find_slot( PPD *ppd, const DEVMODEW *dm ) DECLSPEC_HIDDEN;
373 extern PAGESIZE *find_pagesize( PPD *ppd, const DEVMODEW *dm ) DECLSPEC_HIDDEN;
374 extern DUPLEX *find_duplex( PPD *ppd, const DEVMODEW *dm ) DECLSPEC_HIDDEN;
376 /* GDI driver functions */
377 extern BOOL CDECL PSDRV_Arc( print_ctx *ctx, INT left, INT top, INT right, INT bottom,
378 INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
379 extern BOOL CDECL PSDRV_Chord( print_ctx *ctx, INT left, INT top, INT right, INT bottom,
380 INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
381 extern BOOL CDECL PSDRV_Ellipse( print_ctx *ctx, INT left, INT top, INT right, INT bottom) DECLSPEC_HIDDEN;
382 extern INT CDECL PSDRV_EndPage( print_ctx *ctx ) DECLSPEC_HIDDEN;
383 extern INT CDECL PSDRV_ExtEscape( print_ctx *ctx, INT nEscape, INT cbInput, LPCVOID in_data,
384 INT cbOutput, LPVOID out_data ) DECLSPEC_HIDDEN;
385 extern BOOL CDECL PSDRV_ExtTextOut( print_ctx *ctx, INT x, INT y, UINT flags,
386 const RECT *lprect, LPCWSTR str, UINT count, const INT *lpDx ) DECLSPEC_HIDDEN;
387 extern BOOL CDECL PSDRV_FillPath( print_ctx *ctx ) DECLSPEC_HIDDEN;
388 extern BOOL CDECL PSDRV_LineTo(print_ctx *ctx, INT x, INT y) DECLSPEC_HIDDEN;
389 extern BOOL CDECL PSDRV_PaintRgn( print_ctx *ctx, HRGN hrgn ) DECLSPEC_HIDDEN;
390 extern BOOL CDECL PSDRV_PatBlt(print_ctx *ctx, struct bitblt_coords *dst, DWORD dwRop) DECLSPEC_HIDDEN;
391 extern BOOL CDECL PSDRV_Pie( print_ctx *ctx, INT left, INT top, INT right, INT bottom,
392 INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
393 extern BOOL CDECL PSDRV_PolyBezier( print_ctx *ctx, const POINT *pts, DWORD count ) DECLSPEC_HIDDEN;
394 extern BOOL CDECL PSDRV_PolyBezierTo( print_ctx *ctx, const POINT *pts, DWORD count ) DECLSPEC_HIDDEN;
395 extern BOOL CDECL PSDRV_PolyPolygon( print_ctx *ctx, const POINT* pts, const INT* counts, UINT polygons ) DECLSPEC_HIDDEN;
396 extern BOOL CDECL PSDRV_PolyPolyline( print_ctx *ctx, const POINT* pts, const DWORD* counts, DWORD polylines ) DECLSPEC_HIDDEN;
397 extern DWORD CDECL PSDRV_PutImage( print_ctx *ctx, HRGN clip, BITMAPINFO *info,
398 const struct gdi_image_bits *bits, struct bitblt_coords *src,
399 struct bitblt_coords *dst, DWORD rop ) DECLSPEC_HIDDEN;
400 extern BOOL CDECL PSDRV_Rectangle( print_ctx *ctx, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN;
401 extern BOOL CDECL PSDRV_RoundRect( print_ctx *ctx, INT left, INT top, INT right,
402 INT bottom, INT ell_width, INT ell_height ) DECLSPEC_HIDDEN;
403 extern HBRUSH CDECL PSDRV_SelectBrush( print_ctx *ctx, HBRUSH hbrush, const struct brush_pattern *pattern ) DECLSPEC_HIDDEN;
404 extern HFONT CDECL PSDRV_SelectFont( print_ctx *ctx, HFONT hfont, UINT *aa_flags ) DECLSPEC_HIDDEN;
405 extern HPEN CDECL PSDRV_SelectPen( print_ctx *ctx, HPEN hpen, const struct brush_pattern *pattern ) DECLSPEC_HIDDEN;
406 extern COLORREF CDECL PSDRV_SetBkColor( print_ctx *ctx, COLORREF color ) DECLSPEC_HIDDEN;
407 extern COLORREF CDECL PSDRV_SetDCBrushColor( print_ctx *ctx, COLORREF color ) DECLSPEC_HIDDEN;
408 extern COLORREF CDECL PSDRV_SetDCPenColor( print_ctx *ctx, COLORREF color ) DECLSPEC_HIDDEN;
409 extern COLORREF CDECL PSDRV_SetPixel( print_ctx *ctx, INT x, INT y, COLORREF color ) DECLSPEC_HIDDEN;
410 extern COLORREF CDECL PSDRV_SetTextColor( print_ctx *ctx, COLORREF color ) DECLSPEC_HIDDEN;
411 extern BOOL CDECL PSDRV_StrokeAndFillPath( print_ctx *ctx ) DECLSPEC_HIDDEN;
412 extern BOOL CDECL PSDRV_StrokePath( print_ctx *ctx ) DECLSPEC_HIDDEN;
414 extern BOOL CDECL PSDRV_ResetDC( print_ctx *ctx, const DEVMODEW *lpInitData ) DECLSPEC_HIDDEN;
415 extern void PSDRV_MergeDevmodes(PSDRV_DEVMODE *dm1, const DEVMODEW *dm2,
416 PRINTERINFO *pi) DECLSPEC_HIDDEN;
417 extern BOOL PSDRV_GetFontMetrics(void) DECLSPEC_HIDDEN;
418 extern PPD *PSDRV_ParsePPD(const WCHAR *fname, HANDLE printer) DECLSPEC_HIDDEN;
419 extern PRINTERINFO *PSDRV_FindPrinterInfo(LPCWSTR name) DECLSPEC_HIDDEN;
420 extern const AFM *PSDRV_FindAFMinList(FONTFAMILY *head, LPCSTR name) DECLSPEC_HIDDEN;
421 extern BOOL PSDRV_AddAFMtoList(FONTFAMILY **head, const AFM *afm,
422 BOOL *p_added) DECLSPEC_HIDDEN;
423 extern void PSDRV_FreeAFMList( FONTFAMILY *head ) DECLSPEC_HIDDEN;
425 extern INT PSDRV_XWStoDS( print_ctx *ctx, INT width ) DECLSPEC_HIDDEN;
427 extern BOOL PSDRV_Brush(print_ctx *ctx, BOOL EO) DECLSPEC_HIDDEN;
428 extern BOOL PSDRV_SetFont( print_ctx *ctx, BOOL vertical ) DECLSPEC_HIDDEN;
429 extern BOOL PSDRV_SetPen( print_ctx *ctx ) DECLSPEC_HIDDEN;
431 extern void PSDRV_AddClip( print_ctx *ctx, HRGN hrgn ) DECLSPEC_HIDDEN;
432 extern void PSDRV_SetClip( print_ctx *ctx ) DECLSPEC_HIDDEN;
433 extern void PSDRV_ResetClip( print_ctx *ctx ) DECLSPEC_HIDDEN;
435 extern void PSDRV_CreateColor( print_ctx *ctx, PSCOLOR *pscolor,
436 COLORREF wincolor ) DECLSPEC_HIDDEN;
437 extern PSRGB rgb_to_grayscale_scale( void ) DECLSPEC_HIDDEN;
438 extern char PSDRV_UnicodeToANSI(int u) DECLSPEC_HIDDEN;
440 extern INT PSDRV_WriteHeader( print_ctx *ctx, LPCWSTR title ) DECLSPEC_HIDDEN;
441 extern INT PSDRV_WriteFooter( print_ctx *ctx ) DECLSPEC_HIDDEN;
442 extern INT PSDRV_WriteNewPage( print_ctx *ctx ) DECLSPEC_HIDDEN;
443 extern INT PSDRV_WriteEndPage( print_ctx *ctx ) DECLSPEC_HIDDEN;
444 extern BOOL PSDRV_WriteMoveTo(print_ctx *ctx, INT x, INT y) DECLSPEC_HIDDEN;
445 extern BOOL PSDRV_WriteLineTo(print_ctx *ctx, INT x, INT y) DECLSPEC_HIDDEN;
446 extern BOOL PSDRV_WriteStroke(print_ctx *ctx) DECLSPEC_HIDDEN;
447 extern BOOL PSDRV_WriteRectangle(print_ctx *ctx, INT x, INT y, INT width, INT height) DECLSPEC_HIDDEN;
448 extern BOOL PSDRV_WriteRRectangle(print_ctx *ctx, INT x, INT y, INT width, INT height) DECLSPEC_HIDDEN;
449 extern BOOL PSDRV_WriteSetFont(print_ctx *ctx, const char *name, matrix size, INT escapement,
450 BOOL fake_italic) DECLSPEC_HIDDEN;
451 extern BOOL PSDRV_WriteGlyphShow(print_ctx *ctx, LPCSTR g_name) DECLSPEC_HIDDEN;
452 extern BOOL PSDRV_WriteSetPen(print_ctx *ctx) DECLSPEC_HIDDEN;
453 extern BOOL PSDRV_WriteArc(print_ctx *ctx, INT x, INT y, INT w, INT h,
454 double ang1, double ang2) DECLSPEC_HIDDEN;
455 extern BOOL PSDRV_WriteCurveTo(print_ctx *ctx, POINT pts[3]) DECLSPEC_HIDDEN;
456 extern BOOL PSDRV_WriteSetColor(print_ctx *ctx, PSCOLOR *color) DECLSPEC_HIDDEN;
457 extern BOOL PSDRV_WriteSetBrush(print_ctx *ctx) DECLSPEC_HIDDEN;
458 extern BOOL PSDRV_WriteFill(print_ctx *ctx) DECLSPEC_HIDDEN;
459 extern BOOL PSDRV_WriteEOFill(print_ctx *ctx) DECLSPEC_HIDDEN;
460 extern BOOL PSDRV_WriteGSave(print_ctx *ctx) DECLSPEC_HIDDEN;
461 extern BOOL PSDRV_WriteGRestore(print_ctx *ctx) DECLSPEC_HIDDEN;
462 extern BOOL PSDRV_WriteNewPath(print_ctx *ctx) DECLSPEC_HIDDEN;
463 extern BOOL PSDRV_WriteClosePath(print_ctx *ctx) DECLSPEC_HIDDEN;
464 extern BOOL PSDRV_WriteClip(print_ctx *ctx) DECLSPEC_HIDDEN;
465 extern BOOL PSDRV_WriteRectClip(print_ctx *ctx, INT x, INT y, INT w, INT h) DECLSPEC_HIDDEN;
466 extern BOOL PSDRV_WriteRectClip2(print_ctx *ctx, CHAR *pszArrayName) DECLSPEC_HIDDEN;
467 extern BOOL PSDRV_WriteEOClip(print_ctx *ctx) DECLSPEC_HIDDEN;
468 extern BOOL PSDRV_WriteHatch(print_ctx *ctx) DECLSPEC_HIDDEN;
469 extern BOOL PSDRV_WriteRotate(print_ctx *ctx, float ang) DECLSPEC_HIDDEN;
470 extern BOOL PSDRV_WriteIndexColorSpaceBegin(print_ctx *ctx, int size) DECLSPEC_HIDDEN;
471 extern BOOL PSDRV_WriteIndexColorSpaceEnd(print_ctx *ctx) DECLSPEC_HIDDEN;
472 extern BOOL PSDRV_WriteRGBQUAD(print_ctx *ctx, const RGBQUAD *rgb, int number) DECLSPEC_HIDDEN;
473 extern BOOL PSDRV_WriteImage(print_ctx *ctx, WORD depth, BOOL grayscale, INT xDst, INT yDst,
474 INT widthDst, INT heightDst, INT widthSrc,
475 INT heightSrc, BOOL mask, BOOL top_down) DECLSPEC_HIDDEN;
476 extern BOOL PSDRV_WriteBytes(print_ctx *ctx, const BYTE *bytes, DWORD number) DECLSPEC_HIDDEN;
477 extern BOOL PSDRV_WriteData(print_ctx *ctx, const BYTE *byte, DWORD number) DECLSPEC_HIDDEN;
478 extern DWORD PSDRV_WriteSpool(print_ctx *ctx, LPCSTR lpData, DWORD cch) DECLSPEC_HIDDEN;
479 extern BOOL PSDRV_WriteDIBPatternDict(print_ctx *ctx, const BITMAPINFO *bmi, BYTE *bits, UINT usage) DECLSPEC_HIDDEN;
480 extern BOOL PSDRV_WriteArrayPut(print_ctx *ctx, CHAR *pszArrayName, INT nIndex, LONG lCoord) DECLSPEC_HIDDEN;
481 extern BOOL PSDRV_WriteArrayDef(print_ctx *ctx, CHAR *pszArrayName, INT nSize) DECLSPEC_HIDDEN;
483 extern INT CDECL PSDRV_StartPage( print_ctx *ctx ) DECLSPEC_HIDDEN;
485 INT PSDRV_GlyphListInit(void) DECLSPEC_HIDDEN;
486 const GLYPHNAME *PSDRV_GlyphName(LPCSTR szName) DECLSPEC_HIDDEN;
487 VOID PSDRV_IndexGlyphList(void) DECLSPEC_HIDDEN;
488 BOOL PSDRV_GetType1Metrics(void) DECLSPEC_HIDDEN;
489 SHORT PSDRV_CalcAvgCharWidth(const AFM *afm) DECLSPEC_HIDDEN;
491 extern BOOL PSDRV_WriteSetBuiltinFont(print_ctx *ctx) DECLSPEC_HIDDEN;
492 extern BOOL PSDRV_WriteBuiltinGlyphShow(print_ctx *ctx, LPCWSTR str, INT count) DECLSPEC_HIDDEN;
494 extern BOOL PSDRV_SelectDownloadFont(print_ctx *ctx) DECLSPEC_HIDDEN;
495 extern BOOL PSDRV_WriteSetDownloadFont(print_ctx *ctx, BOOL vertical) DECLSPEC_HIDDEN;
496 extern BOOL PSDRV_WriteDownloadGlyphShow(print_ctx *ctx, const WORD *glyphs, UINT count) DECLSPEC_HIDDEN;
497 extern BOOL PSDRV_EmptyDownloadList(print_ctx *ctx, BOOL write_undef) DECLSPEC_HIDDEN;
499 extern DWORD write_spool( print_ctx *ctx, const void *data, DWORD num ) DECLSPEC_HIDDEN;
501 #define MAX_G_NAME 31 /* max length of PS glyph name */
502 extern void get_glyph_name(HDC hdc, WORD index, char *name) DECLSPEC_HIDDEN;
504 extern TYPE1 *T1_download_header(print_ctx *ctx, char *ps_name,
505 RECT *bbox, UINT emsize) DECLSPEC_HIDDEN;
506 extern BOOL T1_download_glyph(print_ctx *ctx, DOWNLOAD *pdl,
507 DWORD index, char *glyph_name) DECLSPEC_HIDDEN;
508 extern void T1_free(TYPE1 *t1) DECLSPEC_HIDDEN;
510 extern TYPE42 *T42_download_header(print_ctx *ctx, char *ps_name,
511 RECT *bbox, UINT emsize) DECLSPEC_HIDDEN;
512 extern BOOL T42_download_glyph(print_ctx *ctx, DOWNLOAD *pdl,
513 DWORD index, char *glyph_name) DECLSPEC_HIDDEN;
514 extern void T42_free(TYPE42 *t42) DECLSPEC_HIDDEN;
516 extern DWORD RLE_encode(BYTE *in_buf, DWORD len, BYTE *out_buf) DECLSPEC_HIDDEN;
517 extern DWORD ASCII85_encode(BYTE *in_buf, DWORD len, BYTE *out_buf) DECLSPEC_HIDDEN;
519 extern void passthrough_enter(print_ctx *ctx) DECLSPEC_HIDDEN;
520 extern void passthrough_leave(print_ctx *ctx) DECLSPEC_HIDDEN;
522 #define push_lc_numeric(x) do { \
523 const char *tmplocale = setlocale(LC_NUMERIC,NULL); \
524 setlocale(LC_NUMERIC,x);
526 #define pop_lc_numeric() \
527 setlocale(LC_NUMERIC,tmplocale); \
528 } while (0)
530 static inline WCHAR *strdupW( const WCHAR *str )
532 int size;
533 WCHAR *ret;
535 if (!str) return NULL;
536 size = (lstrlenW( str ) + 1) * sizeof(WCHAR);
537 ret = HeapAlloc( GetProcessHeap(), 0, size );
538 if (ret) memcpy( ret, str, size );
539 return ret;
542 #endif