]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/metafile.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxMetaFile, wxMetaFileDC classes.
4 // This probably should be restricted to Windows platforms,
5 // but if there is an equivalent on your platform, great.
10 // Copyright: (c) AUTHOR
11 // Licence: wxWindows licence
12 /////////////////////////////////////////////////////////////////////////////
15 #ifndef _WX_METAFIILE_H_
16 #define _WX_METAFIILE_H_
19 #pragma interface "metafile.h"
26 * Metafile and metafile device context classes - work in Windows 3.1 only
30 class WXDLLEXPORT wxDC
;
31 class WXDLLEXPORT wxMetaFile
: public wxObject
33 DECLARE_DYNAMIC_CLASS(wxMetaFile
)
35 wxMetaFile(const wxString
& file
= "");
38 // After this is called, the metafile cannot be used for anything
39 // since it is now owned by the clipboard.
40 virtual bool SetClipboard(int width
= 0, int height
= 0);
42 virtual bool Play(wxDC
*dc
);
44 inline bool Ok() { return FALSE
; };
46 /* TODO: Implementation
47 inline WXHANDLE GetHMETAFILE() { return m_metaFile; }
48 inline void SetHMETAFILE(WXHANDLE mf) { m_metaFile = mf; }
55 class WXDLLEXPORT wxMetaFileDC
: public wxDC
57 DECLARE_DYNAMIC_CLASS(wxMetaFileDC
)
60 // Don't supply origin and extent
61 // Supply them to wxMakeMetaFilePlaceable instead.
62 wxMetaFileDC(const wxString
& file
= "");
64 // Supply origin and extent (recommended).
65 // Then don't need to supply them to wxMakeMetaFilePlaceable.
66 wxMetaFileDC(const wxString
& file
, int xext
, int yext
, int xorg
, int yorg
);
70 // Should be called at end of drawing
71 virtual wxMetaFile
*Close();
72 virtual void SetMapMode(int mode
);
73 virtual void GetTextExtent(const wxString
& string
, float *x
, float *y
,
74 float *descent
= NULL
, float *externalLeading
= NULL
,
75 wxFont
*theFont
= NULL
, bool use16bit
= FALSE
);
78 inline wxMetaFile
*GetMetaFile() { return m_metaFile
; }
79 inline void SetMetaFile(wxMetaFile
*mf
) { m_metaFile
= mf
; }
80 inline int GetWindowsMappingMode() { return m_windowsMappingMode
; }
81 inline void SetWindowsMappingMode(int mm
) { m_windowsMappingMode
= mm
; }
84 int m_windowsMappingMode
;
85 wxMetaFile
*m_metaFile
;
89 * Pass filename of existing non-placeable metafile, and bounding box.
90 * Adds a placeable metafile header, sets the mapping mode to anisotropic,
91 * and sets the window origin and extent to mimic the wxMM_TEXT mapping mode.
95 // No origin or extent
96 bool WXDLLEXPORT
wxMakeMetaFilePlaceable(const wxString
& filename
, float scale
= 1.0);
98 // Optional origin and extent
99 bool WXDLLEXPORT
wxMakeMetaFilePlaceable(const wxString
& filename
, int x1
, int y1
, int x2
, int y2
, float scale
= 1.0, bool useOriginAndExtent
= TRUE
);