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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 DoNotRevealExtent | 54 DoNotRevealExtent |
55 }; | 55 }; |
56 | 56 |
57 class CaretBase { | 57 class CaretBase { |
58 WTF_MAKE_NONCOPYABLE(CaretBase); | 58 WTF_MAKE_NONCOPYABLE(CaretBase); |
59 WTF_MAKE_FAST_ALLOCATED; | 59 WTF_MAKE_FAST_ALLOCATED; |
60 protected: | 60 protected: |
61 enum CaretVisibility { Visible, Hidden }; | 61 enum CaretVisibility { Visible, Hidden }; |
62 explicit CaretBase(CaretVisibility = Hidden); | 62 explicit CaretBase(CaretVisibility = Hidden); |
63 | 63 |
64 void invalidateCaretRect(Node*, bool caretRectChanged = false); | 64 void invalidateCaretRect(const Position&, bool caretRectChanged = false); |
65 void clearCaretRect(); | 65 void clearCaretRect(); |
66 bool updateCaretRect(Document*, const VisiblePosition& caretPosition); | 66 bool updateCaretRect(Document*, const VisiblePosition& caretPosition); |
67 IntRect absoluteBoundsForLocalRect(Node*, const LayoutRect&) const; | 67 IntRect absoluteBoundsForLocalRect(const Position&, const LayoutRect&) const
; |
68 bool shouldRepaintCaret(const RenderView*, bool isContentEditable) const; | 68 bool shouldRepaintCaret(const RenderView*, bool isContentEditable) const; |
69 void paintCaret(Node*, GraphicsContext*, const LayoutPoint&, const LayoutRec
t& clipRect) const; | 69 void paintCaret(const Position&, GraphicsContext*, const LayoutPoint&, const
LayoutRect& clipRect) const; |
70 | 70 |
71 const LayoutRect& localCaretRectWithoutUpdate() const { return m_caretLocalR
ect; } | 71 const LayoutRect& localCaretRectWithoutUpdate() const { return m_caretLocalR
ect; } |
72 | 72 |
73 bool shouldUpdateCaretRect() const { return m_caretRectNeedsUpdate; } | 73 bool shouldUpdateCaretRect() const { return m_caretRectNeedsUpdate; } |
74 void setCaretRectNeedsUpdate() { m_caretRectNeedsUpdate = true; } | 74 void setCaretRectNeedsUpdate() { m_caretRectNeedsUpdate = true; } |
75 | 75 |
76 void setCaretVisibility(CaretVisibility visibility) { m_caretVisibility = vi
sibility; } | 76 void setCaretVisibility(CaretVisibility visibility) { m_caretVisibility = vi
sibility; } |
77 bool caretIsVisible() const { return m_caretVisibility == Visible; } | 77 bool caretIsVisible() const { return m_caretVisibility == Visible; } |
78 CaretVisibility caretVisibility() const { return m_caretVisibility; } | 78 CaretVisibility caretVisibility() const { return m_caretVisibility; } |
79 | 79 |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 bool visualWordMovementEnabled() const; | 299 bool visualWordMovementEnabled() const; |
300 | 300 |
301 Frame* m_frame; | 301 Frame* m_frame; |
302 | 302 |
303 LayoutUnit m_xPosForVerticalArrowNavigation; | 303 LayoutUnit m_xPosForVerticalArrowNavigation; |
304 | 304 |
305 VisibleSelection m_selection; | 305 VisibleSelection m_selection; |
306 VisiblePosition m_originalBase; // Used to store base before the adjustment
at bidi boundary | 306 VisiblePosition m_originalBase; // Used to store base before the adjustment
at bidi boundary |
307 TextGranularity m_granularity; | 307 TextGranularity m_granularity; |
308 | 308 |
309 RefPtr<Node> m_previousCaretNode; // The last node which painted the caret.
Retained for clearing the old caret when it moves. | 309 Position m_previousCaretPosition; // The last position which painted the car
et. Retained for clearing the old caret when it moves. |
310 | 310 |
311 RefPtr<EditingStyle> m_typingStyle; | 311 RefPtr<EditingStyle> m_typingStyle; |
312 | 312 |
313 Timer<FrameSelection> m_caretBlinkTimer; | 313 Timer<FrameSelection> m_caretBlinkTimer; |
314 // The painted bounds of the caret in absolute coordinates | 314 // The painted bounds of the caret in absolute coordinates |
315 IntRect m_absCaretBounds; | 315 IntRect m_absCaretBounds; |
316 bool m_absCaretBoundsDirty : 1; | 316 bool m_absCaretBoundsDirty : 1; |
317 bool m_caretPaint : 1; | 317 bool m_caretPaint : 1; |
318 bool m_isCaretBlinkingSuspended : 1; | 318 bool m_isCaretBlinkingSuspended : 1; |
319 bool m_focused : 1; | 319 bool m_focused : 1; |
(...skipping 16 matching lines...) Expand all Loading... |
336 } | 336 } |
337 } // namespace WebCore | 337 } // namespace WebCore |
338 | 338 |
339 #ifndef NDEBUG | 339 #ifndef NDEBUG |
340 // Outside the WebCore namespace for ease of invocation from gdb. | 340 // Outside the WebCore namespace for ease of invocation from gdb. |
341 void showTree(const WebCore::FrameSelection&); | 341 void showTree(const WebCore::FrameSelection&); |
342 void showTree(const WebCore::FrameSelection*); | 342 void showTree(const WebCore::FrameSelection*); |
343 #endif | 343 #endif |
344 | 344 |
345 #endif // FrameSelection_h | 345 #endif // FrameSelection_h |
OLD | NEW |