Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
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 96 of file drag-relocate-controller.hpp.

Public Member Functions

 DragRelocateController ()
 

Private Types

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

Private Member Functions

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

Private Attributes

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

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ DragRelocateController()

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

Member Typedef Documentation

◆ Observer

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

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

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 110 of file drag-relocate-controller.hpp.

References Subject::exposeWidget(), DragRelocateController::maybeActivate(), ON_EXCEPTION_RETURN, and DragRelocateController::watchButton().

+ Here is the call graph for this function:

◆ watchButton()

bool watchButton ( GdkEventButton *  button_event)
inlineprivatenoexcept

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

References DragRelocateController::buttonPressed_, DragRelocateController::doCompleteGesture(), DragRelocateController::isActive(), and DragRelocateController::resetState().

Referenced by DragRelocateController::linkTrigger().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maybeActivate()

bool maybeActivate ( Symbol  cmdID,
Subject subject,
GdkEventMotion *  motion_event 
)
inlineprivate

Gesture detection state logic.

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

References DragRelocateController::anchor(), DragRelocateController::buttonPressed_, DragRelocateController::doTrackGesture(), DragRelocateController::initGestureTracking(), DragRelocateController::isActive(), DragRelocateController::isAnchored(), and DragRelocateController::probeActivation().

Referenced by DragRelocateController::linkTrigger().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isActive()

bool isActive ( )
inlineprivate

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

References DragRelocateController::isInFormation_, and DragRelocateController::subject_.

Referenced by DragRelocateController::maybeActivate(), and DragRelocateController::watchButton().

+ Here is the caller graph for this function:

◆ isAnchored()

bool isAnchored ( )
inlineprivate

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

References DragRelocateController::subject_.

Referenced by DragRelocateController::maybeActivate().

+ Here is the caller graph for this function:

◆ anchor()

void anchor ( Symbol  cmdID,
Subject subject,
GdkEventMotion *  motion_event 
)
inlineprivate

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

References DragRelocateController::anchorX_, and DragRelocateController::anchorY_.

Referenced by DragRelocateController::maybeActivate().

+ Here is the caller graph for this function:

◆ probeActivation()

void probeActivation ( GdkEventMotion *  motion_event)
inlineprivate

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

References DragRelocateController::anchorX_, DragRelocateController::anchorY_, and DragRelocateController::isInFormation_.

Referenced by DragRelocateController::maybeActivate().

+ Here is the caller graph for this function:

◆ initGestureTracking()

void initGestureTracking ( Symbol  cmdID,
Subject subject 
)
inlineprivate

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

References Subject::buildGestureObserver(), and DragRelocateController::observer_.

Referenced by DragRelocateController::maybeActivate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doTrackGesture()

void doTrackGesture ( GdkEventMotion *  motion_event)
inlineprivate

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

References DragRelocateController::anchorX_, and DragRelocateController::anchorY_.

Referenced by DragRelocateController::maybeActivate().

+ Here is the caller graph for this function:

◆ doCompleteGesture()

void doCompleteGesture ( )
inlineprivate

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

References DragRelocateController::observer_.

Referenced by DragRelocateController::watchButton().

+ Here is the caller graph for this function:

◆ resetState()

void resetState ( )
inlineprivate

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

References DragRelocateController::anchorX_, DragRelocateController::anchorY_, DragRelocateController::isInFormation_, DragRelocateController::observer_, InPlaceBuffer< BA, siz, DEFAULT >::reset(), and DragRelocateController::subject_.

Referenced by DragRelocateController::watchButton().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ buttonPressed_

bool buttonPressed_ = false
private

◆ subject_

◆ isInFormation_

◆ anchorX_

◆ anchorY_

◆ observer_

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

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