.TH "EMF::METAFILEDEVICECONTEXT" 3 "Wed Jun 29 2022" "Version 1.0.9" "libemf" \" -*- nroff -*- .ad l .nh .SH NAME EMF::METAFILEDEVICECONTEXT \- Graphics Device Context\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBEMF::OBJECT\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBMETAFILEDEVICECONTEXT\fP (FILE *fp_, const RECT *size, LPCWSTR description_w)" .br .ti -1c .RI "virtual \fB~METAFILEDEVICECONTEXT\fP ()" .br .ti -1c .RI "OBJECTTYPE \fBgetType\fP (void) const" .br .ti -1c .RI "DWORD \fBnextHandle\fP (void)" .br .ti -1c .RI "void \fBclearHandle\fP (DWORD \fBhandle\fP)" .br .ti -1c .RI "void \fBappendRecord\fP (\fBMETARECORD\fP *record)" .br .ti -1c .RI "void \fBappendHandle\fP (\fBMETARECORD\fP *record)" .br .ti -1c .RI "void \fBdeleteMetafile\fP (void)" .br .ti -1c .RI "void \fBmergePoint\fP (const LONG &x, const LONG &y)" .br .ti -1c .RI "void \fBmergePoint\fP (const POINT &p)" .br .in -1c .SS "Data Fields" .in +1c .ti -1c .RI "::FILE * \fBfp\fP" .br .ti -1c .RI "\fBDATASTREAM\fP \fBds\fP" .br .ti -1c .RI "\fBENHMETAHEADER\fP * \fBheader\fP" .br .ti -1c .RI "std::vector< \fBEMF::METARECORD\fP * > \fBrecords\fP" .br .ti -1c .RI "SIZEL \fBresolution\fP" .br .RI "The resolution in DPI of the \fIreference\fP DC\&. " .ti -1c .RI "SIZEL \fBviewport_ext\fP" .br .RI "The extent of the viewport\&. " .ti -1c .RI "POINT \fBviewport_org\fP" .br .RI "The origin of the viewport\&. " .ti -1c .RI "SIZEL \fBwindow_ext\fP" .br .RI "The extent of the window\&. " .ti -1c .RI "POINT \fBwindow_org\fP" .br .RI "The origin of the window\&. " .ti -1c .RI "bool \fBupdate_frame\fP" .br .RI "Update the frame automatically? " .ti -1c .RI "POINT \fBmin_device_point\fP" .br .RI "The lft/top-most painted point in device units\&. " .ti -1c .RI "POINT \fBmax_device_point\fP" .br .RI "The rgt/btm-most painted point in device units\&. " .ti -1c .RI "POINT \fBpoint\fP" .br .RI "The current point\&. " .ti -1c .RI "\fBPEN\fP * \fBpen\fP" .br .RI "The current pen\&. " .ti -1c .RI "\fBBRUSH\fP * \fBbrush\fP" .br .RI "The current brush\&. " .ti -1c .RI "\fBFONT\fP * \fBfont\fP" .br .RI "The current font\&. " .ti -1c .RI "\fBPALETTE\fP * \fBpalette\fP" .br .RI "The current palette\&. " .ti -1c .RI "UINT \fBtext_alignment\fP" .br .RI "The current text alignment\&. " .ti -1c .RI "COLORREF \fBtext_color\fP" .br .RI "The current text foreground color\&. " .ti -1c .RI "COLORREF \fBbk_color\fP" .br .RI "The current background color\&. " .ti -1c .RI "INT \fBbk_mode\fP" .br .RI "The current background mode\&. " .ti -1c .RI "INT \fBpolyfill_mode\fP" .br .RI "The current polygon fill mode\&. " .ti -1c .RI "INT \fBmap_mode\fP" .br .RI "The current mapping mode\&. " .ti -1c .RI "FLOAT \fBmiter_limit\fP" .br .RI "The current miter length limit\&. " .ti -1c .RI "std::vector< bool > \fBhandles\fP" .br .ti -1c .RI "std::map< HGDIOBJ, HGDIOBJ > \fBemf_handles\fP" .br .in -1c .SH "Detailed Description" .PP Graphics Device Context\&. Almost all GDI graphics calls require a device context (except those which create graphics objects such as pens and fonts)\&. This is a specific context which renders to a metafile\&. There is a one-to-one correspondence between the device context and the metafile\&. .SH "Constructor & Destructor Documentation" .PP .SS "EMF::METAFILEDEVICECONTEXT::METAFILEDEVICECONTEXT (FILE * fp_, const RECT * size, LPCWSTR description_w)\fC [inline]\fP" Most graphics programs seem to want to handle the opening and closing of files themselves, so this is an extension to the w32 interface\&. .PP \fBParameters\fP .RS 4 \fIfp_\fP stdio pointer to an open file\&. May be null\&. .br \fIsize\fP the rectangle describing the position and size of the metafile on the 'page'\&. May be null\&. .br \fIdescription_w\fP a UNICODE string describing the metafile\&. The format must be 'some text\\0some more text\\0\\0'\&. May be null\&. .RE .PP .SS "virtual EMF::METAFILEDEVICECONTEXT::~METAFILEDEVICECONTEXT ()\fC [inline]\fP, \fC [virtual]\fP" Destructor frees all the graphics objects which may have been allocated\&. Now, it also frees any metarecords which it might hold, too\&. .PP References deleteMetafile(), and records\&. .SH "Member Function Documentation" .PP .SS "void EMF::METAFILEDEVICECONTEXT::appendHandle (\fBMETARECORD\fP * record)\fC [inline]\fP" Add this record to the metafile\&. .PP \fBParameters\fP .RS 4 \fIrecord\fP this record is an object so it increments the handle count as well\&. .RE .PP .PP References header, records, and EMF::METARECORD::size()\&. .SS "void EMF::METAFILEDEVICECONTEXT::appendRecord (\fBMETARECORD\fP * record)\fC [inline]\fP" Add this record to the metafile\&. .PP \fBParameters\fP .RS 4 \fIrecord\fP standard graphics record .RE .PP .PP References header, records, and EMF::METARECORD::size()\&. .SS "void EMF::METAFILEDEVICECONTEXT::clearHandle (DWORD handle)\fC [inline]\fP" Clear the usage of this handle .PP References EMF::OBJECT::handle, and handles\&. .SS "void EMF::METAFILEDEVICECONTEXT::deleteMetafile (void)\fC [inline]\fP" Delete all the records from the metafile\&. This would seem to include deleting the header record as well\&. .PP References records\&. .PP Referenced by ~METAFILEDEVICECONTEXT()\&. .SS "OBJECTTYPE EMF::METAFILEDEVICECONTEXT::getType (void) const\fC [inline]\fP, \fC [virtual]\fP" Return the type of this object (could probably do better with RTTI())\&. .PP Implements \fBEMF::OBJECT\fP\&. .SS "void EMF::METAFILEDEVICECONTEXT::mergePoint (const LONG & x, const LONG & y)\fC [inline]\fP" Somewhat superfluous, except checker doesn't understand the initialization of automatic structures in the declaration\&. .SS "void EMF::METAFILEDEVICECONTEXT::mergePoint (const POINT & p)\fC [inline]\fP" Take the given point and determine if it enlarges the 'painted' area of the device\&. .PP References header, max_device_point, min_device_point, update_frame, viewport_ext, viewport_org, window_ext, and window_org\&. .SS "DWORD EMF::METAFILEDEVICECONTEXT::nextHandle (void)\fC [inline]\fP" Scan the bit vector of used handles and return the index of the first free bit as this objects metafile handle\&. .PP References handles, and header\&. .SH "Field Documentation" .PP .SS "\fBDATASTREAM\fP EMF::METAFILEDEVICECONTEXT::ds" All i/o to the metafile is wrapped by this class so that byte swapping on big-endian machines is transparent\&. .SS "std::map< HGDIOBJ, HGDIOBJ > EMF::METAFILEDEVICECONTEXT::emf_handles" This map holds the \fIcurrent\fP mapping between EMF handles and global object handles as a metafile is played back (with PlayEnhMetaFile)\&. .PP Referenced by EMF::EMRSELECTOBJECT::execute(), EMF::EMRDELETEOBJECT::execute(), EMF::EMRCREATEPEN::execute(), EMF::EMREXTCREATEPEN::execute(), EMF::EMRCREATEBRUSHINDIRECT::execute(), and EMF::EMREXTCREATEFONTINDIRECTW::execute()\&. .SS "::FILE* EMF::METAFILEDEVICECONTEXT::fp" If it is a file-based metafile, then this pointer is not null\&. .SS "std::vector< bool > EMF::METAFILEDEVICECONTEXT::handles" For compatibility, it appears that metafile handles are reused as objects are deleted\&. Attempt to emulate that behavior with a bit vector of used metafile handles\&. .PP Referenced by clearHandle(), and nextHandle()\&. .SS "\fBENHMETAHEADER\fP* EMF::METAFILEDEVICECONTEXT::header" Serves double duty as the physical device description\&. .PP Referenced by appendHandle(), appendRecord(), mergePoint(), and nextHandle()\&. .SS "std::vector< \fBEMF::METARECORD\fP* > EMF::METAFILEDEVICECONTEXT::records" All of the metafile records are stored in memory\&. .PP Referenced by appendHandle(), appendRecord(), deleteMetafile(), and ~METAFILEDEVICECONTEXT()\&. .SH "Author" .PP Generated automatically by Doxygen for libemf from the source code\&.