- Added some missing EMR record types and updated and fixed others

- Added stubs and headers for CreateColorSpace,DeleteColorSpace and SetColorSpace
- Added header for SetICMMode
- Added ability to play more enhanced metafile records
This commit is contained in:
Peter Hunnisett 2000-01-15 22:17:49 +00:00 committed by Alexandre Julliard
parent 40d5f4cddc
commit f2b8492285
3 changed files with 173 additions and 16 deletions

View file

@ -1966,9 +1966,15 @@ typedef struct {
DWORD nPalEntries;
SIZEL szlDevice;
SIZEL szlMillimeters;
/* Fields for winver >= win95 */
DWORD cbPixelFormat;
DWORD offPixelFormat;
DWORD bOpenGL;
/* Fields for winver >= win98 */
SIZEL szlMicrometers;
} ENHMETAHEADER, *LPENHMETAHEADER;
typedef struct {
@ -2049,9 +2055,18 @@ typedef struct {
typedef struct {
EMR emr;
DWORD ihCS;
LOGCOLORSPACEW lcs;
LOGCOLORSPACEA lcs;
} EMRCREATECOLORSPACE, *PEMRCREATECOLORSPACE;
typedef struct {
EMR emr;
DWORD ihCS;
LOGCOLORSPACEW lcs;
DWORD dwFlags;
DWORD cbData;
BYTE Data[1];
} EMRCREATECOLORSPACEW, *PEMRCREATECOLORSPACEW;
typedef struct {
EMR emr;
DWORD ihBrush;
@ -2508,6 +2523,24 @@ typedef struct {
LONG cyDst;
} EMRSTRETCHDIBITS, *PEMRSTRETCHDIBITS;
typedef struct {
EMR emr;
PIXELFORMATDESCRIPTOR pfd;
} EMRPIXELFORMAT, *PEMRPIXELFORMAT;
typedef struct tagEMRGLSRECORD {
EMR emr;
DWORD cbData;
BYTE Data[1];
} EMRGLSRECORD, *PEMRGLSRECORD;
typedef struct {
EMR emr;
RECTL rclBounds;
DWORD cbData;
BYTE Data[1];
} EMRGLSBOUNDEDRECORD, *PEMRGLSBOUNDEDRECORD;
typedef INT (CALLBACK *ENHMFENUMPROC)(HDC, LPHANDLETABLE,
LPENHMETARECORD, INT, LPVOID);
@ -3046,6 +3079,9 @@ HMETAFILE WINAPI CopyMetaFileW(HMETAFILE,LPCWSTR);
HBITMAP WINAPI CreateBitmap(INT,INT,UINT,UINT,LPCVOID);
HBITMAP WINAPI CreateBitmapIndirect(const BITMAP*);
HBRUSH WINAPI CreateBrushIndirect(const LOGBRUSH*);
HCOLORSPACE WINAPI CreateColorSpaceA(LPLOGCOLORSPACEA);
HCOLORSPACE WINAPI CreateColorSpaceW(LPLOGCOLORSPACEW);
#define CreateColorSpace WINELIB_NAME_AW(CreateColorSpace)
HBITMAP WINAPI CreateCompatibleBitmap(HDC,INT,INT);
HDC WINAPI CreateCompatibleDC(HDC);
HDC WINAPI CreateDCA(LPCSTR,LPCSTR,LPCSTR,const DEVMODEA*);
@ -3093,6 +3129,7 @@ BOOL WINAPI CreateScalableFontResourceW(DWORD,LPCWSTR,LPCWSTR,LPCWSTR);
#define CreateScalableFontResource WINELIB_NAME_AW(CreateScalableFontResource)
HBRUSH WINAPI CreateSolidBrush(COLORREF);
BOOL WINAPI DPtoLP(HDC,LPPOINT,INT);
BOOL WINAPI DeleteColorSpace(HCOLORSPACE);
BOOL WINAPI DeleteDC(HDC);
BOOL WINAPI DeleteEnhMetaFile(HENHMETAFILE);
BOOL WINAPI DeleteMetaFile(HMETAFILE);
@ -3308,12 +3345,14 @@ INT WINAPI SetBkMode(HDC,INT);
UINT WINAPI SetBoundsRect(HDC,const RECT*,UINT);
BOOL WINAPI SetBrushOrgEx(HDC,INT,INT,LPPOINT);
BOOL WINAPI SetColorAdjustment(HDC,const COLORADJUSTMENT*);
HCOLORSPACE WINAPI SetColorSpace(HDC,HCOLORSPACE);
UINT WINAPI SetDIBColorTable(HDC,UINT,UINT,RGBQUAD*);
INT WINAPI SetDIBits(HDC,HBITMAP,UINT,UINT,LPCVOID,const BITMAPINFO*,UINT);
INT WINAPI SetDIBitsToDevice(HDC,INT,INT,DWORD,DWORD,INT,
INT,UINT,UINT,LPCVOID,const BITMAPINFO*,UINT);
HENHMETAFILE WINAPI SetEnhMetaFileBits(UINT,const BYTE *);
INT WINAPI SetGraphicsMode(HDC,INT);
INT WINAPI SetICMMode(HDC,INT);
DWORD WINAPI SetLayout(HDC,DWORD);
INT WINAPI SetMapMode(HDC,INT);
DWORD WINAPI SetMapperFlags(HDC,DWORD);

View file

@ -352,7 +352,39 @@ BOOL WINAPI PlayEnhMetaFileRecord(
{
case EMR_HEADER:
{
/* ENHMETAHEADER *h = (LPENHMETAHEADER) mr; */
#if 0
ENHMETAHEADER* h = (LPENHMETAHEADER)mr;
XFORM dcTransform;
/* Scale the enhanced metafile according to the reference hdc
it was created with */
if( h->szlDevice.cx )
{
dcTransform.eM11 = (FLOAT)( (DOUBLE)GetDeviceCaps( hdc, HORZRES ) /
(DOUBLE)h->szlDevice.cx );
}
else
{
ERR( "Invalid szlDevice.cx in header\n" );
dcTransform.eM11 = (FLOAT)1.0;
}
if( h->szlDevice.cy )
{
dcTransform.eM22 = (FLOAT)( (DOUBLE)GetDeviceCaps( hdc, VERTRES ) /
(DOUBLE)h->szlDevice.cy );
}
else
{
ERR( "Invalid szlDevice.cy in header\n" );
dcTransform.eM22 = (FLOAT)1.0;
}
dcTransform.eM12 = dcTransform.eM21 = (FLOAT)0;
dcTransform.eDx = dcTransform.eDy = (FLOAT)0;
ModifyWorldTransform( hdc, &dcTransform, MWT_RIGHTMULTIPLY );
#endif
break;
}
case EMR_EOF:
@ -1048,6 +1080,100 @@ BOOL WINAPI PlayEnhMetaFileRecord(
break;
}
case EMR_CREATECOLORSPACE:
{
PEMRCREATECOLORSPACE lpCreateColorSpace = (PEMRCREATECOLORSPACE)mr;
(handletable->objectHandle)[lpCreateColorSpace->ihCS] =
CreateColorSpaceA( &lpCreateColorSpace->lcs );
break;
}
case EMR_SETCOLORSPACE:
{
PEMRSETCOLORSPACE lpSetColorSpace = (PEMRSETCOLORSPACE)mr;
SetColorSpace( hdc,
(handletable->objectHandle)[lpSetColorSpace->ihCS] );
break;
}
case EMR_DELETECOLORSPACE:
{
PEMRDELETECOLORSPACE lpDeleteColorSpace = (PEMRDELETECOLORSPACE)mr;
DeleteColorSpace( (handletable->objectHandle)[lpDeleteColorSpace->ihCS] );
break;
}
case EMR_SETICMMODE:
{
PERMSETICMMODE lpSetICMMode = (PERMSETICMMODE)mr;
SetICMMode( hdc,
(INT)lpSetICMMode->iMode );
break;
}
case EMR_PIXELFORMAT:
{
INT iPixelFormat;
PEMRPIXELFORMAT lpPixelFormat = (PEMRPIXELFORMAT)mr;
iPixelFormat = ChoosePixelFormat( hdc, &lpPixelFormat->pfd );
SetPixelFormat( hdc, iPixelFormat, &lpPixelFormat->pfd );
break;
}
case EMR_SETPALETTEENTRIES:
{
PEMRSETPALETTEENTRIES lpSetPaletteEntries = (PEMRSETPALETTEENTRIES)mr;
SetPaletteEntries( (handletable->objectHandle)[lpSetPaletteEntries->ihPal],
(UINT)lpSetPaletteEntries->iStart,
(UINT)lpSetPaletteEntries->cEntries,
lpSetPaletteEntries->aPalEntries );
break;
}
case EMR_RESIZEPALETTE:
{
PEMRRESIZEPALETTE lpResizePalette = (PEMRRESIZEPALETTE)mr;
ResizePalette( (handletable->objectHandle)[lpResizePalette->ihPal],
(UINT)lpResizePalette->cEntries );
break;
}
case EMR_CREATEDIBPATTERNBRUSHPT:
{
PEMRCREATEDIBPATTERNBRUSHPT lpCreate = (PEMRCREATEDIBPATTERNBRUSHPT)mr;
/* This is a BITMAPINFO struct followed directly by bitmap bits */
LPVOID lpPackedStruct = HeapAlloc( GetProcessHeap(),
0,
lpCreate->cbBmi + lpCreate->cbBits );
/* Now pack this structure */
memcpy( lpPackedStruct,
((BYTE*)lpCreate) + lpCreate->offBmi,
lpCreate->cbBmi );
memcpy( ((BYTE*)lpPackedStruct) + lpCreate->cbBmi,
((BYTE*)lpCreate) + lpCreate->offBits,
lpCreate->cbBits );
(handletable->objectHandle)[lpCreate->ihBrush] =
CreateDIBPatternBrushPt( lpPackedStruct,
(UINT)lpCreate->iUsage );
break;
}
case EMR_BITBLT:
case EMR_STRETCHBLT:
@ -1062,22 +1188,14 @@ BOOL WINAPI PlayEnhMetaFileRecord(
case EMR_POLYPOLYGON16:
case EMR_POLYDRAW16:
case EMR_CREATEMONOBRUSH:
case EMR_CREATEDIBPATTERNBRUSHPT:
case EMR_POLYTEXTOUTA:
case EMR_POLYTEXTOUTW:
case EMR_SETICMMODE:
case EMR_CREATECOLORSPACE:
case EMR_SETCOLORSPACE:
case EMR_DELETECOLORSPACE:
case EMR_GLSRECORD:
case EMR_GLSBOUNDEDRECORD:
case EMR_PIXELFORMAT:
case EMR_SETPALETTEENTRIES:
case EMR_RESIZEPALETTE:
case EMR_FILLRGN:
case EMR_FRAMERGN:
case EMR_INVERTRGN:
case EMR_PAINTRGN:
case EMR_GLSRECORD:
case EMR_GLSBOUNDEDRECORD:
default:
/* From docs: If PlayEnhMetaFileRecord doesn't recognize a
record then ignore and return TRUE. */

View file

@ -39,8 +39,8 @@ init MAIN_GdiInit
@ stdcall CreateBitmap(long long long long ptr) CreateBitmap
@ stdcall CreateBitmapIndirect(ptr) CreateBitmapIndirect
@ stdcall CreateBrushIndirect(ptr) CreateBrushIndirect
@ stub CreateColorSpaceA
@ stub CreateColorSpaceW
@ stdcall CreateColorSpaceA(ptr) CreateColorSpaceA
@ stdcall CreateColorSpaceW(ptr) CreateColorSpaceW
@ stdcall CreateCompatibleBitmap(long long long) CreateCompatibleBitmap
@ stdcall CreateCompatibleDC(long) CreateCompatibleDC
@ stdcall CreateDCA(str str str ptr) CreateDCA
@ -77,7 +77,7 @@ init MAIN_GdiInit
@ stdcall CreateScalableFontResourceW(long wstr wstr wstr) CreateScalableFontResourceW
@ stdcall CreateSolidBrush(long) CreateSolidBrush
@ stdcall DPtoLP(long ptr long) DPtoLP
@ stub DeleteColorSpace
@ stdcall DeleteColorSpace(long) DeleteColorSpace
@ stdcall DeleteDC(long) DeleteDC
@ stdcall DeleteEnhMetaFile(long) DeleteEnhMetaFile
@ stdcall DeleteMetaFile(long) DeleteMetaFile
@ -343,7 +343,7 @@ init MAIN_GdiInit
@ stdcall SetBoundsRect(long ptr long) SetBoundsRect
@ stdcall SetBrushOrgEx(long long long ptr) SetBrushOrgEx
@ stdcall SetColorAdjustment(long ptr) SetColorAdjustment
@ stub SetColorSpace
@ stdcall SetColorSpace(long long) SetColorSpace
@ stdcall SetDIBColorTable(long long long ptr) SetDIBColorTable
@ stdcall SetDIBits(long long long long ptr ptr long) SetDIBits
@ stdcall SetDIBitsToDevice(long long long long long long long long long ptr ptr long) SetDIBitsToDevice