Lumiera  0.pre.03
»edit your freedom«
cmd-context.hpp File Reference

Go to the source code of this file.

Description

Abstraction: support for binding command invocation into an UI context.

The interact::CmdContext front-end is used when commands need to be bound to a whole context of UI elements rather than to a specific widget – especially for picking up command arguments from interaction state found within that context. To invoke a command, typically it is necessary to prepare a command instance and to pick up and bind command arguments. In most cases, this can be done directly, using a fixed command-ID and locally known argument values. But in the aforementioned special situation, we have to deal with ongoing user interactions, which might span several widgets, where some interaction events just happen to make invocation of a specific command viable. The prototypical example is when some element is dragged around, and, depending on the vicinity, might cause quite different actions when dropped. Such behaviour can be achieved with the help of an intermediary, known as InteractionStateinteraction state manager"". The command context accessor allows to discover a specific InteractionState instance, which

  • is responsible for the specific command to be invoked
  • can handle context information related to a specific control system (e.g mouse, keyboard, hardware controller, pen)
  • might observe changes in contextual state and thus decide if a command can be invoked From the InteractionState instance, it is possible to retrieve a notification when a specific, context-bound command becomes executable by picking up suitable parameter values from this context.
Todo:

as of 3/2017 this is a early design draft and WIP-WIP-WIP

after initial design draft, postponed as of 10/2017

See also
CmdContext_test
////TODO_test usage example

Definition in file cmd-context.hpp.

#include "lib/error.hpp"
#include "lib/nocopy.hpp"
#include "lib/hash-indexed.hpp"
#include "lib/opaque-holder.hpp"
#include "lib/symbol.hpp"
#include <utility>

Classes

class  CmdContext
 Builder to define a binding to relate some entity or place within the UI with a specific from of interaction gesture or context dependent command invocation. More...
 
class  GestureObserver
 Collaboration interface for tracking the formation of a gesture. More...
 
class  InactiveObserver
 »Null Object« when no gesture is being tracked currently. More...
 
struct  CmdContext::Resolver
 Helper for dynamic command argument resolution. More...
 
class  Subject
 Role-Interface: the Subject of Interaction. More...
 

Namespaces

 stage
 Lumiera GTK UI implementation root.
 
 stage::interact
 UI interaction control.