#pragma SWIG nowarn=325,401
-%{
-#include "libsigrok/libsigrok.hpp"
-using namespace std;
-%}
-
%include "typemaps.i"
-%include "std_string.i"
-%include "std_vector.i"
-%include "std_map.i"
-%include "std_shared_ptr.i"
%include "exception.i"
%{
%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);
%shared_ptr(sigrok::Trigger);
%shared_ptr(sigrok::TriggerStage);
%shared_ptr(sigrok::TriggerMatch);
-
-%template(StringMap) std::map<std::string, std::string>;
-
-%template(DriverMap)
- std::map<std::string, std::shared_ptr<sigrok::Driver> >;
-%template(InputFormatMap)
- std::map<std::string, std::shared_ptr<sigrok::InputFormat> >;
-%template(OutputFormatMap)
- std::map<std::string, std::shared_ptr<sigrok::OutputFormat> >;
-
-%template(HardwareDeviceVector)
- std::vector<std::shared_ptr<sigrok::HardwareDevice> >;
-
-%template(DeviceVector)
- std::vector<std::shared_ptr<sigrok::Device> >;
-
-%template(ChannelVector)
- std::vector<std::shared_ptr<sigrok::Channel> >;
-
-%template(ChannelGroupMap)
- std::map<std::string, std::shared_ptr<sigrok::ChannelGroup> >;
-
-/* Workaround for SWIG bug. The vector template instantiation
- isn't needed but somehow fixes a bug that stops the wrapper
- for the map instantiation from compiling. */
-%template(ConfigVector)
- std::vector<const sigrok::ConfigKey *>;
-%template(ConfigMap)
- std::map<const sigrok::ConfigKey *, Glib::VariantBase>;
-
-%template(OptionVector)
- std::vector<std::shared_ptr<sigrok::Option> >;
-%template(OptionMap)
- std::map<std::string, std::shared_ptr<sigrok::Option> >;
-
-%template(VariantVector)
- std::vector<Glib::VariantBase>;
-%template(VariantMap)
- std::map<std::string, Glib::VariantBase>;
-
-%template(QuantityFlagVector)
- std::vector<const sigrok::QuantityFlag *>;
-
-%template(TriggerStageVector)
- std::vector<std::shared_ptr<sigrok::TriggerStage> >;
-
-%template(TriggerMatchVector)
- std::vector<std::shared_ptr<sigrok::TriggerMatch> >;
+%shared_ptr(sigrok::UserDevice);
#define SR_API
#define SR_PRIV
%ignore sigrok::DatafeedCallbackData;
-%ignore sigrok::SourceCallbackData;
+
+#ifndef SWIGJAVA
#define SWIG_ATTRIBUTE_TEMPLATE
%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);
%attribute(sigrok::Packet,
const sigrok::PacketType *, type, type);
-%attributestring(sigrok::Packet,
- std::shared_ptr<sigrok::PacketPayload>, payload, payload);
%attributemap(Meta, map_ConfigKey_Variant, config, config);
+%attributevector(Analog,
+ std::vector<std::shared_ptr<sigrok::Channel> >, 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);
%attributevector(Analog, std::vector<const sigrok::QuantityFlag *>, mq_flags, mq_flags);
-%include "libsigrok/libsigrok.hpp"
+#endif
-%include "enums.i"
+%include <libsigrokcxx/libsigrokcxx.hpp>
-namespace sigrok {
-%include "libsigrok/enums.hpp"
-}
+%include "swig/enums.i"
+
+%include <libsigrokcxx/enums.hpp>