Detailed Description
The QLinuxFbScreen class implements a screen driver for the Linux framebuffer.
Note that this class is only available in Qtopia Core. Custom screen drivers can be added by subclassing the QScreenDriverPlugin class, using the QScreenDriverFactory class to dynamically load the driver into the application, but there should only be one screen object per application.
The QLinuxFbScreen class provides the cache() function allocating off-screen graphics memory, and the complementary uncache() function releasing the allocated memory. The latter function will first sync the graphics card to ensure the memory isn't still being used by a command in the graphics card FIFO queue. The deleteEntry() function deletes the given memory block without such synchronization. Given the screen instance and client id, the memory can also be released using the clearCache() function, but this should only be necessary if a client exits abnormally.
In addition, when in paletted graphics modes, the set() function provides the possibility of setting a specified color index to a given RGB value.
The QLinuxFbScreen class also acts as a factory for the unaccelerated screen cursor and the unaccelerated raster-based implementation of QPaintEngine (QRasterPaintEngine); accelerated drivers for Linux should derive from this class.
See also QScreen, QScreenDriverPlugin, and Running Applications.
Member Function Documentation
QLinuxFbScreen::QLinuxFbScreen ( int displayId )
Constructs a QLinuxFbScreen object. The displayId argument identifies the Qtopia Core server to connect to.
QLinuxFbScreen::~QLinuxFbScreen () [virtual]
Destroys this QLinuxFbScreen object.
uchar * QLinuxFbScreen::cache ( int amount ) [virtual]
Requests the specified amount of offscreen graphics card memory from the memory manager, and returns a pointer to the data within the framebuffer (or 0 if there is no free memory).
Note that the display is locked while memory is allocated in order to preserve the memory pool's integrity.
Use the QScreen::onCard() function to retrieve an offset (in bytes) from the start of graphics card memory for the returned pointer.
See also uncache(), clearCache(), and deleteEntry().
void QLinuxFbScreen::clearCache ( QScreen * instance, int clientId ) [static protected]
Removes all entries from the cache for the specified screen instance and client identified by the given clientId.
Calling this function should only be necessary if a client exits abnormally.
See also cache(), uncache(), and deleteEntry().
void QLinuxFbScreen::deleteEntry ( uchar * memoryBlock ) [protected]
Deletes the specified memoryBlock allocated from the graphics card memory.
See also uncache(), cache(), and clearCache().
void QLinuxFbScreen::set ( unsigned int index, unsigned int red, unsigned int green, unsigned int blue ) [virtual]
Sets the specified color index to the specified RGB value, (red, green, blue), when in paletted graphics modes.
void QLinuxFbScreen::uncache ( uchar * memoryBlock ) [virtual]
Deletes the specified memoryBlock allocated from the graphics card memory.
Note that the display is locked while memory is unallocated in order to preserve the memory pool's integrity.
This function will first sync the graphics card to ensure the memory isn't still being used by a command in the graphics card FIFO queue. It is possible to speed up a driver by overriding this function to avoid syncing. For example, the driver might delay deleting the memory until it detects that all commands dealing with the memory are no longer in the queue. Note that it will then be up to the driver to ensure that the specified memoryBlock no longer is being used.
See also cache(), deleteEntry(), and clearCache().
bool QLinuxFbScreen::useOffscreen () [virtual]