follow hotplug-ng changes
[enigma2.git] / lib / python / connections.cpp
index c24c939..00f33f7 100644 (file)
@@ -1,9 +1,29 @@
 #include <lib/python/connections.h>
 
-PSignal1<void,int> testsignal;
+PSignal::PSignal()
+{
+}
 
-void connect(Slot1<void, int> &slot, PyObject *fnc)
+PSignal::~PSignal()
 {
-       printf("CONNECT !\n");
+       Py_XDECREF(m_list);
 }
 
+void PSignal::callPython(ePyObject tuple)
+{
+       int size = PyList_Size(m_list);
+       int i;
+       for (i=0; i<size; ++i)
+       {
+               ePyObject b = PyList_GET_ITEM(m_list, i);
+               ePython::call(b, tuple);
+       }
+}
+
+PyObject *PSignal::get()
+{
+       if (!m_list)
+               m_list = PyList_New(0);
+       Py_INCREF(m_list);
+       return m_list;
+}