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 25 matching lines...) Expand all Loading... |
36 SCRIPT_ANALYSIS script_analysis; | 36 SCRIPT_ANALYSIS script_analysis; |
37 | 37 |
38 scoped_array<WORD> glyphs; | 38 scoped_array<WORD> glyphs; |
39 scoped_array<WORD> logical_clusters; | 39 scoped_array<WORD> logical_clusters; |
40 scoped_array<SCRIPT_VISATTR> visible_attributes; | 40 scoped_array<SCRIPT_VISATTR> visible_attributes; |
41 int glyph_count; | 41 int glyph_count; |
42 | 42 |
43 scoped_array<int> advance_widths; | 43 scoped_array<int> advance_widths; |
44 scoped_array<GOFFSET> offsets; | 44 scoped_array<GOFFSET> offsets; |
45 ABC abc_widths; | 45 ABC abc_widths; |
46 SCRIPT_CACHE script_cache; | |
47 | 46 |
48 private: | 47 private: |
49 DISALLOW_COPY_AND_ASSIGN(TextRun); | 48 DISALLOW_COPY_AND_ASSIGN(TextRun); |
50 }; | 49 }; |
51 | 50 |
52 } // namespace internal | 51 } // namespace internal |
53 | 52 |
54 // RenderTextWin is the Windows implementation of RenderText using Uniscribe. | 53 // RenderTextWin is the Windows implementation of RenderText using Uniscribe. |
55 class RenderTextWin : public RenderText { | 54 class RenderTextWin : public RenderText { |
56 public: | 55 public: |
(...skipping 26 matching lines...) Expand all Loading... |
83 void LayoutVisualText(); | 82 void LayoutVisualText(); |
84 | 83 |
85 // Return the run index that contains the argument; or the length of the | 84 // Return the run index that contains the argument; or the length of the |
86 // |runs_| vector if argument exceeds the text length or width. | 85 // |runs_| vector if argument exceeds the text length or width. |
87 size_t GetRunContainingPosition(size_t position) const; | 86 size_t GetRunContainingPosition(size_t position) const; |
88 size_t GetRunContainingPoint(const Point& point) const; | 87 size_t GetRunContainingPoint(const Point& point) const; |
89 | 88 |
90 // Given a |run|, returns the SelectionModel that contains the logical first | 89 // Given a |run|, returns the SelectionModel that contains the logical first |
91 // or last caret position inside (not at a boundary of) the run. | 90 // or last caret position inside (not at a boundary of) the run. |
92 // The returned value represents a cursor/caret position without a selection. | 91 // The returned value represents a cursor/caret position without a selection. |
93 SelectionModel FirstSelectionModelInsideRun(internal::TextRun* run); | 92 SelectionModel FirstSelectionModelInsideRun(internal::TextRun*); |
94 SelectionModel LastSelectionModelInsideRun(internal::TextRun* run); | 93 SelectionModel LastSelectionModelInsideRun(internal::TextRun*); |
95 | 94 |
96 // Get the selection model visually left/right of |selection| by one grapheme. | 95 // Get the selection model visually left/right of |selection| by one grapheme. |
97 // The returned value represents a cursor/caret position without a selection. | 96 // The returned value represents a cursor/caret position without a selection. |
98 SelectionModel LeftSelectionModel(const SelectionModel& selection); | 97 SelectionModel LeftSelectionModel(const SelectionModel& selection); |
99 SelectionModel RightSelectionModel(const SelectionModel& selection); | 98 SelectionModel RightSelectionModel(const SelectionModel& selection); |
100 | 99 |
101 // Draw the text, cursor, and selection. | 100 // Draw the text, cursor, and selection. |
102 void DrawSelection(Canvas* canvas); | 101 void DrawSelection(Canvas* canvas); |
103 void DrawVisualText(Canvas* canvas); | 102 void DrawVisualText(Canvas* canvas); |
104 void DrawCursor(Canvas* canvas); | 103 void DrawCursor(Canvas* canvas); |
105 | 104 |
106 bool text_is_dirty_; | 105 bool text_is_dirty_; |
107 bool style_is_dirty_; | 106 bool style_is_dirty_; |
108 | 107 |
109 // National Language Support native digit and digit substitution settings. | 108 // National Language Support native digit and digit substitution settings. |
110 SCRIPT_DIGITSUBSTITUTE digit_substitute_; | 109 SCRIPT_DIGITSUBSTITUTE digit_substitute_; |
111 | 110 |
112 SCRIPT_CONTROL script_control_; | 111 SCRIPT_CONTROL script_control_; |
113 SCRIPT_STATE script_state_; | 112 SCRIPT_STATE script_state_; |
114 | 113 |
| 114 SCRIPT_CACHE script_cache_; |
| 115 |
115 std::vector<internal::TextRun*> runs_; | 116 std::vector<internal::TextRun*> runs_; |
116 int string_width_; | 117 int string_width_; |
117 | 118 |
118 scoped_array<int> visual_to_logical_; | 119 scoped_array<int> visual_to_logical_; |
119 scoped_array<int> logical_to_visual_; | 120 scoped_array<int> logical_to_visual_; |
120 | 121 |
121 DISALLOW_COPY_AND_ASSIGN(RenderTextWin); | 122 DISALLOW_COPY_AND_ASSIGN(RenderTextWin); |
122 }; | 123 }; |
123 | 124 |
124 } // namespace gfx | 125 } // namespace gfx |
125 | 126 |
126 #endif // UI_GFX_RENDER_TEXT_WIN_H_ | 127 #endif // UI_GFX_RENDER_TEXT_WIN_H_ |
OLD | NEW |