32 #include <libEMF/emf.h>
34 #include <libEMF/wine/w16.h>
41 #define EMF_UNUSED(x) (void)x;
49 const int XMAX_PIXELS = 1024;
51 const int XMAX_PIXELS = 1280;
58 const int YMAX_PIXELS = 768;
60 const int YMAX_PIXELS = 1024;
67 const int XMAX_MM = 320;
73 const int YMAX_MM = 240;
77 const int RESOLUTION = 96;
81 static inline int ROUND_TO_LONG (
int n ) {
return ((n+3)/4)*4; }
97 WCHARSTR ( WCHAR *
const string,
const int length )
115 CHARSTR ( CHAR *
const string,
const int length )
226 static bool bigEndian (
void );
233 DATASTREAM ( ::FILE* fp = 0 ) : swap_( bigEndian() ), fp_( fp ) {}
245 fwrite( &
byte,
sizeof(BYTE), 1, fp_ );
254 fread( &
byte,
sizeof(BYTE), 1, fp_ );
264 unsigned char const * p = (
unsigned char const*)&word;
265 fwrite( &p[1],
sizeof(
unsigned char), 1, fp_ );
266 fwrite( &p[0],
sizeof(
unsigned char), 1, fp_ );
269 fwrite( &word,
sizeof(WORD), 1, fp_ );
279 unsigned char* p = (
unsigned char*)&word;
280 fread( &p[1],
sizeof(
unsigned char), 1, fp_ );
281 fread( &p[0],
sizeof(
unsigned char), 1, fp_ );
284 fread( &word,
sizeof(WORD), 1, fp_ );
294 unsigned char const * p = (
unsigned char const*)&word;
295 fwrite( &p[1],
sizeof(
unsigned char), 1, fp_ );
296 fwrite( &p[0],
sizeof(
unsigned char), 1, fp_ );
299 fwrite( &word,
sizeof(INT16), 1, fp_ );
309 unsigned char* p = (
unsigned char*)&word;
310 fread( &p[1],
sizeof(
unsigned char), 1, fp_ );
311 fread( &p[0],
sizeof(
unsigned char), 1, fp_ );
314 fread( &word,
sizeof(INT16), 1, fp_ );
324 unsigned char const* p = (
unsigned char const*)&dword;
325 fwrite( &p[3],
sizeof(
unsigned char), 1, fp_ );
326 fwrite( &p[2],
sizeof(
unsigned char), 1, fp_ );
327 fwrite( &p[1],
sizeof(
unsigned char), 1, fp_ );
328 fwrite( &p[0],
sizeof(
unsigned char), 1, fp_ );
331 fwrite( &dword,
sizeof(DWORD), 1, fp_ );
341 unsigned char* p = (
unsigned char*)&dword;
342 fread( &p[3],
sizeof(
unsigned char), 1, fp_ );
343 fread( &p[2],
sizeof(
unsigned char), 1, fp_ );
344 fread( &p[1],
sizeof(
unsigned char), 1, fp_ );
345 fread( &p[0],
sizeof(
unsigned char), 1, fp_ );
348 fread( &dword,
sizeof(DWORD), 1, fp_ );
351 #if !defined( __LP64__ )
359 unsigned char const* p = (
unsigned char const*)&long_;
360 fwrite( &p[3],
sizeof(
unsigned char), 1, fp_ );
361 fwrite( &p[2],
sizeof(
unsigned char), 1, fp_ );
362 fwrite( &p[1],
sizeof(
unsigned char), 1, fp_ );
363 fwrite( &p[0],
sizeof(
unsigned char), 1, fp_ );
366 fwrite( &long_,
sizeof(LONG), 1, fp_ );
376 unsigned char* p = (
unsigned char*)&long_;
377 fread( &p[3],
sizeof(
unsigned char), 1, fp_ );
378 fread( &p[2],
sizeof(
unsigned char), 1, fp_ );
379 fread( &p[1],
sizeof(
unsigned char), 1, fp_ );
380 fread( &p[0],
sizeof(
unsigned char), 1, fp_ );
383 fread( &long_,
sizeof(LONG), 1, fp_ );
394 unsigned char const* p = (
unsigned char const*)&int_;
395 fwrite( &p[3],
sizeof(
unsigned char), 1, fp_ );
396 fwrite( &p[2],
sizeof(
unsigned char), 1, fp_ );
397 fwrite( &p[1],
sizeof(
unsigned char), 1, fp_ );
398 fwrite( &p[0],
sizeof(
unsigned char), 1, fp_ );
401 fwrite( &int_,
sizeof(INT), 1, fp_ );
411 unsigned char* p = (
unsigned char*)&int_;
412 fread( &p[3],
sizeof(
unsigned char), 1, fp_ );
413 fread( &p[2],
sizeof(
unsigned char), 1, fp_ );
414 fread( &p[1],
sizeof(
unsigned char), 1, fp_ );
415 fread( &p[0],
sizeof(
unsigned char), 1, fp_ );
418 fread( &int_,
sizeof(INT), 1, fp_ );
421 #if !defined(__LP64__)
429 unsigned char const* p = (
unsigned char const*)&uint;
430 fwrite( &p[3],
sizeof(
unsigned char), 1, fp_ );
431 fwrite( &p[2],
sizeof(
unsigned char), 1, fp_ );
432 fwrite( &p[1],
sizeof(
unsigned char), 1, fp_ );
433 fwrite( &p[0],
sizeof(
unsigned char), 1, fp_ );
436 fwrite( &uint,
sizeof(UINT), 1, fp_ );
446 unsigned char* p = (
unsigned char*)&uint;
447 fread( &p[3],
sizeof(
unsigned char), 1, fp_ );
448 fread( &p[2],
sizeof(
unsigned char), 1, fp_ );
449 fread( &p[1],
sizeof(
unsigned char), 1, fp_ );
450 fread( &p[0],
sizeof(
unsigned char), 1, fp_ );
453 fread( &uint,
sizeof(UINT), 1, fp_ );
464 unsigned char const* p = (
unsigned char const*)&float_;
465 fwrite( &p[3],
sizeof(
unsigned char), 1, fp_ );
466 fwrite( &p[2],
sizeof(
unsigned char), 1, fp_ );
467 fwrite( &p[1],
sizeof(
unsigned char), 1, fp_ );
468 fwrite( &p[0],
sizeof(
unsigned char), 1, fp_ );
471 fwrite( &float_,
sizeof(FLOAT), 1, fp_ );
481 unsigned char* p = (
unsigned char*)&float_;
482 fread( &p[3],
sizeof(
unsigned char), 1, fp_ );
483 fread( &p[2],
sizeof(
unsigned char), 1, fp_ );
484 fread( &p[1],
sizeof(
unsigned char), 1, fp_ );
485 fread( &p[0],
sizeof(
unsigned char), 1, fp_ );
488 fread( &float_,
sizeof(FLOAT), 1, fp_ );
497 if ( padding.
size_ != 0 )
498 fwrite( &padding.
padding_,
sizeof(CHAR), padding.
size_, fp_ );
507 *
this << rectl.left << rectl.top << rectl.right << rectl.bottom;
516 *
this >> rectl.left >> rectl.top >> rectl.right >> rectl.bottom;
525 *
this << sizel.cx << sizel.cy;
534 *
this >> sizel.cx >> sizel.cy;
543 for (
int i = 0; i < wcharstr.
length_; i++ )
553 for (
int i = 0; i < wcharstr.
length_; i++ )
581 *
this << emr.iType << emr.nSize;
590 *
this >> emr.iType >> emr.nSize;
599 *
this << point.x << point.y;
608 *
this >> point.x >> point.y;
617 *
this << pointl.x << pointl.y;
626 *
this >> pointl.x >> pointl.y;
635 *
this << point.x << point.y;
644 *
this >> point.x >> point.y;
653 *
this << xform.eM11 << xform.eM12 << xform.eM21 << xform.eM22
654 << xform.eDx << xform.eDy;
663 *
this >> xform.eM11 >> xform.eM12 >> xform.eM21 >> xform.eM22
664 >> xform.eDx >> xform.eDy;
673 fwrite( array.
array_,
sizeof(BYTE), array.
n_, fp_ );
682 fread( array.
array_,
sizeof(BYTE), array.
n_, fp_ );
691 for (
unsigned int i = 0; i < array.
n_; i++ )
701 for (
unsigned int i = 0; i < array.
n_; i++ )
711 for (
unsigned int i = 0; i < array.
n_; i++ )
721 for (
unsigned int i = 0; i < array.
n_; i++ )
731 for (
unsigned int i = 0; i < array.
n_; i++ )
732 *
this << array.
ints_[i];
741 for (
unsigned int i = 0; i < array.
n_; i++ )
742 *
this >> array.
ints_[i];
751 for (
unsigned int i = 0; i < array.
n_; i++ )
761 for (
unsigned int i = 0; i < array.
n_; i++ )
771 *
this << text.ptlReference << text.nChars << text.offString << text.fOptions
772 << text.rcl << text.offDx;
781 *
this >> text.ptlReference >> text.nChars >> text.offString >> text.fOptions
782 >> text.rcl >> text.offDx;
791 *
this << pen.lopnStyle << pen.lopnWidth << pen.lopnColor;
800 *
this >> pen.lopnStyle >> pen.lopnWidth >> pen.lopnColor;
810 *
this << pen.elpPenStyle << pen.elpWidth << pen.elpBrushStyle << pen.elpColor
811 << pen.elpHatch << pen.elpNumEntries;
821 *
this >> pen.elpPenStyle >> pen.elpWidth >> pen.elpBrushStyle >> pen.elpColor
822 >> pen.elpHatch >> pen.elpNumEntries;
831 *
this << brush.lbStyle << brush.lbColor << brush.lbHatch;
840 *
this >> brush.lbStyle >> brush.lbColor >> brush.lbHatch;
849 *
this << font.lfHeight << font.lfWidth << font.lfEscapement
850 << font.lfOrientation << font.lfWeight << font.lfItalic
851 << font.lfUnderline << font.lfStrikeOut << font.lfCharSet
852 << font.lfOutPrecision << font.lfClipPrecision << font.lfQuality
853 << font.lfPitchAndFamily
854 <<
WCHARSTR(
const_cast<WCHAR*const
>(font.lfFaceName), LF_FACESIZE );
863 WCHARSTR wFaceName( font.lfFaceName, LF_FACESIZE );
865 *
this >> font.lfHeight >> font.lfWidth >> font.lfEscapement
866 >> font.lfOrientation >> font.lfWeight >> font.lfItalic
867 >> font.lfUnderline >> font.lfStrikeOut >> font.lfCharSet
868 >> font.lfOutPrecision >> font.lfClipPrecision >> font.lfQuality
869 >> font.lfPitchAndFamily
879 fwrite( &panose,
sizeof(PANOSE), 1, fp_ );
888 fread( &panose,
sizeof(PANOSE), 1, fp_ );
897 *
this << font.elfLogFont
898 <<
WCHARSTR(
const_cast<WCHAR*const
>(font.elfFullName),
900 <<
WCHARSTR(
const_cast<WCHAR*const
>(font.elfStyle), LF_FACESIZE )
901 << font.elfVersion << font.elfStyleSize << font.elfMatch
903 <<
BYTEARRAY(
const_cast<BYTE*const
>(font.elfVendorId),
905 << font.elfCulture << font.elfPanose;
914 WCHARSTR wFullName( font.elfFullName, LF_FULLFACESIZE );
915 WCHARSTR wStyle( font.elfStyle, LF_FACESIZE );
916 BYTEARRAY bVendorId( font.elfVendorId, ELF_VENDOR_SIZE );
917 *
this >> font.elfLogFont
918 >> wFullName >> wStyle
919 >> font.elfVersion >> font.elfStyleSize >> font.elfMatch
920 >> font.elfReserved >> bVendorId
921 >> font.elfCulture >> font.elfPanose;
931 *
this << palette.palVersion << palette.palNumEntries;
941 *
this >> palette.palVersion >> palette.palNumEntries;
954 void fread (
void* ptr,
size_t size,
size_t nmemb, FILE* stream )
956 size_t res = ::fread( ptr, size, nmemb, stream );
958 throw std::runtime_error(
"error reading EMF stream" );
970 void fwrite (
const void* ptr,
size_t size,
size_t nmemb, FILE* stream )
972 size_t res = ::fwrite( ptr, size, nmemb, stream );
974 throw std::runtime_error(
"error writing EMF stream" );
979 class METAFILEDEVICECONTEXT;
1009 virtual int size (
void )
const = 0;
1016 #ifdef ENABLE_EDITING
1021 virtual void edit (
void )
const {}
1025 #ifdef ENABLE_EDITING
1027 inline void edit_rectl (
const char* tag,
const RECTL& rectl )
1029 #if defined(__LP64__)
1030 const char* FMT =
"\t%s\t: (%d, %d) - (%d, %d)\n";
1032 const char* FMT =
"\t%s\t: (%ld, %ld) - (%ld, %ld)\n";
1034 printf( FMT, tag, rectl.left, rectl.top, rectl.right, rectl.bottom );
1037 inline void edit_xform (
const char* tag,
const XFORM& xform )
1039 printf(
"\t%s.eM11\t: %f\n", tag, xform.eM11 );
1040 printf(
"\t%s.eM12\t: %f\n", tag, xform.eM12 );
1041 printf(
"\t%s.eM21\t: %f\n", tag, xform.eM21 );
1042 printf(
"\t%s.eM22\t: %f\n", tag, xform.eM22 );
1043 printf(
"\t%s.eDx\t: %f\n", tag, xform.eDx );
1044 printf(
"\t%s.eDy\t: %f\n", tag, xform.eDy );
1047 inline void edit_color (
const char* tag,
const COLORREF& color )
1049 #if defined(__LP64__)
1050 const char* FMT =
"\t%s\t: R(0x%02x) G(0x%02x) B(0x%02x)\n";
1052 const char* FMT =
"\t%s\t: R(0x%02lx) G(0x%02lx) B(0x%02lx)\n";
1055 GetRValue( color ), GetGValue( color ), GetBValue( color ) );
1058 inline void edit_sizel (
const char* tag,
const SIZEL& size )
1060 #if defined(__LP64__)
1061 const char* FMT =
"\t%s\t: (%d, %d)\n";
1063 const char* FMT =
"\t%s\t: (%ld, %ld)\n";
1065 printf( FMT, tag, size.cx, size.cy );
1068 inline void edit_pointl (
const char* tag,
const POINTL& point )
1070 #if defined(__LP64__)
1071 const char* FMT =
"\t%s\t: (%d, %d)\n";
1073 const char* FMT =
"\t%s\t: (%ld, %ld)\n";
1075 printf( FMT, tag, point.x, point.y );
1078 inline void edit_pointlarray (
const char* tag,
const DWORD cptl,
1079 const POINTL* points )
1081 #if defined(__LP64__)
1082 const char* FMT0 =
"\tcptl%s\t: %d\n";
1083 const char* FMT1 =
"%d, %d\n";
1084 const char* FMT2 =
"\t\t%s %d, %d\n";
1086 const char* FMT0 =
"\tcptl%s\t: %ld\n";
1087 const char* FMT1 =
"%ld, %ld\n";
1088 const char* FMT2 =
"\t\t%s %ld, %ld\n";
1090 printf( FMT0, tag, cptl );
1091 printf(
"\taptl%s\t: ", tag );
1093 printf( FMT1, points[0].x, points[0].y );
1096 for ( DWORD i = 1; i < cptl; i++ )
1097 printf( FMT2, tag, points[i].x, points[i].y );
1100 inline void edit_point16array (
const char* tag,
const unsigned int cpts,
1101 const POINT16* points )
1103 printf(
"\tcpts%s\t: %d\n", tag, cpts );
1104 printf(
"\tapts%s\t: ", tag );
1106 printf(
"%d, %d\n", points[0].x, points[0].y );
1109 for (
unsigned int i = 1; i < cpts; i++ )
1110 printf(
"\t\t%s %d, %d\n", tag, points[i].x, points[i].y );
1113 inline void edit_pen_style (
const char* tag, DWORD style )
1115 printf(
"\t%s\t: ", tag );
1116 switch ( style & PS_STYLE_MASK ) {
1117 case PS_SOLID: printf(
"PS_SOLID" );
break;
1118 case PS_DASH: printf(
"PS_DASH" );
break;
1119 case PS_DOT: printf(
"PS_DOT" );
break;
1120 case PS_DASHDOT: printf(
"PS_DASHDOT" );
break;
1121 case PS_DASHDOTDOT: printf(
"PS_DASHDOTDOT" );
break;
1122 case PS_NULL: printf(
"PS_NULL" );
break;
1123 case PS_INSIDEFRAME: printf(
"PS_INSIDEFRAME" );
break;
1124 case PS_USERSTYLE: printf(
"PS_USERSTYLE" );
break;
1125 case PS_ALTERNATE: printf(
"PS_ALTERNATE" );
break;
1127 switch ( style & PS_ENDCAP_MASK ) {
1128 case PS_ENDCAP_ROUND: printf(
" | PS_ENDCAP_ROUND" );
break;
1129 case PS_ENDCAP_SQUARE: printf(
" | PS_ENDCAP_SQUARE" );
break;
1130 case PS_ENDCAP_FLAT: printf(
" | PS_ENDCAP_FLAT" );
break;
1132 switch ( style & PS_JOIN_MASK ) {
1133 case PS_JOIN_ROUND: printf(
" | PS_JOIN_ROUND" );
break;
1134 case PS_JOIN_BEVEL: printf(
" | PS_JOIN_BEVEL" );
break;
1135 case PS_JOIN_MITER: printf(
" | PS_JOIN_MITER" );
break;
1137 switch ( style & PS_TYPE_MASK ) {
1138 case PS_COSMETIC: printf(
" | PS_COSMETIC" );
break;
1139 case PS_GEOMETRIC: printf(
" | PS_GEOMETRIC" );
break;
1144 inline void edit_brush_style (
const char* tag, DWORD style )
1146 #if defined(__LP64__)
1147 const char* FMT =
"unknown(%d)";
1149 const char* FMT =
"unknown(%ld)";
1151 printf(
"\t%s\t: ", tag );
1153 case BS_SOLID: printf(
"BS_SOLID" );
break;
1154 case BS_NULL: printf(
"BS_NULL" );
break;
1155 case BS_HATCHED: printf(
"BS_HATCHED" );
break;
1156 case BS_PATTERN: printf(
"BS_PATTERN" );
break;
1157 case BS_INDEXED: printf(
"BS_INDEXED" );
break;
1158 case BS_DIBPATTERN: printf(
"BS_DIBPATTERN" );
break;
1159 case BS_DIBPATTERNPT: printf(
"BS_DIBPATTERNPT" );
break;
1160 case BS_PATTERN8X8: printf(
"BS_PATTERN8X8" );
break;
1161 case BS_DIBPATTERN8X8: printf(
"BS_DIBPATTERN8X8" );
break;
1162 case BS_MONOPATTERN: printf(
"BS_DIBPATTERN8X8" );
break;
1163 default: printf( FMT, style );
1168 inline void edit_brush_hatch (
const char* tag, DWORD hatch )
1170 #if defined(__LP64__)
1171 const char* FMT =
"unknown(%d)";
1173 const char* FMT =
"unknown(%ld)";
1175 printf(
"\t%s\t: ", tag );
1177 case HS_HORIZONTAL: printf(
"HS_HORIZONTAL" );
break;
1178 case HS_VERTICAL: printf(
"HS_VERTICAL" );
break;
1179 case HS_FDIAGONAL: printf(
"HS_FDIAGONAL" );
break;
1180 case HS_BDIAGONAL: printf(
"HS_BDIAGONAL" );
break;
1181 case HS_CROSS: printf(
"HS_CROSS" );
break;
1182 case HS_DIAGCROSS: printf(
"HS_DIAGCROSS" );
break;
1183 default: printf( FMT, hatch );
1195 enum OBJECTTYPE { O_METAFILEDEVICECONTEXT = OBJ_METADC,
1198 O_EXTPEN = OBJ_EXTPEN,
1199 O_BRUSH = OBJ_BRUSH,
1200 O_PALETTE = OBJ_PAL };
1205 static char* typStr ( OBJECTTYPE type )
1208 case O_METAFILEDEVICECONTEXT:
1209 return "metafile device context";
1215 return "extended pen";
1221 return "unknown object";
1243 virtual OBJECTTYPE
getType (
void )
const = 0;
1279 std::vector<OBJECT*> objects;
1287 std::map< DWORD, METARECORDCTOR > new_records;
1299 std::vector<EMF::OBJECT*>::const_iterator
begin (
void )
const
1300 {
return objects.begin(); }
1304 std::vector<EMF::OBJECT*>::const_iterator
end (
void )
const
1305 {
return objects.end(); }
1307 METARECORDCTOR
newRecord ( DWORD iType )
const;
1415 extern GLOBALOBJECTS globalObjects;
1426 LPWSTR description_w;
1427 int description_size;
1437 : description_w( 0 ), description_size( 0 )
1443 RECTL default_bounds = { 0, 0, 0, 0 };
1444 rclBounds = default_bounds;
1445 RECTL default_frame = { 0, 0, 0, 0 };
1446 rclFrame = default_frame;
1447 dSignature = ENHMETA_SIGNATURE;
1456 szlDevice.cx = XMAX_PIXELS;
1457 szlDevice.cy = YMAX_PIXELS;
1458 szlMillimeters.cx = XMAX_MM;
1459 szlMillimeters.cy = YMAX_MM;
1466 szlMicrometers.cx = 1000 * szlMillimeters.cx;
1467 szlMicrometers.cy = 1000 * szlMillimeters.cy;
1469 if ( description ) {
1471 int description_count = 0, nulls = 0;
1472 LPCWSTR description_p = description;
1473 while ( nulls < 3 ) {
1474 description_count++;
1475 if ( (*description_p++) == 0 ) nulls++;
1480 int record_size = ROUND_TO_LONG(
sizeof( ::
ENHMETAHEADER ) +
1481 sizeof( WCHAR ) * description_count );
1485 description_w =
new WCHAR[ description_size ];
1487 memset( description_w, 0,
sizeof(WCHAR) * description_size );
1489 for (
int i=0; i<description_count; i++ )
1490 description_w[i] = *description++;
1492 nSize = nBytes = record_size;
1493 nDescription = description_count;
1503 if ( description_w )
delete[] description_w;
1511 ds << iType << nSize
1512 << rclBounds << rclFrame
1513 << dSignature << nVersion << nBytes << nRecords << nHandles << sReserved
1514 << nDescription << offDescription << nPalEntries
1515 << szlDevice << szlMillimeters
1516 << cbPixelFormat << offPixelFormat << bOpenGL
1520 <<
WCHARSTR( description_w, description_size );
1528 ds >> iType >> nSize
1529 >> rclBounds >> rclFrame
1530 >> dSignature >> nVersion >> nBytes >> nRecords >> nHandles >> sReserved
1531 >> nDescription >> offDescription >> nPalEntries
1532 >> szlDevice >> szlMillimeters;
1536 #define OffsetOf( a, b ) ((unsigned int)(((char*)&(((::ENHMETAHEADER*)a)->b)) - \
1537 (char*)((::ENHMETAHEADER*)a)))
1539 if ( OffsetOf(
this, szlMicrometers ) <= offDescription )
1540 ds >> cbPixelFormat >> offPixelFormat >> bOpenGL;
1543 ds >> cbPixelFormat >> offPixelFormat >> bOpenGL;
1548 ds >> szlMicrometers;
1552 description_size = ( nSize - offDescription ) /
sizeof(WCHAR);
1553 description_w =
new WCHAR[ description_size ];
1555 WCHARSTR description( description_w, description_size );
1564 int size (
void )
const {
return nSize; }
1576 #ifdef ENABLE_EDITING
1580 void edit (
void )
const
1582 #if defined(__LP64__)
1583 const char* FMT0 =
"\tiType\t\t\t: %d\n";
1584 const char* FMT1 =
"\tnSize\t\t\t: %d\n";
1585 const char* FMT2 =
"\tnBytes\t\t\t: %d\n";
1586 const char* FMT3 =
"\tnRecords\t\t: %d\n";
1587 const char* FMT4 =
"\tnDescription\t\t: %d\n";
1588 const char* FMT5 =
"\toffDescription\t\t: %d\n";
1589 const char* FMT6 =
"\tnPalEntries\t\t: %d\n";
1590 const char* FMT7 =
"\tcbPixelFormat\t\t: %d\n";
1591 const char* FMT8 =
"\toffPixelFormat\t\t: %d\n";
1592 const char* FMT9 =
"\tbOpenGL\t\t\t: %d\n";
1594 const char* FMT0 =
"\tiType\t\t\t: %ld\n";
1595 const char* FMT1 =
"\tnSize\t\t\t: %ld\n";
1596 const char* FMT2 =
"\tnBytes\t\t\t: %ld\n";
1597 const char* FMT3 =
"\tnRecords\t\t: %ld\n";
1598 const char* FMT4 =
"\tnDescription\t\t: %ld\n";
1599 const char* FMT5 =
"\toffDescription\t\t: %ld\n";
1600 const char* FMT6 =
"\tnPalEntries\t\t: %ld\n";
1601 const char* FMT7 =
"\tcbPixelFormat\t\t: %ld\n";
1602 const char* FMT8 =
"\toffPixelFormat\t\t: %ld\n";
1603 const char* FMT9 =
"\tbOpenGL\t\t\t: %ld\n";
1605 printf(
"*HEADER*\n" );
1606 printf( FMT0, iType );
1607 printf( FMT1, nSize );
1608 edit_rectl(
"rclBounds\t", rclBounds );
1609 edit_rectl(
"rclFrame\t", rclFrame );
1610 printf(
"\tdSignature\t\t: %.4s\n", (
const char*)&dSignature );
1611 printf(
"\tnVersion\t\t: 0x%x\n", (
unsigned int)nVersion );
1612 printf( FMT2, nBytes );
1613 printf( FMT3, nRecords );
1614 printf(
"\tnHandles\t\t: %d\n", nHandles );
1615 printf( FMT4, nDescription );
1616 printf( FMT5, offDescription );
1617 printf( FMT6, nPalEntries );
1618 edit_sizel(
"szlDevice\t", szlDevice );
1619 edit_sizel(
"szlMillimeters\t", szlMillimeters );
1622 #define OffsetOf( a, b ) ((unsigned int)(((const char*)&(((const ::ENHMETAHEADER*)a)->b)) - \
1623 (const char*)((const ::ENHMETAHEADER*)a)))
1625 if ( OffsetOf(
this, cbPixelFormat ) <= offDescription ) {
1626 printf( FMT7, cbPixelFormat );
1627 printf( FMT8, offPixelFormat );
1628 printf( FMT9, bOpenGL );
1631 edit_sizel(
"szlMicrometers\t", szlMicrometers );
1638 if ( nDescription != 0 ) {
1641 WCHAR* description = description_w;
1643 printf(
"\tDescription:" );
1645 for ( DWORD i = 0; i < nDescription; i++ ) {
1647 wchar_t w = *description++;
1651 if ( last_w == 0 ) printf(
"\n\t\t" );
1676 emr.iType = EMR_EOF;
1689 ds >> emr >> nPalEntries >> offPalEntries >> nSizeLast;
1697 ds << emr << nPalEntries << offPalEntries << nSizeLast;
1703 int size (
void )
const {
return emr.nSize; }
1715 #ifdef ENABLE_EDITING
1719 void edit (
void )
const
1721 printf(
"*EOF*\n" );
1740 emr.iType = EMR_SETVIEWPORTORGEX;
1751 ds >> emr >> ptlOrigin;
1758 ds << emr << ptlOrigin;
1764 int size (
void )
const {
return emr.nSize; }
1773 SetViewportOrgEx( dc, ptlOrigin.x, ptlOrigin.y, 0 );
1775 #ifdef ENABLE_EDITING
1779 void edit (
void )
const
1781 printf(
"*SETVIEWPORTORGEX*\n" );
1782 edit_pointl(
"ptlOrigin", ptlOrigin );
1803 emr.iType = EMR_SETWINDOWORGEX;
1814 ds >> emr >> ptlOrigin;
1821 ds << emr << ptlOrigin;
1827 int size (
void )
const {
return emr.nSize; }
1836 SetWindowOrgEx( dc, ptlOrigin.x, ptlOrigin.y, 0 );
1838 #ifdef ENABLE_EDITING
1842 void edit (
void )
const
1844 printf(
"*SETWINDOWORGEX*\n" );
1845 edit_pointl(
"ptlOrigin", ptlOrigin );
1864 emr.iType = EMR_SETVIEWPORTEXTEX;
1875 ds >> emr >> szlExtent;
1882 ds << emr << szlExtent;
1888 int size (
void )
const {
return emr.nSize; }
1897 SetViewportExtEx( dc, szlExtent.cx, szlExtent.cy, 0 );
1899 #ifdef ENABLE_EDITING
1903 void edit (
void )
const
1905 printf(
"*SETVIEWPORTEXTEX*\n" );
1906 edit_sizel(
"szlExtent", szlExtent );
1927 emr.iType = EMR_SCALEVIEWPORTEXTEX;
1940 ds >> emr >> xNum >> xDenom >> yNum >> yDenom;
1947 ds << emr << xNum << xDenom << yNum << yDenom;
1953 int size (
void )
const {
return emr.nSize; }
1962 ScaleViewportExtEx( dc, xNum, xDenom, yNum, yDenom, 0 );
1964 #ifdef ENABLE_EDITING
1968 void edit (
void )
const
1970 #if defined(__LP64__)
1971 const char* FMT0 =
"\txNum\t: %d\n";
1972 const char* FMT1 =
"\txDenom\t: %d\n";
1973 const char* FMT2 =
"\tyNum\t: %d\n";
1974 const char* FMT3 =
"\tyDenom\t: %d\n";
1976 const char* FMT0 =
"\txNum\t: %ld\n";
1977 const char* FMT1 =
"\txDenom\t: %ld\n";
1978 const char* FMT2 =
"\tyNum\t: %ld\n";
1979 const char* FMT3 =
"\tyDenom\t: %ld\n";
1981 printf(
"*SCALEVIEWPORTEXTEX*\n" );
1982 printf( FMT0, xNum );
1983 printf( FMT1, xDenom );
1984 printf( FMT2, yNum );
1985 printf( FMT3, yDenom );
2004 emr.iType = EMR_SETWINDOWEXTEX;
2015 ds >> emr >> szlExtent;
2022 ds << emr << szlExtent;
2028 int size (
void )
const {
return emr.nSize; }
2037 SetWindowExtEx( dc, szlExtent.cx, szlExtent.cy, 0 );
2039 #ifdef ENABLE_EDITING
2043 void edit (
void )
const
2045 printf(
"*SETWINDOWEXTEX*\n" );
2046 edit_sizel(
"szlExtent", szlExtent );
2067 emr.iType = EMR_SCALEWINDOWEXTEX;
2080 ds >> emr >> xNum >> xDenom >> yNum >> yDenom;
2087 ds << emr << xNum << xDenom << yNum << yDenom;
2093 int size (
void )
const {
return emr.nSize; }
2102 ScaleWindowExtEx( dc, xNum, xDenom, yNum, yDenom, 0 );
2104 #ifdef ENABLE_EDITING
2108 void edit (
void )
const
2110 #if defined(__LP64__)
2111 const char* FMT0 =
"\txNum\t: %d\n";
2112 const char* FMT1 =
"\txDenom\t: %d\n";
2113 const char* FMT2 =
"\tyNum\t: %d\n";
2114 const char* FMT3 =
"\tyDenom\t: %d\n";
2116 const char* FMT0 =
"\txNum\t: %ld\n";
2117 const char* FMT1 =
"\txDenom\t: %ld\n";
2118 const char* FMT2 =
"\tyNum\t: %ld\n";
2119 const char* FMT3 =
"\tyDenom\t: %ld\n";
2121 printf(
"*SCALEWINDOWEXTEX*\n" );
2122 printf( FMT0, xNum );
2123 printf( FMT1, xDenom );
2124 printf( FMT2, yNum );
2125 printf( FMT3, yDenom );
2146 emr.iType = EMR_MODIFYWORLDTRANSFORM;
2157 ds >> emr >> xform >> iMode;
2164 ds << emr << xform << iMode;
2170 int size (
void )
const {
return emr.nSize; }
2179 ModifyWorldTransform( dc, &xform, iMode );
2181 #ifdef ENABLE_EDITING
2185 void edit (
void )
const
2187 #if defined(__LP64__)
2188 const char* FMT =
"unknown(%d)\n";
2190 const char* FMT =
"unknown(%ld)\n";
2192 printf(
"*MODIFYWORLDTRANSFORM*\n" );
2193 edit_xform(
"xform", xform );
2194 printf(
"\tiMode\t\t: " );
2196 case MWT_IDENTITY: printf(
"MWT_IDENTITY\n" );
break;
2197 case MWT_LEFTMULTIPLY: printf(
"MWT_LEFTMULTIPLY\n" );
break;
2198 case MWT_RIGHTMULTIPLY: printf(
"MWT_RIGHTMULTIPLY\n" );
break;
2199 default: printf( FMT, iMode );
2219 emr.iType = EMR_SETWORLDTRANSFORM;
2242 int size (
void )
const {
return emr.nSize; }
2251 SetWorldTransform( dc, &xform );
2253 #ifdef ENABLE_EDITING
2257 void edit (
void )
const
2259 printf(
"*SETWORLDTRANSFORM*\n" );
2260 edit_xform(
"xform", xform );
2276 emr.iType = EMR_SETTEXTALIGN;
2299 int size (
void )
const {
return emr.nSize; }
2308 SetTextAlign( dc, iMode );
2310 #ifdef ENABLE_EDITING
2314 void edit (
void )
const
2316 #if defined(__LP64__)
2317 const char* FMT =
"| unknown bits(0x%x)";
2319 const char* FMT =
"| unknown bits(0x%lx)";
2321 unsigned int known_bits = TA_BASELINE+TA_CENTER+TA_UPDATECP+TA_RTLREADING;
2322 unsigned int unknown_bits = ~known_bits;
2324 printf(
"*SETTEXTALIGN*\n" );
2325 printf(
"\tiMode\t: " );
2326 if ( iMode & TA_UPDATECP )
2327 printf(
"TA_UPDATECP" );
2329 printf(
"TA_NOUPDATECP" );
2330 if ( iMode & TA_CENTER )
2331 printf(
" | TA_CENTER" );
2332 else if ( iMode & TA_RIGHT )
2333 printf(
" | TA_RIGHT" );
2335 printf(
" | TA_LEFT" );
2336 if ( iMode & TA_BASELINE )
2337 printf(
" | TA_BASELINE" );
2338 else if ( iMode & TA_BOTTOM )
2339 printf(
" | TA_BOTTOM" );
2341 printf(
" | TA_TOP" );
2342 if ( iMode & TA_RTLREADING )
2343 printf(
" | TA_RTLREADING" );
2344 if ( iMode & unknown_bits )
2345 printf( FMT, iMode & unknown_bits );
2362 emr.iType = EMR_SETTEXTCOLOR;
2372 ds >> emr >> crColor;
2379 ds << emr << crColor;
2385 int size (
void )
const {
return emr.nSize; }
2394 SetTextColor( dc, crColor );
2396 #ifdef ENABLE_EDITING
2400 void edit (
void )
const
2402 printf(
"*SETTEXTCOLOR*\n" );
2403 edit_color(
"crColor", crColor );
2419 emr.iType = EMR_SETBKCOLOR;
2429 ds >> emr >> crColor;
2436 ds << emr << crColor;
2442 int size (
void )
const {
return emr.nSize; }
2451 SetBkColor( dc, crColor );
2453 #ifdef ENABLE_EDITING
2457 void edit (
void )
const
2459 printf(
"*SETBKCOLOR*\n" );
2460 edit_color(
"crColor", crColor );
2477 emr.iType = EMR_SETBKMODE;
2500 int size (
void )
const {
return emr.nSize; }
2509 SetBkMode( dc, iMode );
2511 #ifdef ENABLE_EDITING
2515 void edit (
void )
const
2517 #if defined(__LP64__)
2518 const char* FMT =
"unknown(%d)\n";
2520 const char* FMT =
"unknown(%ld)\n";
2522 printf(
"*SETBKMODE*\n" );
2523 printf(
"\tiMode\t: " );
2525 case TRANSPARENT: printf(
"TRANSPARENT\n" );
break;
2526 case OPAQUE: printf(
"OPAQUE\n" );
break;
2527 default: printf( FMT, iMode );
2544 emr.iType = EMR_SETPOLYFILLMODE;
2567 int size (
void )
const {
return emr.nSize; }
2576 SetPolyFillMode( dc, iMode );
2578 #ifdef ENABLE_EDITING
2582 void edit (
void )
const
2584 #if defined(__LP64__)
2585 const char* FMT =
"unknown(%d)\n";
2587 const char* FMT =
"unknown(%ld)\n";
2589 printf(
"*SETPOLYFILLMODE*\n" );
2590 printf(
"\tiMode: " );
2592 case ALTERNATE: printf(
"ALTERNATE\n" );
break;
2593 case WINDING: printf(
"WINDING\n" );
break;
2594 default: printf( FMT, iMode );
2612 emr.iType = EMR_SETMAPMODE;
2635 int size (
void )
const {
return emr.nSize; }
2644 SetMapMode( dc, iMode );
2646 #ifdef ENABLE_EDITING
2650 void edit (
void )
const
2652 #if defined(__LP64__)
2653 const char* FMT =
"unknown(%d)\n";
2655 const char* FMT =
"unknown(%ld)\n";
2657 printf(
"*SETMAPMODE*\n" );
2658 printf(
"\tiMode\t: " );
2660 case MM_TEXT: printf(
"MM_TEXT\n" );
break;
2661 case MM_LOMETRIC: printf(
"MM_LOMETRIC\n" );
break;
2662 case MM_HIMETRIC: printf(
"MM_HIMETRIC\n" );
break;
2663 case MM_LOENGLISH: printf(
"MM_LOENGLISH\n" );
break;
2664 case MM_HIENGLISH: printf(
"MM_HIENGLISH\n" );
break;
2665 case MM_TWIPS: printf(
"MM_TWIPS\n" );
break;
2666 case MM_ISOTROPIC: printf(
"MM_ISOTROPIC\n" );
break;
2667 case MM_ANISOTROPIC: printf(
"MM_ANISOTROPIC\n" );
break;
2668 default: printf( FMT, iMode );
2685 emr.iType = EMR_SELECTOBJECT;
2695 ds >> emr >> ihObject;
2702 ds << emr << ihObject;
2708 int size (
void )
const {
return emr.nSize; }
2715 #ifdef ENABLE_EDITING
2719 void edit (
void )
const
2721 #if defined(__LP64__)
2722 const char* FMT =
"\tihObject\t: 0x%x\n";
2724 const char* FMT =
"\tihObject\t: 0x%lx\n";
2726 printf(
"*SELECTOBJECT*\n" );
2727 printf( FMT, ihObject );
2743 emr.iType = EMR_DELETEOBJECT;
2753 ds >> emr >> ihObject;
2760 ds << emr << ihObject;
2766 int size (
void )
const {
return emr.nSize; }
2773 #ifdef ENABLE_EDITING
2777 void edit (
void )
const
2779 #if defined(__LP64__)
2780 const char* FMT =
"\tihObject\t: 0x%x\n";
2782 const char* FMT =
"\tihObject\t: 0x%lx\n";
2784 printf(
"*DELETEOBJECT*\n" );
2785 printf( FMT, ihObject );
2802 emr.iType = EMR_MOVETOEX;
2826 int size (
void )
const {
return emr.nSize; }
2835 MoveToEx( dc, ptl.x, ptl.y, 0 );
2837 #ifdef ENABLE_EDITING
2841 void edit (
void )
const
2843 printf(
"*MOVETOEX*\n" );
2844 edit_pointl(
"ptl", ptl );
2861 emr.iType = EMR_LINETO;
2885 int size (
void )
const {
return emr.nSize; }
2894 LineTo( dc, ptl.x, ptl.y );
2896 #ifdef ENABLE_EDITING
2900 void edit (
void )
const
2902 printf(
"*LINETO*\n" );
2903 edit_pointl(
"ptl", ptl );
2925 EMRARC ( INT left, INT top, INT right, INT bottom, INT xstart,
2926 INT ystart, INT xend, INT yend )
2928 emr.iType = EMR_ARC;
2931 rclBox.right = right;
2932 rclBox.bottom = bottom;
2934 ptlStart.x = xstart;
2935 ptlStart.y = ystart;
2945 ds >> emr >> rclBox >> ptlStart >> ptlEnd;
2952 ds << emr << rclBox << ptlStart << ptlEnd;
2958 int size (
void )
const {
return emr.nSize; }
2967 Arc( dc, rclBox.left, rclBox.top, rclBox.right, rclBox.bottom,
2968 ptlStart.x, ptlStart.y, ptlEnd.x, ptlEnd.y );
2970 #ifdef ENABLE_EDITING
2974 void edit (
void )
const
2976 printf(
"*ARC*\n" );
2977 edit_rectl(
"rclBox\t", rclBox );
2978 edit_pointl(
"ptlStart", ptlStart );
2979 edit_pointl(
"ptlEnd\t", ptlEnd );
3001 EMRARCTO ( INT left, INT top, INT right, INT bottom, INT xstart,
3002 INT ystart, INT xend, INT yend )
3004 emr.iType = EMR_ARCTO;
3007 rclBox.right = right;
3008 rclBox.bottom = bottom;
3010 ptlStart.x = xstart;
3011 ptlStart.y = ystart;
3021 ds >> emr >> rclBox >> ptlStart >> ptlEnd;
3028 ds << emr << rclBox << ptlStart << ptlEnd;
3034 int size (
void )
const {
return emr.nSize; }
3043 ArcTo( dc, rclBox.left, rclBox.top, rclBox.right, rclBox.bottom,
3044 ptlStart.x, ptlStart.y, ptlEnd.x, ptlEnd.y );
3046 #ifdef ENABLE_EDITING
3050 void edit (
void )
const
3052 printf(
"*ARCTO*\n" );
3053 edit_rectl(
"rclBox\t", rclBox );
3054 edit_pointl(
"ptlStart", ptlStart );
3055 edit_pointl(
"ptlEnd\t", ptlEnd );
3074 emr.iType = EMR_RECTANGLE;
3077 rclBox.right = right;
3078 rclBox.bottom = bottom;
3087 ds >> emr >> rclBox;
3094 ds << emr << rclBox;
3100 int size (
void )
const {
return emr.nSize; }
3109 Rectangle( dc, rclBox.left, rclBox.top, rclBox.right, rclBox.bottom );
3111 #ifdef ENABLE_EDITING
3115 void edit (
void )
const
3117 printf(
"*RECTANGLE*\n" );
3118 edit_rectl(
"rclBox", rclBox );
3138 emr.iType = EMR_ELLIPSE;
3141 rclBox.right = right;
3142 rclBox.bottom = bottom;
3151 ds >> emr >> rclBox;
3158 ds << emr << rclBox;
3164 int size (
void )
const {
return emr.nSize; }
3173 Ellipse( dc, rclBox.left, rclBox.top, rclBox.right, rclBox.bottom );
3175 #ifdef ENABLE_EDITING
3179 void edit (
void )
const
3181 printf(
"*ELLIPSE*\n" );
3182 edit_rectl(
"rclBox", rclBox );
3205 emr.iType = EMR_POLYLINE;
3207 emr.nSize =
sizeof(
::EMRPOLYLINE ) +
sizeof( POINTL ) * ( cptl - 1);
3209 lpoints =
new POINTL[cptl];
3211 for (
int i=0; i<n; i++) {
3212 lpoints[i].x = points[i].x;
3213 lpoints[i].y = points[i].y;
3216 rclBounds = *bounds;
3223 if ( lpoints )
delete[] lpoints;
3231 ds >> emr >> rclBounds >> cptl;
3233 lpoints =
new POINTL[cptl];
3244 ds << emr << rclBounds << cptl <<
POINTLARRAY( lpoints, cptl );
3250 int size (
void )
const {
return emr.nSize; }
3260 Polyline( dc, (POINT*)lpoints, cptl );
3262 #ifdef ENABLE_EDITING
3266 void edit (
void )
const
3268 printf(
"*POLYLINE*\n" );
3269 edit_rectl(
"rclBounds", rclBounds );
3271 printf(
"\tcptl : %ld\n", cptl );
3272 printf(
"\taptl->\n" );
3273 for (
unsigned int i = 0; i < cptl; i++ )
3274 printf(
"\t\t%ld, %ld\n", lpoints[i].x, lpoints[i].y );
3276 edit_pointlarray(
"\t", cptl, lpoints );
3300 emr.iType = EMR_POLYLINE16;
3302 emr.nSize =
sizeof(
::EMRPOLYLINE16 ) +
sizeof( POINT16 ) * ( cpts - 1);
3304 lpoints =
new POINT16[cpts];
3306 for (
int i=0; i<n; i++) {
3307 lpoints[i].x = points[i].x;
3308 lpoints[i].y = points[i].y;
3311 rclBounds = *bounds;
3325 emr.iType = EMR_POLYLINE16;
3327 emr.nSize =
sizeof(
::EMRPOLYLINE16 ) +
sizeof( POINT16 ) * ( cpts - 1);
3329 lpoints =
new POINT16[cpts];
3331 for (
int i=0; i<n; i++) {
3332 lpoints[i].x = points[i].x;
3333 lpoints[i].y = points[i].y;
3336 rclBounds = *bounds;
3343 if ( lpoints )
delete[] lpoints;
3351 ds >> emr >> rclBounds >> cpts;
3353 lpoints =
new POINT16[cpts];
3364 ds << emr << rclBounds << cpts <<
POINT16ARRAY( lpoints, cpts );
3370 int size (
void )
const {
return emr.nSize; }
3380 Polyline16( dc, lpoints, cpts );
3382 #ifdef ENABLE_EDITING
3386 void edit (
void )
const
3388 printf(
"*POLYLINE16*\n" );
3389 edit_rectl(
"rclBounds", rclBounds );
3390 edit_point16array(
"\t", cpts, lpoints );
3413 emr.iType = EMR_POLYGON;
3415 emr.nSize =
sizeof(
::EMRPOLYGON ) +
sizeof( POINTL ) * (cptl-1);
3417 lpoints =
new POINTL[cptl];
3419 for (
int i=0; i<n; i++) {
3420 lpoints[i].x = points[i].x;
3421 lpoints[i].y = points[i].y;
3424 rclBounds = *bounds;
3432 ds >> emr >> rclBounds >> cptl;
3434 lpoints =
new POINTL[cptl];
3445 if ( lpoints )
delete[] lpoints;
3452 ds << emr << rclBounds << cptl <<
POINTLARRAY( lpoints, cptl );
3458 int size (
void )
const {
return emr.nSize; }
3468 Polygon( dc, (POINT*)lpoints, cptl );
3470 #ifdef ENABLE_EDITING
3474 void edit (
void )
const
3476 printf(
"*POLYGON*\n" );
3477 edit_rectl(
"rclBounds", rclBounds );
3479 printf(
"\tcptl : %ld\n", cptl );
3480 printf(
"\taptl->\n" );
3481 for (
unsigned int i = 0; i < cptl; i++ )
3482 printf(
"\t\t%ld, %ld\n", lpoints[i].x, lpoints[i].y );
3484 edit_pointlarray(
"\t", cptl, lpoints );
3508 emr.iType = EMR_POLYGON16;
3510 emr.nSize =
sizeof(
::EMRPOLYGON16 ) +
sizeof( POINT16 ) * (cpts-1);
3512 lpoints =
new POINT16[cpts];
3514 for (
int i=0; i<n; i++) {
3515 lpoints[i].x = points[i].x;
3516 lpoints[i].y = points[i].y;
3519 rclBounds = *bounds;
3533 emr.iType = EMR_POLYGON16;
3535 emr.nSize =
sizeof(
::EMRPOLYGON16 ) +
sizeof( POINT16 ) * (cpts-1);
3537 lpoints =
new POINT16[cpts];
3539 for (
int i=0; i<n; i++) {
3540 lpoints[i].x = points[i].x;
3541 lpoints[i].y = points[i].y;
3544 rclBounds = *bounds;
3552 ds >> emr >> rclBounds >> cpts;
3554 lpoints =
new POINT16[cpts];
3565 if ( lpoints )
delete[] lpoints;
3572 ds << emr << rclBounds << cpts <<
POINT16ARRAY( lpoints, cpts );
3578 int size (
void )
const {
return emr.nSize; }
3588 Polygon16( dc, lpoints, cpts );
3590 #ifdef ENABLE_EDITING
3594 void edit (
void )
const
3596 printf(
"*POLYGON16*\n" );
3597 edit_rectl(
"rclBounds", rclBounds );
3598 edit_point16array(
"\t", cpts, lpoints );
3623 for (
unsigned int i = 0; i < nPolys; i++ )
3631 emr.iType = EMR_POLYPOLYGON;
3635 +
sizeof( DWORD ) * (nPolys-1);
3637 lcounts =
new DWORD[nPolys];
3639 for (
unsigned int i = 0; i < nPolys; i++ )
3640 lcounts[i] = counts[i];
3642 lpoints =
new POINTL[cptl];
3644 for (
int i=0; i<n; i++) {
3645 lpoints[i].x = points[i].x;
3646 lpoints[i].y = points[i].y;
3649 rclBounds = *bounds;
3656 if ( lcounts )
delete[] lcounts;
3657 if ( lpoints )
delete[] lpoints;
3665 ds >> emr >> rclBounds >> nPolys >> cptl;
3667 lcounts =
new DWORD[nPolys];
3673 lpoints =
new POINTL[cptl];
3684 ds << emr << rclBounds << nPolys << cptl <<
DWORDARRAY( lcounts, nPolys )
3691 int size (
void )
const {
return emr.nSize; }
3702 std::vector<INT> countsv( lcounts, lcounts + nPolys );
3704 PolyPolygon( dc, (POINT*)lpoints, &countsv[0], nPolys );
3706 #ifdef ENABLE_EDITING
3710 void edit (
void )
const
3712 #if defined(__LP64__)
3713 const char* FMT0 =
"\tnPolys\t\t: %d\n";
3714 const char* FMT1 =
"\tcptl\t\t: %d\n";
3715 const char* FMT2 =
"%d\n";
3716 const char* FMT3 =
"\t\t\t %d\n";
3717 const char* FMT4 =
"%d, %d\n";
3718 const char* FMT5 =
"\t\t\t %d, %d\n";
3720 const char* FMT0 =
"\tnPolys\t\t: %ld\n";
3721 const char* FMT1 =
"\tcptl\t\t: %ld\n";
3722 const char* FMT2 =
"%ld\n";
3723 const char* FMT3 =
"\t\t\t %ld\n";
3724 const char* FMT4 =
"%ld, %ld\n";
3725 const char* FMT5 =
"\t\t\t %ld, %ld\n";
3727 printf(
"*POLYPOLYGON*\n" );
3728 edit_rectl(
"rclBounds", rclBounds );
3729 printf( FMT0, nPolys );
3730 printf( FMT1, cptl );
3731 printf(
"\taPolyCounts\t: " );
3733 printf( FMT2, lcounts[0] );
3736 for (
unsigned int i = 1; i < nPolys; i++ )
3737 printf( FMT3, lcounts[i] );
3738 printf(
"\tapts\t\t: " );
3740 printf( FMT4, lpoints[0].x, lpoints[0].y );
3743 for (
unsigned int i = 1; i < cptl; i++ )
3744 printf( FMT5, lpoints[i].x, lpoints[i].y );
3764 const INT* counts, UINT polygons )
3769 for (
unsigned int i = 0; i < nPolys; i++ )
3777 emr.iType = EMR_POLYPOLYGON16;
3781 +
sizeof( DWORD ) * (nPolys-1);
3783 lcounts =
new DWORD[nPolys];
3785 for (
unsigned int i = 0; i < nPolys; i++ )
3786 lcounts[i] = counts[i];
3788 lpoints =
new POINT16[cpts];
3790 for (
int i=0; i<n; i++) {
3791 lpoints[i].x = points[i].x;
3792 lpoints[i].y = points[i].y;
3795 rclBounds = *bounds;
3805 const INT* counts, UINT16 polygons )
3810 for (
unsigned int i = 0; i < nPolys; i++ )
3818 emr.iType = EMR_POLYPOLYGON16;
3822 +
sizeof( DWORD ) * (nPolys-1);
3824 lcounts =
new DWORD[nPolys];
3826 for (
unsigned int i = 0; i < nPolys; i++ )
3827 lcounts[i] = counts[i];
3829 lpoints =
new POINT16[cpts];
3831 for (
int i=0; i<n; i++) {
3832 lpoints[i].x = points[i].x;
3833 lpoints[i].y = points[i].y;
3836 rclBounds = *bounds;
3843 if ( lcounts )
delete[] lcounts;
3844 if ( lpoints )
delete[] lpoints;
3852 ds >> emr >> rclBounds >> nPolys >> cpts;
3854 lcounts =
new DWORD[nPolys];
3860 lpoints =
new POINT16[cpts];
3871 ds << emr << rclBounds << nPolys << cpts <<
DWORDARRAY( lcounts, nPolys )
3878 int size (
void )
const {
return emr.nSize; }
3889 std::vector<INT> counts( lcounts, lcounts + nPolys );
3891 PolyPolygon16( dc, lpoints, &counts[0], nPolys );
3893 #ifdef ENABLE_EDITING
3897 void edit (
void )
const
3899 #if defined(__LP64__)
3900 const char* FMT0 =
"\tnPolys\t\t: %d\n";
3901 const char* FMT1 =
"\tcptl\t\t: %d\n";
3902 const char* FMT2 =
"%d\n";
3903 const char* FMT3 =
"\t\t\t %d\n";
3905 const char* FMT0 =
"\tnPolys\t\t: %ld\n";
3906 const char* FMT1 =
"\tcptl\t\t: %ld\n";
3907 const char* FMT2 =
"%ld\n";
3908 const char* FMT3 =
"\t\t\t %ld\n";
3910 printf(
"*POLYPOLYGON16*\n" );
3911 edit_rectl(
"rclBounds", rclBounds );
3912 printf( FMT0, nPolys );
3913 printf( FMT1, cpts );
3914 printf(
"\taPolyCounts\t: " );
3916 printf( FMT2, lcounts[0] );
3919 for (
unsigned int i = 1; i < nPolys; i++ )
3920 printf( FMT3, lcounts[i] );
3921 printf(
"\tapts\t\t: " );
3923 printf(
"%d, %d\n", lpoints[0].x, lpoints[0].y );
3926 for (
unsigned int i = 1; i < cpts; i++ )
3927 printf(
"\t\t\t %d, %d\n", lpoints[i].x, lpoints[i].y );
3950 emr.iType = EMR_POLYBEZIER;
3954 lpoints =
new POINTL[cptl];
3956 for (
int i=0; i<n; i++) {
3957 lpoints[i].x = points[i].x;
3958 lpoints[i].y = points[i].y;
3961 rclBounds = *bounds;
3969 ds >> emr >> rclBounds >> cptl;
3971 lpoints =
new POINTL[cptl];
3982 if ( lpoints )
delete[] lpoints;
3989 ds << emr << rclBounds << cptl <<
POINTLARRAY( lpoints, cptl );
3995 int size (
void )
const {
return emr.nSize; }
4005 PolyBezier( dc, (POINT*)lpoints, cptl );
4007 #ifdef ENABLE_EDITING
4011 void edit (
void )
const
4013 printf(
"*POLYBEZIER*\n" );
4014 edit_rectl(
"rclBounds", rclBounds );
4016 printf(
"\tcptl : %ld\n", cptl );
4017 printf(
"\taptl->\n" );
4018 for (
unsigned int i = 0; i < cptl; i++ )
4019 printf(
"\t\t%ld, %ld\n", lpoints[i].x, lpoints[i].y );
4021 edit_pointlarray(
"\t", cptl, lpoints );
4045 emr.iType = EMR_POLYBEZIER16;
4049 lpoints =
new POINT16[cpts];
4051 for (
int i=0; i<n; i++) {
4052 lpoints[i].x = points[i].x;
4053 lpoints[i].y = points[i].y;
4056 rclBounds = *bounds;
4070 emr.iType = EMR_POLYBEZIER16;
4074 lpoints =
new POINT16[cpts];
4076 for (
int i=0; i<n; i++) {
4077 lpoints[i].x = points[i].x;
4078 lpoints[i].y = points[i].y;
4081 rclBounds = *bounds;
4089 ds >> emr >> rclBounds >> cpts;
4091 lpoints =
new POINT16[cpts];
4102 if ( lpoints )
delete[] lpoints;
4109 ds << emr << rclBounds << cpts <<
POINT16ARRAY( lpoints, cpts );
4115 int size (
void )
const {
return emr.nSize; }
4125 PolyBezier16( dc, lpoints, cpts );
4127 #ifdef ENABLE_EDITING
4131 void edit (
void )
const
4133 printf(
"*POLYBEZIER16*\n" );
4134 edit_rectl(
"rclBounds", rclBounds );
4135 edit_point16array(
"\t", cpts, lpoints );
4158 emr.iType = EMR_POLYBEZIERTO;
4162 lpoints =
new POINTL[cptl];
4164 for (
int i=0; i<n; i++) {
4165 lpoints[i].x = points[i].x;
4166 lpoints[i].y = points[i].y;
4169 rclBounds = *bounds;
4177 ds >> emr >> rclBounds >> cptl;
4179 lpoints =
new POINTL[cptl];
4190 if ( lpoints )
delete[] lpoints;
4197 ds << emr << rclBounds << cptl <<
POINTLARRAY( lpoints, cptl );
4203 int size (
void )
const {
return emr.nSize; }
4213 PolyBezierTo( dc, (POINT*)lpoints, cptl );
4215 #ifdef ENABLE_EDITING
4219 void edit (
void )
const
4221 printf(
"*POLYBEZIERTO*\n" );
4222 edit_rectl(
"rclBounds", rclBounds );
4224 printf(
"\tcptl : %ld\n", cptl );
4225 printf(
"\taptl->\n" );
4226 for (
unsigned int i = 0; i < cptl; i++ )
4227 printf(
"\t\t%ld, %ld\n", lpoints[i].x, lpoints[i].y );
4229 edit_pointlarray(
"\t", cptl, lpoints );
4253 emr.iType = EMR_POLYBEZIERTO16;
4257 lpoints =
new POINT16[cpts];
4259 for (
int i=0; i<n; i++) {
4260 lpoints[i].x = points[i].x;
4261 lpoints[i].y = points[i].y;
4264 rclBounds = *bounds;
4278 emr.iType = EMR_POLYBEZIERTO16;
4282 lpoints =
new POINT16[cpts];
4284 for (
int i=0; i<n; i++) {
4285 lpoints[i].x = points[i].x;
4286 lpoints[i].y = points[i].y;
4289 rclBounds = *bounds;
4297 ds >> emr >> rclBounds >> cpts;
4299 lpoints =
new POINT16[cpts];
4310 if ( lpoints )
delete[] lpoints;
4317 ds << emr << rclBounds << cpts <<
POINT16ARRAY( lpoints, cpts );
4323 int size (
void )
const {
return emr.nSize; }
4333 PolyBezierTo16( dc, lpoints, cpts );
4335 #ifdef ENABLE_EDITING
4339 void edit (
void )
const
4341 printf(
"*POLYBEZIERTO16*\n" );
4342 edit_rectl(
"rclBounds", rclBounds );
4343 edit_point16array(
"\t", cpts, lpoints );
4366 emr.iType = EMR_POLYLINETO;
4370 lpoints =
new POINTL[cptl];
4372 for (
int i=0; i<n; i++) {
4373 lpoints[i].x = points[i].x;
4374 lpoints[i].y = points[i].y;
4377 rclBounds = *bounds;
4385 ds >> emr >> rclBounds >> cptl;
4387 lpoints =
new POINTL[cptl];
4398 if ( lpoints )
delete[] lpoints;
4405 ds << emr << rclBounds << cptl <<
POINTLARRAY( lpoints, cptl );
4411 int size (
void )
const {
return emr.nSize; }
4421 PolylineTo( dc, (POINT*)lpoints, cptl );
4423 #ifdef ENABLE_EDITING
4427 void edit (
void )
const
4429 printf(
"*POLYLINETO*\n" );
4430 edit_rectl(
"rclBounds", rclBounds );
4432 printf(
"\tcptl : %ld\n", cptl );
4433 printf(
"\taptl->\n" );
4434 for (
unsigned int i = 0; i < cptl; i++ )
4435 printf(
"\t\t%ld, %ld\n", lpoints[i].x, lpoints[i].y );
4437 edit_pointlarray(
"\t", cptl, lpoints );
4461 emr.iType = EMR_POLYLINETO16;
4465 lpoints =
new POINT16[cpts];
4467 for (
int i=0; i<n; i++) {
4468 lpoints[i].x = points[i].x;
4469 lpoints[i].y = points[i].y;
4472 rclBounds = *bounds;
4486 emr.iType = EMR_POLYLINETO16;
4490 lpoints =
new POINT16[cpts];
4492 for (
int i=0; i<n; i++) {
4493 lpoints[i].x = points[i].x;
4494 lpoints[i].y = points[i].y;
4497 rclBounds = *bounds;
4505 ds >> emr >> rclBounds >> cpts;
4507 lpoints =
new POINT16[cpts];
4518 if ( lpoints )
delete[] lpoints;
4525 ds << emr << rclBounds << cpts <<
POINT16ARRAY( lpoints, cpts );
4531 int size (
void )
const {
return emr.nSize; }
4541 PolylineTo16( dc, lpoints, cpts );
4543 #ifdef ENABLE_EDITING
4547 void edit (
void )
const
4549 printf(
"*POLYLINETO16*\n" );
4550 edit_rectl(
"rclBounds", rclBounds );
4551 edit_point16array(
"\t", cpts, lpoints );
4578 FLOAT yScale,
const PEMRTEXT text, LPCSTR
string,
4581 emr.iType = EMR_EXTTEXTOUTA;
4584 rclBounds = *bounds;
4586 iGraphicsMode = graphicsMode;
4592 string_size = ROUND_TO_LONG( emrtext.nChars );
4594 string_a =
new CHAR[ string_size ];
4596 memset( string_a, 0,
sizeof(CHAR) * string_size );
4598 for (
unsigned int i=0; i<emrtext.nChars; i++ )
4599 string_a[i] = *
string++;
4601 emrtext.offString = emr.nSize;
4602 emr.nSize += string_size *
sizeof(CHAR);
4610 int * dxn =
new int [string_size];
4611 for (
unsigned int i=0; i < string_size; i++) dxn[i] = 10;
4618 dx_i =
new INT[ emrtext.nChars ];
4620 for (
unsigned int i=0; i<emrtext.nChars; i++ )
4623 emrtext.offDx = emr.nSize;
4624 emr.nSize += emrtext.nChars *
sizeof(INT);
4637 ds >> emr >> rclBounds >> iGraphicsMode >> exScale >> eyScale >> emrtext;
4639 if ( emrtext.offString != 0 ) {
4640 string_size = ROUND_TO_LONG( emrtext.nChars );
4642 string_a =
new CHAR[ string_size ];
4644 memset( string_a, 0,
sizeof(CHAR) * string_size );
4646 CHARSTR string( string_a, string_size );
4653 if ( emrtext.offDx ) {
4654 dx_i =
new INT[ emrtext.nChars ];
4656 INTARRAY dx_is( dx_i, emrtext.nChars );
4669 if ( string_a )
delete[] string_a;
4670 if ( dx_i )
delete[] dx_i;
4677 ds << emr << rclBounds << iGraphicsMode << exScale << eyScale
4678 << emrtext <<
CHARSTR( string_a, string_size );
4680 ds <<
INTARRAY( dx_i, emrtext.nChars );
4686 int size (
void )
const {
return emr.nSize; }
4696 rect.left = emrtext.rcl.left;
4697 rect.top = emrtext.rcl.top;
4698 rect.right = emrtext.rcl.right;
4699 rect.bottom = emrtext.rcl.bottom;
4701 ExtTextOutA( dc, emrtext.ptlReference.x, emrtext.ptlReference.y,
4702 emrtext.fOptions, &rect, string_a, emrtext.nChars,
4705 #ifdef ENABLE_EDITING
4709 void edit (
void )
const
4711 #if defined(__LP64__)
4712 const char* FMT0 =
"unknown(%d)\n";
4713 const char* FMT1 =
"\tptlReference\t: (%d,%d)\n";
4714 const char* FMT2 =
"\tnChars\t\t: %d\n";
4715 const char* FMT3 =
"\toffString\t: %d\n";
4716 const char* FMT4 =
"\toffDx\t\t: %d\n";
4718 const char* FMT0 =
"unknown(%ld)\n";
4719 const char* FMT1 =
"\tptlReference\t: (%ld,%ld)\n";
4720 const char* FMT2 =
"\tnChars\t\t: %ld\n";
4721 const char* FMT3 =
"\toffString\t: %ld\n";
4722 const char* FMT4 =
"\toffDx\t\t: %ld\n";
4724 printf(
"*EXTTEXTOUTA*\n" );
4725 edit_rectl(
"rclBounds", rclBounds );
4726 printf(
"\tiGraphicsMode\t: " );
4727 switch ( iGraphicsMode ) {
4728 case GM_COMPATIBLE: printf(
"GM_COMPATIBLE\n" );
break;
4729 case GM_ADVANCED: printf(
"GM_ADVANCED\n" );
break;
4730 default: printf( FMT0, iGraphicsMode );
4732 printf(
"\texScale\t\t: %f\n", exScale );
4733 printf(
"\teyScale\t\t: %f\n", eyScale );
4734 printf( FMT1, emrtext.ptlReference.x, emrtext.ptlReference.y );
4735 printf( FMT2, emrtext.nChars );
4736 printf( FMT3, emrtext.offString );
4737 printf(
"\tfOptions\t: " );
4738 if ( emrtext.fOptions == 0 )
4741 if ( emrtext.fOptions & ETO_GRAYED ) {
4742 printf(
"ETO_GRAYED" );
4743 if ( emrtext.fOptions & ~ETO_GRAYED )
4746 if ( emrtext.fOptions & ETO_OPAQUE ) {
4747 printf(
"ETO_OPAQUE" );
4748 if ( emrtext.fOptions & ~(ETO_GRAYED | ETO_OPAQUE) )
4751 if ( emrtext.fOptions & ETO_CLIPPED ) {
4752 printf(
"ETO_CLIPPED" );
4753 if ( emrtext.fOptions & ~(ETO_GRAYED | ETO_OPAQUE | ETO_CLIPPED ) )
4756 if ( emrtext.fOptions & ETO_GLYPH_INDEX ) {
4757 printf(
"ETO_GLYPH_INDEX" );
4758 if ( emrtext.fOptions &
4759 ~(ETO_GRAYED | ETO_OPAQUE | ETO_CLIPPED | ETO_GLYPH_INDEX) )
4762 if ( emrtext.fOptions & ETO_RTLREADING ) {
4763 printf(
"ETO_RTLREADING" );
4764 if ( emrtext.fOptions &
4765 ~(ETO_GRAYED | ETO_OPAQUE | ETO_CLIPPED | ETO_GLYPH_INDEX |
4769 if ( emrtext.fOptions & ETO_IGNORELANGUAGE )
4770 printf(
"ETO_IGNORELANGUAGE" );
4773 edit_rectl(
"rcl\t", emrtext.rcl );
4774 printf( FMT4, emrtext.offDx );
4775 printf(
"\tString:\n\t\t%s\n", string_a );
4777 if ( emrtext.offDx != 0 ) {
4778 printf(
"\tOffsets:\n\t\t" );
4779 for (
unsigned int i = 0; i < emrtext.nChars; i++ )
4780 printf(
"%d ", dx_i[i] );
4808 FLOAT yScale,
const PEMRTEXT text, LPCWSTR
string,
4811 emr.iType = EMR_EXTTEXTOUTW;
4814 rclBounds = *bounds;
4816 iGraphicsMode = graphicsMode;
4822 string_size = ROUND_TO_LONG( emrtext.nChars );
4824 string_a =
new WCHAR[ string_size ];
4826 memset( string_a, 0,
sizeof(WCHAR) * string_size );
4828 for (
unsigned int i=0; i<emrtext.nChars; i++ )
4829 string_a[i] = *
string++;
4831 emrtext.offString = emr.nSize;
4832 emr.nSize += string_size *
sizeof(WCHAR);
4840 int * dxn =
new int [string_size];
4841 for (
unsigned int i=0; i < string_size; i++) dxn[i] = 10;
4848 dx_i =
new INT[ emrtext.nChars ];
4850 for (
unsigned int i=0; i<emrtext.nChars; i++ )
4853 emrtext.offDx = emr.nSize;
4854 emr.nSize += emrtext.nChars *
sizeof(INT);
4867 ds >> emr >> rclBounds >> iGraphicsMode >> exScale >> eyScale >> emrtext;
4869 if ( emrtext.offString != 0 ) {
4870 string_size = ROUND_TO_LONG( emrtext.nChars );
4872 string_a =
new WCHAR[ string_size ];
4874 memset( string_a, 0,
sizeof(WCHAR) * string_size );
4876 WCHARSTR string( string_a, string_size );
4883 if ( emrtext.offDx ) {
4884 dx_i =
new INT[ emrtext.nChars ];
4886 INTARRAY dx_is( dx_i, emrtext.nChars );
4899 if ( string_a )
delete[] string_a;
4900 if ( dx_i )
delete[] dx_i;
4907 ds << emr << rclBounds << iGraphicsMode << exScale << eyScale
4908 << emrtext <<
WCHARSTR( string_a, string_size );
4910 ds <<
INTARRAY( dx_i, emrtext.nChars );
4916 int size (
void )
const {
return emr.nSize; }
4926 rect.left = emrtext.rcl.left;
4927 rect.top = emrtext.rcl.top;
4928 rect.right = emrtext.rcl.right;
4929 rect.bottom = emrtext.rcl.bottom;
4931 ExtTextOutW( dc, emrtext.ptlReference.x, emrtext.ptlReference.y,
4932 emrtext.fOptions, &rect, string_a, emrtext.nChars,
4935 #ifdef ENABLE_EDITING
4939 void edit (
void )
const
4941 #if defined(__LP64__)
4942 const char* FMT0 =
"unknown(%d)\n";
4943 const char* FMT1 =
"\tptlReference\t: (%d,%d)\n";
4944 const char* FMT2 =
"\tnChars\t\t: %d\n";
4945 const char* FMT3 =
"\toffString\t: %d\n";
4946 const char* FMT4 =
"\toffDx\t\t: %d\n";
4948 const char* FMT0 =
"unknown(%ld)\n";
4949 const char* FMT1 =
"\tptlReference\t: (%ld,%ld)\n";
4950 const char* FMT2 =
"\tnChars\t\t: %ld\n";
4951 const char* FMT3 =
"\toffString\t: %ld\n";
4952 const char* FMT4 =
"\toffDx\t\t: %ld\n";
4954 printf(
"*EXTTEXTOUTA*\n" );
4955 edit_rectl(
"rclBounds", rclBounds );
4956 printf(
"\tiGraphicsMode\t: " );
4957 switch ( iGraphicsMode ) {
4958 case GM_COMPATIBLE: printf(
"GM_COMPATIBLE\n" );
break;
4959 case GM_ADVANCED: printf(
"GM_ADVANCED\n" );
break;
4960 default: printf( FMT0, iGraphicsMode );
4962 printf(
"\texScale\t\t: %f\n", exScale );
4963 printf(
"\teyScale\t\t: %f\n", eyScale );
4964 printf( FMT1, emrtext.ptlReference.x, emrtext.ptlReference.y );
4965 printf( FMT2, emrtext.nChars );
4966 printf( FMT3, emrtext.offString );
4967 printf(
"\tfOptions\t: " );
4968 if ( emrtext.fOptions == 0 )
4971 if ( emrtext.fOptions & ETO_GRAYED ) {
4972 printf(
"ETO_GRAYED" );
4973 if ( emrtext.fOptions & ~ETO_GRAYED )
4976 if ( emrtext.fOptions & ETO_OPAQUE ) {
4977 printf(
"ETO_OPAQUE" );
4978 if ( emrtext.fOptions & ~(ETO_GRAYED | ETO_OPAQUE) )
4981 if ( emrtext.fOptions & ETO_CLIPPED ) {
4982 printf(
"ETO_CLIPPED" );
4983 if ( emrtext.fOptions & ~(ETO_GRAYED | ETO_OPAQUE | ETO_CLIPPED ) )
4986 if ( emrtext.fOptions & ETO_GLYPH_INDEX ) {
4987 printf(
"ETO_GLYPH_INDEX" );
4988 if ( emrtext.fOptions &
4989 ~(ETO_GRAYED | ETO_OPAQUE | ETO_CLIPPED | ETO_GLYPH_INDEX) )
4992 if ( emrtext.fOptions & ETO_RTLREADING ) {
4993 printf(
"ETO_RTLREADING" );
4994 if ( emrtext.fOptions &
4995 ~(ETO_GRAYED | ETO_OPAQUE | ETO_CLIPPED | ETO_GLYPH_INDEX |
4999 if ( emrtext.fOptions & ETO_IGNORELANGUAGE )
5000 printf(
"ETO_IGNORELANGUAGE" );
5003 edit_rectl(
"rcl\t", emrtext.rcl );
5004 printf( FMT4, emrtext.offDx );
5006 printf(
"\tString:\n\t\t%s\n", string_a );
5010 iconv_t cvt = iconv_open(
"UTF-8",
"UTF-16LE" );
5011 std::vector<char> utf8_buffer( emrtext.nChars );
5014 size_t size = emrtext.nChars *
sizeof(*string_a);
5015 size_t in_bytes_left =
size;
5016 size_t converted = 0;
5017 char* in_buffer = (
char*)string_a;
5019 char* out_buffer = &utf8_buffer[converted];
5020 size_t out_bytes_left =
size - converted;
5022 size_t n = iconv( cvt, &in_buffer, &in_bytes_left,
5023 &out_buffer, &out_bytes_left );
5025 converted =
size - out_bytes_left;
5027 if ( n == (
size_t)-1 ) {
5028 if ( errno == E2BIG ) {
5029 size_t new_size = 2 * utf8_buffer.size();
5030 utf8_buffer.resize( new_size );
5031 size = utf8_buffer.size();
5045 if ( converted == utf8_buffer.size() )
5046 utf8_buffer.push_back(
'\0' );
5048 utf8_buffer[converted] =
'\0';
5050 printf(
"\tString:\n\t\t%s\n", &utf8_buffer[0] );
5053 if ( emrtext.offDx != 0 ) {
5054 printf(
"\tOffsets:\n\t\t" );
5055 for (
unsigned int i = 0; i < emrtext.nChars; i++ )
5056 printf(
"%d ", dx_i[i] );
5076 emr.iType = EMR_SETPIXELV;
5088 ds >> emr >> ptlPixel >> crColor;
5095 ds << emr << ptlPixel << crColor;
5101 int size (
void )
const {
return emr.nSize; }
5110 SetPixel( dc, ptlPixel.x, ptlPixel.y, crColor );
5112 #ifdef ENABLE_EDITING
5116 void edit (
void )
const
5118 printf(
"*SETPIXELV*\n" );
5119 edit_pointl(
"ptlPixel", ptlPixel );
5120 edit_color(
"crColor\t", crColor );
5153 ds << emr << ihPen << lopn;
5159 int size (
void )
const {
return emr.nSize; }
5166 #ifdef ENABLE_EDITING
5170 void edit (
void )
const
5172 #if defined(__LP64__)
5173 const char* FMT0 =
"\tihPen\t\t: 0x%x\n";
5174 const char* FMT1 =
"\tlopn.lopnWidth\t: %d, %d\n";
5176 const char* FMT0 =
"\tihPen\t\t: 0x%lx\n";
5177 const char* FMT1 =
"\tlopn.lopnWidth\t: %ld, %ld\n";
5179 printf(
"*CREATEPEN*\n" );
5180 printf( FMT0, ihPen );
5181 edit_pen_style(
"lopn.lopnStyle", lopn.lopnStyle );
5182 printf( FMT1, lopn.lopnWidth.x, lopn.lopnWidth.y );
5183 edit_color(
"lopn.lopnColor", lopn.lopnColor );
5211 ds << emr << ihPen << offBmi << cbBmi << offBits << cbBits << elp;
5217 int size (
void )
const {
return emr.nSize; }
5224 #ifdef ENABLE_EDITING
5228 void edit (
void )
const
5230 #if defined(__LP64__)
5231 const char* FMT0 =
"\tihPen\t\t\t: 0x%x\n";
5232 const char* FMT1 =
"\toffBmi\t\t\t: %d\n";
5233 const char* FMT2 =
"\tcbBmi\t\t\t: %d\n";
5234 const char* FMT3 =
"\toffBits\t\t\t: %d\n";
5235 const char* FMT4 =
"\tcbBits\t\t\t: %d\n";
5236 const char* FMT5 =
"\telp.elpWidth\t\t: %d\n";
5237 const char* FMT6 =
"\telp.elpNumEntries\t: %d\n";
5239 const char* FMT0 =
"\tihPen\t\t\t: 0x%lx\n";
5240 const char* FMT1 =
"\toffBmi\t\t\t: %ld\n";
5241 const char* FMT2 =
"\tcbBmi\t\t\t: %ld\n";
5242 const char* FMT3 =
"\toffBits\t\t\t: %ld\n";
5243 const char* FMT4 =
"\tcbBits\t\t\t: %ld\n";
5244 const char* FMT5 =
"\telp.elpWidth\t\t: %ld\n";
5245 const char* FMT6 =
"\telp.elpNumEntries\t: %ld\n";
5247 printf(
"*EXTCREATEPEN*\n" );
5248 printf( FMT0, ihPen );
5249 printf( FMT1, offBmi );
5250 printf( FMT2, cbBmi );
5251 printf( FMT3, offBits );
5252 printf( FMT4, cbBits );
5253 edit_pen_style(
"elp.elpPenStyle\t", elp.elpPenStyle );
5254 printf( FMT5, elp.elpWidth );
5255 edit_brush_style(
"elp.elpBrushStyle", elp.elpBrushStyle );
5256 edit_color(
"elp.elpColor\t", elp.elpColor );
5257 edit_brush_hatch(
"elp.elpHatch\t", elp.elpHatch );
5258 printf( FMT6, elp.elpNumEntries );
5285 ds << emr << ihBrush << lb;
5291 int size (
void )
const {
return emr.nSize; }
5298 #ifdef ENABLE_EDITING
5302 void edit (
void )
const
5304 #if defined(__LP64__)
5305 const char* FMT =
"\tihBrush\t\t: 0x%x\n";
5307 const char* FMT =
"\tihBrush\t\t: 0x%lx\n";
5309 printf(
"*CREATEBRUSHINDIRECT*\n" );
5310 printf( FMT, ihBrush );
5311 edit_brush_style(
"lb.lbStyle", lb.lbStyle );
5312 edit_color(
"lb.lbColor", lb.lbColor );
5313 edit_brush_hatch(
"lb.lbHatch", lb.lbHatch );
5344 ds << emr << ihFont << elfw <<
PADDING( 2 );
5351 int size (
void )
const {
return emr.nSize; }
5358 #ifdef ENABLE_EDITING
5362 void edit (
void )
const
5364 #if defined(__LP64__)
5365 const char* FMT0 =
"\tihFont\t\t\t: %d\n";
5366 const char* FMT1 =
"\tlfHeight\t\t: %d\n";
5367 const char* FMT2 =
"\tlfWidth\t\t\t: %d\n";
5368 const char* FMT3 =
"\tlfEscapement\t\t: %d\n";
5369 const char* FMT4 =
"\tlfOrientation\t\t: %d\n";
5370 const char* FMT5 =
"\telfVersion\t\t: %d\n";
5371 const char* FMT6 =
"\telfStyleSize\t\t: %d\n";
5372 const char* FMT7 =
"\telfMatch\t\t: %d\n";
5373 const char* FMT8 =
"\telfCulture\t\t: %d\n";
5375 const char* FMT0 =
"\tihFont\t\t\t: %ld\n";
5376 const char* FMT1 =
"\tlfHeight\t\t: %ld\n";
5377 const char* FMT2 =
"\tlfWidth\t\t\t: %ld\n";
5378 const char* FMT3 =
"\tlfEscapement\t\t: %ld\n";
5379 const char* FMT4 =
"\tlfOrientation\t\t: %ld\n";
5380 const char* FMT5 =
"\telfVersion\t\t: %ld\n";
5381 const char* FMT6 =
"\telfStyleSize\t\t: %ld\n";
5382 const char* FMT7 =
"\telfMatch\t\t: %ld\n";
5383 const char* FMT8 =
"\telfCulture\t\t: %ld\n";
5385 printf(
"*EXTCREATEFONTINDIRECTW*\n" );
5386 printf( FMT0, ihFont );
5387 printf( FMT1, elfw.elfLogFont.lfHeight );
5388 printf( FMT2, elfw.elfLogFont.lfWidth );
5389 printf( FMT3, elfw.elfLogFont.lfEscapement );
5390 printf( FMT4, elfw.elfLogFont.lfOrientation );
5391 printf(
"\tlfWeight\t\t: " );
5392 switch ( elfw.elfLogFont.lfWeight ) {
5393 case FW_DONTCARE: printf(
"FW_DONTCARE\n" );
break;
5394 case FW_THIN: printf(
"FW_THIN\n" );
break;
5395 case FW_EXTRALIGHT: printf(
"FW_EXTRALIGHT\n" );
break;
5396 case FW_LIGHT: printf(
"FW_LIGHT\n" );
break;
5397 case FW_NORMAL: printf(
"FW_NORMAL\n" );
break;
5398 case FW_MEDIUM: printf(
"FW_MEDIUM\n" );
break;
5399 case FW_SEMIBOLD: printf(
"FW_SEMIBOLD\n" );
break;
5400 case FW_BOLD: printf(
"FW_BOLD\n" );
break;
5401 case FW_EXTRABOLD: printf(
"FW_EXTRABOLD\n" );
break;
5402 case FW_BLACK: printf(
"FW_BLACK\n" );
break;
5404 printf(
"\tlfItalic\t\t: %d\n", elfw.elfLogFont.lfItalic );
5405 printf(
"\tlfUnderline\t\t: %d\n", elfw.elfLogFont.lfUnderline );
5406 printf(
"\tlfStrikeOut\t\t: %d\n", elfw.elfLogFont.lfStrikeOut );
5407 printf(
"\tlfCharSet\t\t: %d\n", elfw.elfLogFont.lfCharSet );
5408 printf(
"\tlfOutPrecision\t\t: %d\n", elfw.elfLogFont.lfOutPrecision );
5409 printf(
"\tlfClipPrecision\t\t: %d\n", elfw.elfLogFont.lfClipPrecision );
5410 printf(
"\tlfQuality\t\t: %d\n", elfw.elfLogFont.lfQuality );
5411 printf(
"\tlfPitchAndFamily\t: %d\n", elfw.elfLogFont.lfPitchAndFamily );
5413 printf(
"\tlfFaceName\t\t: '" );
5414 while ( elfw.elfLogFont.lfFaceName[i] != 0 && i < LF_FACESIZE ) {
5415 putchar( elfw.elfLogFont.lfFaceName[i] );
5421 printf(
"\telfFullName\t\t: '" );
5422 while ( elfw.elfFullName[i] != 0 && i < LF_FULLFACESIZE ) {
5423 putchar( elfw.elfFullName[i] );
5429 printf(
"\telfStyle\t\t: '" );
5430 while ( elfw.elfStyle[i] != 0 && i < LF_FACESIZE ) {
5431 putchar( elfw.elfStyle[i] );
5436 printf( FMT5, elfw.elfVersion );
5437 printf( FMT6, elfw.elfStyleSize );
5438 printf( FMT7, elfw.elfMatch );
5439 printf(
"\telfVendorId\t\t: '%s'\n", elfw.elfVendorId );
5440 printf( FMT8, elfw.elfCulture );
5441 printf(
"\telfPanose\t\t:\n" );
5442 printf(
"\t\tbFamilyType\t\t: %d\n", elfw.elfPanose.bFamilyType );
5443 printf(
"\t\tbSerifStyle\t\t: %d\n", elfw.elfPanose.bSerifStyle );
5444 printf(
"\t\tbWeight\t\t\t: %d\n", elfw.elfPanose.bWeight );
5445 printf(
"\t\tbProportion\t\t: %d\n", elfw.elfPanose.bProportion );
5446 printf(
"\t\tbContrast\t\t: %d\n", elfw.elfPanose.bContrast );
5447 printf(
"\t\tbStrokeVariation\t: %d\n", elfw.elfPanose.bStrokeVariation );
5448 printf(
"\t\tbArmStyle\t\t: %d\n", elfw.elfPanose.bArmStyle );
5449 printf(
"\t\tbLetterform\t\t: %d\n", elfw.elfPanose.bLetterform );
5450 printf(
"\t\tbMidline\t\t: %d\n", elfw.elfPanose.bMidline );
5451 printf(
"\t\tbXHeight\t\t: %d\n", elfw.elfPanose.bXHeight );
5478 ds << emr << ihPal << lgpl;
5484 int size (
void )
const {
return emr.nSize; }
5491 #ifdef ENABLE_EDITING
5495 void edit (
void )
const
5497 printf(
"*CREATEPALETTE* (not really handled by libEMF)\n" );
5513 emr.iType = EMR_FILLPATH;
5515 rclBounds = *bounds;
5523 ds >> emr >> rclBounds;
5530 ds << emr << rclBounds;
5536 int size (
void )
const {
return emr.nSize; }
5547 #ifdef ENABLE_EDITING
5551 void edit (
void )
const
5553 printf(
"*FILLPATH*\n" );
5554 edit_rectl(
"rclBounds", rclBounds );
5569 emr.iType = EMR_STROKEPATH;
5571 rclBounds = *bounds;
5579 ds >> emr >> rclBounds;
5586 ds << emr << rclBounds;
5592 int size (
void )
const {
return emr.nSize; }
5603 #ifdef ENABLE_EDITING
5607 void edit (
void )
const
5609 printf(
"*STROKEPATH*\n" );
5610 edit_rectl(
"rclBounds", rclBounds );
5625 emr.iType = EMR_STROKEANDFILLPATH;
5627 rclBounds = *bounds;
5635 ds >> emr >> rclBounds;
5642 ds << emr << rclBounds;
5648 int size (
void )
const {
return emr.nSize; }
5657 StrokeAndFillPath( dc );
5659 #ifdef ENABLE_EDITING
5663 void edit (
void )
const
5665 printf(
"*STROKEANDFILLPATH*\n" );
5666 edit_rectl(
"rclBounds", rclBounds );
5681 emr.iType = EMR_BEGINPATH;
5703 int size (
void )
const {
return emr.nSize; }
5714 #ifdef ENABLE_EDITING
5718 void edit (
void )
const
5720 printf(
"*BEGINPATH*\n" );
5735 emr.iType = EMR_ENDPATH;
5757 int size (
void )
const {
return emr.nSize; }
5768 #ifdef ENABLE_EDITING
5772 void edit (
void )
const
5774 printf(
"*ENDPATH*\n" );
5789 emr.iType = EMR_CLOSEFIGURE;
5811 int size (
void )
const {
return emr.nSize; }
5822 #ifdef ENABLE_EDITING
5826 void edit (
void )
const
5828 printf(
"*CLOSEFIGURE*\n" );
5844 emr.iType = EMR_SAVEDC;
5866 int size (
void )
const {
return emr.nSize; }
5877 #ifdef ENABLE_EDITING
5881 void edit (
void )
const
5883 printf(
"*SAVEDC*\n" );
5898 emr.iType = EMR_RESTOREDC;
5908 ds >> emr >> iRelative;
5915 ds << emr << iRelative;
5921 int size (
void )
const {
return emr.nSize; }
5930 RestoreDC( dc, iRelative );
5932 #ifdef ENABLE_EDITING
5936 void edit (
void )
const
5938 #if defined(__LP64__)
5939 const char* FMT =
"\tiRelative: %d\n";
5941 const char* FMT =
"\tiRelative: %ld\n";
5943 printf(
"*RESTOREDC*\n" );
5944 printf( FMT, iRelative );
5959 emr.iType = EMR_SETMETARGN;
5981 int size (
void )
const {
return emr.nSize; }
5992 #ifdef ENABLE_EDITING
5996 void edit (
void )
const
5998 printf(
"*SETMETARGN*\n" );
6014 lopnStyle = lpen->lopnStyle;
6015 lopnWidth = lpen->lopnWidth;
6016 lopnColor = lpen->lopnColor;
6021 OBJECTTYPE
getType (
void )
const {
return O_PEN; }
6046 elpPenStyle = lpen->elpPenStyle;
6047 elpWidth = lpen->elpWidth;
6048 elpBrushStyle = lpen->elpBrushStyle;
6049 elpColor = lpen->elpColor;
6050 elpHatch = lpen->elpHatch;
6052 elpStyleEntry[0] = 0;
6057 OBJECTTYPE
getType (
void )
const {
return O_EXTPEN; }
6082 lbStyle = lbrush->lbStyle;
6083 lbColor = lbrush->lbColor;
6084 lbHatch = lbrush->lbHatch;
6089 OBJECTTYPE
getType (
void )
const {
return O_BRUSH; }
6114 this->elfLogFont = *lfont;
6117 memset( &elfFullName, 0,
sizeof elfFullName );
6118 memset( &elfStyle, 0,
sizeof elfStyle );
6119 elfVersion = ELF_VERSION;
6123 memset( &elfVendorId, 0,
sizeof elfVendorId );
6124 elfCulture = ELF_CULTURE_LATIN;
6125 memset( &elfPanose, 1,
sizeof(PANOSE) );
6130 OBJECTTYPE
getType (
void )
const {
return O_FONT; }
6155 EMF_UNUSED(lpalette);
6158 PALETTEENTRY zero_entry = { 0, 0, 0, 0 };
6159 palPalEntry[0] = zero_entry;
6164 OBJECTTYPE
getType (
void )
const {
return O_PALETTE; }
6189 emr.iType = EMR_SETMITERLIMIT;
6191 eMiterLimit = limit;
6200 ds >> emr >> miter_limit;
6201 eMiterLimit = float(miter_limit);
6208 ds << emr << (int)eMiterLimit;
6214 int size (
void )
const {
return emr.nSize; }
6223 SetMiterLimit( dc, eMiterLimit, 0 );
6225 #ifdef ENABLE_EDITING
6229 void edit (
void )
const
6231 printf(
"*SETMITERLIMIT*\n" );
6232 printf(
"\teMiterLimit\t: %f\n", eMiterLimit );
6252 void init (
const RECT* size, LPCWSTR description_w ) {
6269 header->rclFrame.left = size->left;
6270 header->rclFrame.top = size->top;
6271 header->rclFrame.right = size->right;
6272 header->rclFrame.bottom = size->bottom;
6275 size->left *
header->szlDevice.cx / (
header->szlMillimeters.cx * 100 );
6277 size->top *
header->szlDevice.cy / (
header->szlMillimeters.cy * 100 );
6278 header->rclBounds.right =
6279 size->right *
header->szlDevice.cx / (
header->szlMillimeters.cx * 100 );
6280 header->rclBounds.bottom =
6281 size->bottom *
header->szlDevice.cy / (
header->szlMillimeters.cy * 100 );
6286 header->rclBounds.left = -10;
6287 header->rclBounds.top = -10;
6288 header->rclBounds.right = 10;
6289 header->rclBounds.bottom = 10;
6291 header->rclFrame.left = (LONG)floor( (
float)
header->rclBounds.left *
6292 header->szlMillimeters.cx * 100 /
header->szlDevice.cx );
6293 header->rclFrame.top = (LONG)floor( (
float)
header->rclBounds.top *
6294 header->szlMillimeters.cy * 100 /
header->szlDevice.cy );
6295 header->rclFrame.right = (LONG)ceil( (
float)
header->rclBounds.right *
6296 header->szlMillimeters.cx * 100 /
header->szlDevice.cx );
6297 header->rclFrame.bottom = (LONG)ceil( (
float)
header->rclBounds.bottom *
6298 header->szlMillimeters.cy * 100 /
header->szlDevice.cy );
6303 SIZEL default_resolution = { RESOLUTION, RESOLUTION };
6305 SIZEL default_viewport_ext = { 1, 1 };
6307 POINT default_viewport_org = { 0, 0 };
6309 SIZEL default_window_ext = { 1, 1 };
6311 POINT default_window_org = { 0, 0 };
6317 pen = (
PEN*)globalObjects.
find( BLACK_PEN | ENHMETA_STOCK_OBJECT );
6318 brush = (
BRUSH*)globalObjects.
find( BLACK_BRUSH | ENHMETA_STOCK_OBJECT );
6319 font = (
FONT*)globalObjects.
find( DEVICE_DEFAULT_FONT | ENHMETA_STOCK_OBJECT);
6399 LPCWSTR description_w )
6400 :
fp(fp_),
ds( fp_ )
6402 init( size, description_w );
6418 OBJECTTYPE
getType (
void )
const {
return O_METAFILEDEVICECONTEXT; }
6425 for (
unsigned int i = 1; i <
handles.size(); i++ ) {
6474 for ( std::vector<METARECORD*>::const_iterator r =
records.begin();
6515 header->rclFrame.left = (LONG)floor( (
float)
header->rclBounds.left *
6516 header->szlMillimeters.cx * 100 /
header->szlDevice.cx );
6523 header->rclFrame.right = (LONG)ceil( (
float)
header->rclBounds.right *
6524 header->szlMillimeters.cx * 100 /
header->szlDevice.cx );
6532 header->rclFrame.top = (LONG)floor( (
float)
header->rclBounds.top *
6533 header->szlMillimeters.cy * 100 /
header->szlDevice.cy );
6540 header->rclFrame.bottom = (LONG)ceil( (
float)
header->rclBounds.bottom *
6541 header->szlMillimeters.cy * 100 /
header->szlDevice.cy );
EMRSETTEXTCOLOR(DATASTREAM &ds)
Definition: libemf.h:2370
EMRSETBKMODE(DWORD mode)
Definition: libemf.h:2475
SIZEL resolution
The resolution in DPI of the reference DC.
Definition: libemf.h:6353
int size(void) const
Definition: libemf.h:2766
static EMF::METARECORD * new_extcreatepen(DATASTREAM &ds)
Create a new EXTCREATEPEN record.
Definition: libemf.cpp:449
bool serialize(DATASTREAM ds)
Definition: libemf.h:5283
static EMF::METARECORD * new_polypolygon(DATASTREAM &ds)
Create a new POLYPOLYGON record.
Definition: libemf.cpp:389
bool serialize(DATASTREAM ds)
Definition: libemf.h:2758
int size(void) const
Definition: libemf.h:3164
EMRSETMAPMODE(DATASTREAM &ds)
Definition: libemf.h:2620
OBJECT * find(const HGDIOBJ handle)
Definition: libemf.cpp:213
bool serialize(DATASTREAM ds)
Definition: libemf.h:5584
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:1833
EMRPOLYBEZIER(const RECTL *bounds, const POINT *points, INT n)
Definition: libemf.h:3944
EMRSCALEWINDOWEXTEX(DATASTREAM &ds)
Definition: libemf.h:2078
INT bk_mode
The current background mode.
Definition: libemf.h:6369
Represent an array of points in a simple way.
Definition: libemf.h:140
EMF Filled Polygon.
Definition: libemf.h:3399
static EMF::METARECORD * new_polybezierto16(DATASTREAM &ds)
Create a new POLYBEZIERTO16 record.
Definition: libemf.cpp:414
EMRSETTEXTALIGN(DATASTREAM &ds)
Definition: libemf.h:2284
bool serialize(DATASTREAM ds)
Definition: libemf.h:4905
const DWORD n_
Number of POINTLs in array.
Definition: libemf.h:142
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.cpp:669
BRUSH * brush
The current brush.
Definition: libemf.h:6363
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:5654
EMRPOLYLINETO16(DATASTREAM &ds)
Definition: libemf.h:4503
static EMF::METARECORD * new_deleteobject(DATASTREAM &ds)
Create a new DELETEOBJECT record.
Definition: libemf.cpp:334
EMRSELECTOBJECT(HGDIOBJ object)
Definition: libemf.h:2683
EMF PolyBezierTo.
Definition: libemf.h:4144
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:1959
Represent an array of double word integers in a simple way.
Definition: libemf.h:188
static EMF::METARECORD * new_lineto(DATASTREAM &ds)
Create a new LINETO record.
Definition: libemf.cpp:344
EMRARC(DATASTREAM &ds)
Definition: libemf.h:2943
ENHMETAHEADER * header
Definition: libemf.h:6346
static EMF::METARECORD * new_createpen(DATASTREAM &ds)
Create a new CREATEPEN record.
Definition: libemf.cpp:444
int size(void) const
Definition: libemf.h:4531
EMRRESTOREDC(INT n)
Definition: libemf.h:5896
EMRMOVETOEX(DATASTREAM &ds)
Definition: libemf.h:2811
bool serialize(DATASTREAM ds)
Definition: libemf.h:5338
EMF Polyline16.
Definition: libemf.h:3286
EMRSETPIXELV(DATASTREAM &ds)
Definition: libemf.h:5086
EMF Polybezier.
Definition: libemf.h:3936
~EMREXTTEXTOUTA()
Definition: libemf.h:4667
int size(void) const
Definition: libemf.h:5159
All metafile records must be padded out to a multiple of 4 bytes.
Definition: libemf.h:204
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:2891
EMRSETPOLYFILLMODE(DATASTREAM &ds)
Definition: libemf.h:2552
bool serialize(DATASTREAM ds)
Definition: libemf.h:3450
EMRSTROKEPATH(const RECTL *bounds)
Definition: libemf.h:5567
EMRPOLYGON(DATASTREAM &ds)
Definition: libemf.h:3430
void mergePoint(const POINT &p)
Definition: libemf.h:6496
SIZEL viewport_ext
The extent of the viewport.
Definition: libemf.h:6354
const DWORD n_
Number of POINT16s in array.
Definition: libemf.h:158
EMRPOLYBEZIERTO16(const RECTL *bounds, const POINT *points, INT n)
Definition: libemf.h:4272
bool serialize(DATASTREAM ds)
Definition: libemf.h:5695
Global GDI object.
Definition: libemf.h:1230
EMRSAVEDC(void)
Definition: libemf.h:5842
EMRPOLYPOLYGON16(const RECTL *bounds, const POINT16 *points, const INT *counts, UINT16 polygons)
Definition: libemf.h:3804
int size(void) const
Definition: libemf.h:2567
bool serialize(DATASTREAM ds)
Definition: libemf.h:3362
int size(void) const
Definition: libemf.h:5866
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:2641
~EMRPOLYPOLYGON()
Definition: libemf.h:3654
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:2305
bool serialize(DATASTREAM ds)
Definition: libemf.h:4107
static EMF::METARECORD * new_savedc(DATASTREAM &ds)
Create a new SAVEDC record.
Definition: libemf.cpp:494
bool serialize(DATASTREAM ds)
Definition: libemf.h:1756
EMREXTTEXTOUTW(DATASTREAM &ds)
Definition: libemf.h:4865
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:2034
EMRCREATEPEN(PEN *pen, HGDIOBJ handle)
Definition: libemf.cpp:514
EMRSETVIEWPORTORGEX(INT x, INT y)
Definition: libemf.h:1738
EMRPOLYBEZIER(DATASTREAM &ds)
Definition: libemf.h:3967
int size(void) const
Definition: libemf.h:1764
DATASTREAM & operator>>(BYTE &byte)
Definition: libemf.h:252
static EMF::METARECORD * new_setpolyfillmode(DATASTREAM &ds)
Create a new SETPOLYFILLMODE record.
Definition: libemf.cpp:319
OBJECTTYPE getType(void) const
Definition: libemf.h:6057
bool serialize(DATASTREAM ds)
Definition: libemf.h:5858
static EMF::METARECORD * new_createbrushindirect(DATASTREAM &ds)
Create a new CREATEBRUSHINDIRECT record.
Definition: libemf.cpp:454
int size(void) const
Definition: libemf.h:1703
EMRPOLYBEZIER16(const RECTL *bounds, const POINT *points, INT n)
Definition: libemf.h:4064
EMRSTROKEANDFILLPATH(DATASTREAM &ds)
Definition: libemf.h:5633
bool serialize(DATASTREAM ds)
Definition: libemf.h:5640
void deleteMetafile(void)
Definition: libemf.h:6472
bool serialize(DATASTREAM ds)
Definition: libemf.h:5913
~EMREXTTEXTOUTW()
Definition: libemf.h:4897
POINT16ARRAY(POINT16 *const points, const DWORD n)
Definition: libemf.h:164
EMRSCALEWINDOWEXTEX(LONG x_num, LONG x_den, LONG y_num, LONG y_den)
Definition: libemf.h:2065
static EMF::METARECORD * new_setviewportextex(DATASTREAM &ds)
Create a new EMRSETVIEWPORTEXTEX record.
Definition: libemf.cpp:269
EMRPOLYLINE(const RECTL *bounds, const POINT *points, INT n)
Definition: libemf.h:3199
EMRPOLYBEZIERTO(const RECTL *bounds, const POINT *points, INT n)
Definition: libemf.h:4152
EMRPOLYBEZIERTO16(DATASTREAM &ds)
Definition: libemf.h:4295
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:4121
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:3106
EMRLINETO(DATASTREAM &ds)
Definition: libemf.h:2870
EMRSETMAPMODE(DWORD mode)
Definition: libemf.h:2610
void appendRecord(METARECORD *record)
Definition: libemf.h:6449
EMRSETPIXELV(INT x, INT y, COLORREF color)
Definition: libemf.h:5074
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:3376
const DWORD n_
Number of double words in array.
Definition: libemf.h:190
EMRPOLYPOLYGON(const RECTL *bounds, const POINT *points, const INT *counts, UINT polygons)
Definition: libemf.h:3617
int size(void) const
Definition: libemf.h:5592
METAFILEDEVICECONTEXT(FILE *fp_, const RECT *size, LPCWSTR description_w)
Definition: libemf.h:6398
static EMF::METARECORD * new_setwindowextex(DATASTREAM &ds)
Create a new EMRSETWINDOWEXTEX record.
Definition: libemf.cpp:274
WCHAR *const string_
String of WCHARs.
Definition: libemf.h:90
POINT16 *const points_
Array of POINT16s.
Definition: libemf.h:157
bool serialize(DATASTREAM ds)
Definition: libemf.h:4523
EMF Filled Polygon16.
Definition: libemf.h:3494
EMF Set Window Extent (ex)
Definition: libemf.h:1996
EMRENDPATH(void)
Definition: libemf.h:5733
int size(void) const
Definition: libemf.h:3034
int size(void) const
Definition: libemf.h:3878
static EMF::METARECORD * new_arc(DATASTREAM &ds)
Create a new ARC record.
Definition: libemf.cpp:349
FONT(const LOGFONTW *lfont)
Definition: libemf.h:6112
static EMF::METARECORD * new_polylineto(DATASTREAM &ds)
Create a new POLYLINETO record.
Definition: libemf.cpp:419
void appendHandle(METARECORD *record)
Definition: libemf.h:6461
~EMRPOLYBEZIERTO()
Definition: libemf.h:4188
Support different endian modes when reading and writing the metafile.
Definition: libemf.h:222
bool serialize(DATASTREAM ds)
Definition: libemf.h:5749
EMRSETTEXTCOLOR(COLORREF color)
Definition: libemf.h:2360
DWORDARRAY(DWORD *const dwords, const DWORD n)
Definition: libemf.h:196
int size(void) const
Definition: libemf.h:2500
DWORD nextHandle(void)
Definition: libemf.h:6423
static EMF::METARECORD * new_settextalign(DATASTREAM &ds)
Create a new SETTEXTALIGN record.
Definition: libemf.cpp:299
EMRSTROKEPATH(DATASTREAM &ds)
Definition: libemf.h:5577
static EMF::METARECORD * new_setmapmode(DATASTREAM &ds)
Create a new SETMAPMODE record.
Definition: libemf.cpp:324
EMRSETMITERLIMIT(FLOAT limit)
Definition: libemf.h:6187
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:4922
~EMRPOLYLINE16()
Definition: libemf.h:3341
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:5709
std::map< HDC, HGDIOBJ > contexts
Definition: libemf.h:1260
int size(void) const
Definition: libemf.h:5351
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.cpp:614
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:3040
~EMRPOLYBEZIER16()
Definition: libemf.h:4100
bool serialize(DATASTREAM ds)
Definition: libemf.h:5209
Represent a byte array in a simple way.
Definition: libemf.h:124
EMRPOLYLINETO16(const RECTL *bounds, const POINT *points, INT n)
Definition: libemf.h:4480
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:2391
EMRPOLYLINETO(const RECTL *bounds, const POINT *points, INT n)
Definition: libemf.h:4360
virtual ~GRAPHICSOBJECT()
GRAPHICSOBJECTs has a virtual destructor.
Definition: libemf.h:1255
static EMF::METARECORD * new_setviewportorgex(DATASTREAM &ds)
Create a new EMRSETVIEWPORTORGEX record.
Definition: libemf.cpp:259
EMF Set the Polygon Fill Mode.
Definition: libemf.h:2537
static EMF::METARECORD * new_strokepath(DATASTREAM &ds)
Create a new STROKEPATH record.
Definition: libemf.cpp:469
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:6220
int size(void) const
Definition: libemf.h:2708
EMREXTCREATEFONTINDIRECTW(FONT *font, HGDIOBJ handle)
Definition: libemf.cpp:633
static EMF::METARECORD * new_rectangle(DATASTREAM &ds)
Create a new RECTANGLE record.
Definition: libemf.cpp:359
static EMF::METARECORD * new_settextcolor(DATASTREAM &ds)
Create a new SETTEXTCOLOR record.
Definition: libemf.cpp:304
EXTPEN(const EXTLOGPEN *lpen)
Definition: libemf.h:6044
virtual ~METAFILEDEVICECONTEXT()
Definition: libemf.h:6408
DATASTREAM ds
Definition: libemf.h:6342
EMF Brush.
Definition: libemf.h:5267
EMF PolyBezierTo16.
Definition: libemf.h:4239
EMF Poly Polygon.
Definition: libemf.h:3607
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:3697
HGDIOBJ handle
Definition: libemf.h:1232
EMRFILLPATH(const RECTL *bounds)
Definition: libemf.h:5511
METARECORD * newEMR(HDC dc, HGDIOBJ emf_handle)
Definition: libemf.h:6171
EMRCREATEPALETTE(PALETTE *palette, HGDIOBJ handle)
Definition: libemf.cpp:661
int size(void) const
Definition: libemf.h:3691
int size(void) const
Definition: libemf.h:2958
EMRPOLYGON(const RECTL *bounds, const POINT *points, INT n)
Definition: libemf.h:3407
static EMF::METARECORD * new_polyline16(DATASTREAM &ds)
Create a new POLYLINE16 record.
Definition: libemf.cpp:374
EMF Save DC.
Definition: libemf.h:5837
INTARRAY(INT *const ints, const DWORD n)
Definition: libemf.h:180
INT *const ints_
Array of ints.
Definition: libemf.h:173
bool serialize(DATASTREAM ds)
Definition: libemf.h:5528
~EMRPOLYGON()
Definition: libemf.h:3443
int size(void) const
Definition: libemf.h:5757
EMRSELECTOBJECT(DATASTREAM &ds)
Definition: libemf.h:2693
bool serialize(DATASTREAM ds)
Definition: libemf.h:4403
A global graphics object.
Definition: libemf.h:1252
EMRRESTOREDC(DATASTREAM &ds)
Definition: libemf.h:5906
OBJECTTYPE getType(void) const
Definition: libemf.h:6418
EMF Palette.
Definition: libemf.h:5460
const int size_
Number of bytes of padding.
Definition: libemf.h:206
std::vector< bool > handles
Definition: libemf.h:6379
EMF Set Mapping Mode.
Definition: libemf.h:2605
int size(void) const
Definition: libemf.h:2299
EMRARCTO(INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend)
Definition: libemf.h:3001
EMRDELETEOBJECT(DATASTREAM &ds)
Definition: libemf.h:2751
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:2573
WCHARSTR(WCHAR *const string, const int length)
Definition: libemf.h:97
EMF PolylineTo16.
Definition: libemf.h:4447
EMF Pen.
Definition: libemf.h:5135
int size(void) const
Definition: libemf.h:4686
~EMRPOLYLINETO16()
Definition: libemf.h:4516
EMRCREATEBRUSHINDIRECT(BRUSH *brush, HGDIOBJ handle)
Definition: libemf.cpp:606
std::vector< EMF::OBJECT * >::const_iterator end(void) const
Definition: libemf.h:1304
POINT viewport_org
The origin of the viewport.
Definition: libemf.h:6355
EMF Restore DC.
Definition: libemf.h:5891
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.cpp:537
EMF Ellipse.
Definition: libemf.h:3127
const DWORD n_
Number of ints in array.
Definition: libemf.h:174
PADDING(const int size)
Definition: libemf.h:211
bool serialize(DATASTREAM ds)
Definition: libemf.h:2085
EMRDELETEOBJECT(HGDIOBJ object)
Definition: libemf.h:2741
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:3884
EMRPOLYLINE(DATASTREAM &ds)
Definition: libemf.h:3229
POINT window_org
The origin of the window.
Definition: libemf.h:6357
EMF Set Background Color.
Definition: libemf.h:2412
static EMF::METARECORD * new_arcto(DATASTREAM &ds)
Create a new ARCTO record.
Definition: libemf.cpp:354
virtual ~OBJECT()
OBJECTs have a virtual destructor.
Definition: libemf.h:1234
EMF Stroke path.
Definition: libemf.h:5562
EMRFILLPATH(DATASTREAM &ds)
Definition: libemf.h:5521
EMRSETVIEWPORTEXTEX(INT cx, INT cy)
Definition: libemf.h:1862
EMRMOVETOEX(INT x, INT y)
Definition: libemf.h:2800
static EMF::METARECORD * new_exttextoutw(DATASTREAM &ds)
Create a new EXTTEXTOUTW record.
Definition: libemf.cpp:434
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:3584
int size(void) const
Definition: libemf.h:1953
Graphics Font.
Definition: libemf.h:6107
const int length_
Number of single byte characters in array.
Definition: libemf.h:109
static EMF::METARECORD * new_polygon(DATASTREAM &ds)
Create a new POLYGON record.
Definition: libemf.cpp:379
EMF Arc.
Definition: libemf.h:2912
bool serialize(DATASTREAM ds)
Definition: libemf.h:1695
bool serialize(DATASTREAM ds)
Definition: libemf.h:3869
EMF Scale Viewport Extents (ex)
Definition: libemf.h:1917
static EMF::METARECORD * new_polylineto16(DATASTREAM &ds)
Create a new POLYLINETO16 record.
Definition: libemf.cpp:424
EMRSETMITERLIMIT(DATASTREAM &ds)
Definition: libemf.h:6197
Graphics Pen.
Definition: libemf.h:6007
DATASTREAM & operator<<(const BYTE &byte)
Definition: libemf.h:243
int size(void) const
Definition: libemf.h:5536
static EMF::METARECORD * new_setpixelv(DATASTREAM &ds)
Create a new SETPIXELV record.
Definition: libemf.cpp:439
bool serialize(DATASTREAM ds)
Definition: libemf.h:3242
BRUSH(const LOGBRUSH *lbrush)
Definition: libemf.h:6080
METARECORD * newEMR(HDC dc, HGDIOBJ emf_handle)
Definition: libemf.h:6137
EMRLINETO(INT x, INT y)
Definition: libemf.h:2859
static EMF::METARECORD * new_scalewindowextex(DATASTREAM &ds)
Create a new SCALEWINDOWEXTEX record.
Definition: libemf.cpp:284
EMREXTTEXTOUTA(DATASTREAM &ds)
Definition: libemf.h:4635
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:1709
static EMF::METARECORD * new_beginpath(DATASTREAM &ds)
Create a new BEGINPATH record.
Definition: libemf.cpp:479
METARECORD * newEMR(HDC dc, HGDIOBJ emf_handle)
Definition: libemf.h:6096
POINT point
The current point.
Definition: libemf.h:6361
int size(void) const
Definition: libemf.h:5101
bool serialize(DATASTREAM ds)
Definition: libemf.h:3026
INT polyfill_mode
The current polygon fill mode.
Definition: libemf.h:6370
bool serialize(DATASTREAM ds)
Definition: libemf.h:2877
EMRBEGINPATH(void)
Definition: libemf.h:5679
static EMF::METARECORD * new_closefigure(DATASTREAM &ds)
Create a new CLOSEFIGURE record.
Definition: libemf.cpp:489
EMRPOLYGON16(const RECTL *bounds, const POINT16 *points, INT16 n)
Definition: libemf.h:3527
void clearHandle(DWORD handle)
Definition: libemf.h:6440
PEN(const LOGPEN *lpen)
Definition: libemf.h:6012
static EMF::METARECORD * new_setworldtransform(DATASTREAM &ds)
Create a new SETWORLDTRANSFORM record.
Definition: libemf.cpp:294
EMF Set Viewport Origin (ex)
Definition: libemf.h:1732
bool serialize(DATASTREAM ds)
Definition: libemf.h:2700
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:2099
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:3256
bool serialize(DATASTREAM ds)
Definition: libemf.h:1880
EMF Scale Window Extents (ex)
Definition: libemf.h:2057
OBJECTTYPE getType(void) const
Definition: libemf.h:6164
EMF Begin Path.
Definition: libemf.h:5674
EMRPOLYLINETO16(const RECTL *bounds, const POINT16 *points, INT n)
Definition: libemf.h:4455
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.cpp:647
PEN * pen
The current pen.
Definition: libemf.h:6362
EMRSETWINDOWEXTEX(INT cx, INT cy)
Definition: libemf.h:2002
virtual OBJECTTYPE getType(void) const =0
EMF Set Viewport Extents (ex)
Definition: libemf.h:1856
bool serialize(DATASTREAM ds)
Definition: libemf.h:5476
~EMRPOLYLINE()
Definition: libemf.h:3221
::FILE * fp
Definition: libemf.h:6337
~EMRPOLYBEZIERTO16()
Definition: libemf.h:4308
EMF Set Pixel.
Definition: libemf.h:5067
EMF Set Text Alignment.
Definition: libemf.h:2269
COLORREF bk_color
The current background color.
Definition: libemf.h:6368
static EMF::METARECORD * new_modifyworldtransform(DATASTREAM &ds)
Create a new MODIFYWORLDTRANSFORM record.
Definition: libemf.cpp:289
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:3464
void remove(const OBJECT *object)
Definition: libemf.cpp:227
~EMRPOLYBEZIER()
Definition: libemf.h:3980
EMF PolylineTo.
Definition: libemf.h:4352
bool serialize(DATASTREAM ds)
Definition: libemf.h:3682
EMF Polyline.
Definition: libemf.h:3191
EMRSETVIEWPORTEXTEX(DATASTREAM &ds)
Definition: libemf.h:1873
static EMF::METARECORD * new_polybezier(DATASTREAM &ds)
Create a new POLYBEZIER record.
Definition: libemf.cpp:399
static EMF::METARECORD * new_restoredc(DATASTREAM &ds)
Create a new RESTOREDC record.
Definition: libemf.cpp:499
bool serialize(DATASTREAM ds)
Definition: libemf.h:1819
static EMF::METARECORD * new_extcreatefontindirectw(DATASTREAM &ds)
Create a new EXTCREATEFONTINDIRECTW record.
Definition: libemf.cpp:459
static EMF::METARECORD * new_setbkmode(DATASTREAM &ds)
Create a new SETBKMODE record.
Definition: libemf.cpp:314
EMRSETBKCOLOR(COLORREF color)
Definition: libemf.h:2417
METARECORDCTOR newRecord(DWORD iType) const
Definition: libemf.cpp:243
int size(void) const
Definition: libemf.h:4916
EMF Extended Text Output ASCII.
Definition: libemf.h:4562
~EMRPOLYGON16()
Definition: libemf.h:3563
static EMF::METARECORD * new_setbkcolor(DATASTREAM &ds)
Create a new SETBKCOLOR record.
Definition: libemf.cpp:309
PALETTE * palette
The current palette.
Definition: libemf.h:6365
static EMF::METARECORD * new_endpath(DATASTREAM &ds)
Create a new ENDPATH record.
Definition: libemf.cpp:484
EMRPOLYPOLYGON16(const RECTL *bounds, const POINT *points, const INT *counts, UINT polygons)
Definition: libemf.h:3763
EMRSETBKMODE(DATASTREAM &ds)
Definition: libemf.h:2485
bool serialize(DATASTREAM ds)
Definition: libemf.h:2377
int size(void) const
Definition: libemf.h:3458
bool serialize(DATASTREAM ds)
Definition: libemf.h:6206
~EMRPOLYPOLYGON16()
Definition: libemf.h:3841
Extended Graphics Pen.
Definition: libemf.h:6039
EMRSETPOLYFILLMODE(DWORD mode)
Definition: libemf.h:2542
const int n_
Number of bytes in array.
Definition: libemf.h:126
std::vector< EMF::METARECORD * > records
Definition: libemf.h:6350
Graphics Device Context.
Definition: libemf.h:6244
EMRPOLYLINE16(const RECTL *bounds, const POINT16 *points, INT n)
Definition: libemf.h:3294
EMRENDPATH(DATASTREAM &ds)
Definition: libemf.h:5742
EMF SetMiterLimit.
Definition: libemf.h:6182
bool serialize(DATASTREAM ds)
Definition: libemf.h:5093
EMREXTTEXTOUTA(const RECTL *bounds, DWORD graphicsMode, FLOAT xScale, FLOAT yScale, const PEMRTEXT text, LPCSTR string, const INT *dx)
Definition: libemf.h:4577
POINT min_device_point
The lft/top-most painted point in device units.
Definition: libemf.h:6359
int size(void) const
Definition: libemf.h:3370
POINT max_device_point
The rgt/btm-most painted point in device units.
Definition: libemf.h:6360
BYTE *const array_
Array of unsigned bytes.
Definition: libemf.h:125
Represent an array of 16-bit point in a simple way.
Definition: libemf.h:156
Definition: libemf.h:1275
DWORD *const dwords_
Array of double words.
Definition: libemf.h:189
bool serialize(DATASTREAM ds)
Definition: libemf.h:2627
std::vector< EMF::OBJECT * >::const_iterator begin(void) const
Definition: libemf.h:1299
static EMF::METARECORD * new_polygon16(DATASTREAM &ds)
Create a new POLYGON16 record.
Definition: libemf.cpp:384
int size(void) const
Definition: libemf.h:3578
int size(void) const
Definition: libemf.h:3100
int size(void) const
Definition: libemf.h:2826
EMREXTTEXTOUTW(const RECTL *bounds, DWORD graphicsMode, FLOAT xScale, FLOAT yScale, const PEMRTEXT text, LPCWSTR string, const INT *dx)
Definition: libemf.h:4807
EMREOF(DATASTREAM &ds)
Definition: libemf.h:1687
int size(void) const
Definition: libemf.h:1888
int size(void) const
Definition: libemf.h:2093
int size(void) const
Definition: libemf.h:5291
EMRBEGINPATH(DATASTREAM &ds)
Definition: libemf.h:5688
EMF Poly Polygon16.
Definition: libemf.h:3753
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:5763
bool serialize(DATASTREAM ds)
Definition: libemf.h:3570
UINT text_alignment
The current text alignment.
Definition: libemf.h:6366
EMRARCTO(DATASTREAM &ds)
Definition: libemf.h:3019
EMF Font.
Definition: libemf.h:5322
bool serialize(DATASTREAM ds)
Definition: libemf.h:5151
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:2832
EMRSETWINDOWORGEX(DATASTREAM &ds)
Definition: libemf.h:1812
int size(void) const
Definition: libemf.h:5648
static EMF::METARECORD * new_setwindoworgex(DATASTREAM &ds)
Create a new EMRSETWINDOWORGEX record.
Definition: libemf.cpp:264
int size(void) const
Definition: libemf.h:5921
int size(void) const
Definition: libemf.h:2885
static EMF::METARECORD * new_polypolygon16(DATASTREAM &ds)
Create a new POLYPOLYGON16 record.
Definition: libemf.cpp:394
int size(void) const
Definition: libemf.h:4203
METARECORD * newEMR(HDC dc, HGDIOBJ emf_handle)
Definition: libemf.h:6064
static EMF::METARECORD * new_ellipse(DATASTREAM &ds)
Create a new ELLIPSE record.
Definition: libemf.cpp:364
int size(void) const
Definition: libemf.h:1827
EMF Set Background Mode.
Definition: libemf.h:2470
int size(void) const
Definition: libemf.h:4323
bool serialize(DATASTREAM ds)
Definition: libemf.h:4195
Represent an ASCII character string in a simple way.
Definition: libemf.h:107
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:5542
EMRPOLYPOLYGON(DATASTREAM &ds)
Definition: libemf.h:3663
EMRARC(INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend)
Definition: libemf.h:2925
void setStream(::FILE *fp)
Definition: libemf.h:238
EMRPOLYLINETO(DATASTREAM &ds)
Definition: libemf.h:4383
EMRSCALEVIEWPORTEXTEX(DATASTREAM &ds)
Definition: libemf.h:1938
POINTL *const points_
Array of POINTLs.
Definition: libemf.h:141
int size(void) const
Definition: libemf.h:4411
static EMF::METARECORD * new_movetoex(DATASTREAM &ds)
Create a new MOVETOEX record.
Definition: libemf.cpp:339
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:2964
EMF Select Object.
Definition: libemf.h:2678
EMREOF(void)
Definition: libemf.h:1674
EMF Set Text Color.
Definition: libemf.h:2355
EMF End Path.
Definition: libemf.h:5728
EMRSETVIEWPORTORGEX(DATASTREAM &ds)
Definition: libemf.h:1749
OBJECTTYPE getType(void) const
Definition: libemf.h:6089
~EMRPOLYLINETO()
Definition: libemf.h:4396
bool serialize(DATASTREAM ds)
Definition: libemf.h:2818
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:4537
DATASTREAM(::FILE *fp=0)
Definition: libemf.h:233
EMRPOLYBEZIERTO(DATASTREAM &ds)
Definition: libemf.h:4175
void mergePoint(const LONG &x, const LONG &y)
Definition: libemf.h:6485
EMF Arc To.
Definition: libemf.h:2988
Represent a wide (UNICODE) character string in a simple way.
Definition: libemf.h:89
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:5598
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:1894
EMRPOLYBEZIERTO16(const RECTL *bounds, const POINT16 *points, INT n)
Definition: libemf.h:4247
EMF Polybezier16.
Definition: libemf.h:4031
SIZEL window_ext
The extent of the window.
Definition: libemf.h:6356
EMF Fill path.
Definition: libemf.h:5506
bool serialize(DATASTREAM ds)
Definition: libemf.h:3092
std::map< HGDIOBJ, HGDIOBJ > emf_handles
Definition: libemf.h:6386
static EMF::METARECORD * new_selectobject(DATASTREAM &ds)
Create a new SELECTOBJECT record.
Definition: libemf.cpp:329
EMF Delete Object.
Definition: libemf.h:2736
COLORREF text_color
The current text foreground color.
Definition: libemf.h:6367
int size(void) const
Definition: libemf.h:4115
EMRELLIPSE(DATASTREAM &ds)
Definition: libemf.h:3149
EMF Rectangle.
Definition: libemf.h:3064
static EMF::METARECORD * new_polybezierto(DATASTREAM &ds)
Create a new POLYBEZIERTO record.
Definition: libemf.cpp:409
METARECORD * newEMR(HDC dc, HGDIOBJ emf_handle)
Definition: libemf.h:6028
static EMF::METARECORD * new_polyline(DATASTREAM &ds)
Create a new POLYLINE record.
Definition: libemf.cpp:369
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:4329
static EMF::METARECORD * new_fillpath(DATASTREAM &ds)
Create a new FILLPATH record.
Definition: libemf.cpp:464
int size(void) const
Definition: libemf.h:2385
CHARSTR(CHAR *const string, const int length)
Definition: libemf.h:115
EMRPOLYBEZIER16(const RECTL *bounds, const POINT16 *points, INT n)
Definition: libemf.h:4039
bool serialize(DATASTREAM ds)
Definition: libemf.h:3156
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:2506
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:5107
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:2448
EMREXTCREATEPEN(EXTPEN *pen, HGDIOBJ handle)
Definition: libemf.cpp:569
static const char padding_[4]
Pad with '\0's.
Definition: libemf.h:205
int size(void) const
Definition: libemf.h:2442
EMF Set Window Origin (ex)
Definition: libemf.h:1795
static EMF::METARECORD * new_strokeandfillpath(DATASTREAM &ds)
Create a new STROKEANDFILLPATH record.
Definition: libemf.cpp:474
EMRSTROKEANDFILLPATH(const RECTL *bounds)
Definition: libemf.h:5623
EMRSETWINDOWEXTEX(DATASTREAM &ds)
Definition: libemf.h:2013
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:4209
static EMF::METARECORD * new_setmiterlimit(DATASTREAM &ds)
Create a new SETMITERLIMIT record.
Definition: libemf.cpp:509
BYTEARRAY(BYTE *const array, const int n)
Definition: libemf.h:132
bool serialize(DATASTREAM ds)
Definition: libemf.h:2020
CHAR *const string_
Array of single byte characters.
Definition: libemf.h:108
EMF Extended Pen.
Definition: libemf.h:5193
EMRSETWINDOWORGEX(INT x, INT y)
Definition: libemf.h:1801
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:4417
bool serialize(DATASTREAM ds)
Definition: libemf.h:2291
FLOAT miter_limit
The current miter length limit.
Definition: libemf.h:6372
EMRPOLYLINE16(DATASTREAM &ds)
Definition: libemf.h:3349
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:5927
bool serialize(DATASTREAM ds)
Definition: libemf.h:4675
Represent an array of integers in a simple way.
Definition: libemf.h:172
OBJECTTYPE getType(void) const
Definition: libemf.h:6130
HGDIOBJ add(OBJECT *object)
Definition: libemf.cpp:180
INT map_mode
The current mapping mode.
Definition: libemf.h:6371
EMF Line To.
Definition: libemf.h:2853
int size(void) const
Definition: libemf.h:3250
EMRPOLYPOLYGON16(DATASTREAM &ds)
Definition: libemf.h:3850
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.cpp:556
bool update_frame
Update the frame automatically?
Definition: libemf.h:6358
EMRRECTANGLE(DATASTREAM &ds)
Definition: libemf.h:3085
PALETTE(const LOGPALETTE *lpalette)
Definition: libemf.h:6153
static EMF::METARECORD * new_polybezier16(DATASTREAM &ds)
Create a new POLYBEZIER16 record.
Definition: libemf.cpp:404
EMF Extended Text Output Wide character.
Definition: libemf.h:4792
Graphics Palette.
Definition: libemf.h:6148
EMRSAVEDC(DATASTREAM &ds)
Definition: libemf.h:5851
EMRPOLYBEZIER16(DATASTREAM &ds)
Definition: libemf.h:4087
int size(void) const
Definition: libemf.h:6214
EMRSETTEXTALIGN(UINT mode)
Definition: libemf.h:2274
int size(void) const
Definition: libemf.h:3995
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.cpp:581
EMRSCALEVIEWPORTEXTEX(LONG x_num, LONG x_den, LONG y_num, LONG y_den)
Definition: libemf.h:1925
EMF Stroke and Fill path.
Definition: libemf.h:5618
EMRPOLYGON16(const RECTL *bounds, const POINT *points, INT16 n)
Definition: libemf.h:3502
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:1770
EMF End of File Record.
Definition: libemf.h:1669
Graphics Brush.
Definition: libemf.h:6075
int size(void) const
Definition: libemf.h:5484
int size(void) const
Definition: libemf.h:2028
bool serialize(DATASTREAM ds)
Definition: libemf.h:2434
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:4001
virtual METARECORD * newEMR(HDC dc, HGDIOBJ handle)=0
static EMF::METARECORD * new_eof(DATASTREAM &ds)
Create a new EMREOF record.
Definition: libemf.cpp:254
int size(void) const
Definition: libemf.h:5703
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:4692
POINTLARRAY(POINTL *const points, const DWORD n)
Definition: libemf.h:148
int size(void) const
Definition: libemf.h:2635
bool serialize(DATASTREAM ds)
Definition: libemf.h:2950
bool serialize(DATASTREAM ds)
Definition: libemf.h:4315
const int length_
Number of WCHARs in string.
Definition: libemf.h:91
EMRRECTANGLE(INT left, INT top, INT right, INT bottom)
Definition: libemf.h:3072
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.cpp:522
FONT * font
The current font.
Definition: libemf.h:6364
static EMF::METARECORD * new_exttextouta(DATASTREAM &ds)
Create a new EXTTEXTOUTA record.
Definition: libemf.cpp:429
OBJECT(void)
Definition: libemf.h:1239
bool serialize(DATASTREAM ds)
Definition: libemf.h:2559
int size(void) const
Definition: libemf.h:5217
OBJECTTYPE getType(void) const
Definition: libemf.h:6021
static EMF::METARECORD * new_scaleviewportextex(DATASTREAM &ds)
Create a new SCALEVIEWPORTEXTEX record.
Definition: libemf.cpp:279
EMRPOLYGON16(DATASTREAM &ds)
Definition: libemf.h:3550
bool serialize(DATASTREAM ds)
Definition: libemf.h:3987
static EMF::METARECORD * new_setmetargn(DATASTREAM &ds)
Create a new SETMETARGN record.
Definition: libemf.cpp:504
bool serialize(DATASTREAM ds)
Definition: libemf.h:2492
EMRSETBKCOLOR(DATASTREAM &ds)
Definition: libemf.h:2427
EMRELLIPSE(INT left, INT top, INT right, INT bottom)
Definition: libemf.h:3136
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:5872
bool serialize(DATASTREAM ds)
Definition: libemf.h:1945
EMRPOLYLINE16(const RECTL *bounds, const POINT *points, INT n)
Definition: libemf.h:3319
EMF MoveTo (ex)
Definition: libemf.h:2794
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:3170