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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 // The returned value represents a cursor/caret position without a selection. | 61 // The returned value represents a cursor/caret position without a selection. |
62 SelectionModel FirstSelectionModelInsideRun(const PangoItem* run) const; | 62 SelectionModel FirstSelectionModelInsideRun(const PangoItem* run) const; |
63 SelectionModel LastSelectionModelInsideRun(const PangoItem* run) const; | 63 SelectionModel LastSelectionModelInsideRun(const PangoItem* run) const; |
64 | 64 |
65 // Get the selection model visually left or right of |current| by one | 65 // Get the selection model visually left or right of |current| by one |
66 // grapheme. | 66 // grapheme. |
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 LeftSelectionModel(const SelectionModel& current); | 68 SelectionModel LeftSelectionModel(const SelectionModel& current); |
69 SelectionModel RightSelectionModel(const SelectionModel& current); | 69 SelectionModel RightSelectionModel(const SelectionModel& current); |
70 | 70 |
| 71 // Get the selection model visually left or right of |current| by one word. |
| 72 // The returned value represents a cursor/caret position without a selection. |
| 73 SelectionModel LeftSelectionModelByWord(const SelectionModel& current); |
| 74 SelectionModel RightSelectionModelByWord(const SelectionModel& current); |
| 75 |
71 // If |layout_| is NULL, create and setup |layout_|, retain and ref | 76 // If |layout_| is NULL, create and setup |layout_|, retain and ref |
72 // |current_line_|. Return |layout_|. | 77 // |current_line_|. Return |layout_|. |
73 PangoLayout* EnsureLayout(); | 78 PangoLayout* EnsureLayout(); |
74 | 79 |
75 // Unref |layout_| and |pango_line_|. Set them to NULL. | 80 // Unref |layout_| and |pango_line_|. Set them to NULL. |
76 void ResetLayout(); | 81 void ResetLayout(); |
77 | 82 |
78 // Setup pango attribute: foreground, background, font, strike. | 83 // Setup pango attribute: foreground, background, font, strike. |
79 void SetupPangoAttributes(PangoLayout* layout); | 84 void SetupPangoAttributes(PangoLayout* layout); |
80 | 85 |
(...skipping 28 matching lines...) Expand all Loading... |
109 const char* layout_text_; | 114 const char* layout_text_; |
110 // The text length. | 115 // The text length. |
111 size_t layout_text_len_; | 116 size_t layout_text_len_; |
112 | 117 |
113 DISALLOW_COPY_AND_ASSIGN(RenderTextLinux); | 118 DISALLOW_COPY_AND_ASSIGN(RenderTextLinux); |
114 }; | 119 }; |
115 | 120 |
116 } // namespace gfx; | 121 } // namespace gfx; |
117 | 122 |
118 #endif // UI_GFX_RENDER_TEXT_LINUX_H_ | 123 #endif // UI_GFX_RENDER_TEXT_LINUX_H_ |
OLD | NEW |