X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/31688e1b8f028059a700a92a8276c97928abd260..d1ba8203832c54b4a98978c6033296183a24b4d0:/lib/python/enigma_python.i diff --git a/lib/python/enigma_python.i b/lib/python/enigma_python.i index b84dbd14..79f9296e 100644 --- a/lib/python/enigma_python.i +++ b/lib/python/enigma_python.i @@ -29,13 +29,12 @@ Oh, things like "operator= is private in this context" etc. -is usually caused by not marking PSignals as immutable. - +is usually caused by not marking PSignals as immutable. */ - %module enigma %{ + #define SWIG_COMPILE #include #include @@ -43,33 +42,81 @@ is usually caused by not marking PSignals as immutable. #include #include #include +#include + +#include #include #include +#include +#include +#include +#include #include #include #include +#include +#include +#include #include #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include extern void runMainloop(); +extern void quitMainloop(); +extern void setLCD(const char *c); +extern void setLCDClock(const char *c); 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 +%include "typemaps.i" %include "stl.i" +%include %include %include %include %include %include %include + %template(eServiceCenterPtr) ePtr; +%include + +// TODO: embed these... %immutable eButton::selected; +%immutable eInput::changed; +%immutable eComponentScan::statusChanged; +%immutable pNavigation::m_event; %include %include @@ -77,12 +124,37 @@ extern PSignal1 &keyPressedSignal(); %include %include %include +%include +%include +%include +%include %include %include %include %include %include %include +%include +%include +%include +%include +%include +%include +%include +%include +%include +%include +%include +%include + +%include +/************** eptr **************/ + +%template(eActionMapPtr) ePtr; +%apply eActionMapPtr OUTPUT { eActionMapPtr &ptr } +%apply eActionMap* *OUTPUT { eActionMap **ptr } + +/************** signals **************/ template class PSignal0 { @@ -114,7 +186,6 @@ public: $1 = $input->get(); } - /************** base **************/ %immutable eTimer::timeout; @@ -133,5 +204,9 @@ public: /************** debug **************/ void runMainloop(); +void quitMainloop(); +void setLCD(const char*); +void setLCDClock(const char*); %immutable keyPressed; PSignal1 &keyPressedSignal(); +