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 | 5 |
6 /* From trusted/ppb_browser_font_trusted.idl, | 6 /* From trusted/ppb_browser_font_trusted.idl, |
7 * modified Tue Feb 14 08:45:20 2012. | 7 * modified Wed Jun 27 14:43:20 2012. |
8 */ | 8 */ |
9 | 9 |
10 #ifndef PPAPI_C_TRUSTED_PPB_BROWSER_FONT_TRUSTED_H_ | 10 #ifndef PPAPI_C_TRUSTED_PPB_BROWSER_FONT_TRUSTED_H_ |
11 #define PPAPI_C_TRUSTED_PPB_BROWSER_FONT_TRUSTED_H_ | 11 #define PPAPI_C_TRUSTED_PPB_BROWSER_FONT_TRUSTED_H_ |
12 | 12 |
13 #include "ppapi/c/pp_bool.h" | 13 #include "ppapi/c/pp_bool.h" |
14 #include "ppapi/c/pp_instance.h" | 14 #include "ppapi/c/pp_instance.h" |
15 #include "ppapi/c/pp_macros.h" | 15 #include "ppapi/c/pp_macros.h" |
16 #include "ppapi/c/pp_point.h" | 16 #include "ppapi/c/pp_point.h" |
17 #include "ppapi/c/pp_rect.h" | 17 #include "ppapi/c/pp_rect.h" |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 * | 245 * |
246 * Returns -1 on failure. | 246 * Returns -1 on failure. |
247 */ | 247 */ |
248 int32_t (*MeasureText)(PP_Resource font, | 248 int32_t (*MeasureText)(PP_Resource font, |
249 const struct PP_BrowserFont_Trusted_TextRun* text); | 249 const struct PP_BrowserFont_Trusted_TextRun* text); |
250 /** | 250 /** |
251 * Returns the character at the given pixel X position from the beginning of | 251 * Returns the character at the given pixel X position from the beginning of |
252 * the string. This handles complex scripts such as Arabic, where characters | 252 * the string. This handles complex scripts such as Arabic, where characters |
253 * may be combined or replaced depending on the context. Returns (uint32)-1 | 253 * may be combined or replaced depending on the context. Returns (uint32)-1 |
254 * on failure. | 254 * on failure. |
| 255 * |
| 256 * TODO(brettw) this function may be broken. See the CharPosRTL test. It |
| 257 * seems to tell you "insertion point" rather than painting position. This |
| 258 * is useful but maybe not what we intended here. |
255 */ | 259 */ |
256 uint32_t (*CharacterOffsetForPixel)( | 260 uint32_t (*CharacterOffsetForPixel)( |
257 PP_Resource font, | 261 PP_Resource font, |
258 const struct PP_BrowserFont_Trusted_TextRun* text, | 262 const struct PP_BrowserFont_Trusted_TextRun* text, |
259 int32_t pixel_position); | 263 int32_t pixel_position); |
260 /** | 264 /** |
261 * Returns the horizontal advance to the given character if the string was | 265 * Returns the horizontal advance to the given character if the string was |
262 * placed at the given position. This handles complex scripts such as Arabic, | 266 * placed at the given position. This handles complex scripts such as Arabic, |
263 * where characters may be combined or replaced depending on context. Returns | 267 * where characters may be combined or replaced depending on context. Returns |
264 * -1 on error. | 268 * -1 on error. |
265 */ | 269 */ |
266 int32_t (*PixelOffsetForCharacter)( | 270 int32_t (*PixelOffsetForCharacter)( |
267 PP_Resource font, | 271 PP_Resource font, |
268 const struct PP_BrowserFont_Trusted_TextRun* text, | 272 const struct PP_BrowserFont_Trusted_TextRun* text, |
269 uint32_t char_offset); | 273 uint32_t char_offset); |
270 }; | 274 }; |
271 | 275 |
272 typedef struct PPB_BrowserFont_Trusted_1_0 PPB_BrowserFont_Trusted; | 276 typedef struct PPB_BrowserFont_Trusted_1_0 PPB_BrowserFont_Trusted; |
273 /** | 277 /** |
274 * @} | 278 * @} |
275 */ | 279 */ |
276 | 280 |
277 #endif /* PPAPI_C_TRUSTED_PPB_BROWSER_FONT_TRUSTED_H_ */ | 281 #endif /* PPAPI_C_TRUSTED_PPB_BROWSER_FONT_TRUSTED_H_ */ |
278 | 282 |
OLD | NEW |