- fixed blit in gRC
[openblackhole/openblackhole-enigma2.git] / lib / gui / epixmap.cpp
1 #include <lib/gui/epixmap.h>
2
3 ePixmap::ePixmap(eWidget *parent): eWidget(parent)
4 {
5 }
6
7 void ePixmap::setPixmap(gPixmap *pixmap)
8 {
9         m_pixmap = pixmap;
10         event(evtChangedPixmap);
11 }
12
13 int ePixmap::event(int event, void *data, void *data2)
14 {
15         switch (event)
16         {
17         case evtPaint:
18         {
19                 ePtr<eWindowStyle> style;
20                 
21                 getStyle(style);
22                 
23                 eWidget::event(event, data, data2);
24                 
25                 gPainter &painter = *(gPainter*)data2;
26                 if (m_pixmap)
27                         painter.blit(m_pixmap, ePoint(0, 0));
28                 
29                 return 0;
30         }
31         case evtChangedPixmap:
32                 invalidate();
33                 return 0;
34         default:
35                 return eWidget::event(event, data, data2);
36         }
37 }