1 /* Copyright (c) 2012 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.
6 /* From dev/ppb_resource_array_dev.idl modified Fri Jan 6 11:59:21 2012. */
8 #ifndef PPAPI_C_DEV_PPB_RESOURCE_ARRAY_DEV_H_
9 #define PPAPI_C_DEV_PPB_RESOURCE_ARRAY_DEV_H_
11 #include "ppapi/c/pp_bool.h"
12 #include "ppapi/c/pp_instance.h"
13 #include "ppapi/c/pp_macros.h"
14 #include "ppapi/c/pp_resource.h"
15 #include "ppapi/c/pp_stdint.h"
17 #define PPB_RESOURCEARRAY_DEV_INTERFACE_0_1 "PPB_ResourceArray(Dev);0.1"
18 #define PPB_RESOURCEARRAY_DEV_INTERFACE PPB_RESOURCEARRAY_DEV_INTERFACE_0_1
22 * This file defines the <code>PPB_ResourceArray_Dev</code> interface.
27 * @addtogroup Interfaces
31 * A resource array holds a list of resources and retains a reference to each of
34 struct PPB_ResourceArray_Dev_0_1
{
36 * Creates a resource array.
37 * Note: It will add a reference to each of the elements.
39 * @param[in] elements <code>PP_Resource</code>s to be stored in the created
41 * @param[in] size The number of elements.
43 * @return A <code>PP_Resource</code> corresponding to a resource array if
44 * successful; 0 if failed.
46 PP_Resource (*Create
)(PP_Instance instance
,
47 const PP_Resource elements
[],
50 * Determines if the provided resource is a resource array.
52 * @param[in] resource A <code>PP_Resource</code> corresponding to a generic
55 * @return A <code>PP_Bool</code> that is <code>PP_TRUE</code> if the given
56 * resource is a resource array, otherwise <code>PP_FALSE</code>.
58 PP_Bool (*IsResourceArray
)(PP_Resource resource
);
60 * Gets the array size.
62 * @param[in] resource_array The resource array.
64 * @return How many elements are there in the array.
66 uint32_t (*GetSize
)(PP_Resource resource_array
);
68 * Gets the element at the specified position.
69 * Note: It doesn't add a reference to the returned resource for the caller.
71 * @param[in] resource_array The resource array.
72 * @param[in] index An integer indicating a position in the array.
74 * @return A <code>PP_Resource</code>. Returns 0 if the index is out of range.
76 PP_Resource (*GetAt
)(PP_Resource resource_array
, uint32_t index
);
79 typedef struct PPB_ResourceArray_Dev_0_1 PPB_ResourceArray_Dev
;
84 #endif /* PPAPI_C_DEV_PPB_RESOURCE_ARRAY_DEV_H_ */