gi-gdk-3.0.28: Gdk bindings

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

GI.Gdk.Objects.Seat

Contents

- Exported types
- Methods
  - getCapabilities
  - getDisplay
  - getKeyboard
  - getPointer
  - getSlaves
  - grab
  - ungrab
- Properties
  - display
- Signals
  - deviceAdded
  - deviceRemoved
  - toolAdded
  - toolRemoved

Description

The `Seat` object represents a collection of input devices that belong to a user.

Synopsis

- newtype Seat = Seat (ManagedPtr Seat)
- class (GObject o, IsDescendantOf Seat o) => IsSeat o
- toSeat :: (MonadIO m, IsSeat o) => o -> m Seat
- seatGetCapabilities :: (HasCallStack, MonadIO m, IsSeat a) => a -> m [SeatCapabilities]
- seatGetDisplay :: (HasCallStack, MonadIO m, IsSeat a) => a -> m Display
- seatGetKeyboard :: (HasCallStack, MonadIO m, IsSeat a) => a -> m (Maybe Device)
- seatGetPointer :: (HasCallStack, MonadIO m, IsSeat a) => a -> m (Maybe Device)
- seatGetSlaves :: (HasCallStack, MonadIO m, IsSeat a) => a -> [SeatCapabilities] -> m [Device]
- seatGrab :: (HasCallStack, MonadIO m, IsSeat a, IsWindow b, IsCursor c) => a -> b -> [SeatCapabilities] -> Bool -> Maybe c -> Maybe Event -> Maybe SeatGrabPrepareFunc -> m GrabStatus
- seatUngrab :: (HasCallStack, MonadIO m, IsSeat a) => a -> m ()
- constructSeatDisplay :: (IsSeat o, MonadIO m, IsDisplay a) => a -> m (GValueConstruct o)
- getSeatDisplay :: (MonadIO m, IsSeat o) => o -> m Display
- type SeatDeviceAddedCallback = Device -> IO ()
- afterSeatDeviceAdded :: (IsSeat a, MonadIO m) => a -> ((?self :: a) => SeatDeviceAddedCallback) -> m SignalHandlerId
- onSeatDeviceAdded :: (IsSeat a, MonadIO m) => a -> ((?self :: a) => SeatDeviceAddedCallback) -> m SignalHandlerId
- type SeatDeviceRemovedCallback = Device -> IO ()
- afterSeatDeviceRemoved :: (IsSeat a, MonadIO m) => a -> ((?self :: a) => SeatDeviceRemovedCallback) -> m SignalHandlerId
- onSeatDeviceRemoved :: (IsSeat a, MonadIO m) => a -> ((?self :: a) => SeatDeviceRemovedCallback) -> m SignalHandlerId
- type SeatToolAddedCallback = DeviceTool -> IO ()
- afterSeatToolAdded :: (IsSeat a, MonadIO m) => a -> ((?self :: a) => SeatToolAddedCallback) -> m SignalHandlerId
- onSeatToolAdded :: (IsSeat a, MonadIO m) => a -> ((?self :: a) => SeatToolAddedCallback) -> m SignalHandlerId
- type SeatToolRemovedCallback = DeviceTool -> IO ()
- afterSeatToolRemoved :: (IsSeat a, MonadIO m) => a -> ((?self :: a) => SeatToolRemovedCallback) -> m SignalHandlerId
- onSeatToolRemoved :: (IsSeat a, MonadIO m) => a -> ((?self :: a) => SeatToolRemovedCallback) -> m SignalHandlerId

# Exported types

newtype Seat Source #

Memory-managed wrapper type.

Constructors

Seat (ManagedPtr Seat) |

#### Instances

Instances details

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

class (GObject o, IsDescendantOf Seat o) => IsSeat o Source #

Type class for types which can be safely cast to `Seat`, for instance with `toSeat`.

#### Instances

Instances details

(GObject o, IsDescendantOf Seat o) => IsSeat o Source # |
Instance details Defined in GI.Gdk.Objects.Seat

toSeat :: (MonadIO m, IsSeat o) => o -> m Seat Source #

Cast to `Seat`, 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, grab, isFloating, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, ungrab, unref, watchClosure.

#### Getters

getCapabilities, getData, getDisplay, getKeyboard, getPointer, getProperty, getQdata, getSlaves.

#### Setters

setData, setDataFull, setProperty.

## getCapabilities

seatGetCapabilities Source #

Arguments

:: (HasCallStack, MonadIO m, IsSeat a) |
=> a | `seat`: a `Seat`
-> m [SeatCapabilities] | Returns: the seat capabilities

Returns the capabilities this `Seat` currently has.

Since: 3.20

## getDisplay

seatGetDisplay Source #

Arguments

:: (HasCallStack, MonadIO m, IsSeat a) |
=> a | `seat`: a `Seat`
-> m Display | Returns: a `Display`. This object is owned by GTK+ and must not be freed.

Returns the `Display` this seat belongs to.

## getKeyboard

seatGetKeyboard Source #

Arguments

:: (HasCallStack, MonadIO m, IsSeat a) |
=> a | `seat`: a `Seat`
-> m (Maybe Device) | Returns: a master `Device` with keyboard capabilities. This object is owned by GTK+ and must not be freed.

Returns the master device that routes keyboard events.

Since: 3.20

## getPointer

seatGetPointer Source #

Arguments

:: (HasCallStack, MonadIO m, IsSeat a) |
=> a | `seat`: a `Seat`
-> m (Maybe Device) | Returns: a master `Device` with pointer capabilities. This object is owned by GTK+ and must not be freed.

Returns the master device that routes pointer events.

Since: 3.20

## getSlaves

seatGetSlaves Source #

Arguments

:: (HasCallStack, MonadIO m, IsSeat a) |
=> a | `seat`: a `Seat`
-> [SeatCapabilities] | `capabilities`: capabilities to get devices for
-> m [Device] | Returns: A list of `GdkDevices`. The list must be freed with `g_list_free()`, the elements are owned by GDK and must not be freed.

Returns the slave devices that match the given capabilities.

Since: 3.20

## grab

seatGrab Source #

Arguments

:: (HasCallStack, MonadIO m, IsSeat a, IsWindow b, IsCursor c) |
=> a | `seat`: a `Seat`
-> b | `window`: the `Window` which will own the grab
-> [SeatCapabilities] | `capabilities`: capabilities that will be grabbed
-> Bool | `ownerEvents`: if `False` then all device events are reported with respect to `window` and are only reported if selected by `eventMask`. If `True` then pointer events for this application are reported as normal, but pointer events outside this application are reported with respect to `window` and only if selected by `eventMask`. In either mode, unreported events are discarded.
-> Maybe c | `cursor`: the cursor to display while the grab is active. If this is `Nothing` then the normal cursors are used for `window` and its descendants, and the cursor for `window` is used elsewhere.
-> Maybe Event | `event`: the event that is triggering the grab, or `Nothing` if none is available.
-> Maybe SeatGrabPrepareFunc | `prepareFunc`: function to prepare the window to be grabbed, it can be `Nothing` if `window` is visible before this call.
-> m GrabStatus | Returns: `GrabStatusSuccess` if the grab was successful.

Grabs the seat so that all events corresponding to the given `capabilities` are passed to this application until the seat is ungrabbed with `seatUngrab`, or the window becomes hidden. This overrides any previous grab on the seat by this client.

As a rule of thumb, if a grab is desired over `SeatCapabilitiesPointer`, all other "pointing" capabilities (eg. `SeatCapabilitiesTouch`) should be grabbed too, so the user is able to interact with all of those while the grab holds, you should thus use `SeatCapabilitiesAllPointing` most commonly.

Grabs are used for operations which need complete control over the events corresponding to the given capabilities. For example in GTK+ this is used for Drag and Drop operations, popup menus and such.

Note that if the event mask of a `Window` has selected both button press and button release events, or touch begin and touch end, then a press event will cause an automatic grab until the button is released, equivalent to a grab on the window with `ownerEvents` set to `True`. This is done because most applications expect to receive paired press and release events.

If you set up anything at the time you take the grab that needs to be cleaned up when the grab ends, you should handle the `EventGrabBroken` events that are emitted when the grab ends unvoluntarily.

Since: 3.20

## ungrab

seatUngrab Source #

Arguments

:: (HasCallStack, MonadIO m, IsSeat a) |
=> a | `seat`: a `Seat`
-> m () |

Releases a grab added through `seatGrab`.

Since: 3.20

# Properties

## display

`Display` of this seat.

Since: 3.20

constructSeatDisplay :: (IsSeat o, MonadIO m, IsDisplay a) => a -> m (GValueConstruct o) Source #

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

getSeatDisplay :: (MonadIO m, IsSeat o) => o -> m Display Source #

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

    get seat #display

# Signals

## deviceAdded

type SeatDeviceAddedCallback Source #

Arguments

= Device | `device`: the newly added `Device`.
-> IO () |

The deviceAdded signal is emitted when a new input device is related to this seat.

Since: 3.20

afterSeatDeviceAdded :: (IsSeat a, MonadIO m) => a -> ((?self :: a) => SeatDeviceAddedCallback) -> m SignalHandlerId Source #

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

    after seat #deviceAdded 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.

onSeatDeviceAdded :: (IsSeat a, MonadIO m) => a -> ((?self :: a) => SeatDeviceAddedCallback) -> m SignalHandlerId Source #

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

    on seat #deviceAdded callback

## deviceRemoved

type SeatDeviceRemovedCallback Source #

Arguments

= Device | `device`: the just removed `Device`.
-> IO () |

The deviceRemoved signal is emitted when an input device is removed (e.g. unplugged).

Since: 3.20

afterSeatDeviceRemoved :: (IsSeat a, MonadIO m) => a -> ((?self :: a) => SeatDeviceRemovedCallback) -> m SignalHandlerId Source #

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

    after seat #deviceRemoved 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.

onSeatDeviceRemoved :: (IsSeat a, MonadIO m) => a -> ((?self :: a) => SeatDeviceRemovedCallback) -> m SignalHandlerId Source #

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

    on seat #deviceRemoved callback

## toolAdded

type SeatToolAddedCallback Source #

Arguments

= DeviceTool | `tool`: the new `DeviceTool` known to the seat
-> IO () |

The toolAdded signal is emitted whenever a new tool is made known to the seat. The tool may later be assigned to a device (i.e. on proximity with a tablet). The device will emit the Device::toolChanged signal accordingly.

A same tool may be used by several devices.

Since: 3.22

afterSeatToolAdded :: (IsSeat a, MonadIO m) => a -> ((?self :: a) => SeatToolAddedCallback) -> m SignalHandlerId Source #

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

    after seat #toolAdded 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.

onSeatToolAdded :: (IsSeat a, MonadIO m) => a -> ((?self :: a) => SeatToolAddedCallback) -> m SignalHandlerId Source #

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

    on seat #toolAdded callback

## toolRemoved

type SeatToolRemovedCallback Source #

Arguments

= DeviceTool | `tool`: the just removed `DeviceTool`
-> IO () |

This signal is emitted whenever a tool is no longer known to this `seat`.

Since: 3.22

afterSeatToolRemoved :: (IsSeat a, MonadIO m) => a -> ((?self :: a) => SeatToolRemovedCallback) -> m SignalHandlerId Source #

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

    after seat #toolRemoved 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.

onSeatToolRemoved :: (IsSeat a, MonadIO m) => a -> ((?self :: a) => SeatToolRemovedCallback) -> m SignalHandlerId Source #

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

    on seat #toolRemoved callback