Gnash  0.8.11dev
fb_glue.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_H
20 #define GNASH_FB_GLUE_H
21 
22 #include <cassert>
23 
24 #include "GnashDevice.h"
25 #include "DeviceGlue.h"
26 
27 #ifdef BUILD_EGL_DEVICE
28 #include "egl/eglDevice.h"
29 #endif
30 #ifdef BUILD_RAWFB_DEVICE
31 #include "rawfb/RawFBDevice.h"
32 #endif
33 #ifdef BUILD_DIRECTFB_DEVICE
35 #endif
36 #ifdef BUILD_X11_DEVICE
37 #include "x11/X11Device.h"
38 #endif
39 
40 namespace gnash {
41  class movie_root;
42 }
43 
44 namespace gnash {
45 
46 namespace gui {
47 
48 typedef void FbWidget;
49 
53 class FBGlue : public DeviceGlue
54 {
55 public:
56  FBGlue() {};
57  virtual ~FBGlue() {};
58 
61  virtual bool init(int argc, char **argv[]) = 0;
62 
63  // Prepare the drawing area for the renderer
64  virtual void prepDrawingArea(FbWidget *drawing_area) = 0;
65  virtual Renderer* createRenderHandler() = 0;
66  virtual void setRenderHandlerSize(int /*width*/, int /*height*/) {}
67  virtual void setInvalidatedRegions(const InvalidatedRanges &/* ranges */) {};
68 
69  virtual void render() = 0;
70 
71  virtual int width() = 0;
72  virtual int height() = 0;
73 
74  virtual void render(void* const /* region */) {};
75 
76  virtual void beforeRendering(movie_root *) {};
77 
78 protected:
79  std::unique_ptr<Renderer> _renderer;
80 };
81 
82 } // end of namespace gui
83 } // end of namespace gnash
84 
85 // end of GNASH_FB_GLUE_H
86 #endif
87 
88 // Local Variables:
89 // mode: C++
90 // indent-tabs-mode: nil
91 // End:
gnash::geometry::SnappingRanges2d< std::int32_t >
Renderer_agg.h
gnash::gui::FBGlue::createRenderHandler
virtual Renderer * createRenderHandler()=0
gnash::gui::FBAggGlue::height
int height()
Definition: fb_glue_agg.cpp:245
gnash::gui::FBGui::~FBGui
virtual ~FBGui()
Definition: fb.cpp:172
optind
int optind
OpenVGRenderer.h
gnash::gui::FBGlue::prepDrawingArea
virtual void prepDrawingArea(FbWidget *drawing_area)=0
movie_root.h
gnash::gui::FBGlue::render
virtual void render()=0
fb_glue_ovg.h
gnash::renderer::openvg::Renderer_ovg::init
void init(float x, float y)
Definition: OpenVGRenderer.cpp:248
height
@ height
Definition: klash_part.cpp:329
gnash::InputDevice::scanForDevices
static DSOEXPORT std::vector< std::shared_ptr< InputDevice > > scanForDevices()
Definition: InputDevice.cpp:191
gnash::gui::FBGui::setInterval
void setInterval(unsigned int interval)
Set main loop delay in milliseconds.
Definition: fb.cpp:458
gnash::InputDevice::TOUCHSCREEN
@ TOUCHSCREEN
Definition: InputDevice.h:100
gnash::gui::FBGlue
Definition: fb_glue.h:54
gnash::VirtualClock
A class used to virtualize time flow.
Definition: VirtualClock.h:34
Renderer_gles1.h
gnash::gui::FBGui::unsetFullscreen
void unsetFullscreen()
Definition: fb.cpp:479
gnash::gui::FBGui::setInvalidatedRegions
void setInvalidatedRegions(const InvalidatedRanges &ranges)
Definition: fb.cpp:508
gnash::log_debug
void log_debug(StringType msg, Args... args)
Definition: log.h:301
gnash::InputDevice::KEYBOARD
@ KEYBOARD
Definition: InputDevice.h:96
y
std::int32_t y
Definition: BitmapData_as.cpp:435
gnash::RunResources::getRenderBackend
std::string & getRenderBackend()
Definition: RunResources.h:136
fb_glue_gles1.h
rc.h
getopt
int getopt(int, char *const *, const char *)
_
#define _(String)
Definition: log.h:44
Renderer.h
gnash::gui::FBGlue::~FBGlue
virtual ~FBGlue()
Definition: fb_glue.h:57
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::gui::FbWidget
void FbWidget
Definition: fb_glue.h:48
gnash::gui::FBGlue::setInvalidatedRegions
virtual void setInvalidatedRegions(const InvalidatedRanges &)
Definition: fb_glue.h:67
GNASH_REPORT_FUNCTION
#define GNASH_REPORT_FUNCTION
Definition: log.h:452
gnash::Renderer
Base class for render handlers.
Definition: Renderer.h:189
gnash::gui::FBGlue::setRenderHandlerSize
virtual void setRenderHandlerSize(int, int)
Definition: fb_glue.h:66
gnash::gui::FBGui::renderBuffer
void renderBuffer()
Definition: fb.cpp:425
gnash::gui::FBGlue::FBGlue
FBGlue()
Definition: fb_glue.h:56
gnash::gui::FBGui::showMouse
bool showMouse(bool show)
Sets whether the gui should show the system mouse pointer.
Definition: fb.cpp:491
gnash::gui::FBgles1Glue
Definition: fb_glue_gles1.h:64
gnash::log_error
void log_error(StringType msg, Args... args)
Definition: log.h:283
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::VirtualClock::elapsed
virtual unsigned long int elapsed() const =0
Return number of milliseconds elapsed since start.
gnash::Gui::notifyMouseClick
void notifyMouseClick(bool mouse_pressed)
Mouse notification callback to be called when the mouse is clicked.
Definition: gui.cpp:531
gnash::SWFRect
Rectangle class, see swf defined rectangle record.
Definition: SWFRect.h:45
gnash::renderer::openvg::create_handler
DSOEXPORT Renderer * create_handler(const char *)
Definition: OpenVGRenderer.cpp:1265
gnash::key::r
@ r
Definition: GnashKey.h:164
GnashSleep.h
gnash::gui::FBGui::setFullscreen
void setFullscreen()
Definition: fb.cpp:473
gnash::Gui::getFPS
float getFPS() const
Height of a window pixel, in stage pseudopixel units.
Definition: gui.h:434
gnash::gui::FBGlue::render
virtual void render(void *const)
Definition: fb_glue.h:74
gnash::gui::FBGui
Definition: fbsup.h:96
gnash::gui::FBGui::showMenu
void showMenu(bool show)
Sets whether the menus should be shown (for fscommand)
Definition: fb.cpp:485
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::InputDevice::POWERBUTTON
@ POWERBUTTON
Definition: InputDevice.h:102
gnash::geometry::Range2d::width
T width() const
Return width this Range2d.
Definition: Range2d.h:374
gnash::gui::FBAggGlue::width
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
gnash::Gui::advance_movie
static bool advance_movie(Gui *gui)
Convenience static wrapper around advanceMovie for callbacks happiness.
Definition: gui.h:272
gnash::InputDevice::MOUSE
@ MOUSE
Definition: InputDevice.h:98
gnash::gui::FBGlue::init
virtual bool init(int argc, char **argv[])=0
gnash::DeviceGlue::getHeight
size_t getHeight()
Definition: DeviceGlue.h:128
gnash::renderer::openvg::Renderer_ovg
Definition: OpenVGRenderer.h:73
GnashSystemIOHeaders.h
gnash::gui::FBGui::checkForData
void checkForData()
Definition: fb.cpp:735
eglDevice.h
GnashNumeric.h
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::RunResources
Class to group together per-run and external resources for Gnash.
Definition: RunResources.h:54
gnash::gui::FBGlue::beforeRendering
virtual void beforeRendering(movie_root *)
Definition: fb_glue.h:76
gnash::Gui::getClock
virtual VirtualClock & getClock()
Return the clock provided by this Gui.
Definition: gui.h:112
gnash::InputDevice::convertAbsCoords
static DSOEXPORT std::unique_ptr< int[]> convertAbsCoords(int x, int y, int width, int height)
Definition: InputDevice.cpp:179
InputDevice.h
gnash::gui::FBGui::createWindow
bool createWindow(const char *title, int width, int height, int xPosition=0, int yPosition=0)
Create and display our window.
Definition: fb.cpp:433
log.h
gnash::gnashSleep
void gnashSleep(time_t useconds)
Sleep compatibly for the specified number of microseconds.
Definition: GnashSleep.h:35
gnash::gui::FBGui::setTimeout
void setTimeout(unsigned int timeout)
Set the time in milliseconds after which the programme should exit.
Definition: fb.cpp:464
gnash::gui::terminate_request
int terminate_request
Definition: fb.cpp:139
X11Device.h
gnashconfig.h
gnash::gui::FBAggGlue
Definition: fb_glue_agg.h:37
gnash::movie_root
This class represents the 'Stage' and top-level movie.
Definition: movie_root.h:151
gnash::gui::FBGui::quitUI
void quitUI()
Stop main rendering loop.
Definition: fb.cpp:516
gnash::geometry::Range2d::height
T height() const
Return height this Range2dangle.
Definition: Range2d.h:385
gnash::Gui::getStage
movie_root * getStage()
The root movie, or "Stage".
Definition: gui.h:407
gnash::gui::terminate_signal
void terminate_signal(int)
Called on CTRL-C and alike.
Definition: fb.cpp:150
RunResources.h
gnash::key::c
@ c
Definition: GnashKey.h:149
gnash::gui::FBGui::resize_view
bool resize_view(int width, int height)
Definition: fb.cpp:357
gnash::renderer::gles1::create_handler
Renderer * create_handler(const char *)
Definition: Renderer_gles1.cpp:315
gnash::InputDevice::TABLET
@ TABLET
Definition: InputDevice.h:99
gnash::geometry::Range2d::setTo
Range2d< T > & setTo(T x, T y)
Set ourself to bound the given point.
Definition: Range2d.h:339
gnash::Gui::_interval
unsigned int _interval
Main loop interval: the time between successive advance_movie calls.
Definition: gui.h:503
gnash::Gui::_validbounds
geometry::Range2d< int > _validbounds
Definition: gui.h:491
gnash::gui::FBGui::setupEvents
bool setupEvents()
Definition: fb.cpp:451
gnash::gui::FBAggGlue::createRenderHandler
Renderer * createRenderHandler()
Create the renderer handler.
Definition: fb_glue_agg.cpp:147
DirectFBDevice.h
gnash::gui::FBGlue::height
virtual int height()=0
gnash::gui::FBGui::createMenu
bool createMenu()
Definition: fb.cpp:444
gui.h
GnashDevice.h
RawFBDevice.h
gnash::gui::FBOvgGlue
Definition: fb_glue_ovg.h:50
optarg
char * optarg
gnash::gui::FBGlue::_renderer
std::unique_ptr< Renderer > _renderer
Definition: fb_glue.h:76
fbsup.h
fb_glue_agg.h
width
@ width
Definition: klash_part.cpp:329
gnash::log_unimpl
void log_unimpl(StringType msg, Args... args)
Definition: log.h:289
gnash::gui::createFBGui
std::unique_ptr< Gui > createFBGui(unsigned long windowid, float scale, bool do_loop, RunResources &r)
Definition: fb.cpp:141
gnash::DeviceGlue::getWidth
size_t getWidth()
Definition: DeviceGlue.h:124
gnash::gui::FBGui::run
bool run()
Start main rendering loop.
Definition: fb.cpp:368
DeviceGlue.h
gnash::gui::FBGui::setInvalidatedRegion
void setInvalidatedRegion(const SWFRect &bounds)
Gives the GUI a hint which region of the stage should be redrawn.
Definition: fb.cpp:500
x
std::int32_t x
Definition: BitmapData_as.cpp:434
gnash::DeviceGlue
Definition: DeviceGlue.h:37
gnash::Gui::_height
int _height
Desired window height.
Definition: gui.h:497
gnash::gui::FBGui::init
virtual bool init(int argc, char ***argv)
Initialize the framebuffer.
Definition: fb.cpp:180
gnash::gui::FBGlue::width
virtual int width()=0