Make ExtDeviceMode dialog use unicode property sheet functions.
[wine] / dlls / wineps / driver.c
1 /*
2  * Exported functions from the PostScript driver.
3  *
4  * [Ext]DeviceMode, DeviceCapabilities, AdvancedSetupDialog. 
5  *
6  * Will need ExtTextOut for winword6 (urgh!)
7  *
8  * Copyright 1998  Huw D M Davies
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2.1 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23  */
24
25 #include <string.h>
26 #include "psdrv.h"
27 #include "wine/debug.h"
28 #include "winuser.h"
29 #include "winspool.h"
30 #include "prsht.h"
31 #include "psdlg.h"
32
33 WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
34
35
36 /************************************************************************
37  *
38  *              PSDRV_MergeDevmodes
39  *
40  * Updates dm1 with some fields from dm2
41  *
42  */
43 void PSDRV_MergeDevmodes(PSDRV_DEVMODEA *dm1, PSDRV_DEVMODEA *dm2,
44                          PRINTERINFO *pi)
45 {
46     /* some sanity checks here on dm2 */
47
48     if(dm2->dmPublic.dmFields & DM_ORIENTATION)
49         dm1->dmPublic.u1.s1.dmOrientation = dm2->dmPublic.u1.s1.dmOrientation;
50
51     /* NB PaperWidth is always < PaperLength */
52
53     if(dm2->dmPublic.dmFields & DM_PAPERSIZE) {
54         PAGESIZE *page;
55
56         for(page = pi->ppd->PageSizes; page; page = page->next) {
57             if(page->WinPage == dm2->dmPublic.u1.s1.dmPaperSize)
58                 break;
59         }
60         if(page) {
61             dm1->dmPublic.u1.s1.dmPaperSize = dm2->dmPublic.u1.s1.dmPaperSize;
62             dm1->dmPublic.u1.s1.dmPaperWidth = page->PaperDimension->x * 
63                                                                 254.0 / 72.0;
64             dm1->dmPublic.u1.s1.dmPaperLength = page->PaperDimension->y *
65                                                                 254.0 / 72.0;
66             TRACE("Changing page to %s %d x %d\n", page->FullName,
67                   dm1->dmPublic.u1.s1.dmPaperWidth,
68                   dm1->dmPublic.u1.s1.dmPaperLength );
69         } else {
70             TRACE("Trying to change to unsupported pagesize %d\n",
71                       dm2->dmPublic.u1.s1.dmPaperSize);
72         }
73     }
74
75     if(dm2->dmPublic.dmFields & DM_PAPERLENGTH) {
76         dm1->dmPublic.u1.s1.dmPaperLength = dm2->dmPublic.u1.s1.dmPaperLength; 
77         TRACE("Changing PaperLength to %d\n",
78               dm2->dmPublic.u1.s1.dmPaperLength);
79         FIXME("Changing PaperLength.  Do we adjust PaperSize?\n");
80     }
81
82     if(dm2->dmPublic.dmFields & DM_PAPERWIDTH) {
83         dm1->dmPublic.u1.s1.dmPaperWidth = dm2->dmPublic.u1.s1.dmPaperWidth; 
84         TRACE("Changing PaperWidth to %d\n",
85               dm2->dmPublic.u1.s1.dmPaperWidth);
86         FIXME("Changing PaperWidth.  Do we adjust PaperSize?\n");
87     }
88
89     if(dm2->dmPublic.dmFields & DM_SCALE) {
90         dm1->dmPublic.dmScale = dm2->dmPublic.dmScale;
91         TRACE("Changing Scale to %d\n", dm2->dmPublic.dmScale);
92     }
93
94     if(dm2->dmPublic.dmFields & DM_COPIES) {
95         dm1->dmPublic.dmCopies = dm2->dmPublic.dmCopies;
96         TRACE("Changing Copies to %d\n", dm2->dmPublic.dmCopies);
97     }
98
99     if(dm2->dmPublic.dmFields & DM_DEFAULTSOURCE) {
100         INPUTSLOT *slot;
101         
102         for(slot = pi->ppd->InputSlots; slot; slot = slot->next) {
103             if(slot->WinBin == dm2->dmPublic.dmDefaultSource)
104                 break;
105         }
106         if(slot) {
107             dm1->dmPublic.dmDefaultSource = dm2->dmPublic.dmDefaultSource;
108             TRACE("Changing bin to '%s'\n", slot->FullName);
109         } else {
110           TRACE("Trying to change to unsupported bin %d\n",
111                 dm2->dmPublic.dmDefaultSource);
112         }
113     }
114
115    if (dm2->dmPublic.dmFields & DM_DEFAULTSOURCE )
116        dm1->dmPublic.dmDefaultSource = dm2->dmPublic.dmDefaultSource;
117    if (dm2->dmPublic.dmFields & DM_PRINTQUALITY )
118        dm1->dmPublic.dmPrintQuality = dm2->dmPublic.dmPrintQuality;
119    if (dm2->dmPublic.dmFields & DM_COLOR )
120        dm1->dmPublic.dmColor = dm2->dmPublic.dmColor;
121    if (dm2->dmPublic.dmFields & DM_DUPLEX )
122        dm1->dmPublic.dmDuplex = dm2->dmPublic.dmDuplex;
123    if (dm2->dmPublic.dmFields & DM_YRESOLUTION )
124        dm1->dmPublic.dmYResolution = dm2->dmPublic.dmYResolution;
125    if (dm2->dmPublic.dmFields & DM_TTOPTION )
126        dm1->dmPublic.dmTTOption = dm2->dmPublic.dmTTOption;
127    if (dm2->dmPublic.dmFields & DM_COLLATE )
128        dm1->dmPublic.dmCollate = dm2->dmPublic.dmCollate;
129    if (dm2->dmPublic.dmFields & DM_FORMNAME )
130        lstrcpynA(dm1->dmPublic.dmFormName, dm2->dmPublic.dmFormName, CCHFORMNAME);
131    if (dm2->dmPublic.dmFields & DM_BITSPERPEL )
132        dm1->dmPublic.dmBitsPerPel = dm2->dmPublic.dmBitsPerPel;
133    if (dm2->dmPublic.dmFields & DM_PELSWIDTH )
134        dm1->dmPublic.dmPelsWidth = dm2->dmPublic.dmPelsWidth;
135    if (dm2->dmPublic.dmFields & DM_PELSHEIGHT )
136        dm1->dmPublic.dmPelsHeight = dm2->dmPublic.dmPelsHeight;
137    if (dm2->dmPublic.dmFields & DM_DISPLAYFLAGS )
138        dm1->dmPublic.dmDisplayFlags = dm2->dmPublic.dmDisplayFlags;
139    if (dm2->dmPublic.dmFields & DM_DISPLAYFREQUENCY )
140        dm1->dmPublic.dmDisplayFrequency = dm2->dmPublic.dmDisplayFrequency;
141    if (dm2->dmPublic.dmFields & DM_POSITION )
142        dm1->dmPublic.u1.dmPosition = dm2->dmPublic.u1.dmPosition;
143    if (dm2->dmPublic.dmFields & DM_LOGPIXELS )
144        dm1->dmPublic.dmLogPixels = dm2->dmPublic.dmLogPixels;
145    if (dm2->dmPublic.dmFields & DM_ICMMETHOD )
146        dm1->dmPublic.dmICMMethod = dm2->dmPublic.dmICMMethod;
147    if (dm2->dmPublic.dmFields & DM_ICMINTENT )
148        dm1->dmPublic.dmICMIntent = dm2->dmPublic.dmICMIntent;
149    if (dm2->dmPublic.dmFields & DM_MEDIATYPE )
150        dm1->dmPublic.dmMediaType = dm2->dmPublic.dmMediaType;
151    if (dm2->dmPublic.dmFields & DM_DITHERTYPE )
152        dm1->dmPublic.dmDitherType = dm2->dmPublic.dmDitherType;
153    if (dm2->dmPublic.dmFields & DM_PANNINGWIDTH )
154        dm1->dmPublic.dmPanningWidth = dm2->dmPublic.dmPanningWidth;
155    if (dm2->dmPublic.dmFields & DM_PANNINGHEIGHT )
156        dm1->dmPublic.dmPanningHeight = dm2->dmPublic.dmPanningHeight;
157
158     return;
159 }
160
161
162 /**************************************************************
163  *      AdvancedSetupDialog     [WINEPS16.93]
164  *
165  */
166 WORD WINAPI PSDRV_AdvancedSetupDialog16(HWND16 hwnd, HANDLE16 hDriver,
167                                          LPDEVMODEA devin, LPDEVMODEA devout)
168 {
169
170   TRACE("hwnd = %04x, hDriver = %04x devin=%p devout=%p\n", hwnd,
171         hDriver, devin, devout);
172   return IDCANCEL;
173 }
174
175 /****************************************************************
176  *       PSDRV_PaperDlgProc
177  *
178  * Dialog proc for 'Paper' propsheet
179  */
180 BOOL WINAPI PSDRV_PaperDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
181                                lParam)
182 {
183   PSDRV_DLGINFO *di;
184   int i, Cursel = 0; 
185   PAGESIZE *ps;
186
187
188   switch(msg) {
189   case WM_INITDIALOG:
190     di = (PSDRV_DLGINFO*)((PROPSHEETPAGEA*)lParam)->lParam;
191     SetWindowLongA(hwnd, DWL_USER, (LONG)di);
192
193     for(ps = di->pi->ppd->PageSizes, i = 0; ps; ps = ps->next, i++) {
194       SendDlgItemMessageA(hwnd, IDD_PAPERS, LB_INSERTSTRING, i, 
195                           (LPARAM)ps->FullName);
196       if(di->pi->Devmode->dmPublic.u1.s1.dmPaperSize == ps->WinPage)
197         Cursel = i;
198     }
199     SendDlgItemMessageA(hwnd, IDD_PAPERS, LB_SETCURSEL, Cursel, 0);
200
201     CheckRadioButton(hwnd, IDD_ORIENT_PORTRAIT, IDD_ORIENT_LANDSCAPE,
202                      di->pi->Devmode->dmPublic.u1.s1.dmOrientation ==
203                      DMORIENT_PORTRAIT ? IDD_ORIENT_PORTRAIT :
204                      IDD_ORIENT_LANDSCAPE);
205     break;
206
207   case WM_COMMAND:
208     di = (PSDRV_DLGINFO *)GetWindowLongA(hwnd, DWL_USER);
209     switch(LOWORD(wParam)) {
210     case IDD_PAPERS:
211       if(HIWORD(wParam) == LBN_SELCHANGE) {
212         Cursel = SendDlgItemMessageA(hwnd, LOWORD(wParam), LB_GETCURSEL, 0, 0);
213         for(i = 0, ps = di->pi->ppd->PageSizes; i < Cursel; i++, ps = ps->next)
214           ;
215         TRACE("Setting pagesize to item %d Winpage = %d\n", Cursel,
216               ps->WinPage);
217         di->dlgdm->dmPublic.u1.s1.dmPaperSize = ps->WinPage;
218       }
219       break;
220     case IDD_ORIENT_PORTRAIT:
221     case IDD_ORIENT_LANDSCAPE:
222       TRACE("Setting orientation to %s\n", wParam == IDD_ORIENT_PORTRAIT ?
223             "portrait" : "landscape");
224       di->dlgdm->dmPublic.u1.s1.dmOrientation = wParam == IDD_ORIENT_PORTRAIT ?
225         DMORIENT_PORTRAIT : DMORIENT_LANDSCAPE;
226       break;
227     }
228     break;
229
230   case WM_NOTIFY:
231    {
232     NMHDR *nmhdr = (NMHDR *)lParam;
233     di = (PSDRV_DLGINFO *)GetWindowLongA(hwnd, DWL_USER);
234     switch(nmhdr->code) {
235     case PSN_APPLY:
236       memcpy(di->pi->Devmode, di->dlgdm, sizeof(PSDRV_DEVMODEA));
237       SetWindowLongA(hwnd, DWL_MSGRESULT, PSNRET_NOERROR);
238       return TRUE;
239       break;
240
241     default:
242       return FALSE;
243       break;
244     }
245     break;
246    }
247    
248   default:
249     return FALSE;
250   }
251   return TRUE;
252 }
253
254
255 static void (WINAPI *pInitCommonControls) (void);
256 static HPROPSHEETPAGE (WINAPI *pCreatePropertySheetPage) (LPCPROPSHEETPAGEW);
257 static int (WINAPI *pPropertySheet) (LPCPROPSHEETHEADERW);
258
259 /***************************************************************
260  *      ExtDeviceMode   [WINEPS16.90]
261  *
262  * Just returns default devmode at the moment
263  */
264 INT16 WINAPI PSDRV_ExtDeviceMode16(HWND16 hwnd, HANDLE16 hDriver,
265                                    LPDEVMODEA lpdmOutput, LPSTR lpszDevice,
266                                    LPSTR lpszPort, LPDEVMODEA lpdmInput,
267                                    LPSTR lpszProfile, WORD fwMode)
268 {
269   PRINTERINFO *pi = PSDRV_FindPrinterInfo(lpszDevice);
270   if(!pi) return -1;
271
272   TRACE("(hwnd=%04x, hDriver=%04x, devOut=%p, Device='%s', Port='%s', devIn=%p, Profile='%s', Mode=%04x)\n",
273 hwnd, hDriver, lpdmOutput, lpszDevice, lpszPort, lpdmInput, lpszProfile,
274 fwMode);
275
276   if(!fwMode)
277     return sizeof(DEVMODEA); /* Just copy dmPublic bit of PSDRV_DEVMODE */
278
279   if((fwMode & DM_MODIFY) && lpdmInput) {
280     TRACE("DM_MODIFY set. devIn->dmFields = %08lx\n", lpdmInput->dmFields);
281     PSDRV_MergeDevmodes(pi->Devmode, (PSDRV_DEVMODEA *)lpdmInput, pi);
282   }
283
284   if(fwMode & DM_PROMPT) {
285     HINSTANCE hinstComctl32, hinstWineps32 = LoadLibraryA("WINEPS");
286     HPROPSHEETPAGE hpsp[1];
287     PROPSHEETPAGEW psp;
288     PROPSHEETHEADERW psh;
289     PSDRV_DLGINFO *di;
290     PSDRV_DEVMODEA *dlgdm;
291     static const WCHAR PAPERW[] = {'P','A','P','E','R','\0'};
292     static const WCHAR SetupW[] = {'S','e','t','u','p','\0'};
293
294     hinstComctl32 = LoadLibraryA("comctl32.dll");
295     pInitCommonControls = (void*)GetProcAddress(hinstComctl32,
296                                                 "InitCommonControls");
297     pCreatePropertySheetPage = (void*)GetProcAddress(hinstComctl32,
298                                                     "CreatePropertySheetPageW");
299     pPropertySheet = (void*)GetProcAddress(hinstComctl32, "PropertySheetW"); 
300     memset(&psp,0,sizeof(psp));
301     dlgdm = HeapAlloc( PSDRV_Heap, 0, sizeof(*dlgdm) );
302     memcpy(dlgdm, pi->Devmode, sizeof(*dlgdm));
303     di = HeapAlloc( PSDRV_Heap, 0, sizeof(*di) );
304     di->pi = pi;
305     di->dlgdm = dlgdm;
306     psp.dwSize = sizeof(psp);
307     psp.hInstance = hinstWineps32;
308     psp.u.pszTemplate = PAPERW;
309     psp.u2.pszIcon = NULL;
310     psp.pfnDlgProc = PSDRV_PaperDlgProc;
311     psp.lParam = (LPARAM)di;
312     hpsp[0] = pCreatePropertySheetPage(&psp);
313
314     memset(&psh, 0, sizeof(psh));
315     psh.dwSize = sizeof(psh);
316     psh.pszCaption = SetupW;
317     psh.nPages = 1;
318     psh.hwndParent = hwnd;
319     psh.u3.phpage = hpsp;
320     
321     pPropertySheet(&psh);
322     
323   }
324   if(fwMode & DM_UPDATE)
325     FIXME("Mode DM_UPDATE.  Just do the same as DM_COPY\n");
326
327   if((fwMode & DM_COPY) || (fwMode & DM_UPDATE)) {
328     memcpy(lpdmOutput, pi->Devmode, sizeof(DEVMODEA));
329   }
330   return IDOK;
331 }
332
333 /**************************************************************
334  *
335  *       PSDRV_ExtDeviceMode
336  */
337 INT PSDRV_ExtDeviceMode(LPSTR lpszDriver, HWND hwnd, LPDEVMODEA lpdmOutput,
338                         LPSTR lpszDevice, LPSTR lpszPort, LPDEVMODEA lpdmInput,
339                         LPSTR lpszProfile, DWORD dwMode)
340 {
341     return PSDRV_ExtDeviceMode16(hwnd, 0, lpdmOutput, lpszDevice, lpszPort,
342                                  lpdmInput, lpszProfile, dwMode);
343 }
344
345 /***********************************************************************
346  *      DeviceCapabilities      [WINEPS16.91]
347  *
348  */
349 DWORD WINAPI PSDRV_DeviceCapabilities16(LPCSTR lpszDevice, LPCSTR lpszPort,
350                                         WORD fwCapability, LPSTR lpszOutput,
351                                         LPDEVMODEA lpDevMode)
352 {
353   PRINTERINFO *pi;
354   DEVMODEA *lpdm;
355   pi = PSDRV_FindPrinterInfo(lpszDevice);
356
357   TRACE("Cap=%d. Got PrinterInfo = %p\n", fwCapability, pi);
358
359
360   if (!pi) {
361           ERR("no printerinfo for %s, return 0!\n",lpszDevice);
362           return 0;
363   }
364
365
366   lpdm = lpDevMode ? lpDevMode : (DEVMODEA *)pi->Devmode;
367
368   switch(fwCapability) {
369
370   case DC_PAPERS:
371     {
372       PAGESIZE *ps;
373       WORD *wp = (WORD *)lpszOutput;
374       int i = 0;
375
376       for(ps = pi->ppd->PageSizes; ps; ps = ps->next, i++)
377         if(lpszOutput != NULL)
378           *wp++ = ps->WinPage;
379       return i;
380     }
381
382   case DC_PAPERSIZE:
383     {
384       PAGESIZE *ps;
385       POINT16 *pt = (POINT16 *)lpszOutput;
386       int i = 0;
387
388       for(ps = pi->ppd->PageSizes; ps; ps = ps->next, i++)
389         if(lpszOutput != NULL) {
390           pt->x = ps->PaperDimension->x * 254.0 / 72.0;
391           pt->y = ps->PaperDimension->y * 254.0 / 72.0;
392           pt++;
393         }
394       return i;
395     }
396
397   case DC_PAPERNAMES:
398     {
399       PAGESIZE *ps;
400       char *cp = lpszOutput;
401       int i = 0;
402
403       for(ps = pi->ppd->PageSizes; ps; ps = ps->next, i++)
404         if(lpszOutput != NULL) {
405           lstrcpynA(cp, ps->FullName, 64);
406           cp += 64;
407         }
408       return i;
409     }
410
411   case DC_ORIENTATION:
412     return pi->ppd->LandscapeOrientation ? pi->ppd->LandscapeOrientation : 90;
413
414   case DC_BINS:
415     {
416       INPUTSLOT *slot;
417       WORD *wp = (WORD *)lpszOutput;
418       int i = 0;
419
420       /* We explicitly list DMBIN_AUTO first; actually while win9x does this
421          win2000 lists DMBIN_FORMSOURCE instead. */
422       i++;
423       if(lpszOutput != NULL)
424         *wp++ = DMBIN_AUTO;
425
426       for(slot = pi->ppd->InputSlots; slot; slot = slot->next, i++)
427         if(lpszOutput != NULL)
428           *wp++ = slot->WinBin;
429       return i;
430     }
431
432   case DC_BINNAMES:
433     {
434       INPUTSLOT *slot;
435       char *cp = lpszOutput;
436       int i = 0;
437       
438       /* Add an entry corresponding to DMBIN_AUTO, see DC_BINS */
439       i++;
440       if(lpszOutput != NULL) {
441         strcpy(cp, "Automatically Select");
442         cp += 24;
443       }
444
445       for(slot = pi->ppd->InputSlots; slot; slot = slot->next, i++)
446         if(lpszOutput != NULL) {
447           lstrcpynA(cp, slot->FullName, 24);
448           cp += 24;
449         }
450       return i;
451     }
452
453   case DC_BINADJUST:
454     FIXME("DC_BINADJUST: stub.\n");
455     return DCBA_FACEUPNONE;
456
457   case DC_ENUMRESOLUTIONS:
458     {
459       LONG *lp = (LONG*)lpszOutput;
460
461       if(lpszOutput != NULL) {
462         lp[0] = (LONG)pi->ppd->DefaultResolution;
463         lp[1] = (LONG)pi->ppd->DefaultResolution;
464       }
465       return 1;
466     }
467
468   case DC_COPIES:
469     FIXME("DC_COPIES: returning %d.  Is this correct?\n", lpdm->dmCopies);
470     return lpdm->dmCopies;
471
472   case DC_DRIVER:
473     return lpdm->dmDriverVersion;
474
475   case DC_DATATYPE_PRODUCED:
476     FIXME("DATA_TYPE_PRODUCED: stub.\n");
477     return -1; /* simulate that the driver supports 'RAW' */
478
479   case DC_DUPLEX:
480     FIXME("DC_DUPLEX: returning %d.  Is this correct?\n", lpdm->dmDuplex);
481     return lpdm->dmDuplex;
482
483   case DC_EMF_COMPLIANT:
484     FIXME("DC_EMF_COMPLIANT: stub.\n");
485     return -1; /* simulate that the driver do not support EMF */
486
487   case DC_EXTRA:
488     return lpdm->dmDriverExtra;
489
490   case DC_FIELDS:
491     return lpdm->dmFields;
492
493   case DC_FILEDEPENDENCIES:
494     FIXME("DC_FILEDEPENDENCIES: stub.\n");
495     return 0;
496
497   case DC_MAXEXTENT:
498     {
499       PAGESIZE *ps;
500       int i;
501       POINT ptMax;
502       ptMax.x = ptMax.y = 0;
503
504       if(lpszOutput == NULL)
505         return -1;
506  
507       i = 0;
508       for(ps = pi->ppd->PageSizes; ps; ps = ps->next, i++) {
509         if(ps->PaperDimension->x > ptMax.x)
510           ptMax.x = ps->PaperDimension->x;
511         if(ps->PaperDimension->y > ptMax.y)
512           ptMax.y = ps->PaperDimension->y;
513       }
514       *((POINT*)lpszOutput) = ptMax;
515       return 1;
516     }
517
518   case DC_MINEXTENT:
519     {
520       PAGESIZE *ps;
521       int i;
522       POINT ptMax;
523       ptMax.x = ptMax.y = 0;
524
525       if(lpszOutput == NULL)
526         return -1;
527  
528       i = 0;
529       for(ps = pi->ppd->PageSizes; ps; ps = ps->next, i++) {
530         if(ps->PaperDimension->x > ptMax.x)
531           ptMax.x = ps->PaperDimension->x;
532         if(ps->PaperDimension->y > ptMax.y)
533           ptMax.y = ps->PaperDimension->y;
534       }
535       *((POINT*)lpszOutput) = ptMax;
536       return 1;
537     }
538
539   case DC_SIZE:
540     return lpdm->dmSize;
541
542   case DC_TRUETYPE:
543     FIXME("DC_TRUETYPE: stub\n");
544     return DCTT_SUBDEV;
545
546   case DC_VERSION:
547     return lpdm->dmSpecVersion;
548
549   default:
550     FIXME("Unsupported capability %d\n", fwCapability);
551   }
552   return -1;
553 }
554
555 /**************************************************************
556  *
557  *     PSDRV_DeviceCapabilities
558  */
559 DWORD PSDRV_DeviceCapabilities(LPSTR lpszDriver, LPCSTR lpszDevice,
560                                LPCSTR lpszPort, WORD fwCapability,
561                                LPSTR lpszOutput, LPDEVMODEA lpdm)
562 {
563     return PSDRV_DeviceCapabilities16(lpszDevice, lpszPort, fwCapability,
564                                       lpszOutput, lpdm);
565 }
566
567 /***************************************************************
568  *      DeviceMode      [WINEPS16.13]
569  *
570  */
571 void WINAPI PSDRV_DeviceMode16(HWND16 hwnd, HANDLE16 hDriver,
572 LPSTR lpszDevice, LPSTR lpszPort)
573 {
574     PSDRV_ExtDeviceMode16( hwnd, hDriver, NULL, lpszDevice, lpszPort, NULL, 
575                            NULL, DM_PROMPT );
576     return;
577 }
578
579 #if 0
580 typedef struct {
581   DWORD nPages;
582   DWORD Unknown;
583   HPROPSHEETPAGE hPages[10];
584 } EDMPS;
585
586 INT PSDRV_ExtDeviceModePropSheet(HWND hwnd, LPSTR lpszDevice, LPSTR lpszPort,
587                                  LPVOID pPropSheet)
588 {
589     EDMPS *ps = pPropSheet;
590     PROPSHEETPAGE psp;
591
592     psp->dwSize = sizeof(psp);
593     psp->hInstance = 0x1234;
594     
595     ps->nPages = 1;
596     
597 }
598
599 #endif