summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowstabletsupport.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2014-01-10 17:17:12 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-22 12:12:17 +0100
commitdb51ffc0d1fbce85fd542403812fab8783c53e3c (patch)
tree2e7a051dbf6701b477e4c19de014a44dbaf84c37 /src/plugins/platforms/windows/qwindowstabletsupport.cpp
parenta5c288ea5675a382edf0b3ecae42f461a22a7303 (diff)
Port Windows QPA plugin to new logger API.
Introduce logging categories and change most debug statements to qCDebug(). Retrieve the filter rules from the environment variable QT_QPA_VERBOSE (should be removed once the logging framework offers a more convenient way of configuring). Replace the old per-category variables controlling verboseness of the output by a single variable which can be set on the command line. Change-Id: Iae55ecdb0e150efd165b7d3e90b371f72853f194 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowstabletsupport.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowstabletsupport.cpp30
1 files changed, 12 insertions, 18 deletions
diff --git a/src/plugins/platforms/windows/qwindowstabletsupport.cpp b/src/plugins/platforms/windows/qwindowstabletsupport.cpp
index 1a5c1a2e0c..8b863ec43d 100644
--- a/src/plugins/platforms/windows/qwindowstabletsupport.cpp
+++ b/src/plugins/platforms/windows/qwindowstabletsupport.cpp
@@ -182,8 +182,7 @@ QWindowsTabletSupport *QWindowsTabletSupport::create()
L"TabletDummyWindow",
qWindowsTabletSupportWndProc);
if (!window) {
- if (QWindowsContext::verboseTablet)
- qWarning() << __FUNCTION__ << "Unable to create window for tablet.";
+ qCWarning(lcQpaTablet) << __FUNCTION__ << "Unable to create window for tablet.";
return 0;
}
LOGCONTEXT lcMine;
@@ -199,8 +198,7 @@ QWindowsTabletSupport *QWindowsTabletSupport::create()
lcMine.lcOutExtY = -lcMine.lcInExtY;
const HCTX context = QWindowsTabletSupport::m_winTab32DLL.wTOpen(window, &lcMine, true);
if (!context) {
- if (QWindowsContext::verboseTablet)
- qWarning() << __FUNCTION__ << "Unable to open tablet.";
+ qCDebug(lcQpaTablet) << __FUNCTION__ << "Unable to open tablet.";
DestroyWindow(window);
return 0;
@@ -217,9 +215,9 @@ QWindowsTabletSupport *QWindowsTabletSupport::create()
} // cannot restore old size
} // cannot set
} // mismatch
- if (QWindowsContext::verboseTablet)
- qDebug("Opened tablet context %p on window %p, changed packet queue size %d -> %d",
- context, window, currentQueueSize, TabletPacketQSize);
+ qCDebug(lcQpaTablet) << "Opened tablet context " << context << " on window "
+ << window << "changed packet queue size " << currentQueueSize
+ << "->" << TabletPacketQSize;
return new QWindowsTabletSupport(window, context);
}
@@ -261,8 +259,7 @@ void QWindowsTabletSupport::notifyActivate()
// Cooperate with other tablet applications, but when we get focus, I want to use the tablet.
const bool result = QWindowsTabletSupport::m_winTab32DLL.wTEnable(m_context, true)
&& QWindowsTabletSupport::m_winTab32DLL.wTOverlap(m_context, true);
- if (QWindowsContext::verboseTablet)
- qDebug() << __FUNCTION__ << result;
+ qCDebug(lcQpaTablet) << __FUNCTION__ << result;
}
static inline int indexOfDevice(const QVector<QWindowsTabletDeviceData> &devices, qint64 uniqueId)
@@ -369,10 +366,8 @@ bool QWindowsTabletSupport::translateTabletProximityEvent(WPARAM /* wParam */, L
m_devices.push_back(tabletInit(uniqueId, cursorType));
}
m_devices[m_currentDevice].currentPointerType = pointerType(currentCursor);
- if (QWindowsContext::verboseTablet)
- qDebug() << __FUNCTION__ << (enteredProximity ? "enter" : "leave")
- << " proximity for device #"
- << m_currentDevice << m_devices.at(m_currentDevice);
+ qCDebug(lcQpaTablet) << __FUNCTION__ << (enteredProximity ? "enter" : "leave")
+ << " proximity for device #" << m_currentDevice << m_devices.at(m_currentDevice);
if (enteredProximity) {
QWindowSystemInterface::handleTabletEnterProximityEvent(m_devices.at(m_currentDevice).currentDevice,
m_devices.at(m_currentDevice).currentPointerType,
@@ -410,9 +405,8 @@ bool QWindowsTabletSupport::translateTabletPacketEvent()
enum { absoluteRange = 20 };
const QRect virtualDesktopArea = QGuiApplication::primaryScreen()->virtualGeometry();
- if (QWindowsContext::verboseTablet)
- qDebug() << __FUNCTION__ << "processing " << packetCount
- << "target:" << QGuiApplicationPrivate::tabletPressTarget;
+ qCDebug(lcQpaTablet) << __FUNCTION__ << "processing " << packetCount
+ << "target:" << QGuiApplicationPrivate::tabletPressTarget;
const Qt::KeyboardModifiers keyboardModifiers = QWindowsKeyMapper::queryKeyboardModifiers();
@@ -474,8 +468,8 @@ bool QWindowsTabletSupport::translateTabletPacketEvent()
rotation = packet.pkOrientation.orTwist;
}
- if (QWindowsContext::verboseTablet > 1) {
- qDebug()
+ if (QWindowsContext::verbose > 1) {
+ qCDebug(lcQpaTablet)
<< "Packet #" << i << '/' << packetCount << "button:" << packet.pkButtons
<< globalPosF << z << "to:" << target << localPos << "(packet" << packet.pkX
<< packet.pkY << ") dev:" << currentDevice << "pointer:"