Generate stubs for glcanvas, mediactrl and webview

This commit is contained in:
Robin Dunn
2018-10-10 18:06:01 -07:00
parent 0dec6dfe26
commit ea5c502498
4 changed files with 20 additions and 9 deletions

View File

@@ -6108,6 +6108,9 @@
"USER_ATTENTION_ERROR":"wx.",
"USER_ATTENTION_INFO":"wx.",
"USE_ACCESSIBILITY":"wx.",
"USE_GLCANVAS":"wx.glcanvas.",
"USE_MEDIACTRL":"wx.media.",
"USE_WEBVIEW":"wx.html2.",
"Uint16":"wx.",
"Uint32":"wx.",
"Uint64":"wx.",

View File

@@ -59,7 +59,7 @@ def run():
#-----------------------------------------------------------------
module.addHeaderCode('#include <wx/glcanvas.h>')
tools.generateStubs('wxUSE_GLCANVAS', module)
c = module.find('wxGLContext')
assert isinstance(c, etgtools.ClassDef)
@@ -67,7 +67,6 @@ def run():
c.addPrivateCopyCtor()
c = module.find('wxGLCanvas')
tools.fixWindowClass(c)

View File

@@ -29,12 +29,16 @@ def run():
# Parse the XML file(s) building a collection of Extractor objects
module = etgtools.ModuleDef(PACKAGE, MODULE, NAME, DOCSTRING)
etgtools.parseDoxyXML(module, ITEMS)
module.addHeaderCode('#include "wx/mediactrl.h"')
#-----------------------------------------------------------------
# Tweak the parsed meta objects in the module object as needed for
# customizing the generated code and docstrings.
module.addHeaderCode('#include <wx/mediactrl.h>')
module.addHeaderCode('#include <wx/uri.h>')
tools.generateStubs('wxUSE_MEDIACTRL', module,
typeValMap={'wxMediaState': 'wxMEDIASTATE_STOPPED'})
c = module.find('wxMediaCtrl')
c.addPrivateCopyCtor()

View File

@@ -38,19 +38,24 @@ def run():
# customizing the generated code and docstrings.
module.addHeaderCode('#include <wx/webview.h>')
module.addHeaderCode('#include <wx/filesys.h>')
module.addGlobalStr('wxWebViewBackendDefault')
module.addGlobalStr('wxWebViewBackendIE')
module.addGlobalStr('wxWebViewBackendWebKit')
module.addGlobalStr('wxWebViewBackendDefault', 0)
module.addGlobalStr('wxWebViewBackendIE', 0)
module.addGlobalStr('wxWebViewBackendWebKit', 0)
module.addGlobalStr('wxWebViewNameStr', 0)
module.addGlobalStr('wxWebViewDefaultURLStr', 0)
# This tweak is needed only for the stub code
module.find('wxWebViewHandler.wxWebViewHandler').argsString = '(const wxString& scheme="")'
tools.generateStubs('wxUSE_WEBVIEW', module)
c = module.find('wxWebView')
assert isinstance(c, etgtools.ClassDef)
tools.fixWindowClass(c)
c.abstract = True
module.addGlobalStr('wxWebViewNameStr', c)
module.addGlobalStr('wxWebViewDefaultURLStr', c)
for m in c.find('New').all():
m.factory = True
c.find('New.id').default = 'wxID_ANY'