summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjvoung@google.com <jvoung@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-18 22:53:04 +0000
committerjvoung@google.com <jvoung@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-18 22:53:04 +0000
commit03f41ec4b0affa9c949e5e7190fcce0159c0fef3 (patch)
tree0b03f78b3e8c4edd11cedd464683695c8d97beec
parentab88d15445a1bbf1e55bc34a559f8942cb175a7a (diff)
downloadchromium_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
-rw-r--r--ppapi/api/dev/pp_cursor_type_dev.idl57
-rw-r--r--ppapi/api/dev/ppb_cursor_control_dev.idl65
-rw-r--r--ppapi/api/dev/ppb_memory_dev.idl37
-rw-r--r--ppapi/api/dev/ppb_testing_dev.idl80
-rw-r--r--ppapi/api/dev/ppp_printing_dev.idl88
-rw-r--r--ppapi/c/dev/pp_cursor_type_dev.h22
-rw-r--r--ppapi/c/dev/ppb_cursor_control_dev.h93
-rw-r--r--ppapi/c/dev/ppb_memory_dev.h12
-rw-r--r--ppapi/c/dev/ppb_testing_dev.h125
-rw-r--r--ppapi/c/dev/ppp_printing_dev.h55
-rw-r--r--ppapi/generators/idl_c_header.py6
-rw-r--r--ppapi/generators/idl_c_proto.py15
-rw-r--r--ppapi/generators/idl_lexer.py3
13 files changed, 543 insertions, 115 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);
+};
+
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_ */
diff --git a/ppapi/generators/idl_c_header.py b/ppapi/generators/idl_c_header.py
index e08316c..7813b0b 100644
--- a/ppapi/generators/idl_c_header.py
+++ b/ppapi/generators/idl_c_header.py
@@ -90,6 +90,11 @@ def GenerateHeader(out, filenode, releases):
name = '%s%s' % (pref, node.GetName())
if node.IsA('Struct'):
form = 'PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(%s, %s);\n'
+ elif node.IsA('Enum'):
+ if node.GetProperty('notypedef'):
+ form = 'PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(%s, %s);\n'
+ else:
+ form = 'PP_COMPILE_ASSERT_SIZE_IN_BYTES(%s, %s);\n'
else:
form = 'PP_COMPILE_ASSERT_SIZE_IN_BYTES(%s, %s);\n'
item += form % (name, asize[0])
@@ -219,4 +224,3 @@ def Main(args):
if __name__ == '__main__':
retval = Main(sys.argv[1:])
sys.exit(retval)
-
diff --git a/ppapi/generators/idl_c_proto.py b/ppapi/generators/idl_c_proto.py
index f3eab9d..584cfaa 100644
--- a/ppapi/generators/idl_c_proto.py
+++ b/ppapi/generators/idl_c_proto.py
@@ -254,7 +254,11 @@ class CGen(object):
# If it's an enum, or typedef then return the Enum's name
elif typeref.IsA('Enum', 'Typedef'):
- name = '%s%s' % (prefix, typeref.GetName())
+ # The enum may have skipped having a typedef, we need prefix with 'enum'.
+ if typeref.GetProperty('notypedef'):
+ name = 'enum %s%s' % (prefix, typeref.GetName())
+ else:
+ name = '%s%s' % (prefix, typeref.GetName())
else:
raise RuntimeError('Getting name of non-type %s.' % node)
@@ -413,12 +417,15 @@ class CGen(object):
def DefineEnum(self, node, releases, prefix='', comment=False):
__pychecker__ = 'unusednames=comment,releases'
self.LogEnter('DefineEnum %s' % node)
- unnamed = node.GetProperty('unnamed')
+ name = '%s%s' % (prefix, node.GetName())
+ notypedef = node.GetProperty('notypedef')
+ unnamed = node.GetProperty('unnamed')
if unnamed:
out = 'enum {'
+ elif notypedef:
+ out = 'enum %s {' % name
else:
out = 'typedef enum {'
- name = '%s%s' % (prefix, node.GetName())
enumlist = []
for child in node.GetListOf('EnumItem'):
value = child.GetProperty('VALUE')
@@ -430,7 +437,7 @@ class CGen(object):
enumlist.append('%s %s' % (comment_txt, item_txt))
self.LogExit('Exit DefineEnum')
- if unnamed:
+ if unnamed or notypedef:
out = '%s\n%s\n};\n' % (out, ',\n'.join(enumlist))
else:
out = '%s\n%s\n} %s;\n' % (out, ',\n'.join(enumlist), name)
diff --git a/ppapi/generators/idl_lexer.py b/ppapi/generators/idl_lexer.py
index 940eea2..bf0b134 100644
--- a/ppapi/generators/idl_lexer.py
+++ b/ppapi/generators/idl_lexer.py
@@ -97,7 +97,7 @@ class IDLLexer(object):
# Constant values
t_FLOAT = r'-?(\d+\.\d*|\d*\.\d+)([Ee][+-]?\d+)?|-?\d+[Ee][+-]?\d+'
- t_INT = r'-?[0-9]+'
+ t_INT = r'-?[0-9]+[uU]?'
t_OCT = r'-?0[0-7]+'
t_HEX = r'-?0[Xx][0-9A-Fa-f]+'
t_LSHIFT = r'<<'
@@ -330,4 +330,3 @@ def Main(args):
if __name__ == '__main__':
sys.exit(Main(sys.argv[1:]))
-