diff options
Diffstat (limited to 'src/bindings')
-rw-r--r-- | src/bindings/ingen.i | 19 | ||||
-rw-r--r-- | src/bindings/ingen_bindings.cpp | 12 | ||||
-rw-r--r-- | src/bindings/ingen_bindings.hpp | 2 |
3 files changed, 12 insertions, 21 deletions
diff --git a/src/bindings/ingen.i b/src/bindings/ingen.i index 6b39eb33..b29a61ce 100644 --- a/src/bindings/ingen.i +++ b/src/bindings/ingen.i @@ -9,8 +9,6 @@ #include "Client.hpp" %} -/*%ignore Ingen::Shared::EngineInterface;*/ - %include "../../ingen/CommonInterface.hpp" %include "../../ingen/ClientInterface.hpp" %include "../../ingen/EngineInterface.hpp" @@ -21,34 +19,29 @@ // generate directors for all classes that have virtual methods %feature("director"); %feature("director") Ingen::ClientInterface; -//%feature("director") Ingen::Shared::EngineInterface; -typedef Ingen::Shared::World World; -namespace Ingen { namespace Shared { +typedef Ingen::World World; +namespace Ingen { %extend World { World() { - if (!Ingen::Shared::ingen_world) { + if (!Ingen::ingen_world) { fprintf(stderr, "ERROR: World uninitialized (running within Ingen?)\n"); abort(); } else { - return Ingen::Shared::ingen_world; + return Ingen::ingen_world; } } void iteration() { - Ingen::Shared::script_iteration($self); + Ingen::script_iteration($self); } /*LILVWorld lilv() { return $self->me->lilv_world; }*/ }; -} } +} %include "Client.hpp" %feature("director") Client; - - -/*SharedPtr<Ingen::Shared::EngineInterface> engine() { return $self->me->engine; }*/ - diff --git a/src/bindings/ingen_bindings.cpp b/src/bindings/ingen_bindings.cpp index 6c92d7bb..39fd9fbf 100644 --- a/src/bindings/ingen_bindings.cpp +++ b/src/bindings/ingen_bindings.cpp @@ -18,10 +18,10 @@ #include "raul/log.hpp" #include "ingen_bindings.hpp" #include "server/Engine.hpp" -#include "ingen/shared/World.hpp" +#include "ingen/World.hpp" bool -run(Ingen::Shared::World* world, const char* filename) +run(Ingen::World* world, const char* filename) { ingen_world = world; @@ -38,22 +38,22 @@ run(Ingen::Shared::World* world, const char* filename) } } -struct IngenBindingsModule : public Ingen::Shared::Module { - void load(Ingen::Shared::World* world) { +struct IngenBindingsModule : public Ingen::Module { + void load(Ingen::World* world) { world->script_runners.insert(make_pair("application/x-python", &run)); } }; extern "C" { -Ingen::Shared::Module* +Ingen::Module* ingen_module_load() { return new IngenBindingsModule(); } void -script_iteration(Ingen::Shared::World* world) +script_iteration(Ingen::World* world) { if (world->engine()) world->engine()->main_iteration(); diff --git a/src/bindings/ingen_bindings.hpp b/src/bindings/ingen_bindings.hpp index 90ac4b0b..90358cd8 100644 --- a/src/bindings/ingen_bindings.hpp +++ b/src/bindings/ingen_bindings.hpp @@ -18,7 +18,6 @@ #define INGEN_BINDINGS_HPP namespace Ingen { -namespace Shared { class World; extern World* ingen_world; @@ -28,7 +27,6 @@ extern "C" { void script_iteration(World* world); } -} // namespace Shared } // namespace Ingen #endif // INGEN_BINDINGS_HPP |