Gnash  0.8.11dev
fltk_glue_agg.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010,
3 // 2011 Free Software 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 FLTK_GLUE_AGG_H
20 #define FLTK_GLUE_AGG_H
21 
22 #ifdef HAVE_CONFIG_H
23 #include "gnashconfig.h"
24 #endif
25 
26 #include <fltk/Widget.h>
27 
28 #include "log.h"
29 #include "gui.h"
30 
31 #include "Renderer.h"
32 #include "Renderer_agg.h"
33 
34 using namespace fltk;
35 
36 namespace gnash {
37 
38 class FltkAggGlue : public fltk::Widget
39 {
40  public:
41  FltkAggGlue(int x, int y, int width, int height);
42  ~FltkAggGlue();
43  // resize(int width, int height);
44  void draw();
45  Renderer* createRenderHandler();
46  void initBuffer(int width, int height);
47  void resize(int width, int height);
48  void render(geometry::Range2d<int>& bounds);
49 
50 
51  private:
52  int _width;
53  int _height;
54  int _stride;
55  unsigned char* _offscreenbuf;
56  Renderer* _renderer;
57  //Rectangle _bounds;
58  geometry::Range2d<int> _drawbounds;
59  geometry::Range2d<int> _validbounds;
60 };
61 
62 } // namespace gnash
63 
64 #endif //FLTK_GLUE_AGG_H
gnash::geometry::SnappingRanges2d< std::int32_t >
Renderer_agg.h
gnash::key::KEY
@ KEY
Definition: GnashKey.h:332
gnash::gnash_cursor_type
gnash_cursor_type
Enumerates mouse cursor types.
Definition: gui.h:81
gnash::FltkGui::addMenuItems
void addMenuItems()
Definition: fltk.cpp:356
gnash::key::GNASH_MOD_CONTROL
@ GNASH_MOD_CONTROL
Definition: GnashKey.h:37
gnash::geometry::Range2d< int >
gnash::key::RIGHT_BRACKET
@ RIGHT_BRACKET
Definition: GnashKey.h:142
gnash::key::DOWN
@ DOWN
Definition: GnashKey.h:207
gnash::Gui::_renderer
std::shared_ptr< Renderer > _renderer
The handler which is called to update the client area of our window.
Definition: gui.h:506
gnash::create_Renderer_agg
DSOEXPORT Renderer_agg_base * create_Renderer_agg(const char *pixelformat)
Create a render handler.
Definition: Renderer_agg.cpp:2048
gnash::key::BACKSPACE
@ BACKSPACE
Definition: GnashKey.h:53
gnash::CURSOR_INPUT
@ CURSOR_INPUT
Definition: gui.h:84
gnash::image::begin
pixel_iterator< T > begin(GnashImage &im)
Definition: ImageIterators.h:191
height
@ height
Definition: klash_part.cpp:329
gnash::FltkGui::init
virtual bool init(int argc, char **argv[])
/ Initialise the gui and the associated renderer.
Definition: fltk.cpp:205
gnash::GnashException
Top-level gnash exception.
Definition: GnashException.h:31
gnash::FltkAggGlue::render
void render(geometry::Range2d< int > &bounds)
Definition: fltk_glue_agg.cpp:89
gnash::FltkAggGlue::~FltkAggGlue
~FltkAggGlue()
Definition: fltk_glue_agg.cpp:41
y
std::int32_t y
Definition: BitmapData_as.cpp:435
gnash::FltkGui::create
void create()
Definition: fltk.cpp:219
gnash::key::i
@ i
Definition: GnashKey.h:155
gnash::FltkCairoGlue::createRenderHandler
Renderer * createRenderHandler()
Definition: fltk_glue_cairo.cpp:65
_
#define _(String)
Definition: log.h:44
Renderer.h
gnash::key::modifier
modifier
Definition: GnashKey.h:34
gnash
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
gnash::Gui
Parent class from which all GUI implementations will depend.
Definition: gui.h:88
gnash::key::DELETEKEY
@ DELETEKEY
Definition: GnashKey.h:177
gnash::FltkGui::setInterval
virtual void setInterval(unsigned int)
Set main loop delay in milliseconds.
Definition: fltk.cpp:212
gnash::key::LEFT_BRACKET
@ LEFT_BRACKET
Definition: GnashKey.h:140
gnash::key::CAPSLOCK
@ CAPSLOCK
Definition: GnashKey.h:65
GNASH_REPORT_FUNCTION
#define GNASH_REPORT_FUNCTION
Definition: log.h:452
gnash::Renderer
Base class for render handlers.
Definition: Renderer.h:189
gnash::key::GNASH_MOD_NONE
@ GNASH_MOD_NONE
Definition: GnashKey.h:35
gnash::FltkCairoGlue
Definition: fltk_glue_cairo.h:52
gnash::Renderer_agg_base::init_buffer
virtual void init_buffer(unsigned char *mem, int size, int x, int y, int rowstride)=0
gnash::FltkGui::createWindow
virtual bool createWindow(const char *title, int width, int height, int xPosition=0, int yPosition=0)
Create and display our window.
Definition: fltk.cpp:232
gnash::geometry::Range2d::getMinX
T getMinX() const
Get min X ordinate.
Definition: Range2d.h:603
gnash::geometry::Range2d::isNull
bool isNull() const
Returns true if this is the NULL Range2d.
Definition: Range2d.h:181
gnash::FltkAggGlue
Definition: fltk_glue_agg.h:39
gnash::key::PGUP
@ PGUP
Definition: GnashKey.h:213
gnash::Gui::_runResources
RunResources & _runResources
Per-run resources.
Definition: gui.h:500
gnash::RunResources::setRenderer
void setRenderer(std::shared_ptr< Renderer > r)
Definition: RunResources.h:108
gnash::key::LEFT
@ LEFT
Definition: GnashKey.h:209
gnash::FltkAggGlue::createRenderHandler
Renderer * createRenderHandler()
Definition: fltk_glue_agg.cpp:46
gnash::key::RIGHT
@ RIGHT
Definition: GnashKey.h:208
gnash::Gui::notifyMouseClick
void notifyMouseClick(bool mouse_pressed)
Mouse notification callback to be called when the mouse is clicked.
Definition: gui.cpp:531
gnash::geometry::Intersection
Range2d< T > Intersection(const Range2d< T > &r1, const Range2d< T > &r2)
Return a rectangle being the intersetion of the two rectangles.
Definition: Range2d.h:762
gnash::geometry::Range2d::isFinite
bool isFinite() const
Returns true if this is a finite Range2d.
Definition: Range2d.h:210
gnash::key::r
@ r
Definition: GnashKey.h:164
gnash::key::GNASH_MOD_SHIFT
@ GNASH_MOD_SHIFT
Definition: GnashKey.h:36
gnash::key::INSERT
@ INSERT
Definition: GnashKey.h:210
gnash::key::ALT
@ ALT
Definition: GnashKey.h:63
gnash::key::PGDN
@ PGDN
Definition: GnashKey.h:214
gnash::key::END
@ END
Definition: GnashKey.h:212
gnash::key::code
code
Definition: GnashKey.h:44
gnash::geometry::Range2d::getMinY
T getMinY() const
Get min Y ordinate.
Definition: Range2d.h:623
gnash::FltkGui::FltkGui
FltkGui(unsigned long xid, float scale, bool loop, RunResources &r)
Definition: fltk.cpp:54
gnash::key::ENTER
@ ENTER
Definition: GnashKey.h:58
gnash::key::h
@ h
Definition: GnashKey.h:154
gnash::Gui::notifyMouseMove
void notifyMouseMove(int x, int y)
Mouse notification callback to be called when the mouse is moved.
Definition: gui.cpp:469
gnash::Gui::_width
int _width
Desired window width.
Definition: gui.h:494
gnash::geometry::Range2d::width
T width() const
Return width this Range2d.
Definition: Range2d.h:374
gnash::key::TAB
@ TAB
Definition: GnashKey.h:54
gnash::FltkCairoGlue::initBuffer
void initBuffer(int width, int height)
Definition: fltk_glue_cairo.cpp:72
gnash::Gui::advance_movie
static bool advance_movie(Gui *gui)
Convenience static wrapper around advanceMovie for callbacks happiness.
Definition: gui.h:272
gnash::key::CLEAR
@ CLEAR
Definition: GnashKey.h:57
gnash::key::INVALID
@ INVALID
Definition: GnashKey.h:45
gnash::key::SHIFT
@ SHIFT
Definition: GnashKey.h:61
test.w
w
Definition: test.py:8
gnash::key::UP
@ UP
Definition: GnashKey.h:206
gnash::key::HOME
@ HOME
Definition: GnashKey.h:211
gnash::Gui::resize_view
void resize_view(int width, int height)
Resize the client area view and the window accordingly.
Definition: gui.cpp:429
gnash::FltkGui::setInvalidatedRegions
void setInvalidatedRegions(const InvalidatedRanges &ranges)
Definition: fltk.cpp:447
gnash::RunResources
Class to group together per-run and external resources for Gnash.
Definition: RunResources.h:54
gnash::FltkGui::run
virtual bool run()
Start main rendering loop.
Definition: fltk.cpp:197
fltk_glue_agg.h
gnash::geometry::SnappingRanges2d::size
size_type size() const
Returns the number of ranges in the list.
Definition: snappingrange.h:320
VM.h
CHUNK_SIZE
#define CHUNK_SIZE
gnash::CURSOR_HAND
@ CURSOR_HAND
Definition: gui.h:82
log.h
gnash::FltkGui::~FltkGui
virtual ~FltkGui()
Definition: fltk.cpp:61
gnash::FltkAggGlue::draw
void draw()
Definition: fltk_glue_agg.cpp:96
gnash::key::ESCAPE
@ ESCAPE
Definition: GnashKey.h:72
gnash::Renderer_agg_base
Definition: Renderer_agg.h:30
gnashconfig.h
gnash::image::end
pixel_iterator< T > end(GnashImage &im)
Definition: ImageIterators.h:198
gnash::geometry::Range2d::height
T height() const
Return height this Range2dangle.
Definition: Range2d.h:385
gnash::FltkAggGlue::resize
void resize(int width, int height)
Definition: fltk_glue_agg.cpp:108
RunResources.h
gnash::Gui::_xid
unsigned long _xid
The X Window ID to attach to. If zero, we create a new window.
Definition: gui.h:486
gnash::key::MINUS
@ MINUS
Definition: GnashKey.h:90
gnash::key::EQUALS
@ EQUALS
Definition: GnashKey.h:108
gnash::FltkGui::createMenu
virtual bool createMenu()
Definition: fltk.cpp:396
gnash::key::BACKSLASH
@ BACKSLASH
Definition: GnashKey.h:141
gnash::FltkAggGlue::initBuffer
void initBuffer(int width, int height)
Definition: fltk_glue_agg.cpp:55
gnash::geometry::Range2d::setTo
Range2d< T > & setTo(T x, T y)
Set ourself to bound the given point.
Definition: Range2d.h:339
gnash::Gui::_validbounds
geometry::Range2d< int > _validbounds
Definition: gui.h:491
gnash::FltkGui::setCursor
virtual void setCursor(gnash_cursor_type newcursor)
Sets the current mouse cursor for the Gui window.
Definition: fltk.cpp:428
gui.h
gnash::FltkGui::handle
int handle(int event)
Definition: fltk.cpp:99
gnash::key::GNASH_MOD_ALT
@ GNASH_MOD_ALT
Definition: GnashKey.h:38
gnash::key::SLASH
@ SLASH
Definition: GnashKey.h:92
gnash::key::SPACE
@ SPACE
Definition: GnashKey.h:77
gnash::Gui::notify_key_event
void notify_key_event(gnash::key::code k, int modifier, bool pressed)
Key event notification to be called when a key is pressed or depressed.
Definition: gui.cpp:560
gnash::geometry::SnappingRanges2d::getRange
const RangeType & getRange(size_type index) const
Returns the range at the specified index.
Definition: snappingrange.h:326
width
@ width
Definition: klash_part.cpp:329
gnash::key::HELP
@ HELP
Definition: GnashKey.h:325
gnash::key::SEMICOLON
@ SEMICOLON
Definition: GnashKey.h:106
GnashException.h
x
std::int32_t x
Definition: BitmapData_as.cpp:434
gnash::FltkGui::renderBuffer
virtual void renderBuffer()
Definition: fltk.cpp:68
gnash::Gui::_height
int _height
Desired window height.
Definition: gui.h:497
gnash::FltkGui::layout
void layout()
Definition: fltk.cpp:411
fltksup.h
gnash::key::NUM_LOCK
@ NUM_LOCK
Definition: GnashKey.h:223