Qt 4.8
fb_base.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the plugins of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #include "fb_base.h"
43 #include <qpainter.h>
44 #include <qdebug.h>
45 #include <qbitmap.h>
46 #include <QPlatformCursor>
47 #include <QWindowSystemInterface>
48 
50  : QPlatformCursor(scr), currentRect(QRect()), prevRect(QRect())
51 {
52  graphic = new QPlatformCursorImage(0, 0, 0, 0, 0, 0);
54 }
55 
57 {
58  QRect rect = graphic->image()->rect().translated(-graphic->hotspot().x(),
59  -graphic->hotspot().y());
60  rect.translate(QCursor::pos());
61  QPoint screenOffset = screen->geometry().topLeft();
62  rect.translate(-screenOffset); // global to local translation
63  return rect;
64 }
65 
66 
68 {
69  Q_UNUSED(e);
70  QPoint screenOffset = screen->geometry().topLeft();
72  // global to local translation
73  if (onScreen || screen->geometry().intersects(currentRect.translated(screenOffset))) {
74  setDirty();
75  }
76 }
77 
79 {
80  dirty = false;
81  if (currentRect.isNull())
82  return QRect();
83 
84  // We need this because the cursor might be dirty due to moving off screen
85  QPoint screenOffset = screen->geometry().topLeft();
86  // global to local translation
87  if (!currentRect.translated(screenOffset).intersects(screen->geometry()))
88  return QRect();
89 
91  painter.drawImage(prevRect, *graphic->image());
92  onScreen = true;
93  return prevRect;
94 }
95 
97 {
98  if (onScreen) {
99  onScreen = false;
100  return prevRect;
101  }
102  return QRect();
103 }
104 
106 {
107  graphic->set(shape);
108 }
109 
110 void QPlatformSoftwareCursor::setCursor(const QImage &image, int hotx, int hoty)
111 {
112  graphic->set(image, hotx, hoty);
113 }
114 
115 void QPlatformSoftwareCursor::setCursor(const uchar *data, const uchar *mask, int width, int height, int hotX, int hotY)
116 {
117  graphic->set(data, mask, width, height, hotX, hotY);
118 }
119 
121 {
122 #ifdef QT_NO_CURSOR
123  Q_UNUSED(widgetCursor);
124  Q_UNUSED(widget);
125 #else
126  Q_UNUSED(widget);
127  Qt::CursorShape shape = widgetCursor->shape();
128 
129  if (shape == Qt::BitmapCursor) {
130  // application supplied cursor
131  QPoint spot = widgetCursor->hotSpot();
132  setCursor(widgetCursor->pixmap().toImage(), spot.x(), spot.y());
133  } else {
134  // system cursor
135  setCursor(shape);
136  }
138  QPoint screenOffset = screen->geometry().topLeft(); // global to local translation
139  if (onScreen || screen->geometry().intersects(currentRect.translated(screenOffset)))
140  setDirty();
141 #endif
142 }
143 
144 QFbScreen::QFbScreen() : cursor(0), mGeometry(), mDepth(16), mFormat(QImage::Format_RGB16), mScreenImage(0), compositePainter(0), isUpToDate(false)
145 {
149  QObject::connect(&redrawTimer, SIGNAL(timeout()), this, SLOT(doRedraw()));
150 }
151 
153 {
154  delete mScreenImage;
155  mGeometry = rect;
157  delete compositePainter;
158  compositePainter = 0;
160 }
161 
163 {
164  mDepth = depth;
165 }
166 
168 {
169  mPhysicalSize = size;
170 }
171 
173 {
174  mFormat = format;
175  delete mScreenImage;
177  delete compositePainter;
178  compositePainter = 0;
179 }
180 
182 {
183  delete compositePainter;
184  delete mScreenImage;
185 }
186 
187 void QFbScreen::setDirty(const QRect &rect)
188 {
189  QRect intersection = rect.intersected(mGeometry);
190  QPoint screenOffset = mGeometry.topLeft();
191  repaintRegion += intersection.translated(-screenOffset); // global to local translation
192  if (!redrawTimer.isActive()) {
193  redrawTimer.start();
194  }
195 }
196 
198 {
199  cachedRects.clear();
200  QPoint screenOffset = mGeometry.topLeft();
201  QRegion remainingScreen(mGeometry.translated(-screenOffset)); // global to local translation
202 
203  for (int i = 0; i < windowStack.length(); i++) {
204  if (remainingScreen.isEmpty())
205  break;
206  if (!windowStack[i]->visible())
207  continue;
208  if (windowStack[i]->widget()->isMinimized())
209  continue;
210 
212  QRect localGeometry = windowStack.at(i)->geometry().translated(-screenOffset); // global to local translation
213  remainingScreen -= localGeometry;
214  QRegion windowRegion(localGeometry);
215  windowRegion -= remainingScreen;
216  foreach(QRect rect, windowRegion.rects()) {
217  cachedRects += QPair<QRect, int>(rect, i);
218  }
219  }
220  }
221  foreach (QRect rect, remainingScreen.rects())
222  cachedRects += QPair<QRect, int>(rect, -1);
223  isUpToDate = true;
224  return;
225 }
226 
227 
228 
230 {
231  QPoint screenOffset = mGeometry.topLeft();
232 
233  QRegion touchedRegion;
234  if (cursor && cursor->isDirty() && cursor->isOnScreen()) {
235  QRect lastCursor = cursor->dirtyRect();
236  repaintRegion += lastCursor;
237  }
238  if (repaintRegion.isEmpty() && (!cursor || !cursor->isDirty())) {
239  return touchedRegion;
240  }
241 
243 
244  if (!isUpToDate)
245  generateRects();
246 
247  if (!compositePainter)
249  for (int rectIndex = 0; rectIndex < repaintRegion.numRects(); rectIndex++) {
250  QRegion rectRegion = rects[rectIndex];
251 
252  for(int i = 0; i < cachedRects.length(); i++) {
253  QRect screenSubRect = cachedRects[i].first;
254  int layer = cachedRects[i].second;
255  QRegion intersect = rectRegion.intersected(screenSubRect);
256 
257  if (intersect.isEmpty())
258  continue;
259 
260  rectRegion -= intersect;
261 
262  // we only expect one rectangle, but defensive coding...
263  foreach (QRect rect, intersect.rects()) {
264  bool firstLayer = true;
265  if (layer == -1) {
267  firstLayer = false;
268  layer = windowStack.size() - 1;
269  }
270 
271  for (int layerIndex = layer; layerIndex != -1; layerIndex--) {
272  if (!windowStack[layerIndex]->visible())
273  continue;
274  if (windowStack[layerIndex]->widget()->isMinimized())
275  continue;
276  QRect windowRect = windowStack[layerIndex]->geometry().translated(-screenOffset);
277  QRect windowIntersect = rect.translated(-windowRect.left(),
278  -windowRect.top());
279  compositePainter->drawImage(rect, windowStack[layerIndex]->surface->image(),
280  windowIntersect);
281  if (firstLayer) {
282  firstLayer = false;
283  }
284  }
285  }
286  }
287  }
288 
289  QRect cursorRect;
291  cursorRect = cursor->drawCursor(*compositePainter);
292  touchedRegion += cursorRect;
293  }
294  touchedRegion += repaintRegion;
296 
297 
298 
299 // qDebug() << "QFbScreen::doRedraw" << windowStack.size() << mScreenImage->size() << touchedRegion;
300 
301 
302  return touchedRegion;
303 }
304 
306 {
307  windowStack.prepend(surface);
308  surface->mScreens.append(this);
310  setDirty(surface->geometry());
311 }
312 
314 {
315  windowStack.removeOne(surface);
316  surface->mScreens.removeOne(this);
318  setDirty(surface->geometry());
319 }
320 
322 {
323  QList<QFbScreen *>::const_iterator i = mScreens.constBegin();
324  QList<QFbScreen *>::const_iterator end = mScreens.constEnd();
325  while (i != end) {
326  (*i)->raise(this);
327  ++i;
328  }
329 }
330 
332 {
333  QFbWindow *s = static_cast<QFbWindow *>(surface);
334  int index = windowStack.indexOf(s);
335  if (index <= 0)
336  return;
337  windowStack.move(index, 0);
339  setDirty(s->geometry());
340 }
341 
343 {
344  QList<QFbScreen *>::const_iterator i = mScreens.constBegin();
345  QList<QFbScreen *>::const_iterator end = mScreens.constEnd();
346  while (i != end) {
347  (*i)->lower(this);
348  ++i;
349  }
350 }
351 
353 {
354  QFbWindow *s = static_cast<QFbWindow *>(surface);
355  int index = windowStack.indexOf(s);
356  if (index == -1 || index == (windowStack.size() - 1))
357  return;
358  windowStack.move(index, windowStack.size() - 1);
360  setDirty(s->geometry());
361 }
362 
364 {
365  for(int i = 0; i < windowStack.size(); i++) {
366  if (windowStack[i]->geometry().contains(p, false) &&
367  windowStack[i]->visible() &&
368  !windowStack[i]->widget()->isMinimized()) {
369  return windowStack[i]->widget();
370  }
371  }
372  return 0;
373 }
374 
376  :QPlatformWindow(window),
377  visibleFlag(false)
378 {
379  static QAtomicInt winIdGenerator(1);
380  windowId = winIdGenerator.fetchAndAddRelaxed(1);
381 }
382 
383 
385 {
388  while (i != end) {
389  (*i)->removeWindow(this);
390  ++i;
391  }
392 }
393 
394 
396  : QWindowSurface(window),
397  mScreen(screen)
398 {
399  mImage = QImage(window->size(), mScreen->format());
400 
401  platformWindow = static_cast<QFbWindow*>(window->platformWindow());
402  platformWindow->surface = this;
403 }
404 
406 {
407 }
408 
410 {
411  Q_UNUSED(widget);
412  Q_UNUSED(offset);
413 
414 
415 // qDebug() << "QFbWindowSurface::flush" << region;
416 
417 
418  platformWindow->repaint(region);
419 }
420 
421 
422 void QFbWindow::repaint(const QRegion &region)
423 {
424  QRect currentGeometry = geometry();
425 
426  QRect dirtyClient = region.boundingRect();
427  QRect dirtyRegion(currentGeometry.left() + dirtyClient.left(),
428  currentGeometry.top() + dirtyClient.top(),
429  dirtyClient.width(),
430  dirtyClient.height());
431  QList<QFbScreen *>::const_iterator i = mScreens.constBegin();
432  QList<QFbScreen *>::const_iterator end = mScreens.constEnd();
433  QRect oldGeometryLocal = oldGeometry;
434  oldGeometry = currentGeometry;
435  while (i != end) {
436  // If this is a move, redraw the previous location
437  if (oldGeometryLocal != currentGeometry) {
438  (*i)->setDirty(oldGeometryLocal);
439  }
440  (*i)->setDirty(dirtyRegion);
441  ++i;
442  }
443 }
444 
446 {
447  // change the widget's QImage if this is a resize
448  if (mImage.size() != size)
449  mImage = QImage(size, mScreen->format());
450  QWindowSurface::resize(size);
451 }
452 
454 {
455 // store previous geometry for screen update
456  oldGeometry = geometry();
457 
458 
459  QList<QFbScreen *>::const_iterator i = mScreens.constBegin();
460  QList<QFbScreen *>::const_iterator end = mScreens.constEnd();
461  while (i != end) {
462  (*i)->invalidateRectCache();
463  ++i;
464  }
465 //### QWindowSystemInterface::handleGeometryChange(window(), rect);
466 
468 }
469 
470 bool QFbWindowSurface::scroll(const QRegion &area, int dx, int dy)
471 {
472  return QWindowSurface::scroll(area, dx, dy);
473 }
474 
476 {
477  Q_UNUSED(region);
478 }
479 
481 {
482  Q_UNUSED(region);
483 }
484 
485 void QFbWindow::setVisible(bool visible)
486 {
487  visibleFlag = visible;
488  QList<QFbScreen *>::const_iterator i = mScreens.constBegin();
489  QList<QFbScreen *>::const_iterator end = mScreens.constEnd();
490  while (i != end) {
491  (*i)->invalidateRectCache();
492  (*i)->setDirty(geometry());
493  ++i;
494  }
495 }
496 
497 Qt::WindowFlags QFbWindow::setWindowFlags(Qt::WindowFlags type)
498 {
499  flags = type;
500  QList<QFbScreen *>::const_iterator i = mScreens.constBegin();
501  QList<QFbScreen *>::const_iterator end = mScreens.constEnd();
502  while (i != end) {
503  (*i)->invalidateRectCache();
504  ++i;
505  }
506  return flags;
507 }
508 
509 Qt::WindowFlags QFbWindow::windowFlags() const
510 {
511  return flags;
512 }
virtual void setDirty(const QRect &rect)
Definition: fb_base.cpp:187
The QPainter class performs low-level painting on widgets and other paint devices.
Definition: qpainter.h:86
void setSingleShot(bool singleShot)
Definition: qtimer.h:108
QImage * mScreenImage
Definition: fb_base.h:197
virtual void pointerEvent(const QMouseEvent &event)
This method is called by Qt whenever a QMouseEvent is generated by the underlying pointer input...
Definition: fb_base.cpp:67
QRect geometry() const
Returns the currently allocated area on the screen.
QImage toImage() const
Converts the pixmap to a QImage.
Definition: qpixmap.cpp:542
QT_DEPRECATED int numRects() const
Returns the number of rectangles that will be returned in rects().
Definition: qregion.cpp:4456
Format
The following image formats are available in Qt.
Definition: qimage.h:91
virtual bool isDirty()
Definition: fb_base.h:74
QFbWindowSurface(QFbScreen *screen, QWidget *window)
Definition: fb_base.cpp:395
QRegion intersected(const QRegion &r) const
Returns a region which is the intersection of this region and r.
Definition: qregion.h:112
bool isNull() const
Returns true if the rectangle is a null rectangle, otherwise returns false.
Definition: qrect.h:231
int type
Definition: qmetatype.cpp:239
The QCursor class provides a mouse cursor with an arbitrary shape.
Definition: qcursor.h:89
virtual QRegion doRedraw()
Definition: fb_base.cpp:229
QPointer< QWidget > widget
QTimer redrawTimer
Definition: fb_base.h:187
QFbScreen * mScreen
Definition: fb_base.h:115
The QPlatformScreen class provides an abstraction for visual displays.
bool isUpToDate
Definition: fb_base.h:207
virtual void lower(QPlatformWindow *surface)
Definition: fb_base.cpp:352
The QAtomicInt class provides platform-independent atomic operations on integers. ...
Definition: qatomic.h:55
void resize(const QSize &size)
Definition: fb_base.cpp:445
QRect rect(const QWidget *widget) const
Returns the rectangle for widget in the coordinates of this window surface.
virtual bool scroll(const QRegion &area, int dx, int dy)
Scrolls the given area dx pixels to the right and dy downward; both dx and dy may be negative...
Definition: fb_base.cpp:470
virtual void setGeometry(const QRect &rect)
This function is called by Qt whenever a window is moved or the window is resized.
virtual void flush(QWidget *widget, const QRegion &region, const QPoint &offset)
Flushes the given region from the specified widget onto the screen.
Definition: fb_base.cpp:409
QImage::Format mFormat
Definition: fb_base.h:195
virtual QRect geometry() const
Returnes the current geometry of a window.
The QPlatformCursor class provides information about pointer device events (movement, buttons), and requests to change the currently displayed cursor.
#define SLOT(a)
Definition: qobjectdefs.h:226
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
virtual QRect lastPainted()
Definition: fb_base.h:76
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
Definition: qlist.h:269
int left() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:240
QPlatformSoftwareCursor(QPlatformScreen *scr)
Definition: fb_base.cpp:49
QRect translated(int dx, int dy) const
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis...
Definition: qrect.h:328
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
The QList::const_iterator class provides an STL-style const iterator for QList and QQueue...
Definition: qlist.h:228
virtual void setFormat(QImage::Format format)
Definition: fb_base.cpp:172
virtual QPoint offset(const QWidget *widget) const
Returns the offset of widget in the coordinates of this window surface.
QRect intersected(const QRect &other) const
Returns the intersection of this rectangle and the given rectangle.
Definition: qrect.h:481
QRect boundingRect() const
Returns the bounding rectangle of this region.
Definition: qregion.cpp:4363
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
virtual void repaint(const QRegion &)
Definition: fb_base.cpp:422
QRect rect() const
Returns the enclosing rectangle (0, 0, width(), height()) of the image.
Definition: qimage.cpp:1603
virtual QRect drawCursor(QPainter &painter)
Definition: fb_base.cpp:78
QPainter * compositePainter
Definition: fb_base.h:200
The QPlatformWindow class provides an abstraction for top-level windows.
virtual bool isOnScreen()
Definition: fb_base.h:75
~QFbScreen()
Definition: fb_base.cpp:181
void setCursor(const uchar *data, const uchar *mask, int width, int height, int hotX, int hotY)
Definition: fb_base.cpp:115
void move(int from, int to)
Moves the item at index position from to index position to.
Definition: qlist.h:628
bool removeOne(const T &t)
Removes the first occurrence of value in the list and returns true on success; otherwise returns fals...
Definition: qlist.h:796
#define SIGNAL(a)
Definition: qobjectdefs.h:227
unsigned char uchar
Definition: qglobal.h:994
NSWindow * window
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
virtual void raise()
Reimplement to be able to let Qt rais windows to the top of the desktop.
Definition: fb_base.cpp:321
virtual int depth() const
Reimplement in subclass to return current depth of the screen.
Definition: fb_base.h:163
virtual void addWindow(QFbWindow *surface)
Definition: fb_base.cpp:305
QList< QPair< QRect, int > > cachedRects
Definition: fb_base.h:202
QImage mImage
Definition: fb_base.h:116
virtual void changeCursor(QCursor *widgetCursor, QWidget *widget)
This method is called by Qt whenever the cursor graphic should be changed.
Definition: fb_base.cpp:120
void invalidateRectCache()
Definition: fb_base.h:204
bool testAttribute(Qt::WidgetAttribute) const
Returns true if attribute attribute is set on this widget; otherwise returns false.
Definition: qwidget.h:1041
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
Definition: qobject.cpp:2580
QFbWindow * platformWindow
Definition: fb_base.h:113
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
Definition: qregion.cpp:4098
void prepend(const T &t)
Inserts value at the beginning of the list.
Definition: qlist.h:541
QSize size() const
Returns the size of the rectangle.
Definition: qrect.h:309
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
virtual void setVisible(bool visible)
Reimplemented in subclasses to show the surface if visible is true, and hide it if visible is false...
Definition: fb_base.cpp:485
QPixmap pixmap() const
Returns the cursor pixmap.
Definition: qcursor.cpp:528
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
static const char * data(const QByteArray &arr)
bool isActive() const
Returns true if the timer is running (pending); otherwise returns false.
Definition: qtimer.h:69
The QRegion class specifies a clip region for a painter.
Definition: qregion.h:68
QSize size
the size of the widget excluding any window frame
Definition: qwidget.h:165
virtual void beginPaint(const QRegion &region)
This function is called before painting onto the surface begins, with the region in which the paintin...
Definition: fb_base.cpp:475
virtual Qt::WindowFlags setWindowFlags(Qt::WindowFlags type)
Requests setting the window flags of this surface to type.
Definition: fb_base.cpp:497
void clear()
Removes all items from the list.
Definition: qlist.h:764
QImage * image()
Return the cursor graphic as a pointer to a QImage.
virtual QRect geometry() const =0
Reimplement in subclass to return the pixel geometry of the screen.
QRect mGeometry
Definition: fb_base.h:193
bool contains(const QPoint &p, bool proper=false) const
Returns true if the given point is inside or on the edge of the rectangle, otherwise returns false...
Definition: qrect.cpp:1101
int mDepth
Definition: fb_base.h:194
The QWindowSurface class provides the drawing area for top-level windows.
void setInterval(int msec)
Definition: qtimer.cpp:419
WId windowId
Definition: fb_base.h:152
QSize size() const
Returns the size of the image, i.
Definition: qimage.cpp:1587
QPlatformSoftwareCursor * cursor
Definition: fb_base.h:186
The QMouseEvent class contains parameters that describe a mouse event.
Definition: qevent.h:85
int fetchAndAddRelaxed(int valueToAdd)
Atomic fetch-and-add.
QPoint hotSpot() const
Returns the cursor hot spot, or (0, 0) if it is one of the standard cursors.
Definition: qcursor.cpp:540
T & first()
Returns a reference to the first item in the list.
Definition: qlist.h:282
int top() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:243
virtual void removeWindow(QFbWindow *surface)
Definition: fb_base.cpp:313
int indexOf(const T &t, int from=0) const
Returns the index position of the first occurrence of value in the list, searching forward from index...
Definition: qlist.h:847
void setGeometry(const QRect &rect)
This function is called by Qt whenever a window is moved or the window is resized.
Definition: fb_base.cpp:453
QPoint hotspot()
Return the cursor&#39;s hotspot.
The QPlatformCursorImage class provides a set of graphics intended to be used as cursors.
virtual QImage::Format format() const
Reimplement in subclass to return the image format which corresponds to the screen format...
Definition: fb_base.h:164
CursorShape
Definition: qnamespace.h:1262
void generateRects()
Definition: fb_base.cpp:197
int length() const
This function is identical to count().
Definition: qlist.h:281
virtual void setPhysicalSize(QSize size)
Definition: fb_base.cpp:167
void set(const uchar *data, const uchar *mask, int width, int height, int hotX, int hotY)
Sets the cursor image to the graphic represented by the combination of data and mask, with dimensions given by width and height and a hotspot at the point specified by (hx, hy).
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
QVector< QRect > rects() const
Returns an array of non-overlapping rectangles that make up the region.
Definition: qregion.cpp:4412
~QFbWindow()
Definition: fb_base.cpp:384
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QSize mPhysicalSize
Definition: fb_base.h:196
virtual void endPaint(const QRegion &region)
This function is called after painting onto the surface has ended, with the region in which the paint...
Definition: fb_base.cpp:480
QPlatformScreen * screen
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
virtual void raise(QPlatformWindow *surface)
Definition: fb_base.cpp:331
int y() const
Returns the y coordinate of this point.
Definition: qpoint.h:131
virtual void setDepth(int depth)
Definition: fb_base.cpp:162
void drawImage(const QRectF &targetRect, const QImage &image, const QRectF &sourceRect, Qt::ImageConversionFlags flags=Qt::AutoColor)
Definition: qpainter.cpp:5936
quint16 index
bool isMinimized() const
Definition: qwidget.cpp:3027
bool intersects(const QRegion &r) const
Returns true if this region intersects with region, otherwise returns false.
Definition: qregion.cpp:766
QList< QFbScreen * > mScreens
Definition: fb_base.h:147
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
virtual void lower()
Reimplement to be able to let Qt lower windows to the bottom of the desktop.
Definition: fb_base.cpp:342
bool intersects(const QRect &r) const
Returns true if this rectangle intersects with the given rectangle (i.
Definition: qrect.cpp:1429
int x() const
Returns the x coordinate of this point.
Definition: qpoint.h:128
virtual QRect geometry() const
Reimplement in subclass to return the pixel geometry of the screen.
Definition: fb_base.h:162
QList< QFbWindow * > windowStack
Definition: fb_base.h:184
QRegion repaintRegion
Definition: fb_base.h:185
QPlatformCursorImage * graphic
Definition: fb_base.h:79
void translate(int dx, int dy)
Moves the rectangle dx along the x axis and dy along the y axis, relative to the current position...
Definition: qrect.h:312
static const KeyPair *const end
void start(int msec)
Starts or restarts the timer with a timeout interval of msec milliseconds.
Definition: qtimer.cpp:249
virtual void setDirty()
Definition: fb_base.h:73
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
QFbWindow(QWidget *window)
Definition: fb_base.cpp:375
virtual bool scroll(const QRegion &area, int dx, int dy)
Scrolls the given area dx pixels to the right and dy downward; both dx and dy may be negative...
virtual void setGeometry(QRect rect)
Definition: fb_base.cpp:152
void fillRect(const QRectF &, const QBrush &)
Fills the given rectangle with the brush specified.
Definition: qpainter.cpp:7420
static QPoint pos()
Returns the position of the cursor (hot spot) in global screen coordinates.
Definition: qcursor_mac.mm:310
static int area(const QSize &s)
Definition: qicon.cpp:155
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
Definition: qlist.h:272
Qt::CursorShape shape() const
Returns the cursor shape identifier.
Definition: qcursor.cpp:469
QPoint topLeft() const
Returns the position of the rectangle&#39;s top-left corner.
Definition: qrect.h:288
virtual Qt::WindowFlags windowFlags() const
Returns the effective window flags for this surface.
Definition: fb_base.cpp:509
virtual QWidget * topLevelAt(const QPoint &p) const
Return the given top level widget for a given position.
Definition: fb_base.cpp:363