]>
git.saurik.com Git - wxWidgets.git/blob - src/palmos/metafile.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/palmos/metafile.cpp
3 // Purpose: wxMetafileDC etc.
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"
32 #include "wx/metafile.h"
34 #if wxUSE_METAFILE && !defined(wxMETAFILE_IS_ENH)
36 #include "wx/clipbrd.h"
37 #include "wx/palmos/private.h"
42 // ----------------------------------------------------------------------------
44 // ----------------------------------------------------------------------------
46 IMPLEMENT_DYNAMIC_CLASS(wxMetafile
, wxObject
)
47 IMPLEMENT_ABSTRACT_CLASS(wxMetafileDC
, wxDC
)
49 // ============================================================================
51 // ============================================================================
53 // ----------------------------------------------------------------------------
55 // ----------------------------------------------------------------------------
59 * Currently, the only purpose for making a metafile is to put
60 * it on the clipboard.
63 wxMetafileRefData::wxMetafileRefData()
67 wxMetafileRefData::~wxMetafileRefData()
71 // ----------------------------------------------------------------------------
73 // ----------------------------------------------------------------------------
75 wxMetafile::wxMetafile(const wxString
& file
)
79 wxMetafile::~wxMetafile()
83 bool wxMetafile::SetClipboard(int width
, int height
)
88 bool wxMetafile::Play(wxDC
*dc
)
93 void wxMetafile::SetHMETAFILE(WXHANDLE mf
)
97 void wxMetafile::SetWindowsMappingMode(int mm
)
101 // ----------------------------------------------------------------------------
102 // Metafile device context
103 // ----------------------------------------------------------------------------
105 // Original constructor that does not takes origin and extent. If you use this,
106 // *DO* give origin/extent arguments to wxMakeMetafilePlaceable.
107 wxMetafileDC::wxMetafileDC(const wxString
& file
)
111 // New constructor that takes origin and extent. If you use this, don't
112 // give origin/extent arguments to wxMakeMetafilePlaceable.
113 wxMetafileDC::wxMetafileDC(const wxString
& file
, int xext
, int yext
, int xorg
, int yorg
)
117 wxMetafileDC::~wxMetafileDC()
121 void wxMetafileDC::GetTextExtent(const wxString
& string
, long *x
, long *y
,
122 long *descent
, long *externalLeading
,
123 const wxFont
*theFont
, bool WXUNUSED(use16bit
)) const
127 wxMetafile
*wxMetafileDC::Close()
132 void wxMetafileDC::SetMapMode(wxMappingMode mode
)
136 // ----------------------------------------------------------------------------
137 // wxMakeMetafilePlaceable
138 // ----------------------------------------------------------------------------
139 struct mfPLACEABLEHEADER
{
149 * Pass filename of existing non-placeable metafile, and bounding box.
150 * Adds a placeable metafile header, sets the mapping mode to anisotropic,
151 * and sets the window origin and extent to mimic the wxMM_TEXT mapping mode.
155 bool wxMakeMetafilePlaceable(const wxString
& filename
, float scale
)
160 bool wxMakeMetafilePlaceable(const wxString
& filename
, int x1
, int y1
, int x2
, int y2
, float scale
, bool useOriginAndExtent
)
166 #if wxUSE_DRAG_AND_DROP
168 // ----------------------------------------------------------------------------
169 // wxMetafileDataObject
170 // ----------------------------------------------------------------------------
172 size_t wxMetafileDataObject::GetDataSize() const
177 bool wxMetafileDataObject::GetDataHere(void *buf
) const
182 bool wxMetafileDataObject::SetData(size_t WXUNUSED(len
), const void *buf
)
187 #endif // wxUSE_DRAG_AND_DROP
189 #endif // wxUSE_METAFILE