Qt 4.8
Classes | Macros | Typedefs | Functions | Variables
qwidget_win.cpp File Reference
#include "qapplication.h"
#include "qapplication_p.h"
#include "qbitmap.h"
#include "qcursor.h"
#include "qdesktopwidget.h"
#include "qevent.h"
#include "qimage.h"
#include "qlayout.h"
#include "qpainter.h"
#include "qstack.h"
#include "qthread.h"
#include "qt_windows.h"
#include "qwidget.h"
#include "qwidget_p.h"
#include "private/qbackingstore_p.h"
#include "private/qwindowsurface_raster_p.h"
#include "qscrollbar.h"
#include "qabstractscrollarea.h"
#include <private/qabstractscrollarea_p.h>
#include <qdebug.h>
#include <private/qapplication_p.h>
#include <private/qwininputcontext_p.h>
#include <private/qpaintengine_raster_p.h>
#include <private/qsystemlibrary_p.h>
#include "qguifunctions_wince.h"
#include <ddraw.h>
#include <private/qimage_p.h>
#include <wintab.h>
#include <pktdef.h>
#include "qwidget_wince.cpp"

Go to the source code of this file.

Classes

class  QOnScreenRasterPaintEngine
 

Macros

#define GWLP_WNDPROC   GWL_WNDPROC
 
#define PACKETDATA
 
#define PACKETMODE   0
 
#define WRECT_MAX   16383
 
#define XCOORD_MAX   16383
 

Typedefs

typedef BOOL(WINAPI * PtrSetLayeredWindowAttributes) (HWND hwnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags)
 
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)
 

Functions

static void init_wintab_functions ()
 
HICON qt_createIcon (QIcon icon, int xSize, int ySize, QPixmap **cache)
 
QWidgetqt_get_tablet_widget ()
 
QCursorqt_grab_cursor ()
 
bool qt_nograb ()
 
QOleDropTargetqt_olednd_register (QWidget *widget)
 
void qt_olednd_unregister (QWidget *widget, QOleDropTarget *dst)
 
const QString qt_reg_winclass (QWidget *w)
 
static void qt_tablet_cleanup ()
 
static void qt_tablet_init ()
 
HRGN qt_tryCreateRegion (QRegion::RegionType type, int left, int top, int right, int bottom)
 
HRGN qt_win_bitmapToRegion (const QBitmap &bitmap)
 
Q_GUI_EXPORT HDC qt_win_display_dc ()
 
void qt_win_initialize_directdraw ()
 
void qt_wince_full_screen (HWND hwnd, bool fullScreen, UINT swpf)
 
bool qt_wince_is_mobile ()
 
void qt_wince_maximize (QWidget *widget)
 
void qt_wince_minimize (HWND hwnd)
 
void qt_wince_unmaximize (QWidget *widget)
 
LRESULT QT_WIN_CALLBACK QtWndProc (HWND, UINT, WPARAM, LPARAM)
 
void qWinRequestConfig (WId, int, int, int, int, int)
 

Variables

static HHOOK journalRec = 0
 
static QWidgetkeyboardGrb = 0
 
static QWidgetmouseGrb = 0
 
static QCursormouseGrbCur = 0
 
static PtrSetLayeredWindowAttributes ptrSetLayeredWindowAttributes = 0
 
static PtrWTClose ptrWTClose = 0
 
static PtrWTInfo ptrWTInfo = 0
 
static PtrWTOpen ptrWTOpen = 0
 
static PtrWTQueueSizeGet ptrWTQueueSizeGet = 0
 
static PtrWTQueueSizeSet ptrWTQueueSizeSet = 0
 
static IDirectDraw * qt_ddraw_object
 
static IDirectDrawSurface * qt_ddraw_primary
 
bool qt_is_gui_used
 
static ucharqt_primary_surface_bits
 
static QImage::Format qt_primary_surface_format
 
static int qt_primary_surface_stride
 
HCTX qt_tablet_context
 
bool qt_tablet_tilt_support
 
static QWidgetqt_tablet_widget = 0
 

Macro Definition Documentation

◆ GWLP_WNDPROC

#define GWLP_WNDPROC   GWL_WNDPROC

Definition at line 101 of file qwidget_win.cpp.

◆ 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 105 of file qwidget_win.cpp.

Referenced by qt_tablet_init().

◆ PACKETMODE

#define PACKETMODE   0

Definition at line 107 of file qwidget_win.cpp.

Referenced by qt_tablet_init().

◆ WRECT_MAX

#define WRECT_MAX   16383

Definition at line 256 of file qwidget_win.cpp.

Referenced by qt_grab_cursor().

◆ XCOORD_MAX

#define XCOORD_MAX   16383

Definition at line 255 of file qwidget_win.cpp.

Referenced by qt_grab_cursor().

Typedef Documentation

◆ PtrSetLayeredWindowAttributes

typedef BOOL(WINAPI * PtrSetLayeredWindowAttributes) (HWND hwnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags)

Definition at line 80 of file qwidget_win.cpp.

◆ PtrWTClose

typedef BOOL(API * PtrWTClose) (HCTX)

Definition at line 114 of file qwidget_win.cpp.

◆ PtrWTEnable

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

Definition at line 116 of file qwidget_win.cpp.

◆ PtrWTGet

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

Definition at line 119 of file qwidget_win.cpp.

◆ PtrWTInfo

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

Definition at line 115 of file qwidget_win.cpp.

◆ PtrWTOpen

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

Definition at line 113 of file qwidget_win.cpp.

◆ PtrWTOverlap

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

Definition at line 117 of file qwidget_win.cpp.

◆ PtrWTPacketsGet

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

Definition at line 118 of file qwidget_win.cpp.

◆ PtrWTQueueSizeGet

typedef int(API * PtrWTQueueSizeGet) (HCTX)

Definition at line 120 of file qwidget_win.cpp.

◆ PtrWTQueueSizeSet

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

Definition at line 121 of file qwidget_win.cpp.

Function Documentation

◆ init_wintab_functions()

static void init_wintab_functions ( )
static

Definition at line 145 of file qwidget_win.cpp.

Referenced by qt_tablet_init().

146 {
147 #if defined(Q_OS_WINCE)
148  return;
149 #else
150  if (!qt_is_gui_used)
151  return;
152  QSystemLibrary library(QLatin1String("wintab32"));
153  ptrWTOpen = (PtrWTOpen)library.resolve("WTOpenW");
154  ptrWTInfo = (PtrWTInfo)library.resolve("WTInfoW");
155  ptrWTClose = (PtrWTClose)library.resolve("WTClose");
156  ptrWTQueueSizeGet = (PtrWTQueueSizeGet)library.resolve("WTQueueSizeGet");
157  ptrWTQueueSizeSet = (PtrWTQueueSizeSet)library.resolve("WTQueueSizeSet");
158 #endif // Q_OS_WINCE
159 }
BOOL(API * PtrWTClose)(HCTX)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
static PtrWTQueueSizeSet ptrWTQueueSizeSet
int(API * PtrWTQueueSizeGet)(HCTX)
UINT(API * PtrWTInfo)(UINT, UINT, LPVOID)
HCTX(API * PtrWTOpen)(HWND, LPLOGCONTEXT, BOOL)
static PtrWTClose ptrWTClose
static PtrWTOpen ptrWTOpen
BOOL(API * PtrWTQueueSizeSet)(HCTX, int)
bool qt_is_gui_used
static PtrWTQueueSizeGet ptrWTQueueSizeGet
static PtrWTInfo ptrWTInfo

◆ qt_createIcon()

HICON qt_createIcon ( QIcon  icon,
int  xSize,
int  ySize,
QPixmap **  cache 
)

Definition at line 798 of file qwidget_win.cpp.

799 {
800  HICON result = 0;
801  if (!icon.isNull()) { // valid icon
802  QSize size = icon.actualSize(QSize(xSize, ySize));
803  QPixmap pm = icon.pixmap(size);
804  if (pm.isNull())
805  return 0;
806 
807  result = pm.toWinHICON();
808 
809  if (cache) {
810  delete *cache;
811  *cache = new QPixmap(pm);;
812  }
813  }
814  return result;
815 }
bool isNull() const
Returns true if the icon is empty; otherwise returns false.
Definition: qicon.cpp:769
HICON toWinHICON() const
Returns the HICON handle.
QSize actualSize(const QSize &size, Mode mode=Normal, State state=Off) const
Returns the actual size of the icon for the requested size, mode, and state.
Definition: qicon.cpp:730
The QPixmap class is an off-screen image representation that can be used as a paint device...
Definition: qpixmap.h:71
QPixmap pixmap(const QSize &size, Mode mode=Normal, State state=Off) const
Returns a pixmap with the requested size, mode, and state, generating one if necessary.
Definition: qicon.cpp:693
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
bool isNull() const
Returns true if this is a null pixmap; otherwise returns false.
Definition: qpixmap.cpp:615

◆ 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_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_nograb()

bool qt_nograb ( )

Definition at line 482 of file qapplication_mac.mm.

Referenced by qt_grab_cursor(), and qt_tablet_cleanup().

483 {
484 #if defined(QT_DEBUG)
485  return appNoGrab;
486 #else
487  return false;
488 #endif
489 }
static bool appNoGrab

◆ qt_olednd_register()

QOleDropTarget* qt_olednd_register ( QWidget widget)

Referenced by qt_tablet_cleanup().

◆ qt_olednd_unregister()

void qt_olednd_unregister ( QWidget widget,
QOleDropTarget dst 
)

Referenced by qt_tablet_cleanup().

◆ qt_reg_winclass()

const QString qt_reg_winclass ( QWidget w)

Definition at line 969 of file qapplication_win.cpp.

Referenced by qt_tablet_cleanup().

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_tablet_cleanup()

static void qt_tablet_cleanup ( )
static

Definition at line 229 of file qwidget_win.cpp.

Referenced by qt_tablet_init().

230 {
231  if (ptrWTClose)
233  delete qt_tablet_widget;
234  qt_tablet_widget = 0;
235 }
static QWidget * qt_tablet_widget
static PtrWTClose ptrWTClose
HCTX qt_tablet_context

◆ qt_tablet_init()

static void qt_tablet_init ( )
static

Definition at line 161 of file qwidget_win.cpp.

162 {
163  static bool firstTime = true;
164  if (!firstTime)
165  return;
166  firstTime = false;
167  qt_tablet_widget = new QWidget(0);
169  qt_tablet_widget->setObjectName(QLatin1String("Qt internal tablet widget"));
170  // We don't need this internal widget to appear in QApplication::topLevelWidgets()
173  LOGCONTEXT lcMine;
175  struct tagAXIS tpOri[3];
178  // make sure we have WinTab
179  if (!ptrWTInfo(0, 0, NULL)) {
180 #ifdef TABLET_DEBUG
181  qWarning("QWidget: Wintab services not available");
182 #endif
183  return;
184  }
185 
186  // some tablets don't support tilt, check if it is possible,
187  qt_tablet_tilt_support = ptrWTInfo(WTI_DEVICES, DVC_ORIENTATION, &tpOri);
189  // check for azimuth and altitude
190  qt_tablet_tilt_support = tpOri[0].axResolution && tpOri[1].axResolution;
191  }
192  // build our context from the default context
193  ptrWTInfo(WTI_DEFSYSCTX, 0, &lcMine);
194  // Go for the raw coordinates, the tablet event will return good stuff
195  lcMine.lcOptions |= CXO_MESSAGES | CXO_CSRMESSAGES;
196  lcMine.lcPktData = PACKETDATA;
197  lcMine.lcPktMode = PACKETMODE;
198  lcMine.lcMoveMask = PACKETDATA;
199  lcMine.lcOutOrgX = 0;
200  lcMine.lcOutExtX = lcMine.lcInExtX;
201  lcMine.lcOutOrgY = 0;
202  lcMine.lcOutExtY = -lcMine.lcInExtY;
203  qt_tablet_context = ptrWTOpen(qt_tablet_widget->winId(), &lcMine, true);
204 #ifdef TABLET_DEBUG
205  qDebug("Tablet is %p", qt_tablet_context);
206 #endif
207  if (!qt_tablet_context) {
208 #ifdef TABLET_DEBUG
209  qWarning("QWidget: Failed to open the tablet");
210 #endif
211  return;
212  }
213  // Set the size of the Packet Queue to the correct size...
214  int currSize = ptrWTQueueSizeGet(qt_tablet_context);
216  // Ideally one might want to use a smaller
217  // multiple, but for now, since we managed to destroy
218  // the existing Q with the previous call, set it back
219  // to the other size, which should work. If not,
220  // there will be trouble.
221  if (!ptrWTQueueSizeSet(qt_tablet_context, currSize)) {
222  Q_ASSERT_X(0, "Qt::Internal", "There is no packet queue for"
223  " the tablet. The tablet will not work");
224  }
225  }
226  }
227 }
static QWidget * qt_tablet_widget
static void qt_tablet_cleanup()
bool remove(const T &value)
Definition: qset.h:89
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
#define PACKETMODE
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
static PtrWTQueueSizeSet ptrWTQueueSizeSet
void setObjectName(const QString &name)
Definition: qobject.cpp:1112
Q_CORE_EXPORT void qDebug(const char *,...)
Q_CORE_EXPORT void qWarning(const char *,...)
static PtrWTOpen ptrWTOpen
static void init_wintab_functions()
static QWidgetSet * allWidgets
Definition: qwidget_p.h:715
bool qt_tablet_tilt_support
#define Q_ASSERT_X(cond, where, what)
Definition: qglobal.h:1837
HCTX qt_tablet_context
void createWinId()
Definition: qwidget.cpp:2626
static PtrWTQueueSizeGet ptrWTQueueSizeGet
WId winId() const
Returns the window system identifier of the widget.
Definition: qwidget.cpp:2557
#define PACKETDATA
void qAddPostRoutine(QtCleanUpFunction ptr)
Adds a global routine that will be called from the QApplication destructor.
static PtrWTInfo ptrWTInfo

◆ 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 qt_grab_cursor().

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_win_bitmapToRegion()

HRGN qt_win_bitmapToRegion ( const QBitmap bitmap)

Referenced by qt_tablet_cleanup().

◆ qt_win_display_dc()

Q_GUI_EXPORT HDC qt_win_display_dc ( )

Definition at line 942 of file qapplication_win.cpp.

Referenced by qt_grab_cursor().

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_initialize_directdraw()

void qt_win_initialize_directdraw ( )

Definition at line 1969 of file qwidget_win.cpp.

Referenced by qt_init().

1970 {
1971  HRESULT res;
1972 
1973  // Some initialization...
1974  if (!qt_ddraw_object) {
1975  res = DirectDrawCreate(0, &qt_ddraw_object, 0);
1976 
1977  if (res != DD_OK)
1978  qWarning("DirectDrawCreate failed: %d", res);
1979 
1980  qt_ddraw_object->SetCooperativeLevel(0, DDSCL_NORMAL);
1981 
1982  DDSURFACEDESC surfaceDesc;
1983  memset(&surfaceDesc, 0, sizeof(DDSURFACEDESC));
1984 
1985  surfaceDesc.dwSize = sizeof(DDSURFACEDESC);
1986  surfaceDesc.dwFlags = DDSD_CAPS;
1987  surfaceDesc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
1988 
1989  res = qt_ddraw_object->CreateSurface(&surfaceDesc, &qt_ddraw_primary, 0);
1990  if (res != DD_OK)
1991  qWarning("CreateSurface failed: %d", res);
1992 
1993  memset(&surfaceDesc, 0, sizeof(DDSURFACEDESC));
1994  surfaceDesc.dwSize = sizeof(DDSURFACEDESC);
1995  res = qt_ddraw_primary->Lock(0, &surfaceDesc, DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR, 0);
1996  if (res != DD_OK)
1997  qWarning("Locking surface failed: %d", res);
1998 
1999  if (surfaceDesc.ddpfPixelFormat.dwFlags == DDPF_RGB) {
2000  qt_primary_surface_bits = (uchar *) surfaceDesc.lpSurface;
2001  qt_primary_surface_stride = surfaceDesc.lPitch;
2003  } else {
2004  qWarning("QWidget painting: unsupported device depth for onscreen painting...\n");
2005  }
2006 
2007  qt_ddraw_primary->Unlock(0);
2008  }
2009 }
static uchar * qt_primary_surface_bits
static IDirectDraw * qt_ddraw_object
Definition: qwidget_win.cpp:86
static IDirectDrawSurface * qt_ddraw_primary
Definition: qwidget_win.cpp:87
unsigned char uchar
Definition: qglobal.h:994
Q_CORE_EXPORT void qWarning(const char *,...)
static int qt_primary_surface_stride
long HRESULT
static QImage::Format qt_primary_surface_format

◆ qt_wince_full_screen()

void qt_wince_full_screen ( HWND  hwnd,
bool  fullScreen,
UINT  swpf 
)

Definition at line 366 of file qguifunctions_wince.cpp.

Referenced by qt_tablet_cleanup_wce().

366  {
367  resolveAygLibs();
368  if (fullScreen) {
369  QRect r = qApp->desktop()->screenGeometry(QWidget::find(hwnd));
370  SetWindowPos(hwnd, HWND_TOP, r.left(), r.top(), r.width(), r.height(), swpf);
371  if (ptrAygFullScreen)
373  if (!qt_wince_is_mobile()) {
374  HWND handle = FindWindow(L"HHTaskBar", L"");
375  if (handle) {
376  ShowWindow(handle, 0);
377  EnableWindow(handle, false);
378  }
379  }
380  } else {
381  if (ptrAygFullScreen)
383  SetWindowPos(hwnd, 0, 0, 0, 0, 0, swpf);
384  if (!qt_wince_is_mobile()) {
385  HWND handle = FindWindow(L"HHTaskBar", L"");
386  if (handle) {
387  ShowWindow(handle, 1);
388  EnableWindow(handle, true);
389  }
390  }
391  }
392 }
#define SHFS_SHOWSTARTICON
int left() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:240
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
#define SHFS_HIDESIPBUTTON
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
#define SHFS_SHOWSIPBUTTON
#define SHFS_SHOWTASKBAR
#define qApp
static QWidget * find(WId)
Returns a pointer to the widget with window identifer/handle id.
Definition: qwidget.cpp:2517
bool qt_wince_is_mobile()
#define SHFS_HIDESTARTICON
static AygFullScreen ptrAygFullScreen
int top() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:243
#define SHFS_HIDETASKBAR
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
static void resolveAygLibs()

◆ qt_wince_is_mobile()

bool qt_wince_is_mobile ( )

Definition at line 296 of file qguifunctions_wince.cpp.

Referenced by qt_grab_cursor().

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

◆ qt_wince_maximize()

void qt_wince_maximize ( QWidget widget)

Definition at line 312 of file qguifunctions_wince.cpp.

Referenced by qt_grab_cursor(), and qt_tablet_cleanup_wce().

313 {
314  HWND hwnd = widget->winId();
315  if (qt_wince_is_mobile()) {
316  AygSHINITDLGINFO shidi;
317  shidi.dwMask = SHIDIM_FLAGS;
318  shidi.hDlg = hwnd;
320  if (widget->windowFlags() & Qt::WindowCancelButtonHint)
321  shidi.dwFlags |= SHIDIF_CANCELBUTTON;
323  shidi.dwFlags |= SHIDIF_DONEBUTTON;
325  shidi.dwFlags |= SHIDIF_CANCELBUTTON;
326  resolveAygLibs();
327  if (ptrAygInitDialog)
328  ptrAygInitDialog(&shidi);
329  } else {
330  RECT r;
331  SystemParametersInfo(SPI_GETWORKAREA, 0, &r, 0);
332  MoveWindow(hwnd, r.top, r.left, r.right - r.left, r.bottom - r.top, true);
333  SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong (hwnd, GWL_EXSTYLE) | WS_EX_NODRAG);
334  }
335 }
#define SHIDIF_DONEBUTTON
#define SPI_GETWORKAREA
#define SHIDIM_FLAGS
static AygInitDialog ptrAygInitDialog
#define WS_EX_NODRAG
bool qt_wince_is_mobile()
#define SHIDIF_SIZEDLGFULLSCREEN
if(void) toggleToolbarShown
WId winId() const
Returns the window system identifier of the widget.
Definition: qwidget.cpp:2557
Qt::WindowFlags windowFlags() const
Window flags are a combination of a type (e.
Definition: qwidget.h:939
static void resolveAygLibs()
#define SHIDIF_CANCELBUTTON

◆ qt_wince_minimize()

void qt_wince_minimize ( HWND  hwnd)

Definition at line 347 of file qguifunctions_wince.cpp.

Referenced by qt_tablet_cleanup_wce().

348 {
349 #ifdef Q_OS_WINCE_WM
350  ShowWindow(hwnd, SW_HIDE);
351 #else
352  if (!IsWindowVisible(hwnd)) {
353  // Hack for an initial showMinimized.
354  // Without it, our widget doesn't appear in the task bar.
355  ShowWindow(hwnd, SW_SHOW);
356  }
357  ShowWindow(hwnd, SW_MINIMIZE);
358 #endif
359 }

◆ qt_wince_unmaximize()

void qt_wince_unmaximize ( QWidget widget)

Definition at line 337 of file qguifunctions_wince.cpp.

Referenced by qt_tablet_cleanup_wce().

338 {
341  {
342  // Hide the [X] button, we've added in qt_wince_maximize.
343  ptrAygSHDoneButton(widget->winId(), SHDB_HIDE);
344  }
345 }
#define SHDB_HIDE
static AygSHDoneButton ptrAygSHDoneButton
bool qt_wince_is_mobile()
WId winId() const
Returns the window system identifier of the widget.
Definition: qwidget.cpp:2557
Qt::WindowFlags windowFlags() const
Window flags are a combination of a type (e.
Definition: qwidget.h:939

◆ QtWndProc()

LRESULT QT_WIN_CALLBACK QtWndProc ( HWND  ,
UINT  ,
WPARAM  ,
LPARAM   
)

Definition at line 1475 of file qapplication_win.cpp.

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

◆ qWinRequestConfig()

void qWinRequestConfig ( WId  ,
int  ,
int  ,
int  ,
int  ,
int   
)

Definition at line 1148 of file qapplication_win.cpp.

Referenced by qt_grab_cursor().

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

Variable Documentation

◆ journalRec

HHOOK journalRec = 0
static

Definition at line 251 of file qwidget_win.cpp.

Referenced by qJournalRecordProc(), and qt_grab_cursor().

◆ keyboardGrb

QWidget* keyboardGrb = 0
static

Definition at line 250 of file qwidget_win.cpp.

Referenced by qt_grab_cursor().

◆ mouseGrb

QWidget* mouseGrb = 0
static

Definition at line 248 of file qwidget_win.cpp.

Referenced by qJournalRecordProc(), and qt_grab_cursor().

◆ mouseGrbCur

QCursor* mouseGrbCur = 0
static

Definition at line 249 of file qwidget_win.cpp.

Referenced by qJournalRecordProc(), and qt_grab_cursor().

◆ ptrSetLayeredWindowAttributes

PtrSetLayeredWindowAttributes ptrSetLayeredWindowAttributes = 0
static

Definition at line 81 of file qwidget_win.cpp.

Referenced by qt_grab_cursor().

◆ ptrWTClose

PtrWTClose ptrWTClose = 0
static

◆ ptrWTInfo

PtrWTInfo ptrWTInfo = 0
static

Definition at line 125 of file qwidget_win.cpp.

Referenced by init_wintab_functions(), and qt_tablet_init().

◆ ptrWTOpen

PtrWTOpen ptrWTOpen = 0
static

Definition at line 123 of file qwidget_win.cpp.

Referenced by init_wintab_functions(), qt_tablet_init(), and qt_tablet_init_wce().

◆ ptrWTQueueSizeGet

PtrWTQueueSizeGet ptrWTQueueSizeGet = 0
static

Definition at line 126 of file qwidget_win.cpp.

Referenced by init_wintab_functions(), qt_tablet_init(), and qt_tablet_init_wce().

◆ ptrWTQueueSizeSet

PtrWTQueueSizeSet ptrWTQueueSizeSet = 0
static

Definition at line 127 of file qwidget_win.cpp.

Referenced by init_wintab_functions(), qt_tablet_init(), and qt_tablet_init_wce().

◆ qt_ddraw_object

IDirectDraw* qt_ddraw_object
static

Definition at line 86 of file qwidget_win.cpp.

Referenced by qt_win_initialize_directdraw().

◆ qt_ddraw_primary

IDirectDrawSurface* qt_ddraw_primary
static

◆ qt_is_gui_used

bool qt_is_gui_used

Definition at line 492 of file qapplication.cpp.

Referenced by init_wintab_functions(), and qt_get_tablet_widget().

◆ qt_primary_surface_bits

uchar* qt_primary_surface_bits
static

Definition at line 1965 of file qwidget_win.cpp.

Referenced by QOnScreenRasterPaintEngine::begin().

◆ qt_primary_surface_format

QImage::Format qt_primary_surface_format
static

Definition at line 1967 of file qwidget_win.cpp.

◆ qt_primary_surface_stride

int qt_primary_surface_stride
static

Definition at line 1966 of file qwidget_win.cpp.

◆ qt_tablet_context

HCTX qt_tablet_context

◆ qt_tablet_tilt_support

bool qt_tablet_tilt_support

◆ qt_tablet_widget

QWidget* qt_tablet_widget = 0
static