summaryrefslogtreecommitdiffstats
path: root/src/bindings
diff options
context:
space:
mode:
Diffstat (limited to 'src/bindings')
-rw-r--r--src/bindings/Makefile.am28
-rw-r--r--src/bindings/ingen.i39
-rwxr-xr-xsrc/bindings/test_ingen.py8
3 files changed, 75 insertions, 0 deletions
diff --git a/src/bindings/Makefile.am b/src/bindings/Makefile.am
new file mode 100644
index 00000000..8935eebb
--- /dev/null
+++ b/src/bindings/Makefile.am
@@ -0,0 +1,28 @@
+FLAGS = @RAUL_CFLAGS@ @GLIBMM_CFLAGS@ -I$(top_srcdir)/ingen/src/common
+LIBS = @RAUL_LIBS@ @GLIBMM_LIBS@
+AM_CXXFLAGS = -I/usr/include/python2.4 $(FLAGS)
+
+EXTRA_DIST = ingen.i ingen_test.py
+
+if WITH_SWIG
+bindingsdir = $(libdir)/ingen
+bindings_LTLIBRARIES = libingen_bindings.la
+libingen_bindings_la_LDFLAGS = -no-undefined -module -avoid-version
+libingen_bindings_la_LIBADD = @RAUL_LIBS@ @GLIBMM_LIBS@ ../libs/module/libingen_module.la
+libingen_bindings_la_SOURCES = ingen_wrap.cxx
+
+swig: ingen.i
+ swig -c++ -Wall $(FLAGS) -python ingen.i
+
+libingen_bindings_la: swig ingen_wrap.cxx
+
+all-local:
+ ln -sf .libs/libingen_bindings.so _ingen.so
+
+#libtool --mode=compile g++ -fPIC -shared $(CXXFLAGS) $(FLAGS) $(LIBS) -I/usr/include/python2.4 ingen_wrap.cxx -o libingen_python.so.0.0.0
+endif
+
+clean-local:
+ rm *.cxx
+ rm *.so
+ rm *.o
diff --git a/src/bindings/ingen.i b/src/bindings/ingen.i
new file mode 100644
index 00000000..e9a13dc3
--- /dev/null
+++ b/src/bindings/ingen.i
@@ -0,0 +1,39 @@
+%include "stl.i"
+%module ingen
+%{
+#include "../common/interface/ClientInterface.hpp"
+#include "../common/interface/EngineInterface.hpp"
+#include "../libs/module/World.hpp"
+#include "../libs/module/module.h"
+
+namespace Ingen { namespace Shared {
+ class World;
+} }
+typedef Ingen::Shared::World World;
+/*struct World {
+ World() { me = Ingen::Shared::get_world(); }
+ Ingen::Shared::World* me;
+};*/
+%}
+
+/*%ignore Ingen::Shared::EngineInterface;*/
+
+%include "../common/interface/ClientInterface.hpp"
+%include "../common/interface/EngineInterface.hpp"
+/*%include "../libs/module/World.hpp"
+%include "../libs/module/module.h"*/
+%include "../libs/module/module.h"
+
+using namespace Ingen::Shared;
+namespace Ingen { namespace Shared {
+ class World;
+} }
+%typedef Ingen::Shared::World World;
+/*struct World {};*/
+%extend World {
+ World() { return Ingen::Shared::get_world(); }
+ /*SLV2World slv2() { return $self->me->slv2_world; }*/
+
+/*SharedPtr<Ingen::Shared::EngineInterface> engine() { return $self->me->engine; }*/
+};
+
diff --git a/src/bindings/test_ingen.py b/src/bindings/test_ingen.py
new file mode 100755
index 00000000..93d524c6
--- /dev/null
+++ b/src/bindings/test_ingen.py
@@ -0,0 +1,8 @@
+#!/usr/bin/env python
+import ingen
+
+world = ingen.World()
+#w = ingen.get_world()
+print world
+e = world.engine
+print e