Gnash  0.8.11dev
fb_glue_agg.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
3 // Foundation, Inc
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 
19 #ifndef GNASH_FB_GLUE_AGG_H
20 #define GNASH_FB_GLUE_AGG_H
21 
22 #ifdef HAVE_CONFIG_H
23 #include "gnashconfig.h"
24 #endif
25 
26 #include <cstdint>
27 
28 #include "Renderer.h"
29 #include "fbsup.h"
30 #include "fb_glue.h"
31 
32 namespace gnash {
33 
34 namespace gui {
35 
36 class FBAggGlue: public FBGlue
37 {
38 public:
39  FBAggGlue();
40 
41  // This constructor is not part of the API, as it's AGG and
42  // Framebuffer specific
43  FBAggGlue(int fd);
44 
45  // All of these virtuals are all defined in the base FBGlue class
46  ~FBAggGlue();
47 
54  bool init(int argc, char ***argv);
55 
58 
61  void prepDrawingArea(void *drawing_area);
62 
64  //
78  // does not need to be implemented (optional feature),
79  // but still needs to be available.
80  //
81  void setInvalidatedRegion(const SWFRect& bounds);
82  void setInvalidatedRegions(const InvalidatedRanges &ranges);
83 
87  int width();
88 
91  int height();
92 
94  void render();
95  void render(void* const /* region */) { };
96 
97  size_t getWidth() { return (_device) ? _device->getWidth() : 0; };
98  size_t getHeight() { return (_device) ? _device->getWidth() : 0; };
99  size_t getDepth() { return (_device) ? _device->getDepth() : 0; };
100 
101 protected:
103  int _fd;
104  struct fb_fix_screeninfo _fixinfo;
105  struct fb_var_screeninfo _varinfo;
106 
107  std::unique_ptr<Renderer> _renderer;
108 
110  std::vector< geometry::Range2d<int> > _drawbounds;
111 };
112 
113 } // end of namespace gui
114 } // end of gnash namespace
115 
116 #endif // GNASH_FB_GLUE_AGG_H
117 
118 // Local Variables:
119 // mode: C++
120 // indent-tabs-mode: nil
121 // End:
Definition: fb_glue.h:53
struct fb_var_screeninfo _varinfo
Definition: fb_glue_agg.h:105
Definition: fb_glue_agg.h:36
int width()
The Width of the drawing area, in pixels. For framebuffer based devices, this is the size of the disp...
Definition: fb_glue_agg.cpp:234
size_t getDepth()
Definition: fb_glue_agg.h:99
std::vector< geometry::Range2d< int > > _drawbounds
Definition: fb_glue_agg.h:110
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
void setInvalidatedRegion(const SWFRect &bounds)
Gives the GUI a hint which region of the stage should be redrawn.
Definition: fb_glue_agg.cpp:72
Base class for render handlers.
Definition: Renderer.h:188
struct fb_fix_screeninfo _fixinfo
Definition: fb_glue_agg.h:104
std::unique_ptr< Renderer > _renderer
Definition: fb_glue_agg.h:107
size_t getHeight()
Definition: fb_glue_agg.h:98
int _fd
This is the file descriptor for the framebuffer memory.
Definition: fb_glue_agg.h:99
int height()
Definition: fb_glue_agg.cpp:245
Renderer * createRenderHandler()
Create the renderer handler.
Definition: fb_glue_agg.cpp:147
void render(void *const)
Definition: fb_glue_agg.h:95
bool init(int argc, char ***argv)
Initialise the Framebuffer GUI and the AGG renderer.
Definition: fb_glue_agg.cpp:109
size_t getWidth()
Definition: fb_glue_agg.h:97
FBAggGlue()
Definition: fb_glue_agg.cpp:45
geometry::Range2d< int > _validbounds
Definition: fb_glue_agg.h:109
~FBAggGlue()
Definition: fb_glue_agg.cpp:61
void setInvalidatedRegions(const InvalidatedRanges &ranges)
Definition: fb_glue_agg.cpp:83
Rectangle class, see swf defined rectangle record.
Definition: SWFRect.h:44
void render()
Render the current buffer.
Definition: fb_glue_agg.cpp:217
std::unique_ptr< renderer::GnashDevice > _device
Definition: DeviceGlue.h:139
void prepDrawingArea(void *drawing_area)
Hand off a handle to the native drawing area to the renderer.
Definition: fb_glue_agg.cpp:209