Gnash  0.8.10
fb_glue_ovg.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 FB_GLUE_OVG_H
00020 #define FB_GLUE_OVG_H 1
00021 
00022 #ifdef HAVE_CONFIG_H
00023 #include "gnashconfig.h"
00024 #endif
00025 
00026 #include <boost/cstdint.hpp>
00027 #include "openvg/OpenVGRenderer.h"
00028 #include "fbsup.h"
00029 #include "fb_glue.h"
00030 
00031 #ifdef HAVE_VG_OPENVG_H
00032 #include <VG/openvg.h>
00033 #endif
00034 
00035 #ifdef BUILD_RAWFB_DEVICE
00036 # include "rawfb/RawFBDevice.h"
00037 #endif
00038 
00039 #ifdef BUILD_EGL_DEVICE
00040 # include "egl/eglDevice.h"
00041 #endif
00042 
00043 namespace gnash {
00044 
00045 namespace gui {
00046 
00047 class render_handler;
00048 
00049 class FBOvgGlue : public FBGlue
00050 {
00051     
00052 public:
00053     FBOvgGlue() {};
00054     FBOvgGlue(int fd);
00055 //    FBOvgGlue(int x, int y, int width, int height);
00056     ~FBOvgGlue();
00057     
00058     bool init(int argc, char ***argv);
00059     void render();
00060     
00061     // resize(int width, int height);
00062     void draw();
00063     Renderer* createRenderHandler();
00064     void setInvalidatedRegions(const InvalidatedRanges &ranges);
00065     
00068     void prepDrawingArea(void *drawing_area);
00069     
00070     void initBuffer(int width, int height);
00071     void resize(int width, int height);
00072     // void render(geometry::Range2d<int>& bounds);
00073 
00074     // FIXME: these should go away to be replaced by the DeviceGlue
00075     // versions of the same methods.
00076     // int width() { return (_device) ? _device->getWidth() : 0; };
00077     // int height() { return (_device) ? _device->getHeight() : 0; };
00078     int width() { return _width; };
00079     int height() { return _height; };
00080     int stride() { return _stride; };
00081 
00082     // these are used only for debugging purpose to access private data
00083     size_t getBounds() { return _drawbounds.size(); };
00084 
00085 private:
00086     int         _stride;
00087     int         _width;
00088     int         _height;
00089     
00090     //Rectangle _bounds;
00091     std::vector< geometry::Range2d<int> > _drawbounds;
00092     geometry::Range2d<int>              _validbounds;
00093 
00094     // EGL needs it's own display device, as that's how it stays platform
00095     // independent. For a Framebuffer we use that, and on the desktop,
00096     // well, there really isn't framebuffer support on the desktop because
00097     // the X11 server has control of the device. So the X11 glue support
00098     // for OpenVG on a fake framebuffer is for development only.
00099 #ifdef BUILD_RAWFB_DEVICE
00100     renderer::rawfb::RawFBDevice        _display;
00101 #else
00102 # ifdef BUILD_X11_DEVICE
00103     renderer::x11::X11Device            _display;
00104 # endif
00105 #endif
00106 };
00107 
00108 } // end of namespace gui
00109 } // end of namespace gnash
00110 
00111 #endif  // end of FB_GLUE_OVG_H
00112 
00113 // Local Variables:
00114 // mode: C++
00115 // indent-tabs-mode: nil
00116 // End: