Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Unified Diff: ui/gfx/render_text.h

Issue 8536047: Separate selection highlight from pango layout (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: fix an lint error Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/gfx/render_text.cc » ('j') | ui/gfx/render_text_linux.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « no previous file | ui/gfx/render_text.cc » ('j') | ui/gfx/render_text_linux.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698