sl@0: /* Copyright (c) 2009 The Khronos Group Inc. sl@0: * Portions copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies) sl@0: * sl@0: * Permission is hereby granted, free of charge, to any person obtaining a sl@0: * copy of this software and/or associated documentation files (the sl@0: * "Materials"), to deal in the Materials without restriction, including sl@0: * without limitation the rights to use, copy, modify, merge, publish, sl@0: * distribute, sublicense, and/or sell copies of the Materials, and to sl@0: * permit persons to whom the Materials are furnished to do so, subject to sl@0: * the following conditions: sl@0: * sl@0: * The above copyright notice and this permission notice shall be included sl@0: * in all copies or substantial portions of the Materials. sl@0: * sl@0: * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, sl@0: * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF sl@0: * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. sl@0: * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY sl@0: * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, sl@0: * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE sl@0: * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. sl@0: */ sl@0: sl@0: /*! \ingroup wfc sl@0: * \file wfcscene.h sl@0: * sl@0: * \brief Scene handling interface sl@0: */ sl@0: sl@0: #ifndef WFCSCENE_H_ sl@0: #define WFCSCENE_H_ sl@0: sl@0: #include "WF/wfc.h" sl@0: #include "wfcelement.h" sl@0: sl@0: #include "owfpool.h" sl@0: #ifdef __cplusplus sl@0: extern "C" { sl@0: #endif sl@0: sl@0: /*! sl@0: * \brief Clone a scene sl@0: * sl@0: * \param scene Pointer to scene to clone sl@0: * \returns cloned scene sl@0: */ sl@0: OWF_API_CALL WFC_SCENE* sl@0: WFC_Scene_Clone(WFC_SCENE* scene); sl@0: sl@0: /*! sl@0: * \brief Create new scene in a context sl@0: * sl@0: * \param context Context to create the scene in sl@0: * sl@0: * \return New scene object sl@0: */ sl@0: OWF_API_CALL WFC_SCENE* sl@0: WFC_Scene_Create(WFC_CONTEXT* context); sl@0: sl@0: /*! sl@0: * \brief Destroy a scene. sl@0: * sl@0: * Free all resources used by the scene and return the sl@0: * scene object into the scene pool sl@0: * sl@0: * \param scene Scene sl@0: */ sl@0: sl@0: OWF_API_CALL void sl@0: WFC_Scene_Destroy(WFC_SCENE* scene); sl@0: sl@0: /*! sl@0: * \brief Insert element to scene above given element sl@0: * sl@0: * \param scene Scene sl@0: * \param element Element to add sl@0: * \param elementBelow Element above which the new element should be sl@0: * inserted. sl@0: * \return WFCErrorCode sl@0: */ sl@0: sl@0: OWF_API_CALL WFCErrorCode sl@0: WFC_Scene_InsertElement(WFC_SCENE* scene, sl@0: WFC_ELEMENT* element, sl@0: WFCElement elementBelow); sl@0: sl@0: /*! sl@0: * \brief Remove element from scene sl@0: * sl@0: * \param scene Scene sl@0: * \param element Element to remove sl@0: * sl@0: * \return WFCErrorCode sl@0: */ sl@0: OWF_API_CALL void sl@0: WFC_Scene_RemoveElement(WFC_SCENE* scene, sl@0: WFCElement element); sl@0: sl@0: sl@0: /*! sl@0: * \brief Get element's neighbour element (i.e. element on top of it sl@0: * or underneath it) sl@0: * sl@0: * \param scene Scene sl@0: * \param element Element sl@0: * \param n Neighbour element offset (< 0 for elements underneath, sl@0: * > 0 for elements on top) sl@0: * sl@0: * \return Neigbour element id or WFC_INVALID_HANDLE sl@0: */ sl@0: OWF_API_CALL WFCElement sl@0: WFC_Scene_GetNeighbourElement(WFC_SCENE* scene, WFCElement element, WFCint n); sl@0: sl@0: /*! sl@0: * \brief Search the scene for given element. sl@0: * sl@0: * \param scene Scene to search sl@0: * \param element Handle of the element to find sl@0: * sl@0: */ sl@0: OWF_API_CALL WFC_ELEMENT* sl@0: WFC_Scene_FindElement(WFC_SCENE* scene, sl@0: WFCElement element); sl@0: /*! sl@0: * \brief Unlock scene sources & masks. sl@0: * sl@0: * \param scene Scene sl@0: */ sl@0: OWF_API_CALL void sl@0: WFC_Scene_UnlockSourcesAndMasks(WFC_SCENE* scene); sl@0: sl@0: /*! sl@0: * \brief Lock all sources' & masks' streams for reading prior to rendering. sl@0: sl@0: * Locking is actually just acquiring the read buffer for each source/mask sl@0: * stream. sl@0: * sl@0: * All source read buffers must be acquired before the composition starts sl@0: * because if multiple elements share same source, they all should get same sl@0: * frame from that source. sl@0: * sl@0: * If each source buffer were locked/unlocked multiple times during sl@0: * composition (i.e. once for each element that uses it), the buffer sl@0: * contents might change between elements thus yielding wrong visual results. sl@0: * sl@0: * \param scene Scene sl@0: */ sl@0: OWF_API_CALL void sl@0: WFC_Scene_LockSourcesAndMasks(WFC_SCENE* scene); sl@0: sl@0: /*! sl@0: * \brief Check scene for conflicts sl@0: * sl@0: * \param scene Scene to check sl@0: * sl@0: * \return WFC_TRUE if there's a conflict (inconsistency) in the sl@0: * scene graph, WFC_FALSE otherwise. sl@0: */ sl@0: OWF_API_CALL WFCboolean sl@0: WFC_Scene_HasConflicts(WFC_SCENE* scene); sl@0: sl@0: /*! sl@0: * \brief Commit changes to scene sl@0: * sl@0: * \param scene Scene sl@0: */ sl@0: OWF_API_CALL void sl@0: WFC_Scene_Commit(WFC_SCENE* scene); sl@0: sl@0: /*! sl@0: * Return handle of the lowest element in the scene. sl@0: * sl@0: * \param scene Scene sl@0: * \return Handle of the bottom element sl@0: */ sl@0: OWF_API_CALL WFCElement sl@0: WFC_Scene_LowestElement(WFC_SCENE* scene); sl@0: sl@0: /*! sl@0: * \brief Search for the topmost element sl@0: * sl@0: * \param scene Scene to search sl@0: * \return pointer to the topmost element sl@0: */ sl@0: OWF_API_CALL WFC_ELEMENT* sl@0: WFC_Scene_TopMostElement(WFC_SCENE* scene); sl@0: sl@0: #ifdef __cplusplus sl@0: } sl@0: #endif sl@0: #endif /* WFCSCENE_H_ */