2005-01-04 21:32:25 +01:00
|
|
|
/*
|
|
|
|
* Dump an Enhanced Meta File
|
|
|
|
*
|
|
|
|
* Copyright 2005 Mike McCormack
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2005-01-04 21:32:25 +01:00
|
|
|
*/
|
|
|
|
|
2005-02-22 15:52:35 +01:00
|
|
|
#include "config.h"
|
|
|
|
#include "wine/port.h"
|
2005-06-23 11:48:15 +02:00
|
|
|
#include "winedump.h"
|
2005-02-22 15:52:35 +01:00
|
|
|
|
2005-01-04 21:32:25 +01:00
|
|
|
#include <stdio.h>
|
2005-02-22 15:52:35 +01:00
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
# include <unistd.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
|
|
|
# include <sys/types.h>
|
|
|
|
#endif
|
2005-01-04 21:32:25 +01:00
|
|
|
#include <fcntl.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "wingdi.h"
|
2017-06-30 18:03:38 +02:00
|
|
|
#include "gdiplusenums.h"
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
WORD Type;
|
|
|
|
WORD Flags;
|
|
|
|
DWORD Size;
|
|
|
|
DWORD DataSize;
|
|
|
|
} EmfPlusRecordHeader;
|
2005-01-04 21:32:25 +01:00
|
|
|
|
2009-05-08 13:10:52 +02:00
|
|
|
static const char *debugstr_wn(const WCHAR *wstr, unsigned int n)
|
2008-04-17 14:11:16 +02:00
|
|
|
{
|
|
|
|
static char buf[80];
|
|
|
|
char *p;
|
2009-05-08 13:10:52 +02:00
|
|
|
unsigned int i;
|
2008-04-17 14:11:16 +02:00
|
|
|
|
|
|
|
if (!wstr) return "(null)";
|
|
|
|
|
|
|
|
i = 0;
|
|
|
|
p = buf;
|
|
|
|
*p++ = '\"';
|
|
|
|
while (i < n && i < sizeof(buf) - 2 && wstr[i])
|
|
|
|
{
|
|
|
|
if (wstr[i] < 127) *p++ = wstr[i];
|
|
|
|
else *p++ = '.';
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
*p++ = '\"';
|
|
|
|
*p = 0;
|
|
|
|
return buf;
|
|
|
|
}
|
|
|
|
|
2006-11-29 21:40:21 +01:00
|
|
|
static unsigned int read_int(const unsigned char *buffer)
|
2005-01-04 21:32:25 +01:00
|
|
|
{
|
2005-02-22 15:52:35 +01:00
|
|
|
return buffer[0]
|
2005-01-04 21:32:25 +01:00
|
|
|
+ (buffer[1]<<8)
|
|
|
|
+ (buffer[2]<<16)
|
|
|
|
+ (buffer[3]<<24);
|
|
|
|
}
|
|
|
|
|
|
|
|
#define EMRCASE(x) case x: printf("%-20s %08x\n", #x, length); break
|
2017-06-30 18:03:38 +02:00
|
|
|
#define EMRPLUSCASE(x) case x: printf(" %-20s %04x %08x %08x\n", #x, header->Flags, header->Size, header->DataSize); break
|
2005-01-04 21:32:25 +01:00
|
|
|
|
2006-11-29 21:40:21 +01:00
|
|
|
static unsigned offset = 0;
|
|
|
|
|
|
|
|
static int dump_emfrecord(void)
|
2005-01-04 21:32:25 +01:00
|
|
|
{
|
2006-11-29 21:40:21 +01:00
|
|
|
const unsigned char* ptr;
|
2005-02-22 15:52:35 +01:00
|
|
|
unsigned int type, length, i;
|
2005-01-04 21:32:25 +01:00
|
|
|
|
2006-11-29 21:40:21 +01:00
|
|
|
ptr = PRD(offset, 8);
|
|
|
|
if (!ptr) return -1;
|
2005-01-04 21:32:25 +01:00
|
|
|
|
2006-11-29 21:40:21 +01:00
|
|
|
type = read_int(ptr);
|
|
|
|
length = read_int(ptr + 4);
|
2005-01-04 21:32:25 +01:00
|
|
|
|
|
|
|
switch(type)
|
|
|
|
{
|
2021-03-24 09:10:12 +01:00
|
|
|
case EMR_HEADER:
|
|
|
|
{
|
|
|
|
const ENHMETAHEADER *header = PRD(offset, sizeof(*header));
|
|
|
|
|
|
|
|
printf("%-20s %08x\n", "EMR_HEADER", length);
|
|
|
|
printf("bounds (%d,%d - %d,%d) frame (%d,%d - %d,%d) signature %#x version %#x bytes %#x records %#x\n"
|
|
|
|
"handles %#x reserved %#x palette entries %#x px %dx%d mm %dx%d μm %dx%d opengl %d description %s\n",
|
|
|
|
header->rclBounds.left, header->rclBounds.top, header->rclBounds.right, header->rclBounds.bottom,
|
|
|
|
header->rclFrame.left, header->rclFrame.top, header->rclFrame.right, header->rclFrame.bottom,
|
|
|
|
header->dSignature, header->nVersion, header->nBytes, header->nRecords, header->nHandles, header->sReserved,
|
|
|
|
header->nPalEntries, header->szlDevice.cx, header->szlDevice.cy, header->szlMillimeters.cx,
|
|
|
|
header->szlMillimeters.cy, header->szlMicrometers.cx, header->szlMicrometers.cy, header->bOpenGL,
|
|
|
|
debugstr_wn((LPCWSTR)((const BYTE *)header + header->offDescription), header->nDescription));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2008-04-17 12:15:43 +02:00
|
|
|
EMRCASE(EMR_POLYBEZIER);
|
2005-01-04 21:32:25 +01:00
|
|
|
EMRCASE(EMR_POLYGON);
|
|
|
|
EMRCASE(EMR_POLYLINE);
|
2008-04-17 12:15:43 +02:00
|
|
|
EMRCASE(EMR_POLYBEZIERTO);
|
|
|
|
EMRCASE(EMR_POLYLINETO);
|
|
|
|
EMRCASE(EMR_POLYPOLYLINE);
|
|
|
|
EMRCASE(EMR_POLYPOLYGON);
|
2005-01-04 21:32:25 +01:00
|
|
|
EMRCASE(EMR_SETWINDOWEXTEX);
|
|
|
|
EMRCASE(EMR_SETWINDOWORGEX);
|
|
|
|
EMRCASE(EMR_SETVIEWPORTEXTEX);
|
2008-04-17 12:15:43 +02:00
|
|
|
EMRCASE(EMR_SETVIEWPORTORGEX);
|
|
|
|
EMRCASE(EMR_SETBRUSHORGEX);
|
2005-01-04 21:32:25 +01:00
|
|
|
EMRCASE(EMR_EOF);
|
2008-04-17 12:15:43 +02:00
|
|
|
EMRCASE(EMR_SETPIXELV);
|
|
|
|
EMRCASE(EMR_SETMAPPERFLAGS);
|
2005-01-04 21:32:25 +01:00
|
|
|
EMRCASE(EMR_SETMAPMODE);
|
2008-04-17 12:15:43 +02:00
|
|
|
EMRCASE(EMR_SETBKMODE);
|
2005-01-04 21:32:25 +01:00
|
|
|
EMRCASE(EMR_SETPOLYFILLMODE);
|
|
|
|
EMRCASE(EMR_SETROP2);
|
2008-04-17 12:15:43 +02:00
|
|
|
EMRCASE(EMR_SETSTRETCHBLTMODE);
|
|
|
|
EMRCASE(EMR_SETTEXTALIGN);
|
|
|
|
EMRCASE(EMR_SETCOLORADJUSTMENT);
|
|
|
|
EMRCASE(EMR_SETTEXTCOLOR);
|
|
|
|
EMRCASE(EMR_SETBKCOLOR);
|
|
|
|
EMRCASE(EMR_OFFSETCLIPRGN);
|
|
|
|
EMRCASE(EMR_MOVETOEX);
|
|
|
|
EMRCASE(EMR_SETMETARGN);
|
|
|
|
EMRCASE(EMR_EXCLUDECLIPRECT);
|
2008-04-18 15:42:15 +02:00
|
|
|
|
|
|
|
case EMR_INTERSECTCLIPRECT:
|
|
|
|
{
|
2008-11-02 00:20:49 +01:00
|
|
|
const EMRINTERSECTCLIPRECT *clip = PRD(offset, sizeof(*clip));
|
2008-04-18 15:42:15 +02:00
|
|
|
|
|
|
|
printf("%-20s %08x\n", "EMR_INTERSECTCLIPRECT", length);
|
|
|
|
printf("rect %d,%d - %d, %d\n",
|
|
|
|
clip->rclClip.left, clip->rclClip.top,
|
|
|
|
clip->rclClip.right, clip->rclClip.bottom);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2008-04-17 12:15:43 +02:00
|
|
|
EMRCASE(EMR_SCALEVIEWPORTEXTEX);
|
2005-01-04 21:32:25 +01:00
|
|
|
EMRCASE(EMR_SCALEWINDOWEXTEX);
|
|
|
|
EMRCASE(EMR_SAVEDC);
|
2008-04-17 12:15:43 +02:00
|
|
|
EMRCASE(EMR_RESTOREDC);
|
|
|
|
EMRCASE(EMR_SETWORLDTRANSFORM);
|
|
|
|
EMRCASE(EMR_MODIFYWORLDTRANSFORM);
|
2005-01-04 21:32:25 +01:00
|
|
|
EMRCASE(EMR_SELECTOBJECT);
|
|
|
|
EMRCASE(EMR_CREATEPEN);
|
|
|
|
EMRCASE(EMR_CREATEBRUSHINDIRECT);
|
|
|
|
EMRCASE(EMR_DELETEOBJECT);
|
2008-04-17 12:15:43 +02:00
|
|
|
EMRCASE(EMR_ANGLEARC);
|
|
|
|
EMRCASE(EMR_ELLIPSE);
|
2005-01-04 21:32:25 +01:00
|
|
|
EMRCASE(EMR_RECTANGLE);
|
2008-04-17 12:15:43 +02:00
|
|
|
EMRCASE(EMR_ROUNDRECT);
|
|
|
|
EMRCASE(EMR_ARC);
|
|
|
|
EMRCASE(EMR_CHORD);
|
|
|
|
EMRCASE(EMR_PIE);
|
2005-01-04 21:32:25 +01:00
|
|
|
EMRCASE(EMR_SELECTPALETTE);
|
2008-04-17 12:15:43 +02:00
|
|
|
EMRCASE(EMR_CREATEPALETTE);
|
|
|
|
EMRCASE(EMR_SETPALETTEENTRIES);
|
|
|
|
EMRCASE(EMR_RESIZEPALETTE);
|
|
|
|
EMRCASE(EMR_REALIZEPALETTE);
|
|
|
|
EMRCASE(EMR_EXTFLOODFILL);
|
|
|
|
EMRCASE(EMR_LINETO);
|
|
|
|
EMRCASE(EMR_ARCTO);
|
|
|
|
EMRCASE(EMR_POLYDRAW);
|
|
|
|
EMRCASE(EMR_SETARCDIRECTION);
|
|
|
|
EMRCASE(EMR_SETMITERLIMIT);
|
|
|
|
EMRCASE(EMR_BEGINPATH);
|
|
|
|
EMRCASE(EMR_ENDPATH);
|
|
|
|
EMRCASE(EMR_CLOSEFIGURE);
|
|
|
|
EMRCASE(EMR_FILLPATH);
|
|
|
|
EMRCASE(EMR_STROKEANDFILLPATH);
|
|
|
|
EMRCASE(EMR_STROKEPATH);
|
|
|
|
EMRCASE(EMR_FLATTENPATH);
|
|
|
|
EMRCASE(EMR_WIDENPATH);
|
|
|
|
EMRCASE(EMR_SELECTCLIPPATH);
|
|
|
|
EMRCASE(EMR_ABORTPATH);
|
2017-06-30 18:03:38 +02:00
|
|
|
|
|
|
|
case EMR_GDICOMMENT:
|
|
|
|
{
|
|
|
|
printf("%-20s %08x\n", "EMR_GDICOMMENT", length);
|
|
|
|
|
|
|
|
/* Handle EMF+ records */
|
|
|
|
if (length >= 16 && !memcmp((char*)PRD(offset + 12, sizeof(unsigned int)), "EMF+", 4))
|
|
|
|
{
|
|
|
|
const EmfPlusRecordHeader *header;
|
|
|
|
const unsigned int *data_size;
|
|
|
|
|
|
|
|
offset += 8;
|
|
|
|
length -= 8;
|
|
|
|
data_size = PRD(offset, sizeof(*data_size));
|
|
|
|
printf("data size = %x\n", *data_size);
|
|
|
|
offset += 8;
|
|
|
|
length -= 8;
|
|
|
|
|
|
|
|
while (length >= sizeof(*header))
|
|
|
|
{
|
|
|
|
header = PRD(offset, sizeof(*header));
|
|
|
|
switch(header->Type)
|
|
|
|
{
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeInvalid);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeHeader);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeEndOfFile);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeComment);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeGetDC);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeMultiFormatStart);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeMultiFormatSection);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeMultiFormatEnd);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeObject);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeClear);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeFillRects);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeDrawRects);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeFillPolygon);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeDrawLines);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeFillEllipse);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeDrawEllipse);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeFillPie);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeDrawPie);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeDrawArc);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeFillRegion);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeFillPath);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeDrawPath);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeFillClosedCurve);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeDrawClosedCurve);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeDrawCurve);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeDrawBeziers);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeDrawImage);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeDrawImagePoints);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeDrawString);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeSetRenderingOrigin);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeSetAntiAliasMode);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeSetTextRenderingHint);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeSetTextContrast);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeSetInterpolationMode);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeSetPixelOffsetMode);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeSetCompositingMode);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeSetCompositingQuality);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeSave);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeRestore);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeBeginContainer);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeBeginContainerNoParams);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeEndContainer);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeSetWorldTransform);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeResetWorldTransform);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeMultiplyWorldTransform);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeTranslateWorldTransform);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeScaleWorldTransform);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeRotateWorldTransform);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeSetPageTransform);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeResetClip);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeSetClipRect);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeSetClipPath);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeSetClipRegion);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeOffsetClip);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeDrawDriverString);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeStrokeFillPath);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeSerializableObject);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeSetTSGraphics);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTypeSetTSClip);
|
|
|
|
EMRPLUSCASE(EmfPlusRecordTotal);
|
|
|
|
|
|
|
|
default:
|
|
|
|
printf(" unknown EMF+ record %x %04x %08x\n", header->Type, header->Flags, header->Size);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (length<sizeof(*header) || header->Size%4)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
length -= sizeof(*header);
|
|
|
|
offset += sizeof(*header);
|
|
|
|
|
|
|
|
for (i=0; i<header->Size-sizeof(*header); i+=4)
|
|
|
|
{
|
|
|
|
if (i%16 == 0)
|
|
|
|
printf(" ");
|
|
|
|
if (!(ptr = PRD(offset, 4))) return -1;
|
|
|
|
length -= 4;
|
|
|
|
offset += 4;
|
|
|
|
printf("%08x ", read_int(ptr));
|
|
|
|
if ((i % 16 == 12) || (i + 4 == header->Size - sizeof(*header)))
|
|
|
|
printf("\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2008-04-17 12:15:43 +02:00
|
|
|
EMRCASE(EMR_FILLRGN);
|
|
|
|
EMRCASE(EMR_FRAMERGN);
|
|
|
|
EMRCASE(EMR_INVERTRGN);
|
|
|
|
EMRCASE(EMR_PAINTRGN);
|
2008-04-18 15:42:15 +02:00
|
|
|
|
|
|
|
case EMR_EXTSELECTCLIPRGN:
|
|
|
|
{
|
2008-11-02 00:20:49 +01:00
|
|
|
const EMREXTSELECTCLIPRGN *clip = PRD(offset, sizeof(*clip));
|
2010-03-28 18:19:18 +02:00
|
|
|
const RGNDATA *data = (const RGNDATA *)clip->RgnData;
|
2008-04-18 15:42:15 +02:00
|
|
|
DWORD i, rc_count = 0;
|
2010-03-28 18:19:18 +02:00
|
|
|
const RECT *rc;
|
2008-04-18 15:42:15 +02:00
|
|
|
|
|
|
|
if (length >= sizeof(*clip) + sizeof(*data))
|
|
|
|
rc_count = data->rdh.nCount;
|
|
|
|
|
2017-06-30 18:03:38 +02:00
|
|
|
printf("%-20s %08x\n", "EMR_EXTSELECTCLIPRGN", length);
|
2008-04-18 15:42:15 +02:00
|
|
|
printf("mode %d, rects %d\n", clip->iMode, rc_count);
|
2010-03-28 18:19:18 +02:00
|
|
|
for (i = 0, rc = (const RECT *)data->Buffer; i < rc_count; i++, rc++)
|
2008-04-18 15:42:15 +02:00
|
|
|
printf(" (%d,%d)-(%d,%d)", rc->left, rc->top, rc->right, rc->bottom);
|
|
|
|
if (rc_count != 0) printf("\n");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2008-04-17 12:15:43 +02:00
|
|
|
EMRCASE(EMR_BITBLT);
|
2021-04-14 09:26:52 +02:00
|
|
|
|
|
|
|
case EMR_STRETCHBLT:
|
|
|
|
{
|
|
|
|
const EMRSTRETCHBLT *blt = PRD(offset, sizeof(*blt));
|
|
|
|
const BITMAPINFOHEADER *bmih = (const BITMAPINFOHEADER *)((const unsigned char *)blt + blt->offBmiSrc);
|
|
|
|
|
|
|
|
printf("%-20s %08x\n", "EMR_STRETCHBLT", length);
|
|
|
|
printf("bounds (%d,%d - %d,%d) dst %d,%d %dx%d src %d,%d %dx%d rop %#x xform (%f, %f, %f, %f, %f, %f)\n"
|
|
|
|
"bk_color %#x usage %#x bmi_offset %#x bmi_size %#x bits_offset %#x bits_size %#x\n",
|
|
|
|
blt->rclBounds.left, blt->rclBounds.top, blt->rclBounds.right, blt->rclBounds.bottom,
|
|
|
|
blt->xDest, blt->yDest, blt->cxDest, blt->cyDest,
|
|
|
|
blt->xSrc, blt->ySrc, blt->cxSrc, blt->cySrc, blt->dwRop,
|
|
|
|
blt->xformSrc.eM11, blt->xformSrc.eM12, blt->xformSrc.eM21,
|
|
|
|
blt->xformSrc.eM22, blt->xformSrc.eDx, blt->xformSrc.eDy,
|
|
|
|
blt->crBkColorSrc, blt->iUsageSrc, blt->offBmiSrc, blt->cbBmiSrc,
|
|
|
|
blt->offBitsSrc, blt->cbBitsSrc);
|
|
|
|
printf("BITMAPINFOHEADER biSize %#x biWidth %d biHeight %d biPlanes %d biBitCount %d biCompression %#x\n"
|
|
|
|
"biSizeImage %#x biXPelsPerMeter %d biYPelsPerMeter %d biClrUsed %#x biClrImportant %#x\n",
|
|
|
|
bmih->biSize, bmih->biWidth, bmih->biHeight, bmih->biPlanes, bmih->biBitCount,
|
|
|
|
bmih->biCompression, bmih->biSizeImage, bmih->biXPelsPerMeter, bmih->biYPelsPerMeter,
|
|
|
|
bmih->biClrUsed, bmih->biClrImportant);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2008-04-17 12:15:43 +02:00
|
|
|
EMRCASE(EMR_MASKBLT);
|
|
|
|
EMRCASE(EMR_PLGBLT);
|
|
|
|
EMRCASE(EMR_SETDIBITSTODEVICE);
|
|
|
|
EMRCASE(EMR_STRETCHDIBITS);
|
2008-04-17 14:11:16 +02:00
|
|
|
|
|
|
|
case EMR_EXTCREATEFONTINDIRECTW:
|
|
|
|
{
|
2008-11-02 00:20:49 +01:00
|
|
|
const EMREXTCREATEFONTINDIRECTW *pf = PRD(offset, sizeof(*pf));
|
2008-04-17 14:11:16 +02:00
|
|
|
const LOGFONTW *plf = &pf->elfw.elfLogFont;
|
|
|
|
|
|
|
|
printf("%-20s %08x\n", "EMR_EXTCREATEFONTINDIRECTW", length);
|
|
|
|
printf("(%d %d %d %d %x out %d clip %x quality %d charset %d) %s %s %s %s\n",
|
|
|
|
plf->lfHeight, plf->lfWidth,
|
|
|
|
plf->lfEscapement, plf->lfOrientation,
|
|
|
|
plf->lfPitchAndFamily,
|
|
|
|
plf->lfOutPrecision, plf->lfClipPrecision,
|
|
|
|
plf->lfQuality, plf->lfCharSet,
|
|
|
|
debugstr_wn(plf->lfFaceName, LF_FACESIZE),
|
|
|
|
plf->lfWeight > 400 ? "Bold" : "",
|
|
|
|
plf->lfItalic ? "Italic" : "",
|
|
|
|
plf->lfUnderline ? "Underline" : "");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2008-04-17 12:15:43 +02:00
|
|
|
EMRCASE(EMR_EXTTEXTOUTA);
|
2008-04-17 14:11:16 +02:00
|
|
|
|
|
|
|
case EMR_EXTTEXTOUTW:
|
|
|
|
{
|
2008-11-02 00:20:49 +01:00
|
|
|
const EMREXTTEXTOUTW *etoW = PRD(offset, sizeof(*etoW));
|
2021-05-17 11:09:27 +02:00
|
|
|
const int *dx = (const int *)((const BYTE *)etoW + etoW->emrtext.offDx);
|
2008-04-17 14:11:16 +02:00
|
|
|
|
|
|
|
printf("%-20s %08x\n", "EMR_EXTTEXTOUTW", length);
|
2021-03-24 09:10:21 +01:00
|
|
|
printf("bounds (%d,%d - %d,%d) mode %#x x_scale %f y_scale %f pt (%d,%d) rect (%d,%d - %d,%d) flags %#x, %s\n",
|
|
|
|
etoW->rclBounds.left, etoW->rclBounds.top, etoW->rclBounds.right, etoW->rclBounds.bottom,
|
|
|
|
etoW->iGraphicsMode, etoW->exScale, etoW->eyScale,
|
2008-04-17 14:11:16 +02:00
|
|
|
etoW->emrtext.ptlReference.x, etoW->emrtext.ptlReference.y,
|
|
|
|
etoW->emrtext.rcl.left, etoW->emrtext.rcl.top,
|
|
|
|
etoW->emrtext.rcl.right, etoW->emrtext.rcl.bottom,
|
|
|
|
etoW->emrtext.fOptions,
|
|
|
|
debugstr_wn((LPCWSTR)((const BYTE *)etoW + etoW->emrtext.offString), etoW->emrtext.nChars));
|
2021-05-17 11:09:27 +02:00
|
|
|
printf("dx_offset %u {", etoW->emrtext.offDx);
|
|
|
|
for (i = 0; i < etoW->emrtext.nChars; ++i)
|
|
|
|
{
|
|
|
|
printf("%d", dx[i]);
|
|
|
|
if (i != etoW->emrtext.nChars - 1)
|
|
|
|
putchar(',');
|
|
|
|
}
|
|
|
|
printf("}\n");
|
2008-04-17 14:11:16 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2008-04-17 12:15:43 +02:00
|
|
|
EMRCASE(EMR_POLYBEZIER16);
|
2005-01-04 21:32:25 +01:00
|
|
|
EMRCASE(EMR_POLYGON16);
|
|
|
|
EMRCASE(EMR_POLYLINE16);
|
2008-04-17 12:15:43 +02:00
|
|
|
EMRCASE(EMR_POLYBEZIERTO16);
|
|
|
|
EMRCASE(EMR_POLYLINETO16);
|
|
|
|
EMRCASE(EMR_POLYPOLYLINE16);
|
|
|
|
EMRCASE(EMR_POLYPOLYGON16);
|
|
|
|
EMRCASE(EMR_POLYDRAW16);
|
|
|
|
EMRCASE(EMR_CREATEMONOBRUSH);
|
|
|
|
EMRCASE(EMR_CREATEDIBPATTERNBRUSHPT);
|
|
|
|
EMRCASE(EMR_EXTCREATEPEN);
|
|
|
|
EMRCASE(EMR_POLYTEXTOUTA);
|
|
|
|
EMRCASE(EMR_POLYTEXTOUTW);
|
|
|
|
EMRCASE(EMR_SETICMMODE);
|
|
|
|
EMRCASE(EMR_CREATECOLORSPACE);
|
|
|
|
EMRCASE(EMR_SETCOLORSPACE);
|
|
|
|
EMRCASE(EMR_DELETECOLORSPACE);
|
|
|
|
EMRCASE(EMR_GLSRECORD);
|
|
|
|
EMRCASE(EMR_GLSBOUNDEDRECORD);
|
|
|
|
EMRCASE(EMR_PIXELFORMAT);
|
|
|
|
EMRCASE(EMR_DRAWESCAPE);
|
|
|
|
EMRCASE(EMR_EXTESCAPE);
|
|
|
|
EMRCASE(EMR_STARTDOC);
|
|
|
|
EMRCASE(EMR_SMALLTEXTOUT);
|
|
|
|
EMRCASE(EMR_FORCEUFIMAPPING);
|
|
|
|
EMRCASE(EMR_NAMEDESCAPE);
|
|
|
|
EMRCASE(EMR_COLORCORRECTPALETTE);
|
|
|
|
EMRCASE(EMR_SETICMPROFILEA);
|
|
|
|
EMRCASE(EMR_SETICMPROFILEW);
|
2021-04-14 09:26:40 +02:00
|
|
|
|
|
|
|
case EMR_ALPHABLEND:
|
|
|
|
{
|
|
|
|
const EMRALPHABLEND *blend = PRD(offset, sizeof(*blend));
|
|
|
|
const BITMAPINFOHEADER *bmih = (const BITMAPINFOHEADER *)((const unsigned char *)blend + blend->offBmiSrc);
|
|
|
|
|
|
|
|
printf("%-20s %08x\n", "EMR_ALPHABLEND", length);
|
|
|
|
printf("bounds (%d,%d - %d,%d) dst %d,%d %dx%d src %d,%d %dx%d rop %#x xform (%f, %f, %f, %f, %f, %f)\n"
|
|
|
|
"bk_color %#x usage %#x bmi_offset %#x bmi_size %#x bits_offset %#x bits_size %#x\n",
|
|
|
|
blend->rclBounds.left, blend->rclBounds.top, blend->rclBounds.right, blend->rclBounds.bottom,
|
|
|
|
blend->xDest, blend->yDest, blend->cxDest, blend->cyDest,
|
|
|
|
blend->xSrc, blend->ySrc, blend->cxSrc, blend->cySrc, blend->dwRop,
|
|
|
|
blend->xformSrc.eM11, blend->xformSrc.eM12, blend->xformSrc.eM21,
|
|
|
|
blend->xformSrc.eM22, blend->xformSrc.eDx, blend->xformSrc.eDy,
|
|
|
|
blend->crBkColorSrc, blend->iUsageSrc, blend->offBmiSrc, blend->cbBmiSrc,
|
|
|
|
blend->offBitsSrc, blend->cbBitsSrc);
|
|
|
|
printf("BITMAPINFOHEADER biSize %#x biWidth %d biHeight %d biPlanes %d biBitCount %d biCompression %#x\n"
|
|
|
|
"biSizeImage %#x biXPelsPerMeter %d biYPelsPerMeter %d biClrUsed %#x biClrImportant %#x\n",
|
|
|
|
bmih->biSize, bmih->biWidth, bmih->biHeight, bmih->biPlanes, bmih->biBitCount,
|
|
|
|
bmih->biCompression, bmih->biSizeImage, bmih->biXPelsPerMeter, bmih->biYPelsPerMeter,
|
|
|
|
bmih->biClrUsed, bmih->biClrImportant);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2008-04-17 12:15:43 +02:00
|
|
|
EMRCASE(EMR_SETLAYOUT);
|
|
|
|
EMRCASE(EMR_TRANSPARENTBLT);
|
|
|
|
EMRCASE(EMR_RESERVED_117);
|
|
|
|
EMRCASE(EMR_GRADIENTFILL);
|
|
|
|
EMRCASE(EMR_SETLINKEDUFI);
|
|
|
|
EMRCASE(EMR_SETTEXTJUSTIFICATION);
|
|
|
|
EMRCASE(EMR_COLORMATCHTOTARGETW);
|
|
|
|
EMRCASE(EMR_CREATECOLORSPACEW);
|
2005-01-04 21:32:25 +01:00
|
|
|
|
|
|
|
default:
|
2008-04-17 12:15:43 +02:00
|
|
|
printf("%u %08x\n", type, length);
|
2005-01-04 21:32:25 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( (length < 8) || (length % 4) )
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
length -= 8;
|
|
|
|
|
2006-11-29 21:40:21 +01:00
|
|
|
offset += 8;
|
|
|
|
|
2005-01-04 21:32:25 +01:00
|
|
|
for(i=0; i<length; i+=4)
|
|
|
|
{
|
|
|
|
if (i%16 == 0)
|
|
|
|
printf(" ");
|
2006-11-29 21:40:21 +01:00
|
|
|
if (!(ptr = PRD(offset, 4))) return -1;
|
|
|
|
offset += 4;
|
|
|
|
printf("%08x ", read_int(ptr));
|
|
|
|
if ( (i % 16 == 12) || (i + 4 == length))
|
2005-01-04 21:32:25 +01:00
|
|
|
printf("\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2006-11-29 21:40:21 +01:00
|
|
|
enum FileSig get_kind_emf(void)
|
2005-01-04 21:32:25 +01:00
|
|
|
{
|
2006-11-29 21:40:21 +01:00
|
|
|
const ENHMETAHEADER* hdr;
|
|
|
|
|
|
|
|
hdr = PRD(0, sizeof(*hdr));
|
|
|
|
if (hdr && hdr->iType == EMR_HEADER && hdr->dSignature == ENHMETA_SIGNATURE)
|
|
|
|
return SIG_EMF;
|
|
|
|
return SIG_UNKNOWN;
|
2005-01-04 21:32:25 +01:00
|
|
|
}
|
|
|
|
|
2006-11-29 21:40:21 +01:00
|
|
|
void emf_dump(void)
|
2005-01-04 21:32:25 +01:00
|
|
|
{
|
2006-11-29 21:40:21 +01:00
|
|
|
offset = 0;
|
|
|
|
while (!dump_emfrecord());
|
2005-01-04 21:32:25 +01:00
|
|
|
}
|