Chromium Code Reviews| 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" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 104 // Creates an is_null() Font object. | 104 // Creates an is_null() Font object. |
| 105 Font_Dev(); | 105 Font_Dev(); |
| 106 | 106 |
| 107 explicit Font_Dev(PP_Resource resource); | 107 explicit Font_Dev(PP_Resource resource); |
| 108 explicit Font_Dev(Instance* instance, const FontDescription_Dev& description); | 108 explicit Font_Dev(Instance* instance, const FontDescription_Dev& description); |
| 109 Font_Dev(const Font_Dev& other); | 109 Font_Dev(const Font_Dev& other); |
| 110 | 110 |
| 111 Font_Dev& operator=(const Font_Dev& other); | 111 Font_Dev& operator=(const Font_Dev& other); |
| 112 | 112 |
| 113 // PPB_Font methods: | 113 // PPB_Font methods: |
| 114 static Var GetFontFamilies(Instance* instance); | |
|
viettrungluu
2011/05/18 21:07:46
I don't suppose you could write a version which ju
brettw
2011/05/18 21:14:38
I thought about that. I really wanted to rewrite t
| |
| 114 bool Describe(FontDescription_Dev* description, | 115 bool Describe(FontDescription_Dev* description, |
| 115 PP_FontMetrics_Dev* metrics) const; | 116 PP_FontMetrics_Dev* metrics) const; |
| 116 bool DrawTextAt(ImageData* dest, | 117 bool DrawTextAt(ImageData* dest, |
| 117 const TextRun_Dev& text, | 118 const TextRun_Dev& text, |
| 118 const Point& position, | 119 const Point& position, |
| 119 uint32_t color, | 120 uint32_t color, |
| 120 const Rect& clip, | 121 const Rect& clip, |
| 121 bool image_data_is_opaque) const; | 122 bool image_data_is_opaque) const; |
| 122 int32_t MeasureText(const TextRun_Dev& text) const; | 123 int32_t MeasureText(const TextRun_Dev& text) const; |
| 123 uint32_t CharacterOffsetForPixel(const TextRun_Dev& text, | 124 uint32_t CharacterOffsetForPixel(const TextRun_Dev& text, |
| 124 int32_t pixel_position) const; | 125 int32_t pixel_position) const; |
| 125 int32_t PixelOffsetForCharacter(const TextRun_Dev& text, | 126 int32_t PixelOffsetForCharacter(const TextRun_Dev& text, |
| 126 uint32_t char_offset) const; | 127 uint32_t char_offset) const; |
| 127 | 128 |
| 128 // Convenience function that assumes a left-to-right string with no clipping. | 129 // Convenience function that assumes a left-to-right string with no clipping. |
| 129 bool DrawSimpleText(ImageData* dest, | 130 bool DrawSimpleText(ImageData* dest, |
| 130 const std::string& text, | 131 const std::string& text, |
| 131 const Point& position, | 132 const Point& position, |
| 132 uint32_t color, | 133 uint32_t color, |
| 133 bool image_data_is_opaque = false) const; | 134 bool image_data_is_opaque = false) const; |
| 134 | 135 |
| 135 // Convenience function that assumes a left-to-right string. | 136 // Convenience function that assumes a left-to-right string. |
| 136 int32_t MeasureSimpleText(const std::string& text) const; | 137 int32_t MeasureSimpleText(const std::string& text) const; |
| 137 }; | 138 }; |
| 138 | 139 |
| 139 } // namespace pp | 140 } // namespace pp |
| 140 | 141 |
| 141 #endif // PPAPI_CPP_DEV_FONT_DEV_H_ | 142 #endif // PPAPI_CPP_DEV_FONT_DEV_H_ |
| OLD | NEW |