Merge remote-tracking branch 'origin/tizen' into new_text
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / scrollable / item-view / depth-layout.cpp
index 11b97a7..564235c 100644 (file)
@@ -1,26 +1,29 @@
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+/*
+ * Copyright (c) 2014 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali-toolkit/public-api/controls/scrollable/item-view/depth-layout.h>
 
+// EXTERNAL INCLUDES
 #include <algorithm>
-
-#include <dali-toolkit/public-api/controls/scrollable/item-view/depth-layout.h>
+#include <dali/public-api/animation/animation.h>
 
 using namespace Dali;
 using namespace Dali::Toolkit;
-using namespace std;
 
 namespace // unnamed namespace
 {
@@ -56,7 +59,7 @@ struct GetColumnPositionDefaultFunction
                    float layoutWidth)
   {
     // Share the available space between margins & column spacings
-    float availableSpace = max(0.0f, (layoutWidth - itemSize.width*numberOfColumns));
+    float availableSpace = std::max(0.0f, (layoutWidth - itemSize.width*numberOfColumns));
 
     float leftMargin = availableSpace/numberOfColumns * 0.5f;
 
@@ -308,7 +311,7 @@ struct DepthColorConstraint
 
     if (row < 0.0f)
     {
-      darkness = alpha = max(0.0f, 1.0f + row);
+      darkness = alpha = std::max(0.0f, 1.0f + row);
     }
     else
     {
@@ -323,7 +326,7 @@ struct DepthColorConstraint
 
       if (row > (mNumberOfRows-1.0f))
       {
-        alpha = max(0.0f, 1.0f - (row-(mNumberOfRows-1.0f)));
+        alpha = std::max(0.0f, 1.0f - (row-(mNumberOfRows-1.0f)));
       }
     }
 
@@ -547,8 +550,8 @@ ItemRange DepthLayout::GetItemsWithinArea(float firstItemPosition, Vector3 layou
   float firstRow = -(firstItemPosition/mImpl->mNumberOfColumns);
   float lastRow = firstRow + mImpl->mNumberOfRows * 0.5f;
 
-  unsigned int firstItem = static_cast<unsigned int>(max(0.0f, firstRow * mImpl->mNumberOfColumns));
-  unsigned int lastItem  = static_cast<unsigned int>(max(0.0f, lastRow  * mImpl->mNumberOfColumns));
+  unsigned int firstItem = static_cast<unsigned int>(std::max(0.0f, firstRow * mImpl->mNumberOfColumns));
+  unsigned int lastItem  = static_cast<unsigned int>(std::max(0.0f, lastRow  * mImpl->mNumberOfColumns));
 
   return ItemRange(firstItem, lastItem+1);
 }
@@ -572,7 +575,7 @@ void DepthLayout::GetResizeAnimation(Animation& animation, Actor actor, Vector3
 {
   if(animation)
   {
-    animation.Resize(actor, size);
+    animation.AnimateTo( Property( actor, Actor::Property::SIZE ), size );
   }
 }