From e7d7a643767ab46fdc15b4d7f430c38064f8e9ce Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Sun, 11 Nov 2012 00:17:00 +0000 Subject: [PATCH] d2d: Eliminate custom tracers. --- specs/d2d1.py | 2 +- wrappers/d2d1trace.py | 16 +--------------- wrappers/dwritetrace.py | 16 +--------------- 3 files changed, 3 insertions(+), 31 deletions(-) diff --git a/specs/d2d1.py b/specs/d2d1.py index 20c657e..a26b4a6 100644 --- a/specs/d2d1.py +++ b/specs/d2d1.py @@ -627,7 +627,7 @@ d2d1.addInterfaces([ ID2D1Factory ]) d2d1.addFunctions([ - StdFunction(HRESULT, "D2D1CreateFactory", [(D2D1_FACTORY_TYPE, "factoryType"), (REFIID, "riid"), (Pointer(Const(D2D1_FACTORY_OPTIONS)), "pFactoryOptions"), Out(Pointer(OpaquePointer(Void)), "ppIFactory")]), + StdFunction(HRESULT, "D2D1CreateFactory", [(D2D1_FACTORY_TYPE, "factoryType"), (REFIID, "riid"), (Pointer(Const(D2D1_FACTORY_OPTIONS)), "pFactoryOptions"), Out(Pointer(ObjPointer(Void)), "ppIFactory")]), StdFunction(Void, "D2D1MakeRotateMatrix", [(FLOAT, "angle"), (D2D1_POINT_2F, "center"), Out(Pointer(D2D1_MATRIX_3X2_F), "matrix")]), StdFunction(Void, "D2D1MakeSkewMatrix", [(FLOAT, "angleX"), (FLOAT, "angleY"), (D2D1_POINT_2F, "center"), Out(Pointer(D2D1_MATRIX_3X2_F), "matrix")]), StdFunction(BOOL, "D2D1IsMatrixInvertible", [(Pointer(Const(D2D1_MATRIX_3X2_F)), "matrix")]), diff --git a/wrappers/d2d1trace.py b/wrappers/d2d1trace.py index d6d4864..8883bd5 100644 --- a/wrappers/d2d1trace.py +++ b/wrappers/d2d1trace.py @@ -28,20 +28,6 @@ from dlltrace import DllTracer from specs.d2d1 import d2d1 -class D2D1Tracer(DllTracer): - - def wrapArg(self, function, arg): - if function.name == 'D2D1CreateFactory' and arg.output: - print ' if (*%s) {' % arg.name - for iface in d2d1.interfaces: - print ' if (riid == IID_%s) {' % iface.name - print ' *%s = (LPVOID) new Wrap%s((%s *)*%s);' % (arg.name, iface.name, iface.name, arg.name) - print ' }' - print ' }' - else: - DllTracer.wrapArg(self, function, arg) - - if __name__ == '__main__': print '#define INITGUID' print @@ -51,5 +37,5 @@ if __name__ == '__main__': print '#include "d2dimports.hpp"' print - tracer = D2D1Tracer('d2d1.dll') + tracer = DllTracer('d2d1.dll') tracer.traceModule(d2d1) diff --git a/wrappers/dwritetrace.py b/wrappers/dwritetrace.py index cbb2148..2b42e43 100644 --- a/wrappers/dwritetrace.py +++ b/wrappers/dwritetrace.py @@ -29,20 +29,6 @@ from specs.dwrite import dwrite from specs.d2d1 import d2d1 # cyclic dependency -class DWriteTracer(DllTracer): - - def wrapArg(self, function, arg): - if function.name == 'DWriteCreateFactory' and arg.output: - print ' if (*%s) {' % arg.name - for iface in dwrite.interfaces: - print ' if (iid == IID_%s) {' % iface.name - print ' *%s = new Wrap%s(static_cast<%s *>(*%s));' % (arg.name, iface.name, iface.name, arg.name) - print ' }' - print ' }' - else: - DllTracer.wrapArg(self, function, arg) - - if __name__ == '__main__': print '#define INITGUID' print @@ -54,5 +40,5 @@ if __name__ == '__main__': print '#include "d2dimports.hpp"' print - tracer = DWriteTracer('dwrite.dll') + tracer = DllTracer('dwrite.dll') tracer.traceModule(dwrite) -- 2.43.0