API adaptions to MSW EnhMetafile
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26058 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -48,31 +48,35 @@ public:
|
|||||||
|
|
||||||
class WXDLLEXPORT wxMetafile: public wxGDIObject
|
class WXDLLEXPORT wxMetafile: public wxGDIObject
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxMetafile)
|
DECLARE_DYNAMIC_CLASS(wxMetafile)
|
||||||
public:
|
public:
|
||||||
// Copy constructor
|
// Copy constructor
|
||||||
wxMetafile(const wxMetafile& metafile)
|
wxMetafile(const wxMetafile& metafile)
|
||||||
: wxGDIObject()
|
: wxGDIObject()
|
||||||
{ Ref(metafile); }
|
{ Ref(metafile); }
|
||||||
|
|
||||||
wxMetafile(const wxString& file = wxEmptyString);
|
wxMetafile(const wxString& file = wxEmptyString);
|
||||||
~wxMetafile(void);
|
~wxMetafile(void);
|
||||||
|
|
||||||
// After this is called, the metafile cannot be used for anything
|
// After this is called, the metafile cannot be used for anything
|
||||||
// since it is now owned by the clipboard.
|
// since it is now owned by the clipboard.
|
||||||
virtual bool SetClipboard(int width = 0, int height = 0);
|
virtual bool SetClipboard(int width = 0, int height = 0);
|
||||||
|
|
||||||
virtual bool Play(wxDC *dc);
|
virtual bool Play(wxDC *dc);
|
||||||
inline bool Ok(void) const { return (M_METAFILEDATA && (M_METAFILEDATA->m_metafile != 0)); };
|
inline bool Ok(void) const { return (M_METAFILEDATA && (M_METAFILEDATA->m_metafile != 0)); };
|
||||||
|
|
||||||
// Implementation
|
wxSize GetSize() const;
|
||||||
inline WXHMETAFILE GetHMETAFILE(void) { return M_METAFILEDATA->m_metafile; }
|
int GetWidth() const { return GetSize().x; }
|
||||||
void SetHMETAFILE(WXHMETAFILE mf) ;
|
int GetHeight() const { return GetSize().y; }
|
||||||
|
|
||||||
// Operators
|
// Implementation
|
||||||
inline wxMetafile& operator = (const wxMetafile& metafile) { if (*this == metafile) return (*this); Ref(metafile); return *this; }
|
inline WXHMETAFILE GetHMETAFILE() const { return M_METAFILEDATA->m_metafile; }
|
||||||
inline bool operator == (const wxMetafile& metafile) { return m_refData == metafile.m_refData; }
|
void SetHMETAFILE(WXHMETAFILE mf) ;
|
||||||
inline bool operator != (const wxMetafile& metafile) { return m_refData != metafile.m_refData; }
|
|
||||||
|
// 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:
|
protected:
|
||||||
};
|
};
|
||||||
@@ -82,18 +86,17 @@ class WXDLLEXPORT wxMetafileDC: public wxDC
|
|||||||
DECLARE_DYNAMIC_CLASS(wxMetafileDC)
|
DECLARE_DYNAMIC_CLASS(wxMetafileDC)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Don't supply origin and extent
|
// the ctor parameters specify the filename (empty for memory metafiles),
|
||||||
// Supply them to wxMakeMetaFilePlaceable instead.
|
// the metafile picture size and the optional description/comment
|
||||||
wxMetafileDC(const wxString& file = wxEmptyString);
|
wxMetafileDC(const wxString& filename = wxEmptyString,
|
||||||
|
int width = 0, int height = 0,
|
||||||
// Supply origin and extent (recommended).
|
const wxString& description = wxEmptyString);
|
||||||
// Then don't need to supply them to wxMakeMetaFilePlaceable.
|
|
||||||
wxMetafileDC(const wxString& file, int xext, int yext, int xorg, int yorg);
|
|
||||||
|
|
||||||
~wxMetafileDC(void);
|
~wxMetafileDC(void);
|
||||||
|
|
||||||
// Should be called at end of drawing
|
// Should be called at end of drawing
|
||||||
virtual wxMetafile *Close(void);
|
virtual wxMetafile *Close(void);
|
||||||
|
virtual void DoGetSize(int *width, int *height) const ;
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
inline wxMetafile *GetMetaFile(void) const { return m_metaFile; }
|
inline wxMetafile *GetMetaFile(void) const { return m_metaFile; }
|
||||||
@@ -143,6 +146,14 @@ public:
|
|||||||
virtual bool GetDataHere(void *buf) const;
|
virtual bool GetDataHere(void *buf) const;
|
||||||
virtual bool SetData(size_t len, const void *buf);
|
virtual bool SetData(size_t len, const void *buf);
|
||||||
|
|
||||||
|
virtual size_t GetDataSize(const wxDataFormat& WXUNUSED(format)) const
|
||||||
|
{ return GetDataSize(); }
|
||||||
|
virtual bool GetDataHere(const wxDataFormat& WXUNUSED(format),
|
||||||
|
void *buf) const
|
||||||
|
{ return GetDataHere(buf); }
|
||||||
|
virtual bool SetData(const wxDataFormat& WXUNUSED(format),
|
||||||
|
size_t len, const void *buf)
|
||||||
|
{ return SetData(len, buf); }
|
||||||
protected:
|
protected:
|
||||||
wxMetafile m_metafile;
|
wxMetafile m_metafile;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user