X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/72bb04e928b096869b458b9cf6ceb1bc636d600e..954106887a9b77a26753c5613ff368ce4c997044:/lib/python/enigma_python.i diff --git a/lib/python/enigma_python.i b/lib/python/enigma_python.i index b8a3c533..89aef414 100644 --- a/lib/python/enigma_python.i +++ b/lib/python/enigma_python.i @@ -39,13 +39,15 @@ 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 @@ -59,28 +61,41 @@ 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(); +extern void quitMainloop(int exit_code); +extern eApplication *getApplication(); +extern int getPrevAsciiCode(); +extern int isUTF8(const std::string &); +extern std::string convertUTF8DVB(const std::string &, int); +extern std::string convertDVBUTF8(const unsigned char *data, int len, int table, int tsidonid); %} %feature("ref") iObject "$this->AddRef(); /* eDebug(\"AddRef (%s:%d)!\", __FILE__, __LINE__); */ " @@ -112,12 +127,16 @@ extern PSignal1 &keyPressedSignal(); #define DEBUG +typedef long time_t; %include "typemaps.i" %include "stl.i" %include %include %include -%include + +%immutable eTimer::timeout; +%immutable eSocketNotifier::activated; +%include %include %include %include @@ -125,13 +144,25 @@ extern PSignal1 &keyPressedSignal(); %template(eServiceCenterPtr) ePtr; %include - // TODO: embed these... +%immutable eConsoleAppContainer::appClosed; +%immutable eConsoleAppContainer::dataAvail; +%immutable eConsoleAppContainer::dataSent; %immutable eButton::selected; %immutable eInput::changed; %immutable eComponentScan::statusChanged; +%immutable eComponentScan::newService; %immutable pNavigation::m_event; - +%immutable eListbox::selectionChanged; +%immutable eDVBCI_UI::ciStateChanged; +%immutable eDVBResourceManager::frontendUseMaskChanged; + +%include +%include +%include +%include +%include +%include %include %include %include @@ -145,31 +176,39 @@ 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 %include %include +%include %include %include - -%include +%include +%include /************** eptr **************/ %template(eActionMapPtr) ePtr; -%apply eActionMapPtr OUTPUT { eActionMapPtr &ptr } -%apply eActionMap* *OUTPUT { eActionMap **ptr } /************** signals **************/ @@ -179,51 +218,81 @@ public: PyObject *get(); }; -template class PSignal1 -{ -public: - PyObject *get(); -}; +%template(PSignal0V) PSignal0; -template class PSignal2 +%typemap(out) PSignal0V { + $1 = $input->get(); +} + +template class PSignal1 { public: PyObject *get(); }; %template(PSignal1VI) PSignal1; +%template(PSignal1VS) PSignal1; %typemap(out) PSignal1VI { $1 = $input->get(); } -%template(PSignal0V) PSignal0; - -%typemap(out) PSignal0V { +%typemap(out) PSignal1VS { $1 = $input->get(); } -/************** base **************/ - -%immutable eTimer::timeout; - -class eTimer +template class PSignal2 { public: - eTimer(eMainloop *context = eApp); - PSignal0 timeout; - - void start(long msec, bool singleShot=false); - void stop(); - void changeInterval(long msek); + PyObject *get(); }; +/************** temp *****************/ + + /* need a better place for this, i agree. */ +%{ +void addFont(const char *filename, const char *alias, int scale_factor, int is_replacement); +%} +void addFont(const char *filename, const char *alias, int scale_factor, int is_replacement); + /************** debug **************/ +int getPrevAsciiCode(); void runMainloop(); -void quitMainloop(); -void setLCD(const char*); -void setLCDClock(const char*); -%immutable keyPressed; -PSignal1 &keyPressedSignal(); +void quitMainloop(int exit_code); +eApplication *getApplication(); +int isUTF8(const std::string &); +std::string convertUTF8DVB(const std::string &, int); +std::string convertDVBUTF8(std::string text, int table); +%{ + +std::string convertDVBUTF8(std::string text, int table) +{ + int len = text.length(); + return convertDVBUTF8(len?(unsigned char*)text.c_str():(unsigned char*)"", len, table, 0); +} +RESULT SwigFromPython(ePtr &result, PyObject *obj) +{ + ePtr *res; + + res = 0; + result = 0; + if (SWIG_Python_ConvertPtr(obj, (void **)&res, SWIGTYPE_p_ePtrTgPixmap_t, SWIG_POINTER_EXCEPTION | 0)) + return -1; + if (!res) + return -1; + result = *res; + return 0; +} +PyObject *New_TestObj() +{ + TestObj *result = (TestObj *)new TestObj(); + return SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_TestObj, 1); +} +PyObject *New_eServiceReference(const eServiceReference &ref) +{ + eServiceReference *result = new eServiceReference(ref); + return SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_eServiceReference, 1); +} +%}