diff --git a/src/gui/model/tangible.hpp b/src/gui/model/tangible.hpp index 61573d007..f9185dbd3 100644 --- a/src/gui/model/tangible.hpp +++ b/src/gui/model/tangible.hpp @@ -101,7 +101,7 @@ ** This interaction also implies, that the element automatically detaches itself at end of life. ** - **act**: send a \ref GenNode representing the action ** - **note**: _send_ a GenNode representing the _state mark_ - ** - **mark**: _receive_ a GenNode representing the _feedback_ or a replayed _state mark_ + ** - **mark**: _receive_ a GenNode representing the _feedback,_ a replayed _state mark_ or _generic message._ ** - **diff**: ask to retrieve a diff, which ** - either is an incremental status update ** - or is a from-scratch reconfiguration diff --git a/src/gui/ui-bus.hpp b/src/gui/ui-bus.hpp index 9aacb28d0..e9fa4afd4 100644 --- a/src/gui/ui-bus.hpp +++ b/src/gui/ui-bus.hpp @@ -66,17 +66,21 @@ ** directed towards individual elements. The interactions at the bus are closely interrelated ** with the [elementary UI-Element operations](tangible.hpp). ** - ** - **act**: send a [GenNode] representing the action + ** - *act*: send a [GenNode] representing the action ** - in a first step, a command prototype is [outfitted](\ref InvocationTrail::bind()) with actual ** parameter values. -> see [InvocationTrail] ** - the actual command invocation is triggered by a ["bang" message](\ref InvocationTrail::bang()) - ** - **note**: send a [GenNode] representing the _state mark;_ + ** - *note*: send a [GenNode] representing the _state mark;_ ** some (abstracted) presentation state manager is expected to listen to these messages, ** possibly recording state to be restored later. The contents of the _state mark_ message ** are implementation defined; knowledge about these is shared between individual widget ** implementations and (partially, to some degree) the presentation state manager. - ** - **mark**: down-link communication to _feed back_ state updates or - ** to replay previously recorded _state marks_ + ** - *mark*: down-link communication to _feed back_ state updates or + ** to replay previously recorded _state marks._ + ** + ** @note The *mark* verb can also be used as an (future) extension point to send _generic messages_ -- + ** possibly even to broadcast them to interested subjects, which have been registered with the + ** \ref Nexus as targeted receivers... ** ** @warning deliberately the UI-Bus is **not threadsafe**. ** Only [Tangible] elements performing in the UI-event thread are allowed to talk to the bus. diff --git a/src/gui/workspace/window-manager.cpp b/src/gui/workspace/window-manager.cpp index dfcc9902a..04143ea91 100644 --- a/src/gui/workspace/window-manager.cpp +++ b/src/gui/workspace/window-manager.cpp @@ -30,7 +30,6 @@ using util::cStr; using std::list; -using std::shared_ptr; namespace gui { @@ -39,20 +38,21 @@ namespace workspace { WindowManager::WindowManager (UiManager& uiManager) - : uiManager_(uiManager) + : uiManager_{uiManager} + , windowList_{} { } void WindowManager::newWindow (gui::model::Project& source_project, gui::controller::Controller& source_controller) { - shared_ptr window (new WorkspaceWindow{uiManager_, source_project, source_controller}); + PWindow window (new WorkspaceWindow{uiManager_, source_project, source_controller}); REQUIRE(window); window->signal_delete_event().connect(sigc::mem_fun( this, &WindowManager::on_window_closed)); - windowList.push_back(window); + windowList_.push_back(window); window->show(); @@ -66,11 +66,11 @@ namespace workspace { REQUIRE(event); REQUIRE(event->window); - list>::iterator iterator{windowList.begin()}; + list::iterator iterator{windowList_.begin()}; - while (iterator != windowList.end()) + while (iterator != windowList_.end()) { - shared_ptr workspace_window(*iterator); + PWindow workspace_window(*iterator); REQUIRE(workspace_window); Glib::RefPtr window = workspace_window->get_window(); @@ -78,13 +78,13 @@ namespace workspace { if (window->gobj() == event->window) { // This window has been closed - iterator = windowList.erase(iterator); + iterator = windowList_.erase(iterator); } else iterator++; } - if (windowList.empty()) + if (windowList_.empty()) { // All windows have been closed - we should exit Gtk::Main *main = Gtk::Main::instance(); ////////////////////////////////////////////////TICKET #1032 : use gtk::Application instead of gtk::Main @@ -102,7 +102,7 @@ namespace workspace { void WindowManager::updateCloseWindowInMenus() { - uiManager_.allowCloseWindow ( 1 < windowList.size()); + uiManager_.allowCloseWindow ( 1 < windowList_.size()); } diff --git a/src/gui/workspace/window-manager.hpp b/src/gui/workspace/window-manager.hpp index 157952ae4..612b38811 100644 --- a/src/gui/workspace/window-manager.hpp +++ b/src/gui/workspace/window-manager.hpp @@ -22,14 +22,13 @@ /** @file window-manager.hpp - ** Manager for all application windows and resources. - ** This file defines the global UI Manager class. The central WindowManager - ** instance is owned by the GtkLumiera object and initialised in GTK-main. - ** The WindowManager has the ability to create new windows integrated with - ** the application framework, to provide Icons and other resources and - ** to set and access a general UI theme. + ** Manager for all top level application windows. + ** The central WindowManager instance is owned by the GtkLumiera object and + ** initialised in GTK-main. The WindowManager allows to create new windows + ** integrated with the application framework. ** ** @see gtk-lumiera.hpp + ** @see ui-manager.hpp */ @@ -39,9 +38,8 @@ #include "gui/gtk-base.hpp" #include -#include -#include #include +#include namespace gui { @@ -54,28 +52,30 @@ namespace workspace { class UiManager; class WorkspaceWindow; - using std::shared_ptr; - using std::string; + using std::list; /** - * The centralised manager of all the windows, - * icons and resources within Lumiera's GUI. + * A centralised manager of all top level application windows. */ class WindowManager : boost::noncopyable { - UiManager& uiManager_; + using PWindow = shared_ptr; + + UiManager& uiManager_; + list windowList_; public: WindowManager (UiManager&); /** - * Creates a new window connected to a specified project and controller + * Create a new window connected to a specified project and controller * @param source_project The project to connect the window to. * @param source_controller The controller to connect the window to. + * @todo better way to connect to the model ////////////////////////////////////////////////////TICKET #1048 : rectify UI lifecycle */ void newWindow (gui::model::Project&, gui::controller::Controller&); @@ -84,7 +84,7 @@ namespace workspace { private: /** Event handler for when a window has been closed */ - bool on_window_closed(GdkEventAny* event); + bool on_window_closed (GdkEventAny* event); /** @@ -100,8 +100,6 @@ namespace workspace { private: - std::list> windowList; - };