openATV enigma2
openATV is an open source SetTopBox Graphical user interface.
elistboxcontent.h
Go to the documentation of this file.
1 #ifndef __lib_gui_elistboxcontent_h
2 #define __lib_gui_elistboxcontent_h
3 
4 #include <lib/python/python.h>
5 #include <lib/gui/elistbox.h>
6 
8 {
9  DECLARE_REF(eListboxPythonStringContent);
10 public:
13 
15  void setItemHeight(int height);
16  PyObject *getCurrentSelection();
17  int getCurrentSelectionIndex() { return m_cursor; }
18  void invalidateEntry(int index);
19  void invalidate();
21 #ifndef SWIG
22 protected:
23  void cursorHome();
24  void cursorEnd();
25  int cursorMove(int count=1);
26  int cursorValid();
27  int cursorSet(int n);
28  int cursorGet();
29  virtual int currentCursorSelectable();
30 
31  void cursorSave();
32  void cursorRestore();
33  void cursorSaveLine(int n);
34  int cursorRestoreLine();
35  int size();
36 
37  RESULT connectItemChanged(const sigc::slot0<void> &itemChanged, ePtr<eConnection> &connection);
38 
39  // void setOutputDevice ? (for allocating colors, ...) .. requires some work, though
40  void setSize(const eSize &size);
41 
42  /* the following functions always refer to the selected item */
43  virtual void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
44 
45  int getItemHeight() { return m_itemheight; }
46 
47 private:
48  int m_cursor;
49  int m_saved_cursor;
50  int m_saved_cursor_line;
51 
52 protected:
56 #endif
57 };
58 
60 {
61 public:
62  void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
63  void setSeperation(int sep) { m_seperation = sep; }
65  void setSlider(int height, int space) { m_slider_height = height; m_slider_space = space; }
66 private:
67  int m_seperation, m_slider_height, m_slider_space;
68  std::map<int, int> m_text_offset;
69 };
70 
72 {
73  ePyObject m_buildFunc;
74  ePyObject m_selectableFunc;
75  ePyObject m_template;
76  eRect m_selection_clip;
77  gRegion m_clip, m_old_clip;
78 public:
82  void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
85  void setFont(int fnt, gFont *font);
88  void setItemHeight(int height);
89  void setSelectionClip(eRect &rect, bool update=false);
90  void updateClip(gRegion &);
91  void resetClip();
92  void entryRemoved(int idx);
93  void setTemplate(SWIG_PYOBJECT(ePyObject) tmplate);
94 private:
95  std::map<int, ePtr<gFont> > m_fonts;
96 };
97 
98 #ifdef SWIG
99 #define RT_HALIGN_BIDI 0
100 #define RT_HALIGN_LEFT 1
101 #define RT_HALIGN_RIGHT 2
102 #define RT_HALIGN_CENTER 4
103 #define RT_HALIGN_BLOCK 8
104 #define RT_VALIGN_TOP 0
105 #define RT_VALIGN_CENTER 16
106 #define RT_VALIGN_BOTTOM 32
107 #define RT_WRAP 64
108 #define BT_ALPHATEST 1
109 #define BT_ALPHABLEND 2
110 #define BT_SCALE 4
111 #define BT_KEEP_ASPECT_RATIO 8
112 #define BT_FIXRATIO 8
113 #define BT_HALIGN_LEFT 0
114 #define BT_HALIGN_CENTER 16
115 #define BT_HALIGN_RIGHT 32
116 #define BT_VALIGN_TOP 0
117 #define BT_VALIGN_CENTER 64
118 #define BT_VALIGN_BOTTOM 128
119 #define BT_ALIGN_CENTER BT_HALIGN_CENTER | BT_VALIGN_CENTER
120 
121 #endif // SWIG
122 
123 #endif
ucs4_t int n
Definition: big5.h:4148
Definition: elistboxcontent.h:60
void setSeperation(int sep)
Definition: elistboxcontent.h:63
int currentCursorSelectable()
Definition: elistboxcontent.cpp:621
void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected)
Definition: elistboxcontent.cpp:349
void setSlider(int height, int space)
Definition: elistboxcontent.h:65
Definition: elistboxcontent.h:72
void entryRemoved(int idx)
Definition: elistboxcontent.cpp:1362
void setItemHeight(int height)
Definition: elistboxcontent.cpp:1331
void updateClip(gRegion &)
Definition: elistboxcontent.cpp:1349
void resetClip()
Definition: elistboxcontent.cpp:1344
void setTemplate(SWIG_PYOBJECT(ePyObject) tmplate)
Definition: elistboxcontent.cpp:1368
@ TYPE_PIXMAP_ALPHATEST
Definition: elistboxcontent.h:81
@ TYPE_PIXMAP_ALPHABLEND
Definition: elistboxcontent.h:81
@ TYPE_PIXMAP
Definition: elistboxcontent.h:81
@ TYPE_PROGRESS_PIXMAP
Definition: elistboxcontent.h:81
@ TYPE_PROGRESS
Definition: elistboxcontent.h:81
@ TYPE_TEXT
Definition: elistboxcontent.h:81
void setList(SWIG_PYOBJECT(ePyObject) list)
Definition: elistboxcontent.cpp:1338
void setSelectionClip(eRect &rect, bool update=false)
Definition: elistboxcontent.cpp:643
void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected)
Definition: elistboxcontent.cpp:791
~eListboxPythonMultiContent()
Definition: elistboxcontent.cpp:636
void setSelectableFunc(SWIG_PYOBJECT(ePyObject) func)
Definition: elistboxcontent.cpp:1273
void setBuildFunc(SWIG_PYOBJECT(ePyObject) func)
Definition: elistboxcontent.cpp:1266
void setFont(int fnt, gFont *font)
Definition: elistboxcontent.cpp:1323
int currentCursorSelectable()
Definition: elistboxcontent.cpp:1280
eListboxPythonMultiContent()
Definition: elistboxcontent.cpp:631
Definition: elistboxcontent.h:8
int cursorMove(int count=1)
Definition: elistboxcontent.cpp:78
int cursorRestoreLine()
Definition: elistboxcontent.cpp:138
~eListboxPythonStringContent()
Definition: elistboxcontent.cpp:63
void invalidate()
Definition: elistboxcontent.cpp:333
PyObject * getCurrentSelection()
Definition: elistboxcontent.cpp:317
int cursorSet(int n)
Definition: elistboxcontent.cpp:94
eListboxPythonStringContent()
Definition: elistboxcontent.cpp:58
int m_itemheight
Definition: elistboxcontent.h:55
void invalidateEntry(int index)
Definition: elistboxcontent.cpp:327
int cursorValid()
Definition: elistboxcontent.cpp:89
ePyObject m_list
Definition: elistboxcontent.h:53
void cursorSave()
Definition: elistboxcontent.cpp:123
void cursorRestore()
Definition: elistboxcontent.cpp:128
int getCurrentSelectionIndex()
Definition: elistboxcontent.h:17
void cursorSaveLine(int n)
Definition: elistboxcontent.cpp:133
void setItemHeight(int height)
Definition: elistboxcontent.cpp:310
void cursorHome()
Definition: elistboxcontent.cpp:68
void cursorEnd()
Definition: elistboxcontent.cpp:73
eSize m_itemsize
Definition: elistboxcontent.h:54
int cursorGet()
Definition: elistboxcontent.cpp:105
virtual void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected)
Definition: elistboxcontent.cpp:155
int getItemHeight()
Definition: elistboxcontent.h:45
RESULT connectItemChanged(const sigc::slot0< void > &itemChanged, ePtr< eConnection > &connection)
void setSize(const eSize &size)
Definition: elistboxcontent.cpp:150
int size()
Definition: elistboxcontent.cpp:143
virtual int currentCursorSelectable()
Definition: elistboxcontent.cpp:110
void setList(SWIG_PYOBJECT(ePyObject) list)
Definition: elistboxcontent.cpp:294
eSize getItemSize()
Definition: elistboxcontent.h:20
Definition: epoint.h:9
Definition: python.h:31
Definition: erect.h:11
Definition: esize.h:8
Definition: ewindowstyle.h:46
A softreference to a font.
Definition: gfont.h:14
Definition: grc.h:239
Definition: region.h:9
Definition: elistbox.h:11
const char int int int height
Definition: epng.h:39
fontRenderClass * font
int count
Definition: newplugin.py:14
list list
Definition: main.py:25
index
Definition: main.py:28
int RESULT
Definition: object.h:12
#define SWIG_PYOBJECT(x)
Definition: swig.h:23