~ubuntu-branches/ubuntu/maverick/gnash/maverick

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//
//   Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

#include "aos4_glue.h"
#include "gnash.h"
#undef ACTION_END
#include "Renderer.h"
#include "Renderer_cairo.h"

#include <proto/intuition.h>
#include <proto/graphics.h>
#include <graphics/blitattr.h>
#include <proto/Picasso96API.h>
#include <proto/layers.h>
#include <proto/dos.h>
#include <proto/gadtools.h>

#include <cairo.h>

#include <boost/cstdint.hpp> // for boost::?int??_t
#include <vector>

namespace gnash
{
	class AOS4CairoGlue : public AOS4Glue
	{
	  public:
    	AOS4CairoGlue();
	    virtual ~AOS4CairoGlue();

    	bool 			 	 init(int argc, char **argv[]);
	    Renderer			*createRenderHandler(int depth);
    	Renderer			*createRenderHandler();
	    bool 			 	 prepDrawingArea(int width, int height);
	    void 			 	 render();
    	void 			 	 render(int minx, int miny, int maxx, int maxy);
	    void 			 	 setInvalidatedRegions(const InvalidatedRanges& ranges);
		struct Window 		*getWindow(void);
		struct Menu 		*getMenu(void);
		void			 	 setFullscreen();
		void			 	 unsetFullscreen();
		void 			 	 resize(int width, int height);
		void 			 	 saveOrigiginalDimension(int width, int height);
	 private:
    	geometry::Range2d<int> _validbounds;
	    std::vector< geometry::Range2d<int> > _drawbounds;
		cairo_surface_t 	*_cairo_surface;
		cairo_t         	*_cairo_handle;
    	unsigned char   	*_offscreenbuf;
	    Renderer  			*_cairo_renderer;
    	struct Window   	*_window;
    	struct Screen		*_screen;
		bool 				 _fullscreen;
		int 			 	 _width;
    	int 			 	 _orig_width;
	    int				 	 _height;
	    int				 	 _orig_height;
    	int				 	 _stride;
		int				 	 _btype;
		cairo_format_t	 	 _ctype;
		struct Menu 		*_menu;
		RGBFTYPE		 	 _ftype;
	};
}