| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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& frame) { m_frame = frame; } |
| 63 const IntRect& frameRect() const { return m_frame; } | 63 const IntRect& frameRect() const { return m_frame; } |
| 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 // These return false if the resize was a no-op. |
| 67 void resize(const IntSize& s) { setFrameRect(IntRect(location(), s)); } | 67 bool resize(int w, int h); |
| 68 bool resize(const IntSize&); |
| 68 | 69 |
| 69 virtual void paint(GraphicsContext&, const CullRect&) const { } | 70 virtual void paint(GraphicsContext&, const CullRect&) const { } |
| 70 void invalidate() { invalidateRect(boundsRect()); } | 71 void invalidate() { invalidateRect(boundsRect()); } |
| 71 virtual void invalidateRect(const IntRect&) = 0; | 72 virtual void invalidateRect(const IntRect&) = 0; |
| 72 | 73 |
| 73 virtual void setFocus(bool, WebFocusType) { } | 74 virtual void setFocus(bool, WebFocusType) { } |
| 74 | 75 |
| 75 virtual void show() { } | 76 virtual void show() { } |
| 76 virtual void hide() { } | 77 virtual void hide() { } |
| 77 bool isSelfVisible() const { return m_selfVisible; } // Whether or not we ha
ve been explicitly marked as visible or not. | 78 bool isSelfVisible() const { return m_selfVisible; } // Whether or not we ha
ve been explicitly marked as visible or not. |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 private: | 126 private: |
| 126 Member<Widget> m_parent; | 127 Member<Widget> m_parent; |
| 127 IntRect m_frame; | 128 IntRect m_frame; |
| 128 bool m_selfVisible; | 129 bool m_selfVisible; |
| 129 bool m_parentVisible; | 130 bool m_parentVisible; |
| 130 }; | 131 }; |
| 131 | 132 |
| 132 } // namespace blink | 133 } // namespace blink |
| 133 | 134 |
| 134 #endif // Widget_h | 135 #endif // Widget_h |
| OLD | NEW |