C

Platform Namespace

Qul::Platform

The namespace offers interfaces to port Qt Quick Ultralite to new platforms. More...

Header: #include <Platform>

Classes

Types

enum FrameBufferingType { SingleBuffering, FlippedDoubleBuffering, CopyingDoubleBuffering, PartialBuffering, OtherBuffering }
enum class MessageQueueStatus { Success, MessageDiscarded, MessageOverwritten, EmptyQueue, Timeout, …, OtherError }

Functions

void deleteQueue(Qul::Platform::MessageQueueInterface *queue)
Qul::Platform::DeviceLinkInterface *getDeviceLinkInterface()
Qul::Platform::PlatformContext *getPlatformInstance()
std::size_t maximumQueueMessageSize()
void printHeapStats()
void printStackStats()
void qul_free(void *ptr)
void *qul_malloc(std::size_t size)
void *qul_realloc(void *ptr, std::size_t new_size)
Qul::Platform::MessageQueueInterface *requestQueue(std::size_t queueCapacity, std::size_t messageSize)

Detailed Description

Classes

class Config

This struct provides runtime representation of platform configuration. More...

class DeviceLink

This class provides functionality for communication between host and device. More...

class DeviceLinkInterface

This provides the interface to implement by the platform. More...

class FrameStatistics

Provides frame rendering statistics. More...

class FramebufferFormat

This struct contains information about a framebuffer. More...

class MessageQueue

A convenience class used to interface with the queue implementation. More...

class MessageQueueInterface

Interface class providing platform-specific queues to Qt Quick Ultralite. More...

class PerformanceMetrics

Provides performance metrics. More...

class PlatformContext

This class provides an abstract interface to implement platform context. More...

class SinglePointTouchEvent

A struct containing information related to a single point touch event. More...

class SinglePointTouchEventDispatcher

A convenience class for handling single point touch from the platform. More...

class StackAllocator

Provides a simple memory allocator for functions that might temporarily require some extra memory for caching. More...

Type Documentation

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

Defines the different buffering mechanisms that are supported.

ConstantValueDescription
SingleBuffering0There is only single buffer used for rendering. All rendering must happen within timing budget allowed by the display refresh rate.
FlippedDoubleBuffering1Two buffers are used and both can be displayed. One is used for displaying while the other is used for rendering and then flipped.
CopyingDoubleBuffering2There is one buffer for rendering and one for displaying. When rendering is finished the content from rendering buffer is copied to the display buffer.
PartialBuffering3There is one or multiple buffers which are smaller than full framebuffer. Partial buffering requires that display has built-in memory.
OtherBuffering4Other platform specific buffering type.

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

See also Framebuffer Requirements and Partial framebuffer.

[since Qt Quick Ultralite (Platform) 1.9] enum class MessageQueueStatus

Status code returned by the MessageQueueInterface functions.

ConstantValueDescription
MessageQueueStatus::Success0Function was executed successfully.
MessageQueueStatus::MessageDiscarded1Message was discarded. This must be returned only when MessageQueueInterface::enqueueOrDiscard() and MessageQueueInterface::enqueueOrDiscardFromInterrupt() functions discard the given message.
MessageQueueStatus::MessageOverwritten2A message in a queue was overwritten with the given message. This must be returned only by the MessageQueueInterface::enqueueOrOverwrite() and MessageQueueInterface::enqueueOrOverwriteFromInterrupt() functions.
MessageQueueStatus::EmptyQueue3MessageQueueInterface::receive() or MessageQueueInterface::receiveFromInterrupt() could not get a message from the queue because it is empty.
MessageQueueStatus::Timeout4Could not get a message from the queue within timeout ms.
MessageQueueStatus::DiscardNotSupported5The queue implementation does not support discarding.
MessageQueueStatus::OverwriteNotSupported6The queue implementation does not support overwriting.
MessageQueueStatus::OtherError7None of the status codes fit the status of the function. EventQueue treats it as an error.

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

Function Documentation

[since Qt Quick Ultralite (Platform) 1.9] void deleteQueue(Qul::Platform::MessageQueueInterface *queue)

Deletes the queue.

This function is used by MessageQueue to delete a queue when it is not needed anymore.

Here is an example implementation of this function:

void deleteQueue(MessageQueueInterface *queue)
{
    MyMessageQueue *mq = static_cast<MyMessageQueue *>(queue);
    mq->~MyMessageQueue();
    qul_free(mq);
}

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

See also requestQueue(), maximumQueueMessageSize(), Qul::Platform::MessageQueue, and Qul::Platform::MessageQueueInterface.

Qul::Platform::DeviceLinkInterface *Platform::getDeviceLinkInterface()

Provides the device link interface implementation for the platform.

If there is no such imlementation the function can return nullptr. But ideally, when the device link is not compiled in, this function should not be called at all.

See also QUL_PLATFORM_DEVICELINK_ENABLED.

[since Qt Quick Ultralite (Platform) 2.0] Qul::Platform::PlatformContext *getPlatformInstance()

Returns hardware specific platform context instance.

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

[since Qt Quick Ultralite (Platform) 1.9] std::size_t maximumQueueMessageSize()

Returns the maximum size of a message that a queue can hold. If the queue's maximum message size is not known or is arbitrary, SIZE_MAX must be returned.

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

See also requestQueue(), Qul::Platform::MessageQueue, and Qul::Platform::MessageQueueInterface.

[since Qt Quick Ultralite (Platform) 1.5] void printHeapStats()

Print heap usage statistics to stderr.

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

[since Qt Quick Ultralite (Platform) 1.5] void printStackStats()

Print stack usage statistics to stderr.

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

[since Qt Quick Ultralite (Platform) 1.5] void qul_free(void *ptr)

Frees a memory block allocated by qul_malloc.

ptr is the pointer to the memory block to be freed.

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

See also Qul::Platform::qul_malloc(std::size_t size) and Qul::Platform::qul_realloc(void *ptr, std::size_t new_size).

[since Qt Quick Ultralite (Platform) 1.5] void *qul_malloc(std::size_t size)

Allocates memory in the way optimal for the platform.

size is the size of the requested block of memory, in bytes.

All of Qt Quick Ultralite performs dynamic memory allocation through this function.

Memory allocated using this function must be freed using qul_free. Resizing the memory block that was allocated can also be done using qul_realloc.

Might return NULL if there is not sufficient memory to satisfy the request.

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

See also Qul::Platform::qul_free(void *ptr) and Qul::Platform::qul_realloc(void *ptr, std::size_t new_size).

[since Qt Quick Ultralite (Platform) 1.5] void *qul_realloc(void *ptr, std::size_t new_size)

Attempt to resize a memory block allocated with qul_malloc.

ptr is the pointer the the previously allocated memory block, and new_size is the new size for the memory block, in bytes.

Might return NULL if there is not sufficient memory to satisfy the request.

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

See also Qul::Platform::qul_malloc(std::size_t size) and Qul::Platform::qul_free(void *ptr).

[since Qt Quick Ultralite (Platform) 1.9] Qul::Platform::MessageQueueInterface *requestQueue(std::size_t queueCapacity, std::size_t messageSize)

Returns an instance of the MessageQueueInterface implementation with queueCapacity capacity. The queue must accept messages that satisfies the messageSize requirement. If the implementation can't satisfy the queueCapacity or messageSize, the function must return a null pointer.

This function is used by MessageQueue to get an appropriate queue for its use.

Here is an example implementation of this function:

MessageQueueInterface *requestQueue(size_t queueCapacity, size_t messageSize)
{
    void *queue = qul_malloc(sizeof(MyMessageQueue));

    if (queue == NULL) {
        return NULL;
    }

    MessageQueueInterface *interface = new (queue) MyMessageQueue(queueCapacity, messageSize);
    return interface;
}

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

See also deleteQueue(), maximumQueueMessageSize(), Qul::Platform::MessageQueue, and Qul::Platform::MessageQueueInterface.

Available under certain Qt licenses.
Find out more.