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 |
- Exported types
- Methods
- eventGetCoordinates
- eventGetType
- eventNewCommand
- eventNewKeyPress
- eventNewKeyRelease
- eventNewMouseButtonPress
- eventNewMouseButtonRelease
- eventNewMouseMove
- eventNewMouseScroll
- eventNewTouchCancel
- eventNewTouchDown
- eventNewTouchFrame
- eventNewTouchMotion
- eventNewTouchUp
- eventParseCommand
- eventParseKeyEvent
- eventParseModifierState
- eventParseMouseButtonEvent
- eventParseMouseMoveEvent
- eventParseMouseScrollEvent
- eventParseTouchEvent
- eventParseTouchUpEvent
- eventSetCoordinates
- messageGetType
- messageNewAnglesChanged
- messageNewCommandsChanged
- messageNewEvent
- messageNewMouseOver
- messageParseAnglesChanged
- messageParseEvent
- messageParseMouseOver
- queryGetType
- queryNewAngles
- queryNewCommands
- queryParseAngles
- queryParseCommandsLength
- queryParseCommandsNth
- querySetAngles
- querySetCommandsv
- sendCommand
- sendEvent
- sendEventSimple
- sendKeyEvent
- sendMouseEvent
- sendMouseScrollEvent
The Navigation interface is used for creating and injecting navigation related events such as mouse button presses, cursor motion and key presses. The associated library also provides methods for parsing received events, and for sending and receiving navigation related bus events. One main usecase is DVD menu navigation.
The main parts of the API are:
- The GstNavigation interface, implemented by elements which provide an application with the ability to create and inject navigation events into the pipeline.
- GstNavigation event handling API. GstNavigation events are created in response to calls on a GstNavigation interface implementation, and sent in the pipeline. Upstream elements can use the navigation event API functions to parse the contents of received messages.
- GstNavigation message handling API. GstNavigation messages may be sent on the message bus to inform applications of navigation related changes in the pipeline, such as the mouse moving over a clickable region, or the set of available angles changing.
The GstNavigation message functions provide functions for creating and parsing custom bus messages for signaling GstNavigation changes.
Synopsis
- newtype Navigation = Navigation (ManagedPtr Navigation)
- class (ManagedPtrNewtype o, IsDescendantOf Navigation o) => IsNavigation o
- navigationEventGetCoordinates :: (HasCallStack, MonadIO m) => Event -> m (Bool, Double, Double)
- navigationEventGetType :: (HasCallStack, MonadIO m) => Event -> m NavigationEventType
- navigationEventNewCommand :: (HasCallStack, MonadIO m) => NavigationCommand -> m Event
- navigationEventNewKeyPress :: (HasCallStack, MonadIO m) => Text -> [NavigationModifierType] -> m Event
- navigationEventNewKeyRelease :: (HasCallStack, MonadIO m) => Text -> [NavigationModifierType] -> m Event
- navigationEventNewMouseButtonPress :: (HasCallStack, MonadIO m) => Int32 -> Double -> Double -> [NavigationModifierType] -> m Event
- navigationEventNewMouseButtonRelease :: (HasCallStack, MonadIO m) => Int32 -> Double -> Double -> [NavigationModifierType] -> m Event
- navigationEventNewMouseMove :: (HasCallStack, MonadIO m) => Double -> Double -> [NavigationModifierType] -> m Event
- navigationEventNewMouseScroll :: (HasCallStack, MonadIO m) => Double -> Double -> Double -> Double -> [NavigationModifierType] -> m Event
- navigationEventNewTouchCancel :: (HasCallStack, MonadIO m) => [NavigationModifierType] -> m Event
- navigationEventNewTouchDown :: (HasCallStack, MonadIO m) => Word32 -> Double -> Double -> Double -> [NavigationModifierType] -> m Event
- navigationEventNewTouchFrame :: (HasCallStack, MonadIO m) => [NavigationModifierType] -> m Event
- navigationEventNewTouchMotion :: (HasCallStack, MonadIO m) => Word32 -> Double -> Double -> Double -> [NavigationModifierType] -> m Event
- navigationEventNewTouchUp :: (HasCallStack, MonadIO m) => Word32 -> Double -> Double -> [NavigationModifierType] -> m Event
- navigationEventParseCommand :: (HasCallStack, MonadIO m) => Event -> m (Bool, NavigationCommand)
- navigationEventParseKeyEvent :: (HasCallStack, MonadIO m) => Event -> m (Bool, Text)
- navigationEventParseModifierState :: (HasCallStack, MonadIO m) => Event -> [NavigationModifierType] -> m Bool
- navigationEventParseMouseButtonEvent :: (HasCallStack, MonadIO m) => Event -> m (Bool, Int32, Double, Double)
- navigationEventParseMouseMoveEvent :: (HasCallStack, MonadIO m) => Event -> m (Bool, Double, Double)
- navigationEventParseMouseScrollEvent :: (HasCallStack, MonadIO m) => Event -> m (Bool, Double, Double, Double, Double)
- navigationEventParseTouchEvent :: (HasCallStack, MonadIO m) => Event -> m (Bool, Word32, Double, Double, Double)
- navigationEventParseTouchUpEvent :: (HasCallStack, MonadIO m) => Event -> m (Bool, Word32, Double, Double)
- navigationEventSetCoordinates :: (HasCallStack, MonadIO m) => Event -> Double -> Double -> m Bool
- navigationMessageGetType :: (HasCallStack, MonadIO m) => Message -> m NavigationMessageType
- navigationMessageNewAnglesChanged :: (HasCallStack, MonadIO m, IsObject a) => a -> Word32 -> Word32 -> m Message
- navigationMessageNewCommandsChanged :: (HasCallStack, MonadIO m, IsObject a) => a -> m Message
- navigationMessageNewEvent :: (HasCallStack, MonadIO m, IsObject a) => a -> Event -> m Message
- navigationMessageNewMouseOver :: (HasCallStack, MonadIO m, IsObject a) => a -> Bool -> m Message
- navigationMessageParseAnglesChanged :: (HasCallStack, MonadIO m) => Message -> m (Bool, Word32, Word32)
- navigationMessageParseEvent :: (HasCallStack, MonadIO m) => Message -> m (Bool, Event)
- navigationMessageParseMouseOver :: (HasCallStack, MonadIO m) => Message -> m (Bool, Bool)
- navigationQueryGetType :: (HasCallStack, MonadIO m) => Query -> m NavigationQueryType
- navigationQueryNewAngles :: (HasCallStack, MonadIO m) => m Query
- navigationQueryNewCommands :: (HasCallStack, MonadIO m) => m Query
- navigationQueryParseAngles :: (HasCallStack, MonadIO m) => Query -> m (Bool, Word32, Word32)
- navigationQueryParseCommandsLength :: (HasCallStack, MonadIO m) => Query -> m (Bool, Word32)
- navigationQueryParseCommandsNth :: (HasCallStack, MonadIO m) => Query -> Word32 -> m (Bool, NavigationCommand)
- navigationQuerySetAngles :: (HasCallStack, MonadIO m) => Query -> Word32 -> Word32 -> m ()
- navigationQuerySetCommandsv :: (HasCallStack, MonadIO m) => Query -> [NavigationCommand] -> m ()
- navigationSendCommand :: (HasCallStack, MonadIO m, IsNavigation a) => a -> NavigationCommand -> m ()
- navigationSendEvent :: (HasCallStack, MonadIO m, IsNavigation a) => a -> Structure -> m ()
- navigationSendEventSimple :: (HasCallStack, MonadIO m, IsNavigation a) => a -> Event -> m ()
- navigationSendKeyEvent :: (HasCallStack, MonadIO m, IsNavigation a) => a -> Text -> Text -> m ()
- navigationSendMouseEvent :: (HasCallStack, MonadIO m, IsNavigation a) => a -> Text -> Int32 -> Double -> Double -> m ()
- navigationSendMouseScrollEvent :: (HasCallStack, MonadIO m, IsNavigation a) => a -> Double -> Double -> Double -> Double -> m ()
Exported types
class (ManagedPtrNewtype o, IsDescendantOf Navigation o) => IsNavigation o Source #
Type class for types which implement Navigation
.
Instances
Methods
Click to display all available methods, including inherited ones
Methods
sendCommand, sendEvent, sendEventSimple, sendKeyEvent, sendMouseEvent, sendMouseScrollEvent.
Getters
None.
Setters
None.
eventGetCoordinates
navigationEventGetCoordinates Source #
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m (Bool, Double, Double) | Returns: A boolean indicating success. |
Try to retrieve x and y coordinates of a Navigation
event.
Since: 1.22
eventGetType
navigationEventGetType Source #
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m NavigationEventType |
Inspect a Event
and return the NavigationEventType
of the event, or
GST_NAVIGATION_EVENT_INVALID
if the event is not a Navigation
event.
eventNewCommand
navigationEventNewCommand Source #
:: (HasCallStack, MonadIO m) | |
=> NavigationCommand |
|
-> m Event | Returns: a new |
Create a new navigation event given navigation command..
Since: 1.22
eventNewKeyPress
navigationEventNewKeyPress Source #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> [NavigationModifierType] |
|
-> m Event | Returns: a new |
Create a new navigation event for the given key press.
Since: 1.22
eventNewKeyRelease
navigationEventNewKeyRelease Source #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> [NavigationModifierType] |
|
-> m Event | Returns: a new |
Create a new navigation event for the given key release.
Since: 1.22
eventNewMouseButtonPress
navigationEventNewMouseButtonPress Source #
:: (HasCallStack, MonadIO m) | |
=> Int32 |
|
-> Double |
|
-> Double |
|
-> [NavigationModifierType] |
|
-> m Event | Returns: a new |
Create a new navigation event for the given key mouse button press.
Since: 1.22
eventNewMouseButtonRelease
navigationEventNewMouseButtonRelease Source #
:: (HasCallStack, MonadIO m) | |
=> Int32 |
|
-> Double |
|
-> Double |
|
-> [NavigationModifierType] |
|
-> m Event | Returns: a new |
Create a new navigation event for the given key mouse button release.
Since: 1.22
eventNewMouseMove
navigationEventNewMouseMove Source #
:: (HasCallStack, MonadIO m) | |
=> Double |
|
-> Double |
|
-> [NavigationModifierType] |
|
-> m Event | Returns: a new |
Create a new navigation event for the new mouse location.
Since: 1.22
eventNewMouseScroll
navigationEventNewMouseScroll Source #
:: (HasCallStack, MonadIO m) | |
=> Double |
|
-> Double |
|
-> Double |
|
-> Double |
|
-> [NavigationModifierType] |
|
-> m Event | Returns: a new |
Create a new navigation event for the mouse scroll.
Since: 1.22
eventNewTouchCancel
navigationEventNewTouchCancel Source #
:: (HasCallStack, MonadIO m) | |
=> [NavigationModifierType] |
|
-> m Event | Returns: a new |
Create a new navigation event signalling that all currently active touch points are cancelled and should be discarded. For example, under Wayland this event might be sent when a swipe passes the threshold to be recognized as a gesture by the compositor.
Since: 1.22
eventNewTouchDown
navigationEventNewTouchDown Source #
:: (HasCallStack, MonadIO m) | |
=> Word32 |
|
-> Double |
|
-> Double |
|
-> Double |
|
-> [NavigationModifierType] |
|
-> m Event | Returns: a new |
Create a new navigation event for an added touch point.
Since: 1.22
eventNewTouchFrame
navigationEventNewTouchFrame Source #
:: (HasCallStack, MonadIO m) | |
=> [NavigationModifierType] |
|
-> m Event | Returns: a new |
Create a new navigation event signalling the end of a touch frame. Touch frames signal that all previous down, motion and up events not followed by another touch frame event already should be considered simultaneous.
Since: 1.22
eventNewTouchMotion
navigationEventNewTouchMotion Source #
:: (HasCallStack, MonadIO m) | |
=> Word32 |
|
-> Double |
|
-> Double |
|
-> Double |
|
-> [NavigationModifierType] |
|
-> m Event | Returns: a new |
Create a new navigation event for a moved touch point.
Since: 1.22
eventNewTouchUp
navigationEventNewTouchUp Source #
:: (HasCallStack, MonadIO m) | |
=> Word32 |
|
-> Double |
|
-> Double |
|
-> [NavigationModifierType] |
|
-> m Event | Returns: a new |
Create a new navigation event for a removed touch point.
Since: 1.22
eventParseCommand
navigationEventParseCommand Source #
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m (Bool, NavigationCommand) | Returns: TRUE if the navigation command could be extracted, otherwise FALSE. |
Inspect a Navigation
command event and retrieve the enum value of the
associated command.
eventParseKeyEvent
navigationEventParseKeyEvent Source #
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m (Bool, Text) |
Note: Modifier keys (as defined in NavigationModifierType
)
press and
release events are generated even if those states are
present on all other related events
eventParseModifierState
navigationEventParseModifierState Source #
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> [NavigationModifierType] |
|
-> m Bool | Returns: TRUE if the event is a |
No description available in the introspection data.
Since: 1.22
eventParseMouseButtonEvent
navigationEventParseMouseButtonEvent Source #
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m (Bool, Int32, Double, Double) | Returns: TRUE if the button number and both coordinates could be extracted, otherwise FALSE. |
Retrieve the details of either a Navigation
mouse button press event or
a mouse button release event. Determine which type the event is using
navigationEventGetType
to retrieve the NavigationEventType
.
eventParseMouseMoveEvent
navigationEventParseMouseMoveEvent Source #
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m (Bool, Double, Double) | Returns: TRUE if both coordinates could be extracted, otherwise FALSE. |
Inspect a Navigation
mouse movement event and extract the coordinates
of the event.
eventParseMouseScrollEvent
navigationEventParseMouseScrollEvent Source #
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m (Bool, Double, Double, Double, Double) | Returns: TRUE if all coordinates could be extracted, otherwise FALSE. |
Inspect a Navigation
mouse scroll event and extract the coordinates
of the event.
Since: 1.18
eventParseTouchEvent
navigationEventParseTouchEvent Source #
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m (Bool, Word32, Double, Double, Double) | Returns: TRUE if all details could be extracted, otherwise FALSE. |
Retrieve the details of a Navigation
touch-down or touch-motion event.
Determine which type the event is using navigationEventGetType
to retrieve the NavigationEventType
.
Since: 1.22
eventParseTouchUpEvent
navigationEventParseTouchUpEvent Source #
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m (Bool, Word32, Double, Double) | Returns: TRUE if all details could be extracted, otherwise FALSE. |
Retrieve the details of a Navigation
touch-up event.
Since: 1.22
eventSetCoordinates
navigationEventSetCoordinates Source #
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> Double |
|
-> Double |
|
-> m Bool | Returns: A boolean indicating success. |
Try to set x and y coordinates on a Navigation
event. The event must
be writable.
Since: 1.22
messageGetType
navigationMessageGetType Source #
:: (HasCallStack, MonadIO m) | |
=> Message |
|
-> m NavigationMessageType | Returns: The type of the |
Check a bus message to see if it is a Navigation
event, and return
the NavigationMessageType
identifying the type of the message if so.
messageNewAnglesChanged
navigationMessageNewAnglesChanged Source #
:: (HasCallStack, MonadIO m, IsObject a) | |
=> a |
|
-> Word32 |
|
-> Word32 |
|
-> m Message | Returns: The new |
Creates a new Navigation
message with type
GST_NAVIGATION_MESSAGE_ANGLES_CHANGED
for notifying an application
that the current angle, or current number of angles available in a
multiangle video has changed.
messageNewCommandsChanged
navigationMessageNewCommandsChanged Source #
:: (HasCallStack, MonadIO m, IsObject a) | |
=> a |
|
-> m Message | Returns: The new |
Creates a new Navigation
message with type
GST_NAVIGATION_MESSAGE_COMMANDS_CHANGED
messageNewEvent
navigationMessageNewEvent Source #
:: (HasCallStack, MonadIO m, IsObject a) | |
=> a |
|
-> Event |
|
-> m Message | Returns: The new |
Creates a new Navigation
message with type
GST_NAVIGATION_MESSAGE_EVENT
.
Since: 1.6
messageNewMouseOver
navigationMessageNewMouseOver Source #
:: (HasCallStack, MonadIO m, IsObject a) | |
=> a |
|
-> Bool |
|
-> m Message | Returns: The new |
Creates a new Navigation
message with type
GST_NAVIGATION_MESSAGE_MOUSE_OVER
.
messageParseAnglesChanged
navigationMessageParseAnglesChanged Source #
:: (HasCallStack, MonadIO m) | |
=> Message |
|
-> m (Bool, Word32, Word32) | Returns: |
Parse a Navigation
message of type GST_NAVIGATION_MESSAGE_ANGLES_CHANGED
and extract the curAngle
and nAngles
parameters.
messageParseEvent
navigationMessageParseEvent Source #
:: (HasCallStack, MonadIO m) | |
=> Message |
|
-> m (Bool, Event) | Returns: |
Parse a Navigation
message of type GST_NAVIGATION_MESSAGE_EVENT
and extract contained Event
. The caller must unref the event
when done
with it.
Since: 1.6
messageParseMouseOver
navigationMessageParseMouseOver Source #
:: (HasCallStack, MonadIO m) | |
=> Message |
|
-> m (Bool, Bool) | Returns: |
Parse a Navigation
message of type GST_NAVIGATION_MESSAGE_MOUSE_OVER
and extract the active/inactive flag. If the mouse over event is marked
active, it indicates that the mouse is over a clickable area.
queryGetType
navigationQueryGetType Source #
:: (HasCallStack, MonadIO m) | |
=> Query |
|
-> m NavigationQueryType | Returns: The |
Inspect a Query
and return the NavigationQueryType
associated with
it if it is a Navigation
query.
queryNewAngles
navigationQueryNewAngles Source #
:: (HasCallStack, MonadIO m) | |
=> m Query | Returns: The new query. |
Create a new Navigation
angles query. When executed, it will
query the pipeline for the set of currently available angles, which may be
greater than one in a multiangle video.
queryNewCommands
navigationQueryNewCommands Source #
:: (HasCallStack, MonadIO m) | |
=> m Query | Returns: The new query. |
Create a new Navigation
commands query. When executed, it will
query the pipeline for the set of currently available commands.
queryParseAngles
navigationQueryParseAngles Source #
:: (HasCallStack, MonadIO m) | |
=> Query |
|
-> m (Bool, Word32, Word32) | Returns: |
Parse the current angle number in the Navigation
angles query
into the
guint
pointed to by the curAngle
variable, and the number of available
angles into the guint
pointed to by the nAngles
variable.
queryParseCommandsLength
navigationQueryParseCommandsLength Source #
:: (HasCallStack, MonadIO m) | |
=> Query |
|
-> m (Bool, Word32) | Returns: |
Parse the number of commands in the Navigation
commands query
.
queryParseCommandsNth
navigationQueryParseCommandsNth Source #
:: (HasCallStack, MonadIO m) | |
=> Query |
|
-> Word32 |
|
-> m (Bool, NavigationCommand) | Returns: |
Parse the Navigation
command query and retrieve the nth
command from
it into cmd
. If the list contains less elements than nth
, cmd
will be
set to GST_NAVIGATION_COMMAND_INVALID
.
querySetAngles
navigationQuerySetAngles Source #
:: (HasCallStack, MonadIO m) | |
=> Query |
|
-> Word32 |
|
-> Word32 |
|
-> m () |
Set the Navigation
angles query result field in query
.
querySetCommandsv
navigationQuerySetCommandsv Source #
:: (HasCallStack, MonadIO m) | |
=> Query |
|
-> [NavigationCommand] |
|
-> m () |
Set the Navigation
command query result fields in query
. The number
of commands passed must be equal to nCommands
.
sendCommand
navigationSendCommand Source #
:: (HasCallStack, MonadIO m, IsNavigation a) | |
=> a |
|
-> NavigationCommand |
|
-> m () |
Sends the indicated command to the navigation interface.
sendEvent
navigationSendEvent :: (HasCallStack, MonadIO m, IsNavigation a) => a -> Structure -> m () Source #
No description available in the introspection data.
sendEventSimple
navigationSendEventSimple Source #
:: (HasCallStack, MonadIO m, IsNavigation a) | |
=> a |
|
-> Event |
|
-> m () |
Sends an event to the navigation interface.
Since: 1.22
sendKeyEvent
navigationSendKeyEvent Source #
:: (HasCallStack, MonadIO m, IsNavigation a) | |
=> a |
|
-> Text |
|
-> Text |
|
-> m () |
No description available in the introspection data.
sendMouseEvent
navigationSendMouseEvent Source #
:: (HasCallStack, MonadIO m, IsNavigation a) | |
=> a |
|
-> Text |
|
-> Int32 |
|
-> Double |
|
-> Double |
|
-> m () |
Sends a mouse event to the navigation interface. Mouse event coordinates
are sent relative to the display space of the related output area. This is
usually the size in pixels of the window associated with the element
implementing the Navigation
interface.
sendMouseScrollEvent
navigationSendMouseScrollEvent Source #
:: (HasCallStack, MonadIO m, IsNavigation a) | |
=> a |
|
-> Double |
|
-> Double |
|
-> Double |
|
-> Double |
|
-> m () |
Sends a mouse scroll event to the navigation interface. Mouse event coordinates
are sent relative to the display space of the related output area. This is
usually the size in pixels of the window associated with the element
implementing the Navigation
interface.
Since: 1.18