OLD | NEW |
(Empty) | |
| 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 |
| 3 * found in the LICENSE file. |
| 4 */ |
| 5 #ifndef PPAPI_C_DEV_PPB_FONT_LIST_DEV_H_ |
| 6 #define PPAPI_C_DEV_PPB_FONT_LIST_DEV_H_ |
| 7 |
| 8 #include "ppapi/c/pp_completion_callback.h" |
| 9 #include "ppapi/c/pp_instance.h" |
| 10 #include "ppapi/c/pp_resource.h" |
| 11 #include "ppapi/c/pp_var.h" |
| 12 |
| 13 #define PPB_FONT_LIST_DEV_INTERFACE "PPB_FontList(Dev);0.1" |
| 14 |
| 15 struct PPB_FontList_Dev { |
| 16 /* Creates a font list resource. By default, the list will be empty, you must |
| 17 * call Initialize before calling any other functions to actually populate |
| 18 * the fonts. |
| 19 */ |
| 20 PP_Resource (*Create)(PP_Instance instance); |
| 21 |
| 22 /* Actually retrieves the fonts associated with this resource. This function |
| 23 * will complete asynchronously (it may be slow to get all of the fonts from |
| 24 * the operating system). |
| 25 */ |
| 26 int32_t (*Initialize)(PP_Resource font_list, |
| 27 struct PP_CompletionCallback completion); |
| 28 |
| 29 /* Returns the number of entries in the font list. If you call on an invalid |
| 30 * resource or a FontList that has not issued its create completion callback |
| 31 * yet, it will return 0. |
| 32 */ |
| 33 int32_t (*GetListSize)(PP_Resource font_list); |
| 34 |
| 35 /* Retrieves the font family name at the given index, returning it in a |
| 36 * string var. Valid indices are [0, GetListSize). Passing an invalid |
| 37 * resource, an out-of-range index, or a FontList that has not issued its |
| 38 * create completion callback from Initialize() yet will result in a Null var |
| 39 * being returned. |
| 40 */ |
| 41 struct PP_Var (*GetFontFaceAt)(PP_Resource font_list, int32_t index); |
| 42 }; |
| 43 |
| 44 #endif /* PPAPI_C_DEV_PPB_FONT_LIST_DEV_H_ */ |
| 45 |
OLD | NEW |