Qt 4.8
Public Functions | Protected Variables | Friends | List of all members
QFbWindowSurface Class Reference

#include <fb_base.h>

Inheritance diagram for QFbWindowSurface:
QWindowSurface

Public Functions

virtual 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...
 
virtual 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...
 
virtual void flush (QWidget *widget, const QRegion &region, const QPoint &offset)
 Flushes the given region from the specified widget onto the screen. More...
 
const QImage image ()
 
virtual QPaintDevicepaintDevice ()
 Implement this function to return the appropriate paint device. More...
 
 QFbWindowSurface (QFbScreen *screen, QWidget *window)
 
void resize (const QSize &size)
 
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...
 
 ~QFbWindowSurface ()
 
- 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...
 

Protected Variables

QImage mImage
 
QFbScreenmScreen
 
QFbWindowplatformWindow
 

Friends

class QFbWindow
 

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 94 of file fb_base.h.

Constructors and Destructors

◆ QFbWindowSurface()

QFbWindowSurface::QFbWindowSurface ( QFbScreen screen,
QWidget window 
)

Definition at line 395 of file fb_base.cpp.

396  : QWindowSurface(window),
397  mScreen(screen)
398 {
399  mImage = QImage(window->size(), mScreen->format());
400 
401  platformWindow = static_cast<QFbWindow*>(window->platformWindow());
402  platformWindow->surface = this;
403 }
QFbScreen * mScreen
Definition: fb_base.h:115
QImage mImage
Definition: fb_base.h:116
QFbWindow * platformWindow
Definition: fb_base.h:113
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
QSize size
the size of the widget excluding any window frame
Definition: qwidget.h:165
QWindowSurface(QWidget *window, bool setDefaultSurface=true)
Constructs an empty surface for the given top-level window.
virtual QImage::Format format() const
Reimplement in subclass to return the image format which corresponds to the screen format...
Definition: fb_base.h:164

◆ ~QFbWindowSurface()

QFbWindowSurface::~QFbWindowSurface ( )

Definition at line 405 of file fb_base.cpp.

406 {
407 }

Functions

◆ beginPaint()

void QFbWindowSurface::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 475 of file fb_base.cpp.

476 {
477  Q_UNUSED(region);
478 }
#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 QFbWindowSurface::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 480 of file fb_base.cpp.

481 {
482  Q_UNUSED(region);
483 }
#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 QFbWindowSurface::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 409 of file fb_base.cpp.

410 {
411  Q_UNUSED(widget);
412  Q_UNUSED(offset);
413 
414 
415 // qDebug() << "QFbWindowSurface::flush" << region;
416 
417 
418  platformWindow->repaint(region);
419 }
virtual void repaint(const QRegion &)
Definition: fb_base.cpp:422
QFbWindow * platformWindow
Definition: fb_base.h:113
#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

◆ image()

const QImage QFbWindowSurface::image ( )
inline

Definition at line 108 of file fb_base.h.

108 { return mImage; }
QImage mImage
Definition: fb_base.h:116

◆ paintDevice()

virtual QPaintDevice* QFbWindowSurface::paintDevice ( )
inlinevirtual

Implement this function to return the appropriate paint device.

Implements QWindowSurface.

Definition at line 100 of file fb_base.h.

100 { return &mImage; }
QImage mImage
Definition: fb_base.h:116

◆ resize()

void QFbWindowSurface::resize ( const QSize size)

Definition at line 445 of file fb_base.cpp.

446 {
447  // change the widget's QImage if this is a resize
448  if (mImage.size() != size)
449  mImage = QImage(size, mScreen->format());
450  QWindowSurface::resize(size);
451 }
QFbScreen * mScreen
Definition: fb_base.h:115
QImage mImage
Definition: fb_base.h:116
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
QSize size() const
Returns the size of the image, i.
Definition: qimage.cpp:1587
virtual QImage::Format format() const
Reimplement in subclass to return the image format which corresponds to the screen format...
Definition: fb_base.h:164

◆ scroll()

bool QFbWindowSurface::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 470 of file fb_base.cpp.

471 {
472  return QWindowSurface::scroll(area, dx, dy);
473 }
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...

Friends and Related Functions

◆ QFbWindow

friend class QFbWindow
friend

Definition at line 112 of file fb_base.h.

Properties

◆ mImage

QImage QFbWindowSurface::mImage
protected

Definition at line 116 of file fb_base.h.

Referenced by QFbWindowSurface(), and resize().

◆ mScreen

QFbScreen* QFbWindowSurface::mScreen
protected

Definition at line 115 of file fb_base.h.

Referenced by QFbWindowSurface(), and resize().

◆ platformWindow

QFbWindow* QFbWindowSurface::platformWindow
protected

Definition at line 113 of file fb_base.h.

Referenced by flush(), and QFbWindowSurface().


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