X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/c2f28d655c5a33f04bc340504116496c93c47f2b..7373f39fe2ebe1b5007ed56ddd86d9ce0ad3efb7:/lib/gui/elistboxcontent.h diff --git a/lib/gui/elistboxcontent.h b/lib/gui/elistboxcontent.h index 4d2c46b5..d3d2a089 100644 --- a/lib/gui/elistboxcontent.h +++ b/lib/gui/elistboxcontent.h @@ -4,75 +4,6 @@ #include #include -class eListboxTestContent: public virtual iListboxContent -{ - DECLARE_REF(eListboxTestContent); -public: - -#ifndef SWIG -protected: - void cursorHome(); - void cursorEnd(); - int cursorMove(int count=1); - int cursorValid(); - int cursorSet(int n); - int cursorGet(); - - void cursorSave(); - void cursorRestore(); - int size(); - - RESULT connectItemChanged(const Slot0 &itemChanged, ePtr &connection); - - // void setOutputDevice ? (for allocating colors, ...) .. requires some work, though - void setSize(const eSize &size); - - /* the following functions always refer to the selected item */ - void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected); -private: - int m_cursor, m_saved_cursor; - eSize m_size; -#endif -}; - -class eListboxStringContent: public virtual iListboxContent -{ - DECLARE_REF(eListboxStringContent); -public: - eListboxStringContent(); - void setList(std::list &list); -#ifndef SWI -protected: - - void cursorHome(); - void cursorEnd(); - int cursorMove(int count=1); - int cursorValid(); - int cursorSet(int n); - int cursorGet(); - - void cursorSave(); - void cursorRestore(); - int size(); - - // void setOutputDevice ? (for allocating colors, ...) .. requires some work, though - void setSize(const eSize &size); - - /* the following functions always refer to the selected item */ - void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected); -private: - typedef std::list list; - - list m_list; - list::iterator m_cursor, m_saved_cursor; - - int m_cursor_number, m_saved_cursor_number; - int m_size; - - eSize m_itemsize; -#endif -}; - class eListboxPythonStringContent: public virtual iListboxContent { DECLARE_REF(eListboxPythonStringContent); @@ -80,7 +11,7 @@ public: eListboxPythonStringContent(); ~eListboxPythonStringContent(); - void setList(PyObject *list); + void setList(SWIG_PYOBJECT(ePyObject) list); PyObject *getCurrentSelection(); int getCurrentSelectionIndex() { return m_cursor; } void invalidateEntry(int index); @@ -94,7 +25,8 @@ protected: int cursorValid(); int cursorSet(int n); int cursorGet(); - + virtual int currentCursorSelectable(); + void cursorSave(); void cursorRestore(); int size(); @@ -106,11 +38,14 @@ protected: /* the following functions always refer to the selected item */ virtual void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected); + + int getItemHeight() { return m_itemheight; } protected: - PyObject *m_list; + ePyObject m_list; int m_cursor, m_saved_cursor; eSize m_itemsize; + int m_itemheight; #endif }; @@ -119,18 +54,46 @@ class eListboxPythonConfigContent: public eListboxPythonStringContent public: void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected); void setSeperation(int sep) { m_seperation = sep; } + int currentCursorSelectable(); private: int m_seperation; }; class eListboxPythonMultiContent: public eListboxPythonStringContent { + ePyObject m_buildFunc; + ePyObject m_selectableFunc; + ePyObject m_template; + eRect m_selection_clip; + gRegion m_clip, m_old_clip; public: + eListboxPythonMultiContent(); + ~eListboxPythonMultiContent(); + enum { TYPE_TEXT, TYPE_PROGRESS, TYPE_PIXMAP, TYPE_PIXMAP_ALPHATEST, TYPE_PIXMAP_ALPHABLEND }; void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected); - - void setFont(int fnt, gFont *fnt); + int currentCursorSelectable(); + void setList(SWIG_PYOBJECT(ePyObject) list); + void setFont(int fnt, gFont *font); + void setBuildFunc(SWIG_PYOBJECT(ePyObject) func); + void setSelectableFunc(SWIG_PYOBJECT(ePyObject) func); + void setItemHeight(int height); + void setSelectionClip(eRect &rect, bool update=false); + void updateClip(gRegion &); + void entryRemoved(int idx); + void setTemplate(SWIG_PYOBJECT(ePyObject) tmplate); private: std::map > m_font; }; +#ifdef SWIG +#define RT_HALIGN_LEFT 0 +#define RT_HALIGN_RIGHT 1 +#define RT_HALIGN_CENTER 2 +#define RT_HALIGN_BLOCK 4 +#define RT_VALIGN_TOP 0 +#define RT_VALIGN_CENTER 8 +#define RT_VALIGN_BOTTOM 16 +#define RT_WRAP 32 +#endif // SWIG + #endif