| 57 | } |
| 58 | |
| 59 | void fillPointerData(ValueMap& map, int pointerCount, Valdi::TouchEvents::PointerLocations& pointerLocations) { |
| 60 | static auto pointerCountKey = STRING_LITERAL("pointerCount"); |
| 61 | static auto pointerLocationsKey = STRING_LITERAL("pointerLocations"); |
| 62 | static auto xKey = STRING_LITERAL("x"); |
| 63 | static auto yKey = STRING_LITERAL("y"); |
| 64 | static auto pointerIdKey = STRING_LITERAL("pointerId"); |
| 65 | |
| 66 | auto array = ValueArray::make(pointerLocations.size()); |
| 67 | for (size_t i = 0; i < pointerLocations.size(); i++) { |
| 68 | const Valdi::TouchEvents::PointerData& pointer = pointerLocations[i]; |
| 69 | auto pointerMap = makeShared<ValueMap>(); |
| 70 | pointerMap->reserve(3); |
| 71 | (*pointerMap)[xKey] = Value(pointer.x); |
| 72 | (*pointerMap)[yKey] = Value(pointer.y); |
| 73 | (*pointerMap)[pointerIdKey] = Value(pointer.pointerId); |
| 74 | array->emplace(i, Value(pointerMap)); |
| 75 | } |
| 76 | |
| 77 | map[pointerCountKey] = Value(pointerCount); |
| 78 | map[pointerLocationsKey] = Value(array); |
| 79 | } |
| 80 | |
| 81 | Value TouchEvents::makeDragEvent(Valdi::TouchEventState state, |
| 82 | double x, |
no test coverage detected