diff --git a/src/gui/gtk-lumiera.cpp b/src/gui/gtk-lumiera.cpp index a6b9c0dbd..c54ecaad3 100644 --- a/src/gui/gtk-lumiera.cpp +++ b/src/gui/gtk-lumiera.cpp @@ -23,12 +23,13 @@ #include "gui/gtk-lumiera.hpp" #include "gui/workspace/ui-manager.hpp" -#include "gui/workspace/workspace-window.hpp" #include "gui/ui-bus.hpp" #include "lib/depend.hpp" #include "include/config-facade.h" +#include + namespace gui { @@ -75,15 +76,4 @@ namespace gui { } - workspace::WindowList& - GtkLumiera::windowManager() /////////////////////////////////////////TICKET #1048 : last Blocker is Actions::onMenu_window_new_window() - { - if (not windowManagerInstance_) - throw error::Logic ("GTK UI is not in running state" - , error::LUMIERA_ERROR_LIFECYCLE); - - return *windowManagerInstance_; - } - - }// namespace gui diff --git a/src/gui/panel/panel.hpp b/src/gui/panel/panel.hpp index 9430b8c1a..0b7b85768 100644 --- a/src/gui/panel/panel.hpp +++ b/src/gui/panel/panel.hpp @@ -32,7 +32,8 @@ namespace gui { namespace workspace { - class PanelManager; + class PanelManager; + class WorkspaceWindow; } namespace panel { diff --git a/src/gui/workspace/actions.cpp b/src/gui/workspace/actions.cpp index b5bb50872..b51cf5462 100644 --- a/src/gui/workspace/actions.cpp +++ b/src/gui/workspace/actions.cpp @@ -55,11 +55,10 @@ using std::vector; namespace gui { namespace workspace { - Actions::Actions (WorkspaceWindow& owner) - : workspaceWindow_(owner) + Actions::Actions (GetWindow how_to_access_current_window) + : getWorkspaceWindow(how_to_access_current_window) , is_updating_action_state(false) { - owner.signal_show ().connect_notify(mem_fun(this, &Actions::updateActionState)); } @@ -251,18 +250,20 @@ namespace workspace { void Actions::updateActionState() { - /*REQUIRE(workspaceWindow.assetsPanel != NULL); - REQUIRE(workspaceWindow.timelinePanel != NULL); - REQUIRE(workspaceWindow.viewerPanel != NULL); + ///////////////////////////////////////////////////////////////////////////////////////TICKET #1076 find out how to handle this properly + /* + WorkspaceWindow& currentWindow = getWorkspaceWindow(); + + REQUIRE(currentWindow.assetsPanel != NULL); + REQUIRE(currentWindow.timelinePanel != NULL); + REQUIRE(currentWindow.viewerPanel != NULL); is_updating_action_state = true; - assetsPanelAction->set_active( - workspaceWindow.assetsPanel->is_shown()); - timelinePanelAction->set_active( - workspaceWindow.timelinePanel->is_shown()); - viewerPanelAction->set_active( - workspaceWindow.viewerPanel->is_shown()); - is_updating_action_state = false;*/ + assetsPanelAction->set_active (currentWindow.assetsPanel->is_shown()); + timelinePanelAction->set_active(currentWindow.timelinePanel->is_shown()); + viewerPanelAction->set_active (currentWindow.viewerPanel->is_shown()); + is_updating_action_state = false; + */ } @@ -285,7 +286,7 @@ namespace workspace { void Actions::onMenu_file_render() { - dialog::Render dialog(workspaceWindow_); ////////////////////////////////////TICKET #1069 how to refer to the _current window_ + dialog::Render dialog(getWorkspaceWindow()); dialog.run(); } @@ -304,7 +305,7 @@ namespace workspace { void Actions::onMenu_edit_preferences() { - dialog::PreferencesDialog dialog(workspaceWindow_); ////////////////////////////////TICKET #1069 how to refer to the _current window_ + dialog::PreferencesDialog dialog(getWorkspaceWindow()); dialog.run(); } @@ -326,7 +327,7 @@ namespace workspace { { /////////////////////////////////////////////////////////////////////////////////////TODO defunct since GTK-3 transition //if(!is_updating_action_state) - // workspaceWindow.timelinePanel->show(timelinePanelAction->get_active()); + // workspaceWindow.timelinePanel->show(timelinePanActionselAction->get_active()); } @@ -344,11 +345,11 @@ namespace workspace { void Actions::onMenu_sequence_add() { - dialog::NameChooser dialog(workspaceWindow_, ////////////////////////////////////TICKET #1069 how to refer to the _current window_ + dialog::NameChooser dialog(getWorkspaceWindow(), _("Add Sequence"), _("New Sequence")); /////////////////////////////////////////////////////////////////////////////////////////TICKET #1070 need a way how to issue session commands // if(dialog.run() == RESPONSE_OK) -// workspaceWindow_.getProject().add_new_sequence(dialog.getName()); +// workspaceWindow().getProject().add_new_sequence(dialog.getName()); } @@ -366,14 +367,14 @@ namespace workspace { void Actions::onMenu_window_new_window() { - GtkLumiera::application().windowManager().newWindow(); +// windowList_.newWindow(); //////////////////////////////////TODO move into UiManager } void Actions::onMenu_window_close_window() { - workspaceWindow_.hide(); + getWorkspaceWindow().hide(); // delete &workspaceWindow; } @@ -381,7 +382,7 @@ namespace workspace { void Actions::onMenu_show_panel(int panel_index) { - workspaceWindow_.getPanelManager().showPanel(panel_index); /////////////////////////TICKET #1069 how to refer to the _current window_ + getWorkspaceWindow().getPanelManager().showPanel(panel_index); } @@ -409,7 +410,7 @@ namespace workspace { dialog.set_website(Config::get (KEY_WEBSITE)); dialog.set_authors(authorsList); - dialog.set_transient_for(workspaceWindow_); + dialog.set_transient_for(getWorkspaceWindow()); // Show the about dialog dialog.run(); diff --git a/src/gui/workspace/actions.hpp b/src/gui/workspace/actions.hpp index 4a1abd3b5..3ffd3efc4 100644 --- a/src/gui/workspace/actions.hpp +++ b/src/gui/workspace/actions.hpp @@ -34,9 +34,13 @@ #include "gui/gtk-lumiera.hpp" +#include + namespace gui { namespace workspace { + using std::function; + class WorkspaceWindow; /** @@ -46,10 +50,12 @@ namespace workspace { class Actions { /**reference to the MainWindow which owns this helper */ - WorkspaceWindow& workspaceWindow_; + using GetWindow = function; + + GetWindow getWorkspaceWindow; public: - Actions (WorkspaceWindow& owner); + Actions (GetWindow how_to_access_current_window); /** * Populates a uiManager with the main set of actions. diff --git a/src/gui/workspace/ui-manager.cpp b/src/gui/workspace/ui-manager.cpp index f163fb66e..6462b00ba 100644 --- a/src/gui/workspace/ui-manager.cpp +++ b/src/gui/workspace/ui-manager.cpp @@ -31,6 +31,7 @@ #include "gui/config-keys.hpp" #include "gui/ui-bus.hpp" #include "gui/workspace/ui-manager.hpp" +#include "gui/workspace/workspace-window.hpp" #include "lib/searchpath.hpp" #include "lib/util.hpp" @@ -59,12 +60,22 @@ namespace workspace { UiManager::UiManager (UiBus& bus) : Gtk::UIManager() , uiBus_(bus) + , windowList_{*this} + , actions_{[this]() ->WorkspaceWindow& { return windowList_.findActiveWindow();}} , iconSearchPath_{Config::get (KEY_ICON_PATH)} , resourceSerachPath_{Config::get (KEY_UIRES_PATH)} { } + + /** + * Initialise the window manager on application start. + * Register the icon configuration and sizes and lookup + * all the icons -- either from the default theme of via + * the given Lumiera icon search paths (see \c setup.ini ). + * @see lumiera::Config + */ void - UiManager::init () + UiManager::initGlobalUI () { Glib::set_application_name (Config::get (KEY_TITLE)); @@ -72,9 +83,30 @@ namespace workspace { registerStockItems(); setTheme (Config::get (KEY_STYLESHEET)); + + actions_.populateMainActions (*this); } + /** + * @remarks this function is invoked once from the main application object, + * immediately prior to starting the GTK event loop. */ + void + UiManager::createApplicationWindow() + { + UNIMPLEMENTED ("create the first top-level window"); + } + + + void + UiManager::updateWindowFocusRelatedActions() + { + UNIMPLEMENTED ("how to handle activation of menu entries depending on window focus"); ////////TICKET #1076 find out how to handle this properly + //////see Actions::updateActionState() + } + + + void UiManager::setTheme (string const& stylesheetName) { @@ -137,6 +169,10 @@ namespace workspace { } + /** + * Registers application stock items: + * icons and labels associated with IDs + */ void UiManager::registerStockItems() { diff --git a/src/gui/workspace/ui-manager.hpp b/src/gui/workspace/ui-manager.hpp index aa43a0201..9a4b6c13d 100644 --- a/src/gui/workspace/ui-manager.hpp +++ b/src/gui/workspace/ui-manager.hpp @@ -36,6 +36,8 @@ #define GUI_WORKSPACE_UI_MANAGER_H #include "gui/gtk-base.hpp" +#include "gui/workspace/actions.hpp" +#include "gui/workspace/window-list.hpp" #include #include @@ -65,11 +67,13 @@ namespace workspace { : public Gtk::UIManager , boost::noncopyable { - string iconSearchPath_; - string resourceSerachPath_; - UiBus& uiBus_; + WindowList windowList_; + Actions actions_; + + string iconSearchPath_; + string resourceSerachPath_; public: @@ -97,14 +101,15 @@ namespace workspace { UiManager (UiBus& bus); /** - * Initialise the window manager on application start. - * Register the icon configuration and sizes and lookup - * all the icons -- either from the default theme of via - * the given Lumiera icon search paths (see \c setup.ini ). - * @see lumiera::Config + * Set up the first top-level application window. + * This triggers the build-up of the user interface widgets. */ - void init (); + void createApplicationWindow(); + /** @todo find a solution how to enable/disable menu entries according to focus + * /////////////////////////////////////////////////TICKET #1076 find out how to handle this properly + */ + void updateWindowFocusRelatedActions(); /** * Sets the theme to use for the Lumiera GUI. @@ -131,15 +136,9 @@ namespace workspace { void allowCloseWindow (bool yes); private: + void initGlobalUI (); - - /** Registers the custom icon sizes. */ void registerAppIconSizes(); - - /** - * Registers application stock items: - * icons and labels associated with IDs - */ void registerStockItems(); /** diff --git a/src/gui/workspace/window-list.cpp b/src/gui/workspace/window-list.cpp index e97fdccd7..0954996c2 100644 --- a/src/gui/workspace/window-list.cpp +++ b/src/gui/workspace/window-list.cpp @@ -66,6 +66,13 @@ namespace workspace { } + WorkspaceWindow& + WindowList::findActiveWindow() + { + UNIMPLEMENTED ("search the window list and return the currently active window"); + } + + bool WindowList::on_window_closed (GdkEventAny* event) { diff --git a/src/gui/workspace/window-list.hpp b/src/gui/workspace/window-list.hpp index f1611b6c1..2ffd91459 100644 --- a/src/gui/workspace/window-list.hpp +++ b/src/gui/workspace/window-list.hpp @@ -73,6 +73,7 @@ namespace workspace { void newWindow (); + WorkspaceWindow& findActiveWindow(); private: diff --git a/src/gui/workspace/workspace-window.cpp b/src/gui/workspace/workspace-window.cpp index 659529393..89267fb01 100644 --- a/src/gui/workspace/workspace-window.cpp +++ b/src/gui/workspace/workspace-window.cpp @@ -44,7 +44,6 @@ namespace workspace { WorkspaceWindow::WorkspaceWindow (UiManager& uiManager) : panelManager_(*this) - , actions_(*this) { createUI (uiManager); } @@ -67,6 +66,9 @@ namespace workspace { void WorkspaceWindow::createUI (UiManager& uiManager) { + signal_show ().connect_notify(mem_fun(uiManager, &UiManager::updateWindowFocusRelatedActions)); ///////////////TICKET #1076 find out how to handle this properly + add_accel_group (uiManager.get_accel_group()); + // RTL Test Code //set_default_direction (TEXT_DIR_RTL); @@ -77,10 +79,7 @@ namespace workspace { //----- Set up the UI Manager -----// // The UI will be nested within a VBox add (baseContainer_); - - actions_.populateMainActions (uiManager); - add_accel_group (uiManager.get_accel_group()); - + //----- Set up the Menu Bar -----// Gtk::Widget* menu_bar = uiManager.get_widget ("/MenuBar"); REQUIRE (menu_bar != NULL); diff --git a/src/gui/workspace/workspace-window.hpp b/src/gui/workspace/workspace-window.hpp index c097e6c13..54137e5dd 100644 --- a/src/gui/workspace/workspace-window.hpp +++ b/src/gui/workspace/workspace-window.hpp @@ -49,6 +49,7 @@ namespace gui { namespace workspace { + class UiManager; /** @@ -58,7 +59,7 @@ namespace gui { : public Gtk::Window { public: - WorkspaceWindow(gui::workspace::UiManager&); + WorkspaceWindow (UiManager&); ~WorkspaceWindow(); PanelManager& getPanelManager(); @@ -77,12 +78,6 @@ namespace gui { //----- Status Bar -----// Gtk::Statusbar statusBar_; - - /** - * Helper to build the menu and for - * registering and handling of user action events - */ - Actions actions_; }; diff --git a/wiki/renderengine.html b/wiki/renderengine.html index fa3e075fe..a75f908d1 100644 --- a/wiki/renderengine.html +++ b/wiki/renderengine.html @@ -2780,9 +2780,14 @@ This treatment ensures each nested diff is consumed within a properly typed cont → this is the purpose of the {{{DataCap}}} within our [[generic node element|GenNode]] -
+
LayerSeparationInterface provided by the GUI.
-Access point for the lower layers to push information and state changes (aynchronously) to the GUI. Actually, most operations within Lumiera are initiated by the user through the GUI. In the course of such actions, the GUI uses the services of the lower layer and typically recieves an synchronous response. In some exceptional cases, these operations may cause additional changes to happen asynchronously from the GUI's perspective. For example, an edit operation might trigger a re-build of the low-level model, which then detects an error.
+Access point for the lower layers to push information and state changes (asynchronously) to the GUI. Most operations within Lumiera are in fact initiated by the user through the GUI. In the course of such actions, the GUI uses the services of the lower layer and typically receives an immediate synchronous response to indicate the change was noted. Yet often, these operations may cause additional changes to happen asynchronously from the GUI's perspective. For example, an edit operation might trigger a re-build of the low-level model, which then detects an error. Any such consequences and notifications can be "cast" up into the UI, using this service here.
+
+Beyond that, a call to trigger shutdown of the UI layer is also exposed here.
+
+!Addressing of UI elements
+Most calls in this interface require to specify a receiver or target, in the form of an element ID. It is assumed the caller effectively just knows these IDs, typically because the same IDs are also used as element IDs for the corresponding session entities. And, to start with, the whole UI representation of the session was at some point generated by //population diff messages,// which used the same IDs to indicate the creation of the corresponding UI representation elements.
 
diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index dcad8f44e..d4fb456bc 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -1664,18 +1664,25 @@ - - - + + + + - - - + + + + + + + + + @@ -1711,6 +1718,9 @@ + + + @@ -1744,7 +1754,7 @@ - + @@ -1755,6 +1765,7 @@

+
@@ -1826,7 +1837,8 @@ - + + @@ -1838,9 +1850,21 @@ + + + + + + + + + + + + @@ -1909,7 +1933,9 @@ - + + +