source: trunk/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h

Last change on this file was 846, checked in by Dmitry A. Kuminov, 14 years ago

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

  • Property svn:eol-style set to native
File size: 3.9 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4** All rights reserved.
5** Contact: Nokia Corporation (qt-info@nokia.com)
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 qt-info@nokia.com.
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
58QT_BEGIN_HEADER
59
60QT_BEGIN_NAMESPACE
61
62QT_MODULE(Gui)
63
64class QDirectFBWindowSurface : public QWSWindowSurface, public QDirectFBPaintDevice
65{
66public:
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 &region, 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
99private:
100 void updateIsOpaque();
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;
117 bool flushPending;
118#ifdef QT_DIRECTFB_TIMING
119 int frames;
120 QTime timer;
121#endif
122};
123
124QT_END_NAMESPACE
125
126QT_END_HEADER
127
128#endif // QT_NO_QWS_DIRECTFB
129
130#endif // QDIRECFBWINDOWSURFACE_H
Note: See TracBrowser for help on using the repository browser.