X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dbe4a80c57a77b249ef32117efe9fd923066f958..6cef0db28018fd2644ee4e38af715872e5242459:/src/mac/carbon/metafile.cpp?ds=inline diff --git a/src/mac/carbon/metafile.cpp b/src/mac/carbon/metafile.cpp index 7d09ee1033..73d5b77f9a 100644 --- a/src/mac/carbon/metafile.cpp +++ b/src/mac/carbon/metafile.cpp @@ -37,17 +37,25 @@ IMPLEMENT_ABSTRACT_CLASS(wxMetafileDCImpl, wxGCDCImpl) #define M_METAFILEREFDATA( a ) ((wxMetafileRefData*)(a).GetRefData()) -class wxMetafileRefData: public wxGDIRefData +class wxMetafileRefData : public wxGDIRefData { public: + // default ctor needed for CreateGDIRefData(), must be initialized later + wxMetafileRefData() { Init(); } + // creates a metafile from memory, assumes ownership wxMetafileRefData(CFDataRef data); + // prepares a recording metafile wxMetafileRefData( int width, int height); + // prepares a metafile to be read from a file (if filename is not empty) wxMetafileRefData( const wxString& filename); + virtual ~wxMetafileRefData(); + virtual bool IsOk() const { return m_data != NULL; } + void Init(); int GetWidth() const { return m_width; } @@ -162,9 +170,14 @@ wxMetaFile::~wxMetaFile() { } -bool wxMetaFile::IsOk() const +wxGDIRefData *wxMetaFile::CreateGDIRefData() const +{ + return new wxMetafileRefData; +} + +wxGDIRefData *wxMetaFile::CloneGDIRefData(const wxGDIRefData *data) const { - return (M_METAFILEDATA && (M_METAFILEDATA->GetData() != NULL)); + return new wxMetafileRefData(*wx_static_cast(const wxMetafileRefData *, data)); } WXHMETAFILE wxMetaFile::GetHMETAFILE() const