diff options
author | neb@chromium.org <neb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-30 17:37:54 +0000 |
---|---|---|
committer | neb@chromium.org <neb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-30 17:37:54 +0000 |
commit | 2272ed3505a36c7d1543f24b770ea85dcfee8640 (patch) | |
tree | 91bc7c2235c7d07b65f16e2b78f49382d863fb0b /ppapi/api/private | |
parent | f917b80b0878fe92ca856696af2dc47a0f5e1c55 (diff) | |
download | chromium_src-2272ed3505a36c7d1543f24b770ea85dcfee8640.zip chromium_src-2272ed3505a36c7d1543f24b770ea85dcfee8640.tar.gz chromium_src-2272ed3505a36c7d1543f24b770ea85dcfee8640.tar.bz2 |
IDL version of PPAPI interfaces.
BUG=none
TEST=none yet... soon.
Review URL: http://codereview.chromium.org/6726041
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79857 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/api/private')
-rw-r--r-- | ppapi/api/private/ppb_flash.idl | 60 | ||||
-rw-r--r-- | ppapi/api/private/ppb_flash_file.idl | 81 | ||||
-rw-r--r-- | ppapi/api/private/ppb_flash_menu.idl | 52 | ||||
-rw-r--r-- | ppapi/api/private/ppb_flash_net_connector.idl | 41 | ||||
-rw-r--r-- | ppapi/api/private/ppb_nacl_private.idl | 28 | ||||
-rw-r--r-- | ppapi/api/private/ppb_pdf.idl | 141 | ||||
-rw-r--r-- | ppapi/api/private/ppb_proxy_private.idl | 17 |
7 files changed, 420 insertions, 0 deletions
diff --git a/ppapi/api/private/ppb_flash.idl b/ppapi/api/private/ppb_flash.idl new file mode 100644 index 0000000..55a3862 --- /dev/null +++ b/ppapi/api/private/ppb_flash.idl @@ -0,0 +1,60 @@ +/* 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. + */ + +/* This file contains PPB_Flash interface. */ + +/* PPB_Flash interface. */ +interface PPB_Flash_0_7 { + /* Sets or clears the rendering hint that the given plugin instance is always + * on top of page content. Somewhat more optimized painting can be used in + * this case. + */ + void SetInstanceAlwaysOnTop( + [in] PP_Instance instance, + [in] PP_Bool on_top); + + PP_Bool DrawGlyphs( + [in] PP_Instance instance, + [in] PP_Resource pp_image_data, + [in] PP_FontDescription_Dev font_desc, + [in] uint32_t color, + [in] PP_Point position, + [in] PP_Rect clip, + [in] float_t[3][3] transformation, + [in] uint32_t glyph_count, + [in, size_is(glyph_count)] uint16_t[] glyph_indices, + [in, size_is(glyph_count)] PP_Point[] glyph_advances); + + /* Retrieves the proxy that will be used for the given URL. The result will + * be a string in PAC format, or an undefined var on error. + */ + PP_Var GetProxyForURL( + [in] PP_Instance instance, + [in] str_t url); + + /* Navigate to URL. May open a new tab if target is not "_self". Return true + * if success. This differs from javascript:window.open() in that it bypasses + * the popup blocker, even when this is not called from an event handler. + */ + PP_Bool NavigateToURL( + [in] PP_Instance instance, + [in] str_t url, + [in] str_t target); + + /* Runs a nested message loop. The plugin will be reentered from this call. + * This function is used in places where Flash would normally enter a nested + * message loop (e.g., when displaying context menus), but Pepper provides + * only an asynchronous call. After performing that asynchronous call, call + * |RunMessageLoop()|. In the callback, call |QuitMessageLoop()|. + */ + void RunMessageLoop( + [in] PP_Instance instance); + + /* Posts a quit message for the outermost nested message loop. Use this to + * exit and return back to the caller after you call RunMessageLoop. + */ + void QuitMessageLoop( + [in] PP_Instance instance); +}; diff --git a/ppapi/api/private/ppb_flash_file.idl b/ppapi/api/private/ppb_flash_file.idl new file mode 100644 index 0000000..6ad1a8a --- /dev/null +++ b/ppapi/api/private/ppb_flash_file.idl @@ -0,0 +1,81 @@ +/* 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. + */ + +/* This file contains PPB_Flash_File interface. */ + +/* A directory entry. */ +struct PP_DirEntry_Dev { + str_t name; + PP_Bool is_dir; +}; + +/* Directory. */ +struct PP_DirContents_Dev { + int32_t count; + [size_is(count)] PP_DirEntry_Dev[] entries; +}; + +/* PPB_Flash_File_ModuleLocal */ +interface PPB_Flash_File_ModuleLocal_0_1 { + /* Opens a module-local file, returning a file descriptor (posix) or a HANDLE + * (win32) into file. Module-local file paths (here and below) are + * '/'-separated UTF-8 strings, relative to a module-specific root. The return + * value is the ppapi error, PP_OK if success, one of the PP_ERROR_* in case + * of failure + */ + int32_t OpenFile( + [in] PP_Instance instance, + [in] str_t path, + [in] int32_t mode, + [out] PP_FileHandle file); + + /* Renames a module-local file. The return value is the ppapi error, PP_OK if + * success, one of the PP_ERROR_* in case of failure. + */ + int32_t RenameFile( + [in] PP_Instance instance, + [in] str_t path_from, + [in] str_t path_to); + + /* Deletes a module-local file or directory. If recursive is set and the path + * points to a directory, deletes all the contents of the directory. The + * return value is the ppapi error, PP_OK if success, one of the PP_ERROR_* in + * case of failure. + */ + int32_t DeleteFileOrDir( + [in] PP_Instance instance, + [in] str_t path, + [in] PP_Bool recursive); + + /* Creates a module-local directory. The return value is the ppapi error, + * PP_OK if success, one of the PP_ERROR_* in case of failure. + */ + int32_t CreateDir( + [in] PP_Instance instance, + [in] str_t path); + + /* Queries information about a module-local file. The return value is the + * ppapi error, PP_OK if success, one of the PP_ERROR_* in case of failure. + */ + int32_t QueryFile( + [in] PP_Instance instance, + [in] str_t path, + [out] PP_FileInfo_Dev info); + + /* Gets the list of files contained in a module-local directory. The return + * value is the ppapi error, PP_OK if success, one of the PP_ERROR_* in case + * of failure. If non-NULL, the returned contents should be freed with + * FreeDirContents. + */ + int32_t GetDirContents( + [in] PP_Instance instance, + [in] str_t path, + [out] PP_DirContents_Dev contents); + + /* Frees the data allocated by GetDirContents. */ + void FreeDirContents( + [in] PP_Instance instance, + [in] PP_DirContents_Dev contents); +}; diff --git a/ppapi/api/private/ppb_flash_menu.idl b/ppapi/api/private/ppb_flash_menu.idl new file mode 100644 index 0000000..df6aa44 --- /dev/null +++ b/ppapi/api/private/ppb_flash_menu.idl @@ -0,0 +1,52 @@ +/* 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. + */ + +/* PPB_Flash */ + +/* Menu item type. + * + * TODO(viettrungluu): Radio items not supported yet. Will also probably want + * special menu items tied to clipboard access. + */ +enum PP_Flash_MenuItem_Type { + PP_FLASH_MENUITEM_TYPE_NORMAL = 0, + PP_FLASH_MENUITEM_TYPE_CHECKBOX = 1, + PP_FLASH_MENUITEM_TYPE_SEPARATOR = 2, + PP_FLASH_MENUITEM_TYPE_SUBMENU = 3 +}; + +struct PP_Flash_MenuItem { + PP_Flash_MenuItem_Type type; + str_t name; + int32_t id; + PP_Bool enabled; + PP_Bool checked; + PP_Flash_Menu submenu; +}; + +struct PP_Flash_Menu { + uint32_t count; + [size_is(count)] PP_Flash_MenuItem[] items; +}; + +interface PPB_Flash_Menu_0_1 { + PP_Resource Create( + [in] PP_Instance instance_id, + [in] PP_Flash_Menu menu_data); + + PP_Bool IsFlashMenu( + [in] PP_Resource resource_id); + + /* Display a context menu at the given location. If the user selects an item, + * |selected_id| will be set to its |id| and the callback called with |PP_OK|. + * If the user dismisses the menu without selecting an item, + * |PP_ERROR_USERCANCEL| will be indicated. + */ + int32_t Show( + [in] PP_Resource menu_id, + [in] PP_Point location, + [out] int32_t selected_id, + [in] PP_CompletionCallback callback); +}; diff --git a/ppapi/api/private/ppb_flash_net_connector.idl b/ppapi/api/private/ppb_flash_net_connector.idl new file mode 100644 index 0000000..3886dad --- /dev/null +++ b/ppapi/api/private/ppb_flash_net_connector.idl @@ -0,0 +1,41 @@ +/* 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. + */ + +/* This is an opaque type holding a network address. */ +struct PP_Flash_NetAddress { + uint32_t size; + [fixed=128] uint8_t data; +}; + +interface PPB_Flash_NetConnector_0_1 { + PP_Resource Create( + [in] PP_Instance instance_id); + PP_Bool IsFlashNetConnector( + [in] PP_Resource resource_id); + + /* Connect to a TCP port given as a host-port pair. The local and remote + * addresses of the connection (if successful) are returned in + * |local_addr_out| and |remote_addr_out|, respectively, if non-null. + */ + int32_t ConnectTcp( + [in] PP_Resource connector_id, + [in] str_t host, + [in] uint16_t port, + [out] PP_FileHandle socket_out, + [out] PP_Flash_NetAddress local_addr_out, + [out] PP_Flash_NetAddress remote_addr_out, + [in] PP_CompletionCallback callback); + + /* Same as |ConnectTcp()|, but connecting to the address given by |addr|. A + * typical use-case would be for reconnections. + */ + int32_t ConnectTcpAddress( + [in] PP_Resource connector_id, + [in] PP_Flash_NetAddress addr, + [out] PP_FileHandle socket_out, + [out] PP_Flash_NetAddress local_addr_out, + [out] PP_Flash_NetAddress remote_addr_out, + [in] PP_CompletionCallback callback); +}; diff --git a/ppapi/api/private/ppb_nacl_private.idl b/ppapi/api/private/ppb_nacl_private.idl new file mode 100644 index 0000000..fc31dbb --- /dev/null +++ b/ppapi/api/private/ppb_nacl_private.idl @@ -0,0 +1,28 @@ +/* Copyright (c) 2010 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. + */ + +/* This file contains NaCl private interfaces. */ + +/* PPB_NaCl_Private */ +interface PPB_NaCl_Private_0_1 { + /* This function launches NaCl's sel_ldr process. On success, the function + * returns true, otherwise it returns false. When it returns true, it will + * write |socket_count| nacl::Handles to imc_handles and will write the + * nacl::Handle of the created process to |nacl_process_handle|. Finally, + * the function will write the process ID of the created process to + * |nacl_process_id|. + */ + bool LaunchSelLdr( + [in] str_t alleged_url, + [in] int32_t socket_count, + [out] mem_t imc_handles, + [out] mem_t nacl_process_handle, + [out] int32_t nacl_process_id); + + /* On POSIX systems, this function returns the file descriptor of + * /dev/urandom. On non-POSIX systems, this function returns 0. + */ + int32_t UrandomFD(); +}; diff --git a/ppapi/api/private/ppb_pdf.idl b/ppapi/api/private/ppb_pdf.idl new file mode 100644 index 0000000..3a6094f --- /dev/null +++ b/ppapi/api/private/ppb_pdf.idl @@ -0,0 +1,141 @@ +/* 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. + */ + +/* This file contains PPB_PDF interface. */ + +enum PP_ResourceString{ + PP_RESOURCESTRING_PDFGETPASSWORD = 0, + PP_RESOURCESTRING_PDFLOADING = 1, + PP_RESOURCESTRING_PDFLOAD_FAILED = 2 +}; + +enum PP_ResourceImage{ + PP_RESOURCEIMAGE_PDF_BUTTON_FTH = 0, + PP_RESOURCEIMAGE_PDF_BUTTON_FTH_HOVER = 1, + PP_RESOURCEIMAGE_PDF_BUTTON_FTH_PRESSED = 2, + PP_RESOURCEIMAGE_PDF_BUTTON_FTW = 3, + PP_RESOURCEIMAGE_PDF_BUTTON_FTW_HOVER = 4, + PP_RESOURCEIMAGE_PDF_BUTTON_FTW_PRESSED = 5, + PP_RESOURCEIMAGE_PDF_BUTTON_ZOOMIN = 6, + PP_RESOURCEIMAGE_PDF_BUTTON_ZOOMIN_HOVER = 7, + PP_RESOURCEIMAGE_PDF_BUTTON_ZOOMIN_PRESSED = 8, + PP_RESOURCEIMAGE_PDF_BUTTON_ZOOMOUT = 9, + PP_RESOURCEIMAGE_PDF_BUTTON_ZOOMOUT_HOVER = 10, + PP_RESOURCEIMAGE_PDF_BUTTON_ZOOMOUT_PRESSED = 11, + PP_RESOURCEIMAGE_PDF_BUTTON_THUMBNAIL_0 = 12, + PP_RESOURCEIMAGE_PDF_BUTTON_THUMBNAIL_1 = 13, + PP_RESOURCEIMAGE_PDF_BUTTON_THUMBNAIL_2 = 14, + PP_RESOURCEIMAGE_PDF_BUTTON_THUMBNAIL_3 = 15, + PP_RESOURCEIMAGE_PDF_BUTTON_THUMBNAIL_4 = 16, + PP_RESOURCEIMAGE_PDF_BUTTON_THUMBNAIL_5 = 17, + PP_RESOURCEIMAGE_PDF_BUTTON_THUMBNAIL_6 = 18, + PP_RESOURCEIMAGE_PDF_BUTTON_THUMBNAIL_7 = 19, + PP_RESOURCEIMAGE_PDF_BUTTON_THUMBNAIL_8 = 20, + PP_RESOURCEIMAGE_PDF_BUTTON_THUMBNAIL_9 = 21, + PP_RESOURCEIMAGE_PDF_BUTTON_THUMBNAIL_NUM_BACKGROUND = 22 +}; + +enum PP_PrivateFontCharset { + PP_PRIVATEFONTCHARSET_ANSI = 0, + PP_PRIVATEFONTCHARSET_DEFAULT = 1, + PP_PRIVATEFONTCHARSET_SYMBOL = 2, + PP_PRIVATEFONTCHARSET_MAC = 77, + PP_PRIVATEFONTCHARSET_SHIFTJIS = 128, + PP_PRIVATEFONTCHARSET_HANGUL = 129, + PP_PRIVATEFONTCHARSET_JOHAB = 130, + PP_PRIVATEFONTCHARSET_GB2312 = 134, + PP_PRIVATEFONTCHARSET_CHINESEBIG5 = 136, + PP_PRIVATEFONTCHARSET_GREEK = 161, + PP_PRIVATEFONTCHARSET_TURKISH = 162, + PP_PRIVATEFONTCHARSET_VIETNAMESE = 163, + PP_PRIVATEFONTCHARSET_HEBREW = 177, + PP_PRIVATEFONTCHARSET_ARABIC = 178, + PP_PRIVATEFONTCHARSET_BALTIC = 186, + PP_PRIVATEFONTCHARSET_RUSSIAN = 204, + PP_PRIVATEFONTCHARSET_THAI = 222, + PP_PRIVATEFONTCHARSET_EASTEUROPE = 238, + PP_PRIVATEFONTCHARSET_OEM = 255 +}; + +struct PP_PrivateFontFileDescription { + str_t face; + uint32_t weight; + PP_Bool italic; +}; + +struct PP_PrivateFindResult { + int32_t start_index; + int32_t length; +}; + +interface PPB_PDF_0_1 { + /* Returns a localized string. */ + PP_Var GetLocalizedString( + [in] PP_Instance instance, + [in] PP_ResourceString string_id); + + /* Returns a resource image. */ + PP_Resource GetResourceImage( + [in] PP_Instance instance, + [in] PP_ResourceImage image_id); + + /* Returns a resource identifying a font file corresponding to the given font + * request after applying the browser-specific fallback. + * + * Currently Linux-only. + */ + PP_Resource GetFontFileWithFallback( + [in] PP_Instance instance, + [in] PP_FontDescription_Dev description, + [in] PP_PrivateFontCharset charset); + + /* Given a resource previously returned by GetFontFileWithFallback, returns + * a pointer to the requested font table. Linux only. + */ + PP_Bool GetFontTableForPrivateFontFile( + [in] PP_Resource font_file, + [in] uint32_t table, + [out] mem_t output, + [out] uint32_t output_length); + + /* Search the given string using ICU. Use PPB_Core's MemFree on results when + * done. + */ + void SearchString( + [in] PP_Instance instance, + [in] mem_t string, + [in] mem_t term, + [in] PP_Bool case_sensitive, + [out, size_is(count)] PP_PrivateFindResult[] results, + [out] int32_t count); + + /* Since WebFrame doesn't know about PPAPI requests, it'll think the page has + * finished loading even if there are outstanding requests by the plugin. + * Take this out once WebFrame knows about requests by PPAPI plugins. + */ + void DidStartLoading( + [in] PP_Instance instance); + void DidStopLoading( + [in] PP_Instance instance); + + /* Sets content restriction for a full-page plugin (i.e. can't copy/print). + * The value is a bitfield of ContentRestriction enums. + */ + void SetContentRestriction( + [in] PP_Instance instance, + [in] int32_t restrictions); + + /* Use UMA so we know average pdf page count. */ + void HistogramPDFPageCount( + [in] int32_t count); + + /* Notifies the browser that the given action has been performed. */ + void UserMetricsRecordAction( + [in] PP_Var action); + + /* Notifies the browser that the PDF has an unsupported feature. */ + void HasUnsupportedFeature( + [in] PP_Instance instance); +}; diff --git a/ppapi/api/private/ppb_proxy_private.idl b/ppapi/api/private/ppb_proxy_private.idl new file mode 100644 index 0000000..b455636 --- /dev/null +++ b/ppapi/api/private/ppb_proxy_private.idl @@ -0,0 +1,17 @@ +/* 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. + */ + +/* Exposes functions needed by the out-of-process proxy to call into the + * renderer PPAPI implementation. + */ +interface PPB_Proxy_Private_0_2 { + /* Called when the given plugin process has crashed. */ + void PluginCrashed( + [in] PP_Module module); + + /* Returns the instance for the given resource, or 0 on failure. */ + PP_Instance GetInstanceForResource( + [in] PP_Resource resource); +}; |