atl80: Added AtlComModuleRegisterServer implementation (based on AtlModuleRegisterSer...
[wine] / dlls / wineps16.drv16 / driver.c
1 /*
2  * Exported functions from the PostScript driver.
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 #include "config.h"
22
23 #include <stdarg.h>
24
25 #include "windef.h"
26 #include "wine/winuser16.h"
27 #include "wownt32.h"
28 #include "winspool.h"
29 #include "wine/debug.h"
30
31 WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
32
33
34 /**************************************************************
35  *      AdvancedSetupDialog     [WINEPS16.93]
36  */
37 WORD WINAPI PSDRV_AdvancedSetupDialog16(HWND16 hwnd, HANDLE16 hDriver,
38                                         LPDEVMODEA devin, LPDEVMODEA devout)
39 {
40     TRACE("hwnd = %04x, hDriver = %04x devin=%p devout=%p\n", hwnd, hDriver, devin, devout);
41     return IDCANCEL;
42 }
43
44 /***************************************************************
45  *      ExtDeviceMode   [WINEPS16.90]
46  */
47 INT16 WINAPI PSDRV_ExtDeviceMode16(HWND16 hwnd, HANDLE16 hDriver,
48                                    LPDEVMODEA lpdmOutput, LPSTR lpszDevice,
49                                    LPSTR lpszPort, LPDEVMODEA lpdmInput,
50                                    LPSTR lpszProfile, WORD fwMode)
51
52 {
53     return DocumentPropertiesA( HWND_32(hwnd), 0, lpszDevice, lpdmOutput, lpdmInput, fwMode );
54 }
55
56 /**************************************************************
57  *     DeviceCapabilities [WINEPS16.91]
58  */
59 DWORD WINAPI PSDRV_DeviceCapabilities16(LPCSTR lpszDevice,
60                                LPCSTR lpszPort, WORD fwCapability,
61                                LPSTR lpszOutput, LPDEVMODEA lpdm)
62 {
63     int i, ret;
64     POINT *pt;
65     POINT16 *pt16;
66
67     if (fwCapability != DC_PAPERSIZE || !lpszOutput)
68         return DeviceCapabilitiesA( lpszDevice, lpszPort, fwCapability, lpszOutput, lpdm );
69
70     /* for DC_PAPERSIZE, map POINT to POINT16 */
71
72     ret = DeviceCapabilitiesA( lpszDevice, lpszPort, DC_PAPERSIZE, NULL, lpdm );
73     if (ret <= 0) return ret;
74
75     pt16 = (POINT16 *)lpszOutput;
76     pt = HeapAlloc( GetProcessHeap(), 0, ret * sizeof(POINT) );
77     ret = DeviceCapabilitiesA( lpszDevice, lpszPort, DC_PAPERSIZE, (LPSTR)pt, lpdm );
78     for (i = 0; i < ret; i++)
79     {
80         pt16[i].x = pt[i].x;
81         pt16[i].y = pt[i].y;
82     }
83     HeapFree( GetProcessHeap(), 0, pt );
84     return ret;
85 }
86
87 /***************************************************************
88  *      DeviceMode      [WINEPS16.13]
89  *
90  */
91 void WINAPI PSDRV_DeviceMode16(HWND16 hwnd, HANDLE16 hDriver, LPSTR lpszDevice, LPSTR lpszPort)
92 {
93     PSDRV_ExtDeviceMode16( hwnd, hDriver, NULL, lpszDevice, lpszPort, NULL, NULL, DM_PROMPT );
94 }