OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 PPAPI_CPP_DEV_FONT_DEV_H_ | 5 #ifndef PPAPI_CPP_DEV_FONT_DEV_H_ |
6 #define PPAPI_CPP_DEV_FONT_DEV_H_ | 6 #define PPAPI_CPP_DEV_FONT_DEV_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ppapi/c/dev/ppb_font_dev.h" | 10 #include "ppapi/c/dev/ppb_font_dev.h" |
11 #include "ppapi/cpp/common.h" | 11 #include "ppapi/cpp/common.h" |
dmichael (off chromium)
2011/07/07 22:37:03
here too
| |
12 #include "ppapi/cpp/resource.h" | 12 #include "ppapi/cpp/resource.h" |
13 #include "ppapi/cpp/var.h" | 13 #include "ppapi/cpp/var.h" |
14 | 14 |
15 struct PP_FontDescription_Dev; | 15 struct PP_FontDescription_Dev; |
16 | 16 |
17 namespace pp { | 17 namespace pp { |
18 | 18 |
19 class Font_dev; | 19 class Font_dev; |
20 class ImageData; | 20 class ImageData; |
21 class Instance; | 21 class Instance; |
(...skipping 22 matching lines...) Expand all Loading... | |
44 | 44 |
45 PP_FontFamily_Dev family() const { return pp_font_description_.family; } | 45 PP_FontFamily_Dev family() const { return pp_font_description_.family; } |
46 void set_family(PP_FontFamily_Dev f) { pp_font_description_.family = f; } | 46 void set_family(PP_FontFamily_Dev f) { pp_font_description_.family = f; } |
47 | 47 |
48 uint32_t size() const { return pp_font_description_.size; } | 48 uint32_t size() const { return pp_font_description_.size; } |
49 void set_size(uint32_t s) { pp_font_description_.size = s; } | 49 void set_size(uint32_t s) { pp_font_description_.size = s; } |
50 | 50 |
51 PP_FontWeight_Dev weight() const { return pp_font_description_.weight; } | 51 PP_FontWeight_Dev weight() const { return pp_font_description_.weight; } |
52 void set_weight(PP_FontWeight_Dev w) { pp_font_description_.weight = w; } | 52 void set_weight(PP_FontWeight_Dev w) { pp_font_description_.weight = w; } |
53 | 53 |
54 bool italic() const { return PPBoolToBool(pp_font_description_.italic); } | 54 bool italic() const { return PP_ToBool(pp_font_description_.italic); } |
55 void set_italic(bool i) { pp_font_description_.italic = BoolToPPBool(i); } | 55 void set_italic(bool i) { pp_font_description_.italic = PP_FromBool(i); } |
56 | 56 |
57 bool small_caps() const { | 57 bool small_caps() const { |
58 return PPBoolToBool(pp_font_description_.small_caps); | 58 return PP_ToBool(pp_font_description_.small_caps); |
59 } | 59 } |
60 void set_small_caps(bool s) { | 60 void set_small_caps(bool s) { |
61 pp_font_description_.small_caps = BoolToPPBool(s); | 61 pp_font_description_.small_caps = PP_FromBool(s); |
62 } | 62 } |
63 | 63 |
64 int letter_spacing() const { return pp_font_description_.letter_spacing; } | 64 int letter_spacing() const { return pp_font_description_.letter_spacing; } |
65 void set_letter_spacing(int s) { pp_font_description_.letter_spacing = s; } | 65 void set_letter_spacing(int s) { pp_font_description_.letter_spacing = s; } |
66 | 66 |
67 int word_spacing() const { return pp_font_description_.word_spacing; } | 67 int word_spacing() const { return pp_font_description_.word_spacing; } |
68 void set_word_spacing(int w) { pp_font_description_.word_spacing = w; } | 68 void set_word_spacing(int w) { pp_font_description_.word_spacing = w; } |
69 | 69 |
70 private: | 70 private: |
71 friend class Font_Dev; | 71 friend class Font_Dev; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
133 uint32_t color, | 133 uint32_t color, |
134 bool image_data_is_opaque = false) const; | 134 bool image_data_is_opaque = false) const; |
135 | 135 |
136 // Convenience function that assumes a left-to-right string. | 136 // Convenience function that assumes a left-to-right string. |
137 int32_t MeasureSimpleText(const std::string& text) const; | 137 int32_t MeasureSimpleText(const std::string& text) const; |
138 }; | 138 }; |
139 | 139 |
140 } // namespace pp | 140 } // namespace pp |
141 | 141 |
142 #endif // PPAPI_CPP_DEV_FONT_DEV_H_ | 142 #endif // PPAPI_CPP_DEV_FONT_DEV_H_ |
OLD | NEW |