From 0f40210bffb53fe4a9fb7bcb3f594c6ad378967d Mon Sep 17 00:00:00 2001 From: "brettw@chromium.org" Date: Sat, 19 Mar 2011 06:05:08 +0000 Subject: Add an (unimplemented) API for getting the available list of font families on the system. Review URL: http://codereview.chromium.org/6708043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78817 0039d316-1c4b-4281-b951-d872f2087c98 --- ppapi/c/dev/ppb_font_list_dev.h | 45 +++++++++++++++++++++++++++++++++++++++++ ppapi/ppapi_cpp.gypi | 1 + ppapi/tests/all_c_includes.h | 1 + 3 files changed, 47 insertions(+) create mode 100644 ppapi/c/dev/ppb_font_list_dev.h (limited to 'ppapi') diff --git a/ppapi/c/dev/ppb_font_list_dev.h b/ppapi/c/dev/ppb_font_list_dev.h new file mode 100644 index 0000000..533c960 --- /dev/null +++ b/ppapi/c/dev/ppb_font_list_dev.h @@ -0,0 +1,45 @@ +/* Copyright (c) 2011 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ +#ifndef PPAPI_C_DEV_PPB_FONT_LIST_DEV_H_ +#define PPAPI_C_DEV_PPB_FONT_LIST_DEV_H_ + +#include "ppapi/c/pp_completion_callback.h" +#include "ppapi/c/pp_instance.h" +#include "ppapi/c/pp_resource.h" +#include "ppapi/c/pp_var.h" + +#define PPB_FONT_LIST_DEV_INTERFACE "PPB_FontList(Dev);0.1" + +struct PPB_FontList_Dev { + /* Creates a font list resource. By default, the list will be empty, you must + * call Initialize before calling any other functions to actually populate + * the fonts. + */ + PP_Resource (*Create)(PP_Instance instance); + + /* Actually retrieves the fonts associated with this resource. This function + * will complete asynchronously (it may be slow to get all of the fonts from + * the operating system). + */ + int32_t (*Initialize)(PP_Resource font_list, + struct PP_CompletionCallback completion); + + /* Returns the number of entries in the font list. If you call on an invalid + * resource or a FontList that has not issued its create completion callback + * yet, it will return 0. + */ + int32_t (*GetListSize)(PP_Resource font_list); + + /* Retrieves the font family name at the given index, returning it in a + * string var. Valid indices are [0, GetListSize). Passing an invalid + * resource, an out-of-range index, or a FontList that has not issued its + * create completion callback from Initialize() yet will result in a Null var + * being returned. + */ + struct PP_Var (*GetFontFaceAt)(PP_Resource font_list, int32_t index); +}; + +#endif /* PPAPI_C_DEV_PPB_FONT_LIST_DEV_H_ */ + diff --git a/ppapi/ppapi_cpp.gypi b/ppapi/ppapi_cpp.gypi index adcf01a..784bf0e 100644 --- a/ppapi/ppapi_cpp.gypi +++ b/ppapi/ppapi_cpp.gypi @@ -61,6 +61,7 @@ 'c/dev/ppb_file_system_dev.h', 'c/dev/ppb_find_dev.h', 'c/dev/ppb_font_dev.h', + 'c/dev/ppb_font_list_dev.h', 'c/dev/ppb_fullscreen_dev.h', 'c/dev/ppb_graphics_3d_dev.h', 'c/dev/ppb_opengles_dev.h', diff --git a/ppapi/tests/all_c_includes.h b/ppapi/tests/all_c_includes.h index 09ca217..bbac836 100644 --- a/ppapi/tests/all_c_includes.h +++ b/ppapi/tests/all_c_includes.h @@ -27,6 +27,7 @@ #include "ppapi/c/dev/ppb_file_system_dev.h" #include "ppapi/c/dev/ppb_find_dev.h" #include "ppapi/c/dev/ppb_font_dev.h" +#include "ppapi/c/dev/ppb_font_list_dev.h" #include "ppapi/c/dev/ppb_fullscreen_dev.h" #include "ppapi/c/dev/ppb_graphics_3d_dev.h" #include "ppapi/c/dev/ppb_opengles_dev.h" -- cgit v1.1