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

Unified Diff: ui/gfx/render_text.h

Issue 7458014: Implement Uniscribe RenderText for Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add simple BreakIterator support, use scoped_array, fix home/end, invalidate on toggle insert, etc. Created 9 years, 4 months 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
Index: ui/gfx/render_text.h
diff --git a/ui/gfx/render_text.h b/ui/gfx/render_text.h
index cc4f4e5f66c280b195058a20f29297a5217229a9..5ae8df8dbca050eec2ea67146c924879dfc92071 100644
--- a/ui/gfx/render_text.h
+++ b/ui/gfx/render_text.h
@@ -160,7 +160,7 @@ class UI_EXPORT RenderText {
void set_cursor_visible(bool visible) { cursor_visible_ = visible; }
bool insert_mode() const { return insert_mode_; }
- void toggle_insert_mode() { insert_mode_ = !insert_mode_; }
+ void ToggleInsertMode();
bool focused() const { return focused_; }
void set_focused(bool focused) { focused_ = focused; }
@@ -176,7 +176,7 @@ class UI_EXPORT RenderText {
// edits take place, and doesn't necessarily correspond to
// SelectionModel::caret_pos.
size_t GetCursorPosition() const;
- void SetCursorPosition(const size_t position);
+ void SetCursorPosition(size_t position);
void SetCaretPlacement(SelectionModel::CaretPlacement placement) {
selection_model_.set_caret_placement(placement);
@@ -184,16 +184,21 @@ class UI_EXPORT RenderText {
// Moves the cursor left or right. Cursor movement is visual, meaning that
// left and right are relative to screen, not the directionality of the text.
- // If |select| is false, the selection range is emptied at the new position.
+ // If |select| is false, the selection start is moved to the same position.
void MoveCursorLeft(BreakType break_type, bool select);
void MoveCursorRight(BreakType break_type, bool select);
+ // Set the cursor to |position|.
+ // If |select| is false, the selection start is moved to the same position.
+ void MoveCursorTo(size_t position, bool select);
xji 2011/08/18 22:47:54 seems that this is not used as public (and we prob
msw 2011/08/19 10:55:30 Done.
+
// Set the selection_model_ to the value of |selection|.
// Returns true if the cursor position or selection range changed.
bool MoveCursorTo(const SelectionModel& selection);
// Move the cursor to the position associated with the clicked point.
- // If |select| is false, the selection range is emptied at the new position.
+ // If |select| is false, the selection start is moved to the same position.
+ // Returns true if the cursor position or selection range changed.
bool MoveCursorTo(const Point& point, bool select);
size_t GetSelectionStart() const {

Powered by Google App Engine
This is Rietveld 408576698