gi-gtk-4.0.5: Gtk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gtk.Objects.GestureDrag

Description

GtkGestureDrag is a GtkGesture implementation for drags.

The drag operation itself can be tracked throughout the GestureDrag::dragBegin, GestureDrag::dragUpdate and GestureDrag::dragEnd signals, and the relevant coordinates can be extracted through gestureDragGetOffset and gestureDragGetStartPoint.

Synopsis

Exported types

class (GObject o, IsDescendantOf GestureDrag o) => IsGestureDrag o Source #

Type class for types which can be safely cast to GestureDrag, for instance with toGestureDrag.

Instances

Instances details
(GObject o, IsDescendantOf GestureDrag o) => IsGestureDrag o Source # 
Instance details

Defined in GI.Gtk.Objects.GestureDrag

toGestureDrag :: (MonadIO m, IsGestureDrag o) => o -> m GestureDrag Source #

Cast to GestureDrag, for types for which this is known to be safe. For general casts, use castTo.

Methods

getOffset

gestureDragGetOffset Source #

Arguments

:: (HasCallStack, MonadIO m, IsGestureDrag a) 
=> a

gesture: a GtkGesture

-> m (Bool, Double, Double)

Returns: True if the gesture is active

Gets the offset from the start point.

If the gesture is active, this function returns True and fills in x and y with the coordinates of the current point, as an offset to the starting drag point.

getStartPoint

gestureDragGetStartPoint Source #

Arguments

:: (HasCallStack, MonadIO m, IsGestureDrag a) 
=> a

gesture: a GtkGesture

-> m (Bool, Double, Double)

Returns: True if the gesture is active

Gets the point where the drag started.

If the gesture is active, this function returns True and fills in x and y with the drag start coordinates, in surface-relative coordinates.

new

gestureDragNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m GestureDrag

Returns: a newly created GtkGestureDrag

Returns a newly created GtkGesture that recognizes drags.

Signals

dragBegin

type GestureDragDragBeginCallback Source #

Arguments

 = Double

startX: X coordinate, relative to the widget allocation

-> Double

startY: Y coordinate, relative to the widget allocation

-> IO () 

Emitted whenever dragging starts.

afterGestureDragDragBegin :: (IsGestureDrag a, MonadIO m) => a -> ((?self :: a) => GestureDragDragBeginCallback) -> m SignalHandlerId Source #

Connect a signal handler for the dragBegin signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after gestureDrag #dragBegin callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onGestureDragDragBegin :: (IsGestureDrag a, MonadIO m) => a -> ((?self :: a) => GestureDragDragBeginCallback) -> m SignalHandlerId Source #

Connect a signal handler for the dragBegin signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on gestureDrag #dragBegin callback

dragEnd

type GestureDragDragEndCallback Source #

Arguments

 = Double

offsetX: X offset, relative to the start point

-> Double

offsetY: Y offset, relative to the start point

-> IO () 

Emitted whenever the dragging is finished.

afterGestureDragDragEnd :: (IsGestureDrag a, MonadIO m) => a -> ((?self :: a) => GestureDragDragEndCallback) -> m SignalHandlerId Source #

Connect a signal handler for the dragEnd signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after gestureDrag #dragEnd callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onGestureDragDragEnd :: (IsGestureDrag a, MonadIO m) => a -> ((?self :: a) => GestureDragDragEndCallback) -> m SignalHandlerId Source #

Connect a signal handler for the dragEnd signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on gestureDrag #dragEnd callback

dragUpdate

type GestureDragDragUpdateCallback Source #

Arguments

 = Double

offsetX: X offset, relative to the start point

-> Double

offsetY: Y offset, relative to the start point

-> IO () 

Emitted whenever the dragging point moves.

afterGestureDragDragUpdate :: (IsGestureDrag a, MonadIO m) => a -> ((?self :: a) => GestureDragDragUpdateCallback) -> m SignalHandlerId Source #

Connect a signal handler for the dragUpdate signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after gestureDrag #dragUpdate callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onGestureDragDragUpdate :: (IsGestureDrag a, MonadIO m) => a -> ((?self :: a) => GestureDragDragUpdateCallback) -> m SignalHandlerId Source #

Connect a signal handler for the dragUpdate signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on gestureDrag #dragUpdate callback