diff --git a/src/gui/id-scheme.hpp b/src/gui/id-scheme.hpp index 15366d689..8e39c7275 100644 --- a/src/gui/id-scheme.hpp +++ b/src/gui/id-scheme.hpp @@ -112,7 +112,7 @@ namespace gui { ///////////////////////////////////////////////////////////////////////////////////////////TICKET #1105 : consider use of a DSL to configure component view access // - // count = onePerWindow + // alloc = onePerWindow // locate = within(InfoBoxPanel) }; @@ -121,14 +121,14 @@ namespace gui { // Timeline // add to group of timelines within the timelinePanel -count = unlimited +alloc = unlimited locate = panel(timeline) // Viewer // here multiple alternatives are conceivable // - allow only a single view instance in the whole application -count = onlyOne +alloc = onlyOne locate = external(beamer) or perspective(mediaView), panel(viewer) or existingPanel(viewer) @@ -136,7 +136,7 @@ locate = external(beamer) // - allow two viewer panels (the standard layout of editing applications) -count = limitPerWindow(2) +alloc = limitPerWindow(2) locate = perspective(edit), existingPanel(viewer) or currentWindow, existingPanel(viewer) or existingPanel(viewer) @@ -145,7 +145,7 @@ locate = perspective(edit), existingPanel(viewer) // (Asset)Bin // within the dedicated asset panel, add to the appropriate group for the kind of asset -count = unlimited +alloc = unlimited locate = currentWindow, perspective(edit), existingPanel(asset), existingGroup or perspective(asset), panel(asset) or firstWindow, panel(asset) @@ -153,7 +153,7 @@ locate = currentWindow, perspective(edit), existingPanel(asset), existingGroup // Error-Log // use the current {{{InfoBoxPanel}}} if such exists, fall back to using a single view on the primary window -count = limitPerWindow(1) +alloc = limitPerWindow(1) locate = currentWindow, existingPanel(infobox) or firstWindow, panel(infobox) diff --git a/src/gui/interact/view-spec-dsl.hpp b/src/gui/interact/view-spec-dsl.hpp index 4f55e2c9c..2734f6280 100644 --- a/src/gui/interact/view-spec-dsl.hpp +++ b/src/gui/interact/view-spec-dsl.hpp @@ -23,24 +23,25 @@ /** @file view-spec-dsl.hpp ** A framework for configuration of view access and allocation patterns. - ** Component views are building blocks of the Lumiera UI, and may, depending on their, - ** be instantiated or allocated according to specific rules and patterns. And these might - ** vary in accordance to the desired working style. To give a typical example, at times it - ** might be mandatory to use a single, external output for all kind of media playback, while + ** Component views are building blocks of the Lumiera UI, and may, depending on their + ** type, be instantiated or allocated according to specific rules and patterns. And these + ** might vary in accordance to the desired working style. To give a typical example, at times + ** it might be mandatory to use a single, external output for all kind of media playback, while ** other users prefer the classical editing application layout with two media viewers side by ** side. And yet another working style would be to use a stack of media viewers allocated on ** demand in MRU-fashion. ** ** To specify those standard behaviour patterns, we provide a small internal DSL to spell out ** the default configuration in a (hopefully) self explanatory way. - ** @todo as of 9/2017, the intention to open this configuration DSL for some kind of - ** user provided flexible configuration of screen layouts eventually; right now + ** @todo as of 9/2017, we confirm the intention to open this configuration DSL for some kind + ** of user provided flexible configuration of screen layouts eventually; yet right now, ** only the foundation for this flexible configuration is provided while the defaults - ** are compiled in hard wired. + ** are to be compiled into the UI as hard wired constants. + ** ** ** # Allocation of UI component views ** - ** Here, Allocation means + ** Within this context, _Allocation_ means... ** - to constitute the desired element's identity ** - to consider multiplicity and possibly retrieve an existing instance ** - to determine the hosting location @@ -58,8 +59,8 @@ ** and thus allow to manage them like child objects. Operating on top of these primitive operations, ** the _configuration of view access patterns_ creates a flexible binding layer, which isolates the ** users of component views (typically other parts of the UI) from the actual mechanics of locating. - ** While the client just retrieves a view instance, a dedicate _allocation logic_ ensures this view - ** instance is placed at the desired place within the UI and manages the active view instances. + ** While the client just retrieves a view instance, a dedicated _allocation logic_ ensures this view + ** instance is actually placed at the desired place within the UI, and manages active view instances. ** ** ## Configuration DSL ** @@ -133,7 +134,7 @@ namespace interact { UNIMPLEMENTED ("build a view spec from explicitly given UI coordinates"); } - /** shortcut to allow initialisation from UI-Coordintate builder expressiong */ + /** shortcut to allow initialisation from UI-Coordinate builder expression */ ViewSpec(UICoord::Builder&& coordinates) : ViewSpec{UICoord(std::move (coordinates))} { } @@ -159,6 +160,17 @@ namespace interact { }; + /** + * A specification to describe the strategy for allocating (placing, retrieving) a component view. + * On a DSL-technical level, AllocSpec is a _function generator_: it produces Allocator entities, + * which in turn are functions to perform the actual allocation. + * @note AllocSpec relies on a specific *convention* how to specify the actual allocation operation: + * - the operation is a two-argument function + * - its first argument is the _work triggering argument_, namely the concrete UI coordinates + * passed to the Allocator, requesting to create or retrieve or claim the view at that location + * - its second argument serves for parametrisation or specialisation of the strategy; it will + * be "baked" into the generated allocator. + */ template class AllocSpec : public std::function diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index ad17b255e..3950e8825 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -1351,7 +1351,7 @@ - + @@ -1396,7 +1396,7 @@ - + @@ -3374,7 +3374,7 @@ - + @@ -3542,7 +3542,7 @@ - + @@ -3555,7 +3555,7 @@ - + @@ -9042,18 +9042,97 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -9412,12 +9491,22 @@ + + + + + + + + + + @@ -9691,7 +9780,28 @@ - + + + + + + + + + + +

+ Alternative: wrap UI-Coord, +

+

+ thin autmentation layer +

+ + +
+ +
+
@@ -9852,6 +9962,9 @@

+ + +
@@ -10033,7 +10146,7 @@
- + @@ -12184,7 +12297,7 @@
- + @@ -18529,9 +18642,9 @@ - - + + @@ -18539,6 +18652,9 @@ + + + @@ -25396,7 +25512,7 @@ - +