| OLD | NEW |
| 1 /* | 1 /* |
| 2 Copyright (C) 2000 Simon Hausmann <hausmann@kde.org> | 2 Copyright (C) 2000 Simon Hausmann <hausmann@kde.org> |
| 3 Copyright (C) 2006 Apple Computer, Inc. | 3 Copyright (C) 2006 Apple Computer, Inc. |
| 4 | 4 |
| 5 This library is free software; you can redistribute it and/or | 5 This library is free software; you can redistribute it and/or |
| 6 modify it under the terms of the GNU Library General Public | 6 modify it under the terms of the GNU Library General Public |
| 7 License as published by the Free Software Foundation; either | 7 License as published by the Free Software Foundation; either |
| 8 version 2 of the License, or (at your option) any later version. | 8 version 2 of the License, or (at your option) any later version. |
| 9 | 9 |
| 10 This library is distributed in the hope that it will be useful, | 10 This library is distributed in the hope that it will be useful, |
| 11 but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 Library General Public License for more details. | 13 Library General Public License for more details. |
| 14 | 14 |
| 15 You should have received a copy of the GNU Library General Public License | 15 You should have received a copy of the GNU Library General Public License |
| 16 along with this library; see the file COPYING.LIB. If not, write to | 16 along with this library; see the file COPYING.LIB. If not, write to |
| 17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 Boston, MA 02110-1301, USA. | 18 Boston, MA 02110-1301, USA. |
| 19 */ | 19 */ |
| 20 | 20 |
| 21 #ifndef SKY_ENGINE_CORE_PAGE_EVENTWITHHITTESTRESULTS_H_ | 21 #ifndef SKY_ENGINE_CORE_PAGE_EVENTWITHHITTESTRESULTS_H_ |
| 22 #define SKY_ENGINE_CORE_PAGE_EVENTWITHHITTESTRESULTS_H_ | 22 #define SKY_ENGINE_CORE_PAGE_EVENTWITHHITTESTRESULTS_H_ |
| 23 | 23 |
| 24 #include "sky/engine/core/rendering/HitTestResult.h" | 24 #include "sky/engine/core/rendering/HitTestResult.h" |
| 25 #include "sky/engine/platform/PlatformEvent.h" | 25 #include "sky/engine/platform/PlatformEvent.h" |
| 26 #include "sky/engine/platform/PlatformGestureEvent.h" | 26 #include "sky/engine/platform/PlatformGestureEvent.h" |
| 27 #include "sky/engine/platform/PlatformMouseEvent.h" | |
| 28 | 27 |
| 29 namespace blink { | 28 namespace blink { |
| 30 | 29 |
| 31 class Scrollbar; | 30 class Scrollbar; |
| 32 | 31 |
| 33 template <typename EventType> | 32 template <typename EventType> |
| 34 class EventWithHitTestResults { | 33 class EventWithHitTestResults { |
| 35 STACK_ALLOCATED(); | 34 STACK_ALLOCATED(); |
| 36 | 35 |
| 37 public: | 36 public: |
| 38 EventWithHitTestResults(const EventType& event, const HitTestResult& hitTest
Result) | 37 EventWithHitTestResults(const EventType& event, const HitTestResult& hitTest
Result) |
| 39 : m_event(event) | 38 : m_event(event) |
| 40 , m_hitTestResult(hitTestResult) | 39 , m_hitTestResult(hitTestResult) |
| 41 { | 40 { |
| 42 } | 41 } |
| 43 | 42 |
| 44 const EventType& event() const { return m_event; } | 43 const EventType& event() const { return m_event; } |
| 45 const HitTestResult& hitTestResult() const { return m_hitTestResult; } | 44 const HitTestResult& hitTestResult() const { return m_hitTestResult; } |
| 46 LayoutPoint localPoint() const { return m_hitTestResult.localPoint(); } | 45 LayoutPoint localPoint() const { return m_hitTestResult.localPoint(); } |
| 47 Scrollbar* scrollbar() const { return m_hitTestResult.scrollbar(); } | 46 Scrollbar* scrollbar() const { return m_hitTestResult.scrollbar(); } |
| 48 bool isOverLink() const { return m_hitTestResult.isOverLink(); } | 47 bool isOverLink() const { return m_hitTestResult.isOverLink(); } |
| 49 bool isOverWidget() const { return m_hitTestResult.isOverWidget(); } | 48 bool isOverWidget() const { return m_hitTestResult.isOverWidget(); } |
| 50 Node* targetNode() const { return m_hitTestResult.targetNode(); } | 49 Node* targetNode() const { return m_hitTestResult.targetNode(); } |
| 51 | 50 |
| 52 private: | 51 private: |
| 53 EventType m_event; | 52 EventType m_event; |
| 54 HitTestResult m_hitTestResult; | 53 HitTestResult m_hitTestResult; |
| 55 }; | 54 }; |
| 56 | 55 |
| 57 typedef EventWithHitTestResults<PlatformMouseEvent> MouseEventWithHitTestResults
; | |
| 58 | |
| 59 typedef EventWithHitTestResults<PlatformGestureEvent> GestureEventWithHitTestRes
ults; | 56 typedef EventWithHitTestResults<PlatformGestureEvent> GestureEventWithHitTestRes
ults; |
| 60 | 57 |
| 61 } // namespace blink | 58 } // namespace blink |
| 62 | 59 |
| 63 #endif // SKY_ENGINE_CORE_PAGE_EVENTWITHHITTESTRESULTS_H_ | 60 #endif // SKY_ENGINE_CORE_PAGE_EVENTWITHHITTESTRESULTS_H_ |
| OLD | NEW |