]>
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
, wxFont
*theFont
, bool WXUNUSED(use16bit
)) const
126 wxMetafile
*wxMetafileDC::Close()
131 void wxMetafileDC::SetMapMode(int mode
)
135 // ----------------------------------------------------------------------------
136 // wxMakeMetafilePlaceable
137 // ----------------------------------------------------------------------------
138 struct mfPLACEABLEHEADER
{
148 * Pass filename of existing non-placeable metafile, and bounding box.
149 * Adds a placeable metafile header, sets the mapping mode to anisotropic,
150 * and sets the window origin and extent to mimic the wxMM_TEXT mapping mode.
154 bool wxMakeMetafilePlaceable(const wxString
& filename
, float scale
)
159 bool wxMakeMetafilePlaceable(const wxString
& filename
, int x1
, int y1
, int x2
, int y2
, float scale
, bool useOriginAndExtent
)
165 #if wxUSE_DRAG_AND_DROP
167 // ----------------------------------------------------------------------------
168 // wxMetafileDataObject
169 // ----------------------------------------------------------------------------
171 size_t wxMetafileDataObject::GetDataSize() const
176 bool wxMetafileDataObject::GetDataHere(void *buf
) const
181 bool wxMetafileDataObject::SetData(size_t WXUNUSED(len
), const void *buf
)
186 #endif // wxUSE_DRAG_AND_DROP
188 #endif // wxUSE_METAFILE