| 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>); | |
| 36 | 35 |
| 36 void updateOnWidgetChange(); |
| 37 void updateWidgetPosition(); | 37 void updateWidgetPosition(); |
| 38 void widgetPositionsUpdated(); | 38 void widgetPositionsUpdated(); |
| 39 | 39 |
| 40 void setIsOverlapped(bool); | 40 void setIsOverlapped(bool); |
| 41 | 41 |
| 42 void ref() { ++m_refCount; } | 42 void ref() { ++m_refCount; } |
| 43 void deref(); | 43 void deref(); |
| 44 | 44 |
| 45 class UpdateSuspendScope { | 45 FrameView* frameView() const { return m_frameView; } |
| 46 public: | 46 |
| 47 UpdateSuspendScope(); | 47 virtual bool isWidget() const OVERRIDE FINAL { return true; } |
| 48 ~UpdateSuspendScope(); | 48 bool updateWidgetGeometry(); |
| 49 }; | |
| 50 | 49 |
| 51 protected: | 50 protected: |
| 52 explicit RenderWidget(Element*); | 51 explicit RenderWidget(Element*); |
| 53 | 52 |
| 54 void clearWidget(); | |
| 55 | |
| 56 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OV
ERRIDE FINAL; | 53 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OV
ERRIDE FINAL; |
| 57 virtual void layout(); | 54 virtual void layout(); |
| 58 virtual void paint(PaintInfo&, const LayoutPoint&); | 55 virtual void paint(PaintInfo&, const LayoutPoint&); |
| 59 virtual CursorDirective getCursor(const LayoutPoint&, Cursor&) const; | 56 virtual CursorDirective getCursor(const LayoutPoint&, Cursor&) const; |
| 60 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes
tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct
ion) OVERRIDE; | 57 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes
tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct
ion) OVERRIDE; |
| 61 | 58 |
| 62 virtual void paintContents(PaintInfo&, const LayoutPoint&); | 59 virtual void paintContents(PaintInfo&, const LayoutPoint&); |
| 63 | 60 |
| 64 private: | 61 private: |
| 65 virtual bool isWidget() const OVERRIDE FINAL { return true; } | |
| 66 | |
| 67 virtual void willBeDestroyed() OVERRIDE FINAL; | 62 virtual void willBeDestroyed() OVERRIDE FINAL; |
| 68 virtual void destroy() OVERRIDE FINAL; | 63 virtual void destroy() OVERRIDE FINAL; |
| 69 | 64 |
| 70 bool setWidgetGeometry(const LayoutRect&); | 65 bool setWidgetGeometry(const LayoutRect&); |
| 71 bool updateWidgetGeometry(); | |
| 72 | 66 |
| 73 RefPtr<Widget> m_widget; | |
| 74 FrameView* m_frameView; | 67 FrameView* m_frameView; |
| 75 IntRect m_clipRect; // The rectangle needs to remain correct after scrolling
, so it is stored in content view coordinates, and not clipped to window. | 68 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 int m_refCount; | 69 int m_refCount; |
| 77 }; | 70 }; |
| 78 | 71 |
| 79 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderWidget, isWidget()); | 72 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderWidget, isWidget()); |
| 80 | 73 |
| 81 } // namespace WebCore | 74 } // namespace WebCore |
| 82 | 75 |
| 83 #endif // RenderWidget_h | 76 #endif // RenderWidget_h |
| OLD | NEW |