Qt Toolkit - QScreen Class

| Classes - Annotated - Tree - Functions - Home - Structure Qte

# QScreen Class Reference

The QScreen class abstracts the interface to the framebuffer. More...

`#include <qgfx_qws.h>`

List of all member functions.

## Public Members

- QScreen ( int display_id )
- virtual ~QScreen ()
- virtual bool initDevice ()
- virtual bool connect ( const QString & displaySpec )
- virtual void disconnect ()
- virtual int initCursor ( void *, bool=FALSE )
- virtual void shutdownDevice ()
- virtual void setMode ( int, int, int )
- virtual bool supportsDepth ( int ) const
- virtual QGfx* createGfx ( unsigned char *, int, int, int, int )
- virtual QGfx* screenGfx ()
- virtual void save ()
- virtual void restore ()
- virtual void blank ( bool on )
- virtual int pixmapOffsetAlignment ()
- virtual int pixmapLinestepAlignment ()
- virtual bool onCard ( unsigned char * ) const
- virtual bool onCard ( unsigned char *, ulong & out_offset ) const
- virtual void set ( unsigned int, unsigned int, unsigned int, unsigned int )
- virtual int alloc ( unsigned int, unsigned int, unsigned int )
- int width () const
- int height () const
- int depth () const
- virtual int pixmapDepth () const
- int pixelType () const
- int linestep () const
- int deviceWidth () const
- int deviceHeight () const
- uchar* base () const
- virtual uchar* cache ( int, int )
- virtual void uncache ( uchar * )
- int screenSize () const
- int totalSize () const
- QRgb* clut ()
- int numCols ()
- virtual QSize mapToDevice ( const QSize & ) const
- virtual QSize mapFromDevice ( const QSize & ) const
- virtual QPoint mapToDevice ( const QPoint &, const QSize & ) const
- virtual QPoint mapFromDevice ( const QPoint &, const QSize & ) const
- virtual QRect mapToDevice ( const QRect &, const QSize & ) const
- virtual QRect mapFromDevice ( const QRect &, const QSize & ) const
- virtual QImage mapToDevice ( const QImage & ) const
- virtual QImage mapFromDevice ( const QImage & ) const
- virtual QRegion mapToDevice ( const QRegion &, const QSize & ) const
- virtual QRegion mapFromDevice ( const QRegion &, const QSize & ) const
- virtual int transformOrientation () const
- virtual bool isTransformed () const
- virtual bool isInterlaced () const

## Detailed Description

The QScreen class abstracts the interface to the framebuffer.

Descendants of QScreen manage the framebuffer and palette and act as factories for the screen cursor and QGfx's. QLinuxFbScreen manages a Linux framebuffer; accelerated drivers subclass QLinuxFbScreen. There can only be one screen in a Qt/Embedded application.

## Member Function Documentation

### QScreen::QScreen ( int display_id )

Create a screen; the display_id is the number of the Qt/Embedded server to connect to.

### QScreen::~QScreen () `[virtual]`

Destroys a QScreen.

### int QScreen::alloc ( unsigned int r,unsigned int g,unsigned int b ) `[virtual]`

Given an RGB value, return an index which is the closest match to it in the screen's palette. Used in paletted modes only.

### int QScreen::initCursor ( void * end_of_location, bool init=FALSE ) `[virtual]`

This is used to initialise the software cursor - end_of_location points to the address after the area where the cursor image can be stored. init is true for the first application this method is called from (the Qt/Embedded server), false otherwise.

### bool QScreen::onCard ( unsigned char * p ) const `[virtual]`

Returns true if the buffer pointed to by p is within graphics card memory, false if it's in main RAM.

### bool QScreen::onCard ( unsigned char * p, ulong & offset ) const `[virtual]`

This checks whether the buffer specified by p is on the card (as per the other version of onCard) and returns an offset in bytes from the start of graphics card memory in offset if it is.

### int QScreen::pixelType () const

Returns an integer (taking the same values as QGfx::PixelType) that specifies the pixel storage format of the screen.

### void QScreen::restore () `[virtual]`

Restore the state of the graphics card from a previous save().

### void QScreen::save () `[virtual]`

Saves the state of the graphics card - used so that, for instance, the palette can be restored when switching between linux virtual consoles. Hardware QScreen descendants should save register state here if necessary if switching between virtual consoles (for example to/from X) is to be permitted.

### QGfx * QScreen::screenGfx () `[virtual]`

Returns a QGfx (normally a QGfxRaster) initialised to point to the screen, with an origin at 0,0 and a clip region covering the whole screen.

### void QScreen::set ( unsigned int, unsigned int, unsigned int, unsigned int ) `[virtual]`

Set an entry in the colour palette. A noop in this class, implemented in QLinuxFbScreen.

### void QScreen::shutdownDevice () `[virtual]`

Called by the Qt/Embedded server on shutdown; never called by a Qt/Embedded client. This is intended to support graphics card specific shutdown; the unaccelerated implementation simply hides the mouse cursor.

### bool QScreen::supportsDepth ( int d ) const `[virtual]`

Returns true if the screen supports a particular color depth. Possible values are 1,4,8,16 and 32.

Search the documentation, FAQ, qt-interest archive and more (uses www.trolltech.com):

This file is part of the Qt toolkit, copyright © 1995-2005 Trolltech, all rights reserved.