mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-07 12:30:07 +01:00
trim trailing space etg directory
This commit is contained in:
@@ -10,39 +10,39 @@
|
||||
import etgtools
|
||||
import etgtools.tweaker_tools as tools
|
||||
|
||||
PACKAGE = "wx"
|
||||
PACKAGE = "wx"
|
||||
MODULE = "_html2"
|
||||
NAME = "webview" # Base name of the file to generate to for this script
|
||||
DOCSTRING = ""
|
||||
|
||||
# The classes and/or the basename of the Doxygen XML files to be processed by
|
||||
# this script.
|
||||
# this script.
|
||||
ITEMS = [ 'wxWebViewHistoryItem',
|
||||
'wxWebViewHandler',
|
||||
'wxWebViewHandler',
|
||||
'wxWebViewArchiveHandler',
|
||||
'wxWebViewFSHandler',
|
||||
'wxWebView',
|
||||
'wxWebViewEvent',
|
||||
'wxWebViewFactory',
|
||||
]
|
||||
|
||||
]
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
def run():
|
||||
# Parse the XML file(s) building a collection of Extractor objects
|
||||
module = etgtools.ModuleDef(PACKAGE, MODULE, NAME, DOCSTRING)
|
||||
etgtools.parseDoxyXML(module, ITEMS)
|
||||
|
||||
|
||||
#-----------------------------------------------------------------
|
||||
# Tweak the parsed meta objects in the module object as needed for
|
||||
# customizing the generated code and docstrings.
|
||||
|
||||
|
||||
module.addHeaderCode('#include <wx/webview.h>')
|
||||
|
||||
module.addGlobalStr('wxWebViewBackendDefault')
|
||||
module.addGlobalStr('wxWebViewBackendIE')
|
||||
module.addGlobalStr('wxWebViewBackendWebKit')
|
||||
|
||||
|
||||
c = module.find('wxWebView')
|
||||
assert isinstance(c, etgtools.ClassDef)
|
||||
tools.fixWindowClass(c)
|
||||
@@ -50,13 +50,13 @@ def run():
|
||||
|
||||
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'
|
||||
c.find('New.parent').transferThis = True
|
||||
|
||||
|
||||
|
||||
|
||||
c.find('RegisterHandler.handler').type = 'wxWebViewHandler*'
|
||||
c.find('RegisterHandler.handler').transfer = True
|
||||
c.find('RegisterHandler').setCppCode_sip(
|
||||
@@ -67,11 +67,11 @@ def run():
|
||||
c.find('RegisterFactory.factory').transfer = True
|
||||
c.find('RegisterFactory').setCppCode_sip(
|
||||
"wxWebView::RegisterFactory(*backend, wxSharedPtr<wxWebViewFactory>(factory));")
|
||||
|
||||
|
||||
|
||||
# Custom code to deal with the
|
||||
# wxVector<wxSharedPtr<wxWebViewHistoryItem>> return type of these two
|
||||
# methods. We'll just convert them to a Python list of history items.
|
||||
# methods. We'll just convert them to a Python list of history items.
|
||||
code = """\
|
||||
wxPyThreadBlocker blocker;
|
||||
PyObject* result = PyList_New(0);
|
||||
@@ -89,8 +89,8 @@ def run():
|
||||
c.find('GetBackwardHistory').setCppCode(code.format(method='GetBackwardHistory'))
|
||||
c.find('GetForwardHistory').type = 'PyObject*'
|
||||
c.find('GetForwardHistory').setCppCode(code.format(method='GetForwardHistory'))
|
||||
|
||||
|
||||
|
||||
|
||||
# Since LoadHistoryItem expects to get an actual item in the history
|
||||
# list, and since we make copies of the items in the cppCode above, then
|
||||
# this won't be possible to do from the Python wrappers. However, it's
|
||||
@@ -101,14 +101,14 @@ def run():
|
||||
##c.find('LoadHistoryItem.item').transfer = True
|
||||
##c.find('LoadHistoryItem').setCppCode_sip(
|
||||
## "sipCpp->LoadHistoryItem(wxSharedPtr<wxWebViewHistoryItem>(item));")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
c = module.find('wxWebViewEvent')
|
||||
tools.fixEventClass(c)
|
||||
|
||||
|
||||
module.addPyCode("""\
|
||||
EVT_WEBVIEW_NAVIGATING = wx.PyEventBinder( wxEVT_WEBVIEW_NAVIGATING, 1 )
|
||||
EVT_WEBVIEW_NAVIGATED = wx.PyEventBinder( wxEVT_WEBVIEW_NAVIGATED, 1 )
|
||||
@@ -116,26 +116,26 @@ def run():
|
||||
EVT_WEBVIEW_ERROR = wx.PyEventBinder( wxEVT_WEBVIEW_ERROR, 1 )
|
||||
EVT_WEBVIEW_NEWWINDOW = wx.PyEventBinder( wxEVT_WEBVIEW_NEWWINDOW, 1 )
|
||||
EVT_WEBVIEW_TITLE_CHANGED = wx.PyEventBinder( wxEVT_WEBVIEW_TITLE_CHANGED, 1 )
|
||||
|
||||
|
||||
# deprecated wxEVT aliases
|
||||
wxEVT_COMMAND_WEBVIEW_NAVIGATING = wxEVT_WEBVIEW_NAVIGATING
|
||||
wxEVT_COMMAND_WEBVIEW_NAVIGATED = wxEVT_WEBVIEW_NAVIGATED
|
||||
wxEVT_COMMAND_WEBVIEW_LOADED = wxEVT_WEBVIEW_LOADED
|
||||
wxEVT_COMMAND_WEBVIEW_ERROR = wxEVT_WEBVIEW_ERROR
|
||||
wxEVT_COMMAND_WEBVIEW_NEWWINDOW = wxEVT_WEBVIEW_NEWWINDOW
|
||||
wxEVT_COMMAND_WEBVIEW_TITLE_CHANGED = wxEVT_WEBVIEW_TITLE_CHANGED
|
||||
wxEVT_COMMAND_WEBVIEW_TITLE_CHANGED = wxEVT_WEBVIEW_TITLE_CHANGED
|
||||
""")
|
||||
|
||||
|
||||
|
||||
c = module.find('wxWebViewHistoryItem')
|
||||
tools.addAutoProperties(c)
|
||||
|
||||
|
||||
|
||||
|
||||
#-----------------------------------------------------------------
|
||||
tools.doCommonTweaks(module)
|
||||
tools.runGenerators(module)
|
||||
|
||||
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
if __name__ == '__main__':
|
||||
run()
|
||||
|
||||
Reference in New Issue
Block a user