Commit d5f27e19 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

wineps.drv: Keep track of all supported device resolutions.

parent 57f84bc7
......@@ -638,14 +638,22 @@ DWORD PSDRV_DeviceCapabilities(LPSTR lpszDriver, LPCSTR lpszDevice, LPCSTR lpszP
case DC_ENUMRESOLUTIONS:
{
LONG *lp = (LONG*)lpszOutput;
RESOLUTION *res;
LONG *lp = (LONG *)lpszOutput;
int i = 0;
if(lpszOutput != NULL) {
lp[0] = pi->ppd->DefaultResolution;
lp[1] = pi->ppd->DefaultResolution;
}
ret = 1;
break;
LIST_FOR_EACH_ENTRY(res, &pi->ppd->Resolutions, RESOLUTION, entry)
{
i++;
if (lpszOutput != NULL)
{
lp[0] = res->resx;
lp[1] = res->resy;
lp += 2;
}
}
ret = i;
break;
}
/* Windows returns 9999 too */
......
......@@ -659,6 +659,7 @@ PPD *PSDRV_ParsePPD( char *fname, HANDLE printer )
ppd->ColorDevice = CD_NotSpecified;
list_init( &ppd->Resolutions );
list_init( &ppd->InstalledFonts );
list_init( &ppd->PageSizes );
list_init( &ppd->Constraints );
......@@ -713,6 +714,26 @@ PPD *PSDRV_ParsePPD( char *fname, HANDLE printer )
WARN("failed to parse DefaultResolution %s\n", debugstr_a(tuple.value));
}
else if(!strcmp("*Resolution", tuple.key))
{
SIZE sz;
if (parse_resolution(tuple.option, &sz))
{
RESOLUTION *res;
TRACE("Resolution %dx%d, invocation %s\n", sz.cx, sz.cy, tuple.value);
res = HeapAlloc( GetProcessHeap(), 0, sizeof(*res) );
res->resx = sz.cx;
res->resy = sz.cy;
res->InvocationString = tuple.value;
tuple.value = NULL;
list_add_tail( &ppd->Resolutions, &res->entry );
}
else
WARN("failed to parse Resolution %s\n", debugstr_a(tuple.option));
}
else if(!strcmp("*Font", tuple.key))
{
FONTNAME *fn = HeapAlloc( PSDRV_Heap, 0, sizeof(*fn) );
......
......@@ -183,6 +183,13 @@ typedef struct
WORD WinDuplex; /* eg DMDUP_SIMPLEX */
} DUPLEX;
typedef struct
{
struct list entry;
int resx, resy;
char *InvocationString;
} RESOLUTION;
/* Many Mac OS X based ppd files don't include a *ColorDevice line, so
we use a tristate here rather than a boolean. Code that
cares is expected to treat these as if they were colour. */
......@@ -196,6 +203,7 @@ typedef struct {
char *NickName;
int LanguageLevel;
COLORDEVICE ColorDevice;
struct list Resolutions;
int DefaultResolution;
signed int LandscapeOrientation;
char *JCLBegin;
......
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