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

Side by Side Diff: ppapi/c/dev/ppb_var_array_dev.h

Issue 12388083: Add PPB_VarArray_Dev support - part 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 /* Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file.
4 */
5
6 /* From dev/ppb_var_array_dev.idl modified Sun Mar 03 18:06:28 2013. */
7
8 #ifndef PPAPI_C_DEV_PPB_VAR_ARRAY_DEV_H_
9 #define PPAPI_C_DEV_PPB_VAR_ARRAY_DEV_H_
10
11 #include "ppapi/c/pp_bool.h"
12 #include "ppapi/c/pp_macros.h"
13 #include "ppapi/c/pp_stdint.h"
14 #include "ppapi/c/pp_var.h"
15
16 #define PPB_VAR_ARRAY_DEV_INTERFACE_0_1 "PPB_VarArray(Dev);0.1"
17 #define PPB_VAR_ARRAY_DEV_INTERFACE PPB_VAR_ARRAY_DEV_INTERFACE_0_1
18
19 /**
20 * @file
21 * This file defines the <code>PPB_VarArray_Dev</code> struct providing
22 * a way to interact with array vars.
23 */
24
25
26 /**
27 * @addtogroup Interfaces
28 * @{
29 */
30 struct PPB_VarArray_Dev_0_1 {
31 /**
32 * Creates an array var, i.e., a <code>PP_Var</code> with type set to
33 * <code>PP_VARTYPE_ARRAY</code>. The array length is set to 0.
34 *
35 * @return An empty array var, whose reference count is set to 1 on behalf of
36 * the caller.
37 */
38 struct PP_Var (*Create)(void);
39 /**
40 * Gets an element from the array.
41 *
42 * @param[in] array An array var.
43 * @param[in] index An index indicating which element to return.
44 *
45 * @return The element at the specified position. The reference count is
46 * incremented on behalf of the caller. If <code>index</code> is larger than
47 * or equal to the array length, an undefined var is returned.
48 */
49 struct PP_Var (*Get)(struct PP_Var array, uint32_t index);
50 /**
51 * Sets the value of an element in the array.
52 *
53 * @param[in] array An array var.
54 * @param[in] index An index indicating which element to modify. If
55 * <code>index</code> is larger than or equal to the array length, the length
56 * is updated to be <code>index</code> + 1. Any position in the array that
57 * hasn't been set before is set to undefined, i.e., <code>PP_Var</code> of
58 * type <code>PP_VARTYPE_UNDEFINED</code>.
59 * @param[in] value The value to set.
60 *
61 * @return A <code>PP_Bool</code> indicating whether the operation succeeds.
62 */
63 PP_Bool (*Set)(struct PP_Var array, uint32_t index, struct PP_Var value);
64 /**
65 * Gets the array length.
66 *
67 * @param[in] array An array var.
68 *
69 * @return The array length.
70 */
71 uint32_t (*GetLength)(struct PP_Var array);
72 /**
73 * Sets the array length.
74 *
75 * @param[in] array An array var.
76 * @param[in] length The new array length. If <code>length</code> is smaller
77 * than its current value, the array is truncated to the new length; any
78 * elements that no longer fit are removed. If <code>length</code> is larger
79 * than its current value, undefined vars are appended to increase the array
80 * to the specified length.
81 *
82 * @return A <code>PP_Bool</code> indicating whether the operation succeeds.
83 */
84 PP_Bool (*SetLength)(struct PP_Var array, uint32_t length);
85 };
86
87 typedef struct PPB_VarArray_Dev_0_1 PPB_VarArray_Dev;
88 /**
89 * @}
90 */
91
92 #endif /* PPAPI_C_DEV_PPB_VAR_ARRAY_DEV_H_ */
93
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698