]>
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"
36 #include "wx/metafile.h"
38 #if wxUSE_METAFILE && !defined(wxMETAFILE_IS_ENH)
40 #include "wx/clipbrd.h"
41 #include "wx/palmos/private.h"
46 // ----------------------------------------------------------------------------
48 // ----------------------------------------------------------------------------
50 IMPLEMENT_DYNAMIC_CLASS(wxMetafile
, wxObject
)
51 IMPLEMENT_ABSTRACT_CLASS(wxMetafileDC
, wxDC
)
53 // ============================================================================
55 // ============================================================================
57 // ----------------------------------------------------------------------------
59 // ----------------------------------------------------------------------------
63 * Currently, the only purpose for making a metafile is to put
64 * it on the clipboard.
67 wxMetafileRefData::wxMetafileRefData()
71 wxMetafileRefData::~wxMetafileRefData()
75 // ----------------------------------------------------------------------------
77 // ----------------------------------------------------------------------------
79 wxMetafile::wxMetafile(const wxString
& file
)
83 wxMetafile::~wxMetafile()
87 bool wxMetafile::SetClipboard(int width
, int height
)
92 bool wxMetafile::Play(wxDC
*dc
)
97 void wxMetafile::SetHMETAFILE(WXHANDLE mf
)
101 void wxMetafile::SetWindowsMappingMode(int mm
)
105 // ----------------------------------------------------------------------------
106 // Metafile device context
107 // ----------------------------------------------------------------------------
109 // Original constructor that does not takes origin and extent. If you use this,
110 // *DO* give origin/extent arguments to wxMakeMetafilePlaceable.
111 wxMetafileDC::wxMetafileDC(const wxString
& file
)
115 // New constructor that takes origin and extent. If you use this, don't
116 // give origin/extent arguments to wxMakeMetafilePlaceable.
117 wxMetafileDC::wxMetafileDC(const wxString
& file
, int xext
, int yext
, int xorg
, int yorg
)
121 wxMetafileDC::~wxMetafileDC()
125 void wxMetafileDC::GetTextExtent(const wxString
& string
, long *x
, long *y
,
126 long *descent
, long *externalLeading
, wxFont
*theFont
, bool WXUNUSED(use16bit
)) const
130 wxMetafile
*wxMetafileDC::Close()
135 void wxMetafileDC::SetMapMode(int mode
)
139 // ----------------------------------------------------------------------------
140 // wxMakeMetafilePlaceable
141 // ----------------------------------------------------------------------------
142 struct mfPLACEABLEHEADER
{
152 * Pass filename of existing non-placeable metafile, and bounding box.
153 * Adds a placeable metafile header, sets the mapping mode to anisotropic,
154 * and sets the window origin and extent to mimic the wxMM_TEXT mapping mode.
158 bool wxMakeMetafilePlaceable(const wxString
& filename
, float scale
)
163 bool wxMakeMetafilePlaceable(const wxString
& filename
, int x1
, int y1
, int x2
, int y2
, float scale
, bool useOriginAndExtent
)
169 #if wxUSE_DRAG_AND_DROP
171 // ----------------------------------------------------------------------------
172 // wxMetafileDataObject
173 // ----------------------------------------------------------------------------
175 size_t wxMetafileDataObject::GetDataSize() const
180 bool wxMetafileDataObject::GetDataHere(void *buf
) const
185 bool wxMetafileDataObject::SetData(size_t WXUNUSED(len
), const void *buf
)
190 #endif // wxUSE_DRAG_AND_DROP
192 #endif // wxUSE_METAFILE