EMF: libemf.h Source File

EMF 1.0

- Main Page
- Classes
- Files

- File List

libemf.h
1 /* -*- c++ -*-
2 * EMF: A library for generating ECMA-234 Enhanced Metafiles
3 * Copyright (C) 2002, 2003 lignum Computing, Inc. <dallenbarnett@users.sourceforge.net>
4 * $Id: libemf.h 70 2015-11-21 21:14:35Z dallenbarnett $
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 */
21 #ifndef _LIBEMF_H
22 #define _LIBEMF_H 1
23
24 #include <cmath>
25 #include <vector>
26 #include <map>
27 #include <functional>
28 #include <algorithm>
29 #include <stdexcept>
30
31 #include <config.h>
32 #include <libEMF/emf.h>
33
34 #include <libEMF/wine/w16.h>
35
36 #ifdef ENABLE_EDITING
37 #include <iconv.h>
38 #include <errno.h>
39 #endif
40
41 #define EMF_UNUSED(x) (void)x;
42
43 namespace EMF {
48 #if 1
49 const int XMAX_PIXELS = 1024; /*(INT_MAX)*/
50 #else
51 const int XMAX_PIXELS = 1280; /*(INT_MAX)*/
52 #endif
53
57 #if 1
58 const int YMAX_PIXELS = 768; /*(INT_MAX)*/
59 #else
60 const int YMAX_PIXELS = 1024; /*(INT_MAX)*/
61 #endif
62
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; }
82
84
89 struct WCHARSTR {
90 WCHAR *const string_;
91 const int length_;
92
97 WCHARSTR ( WCHAR *const string, const int length )
98 : string_( string ), length_( length ) {}
99 };
100
102
107 struct CHARSTR {
108 CHAR *const string_;
109 const int length_;
110
115 CHARSTR ( CHAR *const string, const int length )
116 : string_( string ), length_( length ) {}
117 };
118
120
124 struct BYTEARRAY {
125 BYTE *const array_;
126 const int n_;
127
132 BYTEARRAY ( BYTE *const array, const int n )
133 : array_( array ), n_( n ) {}
134 };
135
137
140 struct POINTLARRAY {
141 POINTL *const points_;
142 const DWORD n_;
143
148 POINTLARRAY ( POINTL *const points, const DWORD n )
149 : points_( points ), n_( n ) {}
150 };
151
153
156 struct POINT16ARRAY {
157 POINT16 *const points_;
158 const DWORD n_;
159
164 POINT16ARRAY ( POINT16 *const points, const DWORD n )
165 : points_( points ), n_( n ) {}
166 };
167
169
172 struct INTARRAY {
173 INT *const ints_;
174 const DWORD n_;
175
180 INTARRAY ( INT *const ints, const DWORD n )
181 : ints_( ints ), n_( n ) {}
182 };
183
185
188 struct DWORDARRAY {
189 DWORD *const dwords_;
190 const DWORD n_;
191
196 DWORDARRAY ( DWORD *const dwords, const DWORD n )
197 : dwords_( dwords ), n_( n ) {}
198 };
199
201
204 struct PADDING {
205 static const char padding_[4];
206 const int size_;
207
211 PADDING ( const int size ) : size_( size ) {}
212 };
213
215
222 class DATASTREAM {
223 bool swap_;
224 ::FILE* fp_;
225
226 static bool bigEndian ( void );
227 public:
233 DATASTREAM ( ::FILE* fp = 0 ) : swap_( bigEndian() ), fp_( fp ) {}
238 void setStream ( ::FILE* fp ) { fp_ = fp; }
243 DATASTREAM& operator<< ( const BYTE& byte )
244 {
245 fwrite( &byte, sizeof(BYTE), 1, fp_ );
246 return *this;
247 }
252 DATASTREAM& operator>> ( BYTE& byte )
253 {
254 fread( &byte, sizeof(BYTE), 1, fp_ );
255 return *this;
256 }
261 DATASTREAM& operator<< ( const WORD& word )
262 {
263 if ( swap_ ) {
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_ );
267 }
268 else
269 fwrite( &word, sizeof(WORD), 1, fp_ );
270 return *this;
271 }
276 DATASTREAM& operator>> ( WORD& word )
277 {
278 if ( swap_ ) {
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_ );
282 }
283 else
284 fread( &word, sizeof(WORD), 1, fp_ );
285 return *this;
286 }
291 DATASTREAM& operator<< ( const INT16& word )
292 {
293 if ( swap_ ) {
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_ );
297 }
298 else
299 fwrite( &word, sizeof(INT16), 1, fp_ );
300 return *this;
301 }
306 DATASTREAM& operator>> ( INT16& word )
307 {
308 if ( swap_ ) {
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_ );
312 }
313 else
314 fread( &word, sizeof(INT16), 1, fp_ );
315 return *this;
316 }
321 DATASTREAM& operator<< ( const DWORD& dword )
322 {
323 if ( swap_ ) {
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_ );
329 }
330 else
331 fwrite( &dword, sizeof(DWORD), 1, fp_ );
332 return *this;
333 }
338 DATASTREAM& operator>> ( DWORD& dword )
339 {
340 if ( swap_ ) {
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_ );
346 }
347 else
348 fread( &dword, sizeof(DWORD), 1, fp_ );
349 return *this;
350 }
351 #if !defined( __LP64__ )
352
356 DATASTREAM& operator<< ( const LONG& long_ )
357 {
358 if ( swap_ ) {
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_ );
364 }
365 else
366 fwrite( &long_, sizeof(LONG), 1, fp_ );
367 return *this;
368 }
373 DATASTREAM& operator>> ( LONG& long_ )
374 {
375 if ( swap_ ) {
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_ );
381 }
382 else
383 fread( &long_, sizeof(LONG), 1, fp_ );
384 return *this;
385 }
386 #endif /* __x86_64__ */
387
391 DATASTREAM& operator<< ( const INT& int_ )
392 {
393 if ( swap_ ) {
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_ );
399 }
400 else
401 fwrite( &int_, sizeof(INT), 1, fp_ );
402 return *this;
403 }
408 DATASTREAM& operator>> ( INT& int_ )
409 {
410 if ( swap_ ) {
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_ );
416 }
417 else
418 fread( &int_, sizeof(INT), 1, fp_ );
419 return *this;
420 }
421 #if !defined(__LP64__)
422
426 DATASTREAM& operator<< ( const UINT& uint )
427 {
428 if ( swap_ ) {
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_ );
434 }
435 else
436 fwrite( &uint, sizeof(UINT), 1, fp_ );
437 return *this;
438 }
443 DATASTREAM& operator>> ( UINT& uint )
444 {
445 if ( swap_ ) {
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_ );
451 }
452 else
453 fread( &uint, sizeof(UINT), 1, fp_ );
454 return *this;
455 }
456 #endif /* !__x86_64__ */
457
461 DATASTREAM& operator<< ( const FLOAT& float_ )
462 {
463 if ( swap_ ) {
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_ );
469 }
470 else
471 fwrite( &float_, sizeof(FLOAT), 1, fp_ );
472 return *this;
473 }
478 DATASTREAM& operator>> ( FLOAT& float_ )
479 {
480 if ( swap_ ) {
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_ );
486 }
487 else
488 fread( &float_, sizeof(FLOAT), 1, fp_ );
489 return *this;
490 }
495 DATASTREAM& operator<< ( const PADDING& padding )
496 {
497 if ( padding.size_ != 0 )
498 fwrite( &padding.padding_, sizeof(CHAR), padding.size_, fp_ );
499 return *this;
500 }
505 DATASTREAM& operator<< ( const RECTL& rectl )
506 {
507 *this << rectl.left << rectl.top << rectl.right << rectl.bottom;
508 return *this;
509 }
514 DATASTREAM& operator>> ( RECTL& rectl )
515 {
516 *this >> rectl.left >> rectl.top >> rectl.right >> rectl.bottom;
517 return *this;
518 }
523 DATASTREAM& operator<< ( const SIZEL& sizel )
524 {
525 *this << sizel.cx << sizel.cy;
526 return *this;
527 }
532 DATASTREAM& operator>> ( SIZEL& sizel )
533 {
534 *this >> sizel.cx >> sizel.cy;
535 return *this;
536 }
541 DATASTREAM& operator<< ( const WCHARSTR& wcharstr )
542 {
543 for ( int i = 0; i < wcharstr.length_; i++ )
544 *this << wcharstr.string_[i];
545 return *this;
546 }
551 DATASTREAM& operator>> ( WCHARSTR& wcharstr )
552 {
553 for ( int i = 0; i < wcharstr.length_; i++ )
554 *this >> wcharstr.string_[i];
555 return *this;
556 }
561 DATASTREAM& operator<< ( const CHARSTR& charstr )
562 {
563 fwrite( charstr.string_, sizeof(CHAR), charstr.length_, fp_ );
564 return *this;
565 }
570 DATASTREAM& operator>> ( CHARSTR& charstr )
571 {
572 fread( charstr.string_, sizeof(CHAR), charstr.length_, fp_ );
573 return *this;
574 }
579 DATASTREAM& operator<< ( const ::EMR& emr )
580 {
581 *this << emr.iType << emr.nSize;
582 return *this;
583 }
588 DATASTREAM& operator>> ( ::EMR& emr )
589 {
590 *this >> emr.iType >> emr.nSize;
591 return *this;
592 }
597 DATASTREAM& operator<< ( const POINT& point )
598 {
599 *this << point.x << point.y;
600 return *this;
601 }
606 DATASTREAM& operator>> ( POINT& point )
607 {
608 *this >> point.x >> point.y;
609 return *this;
610 }
615 DATASTREAM& operator<< ( const POINTL& pointl )
616 {
617 *this << pointl.x << pointl.y;
618 return *this;
619 }
624 DATASTREAM& operator>> ( POINTL& pointl )
625 {
626 *this >> pointl.x >> pointl.y;
627 return *this;
628 }
633 DATASTREAM& operator<< ( const POINT16& point )
634 {
635 *this << point.x << point.y;
636 return *this;
637 }
642 DATASTREAM& operator>> ( POINT16& point )
643 {
644 *this >> point.x >> point.y;
645 return *this;
646 }
651 DATASTREAM& operator<< ( const XFORM& xform )
652 {
653 *this << xform.eM11 << xform.eM12 << xform.eM21 << xform.eM22
654 << xform.eDx << xform.eDy;
655 return *this;
656 }
661 DATASTREAM& operator>> ( XFORM& xform )
662 {
663 *this >> xform.eM11 >> xform.eM12 >> xform.eM21 >> xform.eM22
664 >> xform.eDx >> xform.eDy;
665 return *this;
666 }
671 DATASTREAM& operator<< ( const BYTEARRAY& array )
672 {
673 fwrite( array.array_, sizeof(BYTE), array.n_, fp_ );
674 return *this;
675 }
680 DATASTREAM& operator>> ( BYTEARRAY& array )
681 {
682 fread( array.array_, sizeof(BYTE), array.n_, fp_ );
683 return *this;
684 }
689 DATASTREAM& operator<< ( const POINTLARRAY& array )
690 {
691 for ( unsigned int i = 0; i < array.n_; i++ )
692 *this << array.points_[i];
693 return *this;
694 }
699 DATASTREAM& operator>> ( POINTLARRAY& array )
700 {
701 for ( unsigned int i = 0; i < array.n_; i++ )
702 *this >> array.points_[i];
703 return *this;
704 }
709 DATASTREAM& operator<< ( const POINT16ARRAY& array )
710 {
711 for ( unsigned int i = 0; i < array.n_; i++ )
712 *this << array.points_[i];
713 return *this;
714 }
719 DATASTREAM& operator>> ( POINT16ARRAY& array )
720 {
721 for ( unsigned int i = 0; i < array.n_; i++ )
722 *this >> array.points_[i];
723 return *this;
724 }
729 DATASTREAM& operator<< ( const INTARRAY& array )
730 {
731 for ( unsigned int i = 0; i < array.n_; i++ )
732 *this << array.ints_[i];
733 return *this;
734 }
739 DATASTREAM& operator>> ( INTARRAY& array )
740 {
741 for ( unsigned int i = 0; i < array.n_; i++ )
742 *this >> array.ints_[i];
743 return *this;
744 }
749 DATASTREAM& operator<< ( const DWORDARRAY& array )
750 {
751 for ( unsigned int i = 0; i < array.n_; i++ )
752 *this << array.dwords_[i];
753 return *this;
754 }
759 DATASTREAM& operator>> ( DWORDARRAY& array )
760 {
761 for ( unsigned int i = 0; i < array.n_; i++ )
762 *this >> array.dwords_[i];
763 return *this;
764 }
769 DATASTREAM& operator<< ( const ::EMRTEXT& text )
770 {
771 *this << text.ptlReference << text.nChars << text.offString << text.fOptions
772 << text.rcl << text.offDx;
773 return *this;
774 }
779 DATASTREAM& operator>> ( ::EMRTEXT& text )
780 {
781 *this >> text.ptlReference >> text.nChars >> text.offString >> text.fOptions
782 >> text.rcl >> text.offDx;
783 return *this;
784 }
789 DATASTREAM& operator<< ( const LOGPEN& pen )
790 {
791 *this << pen.lopnStyle << pen.lopnWidth << pen.lopnColor;
792 return *this;
793 }
798 DATASTREAM& operator>> ( LOGPEN& pen )
799 {
800 *this >> pen.lopnStyle >> pen.lopnWidth >> pen.lopnColor;
801 return *this;
802 }
807 DATASTREAM& operator<< ( const EXTLOGPEN& pen )
808 {
809 // *** How big is this structure if there are no style entries? ***
810 *this << pen.elpPenStyle << pen.elpWidth << pen.elpBrushStyle << pen.elpColor
811 << pen.elpHatch << pen.elpNumEntries;
812 return *this;
813 }
818 DATASTREAM& operator>> ( EXTLOGPEN& pen )
819 {
820 // *** How big is this structure if there are no style entries? ***
821 *this >> pen.elpPenStyle >> pen.elpWidth >> pen.elpBrushStyle >> pen.elpColor
822 >> pen.elpHatch >> pen.elpNumEntries;
823 return *this;
824 }
829 DATASTREAM& operator<< ( const LOGBRUSH& brush )
830 {
831 *this << brush.lbStyle << brush.lbColor << brush.lbHatch;
832 return *this;
833 }
838 DATASTREAM& operator>> ( LOGBRUSH& brush )
839 {
840 *this >> brush.lbStyle >> brush.lbColor >> brush.lbHatch;
841 return *this;
842 }
847 DATASTREAM& operator<< ( const LOGFONTW& font )
848 {
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 );
855 return *this;
856 }
861 DATASTREAM& operator>> ( LOGFONTW& font )
862 {
863 WCHARSTR wFaceName( font.lfFaceName, LF_FACESIZE );
864
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
870 >> wFaceName;
871 return *this;
872 }
877 DATASTREAM& operator<< ( const PANOSE& panose )
878 {
879 fwrite( &panose, sizeof(PANOSE), 1, fp_ );
880 return *this;
881 }
886 DATASTREAM& operator>> ( PANOSE& panose )
887 {
888 fread( &panose, sizeof(PANOSE), 1, fp_ );
889 return *this;
890 }
895 DATASTREAM& operator<< ( const EXTLOGFONTW& font )
896 {
897 *this << font.elfLogFont
898 << WCHARSTR( const_cast<WCHAR*const>(font.elfFullName),
899 LF_FULLFACESIZE )
900 << WCHARSTR( const_cast<WCHAR*const>(font.elfStyle), LF_FACESIZE )
901 << font.elfVersion << font.elfStyleSize << font.elfMatch
902 << font.elfReserved
903 << BYTEARRAY( const_cast<BYTE*const>(font.elfVendorId),
904 ELF_VENDOR_SIZE )
905 << font.elfCulture << font.elfPanose;
906 return *this;
907 }
912 DATASTREAM& operator>> ( EXTLOGFONTW& font )
913 {
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;
922 return *this;
923 }
928 DATASTREAM& operator<< ( const LOGPALETTE& palette )
929 {
930 // *** How big is this structure if the palette is empty? ***
931 *this << palette.palVersion << palette.palNumEntries;
932 return *this;
933 }
938 DATASTREAM& operator>> ( LOGPALETTE& palette )
939 {
940 // *** How big is this structure if the palette is empty? ***
941 *this >> palette.palVersion >> palette.palNumEntries;
942 return *this;
943 }
944 private:
955 void fread ( void* ptr, size_t size, size_t nmemb, FILE* stream )
956 {
957 size_t res = ::fread( ptr, size, nmemb, stream );
958 if ( res < nmemb ) {
959 if ( ! feof( stream ) ) {
960 throw std::runtime_error( "error reading EMF stream" );
961 }
962 }
963 }
973 void fwrite ( const void* ptr, size_t size, size_t nmemb, FILE* stream )
974 {
975 size_t res = ::fwrite( ptr, size, nmemb, stream );
976 if ( res < nmemb ) {
977 throw std::runtime_error( "error writing EMF stream" );
978 }
979 }
980 };
981
982 class METAFILEDEVICECONTEXT;
983
985
991 class METARECORD {
992 public:
999 virtual void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const = 0;
1006 virtual bool serialize ( DATASTREAM ds ) = 0;
1012 virtual int size ( void ) const = 0;
1018 virtual ~METARECORD( ) { }
1019 #ifdef ENABLE_EDITING
1020
1024 virtual void edit ( void ) const {}
1025 #endif
1026 };
1027
1028 #ifdef ENABLE_EDITING
1029 /* Miscellaneous editing routines */
1030 inline void edit_rectl ( const char* tag, const RECTL& rectl )
1031 {
1032 #if defined(__LP64__)
1033 const char* FMT = "\t%s\t: (%d, %d) - (%d, %d)\n";
1034 #else
1035 const char* FMT = "\t%s\t: (%ld, %ld) - (%ld, %ld)\n";
1036 #endif /* __x86_64__ */
1037 printf( FMT, tag, rectl.left, rectl.top, rectl.right, rectl.bottom );
1038 }
1039
1040 inline void edit_xform ( const char* tag, const XFORM& xform )
1041 {
1042 printf( "\t%s.eM11\t: %f\n", tag, xform.eM11 );
1043 printf( "\t%s.eM12\t: %f\n", tag, xform.eM12 );
1044 printf( "\t%s.eM21\t: %f\n", tag, xform.eM21 );
1045 printf( "\t%s.eM22\t: %f\n", tag, xform.eM22 );
1046 printf( "\t%s.eDx\t: %f\n", tag, xform.eDx );
1047 printf( "\t%s.eDy\t: %f\n", tag, xform.eDy );
1048 }
1049
1050 inline void edit_color ( const char* tag, const COLORREF& color )
1051 {
1052 #if defined(__LP64__)
1053 const char* FMT = "\t%s\t: R(0x%02x) G(0x%02x) B(0x%02x)\n";
1054 #else
1055 const char* FMT = "\t%s\t: R(0x%02lx) G(0x%02lx) B(0x%02lx)\n";
1056 #endif /* __x86_64__ */
1057 printf( FMT, tag,
1058 GetRValue( color ), GetGValue( color ), GetBValue( color ) );
1059 }
1060
1061 inline void edit_sizel ( const char* tag, const SIZEL& size )
1062 {
1063 #if defined(__LP64__)
1064 const char* FMT = "\t%s\t: (%d, %d)\n";
1065 #else
1066 const char* FMT = "\t%s\t: (%ld, %ld)\n";
1067 #endif /* __x86_64__ */
1068 printf( FMT, tag, size.cx, size.cy );
1069 }
1070
1071 inline void edit_pointl ( const char* tag, const POINTL& point )
1072 {
1073 #if defined(__LP64__)
1074 const char* FMT = "\t%s\t: (%d, %d)\n";
1075 #else
1076 const char* FMT = "\t%s\t: (%ld, %ld)\n";
1077 #endif /* __x86_64__ */
1078 printf( FMT, tag, point.x, point.y );
1079 }
1080
1081 inline void edit_pointlarray ( const char* tag, const DWORD cptl,
1082 const POINTL* points )
1083 {
1084 #if defined(__LP64__)
1085 const char* FMT0 = "\tcptl%s\t: %d\n";
1086 const char* FMT1 = "%d, %d\n";
1087 const char* FMT2 = "\t\t%s %d, %d\n";
1088 #else
1089 const char* FMT0 = "\tcptl%s\t: %ld\n";
1090 const char* FMT1 = "%ld, %ld\n";
1091 const char* FMT2 = "\t\t%s %ld, %ld\n";
1092 #endif /* __x86_64__ */
1093 printf( FMT0, tag, cptl );
1094 printf( "\taptl%s\t: ", tag );
1095 if ( cptl > 0 )
1096 printf( FMT1, points[0].x, points[0].y );
1097 else
1098 puts( "" );
1099 for ( DWORD i = 1; i < cptl; i++ )
1100 printf( FMT2, tag, points[i].x, points[i].y );
1101 }
1102
1103 inline void edit_point16array ( const char* tag, const unsigned int cpts,
1104 const POINT16* points )
1105 {
1106 printf( "\tcpts%s\t: %d\n", tag, cpts );
1107 printf( "\tapts%s\t: ", tag );
1108 if ( cpts > 0 )
1109 printf( "%d, %d\n", points[0].x, points[0].y );
1110 else
1111 puts( "" );
1112 for ( unsigned int i = 1; i < cpts; i++ )
1113 printf( "\t\t%s %d, %d\n", tag, points[i].x, points[i].y );
1114 }
1115
1116 inline void edit_pen_style ( const char* tag, DWORD style )
1117 {
1118 printf( "\t%s\t: ", tag );
1119 switch ( style & PS_STYLE_MASK ) {
1120 case PS_SOLID: printf( "PS_SOLID" ); break;
1121 case PS_DASH: printf( "PS_DASH" ); break;
1122 case PS_DOT: printf( "PS_DOT" ); break;
1123 case PS_DASHDOT: printf( "PS_DASHDOT" ); break;
1124 case PS_DASHDOTDOT: printf( "PS_DASHDOTDOT" ); break;
1125 case PS_NULL: printf( "PS_NULL" ); break;
1126 case PS_INSIDEFRAME: printf( "PS_INSIDEFRAME" ); break;
1127 case PS_USERSTYLE: printf( "PS_USERSTYLE" ); break;
1128 case PS_ALTERNATE: printf( "PS_ALTERNATE" ); break;
1129 }
1130 switch ( style & PS_ENDCAP_MASK ) {
1131 case PS_ENDCAP_ROUND: printf( " | PS_ENDCAP_ROUND" ); break;
1132 case PS_ENDCAP_SQUARE: printf( " | PS_ENDCAP_SQUARE" ); break;
1133 case PS_ENDCAP_FLAT: printf( " | PS_ENDCAP_FLAT" ); break;
1134 }
1135 switch ( style & PS_JOIN_MASK ) {
1136 case PS_JOIN_ROUND: printf( " | PS_JOIN_ROUND" ); break;
1137 case PS_JOIN_BEVEL: printf( " | PS_JOIN_BEVEL" ); break;
1138 case PS_JOIN_MITER: printf( " | PS_JOIN_MITER" ); break;
1139 }
1140 switch ( style & PS_TYPE_MASK ) {
1141 case PS_COSMETIC: printf( " | PS_COSMETIC" ); break;
1142 case PS_GEOMETRIC: printf( " | PS_GEOMETRIC" ); break;
1143 }
1144 printf( "\n" );
1145 }
1146
1147 inline void edit_brush_style ( const char* tag, DWORD style )
1148 {
1149 #if defined(__LP64__)
1150 const char* FMT = "unknown(%d)";
1151 #else
1152 const char* FMT = "unknown(%ld)";
1153 #endif /* __x86_64__ */
1154 printf( "\t%s\t: ", tag );
1155 switch ( style ) {
1156 case BS_SOLID: printf( "BS_SOLID" ); break;
1157 case BS_NULL: printf( "BS_NULL" ); break;
1158 case BS_HATCHED: printf( "BS_HATCHED" ); break;
1159 case BS_PATTERN: printf( "BS_PATTERN" ); break;
1160 case BS_INDEXED: printf( "BS_INDEXED" ); break;
1161 case BS_DIBPATTERN: printf( "BS_DIBPATTERN" ); break;
1162 case BS_DIBPATTERNPT: printf( "BS_DIBPATTERNPT" ); break;
1163 case BS_PATTERN8X8: printf( "BS_PATTERN8X8" ); break;
1164 case BS_DIBPATTERN8X8: printf( "BS_DIBPATTERN8X8" ); break;
1165 case BS_MONOPATTERN: printf( "BS_DIBPATTERN8X8" ); break;
1166 default: printf( FMT, style );
1167 }
1168 printf( "\n" );
1169 }
1170
1171 inline void edit_brush_hatch ( const char* tag, DWORD hatch )
1172 {
1173 #if defined(__LP64__)
1174 const char* FMT = "unknown(%d)";
1175 #else
1176 const char* FMT = "unknown(%ld)";
1177 #endif /* __x86_64__ */
1178 printf( "\t%s\t: ", tag );
1179 switch ( hatch ) {
1180 case HS_HORIZONTAL: printf( "HS_HORIZONTAL" ); break;
1181 case HS_VERTICAL: printf( "HS_VERTICAL" ); break;
1182 case HS_FDIAGONAL: printf( "HS_FDIAGONAL" ); break;
1183 case HS_BDIAGONAL: printf( "HS_BDIAGONAL" ); break;
1184 case HS_CROSS: printf( "HS_CROSS" ); break;
1185 case HS_DIAGCROSS: printf( "HS_DIAGCROSS" ); break;
1186 default: printf( FMT, hatch );
1187 }
1188 printf( "\n" );
1189 }
1190 #endif
1191
1198 enum OBJECTTYPE { O_METAFILEDEVICECONTEXT = OBJ_METADC,
1199 O_FONT = OBJ_FONT,
1200 O_PEN = OBJ_PEN,
1201 O_EXTPEN = OBJ_EXTPEN,
1202 O_BRUSH = OBJ_BRUSH,
1203 O_PALETTE = OBJ_PAL };
1204 #if 0
1205
1208 static char* typStr ( OBJECTTYPE type )
1209 {
1210 switch (type) {
1211 case O_METAFILEDEVICECONTEXT:
1212 return "metafile device context";
1213 case O_FONT:
1214 return "font";
1215 case O_PEN:
1216 return "pen";
1217 case O_EXTPEN:
1218 return "extended pen";
1219 case O_BRUSH:
1220 return "brush";
1221 case O_PALETTE:
1222 return "palette";
1223 }
1224 return "unknown object";
1225 }
1226 #endif
1227
1233 class OBJECT {
1234 public:
1235 HGDIOBJ handle;
1236 virtual ~OBJECT () {}
1242 OBJECT ( void ) : handle( 0 ) {}
1246 virtual OBJECTTYPE getType ( void ) const = 0;
1247 };
1248
1250
1255 class GRAPHICSOBJECT : public OBJECT {
1256 public:
1258 virtual ~GRAPHICSOBJECT () {}
1263 std::map< HDC, HGDIOBJ > contexts;
1270 virtual METARECORD* newEMR ( HDC dc, HGDIOBJ handle ) = 0;
1271 };
1272
1273 typedef METARECORD*(*METARECORDCTOR)(DATASTREAM&);
1274
1278 class GLOBALOBJECTS {
1282 std::vector<OBJECT*> objects;
1283
1290 std::map< DWORD, METARECORDCTOR > new_records;
1291
1292 public:
1293 GLOBALOBJECTS ( void );
1294 ~GLOBALOBJECTS ( void );
1295 HGDIOBJ add ( OBJECT* object );
1296 OBJECT* find ( const HGDIOBJ handle );
1297 void remove ( const OBJECT* object );
1298
1302 std::vector<EMF::OBJECT*>::const_iterator begin ( void ) const
1303 { return objects.begin(); }
1307 std::vector<EMF::OBJECT*>::const_iterator end ( void ) const
1308 { return objects.end(); }
1309
1310 METARECORDCTOR newRecord ( DWORD iType ) const;
1311
1313 static EMF::METARECORD* new_eof ( DATASTREAM& ds );
1315 static EMF::METARECORD* new_setviewportorgex ( DATASTREAM& ds );
1317 static EMF::METARECORD* new_setwindoworgex ( DATASTREAM& ds );
1319 static EMF::METARECORD* new_setviewportextex ( DATASTREAM& ds );
1321 static EMF::METARECORD* new_setwindowextex ( DATASTREAM& ds );
1323 static EMF::METARECORD* new_scaleviewportextex ( DATASTREAM& ds );
1325 static EMF::METARECORD* new_scalewindowextex ( DATASTREAM& ds );
1327 static EMF::METARECORD* new_modifyworldtransform ( DATASTREAM& ds );
1329 static EMF::METARECORD* new_setworldtransform ( DATASTREAM& ds );
1331 static EMF::METARECORD* new_settextalign ( DATASTREAM& ds );
1333 static EMF::METARECORD* new_settextcolor ( DATASTREAM& ds );
1335 static EMF::METARECORD* new_setbkcolor ( DATASTREAM& ds );
1337 static EMF::METARECORD* new_setbkmode ( DATASTREAM& ds );
1339 static EMF::METARECORD* new_setpolyfillmode ( DATASTREAM& ds );
1341 static EMF::METARECORD* new_setmapmode ( DATASTREAM& ds );
1343 static EMF::METARECORD* new_selectobject ( DATASTREAM& ds );
1345 static EMF::METARECORD* new_deleteobject ( DATASTREAM& ds );
1347 static EMF::METARECORD* new_movetoex ( DATASTREAM& ds );
1349 static EMF::METARECORD* new_lineto ( DATASTREAM& ds );
1351 static EMF::METARECORD* new_arc ( DATASTREAM& ds );
1353 static EMF::METARECORD* new_arcto ( DATASTREAM& ds );
1355 static EMF::METARECORD* new_rectangle ( DATASTREAM& ds );
1357 static EMF::METARECORD* new_ellipse ( DATASTREAM& ds );
1359 static EMF::METARECORD* new_polyline ( DATASTREAM& ds );
1361 static EMF::METARECORD* new_polyline16 ( DATASTREAM& ds );
1363 static EMF::METARECORD* new_polygon ( DATASTREAM& ds );
1365 static EMF::METARECORD* new_polygon16 ( DATASTREAM& ds );
1367 static EMF::METARECORD* new_polypolygon ( DATASTREAM& ds );
1369 static EMF::METARECORD* new_polypolygon16 ( DATASTREAM& ds );
1371 static EMF::METARECORD* new_polybezier ( DATASTREAM& ds );
1373 static EMF::METARECORD* new_polybezier16 ( DATASTREAM& ds );
1375 static EMF::METARECORD* new_polybezierto ( DATASTREAM& ds );
1377 static EMF::METARECORD* new_polybezierto16 ( DATASTREAM& ds );
1379 static EMF::METARECORD* new_polylineto ( DATASTREAM& ds );
1381 static EMF::METARECORD* new_polylineto16 ( DATASTREAM& ds );
1383 static EMF::METARECORD* new_exttextouta ( DATASTREAM& ds );
1385 static EMF::METARECORD* new_exttextoutw ( DATASTREAM& ds );
1387 static EMF::METARECORD* new_setpixelv ( DATASTREAM& ds );
1389 static EMF::METARECORD* new_createpen ( DATASTREAM& ds );
1391 static EMF::METARECORD* new_extcreatepen ( DATASTREAM& ds );
1393 static EMF::METARECORD* new_createbrushindirect ( DATASTREAM& ds );
1395 static EMF::METARECORD* new_extcreatefontindirectw ( DATASTREAM& ds );
1397 static EMF::METARECORD* new_fillpath ( DATASTREAM& ds );
1399 static EMF::METARECORD* new_strokepath ( DATASTREAM& ds );
1401 static EMF::METARECORD* new_strokeandfillpath ( DATASTREAM& ds );
1403 static EMF::METARECORD* new_beginpath ( DATASTREAM& ds );
1405 static EMF::METARECORD* new_endpath ( DATASTREAM& ds );
1407 static EMF::METARECORD* new_closefigure ( DATASTREAM& ds );
1409 static EMF::METARECORD* new_savedc ( DATASTREAM& ds );
1411 static EMF::METARECORD* new_restoredc ( DATASTREAM& ds );
1413 static EMF::METARECORD* new_setmetargn ( DATASTREAM& ds );
1415 static EMF::METARECORD* new_setmiterlimit ( DATASTREAM& ds );
1416 };
1417
1418 extern GLOBALOBJECTS globalObjects;
1419
1421
1427 class ENHMETAHEADER : public METARECORD, public ::ENHMETAHEADER {
1428
1429 LPWSTR description_w;
1430 int description_size;
1431
1432 public:
1439 ENHMETAHEADER ( LPCWSTR description = 0 )
1440 : description_w( 0 ), description_size( 0 )
1441 {
1442 iType = EMR_HEADER;
1443 nSize = sizeof( ::ENHMETAHEADER );
1444
1445 // Compute the bounds
1446 RECTL default_bounds = { 0, 0, 0, 0 };
1447 rclBounds = default_bounds;
1448 RECTL default_frame = { 0, 0, 0, 0 };
1449 rclFrame = default_frame;
1450 dSignature = ENHMETA_SIGNATURE;
1451 nVersion = 0x10000;
1452 nBytes = nSize;
1453 nRecords = 1;
1454 nHandles = 0;
1455 sReserved = 0;
1456 nDescription = 0;
1457 offDescription = 0;
1458 nPalEntries = 0;
1459 szlDevice.cx = XMAX_PIXELS;
1460 szlDevice.cy = YMAX_PIXELS;
1461 szlMillimeters.cx = XMAX_MM;
1462 szlMillimeters.cy = YMAX_MM;
1463 //
1464 cbPixelFormat = 0;
1465 offPixelFormat = 0;
1466 bOpenGL = FALSE;
1467 //
1468 #if 1
1469 szlMicrometers.cx = 1000 * szlMillimeters.cx;
1470 szlMicrometers.cy = 1000 * szlMillimeters.cy;
1471 #endif
1472 if ( description ) {
1473 // Count the number of characters in the description
1474 int description_count = 0, nulls = 0;
1475 LPCWSTR description_p = description;
1476 while ( nulls < 3 ) {
1477 description_count++;
1478 if ( (*description_p++) == 0 ) nulls++;
1479 }
1480
1481 // Make sure that the TOTAL record length will be a multiple of 4
1482
1483 int record_size = ROUND_TO_LONG( sizeof( ::ENHMETAHEADER ) +
1484 sizeof( WCHAR ) * description_count );
1485 description_size =
1486 (record_size - sizeof( ::ENHMETAHEADER )) / sizeof( WCHAR );
1487
1488 description_w = new WCHAR[ description_size ];
1489
1490 memset( description_w, 0, sizeof(WCHAR) * description_size );
1491
1492 for ( int i=0; i<description_count; i++ )
1493 description_w[i] = *description++;
1494
1495 nSize = nBytes = record_size;
1496 nDescription = description_count;
1497 offDescription = sizeof( ::ENHMETAHEADER );
1498 }
1499 }
1500
1504 ~ENHMETAHEADER ( )
1505 {
1506 if ( description_w ) delete[] description_w;
1507 }
1512 bool serialize ( DATASTREAM ds )
1513 {
1514 ds << iType << nSize
1515 << rclBounds << rclFrame
1516 << dSignature << nVersion << nBytes << nRecords << nHandles << sReserved
1517 << nDescription << offDescription << nPalEntries
1518 << szlDevice << szlMillimeters
1519 << cbPixelFormat << offPixelFormat << bOpenGL
1520 #if 1
1521 << szlMicrometers
1522 #endif
1523 << WCHARSTR( description_w, description_size );
1524 return true;
1525 }
1529 bool unserialize ( DATASTREAM ds )
1530 {
1531 ds >> iType >> nSize
1532 >> rclBounds >> rclFrame
1533 >> dSignature >> nVersion >> nBytes >> nRecords >> nHandles >> sReserved
1534 >> nDescription >> offDescription >> nPalEntries
1535 >> szlDevice >> szlMillimeters;
1536
1537 // Some elements of the metafile header were added at later dates
1538
1539 #define OffsetOf( a, b ) ((unsigned int)(((char*)&(((::ENHMETAHEADER*)a)->b)) - \
1540 (char*)((::ENHMETAHEADER*)a)))
1541 #if 1
1542 if ( OffsetOf( this, szlMicrometers ) <= offDescription )
1543 ds >> cbPixelFormat >> offPixelFormat >> bOpenGL;
1544 #else
1545 if ( sizeof(::ENHMETAHEADER) <= offDescription )
1546 ds >> cbPixelFormat >> offPixelFormat >> bOpenGL;
1547 #endif
1548 #undef OffsetOf
1549 #if 1
1550 if ( sizeof(::ENHMETAHEADER) <= offDescription )
1551 ds >> szlMicrometers;
1552 #endif
1553 // Should now probably check that the offset is correct...
1554
1555 description_size = ( nSize - offDescription ) / sizeof(WCHAR);
1556 description_w = new WCHAR[ description_size ];
1557
1558 WCHARSTR description( description_w, description_size );
1559
1560 ds >> description;
1561
1562 return true;
1563 }
1567 int size ( void ) const { return nSize; }
1573 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
1574 {
1575 // Actually handled by the destination device context.
1576 EMF_UNUSED(source);
1577 EMF_UNUSED(dc);
1578 }
1579 #ifdef ENABLE_EDITING
1580
1583 void edit ( void ) const
1584 {
1585 #if defined(__LP64__)
1586 const char* FMT0 = "\tiType\t\t\t: %d\n";
1587 const char* FMT1 = "\tnSize\t\t\t: %d\n";
1588 const char* FMT2 = "\tnBytes\t\t\t: %d\n";
1589 const char* FMT3 = "\tnRecords\t\t: %d\n";
1590 const char* FMT4 = "\tnDescription\t\t: %d\n";
1591 const char* FMT5 = "\toffDescription\t\t: %d\n";
1592 const char* FMT6 = "\tnPalEntries\t\t: %d\n";
1593 const char* FMT7 = "\tcbPixelFormat\t\t: %d\n";
1594 const char* FMT8 = "\toffPixelFormat\t\t: %d\n";
1595 const char* FMT9 = "\tbOpenGL\t\t\t: %d\n";
1596 #else
1597 const char* FMT0 = "\tiType\t\t\t: %ld\n";
1598 const char* FMT1 = "\tnSize\t\t\t: %ld\n";
1599 const char* FMT2 = "\tnBytes\t\t\t: %ld\n";
1600 const char* FMT3 = "\tnRecords\t\t: %ld\n";
1601 const char* FMT4 = "\tnDescription\t\t: %ld\n";
1602 const char* FMT5 = "\toffDescription\t\t: %ld\n";
1603 const char* FMT6 = "\tnPalEntries\t\t: %ld\n";
1604 const char* FMT7 = "\tcbPixelFormat\t\t: %ld\n";
1605 const char* FMT8 = "\toffPixelFormat\t\t: %ld\n";
1606 const char* FMT9 = "\tbOpenGL\t\t\t: %ld\n";
1607 #endif
1608 printf( "*HEADER*\n" );
1609 printf( FMT0, iType );
1610 printf( FMT1, nSize );
1611 edit_rectl( "rclBounds\t", rclBounds );
1612 edit_rectl( "rclFrame\t", rclFrame );
1613 printf( "\tdSignature\t\t: %.4s\n", (const char*)&dSignature );
1614 printf( "\tnVersion\t\t: 0x%x\n", (unsigned int)nVersion );
1615 printf( FMT2, nBytes );
1616 printf( FMT3, nRecords );
1617 printf( "\tnHandles\t\t: %d\n", nHandles );
1618 printf( FMT4, nDescription );
1619 printf( FMT5, offDescription );
1620 printf( FMT6, nPalEntries );
1621 edit_sizel( "szlDevice\t", szlDevice );
1622 edit_sizel( "szlMillimeters\t", szlMillimeters );
1623
1624 /* Make a crude guess as to the age of this file */
1625 #define OffsetOf( a, b ) ((unsigned int)(((const char*)&(((const ::ENHMETAHEADER*)a)->b)) - \
1626 (const char*)((const ::ENHMETAHEADER*)a)))
1627
1628 if ( OffsetOf( this, cbPixelFormat ) <= offDescription ) {
1629 printf( FMT7, cbPixelFormat );
1630 printf( FMT8, offPixelFormat );
1631 printf( FMT9, bOpenGL );
1632 #if 1
1633 if ( sizeof(::ENHMETAHEADER) <= offDescription ) {
1634 edit_sizel( "szlMicrometers\t", szlMicrometers );
1635 }
1636 #endif
1637 }
1638
1639 #undef OffsetOf
1640
1641 if ( nDescription != 0 ) {
1642
1643 wchar_t last_w = 0;
1644 WCHAR* description = description_w;
1645
1646 printf( "\tDescription:" );
1647
1648 for ( DWORD i = 0; i < nDescription; i++ ) {
1649
1650 wchar_t w = *description++; /* This is not true, really. UNICODE is not
1651 * glibc's wide character representation */
1652
1653 if ( w != 0 ) {
1654 if ( last_w == 0 ) printf( "\n\t\t" );
1655 putchar( w );
1656 }
1657
1658 last_w = w;
1659 }
1660 printf( "\n" );
1661 }
1662 }
1663 #endif /* ENABLE_EDITING */
1664 };
1665
1667
1672 class EMREOF : public METARECORD, ::EMREOF {
1673 public:
1677 EMREOF ( void )
1678 {
1679 emr.iType = EMR_EOF;
1680 emr.nSize = sizeof( ::EMREOF );
1681 nPalEntries = 0;
1682 offPalEntries = 0;
1683 nSizeLast = 0;
1684 }
1685
1690 EMREOF ( DATASTREAM& ds )
1691 {
1692 ds >> emr >> nPalEntries >> offPalEntries >> nSizeLast;
1693 }
1694
1698 bool serialize ( DATASTREAM ds )
1699 {
1700 ds << emr << nPalEntries << offPalEntries << nSizeLast;
1701 return true;
1702 }
1706 int size ( void ) const { return emr.nSize; }
1712 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
1713 {
1714 // Actually handled by the destination device context.
1715 EMF_UNUSED(source);
1716 EMF_UNUSED(dc);
1717 }
1718 #ifdef ENABLE_EDITING
1719
1722 void edit ( void ) const
1723 {
1724 printf( "*EOF*\n" );
1725 }
1726 #endif /* ENABLE_EDITING */
1727 };
1728
1730
1735 class EMRSETVIEWPORTORGEX : public METARECORD, ::EMRSETVIEWPORTORGEX {
1736 public:
1741 EMRSETVIEWPORTORGEX ( INT x, INT y )
1742 {
1743 emr.iType = EMR_SETVIEWPORTORGEX;
1744 emr.nSize = sizeof( ::EMRSETVIEWPORTORGEX );
1745 ptlOrigin.x = x;
1746 ptlOrigin.y = y;
1747 }
1752 EMRSETVIEWPORTORGEX ( DATASTREAM& ds )
1753 {
1754 ds >> emr >> ptlOrigin;
1755 }
1759 bool serialize ( DATASTREAM ds )
1760 {
1761 ds << emr << ptlOrigin;
1762 return true;
1763 }
1767 int size ( void ) const { return emr.nSize; }
1773 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
1774 {
1775 EMF_UNUSED(source);
1776 SetViewportOrgEx( dc, ptlOrigin.x, ptlOrigin.y, 0 );
1777 }
1778 #ifdef ENABLE_EDITING
1779
1782 void edit ( void ) const
1783 {
1784 printf( "*SETVIEWPORTORGEX*\n" );
1785 edit_pointl( "ptlOrigin", ptlOrigin );
1786 }
1787 #endif /* ENABLE_EDITING */
1788 };
1789
1791
1798 class EMRSETWINDOWORGEX : public METARECORD, ::EMRSETWINDOWORGEX {
1799 public:
1804 EMRSETWINDOWORGEX ( INT x, INT y )
1805 {
1806 emr.iType = EMR_SETWINDOWORGEX;
1807 emr.nSize = sizeof( ::EMRSETWINDOWORGEX );
1808 ptlOrigin.x = x;
1809 ptlOrigin.y = y;
1810 }
1815 EMRSETWINDOWORGEX ( DATASTREAM& ds )
1816 {
1817 ds >> emr >> ptlOrigin;
1818 }
1822 bool serialize ( DATASTREAM ds )
1823 {
1824 ds << emr << ptlOrigin;
1825 return true;
1826 }
1830 int size ( void ) const { return emr.nSize; }
1836 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
1837 {
1838 EMF_UNUSED(source);
1839 SetWindowOrgEx( dc, ptlOrigin.x, ptlOrigin.y, 0 );
1840 }
1841 #ifdef ENABLE_EDITING
1842
1845 void edit ( void ) const
1846 {
1847 printf( "*SETWINDOWORGEX*\n" );
1848 edit_pointl( "ptlOrigin", ptlOrigin );
1849 }
1850 #endif /* ENABLE_EDITING */
1851 };
1852
1854
1859 class EMRSETVIEWPORTEXTEX : public METARECORD, ::EMRSETVIEWPORTEXTEX {
1860 public:
1865 EMRSETVIEWPORTEXTEX ( INT cx, INT cy )
1866 {
1867 emr.iType = EMR_SETVIEWPORTEXTEX;
1868 emr.nSize = sizeof( ::EMRSETVIEWPORTEXTEX );
1869 szlExtent.cx = cx;
1870 szlExtent.cy = cy;
1871 }
1876 EMRSETVIEWPORTEXTEX ( DATASTREAM& ds )
1877 {
1878 ds >> emr >> szlExtent;
1879 }
1883 bool serialize ( DATASTREAM ds )
1884 {
1885 ds << emr << szlExtent;
1886 return true;
1887 }
1891 int size ( void ) const { return emr.nSize; }
1897 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
1898 {
1899 EMF_UNUSED(source);
1900 SetViewportExtEx( dc, szlExtent.cx, szlExtent.cy, 0 );
1901 }
1902 #ifdef ENABLE_EDITING
1903
1906 void edit ( void ) const
1907 {
1908 printf( "*SETVIEWPORTEXTEX*\n" );
1909 edit_sizel( "szlExtent", szlExtent );
1910 }
1911 #endif /* ENABLE_EDITING */
1912 };
1913
1915
1920 class EMRSCALEVIEWPORTEXTEX : public METARECORD, ::EMRSCALEVIEWPORTEXTEX {
1921 public:
1928 EMRSCALEVIEWPORTEXTEX ( LONG x_num, LONG x_den, LONG y_num, LONG y_den )
1929 {
1930 emr.iType = EMR_SCALEVIEWPORTEXTEX;
1931 emr.nSize = sizeof( ::EMRSCALEVIEWPORTEXTEX );
1932 xNum = x_num;
1933 xDenom = x_den;
1934 yNum = y_num;
1935 yDenom = y_den;
1936 }
1941 EMRSCALEVIEWPORTEXTEX ( DATASTREAM& ds )
1942 {
1943 ds >> emr >> xNum >> xDenom >> yNum >> yDenom;
1944 }
1948 bool serialize ( DATASTREAM ds )
1949 {
1950 ds << emr << xNum << xDenom << yNum << yDenom;
1951 return true;
1952 }
1956 int size ( void ) const { return emr.nSize; }
1962 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
1963 {
1964 EMF_UNUSED(source);
1965 ScaleViewportExtEx( dc, xNum, xDenom, yNum, yDenom, 0 );
1966 }
1967 #ifdef ENABLE_EDITING
1968
1971 void edit ( void ) const
1972 {
1973 #if defined(__LP64__)
1974 const char* FMT0 = "\txNum\t: %d\n";
1975 const char* FMT1 = "\txDenom\t: %d\n";
1976 const char* FMT2 = "\tyNum\t: %d\n";
1977 const char* FMT3 = "\tyDenom\t: %d\n";
1978 #else
1979 const char* FMT0 = "\txNum\t: %ld\n";
1980 const char* FMT1 = "\txDenom\t: %ld\n";
1981 const char* FMT2 = "\tyNum\t: %ld\n";
1982 const char* FMT3 = "\tyDenom\t: %ld\n";
1983 #endif
1984 printf( "*SCALEVIEWPORTEXTEX*\n" );
1985 printf( FMT0, xNum );
1986 printf( FMT1, xDenom );
1987 printf( FMT2, yNum );
1988 printf( FMT3, yDenom );
1989 }
1990 #endif /* ENABLE_EDITING */
1991 };
1992
1994
1999 class EMRSETWINDOWEXTEX : public METARECORD, ::EMRSETWINDOWEXTEX {
2000 public:
2005 EMRSETWINDOWEXTEX ( INT cx, INT cy )
2006 {
2007 emr.iType = EMR_SETWINDOWEXTEX;
2008 emr.nSize = sizeof( ::EMRSETWINDOWEXTEX );
2009 szlExtent.cx = cx;
2010 szlExtent.cy = cy;
2011 }
2016 EMRSETWINDOWEXTEX ( DATASTREAM& ds )
2017 {
2018 ds >> emr >> szlExtent;
2019 }
2023 bool serialize ( DATASTREAM ds )
2024 {
2025 ds << emr << szlExtent;
2026 return true;
2027 }
2031 int size ( void ) const { return emr.nSize; }
2037 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
2038 {
2039 EMF_UNUSED(source);
2040 SetWindowExtEx( dc, szlExtent.cx, szlExtent.cy, 0 );
2041 }
2042 #ifdef ENABLE_EDITING
2043
2046 void edit ( void ) const
2047 {
2048 printf( "*SETWINDOWEXTEX*\n" );
2049 edit_sizel( "szlExtent", szlExtent );
2050 }
2051 #endif /* ENABLE_EDITING */
2052 };
2053
2055
2060 class EMRSCALEWINDOWEXTEX : public METARECORD, ::EMRSCALEWINDOWEXTEX {
2061 public:
2068 EMRSCALEWINDOWEXTEX ( LONG x_num, LONG x_den, LONG y_num, LONG y_den )
2069 {
2070 emr.iType = EMR_SCALEWINDOWEXTEX;
2071 emr.nSize = sizeof( ::EMRSCALEWINDOWEXTEX );
2072 xNum = x_num;
2073 xDenom = x_den;
2074 yNum = y_num;
2075 yDenom = y_den;
2076 }
2081 EMRSCALEWINDOWEXTEX ( DATASTREAM& ds )
2082 {
2083 ds >> emr >> xNum >> xDenom >> yNum >> yDenom;
2084 }
2088 bool serialize ( DATASTREAM ds )
2089 {
2090 ds << emr << xNum << xDenom << yNum << yDenom;
2091 return true;
2092 }
2096 int size ( void ) const { return emr.nSize; }
2102 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
2103 {
2104 EMF_UNUSED(source);
2105 ScaleWindowExtEx( dc, xNum, xDenom, yNum, yDenom, 0 );
2106 }
2107 #ifdef ENABLE_EDITING
2108
2111 void edit ( void ) const
2112 {
2113 #if defined(__LP64__)
2114 const char* FMT0 = "\txNum\t: %d\n";
2115 const char* FMT1 = "\txDenom\t: %d\n";
2116 const char* FMT2 = "\tyNum\t: %d\n";
2117 const char* FMT3 = "\tyDenom\t: %d\n";
2118 #else
2119 const char* FMT0 = "\txNum\t: %ld\n";
2120 const char* FMT1 = "\txDenom\t: %ld\n";
2121 const char* FMT2 = "\tyNum\t: %ld\n";
2122 const char* FMT3 = "\tyDenom\t: %ld\n";
2123 #endif
2124 printf( "*SCALEWINDOWEXTEX*\n" );
2125 printf( FMT0, xNum );
2126 printf( FMT1, xDenom );
2127 printf( FMT2, yNum );
2128 printf( FMT3, yDenom );
2129 }
2130 #endif /* ENABLE_EDITING */
2131 };
2132
2134
2140 class EMRMODIFYWORLDTRANSFORM : public METARECORD, ::EMRMODIFYWORLDTRANSFORM {
2141 public:
2147 EMRMODIFYWORLDTRANSFORM ( const XFORM* transform, DWORD mode )
2148 {
2149 emr.iType = EMR_MODIFYWORLDTRANSFORM;
2150 emr.nSize = sizeof( ::EMRMODIFYWORLDTRANSFORM );
2151 xform = *transform;
2152 iMode = mode;
2153 }
2158 EMRMODIFYWORLDTRANSFORM ( DATASTREAM& ds )
2159 {
2160 ds >> emr >> xform >> iMode;
2161 }
2165 bool serialize ( DATASTREAM ds )
2166 {
2167 ds << emr << xform << iMode;
2168 return true;
2169 }
2173 int size ( void ) const { return emr.nSize; }
2179 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
2180 {
2181 EMF_UNUSED(source);
2182 ModifyWorldTransform( dc, &xform, iMode );
2183 }
2184 #ifdef ENABLE_EDITING
2185
2188 void edit ( void ) const
2189 {
2190 #if defined(__LP64__)
2191 const char* FMT = "unknown(%d)\n";
2192 #else
2193 const char* FMT = "unknown(%ld)\n";
2194 #endif /* __x86_64__ */
2195 printf( "*MODIFYWORLDTRANSFORM*\n" );
2196 edit_xform( "xform", xform );
2197 printf( "\tiMode\t\t: " );
2198 switch ( iMode ) {
2199 case MWT_IDENTITY: printf( "MWT_IDENTITY\n" ); break;
2200 case MWT_LEFTMULTIPLY: printf( "MWT_LEFTMULTIPLY\n" ); break;
2201 case MWT_RIGHTMULTIPLY: printf( "MWT_RIGHTMULTIPLY\n" ); break;
2202 default: printf( FMT, iMode );
2203 }
2204 }
2205 #endif /* ENABLE_EDITING */
2206 };
2207
2209
2215 class EMRSETWORLDTRANSFORM : public METARECORD, ::EMRSETWORLDTRANSFORM {
2216 public:
2220 EMRSETWORLDTRANSFORM ( const XFORM* transform )
2221 {
2222 emr.iType = EMR_SETWORLDTRANSFORM;
2223 emr.nSize = sizeof( ::EMRSETWORLDTRANSFORM );
2224 xform = *transform;
2225 }
2230 EMRSETWORLDTRANSFORM ( DATASTREAM& ds )
2231 {
2232 ds >> emr >> xform;
2233 }
2237 bool serialize ( DATASTREAM ds )
2238 {
2239 ds << emr << xform;
2240 return true;
2241 }
2245 int size ( void ) const { return emr.nSize; }
2251 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
2252 {
2253 EMF_UNUSED(source);
2254 SetWorldTransform( dc, &xform );
2255 }
2256 #ifdef ENABLE_EDITING
2257
2260 void edit ( void ) const
2261 {
2262 printf( "*SETWORLDTRANSFORM*\n" );
2263 edit_xform( "xform", xform );
2264 }
2265 #endif /* ENABLE_EDITING */
2266 };
2267
2269
2272 class EMRSETTEXTALIGN : public METARECORD, ::EMRSETTEXTALIGN {
2273 public:
2277 EMRSETTEXTALIGN ( UINT mode )
2278 {
2279 emr.iType = EMR_SETTEXTALIGN;
2280 emr.nSize = sizeof( ::EMRSETTEXTALIGN );
2281 iMode = mode;
2282 }
2287 EMRSETTEXTALIGN ( DATASTREAM& ds )
2288 {
2289 ds >> emr >> iMode;
2290 }
2294 bool serialize ( DATASTREAM ds )
2295 {
2296 ds << emr << iMode;
2297 return true;
2298 }
2302 int size ( void ) const { return emr.nSize; }
2308 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
2309 {
2310 EMF_UNUSED(source);
2311 SetTextAlign( dc, iMode );
2312 }
2313 #ifdef ENABLE_EDITING
2314
2317 void edit ( void ) const
2318 {
2319 #if defined(__LP64__)
2320 const char* FMT = "| unknown bits(0x%x)";
2321 #else
2322 const char* FMT = "| unknown bits(0x%lx)";
2323 #endif /* __x86_64__ */
2324 unsigned int known_bits = TA_BASELINE+TA_CENTER+TA_UPDATECP+TA_RTLREADING;
2325 unsigned int unknown_bits = ~known_bits;
2326
2327 printf( "*SETTEXTALIGN*\n" );
2328 printf( "\tiMode\t: " );
2329 if ( iMode & TA_UPDATECP )
2330 printf( "TA_UPDATECP" );
2331 else
2332 printf( "TA_NOUPDATECP" );
2333 if ( iMode & TA_CENTER )
2334 printf( " | TA_CENTER" );
2335 else if ( iMode & TA_RIGHT )
2336 printf( " | TA_RIGHT" );
2337 else
2338 printf( " | TA_LEFT" );
2339 if ( iMode & TA_BASELINE )
2340 printf( " | TA_BASELINE" );
2341 else if ( iMode & TA_BOTTOM )
2342 printf( " | TA_BOTTOM" );
2343 else
2344 printf( " | TA_TOP" );
2345 if ( iMode & TA_RTLREADING )
2346 printf( " | TA_RTLREADING" );
2347 if ( iMode & unknown_bits )
2348 printf( FMT, iMode & unknown_bits );
2349 printf( "\n" );
2350 }
2351 #endif /* ENABLE_EDITING */
2352 };
2353
2355
2358 class EMRSETTEXTCOLOR : public METARECORD, ::EMRSETTEXTCOLOR {
2359 public:
2363 EMRSETTEXTCOLOR ( COLORREF color )
2364 {
2365 emr.iType = EMR_SETTEXTCOLOR;
2366 emr.nSize = sizeof( ::EMRSETTEXTCOLOR );
2367 crColor = color;
2368 }
2373 EMRSETTEXTCOLOR ( DATASTREAM& ds )
2374 {
2375 ds >> emr >> crColor;
2376 }
2380 bool serialize ( DATASTREAM ds )
2381 {
2382 ds << emr << crColor;
2383 return true;
2384 }
2388 int size ( void ) const { return emr.nSize; }
2394 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
2395 {
2396 EMF_UNUSED(source);
2397 SetTextColor( dc, crColor );
2398 }
2399 #ifdef ENABLE_EDITING
2400
2403 void edit ( void ) const
2404 {
2405 printf( "*SETTEXTCOLOR*\n" );
2406 edit_color( "crColor", crColor );
2407 }
2408 #endif /* ENABLE_EDITING */
2409 };
2410
2412
2415 class EMRSETBKCOLOR : public METARECORD, ::EMRSETBKCOLOR {
2416 public:
2420 EMRSETBKCOLOR ( COLORREF color )
2421 {
2422 emr.iType = EMR_SETBKCOLOR;
2423 emr.nSize = sizeof( ::EMRSETBKCOLOR );
2424 crColor = color;
2425 }
2430 EMRSETBKCOLOR ( DATASTREAM& ds )
2431 {
2432 ds >> emr >> crColor;
2433 }
2437 bool serialize ( DATASTREAM ds )
2438 {
2439 ds << emr << crColor;
2440 return true;
2441 }
2445 int size ( void ) const { return emr.nSize; }
2451 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
2452 {
2453 EMF_UNUSED(source);
2454 SetBkColor( dc, crColor );
2455 }
2456 #ifdef ENABLE_EDITING
2457
2460 void edit ( void ) const
2461 {
2462 printf( "*SETBKCOLOR*\n" );
2463 edit_color( "crColor", crColor );
2464 }
2465 #endif /* ENABLE_EDITING */
2466 };
2467
2469
2473 class EMRSETBKMODE : public METARECORD, ::EMRSETBKMODE {
2474 public:
2478 EMRSETBKMODE ( DWORD mode )
2479 {
2480 emr.iType = EMR_SETBKMODE;
2481 emr.nSize = sizeof( ::EMRSETBKMODE );
2482 iMode = mode;
2483 }
2488 EMRSETBKMODE ( DATASTREAM& ds )
2489 {
2490 ds >> emr >> iMode;
2491 }
2495 bool serialize ( DATASTREAM ds )
2496 {
2497 ds << emr << iMode;
2498 return true;
2499 }
2503 int size ( void ) const { return emr.nSize; }
2509 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
2510 {
2511 EMF_UNUSED(source);
2512 SetBkMode( dc, iMode );
2513 }
2514 #ifdef ENABLE_EDITING
2515
2518 void edit ( void ) const
2519 {
2520 #if defined(__LP64__)
2521 const char* FMT = "unknown(%d)\n";
2522 #else
2523 const char* FMT = "unknown(%ld)\n";
2524 #endif /* __x86_64__ */
2525 printf( "*SETBKMODE*\n" );
2526 printf( "\tiMode\t: " );
2527 switch ( iMode ) {
2528 case TRANSPARENT: printf( "TRANSPARENT\n" ); break;
2529 case OPAQUE: printf( "OPAQUE\n" ); break;
2530 default: printf( FMT, iMode );
2531 }
2532 }
2533 #endif /* ENABLE_EDITING */
2534 };
2535
2537
2540 class EMRSETPOLYFILLMODE : public METARECORD, ::EMRSETPOLYFILLMODE {
2541 public:
2545 EMRSETPOLYFILLMODE ( DWORD mode )
2546 {
2547 emr.iType = EMR_SETPOLYFILLMODE;
2548 emr.nSize = sizeof( ::EMRSETPOLYFILLMODE );
2549 iMode = mode;
2550 }
2555 EMRSETPOLYFILLMODE ( DATASTREAM& ds )
2556 {
2557 ds >> emr >> iMode;
2558 }
2562 bool serialize ( DATASTREAM ds )
2563 {
2564 ds << emr << iMode;
2565 return true;
2566 }
2570 int size ( void ) const { return emr.nSize; }
2576 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
2577 {
2578 EMF_UNUSED(source);
2579 SetPolyFillMode( dc, iMode );
2580 }
2581 #ifdef ENABLE_EDITING
2582
2585 void edit ( void ) const
2586 {
2587 #if defined(__LP64__)
2588 const char* FMT = "unknown(%d)\n";
2589 #else
2590 const char* FMT = "unknown(%ld)\n";
2591 #endif /* __x86_64__ */
2592 printf( "*SETPOLYFILLMODE*\n" );
2593 printf( "\tiMode: " );
2594 switch ( iMode ) {
2595 case ALTERNATE: printf( "ALTERNATE\n" ); break;
2596 case WINDING: printf( "WINDING\n" ); break;
2597 default: printf( FMT, iMode );
2598 }
2599 }
2600 #endif /* ENABLE_EDITING */
2601 };
2602
2604
2608 class EMRSETMAPMODE : public METARECORD, ::EMRSETMAPMODE {
2609 public:
2613 EMRSETMAPMODE ( DWORD mode )
2614 {
2615 emr.iType = EMR_SETMAPMODE;
2616 emr.nSize = sizeof( ::EMRSETMAPMODE );
2617 iMode = mode;
2618 }
2623 EMRSETMAPMODE ( DATASTREAM& ds )
2624 {
2625 ds >> emr >> iMode;
2626 }
2630 bool serialize ( DATASTREAM ds )
2631 {
2632 ds << emr << iMode;
2633 return true;
2634 }
2638 int size ( void ) const { return emr.nSize; }
2644 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
2645 {
2646 EMF_UNUSED(source);
2647 SetMapMode( dc, iMode );
2648 }
2649 #ifdef ENABLE_EDITING
2650
2653 void edit ( void ) const
2654 {
2655 #if defined(__LP64__)
2656 const char* FMT = "unknown(%d)\n";
2657 #else
2658 const char* FMT = "unknown(%ld)\n";
2659 #endif /* __x86_64__ */
2660 printf( "*SETMAPMODE*\n" );
2661 printf( "\tiMode\t: " );
2662 switch ( iMode ) {
2663 case MM_TEXT: printf( "MM_TEXT\n" ); break;
2664 case MM_LOMETRIC: printf( "MM_LOMETRIC\n" ); break;
2665 case MM_HIMETRIC: printf( "MM_HIMETRIC\n" ); break;
2666 case MM_LOENGLISH: printf( "MM_LOENGLISH\n" ); break;
2667 case MM_HIENGLISH: printf( "MM_HIENGLISH\n" ); break;
2668 case MM_TWIPS: printf( "MM_TWIPS\n" ); break;
2669 case MM_ISOTROPIC: printf( "MM_ISOTROPIC\n" ); break;
2670 case MM_ANISOTROPIC: printf( "MM_ANISOTROPIC\n" ); break;
2671 default: printf( FMT, iMode );
2672 }
2673 }
2674 #endif /* ENABLE_EDITING */
2675 };
2676
2678
2681 class EMRSELECTOBJECT : public METARECORD, ::EMRSELECTOBJECT {
2682 public:
2686 EMRSELECTOBJECT ( HGDIOBJ object )
2687 {
2688 emr.iType = EMR_SELECTOBJECT;
2689 emr.nSize = sizeof( ::EMRSELECTOBJECT );
2690 ihObject = object;
2691 }
2696 EMRSELECTOBJECT ( DATASTREAM& ds )
2697 {
2698 ds >> emr >> ihObject;
2699 }
2703 bool serialize ( DATASTREAM ds )
2704 {
2705 ds << emr << ihObject;
2706 return true;
2707 }
2711 int size ( void ) const { return emr.nSize; }
2717 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const;
2718 #ifdef ENABLE_EDITING
2719
2722 void edit ( void ) const
2723 {
2724 #if defined(__LP64__)
2725 const char* FMT = "\tihObject\t: 0x%x\n";
2726 #else
2727 const char* FMT = "\tihObject\t: 0x%lx\n";
2728 #endif /* __x86_64__ */
2729 printf( "*SELECTOBJECT*\n" );
2730 printf( FMT, ihObject );
2731 }
2732 #endif /* ENABLE_EDITING */
2733 };
2734
2736
2739 class EMRDELETEOBJECT : public METARECORD, ::EMRDELETEOBJECT {
2740 public:
2744 EMRDELETEOBJECT ( HGDIOBJ object )
2745 {
2746 emr.iType = EMR_DELETEOBJECT;
2747 emr.nSize = sizeof( ::EMRDELETEOBJECT );
2748 ihObject = object;
2749 }
2754 EMRDELETEOBJECT ( DATASTREAM& ds )
2755 {
2756 ds >> emr >> ihObject;
2757 }
2761 bool serialize ( DATASTREAM ds )
2762 {
2763 ds << emr << ihObject;
2764 return true;
2765 }
2769 int size ( void ) const { return emr.nSize; }
2775 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const;
2776 #ifdef ENABLE_EDITING
2777
2780 void edit ( void ) const
2781 {
2782 #if defined(__LP64__)
2783 const char* FMT = "\tihObject\t: 0x%x\n";
2784 #else
2785 const char* FMT = "\tihObject\t: 0x%lx\n";
2786 #endif /* __x86_64__ */
2787 printf( "*DELETEOBJECT*\n" );
2788 printf( FMT, ihObject );
2789 }
2790 #endif /* ENABLE_EDITING */
2791 };
2792
2794
2797 class EMRMOVETOEX : public METARECORD, ::EMRMOVETOEX {
2798 public:
2803 EMRMOVETOEX ( INT x, INT y )
2804 {
2805 emr.iType = EMR_MOVETOEX;
2806 emr.nSize = sizeof( ::EMRMOVETOEX );
2807 ptl.x = x;
2808 ptl.y = y;
2809 }
2814 EMRMOVETOEX ( DATASTREAM& ds )
2815 {
2816 ds >> emr >> ptl;
2817 }
2821 bool serialize ( DATASTREAM ds )
2822 {
2823 ds << emr << ptl;
2824 return true;
2825 }
2829 int size ( void ) const { return emr.nSize; }
2835 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
2836 {
2837 EMF_UNUSED(source);
2838 MoveToEx( dc, ptl.x, ptl.y, 0 );
2839 }
2840 #ifdef ENABLE_EDITING
2841
2844 void edit ( void ) const
2845 {
2846 printf( "*MOVETOEX*\n" );
2847 edit_pointl( "ptl", ptl );
2848 }
2849 #endif /* ENABLE_EDITING */
2850 };
2851
2853
2856 class EMRLINETO : public METARECORD, ::EMRLINETO {
2857 public:
2862 EMRLINETO ( INT x, INT y )
2863 {
2864 emr.iType = EMR_LINETO;
2865 emr.nSize = sizeof( ::EMRLINETO );
2866 ptl.x = x;
2867 ptl.y = y;
2868 }
2873 EMRLINETO ( DATASTREAM& ds )
2874 {
2875 ds >> emr >> ptl;
2876 }
2880 bool serialize ( DATASTREAM ds )
2881 {
2882 ds << emr << ptl;
2883 return true;
2884 }
2888 int size ( void ) const { return emr.nSize; }
2894 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
2895 {
2896 EMF_UNUSED(source);
2897 LineTo( dc, ptl.x, ptl.y );
2898 }
2899 #ifdef ENABLE_EDITING
2900
2903 void edit ( void ) const
2904 {
2905 printf( "*LINETO*\n" );
2906 edit_pointl( "ptl", ptl );
2907 }
2908 #endif /* ENABLE_EDITING */
2909 };
2910
2912
2915 class EMRARC : public METARECORD, ::EMRARC {
2916 public:
2928 EMRARC ( INT left, INT top, INT right, INT bottom, INT xstart,
2929 INT ystart, INT xend, INT yend )
2930 {
2931 emr.iType = EMR_ARC;
2932 emr.nSize = sizeof( ::EMRARC );
2933 rclBox.left = left;
2934 rclBox.right = right;
2935 rclBox.bottom = bottom;
2936 rclBox.top = top;
2937 ptlStart.x = xstart;
2938 ptlStart.y = ystart;
2939 ptlEnd.x = xend;
2940 ptlEnd.y = yend;
2941 }
2946 EMRARC ( DATASTREAM& ds )
2947 {
2948 ds >> emr >> rclBox >> ptlStart >> ptlEnd;
2949 }
2953 bool serialize ( DATASTREAM ds )
2954 {
2955 ds << emr << rclBox << ptlStart << ptlEnd;
2956 return true;
2957 }
2961 int size ( void ) const { return emr.nSize; }
2967 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
2968 {
2969 EMF_UNUSED(source);
2970 Arc( dc, rclBox.left, rclBox.top, rclBox.right, rclBox.bottom,
2971 ptlStart.x, ptlStart.y, ptlEnd.x, ptlEnd.y );
2972 }
2973 #ifdef ENABLE_EDITING
2974
2977 void edit ( void ) const
2978 {
2979 printf( "*ARC*\n" );
2980 edit_rectl( "rclBox\t", rclBox );
2981 edit_pointl( "ptlStart", ptlStart );
2982 edit_pointl( "ptlEnd\t", ptlEnd );
2983 }
2984 #endif /* ENABLE_EDITING */
2985 };
2986
2988
2991 class EMRARCTO : public METARECORD, ::EMRARCTO {
2992 public:
3004 EMRARCTO ( INT left, INT top, INT right, INT bottom, INT xstart,
3005 INT ystart, INT xend, INT yend )
3006 {
3007 emr.iType = EMR_ARCTO;
3008 emr.nSize = sizeof( ::EMRARCTO );
3009 rclBox.left = left;
3010 rclBox.right = right;
3011 rclBox.bottom = bottom;
3012 rclBox.top = top;
3013 ptlStart.x = xstart;
3014 ptlStart.y = ystart;
3015 ptlEnd.x = xend;
3016 ptlEnd.y = yend;
3017 }
3022 EMRARCTO ( DATASTREAM& ds )
3023 {
3024 ds >> emr >> rclBox >> ptlStart >> ptlEnd;
3025 }
3029 bool serialize ( DATASTREAM ds )
3030 {
3031 ds << emr << rclBox << ptlStart << ptlEnd;
3032 return true;
3033 }
3037 int size ( void ) const { return emr.nSize; }
3043 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
3044 {
3045 EMF_UNUSED(source);
3046 ArcTo( dc, rclBox.left, rclBox.top, rclBox.right, rclBox.bottom,
3047 ptlStart.x, ptlStart.y, ptlEnd.x, ptlEnd.y );
3048 }
3049 #ifdef ENABLE_EDITING
3050
3053 void edit ( void ) const
3054 {
3055 printf( "*ARCTO*\n" );
3056 edit_rectl( "rclBox\t", rclBox );
3057 edit_pointl( "ptlStart", ptlStart );
3058 edit_pointl( "ptlEnd\t", ptlEnd );
3059 }
3060 #endif /* ENABLE_EDITING */
3061 };
3062
3064
3067 class EMRRECTANGLE : public METARECORD, ::EMRRECTANGLE {
3068 public:
3075 EMRRECTANGLE ( INT left, INT top, INT right, INT bottom )
3076 {
3077 emr.iType = EMR_RECTANGLE;
3078 emr.nSize = sizeof( ::EMRRECTANGLE );
3079 rclBox.left = left;
3080 rclBox.right = right;
3081 rclBox.bottom = bottom;
3082 rclBox.top = top;
3083 }
3088 EMRRECTANGLE ( DATASTREAM& ds )
3089 {
3090 ds >> emr >> rclBox;
3091 }
3095 bool serialize ( DATASTREAM ds )
3096 {
3097 ds << emr << rclBox;
3098 return true;
3099 }
3103 int size ( void ) const { return emr.nSize; }
3109 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
3110 {
3111 EMF_UNUSED(source);
3112 Rectangle( dc, rclBox.left, rclBox.top, rclBox.right, rclBox.bottom );
3113 }
3114 #ifdef ENABLE_EDITING
3115
3118 void edit ( void ) const
3119 {
3120 printf( "*RECTANGLE*\n" );
3121 edit_rectl( "rclBox", rclBox );
3122 }
3123 #endif /* ENABLE_EDITING */
3124 };
3125
3127
3130 class EMRELLIPSE : public METARECORD, ::EMRELLIPSE {
3131 public:
3139 EMRELLIPSE ( INT left, INT top, INT right, INT bottom )
3140 {
3141 emr.iType = EMR_ELLIPSE;
3142 emr.nSize = sizeof( ::EMRELLIPSE );
3143 rclBox.left = left;
3144 rclBox.right = right;
3145 rclBox.bottom = bottom;
3146 rclBox.top = top;
3147 }
3152 EMRELLIPSE ( DATASTREAM& ds )
3153 {
3154 ds >> emr >> rclBox;
3155 }
3159 bool serialize ( DATASTREAM ds )
3160 {
3161 ds << emr << rclBox;
3162 return true;
3163 }
3167 int size ( void ) const { return emr.nSize; }
3173 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
3174 {
3175 EMF_UNUSED(source);
3176 Ellipse( dc, rclBox.left, rclBox.top, rclBox.right, rclBox.bottom );
3177 }
3178 #ifdef ENABLE_EDITING
3179
3182 void edit ( void ) const
3183 {
3184 printf( "*ELLIPSE*\n" );
3185 edit_rectl( "rclBox", rclBox );
3186 }
3187 #endif /* ENABLE_EDITING */
3188 };
3189
3191
3194 class EMRPOLYLINE : public METARECORD, ::EMRPOLYLINE {
3195 POINTL* lpoints;
3196 public:
3202 EMRPOLYLINE ( const RECTL* bounds, const POINT* points, INT n )
3203 {
3204 cptl = n;
3205 aptl[0].x = 0; // Really unused
3206 aptl[0].y = 0;
3207
3208 emr.iType = EMR_POLYLINE;
3209 // The (cptl - 1) below is to account for aptl, which isn't written out
3210 emr.nSize = sizeof( ::EMRPOLYLINE ) + sizeof( POINTL ) * ( cptl - 1);
3211
3212 lpoints = new POINTL[cptl];
3213
3214 for (int i=0; i<n; i++) {
3215 lpoints[i].x = points[i].x;
3216 lpoints[i].y = points[i].y;
3217 }
3218
3219 rclBounds = *bounds;
3220 }
3224 ~EMRPOLYLINE ( )
3225 {
3226 if ( lpoints ) delete[] lpoints;
3227 }
3232 EMRPOLYLINE ( DATASTREAM& ds )
3233 {
3234 ds >> emr >> rclBounds >> cptl;
3235
3236 lpoints = new POINTL[cptl];
3237
3238 POINTLARRAY points( lpoints, cptl );
3239
3240 ds >> points;
3241 }
3245 bool serialize ( DATASTREAM ds )
3246 {
3247 ds << emr << rclBounds << cptl << POINTLARRAY( lpoints, cptl );
3248 return true;
3249 }
3253 int size ( void ) const { return emr.nSize; }
3259 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
3260 {
3261 EMF_UNUSED(source);
3262 // According to the wine windef.h header, POINT and POINTL are equivalent
3263 Polyline( dc, (POINT*)lpoints, cptl );
3264 }
3265 #ifdef ENABLE_EDITING
3266
3269 void edit ( void ) const
3270 {
3271 printf( "*POLYLINE*\n" );
3272 edit_rectl( "rclBounds", rclBounds );
3273 #if 0
3274 printf( "\tcptl : %ld\n", cptl );
3275 printf( "\taptl->\n" );
3276 for ( unsigned int i = 0; i < cptl; i++ )
3277 printf( "\t\t%ld, %ld\n", lpoints[i].x, lpoints[i].y );
3278 #else
3279 edit_pointlarray( "\t", cptl, lpoints );
3280 #endif
3281 }
3282 #endif /* ENABLE_EDITING */
3283 };
3284
3286
3289 class EMRPOLYLINE16 : public METARECORD, ::EMRPOLYLINE16 {
3290 POINT16* lpoints;
3291 public:
3297 EMRPOLYLINE16 ( const RECTL* bounds, const POINT16* points, INT n )
3298 {
3299 cpts = n;
3300 apts[0].x = 0; // Really unused
3301 apts[0].y = 0;
3302
3303 emr.iType = EMR_POLYLINE16;
3304 // The (cptl - 1) below is to account for aptl, which isn't written out
3305 emr.nSize = sizeof( ::EMRPOLYLINE16 ) + sizeof( POINT16 ) * ( cpts - 1);
3306
3307 lpoints = new POINT16[cpts];
3308
3309 for (int i=0; i<n; i++) {
3310 lpoints[i].x = points[i].x;
3311 lpoints[i].y = points[i].y;
3312 }
3313
3314 rclBounds = *bounds;
3315 }
3322 EMRPOLYLINE16 ( const RECTL* bounds, const POINT* points, INT n )
3323 {
3324 cpts = n;
3325 apts[0].x = 0; // Really unused
3326 apts[0].y = 0;
3327
3328 emr.iType = EMR_POLYLINE16;
3329 // The (cptl - 1) below is to account for aptl, which isn't written out
3330 emr.nSize = sizeof( ::EMRPOLYLINE16 ) + sizeof( POINT16 ) * ( cpts - 1);
3331
3332 lpoints = new POINT16[cpts];
3333
3334 for (int i=0; i<n; i++) {
3335 lpoints[i].x = points[i].x;
3336 lpoints[i].y = points[i].y;
3337 }
3338
3339 rclBounds = *bounds;
3340 }
3344 ~EMRPOLYLINE16 ( )
3345 {
3346 if ( lpoints ) delete[] lpoints;
3347 }
3352 EMRPOLYLINE16 ( DATASTREAM& ds )
3353 {
3354 ds >> emr >> rclBounds >> cpts;
3355
3356 lpoints = new POINT16[cpts];
3357
3358 POINT16ARRAY points( lpoints, cpts );
3359
3360 ds >> points;
3361 }
3365 bool serialize ( DATASTREAM ds )
3366 {
3367 ds << emr << rclBounds << cpts << POINT16ARRAY( lpoints, cpts );
3368 return true;
3369 }
3373 int size ( void ) const { return emr.nSize; }
3379 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
3380 {
3381 EMF_UNUSED(source);
3382 // According to the wine windef.h header, POINT and POINTL are equivalent
3383 Polyline16( dc, lpoints, cpts );
3384 }
3385 #ifdef ENABLE_EDITING
3386
3389 void edit ( void ) const
3390 {
3391 printf( "*POLYLINE16*\n" );
3392 edit_rectl( "rclBounds", rclBounds );
3393 edit_point16array( "\t", cpts, lpoints );
3394 }
3395 #endif /* ENABLE_EDITING */
3396 };
3397
3399
3402 class EMRPOLYGON : public METARECORD, ::EMRPOLYGON {
3403 POINTL* lpoints;
3404 public:
3410 EMRPOLYGON ( const RECTL* bounds, const POINT* points, INT n )
3411 {
3412 cptl = n;
3413 aptl[0].x = 0; // Really unused
3414 aptl[0].y = 0;
3415
3416 emr.iType = EMR_POLYGON;
3417 // The (cptl-1) below is to account for aptl, which isn't written out
3418 emr.nSize = sizeof( ::EMRPOLYGON ) + sizeof( POINTL ) * (cptl-1);
3419
3420 lpoints = new POINTL[cptl];
3421
3422 for (int i=0; i<n; i++) {
3423 lpoints[i].x = points[i].x;
3424 lpoints[i].y = points[i].y;
3425 }
3426
3427 rclBounds = *bounds;
3428 }
3433 EMRPOLYGON ( DATASTREAM& ds )
3434 {
3435 ds >> emr >> rclBounds >> cptl;
3436
3437 lpoints = new POINTL[cptl];
3438
3439 POINTLARRAY points( lpoints, cptl );
3440
3441 ds >> points;
3442 }
3446 ~EMRPOLYGON ( )
3447 {
3448 if ( lpoints ) delete[] lpoints;
3449 }
3453 bool serialize ( DATASTREAM ds )
3454 {
3455 ds << emr << rclBounds << cptl << POINTLARRAY( lpoints, cptl );
3456 return true;
3457 }
3461 int size ( void ) const { return emr.nSize; }
3467 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
3468 {
3469 EMF_UNUSED(source);
3470 // According to the wine windef.h header, POINT and POINTL are equivalent
3471 Polygon( dc, (POINT*)lpoints, cptl );
3472 }
3473 #ifdef ENABLE_EDITING
3474
3477 void edit ( void ) const
3478 {
3479 printf( "*POLYGON*\n" );
3480 edit_rectl( "rclBounds", rclBounds );
3481 #if 0
3482 printf( "\tcptl : %ld\n", cptl );
3483 printf( "\taptl->\n" );
3484 for ( unsigned int i = 0; i < cptl; i++ )
3485 printf( "\t\t%ld, %ld\n", lpoints[i].x, lpoints[i].y );
3486 #else
3487 edit_pointlarray( "\t", cptl, lpoints );
3488 #endif
3489 }
3490 #endif /* ENABLE_EDITING */
3491 };
3492
3494
3497 class EMRPOLYGON16 : public METARECORD, ::EMRPOLYGON16 {
3498 POINT16* lpoints;
3499 public:
3505 EMRPOLYGON16 ( const RECTL* bounds, const POINT* points, INT16 n )
3506 {
3507 cpts = n;
3508 apts[0].x = 0; // Really unused
3509 apts[0].y = 0;
3510
3511 emr.iType = EMR_POLYGON16;
3512 // The (cptl-1) below is to account for aptl, which isn't written out
3513 emr.nSize = sizeof( ::EMRPOLYGON16 ) + sizeof( POINT16 ) * (cpts-1);
3514
3515 lpoints = new POINT16[cpts];
3516
3517 for (int i=0; i<n; i++) {
3518 lpoints[i].x = points[i].x;
3519 lpoints[i].y = points[i].y;
3520 }
3521
3522 rclBounds = *bounds;
3523 }
3530 EMRPOLYGON16 ( const RECTL* bounds, const POINT16* points, INT16 n )
3531 {
3532 cpts = n;
3533 apts[0].x = 0; // Really unused
3534 apts[0].y = 0;
3535
3536 emr.iType = EMR_POLYGON16;
3537 // The (cptl-1) below is to account for aptl, which isn't written out
3538 emr.nSize = sizeof( ::EMRPOLYGON16 ) + sizeof( POINT16 ) * (cpts-1);
3539
3540 lpoints = new POINT16[cpts];
3541
3542 for (int i=0; i<n; i++) {
3543 lpoints[i].x = points[i].x;
3544 lpoints[i].y = points[i].y;
3545 }
3546
3547 rclBounds = *bounds;
3548 }
3553 EMRPOLYGON16 ( DATASTREAM& ds )
3554 {
3555 ds >> emr >> rclBounds >> cpts;
3556
3557 lpoints = new POINT16[cpts];
3558
3559 POINT16ARRAY points( lpoints, cpts );
3560
3561 ds >> points;
3562 }
3566 ~EMRPOLYGON16 ( )
3567 {
3568 if ( lpoints ) delete[] lpoints;
3569 }
3573 bool serialize ( DATASTREAM ds )
3574 {
3575 ds << emr << rclBounds << cpts << POINT16ARRAY( lpoints, cpts );
3576 return true;
3577 }
3581 int size ( void ) const { return emr.nSize; }
3587 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
3588 {
3589 EMF_UNUSED(source);
3590 // According to the wine windef.h header, POINT and POINTL are equivalent
3591 Polygon16( dc, lpoints, cpts );
3592 }
3593 #ifdef ENABLE_EDITING
3594
3597 void edit ( void ) const
3598 {
3599 printf( "*POLYGON16*\n" );
3600 edit_rectl( "rclBounds", rclBounds );
3601 edit_point16array( "\t", cpts, lpoints );
3602 }
3603 #endif /* ENABLE_EDITING */
3604 };
3605
3607
3610 class EMRPOLYPOLYGON : public METARECORD, ::EMRPOLYPOLYGON {
3611 DWORD* lcounts;
3612 POINTL* lpoints;
3613 public:
3620 EMRPOLYPOLYGON ( const RECTL* bounds, const POINT* points, const INT* counts,
3621 UINT polygons )
3622 {
3623 nPolys = polygons;
3624 // Count the number of points in points
3625 int n = 0;
3626 for ( unsigned int i = 0; i < nPolys; i++ )
3627 n += counts[i];
3628
3629 cptl = n;
3630 aPolyCounts[0] = 0; // Really unused
3631 aptl[0].x = 0;
3632 aptl[0].y = 0;
3633
3634 emr.iType = EMR_POLYPOLYGON;
3635 // The (#-1)'s below are to account for aPolyCounts[0] and aptl[0], which
3636 // aren't directly written out
3637 emr.nSize = sizeof( ::EMRPOLYPOLYGON ) + sizeof( POINTL ) * (cptl-1)
3638 + sizeof( DWORD ) * (nPolys-1);
3639
3640 lcounts = new DWORD[nPolys];
3641
3642 for ( unsigned int i = 0; i < nPolys; i++ )
3643 lcounts[i] = counts[i];
3644
3645 lpoints = new POINTL[cptl];
3646
3647 for (int i=0; i<n; i++) {
3648 lpoints[i].x = points[i].x;
3649 lpoints[i].y = points[i].y;
3650 }
3651
3652 rclBounds = *bounds;
3653 }
3657 ~EMRPOLYPOLYGON ( )
3658 {
3659 if ( lcounts ) delete[] lcounts;
3660 if ( lpoints ) delete[] lpoints;
3661 }
3666 EMRPOLYPOLYGON ( DATASTREAM& ds )
3667 {
3668 ds >> emr >> rclBounds >> nPolys >> cptl;
3669
3670 lcounts = new DWORD[nPolys];
3671
3672 DWORDARRAY counts( lcounts, nPolys );
3673
3674 ds >> counts;
3675
3676 lpoints = new POINTL[cptl];
3677
3678 POINTLARRAY points( lpoints, cptl );
3679
3680 ds >> points;
3681 }
3685 bool serialize ( DATASTREAM ds )
3686 {
3687 ds << emr << rclBounds << nPolys << cptl << DWORDARRAY( lcounts, nPolys )
3688 << POINTLARRAY( lpoints, cptl );
3689 return true;
3690 }
3694 int size ( void ) const { return emr.nSize; }
3700 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
3701 {
3702 EMF_UNUSED(source);
3703 // According to the wine windef.h header, POINT and POINTL are equivalent
3704 // (but DWORD and INT are not)
3705 std::vector<INT> countsv( lcounts, lcounts + nPolys );
3706
3707 PolyPolygon( dc, (POINT*)lpoints, &countsv[0], nPolys );
3708 }
3709 #ifdef ENABLE_EDITING
3710
3713 void edit ( void ) const
3714 {
3715 #if defined(__LP64__)
3716 const char* FMT0 = "\tnPolys\t\t: %d\n";
3717 const char* FMT1 = "\tcptl\t\t: %d\n";
3718 const char* FMT2 = "%d\n";
3719 const char* FMT3 = "\t\t\t %d\n";
3720 const char* FMT4 = "%d, %d\n";
3721 const char* FMT5 = "\t\t\t %d, %d\n";
3722 #else
3723 const char* FMT0 = "\tnPolys\t\t: %ld\n";
3724 const char* FMT1 = "\tcptl\t\t: %ld\n";
3725 const char* FMT2 = "%ld\n";
3726 const char* FMT3 = "\t\t\t %ld\n";
3727 const char* FMT4 = "%ld, %ld\n";
3728 const char* FMT5 = "\t\t\t %ld, %ld\n";
3729 #endif /* __x86_64__ */
3730 printf( "*POLYPOLYGON*\n" );
3731 edit_rectl( "rclBounds", rclBounds );
3732 printf( FMT0, nPolys );
3733 printf( FMT1, cptl );
3734 printf( "\taPolyCounts\t: " );
3735 if ( nPolys > 0 )
3736 printf( FMT2, lcounts[0] );
3737 else
3738 puts( "" );
3739 for ( unsigned int i = 1; i < nPolys; i++ )
3740 printf( FMT3, lcounts[i] );
3741 printf( "\tapts\t\t: " );
3742 if ( cptl > 0 )
3743 printf( FMT4, lpoints[0].x, lpoints[0].y );
3744 else
3745 puts( "" );
3746 for ( unsigned int i = 1; i < cptl; i++ )
3747 printf( FMT5, lpoints[i].x, lpoints[i].y );
3748 }
3749 #endif /* ENABLE_EDITING */
3750 };
3751
3753
3756 class EMRPOLYPOLYGON16 : public METARECORD, ::EMRPOLYPOLYGON16 {
3757 DWORD* lcounts;
3758 POINT16* lpoints;
3759 public:
3766 EMRPOLYPOLYGON16 ( const RECTL* bounds, const POINT* points,
3767 const INT* counts, UINT polygons )
3768 {
3769 nPolys = polygons;
3770 // Count the number of points in points
3771 int n = 0;
3772 for ( unsigned int i = 0; i < nPolys; i++ )
3773 n += counts[i];
3774
3775 cpts = n;
3776 aPolyCounts[0] = 0; // Really unused
3777 apts[0].x = 0;
3778 apts[0].y = 0;
3779
3780 emr.iType = EMR_POLYPOLYGON16;
3781 // The (#-1)'s below are to account for aPolyCounts[0] and aptl[0], which
3782 // aren't directly written out
3783 emr.nSize = sizeof( ::EMRPOLYPOLYGON16 ) + sizeof( POINT16 ) * (cpts-1)
3784 + sizeof( DWORD ) * (nPolys-1);
3785
3786 lcounts = new DWORD[nPolys];
3787
3788 for ( unsigned int i = 0; i < nPolys; i++ )
3789 lcounts[i] = counts[i];
3790
3791 lpoints = new POINT16[cpts];
3792
3793 for (int i=0; i<n; i++) {
3794 lpoints[i].x = points[i].x;
3795 lpoints[i].y = points[i].y;
3796 }
3797
3798 rclBounds = *bounds;
3799 }
3807 EMRPOLYPOLYGON16 ( const RECTL* bounds, const POINT16* points,
3808 const INT* counts, UINT16 polygons )
3809 {
3810 nPolys = polygons;
3811 // Count the number of points in points
3812 int n = 0;
3813 for ( unsigned int i = 0; i < nPolys; i++ )
3814 n += counts[i];
3815
3816 cpts = n;
3817 aPolyCounts[0] = 0; // Really unused
3818 apts[0].x = 0;
3819 apts[0].y = 0;
3820
3821 emr.iType = EMR_POLYPOLYGON16;
3822 // The (#-1)'s below are to account for aPolyCounts[0] and aptl[0], which
3823 // aren't directly written out
3824 emr.nSize = sizeof( ::EMRPOLYPOLYGON16 ) + sizeof( POINT16 ) * (cpts-1)
3825 + sizeof( DWORD ) * (nPolys-1);
3826
3827 lcounts = new DWORD[nPolys];
3828
3829 for ( unsigned int i = 0; i < nPolys; i++ )
3830 lcounts[i] = counts[i];
3831
3832 lpoints = new POINT16[cpts];
3833
3834 for (int i=0; i<n; i++) {
3835 lpoints[i].x = points[i].x;
3836 lpoints[i].y = points[i].y;
3837 }
3838
3839 rclBounds = *bounds;
3840 }
3844 ~EMRPOLYPOLYGON16 ( )
3845 {
3846 if ( lcounts ) delete[] lcounts;
3847 if ( lpoints ) delete[] lpoints;
3848 }
3853 EMRPOLYPOLYGON16 ( DATASTREAM& ds )
3854 {
3855 ds >> emr >> rclBounds >> nPolys >> cpts;
3856
3857 lcounts = new DWORD[nPolys];
3858
3859 DWORDARRAY counts( lcounts, nPolys );
3860
3861 ds >> counts;
3862
3863 lpoints = new POINT16[cpts];
3864
3865 POINT16ARRAY points( lpoints, cpts );
3866
3867 ds >> points;
3868 }
3872 bool serialize ( DATASTREAM ds )
3873 {
3874 ds << emr << rclBounds << nPolys << cpts << DWORDARRAY( lcounts, nPolys )
3875 << POINT16ARRAY( lpoints, cpts );
3876 return true;
3877 }
3881 int size ( void ) const { return emr.nSize; }
3887 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
3888 {
3889 EMF_UNUSED(source);
3890 // According to the wine windef.h header, POINT and POINTL are equivalent
3891 // (but DWORD and INT are not)
3892 std::vector<INT> counts( lcounts, lcounts + nPolys );
3893
3894 PolyPolygon16( dc, lpoints, &counts[0], nPolys );
3895 }
3896 #ifdef ENABLE_EDITING
3897
3900 void edit ( void ) const
3901 {
3902 #if defined(__LP64__)
3903 const char* FMT0 = "\tnPolys\t\t: %d\n";
3904 const char* FMT1 = "\tcptl\t\t: %d\n";
3905 const char* FMT2 = "%d\n";
3906 const char* FMT3 = "\t\t\t %d\n";
3907 #else
3908 const char* FMT0 = "\tnPolys\t\t: %ld\n";
3909 const char* FMT1 = "\tcptl\t\t: %ld\n";
3910 const char* FMT2 = "%ld\n";
3911 const char* FMT3 = "\t\t\t %ld\n";
3912 #endif /* __x86_64__ */
3913 printf( "*POLYPOLYGON16*\n" );
3914 edit_rectl( "rclBounds", rclBounds );
3915 printf( FMT0, nPolys );
3916 printf( FMT1, cpts );
3917 printf( "\taPolyCounts\t: " );
3918 if ( nPolys > 0 )
3919 printf( FMT2, lcounts[0] );
3920 else
3921 puts( "" );
3922 for ( unsigned int i = 1; i < nPolys; i++ )
3923 printf( FMT3, lcounts[i] );
3924 printf( "\tapts\t\t: " );
3925 if ( cpts > 0 )
3926 printf( "%d, %d\n", lpoints[0].x, lpoints[0].y );
3927 else
3928 puts( "" );
3929 for ( unsigned int i = 1; i < cpts; i++ )
3930 printf( "\t\t\t %d, %d\n", lpoints[i].x, lpoints[i].y );
3931 }
3932 #endif /* ENABLE_EDITING */
3933 };
3934
3936
3939 class EMRPOLYBEZIER : public METARECORD, ::EMRPOLYBEZIER {
3940 POINTL* lpoints;
3941 public:
3947 EMRPOLYBEZIER ( const RECTL* bounds, const POINT* points, INT n )
3948 {
3949 cptl = n;
3950 aptl[0].x = 0; // Really unused
3951 aptl[0].y = 0;
3952
3953 emr.iType = EMR_POLYBEZIER;
3954 // The (cptl-1) below is to account for aptl, which isn't written out
3955 emr.nSize = sizeof( ::EMRPOLYBEZIER ) + sizeof( POINTL ) * (cptl-1);
3956
3957 lpoints = new POINTL[cptl];
3958
3959 for (int i=0; i<n; i++) {
3960 lpoints[i].x = points[i].x;
3961 lpoints[i].y = points[i].y;
3962 }
3963
3964 rclBounds = *bounds;
3965 }
3970 EMRPOLYBEZIER ( DATASTREAM& ds )
3971 {
3972 ds >> emr >> rclBounds >> cptl;
3973
3974 lpoints = new POINTL[cptl];
3975
3976 POINTLARRAY points( lpoints, cptl );
3977
3978 ds >> points;
3979 }
3983 ~EMRPOLYBEZIER ( )
3984 {
3985 if ( lpoints ) delete[] lpoints;
3986 }
3990 bool serialize ( DATASTREAM ds )
3991 {
3992 ds << emr << rclBounds << cptl << POINTLARRAY( lpoints, cptl );
3993 return true;
3994 }
3998 int size ( void ) const { return emr.nSize; }
4004 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
4005 {
4006 EMF_UNUSED(source);
4007 // According to the wine windef.h header, POINT and POINTL are equivalent
4008 PolyBezier( dc, (POINT*)lpoints, cptl );
4009 }
4010 #ifdef ENABLE_EDITING
4011
4014 void edit ( void ) const
4015 {
4016 printf( "*POLYBEZIER*\n" );
4017 edit_rectl( "rclBounds", rclBounds );
4018 #if 0
4019 printf( "\tcptl : %ld\n", cptl );
4020 printf( "\taptl->\n" );
4021 for ( unsigned int i = 0; i < cptl; i++ )
4022 printf( "\t\t%ld, %ld\n", lpoints[i].x, lpoints[i].y );
4023 #else
4024 edit_pointlarray( "\t", cptl, lpoints );
4025 #endif
4026 }
4027 #endif /* ENABLE_EDITING */
4028 };
4029
4031
4034 class EMRPOLYBEZIER16 : public METARECORD, ::EMRPOLYBEZIER16 {
4035 POINT16* lpoints;
4036 public:
4042 EMRPOLYBEZIER16 ( const RECTL* bounds, const POINT16* points, INT n )
4043 {
4044 cpts = n;
4045 apts[0].x = 0; // Really unused
4046 apts[0].y = 0;
4047
4048 emr.iType = EMR_POLYBEZIER16;
4049 // The (cptl-1) below is to account for aptl, which isn't written out
4050 emr.nSize = sizeof( ::EMRPOLYBEZIER16 ) + sizeof( POINT16 ) * (cpts-1);
4051
4052 lpoints = new POINT16[cpts];
4053
4054 for (int i=0; i<n; i++) {
4055 lpoints[i].x = points[i].x;
4056 lpoints[i].y = points[i].y;
4057 }
4058
4059 rclBounds = *bounds;
4060 }
4067 EMRPOLYBEZIER16 ( const RECTL* bounds, const POINT* points, INT n )
4068 {
4069 cpts = n;
4070 apts[0].x = 0; // Really unused
4071 apts[0].y = 0;
4072
4073 emr.iType = EMR_POLYBEZIER16;
4074 // The (cptl-1) below is to account for aptl, which isn't written out
4075 emr.nSize = sizeof( ::EMRPOLYBEZIER16 ) + sizeof( POINT16 ) * (cpts-1);
4076
4077 lpoints = new POINT16[cpts];
4078
4079 for (int i=0; i<n; i++) {
4080 lpoints[i].x = points[i].x;
4081 lpoints[i].y = points[i].y;
4082 }
4083
4084 rclBounds = *bounds;
4085 }
4090 EMRPOLYBEZIER16 ( DATASTREAM& ds )
4091 {
4092 ds >> emr >> rclBounds >> cpts;
4093
4094 lpoints = new POINT16[cpts];
4095
4096 POINT16ARRAY points( lpoints, cpts );
4097
4098 ds >> points;
4099 }
4103 ~EMRPOLYBEZIER16 ( )
4104 {
4105 if ( lpoints ) delete[] lpoints;
4106 }
4110 bool serialize ( DATASTREAM ds )
4111 {
4112 ds << emr << rclBounds << cpts << POINT16ARRAY( lpoints, cpts );
4113 return true;
4114 }
4118 int size ( void ) const { return emr.nSize; }
4124 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
4125 {
4126 EMF_UNUSED(source);
4127 // According to the wine windef.h header, POINT and POINTL are equivalent
4128 PolyBezier16( dc, lpoints, cpts );
4129 }
4130 #ifdef ENABLE_EDITING
4131
4134 void edit ( void ) const
4135 {
4136 printf( "*POLYBEZIER16*\n" );
4137 edit_rectl( "rclBounds", rclBounds );
4138 edit_point16array( "\t", cpts, lpoints );
4139 }
4140 #endif /* ENABLE_EDITING */
4141 };
4142
4144
4147 class EMRPOLYBEZIERTO : public METARECORD, ::EMRPOLYBEZIER {
4148 POINTL* lpoints;
4149 public:
4155 EMRPOLYBEZIERTO ( const RECTL* bounds, const POINT* points, INT n )
4156 {
4157 cptl = n;
4158 aptl[0].x = 0; // Really unused
4159 aptl[0].y = 0;
4160
4161 emr.iType = EMR_POLYBEZIERTO;
4162 // The (cptl-1) below is to account for aptl, which isn't written out
4163 emr.nSize = sizeof( ::EMRPOLYBEZIERTO ) + sizeof( POINTL ) * (cptl-1);
4164
4165 lpoints = new POINTL[cptl];
4166
4167 for (int i=0; i<n; i++) {
4168 lpoints[i].x = points[i].x;
4169 lpoints[i].y = points[i].y;
4170 }
4171
4172 rclBounds = *bounds;
4173 }
4178 EMRPOLYBEZIERTO ( DATASTREAM& ds )
4179 {
4180 ds >> emr >> rclBounds >> cptl;
4181
4182 lpoints = new POINTL[cptl];
4183
4184 POINTLARRAY points( lpoints, cptl );
4185
4186 ds >> points;
4187 }
4191 ~EMRPOLYBEZIERTO ( )
4192 {
4193 if ( lpoints ) delete[] lpoints;
4194 }
4198 bool serialize ( DATASTREAM ds )
4199 {
4200 ds << emr << rclBounds << cptl << POINTLARRAY( lpoints, cptl );
4201 return true;
4202 }
4206 int size ( void ) const { return emr.nSize; }
4212 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
4213 {
4214 EMF_UNUSED(source);
4215 // According to the wine windef.h header, POINT and POINTL are equivalent
4216 PolyBezierTo( dc, (POINT*)lpoints, cptl );
4217 }
4218 #ifdef ENABLE_EDITING
4219
4222 void edit ( void ) const
4223 {
4224 printf( "*POLYBEZIERTO*\n" );
4225 edit_rectl( "rclBounds", rclBounds );
4226 #if 0
4227 printf( "\tcptl : %ld\n", cptl );
4228 printf( "\taptl->\n" );
4229 for ( unsigned int i = 0; i < cptl; i++ )
4230 printf( "\t\t%ld, %ld\n", lpoints[i].x, lpoints[i].y );
4231 #else
4232 edit_pointlarray( "\t", cptl, lpoints );
4233 #endif
4234 }
4235 #endif /* ENABLE_EDITING */
4236 };
4237
4239
4242 class EMRPOLYBEZIERTO16 : public METARECORD, ::EMRPOLYBEZIER16 {
4243 POINT16* lpoints;
4244 public:
4250 EMRPOLYBEZIERTO16 ( const RECTL* bounds, const POINT16* points, INT n )
4251 {
4252 cpts = n;
4253 apts[0].x = 0; // Really unused
4254 apts[0].y = 0;
4255
4256 emr.iType = EMR_POLYBEZIERTO16;
4257 // The (cptl-1) below is to account for aptl, which isn't written out
4258 emr.nSize = sizeof( ::EMRPOLYBEZIERTO16 ) + sizeof( POINT16 ) * (cpts-1);
4259
4260 lpoints = new POINT16[cpts];
4261
4262 for (int i=0; i<n; i++) {
4263 lpoints[i].x = points[i].x;
4264 lpoints[i].y = points[i].y;
4265 }
4266
4267 rclBounds = *bounds;
4268 }
4275 EMRPOLYBEZIERTO16 ( const RECTL* bounds, const POINT* points, INT n )
4276 {
4277 cpts = n;
4278 apts[0].x = 0; // Really unused
4279 apts[0].y = 0;
4280
4281 emr.iType = EMR_POLYBEZIERTO16;
4282 // The (cptl-1) below is to account for aptl, which isn't written out
4283 emr.nSize = sizeof( ::EMRPOLYBEZIERTO16 ) + sizeof( POINT16 ) * (cpts-1);
4284
4285 lpoints = new POINT16[cpts];
4286
4287 for (int i=0; i<n; i++) {
4288 lpoints[i].x = points[i].x;
4289 lpoints[i].y = points[i].y;
4290 }
4291
4292 rclBounds = *bounds;
4293 }
4298 EMRPOLYBEZIERTO16 ( DATASTREAM& ds )
4299 {
4300 ds >> emr >> rclBounds >> cpts;
4301
4302 lpoints = new POINT16[cpts];
4303
4304 POINT16ARRAY points( lpoints, cpts );
4305
4306 ds >> points;
4307 }
4311 ~EMRPOLYBEZIERTO16 ( )
4312 {
4313 if ( lpoints ) delete[] lpoints;
4314 }
4318 bool serialize ( DATASTREAM ds )
4319 {
4320 ds << emr << rclBounds << cpts << POINT16ARRAY( lpoints, cpts );
4321 return true;
4322 }
4326 int size ( void ) const { return emr.nSize; }
4332 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
4333 {
4334 EMF_UNUSED(source);
4335 // According to the wine windef.h header, POINT and POINTL are equivalent
4336 PolyBezierTo16( dc, lpoints, cpts );
4337 }
4338 #ifdef ENABLE_EDITING
4339
4342 void edit ( void ) const
4343 {
4344 printf( "*POLYBEZIERTO16*\n" );
4345 edit_rectl( "rclBounds", rclBounds );
4346 edit_point16array( "\t", cpts, lpoints );
4347 }
4348 #endif /* ENABLE_EDITING */
4349 };
4350
4352
4355 class EMRPOLYLINETO : public METARECORD, ::EMRPOLYLINETO {
4356 POINTL* lpoints;
4357 public:
4363 EMRPOLYLINETO ( const RECTL* bounds, const POINT* points, INT n )
4364 {
4365 cptl = n;
4366 aptl[0].x = 0;
4367 aptl[0].y = 0;
4368
4369 emr.iType = EMR_POLYLINETO;
4370 // The (cptl-1) below is to account for aptl, which isn't written out
4371 emr.nSize = sizeof( ::EMRPOLYLINETO ) + sizeof( POINTL ) * (cptl-1);
4372
4373 lpoints = new POINTL[cptl];
4374
4375 for (int i=0; i<n; i++) {
4376 lpoints[i].x = points[i].x;
4377 lpoints[i].y = points[i].y;
4378 }
4379
4380 rclBounds = *bounds;
4381 }
4386 EMRPOLYLINETO ( DATASTREAM& ds )
4387 {
4388 ds >> emr >> rclBounds >> cptl;
4389
4390 lpoints = new POINTL[cptl];
4391
4392 POINTLARRAY points( lpoints, cptl );
4393
4394 ds >> points;
4395 }
4399 ~EMRPOLYLINETO ( )
4400 {
4401 if ( lpoints ) delete[] lpoints;
4402 }
4406 bool serialize ( DATASTREAM ds )
4407 {
4408 ds << emr << rclBounds << cptl << POINTLARRAY( lpoints, cptl );
4409 return true;
4410 }
4414 int size ( void ) const { return emr.nSize; }
4420 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
4421 {
4422 EMF_UNUSED(source);
4423 // According to the wine windef.h header, POINT and POINTL are equivalent
4424 PolylineTo( dc, (POINT*)lpoints, cptl );
4425 }
4426 #ifdef ENABLE_EDITING
4427
4430 void edit ( void ) const
4431 {
4432 printf( "*POLYLINETO*\n" );
4433 edit_rectl( "rclBounds", rclBounds );
4434 #if 0
4435 printf( "\tcptl : %ld\n", cptl );
4436 printf( "\taptl->\n" );
4437 for ( unsigned int i = 0; i < cptl; i++ )
4438 printf( "\t\t%ld, %ld\n", lpoints[i].x, lpoints[i].y );
4439 #else
4440 edit_pointlarray( "\t", cptl, lpoints );
4441 #endif
4442 }
4443 #endif /* ENABLE_EDITING */
4444 };
4445
4447
4450 class EMRPOLYLINETO16 : public METARECORD, ::EMRPOLYLINETO16 {
4451 POINT16* lpoints;
4452 public:
4458 EMRPOLYLINETO16 ( const RECTL* bounds, const POINT16* points, INT n )
4459 {
4460 cpts = n;
4461 apts[0].x = 0;
4462 apts[0].y = 0;
4463
4464 emr.iType = EMR_POLYLINETO16;
4465 // The (cptl-1) below is to account for aptl, which isn't written out
4466 emr.nSize = sizeof( ::EMRPOLYLINETO16 ) + sizeof( POINT16 ) * (cpts-1);
4467
4468 lpoints = new POINT16[cpts];
4469
4470 for (int i=0; i<n; i++) {
4471 lpoints[i].x = points[i].x;
4472 lpoints[i].y = points[i].y;
4473 }
4474
4475 rclBounds = *bounds;
4476 }
4483 EMRPOLYLINETO16 ( const RECTL* bounds, const POINT* points, INT n )
4484 {
4485 cpts = n;
4486 apts[0].x = 0;
4487 apts[0].y = 0;
4488
4489 emr.iType = EMR_POLYLINETO16;
4490 // The (cptl-1) below is to account for aptl, which isn't written out
4491 emr.nSize = sizeof( ::EMRPOLYLINETO16 ) + sizeof( POINT16 ) * (cpts-1);
4492
4493 lpoints = new POINT16[cpts];
4494
4495 for (int i=0; i<n; i++) {
4496 lpoints[i].x = points[i].x;
4497 lpoints[i].y = points[i].y;
4498 }
4499
4500 rclBounds = *bounds;
4501 }
4506 EMRPOLYLINETO16 ( DATASTREAM& ds )
4507 {
4508 ds >> emr >> rclBounds >> cpts;
4509
4510 lpoints = new POINT16[cpts];
4511
4512 POINT16ARRAY points( lpoints, cpts );
4513
4514 ds >> points;
4515 }
4519 ~EMRPOLYLINETO16 ( )
4520 {
4521 if ( lpoints ) delete[] lpoints;
4522 }
4526 bool serialize ( DATASTREAM ds )
4527 {
4528 ds << emr << rclBounds << cpts << POINT16ARRAY( lpoints, cpts );
4529 return true;
4530 }
4534 int size ( void ) const { return emr.nSize; }
4540 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
4541 {
4542 EMF_UNUSED(source);
4543 // According to the wine windef.h header, POINT and POINTL are equivalent
4544 PolylineTo16( dc, lpoints, cpts );
4545 }
4546 #ifdef ENABLE_EDITING
4547
4550 void edit ( void ) const
4551 {
4552 printf( "*POLYLINETO16*\n" );
4553 edit_rectl( "rclBounds", rclBounds );
4554 edit_point16array( "\t", cpts, lpoints );
4555 }
4556 #endif /* ENABLE_EDITING */
4557 };
4558
4560
4565 class EMREXTTEXTOUTA : public METARECORD, ::EMREXTTEXTOUTA {
4566 PSTR string_a;
4567 int string_size;
4568
4569 INT* dx_i;
4570 public:
4580 EMREXTTEXTOUTA ( const RECTL* bounds, DWORD graphicsMode, FLOAT xScale,
4581 FLOAT yScale, const PEMRTEXT text, LPCSTR string,
4582 const INT* dx )
4583 {
4584 emr.iType = EMR_EXTTEXTOUTA;
4585 emr.nSize = sizeof( ::EMREXTTEXTOUTA );
4586
4587 rclBounds = *bounds;
4588
4589 iGraphicsMode = graphicsMode;
4590 exScale = xScale;
4591 eyScale = yScale;
4592
4593 emrtext = *text;
4594
4595 string_size = ROUND_TO_LONG( emrtext.nChars );
4596
4597 string_a = new CHAR[ string_size ];
4598
4599 memset( string_a, 0, sizeof(CHAR) * string_size );
4600
4601 for ( unsigned int i=0; i<emrtext.nChars; i++ )
4602 string_a[i] = *string++;
4603
4604 emrtext.offString = emr.nSize;
4605 emr.nSize += string_size * sizeof(CHAR);
4606 #if 0
4607 /*
4608 Test only - Problem: Windows requires this dx to be set - at least from 2K on
4609 but to calculate real dx values is hard
4610 For pstoedit - this is "fixed" now by estimating dx in pstoedit
4611 */
4612 if ( !dx ) {
4613 int * dxn = new int [string_size];
4614 for (unsigned int i=0; i < string_size; i++) dxn[i] = 10;
4615 dx = dxn;
4616 }
4617 #endif
4618
4619 if ( dx ) {
4620
4621 dx_i = new INT[ emrtext.nChars ];
4622
4623 for ( unsigned int i=0; i<emrtext.nChars; i++ )
4624 dx_i[i] = *dx++;
4625
4626 emrtext.offDx = emr.nSize;
4627 emr.nSize += emrtext.nChars * sizeof(INT);
4628 }
4629 else {
4630 emrtext.offDx = 0;
4631 dx_i = 0;
4632 }
4633 }
4638 EMREXTTEXTOUTA ( DATASTREAM& ds )
4639 {
4640 ds >> emr >> rclBounds >> iGraphicsMode >> exScale >> eyScale >> emrtext;
4641
4642 if ( emrtext.offString != 0 ) {
4643 string_size = ROUND_TO_LONG( emrtext.nChars );
4644
4645 string_a = new CHAR[ string_size ];
4646
4647 memset( string_a, 0, sizeof(CHAR) * string_size );
4648
4649 CHARSTR string( string_a, string_size );
4650
4651 ds >> string;
4652 }
4653 else
4654 string_a = 0;
4655
4656 if ( emrtext.offDx ) {
4657 dx_i = new INT[ emrtext.nChars ];
4658
4659 INTARRAY dx_is( dx_i, emrtext.nChars );
4660
4661 ds >> dx_is;
4662 }
4663 else
4664 dx_i = 0;
4665 }
4670 ~EMREXTTEXTOUTA ( )
4671 {
4672 if ( string_a ) delete[] string_a;
4673 if ( dx_i ) delete[] dx_i;
4674 }
4678 bool serialize ( DATASTREAM ds )
4679 {
4680 ds << emr << rclBounds << iGraphicsMode << exScale << eyScale
4681 << emrtext << CHARSTR( string_a, string_size );
4682 if ( dx_i )
4683 ds << INTARRAY( dx_i, emrtext.nChars );
4684 return true;
4685 }
4689 int size ( void ) const { return emr.nSize; }
4695 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
4696 {
4697 EMF_UNUSED(source);
4698 RECT rect;
4699 rect.left = emrtext.rcl.left;
4700 rect.top = emrtext.rcl.top;
4701 rect.right = emrtext.rcl.right;
4702 rect.bottom = emrtext.rcl.bottom;
4703
4704 ExtTextOutA( dc, emrtext.ptlReference.x, emrtext.ptlReference.y,
4705 emrtext.fOptions, &rect, string_a, emrtext.nChars,
4706 dx_i );
4707 }
4708 #ifdef ENABLE_EDITING
4709
4712 void edit ( void ) const
4713 {
4714 #if defined(__LP64__)
4715 const char* FMT0 = "unknown(%d)\n";
4716 const char* FMT1 = "\tptlReference\t: (%d,%d)\n";
4717 const char* FMT2 = "\tnChars\t\t: %d\n";
4718 const char* FMT3 = "\toffString\t: %d\n";
4719 const char* FMT4 = "\toffDx\t\t: %d\n";
4720 #else
4721 const char* FMT0 = "unknown(%ld)\n";
4722 const char* FMT1 = "\tptlReference\t: (%ld,%ld)\n";
4723 const char* FMT2 = "\tnChars\t\t: %ld\n";
4724 const char* FMT3 = "\toffString\t: %ld\n";
4725 const char* FMT4 = "\toffDx\t\t: %ld\n";
4726 #endif /* __x86_64__ */
4727 printf( "*EXTTEXTOUTA*\n" );
4728 edit_rectl( "rclBounds", rclBounds );
4729 printf( "\tiGraphicsMode\t: " );
4730 switch ( iGraphicsMode ) {
4731 case GM_COMPATIBLE: printf( "GM_COMPATIBLE\n" ); break;
4732 case GM_ADVANCED: printf( "GM_ADVANCED\n" ); break;
4733 default: printf( FMT0, iGraphicsMode );
4734 }
4735 printf( "\texScale\t\t: %f\n", exScale );
4736 printf( "\teyScale\t\t: %f\n", eyScale );
4737 printf( FMT1, emrtext.ptlReference.x, emrtext.ptlReference.y );
4738 printf( FMT2, emrtext.nChars );
4739 printf( FMT3, emrtext.offString );
4740 printf( "\tfOptions\t: " );
4741 if ( emrtext.fOptions == 0 )
4742 printf( "None" );
4743 else {
4744 if ( emrtext.fOptions & ETO_GRAYED ) {
4745 printf( "ETO_GRAYED" );
4746 if ( emrtext.fOptions & ~ETO_GRAYED )
4747 printf( " | " );
4748 }
4749 if ( emrtext.fOptions & ETO_OPAQUE ) {
4750 printf( "ETO_OPAQUE" );
4751 if ( emrtext.fOptions & ~(ETO_GRAYED | ETO_OPAQUE) )
4752 printf( " | " );
4753 }
4754 if ( emrtext.fOptions & ETO_CLIPPED ) {
4755 printf( "ETO_CLIPPED" );
4756 if ( emrtext.fOptions & ~(ETO_GRAYED | ETO_OPAQUE | ETO_CLIPPED ) )
4757 printf( " | " );
4758 }
4759 if ( emrtext.fOptions & ETO_GLYPH_INDEX ) {
4760 printf( "ETO_GLYPH_INDEX" );
4761 if ( emrtext.fOptions &
4762 ~(ETO_GRAYED | ETO_OPAQUE | ETO_CLIPPED | ETO_GLYPH_INDEX) )
4763 printf( " | " );
4764 }
4765 if ( emrtext.fOptions & ETO_RTLREADING ) {
4766 printf( "ETO_RTLREADING" );
4767 if ( emrtext.fOptions &
4768 ~(ETO_GRAYED | ETO_OPAQUE | ETO_CLIPPED | ETO_GLYPH_INDEX |
4769 ETO_RTLREADING) )
4770 printf( " | " );
4771 }
4772 if ( emrtext.fOptions & ETO_IGNORELANGUAGE )
4773 printf( "ETO_IGNORELANGUAGE" );
4774 }
4775 printf( "\n" );
4776 edit_rectl( "rcl\t", emrtext.rcl );
4777 printf( FMT4, emrtext.offDx );
4778 printf( "\tString:\n\t\t%s\n", string_a );
4779
4780 if ( emrtext.offDx != 0 ) {
4781 printf( "\tOffsets:\n\t\t" );
4782 for ( unsigned int i = 0; i < emrtext.nChars; i++ )
4783 printf( "%d ", dx_i[i] );
4784 printf( "\n" );
4785 }
4786 }
4787 #endif /* ENABLE_EDITING */
4788 };
4790
4795 class EMREXTTEXTOUTW : public METARECORD, ::EMREXTTEXTOUTW {
4796 PWSTR string_a;
4797 int string_size;
4798
4799 INT* dx_i;
4800 public:
4810 EMREXTTEXTOUTW ( const RECTL* bounds, DWORD graphicsMode, FLOAT xScale,
4811 FLOAT yScale, const PEMRTEXT text, LPCWSTR string,
4812 const INT* dx )
4813 {
4814 emr.iType = EMR_EXTTEXTOUTW;
4815 emr.nSize = sizeof( ::EMREXTTEXTOUTW );
4816
4817 rclBounds = *bounds;
4818
4819 iGraphicsMode = graphicsMode;
4820 exScale = xScale;
4821 eyScale = yScale;
4822
4823 emrtext = *text;
4824
4825 string_size = ROUND_TO_LONG( emrtext.nChars );
4826
4827 string_a = new WCHAR[ string_size ];
4828
4829 memset( string_a, 0, sizeof(WCHAR) * string_size );
4830
4831 for ( unsigned int i=0; i<emrtext.nChars; i++ )
4832 string_a[i] = *string++;
4833
4834 emrtext.offString = emr.nSize;
4835 emr.nSize += string_size * sizeof(WCHAR);
4836 #if 0
4837 /*
4838 Test only - Problem: Windows requires this dx to be set - at least from 2K on
4839 but to calculate real dx values is hard
4840 For pstoedit - this is "fixed" now by estimating dx in pstoedit
4841 */
4842 if ( !dx ) {
4843 int * dxn = new int [string_size];
4844 for (unsigned int i=0; i < string_size; i++) dxn[i] = 10;
4845 dx = dxn;
4846 }
4847 #endif
4848
4849 if ( dx ) {
4850
4851 dx_i = new INT[ emrtext.nChars ];
4852
4853 for ( unsigned int i=0; i<emrtext.nChars; i++ )
4854 dx_i[i] = *dx++;
4855
4856 emrtext.offDx = emr.nSize;
4857 emr.nSize += emrtext.nChars * sizeof(INT);
4858 }
4859 else {
4860 emrtext.offDx = 0;
4861 dx_i = 0;
4862 }
4863 }
4868 EMREXTTEXTOUTW ( DATASTREAM& ds )
4869 {
4870 ds >> emr >> rclBounds >> iGraphicsMode >> exScale >> eyScale >> emrtext;
4871
4872 if ( emrtext.offString != 0 ) {
4873 string_size = ROUND_TO_LONG( emrtext.nChars );
4874
4875 string_a = new WCHAR[ string_size ];
4876
4877 memset( string_a, 0, sizeof(WCHAR) * string_size );
4878
4879 WCHARSTR string( string_a, string_size );
4880
4881 ds >> string;
4882 }
4883 else
4884 string_a = 0;
4885
4886 if ( emrtext.offDx ) {
4887 dx_i = new INT[ emrtext.nChars ];
4888
4889 INTARRAY dx_is( dx_i, emrtext.nChars );
4890
4891 ds >> dx_is;
4892 }
4893 else
4894 dx_i = 0;
4895 }
4900 ~EMREXTTEXTOUTW ( )
4901 {
4902 if ( string_a ) delete[] string_a;
4903 if ( dx_i ) delete[] dx_i;
4904 }
4908 bool serialize ( DATASTREAM ds )
4909 {
4910 ds << emr << rclBounds << iGraphicsMode << exScale << eyScale
4911 << emrtext << WCHARSTR( string_a, string_size );
4912 if ( dx_i )
4913 ds << INTARRAY( dx_i, emrtext.nChars );
4914 return true;
4915 }
4919 int size ( void ) const { return emr.nSize; }
4925 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
4926 {
4927 EMF_UNUSED(source);
4928 RECT rect;
4929 rect.left = emrtext.rcl.left;
4930 rect.top = emrtext.rcl.top;
4931 rect.right = emrtext.rcl.right;
4932 rect.bottom = emrtext.rcl.bottom;
4933
4934 ExtTextOutW( dc, emrtext.ptlReference.x, emrtext.ptlReference.y,
4935 emrtext.fOptions, &rect, string_a, emrtext.nChars,
4936 dx_i );
4937 }
4938 #ifdef ENABLE_EDITING
4939
4942 void edit ( void ) const
4943 {
4944 #if defined(__LP64__)
4945 const char* FMT0 = "unknown(%d)\n";
4946 const char* FMT1 = "\tptlReference\t: (%d,%d)\n";
4947 const char* FMT2 = "\tnChars\t\t: %d\n";
4948 const char* FMT3 = "\toffString\t: %d\n";
4949 const char* FMT4 = "\toffDx\t\t: %d\n";
4950 #else
4951 const char* FMT0 = "unknown(%ld)\n";
4952 const char* FMT1 = "\tptlReference\t: (%ld,%ld)\n";
4953 const char* FMT2 = "\tnChars\t\t: %ld\n";
4954 const char* FMT3 = "\toffString\t: %ld\n";
4955 const char* FMT4 = "\toffDx\t\t: %ld\n";
4956 #endif /* __x86_64__ */
4957 printf( "*EXTTEXTOUTA*\n" );
4958 edit_rectl( "rclBounds", rclBounds );
4959 printf( "\tiGraphicsMode\t: " );
4960 switch ( iGraphicsMode ) {
4961 case GM_COMPATIBLE: printf( "GM_COMPATIBLE\n" ); break;
4962 case GM_ADVANCED: printf( "GM_ADVANCED\n" ); break;
4963 default: printf( FMT0, iGraphicsMode );
4964 }
4965 printf( "\texScale\t\t: %f\n", exScale );
4966 printf( "\teyScale\t\t: %f\n", eyScale );
4967 printf( FMT1, emrtext.ptlReference.x, emrtext.ptlReference.y );
4968 printf( FMT2, emrtext.nChars );
4969 printf( FMT3, emrtext.offString );
4970 printf( "\tfOptions\t: " );
4971 if ( emrtext.fOptions == 0 )
4972 printf( "None" );
4973 else {
4974 if ( emrtext.fOptions & ETO_GRAYED ) {
4975 printf( "ETO_GRAYED" );
4976 if ( emrtext.fOptions & ~ETO_GRAYED )
4977 printf( " | " );
4978 }
4979 if ( emrtext.fOptions & ETO_OPAQUE ) {
4980 printf( "ETO_OPAQUE" );
4981 if ( emrtext.fOptions & ~(ETO_GRAYED | ETO_OPAQUE) )
4982 printf( " | " );
4983 }
4984 if ( emrtext.fOptions & ETO_CLIPPED ) {
4985 printf( "ETO_CLIPPED" );
4986 if ( emrtext.fOptions & ~(ETO_GRAYED | ETO_OPAQUE | ETO_CLIPPED ) )
4987 printf( " | " );
4988 }
4989 if ( emrtext.fOptions & ETO_GLYPH_INDEX ) {
4990 printf( "ETO_GLYPH_INDEX" );
4991 if ( emrtext.fOptions &
4992 ~(ETO_GRAYED | ETO_OPAQUE | ETO_CLIPPED | ETO_GLYPH_INDEX) )
4993 printf( " | " );
4994 }
4995 if ( emrtext.fOptions & ETO_RTLREADING ) {
4996 printf( "ETO_RTLREADING" );
4997 if ( emrtext.fOptions &
4998 ~(ETO_GRAYED | ETO_OPAQUE | ETO_CLIPPED | ETO_GLYPH_INDEX |
4999 ETO_RTLREADING) )
5000 printf( " | " );
5001 }
5002 if ( emrtext.fOptions & ETO_IGNORELANGUAGE )
5003 printf( "ETO_IGNORELANGUAGE" );
5004 }
5005 printf( "\n" );
5006 edit_rectl( "rcl\t", emrtext.rcl );
5007 printf( FMT4, emrtext.offDx );
5008 #if 0
5009 printf( "\tString:\n\t\t%s\n", string_a );
5010 #else
5011 {
5012 // iconv_open arguments are TO, FROM (not the other way around).
5013 iconv_t cvt = iconv_open( "UTF-8", "UTF-16LE" );
5014 std::vector<char> utf8_buffer( emrtext.nChars );
5015 // Cannot predict the space necessary to hold the converted
5016 // string. So, we loop until conversion is complete.
5017 size_t size = emrtext.nChars * sizeof(*string_a);
5018 size_t in_bytes_left = size;
5019 size_t converted = 0;
5020 char* in_buffer = (char*)string_a;
5021 while ( 1 ) {
5022 char* out_buffer = &utf8_buffer[converted];
5023 size_t out_bytes_left = size - converted;
5024
5025 size_t n = iconv( cvt, &in_buffer, &in_bytes_left,
5026 &out_buffer, &out_bytes_left );
5027
5028 converted = size - out_bytes_left;
5029
5030 if ( n == (size_t)-1 ) {
5031 if ( errno == E2BIG ) {
5032 size_t new_size = 2 * utf8_buffer.size();
5033 utf8_buffer.resize( new_size );
5034 size = utf8_buffer.size();
5035 }
5036 else {
5037 // Real conversion error.
5038 break;
5039 }
5040 }
5041 else {
5042 break;
5043 }
5044 }
5045
5046 iconv_close( cvt );
5047
5048 if ( converted == utf8_buffer.size() )
5049 utf8_buffer.push_back( '\0' );
5050 else
5051 utf8_buffer[converted] = '\0';
5052
5053 printf( "\tString:\n\t\t%s\n", &utf8_buffer[0] );
5054 }
5055 #endif
5056 if ( emrtext.offDx != 0 ) {
5057 printf( "\tOffsets:\n\t\t" );
5058 for ( unsigned int i = 0; i < emrtext.nChars; i++ )
5059 printf( "%d ", dx_i[i] );
5060 printf( "\n" );
5061 }
5062 }
5063 #endif /* ENABLE_EDITING */
5064 };
5065
5067
5070 class EMRSETPIXELV : public METARECORD, ::EMRSETPIXELV {
5071 public:
5077 EMRSETPIXELV ( INT x, INT y, COLORREF color )
5078 {
5079 emr.iType = EMR_SETPIXELV;
5080 emr.nSize = sizeof( ::EMRSETPIXELV );
5081 ptlPixel.x = x;
5082 ptlPixel.y = y;
5083 crColor = color;
5084 }
5089 EMRSETPIXELV ( DATASTREAM& ds )
5090 {
5091 ds >> emr >> ptlPixel >> crColor;
5092 }
5096 bool serialize ( DATASTREAM ds )
5097 {
5098 ds << emr << ptlPixel << crColor;
5099 return true;
5100 }
5104 int size ( void ) const { return emr.nSize; }
5110 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
5111 {
5112 EMF_UNUSED(source);
5113 SetPixel( dc, ptlPixel.x, ptlPixel.y, crColor );
5114 }
5115 #ifdef ENABLE_EDITING
5116
5119 void edit ( void ) const
5120 {
5121 printf( "*SETPIXELV*\n" );
5122 edit_pointl( "ptlPixel", ptlPixel );
5123 edit_color( "crColor\t", crColor );
5124 }
5125 #endif /* ENABLE_EDITING */
5126 };
5127
5128 class PEN;
5129 class EXTPEN;
5130 class BRUSH;
5131 class FONT;
5132 class PALETTE;
5133
5135
5138 class EMRCREATEPEN : public METARECORD, public ::EMRCREATEPEN
5139 {
5140 public:
5145 EMRCREATEPEN ( PEN* pen, HGDIOBJ handle );
5150 EMRCREATEPEN ( DATASTREAM& ds );
5154 bool serialize ( DATASTREAM ds )
5155 {
5156 ds << emr << ihPen << lopn;
5157 return true;
5158 }
5162 int size ( void ) const { return emr.nSize; }
5168 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const;
5169 #ifdef ENABLE_EDITING
5170
5173 void edit ( void ) const
5174 {
5175 #if defined(__LP64__)
5176 const char* FMT0 = "\tihPen\t\t: 0x%x\n";
5177 const char* FMT1 = "\tlopn.lopnWidth\t: %d, %d\n";
5178 #else
5179 const char* FMT0 = "\tihPen\t\t: 0x%lx\n";
5180 const char* FMT1 = "\tlopn.lopnWidth\t: %ld, %ld\n";
5181 #endif /* __x86_64__ */
5182 printf( "*CREATEPEN*\n" );
5183 printf( FMT0, ihPen );
5184 edit_pen_style( "lopn.lopnStyle", lopn.lopnStyle );
5185 printf( FMT1, lopn.lopnWidth.x, lopn.lopnWidth.y );
5186 edit_color( "lopn.lopnColor", lopn.lopnColor );
5187 }
5188 #endif /* ENABLE_EDITING */
5189 };
5190
5192
5196 class EMREXTCREATEPEN : public METARECORD, public ::EMREXTCREATEPEN
5197 {
5198 public:
5203 EMREXTCREATEPEN ( EXTPEN* pen, HGDIOBJ handle );
5208 EMREXTCREATEPEN ( DATASTREAM& ds );
5212 bool serialize ( DATASTREAM ds )
5213 {
5214 ds << emr << ihPen << offBmi << cbBmi << offBits << cbBits << elp;
5215 return true;
5216 }
5220 int size ( void ) const { return emr.nSize; }
5226 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const;
5227 #ifdef ENABLE_EDITING
5228
5231 void edit ( void ) const
5232 {
5233 #if defined(__LP64__)
5234 const char* FMT0 = "\tihPen\t\t\t: 0x%x\n";
5235 const char* FMT1 = "\toffBmi\t\t\t: %d\n";
5236 const char* FMT2 = "\tcbBmi\t\t\t: %d\n";
5237 const char* FMT3 = "\toffBits\t\t\t: %d\n";
5238 const char* FMT4 = "\tcbBits\t\t\t: %d\n";
5239 const char* FMT5 = "\telp.elpWidth\t\t: %d\n";
5240 const char* FMT6 = "\telp.elpNumEntries\t: %d\n";
5241 #else
5242 const char* FMT0 = "\tihPen\t\t\t: 0x%lx\n";
5243 const char* FMT1 = "\toffBmi\t\t\t: %ld\n";
5244 const char* FMT2 = "\tcbBmi\t\t\t: %ld\n";
5245 const char* FMT3 = "\toffBits\t\t\t: %ld\n";
5246 const char* FMT4 = "\tcbBits\t\t\t: %ld\n";
5247 const char* FMT5 = "\telp.elpWidth\t\t: %ld\n";
5248 const char* FMT6 = "\telp.elpNumEntries\t: %ld\n";
5249 #endif /* __x86_64__ */
5250 printf( "*EXTCREATEPEN*\n" );
5251 printf( FMT0, ihPen );
5252 printf( FMT1, offBmi );
5253 printf( FMT2, cbBmi );
5254 printf( FMT3, offBits );
5255 printf( FMT4, cbBits );
5256 edit_pen_style( "elp.elpPenStyle\t", elp.elpPenStyle );
5257 printf( FMT5, elp.elpWidth );
5258 edit_brush_style( "elp.elpBrushStyle", elp.elpBrushStyle );
5259 edit_color( "elp.elpColor\t", elp.elpColor );
5260 edit_brush_hatch( "elp.elpHatch\t", elp.elpHatch );
5261 printf( FMT6, elp.elpNumEntries );
5262 }
5263 #endif /* ENABLE_EDITING */
5264 };
5265
5267
5270 class EMRCREATEBRUSHINDIRECT : public METARECORD, public ::EMRCREATEBRUSHINDIRECT
5271 {
5272 public:
5277 EMRCREATEBRUSHINDIRECT ( BRUSH* brush, HGDIOBJ handle );
5282 EMRCREATEBRUSHINDIRECT ( DATASTREAM& ds );
5286 bool serialize ( DATASTREAM ds )
5287 {
5288 ds << emr << ihBrush << lb;
5289 return true;
5290 }
5294 int size ( void ) const { return emr.nSize; }
5300 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const;
5301 #ifdef ENABLE_EDITING
5302
5305 void edit ( void ) const
5306 {
5307 #if defined(__LP64__)
5308 const char* FMT = "\tihBrush\t\t: 0x%x\n";
5309 #else
5310 const char* FMT = "\tihBrush\t\t: 0x%lx\n";
5311 #endif /* __x86_64__ */
5312 printf( "*CREATEBRUSHINDIRECT*\n" );
5313 printf( FMT, ihBrush );
5314 edit_brush_style( "lb.lbStyle", lb.lbStyle );
5315 edit_color( "lb.lbColor", lb.lbColor );
5316 edit_brush_hatch( "lb.lbHatch", lb.lbHatch );
5317 }
5318 #endif /* ENABLE_EDITING */
5319 };
5320
5322
5325 class EMREXTCREATEFONTINDIRECTW : public METARECORD, public ::EMREXTCREATEFONTINDIRECTW
5326 {
5327 public:
5332 EMREXTCREATEFONTINDIRECTW ( FONT* font, HGDIOBJ handle );
5337 EMREXTCREATEFONTINDIRECTW ( DATASTREAM& ds );
5341 bool serialize ( DATASTREAM ds )
5342 {
5343 // Since EMF records have to be multiples of 4 bytes, this
5344 // should perhaps be a general thing, but we know it's currently
5345 // only a problem for this structure.
5346
5347 ds << emr << ihFont << elfw << PADDING( 2 );
5348
5349 return true;
5350 }
5354 int size ( void ) const { return emr.nSize; }
5360 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const;
5361 #ifdef ENABLE_EDITING
5362
5365 void edit ( void ) const
5366 {
5367 #if defined(__LP64__)
5368 const char* FMT0 = "\tihFont\t\t\t: %d\n";
5369 const char* FMT1 = "\tlfHeight\t\t: %d\n";
5370 const char* FMT2 = "\tlfWidth\t\t\t: %d\n";
5371 const char* FMT3 = "\tlfEscapement\t\t: %d\n";
5372 const char* FMT4 = "\tlfOrientation\t\t: %d\n";
5373 const char* FMT5 = "\telfVersion\t\t: %d\n";
5374 const char* FMT6 = "\telfStyleSize\t\t: %d\n";
5375 const char* FMT7 = "\telfMatch\t\t: %d\n";
5376 const char* FMT8 = "\telfCulture\t\t: %d\n";
5377 #else
5378 const char* FMT0 = "\tihFont\t\t\t: %ld\n";
5379 const char* FMT1 = "\tlfHeight\t\t: %ld\n";
5380 const char* FMT2 = "\tlfWidth\t\t\t: %ld\n";
5381 const char* FMT3 = "\tlfEscapement\t\t: %ld\n";
5382 const char* FMT4 = "\tlfOrientation\t\t: %ld\n";
5383 const char* FMT5 = "\telfVersion\t\t: %ld\n";
5384 const char* FMT6 = "\telfStyleSize\t\t: %ld\n";
5385 const char* FMT7 = "\telfMatch\t\t: %ld\n";
5386 const char* FMT8 = "\telfCulture\t\t: %ld\n";
5387 #endif /* __x86_64__ */
5388 printf( "*EXTCREATEFONTINDIRECTW*\n" );
5389 printf( FMT0, ihFont );
5390 printf( FMT1, elfw.elfLogFont.lfHeight );
5391 printf( FMT2, elfw.elfLogFont.lfWidth );
5392 printf( FMT3, elfw.elfLogFont.lfEscapement );
5393 printf( FMT4, elfw.elfLogFont.lfOrientation );
5394 printf( "\tlfWeight\t\t: " );
5395 switch ( elfw.elfLogFont.lfWeight ) {
5396 case FW_DONTCARE: printf( "FW_DONTCARE\n" ); break;
5397 case FW_THIN: printf( "FW_THIN\n" ); break;
5398 case FW_EXTRALIGHT: printf( "FW_EXTRALIGHT\n" ); break;
5399 case FW_LIGHT: printf( "FW_LIGHT\n" ); break;
5400 case FW_NORMAL: printf( "FW_NORMAL\n" ); break;
5401 case FW_MEDIUM: printf( "FW_MEDIUM\n" ); break;
5402 case FW_SEMIBOLD: printf( "FW_SEMIBOLD\n" ); break;
5403 case FW_BOLD: printf( "FW_BOLD\n" ); break;
5404 case FW_EXTRABOLD: printf( "FW_EXTRABOLD\n" ); break;
5405 case FW_BLACK: printf( "FW_BLACK\n" ); break;
5406 }
5407 printf( "\tlfItalic\t\t: %d\n", elfw.elfLogFont.lfItalic );
5408 printf( "\tlfUnderline\t\t: %d\n", elfw.elfLogFont.lfUnderline );
5409 printf( "\tlfStrikeOut\t\t: %d\n", elfw.elfLogFont.lfStrikeOut );
5410 printf( "\tlfCharSet\t\t: %d\n", elfw.elfLogFont.lfCharSet );
5411 printf( "\tlfOutPrecision\t\t: %d\n", elfw.elfLogFont.lfOutPrecision );
5412 printf( "\tlfClipPrecision\t\t: %d\n", elfw.elfLogFont.lfClipPrecision );
5413 printf( "\tlfQuality\t\t: %d\n", elfw.elfLogFont.lfQuality );
5414 printf( "\tlfPitchAndFamily\t: %d\n", elfw.elfLogFont.lfPitchAndFamily );
5415 int i = 0;
5416 printf( "\tlfFaceName\t\t: '" );
5417 while ( elfw.elfLogFont.lfFaceName[i] != 0 && i < LF_FACESIZE ) {
5418 putchar( elfw.elfLogFont.lfFaceName[i] );
5419 i++;
5420 }
5421 puts( "'" );
5422
5423 i = 0;
5424 printf( "\telfFullName\t\t: '" );
5425 while ( elfw.elfFullName[i] != 0 && i < LF_FULLFACESIZE ) {
5426 putchar( elfw.elfFullName[i] );
5427 i++;
5428 }
5429 puts( "'" );
5430
5431 i = 0;
5432 printf( "\telfStyle\t\t: '" );
5433 while ( elfw.elfStyle[i] != 0 && i < LF_FACESIZE ) {
5434 putchar( elfw.elfStyle[i] );
5435 i++;
5436 }
5437 puts( "'" );
5438
5439 printf( FMT5, elfw.elfVersion );
5440 printf( FMT6, elfw.elfStyleSize );
5441 printf( FMT7, elfw.elfMatch );
5442 printf( "\telfVendorId\t\t: '%s'\n", elfw.elfVendorId );
5443 printf( FMT8, elfw.elfCulture );
5444 printf( "\telfPanose\t\t:\n" );
5445 printf( "\t\tbFamilyType\t\t: %d\n", elfw.elfPanose.bFamilyType );
5446 printf( "\t\tbSerifStyle\t\t: %d\n", elfw.elfPanose.bSerifStyle );
5447 printf( "\t\tbWeight\t\t\t: %d\n", elfw.elfPanose.bWeight );
5448 printf( "\t\tbProportion\t\t: %d\n", elfw.elfPanose.bProportion );
5449 printf( "\t\tbContrast\t\t: %d\n", elfw.elfPanose.bContrast );
5450 printf( "\t\tbStrokeVariation\t: %d\n", elfw.elfPanose.bStrokeVariation );
5451 printf( "\t\tbArmStyle\t\t: %d\n", elfw.elfPanose.bArmStyle );
5452 printf( "\t\tbLetterform\t\t: %d\n", elfw.elfPanose.bLetterform );
5453 printf( "\t\tbMidline\t\t: %d\n", elfw.elfPanose.bMidline );
5454 printf( "\t\tbXHeight\t\t: %d\n", elfw.elfPanose.bXHeight );
5455 }
5456 #endif /* ENABLE_EDITING */
5457 };
5458
5460
5463 class EMRCREATEPALETTE : public METARECORD, public ::EMRCREATEPALETTE
5464 {
5465 public:
5470 EMRCREATEPALETTE ( PALETTE* palette, HGDIOBJ handle );
5475 EMRCREATEPALETTE ( DATASTREAM& ds );
5479 bool serialize ( DATASTREAM ds )
5480 {
5481 ds << emr << ihPal << lgpl;
5482 return true;
5483 }
5487 int size ( void ) const { return emr.nSize; }
5493 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const;
5494 #ifdef ENABLE_EDITING
5495
5498 void edit ( void ) const
5499 {
5500 printf( "*CREATEPALETTE* (not really handled by libEMF)\n" );
5501 }
5502 #endif /* ENABLE_EDITING */
5503 };
5504
5506
5509 class EMRFILLPATH : public METARECORD, ::EMRFILLPATH {
5510 public:
5514 EMRFILLPATH ( const RECTL* bounds )
5515 {
5516 emr.iType = EMR_FILLPATH;
5517 emr.nSize = sizeof( ::EMRFILLPATH );
5518 rclBounds = *bounds;
5519 }
5524 EMRFILLPATH ( DATASTREAM& ds )
5525 {
5526 ds >> emr >> rclBounds;
5527 }
5531 bool serialize ( DATASTREAM ds )
5532 {
5533 ds << emr << rclBounds;
5534 return true;
5535 }
5539 int size ( void ) const { return emr.nSize; }
5545 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
5546 {
5547 EMF_UNUSED(source);
5548 FillPath( dc );
5549 }
5550 #ifdef ENABLE_EDITING
5551
5554 void edit ( void ) const
5555 {
5556 printf( "*FILLPATH*\n" );
5557 edit_rectl( "rclBounds", rclBounds );
5558 }
5559 #endif /* ENABLE_EDITING */
5560 };
5562
5565 class EMRSTROKEPATH : public METARECORD, ::EMRSTROKEPATH {
5566 public:
5570 EMRSTROKEPATH ( const RECTL* bounds )
5571 {
5572 emr.iType = EMR_STROKEPATH;
5573 emr.nSize = sizeof( ::EMRSTROKEPATH );
5574 rclBounds = *bounds;
5575 }
5580 EMRSTROKEPATH ( DATASTREAM& ds )
5581 {
5582 ds >> emr >> rclBounds;
5583 }
5587 bool serialize ( DATASTREAM ds )
5588 {
5589 ds << emr << rclBounds;
5590 return true;
5591 }
5595 int size ( void ) const { return emr.nSize; }
5601 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
5602 {
5603 EMF_UNUSED(source);
5604 StrokePath( dc );
5605 }
5606 #ifdef ENABLE_EDITING
5607
5610 void edit ( void ) const
5611 {
5612 printf( "*STROKEPATH*\n" );
5613 edit_rectl( "rclBounds", rclBounds );
5614 }
5615 #endif /* ENABLE_EDITING */
5616 };
5618
5621 class EMRSTROKEANDFILLPATH : public METARECORD, ::EMRSTROKEANDFILLPATH {
5622 public:
5626 EMRSTROKEANDFILLPATH ( const RECTL* bounds )
5627 {
5628 emr.iType = EMR_STROKEANDFILLPATH;
5629 emr.nSize = sizeof( ::EMRSTROKEANDFILLPATH );
5630 rclBounds = *bounds;
5631 }
5636 EMRSTROKEANDFILLPATH ( DATASTREAM& ds )
5637 {
5638 ds >> emr >> rclBounds;
5639 }
5643 bool serialize ( DATASTREAM ds )
5644 {
5645 ds << emr << rclBounds;
5646 return true;
5647 }
5651 int size ( void ) const { return emr.nSize; }
5657 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
5658 {
5659 EMF_UNUSED(source);
5660 StrokeAndFillPath( dc );
5661 }
5662 #ifdef ENABLE_EDITING
5663
5666 void edit ( void ) const
5667 {
5668 printf( "*STROKEANDFILLPATH*\n" );
5669 edit_rectl( "rclBounds", rclBounds );
5670 }
5671 #endif /* ENABLE_EDITING */
5672 };
5674
5677 class EMRBEGINPATH : public METARECORD, ::EMRBEGINPATH {
5678 public:
5682 EMRBEGINPATH ( void )
5683 {
5684 emr.iType = EMR_BEGINPATH;
5685 emr.nSize = sizeof( ::EMRBEGINPATH );
5686 }
5691 EMRBEGINPATH ( DATASTREAM& ds )
5692 {
5693 ds >> emr;
5694 }
5698 bool serialize ( DATASTREAM ds )
5699 {
5700 ds << emr;
5701 return true;
5702 }
5706 int size ( void ) const { return emr.nSize; }
5712 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
5713 {
5714 EMF_UNUSED(source);
5715 BeginPath( dc );
5716 }
5717 #ifdef ENABLE_EDITING
5718
5721 void edit ( void ) const
5722 {
5723 printf( "*BEGINPATH*\n" );
5724 }
5725 #endif /* ENABLE_EDITING */
5726 };
5728
5731 class EMRENDPATH : public METARECORD, ::EMRENDPATH {
5732 public:
5736 EMRENDPATH ( void )
5737 {
5738 emr.iType = EMR_ENDPATH;
5739 emr.nSize = sizeof( ::EMRENDPATH );
5740 }
5745 EMRENDPATH ( DATASTREAM& ds )
5746 {
5747 ds >> emr;
5748 }
5752 bool serialize ( DATASTREAM ds )
5753 {
5754 ds << emr;
5755 return true;
5756 }
5760 int size ( void ) const { return emr.nSize; }
5766 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
5767 {
5768 EMF_UNUSED(source);
5769 EndPath( dc );
5770 }
5771 #ifdef ENABLE_EDITING
5772
5775 void edit ( void ) const
5776 {
5777 printf( "*ENDPATH*\n" );
5778 }
5779 #endif /* ENABLE_EDITING */
5780 };
5782
5785 class EMRCLOSEFIGURE : public METARECORD, ::EMRCLOSEFIGURE {
5786 public:
5790 EMRCLOSEFIGURE ( void )
5791 {
5792 emr.iType = EMR_CLOSEFIGURE;
5793 emr.nSize = sizeof( ::EMRCLOSEFIGURE );
5794 }
5799 EMRCLOSEFIGURE ( DATASTREAM& ds )
5800 {
5801 ds >> emr;
5802 }
5806 bool serialize ( DATASTREAM ds )
5807 {
5808 ds << emr;
5809 return true;
5810 }
5814 int size ( void ) const { return emr.nSize; }
5820 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
5821 {
5822 EMF_UNUSED(source);
5823 CloseFigure( dc );
5824 }
5825 #ifdef ENABLE_EDITING
5826
5829 void edit ( void ) const
5830 {
5831 printf( "*CLOSEFIGURE*\n" );
5832 }
5833 #endif /* ENABLE_EDITING */
5834 };
5836
5840 class EMRSAVEDC : public METARECORD, ::EMRSAVEDC {
5841 public:
5845 EMRSAVEDC ( void )
5846 {
5847 emr.iType = EMR_SAVEDC;
5848 emr.nSize = sizeof( ::EMRSAVEDC );
5849 }
5854 EMRSAVEDC ( DATASTREAM& ds )
5855 {
5856 ds >> emr;
5857 }
5861 bool serialize ( DATASTREAM ds )
5862 {
5863 ds << emr;
5864 return true;
5865 }
5869 int size ( void ) const { return emr.nSize; }
5875 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
5876 {
5877 EMF_UNUSED(source);
5878 SaveDC( dc );
5879 }
5880 #ifdef ENABLE_EDITING
5881
5884 void edit ( void ) const
5885 {
5886 printf( "*SAVEDC*\n" );
5887 }
5888 #endif /* ENABLE_EDITING */
5889 };
5891
5894 class EMRRESTOREDC : public METARECORD, ::EMRRESTOREDC {
5895 public:
5899 EMRRESTOREDC ( INT n )
5900 {
5901 emr.iType = EMR_RESTOREDC;
5902 emr.nSize = sizeof( ::EMRRESTOREDC );
5903 iRelative = n;
5904 }
5909 EMRRESTOREDC ( DATASTREAM& ds )
5910 {
5911 ds >> emr >> iRelative;
5912 }
5916 bool serialize ( DATASTREAM ds )
5917 {
5918 ds << emr << iRelative;
5919 return true;
5920 }
5924 int size ( void ) const { return emr.nSize; }
5930 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
5931 {
5932 EMF_UNUSED(source);
5933 RestoreDC( dc, iRelative );
5934 }
5935 #ifdef ENABLE_EDITING
5936
5939 void edit ( void ) const
5940 {
5941 #if defined(__LP64__)
5942 const char* FMT = "\tiRelative: %d\n";
5943 #else
5944 const char* FMT = "\tiRelative: %ld\n";
5945 #endif /* __x86_64__ */
5946 printf( "*RESTOREDC*\n" );
5947 printf( FMT, iRelative );
5948 }
5949 #endif /* ENABLE_EDITING */
5950 };
5952
5955 class EMRSETMETARGN : public METARECORD, ::EMRSETMETARGN {
5956 public:
5960 EMRSETMETARGN ( void )
5961 {
5962 emr.iType = EMR_SETMETARGN;
5963 emr.nSize = sizeof( ::EMRSETMETARGN );
5964 }
5969 EMRSETMETARGN ( DATASTREAM& ds )
5970 {
5971 ds >> emr;
5972 }
5976 bool serialize ( DATASTREAM ds )
5977 {
5978 ds << emr;
5979 return true;
5980 }
5984 int size ( void ) const { return emr.nSize; }
5990 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
5991 {
5992 EMF_UNUSED(source);
5993 SetMetaRgn( dc );
5994 }
5995 #ifdef ENABLE_EDITING
5996
5999 void edit ( void ) const
6000 {
6001 printf( "*SETMETARGN*\n" );
6002 }
6003 #endif /* ENABLE_EDITING */
6004 };
6005
6007
6010 class PEN : public GRAPHICSOBJECT, public LOGPEN {
6011 public:
6015 PEN ( const LOGPEN* lpen )
6016 {
6017 lopnStyle = lpen->lopnStyle;
6018 lopnWidth = lpen->lopnWidth;
6019 lopnColor = lpen->lopnColor;
6020 }
6024 OBJECTTYPE getType ( void ) const { return O_PEN; }
6031 METARECORD* newEMR ( HDC dc, HGDIOBJ emf_handle )
6032 {
6033 contexts[dc] = emf_handle;
6034 return new EMRCREATEPEN( this, emf_handle );
6035 }
6036 };
6037
6039
6042 class EXTPEN : public GRAPHICSOBJECT, public EXTLOGPEN {
6043 public:
6047 EXTPEN ( const EXTLOGPEN* lpen )
6048 {
6049 elpPenStyle = lpen->elpPenStyle;
6050 elpWidth = lpen->elpWidth;
6051 elpBrushStyle = lpen->elpBrushStyle;
6052 elpColor = lpen->elpColor;
6053 elpHatch = lpen->elpHatch;
6054 elpNumEntries = 0;
6055 elpStyleEntry[0] = 0;
6056 }
6060 OBJECTTYPE getType ( void ) const { return O_EXTPEN; }
6067 METARECORD* newEMR ( HDC dc, HGDIOBJ emf_handle )
6068 {
6069 contexts[dc] = emf_handle;
6070 return new EMREXTCREATEPEN( this, emf_handle );
6071 }
6072 };
6073
6075
6078 class BRUSH : public GRAPHICSOBJECT, public LOGBRUSH {
6079 public:
6083 BRUSH ( const LOGBRUSH* lbrush )
6084 {
6085 lbStyle = lbrush->lbStyle;
6086 lbColor = lbrush->lbColor;
6087 lbHatch = lbrush->lbHatch;
6088 }
6092 OBJECTTYPE getType ( void ) const { return O_BRUSH; }
6099 METARECORD* newEMR ( HDC dc, HGDIOBJ emf_handle )
6100 {
6101 contexts[dc] = emf_handle;
6102 return new EMRCREATEBRUSHINDIRECT( this, emf_handle );
6103 }
6104 };
6105
6107
6110 class FONT : public GRAPHICSOBJECT, public EXTLOGFONTW {
6111 public:
6115 FONT ( const LOGFONTW* lfont )
6116 {
6117 this->elfLogFont = *lfont;
6118 // There are a lot more entries in the EXTLOGFONTW structure than
6119 // the API has values for, so we invent them here
6120 memset( &elfFullName, 0, sizeof elfFullName );
6121 memset( &elfStyle, 0, sizeof elfStyle );
6122 elfVersion = ELF_VERSION;
6123 elfStyleSize = 0;
6124 elfMatch = 0;
6125 elfReserved = 0;
6126 memset( &elfVendorId, 0, sizeof elfVendorId );
6127 elfCulture = ELF_CULTURE_LATIN;
6128 memset( &elfPanose, 1, sizeof(PANOSE) );
6129 }
6133 OBJECTTYPE getType ( void ) const { return O_FONT; }
6140 METARECORD* newEMR ( HDC dc, HGDIOBJ emf_handle )
6141 {
6142 contexts[dc] = emf_handle;
6143 return new EMREXTCREATEFONTINDIRECTW( this, emf_handle );
6144 }
6145 };
6146
6148
6151 class PALETTE : public GRAPHICSOBJECT, public LOGPALETTE {
6152 public:
6156 PALETTE ( const LOGPALETTE* lpalette )
6157 {
6158 EMF_UNUSED(lpalette);
6159 palVersion = 0;
6160 palNumEntries = 0;
6161 PALETTEENTRY zero_entry = { 0, 0, 0, 0 };
6162 palPalEntry[0] = zero_entry;
6163 }
6167 OBJECTTYPE getType ( void ) const { return O_PALETTE; }
6174 METARECORD* newEMR ( HDC dc, HGDIOBJ emf_handle )
6175 {
6176 contexts[dc] = emf_handle;
6177 return new EMRCREATEPALETTE( this, emf_handle );
6178 }
6179 };
6180
6182
6185 class EMRSETMITERLIMIT : public METARECORD, ::EMRSETMITERLIMIT {
6186 public:
6190 EMRSETMITERLIMIT ( FLOAT limit )
6191 {
6192 emr.iType = EMR_SETMITERLIMIT;
6193 emr.nSize = sizeof( ::EMRSETMITERLIMIT );
6194 eMiterLimit = limit;
6195 }
6200 EMRSETMITERLIMIT ( DATASTREAM& ds )
6201 {
6202 int miter_limit;
6203 ds >> emr >> miter_limit;
6204 eMiterLimit = float(miter_limit);
6205 }
6209 bool serialize ( DATASTREAM ds )
6210 {
6211 ds << emr << (int)eMiterLimit;
6212 return true;
6213 }
6217 int size ( void ) const { return emr.nSize; }
6223 void execute ( METAFILEDEVICECONTEXT* source, HDC dc ) const
6224 {
6225 EMF_UNUSED(source);
6226 SetMiterLimit( dc, eMiterLimit, 0 );
6227 }
6228 #ifdef ENABLE_EDITING
6229
6232 void edit ( void ) const
6233 {
6234 printf( "*SETMITERLIMIT*\n" );
6235 printf( "\teMiterLimit\t: %f\n", eMiterLimit );
6236 }
6237 #endif /* ENABLE_EDITING */
6238 };
6239
6241
6247 class METAFILEDEVICECONTEXT : public OBJECT {
6255 void init ( const RECT* size, LPCWSTR description_w ) {
6256
6257 // Evidently, metafile handles are numbered from 1, so don't
6258 // ever use 0.
6259
6260 handles.push_back( true );
6261
6262 // Keep some of our graphics state in a header record
6263
6264 header = new ENHMETAHEADER ( description_w );
6265 records.push_back( header );
6266
6267 // Compute the size and position of the metafile on the "page"
6268
6269 if ( size ) {
6270 update_frame = false;
6271
6272 header->rclFrame.left = size->left;
6273 header->rclFrame.top = size->top;
6274 header->rclFrame.right = size->right;
6275 header->rclFrame.bottom = size->bottom;
6276
6277 header->rclBounds.left =
6278 size->left * header->szlDevice.cx / ( header->szlMillimeters.cx * 100 );
6279 header->rclBounds.top =
6280 size->top * header->szlDevice.cy / ( header->szlMillimeters.cy * 100 );
6281 header->rclBounds.right =
6282 size->right * header->szlDevice.cx / ( header->szlMillimeters.cx * 100 );
6283 header->rclBounds.bottom =
6284 size->bottom * header->szlDevice.cy / ( header->szlMillimeters.cy * 100 );
6285 }
6286 else {
6287 update_frame = true;
6288
6289 header->rclBounds.left = -10;
6290 header->rclBounds.top = -10;
6291 header->rclBounds.right = 10;
6292 header->rclBounds.bottom = 10;
6293
6294 header->rclFrame.left = (LONG)floor( (float)header->rclBounds.left *
6295 header->szlMillimeters.cx * 100 / header->szlDevice.cx );
6296 header->rclFrame.top = (LONG)floor( (float)header->rclBounds.top *
6297 header->szlMillimeters.cy * 100 / header->szlDevice.cy );
6298 header->rclFrame.right = (LONG)ceil( (float)header->rclBounds.right *
6299 header->szlMillimeters.cx * 100 / header->szlDevice.cx );
6300 header->rclFrame.bottom = (LONG)ceil( (float)header->rclBounds.bottom *
6301 header->szlMillimeters.cy * 100 / header->szlDevice.cy );
6302 }
6303
6304 // Some default graphics state (are they really, though?)
6305
6306 SIZEL default_resolution = { RESOLUTION, RESOLUTION };
6307 resolution = default_resolution;
6308 SIZEL default_viewport_ext = { 1, 1 };
6309 viewport_ext = default_viewport_ext;
6310 POINT default_viewport_org = { 0, 0 };
6311 viewport_org = default_viewport_org;
6312 SIZEL default_window_ext = { 1, 1 };
6313 window_ext = default_window_ext;
6314 POINT default_window_org = { 0, 0 };
6315 window_org = default_window_org;
6316
6317 min_device_point = viewport_org;
6318 max_device_point = viewport_org;
6319
6320 pen = (PEN*)globalObjects.find( BLACK_PEN | ENHMETA_STOCK_OBJECT );
6321 brush = (BRUSH*)globalObjects.find( BLACK_BRUSH | ENHMETA_STOCK_OBJECT );
6322 font = (FONT*)globalObjects.find( DEVICE_DEFAULT_FONT | ENHMETA_STOCK_OBJECT);
6323 palette = (PALETTE*)globalObjects.find( DEFAULT_PALETTE|ENHMETA_STOCK_OBJECT);
6324
6325 text_alignment = TA_BASELINE;
6326 text_color = RGB(0,0,0);
6327 bk_color = RGB(0xff,0xff,0xff);
6328 bk_mode = OPAQUE;
6329 polyfill_mode = ALTERNATE;
6330 map_mode = MM_TEXT;
6331 miter_limit = 10.f;
6332
6333 handle = globalObjects.add( this );
6334 }
6335
6336 public:
6340 ::FILE* fp;
6345 DATASTREAM ds;
6349 ENHMETAHEADER* header;
6353 std::vector< EMF::METARECORD* > records;
6354
6355 // Keep a small set of graphics state information
6356 SIZEL resolution;
6357 SIZEL viewport_ext;
6358 POINT viewport_org;
6359 SIZEL window_ext;
6360 POINT window_org;
6361 bool update_frame;
6362 POINT min_device_point;
6363 POINT max_device_point;
6364 POINT point;
6365 PEN* pen;
6366 BRUSH* brush;
6367 FONT* font;
6368 PALETTE* palette;
6369 UINT text_alignment;
6370 COLORREF text_color;
6371 COLORREF bk_color;
6372 INT bk_mode;
6373 INT polyfill_mode;
6374 INT map_mode;
6375 FLOAT miter_limit;
6376
6382 std::vector< bool > handles;
6383
6389 std::map< HGDIOBJ, HGDIOBJ > emf_handles;
6390
6401 METAFILEDEVICECONTEXT ( FILE* fp_, const RECT* size,
6402 LPCWSTR description_w )
6403 : fp(fp_), ds( fp_ )
6404 {
6405 init( size, description_w );
6406 }
6411 virtual ~METAFILEDEVICECONTEXT ( )
6412 {
6413 // Purge all the metarecords (if there are any) {this include the
6414 // header record, too}
6415 if ( records.size() > 0 )
6416 deleteMetafile();
6417 }
6421 OBJECTTYPE getType ( void ) const { return O_METAFILEDEVICECONTEXT; }
6426 DWORD nextHandle ( void )
6427 {
6428 for ( unsigned int i = 1; i < handles.size(); i++ ) {
6429 if ( !handles[i] ) {
6430 handles[i] = true;
6431 return i;
6432 }
6433 }
6434 handles.push_back( true );
6435 // Well, it appears that even StockObject handles count for something.
6436 // Not sure what the right value here is, then.
6437 header->nHandles = handles.size();
6438 return handles.size()-1;
6439 }
6443 void clearHandle ( DWORD handle )
6444 {
6445 handles[handle] = false;
6446 }
6452 void appendRecord ( METARECORD* record )
6453 {
6454 records.push_back( record );
6455
6456 header->nBytes += record->size();
6457 header->nRecords++;
6458 }
6464 void appendHandle ( METARECORD* record )
6465 {
6466 records.push_back( record );
6467
6468 header->nBytes += record->size();
6469 header->nRecords++;
6470 }
6475 void deleteMetafile ( void )
6476 {
6477 for ( std::vector<METARECORD*>::const_iterator r = records.begin();
6478 r != records.end();
6479 r++ ) {
6480 delete *r;
6481 }
6482 records.clear();
6483 }
6488 void mergePoint ( const LONG& x, const LONG& y )
6489 {
6490 POINT p;
6491 p.x = x;
6492 p.y = y;
6493 mergePoint( p );
6494 }
6499 void mergePoint( const POINT& p )
6500 {
6501 POINT device_point;
6502
6503 // *** Note, it's possible for the global transformation matrix to
6504 // affect this too. ***
6505
6506 device_point.x = (LONG)( (float)( p.x - window_org.x ) / window_ext.cx *
6507 viewport_ext.cx + viewport_org.x );
6508
6509 device_point.y = (LONG)( (float)( p.y - window_org.y ) / window_ext.cy *
6510 viewport_ext.cy + viewport_org.y );
6511
6512 // If the user didn't specify a bounding rectangle in the constructor,
6513 // compute one from this data, too.
6514 if ( device_point.x < min_device_point.x ) {
6515 min_device_point.x = device_point.x;
6516 if ( update_frame ) {
6517 header->rclBounds.left = min_device_point.x - 10;
6518 header->rclFrame.left = (LONG)floor( (float)header->rclBounds.left *
6519 header->szlMillimeters.cx * 100 / header->szlDevice.cx );
6520 }
6521 }
6522 else if ( device_point.x > max_device_point.x ) {
6523 max_device_point.x = device_point.x;
6524 if ( update_frame ) {
6525 header->rclBounds.right = max_device_point.x + 10;
6526 header->rclFrame.right = (LONG)ceil( (float)header->rclBounds.right *
6527 header->szlMillimeters.cx * 100 / header->szlDevice.cx );
6528 }
6529 }
6530
6531 if ( device_point.y < min_device_point.y ) {
6532 min_device_point.y = device_point.y;
6533 if ( update_frame ) {
6534 header->rclBounds.top = min_device_point.y - 10;
6535 header->rclFrame.top = (LONG)floor( (float)header->rclBounds.top *
6536 header->szlMillimeters.cy * 100 / header->szlDevice.cy );
6537 }
6538 }
6539 else if ( device_point.y > max_device_point.y ) {
6540 max_device_point.y = device_point.y;
6541 if ( update_frame ) {
6542 header->rclBounds.bottom = max_device_point.y + 10;
6543 header->rclFrame.bottom = (LONG)ceil( (float)header->rclBounds.bottom *
6544 header->szlMillimeters.cy * 100 / header->szlDevice.cy );
6545 }
6546 }
6547 }
6548 };
6549
6550 } // close EMF namespace
6551
6552 #undef EMF_UNUSED
6553 #endif /* _LIBEMF_H */
EMF::EMRPOLYLINE16::~EMRPOLYLINE16
~EMRPOLYLINE16()
Definition: libemf.h:3344
EMF::EMRSETVIEWPORTORGEX::size
int size(void) const
Definition: libemf.h:1767
EMF::GLOBALOBJECTS::new_setviewportextex
static EMF::METARECORD * new_setviewportextex(DATASTREAM &ds)
Create a new EMRSETVIEWPORTEXTEX record.
Definition: libemf.cpp:269
EMF::EMRPOLYBEZIERTO16::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:4318
EMF::GLOBALOBJECTS::new_setwindowextex
static EMF::METARECORD * new_setwindowextex(DATASTREAM &ds)
Create a new EMRSETWINDOWEXTEX record.
Definition: libemf.cpp:274
EMF::EMREXTTEXTOUTA::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:4678
EMF::DATASTREAM::operator>>
DATASTREAM & operator>>(BYTE &byte)
Definition: libemf.h:252
EMF::EMRPOLYBEZIER::size
int size(void) const
Definition: libemf.h:3998
EMF::EMREXTCREATEPEN::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:5212
EMF::EMRPOLYLINETO::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:4406
EMF::EMRPOLYLINETO::size
int size(void) const
Definition: libemf.h:4414
EMF::EMREXTCREATEFONTINDIRECTW::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:5341
EMF::EMRLINETO
EMF Line To.
Definition: libemf.h:2856
EMF::EMRSETBKCOLOR::EMRSETBKCOLOR
EMRSETBKCOLOR(DATASTREAM &ds)
Definition: libemf.h:2430
EMF::METAFILEDEVICECONTEXT::mergePoint
void mergePoint(const POINT &p)
Definition: libemf.h:6499
EMF::METARECORD::serialize
virtual bool serialize(DATASTREAM ds)=0
EMF::EMRPOLYBEZIER::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:4004
EMF::EMRSCALEWINDOWEXTEX::EMRSCALEWINDOWEXTEX
EMRSCALEWINDOWEXTEX(LONG x_num, LONG x_den, LONG y_num, LONG y_den)
Definition: libemf.h:2068
EMF::EMREOF
EMF End of File Record.
Definition: libemf.h:1672
EMF::EMRENDPATH::EMRENDPATH
EMRENDPATH(void)
Definition: libemf.h:5736
EMF::EMRPOLYGON16::size
int size(void) const
Definition: libemf.h:3581
EMF::ENHMETAHEADER::~ENHMETAHEADER
~ENHMETAHEADER()
Definition: libemf.h:1504
EMF::EMRSETBKCOLOR
EMF Set Background Color.
Definition: libemf.h:2415
EMF::EMREXTTEXTOUTW::EMREXTTEXTOUTW
EMREXTTEXTOUTW(const RECTL *bounds, DWORD graphicsMode, FLOAT xScale, FLOAT yScale, const PEMRTEXT text, LPCWSTR string, const INT *dx)
Definition: libemf.h:4810
EMF::EMRARCTO::EMRARCTO
EMRARCTO(DATASTREAM &ds)
Definition: libemf.h:3022
EMF::FONT::FONT
FONT(const LOGFONTW *lfont)
Definition: libemf.h:6115
EMF::EMRSETMETARGN::size
int size(void) const
Definition: libemf.h:5984
EMF::EMRSELECTOBJECT::size
int size(void) const
Definition: libemf.h:2711
EMF::EMRPOLYLINE16::EMRPOLYLINE16
EMRPOLYLINE16(DATASTREAM &ds)
Definition: libemf.h:3352
EMF::EMRPOLYBEZIERTO16
EMF PolyBezierTo16.
Definition: libemf.h:4242
EMF::METAFILEDEVICECONTEXT::text_color
COLORREF text_color
The current text foreground color.
Definition: libemf.h:6370
EMF::EMRPOLYBEZIERTO16::EMRPOLYBEZIERTO16
EMRPOLYBEZIERTO16(const RECTL *bounds, const POINT *points, INT n)
Definition: libemf.h:4275
EMF::EMRPOLYBEZIERTO::~EMRPOLYBEZIERTO
~EMRPOLYBEZIERTO()
Definition: libemf.h:4191
EMF::EMRELLIPSE::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:3159
EMF::EMRPOLYBEZIERTO16::size
int size(void) const
Definition: libemf.h:4326
EMF::EMRMODIFYWORLDTRANSFORM
EMF Modify World Transform.
Definition: libemf.h:2140
EMF::EMRSETVIEWPORTORGEX::EMRSETVIEWPORTORGEX
EMRSETVIEWPORTORGEX(DATASTREAM &ds)
Definition: libemf.h:1752
EMF::METARECORD::~METARECORD
virtual ~METARECORD()
Definition: libemf.h:1018
EMF::EMRSTROKEPATH::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:5601
EMF::GLOBALOBJECTS::new_strokepath
static EMF::METARECORD * new_strokepath(DATASTREAM &ds)
Create a new STROKEPATH record.
Definition: libemf.cpp:469
EMF::EMRPOLYBEZIER::~EMRPOLYBEZIER
~EMRPOLYBEZIER()
Definition: libemf.h:3983
EMF::EXTPEN::newEMR
METARECORD * newEMR(HDC dc, HGDIOBJ emf_handle)
Definition: libemf.h:6067
EMF::GLOBALOBJECTS::new_selectobject
static EMF::METARECORD * new_selectobject(DATASTREAM &ds)
Create a new SELECTOBJECT record.
Definition: libemf.cpp:329
EMF::EMRARC::EMRARC
EMRARC(INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend)
Definition: libemf.h:2928
EMF::EMRFILLPATH
EMF Fill path.
Definition: libemf.h:5509
EMF::EMRSTROKEANDFILLPATH::EMRSTROKEANDFILLPATH
EMRSTROKEANDFILLPATH(const RECTL *bounds)
Definition: libemf.h:5626
EMF::EMRDELETEOBJECT::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.cpp:537
EMF::EMRSETPIXELV::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:5096
EMF::EMRSETBKCOLOR::EMRSETBKCOLOR
EMRSETBKCOLOR(COLORREF color)
Definition: libemf.h:2420
EMF::EMRPOLYLINETO::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:4420
EMF::EMRSETBKCOLOR::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:2451
EMF::EMRSETTEXTALIGN::size
int size(void) const
Definition: libemf.h:2302
EMF::POINTLARRAY
Represent an array of points in a simple way.
Definition: libemf.h:140
EMF::EMRELLIPSE::EMRELLIPSE
EMRELLIPSE(DATASTREAM &ds)
Definition: libemf.h:3152
EMF::EMRELLIPSE::EMRELLIPSE
EMRELLIPSE(INT left, INT top, INT right, INT bottom)
Definition: libemf.h:3139
EMF::EMREXTTEXTOUTW
EMF Extended Text Output Wide character.
Definition: libemf.h:4795
EMF::BYTEARRAY
Represent a byte array in a simple way.
Definition: libemf.h:124
EMF::EMRSETVIEWPORTEXTEX::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:1897
EMF::GRAPHICSOBJECT
A global graphics object.
Definition: libemf.h:1255
EMF::EMRPOLYGON::EMRPOLYGON
EMRPOLYGON(const RECTL *bounds, const POINT *points, INT n)
Definition: libemf.h:3410
EMF::EMRRECTANGLE::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:3109
EMF::FONT::getType
OBJECTTYPE getType(void) const
Definition: libemf.h:6133
EMF::EMRCLOSEFIGURE::EMRCLOSEFIGURE
EMRCLOSEFIGURE(DATASTREAM &ds)
Definition: libemf.h:5799
EMF::EMRSETWINDOWORGEX::size
int size(void) const
Definition: libemf.h:1830
EMF::EMRSETWINDOWEXTEX::EMRSETWINDOWEXTEX
EMRSETWINDOWEXTEX(INT cx, INT cy)
Definition: libemf.h:2005
EMF::GLOBALOBJECTS::new_scalewindowextex
static EMF::METARECORD * new_scalewindowextex(DATASTREAM &ds)
Create a new SCALEWINDOWEXTEX record.
Definition: libemf.cpp:284
EMF::GLOBALOBJECTS::new_setwindoworgex
static EMF::METARECORD * new_setwindoworgex(DATASTREAM &ds)
Create a new EMRSETWINDOWORGEX record.
Definition: libemf.cpp:264
EMF::EMRPOLYLINETO::EMRPOLYLINETO
EMRPOLYLINETO(const RECTL *bounds, const POINT *points, INT n)
Definition: libemf.h:4363
EMF::EMRFILLPATH::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:5545
EMF::GLOBALOBJECTS::new_fillpath
static EMF::METARECORD * new_fillpath(DATASTREAM &ds)
Create a new FILLPATH record.
Definition: libemf.cpp:464
EMF::PADDING
All metafile records must be padded out to a multiple of 4 bytes.
Definition: libemf.h:204
EMF::EMRSETTEXTCOLOR::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:2380
EMF::EMRRECTANGLE::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:3095
EMF::EMRPOLYLINE16::EMRPOLYLINE16
EMRPOLYLINE16(const RECTL *bounds, const POINT *points, INT n)
Definition: libemf.h:3322
EMF::OBJECT::getType
virtual OBJECTTYPE getType(void) const =0
EMF::EMRSTROKEANDFILLPATH
EMF Stroke and Fill path.
Definition: libemf.h:5621
EMF::EMRSCALEVIEWPORTEXTEX
EMF Scale Viewport Extents (ex)
Definition: libemf.h:1920
EMF::EMRSCALEVIEWPORTEXTEX::EMRSCALEVIEWPORTEXTEX
EMRSCALEVIEWPORTEXTEX(DATASTREAM &ds)
Definition: libemf.h:1941
EMF::METAFILEDEVICECONTEXT::update_frame
bool update_frame
Update the frame automatically?
Definition: libemf.h:6361
EMF::EMRPOLYBEZIERTO::EMRPOLYBEZIERTO
EMRPOLYBEZIERTO(const RECTL *bounds, const POINT *points, INT n)
Definition: libemf.h:4155
EMF::EMREXTCREATEPEN::EMREXTCREATEPEN
EMREXTCREATEPEN(EXTPEN *pen, HGDIOBJ handle)
Definition: libemf.cpp:569
EMF::EMRSTROKEANDFILLPATH::size
int size(void) const
Definition: libemf.h:5651
EMF::EMRSETTEXTCOLOR
EMF Set Text Color.
Definition: libemf.h:2358
EMF::EMRSAVEDC::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:5861
EMF::EMRDELETEOBJECT::EMRDELETEOBJECT
EMRDELETEOBJECT(HGDIOBJ object)
Definition: libemf.h:2744
EMF::EMRRECTANGLE
EMF Rectangle.
Definition: libemf.h:3067
EMF::EMRMOVETOEX::EMRMOVETOEX
EMRMOVETOEX(INT x, INT y)
Definition: libemf.h:2803
EMF::GLOBALOBJECTS::new_savedc
static EMF::METARECORD * new_savedc(DATASTREAM &ds)
Create a new SAVEDC record.
Definition: libemf.cpp:494
EMF::GRAPHICSOBJECT::~GRAPHICSOBJECT
virtual ~GRAPHICSOBJECT()
GRAPHICSOBJECTs has a virtual destructor.
Definition: libemf.h:1258
EMF::EMRCREATEBRUSHINDIRECT::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:5286
EMF::EMRLINETO::EMRLINETO
EMRLINETO(DATASTREAM &ds)
Definition: libemf.h:2873
EMF::BRUSH
Graphics Brush.
Definition: libemf.h:6078
EMF::EMRSETWINDOWORGEX::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:1836
EMF::EMREOF::EMREOF
EMREOF(void)
Definition: libemf.h:1677
EMF::ENHMETAHEADER::size
int size(void) const
Definition: libemf.h:1567
EMF::EMRPOLYPOLYGON
EMF Poly Polygon.
Definition: libemf.h:3610
EMF::EMRARC::EMRARC
EMRARC(DATASTREAM &ds)
Definition: libemf.h:2946
EMF::WCHARSTR
Represent a wide (UNICODE) character string in a simple way.
Definition: libemf.h:89
EMF::METAFILEDEVICECONTEXT::appendHandle
void appendHandle(METARECORD *record)
Definition: libemf.h:6464
EMF::METAFILEDEVICECONTEXT::font
FONT * font
The current font.
Definition: libemf.h:6367
EMF::EMRPOLYGON16::EMRPOLYGON16
EMRPOLYGON16(const RECTL *bounds, const POINT *points, INT16 n)
Definition: libemf.h:3505
EMF::EMRCLOSEFIGURE
EMF Close Figure.
Definition: libemf.h:5785
EMF::GLOBALOBJECTS::new_arc
static EMF::METARECORD * new_arc(DATASTREAM &ds)
Create a new ARC record.
Definition: libemf.cpp:349
EMF::GLOBALOBJECTS::new_polylineto16
static EMF::METARECORD * new_polylineto16(DATASTREAM &ds)
Create a new POLYLINETO16 record.
Definition: libemf.cpp:424
EMF::GLOBALOBJECTS::new_arcto
static EMF::METARECORD * new_arcto(DATASTREAM &ds)
Create a new ARCTO record.
Definition: libemf.cpp:354
EMF::EMRCREATEPEN::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.cpp:556
EMF::EMRSETMETARGN::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:5976
EMF::EMRSETPIXELV::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:5110
EMF::EMRPOLYBEZIER
EMF Polybezier.
Definition: libemf.h:3939
EMF::EMRCREATEBRUSHINDIRECT::EMRCREATEBRUSHINDIRECT
EMRCREATEBRUSHINDIRECT(BRUSH *brush, HGDIOBJ handle)
Definition: libemf.cpp:606
EMF::EMRPOLYLINETO16::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:4540
EMF::EMRCLOSEFIGURE::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:5806
EMF::GLOBALOBJECTS::new_polybezier16
static EMF::METARECORD * new_polybezier16(DATASTREAM &ds)
Create a new POLYBEZIER16 record.
Definition: libemf.cpp:404
EMF::EMRPOLYBEZIER16::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:4110
EMF::EMREXTTEXTOUTW::EMREXTTEXTOUTW
EMREXTTEXTOUTW(DATASTREAM &ds)
Definition: libemf.h:4868
EMF::EMRCREATEPALETTE::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:5479
EMF::EMRDELETEOBJECT::EMRDELETEOBJECT
EMRDELETEOBJECT(DATASTREAM &ds)
Definition: libemf.h:2754
EMF::EMREXTCREATEFONTINDIRECTW::size
int size(void) const
Definition: libemf.h:5354
EMF::EMRSETWORLDTRANSFORM
EMF Set World Transform.
Definition: libemf.h:2215
EMF::EMRSCALEVIEWPORTEXTEX::size
int size(void) const
Definition: libemf.h:1956
EMF::EMRBEGINPATH::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:5698
EMF::EMRRECTANGLE::size
int size(void) const
Definition: libemf.h:3103
EMF::GLOBALOBJECTS::new_polypolygon
static EMF::METARECORD * new_polypolygon(DATASTREAM &ds)
Create a new POLYPOLYGON record.
Definition: libemf.cpp:389
EMF::EMRSTROKEPATH
EMF Stroke path.
Definition: libemf.h:5565
EMF::EMREOF::size
int size(void) const
Definition: libemf.h:1706
EMF::EMRMOVETOEX::EMRMOVETOEX
EMRMOVETOEX(DATASTREAM &ds)
Definition: libemf.h:2814
EMF::EMRMOVETOEX
EMF MoveTo (ex)
Definition: libemf.h:2797
EMF::EMRPOLYPOLYGON16::EMRPOLYPOLYGON16
EMRPOLYPOLYGON16(const RECTL *bounds, const POINT16 *points, const INT *counts, UINT16 polygons)
Definition: libemf.h:3807
EMF::PEN::getType
OBJECTTYPE getType(void) const
Definition: libemf.h:6024
EMF::EMRPOLYGON::size
int size(void) const
Definition: libemf.h:3461
EMF::EMRSETWINDOWEXTEX
EMF Set Window Extent (ex)
Definition: libemf.h:1999
EMF::EMRCLOSEFIGURE::size
int size(void) const
Definition: libemf.h:5814
EMF::OBJECT::~OBJECT
virtual ~OBJECT()
OBJECTs have a virtual destructor.
Definition: libemf.h:1237
EMF::EMRSETMITERLIMIT
EMF SetMiterLimit.
Definition: libemf.h:6185
EMF::EXTPEN::EXTPEN
EXTPEN(const EXTLOGPEN *lpen)
Definition: libemf.h:6047
EMF::GLOBALOBJECTS::new_extcreatepen
static EMF::METARECORD * new_extcreatepen(DATASTREAM &ds)
Create a new EXTCREATEPEN record.
Definition: libemf.cpp:449
EMF::EMRPOLYBEZIERTO::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:4212
EMF::EMRPOLYLINE::size
int size(void) const
Definition: libemf.h:3253
EMF::METAFILEDEVICECONTEXT::nextHandle
DWORD nextHandle(void)
Definition: libemf.h:6426
EMF::GLOBALOBJECTS::new_polybezier
static EMF::METARECORD * new_polybezier(DATASTREAM &ds)
Create a new POLYBEZIER record.
Definition: libemf.cpp:399
EMF::EMRPOLYPOLYGON16
EMF Poly Polygon16.
Definition: libemf.h:3756
EMF::EMRSETWORLDTRANSFORM::EMRSETWORLDTRANSFORM
EMRSETWORLDTRANSFORM(const XFORM *transform)
Definition: libemf.h:2220
EMF::EMRSETMAPMODE::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:2644
EMF::GLOBALOBJECTS::new_setviewportorgex
static EMF::METARECORD * new_setviewportorgex(DATASTREAM &ds)
Create a new EMRSETVIEWPORTORGEX record.
Definition: libemf.cpp:259
EMF::METAFILEDEVICECONTEXT::window_org
POINT window_org
The origin of the window.
Definition: libemf.h:6360
EMF::GLOBALOBJECTS::new_polygon16
static EMF::METARECORD * new_polygon16(DATASTREAM &ds)
Create a new POLYGON16 record.
Definition: libemf.cpp:384
EMF::EMRPOLYBEZIER16::EMRPOLYBEZIER16
EMRPOLYBEZIER16(const RECTL *bounds, const POINT *points, INT n)
Definition: libemf.h:4067
EMF::METAFILEDEVICECONTEXT::bk_mode
INT bk_mode
The current background mode.
Definition: libemf.h:6372
EMF::EMRSETTEXTALIGN::EMRSETTEXTALIGN
EMRSETTEXTALIGN(DATASTREAM &ds)
Definition: libemf.h:2287
EMF::EMRSETMITERLIMIT::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:6223
EMF::EMRMODIFYWORLDTRANSFORM::size
int size(void) const
Definition: libemf.h:2173
EMF::EMREXTTEXTOUTA::size
int size(void) const
Definition: libemf.h:4689
EMF::EMREOF::EMREOF
EMREOF(DATASTREAM &ds)
Definition: libemf.h:1690
EMF::EMRELLIPSE::size
int size(void) const
Definition: libemf.h:3167
EMF::PADDING::padding_
static const char padding_[4]
Pad with '\0's.
Definition: libemf.h:205
EMF::EMRBEGINPATH::size
int size(void) const
Definition: libemf.h:5706
EMF::GLOBALOBJECTS::new_setmiterlimit
static EMF::METARECORD * new_setmiterlimit(DATASTREAM &ds)
Create a new SETMITERLIMIT record.
Definition: libemf.cpp:509
EMF::INTARRAY
Represent an array of integers in a simple way.
Definition: libemf.h:172
EMF::METAFILEDEVICECONTEXT::~METAFILEDEVICECONTEXT
virtual ~METAFILEDEVICECONTEXT()
Definition: libemf.h:6411
EMF::EMRRESTOREDC
EMF Restore DC.
Definition: libemf.h:5894
EMF::EMRCREATEPEN
EMF Pen.
Definition: libemf.h:5138
EMF::GLOBALOBJECTS::end
std::vector< EMF::OBJECT * >::const_iterator end(void) const
Definition: libemf.h:1307
EMF::EMRPOLYGON::EMRPOLYGON
EMRPOLYGON(DATASTREAM &ds)
Definition: libemf.h:3433
EMF::ENHMETAHEADER::ENHMETAHEADER
ENHMETAHEADER(LPCWSTR description=0)
Definition: libemf.h:1439
EMF::GLOBALOBJECTS::new_modifyworldtransform
static EMF::METARECORD * new_modifyworldtransform(DATASTREAM &ds)
Create a new MODIFYWORLDTRANSFORM record.
Definition: libemf.cpp:289
EMF::EMREXTCREATEFONTINDIRECTW::EMREXTCREATEFONTINDIRECTW
EMREXTCREATEFONTINDIRECTW(FONT *font, HGDIOBJ handle)
Definition: libemf.cpp:633
EMF::EMRSETTEXTALIGN
EMF Set Text Alignment.
Definition: libemf.h:2272
EMF::EMRMOVETOEX::size
int size(void) const
Definition: libemf.h:2829
EMF::EMRSAVEDC::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:5875
EMF::EMRSAVEDC
EMF Save DC.
Definition: libemf.h:5840
EMF::OBJECT::OBJECT
OBJECT(void)
Definition: libemf.h:1242
EMF::EMRPOLYPOLYGON16::size
int size(void) const
Definition: libemf.h:3881
EMF::GRAPHICSOBJECT::contexts
std::map< HDC, HGDIOBJ > contexts
Definition: libemf.h:1263
EMF::EMRPOLYLINE::~EMRPOLYLINE
~EMRPOLYLINE()
Definition: libemf.h:3224
EMF::EMRSETWORLDTRANSFORM::size
int size(void) const
Definition: libemf.h:2245
EMF::EMRSETVIEWPORTORGEX::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:1773
EMF::EMRPOLYPOLYGON16::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:3872
EMF::METAFILEDEVICECONTEXT::deleteMetafile
void deleteMetafile(void)
Definition: libemf.h:6475
EMF::EMRSETBKMODE::size
int size(void) const
Definition: libemf.h:2503
EMF::EMRSETMAPMODE::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:2630
EMF::EMRSETPOLYFILLMODE::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:2562
EMF::EMRPOLYLINE16::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:3365
EMF::EMRPOLYLINE::EMRPOLYLINE
EMRPOLYLINE(DATASTREAM &ds)
Definition: libemf.h:3232
EMF::EMRSETBKMODE::EMRSETBKMODE
EMRSETBKMODE(DATASTREAM &ds)
Definition: libemf.h:2488
EMF::EMRDELETEOBJECT::size
int size(void) const
Definition: libemf.h:2769
EMF::EMRPOLYLINE::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:3245
EMF::EMRSETWINDOWEXTEX::size
int size(void) const
Definition: libemf.h:2031
EMF::ENHMETAHEADER::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:1512
EMF::EMRPOLYBEZIER::EMRPOLYBEZIER
EMRPOLYBEZIER(DATASTREAM &ds)
Definition: libemf.h:3970
EMF::EMRPOLYLINETO16::EMRPOLYLINETO16
EMRPOLYLINETO16(const RECTL *bounds, const POINT16 *points, INT n)
Definition: libemf.h:4458
EMF::GLOBALOBJECTS::new_beginpath
static EMF::METARECORD * new_beginpath(DATASTREAM &ds)
Create a new BEGINPATH record.
Definition: libemf.cpp:479
EMF::GLOBALOBJECTS::new_restoredc
static EMF::METARECORD * new_restoredc(DATASTREAM &ds)
Create a new RESTOREDC record.
Definition: libemf.cpp:499
EMF::GLOBALOBJECTS::new_setpixelv
static EMF::METARECORD * new_setpixelv(DATASTREAM &ds)
Create a new SETPIXELV record.
Definition: libemf.cpp:439
EMF::METAFILEDEVICECONTEXT::point
POINT point
The current point.
Definition: libemf.h:6364
EMF::EMRFILLPATH::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:5531
EMF::EMRSELECTOBJECT::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:2703
EMF::POINTLARRAY::n_
const DWORD n_
Number of POINTLs in array.
Definition: libemf.h:142
EMF::EMRSETVIEWPORTORGEX::EMRSETVIEWPORTORGEX
EMRSETVIEWPORTORGEX(INT x, INT y)
Definition: libemf.h:1741
EMF::EMRARCTO::size
int size(void) const
Definition: libemf.h:3037
EMF::EMRPOLYBEZIERTO16::EMRPOLYBEZIERTO16
EMRPOLYBEZIERTO16(const RECTL *bounds, const POINT16 *points, INT n)
Definition: libemf.h:4250
EMF::EMRBEGINPATH
EMF Begin Path.
Definition: libemf.h:5677
EMF::EMRLINETO::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:2894
EMF::GLOBALOBJECTS::new_extcreatefontindirectw
static EMF::METARECORD * new_extcreatefontindirectw(DATASTREAM &ds)
Create a new EXTCREATEFONTINDIRECTW record.
Definition: libemf.cpp:459
EMF::EMREXTTEXTOUTW::~EMREXTTEXTOUTW
~EMREXTTEXTOUTW()
Definition: libemf.h:4900
EMF::METAFILEDEVICECONTEXT::brush
BRUSH * brush
The current brush.
Definition: libemf.h:6366
EMF::EMRSAVEDC::size
int size(void) const
Definition: libemf.h:5869
EMF::EMRSETWORLDTRANSFORM::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:2237
EMF::GLOBALOBJECTS::new_scaleviewportextex
static EMF::METARECORD * new_scaleviewportextex(DATASTREAM &ds)
Create a new SCALEVIEWPORTEXTEX record.
Definition: libemf.cpp:279
EMF::OBJECT
Global GDI object.
Definition: libemf.h:1233
EMF::PADDING::size_
const int size_
Number of bytes of padding.
Definition: libemf.h:206
EMF::POINT16ARRAY::points_
POINT16 *const points_
Array of POINT16s.
Definition: libemf.h:157
EMF::EMRSETWINDOWEXTEX::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:2037
EMF::DWORDARRAY
Represent an array of double word integers in a simple way.
Definition: libemf.h:188
EMF::EMRPOLYLINETO::~EMRPOLYLINETO
~EMRPOLYLINETO()
Definition: libemf.h:4399
EMF::PEN::PEN
PEN(const LOGPEN *lpen)
Definition: libemf.h:6015
EMF::METAFILEDEVICECONTEXT::mergePoint
void mergePoint(const LONG &x, const LONG &y)
Definition: libemf.h:6488
EMF::METAFILEDEVICECONTEXT::text_alignment
UINT text_alignment
The current text alignment.
Definition: libemf.h:6369
EMF::EMRCREATEPALETTE::size
int size(void) const
Definition: libemf.h:5487
EMF::EMRMODIFYWORLDTRANSFORM::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:2179
EMF::ENHMETAHEADER::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:1573
EMF::EXTPEN
Extended Graphics Pen.
Definition: libemf.h:6042
EMF::GLOBALOBJECTS::new_polylineto
static EMF::METARECORD * new_polylineto(DATASTREAM &ds)
Create a new POLYLINETO record.
Definition: libemf.cpp:419
EMF::EMRBEGINPATH::EMRBEGINPATH
EMRBEGINPATH(DATASTREAM &ds)
Definition: libemf.h:5691
EMF::EMRSTROKEPATH::EMRSTROKEPATH
EMRSTROKEPATH(const RECTL *bounds)
Definition: libemf.h:5570
EMF::EMREOF::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:1712
EMF::FONT
Graphics Font.
Definition: libemf.h:6110
EMF::EMRPOLYLINE::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:3259
EMF::EMRSETWINDOWORGEX
EMF Set Window Origin (ex)
Definition: libemf.h:1798
EMF::EMRSETBKMODE::EMRSETBKMODE
EMRSETBKMODE(DWORD mode)
Definition: libemf.h:2478
EMF::DWORDARRAY::dwords_
DWORD *const dwords_
Array of double words.
Definition: libemf.h:189
EMF::EMRSETMETARGN::EMRSETMETARGN
EMRSETMETARGN(DATASTREAM &ds)
Definition: libemf.h:5969
EMF::EMRSETTEXTCOLOR::EMRSETTEXTCOLOR
EMRSETTEXTCOLOR(DATASTREAM &ds)
Definition: libemf.h:2373
EMF::METARECORD::size
virtual int size(void) const =0
EMF::METARECORD::execute
virtual void execute(METAFILEDEVICECONTEXT *source, HDC dc) const =0
EMF::EMREXTCREATEPEN
EMF Extended Pen.
Definition: libemf.h:5196
EMF::EMRPOLYBEZIER16::~EMRPOLYBEZIER16
~EMRPOLYBEZIER16()
Definition: libemf.h:4103
EMF::EMRSELECTOBJECT::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.cpp:522
EMF::GLOBALOBJECTS::new_settextalign
static EMF::METARECORD * new_settextalign(DATASTREAM &ds)
Create a new SETTEXTALIGN record.
Definition: libemf.cpp:299
EMF::EMRSETPOLYFILLMODE::size
int size(void) const
Definition: libemf.h:2570
EMF::EMRSCALEVIEWPORTEXTEX::EMRSCALEVIEWPORTEXTEX
EMRSCALEVIEWPORTEXTEX(LONG x_num, LONG x_den, LONG y_num, LONG y_den)
Definition: libemf.h:1928
EMF::EMRSETPOLYFILLMODE::EMRSETPOLYFILLMODE
EMRSETPOLYFILLMODE(DWORD mode)
Definition: libemf.h:2545
EMF::EMRRESTOREDC::EMRRESTOREDC
EMRRESTOREDC(DATASTREAM &ds)
Definition: libemf.h:5909
EMF::EMRCREATEPEN::EMRCREATEPEN
EMRCREATEPEN(PEN *pen, HGDIOBJ handle)
Definition: libemf.cpp:514
EMF::CHARSTR::CHARSTR
CHARSTR(CHAR *const string, const int length)
Definition: libemf.h:115
EMF::EMRSETVIEWPORTEXTEX::EMRSETVIEWPORTEXTEX
EMRSETVIEWPORTEXTEX(DATASTREAM &ds)
Definition: libemf.h:1876
EMF::EMRENDPATH::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:5752
EMF::EMRPOLYGON16::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:3587
EMF::EMRPOLYPOLYGON::~EMRPOLYPOLYGON
~EMRPOLYPOLYGON()
Definition: libemf.h:3657
EMF::EMRFILLPATH::EMRFILLPATH
EMRFILLPATH(DATASTREAM &ds)
Definition: libemf.h:5524
EMF::ENHMETAHEADER
Enhanced Metafile Header Record.
Definition: libemf.h:1427
EMF::EMRPOLYLINETO
EMF PolylineTo.
Definition: libemf.h:4355
EMF::GLOBALOBJECTS::new_ellipse
static EMF::METARECORD * new_ellipse(DATASTREAM &ds)
Create a new ELLIPSE record.
Definition: libemf.cpp:364
EMF::GLOBALOBJECTS::new_closefigure
static EMF::METARECORD * new_closefigure(DATASTREAM &ds)
Create a new CLOSEFIGURE record.
Definition: libemf.cpp:489
EMF::EMRSETVIEWPORTORGEX
EMF Set Viewport Origin (ex)
Definition: libemf.h:1735
EMF::GLOBALOBJECTS::find
OBJECT * find(const HGDIOBJ handle)
Definition: libemf.cpp:213
EMF::EMRSETMITERLIMIT::size
int size(void) const
Definition: libemf.h:6217
EMF::EMRPOLYBEZIER::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:3990
EMF::WCHARSTR::length_
const int length_
Number of WCHARs in string.
Definition: libemf.h:91
EMF::POINTLARRAY::POINTLARRAY
POINTLARRAY(POINTL *const points, const DWORD n)
Definition: libemf.h:148
EMF::EMRPOLYPOLYGON::size
int size(void) const
Definition: libemf.h:3694
EMF::METAFILEDEVICECONTEXT::fp
::FILE * fp
Definition: libemf.h:6340
EMF::EMRRECTANGLE::EMRRECTANGLE
EMRRECTANGLE(INT left, INT top, INT right, INT bottom)
Definition: libemf.h:3075
EMF::EMRPOLYPOLYGON16::EMRPOLYPOLYGON16
EMRPOLYPOLYGON16(const RECTL *bounds, const POINT *points, const INT *counts, UINT polygons)
Definition: libemf.h:3766
EMF::EMRPOLYPOLYGON::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:3700
EMF::METAFILEDEVICECONTEXT::viewport_org
POINT viewport_org
The origin of the viewport.
Definition: libemf.h:6358
EMF::METAFILEDEVICECONTEXT::polyfill_mode
INT polyfill_mode
The current polygon fill mode.
Definition: libemf.h:6373
EMF::METAFILEDEVICECONTEXT::emf_handles
std::map< HGDIOBJ, HGDIOBJ > emf_handles
Definition: libemf.h:6389
EMF::EMRLINETO::size
int size(void) const
Definition: libemf.h:2888
EMF::EMRPOLYPOLYGON16::~EMRPOLYPOLYGON16
~EMRPOLYPOLYGON16()
Definition: libemf.h:3844
EMF::EMRMOVETOEX::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:2835
EMF::METAFILEDEVICECONTEXT::clearHandle
void clearHandle(DWORD handle)
Definition: libemf.h:6443
EMF::EMRRESTOREDC::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:5930
EMF::METAFILEDEVICECONTEXT::pen
PEN * pen
The current pen.
Definition: libemf.h:6365
EMF::METAFILEDEVICECONTEXT::miter_limit
FLOAT miter_limit
The current miter length limit.
Definition: libemf.h:6375
EMF::METAFILEDEVICECONTEXT::min_device_point
POINT min_device_point
The lft/top-most painted point in device units.
Definition: libemf.h:6362
EMF::GLOBALOBJECTS::new_movetoex
static EMF::METARECORD * new_movetoex(DATASTREAM &ds)
Create a new MOVETOEX record.
Definition: libemf.cpp:339
EMF::EMRSETVIEWPORTEXTEX
EMF Set Viewport Extents (ex)
Definition: libemf.h:1859
EMF::EMRSETVIEWPORTORGEX::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:1759
EMF::EMRELLIPSE::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:3173
EMF::EMRPOLYLINE16::EMRPOLYLINE16
EMRPOLYLINE16(const RECTL *bounds, const POINT16 *points, INT n)
Definition: libemf.h:3297
EMF::CHARSTR::length_
const int length_
Number of single byte characers in array.
Definition: libemf.h:109
EMF::EMRSTROKEANDFILLPATH::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:5643
EMF::EMRSETMITERLIMIT::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:6209
EMF::METAFILEDEVICECONTEXT::bk_color
COLORREF bk_color
The current background color.
Definition: libemf.h:6371
EMF::EMRSETBKCOLOR::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:2437
EMF::CHARSTR
Represent an ASCII character string in a simple way.
Definition: libemf.h:107
EMF::EMRSETPOLYFILLMODE::EMRSETPOLYFILLMODE
EMRSETPOLYFILLMODE(DATASTREAM &ds)
Definition: libemf.h:2555
EMF::ENHMETAHEADER::unserialize
bool unserialize(DATASTREAM ds)
Definition: libemf.h:1529
EMF::EMRARCTO
EMF Arc To.
Definition: libemf.h:2991
EMF::EMRSETWORLDTRANSFORM::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:2251
EMF::EMREXTTEXTOUTA::EMREXTTEXTOUTA
EMREXTTEXTOUTA(DATASTREAM &ds)
Definition: libemf.h:4638
EMF::POINT16ARRAY
Represent an array of 16-bit point in a simple way.
Definition: libemf.h:156
EMF::GLOBALOBJECTS::new_polybezierto
static EMF::METARECORD * new_polybezierto(DATASTREAM &ds)
Create a new POLYBEZIERTO record.
Definition: libemf.cpp:409
EMF::GLOBALOBJECTS::begin
std::vector< EMF::OBJECT * >::const_iterator begin(void) const
Definition: libemf.h:1302
EMF::GLOBALOBJECTS::new_endpath
static EMF::METARECORD * new_endpath(DATASTREAM &ds)
Create a new ENDPATH record.
Definition: libemf.cpp:484
EMF::METAFILEDEVICECONTEXT::METAFILEDEVICECONTEXT
METAFILEDEVICECONTEXT(FILE *fp_, const RECT *size, LPCWSTR description_w)
Definition: libemf.h:6401
EMF::EMRARCTO::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:3043
EMF::EMRELLIPSE
EMF Ellipse.
Definition: libemf.h:3130
EMF::METAFILEDEVICECONTEXT::appendRecord
void appendRecord(METARECORD *record)
Definition: libemf.h:6452
EMF::PADDING::PADDING
PADDING(const int size)
Definition: libemf.h:211
EMF::EMRENDPATH::size
int size(void) const
Definition: libemf.h:5760
EMF::EMRSETPIXELV::EMRSETPIXELV
EMRSETPIXELV(INT x, INT y, COLORREF color)
Definition: libemf.h:5077
EMF::EMRSETVIEWPORTEXTEX::size
int size(void) const
Definition: libemf.h:1891
EMF::EMRCREATEPALETTE::EMRCREATEPALETTE
EMRCREATEPALETTE(PALETTE *palette, HGDIOBJ handle)
Definition: libemf.cpp:661
EMF::EMRSETWORLDTRANSFORM::EMRSETWORLDTRANSFORM
EMRSETWORLDTRANSFORM(DATASTREAM &ds)
Definition: libemf.h:2230
EMF::EMRARCTO::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:3029
EMF::METAFILEDEVICECONTEXT::records
std::vector< EMF::METARECORD * > records
Definition: libemf.h:6353
EMF::EMRPOLYLINE16::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:3379
EMF::EMRSETMAPMODE
EMF Set Mapping Mode.
Definition: libemf.h:2608
EMF::EMRSAVEDC::EMRSAVEDC
EMRSAVEDC(DATASTREAM &ds)
Definition: libemf.h:5854
EMF::EMRSETMAPMODE::EMRSETMAPMODE
EMRSETMAPMODE(DWORD mode)
Definition: libemf.h:2613
EMF::METAFILEDEVICECONTEXT::max_device_point
POINT max_device_point
The rgt/btm-most painted point in device units.
Definition: libemf.h:6363
EMF::GLOBALOBJECTS::new_setpolyfillmode
static EMF::METARECORD * new_setpolyfillmode(DATASTREAM &ds)
Create a new SETPOLYFILLMODE record.
Definition: libemf.cpp:319
EMF::EMRPOLYLINETO16::EMRPOLYLINETO16
EMRPOLYLINETO16(DATASTREAM &ds)
Definition: libemf.h:4506
EMF::EMRCREATEBRUSHINDIRECT::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.cpp:614
EMF::EMRPOLYBEZIERTO16::~EMRPOLYBEZIERTO16
~EMRPOLYBEZIERTO16()
Definition: libemf.h:4311
EMF::GLOBALOBJECTS::new_strokeandfillpath
static EMF::METARECORD * new_strokeandfillpath(DATASTREAM &ds)
Create a new STROKEANDFILLPATH record.
Definition: libemf.cpp:474
EMF::EMRSTROKEPATH::EMRSTROKEPATH
EMRSTROKEPATH(DATASTREAM &ds)
Definition: libemf.h:5580
EMF::EMRSTROKEANDFILLPATH::EMRSTROKEANDFILLPATH
EMRSTROKEANDFILLPATH(DATASTREAM &ds)
Definition: libemf.h:5636
EMF::METARECORD
The base class of all metafile records.
Definition: libemf.h:991
EMF::EMRPOLYLINETO16::size
int size(void) const
Definition: libemf.h:4534
EMF::EMRPOLYLINETO16::~EMRPOLYLINETO16
~EMRPOLYLINETO16()
Definition: libemf.h:4519
EMF::EMRPOLYGON::~EMRPOLYGON
~EMRPOLYGON()
Definition: libemf.h:3446
EMF::EMRSETBKMODE::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:2495
EMF::EMRPOLYPOLYGON::EMRPOLYPOLYGON
EMRPOLYPOLYGON(const RECTL *bounds, const POINT *points, const INT *counts, UINT polygons)
Definition: libemf.h:3620
EMF::EMREXTTEXTOUTA::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:4695
EMF::METAFILEDEVICECONTEXT::palette
PALETTE * palette
The current palette.
Definition: libemf.h:6368
EMF::EMRSCALEVIEWPORTEXTEX::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:1962
EMF::PEN::newEMR
METARECORD * newEMR(HDC dc, HGDIOBJ emf_handle)
Definition: libemf.h:6031
EMF::CHARSTR::string_
CHAR *const string_
Array of single byte characters.
Definition: libemf.h:108
EMF::POINT16ARRAY::POINT16ARRAY
POINT16ARRAY(POINT16 *const points, const DWORD n)
Definition: libemf.h:164
EMF::EMRPOLYBEZIER16
EMF Polybezier16.
Definition: libemf.h:4034
EMF::BRUSH::newEMR
METARECORD * newEMR(HDC dc, HGDIOBJ emf_handle)
Definition: libemf.h:6099
EMF::EMRFILLPATH::size
int size(void) const
Definition: libemf.h:5539
EMF::EMRPOLYBEZIER::EMRPOLYBEZIER
EMRPOLYBEZIER(const RECTL *bounds, const POINT *points, INT n)
Definition: libemf.h:3947
EMF::EMRCREATEPEN::size
int size(void) const
Definition: libemf.h:5162
EMF::EMRSETMETARGN::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:5990
EMF::EMRSETTEXTCOLOR::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:2394
EMF::EMRMODIFYWORLDTRANSFORM::EMRMODIFYWORLDTRANSFORM
EMRMODIFYWORLDTRANSFORM(const XFORM *transform, DWORD mode)
Definition: libemf.h:2147
EMF::EMRPOLYGON::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:3467
EMF::EMRPOLYBEZIERTO::size
int size(void) const
Definition: libemf.h:4206
EMF::METAFILEDEVICECONTEXT::ds
DATASTREAM ds
Definition: libemf.h:6345
EMF::EMRARC::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:2967
EMF::EMRPOLYGON16::EMRPOLYGON16
EMRPOLYGON16(DATASTREAM &ds)
Definition: libemf.h:3553
EMF::GLOBALOBJECTS::newRecord
METARECORDCTOR newRecord(DWORD iType) const
Definition: libemf.cpp:243
EMF::EMRSETBKCOLOR::size
int size(void) const
Definition: libemf.h:2445
EMF::PALETTE::newEMR
METARECORD * newEMR(HDC dc, HGDIOBJ emf_handle)
Definition: libemf.h:6174
EMF::EMRSETPIXELV::EMRSETPIXELV
EMRSETPIXELV(DATASTREAM &ds)
Definition: libemf.h:5089
EMF::OBJECT::handle
HGDIOBJ handle
Definition: libemf.h:1235
EMF::EMRPOLYPOLYGON::EMRPOLYPOLYGON
EMRPOLYPOLYGON(DATASTREAM &ds)
Definition: libemf.h:3666
EMF::EMRPOLYBEZIERTO::EMRPOLYBEZIERTO
EMRPOLYBEZIERTO(DATASTREAM &ds)
Definition: libemf.h:4178
EMF::EMRSCALEWINDOWEXTEX::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:2088
EMF::EMRSELECTOBJECT::EMRSELECTOBJECT
EMRSELECTOBJECT(DATASTREAM &ds)
Definition: libemf.h:2696
EMF::DWORDARRAY::n_
const DWORD n_
Number of double words in array.
Definition: libemf.h:190
EMF::EMRSELECTOBJECT::EMRSELECTOBJECT
EMRSELECTOBJECT(HGDIOBJ object)
Definition: libemf.h:2686
EMF::EMRSETTEXTCOLOR::EMRSETTEXTCOLOR
EMRSETTEXTCOLOR(COLORREF color)
Definition: libemf.h:2363
EMF::EMRPOLYGON16::~EMRPOLYGON16
~EMRPOLYGON16()
Definition: libemf.h:3566
EMF::PALETTE::getType
OBJECTTYPE getType(void) const
Definition: libemf.h:6167
EMF::FONT::newEMR
METARECORD * newEMR(HDC dc, HGDIOBJ emf_handle)
Definition: libemf.h:6140
EMF::EMRSETPOLYFILLMODE
EMF Set the Polygon Fill Mode.
Definition: libemf.h:2540
EMF::EMRMODIFYWORLDTRANSFORM::EMRMODIFYWORLDTRANSFORM
EMRMODIFYWORLDTRANSFORM(DATASTREAM &ds)
Definition: libemf.h:2158
EMF::DATASTREAM::operator<<
DATASTREAM & operator<<(const BYTE &byte)
Definition: libemf.h:243
EMF::EMRPOLYLINETO16
EMF PolylineTo16.
Definition: libemf.h:4450
EMF::BYTEARRAY::array_
BYTE *const array_
Array of unsigned bytes.
Definition: libemf.h:125
EMF::EMRBEGINPATH::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:5712
EMF::EMRCREATEPALETTE
EMF Palette.
Definition: libemf.h:5463
EMF::DATASTREAM
Support different endian modes when reading and writing the metafile.
Definition: libemf.h:222
EMF::EMREXTCREATEPEN::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.cpp:581
EMF::EMRSETVIEWPORTEXTEX::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:1883
EMF::GLOBALOBJECTS::new_setmetargn
static EMF::METARECORD * new_setmetargn(DATASTREAM &ds)
Create a new SETMETARGN record.
Definition: libemf.cpp:504
EMF::EMRPOLYLINETO16::EMRPOLYLINETO16
EMRPOLYLINETO16(const RECTL *bounds, const POINT *points, INT n)
Definition: libemf.h:4483
EMF::EMRSETWINDOWEXTEX::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:2023
EMF::GLOBALOBJECTS::new_eof
static EMF::METARECORD * new_eof(DATASTREAM &ds)
Create a new EMREOF record.
Definition: libemf.cpp:254
EMF::GLOBALOBJECTS::new_setworldtransform
static EMF::METARECORD * new_setworldtransform(DATASTREAM &ds)
Create a new SETWORLDTRANSFORM record.
Definition: libemf.cpp:294
EMF::METAFILEDEVICECONTEXT::window_ext
SIZEL window_ext
The extent of the window.
Definition: libemf.h:6359
EMF::EMRCLOSEFIGURE::EMRCLOSEFIGURE
EMRCLOSEFIGURE(void)
Definition: libemf.h:5790
EMF::EMRARC::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:2953
EMF::EMREXTTEXTOUTW::size
int size(void) const
Definition: libemf.h:4919
EMF::EMRSETBKMODE
EMF Set Background Mode.
Definition: libemf.h:2473
EMF::EMRARCTO::EMRARCTO
EMRARCTO(INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend)
Definition: libemf.h:3004
EMF::GLOBALOBJECTS::new_exttextouta
static EMF::METARECORD * new_exttextouta(DATASTREAM &ds)
Create a new EXTTEXTOUTA record.
Definition: libemf.cpp:429
EMF::GLOBALOBJECTS::new_deleteobject
static EMF::METARECORD * new_deleteobject(DATASTREAM &ds)
Create a new DELETEOBJECT record.
Definition: libemf.cpp:334
EMF::EMRCREATEPEN::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:5154
EMF::EMRSTROKEPATH::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:5587
EMF::EMRPOLYBEZIER16::EMRPOLYBEZIER16
EMRPOLYBEZIER16(const RECTL *bounds, const POINT16 *points, INT n)
Definition: libemf.h:4042
EMF::BRUSH::getType
OBJECTTYPE getType(void) const
Definition: libemf.h:6092
EMF::DWORDARRAY::DWORDARRAY
DWORDARRAY(DWORD *const dwords, const DWORD n)
Definition: libemf.h:196
EMF::EMRPOLYBEZIER16::size
int size(void) const
Definition: libemf.h:4118
EMF::EMRPOLYGON16::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:3573
EMF::METAFILEDEVICECONTEXT::viewport_ext
SIZEL viewport_ext
The extent of the viewport.
Definition: libemf.h:6357
EMF::BYTEARRAY::n_
const int n_
Number of bytes in array.
Definition: libemf.h:126
EMF::EMRSETWINDOWEXTEX::EMRSETWINDOWEXTEX
EMRSETWINDOWEXTEX(DATASTREAM &ds)
Definition: libemf.h:2016
EMF::EMRPOLYPOLYGON16::EMRPOLYPOLYGON16
EMRPOLYPOLYGON16(DATASTREAM &ds)
Definition: libemf.h:3853
EMF::EMRPOLYLINE16::size
int size(void) const
Definition: libemf.h:3373
EMF::WCHARSTR::string_
WCHAR *const string_
String of WCHARs.
Definition: libemf.h:90
EMF::EMRPOLYBEZIER16::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:4124
EMF::EMRPOLYGON16::EMRPOLYGON16
EMRPOLYGON16(const RECTL *bounds, const POINT16 *points, INT16 n)
Definition: libemf.h:3530
EMF::INTARRAY::ints_
INT *const ints_
Array of ints.
Definition: libemf.h:173
EMF::EMRRESTOREDC::EMRRESTOREDC
EMRRESTOREDC(INT n)
Definition: libemf.h:5899
EMF::GLOBALOBJECTS::new_setbkcolor
static EMF::METARECORD * new_setbkcolor(DATASTREAM &ds)
Create a new SETBKCOLOR record.
Definition: libemf.cpp:309
EMF::EMRPOLYLINE
EMF Polyline.
Definition: libemf.h:3194
EMF::INTARRAY::INTARRAY
INTARRAY(INT *const ints, const DWORD n)
Definition: libemf.h:180
EMF::EMRSTROKEANDFILLPATH::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:5657
EMF::BYTEARRAY::BYTEARRAY
BYTEARRAY(BYTE *const array, const int n)
Definition: libemf.h:132
EMF::GRAPHICSOBJECT::newEMR
virtual METARECORD * newEMR(HDC dc, HGDIOBJ handle)=0
EMF::METAFILEDEVICECONTEXT
Graphics Device Context.
Definition: libemf.h:6247
EMF::EMRENDPATH::EMRENDPATH
EMRENDPATH(DATASTREAM &ds)
Definition: libemf.h:5745
EMF::EMREXTCREATEPEN::size
int size(void) const
Definition: libemf.h:5220
EMF::EMREXTTEXTOUTA
EMF Extended Text Output ASCII.
Definition: libemf.h:4565
EMF::POINT16ARRAY::n_
const DWORD n_
Number of POINT16s in array.
Definition: libemf.h:158
EMF::PEN
Graphics Pen.
Definition: libemf.h:6010
EMF::EMRLINETO::EMRLINETO
EMRLINETO(INT x, INT y)
Definition: libemf.h:2862
EMF::EMRSCALEWINDOWEXTEX::size
int size(void) const
Definition: libemf.h:2096
EMF::EMRSETMITERLIMIT::EMRSETMITERLIMIT
EMRSETMITERLIMIT(FLOAT limit)
Definition: libemf.h:6190
EMF::EMREOF::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:1698
EMF::EMRRESTOREDC::size
int size(void) const
Definition: libemf.h:5924
EMF::GLOBALOBJECTS::new_lineto
static EMF::METARECORD * new_lineto(DATASTREAM &ds)
Create a new LINETO record.
Definition: libemf.cpp:344
EMF::EMRSETMAPMODE::size
int size(void) const
Definition: libemf.h:2638
EMF::EMRRECTANGLE::EMRRECTANGLE
EMRRECTANGLE(DATASTREAM &ds)
Definition: libemf.h:3088
EMF::EMRSCALEVIEWPORTEXTEX::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:1948
EMF::EMRPOLYBEZIERTO::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:4198
EMF::EMRSETMAPMODE::EMRSETMAPMODE
EMRSETMAPMODE(DATASTREAM &ds)
Definition: libemf.h:2623
EMF::EMRSETPOLYFILLMODE::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:2576
EMF::GLOBALOBJECTS::new_createpen
static EMF::METARECORD * new_createpen(DATASTREAM &ds)
Create a new CREATEPEN record.
Definition: libemf.cpp:444
EMF::EMRLINETO::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:2880
EMF::EMREXTTEXTOUTA::~EMREXTTEXTOUTA
~EMREXTTEXTOUTA()
Definition: libemf.h:4670
EMF::GLOBALOBJECTS::new_polybezierto16
static EMF::METARECORD * new_polybezierto16(DATASTREAM &ds)
Create a new POLYBEZIERTO16 record.
Definition: libemf.cpp:414
EMF::EMRPOLYGON::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:3453
EMF::EMRSCALEWINDOWEXTEX::EMRSCALEWINDOWEXTEX
EMRSCALEWINDOWEXTEX(DATASTREAM &ds)
Definition: libemf.h:2081
EMF::EMRPOLYPOLYGON::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:3685
EMF::EMRSCALEWINDOWEXTEX
EMF Scale Window Extents (ex)
Definition: libemf.h:2060
EMF::EMRPOLYLINE16
EMF Polyline16.
Definition: libemf.h:3289
EMF::EMRBEGINPATH::EMRBEGINPATH
EMRBEGINPATH(void)
Definition: libemf.h:5682
EMF::METAFILEDEVICECONTEXT::resolution
SIZEL resolution
The resolution in DPI of the reference DC.
Definition: libemf.h:6356
EMF::EMRCREATEPALETTE::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.cpp:669
EMF::EMRSETVIEWPORTEXTEX::EMRSETVIEWPORTEXTEX
EMRSETVIEWPORTEXTEX(INT cx, INT cy)
Definition: libemf.h:1865
EMF::BRUSH::BRUSH
BRUSH(const LOGBRUSH *lbrush)
Definition: libemf.h:6083
EMF::GLOBALOBJECTS::new_polyline16
static EMF::METARECORD * new_polyline16(DATASTREAM &ds)
Create a new POLYLINE16 record.
Definition: libemf.cpp:374
EMF::METAFILEDEVICECONTEXT::map_mode
INT map_mode
The current mapping mode.
Definition: libemf.h:6374
EMF::POINTLARRAY::points_
POINTL *const points_
Array of POINTLs.
Definition: libemf.h:141
EMF::GLOBALOBJECTS::new_setbkmode
static EMF::METARECORD * new_setbkmode(DATASTREAM &ds)
Create a new SETBKMODE record.
Definition: libemf.cpp:314
EMF::EMREXTCREATEFONTINDIRECTW
EMF Font.
Definition: libemf.h:5325
EMF::METAFILEDEVICECONTEXT::getType
OBJECTTYPE getType(void) const
Definition: libemf.h:6421
EMF::EMRSELECTOBJECT
EMF Select Object.
Definition: libemf.h:2681
EMF::EMRDELETEOBJECT::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:2761
EMF::EXTPEN::getType
OBJECTTYPE getType(void) const
Definition: libemf.h:6060
EMF::EMRSAVEDC::EMRSAVEDC
EMRSAVEDC(void)
Definition: libemf.h:5845
EMF::EMRPOLYBEZIERTO16::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:4332
EMF::GLOBALOBJECTS::new_polyline
static EMF::METARECORD * new_polyline(DATASTREAM &ds)
Create a new POLYLINE record.
Definition: libemf.cpp:369
EMF::GLOBALOBJECTS::new_polypolygon16
static EMF::METARECORD * new_polypolygon16(DATASTREAM &ds)
Create a new POLYPOLYGON16 record.
Definition: libemf.cpp:394
EMF::EMRSTROKEPATH::size
int size(void) const
Definition: libemf.h:5595
EMF::EMRARC
EMF Arc.
Definition: libemf.h:2915
EMF::EMRSETMETARGN::EMRSETMETARGN
EMRSETMETARGN(void)
Definition: libemf.h:5960
EMF::EMRPOLYLINETO::EMRPOLYLINETO
EMRPOLYLINETO(DATASTREAM &ds)
Definition: libemf.h:4386
EMF::GLOBALOBJECTS::new_setmapmode
static EMF::METARECORD * new_setmapmode(DATASTREAM &ds)
Create a new SETMAPMODE record.
Definition: libemf.cpp:324
EMF::EMREXTCREATEFONTINDIRECTW::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.cpp:647
EMF::EMRSETTEXTALIGN::EMRSETTEXTALIGN
EMRSETTEXTALIGN(UINT mode)
Definition: libemf.h:2277
EMF::EMRSETTEXTCOLOR::size
int size(void) const
Definition: libemf.h:2388
EMF::EMRRESTOREDC::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:5916
EMF::EMRSETWINDOWORGEX::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:1822
EMF::EMRSETPIXELV
EMF Set Pixel.
Definition: libemf.h:5070
EMF::EMRSETPIXELV::size
int size(void) const
Definition: libemf.h:5104
EMF::DATASTREAM::DATASTREAM
DATASTREAM(::FILE *fp=0)
Definition: libemf.h:233
EMF::EMRPOLYGON16
EMF Filled Polygon16.
Definition: libemf.h:3497
EMF::EMRPOLYBEZIERTO16::EMRPOLYBEZIERTO16
EMRPOLYBEZIERTO16(DATASTREAM &ds)
Definition: libemf.h:4298
EMF::EMRSETBKMODE::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:2509
EMF::WCHARSTR::WCHARSTR
WCHARSTR(WCHAR *const string, const int length)
Definition: libemf.h:97
EMF::EMRPOLYLINE::EMRPOLYLINE
EMRPOLYLINE(const RECTL *bounds, const POINT *points, INT n)
Definition: libemf.h:3202
EMF::EMRPOLYGON
EMF Filled Polygon.
Definition: libemf.h:3402
EMF::EMRPOLYBEZIERTO
EMF PolyBezierTo.
Definition: libemf.h:4147
EMF::GLOBALOBJECTS
Definition: libemf.h:1278
EMF::EMREXTTEXTOUTW::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:4925
EMF::EMRCREATEBRUSHINDIRECT
EMF Brush.
Definition: libemf.h:5270
EMF::EMRFILLPATH::EMRFILLPATH
EMRFILLPATH(const RECTL *bounds)
Definition: libemf.h:5514
EMF::EMRPOLYBEZIER16::EMRPOLYBEZIER16
EMRPOLYBEZIER16(DATASTREAM &ds)
Definition: libemf.h:4090
EMF::EMRENDPATH::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:5766
EMF::GLOBALOBJECTS::new_settextcolor
static EMF::METARECORD * new_settextcolor(DATASTREAM &ds)
Create a new SETTEXTCOLOR record.
Definition: libemf.cpp:304
EMF::EMREXTTEXTOUTA::EMREXTTEXTOUTA
EMREXTTEXTOUTA(const RECTL *bounds, DWORD graphicsMode, FLOAT xScale, FLOAT yScale, const PEMRTEXT text, LPCSTR string, const INT *dx)
Definition: libemf.h:4580
EMF::EMREXTTEXTOUTW::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:4908
EMF::DATASTREAM::setStream
void setStream(::FILE *fp)
Definition: libemf.h:238
EMF::INTARRAY::n_
const DWORD n_
Number of ints in array.
Definition: libemf.h:174
EMF::EMRCREATEBRUSHINDIRECT::size
int size(void) const
Definition: libemf.h:5294
EMF::EMRSETMITERLIMIT::EMRSETMITERLIMIT
EMRSETMITERLIMIT(DATASTREAM &ds)
Definition: libemf.h:6200
EMF::EMRDELETEOBJECT
EMF Delete Object.
Definition: libemf.h:2739
EMF::EMRSETTEXTALIGN::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:2308
EMF::EMRPOLYPOLYGON16::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:3887
EMF::EMRPOLYLINETO16::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:4526
EMF::EMRSETWINDOWORGEX::EMRSETWINDOWORGEX
EMRSETWINDOWORGEX(DATASTREAM &ds)
Definition: libemf.h:1815
EMF::EMRSETWINDOWORGEX::EMRSETWINDOWORGEX
EMRSETWINDOWORGEX(INT x, INT y)
Definition: libemf.h:1804
EMF::GLOBALOBJECTS::new_createbrushindirect
static EMF::METARECORD * new_createbrushindirect(DATASTREAM &ds)
Create a new CREATEBRUSHINDIRECT record.
Definition: libemf.cpp:454
EMF::EMRMOVETOEX::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:2821
EMF::METAFILEDEVICECONTEXT::header
ENHMETAHEADER * header
Definition: libemf.h:6349
EMF::EMRCLOSEFIGURE::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:5820
EMF::GLOBALOBJECTS::new_polygon
static EMF::METARECORD * new_polygon(DATASTREAM &ds)
Create a new POLYGON record.
Definition: libemf.cpp:379
EMF::GLOBALOBJECTS::new_rectangle
static EMF::METARECORD * new_rectangle(DATASTREAM &ds)
Create a new RECTANGLE record.
Definition: libemf.cpp:359
EMF::EMRMODIFYWORLDTRANSFORM::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:2165
EMF::EMRSETMETARGN
EMF Set Meta Region.
Definition: libemf.h:5955
EMF::EMRSCALEWINDOWEXTEX::execute
void execute(METAFILEDEVICECONTEXT *source, HDC dc) const
Definition: libemf.h:2102
EMF::GLOBALOBJECTS::add
HGDIOBJ add(OBJECT *object)
Definition: libemf.cpp:180
EMF::GLOBALOBJECTS::new_exttextoutw
static EMF::METARECORD * new_exttextoutw(DATASTREAM &ds)
Create a new EXTTEXTOUTW record.
Definition: libemf.cpp:434
EMF::METAFILEDEVICECONTEXT::handles
std::vector< bool > handles
Definition: libemf.h:6382
EMF::EMRENDPATH
EMF End Path.
Definition: libemf.h:5731
EMF::EMRARC::size
int size(void) const
Definition: libemf.h:2961
EMF::EMRSETTEXTALIGN::serialize
bool serialize(DATASTREAM ds)
Definition: libemf.h:2294
EMF::PALETTE::PALETTE
PALETTE(const LOGPALETTE *lpalette)
Definition: libemf.h:6156
EMF::PALETTE
Graphics Palette.
Definition: libemf.h:6151