]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/stubs/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"
25 * Metafile and metafile device context classes - work in Windows 3.1 only
29 class WXDLLEXPORT wxDC
;
30 class WXDLLEXPORT wxMetaFile
: public wxObject
32 DECLARE_DYNAMIC_CLASS(wxMetaFile
)
34 wxMetaFile(const wxString
& file
= "");
37 // After this is called, the metafile cannot be used for anything
38 // since it is now owned by the clipboard.
39 virtual bool SetClipboard(int width
= 0, int height
= 0);
41 virtual bool Play(wxDC
*dc
);
43 inline bool Ok() { return FALSE
; };
45 /* TODO: Implementation
46 inline WXHANDLE GetHMETAFILE() { return m_metaFile; }
47 inline void SetHMETAFILE(WXHANDLE mf) { m_metaFile = mf; }
54 class WXDLLEXPORT wxMetaFileDC
: public wxDC
56 DECLARE_DYNAMIC_CLASS(wxMetaFileDC
)
59 // Don't supply origin and extent
60 // Supply them to wxMakeMetaFilePlaceable instead.
61 wxMetaFileDC(const wxString
& file
= "");
63 // Supply origin and extent (recommended).
64 // Then don't need to supply them to wxMakeMetaFilePlaceable.
65 wxMetaFileDC(const wxString
& file
, int xext
, int yext
, int xorg
, int yorg
);
69 // Should be called at end of drawing
70 virtual wxMetaFile
*Close();
71 virtual void SetMapMode(int mode
);
72 virtual void GetTextExtent(const wxString
& string
, float *x
, float *y
,
73 float *descent
= NULL
, float *externalLeading
= NULL
,
74 wxFont
*theFont
= NULL
, bool use16bit
= FALSE
);
77 inline wxMetaFile
*GetMetaFile() { return m_metaFile
; }
78 inline void SetMetaFile(wxMetaFile
*mf
) { m_metaFile
= mf
; }
79 inline int GetWindowsMappingMode() { return m_windowsMappingMode
; }
80 inline void SetWindowsMappingMode(int mm
) { m_windowsMappingMode
= mm
; }
83 int m_windowsMappingMode
;
84 wxMetaFile
*m_metaFile
;
88 * Pass filename of existing non-placeable metafile, and bounding box.
89 * Adds a placeable metafile header, sets the mapping mode to anisotropic,
90 * and sets the window origin and extent to mimic the wxMM_TEXT mapping mode.
94 // No origin or extent
95 bool WXDLLEXPORT
wxMakeMetaFilePlaceable(const wxString
& filename
, float scale
= 1.0);
97 // Optional origin and extent
98 bool WXDLLEXPORT
wxMakeMetaFilePlaceable(const wxString
& filename
, int x1
, int y1
, int x2
, int y2
, float scale
= 1.0, bool useOriginAndExtent
= TRUE
);