From 9796b8463dc518eb0c6cf92b4daf92d080a6a896 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Thu, 25 Nov 2010 11:44:50 +0000 Subject: [PATCH] base.py -> stdapi.py --- CMakeLists.txt | 12 ++++++------ d3dshader.py | 2 +- glapi.py | 2 +- glretrace.py | 16 ++++++++-------- glxtrace.py | 2 +- base.py => stdapi.py | 2 +- trace.py | 16 ++++++++-------- winapi.py | 2 +- 8 files changed, 27 insertions(+), 27 deletions(-) rename base.py => stdapi.py (99%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 99dde68..d3e8832 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,7 +95,7 @@ if (WIN32) # add_custom_command ( # OUTPUT d3d8.cpp # COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d8.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d8.cpp - # DEPENDS d3d8.py d3d8types.py d3d8caps.py winapi.py base.py + # DEPENDS d3d8.py d3d8types.py d3d8caps.py winapi.py stdapi.py # ) # add_library (d3d8 SHARED d3d8.def d3d8.cpp log.cpp os_win32.cpp) # set_target_properties (d3d8 PROPERTIES PREFIX "") @@ -107,7 +107,7 @@ if (WIN32) # add_custom_command ( # OUTPUT d3d9.cpp # COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d9.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d9.cpp - # DEPENDS d3d9.py d3d9types.py d3d9caps.py d3dshader.py winapi.py base.py + # DEPENDS d3d9.py d3d9types.py d3d9caps.py d3dshader.py winapi.py stdapi.py # ) # add_library (d3d9 SHARED d3d9.def d3d9.cpp log.cpp os_win32.cpp) # set_target_properties (d3d9 PROPERTIES PREFIX "") @@ -119,7 +119,7 @@ if (WIN32) # add_custom_command ( # OUTPUT d3d10.cpp # COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d10misc.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d10.cpp - # DEPENDS d3d10misc.py winapi.py base.py + # DEPENDS d3d10misc.py winapi.py stdapi.py # ) # add_library (d3d10 SHARED d3d10.def d3d10.cpp log.cpp os_win32.cpp) # set_target_properties (d3d10 PROPERTIES PREFIX "") @@ -129,7 +129,7 @@ if (WIN32) add_custom_command ( OUTPUT opengl32.cpp COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/opengl32.py > ${CMAKE_CURRENT_BINARY_DIR}/opengl32.cpp - DEPENDS opengl32.py trace.py wglapi.py glapi.py winapi.py base.py + DEPENDS opengl32.py trace.py wglapi.py glapi.py winapi.py stdapi.py ) add_library (opengl SHARED opengl32.def opengl32.cpp log.cpp os_win32.cpp) set_target_properties (opengl PROPERTIES @@ -145,7 +145,7 @@ else () add_custom_command ( OUTPUT glxtrace.cpp COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glxtrace.py > ${CMAKE_CURRENT_BINARY_DIR}/glxtrace.cpp - DEPENDS glxtrace.py trace.py glapi.py base.py + DEPENDS glxtrace.py trace.py glapi.py stdapi.py ) add_library (glxtrace SHARED glxtrace.cpp log.cpp os_posix.cpp) @@ -160,7 +160,7 @@ if (GLEW_INCLUDE_DIR) add_custom_command ( OUTPUT glretrace.cpp COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glretrace.py > ${CMAKE_CURRENT_BINARY_DIR}/glretrace.cpp - DEPENDS glretrace.py glapi.py base.py + DEPENDS glretrace.py glapi.py stdapi.py ) include_directories ( diff --git a/d3dshader.py b/d3dshader.py index b9e18ab..bb37678 100644 --- a/d3dshader.py +++ b/d3dshader.py @@ -24,7 +24,7 @@ ##########################################################################/ -from base import Type +from stdapi import Type class D3DShader(Type): diff --git a/glapi.py b/glapi.py index 219ae94..c94358c 100644 --- a/glapi.py +++ b/glapi.py @@ -24,7 +24,7 @@ ##########################################################################/ -from base import * +from stdapi import * GLboolean = Alias("GLboolean", Bool) diff --git a/glretrace.py b/glretrace.py index 9518320..e42a922 100644 --- a/glretrace.py +++ b/glretrace.py @@ -24,12 +24,12 @@ ##########################################################################/ -import base +import stdapi import glapi -class ConstRemover(base.Rebuilder): +class ConstRemover(stdapi.Rebuilder): def visit_const(self, const): return const.type @@ -38,10 +38,10 @@ class ConstRemover(base.Rebuilder): expr = opaque.expr if expr.startswith('const '): expr = expr[6:] - return base.Opaque(expr) + return stdapi.Opaque(expr) -class ValueExtractor(base.Visitor): +class ValueExtractor(stdapi.Visitor): def visit_literal(self, literal, lvalue, rvalue): if literal.format == 'Bool': @@ -100,7 +100,7 @@ class ValueExtractor(base.Visitor): -class ValueWrapper(base.Visitor): +class ValueWrapper(stdapi.Visitor): def visit_literal(self, literal, lvalue, rvalue): pass @@ -166,7 +166,7 @@ def retrace_function(function): print ' std::cerr << "warning: unsupported call %s\\n";' % function.name print ' return;' arg_names = ", ".join([arg.name for arg in function.args]) - if function.type is not base.Void: + if function.type is not stdapi.Void: print ' %s __result;' % (function.type) print ' __result = %s(%s);' % (function.name, arg_names) else: @@ -180,7 +180,7 @@ def retrace_function(function): ValueWrapper().visit(arg_type, lvalue, rvalue) except NotImplementedError: print ' // FIXME: %s' % arg.name - if function.type is not base.Void: + if function.type is not stdapi.Void: rvalue = '*call.ret' lvalue = '__result' try: @@ -223,7 +223,7 @@ def retrace_functions(functions): def retrace_api(api): types = api.all_types() - handles = [type for type in types if isinstance(type, base.Handle)] + handles = [type for type in types if isinstance(type, stdapi.Handle)] for handle in handles: print 'static std::map<%s, %s> __%s_map;' % (handle.type, handle.type, handle.name) print diff --git a/glxtrace.py b/glxtrace.py index 2fa5ae5..38bac45 100644 --- a/glxtrace.py +++ b/glxtrace.py @@ -24,7 +24,7 @@ ##########################################################################/ -from base import * +from stdapi import * from glapi import glapi import trace diff --git a/base.py b/stdapi.py similarity index 99% rename from base.py rename to stdapi.py index 8213403..8326a72 100644 --- a/base.py +++ b/stdapi.py @@ -399,7 +399,7 @@ class Interface(Type): def itermethods(self): if self.base is not None: - for method in self.base.itermethods(): + for method in self.stdapi.itermethods(): yield method for method in self.methods: yield method diff --git a/trace.py b/trace.py index ab55555..f7f10b8 100644 --- a/trace.py +++ b/trace.py @@ -26,13 +26,13 @@ """C basic types""" -import base +import stdapi all_types = {} -class DumpDeclarator(base.OnceVisitor): +class DumpDeclarator(stdapi.OnceVisitor): '''Declare helper functions to dump complex types.''' def visit_void(self, literal): @@ -111,7 +111,7 @@ class DumpDeclarator(base.OnceVisitor): pass -class DumpImplementer(base.Visitor): +class DumpImplementer(stdapi.Visitor): '''Dump an instance.''' def visit_literal(self, literal, instance): @@ -180,7 +180,7 @@ dump_instance = DumpImplementer().visit -class Wrapper(base.Visitor): +class Wrapper(stdapi.Visitor): '''Wrap an instance.''' def visit_void(self, type, instance): @@ -290,7 +290,7 @@ class Tracer: def trace_function_fail(self, function): if function.fail is not None: - if function.type is base.Void: + if function.type is stdapi.Void: assert function.fail == '' print ' return;' else: @@ -314,7 +314,7 @@ class Tracer: def trace_function_impl(self, function): pvalue = self.function_pointer_value(function) print function.prototype() + ' {' - if function.type is base.Void: + if function.type is stdapi.Void: result = '' else: print ' %s __result;' % function.type @@ -330,10 +330,10 @@ class Tracer: if arg.output: self.dump_arg(function, arg) self.wrap_arg(function, arg) - if function.type is not base.Void: + if function.type is not stdapi.Void: self.dump_ret(function, "__result") print ' Log::EndCall();' - if function.type is not base.Void: + if function.type is not stdapi.Void: self.wrap_ret(function, "__result") print ' return __result;' print '}' diff --git a/winapi.py b/winapi.py index eec3fde..30826e3 100644 --- a/winapi.py +++ b/winapi.py @@ -25,7 +25,7 @@ """Win32 API type description.""" -from base import * +from stdapi import * SHORT = Alias("SHORT", Short) USHORT = Alias("USHORT", UShort) -- 2.45.2