fix bug: last char in removeDVBChars was removed
[enigma2.git] / lib / gui / epixmap.cpp
1 #include <lib/gui/epixmap.h>
2 #include <lib/gdi/epng.h>
3 #include <lib/gui/ewidgetdesktop.h>
4
5 ePixmap::ePixmap(eWidget *parent): eWidget(parent)
6 {
7 }
8
9 void ePixmap::setPixmap(gPixmap *pixmap)
10 {
11         m_pixmap = pixmap;
12         event(evtChangedPixmap);
13 }
14
15 void ePixmap::setPixmapFromFile(const char *filename)
16 {
17         loadPNG(m_pixmap, filename);
18                 
19                 // TODO
20         getDesktop()->makeCompatiblePixmap(*m_pixmap);
21         event(evtChangedPixmap);
22 }
23
24 int ePixmap::event(int event, void *data, void *data2)
25 {
26         switch (event)
27         {
28         case evtPaint:
29         {
30                 ePtr<eWindowStyle> style;
31                 
32                 getStyle(style);
33                 
34 //              eWidget::event(event, data, data2);
35                 
36                 gPainter &painter = *(gPainter*)data2;
37                 if (m_pixmap)
38                         painter.blit(m_pixmap, ePoint(0, 0));
39                 
40                 return 0;
41         }
42         case evtChangedPixmap:
43                 invalidate();
44                 return 0;
45         default:
46                 return eWidget::event(event, data, data2);
47         }
48 }