| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 66 |
| 67 void resize(int w, int h) { setFrameRect(IntRect(x(), y(), w, h)); } | 67 void resize(int w, int h) { setFrameRect(IntRect(x(), y(), w, h)); } |
| 68 void resize(const IntSize& s) { setFrameRect(IntRect(location(), s)); } | 68 void resize(const IntSize& s) { setFrameRect(IntRect(location(), s)); } |
| 69 void move(int x, int y) { setFrameRect(IntRect(x, y, width(), height())); } | 69 void move(int x, int y) { setFrameRect(IntRect(x, y, width(), height())); } |
| 70 void move(const IntPoint& p) { setFrameRect(IntRect(p, size())); } | 70 void move(const IntPoint& p) { setFrameRect(IntRect(p, size())); } |
| 71 | 71 |
| 72 virtual void paint(GraphicsContext*, const IntRect&) { } | 72 virtual void paint(GraphicsContext*, const IntRect&) { } |
| 73 void invalidate() { invalidateRect(boundsRect()); } | 73 void invalidate() { invalidateRect(boundsRect()); } |
| 74 virtual void invalidateRect(const IntRect&) = 0; | 74 virtual void invalidateRect(const IntRect&) = 0; |
| 75 | 75 |
| 76 virtual void setFocus(bool) { } | |
| 77 | |
| 78 virtual void show() { } | |
| 79 virtual void hide() { } | |
| 80 bool isSelfVisible() const { return m_selfVisible; } // Whether or not we ha
ve been explicitly marked as visible or not. | 76 bool isSelfVisible() const { return m_selfVisible; } // Whether or not we ha
ve been explicitly marked as visible or not. |
| 81 bool isParentVisible() const { return m_parentVisible; } // Whether or not o
ur parent is visible. | 77 bool isParentVisible() const { return m_parentVisible; } // Whether or not o
ur parent is visible. |
| 82 bool isVisible() const { return m_selfVisible && m_parentVisible; } // Wheth
er or not we are actually visible. | 78 bool isVisible() const { return m_selfVisible && m_parentVisible; } // Wheth
er or not we are actually visible. |
| 83 virtual void setParentVisible(bool visible) { m_parentVisible = visible; } | 79 virtual void setParentVisible(bool visible) { m_parentVisible = visible; } |
| 84 void setSelfVisible(bool v) { m_selfVisible = v; } | 80 void setSelfVisible(bool v) { m_selfVisible = v; } |
| 85 | 81 |
| 86 virtual bool isFrameView() const { return false; } | 82 virtual bool isFrameView() const { return false; } |
| 87 virtual bool isScrollbar() const { return false; } | 83 virtual bool isScrollbar() const { return false; } |
| 88 virtual bool isScrollView() const { return false; } | 84 virtual bool isScrollView() const { return false; } |
| 89 | 85 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 104 // that tries to convert the location of a rect using the point-based conver
tFromContainingWindow will end | 100 // that tries to convert the location of a rect using the point-based conver
tFromContainingWindow will end |
| 105 // up with an inaccurate rect. Always make sure to use the rect-based conver
tFromContainingWindow method | 101 // up with an inaccurate rect. Always make sure to use the rect-based conver
tFromContainingWindow method |
| 106 // when converting window rects. | 102 // when converting window rects. |
| 107 IntRect convertToContainingWindow(const IntRect&) const; | 103 IntRect convertToContainingWindow(const IntRect&) const; |
| 108 IntRect convertFromContainingWindow(const IntRect&) const; | 104 IntRect convertFromContainingWindow(const IntRect&) const; |
| 109 | 105 |
| 110 IntPoint convertToContainingWindow(const IntPoint&) const; | 106 IntPoint convertToContainingWindow(const IntPoint&) const; |
| 111 IntPoint convertFromContainingWindow(const IntPoint&) const; | 107 IntPoint convertFromContainingWindow(const IntPoint&) const; |
| 112 FloatPoint convertFromContainingWindow(const FloatPoint&) const; | 108 FloatPoint convertFromContainingWindow(const FloatPoint&) const; |
| 113 | 109 |
| 114 virtual void frameRectsChanged() { } | |
| 115 | |
| 116 // Notifies this widget that other widgets on the page have been repositione
d. | |
| 117 virtual void widgetPositionsUpdated() { } | |
| 118 | |
| 119 // Virtual methods to convert points to/from the containing ScrollView | 110 // Virtual methods to convert points to/from the containing ScrollView |
| 120 virtual IntRect convertToContainingView(const IntRect&) const; | 111 virtual IntRect convertToContainingView(const IntRect&) const; |
| 121 virtual IntRect convertFromContainingView(const IntRect&) const; | 112 virtual IntRect convertFromContainingView(const IntRect&) const; |
| 122 virtual IntPoint convertToContainingView(const IntPoint&) const; | 113 virtual IntPoint convertToContainingView(const IntPoint&) const; |
| 123 virtual IntPoint convertFromContainingView(const IntPoint&) const; | 114 virtual IntPoint convertFromContainingView(const IntPoint&) const; |
| 124 | 115 |
| 125 // Virtual methods to convert points to/from child widgets | 116 // Virtual methods to convert points to/from child widgets |
| 126 virtual IntPoint convertChildToSelf(const Widget*, const IntPoint&) const; | 117 virtual IntPoint convertChildToSelf(const Widget*, const IntPoint&) const; |
| 127 virtual IntPoint convertSelfToChild(const Widget*, const IntPoint&) const; | 118 virtual IntPoint convertSelfToChild(const Widget*, const IntPoint&) const; |
| 128 | 119 |
| 129 // Notifies this widget that it will no longer be receiving events. | |
| 130 virtual void eventListenersRemoved() { } | |
| 131 | |
| 132 #if ENABLE(OILPAN) | |
| 133 virtual void detach() { } | |
| 134 #endif | |
| 135 | |
| 136 private: | 120 private: |
| 137 Widget* m_parent; | 121 Widget* m_parent; |
| 138 IntRect m_frame; | 122 IntRect m_frame; |
| 139 bool m_selfVisible; | 123 bool m_selfVisible; |
| 140 bool m_parentVisible; | 124 bool m_parentVisible; |
| 141 }; | 125 }; |
| 142 | 126 |
| 143 } // namespace blink | 127 } // namespace blink |
| 144 | 128 |
| 145 #endif // Widget_h | 129 #endif // Widget_h |
| OLD | NEW |