update python
[enigma2.git] / lib / gdi / gpixmap.h
index 048b73a55ef1682e6affd249b61c57aff3d62e0d..9dd170ac49be822a6936b07dbd895bb68720277c 100644 (file)
@@ -2,7 +2,7 @@
 #define __gpixmap_h
 
 #include <pthread.h>
-#include <lib/base/estring.h>
+#include <string>
 #include <lib/base/object.h>
 #include <lib/base/elock.h>
 #include <lib/gdi/erect.h>
@@ -23,16 +23,23 @@ struct gColor
 
 struct gRGB
 {
-       int b, g, r, a;
+       unsigned char b, g, r, a;
        gRGB(int r, int g, int b, int a=0): b(b), g(g), r(r), a(a)
        {
        }
        gRGB(unsigned long val): b(val&0xFF), g((val>>8)&0xFF), r((val>>16)&0xFF), a((val>>24)&0xFF)            // ARGB
        {
        }
-       gRGB()
+       gRGB(): b(0), g(0), r(0), a(0)
        {
        }
+       void operator=(unsigned long val)
+       {
+               b = val&0xFF;
+               g = (val>>8)&0xFF;
+               r = (val>>16)&0xFF;
+               a = (val>>24)&0xFF;
+       }
        bool operator < (const gRGB &c) const
        {
                if (b < c.b)
@@ -80,12 +87,12 @@ struct gLookup
  * The font is specified by a name and a size.
  * \c gFont is part of the \ref gdi.
  */
-class gFont: public virtual iObject
+class gFont: public iObject
 {
 DECLARE_REF;
 public:
 
-       eString family;
+       std::string family;
        int pointSize;
        
        /**
@@ -93,7 +100,7 @@ public:
         * \param family The name of the font, for example "NimbusSansL-Regular Sans L Regular".
         * \param pointSize the size of the font in PIXELS.
         */
-       gFont(const eString &family, int pointSize):
+       gFont(const std::string &family, int pointSize):
                        family(family), pointSize(pointSize)
        {
        }
@@ -127,6 +134,18 @@ struct gSurfaceSystem: gSurface
 struct gPixmap: public iObject
 {
 DECLARE_REF;
+private:
+       friend class gDC;
+       void fill(const gRegion &clip, const gColor &color);
+       
+       enum
+       {
+               blitAlphaTest=1
+       };
+       void blit(const gPixmap &src, ePoint pos, const gRegion &clip, int flags=0);
+       
+       void mergePalette(const gPixmap &target);
+       void line(const gRegion &clip, ePoint start, ePoint end, gColor color);
 public:
        gSurface *surface;
        
@@ -138,17 +157,6 @@ public:
        
        eSize getSize() const { return eSize(surface->x, surface->y); }
        
-       void fill(const eRect &area, const gColor &color);
-       
-       enum
-       {
-               blitAlphaTest=1
-       };
-       void blit(const gPixmap &src, ePoint pos, const eRect &clip=eRect(), int flags=0);
-       
-       void mergePalette(const gPixmap &target);
-       void line(ePoint start, ePoint end, gColor color);
-       void finalLock();
        gPixmap(gSurface *surface);
        gPixmap(eSize, int bpp);
        virtual ~gPixmap();