2 * Exported functions from the PostScript driver.
4 * [Ext]DeviceMode, DeviceCapabilities, AdvancedSetupDialog.
6 * Will need ExtTextOut for winword6 (urgh!)
8 * Copyright 1998 Huw D M Davies
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.
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.
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
25 #define NONAMELESSUNION
26 #define NONAMELESSSTRUCT
32 #include "wine/debug.h"
41 WINE_DEFAULT_DEBUG_CHANNEL(psdrv
);
44 /************************************************************************
48 * Updates dm1 with some fields from dm2
51 void PSDRV_MergeDevmodes(PSDRV_DEVMODEA
*dm1
, PSDRV_DEVMODEA
*dm2
,
54 /* some sanity checks here on dm2 */
56 if(dm2
->dmPublic
.dmFields
& DM_ORIENTATION
) {
57 dm1
->dmPublic
.u1
.s1
.dmOrientation
= dm2
->dmPublic
.u1
.s1
.dmOrientation
;
58 TRACE("Changing orientation to %d (%s)\n",
59 dm1
->dmPublic
.u1
.s1
.dmOrientation
,
60 dm1
->dmPublic
.u1
.s1
.dmOrientation
== DMORIENT_PORTRAIT
?
62 (dm1
->dmPublic
.u1
.s1
.dmOrientation
== DMORIENT_LANDSCAPE
?
63 "Landscape" : "unknown"));
66 /* NB PaperWidth is always < PaperLength */
67 if(dm2
->dmPublic
.dmFields
& DM_PAPERSIZE
) {
70 for(page
= pi
->ppd
->PageSizes
; page
; page
= page
->next
) {
71 if(page
->WinPage
== dm2
->dmPublic
.u1
.s1
.dmPaperSize
)
75 dm1
->dmPublic
.u1
.s1
.dmPaperSize
= dm2
->dmPublic
.u1
.s1
.dmPaperSize
;
76 dm1
->dmPublic
.u1
.s1
.dmPaperWidth
= page
->PaperDimension
->x
*
78 dm1
->dmPublic
.u1
.s1
.dmPaperLength
= page
->PaperDimension
->y
*
80 dm1
->dmPublic
.dmFields
&= ~(DM_PAPERLENGTH
| DM_PAPERWIDTH
);
81 dm1
->dmPublic
.dmFields
|= DM_PAPERSIZE
;
82 TRACE("Changing page to %s %d x %d\n", page
->FullName
,
83 dm1
->dmPublic
.u1
.s1
.dmPaperWidth
,
84 dm1
->dmPublic
.u1
.s1
.dmPaperLength
);
86 TRACE("Trying to change to unsupported pagesize %d\n",
87 dm2
->dmPublic
.u1
.s1
.dmPaperSize
);
89 } else if((dm2
->dmPublic
.dmFields
& DM_PAPERLENGTH
) &&
90 (dm2
->dmPublic
.dmFields
& DM_PAPERWIDTH
)) {
91 dm1
->dmPublic
.u1
.s1
.dmPaperLength
= dm2
->dmPublic
.u1
.s1
.dmPaperLength
;
92 dm1
->dmPublic
.u1
.s1
.dmPaperWidth
= dm2
->dmPublic
.u1
.s1
.dmPaperWidth
;
93 TRACE("Changing PaperLength|Width to %dx%d\n",
94 dm2
->dmPublic
.u1
.s1
.dmPaperLength
,
95 dm2
->dmPublic
.u1
.s1
.dmPaperWidth
);
96 dm1
->dmPublic
.dmFields
&= ~DM_PAPERSIZE
;
97 dm1
->dmPublic
.dmFields
|= (DM_PAPERLENGTH
| DM_PAPERWIDTH
);
98 } else if(dm2
->dmPublic
.dmFields
& (DM_PAPERLENGTH
| DM_PAPERWIDTH
)) {
99 /* You might think that this would be allowed if dm1 is in custom size
100 mode, but apparently Windows reverts to standard paper mode even in
102 FIXME("Trying to change only paperlength or paperwidth\n");
103 dm1
->dmPublic
.dmFields
&= ~(DM_PAPERLENGTH
| DM_PAPERWIDTH
);
104 dm1
->dmPublic
.dmFields
|= DM_PAPERSIZE
;
107 if(dm2
->dmPublic
.dmFields
& DM_SCALE
) {
108 dm1
->dmPublic
.dmScale
= dm2
->dmPublic
.dmScale
;
109 TRACE("Changing Scale to %d\n", dm2
->dmPublic
.dmScale
);
112 if(dm2
->dmPublic
.dmFields
& DM_COPIES
) {
113 dm1
->dmPublic
.dmCopies
= dm2
->dmPublic
.dmCopies
;
114 TRACE("Changing Copies to %d\n", dm2
->dmPublic
.dmCopies
);
117 if(dm2
->dmPublic
.dmFields
& DM_DEFAULTSOURCE
) {
120 for(slot
= pi
->ppd
->InputSlots
; slot
; slot
= slot
->next
) {
121 if(slot
->WinBin
== dm2
->dmPublic
.dmDefaultSource
)
125 dm1
->dmPublic
.dmDefaultSource
= dm2
->dmPublic
.dmDefaultSource
;
126 TRACE("Changing bin to '%s'\n", slot
->FullName
);
128 TRACE("Trying to change to unsupported bin %d\n",
129 dm2
->dmPublic
.dmDefaultSource
);
133 if (dm2
->dmPublic
.dmFields
& DM_DEFAULTSOURCE
)
134 dm1
->dmPublic
.dmDefaultSource
= dm2
->dmPublic
.dmDefaultSource
;
135 if (dm2
->dmPublic
.dmFields
& DM_PRINTQUALITY
)
136 dm1
->dmPublic
.dmPrintQuality
= dm2
->dmPublic
.dmPrintQuality
;
137 if (dm2
->dmPublic
.dmFields
& DM_COLOR
)
138 dm1
->dmPublic
.dmColor
= dm2
->dmPublic
.dmColor
;
139 if (dm2
->dmPublic
.dmFields
& DM_DUPLEX
)
140 dm1
->dmPublic
.dmDuplex
= dm2
->dmPublic
.dmDuplex
;
141 if (dm2
->dmPublic
.dmFields
& DM_YRESOLUTION
)
142 dm1
->dmPublic
.dmYResolution
= dm2
->dmPublic
.dmYResolution
;
143 if (dm2
->dmPublic
.dmFields
& DM_TTOPTION
)
144 dm1
->dmPublic
.dmTTOption
= dm2
->dmPublic
.dmTTOption
;
145 if (dm2
->dmPublic
.dmFields
& DM_COLLATE
)
146 dm1
->dmPublic
.dmCollate
= dm2
->dmPublic
.dmCollate
;
147 if (dm2
->dmPublic
.dmFields
& DM_FORMNAME
)
148 lstrcpynA(dm1
->dmPublic
.dmFormName
, dm2
->dmPublic
.dmFormName
, CCHFORMNAME
);
149 if (dm2
->dmPublic
.dmFields
& DM_BITSPERPEL
)
150 dm1
->dmPublic
.dmBitsPerPel
= dm2
->dmPublic
.dmBitsPerPel
;
151 if (dm2
->dmPublic
.dmFields
& DM_PELSWIDTH
)
152 dm1
->dmPublic
.dmPelsWidth
= dm2
->dmPublic
.dmPelsWidth
;
153 if (dm2
->dmPublic
.dmFields
& DM_PELSHEIGHT
)
154 dm1
->dmPublic
.dmPelsHeight
= dm2
->dmPublic
.dmPelsHeight
;
155 if (dm2
->dmPublic
.dmFields
& DM_DISPLAYFLAGS
)
156 dm1
->dmPublic
.dmDisplayFlags
= dm2
->dmPublic
.dmDisplayFlags
;
157 if (dm2
->dmPublic
.dmFields
& DM_DISPLAYFREQUENCY
)
158 dm1
->dmPublic
.dmDisplayFrequency
= dm2
->dmPublic
.dmDisplayFrequency
;
159 if (dm2
->dmPublic
.dmFields
& DM_POSITION
)
160 dm1
->dmPublic
.u1
.dmPosition
= dm2
->dmPublic
.u1
.dmPosition
;
161 if (dm2
->dmPublic
.dmFields
& DM_LOGPIXELS
)
162 dm1
->dmPublic
.dmLogPixels
= dm2
->dmPublic
.dmLogPixels
;
163 if (dm2
->dmPublic
.dmFields
& DM_ICMMETHOD
)
164 dm1
->dmPublic
.dmICMMethod
= dm2
->dmPublic
.dmICMMethod
;
165 if (dm2
->dmPublic
.dmFields
& DM_ICMINTENT
)
166 dm1
->dmPublic
.dmICMIntent
= dm2
->dmPublic
.dmICMIntent
;
167 if (dm2
->dmPublic
.dmFields
& DM_MEDIATYPE
)
168 dm1
->dmPublic
.dmMediaType
= dm2
->dmPublic
.dmMediaType
;
169 if (dm2
->dmPublic
.dmFields
& DM_DITHERTYPE
)
170 dm1
->dmPublic
.dmDitherType
= dm2
->dmPublic
.dmDitherType
;
171 if (dm2
->dmPublic
.dmFields
& DM_PANNINGWIDTH
)
172 dm1
->dmPublic
.dmPanningWidth
= dm2
->dmPublic
.dmPanningWidth
;
173 if (dm2
->dmPublic
.dmFields
& DM_PANNINGHEIGHT
)
174 dm1
->dmPublic
.dmPanningHeight
= dm2
->dmPublic
.dmPanningHeight
;
180 /**************************************************************
181 * AdvancedSetupDialog [WINEPS16.93]
184 WORD WINAPI
PSDRV_AdvancedSetupDialog16(HWND16 hwnd
, HANDLE16 hDriver
,
185 LPDEVMODEA devin
, LPDEVMODEA devout
)
188 TRACE("hwnd = %04x, hDriver = %04x devin=%p devout=%p\n", hwnd
,
189 hDriver
, devin
, devout
);
193 /****************************************************************
196 * Dialog proc for 'Paper' propsheet
198 INT_PTR CALLBACK
PSDRV_PaperDlgProc(HWND hwnd
, UINT msg
, WPARAM wParam
, LPARAM
208 di
= (PSDRV_DLGINFO
*)((PROPSHEETPAGEA
*)lParam
)->lParam
;
209 SetWindowLongA(hwnd
, DWL_USER
, (LONG
)di
);
211 for(ps
= di
->pi
->ppd
->PageSizes
, i
= 0; ps
; ps
= ps
->next
, i
++) {
212 SendDlgItemMessageA(hwnd
, IDD_PAPERS
, LB_INSERTSTRING
, i
,
213 (LPARAM
)ps
->FullName
);
214 if(di
->pi
->Devmode
->dmPublic
.u1
.s1
.dmPaperSize
== ps
->WinPage
)
217 SendDlgItemMessageA(hwnd
, IDD_PAPERS
, LB_SETCURSEL
, Cursel
, 0);
219 CheckRadioButton(hwnd
, IDD_ORIENT_PORTRAIT
, IDD_ORIENT_LANDSCAPE
,
220 di
->pi
->Devmode
->dmPublic
.u1
.s1
.dmOrientation
==
221 DMORIENT_PORTRAIT
? IDD_ORIENT_PORTRAIT
:
222 IDD_ORIENT_LANDSCAPE
);
226 di
= (PSDRV_DLGINFO
*)GetWindowLongA(hwnd
, DWL_USER
);
227 switch(LOWORD(wParam
)) {
229 if(HIWORD(wParam
) == LBN_SELCHANGE
) {
230 Cursel
= SendDlgItemMessageA(hwnd
, LOWORD(wParam
), LB_GETCURSEL
, 0, 0);
231 for(i
= 0, ps
= di
->pi
->ppd
->PageSizes
; i
< Cursel
; i
++, ps
= ps
->next
)
233 TRACE("Setting pagesize to item %d Winpage = %d\n", Cursel
,
235 di
->dlgdm
->dmPublic
.u1
.s1
.dmPaperSize
= ps
->WinPage
;
238 case IDD_ORIENT_PORTRAIT
:
239 case IDD_ORIENT_LANDSCAPE
:
240 TRACE("Setting orientation to %s\n", wParam
== IDD_ORIENT_PORTRAIT
?
241 "portrait" : "landscape");
242 di
->dlgdm
->dmPublic
.u1
.s1
.dmOrientation
= wParam
== IDD_ORIENT_PORTRAIT
?
243 DMORIENT_PORTRAIT
: DMORIENT_LANDSCAPE
;
250 NMHDR
*nmhdr
= (NMHDR
*)lParam
;
251 di
= (PSDRV_DLGINFO
*)GetWindowLongA(hwnd
, DWL_USER
);
252 switch(nmhdr
->code
) {
254 memcpy(di
->pi
->Devmode
, di
->dlgdm
, sizeof(PSDRV_DEVMODEA
));
255 SetWindowLongA(hwnd
, DWL_MSGRESULT
, PSNRET_NOERROR
);
273 static void (WINAPI
*pInitCommonControls
) (void);
274 static HPROPSHEETPAGE (WINAPI
*pCreatePropertySheetPage
) (LPCPROPSHEETPAGEW
);
275 static int (WINAPI
*pPropertySheet
) (LPCPROPSHEETHEADERW
);
278 /******************************************************************
279 * PSDRV_ExtDeviceMode
281 * Retrieves or modifies device-initialization information for the PostScript
282 * driver, or displays a driver-supplied dialog box for configuring the driver.
285 * lpszDriver -- Driver name
286 * hwnd -- Parent window for the dialog box
287 * lpdmOutput -- Address of a DEVMODE structure for writing initialization information
288 * lpszDevice -- Device name
289 * lpszPort -- Port name
290 * lpdmInput -- Address of a DEVMODE structure for reading initialization information
291 * lpProfile -- Name of initialization file, defaults to WIN.INI if NULL
292 * wMode -- Operation to perform. Can be a combination if > 0.
293 * (0) -- Returns number of bytes required by DEVMODE structure
294 * DM_UPDATE (1) -- Write current settings to environment and initialization file
295 * DM_COPY (2) -- Write current settings to lpdmOutput
296 * DM_PROMPT (4) -- Presents the driver's modal dialog box (USER.240)
297 * DM_MODIFY (8) -- Changes current settings according to lpdmInput before any other operation
300 * Returns size of DEVMODE structure if wMode is 0. Otherwise, IDOK is returned for success
301 * for both dialog and non-dialog operations. IDCANCEL is returned if the dialog box was cancelled.
302 * A return value less than zero is returned if a non-dialog operation fails.
306 * Just returns default devmode at the moment. No use of initialization file.
308 INT
PSDRV_ExtDeviceMode(LPSTR lpszDriver
, HWND hwnd
, LPDEVMODEA lpdmOutput
,
309 LPSTR lpszDevice
, LPSTR lpszPort
, LPDEVMODEA lpdmInput
,
310 LPSTR lpszProfile
, DWORD dwMode
)
312 PRINTERINFO
*pi
= PSDRV_FindPrinterInfo(lpszDevice
);
315 TRACE("(Driver=%s, hwnd=%p, devOut=%p, Device='%s', Port='%s', devIn=%p, Profile='%s', Mode=%04lx)\n",
316 lpszDriver
, hwnd
, lpdmOutput
, lpszDevice
, lpszPort
, lpdmInput
, lpszProfile
, dwMode
);
318 /* If dwMode == 0, return size of DEVMODE structure */
320 return pi
->Devmode
->dmPublic
.dmSize
+ pi
->Devmode
->dmPublic
.dmDriverExtra
;
322 /* If DM_MODIFY is set, change settings in accordance with lpdmInput */
323 if((dwMode
& DM_MODIFY
) && lpdmInput
) {
324 TRACE("DM_MODIFY set. devIn->dmFields = %08lx\n", lpdmInput
->dmFields
);
325 PSDRV_MergeDevmodes(pi
->Devmode
, (PSDRV_DEVMODEA
*)lpdmInput
, pi
);
328 /* If DM_PROMPT is set, present modal dialog box */
329 if(dwMode
& DM_PROMPT
) {
330 HINSTANCE hinstComctl32
, hinstWineps32
= LoadLibraryA("WINEPS");
331 HPROPSHEETPAGE hpsp
[1];
333 PROPSHEETHEADERW psh
;
335 PSDRV_DEVMODEA
*dlgdm
;
336 static const WCHAR PAPERW
[] = {'P','A','P','E','R','\0'};
337 static const WCHAR SetupW
[] = {'S','e','t','u','p','\0'};
339 hinstComctl32
= LoadLibraryA("comctl32.dll");
340 pInitCommonControls
= (void*)GetProcAddress(hinstComctl32
,
341 "InitCommonControls");
342 pCreatePropertySheetPage
= (void*)GetProcAddress(hinstComctl32
,
343 "CreatePropertySheetPageW");
344 pPropertySheet
= (void*)GetProcAddress(hinstComctl32
, "PropertySheetW");
345 memset(&psp
,0,sizeof(psp
));
346 dlgdm
= HeapAlloc( PSDRV_Heap
, 0, sizeof(*dlgdm
) );
347 memcpy(dlgdm
, pi
->Devmode
, sizeof(*dlgdm
));
348 di
= HeapAlloc( PSDRV_Heap
, 0, sizeof(*di
) );
351 psp
.dwSize
= sizeof(psp
);
352 psp
.hInstance
= hinstWineps32
;
353 psp
.u
.pszTemplate
= PAPERW
;
354 psp
.u2
.pszIcon
= NULL
;
355 psp
.pfnDlgProc
= PSDRV_PaperDlgProc
;
356 psp
.lParam
= (LPARAM
)di
;
357 hpsp
[0] = pCreatePropertySheetPage(&psp
);
359 memset(&psh
, 0, sizeof(psh
));
360 psh
.dwSize
= sizeof(psh
);
361 psh
.pszCaption
= SetupW
;
363 psh
.hwndParent
= HWND_32(hwnd
);
364 psh
.u3
.phpage
= hpsp
;
366 pPropertySheet(&psh
);
370 /* If DM_UPDATE is set, should write settings to environment and initialization file */
371 if(dwMode
& DM_UPDATE
)
372 FIXME("Mode DM_UPDATE. Just do the same as DM_COPY\n");
374 /* If DM_COPY is set, should write settings to lpdmOutput */
375 if((dwMode
& DM_COPY
) || (dwMode
& DM_UPDATE
)) {
377 memcpy(lpdmOutput
, pi
->Devmode
, pi
->Devmode
->dmPublic
.dmSize
+ pi
->Devmode
->dmPublic
.dmDriverExtra
);
379 FIXME("lpdmOutput is NULL what should we do??\n");
383 /***************************************************************
384 * ExtDeviceMode [WINEPS16.90]
388 INT16 WINAPI
PSDRV_ExtDeviceMode16(HWND16 hwnd
, HANDLE16 hDriver
,
389 LPDEVMODEA lpdmOutput
, LPSTR lpszDevice
,
390 LPSTR lpszPort
, LPDEVMODEA lpdmInput
,
391 LPSTR lpszProfile
, WORD fwMode
)
394 return PSDRV_ExtDeviceMode(NULL
, HWND_32(hwnd
), lpdmOutput
, lpszDevice
,
395 lpszPort
, lpdmInput
, lpszProfile
, (DWORD
) fwMode
);
398 /***********************************************************************
399 * PSDRV_DeviceCapabilities
401 * Retrieves the capabilities of a printer device driver.
404 * lpszDriver -- printer driver name
405 * lpszDevice -- printer name
406 * lpszPort -- port name
407 * fwCapability -- device capability
408 * lpszOutput -- output buffer
409 * lpDevMode -- device data buffer
412 * Result depends on the setting of fwCapability. -1 indicates failure.
414 DWORD
PSDRV_DeviceCapabilities(LPSTR lpszDriver
, LPCSTR lpszDevice
, LPCSTR lpszPort
,
415 WORD fwCapability
, LPSTR lpszOutput
,
416 LPDEVMODEA lpDevMode
)
420 pi
= PSDRV_FindPrinterInfo(lpszDevice
);
422 TRACE("Cap=%d. Got PrinterInfo = %p\n", fwCapability
, pi
);
426 ERR("no printerinfo for %s, return 0!\n",lpszDevice
);
431 lpdm
= lpDevMode
? lpDevMode
: (DEVMODEA
*)pi
->Devmode
;
433 switch(fwCapability
) {
438 WORD
*wp
= (WORD
*)lpszOutput
;
441 for(ps
= pi
->ppd
->PageSizes
; ps
; ps
= ps
->next
, i
++)
442 if(lpszOutput
!= NULL
)
450 POINT16
*pt
= (POINT16
*)lpszOutput
;
453 for(ps
= pi
->ppd
->PageSizes
; ps
; ps
= ps
->next
, i
++)
454 if(lpszOutput
!= NULL
) {
455 pt
->x
= ps
->PaperDimension
->x
* 254.0 / 72.0;
456 pt
->y
= ps
->PaperDimension
->y
* 254.0 / 72.0;
465 char *cp
= lpszOutput
;
468 for(ps
= pi
->ppd
->PageSizes
; ps
; ps
= ps
->next
, i
++)
469 if(lpszOutput
!= NULL
) {
470 lstrcpynA(cp
, ps
->FullName
, 64);
477 return pi
->ppd
->LandscapeOrientation
? pi
->ppd
->LandscapeOrientation
: 90;
482 WORD
*wp
= (WORD
*)lpszOutput
;
485 /* We explicitly list DMBIN_AUTO first; actually while win9x does this
486 win2000 lists DMBIN_FORMSOURCE instead. */
488 if(lpszOutput
!= NULL
)
491 for(slot
= pi
->ppd
->InputSlots
; slot
; slot
= slot
->next
, i
++)
492 if(lpszOutput
!= NULL
)
493 *wp
++ = slot
->WinBin
;
500 char *cp
= lpszOutput
;
503 /* Add an entry corresponding to DMBIN_AUTO, see DC_BINS */
505 if(lpszOutput
!= NULL
) {
506 strcpy(cp
, "Automatically Select");
510 for(slot
= pi
->ppd
->InputSlots
; slot
; slot
= slot
->next
, i
++)
511 if(lpszOutput
!= NULL
) {
512 lstrcpynA(cp
, slot
->FullName
, 24);
519 FIXME("DC_BINADJUST: stub.\n");
520 return DCBA_FACEUPNONE
;
522 case DC_ENUMRESOLUTIONS
:
524 LONG
*lp
= (LONG
*)lpszOutput
;
526 if(lpszOutput
!= NULL
) {
527 lp
[0] = (LONG
)pi
->ppd
->DefaultResolution
;
528 lp
[1] = (LONG
)pi
->ppd
->DefaultResolution
;
534 FIXME("DC_COPIES: returning %d. Is this correct?\n", lpdm
->dmCopies
);
535 return lpdm
->dmCopies
;
538 return lpdm
->dmDriverVersion
;
540 case DC_DATATYPE_PRODUCED
:
541 FIXME("DATA_TYPE_PRODUCED: stub.\n");
542 return -1; /* simulate that the driver supports 'RAW' */
545 FIXME("DC_DUPLEX: returning %d. Is this correct?\n", lpdm
->dmDuplex
);
546 return lpdm
->dmDuplex
;
548 case DC_EMF_COMPLIANT
:
549 FIXME("DC_EMF_COMPLIANT: stub.\n");
550 return -1; /* simulate that the driver do not support EMF */
553 return lpdm
->dmDriverExtra
;
556 return lpdm
->dmFields
;
558 case DC_FILEDEPENDENCIES
:
559 FIXME("DC_FILEDEPENDENCIES: stub.\n");
567 ptMax
.x
= ptMax
.y
= 0;
569 if(lpszOutput
== NULL
)
573 for(ps
= pi
->ppd
->PageSizes
; ps
; ps
= ps
->next
, i
++) {
574 if(ps
->PaperDimension
->x
> ptMax
.x
)
575 ptMax
.x
= ps
->PaperDimension
->x
;
576 if(ps
->PaperDimension
->y
> ptMax
.y
)
577 ptMax
.y
= ps
->PaperDimension
->y
;
579 *((POINT
*)lpszOutput
) = ptMax
;
588 ptMax
.x
= ptMax
.y
= 0;
590 if(lpszOutput
== NULL
)
594 for(ps
= pi
->ppd
->PageSizes
; ps
; ps
= ps
->next
, i
++) {
595 if(ps
->PaperDimension
->x
> ptMax
.x
)
596 ptMax
.x
= ps
->PaperDimension
->x
;
597 if(ps
->PaperDimension
->y
> ptMax
.y
)
598 ptMax
.y
= ps
->PaperDimension
->y
;
600 *((POINT
*)lpszOutput
) = ptMax
;
608 FIXME("DC_TRUETYPE: stub\n");
612 return lpdm
->dmSpecVersion
;
614 /* Printer supports collating - 1 if yes, 0 if no. */
616 return ((lpdm
->dmFields
& DM_COLLATE
) ? 1 : 0); /* Collation is supported if DM_COLLATE is set */
618 /* Printer supports colour printing - 1 if yes, 0 if no (Win2k/XP only) */
620 return ((lpdm
->dmFields
& DM_COLOR
) ? 1 : 0); /* Colour is supported if DM_COLOR is set */
622 /* Identification number of the printer manufacturer for use with ICM (Win9x only) */
623 case DC_MANUFACTURER
:
624 FIXME("DC_MANUFACTURER: stub\n");
627 /* Identification number of the printer model for use with ICM (Win9x only) */
629 FIXME("DC_MODEL: stub\n");
632 /* Nonzero if the printer supports stapling, zero otherwise (Win2k/XP only) */
633 case DC_STAPLE
: /* WINVER >= 0x0500 */
634 FIXME("DC_STAPLE: stub\n");
637 /* Returns an array of 64-character string buffers containing the names of the paper forms
638 * available for use, unless pOutput is NULL. The return value is the number of paper forms.
641 case DC_MEDIAREADY
: /* WINVER >= 0x0500 */
642 FIXME("DC_MEDIAREADY: stub\n");
645 /* Returns an array of 64-character string buffers containing the names of the supported
646 * media types, unless pOutput is NULL. The return value is the number of supported.
647 * media types (XP only)
649 case DC_MEDIATYPENAMES
: /* WINVER >= 0x0501 */
650 FIXME("DC_MEDIATYPENAMES: stub\n");
653 /* Returns an array of DWORD values which represent the supported media types, unless
654 * pOutput is NULL. The return value is the number of supported media types. (XP only)
656 case DC_MEDIATYPES
: /* WINVER >= 0x0501 */
657 FIXME("DC_MEDIATYPES: stub\n");
660 /* Returns an array of DWORD values, each representing a supported number of document
661 * pages per printed page, unless pOutput is NULL. The return value is the number of
662 * array entries. (Win2k/XP only)
665 FIXME("DC_NUP: stub\n");
668 /* Returns an array of 32-character string buffers containing a list of printer description
669 * languages supported by the printer, unless pOutput is NULL. The return value is
670 * number of array entries. (Win2k/XP only)
673 case DC_PERSONALITY
: /* WINVER >= 0x0500 */
674 FIXME("DC_PERSONALITY: stub\n");
677 /* Returns the amount of printer memory in kilobytes. (Win2k/XP only) */
678 case DC_PRINTERMEM
: /* WINVER >= 0x0500 */
679 FIXME("DC_PRINTERMEM: stub\n");
682 /* Returns the printer's print rate in PRINTRATEUNIT units. (Win2k/XP only) */
683 case DC_PRINTRATE
: /* WINVER >= 0x0500 */
684 FIXME("DC_PRINTRATE: stub\n");
687 /* Returns the printer's print rate in pages per minute. (Win2k/XP only) */
688 case DC_PRINTRATEPPM
: /* WINVER >= 0x0500 */
689 FIXME("DC_PRINTRATEPPM: stub\n");
692 /* Returns the printer rate unit used for DC_PRINTRATE, which is one of
693 * PRINTRATEUNIT_{CPS,IPM,LPM,PPM} (Win2k/XP only)
695 case DC_PRINTRATEUNIT
: /* WINVER >= 0x0500 */
696 FIXME("DC_PRINTRATEUNIT: stub\n");
700 FIXME("Unsupported capability %d\n", fwCapability
);
705 /**************************************************************
706 * DeviceCapabilities [WINEPS16.91]
708 DWORD WINAPI
PSDRV_DeviceCapabilities16(LPCSTR lpszDevice
,
709 LPCSTR lpszPort
, WORD fwCapability
,
710 LPSTR lpszOutput
, LPDEVMODEA lpdm
)
712 return PSDRV_DeviceCapabilities(NULL
, lpszDevice
, lpszPort
, fwCapability
,
716 /***************************************************************
717 * DeviceMode [WINEPS16.13]
720 void WINAPI
PSDRV_DeviceMode16(HWND16 hwnd
, HANDLE16 hDriver
,
721 LPSTR lpszDevice
, LPSTR lpszPort
)
723 PSDRV_ExtDeviceMode16( hwnd
, hDriver
, NULL
, lpszDevice
, lpszPort
, NULL
,
732 HPROPSHEETPAGE hPages
[10];
735 INT
PSDRV_ExtDeviceModePropSheet(HWND hwnd
, LPSTR lpszDevice
, LPSTR lpszPort
,
738 EDMPS
*ps
= pPropSheet
;
741 psp
->dwSize
= sizeof(psp
);
742 psp
->hInstance
= 0x1234;