Qt 4.8
|
The QWindowSurface class provides the drawing area for top-level windows. More...
#include <qwindowsurface_p.h>
Public Types | |
enum | WindowSurfaceFeature { PartialUpdates = 0x00000001, PreservedContents = 0x00000002, StaticContents = 0x00000004, AllFeatures = 0xffffffff } |
Public Functions | |
virtual void | beginPaint (const QRegion &) |
This function is called before painting onto the surface begins, with the region in which the painting will occur. More... | |
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 unavailable. More... | |
virtual void | endPaint (const QRegion &) |
This function is called after painting onto the surface has ended, with the region in which the painting was performed. More... | |
virtual WindowSurfaceFeatures | features () const |
virtual void | flush (QWidget *widget, const QRegion ®ion, const QPoint &offset)=0 |
Flushes the given region from the specified widget onto the screen. More... | |
QRect | geometry () const |
Returns the currently allocated area on the screen. More... | |
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. More... | |
bool | hasFeature (WindowSurfaceFeature feature) const |
virtual QPoint | offset (const QWidget *widget) const |
Returns the offset of widget in the coordinates of this window surface. More... | |
virtual QPaintDevice * | paintDevice ()=0 |
Implement this function to return the appropriate paint device. More... | |
QWindowSurface (QWidget *window, bool setDefaultSurface=true) | |
Constructs an empty surface for the given top-level window. More... | |
QRect | rect (const QWidget *widget) const |
Returns the rectangle for widget in the coordinates of this window surface. More... | |
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. More... | |
virtual void | setGeometry (const QRect &rect) |
Sets the currently allocated area to be the given rect. More... | |
void | setStaticContents (const QRegion ®ion) |
QRegion | staticContents () const |
QWidget * | window () const |
Returns a pointer to the top-level window associated with this surface. More... | |
virtual | ~QWindowSurface () |
Destroys this surface. More... | |
Protected Functions | |
bool | hasStaticContents () const |
Properties | |
QWindowSurfacePrivate * | d_ptr |
The QWindowSurface class provides the drawing area for top-level windows.
Definition at line 68 of file qwindowsurface_p.h.
Enumerator | |
---|---|
PartialUpdates | |
PreservedContents | |
StaticContents | |
AllFeatures |
Definition at line 71 of file qwindowsurface_p.h.
QWindowSurface::QWindowSurface | ( | QWidget * | window, |
bool | setDefaultSurface = true |
||
) |
Constructs an empty surface for the given top-level window.
Definition at line 126 of file qwindowsurface.cpp.
|
virtual |
Destroys this surface.
Definition at line 138 of file qwindowsurface.cpp.
|
virtual |
This function is called before painting onto the surface begins, with the region in which the painting will occur.
Reimplemented in QWSDirectPainterSurface, QWSMemorySurface, QRuntimeWindowSurface, QRasterWindowSurface, QFbWindowSurface, QGLWindowSurface, QDirectFBWindowSurface, QWSWindowSurface, QVGWindowSurface, QBBGLWindowSurface, QX11WindowSurface, QWaylandShmWindowSurface, QXlibWindowSurface, QXcbWindowSurface, QBBRasterWindowSurface, QDirectFbWindowSurface, ShivaVGWindowSurface, QTraceWindowSurface, and QWaylandGLWindowSurface.
Definition at line 154 of file qwindowsurface.cpp.
Referenced by QRuntimeWindowSurface::beginPaint(), QWidgetBackingStore::beginPaint(), and QWidgetBackingStore::removeDirtyWidget().
Returns a QImage pointer which represents the actual buffer the widget is drawn into or 0 if this is unavailable.
You must call beginPaint() before you call this function and the returned pointer is only valid until endPaint() is called.
Reimplemented in QRuntimeWindowSurface, and QGLWindowSurface.
Definition at line 229 of file qwindowsurface.cpp.
Referenced by QRuntimeWindowSurface::buffer(), and grabWidget().
|
virtual |
This function is called after painting onto the surface has ended, with the region in which the painting was performed.
Reimplemented in QRuntimeWindowSurface, QFbWindowSurface, QGLWindowSurface, QDirectFBWindowSurface, QWSWindowSurface, QVGWindowSurface, QBBGLWindowSurface, QXlibWindowSurface, QXcbWindowSurface, QBBRasterWindowSurface, QDirectFbWindowSurface, ShivaVGWindowSurface, and QTraceWindowSurface.
Definition at line 158 of file qwindowsurface.cpp.
Referenced by QTraceWindowSurface::endPaint(), QRuntimeWindowSurface::endPaint(), QWidgetBackingStore::endPaint(), and QWidgetBackingStore::removeDirtyWidget().
|
virtual |
Reimplemented in QRuntimeWindowSurface, QRasterWindowSurface, QGLWindowSurface, QVGWindowSurface, QX11WindowSurface, QBBGLWindowSurface, and QUIKitWindowSurface.
Definition at line 334 of file qwindowsurface.cpp.
Referenced by QRuntimeWindowSurface::features().
|
pure virtual |
Flushes the given region from the specified widget onto the screen.
Note that the offset parameter is currently unused.
Implemented in QDummyWindowSurface, QWSDirectPainterSurface, QWSYellowSurface, QRuntimeWindowSurface, QRasterWindowSurface, QFbWindowSurface, QGLWindowSurface, QDirectFBWindowSurface, QWSWindowSurface, QBBGLWindowSurface, QX11WindowSurface, QMacWindowSurface, QVGWindowSurface, QWaylandShmWindowSurface, QX11GLWindowSurface, PvrEglWindowSurface, QXlibWindowSurface, QCocoaWindowSurface, QBBRasterWindowSurface, QVFbWindowSurface, QWaylandGLWindowSurface, QXcbWindowSurface, QDirectFbWindowSurface, QEglFSWindowSurface, ShivaVGWindowSurface, QMinimalWindowSurface, and QUIKitWindowSurface.
Referenced by QRuntimeWindowSurface::flush(), QXcbWindow::handleExposeEvent(), and qt_flush().
QRect QWindowSurface::geometry | ( | ) | const |
Returns the currently allocated area on the screen.
Definition at line 182 of file qwindowsurface.cpp.
Referenced by QWidgetBackingStore::dirtyRegion(), effectiveState(), QDirectFBScreen::exposeRegion(), QXcbWindowSurface::flush(), QWSWindowSurface::flush(), QDirectFBWindowSurface::flush(), QGLWindowSurface::flush(), PvrEglWindowSurface::move(), QWSWindowSurface::move(), QDirectFBWindowSurface::move(), QTraceWindowSurface::paintDevice(), QWSOnScreenSurface::painterOffset(), QFbWindow::repaint(), QDirectFBWindowSurface::setGeometry(), QWSWindowSurface::setGeometry(), QFbWindow::setGeometry(), QRuntimeGraphicsSystem::setGraphicsSystem(), QFbWindow::setVisible(), QWidgetBackingStore::staticContents(), QWidgetBackingStore::sync(), and QGLWindowSurface::updateGeometry().
|
virtual |
Returns a QPixmap generated from the part of the backing store corresponding to widget.
Returns a null QPixmap if an error occurs. The contents of the pixmap are only defined for the regions of widget that have received paint events since the last resize of the backing store.
If rectangle is a null rectangle (the default), the entire widget is grabbed. Otherwise, the grabbed area is limited to rectangle.
The default implementation uses QWindowSurface::buffer().
Reimplemented in QRuntimeWindowSurface, QX11WindowSurface, QX11GLWindowSurface, and QBBRasterWindowSurface.
Definition at line 269 of file qwindowsurface.cpp.
Referenced by QBBRasterWindowSurface::grabWidget(), and QRuntimeWindowSurface::grabWidget().
|
inline |
Definition at line 131 of file qwindowsurface_p.h.
Referenced by hasStaticContents(), QWidgetBackingStore::hasStaticContents(), QWidgetBackingStore::markDirty(), and QWidgetBackingStore::sync().
|
protected |
Definition at line 329 of file qwindowsurface.cpp.
Referenced by QRasterWindowSurface::prepareBuffer(), and QX11WindowSurface::setGeometry().
Returns the offset of widget in the coordinates of this window surface.
Reimplemented in QRuntimeWindowSurface.
Definition at line 302 of file qwindowsurface.cpp.
Referenced by addCircle(), QWSMemorySurface::beginPaint(), buffer(), QXlibWindowSurface::flush(), good_offset(), grabWidget(), PvrEglWindowSurface::key(), QRuntimeWindowSurface::offset(), QEglFSWindowSurface::paintDevice(), qt_scrollRectInImage(), QXcbWindowSurface::resize(), QRasterWindowSurface::setGeometry(), and shift().
|
pure virtual |
Implement this function to return the appropriate paint device.
Implemented in QDummyWindowSurface, QWSDirectPainterSurface, QWSYellowSurface, QWSMemorySurface, QRuntimeWindowSurface, QRasterWindowSurface, QWSWindowSurface, QFbWindowSurface, QGLWindowSurface, QDirectFBWindowSurface, QBBGLWindowSurface, QX11WindowSurface, QMacWindowSurface, QVGWindowSurface, QWaylandShmWindowSurface, PvrEglWindowSurface, QX11GLWindowSurface, QXlibWindowSurface, QCocoaWindowSurface, QTraceWindowSurface, QBBRasterWindowSurface, QVFbWindowSurface, QWaylandGLWindowSurface, QXcbWindowSurface, QDirectFbWindowSurface, QEglFSWindowSurface, ShivaVGWindowSurface, QMinimalWindowSurface, EGLNullWSWindowSurface, and QUIKitWindowSurface.
Referenced by buffer(), QRuntimeWindowSurface::paintDevice(), QWidgetBackingStore::removeDirtyWidget(), and QWidgetBackingStore::sync().
Returns the rectangle for widget in the coordinates of this window surface.
Definition at line 126 of file qwindowsurface_p.h.
Referenced by QWSMemorySurface::beginPaint(), buffer(), QDirectFbWindowSurface::flush(), QWaylandGLWindowSurface::flush(), QCocoaWindowSurface::flush(), QXlibWindowSurface::flush(), QWaylandShmWindowSurface::flush(), QMacWindowSurface::flush(), QGLWindowSurface::flush(), QRasterWindowSurface::flush(), grabWidget(), PvrEglWindowSurface::key(), PvrEglWindowSurface::move(), QGLWindowSurface::paintDevice(), QCocoaWindowSurface::QCocoaWindowSurface(), rect(), QXcbWindowSurface::resize(), QVFbWindowSurface::resize(), QX11GLWindowSurface::scroll(), QMacWindowSurface::scroll(), QX11WindowSurface::scroll(), QDirectFBWindowSurface::scroll(), scrollSurface(), PvrEglWindowSurface::setDirectRegion(), QWSWindowSurface::setGeometry(), setGeometry(), and QRasterWindowSurface::setGeometry().
|
virtual |
Scrolls the given area dx pixels to the right and dy downward; both dx and dy may be negative.
Returns true if the area was scrolled successfully; false otherwise.
Reimplemented in QWSMemorySurface, QRuntimeWindowSurface, QRasterWindowSurface, QFbWindowSurface, QGLWindowSurface, QDirectFBWindowSurface, QX11WindowSurface, QVGWindowSurface, QMacWindowSurface, QX11GLWindowSurface, QTraceWindowSurface, QXlibWindowSurface, QBBRasterWindowSurface, QXcbWindowSurface, QDirectFbWindowSurface, and ShivaVGWindowSurface.
Definition at line 213 of file qwindowsurface.cpp.
Referenced by QWidgetBackingStore::bltRect(), QWSMemorySurface::paintDevice(), ShivaVGWindowSurface::scroll(), QVGWindowSurface::scroll(), QFbWindowSurface::scroll(), and QRuntimeWindowSurface::scroll().
|
virtual |
Sets the currently allocated area to be the given rect.
This function is called whenever area covered by the top-level window changes.
Reimplemented in QWSDirectPainterSurface, QWSSharedMemSurface, QWSLocalMemSurface, QRuntimeWindowSurface, QRasterWindowSurface, QGLWindowSurface, QX11WindowSurface, QWSWindowSurface, QDirectFBWindowSurface, QMacWindowSurface, QVGWindowSurface, QX11GLWindowSurface, PvrEglWindowSurface, and ShivaVGWindowSurface.
Definition at line 174 of file qwindowsurface.cpp.
Referenced by effectiveState(), isServerProcess(), QWSWindowSurface::move(), QWidgetBackingStore::releaseBuffer(), ShivaVGWindowSurface::setGeometry(), QX11GLWindowSurface::setGeometry(), QVGWindowSurface::setGeometry(), QMacWindowSurface::setGeometry(), QDirectFBWindowSurface::setGeometry(), QWSWindowSurface::setGeometry(), QX11WindowSurface::setGeometry(), QGLWindowSurface::setGeometry(), QRasterWindowSurface::setGeometry(), QRuntimeWindowSurface::setGeometry(), QRuntimeGraphicsSystem::setGraphicsSystem(), and QWidgetBackingStore::sync().
void QWindowSurface::setStaticContents | ( | const QRegion & | region | ) |
QRegion QWindowSurface::staticContents | ( | ) | const |
Definition at line 324 of file qwindowsurface.cpp.
Referenced by QRasterWindowSurface::prepareBuffer(), and QX11WindowSurface::setGeometry().
QWidget * QWindowSurface::window | ( | ) | const |
Returns a pointer to the top-level window associated with this surface.
Definition at line 149 of file qwindowsurface.cpp.
Referenced by QWaylandGLWindowSurface::beginPaint(), QBBRasterWindowSurface::beginPaint(), QWaylandShmWindowSurface::beginPaint(), QBBGLWindowSurface::beginPaint(), QVGWindowSurface::beginPaint(), QDirectFBWindowSurface::beginPaint(), QGLWindowSurface::beginPaint(), QRasterWindowSurface::beginPaint(), QWidgetBackingStore::beginPaint(), QWSMemorySurface::beginPaint(), buffer(), QDirectFBWindowSurface::createWindow(), QGLWindowSurface::deleted(), QTraceWindowSurface::endPaint(), QBBRasterWindowSurface::endPaint(), QBBGLWindowSurface::endPaint(), QXcbWindowSurface::flush(), QBBRasterWindowSurface::flush(), QXlibWindowSurface::flush(), QX11GLWindowSurface::flush(), QVGWindowSurface::flush(), QWaylandShmWindowSurface::flush(), QBBGLWindowSurface::flush(), QWSWindowSurface::flush(), QDirectFBWindowSurface::flush(), QGLWindowSurface::flush(), QRasterWindowSurface::flush(), QX11GLWindowSurface::grabWidget(), QX11WindowSurface::grabWidget(), grabWidget(), QWSWindowSurface::invalidateBuffer(), EGLNullWSWindowSurface::isValid(), QWSMemorySurface::isValid(), QWSOnScreenSurface::isValid(), ShivaVGWindowSurface::metric(), QVGWindowSurface::metric(), offset(), ShivaVGWindowSurface::paintDevice(), QGLWindowSurface::paintDevice(), QWSWindowSurface::painterOffset(), QWSMemorySurface::painterOffset(), QWSOnScreenSurface::permanentState(), QRasterWindowSurface::prepareBuffer(), QBBGLWindowSurface::QBBGLWindowSurface(), QBBRasterWindowSurface::QBBRasterWindowSurface(), QCocoaWindowSurface::QCocoaWindowSurface(), QApplication::qwsProcessEvent(), QDirectFBWindowSurface::raise(), QXcbWindowSurface::resize(), QBBRasterWindowSurface::resize(), QWaylandGLWindowSurface::resize(), QWaylandShmWindowSurface::resize(), QBBGLWindowSurface::resize(), QBBRasterWindowSurface::scroll(), QGLWindowSurface::scroll(), QWSWindowSurface::setClipRegion(), PvrEglWindowSurface::setDirectRegion(), QX11GLWindowSurface::setGeometry(), QDirectFBWindowSurface::setGeometry(), QWSWindowSurface::setGeometry(), QRasterWindowSurface::setGeometry(), QWSLocalMemSurface::setGeometry(), QWSSharedMemSurface::setGeometry(), QRuntimeGraphicsSystem::setGraphicsSystem(), QDirectFBWindowSurface::surfaceForWidget(), QWidgetBackingStore::sync(), QGLWindowSurface::updateGeometry(), QDirectFBWindowSurface::updateIsOpaque(), QWidget::visibleRegion(), QBBGLWindowSurface::~QBBGLWindowSurface(), and QBBRasterWindowSurface::~QBBRasterWindowSurface().
|
private |
Definition at line 121 of file qwindowsurface_p.h.
Referenced by buffer(), endPaint(), geometry(), hasStaticContents(), offset(), setGeometry(), setStaticContents(), staticContents(), window(), and ~QWindowSurface().