Merge branch 'bug_538_ignore_global_actions_in_standby'
[enigma2.git] / lib / gui / ecanvas.cpp
index c6469912d2ba7f1906a880f1d8b8b275cbc1d0ee..c9a1ec828101c243cb6f86466e0f478bca6814e6 100644 (file)
@@ -11,28 +11,43 @@ void eCanvas::setSize(eSize size)
 
 void eCanvas::clear(gRGB color)
 {
-#if 0
        if (!m_pixmap)
                return;
 
        ePtr<gDC> d = new gDC(m_pixmap);
        gPainter p(d, eRect());
+       p.resetClip(eRect(ePoint(0,0), m_pixmap->size()));
        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());
+       if (!m_pixmap)
+               return;
+
+       ePtr<gDC> dc = new gDC(m_pixmap);
+
+       gPainter p(dc);
+       p.resetClip(eRect(ePoint(0,0), m_pixmap->size()));
        p.setForegroundColor(color);
        p.fill(rect);
 
        invalidate(rect);
-#endif
+}
+
+void eCanvas::writeText(eRect rect, gRGB fg, gRGB bg, gFont *font, const char *string, int flags)
+{
+       ePtr<gDC> dc = new gDC(m_pixmap);
+
+       gPainter p(dc);
+       p.setFont(font);
+       p.resetClip(eRect(ePoint(0,0), m_pixmap->size()));
+       p.setForegroundColor(fg);
+       p.setBackgroundColor(bg);
+       p.renderText(rect, string, flags);
+
+       invalidate(rect);
 }