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

Contents

- Exported types
- Methods
  - getCurrentEvent
  - getCurrentEventDevice
  - getCurrentEventState
  - getCurrentEventTime
  - getName
  - getPropagationLimit
  - getPropagationPhase
  - getWidget
  - reset
  - setName
  - setPropagationLimit
  - setPropagationPhase
  - setStaticName
- Properties
  - name
  - propagationLimit
  - propagationPhase
  - widget

Description

The base class for event controllers.

These are ancillary objects associated to widgets, which react to `GdkEvents`, and possibly trigger actions as a consequence.

Event controllers are added to a widget with `widgetAddController`. It is rarely necessary to explicitly remove a controller with `widgetRemoveController`.

See the chapter on input handling for an overview of the basic concepts, such as the capture and bubble phases of event propagation.

Synopsis

- newtype EventController = EventController (ManagedPtr EventController)
- class (GObject o, IsDescendantOf EventController o) => IsEventController o
- toEventController :: (MonadIO m, IsEventController o) => o -> m EventController
- eventControllerGetCurrentEvent :: (HasCallStack, MonadIO m, IsEventController a) => a -> m (Maybe Event)
- eventControllerGetCurrentEventDevice :: (HasCallStack, MonadIO m, IsEventController a) => a -> m (Maybe Device)
- eventControllerGetCurrentEventState :: (HasCallStack, MonadIO m, IsEventController a) => a -> m [ModifierType]
- eventControllerGetCurrentEventTime :: (HasCallStack, MonadIO m, IsEventController a) => a -> m Word32
- eventControllerGetName :: (HasCallStack, MonadIO m, IsEventController a) => a -> m (Maybe Text)
- eventControllerGetPropagationLimit :: (HasCallStack, MonadIO m, IsEventController a) => a -> m PropagationLimit
- eventControllerGetPropagationPhase :: (HasCallStack, MonadIO m, IsEventController a) => a -> m PropagationPhase
- eventControllerGetWidget :: (HasCallStack, MonadIO m, IsEventController a) => a -> m (Maybe Widget)
- eventControllerReset :: (HasCallStack, MonadIO m, IsEventController a) => a -> m ()
- eventControllerSetName :: (HasCallStack, MonadIO m, IsEventController a) => a -> Maybe Text -> m ()
- eventControllerSetPropagationLimit :: (HasCallStack, MonadIO m, IsEventController a) => a -> PropagationLimit -> m ()
- eventControllerSetPropagationPhase :: (HasCallStack, MonadIO m, IsEventController a) => a -> PropagationPhase -> m ()
- eventControllerSetStaticName :: (HasCallStack, MonadIO m, IsEventController a) => a -> Maybe Text -> m ()
- clearEventControllerName :: (MonadIO m, IsEventController o) => o -> m ()
- constructEventControllerName :: (IsEventController o, MonadIO m) => Text -> m (GValueConstruct o)
- getEventControllerName :: (MonadIO m, IsEventController o) => o -> m (Maybe Text)
- setEventControllerName :: (MonadIO m, IsEventController o) => o -> Text -> m ()
- constructEventControllerPropagationLimit :: (IsEventController o, MonadIO m) => PropagationLimit -> m (GValueConstruct o)
- getEventControllerPropagationLimit :: (MonadIO m, IsEventController o) => o -> m PropagationLimit
- setEventControllerPropagationLimit :: (MonadIO m, IsEventController o) => o -> PropagationLimit -> m ()
- constructEventControllerPropagationPhase :: (IsEventController o, MonadIO m) => PropagationPhase -> m (GValueConstruct o)
- getEventControllerPropagationPhase :: (MonadIO m, IsEventController o) => o -> m PropagationPhase
- setEventControllerPropagationPhase :: (MonadIO m, IsEventController o) => o -> PropagationPhase -> m ()
- getEventControllerWidget :: (MonadIO m, IsEventController o) => o -> m (Maybe Widget)

# Exported types

newtype EventController Source #

Memory-managed wrapper type.

Constructors

EventController (ManagedPtr EventController) |

#### Instances

Instances details

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

class (GObject o, IsDescendantOf EventController o) => IsEventController o Source #

Type class for types which can be safely cast to `EventController`, for instance with `toEventController`.

#### Instances

Instances details

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

toEventController :: (MonadIO m, IsEventController o) => o -> m EventController Source #

Cast to `EventController`, 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, isFloating, 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.

## getCurrentEvent

eventControllerGetCurrentEvent Source #

Arguments

:: (HasCallStack, MonadIO m, IsEventController a) |
=> a | `controller`: a `GtkEventController`
-> m (Maybe Event) | Returns: the event that is currently handled by `controller`

Returns the event that is currently being handled by the controller.

At other times, `Nothing` is returned.

## getCurrentEventDevice

eventControllerGetCurrentEventDevice Source #

Arguments

:: (HasCallStack, MonadIO m, IsEventController a) |
=> a | `controller`: a `GtkEventController`
-> m (Maybe Device) | Returns: device of the event is currently handled by `controller`

Returns the device of the event that is currently being handled by the controller.

At other times, `Nothing` is returned.

## getCurrentEventState

eventControllerGetCurrentEventState Source #

Arguments

:: (HasCallStack, MonadIO m, IsEventController a) |
=> a | `controller`: a `GtkEventController`
-> m [ModifierType] | Returns: modifier state of the event is currently handled by `controller`

Returns the modifier state of the event that is currently being handled by the controller.

At other times, 0 is returned.

## getCurrentEventTime

eventControllerGetCurrentEventTime Source #

Arguments

:: (HasCallStack, MonadIO m, IsEventController a) |
=> a | `controller`: a `GtkEventController`
-> m Word32 | Returns: timestamp of the event is currently handled by `controller`

Returns the timestamp of the event that is currently being handled by the controller.

At other times, 0 is returned.

## getName

eventControllerGetName Source #

Arguments

:: (HasCallStack, MonadIO m, IsEventController a) |
=> a | `controller`: a `GtkEventController`
-> m (Maybe Text) | Returns: The controller name

Gets the name of `controller`.

## getPropagationLimit

eventControllerGetPropagationLimit Source #

Arguments

:: (HasCallStack, MonadIO m, IsEventController a) |
=> a | `controller`: a `GtkEventController`
-> m PropagationLimit | Returns: the propagation limit

Gets the propagation limit of the event controller.

## getPropagationPhase

eventControllerGetPropagationPhase Source #

Arguments

:: (HasCallStack, MonadIO m, IsEventController a) |
=> a | `controller`: a `GtkEventController`
-> m PropagationPhase | Returns: the propagation phase

Gets the propagation phase at which `controller` handles events.

## getWidget

eventControllerGetWidget Source #

Arguments

:: (HasCallStack, MonadIO m, IsEventController a) |
=> a | `controller`: a `GtkEventController`
-> m (Maybe Widget) | Returns: a `GtkWidget`

Returns the `GtkWidget` this controller relates to.

## reset

eventControllerReset Source #

Arguments

:: (HasCallStack, MonadIO m, IsEventController a) |
=> a | `controller`: a `GtkEventController`
-> m () |

Resets the `controller` to a clean state.

## setName

eventControllerSetName Source #

Arguments

:: (HasCallStack, MonadIO m, IsEventController a) |
=> a | `controller`: a `GtkEventController`
-> Maybe Text | `name`: a name for `controller`
-> m () |

Sets a name on the controller that can be used for debugging.

## setPropagationLimit

eventControllerSetPropagationLimit Source #

Arguments

:: (HasCallStack, MonadIO m, IsEventController a) |
=> a | `controller`: a `GtkEventController`
-> PropagationLimit | `limit`: the propagation limit
-> m () |

Sets the event propagation limit on the event controller.

If the limit is set to `PropagationLimitSameNative`, the controller won't handle events that are targeted at widgets on a different surface, such as popovers.

## setPropagationPhase

eventControllerSetPropagationPhase Source #

Arguments

:: (HasCallStack, MonadIO m, IsEventController a) |
=> a | `controller`: a `GtkEventController`
-> PropagationPhase | `phase`: a propagation phase
-> m () |

Sets the propagation phase at which a controller handles events.

If `phase` is `PropagationPhaseNone`, no automatic event handling will be performed, but other additional gesture maintenance will.

## setStaticName

eventControllerSetStaticName Source #

Arguments

:: (HasCallStack, MonadIO m, IsEventController a) |
=> a | `controller`: a `GtkEventController`
-> Maybe Text | `name`: a name for `controller`, must be a static string
-> m () |

Sets a name on the controller that can be used for debugging.

Since: 4.8

# Properties

## name

The name for this controller, typically used for debugging purposes.

clearEventControllerName :: (MonadIO m, IsEventController o) => o -> m () Source #

Set the value of the “`name`” property to `Nothing`. When overloading is enabled, this is equivalent to

    clear #name

constructEventControllerName :: (IsEventController o, MonadIO m) => Text -> m (GValueConstruct o) Source #

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

getEventControllerName :: (MonadIO m, IsEventController o) => o -> m (Maybe Text) Source #

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

    get eventController #name

setEventControllerName :: (MonadIO m, IsEventController o) => o -> Text -> m () Source #

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

    set eventController [ #name := value ]

## propagationLimit

The limit for which events this controller will handle.

constructEventControllerPropagationLimit :: (IsEventController o, MonadIO m) => PropagationLimit -> m (GValueConstruct o) Source #

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

getEventControllerPropagationLimit :: (MonadIO m, IsEventController o) => o -> m PropagationLimit Source #

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

    get eventController #propagationLimit

setEventControllerPropagationLimit :: (MonadIO m, IsEventController o) => o -> PropagationLimit -> m () Source #

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

    set eventController [ #propagationLimit := value ]

## propagationPhase

The propagation phase at which this controller will handle events.

constructEventControllerPropagationPhase :: (IsEventController o, MonadIO m) => PropagationPhase -> m (GValueConstruct o) Source #

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

getEventControllerPropagationPhase :: (MonadIO m, IsEventController o) => o -> m PropagationPhase Source #

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

    get eventController #propagationPhase

setEventControllerPropagationPhase :: (MonadIO m, IsEventController o) => o -> PropagationPhase -> m () Source #

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

    set eventController [ #propagationPhase := value ]

## widget

The widget receiving the `GdkEvents` that the controller will handle.

getEventControllerWidget :: (MonadIO m, IsEventController o) => o -> m (Maybe Widget) Source #

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

    get eventController #widget