C
<platforminterface/platforminterface.h> - Interfaces of the Qt Quick Ultralite core library
Provides basic interfaces from the Qt Quick Ultralite core library to be used by the platform implementation. More...
Header: | #include <platforminterface/platforminterface.h> |
Types
enum | KeyEventType { KeyPressEvent, KeyReleaseEvent } |
enum | KeyboardModifier { NoKeyboardModifier, ShiftKeyboardModifier, ControlKeyboardModifier, AltKeyboardModifier, MetaKeyboardModifier, …, GroupSwitchKeyboardModifier } |
Functions
void | handleKeyEvent(uint64_t timestamp, Qul::PlatformInterface::KeyEventType type, int key, uint32_t nativeScanCode = 0, unsigned int modifiers = NoKeyboardModifier, const char *textUtf8 = NULL, bool autoRepeat = false, uint32_t ucs4 = 0) |
void | handleTouchCancelEvent(Qul::PlatformInterface::Screen *screen, uint64_t timestamp) |
void | handleTouchEvent(Qul::PlatformInterface::Screen *screen, uint64_t timestamp, const Qul::PlatformInterface::TouchPoint *touchPoints, unsigned int numTouchPoints) |
void | initializeArgb32CpuFallbackDrawingEngine() |
void | initializeArgb4444CpuFallbackDrawingEngine() |
void | initializeBgr888CpuFallbackDrawingEngine() |
void | initializeRgb16CpuFallbackDrawingEngine() |
void | initializeRgb32CpuFallbackDrawingEngine() |
void | initializeRgb332CpuFallbackDrawingEngine() |
void | initializeRgb888CpuFallbackDrawingEngine() |
void | updateEngine(uint64_t timestamp) |
Type Documentation
[since Qt Quick Ultralite (Platform) 1.5]
enum KeyEventType
An enum representing the possible key event types.
Constant | Value | Description |
---|---|---|
KeyPressEvent | 0 | Represents a key press event |
KeyReleaseEvent | 1 | Represents a key release event |
This enum was introduced or modified in Qt Quick Ultralite (Platform) 1.5.
[since Qt Quick Ultralite (Platform) 1.5]
enum KeyboardModifier
Constant | Value | Description |
---|---|---|
NoKeyboardModifier | 0x00000000 | No modifier is pressed |
ShiftKeyboardModifier | 0x02000000 | A Shift key on the keyboard is pressed |
ControlKeyboardModifier | 0x04000000 | A Ctrl key on the keyboard is pressed |
AltKeyboardModifier | 0x08000000 | An Alt key on the keyboard is pressed |
MetaKeyboardModifier | 0x10000000 | A Meta key on the keyboard is pressed |
KeypadKeyboardModifier | 0x20000000 | A keypad button is pressed |
GroupSwitchKeyboardModifier | 0x40000000 | A Mode_switch key on the keyboard is pressed. |
This enum was introduced or modified in Qt Quick Ultralite (Platform) 1.5.
Function Documentation
[since Qt Quick Ultralite (Platform) 1.5]
void handleKeyEvent(uint64_t timestamp, Qul::PlatformInterface::KeyEventType type, int key, uint32_t nativeScanCode = 0, unsigned int modifiers = NoKeyboardModifier, const char *textUtf8 = NULL, bool autoRepeat = false, uint32_t ucs4 = 0)
Handles key events
The received key events from the platform layer have to be passed to the core engine through this function. timestamp is the time at which the event occured. This is usually the time read from the platform's native timestamp function. type specifies whether this is a key press or a key release event. key is the actual key identifier, according to the Qul::PlatformInterface::Key enum values. nativeScanCode is a native scan code identifier, useful in combination with key value Qul::Key_unknown
for custom platform specific keys. modifiers specifies which key modifiers are held down at the time of the key event, by using an or'ed combination of the Qul::PlatformInterface::KeyModifier values.
textUtf8 is unused and will be removed in next major release.
autoRepeat specifies whether this is an auto-repeating key, it should be false if the event comes from an initial key press.
ucs4 is a ucs4 representation of the text that the key generates, useful for various international keyboard support and letter casing. Note that the core engine does not keep the state of the keyboard. Platform integration is responsible for tracking the currenly active modifier state and based on that select the relevant ucs4 value. It should be left as NULL for control keys, or if full text input support is not desired (the key event delivered to QML will have an empty text property then, but it's still possible to choose actions based on the key and nativeScanCode values).
This function was introduced in Qt Quick Ultralite (Platform) 1.5.
See also Qul::Platform::PlatformContext::currentTimestamp.
[since Qt Quick Ultralite (Platform) 1.5]
void handleTouchCancelEvent(Qul::PlatformInterface::Screen *screen, uint64_t timestamp)
Cancels touch events
Cancels the touch events for screen. timestamp is the time at which the event occurred. This is usually the time read from the platform's native timestamp function. If screen is NULL
the platform primary screen will be used.
This function was introduced in Qt Quick Ultralite (Platform) 1.5.
See also Qul::Platform::PlatformContext::currentTimestamp and Qul::Platform::PlatformContext::availableScreens.
[since Qt Quick Ultralite (Platform) 1.5]
void handleTouchEvent(Qul::PlatformInterface::Screen *screen, uint64_t timestamp, const Qul::PlatformInterface::TouchPoint *touchPoints, unsigned int numTouchPoints)
Handles touch events
The received touch events from the platform layer have to be passed to the core engine through this function. screen is the screen on which the touch event is issued. timestamp is the time at which the event occurred. This is usually the time read from the platform's native timestamp function. touchPoints and numTouchPoints contain the list of currently active touch points. The ownership of the touch points stays at the calling function. If screen is NULL
the platform primary screen will be used.
This function was introduced in Qt Quick Ultralite (Platform) 1.5.
See also Qul::Platform::PlatformContext::currentTimestamp and Qul::Platform::PlatformContext::availableScreens.
[since Qt Quick Ultralite (Platform) 2.9]
void initializeArgb32CpuFallbackDrawingEngine()
Initializes Qt Quick Ultralite for 32 BPP rendering in ARGB32 format.
By default, Qt Quick Ultralite does not reference the fallback renderer, allowing it to be discarded if it is not used.
This function sets up the fallback renderer for 32 BPP drawing devices in ARGB32 format. The ARGB32 CPU fallback drawing engine uses the same drawing engine and blend functions as RGB32 CPU fallback drawing engine.
This function was introduced in Qt Quick Ultralite (Platform) 2.9.
See also Qul::PlatformInterface::initializeRgb332CpuFallbackDrawingEngine, Qul::PlatformInterface::initializeRgb16CpuFallbackDrawingEngine, Qul::PlatformInterface::initializeArgb4444CpuFallbackDrawingEngine, Qul::PlatformInterface::initializeRgb888CpuFallbackDrawingEngine, Qul::PlatformInterface::initializeBgr888CpuFallbackDrawingEngine, and Qul::PlatformInterface::initializeRgb32CpuFallbackDrawingEngine.
[since Qt Quick Ultralite (Platform) 2.9]
void initializeArgb4444CpuFallbackDrawingEngine()
Initializes Qt Quick Ultralite for 16 BPP rendering in ARGB4444 format.
By default, Qt Quick Ultralite does not reference the fallback renderer, allowing it to be discarded if it is not used.
This function sets up the fallback renderer for 16 BPP drawing devices in ARGB4444 format.
This function was introduced in Qt Quick Ultralite (Platform) 2.9.
See also Qul::PlatformInterface::initializeRgb332CpuFallbackDrawingEngine, Qul::PlatformInterface::initializeRgb16CpuFallbackDrawingEngine, Qul::PlatformInterface::initializeRgb888CpuFallbackDrawingEngine, Qul::PlatformInterface::initializeBgr888CpuFallbackDrawingEngine, Qul::PlatformInterface::initializeArgb32CpuFallbackDrawingEngine, and Qul::PlatformInterface::initializeRgb32CpuFallbackDrawingEngine.
[since Qt Quick Ultralite (Platform) 2.9]
void initializeBgr888CpuFallbackDrawingEngine()
Initializes Qt Quick Ultralite for 24 BPP rendering in BGR888 format.
By default, Qt Quick Ultralite does not reference the fallback renderer, allowing it to be discarded if it is not used.
This function sets up the fallback renderer for 24 BPP drawing devices in BGR888 format. Use Qul::PlatformInterface::initializeRgb888CpuFallbackDrawingEngine for RGB888 format.
This function was introduced in Qt Quick Ultralite (Platform) 2.9.
See also Qul::PlatformInterface::initializeRgb332CpuFallbackDrawingEngine, Qul::PlatformInterface::initializeRgb16CpuFallbackDrawingEngine, Qul::PlatformInterface::initializeArgb4444CpuFallbackDrawingEngine, Qul::PlatformInterface::initializeRgb888CpuFallbackDrawingEngine, Qul::PlatformInterface::initializeArgb32CpuFallbackDrawingEngine, and Qul::PlatformInterface::initializeRgb32CpuFallbackDrawingEngine.
[since Qt Quick Ultralite (Platform) 2.9]
void initializeRgb16CpuFallbackDrawingEngine()
Initializes Qt Quick Ultralite for 16 BPP rendering in RGB565 format.
By default, Qt Quick Ultralite does not reference the fallback renderer, allowing it to be discarded if it is not used.
This function sets up the fallback renderer for 16 BPP drawing devices in RGB565 format.
This function was introduced in Qt Quick Ultralite (Platform) 2.9.
See also Qul::PlatformInterface::initializeRgb332CpuFallbackDrawingEngine, Qul::PlatformInterface::initializeArgb4444CpuFallbackDrawingEngine, Qul::PlatformInterface::initializeRgb888CpuFallbackDrawingEngine, Qul::PlatformInterface::initializeBgr888CpuFallbackDrawingEngine, Qul::PlatformInterface::initializeArgb32CpuFallbackDrawingEngine, and Qul::PlatformInterface::initializeRgb32CpuFallbackDrawingEngine.
[since Qt Quick Ultralite (Platform) 2.9]
void initializeRgb32CpuFallbackDrawingEngine()
Initializes Qt Quick Ultralite for 32 BPP rendering in RGB32 format.
By default, Qt Quick Ultralite does not reference the fallback renderer, allowing it to be discarded if it is not used.
This function sets up the fallback renderer for 32 BPP drawing devices in RGB32 format. The RGB32 CPU fallback drawing engine uses the same drawing engine and blend functions as ARGB32 CPU fallback drawing engine.
This function was introduced in Qt Quick Ultralite (Platform) 2.9.
See also Qul::PlatformInterface::initializeRgb332CpuFallbackDrawingEngine, Qul::PlatformInterface::initializeRgb16CpuFallbackDrawingEngine, Qul::PlatformInterface::initializeArgb4444CpuFallbackDrawingEngine, Qul::PlatformInterface::initializeRgb888CpuFallbackDrawingEngine, Qul::PlatformInterface::initializeBgr888CpuFallbackDrawingEngine, and Qul::PlatformInterface::initializeArgb32CpuFallbackDrawingEngine.
[since Qt Quick Ultralite (Platform) 2.9]
void initializeRgb332CpuFallbackDrawingEngine()
Initializes Qt Quick Ultralite for 8 BPP rendering in RGB332 format.
By default, Qt Quick Ultralite does not reference the fallback renderer, allowing it to be discarded if it is not used.
This function sets up the fallback renderer for 8 BPP drawing devices in RGB332 format.
This function was introduced in Qt Quick Ultralite (Platform) 2.9.
See also Qul::PlatformInterface::initializeRgb16CpuFallbackDrawingEngine, Qul::PlatformInterface::initializeArgb4444CpuFallbackDrawingEngine, Qul::PlatformInterface::initializeRgb888CpuFallbackDrawingEngine, Qul::PlatformInterface::initializeBgr888CpuFallbackDrawingEngine, Qul::PlatformInterface::initializeArgb32CpuFallbackDrawingEngine, and Qul::PlatformInterface::initializeRgb32CpuFallbackDrawingEngine.
[since Qt Quick Ultralite (Platform) 2.9]
void initializeRgb888CpuFallbackDrawingEngine()
Initializes Qt Quick Ultralite for 24 BPP rendering in RGB888 format.
By default, Qt Quick Ultralite does not reference the fallback renderer, allowing it to be discarded if it is not used.
This function sets up the fallback renderer for 24 BPP drawing devices in RGB888 format. Use Qul::PlatformInterface::initializeBgr888CpuFallbackDrawingEngine for BGR888 format.
This function was introduced in Qt Quick Ultralite (Platform) 2.9.
See also Qul::PlatformInterface::initializeRgb332CpuFallbackDrawingEngine, Qul::PlatformInterface::initializeRgb16CpuFallbackDrawingEngine, Qul::PlatformInterface::initializeArgb4444CpuFallbackDrawingEngine, Qul::PlatformInterface::initializeBgr888CpuFallbackDrawingEngine, Qul::PlatformInterface::initializeArgb32CpuFallbackDrawingEngine, and Qul::PlatformInterface::initializeRgb32CpuFallbackDrawingEngine.
[since Qt Quick Ultralite (Platform) 1.5]
void updateEngine(uint64_t timestamp)
Updates the Qt Quick Ultralite engine
The Qt Quick Ultralite engine needs to be updated regularly to update its timers and showing animations.
The timestamp parameter is the current platform timestamp in milliseconds, as reported by Qul::Platform::PlatformContext::currentTimestamp().
This example shows a typical section for performing the engine updates from a main loop.
static uint64_t nextUpdate = 0; void scheduleEngineUpdate(uint64_t timeout) { nextUpdate = timeout; } while_loop { const uint64_t timestamp = Qul::Platform::PlatformContext::currentTimestamp(); if (timestamp >= nextUpdate) { Qul::PlatformInterface::updateEngine(timestamp); } else { // Device could sleep until time in 'nextUpdate'. enterSleepMode(nextUpdate); } }
The callback Qul::Platform::PlatformContext::scheduleEngineUpdate informs the platform implementation about the next time Qt Quick Ultralite engine needs updating via Qul::PlatformInterface::updateEngine.
This function was introduced in Qt Quick Ultralite (Platform) 1.5.
See also Qul::Platform::PlatformContext::scheduleEngineUpdate and Qul::Platform::PlatformContext::currentTimestamp.
Available under certain Qt licenses.
Find out more.