Gnash
0.8.10
|
#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. | |
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. | |
virtual void | resizeWindow (int width, int height) |
virtual bool | run () |
Start main rendering loop. | |
virtual void | quitUI () |
End main rendering loop calling GUI-specific exit functions. | |
virtual bool | createMenu () |
virtual bool | createMenuAlt () |
virtual bool | setupEvents () |
Set up callbacks for key, mouse and other GTK events. | |
virtual void | beforeRendering () |
virtual void | renderBuffer () |
virtual void | setInterval (unsigned int interval) |
Set main loop delay in milliseconds. | |
virtual void | setTimeout (unsigned int timeout) |
Set the time in milliseconds after which the programme should exit. | |
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. | |
virtual double | getPixelAspectRatio () const |
For System.capabilities information. | |
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. | |
bool | createMenuBar () |
Create a menu bar for the application, attach to our window. | |
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. | |
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 | error (const std::string &msg) |
Handle error message from the core. | |
bool | checkX11Extension (const std::string &ext) |
virtual bool | visible () |
Determines whether the Gui is visible (not obscured). | |
void | setVisible (bool visible) |
gnash::GtkGui::GtkGui | ( | unsigned long | xid, |
float | scale, | ||
bool | loop, | ||
RunResources & | r | ||
) |
gnash::GtkGui::~GtkGui | ( | ) | [virtual] |
void gnash::GtkGui::beforeRendering | ( | ) | [virtual] |
Reimplemented from gnash::Gui.
References gnash_canvas_before_rendering(), GNASH_CANVAS, and gnash::Gui::getStage().
bool gnash::GtkGui::checkX11Extension | ( | const std::string & | ext | ) |
References gnash::key::n, and gnash::key::i.
Referenced by init().
void gnash::GtkGui::createControlMenu | ( | GtkWidget * | obj | ) |
Referenced by createMenuBar(), and createMenu().
void gnash::GtkGui::createEditMenu | ( | GtkWidget * | obj | ) |
References _.
Referenced by createMenuBar(), createMenu(), and createMenuAlt().
void gnash::GtkGui::createFileMenu | ( | GtkWidget * | obj | ) |
void gnash::GtkGui::createHelpMenu | ( | GtkWidget * | obj | ) |
References _.
Referenced by createMenuBar(), createMenu(), and createMenuAlt().
bool gnash::GtkGui::createMenu | ( | ) | [virtual] |
The sound handler is initialized after the Gui is created, and may be disabled or enabled dynamically.
References createFileMenu(), createEditMenu(), createViewMenu(), createControlMenu(), createHelpMenu(), _, and gnash::Gui::quit().
Referenced by init().
bool gnash::GtkGui::createMenuAlt | ( | ) | [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 createFileMenu(), createEditMenu(), createViewMenu(), createControlMenu(), and createHelpMenu().
Referenced by init().
void gnash::GtkGui::createQualityMenu | ( | GtkWidget * | obj | ) |
References _.
void gnash::GtkGui::createViewMenu | ( | GtkWidget * | obj | ) |
References _.
Referenced by createMenuBar(), and createMenu().
bool gnash::GtkGui::createWindow | ( | int | width, |
int | height | ||
) | [virtual] |
/ Rendering stuff /// /
References assert, gnash::Gui::_width, gnash::Gui::_height, width, height, gnash::Gui::_validbounds, and gnash::geometry::Range2d::setTo().
Referenced by createWindow().
bool gnash::GtkGui::createWindow | ( | const char * | title, |
int | width, | ||
int | height, | ||
int | xPosition = 0 , |
||
int | yPosition = 0 |
||
) | [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 createWindow(), x, y, and gnash::Gui::_xid.
void gnash::GtkGui::error | ( | const std::string & | ) | [virtual] |
Handle error message from the core.
msg | The error message recieved |
Reimplemented from gnash::Gui.
References gnash::RcInitFile::getDefaultInstance(), and gnash::RcInitFile::popupMessages().
void gnash::GtkGui::expose | ( | const GdkRegion * | region | ) |
double gnash::GtkGui::getPixelAspectRatio | ( | ) | const [virtual] |
double gnash::GtkGui::getScreenDPI | ( | ) | const [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
void gnash::GtkGui::hideMenu | ( | ) | [virtual] |
Hide the menu bar when using standalone player
Reimplemented from gnash::Gui.
References gnash::Gui::_fullscreen, gnash::Gui::_xid, and showMenu().
bool gnash::GtkGui::init | ( | int | argc, |
char ** | argv[] | ||
) | [virtual] |
GUI interface implementation.
Implements gnash::Gui.
References _, gnash::Gui::_xid, gnash::Gui::_runResources, gnash::RunResources::getHWAccelBackend(), gnash::RunResources::getRenderBackend(), checkX11Extension(), gnash_canvas_new(), gnash_canvas_setup(), GNASH_CANVAS, createMenu(), createMenuAlt(), createMenuBar(), setupEvents(), gnash::Gui::_renderer, gnash_canvas_get_renderer(), and gnash::RunResources::setRenderer().
void gnash::GtkGui::quitUI | ( | ) | [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.
void gnash::GtkGui::renderBuffer | ( | ) | [virtual] |
Render the current buffer. For OpenGL, this means that the front and back buffers are swapped.
Implements gnash::Gui.
void gnash::GtkGui::resizeWindow | ( | int | width, |
int | height | ||
) | [virtual] |
Reimplemented from gnash::Gui.
References gnash::Gui::_xid.
bool gnash::GtkGui::run | ( | ) | [virtual] |
std::pair< int, int > gnash::GtkGui::screenResolution | ( | ) | const [virtual] |
Reimplemented from gnash::Gui.
Referenced by getPixelAspectRatio().
void gnash::GtkGui::setClipboard | ( | const std::string & | copy | ) | [virtual] |
Reimplemented from gnash::Gui.
void gnash::GtkGui::setCursor | ( | gnash_cursor_type | newcursor | ) | [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.
void gnash::GtkGui::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.
References gnash::Gui::_fullscreen, gnash::Gui::_xid, and showMenu().
void gnash::GtkGui::setInterval | ( | unsigned int | interval | ) | [virtual] |
Set main loop delay in milliseconds.
Reimplemented from gnash::Gui.
References gnash::Gui::_interval, and gnash::Gui::isStopped().
void gnash::GtkGui::setInvalidatedRegions | ( | const InvalidatedRanges & | ranges | ) | [virtual] |
Reimplemented from gnash::Gui.
References gnash::Gui::_renderer, gnash::geometry::SnappingRanges2d::size(), gnash::geometry::Intersection(), gnash::geometry::SnappingRanges2d::getRange(), gnash::Gui::_validbounds, gnash::geometry::Range2d::isNull(), assert, gnash::geometry::Range2d::isFinite(), gnash::geometry::Range2d::getMinX(), gnash::geometry::Range2d::getMinY(), gnash::geometry::Range2d::width(), and gnash::geometry::Range2d::height().
void gnash::GtkGui::setTimeout | ( | unsigned int | timeout | ) | [virtual] |
Set the time in milliseconds after which the programme should exit.
Implements gnash::Gui.
bool gnash::GtkGui::setupEvents | ( | ) | [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().
void gnash::GtkGui::setVisible | ( | bool | visible | ) | [inline] |
References visible().
void gnash::GtkGui::showAboutDialog | ( | void | ) |
References _, gnash::key::m, _renderer, gnash::Renderer::description(), and gnash::media::MediaHandler::description().
void gnash::GtkGui::showMenu | ( | bool | show | ) | [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 setFullscreen(), unsetFullscreen(), and hideMenu().
bool gnash::GtkGui::showMouse | ( | bool | show | ) | [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, gnash::RcInitFile::getDefaultInstance(), gnash::RcInitFile::showMouse(), and color.
void gnash::GtkGui::showPreferencesDialog | ( | ) |
References _window.
void gnash::GtkGui::unsetFullscreen | ( | ) | [virtual] |
Return from fullscreen to normal mode.
Reimplemented from gnash::Gui.
References gnash::Gui::_fullscreen, gnash::Gui::_xid, and showMenu().
virtual bool gnash::GtkGui::visible | ( | ) | [inline, virtual] |
Determines whether the Gui is visible (not obscured).
Reimplemented from gnash::Gui.
Referenced by setVisible().
bool gnash::GtkGui::want_multiple_regions | ( | ) | [inline, virtual] |
Reimplemented from gnash::Gui.
bool gnash::GtkGui::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 from gnash::Gui.
References _window.