Lumiera  0.pre.03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
cmd-context.hpp File Reference

Go to the source code of this file.


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 handle changing 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.

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
////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/symbol.hpp"
#include <string>


class  CmdContext
 Abstract foundation of UI state tracking components. More...
struct  CmdContext::Resolver
 Helper for dynamic command argument resolution. More...


 Lumiera GTK UI implementation root.
 UI interaction control.