author | eckhart.koppen@nokia.com |
Wed, 31 Mar 2010 11:06:36 +0300 | |
changeset 7 | f7bc934e204c |
parent 3 | 41300fa6a67c |
permissions | -rw-r--r-- |
0 | 1 |
/**************************************************************************** |
2 |
** |
|
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@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 QAPPLICATION_P_H |
|
43 |
#define QAPPLICATION_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, qcolor_x11.cpp, qfiledialog.cpp |
|
51 |
// and many other. This header file may change from version to version |
|
52 |
// without notice, or even be removed. |
|
53 |
// |
|
54 |
// We mean it. |
|
55 |
// |
|
56 |
||
57 |
#include "QtGui/qapplication.h" |
|
58 |
#include "QtGui/qevent.h" |
|
59 |
#include "QtGui/qfont.h" |
|
60 |
#include "QtGui/qcursor.h" |
|
61 |
#include "QtGui/qregion.h" |
|
62 |
#include "QtCore/qmutex.h" |
|
63 |
#include "QtCore/qtranslator.h" |
|
64 |
#include "QtCore/qbasictimer.h" |
|
65 |
#include "QtCore/qhash.h" |
|
66 |
#include "QtCore/qpointer.h" |
|
67 |
#include "private/qcoreapplication_p.h" |
|
68 |
#include "private/qshortcutmap_p.h" |
|
69 |
#include <private/qthread_p.h> |
|
70 |
#ifdef Q_WS_QWS |
|
71 |
#include "QtGui/qscreen_qws.h" |
|
72 |
#include <private/qgraphicssystem_qws_p.h> |
|
73 |
#endif |
|
74 |
#ifdef Q_OS_SYMBIAN |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
75 |
#include <w32std.h> |
0 | 76 |
#endif |
77 |
||
78 |
QT_BEGIN_NAMESPACE |
|
79 |
||
80 |
class QClipboard; |
|
81 |
class QGraphicsScene; |
|
82 |
class QGraphicsSystem; |
|
83 |
class QInputContext; |
|
84 |
class QObject; |
|
85 |
class QWidget; |
|
86 |
class QSocketNotifier; |
|
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
87 |
class QGestureManager; |
0 | 88 |
|
89 |
extern bool qt_is_gui_used; |
|
90 |
#ifndef QT_NO_CLIPBOARD |
|
91 |
extern QClipboard *qt_clipboard; |
|
92 |
#endif |
|
93 |
||
94 |
#if defined (Q_OS_WIN32) || defined (Q_OS_CYGWIN) || defined(Q_OS_WINCE) |
|
95 |
extern QSysInfo::WinVersion qt_winver; |
|
96 |
enum { QT_TABLET_NPACKETQSIZE = 128 }; |
|
97 |
# ifdef Q_OS_WINCE |
|
98 |
extern DWORD qt_cever; |
|
99 |
# endif |
|
100 |
#elif defined (Q_OS_MAC) |
|
101 |
extern QSysInfo::MacVersion qt_macver; |
|
102 |
#endif |
|
103 |
#if defined(Q_WS_QWS) |
|
104 |
class QWSManager; |
|
105 |
class QDirectPainter; |
|
106 |
struct QWSServerCleaner { ~QWSServerCleaner(); }; |
|
107 |
#endif |
|
108 |
||
109 |
#ifndef QT_NO_TABLET |
|
110 |
struct QTabletDeviceData |
|
111 |
{ |
|
112 |
#ifndef Q_WS_MAC |
|
113 |
int minPressure; |
|
114 |
int maxPressure; |
|
115 |
int minTanPressure; |
|
116 |
int maxTanPressure; |
|
117 |
int minX, maxX, minY, maxY, minZ, maxZ; |
|
118 |
inline QPointF scaleCoord(int coordX, int coordY, int outOriginX, int outExtentX, |
|
119 |
int outOriginY, int outExtentY) const; |
|
120 |
#endif |
|
121 |
||
122 |
#if defined(Q_WS_X11) || (defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA)) |
|
123 |
QPointer<QWidget> widgetToGetPress; |
|
124 |
#endif |
|
125 |
||
126 |
#ifdef Q_WS_X11 |
|
127 |
int deviceType; |
|
128 |
enum { |
|
129 |
TOTAL_XINPUT_EVENTS = 64 |
|
130 |
}; |
|
131 |
void *device; |
|
132 |
int eventCount; |
|
133 |
long unsigned int eventList[TOTAL_XINPUT_EVENTS]; // XEventClass is in fact a long unsigned int |
|
134 |
||
135 |
int xinput_motion; |
|
136 |
int xinput_key_press; |
|
137 |
int xinput_key_release; |
|
138 |
int xinput_button_press; |
|
139 |
int xinput_button_release; |
|
140 |
int xinput_proximity_in; |
|
141 |
int xinput_proximity_out; |
|
142 |
#elif defined(Q_WS_WIN) |
|
143 |
qint64 llId; |
|
144 |
int currentDevice; |
|
145 |
int currentPointerType; |
|
146 |
#elif defined(Q_WS_MAC) |
|
147 |
quint64 tabletUniqueID; |
|
148 |
int tabletDeviceType; |
|
149 |
int tabletPointerType; |
|
150 |
int capabilityMask; |
|
151 |
#endif |
|
152 |
}; |
|
153 |
||
154 |
static inline int sign(int x) |
|
155 |
{ |
|
156 |
return x >= 0 ? 1 : -1; |
|
157 |
} |
|
158 |
||
159 |
#ifndef Q_WS_MAC |
|
160 |
inline QPointF QTabletDeviceData::scaleCoord(int coordX, int coordY, |
|
161 |
int outOriginX, int outExtentX, |
|
162 |
int outOriginY, int outExtentY) const |
|
163 |
{ |
|
164 |
QPointF ret; |
|
165 |
||
166 |
if (sign(outExtentX) == sign(maxX)) |
|
167 |
ret.setX(((coordX - minX) * qAbs(outExtentX) / qAbs(qreal(maxX - minX))) + outOriginX); |
|
168 |
else |
|
169 |
ret.setX(((qAbs(maxX) - (coordX - minX)) * qAbs(outExtentX) / qAbs(qreal(maxX - minX))) |
|
170 |
+ outOriginX); |
|
171 |
||
172 |
if (sign(outExtentY) == sign(maxY)) |
|
173 |
ret.setY(((coordY - minY) * qAbs(outExtentY) / qAbs(qreal(maxY - minY))) + outOriginY); |
|
174 |
else |
|
175 |
ret.setY(((qAbs(maxY) - (coordY - minY)) * qAbs(outExtentY) / qAbs(qreal(maxY - minY))) |
|
176 |
+ outOriginY); |
|
177 |
||
178 |
return ret; |
|
179 |
} |
|
180 |
#endif |
|
181 |
||
182 |
typedef QList<QTabletDeviceData> QTabletDeviceDataList; |
|
183 |
QTabletDeviceDataList *qt_tablet_devices(); |
|
184 |
# if defined(Q_WS_MAC) |
|
185 |
typedef QHash<int, QTabletDeviceData> QMacTabletHash; |
|
186 |
QMacTabletHash *qt_mac_tablet_hash(); |
|
187 |
# endif |
|
188 |
#endif |
|
189 |
||
190 |
#ifdef QT3_SUPPORT |
|
191 |
extern "C" { |
|
192 |
typedef bool (*Ptrqt_tryAccelEvent)(QWidget *w, QKeyEvent *e); |
|
193 |
typedef bool (*Ptrqt_tryComposeUnicode)(QWidget *w, QKeyEvent *e); |
|
194 |
typedef bool (*Ptrqt_dispatchAccelEvent)(QWidget *w, QKeyEvent *e); |
|
195 |
} |
|
196 |
#endif |
|
197 |
||
198 |
#if defined(Q_WS_WIN) |
|
199 |
typedef BOOL (WINAPI *PtrRegisterTouchWindow)(HWND, ULONG); |
|
200 |
typedef BOOL (WINAPI *PtrGetTouchInputInfo)(HANDLE, UINT, PVOID, int); |
|
201 |
typedef BOOL (WINAPI *PtrCloseTouchInputHandle)(HANDLE); |
|
202 |
||
203 |
typedef BOOL (WINAPI *PtrGetGestureInfo)(HANDLE, PVOID); |
|
204 |
typedef BOOL (WINAPI *PtrGetGestureExtraArgs)(HANDLE, UINT, PBYTE); |
|
205 |
typedef BOOL (WINAPI *PtrCloseGestureInfoHandle)(HANDLE); |
|
206 |
typedef BOOL (WINAPI *PtrSetGestureConfig)(HWND, DWORD, UINT, PVOID, UINT); |
|
207 |
typedef BOOL (WINAPI *PtrGetGestureConfig)(HWND, DWORD, DWORD, PUINT, PVOID, UINT); |
|
208 |
||
209 |
typedef BOOL (WINAPI *PtrBeginPanningFeedback)(HWND); |
|
210 |
typedef BOOL (WINAPI *PtrUpdatePanningFeedback)(HWND, LONG, LONG, BOOL); |
|
211 |
typedef BOOL (WINAPI *PtrEndPanningFeedback)(HWND, BOOL); |
|
212 |
||
213 |
#ifndef WM_GESTURE |
|
214 |
# define WM_GESTURE 0x0119 |
|
215 |
||
216 |
# define GID_BEGIN 1 |
|
217 |
# define GID_END 2 |
|
218 |
# define GID_ZOOM 3 |
|
219 |
# define GID_PAN 4 |
|
220 |
# define GID_ROTATE 5 |
|
221 |
# define GID_TWOFINGERTAP 6 |
|
222 |
# define GID_ROLLOVER 7 |
|
223 |
||
224 |
typedef struct tagGESTUREINFO |
|
225 |
{ |
|
226 |
UINT cbSize; |
|
227 |
DWORD dwFlags; |
|
228 |
DWORD dwID; |
|
229 |
HWND hwndTarget; |
|
230 |
POINTS ptsLocation; |
|
231 |
DWORD dwInstanceID; |
|
232 |
DWORD dwSequenceID; |
|
233 |
ULONGLONG ullArguments; |
|
234 |
UINT cbExtraArgs; |
|
235 |
} GESTUREINFO; |
|
236 |
||
237 |
# define GC_PAN 0x00000001 |
|
238 |
# define GC_PAN_WITH_SINGLE_FINGER_VERTICALLY 0x00000002 |
|
239 |
# define GC_PAN_WITH_SINGLE_FINGER_HORIZONTALLY 0x00000004 |
|
240 |
||
241 |
# define GC_ZOOM 0x00000001 |
|
242 |
# define GC_ROTATE 0x00000001 |
|
243 |
||
244 |
typedef struct tagGESTURECONFIG |
|
245 |
{ |
|
246 |
DWORD dwID; |
|
247 |
DWORD dwWant; |
|
248 |
DWORD dwBlock; |
|
249 |
} GESTURECONFIG; |
|
250 |
||
251 |
# define GID_ROTATE_ANGLE_FROM_ARGUMENT(arg) ((((double)(arg) / 65535.0) * 4.0 * 3.14159265) - 2.0*3.14159265) |
|
252 |
||
253 |
#endif // WM_GESTURE |
|
254 |
||
255 |
#if defined(Q_WS_WINCE_WM) && defined(QT_WINCE_GESTURES) |
|
256 |
#undef GID_ZOOM |
|
257 |
#define GID_ZOOM 0xf000 |
|
258 |
#undef GID_ROTATE |
|
259 |
#define GID_ROTATE 0xf001 |
|
260 |
#undef GID_TWOFINGERTAP |
|
261 |
#define GID_TWOFINGERTAP 0xf002 |
|
262 |
#undef GID_ROLLOVER |
|
263 |
#define GID_ROLLOVER 0xf003 |
|
264 |
#endif |
|
265 |
||
266 |
#endif // Q_WS_WIN |
|
267 |
||
268 |
class QScopedLoopLevelCounter |
|
269 |
{ |
|
270 |
QThreadData *threadData; |
|
271 |
public: |
|
272 |
QScopedLoopLevelCounter(QThreadData *threadData) |
|
273 |
: threadData(threadData) |
|
274 |
{ ++threadData->loopLevel; } |
|
275 |
~QScopedLoopLevelCounter() |
|
276 |
{ --threadData->loopLevel; } |
|
277 |
}; |
|
278 |
||
279 |
typedef QHash<QByteArray, QFont> FontHash; |
|
280 |
FontHash *qt_app_fonts_hash(); |
|
281 |
||
282 |
typedef QHash<QByteArray, QPalette> PaletteHash; |
|
283 |
PaletteHash *qt_app_palettes_hash(); |
|
284 |
||
285 |
class Q_GUI_EXPORT QApplicationPrivate : public QCoreApplicationPrivate |
|
286 |
{ |
|
287 |
Q_DECLARE_PUBLIC(QApplication) |
|
288 |
public: |
|
289 |
QApplicationPrivate(int &argc, char **argv, QApplication::Type type); |
|
290 |
~QApplicationPrivate(); |
|
291 |
||
292 |
#if defined(Q_WS_X11) |
|
293 |
#ifndef QT_NO_SETTINGS |
|
294 |
static bool x11_apply_settings(); |
|
295 |
#endif |
|
296 |
static void reset_instance_pointer(); |
|
297 |
#elif defined(Q_WS_QWS) |
|
298 |
static bool qws_apply_settings(); |
|
299 |
static QWidget *findWidget(const QObjectList&, const QPoint &, bool rec); |
|
300 |
#endif |
|
301 |
static bool quitOnLastWindowClosed; |
|
302 |
static void emitLastWindowClosed(); |
|
303 |
#ifdef Q_WS_WINCE |
|
304 |
static int autoMaximizeThreshold; |
|
305 |
#endif |
|
306 |
static bool autoSipEnabled; |
|
307 |
static QString desktopStyleKey(); |
|
308 |
||
309 |
static QGraphicsSystem *graphicsSystem() |
|
310 |
#if !defined(Q_WS_QWS) |
|
311 |
{ return graphics_system; } |
|
312 |
#else |
|
313 |
{ return QScreen::instance()->graphicsSystem(); } |
|
314 |
#endif |
|
315 |
||
316 |
void createEventDispatcher(); |
|
317 |
QString appName() const; |
|
318 |
static void dispatchEnterLeave(QWidget *enter, QWidget *leave); |
|
319 |
||
320 |
//modality |
|
321 |
static void enterModal(QWidget*); |
|
322 |
static void leaveModal(QWidget*); |
|
323 |
static void enterModal_sys(QWidget*); |
|
324 |
static void leaveModal_sys(QWidget*); |
|
325 |
static bool isBlockedByModal(QWidget *widget); |
|
326 |
static bool modalState(); |
|
327 |
static bool tryModalHelper(QWidget *widget, QWidget **rettop = 0); |
|
328 |
#ifdef Q_WS_MAC |
|
329 |
static QWidget *tryModalHelper_sys(QWidget *top); |
|
330 |
bool canQuit(); |
|
331 |
#endif |
|
332 |
||
333 |
bool notify_helper(QObject *receiver, QEvent * e); |
|
334 |
||
335 |
void construct( |
|
336 |
#ifdef Q_WS_X11 |
|
337 |
Display *dpy = 0, Qt::HANDLE visual = 0, Qt::HANDLE cmap = 0 |
|
338 |
#endif |
|
339 |
); |
|
340 |
void initialize(); |
|
341 |
void process_cmdline(); |
|
342 |
||
343 |
#if defined(Q_WS_X11) |
|
344 |
static void x11_initialize_style(); |
|
345 |
#endif |
|
346 |
||
347 |
enum KeyPlatform { |
|
348 |
KB_Win = 1, |
|
349 |
KB_Mac = 2, |
|
350 |
KB_X11 = 4, |
|
351 |
KB_KDE = 8, |
|
352 |
KB_Gnome = 16, |
|
353 |
KB_CDE = 32, |
|
354 |
KB_S60 = 64, |
|
355 |
KB_All = 0xffff |
|
356 |
}; |
|
357 |
||
358 |
static uint currentPlatform(); |
|
359 |
bool inPopupMode() const; |
|
360 |
void closePopup(QWidget *popup); |
|
361 |
void openPopup(QWidget *popup); |
|
362 |
static void setFocusWidget(QWidget *focus, Qt::FocusReason reason); |
|
363 |
static QWidget *focusNextPrevChild_helper(QWidget *toplevel, bool next); |
|
364 |
||
365 |
#ifndef QT_NO_SESSIONMANAGER |
|
366 |
QSessionManager *session_manager; |
|
367 |
QString session_id; |
|
368 |
QString session_key; |
|
369 |
bool is_session_restored; |
|
370 |
#endif |
|
371 |
||
372 |
#ifndef QT_NO_CURSOR |
|
373 |
QList<QCursor> cursor_list; |
|
374 |
#endif |
|
375 |
#ifndef QT_NO_GRAPHICSVIEW |
|
376 |
// Maintain a list of all scenes to ensure font and palette propagation to |
|
377 |
// all scenes. |
|
378 |
QList<QGraphicsScene *> scene_list; |
|
379 |
#endif |
|
380 |
||
381 |
QBasicTimer toolTipWakeUp, toolTipFallAsleep; |
|
382 |
QPoint toolTipPos, toolTipGlobalPos, hoverGlobalPos; |
|
383 |
QPointer<QWidget> toolTipWidget; |
|
384 |
#ifndef QT_NO_SHORTCUT |
|
385 |
QShortcutMap shortcutMap; |
|
386 |
#endif |
|
387 |
||
388 |
#ifdef QT3_SUPPORT |
|
389 |
bool qt_compat_used; |
|
390 |
bool qt_compat_resolved; |
|
391 |
Ptrqt_tryAccelEvent qt_tryAccelEvent; |
|
392 |
Ptrqt_tryComposeUnicode qt_tryComposeUnicode; |
|
393 |
Ptrqt_dispatchAccelEvent qt_dispatchAccelEvent; |
|
394 |
||
395 |
bool use_compat() { |
|
396 |
return qt_tryAccelEvent |
|
397 |
&& qt_tryComposeUnicode |
|
398 |
&& qt_dispatchAccelEvent; |
|
399 |
} |
|
400 |
#endif |
|
401 |
static QInputContext *inputContext; |
|
402 |
||
403 |
static Qt::MouseButtons mouse_buttons; |
|
404 |
static Qt::KeyboardModifiers modifier_buttons; |
|
405 |
||
406 |
static QSize app_strut; |
|
407 |
static QWidgetList *popupWidgets; |
|
408 |
static QStyle *app_style; |
|
409 |
static int app_cspec; |
|
410 |
static QPalette *app_pal; |
|
411 |
static QPalette *sys_pal; |
|
412 |
static QPalette *set_pal; |
|
413 |
static QGraphicsSystem *graphics_system; |
|
414 |
static QString graphics_system_name; |
|
415 |
||
416 |
private: |
|
417 |
static QFont *app_font; // private for a reason! Always use QApplication::font() instead! |
|
418 |
public: |
|
419 |
static QFont *sys_font; |
|
420 |
static QFont *set_font; |
|
421 |
static QWidget *main_widget; |
|
422 |
static QWidget *focus_widget; |
|
423 |
static QWidget *hidden_focus_widget; |
|
424 |
static QWidget *active_window; |
|
425 |
static QIcon *app_icon; |
|
426 |
static bool obey_desktop_settings; |
|
427 |
static int cursor_flash_time; |
|
428 |
static int mouse_double_click_time; |
|
429 |
static int keyboard_input_time; |
|
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
430 |
#ifndef QT_NO_WHEELEVENT |
0 | 431 |
static int wheel_scroll_lines; |
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
432 |
#endif |
0 | 433 |
|
434 |
static bool animate_ui; |
|
435 |
static bool animate_menu; |
|
436 |
static bool animate_tooltip; |
|
437 |
static bool animate_combo; |
|
438 |
static bool fade_menu; |
|
439 |
static bool fade_tooltip; |
|
440 |
static bool animate_toolbox; |
|
441 |
static bool widgetCount; // Coupled with -widgetcount switch |
|
442 |
static bool load_testability; // Coupled with -testability switch |
|
443 |
#ifdef Q_WS_MAC |
|
444 |
static bool native_modal_dialog_active; |
|
445 |
#endif |
|
446 |
||
447 |
static void setSystemPalette(const QPalette &pal); |
|
448 |
static void setPalette_helper(const QPalette &palette, const char* className, bool clearWidgetPaletteHash); |
|
449 |
static void initializeWidgetPaletteHash(); |
|
450 |
static void setSystemFont(const QFont &font); |
|
451 |
||
452 |
#if defined(Q_WS_X11) |
|
453 |
static void applyX11SpecificCommandLineArguments(QWidget *main_widget); |
|
454 |
#elif defined(Q_WS_QWS) |
|
455 |
static void applyQWSSpecificCommandLineArguments(QWidget *main_widget); |
|
456 |
#endif |
|
457 |
||
458 |
#ifdef Q_WS_MAC |
|
459 |
static OSStatus globalEventProcessor(EventHandlerCallRef, EventRef, void *); |
|
460 |
static OSStatus globalAppleEventProcessor(const AppleEvent *, AppleEvent *, long); |
|
461 |
static OSStatus tabletProximityCallback(EventHandlerCallRef, EventRef, void *); |
|
462 |
static bool qt_mac_apply_settings(); |
|
463 |
#endif |
|
464 |
||
465 |
#ifdef Q_WS_QWS |
|
466 |
QPointer<QWSManager> last_manager; |
|
467 |
QWSServerCleaner qwsServerCleaner; |
|
468 |
# ifndef QT_NO_DIRECTPAINTER |
|
469 |
QMap<WId, QDirectPainter *> *directPainters; |
|
470 |
# endif |
|
471 |
QRect maxWindowRect(const QScreen *screen) const { return maxWindowRects[screen]; } |
|
472 |
void setMaxWindowRect(const QScreen *screen, int screenNo, const QRect &rect); |
|
473 |
void setScreenTransformation(QScreen *screen, int screenNo, int transformation); |
|
474 |
#endif |
|
475 |
||
476 |
static QApplicationPrivate *instance() { return self; } |
|
477 |
||
478 |
static QString styleOverride; |
|
479 |
||
480 |
static int app_compile_version; |
|
481 |
||
482 |
#ifdef QT_KEYPAD_NAVIGATION |
|
483 |
static QWidget *oldEditFocus; |
|
484 |
static Qt::NavigationMode navigationMode; |
|
485 |
#endif |
|
486 |
||
487 |
#if defined(Q_WS_MAC) || defined(Q_WS_X11) |
|
488 |
void _q_alertTimeOut(); |
|
489 |
QHash<QWidget *, QTimer *> alertTimerHash; |
|
490 |
#endif |
|
491 |
#ifndef QT_NO_STYLE_STYLESHEET |
|
492 |
static QString styleSheet; |
|
493 |
#endif |
|
494 |
static QPointer<QWidget> leaveAfterRelease; |
|
495 |
static QWidget *pickMouseReceiver(QWidget *candidate, const QPoint &globalPos, QPoint &pos, |
|
496 |
QEvent::Type type, Qt::MouseButtons buttons, |
|
497 |
QWidget *buttonDown, QWidget *alienWidget); |
|
498 |
static bool sendMouseEvent(QWidget *receiver, QMouseEvent *event, QWidget *alienWidget, |
|
499 |
QWidget *native, QWidget **buttonDown, QPointer<QWidget> &lastMouseReceiver, |
|
500 |
bool spontaneous = true); |
|
501 |
#ifdef Q_OS_SYMBIAN |
|
502 |
static void setNavigationMode(Qt::NavigationMode mode); |
|
503 |
static TUint resolveS60ScanCode(TInt scanCode, TUint keysym); |
|
504 |
QSet<WId> nativeWindows; |
|
505 |
||
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
506 |
int symbianProcessWsEvent(const QSymbianEvent *symbianEvent); |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
507 |
int symbianHandleCommand(const QSymbianEvent *symbianEvent); |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
508 |
int symbianResourceChange(const QSymbianEvent *symbianEvent); |
0 | 509 |
|
510 |
#endif |
|
511 |
#if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined (Q_WS_QWS) |
|
512 |
void sendSyntheticEnterLeave(QWidget *widget); |
|
513 |
#endif |
|
514 |
||
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
515 |
QGestureManager *gestureManager; |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
516 |
QWidget *gestureWidget; |
0 | 517 |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
518 |
QMap<int, QWeakPointer<QWidget> > widgetForTouchPointId; |
0 | 519 |
QMap<int, QTouchEvent::TouchPoint> appCurrentTouchPoints; |
520 |
static void updateTouchPointsForWidget(QWidget *widget, QTouchEvent *touchEvent); |
|
521 |
void initializeMultitouch(); |
|
522 |
void initializeMultitouch_sys(); |
|
523 |
void cleanupMultitouch(); |
|
524 |
void cleanupMultitouch_sys(); |
|
525 |
int findClosestTouchPointId(const QPointF &screenPos); |
|
526 |
void appendTouchPoint(const QTouchEvent::TouchPoint &touchPoint); |
|
527 |
void removeTouchPoint(int touchPointId); |
|
528 |
static void translateRawTouchEvent(QWidget *widget, |
|
529 |
QTouchEvent::DeviceType deviceType, |
|
530 |
const QList<QTouchEvent::TouchPoint> &touchPoints); |
|
531 |
||
532 |
#if defined(Q_WS_WIN) |
|
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
533 |
static bool HasTouchSupport; |
0 | 534 |
static PtrRegisterTouchWindow RegisterTouchWindow; |
535 |
static PtrGetTouchInputInfo GetTouchInputInfo; |
|
536 |
static PtrCloseTouchInputHandle CloseTouchInputHandle; |
|
537 |
||
538 |
QHash<DWORD, int> touchInputIDToTouchPointID; |
|
539 |
bool translateTouchEvent(const MSG &msg); |
|
540 |
||
541 |
PtrGetGestureInfo GetGestureInfo; |
|
542 |
PtrGetGestureExtraArgs GetGestureExtraArgs; |
|
543 |
PtrCloseGestureInfoHandle CloseGestureInfoHandle; |
|
544 |
PtrSetGestureConfig SetGestureConfig; |
|
545 |
PtrGetGestureConfig GetGestureConfig; |
|
546 |
PtrBeginPanningFeedback BeginPanningFeedback; |
|
547 |
PtrUpdatePanningFeedback UpdatePanningFeedback; |
|
548 |
PtrEndPanningFeedback EndPanningFeedback; |
|
549 |
#endif |
|
550 |
||
551 |
#ifdef QT_RX71_MULTITOUCH |
|
552 |
bool hasRX71MultiTouch; |
|
553 |
||
554 |
struct RX71TouchPointState { |
|
555 |
QSocketNotifier *socketNotifier; |
|
556 |
QTouchEvent::TouchPoint touchPoint; |
|
557 |
||
558 |
int minX, maxX, scaleX; |
|
559 |
int minY, maxY, scaleY; |
|
560 |
int minZ, maxZ; |
|
561 |
}; |
|
562 |
QList<RX71TouchPointState> allRX71TouchPoints; |
|
563 |
||
564 |
bool readRX71MultiTouchEvents(int deviceNumber); |
|
565 |
void fakeMouseEventFromRX71TouchEvent(); |
|
566 |
void _q_readRX71MultiTouchEvents(); |
|
567 |
#endif |
|
568 |
||
569 |
#if defined(Q_WS_S60) |
|
570 |
int maxTouchPressure; |
|
571 |
QList<QTouchEvent::TouchPoint> appAllTouchPoints; |
|
572 |
#endif |
|
573 |
||
574 |
private: |
|
575 |
#ifdef Q_WS_QWS |
|
576 |
QMap<const QScreen*, QRect> maxWindowRects; |
|
577 |
#endif |
|
578 |
||
579 |
#ifdef Q_OS_SYMBIAN |
|
580 |
static QHash<TInt, TUint> scanCodeCache; |
|
581 |
#endif |
|
582 |
||
583 |
static QApplicationPrivate *self; |
|
584 |
||
585 |
static void giveFocusAccordingToFocusPolicy(QWidget *w, |
|
586 |
Qt::FocusPolicy focusPolicy, |
|
587 |
Qt::FocusReason focusReason); |
|
588 |
static bool shouldSetFocus(QWidget *w, Qt::FocusPolicy policy); |
|
589 |
||
590 |
||
591 |
static bool isAlien(QWidget *); |
|
592 |
}; |
|
593 |
||
594 |
Q_GUI_EXPORT void qt_translateRawTouchEvent(QWidget *window, |
|
595 |
QTouchEvent::DeviceType deviceType, |
|
596 |
const QList<QTouchEvent::TouchPoint> &touchPoints); |
|
597 |
||
598 |
#if defined(Q_WS_WIN) |
|
599 |
extern void qt_win_set_cursor(QWidget *, bool); |
|
600 |
#elif defined(Q_WS_X11) |
|
601 |
extern void qt_x11_enforce_cursor(QWidget *, bool); |
|
602 |
extern void qt_x11_enforce_cursor(QWidget *); |
|
603 |
#elif defined(Q_OS_SYMBIAN) |
|
604 |
extern void qt_symbian_set_cursor(QWidget *, bool); |
|
605 |
#endif |
|
606 |
||
607 |
QT_END_NAMESPACE |
|
608 |
||
609 |
#endif // QAPPLICATION_P_H |