PlatformInterface Namespace

Qul::PlatformInterface

Offers interfaces from the Qt Quick Ultralite core library to be used by the platform implementation. 更多...

Header: #include <>

    类型

    enum KeyEventType { KeyPressEvent, KeyReleaseEvent }
    enum KeyboardModifier { NoKeyboardModifier, ShiftKeyboardModifier, ControlKeyboardModifier, AltKeyboardModifier, MetaKeyboardModifier, …, GroupSwitchKeyboardModifier }

    函数

    void blendRectTiled (Qul::PlatformInterface::DrawingDevice * buffer , const Qul::PlatformInterface::Rect & rect , Qul::PlatformInterface::Rgba32 color , void (*)() finish , void (*)(void *, int) invalidateCache )
    void blendRectTiledAlphaMap (Qul::PlatformInterface::DrawingDevice * buffer , const Qul::PlatformInterface::Rect & rect , Qul::PlatformInterface::Rgba32 color , void (*)() finish , void (*)(void *, int) invalidateCache )
    void handleKeyEvent (uint64_t timestamp , Qul::PlatformInterface::KeyEventType type , int key , uint32_t nativeScanCode = 0, unsigned int modifiers = NoKeyboardModifier, char * textUtf8 = NULL, bool autoRepeat = false)
    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 init16bppRendering ()
    void init24bppRendering ()
    void init32bppRendering ()
    void updateEngine (uint64_t timestamp )
    bool operator!= (const Qul::PlatformInterface::Rgba32 & a , const Qul::PlatformInterface::Rgba32 & b )
    bool operator!= ( const Qul::PlatformInterface::RectF & , const Qul::PlatformInterface::RectF & )
    bool operator!= ( const Qul::PlatformInterface::Rect & , const Qul::PlatformInterface::Rect & )
    GenericMatrix<M, N, T2> operator* (T1 factor , const GenericMatrix<M, N, T2> & matrix = M)
    GenericMatrix<M, N2, T> operator* (const GenericMatrix<M, N1, T> & m1 = M, const GenericMatrix<N1, N2, T> & m2 = N1)
    GenericMatrix<M, N, T> operator+ (const GenericMatrix<M, N, T> & m1 = M, const GenericMatrix<M, N, T> & m2 = M)
    bool operator== (const Qul::PlatformInterface::Rgba32 & a , const Qul::PlatformInterface::Rgba32 & b )
    bool operator== ( const Qul::PlatformInterface::RectF & , const Qul::PlatformInterface::RectF & )
    bool operator== ( const Qul::PlatformInterface::Rect & , const Qul::PlatformInterface::Rect & )

    详细描述

    class DrawingDevice

    The DrawingDevice class defines a device which can be drawn onto. 更多...

    class DrawingEngine

    This class provides an abstract interface for blending functions. 更多...

    class GenericMatrix

    The GenericMatrix class is a template class representing a matrix. 更多...

    class LayerEngine

    This class provides an abstract interface for managing hardware layers. 更多...

    class Point

    The Point class defines a point in the plane using integer precision. 更多...

    class PointF

    The PointF class defines a point in the plane using floating point precision. A point is specified by a x coordinate and an y coordinate which can be accessed using the x () 和 y () functions. The coordinates of the point are specified using floating point numbers for accuracy. The isNull () 函数返回 true if both x and y are set to 0.0. The coordinates can be set (or altered) using the setX () 和 setY () functions, or alternatively the rx () 和 ry () functions which return references to the coordinates (allowing direct manipulation). 更多...

    class Rect

    The Rect class defines a rectangle in the plane using integer precision. 更多...

    class RectF

    The RectF class defines a rectangle in the plane using floating point precision. 更多...

    class Rgba32

    The Rgba32 class provides storage space for RGBA colors. 更多...

    class Screen

    The Screen class holds information about display size in pixels. 更多...

    class 尺寸

    The Size class defines the size of a two-dimensional object using integer point precision. 更多...

    class SizeF

    The SizeF class defines the size of a two-dimensional object using floating point precision. 更多...

    class Texture

    A class containing information about a texture. 更多...

    class TouchPoint

    Represents single touch point. 更多...

    class Transform

    The Transform class specifies 2D transformations of a coordinate system. 更多...

    类型文档编制

    enum KeyEventType

    An enum representing the possible key event types.

    常量 描述
    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.

    enum KeyboardModifier

    常量 描述
    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.

    函数文档编制

    void blendRectTiled ( Qul::PlatformInterface::DrawingDevice * buffer , const Qul::PlatformInterface::Rect & rect , Qul::PlatformInterface::Rgba32 color , void (*)() finish , void (*)( void *, int ) invalidateCache )

    Workaround for 2D accelerators that don't have a way to blend a color directly.

    Blends color onto rect by filling an appropriately large buffer with the source color and used that buffer as a source, potentially doing multiple calls in order to tile the whole output rectangle.

    buffer is the drawing device to blend onto. finish is called at the end of the blending operation. May be used to wait for asynchronous blending operations. If not required nullptr should be given. invalidateCache will be called to allow invalidating caches for the allocated tile memory. If not required nullptr should be given.

    This function was introduced in Qt Quick Ultralite (Platform) 1.5.

    void blendRectTiledAlphaMap ( Qul::PlatformInterface::DrawingDevice * buffer , const Qul::PlatformInterface::Rect & rect , Qul::PlatformInterface::Rgba32 color , void (*)() finish , void (*)( void *, int ) invalidateCache )

    Workaround for 2D accelerators that don't have a way to blend a color directly.

    如同 blendRectTiled , but uses DrawingEngine::blendAlphaMap

    Useful when alpha map blending is accelerated, as some bandwidth is saved by not having to blend ARGB32.

    Blends color onto rect by filling an appropriately large buffer with the source color and used that buffer as a source, potentially doing multiple calls in order to tile the whole output rectangle.

    buffer is the drawing device to blend onto. finish is called at the end of the blending operation. May be used to wait for asynchronous blending operations. If not required nullptr should be given. invalidateCache will be called to allow invalidating caches for the allocated tile memory. If not required nullptr should be given.

    This function was introduced in 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, char * textUtf8 = NULL, bool autoRepeat = false)

    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 a UTF-8 representation of the text that the key represents, useful for various international keyboard support. It should be left as nullptr 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). autoRepeat specifies whether this is an auto-repeating key, it should be false if the event comes from an initial key press.

    This function was introduced in Qt Quick Ultralite (Platform) 1.5.

    另请参阅 Qul::Platform::currentTimestamp .

    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 occured. This is usually the time read from the platform's native timestamp function. If screen is nullptr the platform primary screen will be used.

    This function was introduced in Qt Quick Ultralite (Platform) 1.5.

    另请参阅 Qul::Platform::currentTimestamp and Qul::Platform::availableScreens .

    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 occured. 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 nullptr the platform primary screen will be used.

    This function was introduced in Qt Quick Ultralite (Platform) 1.5.

    另请参阅 Qul::Platform::currentTimestamp and Qul::Platform::availableScreens .

    void init16bppRendering ()

    Initializes Qt Quick Ultralite for 16 BPP rendering.

    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.

    Currently this function assumes that 16 BPP means the RGB565 format.

    This function was introduced in Qt Quick Ultralite (Platform) 1.5.

    另请参阅 Qul::PlatformInterface::init24bppRendering and Qul::PlatformInterface::init32bppRendering .

    void init24bppRendering ()

    Initializes Qt Quick Ultralite for 24 BPP rendering.

    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, which is currently the same as for 32 BPP devices.

    Currently this function assumes that 24 BPP devices are in RGB888 format.

    This function was introduced in Qt Quick Ultralite (Platform) 1.5.

    另请参阅 Qul::PlatformInterface::init16bppRendering and Qul::PlatformInterface::init32bppRendering .

    void init32bppRendering ()

    Initializes Qt Quick Ultralite for 32 BPP rendering.

    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.

    Currently this function assumes that the 32 BPP devices are in ARGB32 format.

    This function was introduced in Qt Quick Ultralite (Platform) 1.5.

    另请参阅 Qul::PlatformInterface::init24bppRendering and Qul::PlatformInterface::init16bppRendering .

    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.

    timestamp parameter is the current platform timestamp in milliseconds, as reported by Qul::Platform::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::currentTimestamp();
        if (timestamp >= nextUpdate) {
            Qul::PlatformInterface::updateEngine(timestamp);
        } else {
            // Device could sleep until time in 'nextUpdate'.
            enterSleepMode(nextUpdate);
        }
    }
    							

    The callback Qul::Platform::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.

    另请参阅 Qul::Platform::scheduleEngineUpdate and Qul::Platform::currentTimestamp .

    bool operator!= (const Qul::PlatformInterface::Rgba32 & a , const Qul::PlatformInterface::Rgba32 & b )

    返回 true a and b arguments are not equal.

    bool operator!= ( const Qul::PlatformInterface::RectF & , const Qul::PlatformInterface::RectF & )

    返回 true if the rectangles are different, otherwise returns false .

    bool operator!= ( const Qul::PlatformInterface::Rect & , const Qul::PlatformInterface::Rect & )

    返回 true if the rectangles are different, otherwise returns false .

    template <int M, int N, typename T1, typename T2> GenericMatrix < M , N , T2 > operator* ( T1 factor , const GenericMatrix < M , N , T2 > & matrix = M)

    Returns the result of multiplying all elements of matrix by scalar factor .

    template <int M, int N1, int N2, typename T> GenericMatrix < M , N2 , T > operator* (const GenericMatrix < M , N1 , T > & m1 = M, const GenericMatrix < N1 , N2 , T > & m2 = N1)

    Returns the result of multiplying all elements of m1 and m2 .

    template <int M, int N, typename T> GenericMatrix < M , N , T > operator+ (const GenericMatrix < M , N , T > & m1 = M, const GenericMatrix < M , N , T > & m2 = M)

    Returns the sum of m1 and m2 .

    bool operator== (const Qul::PlatformInterface::Rgba32 & a , const Qul::PlatformInterface::Rgba32 & b )

    返回 true a and b arguments are equal.

    bool operator== ( const Qul::PlatformInterface::RectF & , const Qul::PlatformInterface::RectF & )

    返回 true if the rectangles are equal, otherwise returns false .

    bool operator== ( const Qul::PlatformInterface::Rect & , const Qul::PlatformInterface::Rect & )

    返回 true if the rectangles are equal, otherwise returns false .