Commit 64edac40 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

wineps: Add a helper to find a duplex entry.

parent 44d880b4
...@@ -67,6 +67,20 @@ PAGESIZE *find_pagesize( PPD *ppd, PSDRV_DEVMODE *dm ) ...@@ -67,6 +67,20 @@ PAGESIZE *find_pagesize( PPD *ppd, PSDRV_DEVMODE *dm )
return NULL; return NULL;
} }
DUPLEX *find_duplex( PPD *ppd, PSDRV_DEVMODE *dm )
{
DUPLEX *duplex;
WORD win_duplex = dm->dmPublic.dmFields & DM_DUPLEX ? dm->dmPublic.dmDuplex : 0;
if (win_duplex == 0) return NULL; /* Not capable */
LIST_FOR_EACH_ENTRY( duplex, &ppd->Duplexes, DUPLEX, entry )
if (duplex->WinDuplex == win_duplex)
return duplex;
return NULL;
}
/************************************************************************ /************************************************************************
* *
* PSDRV_MergeDevmodes * PSDRV_MergeDevmodes
......
...@@ -303,8 +303,7 @@ INT PSDRV_WriteHeader( PHYSDEV dev, LPCWSTR title ) ...@@ -303,8 +303,7 @@ INT PSDRV_WriteHeader( PHYSDEV dev, LPCWSTR title )
char *buf, *escaped_title; char *buf, *escaped_title;
INPUTSLOT *slot = find_slot( physDev->pi->ppd, physDev->Devmode ); INPUTSLOT *slot = find_slot( physDev->pi->ppd, physDev->Devmode );
PAGESIZE *page = find_pagesize( physDev->pi->ppd, physDev->Devmode ); PAGESIZE *page = find_pagesize( physDev->pi->ppd, physDev->Devmode );
DUPLEX *duplex; DUPLEX *duplex = find_duplex( physDev->pi->ppd, physDev->Devmode );
int win_duplex;
int llx, lly, urx, ury; int llx, lly, urx, ury;
int ret, len; int ret, len;
...@@ -356,18 +355,8 @@ INT PSDRV_WriteHeader( PHYSDEV dev, LPCWSTR title ) ...@@ -356,18 +355,8 @@ INT PSDRV_WriteHeader( PHYSDEV dev, LPCWSTR title )
if (page && page->InvocationString) if (page && page->InvocationString)
PSDRV_WriteFeature( dev, "*PageSize", page->Name, page->InvocationString ); PSDRV_WriteFeature( dev, "*PageSize", page->Name, page->InvocationString );
win_duplex = physDev->Devmode->dmPublic.dmFields & DM_DUPLEX ? if (duplex && duplex->InvocationString)
physDev->Devmode->dmPublic.dmDuplex : 0; PSDRV_WriteFeature( dev, "*Duplex", duplex->Name, duplex->InvocationString );
LIST_FOR_EACH_ENTRY( duplex, &physDev->pi->ppd->Duplexes, DUPLEX, entry )
{
if(duplex->WinDuplex == win_duplex) {
if(duplex->InvocationString) {
PSDRV_WriteFeature(dev, "*Duplex", duplex->Name,
duplex->InvocationString);
break;
}
}
}
write_spool( dev, psendsetup, strlen(psendsetup) ); write_spool( dev, psendsetup, strlen(psendsetup) );
......
...@@ -403,6 +403,7 @@ extern char *PSDRV_ANSIVector[256] DECLSPEC_HIDDEN; ...@@ -403,6 +403,7 @@ extern char *PSDRV_ANSIVector[256] DECLSPEC_HIDDEN;
extern INPUTSLOT *find_slot( PPD *ppd, PSDRV_DEVMODE *dm ); extern INPUTSLOT *find_slot( PPD *ppd, PSDRV_DEVMODE *dm );
extern PAGESIZE *find_pagesize( PPD *ppd, PSDRV_DEVMODE *dm ); extern PAGESIZE *find_pagesize( PPD *ppd, PSDRV_DEVMODE *dm );
extern DUPLEX *find_duplex( PPD *ppd, PSDRV_DEVMODE *dm );
/* GDI driver functions */ /* GDI driver functions */
extern BOOL PSDRV_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom, extern BOOL PSDRV_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment