m_dirty_region |= region;
}
-void eWidgetDesktop::setBackgroundColor(gColor col)
+void eWidgetDesktop::setBackgroundColor(gRGB col)
{
m_background_color = col;
}
}
+void eWidgetDesktop::setPalette(gPixmap &pm)
+{
+ ASSERT(m_dc);
+ gPainter painter(m_dc);
+ painter.setPalette(&pm);
+}
+
void eWidgetDesktop::paint()
{
gPainter painter(m_dc);
painter.setBackgroundColor(m_background_color);
painter.clear();
+ painter.flush();
+
m_dirty_region = gRegion();
}
m_timer->start(0, 1);
}
+void eWidgetDesktop::makeCompatiblePixmap(gPixmap &pm)
+{
+ eDebug("widgetDesktop: make compatible pixmap of %p\n", &pm);
+ if (!m_dc)
+ {
+ eWarning("eWidgetDesktop: no DC to make pixmap compatible with!");
+ return;
+ }
+
+ ePtr<gDC> pixmap_dc = new gDC(&pm);
+ gPainter pixmap_painter(pixmap_dc);
+
+ ePtr<gPixmap> target_pixmap;
+ m_dc->getPixmap(target_pixmap);
+
+ assert(target_pixmap);
+
+ pixmap_painter.mergePalette(target_pixmap);
+}
+
eWidgetDesktop::eWidgetDesktop(eSize size): m_screen_size(size), m_mainloop(0), m_timer(0)
{
+ m_dirty_region = gRegion(eRect(ePoint(0, 0), m_screen_size));
}
eWidgetDesktop::~eWidgetDesktop()