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.DropControllerMotion

Contents

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

Description

An event controller tracking the pointer during Drag-and-Drop operations.

It is modeled after `EventControllerMotion` so if you have used that, this should feel really familiar.

This controller is not able to accept drops, use `DropTarget` for that purpose.

Synopsis

- newtype DropControllerMotion = DropControllerMotion (ManagedPtr DropControllerMotion)
- class (GObject o, IsDescendantOf DropControllerMotion o) => IsDropControllerMotion o
- toDropControllerMotion :: (MonadIO m, IsDropControllerMotion o) => o -> m DropControllerMotion
- dropControllerMotionContainsPointer :: (HasCallStack, MonadIO m, IsDropControllerMotion a) => a -> m Bool
- dropControllerMotionGetDrop :: (HasCallStack, MonadIO m, IsDropControllerMotion a) => a -> m (Maybe Drop)
- dropControllerMotionIsPointer :: (HasCallStack, MonadIO m, IsDropControllerMotion a) => a -> m Bool
- dropControllerMotionNew :: (HasCallStack, MonadIO m) => m DropControllerMotion
- getDropControllerMotionContainsPointer :: (MonadIO m, IsDropControllerMotion o) => o -> m Bool
- getDropControllerMotionDrop :: (MonadIO m, IsDropControllerMotion o) => o -> m (Maybe Drop)
- getDropControllerMotionIsPointer :: (MonadIO m, IsDropControllerMotion o) => o -> m Bool
- type DropControllerMotionEnterCallback = Double -> Double -> IO ()
- afterDropControllerMotionEnter :: (IsDropControllerMotion a, MonadIO m) => a -> ((?self :: a) => DropControllerMotionEnterCallback) -> m SignalHandlerId
- onDropControllerMotionEnter :: (IsDropControllerMotion a, MonadIO m) => a -> ((?self :: a) => DropControllerMotionEnterCallback) -> m SignalHandlerId
- type DropControllerMotionLeaveCallback = IO ()
- afterDropControllerMotionLeave :: (IsDropControllerMotion a, MonadIO m) => a -> ((?self :: a) => DropControllerMotionLeaveCallback) -> m SignalHandlerId
- onDropControllerMotionLeave :: (IsDropControllerMotion a, MonadIO m) => a -> ((?self :: a) => DropControllerMotionLeaveCallback) -> m SignalHandlerId
- type DropControllerMotionMotionCallback = Double -> Double -> IO ()
- afterDropControllerMotionMotion :: (IsDropControllerMotion a, MonadIO m) => a -> ((?self :: a) => DropControllerMotionMotionCallback) -> m SignalHandlerId
- onDropControllerMotionMotion :: (IsDropControllerMotion a, MonadIO m) => a -> ((?self :: a) => DropControllerMotionMotionCallback) -> m SignalHandlerId

# Exported types

newtype DropControllerMotion Source #

Memory-managed wrapper type.

Constructors

DropControllerMotion (ManagedPtr DropControllerMotion) |

#### Instances

Instances details

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

class (GObject o, IsDescendantOf DropControllerMotion o) => IsDropControllerMotion o Source #

Type class for types which can be safely cast to `DropControllerMotion`, for instance with `toDropControllerMotion`.

#### Instances

Instances details

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

toDropControllerMotion :: (MonadIO m, IsDropControllerMotion o) => o -> m DropControllerMotion Source #

Cast to `DropControllerMotion`, 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, getDrop, getName, getPropagationLimit, getPropagationPhase, getProperty, getQdata, getWidget.

#### Setters

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

## containsPointer

dropControllerMotionContainsPointer Source #

Arguments

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

Returns if a Drag-and-Drop operation is within the widget `self` or one of its children.

## getDrop

dropControllerMotionGetDrop Source #

Arguments

:: (HasCallStack, MonadIO m, IsDropControllerMotion a) |
=> a | `self`: a `GtkDropControllerMotion`
-> m (Maybe Drop) | Returns: The `GdkDrop` currently happening within `self`

Returns the `GdkDrop` of a current Drag-and-Drop operation over the widget of `self`.

## isPointer

dropControllerMotionIsPointer Source #

Arguments

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

Returns if a Drag-and-Drop operation is within the widget `self`, not one of its children.

## new

dropControllerMotionNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m DropControllerMotion | Returns: a new `GtkDropControllerMotion`

Creates a new event controller that will handle pointer motion events during drag and drop.

# Properties

## containsPointer

Whether the pointer of a Drag-and-Drop operation is in the controller's widget or a descendant.

See also DropControllerMotion:isPointer.

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

getDropControllerMotionContainsPointer :: (MonadIO m, IsDropControllerMotion o) => o -> m Bool Source #

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

    get dropControllerMotion #containsPointer

## drop

The ongoing drop operation over the controller's widget or its descendant.

If no drop operation is going on, this property returns `Nothing`.

The event controller should not modify the `drop`, but it might want to query its properties.

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

getDropControllerMotionDrop :: (MonadIO m, IsDropControllerMotion o) => o -> m (Maybe Drop) Source #

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

    get dropControllerMotion #drop

## isPointer

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

See also DropControllerMotion:containsPointer.

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

getDropControllerMotionIsPointer :: (MonadIO m, IsDropControllerMotion o) => o -> m Bool Source #

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

    get dropControllerMotion #isPointer

# Signals

## enter

type DropControllerMotionEnterCallback Source #

Arguments

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

Signals that the pointer has entered the widget.

afterDropControllerMotionEnter :: (IsDropControllerMotion a, MonadIO m) => a -> ((?self :: a) => DropControllerMotionEnterCallback) -> 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 dropControllerMotion #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.

onDropControllerMotionEnter :: (IsDropControllerMotion a, MonadIO m) => a -> ((?self :: a) => DropControllerMotionEnterCallback) -> 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 dropControllerMotion #enter callback

## leave

type DropControllerMotionLeaveCallback = IO () Source #

Signals that the pointer has left the widget.

afterDropControllerMotionLeave :: (IsDropControllerMotion a, MonadIO m) => a -> ((?self :: a) => DropControllerMotionLeaveCallback) -> 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 dropControllerMotion #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.

onDropControllerMotionLeave :: (IsDropControllerMotion a, MonadIO m) => a -> ((?self :: a) => DropControllerMotionLeaveCallback) -> 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 dropControllerMotion #leave callback

## motion

type DropControllerMotionMotionCallback Source #

Arguments

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

Emitted when the pointer moves inside the widget.

afterDropControllerMotionMotion :: (IsDropControllerMotion a, MonadIO m) => a -> ((?self :: a) => DropControllerMotionMotionCallback) -> 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 dropControllerMotion #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.

onDropControllerMotionMotion :: (IsDropControllerMotion a, MonadIO m) => a -> ((?self :: a) => DropControllerMotionMotionCallback) -> 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 dropControllerMotion #motion callback