Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (inaki@blueleaf.cc) |
Safe Haskell | None |
Language | Haskell2010 |
GestureDrag
is a Gesture
implementation that recognizes drag
operations. The drag operation itself can be tracked throught the
GestureDrag
::drag-begin
, GestureDrag
::drag-update
and
GestureDrag
::drag-end
signals, or the relevant coordinates 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
- noGestureDrag :: Maybe 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, IsWidget a) => a -> m GestureDrag
- type C_GestureDragDragBeginCallback = Ptr () -> CDouble -> CDouble -> Ptr () -> IO ()
- type GestureDragDragBeginCallback = Double -> Double -> IO ()
- afterGestureDragDragBegin :: (IsGestureDrag a, MonadIO m) => a -> GestureDragDragBeginCallback -> m SignalHandlerId
- genClosure_GestureDragDragBegin :: MonadIO m => GestureDragDragBeginCallback -> m (GClosure C_GestureDragDragBeginCallback)
- mk_GestureDragDragBeginCallback :: C_GestureDragDragBeginCallback -> IO (FunPtr C_GestureDragDragBeginCallback)
- noGestureDragDragBeginCallback :: Maybe GestureDragDragBeginCallback
- onGestureDragDragBegin :: (IsGestureDrag a, MonadIO m) => a -> GestureDragDragBeginCallback -> m SignalHandlerId
- wrap_GestureDragDragBeginCallback :: GestureDragDragBeginCallback -> C_GestureDragDragBeginCallback
- type C_GestureDragDragEndCallback = Ptr () -> CDouble -> CDouble -> Ptr () -> IO ()
- type GestureDragDragEndCallback = Double -> Double -> IO ()
- afterGestureDragDragEnd :: (IsGestureDrag a, MonadIO m) => a -> GestureDragDragEndCallback -> m SignalHandlerId
- genClosure_GestureDragDragEnd :: MonadIO m => GestureDragDragEndCallback -> m (GClosure C_GestureDragDragEndCallback)
- mk_GestureDragDragEndCallback :: C_GestureDragDragEndCallback -> IO (FunPtr C_GestureDragDragEndCallback)
- noGestureDragDragEndCallback :: Maybe GestureDragDragEndCallback
- onGestureDragDragEnd :: (IsGestureDrag a, MonadIO m) => a -> GestureDragDragEndCallback -> m SignalHandlerId
- wrap_GestureDragDragEndCallback :: GestureDragDragEndCallback -> C_GestureDragDragEndCallback
- type C_GestureDragDragUpdateCallback = Ptr () -> CDouble -> CDouble -> Ptr () -> IO ()
- type GestureDragDragUpdateCallback = Double -> Double -> IO ()
- afterGestureDragDragUpdate :: (IsGestureDrag a, MonadIO m) => a -> GestureDragDragUpdateCallback -> m SignalHandlerId
- genClosure_GestureDragDragUpdate :: MonadIO m => GestureDragDragUpdateCallback -> m (GClosure C_GestureDragDragUpdateCallback)
- mk_GestureDragDragUpdateCallback :: C_GestureDragDragUpdateCallback -> IO (FunPtr C_GestureDragDragUpdateCallback)
- noGestureDragDragUpdateCallback :: Maybe GestureDragDragUpdateCallback
- onGestureDragDragUpdate :: (IsGestureDrag a, MonadIO m) => a -> GestureDragDragUpdateCallback -> m SignalHandlerId
- wrap_GestureDragDragUpdateCallback :: GestureDragDragUpdateCallback -> C_GestureDragDragUpdateCallback
Exported types
newtype GestureDrag Source #
Memory-managed wrapper type.
Instances
GObject GestureDrag Source # | |
Defined in GI.Gtk.Objects.GestureDrag gobjectType :: IO GType # | |
HasParentTypes GestureDrag Source # | |
Defined in GI.Gtk.Objects.GestureDrag | |
type ParentTypes GestureDrag Source # | |
Defined in GI.Gtk.Objects.GestureDrag type ParentTypes GestureDrag = GestureSingle ': (Gesture ': (EventController ': (Object ': ([] :: [Type])))) |
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
.
noGestureDrag :: Maybe GestureDrag Source #
A convenience alias for Nothing
:: Maybe
GestureDrag
.
Methods
getOffset
:: (HasCallStack, MonadIO m, IsGestureDrag a) | |
=> a |
|
-> m (Bool, Double, Double) | Returns: |
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.
Since: 3.14
getStartPoint
gestureDragGetStartPoint Source #
:: (HasCallStack, MonadIO m, IsGestureDrag a) | |
=> a |
|
-> m (Bool, Double, Double) | Returns: |
If the gesture
is active, this function returns True
and fills in x
and y
with the drag start coordinates,
in window-relative coordinates.
Since: 3.14
new
:: (HasCallStack, MonadIO m, IsWidget a) | |
=> a |
|
-> m GestureDrag | Returns: a newly created |
Returns a newly created Gesture
that recognizes drags.
Since: 3.14
Signals
dragBegin
type C_GestureDragDragBeginCallback = Ptr () -> CDouble -> CDouble -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type GestureDragDragBeginCallback Source #
= Double |
|
-> Double |
|
-> IO () |
This signal is emitted whenever dragging starts.
Since: 3.14
afterGestureDragDragBegin :: (IsGestureDrag a, MonadIO m) => a -> GestureDragDragBeginCallback -> m SignalHandlerId Source #
Connect a signal handler for the “drag-begin
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
gestureDrag #dragBegin callback
genClosure_GestureDragDragBegin :: MonadIO m => GestureDragDragBeginCallback -> m (GClosure C_GestureDragDragBeginCallback) Source #
Wrap the callback into a GClosure
.
mk_GestureDragDragBeginCallback :: C_GestureDragDragBeginCallback -> IO (FunPtr C_GestureDragDragBeginCallback) Source #
Generate a function pointer callable from C code, from a C_GestureDragDragBeginCallback
.
noGestureDragDragBeginCallback :: Maybe GestureDragDragBeginCallback Source #
A convenience synonym for
.Nothing
:: Maybe
GestureDragDragBeginCallback
onGestureDragDragBegin :: (IsGestureDrag a, MonadIO m) => a -> GestureDragDragBeginCallback -> m SignalHandlerId Source #
Connect a signal handler for the “drag-begin
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
gestureDrag #dragBegin callback
wrap_GestureDragDragBeginCallback :: GestureDragDragBeginCallback -> C_GestureDragDragBeginCallback Source #
Wrap a GestureDragDragBeginCallback
into a C_GestureDragDragBeginCallback
.
dragEnd
type C_GestureDragDragEndCallback = Ptr () -> CDouble -> CDouble -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type GestureDragDragEndCallback Source #
= Double |
|
-> Double |
|
-> IO () |
This signal is emitted whenever the dragging is finished.
Since: 3.14
afterGestureDragDragEnd :: (IsGestureDrag a, MonadIO m) => a -> GestureDragDragEndCallback -> m SignalHandlerId Source #
Connect a signal handler for the “drag-end
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
gestureDrag #dragEnd callback
genClosure_GestureDragDragEnd :: MonadIO m => GestureDragDragEndCallback -> m (GClosure C_GestureDragDragEndCallback) Source #
Wrap the callback into a GClosure
.
mk_GestureDragDragEndCallback :: C_GestureDragDragEndCallback -> IO (FunPtr C_GestureDragDragEndCallback) Source #
Generate a function pointer callable from C code, from a C_GestureDragDragEndCallback
.
noGestureDragDragEndCallback :: Maybe GestureDragDragEndCallback Source #
A convenience synonym for
.Nothing
:: Maybe
GestureDragDragEndCallback
onGestureDragDragEnd :: (IsGestureDrag a, MonadIO m) => a -> GestureDragDragEndCallback -> m SignalHandlerId Source #
Connect a signal handler for the “drag-end
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
gestureDrag #dragEnd callback
wrap_GestureDragDragEndCallback :: GestureDragDragEndCallback -> C_GestureDragDragEndCallback Source #
Wrap a GestureDragDragEndCallback
into a C_GestureDragDragEndCallback
.
dragUpdate
type C_GestureDragDragUpdateCallback = Ptr () -> CDouble -> CDouble -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type GestureDragDragUpdateCallback Source #
= Double |
|
-> Double |
|
-> IO () |
This signal is emitted whenever the dragging point moves.
Since: 3.14
afterGestureDragDragUpdate :: (IsGestureDrag a, MonadIO m) => a -> GestureDragDragUpdateCallback -> m SignalHandlerId Source #
Connect a signal handler for the “drag-update
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
gestureDrag #dragUpdate callback
genClosure_GestureDragDragUpdate :: MonadIO m => GestureDragDragUpdateCallback -> m (GClosure C_GestureDragDragUpdateCallback) Source #
Wrap the callback into a GClosure
.
mk_GestureDragDragUpdateCallback :: C_GestureDragDragUpdateCallback -> IO (FunPtr C_GestureDragDragUpdateCallback) Source #
Generate a function pointer callable from C code, from a C_GestureDragDragUpdateCallback
.
noGestureDragDragUpdateCallback :: Maybe GestureDragDragUpdateCallback Source #
A convenience synonym for
.Nothing
:: Maybe
GestureDragDragUpdateCallback
onGestureDragDragUpdate :: (IsGestureDrag a, MonadIO m) => a -> GestureDragDragUpdateCallback -> m SignalHandlerId Source #
Connect a signal handler for the “drag-update
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
gestureDrag #dragUpdate callback