Lumiera
0.pre.03
»edit your freedom«
|
#include "stage/model/tangible.hpp"
Interface common to all UI elements of relevance for the Lumiera application.
Any non-local and tangible interface interaction will at some point pass through this foundation element, which forms the joint and attachment to the UI backbone, which is the UI-Bus. Any tangible element acquires a distinct identity and has to be formed starting from an already existing bus nexus.
NonCopyable
for good reason: the UI-Bus Nexus adds a direct reference into the routing table, tied to the given Tangible's ID (identity. Consequently you must not store tangibles in STL containers, since these might re-allocate and thus change the location in memory. Definition at line 156 of file tangible.hpp.
Public Types | |
using | ID = ctrl::BusTerm::ID |
using | LuidH = lib::hash::LuidH |
Public Member Functions | |
virtual | ~Tangible () |
this is an interface | |
virtual void | buildMutator (lib::diff::TreeMutator::Handle)=0 |
build a custom implementation of the TreeMutator interface, suitably wired to cause appropriate changes to the opaque data structure, in accordance to the semantics of the tree diff language. More... | |
void | clearErr () |
invoke the hook to clear error markers More... | |
void | clearMsg () |
invoke the hook to clear notification messages More... | |
ID | getID () const |
void | installExpander (Expander::ProbeFun, Expander::ChangeFun) |
Configure the (optional) functionality to expand or collapse the UI-Element. More... | |
void | installRevealer (Revealer::RevealeItFun) |
Configure the (optional) functionality to bring the UI-Element into sight. More... | |
template<typename... ARGS> | |
void | invoke (Symbol cmdID, ARGS &&...) |
void | invoke (Symbol cmdID, Rec &&arguments) |
Perform a command or action, once the execution context has been established. More... | |
template<typename... ARGS> | |
void | invoke (Symbol cmdID, ARGS &&... args) |
convenience shortcut to issue a command with several arguments | |
void | mark (GenNode const &) |
generic handler for all incoming "state mark" messages | |
void | markErr (string error) |
push an error state tag to the element More... | |
void | markFlash () |
highlight the element visually to catch the user's attention More... | |
void | markMsg (string message) |
push a notification (or warning) message to the element. More... | |
operator LuidH () const | |
operator string () const | |
diagnostic representation. More... | |
void | reset () |
invoke the generic reset hook More... | |
void | slotCollapse () |
Collapse or minimise this element and remember the collapsed state. More... | |
void | slotExpand () |
Expand this element and remember the expanded state. More... | |
void | slotReveal () |
Cause the element to be brought into sight. More... | |
Public Member Functions inherited from DiffMutable | |
virtual | ~DiffMutable () |
this is an interface | |
Friends | |
constexpr size_t | treeMutatorSize (const Tangible *) |
override default size traits for diff application. More... | |
Protected Types | |
using | GenNode = lib::diff::GenNode |
using | Rec = lib::diff::Rec |
Protected Member Functions | |
Tangible (ID identity, ctrl::BusTerm &nexus) | |
virtual bool | doClearErr ()=0 |
virtual bool | doClearMsg ()=0 |
virtual bool | doErr (string)=0 |
virtual bool | doExpand (bool yes) |
generic default implementation of the expand/collapse functionality. More... | |
virtual void | doFlash ()=0 |
virtual void | doMark (GenNode const &)=0 |
default implementation and catch-all handler for receiving »state mark« messages. More... | |
virtual bool | doMsg (string)=0 |
virtual bool | doReset ()=0 |
virtual void | doReveal () |
generic default implementation of the "reveal" functionality. More... | |
Protected Attributes | |
Expander | expand_ |
Revealer | reveal_ |
ctrl::BusTerm | uiBus_ |
Additional Inherited Members | |
Private Member Functions inherited from NonCopyable | |
NonCopyable (NonCopyable const &)=delete | |
NonCopyable & | operator= (NonCopyable const &)=delete |
operator string | ( | ) | const |
diagnostic representation.
Definition at line 44 of file tangible.cpp.
void reset | ( | ) |
invoke the generic reset hook
true
from this doReset()
hook. As a consequence, a new "reset" state mark is emitted, which causes the PresentationStateManager to discard any state previously recorded for this element. Definition at line 65 of file tangible.cpp.
References BusTerm::note().
Referenced by Tangible::doMark().
void clearMsg | ( | ) |
invoke the hook to clear notification messages
Definition at line 98 of file tangible.cpp.
References BusTerm::note().
Referenced by Tangible::doMark().
void clearErr | ( | ) |
invoke the hook to clear error markers
true
in case any actual (sticky) error state has been cleared. Again, this causes emitting of a "resetErr" state mark, which will purge any sticky error state remembered within the state manager. Definition at line 87 of file tangible.cpp.
References BusTerm::note().
Referenced by Tangible::doMark().
Perform a command or action, once the execution context has been established.
After binding (and recording) the command arguments, as supplied with the record, the command action is executed right away.
cmdID | indicates the global command definition to be invoked |
arguments | suitable tuple of values, to be used to outfit the prototype |
Definition at line 242 of file tangible.cpp.
References BusTerm::act().
void slotExpand | ( | ) |
Expand this element and remember the expanded state.
This is a generic Slot to connect UI signals against.
true
, the state change is deemed relevant and persistent, and thus a "state mark" is sent on the UI-Bus. Definition at line 161 of file tangible.cpp.
References Tangible::doExpand(), and BusTerm::note().
Referenced by BusTerm_test::clearStates(), AbstractTangible_test::markState(), and AbstractTangible_test::revealer().
void slotCollapse | ( | ) |
Collapse or minimise this element and remember the collapsed state.
This is a generic Slot to connect UI signals against.
Definition at line 173 of file tangible.cpp.
References Tangible::doExpand(), and BusTerm::note().
Referenced by AbstractTangible_test::markState().
void slotReveal | ( | ) |
Cause the element to be brought into sight.
This is a generic Slot to connect UI signals against; the same action can also be triggered by sending a mark message over the UI-Bus with the symbol "`reveal`".
Definition at line 213 of file tangible.cpp.
References Tangible::doReveal().
Referenced by AbstractTangible_test::revealer().
void markFlash | ( | ) |
highlight the element visually to catch the user's attention
Definition at line 110 of file tangible.cpp.
void markMsg | ( | string | message | ) |
push a notification (or warning) message to the element.
message | notification text |
Definition at line 130 of file tangible.cpp.
References BusTerm::note().
Referenced by Tangible::mark().
void markErr | ( | string | error | ) |
push an error state tag to the element
Definition at line 141 of file tangible.cpp.
References BusTerm::note().
Referenced by Tangible::mark().
|
inline |
Configure the (optional) functionality to expand or collapse the UI-Element.
detectCurrExpansionState | a lambda or function<bool()> to retrieve if the element is currently expanded |
howto_expand_collapse | a lambda or function<void(bool)> to switch the element's expansion state |
Definition at line 273 of file tangible.hpp.
Referenced by MockElm::buildMutator(), and NotificationHub::doMark().
|
inline |
Configure the (optional) functionality to bring the UI-Element into sight.
how_to_uncover_the_element | a lambda or function<void()> to actually cause the necessary actions. |
Definition at line 288 of file tangible.hpp.
Referenced by NotificationHub::doMark(), and AbstractTangible_test::revealer().
|
protectedvirtual |
generic default implementation of the expand/collapse functionality.
Based on the #expand_ functor, which needs to be configured explicitly to enable this functionality.
true
if the actual expansion state has been changed. Reimplemented in MockElm.
Definition at line 187 of file tangible.cpp.
Referenced by Tangible::doMark(), Tangible::slotCollapse(), and Tangible::slotExpand().
|
protectedvirtual |
generic default implementation of the "reveal" functionality.
Based on the #reveal_ functor, which needs to be configured explicitly to enable this functionality.
Reimplemented in MockElm.
Definition at line 225 of file tangible.cpp.
Referenced by Tangible::doMark(), and Tangible::slotReveal().
|
protectedpure virtual |
default implementation and catch-all handler for receiving »state mark« messages.
Such messages serve either to cause a presentation state effect specific to this element, or they are used to re-play a former state change to restore some specific UI state captured within a past working session. Events handled here:
bool
argument calls the doExpand(bool)
virtual function. It is up to the concrete element to give this a tangible meaning, e.g. a track might switch to detail view and a clip might reveal attached effects.doReset()
doReveal(myID)
on this parent. For instance, a clip might ask the enclosing track, which in turn might call the enclosing timeline display for help, resulting in a scroll action to bring the clip into sight. Implemented in MockElm, NotificationHub, Controller, and Widget.
Definition at line 286 of file tangible.cpp.
References Tangible::clearErr(), Tangible::clearMsg(), Tangible::doExpand(), Tangible::doReveal(), BusTerm::note(), and Tangible::reset().
Referenced by Controller::doMark(), and Tangible::mark().
|
pure virtual |
build a custom implementation of the TreeMutator interface, suitably wired to cause appropriate changes to the opaque data structure, in accordance to the semantics of the tree diff language.
buffer | a buffer handle, which can be used to placement-construct |
Implements DiffMutable.
Implemented in TrackPresenter, MockElm, ClipPresenter, InteractionDirector, TimelineController, RulerTrack, NotificationHub, AssetController, and MarkerWidget.
|
friend |
override default size traits for diff application.
Definition at line 229 of file tangible.hpp.