X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/31688e1b8f028059a700a92a8276c97928abd260..df8830e6f19c5557fd52b1a9ac4fbf23c1afcdf2:/lib/gui/elistboxcontent.h diff --git a/lib/gui/elistboxcontent.h b/lib/gui/elistboxcontent.h index 6219cec6..f7e5d2b6 100644 --- a/lib/gui/elistboxcontent.h +++ b/lib/gui/elistboxcontent.h @@ -2,18 +2,31 @@ #define __lib_gui_elistboxcontent_h #include +#include -class eListboxTestContent: public virtual iListboxContent +class eListboxPythonStringContent: public virtual iListboxContent { - DECLARE_REF; + DECLARE_REF(eListboxPythonStringContent); public: + eListboxPythonStringContent(); + ~eListboxPythonStringContent(); + + void setList(PyObject *list); + PyObject *getCurrentSelection(); + int getCurrentSelectionIndex() { return m_cursor; } + void invalidateEntry(int index); + void invalidate(); + eSize getItemSize() { return m_itemsize; } +#ifndef SWIG +protected: void cursorHome(); void cursorEnd(); int cursorMove(int count=1); int cursorValid(); int cursorSet(int n); int cursorGet(); - + virtual int currentCursorSelectable(); + void cursorSave(); void cursorRestore(); int size(); @@ -24,83 +37,39 @@ public: 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: + virtual void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected); + +protected: + PyObject *m_list; int m_cursor, m_saved_cursor; - eSize m_size; + eSize m_itemsize; +#endif }; -class eListboxStringContent: public virtual iListboxContent +class eListboxPythonConfigContent: public eListboxPythonStringContent { - DECLARE_REF; public: - eListboxStringContent(); - - 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); - - void setList(std::list &list); + void setSeperation(int sep) { m_seperation = sep; } + int currentCursorSelectable(); 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; + int m_seperation; }; -class eListboxPythonStringContent: public virtual iListboxContent +class eListboxPythonMultiContent: public eListboxPythonStringContent { - DECLARE_REF; + PyObject *m_buildFunc; public: - eListboxPythonStringContent(); - ~eListboxPythonStringContent(); - 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 */ + eListboxPythonMultiContent(); + ~eListboxPythonMultiContent(); + enum { TYPE_TEXT, TYPE_PROGRESS, TYPE_PIXMAP, TYPE_PIXMAP_ALPHATEST }; void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected); + int currentCursorSelectable(); - void setList(PyObject *list); - - PyObject *getCurrentSelection(); - + void setFont(int fnt, gFont *fnt); + void setBuildFunc(PyObject *func); private: - PyObject *m_list; - int m_cursor, m_saved_cursor; - eSize m_itemsize; + std::map > m_font; }; #endif