Gnash
0.8.10
|
Parent class from which all GUI implementations will depend. More...
#include <gui.h>
Public Types | |
typedef std::map< std::string, std::string > | VariableMap |
Public Member Functions | |
virtual | ~Gui () |
virtual bool | init (int argc, char **argv[])=0 |
/ Initialise the gui and the associated renderer. | |
virtual void | setInterval (unsigned int interval) |
Set main loop delay in milliseconds. | |
virtual VirtualClock & | getClock () |
Return the clock provided by this Gui. | |
virtual void | setTimeout (unsigned int timeout)=0 |
Set the time in milliseconds after which the programme should exit. | |
void | setScreenShotter (std::auto_ptr< ScreenShotter > ss) |
virtual bool | createWindow (const char *title, int width, int height, int xPosition=0, int yPosition=0)=0 |
Create and display our window. | |
virtual void | resizeWindow (int width, int height) |
virtual bool | run ()=0 |
Start main rendering loop. | |
void | quit () |
Always called on exit. | |
virtual void | renderBuffer ()=0 |
virtual void | setInvalidatedRegion (const SWFRect &bounds) |
Gives the GUI a *hint* which region of the stage should be redrawn. | |
virtual void | setInvalidatedRegions (const InvalidatedRanges &ranges) |
virtual void | beforeRendering () |
virtual bool | want_multiple_regions () |
virtual bool | want_redraw () |
Asks the GUI handler if the next frame should be redrawn completely. | |
virtual void | setCursor (gnash_cursor_type newcursor) |
Sets the current mouse cursor for the Gui window. | |
virtual void | setClipboard (const std::string ©) |
virtual double | getPixelAspectRatio () const |
virtual std::pair< int, int > | screenResolution () const |
virtual double | getScreenDPI () const |
virtual std::string | getScreenColor () const |
Get the screen color type. | |
bool | loops () const |
bool | isFullscreen () const |
void | notifyMouseMove (int x, int y) |
Mouse notification callback to be called when the mouse is moved. | |
void | notifyMouseClick (bool mouse_pressed) |
Mouse notification callback to be called when the mouse is clicked. | |
void | notifyMouseWheel (int delta) |
Send a mouse wheel event to the stage. | |
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. | |
void | resize_view (int width, int height) |
Resize the client area view and the window accordingly. | |
void | updateStageMatrix () |
bool | advanceMovie (bool doDisplay=true) |
Give movie an heart-beat. | |
void | refreshView () |
virtual void | setFullscreen () |
virtual void | unsetFullscreen () |
virtual void | hideMenu () |
virtual bool | showMouse (bool show) |
Sets whether the gui should show the system mouse pointer. | |
virtual void | showMenu (bool show) |
Sets whether the menus should be shown (for fscommand) | |
virtual void | allowScale (bool allow) |
Sets whether scaling should be allowed (for fscommand) | |
void | toggleFullscreen () |
void | stop () |
Put the application in "stop" mode. | |
void | play () |
Put the application in "play" mode. | |
void | pause () |
Toggle between "stop" and "play" mode. | |
void | start () |
Start the movie. | |
bool | isStopped () const |
See stop(), play() and pause() | |
bool | isPlugin () const |
Whether gnash is is running as a plugin. | |
void | takeScreenShot () |
Take a screenshot now! | |
void | setMaxAdvances (unsigned long ul) |
Set the maximum number of frame advances before Gnash exits. | |
void | showUpdatedRegions (bool x) |
bool | showUpdatedRegions () const |
void | restart () |
void | setQuality (Quality q) |
Set rendering quality, if not locked by RC file.. | |
Quality | getQuality () const |
Get current rendering quality. | |
void | toggleSound () |
void | addFlashVars (VariableMap &vars) |
Add variables to set into instances of the top-level movie definition. | |
void | setMovieDefinition (movie_definition *md) |
Set the definition of top-level movie. | |
void | setStage (movie_root *stage) |
Set the stage to advance/display. | |
void | setAudioDump (const std::string &fname) |
Set the name of a file to dump audio to. | |
movie_root * | getStage () |
The root movie, or "Stage". | |
virtual void | error (const std::string &) |
Handle error message from the core. | |
virtual bool | yesno (const std::string &question) |
Prompt user with a question she can answer with yes/no. | |
float | getXScale () const |
Width of a window pixel, in stage pseudopixel units. | |
float | getYScale () const |
Height of a window pixel, in stage pseudopixel units. | |
float | getFPS () const |
Height of a window pixel, in stage pseudopixel units. | |
Static Public Member Functions | |
static bool | advance_movie (Gui *gui) |
Convenience static wrapper around advanceMovie for callbacks happiness. | |
Protected Member Functions | |
Gui (RunResources &r) | |
Default constructor. Initialises members to safe defaults. | |
Gui (unsigned long xid, float scale, bool loop, RunResources &r) | |
Expanded constructor for more control over member values. | |
virtual void | quitUI () |
End main rendering loop calling GUI-specific exit functions. | |
virtual bool | watchFD (int) |
Watch a file descriptor. | |
virtual void | stopHook () |
virtual void | playHook () |
Called by Gui::play(). | |
virtual bool | visible () |
Determines whether the Gui is visible (not obscured). | |
Protected Attributes | |
bool | _loop |
Determines if playback should restart after the movie ends. | |
unsigned long | _xid |
The X Window ID to attach to. If zero, we create a new window. | |
geometry::Range2d< int > | _validbounds |
int | _width |
Desired window width. | |
int | _height |
Desired window height. | |
RunResources & | _runResources |
Per-run resources. | |
unsigned int | _interval |
Main loop interval: the time between successive advance_movie calls. | |
boost::shared_ptr< Renderer > | _renderer |
The handler which is called to update the client area of our window. | |
bool | _redraw_flag |
bool | _fullscreen |
bool | _mouseShown |
unsigned long | _maxAdvances |
unsigned long | _advances |
Counter to keep track of frame advances. | |
std::string | _audioDump |
Name of a file to dump audio to. |
Parent class from which all GUI implementations will depend.
typedef std::map<std::string, std::string> gnash::Gui::VariableMap |
gnash::Gui::~Gui | ( | ) | [virtual] |
gnash::Gui::Gui | ( | RunResources & | r | ) | [protected] |
Default constructor. Initialises members to safe defaults.
gnash::Gui::Gui | ( | unsigned long | xid, |
float | scale, | ||
bool | loop, | ||
RunResources & | r | ||
) | [protected] |
Expanded constructor for more control over member values.
xid | The X11 Window ID to attach to. If this is argument is zero, a new window is created. |
scale | The scale used to resize the window size, which has been established by extracting information from the SWF file. |
loop | Defines whether or not the movie should be played once or looped indefinitely. |
depth | Colour depth to be used in the client area of our window. |
void gnash::Gui::addFlashVars | ( | Gui::VariableMap & | from | ) |
Add variables to set into instances of the top-level movie definition.
References gnash::key::i.
static bool gnash::Gui::advance_movie | ( | Gui * | gui | ) | [inline, static] |
Convenience static wrapper around advanceMovie for callbacks happiness.
NOTE: this function always return TRUE, for historical reasons. TODO: bring code up-to-date to drop this legacy return code..
Referenced by gnash::AOS4Gui::run(), gnash::gui::FBGui::run(), gnash::FltkGui::handle(), gnash::GtkGui::run(), gnash::HaikuGui::GnashPulse(), gnash::qwidget::timerEvent(), and gnash::DrawingWidget::timerEvent().
bool gnash::Gui::advanceMovie | ( | bool | doDisplay = true | ) |
Give movie an heart-beat.
This is to take place after the interval specified in the call to setInterval().
Wheter or not this beat advanced the movie to the next frame depends on elapsed time since last advancement.
Quit if we've reached the frame advance limit.
References isStopped(), start(), gnash::movie_root::advance(), gnash::movie_root::getRootMovie(), gnash::MovieClip::get_current_frame(), gnash::MovieClip::get_frame_count(), gnash::Movie::ensureFrameLoaded(), gnash::MovieClip::setPlayState(), gnash::MovieClip::PLAYSTATE_PLAY, visible(), loops(), quit(), _renderer, _advances, and _maxAdvances.
Referenced by gnash::DumpGui::run(), gnash::NullGui::run(), and gnash::SDLGui::run().
void gnash::Gui::allowScale | ( | bool | allow | ) | [virtual] |
Sets whether scaling should be allowed (for fscommand)
allow | true if stage scaling should be allowed |
References gnash::movie_root::setStageScaleMode(), gnash::movie_root::SCALEMODE_SHOWALL, and gnash::movie_root::SCALEMODE_NOSCALE.
virtual void gnash::Gui::beforeRendering | ( | ) | [inline, virtual] |
Reimplemented in gnash::GtkGui, and gnash::DumpGui.
virtual bool gnash::Gui::createWindow | ( | const char * | title, |
int | width, | ||
int | height, | ||
int | xPosition = 0 , |
||
int | yPosition = 0 |
||
) | [pure virtual] |
Create and display our window.
title | The window title. |
width | The desired window width in pixels. |
height | The desired window height in pixels. |
xPosition | The desired window X position from the top left corner. |
yPosition | The desired window Y position from the top left corner. |
Implemented in gnash::gui::FBGui, gnash::KdeGui, gnash::Qt4Gui, gnash::AOS4Gui, gnash::AquaGui, gnash::HaikuGui, gnash::NullGui, gnash::SDLGui, gnash::FltkGui, gnash::DumpGui, and gnash::GtkGui.
virtual void gnash::Gui::error | ( | const std::string & | ) | [inline, virtual] |
Handle error message from the core.
msg | The error message recieved |
Reimplemented in gnash::GtkGui, and gnash::HaikuGui.
virtual VirtualClock& gnash::Gui::getClock | ( | ) | [inline, virtual] |
Return the clock provided by this Gui.
The Gui clock will be paused when the gui is put in pause mode and resumed when gui playback is resumed.
Reimplemented in gnash::DumpGui.
Referenced by gnash::gui::FBGui::run().
float gnash::Gui::getFPS | ( | ) | const [inline] |
Height of a window pixel, in stage pseudopixel units.
Referenced by gnash::gui::FBGui::run().
virtual double gnash::Gui::getPixelAspectRatio | ( | ) | const [inline, virtual] |
Reimplemented in gnash::GtkGui.
Quality gnash::Gui::getQuality | ( | ) | const |
Get current rendering quality.
References _, gnash::QUALITY_HIGH, and gnash::movie_root::getQuality().
virtual std::string gnash::Gui::getScreenColor | ( | ) | const [inline, virtual] |
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".
virtual double gnash::Gui::getScreenDPI | ( | ) | const [inline, virtual] |
Reimplemented in gnash::Qt4Gui, and gnash::GtkGui.
movie_root* gnash::Gui::getStage | ( | ) | [inline] |
The root movie, or "Stage".
Referenced by gnash::DumpGui::run(), gnash::gui::FBGui::checkForData(), and gnash::GtkGui::beforeRendering().
float gnash::Gui::getXScale | ( | ) | const [inline] |
Width of a window pixel, in stage pseudopixel units.
float gnash::Gui::getYScale | ( | ) | const [inline] |
Height of a window pixel, in stage pseudopixel units.
void gnash::Gui::hideMenu | ( | ) | [virtual] |
Hide the menu bar when using standalone player
Reimplemented in gnash::GtkGui.
virtual bool gnash::Gui::init | ( | int | argc, |
char ** | argv[] | ||
) | [pure virtual] |
/ Initialise the gui and the associated renderer.
argc | The commandline argument count. |
argv | The commandline arguments. |
Implemented in gnash::KdeGui, gnash::Qt4Gui, gnash::AOS4Gui, gnash::AquaGui, gnash::HaikuGui, gnash::SDLGui, gnash::DumpGui, gnash::FltkGui, and gnash::GtkGui.
bool gnash::Gui::isFullscreen | ( | ) | const [inline] |
References _fullscreen.
Referenced by notify_key_event(), and stop().
bool gnash::Gui::isPlugin | ( | ) | const [inline] |
Whether gnash is is running as a plugin.
References _xid.
bool gnash::Gui::isStopped | ( | ) | const [inline] |
See stop(), play() and pause()
Referenced by gnash::GtkGui::setInterval(), and advanceMovie().
bool gnash::Gui::loops | ( | ) | const [inline] |
References _loop.
Referenced by advanceMovie().
void gnash::Gui::notify_key_event | ( | gnash::key::code | k, |
int | modifier, | ||
bool | pressed | ||
) |
Key event notification to be called when a key is pressed or depressed.
k | The key code. |
modifier | Modifier key identifiers from gnash::key::modifier ORed together |
pressed | Determines whether the key is being pressed (true) or being released (false) |
References gnash::key::ESCAPE, isFullscreen(), gnash::movie_root::setStageDisplayState(), gnash::movie_root::DISPLAYSTATE_NORMAL, gnash::key::GNASH_MOD_CONTROL, gnash::key::o, gnash::key::O, takeScreenShot(), gnash::key::r, gnash::key::R, restart(), gnash::key::p, gnash::key::P, pause(), gnash::key::l, gnash::key::L, refreshView(), gnash::key::q, gnash::key::Q, test::w, gnash::key::W, quit(), gnash::key::f, gnash::key::F, toggleFullscreen(), gnash::key::h, gnash::key::H, showUpdatedRegions(), gnash::key::MINUS, _interval, gnash::key::u, setInterval(), gnash::key::PLUS, gnash::key::EQUALS, gnash::movie_root::getRootMovie(), gnash::Movie::frameRate(), gnash::key::GNASH_MOD_SHIFT, gnash::key::UP, notifyMouseMove(), gnash::key::DOWN, _height, gnash::key::LEFT, gnash::key::RIGHT, _width, and gnash::movie_root::keyEvent().
Referenced by gnash::AOS4Gui::key_event(), gnash::KdeGui::handleKeyEvent(), gnash::Qt4Gui::handleKeyEvent(), and gnash::SDLGui::key_event().
void gnash::Gui::notifyMouseClick | ( | bool | mouse_pressed | ) |
Mouse notification callback to be called when the mouse is clicked.
mouse_pressed | Determines whether the mouse button is being pressed (true) or being released (false) |
References gnash::key::m, assert, and gnash::movie_root::mouseClick().
Referenced by gnash::AOS4Gui::run(), gnash::gui::FBGui::checkForData(), gnash::FltkGui::handle(), gnash::qwidget::mousePressEvent(), gnash::qwidget::mouseReleaseEvent(), gnash::DrawingWidget::mousePressEvent(), gnash::DrawingWidget::mouseReleaseEvent(), and gnash::SDLGui::run().
void gnash::Gui::notifyMouseMove | ( | int | x, |
int | y | ||
) |
Mouse notification callback to be called when the mouse is moved.
x | The mouse coordinate X component in user/window coordinate space (pixels). |
y | The mouse coordinate Y component in user/window coordinate space (pixels). |
References gnash::key::m, x, y, gnash::movie_root::mouseMoved(), gnash::movie_root::getActiveEntityUnderPointer(), gnash::DisplayObject::isSelectableTextField(), setCursor(), gnash::CURSOR_INPUT, gnash::DisplayObject::allowHandCursor(), gnash::CURSOR_HAND, and gnash::CURSOR_NORMAL.
Referenced by gnash::AOS4Gui::run(), gnash::gui::FBGui::checkForData(), gnash::FltkGui::handle(), notify_key_event(), gnash::qwidget::mouseMoveEvent(), gnash::DrawingWidget::mouseMoveEvent(), and gnash::SDLGui::run().
void gnash::Gui::notifyMouseWheel | ( | int | delta | ) |
Send a mouse wheel event to the stage.
delta | A number expressing the extent of the wheel scroll. |
References gnash::key::m, assert, and gnash::movie_root::mouseWheel().
Referenced by gnash::DrawingWidget::wheelEvent().
void gnash::Gui::pause | ( | ) |
Toggle between "stop" and "play" mode.
References play(), gnash::key::s, gnash::movie_root::runResources(), gnash::RunResources::soundHandler(), gnash::sound::sound_handler::pause(), gnash::InterruptableVirtualClock::pause(), and stopHook().
Referenced by gnash::AOS4Gui::run(), notify_key_event(), gnash::qwidget::menuitem_pause_callback(), and gnash::DrawingWidget::pause().
void gnash::Gui::play | ( | ) |
Put the application in "play" mode.
When in play mode the application will be advanced as usual.
References start(), assert, gnash::key::s, gnash::movie_root::runResources(), gnash::RunResources::soundHandler(), gnash::sound::sound_handler::unpause(), gnash::InterruptableVirtualClock::resume(), and playHook().
Referenced by gnash::AOS4Gui::run(), pause(), gnash::qwidget::menuitem_play_callback(), and gnash::DrawingWidget::play().
virtual void gnash::Gui::playHook | ( | ) | [inline, protected, virtual] |
Called by Gui::play().
Referenced by play().
void gnash::Gui::quit | ( | ) |
Always called on exit.
Handles any common functions, then calls virtual quitUI().
References _renderer, and quitUI().
Referenced by gnash::DumpGui::run(), gnash::GtkGui::createMenu(), gnash::GtkGui::createMenuAlt(), notify_key_event(), advanceMovie(), gnash::KdeGui::setTimeout(), gnash::qwidget::menuitem_quit_callback(), gnash::Player::CallbacksHandler::exit(), gnash::DrawingWidget::quit(), and gnash::Qt4Gui::setTimeout().
virtual void gnash::Gui::quitUI | ( | ) | [inline, protected, virtual] |
End main rendering loop calling GUI-specific exit functions.
Do not call this directly. Call quit() instead. The default implementation calls exit(EXIT_SUCCESS), which isn't nice. Please implement the proper main loop quitter in the subclasses.
Reimplemented in gnash::Qt4Gui, gnash::KdeGui, gnash::NullGui, gnash::GtkGui, and gnash::DumpGui.
Referenced by quit().
void gnash::Gui::refreshView | ( | ) |
Force immediate redraw
References gnash::key::m, assert, and _redraw_flag.
Referenced by gnash::AOS4Gui::run(), notify_key_event(), gnash::qwidget::menuitem_refresh_callback(), and gnash::DrawingWidget::refresh().
virtual void gnash::Gui::renderBuffer | ( | ) | [pure virtual] |
Render the current buffer. For OpenGL, this means that the front and back buffers are swapped.
Implemented in gnash::gui::FBGui, gnash::KdeGui, gnash::Qt4Gui, gnash::AOS4Gui, gnash::HaikuGui, gnash::AquaGui, gnash::GtkGui, gnash::NullGui, gnash::SDLGui, gnash::FltkGui, and gnash::DumpGui.
void gnash::Gui::resize_view | ( | int | width, |
int | height | ||
) |
Resize the client area view and the window accordingly.
width | The desired width in pixels. |
height | The desired height in pixels. |
Reimplemented in gnash::gui::FBGui, and gnash::HaikuGui.
References GNASH_REPORT_FUNCTION, assert, gnash::movie_root::setDimensions(), _width, width, _height, height, _validbounds, gnash::geometry::Range2d::setTo(), and updateStageMatrix().
Referenced by gnash::AOS4Gui::run(), gnash::AOS4Gui::setFullscreen(), gnash::AOS4Gui::unsetFullscreen(), gnash::FltkGui::layout(), start(), gnash::KdeGui::resize(), and gnash::Qt4Gui::resize().
void gnash::Gui::resizeWindow | ( | int | width, |
int | height | ||
) | [virtual] |
Reimplemented in gnash::Qt4Gui, and gnash::GtkGui.
References _.
void gnash::Gui::restart | ( | ) |
Instruct the core to restart the movie and set state to play(). This does not change pause state.
References gnash::movie_root::reset(), and start().
Referenced by gnash::AOS4Gui::run(), notify_key_event(), gnash::qwidget::menuitem_restart_callback(), and gnash::DrawingWidget::restart().
virtual bool gnash::Gui::run | ( | ) | [pure virtual] |
Start main rendering loop.
Implemented in gnash::gui::FBGui, gnash::Qt4Gui, gnash::KdeGui, gnash::AOS4Gui, gnash::AquaGui, gnash::HaikuGui, gnash::NullGui, gnash::DumpGui, gnash::FltkGui, gnash::SDLGui, and gnash::GtkGui.
virtual std::pair<int, int> gnash::Gui::screenResolution | ( | ) | const [inline, virtual] |
Reimplemented in gnash::Qt4Gui, and gnash::GtkGui.
void gnash::Gui::setAudioDump | ( | const std::string & | fname | ) | [inline] |
Set the name of a file to dump audio to.
References _audioDump.
void gnash::Gui::setClipboard | ( | const std::string & | copy | ) | [virtual] |
Reimplemented in gnash::Qt4Gui, and gnash::GtkGui.
void gnash::Gui::setCursor | ( | gnash_cursor_type | newcursor | ) | [virtual] |
Sets the current mouse cursor for the Gui window.
Reimplemented in gnash::GtkGui, gnash::KdeGui, gnash::Qt4Gui, gnash::DumpGui, gnash::AquaGui, and gnash::FltkGui.
Referenced by notifyMouseMove().
void gnash::Gui::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 in gnash::gui::FBGui, gnash::Qt4Gui, gnash::AOS4Gui, gnash::GtkGui, gnash::HaikuGui, and gnash::DumpGui.
References _.
virtual void gnash::Gui::setInterval | ( | unsigned int | interval | ) | [inline, virtual] |
Set main loop delay in milliseconds.
Reimplemented in gnash::gui::FBGui, gnash::KdeGui, gnash::Qt4Gui, gnash::AOS4Gui, gnash::HaikuGui, gnash::GtkGui, gnash::SDLGui, gnash::DumpGui, gnash::FltkGui, and gnash::NullGui.
References _interval.
Referenced by notify_key_event().
void gnash::Gui::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 in gnash::gui::FBGui, and gnash::DumpGui.
Referenced by setInvalidatedRegions().
void gnash::Gui::setInvalidatedRegions | ( | const InvalidatedRanges & | ranges | ) | [virtual] |
Reimplemented in gnash::gui::FBGui, gnash::GtkGui, gnash::Qt4Gui, gnash::KdeGui, gnash::AOS4Gui, gnash::HaikuGui, gnash::SDLGui, gnash::DumpGui, and gnash::FltkGui.
References gnash::geometry::SnappingRanges2d::getFullArea(), gnash::geometry::Range2d::isFinite(), gnash::geometry::Range2d::getMinX(), gnash::geometry::Range2d::getMinY(), gnash::geometry::Range2d::getMaxX(), gnash::geometry::Range2d::getMaxY(), gnash::geometry::Range2d::isWorld(), gnash::SWFRect::set_world(), and setInvalidatedRegion().
void gnash::Gui::setMaxAdvances | ( | unsigned long | ul | ) | [inline] |
Set the maximum number of frame advances before Gnash exits.
References _maxAdvances.
void gnash::Gui::setMovieDefinition | ( | movie_definition * | md | ) |
Set the definition of top-level movie.
References assert.
void gnash::Gui::setQuality | ( | Quality | q | ) |
Set rendering quality, if not locked by RC file..
References _, and gnash::movie_root::setQuality().
void gnash::Gui::setScreenShotter | ( | std::auto_ptr< ScreenShotter > | ss | ) |
void gnash::Gui::setStage | ( | movie_root * | stage | ) |
Set the stage to advance/display.
References assert.
virtual void gnash::Gui::setTimeout | ( | unsigned int | timeout | ) | [pure virtual] |
Set the time in milliseconds after which the programme should exit.
Implemented in gnash::gui::FBGui, gnash::KdeGui, gnash::Qt4Gui, gnash::AOS4Gui, gnash::HaikuGui, gnash::GtkGui, gnash::AquaGui, gnash::SDLGui, gnash::DumpGui, gnash::FltkGui, and gnash::NullGui.
void gnash::Gui::showMenu | ( | bool | show | ) | [virtual] |
Sets whether the menus should be shown (for fscommand)
show | true if the menu bar should be shown. |
Reimplemented in gnash::gui::FBGui, and gnash::GtkGui.
bool gnash::Gui::showMouse | ( | bool | show | ) | [virtual] |
Sets whether the gui should show the system mouse pointer.
show | true if the mouse should be shown. |
Reimplemented in gnash::gui::FBGui, gnash::GtkGui, gnash::Qt4Gui, and gnash::AOS4Gui.
void gnash::Gui::showUpdatedRegions | ( | bool | x | ) | [inline] |
References x.
bool gnash::Gui::showUpdatedRegions | ( | ) | const [inline] |
Referenced by gnash::AOS4Gui::run(), and notify_key_event().
void gnash::Gui::start | ( | ) |
Start the movie.
This function will create an instance of the registered top-level movie definition, set variables into it and place it to the stage.
References assert, _, gnash::movie_root::init(), gnash::movie_root::set_background_alpha(), gnash::key::f, resize_view(), _width, _height, gnash::key::s, gnash::movie_root::runResources(), gnash::RunResources::soundHandler(), _audioDump, gnash::sound::sound_handler::setAudioDump(), gnash::sound::sound_handler::unpause(), and gnash::InterruptableVirtualClock::resume().
Referenced by restart(), play(), and advanceMovie().
void gnash::Gui::stop | ( | ) |
Put the application in "stop" mode.
When in stop mode the application won't be advanced.
References assert, isFullscreen(), unsetFullscreen(), gnash::key::s, gnash::movie_root::runResources(), gnash::RunResources::soundHandler(), gnash::sound::sound_handler::pause(), gnash::InterruptableVirtualClock::pause(), and stopHook().
Referenced by gnash::AOS4Gui::run(), gnash::qwidget::menuitem_stop_callback(), and gnash::DrawingWidget::stop().
virtual void gnash::Gui::stopHook | ( | ) | [inline, protected, virtual] |
Called by Gui::stop(). This can be used by GUIs to implement pause widgets (so that resuming a stopped animation is more user-friendly)
void gnash::Gui::takeScreenShot | ( | ) |
Take a screenshot now!
References url, _runResources, gnash::RunResources::streamProvider(), gnash::StreamProvider::baseURL(), gnash::key::p, gnash::GNASH_FILETYPE_PNG, and assert.
Referenced by notify_key_event().
void gnash::Gui::toggleFullscreen | ( | ) |
Sends request to Gnash core to change display state.
References _fullscreen, gnash::movie_root::setStageDisplayState(), gnash::movie_root::DISPLAYSTATE_NORMAL, and gnash::movie_root::DISPLAYSTATE_FULLSCREEN.
Referenced by gnash::AOS4Gui::run(), and notify_key_event().
void gnash::Gui::toggleSound | ( | ) |
Toggle sound state between muted and unmuted. If there is no active sound handler this does nothing.
References assert, gnash::key::s, gnash::movie_root::runResources(), gnash::RunResources::soundHandler(), gnash::sound::sound_handler::is_muted(), gnash::sound::sound_handler::unmute(), and gnash::sound::sound_handler::mute().
void gnash::Gui::unsetFullscreen | ( | ) | [virtual] |
Return from fullscreen to normal mode.
Reimplemented in gnash::gui::FBGui, gnash::Qt4Gui, gnash::AOS4Gui, gnash::GtkGui, gnash::DumpGui, and gnash::HaikuGui.
References _.
Referenced by stop().
void gnash::Gui::updateStageMatrix | ( | ) |
Update stage SWFMatrix accordingly to window size and flash Stage configuration (scaleMode, alignment) This method should be called from the core lib when Stage configuration change or is called by resize_view.
References _, assert, gnash::movie_root::getStageScaleMode(), gnash::key::f, _width, _height, gnash::movie_root::getStageAlignment(), _renderer, and _redraw_flag.
Referenced by resize_view().
virtual bool gnash::Gui::visible | ( | ) | [inline, protected, virtual] |
Determines whether the Gui is visible (not obscured).
Reimplemented in gnash::GtkGui.
Referenced by advanceMovie().
virtual bool gnash::Gui::want_multiple_regions | ( | ) | [inline, virtual] |
Reimplemented in gnash::gui::FBGui, gnash::GtkGui, gnash::Qt4Gui, and gnash::DumpGui.
bool gnash::Gui::want_redraw | ( | ) | [virtual] |
Asks the GUI handler if the next frame should be redrawn completely.
For example, when the contents of the player window have been destroyed, then want_redraw() should return true so that setInvalidatedRegion() is called with the coordinates of the complete screen.
Reimplemented in gnash::DumpGui.
virtual bool gnash::Gui::watchFD | ( | int | ) | [inline, protected, virtual] |
Watch a file descriptor.
An implementing Gui should monitor the file descriptor in its main loop. When the file descriptor is triggered, the implementation should call callCallback().
fd | The file descriptor to be watched |
bool gnash::Gui::yesno | ( | const std::string & | question | ) | [virtual] |
Prompt user with a question she can answer with yes/no.
question | The question to ask user |
The default implementation always returns true.
Reimplemented in gnash::Qt4Gui, gnash::GtkGui, and gnash::HaikuGui.
References _.
unsigned long gnash::Gui::_advances [protected] |
Counter to keep track of frame advances.
Referenced by advanceMovie().
std::string gnash::Gui::_audioDump [protected] |
Name of a file to dump audio to.
Referenced by start(), and setAudioDump().
bool gnash::Gui::_fullscreen [protected] |
int gnash::Gui::_height [protected] |
Desired window height.
Referenced by gnash::AOS4Gui::run(), gnash::AOS4Gui::createWindow(), gnash::AquaGui::createWindow(), gnash::DumpGui::createWindow(), gnash::DumpGui::setRenderHandlerSize(), gnash::gui::FBGui::init(), gnash::FltkGui::renderBuffer(), gnash::GtkGui::createWindow(), updateStageMatrix(), resize_view(), notify_key_event(), start(), gnash::HaikuGui::createWindow(), gnash::HaikuGui::setFullscreenEtc(), gnash::KdeGui::createWindow(), gnash::Qt4Gui::createWindow(), gnash::Qt4Gui::resizeWindow(), and gnash::SDLGui::createWindow().
unsigned int gnash::Gui::_interval [protected] |
Main loop interval: the time between successive advance_movie calls.
Referenced by gnash::AOS4Gui::run(), gnash::AOS4Gui::setInterval(), gnash::AquaGui::run(), gnash::DumpGui::run(), gnash::DumpGui::setInterval(), gnash::gui::FBGui::run(), gnash::gui::FBGui::setInterval(), gnash::GtkGui::setInterval(), notify_key_event(), setInterval(), gnash::HaikuGui::setInterval(), gnash::HaikuGui::getInterval(), gnash::NullGui::run(), gnash::NullGui::setInterval(), gnash::SDLGui::run(), and gnash::SDLGui::setInterval().
bool gnash::Gui::_loop [protected] |
Determines if playback should restart after the movie ends.
Referenced by loops().
unsigned long gnash::Gui::_maxAdvances [protected] |
Referenced by advanceMovie(), and setMaxAdvances().
bool gnash::Gui::_mouseShown [protected] |
bool gnash::Gui::_redraw_flag [protected] |
Signals that the next frame must be re-rendered completely because the window size did change.
Referenced by updateStageMatrix(), and refreshView().
boost::shared_ptr<Renderer> gnash::Gui::_renderer [protected] |
The handler which is called to update the client area of our window.
Referenced by gnash::AOS4Gui::init(), gnash::AOS4Gui::createWindow(), gnash::AquaGui::init(), gnash::DumpGui::init(), gnash::FltkGui::createWindow(), gnash::FltkGui::setInvalidatedRegions(), gnash::GtkGui::init(), gnash::GtkGui::setInvalidatedRegions(), quit(), updateStageMatrix(), advanceMovie(), gnash::HaikuGui::init(), gnash::HaikuGui::createWindow(), gnash::KdeGui::createWindow(), gnash::Qt4Gui::createWindow(), gnash::Qt4Gui::setInvalidatedRegions(), gnash::SDLGui::init(), and gnash::SDLGui::createWindow().
RunResources& gnash::Gui::_runResources [protected] |
Per-run resources.
Referenced by gnash::AOS4Gui::createWindow(), gnash::AquaGui::init(), gnash::DumpGui::init(), gnash::DumpGui::writeSamples(), gnash::gui::FBGui::init(), gnash::gui::FBGui::createWindow(), gnash::FltkGui::createWindow(), gnash::GtkGui::init(), takeScreenShot(), gnash::HaikuGui::createWindow(), gnash::KdeGui::createWindow(), gnash::Qt4Gui::init(), gnash::Qt4Gui::createWindow(), and gnash::SDLGui::createWindow().
geometry::Range2d<int> gnash::Gui::_validbounds [protected] |
Referenced by gnash::DumpGui::createWindow(), gnash::gui::FBGui::init(), gnash::gui::FBGui::run(), gnash::FltkGui::setInvalidatedRegions(), gnash::GtkGui::createWindow(), gnash::GtkGui::setInvalidatedRegions(), resize_view(), gnash::Qt4Gui::createWindow(), and gnash::Qt4Gui::setInvalidatedRegions().
int gnash::Gui::_width [protected] |
Desired window width.
Referenced by gnash::AOS4Gui::run(), gnash::AOS4Gui::createWindow(), gnash::AquaGui::createWindow(), gnash::DumpGui::createWindow(), gnash::DumpGui::setRenderHandlerSize(), gnash::gui::FBGui::init(), gnash::FltkGui::renderBuffer(), gnash::GtkGui::createWindow(), updateStageMatrix(), resize_view(), notify_key_event(), start(), gnash::HaikuGui::createWindow(), gnash::HaikuGui::setFullscreenEtc(), gnash::KdeGui::createWindow(), gnash::Qt4Gui::createWindow(), gnash::Qt4Gui::resizeWindow(), and gnash::SDLGui::createWindow().
unsigned long gnash::Gui::_xid [protected] |
The X Window ID to attach to. If zero, we create a new window.
Referenced by gnash::DumpGui::DumpGui(), gnash::DumpGui::init(), gnash::FltkGui::handle(), gnash::FltkGui::create(), gnash::FltkGui::createWindow(), gnash::GtkGui::init(), gnash::GtkGui::setFullscreen(), gnash::GtkGui::unsetFullscreen(), gnash::GtkGui::hideMenu(), gnash::GtkGui::resizeWindow(), gnash::GtkGui::createWindow(), isPlugin(), gnash::HaikuGui::createWindow(), gnash::HaikuGui::setFullscreenEtc(), gnash::HaikuGui::unsetFullscreenEtc(), gnash::KdeGui::init(), gnash::Qt4Gui::init(), gnash::Qt4Gui::createWindow(), gnash::Qt4Gui::unsetFullscreen(), gnash::SDLGui::init(), and gnash::SDLGui::createWindow().