bindings: Expose EnumValue::id and EnumValue::name as attributes.
This commit is contained in:
parent
fe4096fde6
commit
189461b251
|
@ -146,6 +146,11 @@ for enum, (classname, classbrief) in classes.items():
|
|||
if os.path.exists(filename):
|
||||
print >> code, str.join('', open(filename).readlines())
|
||||
|
||||
# Instantiate EnumValue template for SWIG wrappers
|
||||
print >> swig, '%%template(EnumValue%s) EnumValue<%s, enum %s>;' % (
|
||||
# Map EnumValue::id() and EnumValue::name() as SWIG attributes.
|
||||
print >> swig, '%%attribute(sigrok::%s, int, id, id);' % classname
|
||||
print >> swig, '%%attributestring(sigrok::%s, std::string, name, name);' % classname
|
||||
|
||||
# Instantiate EnumValue template for SWIG
|
||||
print >> swig, '%%template(EnumValue%s) sigrok::EnumValue<sigrok::%s, enum %s>;' % (
|
||||
classname, classname, enum_name)
|
||||
|
||||
|
|
|
@ -272,7 +272,8 @@ typedef std::map<const sigrok::ConfigKey *, Glib::VariantBase>
|
|||
|
||||
%include "libsigrok/libsigrok.hpp"
|
||||
|
||||
namespace sigrok {
|
||||
%include "enums.i"
|
||||
|
||||
namespace sigrok {
|
||||
%include "libsigrok/enums.hpp"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue