]>
git.saurik.com Git - wxWidgets.git/blob - src/palmos/metafile.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: palmos/metafile.cpp
3 // Purpose: wxMetafileDC etc.
4 // Author: William Osborne
8 // Copyright: (c) William Osborne
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
21 #pragma implementation "metafile.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
40 #include "wx/metafile.h"
42 #if wxUSE_METAFILE && !defined(wxMETAFILE_IS_ENH)
44 #include "wx/clipbrd.h"
45 #include "wx/palmos/private.h"
50 // ----------------------------------------------------------------------------
52 // ----------------------------------------------------------------------------
54 IMPLEMENT_DYNAMIC_CLASS(wxMetafile
, wxObject
)
55 IMPLEMENT_ABSTRACT_CLASS(wxMetafileDC
, wxDC
)
57 // ============================================================================
59 // ============================================================================
61 // ----------------------------------------------------------------------------
63 // ----------------------------------------------------------------------------
67 * Currently, the only purpose for making a metafile is to put
68 * it on the clipboard.
71 wxMetafileRefData::wxMetafileRefData()
75 wxMetafileRefData::~wxMetafileRefData()
79 // ----------------------------------------------------------------------------
81 // ----------------------------------------------------------------------------
83 wxMetafile::wxMetafile(const wxString
& file
)
87 wxMetafile::~wxMetafile()
91 bool wxMetafile::SetClipboard(int width
, int height
)
96 bool wxMetafile::Play(wxDC
*dc
)
101 void wxMetafile::SetHMETAFILE(WXHANDLE mf
)
105 void wxMetafile::SetWindowsMappingMode(int mm
)
109 // ----------------------------------------------------------------------------
110 // Metafile device context
111 // ----------------------------------------------------------------------------
113 // Original constructor that does not takes origin and extent. If you use this,
114 // *DO* give origin/extent arguments to wxMakeMetafilePlaceable.
115 wxMetafileDC::wxMetafileDC(const wxString
& file
)
119 // New constructor that takes origin and extent. If you use this, don't
120 // give origin/extent arguments to wxMakeMetafilePlaceable.
121 wxMetafileDC::wxMetafileDC(const wxString
& file
, int xext
, int yext
, int xorg
, int yorg
)
125 wxMetafileDC::~wxMetafileDC()
129 void wxMetafileDC::GetTextExtent(const wxString
& string
, long *x
, long *y
,
130 long *descent
, long *externalLeading
, wxFont
*theFont
, bool WXUNUSED(use16bit
)) const
134 wxMetafile
*wxMetafileDC::Close()
139 void wxMetafileDC::SetMapMode(int mode
)
143 // ----------------------------------------------------------------------------
144 // wxMakeMetafilePlaceable
145 // ----------------------------------------------------------------------------
155 struct mfPLACEABLEHEADER
{
164 struct mfPLACEABLEHEADER
{
175 * Pass filename of existing non-placeable metafile, and bounding box.
176 * Adds a placeable metafile header, sets the mapping mode to anisotropic,
177 * and sets the window origin and extent to mimic the wxMM_TEXT mapping mode.
181 bool wxMakeMetafilePlaceable(const wxString
& filename
, float scale
)
186 bool wxMakeMetafilePlaceable(const wxString
& filename
, int x1
, int y1
, int x2
, int y2
, float scale
, bool useOriginAndExtent
)
192 #if wxUSE_DRAG_AND_DROP
194 // ----------------------------------------------------------------------------
195 // wxMetafileDataObject
196 // ----------------------------------------------------------------------------
198 size_t wxMetafileDataObject::GetDataSize() const
203 bool wxMetafileDataObject::GetDataHere(void *buf
) const
208 bool wxMetafileDataObject::SetData(size_t WXUNUSED(len
), const void *buf
)
213 #endif // wxUSE_DRAG_AND_DROP
215 #endif // wxUSE_METAFILE