Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/platformsupport/fbconvenience/qfbwindow.cpp |
Source code | Switch to Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | /**************************************************************************** | - | ||||||
2 | ** | - | ||||||
3 | ** Copyright (C) 2015 The Qt Company Ltd. | - | ||||||
4 | ** Contact: http://www.qt.io/licensing/ | - | ||||||
5 | ** | - | ||||||
6 | ** This file is part of the plugins of the Qt Toolkit. | - | ||||||
7 | ** | - | ||||||
8 | ** $QT_BEGIN_LICENSE:LGPL21$ | - | ||||||
9 | ** Commercial License Usage | - | ||||||
10 | ** Licensees holding valid commercial Qt licenses may use this file in | - | ||||||
11 | ** accordance with the commercial license agreement provided with the | - | ||||||
12 | ** Software or, alternatively, in accordance with the terms contained in | - | ||||||
13 | ** a written agreement between you and The Qt Company. For licensing terms | - | ||||||
14 | ** and conditions see http://www.qt.io/terms-conditions. For further | - | ||||||
15 | ** information use the contact form at http://www.qt.io/contact-us. | - | ||||||
16 | ** | - | ||||||
17 | ** GNU Lesser General Public License Usage | - | ||||||
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | - | ||||||
19 | ** General Public License version 2.1 or version 3 as published by the Free | - | ||||||
20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and | - | ||||||
21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the | - | ||||||
22 | ** following information to ensure the GNU Lesser General Public License | - | ||||||
23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and | - | ||||||
24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | - | ||||||
25 | ** | - | ||||||
26 | ** As a special exception, The Qt Company gives you certain additional | - | ||||||
27 | ** rights. These rights are described in The Qt Company LGPL Exception | - | ||||||
28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | - | ||||||
29 | ** | - | ||||||
30 | ** $QT_END_LICENSE$ | - | ||||||
31 | ** | - | ||||||
32 | ****************************************************************************/ | - | ||||||
33 | - | |||||||
34 | #include "qfbwindow_p.h" | - | ||||||
35 | #include "qfbscreen_p.h" | - | ||||||
36 | - | |||||||
37 | #include <QtGui/QScreen> | - | ||||||
38 | #include <qpa/qwindowsysteminterface.h> | - | ||||||
39 | - | |||||||
40 | QT_BEGIN_NAMESPACE | - | ||||||
41 | - | |||||||
42 | QFbWindow::QFbWindow(QWindow *window) | - | ||||||
43 | : QPlatformWindow(window), mBackingStore(0), mWindowState(Qt::WindowNoState) | - | ||||||
44 | { | - | ||||||
45 | static QAtomicInt winIdGenerator(1); | - | ||||||
46 | mWindowId = winIdGenerator.fetchAndAddRelaxed(1); | - | ||||||
47 | } never executed: end of block | 0 | ||||||
48 | - | |||||||
49 | QFbWindow::~QFbWindow() | - | ||||||
50 | { | - | ||||||
51 | } | - | ||||||
52 | - | |||||||
53 | QFbScreen *QFbWindow::platformScreen() const | - | ||||||
54 | { | - | ||||||
55 | return static_cast<QFbScreen *>(window()->screen()->handle()); never executed: return static_cast<QFbScreen *>(window()->screen()->handle()); | 0 | ||||||
56 | } | - | ||||||
57 | - | |||||||
58 | void QFbWindow::setGeometry(const QRect &rect) | - | ||||||
59 | { | - | ||||||
60 | // store previous geometry for screen update | - | ||||||
61 | mOldGeometry = geometry(); | - | ||||||
62 | - | |||||||
63 | platformScreen()->invalidateRectCache(); | - | ||||||
64 | QWindowSystemInterface::handleGeometryChange(window(), rect); | - | ||||||
65 | - | |||||||
66 | QPlatformWindow::setGeometry(rect); | - | ||||||
67 | } never executed: end of block | 0 | ||||||
68 | - | |||||||
69 | void QFbWindow::setVisible(bool visible) | - | ||||||
70 | { | - | ||||||
71 | if (visible) {
| 0 | ||||||
72 | if (mWindowState & Qt::WindowFullScreen)
| 0 | ||||||
73 | setGeometry(platformScreen()->geometry()); never executed: setGeometry(platformScreen()->geometry()); | 0 | ||||||
74 | else if (mWindowState & Qt::WindowMaximized)
| 0 | ||||||
75 | setGeometry(platformScreen()->availableGeometry()); never executed: setGeometry(platformScreen()->availableGeometry()); | 0 | ||||||
76 | } never executed: end of block | 0 | ||||||
77 | QPlatformWindow::setVisible(visible); | - | ||||||
78 | - | |||||||
79 | if (visible)
| 0 | ||||||
80 | platformScreen()->addWindow(this); never executed: platformScreen()->addWindow(this); | 0 | ||||||
81 | else | - | ||||||
82 | platformScreen()->removeWindow(this); never executed: platformScreen()->removeWindow(this); | 0 | ||||||
83 | } | - | ||||||
84 | - | |||||||
85 | - | |||||||
86 | void QFbWindow::setWindowState(Qt::WindowState state) | - | ||||||
87 | { | - | ||||||
88 | QPlatformWindow::setWindowState(state); | - | ||||||
89 | mWindowState = state; | - | ||||||
90 | platformScreen()->invalidateRectCache(); | - | ||||||
91 | } never executed: end of block | 0 | ||||||
92 | - | |||||||
93 | - | |||||||
94 | void QFbWindow::setWindowFlags(Qt::WindowFlags flags) | - | ||||||
95 | { | - | ||||||
96 | mWindowFlags = flags; | - | ||||||
97 | platformScreen()->invalidateRectCache(); | - | ||||||
98 | } never executed: end of block | 0 | ||||||
99 | - | |||||||
100 | Qt::WindowFlags QFbWindow::windowFlags() const | - | ||||||
101 | { | - | ||||||
102 | return mWindowFlags; never executed: return mWindowFlags; | 0 | ||||||
103 | } | - | ||||||
104 | - | |||||||
105 | void QFbWindow::raise() | - | ||||||
106 | { | - | ||||||
107 | platformScreen()->raise(this); | - | ||||||
108 | } never executed: end of block | 0 | ||||||
109 | - | |||||||
110 | void QFbWindow::lower() | - | ||||||
111 | { | - | ||||||
112 | platformScreen()->lower(this); | - | ||||||
113 | } never executed: end of block | 0 | ||||||
114 | - | |||||||
115 | void QFbWindow::repaint(const QRegion ®ion) | - | ||||||
116 | { | - | ||||||
117 | QRect currentGeometry = geometry(); | - | ||||||
118 | - | |||||||
119 | QRect dirtyClient = region.boundingRect(); | - | ||||||
120 | QRect dirtyRegion(currentGeometry.left() + dirtyClient.left(), | - | ||||||
121 | currentGeometry.top() + dirtyClient.top(), | - | ||||||
122 | dirtyClient.width(), | - | ||||||
123 | dirtyClient.height()); | - | ||||||
124 | QRect mOldGeometryLocal = mOldGeometry; | - | ||||||
125 | mOldGeometry = currentGeometry; | - | ||||||
126 | // If this is a move, redraw the previous location | - | ||||||
127 | if (mOldGeometryLocal != currentGeometry)
| 0 | ||||||
128 | platformScreen()->setDirty(mOldGeometryLocal); never executed: platformScreen()->setDirty(mOldGeometryLocal); | 0 | ||||||
129 | platformScreen()->setDirty(dirtyRegion); | - | ||||||
130 | } never executed: end of block | 0 | ||||||
131 | - | |||||||
132 | QT_END_NAMESPACE | - | ||||||
133 | - | |||||||
Source code | Switch to Preprocessed file |