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 13 matching lines...) Expand all Loading... |
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/IntRect.h" | 33 #include "platform/geometry/IntRect.h" |
| 34 #include "platform/heap/Handle.h" |
34 #include "wtf/Forward.h" | 35 #include "wtf/Forward.h" |
35 #include "wtf/RefCounted.h" | 36 #include "wtf/RefCounted.h" |
36 | 37 |
37 namespace blink { | 38 namespace blink { |
38 | 39 |
39 class Event; | 40 class Event; |
40 class GraphicsContext; | 41 class GraphicsContext; |
41 class HostWindow; | 42 class HostWindow; |
42 | 43 |
43 // The Widget class serves as a base class for FrameView, Scrollbar, and PluginV
iew. | 44 // The Widget class serves as a base class for FrameView, Scrollbar, and PluginV
iew. |
44 // | 45 // |
45 // Widgets are connected in a hierarchy, with the restriction that plugins and | 46 // Widgets are connected in a hierarchy, with the restriction that plugins and |
46 // scrollbars are always leaves of the tree. Only FrameView can have children | 47 // scrollbars are always leaves of the tree. Only FrameView can have children |
47 // (and therefore the Widget class has no concept of children). | 48 // (and therefore the Widget class has no concept of children). |
48 class PLATFORM_EXPORT Widget : public RefCounted<Widget> { | 49 class PLATFORM_EXPORT Widget : public RefCountedWillBeGarbageCollectedFinalized<
Widget> { |
49 public: | 50 public: |
50 Widget(); | 51 Widget(); |
51 virtual ~Widget(); | 52 virtual ~Widget(); |
52 | 53 |
53 int x() const { return frameRect().x(); } | 54 int x() const { return frameRect().x(); } |
54 int y() const { return frameRect().y(); } | 55 int y() const { return frameRect().y(); } |
55 int width() const { return frameRect().width(); } | 56 int width() const { return frameRect().width(); } |
56 int height() const { return frameRect().height(); } | 57 int height() const { return frameRect().height(); } |
57 IntSize size() const { return frameRect().size(); } | 58 IntSize size() const { return frameRect().size(); } |
58 IntPoint location() const { return frameRect().location(); } | 59 IntPoint location() const { return frameRect().location(); } |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 virtual IntPoint convertToContainingView(const IntPoint&) const; | 117 virtual IntPoint convertToContainingView(const IntPoint&) const; |
117 virtual IntPoint convertFromContainingView(const IntPoint&) const; | 118 virtual IntPoint convertFromContainingView(const IntPoint&) const; |
118 | 119 |
119 // Virtual methods to convert points to/from child widgets | 120 // Virtual methods to convert points to/from child widgets |
120 virtual IntPoint convertChildToSelf(const Widget*, const IntPoint&) const; | 121 virtual IntPoint convertChildToSelf(const Widget*, const IntPoint&) const; |
121 virtual IntPoint convertSelfToChild(const Widget*, const IntPoint&) const; | 122 virtual IntPoint convertSelfToChild(const Widget*, const IntPoint&) const; |
122 | 123 |
123 // Notifies this widget that it will no longer be receiving events. | 124 // Notifies this widget that it will no longer be receiving events. |
124 virtual void eventListenersRemoved() { } | 125 virtual void eventListenersRemoved() { } |
125 | 126 |
126 #if ENABLE(OILPAN) | 127 virtual void trace(Visitor*); |
127 virtual void detach() { } | 128 virtual void dispose() { } |
128 #endif | |
129 | 129 |
130 private: | 130 private: |
131 Widget* m_parent; | 131 RawPtrWillBeMember<Widget> m_parent; |
132 IntRect m_frame; | 132 IntRect m_frame; |
133 bool m_selfVisible; | 133 bool m_selfVisible; |
134 bool m_parentVisible; | 134 bool m_parentVisible; |
135 }; | 135 }; |
136 | 136 |
137 } // namespace blink | 137 } // namespace blink |
138 | 138 |
139 #endif // Widget_h | 139 #endif // Widget_h |
OLD | NEW |