add preStart event and use it to load the cutlist
[enigma2.git] / lib / gui / epositiongauge.cpp
index 68a4b46d1719d54945c0ff8a20d93fbe61967083..ff98c080835532c4565558bb35254616b2673839 100644 (file)
@@ -43,6 +43,11 @@ void ePositionGauge::setInColor(const gRGB &color)
        invalidate();
 }
 
+void ePositionGauge::setPointer(int which, ePtr<gPixmap> &pixmap, const ePoint &center)
+{
+       setPointer(which, pixmap.operator->(), center);
+}
+
 void ePositionGauge::setPointer(int which, gPixmap *pixmap, const ePoint &center)
 {
        if (which == 0)
@@ -59,7 +64,7 @@ void ePositionGauge::setPointer(int which, gPixmap *pixmap, const ePoint &center
        updatePosition();
 }
 
-void ePositionGauge::setInOutList(PyObject *list)
+void ePositionGauge::setInOutList(ePyObject list)
 {
        if (!PyList_Check(list))
                return;
@@ -70,14 +75,14 @@ void ePositionGauge::setInOutList(PyObject *list)
        
        for (i=0; i<size; ++i)
        {
-               PyObject *tuple = PyList_GetItem(list, i);
+               ePyObject tuple = PyList_GET_ITEM(list, i);
                if (!PyTuple_Check(tuple))
                        continue;
 
                if (PyTuple_Size(tuple) != 2)
                        continue;
 
-               PyObject *ppts = PyTuple_GetItem(tuple, 0), *ptype = PyTuple_GetItem(tuple, 1);
+               ePyObject ppts = PyTuple_GET_ITEM(tuple, 0), ptype = PyTuple_GET_ITEM(tuple, 1);
                if (!(PyLong_Check(ppts) && PyInt_Check(ptype)))
                        continue;
 
@@ -121,13 +126,17 @@ int ePositionGauge::event(int event, void *data, void *data2)
                                        continue;
                                } else if (i->what == 1) /* out */
                                        out = i++->where;
-                               else /* mark */
+                               else if (i->what == 2) /* mark */
                                {
                                        int xm = scale(i->where);
                                        painter.setForegroundColor(gRGB(0xFF8080));
                                        painter.fill(eRect(xm - 2, 0, 4, s.height()));
                                        i++;
                                        continue;
+                               } else /* other marker, like last position */
+                               {
+                                       ++i;
+                                       continue;
                                }
                        }
                        
@@ -135,7 +144,7 @@ int ePositionGauge::event(int event, void *data, void *data2)
                        {
                                painter.setForegroundColor(gRGB(m_foreground_color));
                                int xi = scale(in), xo = scale(out);
-                               painter.fill(eRect(xi, 10, xo-xi, s.height()-14));
+                               painter.fill(eRect(xi, (s.height()-4) / 2, xo-xi, 4));
                        }
                        
                        in = m_length;