| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Collabora Ltd. All rights reserved. | 3 * Copyright (C) 2008 Collabora Ltd. All rights reserved. |
| 4 * Copyright (C) 2013 Google Inc. All rights reserved. | 4 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 26 */ | 26 */ |
| 27 | 27 |
| 28 #ifndef Widget_h | 28 #ifndef Widget_h |
| 29 #define Widget_h | 29 #define Widget_h |
| 30 | 30 |
| 31 #include "platform/PlatformExport.h" | 31 #include "platform/PlatformExport.h" |
| 32 #include "platform/geometry/FloatPoint.h" | 32 #include "platform/geometry/FloatPoint.h" |
| 33 #include "platform/geometry/FloatRect.h" |
| 33 #include "platform/geometry/IntRect.h" | 34 #include "platform/geometry/IntRect.h" |
| 34 #include "platform/heap/Handle.h" | 35 #include "platform/heap/Handle.h" |
| 35 #include "public/platform/WebFocusType.h" | 36 #include "public/platform/WebFocusType.h" |
| 36 #include "wtf/Forward.h" | 37 #include "wtf/Forward.h" |
| 37 #include "wtf/RefCounted.h" | 38 #include "wtf/RefCounted.h" |
| 38 | 39 |
| 39 namespace blink { | 40 namespace blink { |
| 40 | 41 |
| 41 class CullRect; | 42 class CullRect; |
| 42 class Event; | 43 class Event; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 94 |
| 94 virtual void handleEvent(Event*) { } | 95 virtual void handleEvent(Event*) { } |
| 95 | 96 |
| 96 // It is important for cross-platform code to realize that Mac has flipped c
oordinates. Therefore any code | 97 // It is important for cross-platform code to realize that Mac has flipped c
oordinates. Therefore any code |
| 97 // that tries to convert the location of a rect using the point-based conver
tFromRootFrame will end | 98 // that tries to convert the location of a rect using the point-based conver
tFromRootFrame will end |
| 98 // up with an inaccurate rect. Always make sure to use the rect-based conver
tFromRootFrame method | 99 // up with an inaccurate rect. Always make sure to use the rect-based conver
tFromRootFrame method |
| 99 // when converting window rects. | 100 // when converting window rects. |
| 100 IntRect convertToRootFrame(const IntRect&) const; | 101 IntRect convertToRootFrame(const IntRect&) const; |
| 101 IntRect convertFromRootFrame(const IntRect&) const; | 102 IntRect convertFromRootFrame(const IntRect&) const; |
| 102 | 103 |
| 104 FloatRect convertToRootFrame(const FloatRect&) const; |
| 105 |
| 103 IntPoint convertToRootFrame(const IntPoint&) const; | 106 IntPoint convertToRootFrame(const IntPoint&) const; |
| 104 IntPoint convertFromRootFrame(const IntPoint&) const; | 107 IntPoint convertFromRootFrame(const IntPoint&) const; |
| 105 FloatPoint convertFromRootFrame(const FloatPoint&) const; | 108 FloatPoint convertFromRootFrame(const FloatPoint&) const; |
| 106 | 109 |
| 107 virtual void frameRectsChanged() { } | 110 virtual void frameRectsChanged() { } |
| 108 | 111 |
| 109 // Notifies this widget that other widgets on the page have been repositione
d. | 112 // Notifies this widget that other widgets on the page have been repositione
d. |
| 110 virtual void widgetPositionsUpdated() { } | 113 virtual void widgetPositionsUpdated() { } |
| 111 | 114 |
| 112 virtual IntRect convertToContainingWidget(const IntRect&) const; | 115 virtual IntRect convertToContainingWidget(const IntRect&) const; |
| 113 virtual IntRect convertFromContainingWidget(const IntRect&) const; | 116 virtual IntRect convertFromContainingWidget(const IntRect&) const; |
| 117 |
| 118 virtual FloatRect convertToContainingWidget(const FloatRect&) const; |
| 119 |
| 114 virtual IntPoint convertToContainingWidget(const IntPoint&) const; | 120 virtual IntPoint convertToContainingWidget(const IntPoint&) const; |
| 115 virtual IntPoint convertFromContainingWidget(const IntPoint&) const; | 121 virtual IntPoint convertFromContainingWidget(const IntPoint&) const; |
| 116 | 122 |
| 117 // Virtual methods to convert points to/from child widgets | 123 // Virtual methods to convert points to/from child widgets |
| 118 virtual IntPoint convertChildToSelf(const Widget*, const IntPoint&) const; | 124 virtual IntPoint convertChildToSelf(const Widget*, const IntPoint&) const; |
| 119 virtual IntPoint convertSelfToChild(const Widget*, const IntPoint&) const; | 125 virtual IntPoint convertSelfToChild(const Widget*, const IntPoint&) const; |
| 120 | 126 |
| 127 virtual FloatPoint convertChildToSelf(const Widget*, const FloatPoint&) cons
t; |
| 128 |
| 121 // Notifies this widget that it will no longer be receiving events. | 129 // Notifies this widget that it will no longer be receiving events. |
| 122 virtual void eventListenersRemoved() { } | 130 virtual void eventListenersRemoved() { } |
| 123 | 131 |
| 124 DECLARE_VIRTUAL_TRACE(); | 132 DECLARE_VIRTUAL_TRACE(); |
| 125 virtual void dispose() { } | 133 virtual void dispose() { } |
| 126 | 134 |
| 127 private: | 135 private: |
| 128 RawPtrWillBeMember<Widget> m_parent; | 136 RawPtrWillBeMember<Widget> m_parent; |
| 129 IntRect m_frame; | 137 IntRect m_frame; |
| 130 bool m_selfVisible; | 138 bool m_selfVisible; |
| 131 bool m_parentVisible; | 139 bool m_parentVisible; |
| 132 }; | 140 }; |
| 133 | 141 |
| 134 } // namespace blink | 142 } // namespace blink |
| 135 | 143 |
| 136 #endif // Widget_h | 144 #endif // Widget_h |
| OLD | NEW |