Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
EventControllerScroll
is an event controller meant to handle
scroll events from mice and touchpads. It is capable of handling
both discrete and continuous scroll events, abstracting them both
on the scroll signal (deltas in the
discrete case are multiples of 1).
In the case of continuous scroll events, EventControllerScroll
encloses all scroll events between two
scrollBegin and scrollEnd
signals.
The behavior of the event controller can be modified by the
flags given at creation time, or modified at a later point through
eventControllerScrollSetFlags
(e.g. because the scrolling
conditions of the widget changed).
The controller can be set up to emit motion for either/both vertical
and horizontal scroll events through GTK_EVENT_CONTROLLER_SCROLL_VERTICAL
,
GTK_EVENT_CONTROLLER_SCROLL_HORIZONTAL
and GTK_EVENT_CONTROLLER_SCROLL_BOTH
.
If any axis is disabled, the respective scroll
delta will be 0. Vertical scroll events will be translated to horizontal
motion for the devices incapable of horizontal scrolling.
The event controller can also be forced to emit discrete events on all devices
through GTK_EVENT_CONTROLLER_SCROLL_DISCRETE
. This can be used to implement
discrete actions triggered through scroll events (e.g. switching across
combobox options).
The GTK_EVENT_CONTROLLER_SCROLL_KINETIC
flag toggles the emission of the
decelerate signal, emitted at the end of scrolling
with two X/Y velocity arguments that are consistent with the motion that
was received.
This object was added in 3.24.
Synopsis
- newtype EventControllerScroll = EventControllerScroll (ManagedPtr EventControllerScroll)
- class (GObject o, IsDescendantOf EventControllerScroll o) => IsEventControllerScroll o
- toEventControllerScroll :: (MonadIO m, IsEventControllerScroll o) => o -> m EventControllerScroll
- eventControllerScrollGetFlags :: (HasCallStack, MonadIO m, IsEventControllerScroll a) => a -> m [EventControllerScrollFlags]
- eventControllerScrollNew :: (HasCallStack, MonadIO m, IsWidget a) => a -> [EventControllerScrollFlags] -> m EventControllerScroll
- eventControllerScrollSetFlags :: (HasCallStack, MonadIO m, IsEventControllerScroll a) => a -> [EventControllerScrollFlags] -> m ()
- constructEventControllerScrollFlags :: (IsEventControllerScroll o, MonadIO m) => [EventControllerScrollFlags] -> m (GValueConstruct o)
- getEventControllerScrollFlags :: (MonadIO m, IsEventControllerScroll o) => o -> m [EventControllerScrollFlags]
- setEventControllerScrollFlags :: (MonadIO m, IsEventControllerScroll o) => o -> [EventControllerScrollFlags] -> m ()
- type C_EventControllerScrollDecelerateCallback = Ptr () -> CDouble -> CDouble -> Ptr () -> IO ()
- type EventControllerScrollDecelerateCallback = Double -> Double -> IO ()
- afterEventControllerScrollDecelerate :: (IsEventControllerScroll a, MonadIO m) => a -> EventControllerScrollDecelerateCallback -> m SignalHandlerId
- genClosure_EventControllerScrollDecelerate :: MonadIO m => EventControllerScrollDecelerateCallback -> m (GClosure C_EventControllerScrollDecelerateCallback)
- mk_EventControllerScrollDecelerateCallback :: C_EventControllerScrollDecelerateCallback -> IO (FunPtr C_EventControllerScrollDecelerateCallback)
- noEventControllerScrollDecelerateCallback :: Maybe EventControllerScrollDecelerateCallback
- onEventControllerScrollDecelerate :: (IsEventControllerScroll a, MonadIO m) => a -> EventControllerScrollDecelerateCallback -> m SignalHandlerId
- wrap_EventControllerScrollDecelerateCallback :: EventControllerScrollDecelerateCallback -> C_EventControllerScrollDecelerateCallback
- type C_EventControllerScrollScrollCallback = Ptr () -> CDouble -> CDouble -> Ptr () -> IO ()
- type EventControllerScrollScrollCallback = Double -> Double -> IO ()
- afterEventControllerScrollScroll :: (IsEventControllerScroll a, MonadIO m) => a -> EventControllerScrollScrollCallback -> m SignalHandlerId
- genClosure_EventControllerScrollScroll :: MonadIO m => EventControllerScrollScrollCallback -> m (GClosure C_EventControllerScrollScrollCallback)
- mk_EventControllerScrollScrollCallback :: C_EventControllerScrollScrollCallback -> IO (FunPtr C_EventControllerScrollScrollCallback)
- noEventControllerScrollScrollCallback :: Maybe EventControllerScrollScrollCallback
- onEventControllerScrollScroll :: (IsEventControllerScroll a, MonadIO m) => a -> EventControllerScrollScrollCallback -> m SignalHandlerId
- wrap_EventControllerScrollScrollCallback :: EventControllerScrollScrollCallback -> C_EventControllerScrollScrollCallback
- type C_EventControllerScrollScrollBeginCallback = Ptr () -> Ptr () -> IO ()
- type EventControllerScrollScrollBeginCallback = IO ()
- afterEventControllerScrollScrollBegin :: (IsEventControllerScroll a, MonadIO m) => a -> EventControllerScrollScrollBeginCallback -> m SignalHandlerId
- genClosure_EventControllerScrollScrollBegin :: MonadIO m => EventControllerScrollScrollBeginCallback -> m (GClosure C_EventControllerScrollScrollBeginCallback)
- mk_EventControllerScrollScrollBeginCallback :: C_EventControllerScrollScrollBeginCallback -> IO (FunPtr C_EventControllerScrollScrollBeginCallback)
- noEventControllerScrollScrollBeginCallback :: Maybe EventControllerScrollScrollBeginCallback
- onEventControllerScrollScrollBegin :: (IsEventControllerScroll a, MonadIO m) => a -> EventControllerScrollScrollBeginCallback -> m SignalHandlerId
- wrap_EventControllerScrollScrollBeginCallback :: EventControllerScrollScrollBeginCallback -> C_EventControllerScrollScrollBeginCallback
- type C_EventControllerScrollScrollEndCallback = Ptr () -> Ptr () -> IO ()
- type EventControllerScrollScrollEndCallback = IO ()
- afterEventControllerScrollScrollEnd :: (IsEventControllerScroll a, MonadIO m) => a -> EventControllerScrollScrollEndCallback -> m SignalHandlerId
- genClosure_EventControllerScrollScrollEnd :: MonadIO m => EventControllerScrollScrollEndCallback -> m (GClosure C_EventControllerScrollScrollEndCallback)
- mk_EventControllerScrollScrollEndCallback :: C_EventControllerScrollScrollEndCallback -> IO (FunPtr C_EventControllerScrollScrollEndCallback)
- noEventControllerScrollScrollEndCallback :: Maybe EventControllerScrollScrollEndCallback
- onEventControllerScrollScrollEnd :: (IsEventControllerScroll a, MonadIO m) => a -> EventControllerScrollScrollEndCallback -> m SignalHandlerId
- wrap_EventControllerScrollScrollEndCallback :: EventControllerScrollScrollEndCallback -> C_EventControllerScrollScrollEndCallback
Exported types
newtype EventControllerScroll Source #
Memory-managed wrapper type.
Instances
Eq EventControllerScroll Source # | |
Defined in GI.Gtk.Objects.EventControllerScroll (==) :: EventControllerScroll -> EventControllerScroll -> Bool # (/=) :: EventControllerScroll -> EventControllerScroll -> Bool # | |
IsGValue EventControllerScroll Source # | Convert |
Defined in GI.Gtk.Objects.EventControllerScroll toGValue :: EventControllerScroll -> IO GValue # fromGValue :: GValue -> IO EventControllerScroll # | |
ManagedPtrNewtype EventControllerScroll Source # | |
TypedObject EventControllerScroll Source # | |
Defined in GI.Gtk.Objects.EventControllerScroll | |
GObject EventControllerScroll Source # | |
Defined in GI.Gtk.Objects.EventControllerScroll | |
HasParentTypes EventControllerScroll Source # | |
Defined in GI.Gtk.Objects.EventControllerScroll | |
type ParentTypes EventControllerScroll Source # | |
Defined in GI.Gtk.Objects.EventControllerScroll |
class (GObject o, IsDescendantOf EventControllerScroll o) => IsEventControllerScroll o Source #
Type class for types which can be safely cast to EventControllerScroll
, for instance with toEventControllerScroll
.
Instances
(GObject o, IsDescendantOf EventControllerScroll o) => IsEventControllerScroll o Source # | |
Defined in GI.Gtk.Objects.EventControllerScroll |
toEventControllerScroll :: (MonadIO m, IsEventControllerScroll o) => o -> m EventControllerScroll Source #
Cast to EventControllerScroll
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Overloaded methods
getFlags
eventControllerScrollGetFlags Source #
:: (HasCallStack, MonadIO m, IsEventControllerScroll a) | |
=> a | |
-> m [EventControllerScrollFlags] | Returns: the controller flags. |
Gets the flags conditioning the scroll controller behavior.
Since: 3.24
new
eventControllerScrollNew Source #
:: (HasCallStack, MonadIO m, IsWidget a) | |
=> a |
|
-> [EventControllerScrollFlags] |
|
-> m EventControllerScroll | Returns: a new |
Creates a new event controller that will handle scroll events
for the given widget
.
Since: 3.24
setFlags
eventControllerScrollSetFlags Source #
:: (HasCallStack, MonadIO m, IsEventControllerScroll a) | |
=> a | |
-> [EventControllerScrollFlags] |
|
-> m () |
Sets the flags conditioning scroll controller behavior.
Since: 3.24
Properties
flags
The flags affecting event controller behavior
Since: 3.24
constructEventControllerScrollFlags :: (IsEventControllerScroll o, MonadIO m) => [EventControllerScrollFlags] -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “flags
” property. This is rarely needed directly, but it is used by new
.
getEventControllerScrollFlags :: (MonadIO m, IsEventControllerScroll o) => o -> m [EventControllerScrollFlags] Source #
Get the value of the “flags
” property.
When overloading is enabled, this is equivalent to
get
eventControllerScroll #flags
setEventControllerScrollFlags :: (MonadIO m, IsEventControllerScroll o) => o -> [EventControllerScrollFlags] -> m () Source #
Set the value of the “flags
” property.
When overloading is enabled, this is equivalent to
set
eventControllerScroll [ #flags:=
value ]
Signals
decelerate
type C_EventControllerScrollDecelerateCallback = Ptr () -> CDouble -> CDouble -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type EventControllerScrollDecelerateCallback Source #
Emitted after scroll is finished if the GTK_EVENT_CONTROLLER_SCROLL_KINETIC
flag is set. velX
and velY
express the initial velocity that was
imprinted by the scroll events. velX
and velY
are expressed in
pixels/ms.
afterEventControllerScrollDecelerate :: (IsEventControllerScroll a, MonadIO m) => a -> EventControllerScrollDecelerateCallback -> m SignalHandlerId Source #
Connect a signal handler for the decelerate signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
eventControllerScroll #decelerate callback
genClosure_EventControllerScrollDecelerate :: MonadIO m => EventControllerScrollDecelerateCallback -> m (GClosure C_EventControllerScrollDecelerateCallback) Source #
Wrap the callback into a GClosure
.
mk_EventControllerScrollDecelerateCallback :: C_EventControllerScrollDecelerateCallback -> IO (FunPtr C_EventControllerScrollDecelerateCallback) Source #
Generate a function pointer callable from C code, from a C_EventControllerScrollDecelerateCallback
.
noEventControllerScrollDecelerateCallback :: Maybe EventControllerScrollDecelerateCallback Source #
A convenience synonym for
.Nothing
:: Maybe
EventControllerScrollDecelerateCallback
onEventControllerScrollDecelerate :: (IsEventControllerScroll a, MonadIO m) => a -> EventControllerScrollDecelerateCallback -> m SignalHandlerId Source #
Connect a signal handler for the decelerate signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
eventControllerScroll #decelerate callback
wrap_EventControllerScrollDecelerateCallback :: EventControllerScrollDecelerateCallback -> C_EventControllerScrollDecelerateCallback Source #
scroll
type C_EventControllerScrollScrollCallback = Ptr () -> CDouble -> CDouble -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type EventControllerScrollScrollCallback Source #
Signals that the widget should scroll by the
amount specified by dx
and dy
.
afterEventControllerScrollScroll :: (IsEventControllerScroll a, MonadIO m) => a -> EventControllerScrollScrollCallback -> m SignalHandlerId Source #
Connect a signal handler for the scroll signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
eventControllerScroll #scroll callback
genClosure_EventControllerScrollScroll :: MonadIO m => EventControllerScrollScrollCallback -> m (GClosure C_EventControllerScrollScrollCallback) Source #
Wrap the callback into a GClosure
.
mk_EventControllerScrollScrollCallback :: C_EventControllerScrollScrollCallback -> IO (FunPtr C_EventControllerScrollScrollCallback) Source #
Generate a function pointer callable from C code, from a C_EventControllerScrollScrollCallback
.
noEventControllerScrollScrollCallback :: Maybe EventControllerScrollScrollCallback Source #
A convenience synonym for
.Nothing
:: Maybe
EventControllerScrollScrollCallback
onEventControllerScrollScroll :: (IsEventControllerScroll a, MonadIO m) => a -> EventControllerScrollScrollCallback -> m SignalHandlerId Source #
Connect a signal handler for the scroll signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
eventControllerScroll #scroll callback
wrap_EventControllerScrollScrollCallback :: EventControllerScrollScrollCallback -> C_EventControllerScrollScrollCallback Source #
scrollBegin
type C_EventControllerScrollScrollBeginCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type EventControllerScrollScrollBeginCallback = IO () Source #
Signals that a new scrolling operation has begun. It will only be emitted on devices capable of it.
afterEventControllerScrollScrollBegin :: (IsEventControllerScroll a, MonadIO m) => a -> EventControllerScrollScrollBeginCallback -> m SignalHandlerId Source #
Connect a signal handler for the scrollBegin signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
eventControllerScroll #scrollBegin callback
genClosure_EventControllerScrollScrollBegin :: MonadIO m => EventControllerScrollScrollBeginCallback -> m (GClosure C_EventControllerScrollScrollBeginCallback) Source #
Wrap the callback into a GClosure
.
mk_EventControllerScrollScrollBeginCallback :: C_EventControllerScrollScrollBeginCallback -> IO (FunPtr C_EventControllerScrollScrollBeginCallback) Source #
Generate a function pointer callable from C code, from a C_EventControllerScrollScrollBeginCallback
.
noEventControllerScrollScrollBeginCallback :: Maybe EventControllerScrollScrollBeginCallback Source #
A convenience synonym for
.Nothing
:: Maybe
EventControllerScrollScrollBeginCallback
onEventControllerScrollScrollBegin :: (IsEventControllerScroll a, MonadIO m) => a -> EventControllerScrollScrollBeginCallback -> m SignalHandlerId Source #
Connect a signal handler for the scrollBegin signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
eventControllerScroll #scrollBegin callback
wrap_EventControllerScrollScrollBeginCallback :: EventControllerScrollScrollBeginCallback -> C_EventControllerScrollScrollBeginCallback Source #
scrollEnd
type C_EventControllerScrollScrollEndCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type EventControllerScrollScrollEndCallback = IO () Source #
Signals that a new scrolling operation has finished. It will only be emitted on devices capable of it.
afterEventControllerScrollScrollEnd :: (IsEventControllerScroll a, MonadIO m) => a -> EventControllerScrollScrollEndCallback -> m SignalHandlerId Source #
Connect a signal handler for the scrollEnd signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
eventControllerScroll #scrollEnd callback
genClosure_EventControllerScrollScrollEnd :: MonadIO m => EventControllerScrollScrollEndCallback -> m (GClosure C_EventControllerScrollScrollEndCallback) Source #
Wrap the callback into a GClosure
.
mk_EventControllerScrollScrollEndCallback :: C_EventControllerScrollScrollEndCallback -> IO (FunPtr C_EventControllerScrollScrollEndCallback) Source #
Generate a function pointer callable from C code, from a C_EventControllerScrollScrollEndCallback
.
noEventControllerScrollScrollEndCallback :: Maybe EventControllerScrollScrollEndCallback Source #
A convenience synonym for
.Nothing
:: Maybe
EventControllerScrollScrollEndCallback
onEventControllerScrollScrollEnd :: (IsEventControllerScroll a, MonadIO m) => a -> EventControllerScrollScrollEndCallback -> m SignalHandlerId Source #
Connect a signal handler for the scrollEnd signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
eventControllerScroll #scrollEnd callback