]>
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
);
42 inline bool Ok() { return m_metaFile
!= 0; };
44 /* TODO: Implementation
45 inline WXHANDLE GetHMETAFILE() { return m_metaFile; }
46 inline void SetHMETAFILE(WXHANDLE mf) { m_metaFile = mf; }
53 class WXDLLEXPORT wxMetaFileDC
: public wxDC
55 DECLARE_DYNAMIC_CLASS(wxMetaFileDC
)
58 // Don't supply origin and extent
59 // Supply them to wxMakeMetaFilePlaceable instead.
60 wxMetaFileDC(const wxString
& file
= "");
62 // Supply origin and extent (recommended).
63 // Then don't need to supply them to wxMakeMetaFilePlaceable.
64 wxMetaFileDC(const wxString
& file
, int xext
, int yext
, int xorg
, int yorg
);
68 // Should be called at end of drawing
69 virtual wxMetaFile
*Close();
70 virtual void SetMapMode(int mode
);
71 virtual void GetTextExtent(const wxString
& string
, float *x
, float *y
,
72 float *descent
= NULL
, float *externalLeading
= NULL
,
73 wxFont
*theFont
= NULL
, bool use16bit
= FALSE
);
76 inline wxMetaFile
*GetMetaFile() { return m_metaFile
; }
77 inline void SetMetaFile(wxMetaFile
*mf
) { m_metaFile
= mf
; }
78 inline int GetWindowsMappingMode() { return m_windowsMappingMode
; }
79 inline void SetWindowsMappingMode(int mm
) { m_windowsMappingMode
= mm
; }
82 int m_windowsMappingMode
;
83 wxMetaFile
*m_metaFile
;
87 * Pass filename of existing non-placeable metafile, and bounding box.
88 * Adds a placeable metafile header, sets the mapping mode to anisotropic,
89 * and sets the window origin and extent to mimic the MM_TEXT mapping mode.
93 // No origin or extent
94 bool WXDLLEXPORT
wxMakeMetaFilePlaceable(const wxString
& filename
, float scale
= 1.0);
96 // Optional origin and extent
97 bool WXDLLEXPORT
wxMakeMetaFilePlaceable(const wxString
& filename
, int x1
, int y1
, int x2
, int y2
, float scale
= 1.0, bool useOriginAndExtent
= TRUE
);