| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 #include "core/editing/VisiblePosition.h" | 29 #include "core/editing/VisiblePosition.h" |
| 30 #include "platform/geometry/IntRect.h" | 30 #include "platform/geometry/IntRect.h" |
| 31 #include "platform/geometry/LayoutRect.h" | 31 #include "platform/geometry/LayoutRect.h" |
| 32 #include "wtf/Noncopyable.h" | 32 #include "wtf/Noncopyable.h" |
| 33 | 33 |
| 34 namespace blink { | 34 namespace blink { |
| 35 | 35 |
| 36 class LocalFrame; | 36 class LocalFrame; |
| 37 class GraphicsContext; | 37 class GraphicsContext; |
| 38 class PositionWithAffinity; |
| 38 class RenderBlock; | 39 class RenderBlock; |
| 39 class RenderView; | 40 class RenderView; |
| 40 | 41 |
| 41 class CaretBase { | 42 class CaretBase { |
| 42 WTF_MAKE_NONCOPYABLE(CaretBase); | 43 WTF_MAKE_NONCOPYABLE(CaretBase); |
| 43 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; | 44 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; |
| 44 protected: | 45 protected: |
| 45 enum CaretVisibility { Visible, Hidden }; | 46 enum CaretVisibility { Visible, Hidden }; |
| 46 explicit CaretBase(CaretVisibility = Hidden); | 47 explicit CaretBase(CaretVisibility = Hidden); |
| 47 | 48 |
| 48 void invalidateCaretRect(Node*, bool caretRectChanged = false); | 49 void invalidateCaretRect(Node*, bool caretRectChanged = false); |
| 49 void clearCaretRect(); | 50 void clearCaretRect(); |
| 51 bool updateCaretRect(Document*, const PositionWithAffinity& caretPosition); |
| 50 bool updateCaretRect(Document*, const VisiblePosition& caretPosition); | 52 bool updateCaretRect(Document*, const VisiblePosition& caretPosition); |
| 51 IntRect absoluteBoundsForLocalRect(Node*, const LayoutRect&) const; | 53 IntRect absoluteBoundsForLocalRect(Node*, const LayoutRect&) const; |
| 52 bool shouldRepaintCaret(const RenderView*, bool isContentEditable) const; | 54 bool shouldRepaintCaret(const RenderView*, bool isContentEditable) const; |
| 53 void paintCaret(Node*, GraphicsContext*, const LayoutPoint&, const LayoutRec
t& clipRect) const; | 55 void paintCaret(Node*, GraphicsContext*, const LayoutPoint&, const LayoutRec
t& clipRect) const; |
| 54 | 56 |
| 55 const LayoutRect& localCaretRectWithoutUpdate() const { return m_caretLocalR
ect; } | 57 const LayoutRect& localCaretRectWithoutUpdate() const { return m_caretLocalR
ect; } |
| 56 | 58 |
| 57 bool shouldUpdateCaretRect() const { return m_caretRectNeedsUpdate; } | 59 bool shouldUpdateCaretRect() const { return m_caretRectNeedsUpdate; } |
| 58 void setCaretRectNeedsUpdate() { m_caretRectNeedsUpdate = true; } | 60 void setCaretRectNeedsUpdate() { m_caretRectNeedsUpdate = true; } |
| 59 | 61 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 private: | 97 private: |
| 96 DragCaretController(); | 98 DragCaretController(); |
| 97 | 99 |
| 98 VisiblePosition m_position; | 100 VisiblePosition m_position; |
| 99 }; | 101 }; |
| 100 | 102 |
| 101 } // namespace blink | 103 } // namespace blink |
| 102 | 104 |
| 103 | 105 |
| 104 #endif // Caret_h | 106 #endif // Caret_h |
| OLD | NEW |