3 * PostScript driver definitions
5 * Copyright 1998 Huw D M Davies
13 float llx
, lly
, urx
, ury
;
16 typedef struct _tagAFMLIGS
{
19 struct _tagAFMLIGS
*next
;
22 typedef struct _tagAFMMETRICS
{
23 int C
; /* character */
27 AFMLIGS
*L
; /* Ligatures */
28 struct _tagAFMMETRICS
*next
;
31 typedef struct _tagAFM
{
36 int Weight
; /* FW_NORMAL etc. */
39 float UnderlinePosition
;
40 float UnderlineThickness
;
46 float FullAscender
; /* Ascent of Aring character */
47 float CharWidths
[256];
50 } AFM
; /* CharWidths is a shortcut to the WX values of numbered glyphs */
52 /* Note no 'next' in AFM. Use AFMLISTENTRY as a container. This allow more than
53 one list to exist without having to reallocate the entire AFM structure. We
54 keep a global list of all afms (PSDRV_AFMFontList) plus a list of available
55 fonts for each DC (dc->physDev->Fonts) */
57 typedef struct _tagAFMLISTENTRY
{
59 struct _tagAFMLISTENTRY
*next
;
62 typedef struct _tagFONTFAMILY
{
63 char *FamilyName
; /* family name */
64 AFMLISTENTRY
*afmlist
; /* list of afms for this family */
65 struct _tagFONTFAMILY
*next
; /* next family */
68 extern FONTFAMILY
*PSDRV_AFMFontList
;
70 typedef struct _tagFONTNAME
{
72 struct _tagFONTNAME
*next
;
76 float llx
, lly
, urx
, ury
;
83 typedef struct _tagPAGESIZE
{
86 char *InvocationString
;
87 IMAGEABLEAREA
*ImageableArea
;
88 PAPERDIMENSION
*PaperDimension
;
89 WORD WinPage
; /*eg DMPAPER_A4. Doesn't really belong here */
90 struct _tagPAGESIZE
*next
;
94 typedef struct _tagOPTIONENTRY
{
95 char *Name
; /* eg "True" */
96 char *FullName
; /* eg "Installed" */
97 char *InvocationString
; /* Often NULL */
98 struct _tagOPTIONENTRY
*next
;
101 typedef struct _tagOPTION
{ /* Treat bool as a special case of pickone */
102 char *OptionName
; /* eg "*Option1" */
103 char *FullName
; /* eg "Envelope Feeder" */
104 char *DefaultOption
; /* eg "False" */
105 OPTIONENTRY
*Options
;
106 struct _tagOPTION
*next
;
109 typedef struct _tagCONSTRAINT
{
114 struct _tagCONSTRAINT
*next
;
117 typedef struct _tagINPUTSLOT
{
120 char *InvocationString
;
121 WORD WinBin
; /* eg DMBIN_LOWER */
122 struct _tagINPUTSLOT
*next
;
129 int DefaultResolution
;
130 signed int LandscapeOrientation
;
132 char *JCLToPSInterpreter
;
135 FONTNAME
*InstalledFonts
; /* ptr to a list of FontNames */
137 OPTION
*InstalledOptions
;
138 CONSTRAINT
*Constraints
;
139 INPUTSLOT
*InputSlots
;
144 struct _tagdocprivate
{
146 struct _tagdrvprivate
{
147 char ppdFileName
[100]; /* Hack */
148 UINT32 numInstalledOptions
; /* Options at end of struct */
153 numInstalledOptions of OPTIONs
159 typedef struct _tagPI
{
162 PSDRV_DEVMODE16
*Devmode
;
176 /* def's for PSCOLOR.type */
177 #define PSCOLOR_GRAY 0
178 #define PSCOLOR_RGB 1
195 BOOL32 set
; /* Have we done a setfont yet */
212 LPSTR output
; /* Output file/port */
213 BOOL32 banding
; /* Have we received a NEXTBAND */
214 BOOL32 NeedPageHeader
; /* Page header not sent yet */
219 PSFONT font
; /* Current PS font */
223 PSCOLOR inkColor
; /* Last colour set */
225 PSDRV_DEVMODE16
*Devmode
;
229 extern HANDLE32 PSDRV_Heap
;
230 extern char *PSDRV_ANSIVector
[256];
232 extern void PSDRV_MergeDevmodes(PSDRV_DEVMODE16
*dm1
, PSDRV_DEVMODE16
*dm2
,
234 extern BOOL32
PSDRV_GetFontMetrics(void);
235 extern PPD
*PSDRV_ParsePPD(char *fname
);
236 extern PRINTERINFO
*PSDRV_FindPrinterInfo(LPCSTR name
);
237 extern AFM
*PSDRV_FindAFMinList(FONTFAMILY
*head
, char *name
);
238 extern void PSDRV_AddAFMtoList(FONTFAMILY
**head
, AFM
*afm
);
239 extern void PSDRV_FreeAFMList( FONTFAMILY
*head
);
241 extern BOOL32
PSDRV_Init(void);
242 extern HFONT16
PSDRV_FONT_SelectObject( DC
*dc
, HFONT16 hfont
, FONTOBJ
*font
);
243 extern HPEN32
PSDRV_PEN_SelectObject( DC
* dc
, HPEN32 hpen
, PENOBJ
* pen
);
244 extern HBRUSH32
PSDRV_BRUSH_SelectObject( DC
* dc
, HBRUSH32 hbrush
,
247 extern BOOL32
PSDRV_Brush(DC
*dc
, BOOL32 EO
);
248 extern BOOL32
PSDRV_SetFont( DC
*dc
);
249 extern BOOL32
PSDRV_SetPen( DC
*dc
);
251 extern BOOL32
PSDRV_CmpColor(PSCOLOR
*col1
, PSCOLOR
*col2
);
252 extern BOOL32
PSDRV_CopyColor(PSCOLOR
*col1
, PSCOLOR
*col2
);
253 extern void PSDRV_CreateColor( PSDRV_PDEVICE
*physDev
, PSCOLOR
*pscolor
,
257 extern INT32
PSDRV_WriteHeader( DC
*dc
, char *title
, int len
);
258 extern INT32
PSDRV_WriteFooter( DC
*dc
);
259 extern INT32
PSDRV_WriteNewPage( DC
*dc
);
260 extern INT32
PSDRV_WriteEndPage( DC
*dc
);
261 extern BOOL32
PSDRV_WriteMoveTo(DC
*dc
, INT32 x
, INT32 y
);
262 extern BOOL32
PSDRV_WriteLineTo(DC
*dc
, INT32 x
, INT32 y
);
263 extern BOOL32
PSDRV_WriteStroke(DC
*dc
);
264 extern BOOL32
PSDRV_WriteRectangle(DC
*dc
, INT32 x
, INT32 y
, INT32 width
,
266 extern BOOL32
PSDRV_WriteSetFont(DC
*dc
, BOOL32 UseANSI
);
267 extern BOOL32
PSDRV_WriteShow(DC
*dc
, char *str
, INT32 count
);
268 extern BOOL32
PSDRV_WriteReencodeFont(DC
*dc
);
269 extern BOOL32
PSDRV_WriteSetPen(DC
*dc
);
270 extern BOOL32
PSDRV_WriteArc(DC
*dc
, INT32 x
, INT32 y
, INT32 w
, INT32 h
,
271 double ang1
, double ang2
);
272 extern BOOL32
PSDRV_WriteSetColor(DC
*dc
, PSCOLOR
*color
);
273 extern BOOL32
PSDRV_WriteSetBrush(DC
*dc
);
274 extern BOOL32
PSDRV_WriteFill(DC
*dc
);
275 extern BOOL32
PSDRV_WriteEOFill(DC
*dc
);
276 extern BOOL32
PSDRV_WriteGSave(DC
*dc
);
277 extern BOOL32
PSDRV_WriteGRestore(DC
*dc
);
278 extern BOOL32
PSDRV_WriteClosePath(DC
*dc
);
279 extern BOOL32
PSDRV_WriteClip(DC
*dc
);
280 extern BOOL32
PSDRV_WriteEOClip(DC
*dc
);
281 extern BOOL32
PSDRV_WriteHatch(DC
*dc
);
282 extern BOOL32
PSDRV_WriteRotate(DC
*dc
, float ang
);
288 extern BOOL32
PSDRV_Arc( DC
*dc
, INT32 left
, INT32 top
, INT32 right
,
289 INT32 bottom
, INT32 xstart
, INT32 ystart
,
290 INT32 xend
, INT32 yend
);
291 extern BOOL32
PSDRV_Chord( DC
*dc
, INT32 left
, INT32 top
, INT32 right
,
292 INT32 bottom
, INT32 xstart
, INT32 ystart
,
293 INT32 xend
, INT32 yend
);
294 extern BOOL32
PSDRV_Ellipse( DC
*dc
, INT32 left
, INT32 top
, INT32 right
,
296 extern BOOL32
PSDRV_EnumDeviceFonts( DC
* dc
, LPLOGFONT16 plf
,
297 DEVICEFONTENUMPROC proc
, LPARAM lp
);
298 extern INT32
PSDRV_Escape( DC
*dc
, INT32 nEscape
, INT32 cbInput
,
299 SEGPTR lpInData
, SEGPTR lpOutData
);
300 extern BOOL32
PSDRV_ExtTextOut( DC
*dc
, INT32 x
, INT32 y
, UINT32 flags
,
301 const RECT32
*lprect
, LPCSTR str
, UINT32 count
,
303 extern BOOL32
PSDRV_GetCharWidth( DC
*dc
, UINT32 firstChar
, UINT32 lastChar
,
305 extern BOOL32
PSDRV_GetTextExtentPoint( DC
*dc
, LPCSTR str
, INT32 count
,
307 extern BOOL32
PSDRV_GetTextMetrics( DC
*dc
, TEXTMETRIC32A
*metrics
);
308 extern BOOL32
PSDRV_LineTo( DC
*dc
, INT32 x
, INT32 y
);
309 extern BOOL32
PSDRV_MoveToEx( DC
*dc
, INT32 x
, INT32 y
, LPPOINT32 pt
);
310 extern BOOL32
PSDRV_Pie( DC
*dc
, INT32 left
, INT32 top
, INT32 right
,
311 INT32 bottom
, INT32 xstart
, INT32 ystart
,
312 INT32 xend
, INT32 yend
);
313 extern BOOL32
PSDRV_Polygon( DC
*dc
, const POINT32
* pt
, INT32 count
);
314 extern BOOL32
PSDRV_Polyline( DC
*dc
, const POINT32
* pt
, INT32 count
);
315 extern BOOL32
PSDRV_PolyPolygon( DC
*dc
, const POINT32
* pts
, const INT32
* counts
,
317 extern BOOL32
PSDRV_PolyPolyline( DC
*dc
, const POINT32
* pts
, const DWORD
* counts
,
319 extern BOOL32
PSDRV_Rectangle( DC
*dc
, INT32 left
, INT32 top
, INT32 right
,
321 extern BOOL32
PSDRV_RoundRect(DC
*dc
, INT32 left
, INT32 top
, INT32 right
,
322 INT32 bottom
, INT32 ell_width
, INT32 ell_height
);
323 extern HGDIOBJ32
PSDRV_SelectObject( DC
*dc
, HGDIOBJ32 handle
);
324 extern COLORREF
PSDRV_SetBkColor( DC
*dc
, COLORREF color
);
325 extern COLORREF
PSDRV_SetPixel( DC
*dc
, INT32 x
, INT32 y
, COLORREF color
);
326 extern COLORREF
PSDRV_SetTextColor( DC
*dc
, COLORREF color
);
327 extern INT32
PSDRV_StretchDIBits( DC
*dc
, INT32 xDst
, INT32 yDst
,
328 INT32 widthDst
, INT32 heightDst
, INT32 xSrc
,
329 INT32 ySrc
, INT32 widthSrc
, INT32 heightSrc
,
330 const void *bits
, const BITMAPINFO
*info
,
331 UINT32 wUsage
, DWORD dwRop
);