Lumiera
0.pre.03
»edit your freedom«
|
#include "stage/notification-service.hpp"
Actual implementation of the GuiNotification service within the Lumiera GTK GUI.
Creating an instance of this class automatically registers the interface with the Lumiera Interface/Plugin system and creates a forwarding proxy within the application core to route calls through this interface.
Definition at line 67 of file notification-service.hpp.
Public Member Functions | |
NotificationService (ctrl::BusTerm &upLink, ctrl::UiManager &uiManager) | |
When started, NotificationService connects to the UI-Bus via the provided connection. More... | |
void | displayInfo (NotifyLevel, string const &text) override |
push a user visible notification text | |
void | mark (ID uiElement, GenNode &&) override |
void | markError (ID uiElement, string const &text) override |
void | markNote (ID uiElement, string const &text) override |
void | mutate (ID uiElement, MutationMessage &&) override |
void | triggerGuiShutdown (string const &cause) override |
causes the GUI to shut down unconditionally More... | |
Public Member Functions inherited from GuiNotification | |
virtual void | mark (ID uiElement, GenNode &&stateMark)=0 |
send a generic state mark message to some element | |
virtual void | markError (ID uiElement, string const &text)=0 |
highlight an element in the UI as problem location | |
virtual void | markNote (ID uiElement, string const &text)=0 |
attach an warning or state information element | |
virtual void | mutate (ID uiElement, MutationMessage &&)=0 |
push a diff message up into the user interface. More... | |
Public Member Functions inherited from BusTerm | |
BusTerm (BusTerm &&)=default | |
may be moved, but not copied, due to the embedded identity | |
virtual | ~BusTerm () |
this is an interface More... | |
virtual void | act (GenNode const &command) |
prepare or trigger invocation of a command. More... | |
BusTerm | attach (ID, Tangible &newNode) |
Builder function: establish and wire a new BusTerm. More... | |
virtual bool | change (ID subject, MutationMessage &&diff) |
alter and reshape the designated subject by applying the given diff message. More... | |
ID | getID () const |
virtual bool | mark (ID subject, GenNode const &mark) |
route a state update or notification to the given subject. More... | |
virtual size_t | markAll (GenNode const &mark) |
broadcast a notification message to all currently connected bus terminals. More... | |
virtual void | note (ID subject, GenNode const &mark) |
capture and record a "state mark" for later replay for restoring UI state. More... | |
void | note (GenNode const &mark) |
record state mark from this subject | |
virtual | operator string () const |
Private Types | |
using | ServiceInstanceHandle = lumiera::InstanceHandle< LUMIERA_INTERFACE_INAME(lumieraorg_GuiNotification, 0), GuiNotification > |
Private Member Functions | |
void | dispatchMsg (ID, lib::diff::GenNode &&) |
Private Attributes | |
std::unique_ptr< ctrl::UiDispatcher > | dispatch_ |
ServiceInstanceHandle | serviceInstance_ |
ctrl::UiManager & | uiManager_ |
Additional Inherited Members | |
Public Types inherited from BusTerm | |
using | ID = EntryID const & |
Static Public Attributes inherited from GuiNotification | |
static lib::Depend< GuiNotification > | facade |
static storage for the facade access front-end | |
Protected Types inherited from BusTerm | |
using | EntryID = lib::idi::BareEntryID |
using | Tangible = stage::model::Tangible |
Protected Member Functions inherited from GuiNotification | |
virtual | ~GuiNotification () |
this is an interface | |
Protected Member Functions inherited from BusTerm | |
BusTerm (ID identity, BusTerm &attached_to) | |
bool | isShortCircuit (ID) const noexcept |
virtual BusTerm & | routeAdd (ID, Tangible &) |
virtual void | routeDetach (ID) noexcept |
Protected Attributes inherited from BusTerm | |
EntryID | endpointID_ |
BusTerm & | theBus_ |
NotificationService | ( | ctrl::BusTerm & | upLink, |
ctrl::UiManager & | uiManager | ||
) |
When started, NotificationService connects to the UI-Bus via the provided connection.
This is a simple, unidirectional up-link connection, without actively adding NotificationService into the routing tables in [Nexus]. Yet this simple connection is sufficient to implement this service by talking to other facilities within the UI layer.
Definition at line 300 of file notification-service.cpp.
References NotificationService::displayInfo(), LUMIERA_INTERFACE_REF, and stage::NOTE_ERROR.
|
private |
helper to move a given UI-Bus message (GenNode) into the closure of an event-lambda, which then is handed over to the UI event thread through the dispatcher queue.
Definition at line 86 of file notification-service.cpp.
References BusTerm::mark().
|
overridevirtual |
causes the GUI to shut down unconditionally
cause | user visible explanation of the reason causing this shutdown |
Implements GuiNotification.
Definition at line 147 of file notification-service.cpp.
References cStr(), NotificationService::displayInfo(), stage::NOTE_ERROR, and UiManager::terminateUI().