| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_GFX_RENDER_TEXT_H_ | 5 #ifndef UI_GFX_RENDER_TEXT_H_ |
| 6 #define UI_GFX_RENDER_TEXT_H_ | 6 #define UI_GFX_RENDER_TEXT_H_ |
| 7 | 7 |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <cstring> | 9 #include <cstring> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, GlyphBounds); | 583 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, GlyphBounds); |
| 584 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_GlyphBounds); | 584 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_GlyphBounds); |
| 585 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, | 585 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, |
| 586 MoveCursorLeftRight_MeiryoUILigatures); | 586 MoveCursorLeftRight_MeiryoUILigatures); |
| 587 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, Win_LogicalClusters); | 587 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, Win_LogicalClusters); |
| 588 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, SameFontForParentheses); | 588 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, SameFontForParentheses); |
| 589 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, BreakRunsByUnicodeBlocks); | 589 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, BreakRunsByUnicodeBlocks); |
| 590 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, PangoAttributes); | 590 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, PangoAttributes); |
| 591 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, StringFitsOwnWidth); | 591 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, StringFitsOwnWidth); |
| 592 | 592 |
| 593 // Creates a platform-specific RenderText instance. | |
| 594 static RenderText* CreateNativeInstance(); | |
| 595 | |
| 596 // Set the cursor to |position|, with the caret trailing the previous | 593 // Set the cursor to |position|, with the caret trailing the previous |
| 597 // grapheme, or if there is no previous grapheme, leading the cursor position. | 594 // grapheme, or if there is no previous grapheme, leading the cursor position. |
| 598 // If |select| is false, the selection start is moved to the same position. | 595 // If |select| is false, the selection start is moved to the same position. |
| 599 // If the |position| is not a cursorable position (not on grapheme boundary), | 596 // If the |position| is not a cursorable position (not on grapheme boundary), |
| 600 // it is a NO-OP. | 597 // it is a NO-OP. |
| 601 void MoveCursorTo(size_t position, bool select); | 598 void MoveCursorTo(size_t position, bool select); |
| 602 | 599 |
| 603 // Updates |layout_text_| if the text is obscured or truncated. | 600 // Updates |layout_text_| if the text is obscured or truncated. |
| 604 void UpdateLayoutText(); | 601 void UpdateLayoutText(); |
| 605 | 602 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 // Lines computed by EnsureLayout. These should be invalidated with | 727 // Lines computed by EnsureLayout. These should be invalidated with |
| 731 // ResetLayout and on |display_rect_| changes. | 728 // ResetLayout and on |display_rect_| changes. |
| 732 std::vector<internal::Line> lines_; | 729 std::vector<internal::Line> lines_; |
| 733 | 730 |
| 734 DISALLOW_COPY_AND_ASSIGN(RenderText); | 731 DISALLOW_COPY_AND_ASSIGN(RenderText); |
| 735 }; | 732 }; |
| 736 | 733 |
| 737 } // namespace gfx | 734 } // namespace gfx |
| 738 | 735 |
| 739 #endif // UI_GFX_RENDER_TEXT_H_ | 736 #endif // UI_GFX_RENDER_TEXT_H_ |
| OLD | NEW |