OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 ASSERT(m_type == PlatformEvent::GestureScrollUpdate); | 175 ASSERT(m_type == PlatformEvent::GestureScrollUpdate); |
176 return true; | 176 return true; |
177 } | 177 } |
178 | 178 |
179 float scale() const { | 179 float scale() const { |
180 ASSERT(m_type == PlatformEvent::GesturePinchUpdate); | 180 ASSERT(m_type == PlatformEvent::GesturePinchUpdate); |
181 return m_data.m_pinchUpdate.m_scale; | 181 return m_data.m_pinchUpdate.m_scale; |
182 } | 182 } |
183 | 183 |
184 void applyTouchAdjustment(const IntPoint& adjustedPosition) { | 184 void applyTouchAdjustment(const IntPoint& adjustedPosition) { |
185 // Update the window-relative position of the event so that the node that wa
s | 185 // Update the window-relative position of the event so that the node that |
186 // ultimately hit is under this point (i.e. elementFromPoint for the client | 186 // was ultimately hit is under this point (i.e. elementFromPoint for the |
187 // co-ordinates in a 'click' event should yield the target). The global | 187 // client co-ordinates in a 'click' event should yield the target). The |
188 // position is intentionally left unmodified because it's intended to reflec
t | 188 // global position is intentionally left unmodified because it's intended to |
189 // raw co-ordinates unrelated to any content. | 189 // reflect raw co-ordinates unrelated to any content. |
190 m_position = adjustedPosition; | 190 m_position = adjustedPosition; |
191 } | 191 } |
192 | 192 |
193 bool isScrollEvent() const { | 193 bool isScrollEvent() const { |
194 switch (m_type) { | 194 switch (m_type) { |
195 case GestureScrollBegin: | 195 case GestureScrollBegin: |
196 case GestureScrollEnd: | 196 case GestureScrollEnd: |
197 case GestureScrollUpdate: | 197 case GestureScrollUpdate: |
198 case GestureFlingStart: | 198 case GestureFlingStart: |
199 case GesturePinchBegin: | 199 case GesturePinchBegin: |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 float m_scale; | 246 float m_scale; |
247 } m_pinchUpdate; | 247 } m_pinchUpdate; |
248 } m_data; | 248 } m_data; |
249 | 249 |
250 uint32_t m_uniqueTouchEventId; | 250 uint32_t m_uniqueTouchEventId; |
251 }; | 251 }; |
252 | 252 |
253 } // namespace blink | 253 } // namespace blink |
254 | 254 |
255 #endif // PlatformGestureEvent_h | 255 #endif // PlatformGestureEvent_h |
OLD | NEW |