os/graphics/graphicscomposition/openwfcompositionengine/composition/include/wfcscene.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
/* Copyright (c) 2009 The Khronos Group Inc.
sl@0
     2
 * Portions copyright (c) 2009-2010  Nokia Corporation and/or its subsidiary(-ies)
sl@0
     3
 *
sl@0
     4
 * Permission is hereby granted, free of charge, to any person obtaining a
sl@0
     5
 * copy of this software and/or associated documentation files (the
sl@0
     6
 * "Materials"), to deal in the Materials without restriction, including
sl@0
     7
 * without limitation the rights to use, copy, modify, merge, publish,
sl@0
     8
 * distribute, sublicense, and/or sell copies of the Materials, and to
sl@0
     9
 * permit persons to whom the Materials are furnished to do so, subject to
sl@0
    10
 * the following conditions:
sl@0
    11
 *
sl@0
    12
 * The above copyright notice and this permission notice shall be included
sl@0
    13
 * in all copies or substantial portions of the Materials.
sl@0
    14
 *
sl@0
    15
 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
sl@0
    16
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
sl@0
    17
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
sl@0
    18
 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
sl@0
    19
 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
sl@0
    20
 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
sl@0
    21
 * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
sl@0
    22
 */
sl@0
    23
sl@0
    24
/*! \ingroup wfc
sl@0
    25
 *  \file wfcscene.h
sl@0
    26
 *
sl@0
    27
 *  \brief Scene handling interface
sl@0
    28
 */
sl@0
    29
sl@0
    30
#ifndef WFCSCENE_H_
sl@0
    31
#define WFCSCENE_H_
sl@0
    32
sl@0
    33
#include "WF/wfc.h"
sl@0
    34
#include "wfcelement.h"
sl@0
    35
sl@0
    36
#include "owfpool.h"
sl@0
    37
#ifdef __cplusplus
sl@0
    38
extern "C" {
sl@0
    39
#endif
sl@0
    40
sl@0
    41
/*!
sl@0
    42
 *  \brief Clone a scene
sl@0
    43
 *
sl@0
    44
 *  \param scene Pointer to scene to clone
sl@0
    45
 *  \returns cloned scene
sl@0
    46
 */
sl@0
    47
OWF_API_CALL WFC_SCENE*
sl@0
    48
WFC_Scene_Clone(WFC_SCENE* scene);
sl@0
    49
sl@0
    50
/*!
sl@0
    51
 *  \brief Create new scene in a context
sl@0
    52
 *
sl@0
    53
 *  \param context          Context to create the scene in
sl@0
    54
 *
sl@0
    55
 *  \return New scene object
sl@0
    56
 */
sl@0
    57
OWF_API_CALL WFC_SCENE*
sl@0
    58
WFC_Scene_Create(WFC_CONTEXT* context);
sl@0
    59
sl@0
    60
/*!
sl@0
    61
 *  \brief Destroy a scene.
sl@0
    62
 *
sl@0
    63
 *  Free all resources used by the scene and return the
sl@0
    64
 *  scene object into the scene pool
sl@0
    65
 *
sl@0
    66
 *  \param scene            Scene
sl@0
    67
 */
sl@0
    68
sl@0
    69
OWF_API_CALL void
sl@0
    70
WFC_Scene_Destroy(WFC_SCENE* scene);
sl@0
    71
sl@0
    72
/*!
sl@0
    73
 *  \brief Insert element to scene above given element
sl@0
    74
 *
sl@0
    75
 *  \param scene            Scene
sl@0
    76
 *  \param element          Element to add
sl@0
    77
 *  \param elementBelow     Element above which the new element should be
sl@0
    78
 *                          inserted.
sl@0
    79
 *  \return WFCErrorCode
sl@0
    80
 */
sl@0
    81
sl@0
    82
OWF_API_CALL WFCErrorCode
sl@0
    83
WFC_Scene_InsertElement(WFC_SCENE* scene,
sl@0
    84
                        WFC_ELEMENT* element,
sl@0
    85
                        WFCElement elementBelow);
sl@0
    86
sl@0
    87
/*!
sl@0
    88
 *  \brief Remove element from scene
sl@0
    89
 *
sl@0
    90
 *  \param scene            Scene
sl@0
    91
 *  \param element          Element to remove
sl@0
    92
 *
sl@0
    93
 *  \return WFCErrorCode
sl@0
    94
 */
sl@0
    95
OWF_API_CALL void
sl@0
    96
WFC_Scene_RemoveElement(WFC_SCENE* scene,
sl@0
    97
                        WFCElement element);
sl@0
    98
sl@0
    99
sl@0
   100
/*!
sl@0
   101
 *  \brief Get element's neighbour element (i.e. element on top of it
sl@0
   102
 *  or underneath it)
sl@0
   103
 *
sl@0
   104
 *  \param scene Scene
sl@0
   105
 *  \param element Element
sl@0
   106
 *  \param n Neighbour element offset (< 0 for elements underneath,
sl@0
   107
 *  > 0 for elements on top)
sl@0
   108
 *
sl@0
   109
 *  \return Neigbour element id or WFC_INVALID_HANDLE
sl@0
   110
 */
sl@0
   111
OWF_API_CALL WFCElement
sl@0
   112
WFC_Scene_GetNeighbourElement(WFC_SCENE* scene, WFCElement element, WFCint n);
sl@0
   113
sl@0
   114
/*!
sl@0
   115
 *  \brief Search the scene for given element.
sl@0
   116
 *
sl@0
   117
 *  \param scene            Scene to search
sl@0
   118
 *  \param element          Handle of the element to find
sl@0
   119
 *
sl@0
   120
 */
sl@0
   121
OWF_API_CALL WFC_ELEMENT*
sl@0
   122
WFC_Scene_FindElement(WFC_SCENE* scene,
sl@0
   123
                      WFCElement element);
sl@0
   124
/*!
sl@0
   125
 *  \brief Unlock scene sources & masks.
sl@0
   126
 *
sl@0
   127
 *  \param scene            Scene
sl@0
   128
 */
sl@0
   129
OWF_API_CALL void
sl@0
   130
WFC_Scene_UnlockSourcesAndMasks(WFC_SCENE* scene);
sl@0
   131
sl@0
   132
/*!
sl@0
   133
 *  \brief Lock all sources' & masks' streams for reading prior to rendering.
sl@0
   134
sl@0
   135
 *  Locking is actually just acquiring the read buffer for each source/mask
sl@0
   136
 *  stream.
sl@0
   137
 *
sl@0
   138
 *  All source read buffers must be acquired before the composition starts
sl@0
   139
 *  because if multiple elements share same source, they all should get same
sl@0
   140
 *  frame from that source.
sl@0
   141
 *
sl@0
   142
 *  If each source buffer were locked/unlocked multiple times during
sl@0
   143
 *  composition (i.e. once for each element that uses it), the buffer
sl@0
   144
 *  contents might change between elements thus yielding wrong visual results.
sl@0
   145
 *
sl@0
   146
 *  \param scene            Scene
sl@0
   147
 */
sl@0
   148
OWF_API_CALL void
sl@0
   149
WFC_Scene_LockSourcesAndMasks(WFC_SCENE* scene);
sl@0
   150
sl@0
   151
/*!
sl@0
   152
 *  \brief Check scene for conflicts
sl@0
   153
 *
sl@0
   154
 *  \param scene            Scene to check
sl@0
   155
 *
sl@0
   156
 *  \return WFC_TRUE if there's a conflict (inconsistency) in the
sl@0
   157
 *  scene graph, WFC_FALSE otherwise.
sl@0
   158
 */
sl@0
   159
OWF_API_CALL WFCboolean
sl@0
   160
WFC_Scene_HasConflicts(WFC_SCENE* scene);
sl@0
   161
sl@0
   162
/*!
sl@0
   163
 *  \brief Commit changes to scene
sl@0
   164
 *
sl@0
   165
 *  \param scene            Scene
sl@0
   166
 */
sl@0
   167
OWF_API_CALL void
sl@0
   168
WFC_Scene_Commit(WFC_SCENE* scene);
sl@0
   169
sl@0
   170
/*!
sl@0
   171
 *  Return handle of the lowest element in the scene.
sl@0
   172
 *
sl@0
   173
 *  \param scene Scene
sl@0
   174
 *  \return Handle of the bottom element
sl@0
   175
 */
sl@0
   176
OWF_API_CALL WFCElement
sl@0
   177
WFC_Scene_LowestElement(WFC_SCENE* scene);
sl@0
   178
sl@0
   179
/*!
sl@0
   180
 *  \brief Search for the topmost element
sl@0
   181
 *
sl@0
   182
 *  \param scene            Scene to search
sl@0
   183
 *  \return pointer to the topmost element
sl@0
   184
 */
sl@0
   185
OWF_API_CALL WFC_ELEMENT*
sl@0
   186
WFC_Scene_TopMostElement(WFC_SCENE* scene);
sl@0
   187
sl@0
   188
#ifdef __cplusplus
sl@0
   189
}
sl@0
   190
#endif
sl@0
   191
#endif /* WFCSCENE_H_ */