fix gPixmap ref, fix usage of gImage
[enigma2.git] / lib / gdi / fb.h
1 #ifndef __FB_H
2 #define __FB_H
3
4 #include <linux/fb.h>
5 #include <lib/base/eerror.h>
6
7 class fbClass
8 {
9         int fd;
10         unsigned int xRes, yRes, stride, bpp;
11         int available;
12         struct fb_var_screeninfo screeninfo, oldscreen;
13         fb_cmap cmap;
14         __u16 red[256], green[256], blue[256], trans[256];
15         static fbClass *instance;
16         
17         int locked;
18 public:
19         unsigned char *lfb;
20         int showConsole(int state);
21         int SetMode(unsigned int xRes, unsigned int yRes, unsigned int bpp);
22         int Available() { return available; }
23         unsigned int Stride() { return stride; }
24         fb_cmap *CMAP() { return &cmap; }
25
26         fbClass(const char *fb="/dev/fb/0");
27         ~fbClass();
28         
29         static fbClass *getInstance();
30
31                                 // low level gfx stuff
32         int PutCMAP();
33
34                                 // gfx stuff (colors are 8bit!)
35         void Box(int x, int y, int width, int height, int color, int backcolor=0);
36         void NBox(int x, int y, int width, int height, int color);
37         void VLine(int x, int y, int sy, int color);
38         
39         int lock();
40         void unlock();
41 };
42
43 #endif