os/graphics/graphicscomposition/openwfcompositionengine/composition/include/wfcdevice.h
Update contrib.
1 /* Copyright (c) 2009 The Khronos Group Inc.
2 * Portions copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies)
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and/or associated documentation files (the
6 * "Materials"), to deal in the Materials without restriction, including
7 * without limitation the rights to use, copy, modify, merge, publish,
8 * distribute, sublicense, and/or sell copies of the Materials, and to
9 * permit persons to whom the Materials are furnished to do so, subject to
10 * the following conditions:
12 * The above copyright notice and this permission notice shall be included
13 * in all copies or substantial portions of the Materials.
15 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21 * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
26 * \brief Device handling interface
32 #include "wfcstructs.h"
33 #include "wfcimageprovider.h"
40 * Get list of available devices.
42 * \param idList Pointer to list where device IDs should be written
43 * \param listCapacity Maximum number of IDs to write
44 * \param filterList User provided array
46 * \return Number of IDs written.
49 WFC_Devices_GetIds(WFCint* idList,
51 const WFCint* filterList);
54 * \brief Create instance of a device whose ID
57 * \param deviceId ID of the device to create. Must be WFC_DEFAULT_DEVICE_ID
58 * or some other valid device ID (returned by Devices_GetIds)
60 * \return Handle to created device or WFC_INVALID_HANDLE
64 WFC_Device_Create(WFCint deviceId);
67 * \brief Destroy device, or rather queue it for destruction.
69 * \param device Device
72 WFC_Device_Destroy(WFC_DEVICE* device);
75 * \brief Set error code for device.
77 * Obs! In case the previous
78 * error code hasn't been read from the device, this function
79 * does nothing; the new error is set only if "current" error
82 * \param dev Device object
83 * \param code Error to set
86 OWF_API_CALL void OWF_APIENTRY
87 WFC_Device_SetError(WFCDevice dev,
91 * \brief Read and reset last error code from device.
93 * \param device Device object
95 * \return WFCErrorCode
97 OWF_API_CALL WFCErrorCode
98 WFC_Device_GetError(WFC_DEVICE* device);
101 * \brief Find device object by handle
103 * \param dev Device handle
105 * \return Mathing device object or NULL
107 OWF_API_CALL WFC_DEVICE*
108 WFC_Device_FindByHandle(WFCDevice dev);
111 * \brief Get device attribute
113 * \param device Device
114 * \param attrib Attribute name
115 * \param value Pointer to where the value should be saved
117 * \return WFCErrorCode
119 OWF_API_CALL WFCErrorCode
120 WFC_Device_GetAttribi(WFC_DEVICE* device,
121 WFCDeviceAttrib attrib,
125 * \brief Create context on device
127 * \param device Device
128 * \param stream Target stream for context
129 * \param type Context type
131 * \return New context
133 OWF_API_CALL WFC_CONTEXT*
134 WFC_Device_CreateContext(WFC_DEVICE* device,
135 OWFNativeStreamType stream,
140 * \brief Destroy context from device
142 OWF_API_CALL WFCErrorCode
143 WFC_Device_DestroyContext(WFC_DEVICE* device,
147 * \brief Destroy all device's contexts
149 * \param device Device object
152 WFC_Device_DestroyContexts(WFC_DEVICE* device);
155 * \brief Find context context object by handle
157 * \param device Device
158 * \param context Context handle
160 * \return Corresponding context object or NULL
161 * if handle is invalid.
163 OWF_API_CALL WFC_CONTEXT*
164 WFC_Device_FindContext(WFC_DEVICE* device,
168 * \brief Create new element
173 * \return New element or NULL
175 OWF_API_CALL WFC_ELEMENT*
176 WFC_Device_CreateElement(WFC_DEVICE* device, WFC_CONTEXT* context);
179 * \brief Destroy element
184 OWF_API_CALL WFCErrorCode
185 WFC_Device_DestroyElement(WFC_DEVICE* device,
189 * \brief Destroy all elements from device
191 * \param device Device
194 WFC_Device_DestroyElements(WFC_DEVICE* device);
197 * \brief Find element by handle
199 * \param device Device
200 * \param el Element handle
202 * \return Element object
204 OWF_API_CALL WFC_ELEMENT*
205 WFC_Device_FindElement(WFC_DEVICE* device,
209 * \brief Set element integer vector attribute
211 * \param device Device
212 * \param element Element handle
213 * \param attrib Attribute name
214 * \param count Attribute value vector length (1 for scalar attribute)
215 * \param values Pointer to values
217 * \return WFCErrorCode: WFC_ERROR_BAD_ATTRIBUTE if attribute name is invalid;
218 * WFC_ERROR_INVALID_ARGUMENT if values is NULL or if the count doesn't match
219 * the attribute's size; WFC_ERROR_BAD_HANDLE if element handle is invalid.
221 OWF_API_CALL WFCErrorCode
222 WFC_Device_SetElementAttribiv(WFC_DEVICE* device,
224 WFCElementAttrib attrib,
226 const WFCint* values);
229 * \brief Set element attribute
231 OWF_API_CALL WFCErrorCode
232 WFC_Device_SetElementAttribfv(WFC_DEVICE* device,
234 WFCElementAttrib attrib,
236 const WFCfloat* values);
238 * \brief Get element attribute
240 OWF_API_CALL WFCErrorCode
241 WFC_Device_GetElementAttribiv(WFC_DEVICE* device,
243 WFCElementAttrib attrib,
247 * \brief Get element attribute
249 OWF_API_CALL WFCErrorCode
250 WFC_Device_GetElementAttribfv(WFC_DEVICE* device,
252 WFCElementAttrib attrib,
258 * \brief Destroy all image providers from device
260 * \param device Device
263 WFC_Device_DestroyImageProviders(WFC_DEVICE* device);
265 OWF_API_CALL WFC_IMAGE_PROVIDER*
266 WFC_Device_FindImageProvider(WFC_DEVICE* device,
268 WFC_IMAGE_PROVIDER_TYPE type);
270 OWF_API_CALL WFC_IMAGE_PROVIDER*
271 WFC_Device_CreateSource(WFC_DEVICE* device,
272 WFC_CONTEXT* context,
273 WFCNativeStreamType stream);
275 OWF_API_CALL WFC_IMAGE_PROVIDER*
276 WFC_Device_CreateMask(WFC_DEVICE* device,
277 WFC_CONTEXT* context,
278 WFCNativeStreamType stream);
280 OWF_API_CALL WFCErrorCode
281 WFC_Device_DestroySource(WFC_DEVICE* device, WFCSource source);
283 OWF_API_CALL WFCErrorCode
284 WFC_Device_DestroyMask(WFC_DEVICE* device, WFCMask mask);
286 OWF_API_CALL WFC_IMAGE_PROVIDER*
287 WFC_Device_FindSource(WFC_DEVICE* device, WFCSource source);
289 OWF_API_CALL WFC_IMAGE_PROVIDER*
290 WFC_Device_FindMask(WFC_DEVICE* device, WFCMask mask);
293 WFC_Device_EnableContentNotifications(WFC_DEVICE* device,
294 WFC_CONTEXT* context,
297 OWF_API_CALL WFCboolean
298 WFC_Device_StreamIsTarget(WFC_DEVICE* device,
299 WFCNativeStreamType stream);
301 OWF_API_CALL WFC_CONTEXT*
302 WFC_Device_FindContextByScreen(WFC_DEVICE* device,
303 WFCint screenNumber);
306 WFC_Device_DestroyContextElements(WFC_DEVICE* device,
307 WFC_CONTEXT* context);
310 WFC_Device_DestroyContextImageProviders(WFC_DEVICE* device,
311 WFC_CONTEXT* context);
313 OWF_API_CALL WFCboolean
314 WFC_Device_FindScreenNumber(WFCint screenNumber);
320 #endif /*WFCDEVICE_H_*/