Revert "[3.0] Clipping API feature in Actor" 32/97732/1
authordongsug.song <dongsug.song@samsung.com>
Tue, 15 Nov 2016 02:37:56 +0000 (11:37 +0900)
committerdongsug.song <dongsug.song@samsung.com>
Tue, 15 Nov 2016 02:38:00 +0000 (11:38 +0900)
This reverts commit 13884a91d160af26b131a9b4b1e18cb9f0177435.

Change-Id: Id302668c16c78784dc331dfb37561144d1d77152

automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-trace-call-stack.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-trace-call-stack.h
dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp
dali-toolkit/internal/controls/text-controls/text-selection-toolbar-impl.cpp
dali-toolkit/internal/controls/text-controls/text-selection-toolbar-impl.h
plugins/dali-script-v8/src/constants/constants-wrapper.cpp

index 0054e59..3f2e6e5 100644 (file)
@@ -130,18 +130,6 @@ bool TraceCallStack::FindMethodAndParams(std::string method, const NamedParams&
   return FindIndexFromMethodAndParams( method, params ) > -1;
 }
 
-bool TraceCallStack::FindMethodAndParamsFromStartIndex( std::string method, std::string params, size_t& startIndex ) const
-{
-  for( size_t i = startIndex; i < mCallStack.size(); ++i )
-  {
-    if( ( mCallStack[i].method.compare( method ) == 0 ) && ( mCallStack[i].paramList.compare( params ) == 0 ) )
-    {
-      startIndex = i;
-      return true;
-    }
-  }
-  return false;
-}
 
 /**
  * Search for a method in the stack with the given parameter list
index e1882ea..137bfaf 100644 (file)
@@ -102,19 +102,6 @@ public:
   bool FindMethodAndParams(std::string method, const NamedParams& params) const;
 
   /**
-   * Search for a method in the stack with the given parameter list.
-   * The search is done from a given index.
-   * This allows the order of methods and parameters to be checked.
-   * @param[in] method The name of the method
-   * @param[in] params A comma separated list of parameter values
-   * @param[in/out] startIndex The method index to start looking from.
-   *                This is updated if a method is found so subsequent
-   *                calls can search for methods occuring after this one.
-   * @return True if the method was in the stack
-   */
-  bool FindMethodAndParamsFromStartIndex( std::string method, std::string params, size_t& startIndex ) const;
-
-  /**
    * Search for a method in the stack with the given parameter list
    * @param[in] method The name of the method
    * @param[in] params A comma separated list of parameter values
index f3670fd..2248668 100644 (file)
@@ -386,10 +386,6 @@ void TextSelectionPopup::OnInitialize()
   Actor self = Self();
   self.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS );
   self.SetProperty( Actor::Property::COLOR_ALPHA, 0.0f );
-
-  // The Popup Control background is a nine-patch image. We clip against this so the
-  // contents are correctly clipped against the edges of the nine-patch.
-  self.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
 }
 
 void TextSelectionPopup::OnStageConnection( int depth )
index b217be5..b87dab2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
@@ -163,10 +163,10 @@ void TextSelectionToolbar::OnStageConnection( int depth )
 void TextSelectionToolbar::SetPopupMaxSize( const Size& maxSize )
 {
   mMaxSize = maxSize;
-  if (mScrollView && mToolbarLayer )
+  if (mScrollView && mStencilLayer )
   {
     mScrollView.SetMaximumSize( mMaxSize );
-    mToolbarLayer.SetMaximumSize( mMaxSize );
+    mStencilLayer.SetMaximumSize( mMaxSize );
   }
 }
 
@@ -198,18 +198,23 @@ void TextSelectionToolbar::SetUpScrollView()
 void TextSelectionToolbar::SetUp()
 {
   Actor self = Self();
-
   self.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS );
 
-  // Create Layer to house the toolbar.
-  mToolbarLayer = Layer::New();
-  mToolbarLayer.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS );
-  mToolbarLayer.SetAnchorPoint( AnchorPoint::CENTER );
-  mToolbarLayer.SetParentOrigin( ParentOrigin::CENTER );
+  // Create Layer and Stencil.  Layer enable's clipping when content exceed maximum defined width.
+  mStencilLayer = Layer::New();
+  mStencilLayer.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS );
+  mStencilLayer.SetParentOrigin( ParentOrigin::CENTER );
+
+  BufferImage stencilImage = BufferImage::WHITE(); // ImageView needs an Image or does nothing
+  Toolkit::ImageView stencil = Toolkit::ImageView::New(stencilImage);
+  stencil.SetDrawMode( DrawMode::STENCIL );
+  stencil.SetVisible( true );
+  stencil.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+  stencil.SetParentOrigin( ParentOrigin::CENTER );
 
-  if( !mScrollView )
+  if ( !mScrollView )
   {
-    mScrollView = Toolkit::ScrollView::New();
+    mScrollView  = Toolkit::ScrollView::New();
   }
   SetUpScrollView();
 
@@ -219,10 +224,10 @@ void TextSelectionToolbar::SetUp()
   mTableOfButtons.SetParentOrigin( ParentOrigin::CENTER_LEFT );
   mTableOfButtons.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
 
+  mStencilLayer.Add( stencil );
+  mStencilLayer.Add( mScrollView );
   mScrollView.Add( mTableOfButtons );
-  mToolbarLayer.Add( mScrollView );
-
-  self.Add( mToolbarLayer );
+  self.Add( mStencilLayer );
 }
 
 void TextSelectionToolbar::OnScrollStarted( const Vector2& position )
@@ -260,7 +265,7 @@ void TextSelectionToolbar::ResizeDividers( Size& size )
 
 void TextSelectionToolbar::RaiseAbove( Layer target )
 {
-  mToolbarLayer.RaiseAbove( target );
+  mStencilLayer.RaiseAbove( target );
 }
 
 void TextSelectionToolbar::ConfigureScrollview( const Property::Map& properties )
index 46e633b..7997bfa 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef DALI_TOOLKIT_INTERNAL_TEXT_SELECTION_TOOLBAR_H
-#define DALI_TOOLKIT_INTERNAL_TEXT_SELECTION_TOOLBAR_H
+#ifndef __DALI_TOOLKIT_INTERNAL_TEXT_SELECTION_TOOLBAR_H__
+#define __DALI_TOOLKIT_INTERNAL_TEXT_SELECTION_TOOLBAR_H__
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
@@ -160,7 +160,7 @@ private:
 
 private: // Data
 
-  Layer mToolbarLayer;                                ///< The layer used to house the toolbar.
+  Layer mStencilLayer;                                ///< The stencil layer
   Toolkit::TableView mTableOfButtons;                 ///< Actor which holds all the buttons, sensitivity can be set on buttons via this actor
   Toolkit::ScrollView mScrollView;                    ///< Provides scrolling of Toolbar when content does not fit.
   RulerPtr mRulerX;                                   ///< Ruler to clamp horizontal scrolling. Updates on Relayout
@@ -196,4 +196,4 @@ inline const Toolkit::Internal::TextSelectionToolbar& GetImpl( const Toolkit::Te
 
 } // namespace Dali
 
-#endif // DALI_TOOLKIT_INTERNAL_TEXT_SELECTION_TOOLBAR_H
+#endif // __DALI_TOOLKIT_INTERNAL_TEXT_SELECTION_TOOLBAR_H__
index 5ea93df..15252da 100644 (file)
@@ -159,6 +159,7 @@ const IntegerPair EnumTable[] =
 
     { "DRAW_MODE_NORMAL",                                   DrawMode::NORMAL     },
     { "DRAW_MODE_OVERLAY_2D",                               DrawMode::OVERLAY_2D },
+    { "DRAW_MODE_STENCIL",                                  DrawMode::STENCIL    },
 
     { "RESOURCE_LOADING",                                   Dali::ResourceLoading },
     { "RESOURCE_LOADING_SUCCEEDED",                         Dali::ResourceLoadingSucceeded  },
@@ -277,11 +278,14 @@ const IntegerPair EnumTable[] =
     { "ALPHA_FUNCTION_SIN",                   AlphaFunction::SIN                  },
     { "ALPHA_FUNCTION_EASE_OUT_BACK",         AlphaFunction::EASE_OUT_BACK        },
 
-    { "CLIPPING_MODE_DISABLED",                     ClippingMode::DISABLED                     },
-    { "CLIPPING_MODE_CLIP_CHILDREN",                ClippingMode::CLIP_CHILDREN                },
 };
 const unsigned int EnumTableCount = sizeof(EnumTable)/sizeof(EnumTable[0]);
 
+
+
+
+
+
 } // un-named name space