• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • Examples
  • File List
  • File Members

fbsup.h

Go to the documentation of this file.
00001 //
00002 //   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
00003 //   Foundation, Inc
00004 //
00005 // This program is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License as published by
00007 // the Free Software Foundation; either version 3 of the License, or
00008 // (at your option) any later version.
00009 //
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 // 
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
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 // FIXME: this should really be TSLIB_DEVICE_NAME, but I don't have the
00041 // ETT SDK, so for now, leave it the way it was.
00042 #ifdef USE_ETT_TSLIB
00043 #define MOUSE_DEVICE "/dev/usb/tkpanel0"
00044 #endif
00045 
00046 // Define this to request a new virtual terminal at startup. This doesn't always
00047 // work and probably is not necessary anyway
00048 //#define REQUEST_NEW_VT
00049 
00050 namespace gnash
00051 {
00052 
00074 //
00075 // Supported graphics modes:
00091 class FBGui : public Gui
00092 {
00093 private:
00094     int fd;
00095     int original_vt;       // virtual terminal that was active at startup
00096     int original_kd;       // keyboard mode at startup
00097     int own_vt;            // virtual terminal we are running in   
00098     unsigned char *fbmem;  // framebuffer memory
00099     unsigned char *buffer; // offscreen 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 // end of namespace gnash
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 // local Variables:
00171 // mode: C++
00172 // indent-tabs-mode: nil
00173 // End:

Generated on Thu Sep 30 2010 14:34:58 for Gnash by  doxygen 1.7.1