OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
8 #include <usp10.h> | 8 #include <usp10.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/memory/scoped_vector.h" | 15 #include "base/memory/scoped_vector.h" |
16 #include "ui/gfx/render_text.h" | 16 #include "ui/gfx/render_text.h" |
17 | 17 |
18 namespace gfx { | 18 namespace gfx { |
19 | 19 |
20 namespace internal { | 20 namespace internal { |
21 | 21 |
22 struct TextRun { | 22 struct TextRun { |
23 TextRun(); | 23 TextRun(); |
24 ~TextRun(); | 24 ~TextRun(); |
25 | 25 |
26 ui::Range range; | 26 gfx::Range range; |
27 Font font; | 27 Font font; |
28 // A gfx::Font::FontStyle flag to specify bold and italic styles. | 28 // A gfx::Font::FontStyle flag to specify bold and italic styles. |
29 // Supersedes |font.GetFontStyle()|. Stored separately to avoid calling | 29 // Supersedes |font.GetFontStyle()|. Stored separately to avoid calling |
30 // |font.DeriveFont()|, which is expensive on Windows. | 30 // |font.DeriveFont()|, which is expensive on Windows. |
31 int font_style; | 31 int font_style; |
32 | 32 |
33 bool strike; | 33 bool strike; |
34 bool diagonal_strike; | 34 bool diagonal_strike; |
35 bool underline; | 35 bool underline; |
36 | 36 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 virtual std::vector<FontSpan> GetFontSpansForTesting() OVERRIDE; | 69 virtual std::vector<FontSpan> GetFontSpansForTesting() OVERRIDE; |
70 | 70 |
71 protected: | 71 protected: |
72 // Overridden from RenderText: | 72 // Overridden from RenderText: |
73 virtual SelectionModel AdjacentCharSelectionModel( | 73 virtual SelectionModel AdjacentCharSelectionModel( |
74 const SelectionModel& selection, | 74 const SelectionModel& selection, |
75 VisualCursorDirection direction) OVERRIDE; | 75 VisualCursorDirection direction) OVERRIDE; |
76 virtual SelectionModel AdjacentWordSelectionModel( | 76 virtual SelectionModel AdjacentWordSelectionModel( |
77 const SelectionModel& selection, | 77 const SelectionModel& selection, |
78 VisualCursorDirection direction) OVERRIDE; | 78 VisualCursorDirection direction) OVERRIDE; |
79 virtual ui::Range GetGlyphBounds(size_t index) OVERRIDE; | 79 virtual gfx::Range GetGlyphBounds(size_t index) OVERRIDE; |
80 virtual std::vector<Rect> GetSubstringBounds(const ui::Range& range) OVERRIDE; | 80 virtual std::vector<Rect> GetSubstringBounds( |
| 81 const gfx::Range& range) OVERRIDE; |
81 virtual size_t TextIndexToLayoutIndex(size_t index) const OVERRIDE; | 82 virtual size_t TextIndexToLayoutIndex(size_t index) const OVERRIDE; |
82 virtual size_t LayoutIndexToTextIndex(size_t index) const OVERRIDE; | 83 virtual size_t LayoutIndexToTextIndex(size_t index) const OVERRIDE; |
83 virtual bool IsCursorablePosition(size_t position) OVERRIDE; | 84 virtual bool IsCursorablePosition(size_t position) OVERRIDE; |
84 virtual void ResetLayout() OVERRIDE; | 85 virtual void ResetLayout() OVERRIDE; |
85 virtual void EnsureLayout() OVERRIDE; | 86 virtual void EnsureLayout() OVERRIDE; |
86 virtual void DrawVisualText(Canvas* canvas) OVERRIDE; | 87 virtual void DrawVisualText(Canvas* canvas) OVERRIDE; |
87 | 88 |
88 private: | 89 private: |
89 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, Win_LogicalClusters); | 90 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, Win_LogicalClusters); |
90 | 91 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 scoped_ptr<int[]> logical_to_visual_; | 132 scoped_ptr<int[]> logical_to_visual_; |
132 | 133 |
133 bool needs_layout_; | 134 bool needs_layout_; |
134 | 135 |
135 DISALLOW_COPY_AND_ASSIGN(RenderTextWin); | 136 DISALLOW_COPY_AND_ASSIGN(RenderTextWin); |
136 }; | 137 }; |
137 | 138 |
138 } // namespace gfx | 139 } // namespace gfx |
139 | 140 |
140 #endif // UI_GFX_RENDER_TEXT_WIN_H_ | 141 #endif // UI_GFX_RENDER_TEXT_WIN_H_ |
OLD | NEW |