2 * Postscript driver initialization functions
4 * Copyright 1998 Huw D M Davies
14 static BOOL32
PSDRV_CreateDC( DC
*dc
, LPCSTR driver
, LPCSTR device
,
15 LPCSTR output
, const DEVMODE16
* initData
);
16 static BOOL32
PSDRV_DeleteDC( DC
*dc
);
18 static const DC_FUNCTIONS PSDRV_Funcs
=
23 PSDRV_CreateDC
, /* pCreateDC */
24 PSDRV_DeleteDC
, /* pDeleteDC */
25 NULL
, /* pDeleteObject */
26 PSDRV_Ellipse
, /* pEllipse */
27 PSDRV_EnumDeviceFonts
, /* pEnumDeviceFonts */
28 PSDRV_Escape
, /* pEscape */
29 NULL
, /* pExcludeClipRect */
30 NULL
, /* pExcludeVisRect */
31 NULL
, /* pExtFloodFill */
32 PSDRV_ExtTextOut
, /* pExtTextOut */
33 NULL
, /* pGetCharWidth */
35 PSDRV_GetTextExtentPoint
, /* pGetTextExtentPoint */
36 PSDRV_GetTextMetrics
, /* pGetTextMetrics */
37 NULL
, /* pIntersectClipRect */
38 NULL
, /* pIntersectVisRect */
39 PSDRV_LineTo
, /* pLineTo */
40 PSDRV_MoveToEx
, /* pMoveToEx */
41 NULL
, /* pOffsetClipRgn */
42 NULL
, /* pOffsetViewportOrg (optional) */
43 NULL
, /* pOffsetWindowOrg (optional) */
47 NULL
, /* pPolyPolygon */
48 NULL
, /* pPolyPolyline */
51 NULL
, /* pRealizePalette */
52 PSDRV_Rectangle
, /* pRectangle */
53 NULL
, /* pRestoreDC */
54 NULL
, /* pRoundRect */
56 NULL
, /* pScaleViewportExt (optional) */
57 NULL
, /* pScaleWindowExt (optional) */
58 NULL
, /* pSelectClipRgn */
59 PSDRV_SelectObject
, /* pSelectObject */
60 NULL
, /* pSelectPalette */
61 NULL
, /* pSetBkColor */
62 NULL
, /* pSetBkMode */
63 NULL
, /* pSetDeviceClipping */
64 NULL
, /* pSetDIBitsToDevice */
65 NULL
, /* pSetMapMode (optional) */
66 NULL
, /* pSetMapperFlags */
68 NULL
, /* pSetPolyFillMode */
70 NULL
, /* pSetRelAbs */
71 NULL
, /* pSetStretchBltMode */
72 NULL
, /* pSetTextAlign */
73 NULL
, /* pSetTextCharacterExtra */
74 NULL
, /* pSetTextColor */
75 NULL
, /* pSetTextJustification */
76 NULL
, /* pSetViewportExt (optional) */
77 NULL
, /* pSetViewportOrg (optional) */
78 NULL
, /* pSetWindowExt (optional) */
79 NULL
, /* pSetWindowOrg (optional) */
80 NULL
, /* pStretchBlt */
81 NULL
/* pStretchDIBits */
85 /* Default entries for devcaps */
87 static DeviceCaps PSDRV_DevCaps
= {
89 /* technology */ DT_RASPRINTER
,
102 /* curveCaps */ CC_CIRCLES
| CC_PIE
| CC_CHORD
| CC_ELLIPSES
|
103 CC_WIDE
| CC_STYLED
| CC_WIDESTYLED
| CC_INTERIORS
|
105 /* lineCaps */ LC_POLYLINE
| LC_MARKER
| LC_POLYMARKER
| LC_WIDE
|
106 LC_STYLED
| LC_WIDESTYLED
| LC_INTERIORS
,
107 /* polygoalnCaps */ PC_POLYGON
| PC_RECTANGLE
| PC_WINDPOLYGON
|
108 PC_SCANLINE
| PC_WIDE
| PC_STYLED
| PC_WIDESTYLED
|
110 /* textCaps */ 0, /* psdrv 0x59f7 */
111 /* clipCaps */ CP_RECTANGLE
,
112 /* rasterCaps */ RC_BITBLT
| RC_BANDING
| RC_SCALING
| RC_BITMAP64
|
113 RC_DI_BITMAP
| RC_DIBTODEV
| RC_BIGFONT
|
114 RC_STRETCHBLT
| RC_STRETCHDIB
| RC_DEVBITS
,
120 /* logPixelsX */ 600,
121 /* logPixelsY */ 600,
123 /* palette size */ 0,
126 /*********************************************************************
129 * Initializes font metrics and registers driver. Called from GDI_Init()
132 BOOL32
PSDRV_Init(void)
135 PSDRV_GetFontMetrics();
136 return DRIVER_RegisterDriver( "WINEPS", &PSDRV_Funcs
);
140 /**********************************************************************
143 static BOOL32
PSDRV_CreateDC( DC
*dc
, LPCSTR driver
, LPCSTR device
,
144 LPCSTR output
, const DEVMODE16
* initData
)
146 PSDRV_PDEVICE
*physDev
;
148 TRACE(psdrv
, "(%s %s %s %p)\n", driver
, device
, output
, initData
);
150 if(!PSDRV_AFMFontList
) {
151 MSG("To use WINEPS you need to install some AFM files.\n");
155 dc
->w
.devCaps
= &PSDRV_DevCaps
;
156 dc
->w
.hVisRgn
= CreateRectRgn32(0, 0, dc
->w
.devCaps
->horzRes
,
157 dc
->w
.devCaps
->vertRes
);
159 physDev
= (PSDRV_PDEVICE
*)HeapAlloc( GetProcessHeap(), 0,
161 if (!physDev
) return FALSE
;
162 dc
->physDev
= physDev
;
163 physDev
->job
.output
= HEAP_strdupA( GetProcessHeap(), 0, output
);
164 if (!physDev
->job
.output
) return FALSE
;
165 physDev
->job
.hJob
= 0;
170 /**********************************************************************
173 static BOOL32
PSDRV_DeleteDC( DC
*dc
)
175 PSDRV_PDEVICE
*physDev
= (PSDRV_PDEVICE
*)dc
->physDev
;
178 HeapFree( GetProcessHeap(), 0, physDev
->job
.output
);
179 HeapFree( GetProcessHeap(), 0, physDev
);