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 |
GtkGestureLongPress
is a GtkGesture
for long presses.
This gesture is also known as “Press and Hold”.
When the timeout is exceeded, the gesture is triggering the GestureLongPress::pressed signal.
If the touchpoint is lifted before the timeout passes, or if it drifts too far of the initial press point, the GestureLongPress::cancelled signal will be emitted.
How long the timeout is before the pressed signal gets emitted is determined by the Settings:gtkLongPressTime setting. It can be modified by the GestureLongPress:delayFactor property.
Synopsis
- newtype GestureLongPress = GestureLongPress (ManagedPtr GestureLongPress)
- class (GObject o, IsDescendantOf GestureLongPress o) => IsGestureLongPress o
- toGestureLongPress :: (MonadIO m, IsGestureLongPress o) => o -> m GestureLongPress
- gestureLongPressGetDelayFactor :: (HasCallStack, MonadIO m, IsGestureLongPress a) => a -> m Double
- gestureLongPressNew :: (HasCallStack, MonadIO m) => m GestureLongPress
- gestureLongPressSetDelayFactor :: (HasCallStack, MonadIO m, IsGestureLongPress a) => a -> Double -> m ()
- constructGestureLongPressDelayFactor :: (IsGestureLongPress o, MonadIO m) => Double -> m (GValueConstruct o)
- getGestureLongPressDelayFactor :: (MonadIO m, IsGestureLongPress o) => o -> m Double
- setGestureLongPressDelayFactor :: (MonadIO m, IsGestureLongPress o) => o -> Double -> m ()
- type GestureLongPressCancelledCallback = IO ()
- afterGestureLongPressCancelled :: (IsGestureLongPress a, MonadIO m) => a -> ((?self :: a) => GestureLongPressCancelledCallback) -> m SignalHandlerId
- onGestureLongPressCancelled :: (IsGestureLongPress a, MonadIO m) => a -> ((?self :: a) => GestureLongPressCancelledCallback) -> m SignalHandlerId
- type GestureLongPressPressedCallback = Double -> Double -> IO ()
- afterGestureLongPressPressed :: (IsGestureLongPress a, MonadIO m) => a -> ((?self :: a) => GestureLongPressPressedCallback) -> m SignalHandlerId
- onGestureLongPressPressed :: (IsGestureLongPress a, MonadIO m) => a -> ((?self :: a) => GestureLongPressPressedCallback) -> m SignalHandlerId
Exported types
newtype GestureLongPress Source #
Memory-managed wrapper type.
GestureLongPress (ManagedPtr GestureLongPress) |
Instances
Eq GestureLongPress Source # | |
Defined in GI.Gtk.Objects.GestureLongPress (==) :: GestureLongPress -> GestureLongPress -> Bool # (/=) :: GestureLongPress -> GestureLongPress -> Bool # | |
GObject GestureLongPress Source # | |
Defined in GI.Gtk.Objects.GestureLongPress | |
ManagedPtrNewtype GestureLongPress Source # | |
Defined in GI.Gtk.Objects.GestureLongPress toManagedPtr :: GestureLongPress -> ManagedPtr GestureLongPress | |
TypedObject GestureLongPress Source # | |
Defined in GI.Gtk.Objects.GestureLongPress | |
HasParentTypes GestureLongPress Source # | |
Defined in GI.Gtk.Objects.GestureLongPress | |
IsGValue (Maybe GestureLongPress) Source # | Convert |
Defined in GI.Gtk.Objects.GestureLongPress gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe GestureLongPress -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe GestureLongPress) | |
type ParentTypes GestureLongPress Source # | |
Defined in GI.Gtk.Objects.GestureLongPress |
class (GObject o, IsDescendantOf GestureLongPress o) => IsGestureLongPress o Source #
Type class for types which can be safely cast to GestureLongPress
, for instance with toGestureLongPress
.
Instances
(GObject o, IsDescendantOf GestureLongPress o) => IsGestureLongPress o Source # | |
Defined in GI.Gtk.Objects.GestureLongPress |
toGestureLongPress :: (MonadIO m, IsGestureLongPress o) => o -> m GestureLongPress Source #
Cast to GestureLongPress
, 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, getDelayFactor, getDevice, getExclusive, getGroup, getLastEvent, getLastUpdatedSequence, getName, getPoint, getPropagationLimit, getPropagationPhase, getProperty, getQdata, getSequenceState, getSequences, getTouchOnly, getWidget.
Setters
setButton, setData, setDataFull, setDelayFactor, setExclusive, setName, setPropagationLimit, setPropagationPhase, setProperty, setSequenceState, setState, setStaticName, setTouchOnly.
getDelayFactor
gestureLongPressGetDelayFactor Source #
:: (HasCallStack, MonadIO m, IsGestureLongPress a) | |
=> a |
|
-> m Double | Returns: the delay factor |
Returns the delay factor.
new
:: (HasCallStack, MonadIO m) | |
=> m GestureLongPress | Returns: a newly created |
Returns a newly created GtkGesture
that recognizes long presses.
setDelayFactor
gestureLongPressSetDelayFactor Source #
:: (HasCallStack, MonadIO m, IsGestureLongPress a) | |
=> a |
|
-> Double |
|
-> m () |
Applies the given delay factor.
The default long press time will be multiplied by this value. Valid values are in the range [0.5..2.0].
Properties
delayFactor
Factor by which to modify the default timeout.
constructGestureLongPressDelayFactor :: (IsGestureLongPress o, MonadIO m) => Double -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “delay-factor
” property. This is rarely needed directly, but it is used by new
.
getGestureLongPressDelayFactor :: (MonadIO m, IsGestureLongPress o) => o -> m Double Source #
Get the value of the “delay-factor
” property.
When overloading is enabled, this is equivalent to
get
gestureLongPress #delayFactor
setGestureLongPressDelayFactor :: (MonadIO m, IsGestureLongPress o) => o -> Double -> m () Source #
Set the value of the “delay-factor
” property.
When overloading is enabled, this is equivalent to
set
gestureLongPress [ #delayFactor:=
value ]
Signals
cancelled
type GestureLongPressCancelledCallback = IO () Source #
Emitted whenever a press moved too far, or was released before GestureLongPress::pressed happened.
afterGestureLongPressCancelled :: (IsGestureLongPress a, MonadIO m) => a -> ((?self :: a) => GestureLongPressCancelledCallback) -> m SignalHandlerId Source #
Connect a signal handler for the cancelled signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
gestureLongPress #cancelled 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.
onGestureLongPressCancelled :: (IsGestureLongPress a, MonadIO m) => a -> ((?self :: a) => GestureLongPressCancelledCallback) -> m SignalHandlerId Source #
Connect a signal handler for the cancelled signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
gestureLongPress #cancelled callback
pressed
type GestureLongPressPressedCallback Source #
= Double |
|
-> Double |
|
-> IO () |
Emitted whenever a press goes unmoved/unreleased longer than what the GTK defaults tell.
afterGestureLongPressPressed :: (IsGestureLongPress a, MonadIO m) => a -> ((?self :: a) => GestureLongPressPressedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the pressed signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
gestureLongPress #pressed 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.
onGestureLongPressPressed :: (IsGestureLongPress a, MonadIO m) => a -> ((?self :: a) => GestureLongPressPressedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the pressed signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
gestureLongPress #pressed callback