42 #include <private/qwindowsurface_p.h> 44 #include <private/qwidget_p.h> 45 #include <private/qbackingstore_p.h> 46 #include <private/qapplication_p.h> 59 #if !defined(Q_WS_QPA) 130 if(setDefaultSurface && window)
165 #if !defined(Q_WS_QPA) 193 void QWindowSurface::resize(
const QSize &size)
201 QSize QWindowSurface::size()
const 248 rect.width(), rect.height(),
278 if (!img || img->
isNull())
340 #define Q_EXPORT_SCROLLRECT Q_GUI_EXPORT 342 #define Q_EXPORT_SCROLLRECT 351 int depth = img.
depth() >> 3;
363 if (r.top() < p.
y()) {
364 src = mem + r.bottom() * lineskip + r.left() * depth;
365 dest = mem + (p.
y() + r.height() - 1) * lineskip + p.
x() * depth;
366 lineskip = -lineskip;
368 src = mem + r.top() * lineskip + r.left() * depth;
369 dest = mem + p.
y() * lineskip + p.
x() * depth;
372 const int w = r.width();
374 const int bytes = w * depth;
377 if (offset.
y() == 0 &&
qAbs(offset.
x()) < w) {
379 ::memmove(dest, src, bytes);
385 ::memcpy(dest, src, bytes);
QRect geometry() const
Returns the currently allocated area on the screen.
static QPixmap fromImage(const QImage &image, Qt::ImageConversionFlags flags=Qt::AutoColor)
Converts the given image to a pixmap using the specified flags to control the conversion.
void Q_EXPORT_SCROLLRECT qt_scrollRectInImage(QImage &img, const QRect &rect, const QPoint &offset)
#define QT_END_NAMESPACE
This macro expands to.
QPointer< QWidget > widget
QRect rect(const QWidget *widget) const
Returns the rectangle for widget in the coordinates of this window surface.
bool isNull() const
Returns true if it is a null image, otherwise returns false.
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...
virtual void setGeometry(const QRect &rect)
Sets the currently allocated area to be the given rect.
int width() const
Returns the width of the rectangle.
virtual QPoint offset(const QWidget *widget) const
Returns the offset of widget in the coordinates of this window surface.
int bytesPerLine() const
Returns the number of bytes per image scanline.
int height() const
Returns the height of the rectangle.
Q_DECL_CONSTEXPR T qAbs(const T &t)
virtual WindowSurfaceFeatures features() const
virtual int devType() const
Format format() const
Returns the format of the image.
virtual void beginPaint(const QRegion &)
This function is called before painting onto the surface begins, with the region in which the paintin...
virtual QPixmap grabWidget(const QWidget *widget, const QRect &rectangle=QRect()) const
Returns a QPixmap generated from the part of the backing store corresponding to widget.
void append(const T &t)
Inserts value at the end of the list.
#define QT_BEGIN_NAMESPACE
This macro expands to.
bool hasStaticContents() const
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
void detach()
If multiple images share common data, this image makes a copy of the data and detaches itself from th...
The QImage class provides a hardware-independent image representation that allows direct access to th...
The QRegion class specifies a clip region for a painter.
void clear()
Removes all items from the list.
int depth() const
Returns the depth of the image.
static bool runtime_graphics_system
QWindowSurfacePrivate(QWidget *w)
The QWindowSurface class provides the drawing area for top-level windows.
QRegion staticContents() const
QSize size() const
Returns the size of the image, i.
bool isEmpty() const
Returns true if the rectangle is empty, otherwise returns false.
int width() const
Returns the width of the image.
void setStaticContents(const QRegion ®ion)
QWindowSurface(QWidget *window, bool setDefaultSurface=true)
Constructs an empty surface for the given top-level window.
virtual void endPaint(const QRegion &)
This function is called after painting onto the surface has ended, with the region in which the paint...
int y() const
Returns the y-coordinate of the rectangle's top edge.
int x() const
Returns the x-coordinate of the rectangle's left edge.
The QPoint class defines a point in the plane using integer precision.
#define Q_EXPORT_SCROLLRECT
The QRect class defines a rectangle in the plane using integer precision.
virtual QImage * buffer(const QWidget *widget)
Returns a QImage pointer which represents the actual buffer the widget is drawn into or 0 if this is ...
int height() const
Returns the height of the image.
int y() const
Returns the y coordinate of this point.
bool hasFeature(WindowSurfaceFeature feature) const
The QPixmap class is an off-screen image representation that can be used as a paint device...
QList< QImage * > bufferImages
virtual ~QWindowSurface()
Destroys this surface.
The QSize class defines the size of a two-dimensional object using integer point precision.
int x() const
Returns the x coordinate of this point.
QWindowSurfacePrivate * d_ptr
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...
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Q_OUTOFLINE_TEMPLATE void qDeleteAll(ForwardIterator begin, ForwardIterator end)
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...
QWidget * window() const
Returns a pointer to the top-level window associated with this surface.
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
virtual QPaintDevice * paintDevice()=0
Implement this function to return the appropriate paint device.
The QList class is a template class that provides lists.
static int area(const QSize &s)
QPoint topLeft() const
Returns the position of the rectangle's top-left corner.