]> git.sesse.net Git - vlc/blobdiff - bindings/python-ctypes/generate.py
python-ctypes: define a .value() method for enums in java code
[vlc] / bindings / python-ctypes / generate.py
index 15397021e62cafcb3cdc9826ef6aa6bbe96635ac..f3b53d1bb3b7963e1ee38202344602bcf7c6608f 100755 (executable)
@@ -854,7 +854,11 @@ public enum %s
             # FIXME: write comment
 
             for k, v in values:
-                self.output(fd, "        %s, // %s," % (k, v))
+                self.output(fd, "        %s (%s)," % (k, v))
+            self.output(fd, "");
+            self.output(fd, "        private final int _value;");
+            self.output(fd, "        %s(int value) { this._value = value; }" % javaname);
+            self.output(fd, "        public int value() { return this._value; }");
             self.output(fd, "}")
             fd.close()