]> git.cworth.org Git - apitrace/commitdiff
d2d: Eliminate custom tracers.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Sun, 11 Nov 2012 00:17:00 +0000 (00:17 +0000)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Sun, 11 Nov 2012 00:17:00 +0000 (00:17 +0000)
specs/d2d1.py
wrappers/d2d1trace.py
wrappers/dwritetrace.py

index 20c657e51cf9bf1edf9d25445d0947bdd34c65f2..a26b4a6a5c8f07e1a211d5be61cfd4081d62d79c 100644 (file)
@@ -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")]),
index d6d48646d6cdcbdd812247ecc598b639d63d7b1b..8883bd578b82f5821de1dec547168cc8fe9dd9f4 100644 (file)
@@ -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)
index cbb214822b2a6af9c4415c7eb23b807cae297abf..2b42e43eed12053cd89d9d14e51a8e8b14b70a0e 100644 (file)
@@ -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)