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

#include <fb_base.h>

Inheritance diagram for QFbWindow:
QPlatformWindow

Public Functions

virtual void lower ()
 Reimplement to be able to let Qt lower windows to the bottom of the desktop. More...
 
 QFbWindow (QWidget *window)
 
virtual void raise ()
 Reimplement to be able to let Qt rais windows to the top of the desktop. More...
 
virtual void repaint (const QRegion &)
 
void setGeometry (const QRect &rect)
 This function is called by Qt whenever a window is moved or the window is resized. More...
 
virtual void setVisible (bool visible)
 Reimplemented in subclasses to show the surface if visible is true, and hide it if visible is false. More...
 
virtual Qt::WindowFlags setWindowFlags (Qt::WindowFlags type)
 Requests setting the window flags of this surface to type. More...
 
virtual bool visible ()
 
virtual Qt::WindowFlags windowFlags () const
 Returns the effective window flags for this surface. More...
 
WId winId () const
 Reimplement in subclasses to return a handle to the native window. More...
 
 ~QFbWindow ()
 
- Public Functions inherited from QPlatformWindow
virtual QRect geometry () const
 Returnes the current geometry of a window. More...
 
virtual QPlatformGLContextglContext () const
 Reimplement to return the glContext associated with the window. More...
 
 QPlatformWindow (QWidget *tlw)
 Constructs a platform window with the given top level widget. More...
 
virtual void requestActivateWindow ()
 Reimplement to let Qt be able to request activation/focus for a window. More...
 
virtual void setOpacity (qreal level)
 Reimplement to be able to let Qt set the opacity level of a window. More...
 
virtual void setParent (const QPlatformWindow *window)
 This function is called to enable native child widgets in QPA. More...
 
virtual void setWindowTitle (const QString &title)
 Reimplement to set the window title to title. More...
 
QWidgetwidget () const
 Returnes the widget which belongs to the QPlatformWindow. More...
 
virtual ~QPlatformWindow ()
 Virtual destructor does not delete its top level widget. More...
 

Protected Variables

Qt::WindowFlags flags
 
QList< QFbScreen * > mScreens
 
QRect oldGeometry
 
QFbWindowSurfacesurface
 
bool visibleFlag
 
WId windowId
 
- Protected Variables inherited from QPlatformWindow
QScopedPointer< QPlatformWindowPrivated_ptr
 

Friends

class QFbScreen
 
class QFbWindowSurface
 

Detailed Description

Definition at line 120 of file fb_base.h.

Constructors and Destructors

◆ QFbWindow()

QFbWindow::QFbWindow ( QWidget window)

Definition at line 375 of file fb_base.cpp.

376  :QPlatformWindow(window),
377  visibleFlag(false)
378 {
379  static QAtomicInt winIdGenerator(1);
380  windowId = winIdGenerator.fetchAndAddRelaxed(1);
381 }
The QAtomicInt class provides platform-independent atomic operations on integers. ...
Definition: qatomic.h:55
QPlatformWindow(QWidget *tlw)
Constructs a platform window with the given top level widget.
bool visibleFlag
Definition: fb_base.h:149
WId windowId
Definition: fb_base.h:152

◆ ~QFbWindow()

QFbWindow::~QFbWindow ( )

Definition at line 384 of file fb_base.cpp.

385 {
388  while (i != end) {
389  (*i)->removeWindow(this);
390  ++i;
391  }
392 }
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
Definition: qlist.h:269
The QList::const_iterator class provides an STL-style const iterator for QList and QQueue...
Definition: qlist.h:228
QList< QFbScreen * > mScreens
Definition: fb_base.h:147
static const KeyPair *const end
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
Definition: qlist.h:272

Functions

◆ lower()

void QFbWindow::lower ( )
virtual

Reimplement to be able to let Qt lower windows to the bottom of the desktop.

Reimplemented from QPlatformWindow.

Definition at line 342 of file fb_base.cpp.

343 {
346  while (i != end) {
347  (*i)->lower(this);
348  ++i;
349  }
350 }
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
Definition: qlist.h:269
The QList::const_iterator class provides an STL-style const iterator for QList and QQueue...
Definition: qlist.h:228
QList< QFbScreen * > mScreens
Definition: fb_base.h:147
static const KeyPair *const end
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
Definition: qlist.h:272

◆ raise()

void QFbWindow::raise ( )
virtual

Reimplement to be able to let Qt rais windows to the top of the desktop.

Reimplemented from QPlatformWindow.

Definition at line 321 of file fb_base.cpp.

322 {
325  while (i != end) {
326  (*i)->raise(this);
327  ++i;
328  }
329 }
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
Definition: qlist.h:269
The QList::const_iterator class provides an STL-style const iterator for QList and QQueue...
Definition: qlist.h:228
QList< QFbScreen * > mScreens
Definition: fb_base.h:147
static const KeyPair *const end
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
Definition: qlist.h:272

◆ repaint()

void QFbWindow::repaint ( const QRegion region)
virtual

Definition at line 422 of file fb_base.cpp.

Referenced by QFbWindowSurface::flush().

423 {
424  QRect currentGeometry = geometry();
425 
426  QRect dirtyClient = region.boundingRect();
427  QRect dirtyRegion(currentGeometry.left() + dirtyClient.left(),
428  currentGeometry.top() + dirtyClient.top(),
429  dirtyClient.width(),
430  dirtyClient.height());
433  QRect oldGeometryLocal = oldGeometry;
434  oldGeometry = currentGeometry;
435  while (i != end) {
436  // If this is a move, redraw the previous location
437  if (oldGeometryLocal != currentGeometry) {
438  (*i)->setDirty(oldGeometryLocal);
439  }
440  (*i)->setDirty(dirtyRegion);
441  ++i;
442  }
443 }
virtual QRect geometry() const
Returnes the current geometry of a window.
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
Definition: qlist.h:269
int left() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:240
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
The QList::const_iterator class provides an STL-style const iterator for QList and QQueue...
Definition: qlist.h:228
QRect boundingRect() const
Returns the bounding rectangle of this region.
Definition: qregion.cpp:4363
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
QRect oldGeometry
Definition: fb_base.h:148
int top() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:243
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
QList< QFbScreen * > mScreens
Definition: fb_base.h:147
static const KeyPair *const end
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
Definition: qlist.h:272

◆ setGeometry()

void QFbWindow::setGeometry ( const QRect rect)
virtual

This function is called by Qt whenever a window is moved or the window is resized.

The resize can happen programatically(from ie. user application) or by the window manager. This means that there is no need to call this function specifically from the window manager callback, instead call QWindowSystemInterface::handleGeometryChange(QWidget *w, const QRect &newRect);

Reimplemented from QPlatformWindow.

Definition at line 453 of file fb_base.cpp.

454 {
455 // store previous geometry for screen update
456  oldGeometry = geometry();
457 
458 
461  while (i != end) {
462  (*i)->invalidateRectCache();
463  ++i;
464  }
465 //### QWindowSystemInterface::handleGeometryChange(window(), rect);
466 
468 }
virtual void setGeometry(const QRect &rect)
This function is called by Qt whenever a window is moved or the window is resized.
virtual QRect geometry() const
Returnes the current geometry of a window.
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
Definition: qlist.h:269
The QList::const_iterator class provides an STL-style const iterator for QList and QQueue...
Definition: qlist.h:228
QRect oldGeometry
Definition: fb_base.h:148
QList< QFbScreen * > mScreens
Definition: fb_base.h:147
static const KeyPair *const end
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
Definition: qlist.h:272

◆ setVisible()

void QFbWindow::setVisible ( bool  visible)
virtual

Reimplemented in subclasses to show the surface if visible is true, and hide it if visible is false.

Reimplemented from QPlatformWindow.

Definition at line 485 of file fb_base.cpp.

486 {
490  while (i != end) {
491  (*i)->invalidateRectCache();
492  (*i)->setDirty(geometry());
493  ++i;
494  }
495 }
virtual QRect geometry() const
Returnes the current geometry of a window.
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
Definition: qlist.h:269
The QList::const_iterator class provides an STL-style const iterator for QList and QQueue...
Definition: qlist.h:228
bool visibleFlag
Definition: fb_base.h:149
virtual bool visible()
Definition: fb_base.h:129
QList< QFbScreen * > mScreens
Definition: fb_base.h:147
static const KeyPair *const end
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
Definition: qlist.h:272

◆ setWindowFlags()

Qt::WindowFlags QFbWindow::setWindowFlags ( Qt::WindowFlags  flags)
virtual

Requests setting the window flags of this surface to type.

Returns the actual flags set.

Reimplemented from QPlatformWindow.

Definition at line 497 of file fb_base.cpp.

498 {
499  flags = type;
502  while (i != end) {
503  (*i)->invalidateRectCache();
504  ++i;
505  }
506  return flags;
507 }
int type
Definition: qmetatype.cpp:239
Qt::WindowFlags flags
Definition: fb_base.h:150
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
Definition: qlist.h:269
The QList::const_iterator class provides an STL-style const iterator for QList and QQueue...
Definition: qlist.h:228
QList< QFbScreen * > mScreens
Definition: fb_base.h:147
static const KeyPair *const end
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
Definition: qlist.h:272

◆ visible()

virtual bool QFbWindow::visible ( )
inlinevirtual

Definition at line 129 of file fb_base.h.

129 { return visibleFlag; }
bool visibleFlag
Definition: fb_base.h:149

◆ windowFlags()

Qt::WindowFlags QFbWindow::windowFlags ( ) const
virtual

Returns the effective window flags for this surface.

Reimplemented from QPlatformWindow.

Definition at line 509 of file fb_base.cpp.

510 {
511  return flags;
512 }
Qt::WindowFlags flags
Definition: fb_base.h:150

◆ winId()

WId QFbWindow::winId ( ) const
inlinevirtual

Reimplement in subclasses to return a handle to the native window.

Reimplemented from QPlatformWindow.

Definition at line 139 of file fb_base.h.

139 { return windowId; }
WId windowId
Definition: fb_base.h:152

Friends and Related Functions

◆ QFbScreen

friend class QFbScreen
friend

Definition at line 145 of file fb_base.h.

◆ QFbWindowSurface

friend class QFbWindowSurface
friend

Definition at line 144 of file fb_base.h.

Properties

◆ flags

Qt::WindowFlags QFbWindow::flags
protected

Definition at line 150 of file fb_base.h.

◆ mScreens

QList<QFbScreen *> QFbWindow::mScreens
protected

Definition at line 147 of file fb_base.h.

Referenced by QFbScreen::addWindow(), QFbScreen::removeWindow(), and ~QFbWindow().

◆ oldGeometry

QRect QFbWindow::oldGeometry
protected

Definition at line 148 of file fb_base.h.

◆ surface

QFbWindowSurface* QFbWindow::surface
protected

Definition at line 146 of file fb_base.h.

◆ visibleFlag

bool QFbWindow::visibleFlag
protected

Definition at line 149 of file fb_base.h.

◆ windowId

WId QFbWindow::windowId
protected

Definition at line 152 of file fb_base.h.

Referenced by QFbWindow().


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