Qt 4.8
Public Functions | Private Functions | Properties | List of all members
QMultiScreen Class Reference

#include <qscreenmulti_qws_p.h>

Inheritance diagram for QMultiScreen:
QScreen

Public Functions

void blank (bool on)
 Prevents the screen driver form displaying any content on the screen. More...
 
void blit (const QImage &img, const QPoint &topLeft, const QRegion &region)
 Copies the given region in the given image to the point specified by topLeft using device coordinates. More...
 
void blit (QWSWindow *bs, const QRegion &clip)
 
bool connect (const QString &displaySpec)
 This function is called by every Qt for Embedded Linux application on startup, and must be implemented to map in the framebuffer and the accelerated drivers that the graphics card control registers. More...
 
QWSWindowSurfacecreateSurface (QWidget *widget) const
 Creates and returns a new window surface for the given widget. More...
 
QWSWindowSurfacecreateSurface (const QString &key) const
 Creates and returns a new window surface matching the given key. More...
 
void disconnect ()
 This function is called by every Qt for Embedded Linux application before exiting, and must be implemented to unmap the framebuffer. More...
 
void exposeRegion (QRegion r, int changing)
 This function is called by the Qt for Embedded Linux server whenever a screen update is required. More...
 
void haltUpdates ()
 
bool initDevice ()
 This function is called by the Qt for Embedded Linux server to initialize the framebuffer. More...
 
bool isInterlaced () const
 Returns true if the display is interlaced (i. More...
 
int memoryNeeded (const QString &)
 
bool onCard (const unsigned char *) const
 Returns true if the specified buffer is within the graphics card's memory; otherwise returns false (i.e. More...
 
bool onCard (const unsigned char *, ulong &out_offset) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.If the specified buffer is within the graphics card's memory, this function stores the offset from the start of graphics card memory (in bytes), in the location specified by the offset parameter. More...
 
 QMultiScreen (int displayId)
 
QRegion region () const
 Returns the region covered by this screen driver. More...
 
void restore ()
 Restores the previously saved state of the graphics card. More...
 
void resumeUpdates ()
 
void save ()
 Saves the current state of the graphics card. More...
 
void setDirty (const QRect &)
 Marks the given rectangle as dirty. More...
 
void setMode (int, int, int)
 Implement this function to reset the framebuffer's resolution (width and height) and bit depth. More...
 
int sharedRamSize (void *)
 
void shutdownDevice ()
 This function is called by the Qt for Embedded Linux server before it calls the disconnect() function when exiting. More...
 
void solidFill (const QColor &color, const QRegion &region)
 Fills the given region of the screen with the specified color. More...
 
QList< QScreen * > subScreens () const
 
bool supportsDepth (int) const
 Returns true if the screen supports the specified color depth; otherwise returns false. More...
 
 ~QMultiScreen ()
 
- Public Functions inherited from QScreen
virtual int alloc (unsigned int, unsigned int, unsigned int)
 Returns the index in the screen's palette which is the closest match to the given RGB value (red, green, blue). More...
 
ucharbase () const
 Returns a pointer to the beginning of the framebuffer. More...
 
void blit (QWSWindow *bs, const QRegion &clip)
 
virtual ucharcache (int)
 
ClassId classId () const
 Returns the class identifier for the screen object. More...
 
QRgbclut ()
 Returns a pointer to the screen's color lookup table (i. More...
 
int colorCount ()
 Returns the number of entries in the screen's color lookup table (i. More...
 
int depth () const
 Returns the depth of the framebuffer, in bits per pixel. More...
 
int deviceHeight () const
 Returns the full height of the framebuffer device in pixels. More...
 
int deviceWidth () const
 Returns the physical width of the framebuffer device in pixels. More...
 
QGraphicsSystemgraphicsSystem () const
 
int height () const
 Returns the logical height of the framebuffer in pixels. More...
 
virtual bool isTransformed () const
 Returns true if the screen is transformed (for instance, rotated 90 degrees); otherwise returns false. More...
 
int linestep () const
 Returns the length of each scanline of the framebuffer in bytes. More...
 
virtual QSize mapFromDevice (const QSize &) const
 Maps the given size from the framebuffer coordinate system to the coordinate space used by the application. More...
 
virtual QPoint mapFromDevice (const QPoint &, const QSize &) const
 Maps the given point from the framebuffer coordinate system to the coordinate space used by the application, passing the device's screenSize as argument. More...
 
virtual QRect mapFromDevice (const QRect &, const QSize &) const
 Maps the given rectangle from the framebuffer coordinate system to the coordinate space used by the application, passing the device's screenSize as argument. More...
 
virtual QImage mapFromDevice (const QImage &) const
 Maps the given image from the framebuffer coordinate system to the coordinate space used by the application. More...
 
virtual QRegion mapFromDevice (const QRegion &, const QSize &) const
 Maps the given region from the framebuffer coordinate system to the coordinate space used by the application, passing the device's screenSize as argument. More...
 
virtual QSize mapToDevice (const QSize &) const
 Maps the given size from the coordinate space used by the application to the framebuffer coordinate system. More...
 
virtual QPoint mapToDevice (const QPoint &, const QSize &) const
 Maps the given point from the coordinate space used by the application to the framebuffer coordinate system, passing the device's screenSize as argument. More...
 
virtual QRect mapToDevice (const QRect &, const QSize &) const
 Maps the given rectangle from the coordinate space used by the application to the framebuffer coordinate system, passing the device's screenSize as argument. More...
 
virtual QImage mapToDevice (const QImage &) const
 Maps the given image from the coordinate space used by the application to the framebuffer coordinate system. More...
 
virtual QRegion mapToDevice (const QRegion &, const QSize &) const
 Maps the given region from the coordinate space used by the application to the framebuffer coordinate system, passing the device's screenSize as argument. More...
 
QT_DEPRECATED int numCols ()
 
QPoint offset () const
 Returns the logical offset of the screen, i. More...
 
int physicalHeight () const
 Returns the physical height of the screen in millimeters. More...
 
int physicalWidth () const
 Returns the physical width of the screen in millimeters. More...
 
QImage::Format pixelFormat () const
 Returns the pixel format of the screen, or QImage::Format_Invalid if the pixel format is not a supported image format. More...
 
PixelType pixelType () const
 Returns the pixel storage format of the screen. More...
 
QPixmapDataFactorypixmapDataFactory () const
 
virtual int pixmapDepth () const
 Returns the preferred depth for pixmaps, in bits per pixel. More...
 
virtual int pixmapLinestepAlignment ()
 Returns the value (in bits) to which individual scanlines of pixmaps held in the graphics card's memory, should be aligned. More...
 
virtual int pixmapOffsetAlignment ()
 Returns the value (in bits) to which the start address of pixmaps held in the graphics card's memory, should be aligned. More...
 
 QScreen (int display_id, ClassId classId)
 Constructs a new screen driver. More...
 
 QScreen (int display_id)
 Constructs a new screen driver. More...
 
int screenSize () const
 Returns the size of the screen in bytes. More...
 
virtual void set (unsigned int, unsigned int, unsigned int, unsigned int)
 
void setOffset (const QPoint &p)
 
int subScreenIndexAt (const QPoint &p) const
 Returns the index of the subscreen at the given position; returns -1 if no screen is found. More...
 
int totalSize () const
 Returns the size of the available graphics card memory (including the screen) in bytes. More...
 
virtual int transformOrientation () const
 Returns the current rotation as an integer value. More...
 
virtual void uncache (uchar *)
 
int width () const
 Returns the logical width of the framebuffer in pixels. More...
 
virtual ~QScreen ()
 Destroys this screen driver. More...
 

Private Functions

void addSubScreen (QScreen *screen)
 
void removeSubScreen (QScreen *screen)
 

Properties

QMultiScreenPrivated_ptr
 

Additional Inherited Members

- Public Types inherited from QScreen
enum  ClassId {
  LinuxFBClass, TransformedClass, VNCClass, MultiClass,
  VFbClass, DirectFBClass, SvgalibClass, ProxyClass,
  GLClass, IntfbClass, CustomClass = 1024
}
 This enum defines the class identifiers for the known screen subclasses. More...
 
enum  PixelType { NormalPixel, BGRPixel }
 This enum describes the pixel storage format of the screen, i. More...
 
- Static Public Functions inherited from QScreen
static QScreeninstance ()
 Returns a pointer to the application's QScreen instance. More...
 
- Protected Functions inherited from QScreen
void setGraphicsSystem (QGraphicsSystem *system)
 
void setPixelFormat (QImage::Format format)
 Sets the screen's pixel format to format. More...
 
void setPixmapDataFactory (QPixmapDataFactory *factory)
 
- Protected Variables inherited from QScreen
int d
 the pixel depth More...
 
uchardata
 points to the first visible pixel in the frame buffer. More...
 
int dh
 the device height More...
 
int displayId
 
int dw
 the device width More...
 
QPoolEntryentries
 
int * entryp
 
bool grayscale
 the gray scale screen mode flag More...
 
int h
 the logical height of the screen. More...
 
unsigned int * lowest
 
int lstep
 the number of bytes representing a line in the frame buffer. More...
 
int mapsize
 the total number of bytes in the frame buffer More...
 
int physHeight
 the physical height of the screen in millimeters. More...
 
int physWidth
 the physical width of the screen in millimeters. More...
 
PixelType pixeltype
 set to BGRPixel More...
 
QRgb screenclut [256]
 the color table More...
 
int screencols
 the number of entries in the color table More...
 
int size
 the number of bytes in the visible region of the frame buffer More...
 
int w
 the logical width of the screen. More...
 
- Static Protected Variables inherited from QScreen
static ClearCacheFunc clearCacheFunc = 0
 

Detailed Description

Definition at line 64 of file qscreenmulti_qws_p.h.

Constructors and Destructors

◆ QMultiScreen()

QMultiScreen::QMultiScreen ( int  displayId)

Definition at line 164 of file qscreenmulti_qws.cpp.

166 {
167 }
int displayId
Definition: qscreen_qws.h:337
QScreen(int display_id, ClassId classId)
Constructs a new screen driver.
QMultiScreenPrivate * d_ptr

◆ ~QMultiScreen()

QMultiScreen::~QMultiScreen ( )

Definition at line 169 of file qscreenmulti_qws.cpp.

170 {
171  delete d_ptr;
172 }
QMultiScreenPrivate * d_ptr

Functions

◆ addSubScreen()

void QMultiScreen::addSubScreen ( QScreen screen)
private

Definition at line 472 of file qscreenmulti_qws.cpp.

Referenced by connect().

473 {
474  d_ptr->screens.append(screen);
475  d_ptr->region += screen->region();
476 }
virtual QRegion region() const
Returns the region covered by this screen driver.
Definition: qscreen_qws.h:284
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
QList< QScreen * > screens
QMultiScreenPrivate * d_ptr

◆ blank()

void QMultiScreen::blank ( bool  on)
virtual

Prevents the screen driver form displaying any content on the screen.

Note that the default implementation does nothing.

Reimplement this function to prevent the screen driver from displaying any contents on the screen if on is true; otherwise the contents is expected to be shown.

See also
blit()

Reimplemented from QScreen.

Definition at line 309 of file qscreenmulti_qws.cpp.

310 {
311  const int n = d_ptr->screens.size();
312  for (int i = 0; i < n; ++i)
313  d_ptr->screens.at(i)->blank(on);
314 }
QList< QScreen * > screens
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
virtual void blank(bool on)
Prevents the screen driver form displaying any content on the screen.
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QMultiScreenPrivate * d_ptr

◆ blit() [1/2]

void QMultiScreen::blit ( const QImage image,
const QPoint topLeft,
const QRegion region 
)
virtual

Copies the given region in the given image to the point specified by topLeft using device coordinates.

This function is called from the exposeRegion() function; it is not intended to be called explicitly.

Reimplement this function to make use of Adding an Accelerated Graphics Driver to Qt for Embedded Linux{accelerated hardware}. Note that this function must be reimplemented if the framebuffer format is not supported by Qt for Embedded Linux (See the Qt for Embedded Linux Display Management{Display Management} documentation for more details).

See also
exposeRegion(), solidFill(), blank()

Reimplemented from QScreen.

Definition at line 400 of file qscreenmulti_qws.cpp.

402 {
403  const int n = d_ptr->screens.size();
404  for (int i = 0; i < n; ++i) {
405  QScreen *screen = d_ptr->screens.at(i);
406  const QRegion r = region & screen->region();
407  if (r.isEmpty())
408  continue;
409  screen->blit(img, topLeft, r);
410  }
411 }
virtual void blit(const QImage &img, const QPoint &topLeft, const QRegion &region)
Copies the given region in the given image to the point specified by topLeft using device coordinates...
virtual QRegion region() const
Returns the region covered by this screen driver.
Definition: qscreen_qws.h:284
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
Definition: qregion.cpp:4098
QList< QScreen * > screens
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QRegion class specifies a clip region for a painter.
Definition: qregion.h:68
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QMultiScreenPrivate * d_ptr
The QScreen class is a base class for screen drivers in Qt for Embedded Linux.
Definition: qscreen_qws.h:191

◆ blit() [2/2]

void QMultiScreen::blit ( QWSWindow bs,
const QRegion clip 
)

Definition at line 413 of file qscreenmulti_qws.cpp.

414 {
415  const int n = d_ptr->screens.size();
416  for (int i = 0; i < n; ++i) {
417  QScreen *screen = d_ptr->screens.at(i);
418  const QRegion r = clip & screen->region();
419  if (r.isEmpty())
420  continue;
421  screen->blit(bs, r);
422  }
423 }
virtual void blit(const QImage &img, const QPoint &topLeft, const QRegion &region)
Copies the given region in the given image to the point specified by topLeft using device coordinates...
virtual QRegion region() const
Returns the region covered by this screen driver.
Definition: qscreen_qws.h:284
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
Definition: qregion.cpp:4098
QList< QScreen * > screens
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QRegion class specifies a clip region for a painter.
Definition: qregion.h:68
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QMultiScreenPrivate * d_ptr
The QScreen class is a base class for screen drivers in Qt for Embedded Linux.
Definition: qscreen_qws.h:191

◆ connect()

bool QMultiScreen::connect ( const QString displaySpec)
virtual

This function is called by every Qt for Embedded Linux application on startup, and must be implemented to map in the framebuffer and the accelerated drivers that the graphics card control registers.

Note that connect must be called before the initDevice() function.

Ensure that true is returned if a connection to the screen device is made. Otherwise, return false. Upon making the connection, the function should read out the parameters of the framebuffer and use them as required to set this class's protected variables.

The displaySpec argument is passed by the QWS_DISPLAY environment variable or the -display command line parameter, and has the following syntax:

[screen driver][:driver specific options][:display number]

For example, to use the mach64 driver on fb1 as display 2:

Mach64:/dev/fb1:2

See Qt for Embedded Linux Display Management for more details.

See also
disconnect(), initDevice(), {Running Qt for Embedded Linux Applications}

Implements QScreen.

Definition at line 221 of file qscreenmulti_qws.cpp.

222 {
223  QString dSpec = displaySpec;
224  if (dSpec.startsWith(QLatin1String("Multi:"), Qt::CaseInsensitive))
225  dSpec = dSpec.mid(QString::fromLatin1("Multi:").size());
226 
227  const QString displayIdSpec = QString::fromLatin1(" :%1").arg(displayId);
228  if (dSpec.endsWith(displayIdSpec))
229  dSpec = dSpec.left(dSpec.size() - displayIdSpec.size());
230 
232  foreach (QString spec, specs) {
233  const int id = getDisplayId(spec);
234  if (spec.startsWith("vnc:", Qt::CaseInsensitive)) {
235  spec.append(":noDisablePainting");
236  }
237  const QPoint offset = filterDisplayOffset(spec);
238  QScreen *s = qt_get_screen(id, spec.toLatin1().constData());
239  s->setOffset(offset);
240  addSubScreen(s);
241  }
242 
243  QScreen *firstScreen = d_ptr->screens.at(0);
244  Q_ASSERT(firstScreen);
245 
246  // XXX
247  QScreen::d = firstScreen->depth();
248 
249  QScreen::lstep = 0;
250  QScreen::data = 0;
251  QScreen::size = 0;
252 
255 
258 
259  // XXX - Extend the physical size based on the first screen
260  // to encompass all screens, so that code that uses the multi
261  // screen to calculate dpi values will get the right numbers.
262  QScreen::physWidth = firstScreen->physicalWidth() * w / firstScreen->width();
263  QScreen::physHeight = firstScreen->physicalHeight() * h / firstScreen->height();
264 
265  // XXXXX
266  qt_screen = this;
267 
268  return true;
269 }
Q_GUI_EXPORT QScreen * qt_screen
Definition: qscreen_qws.cpp:69
int height() const
Returns the logical height of the framebuffer in pixels.
Definition: qscreen_qws.h:228
void setOffset(const QPoint &p)
int physicalHeight() const
Returns the physical height of the screen in millimeters.
Definition: qscreen_qws.h:291
int d
the pixel depth
Definition: qscreen_qws.h:327
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
Definition: qstring.cpp:3734
Q_GUI_EXPORT QScreen * qt_get_screen(int display_id, const char *spec)
QRect boundingRect() const
Returns the bounding rectangle of this region.
Definition: qregion.cpp:4363
int physHeight
the physical height of the screen in millimeters.
Definition: qscreen_qws.h:340
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
The QString class provides a Unicode character string.
Definition: qstring.h:83
int size
the number of bytes in the visible region of the frame buffer
Definition: qscreen_qws.h:334
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
int physWidth
the physical width of the screen in millimeters.
Definition: qscreen_qws.h:339
void addSubScreen(QScreen *screen)
int width() const
Returns the logical width of the framebuffer in pixels.
Definition: qscreen_qws.h:227
uchar * data
points to the first visible pixel in the frame buffer.
Definition: qscreen_qws.h:311
QString left(int n) const Q_REQUIRED_RESULT
Returns a substring that contains the n leftmost characters of the string.
Definition: qstring.cpp:3664
int size() const
Returns the number of characters in this string.
Definition: qstring.h:102
static int getDisplayId(const QString &spec)
QList< QScreen * > screens
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
int w
the logical width of the screen.
Definition: qscreen_qws.h:324
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
Definition: qstring.cpp:3993
int displayId
Definition: qscreen_qws.h:337
const char * constData() const
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:433
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
Definition: qstring.cpp:3706
int dw
the device width
Definition: qscreen_qws.h:331
int dh
the device height
Definition: qscreen_qws.h:332
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
Definition: qstring.cpp:7186
QString & append(QChar c)
Definition: qstring.cpp:1777
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
QMultiScreenPrivate * d_ptr
The QScreen class is a base class for screen drivers in Qt for Embedded Linux.
Definition: qscreen_qws.h:191
int lstep
the number of bytes representing a line in the frame buffer.
Definition: qscreen_qws.h:325
QStringList split(const QString &sep, SplitBehavior behavior=KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const Q_REQUIRED_RESULT
Splits the string into substrings wherever sep occurs, and returns the list of those strings...
Definition: qstring.cpp:6526
int h
the logical height of the screen.
Definition: qscreen_qws.h:326
static QPoint filterDisplayOffset(QString &spec)
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
Definition: qstring.cpp:3796
int physicalWidth() const
Returns the physical width of the screen in millimeters.
Definition: qscreen_qws.h:290
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55
QPoint offset() const
Returns the logical offset of the screen, i.
int depth() const
Returns the depth of the framebuffer, in bits per pixel.
Definition: qscreen_qws.h:229

◆ createSurface() [1/2]

QWSWindowSurface * QMultiScreen::createSurface ( QWidget widget) const
virtual

Creates and returns a new window surface for the given widget.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Reimplemented from QScreen.

Definition at line 452 of file qscreenmulti_qws.cpp.

453 {
454  const QPoint midpoint = (widget->frameGeometry().topLeft()
455  + widget->frameGeometry().bottomRight()) / 2;
456  int index = subScreenIndexAt(midpoint);
457  if (index == -1)
458  index = 0; // XXX
459  return d_ptr->screens.at(index)->createSurface(widget);
460 }
QRect frameGeometry
geometry of the widget relative to its parent including any window frame
Definition: qwidget.h:159
QPoint bottomRight() const
Returns the position of the rectangle&#39;s bottom-right corner.
Definition: qrect.h:291
QList< QScreen * > screens
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
virtual QWSWindowSurface * createSurface(QWidget *widget) const
Creates and returns a new window surface for the given widget.
int subScreenIndexAt(const QPoint &p) const
Returns the index of the subscreen at the given position; returns -1 if no screen is found...
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
QMultiScreenPrivate * d_ptr
quint16 index
QPoint topLeft() const
Returns the position of the rectangle&#39;s top-left corner.
Definition: qrect.h:288

◆ createSurface() [2/2]

QWSWindowSurface * QMultiScreen::createSurface ( const QString key) const
virtual

Creates and returns a new window surface matching the given key.

Since
4.2

The server application will call this function whenever it needs to create a server side representation of a window, e.g. when copying the content of memory to the screen using the screen driver.

Note that this function must be reimplemented when adding an accelerated graphics driver. See the Adding an Accelerated Graphics Driver to Qt for Embedded Linux {Adding an Accelerated Graphics Driver} documentation for details.

See also
{Qt for Embedded Linux Architecture}

Reimplemented from QScreen.

Definition at line 438 of file qscreenmulti_qws.cpp.

439 {
440  QWSWindowSurface* surf = 0;
441  const int n = d_ptr->screens.size();
442  for (int i = 0; i < n; ++i) {
443  QScreen *screen = d_ptr->screens.at(i);
444  surf = screen->createSurface(key);
445  if (surf)
446  break;
447  }
448  return surf;
449 }
The QWSWindowSurface class provides the drawing area for top-level windows in Qt for Embedded Linux...
QList< QScreen * > screens
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
virtual QWSWindowSurface * createSurface(QWidget *widget) const
Creates and returns a new window surface for the given widget.
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QMultiScreenPrivate * d_ptr
The QScreen class is a base class for screen drivers in Qt for Embedded Linux.
Definition: qscreen_qws.h:191

◆ disconnect()

void QMultiScreen::disconnect ( )
virtual

This function is called by every Qt for Embedded Linux application before exiting, and must be implemented to unmap the framebuffer.

Note that a server application will call the shutdownDevice() function prior to this function.

See also
connect(), shutdownDevice(), {Running Qt for Embedded Linux Applications}

Implements QScreen.

Definition at line 271 of file qscreenmulti_qws.cpp.

272 {
273  const int n = d_ptr->screens.size();
274  for (int i = 0; i < n; ++i)
275  d_ptr->screens.at(i)->disconnect();
276 }
virtual void disconnect()=0
This function is called by every Qt for Embedded Linux application before exiting, and must be implemented to unmap the framebuffer.
QList< QScreen * > screens
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QMultiScreenPrivate * d_ptr

◆ exposeRegion()

void QMultiScreen::exposeRegion ( QRegion  region,
int  windowIndex 
)
virtual

This function is called by the Qt for Embedded Linux server whenever a screen update is required.

region is the area on the screen that must be updated, and windowIndex is the index into QWSServer::clientWindows() of the window that required the update. QWSWindow::state() gives more information about the cause.

The default implementation composes the affected windows and paints the given region on screen by calling the blit() and solidFill() functions

This function can be reimplemented to perform composition in hardware, or to perform transition effects. For simpler hardware acceleration, or to interface with this is typically done by reimplementing the blit() and solidFill() functions instead.

Note that there is no need to call this function explicitly.

See also
blit(), solidFill(), blank()

Reimplemented from QScreen.

Definition at line 376 of file qscreenmulti_qws.cpp.

377 {
378  const int n = d_ptr->screens.size();
379  for (int i = 0; i < n; ++i) {
380  QScreen *screen = d_ptr->screens.at(i);
381  const QRegion r = region & screen->region();
382  if (r.isEmpty())
383  continue;
384  screen->exposeRegion(r, changing);
385  }
386 }
virtual QRegion region() const
Returns the region covered by this screen driver.
Definition: qscreen_qws.h:284
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
Definition: qregion.cpp:4098
QList< QScreen * > screens
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QRegion class specifies a clip region for a painter.
Definition: qregion.h:68
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QMultiScreenPrivate * d_ptr
The QScreen class is a base class for screen drivers in Qt for Embedded Linux.
Definition: qscreen_qws.h:191
virtual void exposeRegion(QRegion r, int changing)
This function is called by the Qt for Embedded Linux server whenever a screen update is required...

◆ haltUpdates()

void QMultiScreen::haltUpdates ( )
virtual
Warning
This function is not part of the public interface.

Reimplemented from QScreen.

Definition at line 362 of file qscreenmulti_qws.cpp.

363 {
364  const int n = d_ptr->screens.size();
365  for (int i = 0; i < n; ++i)
366  d_ptr->screens.at(i)->haltUpdates();
367 }
QList< QScreen * > screens
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
virtual void haltUpdates()
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QMultiScreenPrivate * d_ptr

◆ initDevice()

bool QMultiScreen::initDevice ( )
virtual

This function is called by the Qt for Embedded Linux server to initialize the framebuffer.

Note that a server application will call the connect() function prior to this function.

Implement this function to make accelerated drivers set up the graphics card. Return true to indicate success and false to indicate failure.

See also
shutdownDevice(), connect()

Implements QScreen.

Definition at line 174 of file qscreenmulti_qws.cpp.

175 {
176  bool ok = true;
177 
178 #ifndef QT_NO_QWS_CURSOR
180 #endif
181 
182  const int n = d_ptr->screens.count();
183  for (int i = 0; i < n; ++i) {
184  QScreen *s = d_ptr->screens.at(i);
185  ok = s->initDevice() && ok;
186 #ifndef QT_NO_QWS_CURSOR
188 #endif
189  }
190 
191 #ifndef QT_NO_QWS_CURSOR
192  // XXX
194 #endif
195 
196  return ok;
197 }
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
void addCursor(QScreenCursor *cursor)
virtual bool initDevice()=0
This function is called by the Qt for Embedded Linux server to initialize the framebuffer.
QList< QScreen * > screens
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QMultiScreenCursor * cursor
QMultiScreenPrivate * d_ptr
The QScreen class is a base class for screen drivers in Qt for Embedded Linux.
Definition: qscreen_qws.h:191
Q_GUI_EXPORT QScreenCursor * qt_screencursor
Definition: qscreen_qws.cpp:67

◆ isInterlaced()

bool QMultiScreen::isInterlaced ( ) const
virtual

Returns true if the display is interlaced (i.

e. is displaying images progressively like a television screen); otherwise returns false.

If the display is interlaced, the drawing is altered to look better.

See also
isTransformed(), linestep()

Reimplemented from QScreen.

Definition at line 334 of file qscreenmulti_qws.cpp.

335 {
336  const int n = d_ptr->screens.size();
337  for (int i = 0; i < n; ++i)
338  if (d_ptr->screens.at(i)->isInterlaced())
339  return true;
340 
341  return false;
342 }
QList< QScreen * > screens
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
virtual bool isInterlaced() const
Returns true if the display is interlaced (i.
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QMultiScreenPrivate * d_ptr

◆ memoryNeeded()

int QMultiScreen::memoryNeeded ( const QString )
virtual
Warning
This function is not part of the public interface.

Reimplemented from QScreen.

Definition at line 344 of file qscreenmulti_qws.cpp.

345 {
346  int total = 0;
347  const int n = d_ptr->screens.size();
348  for (int i = 0; i < n; ++i)
349  total += d_ptr->screens.at(i)->memoryNeeded(string);
350  return total;
351 }
QList< QScreen * > screens
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
virtual int memoryNeeded(const QString &)
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QMultiScreenPrivate * d_ptr

◆ onCard() [1/2]

bool QMultiScreen::onCard ( const unsigned char *  buffer) const
virtual

Returns true if the specified buffer is within the graphics card's memory; otherwise returns false (i.e.

if it's in main RAM).

See also
base(), totalSize()

Reimplemented from QScreen.

Definition at line 316 of file qscreenmulti_qws.cpp.

317 {
318  const int n = d_ptr->screens.size();
319  for (int i = 0; i < n; ++i)
320  if (d_ptr->screens.at(i)->onCard(ptr))
321  return true;
322  return false;
323 }
QList< QScreen * > screens
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
const T * ptr(const T &t)
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QMultiScreenPrivate * d_ptr
virtual bool onCard(const unsigned char *) const
Returns true if the specified buffer is within the graphics card&#39;s memory; otherwise returns false (i...

◆ onCard() [2/2]

bool QMultiScreen::onCard ( const unsigned char *  buffer,
ulong out_offset 
) const
virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.If the specified buffer is within the graphics card's memory, this function stores the offset from the start of graphics card memory (in bytes), in the location specified by the offset parameter.

Reimplemented from QScreen.

Definition at line 325 of file qscreenmulti_qws.cpp.

326 {
327  const int n = d_ptr->screens.size();
328  for (int i = 0; i < n; ++i)
329  if (d_ptr->screens.at(i)->onCard(ptr, offset))
330  return true;
331  return false;
332 }
QList< QScreen * > screens
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
const T * ptr(const T &t)
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QMultiScreenPrivate * d_ptr
virtual bool onCard(const unsigned char *) const
Returns true if the specified buffer is within the graphics card&#39;s memory; otherwise returns false (i...
QPoint offset() const
Returns the logical offset of the screen, i.

◆ region()

QRegion QMultiScreen::region ( ) const
virtual

Returns the region covered by this screen driver.

Since
4.2
See also
base(), screenSize()

Reimplemented from QScreen.

Definition at line 467 of file qscreenmulti_qws.cpp.

468 {
469  return d_ptr->region;
470 }
QMultiScreenPrivate * d_ptr

◆ removeSubScreen()

void QMultiScreen::removeSubScreen ( QScreen screen)
private

Definition at line 478 of file qscreenmulti_qws.cpp.

479 {
480  d_ptr->screens.removeAll(screen);
481  d_ptr->region -= screen->region();
482 }
virtual QRegion region() const
Returns the region covered by this screen driver.
Definition: qscreen_qws.h:284
QList< QScreen * > screens
QMultiScreenPrivate * d_ptr
int removeAll(const T &t)
Removes all occurrences of value in the list and returns the number of entries removed.
Definition: qlist.h:770

◆ restore()

void QMultiScreen::restore ( )
virtual

Restores the previously saved state of the graphics card.

For example, hardware screen drivers should reimplement the save() and restore() functions to save and restore its registers, enabling swintching between virtual consoles.

Note that the default implementation does nothing.

See also
save()

Reimplemented from QScreen.

Definition at line 302 of file qscreenmulti_qws.cpp.

303 {
304  const int n = d_ptr->screens.size();
305  for (int i = 0; i < n; ++i)
306  d_ptr->screens.at(i)->restore();
307 }
virtual void restore()
Restores the previously saved state of the graphics card.
QList< QScreen * > screens
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QMultiScreenPrivate * d_ptr

◆ resumeUpdates()

void QMultiScreen::resumeUpdates ( )
virtual
Warning
This function is not part of the public interface.

Reimplemented from QScreen.

Definition at line 369 of file qscreenmulti_qws.cpp.

370 {
371  const int n = d_ptr->screens.size();
372  for (int i = 0; i < n; ++i)
373  d_ptr->screens.at(i)->resumeUpdates();
374 }
virtual void resumeUpdates()
QList< QScreen * > screens
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QMultiScreenPrivate * d_ptr

◆ save()

void QMultiScreen::save ( )
virtual

Saves the current state of the graphics card.

For example, hardware screen drivers should reimplement the save() and restore() functions to save and restore its registers, enabling swintching between virtual consoles.

Note that the default implementation does nothing.

See also
restore()

Reimplemented from QScreen.

Definition at line 295 of file qscreenmulti_qws.cpp.

296 {
297  const int n = d_ptr->screens.size();
298  for (int i = 0; i < n; ++i)
299  d_ptr->screens.at(i)->save();
300 }
QList< QScreen * > screens
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
virtual void save()
Saves the current state of the graphics card.
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QMultiScreenPrivate * d_ptr

◆ setDirty()

void QMultiScreen::setDirty ( const QRect rectangle)
virtual

Marks the given rectangle as dirty.

Note that the default implementation does nothing; reimplement this function to indicate that the given rectangle has been altered.

Reimplemented from QScreen.

Definition at line 425 of file qscreenmulti_qws.cpp.

426 {
427  const int n = d_ptr->screens.size();
428  for (int i = 0; i < n; ++i) {
429  QScreen *screen = d_ptr->screens.at(i);
430  const QRegion r = screen->region() & rect;
431  if (r.isEmpty())
432  continue;
433  screen->setDirty(r.boundingRect());
434  }
435 }
QRect boundingRect() const
Returns the bounding rectangle of this region.
Definition: qregion.cpp:4363
virtual void setDirty(const QRect &)
Marks the given rectangle as dirty.
virtual QRegion region() const
Returns the region covered by this screen driver.
Definition: qscreen_qws.h:284
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
Definition: qregion.cpp:4098
QList< QScreen * > screens
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QRegion class specifies a clip region for a painter.
Definition: qregion.h:68
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QMultiScreenPrivate * d_ptr
The QScreen class is a base class for screen drivers in Qt for Embedded Linux.
Definition: qscreen_qws.h:191

◆ setMode()

void QMultiScreen::setMode ( int  width,
int  height,
int  depth 
)
virtual

Implement this function to reset the framebuffer's resolution (width and height) and bit depth.

After the resolution has been set, existing paint engines will be invalid and the framebuffer should be completely redrawn. In a multiple-process situation, all other applications must be notified to reset their mode and update themselves accordingly.

Implements QScreen.

Definition at line 285 of file qscreenmulti_qws.cpp.

286 {
287  return;
288 }

◆ sharedRamSize()

int QMultiScreen::sharedRamSize ( void *  )
virtual
Warning
This function is not part of the public interface.

Reimplemented from QScreen.

Definition at line 353 of file qscreenmulti_qws.cpp.

354 {
355  int total = 0;
356  const int n = d_ptr->screens.size();
357  for (int i = 0; i < n; ++i)
358  total += d_ptr->screens.at(i)->sharedRamSize(arg);
359  return total;
360 }
virtual int sharedRamSize(void *)
Definition: qscreen_qws.h:215
QList< QScreen * > screens
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QMultiScreenPrivate * d_ptr

◆ shutdownDevice()

void QMultiScreen::shutdownDevice ( )
virtual

This function is called by the Qt for Embedded Linux server before it calls the disconnect() function when exiting.

Note that the default implementation only hides the mouse cursor; reimplement this function to do the necessary graphics card specific cleanup.

See also
initDevice(), disconnect()

Reimplemented from QScreen.

Definition at line 278 of file qscreenmulti_qws.cpp.

279 {
280  const int n = d_ptr->screens.size();
281  for (int i = 0; i < n; ++i)
283 }
QList< QScreen * > screens
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QMultiScreenPrivate * d_ptr
virtual void shutdownDevice()
This function is called by the Qt for Embedded Linux server before it calls the disconnect() function...

◆ solidFill()

void QMultiScreen::solidFill ( const QColor color,
const QRegion region 
)
virtual

Fills the given region of the screen with the specified color.

This function is called from the exposeRegion() function; it is not intended to be called explicitly.

Reimplement this function to make use of Adding an Accelerated Graphics Driver to Qt for Embedded Linux{accelerated hardware}. Note that this function must be reimplemented if the framebuffer format is not supported by Qt for Embedded Linux (See the Qt for Embedded Linux Display Management{Display Management} documentation for more details).

See also
exposeRegion(), blit(), blank()

Reimplemented from QScreen.

Definition at line 388 of file qscreenmulti_qws.cpp.

389 {
390  const int n = d_ptr->screens.size();
391  for (int i = 0; i < n; ++i) {
392  QScreen *screen = d_ptr->screens.at(i);
393  const QRegion r = region & screen->region();
394  if (r.isEmpty())
395  continue;
396  screen->solidFill(color, r);
397  }
398 }
virtual QRegion region() const
Returns the region covered by this screen driver.
Definition: qscreen_qws.h:284
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
Definition: qregion.cpp:4098
QList< QScreen * > screens
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QRegion class specifies a clip region for a painter.
Definition: qregion.h:68
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QMultiScreenPrivate * d_ptr
The QScreen class is a base class for screen drivers in Qt for Embedded Linux.
Definition: qscreen_qws.h:191
virtual void solidFill(const QColor &color, const QRegion &region)
Fills the given region of the screen with the specified color.

◆ subScreens()

QList< QScreen * > QMultiScreen::subScreens ( ) const
virtual
Since
4.2

Returns a list of this screen's subscreens. Use the subScreenIndexAt() function to retrieve the index of a screen at a given position.

Note that if this screen consists of several subscreens, operations to this instance will affect all subscreens by default.

See also
instance(), subScreenIndexAt()

Reimplemented from QScreen.

Definition at line 462 of file qscreenmulti_qws.cpp.

463 {
464  return d_ptr->screens;
465 }
QList< QScreen * > screens
QMultiScreenPrivate * d_ptr

◆ supportsDepth()

bool QMultiScreen::supportsDepth ( int  depth) const
virtual

Returns true if the screen supports the specified color depth; otherwise returns false.

See also
clut()

Reimplemented from QScreen.

Definition at line 290 of file qscreenmulti_qws.cpp.

291 {
292  return false;
293 }

Properties

◆ d_ptr

QMultiScreenPrivate* QMultiScreen::d_ptr
private

The documentation for this class was generated from the following files: