42 #ifndef QAPPLICATION_P_H 43 #define QAPPLICATION_P_H 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 "QtGui/private/qshortcutmap_p.h" 69 #include <private/qthread_p.h> 70 #include "QtCore/qpoint.h" 73 #include "QtGui/qscreen_qws.h" 74 #include <private/qgraphicssystem_qws_p.h> 80 #include <QWindowSystemInterface> 82 #include "QtGui/qplatformintegration_qpa.h" 94 #ifndef QT_NO_GESTURES 99 #ifndef QT_NO_CLIPBOARD 103 #if defined (Q_OS_WIN32) || defined (Q_OS_CYGWIN) || defined(Q_OS_WINCE) 109 #elif defined (Q_OS_MAC) 112 #if defined(Q_WS_QWS) 126 int minX, maxX, minY, maxY, minZ, maxZ;
127 inline QPointF scaleCoord(
int coordX,
int coordY,
int outOriginX,
int outExtentX,
128 int outOriginY,
int outExtentY)
const;
131 #if defined(Q_WS_X11) || (defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA)) 138 TOTAL_XINPUT_EVENTS = 64
142 long unsigned int eventList[TOTAL_XINPUT_EVENTS];
151 #elif defined(Q_WS_WIN) 154 int currentPointerType;
155 #elif defined(Q_WS_MAC) 157 int tabletDeviceType;
158 int tabletPointerType;
165 return x >= 0 ? 1 : -1;
169 inline QPointF QTabletDeviceData::scaleCoord(
int coordX,
int coordY,
170 int outOriginX,
int outExtentX,
171 int outOriginY,
int outExtentY)
const 176 ret.
setX(((coordX - minX) *
qAbs(outExtentX) /
qAbs(
qreal(maxX - minX))) + outOriginX);
182 ret.
setY(((coordY - minY) *
qAbs(outExtentY) /
qAbs(
qreal(maxY - minY))) + outOriginY);
193 # if defined(Q_WS_MAC) 207 #if defined(Q_WS_WIN) 212 #ifndef QT_NO_GESTURES 224 # define WM_GESTURE 0x0119 230 # define GID_ROTATE 5 231 # define GID_TWOFINGERTAP 6 232 # define GID_ROLLOVER 7 247 # define GC_PAN 0x00000001 248 # define GC_PAN_WITH_SINGLE_FINGER_VERTICALLY 0x00000002 249 # define GC_PAN_WITH_SINGLE_FINGER_HORIZONTALLY 0x00000004 251 # define GC_ZOOM 0x00000001 252 # define GC_ROTATE 0x00000001 261 # define GID_ROTATE_ANGLE_FROM_ARGUMENT(arg) ((((double)(arg) / 65535.0) * 4.0 * 3.14159265) - 2.0*3.14159265) 265 #if defined(Q_WS_WINCE_WM) && defined(QT_WINCE_GESTURES) 267 #define GID_ZOOM 0xf000 269 #define GID_ROTATE 0xf001 270 #undef GID_TWOFINGERTAP 271 #define GID_TWOFINGERTAP 0xf002 273 #define GID_ROLLOVER 0xf003 276 #endif // QT_NO_GESTURES 293 #if defined(Q_WS_X11) 294 #ifndef QT_NO_SETTINGS 295 static bool x11_apply_settings();
297 static void reset_instance_pointer();
298 #elif defined(Q_WS_QWS) 299 static bool qws_apply_settings();
303 static void emitLastWindowClosed();
308 static QString desktopStyleKey();
311 #if defined(Q_WS_QWS) 314 {
return graphics_system; }
317 #if defined(Q_WS_QPA) 319 {
return platform_integration; }
325 void createEventDispatcher();
330 static void enterModal(
QWidget*);
331 static void leaveModal(
QWidget*);
332 static void enterModal_sys(
QWidget*);
333 static void leaveModal_sys(
QWidget*);
335 static bool modalState();
336 static bool tryModalHelper(
QWidget *widget,
QWidget **rettop = 0);
350 void process_cmdline();
352 #if defined(Q_WS_X11) 353 static void x11_initialize_style();
367 static uint currentPlatform();
368 bool inPopupMode()
const;
369 void closePopup(
QWidget *popup);
370 void openPopup(
QWidget *popup);
372 static QWidget *focusNextPrevChild_helper(
QWidget *toplevel,
bool next);
374 #ifndef QT_NO_SESSIONMANAGER 384 #ifndef QT_NO_GRAPHICSVIEW 393 #ifndef QT_NO_SHORTCUT 399 bool qt_compat_resolved;
400 Ptrqt_tryAccelEvent qt_tryAccelEvent;
401 Ptrqt_tryComposeUnicode qt_tryComposeUnicode;
402 Ptrqt_dispatchAccelEvent qt_dispatchAccelEvent;
405 return qt_tryAccelEvent
406 && qt_tryComposeUnicode
407 && qt_dispatchAccelEvent;
412 static bool inputContextBeingCreated;
445 #ifndef QT_NO_WHEELEVENT 463 static void setSystemPalette(
const QPalette &pal);
464 static void setPalette_helper(
const QPalette &palette,
const char*
className,
bool clearWidgetPaletteHash);
465 static void initializeWidgetPaletteHash();
466 static void setSystemFont(
const QFont &font);
468 #if defined(Q_WS_X11) 469 static void applyX11SpecificCommandLineArguments(
QWidget *main_widget);
470 #elif defined(Q_WS_QWS) 471 static void applyQWSSpecificCommandLineArguments(
QWidget *main_widget);
478 #ifdef QT_MAC_USE_COCOA 479 static void qt_initAfterNSAppStarted();
480 static void setupAppleEvents();
482 static bool qt_mac_apply_settings();
510 static void reportLocaleChange();
516 # ifndef QT_NO_DIRECTPAINTER 528 #ifdef QT_KEYPAD_NAVIGATION 533 #if defined(Q_WS_MAC) || defined(Q_WS_X11) 534 void _q_alertTimeOut();
537 #ifndef QT_NO_STYLE_STYLESHEET 546 bool spontaneous =
true);
549 static TUint resolveS60ScanCode(TInt scanCode, TUint
keysym);
552 int symbianProcessWsEvent(
const QSymbianEvent *symbianEvent);
553 int symbianHandleCommand(
const QSymbianEvent *symbianEvent);
554 int symbianResourceChange(
const QSymbianEvent *symbianEvent);
555 void symbianHandleLiteModeStartup();
557 void _q_aboutToQuit();
559 void emitAboutToReleaseGpuResources();
560 void emitAboutToUseGpuResources();
562 #if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined (Q_WS_QWS) || defined(Q_WS_MAC) || defined(Q_WS_QPA) 563 void sendSyntheticEnterLeave(
QWidget *widget);
566 #ifndef QT_NO_GESTURES 570 #if defined(Q_WS_X11) || defined(Q_WS_WIN) 575 #if defined(Q_WS_WIN) 583 void initializeMultitouch();
584 void initializeMultitouch_sys();
585 void cleanupMultitouch();
586 void cleanupMultitouch_sys();
587 int findClosestTouchPointId(
const QPointF &screenPos);
589 void removeTouchPoint(
int touchPointId);
590 static void translateRawTouchEvent(
QWidget *widget,
594 #if defined(Q_WS_WIN) 601 bool translateTouchEvent(
const MSG &msg);
603 #ifndef QT_NO_GESTURES 612 #endif // QT_NO_GESTURES 615 #ifdef QT_RX71_MULTITOUCH 616 bool hasRX71MultiTouch;
618 struct RX71TouchPointState {
622 int minX, maxX, scaleX;
623 int minY, maxY, scaleY;
628 bool readRX71MultiTouchEvents(
int deviceNumber);
629 void fakeMouseEventFromRX71TouchEvent();
630 void _q_readRX71MultiTouchEvents();
633 #if defined(Q_OS_SYMBIAN) 634 int pressureSupported;
635 int maxTouchPressure;
638 bool useTranslucentEGLSurfaces;
652 static void giveFocusAccordingToFocusPolicy(
QWidget *w,
658 static bool isAlien(
QWidget *);
665 #if defined(Q_WS_WIN) 667 #elif defined(Q_WS_X11) 670 #elif defined(Q_OS_SYMBIAN) 671 extern void qt_symbian_set_cursor(
QWidget *,
bool);
672 #elif defined (Q_WS_QPA) 678 #endif // QAPPLICATION_P_H static QPointer< QWidget > leaveAfterRelease
static QWidget * main_widget
The QApplication class manages the GUI application's control flow and main settings.
The QGraphicsScene class provides a surface for managing a large number of 2D graphical items...
QRect maxWindowRect(const QScreen *screen) const
The QKeyEvent class describes a key event.
QClipboard * qt_clipboard
BOOL(WINAPI * PtrEndPanningFeedback)(HWND, BOOL)
#define QT_END_NAMESPACE
This macro expands to.
QPointer< QWidget > widget
QHash< DWORD, int > touchInputIDToTouchPointID
static PtrCloseTouchInputHandle CloseTouchInputHandle
QHash< QByteArray, QPalette > PaletteHash
static QPalette * set_pal
BOOL(WINAPI * PtrGetTouchInputInfo)(HANDLE, UINT, PVOID, int)
void setY(qreal y)
Sets the y coordinate of this point to the given y coordinate.
QMap< int, QTouchEvent::TouchPoint > appCurrentTouchPoints
The QPointF class defines a point in the plane using floating point precision.
static Qt::MouseButtons buttons
int xinput_button_release
static int wheel_scroll_lines
PtrSetGestureConfig SetGestureConfig
PtrUpdatePanningFeedback UpdatePanningFeedback
static QWidget * active_window
static QApplicationPrivate * instance()
BOOL(WINAPI * PtrSetGestureConfig)(HWND, DWORD, UINT, PVOID, UINT)
BOOL(WINAPI * PtrCloseTouchInputHandle)(HANDLE)
The QDirectPainter class provides direct access to the underlying hardware in Qt for Embedded Linux...
The QString class provides a Unicode character string.
The QHash class is a template class that provides a hash-table-based dictionary.
QSessionManager * session_manager
DeviceType
This enum represents the type of device that generated a QTouchEvent.
Q_DECL_CONSTEXPR T qAbs(const T &t)
The QObject class is the base class of all Qt objects.
PtrEndPanningFeedback EndPanningFeedback
BOOL(WINAPI * PtrBeginPanningFeedback)(HWND)
QList< QGraphicsScene * > scene_list
QHash< int, QTabletDeviceData > QMacTabletHash
BOOL(WINAPI * PtrRegisterTouchWindow)(HWND, ULONG)
QPointer< QWidget > toolTipWidget
PtrGetGestureInfo GetGestureInfo
static QPalette * app_pal
PaletteHash * qt_app_palettes_hash()
QPointer< QWidget > widgetToGetPress
static bool autoSipEnabled
The QSocketNotifier class provides support for monitoring activity on a file descriptor.
static QWidget * focus_widget
BOOL(WINAPI * PtrCloseGestureInfoHandle)(HANDLE)
static int keyboard_input_time
The QSessionManager class provides access to the session manager.
#define QT_BEGIN_NAMESPACE
This macro expands to.
static bool load_testability
struct tagGESTUREINFO GESTUREINFO
QHash< QWidget *, QTimer * > alertTimerHash
static QWidgetList * popupWidgets
BOOL(WINAPI * PtrUpdatePanningFeedback)(HWND, LONG, LONG, BOOL)
Q_GUI_EXPORT void qt_translateRawTouchEvent(QWidget *window, QTouchEvent::DeviceType deviceType, const QList< QTouchEvent::TouchPoint > &touchPoints)
static bool quitOnLastWindowClosed
static int mouse_double_click_time
static QWidget * hidden_focus_widget
PtrGetGestureExtraArgs GetGestureExtraArgs
static QScreen * instance()
Returns a pointer to the application's QScreen instance.
static bool animate_combo
static bool HasTouchSupport
static QStyle * app_style
static QPalette * sys_pal
BOOL(WINAPI * PtrGetGestureExtraArgs)(HANDLE, UINT, PBYTE)
The QClipboard class provides access to the window system clipboard.
static PtrRegisterTouchWindow RegisterTouchWindow
FontHash * qt_app_fonts_hash()
QWSServerCleaner qwsServerCleaner
QHash< QByteArray, QFont > FontHash
static bool runtime_graphics_system
QSysInfo::WinVersion qt_winver
static QString graphics_system_name
static PtrGetTouchInputInfo GetTouchInputInfo
struct OpaqueEventRef * EventRef
The QMouseEvent class contains parameters that describe a mouse event.
static bool animate_tooltip
QGraphicsSystem * graphicsSystem() const
#define Q_DECLARE_PUBLIC(Class)
static bool obey_desktop_settings
QList< QCursor > cursor_list
MacVersion
This enum provides symbolic names for the various versions of the OS X operating system.
void qt_win_set_cursor(QWidget *, bool)
static Qt::KeyboardModifiers modifier_buttons
Type
This enum type defines the valid event types in Qt.
static QInputContext * inputContext
The QFont class specifies a font used for drawing text.
static QCoreApplication * instance()
Returns a pointer to the application's QCoreApplication (or QApplication) instance.
QMacTabletHash * qt_mac_tablet_hash()
BOOL(WINAPI * PtrGetGestureConfig)(HWND, DWORD, DWORD, PUINT, PVOID, UINT)
static void construct(QVariant::Private *x, const void *copy)
QPointer< QWSManager > last_manager
BOOL(WINAPI * PtrGetGestureInfo)(HANDLE, PVOID)
static QString styleSheet
static bool animate_toolbox
PtrCloseGestureInfoHandle CloseGestureInfoHandle
The QPoint class defines a point in the plane using integer precision.
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI...
QList< QTabletDeviceData > QTabletDeviceDataList
QMap< const QScreen *, QRect > maxWindowRects
struct tagGESTURECONFIG GESTURECONFIG
The QRect class defines a rectangle in the plane using integer precision.
QMap< int, QWeakPointer< QWidget > > widgetForTouchPointId
static QGraphicsSystem * graphics_system
static bool native_modal_dialog_active
The QScreen class is a base class for screen drivers in Qt for Embedded Linux.
void setX(qreal x)
Sets the x coordinate of this point to the given x coordinate.
static void setMaxWindowRect(const QRect &rect)
The QPixmap class is an off-screen image representation that can be used as a paint device...
static QString styleOverride
QMap< WId, QDirectPainter * > * directPainters
QBasicTimer toolTipWakeUp
The TouchPoint class provides information about a touch point in a QTouchEvent.
The QBasicTimer class provides timer events for objects.
The QTouchEvent class contains parameters that describe a touch event.
WinVersion
This enum provides symbolic names for the various versions of the Windows operating system...
The QSize class defines the size of a two-dimensional object using integer point precision.
struct OpaqueEventHandlerCallRef * EventHandlerCallRef
QTouchEventSequence touchEvent(QWidget *widget=0, QTouchEvent::DeviceType deviceType=QTouchEvent::TouchScreen)
Creates and returns a QTouchEventSequence for the device deviceType to simulate events for widget...
The QInputContext class abstracts the input method dependent data and composing state.
static QGraphicsSystem * graphicsSystem()
QGestureManager * gestureManager
The QEvent class is the base class of all event classes.
static int autoMaximizeThreshold
PtrGetGestureConfig GetGestureConfig
QTabletDeviceDataList * qt_tablet_devices()
PtrBeginPanningFeedback BeginPanningFeedback
The QAbstractEventDispatcher class provides an interface to manage Qt's event queue.
The QMap class is a template class that provides a skip-list-based dictionary.
static Qt::MouseButtons mouse_buttons
The QList class is a template class that provides lists.
static int cursor_flash_time
static void setScreenTransformation(int screenNo, int transformation)
The QPalette class contains color groups for each widget state.
The QIcon class provides scalable icons in different modes and states.