diff --git a/src/gui/workspace/global-ctx.hpp b/src/gui/workspace/global-ctx.hpp new file mode 100644 index 000000000..6b87fc96d --- /dev/null +++ b/src/gui/workspace/global-ctx.hpp @@ -0,0 +1,113 @@ +/* + GLOBAL-CTX.hpp - Context of global UI top-level entities + + Copyright (C) Lumiera.org + 2017, Hermann Vosseler + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + + +/** @file global-ctx.hpp + ** Dependency context to hold all the global UI top-level entities. + ** There is a small number of management facilities, responsible for conducting all the + ** global concerns of the Lumiera UI. The circle of these _top level managers_ is quite cohesive, + ** insofar each knows each other and is aware of each others responsibilities. When starting the UI, + ** this global context is established and wired in one shot, any any failure here immediately terminates + ** the UI-Layer. It is the UiManager's responsibility to install this management circle and this task is + ** what effectively brings the UI into operative state. + ** + ** Towards the outside, the interface exposed by these managers is rather narrow; basically the parts + ** comprising the UI are to be wired at startup and expected to react based on events from then on. + ** Shutdown of the GUI is effected by terminating the GTK event loop. Each of the top-level managers + ** serves a distinct purpose and will be addressed through a dedicated API, even by the collaborating + ** other top-level managers. + ** + ** The global UI context is comprised of the following members + ** - connection to the [UI-Bus](\ref ui-bus.hpp) + ** - the UiManager + ** - the InteractionDirector + ** - the WindowList + ** - the HelpController + ** - the Wizzard + ** + ** @see gtk-lumiera.hpp + ** @see ui-bus.hpp + ** @see ui-manager.hpp + ** @see interaction-director.hpp + */ + + +#ifndef GUI_WORKSPACE_GLOBAL_CTX_H +#define GUI_WORKSPACE_GLOBAL_CTX_H + +#include "gui/gtk-lumiera.hpp" +#include "gui/ui-bus.hpp" +#include "gui/workspace/ui-manager.hpp" +#include "gui/workspace/actions.hpp" +#include "gui/workspace/window-list.hpp" +#include "gui/workspace/interaction-director.hpp" + +#include +//#include +//#include + + +namespace gui { +namespace workspace { + + + + /** + * A global circle of top-level UI management facilities. + * Creating an instance of this context makes the Lumiera UI operative. + * All entities installed and wired here are mutually dependent and aware + * of each partner's role; failure to create anyone will terminate the UI. + * + * @remark the UiManager is responsible to install this top-level context + */ + class GlobalCtx + : boost::noncopyable + { + + public: + UiBus& uiBus_; + UiManager& uiManager_; + + InteractionDirector director_; + WindowList windowList_; + Actions actions_; + + + public: + /** + * Establish the top-level UI context of the Lumiera user interface. + */ + GlobalCtx (UiBus& bus, UiManager& manager) + : uiBus_{bus} + , uiManager_{manager} + , director_{*this} + , windowList_{*this} + , actions_{*this} + { } + + private: + }; + + + +}}// namespace gui::workspace +#endif /*GUI_WORKSPACE_GLOBAL_CTX_H*/ diff --git a/src/gui/workspace/ui-manager.cpp b/src/gui/workspace/ui-manager.cpp index d89fa86c6..59bb0b58e 100644 --- a/src/gui/workspace/ui-manager.cpp +++ b/src/gui/workspace/ui-manager.cpp @@ -33,12 +33,9 @@ #include "gui/gtk-lumiera.hpp" #include "gui/config-keys.hpp" -#include "gui/ui-bus.hpp" #include "gui/workspace/ui-manager.hpp" -#include "gui/workspace/actions.hpp" -#include "gui/workspace/window-list.hpp" +#include "gui/workspace/global-ctx.hpp" #include "gui/workspace/workspace-window.hpp" -#include "gui/workspace/interaction-director.hpp" #include "lib/searchpath.hpp" #include "lib/util.hpp" @@ -72,10 +69,7 @@ namespace workspace { UiManager::UiManager (UiBus& bus) : Gtk::UIManager() - , uiBus_{bus} - , director_{new InteractionDirector{bus}} - , windowList_{new WindowList{*this}} - , actions_{new Actions{[this]() ->WorkspaceWindow& { return windowList_->findActiveWindow();}}} + , globals_{new GlobalCtx{bus, *this}} , iconSearchPath_{Config::get (KEY_ICON_PATH)} , resourceSerachPath_{Config::get (KEY_UIRES_PATH)} { diff --git a/src/gui/workspace/ui-manager.hpp b/src/gui/workspace/ui-manager.hpp index d5b016d1d..fd390be90 100644 --- a/src/gui/workspace/ui-manager.hpp +++ b/src/gui/workspace/ui-manager.hpp @@ -62,9 +62,7 @@ namespace workspace { using std::unique_ptr; using std::string; - class Actions; - class WindowList; - class InteractionDirector; + class GlobalCtx; @@ -78,11 +76,8 @@ namespace workspace { : public Gtk::UIManager , boost::noncopyable { - UiBus& uiBus_; - unique_ptr director_; - unique_ptr windowList_; - unique_ptr actions_; + unique_ptr globals_; string iconSearchPath_; string resourceSerachPath_; diff --git a/wiki/renderengine.html b/wiki/renderengine.html index e733e831a..93704541b 100644 --- a/wiki/renderengine.html +++ b/wiki/renderengine.html @@ -2922,7 +2922,7 @@ Applying a diff changes the structure, that is, the structure of the local model Together this means we get a fix up stage after model changes, where the display is re-adjusted to fit the new situation. This works in concert with the [[display manager|TimelineDisplayManager]] representing only those elements as actual widgets, which get a real chance to become visible. This way we can build on the assumption that the actual number of widgets to be managed any time remains so small as to get away with simple linear list processing. It remains to be seen how far this assumption can be pushed -- the problem is that the GTK container components don't support anything beyond such simple linear list processing; there isn't even a call to remove all child widgets of a container in a single pass. -
+
To a large extent, the Lumiera user interface is built around a //backbone structure,// known as the UI-Bus.
 But there are some dedicated top-level entities, collaborating to maintain a consistent application lifecycle
 ;Application
@@ -2942,6 +2942,8 @@ But there are some dedicated top-level entities, collaborating to maintain a con
 ;Notification Façade
 :attachment point for lower layers and anyone in need to "talk to the UI"
 :the GuiNotificationFacade is a LayerSeparationInterface and integrated with Lumiera's interface system
+
+Together, these entities form a cohesive circle of collaborating global managers, known as ''global UI context''; the interplay of these facilities is essentially an implementation detail, insofar there is not much necessity (and only a narrow API) for the rest of the UI to address those directly. Rather, each member of this circle serves a dedicated purpose and is visible to the rest of the application through some kind of service abstraction. For example, the [[interactionDirector|UIInteractionDirector]] is mapped as a top-level model element into the logical model of the UI; typically, other parts of the application address this service through messages via the UI-Bus, while the Interaction Director itself is responsible to create a link between model and interaction state -- a service, which is fulfilled in a transparent way.
 
diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index f4a3271b8..6e2ebeec5 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -1954,11 +1954,13 @@ - + + - + + @@ -1966,8 +1968,26 @@ + + + + + + + + +

+ das verschiebt das Problem nur +

+ + +
- + + + + + @@ -2021,10 +2041,15 @@ - + + + + + +