Gnash  0.8.10
Public Member Functions
gnash::GtkGui Class Reference

#include <gtksup.h>

Inheritance diagram for gnash::GtkGui:
gnash::Gui

List of all members.

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 &copy)
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)

Constructor & Destructor Documentation

gnash::GtkGui::GtkGui ( unsigned long  xid,
float  scale,
bool  loop,
RunResources r 
)
gnash::GtkGui::~GtkGui ( ) [virtual]

Member Function Documentation

void gnash::GtkGui::beforeRendering ( ) [virtual]
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)

References _, play, and stop.

Referenced by createMenuBar(), and createMenu().

void gnash::GtkGui::createEditMenu ( GtkWidget *  obj)

References _.

Referenced by createMenuBar(), createMenu(), and createMenuAlt().

void gnash::GtkGui::createFileMenu ( GtkWidget *  obj)

/ Menus /// /

References _.

Referenced by createMenuBar(), and createMenu().

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]
bool gnash::GtkGui::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 createWindow(), x, y, and gnash::Gui::_xid.

void gnash::GtkGui::error ( const std::string &  ) [virtual]

Handle error message from the core.

Parameters:
msgThe 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]

For System.capabilities information.

Reimplemented from gnash::Gui.

References screenResolution().

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]
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]

Start main rendering loop.

Implements gnash::Gui.

References gnash::Gui::advance_movie().

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]
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  )
void gnash::GtkGui::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 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.

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

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::showPropertiesDialog ( )

References _, and _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.

Parameters:
questionThe question to ask user
Returns:
true for YES, false for NO

The default implementation always returns true.

Reimplemented from gnash::Gui.

References _window.


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