Chromium Code Reviews| Index: ui/gfx/render_text.h |
| =================================================================== |
| --- ui/gfx/render_text.h (revision 109708) |
| +++ ui/gfx/render_text.h (working copy) |
| @@ -209,17 +209,16 @@ |
| virtual SelectionModel LeftEndSelectionModel(); |
| virtual SelectionModel RightEndSelectionModel(); |
| - // Get the logical index of the grapheme preceeding the argument |position|. |
| - virtual size_t GetIndexOfPreviousGrapheme(size_t position); |
| - |
| // Get the visual bounds containing the logical substring within |from| to |
| // |to|. These bounds could be visually discontinuous if the substring is |
| // split by a LTR/RTL level change. These bounds are in local coordinates, but |
| // may be outside the visible region if the text is longer than the textfield. |
| // Subsequent text, cursor, or bounds changes may invalidate returned values. |
| - // TODO(msw) Re-evaluate this function's necessity and signature. |
| virtual std::vector<Rect> GetSubstringBounds(size_t from, size_t to); |
|
Alexei Svitkine (slow)
2011/11/28 19:56:14
Maybe change the signature of this to:
virtual vo
xji
2011/11/29 01:37:02
Changed.
It is generally true that changing the si
|
| + // Sets the selection model, the argument is assumed to be valid. |
| + virtual void SetSelectionModel(const SelectionModel& selection_model); |
| + |
| // Return true if cursor can appear in front of the character at |position|, |
| // which means it is a grapheme boundary or the first character in the text. |
| virtual bool IsCursorablePosition(size_t position) = 0; |
| @@ -228,6 +227,12 @@ |
| // render the text and its attributes. |
| virtual void UpdateLayout() = 0; |
| + // Draw the text. |
| + virtual void DrawVisualText(Canvas* canvas) = 0; |
| + |
| + // Get the logical index of the grapheme preceding the argument |position|. |
| + size_t GetIndexOfPreviousGrapheme(size_t position); |
| + |
| // Apply composition style (underline) to composition range and selection |
| // style (foreground) to selection range. |
| void ApplyCompositionAndSelectionStyles(StyleRanges* style_ranges) const; |
| @@ -249,9 +254,6 @@ |
| // The return value is bounded by 0 and the text length, inclusive. |
| virtual size_t IndexOfAdjacentGrapheme(size_t index, bool next) = 0; |
| - // Sets the selection model, the argument is assumed to be valid. |
| - void SetSelectionModel(const SelectionModel& selection_model); |
| - |
| // Set the cursor to |position|, with the caret trailing the previous |
| // grapheme, or if there is no previous grapheme, leading the cursor position. |
| // If |select| is false, the selection start is moved to the same position. |
| @@ -263,6 +265,10 @@ |
| // cursor is within the visible display area. |
| void UpdateCachedBoundsAndOffset(); |
| + // Draw the selection and cursor. |
| + void DrawSelection(Canvas* canvas); |
| + void DrawCursor(Canvas* canvas); |
| + |
| // Logical UTF-16 string data to be drawn. |
| string16 text_; |