Add dummy stub classes

to be used when the metafile classes are not implemented.
This commit is contained in:
Robin Dunn
2018-05-05 21:29:56 -07:00
parent 3ed48b8362
commit 3aa61bbd3d

View File

@@ -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 <wx/metafile.h>')
module.addHeaderCode(stubCode)
c = module.find('wxMetafile')
c.addPrivateCopyCtor()