Gnash  0.8.10
aos4_cairo_glue.h
Go to the documentation of this file.
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 #include "aos4_glue.h"
00020 #undef ACTION_END
00021 #include "Renderer.h"
00022 #include "Renderer_cairo.h"
00023 
00024 #include <proto/intuition.h>
00025 #include <proto/graphics.h>
00026 #include <graphics/blitattr.h>
00027 #include <proto/Picasso96API.h>
00028 #include <proto/layers.h>
00029 #include <proto/dos.h>
00030 #include <proto/gadtools.h>
00031 
00032 #include <cairo.h>
00033 
00034 #include <boost/cstdint.hpp> // for boost::?int??_t
00035 #include <vector>
00036 
00037 namespace gnash
00038 {
00039         class AOS4CairoGlue : public AOS4Glue
00040         {
00041           public:
00042         AOS4CairoGlue();
00043             virtual ~AOS4CairoGlue();
00044 
00045         bool                             init(int argc, char **argv[]);
00046             Renderer                    *createRenderHandler(int depth);
00047         Renderer                        *createRenderHandler();
00048             bool                                 prepDrawingArea(int width, int height);
00049             void                                 render();
00050         void                             render(int minx, int miny, int maxx, int maxy);
00051             void                                 setInvalidatedRegions(const InvalidatedRanges& ranges);
00052                 struct Window           *getWindow(void);
00053                 struct Menu             *getMenu(void);
00054                 void                             setFullscreen();
00055                 void                             unsetFullscreen();
00056                 void                             resize(int width, int height);
00057                 void                             saveOrigiginalDimension(int width, int height);
00058          private:
00059         geometry::Range2d<int> _validbounds;
00060             std::vector< geometry::Range2d<int> > _drawbounds;
00061                 cairo_surface_t         *_cairo_surface;
00062                 cairo_t                 *_cairo_handle;
00063         unsigned char           *_offscreenbuf;
00064             Renderer                    *_cairo_renderer;
00065         struct Window           *_window;
00066         struct Screen           *_screen;
00067                 bool                             _fullscreen;
00068                 int                              _width;
00069         int                              _orig_width;
00070             int                                  _height;
00071             int                                  _orig_height;
00072         int                                      _stride;
00073                 int                                      _btype;
00074                 cairo_format_t           _ctype;
00075                 struct Menu             *_menu;
00076                 RGBFTYPE                         _ftype;
00077         };
00078 }
00079