Gnash  0.8.10
sdl_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 "sdl_glue.h"
00020 #include <cairo.h>
00021 #include <SDL.h>
00022 
00023 
00024 // Forward declarations
00025 namespace gnash {
00026     class Renderer;
00027 }
00028 
00029 namespace gnash
00030 {
00031 
00032 class SdlCairoGlue : public SdlGlue
00033 {
00034   public:
00035     SdlCairoGlue();
00036     virtual ~SdlCairoGlue();
00037 
00038     bool init(int argc, char **argv[]);
00039     Renderer* createRenderHandler( int depth);
00040     void setInvalidatedRegions(const InvalidatedRanges& ranges);
00041     bool prepDrawingArea(int width, int height, boost::uint32_t sdl_flags);
00042     boost::uint32_t maskFlags(boost::uint32_t sdl_flags);
00043     void render();
00044   private:
00045     cairo_surface_t *_cairo_surface;
00046     cairo_t         *_cairo_handle;
00047     SDL_Surface     *_sdl_surface;
00048     unsigned char   *_render_image;
00049     SDL_Surface     *_screen;
00050     Renderer  *_renderer;
00051 };
00052 
00053 }