6 #include <lib/base/object.h>
7 #include <lib/base/elock.h>
8 #include <lib/gdi/erect.h>
9 #include <lib/gdi/fb.h>
14 gColor(int color): color(color)
20 operator int() const { return color; }
21 bool operator==(const gColor &o) const { return o.color==color; }
26 unsigned char b, g, r, a;
27 gRGB(int r, int g, int b, int a=0): b(b), g(g), r(r), a(a)
30 gRGB(unsigned long val): b(val&0xFF), g((val>>8)&0xFF), r((val>>16)&0xFF), a((val>>24)&0xFF) // ARGB
33 gRGB(): b(0), g(0), r(0), a(0)
36 void operator=(unsigned long val)
43 bool operator < (const gRGB &c) const
61 bool operator==(const gRGB &c) const
63 return (b == c.b) && (g == c.g) && (r == c.r) && (a == c.a);
71 gColor findColor(const gRGB &rgb) const;
78 gLookup(int size, const gPalette &pal, const gRGB &start, const gRGB &end);
80 ~gLookup() { delete [] lookup; }
81 void build(int size, const gPalette &pal, const gRGB &start, const gRGB &end);
85 * \brief A softreference to a font.
87 * The font is specified by a name and a size.
88 * \c gFont is part of the \ref gdi.
90 class gFont: public iObject
99 * \brief Constructs a font with the given name and size.
100 * \param family The name of the font, for example "NimbusSansL-Regular Sans L Regular".
101 * \param pointSize the size of the font in PIXELS.
103 gFont(const std::string &family, int pointSize):
104 family(family), pointSize(pointSize)
121 int x, y, bpp, bypp, stride;
128 struct gSurfaceSystem: gSurface
130 gSurfaceSystem(eSize size, int bpp);
134 struct gPixmap: public iObject
139 void fill(const gRegion &clip, const gColor &color);
145 void blit(const gPixmap &src, ePoint pos, const gRegion &clip, int flags=0);
147 void mergePalette(const gPixmap &target);
148 void line(const gRegion &clip, ePoint start, ePoint end, gColor color);
158 eSize getSize() const { return eSize(surface->x, surface->y); }
160 gPixmap(gSurface *surface);
161 gPixmap(eSize, int bpp);