Qt 4.8
Classes | Macros | Typedefs | Functions | Variables
qapplication_win.cpp File Reference
#include "qguifunctions_wince.h"
#include "qmenubar.h"
#include "qapplication.h"
#include "qdesktopwidget.h"
#include "qevent.h"
#include "private/qeventdispatcher_win_p.h"
#include "qeventloop.h"
#include "qclipboard.h"
#include "qcursor.h"
#include "qdatetime.h"
#include "qpointer.h"
#include "qhash.h"
#include "qmetaobject.h"
#include "qmime.h"
#include "qpainter.h"
#include "qpixmapcache.h"
#include "qsessionmanager.h"
#include "qstyle.h"
#include "qwhatsthis.h"
#include "qwidget.h"
#include "qcolormap.h"
#include "qlayout.h"
#include "qtooltip.h"
#include "qt_windows.h"
#include "qscrollbar.h"
#include "private/qwininputcontext_p.h"
#include "private/qcursor_p.h"
#include "private/qmath_p.h"
#include "private/qapplication_p.h"
#include "private/qbackingstore_p.h"
#include "private/qwindowsurface_raster_p.h"
#include "qdebug.h"
#include <private/qkeymapper_p.h>
#include <private/qlocale_p.h>
#include <private/qsystemlibrary_p.h>
#include "qevent_p.h"
#include "qmutex.h"
#include "qaccessible.h"
#include <oleacc.h>
#include <bldver.h>
#include <windowsx.h>
#include <limits.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <math.h>
#include <wintab.h>
#include <pktdef.h>
#include "private/qwidget_p.h"

Go to the source code of this file.

Classes

class  QETWidget
 
class  QGuiEventDispatcherWin32
 
struct  QWinConfigRequest
 
struct  SHRGINFO
 
struct  tagTOUCHINPUT
 
struct  tagTRACKMOUSEEVENT
 

Macros

#define __export
 
#define APPCOMMAND_BASS_BOOST   20
 
#define APPCOMMAND_BASS_DOWN   19
 
#define APPCOMMAND_BASS_UP   21
 
#define APPCOMMAND_BROWSER_BACKWARD   1
 
#define APPCOMMAND_BROWSER_FAVORITES   6
 
#define APPCOMMAND_BROWSER_FORWARD   2
 
#define APPCOMMAND_BROWSER_HOME   7
 
#define APPCOMMAND_BROWSER_REFRESH   3
 
#define APPCOMMAND_BROWSER_SEARCH   5
 
#define APPCOMMAND_BROWSER_STOP   4
 
#define APPCOMMAND_CLOSE   31
 
#define APPCOMMAND_COPY   36
 
#define APPCOMMAND_CORRECTION_LIST   45
 
#define APPCOMMAND_CUT   37
 
#define APPCOMMAND_DICTATE_OR_COMMAND_CONTROL_TOGGLE   43
 
#define APPCOMMAND_FIND   28
 
#define APPCOMMAND_FORWARD_MAIL   40
 
#define APPCOMMAND_HELP   27
 
#define APPCOMMAND_LAUNCH_APP1   17
 
#define APPCOMMAND_LAUNCH_APP2   18
 
#define APPCOMMAND_LAUNCH_MAIL   15
 
#define APPCOMMAND_LAUNCH_MEDIA_SELECT   16
 
#define APPCOMMAND_MEDIA_CHANNEL_DOWN   52
 
#define APPCOMMAND_MEDIA_CHANNEL_UP   51
 
#define APPCOMMAND_MEDIA_FAST_FORWARD   49
 
#define APPCOMMAND_MEDIA_NEXTTRACK   11
 
#define APPCOMMAND_MEDIA_PAUSE   47
 
#define APPCOMMAND_MEDIA_PLAY   46
 
#define APPCOMMAND_MEDIA_PLAY_PAUSE   14
 
#define APPCOMMAND_MEDIA_PREVIOUSTRACK   12
 
#define APPCOMMAND_MEDIA_RECORD   48
 
#define APPCOMMAND_MEDIA_REWIND   50
 
#define APPCOMMAND_MEDIA_STOP   13
 
#define APPCOMMAND_MIC_ON_OFF_TOGGLE   44
 
#define APPCOMMAND_MICROPHONE_VOLUME_DOWN   25
 
#define APPCOMMAND_MICROPHONE_VOLUME_MUTE   24
 
#define APPCOMMAND_MICROPHONE_VOLUME_UP   26
 
#define APPCOMMAND_NEW   29
 
#define APPCOMMAND_OPEN   30
 
#define APPCOMMAND_PASTE   38
 
#define APPCOMMAND_PRINT   33
 
#define APPCOMMAND_REDO   35
 
#define APPCOMMAND_REPLY_TO_MAIL   39
 
#define APPCOMMAND_SAVE   32
 
#define APPCOMMAND_SEND_MAIL   41
 
#define APPCOMMAND_SPELL_CHECK   42
 
#define APPCOMMAND_TREBLE_DOWN   22
 
#define APPCOMMAND_TREBLE_UP   23
 
#define APPCOMMAND_UNDO   34
 
#define APPCOMMAND_VOLUME_DOWN   9
 
#define APPCOMMAND_VOLUME_MUTE   8
 
#define APPCOMMAND_VOLUME_UP   10
 
#define COLOR_MENUBAR   30
 
#define COLOR_MENUHILIGHT   29
 
#define CSR_TYPE   20
 
#define FAPPCOMMAND_KEY   0
 
#define FAPPCOMMAND_MASK   0xF000
 
#define FAPPCOMMAND_MOUSE   0x8000
 
#define FAPPCOMMAND_OEM   0x1000
 
#define FE_FONTSMOOTHINGCLEARTYPE   0x0002
 
#define GET_APPCOMMAND_LPARAM(lParam)   ((short)(HIWORD(lParam) & ~FAPPCOMMAND_MASK))
 
#define GET_DEVICE_LPARAM(lParam)   ((WORD)(HIWORD(lParam) & FAPPCOMMAND_MASK))
 
#define GET_FLAGS_LPARAM(lParam)   (LOWORD(lParam))
 
#define GET_KEYSTATE_LPARAM(lParam)   GET_FLAGS_LPARAM(lParam)
 
#define GET_KEYSTATE_WPARAM(wParam)   (LOWORD(wParam))
 
#define GET_MOUSEORKEY_LPARAM   GET_DEVICE_LPARAM
 
#define GET_XBUTTON_WPARAM(wParam)   (HIWORD(wParam))
 
#define GID_PRESSANDTAP   7
 
#define GID_ROLLOVER   GID_PRESSANDTAP
 
#define GID_TWOFINGERTAP   6
 
#define GID_ZOOM   3
 
#define GN_CONTEXTMENU   1000
 
#define IMR_CONFIRMRECONVERTSTRING   0x0005
 
#define IMR_RECONVERTSTRING   4
 
#define MK_XBUTTON1   0x0020
 
#define MK_XBUTTON2   0x0040
 
#define PACKETDATA
 
#define PACKETMODE   0
 
#define PEEKMESSAGE_IS_BROKEN   1
 
#define RETURN(x)   { inLoop=false;return x; }
 
#define SHRG_NOANIMATION   0x00000010
 
#define SHRG_RETURNCMD   0x00000001
 
#define SPI_GETFONTSMOOTHINGTYPE   0x200A
 
#define SPI_SETFONTSMOOTHINGTYPE   0x200B
 
#define SPI_SETSIPINFO   224
 
#define TOUCHEVENTF_DOWN   0x0002
 
#define TOUCHEVENTF_INRANGE   0x0008
 
#define TOUCHEVENTF_MOVE   0x0001
 
#define TOUCHEVENTF_NOCOALESCE   0x0020
 
#define TOUCHEVENTF_PALM   0x0080
 
#define TOUCHEVENTF_PEN   0x0040
 
#define TOUCHEVENTF_PRIMARY   0x0010
 
#define TOUCHEVENTF_UP   0x0004
 
#define TOUCHINPUTMASKF_CONTACTAREA   0x0004
 
#define TOUCHINPUTMASKF_EXTRAINFO   0x0002
 
#define TOUCHINPUTMASKF_TIMEFROMSYSTEM   0x0001
 
#define WM_APPCOMMAND   0x0319
 
#define WM_GETOBJECT   0x003D
 
#define WM_MOUSELEAVE   0x02A3
 
#define WM_THEMECHANGED   0x031A
 
#define WM_TOUCH   0x0240
 
#define WM_XBUTTONDBLCLK   0x020D
 
#define WM_XBUTTONDOWN   0x020B
 
#define WM_XBUTTONUP   0x020C
 
#define XBUTTON1   0x0001
 
#define XBUTTON2   0x0002
 

Typedefs

typedef DWORD(API * AygRecognizeGesture) (SHRGINFO *)
 
typedef struct tagTRACKMOUSEEVENTLPTRACKMOUSEEVENT
 
typedef struct tagTOUCHINPUTPTOUCHINPUT
 
typedef BOOL(WINAPI * PtrSetProcessDPIAware) (VOID)
 
typedef BOOL(API * PtrWTClose) (HCTX)
 
typedef BOOL(API * PtrWTEnable) (HCTX, BOOL)
 
typedef BOOL(API * PtrWTGet) (HCTX, LPLOGCONTEXT)
 
typedef UINT(API * PtrWTInfo) (UINT, UINT, LPVOID)
 
typedef HCTX(API * PtrWTOpen) (HWND, LPLOGCONTEXT, BOOL)
 
typedef BOOL(API * PtrWTOverlap) (HCTX, BOOL)
 
typedef int(API * PtrWTPacketsGet) (HCTX, int, LPVOID)
 
typedef int(API * PtrWTQueueSizeGet) (HCTX)
 
typedef BOOL(API * PtrWTQueueSizeSet) (HCTX, int)
 
typedef QHash< quint64, QTabletDeviceDataQTabletCursorInfo
 
typedef struct tagTOUCHINPUT TOUCHINPUT
 
typedef struct tagTRACKMOUSEEVENT TRACKMOUSEEVENT
 
typedef QHash< QString, int > WinClassNameHash
 

Functions

static void alert_widget (QWidget *widget, int duration)
 
static void initWinTabFunctions ()
 
uint qGlobalPostedEventsCount ()
 
void qt_cleanup ()
 
QRgb qt_colorref2qrgb (COLORREF col)
 
IAccessible * qt_createWindowsAccessible (QAccessibleInterface *object)
 
QRegion qt_dirtyRegion (QWidget *)
 
QWidgetqt_get_tablet_widget ()
 
Q_GUI_EXPORT const QString qt_getRegisteredWndClass ()
 
QCursorqt_grab_cursor ()
 
void qt_init (QApplicationPrivate *priv, int)
 
static bool qt_is_translatable_mouse_event (UINT message)
 
QFont qt_LOGFONTtoQFont (LOGFONT &lf, bool scale)
 
bool qt_nograb ()
 
const QString qt_reg_winclass (QWidget *w)
 
bool qt_sendSpontaneousEvent (QObject *, QEvent *)
 
static void qt_set_windows_color_resources ()
 
static void qt_set_windows_font_resources ()
 
static void qt_set_windows_resources ()
 
static void qt_set_windows_updateScrollBar (QWidget *widget)
 
static bool qt_try_modal (QWidget *, MSG *, int &ret)
 
HRGN qt_tryCreateRegion (QRegion::RegionType type, int left, int top, int right, int bottom)
 
static BOOL WINAPI qt_updateLayeredWindowIndirect (HWND hwnd, const Q_UPDATELAYEREDWINDOWINFO *info)
 
Q_GUI_EXPORT HDC qt_win_display_dc ()
 
void qt_win_eatMouseMove ()
 
Qt::KeyboardModifiers qt_win_getKeyboardModifiers ()
 
static void qt_win_read_cleartype_settings ()
 
void qt_win_set_cursor (QWidget *w, bool force)
 
void qt_wince_hide_taskbar (HWND hwnd)
 
bool qt_wince_is_high_dpi ()
 
bool qt_wince_is_mobile ()
 
bool qt_wince_is_pocket_pc ()
 
bool qt_wince_is_smartphone ()
 
LRESULT QT_WIN_CALLBACK QtWndProc (HWND, UINT, WPARAM, LPARAM)
 
static void qWinProcessConfigRequests ()
 
void qWinRequestConfig (WId id, int req, int x, int y, int w, int h)
 
static void releaseAutoCapture ()
 
static void resolveAygLibs ()
 
static void setAutoCapture (HWND)
 
static void tabletInit (const quint64 uniqueId, const UINT csr_type, HCTX hTab)
 
static void tabletUpdateCursor (QTabletDeviceData &tdd, const UINT currentCursor)
 
static int translateButtonState (int s, int type, int button)
 
static void unregWinClasses ()
 

Variables

static bool app_do_modal = false
 
static bool appNoGrab = false
 
static HWND autoCaptureWnd = 0
 
static bool aygResolved = false
 
static QList< QWinConfigRequest * > * configRequests = 0
 
QTabletDeviceData currentTabletPointer
 
static HWND curWin = 0
 
static HDC displayDC = 0
 
static bool effect_override = false
 
static HWND imeParentWnd = 0
 
static bool inLoop = false
 
static int inputcharset = CP_ACP
 
static PACKET localPacketBuf [QT_TABLET_NPACKETQSIZE]
 
static const ushort mouseTbl []
 
QPointF oldHiResTabletGlobalPosF
 
static QPointer< QWidgetpopupButtonFocus
 
static AygRecognizeGesture ptrRecognizeGesture = 0
 
static PtrSetProcessDPIAware ptrSetProcessDPIAware = 0
 
PtrUpdateLayeredWindow ptrUpdateLayeredWindow = 0
 
PtrUpdateLayeredWindowIndirect ptrUpdateLayeredWindowIndirect = 0
 
static PtrWTEnable ptrWTEnable = 0
 
static PtrWTGet ptrWTGet = 0
 
static PtrWTInfo ptrWTInfo = 0
 
static PtrWTOverlap ptrWTOverlap = 0
 
static PtrWTPacketsGet ptrWTPacketsGet = 0
 
bool qt_app_has_font
 
QWidgetqt_button_down = 0
 
Q_GUI_EXPORT bool qt_cleartype_enabled
 
QDesktopWidgetqt_desktopWidget
 
Q_GUI_EXPORT qreal qt_fontsmoothing_gamma
 
bool qt_is_gui_used
 
QPointer< QWidgetqt_last_mouse_receiver = 0
 
QWidgetListqt_modal_stack
 
QSessionManagerqt_session_manager_self
 
HCTX qt_tablet_context
 
bool qt_tablet_tilt_support
 
bool qt_tabletChokeMouse
 
bool qt_use_rtl_extensions = false
 
Q_GUI_EXPORT bool qt_win_ignoreNextMouseReleaseEvent = false
 
Q_GUI_EXPORT bool qt_win_owndc_required
 
static bool replayPopupMouseEvent = false
 
static bool sm_blockUserInput = false
 
static bool sm_cancel
 
static bool sm_smActive = false
 

Macro Definition Documentation

◆ __export

#define __export

Definition at line 460 of file qapplication_win.cpp.

◆ APPCOMMAND_BASS_BOOST

#define APPCOMMAND_BASS_BOOST   20

Definition at line 352 of file qapplication_win.cpp.

Referenced by QtWndProc().

◆ APPCOMMAND_BASS_DOWN

#define APPCOMMAND_BASS_DOWN   19

Definition at line 351 of file qapplication_win.cpp.

Referenced by QtWndProc().

◆ APPCOMMAND_BASS_UP

#define APPCOMMAND_BASS_UP   21

Definition at line 353 of file qapplication_win.cpp.

Referenced by QtWndProc().

◆ APPCOMMAND_BROWSER_BACKWARD

#define APPCOMMAND_BROWSER_BACKWARD   1

Definition at line 333 of file qapplication_win.cpp.

◆ APPCOMMAND_BROWSER_FAVORITES

#define APPCOMMAND_BROWSER_FAVORITES   6

Definition at line 338 of file qapplication_win.cpp.

◆ APPCOMMAND_BROWSER_FORWARD

#define APPCOMMAND_BROWSER_FORWARD   2

Definition at line 334 of file qapplication_win.cpp.

◆ APPCOMMAND_BROWSER_HOME

#define APPCOMMAND_BROWSER_HOME   7

Definition at line 339 of file qapplication_win.cpp.

◆ APPCOMMAND_BROWSER_REFRESH

#define APPCOMMAND_BROWSER_REFRESH   3

Definition at line 335 of file qapplication_win.cpp.

◆ APPCOMMAND_BROWSER_SEARCH

#define APPCOMMAND_BROWSER_SEARCH   5

Definition at line 337 of file qapplication_win.cpp.

◆ APPCOMMAND_BROWSER_STOP

#define APPCOMMAND_BROWSER_STOP   4

Definition at line 336 of file qapplication_win.cpp.

◆ APPCOMMAND_CLOSE

#define APPCOMMAND_CLOSE   31

Definition at line 367 of file qapplication_win.cpp.

◆ APPCOMMAND_COPY

#define APPCOMMAND_COPY   36

Definition at line 372 of file qapplication_win.cpp.

◆ APPCOMMAND_CORRECTION_LIST

#define APPCOMMAND_CORRECTION_LIST   45

Definition at line 381 of file qapplication_win.cpp.

◆ APPCOMMAND_CUT

#define APPCOMMAND_CUT   37

Definition at line 373 of file qapplication_win.cpp.

◆ APPCOMMAND_DICTATE_OR_COMMAND_CONTROL_TOGGLE

#define APPCOMMAND_DICTATE_OR_COMMAND_CONTROL_TOGGLE   43

Definition at line 379 of file qapplication_win.cpp.

◆ APPCOMMAND_FIND

#define APPCOMMAND_FIND   28

Definition at line 364 of file qapplication_win.cpp.

Referenced by QtWndProc().

◆ APPCOMMAND_FORWARD_MAIL

#define APPCOMMAND_FORWARD_MAIL   40

Definition at line 376 of file qapplication_win.cpp.

◆ APPCOMMAND_HELP

#define APPCOMMAND_HELP   27

Definition at line 363 of file qapplication_win.cpp.

Referenced by QtWndProc().

◆ APPCOMMAND_LAUNCH_APP1

#define APPCOMMAND_LAUNCH_APP1   17

Definition at line 349 of file qapplication_win.cpp.

◆ APPCOMMAND_LAUNCH_APP2

#define APPCOMMAND_LAUNCH_APP2   18

Definition at line 350 of file qapplication_win.cpp.

◆ APPCOMMAND_LAUNCH_MAIL

#define APPCOMMAND_LAUNCH_MAIL   15

Definition at line 347 of file qapplication_win.cpp.

◆ APPCOMMAND_LAUNCH_MEDIA_SELECT

#define APPCOMMAND_LAUNCH_MEDIA_SELECT   16

Definition at line 348 of file qapplication_win.cpp.

◆ APPCOMMAND_MEDIA_CHANNEL_DOWN

#define APPCOMMAND_MEDIA_CHANNEL_DOWN   52

Definition at line 388 of file qapplication_win.cpp.

◆ APPCOMMAND_MEDIA_CHANNEL_UP

#define APPCOMMAND_MEDIA_CHANNEL_UP   51

Definition at line 387 of file qapplication_win.cpp.

◆ APPCOMMAND_MEDIA_FAST_FORWARD

#define APPCOMMAND_MEDIA_FAST_FORWARD   49

Definition at line 385 of file qapplication_win.cpp.

◆ APPCOMMAND_MEDIA_NEXTTRACK

#define APPCOMMAND_MEDIA_NEXTTRACK   11

Definition at line 343 of file qapplication_win.cpp.

◆ APPCOMMAND_MEDIA_PAUSE

#define APPCOMMAND_MEDIA_PAUSE   47

Definition at line 383 of file qapplication_win.cpp.

◆ APPCOMMAND_MEDIA_PLAY

#define APPCOMMAND_MEDIA_PLAY   46

Definition at line 382 of file qapplication_win.cpp.

◆ APPCOMMAND_MEDIA_PLAY_PAUSE

#define APPCOMMAND_MEDIA_PLAY_PAUSE   14

Definition at line 346 of file qapplication_win.cpp.

◆ APPCOMMAND_MEDIA_PREVIOUSTRACK

#define APPCOMMAND_MEDIA_PREVIOUSTRACK   12

Definition at line 344 of file qapplication_win.cpp.

◆ APPCOMMAND_MEDIA_RECORD

#define APPCOMMAND_MEDIA_RECORD   48

Definition at line 384 of file qapplication_win.cpp.

◆ APPCOMMAND_MEDIA_REWIND

#define APPCOMMAND_MEDIA_REWIND   50

Definition at line 386 of file qapplication_win.cpp.

◆ APPCOMMAND_MEDIA_STOP

#define APPCOMMAND_MEDIA_STOP   13

Definition at line 345 of file qapplication_win.cpp.

◆ APPCOMMAND_MIC_ON_OFF_TOGGLE

#define APPCOMMAND_MIC_ON_OFF_TOGGLE   44

Definition at line 380 of file qapplication_win.cpp.

◆ APPCOMMAND_MICROPHONE_VOLUME_DOWN

#define APPCOMMAND_MICROPHONE_VOLUME_DOWN   25

Definition at line 361 of file qapplication_win.cpp.

◆ APPCOMMAND_MICROPHONE_VOLUME_MUTE

#define APPCOMMAND_MICROPHONE_VOLUME_MUTE   24

Definition at line 360 of file qapplication_win.cpp.

◆ APPCOMMAND_MICROPHONE_VOLUME_UP

#define APPCOMMAND_MICROPHONE_VOLUME_UP   26

Definition at line 362 of file qapplication_win.cpp.

◆ APPCOMMAND_NEW

#define APPCOMMAND_NEW   29

Definition at line 365 of file qapplication_win.cpp.

◆ APPCOMMAND_OPEN

#define APPCOMMAND_OPEN   30

Definition at line 366 of file qapplication_win.cpp.

◆ APPCOMMAND_PASTE

#define APPCOMMAND_PASTE   38

Definition at line 374 of file qapplication_win.cpp.

◆ APPCOMMAND_PRINT

#define APPCOMMAND_PRINT   33

Definition at line 369 of file qapplication_win.cpp.

◆ APPCOMMAND_REDO

#define APPCOMMAND_REDO   35

Definition at line 371 of file qapplication_win.cpp.

◆ APPCOMMAND_REPLY_TO_MAIL

#define APPCOMMAND_REPLY_TO_MAIL   39

Definition at line 375 of file qapplication_win.cpp.

◆ APPCOMMAND_SAVE

#define APPCOMMAND_SAVE   32

Definition at line 368 of file qapplication_win.cpp.

◆ APPCOMMAND_SEND_MAIL

#define APPCOMMAND_SEND_MAIL   41

Definition at line 377 of file qapplication_win.cpp.

◆ APPCOMMAND_SPELL_CHECK

#define APPCOMMAND_SPELL_CHECK   42

Definition at line 378 of file qapplication_win.cpp.

◆ APPCOMMAND_TREBLE_DOWN

#define APPCOMMAND_TREBLE_DOWN   22

Definition at line 354 of file qapplication_win.cpp.

Referenced by QtWndProc().

◆ APPCOMMAND_TREBLE_UP

#define APPCOMMAND_TREBLE_UP   23

Definition at line 355 of file qapplication_win.cpp.

Referenced by QtWndProc().

◆ APPCOMMAND_UNDO

#define APPCOMMAND_UNDO   34

Definition at line 370 of file qapplication_win.cpp.

◆ APPCOMMAND_VOLUME_DOWN

#define APPCOMMAND_VOLUME_DOWN   9

Definition at line 341 of file qapplication_win.cpp.

◆ APPCOMMAND_VOLUME_MUTE

#define APPCOMMAND_VOLUME_MUTE   8

Definition at line 340 of file qapplication_win.cpp.

◆ APPCOMMAND_VOLUME_UP

#define APPCOMMAND_VOLUME_UP   10

Definition at line 342 of file qapplication_win.cpp.

◆ COLOR_MENUBAR

#define COLOR_MENUBAR   30

Definition at line 297 of file qapplication_win.cpp.

◆ COLOR_MENUHILIGHT

#define COLOR_MENUHILIGHT   29

Definition at line 296 of file qapplication_win.cpp.

◆ CSR_TYPE

#define CSR_TYPE   20

Definition at line 179 of file qapplication_win.cpp.

Referenced by QtWndProc().

◆ FAPPCOMMAND_KEY

#define FAPPCOMMAND_KEY   0

Definition at line 324 of file qapplication_win.cpp.

Referenced by QtWndProc().

◆ FAPPCOMMAND_MASK

#define FAPPCOMMAND_MASK   0xF000

Definition at line 326 of file qapplication_win.cpp.

◆ FAPPCOMMAND_MOUSE

#define FAPPCOMMAND_MOUSE   0x8000

Definition at line 323 of file qapplication_win.cpp.

◆ FAPPCOMMAND_OEM

#define FAPPCOMMAND_OEM   0x1000

Definition at line 325 of file qapplication_win.cpp.

◆ FE_FONTSMOOTHINGCLEARTYPE

#define FE_FONTSMOOTHINGCLEARTYPE   0x0002

Definition at line 237 of file qapplication_win.cpp.

Referenced by qt_win_read_cleartype_settings().

◆ GET_APPCOMMAND_LPARAM

#define GET_APPCOMMAND_LPARAM (   lParam)    ((short)(HIWORD(lParam) & ~FAPPCOMMAND_MASK))

Definition at line 327 of file qapplication_win.cpp.

Referenced by QtWndProc().

◆ GET_DEVICE_LPARAM

#define GET_DEVICE_LPARAM (   lParam)    ((WORD)(HIWORD(lParam) & FAPPCOMMAND_MASK))

Definition at line 328 of file qapplication_win.cpp.

Referenced by QtWndProc().

◆ GET_FLAGS_LPARAM

#define GET_FLAGS_LPARAM (   lParam)    (LOWORD(lParam))

Definition at line 330 of file qapplication_win.cpp.

◆ GET_KEYSTATE_LPARAM

#define GET_KEYSTATE_LPARAM (   lParam)    GET_FLAGS_LPARAM(lParam)

Definition at line 331 of file qapplication_win.cpp.

Referenced by QtWndProc().

◆ GET_KEYSTATE_WPARAM

#define GET_KEYSTATE_WPARAM (   wParam)    (LOWORD(wParam))

Definition at line 307 of file qapplication_win.cpp.

Referenced by QETWidget::translateWheelEvent().

◆ GET_MOUSEORKEY_LPARAM

#define GET_MOUSEORKEY_LPARAM   GET_DEVICE_LPARAM

Definition at line 329 of file qapplication_win.cpp.

◆ GET_XBUTTON_WPARAM

#define GET_XBUTTON_WPARAM (   wParam)    (HIWORD(wParam))

Definition at line 308 of file qapplication_win.cpp.

Referenced by QETWidget::translateMouseEvent().

◆ GID_PRESSANDTAP

#define GID_PRESSANDTAP   7

Definition at line 127 of file qapplication_win.cpp.

◆ GID_ROLLOVER

#define GID_ROLLOVER   GID_PRESSANDTAP

Definition at line 128 of file qapplication_win.cpp.

Referenced by QETWidget::translateGestureEvent().

◆ GID_TWOFINGERTAP

#define GID_TWOFINGERTAP   6

Definition at line 126 of file qapplication_win.cpp.

Referenced by QETWidget::translateGestureEvent().

◆ GID_ZOOM

#define GID_ZOOM   3

Definition at line 125 of file qapplication_win.cpp.

Referenced by QETWidget::translateGestureEvent().

◆ GN_CONTEXTMENU

#define GN_CONTEXTMENU   1000

Definition at line 205 of file qapplication_win.cpp.

Referenced by QtWndProc().

◆ IMR_CONFIRMRECONVERTSTRING

#define IMR_CONFIRMRECONVERTSTRING   0x0005

Definition at line 193 of file qapplication_win.cpp.

Referenced by QtWndProc().

◆ IMR_RECONVERTSTRING

#define IMR_RECONVERTSTRING   4

Definition at line 189 of file qapplication_win.cpp.

Referenced by QtWndProc().

◆ MK_XBUTTON1

#define MK_XBUTTON1   0x0020

Definition at line 313 of file qapplication_win.cpp.

Referenced by decodeMSG(), and translateButtonState().

◆ MK_XBUTTON2

#define MK_XBUTTON2   0x0040

Definition at line 314 of file qapplication_win.cpp.

Referenced by decodeMSG(), and translateButtonState().

◆ PACKETDATA

#define PACKETDATA
Value:
(PK_X | PK_Y | PK_BUTTONS | PK_NORMAL_PRESSURE | PK_TANGENT_PRESSURE \
| PK_ORIENTATION | PK_CURSOR | PK_Z)

Definition at line 173 of file qapplication_win.cpp.

◆ PACKETMODE

#define PACKETMODE   0

Definition at line 175 of file qapplication_win.cpp.

◆ PEEKMESSAGE_IS_BROKEN

#define PEEKMESSAGE_IS_BROKEN   1

◆ RETURN

#define RETURN (   x)    { inLoop=false;return x; }

Definition at line 1460 of file qapplication_win.cpp.

Referenced by QtWndProc().

◆ SHRG_NOANIMATION

#define SHRG_NOANIMATION   0x00000010

Definition at line 207 of file qapplication_win.cpp.

Referenced by QtWndProc().

◆ SHRG_RETURNCMD

#define SHRG_RETURNCMD   0x00000001

Definition at line 206 of file qapplication_win.cpp.

Referenced by QtWndProc().

◆ SPI_GETFONTSMOOTHINGTYPE

#define SPI_GETFONTSMOOTHINGTYPE   0x200A

Definition at line 234 of file qapplication_win.cpp.

Referenced by qt_win_read_cleartype_settings().

◆ SPI_SETFONTSMOOTHINGTYPE

#define SPI_SETFONTSMOOTHINGTYPE   0x200B

Definition at line 231 of file qapplication_win.cpp.

Referenced by QtWndProc().

◆ SPI_SETSIPINFO

#define SPI_SETSIPINFO   224

Definition at line 211 of file qapplication_win.cpp.

Referenced by QtWndProc().

◆ TOUCHEVENTF_DOWN

#define TOUCHEVENTF_DOWN   0x0002

Definition at line 138 of file qapplication_win.cpp.

Referenced by QApplicationPrivate::translateTouchEvent().

◆ TOUCHEVENTF_INRANGE

#define TOUCHEVENTF_INRANGE   0x0008

Definition at line 140 of file qapplication_win.cpp.

◆ TOUCHEVENTF_MOVE

#define TOUCHEVENTF_MOVE   0x0001

Definition at line 137 of file qapplication_win.cpp.

◆ TOUCHEVENTF_NOCOALESCE

#define TOUCHEVENTF_NOCOALESCE   0x0020

Definition at line 142 of file qapplication_win.cpp.

◆ TOUCHEVENTF_PALM

#define TOUCHEVENTF_PALM   0x0080

Definition at line 144 of file qapplication_win.cpp.

◆ TOUCHEVENTF_PEN

#define TOUCHEVENTF_PEN   0x0040

Definition at line 143 of file qapplication_win.cpp.

◆ TOUCHEVENTF_PRIMARY

#define TOUCHEVENTF_PRIMARY   0x0010

Definition at line 141 of file qapplication_win.cpp.

Referenced by QApplicationPrivate::translateTouchEvent().

◆ TOUCHEVENTF_UP

#define TOUCHEVENTF_UP   0x0004

Definition at line 139 of file qapplication_win.cpp.

Referenced by QApplicationPrivate::translateTouchEvent().

◆ TOUCHINPUTMASKF_CONTACTAREA

#define TOUCHINPUTMASKF_CONTACTAREA   0x0004

Definition at line 148 of file qapplication_win.cpp.

Referenced by QApplicationPrivate::translateTouchEvent().

◆ TOUCHINPUTMASKF_EXTRAINFO

#define TOUCHINPUTMASKF_EXTRAINFO   0x0002

Definition at line 147 of file qapplication_win.cpp.

◆ TOUCHINPUTMASKF_TIMEFROMSYSTEM

#define TOUCHINPUTMASKF_TIMEFROMSYSTEM   0x0001

Definition at line 146 of file qapplication_win.cpp.

◆ WM_APPCOMMAND

#define WM_APPCOMMAND   0x0319

Definition at line 319 of file qapplication_win.cpp.

Referenced by QtWndProc().

◆ WM_GETOBJECT

#define WM_GETOBJECT   0x003D

Definition at line 110 of file qapplication_win.cpp.

Referenced by QtWndProc().

◆ WM_MOUSELEAVE

#define WM_MOUSELEAVE   0x02A3

Definition at line 402 of file qapplication_win.cpp.

Referenced by decodeMSG(), qt_try_modal(), and QtWndProc().

◆ WM_THEMECHANGED

#define WM_THEMECHANGED   0x031A

Definition at line 293 of file qapplication_win.cpp.

Referenced by QtWndProc().

◆ WM_TOUCH

#define WM_TOUCH   0x0240

Definition at line 133 of file qapplication_win.cpp.

Referenced by QtWndProc().

◆ WM_XBUTTONDBLCLK

#define WM_XBUTTONDBLCLK   0x020D

Definition at line 304 of file qapplication_win.cpp.

Referenced by qt_is_translatable_mouse_event(), and QtWndProc().

◆ WM_XBUTTONDOWN

#define WM_XBUTTONDOWN   0x020B

Definition at line 302 of file qapplication_win.cpp.

Referenced by qt_is_translatable_mouse_event(), and QtWndProc().

◆ WM_XBUTTONUP

#define WM_XBUTTONUP   0x020C

Definition at line 303 of file qapplication_win.cpp.

Referenced by QtWndProc().

◆ XBUTTON1

#define XBUTTON1   0x0001

Definition at line 309 of file qapplication_win.cpp.

Referenced by QETWidget::translateMouseEvent().

◆ XBUTTON2

#define XBUTTON2   0x0002

Definition at line 310 of file qapplication_win.cpp.

Referenced by QETWidget::translateMouseEvent().

Typedef Documentation

◆ AygRecognizeGesture

typedef DWORD(API * AygRecognizeGesture) (SHRGINFO *)

Definition at line 215 of file qapplication_win.cpp.

◆ LPTRACKMOUSEEVENT

◆ PTOUCHINPUT

typedef struct tagTOUCHINPUT * PTOUCHINPUT

◆ PtrSetProcessDPIAware

typedef BOOL(WINAPI * PtrSetProcessDPIAware) (VOID)

Definition at line 755 of file qapplication_win.cpp.

◆ PtrWTClose

typedef BOOL(API * PtrWTClose) (HCTX)

Definition at line 245 of file qapplication_win.cpp.

◆ PtrWTEnable

typedef BOOL(API * PtrWTEnable) (HCTX, BOOL)

Definition at line 247 of file qapplication_win.cpp.

◆ PtrWTGet

typedef BOOL(API * PtrWTGet) (HCTX, LPLOGCONTEXT)

Definition at line 250 of file qapplication_win.cpp.

◆ PtrWTInfo

typedef UINT(API * PtrWTInfo) (UINT, UINT, LPVOID)

Definition at line 246 of file qapplication_win.cpp.

◆ PtrWTOpen

typedef HCTX(API * PtrWTOpen) (HWND, LPLOGCONTEXT, BOOL)

Definition at line 244 of file qapplication_win.cpp.

◆ PtrWTOverlap

typedef BOOL(API * PtrWTOverlap) (HCTX, BOOL)

Definition at line 248 of file qapplication_win.cpp.

◆ PtrWTPacketsGet

typedef int(API * PtrWTPacketsGet) (HCTX, int, LPVOID)

Definition at line 249 of file qapplication_win.cpp.

◆ PtrWTQueueSizeGet

typedef int(API * PtrWTQueueSizeGet) (HCTX)

Definition at line 251 of file qapplication_win.cpp.

◆ PtrWTQueueSizeSet

typedef BOOL(API * PtrWTQueueSizeSet) (HCTX, int)

Definition at line 252 of file qapplication_win.cpp.

◆ QTabletCursorInfo

Definition at line 284 of file qapplication_win.cpp.

◆ TOUCHINPUT

typedef struct tagTOUCHINPUT TOUCHINPUT

◆ TRACKMOUSEEVENT

◆ WinClassNameHash

Definition at line 959 of file qapplication_win.cpp.

Function Documentation

◆ alert_widget()

static void alert_widget ( QWidget widget,
int  duration 
)
static

Definition at line 1348 of file qapplication_win.cpp.

Referenced by QtWndProc().

1349 {
1350 #ifdef Q_OS_WINCE
1351  Q_UNUSED(widget);
1352  Q_UNUSED(duration);
1353 #else
1354  bool stopFlash = duration < 0;
1355 
1356  if (widget && (!widget->isActiveWindow() || stopFlash)) {
1357  DWORD timeOut = GetCaretBlinkTime();
1358  if (timeOut <= 0)
1359  timeOut = 250;
1360 
1361  UINT flashCount;
1362  if (duration == 0)
1363  flashCount = 10;
1364  else
1365  flashCount = duration/timeOut;
1366 
1367  FLASHWINFO info;
1368  info.cbSize = sizeof(info);
1369  info.hwnd = widget->window()->winId();
1370  info.dwFlags = stopFlash ? FLASHW_STOP : FLASHW_TRAY;
1371  info.dwTimeout = stopFlash ? 0 : timeOut;
1372  info.uCount = stopFlash ? 0 : flashCount;
1373 
1374  FlashWindowEx(&info);
1375  }
1376 #endif
1377 }
static mach_timebase_info_data_t info
bool isActiveWindow
whether this widget&#39;s window is the active window
Definition: qwidget.h:186
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492
WId winId() const
Returns the window system identifier of the widget.
Definition: qwidget.cpp:2557
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ initWinTabFunctions()

static void initWinTabFunctions ( )
static

Definition at line 3762 of file qapplication_win.cpp.

Referenced by qt_init().

3763 {
3764 #if defined(Q_OS_WINCE)
3765  return;
3766 #else
3767  if (!qt_is_gui_used)
3768  return;
3769 
3770  QSystemLibrary library(QLatin1String("wintab32"));
3771  ptrWTInfo = (PtrWTInfo)library.resolve("WTInfoW");
3772  ptrWTGet = (PtrWTGet)library.resolve("WTGetW");
3773  ptrWTEnable = (PtrWTEnable)library.resolve("WTEnable");
3774  ptrWTOverlap = (PtrWTEnable)library.resolve("WTOverlap");
3775  ptrWTPacketsGet = (PtrWTPacketsGet)library.resolve("WTPacketsGet");
3776 #endif // Q_OS_WINCE
3777 }
BOOL(API * PtrWTEnable)(HCTX, BOOL)
static PtrWTEnable ptrWTEnable
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
static PtrWTGet ptrWTGet
UINT(API * PtrWTInfo)(UINT, UINT, LPVOID)
int(API * PtrWTPacketsGet)(HCTX, int, LPVOID)
static PtrWTPacketsGet ptrWTPacketsGet
static PtrWTInfo ptrWTInfo
static PtrWTOverlap ptrWTOverlap
bool qt_is_gui_used
BOOL(API * PtrWTGet)(HCTX, LPLOGCONTEXT)

◆ qGlobalPostedEventsCount()

uint qGlobalPostedEventsCount ( )

Definition at line 348 of file qcoreapplication.cpp.

Referenced by alert_widget().

349 {
350  QThreadData *currentThreadData = QThreadData::current();
351  return currentThreadData->postEventList.size() - currentThreadData->postEventList.startOffset;
352 }
QPostEventList postEventList
Definition: qthread_p.h:266
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
static QThreadData * current()

◆ qt_cleanup()

void qt_cleanup ( )

Definition at line 910 of file qapplication_win.cpp.

911 {
912  unregWinClasses();
914 
915 #ifndef QT_NO_CURSOR
918 #endif
919  QFont::cleanup();
921  if (displayDC) {
922  ReleaseDC(0, displayDC);
923  displayDC = 0;
924  }
925 
926 #ifndef QT_NO_IM
929 #endif
930 
931 #ifndef Q_WS_WINCE
932  // Deinitialize OLE/COM
933  OleUninitialize();
934 #endif
935 }
static void cleanup()
Internal function that cleans up the font system.
Definition: qfont_mac.cpp:93
static HDC displayDC
static void unregWinClasses()
static void clear()
Removes all pixmaps from the cache.
static QInputContext * inputContext
static void cleanup()
Definition: qcursor.cpp:402
static Type type()
Returns the type of application (Tty , GuiClient, or GuiServer).
static void cleanup()

◆ qt_colorref2qrgb()

QRgb qt_colorref2qrgb ( COLORREF  col)

Definition at line 412 of file qapplication_win.cpp.

Referenced by qt_set_windows_color_resources().

413 {
414  return qRgb(GetRValue(col),GetGValue(col),GetBValue(col));
415 }
QRgb qRgb(int r, int g, int b)
Returns the ARGB quadruplet (255, {r}, {g}, {b}).
Definition: qrgb.h:69

◆ qt_createWindowsAccessible()

IAccessible* qt_createWindowsAccessible ( QAccessibleInterface object)

Definition at line 713 of file qaccessible_win.cpp.

Referenced by QtWndProc().

714 {
716  IAccessible *iface;
717  acc->QueryInterface(IID_IAccessible, (void**)&iface);
718 
719  return iface;
720 }
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, LPVOID *)
int access(const char *, int)

◆ qt_dirtyRegion()

QRegion qt_dirtyRegion ( QWidget )

Definition at line 1111 of file qwidget.cpp.

Referenced by QWidgetBackingStore::hasStaticContents(), and QETWidget::translatePaintEvent().

1112 {
1113  if (!widget)
1114  return QRegion();
1115 
1117  if (!bs)
1118  return QRegion();
1119 
1120  return bs->dirtyRegion(widget);
1121 }
QPointer< QWidget > widget
The QRegion class specifies a clip region for a painter.
Definition: qregion.h:68
Q_GUI_EXPORT QWidgetPrivate * qt_widget_private(QWidget *widget)
Definition: qwidget.cpp:12920
QRegion dirtyRegion(QWidget *widget=0) const
Returns the region (in top-level coordinates) that needs repaint and/or flush.
QWidgetBackingStore * maybeBackingStore() const
Definition: qwidget_p.h:1036

◆ qt_get_tablet_widget()

QWidget* qt_get_tablet_widget ( )

Definition at line 137 of file qwidget_win.cpp.

Referenced by QtWndProc().

138 {
139  return qt_tablet_widget;
140 }
static QWidget * qt_tablet_widget

◆ qt_getRegisteredWndClass()

Q_GUI_EXPORT const QString qt_getRegisteredWndClass ( )

Definition at line 1118 of file qapplication_win.cpp.

Referenced by pfiToQGLFormat().

1119 {
1120  return qt_reg_winclass(0);
1121 }
const QString qt_reg_winclass(QWidget *w)

◆ qt_grab_cursor()

QCursor* qt_grab_cursor ( )

Definition at line 858 of file qwidget_win.cpp.

Referenced by qt_try_modal(), and QETWidget::translateMouseEvent().

859 {
860  return mouseGrbCur;
861 }
static QCursor * mouseGrbCur

◆ qt_init()

void qt_init ( QApplicationPrivate priv,
int   
)

Definition at line 765 of file qapplication_win.cpp.

766 {
767 
768  int argc = priv->argc;
769  char **argv = priv->argv;
770  int i, j;
771 
772  // Get command line params
773 
774  j = argc ? 1 : 0;
775  for (i=1; i<argc; i++) {
776  if (argv[i] && *argv[i] != '-') {
777  argv[j++] = argv[i];
778  continue;
779  }
780 #if defined(QT_DEBUG)
781  if (qstrcmp(argv[i], "-nograb") == 0)
782  appNoGrab = !appNoGrab;
783  else
784 #endif // QT_DEBUG
785  argv[j++] = argv[i];
786  }
787  if(j < priv->argc) {
788  priv->argv[j] = 0;
789  priv->argc = j;
790  }
791 
792 #ifndef Q_WS_WINCE
793  // No message boxes but important ones
795 #endif
796 
797 #ifndef Q_WS_WINCE
798  // Initialize OLE/COM
799  // S_OK means success and S_FALSE means that it has already
800  // been initialized
801  HRESULT r;
802  r = OleInitialize(0);
803  if (r != S_OK && r != S_FALSE) {
804  qWarning("Qt: Could not initialize OLE (error %x)", (unsigned int)r);
805  }
806 #endif
807 
808  // Misc. initialization
809 #if defined(QT_DEBUG) && !defined(Q_WS_WINCE)
810  GdiSetBatchLimit(1);
811 #endif
812 
813  // initialize key mapper
815 
818 #ifndef QT_NO_CURSOR
821 #endif
822  qApp->setObjectName(priv->appName());
823 
824  // default font
825 #ifndef Q_WS_WINCE
826  HGDIOBJ stockFont = GetStockObject(DEFAULT_GUI_FONT);
827 #else
828  HGDIOBJ stockFont = GetStockObject(SYSTEM_FONT);
829 #endif
830 
831  LOGFONT lf;
832  GetObject(stockFont, sizeof(lf), &lf);
833  QFont systemFont = qt_LOGFONTtoQFont(lf, true);
834 
835 #ifndef Q_WS_WINCE
836  if (systemFont.family() == QLatin1String("MS Shell Dlg")) {
837  systemFont.setFamily(QLatin1String("MS Shell Dlg 2"));
838  }
839 #endif
840 
842 
843  // QFont::locale_init(); ### Uncomment when it does something on Windows
844 
847 
848 #ifndef QT_NO_TABLETEVENT
850 #endif // QT_NO_TABLETEVENT
851 
852 #ifndef QT_NO_IM
854 #endif
855 
856  // Read the initial cleartype settings...
858  qt_win_owndc_required = false;
859 
860  extern void qt_win_initialize_directdraw();
862 
863 #ifndef Q_OS_WINCE
864  QSystemLibrary user32(QLatin1String("user32"));
865  ptrUpdateLayeredWindowIndirect = (PtrUpdateLayeredWindowIndirect)user32.resolve("UpdateLayeredWindowIndirect");
866  ptrUpdateLayeredWindow = (PtrUpdateLayeredWindow)user32.resolve("UpdateLayeredWindow");
867 
870 
871  // Notify Vista and Windows 7 that we support highter DPI settings
872  ptrSetProcessDPIAware = (PtrSetProcessDPIAware)user32.resolve("SetProcessDPIAware");
875 #endif
876 
877 #ifndef QT_NO_GESTURES
878  priv->GetGestureInfo = 0;
879  priv->GetGestureExtraArgs = 0;
880  priv->CloseGestureInfoHandle = 0;
881  priv->SetGestureConfig = 0;
882  priv->GetGestureConfig = 0;
883  priv->BeginPanningFeedback = 0;
884  priv->UpdatePanningFeedback = 0;
885  priv->EndPanningFeedback = 0;
886 
887 #if defined(Q_WS_WINCE_WM) && defined(QT_WINCE_GESTURES)
888  priv->GetGestureInfo = (PtrGetGestureInfo) &TKGetGestureInfo;
889  priv->GetGestureExtraArgs = (PtrGetGestureExtraArgs) &TKGetGestureExtraArguments;
890 #elif !defined(Q_WS_WINCE)
891  #if !defined(QT_NO_NATIVE_GESTURES)
892  priv->GetGestureInfo = (PtrGetGestureInfo)user32.resolve("GetGestureInfo");
893  priv->GetGestureExtraArgs = (PtrGetGestureExtraArgs)user32.resolve("GetGestureExtraArgs");
894  priv->CloseGestureInfoHandle = (PtrCloseGestureInfoHandle)user32.resolve("CloseGestureInfoHandle");
895  priv->SetGestureConfig = (PtrSetGestureConfig)user32.resolve("SetGestureConfig");
896  priv->GetGestureConfig = (PtrGetGestureConfig)user32.resolve("GetGestureConfig");
897  #endif // QT_NO_NATIVE_GESTURES
898  QSystemLibrary libTheme(QLatin1String("uxtheme"));
899  priv->BeginPanningFeedback = (PtrBeginPanningFeedback)libTheme.resolve("BeginPanningFeedback");
900  priv->UpdatePanningFeedback = (PtrUpdatePanningFeedback)libTheme.resolve("UpdatePanningFeedback");
901  priv->EndPanningFeedback = (PtrEndPanningFeedback)libTheme.resolve("EndPanningFeedback");
902 #endif
903 #endif // QT_NO_GESTURES
904 }
BOOL(WINAPI * PtrEndPanningFeedback)(HWND, BOOL)
PtrUpdateLayeredWindowIndirect ptrUpdateLayeredWindowIndirect
QFont qt_LOGFONTtoQFont(LOGFONT &lf, bool scale)
Definition: qfont_win.cpp:64
#define SEM_FAILCRITICALERRORS
PtrSetGestureConfig SetGestureConfig
PtrUpdatePanningFeedback UpdatePanningFeedback
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
BOOL(WINAPI * PtrSetGestureConfig)(HWND, DWORD, UINT, PVOID, UINT)
QString appName() const
int qstrcmp(const char *str1, const char *str2)
A safe strcmp() function.
Definition: qbytearray.cpp:231
PtrEndPanningFeedback EndPanningFeedback
BOOL(WINAPI * PtrBeginPanningFeedback)(HWND)
PtrGetGestureInfo GetGestureInfo
BOOL(WINAPI * PtrUpdateLayeredWindow)(HWND hwnd, HDC hdcDst, const POINT *pptDst, const SIZE *psize, HDC hdcSrc, const POINT *pptSrc, COLORREF crKey, const BLENDFUNCTION *pblend, DWORD dwflags)
Q_GUI_EXPORT bool qt_win_owndc_required
static BOOL WINAPI qt_updateLayeredWindowIndirect(HWND hwnd, const Q_UPDATELAYEREDWINDOWINFO *info)
BOOL(WINAPI * PtrCloseGestureInfoHandle)(HANDLE)
void setFamily(const QString &)
Sets the family name of the font.
Definition: qfont.cpp:924
#define DEFAULT_GUI_FONT
static void setSystemFont(const QFont &font)
static void initialize()
Internal function that initializes the font system.
Definition: qfont_mac.cpp:131
#define qApp
BOOL(WINAPI * PtrUpdatePanningFeedback)(HWND, LONG, LONG, BOOL)
Q_CORE_EXPORT void qWarning(const char *,...)
PtrGetGestureExtraArgs GetGestureExtraArgs
BOOL(WINAPI * PtrGetGestureExtraArgs)(HANDLE, UINT, PBYTE)
#define SetErrorMode(a)
static void initWinTabFunctions()
long HRESULT
static QInputContext * inputContext
The QFont class specifies a font used for drawing text.
Definition: qfont.h:64
BOOL(WINAPI * PtrGetGestureConfig)(HWND, DWORD, DWORD, PUINT, PVOID, UINT)
QString family() const
Returns the requested font family name, i.e.
Definition: qfont.cpp:906
BOOL(WINAPI * PtrGetGestureInfo)(HANDLE, PVOID)
static void changeKeyboard()
Definition: qkeymapper.cpp:90
PtrCloseGestureInfoHandle CloseGestureInfoHandle
static void initialize()
static void qt_win_read_cleartype_settings()
static bool desktopSettingsAware()
Returns true if Qt is set to use the system&#39;s standard colors, fonts, etc.
static HFONT systemFont()
#define SEM_NOOPENFILEERRORBOX
BOOL(WINAPI * PtrSetProcessDPIAware)(VOID)
static void initialize()
Definition: qcursor.cpp:417
static PtrSetProcessDPIAware ptrSetProcessDPIAware
void qt_win_initialize_directdraw()
static void qt_set_windows_resources()
static bool appNoGrab
static Type type()
Returns the type of application (Tty , GuiClient, or GuiServer).
BOOL(WINAPI * PtrUpdateLayeredWindowIndirect)(HWND hwnd, const Q_UPDATELAYEREDWINDOWINFO *pULWInfo)
PtrGetGestureConfig GetGestureConfig
PtrUpdateLayeredWindow ptrUpdateLayeredWindow
PtrBeginPanningFeedback BeginPanningFeedback

◆ qt_is_translatable_mouse_event()

static bool qt_is_translatable_mouse_event ( UINT  message)
static

Definition at line 1462 of file qapplication_win.cpp.

Referenced by QtWndProc().

1463 {
1464  return (((message >= WM_MOUSEFIRST && message <= WM_MOUSELAST) ||
1465  (message >= WM_XBUTTONDOWN && message <= WM_XBUTTONDBLCLK))
1466  && message != WM_MOUSEWHEEL
1467  && message != WM_MOUSEHWHEEL)
1468 
1469 #ifndef Q_WS_WINCE
1470  || (message >= WM_NCMOUSEMOVE && message <= WM_NCMBUTTONDBLCLK)
1471 #endif
1472  ;
1473 }
#define WM_MOUSEWHEEL
Definition: qt_windows.h:116
#define WM_MOUSEHWHEEL
Definition: qt_windows.h:119
#define WM_XBUTTONDBLCLK
#define WM_XBUTTONDOWN

◆ qt_LOGFONTtoQFont()

QFont qt_LOGFONTtoQFont ( LOGFONT &  lf,
bool  scale 
)

Definition at line 64 of file qfont_win.cpp.

Referenced by QETWidget::forceUpdate(), qt_init(), and qt_set_windows_font_resources().

65 {
66  QString family = QString::fromWCharArray(lf.lfFaceName);
67  QFont qf(family);
68  qf.setItalic(lf.lfItalic);
69  if (lf.lfWeight != FW_DONTCARE)
70  qf.setWeight(weightFromInteger(lf.lfWeight));
71  int lfh = qAbs(lf.lfHeight);
72  qf.setPointSizeF(lfh * 72.0 / GetDeviceCaps(shared_dc(),LOGPIXELSY));
73  qf.setUnderline(false);
74  qf.setOverline(false);
75  qf.setStrikeOut(false);
76  return qf;
77 }
static QString fromWCharArray(const wchar_t *, int size=-1)
Returns a copy of the string, where the encoding of string depends on the size of wchar...
Definition: qstring.cpp:1019
QFont::Weight weightFromInteger(int weight)
The QString class provides a Unicode character string.
Definition: qstring.h:83
Q_DECL_CONSTEXPR T qAbs(const T &t)
Definition: qglobal.h:1201
The QFont class specifies a font used for drawing text.
Definition: qfont.h:64
HDC shared_dc()

◆ qt_nograb()

bool qt_nograb ( )

Definition at line 950 of file qapplication_win.cpp.

Referenced by qt_try_modal().

951 {
952 #if defined(QT_DEBUG)
953  return appNoGrab;
954 #else
955  return false;
956 #endif
957 }
static bool appNoGrab

◆ qt_reg_winclass()

const QString qt_reg_winclass ( QWidget w)

Definition at line 969 of file qapplication_win.cpp.

Referenced by qt_getRegisteredWndClass(), qt_tablet_cleanup(), and qt_tablet_cleanup_wce().

970 {
971  Qt::WindowFlags flags = w ? w->windowFlags() : (Qt::WindowFlags)0;
972  Qt::WindowFlags type = flags & Qt::WindowType_Mask;
973 
974  uint style;
975  bool icon;
976  QString cname;
977  if (w && qt_widget_private(w)->isGLWidget) {
978  cname = QLatin1String("QGLWidget");
979  style = CS_DBLCLKS;
980 #ifndef Q_WS_WINCE
981  style |= CS_OWNDC;
982 #endif
983  icon = true;
984  } else if (w && (flags & Qt::MSWindowsOwnDC)) {
985  cname = QLatin1String("QWidgetOwnDC");
986  style = CS_DBLCLKS;
987 #ifndef Q_WS_WINCE
988  style |= CS_OWNDC;
989 #endif
990  icon = true;
991  } else if (w && (type == Qt::Tool || type == Qt::ToolTip)) {
992  style = CS_DBLCLKS;
993  if (type == Qt::ToolTip || w->inherits("QTipLabel") || w->inherits("QAlphaWidget")) {
996  style |= CS_DROPSHADOW;
997  }
998  cname = QLatin1String("QToolTip");
999  } else {
1000  cname = QLatin1String("QTool");
1001  }
1002 #ifndef Q_WS_WINCE
1003  style |= CS_SAVEBITS;
1004 #endif
1005  icon = false;
1006  } else if (w && (type == Qt::Popup)) {
1007  cname = QLatin1String("QPopup");
1008  style = CS_DBLCLKS;
1009 #ifndef Q_WS_WINCE
1010  style |= CS_SAVEBITS;
1011 #endif
1014  style |= CS_DROPSHADOW;
1015  icon = false;
1016  } else {
1017  cname = QLatin1String("QWidget");
1018  style = CS_DBLCLKS;
1019  icon = true;
1020  }
1021 
1022 #ifndef Q_WS_WINCE
1023  // force CS_OWNDC when the GL graphics system is
1024  // used as the default renderer
1026  style |= CS_OWNDC;
1027 #endif
1028 
1029 #ifdef Q_OS_WINCE
1030  // We need to register the classes with the
1031  // unique ID on WinCE to make sure we can
1032  // move the windows to the front when starting
1033  // a second instance.
1034  wchar_t uniqueAppID[MAX_PATH];
1035  GetModuleFileName(0, uniqueAppID, MAX_PATH);
1036  cname = QString::number(RegisterWindowMessage(
1037  (const wchar_t *) QString::fromWCharArray(uniqueAppID).toLower().replace(QLatin1Char('\\'),
1038  QLatin1Char('_')).utf16()));
1039 #endif
1040 
1041  // since multiple Qt versions can be used in one process
1042  // each one has to have window class names with a unique name
1043  // The first instance gets the unmodified name; if the class
1044  // has already been registered by another instance of Qt then
1045  // add an instance-specific ID, the address of the window proc.
1046  static int classExists = -1;
1047 
1048  if (classExists == -1) {
1049  WNDCLASS wcinfo;
1050  classExists = GetClassInfo((HINSTANCE)qWinAppInst(), (wchar_t*)cname.utf16(), &wcinfo);
1051  classExists = classExists && wcinfo.lpfnWndProc != QtWndProc;
1052  }
1053 
1054  if (classExists)
1055  cname += QString::number((quintptr)QtWndProc);
1056 
1057  if (winclassNames()->contains(cname)) // already registered in our list
1058  return cname;
1059 
1060 #ifndef Q_WS_WINCE
1061  WNDCLASSEX wc;
1062  wc.cbSize = sizeof(WNDCLASSEX);
1063 #else
1064  WNDCLASS wc;
1065 #endif
1066  wc.style = style;
1067  wc.lpfnWndProc = (WNDPROC)QtWndProc;
1068  wc.cbClsExtra = 0;
1069  wc.cbWndExtra = 0;
1070  wc.hInstance = qWinAppInst();
1071  if (icon) {
1072  wc.hIcon = (HICON)LoadImage(qWinAppInst(), L"IDI_ICON1", IMAGE_ICON, 0, 0, LR_DEFAULTSIZE);
1073 #ifndef Q_WS_WINCE
1074  if (wc.hIcon) {
1075  int sw = GetSystemMetrics(SM_CXSMICON);
1076  int sh = GetSystemMetrics(SM_CYSMICON);
1077  wc.hIconSm = (HICON)LoadImage(qWinAppInst(), L"IDI_ICON1", IMAGE_ICON, sw, sh, 0);
1078  } else {
1079  wc.hIcon = (HICON)LoadImage(0, IDI_APPLICATION, IMAGE_ICON, 0, 0, LR_DEFAULTSIZE | LR_SHARED);
1080  wc.hIconSm = 0;
1081  }
1082 #endif
1083  } else {
1084  wc.hIcon = 0;
1085 #ifndef Q_WS_WINCE
1086  wc.hIconSm = 0;
1087 #endif
1088  }
1089  wc.hCursor = 0;
1090 #ifndef Q_WS_WINCE
1091  HBRUSH brush = 0;
1092  if (w && !qt_widget_private(w)->isGLWidget)
1093  brush = (HBRUSH)GetSysColorBrush(COLOR_WINDOW);
1094  wc.hbrBackground = brush;
1095 #else
1096  wc.hbrBackground = 0;
1097 #endif
1098  wc.lpszMenuName = 0;
1099  wc.lpszClassName = (wchar_t*)cname.utf16();
1100 
1101 #ifndef Q_WS_WINCE
1102  ATOM atom = RegisterClassEx(&wc);
1103 #else
1104  ATOM atom = RegisterClass(&wc);
1105 #endif
1106 
1107 #ifndef QT_NO_DEBUG
1108  if (!atom)
1109  qErrnoWarning("QApplication::regClass: Registering window class failed.");
1110 #else
1111  Q_UNUSED(atom);
1112 #endif
1113 
1114  winclassNames()->insert(cname, 1);
1115  return cname;
1116 }
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qstring.cpp:6448
static QString fromWCharArray(const wchar_t *, int size=-1)
Returns a copy of the string, where the encoding of string depends on the size of wchar...
Definition: qstring.cpp:1019
int type
Definition: qmetatype.cpp:239
QIntegerForSizeof< void * >::Unsigned quintptr
Definition: qglobal.h:986
#define LR_SHARED
Definition: qt_windows.h:147
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
static const WinVersion WindowsVersion
the version of the Windows operating system on which the application is run (Windows only) ...
Definition: qglobal.h:1613
The QString class provides a Unicode character string.
Definition: qstring.h:83
Q_GUI_EXPORT bool qt_win_owndc_required
#define ATOM(x)
Definition: qt_x11_p.h:723
unsigned int uint
Definition: qglobal.h:996
#define LR_DEFAULTSIZE
Definition: qt_windows.h:144
bool inherits(const char *classname) const
Returns true if this object is an instance of a class that inherits className or a QObject subclass t...
Definition: qobject.h:275
LRESULT QT_WIN_CALLBACK QtWndProc(HWND, UINT, WPARAM, LPARAM)
Q_CORE_EXPORT HINSTANCE qWinAppInst()
Qt::WindowFlags windowFlags() const
Window flags are a combination of a type (e.
Definition: qwidget.h:939
Q_GUI_EXPORT QWidgetPrivate * qt_widget_private(QWidget *widget)
Definition: qwidget.cpp:12920
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55
const ushort * utf16() const
Returns the QString as a &#39;\0\&#39;-terminated array of unsigned shorts.
Definition: qstring.cpp:5290
#define CS_DROPSHADOW
Definition: qt_windows.h:136
void qErrnoWarning(const char *msg,...)
Definition: qglobal.cpp:2954

◆ qt_sendSpontaneousEvent()

bool qt_sendSpontaneousEvent ( QObject ,
QEvent  
)

Definition at line 5779 of file qapplication.cpp.

Referenced by QtWndProc(), and QETWidget::translateGestureEvent().

5780 {
5782 }
EventRef event
static bool sendSpontaneousEvent(QObject *receiver, QEvent *event)

◆ qt_set_windows_color_resources()

static void qt_set_windows_color_resources ( )
static

Definition at line 504 of file qapplication_win.cpp.

Referenced by QtWndProc().

505 {
506  // Do the color settings
507  QPalette pal;
509  QColor(qt_colorref2qrgb(GetSysColor(COLOR_WINDOWTEXT))));
511  QColor(qt_colorref2qrgb(GetSysColor(COLOR_BTNFACE))));
513  QColor(qt_colorref2qrgb(GetSysColor(COLOR_BTNHIGHLIGHT))));
515  QColor(qt_colorref2qrgb(GetSysColor(COLOR_BTNSHADOW))));
516  pal.setColor(QPalette::Mid, pal.button().color().darker(150));
518  QColor(qt_colorref2qrgb(GetSysColor(COLOR_WINDOWTEXT))));
520  QColor(qt_colorref2qrgb(GetSysColor(COLOR_BTNHIGHLIGHT))));
522  QColor(qt_colorref2qrgb(GetSysColor(COLOR_WINDOW))));
524  QColor(qt_colorref2qrgb(GetSysColor(COLOR_BTNFACE))));
526  QColor(qt_colorref2qrgb(GetSysColor(COLOR_BTNTEXT))));
528  QColor(qt_colorref2qrgb(GetSysColor(COLOR_3DLIGHT))));
530  QColor(qt_colorref2qrgb(GetSysColor(COLOR_3DDKSHADOW))));
532  QColor(qt_colorref2qrgb(GetSysColor(COLOR_HIGHLIGHT))));
534  QColor(qt_colorref2qrgb(GetSysColor(COLOR_HIGHLIGHTTEXT))));
535 
536 #if defined(Q_WS_WINCE)
537  // ### hardcoded until I find out how to get it from the system settings.
539  pal.setColor(QPalette::Link, pal.highlight().color().light(130));
540  // Background == Base on Windows CE
542  pal.setColor(QPalette::Background, pal.base().color());
543 #else
546 #endif
547 
548 
549 
554 
555  if (pal.midlight() == pal.button())
556  pal.setColor(QPalette::Midlight, pal.button().color().lighter(110));
557  if (pal.background() != pal.base()) {
560  }
561 
562  const QColor bg = pal.background().color();
563  const QColor fg = pal.foreground().color(), btn = pal.button().color();
564  QColor disabled((fg.red()+btn.red())/2,(fg.green()+btn.green())/2,
565  (fg.blue()+btn.blue())/2);
566  pal.setColorGroup(QPalette::Disabled, pal.foreground(), pal.button(), pal.light(),
567  pal.dark(), pal.mid(), pal.text(), pal.brightText(), pal.base(), pal.background() );
572  QColor(qt_colorref2qrgb(GetSysColor(COLOR_HIGHLIGHT))));
574  QColor(qt_colorref2qrgb(GetSysColor(COLOR_HIGHLIGHTTEXT))));
576 
578 
580 
581  QColor ttip(qt_colorref2qrgb(GetSysColor(COLOR_INFOBK)));
582 
583  QColor ttipText(qt_colorref2qrgb(GetSysColor(COLOR_INFOTEXT)));
584  {
585 #ifndef QT_NO_TOOLTIP
586  QPalette tiplabel(pal);
587  tiplabel.setColor(QPalette::All, QPalette::Button, ttip);
588  tiplabel.setColor(QPalette::All, QPalette::Window, ttip);
589  tiplabel.setColor(QPalette::All, QPalette::Text, ttipText);
590  tiplabel.setColor(QPalette::All, QPalette::WindowText, ttipText);
591  tiplabel.setColor(QPalette::All, QPalette::ButtonText, ttipText);
592  tiplabel.setColor(QPalette::All, QPalette::Button, ttip);
593  tiplabel.setColor(QPalette::All, QPalette::Window, ttip);
594  tiplabel.setColor(QPalette::All, QPalette::Text, ttipText);
595  tiplabel.setColor(QPalette::All, QPalette::WindowText, ttipText);
596  tiplabel.setColor(QPalette::All, QPalette::ButtonText, ttipText);
597  const QColor fg = tiplabel.foreground().color(), btn = tiplabel.button().color();
598  QColor disabled((fg.red()+btn.red())/2,(fg.green()+btn.green())/2,
599  (fg.blue()+btn.blue())/2);
600  tiplabel.setColor(QPalette::Disabled, QPalette::WindowText, disabled);
601  tiplabel.setColor(QPalette::Disabled, QPalette::Text, disabled);
602  tiplabel.setColor(QPalette::Disabled, QPalette::Base, Qt::white);
604  QToolTip::setPalette(tiplabel);
605 #endif //QT_NO_TOOLTIP
606  }
607 }
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition: qcolor.h:67
const QBrush & highlight() const
Returns the highlight brush of the current color group.
Definition: qpalette.h:140
const QBrush & base() const
Returns the base brush of the current color group.
Definition: qpalette.h:130
const QBrush & brightText() const
Returns the bright text foreground brush of the current color group.
Definition: qpalette.h:137
#define disabled
const QColor & color() const
Returns the brush color.
Definition: qbrush.h:183
bool qt_wince_is_smartphone()
const QBrush & dark() const
Returns the dark brush of the current color group.
Definition: qpalette.h:127
static void initializeWidgetPaletteHash()
const QBrush & background() const
Use window() instead.
Definition: qpalette.h:134
QRgb qt_colorref2qrgb(COLORREF col)
const QBrush & foreground() const
Use windowText() instead.
Definition: qpalette.h:123
ushort red
Returns the red color component of this color.
Definition: qcolor.h:243
bool qt_wince_is_pocket_pc()
const QColor & color(ColorGroup cg, ColorRole cr) const
Returns the color in the specified color group, used for the given color role.
Definition: qpalette.h:107
QColor darker(int f=200) const
Returns a darker (or lighter) color, but does not change this object.
Definition: qcolor.h:301
const QBrush & light() const
Returns the light brush of the current color group.
Definition: qpalette.h:126
QColor dark(int f=200) const
Use darker(factor) instead.
Definition: qcolor.cpp:2447
const QBrush & midlight() const
Returns the midlight brush of the current color group.
Definition: qpalette.h:136
const QBrush & mid() const
Returns the mid brush of the current color group.
Definition: qpalette.h:128
void setColorGroup(ColorGroup cr, const QBrush &windowText, const QBrush &button, const QBrush &light, const QBrush &dark, const QBrush &mid, const QBrush &text, const QBrush &bright_text, const QBrush &base, const QBrush &window)
Sets a the group at cg.
Definition: qpalette.cpp:1246
ushort blue
Returns the blue color component of this color.
Definition: qcolor.h:245
void setColor(ColorGroup cg, ColorRole cr, const QColor &color)
Sets the color in the specified color group, used for the given color role, to the specified solid co...
Definition: qpalette.h:201
static void setSystemPalette(const QPalette &pal)
QColor lighter(int f=150) const
Returns a lighter (or darker) color, but does not change this object.
Definition: qcolor.h:298
const QBrush & button() const
Returns the button brush of the current color group.
Definition: qpalette.h:125
static void setPalette(const QPalette &)
Sets the palette used to render tooltips.
Definition: qtooltip.cpp:586
ushort green
Returns the green color component of this color.
Definition: qcolor.h:244
const QBrush & text() const
Returns the text foreground brush of the current color group.
Definition: qpalette.h:129
QColor light(int f=150) const
Use lighter(factor) instead.
Definition: qcolor.cpp:2391
The QPalette class contains color groups for each widget state.
Definition: qpalette.h:61

◆ qt_set_windows_font_resources()

static void qt_set_windows_font_resources ( )
static

Definition at line 609 of file qapplication_win.cpp.

Referenced by QtWndProc().

610 {
611 #ifndef Q_WS_WINCE
612  NONCLIENTMETRICS ncm;
613  ncm.cbSize = FIELD_OFFSET(NONCLIENTMETRICS, lfMessageFont) + sizeof(LOGFONT);
614  SystemParametersInfo(SPI_GETNONCLIENTMETRICS, ncm.cbSize , &ncm, 0);
615 
616  QFont menuFont = qt_LOGFONTtoQFont(ncm.lfMenuFont, true);
617  QFont messageFont = qt_LOGFONTtoQFont(ncm.lfMessageFont, true);
618  QFont statusFont = qt_LOGFONTtoQFont(ncm.lfStatusFont, true);
619  QFont titleFont = qt_LOGFONTtoQFont(ncm.lfCaptionFont, true);
620 
621  LOGFONT lfIconTitleFont;
622  SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(lfIconTitleFont), &lfIconTitleFont, 0);
623  QFont iconTitleFont = qt_LOGFONTtoQFont(lfIconTitleFont, true);
624 
625  QApplication::setFont(menuFont, "QMenu");
626  QApplication::setFont(menuFont, "QMenuBar");
627  QApplication::setFont(messageFont, "QMessageBox");
628  QApplication::setFont(statusFont, "QTipLabel");
629  QApplication::setFont(statusFont, "QStatusBar");
630  QApplication::setFont(titleFont, "Q3TitleBar");
631  QApplication::setFont(titleFont, "QWorkspaceTitleBar");
632  QApplication::setFont(iconTitleFont, "QAbstractItemView");
633  QApplication::setFont(iconTitleFont, "QDockWidgetTitle");
634 
635 #else
636  LOGFONT lf;
637  HGDIOBJ stockFont = GetStockObject(SYSTEM_FONT);
638  GetObject(stockFont, sizeof(lf), &lf);
639  QFont systemFont = qt_LOGFONTtoQFont(lf, true);
641  QFont smallerFont = systemFont;
642  if (qt_wince_is_mobile()) {
643  smallerFont.setPointSize(systemFont.pointSize()-1);
644  QApplication::setFont(smallerFont, "QTabBar");
645  smallerFont.setBold(true);
646  QApplication::setFont(smallerFont, "QAbstractButton");
647  }
648 #endif// Q_WS_WINCE
649 }
void setPointSize(int)
Sets the point size to pointSize.
Definition: qfont.cpp:1099
QFont qt_LOGFONTtoQFont(LOGFONT &lf, bool scale)
Definition: qfont_win.cpp:64
bool qt_wince_is_mobile()
static void setSystemFont(const QFont &font)
void setBold(bool)
If enable is true sets the font&#39;s weight to QFont::Bold ; otherwise sets the weight to QFont::Normal...
Definition: qfont.h:352
The QFont class specifies a font used for drawing text.
Definition: qfont.h:64
static HFONT systemFont()
int pointSize() const
Returns the point size of the font.
Definition: qfont.cpp:981
static void setFont(const QFont &, const char *className=0)
Changes the default application font to font.

◆ qt_set_windows_resources()

static void qt_set_windows_resources ( )
static

Definition at line 674 of file qapplication_win.cpp.

Referenced by qt_init().

675 {
677  (void) QApplication::style(); // trigger creation of application style
680 }
static void qt_set_windows_font_resources()
static QStyle * style()
Returns the application&#39;s style object.
static Type type()
Returns the type of application (Tty , GuiClient, or GuiServer).
static void qt_set_windows_color_resources()

◆ qt_set_windows_updateScrollBar()

static void qt_set_windows_updateScrollBar ( QWidget widget)
static

Definition at line 734 of file qapplication_win.cpp.

Referenced by QtWndProc().

735 {
736  QList<QObject*> children = widget->children();
737  for (int i = 0; i < children.size(); ++i) {
738  QObject *o = children.at(i);
739  if(!o->isWidgetType())
740  continue;
741  if (QWidget *w = static_cast<QWidget *>(o))
743  }
744 #ifndef QT_NO_SCROLLBAR
745  if (qobject_cast<QScrollBar*>(widget))
746  widget->updateGeometry();
747 #endif
748 }
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
bool isWidgetType() const
Returns true if the object is a widget; otherwise returns false.
Definition: qobject.h:146
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
const QObjectList & children() const
Returns a list of child objects.
Definition: qobject.h:197
void updateGeometry()
Notifies the layout system that this widget has changed and may need to change geometry.
Definition: qwidget.cpp:10372
static void qt_set_windows_updateScrollBar(QWidget *widget)
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ qt_try_modal()

bool qt_try_modal ( QWidget widget,
MSG msg,
int &  ret 
)
static

Definition at line 2767 of file qapplication_win.cpp.

Referenced by QtWndProc(), and QETWidget::translateWheelEvent().

2768 {
2769 #if defined(Q_OS_WINCE)
2770  Q_UNUSED(ret);
2771 #endif
2772  QWidget * top = 0;
2773 
2774  if (QApplicationPrivate::tryModalHelper(widget, &top))
2775  return true;
2776 
2777  int type = msg->message;
2778 
2779  bool block_event = false;
2780 #ifndef Q_WS_WINCE
2781  if (type != WM_NCHITTEST) {
2782 #endif
2783  if ((type >= WM_MOUSEFIRST && type <= WM_MOUSELAST) ||
2784  type == WM_MOUSEWHEEL || type == WM_MOUSEHWHEEL ||
2785  type == WM_MOUSELEAVE ||
2786  (type >= WM_KEYFIRST && type <= WM_KEYLAST)
2787 #ifndef Q_WS_WINCE
2788  || type == WM_NCMOUSEMOVE
2789 #endif
2790  ) {
2791  if (type == WM_MOUSEMOVE
2792 #ifndef Q_WS_WINCE
2793  || type == WM_NCMOUSEMOVE
2794 #endif
2795  ) {
2796 #ifndef QT_NO_CURSOR
2797  QCursor *c = qt_grab_cursor();
2798  if (!c)
2800  if (c) // application cursor defined
2801  SetCursor(c->handle());
2802  else
2803  SetCursor(QCursor(Qt::ArrowCursor).handle());
2804 #endif // QT_NO_CURSOR
2805  }
2806  block_event = true;
2807  } else if (type == WM_CLOSE) {
2808  block_event = true;
2809  }
2810 #ifndef Q_WS_WINCE
2811  else if (type == WM_MOUSEACTIVATE || type == WM_NCLBUTTONDOWN){
2812  if (!top->isActiveWindow()) {
2813  top->activateWindow();
2814  } else {
2816  }
2817  block_event = true;
2818  ret = MA_NOACTIVATEANDEAT;
2819  } else if (type == WM_SYSCOMMAND) {
2820  if (!(msg->wParam == SC_RESTORE && widget->isMinimized()))
2821  block_event = true;
2822  }
2823  }
2824 #endif
2825 
2826  return !block_event;
2827 }
#define WM_MOUSEWHEEL
Definition: qt_windows.h:116
HCURSOR_or_HANDLE handle() const
Returns a platform-specific cursor handle.
Definition: qcursor_mac.mm:301
int type
Definition: qmetatype.cpp:239
static void beep()
Sounds the bell, using the default volume and sound.
The QCursor class provides a mouse cursor with an arbitrary shape.
Definition: qcursor.h:89
unsigned char c[8]
Definition: qnumeric_p.h:62
bool isActiveWindow
whether this widget&#39;s window is the active window
Definition: qwidget.h:186
#define WM_MOUSEHWHEEL
Definition: qt_windows.h:119
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
static QCursor * overrideCursor()
Strips out vertical alignment flags and transforms an alignment align of Qt::AlignLeft into Qt::Align...
QCursor * qt_grab_cursor()
static bool tryModalHelper(QWidget *widget, QWidget **rettop=0)
void activateWindow()
Sets the top-level widget containing this widget to be the active window.
bool isMinimized() const
Definition: qwidget.cpp:3027
#define Q_WS_WINCE
Definition: qglobal.h:895
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
#define WM_MOUSELEAVE

◆ qt_tryCreateRegion()

HRGN qt_tryCreateRegion ( QRegion::RegionType  type,
int  left,
int  top,
int  right,
int  bottom 
)

Definition at line 55 of file qregion_win.cpp.

Referenced by QtWndProc().

56 {
57  const int tries = 10;
58  for (int i = 0; i < tries; ++i) {
59  HRGN region = 0;
60  switch (type) {
61  case QRegion::Rectangle:
62  region = CreateRectRgn(left, top, right, bottom);
63  break;
64  case QRegion::Ellipse:
65 #ifndef Q_OS_WINCE
66  region = CreateEllipticRgn(left, top, right, bottom);
67 #endif
68  break;
69  }
70  if (region) {
71  if (GetRegionData(region, 0, 0))
72  return region;
73  else
74  DeleteObject(region);
75  }
76  }
77  return 0;
78 }
int type
Definition: qmetatype.cpp:239
QTextStream & right(QTextStream &stream)
Calls QTextStream::setFieldAlignment(QTextStream::AlignRight) on stream and returns stream...
QTextStream & left(QTextStream &stream)
Calls QTextStream::setFieldAlignment(QTextStream::AlignLeft) on stream and returns stream...

◆ qt_updateLayeredWindowIndirect()

static BOOL WINAPI qt_updateLayeredWindowIndirect ( HWND  hwnd,
const Q_UPDATELAYEREDWINDOWINFO info 
)
static

Definition at line 759 of file qapplication_win.cpp.

Referenced by qt_init().

760 {
761  return (*ptrUpdateLayeredWindow)(hwnd, info->hdcDst, info->pptDst, info->psize, info->hdcSrc,
762  info->pptSrc, info->crKey, info->pblend, info->dwFlags);
763 }
PtrUpdateLayeredWindow ptrUpdateLayeredWindow

◆ qt_win_display_dc()

Q_GUI_EXPORT HDC qt_win_display_dc ( )

Definition at line 942 of file qapplication_win.cpp.

Referenced by QWindowsXPStylePrivate::buffer(), QWindowsXPStyle::drawComplexControl(), QRasterWindowSurface::flush(), QAxHostWidget::paintEvent(), qt_grab_cursor(), and QWindowsXPStylePrivate::tabBody().

943 {
944  Q_ASSERT(qApp && qApp->thread() == QThread::currentThread());
945  if (!displayDC)
946  displayDC = GetDC(0);
947  return displayDC;
948 }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
static HDC displayDC
static QThread * currentThread()
Returns a pointer to a QThread which manages the currently executing thread.
Definition: qthread.cpp:419
#define qApp

◆ qt_win_eatMouseMove()

void qt_win_eatMouseMove ( )

Definition at line 3016 of file qapplication_win.cpp.

Referenced by QPrintDialogPrivate::openWindowsPrintDialogModally(), qt_win_clean_up_OFN(), qt_win_get_existing_directory(), qt_win_get_open_file_name(), qt_win_get_open_file_names(), and qt_win_get_save_file_name().

3017 {
3018  // after closing a windows dialog with a double click (i.e. open a file)
3019  // the message queue still contains a dubious WM_MOUSEMOVE message where
3020  // the left button is reported to be down (wParam != 0).
3021  // remove all those messages (usually 1) and post the last one with a
3022  // reset button state
3023 
3024  MSG msg = {0, 0, 0, 0, 0, {0, 0} };
3025  while (PeekMessage(&msg, 0, WM_MOUSEMOVE, WM_MOUSEMOVE, PM_REMOVE))
3026  ;
3027  if (msg.message == WM_MOUSEMOVE)
3028  PostMessage(msg.hwnd, msg.message, 0, msg.lParam);
3029 }
struct tagMSG MSG

◆ qt_win_getKeyboardModifiers()

Qt::KeyboardModifiers qt_win_getKeyboardModifiers ( )

Definition at line 1303 of file qapplication_win.cpp.

Referenced by QtWndProc(), and QETWidget::translateMouseEvent().

1304 {
1305  Qt::KeyboardModifiers modifiers = Qt::NoModifier;
1306  if (GetKeyState(VK_SHIFT) < 0)
1307  modifiers |= Qt::ShiftModifier;
1308  if (GetKeyState(VK_CONTROL) < 0)
1309  modifiers |= Qt::ControlModifier;
1310  if (GetKeyState(VK_MENU) < 0)
1311  modifiers |= Qt::AltModifier;
1312  return modifiers;
1313 }

◆ qt_win_read_cleartype_settings()

static void qt_win_read_cleartype_settings ( )
static

Definition at line 651 of file qapplication_win.cpp.

Referenced by qt_init(), and QtWndProc().

652 {
653  UINT result = 0;
654 #ifdef Q_OS_WINCE
655  if (SystemParametersInfo(SPI_GETFONTSMOOTHING, 0, &result, 0))
656  qt_cleartype_enabled = result;
657 #else
658  if (SystemParametersInfo(SPI_GETFONTSMOOTHINGTYPE, 0, &result, 0))
660 #endif
661 
662  int winSmooth;
663  if (SystemParametersInfo(0x200C /* SPI_GETFONTSMOOTHINGCONTRAST */, 0, &winSmooth, 0)) {
664  qt_fontsmoothing_gamma = winSmooth / qreal(1000.0);
665  } else {
667  }
668 
669  // Safeguard ourselves against corrupt registry values...
672 }
double qreal
Definition: qglobal.h:1193
Q_GUI_EXPORT bool qt_cleartype_enabled
#define FE_FONTSMOOTHINGCLEARTYPE
Q_GUI_EXPORT qreal qt_fontsmoothing_gamma
#define SPI_GETFONTSMOOTHINGTYPE

◆ qt_win_set_cursor()

void qt_win_set_cursor ( QWidget w,
bool  force 
)

Definition at line 1282 of file qapplication_win.cpp.

Referenced by QApplicationPrivate::dispatchEnterLeave().

1283 {
1284  static QPointer<QWidget> lastUnderMouse = 0;
1285  if (force) {
1286  lastUnderMouse = w;
1287  } else if (w->testAttribute(Qt::WA_WState_Created) && lastUnderMouse
1288  && lastUnderMouse->effectiveWinId() == w->effectiveWinId()) {
1289  w = lastUnderMouse;
1290  }
1291 
1292  if (!curWin && w && w->internalWinId())
1293  return;
1294  QWidget* cW = w && !w->internalWinId() ? w : QWidget::find(curWin);
1295  if (!cW || cW->window() != w->window() ||
1296  !cW->isVisible() || !cW->underMouse() || QApplication::overrideCursor())
1297  return;
1298 
1299  SetCursor(cW->cursor().handle());
1300 }
HCURSOR_or_HANDLE handle() const
Returns a platform-specific cursor handle.
Definition: qcursor_mac.mm:301
WId effectiveWinId() const
Returns the effective window system identifier of the widget, i.
Definition: qwidget.cpp:2654
bool isVisible() const
Definition: qwidget.h:1005
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
bool underMouse() const
Returns true if the widget is under the mouse cursor; otherwise returns false.
Definition: qwidget.h:996
static HWND curWin
static QCursor * overrideCursor()
Strips out vertical alignment flags and transforms an alignment align of Qt::AlignLeft into Qt::Align...
bool testAttribute(Qt::WidgetAttribute) const
Returns true if attribute attribute is set on this widget; otherwise returns false.
Definition: qwidget.h:1041
static QWidget * find(WId)
Returns a pointer to the widget with window identifer/handle id.
Definition: qwidget.cpp:2517
QCursor cursor
the cursor shape for this widget
Definition: qwidget.h:183
WId internalWinId() const
Returns the window system identifier of the widget, or 0 if the widget is not created yet...
Definition: qwidget.h:244
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492

◆ qt_wince_hide_taskbar()

void qt_wince_hide_taskbar ( HWND  hwnd)

Definition at line 361 of file qguifunctions_wince.cpp.

Referenced by QtWndProc(), and QETWidget::translateConfigEvent().

361  {
362  if (ptrAygFullScreen)
364 }
#define SHFS_HIDESIPBUTTON
#define SHFS_HIDESTARTICON
static AygFullScreen ptrAygFullScreen
#define SHFS_HIDETASKBAR

◆ qt_wince_is_high_dpi()

bool qt_wince_is_high_dpi ( )

Definition at line 300 of file qguifunctions_wince.cpp.

300  {
301  if (!qt_wince_is_pocket_pc())
302  return false;
303  HDC deviceContext = GetDC(0);
304  int dpi = GetDeviceCaps(deviceContext, LOGPIXELSX);
305  ReleaseDC(0, deviceContext);
306  if ((dpi < 1000) && (dpi > 0))
307  return dpi > 96;
308  else
309  return false;
310 }
bool qt_wince_is_pocket_pc()

◆ qt_wince_is_mobile()

bool qt_wince_is_mobile ( )

Definition at line 296 of file qguifunctions_wince.cpp.

Referenced by qt_set_windows_font_resources().

296  {
298 }
bool qt_wince_is_pocket_pc()
bool qt_wince_is_smartphone()

◆ qt_wince_is_pocket_pc()

bool qt_wince_is_pocket_pc ( )

Definition at line 289 of file qguifunctions_wince.cpp.

Referenced by qt_set_windows_color_resources().

289  {
290  return qt_wince_is_platform(QString::fromLatin1("PocketPC"));
291 }
bool qt_wince_is_platform(const QString &platformString)
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188

◆ qt_wince_is_smartphone()

bool qt_wince_is_smartphone ( )

Definition at line 293 of file qguifunctions_wince.cpp.

Referenced by qt_set_windows_color_resources().

293  {
294  return qt_wince_is_platform(QString::fromLatin1("Smartphone"));
295 }
bool qt_wince_is_platform(const QString &platformString)
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188

◆ QtWndProc()

LRESULT QT_WIN_CALLBACK QtWndProc ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 1475 of file qapplication_win.cpp.

Referenced by qt_reg_winclass(), qt_show_system_menu(), and qt_tablet_cleanup_wce().

1476 {
1477  bool result = true;
1478  QEvent::Type evt_type = QEvent::None;
1479  QETWidget *widget = 0;
1480 
1481  // there is no need to process pakcets from tablet unless
1482  // it is actually on the tablet, a flag to let us know...
1483  int nPackets; // the number of packets we get from the queue
1484 
1485  long res = 0;
1486  if (!qApp) // unstable app state
1487 #ifndef QT_NO_IM
1488  RETURN(QWinInputContext::DefWindowProc(hwnd,message,wParam,lParam))
1489 #else
1490  return res;
1491 #endif // QT_NO_IM
1492  QScopedLoopLevelCounter loopLevelCounter(QThreadData::get2(qApp->thread()));
1493 
1494 #if 0
1495  // make sure we update widgets also when the user resizes
1496  if (inLoop && qApp->loopLevel())
1497  qApp->sendPostedEvents(0, QEvent::Paint);
1498 #endif
1499 
1500  inLoop = true;
1501 
1502  MSG msg;
1503  msg.hwnd = hwnd; // create MSG structure
1504  msg.message = message; // time and pt fields ignored
1505  msg.wParam = wParam;
1506  msg.lParam = lParam;
1507  msg.pt.x = GET_X_LPARAM(lParam);
1508  msg.pt.y = GET_Y_LPARAM(lParam);
1509  // If it's a non-client-area message the coords are screen coords, otherwise they are
1510  // client coords.
1511 #ifndef Q_WS_WINCE
1512  if (message < WM_NCMOUSEMOVE || message > WM_NCMBUTTONDBLCLK)
1513 #endif
1514  ClientToScreen(msg.hwnd, &msg.pt);
1515 
1516  /*
1517  // sometimes the autograb is not released, so the clickevent is sent
1518  // to the wrong window. We ignore this for now, because it doesn't
1519  // cause any problems.
1520  if (msg.message == WM_LBUTTONDOWN || msg.message == WM_RBUTTONDOWN || msg.message == WM_MBUTTONDOWN) {
1521  HWND handle = WindowFromPoint(msg.pt);
1522  if (msg.hwnd != handle) {
1523  msg.hwnd = handle;
1524  hwnd = handle;
1525  }
1526  }
1527  */
1528 
1529 #if defined(QT_NON_COMMERCIAL)
1530  QT_NC_WNDPROC
1531 #endif
1532 
1533  // send through app filter
1534  if (qApp->filterEvent(&msg, &res))
1535  return res;
1536 
1537  // close any opened ime candidate window (enabled only on a popup widget)
1539  && (message == WM_MBUTTONDOWN || message == WM_XBUTTONDOWN
1540  || message == WM_LBUTTONDOWN || message == WM_RBUTTONDOWN
1541 #ifndef Q_WS_WINCE
1542  || message == WM_NCMBUTTONDOWN || message == WM_NCLBUTTONDOWN
1543  || message == WM_NCRBUTTONDOWN)) {
1544 #else
1545  )) {
1546 #endif
1547  ::SendMessage(imeParentWnd, WM_IME_ENDCOMPOSITION, 0, 0);
1548  }
1549 
1550  switch (message) {
1551 #ifndef Q_WS_WINCE
1552 #ifndef QT_NO_SESSIONMANAGER
1553  case WM_QUERYENDSESSION: {
1554  if (sm_smActive) // bogus message from windows
1555  RETURN(true);
1556 
1557  sm_smActive = true;
1558  sm_blockUserInput = true; // prevent user-interaction outside interaction windows
1559  sm_cancel = false;
1561  qApp->commitData(*qt_session_manager_self);
1562  if (lParam & ENDSESSION_LOGOFF) {
1563  _flushall();
1564  }
1565  RETURN(!sm_cancel);
1566  }
1567  case WM_ENDSESSION: {
1568  sm_smActive = false;
1569  sm_blockUserInput = false;
1570  bool endsession = (bool) wParam;
1571 
1572  // we receive the message for each toplevel window included internal hidden ones,
1573  // but the aboutToQuit signal should be emitted only once.
1575  if (endsession && !qAppPriv->aboutToQuitEmitted) {
1576  qAppPriv->aboutToQuitEmitted = true;
1577  int index = QApplication::staticMetaObject.indexOfSignal("aboutToQuit()");
1578  qApp->qt_metacall(QMetaObject::InvokeMetaMethod, index,0);
1579  // since the process will be killed immediately quit() has no real effect
1581  }
1582 
1583  RETURN(0);
1584  }
1585 #endif
1586  case WM_DISPLAYCHANGE:
1588  break;
1589  if (qt_desktopWidget) {
1590  qt_desktopWidget->move(GetSystemMetrics(76), GetSystemMetrics(77));
1591  QSize sz(GetSystemMetrics(78), GetSystemMetrics(79));
1592  if (sz == qt_desktopWidget->size()) {
1593  // a screen resized without changing size of the virtual desktop
1594  QResizeEvent rs(sz, qt_desktopWidget->size());
1596  } else {
1597  qt_desktopWidget->resize(sz);
1598  }
1599  }
1600  break;
1601 #endif
1602 
1603  case WM_SETTINGCHANGE:
1604 #ifdef Q_WS_WINCE
1605  // CE SIP hide/show
1606  if (qt_desktopWidget && wParam == SPI_SETSIPINFO) {
1607  QResizeEvent re(QSize(0, 0), QSize(0, 0)); // Calculated by QDesktopWidget
1609  break;
1610  }
1611 #endif
1612  // ignore spurious XP message when user logs in again after locking
1614  break;
1615  if (QApplication::desktopSettingsAware() && wParam != SPI_SETWORKAREA) {
1616  widget = (QETWidget*)QWidget::find(hwnd);
1617  if (widget) {
1618  if (wParam == SPI_SETNONCLIENTMETRICS)
1619  widget->markFrameStrutDirty();
1620  }
1621  }
1622  else if (qt_desktopWidget && wParam == SPI_SETWORKAREA) {
1623  qt_desktopWidget->move(GetSystemMetrics(76), GetSystemMetrics(77));
1624  QSize sz(GetSystemMetrics(78), GetSystemMetrics(79));
1625  if (sz == qt_desktopWidget->size()) {
1626  // a screen resized without changing size of the virtual desktop
1627  QResizeEvent rs(sz, qt_desktopWidget->size());
1629  } else {
1630  qt_desktopWidget->resize(sz);
1631  }
1632  }
1633 
1634  if (wParam == SPI_SETFONTSMOOTHINGTYPE) {
1636  foreach (QWidget *w, QApplication::topLevelWidgets()) {
1637  if (!w->isVisible())
1638  continue;
1639  ((QETWidget *) w)->forceUpdate();
1640  }
1641  }
1642 
1643  break;
1644  case WM_SYSCOLORCHANGE:
1646  break;
1648  widget = (QETWidget*)QWidget::find(hwnd);
1649  if (widget && !widget->parentWidget())
1651  }
1652  break;
1653 
1654  case WM_LBUTTONDOWN:
1655  case WM_MBUTTONDOWN:
1656  case WM_RBUTTONDOWN:
1657  case WM_XBUTTONDOWN:
1658  case WM_LBUTTONDBLCLK:
1659  case WM_RBUTTONDBLCLK:
1660  case WM_MBUTTONDBLCLK:
1661  case WM_XBUTTONDBLCLK:
1664  break;
1665 
1666  case WM_LBUTTONUP:
1667  case WM_MBUTTONUP:
1668  case WM_RBUTTONUP:
1669  case WM_XBUTTONUP:
1674  qt_button_down = 0;
1675  }
1676 
1677  RETURN(0);
1678  }
1679  break;
1680 
1681  default:
1682  break;
1683  }
1684 
1685  if (!widget)
1686  widget = (QETWidget*)QWidget::find(hwnd);
1687  if (!widget) // don't know this widget
1688  goto do_default;
1689 
1690  if (app_do_modal) { // modal event handling
1691  int ret = 0;
1692  if (!qt_try_modal(widget, &msg, ret))
1693  RETURN(ret);
1694  }
1695 
1696  res = 0;
1697  if (widget->winEvent(&msg, &res)) // send through widget filter
1698  RETURN(res);
1699 
1700  if (qt_is_translatable_mouse_event(message)) {
1701  if (QApplication::activePopupWidget() != 0) { // in popup mode
1702  POINT curPos = msg.pt;
1703  QWidget* w = QApplication::widgetAt(curPos.x, curPos.y);
1704  if (w)
1705  widget = (QETWidget*)w;
1706  }
1707 
1708  if (!qt_tabletChokeMouse) {
1709  result = widget->translateMouseEvent(msg); // mouse event
1710 #if defined(Q_WS_WINCE) && !defined(QT_NO_CONTEXTMENU)
1711  if (message == WM_LBUTTONDOWN && widget != QApplication::activePopupWidget()) {
1712  QWidget* alienWidget = widget;
1713  if ((alienWidget != QApplication::activePopupWidget()) && (alienWidget->contextMenuPolicy() != Qt::PreventContextMenu)) {
1714  QPoint pos(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
1715  QPoint globalPos(msg.pt.x, msg.pt.y);
1716  // In case we are using Alien, then the widget to
1717  // send the context menu event is a different one
1718  if (!alienWidget->testAttribute(Qt::WA_NativeWindow) && !alienWidget->testAttribute(Qt::WA_PaintOnScreen)) {
1719  alienWidget = QApplication::widgetAt(globalPos);
1720  if (alienWidget)
1721  pos = alienWidget->mapFromGlobal(globalPos);
1722  }
1723  if (alienWidget) {
1724  SHRGINFO shrg;
1725  shrg.cbSize = sizeof(shrg);
1726  shrg.hwndClient = hwnd;
1727  shrg.ptDown.x = GET_X_LPARAM(lParam);
1728  shrg.ptDown.y = GET_Y_LPARAM(lParam);
1730 #ifndef QT_NO_GESTURES
1731  resolveAygLibs();
1735  QContextMenuEvent e(QContextMenuEvent::Mouse, pos, globalPos);
1736  result = qt_sendSpontaneousEvent(alienWidget, &e);
1737  }
1738 #endif // QT_NO_GESTURES
1739  }
1740  }
1741  }
1742 #endif
1743  } else {
1744  // Sometimes we only get a WM_MOUSEMOVE message
1745  // and sometimes we get both a WM_MOUSEMOVE and
1746  // a WM_LBUTTONDOWN/UP, this creates a spurious mouse
1747  // press/release event, using the PeekMessage
1748  // will help us fix this. This leaves us with a
1749  // question:
1750  // This effectively kills using the mouse AND the
1751  // tablet simultaneously, well creates wacky input.
1752  // Is this going to be a problem? (probably not)
1753  bool next_is_button = false;
1754  bool is_mouse_move = (message == WM_MOUSEMOVE);
1755  if (is_mouse_move) {
1756  MSG msg1;
1757  if (PeekMessage(&msg1, msg.hwnd, WM_MOUSEFIRST,
1758  WM_MOUSELAST, PM_NOREMOVE))
1759  next_is_button = (msg1.message == WM_LBUTTONUP
1760  || msg1.message == WM_LBUTTONDOWN);
1761  }
1762  if (!is_mouse_move || (is_mouse_move && !next_is_button))
1763  qt_tabletChokeMouse = false;
1764  }
1765  } else {
1766  switch (message) {
1767  case WM_TOUCH:
1769  break;
1770  case WM_KEYDOWN: // keyboard event
1771  case WM_SYSKEYDOWN:
1773  // fall-through intended
1774  case WM_KEYUP:
1775  case WM_SYSKEYUP:
1776 #if Q_OS_WINCE_WM
1777  case WM_HOTKEY:
1778  if(HIWORD(msg.lParam) == VK_TBACK) {
1779  const bool hotKeyDown = !(LOWORD(msg.lParam) & MOD_KEYUP);
1780  msg.lParam = 0x69 << 16;
1781  msg.wParam = VK_BACK;
1782  if (hotKeyDown) {
1783  msg.message = WM_KEYDOWN;
1785  } else {
1786  msg.message = WM_KEYUP;
1787  }
1788  }
1789  // fall-through intended
1790 #endif
1791  case WM_IME_CHAR:
1792  case WM_IME_KEYDOWN:
1793  case WM_CHAR: {
1794  MSG msg1;
1795  bool anyMsg = PeekMessage(&msg1, msg.hwnd, 0, 0, PM_NOREMOVE);
1796  if (anyMsg && msg1.message == WM_DEADCHAR) {
1797  result = true; // consume event since there is a dead char next
1798  break;
1799  }
1801  if (g && qt_get_tablet_widget() && hwnd == qt_get_tablet_widget()->winId()) {
1802  // if we get an event for the internal tablet widget,
1803  // then don't send it to the keyboard grabber, but
1804  // send it to the widget itself (we don't use it right
1805  // now, just in case).
1806  g = 0;
1807  }
1808  if (g)
1809  widget = (QETWidget*)g;
1814  else if (QApplication::focusWidget())
1815  widget = (QETWidget*)QApplication::focusWidget();
1816  else if (!widget || widget->internalWinId() == GetFocus()) // We faked the message to go to exactly that widget.
1817  widget = (QETWidget*)widget->window();
1818  if (widget->isEnabled())
1819  result = sm_blockUserInput
1820  ? true
1821  : qt_keymapper_private()->translateKeyEvent(widget, msg, g != 0);
1822  break;
1823  }
1824  case WM_SYSCHAR:
1825  result = true; // consume event
1826  break;
1827 
1828  case WM_MOUSEWHEEL:
1829  case WM_MOUSEHWHEEL:
1830  result = widget->translateWheelEvent(msg);
1831  break;
1832 
1833  case WM_APPCOMMAND:
1834  {
1835  uint cmd = GET_APPCOMMAND_LPARAM(lParam);
1836  uint uDevice = GET_DEVICE_LPARAM(lParam);
1837  uint dwKeys = GET_KEYSTATE_LPARAM(lParam);
1838 
1839  int state = translateButtonState(dwKeys, QEvent::KeyPress, 0);
1840 
1841  switch (uDevice) {
1842  case FAPPCOMMAND_KEY:
1843  {
1844  int key = 0;
1845 
1846  switch(cmd) {
1847  case APPCOMMAND_BASS_BOOST:
1848  key = Qt::Key_BassBoost;
1849  break;
1850  case APPCOMMAND_BASS_DOWN:
1851  key = Qt::Key_BassDown;
1852  break;
1853  case APPCOMMAND_BASS_UP:
1854  key = Qt::Key_BassUp;
1855  break;
1857  key = Qt::Key_TrebleDown;
1858  break;
1859  case APPCOMMAND_TREBLE_UP:
1860  key = Qt::Key_TrebleUp;
1861  break;
1862  case APPCOMMAND_HELP:
1863  key = Qt::Key_Help;
1864  break;
1865  case APPCOMMAND_FIND:
1866  key = Qt::Key_Search;
1867  break;
1868  default:
1869  break;
1870  }
1871  if (key) {
1872  bool res = false;
1874  if (g)
1875  widget = (QETWidget*)g;
1876  else if (QApplication::focusWidget())
1877  widget = (QETWidget*)QApplication::focusWidget();
1878  else
1879  widget = (QETWidget*)widget->window();
1880  if (widget->isEnabled()) {
1881  res = QKeyMapper::sendKeyEvent(widget, g != 0, QEvent::KeyPress, key,
1882  Qt::KeyboardModifier(state),
1883  QString(), false, 0, 0, 0, 0);
1884  }
1885  if (res)
1886  return true;
1887  }
1888  }
1889  break;
1890 
1891  default:
1892  break;
1893  }
1894 
1895  result = false;
1896  }
1897  break;
1898 
1899 #ifndef Q_WS_WINCE
1900  case WM_NCHITTEST:
1901  if (widget->isWindow()) {
1902  QPoint pos = widget->mapFromGlobal(QPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)));
1903  // don't show resize-cursors for fixed-size widgets
1904  QRect fs = widget->frameStrut();
1905  if (!widget->isMinimized()) {
1906  if (widget->minimumHeight() == widget->maximumHeight()) {
1907  if (pos.y() < -(fs.top() - fs.left()))
1908  return HTCAPTION;
1909  if (pos.y() >= widget->height())
1910  return HTBORDER;
1911  }
1912  if (widget->minimumWidth() == widget->maximumWidth() && (pos.x() < 0 || pos.x() >= widget->width()))
1913  return HTBORDER;
1914  }
1915  }
1916 
1917  result = false;
1918  break;
1919 #endif
1920 
1921  case WM_SYSCOMMAND: {
1922 #ifndef Q_WS_WINCE
1923  bool window_state_change = false;
1924  Qt::WindowStates oldstate = Qt::WindowStates(widget->dataPtr()->window_state);
1925  // MSDN:In WM_SYSCOMMAND messages, the four low-order bits of the wParam parameter are
1926  // used internally by the system. To obtain the correct result when testing the value of
1927  // wParam, an application must combine the value 0xFFF0 with the wParam value by using
1928  // the bitwise AND operator.
1929  switch(0xfff0 & wParam) {
1930  case SC_CONTEXTHELP:
1931 #ifndef QT_NO_WHATSTHIS
1933 #endif
1934  DefWindowProc(hwnd, WM_NCPAINT, 1, 0);
1935  break;
1936 #if defined(QT_NON_COMMERCIAL)
1937  QT_NC_SYSCOMMAND
1938 #endif
1939  case SC_MINIMIZE:
1940  window_state_change = true;
1942  if (widget->isVisible()) {
1943  QHideEvent e;
1944  qt_sendSpontaneousEvent(widget, &e);
1945  widget->hideChildren(true);
1946  const QString title = widget->windowIconText();
1947  if (!title.isEmpty())
1948  widget->setWindowTitle_helper(title);
1949  }
1950  result = false;
1951  break;
1952  case SC_MAXIMIZE:
1953  if(widget->isWindow())
1954  widget->topData()->normalGeometry = widget->geometry();
1955  case SC_RESTORE:
1956  window_state_change = true;
1957  if ((0xfff0 & wParam) == SC_MAXIMIZE)
1959  else if (!widget->isMinimized())
1960  widget->dataPtr()->window_state &= ~Qt::WindowMaximized;
1961 
1962  if (widget->isMinimized()) {
1963  widget->dataPtr()->window_state &= ~Qt::WindowMinimized;
1964  widget->showChildren(true);
1965  QShowEvent e;
1966  qt_sendSpontaneousEvent(widget, &e);
1967  const QString title = widget->windowTitle();
1968  if (!title.isEmpty())
1969  widget->setWindowTitle_helper(title);
1970  }
1971  result = false;
1972  break;
1973  default:
1974  result = false;
1975  break;
1976  }
1977 
1978  if (window_state_change) {
1979  QWindowStateChangeEvent e(oldstate);
1980  qt_sendSpontaneousEvent(widget, &e);
1981  }
1982 #endif // #ifndef Q_OS_WINCE
1983 
1984  break;
1985  }
1986 
1987  case WM_SETTINGCHANGE:
1989  break;
1990 
1991  if (!msg.wParam) {
1992 #ifdef Q_WS_WINCE
1993  // On Windows CE, lParam parameter is a constant, not a char pointer.
1994  if (msg.lParam == INI_INTL) {
1995 #else
1996  QString area = QString::fromWCharArray((wchar_t*)msg.lParam);
1997  if (area == QLatin1String("intl")) {
1998 #endif
2000  if (!widget->testAttribute(Qt::WA_SetLocale))
2001  widget->dptr()->setLocale_helper(QLocale(), true);
2004  }
2005  }
2006  else if (msg.wParam == SPI_SETICONTITLELOGFONT) {
2008  widget = (QETWidget*)QWidget::find(hwnd);
2009  if (widget && !widget->parentWidget()) {
2011  }
2012  }
2013  }
2014  else if (msg.wParam == SPI_SETNONCLIENTMETRICS) {
2015  widget = (QETWidget*)QWidget::find(hwnd);
2016  if (widget && !widget->parentWidget()) {
2019  QApplication::sendEvent(widget, &e);
2020  }
2021  }
2022 
2023  break;
2024 
2025  case WM_PAINT: // paint event
2026  case WM_ERASEBKGND: // erase window background
2027  result = widget->translatePaintEvent(msg);
2028  break;
2029 
2030 #ifndef Q_WS_WINCE
2031  case WM_ENTERSIZEMOVE:
2032  autoCaptureWnd = hwnd;
2033  break;
2034  case WM_EXITSIZEMOVE:
2035  autoCaptureWnd = 0;
2036  break;
2037 #endif
2038  case WM_MOVE: // move window
2039  case WM_SIZE: // resize window
2040  result = widget->translateConfigEvent(msg);
2041  break;
2042 
2043  case WM_ACTIVATEAPP:
2044  if (wParam == FALSE) {
2046  // Another application was activated while our popups are open,
2047  // then close all popups. In case some popup refuses to close,
2048  // we give up after 1024 attempts (to avoid an infinite loop).
2049  int maxiter = 1024;
2050  QWidget *popup;
2051  while ((popup=QApplication::activePopupWidget()) && maxiter--)
2052  popup->close();
2053  }
2054  break;
2055 
2056  case WM_ACTIVATE:
2058  break;
2059 
2060  if (ptrWTOverlap && ptrWTEnable) {
2061  // cooperate with other tablet applications, but when
2062  // we get focus, I want to use the tablet...
2063  if (qt_tablet_context && GET_WM_ACTIVATE_STATE(wParam, lParam)) {
2064  if (ptrWTEnable(qt_tablet_context, true))
2066  }
2067  }
2068  if (QApplication::activePopupWidget() && LOWORD(wParam) == WA_INACTIVE &&
2069  QWidget::find((HWND)lParam) == 0) {
2070  // Another application was activated while our popups are open,
2071  // then close all popups. In case some popup refuses to close,
2072  // we give up after 1024 attempts (to avoid an infinite loop).
2073  int maxiter = 1024;
2074  QWidget *popup;
2075  while ((popup=QApplication::activePopupWidget()) && maxiter--)
2076  popup->close();
2077  }
2078 
2079  if (LOWORD(wParam) != WA_INACTIVE) {
2080  // WM_ACTIVATEAPP handles the "true" false case, as this is only when the application
2081  // loses focus. Doing it here would result in the widget getting focus to not know
2082  // where it got it from; it would simply get a 0 value as the old focus widget.
2083 #ifdef Q_WS_WINCE
2084  {
2085 #ifdef Q_WS_WINCE_WM
2086  // On Windows mobile we do not receive WM_SYSCOMMAND / SC_MINIMIZE messages.
2087  // Thus we have to unset the minimized state explicitly. We must do this for all
2088  // top-level widgets, because we get the HWND of a random widget here.
2089  foreach (QWidget* tlw, QApplication::topLevelWidgets()) {
2090  if (tlw->isMinimized())
2092  }
2093 #else
2094  // On Windows CE we do not receive WM_SYSCOMMAND / SC_MINIMIZE messages.
2095  // Thus we have to unset the minimized state explicitly.
2096  if (widget->windowState() & Qt::WindowMinimized)
2097  widget->setWindowState(widget->windowState() & ~Qt::WindowMinimized);
2098 #endif // Q_WS_WINCE_WM
2099 
2100 #else
2101  if (!(widget->windowState() & Qt::WindowMinimized)) {
2102 #endif
2103  // Ignore the activate message send by WindowsXP to a minimized window
2104 #ifdef Q_WS_WINCE_WM
2105  if (widget->windowState() & Qt::WindowFullScreen)
2106  qt_wince_hide_taskbar(widget->winId());
2107 #endif
2108  qApp->winFocus(widget, true);
2109  // reset any window alert flashes
2110  alert_widget(widget, -1);
2111  }
2112  }
2113 
2114  // Windows tries to activate a modally blocked window.
2115  // This happens when restoring an application after "Show Desktop"
2116  if (app_do_modal && LOWORD(wParam) == WA_ACTIVE) {
2117  QWidget *top = 0;
2118  if (!QApplicationPrivate::tryModalHelper(widget, &top) && top && widget != top) {
2119  if (top->isVisible()) {
2120  top->activateWindow();
2121  } else {
2122  // This is the case when native file dialogs are shown
2123  QWidget *p = (top->parentWidget() ? top->parentWidget()->window() : 0);
2124  if (p && p->isVisible())
2125  p->activateWindow();
2126  }
2127  }
2128  }
2129  break;
2130 
2131 #ifndef Q_WS_WINCE
2132  case WM_MOUSEACTIVATE:
2133  if (widget->window()->windowType() == Qt::Tool) {
2134  QWidget *w = widget;
2135  if (!w->window()->focusWidget()) {
2136  while (w && (w->focusPolicy() & Qt::ClickFocus) == 0) {
2137  if (w->isWindow()) {
2138  QWidget *fw = w;
2139  while ((fw = fw->nextInFocusChain()) != w && fw->focusPolicy() == Qt::NoFocus)
2140  ;
2141  if (fw != w)
2142  break;
2143  QWidget *pw = w->parentWidget();
2144  while (pw) {
2145  pw = pw->window();
2146  if (pw && pw->isVisible() && pw->focusWidget()) {
2148  SetWindowPos(pw->internalWinId(), HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
2149  break;
2150  }
2151  pw = pw->parentWidget();
2152  }
2153  RETURN(MA_NOACTIVATE);
2154  }
2155  w = w->parentWidget();
2156  }
2157  }
2158  }
2159  RETURN(MA_ACTIVATE);
2160  break;
2161 #endif
2162  case WM_SHOWWINDOW:
2163  if (lParam == SW_PARENTOPENING) {
2164  if (widget->testAttribute(Qt::WA_WState_Hidden))
2165  RETURN(0);
2166  }
2167  if (widget->isWindow() && widget->testAttribute(Qt::WA_WState_Visible)
2168  && !widget->testWindowState(Qt::WindowMinimized)) {
2169  if (lParam == SW_PARENTOPENING) {
2170  QShowEvent e;
2171  qt_sendSpontaneousEvent(widget, &e);
2172  widget->showChildren(true);
2173  } else if (lParam == SW_PARENTCLOSING) {
2174  QHideEvent e;
2175  qt_sendSpontaneousEvent(widget, &e);
2176  widget->hideChildren(true);
2177  }
2178  }
2179  if (!wParam && autoCaptureWnd == widget->internalWinId())
2181  result = false;
2182  break;
2183 
2184  case WM_PALETTECHANGED: // our window changed palette
2185  if (QColormap::hPal() && (WId)wParam == widget->internalWinId())
2186  RETURN(0); // otherwise: FALL THROUGH!
2187  // FALL THROUGH
2188  case WM_QUERYNEWPALETTE: // realize own palette
2189  if (QColormap::hPal()) {
2191  HDC hdc = GetDC(widget->internalWinId());
2192  HPALETTE hpalOld = SelectPalette(hdc, QColormap::hPal(), FALSE);
2193  uint n = RealizePalette(hdc);
2194  if (n)
2195  InvalidateRect(widget->internalWinId(), 0, TRUE);
2196  SelectPalette(hdc, hpalOld, TRUE);
2197  RealizePalette(hdc);
2198  ReleaseDC(widget->internalWinId(), hdc);
2199  RETURN(n);
2200  }
2201  break;
2202  case WM_CLOSE: // close window
2203  widget->translateCloseEvent(msg);
2204  RETURN(0); // always handled
2205 
2206  case WM_DESTROY: // destroy window
2207  if (hwnd == curWin) {
2208  QWidget *enter = QWidget::mouseGrabber();
2209  if (enter == widget)
2210  enter = 0;
2212  curWin = enter ? enter->effectiveWinId() : 0;
2213  qt_last_mouse_receiver = enter;
2214  }
2215  if (widget == popupButtonFocus)
2216  popupButtonFocus = 0;
2217  result = false;
2218  break;
2219 
2220 #ifndef Q_WS_WINCE
2221  case WM_WINDOWPOSCHANGING:
2222  {
2223  result = false;
2224  if (widget->isWindow()) {
2225  WINDOWPOS *winPos = (WINDOWPOS *)lParam;
2226  if (widget->layout() && widget->layout()->hasHeightForWidth()
2227  && !(winPos->flags & (SWP_NOCOPYBITS | SWP_NOSIZE))) {
2228  QRect fs = widget->frameStrut();
2229  QRect rect = widget->geometry();
2230  QRect newRect = QRect(winPos->x + fs.left(),
2231  winPos->y + fs.top(),
2232  winPos->cx - fs.left() - fs.right(),
2233  winPos->cy - fs.top() - fs.bottom());
2234 
2235  QSize newSize = QLayout::closestAcceptableSize(widget, newRect.size());
2236 
2237  int dh = newSize.height() - newRect.height();
2238  int dw = newSize.width() - newRect.width();
2239  if (!dw && ! dh)
2240  break; // Size OK
2241 
2242  if (rect.y() != newRect.y()) {
2243  newRect.setTop(newRect.top() - dh);
2244  } else {
2245  newRect.setBottom(newRect.bottom() + dh);
2246  }
2247 
2248  if (rect.x() != newRect.x()) {
2249  newRect.setLeft(newRect.left() - dw);
2250  } else {
2251  newRect.setRight(newRect.right() + dw);
2252  }
2253 
2254  winPos->x = newRect.x() - fs.left();
2255  winPos->y = newRect.y() - fs.top();
2256  winPos->cx = newRect.width() + fs.left() + fs.right();
2257  winPos->cy = newRect.height() + fs.top() + fs.bottom();
2258 
2259  RETURN(0);
2260  }
2261  if (widget->windowFlags() & Qt::WindowStaysOnBottomHint) {
2262  winPos->hwndInsertAfter = HWND_BOTTOM;
2263  }
2264  }
2265  }
2266  break;
2267 
2268  case WM_GETMINMAXINFO:
2269  if (widget->xtra()) {
2270  MINMAXINFO *mmi = (MINMAXINFO *)lParam;
2271  QWExtra *x = widget->xtra();
2272  QRect fs = widget->frameStrut();
2273  if ( x->minw > 0 )
2274  mmi->ptMinTrackSize.x = x->minw + fs.right() + fs.left();
2275  if ( x->minh > 0 )
2276  mmi->ptMinTrackSize.y = x->minh + fs.top() + fs.bottom();
2277  qint32 maxw = (x->maxw >= x->minw) ? x->maxw : x->minw;
2278  qint32 maxh = (x->maxh >= x->minh) ? x->maxh : x->minh;
2279  if ( maxw < QWIDGETSIZE_MAX ) {
2280  mmi->ptMaxTrackSize.x = maxw + fs.right() + fs.left();
2281  // windows with title bar have an implicit size limit of 112 pixels
2282  if (widget->windowFlags() & Qt::WindowTitleHint)
2283  mmi->ptMaxTrackSize.x = qMax<long>(mmi->ptMaxTrackSize.x, 112);
2284  }
2285  if ( maxh < QWIDGETSIZE_MAX )
2286  mmi->ptMaxTrackSize.y = maxh + fs.top() + fs.bottom();
2287  RETURN(0);
2288  }
2289  break;
2290 
2291 #ifndef QT_NO_CONTEXTMENU
2292  case WM_CONTEXTMENU:
2293  {
2294  // it's not VK_APPS or Shift+F10, but a click in the NC area
2295  if (lParam != (int)0xffffffff) {
2296  result = false;
2297  break;
2298  }
2299 
2301  if (!fw) {
2306  else if (QApplication::focusWidget())
2308  else if (widget)
2309  fw = widget->window();
2310  }
2311  if (fw && fw->isEnabled()) {
2315  result = qt_sendSpontaneousEvent(fw, &e);
2316  }
2317  }
2318  break;
2319 #endif
2320 #endif
2321 
2322 #ifndef QT_NO_IM
2323  case WM_IME_STARTCOMPOSITION:
2324  case WM_IME_ENDCOMPOSITION:
2325  case WM_IME_COMPOSITION: {
2328  if (fw && im) {
2329  if(message == WM_IME_STARTCOMPOSITION)
2330  result = im->startComposition();
2331  else if (message == WM_IME_ENDCOMPOSITION)
2332  result = im->endComposition();
2333  else if (message == WM_IME_COMPOSITION)
2334  result = im->composition(lParam);
2335  }
2336  break;
2337  }
2338  case WM_IME_REQUEST: {
2341  if (fw && im) {
2342  if(wParam == IMR_RECONVERTSTRING) {
2343  int ret = im->reconvertString((RECONVERTSTRING *)lParam);
2344  if (ret == -1) {
2345  result = false;
2346  } else {
2347  return ret;
2348  }
2349  } else if (wParam == IMR_CONFIRMRECONVERTSTRING) {
2350  RETURN(TRUE);
2351  } else {
2352  // in all other cases, call DefWindowProc()
2353  result = false;
2354  }
2355  }
2356  break;
2357  }
2358 #endif // QT_NO_IM
2359 #ifndef Q_WS_WINCE
2360  case WM_CHANGECBCHAIN:
2361  case WM_DRAWCLIPBOARD:
2362 #endif
2363  case WM_RENDERFORMAT:
2364  case WM_RENDERALLFORMATS:
2365 #ifndef QT_NO_CLIPBOARD
2366  case WM_DESTROYCLIPBOARD:
2367  if (qt_clipboard) {
2368  QClipboardEvent e(reinterpret_cast<QEventPrivate *>(&msg));
2370  RETURN(0);
2371  }
2372  result = false;
2373  break;
2374 #endif //QT_NO_CLIPBOARD
2375 #ifndef QT_NO_ACCESSIBILITY
2376  case WM_GETOBJECT:
2377  {
2378 #if !defined(Q_OS_WINCE)
2379  /* On Win64, lParam can be 0x00000000fffffffc or 0xfffffffffffffffc (!),
2380  but MSDN says that lParam should be converted to a DWORD
2381  before its compared against OBJID_CLIENT
2382  */
2383  const DWORD dwObjId = (DWORD)lParam;
2384  // Ignoring all requests while starting up
2385  if (QApplication::startingUp() || QApplication::closingDown() || dwObjId != OBJID_CLIENT) {
2386  result = false;
2387  break;
2388  }
2389 
2390  typedef LRESULT (WINAPI *PtrLresultFromObject)(REFIID, WPARAM, LPUNKNOWN);
2391  static PtrLresultFromObject ptrLresultFromObject = 0;
2392  static bool oleaccChecked = false;
2393  if (!oleaccChecked) {
2394  QSystemLibrary oleacclib(QLatin1String("oleacc"));
2395  ptrLresultFromObject = (PtrLresultFromObject)oleacclib.resolve("LresultFromObject");
2396  oleaccChecked = true;
2397  }
2398  if (ptrLresultFromObject) {
2400  if (!acc) {
2401  result = false;
2402  break;
2403  }
2404 
2405  // and get an instance of the IAccessibile implementation
2406  IAccessible *iface = qt_createWindowsAccessible(acc);
2407  res = ptrLresultFromObject(IID_IAccessible, wParam, iface); // ref == 2
2408  iface->Release(); // the client will release the object again, and then it will destroy itself
2409 
2410  if (res > 0)
2411  RETURN(res);
2412  }
2413 #endif
2414  }
2415  result = false;
2416  break;
2417  case WM_GETTEXT:
2418  if (!widget->isWindow()) {
2419  int ret = 0;
2421  if (acc) {
2422  QString text = acc->text(QAccessible::Name, 0);
2423  if (text.isEmpty())
2424  text = widget->objectName();
2425  ret = qMin<int>(wParam - 1, text.size());
2426  text.resize(ret);
2427  memcpy((void *)lParam, text.utf16(), (text.size() + 1) * sizeof(ushort));
2428  delete acc;
2429  }
2430  if (!ret) {
2431  result = false;
2432  break;
2433  }
2434  RETURN(ret);
2435  }
2436  result = false;
2437  break;
2438 #endif
2439  case WT_PACKET:
2440  if (ptrWTPacketsGet) {
2442  result = widget->translateTabletEvent(msg, localPacketBuf, nPackets);
2443  }
2444  }
2445  break;
2446  case WT_PROXIMITY:
2447 
2448  #ifndef QT_NO_TABLETEVENT
2449  if (ptrWTPacketsGet && ptrWTInfo) {
2450  const bool enteredProximity = LOWORD(lParam) != 0;
2451  PACKET proximityBuffer[1]; // we are only interested in the first packet in this case
2452  const int totalPacks = ptrWTPacketsGet(qt_tablet_context, 1, proximityBuffer);
2453  if (totalPacks > 0) {
2454  const UINT currentCursor = proximityBuffer[0].pkCursor;
2455 
2456  UINT csr_physid;
2457  ptrWTInfo(WTI_CURSORS + currentCursor, CSR_PHYSID, &csr_physid);
2458  UINT csr_type;
2459  ptrWTInfo(WTI_CURSORS + currentCursor, CSR_TYPE, &csr_type);
2460  const UINT deviceIdMask = 0xFF6; // device type mask && device color mask
2461  quint64 uniqueId = (csr_type & deviceIdMask);
2462  uniqueId = (uniqueId << 32) | csr_physid;
2463 
2464  // initialising and updating the cursor should be done in response to
2465  // WT_CSRCHANGE. We do it in WT_PROXIMITY because some wintab never send
2466  // the event WT_CSRCHANGE even if asked with CXO_CSRMESSAGES
2467  const QTabletCursorInfo *const globalCursorInfo = tCursorInfo();
2468  if (!globalCursorInfo->contains(uniqueId))
2469  tabletInit(uniqueId, csr_type, qt_tablet_context);
2470 
2471  currentTabletPointer = globalCursorInfo->value(uniqueId);
2472  tabletUpdateCursor(currentTabletPointer, currentCursor);
2473  }
2474  qt_tabletChokeMouse = false;
2475 
2476  QTabletEvent tabletProximity(enteredProximity ? QEvent::TabletEnterProximity
2478  QPoint(), QPoint(), QPointF(), currentTabletPointer.currentDevice, currentTabletPointer.currentPointerType, 0, 0,
2479  0, 0, 0, 0, 0, currentTabletPointer.llId);
2480  QApplication::sendEvent(qApp, &tabletProximity);
2481  }
2482  #endif // QT_NO_TABLETEVENT
2483 
2484  break;
2485 #ifdef Q_WS_WINCE_WM
2486  case WM_SETFOCUS: {
2487  HIMC hC;
2488  hC = ImmGetContext(hwnd);
2489  ImmSetOpenStatus(hC, TRUE);
2490  ImmEscape(NULL, hC, IME_ESC_SET_MODE, (LPVOID)IM_SPELL);
2491  result = false;
2492  }
2493  break;
2494 #endif
2495  case WM_KILLFOCUS:
2496  if (!QWidget::find((HWND)wParam)) { // we don't get focus, so unset it now
2497  if (!widget->hasFocus()) // work around Windows bug after minimizing/restoring
2498  widget = (QETWidget*)QApplication::focusWidget();
2499  HWND focus = ::GetFocus();
2500  //if there is a current widget and the new widget belongs to the same toplevel window
2501  //or if the current widget was embedded into non-qt window (i.e. we won't get WM_ACTIVATEAPP)
2502  //then we clear the focus on the widget
2503  //in case the new widget belongs to a different widget hierarchy, clearing the focus
2504  //will be handled because the active window will change
2505  const bool embedded = widget && ((QETWidget*)widget->window())->topData()->embedded;
2506  if (widget && (embedded || ::IsChild(widget->window()->internalWinId(), focus))) {
2507  widget->clearFocus();
2508  result = true;
2509  } else {
2510  result = false;
2511  }
2512  } else {
2513  result = false;
2514  }
2515  break;
2516  case WM_THEMECHANGED:
2517  if ((widget->windowType() == Qt::Desktop) || !qApp || QApplication::closingDown()
2519  break;
2520 
2522  QApplication::style()->unpolish(widget);
2523 
2525  QApplication::style()->polish(widget);
2526  widget->repolishStyle(*QApplication::style());
2527  if (widget->isVisible())
2528  widget->update();
2529  break;
2530 
2531 #ifndef Q_WS_WINCE
2532  case WM_INPUTLANGCHANGE: {
2533  wchar_t info[7];
2534  if (!GetLocaleInfo(MAKELCID(lParam, SORT_DEFAULT), LOCALE_IDEFAULTANSICODEPAGE, info, 6)) {
2535  inputcharset = CP_ACP;
2536  } else {
2538  }
2540  break;
2541  }
2542 #else
2543  case WM_COMMAND: {
2544  bool OkCommand = (LOWORD(wParam) == 0x1);
2545  bool CancelCommand = (LOWORD(wParam) == 0x2);
2546  if (OkCommand)
2548  if (CancelCommand)
2549  widget->showMinimized();
2550  else
2551 #ifndef QT_NO_MENUBAR
2552  QMenuBar::wceCommands(LOWORD(wParam));
2553 #endif
2554  result = true;
2555  }
2556  break;
2557  case WM_HELP:
2559  result = true;
2560  break;
2561 #endif
2562 
2563  case WM_MOUSELEAVE:
2564  // We receive a mouse leave for curWin, meaning
2565  // the mouse was moved outside our widgets
2566  if (widget->internalWinId() == curWin) {
2567  bool dispatch = !widget->underMouse();
2568  // hasMouse is updated when dispatching enter/leave,
2569  // so test if it is actually up-to-date
2570  if (!dispatch) {
2571  QRect geom = widget->geometry();
2572  if (widget->parentWidget() && !widget->isWindow()) {
2573  QPoint gp = widget->parentWidget()->mapToGlobal(widget->pos());
2574  geom.setX(gp.x());
2575  geom.setY(gp.y());
2576  }
2577  QPoint cpos = QCursor::pos();
2578  dispatch = !geom.contains(cpos);
2579  if ( !dispatch && !QWidget::mouseGrabber()) {
2580  QWidget *hittest = QApplication::widgetAt(cpos);
2581  dispatch = !hittest || hittest->internalWinId() != curWin;
2582  }
2583  if (!dispatch) {
2584  HRGN hrgn = qt_tryCreateRegion(QRegion::Rectangle, 0,0,0,0);
2585  if (GetWindowRgn(curWin, hrgn) != ERROR) {
2586  QPoint lcpos = widget->mapFromGlobal(cpos);
2587  dispatch = !PtInRegion(hrgn, lcpos.x(), lcpos.y());
2588  }
2589  DeleteObject(hrgn);
2590  }
2591  }
2592  if (dispatch) {
2595  else
2597  curWin = 0;
2599  }
2600  }
2601  break;
2602 
2603  case WM_CANCELMODE:
2604  {
2605  // this goes through QMenuBar's event filter
2608  }
2609  break;
2610 
2611  case WM_IME_NOTIFY:
2612  // special handling for ime, only for widgets in a popup
2613  if (wParam == IMN_OPENCANDIDATE) {
2614  imeParentWnd = hwnd;
2616  // temporarily disable the mouse grab to allow mouse input in
2617  // the ime candidate window. The actual handle is untouched
2618  if (autoCaptureWnd)
2619  ReleaseCapture();
2620  }
2621  } else if (wParam == IMN_CLOSECANDIDATE) {
2622  imeParentWnd = 0;
2624  // undo the action above, when candidate window is closed
2625  if (autoCaptureWnd)
2626  SetCapture(autoCaptureWnd);
2627  }
2628  }
2629  result = false;
2630  break;
2631 #ifndef QT_NO_GESTURES
2632 #if !defined(Q_WS_WINCE) || defined(QT_WINCE_GESTURES)
2633  case WM_GESTURE: {
2634  GESTUREINFO gi;
2635  memset(&gi, 0, sizeof(GESTUREINFO));
2636  gi.cbSize = sizeof(GESTUREINFO);
2637 
2639  BOOL bResult = false;
2640  if (qAppPriv->GetGestureInfo)
2641  bResult = qAppPriv->GetGestureInfo((HANDLE)msg.lParam, &gi);
2642  if (bResult) {
2643  if (gi.dwID == GID_BEGIN) {
2644  // find the alien widget for the gesture position.
2645  // This might not be accurate as the position is the center
2646  // point of two fingers for multi-finger gestures.
2647  QPoint pt(gi.ptsLocation.x, gi.ptsLocation.y);
2648  QWidget *w = widget->childAt(widget->mapFromGlobal(pt));
2649  qAppPriv->gestureWidget = w ? w : widget;
2650  }
2651  if (qAppPriv->gestureWidget)
2652  static_cast<QETWidget*>(qAppPriv->gestureWidget)->translateGestureEvent(msg, gi);
2653  if (qAppPriv->CloseGestureInfoHandle)
2654  qAppPriv->CloseGestureInfoHandle((HANDLE)msg.lParam);
2655  if (gi.dwID == GID_END)
2656  qAppPriv->gestureWidget = 0;
2657  } else {
2658  DWORD dwErr = GetLastError();
2659  if (dwErr > 0)
2660  qWarning() << "translateGestureEvent: error = " << dwErr;
2661  }
2662  result = true;
2663  break;
2664  }
2665 #endif // !defined(Q_WS_WINCE) || defined(QT_WINCE_GESTURES)
2666 #endif // QT_NO_GESTURES
2667 #ifndef QT_NO_CURSOR
2668  case WM_SETCURSOR: {
2670  if (ovr) {
2671  SetCursor(ovr->handle());
2672  RETURN(TRUE);
2673  }
2674  result = false;
2675  break;
2676  }
2677 #endif
2678  default:
2679  result = false; // event was not processed
2680  break;
2681  }
2682  }
2683 
2684  if (evt_type != QEvent::None) { // simple event
2685  QEvent e(evt_type);
2686  result = qt_sendSpontaneousEvent(widget, &e);
2687  }
2688 
2689  if (result)
2690  RETURN(false);
2691 
2692 do_default:
2693 #ifndef QT_NO_IM
2694  RETURN(QWinInputContext::DefWindowProc(hwnd,message,wParam,lParam))
2695 #else
2696  RETURN(TRUE);
2697 #endif
2698 }
#define GID_BEGIN
static void qt_set_windows_font_resources()
static QString fromWCharArray(const wchar_t *, int size=-1)
Returns a copy of the string, where the encoding of string depends on the size of wchar...
Definition: qstring.cpp:1019
QPoint pos() const
#define WM_MOUSEWHEEL
Definition: qt_windows.h:116
static void updateSystemPrivate()
Definition: qlocale.cpp:478
HCURSOR_or_HANDLE handle() const
Returns a platform-specific cursor handle.
Definition: qcursor_mac.mm:301
#define CSR_TYPE
virtual void unpolish(QWidget *)
Uninitialize the given {widget}&#39;s appearance.
Definition: qstyle.cpp:409
static HWND autoCaptureWnd
void hideChildren(bool spontaneous)
QWidget * parentWidget() const
Returns the parent of this widget, or 0 if it does not have any parent widget.
Definition: qwidget.h:1035
int minimumHeight() const
int reconvertString(RECONVERTSTRING *reconv)
unsigned long WId
Definition: qwindowdefs.h:119
QWidget * focusWidget() const
Returns the last child of this widget that setFocus had been called on.
Definition: qwidget.cpp:6863
#define WM_GETOBJECT
void setBottom(int pos)
Sets the bottom edge of the rectangle to the given y coordinate.
Definition: qrect.h:267
The QCursor class provides a mouse cursor with an arbitrary shape.
Definition: qcursor.h:89
HCTX qt_tablet_context
static mach_timebase_info_data_t info
#define WM_TOUCH
int qint32
Definition: qglobal.h:937
QSize size() const
QPointer< QWidget > widget
QTabletDeviceData currentTabletPointer
Qt::WindowStates windowState() const
Returns the current window state.
Definition: qwidget.cpp:3086
void setWindowState(Qt::WindowStates state)
Sets the window state to windowState.
static bool sm_cancel
static bool qt_is_translatable_mouse_event(UINT message)
int toInt(bool *ok=0, int base=10) const
Returns the string converted to an int using base base, which is 10 by default and must be between 2 ...
Definition: qstring.cpp:6090
static PtrWTEnable ptrWTEnable
#define WM_MOUSEHWHEEL
Definition: qt_windows.h:119
bool isWindow() const
Returns true if the widget is an independent window, otherwise returns false.
Definition: qwidget.h:945
#define WM_THEMECHANGED
The QContextMenuEvent class contains parameters that describe a context menu event.
Definition: qevent.h:396
WId effectiveWinId() const
Returns the effective window system identifier of the widget, i.
Definition: qwidget.cpp:2654
static void postEvent(QObject *receiver, QEvent *event)
Adds the event event, with the object receiver as the receiver of the event, to an event queue and re...
#define WM_DRAWCLIPBOARD
bool isVisible() const
Definition: qwidget.h:1005
void markFrameStrutDirty()
Q_GUI_EXPORT bool qt_win_ignoreNextMouseReleaseEvent
static HPALETTE hPal()
void qt_wince_hide_taskbar(HWND hwnd)
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
#define FAPPCOMMAND_KEY
QString windowIconText() const
#define QWIDGETSIZE_MAX
Defines the maximum size for a QWidget object.
Definition: qwidget.h:1087
Qt::FocusPolicy focusPolicy
the way the widget accepts keyboard focus
Definition: qwidget.h:187
uint window_state
Definition: qwidget.h:120
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
void setLocale_helper(const QLocale &l, bool forceUpdate=false)
Definition: qwidget.cpp:6128
int left() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:240
bool winEvent(MSG *m, long *r)
This special event handler can be reimplemented in a subclass to receive native Windows events which ...
static void wceCommands(uint command)
This function sends native Windows CE commands to Qt menu bars and all their child menus...
static const QMetaObject staticMetaObject
This variable stores the meta-object for the class.
Definition: qobject.h:128
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
QWidget * nextInFocusChain() const
Returns the next widget in this widget&#39;s focus chain.
Definition: qwidget.cpp:6873
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
static QApplicationPrivate * instance()
bool translateTabletEvent(const MSG &msg, PACKET *localPacketBuf, int numPackets)
#define SPI_SETNONCLIENTMETRICS
static QStyle * style()
Returns the application&#39;s style object.
bool underMouse() const
Returns true if the widget is under the mouse cursor; otherwise returns false.
Definition: qwidget.h:996
KeyboardModifier
Definition: qnamespace.h:127
virtual QVariant inputMethodQuery(Qt::InputMethodQuery) const
This method is only relevant for input widgets.
Definition: qwidget.cpp:9683
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
void setY(int y)
Sets the top edge of the rectangle to the given y coordinate.
Definition: qrect.h:285
int bottom() const
Returns the y-coordinate of the rectangle&#39;s bottom edge.
Definition: qrect.h:249
The QString class provides a Unicode character string.
Definition: qstring.h:83
bool hasFocus() const
Definition: qwidget.cpp:6583
T * qobject_cast(QObject *object)
Definition: qobject.h:375
virtual bool hasHeightForWidth() const
Returns true if this layout&#39;s preferred height depends on its width; otherwise returns false...
#define APPCOMMAND_TREBLE_DOWN
QClipboard * qt_clipboard
The QHash class is a template class that provides a hash-table-based dictionary.
Definition: qdatastream.h:66
QWidget * qt_get_tablet_widget()
static void tabletInit(const quint64 uniqueId, const UINT csr_type, HCTX hTab)
void updateKeyMap(const MSG &msg)
static void resolveAygLibs()
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
#define APPCOMMAND_BASS_UP
int height() const
static QSize closestAcceptableSize(const QWidget *w, const QSize &s)
Returns a size that satisfies all size constraints on widget, including heightForWidth() and that is ...
Definition: qlayout.cpp:1586
bool contains(const Key &key) const
Returns true if the hash contains an item with the key; otherwise returns false.
Definition: qhash.h:872
PtrGetGestureInfo GetGestureInfo
#define WM_SETCURSOR
qint32 minw
Definition: qwidget_p.h:264
const T value(const Key &key) const
Returns the value associated with the key.
Definition: qhash.h:606
static HWND curWin
void showChildren(bool spontaneous)
void update()
Updates the widget unless updates are disabled or the widget is hidden.
Definition: qwidget.cpp:10883
#define SW_PARENTOPENING
void clearFocus()
Takes keyboard input focus from the widget.
Definition: qwidget.cpp:6757
static void quit()
Tells the application to exit with return code 0 (success).
void setWindowTitle_helper(const QString &title)
static QWidget * widgetAt(const QPoint &p)
Returns the widget at global screen position point, or 0 if there is no Qt widget there...
static bool inLoop
static QThreadData * get2(QThread *thread)
Definition: qthread_p.h:219
static QCursor * overrideCursor()
Strips out vertical alignment flags and transforms an alignment align of Qt::AlignLeft into Qt::Align...
QRect normalGeometry
Definition: qwidget_p.h:181
QTLWExtra * topData()
#define SHRG_RETURNCMD
QDesktopWidget * qt_desktopWidget
static AygRecognizeGesture ptrRecognizeGesture
#define APPCOMMAND_HELP
static PACKET localPacketBuf[QT_TABLET_NPACKETQSIZE]
unsigned __int64 quint64
Definition: qglobal.h:943
static QWidget * mouseGrabber()
Returns the widget that is currently grabbing the mouse input.
static QCursorData * currentCursor
Definition: qcursor_mac.mm:106
int size() const
Returns the number of characters in this string.
Definition: qstring.h:102
qint32 maxw
Definition: qwidget_p.h:266
bool testAttribute(Qt::WidgetAttribute) const
Returns true if attribute attribute is set on this widget; otherwise returns false.
Definition: qwidget.h:1041
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
QPointer< QWidget > qt_last_mouse_receiver
#define qApp
struct tagGESTUREINFO GESTUREINFO
int width() const
bool translateWheelEvent(const QWSMouseEvent *me)
void setTop(int pos)
Sets the top edge of the rectangle to the given y coordinate.
Definition: qrect.h:261
#define APPCOMMAND_FIND
QWidget * childAt(int x, int y) const
Returns the visible child widget at the position ({x}, {y}) in the widget&#39;s coordinate system...
Definition: qwidget.h:934
static bool qt_try_modal(QWidget *, MSG *, int &ret)
qint32 maxh
Definition: qwidget_p.h:267
QSize size() const
Returns the size of the rectangle.
Definition: qrect.h:309
The QHideEvent class provides an event which is sent after a widget is hidden.
Definition: qevent.h:388
static QWidget * find(WId)
Returns a pointer to the widget with window identifer/handle id.
Definition: qwidget.cpp:2517
void setRight(int pos)
Sets the right edge of the rectangle to the given x coordinate.
Definition: qrect.h:264
Qt::KeyboardModifiers qt_win_getKeyboardModifiers()
#define WM_XBUTTONUP
The QResizeEvent class contains event parameters for resize events.
Definition: qevent.h:349
static HWND imeParentWnd
Q_CORE_EXPORT void qWarning(const char *,...)
#define GET_X_LPARAM(lp)
unsigned int uint
Definition: qglobal.h:996
#define FALSE
Synonym for false.
Definition: qglobal.h:1019
QString windowTitle() const
bool translateKeyEvent(QWidget *receiver, const MSG &msg, bool grab)
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
#define GET_DEVICE_LPARAM(lParam)
#define APPCOMMAND_BASS_DOWN
#define IMR_CONFIRMRECONVERTSTRING
#define WM_GESTURE
#define SPI_SETICONTITLELOGFONT
int indexOfSignal(const char *signal) const
Finds signal and returns its index; otherwise returns -1.
#define WM_CHANGECBCHAIN
Qt::ContextMenuPolicy contextMenuPolicy
how the widget shows a context menu
Definition: qwidget.h:189
#define GID_END
void * HANDLE
Definition: qnamespace.h:1671
The QShowEvent class provides an event that is sent when a widget is shown.
Definition: qevent.h:380
static void tabletUpdateCursor(QTabletDeviceData &tdd, const UINT currentCursor)
static void setActiveWindow(QWidget *act)
Sets the active window to the active widget in response to a system event.
#define IMR_RECONVERTSTRING
static void releaseAutoCapture()
void setX(int x)
Sets the left edge of the rectangle to the given x coordinate.
Definition: qrect.h:282
static QWidgetList topLevelWidgets()
Returns a list of the top-level widgets (windows) in the application.
QWidgetPrivate * dptr()
void showMinimized()
Shows the widget minimized, as an icon.
Definition: qwidget.cpp:3038
QInputContext * inputContext()
This function returns the QInputContext for this widget.
Definition: qwidget.cpp:474
bool contains(const QPoint &p, bool proper=false) const
Returns true if the given point is inside or on the edge of the rectangle, otherwise returns false...
Definition: qrect.cpp:1101
bool isEnabled() const
Definition: qwidget.h:948
The QTabletEvent class contains parameters that describe a Tablet event.
Definition: qevent.h:179
static bool startingUp()
Returns true if an application object has not been created yet; otherwise returns false...
#define TRUE
Synonym for true.
Definition: qglobal.h:1018
static QAccessibleInterface * queryAccessibleInterface(QObject *)
If a QAccessibleInterface implementation exists for the given object, this function returns a pointer...
void resize(int size)
Sets the size of the string to size characters.
Definition: qstring.cpp:1353
QPoint center() const
Returns the center point of the rectangle.
Definition: qrect.h:300
static bool sm_smActive
static bool tryModalHelper(QWidget *widget, QWidget **rettop=0)
static PtrWTPacketsGet ptrWTPacketsGet
bool composition(LPARAM lparam)
QWExtra * xtra()
struct tagMSG MSG
int top() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:243
uint testWindowState(uint teststate)
static QWidget * activePopupWidget()
Returns the active popup widget.
The QWindowStateChangeEvent class provides the window state before a window state change...
Definition: qevent.h:705
static bool closingDown()
Returns true if the application objects are being destroyed; otherwise returns false.
static bool app_do_modal
int right() const
Returns the x-coordinate of the rectangle&#39;s right edge.
Definition: qrect.h:246
WId
Platform dependent window identifier.
void resize(int w, int h)
This corresponds to resize(QSize(w, h)).
Definition: qwidget.h:1014
#define SPI_SETFONTSMOOTHINGTYPE
Type
This enum type defines the valid event types in Qt.
Definition: qcoreevent.h:62
void setLeft(int pos)
Sets the left edge of the rectangle to the given x coordinate.
Definition: qrect.h:258
#define APPCOMMAND_TREBLE_UP
int y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:255
The QAccessibleInterface class defines an interface that exposes information about accessible objects...
Definition: qaccessible.h:370
unsigned short ushort
Definition: qglobal.h:995
QRect toRect() const
Returns the variant as a QRect if the variant has type() Rect ; otherwise returns an invalid QRect...
Definition: qvariant.cpp:2416
static void changeKeyboard()
Definition: qkeymapper.cpp:90
int x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:252
static PtrWTInfo ptrWTInfo
PtrCloseGestureInfoHandle CloseGestureInfoHandle
#define GET_APPCOMMAND_LPARAM(lParam)
static void qt_win_read_cleartype_settings()
int key
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
static QWidget * keyboardGrabber()
Returns the widget that is currently grabbing the keyboard input.
virtual QString text(Text t, int child) const =0
Returns the value of the text property t of the object, or of the object&#39;s child if child is not 0...
static bool desktopSettingsAware()
Returns true if Qt is set to use the system&#39;s standard colors, fonts, etc.
int maximumHeight() const
QString objectName() const
int height() const
Returns the height.
Definition: qsize.h:129
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
Definition: qnamespace.h:54
static LRESULT DefWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
bool translateTouchEvent(const MSG &msg)
bool translatePaintEvent(const MSG &msg)
WId internalWinId() const
Returns the window system identifier of the widget, or 0 if the widget is not created yet...
Definition: qwidget.h:244
static void dispatchEnterLeave(QWidget *enter, QWidget *leave)
#define GN_CONTEXTMENU
void activateWindow()
Sets the top-level widget containing this widget to be the active window.
int y() const
Returns the y coordinate of this point.
Definition: qpoint.h:131
quint16 index
static PtrWTOverlap ptrWTOverlap
QPoint mapFromGlobal(const QPoint &) const
Translates the global screen coordinate pos to widget coordinates.
bool isMinimized() const
Definition: qwidget.cpp:3027
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492
virtual void polish(QWidget *)
Initializes the appearance of the given widget.
Definition: qstyle.cpp:390
static bool sendKeyEvent(QWidget *widget, bool grab, QEvent::Type type, int code, Qt::KeyboardModifiers modifiers, const QString &text, bool autorepeat, int count, quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers, bool *unusedExceptForCocoa=0)
qint32 minh
Definition: qwidget_p.h:265
QKeyMapperPrivate * qt_keymapper_private()
Definition: qkeymapper.cpp:113
QLayout * layout() const
Returns the layout manager that is installed on this widget, or 0 if no layout manager is installed...
Definition: qwidget.cpp:10073
bool translateMouseEvent(const QWSMouseEvent *, int oldstate)
The QClipboardEvent class provides the parameters used in a clipboard event.
Definition: qevent.h:695
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
Qt::WindowType windowType() const
Returns the window type of this widget.
Definition: qwidget.h:937
WId winId() const
Returns the window system identifier of the widget.
Definition: qwidget.cpp:2557
#define WM_APPCOMMAND
bool close()
Closes this widget.
Definition: qwidget.cpp:8305
#define GET_Y_LPARAM(lp)
#define WM_XBUTTONDBLCLK
int x() const
Returns the x coordinate of this point.
Definition: qpoint.h:128
#define SHRG_NOANIMATION
#define RETURN(x)
Qt::WindowFlags windowFlags() const
Window flags are a combination of a type (e.
Definition: qwidget.h:939
bool qt_sendSpontaneousEvent(QObject *, QEvent *)
void repolishStyle(QStyle &style)
QWidgetData * dataPtr()
#define GET_KEYSTATE_LPARAM(lParam)
const QRect & geometry() const
QSessionManager * qt_session_manager_self
static void alert_widget(QWidget *widget, int duration)
static QPointer< QWidget > popupButtonFocus
#define SPI_SETSIPINFO
static bool sm_blockUserInput
QRect frameStrut() const
The QEvent class is the base class of all event classes.
Definition: qcoreevent.h:56
HRGN qt_tryCreateRegion(QRegion::RegionType type, int left, int top, int right, int bottom)
Definition: qregion_win.cpp:55
int minimumWidth() const
static Type type()
Returns the type of application (Tty , GuiClient, or GuiServer).
static QWidget * focusWidget()
Returns the application widget that has the keyboard input focus, or 0 if no widget in this applicati...
IAccessible * qt_createWindowsAccessible(QAccessibleInterface *object)
static int inputcharset
QPoint mapToGlobal(const QPoint &) const
Translates the widget coordinate pos to global screen coordinates.
static int translateButtonState(int s, int type, int button)
static void qt_set_windows_updateScrollBar(QWidget *widget)
#define APPCOMMAND_BASS_BOOST
bool translateConfigEvent(const MSG &msg)
static void enterWhatsThisMode()
This function switches the user interface into "What&#39;s This?" mode.
Definition: qwhatsthis.cpp:633
QWidget * qt_button_down
static void qt_set_windows_color_resources()
void move(int x, int y)
This corresponds to move(QPoint(x, y)).
Definition: qwidget.h:1011
#define text
Definition: qobjectdefs.h:80
static QPoint pos()
Returns the position of the cursor (hot spot) in global screen coordinates.
Definition: qcursor_mac.mm:310
#define WM_ACTIVATEAPP
#define WM_MOUSELEAVE
#define SW_PARENTCLOSING
#define WM_XBUTTONDOWN
static Qt::KeyboardModifiers oldstate
Definition: qdnd_qws.cpp:87
static int area(const QSize &s)
Definition: qicon.cpp:155
bool translateCloseEvent(const MSG &msg)
bool qt_tabletChokeMouse
const ushort * utf16() const
Returns the QString as a &#39;\0\&#39;-terminated array of unsigned shorts.
Definition: qstring.cpp:5290
int maximumWidth() const

◆ qWinProcessConfigRequests()

static void qWinProcessConfigRequests ( )
static

Definition at line 1162 of file qapplication_win.cpp.

Referenced by QGuiEventDispatcherWin32::processEvents().

1163 {
1164  if (!configRequests)
1165  return;
1166  QWinConfigRequest *r;
1167  for (;;) {
1168  if (configRequests->isEmpty())
1169  break;
1170  r = configRequests->takeLast();
1171  QWidget *w = QWidget::find(r->id);
1172  QRect rect(r->x, r->y, r->w, r->h);
1173  int req = r->req;
1174  delete r;
1175 
1176  if ( w ) { // widget exists
1178  return; // biting our tail
1179  if (req == 0)
1180  w->move(rect.topLeft());
1181  else if (req == 1)
1182  w->resize(rect.size());
1183  else
1184  w->setGeometry(rect);
1185  }
1186  }
1187  delete configRequests;
1188  configRequests = 0;
1189 }
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
void setGeometry(int x, int y, int w, int h)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qwidget.h:1017
static QList< QWinConfigRequest * > * configRequests
bool testAttribute(Qt::WidgetAttribute) const
Returns true if attribute attribute is set on this widget; otherwise returns false.
Definition: qwidget.h:1041
static QWidget * find(WId)
Returns a pointer to the widget with window identifer/handle id.
Definition: qwidget.cpp:2517
void resize(int w, int h)
This corresponds to resize(QSize(w, h)).
Definition: qwidget.h:1014
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
void move(int x, int y)
This corresponds to move(QPoint(x, y)).
Definition: qwidget.h:1011

◆ qWinRequestConfig()

void qWinRequestConfig ( WId  id,
int  req,
int  x,
int  y,
int  w,
int  h 
)

Definition at line 1148 of file qapplication_win.cpp.

Referenced by qt_grab_cursor(), and qt_tablet_cleanup_wce().

1149 {
1150  if (!configRequests) // create queue
1153  r->id = id; // create new request
1154  r->req = req;
1155  r->x = x;
1156  r->y = y;
1157  r->w = w;
1158  r->h = h;
1159  configRequests->append(r); // store request in queue
1160 }
static QList< QWinConfigRequest * > * configRequests
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ releaseAutoCapture()

static void releaseAutoCapture ( )
static

Definition at line 2938 of file qapplication_win.cpp.

Referenced by qt_try_modal(), QtWndProc(), setAutoCapture(), QETWidget::translateMouseEvent(), QETWidget::translateTabletEvent(), and QApplication::winMouseButtonUp().

2939 {
2940  if (autoCaptureWnd) {
2941  ReleaseCapture();
2942  autoCaptureWnd = 0;
2943  }
2944 }
static HWND autoCaptureWnd

◆ resolveAygLibs()

static void resolveAygLibs ( )
static

Definition at line 218 of file qapplication_win.cpp.

Referenced by QtWndProc().

219 {
220  if (!aygResolved) {
221  QSystemLibrary ayglib(QLatin1String("aygshell"));
222  ptrRecognizeGesture = (AygRecognizeGesture) ayglib.resolve("SHRecognizeGesture");
223  aygResolved = true;
224  }
225 }
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
static AygRecognizeGesture ptrRecognizeGesture
DWORD(API * AygRecognizeGesture)(SHRGINFO *)
static bool aygResolved

◆ setAutoCapture()

static void setAutoCapture ( HWND  h)
static

Definition at line 2930 of file qapplication_win.cpp.

Referenced by qt_try_modal(), and QETWidget::translateMouseEvent().

2931 {
2932  if (autoCaptureWnd)
2934  autoCaptureWnd = h;
2935  SetCapture(h);
2936 }
static HWND autoCaptureWnd
static void releaseAutoCapture()

◆ tabletInit()

static void tabletInit ( const quint64  uniqueId,
const UINT  csr_type,
HCTX  hTab 
)
static

Definition at line 3502 of file qapplication_win.cpp.

Referenced by QtWndProc().

3503 {
3505  Q_ASSERT(ptrWTGet);
3506 
3507  Q_ASSERT(!tCursorInfo()->contains(uniqueId));
3508 
3509  /* browse WinTab's many info items to discover pressure handling. */
3510  AXIS np;
3511  LOGCONTEXT lc;
3512 
3513  /* get the current context for its device variable. */
3514  ptrWTGet(hTab, &lc);
3515 
3516  /* get the size of the pressure axis. */
3517  QTabletDeviceData tdd;
3518  tdd.llId = uniqueId;
3519 
3520  ptrWTInfo(WTI_DEVICES + lc.lcDevice, DVC_NPRESSURE, &np);
3521  tdd.minPressure = int(np.axMin);
3522  tdd.maxPressure = int(np.axMax);
3523 
3524  ptrWTInfo(WTI_DEVICES + lc.lcDevice, DVC_TPRESSURE, &np);
3525  tdd.minTanPressure = int(np.axMin);
3526  tdd.maxTanPressure = int(np.axMax);
3527 
3528  LOGCONTEXT lcMine;
3529 
3530  /* get default region */
3531  ptrWTInfo(WTI_DEFCONTEXT, 0, &lcMine);
3532 
3533  tdd.minX = 0;
3534  tdd.maxX = int(lcMine.lcInExtX) - int(lcMine.lcInOrgX);
3535 
3536  tdd.minY = 0;
3537  tdd.maxY = int(lcMine.lcInExtY) - int(lcMine.lcInOrgY);
3538 
3539  tdd.minZ = 0;
3540  tdd.maxZ = int(lcMine.lcInExtZ) - int(lcMine.lcInOrgZ);
3541 
3542  const uint cursorTypeBitMask = 0x0F06; // bitmask to find the specific cursor type (see Wacom FAQ)
3543  if (((csr_type & 0x0006) == 0x0002) && ((csr_type & cursorTypeBitMask) != 0x0902)) {
3544  tdd.currentDevice = QTabletEvent::Stylus;
3545  } else {
3546  switch (csr_type & cursorTypeBitMask) {
3547  case 0x0802:
3548  tdd.currentDevice = QTabletEvent::Stylus;
3549  break;
3550  case 0x0902:
3551  tdd.currentDevice = QTabletEvent::Airbrush;
3552  break;
3553  case 0x0004:
3554  tdd.currentDevice = QTabletEvent::FourDMouse;
3555  break;
3556  case 0x0006:
3557  tdd.currentDevice = QTabletEvent::Puck;
3558  break;
3559  case 0x0804:
3560  tdd.currentDevice = QTabletEvent::RotationStylus;
3561  break;
3562  default:
3563  tdd.currentDevice = QTabletEvent::NoDevice;
3564  }
3565  }
3566  tCursorInfo()->insert(uniqueId, tdd);
3567 }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
static PtrWTGet ptrWTGet
unsigned int uint
Definition: qglobal.h:996
static PtrWTInfo ptrWTInfo

◆ tabletUpdateCursor()

static void tabletUpdateCursor ( QTabletDeviceData tdd,
const UINT  currentCursor 
)
static

Definition at line 3575 of file qapplication_win.cpp.

Referenced by QtWndProc().

3576 {
3577  switch (currentCursor % 3) { // %3 for dual track
3578  case 0:
3579  tdd.currentPointerType = QTabletEvent::Cursor;
3580  break;
3581  case 1:
3582  tdd.currentPointerType = QTabletEvent::Pen;
3583  break;
3584  case 2:
3585  tdd.currentPointerType = QTabletEvent::Eraser;
3586  break;
3587  default:
3588  tdd.currentPointerType = QTabletEvent::UnknownPointer;
3589  }
3590 }
static QCursorData * currentCursor
Definition: qcursor_mac.mm:106

◆ translateButtonState()

static int translateButtonState ( int  s,
int  type,
int  button 
)
static

Definition at line 2985 of file qapplication_win.cpp.

Referenced by QtWndProc(), QETWidget::translateMouseEvent(), and QETWidget::translateWheelEvent().

2986 {
2987  Q_UNUSED(type);
2988  Q_UNUSED(button);
2989  int bst = 0;
2990  if (s & MK_LBUTTON)
2991  bst |= Qt::LeftButton;
2992  if (s & MK_MBUTTON)
2993  bst |= Qt::MidButton;
2994  if (s & MK_RBUTTON)
2995  bst |= Qt::RightButton;
2996  if (s & MK_SHIFT)
2997  bst |= Qt::ShiftModifier;
2998  if (s & MK_CONTROL)
2999  bst |= Qt::ControlModifier;
3000 
3001  if (s & MK_XBUTTON1)
3002  bst |= Qt::XButton1;
3003  if (s & MK_XBUTTON2)
3004  bst |= Qt::XButton2;
3005 
3006  if (GetKeyState(VK_MENU) < 0)
3007  bst |= Qt::AltModifier;
3008 
3009  if ((GetKeyState(VK_LWIN) < 0) ||
3010  (GetKeyState(VK_RWIN) < 0))
3011  bst |= Qt::MetaModifier;
3012 
3013  return bst;
3014 }
int type
Definition: qmetatype.cpp:239
#define MK_XBUTTON1
#define MK_XBUTTON2
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ unregWinClasses()

static void unregWinClasses ( )
static

Definition at line 1123 of file qapplication_win.cpp.

Referenced by qt_cleanup().

1124 {
1125  WinClassNameHash *hash = winclassNames();
1127  while (it != hash->constEnd()) {
1128  UnregisterClass((wchar_t*)it.key().utf16(), qWinAppInst());
1129  ++it;
1130  }
1131  hash->clear();
1132 }
static uint hash(const uchar *p, int n)
Definition: qhash.cpp:68
void clear()
Removes all items from the hash.
Definition: qhash.h:574
#define it(className, varName)
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the hash.
Definition: qhash.h:466
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the hash...
Definition: qhash.h:469
const Key key(const T &value) const
Returns the first key mapped to value.
Definition: qhash.h:674
Q_CORE_EXPORT HINSTANCE qWinAppInst()
const ushort * utf16() const
Returns the QString as a &#39;\0\&#39;-terminated array of unsigned shorts.
Definition: qstring.cpp:5290

Variable Documentation

◆ app_do_modal

bool app_do_modal = false
static

Definition at line 441 of file qapplication_win.cpp.

Referenced by QtWndProc().

◆ appNoGrab

bool appNoGrab = false
static

Definition at line 438 of file qapplication_win.cpp.

Referenced by qt_init(), and qt_nograb().

◆ autoCaptureWnd

HWND autoCaptureWnd = 0
static

Definition at line 450 of file qapplication_win.cpp.

Referenced by QtWndProc(), and QETWidget::translateTabletEvent().

◆ aygResolved

bool aygResolved = false
static

Definition at line 217 of file qapplication_win.cpp.

Referenced by resolveAygLibs().

◆ configRequests

QList<QWinConfigRequest*>* configRequests = 0
static

Definition at line 1146 of file qapplication_win.cpp.

Referenced by qWinProcessConfigRequests().

◆ currentTabletPointer

QTabletDeviceData currentTabletPointer

Definition at line 286 of file qapplication_win.cpp.

◆ curWin

HWND curWin = 0
static

◆ displayDC

HDC displayDC = 0
static

Definition at line 423 of file qapplication_win.cpp.

Referenced by qt_win_display_dc(), qt_wince_GetDIBits(), and QtHDC::QtHDC().

◆ effect_override

bool effect_override = false
static

Definition at line 4081 of file qapplication_win.cpp.

◆ imeParentWnd

HWND imeParentWnd = 0
static

Definition at line 451 of file qapplication_win.cpp.

◆ inLoop

bool inLoop = false
static

Definition at line 1457 of file qapplication_win.cpp.

◆ inputcharset

int inputcharset = CP_ACP
static

Definition at line 1458 of file qapplication_win.cpp.

◆ localPacketBuf

PACKET localPacketBuf[QT_TABLET_NPACKETQSIZE]
static

Definition at line 260 of file qapplication_win.cpp.

Referenced by QETWidget::markFrameStrutDirty(), and QtWndProc().

◆ mouseTbl

const ushort mouseTbl[]
static

Definition at line 2953 of file qapplication_win.cpp.

◆ oldHiResTabletGlobalPosF

QPointF oldHiResTabletGlobalPosF

Definition at line 263 of file qapplication_win.cpp.

Referenced by QETWidget::translateTabletEvent().

◆ popupButtonFocus

QPointer<QWidget> popupButtonFocus
static

Definition at line 444 of file qapplication_win.cpp.

Referenced by QETWidget::translateMouseEvent().

◆ ptrRecognizeGesture

AygRecognizeGesture ptrRecognizeGesture = 0
static

Definition at line 216 of file qapplication_win.cpp.

Referenced by QtWndProc(), and resolveAygLibs().

◆ ptrSetProcessDPIAware

PtrSetProcessDPIAware ptrSetProcessDPIAware = 0
static

Definition at line 756 of file qapplication_win.cpp.

Referenced by qt_init().

◆ ptrUpdateLayeredWindow

PtrUpdateLayeredWindow ptrUpdateLayeredWindow = 0

Definition at line 757 of file qapplication_win.cpp.

Referenced by qt_grab_cursor().

◆ ptrUpdateLayeredWindowIndirect

PtrUpdateLayeredWindowIndirect ptrUpdateLayeredWindowIndirect = 0

Definition at line 758 of file qapplication_win.cpp.

Referenced by QRasterWindowSurface::flush(), and qt_grab_cursor().

◆ ptrWTEnable

PtrWTEnable ptrWTEnable = 0
static

Definition at line 255 of file qapplication_win.cpp.

Referenced by initWinTabFunctions(), and QtWndProc().

◆ ptrWTGet

PtrWTGet ptrWTGet = 0
static

Definition at line 258 of file qapplication_win.cpp.

Referenced by initWinTabFunctions(), and tabletInit().

◆ ptrWTInfo

PtrWTInfo ptrWTInfo = 0
static

◆ ptrWTOverlap

PtrWTOverlap ptrWTOverlap = 0
static

Definition at line 256 of file qapplication_win.cpp.

Referenced by initWinTabFunctions(), and QtWndProc().

◆ ptrWTPacketsGet

PtrWTPacketsGet ptrWTPacketsGet = 0
static

Definition at line 257 of file qapplication_win.cpp.

Referenced by initWinTabFunctions(), and QtWndProc().

◆ qt_app_has_font

bool qt_app_has_font

Referenced by QETWidget::forceUpdate().

◆ qt_button_down

QWidget* qt_button_down = 0

Definition at line 447 of file qapplication_win.cpp.

Referenced by QETWidget::translateTabletEvent().

◆ qt_cleartype_enabled

Q_GUI_EXPORT bool qt_cleartype_enabled

◆ qt_desktopWidget

QDesktopWidget* qt_desktopWidget

Definition at line 560 of file qapplication.cpp.

◆ qt_fontsmoothing_gamma

Q_GUI_EXPORT qreal qt_fontsmoothing_gamma

◆ qt_is_gui_used

bool qt_is_gui_used

Definition at line 492 of file qapplication.cpp.

Referenced by QETWidget::translateTabletEvent().

◆ qt_last_mouse_receiver

QPointer<QWidget> qt_last_mouse_receiver = 0

Definition at line 448 of file qapplication_win.cpp.

Referenced by QtWndProc(), and QETWidget::translateMouseEvent().

◆ qt_modal_stack

QWidgetList* qt_modal_stack

Definition at line 564 of file qapplication.cpp.

Referenced by QtWndProc().

◆ qt_session_manager_self

QSessionManager* qt_session_manager_self

Definition at line 5053 of file qapplication.cpp.

◆ qt_tablet_context

HCTX qt_tablet_context

◆ qt_tablet_tilt_support

bool qt_tablet_tilt_support

◆ qt_tabletChokeMouse

bool qt_tabletChokeMouse

Definition at line 526 of file qapplication.cpp.

Referenced by QtWndProc().

◆ qt_use_rtl_extensions

bool qt_use_rtl_extensions = false

Definition at line 266 of file qapplication_win.cpp.

◆ qt_win_ignoreNextMouseReleaseEvent

Q_GUI_EXPORT bool qt_win_ignoreNextMouseReleaseEvent = false

Definition at line 434 of file qapplication_win.cpp.

Referenced by QAxClientSite::qt_metacall().

◆ qt_win_owndc_required

Q_GUI_EXPORT bool qt_win_owndc_required

◆ replayPopupMouseEvent

bool replayPopupMouseEvent = false
static

Definition at line 431 of file qapplication_win.cpp.

◆ sm_blockUserInput

bool sm_blockUserInput = false
static

Definition at line 426 of file qapplication_win.cpp.

◆ sm_cancel

bool sm_cancel
static

Definition at line 429 of file qapplication_win.cpp.

◆ sm_smActive

bool sm_smActive = false
static

Definition at line 427 of file qapplication_win.cpp.