OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2009, 2010, 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 class TouchEvent; | 77 class TouchEvent; |
78 class VisibleSelection; | 78 class VisibleSelection; |
79 class WheelEvent; | 79 class WheelEvent; |
80 class Widget; | 80 class Widget; |
81 | 81 |
82 class DragState; | 82 class DragState; |
83 | 83 |
84 enum AppendTrailingWhitespace { ShouldAppendTrailingWhitespace, DontAppendTraili
ngWhitespace }; | 84 enum AppendTrailingWhitespace { ShouldAppendTrailingWhitespace, DontAppendTraili
ngWhitespace }; |
85 enum CheckDragHysteresis { ShouldCheckDragHysteresis, DontCheckDragHysteresis }; | 85 enum CheckDragHysteresis { ShouldCheckDragHysteresis, DontCheckDragHysteresis }; |
86 | 86 |
87 class EventHandler { | 87 class EventHandler : public NoBaseWillBeGarbageCollectedFinalized<EventHandler>
{ |
88 WTF_MAKE_NONCOPYABLE(EventHandler); | 88 WTF_MAKE_NONCOPYABLE(EventHandler); |
89 public: | 89 public: |
90 explicit EventHandler(LocalFrame*); | 90 explicit EventHandler(LocalFrame*); |
91 ~EventHandler(); | 91 ~EventHandler(); |
| 92 void trace(Visitor*); |
92 | 93 |
93 void clear(); | 94 void clear(); |
94 void nodeWillBeRemoved(Node&); | 95 void nodeWillBeRemoved(Node&); |
95 | 96 |
96 void updateSelectionForMouseDrag(); | 97 void updateSelectionForMouseDrag(); |
97 | 98 |
98 Node* mousePressNode() const; | 99 Node* mousePressNode() const; |
99 | 100 |
100 #if OS(WIN) | 101 #if OS(WIN) |
101 void startPanScrolling(RenderObject*); | 102 void startPanScrolling(RenderObject*); |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 LocalFrame* getSubFrameForGestureEvent(const IntPoint& touchAdjustedPoint, c
onst PlatformGestureEvent&); | 306 LocalFrame* getSubFrameForGestureEvent(const IntPoint& touchAdjustedPoint, c
onst PlatformGestureEvent&); |
306 | 307 |
307 AutoscrollController* autoscrollController() const; | 308 AutoscrollController* autoscrollController() const; |
308 bool panScrollInProgress() const; | 309 bool panScrollInProgress() const; |
309 void setLastKnownMousePosition(const PlatformMouseEvent&); | 310 void setLastKnownMousePosition(const PlatformMouseEvent&); |
310 | 311 |
311 LocalFrame* const m_frame; | 312 LocalFrame* const m_frame; |
312 | 313 |
313 bool m_mousePressed; | 314 bool m_mousePressed; |
314 bool m_capturesDragging; | 315 bool m_capturesDragging; |
315 RefPtrWillBePersistent<Node> m_mousePressNode; | 316 RefPtrWillBeMember<Node> m_mousePressNode; |
316 | 317 |
317 bool m_mouseDownMayStartSelect; | 318 bool m_mouseDownMayStartSelect; |
318 bool m_mouseDownMayStartDrag; | 319 bool m_mouseDownMayStartDrag; |
319 bool m_mouseDownWasSingleClickInSelection; | 320 bool m_mouseDownWasSingleClickInSelection; |
320 enum SelectionInitiationState { HaveNotStartedSelection, PlacedCaret, Extend
edSelection }; | 321 enum SelectionInitiationState { HaveNotStartedSelection, PlacedCaret, Extend
edSelection }; |
321 SelectionInitiationState m_selectionInitiationState; | 322 SelectionInitiationState m_selectionInitiationState; |
322 | 323 |
323 LayoutPoint m_dragStartPos; | 324 LayoutPoint m_dragStartPos; |
324 | 325 |
325 Timer<EventHandler> m_hoverTimer; | 326 Timer<EventHandler> m_hoverTimer; |
326 Timer<EventHandler> m_cursorUpdateTimer; | 327 Timer<EventHandler> m_cursorUpdateTimer; |
327 | 328 |
328 bool m_mouseDownMayStartAutoscroll; | 329 bool m_mouseDownMayStartAutoscroll; |
329 bool m_mouseDownWasInSubframe; | 330 bool m_mouseDownWasInSubframe; |
330 | 331 |
331 Timer<EventHandler> m_fakeMouseMoveEventTimer; | 332 Timer<EventHandler> m_fakeMouseMoveEventTimer; |
332 | 333 |
333 bool m_svgPan; | 334 bool m_svgPan; |
334 | 335 |
335 RenderLayerScrollableArea* m_resizeScrollableArea; | 336 RenderLayerScrollableArea* m_resizeScrollableArea; |
336 | 337 |
337 RefPtrWillBePersistent<Node> m_capturingMouseEventsNode; | 338 RefPtrWillBeMember<Node> m_capturingMouseEventsNode; |
338 bool m_eventHandlerWillResetCapturingMouseEventsNode; | 339 bool m_eventHandlerWillResetCapturingMouseEventsNode; |
339 | 340 |
340 RefPtrWillBePersistent<Node> m_nodeUnderMouse; | 341 RefPtrWillBeMember<Node> m_nodeUnderMouse; |
341 RefPtrWillBePersistent<Node> m_lastNodeUnderMouse; | 342 RefPtrWillBeMember<Node> m_lastNodeUnderMouse; |
342 RefPtr<LocalFrame> m_lastMouseMoveEventSubframe; | 343 RefPtr<LocalFrame> m_lastMouseMoveEventSubframe; |
343 RefPtr<Scrollbar> m_lastScrollbarUnderMouse; | 344 RefPtr<Scrollbar> m_lastScrollbarUnderMouse; |
344 Cursor m_currentMouseCursor; | 345 Cursor m_currentMouseCursor; |
345 | 346 |
346 int m_clickCount; | 347 int m_clickCount; |
347 RefPtrWillBePersistent<Node> m_clickNode; | 348 RefPtrWillBeMember<Node> m_clickNode; |
348 | 349 |
349 RefPtrWillBePersistent<Node> m_dragTarget; | 350 RefPtrWillBeMember<Node> m_dragTarget; |
350 bool m_shouldOnlyFireDragOverEvent; | 351 bool m_shouldOnlyFireDragOverEvent; |
351 | 352 |
352 RefPtrWillBePersistent<HTMLFrameSetElement> m_frameSetBeingResized; | 353 RefPtrWillBeMember<HTMLFrameSetElement> m_frameSetBeingResized; |
353 | 354 |
354 LayoutSize m_offsetFromResizeCorner; // In the coords of m_resizeScrollableA
rea. | 355 LayoutSize m_offsetFromResizeCorner; // In the coords of m_resizeScrollableA
rea. |
355 | 356 |
356 bool m_mousePositionIsUnknown; | 357 bool m_mousePositionIsUnknown; |
357 IntPoint m_lastKnownMousePosition; | 358 IntPoint m_lastKnownMousePosition; |
358 IntPoint m_lastKnownMouseGlobalPosition; | 359 IntPoint m_lastKnownMouseGlobalPosition; |
359 IntPoint m_mouseDownPos; // In our view's coords. | 360 IntPoint m_mouseDownPos; // In our view's coords. |
360 double m_mouseDownTimestamp; | 361 double m_mouseDownTimestamp; |
361 PlatformMouseEvent m_mouseDown; | 362 PlatformMouseEvent m_mouseDown; |
362 RefPtr<UserGestureToken> m_lastMouseDownUserGestureToken; | 363 RefPtr<UserGestureToken> m_lastMouseDownUserGestureToken; |
363 | 364 |
364 RefPtrWillBePersistent<Node> m_latchedWheelEventNode; | 365 RefPtrWillBeMember<Node> m_latchedWheelEventNode; |
365 bool m_widgetIsLatched; | 366 bool m_widgetIsLatched; |
366 | 367 |
367 RefPtrWillBePersistent<Node> m_previousWheelScrolledNode; | 368 RefPtrWillBeMember<Node> m_previousWheelScrolledNode; |
368 | 369 |
369 // The target of each active touch point indexed by the touch ID. | 370 // The target of each active touch point indexed by the touch ID. |
370 typedef WillBeHeapHashMap<unsigned, RefPtrWillBeMember<EventTarget>, Default
Hash<unsigned>::Hash, WTF::UnsignedWithZeroKeyHashTraits<unsigned> > TouchTarget
Map; | 371 typedef WillBeHeapHashMap<unsigned, RefPtrWillBeMember<EventTarget>, Default
Hash<unsigned>::Hash, WTF::UnsignedWithZeroKeyHashTraits<unsigned> > TouchTarget
Map; |
371 typedef WillBePersistentHeapHashMap<unsigned, RefPtrWillBeMember<EventTarget
>, DefaultHash<unsigned>::Hash, WTF::UnsignedWithZeroKeyHashTraits<unsigned> > P
ersistentTouchTargetMap; | 372 TouchTargetMap m_targetForTouchID; |
372 PersistentTouchTargetMap m_targetForTouchID; | |
373 | 373 |
374 // If set, the document of the active touch sequence. Unset if no touch sequ
ence active. | 374 // If set, the document of the active touch sequence. Unset if no touch sequ
ence active. |
375 RefPtrWillBePersistent<Document> m_touchSequenceDocument; | 375 RefPtrWillBeMember<Document> m_touchSequenceDocument; |
376 | 376 |
377 bool m_touchPressed; | 377 bool m_touchPressed; |
378 | 378 |
379 RefPtrWillBePersistent<Node> m_scrollGestureHandlingNode; | 379 RefPtrWillBeMember<Node> m_scrollGestureHandlingNode; |
380 bool m_lastHitTestResultOverWidget; | 380 bool m_lastHitTestResultOverWidget; |
381 RefPtrWillBePersistent<Node> m_previousGestureScrolledNode; | 381 RefPtrWillBeMember<Node> m_previousGestureScrolledNode; |
382 RefPtr<Scrollbar> m_scrollbarHandlingScrollGesture; | 382 RefPtr<Scrollbar> m_scrollbarHandlingScrollGesture; |
383 | 383 |
384 double m_maxMouseMovedDuration; | 384 double m_maxMouseMovedDuration; |
385 PlatformEvent::Type m_baseEventType; | 385 PlatformEvent::Type m_baseEventType; |
386 bool m_didStartDrag; | 386 bool m_didStartDrag; |
387 | 387 |
388 bool m_longTapShouldInvokeContextMenu; | 388 bool m_longTapShouldInvokeContextMenu; |
389 | 389 |
390 Timer<EventHandler> m_activeIntervalTimer; | 390 Timer<EventHandler> m_activeIntervalTimer; |
391 double m_lastShowPressTimestamp; | 391 double m_lastShowPressTimestamp; |
392 RefPtrWillBePersistent<Element> m_lastDeferredTapElement; | 392 RefPtrWillBeMember<Element> m_lastDeferredTapElement; |
393 }; | 393 }; |
394 | 394 |
395 } // namespace WebCore | 395 } // namespace WebCore |
396 | 396 |
397 #endif // EventHandler_h | 397 #endif // EventHandler_h |
OLD | NEW |