| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/gui/kernel/qtouchdevice.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | QTouchDevice::QTouchDevice() | - | ||||||||||||
| 5 | : d(new QTouchDevicePrivate) | - | ||||||||||||
| 6 | { | - | ||||||||||||
| 7 | } never executed: end of block | 0 | ||||||||||||
| 8 | - | |||||||||||||
| 9 | - | |||||||||||||
| 10 | - | |||||||||||||
| 11 | - | |||||||||||||
| 12 | QTouchDevice::~QTouchDevice() | - | ||||||||||||
| 13 | { | - | ||||||||||||
| 14 | delete d; | - | ||||||||||||
| 15 | } never executed: end of block | 0 | ||||||||||||
| 16 | - | |||||||||||||
| 17 | - | |||||||||||||
| 18 | - | |||||||||||||
| 19 | - | |||||||||||||
| 20 | QTouchDevice::DeviceType QTouchDevice::type() const | - | ||||||||||||
| 21 | { | - | ||||||||||||
| 22 | return never executed: d->type;return d->type;never executed: return d->type; | 0 | ||||||||||||
| 23 | } | - | ||||||||||||
| 24 | - | |||||||||||||
| 25 | - | |||||||||||||
| 26 | - | |||||||||||||
| 27 | - | |||||||||||||
| 28 | QTouchDevice::Capabilities QTouchDevice::capabilities() const | - | ||||||||||||
| 29 | { | - | ||||||||||||
| 30 | return never executed: d->caps;return d->caps;never executed: return d->caps; | 0 | ||||||||||||
| 31 | } | - | ||||||||||||
| 32 | - | |||||||||||||
| 33 | - | |||||||||||||
| 34 | - | |||||||||||||
| 35 | - | |||||||||||||
| 36 | - | |||||||||||||
| 37 | - | |||||||||||||
| 38 | int QTouchDevice::maximumTouchPoints() const | - | ||||||||||||
| 39 | { | - | ||||||||||||
| 40 | return never executed: d->maxTouchPoints;return d->maxTouchPoints;never executed: return d->maxTouchPoints; | 0 | ||||||||||||
| 41 | } | - | ||||||||||||
| 42 | QString QTouchDevice::name() const | - | ||||||||||||
| 43 | { | - | ||||||||||||
| 44 | return never executed: d->name;return d->name;never executed: return d->name; | 0 | ||||||||||||
| 45 | } | - | ||||||||||||
| 46 | - | |||||||||||||
| 47 | - | |||||||||||||
| 48 | - | |||||||||||||
| 49 | - | |||||||||||||
| 50 | void QTouchDevice::setType(DeviceType devType) | - | ||||||||||||
| 51 | { | - | ||||||||||||
| 52 | d->type = devType; | - | ||||||||||||
| 53 | } never executed: end of block | 0 | ||||||||||||
| 54 | - | |||||||||||||
| 55 | - | |||||||||||||
| 56 | - | |||||||||||||
| 57 | - | |||||||||||||
| 58 | void QTouchDevice::setCapabilities(Capabilities caps) | - | ||||||||||||
| 59 | { | - | ||||||||||||
| 60 | d->caps = caps; | - | ||||||||||||
| 61 | } never executed: end of block | 0 | ||||||||||||
| 62 | - | |||||||||||||
| 63 | - | |||||||||||||
| 64 | - | |||||||||||||
| 65 | - | |||||||||||||
| 66 | - | |||||||||||||
| 67 | void QTouchDevice::setMaximumTouchPoints(int max) | - | ||||||||||||
| 68 | { | - | ||||||||||||
| 69 | d->maxTouchPoints = max; | - | ||||||||||||
| 70 | } never executed: end of block | 0 | ||||||||||||
| 71 | - | |||||||||||||
| 72 | - | |||||||||||||
| 73 | - | |||||||||||||
| 74 | - | |||||||||||||
| 75 | - | |||||||||||||
| 76 | - | |||||||||||||
| 77 | - | |||||||||||||
| 78 | void QTouchDevice::setName(const QString &name) | - | ||||||||||||
| 79 | { | - | ||||||||||||
| 80 | d->name = name; | - | ||||||||||||
| 81 | } never executed: end of block | 0 | ||||||||||||
| 82 | - | |||||||||||||
| 83 | typedef QList<const QTouchDevice *> TouchDevices; | - | ||||||||||||
| 84 | namespace { namespace Q_QGS_deviceList { typedef TouchDevices Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
never executed: }guard.store(QtGlobalStatic::Destroyed);never executed: }; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; returnend of blocknever executed: &holder.value;return &holder.value;never executed: } } } static QGlobalStatic<TouchDevices, Q_QGS_deviceList::innerFunction, Q_QGS_deviceList::guard> deviceList;return &holder.value; | 0 | ||||||||||||
| 85 | static QBasicMutex devicesMutex; | - | ||||||||||||
| 86 | - | |||||||||||||
| 87 | static void cleanupDevicesList() | - | ||||||||||||
| 88 | { | - | ||||||||||||
| 89 | QMutexLocker lock(&devicesMutex); | - | ||||||||||||
| 90 | qDeleteAll(*deviceList()); | - | ||||||||||||
| 91 | deviceList()->clear(); | - | ||||||||||||
| 92 | } never executed: end of block | 0 | ||||||||||||
| 93 | - | |||||||||||||
| 94 | - | |||||||||||||
| 95 | - | |||||||||||||
| 96 | - | |||||||||||||
| 97 | - | |||||||||||||
| 98 | - | |||||||||||||
| 99 | QList<const QTouchDevice *> QTouchDevice::devices() | - | ||||||||||||
| 100 | { | - | ||||||||||||
| 101 | QMutexLocker lock(&devicesMutex); | - | ||||||||||||
| 102 | return never executed: *deviceList();return *deviceList();never executed: return *deviceList(); | 0 | ||||||||||||
| 103 | } | - | ||||||||||||
| 104 | - | |||||||||||||
| 105 | - | |||||||||||||
| 106 | - | |||||||||||||
| 107 | - | |||||||||||||
| 108 | bool QTouchDevicePrivate::isRegistered(const QTouchDevice *dev) | - | ||||||||||||
| 109 | { | - | ||||||||||||
| 110 | QMutexLocker locker(&devicesMutex); | - | ||||||||||||
| 111 | return never executed: deviceList()->contains(dev);return deviceList()->contains(dev);never executed: return deviceList()->contains(dev); | 0 | ||||||||||||
| 112 | } | - | ||||||||||||
| 113 | - | |||||||||||||
| 114 | - | |||||||||||||
| 115 | - | |||||||||||||
| 116 | - | |||||||||||||
| 117 | void QTouchDevicePrivate::registerDevice(const QTouchDevice *dev) | - | ||||||||||||
| 118 | { | - | ||||||||||||
| 119 | QMutexLocker lock(&devicesMutex); | - | ||||||||||||
| 120 | if (deviceList()->isEmpty()
| 0 | ||||||||||||
| 121 | qAddPostRoutine(cleanupDevicesList); never executed: qAddPostRoutine(cleanupDevicesList); | 0 | ||||||||||||
| 122 | deviceList()->append(dev); | - | ||||||||||||
| 123 | } never executed: end of block | 0 | ||||||||||||
| 124 | - | |||||||||||||
| 125 | - | |||||||||||||
| 126 | - | |||||||||||||
| 127 | - | |||||||||||||
| 128 | void QTouchDevicePrivate::unregisterDevice(const QTouchDevice *dev) | - | ||||||||||||
| 129 | { | - | ||||||||||||
| 130 | QMutexLocker lock(&devicesMutex); | - | ||||||||||||
| 131 | bool wasRemoved = deviceList()->removeOne(dev); | - | ||||||||||||
| 132 | if (wasRemoved
| 0 | ||||||||||||
| 133 | qRemovePostRoutine(cleanupDevicesList); never executed: qRemovePostRoutine(cleanupDevicesList); | 0 | ||||||||||||
| 134 | } never executed: end of block | 0 | ||||||||||||
| 135 | - | |||||||||||||
| 136 | - | |||||||||||||
| 137 | QDebug operator<<(QDebug debug, const QTouchDevice *device) | - | ||||||||||||
| 138 | { | - | ||||||||||||
| 139 | QDebugStateSaver saver(debug); | - | ||||||||||||
| 140 | debug.nospace(); | - | ||||||||||||
| 141 | debug.noquote(); | - | ||||||||||||
| 142 | debug << "QTouchDevice("; | - | ||||||||||||
| 143 | if (device
| 0 | ||||||||||||
| 144 | debug << '"' << device->name() << "\", type="; | - | ||||||||||||
| 145 | QtDebugUtils::formatQEnum(debug, device->type()); | - | ||||||||||||
| 146 | debug << ", capabilities="; | - | ||||||||||||
| 147 | QtDebugUtils::formatQFlags(debug, device->capabilities()); | - | ||||||||||||
| 148 | debug << ", maximumTouchPoints=" << device->maximumTouchPoints(); | - | ||||||||||||
| 149 | } never executed: else {end of block | 0 | ||||||||||||
| 150 | debug << '0'; | - | ||||||||||||
| 151 | } never executed: end of block | 0 | ||||||||||||
| 152 | debug << ')'; | - | ||||||||||||
| 153 | return never executed: debug;return debug;never executed: return debug; | 0 | ||||||||||||
| 154 | } | - | ||||||||||||
| 155 | - | |||||||||||||
| 156 | - | |||||||||||||
| 157 | - | |||||||||||||
| Switch to Source code | Preprocessed file |