Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Side by Side Diff: Source/core/events/WheelEvent.h

Issue 1018183002: Add rails to input wheel events. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: More plumbing and tests Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/events/Event.h ('k') | Source/core/events/WheelEvent.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com)
3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de)
4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2010 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2010 Apple Inc. All rights reserv ed.
6 * Copyright (C) 2013 Samsung Electronics. All rights reserved. 6 * Copyright (C) 2013 Samsung Electronics. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 } 51 }
52 52
53 static PassRefPtrWillBeRawPtr<WheelEvent> create(const AtomicString& type, c onst WheelEventInit& initializer) 53 static PassRefPtrWillBeRawPtr<WheelEvent> create(const AtomicString& type, c onst WheelEventInit& initializer)
54 { 54 {
55 return adoptRefWillBeNoop(new WheelEvent(type, initializer)); 55 return adoptRefWillBeNoop(new WheelEvent(type, initializer));
56 } 56 }
57 57
58 static PassRefPtrWillBeRawPtr<WheelEvent> create(const FloatPoint& wheelTick s, 58 static PassRefPtrWillBeRawPtr<WheelEvent> create(const FloatPoint& wheelTick s,
59 const FloatPoint& rawDelta, unsigned deltaMode, PassRefPtrWillBeRawPtr<A bstractView> view, 59 const FloatPoint& rawDelta, unsigned deltaMode, PassRefPtrWillBeRawPtr<A bstractView> view,
60 const IntPoint& screenLocation, const IntPoint& windowLocation, 60 const IntPoint& screenLocation, const IntPoint& windowLocation,
61 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short b uttons, bool canScroll, bool hasPreciseScrollingDeltas) 61 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short b uttons, bool canScroll, bool hasPreciseScrollingDeltas, RailsMode railsMode)
62 { 62 {
63 return adoptRefWillBeNoop(new WheelEvent(wheelTicks, rawDelta, deltaMode , view, 63 return adoptRefWillBeNoop(new WheelEvent(wheelTicks, rawDelta, deltaMode , view,
64 screenLocation, windowLocation, ctrlKey, altKey, shiftKey, metaKey, buttons, canScroll, hasPreciseScrollingDeltas)); 64 screenLocation, windowLocation, ctrlKey, altKey, shiftKey, metaKey, buttons, canScroll, hasPreciseScrollingDeltas, railsMode));
65 } 65 }
66 66
67 double deltaX() const { return m_deltaX; } // Positive when scrolling right. 67 double deltaX() const { return m_deltaX; } // Positive when scrolling right.
68 double deltaY() const { return m_deltaY; } // Positive when scrolling down. 68 double deltaY() const { return m_deltaY; } // Positive when scrolling down.
69 double deltaZ() const { return m_deltaZ; } 69 double deltaZ() const { return m_deltaZ; }
70 int wheelDelta() const { return wheelDeltaY() ? wheelDeltaY() : wheelDeltaX( ); } // Deprecated. 70 int wheelDelta() const { return wheelDeltaY() ? wheelDeltaY() : wheelDeltaX( ); } // Deprecated.
71 int wheelDeltaX() const { return m_wheelDelta.x(); } // Deprecated, negative when scrolling right. 71 int wheelDeltaX() const { return m_wheelDelta.x(); } // Deprecated, negative when scrolling right.
72 int wheelDeltaY() const { return m_wheelDelta.y(); } // Deprecated, negative when scrolling down. 72 int wheelDeltaY() const { return m_wheelDelta.y(); } // Deprecated, negative when scrolling down.
73 unsigned deltaMode() const { return m_deltaMode; } 73 unsigned deltaMode() const { return m_deltaMode; }
74 float ticksX() const { return static_cast<float>(m_wheelDelta.x()) / TickMul tiplier; } 74 float ticksX() const { return static_cast<float>(m_wheelDelta.x()) / TickMul tiplier; }
75 float ticksY() const { return static_cast<float>(m_wheelDelta.y()) / TickMul tiplier; } 75 float ticksY() const { return static_cast<float>(m_wheelDelta.y()) / TickMul tiplier; }
76 bool canScroll() const { return m_canScroll; } 76 bool canScroll() const { return m_canScroll; }
77 bool hasPreciseScrollingDeltas() const { return m_hasPreciseScrollingDeltas; } 77 bool hasPreciseScrollingDeltas() const { return m_hasPreciseScrollingDeltas; }
78 RailsMode railsMode() const { return m_railsMode; }
78 79
79 virtual const AtomicString& interfaceName() const override; 80 virtual const AtomicString& interfaceName() const override;
80 virtual bool isMouseEvent() const override; 81 virtual bool isMouseEvent() const override;
81 virtual bool isWheelEvent() const override; 82 virtual bool isWheelEvent() const override;
82 83
83 DECLARE_VIRTUAL_TRACE(); 84 DECLARE_VIRTUAL_TRACE();
84 85
85 private: 86 private:
86 WheelEvent(); 87 WheelEvent();
87 WheelEvent(const AtomicString&, const WheelEventInit&); 88 WheelEvent(const AtomicString&, const WheelEventInit&);
88 WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta, 89 WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta,
89 unsigned, PassRefPtrWillBeRawPtr<AbstractView>, const IntPoint& screenLo cation, const IntPoint& windowLocation, 90 unsigned, PassRefPtrWillBeRawPtr<AbstractView>, const IntPoint& screenLo cation, const IntPoint& windowLocation,
90 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short b uttons, bool canScroll, bool hasPreciseScrollingDeltas); 91 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short b uttons, bool canScroll, bool hasPreciseScrollingDeltas, RailsMode);
91 92
92 IntPoint m_wheelDelta; 93 IntPoint m_wheelDelta;
93 double m_deltaX; 94 double m_deltaX;
94 double m_deltaY; 95 double m_deltaY;
95 double m_deltaZ; 96 double m_deltaZ;
96 unsigned m_deltaMode; 97 unsigned m_deltaMode;
97 bool m_canScroll; 98 bool m_canScroll;
98 bool m_hasPreciseScrollingDeltas; 99 bool m_hasPreciseScrollingDeltas;
100 RailsMode m_railsMode;
99 }; 101 };
100 102
101 DEFINE_EVENT_TYPE_CASTS(WheelEvent); 103 DEFINE_EVENT_TYPE_CASTS(WheelEvent);
102 104
103 class WheelEventDispatchMediator final : public EventDispatchMediator { 105 class WheelEventDispatchMediator final : public EventDispatchMediator {
104 public: 106 public:
105 static PassRefPtrWillBeRawPtr<WheelEventDispatchMediator> create(const Platf ormWheelEvent&, PassRefPtrWillBeRawPtr<AbstractView>); 107 static PassRefPtrWillBeRawPtr<WheelEventDispatchMediator> create(const Platf ormWheelEvent&, PassRefPtrWillBeRawPtr<AbstractView>);
106 private: 108 private:
107 WheelEventDispatchMediator(const PlatformWheelEvent&, PassRefPtrWillBeRawPtr <AbstractView>); 109 WheelEventDispatchMediator(const PlatformWheelEvent&, PassRefPtrWillBeRawPtr <AbstractView>);
108 WheelEvent& event() const; 110 WheelEvent& event() const;
109 virtual bool dispatchEvent(EventDispatcher&) const override; 111 virtual bool dispatchEvent(EventDispatcher&) const override;
110 }; 112 };
111 113
112 } // namespace blink 114 } // namespace blink
113 115
114 #endif // WheelEvent_h 116 #endif // WheelEvent_h
OLDNEW
« no previous file with comments | « Source/core/events/Event.h ('k') | Source/core/events/WheelEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698