[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r10295: Always use a vertical box fo
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r10295: Always use a vertical box for the gnash window, embedded or not. |
Date: |
Tue, 18 Nov 2008 16:10:31 +0100 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 10295
committer: Sandro Santilli <address@hidden>
branch nick: trunk
timestamp: Tue 2008-11-18 16:10:31 +0100
message:
Always use a vertical box for the gnash window, embedded or not.
Always add/remove the 'click to start' button to the vbox.
Fixes bug #23477 and gives access to the right-click menu.
Tests highly welcome. In particular, should be tested how the
movie info deals with "entity under the mouse" while paused
(window coordinates might be bogus)
modified:
gui/gtk.cpp
gui/gui.cpp
=== modified file 'gui/gtk.cpp'
--- a/gui/gtk.cpp 2008-11-18 12:24:43 +0000
+++ b/gui/gtk.cpp 2008-11-18 15:10:31 +0000
@@ -178,25 +178,18 @@
_glue->prepDrawingArea(_drawingArea);
#endif
- // Plugin
- if (_xid) {
- gtk_container_add(GTK_CONTAINER(_window), _drawingArea);
- }
-
- // Stand-alone
- else {
-
- // A vertical box is used to allow display of the menu bar
- _vbox = gtk_vbox_new(FALSE, 0);
- gtk_widget_show(_vbox);
- gtk_container_add(GTK_CONTAINER(_window), _vbox);
+ // A vertical box is used to allow display of the menu bar and paused
widget
+ _vbox = gtk_vbox_new(FALSE, 0);
+ gtk_widget_show(_vbox);
+ gtk_container_add(GTK_CONTAINER(_window), _vbox);
#if defined(USE_MENUS) && !defined(GUI_HILDON)
+ if ( ! _xid ) {
createMenuBar();
+ }
#endif
- gtk_box_pack_start(GTK_BOX(_vbox), _drawingArea, TRUE, TRUE, 0);
- }
+ gtk_box_pack_start(GTK_BOX(_vbox), _drawingArea, TRUE, TRUE, 0);
setupEvents();
@@ -305,7 +298,7 @@
// Reparent drawing area from GtkPlug to fullscreen window
gtk_widget_realize(_overlay);
- gtk_widget_reparent(_drawingArea, _overlay);
+ gtk_widget_reparent(_vbox, _overlay);
// Apply key event callbacks to the new window.
setupWindowEvents();
@@ -339,7 +332,7 @@
// Plugin
if (_xid) {
- gtk_widget_reparent (_drawingArea, _window);
+ gtk_widget_reparent (_vbox, _window);
// Apply key event callbacks to the plugin instance.
setupWindowEvents();
@@ -2541,58 +2534,20 @@
GtkGui::stopHook()
{
- // FIXME: this can't work for the stand-alone player, because
- // _drawingArea is
- // packed into a vbox.
- if (! _xid)
- {
- // Assert they're either both initialised or both uninitialised
- assert ((_resumeButton && _vbox) || !(_resumeButton || _vbox));
- if (_resumeButton) {
- gtk_container_add(GTK_CONTAINER(_vbox), _resumeButton);
- }
-
- }
- else
- {
- // Assert they're either both initialised or both uninitialised
- assert ((_resumeButton && _drawingArea) || !(_resumeButton ||
_drawingArea));
-
- if (_drawingArea) {
- gtk_container_remove(GTK_CONTAINER(_window), _drawingArea);
- }
-
- if (_resumeButton) {
- gtk_container_add(GTK_CONTAINER(_window), _resumeButton);
- }
- }
-
+ // Assert they're either both initialised or both uninitialised
+ assert ((_resumeButton && _vbox) || !(_resumeButton || _vbox));
+ if (_resumeButton) {
+ gtk_container_add(GTK_CONTAINER(_vbox), _resumeButton);
+ }
}
void
GtkGui::playHook()
{
- // FIXME: this can't work for the stand-alone player, because _drawingArea
is
- // packed into a vbox.
- if (! _xid)
- {
- if (_resumeButton) {
- gtk_container_remove(GTK_CONTAINER(_vbox), _resumeButton);
- }
- }
- else
- {
- // Assert they're either both initialised or both uninitialised
- assert ((_resumeButton && _drawingArea) || !(_resumeButton ||
_drawingArea));
-
- if (_resumeButton) {
- gtk_container_remove(GTK_CONTAINER(_window), _resumeButton);
- }
- if (_drawingArea) {
- gtk_container_add(GTK_CONTAINER(_window), _drawingArea);
- }
- }
-
+ assert ((_resumeButton && _vbox) || !(_resumeButton || _vbox));
+ if (_resumeButton) {
+ gtk_container_remove(GTK_CONTAINER(_vbox), _resumeButton);
+ }
}
} // end of namespace gnash
=== modified file 'gui/gui.cpp'
--- a/gui/gui.cpp 2008-11-18 12:24:43 +0000
+++ b/gui/gui.cpp 2008-11-18 15:10:31 +0000
@@ -1071,6 +1071,15 @@
os << "SWF " << vm.getSWFVersion();
topIter = tr->insert(topIter, StringPair("VM version", os.str()));
+ // This short-cut is to avoid a bug in movie_root's getMovieInfo,
+ // which relies on the availability of a _rootMovie for doing
+ // it's work, while we don't set it if we didn't start..
+ //
+ if ( ! _started )
+ {
+ topIter = tr->insert(topIter, StringPair("Stage properties", "not
constructed yet"));
+ return tr;
+ }
movie_root& stage = vm.getRoot();
stage.getMovieInfo(*tr, topIter);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r10295: Always use a vertical box for the gnash window, embedded or not.,
Sandro Santilli <=