diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2007-07-19 23:48:55 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2007-07-19 23:48:55 +0000 |
| commit | c479beea7cc338380a38e29ae041c03b2c299ac1 (patch) | |
| tree | 54a2173395f0f15d27f54ed3e9cf5efa9fc136c9 /lib/gui | |
| parent | 4a8afa26612c40ba5c9c48d42e15abe8bcec2b98 (diff) | |
| download | enigma2-c479beea7cc338380a38e29ae041c03b2c299ac1.tar.gz enigma2-c479beea7cc338380a38e29ae041c03b2c299ac1.zip | |
add 'canvas' gui element where you can draw into a pixmap from python
Diffstat (limited to 'lib/gui')
| -rw-r--r-- | lib/gui/Makefile.am | 3 | ||||
| -rw-r--r-- | lib/gui/ecanvas.cpp | 38 | ||||
| -rw-r--r-- | lib/gui/ecanvas.h | 17 |
3 files changed, 56 insertions, 2 deletions
diff --git a/lib/gui/Makefile.am b/lib/gui/Makefile.am index a011e07d..f4de9d12 100644 --- a/lib/gui/Makefile.am +++ b/lib/gui/Makefile.am @@ -8,5 +8,4 @@ libenigma_gui_a_SOURCES = \ ebutton.cpp elabel.cpp eslider.cpp ewidget.cpp ewidgetdesktop.cpp \ ewindow.cpp ewindowstyle.cpp elistbox.cpp elistboxcontent.cpp \ epixmap.cpp ewindowstyleskinned.cpp einput.cpp einputstring.cpp einputnumber.cpp \ - ewidgetanimation.cpp epositiongauge.cpp evideo.cpp esubtitle.cpp - + ewidgetanimation.cpp epositiongauge.cpp evideo.cpp esubtitle.cpp ecanvas.cpp diff --git a/lib/gui/ecanvas.cpp b/lib/gui/ecanvas.cpp new file mode 100644 index 00000000..c6469912 --- /dev/null +++ b/lib/gui/ecanvas.cpp @@ -0,0 +1,38 @@ +#include <lib/gui/ecanvas.h> + +eCanvas::eCanvas(eWidget *parent): ePixmap(parent) +{ +} + +void eCanvas::setSize(eSize size) +{ + setPixmap(new gPixmap(size, 32)); /* TODO: do we need 8bit surfaces? */ +} + +void eCanvas::clear(gRGB color) +{ +#if 0 + if (!m_pixmap) + return; + + ePtr<gDC> d = new gDC(m_pixmap); + gPainter p(d, eRect()); + p.setBackgroundColor(color); + p.clear(); + + invalidate(); +#endif +} + +void eCanvas::fillRect(eRect rect, gRGB color) +{ + eDebug("draw into canvas... %d %d, %d %d", rect.left(), rect.top(), rect.width(), rect.height()); +#if 0 + ePtr<gDC> d = new gDC(m_pixmap); + gPainter p(d, eRect()); + p.setForegroundColor(color); + p.fill(rect); + + invalidate(rect); +#endif +} diff --git a/lib/gui/ecanvas.h b/lib/gui/ecanvas.h new file mode 100644 index 00000000..629c603f --- /dev/null +++ b/lib/gui/ecanvas.h @@ -0,0 +1,17 @@ +#ifndef __lib_gui_ecanvas_h +#define __lib_gui_ecanvas_h + +#include <lib/gui/epixmap.h> + +class eCanvas: public ePixmap +{ +public: + eCanvas(eWidget *parent); + + void setSize(eSize size); + + void clear(gRGB color); + void fillRect(eRect rect, gRGB color); +}; + +#endif |
