add PyObject refcount debugging code
[enigma2.git] / lib / gui / epositiongauge.h
1 #ifndef __lib_gui_epositiongauge_h
2 #define __lib_gui_epositiongauge_h
3
4 #include <lib/gui/ewidget.h>
5 #include <set>
6
7 typedef long long pts_t;
8
9 class ePixmap;
10
11 class ePositionGauge: public eWidget
12 {
13 public:
14         ePositionGauge(eWidget *parent);
15         ~ePositionGauge();
16         void setLength(const pts_t &len);
17         void setPosition(const pts_t &pos);
18         
19         void setInColor(const gRGB &color); /* foreground? */
20         void setPointer(int which, gPixmap *pixmap, const ePoint &center);
21         
22         void setInOutList(PyObject *list);
23         void setForegroundColor(const gRGB &col);
24         
25         void enableSeekPointer(int enable);
26         void setSeekPosition(const pts_t &pos);
27         
28 #ifndef SWIG
29 protected:
30         int event(int event, void *data=0, void *data2=0);
31 private:
32         void updatePosition();
33         enum ePositionGaugeEvent
34         {
35                 evtChangedPosition = evtUserWidget
36         };
37         ePixmap *m_point_widget, *m_seek_point_widget;
38         ePoint m_point_center, m_seek_point_center;
39         
40         pts_t m_position, m_length, m_seek_position;
41         int m_pos, m_seek_pos;
42         
43                 /* TODO: this is duplicated code from lib/service/servicedvb.h */
44         struct cueEntry
45         {
46                 pts_t where;
47                 unsigned int what;
48                 
49                 bool operator < (const struct cueEntry &o) const
50                 {
51                         return where < o.where;
52                 }
53                 cueEntry(const pts_t &where, unsigned int what) :
54                         where(where), what(what)
55                 {
56                 }
57         };
58         
59         std::multiset<cueEntry> m_cue_entries;
60         int scale(const pts_t &val);
61         
62         int m_have_foreground_color;
63         gRGB m_foreground_color;
64 #endif
65 };
66
67 #endif