OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2009 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
88 const IntPoint& position() const { return m_position; } | 88 const IntPoint& position() const { return m_position; } |
89 const IntPoint& globalPosition() const { return m_globalPosition; } | 89 const IntPoint& globalPosition() const { return m_globalPosition; } |
90 const IntPoint& movementDelta() const { return m_movementDelta; } | 90 const IntPoint& movementDelta() const { return m_movementDelta; } |
91 | 91 |
92 MouseButton button() const { return m_button; } | 92 MouseButton button() const { return m_button; } |
93 int clickCount() const { return m_clickCount; } | 93 int clickCount() const { return m_clickCount; } |
94 unsigned modifierFlags() const { return m_modifierFlags; } | 94 unsigned modifierFlags() const { return m_modifierFlags; } |
95 bool fromTouch() const { return m_synthesized == FromTouch; } | 95 bool fromTouch() const { return m_synthesized == FromTouch; } |
96 SyntheticEventType syntheticEventType() const { return m_synthesized; } | 96 SyntheticEventType syntheticEventType() const { return m_synthesized; } |
97 | 97 |
98 unsigned short buttons() const | |
Rick Byers
2014/11/18 20:29:19
And actually, it doesn't really make sense for Pla
zino
2014/11/24 13:07:08
Done.
| |
99 { | |
100 if (fromTouch()) | |
101 return 1; | |
Rick Byers
2014/11/18 20:29:19
This logic doesn't belong here, the caller should
zino
2014/11/24 13:07:08
Done.
Rick Byers
2014/11/25 17:44:27
I still don't see why we should change the Platfor
zino
2014/11/28 02:37:07
Here
zino
2014/11/28 12:29:28
Done
| |
102 | |
103 unsigned short value = 0; | |
104 | |
105 if (m_modifiers & LeftButtonDown) | |
106 value |= 1; | |
107 if (m_modifiers & RightButtonDown) | |
108 value |= 2; | |
109 if (m_modifiers & MiddleButtonDown) | |
110 value |= 4; | |
111 | |
112 return value; | |
113 } | |
114 | |
98 protected: | 115 protected: |
99 IntPoint m_position; | 116 IntPoint m_position; |
100 IntPoint m_globalPosition; | 117 IntPoint m_globalPosition; |
101 IntPoint m_movementDelta; | 118 IntPoint m_movementDelta; |
102 MouseButton m_button; | 119 MouseButton m_button; |
103 int m_clickCount; | 120 int m_clickCount; |
104 SyntheticEventType m_synthesized; | 121 SyntheticEventType m_synthesized; |
105 unsigned m_modifierFlags; | 122 unsigned m_modifierFlags; |
106 }; | 123 }; |
107 | 124 |
108 } // namespace blink | 125 } // namespace blink |
109 | 126 |
110 #endif // PlatformMouseEvent_h | 127 #endif // PlatformMouseEvent_h |
OLD | NEW |