Changeset View
Changeset View
Standalone View
Standalone View
libs/ui/input/wintab/kis_tablet_support_win8.cpp
Context not available. | |||||
60 | FUNC(GetPointerPenInfoHistory) \ | 60 | FUNC(GetPointerPenInfoHistory) \ | ||
---|---|---|---|---|---|
61 | FUNC(GetPointerType) \ | 61 | FUNC(GetPointerType) \ | ||
62 | /* Pointer Device Functions */ \ | 62 | /* Pointer Device Functions */ \ | ||
63 | /*FUNC(GetPointerDevices)*/ \ | 63 | FUNC(GetPointerDevices) \ | ||
64 | /*FUNC(GetPointerDeviceProperties)*/ \ | 64 | /*FUNC(GetPointerDeviceProperties)*/ \ | ||
65 | FUNC(GetPointerDevice) \ | 65 | FUNC(GetPointerDevice) \ | ||
66 | FUNC(GetPointerDeviceRects) \ | 66 | FUNC(GetPointerDeviceRects) \ | ||
Context not available. | |||||
340 | return api.init(); | 340 | return api.init(); | ||
341 | } | 341 | } | ||
342 | 342 | | |||
343 | bool KisTabletSupportWin8::isPenDeviceAvailable() | ||||
344 | { | ||||
345 | if (!api.init()) { | ||||
346 | return false; | ||||
347 | } | ||||
348 | UINT32 deviceCount = 0; | ||||
349 | if (!api.GetPointerDevices(&deviceCount, nullptr)) { | ||||
350 | dbgTablet << "GetPointerDevices failed"; | ||||
351 | return false; | ||||
352 | } | ||||
353 | if (deviceCount == 0) { | ||||
354 | dbgTablet << "No pointer devices"; | ||||
355 | return false; | ||||
356 | } | ||||
357 | QVector<POINTER_DEVICE_INFO> devices(deviceCount); | ||||
358 | if (!api.GetPointerDevices(&deviceCount, devices.data())) { | ||||
359 | dbgTablet << "GetPointerDevices failed"; | ||||
360 | return false; | ||||
361 | } | ||||
362 | bool hasPenDevice = false; | ||||
363 | Q_FOREACH (const POINTER_DEVICE_INFO &device, devices) { | ||||
364 | dbgTablet << "Found pointer device" << static_cast<void *>(device.device) | ||||
365 | << QString::fromWCharArray(device.productString) | ||||
366 | << "type:" << device.pointerDeviceType; | ||||
367 | if (device.pointerDeviceType == POINTER_DEVICE_TYPE_INTEGRATED_PEN || | ||||
368 | device.pointerDeviceType == POINTER_DEVICE_TYPE_EXTERNAL_PEN) { | ||||
369 | hasPenDevice = true; | ||||
370 | } | ||||
371 | } | ||||
372 | dbgTablet << "hasPenDevice:" << hasPenDevice; | ||||
373 | return hasPenDevice; | ||||
374 | } | ||||
375 | | ||||
343 | bool KisTabletSupportWin8::init() | 376 | bool KisTabletSupportWin8::init() | ||
344 | { | 377 | { | ||
345 | return api.init(); | 378 | return api.init(); | ||
Context not available. |