1 // Copyright 2012 The ChromiumOS Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "include/activity_log.h"
6
7 #include <errno.h>
8 #include <fcntl.h>
9 #include <set>
10 #include <string>
11 #include <sys/stat.h>
12 #include <sys/types.h>
13
14 #include <json/value.h>
15 #include <json/writer.h>
16
17 #include "include/file_util.h"
18 #include "include/logging.h"
19 #include "include/prop_registry.h"
20 #include "include/string_util.h"
21
22 // This should be set by build system:
23 #ifndef VCSID
24 #define VCSID "Unknown"
25 #endif // VCSID
26
27 #define QUINTTAP_COUNT 5 /* BTN_TOOL_QUINTTAP - Five fingers on trackpad */
28
29 using std::set;
30 using std::string;
31
32 namespace gestures {
33
ActivityLog(PropRegistry * prop_reg)34 ActivityLog::ActivityLog(PropRegistry* prop_reg)
35 : head_idx_(0), size_(0), max_fingers_(0), hwprops_(),
36 prop_reg_(prop_reg) {}
37
SetHardwareProperties(const HardwareProperties & hwprops)38 void ActivityLog::SetHardwareProperties(const HardwareProperties& hwprops) {
39 hwprops_ = hwprops;
40
41 // For old devices(such as mario, alex, zgb..), the reporting touch count
42 // or 'max_touch_cnt' will be less than number of slots or 'max_finger_cnt'
43 // they support. As kernel evdev drivers do not have a bitset to report
44 // touch count greater than five (bitset for five-fingers gesture is
45 // BTN_TOOL_QUINTAP), we respect 'max_finger_cnt' than 'max_touch_cnt'
46 // reported from kernel driver as the 'max_fingers_' instead.
47 if (hwprops.max_touch_cnt < QUINTTAP_COUNT) {
48 max_fingers_ = std::min<size_t>(hwprops.max_finger_cnt,
49 hwprops.max_touch_cnt);
50 } else {
51 max_fingers_ = std::max<size_t>(hwprops.max_finger_cnt,
52 hwprops.max_touch_cnt);
53 }
54
55 finger_states_.reset(new FingerState[kBufferSize * max_fingers_]);
56 }
57
LogHardwareState(const HardwareState & hwstate)58 void ActivityLog::LogHardwareState(const HardwareState& hwstate) {
59 Entry* entry = PushBack();
60 entry->type = kHardwareState;
61 entry->details.hwstate = hwstate;
62 if (hwstate.finger_cnt > max_fingers_) {
63 Err("Too many fingers! Max is %zu, but I got %d",
64 max_fingers_, hwstate.finger_cnt);
65 entry->details.hwstate.fingers = NULL;
66 entry->details.hwstate.finger_cnt = 0;
67 return;
68 }
69 if (!finger_states_.get())
70 return;
71 entry->details.hwstate.fingers = &finger_states_[TailIdx() * max_fingers_];
72 std::copy(&hwstate.fingers[0], &hwstate.fingers[hwstate.finger_cnt],
73 entry->details.hwstate.fingers);
74 }
75
LogTimerCallback(stime_t now)76 void ActivityLog::LogTimerCallback(stime_t now) {
77 Entry* entry = PushBack();
78 entry->type = kTimerCallback;
79 entry->details.timestamp = now;
80 }
81
LogCallbackRequest(stime_t when)82 void ActivityLog::LogCallbackRequest(stime_t when) {
83 Entry* entry = PushBack();
84 entry->type = kCallbackRequest;
85 entry->details.timestamp = when;
86 }
87
LogGesture(const Gesture & gesture)88 void ActivityLog::LogGesture(const Gesture& gesture) {
89 Entry* entry = PushBack();
90 entry->type = kGesture;
91 entry->details.gesture = gesture;
92 }
93
LogPropChange(const PropChangeEntry & prop_change)94 void ActivityLog::LogPropChange(const PropChangeEntry& prop_change) {
95 Entry* entry = PushBack();
96 entry->type = kPropChange;
97 entry->details.prop_change = prop_change;
98 }
99
Dump(const char * filename)100 void ActivityLog::Dump(const char* filename) {
101 string data = Encode();
102 WriteFile(filename, data.c_str(), data.size());
103 }
104
PushBack()105 ActivityLog::Entry* ActivityLog::PushBack() {
106 if (size_ == kBufferSize) {
107 Entry* ret = &buffer_[head_idx_];
108 head_idx_ = (head_idx_ + 1) % kBufferSize;
109 return ret;
110 }
111 ++size_;
112 return &buffer_[TailIdx()];
113 }
114
EncodeHardwareProperties() const115 Json::Value ActivityLog::EncodeHardwareProperties() const {
116 Json::Value ret(Json::objectValue);
117 ret[kKeyHardwarePropLeft] = Json::Value(hwprops_.left);
118 ret[kKeyHardwarePropTop] = Json::Value(hwprops_.top);
119 ret[kKeyHardwarePropRight] = Json::Value(hwprops_.right);
120 ret[kKeyHardwarePropBottom] = Json::Value(hwprops_.bottom);
121 ret[kKeyHardwarePropXResolution] = Json::Value(hwprops_.res_x);
122 ret[kKeyHardwarePropYResolution] = Json::Value(hwprops_.res_y);
123 ret[kKeyHardwarePropXDpi] = Json::Value(hwprops_.screen_x_dpi);
124 ret[kKeyHardwarePropYDpi] = Json::Value(hwprops_.screen_y_dpi);
125 ret[kKeyHardwarePropOrientationMinimum] =
126 Json::Value(hwprops_.orientation_minimum);
127 ret[kKeyHardwarePropOrientationMaximum] =
128 Json::Value(hwprops_.orientation_maximum);
129 ret[kKeyHardwarePropMaxFingerCount] =
130 Json::Value(hwprops_.max_finger_cnt);
131 ret[kKeyHardwarePropMaxTouchCount] =
132 Json::Value(hwprops_.max_touch_cnt);
133
134 ret[kKeyHardwarePropSupportsT5R2] =
135 Json::Value(hwprops_.supports_t5r2 != 0);
136 ret[kKeyHardwarePropSemiMt] =
137 Json::Value(hwprops_.support_semi_mt != 0);
138 ret[kKeyHardwarePropIsButtonPad] =
139 Json::Value(hwprops_.is_button_pad != 0);
140 ret[kKeyHardwarePropHasWheel] =
141 Json::Value(hwprops_.has_wheel != 0);
142 return ret;
143 }
144
EncodeHardwareState(const HardwareState & hwstate)145 Json::Value ActivityLog::EncodeHardwareState(const HardwareState& hwstate) {
146 Json::Value ret(Json::objectValue);
147 ret[kKeyType] = Json::Value(kKeyHardwareState);
148 ret[kKeyHardwareStateButtonsDown] =
149 Json::Value(hwstate.buttons_down);
150 ret[kKeyHardwareStateTouchCnt] =
151 Json::Value(hwstate.touch_cnt);
152 ret[kKeyHardwareStateTimestamp] =
153 Json::Value(hwstate.timestamp);
154 Json::Value fingers(Json::arrayValue);
155 for (size_t i = 0; i < hwstate.finger_cnt; ++i) {
156 if (hwstate.fingers == NULL) {
157 Err("Have finger_cnt %d but fingers is NULL!", hwstate.finger_cnt);
158 break;
159 }
160 const FingerState& fs = hwstate.fingers[i];
161 Json::Value finger(Json::objectValue);
162 finger[kKeyFingerStateTouchMajor] =
163 Json::Value(fs.touch_major);
164 finger[kKeyFingerStateTouchMinor] =
165 Json::Value(fs.touch_minor);
166 finger[kKeyFingerStateWidthMajor] =
167 Json::Value(fs.width_major);
168 finger[kKeyFingerStateWidthMinor] =
169 Json::Value(fs.width_minor);
170 finger[kKeyFingerStatePressure] =
171 Json::Value(fs.pressure);
172 finger[kKeyFingerStateOrientation] =
173 Json::Value(fs.orientation);
174 finger[kKeyFingerStatePositionX] =
175 Json::Value(fs.position_x);
176 finger[kKeyFingerStatePositionY] =
177 Json::Value(fs.position_y);
178 finger[kKeyFingerStateTrackingId] =
179 Json::Value(fs.tracking_id);
180 finger[kKeyFingerStateFlags] =
181 Json::Value(static_cast<int>(fs.flags));
182 fingers.append(finger);
183 }
184 ret[kKeyHardwareStateFingers] = fingers;
185 ret[kKeyHardwareStateRelX] =
186 Json::Value(hwstate.rel_x);
187 ret[kKeyHardwareStateRelY] =
188 Json::Value(hwstate.rel_y);
189 ret[kKeyHardwareStateRelWheel] =
190 Json::Value(hwstate.rel_wheel);
191 ret[kKeyHardwareStateRelHWheel] =
192 Json::Value(hwstate.rel_hwheel);
193 return ret;
194 }
195
EncodeTimerCallback(stime_t timestamp)196 Json::Value ActivityLog::EncodeTimerCallback(stime_t timestamp) {
197 Json::Value ret(Json::objectValue);
198 ret[kKeyType] = Json::Value(kKeyTimerCallback);
199 ret[kKeyTimerCallbackNow] = Json::Value(timestamp);
200 return ret;
201 }
202
EncodeCallbackRequest(stime_t timestamp)203 Json::Value ActivityLog::EncodeCallbackRequest(stime_t timestamp) {
204 Json::Value ret(Json::objectValue);
205 ret[kKeyType] = Json::Value(kKeyCallbackRequest);
206 ret[kKeyCallbackRequestWhen] = Json::Value(timestamp);
207 return ret;
208 }
209
EncodeGesture(const Gesture & gesture)210 Json::Value ActivityLog::EncodeGesture(const Gesture& gesture) {
211 Json::Value ret(Json::objectValue);
212 ret[kKeyType] = Json::Value(kKeyGesture);
213 ret[kKeyGestureStartTime] = Json::Value(gesture.start_time);
214 ret[kKeyGestureEndTime] = Json::Value(gesture.end_time);
215
216 bool handled = false;
217 switch (gesture.type) {
218 case kGestureTypeNull:
219 handled = true;
220 ret[kKeyGestureType] = Json::Value("null");
221 break;
222 case kGestureTypeContactInitiated:
223 handled = true;
224 ret[kKeyGestureType] =
225 Json::Value(kValueGestureTypeContactInitiated);
226 break;
227 case kGestureTypeMove:
228 handled = true;
229 ret[kKeyGestureType] =
230 Json::Value(kValueGestureTypeMove);
231 ret[kKeyGestureMoveDX] =
232 Json::Value(gesture.details.move.dx);
233 ret[kKeyGestureMoveDY] =
234 Json::Value(gesture.details.move.dy);
235 ret[kKeyGestureMoveOrdinalDX] =
236 Json::Value(gesture.details.move.ordinal_dx);
237 ret[kKeyGestureMoveOrdinalDY] =
238 Json::Value(gesture.details.move.ordinal_dy);
239 break;
240 case kGestureTypeScroll:
241 handled = true;
242 ret[kKeyGestureType] =
243 Json::Value(kValueGestureTypeScroll);
244 ret[kKeyGestureScrollDX] =
245 Json::Value(gesture.details.scroll.dx);
246 ret[kKeyGestureScrollDY] =
247 Json::Value(gesture.details.scroll.dy);
248 ret[kKeyGestureScrollOrdinalDX] =
249 Json::Value(gesture.details.scroll.ordinal_dx);
250 ret[kKeyGestureScrollOrdinalDY] =
251 Json::Value(gesture.details.scroll.ordinal_dy);
252 break;
253 case kGestureTypeMouseWheel:
254 handled = true;
255 ret[kKeyGestureType] =
256 Json::Value(kValueGestureTypeMouseWheel);
257 ret[kKeyGestureMouseWheelDX] =
258 Json::Value(gesture.details.wheel.dx);
259 ret[kKeyGestureMouseWheelDY] =
260 Json::Value(gesture.details.wheel.dy);
261 ret[kKeyGestureMouseWheelTicksDX] =
262 Json::Value(gesture.details.wheel.tick_120ths_dx);
263 ret[kKeyGestureMouseWheelTicksDY] =
264 Json::Value(gesture.details.wheel.tick_120ths_dy);
265 break;
266 case kGestureTypePinch:
267 handled = true;
268 ret[kKeyGestureType] =
269 Json::Value(kValueGestureTypePinch);
270 ret[kKeyGesturePinchDZ] =
271 Json::Value(gesture.details.pinch.dz);
272 ret[kKeyGesturePinchOrdinalDZ] =
273 Json::Value(gesture.details.pinch.ordinal_dz);
274 ret[kKeyGesturePinchZoomState] =
275 Json::Value(gesture.details.pinch.zoom_state);
276 break;
277 case kGestureTypeButtonsChange:
278 handled = true;
279 ret[kKeyGestureType] =
280 Json::Value(kValueGestureTypeButtonsChange);
281 ret[kKeyGestureButtonsChangeDown] =
282 Json::Value(
283 static_cast<int>(gesture.details.buttons.down));
284 ret[kKeyGestureButtonsChangeUp] =
285 Json::Value(
286 static_cast<int>(gesture.details.buttons.up));
287 break;
288 case kGestureTypeFling:
289 handled = true;
290 ret[kKeyGestureType] =
291 Json::Value(kValueGestureTypeFling);
292 ret[kKeyGestureFlingVX] =
293 Json::Value(gesture.details.fling.vx);
294 ret[kKeyGestureFlingVY] =
295 Json::Value(gesture.details.fling.vy);
296 ret[kKeyGestureFlingOrdinalVX] =
297 Json::Value(gesture.details.fling.ordinal_vx);
298 ret[kKeyGestureFlingOrdinalVY] =
299 Json::Value(gesture.details.fling.ordinal_vy);
300 ret[kKeyGestureFlingState] =
301 Json::Value(
302 static_cast<int>(gesture.details.fling.fling_state));
303 break;
304 case kGestureTypeSwipe:
305 handled = true;
306 ret[kKeyGestureType] =
307 Json::Value(kValueGestureTypeSwipe);
308 ret[kKeyGestureSwipeDX] =
309 Json::Value(gesture.details.swipe.dx);
310 ret[kKeyGestureSwipeDY] =
311 Json::Value(gesture.details.swipe.dy);
312 ret[kKeyGestureSwipeOrdinalDX] =
313 Json::Value(gesture.details.swipe.ordinal_dx);
314 ret[kKeyGestureSwipeOrdinalDY] =
315 Json::Value(gesture.details.swipe.ordinal_dy);
316 break;
317 case kGestureTypeSwipeLift:
318 handled = true;
319 ret[kKeyGestureType] =
320 Json::Value(kValueGestureTypeSwipeLift);
321 break;
322 case kGestureTypeFourFingerSwipe:
323 handled = true;
324 ret[kKeyGestureType] =
325 Json::Value(kValueGestureTypeFourFingerSwipe);
326 ret[kKeyGestureFourFingerSwipeDX] =
327 Json::Value(gesture.details.four_finger_swipe.dx);
328 ret[kKeyGestureFourFingerSwipeDY] =
329 Json::Value(gesture.details.four_finger_swipe.dy);
330 ret[kKeyGestureFourFingerSwipeOrdinalDX] =
331 Json::Value(gesture.details.four_finger_swipe.ordinal_dx);
332 ret[kKeyGestureFourFingerSwipeOrdinalDY] =
333 Json::Value(gesture.details.four_finger_swipe.ordinal_dy);
334 break;
335 case kGestureTypeFourFingerSwipeLift:
336 handled = true;
337 ret[kKeyGestureType] =
338 Json::Value(kValueGestureTypeFourFingerSwipeLift);
339 break;
340 case kGestureTypeMetrics:
341 handled = true;
342 ret[kKeyGestureType] =
343 Json::Value(kValueGestureTypeMetrics);
344 ret[kKeyGestureMetricsType] =
345 Json::Value(
346 static_cast<int>(gesture.details.metrics.type));
347 ret[kKeyGestureMetricsData1] =
348 Json::Value(gesture.details.metrics.data[0]);
349 ret[kKeyGestureMetricsData2] =
350 Json::Value(gesture.details.metrics.data[1]);
351 break;
352 }
353 if (!handled)
354 ret[kKeyGestureType] =
355 Json::Value(StringPrintf("Unhandled %d", gesture.type));
356 return ret;
357 }
358
EncodePropChange(const PropChangeEntry & prop_change)359 Json::Value ActivityLog::EncodePropChange(const PropChangeEntry& prop_change) {
360 Json::Value ret(Json::objectValue);
361 ret[kKeyType] = Json::Value(kKeyPropChange);
362 ret[kKeyPropChangeName] = Json::Value(prop_change.name);
363 Json::Value val;
364 Json::Value type;
365 switch (prop_change.type) {
366 case PropChangeEntry::kBoolProp:
367 val = Json::Value(static_cast<bool>(prop_change.value.bool_val));
368 type = Json::Value(kValuePropChangeTypeBool);
369 break;
370 case PropChangeEntry::kDoubleProp:
371 val = Json::Value(prop_change.value.double_val);
372 type = Json::Value(kValuePropChangeTypeDouble);
373 break;
374 case PropChangeEntry::kIntProp:
375 val = Json::Value(prop_change.value.int_val);
376 type = Json::Value(kValuePropChangeTypeInt);
377 break;
378 case PropChangeEntry::kShortProp:
379 val = Json::Value(prop_change.value.short_val);
380 type = Json::Value(kValuePropChangeTypeShort);
381 break;
382 }
383 if (!val.isNull())
384 ret[kKeyPropChangeValue] = val;
385 if (!type.isNull())
386 ret[kKeyPropChangeType] = type;
387 return ret;
388 }
389
EncodePropRegistry()390 Json::Value ActivityLog::EncodePropRegistry() {
391 Json::Value ret(Json::objectValue);
392 if (!prop_reg_)
393 return ret;
394
395 const set<Property*>& props = prop_reg_->props();
396 for (set<Property*>::const_iterator it = props.begin(), e = props.end();
397 it != e; ++it) {
398 ret[(*it)->name()] = (*it)->NewValue();
399 }
400 return ret;
401 }
402
EncodeCommonInfo()403 Json::Value ActivityLog::EncodeCommonInfo() {
404 Json::Value root(Json::objectValue);
405
406 Json::Value entries(Json::arrayValue);
407 for (size_t i = 0; i < size_; ++i) {
408 const Entry& entry = buffer_[(i + head_idx_) % kBufferSize];
409 switch (entry.type) {
410 case kHardwareState:
411 entries.append(EncodeHardwareState(entry.details.hwstate));
412 continue;
413 case kTimerCallback:
414 entries.append(EncodeTimerCallback(entry.details.timestamp));
415 continue;
416 case kCallbackRequest:
417 entries.append(EncodeCallbackRequest(entry.details.timestamp));
418 continue;
419 case kGesture:
420 entries.append(EncodeGesture(entry.details.gesture));
421 continue;
422 case kPropChange:
423 entries.append(EncodePropChange(entry.details.prop_change));
424 continue;
425 }
426 Err("Unknown entry type %d", entry.type);
427 }
428 root[kKeyRoot] = entries;
429 root[kKeyHardwarePropRoot] = EncodeHardwareProperties();
430
431 return root;
432 }
433
AddEncodeInfo(Json::Value * root)434 void ActivityLog::AddEncodeInfo(Json::Value* root) {
435 (*root)["version"] = Json::Value(1);
436 string gestures_version = VCSID;
437
438 // Strip tailing whitespace.
439 TrimWhitespaceASCII(gestures_version, TRIM_ALL, &gestures_version);
440 (*root)["gesturesVersion"] = Json::Value(gestures_version);
441 (*root)[kKeyProperties] = EncodePropRegistry();
442 }
443
Encode()444 string ActivityLog::Encode() {
445 Json::Value root = EncodeCommonInfo();
446 AddEncodeInfo(&root);
447 return root.toStyledString();
448 }
449
450 const char ActivityLog::kKeyInterpreterName[] = "interpreterName";
451 const char ActivityLog::kKeyNext[] = "nextLayer";
452 const char ActivityLog::kKeyRoot[] = "entries";
453 const char ActivityLog::kKeyType[] = "type";
454 const char ActivityLog::kKeyHardwareState[] = "hardwareState";
455 const char ActivityLog::kKeyTimerCallback[] = "timerCallback";
456 const char ActivityLog::kKeyCallbackRequest[] = "callbackRequest";
457 const char ActivityLog::kKeyGesture[] = "gesture";
458 const char ActivityLog::kKeyPropChange[] = "propertyChange";
459 const char ActivityLog::kKeyHardwareStateTimestamp[] = "timestamp";
460 const char ActivityLog::kKeyHardwareStateButtonsDown[] = "buttonsDown";
461 const char ActivityLog::kKeyHardwareStateTouchCnt[] = "touchCount";
462 const char ActivityLog::kKeyHardwareStateFingers[] = "fingers";
463 const char ActivityLog::kKeyHardwareStateRelX[] = "relX";
464 const char ActivityLog::kKeyHardwareStateRelY[] = "relY";
465 const char ActivityLog::kKeyHardwareStateRelWheel[] = "relWheel";
466 const char ActivityLog::kKeyHardwareStateRelHWheel[] = "relHWheel";
467 const char ActivityLog::kKeyFingerStateTouchMajor[] = "touchMajor";
468 const char ActivityLog::kKeyFingerStateTouchMinor[] = "touchMinor";
469 const char ActivityLog::kKeyFingerStateWidthMajor[] = "widthMajor";
470 const char ActivityLog::kKeyFingerStateWidthMinor[] = "widthMinor";
471 const char ActivityLog::kKeyFingerStatePressure[] = "pressure";
472 const char ActivityLog::kKeyFingerStateOrientation[] = "orientation";
473 const char ActivityLog::kKeyFingerStatePositionX[] = "positionX";
474 const char ActivityLog::kKeyFingerStatePositionY[] = "positionY";
475 const char ActivityLog::kKeyFingerStateTrackingId[] = "trackingId";
476 const char ActivityLog::kKeyFingerStateFlags[] = "flags";
477 const char ActivityLog::kKeyTimerCallbackNow[] = "now";
478 const char ActivityLog::kKeyCallbackRequestWhen[] = "when";
479 const char ActivityLog::kKeyGestureType[] = "gestureType";
480 const char ActivityLog::kValueGestureTypeContactInitiated[] =
481 "contactInitiated";
482 const char ActivityLog::kValueGestureTypeMove[] = "move";
483 const char ActivityLog::kValueGestureTypeScroll[] = "scroll";
484 const char ActivityLog::kValueGestureTypeMouseWheel[] = "mouseWheel";
485 const char ActivityLog::kValueGestureTypePinch[] = "pinch";
486 const char ActivityLog::kValueGestureTypeButtonsChange[] = "buttonsChange";
487 const char ActivityLog::kValueGestureTypeFling[] = "fling";
488 const char ActivityLog::kValueGestureTypeSwipe[] = "swipe";
489 const char ActivityLog::kValueGestureTypeSwipeLift[] = "swipeLift";
490 const char ActivityLog::kValueGestureTypeFourFingerSwipe[] = "fourFingerSwipe";
491 const char ActivityLog::kValueGestureTypeFourFingerSwipeLift[] =
492 "fourFingerSwipeLift";
493 const char ActivityLog::kValueGestureTypeMetrics[] = "metrics";
494 const char ActivityLog::kKeyGestureStartTime[] = "startTime";
495 const char ActivityLog::kKeyGestureEndTime[] = "endTime";
496 const char ActivityLog::kKeyGestureMoveDX[] = "dx";
497 const char ActivityLog::kKeyGestureMoveDY[] = "dy";
498 const char ActivityLog::kKeyGestureMoveOrdinalDX[] = "ordinalDx";
499 const char ActivityLog::kKeyGestureMoveOrdinalDY[] = "ordinalDy";
500 const char ActivityLog::kKeyGestureScrollDX[] = "dx";
501 const char ActivityLog::kKeyGestureScrollDY[] = "dy";
502 const char ActivityLog::kKeyGestureScrollOrdinalDX[] = "ordinalDx";
503 const char ActivityLog::kKeyGestureScrollOrdinalDY[] = "ordinalDy";
504 const char ActivityLog::kKeyGestureMouseWheelDX[] = "dx";
505 const char ActivityLog::kKeyGestureMouseWheelDY[] = "dy";
506 const char ActivityLog::kKeyGestureMouseWheelTicksDX[] = "ticksDx";
507 const char ActivityLog::kKeyGestureMouseWheelTicksDY[] = "ticksDy";
508 const char ActivityLog::kKeyGesturePinchDZ[] = "dz";
509 const char ActivityLog::kKeyGesturePinchOrdinalDZ[] = "ordinalDz";
510 const char ActivityLog::kKeyGesturePinchZoomState[] = "zoomState";
511 const char ActivityLog::kKeyGestureButtonsChangeDown[] = "down";
512 const char ActivityLog::kKeyGestureButtonsChangeUp[] = "up";
513 const char ActivityLog::kKeyGestureFlingVX[] = "vx";
514 const char ActivityLog::kKeyGestureFlingVY[] = "vy";
515 const char ActivityLog::kKeyGestureFlingOrdinalVX[] = "ordinalVx";
516 const char ActivityLog::kKeyGestureFlingOrdinalVY[] = "ordinalVy";
517 const char ActivityLog::kKeyGestureFlingState[] = "flingState";
518 const char ActivityLog::kKeyGestureSwipeDX[] = "dx";
519 const char ActivityLog::kKeyGestureSwipeDY[] = "dy";
520 const char ActivityLog::kKeyGestureSwipeOrdinalDX[] = "ordinalDx";
521 const char ActivityLog::kKeyGestureSwipeOrdinalDY[] = "ordinalDy";
522 const char ActivityLog::kKeyGestureFourFingerSwipeDX[] = "dx";
523 const char ActivityLog::kKeyGestureFourFingerSwipeDY[] = "dy";
524 const char ActivityLog::kKeyGestureFourFingerSwipeOrdinalDX[] = "ordinalDx";
525 const char ActivityLog::kKeyGestureFourFingerSwipeOrdinalDY[] = "ordinalDy";
526 const char ActivityLog::kKeyGestureMetricsType[] = "metricsType";
527 const char ActivityLog::kKeyGestureMetricsData1[] = "data1";
528 const char ActivityLog::kKeyGestureMetricsData2[] = "data2";
529 const char ActivityLog::kKeyPropChangeType[] = "propChangeType";
530 const char ActivityLog::kKeyPropChangeName[] = "name";
531 const char ActivityLog::kKeyPropChangeValue[] = "value";
532 const char ActivityLog::kValuePropChangeTypeBool[] = "bool";
533 const char ActivityLog::kValuePropChangeTypeDouble[] = "double";
534 const char ActivityLog::kValuePropChangeTypeInt[] = "int";
535 const char ActivityLog::kValuePropChangeTypeShort[] = "short";
536 const char ActivityLog::kKeyHardwarePropRoot[] = "hardwareProperties";
537 const char ActivityLog::kKeyHardwarePropLeft[] = "left";
538 const char ActivityLog::kKeyHardwarePropTop[] = "top";
539 const char ActivityLog::kKeyHardwarePropRight[] = "right";
540 const char ActivityLog::kKeyHardwarePropBottom[] = "bottom";
541 const char ActivityLog::kKeyHardwarePropXResolution[] = "xResolution";
542 const char ActivityLog::kKeyHardwarePropYResolution[] = "yResolution";
543 const char ActivityLog::kKeyHardwarePropXDpi[] = "xDpi";
544 const char ActivityLog::kKeyHardwarePropYDpi[] = "yDpi";
545 const char ActivityLog::kKeyHardwarePropOrientationMinimum[] =
546 "orientationMinimum";
547 const char ActivityLog::kKeyHardwarePropOrientationMaximum[] =
548 "orientationMaximum";
549 const char ActivityLog::kKeyHardwarePropMaxFingerCount[] = "maxFingerCount";
550 const char ActivityLog::kKeyHardwarePropMaxTouchCount[] = "maxTouchCount";
551 const char ActivityLog::kKeyHardwarePropSupportsT5R2[] = "supportsT5R2";
552 const char ActivityLog::kKeyHardwarePropSemiMt[] = "semiMt";
553 const char ActivityLog::kKeyHardwarePropIsButtonPad[] = "isButtonPad";
554 const char ActivityLog::kKeyHardwarePropHasWheel[] = "hasWheel";
555
556 const char ActivityLog::kKeyProperties[] = "properties";
557
558
559 } // namespace gestures
560