Qt 4.8
Public Functions | Private Functions | Properties | List of all members
QDirectFbWindowSurface Class Reference

#include <qdirectfbwindowsurface.h>

Inheritance diagram for QDirectFbWindowSurface:
QWindowSurface

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...
 
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...
 
 QDirectFbWindowSurface (QWidget *window)
 
void resize (const QSize &size)
 
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...
 
- 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...
 
virtual WindowSurfaceFeatures features () const
 
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...
 
virtual void setGeometry (const QRect &rect)
 Sets the currently allocated area to be the given rect. 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...
 

Private Functions

void lockSurfaceToImage ()
 

Properties

QDirectFBPointer< IDirectFBSurface > m_dfbSurface
 
QScopedPointer< QPixmapm_pixmap
 
QBlittablePixmapDatam_pmdata
 

Additional Inherited Members

- Public Types inherited from QWindowSurface
enum  WindowSurfaceFeature { PartialUpdates = 0x00000001, PreservedContents = 0x00000002, StaticContents = 0x00000004, AllFeatures = 0xffffffff }
 
- Protected Functions inherited from QWindowSurface
bool hasStaticContents () const
 

Detailed Description

Definition at line 53 of file qdirectfbwindowsurface.h.

Constructors and Destructors

◆ QDirectFbWindowSurface()

QDirectFbWindowSurface::QDirectFbWindowSurface ( QWidget window)

Definition at line 53 of file qdirectfbwindowsurface.cpp.

54  : QWindowSurface(window), m_pixmap(0), m_pmdata(0)
55 {
56  IDirectFBWindow *dfbWindow = static_cast<QDirectFbWindow *>(window->platformWindow())->dfbWindow();
57  dfbWindow->GetSurface(dfbWindow, m_dfbSurface.outPtr());
58 
59 //WRONGSIZE
60  QDirectFbBlitter *blitter = new QDirectFbBlitter(window->size(), m_dfbSurface.data());
62  m_pmdata->setBlittable(blitter);
63  m_pixmap.reset(new QPixmap(m_pmdata));
64 }
T * data() const
Returns the value of the pointer referenced by this object.
QScopedPointer< QPixmap > m_pixmap
QBlittablePixmapData * m_pmdata
QSize size
the size of the widget excluding any window frame
Definition: qwidget.h:165
void reset(T *other=0)
Deletes the existing object it is pointing to if any, and sets its pointer to other.
QWindowSurface(QWidget *window, bool setDefaultSurface=true)
Constructs an empty surface for the given top-level window.
The QPixmap class is an off-screen image representation that can be used as a paint device...
Definition: qpixmap.h:71
QDirectFBPointer< IDirectFBSurface > m_dfbSurface

Functions

◆ beginPaint()

void QDirectFbWindowSurface::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 121 of file qdirectfbwindowsurface.cpp.

122 {
123  Q_UNUSED(region);
124 }
#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

◆ endPaint()

void QDirectFbWindowSurface::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 126 of file qdirectfbwindowsurface.cpp.

127 {
128  Q_UNUSED(region);
129 }
#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

◆ flush()

void QDirectFbWindowSurface::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 71 of file qdirectfbwindowsurface.cpp.

72 {
73  Q_UNUSED(widget);
75 
76  QVector<QRect> rects = region.rects();
77  for (int i = 0 ; i < rects.size(); i++) {
78  const QRect rect = rects.at(i);
79  DFBRegion dfbReg = { rect.x() + offset.x(),rect.y() + offset.y(),rect.right() + offset.x(),rect.bottom() + offset.y()};
80  m_dfbSurface->Flip(m_dfbSurface.data(), &dfbReg, DFBSurfaceFlipFlags(DSFLIP_BLIT|DSFLIP_ONSYNC));
81  }
82 }
T * data() const
Returns the value of the pointer referenced by this object.
QRect rect(const QWidget *widget) const
Returns the rectangle for widget in the coordinates of this window surface.
int bottom() const
Returns the y-coordinate of the rectangle&#39;s bottom edge.
Definition: qrect.h:249
QBlittablePixmapData * m_pmdata
const T & at(int i) const
Returns the item at index position i in the vector.
Definition: qvector.h:350
int right() const
Returns the x-coordinate of the rectangle&#39;s right edge.
Definition: qrect.h:246
int y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:255
void unlock()
Definition: qblittable.cpp:100
int x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:252
QVector< QRect > rects() const
Returns an array of non-overlapping rectangles that make up the region.
Definition: qregion.cpp:4412
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
int y() const
Returns the y coordinate of this point.
Definition: qpoint.h:131
int x() const
Returns the x coordinate of this point.
Definition: qpoint.h:128
QBlittable * blittable() const
QDirectFBPointer< IDirectFBSurface > m_dfbSurface
#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
int size() const
Returns the number of items in the vector.
Definition: qvector.h:137

◆ lockSurfaceToImage()

void QDirectFbWindowSurface::lockSurfaceToImage ( )
private

◆ paintDevice()

QPaintDevice * QDirectFbWindowSurface::paintDevice ( )
virtual

Implement this function to return the appropriate paint device.

Implements QWindowSurface.

Definition at line 66 of file qdirectfbwindowsurface.cpp.

67 {
68  return m_pixmap.data();
69 }
T * data() const
Returns the value of the pointer referenced by this object.
QScopedPointer< QPixmap > m_pixmap

◆ resize()

void QDirectFbWindowSurface::resize ( const QSize size)

Definition at line 84 of file qdirectfbwindowsurface.cpp.

85 {
86  if (size == QWindowSurface::size())
87  return;
88 
89  QWindowSurface::resize(size);
90  QDirectFbBlitter *blitter = new QDirectFbBlitter(size, m_dfbSurface.data());
91  m_pmdata->setBlittable(blitter);
92 }
T * data() const
Returns the value of the pointer referenced by this object.
void setBlittable(QBlittable *blittable)
QBlittablePixmapData * m_pmdata
QDirectFBPointer< IDirectFBSurface > m_dfbSurface

◆ scroll()

bool QDirectFbWindowSurface::scroll ( const QRegion area,
int  dx,
int  dy 
)
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 from QWindowSurface.

Definition at line 102 of file qdirectfbwindowsurface.cpp.

103 {
104  m_pmdata->blittable()->unlock();
105 
106  if (!m_dfbSurface || area.isEmpty())
107  return false;
108  m_dfbSurface->SetBlittingFlags(m_dfbSurface.data(), DSBLIT_NOFX);
109  if (area.rectCount() == 1) {
110  scrollSurface(m_dfbSurface.data(), area.boundingRect(), dx, dy);
111  } else {
112  const QVector<QRect> rects = area.rects();
113  const int n = rects.size();
114  for (int i=0; i<n; ++i) {
115  scrollSurface(m_dfbSurface.data(), rects.at(i), dx, dy);
116  }
117  }
118  return true;
119 }
T * data() const
Returns the value of the pointer referenced by this object.
QRect boundingRect() const
Returns the bounding rectangle of this region.
Definition: qregion.cpp:4363
int rectCount() const
Returns the number of rectangles that will be returned in rects().
Definition: qregion.cpp:4461
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
Definition: qregion.cpp:4098
QBlittablePixmapData * m_pmdata
const T & at(int i) const
Returns the item at index position i in the vector.
Definition: qvector.h:350
void unlock()
Definition: qblittable.cpp:100
QVector< QRect > rects() const
Returns an array of non-overlapping rectangles that make up the region.
Definition: qregion.cpp:4412
static void scrollSurface(IDirectFBSurface *surface, const QRect &r, int dx, int dy)
QBlittable * blittable() const
QDirectFBPointer< IDirectFBSurface > m_dfbSurface
int size() const
Returns the number of items in the vector.
Definition: qvector.h:137

Properties

◆ m_dfbSurface

QDirectFBPointer<IDirectFBSurface> QDirectFbWindowSurface::m_dfbSurface
private

Definition at line 71 of file qdirectfbwindowsurface.h.

Referenced by flush(), QDirectFbWindowSurface(), resize(), and scroll().

◆ m_pixmap

QScopedPointer<QPixmap> QDirectFbWindowSurface::m_pixmap
private

Definition at line 69 of file qdirectfbwindowsurface.h.

Referenced by paintDevice(), and QDirectFbWindowSurface().

◆ m_pmdata

QBlittablePixmapData* QDirectFbWindowSurface::m_pmdata
private

Definition at line 70 of file qdirectfbwindowsurface.h.

Referenced by flush(), QDirectFbWindowSurface(), resize(), and scroll().


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