46 #include <QPlatformCursor> 47 #include <QWindowSystemInterface> 117 graphic->
set(data, mask, width, height, hotX, hotY);
144 QFbScreen::QFbScreen() : cursor(0), mGeometry(), mDepth(16), mFormat(
QImage::Format_RGB16), mScreenImage(0), compositePainter(0), isUpToDate(false)
158 compositePainter = 0;
178 compositePainter = 0;
204 if (remainingScreen.isEmpty())
213 remainingScreen -= localGeometry;
214 QRegion windowRegion(localGeometry);
215 windowRegion -= remainingScreen;
221 foreach (
QRect rect, remainingScreen.rects())
239 return touchedRegion;
250 QRegion rectRegion = rects[rectIndex];
260 rectRegion -= intersect;
264 bool firstLayer =
true;
271 for (
int layerIndex = layer; layerIndex != -1; layerIndex--) {
276 QRect windowRect =
windowStack[layerIndex]->geometry().translated(-screenOffset);
292 touchedRegion += cursorRect;
302 return touchedRegion;
389 (*i)->removeWindow(
this);
402 platformWindow->surface =
this;
427 QRect dirtyRegion(currentGeometry.
left() + dirtyClient.
left(),
428 currentGeometry.
top() + dirtyClient.
top(),
433 QRect oldGeometryLocal = oldGeometry;
434 oldGeometry = currentGeometry;
437 if (oldGeometryLocal != currentGeometry) {
438 (*i)->setDirty(oldGeometryLocal);
440 (*i)->setDirty(dirtyRegion);
450 QWindowSurface::resize(size);
462 (*i)->invalidateRectCache();
487 visibleFlag = visible;
491 (*i)->invalidateRectCache();
503 (*i)->invalidateRectCache();
virtual void setDirty(const QRect &rect)
The QPainter class performs low-level painting on widgets and other paint devices.
void setSingleShot(bool singleShot)
QRect geometry() const
Returns the currently allocated area on the screen.
QImage toImage() const
Converts the pixmap to a QImage.
QT_DEPRECATED int numRects() const
Returns the number of rectangles that will be returned in rects().
Format
The following image formats are available in Qt.
QFbWindowSurface(QFbScreen *screen, QWidget *window)
QRegion intersected(const QRegion &r) const
Returns a region which is the intersection of this region and r.
bool isNull() const
Returns true if the rectangle is a null rectangle, otherwise returns false.
The QCursor class provides a mouse cursor with an arbitrary shape.
virtual QRegion doRedraw()
QPointer< QWidget > widget
virtual void lower(QPlatformWindow *surface)
The QAtomicInt class provides platform-independent atomic operations on integers. ...
void resize(const QSize &size)
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...
virtual void flush(QWidget *widget, const QRegion ®ion, const QPoint &offset)
Flushes the given region from the specified widget onto the screen.
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
int left() const
Returns the x-coordinate of the rectangle's left edge.
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...
int width() const
Returns the width of the rectangle.
The QList::const_iterator class provides an STL-style const iterator for QList and QQueue...
virtual void setFormat(QImage::Format format)
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.
QRect boundingRect() const
Returns the bounding rectangle of this region.
int height() const
Returns the height of the rectangle.
virtual void repaint(const QRegion &)
QRect rect() const
Returns the enclosing rectangle (0, 0, width(), height()) of the image.
QPainter * compositePainter
void move(int from, int to)
Moves the item at index position from to index position to.
bool removeOne(const T &t)
Removes the first occurrence of value in the list and returns true on success; otherwise returns fals...
void append(const T &t)
Inserts value at the end of the list.
virtual void raise()
Reimplement to be able to let Qt rais windows to the top of the desktop.
virtual int depth() const
Reimplement in subclass to return current depth of the screen.
virtual void addWindow(QFbWindow *surface)
QList< QPair< QRect, int > > cachedRects
void invalidateRectCache()
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...
QFbWindow * platformWindow
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
void prepend(const T &t)
Inserts value at the beginning of the list.
QSize size() const
Returns the size of the rectangle.
const T & at(int i) const
Returns the item at index position i in the list.
virtual void setVisible(bool visible)
Reimplemented in subclasses to show the surface if visible is true, and hide it if visible is false...
QPixmap pixmap() const
Returns the cursor pixmap.
The QImage class provides a hardware-independent image representation that allows direct access to th...
static const char * data(const QByteArray &arr)
bool isActive() const
Returns true if the timer is running (pending); otherwise returns false.
The QRegion class specifies a clip region for a painter.
virtual void beginPaint(const QRegion ®ion)
This function is called before painting onto the surface begins, with the region in which the paintin...
virtual Qt::WindowFlags setWindowFlags(Qt::WindowFlags type)
Requests setting the window flags of this surface to type.
void clear()
Removes all items from the list.
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...
The QWindowSurface class provides the drawing area for top-level windows.
void setInterval(int msec)
QSize size() const
Returns the size of the image, i.
QPlatformSoftwareCursor * cursor
The QMouseEvent class contains parameters that describe a mouse event.
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.
T & first()
Returns a reference to the first item in the list.
int top() const
Returns the y-coordinate of the rectangle's top edge.
virtual void removeWindow(QFbWindow *surface)
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...
void setGeometry(const QRect &rect)
This function is called by Qt whenever a window is moved or the window is resized.
virtual QImage::Format format() const
Reimplement in subclass to return the image format which corresponds to the screen format...
int length() const
This function is identical to count().
virtual void setPhysicalSize(QSize size)
The QPoint class defines a point in the plane using integer precision.
QVector< QRect > rects() const
Returns an array of non-overlapping rectangles that make up the region.
int size() const
Returns the number of items in the list.
virtual void endPaint(const QRegion ®ion)
This function is called after painting onto the surface has ended, with the region in which the paint...
The QRect class defines a rectangle in the plane using integer precision.
virtual void raise(QPlatformWindow *surface)
int y() const
Returns the y coordinate of this point.
virtual void setDepth(int depth)
void drawImage(const QRectF &targetRect, const QImage &image, const QRectF &sourceRect, Qt::ImageConversionFlags flags=Qt::AutoColor)
bool intersects(const QRegion &r) const
Returns true if this region intersects with region, otherwise returns false.
QList< QFbScreen * > mScreens
The QSize class defines the size of a two-dimensional object using integer point precision.
virtual void lower()
Reimplement to be able to let Qt lower windows to the bottom of the desktop.
bool intersects(const QRect &r) const
Returns true if this rectangle intersects with the given rectangle (i.
int x() const
Returns the x coordinate of this point.
virtual QRect geometry() const
Reimplement in subclass to return the pixel geometry of the screen.
QList< QFbWindow * > windowStack
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...
static const KeyPair *const end
void start(int msec)
Starts or restarts the timer with a timeout interval of msec milliseconds.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
QFbWindow(QWidget *window)
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)
void fillRect(const QRectF &, const QBrush &)
Fills the given rectangle with the brush specified.
static QPoint pos()
Returns the position of the cursor (hot spot) in global screen coordinates.
static int area(const QSize &s)
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
Qt::CursorShape shape() const
Returns the cursor shape identifier.
QPoint topLeft() const
Returns the position of the rectangle's top-left corner.
virtual Qt::WindowFlags windowFlags() const
Returns the effective window flags for this surface.
virtual QWidget * topLevelAt(const QPoint &p) const
Return the given top level widget for a given position.