Gnash
0.8.11dev
|
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. More... | |
virtual void | setInterval (unsigned int interval) |
Set main loop delay in milliseconds. More... | |
virtual VirtualClock & | getClock () |
Return the clock provided by this Gui. More... | |
virtual void | setTimeout (unsigned int timeout)=0 |
Set the time in milliseconds after which the programme should exit. More... | |
void | setScreenShotter (std::unique_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. More... | |
virtual void | resizeWindow (int width, int height) |
virtual bool | run ()=0 |
Start main rendering loop. More... | |
void | quit () |
Always called on exit. More... | |
virtual void | renderBuffer ()=0 |
virtual void | setInvalidatedRegion (const SWFRect &bounds) |
Gives the GUI a hint which region of the stage should be redrawn. More... | |
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. More... | |
virtual void | setCursor (gnash_cursor_type newcursor) |
Sets the current mouse cursor for the Gui window. More... | |
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. More... | |
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 | setFullscreen () |
virtual void | unsetFullscreen () |
virtual void | hideMenu () |
virtual bool | showMouse (bool show) |
Sets whether the gui should show the system mouse pointer. More... | |
virtual void | showMenu (bool show) |
Sets whether the menus should be shown (for fscommand) More... | |
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_root * | getStage () |
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... | |
Static Public Member Functions | |
static bool | advance_movie (Gui *gui) |
Convenience static wrapper around advanceMovie for callbacks happiness. More... | |
Protected Member Functions | |
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 void | quitUI () |
End main rendering loop calling GUI-specific exit functions. 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 | |
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... | |
Parent class from which all GUI implementations will depend.
typedef std::map<std::string, std::string> gnash::Gui::VariableMap |
|
virtual |
References gnash::log_debug().
|
protected |
Default constructor. Initialises members to safe defaults.
|
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.
|
inlinestatic |
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..
References advanceMovie(), gnash::URLAccessManager::allow(), play, start, and stop.
Referenced by gnash::HaikuGui::GnashPulse(), gnash::FltkGui::handle(), gnash::GtkGui::quitUI(), gnash::GtkGui::run(), gnash::DrawingWidget::timerEvent(), and gnash::qwidget::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 _advances, _maxAdvances, _renderer, gnash::movie_root::advance(), gnash::Movie::ensureFrameLoaded(), gnash::MovieClip::get_current_frame(), gnash::MovieClip::get_frame_count(), gnash::movie_root::getRootMovie(), isStopped(), loops(), gnash::MovieClip::PLAYSTATE_PLAY, quit(), gnash::MovieClip::setPlayState(), start(), and visible().
Referenced by advance_movie(), gnash::NullGui::run(), and gnash::DumpGui::run().
|
virtual |
Sets whether scaling should be allowed (for fscommand)
allow | true if stage scaling should be allowed |
References gnash::log_error(), gnash::movie_root::SCALEMODE_NOSCALE, gnash::movie_root::SCALEMODE_SHOWALL, and gnash::movie_root::setStageScaleMode().
|
inlinevirtual |
Reimplemented in gnash::GtkGui, and gnash::DumpGui.
Referenced by notify_key_event().
|
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.
|
inlinevirtual |
Handle error message from the core.
msg | The error message recieved |
Reimplemented in gnash::GtkGui, and gnash::HaikuGui.
|
inlinevirtual |
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().
|
inline |
Height of a window pixel, in stage pseudopixel units.
References gnash::key::r.
|
inlinevirtual |
Reimplemented in gnash::gui::FBGui, and gnash::GtkGui.
Quality gnash::Gui::getQuality | ( | ) | const |
Get current rendering quality.
References _, gnash::movie_root::getQuality(), gnash::log_error(), and gnash::QUALITY_HIGH.
|
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 in gnash::gui::FBGui.
|
inlinevirtual |
Reimplemented in gnash::gui::FBGui, gnash::Qt4Gui, and gnash::GtkGui.
|
inline |
The root movie, or "Stage".
Referenced by gnash::GtkGui::beforeRendering(), gnash::gui::FBGui::checkForData(), and gnash::DumpGui::run().
|
inline |
Width of a window pixel, in stage pseudopixel units.
|
inline |
Height of a window pixel, in stage pseudopixel units.
|
virtual |
Hide the menu bar when using standalone player
Reimplemented in gnash::GtkGui.
References _, LOG_ONCE, and gnash::log_unimpl().
|
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::DumpGui, gnash::SDLGui, gnash::FltkGui, and gnash::GtkGui.
|
inline |
References gnash::key::k, x, and y.
Referenced by notify_key_event(), and stop().
|
inline |
Whether gnash is is running as a plugin.
|
inline |
See stop(), play() and pause()
Referenced by advanceMovie(), and gnash::GtkGui::setInterval().
|
inline |
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 _height, _interval, _redraw_flag, _renderer, _width, gnash::movie_root::add_invalidated_bounds(), beforeRendering(), gnash::geometry::SnappingRanges2d< T >::combineRanges(), gnash::movie_root::display(), gnash::movie_root::DISPLAYSTATE_NORMAL, gnash::key::DOWN, gnash::key::e, gnash::key::EQUALS, gnash::key::ESCAPE, gnash::key::F, gnash::key::f, gnash::Movie::frameRate(), gnash::geometry::Range2d< T >::getMaxX(), gnash::geometry::Range2d< T >::getMaxY(), gnash::geometry::Range2d< T >::getMinX(), gnash::geometry::Range2d< T >::getMinY(), gnash::geometry::SnappingRanges2d< T >::getRange(), gnash::movie_root::getRootMovie(), gnash::key::GNASH_MOD_CONTROL, gnash::key::GNASH_MOD_SHIFT, gnash::geometry::SnappingRanges2d< T >::growBy(), gnash::key::H, gnash::key::h, gnash::key::i, IF_DEBUG_REGION_UPDATES, isFullscreen(), gnash::geometry::SnappingRanges2d< T >::isNull(), gnash::geometry::SnappingRanges2d< T >::isWorld(), gnash::movie_root::keyEvent(), gnash::key::L, gnash::key::l, gnash::key::LEFT, gnash::log_debug(), gnash::key::m, gnash::key::MINUS, notifyMouseMove(), gnash::key::O, gnash::key::o, gnash::key::P, gnash::key::p, pause(), gnash::key::PLUS, gnash::key::Q, gnash::key::q, quit(), gnash::key::R, gnash::key::r, refreshView(), renderBuffer(), restart(), gnash::key::RIGHT, setInterval(), setInvalidatedRegions(), gnash::geometry::SnappingRanges2d< T >::setSingleMode(), gnash::geometry::SnappingRanges2d< T >::setSnapFactor(), gnash::movie_root::setStageDisplayState(), gnash::geometry::SnappingRanges2d< T >::setWorld(), showUpdatedRegions(), gnash::geometry::SnappingRanges2d< T >::size(), takeScreenShot(), toggleFullscreen(), gnash::key::u, gnash::key::UP, gnash::key::W, gnash::key::w, want_multiple_regions(), and want_redraw().
Referenced by gnash::FltkGui::handle(), gnash::Qt4Gui::handleKeyEvent(), gnash::KdeGui::handleKeyEvent(), gnash::SDLGui::key_event(), and gnash::AOS4Gui::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, and gnash::movie_root::mouseClick().
Referenced by gnash::gui::FBGui::checkForData(), gnash::FltkGui::handle(), 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::DisplayObject::allowHandCursor(), gnash::CURSOR_HAND, gnash::CURSOR_INPUT, gnash::CURSOR_NORMAL, gnash::movie_root::getActiveEntityUnderPointer(), gnash::DisplayObject::isSelectableTextField(), gnash::log_debug(), gnash::key::m, gnash::movie_root::mouseMoved(), setCursor(), x, and y.
Referenced by gnash::gui::FBGui::checkForData(), gnash::FltkGui::handle(), gnash::DrawingWidget::mouseMoveEvent(), notify_key_event(), 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, and gnash::movie_root::mouseWheel().
Referenced by gnash::DrawingWidget::wheelEvent().
void gnash::Gui::pause | ( | ) |
Toggle between "stop" and "play" mode.
References gnash::InterruptableVirtualClock::pause(), gnash::sound::sound_handler::pause(), play(), gnash::movie_root::runResources(), gnash::key::s, gnash::RunResources::soundHandler(), and stopHook().
Referenced by gnash::GtkGui::createControlMenu(), gnash::FltkGui::createWindow(), notify_key_event(), gnash::DrawingWidget::pause(), and gnash::Qt4Gui::quitUI().
void gnash::Gui::play | ( | ) |
Put the application in "play" mode.
When in play mode the application will be advanced as usual.
References playHook(), gnash::InterruptableVirtualClock::resume(), gnash::movie_root::runResources(), gnash::key::s, gnash::RunResources::soundHandler(), start(), and gnash::sound::sound_handler::unpause().
Referenced by gnash::GtkGui::createControlMenu(), gnash::FltkGui::createWindow(), pause(), gnash::DrawingWidget::play(), and gnash::Qt4Gui::quitUI().
|
inlineprotectedvirtual |
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 advanceMovie(), gnash::GtkGui::createFileMenu(), gnash::GtkGui::createMenu(), gnash::GtkGui::createMenuAlt(), gnash::FltkGui::createWindow(), notify_key_event(), gnash::DrawingWidget::quit(), gnash::Qt4Gui::quitUI(), gnash::DumpGui::run(), gnash::Qt4Gui::setTimeout(), and gnash::KdeGui::setTimeout().
|
inlineprotectedvirtual |
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::gui::FBGui, gnash::Qt4Gui, gnash::KdeGui, gnash::NullGui, gnash::DumpGui, and gnash::GtkGui.
Referenced by quit().
void gnash::Gui::refreshView | ( | ) |
Force immediate redraw
References _redraw_flag, and gnash::key::m.
Referenced by notify_key_event(), and gnash::DrawingWidget::refresh().
|
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::DumpGui, and gnash::FltkGui.
Referenced by notify_key_event().
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. |
References _height, _validbounds, _width, GNASH_REPORT_FUNCTION, height, gnash::movie_root::setDimensions(), gnash::geometry::Range2d< T >::setTo(), updateStageMatrix(), and width.
Referenced by gnash::FltkGui::layout(), gnash::KdeGui::resize(), gnash::Qt4Gui::resize(), gnash::HaikuGui::resize_view(), gnash::gui::FBGui::resize_view(), and start().
|
virtual |
Reimplemented in gnash::Qt4Gui, and gnash::GtkGui.
References _, and gnash::log_unimpl().
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::GtkGui::createControlMenu(), gnash::FltkGui::createWindow(), notify_key_event(), gnash::Qt4Gui::quitUI(), and gnash::DrawingWidget::restart().
|
pure virtual |
Start main rendering loop.
Implemented in gnash::gui::FBGui, gnash::Qt4Gui, gnash::KdeGui, gnash::AOS4Gui, gnash::AquaGui, gnash::HaikuGui, gnash::DumpGui, gnash::NullGui, gnash::FltkGui, gnash::SDLGui, and gnash::GtkGui.
|
inlinevirtual |
Reimplemented in gnash::Qt4Gui, and gnash::GtkGui.
|
inline |
Set the name of a file to dump audio to.
|
virtual |
Reimplemented in gnash::Qt4Gui, and gnash::GtkGui.
References _, LOG_ONCE, and gnash::log_unimpl().
|
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().
|
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 _, and gnash::log_unimpl().
|
inlinevirtual |
Set main loop delay in milliseconds.
Reimplemented in gnash::gui::FBGui, gnash::KdeGui, gnash::Qt4Gui, gnash::AOS4Gui, gnash::HaikuGui, gnash::GtkGui, gnash::DumpGui, gnash::SDLGui, gnash::FltkGui, and gnash::NullGui.
Referenced by notify_key_event().
|
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().
|
virtual |
Reimplemented in gnash::gui::FBGui, gnash::GtkGui, gnash::Qt4Gui, gnash::KdeGui, gnash::AOS4Gui, gnash::HaikuGui, gnash::DumpGui, gnash::SDLGui, and gnash::FltkGui.
References gnash::DisplayObject::allowHandCursor(), gnash::GC::countCollectables(), gnash::movie_root::gc(), gnash::DisplayObject::get_depth(), gnash::movie_root::getActiveEntityUnderPointer(), gnash::movie_root::getDraggingCharacter(), gnash::movie_root::getEntityUnderPointer(), gnash::geometry::SnappingRanges2d< T >::getFullArea(), gnash::geometry::Range2d< T >::getMaxX(), gnash::geometry::Range2d< T >::getMaxY(), gnash::geometry::Range2d< T >::getMinX(), gnash::geometry::Range2d< T >::getMinY(), gnash::VM::getRoot(), gnash::VM::getSWFVersion(), gnash::DisplayObject::getTarget(), gnash::clocktime::getTicks(), gnash::movie_root::getVM(), gnash::geometry::Range2d< T >::isFinite(), gnash::geometry::Range2d< T >::isWorld(), gnash::SWFRect::set_world(), setInvalidatedRegion(), and gnash::typeName().
Referenced by notify_key_event().
|
inline |
Set the maximum number of frame advances before Gnash exits.
void gnash::Gui::setMovieDefinition | ( | movie_definition * | md | ) |
Set the definition of top-level movie.
void gnash::Gui::setQuality | ( | Quality | q | ) |
Set rendering quality, if not locked by RC file..
References _, gnash::log_error(), and gnash::movie_root::setQuality().
void gnash::Gui::setScreenShotter | ( | std::unique_ptr< ScreenShotter > | ss | ) |
void gnash::Gui::setStage | ( | movie_root * | stage | ) |
Set the stage to advance/display.
|
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::DumpGui, gnash::SDLGui, gnash::FltkGui, and gnash::NullGui.
|
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.
References _, LOG_ONCE, and gnash::log_unimpl().
|
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.
References _, LOG_ONCE, and gnash::log_unimpl().
|
inline |
References x.
|
inline |
References gnash::key::q.
Referenced by gnash::GtkGui::createViewMenu(), 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 _, _audioDump, _height, _width, gnash::key::f, gnash::movie_root::init(), gnash::log_error(), resize_view(), gnash::InterruptableVirtualClock::resume(), gnash::movie_root::runResources(), gnash::key::s, gnash::movie_root::set_background_alpha(), gnash::sound::sound_handler::setAudioDump(), gnash::RunResources::soundHandler(), and gnash::sound::sound_handler::unpause().
Referenced by advanceMovie(), play(), and restart().
void gnash::Gui::stop | ( | ) |
Put the application in "stop" mode.
When in stop mode the application won't be advanced.
References isFullscreen(), gnash::InterruptableVirtualClock::pause(), gnash::sound::sound_handler::pause(), gnash::movie_root::runResources(), gnash::key::s, gnash::RunResources::soundHandler(), stopHook(), and unsetFullscreen().
Referenced by gnash::GtkGui::createControlMenu(), gnash::FltkGui::createWindow(), gnash::Qt4Gui::quitUI(), and gnash::DrawingWidget::stop().
|
inlineprotectedvirtual |
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 _runResources, gnash::StreamProvider::baseURL(), gnash::GNASH_FILETYPE_PNG, name, gnash::key::p, gnash::RunResources::streamProvider(), and url.
Referenced by notify_key_event().
void gnash::Gui::toggleFullscreen | ( | ) |
Sends request to Gnash core to change display state.
References _fullscreen, gnash::movie_root::DISPLAYSTATE_FULLSCREEN, gnash::movie_root::DISPLAYSTATE_NORMAL, and gnash::movie_root::setStageDisplayState().
Referenced by 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 gnash::sound::sound_handler::is_muted(), gnash::sound::sound_handler::mute(), gnash::movie_root::runResources(), gnash::key::s, gnash::RunResources::soundHandler(), and gnash::sound::sound_handler::unmute().
Referenced by gnash::FltkGui::createWindow().
|
virtual |
Return from fullscreen to normal mode.
Reimplemented in gnash::gui::FBGui, gnash::Qt4Gui, gnash::AOS4Gui, gnash::GtkGui, gnash::DumpGui, and gnash::HaikuGui.
References _, and gnash::log_unimpl().
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 _, _height, _redraw_flag, _renderer, _width, gnash::key::f, gnash::movie_root::getStageAlignment(), gnash::movie_root::getStageScaleMode(), gnash::log_error(), gnash::movie_root::SCALEMODE_EXACTFIT, gnash::movie_root::SCALEMODE_NOBORDER, gnash::movie_root::SCALEMODE_NOSCALE, gnash::movie_root::SCALEMODE_SHOWALL, gnash::movie_root::STAGE_H_ALIGN_L, gnash::movie_root::STAGE_H_ALIGN_R, gnash::movie_root::STAGE_V_ALIGN_B, gnash::movie_root::STAGE_V_ALIGN_C, and gnash::movie_root::STAGE_V_ALIGN_T.
Referenced by resize_view().
|
inlineprotectedvirtual |
Determines whether the Gui is visible (not obscured).
Reimplemented in gnash::GtkGui.
References gnash::createAOS4Gui(), gnash::createAQUAGui(), gnash::createDumpGui(), gnash::gui::createFBGui(), gnash::createFLTKGui(), gnash::createGTKGui(), gnash::createHaikuGui(), gnash::createKDEGui(), gnash::createQt4Gui(), gnash::createRISCOSGui(), gnash::createSDLGui(), gnash::key::m, and gnash::key::r.
Referenced by advanceMovie().
|
inlinevirtual |
Reimplemented in gnash::gui::FBGui, gnash::GtkGui, gnash::Qt4Gui, and gnash::DumpGui.
Referenced by notify_key_event().
|
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.
Referenced by notify_key_event().
|
inlineprotectedvirtual |
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 |
References gnash::log_unimpl().
|
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 _, and gnash::log_error().
|
protected |
Counter to keep track of frame advances.
Referenced by advanceMovie().
|
protected |
Name of a file to dump audio to.
Referenced by start().
|
protected |
|
protected |
Desired window height.
Referenced by gnash::GtkGui::createWindow(), gnash::DumpGui::createWindow(), gnash::SDLGui::createWindow(), gnash::HaikuGui::createWindow(), gnash::AquaGui::createWindow(), gnash::AOS4Gui::createWindow(), gnash::Qt4Gui::createWindow(), gnash::KdeGui::createWindow(), gnash::gui::FBGui::init(), notify_key_event(), gnash::FltkGui::renderBuffer(), resize_view(), gnash::Qt4Gui::resizeWindow(), gnash::AOS4Gui::run(), gnash::HaikuGui::setFullscreenEtc(), gnash::DumpGui::setRenderHandlerSize(), start(), and updateStageMatrix().
|
protected |
Main loop interval: the time between successive advance_movie calls.
Referenced by gnash::HaikuGui::getInterval(), notify_key_event(), gnash::GtkGui::quitUI(), gnash::NullGui::run(), gnash::DumpGui::run(), gnash::AquaGui::run(), gnash::NullGui::setInterval(), gnash::SDLGui::setInterval(), gnash::DumpGui::setInterval(), gnash::GtkGui::setInterval(), gnash::HaikuGui::setInterval(), gnash::AOS4Gui::setInterval(), and gnash::gui::FBGui::setInterval().
|
protected |
Determines if playback should restart after the movie ends.
|
protected |
Referenced by advanceMovie().
|
protected |
|
protected |
Signals that the next frame must be re-rendered completely because the window size did change.
Referenced by notify_key_event(), refreshView(), and updateStageMatrix().
|
protected |
The handler which is called to update the client area of our window.
Referenced by advanceMovie(), gnash::FltkGui::createWindow(), gnash::SDLGui::createWindow(), gnash::HaikuGui::createWindow(), gnash::KdeGui::createWindow(), gnash::Qt4Gui::createWindow(), gnash::GtkGui::init(), gnash::SDLGui::init(), gnash::DumpGui::init(), gnash::HaikuGui::init(), gnash::AquaGui::init(), notify_key_event(), quit(), gnash::FltkGui::setInvalidatedRegions(), gnash::Qt4Gui::setInvalidatedRegions(), gnash::GtkGui::setInvalidatedRegions(), gnash::GtkGui::showAboutDialog(), and updateStageMatrix().
|
protected |
Per-run resources.
Referenced by gnash::FltkGui::createWindow(), gnash::SDLGui::createWindow(), gnash::HaikuGui::createWindow(), gnash::KdeGui::createWindow(), gnash::Qt4Gui::createWindow(), gnash::gui::FBGui::createWindow(), gnash::GtkGui::init(), gnash::DumpGui::init(), gnash::AquaGui::init(), gnash::Qt4Gui::init(), gnash::gui::FBGui::init(), gnash::GtkGui::showAboutDialog(), takeScreenShot(), and gnash::DumpGui::writeSamples().
|
protected |
|
protected |
Desired window width.
Referenced by gnash::GtkGui::createWindow(), gnash::DumpGui::createWindow(), gnash::SDLGui::createWindow(), gnash::HaikuGui::createWindow(), gnash::AquaGui::createWindow(), gnash::AOS4Gui::createWindow(), gnash::Qt4Gui::createWindow(), gnash::KdeGui::createWindow(), gnash::gui::FBGui::init(), notify_key_event(), gnash::FltkGui::renderBuffer(), resize_view(), gnash::Qt4Gui::resizeWindow(), gnash::AOS4Gui::run(), gnash::HaikuGui::setFullscreenEtc(), gnash::DumpGui::setRenderHandlerSize(), start(), and updateStageMatrix().
|
protected |
The X Window ID to attach to. If zero, we create a new window.
Referenced by gnash::FltkGui::create(), gnash::GtkGui::createWindow(), gnash::FltkGui::createWindow(), gnash::SDLGui::createWindow(), gnash::HaikuGui::createWindow(), gnash::Qt4Gui::createWindow(), gnash::DumpGui::DumpGui(), gnash::FltkGui::handle(), gnash::GtkGui::hideMenu(), gnash::GtkGui::init(), gnash::SDLGui::init(), gnash::DumpGui::init(), gnash::Qt4Gui::init(), gnash::KdeGui::init(), gnash::GtkGui::resizeWindow(), gnash::GtkGui::setFullscreen(), gnash::HaikuGui::setFullscreenEtc(), gnash::GtkGui::unsetFullscreen(), gnash::Qt4Gui::unsetFullscreen(), and gnash::HaikuGui::unsetFullscreenEtc().