C

PlatformInterface Namespace

Qul::PlatformInterface

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

Classes

Types

enum KeyEventType { KeyPressEvent, KeyReleaseEvent }
enum KeyboardModifier { NoKeyboardModifier, ShiftKeyboardModifier, ControlKeyboardModifier, AltKeyboardModifier, MetaKeyboardModifier, …, GroupSwitchKeyboardModifier }
enum LineCapStyle { FlatCap, RoundCap, SquareCap }
enum LineJoinStyle { MiterJoin, RoundJoin, BevelJoin }
enum PathFillRule { PathOddEvenFill, PathWindingFill }
enum PathOptimizationHints { PathOptimizationHints_None, PathOptimizationHints_NotSelfIntersecting, PathOptimizationHints_NoOverlappingSubPaths }
Vector

Functions

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 deviceLinkBytesReceived(const uint8_t *data, int size)
void error(unsigned int lineNumber, QulError code, int param1 = 0, int param2 = 0, int param3 = 0)
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)
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 init8bppRendering()
int log(const char *format, ...)
void pathArcToBeziers(Qul::PlatformInterface::cubicToPath func, void *data, float radiusX, float radiusY, float xAxisRotation, bool useLargeArc, bool clockwise, const Qul::PlatformInterface::PointF &source, const Qul::PlatformInterface::PointF &target)
void qul_delete(T *t)
T *qul_new(Args &&... args)
T *qul_new()
T *qul_new(Arg1 arg1)
T *qul_new(Arg1 arg1, Arg2 arg2)
T *qul_new(Arg1 arg1, Arg2 arg2, Arg3 arg3)
T *qul_new(Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4)
QulErrorHandler *setErrorHandler(QulErrorHandler *handler)
void updateEngine(uint64_t timestamp)
bool operator!=(const Qul::PlatformInterface::RectF &r1, const Qul::PlatformInterface::RectF &r2)
bool operator!=(const Qul::PlatformInterface::Rect &r1, const Qul::PlatformInterface::Rect &r2)
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::RectF &r1, const Qul::PlatformInterface::RectF &r2)
bool operator==(const Qul::PlatformInterface::Rect &r1, const Qul::PlatformInterface::Rect &r2)

Detailed Description

Classes

class Allocator

A memory allocator for use with the C++ standard containers. More...

class Brush

Represents the fill pattern of shapes drawn using DrawingEngine. More...

class DefaultPathDataStroker

The DefaultPathDataStroker provides a default implementation. More...

class DrawingDevice

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

class DrawingEngine

This class provides an abstract interface for blending functions. More...

class GenericMatrix

The GenericMatrix class is a template class representing a matrix. More...

class LayerEngine

This class provides an abstract interface for managing hardware layers. More...

class MemoryAllocator

This class provides an abstract interface for memory allocation. More...

class PathData

This class represents vector path data. More...

class PathDataArcSegment

Represents a path data arc segment. More...

class PathDataCubicBezierSegment

Represents a path data cubic bezier segment. More...

class PathDataIterator

A convenience class for iterating over path data segments. More...

class PathDataLargeClockWiseArcSegment

Represents a path data large clockwise arc segment. More...

class PathDataLargeCounterClockWiseArcSegment

Represents a path data large counterclockwise arc segment. More...

class PathDataLineSegment

Represents a path data line segment. More...

class PathDataMoveSegment

Represents a path data move segment. More...

class PathDataPathSeparatorSegment

Represents a path data path separator segment. More...

class PathDataQuadraticBezierSegment

Represents a path data quadratic bezier segment. More...

class PathDataSegment

Represents a single path data segment of the Qul::PlatformInterface::PathData class. More...

class PathDataSmallClockWiseArcSegment

Represents a path data small clockwise arc segment. More...

class PathDataSmallCounterClockWiseArcSegment

Represents a path data small counterclockwise arc segment. More...

class PathDataStroker

The PathDataStroker generates stroke representation for a shape. More...

class PixelDataPointer

A structure containing information about precise (bit perfect) pixel data location. More...

class Point

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

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() and y() functions. The coordinates of the point are specified using floating point numbers for accuracy. The isNull() function returns true if both x and y are set to 0.0. The coordinates can be set (or altered) using the setX() and setY() functions, or alternatively the rx() and ry() functions which return references to the coordinates (allowing direct manipulation). More...

class Rect

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

class RectF

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

class Rgba32

The Rgba32 class provides storage space for RGBA colors. More...

class Screen

The Screen class holds information about display size in pixels. More...

class Size

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

class SizeF

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

class StrokeProperties

A struct specifying the stroke properties of a path. More...

class Texture

A class containing information about a texture. More...

class TouchPoint

Represents single touch point. More...

class Transform

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

Type Documentation

[since Qt Quick Ultralite (Platform) 1.5] enum KeyEventType

An enum representing the possible key event types.

ConstantValueDescription
KeyPressEvent0Represents a key press event
KeyReleaseEvent1Represents 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

ConstantValueDescription
NoKeyboardModifier0x00000000No modifier is pressed
ShiftKeyboardModifier0x02000000A Shift key on the keyboard is pressed
ControlKeyboardModifier0x04000000A Ctrl key on the keyboard is pressed
AltKeyboardModifier0x08000000An Alt key on the keyboard is pressed
MetaKeyboardModifier0x10000000A Meta key on the keyboard is pressed
KeypadKeyboardModifier0x20000000A keypad button is pressed
GroupSwitchKeyboardModifier0x40000000A Mode_switch key on the keyboard is pressed.

This enum was introduced or modified in Qt Quick Ultralite (Platform) 1.5.

[since Qt Quick Ultralite (Platform) 1.8] enum LineCapStyle

This enum type defines the supported line cap styles that can be drawn using Qul::PlatformInterface::DrawingEngine.

ConstantValueDescription
FlatCap0A square line end that does not go beyond the end of the line.
RoundCap1A rounded line end with radius equal to half the line width.
SquareCap2A square line end that extends beyond the end of the line by half the line width.

This enum was introduced or modified in Qt Quick Ultralite (Platform) 1.8.

[since Qt Quick Ultralite (Platform) 1.8] enum LineJoinStyle

This enum type defines the supported line join styles that can be drawn using Qul::PlatformInterface::DrawingEngine.

ConstantValueDescription
MiterJoin0The outer edges of the lines are extended to meet at an angle, and this area is filled.
RoundJoin1A circular arc between the two lines is filled.
BevelJoin2The triangular notch between the two lines is filled.

This enum was introduced or modified in Qt Quick Ultralite (Platform) 1.8.

[since Qt Quick Ultralite (Platform) 1.8] enum PlatformInterface::PathFillRule

This enum type defines how a path should be filled.

ConstantValueDescription
Qul::PlatformInterface::PathOddEvenFill0Specifies that the region is filled using the odd even fill rule. With this rule, whether a point is inside the shape is determined by using the following method. Draw a horizontal line from the point to a location outside the shape, and count the number of intersections. If the number of intersections is an odd number, the point is inside the shape. This mode is the default.
Qul::PlatformInterface::PathWindingFill1Specifies that the region is filled using the non zero winding rule. With this rule, whether a point is inside the shape is determined by using the following method. Draw a horizontal line from the point to a location outside the shape. Determine whether the direction of the line at each intersection point is up or down. The winding number is determined by summing the direction of each intersection. If the number is non zero, the point is inside the shape. This fill mode can also in most cases be considered as the intersection of closed shapes.

This enum was introduced or modified in Qt Quick Ultralite (Platform) 1.8.

[since Qt Quick Ultralite (Platform) 1.8] enum PathOptimizationHints

This enum type defines path optimization hints.

ConstantValueDescription
PathOptimizationHints_None0No path optimization hints.
PathOptimizationHints_NotSelfIntersecting1The path does not have any self-intersecting lines.
PathOptimizationHints_NoOverlappingSubPaths2The path does not have any overlapping sub paths.

This enum was introduced or modified in Qt Quick Ultralite (Platform) 1.8.

[alias, since Qt Quick Ultralite (Platform) 1.8] template<typename T> PlatformInterface::Vector

An std::vector template specialization that allocates and frees memory using Qul::Platform::qul_malloc and Qul::Platform::qul_free respectively.

Only available with C++ version C++11 or newer.

This typedef was introduced in Qt Quick Ultralite (Platform) 1.8.

Function Documentation

[since 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 NULL should be given. invalidateCache will be called to allow invalidating caches for the allocated tile memory. If not required NULL should be given.

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

[since 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.

Same as 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 NULL should be given. invalidateCache will be called to allow invalidating caches for the allocated tile memory. If not required NULL should be given.

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

void PlatformInterface::deviceLinkBytesReceived(const uint8_t *data, int size)

Sends data received on the serial port further to decoding.

This function has to be called by the serial port receiver function when characters have been received from the host. data is the received data and size its length. This function will forward the data to Qul::Platform::DeviceLink::charsReceived.

See also Porting DeviceLink Communication.

[since Qt Quick Ultralite (Platform) 2.2] void error(unsigned int lineNumber, QulError code, int param1 = 0, int param2 = 0, int param3 = 0)

Reports error message to default or custom handler.

The default error handler prints error code, lineNumber, and additional param1, param2, and param3 to Qul::Platform::PlatformContext::consoleWrite.

The default handler halts the program after printing the error message, and enters an infinite loop to save the backtrace for debugging.

Calls the custom error handler if it has been set using Qul::setErrorHandler.

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

See also Error handling, Qt Quick Ultralite error codes, and QUL_ASSERT.

[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)

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

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) 1.5] 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.

See also Qul::PlatformInterface::init8bppRendering, Qul::PlatformInterface::init24bppRendering, and Qul::PlatformInterface::init32bppRendering.

[since Qt Quick Ultralite (Platform) 1.5] 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.

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

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

See also Qul::PlatformInterface::init8bppRendering, Qul::PlatformInterface::init16bppRendering, and Qul::PlatformInterface::init32bppRendering.

[since Qt Quick Ultralite (Platform) 1.5] 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.

See also Qul::PlatformInterface::init8bppRendering, Qul::PlatformInterface::init24bppRendering, and Qul::PlatformInterface::init16bppRendering.

[since Qt Quick Ultralite (Platform) 1.8] void init8bppRendering()

Initializes Qt Quick Ultralite for 8 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 8 BPP drawing devices.

Currently this function assumes that 8 BPP means the RGB332 format.

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

See also Qul::PlatformInterface::init16bppRendering, Qul::PlatformInterface::init24bppRendering, and Qul::PlatformInterface::init32bppRendering.

[since Qt Quick Ultralite (Platform) 1.9] int log(const char *format, ...)

Prints arguments defined by ... according to the format string. Writes the output to Qul::Platform::PlatformContext::consoleWrite.

format is a pointer to a null-terminated multi-byte string, specifying how to interpret the data.

... contains arguments specifying data to print.

Returns the number of characters written successfully or a negative value if an error occurred.

Note: Format string parsing is equivalent to C++11 std::printf.

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

See also Qul::Platform::PlatformContext::consoleWrite().

[since Qt Quick Ultralite (Platform) 1.8] void pathArcToBeziers(Qul::PlatformInterface::cubicToPath func, void *data, float radiusX, float radiusY, float xAxisRotation, bool useLargeArc, bool clockwise, const Qul::PlatformInterface::PointF &source, const Qul::PlatformInterface::PointF &target)

Converts an arc segment into a series of bezier curves.

The provided callback func will be called up to four times, with cubic bezier curve parameters. The data handle will also be given as the first argument to the callback and can be used to provide necessaradiusY context information.

The radiusX, radiusY, xAxisRotation, useLargeArc, clockwise, source and target parameters define the arc segment in accordance with the SVG standard.

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

See also Qul::PlatformInterface::PathDataArcSegment.

template <typename T> void PlatformInterface::qul_delete(T *t)

A helper function to deallocate memory for a type and call its destructor.

t is a pointer to the type that was allocated previously with qul_new.

template <typename T, typename Args> T *PlatformInterface::qul_new(Args &&... args)

A helper function that allocates memory using Qul::Platform::qul_malloc implementation for a type T and calls its constructor with args.

This function is only available with C++11 or higher.

template <typename T> T *PlatformInterface::qul_new()

A helper function that allocates memory using Qul::Platform::qul_malloc implementation for a type T and calls its constructor.

This function is only available with C++03 or lower.

template <typename T, typename Arg1> T *PlatformInterface::qul_new(Arg1 arg1)

A helper function that allocates memory using Qul::Platform::qul_malloc implementation for a type T and calls its constructor with arguments.

This function is only available with C++03 or lower.

template <typename T, typename Arg1, typename Arg2> T *PlatformInterface::qul_new(Arg1 arg1, Arg2 arg2)

A helper function that allocates memory using Qul::Platform::qul_malloc implementation for a type T and calls its constructor with arguments.

This function is only available with C++03 or lower.

template <typename T, typename Arg1, typename Arg2, typename Arg3> T *PlatformInterface::qul_new(Arg1 arg1, Arg2 arg2, Arg3 arg3)

A helper function that allocates memory using Qul::Platform::qul_malloc implementation for a type T and calls its constructor with arguments.

This function is only available with C++03 or lower.

template <typename T, typename Arg1, typename Arg2, typename Arg3, typename Arg4> T *PlatformInterface::qul_new(Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4)

A helper function that allocates memory using Qul::Platform::qul_malloc implementation for a type T and calls its constructor with arguments.

This function is only available with C++03 or lower.

[since Qt Quick Ultralite (Platform) 2.2] QulErrorHandler *setErrorHandler(QulErrorHandler *handler)

Set error handler to handler.

Passing NULL as an argument will restore default error handling.

Returns a pointer to the previous error handler. NULL is returned when the default error handler is in use.

Called by Qul::setErrorHandler

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

See also Error handling.

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

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

Returns true if the rectangles r1 r2 are different, otherwise returns false.

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

Returns true if the rectangles r1 r2 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::RectF &r1, const Qul::PlatformInterface::RectF &r2)

Returns true if the rectangles r1 and r2 are equal, otherwise returns false.

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

Returns true if the rectangles r1 r2 are equal, otherwise returns false.

Available under certain Qt licenses.
Find out more.