diff options
| -rw-r--r-- | lib/gdi/grc.h | 7 | ||||
| -rw-r--r-- | lib/gui/epixmap.cpp | 10 | ||||
| -rw-r--r-- | lib/gui/epixmap.h | 2 | ||||
| -rw-r--r-- | skin.py | 5 |
4 files changed, 21 insertions, 3 deletions
diff --git a/lib/gdi/grc.h b/lib/gdi/grc.h index 82243483..e277db34 100644 --- a/lib/gdi/grc.h +++ b/lib/gdi/grc.h @@ -220,7 +220,12 @@ public: void fill(const gRegion &area); void clear(); - + + enum + { + BT_ALPHATEST = 1 + }; + void blit(gPixmap *pixmap, ePoint pos, const eRect &what=eRect(), int flags=0); void setPalette(gRGB *colors, int start=0, int len=256); diff --git a/lib/gui/epixmap.cpp b/lib/gui/epixmap.cpp index e4e4acc3..3a377f14 100644 --- a/lib/gui/epixmap.cpp +++ b/lib/gui/epixmap.cpp @@ -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; @@ -35,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; } diff --git a/lib/gui/epixmap.h b/lib/gui/epixmap.h index 220db1ff..ce1e7a56 100644 --- a/lib/gui/epixmap.h +++ b/lib/gui/epixmap.h @@ -5,11 +5,13 @@ class ePixmap: public eWidget { + bool m_alphatest; public: ePixmap(eWidget *parent); void setPixmap(gPixmap *pixmap); void setPixmapFromFile(const char *filename); + void setAlphatest(bool alphatest); protected: ePtr<gPixmap> m_pixmap; int event(int event, void *data=0, void *data2=0); @@ -82,6 +82,11 @@ def applySingleAttribute(guiObject, desktop, attrib, value): desktop.makeCompatiblePixmap(ptr) guiObject.setPixmap(ptr) # guiObject.setPixmapFromFile(value) + elif attrib == "alphatest": # used by ePixmap + guiObject.setAlphatest( + { "on": True, + "off": False + }[value]) elif attrib == "orientation": # used by eSlider try: guiObject.setOrientation( |
