1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/palmos/enhmeta.cpp
3 // Purpose: implementation of wxEnhMetaFileXXX classes
4 // Author: William Osborne - minimal working wxPalmOS port
8 // Copyright: (c) William Osborne
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 // For compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
27 #if wxUSE_ENH_METAFILE
30 #include "wx/string.h"
34 #include "wx/metafile.h"
35 #include "wx/clipbrd.h"
37 #include "wx/palmos/private.h"
39 // ----------------------------------------------------------------------------
41 // ----------------------------------------------------------------------------
43 IMPLEMENT_DYNAMIC_CLASS(wxEnhMetaFile
, wxObject
)
44 IMPLEMENT_ABSTRACT_CLASS(wxEnhMetaFileDC
, wxDC
)
46 // ----------------------------------------------------------------------------
48 // ----------------------------------------------------------------------------
50 #define GetEMF() ((HENHMETAFILE)m_hMF)
51 #define GetEMFOf(mf) ((HENHMETAFILE)((mf).m_hMF))
53 // ----------------------------------------------------------------------------
55 // ----------------------------------------------------------------------------
57 // we must pass NULL if the string is empty to metafile functions
58 static inline const wxChar
*GetMetaFileName(const wxString
& fn
)
59 { return !fn
? NULL
: fn
.c_str(); }
61 // ============================================================================
63 // ============================================================================
65 // ----------------------------------------------------------------------------
67 // ----------------------------------------------------------------------------
69 void wxEnhMetaFile::Assign(const wxEnhMetaFile
& mf
)
73 void wxEnhMetaFile::Free()
77 bool wxEnhMetaFile::Play(wxDC
*dc
, wxRect
*rectBound
)
82 wxSize
wxEnhMetaFile::GetSize() const
84 wxSize size
= wxDefaultSize
;
89 bool wxEnhMetaFile::SetClipboard(int WXUNUSED(width
), int WXUNUSED(height
))
94 // ----------------------------------------------------------------------------
96 // ----------------------------------------------------------------------------
98 wxEnhMetaFileDC::wxEnhMetaFileDC(const wxString
& filename
,
99 int width
, int height
,
100 const wxString
& description
)
104 wxEnhMetaFile
*wxEnhMetaFileDC::Close()
109 wxEnhMetaFileDC::~wxEnhMetaFileDC()
113 #if wxUSE_DRAG_AND_DROP
115 // ----------------------------------------------------------------------------
116 // wxEnhMetaFileDataObject
117 // ----------------------------------------------------------------------------
120 wxEnhMetaFileDataObject::GetPreferredFormat(Direction
WXUNUSED(dir
)) const
122 return wxDF_ENHMETAFILE
;
125 size_t wxEnhMetaFileDataObject::GetFormatCount(Direction
WXUNUSED(dir
)) const
127 // wxDF_ENHMETAFILE and wxDF_METAFILE
131 void wxEnhMetaFileDataObject::GetAllFormats(wxDataFormat
*formats
,
132 Direction
WXUNUSED(dir
)) const
136 size_t wxEnhMetaFileDataObject::GetDataSize(const wxDataFormat
& format
) const
141 bool wxEnhMetaFileDataObject::GetDataHere(const wxDataFormat
& format
, void *buf
) const
146 bool wxEnhMetaFileDataObject::SetData(const wxDataFormat
& format
,
147 size_t WXUNUSED(len
),
153 // ----------------------------------------------------------------------------
154 // wxEnhMetaFileSimpleDataObject
155 // ----------------------------------------------------------------------------
157 size_t wxEnhMetaFileSimpleDataObject::GetDataSize() const
162 bool wxEnhMetaFileSimpleDataObject::GetDataHere(void *buf
) const
167 bool wxEnhMetaFileSimpleDataObject::SetData(size_t WXUNUSED(len
),
174 #endif // wxUSE_DRAG_AND_DROP
176 #endif // wxUSE_ENH_METAFILE