C

QSafeRenderer Class

class SafeRenderer::QSafeRenderer

The QSafeRenderer class renders the safe layout. More...

Header: #include <QSafeRenderer>
Since: QtSafeRenderer 1.0

This class was introduced in QtSafeRenderer 1.0.

Public Types

enum RendererException { UnsupportedSurfaceFormat, BitmapOutOfScreen, InvalidBitmapPointer, InvalidBitmapId }

Public Functions

QSafeRenderer(SafeRenderer::AbstractWindow *const window, SafeRenderer::QSafeLayout *const layout)
~QSafeRenderer()
SafeRenderer::Rect clear(const SafeRenderer::ARGB &pixel)
SafeRenderer::Rect clearBitmap(const SafeRenderer::quint32 id)
SafeRenderer::Rect clearBitmap(const SafeRenderer::qchar *const itemName)
SafeRenderer::Rect drawBitmap(const SafeRenderer::quint32 id)
SafeRenderer::Rect drawBitmap(const SafeRenderer::qchar *const itemName)
SafeRenderer::Rect drawText(const SafeRenderer::quint32 id, const SafeRenderer::qchar *const text)
bool setLayout(SafeRenderer::QSafeLayout *const layout)
typedef qchar
typedef qint8
typedef qint32
typedef qint64
typedef qint
typedef quchar
typedef quint8
typedef quint16
typedef quint32
typedef quint64

Detailed Description

The QSafeRenderer class draws and clears the bitmaps defined in the QSafeLayout class.

Member Type Documentation

enum QSafeRenderer::RendererException

This enum describes the exception values in the QSafeRenderer class.

ConstantValueDescription
SafeRenderer::QSafeRenderer::UnsupportedSurfaceFormat0The bits per pixel value in the window is neither 16 or 32.
SafeRenderer::QSafeRenderer::BitmapOutOfScreen1The bitmap does not fit inside the screen area.
SafeRenderer::QSafeRenderer::InvalidBitmapPointer2The bitmap pointer is a null pointer.
SafeRenderer::QSafeRenderer::InvalidBitmapId3The bitmap ID is 0.

Member Function Documentation

QSafeRenderer::QSafeRenderer(SafeRenderer::AbstractWindow *const window, SafeRenderer::QSafeLayout *const layout)

Constructs a safe renderer object with a window and layout. window is the target window where the bitmap is drawn. layout hold the layout data position.

In case of a failure, one of the following exceptions will be thrown:

ConstantDescription
SafeRenderer::QSafeBitmapFileReader::BitmapFileReaderException::IndexOutOfBoundsThe bitmap index exceeds the value defined in SafeRenderer::Constraints::MAX_AMOUNT_OF_BITMAPS.
SafeRenderer::QSafeLayout::LayoutException::UnknownBitmapIdThe bitmap could not found bitmap by given ID.
SafeRenderer::QSafeLayout::LayoutException::UnknownItemThe item could not be found.
SafeRenderer::QSafeLayout::LayoutException::ItemOutOfBoundsThe item's position is out of the layout's boundaries.
SafeRenderer::QSafeRenderer::RendererException::UnsupportedSurfaceFormatThe bits per pixel value in the window is neither 16 nor 32, or the given framebuffer address is NULL.

QSafeRenderer::~QSafeRenderer()

Destroys the safe renderer.

SafeRenderer::Rect QSafeRenderer::clear(const SafeRenderer::ARGB &pixel)

Fill the screen with the pixel color.

SafeRenderer::Rect QSafeRenderer::clearBitmap(const SafeRenderer::quint32 id)

Clears the bitmap id from the screen.

In case of a failure, one of the following exceptions will be thrown:

ConstantDescription
SafeRenderer::QSafeBitmapFileReader::BitmapFileReaderException::IndexOutOfBoundsThe bitmap index exceeds the value defined in SafeRenderer::Constraints::MAX_AMOUNT_OF_BITMAPS.
SafeRenderer::QSafeRenderer::BitmapOutOfScreenThe bitmap does not fit to the screen.
SafeRenderer::QSafeRenderer::InvalidBitmapPointerThe bitmap pointer is a null pointer.
SafeRenderer::QSafeRenderer::InvalidBitmapIdThe bitmap ID is 0.

SafeRenderer::Rect QSafeRenderer::clearBitmap(const SafeRenderer::qchar *const itemName)

Clears the bitmap itemName from the screen.

In case of a failure, one of the following exceptions will be thrown:

ConstantDescription
SafeRenderer::QSafeBitmapFileReader::BitmapFileReaderException::IndexOutOfBoundsThe bitmap index exceeds the value defined in SafeRenderer::Constraints::MAX_AMOUNT_OF_BITMAPS.
SafeRenderer::QSafeRenderer::BitmapOutOfScreenThe bitmap does not fit to the screen.
SafeRenderer::QSafeRenderer::InvalidBitmapPointerThe bitmap pointer is a null pointer.
SafeRenderer::QSafeRenderer::InvalidBitmapIdThe bitmap ID is 0.

SafeRenderer::Rect QSafeRenderer::drawBitmap(const SafeRenderer::quint32 id)

Draws bitmap id to the screen.

In case of a failure, one of the following exceptions will be thrown:

ConstantDescription
SafeRenderer::QSafeBitmapFileReader::BitmapFileReaderException::IndexOutOfBoundsThe bitmap index exceeds the value defined in SafeRenderer::Constraints::MAX_AMOUNT_OF_BITMAPS.
SafeRenderer::QSafeRenderer::BitmapOutOfScreenThe bitmap does not fit to the screen.
SafeRenderer::QSafeRenderer::InvalidBitmapPointerThe bitmap pointer is a null pointer.
SafeRenderer::QSafeRenderer::InvalidBitmapIdThe bitmap ID is 0.

SafeRenderer::Rect QSafeRenderer::drawBitmap(const SafeRenderer::qchar *const itemName)

Draws the bitmap itemName to the screen.

In case of a failure, one of the following exceptions will be thrown:

ConstantDescription
SafeRenderer::QSafeBitmapFileReader::BitmapFileReaderException::IndexOutOfBoundsThe bitmap index exceeds the value defined in SafeRenderer::Constraints::MAX_AMOUNT_OF_BITMAPS.
SafeRenderer::QSafeRenderer::BitmapOutOfScreenThe bitmap does not fit to the screen.
SafeRenderer::QSafeRenderer::InvalidBitmapPointerThe bitmap pointer is a null pointer.
SafeRenderer::QSafeRenderer::InvalidBitmapIdThe bitmap ID is 0.

SafeRenderer::Rect QSafeRenderer::drawText(const SafeRenderer::quint32 id, const SafeRenderer::qchar *const text)

Draws text with bitmap id.

This function was introduced in QtSafeRenderer 1.1.

bool QSafeRenderer::setLayout(SafeRenderer::QSafeLayout *const layout)

Sets the layout to layout.

It is possible to change renderer layout on runtime. The size of the new layout must match the current layout.

Returns true if setting the layout succeeded, otherwise false.

Related Non-Members

typedef qchar

Qt-style synonym for 8-bit signed char.

typedef qint8

Qt-style synonym for 8-bit signed char.

typedef qint32

Qt-style synonym for 32-bit signed int.

typedef qint64

Qt-style synonym for 64-bit signed long long.

typedef qint

Qt-style synonym for 32-bit signed int.

typedef quchar

Qt-style synonym for 8-bit unsigned char.

typedef quint8

Qt-style synonym for 8-bit unsigned char.

typedef quint16

Qt-style synonym for 16-bit unsigned short.

typedef quint32

Qt-style synonym for 32-bit unsigned int.

typedef quint64

Qt-style synonym for 64-bit unsigned long long.

Available under certain Qt licenses.
Find out more.