gi-gdk4-4.0.10: Gdk bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gdk.Objects.ScrollEvent

Contents

- Exported types
- Methods
  - getDeltas
  - getDirection
  - getRelativeDirection
  - getUnit
  - isStop

Description

An event related to a scrolling motion.

Synopsis

- newtype ScrollEvent = ScrollEvent (ManagedPtr ScrollEvent)
- class (BoxedPtr o, TypedObject o, IsDescendantOf ScrollEvent o) => IsScrollEvent o
- toScrollEvent :: (MonadIO m, IsScrollEvent o) => o -> m ScrollEvent
- scrollEventGetDeltas :: (HasCallStack, MonadIO m, IsScrollEvent a) => a -> m (Double, Double)
- scrollEventGetDirection :: (HasCallStack, MonadIO m, IsScrollEvent a) => a -> m ScrollDirection
- scrollEventGetRelativeDirection :: (HasCallStack, MonadIO m, IsScrollEvent a) => a -> m ScrollRelativeDirection
- scrollEventGetUnit :: (HasCallStack, MonadIO m, IsScrollEvent a) => a -> m ScrollUnit
- scrollEventIsStop :: (HasCallStack, MonadIO m, IsScrollEvent a) => a -> m Bool

# Exported types

newtype ScrollEvent Source #

Memory-managed wrapper type.

Constructors

ScrollEvent (ManagedPtr ScrollEvent) |

#### Instances

Instances details

Eq ScrollEvent Source # |
Instance details Defined in GI.Gdk.Objects.ScrollEvent Methods (==) :: ScrollEvent -> ScrollEvent -> Bool Source # (/=) :: ScrollEvent -> ScrollEvent -> Bool Source #
BoxedPtr ScrollEvent Source # |
Instance details Defined in GI.Gdk.Objects.ScrollEvent Methods boxedPtrCopy :: ScrollEvent -> IO ScrollEvent Source # boxedPtrFree :: ScrollEvent -> IO () Source #
ManagedPtrNewtype ScrollEvent Source # |
Instance details Defined in GI.Gdk.Objects.ScrollEvent Methods toManagedPtr :: ScrollEvent -> ManagedPtr ScrollEvent Source #
TypedObject ScrollEvent Source # |
Instance details Defined in GI.Gdk.Objects.ScrollEvent Methods glibType :: IO GType Source #
HasParentTypes ScrollEvent Source # |
Instance details Defined in GI.Gdk.Objects.ScrollEvent
type ParentTypes ScrollEvent Source # |
Instance details Defined in GI.Gdk.Objects.ScrollEvent type ParentTypes ScrollEvent = '[Event]

class (BoxedPtr o, TypedObject o, IsDescendantOf ScrollEvent o) => IsScrollEvent o Source #

Type class for types which can be safely cast to `ScrollEvent`, for instance with `toScrollEvent`.

#### Instances

Instances details

(BoxedPtr o, TypedObject o, IsDescendantOf ScrollEvent o) => IsScrollEvent o Source # |
Instance details Defined in GI.Gdk.Objects.ScrollEvent

toScrollEvent :: (MonadIO m, IsScrollEvent o) => o -> m ScrollEvent Source #

Cast to `ScrollEvent`, 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

Expand

#### Methods

isStop, ref, triggersContextMenu, unref.

#### Getters

getAxes, getAxis, getDeltas, getDevice, getDeviceTool, getDirection, getDisplay, getEventSequence, getEventType, getHistory, getModifierState, getPointerEmulated, getPosition, getRelativeDirection, getSeat, getSurface, getTime, getUnit.

#### Setters

None.

## getDeltas

scrollEventGetDeltas Source #

Arguments

:: (HasCallStack, MonadIO m, IsScrollEvent a) |
=> a | `event`: a scroll event
-> m (Double, Double) |

Extracts the scroll deltas of a scroll event.

The deltas will be zero unless the scroll direction is `ScrollDirectionSmooth`.

For the representation unit of these deltas, see `scrollEventGetUnit`.

## getDirection

scrollEventGetDirection Source #

Arguments

:: (HasCallStack, MonadIO m, IsScrollEvent a) |
=> a | `event`: a scroll event
-> m ScrollDirection | Returns: the scroll direction of `event`

Extracts the direction of a scroll event.

## getRelativeDirection

scrollEventGetRelativeDirection Source #

Arguments

:: (HasCallStack, MonadIO m, IsScrollEvent a) |
=> a | `event`: a relative scroll direction.
-> m ScrollRelativeDirection | Returns: the relative scroll direction.

Extracts the scroll direction relative to the physical motion.

Since: 4.20

## getUnit

scrollEventGetUnit Source #

Arguments

:: (HasCallStack, MonadIO m, IsScrollEvent a) |
=> a | `event`: a scroll event.
-> m ScrollUnit | Returns: the scroll unit.

Extracts the scroll delta unit of a scroll event.

The unit will always be `ScrollUnitWheel` if the scroll direction is not `ScrollDirectionSmooth`.

Since: 4.8

## isStop

scrollEventIsStop Source #

Arguments

:: (HasCallStack, MonadIO m, IsScrollEvent a) |
=> a | `event`: a scroll event
-> m Bool | Returns: `True` if the event is a scroll stop event

Check whether a scroll event is a stop scroll event.

Scroll sequences with smooth scroll information may provide a stop scroll event once the interaction with the device finishes, e.g. by lifting a finger. This stop scroll event is the signal that a widget may trigger kinetic scrolling based on the current velocity.

Stop scroll events always have a delta of 0/0.