Implemented GdiComment for enhanced metafiles.

This commit is contained in:
Mike McCormack 2003-05-21 18:28:49 +00:00 committed by Alexandre Julliard
parent b168f12a48
commit 399967c10d
7 changed files with 42 additions and 2 deletions

View File

@ -94,6 +94,7 @@ static struct graphics_driver *create_driver( HMODULE module )
GET_FUNC(FillRgn);
GET_FUNC(FlattenPath);
GET_FUNC(FrameRgn);
GET_FUNC(GdiComment);
GET_FUNC(GetBitmapBits);
GET_FUNC(GetCharWidth);
GET_FUNC(GetDCOrgEx);

View File

@ -77,6 +77,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 BOOL EMFDRV_GdiComment( PHYSDEV dev, UINT bytes, CONST BYTE *buffer );
extern INT EMFDRV_GetDeviceCaps( PHYSDEV dev, INT cap );
extern INT EMFDRV_IntersectClipRect( PHYSDEV dev, INT left, INT top, INT right,
INT bottom );

View File

@ -62,6 +62,7 @@ static const DC_FUNCTIONS EMFDRV_Funcs =
EMFDRV_FillRgn, /* pFillRgn */
EMFDRV_FlattenPath, /* pFlattenPath */
EMFDRV_FrameRgn, /* pFrameRgn */
EMFDRV_GdiComment, /* pGdiComment */
NULL, /* pGetBitmapBits */
NULL, /* pGetCharWidth */
NULL, /* pGetDCOrgEx */

View File

@ -264,3 +264,30 @@ HPEN EMFDRV_SelectPen(PHYSDEV dev, HPEN hPen )
emr.ihObject = index;
return EMFDRV_WriteRecord( dev, &emr.emr ) ? hPen : 0;
}
/******************************************************************
* EMFDRV_GdiComment
*/
BOOL EMFDRV_GdiComment(PHYSDEV dev, UINT bytes, CONST BYTE *buffer)
{
EMRGDICOMMENT *emr;
UINT total, rounded_size;
BOOL ret;
rounded_size = (bytes+3) & ~3;
total = offsetof(EMRGDICOMMENT,Data) + rounded_size;
emr = HeapAlloc(GetProcessHeap(), 0, total);
emr->emr.iType = EMR_GDICOMMENT;
emr->emr.nSize = total;
emr->cbData = bytes;
memset(&emr->Data[bytes], 0, rounded_size - bytes);
memcpy(&emr->Data[0], buffer, bytes);
ret = EMFDRV_WriteRecord( dev, &emr->emr );
HeapFree(GetProcessHeap(), 0, emr);
return ret;
}

View File

@ -63,6 +63,7 @@ static const DC_FUNCTIONS MFDRV_Funcs =
MFDRV_FillRgn, /* pFillRgn */
MFDRV_FlattenPath, /* pFlattenPath */
MFDRV_FrameRgn, /* pFrameRgn */
NULL, /* pGdiComment */
NULL, /* pGetBitmapBits */
NULL, /* pGetCharWidth */
NULL, /* pGetDCOrgEx */

View File

@ -202,6 +202,7 @@ typedef struct tagDC_FUNCS
BOOL (*pFillRgn)(PHYSDEV,HRGN,HBRUSH);
BOOL (*pFlattenPath)(PHYSDEV);
BOOL (*pFrameRgn)(PHYSDEV,HRGN,HBRUSH,INT,INT);
BOOL (*pGdiComment)(PHYSDEV,UINT,CONST BYTE*);
LONG (*pGetBitmapBits)(HBITMAP,void*,LONG);
BOOL (*pGetCharWidth)(PHYSDEV,UINT,UINT,LPINT);
BOOL (*pGetDCOrgEx)(PHYSDEV,LPPOINT);

View File

@ -1370,9 +1370,17 @@ BOOL WINAPI SetMiterLimit(HDC hdc, FLOAT eNewLimit, PFLOAT peOldLimit)
*/
BOOL WINAPI GdiComment(HDC hdc, UINT cbSize, const BYTE *lpData)
{
FIXME("GdiComment, stub\n");
return 0;
DC *dc = DC_GetDCPtr(hdc);
BOOL ret = FALSE;
if(dc)
{
if (dc->funcs->pGdiComment)
ret = dc->funcs->pGdiComment( dc->physDev, cbSize, lpData );
}
GDI_ReleaseObj( hdc );
return ret;
}
/*******************************************************************
* SetColorAdjustment [GDI32.@]
*