summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-03-12 01:00:09 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-03-12 01:00:09 +0100
commit6dc1a52b4a3341e5474eab128161212f6d952513 (patch)
tree2e8714840ab31f48f279a230c6a01e88d979c7bd /src/plugins/platforms/windows
parentffdacff6b0cf068c935e63c0238cbe509f14445c (diff)
parentf1d2c20a2754894f26e3af3d72699ce01f312799 (diff)
Merge remote-tracking branch 'origin/5.11' into dev
Diffstat (limited to 'src/plugins/platforms/windows')
-rw-r--r--src/plugins/platforms/windows/qwindowsglcontext.cpp9
-rw-r--r--src/plugins/platforms/windows/qwindowstabletsupport.cpp99
2 files changed, 83 insertions, 25 deletions
diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp
index 4bdf3167e4..e9c52e2c02 100644
--- a/src/plugins/platforms/windows/qwindowsglcontext.cpp
+++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp
@@ -391,6 +391,15 @@ static PIXELFORMATDESCRIPTOR
pfd.dwFlags |= PFD_DOUBLEBUFFER;
pfd.cDepthBits =
format.depthBufferSize() >= 0 ? format.depthBufferSize() : 32;
+ const int redBufferSize = format.redBufferSize();
+ if (redBufferSize != -1)
+ pfd.cRedBits = BYTE(redBufferSize);
+ const int greenBufferSize = format.greenBufferSize();
+ if (greenBufferSize != -1)
+ pfd.cGreenBits = BYTE(greenBufferSize);
+ const int blueBufferSize = format.blueBufferSize();
+ if (blueBufferSize != -1)
+ pfd.cBlueBits = BYTE(blueBufferSize);
pfd.cAlphaBits = format.alphaBufferSize() > 0 ? format.alphaBufferSize() : 8;
pfd.cStencilBits = format.stencilBufferSize() > 0 ? format.stencilBufferSize() : 8;
if (additional.formatFlags & QWindowsGLAccumBuffer)
diff --git a/src/plugins/platforms/windows/qwindowstabletsupport.cpp b/src/plugins/platforms/windows/qwindowstabletsupport.cpp
index 78e33e57ab..dcad23e446 100644
--- a/src/plugins/platforms/windows/qwindowstabletsupport.cpp
+++ b/src/plugins/platforms/windows/qwindowstabletsupport.cpp
@@ -111,6 +111,61 @@ inline QPointF QWindowsTabletDeviceData::scaleCoordinates(int coordX, int coordY
return QPointF(x, y);
}
+template <class Stream>
+static void formatOptions(Stream &str, unsigned options)
+{
+ if (options & CXO_SYSTEM)
+ str << " CXO_SYSTEM";
+ if (options & CXO_PEN)
+ str << " CXO_PEN";
+ if (options & CXO_MESSAGES)
+ str << " CXO_MESSAGES";
+ if (options & CXO_MARGIN)
+ str << " CXO_MARGIN";
+ if (options & CXO_MGNINSIDE)
+ str << " CXO_MGNINSIDE";
+ if (options & CXO_CSRMESSAGES)
+ str << " CXO_CSRMESSAGES";
+}
+
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug d, const QWindowsTabletDeviceData &t)
+{
+ QDebugStateSaver saver(d);
+ d.nospace();
+ d << "TabletDevice id:" << t.uniqueId << " pressure: " << t.minPressure
+ << ".." << t.maxPressure << " tan pressure: " << t.minTanPressure << ".."
+ << t.maxTanPressure << " area:" << t.minX << t.minY <<t.minZ
+ << ".." << t.maxX << t.maxY << t.maxZ << " device " << t.currentDevice
+ << " pointer " << t.currentPointerType;
+ return d;
+}
+
+QDebug operator<<(QDebug d, const LOGCONTEXT &lc)
+{
+ QDebugStateSaver saver(d);
+ d.nospace();
+ d << "LOGCONTEXT(\"" << QString::fromWCharArray(lc.lcName) << "\", options=0x"
+ << hex << lc.lcOptions << dec;
+ formatOptions(d, lc.lcOptions);
+ d << ", status=0x" << hex << lc.lcStatus << ", device=0x" << lc.lcDevice
+ << dec << ", PktRate=" << lc.lcPktRate
+ << ", PktData=" << lc.lcPktData << ", PktMode=" << lc.lcPktMode
+ << ", MoveMask=0x" << hex << lc.lcMoveMask << ", BtnDnMask=0x" << lc.lcBtnDnMask
+ << ", BtnUpMask=0x" << lc.lcBtnUpMask << dec << ", SysMode=" << lc.lcSysMode
+ << ", InOrg=(" << lc.lcInOrgX << ", " << lc.lcInOrgY << ", " << lc.lcInOrgZ
+ << "), InExt=(" << lc.lcInExtX << ", " << lc.lcInExtY << ", " << lc.lcInExtZ
+ << ") OutOrg=(" << lc.lcOutOrgX << ", " << lc.lcOutOrgY << ", "
+ << lc.lcOutOrgZ << "), OutExt=(" << lc.lcOutExtX << ", " << lc.lcOutExtY
+ << ", " << lc.lcOutExtZ
+ << "), Sens=(" << lc.lcSensX << ", " << lc.lcSensX << ", " << lc.lcSensZ
+ << ") SysOrg=(" << lc.lcSysOrgX << ", " << lc.lcSysOrgY
+ << "), SysExt=(" << lc.lcSysExtX << ", " << lc.lcSysExtY
+ << "), SysSens=(" << lc.lcSysSensX << ", " << lc.lcSysSensY << "))";
+ return d;
+}
+#endif // !QT_NO_DEBUG_STREAM
+
QWindowsWinTab32DLL QWindowsTabletSupport::m_winTab32DLL;
/*!
@@ -186,6 +241,7 @@ QWindowsTabletSupport *QWindowsTabletSupport::create()
LOGCONTEXT lcMine;
// build our context from the default context
QWindowsTabletSupport::m_winTab32DLL.wTInfo(WTI_DEFSYSCTX, 0, &lcMine);
+ qCDebug(lcQpaTablet) << "Default: " << lcMine;
// Go for the raw coordinates, the tablet event will return good stuff
lcMine.lcOptions |= CXO_MESSAGES | CXO_CSRMESSAGES;
lcMine.lcPktData = lcMine.lcMoveMask = PACKETDATA;
@@ -194,6 +250,7 @@ QWindowsTabletSupport *QWindowsTabletSupport::create()
lcMine.lcOutExtX = lcMine.lcInExtX;
lcMine.lcOutOrgY = 0;
lcMine.lcOutExtY = -lcMine.lcInExtY;
+ qCDebug(lcQpaTablet) << "Requesting: " << lcMine;
const HCTX context = QWindowsTabletSupport::m_winTab32DLL.wTOpen(window, &lcMine, true);
if (!context) {
qCDebug(lcQpaTablet) << __FUNCTION__ << "Unable to open tablet.";
@@ -215,7 +272,7 @@ QWindowsTabletSupport *QWindowsTabletSupport::create()
} // mismatch
qCDebug(lcQpaTablet) << "Opened tablet context " << context << " on window "
<< window << "changed packet queue size " << currentQueueSize
- << "->" << TabletPacketQSize;
+ << "->" << TabletPacketQSize << "\nobtained: " << lcMine;
return new QWindowsTabletSupport(window, context);
}
@@ -238,17 +295,23 @@ QString QWindowsTabletSupport::description() const
WORD specificationVersion = 0;
m_winTab32DLL.wTInfo(WTI_INTERFACE, IFC_SPECVERSION, &specificationVersion);
const unsigned opts = options();
- QString result = QString::fromLatin1("%1 specification: v%2.%3 implementation: v%4.%5 options: 0x%6")
- .arg(QString::fromWCharArray(winTabId.data()))
- .arg(specificationVersion >> 8).arg(specificationVersion & 0xFF)
- .arg(implementationVersion >> 8).arg(implementationVersion & 0xFF)
- .arg(opts, 0, 16);
- if (opts & CXO_MESSAGES)
- result += QLatin1String(" CXO_MESSAGES");
- if (opts & CXO_CSRMESSAGES)
- result += QLatin1String(" CXO_CSRMESSAGES");
+ WORD devices = 0;
+ m_winTab32DLL.wTInfo(WTI_INTERFACE, IFC_NDEVICES, &devices);
+ WORD cursors = 0;
+ m_winTab32DLL.wTInfo(WTI_INTERFACE, IFC_NCURSORS, &cursors);
+ WORD extensions = 0;
+ m_winTab32DLL.wTInfo(WTI_INTERFACE, IFC_NEXTENSIONS, &extensions);
+ QString result;
+ QTextStream str(&result);
+ str << '"' << QString::fromWCharArray(winTabId.data())
+ << "\" specification: v" << (specificationVersion >> 8)
+ << '.' << (specificationVersion & 0xFF) << " implementation: v"
+ << (implementationVersion >> 8) << '.' << (implementationVersion & 0xFF)
+ << ' ' << devices << " device(s), " << cursors << " cursor(s), "
+ << extensions << " extensions" << ", options: 0x" << hex << opts << dec;
+ formatOptions(str, opts);
if (m_tiltSupport)
- result += QLatin1String(" tilt");
+ str << " tilt";
return result;
}
@@ -306,20 +369,6 @@ static inline QTabletEvent::PointerType pointerType(unsigned currentCursor)
return QTabletEvent::UnknownPointer;
}
-#ifndef QT_NO_DEBUG_STREAM
-QDebug operator<<(QDebug d, const QWindowsTabletDeviceData &t)
-{
- QDebugStateSaver saver(d);
- d.nospace();
- d << "TabletDevice id:" << t.uniqueId << " pressure: " << t.minPressure
- << ".." << t.maxPressure << " tan pressure: " << t.minTanPressure << ".."
- << t.maxTanPressure << " area:" << t.minX << t.minY <<t.minZ
- << ".." << t.maxX << t.maxY << t.maxZ << " device " << t.currentDevice
- << " pointer " << t.currentPointerType;
- return d;
-}
-#endif // !QT_NO_DEBUG_STREAM
-
QWindowsTabletDeviceData QWindowsTabletSupport::tabletInit(qint64 uniqueId, UINT cursorType) const
{
QWindowsTabletDeviceData result;