gi-gtk4-4.0.12: Gtk 4.x 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.Gtk.Objects.EventControllerMotion

Contents

- Exported types
- Methods
  - containsPointer
  - isPointer
  - new
- Properties
  - containsPointer
  - isPointer
- Signals
  - enter
  - leave
  - motion

Description

Tracks the pointer position.

The event controller offers EventControllerMotion::enter and EventControllerMotion::leave signals, as well as EventControllerMotion:isPointer and EventControllerMotion:containsPointer properties which are updated to reflect changes in the pointer position as it moves over the widget.

Synopsis

- newtype EventControllerMotion = EventControllerMotion (ManagedPtr EventControllerMotion)
- class (GObject o, IsDescendantOf EventControllerMotion o) => IsEventControllerMotion o
- toEventControllerMotion :: (MonadIO m, IsEventControllerMotion o) => o -> m EventControllerMotion
- eventControllerMotionContainsPointer :: (HasCallStack, MonadIO m, IsEventControllerMotion a) => a -> m Bool
- eventControllerMotionIsPointer :: (HasCallStack, MonadIO m, IsEventControllerMotion a) => a -> m Bool
- eventControllerMotionNew :: (HasCallStack, MonadIO m) => m EventControllerMotion
- getEventControllerMotionContainsPointer :: (MonadIO m, IsEventControllerMotion o) => o -> m Bool
- getEventControllerMotionIsPointer :: (MonadIO m, IsEventControllerMotion o) => o -> m Bool
- type EventControllerMotionEnterCallback = Double -> Double -> IO ()
- afterEventControllerMotionEnter :: (IsEventControllerMotion a, MonadIO m) => a -> ((?self :: a) => EventControllerMotionEnterCallback) -> m SignalHandlerId
- onEventControllerMotionEnter :: (IsEventControllerMotion a, MonadIO m) => a -> ((?self :: a) => EventControllerMotionEnterCallback) -> m SignalHandlerId
- type EventControllerMotionLeaveCallback = IO ()
- afterEventControllerMotionLeave :: (IsEventControllerMotion a, MonadIO m) => a -> ((?self :: a) => EventControllerMotionLeaveCallback) -> m SignalHandlerId
- onEventControllerMotionLeave :: (IsEventControllerMotion a, MonadIO m) => a -> ((?self :: a) => EventControllerMotionLeaveCallback) -> m SignalHandlerId
- type EventControllerMotionMotionCallback = Double -> Double -> IO ()
- afterEventControllerMotionMotion :: (IsEventControllerMotion a, MonadIO m) => a -> ((?self :: a) => EventControllerMotionMotionCallback) -> m SignalHandlerId
- onEventControllerMotionMotion :: (IsEventControllerMotion a, MonadIO m) => a -> ((?self :: a) => EventControllerMotionMotionCallback) -> m SignalHandlerId

# Exported types

newtype EventControllerMotion Source #

Memory-managed wrapper type.

Constructors

EventControllerMotion (ManagedPtr EventControllerMotion) |

#### Instances

Instances details

Eq EventControllerMotion Source # |
Instance details Defined in GI.Gtk.Objects.EventControllerMotion Methods (==) :: EventControllerMotion -> EventControllerMotion -> Bool Source # (/=) :: EventControllerMotion -> EventControllerMotion -> Bool Source #
GObject EventControllerMotion Source # |
Instance details Defined in GI.Gtk.Objects.EventControllerMotion
ManagedPtrNewtype EventControllerMotion Source # |
Instance details Defined in GI.Gtk.Objects.EventControllerMotion Methods toManagedPtr :: EventControllerMotion -> ManagedPtr EventControllerMotion Source #
TypedObject EventControllerMotion Source # |
Instance details Defined in GI.Gtk.Objects.EventControllerMotion Methods glibType :: IO GType Source #
HasParentTypes EventControllerMotion Source # |
Instance details Defined in GI.Gtk.Objects.EventControllerMotion
IsGValue (Maybe EventControllerMotion) Source # | Convert `EventControllerMotion` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gtk.Objects.EventControllerMotion Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe EventControllerMotion -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe EventControllerMotion) Source #
type ParentTypes EventControllerMotion Source # |
Instance details Defined in GI.Gtk.Objects.EventControllerMotion type ParentTypes EventControllerMotion = '[EventController, Object]

class (GObject o, IsDescendantOf EventControllerMotion o) => IsEventControllerMotion o Source #

Type class for types which can be safely cast to `EventControllerMotion`, for instance with `toEventControllerMotion`.

#### Instances

Instances details

(GObject o, IsDescendantOf EventControllerMotion o) => IsEventControllerMotion o Source # |
Instance details Defined in GI.Gtk.Objects.EventControllerMotion

toEventControllerMotion :: (MonadIO m, IsEventControllerMotion o) => o -> m EventControllerMotion Source #

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

bindProperty, bindPropertyFull, containsPointer, forceFloating, freezeNotify, getv, isFloating, isPointer, notify, notifyByPspec, ref, refSink, reset, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.

#### Getters

getCurrentEvent, getCurrentEventDevice, getCurrentEventState, getCurrentEventTime, getData, getName, getPropagationLimit, getPropagationPhase, getProperty, getQdata, getWidget.

#### Setters

setData, setDataFull, setName, setPropagationLimit, setPropagationPhase, setProperty, setStaticName.

## containsPointer

eventControllerMotionContainsPointer Source #

Arguments

:: (HasCallStack, MonadIO m, IsEventControllerMotion a) |
=> a | `self`: a `GtkEventControllerMotion`
-> m Bool | Returns: `True` if a pointer is within `self` or one of its children

Returns if a pointer is within `self` or one of its children.

## isPointer

eventControllerMotionIsPointer Source #

Arguments

:: (HasCallStack, MonadIO m, IsEventControllerMotion a) |
=> a | `self`: a `GtkEventControllerMotion`
-> m Bool | Returns: `True` if a pointer is within `self` but not one of its children

Returns if a pointer is within `self`, but not one of its children.

## new

eventControllerMotionNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m EventControllerMotion | Returns: a new `GtkEventControllerMotion`

Creates a new event controller that will handle motion events.

# Properties

## containsPointer

Whether the pointer is in the controllers widget or a descendant.

See also EventControllerMotion:isPointer.

When handling crossing events, this property is updated before EventControllerMotion::enter, but after EventControllerMotion::leave is emitted.

getEventControllerMotionContainsPointer :: (MonadIO m, IsEventControllerMotion o) => o -> m Bool Source #

Get the value of the “`contains-pointer`” property. When overloading is enabled, this is equivalent to

    get eventControllerMotion #containsPointer

## isPointer

Whether the pointer is in the controllers widget itself, as opposed to in a descendent widget.

See also EventControllerMotion:containsPointer.

When handling crossing events, this property is updated before EventControllerMotion::enter, but after EventControllerMotion::leave is emitted.

getEventControllerMotionIsPointer :: (MonadIO m, IsEventControllerMotion o) => o -> m Bool Source #

Get the value of the “`is-pointer`” property. When overloading is enabled, this is equivalent to

    get eventControllerMotion #isPointer

# Signals

## enter

type EventControllerMotionEnterCallback Source #

Arguments

= Double | `x`: coordinates of pointer location
-> Double | `y`: coordinates of pointer location
-> IO () |

Signals that the pointer has entered the widget.

afterEventControllerMotionEnter :: (IsEventControllerMotion a, MonadIO m) => a -> ((?self :: a) => EventControllerMotionEnterCallback) -> m SignalHandlerId Source #

Connect a signal handler for the enter signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after eventControllerMotion #enter 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.

onEventControllerMotionEnter :: (IsEventControllerMotion a, MonadIO m) => a -> ((?self :: a) => EventControllerMotionEnterCallback) -> m SignalHandlerId Source #

Connect a signal handler for the enter signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on eventControllerMotion #enter callback

## leave

type EventControllerMotionLeaveCallback = IO () Source #

Signals that the pointer has left the widget.

afterEventControllerMotionLeave :: (IsEventControllerMotion a, MonadIO m) => a -> ((?self :: a) => EventControllerMotionLeaveCallback) -> m SignalHandlerId Source #

Connect a signal handler for the leave signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after eventControllerMotion #leave 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.

onEventControllerMotionLeave :: (IsEventControllerMotion a, MonadIO m) => a -> ((?self :: a) => EventControllerMotionLeaveCallback) -> m SignalHandlerId Source #

Connect a signal handler for the leave signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on eventControllerMotion #leave callback

## motion

type EventControllerMotionMotionCallback Source #

Arguments

= Double | `x`: the x coordinate
-> Double | `y`: the y coordinate
-> IO () |

Emitted when the pointer moves inside the widget.

afterEventControllerMotionMotion :: (IsEventControllerMotion a, MonadIO m) => a -> ((?self :: a) => EventControllerMotionMotionCallback) -> m SignalHandlerId Source #

Connect a signal handler for the motion signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after eventControllerMotion #motion 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.

onEventControllerMotionMotion :: (IsEventControllerMotion a, MonadIO m) => a -> ((?self :: a) => EventControllerMotionMotionCallback) -> m SignalHandlerId Source #

Connect a signal handler for the motion signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on eventControllerMotion #motion callback