Home · All Classes · Main Classes · Grouped Classes · Modules · Functions

QWSWindowSurface Class Reference
[QtGui module]

The QWSWindowSurface class provides the drawing area of a top-level window. More...

#include <QWSWindowSurface>

This class is under development and is subject to change.

This class was introduced in Qt 4.2.

Public Types

Public Functions

Protected Functions


Detailed Description

The QWSWindowSurface class provides the drawing area of a top-level window.

This class is used for implementing different types of memory allocation policies which are implemented in QScreen::createSurface(). There will be two instances of this class for each top-level window; one used by the application when drawing a window, and one used by the Qtopia Core GUI server for doing window compositioning.


Member Type Documentation

enum QWSWindowSurface::SurfaceFlag
flags QWSWindowSurface::SurfaceFlags

This enum is used to specify various properties for the window surface. It is used by QScreen to handle region allocation and composition properly.

ConstantValueDescription
QWSWindowSurface::Reserved0x1The surface contains a reserved area. Once allocated, a reserved area will not be changed by the window system. Thus no other widgets can be drawn on top of this.
QWSWindowSurface::Buffered0x2The surface is in a memory area which is not part of a framebuffer. A top-level window with QWidget::windowOpacity() other than 1.0 must use a buffered surface in order to making blending with the background work.
QWSWindowSurface::Opaque0x4The surface contains only opaque pixels.

The SurfaceFlags type is a typedef for QFlags<SurfaceFlag>. It stores an OR combination of SurfaceFlag values.


Member Function Documentation

QWSWindowSurface::QWSWindowSurface ()

Creates an empty surface.

QWSWindowSurface::QWSWindowSurface ( QWidget * window )

Constructs an empty surface for the top-level window.

QWSWindowSurface::~QWSWindowSurface ()

Destroys the surface.

bool QWSWindowSurface::attach ( const QByteArray & data )   [pure virtual]

Attach a server-side instance to a client side surface instance using data.

void QWSWindowSurface::beginPaint ( const QRegion & region )   [virtual]

This function is called before painting onto the surface begins, with the region in which painting will occur.

const QRegion QWSWindowSurface::clipRegion () const

Returns the region currently visible on the screen.

See also setClipRegion().

const QByteArray QWSWindowSurface::data () const   [pure virtual]

Returns a QByteArray containing whatever data neccessary for creating a server-side representation of the surface.

void QWSWindowSurface::detach ()   [pure virtual]

Detach a server-side instance from the client.

const QRegion QWSWindowSurface::dirtyRegion () const

Returns the region which needs to be repainted.

void QWSWindowSurface::endPaint ( const QRegion & region )   [virtual]

This function is called after painting onto the surface has ended, with the region in which painting could occur.

void QWSWindowSurface::flush ( QWidget * widget, const QRegion & region, const QPoint & offset )   [virtual]

Flushes the region from widget onto the screen.

The default implementation will communicate the region to the Qtopia Core GUI server.

offset is currently unused. Always pass QPoint(0, 0).

QRect QWSWindowSurface::geometry () const   [pure virtual]

Returns the geometry currently allocated by this surface.

See also setGeometry().

const QImage QWSWindowSurface::image () const   [pure virtual]

Returns an image of the top-level window.

This function is called by the Qtopia Core GUI server when doing window compositioning.

bool QWSWindowSurface::isBuffered () const

Returns true if the Buffered SurfaceFlag is set; otherwise returns false.

bool QWSWindowSurface::isOpaque () const

Returns true if the Opaque SurfaceFlag is set or the surface is non-buffered; otherwise returns false.

bool QWSWindowSurface::isReserved () const

Returns true if the Reserved SurfaceFlag is set; otherwise returns false.

bool QWSWindowSurface::isValidFor ( const QWidget * window ) const   [pure virtual]

Returns true if the surface is a valid surface for the top-level window; otherwise returns false.

const QString QWSWindowSurface::key () const   [pure virtual]

Returns a string that uniquely identifies the class of the surface.

This information is used for creating a a server-side representation of the surface on the Qtopia Core GUI server.

QPoint QWSWindowSurface::painterOffset () const   [virtual]

Returns the offset to be used when painting into the paintDevice().

void QWSWindowSurface::release ()   [virtual]

Release the surface.

The default implementation will communicate with the Qtopia Core GUI server to deallocate the current allocated screen region.

void QWSWindowSurface::setClipRegion ( const QRegion & clip )

Sets the region currently visible on the screen to clip.

See also clipRegion().

void QWSWindowSurface::setDirty ( const QRegion & region ) const

Mark the region as needing to be repainted.

void QWSWindowSurface::setGeometry ( const QRect & rect )   [virtual]

Set the geometry on the surface to rect.

This function is called whenever the area neccessary for the top-level window to be drawn is changed. The default implementation will communicate the geometry to the Qtopia Core GUI server and mark it as dirty.

See also geometry().

void QWSWindowSurface::setSurfaceFlags ( SurfaceFlags flags )   [protected]

Set the properties of this surface to flags.

See also surfaceFlags().

SurfaceFlags QWSWindowSurface::surfaceFlags () const

Returns the SurfaceFlags describing the properties of this surface.

See also setSurfaceFlags().

QWidget * QWSWindowSurface::window () const

Returns a pointer to the top-level window for this surface.


Copyright © 2006 Trolltech Trademarks
Qt 4.2.0-rc1