Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1803)

Unified Diff: ppapi/c/private/ppb_flash_clipboard.h

Issue 11225021: Move flash clipboard to the new proxy and add custom format support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ppapi/c/private/ppb_flash_clipboard.h
diff --git a/ppapi/c/private/ppb_flash_clipboard.h b/ppapi/c/private/ppb_flash_clipboard.h
index 3498d6104ace4bc7cffa70a20059ca7de69e52e8..e6c6b5ba5a9fcdafcc3464c2dd208f677121f609 100644
--- a/ppapi/c/private/ppb_flash_clipboard.h
+++ b/ppapi/c/private/ppb_flash_clipboard.h
@@ -3,7 +3,7 @@
* found in the LICENSE file.
*/
-/* From private/ppb_flash_clipboard.idl modified Wed Mar 28 16:49:38 2012. */
+/* From private/ppb_flash_clipboard.idl modified Thu Oct 25 15:19:51 2012. */
#ifndef PPAPI_C_PRIVATE_PPB_FLASH_CLIPBOARD_H_
#define PPAPI_C_PRIVATE_PPB_FLASH_CLIPBOARD_H_
@@ -14,9 +14,9 @@
#include "ppapi/c/pp_stdint.h"
#include "ppapi/c/pp_var.h"
-#define PPB_FLASH_CLIPBOARD_INTERFACE_3_0 "PPB_Flash_Clipboard;3.0"
#define PPB_FLASH_CLIPBOARD_INTERFACE_4_0 "PPB_Flash_Clipboard;4.0"
-#define PPB_FLASH_CLIPBOARD_INTERFACE PPB_FLASH_CLIPBOARD_INTERFACE_4_0
+#define PPB_FLASH_CLIPBOARD_INTERFACE_5_0 "PPB_Flash_Clipboard;5.0"
+#define PPB_FLASH_CLIPBOARD_INTERFACE PPB_FLASH_CLIPBOARD_INTERFACE_5_0
/**
* @file
@@ -26,12 +26,6 @@
/**
- * The old version string for this interface, equivalent to version 3.0.
- * TODO(viettrungluu): Remove this when enough time has passed. crbug.com/104184
- */
-#define PPB_FLASH_CLIPBOARD_INTERFACE_3_LEGACY "PPB_Flash_Clipboard;3"
-
-/**
* @addtogroup Enums
* @{
*/
@@ -48,7 +42,7 @@ typedef enum {
PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Flash_Clipboard_Type, 4);
/**
- * This enumeration contains the supported clipboard data formats.
+ * This enumeration contains the predfined clipboard data formats.
*/
typedef enum {
/** Indicates an invalid or unsupported clipboard data format. */
@@ -83,14 +77,30 @@ PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Flash_Clipboard_Format, 4);
* used by Pepper Flash to access the clipboard.
*
*/
-struct PPB_Flash_Clipboard_4_0 {
+struct PPB_Flash_Clipboard_5_0 {
+ /**
+ * Registers a custom clipboard format. The format is identified by a
+ * <code>str_t</code>. An id identifying the format will be returned if the
yzshen1 2012/10/29 17:58:04 better to use 'string' instead of '<code>str_t</co
raymes 2012/10/29 18:44:58 Done.
+ * format is successfully registered, which can be used to read/write data of
+ * that format. If the format has already been registered, the id associated
+ * with that format will be returned. If the format fails to be registered
+ * <code>PP_FLASH_CLIPBOARD_FORMAT_INVALID</code> will be returned.
+ *
+ * All custom data should be read/written as <code>PP_Var</code> array
+ * buffers. The clipboard format is pepper-specific meaning that although the
+ * data will be stored on the system clipboard, it can only be accessed in a
+ * sensible way by using the pepper API. Data stored in custom formats can
+ * be safely shared between different applications that use pepper.
+ */
+ uint32_t (*RegisterCustomFormat)(PP_Instance instance_id,
+ const char* format_name);
/**
* Checks whether a given data format is available from the given clipboard.
* Returns true if the given format is available from the given clipboard.
*/
PP_Bool (*IsFormatAvailable)(PP_Instance instance_id,
PP_Flash_Clipboard_Type clipboard_type,
- PP_Flash_Clipboard_Format format);
+ uint32_t format);
/**
* Reads data in the given <code>format</code> from the clipboard. An
* undefined <code>PP_Var</code> is returned if there is an error in reading
@@ -99,7 +109,7 @@ struct PPB_Flash_Clipboard_4_0 {
*/
struct PP_Var (*ReadData)(PP_Instance instance_id,
PP_Flash_Clipboard_Type clipboard_type,
- PP_Flash_Clipboard_Format format);
+ uint32_t format);
/**
* Writes the given array of data items to the clipboard. All existing
* clipboard data in any format is erased before writing this data. Thus,
@@ -117,21 +127,24 @@ struct PPB_Flash_Clipboard_4_0 {
int32_t (*WriteData)(PP_Instance instance_id,
PP_Flash_Clipboard_Type clipboard_type,
uint32_t data_item_count,
- const PP_Flash_Clipboard_Format formats[],
+ const uint32_t formats[],
const struct PP_Var data_items[]);
};
-typedef struct PPB_Flash_Clipboard_4_0 PPB_Flash_Clipboard;
+typedef struct PPB_Flash_Clipboard_5_0 PPB_Flash_Clipboard;
-struct PPB_Flash_Clipboard_3_0 {
+struct PPB_Flash_Clipboard_4_0 {
PP_Bool (*IsFormatAvailable)(PP_Instance instance_id,
PP_Flash_Clipboard_Type clipboard_type,
PP_Flash_Clipboard_Format format);
- struct PP_Var (*ReadPlainText)(PP_Instance instance_id,
- PP_Flash_Clipboard_Type clipboard_type);
- int32_t (*WritePlainText)(PP_Instance instance_id,
+ struct PP_Var (*ReadData)(PP_Instance instance_id,
PP_Flash_Clipboard_Type clipboard_type,
- struct PP_Var text);
+ PP_Flash_Clipboard_Format format);
+ int32_t (*WriteData)(PP_Instance instance_id,
+ PP_Flash_Clipboard_Type clipboard_type,
+ uint32_t data_item_count,
+ const PP_Flash_Clipboard_Format formats[],
+ const struct PP_Var data_items[]);
};
/**
* @}

Powered by Google App Engine
This is Rietveld 408576698