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 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, NewlineWithoutMultilineFlag); | 616 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, NewlineWithoutMultilineFlag); |
617 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, GlyphBounds); | 617 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, GlyphBounds); |
618 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_GlyphBounds); | 618 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_GlyphBounds); |
619 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, | 619 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, |
620 MoveCursorLeftRight_MeiryoUILigatures); | 620 MoveCursorLeftRight_MeiryoUILigatures); |
621 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, Win_LogicalClusters); | 621 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, Win_LogicalClusters); |
622 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, SameFontForParentheses); | 622 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, SameFontForParentheses); |
623 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, BreakRunsByUnicodeBlocks); | 623 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, BreakRunsByUnicodeBlocks); |
624 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, PangoAttributes); | 624 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, PangoAttributes); |
625 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, StringFitsOwnWidth); | 625 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, StringFitsOwnWidth); |
| 626 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, Mac_ElidedText); |
| 627 |
626 | 628 |
627 // Set the cursor to |position|, with the caret trailing the previous | 629 // Set the cursor to |position|, with the caret trailing the previous |
628 // grapheme, or if there is no previous grapheme, leading the cursor position. | 630 // grapheme, or if there is no previous grapheme, leading the cursor position. |
629 // If |select| is false, the selection start is moved to the same position. | 631 // If |select| is false, the selection start is moved to the same position. |
630 // If the |position| is not a cursorable position (not on grapheme boundary), | 632 // If the |position| is not a cursorable position (not on grapheme boundary), |
631 // it is a NO-OP. | 633 // it is a NO-OP. |
632 void MoveCursorTo(size_t position, bool select); | 634 void MoveCursorTo(size_t position, bool select); |
633 | 635 |
634 // Updates |layout_text_| and |display_text_| as needed (or marks them dirty). | 636 // Updates |layout_text_| and |display_text_| as needed (or marks them dirty). |
635 void OnTextAttributeChanged(); | 637 void OnTextAttributeChanged(); |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 // Lines computed by EnsureLayout. These should be invalidated upon | 780 // Lines computed by EnsureLayout. These should be invalidated upon |
779 // OnLayoutTextAttributeChanged and OnDisplayTextAttributeChanged calls. | 781 // OnLayoutTextAttributeChanged and OnDisplayTextAttributeChanged calls. |
780 std::vector<internal::Line> lines_; | 782 std::vector<internal::Line> lines_; |
781 | 783 |
782 DISALLOW_COPY_AND_ASSIGN(RenderText); | 784 DISALLOW_COPY_AND_ASSIGN(RenderText); |
783 }; | 785 }; |
784 | 786 |
785 } // namespace gfx | 787 } // namespace gfx |
786 | 788 |
787 #endif // UI_GFX_RENDER_TEXT_H_ | 789 #endif // UI_GFX_RENDER_TEXT_H_ |
OLD | NEW |