Changeset 63939 in vbox for trunk/src/VBox/Additions/common
- Timestamp:
- Sep 22, 2016 7:58:05 AM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 110825
- Location:
- trunk/src/VBox/Additions/common/crOpenGL
- Files:
-
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/crOpenGL/DD_glc.py
r62521 r63939 1 print """ 1 from __future__ import print_function 2 print(""" 2 3 /** @file 3 4 * VBox OpenGL chromium functions header … … 15 16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 16 17 */ 17 """ 18 """) 18 19 # Copyright (c) 2001, Stanford University 19 20 # All rights reserved. … … 27 28 apiutil.CopyrightC() 28 29 29 print 30 print(""" 30 31 /* DO NOT EDIT - THIS FILE GENERATED BY THE DD_gl.py SCRIPT */ 31 32 … … 36 37 #include "dri_drv.h" 37 38 #include "cr_gl.h" 38 """ 39 """) 39 40 40 41 commoncall_special = [ … … 122 123 123 124 if func_name in commoncall_special: 124 print "%s vboxDD_gl%s( %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params))125 print("%s vboxDD_gl%s( %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params) )) 125 126 else: 126 127 if apiutil.MakeDeclarationString(params)=="void": 127 print "%s vboxDD_gl%s( GLcontext *ctx )" % (return_type, func_name)128 print("%s vboxDD_gl%s( GLcontext *ctx )" % (return_type, func_name )) 128 129 else: 129 print "%s vboxDD_gl%s( GLcontext *ctx, %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params))130 print "{"130 print("%s vboxDD_gl%s( GLcontext *ctx, %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params) )) 131 print("{") 131 132 132 133 if return_type != "void": 133 print "\treturn ",134 print("\treturn ", end=' ') 134 135 135 print "\tcr_gl%s( %s );" % (func_name, apiutil.MakeCallString(params))136 print "}"137 print ""136 print("\tcr_gl%s( %s );" % (func_name, apiutil.MakeCallString(params))) 137 print("}") 138 print("") 138 139 -
trunk/src/VBox/Additions/common/crOpenGL/DD_glh.py
r62521 r63939 1 print """ 1 from __future__ import print_function 2 print(""" 2 3 /** @file 3 4 * VBox OpenGL chromium functions header … … 15 16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 16 17 */ 17 """ 18 """) 18 19 # Copyright (c) 2001, Stanford University 19 20 # All rights reserved. … … 27 28 apiutil.CopyrightC() 28 29 29 print 30 print(""" 30 31 /* DO NOT EDIT - THIS FILE GENERATED BY THE DD_gl.py SCRIPT */ 31 32 #ifndef __DD_GL_H__ … … 37 38 #include "stub.h" 38 39 39 """ 40 """) 40 41 41 42 commoncall_special = [ … … 124 125 125 126 if func_name in commoncall_special: 126 print 127 apiutil.MakeDeclarationString( params )) 127 print("extern %s vboxDD_gl%s( %s );" % (return_type, func_name, 128 apiutil.MakeDeclarationString( params ))) 128 129 else: 129 130 if apiutil.MakeDeclarationString(params)=="void": 130 print "extern %s vboxDD_gl%s( GLcontext *ctx );" % (return_type, func_name)131 print("extern %s vboxDD_gl%s( GLcontext *ctx );" % (return_type, func_name)) 131 132 else: 132 print 133 apiutil.MakeDeclarationString( params )) 133 print("extern %s vboxDD_gl%s( GLcontext *ctx, %s );" % (return_type, func_name, 134 apiutil.MakeDeclarationString( params ))) 134 135 135 print "#endif /* __DD_GL_H__ */"136 print("#endif /* __DD_GL_H__ */") -
trunk/src/VBox/Additions/common/crOpenGL/Linux_i386_exports.py
r30457 r63939 5 5 6 6 7 from __future__ import print_function 7 8 import sys 8 9 … … 17 18 # The order is very important - it must match cr_opcodes.h 18 19 # and spu_dispatch_table.h 19 print '%include "iprt/asmdefs.mac"'20 print ""21 print "%ifdef RT_ARCH_AMD64"22 print "extern glim"23 print "%else ; X86"24 print "extern glim"25 print "%endif"26 print ""20 print('%include "iprt/asmdefs.mac"') 21 print("") 22 print("%ifdef RT_ARCH_AMD64") 23 print("extern glim") 24 print("%else ; X86") 25 print("extern glim") 26 print("%endif") 27 print("") 27 28 28 29 keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt") … … 35 36 continue 36 37 37 print "BEGINPROC_EXPORTED gl%s" % func_name38 print "%ifdef RT_ARCH_AMD64"39 print "\tmov \trax, qword glim+%d" % (8*index)40 print "\tjmp \t[rax]"41 print "%else ; X86"42 print "\tmov \teax, dword glim+%d" % (4*index)43 print "\tjmp \t[eax]"44 print "%endif"45 print "ENDPROC gl%s" % func_name46 print ""38 print("BEGINPROC_EXPORTED gl%s" % func_name) 39 print("%ifdef RT_ARCH_AMD64") 40 print("\tmov \trax, qword glim+%d" % (8*index)) 41 print("\tjmp \t[rax]") 42 print("%else ; X86") 43 print("\tmov \teax, dword glim+%d" % (4*index)) 44 print("\tjmp \t[eax]") 45 print("%endif") 46 print("ENDPROC gl%s" % func_name) 47 print("") 47 48 48 49 49 print ';'50 print '; Aliases'51 print ';'50 print(';') 51 print('; Aliases') 52 print(';') 52 53 53 54 # Now loop over all the functions and take care of any aliases … … 66 67 # this dict lookup should never fail (raise an exception)! 67 68 index = keys.index(alias) 68 print "BEGINPROC_EXPORTED gl%s" % func_name69 print "%ifdef RT_ARCH_AMD64"70 print "\tmov \trax, qword glim+%d" % (8*index)71 print "\tjmp \t[rax]"72 print "%else ; X86"73 print "\tmov \teax, dword glim+%d" % (4*index)74 print "\tjmp \t[eax]"75 print "%endif"76 print "ENDPROC gl%s" % func_name77 print ""69 print("BEGINPROC_EXPORTED gl%s" % func_name) 70 print("%ifdef RT_ARCH_AMD64") 71 print("\tmov \trax, qword glim+%d" % (8*index)) 72 print("\tjmp \t[rax]") 73 print("%else ; X86") 74 print("\tmov \teax, dword glim+%d" % (4*index)) 75 print("\tjmp \t[eax]") 76 print("%endif") 77 print("ENDPROC gl%s" % func_name) 78 print("") 78 79 79 80 80 print ';'81 print '; No-op stubs'82 print ';'81 print(';') 82 print('; No-op stubs') 83 print(';') 83 84 84 85 # Now generate no-op stub functions 85 86 for func_name in allkeys: 86 87 if "stub" in apiutil.ChromiumProps(func_name): 87 print "BEGINPROC_EXPORTED gl%s" % func_name88 print "\tleave"89 print "\tret"90 print "ENDPROC gl%s" % func_name91 print ""88 print("BEGINPROC_EXPORTED gl%s" % func_name) 89 print("\tleave") 90 print("\tret") 91 print("ENDPROC gl%s" % func_name) 92 print("") 92 93 93 94 -
trunk/src/VBox/Additions/common/crOpenGL/Linux_i386_exports_dri.py
r30457 r63939 5 5 6 6 7 from __future__ import print_function 7 8 import sys 8 9 … … 17 18 # The order is very important - it must match cr_opcodes.h 18 19 # and spu_dispatch_table.h 19 print '%include "iprt/asmdefs.mac"'20 print ""21 print "%ifdef RT_ARCH_AMD64"22 print "extern glim"23 print "%else ; X86"24 print "extern glim"25 print "%endif"26 print ""20 print('%include "iprt/asmdefs.mac"') 21 print("") 22 print("%ifdef RT_ARCH_AMD64") 23 print("extern glim") 24 print("%else ; X86") 25 print("extern glim") 26 print("%endif") 27 print("") 27 28 28 29 keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt") … … 35 36 continue 36 37 37 print "BEGINPROC_EXPORTED cr_gl%s" % func_name38 print "%ifdef RT_ARCH_AMD64"39 print "\tmov \trax, qword glim+%d" % (8*index)40 print "\tjmp \t[rax]"41 print "%else ; X86"42 print "\tmov \teax, dword glim+%d" % (4*index)43 print "\tjmp \t[eax]"44 print "%endif"45 print "ENDPROC cr_gl%s" % func_name46 print ""38 print("BEGINPROC_EXPORTED cr_gl%s" % func_name) 39 print("%ifdef RT_ARCH_AMD64") 40 print("\tmov \trax, qword glim+%d" % (8*index)) 41 print("\tjmp \t[rax]") 42 print("%else ; X86") 43 print("\tmov \teax, dword glim+%d" % (4*index)) 44 print("\tjmp \t[eax]") 45 print("%endif") 46 print("ENDPROC cr_gl%s" % func_name) 47 print("") 47 48 48 49 49 print ';'50 print '; Aliases'51 print ';'50 print(';') 51 print('; Aliases') 52 print(';') 52 53 53 54 # Now loop over all the functions and take care of any aliases … … 66 67 # this dict lookup should never fail (raise an exception)! 67 68 index = keys.index(alias) 68 print "BEGINPROC_EXPORTED cr_gl%s" % func_name69 print "%ifdef RT_ARCH_AMD64"70 print "\tmov \trax, qword glim+%d" % (8*index)71 print "\tjmp \t[rax]"72 print "%else ; X86"73 print "\tmov \teax, dword glim+%d" % (4*index)74 print "\tjmp \t[eax]"75 print "%endif"76 print "ENDPROC cr_gl%s" % func_name77 print ""69 print("BEGINPROC_EXPORTED cr_gl%s" % func_name) 70 print("%ifdef RT_ARCH_AMD64") 71 print("\tmov \trax, qword glim+%d" % (8*index)) 72 print("\tjmp \t[rax]") 73 print("%else ; X86") 74 print("\tmov \teax, dword glim+%d" % (4*index)) 75 print("\tjmp \t[eax]") 76 print("%endif") 77 print("ENDPROC cr_gl%s" % func_name) 78 print("") 78 79 79 80 80 print ';'81 print '; No-op stubs'82 print ';'81 print(';') 82 print('; No-op stubs') 83 print(';') 83 84 84 85 # Now generate no-op stub functions 85 86 for func_name in allkeys: 86 87 if "stub" in apiutil.ChromiumProps(func_name): 87 print "BEGINPROC_EXPORTED cr_gl%s" % func_name88 print "\tleave"89 print "\tret"90 print "ENDPROC cr_gl%s" % func_name91 print ""88 print("BEGINPROC_EXPORTED cr_gl%s" % func_name) 89 print("\tleave") 90 print("\tret") 91 print("ENDPROC cr_gl%s" % func_name) 92 print("") 92 93 93 94 -
trunk/src/VBox/Additions/common/crOpenGL/Linux_i386_glxapi_exports.py
r62520 r63939 11 11 """ 12 12 13 from __future__ import print_function 13 14 import sys 14 15 … … 80 81 ]; 81 82 82 print '%include "iprt/asmdefs.mac"'83 print ""84 print "%ifdef RT_ARCH_AMD64"85 print "extern glxim"86 print "%else ; X86"87 print "extern glxim"88 print "%endif"89 print ""83 print('%include "iprt/asmdefs.mac"') 84 print("") 85 print("%ifdef RT_ARCH_AMD64") 86 print("extern glxim") 87 print("%else ; X86") 88 print("extern glxim") 89 print("%endif") 90 print("") 90 91 91 92 for index in range(len(glx_functions)): 92 93 func_name = glx_functions[index] 93 94 94 print "BEGINPROC_EXPORTED vbox_glX%s" % func_name95 print "%ifdef RT_ARCH_AMD64"96 print "\tmov \trax, qword glxim+%d" % (8*index)97 print "\tjmp \t[rax]"98 print "%else ; X86"99 print "\tmov \teax, dword glxim+%d" % (4*index)100 print "\tjmp \t[eax]"101 print "%endif"102 print "ENDPROC vbox_glX%s" % func_name103 print ""95 print("BEGINPROC_EXPORTED vbox_glX%s" % func_name) 96 print("%ifdef RT_ARCH_AMD64") 97 print("\tmov \trax, qword glxim+%d" % (8*index)) 98 print("\tjmp \t[rax]") 99 print("%else ; X86") 100 print("\tmov \teax, dword glxim+%d" % (4*index)) 101 print("\tjmp \t[eax]") 102 print("%endif") 103 print("ENDPROC vbox_glX%s" % func_name) 104 print("") 104 105 -
trunk/src/VBox/Additions/common/crOpenGL/NULLfuncs.py
r16381 r63939 5 5 6 6 7 from __future__ import print_function 7 8 import sys 8 9 … … 13 14 apiutil.CopyrightC() 14 15 15 print 16 print(""" 16 17 /* DO NOT EDIT - THIS FILE GENERATED BY THE NULLfuncs.py SCRIPT */ 17 18 18 19 #include "cr_error.h" 19 20 #include "stub.h" 20 """ 21 """) 21 22 22 23 for func_name in keys: … … 24 25 params = apiutil.Parameters(func_name) 25 26 26 print "static %s SPULOAD_APIENTRY NULL_%s( %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params))27 print "{"28 print "\t/* do nothing */"29 print "\tcrWarning(\"YOU ARE CALLING A NULLED FUNCTION (%s)\");" % func_name27 print("static %s SPULOAD_APIENTRY NULL_%s( %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params))) 28 print("{") 29 print("\t/* do nothing */") 30 print("\tcrWarning(\"YOU ARE CALLING A NULLED FUNCTION (%s)\");" % func_name) 30 31 for (name, type, vecSize) in params: 31 print "\t(void) %s;" % name32 print("\t(void) %s;" % name) 32 33 if return_type != "void": 33 print "\treturn 0;"34 print "}"35 print ""34 print("\treturn 0;") 35 print("}") 36 print("") 36 37 37 38 38 print "DECLEXPORT(SPUDispatchTable) stubNULLDispatch = {"39 print("DECLEXPORT(SPUDispatchTable) stubNULLDispatch = {") 39 40 for func_name in keys: 40 print "\tNULL_%s," % (func_name)41 print "\tNULL, /* copyList */"42 print "\tNULL, /* copy_of */"43 print "\t0, /* mark */"44 print "\tNULL /* server */"45 print "};"41 print("\tNULL_%s," % (func_name)) 42 print("\tNULL, /* copyList */") 43 print("\tNULL, /* copy_of */") 44 print("\t0, /* mark */") 45 print("\tNULL /* server */") 46 print("};") 46 47 47 print ""48 print "/* Declare and initialize the glim dispatch table here so that we */"49 print "/* can initialize all entries to no-op routines. */"50 print "SPUDispatchTable glim = {"48 print("") 49 print("/* Declare and initialize the glim dispatch table here so that we */") 50 print("/* can initialize all entries to no-op routines. */") 51 print("SPUDispatchTable glim = {") 51 52 for func_name in keys: 52 print "\tNULL_%s," % (func_name)53 print "\tNULL, /* copyList */"54 print "\tNULL, /* copy_of */"55 print "\t0, /* mark */"56 print "\tNULL /* server */"57 print "};"53 print("\tNULL_%s," % (func_name)) 54 print("\tNULL, /* copyList */") 55 print("\tNULL, /* copy_of */") 56 print("\t0, /* mark */") 57 print("\tNULL /* server */") 58 print("};") -
trunk/src/VBox/Additions/common/crOpenGL/SunOS_i386_exports.py
r62521 r63939 11 11 """ 12 12 13 from __future__ import print_function 13 14 import sys 14 15 … … 23 24 # The order is very important - it must match cr_opcodes.h 24 25 # and spu_dispatch_table.h 25 print '%include "iprt/asmdefs.mac"'26 print ""27 print "%ifdef RT_ARCH_AMD64"28 print "extern glim"29 print "%else ; X86"30 print "extern glim"31 print "%endif"32 print ""26 print('%include "iprt/asmdefs.mac"') 27 print("") 28 print("%ifdef RT_ARCH_AMD64") 29 print("extern glim") 30 print("%else ; X86") 31 print("extern glim") 32 print("%endif") 33 print("") 33 34 34 35 keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt") … … 41 42 continue 42 43 43 print "BEGINPROC_EXPORTED gl%s" % func_name44 print "%ifdef RT_ARCH_AMD64"45 print "\tjmp \t[glim+%d wrt rip wrt ..gotpcrel]" % (8*index)46 print "%else ; X86"47 print "\tjmp \t[glim+%d wrt ..gotpc]" % (4*index)48 print "%endif"49 print "ENDPROC gl%s" % func_name50 print ""44 print("BEGINPROC_EXPORTED gl%s" % func_name) 45 print("%ifdef RT_ARCH_AMD64") 46 print("\tjmp \t[glim+%d wrt rip wrt ..gotpcrel]" % (8*index)) 47 print("%else ; X86") 48 print("\tjmp \t[glim+%d wrt ..gotpc]" % (4*index)) 49 print("%endif") 50 print("ENDPROC gl%s" % func_name) 51 print("") 51 52 52 53 53 print ';'54 print '; Aliases'55 print ';'54 print(';') 55 print('; Aliases') 56 print(';') 56 57 57 58 # Now loop over all the functions and take care of any aliases … … 70 71 # this dict lookup should never fail (raise an exception)! 71 72 index = keys.index(alias) 72 print "BEGINPROC_EXPORTED gl%s" % func_name73 print "%ifdef RT_ARCH_AMD64"74 print "\tjmp \t[glim+%d wrt rip wrt ..gotpcrel]" % (8*index)75 print "%else ; X86"76 print "\tjmp \t[glim+%d wrt ..gotpc]" % (4*index)77 print "%endif"78 print "ENDPROC gl%s" % func_name79 print ""73 print("BEGINPROC_EXPORTED gl%s" % func_name) 74 print("%ifdef RT_ARCH_AMD64") 75 print("\tjmp \t[glim+%d wrt rip wrt ..gotpcrel]" % (8*index)) 76 print("%else ; X86") 77 print("\tjmp \t[glim+%d wrt ..gotpc]" % (4*index)) 78 print("%endif") 79 print("ENDPROC gl%s" % func_name) 80 print("") 80 81 81 82 82 print ';'83 print '; No-op stubs'84 print ';'83 print(';') 84 print('; No-op stubs') 85 print(';') 85 86 86 87 # Now generate no-op stub functions 87 88 for func_name in allkeys: 88 89 if "stub" in apiutil.ChromiumProps(func_name): 89 print "BEGINPROC_EXPORTED gl%s" % func_name90 print "\tleave"91 print "\tret"92 print "ENDPROC gl%s" % func_name93 print ""90 print("BEGINPROC_EXPORTED gl%s" % func_name) 91 print("\tleave") 92 print("\tret") 93 print("ENDPROC gl%s" % func_name) 94 print("") 94 95 95 96 -
trunk/src/VBox/Additions/common/crOpenGL/SunOS_i386_exports_dri.py
r62521 r63939 11 11 """ 12 12 13 from __future__ import print_function 13 14 import sys 14 15 … … 23 24 # The order is very important - it must match cr_opcodes.h 24 25 # and spu_dispatch_table.h 25 print '%include "iprt/asmdefs.mac"'26 print ""27 print "%ifdef RT_ARCH_AMD64"28 print "extern glim"29 print "%else ; X86"30 print "extern glim"31 print "%endif"32 print ""26 print('%include "iprt/asmdefs.mac"') 27 print("") 28 print("%ifdef RT_ARCH_AMD64") 29 print("extern glim") 30 print("%else ; X86") 31 print("extern glim") 32 print("%endif") 33 print("") 33 34 34 35 keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt") … … 41 42 continue 42 43 43 print "BEGINPROC_EXPORTED cr_gl%s" % func_name44 print "%ifdef RT_ARCH_AMD64"45 print "\tjmp \t[glim+%d wrt rip wrt ..gotpcrel]" % (8*index)46 print "%else ; X86"47 print "\tjmp \t[glim+%d wrt ..gotpc]" % (4*index)48 print "%endif"49 print "ENDPROC cr_gl%s" % func_name50 print ""44 print("BEGINPROC_EXPORTED cr_gl%s" % func_name) 45 print("%ifdef RT_ARCH_AMD64") 46 print("\tjmp \t[glim+%d wrt rip wrt ..gotpcrel]" % (8*index)) 47 print("%else ; X86") 48 print("\tjmp \t[glim+%d wrt ..gotpc]" % (4*index)) 49 print("%endif") 50 print("ENDPROC cr_gl%s" % func_name) 51 print("") 51 52 52 53 53 print ';'54 print '; Aliases'55 print ';'54 print(';') 55 print('; Aliases') 56 print(';') 56 57 57 58 # Now loop over all the functions and take care of any aliases … … 70 71 # this dict lookup should never fail (raise an exception)! 71 72 index = keys.index(alias) 72 print "BEGINPROC_EXPORTED cr_gl%s" % func_name73 print "%ifdef RT_ARCH_AMD64"74 print "\tjmp \t[glim+%d wrt rip wrt ..gotpcrel]" % (8*index)75 print "%else ; X86"76 print "\tjmp \t[glim+%d wrt ..gotpc]" % (4*index)77 print "%endif"78 print "ENDPROC cr_gl%s" % func_name79 print ""73 print("BEGINPROC_EXPORTED cr_gl%s" % func_name) 74 print("%ifdef RT_ARCH_AMD64") 75 print("\tjmp \t[glim+%d wrt rip wrt ..gotpcrel]" % (8*index)) 76 print("%else ; X86") 77 print("\tjmp \t[glim+%d wrt ..gotpc]" % (4*index)) 78 print("%endif") 79 print("ENDPROC cr_gl%s" % func_name) 80 print("") 80 81 81 82 82 print ';'83 print '; No-op stubs'84 print ';'83 print(';') 84 print('; No-op stubs') 85 print(';') 85 86 86 87 # Now generate no-op stub functions 87 88 for func_name in allkeys: 88 89 if "stub" in apiutil.ChromiumProps(func_name): 89 print "BEGINPROC_EXPORTED cr_gl%s" % func_name90 print "\tleave"91 print "\tret"92 print "ENDPROC cr_gl%s" % func_name93 print ""90 print("BEGINPROC_EXPORTED cr_gl%s" % func_name) 91 print("\tleave") 92 print("\tret") 93 print("ENDPROC cr_gl%s" % func_name) 94 print("") 94 95 95 96 -
trunk/src/VBox/Additions/common/crOpenGL/SunOS_i386_glxapi_exports.py
r62521 r63939 11 11 """ 12 12 13 from __future__ import print_function 13 14 import sys 14 15 … … 80 81 ]; 81 82 82 print '%include "iprt/asmdefs.mac"'83 print ""84 print "%ifdef RT_ARCH_AMD64"85 print "extern glxim"86 print "%else ; X86"87 print "extern glxim"88 print "%endif"89 print ""83 print('%include "iprt/asmdefs.mac"') 84 print("") 85 print("%ifdef RT_ARCH_AMD64") 86 print("extern glxim") 87 print("%else ; X86") 88 print("extern glxim") 89 print("%endif") 90 print("") 90 91 91 92 for index in range(len(glx_functions)): 92 93 func_name = glx_functions[index] 93 94 94 print "BEGINPROC_EXPORTED vbox_glX%s" % func_name95 print "%ifdef RT_ARCH_AMD64"96 print "\tjmp \t[glxim+%d wrt rip wrt ..gotpcrel]" % (8*index)97 print "%else ; X86"98 print "\tjmp \t[glxim+%d wrt ..gotpc]" % (4*index)99 print "%endif"100 print "ENDPROC vbox_glX%s" % func_name101 print ""95 print("BEGINPROC_EXPORTED vbox_glX%s" % func_name) 96 print("%ifdef RT_ARCH_AMD64") 97 print("\tjmp \t[glxim+%d wrt rip wrt ..gotpcrel]" % (8*index)) 98 print("%else ; X86") 99 print("\tjmp \t[glxim+%d wrt ..gotpc]" % (4*index)) 100 print("%endif") 101 print("ENDPROC vbox_glX%s" % func_name) 102 print("") 102 103 -
trunk/src/VBox/Additions/common/crOpenGL/cr_gl.py
r62521 r63939 1 print """ 1 from __future__ import print_function 2 print(""" 2 3 /** @file 3 4 * VBox OpenGL chromium functions header … … 15 16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 16 17 */ 17 """ 18 """) 18 19 # Copyright (c) 2001, Stanford University 19 20 # All rights reserved. … … 27 28 apiutil.CopyrightC() 28 29 29 print 30 print(""" 30 31 /* DO NOT EDIT - THIS FILE GENERATED BY THE cr_gl.py SCRIPT */ 31 32 #ifndef __CR_GL_H__ … … 41 42 #endif 42 43 43 """ 44 """) 44 45 45 46 … … 59 60 params = apiutil.Parameters(func_name) 60 61 61 print 62 apiutil.MakeDeclarationString( params )) 62 print("extern %s cr_gl%s( %s );" % (return_type, func_name, 63 apiutil.MakeDeclarationString( params ))) 63 64 64 print "#endif /* __CR_GL_H__ */"65 print("#endif /* __CR_GL_H__ */") -
trunk/src/VBox/Additions/common/crOpenGL/defs.py
r48999 r63939 4 4 # See the file LICENSE.txt for information on redistributing this software. 5 5 6 from __future__ import print_function 6 7 import sys 7 8 … … 13 14 #print "LIBRARY VBoxOGL" 14 15 #print "DESCRIPTION \"\"" - warning LNK4017: DESCRIPTION statement not supported for the target platform; ignored 15 print "EXPORTS"16 print("EXPORTS") 16 17 17 18 # XXX can't these values be automatically computed by analyzing parameters? … … 424 425 continue 425 426 try: 426 print "gl%s@%d = cr_gl%s" % (func_name,stack_sizes[func_name],func_name)427 print("gl%s@%d = cr_gl%s" % (func_name,stack_sizes[func_name],func_name)) 427 428 except KeyError: 428 429 pass … … 456 457 "wglGetPixelFormatAttribfvEXT", 457 458 "wglGetExtensionsStringEXT"): 458 print "%s = %s_prox" % (func_name,func_name)459 print("%s = %s_prox" % (func_name,func_name)) 459 460 460 461 """ … … 475 476 """ 476 477 477 print 478 print("""DrvCopyContext 478 479 DrvCreateContext 479 480 DrvCreateLayerContext … … 491 492 DrvSetContext@12 = DrvSetContext 492 493 DrvValidateVersion@4 = DrvValidateVersion 493 DrvSetPixelFormat@8 = DrvSetPixelFormat""" 494 495 print 494 DrvSetPixelFormat@8 = DrvSetPixelFormat""") 495 496 print("""crCreateContext 496 497 crMakeCurrent 497 498 crSwapBuffers … … 501 502 VBoxGetWindowId 502 503 VBoxGetContextId 503 VBoxFlushToHost""" 504 VBoxFlushToHost""") 504 505 #print "DllMain" -
trunk/src/VBox/Additions/common/crOpenGL/defs64.py
r48999 r63939 4 4 # See the file LICENSE.txt for information on redistributing this software. 5 5 6 from __future__ import print_function 6 7 import sys 7 8 … … 12 13 #print "LIBRARY VBoxOGL" 13 14 #print "DESCRIPTION \"\"" - warning LNK4017: DESCRIPTION statement not supported for the target platform; ignored 14 print "EXPORTS"15 print("EXPORTS") 15 16 16 17 # XXX can't these values be automatically computed by analyzing parameters? … … 423 424 continue 424 425 if func_name in exports_special: 425 print "gl%s = cr_gl%s" % (func_name,func_name)426 print("gl%s = cr_gl%s" % (func_name,func_name)) 426 427 427 428 for func_name in ( "wglChoosePixelFormat", … … 453 454 "wglGetPixelFormatAttribfvEXT", 454 455 "wglGetExtensionsStringEXT"): 455 print "%s = %s_prox" % (func_name,func_name)456 457 print 456 print("%s = %s_prox" % (func_name,func_name)) 457 458 print("""DrvCopyContext 458 459 DrvCreateContext 459 460 DrvCreateLayerContext … … 471 472 DrvSetContext = DrvSetContext 472 473 DrvValidateVersion = DrvValidateVersion 473 DrvSetPixelFormat = DrvSetPixelFormat""" 474 475 print 474 DrvSetPixelFormat = DrvSetPixelFormat""") 475 476 print("""crCreateContext 476 477 crMakeCurrent 477 478 crSwapBuffers … … 481 482 VBoxGetWindowId 482 483 VBoxGetContextId 483 VBoxFlushToHost""" 484 VBoxFlushToHost""") 484 485 #print "DllMain" -
trunk/src/VBox/Additions/common/crOpenGL/entrypoints.py
r63205 r63939 11 11 12 12 13 from __future__ import print_function 13 14 import sys 14 15 … … 23 24 apiutil.CopyrightC() 24 25 25 print '#define GL_GLEXT_PROTOTYPES'26 print '#include <stdio.h>'27 print '#include <stdlib.h>'28 print '#include <GL/gl.h>'29 print '#include "chromium.h"'30 print '#include "stub.h"'31 print '#include "dri_glx.h"'32 print ''33 print '#ifdef __GNUC__';34 print '# if (__GNUC__ << 16) + __GNUC_MINOR__ >= 0x40002';35 print '# pragma GCC diagnostic ignored "-Wunused-parameter"';36 print '# endif';37 print '#endif';26 print('#define GL_GLEXT_PROTOTYPES') 27 print('#include <stdio.h>') 28 print('#include <stdlib.h>') 29 print('#include <GL/gl.h>') 30 print('#include "chromium.h"') 31 print('#include "stub.h"') 32 print('#include "dri_glx.h"') 33 print('') 34 print('#ifdef __GNUC__') 35 print('# if (__GNUC__ << 16) + __GNUC_MINOR__ >= 0x40002') 36 print('# pragma GCC diagnostic ignored "-Wunused-parameter"') 37 print('# endif') 38 print('#endif') 38 39 39 40 … … 53 54 54 55 if func_name in hacks: 55 print "/* hacked entrypoint: %s */" % func_name56 print("/* hacked entrypoint: %s */" % func_name) 56 57 if func_name == "TexImage3D": 57 58 # Pretty common: internalformat is GLenum, not GLint 58 print "void glTexImage3D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels )"59 print "{"60 print "\tglim.TexImage3D( target, level, (GLint) internalformat, width, height, depth, border, format, type, pixels );"61 print "}"59 print("void glTexImage3D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels )") 60 print("{") 61 print("\tglim.TexImage3D( target, level, (GLint) internalformat, width, height, depth, border, format, type, pixels );") 62 print("}") 62 63 elif func_name == "TexImage2D": 63 64 # Pretty common: internalformat is GLenum, not GLint 64 print "void glTexImage2D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels )"65 print "{"66 print "\tglim.TexImage2D( target, level, (GLint) internalformat, width, height, border, format, type, pixels );"67 print "}"65 print("void glTexImage2D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels )") 66 print("{") 67 print("\tglim.TexImage2D( target, level, (GLint) internalformat, width, height, border, format, type, pixels );") 68 print("}") 68 69 elif func_name == "TexImage1D": 69 70 # Pretty common: internalformat is GLenum, not GLint 70 print "void glTexImage1D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels )"71 print "{"72 print "\tglim.TexImage1D( target, level, (GLint) internalformat, width, border, format, type, pixels );"73 print "}"71 print("void glTexImage1D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels )") 72 print("{") 73 print("\tglim.TexImage1D( target, level, (GLint) internalformat, width, border, format, type, pixels );") 74 print("}") 74 75 elif func_name == "EdgeFlagPointer": 75 76 # second arg is GLboolean instead of GLvoid 76 print "void glEdgeFlagPointer( GLsizei stride, const GLboolean *pointer )"77 print "{"78 print "\tglim.EdgeFlagPointer( stride, pointer );"79 print "}"77 print("void glEdgeFlagPointer( GLsizei stride, const GLboolean *pointer )") 78 print("{") 79 print("\tglim.EdgeFlagPointer( stride, pointer );") 80 print("}") 80 81 elif func_name == "ProgramParameters4fvNV": 81 print "void glProgramParameters4fvNV( GLenum target, GLuint index, GLuint num, const GLfloat *params )"82 print "{"83 print "\tglim.ProgramParameters4fvNV( target, index, num, params );"84 print "}"82 print("void glProgramParameters4fvNV( GLenum target, GLuint index, GLuint num, const GLfloat *params )") 83 print("{") 84 print("\tglim.ProgramParameters4fvNV( target, index, num, params );") 85 print("}") 85 86 elif func_name == "MultiDrawElementsEXT": 86 print "void glMultiDrawElementsEXT(GLenum mode, GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount)"87 print "{"88 print "\tglim.MultiDrawElementsEXT(mode, count,type, indices, primcount);"89 print "}"87 print("void glMultiDrawElementsEXT(GLenum mode, GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount)") 88 print("{") 89 print("\tglim.MultiDrawElementsEXT(mode, count,type, indices, primcount);") 90 print("}") 90 91 elif func_name == "ProgramParameters4dvNV": 91 print "void glProgramParameters4dvNV( GLenum target, GLuint index, GLuint num, const GLdouble *params )"92 print "{"93 print "\tglim.ProgramParameters4dvNV( target, index, num, params );"94 print "}"92 print("void glProgramParameters4dvNV( GLenum target, GLuint index, GLuint num, const GLdouble *params )") 93 print("{") 94 print("\tglim.ProgramParameters4dvNV( target, index, num, params );") 95 print("}") 95 96 else: 96 97 # the usual path 97 print "%s VBOXGLTAG(gl%s)( %s );" % (return_type, func_name, apiutil.MakeDeclarationString(params))98 print ""99 print "%s VBOXGLTAG(gl%s)( %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params))100 print "{"101 print "\t",98 print("%s VBOXGLTAG(gl%s)( %s );" % (return_type, func_name, apiutil.MakeDeclarationString(params))) 99 print("") 100 print("%s VBOXGLTAG(gl%s)( %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params))) 101 print("{") 102 print("\t", end="") 102 103 if return_type != "void": 103 print "return ",104 print "glim.%s( %s );" % (func_name, apiutil.MakeCallString(params))105 print "}"106 print ""104 print("return ", end=" ") 105 print("glim.%s( %s );" % (func_name, apiutil.MakeCallString(params))) 106 print("}") 107 print("") 107 108 108 print '/*'109 print '* Aliases'110 print '*/'109 print('/*') 110 print('* Aliases') 111 print('*/') 111 112 112 113 # Now loop over all the functions and take care of any aliases … … 124 125 if alias: 125 126 if func_name in hacks: 126 print "/* hacked entrypoint: %s */" % func_name127 print("/* hacked entrypoint: %s */" % func_name) 127 128 if func_name == "MultiDrawArrays": 128 print "void glMultiDrawArrays( GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount )"129 print "{"130 print "\tglim.MultiDrawArraysEXT( mode, (GLint*)first, (GLsizei*)count, primcount );"131 print "}"129 print("void glMultiDrawArrays( GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount )") 130 print("{") 131 print("\tglim.MultiDrawArraysEXT( mode, (GLint*)first, (GLsizei*)count, primcount );") 132 print("}") 132 133 elif func_name == "BufferData": 133 print "void glBufferData(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage)"134 print "{"135 print "\tglim.BufferDataARB(target, size, data, usage);"136 print "}"134 print("void glBufferData(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage)") 135 print("{") 136 print("\tglim.BufferDataARB(target, size, data, usage);") 137 print("}") 137 138 elif func_name == "BufferSubData": 138 print "void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data)"139 print "{"140 print "\tglim.BufferSubDataARB(target, offset, size, data);"141 print "}"139 print("void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data)") 140 print("{") 141 print("\tglim.BufferSubDataARB(target, offset, size, data);") 142 print("}") 142 143 elif func_name == "GetBufferSubData": 143 print "void glGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data)"144 print "{"145 print "\tglim.GetBufferSubDataARB(target, offset, size, data);"146 print "}"144 print("void glGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data)") 145 print("{") 146 print("\tglim.GetBufferSubDataARB(target, offset, size, data);") 147 print("}") 147 148 else: 148 149 return_type = apiutil.ReturnType(func_name) 149 150 params = apiutil.Parameters(func_name) 150 print "%s VBOXGLTAG(gl%s)( %s );" % (return_type, func_name, apiutil.MakeDeclarationString(params))151 print ""152 print "%s VBOXGLTAG(gl%s)( %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params))153 print "{"154 print "\t",151 print("%s VBOXGLTAG(gl%s)( %s );" % (return_type, func_name, apiutil.MakeDeclarationString(params))) 152 print("") 153 print("%s VBOXGLTAG(gl%s)( %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params))) 154 print("{") 155 print("\t", end="") 155 156 if return_type != "void": 156 print "return ",157 print "glim.%s( %s );" % (alias, apiutil.MakeCallString(params))158 print "}"159 print ""157 print("return ", end=" ") 158 print("glim.%s( %s );" % (alias, apiutil.MakeCallString(params))) 159 print("}") 160 print("") 160 161 161 print '/*'162 print '* No-op stubs'163 print '*/'162 print('/*') 163 print('* No-op stubs') 164 print('*/') 164 165 165 166 # Now generate no-op stub functions … … 169 170 params = apiutil.Parameters(func_name) 170 171 171 print "%s VBOXGLTAG(gl%s)( %s );" % (return_type, func_name, apiutil.MakeDeclarationString(params))172 print ""173 print "%s VBOXGLTAG(gl%s)( %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params))174 print "{"172 print("%s VBOXGLTAG(gl%s)( %s );" % (return_type, func_name, apiutil.MakeDeclarationString(params))) 173 print("") 174 print("%s VBOXGLTAG(gl%s)( %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params))) 175 print("{") 175 176 if return_type != "void": 176 print "return (%s) 0" % return_type177 print "}"178 print ""177 print("return (%s) 0" % return_type) 178 print("}") 179 print("") 179 180 180 181 -
trunk/src/VBox/Additions/common/crOpenGL/feedback/feedback.py
r17269 r63939 4 4 # See the file LICENSE.txt for information on redistributing this software. 5 5 6 from __future__ import print_function 6 7 import sys 7 8 … … 11 12 apiutil.CopyrightC() 12 13 13 print 14 print(""" 14 15 /* DO NOT EDIT - generated by feedback.py */ 15 16 #include <stdio.h> … … 20 21 #include "cr_glstate.h" 21 22 22 """ 23 """) 23 24 24 25 keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt") … … 28 29 params = apiutil.Parameters(func_name) 29 30 if apiutil.FindSpecial( "feedback", func_name ): 30 print 'static %s FEEDBACKSPU_APIENTRY feedbackspu_%s( %s )' % ( return_type, func_name, apiutil.MakeDeclarationString(params))31 print '{'32 print '\tfeedback_spu.super.%s( %s );' % ( func_name, apiutil.MakeCallString(params))33 print '}'34 35 36 37 print 31 print('static %s FEEDBACKSPU_APIENTRY feedbackspu_%s( %s )' % ( return_type, func_name, apiutil.MakeDeclarationString(params) )) 32 print('{') 33 print('\tfeedback_spu.super.%s( %s );' % ( func_name, apiutil.MakeCallString(params) )) 34 print('}') 35 36 37 38 print(""" 38 39 #define CHANGE( name, func ) crSPUChangeInterface( (void *)&(feedback_spu.self), (void *)feedback_spu.self.name, (void *)((SPUGenericFunction) func) ) 39 40 #define CHANGESWAP( name, swapfunc, regfunc ) crSPUChangeInterface( (void *)&(feedback_spu.self), (void *)feedback_spu.self.name, (void *)((SPUGenericFunction) (feedback_spu.swap ? swapfunc: regfunc )) ) … … 41 42 static void __loadFeedbackAPI( void ) 42 43 { 43 """ 44 """) 44 45 for func_name in keys: 45 46 return_type = apiutil.ReturnType(func_name) 46 47 params = apiutil.Parameters(func_name) 47 48 if apiutil.FindSpecial( "feedback", func_name ): 48 print '\tCHANGE( %s, crStateFeedback%s );' % (func_name, func_name)49 print 49 print('\tCHANGE( %s, crStateFeedback%s );' % (func_name, func_name )) 50 print(""" 50 51 } 51 52 52 53 static void __loadSelectAPI( void ) 53 54 { 54 """ 55 """) 55 56 for func_name in keys: 56 57 if apiutil.FindSpecial( "select", func_name ): 57 print '\tCHANGE( %s, crStateSelect%s );' % (func_name, func_name)58 print('\tCHANGE( %s, crStateSelect%s );' % (func_name, func_name )) 58 59 elif apiutil.FindSpecial( "feedback", func_name ): 59 print '\tCHANGE( %s, feedbackspu_%s );' % (func_name, func_name)60 print 60 print('\tCHANGE( %s, feedbackspu_%s );' % (func_name, func_name )) 61 print(""" 61 62 } 62 63 63 64 static void __loadRenderAPI( void ) 64 65 { 65 """ 66 """) 66 67 67 68 for func_name in keys: 68 69 return_type = apiutil.ReturnType(func_name) 69 70 if apiutil.FindSpecial( "feedback", func_name ) or apiutil.FindSpecial( "select", func_name ): 70 print '\tCHANGE( %s, feedbackspu_%s );' % (func_name, func_name)71 print 72 } 73 """ 74 75 print 71 print('\tCHANGE( %s, feedbackspu_%s );' % (func_name, func_name )) 72 print(""" 73 } 74 """) 75 76 print(""" 76 77 static GLint FEEDBACKSPU_APIENTRY feedbackspu_RenderMode ( GLenum mode ) 77 78 { … … 211 212 212 213 SPUNamedFunctionTable _cr_feedback_table[] = { 213 """ 214 """) 214 215 215 216 for func_name in keys: 216 217 if apiutil.FindSpecial( "feedback_state", func_name ): 217 print '\t{ "%s", (SPUGenericFunction) feedbackspu_%s }, ' % ( func_name, func_name)218 print 218 print('\t{ "%s", (SPUGenericFunction) feedbackspu_%s }, ' % ( func_name, func_name )) 219 print(""" 219 220 { "GetBooleanv", (SPUGenericFunction) feedbackspu_GetBooleanv }, 220 221 { "GetDoublev", (SPUGenericFunction) feedbackspu_GetDoublev }, … … 267 268 { NULL, NULL } 268 269 }; 269 """ 270 """) -
trunk/src/VBox/Additions/common/crOpenGL/feedback/feedback_funcs.py
r17269 r63939 4 4 # See the file LICENSE.txt for information on redistributing this software. 5 5 6 from __future__ import print_function 6 7 import sys 7 8 … … 11 12 apiutil.CopyrightC() 12 13 13 print 14 print(""" 14 15 /* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED BY feedback_funcs.py SCRIPT */ 15 16 #ifndef CR_STATE_FEEDBACK_FUNCS_H … … 24 25 #endif 25 26 26 #define STATE_UNUSED(x) ((void)x)""" 27 #define STATE_UNUSED(x) ((void)x)""") 27 28 28 29 keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt") … … 31 32 return_type = apiutil.ReturnType(func_name) 32 33 params = apiutil.Parameters(func_name) 33 print '%s STATE_APIENTRY crStateFeedback%s( %s );' % (return_type, func_name, apiutil.MakeDeclarationString(params))34 print('%s STATE_APIENTRY crStateFeedback%s( %s );' % (return_type, func_name, apiutil.MakeDeclarationString(params))) 34 35 35 36 for func_name in apiutil.AllSpecials( "select" ): 36 37 return_type = apiutil.ReturnType(func_name) 37 38 params = apiutil.Parameters(func_name) 38 print '%s STATE_APIENTRY crStateSelect%s( %s );' % (return_type, func_name, apiutil.MakeDeclarationString(params))39 print '\n#endif /* CR_STATE_FEEDBACK_FUNCS_H */'39 print('%s STATE_APIENTRY crStateSelect%s( %s );' % (return_type, func_name, apiutil.MakeDeclarationString(params))) 40 print('\n#endif /* CR_STATE_FEEDBACK_FUNCS_H */') -
trunk/src/VBox/Additions/common/crOpenGL/feedback/feedback_state.py
r42499 r63939 4 4 # See the file LICENSE.txt for information on redistributing this software. 5 5 6 from __future__ import print_function 6 7 import sys 7 8 … … 11 12 apiutil.CopyrightC() 12 13 13 print 14 print(""" 14 15 #include "cr_server.h" 15 16 #include "feedbackspu.h" 16 17 #include "feedbackspu_proto.h" 17 """ 18 """) 18 19 custom = ["CreateContext", "VBoxCreateContext", "MakeCurrent", "DestroyContext"] 19 20 … … 26 27 return_type = apiutil.ReturnType(func_name) 27 28 params = apiutil.Parameters(func_name) 28 print '%s FEEDBACKSPU_APIENTRY feedbackspu_%s( %s )' % (return_type, func_name, apiutil.MakeDeclarationString(params))29 print '{'30 print '\tcrState%s( %s );' % (func_name, apiutil.MakeCallString(params))31 print ''32 print '\tfeedback_spu.super.%s( %s );' % (func_name, apiutil.MakeCallString(params))33 print '}'29 print('%s FEEDBACKSPU_APIENTRY feedbackspu_%s( %s )' % (return_type, func_name, apiutil.MakeDeclarationString(params))) 30 print('{') 31 print('\tcrState%s( %s );' % (func_name, apiutil.MakeCallString(params))) 32 print('') 33 print('\tfeedback_spu.super.%s( %s );' % (func_name, apiutil.MakeCallString(params))) 34 print('}') -
trunk/src/VBox/Additions/common/crOpenGL/feedback/feedbackspu_proto.py
r17269 r63939 4 4 # See the file LICENSE.txt for information on redistributing this software. 5 5 6 from __future__ import print_function 6 7 import sys 7 8 … … 11 12 apiutil.CopyrightC() 12 13 13 print 14 print(""" 14 15 /* DO NOT EDIT - generated by feedback.py */ 15 16 … … 19 20 #include "feedbackspu.h" 20 21 21 """ 22 """) 22 23 23 24 keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt") … … 27 28 return_type = apiutil.ReturnType(func_name) 28 29 params = apiutil.Parameters(func_name) 29 print 'extern %s FEEDBACKSPU_APIENTRY feedbackspu_%s( %s );' % (return_type, func_name, apiutil.MakeDeclarationString(params))30 print('extern %s FEEDBACKSPU_APIENTRY feedbackspu_%s( %s );' % (return_type, func_name, apiutil.MakeDeclarationString(params))) 30 31 31 32 32 print 33 print(""" 33 34 #endif 34 """ 35 """) -
trunk/src/VBox/Additions/common/crOpenGL/getprocaddress.py
r51200 r63939 4 4 # See the file LICENSE.txt for information on redistributing this software. 5 5 6 from __future__ import print_function 6 7 import sys 7 8 … … 10 11 apiutil.CopyrightC() 11 12 12 print 13 print(""" 13 14 /* DO NOT EDIT - THIS FILE GENERATED BY THE getprocaddress.py SCRIPT */ 14 15 … … 30 31 31 32 static struct name_address functions[] = { 32 """ 33 """) 33 34 34 35 … … 48 49 address = "VBOXGLTAG(gl" + func_name + ")" 49 50 if wrap: 50 print '#ifdef CR_%s' % wrap51 print '\t{ "%s", (CR_PROC) %s },' % (name, address)51 print('#ifdef CR_%s' % wrap) 52 print('\t{ "%s", (CR_PROC) %s },' % (name, address)) 52 53 if wrap: 53 print '#endif'54 print('#endif') 54 55 55 56 56 print "\t/* Chromium binding/glue functions */"57 print("\t/* Chromium binding/glue functions */") 57 58 58 59 for func_name in keys: … … 63 64 continue 64 65 if apiutil.Category(func_name) == "Chromium": 65 print '\t{ "cr%s", (CR_PROC) cr%s },' % (func_name, func_name)66 print('\t{ "cr%s", (CR_PROC) cr%s },' % (func_name, func_name)) 66 67 67 68 68 print 69 print(""" 69 70 { NULL, NULL } 70 71 }; … … 102 103 } 103 104 104 """ 105 """) 105 106 106 107 -
trunk/src/VBox/Additions/common/crOpenGL/pack/pack.py
r20083 r63939 4 4 # See the file LICENSE.txt for information on redistributing this software. 5 5 6 from __future__ import print_function 6 7 import sys 7 8 … … 14 15 apiutil.CopyrightC() 15 16 16 print 17 print(""" 17 18 /* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED BY pack.py SCRIPT */ 18 19 #include <stdio.h> … … 22 23 #include "cr_packfunctions.h" 23 24 #include "packspu_proto.h" 24 """ 25 """) 25 26 26 27 num_funcs = len(keys) - len(apiutil.AllSpecials('packspu_unimplemented')) 27 print 'SPUNamedFunctionTable _cr_pack_table[%d];' % (num_funcs+1)28 print('SPUNamedFunctionTable _cr_pack_table[%d];' % (num_funcs+1)) 28 29 29 print 30 print(""" 30 31 static void __fillin( int offset, char *name, SPUGenericFunction func ) 31 32 { 32 33 _cr_pack_table[offset].name = crStrdup( name ); 33 34 _cr_pack_table[offset].fn = func; 34 }""" 35 }""") 35 36 36 37 pack_specials = [] … … 43 44 pack_specials.append( func_name ) 44 45 45 print '\nvoid packspuCreateFunctions( void )'46 print '{'46 print('\nvoid packspuCreateFunctions( void )') 47 print('{') 47 48 for index in range(len(keys)): 48 49 func_name = keys[index] … … 50 51 continue 51 52 if func_name in pack_specials: 52 print '\t__fillin( %3d, "%s", (SPUGenericFunction) packspu_%s );' % (index, func_name, func_name)53 print('\t__fillin( %3d, "%s", (SPUGenericFunction) packspu_%s );' % (index, func_name, func_name )) 53 54 else: 54 print '\t__fillin( %3d, "%s", (SPUGenericFunction) (pack_spu.swap ? crPack%sSWAP : crPack%s) );' % (index, func_name, func_name, func_name)55 print '\t__fillin( %3d, NULL, NULL );' % num_funcs56 print '}'55 print('\t__fillin( %3d, "%s", (SPUGenericFunction) (pack_spu.swap ? crPack%sSWAP : crPack%s) );' % (index, func_name, func_name, func_name )) 56 print('\t__fillin( %3d, NULL, NULL );' % num_funcs) 57 print('}') -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_beginend.py
r63206 r63939 4 4 # See the file LICENSE.txt for information on redistributing this software. 5 5 6 from __future__ import print_function 6 7 import sys 7 8 … … 11 12 apiutil.CopyrightC() 12 13 13 print 14 print("""/* DO NOT EDIT - AUTOMATICALLY GENERATED BY packspu_beginend.py */ 14 15 #include "packspu.h" 15 16 #include "assert.h" … … 157 158 DoVertex(); 158 159 } 159 """ 160 """) 160 161 161 162 keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt") … … 163 164 for func_name in apiutil.AllSpecials( "packspu_vertex" ): 164 165 params = apiutil.Parameters(func_name) 165 print 'void PACKSPU_APIENTRY packspu_%s( %s )' % ( func_name, apiutil.MakeDeclarationString(params))166 print '{'167 print '\tif (pack_spu.swap)'168 print '\t{'169 print '\t\tcrPack%sSWAP( %s );' % ( func_name, apiutil.MakeCallString( params ))170 print '\t}'171 print '\telse'172 print '\t{'173 print '\t\tcrPack%s( %s );' % ( func_name, apiutil.MakeCallString( params ))174 print '\t}'175 print '\tRunState();'176 print '}'166 print('void PACKSPU_APIENTRY packspu_%s( %s )' % ( func_name, apiutil.MakeDeclarationString(params) )) 167 print('{') 168 print('\tif (pack_spu.swap)') 169 print('\t{') 170 print('\t\tcrPack%sSWAP( %s );' % ( func_name, apiutil.MakeCallString( params ) )) 171 print('\t}') 172 print('\telse') 173 print('\t{') 174 print('\t\tcrPack%s( %s );' % ( func_name, apiutil.MakeCallString( params ) )) 175 print('\t}') 176 print('\tRunState();') 177 print('}') -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_flush.py
r20083 r63939 4 4 # See the file LICENSE.txt for information on redistributing this software. 5 5 6 from __future__ import print_function 6 7 import sys 7 8 … … 11 12 apiutil.CopyrightC() 12 13 13 print 14 print(""" 14 15 /* DO NOT EDIT - this file generated by packspu_flush.py script */ 15 16 … … 21 22 #include "packspu.h" 22 23 #include "packspu_proto.h" 23 """ 24 """) 24 25 25 26 keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt") … … 27 28 for func_name in apiutil.AllSpecials( "packspu_flush" ): 28 29 params = apiutil.Parameters(func_name) 29 print 'void PACKSPU_APIENTRY packspu_%s( %s )' % ( func_name, apiutil.MakeDeclarationString(params))30 print '{'31 print '\tGET_THREAD(thread);'32 print '\tif (pack_spu.swap)'33 print '\t{'34 print '\t\tcrPack%sSWAP( %s );' % ( func_name, apiutil.MakeCallString( params ))35 print '\t}'36 print '\telse'37 print '\t{'38 print '\t\tcrPack%s( %s );' % ( func_name, apiutil.MakeCallString( params ))39 print '\t}'40 print '\tpackspuFlush( (void *) thread );'41 print '}\n'30 print('void PACKSPU_APIENTRY packspu_%s( %s )' % ( func_name, apiutil.MakeDeclarationString(params))) 31 print('{') 32 print('\tGET_THREAD(thread);') 33 print('\tif (pack_spu.swap)') 34 print('\t{') 35 print('\t\tcrPack%sSWAP( %s );' % ( func_name, apiutil.MakeCallString( params ) )) 36 print('\t}') 37 print('\telse') 38 print('\t{') 39 print('\t\tcrPack%s( %s );' % ( func_name, apiutil.MakeCallString( params ) )) 40 print('\t}') 41 print('\tpackspuFlush( (void *) thread );') 42 print('}\n') -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_get.py
r63206 r63939 4 4 # See the file LICENSE.txt for information on redistributing this software. 5 5 6 from __future__ import print_function 6 7 import sys 7 8 … … 11 12 apiutil.CopyrightC() 12 13 13 print 14 print(""" 14 15 /* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED BY packspu_get.py SCRIPT */ 15 16 #include "packspu.h" … … 18 19 #include "cr_mem.h" 19 20 #include "packspu_proto.h" 20 """ 21 22 print 21 """) 22 23 print(""" 23 24 static GLboolean crPackIsPixelStoreParm(GLenum pname) 24 25 { … … 46 47 return GL_FALSE; 47 48 } 48 """ 49 """) 49 50 50 51 from get_sizes import * … … 85 86 86 87 if "get" in apiutil.Properties(func_name): 87 print '%s PACKSPU_APIENTRY packspu_%s( %s )' % ( return_type, func_name, apiutil.MakeDeclarationString( params ))88 print '{'89 print '\tGET_THREAD(thread);'90 print '\tint writeback = 1;'88 print('%s PACKSPU_APIENTRY packspu_%s( %s )' % ( return_type, func_name, apiutil.MakeDeclarationString( params ) )) 89 print('{') 90 print('\tGET_THREAD(thread);') 91 print('\tint writeback = 1;') 91 92 if return_type != 'void': 92 print '\t%s return_val = (%s) 0;' % (return_type, return_type)93 print('\t%s return_val = (%s) 0;' % (return_type, return_type)) 93 94 params.append( ("&return_val", "foo", 0) ) 94 if (func_name in easy_swaps .keys() and easy_swaps[func_name] != '0') or func_name in simple_funcs or func_name in hard_funcs.keys():95 print '\tunsigned int i;'96 print '\tif (!CRPACKSPU_IS_WDDM_CRHGSMI() && !(pack_spu.thread[pack_spu.idxThreadInUse].netServer.conn->actual_network))'97 print '\t{'98 print '\t\tcrError( "packspu_%s doesn\'t work when there\'s no actual network involved!\\nTry using the simplequery SPU in your chain!" );' % func_name99 print '\t}'95 if (func_name in easy_swaps and easy_swaps[func_name] != '0') or func_name in simple_funcs or func_name in hard_funcs: 96 print('\tunsigned int i;') 97 print('\tif (!CRPACKSPU_IS_WDDM_CRHGSMI() && !(pack_spu.thread[pack_spu.idxThreadInUse].netServer.conn->actual_network))') 98 print('\t{') 99 print('\t\tcrError( "packspu_%s doesn\'t work when there\'s no actual network involved!\\nTry using the simplequery SPU in your chain!" );' % func_name) 100 print('\t}') 100 101 if func_name in simple_funcs: 101 print 102 print(""" 102 103 if (crPackIsPixelStoreParm(pname) 103 104 || pname == GL_DRAW_BUFFER … … 162 163 163 164 } 164 """ % (params[-1][1], params[-1][1], func_name, func_name, apiutil.MakeCallString(params), func_name, func_name) 165 """ % (params[-1][1], params[-1][1], func_name, func_name, apiutil.MakeCallString(params), func_name, func_name)) 165 166 166 167 if func_name in vertattr_get_funcs: 167 print 168 print(""" 168 169 if (pname != GL_CURRENT_VERTEX_ATTRIB_ARB) 169 170 { … … 189 190 return; 190 191 } 191 """ % (params[-1][1], params[-1][1], func_name, func_name, apiutil.MakeCallString(params), func_name, func_name) 192 """ % (params[-1][1], params[-1][1], func_name, func_name, apiutil.MakeCallString(params), func_name, func_name)) 192 193 193 194 params.append( ("&writeback", "foo", 0) ) 194 print '\tif (pack_spu.swap)'195 print '\t{'196 print '\t\tcrPack%sSWAP( %s );' % (func_name, apiutil.MakeCallString( params ))197 print '\t}'198 print '\telse'199 print '\t{'200 print '\t\tcrPack%s( %s );' % (func_name, apiutil.MakeCallString( params ))201 print '\t}'202 print '\tpackspuFlush( (void *) thread );'203 print '\tCRPACKSPU_WRITEBACK_WAIT(thread, writeback);'195 print('\tif (pack_spu.swap)') 196 print('\t{') 197 print('\t\tcrPack%sSWAP( %s );' % (func_name, apiutil.MakeCallString( params ) )) 198 print('\t}') 199 print('\telse') 200 print('\t{') 201 print('\t\tcrPack%s( %s );' % (func_name, apiutil.MakeCallString( params ) )) 202 print('\t}') 203 print('\tpackspuFlush( (void *) thread );') 204 print('\tCRPACKSPU_WRITEBACK_WAIT(thread, writeback);') 204 205 205 206 … … 207 208 lastParamName = params[-2][0] 208 209 if return_type != 'void': 209 print '\tif (pack_spu.swap)'210 print '\t{'211 print '\t\treturn_val = (%s) SWAP32(return_val);' % return_type212 print '\t}'213 print '\treturn return_val;'214 if func_name in easy_swaps .keys()and easy_swaps[func_name] != '0':210 print('\tif (pack_spu.swap)') 211 print('\t{') 212 print('\t\treturn_val = (%s) SWAP32(return_val);' % return_type) 213 print('\t}') 214 print('\treturn return_val;') 215 if func_name in easy_swaps and easy_swaps[func_name] != '0': 215 216 limit = easy_swaps[func_name] 216 print '\tif (pack_spu.swap)'217 print '\t{'218 print '\t\tfor (i = 0 ; i < %s ; i++)' % limit219 print '\t\t{'217 print('\tif (pack_spu.swap)') 218 print('\t{') 219 print('\t\tfor (i = 0 ; i < %s ; i++)' % limit) 220 print('\t\t{') 220 221 if params[-2][1].find( "double" ) > -1: 221 print '\t\t\t%s[i] = SWAPDOUBLE(%s[i]);' % (lastParamName, lastParamName)222 print('\t\t\t%s[i] = SWAPDOUBLE(%s[i]);' % (lastParamName, lastParamName)) 222 223 else: 223 print '\t\t\t%s[i] = SWAP32(%s[i]);' % (lastParamName, lastParamName)224 print '\t\t}'225 print '\t}'224 print('\t\t\t%s[i] = SWAP32(%s[i]);' % (lastParamName, lastParamName)) 225 print('\t\t}') 226 print('\t}') 226 227 for index in range(len(simple_funcs)): 227 228 if simple_funcs[index] == func_name: 228 print '\tif (pack_spu.swap)'229 print '\t{'230 print '\t\tfor (i = 0 ; i < __numValues( pname ) ; i++)'231 print '\t\t{'229 print('\tif (pack_spu.swap)') 230 print('\t{') 231 print('\t\tfor (i = 0 ; i < __numValues( pname ) ; i++)') 232 print('\t\t{') 232 233 if simple_swaps[index] == 'SWAPDOUBLE': 233 print '\t\t\t%s[i] = %s(%s[i]);' % (lastParamName, simple_swaps[index], lastParamName)234 print('\t\t\t%s[i] = %s(%s[i]);' % (lastParamName, simple_swaps[index], lastParamName)) 234 235 else: 235 print '\t\t\t((GLuint *) %s)[i] = %s(%s[i]);' % (lastParamName, simple_swaps[index], lastParamName)236 print '\t\t}'237 print '\t}'238 if func_name in hard_funcs .keys():239 print '\tif (pack_spu.swap)'240 print '\t{'241 print '\t\tfor (i = 0 ; i < crStateHlpComponentsCount(pname) ; i++)'242 print '\t\t{'236 print('\t\t\t((GLuint *) %s)[i] = %s(%s[i]);' % (lastParamName, simple_swaps[index], lastParamName)) 237 print('\t\t}') 238 print('\t}') 239 if func_name in hard_funcs: 240 print('\tif (pack_spu.swap)') 241 print('\t{') 242 print('\t\tfor (i = 0 ; i < crStateHlpComponentsCount(pname) ; i++)') 243 print('\t\t{') 243 244 if hard_funcs[func_name] == 'SWAPDOUBLE': 244 print '\t\t\t%s[i] = %s(%s[i]);' % (lastParamName, hard_funcs[func_name], lastParamName)245 print('\t\t\t%s[i] = %s(%s[i]);' % (lastParamName, hard_funcs[func_name], lastParamName)) 245 246 else: 246 print '\t\t\t((GLuint *) %s)[i] = %s(%s[i]);' % (lastParamName, hard_funcs[func_name], lastParamName)247 print '\t\t}'248 print '\t}'249 print '}\n'247 print('\t\t\t((GLuint *) %s)[i] = %s(%s[i]);' % (lastParamName, hard_funcs[func_name], lastParamName)) 248 print('\t\t}') 249 print('\t}') 250 print('}\n') -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_proto.py
r20083 r63939 4 4 # See the file LICENSE.txt for information on redistributing this software. 5 5 6 from __future__ import print_function 6 7 import sys 7 8 … … 10 11 apiutil.CopyrightC() 11 12 12 print 13 print(""" 13 14 /* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED BY packspu_proto.py SCRIPT */ 14 15 … … 21 22 #include "packspu.h" 22 23 #include "cr_packfunctions.h" 23 """ 24 """) 24 25 25 26 … … 42 43 return_type = apiutil.ReturnType(func_name) 43 44 params = apiutil.Parameters(func_name) 44 print 'extern %s PACKSPU_APIENTRY packspu_%s( %s );' % ( return_type, func_name, apiutil.MakeDeclarationString(params))45 print('extern %s PACKSPU_APIENTRY packspu_%s( %s );' % ( return_type, func_name, apiutil.MakeDeclarationString(params) )) 45 46 46 47 47 print 48 print(""" 48 49 #endif 49 """ 50 """) -
trunk/src/VBox/Additions/common/crOpenGL/passthrough/passthrough.py
r15532 r63939 4 4 # See the file LICENSE.txt for information on redistributing this software. 5 5 6 from __future__ import print_function 6 7 import sys 7 8 … … 11 12 apiutil.CopyrightC() 12 13 13 print 14 print("""#include <stdio.h> 14 15 #include "cr_error.h" 15 16 #include "cr_string.h" 16 17 #include "cr_spu.h" 17 18 #include "passthroughspu.h" 18 """ 19 """) 19 20 20 21 keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt") 21 22 22 23 23 print 'SPUNamedFunctionTable _cr_passthrough_table[%d];' % ( len(keys) + 1)24 print('SPUNamedFunctionTable _cr_passthrough_table[%d];' % ( len(keys) + 1 )) 24 25 25 print 26 print(""" 26 27 static void __fillin( int offset, char *name, SPUGenericFunction func ) 27 28 { … … 31 32 32 33 void BuildPassthroughTable( SPU *child ) 33 {""" 34 {""") 34 35 35 36 for index in range(len(keys)): 36 37 func_name = keys[index] 37 print '\t__fillin( %3d, "%s", (SPUGenericFunction) child->dispatch_table.%s );' % (index, func_name, func_name)38 print '\t__fillin( %3d, NULL, NULL );' % len(keys)39 print '}'38 print('\t__fillin( %3d, "%s", (SPUGenericFunction) child->dispatch_table.%s );' % (index, func_name, func_name )) 39 print('\t__fillin( %3d, NULL, NULL );' % len(keys)) 40 print('}') -
trunk/src/VBox/Additions/common/crOpenGL/stub_common.py
r15532 r63939 4 4 # See the file LICENSE.txt for information on redistributing this software. 5 5 6 from __future__ import print_function 6 7 import sys 7 8 curver = sys.version_info[0] + sys.version_info[1]/10.0 8 9 if curver < 2.2: 9 print >>sys.stderr, "Your python is version %g. Chromium requires at least"%(curver)10 print >>sys.stderr, "version 2.2. Please upgrade your python installation."10 print("Your python is version %g. Chromium requires at least"%(curver), file=sys.stderr) 11 print("version 2.2. Please upgrade your python installation.", file=sys.stderr) 11 12 sys.exit(1) 12 13 … … 15 16 16 17 def CopyrightC( ): 17 print 18 print("""/* Copyright (c) 2001, Stanford University 18 19 All rights reserved. 19 20 20 21 See the file LICENSE.txt for information on redistributing this software. */ 21 """ 22 """) 22 23 23 24 def CopyrightDef( ): 24 print 25 print("""; Copyright (c) 2001, Stanford University 25 26 ; All rights reserved. 26 27 ; 27 28 ; See the file LICENSE.txt for information on redistributing this software. 28 """ 29 """) 29 30 30 31 def DecoderName( glName ): … … 101 102 return [] 102 103 103 keys = subtable.keys() 104 keys.sort() 105 return keys 104 return sorted(subtable.keys()) 106 105 107 106 def FindAnnotation( filename, key, subkey ): … … 167 166 table = LoadSpecials( filename ) 168 167 169 keys = table.keys() 170 keys.sort() 171 return keys 168 return sorted(table.keys()) 172 169 173 170 def AllSpecials( table_file ): … … 180 177 table = LoadSpecials(filename) 181 178 182 ret = table.keys() 183 ret.sort() 184 return ret 179 return sorted(table.keys()) 185 180 186 181 def NumSpecials( table_file ): -
trunk/src/VBox/Additions/common/crOpenGL/tsfuncs.py
r15532 r63939 4 4 # See the file LICENSE.txt for information on redistributing this software. 5 5 6 from __future__ import print_function 6 7 import sys 7 8 … … 11 12 apiutil.CopyrightC() 12 13 13 print 14 print(""" 14 15 /* DO NOT EDIT - THIS FILE GENERATED BY THE tsfuncs.py SCRIPT */ 15 16 16 17 #include "stub.h" 17 """ 18 """) 18 19 19 20 keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt") … … 23 24 params = apiutil.Parameters(func_name) 24 25 25 print "static %s SPULOAD_APIENTRY ts_%s( %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params))26 print "{"27 print "\tSPUDispatchTable *tab = (SPUDispatchTable *) crGetTSD(&stub.dispatchTSD);"26 print("static %s SPULOAD_APIENTRY ts_%s( %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params) )) 27 print("{") 28 print("\tSPUDispatchTable *tab = (SPUDispatchTable *) crGetTSD(&stub.dispatchTSD);") 28 29 29 30 if return_type != "void": 30 print "\treturn ",31 print("\treturn ", end=" ") 31 32 32 print "\ttab->%s( %s );" % (func_name, apiutil.MakeCallString(params))33 print "}"34 print ""33 print("\ttab->%s( %s );" % (func_name, apiutil.MakeCallString(params))) 34 print("}") 35 print("") 35 36 36 37 37 print "SPUDispatchTable stubThreadsafeDispatch = {"38 print("SPUDispatchTable stubThreadsafeDispatch = {") 38 39 39 40 for func_name in keys: 40 print "\tts_%s," % func_name41 print("\tts_%s," % func_name) 41 42 42 print "\tNULL, /* copyList */"43 print "\tNULL, /* copy_of */"44 print "\t0, /* mark */"45 print "\tNULL /* server */"46 print "};"43 print("\tNULL, /* copyList */") 44 print("\tNULL, /* copy_of */") 45 print("\t0, /* mark */") 46 print("\tNULL /* server */") 47 print("};") -
trunk/src/VBox/Additions/common/crOpenGL/windows_exports.py
r30457 r63939 5 5 6 6 7 from __future__ import print_function 7 8 import sys 8 9 … … 14 15 apiutil.CopyrightC() 15 16 16 print '#include "chromium.h"'17 print '#include "stub.h"'18 print ''19 print '#define NAKED __declspec(naked)'20 print '#define UNUSED(x) ((void)(x))'21 print ''17 print('#include "chromium.h"') 18 print('#include "stub.h"') 19 print('') 20 print('#define NAKED __declspec(naked)') 21 print('#define UNUSED(x) ((void)(x))') 22 print('') 22 23 23 24 … … 37 38 params = apiutil.Parameters(func_name) 38 39 39 print 40 apiutil.MakeDeclarationString( params )) 41 print "{"42 print "\t__asm jmp [glim.%s]" % func_name40 print("NAKED %s cr_gl%s( %s )" % (return_type, func_name, 41 apiutil.MakeDeclarationString( params ))) 42 print("{") 43 print("\t__asm jmp [glim.%s]" % func_name) 43 44 for (name, type, vecSize) in params: 44 print "\tUNUSED( %s );" % name45 print "}"46 print ""45 print("\tUNUSED( %s );" % name) 46 print("}") 47 print("") 47 48 48 print '/*'49 print '* Aliases'50 print '*/'49 print('/*') 50 print('* Aliases') 51 print('*/') 51 52 52 53 # Now loop over all the functions and take care of any aliases … … 65 66 return_type = apiutil.ReturnType(func_name) 66 67 params = apiutil.Parameters(func_name) 67 print 68 apiutil.MakeDeclarationString( params )) 69 print "{"70 print "\t__asm jmp [glim.%s]" % alias68 print("NAKED %s cr_gl%s( %s )" % (return_type, func_name, 69 apiutil.MakeDeclarationString( params ))) 70 print("{") 71 print("\t__asm jmp [glim.%s]" % alias) 71 72 for (name, type, vecSize) in params: 72 print "\tUNUSED( %s );" % name73 print "}"74 print ""73 print("\tUNUSED( %s );" % name) 74 print("}") 75 print("") 75 76 76 77 77 print '/*'78 print '* No-op stubs'79 print '*/'78 print('/*') 79 print('* No-op stubs') 80 print('*/') 80 81 81 82 # Now generate no-op stub functions … … 84 85 return_type = apiutil.ReturnType(func_name) 85 86 params = apiutil.Parameters(func_name) 86 print "NAKED %s cr_gl%s( %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params))87 print "{"87 print("NAKED %s cr_gl%s( %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params))) 88 print("{") 88 89 if return_type != "void": 89 print "return (%s) 0" % return_type90 print "}"91 print ""90 print("return (%s) 0" % return_type) 91 print("}") 92 print("") 92 93 93 94 -
trunk/src/VBox/Additions/common/crOpenGL/windows_getprocaddress.py
r51200 r63939 4 4 # See the file LICENSE.txt for information on redistributing this software. 5 5 6 from __future__ import print_function 6 7 import sys 7 8 … … 10 11 apiutil.CopyrightC() 11 12 12 print 13 print(""" 13 14 /* DO NOT EDIT - THIS FILE GENERATED BY THE getprocaddress.py SCRIPT */ 14 15 #include "chromium.h" … … 24 25 #endif 25 26 26 """ 27 """) 27 28 28 print 29 print(""" 29 30 struct name_address { 30 31 const char *name; … … 35 36 36 37 static struct name_address functions[] = { 37 """ 38 """) 38 39 39 40 … … 60 61 address = "cr_gl" + proc_name 61 62 if wrap: 62 print '#ifdef CR_%s' % wrap63 print '\t{ "%s", (CR_PROC) %s },' % (name, address)63 print('#ifdef CR_%s' % wrap) 64 print('\t{ "%s", (CR_PROC) %s },' % (name, address)) 64 65 if wrap: 65 print '#endif'66 print('#endif') 66 67 67 68 68 print "\t/* Chromium binding/glue functions */"69 print("\t/* Chromium binding/glue functions */") 69 70 70 71 for func_name in keys: … … 75 76 continue 76 77 if apiutil.Category(func_name) == "Chromium": 77 print '\t{ "cr%s", (CR_PROC) cr%s },' % (func_name, func_name)78 print('\t{ "cr%s", (CR_PROC) cr%s },' % (func_name, func_name)) 78 79 79 print "\t/* Windows ICD functions */"80 print("\t/* Windows ICD functions */") 80 81 81 82 for func_name in ( "CopyContext", … … 95 96 "SetContext", 96 97 "ValidateVersion"): 97 print '\t{ "Drv%s", (CR_PROC) Drv%s },' % (func_name, func_name)98 print('\t{ "Drv%s", (CR_PROC) Drv%s },' % (func_name, func_name)) 98 99 99 print '\t{ "DrvGetProcAddress", (CR_PROC) wglGetProcAddress_prox },'100 print('\t{ "DrvGetProcAddress", (CR_PROC) wglGetProcAddress_prox },') 100 101 101 print 102 print(""" 102 103 { NULL, NULL } 103 104 }; … … 149 150 } 150 151 151 """ 152 """) 152 153 153 154 -
trunk/src/VBox/Additions/common/crOpenGL/windows_i386_exports.py
r30457 r63939 5 5 6 6 7 from __future__ import print_function 7 8 import sys 8 9 … … 13 14 14 15 #apiutil.CopyrightC() 15 print '%include "iprt/asmdefs.mac"'16 print ""17 print "%ifdef RT_ARCH_AMD64"18 print "extern glim"19 print "%else ; X86"20 print "extern _glim"21 print "%endif"22 print ""16 print('%include "iprt/asmdefs.mac"') 17 print("") 18 print("%ifdef RT_ARCH_AMD64") 19 print("extern glim") 20 print("%else ; X86") 21 print("extern _glim") 22 print("%endif") 23 print("") 23 24 24 25 # Get sorted list of dispatched functions. … … 34 35 continue 35 36 36 print "BEGINPROC_EXPORTED cr_gl%s" % func_name37 print "%ifdef RT_ARCH_AMD64"38 print "\tmov \trax, qword glim+%d" % (8*index)39 print "\tjmp \t[rax]"40 print "%else ; X86"41 print "\tmov \teax, dword _glim+%d" % (4*index)42 print "\tjmp \t[eax]"43 print "%endif"44 print "ENDPROC cr_gl%s" % func_name45 print ""37 print("BEGINPROC_EXPORTED cr_gl%s" % func_name) 38 print("%ifdef RT_ARCH_AMD64") 39 print("\tmov \trax, qword glim+%d" % (8*index)) 40 print("\tjmp \t[rax]") 41 print("%else ; X86") 42 print("\tmov \teax, dword _glim+%d" % (4*index)) 43 print("\tjmp \t[eax]") 44 print("%endif") 45 print("ENDPROC cr_gl%s" % func_name) 46 print("") 46 47 47 48 48 print ';'49 print '; Aliases'50 print ';'49 print(';') 50 print('; Aliases') 51 print(';') 51 52 52 53 # Now loop over all the functions and take care of any aliases … … 65 66 # this dict lookup should never fail (raise an exception)! 66 67 index = keys.index(alias) 67 print "BEGINPROC_EXPORTED cr_gl%s" % func_name68 print "%ifdef RT_ARCH_AMD64"69 print "\tmov \trax, qword glim+%d" % (8*index)70 print "\tjmp \t[rax]"71 print "%else ; X86"72 print "\tmov \teax, dword _glim+%d" % (4*index)73 print "\tjmp \t[eax]"74 print "%endif"75 print "ENDPROC cr_gl%s" % func_name76 print ""68 print("BEGINPROC_EXPORTED cr_gl%s" % func_name) 69 print("%ifdef RT_ARCH_AMD64") 70 print("\tmov \trax, qword glim+%d" % (8*index)) 71 print("\tjmp \t[rax]") 72 print("%else ; X86") 73 print("\tmov \teax, dword _glim+%d" % (4*index)) 74 print("\tjmp \t[eax]") 75 print("%endif") 76 print("ENDPROC cr_gl%s" % func_name) 77 print("") 77 78 78 79 79 print ';'80 print '; No-op stubs'81 print ';'80 print(';') 81 print('; No-op stubs') 82 print(';') 82 83 83 84 # Now generate no-op stub functions 84 85 for func_name in allkeys: 85 86 if "stub" in apiutil.ChromiumProps(func_name): 86 print "BEGINPROC_EXPORTED cr_gl%s" % func_name87 print "\tleave"88 print "\tret"89 print "ENDPROC cr_gl%s" % func_name90 print ""87 print("BEGINPROC_EXPORTED cr_gl%s" % func_name) 88 print("\tleave") 89 print("\tret") 90 print("ENDPROC cr_gl%s" % func_name) 91 print("") 91 92 92 93
Note:
See TracChangeset
for help on using the changeset viewer.