Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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
- newtype GestureDrag = GestureDrag (ManagedPtr GestureDrag)
- class (GObject o, IsDescendantOf GestureDrag o) => IsGestureDrag o
- toGestureDrag :: (MonadIO m, IsGestureDrag o) => o -> m GestureDrag
- gestureDragGetOffset :: (HasCallStack, MonadIO m, IsGestureDrag a) => a -> m (Bool, Double, Double)
- gestureDragGetStartPoint :: (HasCallStack, MonadIO m, IsGestureDrag a) => a -> m (Bool, Double, Double)
- gestureDragNew :: (HasCallStack, MonadIO m) => m GestureDrag
- type GestureDragDragBeginCallback = Double -> Double -> IO ()
- afterGestureDragDragBegin :: (IsGestureDrag a, MonadIO m) => a -> ((?self :: a) => GestureDragDragBeginCallback) -> m SignalHandlerId
- onGestureDragDragBegin :: (IsGestureDrag a, MonadIO m) => a -> ((?self :: a) => GestureDragDragBeginCallback) -> m SignalHandlerId
- type GestureDragDragEndCallback = Double -> Double -> IO ()
- afterGestureDragDragEnd :: (IsGestureDrag a, MonadIO m) => a -> ((?self :: a) => GestureDragDragEndCallback) -> m SignalHandlerId
- onGestureDragDragEnd :: (IsGestureDrag a, MonadIO m) => a -> ((?self :: a) => GestureDragDragEndCallback) -> m SignalHandlerId
- type GestureDragDragUpdateCallback = Double -> Double -> IO ()
- afterGestureDragDragUpdate :: (IsGestureDrag a, MonadIO m) => a -> ((?self :: a) => GestureDragDragUpdateCallback) -> m SignalHandlerId
- onGestureDragDragUpdate :: (IsGestureDrag a, MonadIO m) => a -> ((?self :: a) => GestureDragDragUpdateCallback) -> m SignalHandlerId
Exported types
newtype GestureDrag Source #
Memory-managed wrapper type.
GestureDrag (ManagedPtr GestureDrag) |
Instances
Eq GestureDrag Source # | |
Defined in GI.Gtk.Objects.GestureDrag (==) :: GestureDrag -> GestureDrag -> Bool # (/=) :: GestureDrag -> GestureDrag -> Bool # | |
GObject GestureDrag Source # | |
Defined in GI.Gtk.Objects.GestureDrag | |
ManagedPtrNewtype GestureDrag Source # | |
Defined in GI.Gtk.Objects.GestureDrag toManagedPtr :: GestureDrag -> ManagedPtr GestureDrag | |
TypedObject GestureDrag Source # | |
Defined in GI.Gtk.Objects.GestureDrag | |
HasParentTypes GestureDrag Source # | |
Defined in GI.Gtk.Objects.GestureDrag | |
IsGValue (Maybe GestureDrag) Source # | Convert |
Defined in GI.Gtk.Objects.GestureDrag gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe GestureDrag -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe GestureDrag) | |
type ParentTypes GestureDrag Source # | |
Defined in GI.Gtk.Objects.GestureDrag |
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
(GObject o, IsDescendantOf GestureDrag o) => IsGestureDrag o Source # | |
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
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, group, handlesSequence, isActive, isFloating, isGroupedWith, isRecognized, notify, notifyByPspec, ref, refSink, reset, runDispose, stealData, stealQdata, thawNotify, ungroup, unref, watchClosure.
Getters
getBoundingBox, getBoundingBoxCenter, getButton, getCurrentButton, getCurrentEvent, getCurrentEventDevice, getCurrentEventState, getCurrentEventTime, getCurrentSequence, getData, getDevice, getExclusive, getGroup, getLastEvent, getLastUpdatedSequence, getName, getOffset, getPoint, getPropagationLimit, getPropagationPhase, getProperty, getQdata, getSequenceState, getSequences, getStartPoint, getTouchOnly, getWidget.
Setters
setButton, setData, setDataFull, setExclusive, setName, setPropagationLimit, setPropagationPhase, setProperty, setSequenceState, setState, setStaticName, setTouchOnly.
getOffset
:: (HasCallStack, MonadIO m, IsGestureDrag a) | |
=> a |
|
-> m (Bool, Double, Double) | Returns: |
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 #
:: (HasCallStack, MonadIO m, IsGestureDrag a) | |
=> a |
|
-> m (Bool, Double, Double) | Returns: |
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 widget-relative coordinates.
new
:: (HasCallStack, MonadIO m) | |
=> m GestureDrag | Returns: a newly created |
Returns a newly created GtkGesture
that recognizes drags.
Signals
dragBegin
type GestureDragDragBeginCallback Source #
= Double |
|
-> Double |
|
-> 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 #
= Double |
|
-> Double |
|
-> 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 #
= Double |
|
-> Double |
|
-> 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