1 #include <lib/gui/ecanvas.h>
3 eCanvas::eCanvas(eWidget *parent): ePixmap(parent)
7 void eCanvas::setSize(eSize size)
9 setPixmap(new gPixmap(size, 32)); /* TODO: do we need 8bit surfaces? */
12 void eCanvas::clear(gRGB color)
17 ePtr<gDC> d = new gDC(m_pixmap);
18 gPainter p(d, eRect());
19 p.resetClip(eRect(ePoint(0,0), m_pixmap->size()));
20 p.setBackgroundColor(color);
26 void eCanvas::fillRect(eRect rect, gRGB color)
31 ePtr<gDC> dc = new gDC(m_pixmap);
34 p.resetClip(eRect(ePoint(0,0), m_pixmap->size()));
35 p.setForegroundColor(color);
41 void eCanvas::writeText(eRect rect, gRGB fg, gRGB bg, gFont *font, const char *string, int flags)
43 ePtr<gDC> dc = new gDC(m_pixmap);
47 p.resetClip(eRect(ePoint(0,0), m_pixmap->size()));
48 p.setForegroundColor(fg);
49 p.setBackgroundColor(bg);
50 p.renderText(rect, string, flags);