author | Eckhart Koeppen <eckhart.koppen@nokia.com> |
Wed, 21 Apr 2010 11:15:19 +0300 | |
branch | RCL_3 |
changeset 11 | 25a739ee40f4 |
parent 7 | 3f74d0d4af4c |
permissions | -rw-r--r-- |
0 | 1 |
/**************************************************************************** |
2 |
** |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
3 |
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 4 |
** All rights reserved. |
5 |
** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 |
** |
|
7 |
** This file is part of the QtGui module of the Qt Toolkit. |
|
8 |
** |
|
9 |
** $QT_BEGIN_LICENSE:LGPL$ |
|
10 |
** No Commercial Usage |
|
11 |
** This file contains pre-release code and may not be distributed. |
|
12 |
** You may use this file in accordance with the terms and conditions |
|
13 |
** contained in the Technology Preview License Agreement accompanying |
|
14 |
** this package. |
|
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 |
** If you have questions regarding the use of this file, please contact |
|
29 |
** Nokia at qt-info@nokia.com. |
|
30 |
** |
|
31 |
** |
|
32 |
** |
|
33 |
** |
|
34 |
** |
|
35 |
** |
|
36 |
** |
|
37 |
** |
|
38 |
** $QT_END_LICENSE$ |
|
39 |
** |
|
40 |
****************************************************************************/ |
|
41 |
||
42 |
#ifndef QWIDGET_P_H |
|
43 |
#define QWIDGET_P_H |
|
44 |
||
45 |
// |
|
46 |
// W A R N I N G |
|
47 |
// ------------- |
|
48 |
// |
|
49 |
// This file is not part of the Qt API. It exists for the convenience |
|
50 |
// of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header |
|
51 |
// file may change from version to version without notice, or even be removed. |
|
52 |
// |
|
53 |
// We mean it. |
|
54 |
// |
|
55 |
||
56 |
#include "QtGui/qwidget.h" |
|
57 |
#include "private/qobject_p.h" |
|
58 |
#include "QtCore/qrect.h" |
|
59 |
#include "QtCore/qlocale.h" |
|
60 |
#include "QtCore/qset.h" |
|
61 |
#include "QtGui/qregion.h" |
|
62 |
#include "QtGui/qsizepolicy.h" |
|
63 |
#include "QtGui/qstyle.h" |
|
64 |
#include "QtGui/qapplication.h" |
|
65 |
#include <private/qgraphicseffect_p.h> |
|
66 |
#include "QtGui/qgraphicsproxywidget.h" |
|
67 |
#include "QtGui/qgraphicsscene.h" |
|
68 |
#include "QtGui/qgraphicsview.h" |
|
69 |
#include <private/qgesture_p.h> |
|
70 |
||
71 |
#ifdef Q_WS_WIN |
|
72 |
#include "QtCore/qt_windows.h" |
|
73 |
#include <private/qdnd_p.h> |
|
74 |
#endif // Q_WS_WIN |
|
75 |
||
76 |
#ifdef Q_WS_X11 |
|
77 |
#include "QtGui/qx11info_x11.h" |
|
78 |
#endif |
|
79 |
||
80 |
#ifdef Q_WS_MAC |
|
81 |
#include <private/qt_mac_p.h> |
|
82 |
#endif |
|
83 |
||
84 |
#if defined(Q_WS_QWS) |
|
85 |
#include "QtGui/qinputcontext.h" |
|
86 |
#include "QtGui/qscreen_qws.h" |
|
87 |
#endif |
|
88 |
||
89 |
#if defined(Q_OS_SYMBIAN) |
|
90 |
class RDrawableWindow; |
|
91 |
class CCoeControl; |
|
92 |
#endif |
|
93 |
||
94 |
QT_BEGIN_NAMESPACE |
|
95 |
||
96 |
// Extra QWidget data |
|
97 |
// - to minimize memory usage for members that are seldom used. |
|
98 |
// - top-level widgets have extra extra data to reduce cost further |
|
99 |
#if defined(Q_WS_QWS) |
|
100 |
class QWSManager; |
|
101 |
#endif |
|
102 |
#if defined(Q_WS_MAC) |
|
103 |
class QCoreGraphicsPaintEnginePrivate; |
|
104 |
#endif |
|
105 |
class QPaintEngine; |
|
106 |
class QPixmap; |
|
107 |
class QWidgetBackingStore; |
|
108 |
class QGraphicsProxyWidget; |
|
109 |
class QWidgetItemV2; |
|
110 |
||
111 |
class QStyle; |
|
112 |
||
113 |
struct QTLWExtra { |
|
114 |
// *************************** Cross-platform variables ***************************** |
|
115 |
||
116 |
// Regular pointers (keep them together to avoid gaps on 64 bits architectures). |
|
117 |
QIcon *icon; // widget icon |
|
118 |
QPixmap *iconPixmap; |
|
119 |
QWidgetBackingStore *backingStore; |
|
120 |
QWindowSurface *windowSurface; |
|
121 |
QPainter *sharedPainter; |
|
122 |
||
123 |
// Implicit pointers (shared_null). |
|
124 |
QString caption; // widget caption |
|
125 |
QString iconText; // widget icon text |
|
126 |
QString role; // widget role |
|
127 |
QString filePath; // widget file path |
|
128 |
||
129 |
// Other variables. |
|
130 |
short incw, inch; // size increments |
|
131 |
short basew, baseh; // base sizes |
|
132 |
// frame strut, don't use these directly, use QWidgetPrivate::frameStrut() instead. |
|
133 |
QRect frameStrut; |
|
134 |
QRect normalGeometry; // used by showMin/maximized/FullScreen |
|
135 |
Qt::WindowFlags savedFlags; // Save widget flags while showing fullscreen |
|
136 |
||
137 |
// *************************** Cross-platform bit fields **************************** |
|
138 |
uint opacity : 8; |
|
139 |
uint posFromMove : 1; |
|
140 |
uint sizeAdjusted : 1; |
|
141 |
uint inTopLevelResize : 1; |
|
142 |
uint inRepaint : 1; |
|
143 |
uint embedded : 1; |
|
144 |
||
145 |
// *************************** Platform specific values (bit fields first) ********** |
|
146 |
#if defined(Q_WS_X11) // <----------------------------------------------------------- X11 |
|
147 |
uint spont_unmapped: 1; // window was spontaneously unmapped |
|
148 |
uint dnd : 1; // DND properties installed |
|
149 |
uint validWMState : 1; // is WM_STATE valid? |
|
150 |
uint waitingForMapNotify : 1; // show() has been called, haven't got the MapNotify yet |
|
151 |
WId parentWinId; // parent window Id (valid after reparenting) |
|
152 |
WId userTimeWindow; // window id that contains user-time timestamp when WM supports a _NET_WM_USER_TIME_WINDOW atom |
|
153 |
QPoint fullScreenOffset; |
|
154 |
#ifndef QT_NO_XSYNC |
|
155 |
WId syncUpdateCounter; |
|
156 |
ulong syncRequestTimestamp; |
|
157 |
qint32 newCounterValueHi; |
|
158 |
quint32 newCounterValueLo; |
|
159 |
#endif |
|
160 |
#elif defined(Q_WS_WIN) // <--------------------------------------------------------- WIN |
|
161 |
HICON winIconBig; // internal big Windows icon |
|
162 |
HICON winIconSmall; // internal small Windows icon |
|
163 |
#elif defined(Q_WS_MAC) // <--------------------------------------------------------- MAC |
|
164 |
uint resizer : 4; |
|
165 |
uint isSetGeometry : 1; |
|
166 |
uint isMove : 1; |
|
167 |
quint32 wattr; |
|
168 |
quint32 wclass; |
|
169 |
WindowGroupRef group; |
|
170 |
IconRef windowIcon; // the current window icon, if set with setWindowIcon_sys. |
|
171 |
quint32 savedWindowAttributesFromMaximized; // Saved attributes from when the calling updateMaximizeButton_sys() |
|
172 |
#elif defined(Q_WS_QWS) // <--------------------------------------------------------- QWS |
|
173 |
#ifndef QT_NO_QWS_MANAGER |
|
174 |
QWSManager *qwsManager; |
|
175 |
#endif |
|
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
176 |
#elif defined(Q_OS_SYMBIAN) |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
177 |
uint inExpose : 1; // Prevents drawing recursion |
0 | 178 |
#endif |
179 |
}; |
|
180 |
||
181 |
struct QWExtra { |
|
182 |
// *************************** Cross-platform variables ***************************** |
|
183 |
||
184 |
// Regular pointers (keep them together to avoid gaps on 64 bits architectures). |
|
185 |
void *glContext; // if the widget is hijacked by QGLWindowSurface |
|
186 |
QTLWExtra *topextra; // only useful for TLWs |
|
187 |
#ifndef QT_NO_GRAPHICSVIEW |
|
188 |
QGraphicsProxyWidget *proxyWidget; // if the widget is embedded |
|
189 |
#endif |
|
190 |
#ifndef QT_NO_CURSOR |
|
191 |
QCursor *curs; |
|
192 |
#endif |
|
193 |
QPointer<QStyle> style; |
|
194 |
QPointer<QWidget> focus_proxy; |
|
195 |
||
196 |
// Implicit pointers (shared_empty/shared_null). |
|
197 |
QRegion mask; // widget mask |
|
198 |
QString styleSheet; |
|
199 |
||
200 |
// Other variables. |
|
201 |
qint32 minw; |
|
202 |
qint32 minh; // minimum size |
|
203 |
qint32 maxw; |
|
204 |
qint32 maxh; // maximum size |
|
205 |
quint16 customDpiX; |
|
206 |
quint16 customDpiY; |
|
207 |
QSize staticContentsSize; |
|
208 |
||
209 |
// *************************** Cross-platform bit fields **************************** |
|
210 |
uint explicitMinSize : 2; |
|
211 |
uint explicitMaxSize : 2; |
|
212 |
uint autoFillBackground : 1; |
|
213 |
uint nativeChildrenForced : 1; |
|
214 |
uint inRenderWithPainter : 1; |
|
215 |
uint hasMask : 1; |
|
216 |
||
217 |
// *************************** Platform specific values (bit fields first) ********** |
|
218 |
#if defined(Q_WS_WIN) // <----------------------------------------------------------- WIN |
|
219 |
#ifndef QT_NO_DRAGANDDROP |
|
220 |
QOleDropTarget *dropTarget; // drop target |
|
221 |
QList<QPointer<QWidget> > oleDropWidgets; |
|
222 |
#endif |
|
223 |
#elif defined(Q_WS_X11) // <--------------------------------------------------------- X11 |
|
224 |
uint compress_events : 1; |
|
225 |
WId xDndProxy; // XDND forwarding to embedded windows |
|
226 |
#elif defined(Q_WS_MAC) // <------------------------------------------------------ MAC |
|
227 |
#ifdef QT_MAC_USE_COCOA |
|
228 |
// Cocoa Mask stuff |
|
229 |
QImage maskBits; |
|
230 |
CGImageRef imageMask; |
|
231 |
#endif |
|
232 |
#elif defined(Q_OS_SYMBIAN) // <----------------------------------------------------- Symbian |
|
233 |
uint activated : 1; // RWindowBase::Activated has been called |
|
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
234 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
235 |
/** |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
236 |
* If this bit is set, each native widget receives the signals from the |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
237 |
* Symbian control immediately before and immediately after draw ops are |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
238 |
* sent to the window server for this control: |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
239 |
* void beginNativePaintEvent(const QRect &paintRect); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
240 |
* void endNativePaintEvent(const QRect &paintRect); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
241 |
*/ |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
242 |
uint receiveNativePaintEvents : 1; |
0 | 243 |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
244 |
/** |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
245 |
* Defines the behaviour of QSymbianControl::Draw. |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
246 |
*/ |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
247 |
enum NativePaintMode { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
248 |
/** |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
249 |
* Normal drawing mode: blits the required region of the backing store |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
250 |
* via WSERV. |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
251 |
*/ |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
252 |
Blit, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
253 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
254 |
/** |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
255 |
* Disable drawing for this widget. |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
256 |
*/ |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
257 |
Disable, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
258 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
259 |
/** |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
260 |
* Paint zeros into the WSERV framebuffer, using BitGDI APIs. For windows |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
261 |
* with an EColor16MU display mode, zero is written only into the R, G and B |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
262 |
* channels of the pixel. |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
263 |
*/ |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
264 |
ZeroFill, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
265 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
266 |
Default = Blit |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
267 |
}; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
268 |
|
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
269 |
NativePaintMode nativePaintMode; |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
270 |
|
0 | 271 |
#endif |
272 |
}; |
|
273 |
||
274 |
/*! |
|
275 |
\internal |
|
276 |
||
277 |
Returns true if \a p or any of its parents enable the |
|
278 |
Qt::BypassGraphicsProxyWidget window flag. Used in QWidget::show() and |
|
279 |
QWidget::setParent() to determine whether it's necessary to embed the |
|
280 |
widget into a QGraphicsProxyWidget or not. |
|
281 |
*/ |
|
282 |
static inline bool bypassGraphicsProxyWidget(const QWidget *p) |
|
283 |
{ |
|
284 |
while (p) { |
|
285 |
if (p->windowFlags() & Qt::BypassGraphicsProxyWidget) |
|
286 |
return true; |
|
287 |
p = p->parentWidget(); |
|
288 |
} |
|
289 |
return false; |
|
290 |
} |
|
291 |
||
292 |
class Q_GUI_EXPORT QWidgetPrivate : public QObjectPrivate |
|
293 |
{ |
|
294 |
Q_DECLARE_PUBLIC(QWidget) |
|
295 |
||
296 |
public: |
|
297 |
// *************************** Cross-platform *************************************** |
|
298 |
enum DrawWidgetFlags { |
|
299 |
DrawAsRoot = 0x01, |
|
300 |
DrawPaintOnScreen = 0x02, |
|
301 |
DrawRecursive = 0x04, |
|
302 |
DrawInvisible = 0x08, |
|
303 |
DontSubtractOpaqueChildren = 0x10, |
|
304 |
DontSetCompositionMode = 0x20, |
|
305 |
DontDrawOpaqueChildren = 0x40 |
|
306 |
}; |
|
307 |
||
308 |
enum CloseMode { |
|
309 |
CloseNoEvent, |
|
310 |
CloseWithEvent, |
|
311 |
CloseWithSpontaneousEvent |
|
312 |
}; |
|
313 |
||
314 |
enum Direction { |
|
315 |
DirectionNorth = 0x01, |
|
316 |
DirectionEast = 0x10, |
|
317 |
DirectionSouth = 0x02, |
|
318 |
DirectionWest = 0x20 |
|
319 |
}; |
|
320 |
||
321 |
// Functions. |
|
322 |
explicit QWidgetPrivate(int version = QObjectPrivateVersion); |
|
323 |
~QWidgetPrivate(); |
|
324 |
||
325 |
QWExtra *extraData() const; |
|
326 |
QTLWExtra *topData() const; |
|
327 |
QTLWExtra *maybeTopData() const; |
|
328 |
QPainter *sharedPainter() const; |
|
329 |
void setSharedPainter(QPainter *painter); |
|
330 |
QWidgetBackingStore *maybeBackingStore() const; |
|
331 |
void init(QWidget *desktopWidget, Qt::WindowFlags f); |
|
332 |
void create_sys(WId window, bool initializeWindow, bool destroyOldWindow); |
|
333 |
void createRecursively(); |
|
334 |
void createWinId(WId id = 0); |
|
335 |
||
336 |
void createTLExtra(); |
|
337 |
void createExtra(); |
|
338 |
void deleteExtra(); |
|
339 |
void createSysExtra(); |
|
340 |
void deleteSysExtra(); |
|
341 |
void createTLSysExtra(); |
|
342 |
void deleteTLSysExtra(); |
|
343 |
void updateSystemBackground(); |
|
344 |
void propagatePaletteChange(); |
|
345 |
||
346 |
void setPalette_helper(const QPalette &); |
|
347 |
void resolvePalette(); |
|
348 |
QPalette naturalWidgetPalette(uint inheritedMask) const; |
|
349 |
||
350 |
void setMask_sys(const QRegion &); |
|
351 |
#ifdef Q_OS_SYMBIAN |
|
352 |
void setSoftKeys_sys(const QList<QAction*> &softkeys); |
|
353 |
void activateSymbianWindow(WId wid = 0); |
|
354 |
void _q_delayedDestroy(WId winId); |
|
355 |
#endif |
|
356 |
||
357 |
void raise_sys(); |
|
358 |
void lower_sys(); |
|
359 |
void stackUnder_sys(QWidget *); |
|
360 |
||
361 |
void setFocus_sys(); |
|
362 |
||
363 |
void updateFont(const QFont &); |
|
364 |
inline void setFont_helper(const QFont &font) { |
|
365 |
if (data.fnt == font && data.fnt.resolve() == font.resolve()) |
|
366 |
return; |
|
367 |
updateFont(font); |
|
368 |
} |
|
369 |
void resolveFont(); |
|
370 |
QFont naturalWidgetFont(uint inheritedMask) const; |
|
371 |
||
372 |
void setLayoutDirection_helper(Qt::LayoutDirection); |
|
373 |
void resolveLayoutDirection(); |
|
374 |
||
375 |
void setLocale_helper(const QLocale &l, bool forceUpdate = false); |
|
376 |
void resolveLocale(); |
|
377 |
||
378 |
void setStyle_helper(QStyle *newStyle, bool propagate, bool metalHack = false); |
|
379 |
void inheritStyle(); |
|
380 |
||
381 |
void setUpdatesEnabled_helper(bool ); |
|
382 |
||
383 |
void paintBackground(QPainter *, const QRegion &, int flags = DrawAsRoot) const; |
|
384 |
bool isAboutToShow() const; |
|
385 |
QRegion prepareToRender(const QRegion ®ion, QWidget::RenderFlags renderFlags); |
|
386 |
void render_helper(QPainter *painter, const QPoint &targetOffset, const QRegion &sourceRegion, |
|
387 |
QWidget::RenderFlags renderFlags); |
|
388 |
void drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QPoint &offset, int flags, |
|
389 |
QPainter *sharedPainter = 0, QWidgetBackingStore *backingStore = 0); |
|
390 |
||
391 |
||
392 |
void paintSiblingsRecursive(QPaintDevice *pdev, const QObjectList& children, int index, |
|
393 |
const QRegion &rgn, const QPoint &offset, int flags |
|
394 |
#ifdef Q_BACKINGSTORE_SUBSURFACES |
|
395 |
, const QWindowSurface *currentSurface |
|
396 |
#endif |
|
397 |
, QPainter *sharedPainter, QWidgetBackingStore *backingStore); |
|
398 |
||
399 |
||
400 |
QPainter *beginSharedPainter(); |
|
401 |
bool endSharedPainter(); |
|
402 |
#ifndef QT_NO_GRAPHICSVIEW |
|
403 |
static QGraphicsProxyWidget * nearestGraphicsProxyWidget(const QWidget *origin); |
|
404 |
#endif |
|
405 |
QWindowSurface *createDefaultWindowSurface(); |
|
406 |
QWindowSurface *createDefaultWindowSurface_sys(); |
|
407 |
void repaint_sys(const QRegion &rgn); |
|
408 |
||
409 |
QRect clipRect() const; |
|
410 |
QRegion clipRegion() const; |
|
411 |
void subtractOpaqueChildren(QRegion &rgn, const QRect &clipRect) const; |
|
412 |
void subtractOpaqueSiblings(QRegion &source, bool *hasDirtySiblingsAbove = 0, |
|
413 |
bool alsoNonOpaque = false) const; |
|
414 |
void clipToEffectiveMask(QRegion ®ion) const; |
|
415 |
void updateIsOpaque(); |
|
416 |
void setOpaque(bool opaque); |
|
417 |
void updateIsTranslucent(); |
|
418 |
bool paintOnScreen() const; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
419 |
#ifndef QT_NO_GRAPHICSEFFECT |
0 | 420 |
void invalidateGraphicsEffectsRecursively(); |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
421 |
#endif //QT_NO_GRAPHICSEFFECT |
0 | 422 |
|
423 |
const QRegion &getOpaqueChildren() const; |
|
424 |
void setDirtyOpaqueRegion(); |
|
425 |
||
426 |
bool close_helper(CloseMode mode); |
|
427 |
||
428 |
void setWindowIcon_helper(); |
|
429 |
void setWindowIcon_sys(bool forceReset = false); |
|
430 |
void setWindowOpacity_sys(qreal opacity); |
|
431 |
void adjustQuitOnCloseAttribute(); |
|
432 |
||
433 |
void scrollChildren(int dx, int dy); |
|
434 |
void moveRect(const QRect &, int dx, int dy); |
|
435 |
void scrollRect(const QRect &, int dx, int dy); |
|
436 |
void invalidateBuffer_resizeHelper(const QPoint &oldPos, const QSize &oldSize); |
|
437 |
// ### Qt 4.6: Merge into a template function (after MSVC isn't supported anymore). |
|
438 |
void invalidateBuffer(const QRegion &); |
|
439 |
void invalidateBuffer(const QRect &); |
|
440 |
bool isOverlapped(const QRect&) const; |
|
441 |
void syncBackingStore(); |
|
442 |
void syncBackingStore(const QRegion ®ion); |
|
443 |
||
444 |
void reparentFocusWidgets(QWidget *oldtlw); |
|
445 |
||
446 |
static int pointToRect(const QPoint &p, const QRect &r); |
|
447 |
||
448 |
void setWinId(WId); |
|
449 |
void showChildren(bool spontaneous); |
|
450 |
void hideChildren(bool spontaneous); |
|
451 |
void setParent_sys(QWidget *parent, Qt::WindowFlags); |
|
452 |
void scroll_sys(int dx, int dy); |
|
453 |
void scroll_sys(int dx, int dy, const QRect &r); |
|
454 |
void deactivateWidgetCleanup(); |
|
455 |
void setGeometry_sys(int, int, int, int, bool); |
|
456 |
void sendPendingMoveAndResizeEvents(bool recursive = false, bool disableUpdates = false); |
|
457 |
void activateChildLayoutsRecursively(); |
|
458 |
void show_recursive(); |
|
459 |
void show_helper(); |
|
460 |
void show_sys(); |
|
461 |
void hide_sys(); |
|
462 |
void hide_helper(); |
|
463 |
void _q_showIfNotHidden(); |
|
464 |
||
465 |
void setEnabled_helper(bool); |
|
466 |
void registerDropSite(bool); |
|
467 |
static void adjustFlags(Qt::WindowFlags &flags, QWidget *w = 0); |
|
468 |
||
469 |
void updateFrameStrut(); |
|
470 |
QRect frameStrut() const; |
|
471 |
||
472 |
#ifdef QT_KEYPAD_NAVIGATION |
|
473 |
static bool navigateToDirection(Direction direction); |
|
474 |
static QWidget *widgetInNavigationDirection(Direction direction); |
|
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
475 |
static bool canKeypadNavigate(Qt::Orientation orientation); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
476 |
static bool inTabWidget(QWidget *widget); |
0 | 477 |
#endif |
478 |
||
479 |
void setWindowIconText_sys(const QString &cap); |
|
480 |
void setWindowIconText_helper(const QString &cap); |
|
481 |
void setWindowTitle_sys(const QString &cap); |
|
482 |
||
483 |
#ifndef QT_NO_CURSOR |
|
484 |
void setCursor_sys(const QCursor &cursor); |
|
485 |
void unsetCursor_sys(); |
|
486 |
#endif |
|
487 |
||
488 |
void setWindowTitle_helper(const QString &cap); |
|
489 |
void setWindowFilePath_helper(const QString &filePath); |
|
490 |
||
491 |
bool setMinimumSize_helper(int &minw, int &minh); |
|
492 |
bool setMaximumSize_helper(int &maxw, int &maxh); |
|
493 |
void setConstraints_sys(); |
|
494 |
QWidget *childAt_helper(const QPoint &, bool) const; |
|
495 |
void updateGeometry_helper(bool forceUpdate); |
|
496 |
||
497 |
void getLayoutItemMargins(int *left, int *top, int *right, int *bottom) const; |
|
498 |
void setLayoutItemMargins(int left, int top, int right, int bottom); |
|
499 |
void setLayoutItemMargins(QStyle::SubElement element, const QStyleOption *opt = 0); |
|
500 |
||
501 |
QInputContext *inputContext() const; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
502 |
inline QWidget *effectiveFocusWidget() { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
503 |
QWidget *w = q_func(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
504 |
while (w->focusProxy()) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
505 |
w = w->focusProxy(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
506 |
return w; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
507 |
} |
0 | 508 |
|
509 |
void setModal_sys(); |
|
510 |
||
511 |
// This is an helper function that return the available geometry for |
|
512 |
// a widget and takes care is this one is in QGraphicsView. |
|
513 |
// If the widget is not embed in a scene then the geometry available is |
|
514 |
// null, we let QDesktopWidget decide for us. |
|
515 |
static QRect screenGeometry(const QWidget *widget) |
|
516 |
{ |
|
517 |
QRect screen; |
|
518 |
#ifndef QT_NO_GRAPHICSVIEW |
|
519 |
QGraphicsProxyWidget *ancestorProxy = widget->d_func()->nearestGraphicsProxyWidget(widget); |
|
520 |
//It's embedded if it has an ancestor |
|
521 |
if (ancestorProxy) { |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
522 |
if (!bypassGraphicsProxyWidget(widget) && ancestorProxy->scene() != 0) { |
0 | 523 |
// One view, let be smart and return the viewport rect then the popup is aligned |
524 |
if (ancestorProxy->scene()->views().size() == 1) { |
|
525 |
QGraphicsView *view = ancestorProxy->scene()->views().at(0); |
|
526 |
screen = view->mapToScene(view->viewport()->rect()).boundingRect().toRect(); |
|
527 |
} else { |
|
528 |
screen = ancestorProxy->scene()->sceneRect().toRect(); |
|
529 |
} |
|
530 |
} |
|
531 |
} |
|
532 |
#endif |
|
533 |
return screen; |
|
534 |
} |
|
535 |
||
536 |
inline void setRedirected(QPaintDevice *replacement, const QPoint &offset) |
|
537 |
{ |
|
538 |
Q_ASSERT(q_func()->testAttribute(Qt::WA_WState_InPaintEvent)); |
|
539 |
redirectDev = replacement; |
|
540 |
redirectOffset = offset; |
|
541 |
} |
|
542 |
||
543 |
inline QPaintDevice *redirected(QPoint *offset) const |
|
544 |
{ |
|
545 |
if (offset) |
|
546 |
*offset = redirectDev ? redirectOffset : QPoint(); |
|
547 |
return redirectDev; |
|
548 |
} |
|
549 |
||
550 |
inline void restoreRedirected() |
|
551 |
{ redirectDev = 0; } |
|
552 |
||
553 |
inline void enforceNativeChildren() |
|
554 |
{ |
|
555 |
if (!extra) |
|
556 |
createExtra(); |
|
557 |
||
558 |
if (extra->nativeChildrenForced) |
|
559 |
return; |
|
560 |
extra->nativeChildrenForced = 1; |
|
561 |
||
562 |
for (int i = 0; i < children.size(); ++i) { |
|
563 |
if (QWidget *child = qobject_cast<QWidget *>(children.at(i))) |
|
564 |
child->setAttribute(Qt::WA_NativeWindow); |
|
565 |
} |
|
566 |
} |
|
567 |
||
568 |
inline bool nativeChildrenForced() const |
|
569 |
{ |
|
570 |
return extra ? extra->nativeChildrenForced : false; |
|
571 |
} |
|
572 |
||
573 |
inline QRect effectiveRectFor(const QRect &rect) const |
|
574 |
{ |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
575 |
#ifndef QT_NO_GRAPHICSEFFECT |
0 | 576 |
if (graphicsEffect && graphicsEffect->isEnabled()) |
577 |
return graphicsEffect->boundingRectFor(rect).toAlignedRect(); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
578 |
#endif //QT_NO_GRAPHICSEFFECT |
0 | 579 |
return rect; |
580 |
} |
|
581 |
||
582 |
QSize adjustedSize() const; |
|
583 |
||
584 |
inline void handleSoftwareInputPanel(Qt::MouseButton button, bool clickCausedFocus) |
|
585 |
{ |
|
586 |
Q_Q(QWidget); |
|
587 |
if (button == Qt::LeftButton && qApp->autoSipEnabled()) { |
|
588 |
QStyle::RequestSoftwareInputPanel behavior = QStyle::RequestSoftwareInputPanel( |
|
589 |
q->style()->styleHint(QStyle::SH_RequestSoftwareInputPanel)); |
|
590 |
if (!clickCausedFocus || behavior == QStyle::RSIP_OnMouseClick) { |
|
591 |
QEvent event(QEvent::RequestSoftwareInputPanel); |
|
592 |
QApplication::sendEvent(q, &event); |
|
593 |
} |
|
594 |
} |
|
595 |
} |
|
596 |
||
597 |
#ifndef Q_WS_QWS // Almost cross-platform :-) |
|
598 |
void setWSGeometry(bool dontShow=false, const QRect &oldRect = QRect()); |
|
599 |
||
600 |
inline QPoint mapToWS(const QPoint &p) const |
|
601 |
{ return p - data.wrect.topLeft(); } |
|
602 |
||
603 |
inline QPoint mapFromWS(const QPoint &p) const |
|
604 |
{ return p + data.wrect.topLeft(); } |
|
605 |
||
606 |
inline QRect mapToWS(const QRect &r) const |
|
607 |
{ QRect rr(r); rr.translate(-data.wrect.topLeft()); return rr; } |
|
608 |
||
609 |
inline QRect mapFromWS(const QRect &r) const |
|
610 |
{ QRect rr(r); rr.translate(data.wrect.topLeft()); return rr; } |
|
611 |
#endif |
|
612 |
||
613 |
// Variables. |
|
614 |
// Regular pointers (keep them together to avoid gaps on 64 bit architectures). |
|
615 |
QWExtra *extra; |
|
616 |
QWidget *focus_next; |
|
617 |
QWidget *focus_prev; |
|
618 |
QWidget *focus_child; |
|
619 |
QLayout *layout; |
|
620 |
QRegion *needsFlush; |
|
621 |
QPaintDevice *redirectDev; |
|
622 |
QWidgetItemV2 *widgetItem; |
|
623 |
QPaintEngine *extraPaintEngine; |
|
624 |
mutable const QMetaObject *polished; |
|
625 |
QGraphicsEffect *graphicsEffect; |
|
626 |
// All widgets are added into the allWidgets set. Once |
|
627 |
// they receive a window id they are also added to the mapper. |
|
628 |
// This should just ensure that all widgets are deleted by QApplication |
|
629 |
static QWidgetMapper *mapper; |
|
630 |
static QWidgetSet *allWidgets; |
|
631 |
#if !defined(QT_NO_IM) |
|
632 |
QPointer<QInputContext> ic; |
|
633 |
Qt::InputMethodHints imHints; |
|
634 |
#endif |
|
635 |
#ifdef QT_KEYPAD_NAVIGATION |
|
636 |
static QPointer<QWidget> editingWidget; |
|
637 |
#endif |
|
638 |
||
639 |
// Implicit pointers (shared_null/shared_empty). |
|
640 |
QRegion opaqueChildren; |
|
641 |
QRegion dirty; |
|
642 |
#ifndef QT_NO_TOOLTIP |
|
643 |
QString toolTip; |
|
644 |
#endif |
|
645 |
#ifndef QT_NO_STATUSTIP |
|
646 |
QString statusTip; |
|
647 |
#endif |
|
648 |
#ifndef QT_NO_WHATSTHIS |
|
649 |
QString whatsThis; |
|
650 |
#endif |
|
651 |
#ifndef QT_NO_ACCESSIBILITY |
|
652 |
QString accessibleName; |
|
653 |
QString accessibleDescription; |
|
654 |
#endif |
|
655 |
||
656 |
// Other variables. |
|
657 |
uint inheritedFontResolveMask; |
|
658 |
uint inheritedPaletteResolveMask; |
|
659 |
short leftmargin; |
|
660 |
short topmargin; |
|
661 |
short rightmargin; |
|
662 |
short bottommargin; |
|
663 |
signed char leftLayoutItemMargin; |
|
664 |
signed char topLayoutItemMargin; |
|
665 |
signed char rightLayoutItemMargin; |
|
666 |
signed char bottomLayoutItemMargin; |
|
667 |
static int instanceCounter; // Current number of widget instances |
|
668 |
static int maxInstances; // Maximum number of widget instances |
|
669 |
Qt::HANDLE hd; |
|
670 |
QWidgetData data; |
|
671 |
QSizePolicy size_policy; |
|
672 |
QLocale locale; |
|
673 |
QPoint redirectOffset; |
|
674 |
#ifndef QT_NO_ACTION |
|
675 |
QList<QAction*> actions; |
|
676 |
#endif |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
677 |
QMap<Qt::GestureType, Qt::GestureFlags> gestureContext; |
0 | 678 |
|
679 |
// Bit fields. |
|
680 |
uint high_attributes[3]; // the low ones are in QWidget::widget_attributes |
|
681 |
QPalette::ColorRole fg_role : 8; |
|
682 |
QPalette::ColorRole bg_role : 8; |
|
683 |
uint dirtyOpaqueChildren : 1; |
|
684 |
uint isOpaque : 1; |
|
685 |
uint inDirtyList : 1; |
|
686 |
uint isScrolled : 1; |
|
687 |
uint isMoved : 1; |
|
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
688 |
uint isGLWidget : 1; |
0 | 689 |
uint usesDoubleBufferedGLContext : 1; |
690 |
||
691 |
// *************************** Platform specific ************************************ |
|
692 |
#if defined(Q_WS_X11) // <----------------------------------------------------------- X11 |
|
693 |
QX11Info xinfo; |
|
694 |
Qt::HANDLE picture; |
|
695 |
static QWidget *mouseGrabber; |
|
696 |
static QWidget *keyboardGrabber; |
|
697 |
||
698 |
void setWindowRole(); |
|
699 |
void sendStartupMessage(const char *message) const; |
|
700 |
void setNetWmWindowTypes(); |
|
701 |
void x11UpdateIsOpaque(); |
|
702 |
bool isBackgroundInherited() const; |
|
703 |
#elif defined(Q_WS_WIN) // <--------------------------------------------------------- WIN |
|
704 |
uint noPaintOnScreen : 1; // see qwidget_win.cpp ::paintEngine() |
|
705 |
uint nativeGesturePanEnabled : 1; |
|
706 |
||
707 |
bool shouldShowMaximizeButton(); |
|
708 |
void winUpdateIsOpaque(); |
|
709 |
void reparentChildren(); |
|
710 |
#ifndef QT_NO_DRAGANDDROP |
|
711 |
QOleDropTarget *registerOleDnd(QWidget *widget); |
|
712 |
void unregisterOleDnd(QWidget *widget, QOleDropTarget *target); |
|
713 |
#endif |
|
714 |
void grabMouseWhileInWindow(); |
|
715 |
void registerTouchWindow(); |
|
716 |
void winSetupGestures(); |
|
717 |
#elif defined(Q_WS_MAC) // <--------------------------------------------------------- MAC |
|
718 |
// This is new stuff |
|
719 |
uint needWindowChange : 1; |
|
720 |
||
721 |
// Each wiget keeps a list of all its child and grandchild OpenGL widgets. |
|
722 |
// This list is used to update the gl context whenever a parent and a granparent |
|
723 |
// moves, and also to check for intersections with gl widgets within the window |
|
724 |
// when a widget moves. |
|
725 |
struct GlWidgetInfo |
|
726 |
{ |
|
727 |
GlWidgetInfo(QWidget *widget) : widget(widget), lastUpdateWidget(0) { } |
|
728 |
bool operator==(const GlWidgetInfo &other) const { return (widget == other.widget); } |
|
729 |
QWidget * widget; |
|
730 |
QWidget * lastUpdateWidget; |
|
731 |
}; |
|
732 |
||
733 |
// dirtyOnWidget contains the areas in the widget that needs to be repained, |
|
734 |
// in the same way as dirtyOnScreen does for the window. Areas are added in |
|
735 |
// dirtyWidget_sys and cleared in the paint event. In scroll_sys we then use |
|
736 |
// this information repaint invalid areas when widgets are scrolled. |
|
737 |
QRegion dirtyOnWidget; |
|
738 |
EventHandlerRef window_event; |
|
739 |
QList<GlWidgetInfo> glWidgets; |
|
740 |
||
741 |
//these are here just for code compat (HIViews) |
|
742 |
Qt::HANDLE qd_hd; |
|
743 |
||
744 |
void macUpdateSizeAttribute(); |
|
745 |
void macUpdateHideOnSuspend(); |
|
746 |
void macUpdateOpaqueSizeGrip(); |
|
747 |
void macUpdateIgnoreMouseEvents(); |
|
748 |
void macUpdateMetalAttribute(); |
|
749 |
void macUpdateIsOpaque(); |
|
750 |
void setEnabled_helper_sys(bool enable); |
|
751 |
bool isRealWindow() const; |
|
752 |
void adjustWithinMaxAndMinSize(int &w, int &h); |
|
753 |
void applyMaxAndMinSizeOnWindow(); |
|
754 |
void update_sys(const QRect &rect); |
|
755 |
void update_sys(const QRegion &rgn); |
|
756 |
void setGeometry_sys_helper(int, int, int, int, bool); |
|
757 |
void setWindowModified_sys(bool b); |
|
758 |
void updateMaximizeButton_sys(); |
|
759 |
void setWindowFilePath_sys(const QString &filePath); |
|
760 |
void createWindow_sys(); |
|
761 |
void recreateMacWindow(); |
|
762 |
#ifndef QT_MAC_USE_COCOA |
|
763 |
void initWindowPtr(); |
|
764 |
void finishCreateWindow_sys_Carbon(OSWindowRef windowRef); |
|
765 |
#else |
|
766 |
void finishCreateWindow_sys_Cocoa(void * /*NSWindow * */ windowRef); |
|
767 |
void syncCocoaMask(); |
|
768 |
void finishCocoaMaskSetup(); |
|
769 |
#endif |
|
770 |
void determineWindowClass(); |
|
771 |
void transferChildren(); |
|
772 |
bool qt_mac_dnd_event(uint, DragRef); |
|
773 |
void toggleDrawers(bool); |
|
774 |
//mac event functions |
|
775 |
static bool qt_create_root_win(); |
|
776 |
static void qt_clean_root_win(); |
|
777 |
static bool qt_mac_update_sizer(QWidget *, int up = 0); |
|
778 |
static OSStatus qt_window_event(EventHandlerCallRef er, EventRef event, void *); |
|
779 |
static OSStatus qt_widget_event(EventHandlerCallRef er, EventRef event, void *); |
|
780 |
static bool qt_widget_rgn(QWidget *, short, RgnHandle, bool); |
|
781 |
void registerTouchWindow(); |
|
782 |
#elif defined(Q_WS_QWS) // <--------------------------------------------------------- QWS |
|
783 |
void setMaxWindowState_helper(); |
|
784 |
void setFullScreenSize_helper(); |
|
785 |
void moveSurface(QWindowSurface *surface, const QPoint &offset); |
|
786 |
QRegion localRequestedRegion() const; |
|
787 |
QRegion localAllocatedRegion() const; |
|
788 |
||
789 |
friend class QWSManager; |
|
790 |
friend class QWSManagerPrivate; |
|
791 |
friend class QDecoration; |
|
792 |
#ifndef QT_NO_CURSOR |
|
793 |
void updateCursor() const; |
|
794 |
#endif |
|
795 |
QScreen* getScreen() const; |
|
796 |
#elif defined(Q_OS_SYMBIAN) // <--------------------------------------------------------- SYMBIAN |
|
797 |
static QWidget *mouseGrabber; |
|
798 |
static QWidget *keyboardGrabber; |
|
799 |
void s60UpdateIsOpaque(); |
|
800 |
void reparentChildren(); |
|
801 |
void registerTouchWindow(); |
|
802 |
#endif |
|
803 |
||
804 |
}; |
|
805 |
||
806 |
struct QWidgetPaintContext |
|
807 |
{ |
|
808 |
inline QWidgetPaintContext(QPaintDevice *d, const QRegion &r, const QPoint &o, int f, |
|
809 |
QPainter *p, QWidgetBackingStore *b) |
|
810 |
: pdev(d), rgn(r), offset(o), flags(f), sharedPainter(p), backingStore(b), painter(0) {} |
|
811 |
||
812 |
QPaintDevice *pdev; |
|
813 |
QRegion rgn; |
|
814 |
QPoint offset; |
|
815 |
int flags; |
|
816 |
QPainter *sharedPainter; |
|
817 |
QWidgetBackingStore *backingStore; |
|
818 |
QPainter *painter; |
|
819 |
}; |
|
820 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
821 |
#ifndef QT_NO_GRAPHICSEFFECT |
0 | 822 |
class QWidgetEffectSourcePrivate : public QGraphicsEffectSourcePrivate |
823 |
{ |
|
824 |
public: |
|
825 |
QWidgetEffectSourcePrivate(QWidget *widget) |
|
826 |
: QGraphicsEffectSourcePrivate(), m_widget(widget), context(0), updateDueToGraphicsEffect(false) |
|
827 |
{} |
|
828 |
||
829 |
inline void detach() |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
830 |
{ m_widget->d_func()->graphicsEffect = 0; } |
0 | 831 |
|
832 |
inline const QGraphicsItem *graphicsItem() const |
|
833 |
{ return 0; } |
|
834 |
||
835 |
inline const QWidget *widget() const |
|
836 |
{ return m_widget; } |
|
837 |
||
838 |
inline void update() |
|
839 |
{ |
|
840 |
updateDueToGraphicsEffect = true; |
|
841 |
m_widget->update(); |
|
842 |
updateDueToGraphicsEffect = false; |
|
843 |
} |
|
844 |
||
845 |
inline bool isPixmap() const |
|
846 |
{ return false; } |
|
847 |
||
848 |
inline void effectBoundingRectChanged() |
|
849 |
{ |
|
850 |
// ### This function should take a rect parameter; then we can avoid |
|
851 |
// updating too much on the parent widget. |
|
852 |
if (QWidget *parent = m_widget->parentWidget()) |
|
853 |
parent->update(); |
|
854 |
else |
|
855 |
update(); |
|
856 |
} |
|
857 |
||
858 |
inline const QStyleOption *styleOption() const |
|
859 |
{ return 0; } |
|
860 |
||
861 |
inline QRect deviceRect() const |
|
862 |
{ return m_widget->window()->rect(); } |
|
863 |
||
864 |
QRectF boundingRect(Qt::CoordinateSystem system) const; |
|
865 |
void draw(QPainter *p); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
866 |
QPixmap pixmap(Qt::CoordinateSystem system, QPoint *offset, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
867 |
QGraphicsEffect::PixmapPadMode mode) const; |
0 | 868 |
|
869 |
QWidget *m_widget; |
|
870 |
QWidgetPaintContext *context; |
|
871 |
QTransform lastEffectTransform; |
|
872 |
bool updateDueToGraphicsEffect; |
|
873 |
}; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
874 |
#endif //QT_NO_GRAPHICSEFFECT |
0 | 875 |
|
876 |
inline QWExtra *QWidgetPrivate::extraData() const |
|
877 |
{ |
|
878 |
return extra; |
|
879 |
} |
|
880 |
||
881 |
inline QTLWExtra *QWidgetPrivate::topData() const |
|
882 |
{ |
|
883 |
const_cast<QWidgetPrivate *>(this)->createTLExtra(); |
|
884 |
return extra->topextra; |
|
885 |
} |
|
886 |
||
887 |
inline QTLWExtra *QWidgetPrivate::maybeTopData() const |
|
888 |
{ |
|
889 |
return extra ? extra->topextra : 0; |
|
890 |
} |
|
891 |
||
892 |
inline QPainter *QWidgetPrivate::sharedPainter() const |
|
893 |
{ |
|
894 |
Q_Q(const QWidget); |
|
895 |
QTLWExtra *x = q->window()->d_func()->maybeTopData(); |
|
896 |
return x ? x->sharedPainter : 0; |
|
897 |
} |
|
898 |
||
899 |
inline void QWidgetPrivate::setSharedPainter(QPainter *painter) |
|
900 |
{ |
|
901 |
Q_Q(QWidget); |
|
902 |
QTLWExtra *x = q->window()->d_func()->topData(); |
|
903 |
x->sharedPainter = painter; |
|
904 |
} |
|
905 |
||
906 |
inline QWidgetBackingStore *QWidgetPrivate::maybeBackingStore() const |
|
907 |
{ |
|
908 |
Q_Q(const QWidget); |
|
909 |
QTLWExtra *x = q->window()->d_func()->maybeTopData(); |
|
910 |
return x ? x->backingStore : 0; |
|
911 |
} |
|
912 |
||
913 |
QT_END_NAMESPACE |
|
914 |
||
915 |
#endif // QWIDGET_P_H |