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_LINUX_H_ | 5 #ifndef UI_GFX_RENDER_TEXT_LINUX_H_ |
6 #define UI_GFX_RENDER_TEXT_LINUX_H_ | 6 #define UI_GFX_RENDER_TEXT_LINUX_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <pango/pango.h> | 9 #include <pango/pango.h> |
10 | 10 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // The returned value represents a cursor/caret position without a selection. | 67 // The returned value represents a cursor/caret position without a selection. |
68 SelectionModel FirstSelectionModelInsideRun(const PangoItem* run) const; | 68 SelectionModel FirstSelectionModelInsideRun(const PangoItem* run) const; |
69 SelectionModel LastSelectionModelInsideRun(const PangoItem* run) const; | 69 SelectionModel LastSelectionModelInsideRun(const PangoItem* run) const; |
70 | 70 |
71 // Get the selection model visually left or right of |current| by one | 71 // Get the selection model visually left or right of |current| by one |
72 // grapheme. | 72 // grapheme. |
73 // The returned value represents a cursor/caret position without a selection. | 73 // The returned value represents a cursor/caret position without a selection. |
74 SelectionModel LeftSelectionModel(const SelectionModel& current); | 74 SelectionModel LeftSelectionModel(const SelectionModel& current); |
75 SelectionModel RightSelectionModel(const SelectionModel& current); | 75 SelectionModel RightSelectionModel(const SelectionModel& current); |
76 | 76 |
| 77 // Get the selection model visually left or right of |current| by one word. |
| 78 // The returned value represents a cursor/caret position without a selection. |
| 79 SelectionModel LeftSelectionModelByWord(const SelectionModel& current); |
| 80 SelectionModel RightSelectionModelByWord(const SelectionModel& current); |
| 81 |
77 // If |layout_| is NULL, create and setup |layout_|, retain and ref | 82 // If |layout_| is NULL, create and setup |layout_|, retain and ref |
78 // |current_line_|. Return |layout_|. | 83 // |current_line_|. Return |layout_|. |
79 PangoLayout* EnsureLayout(); | 84 PangoLayout* EnsureLayout(); |
80 | 85 |
81 // Unref |layout_| and |pango_line_|. Set them to NULL. | 86 // Unref |layout_| and |pango_line_|. Set them to NULL. |
82 void ResetLayout(); | 87 void ResetLayout(); |
83 | 88 |
84 // Setup pango attribute: foreground, background, font, strike. | 89 // Setup pango attribute: foreground, background, font, strike. |
85 void SetupPangoAttributes(PangoLayout* layout); | 90 void SetupPangoAttributes(PangoLayout* layout); |
86 | 91 |
(...skipping 28 matching lines...) Expand all Loading... |
115 const char* layout_text_; | 120 const char* layout_text_; |
116 // The text length. | 121 // The text length. |
117 size_t layout_text_len_; | 122 size_t layout_text_len_; |
118 | 123 |
119 DISALLOW_COPY_AND_ASSIGN(RenderTextLinux); | 124 DISALLOW_COPY_AND_ASSIGN(RenderTextLinux); |
120 }; | 125 }; |
121 | 126 |
122 } // namespace gfx; | 127 } // namespace gfx; |
123 | 128 |
124 #endif // UI_GFX_RENDER_TEXT_LINUX_H_ | 129 #endif // UI_GFX_RENDER_TEXT_LINUX_H_ |
OLD | NEW |