diff options
-rw-r--r-- | retrace/retrace.py | 21 | ||||
-rw-r--r-- | specs/dcomp.py | 192 | ||||
-rw-r--r-- | specs/stdapi.py | 22 | ||||
-rw-r--r-- | wrappers/trace.py | 16 |
4 files changed, 141 insertions, 110 deletions
diff --git a/retrace/retrace.py b/retrace/retrace.py index d506abca..4c3d5530 100644 --- a/retrace/retrace.py +++ b/retrace/retrace.py @@ -361,14 +361,21 @@ class SwizzledValueRegistrator(stdapi.Visitor, stdapi.ExpanderMixin): class Retracer: + def makeFunctionId(self, function): + name = function.name + if function.overloaded: + # TODO: Use a sequence number + name += '__%08x' % (hash(function) & 0xffffffff) + return name + def retraceFunction(self, function): - print 'static void retrace_%s(trace::Call &call) {' % function.name + print 'static void retrace_%s(trace::Call &call) {' % self.makeFunctionId(function) self.retraceFunctionBody(function) print '}' print def retraceInterfaceMethod(self, interface, method): - print 'static void retrace_%s__%s(trace::Call &call) {' % (interface.name, method.name) + print 'static void retrace_%s__%s(trace::Call &call) {' % (interface.name, self.makeFunctionId(method)) self.retraceInterfaceMethodBody(interface, method) print '}' print @@ -605,16 +612,18 @@ class Retracer: print 'const retrace::Entry %s[] = {' % self.table_name for function in functions: if not function.internal: + sigName = function.sigName() if function.sideeffects: - print ' {"%s", &retrace_%s},' % (function.name, function.name) + print ' {"%s", &retrace_%s},' % (sigName, self.makeFunctionId(function)) else: - print ' {"%s", &retrace::ignore},' % (function.name,) + print ' {"%s", &retrace::ignore},' % (sigName,) for interface in interfaces: for base, method in interface.iterBaseMethods(): + sigName = method.sigName() if method.sideeffects: - print ' {"%s::%s", &retrace_%s__%s},' % (interface.name, method.name, base.name, method.name) + print ' {"%s::%s", &retrace_%s__%s},' % (interface.name, sigName, base.name, self.makeFunctionId(method)) else: - print ' {"%s::%s", &retrace::ignore},' % (interface.name, method.name) + print ' {"%s::%s", &retrace::ignore},' % (interface.name, sigName) print ' {NULL, NULL}' print '};' print diff --git a/specs/dcomp.py b/specs/dcomp.py index 983ce3c3..85049ff6 100644 --- a/specs/dcomp.py +++ b/specs/dcomp.py @@ -124,18 +124,18 @@ IDCompositionTarget.methods += [ ] IDCompositionVisual.methods += [ - StdMethod(HRESULT, 'SetOffsetX', [(Float, 'offsetX')]), - StdMethod(HRESULT, 'SetOffsetX', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetOffsetY', [(Float, 'offsetY')]), - StdMethod(HRESULT, 'SetOffsetY', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetTransform', [(Reference(Const(D2D_MATRIX_3X2_F)), 'matrix')]), - StdMethod(HRESULT, 'SetTransform', [(ObjPointer(IDCompositionTransform), 'transform')]), + StdMethod(HRESULT, 'SetOffsetX', [(Float, 'offsetX')], overloaded=True), + StdMethod(HRESULT, 'SetOffsetX', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetOffsetY', [(Float, 'offsetY')], overloaded=True), + StdMethod(HRESULT, 'SetOffsetY', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetTransform', [(Reference(Const(D2D_MATRIX_3X2_F)), 'matrix')], overloaded=True), + StdMethod(HRESULT, 'SetTransform', [(ObjPointer(IDCompositionTransform), 'transform')], overloaded=True), StdMethod(HRESULT, 'SetTransformParent', [(ObjPointer(IDCompositionVisual), 'visual')]), StdMethod(HRESULT, 'SetEffect', [(ObjPointer(IDCompositionEffect), 'effect')]), StdMethod(HRESULT, 'SetBitmapInterpolationMode', [(DCOMPOSITION_BITMAP_INTERPOLATION_MODE, 'interpolationMode')]), StdMethod(HRESULT, 'SetBorderMode', [(DCOMPOSITION_BORDER_MODE, 'borderMode')]), - StdMethod(HRESULT, 'SetClip', [(Reference(Const(D2D_RECT_F)), 'rect')]), - StdMethod(HRESULT, 'SetClip', [(ObjPointer(IDCompositionClip), 'clip')]), + StdMethod(HRESULT, 'SetClip', [(Reference(Const(D2D_RECT_F)), 'rect')], overloaded=True), + StdMethod(HRESULT, 'SetClip', [(ObjPointer(IDCompositionClip), 'clip')], overloaded=True), StdMethod(HRESULT, 'SetContent', [(ObjPointer(IUnknown), 'content')]), StdMethod(HRESULT, 'AddVisual', [(ObjPointer(IDCompositionVisual), 'visual'), (BOOL, 'insertAbove'), (ObjPointer(IDCompositionVisual), 'referenceVisual')]), StdMethod(HRESULT, 'RemoveVisual', [(ObjPointer(IDCompositionVisual), 'visual')]), @@ -150,102 +150,102 @@ IDCompositionTransform3D.methods += [ ] IDCompositionTranslateTransform.methods += [ - StdMethod(HRESULT, 'SetOffsetX', [(Float, 'offsetX')]), - StdMethod(HRESULT, 'SetOffsetX', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetOffsetY', [(Float, 'offsetY')]), - StdMethod(HRESULT, 'SetOffsetY', [(ObjPointer(IDCompositionAnimation), 'animation')]), + StdMethod(HRESULT, 'SetOffsetX', [(Float, 'offsetX')], overloaded=True), + StdMethod(HRESULT, 'SetOffsetX', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetOffsetY', [(Float, 'offsetY')], overloaded=True), + StdMethod(HRESULT, 'SetOffsetY', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), ] IDCompositionTranslateTransform3D.methods += [ - StdMethod(HRESULT, 'SetOffsetX', [(Float, 'offsetX')]), - StdMethod(HRESULT, 'SetOffsetX', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetOffsetY', [(Float, 'offsetY')]), - StdMethod(HRESULT, 'SetOffsetY', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetOffsetZ', [(Float, 'offsetZ')]), - StdMethod(HRESULT, 'SetOffsetZ', [(ObjPointer(IDCompositionAnimation), 'animation')]), + StdMethod(HRESULT, 'SetOffsetX', [(Float, 'offsetX')], overloaded=True), + StdMethod(HRESULT, 'SetOffsetX', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetOffsetY', [(Float, 'offsetY')], overloaded=True), + StdMethod(HRESULT, 'SetOffsetY', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetOffsetZ', [(Float, 'offsetZ')], overloaded=True), + StdMethod(HRESULT, 'SetOffsetZ', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), ] IDCompositionScaleTransform.methods += [ - StdMethod(HRESULT, 'SetScaleX', [(Float, 'scaleX')]), - StdMethod(HRESULT, 'SetScaleX', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetScaleY', [(Float, 'scaleY')]), - StdMethod(HRESULT, 'SetScaleY', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetCenterX', [(Float, 'centerX')]), - StdMethod(HRESULT, 'SetCenterX', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetCenterY', [(Float, 'centerY')]), - StdMethod(HRESULT, 'SetCenterY', [(ObjPointer(IDCompositionAnimation), 'animation')]), + StdMethod(HRESULT, 'SetScaleX', [(Float, 'scaleX')], overloaded=True), + StdMethod(HRESULT, 'SetScaleX', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetScaleY', [(Float, 'scaleY')], overloaded=True), + StdMethod(HRESULT, 'SetScaleY', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetCenterX', [(Float, 'centerX')], overloaded=True), + StdMethod(HRESULT, 'SetCenterX', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetCenterY', [(Float, 'centerY')], overloaded=True), + StdMethod(HRESULT, 'SetCenterY', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), ] IDCompositionScaleTransform3D.methods += [ - StdMethod(HRESULT, 'SetScaleX', [(Float, 'scaleX')]), - StdMethod(HRESULT, 'SetScaleX', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetScaleY', [(Float, 'scaleY')]), - StdMethod(HRESULT, 'SetScaleY', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetScaleZ', [(Float, 'scaleZ')]), - StdMethod(HRESULT, 'SetScaleZ', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetCenterX', [(Float, 'centerX')]), - StdMethod(HRESULT, 'SetCenterX', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetCenterY', [(Float, 'centerY')]), - StdMethod(HRESULT, 'SetCenterY', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetCenterZ', [(Float, 'centerZ')]), - StdMethod(HRESULT, 'SetCenterZ', [(ObjPointer(IDCompositionAnimation), 'animation')]), + StdMethod(HRESULT, 'SetScaleX', [(Float, 'scaleX')], overloaded=True), + StdMethod(HRESULT, 'SetScaleX', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetScaleY', [(Float, 'scaleY')], overloaded=True), + StdMethod(HRESULT, 'SetScaleY', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetScaleZ', [(Float, 'scaleZ')], overloaded=True), + StdMethod(HRESULT, 'SetScaleZ', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetCenterX', [(Float, 'centerX')], overloaded=True), + StdMethod(HRESULT, 'SetCenterX', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetCenterY', [(Float, 'centerY')], overloaded=True), + StdMethod(HRESULT, 'SetCenterY', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetCenterZ', [(Float, 'centerZ')], overloaded=True), + StdMethod(HRESULT, 'SetCenterZ', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), ] IDCompositionRotateTransform.methods += [ - StdMethod(HRESULT, 'SetAngle', [(Float, 'angle')]), - StdMethod(HRESULT, 'SetAngle', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetCenterX', [(Float, 'centerX')]), - StdMethod(HRESULT, 'SetCenterX', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetCenterY', [(Float, 'centerY')]), - StdMethod(HRESULT, 'SetCenterY', [(ObjPointer(IDCompositionAnimation), 'animation')]), + StdMethod(HRESULT, 'SetAngle', [(Float, 'angle')], overloaded=True), + StdMethod(HRESULT, 'SetAngle', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetCenterX', [(Float, 'centerX')], overloaded=True), + StdMethod(HRESULT, 'SetCenterX', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetCenterY', [(Float, 'centerY')], overloaded=True), + StdMethod(HRESULT, 'SetCenterY', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), ] IDCompositionRotateTransform3D.methods += [ - StdMethod(HRESULT, 'SetAngle', [(Float, 'angle')]), - StdMethod(HRESULT, 'SetAngle', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetAxisX', [(Float, 'axisX')]), - StdMethod(HRESULT, 'SetAxisX', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetAxisY', [(Float, 'axisY')]), - StdMethod(HRESULT, 'SetAxisY', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetAxisZ', [(Float, 'axisZ')]), - StdMethod(HRESULT, 'SetAxisZ', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetCenterX', [(Float, 'centerX')]), - StdMethod(HRESULT, 'SetCenterX', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetCenterY', [(Float, 'centerY')]), - StdMethod(HRESULT, 'SetCenterY', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetCenterZ', [(Float, 'centerZ')]), - StdMethod(HRESULT, 'SetCenterZ', [(ObjPointer(IDCompositionAnimation), 'animation')]), + StdMethod(HRESULT, 'SetAngle', [(Float, 'angle')], overloaded=True), + StdMethod(HRESULT, 'SetAngle', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetAxisX', [(Float, 'axisX')], overloaded=True), + StdMethod(HRESULT, 'SetAxisX', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetAxisY', [(Float, 'axisY')], overloaded=True), + StdMethod(HRESULT, 'SetAxisY', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetAxisZ', [(Float, 'axisZ')], overloaded=True), + StdMethod(HRESULT, 'SetAxisZ', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetCenterX', [(Float, 'centerX')], overloaded=True), + StdMethod(HRESULT, 'SetCenterX', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetCenterY', [(Float, 'centerY')], overloaded=True), + StdMethod(HRESULT, 'SetCenterY', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetCenterZ', [(Float, 'centerZ')], overloaded=True), + StdMethod(HRESULT, 'SetCenterZ', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), ] IDCompositionSkewTransform.methods += [ - StdMethod(HRESULT, 'SetAngleX', [(Float, 'angleX')]), - StdMethod(HRESULT, 'SetAngleX', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetAngleY', [(Float, 'angleY')]), - StdMethod(HRESULT, 'SetAngleY', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetCenterX', [(Float, 'centerX')]), - StdMethod(HRESULT, 'SetCenterX', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetCenterY', [(Float, 'centerY')]), - StdMethod(HRESULT, 'SetCenterY', [(ObjPointer(IDCompositionAnimation), 'animation')]), + StdMethod(HRESULT, 'SetAngleX', [(Float, 'angleX')], overloaded=True), + StdMethod(HRESULT, 'SetAngleX', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetAngleY', [(Float, 'angleY')], overloaded=True), + StdMethod(HRESULT, 'SetAngleY', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetCenterX', [(Float, 'centerX')], overloaded=True), + StdMethod(HRESULT, 'SetCenterX', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetCenterY', [(Float, 'centerY')], overloaded=True), + StdMethod(HRESULT, 'SetCenterY', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), ] IDCompositionMatrixTransform.methods += [ StdMethod(HRESULT, 'SetMatrix', [(Reference(Const(D2D_MATRIX_3X2_F)), 'matrix')]), - StdMethod(HRESULT, 'SetMatrixElement', [(Int, 'row'), (Int, 'column'), (Float, 'value')]), - StdMethod(HRESULT, 'SetMatrixElement', [(Int, 'row'), (Int, 'column'), (ObjPointer(IDCompositionAnimation), 'animation')]), + StdMethod(HRESULT, 'SetMatrixElement', [(Int, 'row'), (Int, 'column'), (Float, 'value')], overloaded=True), + StdMethod(HRESULT, 'SetMatrixElement', [(Int, 'row'), (Int, 'column'), (ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), ] IDCompositionMatrixTransform3D.methods += [ StdMethod(HRESULT, 'SetMatrix', [(Reference(Const(D3DMATRIX)), 'matrix')]), - StdMethod(HRESULT, 'SetMatrixElement', [(Int, 'row'), (Int, 'column'), (Float, 'value')]), - StdMethod(HRESULT, 'SetMatrixElement', [(Int, 'row'), (Int, 'column'), (ObjPointer(IDCompositionAnimation), 'animation')]), + StdMethod(HRESULT, 'SetMatrixElement', [(Int, 'row'), (Int, 'column'), (Float, 'value')], overloaded=True), + StdMethod(HRESULT, 'SetMatrixElement', [(Int, 'row'), (Int, 'column'), (ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), ] IDCompositionEffect.methods += [ ] IDCompositionEffectGroup.methods += [ - StdMethod(HRESULT, 'SetOpacity', [(Float, 'opacity')]), - StdMethod(HRESULT, 'SetOpacity', [(ObjPointer(IDCompositionAnimation), 'animation')]), + StdMethod(HRESULT, 'SetOpacity', [(Float, 'opacity')], overloaded=True), + StdMethod(HRESULT, 'SetOpacity', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), StdMethod(HRESULT, 'SetTransform3D', [(ObjPointer(IDCompositionTransform3D), 'transform3D')]), ] @@ -253,30 +253,30 @@ IDCompositionClip.methods += [ ] IDCompositionRectangleClip.methods += [ - StdMethod(HRESULT, 'SetLeft', [(Float, 'left')]), - StdMethod(HRESULT, 'SetLeft', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetTop', [(Float, 'top')]), - StdMethod(HRESULT, 'SetTop', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetRight', [(Float, 'right')]), - StdMethod(HRESULT, 'SetRight', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetBottom', [(Float, 'bottom')]), - StdMethod(HRESULT, 'SetBottom', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetTopLeftRadiusX', [(Float, 'radius')]), - StdMethod(HRESULT, 'SetTopLeftRadiusX', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetTopLeftRadiusY', [(Float, 'radius')]), - StdMethod(HRESULT, 'SetTopLeftRadiusY', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetTopRightRadiusX', [(Float, 'radius')]), - StdMethod(HRESULT, 'SetTopRightRadiusX', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetTopRightRadiusY', [(Float, 'radius')]), - StdMethod(HRESULT, 'SetTopRightRadiusY', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetBottomLeftRadiusX', [(Float, 'radius')]), - StdMethod(HRESULT, 'SetBottomLeftRadiusX', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetBottomLeftRadiusY', [(Float, 'radius')]), - StdMethod(HRESULT, 'SetBottomLeftRadiusY', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetBottomRightRadiusX', [(Float, 'radius')]), - StdMethod(HRESULT, 'SetBottomRightRadiusX', [(ObjPointer(IDCompositionAnimation), 'animation')]), - StdMethod(HRESULT, 'SetBottomRightRadiusY', [(Float, 'radius')]), - StdMethod(HRESULT, 'SetBottomRightRadiusY', [(ObjPointer(IDCompositionAnimation), 'animation')]), + StdMethod(HRESULT, 'SetLeft', [(Float, 'left')], overloaded=True), + StdMethod(HRESULT, 'SetLeft', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetTop', [(Float, 'top')], overloaded=True), + StdMethod(HRESULT, 'SetTop', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetRight', [(Float, 'right')], overloaded=True), + StdMethod(HRESULT, 'SetRight', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetBottom', [(Float, 'bottom')], overloaded=True), + StdMethod(HRESULT, 'SetBottom', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetTopLeftRadiusX', [(Float, 'radius')], overloaded=True), + StdMethod(HRESULT, 'SetTopLeftRadiusX', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetTopLeftRadiusY', [(Float, 'radius')], overloaded=True), + StdMethod(HRESULT, 'SetTopLeftRadiusY', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetTopRightRadiusX', [(Float, 'radius')], overloaded=True), + StdMethod(HRESULT, 'SetTopRightRadiusX', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetTopRightRadiusY', [(Float, 'radius')], overloaded=True), + StdMethod(HRESULT, 'SetTopRightRadiusY', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetBottomLeftRadiusX', [(Float, 'radius')], overloaded=True), + StdMethod(HRESULT, 'SetBottomLeftRadiusX', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetBottomLeftRadiusY', [(Float, 'radius')], overloaded=True), + StdMethod(HRESULT, 'SetBottomLeftRadiusY', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetBottomRightRadiusX', [(Float, 'radius')], overloaded=True), + StdMethod(HRESULT, 'SetBottomRightRadiusX', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), + StdMethod(HRESULT, 'SetBottomRightRadiusY', [(Float, 'radius')], overloaded=True), + StdMethod(HRESULT, 'SetBottomRightRadiusY', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True), ] IDCompositionSurface.methods += [ diff --git a/specs/stdapi.py b/specs/stdapi.py index c72c264b..de0cc93a 100644 --- a/specs/stdapi.py +++ b/specs/stdapi.py @@ -26,6 +26,8 @@ """C basic types""" +import sys + import debug @@ -372,7 +374,7 @@ def InOut(type, name): class Function: - def __init__(self, type, name, args, call = '', fail = None, sideeffects=True, internal=False): + def __init__(self, type, name, args, call = '', fail = None, sideeffects=True, internal=False, overloaded=False): self.type = type self.name = name @@ -394,6 +396,7 @@ class Function: self.fail = fail self.sideeffects = sideeffects self.internal = internal + self.overloaded = overloaded def prototype(self, name=None): if name is not None: @@ -414,6 +417,17 @@ class Function: s += ")" return s + def sigName(self): + name = self.name + if self.overloaded: + # suffix used to make overloaded functions/methods unique + suffix = ','.join([str(arg.type) for arg in self.args]) + suffix = suffix.replace(' *', '*') + suffix = suffix.replace(' &', '&') + suffix = '(' + suffix + ')' + name += suffix + return name + def argNames(self): return [arg.name for arg in self.args] @@ -489,9 +503,9 @@ class Interface(Type): class Method(Function): - def __init__(self, type, name, args, call = '', const=False, sideeffects=True): + def __init__(self, type, name, args, call = '', const=False, sideeffects=True, overloaded=False): assert call == '__stdcall' - Function.__init__(self, type, name, args, call = call, sideeffects=sideeffects) + Function.__init__(self, type, name, args, call = call, sideeffects=sideeffects, overloaded=overloaded) for index in range(len(self.args)): self.args[index].index = index + 1 self.const = const @@ -792,7 +806,7 @@ class MutableRebuilder(Rebuilder): def visitReference(self, reference): # Strip out references - return reference.type + return self.visit(reference.type) class Traverser(Visitor): diff --git a/wrappers/trace.py b/wrappers/trace.py index ab326aa1..18c8816e 100644 --- a/wrappers/trace.py +++ b/wrappers/trace.py @@ -538,7 +538,7 @@ class Tracer: print 'static const char * _%s_args[%u] = {%s};' % (function.name, len(function.args), ', '.join(['"%s"' % arg.name for arg in function.args])) else: print 'static const char ** _%s_args = NULL;' % (function.name,) - print 'static const trace::FunctionSig _%s_sig = {%u, "%s", %u, _%s_args};' % (function.name, self.getFunctionSigId(), function.name, len(function.args), function.name) + print 'static const trace::FunctionSig _%s_sig = {%u, "%s", %u, _%s_args};' % (function.name, self.getFunctionSigId(), function.sigName(), len(function.args), function.name) print def getFunctionSigId(self): @@ -717,7 +717,7 @@ class Tracer: methods = list(interface.iterMethods()) for method in methods: - print " " + method.prototype() + ";" + print " " + method.prototype() + " override;" print for type, name, value in self.enumWrapperInterfaceVariables(interface): @@ -864,8 +864,16 @@ class Tracer: def implementWrapperInterfaceMethodBody(self, interface, base, method): assert not method.internal - print ' static const char * _args[%u] = {%s};' % (len(method.args) + 1, ', '.join(['"this"'] + ['"%s"' % arg.name for arg in method.args])) - print ' static const trace::FunctionSig _sig = {%u, "%s", %u, _args};' % (self.getFunctionSigId(), interface.name + '::' + method.name, len(method.args) + 1) + sigName = interface.name + '::' + method.sigName() + if method.overloaded: + # Once the method signature name goes into a trace, we'll need to + # support it indefinetely, so log them so one can make sure nothing + # weird gets baked in + sys.stderr.write('note: overloaded method %s\n' % (sigName,)) + + numArgs = len(method.args) + 1 + print ' static const char * _args[%u] = {%s};' % (numArgs, ', '.join(['"this"'] + ['"%s"' % arg.name for arg in method.args])) + print ' static const trace::FunctionSig _sig = {%u, "%s", %u, _args};' % (self.getFunctionSigId(), sigName, numArgs) print ' unsigned _call = trace::localWriter.beginEnter(&_sig);' print ' trace::localWriter.beginArg(0);' |