X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=bindings%2Fswig%2Fclasses.i;h=309bd34057f78eed5fd3b376b1b4571224176baa;hb=2c3c9b999cd5c1130afeeee4094400592c9e1bde;hp=1bbba90fd3fd53d4a482c8c7b99e58b42ae5aa3e;hpb=189461b25193d099b8a1087d8fda97958ae31ed5;p=libsigrok.git diff --git a/bindings/swig/classes.i b/bindings/swig/classes.i index 1bbba90f..309bd340 100644 --- a/bindings/swig/classes.i +++ b/bindings/swig/classes.i @@ -20,7 +20,7 @@ #pragma SWIG nowarn=325,401 %{ -#include "libsigrok/libsigrok.hpp" +#include using namespace std; %} @@ -66,7 +66,6 @@ template< class T > class enable_shared_from_this; %shared_ptr(sigrok::HardwareDevice); %shared_ptr(sigrok::Channel); %shared_ptr(sigrok::ChannelGroup); -%shared_ptr(sigrok::EventSource); %shared_ptr(sigrok::Session); %shared_ptr(sigrok::SessionDevice); %shared_ptr(sigrok::Packet); @@ -84,6 +83,7 @@ template< class T > class enable_shared_from_this; %shared_ptr(sigrok::Trigger); %shared_ptr(sigrok::TriggerStage); %shared_ptr(sigrok::TriggerMatch); +%shared_ptr(sigrok::UserDevice); %template(StringMap) std::map; @@ -137,7 +137,6 @@ template< class T > class enable_shared_from_this; #define SR_PRIV %ignore sigrok::DatafeedCallbackData; -%ignore sigrok::SourceCallbackData; #define SWIG_ATTRIBUTE_TEMPLATE @@ -160,11 +159,11 @@ typedef std::map map_ConfigKey_Variant; } -%attributeval(sigrok::Context, +%attributemap(Context, map_string_Driver, drivers, drivers); -%attributeval(sigrok::Context, +%attributemap(Context, map_string_InputFormat, input_formats, input_formats); -%attributeval(sigrok::Context, +%attributemap(Context, map_string_OutputFormat, output_formats, output_formats); %attributestring(sigrok::Context, @@ -175,9 +174,6 @@ typedef std::map %attribute(sigrok::Context, const sigrok::LogLevel *, log_level, log_level, set_log_level); -%attributestring(sigrok::Context, - std::string, log_domain, log_domain, set_log_domain); - %attributestring(sigrok::Driver, std::string, name, name); %attributestring(sigrok::Driver, std::string, long_name, long_name); @@ -196,27 +192,27 @@ typedef std::map %attributestring(sigrok::Option, std::string, description, description); /* Currently broken on Python due to some issue with variant typemaps. */ -/* %attributeval(sigrok::Option, +/* %attributevector(Option, Glib::VariantBase, default_value, default_value); */ -%attributeval(sigrok::Option, +%attributevector(Option, std::vector, values, values); %attributestring(sigrok::OutputFormat, std::string, name, name); %attributestring(sigrok::OutputFormat, std::string, description, description); -%attributeval(sigrok::OutputFormat, +%attributemap(OutputFormat, map_string_Option, options, options); %attributestring(sigrok::Device, std::string, vendor, vendor); %attributestring(sigrok::Device, std::string, model, model); %attributestring(sigrok::Device, std::string, version, version); -%attributeval(sigrok::Device, +%attributevector(Device, std::vector >, channels, channels); -%attributeval(sigrok::Device, map_string_ChannelGroup, +%attributemap(Device, map_string_ChannelGroup, channel_groups, channel_groups); /* Using %attributestring for shared_ptr attribute. See @@ -230,17 +226,17 @@ typedef std::map %attribute(sigrok::Channel, unsigned int, index, index); %attributestring(sigrok::ChannelGroup, std::string, name, name); -%attributeval(sigrok::ChannelGroup, +%attributevector(ChannelGroup, std::vector >, channels, channels); %attributestring(sigrok::Trigger, std::string, name, name); -%attributeval(sigrok::Trigger, +%attributevector(Trigger, std::vector >, stages, stages); %attribute(sigrok::TriggerStage, int, number, number); -%attributeval(sigrok::TriggerStage, +%attributevector(TriggerStage, std::vector >, matches, matches); @@ -249,7 +245,7 @@ typedef std::map %attribute(sigrok::TriggerMatch, const sigrok::TriggerMatchType *, type, type); %attribute(sigrok::TriggerMatch, float, value, value); -%attributeval(sigrok::Session, +%attributevector(Session, std::vector >, devices, devices); @@ -260,20 +256,20 @@ typedef std::map %attribute(sigrok::Packet, const sigrok::PacketType *, type, type); -%attributestring(sigrok::Packet, - std::shared_ptr, payload, payload); -%attributeval(sigrok::Meta, map_ConfigKey_Variant, config, config); +%attributemap(Meta, map_ConfigKey_Variant, config, config); +%attributevector(Analog, + std::vector >, channels, channels); %attribute(sigrok::Analog, int, num_samples, num_samples); %attribute(sigrok::Analog, const sigrok::Quantity *, mq, mq); %attribute(sigrok::Analog, const sigrok::Unit *, unit, unit); -%attributeval(sigrok::Analog, std::vector, mq_flags, mq_flags); +%attributevector(Analog, std::vector, mq_flags, mq_flags); -%include "libsigrok/libsigrok.hpp" +%include -%include "enums.i" +%include "swig/enums.i" namespace sigrok { -%include "libsigrok/enums.hpp" +%include }