Changeset 561 for trunk/src/gui/kernel/qapplication_p.h
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/gui/kernel/qapplication_p.h
r428 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 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 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 56 56 57 57 #include "QtGui/qapplication.h" 58 #include "QtGui/qevent.h" 58 59 #include "QtGui/qfont.h" 59 60 #include "QtGui/qcursor.h" … … 71 72 #include <private/qgraphicssystem_qws_p.h> 72 73 #endif 74 #ifdef Q_OS_SYMBIAN 75 #include <w32std.h> 76 #endif 73 77 74 78 QT_BEGIN_NAMESPACE … … 78 82 class QGraphicsSystem; 79 83 class QInputContext; 80 class QKeyEvent;81 class QMouseEvent;82 84 class QObject; 83 class QWheelEvent;84 85 class QWidget; 86 class QSocketNotifier; 87 class QGestureManager; 85 88 86 89 extern bool qt_is_gui_used; … … 101 104 class QWSManager; 102 105 class QDirectPainter; 106 struct QWSServerCleaner { ~QWSServerCleaner(); }; 103 107 #endif 104 108 … … 159 163 { 160 164 QPointF ret; 165 161 166 if (sign(outExtentX) == sign(maxX)) 162 ret.setX(((coordX - minX) * qAbs(outExtentX) / qAbs(qreal(maxX ))) + outOriginX);167 ret.setX(((coordX - minX) * qAbs(outExtentX) / qAbs(qreal(maxX - minX))) + outOriginX); 163 168 else 164 ret.setX(((qAbs(maxX) - (coordX - minX)) * qAbs(outExtentX) / qAbs(qreal(maxX )))169 ret.setX(((qAbs(maxX) - (coordX - minX)) * qAbs(outExtentX) / qAbs(qreal(maxX - minX))) 165 170 + outOriginX); 166 171 167 172 if (sign(outExtentY) == sign(maxY)) 168 ret.setY(((coordY - minY) * qAbs(outExtentY) / qAbs(qreal(maxY ))) + outOriginY);173 ret.setY(((coordY - minY) * qAbs(outExtentY) / qAbs(qreal(maxY - minY))) + outOriginY); 169 174 else 170 ret.setY(((qAbs(maxY) - (coordY - minY)) * qAbs(outExtentY) / qAbs(qreal(maxY )))175 ret.setY(((qAbs(maxY) - (coordY - minY)) * qAbs(outExtentY) / qAbs(qreal(maxY - minY))) 171 176 + outOriginY); 177 172 178 return ret; 173 179 } … … 189 195 } 190 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 191 267 192 268 class QScopedLoopLevelCounter … … 201 277 }; 202 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 203 285 class Q_GUI_EXPORT QApplicationPrivate : public QCoreApplicationPrivate 204 286 { … … 210 292 #if defined(Q_WS_X11) 211 293 #ifndef QT_NO_SETTINGS 212 static QString kdeHome();213 294 static bool x11_apply_settings(); 214 295 #endif … … 220 301 static bool quitOnLastWindowClosed; 221 302 static void emitLastWindowClosed(); 222 #ifdef Q_ OS_WINCE303 #ifdef Q_WS_WINCE 223 304 static int autoMaximizeThreshold; 305 #endif 224 306 static bool autoSipEnabled; 225 #endif 307 static QString desktopStyleKey(); 226 308 227 309 static QGraphicsSystem *graphicsSystem() … … 234 316 void createEventDispatcher(); 235 317 QString appName() const; 236 237 318 static void dispatchEnterLeave(QWidget *enter, QWidget *leave); 238 319 … … 271 352 KB_Gnome = 16, 272 353 KB_CDE = 32, 354 KB_S60 = 64, 273 355 KB_All = 0xffff 274 356 }; … … 357 439 static bool animate_toolbox; 358 440 static bool widgetCount; // Coupled with -widgetcount switch 441 static bool load_testability; // Coupled with -testability switch 359 442 #ifdef Q_WS_MAC 360 443 static bool native_modal_dialog_active; 361 #endif362 #if defined(Q_WS_WIN) && !defined(Q_OS_WINCE)363 static bool inSizeMove;364 444 #endif 365 445 … … 384 464 #ifdef Q_WS_QWS 385 465 QPointer<QWSManager> last_manager; 466 QWSServerCleaner qwsServerCleaner; 386 467 # ifndef QT_NO_DIRECTPAINTER 387 468 QMap<WId, QDirectPainter *> *directPainters; … … 394 475 static QApplicationPrivate *instance() { return self; } 395 476 396 static QString *styleOverride;477 static QString styleOverride; 397 478 398 479 static int app_compile_version; 399 480 400 481 #ifdef QT_KEYPAD_NAVIGATION 401 static bool keypadNavigation;402 482 static QWidget *oldEditFocus; 483 static Qt::NavigationMode navigationMode; 403 484 #endif 404 485 … … 406 487 void _q_alertTimeOut(); 407 488 QHash<QWidget *, QTimer *> alertTimerHash; 408 #endif409 #if defined(QT_MAC_USE_COCOA)410 void _q_runAppModalWindow();411 #endif412 #if defined(QT_MAC_USE_COCOA)413 void _q_runModalWindow();414 489 #endif 415 490 #ifndef QT_NO_STYLE_STYLESHEET … … 421 496 QWidget *buttonDown, QWidget *alienWidget); 422 497 static bool sendMouseEvent(QWidget *receiver, QMouseEvent *event, QWidget *alienWidget, 423 QWidget *native, QWidget **buttonDown, QPointer<QWidget> &lastMouseReceiver); 424 #if defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_WS_X11) 498 QWidget *native, QWidget **buttonDown, QPointer<QWidget> &lastMouseReceiver, 499 bool spontaneous = true); 500 #ifdef Q_OS_SYMBIAN 501 static void setNavigationMode(Qt::NavigationMode mode); 502 static TUint resolveS60ScanCode(TInt scanCode, TUint keysym); 503 QSet<WId> nativeWindows; 504 505 int symbianProcessWsEvent(const TWsEvent *event); 506 int symbianHandleCommand(int command); 507 int symbianResourceChange(int type); 508 509 #endif 510 #if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined (Q_WS_QWS) || defined(Q_WS_PM) 425 511 void sendSyntheticEnterLeave(QWidget *widget); 426 512 #endif 427 513 #if defined(Q_WS_PM) && !defined(QT_NO_SESSIONMANAGER) 428 514 bool canQuit(); 515 #endif 516 517 QGestureManager *gestureManager; 518 QWidget *gestureWidget; 519 520 QMap<int, QWeakPointer<QWidget> > widgetForTouchPointId; 521 QMap<int, QTouchEvent::TouchPoint> appCurrentTouchPoints; 522 static void updateTouchPointsForWidget(QWidget *widget, QTouchEvent *touchEvent); 523 void initializeMultitouch(); 524 void initializeMultitouch_sys(); 525 void cleanupMultitouch(); 526 void cleanupMultitouch_sys(); 527 int findClosestTouchPointId(const QPointF &screenPos); 528 void appendTouchPoint(const QTouchEvent::TouchPoint &touchPoint); 529 void removeTouchPoint(int touchPointId); 530 static void translateRawTouchEvent(QWidget *widget, 531 QTouchEvent::DeviceType deviceType, 532 const QList<QTouchEvent::TouchPoint> &touchPoints); 533 534 #if defined(Q_WS_WIN) 535 static PtrRegisterTouchWindow RegisterTouchWindow; 536 static PtrGetTouchInputInfo GetTouchInputInfo; 537 static PtrCloseTouchInputHandle CloseTouchInputHandle; 538 539 QHash<DWORD, int> touchInputIDToTouchPointID; 540 bool translateTouchEvent(const MSG &msg); 541 542 PtrGetGestureInfo GetGestureInfo; 543 PtrGetGestureExtraArgs GetGestureExtraArgs; 544 PtrCloseGestureInfoHandle CloseGestureInfoHandle; 545 PtrSetGestureConfig SetGestureConfig; 546 PtrGetGestureConfig GetGestureConfig; 547 PtrBeginPanningFeedback BeginPanningFeedback; 548 PtrUpdatePanningFeedback UpdatePanningFeedback; 549 PtrEndPanningFeedback EndPanningFeedback; 550 #endif 551 552 #ifdef QT_RX71_MULTITOUCH 553 bool hasRX71MultiTouch; 554 555 struct RX71TouchPointState { 556 QSocketNotifier *socketNotifier; 557 QTouchEvent::TouchPoint touchPoint; 558 559 int minX, maxX, scaleX; 560 int minY, maxY, scaleY; 561 int minZ, maxZ; 562 }; 563 QList<RX71TouchPointState> allRX71TouchPoints; 564 565 bool readRX71MultiTouchEvents(int deviceNumber); 566 void fakeMouseEventFromRX71TouchEvent(); 567 void _q_readRX71MultiTouchEvents(); 568 #endif 569 570 #if defined(Q_WS_S60) 571 int maxTouchPressure; 572 QList<QTouchEvent::TouchPoint> appAllTouchPoints; 429 573 #endif 430 574 … … 434 578 #endif 435 579 580 #ifdef Q_OS_SYMBIAN 581 static QHash<TInt, TUint> scanCodeCache; 582 #endif 583 436 584 static QApplicationPrivate *self; 585 586 static void giveFocusAccordingToFocusPolicy(QWidget *w, 587 Qt::FocusPolicy focusPolicy, 588 Qt::FocusReason focusReason); 437 589 static bool shouldSetFocus(QWidget *w, Qt::FocusPolicy policy); 590 591 592 static bool isAlien(QWidget *); 438 593 }; 439 594 595 Q_GUI_EXPORT void qt_translateRawTouchEvent(QWidget *window, 596 QTouchEvent::DeviceType deviceType, 597 const QList<QTouchEvent::TouchPoint> &touchPoints); 598 599 #if defined(Q_WS_WIN) 600 extern void qt_win_set_cursor(QWidget *, bool); 601 #elif defined(Q_WS_X11) 602 extern void qt_x11_enforce_cursor(QWidget *, bool); 603 extern void qt_x11_enforce_cursor(QWidget *); 604 #elif defined(Q_OS_SYMBIAN) 605 extern void qt_symbian_set_cursor(QWidget *, bool); 606 #elif defined(Q_WS_PM) 607 extern void qt_pm_set_cursor(QWidget *, bool); 608 #endif 609 440 610 QT_END_NAMESPACE 441 611
Note:
See TracChangeset
for help on using the changeset viewer.