Commit 7318acaa authored by Huw D M Davies's avatar Huw D M Davies Committed by Alexandre Julliard

Implemented a few device caps.

parent bd0a567a
......@@ -278,3 +278,31 @@ BOOL EMFDRV_WidenPath( PHYSDEV dev )
return EMFDRV_WriteRecord( dev, &emr.emr );
}
INT EMFDRV_GetDeviceCaps(PHYSDEV dev, INT cap)
{
EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE*) dev;
switch(cap) {
case HORZRES:
return physDev->horzres;
case VERTRES:
return physDev->vertres;
case LOGPIXELSX:
return physDev->logpixelsx;
case LOGPIXELSY:
return physDev->logpixelsy;
case HORZSIZE:
return physDev->horzsize;
case VERTSIZE:
return physDev->vertsize;
case BITSPIXEL:
return physDev->bitspixel;
default:
FIXME("Unimplemented cap %d\n", cap);
return 0;
}
}
......@@ -34,6 +34,10 @@ typedef struct
ENHMETAHEADER *emh; /* Pointer to enhanced metafile header */
UINT nextHandle; /* Next handle number */
HANDLE hFile; /* Handle for disk based MetaFile */
INT horzres, vertres;
INT horzsize, vertsize;
INT logpixelsx, logpixelsy;
INT bitspixel;
} EMFDRV_PDEVICE;
......@@ -69,6 +73,7 @@ extern BOOL EMFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush );
extern BOOL EMFDRV_FlattenPath( PHYSDEV dev );
extern BOOL EMFDRV_FrameRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush, INT width,
INT height );
extern INT EMFDRV_GetDeviceCaps( PHYSDEV dev, INT cap );
extern INT EMFDRV_IntersectClipRect( PHYSDEV dev, INT left, INT top, INT right,
INT bottom );
extern BOOL EMFDRV_InvertRgn( PHYSDEV dev, HRGN hrgn );
......
......@@ -67,7 +67,7 @@ static const DC_FUNCTIONS EMFDRV_Funcs =
NULL, /* pGetDCOrgEx */
NULL, /* pGetDIBColorTable */
NULL, /* pGetDIBits */
NULL, /* pGetDeviceCaps */
EMFDRV_GetDeviceCaps, /* pGetDeviceCaps */
NULL, /* pGetDeviceGammaRamp */
NULL, /* pGetNearestColor */
NULL, /* pGetPixel */
......@@ -311,6 +311,14 @@ HDC WINAPI CreateEnhMetaFileW(
physDev->nextHandle = 1;
physDev->hFile = 0;
physDev->horzres = GetDeviceCaps(hRefDC, HORZRES);
physDev->vertres = GetDeviceCaps(hRefDC, VERTRES);
physDev->logpixelsx = GetDeviceCaps(hRefDC, LOGPIXELSX);
physDev->logpixelsy = GetDeviceCaps(hRefDC, LOGPIXELSY);
physDev->horzsize = GetDeviceCaps(hRefDC, HORZSIZE);
physDev->vertsize = GetDeviceCaps(hRefDC, VERTSIZE);
physDev->bitspixel = GetDeviceCaps(hRefDC, BITSPIXEL);
physDev->emh->iType = EMR_HEADER;
physDev->emh->nSize = size;
......@@ -341,12 +349,12 @@ HDC WINAPI CreateEnhMetaFileW(
physDev->emh->nPalEntries = 0; /* I guess this should start at 0 */
/* Size in pixels */
physDev->emh->szlDevice.cx = GetDeviceCaps( hRefDC, HORZRES );
physDev->emh->szlDevice.cy = GetDeviceCaps( hRefDC, VERTRES );
physDev->emh->szlDevice.cx = physDev->horzres;
physDev->emh->szlDevice.cy = physDev->vertres;
/* Size in millimeters */
physDev->emh->szlMillimeters.cx = GetDeviceCaps( hRefDC, HORZSIZE );
physDev->emh->szlMillimeters.cy = GetDeviceCaps( hRefDC, VERTSIZE );
physDev->emh->szlMillimeters.cx = physDev->horzsize;
physDev->emh->szlMillimeters.cy = physDev->vertsize;
memcpy((char *)physDev->emh + sizeof(ENHMETAHEADER), description, length);
......
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