diff options
author | jvoung@google.com <jvoung@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-18 22:53:04 +0000 |
---|---|---|
committer | jvoung@google.com <jvoung@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-18 22:53:04 +0000 |
commit | 03f41ec4b0affa9c949e5e7190fcce0159c0fef3 (patch) | |
tree | 0b03f78b3e8c4edd11cedd464683695c8d97beec /ppapi/api/dev | |
parent | ab88d15445a1bbf1e55bc34a559f8942cb175a7a (diff) | |
download | chromium_src-03f41ec4b0affa9c949e5e7190fcce0159c0fef3.zip chromium_src-03f41ec4b0affa9c949e5e7190fcce0159c0fef3.tar.gz chromium_src-03f41ec4b0affa9c949e5e7190fcce0159c0fef3.tar.bz2 |
Convert a few ppapi dev interfaces to IDL. NaCl has tests for these
dev interfaces, and we want it to go through IDL so that the PNaCl shim
will know about them. There are few others dev and private interfaces
not yet converted to IDL, but this is a start.
TEST= ./generator.py
BUG= http://code.google.com/p/chromium/issues/detail?id=89968
Review URL: http://codereview.chromium.org/8586031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110777 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/api/dev')
-rw-r--r-- | ppapi/api/dev/pp_cursor_type_dev.idl | 57 | ||||
-rw-r--r-- | ppapi/api/dev/ppb_cursor_control_dev.idl | 65 | ||||
-rw-r--r-- | ppapi/api/dev/ppb_memory_dev.idl | 37 | ||||
-rw-r--r-- | ppapi/api/dev/ppb_testing_dev.idl | 80 | ||||
-rw-r--r-- | ppapi/api/dev/ppp_printing_dev.idl | 88 |
5 files changed, 327 insertions, 0 deletions
diff --git a/ppapi/api/dev/pp_cursor_type_dev.idl b/ppapi/api/dev/pp_cursor_type_dev.idl new file mode 100644 index 0000000..c89d859 --- /dev/null +++ b/ppapi/api/dev/pp_cursor_type_dev.idl @@ -0,0 +1,57 @@ +/* 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 defines enumerations for cursor types. + */ + +[assert_size(4)] +[notypedef] enum PP_CursorType_Dev { + PP_CURSORTYPE_CUSTOM = -1, + PP_CURSORTYPE_POINTER = 0, + PP_CURSORTYPE_CROSS = 1, + PP_CURSORTYPE_HAND = 2, + PP_CURSORTYPE_IBEAM = 3, + PP_CURSORTYPE_WAIT = 4, + PP_CURSORTYPE_HELP = 5, + PP_CURSORTYPE_EASTRESIZE = 6, + PP_CURSORTYPE_NORTHRESIZE = 7, + PP_CURSORTYPE_NORTHEASTRESIZE = 8, + PP_CURSORTYPE_NORTHWESTRESIZE = 9, + PP_CURSORTYPE_SOUTHRESIZE = 10, + PP_CURSORTYPE_SOUTHEASTRESIZE = 11, + PP_CURSORTYPE_SOUTHWESTRESIZE = 12, + PP_CURSORTYPE_WESTRESIZE = 13, + PP_CURSORTYPE_NORTHSOUTHRESIZE = 14, + PP_CURSORTYPE_EASTWESTRESIZE = 15, + PP_CURSORTYPE_NORTHEASTSOUTHWESTRESIZE = 16, + PP_CURSORTYPE_NORTHWESTSOUTHEASTRESIZE = 17, + PP_CURSORTYPE_COLUMNRESIZE = 18, + PP_CURSORTYPE_ROWRESIZE = 19, + PP_CURSORTYPE_MIDDLEPANNING = 20, + PP_CURSORTYPE_EASTPANNING = 21, + PP_CURSORTYPE_NORTHPANNING = 22, + PP_CURSORTYPE_NORTHEASTPANNING = 23, + PP_CURSORTYPE_NORTHWESTPANNING = 24, + PP_CURSORTYPE_SOUTHPANNING = 25, + PP_CURSORTYPE_SOUTHEASTPANNING = 26, + PP_CURSORTYPE_SOUTHWESTPANNING = 27, + PP_CURSORTYPE_WESTPANNING = 28, + PP_CURSORTYPE_MOVE = 29, + PP_CURSORTYPE_VERTICALTEXT = 30, + PP_CURSORTYPE_CELL = 31, + PP_CURSORTYPE_CONTEXTMENU = 32, + PP_CURSORTYPE_ALIAS = 33, + PP_CURSORTYPE_PROGRESS = 34, + PP_CURSORTYPE_NODROP = 35, + PP_CURSORTYPE_COPY = 36, + PP_CURSORTYPE_NONE = 37, + PP_CURSORTYPE_NOTALLOWED = 38, + PP_CURSORTYPE_ZOOMIN = 39, + PP_CURSORTYPE_ZOOMOUT = 40, + PP_CURSORTYPE_GRAB = 41, + PP_CURSORTYPE_GRABBING = 42 +}; + diff --git a/ppapi/api/dev/ppb_cursor_control_dev.idl b/ppapi/api/dev/ppb_cursor_control_dev.idl new file mode 100644 index 0000000..714250a --- /dev/null +++ b/ppapi/api/dev/ppb_cursor_control_dev.idl @@ -0,0 +1,65 @@ +/* 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 defines the <code>PPB_CursorControl_Dev</code> interface + * implemented by the browser for controlling the cursor. + */ + +label Chrome { + M14 = 0.4 +}; + +[macro="PPB_CURSOR_CONTROL_DEV_INTERFACE"] +interface PPB_CursorControl_Dev { + /** + * Set a cursor. If "type" is PP_CURSORTYPE_CUSTOM, then "custom_image" + * must be an ImageData resource containing the cursor and "hot_spot" must + * contain the offset within that image that refers to the cursor's position. + */ + PP_Bool SetCursor([in] PP_Instance instance, + [in] PP_CursorType_Dev type, + [in] PP_Resource custom_image, + [in] PP_Point hot_spot); + + /** + * This method causes the cursor to be moved to the center of the + * instance and be locked, preventing the user from moving it. + * The cursor is implicitly hidden from the user while locked. + * Cursor lock may only be requested in response to a + * PP_InputEvent_MouseDown, and then only if the event was generated via + * user gesture. + * + * While the cursor is locked, any movement of the mouse will + * generate a PP_InputEvent_Type_MouseMove, whose x and y values + * indicate the position the cursor would have been moved to had + * the cursor not been locked, and had the screen been infinite in size. + * + * The browser may revoke cursor lock for reasons including but not + * limited to the user pressing the ESC key, the user activating + * another program via a reserved keystroke (e.g., ALT+TAB), or + * some other system event. + * + * Returns PP_TRUE if the cursor could be locked, PP_FALSE otherwise. + */ + PP_Bool LockCursor([in] PP_Instance instance); + + /** + * Causes the cursor to be unlocked, allowing it to track user + * movement again. + */ + PP_Bool UnlockCursor([in] PP_Instance instance); + + /** + * Returns PP_TRUE if the cursor is locked, PP_FALSE otherwise. + */ + PP_Bool HasCursorLock([in] PP_Instance instance); + + /** + * Returns PP_TRUE if the cursor can be locked, PP_FALSE otherwise. + */ + PP_Bool CanLockCursor([in] PP_Instance instance); +}; + diff --git a/ppapi/api/dev/ppb_memory_dev.idl b/ppapi/api/dev/ppb_memory_dev.idl new file mode 100644 index 0000000..1ed1d0d --- /dev/null +++ b/ppapi/api/dev/ppb_memory_dev.idl @@ -0,0 +1,37 @@ +/* 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 defines the <code>PPB_Memory interface</code> for functions + * related to memory management. + */ + +label Chrome { + M14 = 0.1 +}; + +/** + * The PPB_Memory_Dev interface contains pointers to functions related to memory + * management. + * + */ +interface PPB_Memory_Dev { + /** + * MemAlloc is a pointer to a function that allocate memory. + * + * @param[in] num_bytes A number of bytes to allocate. + * @return A pointer to the memory if successful, NULL If the + * allocation fails. + */ + mem_t MemAlloc([in] uint32_t num_bytes); + + /** + * MemFree is a pointer to a function that deallocates memory. + * + * @param[in] ptr A pointer to the memory to deallocate. It is safe to + * pass NULL to this function. + */ + void MemFree([inout] mem_t ptr); +}; diff --git a/ppapi/api/dev/ppb_testing_dev.idl b/ppapi/api/dev/ppb_testing_dev.idl new file mode 100644 index 0000000..87d4541 --- /dev/null +++ b/ppapi/api/dev/ppb_testing_dev.idl @@ -0,0 +1,80 @@ +/* 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 interface functions used for unit testing. Do not use in + * production code. They are not guaranteed to be available in normal plugin + * environments so you should not depend on them. + */ + +label Chrome { + M14 = 0.7 +}; + +interface PPB_Testing_Dev { + /** + * Reads the bitmap data out of the backing store for the given + * DeviceContext2D and into the given image. If the data was successfully + * read, it will return PP_TRUE. + * + * This function should not generally be necessary for normal plugin + * operation. If you want to update portions of a device, the expectation is + * that you will either regenerate the data, or maintain a backing store + * pushing updates to the device from your backing store via PaintImageData. + * Using this function will introduce an extra copy which will make your + * plugin slower. In some cases, this may be a very expensive operation (it + * may require slow cross-process transitions or graphics card readbacks). + * + * Data will be read into the image starting at |top_left| in the device + * context, and proceeding down and to the right for as many pixels as the + * image is large. If any part of the image bound would fall outside of the + * backing store of the device if positioned at |top_left|, this function + * will fail and return PP_FALSE. + * + * The image format must be of the format + * PPB_ImageData.GetNativeImageDataFormat() or this function will fail and + * return PP_FALSE. + * + * The returned image data will represent the current status of the backing + * store. This will not include any paint, scroll, or replace operations + * that have not yet been flushed; these operations are only reflected in + * the backing store (and hence ReadImageData) until after a Flush() + * operation has completed. + */ + PP_Bool ReadImageData([in] PP_Resource device_context_2d, + [in] PP_Resource image, + [in] PP_Point top_left); + + /** + * Runs a nested message loop. The plugin will be reentered from this call. + * This function is used for unit testing the API. The normal pattern is to + * issue some asynchronous call that has a callback. Then you call + * RunMessageLoop which will suspend the plugin and go back to processing + * messages, giving the asynchronous operation time to complete. In your + * callback, you save the data and call QuitMessageLoop, which will then + * pop back up and continue with the test. This avoids having to write a + * complicated state machine for simple tests for asynchronous APIs. + */ + 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); + + /** + * Returns the number of live objects (resources + strings + objects) + * associated with this plugin instance. Used for detecting leaks. Returns + * (uint32_t)-1 on failure. + */ + uint32_t GetLiveObjectsForInstance([in] PP_Instance instance); + + /** + * Returns PP_TRUE if the plugin is running out-of-process, PP_FALSE + * otherwise. + */ + PP_Bool IsOutOfProcess(); +}; diff --git a/ppapi/api/dev/ppp_printing_dev.idl b/ppapi/api/dev/ppp_printing_dev.idl new file mode 100644 index 0000000..746cf9f --- /dev/null +++ b/ppapi/api/dev/ppp_printing_dev.idl @@ -0,0 +1,88 @@ +/* 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. + */ + +/** + * Implementation of the Printing interface. + */ + +label Chrome { + M14 = 0.5 +}; + +[assert_size(4)] +enum PP_PrintOrientation_Dev { + PP_PRINTORIENTATION_NORMAL = 0, + PP_PRINTORIENTATION_ROTATED_90_CW = 1, + PP_PRINTORIENTATION_ROTATED_180 = 2, + PP_PRINTORIENTATION_ROTATED_90_CCW = 3 +}; + +[assert_size(4)] +enum PP_PrintOutputFormat_Dev { + PP_PRINTOUTPUTFORMAT_RASTER = 1u << 0, + PP_PRINTOUTPUTFORMAT_PDF = 1u << 1, + PP_PRINTOUTPUTFORMAT_POSTSCRIPT = 1u << 2, + PP_PRINTOUTPUTFORMAT_EMF = 1u << 3 +}; + +[assert_size(32)] +struct PP_PrintSettings_Dev { + /** This is the size of the printable area in points (1/72 of an inch) */ + PP_Rect printable_area; + int32_t dpi; + PP_PrintOrientation_Dev orientation; + PP_Bool grayscale; + PP_PrintOutputFormat_Dev format; +}; + +/** + * Specifies a contiguous range of page numbers to be printed. + * The page numbers use a zero-based index. + */ +[assert_size(8)] +struct PP_PrintPageNumberRange_Dev { + uint32_t first_page_number; + uint32_t last_page_number; +}; + +interface PPP_Printing_Dev { + /** + * Returns a bit field representing the supported print output formats. For + * example, if only Raster and PostScript are supported, + * QuerySupportedFormats returns a value equivalent to: + * (PP_PRINTOUTPUTFORMAT_RASTER | PP_PRINTOUTPUTFORMAT_POSTSCRIPT) + */ + uint32_t QuerySupportedFormats([in] PP_Instance instance); + + /** + * Begins a print session with the given print settings. Calls to PrintPage + * can only be made after a successful call to Begin. Returns the number of + * pages required for the print output at the given page size (0 indicates + * a failure). + */ + int32_t Begin([in] PP_Instance instance, + [in] PP_PrintSettings_Dev print_settings); + + /** + * Prints the specified pages using the format specified in Begin. + * Returns a resource that represents the printed output. + * This is a PPB_ImageData resource if the output format is + * PP_PrintOutputFormat_Raster and a PPB_Blob otherwise. Returns 0 on + * failure. + */ + PP_Resource PrintPages([in] PP_Instance instance, + [in] PP_PrintPageNumberRange_Dev page_ranges, + [in] uint32_t page_range_count); + + /** Ends the print session. Further calls to PrintPage will fail. */ + void End([in] PP_Instance instance); + + /** + * Returns true if the current content should be printed into the full page + * and not scaled down to fit within the printer's printable area. + */ + PP_Bool IsScalingDisabled([in] PP_Instance instance); +}; + |