allow access to gfbdc from python to set resolution
[vuplus_dvbapp] / lib / gdi / gfbdc.h
1 #ifndef __gfbdc_h
2 #define __gfbdc_h
3
4 #include "fb.h"
5 #include "gpixmap.h"
6 #include "grc.h"
7
8 class gFBDC;
9
10 SWIG_TEMPLATE_TYPEDEF(ePtr<gFBDC>, gFBDCPtr);
11
12 class gFBDC: public gDC
13 {
14 #ifndef SWIG
15         fbClass *fb;
16         static gFBDC *instance;
17         void exec(gOpcode *opcode);
18         unsigned char ramp[256], rampalpha[256]; // RGB ramp 0..255
19         int brightness, gamma, alpha;
20         void calcRamp();
21         void setPalette();
22         gSurface surface, surface_back;
23         int m_enable_double_buffering;
24         int m_xres, m_yres;
25 #endif
26 public:
27         void reloadSettings();
28         void setAlpha(int alpha);
29         void setBrightness(int brightness);
30         void setGamma(int gamma);
31
32         int getAlpha() { return alpha; }
33         int getBrightness() { return brightness; }
34         int getGamma() { return gamma; }
35
36         int haveDoubleBuffering() { return m_enable_double_buffering; }
37
38         void setResolution(int xres, int yres);
39
40         void saveSettings();
41
42         gFBDC();
43         virtual ~gFBDC();
44         static SWIG_VOID(int) getInstance(ePtr<gFBDC> &SWIG_NAMED_OUTPUT(ptr)) { if (!instance) return -1; ptr = instance; return 0; }
45         int islocked() { return fb->islocked(); }
46 };
47
48 #endif