| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 static_assert(sizeof(WebMouseEvent) == sizeof(SameSizeAsWebMouseEvent), | 74 static_assert(sizeof(WebMouseEvent) == sizeof(SameSizeAsWebMouseEvent), |
| 75 "WebMouseEvent should not have gaps"); | 75 "WebMouseEvent should not have gaps"); |
| 76 static_assert(sizeof(WebMouseWheelEvent) == | 76 static_assert(sizeof(WebMouseWheelEvent) == |
| 77 sizeof(SameSizeAsWebMouseWheelEvent), | 77 sizeof(SameSizeAsWebMouseWheelEvent), |
| 78 "WebMouseWheelEvent should not have gaps"); | 78 "WebMouseWheelEvent should not have gaps"); |
| 79 static_assert(sizeof(WebGestureEvent) == sizeof(SameSizeAsWebGestureEvent), | 79 static_assert(sizeof(WebGestureEvent) == sizeof(SameSizeAsWebGestureEvent), |
| 80 "WebGestureEvent should not have gaps"); | 80 "WebGestureEvent should not have gaps"); |
| 81 static_assert(sizeof(WebTouchEvent) == sizeof(SameSizeAsWebTouchEvent), | 81 static_assert(sizeof(WebTouchEvent) == sizeof(SameSizeAsWebTouchEvent), |
| 82 "WebTouchEvent should not have gaps"); | 82 "WebTouchEvent should not have gaps"); |
| 83 | 83 |
| 84 #define CASE_TYPE(t) \ | |
| 85 case WebInputEvent::t: \ | |
| 86 return #t | |
| 87 // static | |
| 88 const char* WebInputEvent::GetName(WebInputEvent::Type type) { | |
| 89 switch (type) { | |
| 90 CASE_TYPE(Undefined); | |
| 91 CASE_TYPE(MouseDown); | |
| 92 CASE_TYPE(MouseUp); | |
| 93 CASE_TYPE(MouseMove); | |
| 94 CASE_TYPE(MouseEnter); | |
| 95 CASE_TYPE(MouseLeave); | |
| 96 CASE_TYPE(ContextMenu); | |
| 97 CASE_TYPE(MouseWheel); | |
| 98 CASE_TYPE(RawKeyDown); | |
| 99 CASE_TYPE(KeyDown); | |
| 100 CASE_TYPE(KeyUp); | |
| 101 CASE_TYPE(Char); | |
| 102 CASE_TYPE(GestureScrollBegin); | |
| 103 CASE_TYPE(GestureScrollEnd); | |
| 104 CASE_TYPE(GestureScrollUpdate); | |
| 105 CASE_TYPE(GestureFlingStart); | |
| 106 CASE_TYPE(GestureFlingCancel); | |
| 107 CASE_TYPE(GestureShowPress); | |
| 108 CASE_TYPE(GestureTap); | |
| 109 CASE_TYPE(GestureTapUnconfirmed); | |
| 110 CASE_TYPE(GestureTapDown); | |
| 111 CASE_TYPE(GestureTapCancel); | |
| 112 CASE_TYPE(GestureDoubleTap); | |
| 113 CASE_TYPE(GestureTwoFingerTap); | |
| 114 CASE_TYPE(GestureLongPress); | |
| 115 CASE_TYPE(GestureLongTap); | |
| 116 CASE_TYPE(GesturePinchBegin); | |
| 117 CASE_TYPE(GesturePinchEnd); | |
| 118 CASE_TYPE(GesturePinchUpdate); | |
| 119 CASE_TYPE(TouchStart); | |
| 120 CASE_TYPE(TouchMove); | |
| 121 CASE_TYPE(TouchEnd); | |
| 122 CASE_TYPE(TouchCancel); | |
| 123 CASE_TYPE(TouchScrollStarted); | |
| 124 default: | |
| 125 NOTREACHED(); | |
| 126 return ""; | |
| 127 } | |
| 128 } | |
| 129 #undef CASE_TYPE | |
| 130 | |
| 131 } // namespace blink | 84 } // namespace blink |
| OLD | NEW |