|  | 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.

- List of all members, including inherited members

### Public Types

- enum SurfaceFlag { Reserved, Buffered, Opaque }
- flags SurfaceFlags

### Public Functions

- QWSWindowSurface ()
- QWSWindowSurface ( QWidget * window )
- ~QWSWindowSurface ()
- virtual bool attach ( const QByteArray & data ) = 0
- virtual void beginPaint ( const QRegion & region )
- const QRegion clipRegion () const
- virtual const QByteArray data () const = 0
- virtual void detach () = 0
- const QRegion dirtyRegion () const
- virtual void endPaint ( const QRegion & region )
- virtual void flush ( QWidget * widget, const QRegion & region, const QPoint & offset )
- virtual QRect geometry () const = 0
- virtual const QImage image () const = 0
- bool isBuffered () const
- bool isOpaque () const
- bool isReserved () const
- virtual bool isValidFor ( const QWidget * window ) const = 0
- virtual const QString key () const = 0
- virtual QPaintDevice * paintDevice () = 0
- virtual QPoint painterOffset () const
- virtual void release ()
- virtual void scroll ( const QRegion & region, int dx, int dy ) = 0
- void setClipRegion ( const QRegion & clip )
- void setDirty ( const QRegion & region ) const
- virtual void setGeometry ( const QRect & rect )
- SurfaceFlags surfaceFlags () const
- QWidget * window () const

### Protected Functions

- void setSurfaceFlags ( SurfaceFlags flags )

## 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.

Constant | Value | Description
--- | --- | ---
`QWSWindowSurface::Reserved` | `0x1` | The 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::Buffered` | `0x2` | The 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::Opaque` | `0x4` | The 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.

### QPaintDevice * QWSWindowSurface::paintDevice () `[pure virtual]`

Returns the associated paint device.

### 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::scroll ( const QRegion & region, int dx, int dy ) `[pure virtual]`

Scrolls the given region dx pixels to the right and dy downward.

Both dx and dy may be negative.

### 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.