openATV enigma2
openATV is an open source SetTopBox Graphical user interface.
fb.h
Go to the documentation of this file.
1 #ifndef __FB_H
2 #define __FB_H
3 
4 #include <lib/base/eerror.h>
5 #include <linux/fb.h>
6 #if defined(__sh__)
7  #include <linux/stmfb.h>
8 #endif
9 
10 #ifndef FB_DEV
11 # define FB_DEV "/dev/fb0"
12 #endif
13 
14 class fbClass
15 {
16  int fbFd;
17  int xRes, yRes, stride, bpp;
18 #if defined(__sh__)
19  struct stmfbio_output_configuration outcfg;
20  struct stmfbio_outputinfo outinfo;
21  struct stmfbio_planeinfo planemode;
22  struct stmfbio_var_screeninfo_ex infoex;
23 
24  int xResSc, yResSc;
25  int topDiff, leftDiff, rightDiff, bottomDiff;
26 #endif
27  int available;
28  struct fb_var_screeninfo screeninfo;
29  fb_cmap cmap;
30  uint16_t red[256], green[256], blue[256], trans[256];
31  static fbClass *instance;
32  int locked;
33 
34  int m_manual_blit;
35  int m_number_of_pages;
36  int m_phys_mem;
37 #ifdef SWIG
38  fbClass(const char *fb=FB_DEV);
39  ~fbClass();
40 public:
41 #else
42 public:
43  unsigned char *lfb;
44 #ifdef CONFIG_ION
45  int m_accel_fd;
46 #endif
47 #if not defined(__sh__)
48  void enableManualBlit();
49  void disableManualBlit();
50  int showConsole(int state);
51 #endif
52  int SetMode(int xRes, int yRes, int bpp);
53  void getMode(int &xres, int &yres, int &bpp);
54  int Available() { return available; }
55 
56  int getNumPages() { return m_number_of_pages; }
57 
58  unsigned long getPhysAddr() { return m_phys_mem; }
59 
60  int setOffset(int off);
61  int waitVSync();
62  void blit();
63  unsigned int Stride() { return stride; }
64  fb_cmap *CMAP() { return &cmap; }
65 
66  fbClass(const char *fb=FB_DEV);
67  ~fbClass();
68 
69  // low level gfx stuff
70  int PutCMAP();
71 #endif
72  static fbClass *getInstance();
73 #if defined(__sh__)
74  void clearFBblit();
75  int getFBdiff(int ret);
76  void setFBdiff(int top, int right, int left, int bottom);
77 #endif
78 
79  int lock();
80  void unlock();
81  int islocked() { return locked; }
82 };
83 
84 #endif
Definition: fb.h:15
int getNumPages()
Definition: fb.h:56
unsigned int Stride()
Definition: fb.h:63
int PutCMAP()
Definition: fb.cpp:449
int lock()
Definition: fb.cpp:454
int SetMode(int xRes, int yRes, int bpp)
Definition: fb.cpp:210
fbClass(const char *fb=FB_DEV)
Definition: fb.cpp:41
static fbClass * getInstance()
Definition: fb.cpp:36
void unlock()
Definition: fb.cpp:487
void getMode(int &xres, int &yres, int &bpp)
Definition: fb.cpp:310
unsigned char * lfb
Definition: fb.h:43
fb_cmap * CMAP()
Definition: fb.h:64
~fbClass()
Definition: fb.cpp:427
int islocked()
Definition: fb.h:81
unsigned long getPhysAddr()
Definition: fb.h:58
int waitVSync()
Definition: fb.cpp:330
void blit()
Definition: fb.cpp:336
int Available()
Definition: fb.h:54
int setOffset(int off)
Definition: fb.cpp:323
#define FB_DEV
Definition: fb.h:11
instance
Definition: NavigationInstance.py:2