Gnash
0.8.10
|
00001 // 00002 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 00003 // 2011 Free Software 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 HAIKU_AGG_GLUE_H 00020 #define HAIKU_AGG_GLUE_H 00021 00022 #include <vector> 00023 #include <boost/cstdint.hpp> // for boost::?int??_t 00024 #include <Renderer.h> 00025 00026 #include <SupportDefs.h> 00027 00028 class BWindow; 00029 00030 namespace gnash 00031 { 00032 00033 class Gui; 00034 class BeV; 00035 00036 /* copy in plugin.cpp */ 00037 const int GNASH_MOUSE_CLICKED = 'GMCL'; 00038 const int GNASH_MOUSE_MOVED = 'GMMV'; 00039 const int GNASH_KEY_EVENT = 'GKKE'; 00040 const int GNASH_RESIZE = 'GRSZ'; 00041 const int GNASH_HIDDEN = 'GHID'; 00042 const int GNASH_SHOWN = 'GSHN'; 00043 00044 00045 const int GNASH_SET_FULLSCREEN = 'GSFS'; 00046 const int GNASH_UNSET_FULLSCREEN = 'GUFS'; 00047 00048 class HaikuAggGlue 00049 { 00050 public: 00051 HaikuAggGlue(Gui *gui, unsigned long xid); 00052 virtual ~HaikuAggGlue(); 00053 00054 bool init(int argc, char **argv[], BWindow **win, std::string sharefilename); 00055 Renderer* createRenderHandler(int depth); 00056 void setInvalidatedRegions(const InvalidatedRanges& ranges); 00057 void ViewNoMore(); 00058 void ViewNeeded(); 00059 bool prepDrawingArea(int width, int height, boost::uint32_t sdl_flags); 00060 boost::uint32_t maskFlags(boost::uint32_t sdl_flags); 00061 void render(); 00062 void render(int minx, int miny, int maxx, int maxy); 00063 void Shown(); 00064 void Hidden(); 00065 //void BlankScreen(); 00066 private: 00067 unsigned char *_offscreenbuf; 00068 unsigned char *_sharebuf; 00069 int _width, _height; 00070 unsigned int _bufsize; 00071 Renderer *_agg_renderer; 00072 00073 geometry::Range2d<int> _validbounds; 00074 std::vector< geometry::Range2d<int> > _drawbounds; 00075 int _bpp; 00076 BWindow **_win; 00077 BeV *_view; 00078 Gui *_gui; 00079 unsigned long _xid; 00080 std::string _sharefilename; 00081 int _sharefd; 00082 bool _viewhidden; 00083 }; 00084 00085 } 00086 00087 #endif 00088