Qt 4.8
Public Functions | Protected Functions | Properties | List of all members
QVGWindowSurface Class Reference

#include <qwindowsurface_vg_p.h>

Inheritance diagram for QVGWindowSurface:
QWindowSurface QPaintDevice

Public Functions

void beginPaint (const QRegion &region)
 This function is called before painting onto the surface begins, with the region in which the painting will occur. More...
 
void endPaint (const QRegion &region)
 This function is called after painting onto the surface has ended, with the region in which the painting was performed. More...
 
WindowSurfaceFeatures features () const
 
void flush (QWidget *widget, const QRegion &region, const QPoint &offset)
 Flushes the given region from the specified widget onto the screen. More...
 
QPaintDevicepaintDevice ()
 Implement this function to return the appropriate paint device. More...
 
QPaintEnginepaintEngine () const
 
 QVGWindowSurface (QWidget *window)
 
 QVGWindowSurface (QWidget *window, QVGEGLWindowSurfacePrivate *d)
 
bool scroll (const QRegion &area, int dx, int dy)
 Q_WS_QPA. More...
 
void setGeometry (const QRect &rect)
 Sets the currently allocated area to be the given rect. More...
 
 ~QVGWindowSurface ()
 
- Public Functions inherited from QWindowSurface
virtual QImagebuffer (const QWidget *widget)
 Returns a QImage pointer which represents the actual buffer the widget is drawn into or 0 if this is unavailable. 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...
 
 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...
 
void setStaticContents (const QRegion &region)
 
QRegion staticContents () const
 
QWidgetwindow () const
 Returns a pointer to the top-level window associated with this surface. More...
 
virtual ~QWindowSurface ()
 Destroys this surface. More...
 
- Public Functions inherited from QPaintDevice
int colorCount () const
 
int depth () const
 
virtual int devType () const
 
virtual HDC getDC () const
 
int height () const
 
int heightMM () const
 
int logicalDpiX () const
 
int logicalDpiY () const
 
QT_DEPRECATED int numColors () const
 
bool paintingActive () const
 
int physicalDpiX () const
 
int physicalDpiY () const
 
virtual void releaseDC (HDC hdc) const
 
int width () const
 
int widthMM () const
 
virtual ~QPaintDevice ()
 

Protected Functions

int metric (PaintDeviceMetric metric) const
 
- Protected Functions inherited from QWindowSurface
bool hasStaticContents () const
 
- Protected Functions inherited from QPaintDevice
 QPaintDevice ()
 

Properties

QVGEGLWindowSurfacePrivated_ptr
 

Additional Inherited Members

- Public Types inherited from QWindowSurface
enum  WindowSurfaceFeature { PartialUpdates = 0x00000001, PreservedContents = 0x00000002, StaticContents = 0x00000004, AllFeatures = 0xffffffff }
 
- Public Types inherited from QPaintDevice
enum  PaintDeviceMetric {
  PdmWidth = 1, PdmHeight, PdmWidthMM, PdmHeightMM,
  PdmNumColors, PdmDepth, PdmDpiX, PdmDpiY,
  PdmPhysicalDpiX, PdmPhysicalDpiY
}
 
- Static Public Functions inherited from QPaintDevice
static QWSDisplayqwsDisplay ()
 
- Protected Variables inherited from QPaintDevice
ushort painters
 

Detailed Description

Definition at line 64 of file qwindowsurface_vg_p.h.

Constructors and Destructors

◆ QVGWindowSurface() [1/2]

QVGWindowSurface::QVGWindowSurface ( QWidget window)

Definition at line 55 of file qwindowsurface_vg.cpp.

56  : QWindowSurface(window)
57 {
58  // Create the default type of EGL window surface for windows.
59  d_ptr = new QVGEGLWindowSurfaceDirect(this);
60 }
QWindowSurface(QWidget *window, bool setDefaultSurface=true)
Constructs an empty surface for the given top-level window.
QVGEGLWindowSurfacePrivate * d_ptr

◆ QVGWindowSurface() [2/2]

QVGWindowSurface::QVGWindowSurface ( QWidget window,
QVGEGLWindowSurfacePrivate d 
)

Definition at line 63 of file qwindowsurface_vg.cpp.

64  : QWindowSurface(window), d_ptr(d)
65 {
66 }
QWindowSurface(QWidget *window, bool setDefaultSurface=true)
Constructs an empty surface for the given top-level window.
QVGEGLWindowSurfacePrivate * d_ptr

◆ ~QVGWindowSurface()

QVGWindowSurface::~QVGWindowSurface ( )

Definition at line 68 of file qwindowsurface_vg.cpp.

69 {
70  delete d_ptr;
71 }
QVGEGLWindowSurfacePrivate * d_ptr

Functions

◆ beginPaint()

void QVGWindowSurface::beginPaint ( const QRegion region)
virtual

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

See also
endPaint(), paintDevice()

Reimplemented from QWindowSurface.

Definition at line 115 of file qwindowsurface_vg.cpp.

116 {
117  d_ptr->beginPaint(window());
118 
119  // If the window is not opaque, then fill the region we are about
120  // to paint with the transparent color.
121  if (!qt_widget_private(window())->isOpaque &&
122  window()->testAttribute(Qt::WA_TranslucentBackground)) {
123  QVGPaintEngine *engine = static_cast<QVGPaintEngine *>
124  (d_ptr->paintEngine());
125  engine->fillRegion(region, Qt::transparent, d_ptr->surfaceSize());
126  }
127 }
virtual QSize surfaceSize() const =0
QVGEGLWindowSurfacePrivate * d_ptr
Q_GUI_EXPORT QWidgetPrivate * qt_widget_private(QWidget *widget)
Definition: qwidget.cpp:12920
virtual void beginPaint(QWidget *widget)=0
QWidget * window() const
Returns a pointer to the top-level window associated with this surface.
void fillRegion(const QRegion &region, const QColor &color, const QSize &surfaceSize)

◆ endPaint()

void QVGWindowSurface::endPaint ( const QRegion region)
virtual

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

See also
beginPaint(), paintDevice()

Reimplemented from QWindowSurface.

Definition at line 129 of file qwindowsurface_vg.cpp.

130 {
131  // Nothing to do here.
132  Q_UNUSED(region);
133 }
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ features()

QWindowSurface::WindowSurfaceFeatures QVGWindowSurface::features ( ) const
virtual

Reimplemented from QWindowSurface.

Definition at line 140 of file qwindowsurface_vg.cpp.

141 {
142  WindowSurfaceFeatures features = PartialUpdates | PreservedContents;
144  features |= StaticContents;
145  return features;
146 }
WindowSurfaceFeatures features() const
QVGEGLWindowSurfacePrivate * d_ptr
virtual bool supportsStaticContents() const

◆ flush()

void QVGWindowSurface::flush ( QWidget widget,
const QRegion region,
const QPoint offset 
)
virtual

Flushes the given region from the specified widget onto the screen.

Note that the offset parameter is currently unused.

Implements QWindowSurface.

Definition at line 78 of file qwindowsurface_vg.cpp.

79 {
80  Q_UNUSED(offset);
81 
82 #ifdef Q_OS_SYMBIAN
83  if (window() != widget) {
84  // For performance reasons we don't support
85  // flushing native child widgets on Symbian.
86  // It breaks overlapping native child widget
87  // rendering in some cases but we prefer performance.
88  return;
89  }
90 #endif
91 
92  QWidget *parent = widget->internalWinId() ? widget : widget->nativeParentWidget();
93  d_ptr->endPaint(parent, region);
94 }
QPointer< QWidget > widget
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
virtual void endPaint(QWidget *widget, const QRegion &region, QImage *image=0)=0
QWidget * nativeParentWidget() const
Returns the native parent for this widget, i.
Definition: qwidget.cpp:4514
WId internalWinId() const
Returns the window system identifier of the widget, or 0 if the widget is not created yet...
Definition: qwidget.h:244
QVGEGLWindowSurfacePrivate * d_ptr
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
QWidget * window() const
Returns a pointer to the top-level window associated with this surface.

◆ metric()

int QVGWindowSurface::metric ( PaintDeviceMetric  metric) const
protectedvirtual

Reimplemented from QPaintDevice.

Definition at line 148 of file qwindowsurface_vg.cpp.

149 {
150  return qt_paint_device_metric(window(), met);
151 }
friend Q_GUI_EXPORT int qt_paint_device_metric(const QPaintDevice *device, PaintDeviceMetric metric)
QWidget * window() const
Returns a pointer to the top-level window associated with this surface.

◆ paintDevice()

QPaintDevice * QVGWindowSurface::paintDevice ( )
virtual

Implement this function to return the appropriate paint device.

Implements QWindowSurface.

Definition at line 73 of file qwindowsurface_vg.cpp.

74 {
75  return this;
76 }

◆ paintEngine()

QPaintEngine * QVGWindowSurface::paintEngine ( ) const
virtual

Implements QPaintDevice.

Definition at line 135 of file qwindowsurface_vg.cpp.

136 {
137  return d_ptr->paintEngine();
138 }
QVGEGLWindowSurfacePrivate * d_ptr

◆ scroll()

bool QVGWindowSurface::scroll ( const QRegion area,
int  dx,
int  dy 
)
virtual

Q_WS_QPA.

Reimplemented from QWindowSurface.

Definition at line 108 of file qwindowsurface_vg.cpp.

109 {
110  if (!d_ptr->scroll(window(), area, dx, dy))
111  return QWindowSurface::scroll(area, dx, dy);
112  return true;
113 }
virtual bool scroll(QWidget *, const QRegion &, int, int)
QVGEGLWindowSurfacePrivate * d_ptr
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.

◆ setGeometry()

void QVGWindowSurface::setGeometry ( const QRect rect)
virtual

Sets the currently allocated area to be the given rect.

This function is called whenever area covered by the top-level window changes.

See also
geometry()

Reimplemented from QWindowSurface.

Definition at line 97 of file qwindowsurface_vg.cpp.

98 {
100 }
virtual void setGeometry(const QRect &rect)
Sets the currently allocated area to be the given rect.

Properties

◆ d_ptr

QVGEGLWindowSurfacePrivate* QVGWindowSurface::d_ptr
private

The documentation for this class was generated from the following files: