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

Contents

- Exported types
- Methods
  - getAxis
  - getBacklog
  - getDeviceTool
  - getStylusOnly
  - new
  - setStylusOnly
- Properties
  - stylusOnly
- Signals
  - down
  - motion
  - proximity
  - up

Description

Recognizes tablet stylus input.

The provided signals just relay the basic information of the stylus events.

Synopsis

- newtype GestureStylus = GestureStylus (ManagedPtr GestureStylus)
- class (GObject o, IsDescendantOf GestureStylus o) => IsGestureStylus o
- toGestureStylus :: (MonadIO m, IsGestureStylus o) => o -> m GestureStylus
- gestureStylusGetAxis :: (HasCallStack, MonadIO m, IsGestureStylus a) => a -> AxisUse -> m (Bool, Double)
- gestureStylusGetBacklog :: (HasCallStack, MonadIO m, IsGestureStylus a) => a -> m (Bool, [TimeCoord])
- gestureStylusGetDeviceTool :: (HasCallStack, MonadIO m, IsGestureStylus a) => a -> m (Maybe DeviceTool)
- gestureStylusGetStylusOnly :: (HasCallStack, MonadIO m, IsGestureStylus a) => a -> m Bool
- gestureStylusNew :: (HasCallStack, MonadIO m) => m GestureStylus
- gestureStylusSetStylusOnly :: (HasCallStack, MonadIO m, IsGestureStylus a) => a -> Bool -> m ()
- constructGestureStylusStylusOnly :: (IsGestureStylus o, MonadIO m) => Bool -> m (GValueConstruct o)
- getGestureStylusStylusOnly :: (MonadIO m, IsGestureStylus o) => o -> m Bool
- setGestureStylusStylusOnly :: (MonadIO m, IsGestureStylus o) => o -> Bool -> m ()
- type GestureStylusDownCallback = Double -> Double -> IO ()
- afterGestureStylusDown :: (IsGestureStylus a, MonadIO m) => a -> ((?self :: a) => GestureStylusDownCallback) -> m SignalHandlerId
- onGestureStylusDown :: (IsGestureStylus a, MonadIO m) => a -> ((?self :: a) => GestureStylusDownCallback) -> m SignalHandlerId
- type GestureStylusMotionCallback = Double -> Double -> IO ()
- afterGestureStylusMotion :: (IsGestureStylus a, MonadIO m) => a -> ((?self :: a) => GestureStylusMotionCallback) -> m SignalHandlerId
- onGestureStylusMotion :: (IsGestureStylus a, MonadIO m) => a -> ((?self :: a) => GestureStylusMotionCallback) -> m SignalHandlerId
- type GestureStylusProximityCallback = Double -> Double -> IO ()
- afterGestureStylusProximity :: (IsGestureStylus a, MonadIO m) => a -> ((?self :: a) => GestureStylusProximityCallback) -> m SignalHandlerId
- onGestureStylusProximity :: (IsGestureStylus a, MonadIO m) => a -> ((?self :: a) => GestureStylusProximityCallback) -> m SignalHandlerId
- type GestureStylusUpCallback = Double -> Double -> IO ()
- afterGestureStylusUp :: (IsGestureStylus a, MonadIO m) => a -> ((?self :: a) => GestureStylusUpCallback) -> m SignalHandlerId
- onGestureStylusUp :: (IsGestureStylus a, MonadIO m) => a -> ((?self :: a) => GestureStylusUpCallback) -> m SignalHandlerId

# Exported types

newtype GestureStylus Source #

Memory-managed wrapper type.

Constructors

GestureStylus (ManagedPtr GestureStylus) |

#### Instances

Instances details

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

class (GObject o, IsDescendantOf GestureStylus o) => IsGestureStylus o Source #

Type class for types which can be safely cast to `GestureStylus`, for instance with `toGestureStylus`.

#### Instances

Instances details

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

toGestureStylus :: (MonadIO m, IsGestureStylus o) => o -> m GestureStylus Source #

Cast to `GestureStylus`, 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, forceFloating, freezeNotify, getv, group, handlesSequence, isActive, isFloating, isGroupedWith, isRecognized, notify, notifyByPspec, ref, refSink, reset, runDispose, stealData, stealQdata, thawNotify, ungroup, unref, watchClosure.

#### Getters

getAxes, getAxis, getBacklog, getBoundingBox, getBoundingBoxCenter, getButton, getCurrentButton, getCurrentEvent, getCurrentEventDevice, getCurrentEventState, getCurrentEventTime, getCurrentSequence, getData, getDevice, getDeviceTool, getExclusive, getGroup, getLastEvent, getLastUpdatedSequence, getName, getPoint, getPropagationLimit, getPropagationPhase, getProperty, getQdata, getSequenceState, getSequences, getStylusOnly, getTouchOnly, getWidget.

#### Setters

setButton, setData, setDataFull, setExclusive, setName, setPropagationLimit, setPropagationPhase, setProperty, setSequenceState, setState, setStaticName, setStylusOnly, setTouchOnly.

## getAxis

gestureStylusGetAxis Source #

Arguments

:: (HasCallStack, MonadIO m, IsGestureStylus a) |
=> a | `gesture`: a `GtkGestureStylus`
-> AxisUse | `axis`: requested device axis
-> m (Bool, Double) | Returns: `True` if there is a current value for the axis

Returns the current value for the requested `axis`.

This function must be called from the handler of one of the GestureStylus::down, GestureStylus::motion, GestureStylus::up or GestureStylus::proximity signals.

## getBacklog

gestureStylusGetBacklog Source #

Arguments

:: (HasCallStack, MonadIO m, IsGestureStylus a) |
=> a | `gesture`: a `GtkGestureStylus`
-> m (Bool, [TimeCoord]) | Returns: `True` if there is a backlog to unfold in the current state.

Returns the accumulated backlog of tracking information.

By default, GTK will limit rate of input events. On stylus input where accuracy of strokes is paramount, this function returns the accumulated coordinate/timing state before the emission of the current Gtk.GestureStylus[motion] signal.

This function may only be called within a GestureStylus::motion signal handler, the state given in this signal and obtainable through `gestureStylusGetAxis` express the latest (most up-to-date) state in motion history.

The `backlog` is provided in chronological order.

## getDeviceTool

gestureStylusGetDeviceTool Source #

Arguments

:: (HasCallStack, MonadIO m, IsGestureStylus a) |
=> a | `gesture`: a `GtkGestureStylus`
-> m (Maybe DeviceTool) | Returns: The current stylus tool

Returns the `GdkDeviceTool` currently driving input through this gesture.

This function must be called from the handler of one of the GestureStylus::down, GestureStylus::motion, GestureStylus::up or GestureStylus::proximity signals.

## getStylusOnly

gestureStylusGetStylusOnly Source #

Arguments

:: (HasCallStack, MonadIO m, IsGestureStylus a) |
=> a | `gesture`: the gesture
-> m Bool | Returns: `True` if the gesture is only for stylus events

Checks whether the gesture is for styluses only.

Stylus-only gestures will signal events exclusively from stylus input devices.

Since: 4.10

## new

gestureStylusNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m GestureStylus | Returns: a newly created stylus gesture

Creates a new `GtkGestureStylus`.

## setStylusOnly

gestureStylusSetStylusOnly Source #

Arguments

:: (HasCallStack, MonadIO m, IsGestureStylus a) |
=> a | `gesture`: the gesture
-> Bool | `stylusOnly`: whether the gesture is used exclusively for stylus events
-> m () |

Sets the state of stylus-only

If true, the gesture will exclusively handle events from stylus input devices, otherwise it'll handle events from any pointing device.

Since: 4.10

# Properties

## stylusOnly

If this gesture should exclusively react to stylus input devices.

Since: 4.10

constructGestureStylusStylusOnly :: (IsGestureStylus o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`stylus-only`” property. This is rarely needed directly, but it is used by `new`.

getGestureStylusStylusOnly :: (MonadIO m, IsGestureStylus o) => o -> m Bool Source #

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

    get gestureStylus #stylusOnly

setGestureStylusStylusOnly :: (MonadIO m, IsGestureStylus o) => o -> Bool -> m () Source #

Set the value of the “`stylus-only`” property. When overloading is enabled, this is equivalent to

    set gestureStylus [ #stylusOnly := value ]

# Signals

## down

type GestureStylusDownCallback Source #

Arguments

= Double | `x`: the X coordinate of the stylus event
-> Double | `y`: the Y coordinate of the stylus event
-> IO () |

Emitted when the stylus touches the device.

afterGestureStylusDown :: (IsGestureStylus a, MonadIO m) => a -> ((?self :: a) => GestureStylusDownCallback) -> m SignalHandlerId Source #

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

    after gestureStylus #down 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.

onGestureStylusDown :: (IsGestureStylus a, MonadIO m) => a -> ((?self :: a) => GestureStylusDownCallback) -> m SignalHandlerId Source #

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

    on gestureStylus #down callback

## motion

type GestureStylusMotionCallback Source #

Arguments

= Double | `x`: the X coordinate of the stylus event
-> Double | `y`: the Y coordinate of the stylus event
-> IO () |

Emitted when the stylus moves while touching the device.

afterGestureStylusMotion :: (IsGestureStylus a, MonadIO m) => a -> ((?self :: a) => GestureStylusMotionCallback) -> 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 gestureStylus #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.

onGestureStylusMotion :: (IsGestureStylus a, MonadIO m) => a -> ((?self :: a) => GestureStylusMotionCallback) -> 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 gestureStylus #motion callback

## proximity

type GestureStylusProximityCallback Source #

Arguments

= Double | `x`: the X coordinate of the stylus event
-> Double | `y`: the Y coordinate of the stylus event
-> IO () |

Emitted when the stylus is in proximity of the device.

afterGestureStylusProximity :: (IsGestureStylus a, MonadIO m) => a -> ((?self :: a) => GestureStylusProximityCallback) -> m SignalHandlerId Source #

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

    after gestureStylus #proximity 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.

onGestureStylusProximity :: (IsGestureStylus a, MonadIO m) => a -> ((?self :: a) => GestureStylusProximityCallback) -> m SignalHandlerId Source #

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

    on gestureStylus #proximity callback

## up

type GestureStylusUpCallback Source #

Arguments

= Double | `x`: the X coordinate of the stylus event
-> Double | `y`: the Y coordinate of the stylus event
-> IO () |

Emitted when the stylus no longer touches the device.

afterGestureStylusUp :: (IsGestureStylus a, MonadIO m) => a -> ((?self :: a) => GestureStylusUpCallback) -> m SignalHandlerId Source #

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

    after gestureStylus #up 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.

onGestureStylusUp :: (IsGestureStylus a, MonadIO m) => a -> ((?self :: a) => GestureStylusUpCallback) -> m SignalHandlerId Source #

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

    on gestureStylus #up callback