From: Martin Ling Date: Tue, 20 Oct 2015 23:29:50 +0000 (+0100) Subject: java: Don't use SWIG attribute mechanism. X-Git-Tag: libsigrok-0.4.0~186 X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=d0fa4ac1e786490b47b9f4284ad045f65d1e058d java: Don't use SWIG attribute mechanism. Using the attribute mechanism results in badly named wrappers like getLog_level(), as well as incompletely applied typemaps for templated container types. If we just avoid this mechanism entirely, we get the same foo() and set_foo() accessors as we have in the C++ API. --- diff --git a/bindings/java/org/sigrok/core/classes/classes.i b/bindings/java/org/sigrok/core/classes/classes.i index ba95144b..c5d9b27b 100644 --- a/bindings/java/org/sigrok/core/classes/classes.i +++ b/bindings/java/org/sigrok/core/classes/classes.i @@ -293,20 +293,13 @@ typedef jobject jdatafeedcallback; %include "doc.i" -%define %attributevector(Class, Type, Name, Get) -%attributeval(sigrok::Class, Type, Name, Get); -%enddef - -%define %attributemap(Class, Type, Name, Get) -%attributeval(sigrok::Class, Type, Name, Get); -%enddef - %define %enumextras(Class) %enddef /* Ignore these for now, need fixes. */ %ignore sigrok::Context::create_analog_packet; %ignore sigrok::Context::create_meta_packet; +%ignore sigrok::Meta::config; %include "bindings/swig/classes.i" diff --git a/bindings/swig/classes.i b/bindings/swig/classes.i index f556ba1a..b87bbe1b 100644 --- a/bindings/swig/classes.i +++ b/bindings/swig/classes.i @@ -81,6 +81,8 @@ template< class T > class enable_shared_from_this; %ignore sigrok::DatafeedCallbackData; +#ifndef SWIGJAVA + #define SWIG_ATTRIBUTE_TEMPLATE %include "attribute.i" @@ -209,6 +211,8 @@ typedef std::map %attribute(sigrok::Analog, const sigrok::Unit *, unit, unit); %attributevector(Analog, std::vector, mq_flags, mq_flags); +#endif + %include %include "swig/enums.i"