| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 void move(const IntPoint& p) { setFrameRect(IntRect(p, size())); } | 63 void move(const IntPoint& p) { setFrameRect(IntRect(p, size())); } |
| 64 | 64 |
| 65 virtual void paint(GraphicsContext*, const IntRect&) { } | 65 virtual void paint(GraphicsContext*, const IntRect&) { } |
| 66 void invalidate() { invalidateRect(boundsRect()); } | 66 void invalidate() { invalidateRect(boundsRect()); } |
| 67 virtual void invalidateRect(const IntRect&) = 0; | 67 virtual void invalidateRect(const IntRect&) = 0; |
| 68 | 68 |
| 69 virtual bool isFrameView() const { return false; } | 69 virtual bool isFrameView() const { return false; } |
| 70 virtual bool isScrollbar() const { return false; } | 70 virtual bool isScrollbar() const { return false; } |
| 71 | 71 |
| 72 virtual HostWindow* hostWindow() const { ASSERT_NOT_REACHED(); return 0; } | 72 virtual HostWindow* hostWindow() const { ASSERT_NOT_REACHED(); return 0; } |
| 73 void setParent(Widget* parent) { m_parent = parent; } | |
| 74 Widget* parent() const { return m_parent; } | 73 Widget* parent() const { return m_parent; } |
| 75 Widget* root() const; | 74 Widget* root() const; |
| 76 | 75 |
| 77 IntRect convertToRootView(const IntRect&) const; | |
| 78 IntRect convertFromRootView(const IntRect&) const; | |
| 79 | |
| 80 IntPoint convertToRootView(const IntPoint&) const; | |
| 81 IntPoint convertFromRootView(const IntPoint&) const; | |
| 82 | |
| 83 // It is important for cross-platform code to realize that Mac has flipped c
oordinates. Therefore any code | |
| 84 // that tries to convert the location of a rect using the point-based conver
tFromContainingWindow will end | |
| 85 // up with an inaccurate rect. Always make sure to use the rect-based conver
tFromContainingWindow method | |
| 86 // when converting window rects. | |
| 87 IntRect convertToContainingWindow(const IntRect&) const; | |
| 88 IntRect convertFromContainingWindow(const IntRect&) const; | |
| 89 | |
| 90 IntPoint convertToContainingWindow(const IntPoint&) const; | |
| 91 IntPoint convertFromContainingWindow(const IntPoint&) const; | |
| 92 FloatPoint convertFromContainingWindow(const FloatPoint&) const; | |
| 93 | |
| 94 // Virtual methods to convert points to/from the containing ScrollView | 76 // Virtual methods to convert points to/from the containing ScrollView |
| 95 virtual IntRect convertToContainingView(const IntRect&) const; | 77 virtual IntRect convertToContainingView(const IntRect& localRect) const { re
turn localRect; } |
| 96 virtual IntRect convertFromContainingView(const IntRect&) const; | 78 virtual IntRect convertFromContainingView(const IntRect& localRect) const {
return localRect; } |
| 97 virtual IntPoint convertToContainingView(const IntPoint&) const; | 79 virtual IntPoint convertToContainingView(const IntPoint& localPoint) const
{ return localPoint; } |
| 98 virtual IntPoint convertFromContainingView(const IntPoint&) const; | 80 virtual IntPoint convertFromContainingView(const IntPoint& localPoint) const
{ return localPoint; } |
| 99 | 81 |
| 100 private: | 82 private: |
| 101 Widget* m_parent; | 83 Widget* m_parent; |
| 102 IntRect m_frame; | 84 IntRect m_frame; |
| 103 }; | 85 }; |
| 104 | 86 |
| 105 } // namespace blink | 87 } // namespace blink |
| 106 | 88 |
| 107 #endif // Widget_h | 89 #endif // Widget_h |
| OLD | NEW |