From 3aa61bbd3dcb676c0b651d6410ed6b29d3891380 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 5 May 2018 21:29:56 -0700 Subject: [PATCH] Add dummy stub classes to be used when the metafile classes are not implemented. --- etg/metafile.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/etg/metafile.py b/etg/metafile.py index 5052578b..dcc5f914 100644 --- a/etg/metafile.py +++ b/etg/metafile.py @@ -22,7 +22,29 @@ ITEMS = [ 'wxMetafile', 'wxMetafileDC', ] +stubCode = """\ +#if !wxUSE_METAFILE +class wxMetafile : public wxObject +{ +public: + wxMetafile(const wxString& filename = wxEmptyString) { wxPyRaiseNotImplemented(); } + ~wxMetafile() {} + bool IsOk() { return false; } + bool Play(wxDC* dc) { return false; } + bool SetClipboard(int width = 0, int height = 0) { return false; } +}; + +class wxMetafileDC : public wxMemoryDC +{ +public: + wxMetafileDC(const wxString& filename = wxEmptyString) { wxPyRaiseNotImplemented(); } + ~wxMetafileDC() {} + wxMetafile* Close() { return NULL; } +}; + +#endif +""" #--------------------------------------------------------------------------- def run(): @@ -35,6 +57,7 @@ def run(): # customizing the generated code and docstrings. module.addHeaderCode('#include ') + module.addHeaderCode(stubCode) c = module.find('wxMetafile') c.addPrivateCopyCtor()