Commit 259837a1 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

gdiplus: Implement GdipGetMetafileHeaderFromMetafile.

parent 37697789
...@@ -1667,17 +1667,29 @@ GpStatus WINGDIPAPI GdipEnumerateMetafileDestPointI(GpGraphics *graphics, ...@@ -1667,17 +1667,29 @@ GpStatus WINGDIPAPI GdipEnumerateMetafileDestPointI(GpGraphics *graphics,
GpStatus WINGDIPAPI GdipGetMetafileHeaderFromMetafile(GpMetafile * metafile, GpStatus WINGDIPAPI GdipGetMetafileHeaderFromMetafile(GpMetafile * metafile,
MetafileHeader * header) MetafileHeader * header)
{ {
static int calls; GpStatus status;
TRACE("(%p, %p)\n", metafile, header); TRACE("(%p, %p)\n", metafile, header);
if(!metafile || !header) if(!metafile || !header)
return InvalidParameter; return InvalidParameter;
if(!(calls++)) if (metafile->hemf)
FIXME("not implemented\n"); {
status = GdipGetMetafileHeaderFromEmf(metafile->hemf, header);
if (status != Ok) return status;
}
else
{
memset(header, 0, sizeof(*header));
header->Version = 0xdbc01002;
}
memset(header, 0, sizeof(MetafileHeader)); header->Type = metafile->metafile_type;
header->DpiX = metafile->image.xres;
header->DpiY = metafile->image.yres;
header->Width = gdip_round(metafile->bounds.Width);
header->Height = gdip_round(metafile->bounds.Height);
return Ok; return Ok;
} }
......
...@@ -1465,17 +1465,17 @@ static void test_loadwmf(void) ...@@ -1465,17 +1465,17 @@ static void test_loadwmf(void)
expect(Ok, stat); expect(Ok, stat);
if (stat == Ok) if (stat == Ok)
{ {
todo_wine expect(MetafileTypeWmfPlaceable, header.Type); expect(MetafileTypeWmfPlaceable, header.Type);
todo_wine expect(sizeof(wmfimage)-sizeof(WmfPlaceableFileHeader), header.Size); todo_wine expect(sizeof(wmfimage)-sizeof(WmfPlaceableFileHeader), header.Size);
todo_wine expect(0x300, header.Version); todo_wine expect(0x300, header.Version);
expect(0, header.EmfPlusFlags); expect(0, header.EmfPlusFlags);
todo_wine expectf(1440.0, header.DpiX); expectf(1440.0, header.DpiX);
todo_wine expectf(1440.0, header.DpiY); expectf(1440.0, header.DpiY);
expect(0, header.X); expect(0, header.X);
expect(0, header.Y); expect(0, header.Y);
todo_wine expect(320, header.Width); expect(320, header.Width);
todo_wine expect(320, header.Height); expect(320, header.Height);
todo_wine expect(1, U(header).WmfHeader.mtType); expect(1, U(header).WmfHeader.mtType);
expect(0, header.EmfPlusHeaderSize); expect(0, header.EmfPlusHeaderSize);
expect(0, header.LogicalDpiX); expect(0, header.LogicalDpiX);
expect(0, header.LogicalDpiY); expect(0, header.LogicalDpiY);
...@@ -1523,17 +1523,17 @@ static void test_createfromwmf(void) ...@@ -1523,17 +1523,17 @@ static void test_createfromwmf(void)
expect(Ok, stat); expect(Ok, stat);
if (stat == Ok) if (stat == Ok)
{ {
todo_wine expect(MetafileTypeWmfPlaceable, header.Type); expect(MetafileTypeWmfPlaceable, header.Type);
todo_wine expect(sizeof(wmfimage)-sizeof(WmfPlaceableFileHeader), header.Size); todo_wine expect(sizeof(wmfimage)-sizeof(WmfPlaceableFileHeader), header.Size);
todo_wine expect(0x300, header.Version); todo_wine expect(0x300, header.Version);
expect(0, header.EmfPlusFlags); expect(0, header.EmfPlusFlags);
todo_wine expectf(1440.0, header.DpiX); expectf(1440.0, header.DpiX);
todo_wine expectf(1440.0, header.DpiY); expectf(1440.0, header.DpiY);
expect(0, header.X); expect(0, header.X);
expect(0, header.Y); expect(0, header.Y);
todo_wine expect(320, header.Width); expect(320, header.Width);
todo_wine expect(320, header.Height); expect(320, header.Height);
todo_wine expect(1, U(header).WmfHeader.mtType); expect(1, U(header).WmfHeader.mtType);
expect(0, header.EmfPlusHeaderSize); expect(0, header.EmfPlusHeaderSize);
expect(0, header.LogicalDpiX); expect(0, header.LogicalDpiX);
expect(0, header.LogicalDpiY); expect(0, header.LogicalDpiY);
......
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