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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 Widget(); | 52 Widget(); |
53 virtual ~Widget(); | 53 virtual ~Widget(); |
54 | 54 |
55 int x() const { return frameRect().x(); } | 55 int x() const { return frameRect().x(); } |
56 int y() const { return frameRect().y(); } | 56 int y() const { return frameRect().y(); } |
57 int width() const { return frameRect().width(); } | 57 int width() const { return frameRect().width(); } |
58 int height() const { return frameRect().height(); } | 58 int height() const { return frameRect().height(); } |
59 IntSize size() const { return frameRect().size(); } | 59 IntSize size() const { return frameRect().size(); } |
60 IntPoint location() const { return frameRect().location(); } | 60 IntPoint location() const { return frameRect().location(); } |
61 | 61 |
62 virtual void setFrameRect(const IntRect& frame) { m_frame = frame; } | 62 virtual void setFrameRect(const IntRect& frameRect) { m_frameRect = frameRec
t; } |
63 const IntRect& frameRect() const { return m_frame; } | 63 const IntRect& frameRect() const { return m_frameRect; } |
64 IntRect boundsRect() const { return IntRect(0, 0, width(), height()); } | 64 IntRect boundsRect() const { return IntRect(0, 0, width(), height()); } |
65 | 65 |
66 void resize(int w, int h) { setFrameRect(IntRect(x(), y(), w, h)); } | 66 void resize(int w, int h) { setFrameRect(IntRect(x(), y(), w, h)); } |
67 void resize(const IntSize& s) { setFrameRect(IntRect(location(), s)); } | 67 void resize(const IntSize& s) { setFrameRect(IntRect(location(), s)); } |
68 | 68 |
69 virtual void paint(GraphicsContext&, const CullRect&) const { } | 69 virtual void paint(GraphicsContext&, const CullRect&) const { } |
70 void invalidate() { invalidateRect(boundsRect()); } | 70 void invalidate() { invalidateRect(boundsRect()); } |
71 virtual void invalidateRect(const IntRect&) = 0; | 71 virtual void invalidateRect(const IntRect&) = 0; |
72 | 72 |
73 virtual void setFocus(bool, WebFocusType) { } | 73 virtual void setFocus(bool, WebFocusType) { } |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 virtual IntPoint convertSelfToChild(const Widget*, const IntPoint&) const; | 117 virtual IntPoint convertSelfToChild(const Widget*, const IntPoint&) const; |
118 | 118 |
119 // Notifies this widget that it will no longer be receiving events. | 119 // Notifies this widget that it will no longer be receiving events. |
120 virtual void eventListenersRemoved() { } | 120 virtual void eventListenersRemoved() { } |
121 | 121 |
122 DECLARE_VIRTUAL_TRACE(); | 122 DECLARE_VIRTUAL_TRACE(); |
123 virtual void dispose() { } | 123 virtual void dispose() { } |
124 | 124 |
125 private: | 125 private: |
126 Member<Widget> m_parent; | 126 Member<Widget> m_parent; |
127 IntRect m_frame; | 127 IntRect m_frameRect; |
128 bool m_selfVisible; | 128 bool m_selfVisible; |
129 bool m_parentVisible; | 129 bool m_parentVisible; |
130 }; | 130 }; |
131 | 131 |
132 } // namespace blink | 132 } // namespace blink |
133 | 133 |
134 #endif // Widget_h | 134 #endif // Widget_h |
OLD | NEW |