37#ifndef STAGE_INTERACT_DRAG_RELOCATE_CONTROLLER_H
38#define STAGE_INTERACT_DRAG_RELOCATE_CONTROLLER_H
112 REQUIRE (not isnil (cmdID));
114 widget.signal_button_press_event().connect(
116 widget.signal_button_release_event().connect(
118 widget.signal_motion_notify_event().connect(
119 [&, cmdID](GdkEventMotion* motion) ->
bool
130 REQUIRE (button_event);
131 if (GDK_BUTTON_PRESS == button_event->type)
134 if (GDK_BUTTON_RELEASE == button_event->type)
141 std::cerr <<
_Fmt{
"BUTT %s flag=%d"} %
buttonPressed_ % button_event->type << std::endl;
151 REQUIRE (motion_event);
152 std::cerr <<
_Fmt{
"MOVE x=%3.1f y=%3.1f subject=%s"}
153 % motion_event->x_root
154 % motion_event->y_root
158 anchor (cmdID, subject, motion_event);
191 REQUIRE (motion_event);
192 this->subject_ = & subject;
193 this->anchorX_ = motion_event->x_root;
194 this->anchorY_ = motion_event->y_root;
195 std::cerr <<
_Fmt{
"ANCHOR at x=%3.1f y=%3.1f ('%s')"}
206 or DISTANCE_THRESHOLD < abs (motion_event->y_root -
anchorY_);
218 REQUIRE (motion_event);
219 gdouble deltaX = motion_event->x_root - this->
anchorX_;
220 gdouble deltaY = motion_event->y_root - this->
anchorY_;
222 observer_->updateOffset (deltaX, deltaY);
PlantingHandle< GestureObserver, InactiveObserver > Handle
a "planting handle" can be used to expose an opaque InPlaceBuffer through an API
Token or Atom with distinct identity.
Gesture controller for dragging objects within the Timeline display.
void linkTrigger(Subject &subject, Symbol cmdID) override
Hook up a trigger signal to initiate a specific interaction gesture.
bool watchButton(GdkEventButton *button_event) noexcept
void initGestureTracking(Symbol cmdID, Subject &subject)
void anchor(Symbol cmdID, Subject &subject, GdkEventMotion *motion_event)
bool maybeActivate(Symbol cmdID, Subject &subject, GdkEventMotion *motion_event)
Gesture detection state logic.
void probeActivation(GdkEventMotion *motion_event)
void doTrackGesture(GdkEventMotion *motion_event)
Abstract foundation for context dependent UI interactions.
Role-Interface: the Subject of Interaction.
virtual void buildGestureObserver(Symbol cmdID, Buffer)=0
prompt the Subject to build an Observer for the gesture in formation
virtual Gtk::Widget & exposeWidget()=0
the exposed widget can be used for wiring signal handlers
A front-end for using printf-style formatting.
Abstraction: support for binding command invocation into an UI context.
#define ON_EXCEPTION_RETURN(_VAL_, _OP_DESCR_)
convenience shortcut to catch and absorb any exception, then returning a default value instead.
A set of basic GTK includes for the UI.
Abstraction: a component to watch, maintain and guide UI state.
const gdouble DISTANCE_THRESHOLD
const size_t OBSERVER_BUFF_SIZ
heuristics for sizing the inline buffer where the Subject will construct its Observer/Adapter
Lumiera GTK UI implementation root.
bool isnil(lib::time::Duration const &dur)
Mix-Ins to allow or prohibit various degrees of copying and cloning.
Helper allowing type erasure while holding the actual object inline.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...