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 11 matching lines...) Expand all Loading... |
22 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 22 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
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/IntRect.h" | 33 #include "platform/geometry/IntRect.h" |
33 #include "wtf/Forward.h" | 34 #include "wtf/Forward.h" |
34 #include "wtf/RefCounted.h" | 35 #include "wtf/RefCounted.h" |
35 | 36 |
36 namespace WebCore { | 37 namespace WebCore { |
37 | 38 |
38 class Event; | 39 class Event; |
39 class GraphicsContext; | 40 class GraphicsContext; |
40 class HostWindow; | 41 class HostWindow; |
41 | 42 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 106 |
106 // It is important for cross-platform code to realize that Mac has flipped c
oordinates. Therefore any code | 107 // It is important for cross-platform code to realize that Mac has flipped c
oordinates. Therefore any code |
107 // that tries to convert the location of a rect using the point-based conver
tFromContainingWindow will end | 108 // that tries to convert the location of a rect using the point-based conver
tFromContainingWindow will end |
108 // up with an inaccurate rect. Always make sure to use the rect-based conver
tFromContainingWindow method | 109 // up with an inaccurate rect. Always make sure to use the rect-based conver
tFromContainingWindow method |
109 // when converting window rects. | 110 // when converting window rects. |
110 IntRect convertToContainingWindow(const IntRect&) const; | 111 IntRect convertToContainingWindow(const IntRect&) const; |
111 IntRect convertFromContainingWindow(const IntRect&) const; | 112 IntRect convertFromContainingWindow(const IntRect&) const; |
112 | 113 |
113 IntPoint convertToContainingWindow(const IntPoint&) const; | 114 IntPoint convertToContainingWindow(const IntPoint&) const; |
114 IntPoint convertFromContainingWindow(const IntPoint&) const; | 115 IntPoint convertFromContainingWindow(const IntPoint&) const; |
| 116 FloatPoint convertFromContainingWindow(const FloatPoint&) const; |
115 | 117 |
116 virtual void frameRectsChanged() { } | 118 virtual void frameRectsChanged() { } |
117 | 119 |
118 // Notifies this widget that other widgets on the page have been repositione
d. | 120 // Notifies this widget that other widgets on the page have been repositione
d. |
119 virtual void widgetPositionsUpdated() { } | 121 virtual void widgetPositionsUpdated() { } |
120 | 122 |
121 // Virtual methods to convert points to/from the containing ScrollView | 123 // Virtual methods to convert points to/from the containing ScrollView |
122 virtual IntRect convertToContainingView(const IntRect&) const; | 124 virtual IntRect convertToContainingView(const IntRect&) const; |
123 virtual IntRect convertFromContainingView(const IntRect&) const; | 125 virtual IntRect convertFromContainingView(const IntRect&) const; |
124 virtual IntPoint convertToContainingView(const IntPoint&) const; | 126 virtual IntPoint convertToContainingView(const IntPoint&) const; |
125 virtual IntPoint convertFromContainingView(const IntPoint&) const; | 127 virtual IntPoint convertFromContainingView(const IntPoint&) const; |
126 | 128 |
127 // Virtual methods to convert points to/from child widgets | 129 // Virtual methods to convert points to/from child widgets |
128 virtual IntPoint convertChildToSelf(const Widget*, const IntPoint&) const; | 130 virtual IntPoint convertChildToSelf(const Widget*, const IntPoint&) const; |
129 virtual IntPoint convertSelfToChild(const Widget*, const IntPoint&) const; | 131 virtual IntPoint convertSelfToChild(const Widget*, const IntPoint&) const; |
130 | 132 |
131 // Notifies this widget that it will no longer be receiving events. | 133 // Notifies this widget that it will no longer be receiving events. |
132 virtual void eventListenersRemoved() { } | 134 virtual void eventListenersRemoved() { } |
133 | 135 |
134 private: | 136 private: |
135 Widget* m_parent; | 137 Widget* m_parent; |
136 IntRect m_frame; | 138 IntRect m_frame; |
137 bool m_selfVisible; | 139 bool m_selfVisible; |
138 bool m_parentVisible; | 140 bool m_parentVisible; |
139 }; | 141 }; |
140 | 142 |
141 } // namespace WebCore | 143 } // namespace WebCore |
142 | 144 |
143 #endif // Widget_h | 145 #endif // Widget_h |
OLD | NEW |