OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_WIN_H_ | 5 #ifndef UI_GFX_RENDER_TEXT_WIN_H_ |
6 #define UI_GFX_RENDER_TEXT_WIN_H_ | 6 #define UI_GFX_RENDER_TEXT_WIN_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <usp10.h> | 9 #include <usp10.h> |
10 | 10 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 BreakType break_type) OVERRIDE; | 73 BreakType break_type) OVERRIDE; |
74 virtual SelectionModel LeftEndSelectionModel() OVERRIDE; | 74 virtual SelectionModel LeftEndSelectionModel() OVERRIDE; |
75 virtual SelectionModel RightEndSelectionModel() OVERRIDE; | 75 virtual SelectionModel RightEndSelectionModel() OVERRIDE; |
76 virtual std::vector<Rect> GetSubstringBounds(size_t from, size_t to) OVERRIDE; | 76 virtual std::vector<Rect> GetSubstringBounds(size_t from, size_t to) OVERRIDE; |
77 virtual bool IsCursorablePosition(size_t position) OVERRIDE; | 77 virtual bool IsCursorablePosition(size_t position) OVERRIDE; |
78 virtual void UpdateLayout() OVERRIDE; | 78 virtual void UpdateLayout() OVERRIDE; |
79 | 79 |
80 private: | 80 private: |
81 virtual size_t IndexOfAdjacentGrapheme(size_t index, bool next) OVERRIDE; | 81 virtual size_t IndexOfAdjacentGrapheme(size_t index, bool next) OVERRIDE; |
82 | 82 |
| 83 void EnsureLayout(); |
83 void ItemizeLogicalText(); | 84 void ItemizeLogicalText(); |
84 void LayoutVisualText(); | 85 void LayoutVisualText(); |
85 | 86 |
86 // Return the run index that contains the argument; or the length of the | 87 // Return the run index that contains the argument; or the length of the |
87 // |runs_| vector if argument exceeds the text length or width. | 88 // |runs_| vector if argument exceeds the text length or width. |
88 size_t GetRunContainingPosition(size_t position) const; | 89 size_t GetRunContainingPosition(size_t position) const; |
89 size_t GetRunContainingPoint(const Point& point) const; | 90 size_t GetRunContainingPoint(const Point& point) const; |
90 | 91 |
91 // Given a |run|, returns the SelectionModel that contains the logical first | 92 // Given a |run|, returns the SelectionModel that contains the logical first |
92 // or last caret position inside (not at a boundary of) the run. | 93 // or last caret position inside (not at a boundary of) the run. |
(...skipping 16 matching lines...) Expand all Loading... |
109 | 110 |
110 SCRIPT_CONTROL script_control_; | 111 SCRIPT_CONTROL script_control_; |
111 SCRIPT_STATE script_state_; | 112 SCRIPT_STATE script_state_; |
112 | 113 |
113 std::vector<internal::TextRun*> runs_; | 114 std::vector<internal::TextRun*> runs_; |
114 int string_width_; | 115 int string_width_; |
115 | 116 |
116 scoped_array<int> visual_to_logical_; | 117 scoped_array<int> visual_to_logical_; |
117 scoped_array<int> logical_to_visual_; | 118 scoped_array<int> logical_to_visual_; |
118 | 119 |
| 120 bool needs_layout_; |
| 121 |
119 DISALLOW_COPY_AND_ASSIGN(RenderTextWin); | 122 DISALLOW_COPY_AND_ASSIGN(RenderTextWin); |
120 }; | 123 }; |
121 | 124 |
122 } // namespace gfx | 125 } // namespace gfx |
123 | 126 |
124 #endif // UI_GFX_RENDER_TEXT_WIN_H_ | 127 #endif // UI_GFX_RENDER_TEXT_WIN_H_ |
OLD | NEW |