Lumiera  0.pre.03
»edit your freedom«
DragRelocateController Class Reference

#include "stage/interact/drag-relocate-controller.hpp"

Description

Gesture controller for dragging objects within the Timeline display.

The gesture to drag an entity is triggered by observing mouse movements while a mouse key and possibly some modifier key is pressed. To recognise this condition, every possible subject for a drag gesture will be wired through the linkTrigger call into this controller. When #detectActivation is fulfilled for one specific subject, the corresponding context data will be tracked as state of the ongoing gesture in formation, maintained within the member fields of this controller.

Todo:
write type comment...
Remarks
  • tracking of signal connections is not relevant here, since this controller is managed by the UI backbone and thus ensured to outlive any event processing.
  • this concrete controller handles all drag-relocate gestures for all widgets
  • the actual Subject (widget) and command are bound into the signal wiring
  • whenever a new gesture possibly starts, we pick up these arguments and store them into the current gesture state within this object's fields.
Todo:
WIP-WIP as of /3/2021 ///////////////////////////////////TODO do we need a translation unit interaction-state.cpp (otherwise delete it!)

Definition at line 105 of file drag-relocate-controller.hpp.

Private Types

using Observer = lib::InPlaceBuffer< GestureObserver, OBSERVER_BUFF_SIZ, InactiveObserver >
 

Private Member Functions

void anchor (Symbol cmdID, Subject &subject, GdkEventMotion *motion_event)
 
void doCompleteGesture ()
 
void doTrackGesture (GdkEventMotion *motion_event)
 
void initGestureTracking (Symbol cmdID, Subject &subject)
 
bool isActive ()
 
bool isAnchored ()
 
void linkTrigger (Subject &subject, Symbol cmdID) override
 Hook up a trigger signal to initiate a specific interaction gesture. More...
 
bool maybeActivate (Symbol cmdID, Subject &subject, GdkEventMotion *motion_event)
 Gesture detection state logic.
 
void probeActivation (GdkEventMotion *motion_event)
 
void resetState ()
 
bool watchButton (GdkEventButton *button_event) noexcept
 

Private Attributes

gdouble anchorX_ = 0.0
 
gdouble anchorY_ = 0.0
 
bool buttonPressed_ = false
 
bool isInFormation_ = false
 
Observer observer_
 
Subjectsubject_ = nullptr
 

Additional Inherited Members

- Protected Member Functions inherited from InteractionState
virtual ~InteractionState ()
 this is an interface
 

Member Function Documentation

◆ linkTrigger()

void linkTrigger ( Subject ,
Symbol  cmdID 
)
inlineoverrideprivatevirtual

Hook up a trigger signal to initiate a specific interaction gesture.

Within the concrete controller implementation for each gesture, the Subject interface shall be used to access an actual widget and to wire this widget's signals to a private implementation function within the concrete gesture controller. The purpose is then to observe this widget and to activate recognition of the gesture when applicable.

Parameters
Subjectthe subject of the interaction gesture; typically implemented by a controller or widget responsible for the UI entity involved.
cmdIDthe actual command to be issued on completion of the interaction
Remarks
typically this contextual information is bound into the signal wiring, meaning that the actual interaction context will be established "late", i.e. only when an actual gesture is about to commence

Implements InteractionState.

Definition at line 119 of file drag-relocate-controller.hpp.

+ Inheritance diagram for DragRelocateController:
+ Collaboration diagram for DragRelocateController:

The documentation for this class was generated from the following file: