X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/26ff43bdf1eb6fe4da12db2c61a63c0dcd9612c8..9b17ab1310d7b71aea7c0d9d12f2b73520a6d750:/lib/python/connections.h diff --git a/lib/python/connections.h b/lib/python/connections.h index 8ff3a620..374749ab 100644 --- a/lib/python/connections.h +++ b/lib/python/connections.h @@ -3,11 +3,6 @@ #include - /* avoid warnigs :) */ -#include -#undef _POSIX_C_SOURCE -#define _POSIX_C_SOURCE 200112L - #include class PSignal @@ -18,6 +13,9 @@ public: PSignal(); ~PSignal(); void callPython(SWIG_PYOBJECT(ePyObject) tuple); +#ifndef SWIG + PyObject *getSteal(bool clear=false); +#endif PyObject *get(); }; @@ -82,4 +80,23 @@ public: } }; +template +class PSignal3: public PSignal, public Signal3 +{ +public: + R operator()(V0 a0, V1 a1, V2 a2) + { + if (m_list) + { + PyObject *pArgs = PyTuple_New(3); + PyTuple_SET_ITEM(pArgs, 0, PyFrom(a0)); + PyTuple_SET_ITEM(pArgs, 1, PyFrom(a1)); + PyTuple_SET_ITEM(pArgs, 2, PyFrom(a2)); + callPython(pArgs); + Org_Py_DECREF(pArgs); + } + return Signal3::operator()(a0, a1, a2); + } +}; + #endif