| 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_H_ | 5 #ifndef UI_GFX_RENDER_TEXT_H_ |
| 6 #define UI_GFX_RENDER_TEXT_H_ | 6 #define UI_GFX_RENDER_TEXT_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 | 239 |
| 240 bool cursor_visible() const { return cursor_visible_; } | 240 bool cursor_visible() const { return cursor_visible_; } |
| 241 void set_cursor_visible(bool visible) { cursor_visible_ = visible; } | 241 void set_cursor_visible(bool visible) { cursor_visible_ = visible; } |
| 242 | 242 |
| 243 SkColor cursor_color() const { return cursor_color_; } | 243 SkColor cursor_color() const { return cursor_color_; } |
| 244 void set_cursor_color(SkColor color) { cursor_color_ = color; } | 244 void set_cursor_color(SkColor color) { cursor_color_ = color; } |
| 245 | 245 |
| 246 SkColor selection_color() const { return selection_color_; } | 246 SkColor selection_color() const { return selection_color_; } |
| 247 void set_selection_color(SkColor color) { selection_color_ = color; } | 247 void set_selection_color(SkColor color) { selection_color_ = color; } |
| 248 | 248 |
| 249 SkColor selection_background_focused_color() const { | 249 SkColor selection_background_color() const { |
| 250 return selection_background_focused_color_; | 250 return selection_background_color_; |
| 251 } | 251 } |
| 252 void set_selection_background_focused_color(SkColor color) { | 252 void set_selection_background_color(SkColor color) { |
| 253 selection_background_focused_color_ = color; | 253 selection_background_color_ = color; |
| 254 } | 254 } |
| 255 | 255 |
| 256 void set_draw_text_selection(bool draw) { draw_text_selection_ = draw; } |
| 257 |
| 256 bool focused() const { return focused_; } | 258 bool focused() const { return focused_; } |
| 257 void set_focused(bool focused) { focused_ = focused; } | 259 void set_focused(bool focused) { focused_ = focused; } |
| 258 | 260 |
| 259 bool clip_to_display_rect() const { return clip_to_display_rect_; } | 261 bool clip_to_display_rect() const { return clip_to_display_rect_; } |
| 260 void set_clip_to_display_rect(bool clip) { clip_to_display_rect_ = clip; } | 262 void set_clip_to_display_rect(bool clip) { clip_to_display_rect_ = clip; } |
| 261 | 263 |
| 262 // In an obscured (password) field, all text is drawn as asterisks or bullets. | 264 // In an obscured (password) field, all text is drawn as asterisks or bullets. |
| 263 bool obscured() const { return obscured_; } | 265 bool obscured() const { return obscured_; } |
| 264 void SetObscured(bool obscured); | 266 void SetObscured(bool obscured); |
| 265 | 267 |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 735 // The cursor visibility. | 737 // The cursor visibility. |
| 736 bool cursor_visible_; | 738 bool cursor_visible_; |
| 737 | 739 |
| 738 // The color used for the cursor. | 740 // The color used for the cursor. |
| 739 SkColor cursor_color_; | 741 SkColor cursor_color_; |
| 740 | 742 |
| 741 // The color used for drawing selected text. | 743 // The color used for drawing selected text. |
| 742 SkColor selection_color_; | 744 SkColor selection_color_; |
| 743 | 745 |
| 744 // The background color used for drawing the selection when focused. | 746 // The background color used for drawing the selection when focused. |
| 745 SkColor selection_background_focused_color_; | 747 SkColor selection_background_color_; |
| 748 |
| 749 // Whether to draw the selected text regardless of focus. |
| 750 bool draw_text_selection_; |
| 746 | 751 |
| 747 // The focus state of the text. | 752 // The focus state of the text. |
| 748 bool focused_; | 753 bool focused_; |
| 749 | 754 |
| 750 // Composition text range. | 755 // Composition text range. |
| 751 Range composition_range_; | 756 Range composition_range_; |
| 752 | 757 |
| 753 // Color, baseline, and style breaks, used to modify ranges of text. | 758 // Color, baseline, and style breaks, used to modify ranges of text. |
| 754 // BreakList positions are stored with text indices, not display indices. | 759 // BreakList positions are stored with text indices, not display indices. |
| 755 // TODO(msw): Expand to support cursor, selection, background, etc. colors. | 760 // TODO(msw): Expand to support cursor, selection, background, etc. colors. |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 842 // Lines computed by EnsureLayout. These should be invalidated upon | 847 // Lines computed by EnsureLayout. These should be invalidated upon |
| 843 // OnLayoutTextAttributeChanged and OnDisplayTextAttributeChanged calls. | 848 // OnLayoutTextAttributeChanged and OnDisplayTextAttributeChanged calls. |
| 844 std::vector<internal::Line> lines_; | 849 std::vector<internal::Line> lines_; |
| 845 | 850 |
| 846 DISALLOW_COPY_AND_ASSIGN(RenderText); | 851 DISALLOW_COPY_AND_ASSIGN(RenderText); |
| 847 }; | 852 }; |
| 848 | 853 |
| 849 } // namespace gfx | 854 } // namespace gfx |
| 850 | 855 |
| 851 #endif // UI_GFX_RENDER_TEXT_H_ | 856 #endif // UI_GFX_RENDER_TEXT_H_ |
| OLD | NEW |