OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2004, 2005, 2006, 2009, 2010 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2009, 2010 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 #include "core/rendering/RenderReplaced.h" | 25 #include "core/rendering/RenderReplaced.h" |
26 #include "platform/Widget.h" | 26 #include "platform/Widget.h" |
27 | 27 |
28 namespace WebCore { | 28 namespace WebCore { |
29 | 29 |
30 class RenderWidget : public RenderReplaced { | 30 class RenderWidget : public RenderReplaced { |
31 public: | 31 public: |
32 virtual ~RenderWidget(); | 32 virtual ~RenderWidget(); |
33 | 33 |
34 Widget* widget() const { return m_widget.get(); } | 34 Widget* widget() const; |
35 virtual void setWidget(PassRefPtr<Widget>); | 35 virtual void attachWidget(Widget*); |
| 36 virtual void detachWidget(Widget*); |
36 | 37 |
37 void updateWidgetPosition(); | 38 void updateWidgetPosition(); |
38 void widgetPositionsUpdated(); | 39 void widgetPositionsUpdated(); |
39 IntRect windowClipRect() const; | 40 IntRect windowClipRect() const; |
40 | 41 |
41 void setIsOverlapped(bool); | 42 void setIsOverlapped(bool); |
42 | 43 |
43 void ref() { ++m_refCount; } | 44 void ref() { ++m_refCount; } |
44 void deref(); | 45 void deref(); |
45 | 46 |
46 class UpdateSuspendScope { | 47 class UpdateSuspendScope { |
47 public: | 48 public: |
48 UpdateSuspendScope(); | 49 UpdateSuspendScope(); |
49 ~UpdateSuspendScope(); | 50 ~UpdateSuspendScope(); |
50 }; | 51 }; |
51 | 52 |
52 protected: | 53 protected: |
53 RenderWidget(Element*); | 54 RenderWidget(Element*); |
54 | 55 |
55 FrameView* frameView() const { return m_frameView; } | 56 FrameView* frameView() const { return m_frameView; } |
56 | 57 |
57 void clearWidget(); | |
58 | |
59 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OV
ERRIDE FINAL; | 58 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OV
ERRIDE FINAL; |
60 virtual void layout(); | 59 virtual void layout(); |
61 virtual void paint(PaintInfo&, const LayoutPoint&); | 60 virtual void paint(PaintInfo&, const LayoutPoint&); |
62 virtual CursorDirective getCursor(const LayoutPoint&, Cursor&) const; | 61 virtual CursorDirective getCursor(const LayoutPoint&, Cursor&) const; |
63 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes
tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct
ion) OVERRIDE; | 62 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes
tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct
ion) OVERRIDE; |
64 | 63 |
65 virtual void paintContents(PaintInfo&, const LayoutPoint&); | 64 virtual void paintContents(PaintInfo&, const LayoutPoint&); |
66 | 65 |
67 private: | 66 private: |
68 virtual bool isWidget() const OVERRIDE FINAL { return true; } | 67 virtual bool isWidget() const OVERRIDE FINAL { return true; } |
69 | 68 |
70 virtual void willBeDestroyed() OVERRIDE FINAL; | 69 virtual void willBeDestroyed() OVERRIDE FINAL; |
71 virtual void destroy() OVERRIDE FINAL; | 70 virtual void destroy() OVERRIDE FINAL; |
72 | 71 |
73 bool setWidgetGeometry(const LayoutRect&); | 72 bool setWidgetGeometry(const LayoutRect&); |
74 bool updateWidgetGeometry(); | 73 bool updateWidgetGeometry(); |
75 | 74 |
76 RefPtr<Widget> m_widget; | |
77 FrameView* m_frameView; | 75 FrameView* m_frameView; |
78 IntRect m_clipRect; // The rectangle needs to remain correct after scrolling
, so it is stored in content view coordinates, and not clipped to window. | 76 IntRect m_clipRect; // The rectangle needs to remain correct after scrolling
, so it is stored in content view coordinates, and not clipped to window. |
79 int m_refCount; | 77 int m_refCount; |
80 }; | 78 }; |
81 | 79 |
82 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderWidget, isWidget()); | 80 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderWidget, isWidget()); |
83 | 81 |
84 } // namespace WebCore | 82 } // namespace WebCore |
85 | 83 |
86 #endif // RenderWidget_h | 84 #endif // RenderWidget_h |
OLD | NEW |