mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2025-12-16 09:40:07 +01:00
Add the ability to replacde the implementation of a wrapper with C++ code, but still keep all the info we pulled from the DoxyXML
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@66317 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -224,6 +224,7 @@ class FunctionDef(BaseDef):
|
||||
self.transfer = False # transfer ownership of return value to C++?
|
||||
self.transferBack = False # transfer ownership of return value from C++ to Python?
|
||||
self.transferThis = False # ownership of 'this' pointer transfered to C++
|
||||
self.cppCode = None # Use this code instead of the default wrapper
|
||||
self.__dict__.update(kw)
|
||||
if element is not None:
|
||||
self.extract(element)
|
||||
@@ -244,6 +245,10 @@ class FunctionDef(BaseDef):
|
||||
# briefDoc for this ParamDef object.
|
||||
|
||||
|
||||
def setCppCode(self, code):
|
||||
self.cppCode = code
|
||||
|
||||
|
||||
def checkForOverload(self, methods):
|
||||
for m in methods:
|
||||
if isinstance(m, MethodDef) and m.name == self.name:
|
||||
@@ -273,6 +278,7 @@ class FunctionDef(BaseDef):
|
||||
items.extend(o.items)
|
||||
return items
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
class MethodDef(FunctionDef):
|
||||
|
||||
@@ -159,6 +159,10 @@ from %s import *
|
||||
stream.write('\n')
|
||||
self.generateParameters(function.items, stream, ' '*4)
|
||||
stream.write(')%s;\n' % self.annotate(function))
|
||||
if function.cppCode:
|
||||
stream.write('%MethodCode\n')
|
||||
stream.write(nci(function.cppCode, 4))
|
||||
stream.write('%End\n')
|
||||
for f in function.overloads:
|
||||
self.generateFunction(f, stream)
|
||||
stream.write('\n')
|
||||
@@ -372,7 +376,12 @@ from %s import *
|
||||
stream.write(')')
|
||||
if method.isPureVirtual:
|
||||
stream.write(' = 0')
|
||||
stream.write('%s;\n\n' % self.annotate(method))
|
||||
stream.write('%s;\n' % self.annotate(method))
|
||||
if method.cppCode:
|
||||
stream.write('%s%%MethodCode\n' % indent)
|
||||
stream.write(nci(method.cppCode, len(indent)+4))
|
||||
stream.write('%s%%End\n' % indent)
|
||||
stream.write('\n')
|
||||
if method.overloads:
|
||||
for m in method.overloads:
|
||||
self.generateMethod(m, stream, indent)
|
||||
|
||||
Reference in New Issue
Block a user