X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=bindings%2Fswig%2Fclasses.i;h=cdb9f0e7716e6bbb2b2a87831dcc7cd751e21741;hb=7637cc60ba0201202eec98f66d8494e6ba3d53bd;hp=983fcdc242f057d93afd417baf642dc233f9c58f;hpb=3b161085731fc6e86f7decedee34f55096282581;p=libsigrok.git diff --git a/bindings/swig/classes.i b/bindings/swig/classes.i index 983fcdc2..cdb9f0e7 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 "libsigrokcxx/libsigrokcxx.hpp" using namespace std; %} @@ -84,6 +84,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; @@ -160,11 +161,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, @@ -196,28 +197,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, description, description); %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 @@ -231,17 +231,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); @@ -250,25 +250,31 @@ 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); %attributestring(sigrok::Session, std::shared_ptr, trigger, trigger, set_trigger); -%attributestring(sigrok::Packet, - std::shared_ptr, payload, payload); +%attributestring(sigrok::Session, std::string, filename, filename); -%attributeval(sigrok::Meta, map_ConfigKey_Variant, config, config); +%attribute(sigrok::Packet, + const sigrok::PacketType *, type, type); +%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 "libsigrokcxx/libsigrokcxx.hpp" -%include "libsigrok/libsigrok.hpp" +%include "enums.i" namespace sigrok { -%include "libsigrok/enums.hpp" +%include "libsigrokcxx/enums.hpp" }