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.Clutter.Unions.Event
Contents
- Exported types
- Methods
- addFilter
- copy
- free
- get
- getAngle
- getAxes
- getButton
- getClickCount
- getCoords
- getDevice
- getDeviceId
- getDeviceType
- getDistance
- getEventSequence
- getFlags
- getGestureMotionDelta
- getGesturePhase
- getGesturePinchAngleDelta
- getGesturePinchScale
- getGestureSwipeFingerCount
- getKeyCode
- getKeySymbol
- getKeyUnicode
- getPosition
- getRelated
- getScrollDelta
- getScrollDirection
- getSource
- getSourceDevice
- getStage
- getState
- getStateFull
- getTime
- hasControlModifier
- hasShiftModifier
- isPointerEmulated
- new
- peek
- put
- removeFilter
- setButton
- setCoords
- setDevice
- setFlags
- setKeyCode
- setKeySymbol
- setKeyUnicode
- setRelated
- setScrollDelta
- setScrollDirection
- setSource
- setSourceDevice
- setStage
- setState
- setTime
- type
Description
Generic event wrapper.
Since: 0.2
Synopsis
- newtype Event = Event (ManagedPtr Event)
- newZeroEvent :: MonadIO m => m Event
- eventAddFilter :: (HasCallStack, MonadIO m, IsStage a) => Maybe a -> EventFilterFunc -> m Word32
- eventCopy :: (HasCallStack, MonadIO m) => Event -> m Event
- eventFree :: (HasCallStack, MonadIO m) => Event -> m ()
- eventGet :: (HasCallStack, MonadIO m) => m Event
- eventGetAngle :: (HasCallStack, MonadIO m) => Event -> Event -> m Double
- eventGetAxes :: (HasCallStack, MonadIO m) => Event -> m (Double, Word32)
- eventGetButton :: (HasCallStack, MonadIO m) => Event -> m Word32
- eventGetClickCount :: (HasCallStack, MonadIO m) => Event -> m Word32
- eventGetCoords :: (HasCallStack, MonadIO m) => Event -> m (Float, Float)
- eventGetDevice :: (HasCallStack, MonadIO m) => Event -> m InputDevice
- eventGetDeviceId :: (HasCallStack, MonadIO m) => Event -> m Int32
- eventGetDeviceType :: (HasCallStack, MonadIO m) => Event -> m InputDeviceType
- eventGetDistance :: (HasCallStack, MonadIO m) => Event -> Event -> m Float
- eventGetEventSequence :: (HasCallStack, MonadIO m) => Event -> m EventSequence
- eventGetFlags :: (HasCallStack, MonadIO m) => Event -> m [EventFlags]
- eventGetGestureMotionDelta :: (HasCallStack, MonadIO m) => Event -> m (Double, Double)
- eventGetGesturePhase :: (HasCallStack, MonadIO m) => Event -> m TouchpadGesturePhase
- eventGetGesturePinchAngleDelta :: (HasCallStack, MonadIO m) => Event -> m Double
- eventGetGesturePinchScale :: (HasCallStack, MonadIO m) => Event -> m Double
- eventGetGestureSwipeFingerCount :: (HasCallStack, MonadIO m) => Event -> m Word32
- eventGetKeyCode :: (HasCallStack, MonadIO m) => Event -> m Word16
- eventGetKeySymbol :: (HasCallStack, MonadIO m) => Event -> m Word32
- eventGetKeyUnicode :: (HasCallStack, MonadIO m) => Event -> m Char
- eventGetPosition :: (HasCallStack, MonadIO m) => Event -> Point -> m ()
- eventGetRelated :: (HasCallStack, MonadIO m) => Event -> m Actor
- eventGetScrollDelta :: (HasCallStack, MonadIO m) => Event -> m (Double, Double)
- eventGetScrollDirection :: (HasCallStack, MonadIO m) => Event -> m ScrollDirection
- eventGetSource :: (HasCallStack, MonadIO m) => Event -> m Actor
- eventGetSourceDevice :: (HasCallStack, MonadIO m) => Event -> m InputDevice
- eventGetStage :: (HasCallStack, MonadIO m) => Event -> m Stage
- eventGetState :: (HasCallStack, MonadIO m) => Event -> m [ModifierType]
- eventGetStateFull :: (HasCallStack, MonadIO m) => Event -> m ([ModifierType], [ModifierType], [ModifierType], [ModifierType], [ModifierType])
- eventGetTime :: (HasCallStack, MonadIO m) => Event -> m Word32
- eventHasControlModifier :: (HasCallStack, MonadIO m) => Event -> m Bool
- eventHasShiftModifier :: (HasCallStack, MonadIO m) => Event -> m Bool
- eventIsPointerEmulated :: (HasCallStack, MonadIO m) => Event -> m Bool
- eventNew :: (HasCallStack, MonadIO m) => EventType -> m Event
- eventPeek :: (HasCallStack, MonadIO m) => m Event
- eventPut :: (HasCallStack, MonadIO m) => Event -> m ()
- eventRemoveFilter :: (HasCallStack, MonadIO m) => Word32 -> m ()
- eventSetButton :: (HasCallStack, MonadIO m) => Event -> Word32 -> m ()
- eventSetCoords :: (HasCallStack, MonadIO m) => Event -> Float -> Float -> m ()
- eventSetDevice :: (HasCallStack, MonadIO m, IsInputDevice a) => Event -> Maybe a -> m ()
- eventSetFlags :: (HasCallStack, MonadIO m) => Event -> [EventFlags] -> m ()
- eventSetKeyCode :: (HasCallStack, MonadIO m) => Event -> Word16 -> m ()
- eventSetKeySymbol :: (HasCallStack, MonadIO m) => Event -> Word32 -> m ()
- eventSetKeyUnicode :: (HasCallStack, MonadIO m) => Event -> Char -> m ()
- eventSetRelated :: (HasCallStack, MonadIO m, IsActor a) => Event -> Maybe a -> m ()
- eventSetScrollDelta :: (HasCallStack, MonadIO m) => Event -> Double -> Double -> m ()
- eventSetScrollDirection :: (HasCallStack, MonadIO m) => Event -> ScrollDirection -> m ()
- eventSetSource :: (HasCallStack, MonadIO m, IsActor a) => Event -> Maybe a -> m ()
- eventSetSourceDevice :: (HasCallStack, MonadIO m, IsInputDevice a) => Event -> Maybe a -> m ()
- eventSetStage :: (HasCallStack, MonadIO m, IsStage a) => Event -> Maybe a -> m ()
- eventSetState :: (HasCallStack, MonadIO m) => Event -> [ModifierType] -> m ()
- eventSetTime :: (HasCallStack, MonadIO m) => Event -> Word32 -> m ()
- eventType :: (HasCallStack, MonadIO m) => Event -> m EventType
Exported types
Memory-managed wrapper type.
Instances
Eq Event Source # | |
GBoxed Event Source # | |
Defined in GI.Clutter.Unions.Event | |
ManagedPtrNewtype Event Source # | |
Defined in GI.Clutter.Unions.Event Methods toManagedPtr :: Event -> ManagedPtr Event | |
TypedObject Event Source # | |
Defined in GI.Clutter.Unions.Event | |
HasParentTypes Event Source # | |
Defined in GI.Clutter.Unions.Event | |
tag ~ 'AttrSet => Constructible Event tag Source # | |
IsGValue (Maybe Event) Source # | Convert |
Defined in GI.Clutter.Unions.Event Methods gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Event -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Event) | |
type ParentTypes Event Source # | |
Defined in GI.Clutter.Unions.Event |
Methods
Click to display all available methods, including inherited ones
Methods
copy, free, hasControlModifier, hasShiftModifier, isPointerEmulated, put, type.
Getters
getAngle, getAxes, getButton, getClickCount, getCoords, getDevice, getDeviceId, getDeviceType, getDistance, getEventSequence, getFlags, getGestureMotionDelta, getGesturePhase, getGesturePinchAngleDelta, getGesturePinchScale, getGestureSwipeFingerCount, getKeyCode, getKeySymbol, getKeyUnicode, getPosition, getRelated, getScrollDelta, getScrollDirection, getSource, getSourceDevice, getStage, getState, getStateFull, getTime.
Setters
setButton, setCoords, setDevice, setFlags, setKeyCode, setKeySymbol, setKeyUnicode, setRelated, setScrollDelta, setScrollDirection, setSource, setSourceDevice, setStage, setState, setTime.
addFilter
Arguments
:: (HasCallStack, MonadIO m, IsStage a) | |
=> Maybe a |
|
-> EventFilterFunc |
|
-> m Word32 | Returns: an identifier for the event filter, to be used
with |
Adds a function which will be called for all events that Clutter processes. The function will be called before any signals are emitted for the event and it will take precedence over any grabs.
Since: 1.18
copy
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m Event | Returns: A newly allocated |
Copies event
.
free
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m () |
Frees all resources used by event
.
get
Arguments
:: (HasCallStack, MonadIO m) | |
=> m Event | Returns: A |
Pops an event off the event queue. Applications should not need to call this.
Since: 0.4
getAngle
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> Event |
|
-> m Double | Returns: the angle between two |
Retrieves the angle relative from source
to target
.
The direction of the angle is from the position X axis towards the positive Y axis.
Since: 1.12
getAxes
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m (Double, Word32) | Returns: an array of axis values |
Retrieves the array of axes values attached to the event.
Since: 1.6
getButton
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m Word32 | Returns: the button number |
Retrieves the button number of event
Since: 1.0
getClickCount
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m Word32 | Returns: the click count |
Retrieves the number of clicks of event
Since: 1.0
getCoords
Retrieves the coordinates of event
and puts them into x
and y
.
Since: 0.4
getDevice
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m InputDevice | Returns: the |
Retrieves the InputDevice
for the event.
If you want the physical device the event originated from, use
eventGetSourceDevice
.
The InputDevice
structure is completely opaque and should
be cast to the platform-specific implementation.
Since: 1.0
getDeviceId
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m Int32 | Returns: A unique identifier for the device or -1 if the event has no specific device set. |
Retrieves the events device id if set.
getDeviceType
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m InputDeviceType | Returns: the |
Retrieves the type of the device for event
Since: 1.0
getDistance
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> Event |
|
-> m Float | Returns: the distance between two |
Retrieves the distance between two events, a source
and a target
.
Since: 1.12
getEventSequence
eventGetEventSequence Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m EventSequence | Returns: the event sequence, or |
Retrieves the EventSequence
of event
.
Since: 1.10
getFlags
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m [EventFlags] | Returns: the event flags |
Retrieves the EventFlags
of event
Since: 1.0
getGestureMotionDelta
eventGetGestureMotionDelta Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m (Double, Double) |
Returns the gesture motion deltas relative to the current pointer position.
Since: 1.24
getGesturePhase
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m TouchpadGesturePhase | Returns: the phase of the gesture event. |
Returns the phase of the event, See TouchpadGesturePhase
.
getGesturePinchAngleDelta
eventGetGesturePinchAngleDelta Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m Double | Returns: The angle delta relative to the previous event. |
Returns the angle delta reported by this specific event.
Since: 1.24
getGesturePinchScale
eventGetGesturePinchScale Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m Double | Returns: the current pinch gesture scale |
Returns the current scale as reported by event
, 1.0 being the original
distance at the time the corresponding event with phase
TouchpadGesturePhaseBegin
is received.
is received.
Since: 1.24
getGestureSwipeFingerCount
eventGetGestureSwipeFingerCount Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m Word32 | Returns: the number of fingers swiping. |
Returns the number of fingers that is triggering the touchpad gesture.
Since: 1.24
getKeyCode
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m Word16 | Returns: The keycode representing the key |
Retrieves the keycode of the key that caused event
Since: 1.0
getKeySymbol
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m Word32 | Returns: the key symbol representing the key |
Retrieves the key symbol of event
Since: 1.0
getKeyUnicode
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m Char | Returns: The unicode value representing the key |
Retrieves the unicode value for the key that caused keyev
.
getPosition
Retrieves the event coordinates as a Point
.
Since: 1.12
getRelated
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m Actor |
Retrieves the related actor of a crossing event.
Since: 1.0
getScrollDelta
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m (Double, Double) |
Retrieves the precise scrolling information of event
.
The event
has to have a ScrollEvent
.direction
value
of ScrollDirectionSmooth
.
Since: 1.10
getScrollDirection
eventGetScrollDirection Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m ScrollDirection | Returns: the scrolling direction |
Retrieves the direction of the scrolling of event
Since: 1.0
getSource
Retrieves the source Actor
the event originated from, or
NULL if the event has no source.
Since: 0.6
getSourceDevice
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m InputDevice | Returns: a pointer to a |
Retrieves the hardware device that originated the event.
If you need the virtual device, use eventGetDevice
.
If no hardware device originated this event, this function will
return the same device as eventGetDevice
.
Since: 1.6
getStage
getState
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m [ModifierType] | Returns: the modifier state parameter, or 0 |
Retrieves the modifier state of the event. In case the window system supports reporting latched and locked modifiers, this function returns the effective state.
Since: 0.4
getStateFull
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m ([ModifierType], [ModifierType], [ModifierType], [ModifierType], [ModifierType]) |
Retrieves the decomposition of the keyboard state into button, base, latched, locked and effective. This can be used to transmit to other applications, for example when implementing a wayland compositor.
Since: 1.16
getTime
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m Word32 | Returns: the time of the event, or |
Retrieves the time of the event.
Since: 0.4
hasControlModifier
eventHasControlModifier Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m Bool | Returns: |
Checks whether event
has the Control modifier mask set.
Since: 1.12
hasShiftModifier
eventHasShiftModifier Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m Bool | Returns: |
Checks whether event
has the Shift modifier mask set.
Since: 1.12
isPointerEmulated
eventIsPointerEmulated Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m Bool | Returns: |
Checks whether a pointer event
has been generated by the windowing
system. The returned value can be used to distinguish between events
synthesized by the windowing system itself (as opposed by Clutter).
Since: 1.12
new
Arguments
:: (HasCallStack, MonadIO m) | |
=> EventType |
|
-> m Event | Returns: A newly allocated |
Creates a new Event
of the specified type.
peek
Arguments
:: (HasCallStack, MonadIO m) | |
=> m Event | Returns: A |
Returns a pointer to the first event from the event queue but does not remove it.
Since: 0.4
put
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m () |
Puts a copy of the event on the back of the event queue. The event will
have the EventFlagsFlagSynthetic
flag set. If the source is set
event signals will be emitted for this source and capture/bubbling for
its ancestors. If the source is not set it will be generated by picking
or use the actor that currently has keyboard focus
Since: 0.6
removeFilter
Arguments
:: (HasCallStack, MonadIO m) | |
=> Word32 |
|
-> m () |
Removes an event filter that was previously added with
eventAddFilter
.
Since: 1.18
setButton
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> Word32 |
|
-> m () |
Sets the button number of event
Since: 1.8
setCoords
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> Float |
|
-> Float |
|
-> m () |
Sets the coordinates of the event
.
Since: 1.8
setDevice
Arguments
:: (HasCallStack, MonadIO m, IsInputDevice a) | |
=> Event |
|
-> Maybe a |
|
-> m () |
Sets the device for event
.
Since: 1.6
setFlags
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> [EventFlags] |
|
-> m () |
Sets the EventFlags
of event
Since: 1.8
setKeyCode
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> Word16 |
|
-> m () |
Sets the keycode of the event
.
Since: 1.8
setKeySymbol
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> Word32 |
|
-> m () |
Sets the key symbol of event
.
Since: 1.8
setKeyUnicode
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> Char |
|
-> m () |
Sets the Unicode value of event
.
Since: 1.8
setRelated
Arguments
:: (HasCallStack, MonadIO m, IsActor a) | |
=> Event |
|
-> Maybe a | |
-> m () |
Sets the related actor of a crossing event
Since: 1.8
setScrollDelta
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> Double |
|
-> Double |
|
-> m () |
Sets the precise scrolling information of event
.
Since: 1.10
setScrollDirection
eventSetScrollDirection Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> ScrollDirection |
|
-> m () |
Sets the direction of the scrolling of event
Since: 1.8
setSource
Sets the source Actor
of event
.
Since: 1.8
setSourceDevice
Arguments
:: (HasCallStack, MonadIO m, IsInputDevice a) | |
=> Event |
|
-> Maybe a |
|
-> m () |
setStage
Sets the source Stage
of the event.
Since: 1.8
setState
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> [ModifierType] |
|
-> m () |
Sets the modifier state of the event.
Since: 1.8
setTime
Arguments
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> Word32 |
|
-> m () |
Sets the time of the event.
Since: 1.8