Gnash  0.8.11dev
Public Member Functions | List of all members
gnash::gui::FBGui Class Reference

#include <fbsup.h>

Inheritance diagram for gnash::gui::FBGui:
gnash::Gui

Public Member Functions

 FBGui (unsigned long xid, float scale, bool loop, RunResources &r)
 
virtual ~FBGui ()
 
virtual bool init (int argc, char ***argv)
 Initialize the framebuffer. More...
 
bool createWindow (const char *title, int width, int height, int xPosition=0, int yPosition=0)
 Create and display our window. More...
 
void renderBuffer ()
 
bool run ()
 Start main rendering loop. More...
 
void quitUI ()
 Stop main rendering loop. More...
 
bool resize_view (int width, int height)
 
void setInvalidatedRegion (const SWFRect &bounds)
 Gives the GUI a hint which region of the stage should be redrawn. More...
 
void setInvalidatedRegions (const InvalidatedRanges &ranges)
 
bool want_multiple_regions ()
 
double getPixelAspectRatio () const
 
int getScreenResX ()
 
int getScreenResY ()
 
double getScreenDPI () const
 
std::string getScreenColor () const
 Get the screen color type. More...
 
void setFullscreen ()
 
void unsetFullscreen ()
 
bool createMenu ()
 
bool setupEvents ()
 
void setInterval (unsigned int interval)
 Set main loop delay in milliseconds. More...
 
void setTimeout (unsigned int timeout)
 Set the time in milliseconds after which the programme should exit. More...
 
void showMenu (bool show)
 Sets whether the menus should be shown (for fscommand) More...
 
bool showMouse (bool show)
 Sets whether the gui should show the system mouse pointer. More...
 
void checkForData ()
 
- Public Member Functions inherited from gnash::Gui
virtual ~Gui ()
 
virtual bool init (int argc, char **argv[])=0
 / Initialise the gui and the associated renderer. More...
 
virtual VirtualClockgetClock ()
 Return the clock provided by this Gui. More...
 
void setScreenShotter (std::unique_ptr< ScreenShotter > ss)
 
virtual void resizeWindow (int width, int height)
 
void quit ()
 Always called on exit. More...
 
virtual void beforeRendering ()
 
virtual bool want_redraw ()
 Asks the GUI handler if the next frame should be redrawn completely. More...
 
virtual void setCursor (gnash_cursor_type newcursor)
 Sets the current mouse cursor for the Gui window. More...
 
virtual void setClipboard (const std::string &copy)
 
virtual std::pair< int, int > screenResolution () const
 
bool loops () const
 
bool isFullscreen () const
 
void notifyMouseMove (int x, int y)
 Mouse notification callback to be called when the mouse is moved. More...
 
void notifyMouseClick (bool mouse_pressed)
 Mouse notification callback to be called when the mouse is clicked. More...
 
void notifyMouseWheel (int delta)
 Send a mouse wheel event to the stage. More...
 
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. More...
 
void resize_view (int width, int height)
 Resize the client area view and the window accordingly. More...
 
void updateStageMatrix ()
 
bool advanceMovie (bool doDisplay=true)
 Give movie an heart-beat. More...
 
void refreshView ()
 
virtual void hideMenu ()
 
virtual void allowScale (bool allow)
 Sets whether scaling should be allowed (for fscommand) More...
 
void toggleFullscreen ()
 
void stop ()
 Put the application in "stop" mode. More...
 
void play ()
 Put the application in "play" mode. More...
 
void pause ()
 Toggle between "stop" and "play" mode. More...
 
void start ()
 Start the movie. More...
 
bool isStopped () const
 See stop(), play() and pause() More...
 
bool isPlugin () const
 Whether gnash is is running as a plugin. More...
 
void takeScreenShot ()
 Take a screenshot now! More...
 
void setMaxAdvances (unsigned long ul)
 Set the maximum number of frame advances before Gnash exits. More...
 
void showUpdatedRegions (bool x)
 
bool showUpdatedRegions () const
 
void restart ()
 
void setQuality (Quality q)
 Set rendering quality, if not locked by RC file.. More...
 
Quality getQuality () const
 Get current rendering quality. More...
 
void toggleSound ()
 
void addFlashVars (VariableMap &vars)
 Add variables to set into instances of the top-level movie definition. More...
 
void setMovieDefinition (movie_definition *md)
 Set the definition of top-level movie. More...
 
void setStage (movie_root *stage)
 Set the stage to advance/display. More...
 
void setAudioDump (const std::string &fname)
 Set the name of a file to dump audio to. More...
 
movie_rootgetStage ()
 The root movie, or "Stage". More...
 
virtual void error (const std::string &)
 Handle error message from the core. More...
 
virtual bool yesno (const std::string &question)
 Prompt user with a question she can answer with yes/no. More...
 
float getXScale () const
 Width of a window pixel, in stage pseudopixel units. More...
 
float getYScale () const
 Height of a window pixel, in stage pseudopixel units. More...
 
float getFPS () const
 Height of a window pixel, in stage pseudopixel units. More...
 

Additional Inherited Members

- Public Types inherited from gnash::Gui
typedef std::map< std::string, std::string > VariableMap
 
- Static Public Member Functions inherited from gnash::Gui
static bool advance_movie (Gui *gui)
 Convenience static wrapper around advanceMovie for callbacks happiness. More...
 
- Protected Member Functions inherited from gnash::Gui
 Gui (RunResources &r)
 Default constructor. Initialises members to safe defaults. More...
 
 Gui (unsigned long xid, float scale, bool loop, RunResources &r)
 Expanded constructor for more control over member values. More...
 
virtual bool watchFD (int)
 Watch a file descriptor. More...
 
virtual void stopHook ()
 
virtual void playHook ()
 Called by Gui::play(). More...
 
virtual bool visible ()
 Determines whether the Gui is visible (not obscured). More...
 
- Protected Attributes inherited from gnash::Gui
bool _loop
 Determines if playback should restart after the movie ends. More...
 
unsigned long _xid
 The X Window ID to attach to. If zero, we create a new window. More...
 
geometry::Range2d< int > _validbounds
 
int _width
 Desired window width. More...
 
int _height
 Desired window height. More...
 
RunResources_runResources
 Per-run resources. More...
 
unsigned int _interval
 Main loop interval: the time between successive advance_movie calls. More...
 
std::shared_ptr< Renderer_renderer
 The handler which is called to update the client area of our window. More...
 
bool _redraw_flag
 
bool _fullscreen
 
bool _mouseShown
 
unsigned long _maxAdvances
 
unsigned long _advances
 Counter to keep track of frame advances. More...
 
std::string _audioDump
 Name of a file to dump audio to. More...
 

Detailed Description

A Framebuffer-based GUI for Gnash.

This is a simple "GUI" that works with any framebuffer device (/dev/fb0). No window system is required, it will run straigt from a console.

The current version requires that your system boots in graphics mode (that is, with a framebuffer driver - like vesafb - and most probably the virtual console enabled). Which graphics mode Gnash runs in depends on the mode your machine boots in and can be choosen using the kernel command line. With other words: Gnash does not change the graphics mode. Refer to the framebuffer docs for more information.

The fb gui now also supports pointing devices like mice or touchscreens, but it is not required. It works with /dev/input/mice so any PS/2 compatible mouse should do. Your kernel can emulate the "mice" device for other devices (like touchscreens and tablets) so this method is very flexible.

There is currently no visible mouse pointer built in, which is fine for touchscreens but will make it difficult for standard mice. This will be fixed in near time. Resolution: any

Pixel formats: 8 bit: none yet 15 bit: R5/G5/B5 16 bit: R5/G6/B5 24 bit: R8/G8/B8, B8/G8/R8 32 bit: R8/G8/B8/A8, B8/G8/R8/A8

Supported input devices:

any PS/2 compatible mouse (may be emulated by the kernel) talking to /dev/input/mice

Constructor & Destructor Documentation

§ FBGui()

gnash::gui::FBGui::FBGui ( unsigned long  xid,
float  scale,
bool  loop,
RunResources r 
)

§ ~FBGui()

gnash::gui::FBGui::~FBGui ( )
virtual

Member Function Documentation

§ checkForData()

void gnash::gui::FBGui::checkForData ( )

§ createMenu()

bool gnash::gui::FBGui::createMenu ( )

Referenced by getScreenColor().

§ createWindow()

bool gnash::gui::FBGui::createWindow ( const char *  title,
int  width,
int  height,
int  xPosition = 0,
int  yPosition = 0 
)
virtual

Create and display our window.

Parameters
titleThe window title.
widthThe desired window width in pixels.
heightThe desired window height in pixels.
xPositionThe desired window X position from the top left corner.
yPositionThe desired window Y position from the top left corner.

Implements gnash::Gui.

References gnash::Gui::_runResources, and gnash::RunResources::setRenderer().

§ getPixelAspectRatio()

double gnash::gui::FBGui::getPixelAspectRatio ( ) const
inlinevirtual

Reimplemented from gnash::Gui.

§ getScreenColor()

std::string gnash::gui::FBGui::getScreenColor ( ) const
inlinevirtual

Get the screen color type.

The choice is between "color" and something designating monochrome (not sure what). If this isn't implemented in the gui we return "color".

Reimplemented from gnash::Gui.

References checkForData(), createMenu(), setFullscreen(), setInterval(), setTimeout(), setupEvents(), showMenu(), showMouse(), and unsetFullscreen().

§ getScreenDPI()

double gnash::gui::FBGui::getScreenDPI ( ) const
inlinevirtual

Reimplemented from gnash::Gui.

§ getScreenResX()

int gnash::gui::FBGui::getScreenResX ( )
inline

§ getScreenResY()

int gnash::gui::FBGui::getScreenResY ( )
inline

§ init()

bool gnash::gui::FBGui::init ( int  argc,
char ***  argv 
)
virtual

§ quitUI()

void gnash::gui::FBGui::quitUI ( )
virtual

Stop main rendering loop.

Reimplemented from gnash::Gui.

References _, gnash::log_debug(), and gnash::log_error().

§ renderBuffer()

void gnash::gui::FBGui::renderBuffer ( )
virtual

Render the current buffer. For OpenGL, this means that the front and back buffers are swapped.

Implements gnash::Gui.

§ resize_view()

bool gnash::gui::FBGui::resize_view ( int  width,
int  height 
)

§ run()

bool gnash::gui::FBGui::run ( )
virtual

Start main rendering loop.

Implements gnash::Gui.

References gnash::Gui::getClock().

§ setFullscreen()

void gnash::gui::FBGui::setFullscreen ( )
virtual

Attempt to run in a fullscreen window both for plugin and standalone player. Use isFullscreen() to see if gnash thinks it's running in fullscreen or not. The switch to fullscreen may fail if, for instance, the window manager refuses to allow it, but the flag will be set anyway.

Reimplemented from gnash::Gui.

Referenced by getScreenColor().

§ setInterval()

void gnash::gui::FBGui::setInterval ( unsigned int  interval)
virtual

Set main loop delay in milliseconds.

Reimplemented from gnash::Gui.

References gnash::Gui::_interval.

Referenced by getScreenColor().

§ setInvalidatedRegion()

void gnash::gui::FBGui::setInvalidatedRegion ( const SWFRect bounds)
virtual

Gives the GUI a hint which region of the stage should be redrawn.

There is no restriction what the GUI might do with these coordinates. Normally the GUI forwards the information to the renderer so that it avoids rendering regions that did not change anyway. The GUI can also alter the bounds before passing them to the renderer and it's absolutely legal for the GUI to simply ignore the call.

Coordinates are in TWIPS!

Note this information is given to the GUI and not directly to the renderer because both of them need to support this feature for correct results. It is up to the GUI to forward this information to the renderer.

Reimplemented from gnash::Gui.

§ setInvalidatedRegions()

void gnash::gui::FBGui::setInvalidatedRegions ( const InvalidatedRanges ranges)
virtual

Reimplemented from gnash::Gui.

§ setTimeout()

void gnash::gui::FBGui::setTimeout ( unsigned int  timeout)
virtual

Set the time in milliseconds after which the programme should exit.

Implements gnash::Gui.

Referenced by getScreenColor().

§ setupEvents()

bool gnash::gui::FBGui::setupEvents ( )

Referenced by getScreenColor().

§ showMenu()

void gnash::gui::FBGui::showMenu ( bool  show)
virtual

Sets whether the menus should be shown (for fscommand)

Parameters
showtrue if the menu bar should be shown.

Reimplemented from gnash::Gui.

References _, and gnash::log_unimpl().

Referenced by getScreenColor().

§ showMouse()

bool gnash::gui::FBGui::showMouse ( bool  show)
virtual

Sets whether the gui should show the system mouse pointer.

Parameters
showtrue if the mouse should be shown.
Returns
true if the state changed.

Reimplemented from gnash::Gui.

References _, and gnash::log_unimpl().

Referenced by getScreenColor().

§ unsetFullscreen()

void gnash::gui::FBGui::unsetFullscreen ( )
virtual

Return from fullscreen to normal mode.

Reimplemented from gnash::Gui.

Referenced by getScreenColor().

§ want_multiple_regions()

bool gnash::gui::FBGui::want_multiple_regions ( )
inlinevirtual

Should return TRUE when the GUI/Renderer combination supports multiple invalidated bounds regions.

Reimplemented from gnash::Gui.


The documentation for this class was generated from the following files: