088fb7a67e836ba05ea2ecbfbb4cffbafa4f5523
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / control-depth-index-ranges.h
1 #ifndef __DALI_TOOLKIT_DEVEL_CONTROL_DEPTH_INDEX_RANGES_H__
2 #define __DALI_TOOLKIT_DEVEL_CONTROL_DEPTH_INDEX_RANGES_H__
3
4 /*
5  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <dali/public-api/common/compile-time-assert.h>
23 #include <dali/devel-api/actors/layer-devel.h>
24
25 namespace Dali
26 {
27
28 namespace Toolkit
29 {
30
31 namespace DepthIndex
32 {
33
34 // The negative value for background effect and background has been
35 // chosen so that newer controls can have content without setting
36 // depth index, and go in front of native controls with a background.
37 // This backround negative value means that the highest possible value
38 // is SIBLING_ORDER_MULTIPLIER-BACKGROUND_EFFECT-1.  The divisor of
39 // 100 ensures the range fits within the sibling order range, and has
40 // enough gaps to allow Control Authors to use other intermediate depths.
41
42 enum Ranges
43 {
44   BACKGROUND_EFFECT = -2 * DevelLayer::SIBLING_ORDER_MULTIPLIER/100,
45   BACKGROUND    =     -1 * DevelLayer::SIBLING_ORDER_MULTIPLIER/100,
46   CONTENT       =      0,
47   DECORATION    =      1 * DevelLayer::SIBLING_ORDER_MULTIPLIER/100,
48   FOREGROUND_EFFECT =  2 * DevelLayer::SIBLING_ORDER_MULTIPLIER/100
49 };
50
51 DALI_COMPILE_TIME_ASSERT( (unsigned int)DevelLayer::ACTOR_DEPTH_MULTIPLIER > (unsigned int)DevelLayer::SIBLING_ORDER_MULTIPLIER );
52 DALI_COMPILE_TIME_ASSERT( BACKGROUND_EFFECT < BACKGROUND );
53 DALI_COMPILE_TIME_ASSERT( BACKGROUND < CONTENT );
54 DALI_COMPILE_TIME_ASSERT( CONTENT < DECORATION );
55 DALI_COMPILE_TIME_ASSERT( DECORATION < FOREGROUND_EFFECT );
56
57 } // namespace DepthIndex
58
59 } // namespace Toolkit
60
61 } // namespace Dali
62
63 #endif // __DALI_TOOLKIT_DEVEL_CONTROL_DEPTH_INDEX_RANGES_H__