Purge underscored header file barriers
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / control-depth-index-ranges.h
index d010c11..6c4ed30 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_DEVEL_CONTROL_DEPTH_INDEX_RANGES_H__
-#define __DALI_TOOLKIT_DEVEL_CONTROL_DEPTH_INDEX_RANGES_H__
+#ifndef DALI_TOOLKIT_DEVEL_CONTROL_DEPTH_INDEX_RANGES_H
+#define DALI_TOOLKIT_DEVEL_CONTROL_DEPTH_INDEX_RANGES_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,7 +19,8 @@
  */
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/actors/layer.h>
+#include <dali/public-api/common/compile-time-assert.h>
+#include <dali/devel-api/actors/layer-devel.h>
 
 namespace Dali
 {
@@ -30,18 +31,33 @@ namespace Toolkit
 namespace DepthIndex
 {
 
+// The negative value for background effect and background has been
+// chosen so that newer controls can have content without setting
+// depth index, and go in front of native controls with a background.
+// This backround negative value means that the highest possible value
+// is SIBLING_ORDER_MULTIPLIER-BACKGROUND_EFFECT-1.  The divisor of
+// 100 ensures the range fits within the sibling order range, and has
+// enough gaps to allow Control Authors to use other intermediate depths.
+
 enum Ranges
 {
-    BACKGROUND    = -Dali::Layer::TREE_DEPTH_MULTIPLIER / 10,
-    CONTENT       = 0,
-    TEXT          = Dali::Layer::TREE_DEPTH_MULTIPLIER / 100,
-    DECORATION    = Dali::Layer::TREE_DEPTH_MULTIPLIER / 10
+  BACKGROUND_EFFECT = -2 * DevelLayer::SIBLING_ORDER_MULTIPLIER/100,
+  BACKGROUND    =     -1 * DevelLayer::SIBLING_ORDER_MULTIPLIER/100,
+  CONTENT       =      0,
+  DECORATION    =      1 * DevelLayer::SIBLING_ORDER_MULTIPLIER/100,
+  FOREGROUND_EFFECT =  2 * DevelLayer::SIBLING_ORDER_MULTIPLIER/100
 };
 
+DALI_COMPILE_TIME_ASSERT( (unsigned int)DevelLayer::ACTOR_DEPTH_MULTIPLIER > (unsigned int)DevelLayer::SIBLING_ORDER_MULTIPLIER );
+DALI_COMPILE_TIME_ASSERT( BACKGROUND_EFFECT < BACKGROUND );
+DALI_COMPILE_TIME_ASSERT( BACKGROUND < CONTENT );
+DALI_COMPILE_TIME_ASSERT( CONTENT < DECORATION );
+DALI_COMPILE_TIME_ASSERT( DECORATION < FOREGROUND_EFFECT );
+
 } // namespace DepthIndex
 
 } // namespace Toolkit
 
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_DEVEL_CONTROL_DEPTH_INDEX_RANGES_H__
+#endif // DALI_TOOLKIT_DEVEL_CONTROL_DEPTH_INDEX_RANGES_H