]> sigrok.org Git - libsigrok.git/commitdiff
bindings: Support per-language extensions to EnumValue wrappers.
authorMartin Ling <redacted>
Tue, 11 Nov 2014 18:26:50 +0000 (18:26 +0000)
committerUwe Hermann <redacted>
Wed, 12 Nov 2014 01:27:05 +0000 (02:27 +0100)
bindings/cxx/enums.py
bindings/java/org/sigrok/core/classes/classes.i
bindings/python/sigrok/core/classes.i

index 25bd6f428271a939cd7fa6a8bba2c5c5f44e7e6c..fb00102a3bf0a86400654aa59c79f4d7e2c401eb 100644 (file)
@@ -154,6 +154,9 @@ for enum, (classname, classbrief) in classes.items():
     print >> swig, '%%template(EnumValue%s) sigrok::EnumValue<sigrok::%s, enum %s>;' % (
         classname, classname, enum_name)
 
+    # Apply any language-specific extras.
+    print >> swig, '%%enumextras(%s);' % classname
+
     # Declare additional attributes if present
     filename = os.path.join(dirname, "%s_methods.i" % classname)
     if os.path.exists(filename):
index 22e6e2562ab43f0f9729ff72091c93d325c6e584..3ca7d1aaa8a94daac0af6057006bfa2f4ad887bb 100644 (file)
@@ -386,4 +386,7 @@ typedef jobject jsourcecallback;
 %attributeval(sigrok::Class, Type, Name, Get);
 %enddef
 
+%define %enumextras(Class)
+%enddef
+
 %include "bindings/swig/classes.i"
index 7cfdc29dd660a90148490701010c9e16b01ec647..066dbf8264f8edc75b641d29c217ec5913b1b8bb 100644 (file)
@@ -381,6 +381,9 @@ std::map<std::string, Glib::VariantBase> dict_to_map_options(PyObject *dict,
 }
 %enddef
 
+%define %enumextras(Class)
+%enddef
+
 %include "../../../swig/classes.i"
 
 /* Support Driver.scan() with keyword arguments. */