add two native python epg views
[enigma2.git] / lib / gui / epixmap.cpp
index ca3e456275de817cebab05c99da3d227bd663d61..3a377f14c78ad5ee9280fb8870f18d34fd1f82b7 100644 (file)
@@ -2,10 +2,16 @@
 #include <lib/gdi/epng.h>
 #include <lib/gui/ewidgetdesktop.h>
 
-ePixmap::ePixmap(eWidget *parent): eWidget(parent)
+ePixmap::ePixmap(eWidget *parent)
+       :eWidget(parent), m_alphatest(false)
 {
 }
 
+void ePixmap::setAlphatest(bool alphatest)
+{
+       m_alphatest = alphatest;
+}
+
 void ePixmap::setPixmap(gPixmap *pixmap)
 {
        m_pixmap = pixmap;
@@ -14,11 +20,7 @@ void ePixmap::setPixmap(gPixmap *pixmap)
 
 void ePixmap::setPixmapFromFile(const char *filename)
 {
-       // use direct filename for absolute path or relative to enigma2 DATADIR otherwise
-       if (filename[0] == '/')
-               loadPNG(m_pixmap, filename);
-       else
-               loadPNG(m_pixmap, strcat(DATADIR "/enigma2/", filename));
+       loadPNG(m_pixmap, filename);
                
                // TODO
        getDesktop()->makeCompatiblePixmap(*m_pixmap);
@@ -39,7 +41,7 @@ int ePixmap::event(int event, void *data, void *data2)
                
                gPainter &painter = *(gPainter*)data2;
                if (m_pixmap)
-                       painter.blit(m_pixmap, ePoint(0, 0));
+                       painter.blit(m_pixmap, ePoint(0, 0), eRect(), m_alphatest?gPainter::BT_ALPHATEST:0);
                
                return 0;
        }