cleanups and tweaks

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@66467 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2010-12-27 19:00:33 +00:00
parent 53b1694757
commit efd05f36dc
2 changed files with 18 additions and 10 deletions

View File

@@ -239,11 +239,7 @@ class FunctionDef(BaseDef):
if element is not None:
self.extract(element)
def releaseGIL(self, release=True):
self.pyReleaseGIL = release
def extract(self, element):
super(FunctionDef, self).extract(element)
self.type = flattenNode(element.find('type'))
@@ -257,13 +253,23 @@ class FunctionDef(BaseDef):
# briefDoc for this ParamDef object.
def releaseGIL(self, release=True):
self.pyReleaseGIL = release
def setCppCode(self, code):
"""
Use the given C++ code instead of that automatically generated by the
back-end. This is similar to adding a new C++ method, except it uses
info we've alread received from the source XML such as the argument
types and names, docstring, etc.
"""
self.cppCode = code
def checkForOverload(self, methods):
for m in methods:
if isinstance(m, MethodDef) and m.name == self.name:
if isinstance(m, FunctionDef) and m.name == self.name:
m.overloads.append(self)
m.isOverloaded = self.isOverloaded = True
return True

View File

@@ -32,7 +32,7 @@ def removeWxPrefixes(node):
item.pyName = item.name[2:]
item.wxDropped = True
if item.name.startswith('wxEVT_'):
# give these theire actual name so the auto-renamer won't touch them
# give these their actual name so the auto-renamer won't touch them
item.pyName = item.name
@@ -69,12 +69,13 @@ def fixEventClass(klass):
Add the extra stuff that an event class needs that are lacking from the
interface headers.
"""
assert isinstance(klass, extractors.ClassDef)
if klass.name != 'wxEvent':
# Clone() in wxEvent is pure virtual, so we need to let the back-end
# know that the other event classes have an implementation for it so
# it won't think that they are abstract classes too.
wig = extractors.WigCode("virtual wxEvent* Clone();")
klass.addItem(wig)
if not klass.findItem('Clone'):
klass.addPublic('virtual wxEvent* Clone() const /Factory/;')
# Add a private assignment operator so the back-end (if it's watching out
# for this) won't try to make copies by assignment.
@@ -107,7 +108,8 @@ def removeVirtuals(klass):
def addWindowVirtuals(klass):
"""
Either turn the virtual flag back on or add a delcaration for the subset of
the C++ virtuals in wxWindow classes that we will be supporting.
"""
publicWindowVirtuals = [
('GetClientAreaOrigin', 'wxPoint GetClientAreaOrigin() const'),