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/c | |
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/c')
-rw-r--r-- | ppapi/c/dev/pp_cursor_type_dev.h | 22 | ||||
-rw-r--r-- | ppapi/c/dev/ppb_cursor_control_dev.h | 93 | ||||
-rw-r--r-- | ppapi/c/dev/ppb_memory_dev.h | 12 | ||||
-rw-r--r-- | ppapi/c/dev/ppb_testing_dev.h | 125 | ||||
-rw-r--r-- | ppapi/c/dev/ppp_printing_dev.h | 55 |
5 files changed, 199 insertions, 108 deletions
diff --git a/ppapi/c/dev/pp_cursor_type_dev.h b/ppapi/c/dev/pp_cursor_type_dev.h index 191df9f..82967a7 100644 --- a/ppapi/c/dev/pp_cursor_type_dev.h +++ b/ppapi/c/dev/pp_cursor_type_dev.h @@ -2,11 +2,24 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -#ifndef PPAPI_C_DEV_PP_CURSORTYPE_DEV_H_ -#define PPAPI_C_DEV_PP_CURSORTYPE_DEV_H_ + +/* From dev/pp_cursor_type_dev.idl modified Thu Nov 17 15:27:17 2011. */ + +#ifndef PPAPI_C_DEV_PP_CURSOR_TYPE_DEV_H_ +#define PPAPI_C_DEV_PP_CURSOR_TYPE_DEV_H_ #include "ppapi/c/pp_macros.h" +/** + * @file + * This file defines enumerations for cursor types. + */ + + +/** + * @addtogroup Enums + * @{ + */ enum PP_CursorType_Dev { PP_CURSORTYPE_CUSTOM = -1, PP_CURSORTYPE_POINTER = 0, @@ -54,6 +67,9 @@ enum PP_CursorType_Dev { PP_CURSORTYPE_GRABBING = 42 }; PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_CursorType_Dev, 4); +/** + * @} + */ -#endif /* PPAPI_C_DEV_PP_CURSORTYPE_DEV_H_ */ +#endif /* PPAPI_C_DEV_PP_CURSOR_TYPE_DEV_H_ */ diff --git a/ppapi/c/dev/ppb_cursor_control_dev.h b/ppapi/c/dev/ppb_cursor_control_dev.h index e401ef1..4bb3b80 100644 --- a/ppapi/c/dev/ppb_cursor_control_dev.h +++ b/ppapi/c/dev/ppb_cursor_control_dev.h @@ -2,57 +2,82 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ + +/* From dev/ppb_cursor_control_dev.idl modified Thu Nov 17 14:24:28 2011. */ + #ifndef PPAPI_C_DEV_PPB_CURSOR_CONTROL_DEV_H_ #define PPAPI_C_DEV_PPB_CURSOR_CONTROL_DEV_H_ -#include "ppapi/c/pp_bool.h" #include "ppapi/c/dev/pp_cursor_type_dev.h" +#include "ppapi/c/pp_bool.h" #include "ppapi/c/pp_instance.h" +#include "ppapi/c/pp_macros.h" #include "ppapi/c/pp_point.h" #include "ppapi/c/pp_resource.h" +#include "ppapi/c/pp_stdint.h" #define PPB_CURSOR_CONTROL_DEV_INTERFACE_0_4 "PPB_CursorControl(Dev);0.4" #define PPB_CURSOR_CONTROL_DEV_INTERFACE PPB_CURSOR_CONTROL_DEV_INTERFACE_0_4 +/** + * @file + * This file defines the <code>PPB_CursorControl_Dev</code> interface + * implemented by the browser for controlling the cursor. + */ + + +/** + * @addtogroup Interfaces + * @{ + */ struct 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. + /** + * 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)(PP_Instance instance, enum PP_CursorType_Dev type, PP_Resource custom_image, const struct 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)(PP_Instance); - - // Causes the cursor to be unlocked, allowing it to track user - // movement again. - PP_Bool (*UnlockCursor)(PP_Instance); - - // Returns PP_TRUE if the cursor is locked, PP_FALSE otherwise. - PP_Bool (*HasCursorLock)(PP_Instance); - - // Returns PP_TRUE if the cursor can be locked, PP_FALSE otherwise. - PP_Bool (*CanLockCursor)(PP_Instance); + /** + * 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)(PP_Instance instance); + /** + * Causes the cursor to be unlocked, allowing it to track user + * movement again. + */ + PP_Bool (*UnlockCursor)(PP_Instance instance); + /** + * Returns PP_TRUE if the cursor is locked, PP_FALSE otherwise. + */ + PP_Bool (*HasCursorLock)(PP_Instance instance); + /** + * Returns PP_TRUE if the cursor can be locked, PP_FALSE otherwise. + */ + PP_Bool (*CanLockCursor)(PP_Instance instance); }; +/** + * @} + */ #endif /* PPAPI_C_DEV_PPB_CURSOR_CONTROL_DEV_H_ */ diff --git a/ppapi/c/dev/ppb_memory_dev.h b/ppapi/c/dev/ppb_memory_dev.h index 34773bf..56d6bc5 100644 --- a/ppapi/c/dev/ppb_memory_dev.h +++ b/ppapi/c/dev/ppb_memory_dev.h @@ -2,9 +2,13 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ + +/* From dev/ppb_memory_dev.idl modified Thu Nov 17 09:45:57 2011. */ + #ifndef PPAPI_C_DEV_PPB_MEMORY_DEV_H_ #define PPAPI_C_DEV_PPB_MEMORY_DEV_H_ +#include "ppapi/c/pp_macros.h" #include "ppapi/c/pp_stdint.h" #define PPB_MEMORY_DEV_INTERFACE_0_1 "PPB_Memory(Dev);0.1" @@ -12,15 +16,15 @@ /** * @file - * This file defines the PPB_Memory interface defined by the browser and - * and containing pointers to functions related to memory management. + * This file defines the <code>PPB_Memory interface</code> for functions + * related to memory management. */ + /** * @addtogroup Interfaces * @{ */ - /** * The PPB_Memory_Dev interface contains pointers to functions related to memory * management. @@ -35,7 +39,6 @@ struct PPB_Memory_Dev { * allocation fails. */ void* (*MemAlloc)(uint32_t num_bytes); - /** * MemFree is a pointer to a function that deallocates memory. * @@ -49,3 +52,4 @@ struct PPB_Memory_Dev { */ #endif /* PPAPI_C_DEV_PPB_MEMORY_DEV_H_ */ + diff --git a/ppapi/c/dev/ppb_testing_dev.h b/ppapi/c/dev/ppb_testing_dev.h index 066b50f..ebc9345 100644 --- a/ppapi/c/dev/ppb_testing_dev.h +++ b/ppapi/c/dev/ppb_testing_dev.h @@ -2,79 +2,98 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ + +/* From dev/ppb_testing_dev.idl modified Thu Nov 17 13:50:20 2011. */ + #ifndef PPAPI_C_DEV_PPB_TESTING_DEV_H_ #define PPAPI_C_DEV_PPB_TESTING_DEV_H_ #include "ppapi/c/pp_bool.h" #include "ppapi/c/pp_instance.h" +#include "ppapi/c/pp_macros.h" +#include "ppapi/c/pp_point.h" #include "ppapi/c/pp_resource.h" #include "ppapi/c/pp_stdint.h" -struct PP_Point; - -// TODO(dmichael): Delete support for 0.6. -#define PPB_TESTING_DEV_INTERFACE_0_6 "PPB_Testing(Dev);0.6" #define PPB_TESTING_DEV_INTERFACE_0_7 "PPB_Testing(Dev);0.7" #define PPB_TESTING_DEV_INTERFACE PPB_TESTING_DEV_INTERFACE_0_7 -// This interface contains 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. +/** + * @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. + */ + + +/** + * @addtogroup Interfaces + * @{ + */ struct 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. + /** + * 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)(PP_Resource device_context_2d, PP_Resource image, const struct 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. + /** + * 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)(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. + /** + * 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)(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. + /** + * 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)(PP_Instance instance); - - // Returns PP_TRUE if the plugin is running out-of-process, PP_FALSE - // otherwise. + /** + * Returns PP_TRUE if the plugin is running out-of-process, PP_FALSE + * otherwise. + */ PP_Bool (*IsOutOfProcess)(); }; +/** + * @} + */ #endif /* PPAPI_C_DEV_PPB_TESTING_DEV_H_ */ diff --git a/ppapi/c/dev/ppp_printing_dev.h b/ppapi/c/dev/ppp_printing_dev.h index cd83d45..d709b67 100644 --- a/ppapi/c/dev/ppp_printing_dev.h +++ b/ppapi/c/dev/ppp_printing_dev.h @@ -2,32 +2,57 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ + +/* From dev/ppp_printing_dev.idl modified Thu Nov 17 13:26:05 2011. */ + #ifndef PPAPI_C_DEV_PPP_PRINTING_DEV_H_ #define PPAPI_C_DEV_PPP_PRINTING_DEV_H_ #include "ppapi/c/pp_bool.h" #include "ppapi/c/pp_instance.h" #include "ppapi/c/pp_macros.h" +#include "ppapi/c/pp_point.h" #include "ppapi/c/pp_rect.h" #include "ppapi/c/pp_resource.h" +#include "ppapi/c/pp_size.h" #include "ppapi/c/pp_stdint.h" +#define PPP_PRINTING_DEV_INTERFACE_0_5 "PPP_Printing(Dev);0.5" +#define PPP_PRINTING_DEV_INTERFACE PPP_PRINTING_DEV_INTERFACE_0_5 + +/** + * @file + * Implementation of the Printing interface. + */ + + +/** + * @addtogroup Enums + * @{ + */ typedef enum { - PP_PRINTORIENTATION_NORMAL = 0, - PP_PRINTORIENTATION_ROTATED_90_CW = 1, - PP_PRINTORIENTATION_ROTATED_180 = 2, + PP_PRINTORIENTATION_NORMAL = 0, + PP_PRINTORIENTATION_ROTATED_90_CW = 1, + PP_PRINTORIENTATION_ROTATED_180 = 2, PP_PRINTORIENTATION_ROTATED_90_CCW = 3 } PP_PrintOrientation_Dev; PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_PrintOrientation_Dev, 4); typedef enum { - PP_PRINTOUTPUTFORMAT_RASTER = 1u << 0, - PP_PRINTOUTPUTFORMAT_PDF = 1u << 1, + PP_PRINTOUTPUTFORMAT_RASTER = 1u << 0, + PP_PRINTOUTPUTFORMAT_PDF = 1u << 1, PP_PRINTOUTPUTFORMAT_POSTSCRIPT = 1u << 2, - PP_PRINTOUTPUTFORMAT_EMF = 1u << 3 + PP_PRINTOUTPUTFORMAT_EMF = 1u << 3 } PP_PrintOutputFormat_Dev; PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_PrintOutputFormat_Dev, 4); +/** + * @} + */ +/** + * @addtogroup Structs + * @{ + */ struct PP_PrintSettings_Dev { /** This is the size of the printable area in points (1/72 of an inch) */ struct PP_Rect printable_area; @@ -47,11 +72,14 @@ struct PP_PrintPageNumberRange_Dev { uint32_t last_page_number; }; PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_PrintPageNumberRange_Dev, 8); +/** + * @} + */ -/* Interface for the plugin to implement printing. */ -#define PPP_PRINTING_DEV_INTERFACE_0_5 "PPP_Printing(Dev);0.5" -#define PPP_PRINTING_DEV_INTERFACE PPP_PRINTING_DEV_INTERFACE_0_5 - +/** + * @addtogroup Interfaces + * @{ + */ struct PPP_Printing_Dev { /** * Returns a bit field representing the supported print output formats. For @@ -60,7 +88,6 @@ struct PPP_Printing_Dev { * (PP_PRINTOUTPUTFORMAT_RASTER | PP_PRINTOUTPUTFORMAT_POSTSCRIPT) */ uint32_t (*QuerySupportedFormats)(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 @@ -69,7 +96,6 @@ struct PPP_Printing_Dev { */ int32_t (*Begin)(PP_Instance instance, const struct PP_PrintSettings_Dev* print_settings); - /** * Prints the specified pages using the format specified in Begin. * Returns a resource that represents the printed output. @@ -81,16 +107,17 @@ struct PPP_Printing_Dev { PP_Instance instance, const struct PP_PrintPageNumberRange_Dev* page_ranges, uint32_t page_range_count); - /** Ends the print session. Further calls to PrintPage will fail. */ void (*End)(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)(PP_Instance instance); }; +/** + * @} + */ #endif /* PPAPI_C_DEV_PPP_PRINTING_DEV_H_ */ |