| [556] | 1 | /****************************************************************************
|
|---|
| 2 | **
|
|---|
| [846] | 3 | ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
|---|
| [556] | 4 | ** All rights reserved.
|
|---|
| 5 | ** Contact: Nokia Corporation ([email protected])
|
|---|
| 6 | **
|
|---|
| 7 | ** This file is part of the plugins of the Qt Toolkit.
|
|---|
| 8 | **
|
|---|
| 9 | ** $QT_BEGIN_LICENSE:LGPL$
|
|---|
| 10 | ** Commercial Usage
|
|---|
| 11 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
|---|
| 12 | ** accordance with the Qt Commercial License Agreement provided with the
|
|---|
| 13 | ** Software or, alternatively, in accordance with the terms contained in
|
|---|
| 14 | ** a written agreement between you and Nokia.
|
|---|
| 15 | **
|
|---|
| 16 | ** GNU Lesser General Public License Usage
|
|---|
| 17 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
|---|
| 18 | ** General Public License version 2.1 as published by the Free Software
|
|---|
| 19 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
|---|
| 20 | ** packaging of this file. Please review the following information to
|
|---|
| 21 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
|---|
| 22 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|---|
| 23 | **
|
|---|
| 24 | ** In addition, as a special exception, Nokia gives you certain additional
|
|---|
| 25 | ** rights. These rights are described in the Nokia Qt LGPL Exception
|
|---|
| 26 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|---|
| 27 | **
|
|---|
| 28 | ** GNU General Public License Usage
|
|---|
| 29 | ** Alternatively, this file may be used under the terms of the GNU
|
|---|
| 30 | ** General Public License version 3.0 as published by the Free Software
|
|---|
| 31 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
|---|
| 32 | ** packaging of this file. Please review the following information to
|
|---|
| 33 | ** ensure the GNU General Public License version 3.0 requirements will be
|
|---|
| 34 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
|---|
| 35 | **
|
|---|
| 36 | ** If you have questions regarding the use of this file, please contact
|
|---|
| 37 | ** Nokia at [email protected].
|
|---|
| 38 | ** $QT_END_LICENSE$
|
|---|
| 39 | **
|
|---|
| 40 | ****************************************************************************/
|
|---|
| 41 |
|
|---|
| 42 | #ifndef QDIRECFBWINDOWSURFACE_H
|
|---|
| 43 | #define QDIRECFBWINDOWSURFACE_H
|
|---|
| 44 |
|
|---|
| 45 | #include "qdirectfbpaintengine.h"
|
|---|
| 46 | #include "qdirectfbpaintdevice.h"
|
|---|
| 47 | #include "qdirectfbscreen.h"
|
|---|
| 48 |
|
|---|
| 49 | #ifndef QT_NO_QWS_DIRECTFB
|
|---|
| 50 |
|
|---|
| 51 | #include <private/qpaintengine_raster_p.h>
|
|---|
| 52 | #include <private/qwindowsurface_qws_p.h>
|
|---|
| 53 |
|
|---|
| 54 | #ifdef QT_DIRECTFB_TIMING
|
|---|
| 55 | #include <qdatetime.h>
|
|---|
| 56 | #endif
|
|---|
| 57 |
|
|---|
| 58 | QT_BEGIN_HEADER
|
|---|
| 59 |
|
|---|
| 60 | QT_BEGIN_NAMESPACE
|
|---|
| 61 |
|
|---|
| 62 | QT_MODULE(Gui)
|
|---|
| 63 |
|
|---|
| 64 | class QDirectFBWindowSurface : public QWSWindowSurface, public QDirectFBPaintDevice
|
|---|
| 65 | {
|
|---|
| 66 | public:
|
|---|
| 67 | QDirectFBWindowSurface(DFBSurfaceFlipFlags flipFlags, QDirectFBScreen *scr);
|
|---|
| 68 | QDirectFBWindowSurface(DFBSurfaceFlipFlags flipFlags, QDirectFBScreen *scr, QWidget *widget);
|
|---|
| 69 | ~QDirectFBWindowSurface();
|
|---|
| 70 |
|
|---|
| 71 | #ifdef QT_DIRECTFB_WM
|
|---|
| 72 | void raise();
|
|---|
| 73 | #endif
|
|---|
| 74 | bool isValid() const;
|
|---|
| 75 |
|
|---|
| 76 | void setGeometry(const QRect &rect);
|
|---|
| 77 |
|
|---|
| 78 | QString key() const { return QLatin1String("directfb"); }
|
|---|
| 79 | QByteArray permanentState() const;
|
|---|
| 80 | void setPermanentState(const QByteArray &state);
|
|---|
| 81 |
|
|---|
| 82 | bool scroll(const QRegion &area, int dx, int dy);
|
|---|
| 83 |
|
|---|
| 84 | bool move(const QPoint &offset);
|
|---|
| 85 |
|
|---|
| 86 | QImage image() const { return QImage(); }
|
|---|
| 87 | QPaintDevice *paintDevice() { return this; }
|
|---|
| 88 |
|
|---|
| 89 | void flush(QWidget *widget, const QRegion ®ion, const QPoint &offset);
|
|---|
| 90 |
|
|---|
| 91 | void beginPaint(const QRegion &);
|
|---|
| 92 | void endPaint(const QRegion &);
|
|---|
| 93 |
|
|---|
| 94 | IDirectFBSurface *surfaceForWidget(const QWidget *widget, QRect *rect) const;
|
|---|
| 95 | IDirectFBSurface *directFBSurface() const;
|
|---|
| 96 | #ifdef QT_DIRECTFB_WM
|
|---|
| 97 | IDirectFBWindow *directFBWindow() const;
|
|---|
| 98 | #endif
|
|---|
| 99 | private:
|
|---|
| [769] | 100 | void updateIsOpaque();
|
|---|
| [556] | 101 | void setOpaque(bool opaque);
|
|---|
| 102 | void releaseSurface();
|
|---|
| 103 | QDirectFBWindowSurface *sibling;
|
|---|
| 104 |
|
|---|
| 105 | #ifdef QT_DIRECTFB_WM
|
|---|
| 106 | void createWindow(const QRect &rect);
|
|---|
| 107 | IDirectFBWindow *dfbWindow;
|
|---|
| 108 | #else
|
|---|
| 109 | enum Mode {
|
|---|
| 110 | Primary,
|
|---|
| 111 | Offscreen
|
|---|
| 112 | } mode;
|
|---|
| 113 | #endif
|
|---|
| 114 |
|
|---|
| 115 | DFBSurfaceFlipFlags flipFlags;
|
|---|
| 116 | bool boundingRectFlip;
|
|---|
| [769] | 117 | bool flushPending;
|
|---|
| [556] | 118 | #ifdef QT_DIRECTFB_TIMING
|
|---|
| 119 | int frames;
|
|---|
| 120 | QTime timer;
|
|---|
| 121 | #endif
|
|---|
| 122 | };
|
|---|
| 123 |
|
|---|
| 124 | QT_END_NAMESPACE
|
|---|
| 125 |
|
|---|
| 126 | QT_END_HEADER
|
|---|
| 127 |
|
|---|
| 128 | #endif // QT_NO_QWS_DIRECTFB
|
|---|
| 129 |
|
|---|
| 130 | #endif // QDIRECFBWINDOWSURFACE_H
|
|---|