os/graphics/graphicscomposition/openwfcompositionengine/composition/include/wfcscene.h
First public contribution.
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.
27 * \brief Scene handling interface
34 #include "wfcelement.h"
42 * \brief Clone a scene
44 * \param scene Pointer to scene to clone
45 * \returns cloned scene
47 OWF_API_CALL WFC_SCENE*
48 WFC_Scene_Clone(WFC_SCENE* scene);
51 * \brief Create new scene in a context
53 * \param context Context to create the scene in
55 * \return New scene object
57 OWF_API_CALL WFC_SCENE*
58 WFC_Scene_Create(WFC_CONTEXT* context);
61 * \brief Destroy a scene.
63 * Free all resources used by the scene and return the
64 * scene object into the scene pool
70 WFC_Scene_Destroy(WFC_SCENE* scene);
73 * \brief Insert element to scene above given element
76 * \param element Element to add
77 * \param elementBelow Element above which the new element should be
79 * \return WFCErrorCode
82 OWF_API_CALL WFCErrorCode
83 WFC_Scene_InsertElement(WFC_SCENE* scene,
85 WFCElement elementBelow);
88 * \brief Remove element from scene
91 * \param element Element to remove
93 * \return WFCErrorCode
96 WFC_Scene_RemoveElement(WFC_SCENE* scene,
101 * \brief Get element's neighbour element (i.e. element on top of it
105 * \param element Element
106 * \param n Neighbour element offset (< 0 for elements underneath,
107 * > 0 for elements on top)
109 * \return Neigbour element id or WFC_INVALID_HANDLE
111 OWF_API_CALL WFCElement
112 WFC_Scene_GetNeighbourElement(WFC_SCENE* scene, WFCElement element, WFCint n);
115 * \brief Search the scene for given element.
117 * \param scene Scene to search
118 * \param element Handle of the element to find
121 OWF_API_CALL WFC_ELEMENT*
122 WFC_Scene_FindElement(WFC_SCENE* scene,
125 * \brief Unlock scene sources & masks.
130 WFC_Scene_UnlockSourcesAndMasks(WFC_SCENE* scene);
133 * \brief Lock all sources' & masks' streams for reading prior to rendering.
135 * Locking is actually just acquiring the read buffer for each source/mask
138 * All source read buffers must be acquired before the composition starts
139 * because if multiple elements share same source, they all should get same
140 * frame from that source.
142 * If each source buffer were locked/unlocked multiple times during
143 * composition (i.e. once for each element that uses it), the buffer
144 * contents might change between elements thus yielding wrong visual results.
149 WFC_Scene_LockSourcesAndMasks(WFC_SCENE* scene);
152 * \brief Check scene for conflicts
154 * \param scene Scene to check
156 * \return WFC_TRUE if there's a conflict (inconsistency) in the
157 * scene graph, WFC_FALSE otherwise.
159 OWF_API_CALL WFCboolean
160 WFC_Scene_HasConflicts(WFC_SCENE* scene);
163 * \brief Commit changes to scene
168 WFC_Scene_Commit(WFC_SCENE* scene);
171 * Return handle of the lowest element in the scene.
174 * \return Handle of the bottom element
176 OWF_API_CALL WFCElement
177 WFC_Scene_LowestElement(WFC_SCENE* scene);
180 * \brief Search for the topmost element
182 * \param scene Scene to search
183 * \return pointer to the topmost element
185 OWF_API_CALL WFC_ELEMENT*
186 WFC_Scene_TopMostElement(WFC_SCENE* scene);
191 #endif /* WFCSCENE_H_ */