X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8cf73271dd6f442a98e86b559d4a55c37e25b99f..8a7e4b38b8fa4d31b805a0cf1779a9b95142f05b:/include/wx/mac/carbon/metafile.h diff --git a/include/wx/mac/carbon/metafile.h b/include/wx/mac/carbon/metafile.h index 2b528efeca..da46526593 100644 --- a/include/wx/mac/carbon/metafile.h +++ b/include/wx/mac/carbon/metafile.h @@ -15,7 +15,6 @@ #ifndef _WX_METAFIILE_H_ #define _WX_METAFIILE_H_ -#if wxUSE_METAFILE #include "wx/dc.h" #include "wx/gdiobj.h" @@ -32,17 +31,7 @@ #define wxMetaFileDC wxMetafileDC class WXDLLEXPORT wxMetafile; - -class WXDLLEXPORT wxMetafileRefData: public wxGDIRefData -{ - friend class WXDLLEXPORT wxMetafile; -public: - wxMetafileRefData(void); - ~wxMetafileRefData(void); - -public: - WXHMETAFILE m_metafile; -}; +class wxMetafileRefData ; #define M_METAFILEDATA ((wxMetafileRefData *)m_refData) @@ -50,35 +39,24 @@ class WXDLLEXPORT wxMetafile: public wxGDIObject { DECLARE_DYNAMIC_CLASS(wxMetafile) public: - // Copy constructor - wxMetafile(const wxMetafile& metafile) - : wxGDIObject() - { Ref(metafile); } - wxMetafile(const wxString& file = wxEmptyString); - ~wxMetafile(void); + virtual ~wxMetafile(void); // After this is called, the metafile cannot be used for anything // since it is now owned by the clipboard. virtual bool SetClipboard(int width = 0, int height = 0); virtual bool Play(wxDC *dc); - inline bool Ok(void) const { return (M_METAFILEDATA && (M_METAFILEDATA->m_metafile != 0)); }; + bool Ok() const { return IsOk(); } + bool IsOk() const ; wxSize GetSize() const; int GetWidth() const { return GetSize().x; } int GetHeight() const { return GetSize().y; } // Implementation - inline WXHMETAFILE GetHMETAFILE() const { return M_METAFILEDATA->m_metafile; } + WXHMETAFILE GetHMETAFILE() const ; void SetHMETAFILE(WXHMETAFILE mf) ; - - // Operators - inline wxMetafile& operator = (const wxMetafile& metafile) { if (*this == metafile) return (*this); Ref(metafile); return *this; } - inline bool operator == (const wxMetafile& metafile) { return m_refData == metafile.m_refData; } - inline bool operator != (const wxMetafile& metafile) { return m_refData != metafile.m_refData; } - -protected: }; class WXDLLEXPORT wxMetafileDC: public wxDC @@ -92,17 +70,18 @@ class WXDLLEXPORT wxMetafileDC: public wxDC int width = 0, int height = 0, const wxString& description = wxEmptyString); - ~wxMetafileDC(void); + virtual ~wxMetafileDC(void); // Should be called at end of drawing virtual wxMetafile *Close(void); - virtual void DoGetSize(int *width, int *height) const ; // Implementation inline wxMetafile *GetMetaFile(void) const { return m_metaFile; } inline void SetMetaFile(wxMetafile *mf) { m_metaFile = mf; } protected: + virtual void DoGetSize(int *width, int *height) const; + wxMetafile* m_metaFile; }; @@ -159,8 +138,5 @@ protected: }; #endif -#endif // wxUSE_METAFILE - - #endif // _WX_METAFIILE_H_