5 #include <lib/base/estring.h>
6 #include <lib/gdi/erect.h>
7 #include <lib/gdi/fb.h>
8 #include <lib/base/elock.h>
10 #include <lib/base/object.h>
15 gColor(int color): color(color)
21 operator int() const { return color; }
22 bool operator==(const gColor &o) const { return o.color==color; }
28 gRGB(int r, int g, int b, int a=0): b(b), g(g), r(r), a(a)
31 gRGB(unsigned long val): b(val&0xFF), g((val>>8)&0xFF), r((val>>16)&0xFF), a((val>>24)&0xFF) // ARGB
37 bool operator < (const gRGB &c) const
55 bool operator==(const gRGB &c) const
57 return (b == c.b) && (g == c.g) && (r == c.r) && (a == c.a);
65 gColor findColor(const gRGB &rgb) const;
72 gLookup(int size, const gPalette &pal, const gRGB &start, const gRGB &end);
74 void build(int size, const gPalette &pal, const gRGB &start, const gRGB &end);
78 * \brief A softreference to a font.
80 * The font is specified by a name and a size.
81 * \c gFont is part of the \ref gdi.
89 * \brief Constructs a font with the given name and size.
90 * \param family The name of the font, for example "NimbusSansL-Regular Sans L Regular".
91 * \param pointSize the size of the font in PIXELS.
93 gFont(const eString &family, int pointSize):
94 family(family), pointSize(pointSize)
103 gFont(int type, int pointSize);
111 struct gPixmap: public iObject
115 int x, y, bpp, bypp, stride;
120 eSize getSize() const { return eSize(x, y); }
122 void fill(const eRect &area, const gColor &color);
128 void blit(const gPixmap &src, ePoint pos, const eRect &clip=eRect(), int flags=0);
130 void mergePalette(const gPixmap &target);
131 void line(ePoint start, ePoint end, gColor color);
136 struct gImage: gPixmap
138 gImage(eSize size, int bpp);