Gnash
0.8.11dev
|
#include <gtksup.h>
Public Member Functions | |
GtkGui (unsigned long xid, float scale, bool loop, RunResources &r) | |
virtual | ~GtkGui () |
virtual bool | init (int argc, char **argv[]) |
GUI interface implementation. More... | |
virtual bool | createWindow (int width, int height) |
virtual bool | createWindow (const char *title, int width, int height, int xPosition=0, int yPosition=0) |
Create and display our window. More... | |
virtual void | resizeWindow (int width, int height) |
virtual bool | run () |
Start main rendering loop. More... | |
virtual void | quitUI () |
End main rendering loop calling GUI-specific exit functions. More... | |
virtual bool | createMenu () |
virtual bool | createMenuAlt () |
virtual bool | setupEvents () |
Set up callbacks for key, mouse and other GTK events. More... | |
virtual void | beforeRendering () |
virtual void | renderBuffer () |
virtual void | setInterval (unsigned int interval) |
Set main loop delay in milliseconds. More... | |
virtual void | setTimeout (unsigned int timeout) |
Set the time in milliseconds after which the programme should exit. More... | |
virtual void | setFullscreen () |
virtual void | unsetFullscreen () |
virtual void | hideMenu () |
virtual bool | yesno (const std::string &question) |
Prompt user with a question she can answer with yes/no. More... | |
virtual double | getPixelAspectRatio () const |
For System.capabilities information. More... | |
virtual std::pair< int, int > | screenResolution () const |
virtual double | getScreenDPI () const |
virtual void | setClipboard (const std::string ©) |
void | grabFocus () |
Grab focus so to receive all key events. More... | |
bool | createMenuBar () |
Create a menu bar for the application, attach to our window. More... | |
void | createFileMenu (GtkWidget *obj) |
void | createEditMenu (GtkWidget *obj) |
void | createViewMenu (GtkWidget *obj) |
void | createQualityMenu (GtkWidget *obj) |
void | createHelpMenu (GtkWidget *obj) |
void | createControlMenu (GtkWidget *obj) |
void | showPropertiesDialog () |
void | showPreferencesDialog () |
void | showAboutDialog () |
void | expose (const GdkRegion *region) |
void | setInvalidatedRegions (const InvalidatedRanges &ranges) |
bool | want_multiple_regions () |
virtual void | setCursor (gnash_cursor_type newcursor) |
Sets the current mouse cursor for the Gui window. More... | |
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 | error (const std::string &msg) |
Handle error message from the core. More... | |
bool | checkX11Extension (const std::string &ext) |
virtual bool | visible () |
Determines whether the Gui is visible (not obscured). More... | |
void | setVisible (bool visible) |
![]() | |
virtual | ~Gui () |
virtual VirtualClock & | getClock () |
Return the clock provided by this Gui. More... | |
void | setScreenShotter (std::unique_ptr< ScreenShotter > ss) |
void | quit () |
Always called on exit. More... | |
virtual void | setInvalidatedRegion (const SWFRect &bounds) |
Gives the GUI a hint which region of the stage should be redrawn. More... | |
virtual bool | want_redraw () |
Asks the GUI handler if the next frame should be redrawn completely. More... | |
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 | 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... | |
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 | |
![]() | |
typedef std::map< std::string, std::string > | VariableMap |
![]() | |
static bool | advance_movie (Gui *gui) |
Convenience static wrapper around advanceMovie for callbacks happiness. More... | |
![]() | |
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... | |
![]() | |
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... | |
gnash::GtkGui::GtkGui | ( | unsigned long | xid, |
float | scale, | ||
bool | loop, | ||
RunResources & | r | ||
) |
|
virtual |
|
virtual |
Reimplemented from gnash::Gui.
References gnash::Gui::getStage(), GNASH_CANVAS, and gnash_canvas_before_rendering().
bool gnash::GtkGui::checkX11Extension | ( | const std::string & | ext | ) |
References gnash::key::i, and gnash::key::n.
Referenced by init(), and want_multiple_regions().
void gnash::GtkGui::createControlMenu | ( | GtkWidget * | obj | ) |
References _, gnash::Gui::pause(), gnash::Gui::play(), gnash::Gui::restart(), and gnash::Gui::stop().
Referenced by createMenu(), and createMenuBar().
void gnash::GtkGui::createEditMenu | ( | GtkWidget * | obj | ) |
References _.
Referenced by createMenu(), createMenuAlt(), and createMenuBar().
void gnash::GtkGui::createFileMenu | ( | GtkWidget * | obj | ) |
/// Menus /// ///
References _, and gnash::Gui::quit().
Referenced by createMenu(), and createMenuBar().
void gnash::GtkGui::createHelpMenu | ( | GtkWidget * | obj | ) |
References _.
Referenced by createMenu(), createMenuAlt(), and createMenuBar().
|
virtual |
The sound handler is initialized after the Gui is created, and may be disabled or enabled dynamically.
References _, createControlMenu(), createEditMenu(), createFileMenu(), createHelpMenu(), createViewMenu(), and gnash::Gui::quit().
Referenced by init().
|
virtual |
References createEditMenu(), createHelpMenu(), and gnash::Gui::quit().
Referenced by init().
bool gnash::GtkGui::createMenuBar | ( | ) |
Create a menu bar for the application, attach to our window.
/// Widget functions /// ///
References createControlMenu(), createEditMenu(), createFileMenu(), createHelpMenu(), and createViewMenu().
Referenced by init().
void gnash::GtkGui::createQualityMenu | ( | GtkWidget * | obj | ) |
References _.
Referenced by createViewMenu().
void gnash::GtkGui::createViewMenu | ( | GtkWidget * | obj | ) |
References _, createQualityMenu(), and gnash::Gui::showUpdatedRegions().
Referenced by createMenu(), and createMenuBar().
|
virtual |
/// Rendering stuff /// ///
References gnash::Gui::_height, gnash::Gui::_validbounds, gnash::Gui::_width, height, gnash::geometry::Range2d< T >::setTo(), and width.
Referenced by createWindow().
|
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. |
Implements gnash::Gui.
References gnash::Gui::_xid, createWindow(), gnash::key::e, gnash::key::i, gnash::key::p, x, and y.
|
virtual |
Handle error message from the core.
msg | The error message recieved |
Reimplemented from gnash::Gui.
References gnash::RcInitFile::getDefaultInstance(), and gnash::RcInitFile::popupMessages().
Referenced by want_multiple_regions(), and yesno().
void gnash::GtkGui::expose | ( | const GdkRegion * | region | ) |
|
virtual |
|
virtual |
Reimplemented from gnash::Gui.
void gnash::GtkGui::grabFocus | ( | ) |
Grab focus so to receive all key events.
Might become a virtual in the base class
|
virtual |
Hide the menu bar when using standalone player
Reimplemented from gnash::Gui.
References gnash::Gui::_fullscreen, gnash::Gui::_xid, and showMenu().
|
virtual |
GUI interface implementation.
Implements gnash::Gui.
References _, gnash::Gui::_renderer, gnash::Gui::_runResources, gnash::Gui::_xid, checkX11Extension(), createMenu(), createMenuAlt(), createMenuBar(), gnash::RunResources::getHWAccelBackend(), gnash::RunResources::getRenderBackend(), GNASH_CANVAS, gnash_canvas_get_renderer(), gnash_canvas_new(), gnash_canvas_setup(), gnash::log_debug(), gnash::log_error(), gnash::RunResources::setRenderer(), and setupEvents().
|
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 from gnash::Gui.
References _, gnash::Gui::_interval, gnash::Gui::advance_movie(), and gnash::log_debug().
|
virtual |
Render the current buffer. For OpenGL, this means that the front and back buffers are swapped.
Implements gnash::Gui.
|
virtual |
Reimplemented from gnash::Gui.
References gnash::Gui::_xid.
|
virtual |
|
virtual |
Reimplemented from gnash::Gui.
Referenced by getPixelAspectRatio().
|
virtual |
Reimplemented from gnash::Gui.
|
virtual |
Sets the current mouse cursor for the Gui window.
Reimplemented from gnash::Gui.
References gnash::Gui::_mouseShown, gnash::CURSOR_HAND, and gnash::CURSOR_INPUT.
Referenced by want_multiple_regions().
|
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.
References gnash::Gui::_fullscreen, gnash::Gui::_xid, and showMenu().
|
virtual |
Set main loop delay in milliseconds.
Reimplemented from gnash::Gui.
References gnash::Gui::_interval, and gnash::Gui::isStopped().
|
virtual |
Reimplemented from gnash::Gui.
References gnash::Gui::_renderer, gnash::Gui::_validbounds, gnash::geometry::Range2d< T >::getMinX(), gnash::geometry::Range2d< T >::getMinY(), gnash::geometry::SnappingRanges2d< T >::getRange(), gnash::geometry::Range2d< T >::height(), gnash::geometry::Intersection(), gnash::geometry::Range2d< T >::isFinite(), gnash::geometry::Range2d< T >::isNull(), gnash::geometry::SnappingRanges2d< T >::size(), and gnash::geometry::Range2d< T >::width().
|
virtual |
Set the time in milliseconds after which the programme should exit.
Implements gnash::Gui.
|
virtual |
Set up callbacks for key, mouse and other GTK events.
Must be called after the drawing area has been added to a top level window, as it calls setupWindowEvents() to add key event callbacks to the top level window.
Referenced by init().
|
inline |
References visible().
void gnash::GtkGui::showAboutDialog | ( | void | ) |
|
virtual |
Sets whether the menus should be shown (for fscommand)
show | true if the menu bar should be shown. |
Reimplemented from gnash::Gui.
References gnash::RcInitFile::getDefaultInstance(), and gnash::RcInitFile::ignoreShowMenu().
Referenced by hideMenu(), setFullscreen(), unsetFullscreen(), and want_multiple_regions().
|
virtual |
Sets whether the gui should show the system mouse pointer.
show | true if the mouse should be shown. |
Reimplemented from gnash::Gui.
References gnash::Gui::_mouseShown, color, gnash::RcInitFile::getDefaultInstance(), and gnash::RcInitFile::showMouse().
Referenced by want_multiple_regions().
void gnash::GtkGui::showPreferencesDialog | ( | ) |
void gnash::GtkGui::showPropertiesDialog | ( | ) |
References _.
|
virtual |
Return from fullscreen to normal mode.
Reimplemented from gnash::Gui.
References gnash::Gui::_fullscreen, gnash::Gui::_xid, and showMenu().
|
inlinevirtual |
Determines whether the Gui is visible (not obscured).
Reimplemented from gnash::Gui.
Referenced by setVisible().
|
inlinevirtual |
Reimplemented from gnash::Gui.
References checkX11Extension(), error(), setCursor(), showMenu(), and showMouse().
|
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 from gnash::Gui.
References _, error(), and gnash::log_error().