1 #include <lib/gui/epixmap.h>
2 #include <lib/gdi/epng.h>
3 #include <lib/gui/ewidgetdesktop.h>
5 ePixmap::ePixmap(eWidget *parent)
6 :eWidget(parent), m_alphatest(false)
10 void ePixmap::setAlphatest(bool alphatest)
12 m_alphatest = alphatest;
13 setTransparent(alphatest);
16 void ePixmap::setPixmap(gPixmap *pixmap)
19 event(evtChangedPixmap);
22 void ePixmap::setPixmapFromFile(const char *filename)
24 loadPNG(m_pixmap, filename);
28 eDebug("ePixmap::setPixmapFromFile: loadPNG failed");
32 // TODO: This only works for desktop 0
33 getDesktop(0)->makeCompatiblePixmap(*m_pixmap);
34 event(evtChangedPixmap);
37 int ePixmap::event(int event, void *data, void *data2)
43 ePtr<eWindowStyle> style;
47 // eWidget::event(event, data, data2);
49 gPainter &painter = *(gPainter*)data2;
51 painter.blit(m_pixmap, ePoint(0, 0), eRect(), m_alphatest?gPainter::BT_ALPHATEST:0);
55 case evtChangedPixmap:
59 return eWidget::event(event, data, data2);