Qt 4.8
Public Functions | Protected Slots | Protected Variables | Private Functions | Properties | Friends | List of all members
QFbScreen Class Reference

#include <fb_base.h>

Inheritance diagram for QFbScreen:
QPlatformScreen QObject QLinuxFbScreen QVNCScreen

Public Functions

virtual void addWindow (QFbWindow *surface)
 
virtual int depth () const
 Reimplement in subclass to return current depth of the screen. More...
 
virtual QImage::Format format () const
 Reimplement in subclass to return the image format which corresponds to the screen format. More...
 
virtual QRect geometry () const
 Reimplement in subclass to return the pixel geometry of the screen. More...
 
QImageimage () const
 
virtual void lower (QPlatformWindow *surface)
 
QPaintDevicepaintDevice () const
 
virtual QSize physicalSize () const
 Reimplement this function in subclass to return the physical size of the screen. More...
 
 QFbScreen ()
 
virtual void raise (QPlatformWindow *surface)
 
virtual void removeWindow (QFbWindow *surface)
 
virtual void setDepth (int depth)
 
virtual void setDirty (const QRect &rect)
 
virtual void setFormat (QImage::Format format)
 
virtual void setGeometry (QRect rect)
 
virtual void setPhysicalSize (QSize size)
 
virtual QWidgettopLevelAt (const QPoint &p) const
 Return the given top level widget for a given position. More...
 
 ~QFbScreen ()
 
- Public Functions inherited from QPlatformScreen
virtual QRect availableGeometry () const
 Reimplement in subclass to return the pixel geometry of the available space This normally is the desktop screen minus the task manager, global menubar etc. More...
 
virtual ~QPlatformScreen ()
 
- Public Functions inherited from QObject
bool blockSignals (bool b)
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). More...
 
const QObjectListchildren () const
 Returns a list of child objects. More...
 
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
 
bool disconnect (const QObject *receiver, const char *member=0)
 
void dumpObjectInfo ()
 Dumps information about signal connections, etc. More...
 
void dumpObjectTree ()
 Dumps a tree of children to the debug output. More...
 
QList< QByteArraydynamicPropertyNames () const
 Returns the names of all properties that were dynamically added to the object using setProperty(). More...
 
virtual bool event (QEvent *)
 This virtual function receives events to an object and should return true if the event e was recognized and processed. More...
 
virtual bool eventFilter (QObject *, QEvent *)
 Filters events if this object has been installed as an event filter for the watched object. More...
 
template<typename T >
findChild (const QString &aName=QString()) const
 Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. More...
 
template<typename T >
QList< T > findChildren (const QString &aName=QString()) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. More...
 
template<typename T >
QList< T > findChildren (const QRegExp &re) const
 
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false. More...
 
void installEventFilter (QObject *)
 Installs an event filter filterObj on this object. More...
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false. More...
 
void killTimer (int id)
 Kills the timer with timer identifier, id. More...
 
virtual const QMetaObjectmetaObject () const
 Returns a pointer to the meta-object of this object. More...
 
void moveToThread (QThread *thread)
 Changes the thread affinity for this object and its children. More...
 
QString objectName () const
 
QObjectparent () const
 Returns a pointer to the parent object. More...
 
QVariant property (const char *name) const
 Returns the value of the object's name property. More...
 
Q_INVOKABLE QObject (QObject *parent=0)
 Constructs an object with parent object parent. More...
 
void removeEventFilter (QObject *)
 Removes an event filter object obj from this object. More...
 
void setObjectName (const QString &name)
 
void setParent (QObject *)
 Makes the object a child of parent. More...
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value. More...
 
void setUserData (uint id, QObjectUserData *data)
 
bool signalsBlocked () const
 Returns true if signals are blocked; otherwise returns false. More...
 
int startTimer (int interval)
 Starts a timer and returns a timer identifier, or returns zero if it could not start a timer. More...
 
QThreadthread () const
 Returns the thread in which the object lives. More...
 
QObjectUserDatauserData (uint id) const
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects. More...
 

Protected Slots

virtual QRegion doRedraw ()
 

Protected Variables

QPlatformSoftwareCursorcursor
 
int mDepth
 
QImage::Format mFormat
 
QRect mGeometry
 
QSize mPhysicalSize
 
QImagemScreenImage
 
QTimer redrawTimer
 
QRegion repaintRegion
 
QList< QFbWindow * > windowStack
 
- Protected Variables inherited from QObject
QScopedPointer< QObjectDatad_ptr
 

Private Functions

void generateRects ()
 
void invalidateRectCache ()
 

Properties

QList< QPair< QRect, int > > cachedRects
 
QPaintercompositePainter
 
bool isUpToDate
 

Friends

class QFbWindow
 
class QFbWindowSurface
 

Additional Inherited Members

- Public Slots inherited from QObject
void deleteLater ()
 Schedules this object for deletion. More...
 
- Signals inherited from QObject
void destroyed (QObject *=0)
 This signal is emitted immediately before the object obj is destroyed, and can not be blocked. More...
 
- Static Public Functions inherited from QPlatformScreen
static QPlatformScreenplatformScreenForWidget (const QWidget *widget)
 
- Static Public Functions inherited from QObject
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 receiver object. More...
 
static bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 Disconnects signal in object sender from method in object receiver. More...
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static uint registerUserData ()
 
static QString tr (const char *sourceText, const char *comment=0, int n=-1)
 
static QString trUtf8 (const char *sourceText, const char *comment=0, int n=-1)
 
- Static Public Variables inherited from QObject
static const QMetaObject staticMetaObject
 This variable stores the meta-object for the class. More...
 
- Protected Functions inherited from QObject
virtual void childEvent (QChildEvent *)
 This event handler can be reimplemented in a subclass to receive child events. More...
 
virtual void connectNotify (const char *signal)
 This virtual function is called when something has been connected to signal in this object. More...
 
virtual void customEvent (QEvent *)
 This event handler can be reimplemented in a subclass to receive custom events. More...
 
virtual void disconnectNotify (const char *signal)
 This virtual function is called when something has been disconnected from signal in this object. More...
 
 QObject (QObjectPrivate &dd, QObject *parent=0)
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal. More...
 
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. More...
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *)
 This event handler can be reimplemented in a subclass to receive timer events for the object. More...
 
- Static Protected Variables inherited from QObject
static const QMetaObject staticQtMetaObject
 

Detailed Description

Definition at line 155 of file fb_base.h.

Constructors and Destructors

◆ QFbScreen()

QFbScreen::QFbScreen ( )

Definition at line 144 of file fb_base.cpp.

145 {
149  QObject::connect(&redrawTimer, SIGNAL(timeout()), this, SLOT(doRedraw()));
150 }
void setSingleShot(bool singleShot)
Definition: qtimer.h:108
QImage * mScreenImage
Definition: fb_base.h:197
virtual QRegion doRedraw()
Definition: fb_base.cpp:229
QTimer redrawTimer
Definition: fb_base.h:187
bool isUpToDate
Definition: fb_base.h:207
QImage::Format mFormat
Definition: fb_base.h:195
#define SLOT(a)
Definition: qobjectdefs.h:226
QPainter * compositePainter
Definition: fb_base.h:200
#define SIGNAL(a)
Definition: qobjectdefs.h:227
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
QSize size() const
Returns the size of the rectangle.
Definition: qrect.h:309
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
QRect mGeometry
Definition: fb_base.h:193
int mDepth
Definition: fb_base.h:194
void setInterval(int msec)
Definition: qtimer.cpp:419
QPlatformSoftwareCursor * cursor
Definition: fb_base.h:186

◆ ~QFbScreen()

QFbScreen::~QFbScreen ( )

Definition at line 181 of file fb_base.cpp.

182 {
183  delete compositePainter;
184  delete mScreenImage;
185 }
QImage * mScreenImage
Definition: fb_base.h:197
QPainter * compositePainter
Definition: fb_base.h:200

Functions

◆ addWindow()

void QFbScreen::addWindow ( QFbWindow surface)
virtual

Definition at line 305 of file fb_base.cpp.

Referenced by QLinuxFbIntegration::createPlatformWindow(), QVNCIntegration::createPlatformWindow(), and QVNCIntegration::moveToScreen().

306 {
307  windowStack.prepend(surface);
308  surface->mScreens.append(this);
310  setDirty(surface->geometry());
311 }
virtual void setDirty(const QRect &rect)
Definition: fb_base.cpp:187
virtual QRect geometry() const
Returnes the current geometry of a window.
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
void invalidateRectCache()
Definition: fb_base.h:204
void prepend(const T &t)
Inserts value at the beginning of the list.
Definition: qlist.h:541
QList< QFbScreen * > mScreens
Definition: fb_base.h:147
QList< QFbWindow * > windowStack
Definition: fb_base.h:184

◆ depth()

virtual int QFbScreen::depth ( ) const
inlinevirtual

◆ doRedraw

QRegion QFbScreen::doRedraw ( )
protectedvirtualslot

Reimplemented in QVNCScreen.

Definition at line 229 of file fb_base.cpp.

Referenced by QLinuxFbScreen::doRedraw(), QVNCScreen::doRedraw(), and QFbScreen().

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 }
The QPainter class performs low-level painting on widgets and other paint devices.
Definition: qpainter.h:86
QImage * mScreenImage
Definition: fb_base.h:197
QT_DEPRECATED int numRects() const
Returns the number of rectangles that will be returned in rects().
Definition: qregion.cpp:4456
virtual bool isDirty()
Definition: fb_base.h:74
QRegion intersected(const QRegion &r) const
Returns a region which is the intersection of this region and r.
Definition: qregion.h:112
QPointer< QWidget > widget
bool isUpToDate
Definition: fb_base.h:207
virtual QRect lastPainted()
Definition: fb_base.h:76
int left() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:240
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
virtual QRect drawCursor(QPainter &painter)
Definition: fb_base.cpp:78
QPainter * compositePainter
Definition: fb_base.h:200
virtual bool isOnScreen()
Definition: fb_base.h:75
QList< QPair< QRect, int > > cachedRects
Definition: fb_base.h:202
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
Definition: qregion.cpp:4098
The QRegion class specifies a clip region for a painter.
Definition: qregion.h:68
QRect mGeometry
Definition: fb_base.h:193
QPlatformSoftwareCursor * cursor
Definition: fb_base.h:186
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
void generateRects()
Definition: fb_base.cpp:197
int length() const
This function is identical to count().
Definition: qlist.h:281
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
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
void drawImage(const QRectF &targetRect, const QImage &image, const QRectF &sourceRect, Qt::ImageConversionFlags flags=Qt::AutoColor)
Definition: qpainter.cpp:5936
bool intersects(const QRegion &r) const
Returns true if this region intersects with region, otherwise returns false.
Definition: qregion.cpp:766
QList< QFbWindow * > windowStack
Definition: fb_base.h:184
QRegion repaintRegion
Definition: fb_base.h:185
void fillRect(const QRectF &, const QBrush &)
Fills the given rectangle with the brush specified.
Definition: qpainter.cpp:7420
QPoint topLeft() const
Returns the position of the rectangle&#39;s top-left corner.
Definition: qrect.h:288

◆ format()

virtual QImage::Format QFbScreen::format ( ) const
inlinevirtual

Reimplement in subclass to return the image format which corresponds to the screen format.

Implements QPlatformScreen.

Definition at line 164 of file fb_base.h.

Referenced by QFbWindowSurface::QFbWindowSurface(), QFbWindowSurface::resize(), QLinuxFbScreen::setFormat(), and setFormat().

164 { return mFormat; }
QImage::Format mFormat
Definition: fb_base.h:195

◆ generateRects()

void QFbScreen::generateRects ( )
private

Definition at line 197 of file fb_base.cpp.

Referenced by doRedraw().

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 }
QPointer< QWidget > widget
bool isUpToDate
Definition: fb_base.h:207
virtual QRect geometry() const
Returnes the current geometry of a window.
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
QList< QPair< QRect, int > > cachedRects
Definition: fb_base.h:202
bool testAttribute(Qt::WidgetAttribute) const
Returns true if attribute attribute is set on this widget; otherwise returns false.
Definition: qwidget.h:1041
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
void clear()
Removes all items from the list.
Definition: qlist.h:764
QRect mGeometry
Definition: fb_base.h:193
int length() const
This function is identical to count().
Definition: qlist.h:281
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
bool isMinimized() const
Definition: qwidget.cpp:3027
QList< QFbWindow * > windowStack
Definition: fb_base.h:184
QPoint topLeft() const
Returns the position of the rectangle&#39;s top-left corner.
Definition: qrect.h:288

◆ geometry()

virtual QRect QFbScreen::geometry ( ) const
inlinevirtual

Reimplement in subclass to return the pixel geometry of the screen.

Implements QPlatformScreen.

Definition at line 162 of file fb_base.h.

Referenced by buttonChange(), QVNCDirtyMap::QVNCDirtyMap(), QVNCScreen::QVNCScreen(), and topLevelAt().

162 { return mGeometry; }
QRect mGeometry
Definition: fb_base.h:193

◆ image()

QImage* QFbScreen::image ( ) const
inline

Definition at line 180 of file fb_base.h.

Referenced by QVNCScreen::base(), QVNCIntegration::grabWindow(), and QVNCScreen::linestep().

180 { return mScreenImage; }
QImage * mScreenImage
Definition: fb_base.h:197

◆ invalidateRectCache()

void QFbScreen::invalidateRectCache ( )
inlineprivate

Definition at line 204 of file fb_base.h.

Referenced by addWindow(), lower(), raise(), removeWindow(), and setGeometry().

204 { isUpToDate = false; }
bool isUpToDate
Definition: fb_base.h:207

◆ lower()

void QFbScreen::lower ( QPlatformWindow surface)
virtual

Definition at line 352 of file fb_base.cpp.

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 }
virtual void setDirty(const QRect &rect)
Definition: fb_base.cpp:187
virtual QRect geometry() const
Returnes the current geometry of a window.
void move(int from, int to)
Moves the item at index position from to index position to.
Definition: qlist.h:628
void invalidateRectCache()
Definition: fb_base.h:204
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
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
quint16 index
QList< QFbWindow * > windowStack
Definition: fb_base.h:184

◆ paintDevice()

QPaintDevice* QFbScreen::paintDevice ( ) const
inline

Definition at line 181 of file fb_base.h.

181 { return mScreenImage; }
QImage * mScreenImage
Definition: fb_base.h:197

◆ physicalSize()

virtual QSize QFbScreen::physicalSize ( ) const
inlinevirtual

Reimplement this function in subclass to return the physical size of the screen.

This function is used by QFont to convert point sizes to pixel sizes.

The default implementation takes the pixel size of the screen, considers a resolution of 100 dots per inch, and returns the calculated physical size. A device with a screen that has different resolutions will need to be supported by a suitable reimplementation of this function.

Reimplemented from QPlatformScreen.

Definition at line 165 of file fb_base.h.

165 { return mPhysicalSize; }
QSize mPhysicalSize
Definition: fb_base.h:196

◆ raise()

void QFbScreen::raise ( QPlatformWindow surface)
virtual

Definition at line 331 of file fb_base.cpp.

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 }
virtual void setDirty(const QRect &rect)
Definition: fb_base.cpp:187
virtual QRect geometry() const
Returnes the current geometry of a window.
void move(int from, int to)
Moves the item at index position from to index position to.
Definition: qlist.h:628
void invalidateRectCache()
Definition: fb_base.h:204
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
quint16 index
QList< QFbWindow * > windowStack
Definition: fb_base.h:184

◆ removeWindow()

void QFbScreen::removeWindow ( QFbWindow surface)
virtual

Definition at line 313 of file fb_base.cpp.

Referenced by QVNCIntegration::moveToScreen().

314 {
315  windowStack.removeOne(surface);
316  surface->mScreens.removeOne(this);
318  setDirty(surface->geometry());
319 }
virtual void setDirty(const QRect &rect)
Definition: fb_base.cpp:187
virtual QRect geometry() const
Returnes the current geometry of a window.
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
void invalidateRectCache()
Definition: fb_base.h:204
QList< QFbScreen * > mScreens
Definition: fb_base.h:147
QList< QFbWindow * > windowStack
Definition: fb_base.h:184

◆ setDepth()

void QFbScreen::setDepth ( int  depth)
virtual

Definition at line 162 of file fb_base.cpp.

Referenced by QVNCScreen::QVNCScreen().

163 {
164  mDepth = depth;
165 }
virtual int depth() const
Reimplement in subclass to return current depth of the screen.
Definition: fb_base.h:163
int mDepth
Definition: fb_base.h:194

◆ setDirty()

void QFbScreen::setDirty ( const QRect rect)
virtual

Reimplemented from QPlatformScreen.

Reimplemented in QLinuxFbScreen, and QVNCScreen.

Definition at line 187 of file fb_base.cpp.

Referenced by addWindow(), lower(), raise(), and removeWindow().

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 }
QTimer redrawTimer
Definition: fb_base.h:187
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
QRect intersected(const QRect &other) const
Returns the intersection of this rectangle and the given rectangle.
Definition: qrect.h:481
bool isActive() const
Returns true if the timer is running (pending); otherwise returns false.
Definition: qtimer.h:69
QRect mGeometry
Definition: fb_base.h:193
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
QRegion repaintRegion
Definition: fb_base.h:185
void start(int msec)
Starts or restarts the timer with a timeout interval of msec milliseconds.
Definition: qtimer.cpp:249
QPoint topLeft() const
Returns the position of the rectangle&#39;s top-left corner.
Definition: qrect.h:288

◆ setFormat()

void QFbScreen::setFormat ( QImage::Format  format)
virtual

Reimplemented in QLinuxFbScreen.

Definition at line 172 of file fb_base.cpp.

Referenced by QVNCScreen::QVNCScreen().

173 {
174  mFormat = format;
175  delete mScreenImage;
177  delete compositePainter;
178  compositePainter = 0;
179 }
QImage * mScreenImage
Definition: fb_base.h:197
QImage::Format mFormat
Definition: fb_base.h:195
QPainter * compositePainter
Definition: fb_base.h:200
QSize size() const
Returns the size of the rectangle.
Definition: qrect.h:309
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
QRect mGeometry
Definition: fb_base.h:193
virtual QImage::Format format() const
Reimplement in subclass to return the image format which corresponds to the screen format...
Definition: fb_base.h:164

◆ setGeometry()

void QFbScreen::setGeometry ( QRect  rect)
virtual

Reimplemented in QLinuxFbScreen.

Definition at line 152 of file fb_base.cpp.

Referenced by QVNCScreen::QVNCScreen().

153 {
154  delete mScreenImage;
155  mGeometry = rect;
157  delete compositePainter;
158  compositePainter = 0;
160 }
QImage * mScreenImage
Definition: fb_base.h:197
QImage::Format mFormat
Definition: fb_base.h:195
QPainter * compositePainter
Definition: fb_base.h:200
void invalidateRectCache()
Definition: fb_base.h:204
QSize size() const
Returns the size of the rectangle.
Definition: qrect.h:309
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
QRect mGeometry
Definition: fb_base.h:193

◆ setPhysicalSize()

void QFbScreen::setPhysicalSize ( QSize  size)
virtual

Definition at line 167 of file fb_base.cpp.

Referenced by QLinuxFbIntegration::QLinuxFbIntegration(), and QVNCScreen::QVNCScreen().

168 {
169  mPhysicalSize = size;
170 }
QSize mPhysicalSize
Definition: fb_base.h:196

◆ topLevelAt()

QWidget * QFbScreen::topLevelAt ( const QPoint pos) const
virtual

Return the given top level widget for a given position.

Default implementation retrieves a list of all top level widgets and finds the first widget which contains point pos

Reimplemented from QPlatformScreen.

Definition at line 363 of file fb_base.cpp.

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 }
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 size() const
Returns the number of items in the list.
Definition: qlist.h:137
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

Friends and Related Functions

◆ QFbWindow

friend class QFbWindow
friend

Definition at line 206 of file fb_base.h.

◆ QFbWindowSurface

friend class QFbWindowSurface
friend

Definition at line 205 of file fb_base.h.

Properties

◆ cachedRects

QList<QPair<QRect, int> > QFbScreen::cachedRects
private

Definition at line 202 of file fb_base.h.

Referenced by doRedraw(), and generateRects().

◆ compositePainter

QPainter* QFbScreen::compositePainter
private

Definition at line 200 of file fb_base.h.

Referenced by doRedraw(), setFormat(), setGeometry(), and ~QFbScreen().

◆ cursor

QPlatformSoftwareCursor* QFbScreen::cursor
protected

Definition at line 186 of file fb_base.h.

Referenced by doRedraw(), QLinuxFbScreen::QLinuxFbScreen(), and QVNCScreen::QVNCScreen().

◆ isUpToDate

bool QFbScreen::isUpToDate
private

Definition at line 207 of file fb_base.h.

Referenced by doRedraw(), and generateRects().

◆ mDepth

int QFbScreen::mDepth
protected

Definition at line 194 of file fb_base.h.

Referenced by QLinuxFbScreen::QLinuxFbScreen(), and setDepth().

◆ mFormat

QImage::Format QFbScreen::mFormat
protected

◆ mGeometry

QRect QFbScreen::mGeometry
protected

◆ mPhysicalSize

QSize QFbScreen::mPhysicalSize
protected

Definition at line 196 of file fb_base.h.

Referenced by setPhysicalSize().

◆ mScreenImage

QImage* QFbScreen::mScreenImage
protected

◆ redrawTimer

QTimer QFbScreen::redrawTimer
protected

Definition at line 187 of file fb_base.h.

Referenced by QFbScreen(), and setDirty().

◆ repaintRegion

QRegion QFbScreen::repaintRegion
protected

Definition at line 185 of file fb_base.h.

Referenced by doRedraw(), and setDirty().

◆ windowStack

QList<QFbWindow *> QFbScreen::windowStack
protected

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