Release 980503
[wine] / misc / printdrv.c
1 /* 
2  * Implementation of some printer driver bits
3  * 
4  * Copyright 1996 John Harvey
5  */
6
7 #include <stdlib.h>
8 #include <stdio.h>
9 #include <string.h>
10 #include <ctype.h>
11 #include "windows.h"
12 #include "win.h"
13 #include "winerror.h"
14 #include "debug.h"
15
16 INT16 WINAPI StartDoc16( HDC16 hdc, const DOCINFO16 *lpdoc )
17 {
18   INT16 retVal;
19   TRACE(print,"(%p)\n", lpdoc );
20   TRACE(print,"%d 0x%lx:0x%p 0x%lx:0x%p\n",lpdoc->cbSize,
21         lpdoc->lpszDocName,PTR_SEG_TO_LIN(lpdoc->lpszDocName),
22         lpdoc->lpszOutput,PTR_SEG_TO_LIN(lpdoc->lpszOutput));
23   TRACE(print, "%d %s %s\n",lpdoc->cbSize,
24         (LPSTR)PTR_SEG_TO_LIN(lpdoc->lpszDocName),
25         (LPSTR)PTR_SEG_TO_LIN(lpdoc->lpszOutput));
26   retVal =  Escape16(hdc, STARTDOC, sizeof(DOCINFO16), lpdoc->lpszDocName, 0);
27   TRACE(print,"Escape16 returned %d\n",retVal);
28   return retVal;
29 }
30
31 INT16 WINAPI EndDoc16(HDC16 hdc)
32 {
33   return  Escape16(hdc, ENDDOC, 0, 0, 0);
34 }
35
36
37
38 DWORD WINAPI DrvGetPrinterData(LPSTR lpPrinter, LPSTR lpProfile,
39                                LPDWORD lpType, LPBYTE lpPrinterData,
40                                int cbData, LPDWORD lpNeeded)
41 {
42     FIXME(print, "stub.\n");
43     if (HIWORD(lpPrinter))
44             TRACE(print,"printer %s\n",lpPrinter);
45     else
46             TRACE(print,"printer %p\n",lpPrinter);
47     if (HIWORD(lpProfile))
48             TRACE(print,"profile %s\n",lpProfile);
49     else
50             TRACE(print,"profile %p\n",lpProfile);
51     TRACE(print,"lpType %p\n",lpType);
52     return 0;
53 }
54
55
56
57 DWORD WINAPI DrvSetPrinterData(LPSTR lpPrinter, LPSTR lpProfile,
58                                LPDWORD lpType, LPBYTE lpPrinterData,
59                                DWORD dwSize)
60 {
61     FIXME(print, "stub.\n");
62     if (HIWORD(lpPrinter))
63             TRACE(print,"printer %s\n",lpPrinter);
64     else
65             TRACE(print,"printer %p\n",lpPrinter);
66     if (HIWORD(lpProfile))
67             TRACE(print,"profile %s\n",lpProfile);
68     else
69             TRACE(print,"profile %p\n",lpProfile);
70     TRACE(print,"lpType %p\n",lpType);
71     return 0;
72 }
73
74
75 INT32 WINAPI DeviceCapabilities32A(LPCSTR printer,LPCSTR target,WORD z,
76                                    LPSTR a,LPDEVMODE32A b)
77 {
78     FIXME(print,"(%s,%s,%d,%p,%p):stub.\n",printer,target,z,a,b);
79     return 1;           
80 }
81
82 LONG WINAPI DocumentProperties32A(HWND32 hWnd,HANDLE32 hPrinter,
83                                 LPSTR pDeviceName, LPDEVMODE32A pDevModeOutput,
84                                   LPDEVMODE32A pDevModeInput,DWORD fMode )
85 {
86     FIXME(print,"(%d,%d,%s,%p,%p,%ld):stub.\n",
87         hWnd,hPrinter,pDeviceName,pDevModeOutput,pDevModeInput,fMode
88     );
89     return 1;
90 }
91
92 BOOL32 WINAPI OpenPrinter32A(LPSTR lpPrinterName,HANDLE32 *phPrinter,
93                              LPPRINTER_DEFAULTS32A pDefault)
94 {
95     FIXME(print,"(%s,%p,%p):stub.\n",
96             lpPrinterName, phPrinter, pDefault);
97     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
98     return FALSE;
99 }
100 BOOL32  WINAPI EnumPrinters32A(DWORD dwType, LPSTR lpszName,
101                                DWORD dwLevel, LPBYTE lpbPrinters,
102                                DWORD cbBuf, LPDWORD lpdwNeeded,
103                                LPDWORD lpdwReturned)
104 {
105     FIXME(print,"Nearly empty stub\n");
106     *lpdwReturned=0;
107     return TRUE;
108 }