X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/c87f1f3b8eb5dec60131976cc092bd5ed6e66acf..cdeb634affac7c3083937825bbf2c89cd11e84f9:/lib/python/enigma_python.i diff --git a/lib/python/enigma_python.i b/lib/python/enigma_python.i index 8654e5cd..79f9296e 100644 --- a/lib/python/enigma_python.i +++ b/lib/python/enigma_python.i @@ -69,6 +69,8 @@ is usually caused by not marking PSignals as immutable. #include #include #include +#include +#include extern void runMainloop(); extern void quitMainloop(); @@ -81,6 +83,18 @@ extern PSignal1 &keyPressedSignal(); %feature("ref") iObject "$this->AddRef(); eDebug(\"AddRef (%s:%d)!\", __FILE__, __LINE__); " %feature("unref") iObject "$this->Release(); eDebug(\"Release! %s:%d\", __FILE__, __LINE__); " +/* this magic allows smartpointer to be used as OUTPUT arguments, i.e. call-by-reference-styled return value. */ + +%define %typemap_output_ptr(Type) + %typemap(in,numinputs=0) Type *OUTPUT ($*1_ltype temp), + Type &OUTPUT ($*1_ltype temp) + "$1 = new Type;"; + %fragment("t_out_helper"{Type},"header", + fragment="t_output_helper") {} + %typemap(argout,fragment="t_out_helper"{Type}) Type *OUTPUT, Type &OUTPUT + "$result = t_output_helper($result, (SWIG_NewPointerObj((void*)($1), $1_descriptor, 1)));" +%enddef + %newobject eDebugClassPtr::operator->; #define DEBUG @@ -130,6 +144,8 @@ extern PSignal1 &keyPressedSignal(); %include %include %include +%include +%include %include /************** eptr **************/