| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 | 173 |
| 174 // WebTouchEvent - raw touch pointers not yet classified into gestures. | 174 // WebTouchEvent - raw touch pointers not yet classified into gestures. |
| 175 kTouchStart, | 175 kTouchStart, |
| 176 kTouchTypeFirst = kTouchStart, | 176 kTouchTypeFirst = kTouchStart, |
| 177 kTouchMove, | 177 kTouchMove, |
| 178 kTouchEnd, | 178 kTouchEnd, |
| 179 kTouchCancel, | 179 kTouchCancel, |
| 180 kTouchScrollStarted, | 180 kTouchScrollStarted, |
| 181 kTouchTypeLast = kTouchScrollStarted, | 181 kTouchTypeLast = kTouchScrollStarted, |
| 182 | 182 |
| 183 // WebPointerEvent: work in progress |
| 184 kPointerDown, |
| 185 kPointerTypeFirst = kPointerDown, |
| 186 kPointerUp, |
| 187 kPointerMove, |
| 188 kPointerCancel, |
| 189 kPointerTypeLast = kPointerCancel, |
| 190 |
| 183 kTypeLast = kTouchTypeLast | 191 kTypeLast = kTouchTypeLast |
| 184 }; | 192 }; |
| 185 | 193 |
| 186 // The modifier constants cannot change their values since pepper | 194 // The modifier constants cannot change their values since pepper |
| 187 // does a 1-1 mapping of its values; see | 195 // does a 1-1 mapping of its values; see |
| 188 // content/renderer/pepper/event_conversion.cc | 196 // content/renderer/pepper/event_conversion.cc |
| 189 // | 197 // |
| 190 // A Java counterpart will be generated for this enum. | 198 // A Java counterpart will be generated for this enum. |
| 191 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.blink_public.web | 199 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.blink_public.web |
| 192 // GENERATED_JAVA_CLASS_NAME_OVERRIDE: WebInputEventModifier | 200 // GENERATED_JAVA_CLASS_NAME_OVERRIDE: WebInputEventModifier |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 // Returns true if the WebInputEvent |type| is a touch event. | 301 // Returns true if the WebInputEvent |type| is a touch event. |
| 294 static bool IsTouchEventType(WebInputEvent::Type type) { | 302 static bool IsTouchEventType(WebInputEvent::Type type) { |
| 295 return kTouchTypeFirst <= type && type <= kTouchTypeLast; | 303 return kTouchTypeFirst <= type && type <= kTouchTypeLast; |
| 296 } | 304 } |
| 297 | 305 |
| 298 // Returns true if the WebInputEvent is a gesture event. | 306 // Returns true if the WebInputEvent is a gesture event. |
| 299 static bool IsGestureEventType(WebInputEvent::Type type) { | 307 static bool IsGestureEventType(WebInputEvent::Type type) { |
| 300 return kGestureTypeFirst <= type && type <= kGestureTypeLast; | 308 return kGestureTypeFirst <= type && type <= kGestureTypeLast; |
| 301 } | 309 } |
| 302 | 310 |
| 311 // Returns true if the WebInputEvent |type| is a pointer event. |
| 312 static bool IsPointerEventType(WebInputEvent::Type type) { |
| 313 return kPointerTypeFirst <= type && type <= kPointerTypeLast; |
| 314 } |
| 315 |
| 303 bool IsSameEventClass(const WebInputEvent& other) const { | 316 bool IsSameEventClass(const WebInputEvent& other) const { |
| 304 if (IsMouseEventType(type_)) | 317 if (IsMouseEventType(type_)) |
| 305 return IsMouseEventType(other.type_); | 318 return IsMouseEventType(other.type_); |
| 306 if (IsGestureEventType(type_)) | 319 if (IsGestureEventType(type_)) |
| 307 return IsGestureEventType(other.type_); | 320 return IsGestureEventType(other.type_); |
| 308 if (IsTouchEventType(type_)) | 321 if (IsTouchEventType(type_)) |
| 309 return IsTouchEventType(other.type_); | 322 return IsTouchEventType(other.type_); |
| 310 if (IsKeyboardEventType(type_)) | 323 if (IsKeyboardEventType(type_)) |
| 311 return IsKeyboardEventType(other.type_); | 324 return IsKeyboardEventType(other.type_); |
| 325 if (IsPointerEventType(type_)) |
| 326 return IsPointerEventType(other.type_); |
| 312 return type_ == other.type_; | 327 return type_ == other.type_; |
| 313 } | 328 } |
| 314 | 329 |
| 315 // Returns true if the WebInputEvent |type| is a pinch gesture event. | 330 // Returns true if the WebInputEvent |type| is a pinch gesture event. |
| 316 static bool IsPinchGestureEventType(WebInputEvent::Type type) { | 331 static bool IsPinchGestureEventType(WebInputEvent::Type type) { |
| 317 return kGesturePinchTypeFirst <= type && type <= kGesturePinchTypeLast; | 332 return kGesturePinchTypeFirst <= type && type <= kGesturePinchTypeLast; |
| 318 } | 333 } |
| 319 | 334 |
| 320 static const char* GetName(WebInputEvent::Type type) { | 335 static const char* GetName(WebInputEvent::Type type) { |
| 321 #define CASE_TYPE(t) \ | 336 #define CASE_TYPE(t) \ |
| (...skipping 27 matching lines...) Expand all Loading... |
| 349 CASE_TYPE(GestureLongPress); | 364 CASE_TYPE(GestureLongPress); |
| 350 CASE_TYPE(GestureLongTap); | 365 CASE_TYPE(GestureLongTap); |
| 351 CASE_TYPE(GesturePinchBegin); | 366 CASE_TYPE(GesturePinchBegin); |
| 352 CASE_TYPE(GesturePinchEnd); | 367 CASE_TYPE(GesturePinchEnd); |
| 353 CASE_TYPE(GesturePinchUpdate); | 368 CASE_TYPE(GesturePinchUpdate); |
| 354 CASE_TYPE(TouchStart); | 369 CASE_TYPE(TouchStart); |
| 355 CASE_TYPE(TouchMove); | 370 CASE_TYPE(TouchMove); |
| 356 CASE_TYPE(TouchEnd); | 371 CASE_TYPE(TouchEnd); |
| 357 CASE_TYPE(TouchCancel); | 372 CASE_TYPE(TouchCancel); |
| 358 CASE_TYPE(TouchScrollStarted); | 373 CASE_TYPE(TouchScrollStarted); |
| 359 default: | 374 CASE_TYPE(PointerDown); |
| 360 NOTREACHED(); | 375 CASE_TYPE(PointerUp); |
| 361 return ""; | 376 CASE_TYPE(PointerMove); |
| 377 CASE_TYPE(PointerCancel); |
| 362 } | 378 } |
| 363 #undef CASE_TYPE | 379 #undef CASE_TYPE |
| 380 NOTREACHED(); |
| 381 return ""; |
| 364 } | 382 } |
| 365 | 383 |
| 366 float FrameScale() const { return frame_scale_; } | 384 float FrameScale() const { return frame_scale_; } |
| 367 void SetFrameScale(float scale) { frame_scale_ = scale; } | 385 void SetFrameScale(float scale) { frame_scale_ = scale; } |
| 368 | 386 |
| 369 WebFloatPoint FrameTranslate() const { return frame_translate_; } | 387 WebFloatPoint FrameTranslate() const { return frame_translate_; } |
| 370 void SetFrameTranslate(WebFloatPoint translate) { | 388 void SetFrameTranslate(WebFloatPoint translate) { |
| 371 frame_translate_ = translate; | 389 frame_translate_ = translate; |
| 372 } | 390 } |
| 373 | 391 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 unsigned size_; // The size of this structure, for serialization. | 448 unsigned size_; // The size of this structure, for serialization. |
| 431 Type type_; | 449 Type type_; |
| 432 int modifiers_; | 450 int modifiers_; |
| 433 }; | 451 }; |
| 434 | 452 |
| 435 #pragma pack(pop) | 453 #pragma pack(pop) |
| 436 | 454 |
| 437 } // namespace blink | 455 } // namespace blink |
| 438 | 456 |
| 439 #endif | 457 #endif |
| OLD | NEW |