replicant-frameworks_native/opengl/libs/GLES2_dbg/generate_GLEnum_java.py
David Li 2f5a6557ef Initial commit of GLESv2 debugger server
Use debug.egl.debug_proc property to match process cmdline.
Binds to TCP:5039 and waits for client connection.
Sends function call parameters, textures and shaders using Protobuf.
Java Eclipse client plug-in is next.

Change-Id: I183b755263663f87e86dde1ad12f527d0445fd57
Signed-off-by: David Li <davidxli@google.com>
2011-03-03 18:28:43 -08:00

44 lines
829 B
Python
Executable File

#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
if __name__ == "__main__":
externs = []
lines = open("enums.in").readlines()
i = 0
print "// auto generated by generate_GLFunction_java.py"
print """package GLESv2Debugger;
public enum GLEnum
{"""
index = 0
for line in lines:
value = line[line.find("(") + 1: line.find(",")]
name = line[line.find(",") + 1: line.find(")")]
print "\t%s(%s)," % (name, value)
print """\t;
\tpublic final int value;
\tGLEnum(final int value)
\t{
\t\tthis.value = value;
\t}
\tprivate static final java.util.HashMap<Integer, GLEnum> reverseMap = new java.util.HashMap<Integer, GLEnum>();
\tstatic
\t{
\t\tfor (GLEnum e : GLEnum.values())
\t\t\treverseMap.put(e.value, e);
\t}
\tpublic static GLEnum valueOf(final int value)
\t{
\t\treturn reverseMap.get(value);
\t}
}"""