Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef GNASH_FBSUP_H
00020 #define GNASH_FBSUP_H
00021
00022 #ifdef HAVE_CONFIG_H
00023 #include "gnashconfig.h"
00024 #endif
00025
00026 #include <boost/scoped_array.hpp>
00027 #include <vector>
00028 #include <linux/fb.h>
00029
00030 #include "gui.h"
00031 #include "InputDevice.h"
00032
00033 #define PIXELFORMAT_LUT8
00034 #define CMAP_SIZE (256*2)
00035
00036 #ifdef USE_MOUSE_PS2
00037 # define MOUSE_DEVICE "/dev/input/mice"
00038 #endif
00039
00040
00041
00042 #ifdef USE_ETT_TSLIB
00043 #define MOUSE_DEVICE "/dev/usb/tkpanel0"
00044 #endif
00045
00046
00047
00048
00049
00050 namespace gnash
00051 {
00052
00074
00075
00091 class FBGui : public Gui
00092 {
00093 private:
00094 int fd;
00095 int original_vt;
00096 int original_kd;
00097 int own_vt;
00098 unsigned char *fbmem;
00099 unsigned char *buffer;
00100
00101 std::vector< geometry::Range2d<int> > _drawbounds;
00102
00103 int m_stage_width;
00104 int m_stage_height;
00105 unsigned m_rowsize;
00106
00107 std::vector<boost::shared_ptr<InputDevice> > _inputs;
00108
00109 struct fb_var_screeninfo var_screeninfo;
00110 struct fb_fix_screeninfo fix_screeninfo;
00111
00113
00116 bool set_grayscale_lut8();
00117
00118 bool initialize_renderer();
00119
00121 char* find_accessible_tty(int no);
00122 char* find_accessible_tty(const char* format, int no);
00123
00125 bool disable_terminal();
00126
00128 bool enable_terminal();
00129
00130 int valid_x(int x);
00131 int valid_y(int y);
00132
00133 public:
00134 FBGui(unsigned long xid, float scale, bool loop, RunResources& r);
00135 virtual ~FBGui();
00136 virtual bool init(int argc, char ***argv);
00137 virtual bool createWindow(const char *title, int width, int height,
00138 int xPosition = 0, int yPosition = 0);
00139 virtual bool run();
00140 virtual bool createMenu();
00141 virtual bool setupEvents();
00142 virtual void renderBuffer();
00143 virtual void setInterval(unsigned int interval);
00144 virtual void setTimeout(unsigned int timeout);
00145
00146 virtual void setFullscreen();
00147 virtual void unsetFullscreen();
00148
00149 virtual void showMenu(bool show);
00150 virtual bool showMouse(bool show);
00151
00152 virtual void setInvalidatedRegions(const InvalidatedRanges& ranges);
00153 virtual bool want_multiple_regions() { return true; }
00154
00155 bool checkForData();
00156 };
00157
00158
00159 }
00160
00161 #ifdef ENABLE_FAKE_FRAMEBUFFER
00162
00163
00164
00165 int fakefb_ioctl(int fd, int request, void *data);
00166 #endif
00167
00168 #endif // end of GNASH_FBSUP_H
00169
00170
00171
00172
00173