#include <pthread.h>
#include <lib/base/estring.h>
+#include <lib/base/object.h>
+#include <lib/base/elock.h>
#include <lib/gdi/erect.h>
#include <lib/gdi/fb.h>
-#include <lib/base/elock.h>
-
-#include <lib/base/object.h>
struct gColor
{
gColor *lookup;
gLookup(int size, const gPalette &pal, const gRGB &start, const gRGB &end);
gLookup();
+ ~gLookup() { delete [] lookup; }
void build(int size, const gPalette &pal, const gRGB &start, const gRGB &end);
};
* The font is specified by a name and a size.
* \c gFont is part of the \ref gdi.
*/
-struct gFont
+class gFont: public virtual iObject
{
+DECLARE_REF;
+public:
+
eString family;
int pointSize;
{
}
- enum
+ virtual ~gFont()
{
- tRegular, tFixed
- };
-
- gFont(int type, int pointSize);
+ }
gFont()
:pointSize(0)
}
};
+struct gSurface
+{
+ int type;
+ int x, y, bpp, bypp, stride;
+ gPalette clut;
+
+ void *data;
+ virtual ~gSurface();
+};
+
+struct gSurfaceSystem: gSurface
+{
+ gSurfaceSystem(eSize size, int bpp);
+ ~gSurfaceSystem();
+};
+
struct gPixmap: public iObject
{
DECLARE_REF;
public:
- int x, y, bpp, bypp, stride;
- void *data;
+ gSurface *surface;
- gPalette clut;
+ eLock contentlock;
+ int final;
+
+ gPixmap *lock();
+ void unlock();
- eSize getSize() const { return eSize(x, y); }
+ eSize getSize() const { return eSize(surface->x, surface->y); }
void fill(const eRect &area, const gColor &color);
void mergePalette(const gPixmap &target);
void line(ePoint start, ePoint end, gColor color);
- gPixmap();
+ void finalLock();
+ gPixmap(gSurface *surface);
+ gPixmap(eSize, int bpp);
virtual ~gPixmap();
};
-struct gImage: gPixmap
-{
- gImage(eSize size, int bpp);
- ~gImage();
-};
-
#endif