diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2005-02-27 02:20:31 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2005-02-27 02:20:31 +0000 |
| commit | dba614edd2aad3c17e244914eaef3809d8300cb1 (patch) | |
| tree | 382782ddff50bf88e421d933b13e35b9e5682cff /lib/gui | |
| parent | 1cdf6cb021fcaa6548b90ba7b6765cf1e8b8b37b (diff) | |
| download | enigma2-dba614edd2aad3c17e244914eaef3809d8300cb1.tar.gz enigma2-dba614edd2aad3c17e244914eaef3809d8300cb1.zip | |
- hopefully fixed some python/refcount stuff (__deref__ is still evil!)
- first work on skin support, not really far
- improved infobar
- deletes components when destroying screens
- fixed elistbox and component
- add ability to change bouqet - real query parser still unfinished
Diffstat (limited to 'lib/gui')
| -rw-r--r-- | lib/gui/elistbox.cpp | 11 | ||||
| -rw-r--r-- | lib/gui/elistbox.h | 16 | ||||
| -rw-r--r-- | lib/gui/elistboxcontent.cpp | 4 | ||||
| -rw-r--r-- | lib/gui/elistboxcontent.h | 6 | ||||
| -rw-r--r-- | lib/gui/ewidget.h | 2 | ||||
| -rw-r--r-- | lib/gui/ewindowstyle.cpp | 31 | ||||
| -rw-r--r-- | lib/gui/ewindowstyle.h | 41 |
7 files changed, 98 insertions, 13 deletions
diff --git a/lib/gui/elistbox.cpp b/lib/gui/elistbox.cpp index 1dae137f..a3fae34c 100644 --- a/lib/gui/elistbox.cpp +++ b/lib/gui/elistbox.cpp @@ -22,11 +22,17 @@ eListbox::~eListbox() void eListbox::setContent(iListboxContent *content) { m_content = content; + if (content) + m_content->setListbox(this); entryReset(); } void eListbox::moveSelection(int dir) { + /* refuse to do anything without a valid list. */ + if (!m_content) + return; + /* we need the old top/sel to see what we have to redraw */ int oldtop = m_top; int oldsel = m_selected; @@ -98,6 +104,8 @@ int eListbox::event(int event, void *data, void *data2) { ePtr<eWindowStyle> style; + if (!m_content) + return eWidget::event(event, data, data2); assert(m_content); recalcSize(); // move to event @@ -183,9 +191,10 @@ void eListbox::entryChanged(int index) void eListbox::entryReset() { - invalidate(); if (m_content) m_content->cursorHome(); m_top = 0; m_selected = 0; + invalidate(); + eDebug("inval!"); } diff --git a/lib/gui/elistbox.h b/lib/gui/elistbox.h index 78e0fbe9..9e23bde3 100644 --- a/lib/gui/elistbox.h +++ b/lib/gui/elistbox.h @@ -21,6 +21,7 @@ public: anyway. */ #ifndef SWIG protected: + iListboxContent(); friend class eListbox; virtual void cursorHome()=0; virtual void cursorEnd()=0; @@ -72,12 +73,8 @@ public: pageDown, justCheck }; -protected: - int event(int event, void *data=0, void *data2=0); - void recalcSize(); -private: - friend class iListboxContent; - + +#ifndef SWIG /* entryAdded: an entry was added *before* the given index. it's index is the given number. */ void entryAdded(int index); /* entryRemoved: an entry with the given index was removed. */ @@ -86,11 +83,18 @@ private: void entryChanged(int index); /* the complete list changed. you should not attemp to keep the current index. */ void entryReset(); + +protected: + int event(int event, void *data=0, void *data2=0); + void recalcSize(); +private: int m_top, m_selected; int m_itemheight; int m_items_per_page; ePtr<iListboxContent> m_content; +#endif + }; #endif diff --git a/lib/gui/elistboxcontent.cpp b/lib/gui/elistboxcontent.cpp index 0a10b27a..209b5250 100644 --- a/lib/gui/elistboxcontent.cpp +++ b/lib/gui/elistboxcontent.cpp @@ -29,6 +29,10 @@ iListboxContent::~iListboxContent() { } +iListboxContent::iListboxContent(): m_listbox(0) +{ +} + void iListboxContent::setListbox(eListbox *lb) { m_listbox = lb; diff --git a/lib/gui/elistboxcontent.h b/lib/gui/elistboxcontent.h index deea3000..a2e1fd36 100644 --- a/lib/gui/elistboxcontent.h +++ b/lib/gui/elistboxcontent.h @@ -6,7 +6,7 @@ class eListboxTestContent: public virtual iListboxContent { - DECLARE_REF; + DECLARE_REF(eListboxTestContent); public: #ifndef SWIG @@ -37,7 +37,7 @@ private: class eListboxStringContent: public virtual iListboxContent { - DECLARE_REF; + DECLARE_REF(eListboxStringContent); public: eListboxStringContent(); void setList(std::list<std::string> &list); @@ -75,7 +75,7 @@ private: class eListboxPythonStringContent: public virtual iListboxContent { - DECLARE_REF; + DECLARE_REF(eListboxPythonStringContent); public: eListboxPythonStringContent(); ~eListboxPythonStringContent(); diff --git a/lib/gui/ewidget.h b/lib/gui/ewidget.h index 12d2e743..97eb1434 100644 --- a/lib/gui/ewidget.h +++ b/lib/gui/ewidget.h @@ -5,8 +5,6 @@ #include <lib/base/eptrlist.h> /* for eSmartPtrList */ #include <lib/gui/ewindowstyle.h> /* for eWindowStyle */ -class eWindowStyle; - class eWidget { friend class eWidgetDesktop; diff --git a/lib/gui/ewindowstyle.cpp b/lib/gui/ewindowstyle.cpp index ccf7299f..3b8271f6 100644 --- a/lib/gui/ewindowstyle.cpp +++ b/lib/gui/ewindowstyle.cpp @@ -105,3 +105,34 @@ void eWindowStyleSimple::drawFrame(gPainter &painter, const eRect &frame, int wh painter.line(frame.bottomRight1(), frame.bottomLeft1()); painter.line(frame.bottomLeft1(), frame.topLeft1()); } + +DEFINE_REF(eWindowStyleSkinned); + +eWindowStyleSkinned::eWindowStyleSkinned() +{ +} + +void eWindowStyleSkinned::handleNewSize(eWindow *wnd, const eSize &size) +{ +} + +void eWindowStyleSkinned::paintWindowDecoration(eWindow *wnd, gPainter &painter, const std::string &title) +{ +} + +void eWindowStyleSkinned::paintBackground(gPainter &painter, const ePoint &offset, const eSize &size) +{ +} + +void eWindowStyleSkinned::setStyle(gPainter &painter, int what) +{ +} + +void eWindowStyleSkinned::drawFrame(gPainter &painter, const eRect &frame, int what) +{ +} + +void eWindowStyleSkinned::drawBorder(gPainter &painter, const eSize &size, const struct borderSet &border, int where) +{ +} + diff --git a/lib/gui/ewindowstyle.h b/lib/gui/ewindowstyle.h index 74ff88d5..6431c242 100644 --- a/lib/gui/ewindowstyle.h +++ b/lib/gui/ewindowstyle.h @@ -32,7 +32,7 @@ public: class eWindowStyleSimple: public eWindowStyle { - DECLARE_REF; + DECLARE_REF(eWindowStyleSimple); private: ePtr<gFont> m_fnt; gColor m_border_color_tl, m_border_color_br, m_title_color_back, m_title_color, m_background_color; @@ -47,4 +47,43 @@ public: void drawFrame(gPainter &painter, const eRect &frame, int what); }; +class eWindowStyleSkinned: public eWindowStyle +{ + DECLARE_REF(eWindowStyleSkinned); +public: + eWindowStyleSkinned(); + void handleNewSize(eWindow *wnd, const eSize &size); + void paintWindowDecoration(eWindow *wnd, gPainter &painter, const std::string &title); + void paintBackground(gPainter &painter, const ePoint &offset, const eSize &size); + void setStyle(gPainter &painter, int what); + void drawFrame(gPainter &painter, const eRect &frame, int what); + + enum { + bsWindow, + bsButton, +#ifndef SWIG + bsMax +#endif + }; + + enum { + bpTopLeft = 1, + bpTop = 2, + bpTopRight = 4, + bpLeft = 8, + bpRight = 0x10, + bpBottomLeft = 0x20, + bpBottom = 0x40, + bpBottomRight = 0x80, + bpBackground = 0x100 + }; +private: + struct borderSet + { + ePtr<gPixmap> m_pixmap[9]; + }; + + void drawBorder(gPainter &painter, const eSize &size, const struct borderSet &border, int where); +}; + #endif |
