[3.0] Version downgrade (1.2.0 to 1.1.45) 69/84669/6
authortaeyoon <taeyoon0.lee@samsung.com>
Mon, 22 Aug 2016 02:29:30 +0000 (11:29 +0900)
committerTaeyoon Lee <taeyoon0.lee@samsung.com>
Mon, 22 Aug 2016 05:51:27 +0000 (22:51 -0700)
  Final integration work for tizen 3.0 merged 1.2.0 dali in tizen branch.

  1.2.0 already includes new features (Public-APIs) for next tizen release.
  For tizen 3.0, we downgrade tizen branch to 1.1.45

This reverts commit 707333599e29423db3bf26b945f35bb3070897e0.

Conflicts:
packaging/dali-addon.spec

Revert "Preparation for minor version upgrade"

This reverts commit 19dfaca56bd409626a14b50d7d9cc22a958d93f4.

Revert "Batching clean-up"

This reverts commit afe38927f068846eaa02c374430da05f6209a6f9.

Revert "Adding ObjectDestructionTracker to dali-test-suite-utils for testing object destruction"

This reverts commit 56b4ea70c3d00b35bd517f532c5229902795bff6.

Revert "Geometry Batching"

This reverts commit f29b744f4c9d27aeb355319712313876bb236bca.

Revert "Added missing newline chars to logging commands"

This reverts commit 9ca43010ae274e019743c95a3bed73fd2e151bcd.

Revert "Adding RegisterVisual API to Control base class"

This reverts commit e14d00568eab69d46e78db427d91e33513fd662b.

Revert "Fix the broken build for JavaScript plugin"

This reverts commit 60e86925712d9ec15583644dddaba523c16e8882.

Revert "Fix text's highlight box."

This reverts commit b2d83201fba837ae079d0f608517884def2c43c7.

Revert "Reposition the text's popup when the text is scrolled."

This reverts commit 549dd9160d48572dcbfbae6ae87ae6d8f749aa83.

Revert "Renderer Depth UTCs + test-gl-abstraction update"

This reverts commit d7708e4df9cd7392fd0d2c880f47d8b703b2b8e6.

Revert "Text - Replace the if/else in the ChangeState method by a switch/case."

This reverts commit 12fe9741661d0fefaabddd959d04566a0a2d2233.

Change-Id: I57d0366d424a006dee3d1bd4292e0cc3795801bf

45 files changed:
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-test-suite-utils.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-test-suite-utils.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.h
automated-tests/src/dali-toolkit/utc-Dali-Button.cpp
automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp
automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp
automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp
build/tizen/docs/dali.doxy.in
dali-toolkit/dali-toolkit.h
dali-toolkit/internal/accessibility-manager/accessibility-manager-impl.cpp
dali-toolkit/internal/controls/buttons/button-impl.cpp
dali-toolkit/internal/file.list
dali-toolkit/internal/text/decorator/text-decorator.cpp
dali-toolkit/internal/text/decorator/text-decorator.h
dali-toolkit/internal/text/rendering/text-backend-impl.cpp
dali-toolkit/internal/text/text-controller-impl.cpp
dali-toolkit/internal/text/text-controller-impl.h
dali-toolkit/internal/text/text-controller.cpp
dali-toolkit/internal/transition-effects/cube-transition-effect-impl.cpp
dali-toolkit/internal/visuals/border/border-visual.cpp
dali-toolkit/internal/visuals/color/color-visual.cpp
dali-toolkit/internal/visuals/gradient/gradient-visual.cpp
dali-toolkit/internal/visuals/image/batch-image-visual.cpp [deleted file]
dali-toolkit/internal/visuals/image/batch-image-visual.h [deleted file]
dali-toolkit/internal/visuals/image/image-visual.cpp
dali-toolkit/internal/visuals/visual-base-data-impl.cpp
dali-toolkit/internal/visuals/visual-base-impl.cpp
dali-toolkit/internal/visuals/visual-base-impl.h
dali-toolkit/internal/visuals/visual-factory-cache.cpp
dali-toolkit/internal/visuals/visual-factory-cache.h
dali-toolkit/internal/visuals/visual-factory-impl.cpp
dali-toolkit/internal/visuals/visual-string-constants.cpp
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/controls/control-impl.h
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.cpp
dali-toolkit/public-api/dali-toolkit-version.cpp
dali-toolkit/public-api/visuals/image-visual-properties.h
dali-toolkit/public-api/visuals/visual-properties.h
packaging/dali-toolkit.spec
plugins/dali-script-v8/src/rendering/texture-set-api.h
plugins/dali-script-v8/src/rendering/texture-set-wrapper.cpp
plugins/dali-script-v8/src/utils/v8-utils.cpp

index b50f506489cb409a7e291584187ab3a240ec60a7..467bb526280c47e3d8be9c943aa7e39a16464414 100644 (file)
@@ -337,51 +337,3 @@ BufferImage CreateBufferImage()
 {
   return CreateBufferImage(4, 4, Color::WHITE);
 }
-
-namespace Test
-{
-
-struct ObjectDestructionFunctor
-{
-  // Create a ObjectDestructionFunctor passing in a Dali::RefObject* to be monitored and a bool variable.
-  // Create ObjectRegistry instance and connect to the ObjectDestroyedSignal passing in the above functor for the callback.
-  // Get the ObjectPointer (Actor::GetObjectPtr) of the Actor to be checked for destruction and assign it to the Dali::RefObject*
-  // Check the bool variable which would be true when object destroyed.
-  ObjectDestructionFunctor( Dali::RefObject* objectPtr, bool& refObjectDestroyed )
-  : refObjectPointerToCheck( objectPtr ),
-    refObjectDestroyedBoolean( refObjectDestroyed )
-  {
-    refObjectDestroyed = false;
-  }
-
-  void operator()( const Dali::RefObject* objectPointer )
-  {
-    if ( refObjectPointerToCheck == objectPointer )
-    {
-      refObjectDestroyedBoolean = true;
-    }
-  }
-
-  Dali::RefObject* refObjectPointerToCheck;
-  bool& refObjectDestroyedBoolean;
-};
-
-ObjectDestructionTracker::ObjectDestructionTracker()
-  :mRefObjectDestroyed( false)
-{
-}
-
-void ObjectDestructionTracker::Start( Actor actor )
-{
-  ObjectDestructionFunctor destructionFunctor( actor.GetObjectPtr(), mRefObjectDestroyed );
-
-  ObjectRegistry objectRegistry = Stage::GetCurrent().GetObjectRegistry();
-  objectRegistry.ObjectDestroyedSignal().Connect( this, destructionFunctor );
-}
-
-bool ObjectDestructionTracker::IsDestroyed()
-{
-   return mRefObjectDestroyed;
-}
-
-} // namespace Test
index 9e0364bcc2654562235a57269b25dcf881628b8a..7f81872e1388101410e950f9cb6b514de80fd00e 100644 (file)
@@ -499,46 +499,4 @@ struct DefaultFunctionCoverage
 BufferImage CreateBufferImage();
 BufferImage CreateBufferImage(int width, int height, const Vector4& color);
 
-// Test namespace to prevent pollution of Dali namespace, add Test helper functions here
-namespace Test
-{
-/**
- *  @brief
- *
- *  Helper to check object destruction occurred
- *  1) In main part of code create an ObjectDestructionTracker
- *  2) Within sub section of main create object Actor test and call Start with Actor to test for destruction
- *  3) Perform code which is expected to destroy Actor
- *  4) Back in main part of code use IsDestroyed() to test if Actor was destroyed
- */
-class ObjectDestructionTracker : public ConnectionTracker
-{
-public:
-
-  /**
-   * @brief
-   *
-   * Call in main part of code
-   */
-  ObjectDestructionTracker();
-
-  /**
-   * @brief Call in sub bock of code where the Actor being checked is still alive.
-   *
-   * @param[in] actor Actor to be checked for destruction
-   */
-  void Start( Actor actor );
-
-  /**
-   * @brief Call to check if Actor alive or destroyed.
-   * @return bool true if Actor was destroyed
-   */
-  bool IsDestroyed();
-
-private:
-  bool mRefObjectDestroyed;
-};
-
-} // namespace Test
-
 #endif // __DALI_TEST_SUITE_UTILS_H__
index fcf6825ab898ae00aeed0992d59f37beb6ea7859..1a3490b8bdc363241a1a7838c655a719276939b7 100644 (file)
@@ -18,7 +18,6 @@
 #include "dummy-control.h"
 
 #include <dali-toolkit/dali-toolkit.h>
-#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
 
 namespace Dali
 {
@@ -75,16 +74,6 @@ DummyControlImpl::~DummyControlImpl()
 {
 }
 
-void DummyControlImpl::RegisterVisual( Property::Index index, Actor placementActor, Toolkit::Visual::Base visual )
-{
-  Control::RegisterVisual( index, placementActor, visual );
-}
-
-void DummyControlImpl::UnregisterVisual( Property::Index index )
-{
-  Control::UnregisterVisual( index );
-}
-
 DummyControl DummyControlImplOverride::New()
 {
   IntrusivePtr< DummyControlImplOverride > impl = new DummyControlImplOverride;
index 897fc17eb0d8d4feab39db14f0813c71acc7c09c..496786e335498ef228ee340578120b14898db5ba 100644 (file)
@@ -28,7 +28,7 @@ namespace Toolkit
 {
 
 class DummyControlImpl;
-class ControlRenderer;
+
 /**
  * Control does not have a New method so use this dummy class for the handle.
  */
@@ -71,9 +71,6 @@ public:
   inline TapGestureDetector GetTapGestureDetector() const { return Internal::Control::GetTapGestureDetector(); }
   inline LongPressGestureDetector GetLongPressGestureDetector() const { return Internal::Control::GetLongPressGestureDetector(); }
 
-  void RegisterVisual( Property::Index index, Actor placementActor, Toolkit::Visual::Base visual);
-  void UnregisterVisual( Property::Index index );
-
   // Used to test signal connections
   void CustomSlot1( Actor actor );
 
index 6e9b9f0e92d06d8513abb0b5bb67be858ffb53b2..d42a548e55509da3bcdd8cdf845bb6fc37747185 100644 (file)
@@ -70,7 +70,6 @@ void TestGlAbstraction::Initialize()
   mLastShaderIdUsed = 0;
   mLastProgramIdUsed = 0;
   mLastUniformIdUsed = 0;
-  mLastDepthMask = false;
 
   mUniforms.clear();
   mProgramUniforms1i.clear();
@@ -80,10 +79,8 @@ void TestGlAbstraction::Initialize()
   mProgramUniforms4f.clear();
 
   mCullFaceTrace.Reset();
-  mDepthFunctionTrace.Reset();
   mEnableDisableTrace.Reset();
   mShaderTrace.Reset();
-  mStencilFunctionTrace.Reset();
   mTextureTrace.Reset();
   mTexParamaterTrace.Reset();
   mDrawTrace.Reset();
index 10c326429ebe43375b6b0245deb5e5ba75aa6a08..1f5597700a4c0a2925a398ff1897ec5b590cebc8 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef TEST_GL_ABSTRACTION_H
-#define TEST_GL_ABSTRACTION_H
+#ifndef __TEST_GL_ABSTRACTION_H__
+#define __TEST_GL_ABSTRACTION_H__
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * 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.
@@ -468,12 +468,6 @@ public:
 
   inline void DepthMask(GLboolean flag)
   {
-    mLastDepthMask = flag;
-  }
-
-  inline bool GetLastDepthMask() const
-  {
-    return mLastDepthMask;
   }
 
   inline void DepthRangef(GLclampf zNear, GLclampf zFar)
@@ -2065,8 +2059,6 @@ private:
   GLenum  mLastBlendFuncSrcAlpha;
   GLenum  mLastBlendFuncDstAlpha;
 
-  GLboolean mLastDepthMask;
-
   // Data for manipulating the IDs returned by GenTextures
   GLuint mLastAutoTextureIdUsed;
   std::vector<GLuint> mNextTextureIds;
@@ -2266,4 +2258,6 @@ bool BlendEnabled(const Dali::TraceCallStack& callStack);
 bool BlendDisabled(const Dali::TraceCallStack& callStack);
 
 
-#endif // TEST_GL_ABSTRACTION_H
+
+
+#endif // __TEST_GL_ES_H__
index ead898d941a48be1f0a39d0227ee10998547596e..5aff1464b572a3f85539eaa4a259665448db8902 100644 (file)
@@ -972,38 +972,3 @@ int UtcDaliButtonSetUnSelectedColorP(void)
   END_TEST;
 }
 
-int UtcDaliButtonResetSelectedColorP(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliButtonSetSelectedColorP");
-
-  PushButton pushButton = PushButton::New();
-  Stage::GetCurrent().Add( pushButton );
-
-  application.SendNotification();
-  application.Render();
-
-  const Vector4 FIRST_COLOR = Color::BLUE;
-  const Vector4 SECOND_COLOR = Color::BLUE;
-
-  pushButton.SetSize( Vector2( 20.0f, 20.0f ) );
-  pushButton.SetProperty( Button::Property::SELECTED_COLOR, FIRST_COLOR );
-
-  application.SendNotification();
-  application.Render();
-
-  Vector4 color = pushButton.GetProperty<Vector4>( Button::Property::SELECTED_COLOR );
-
-  DALI_TEST_EQUALS( color, FIRST_COLOR, TEST_LOCATION );
-
-  pushButton.SetProperty( Button::Property::SELECTED_COLOR, SECOND_COLOR );
-
-  application.SendNotification();
-  application.Render();
-
-  color = pushButton.GetProperty<Vector4>( Button::Property::SELECTED_COLOR );
-
-  DALI_TEST_EQUALS( color, SECOND_COLOR, TEST_LOCATION );
-
-  END_TEST;
-}
index 09d1dd760e31c9b8546340e135ce9c53e9c51478..12ce9136af00224ffdd345a896821b2dbbfee81e 100644 (file)
@@ -25,7 +25,6 @@
 
 #include <dali.h>
 #include <dali-toolkit/dali-toolkit.h>
-#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
 #include <dali/integration-api/events/key-event-integ.h>
 #include <dali/integration-api/events/wheel-event-integ.h>
 #include <dali/integration-api/events/long-press-gesture-event.h>
@@ -945,174 +944,3 @@ int UtcDaliControlImplGetNextKeyboardFocusableActorP(void)
 
   END_TEST;
 }
-
-int UtcDaliControlImplRegisterThenReRegisterVisual(void)
-{
-  ToolkitTestApplication application;
-
-  DummyControl dummy = DummyControl::New();
-  DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
-
-  Property::Index index =1;
-  Actor placementActor = Actor::New();
-
-  Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
-  Toolkit::Visual::Base visual;
-
-  Property::Map map;
-  map[Visual::Property::TYPE] = Visual::COLOR;
-  map[ColorVisual::Property::MIX_COLOR] = Color::RED;
-
-  visual = visualFactory.CreateVisual( map );
-  DALI_TEST_CHECK(visual);
-
-  // Register index with a color visual
-  dummyImpl.RegisterVisual( index, placementActor, visual );
-
-
-  Property::Map newMap;
-  newMap[Visual::Property::TYPE] = Visual::COLOR;
-  newMap[ColorVisual::Property::MIX_COLOR] = Color::BLUE;
-
-  visual = visualFactory.CreateVisual( newMap );
-  DALI_TEST_CHECK(visual);
-
-  // ReRegister with altered color visual
-  dummyImpl.RegisterVisual( index, placementActor, visual );
-
-  tet_result(TET_PASS);
-
-  END_TEST;
-}
-
-int UtcDaliControlImplRegisterVisaulThenReRegisterToSelf(void)
-{
-  ToolkitTestApplication application;
-
-  DummyControl dummy = DummyControl::New();
-  DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
-
-  Property::Index index =1;
-  Actor placementActor = Actor::New();
-
-  Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
-  Toolkit::Visual::Base visual;
-
-  Property::Map map;
-  map[Visual::Property::TYPE] = Visual::COLOR;
-  map[ColorVisual::Property::MIX_COLOR] = Color::RED;
-
-  visual = visualFactory.CreateVisual( map );
-  DALI_TEST_CHECK(visual);
-
-  // Register index with a color visual
-  dummyImpl.RegisterVisual( index, placementActor, visual );
-
-  // ReRegister to self
-  dummyImpl.RegisterVisual( index, dummy, visual );
-
-  END_TEST;
-}
-
-int UtcDaliControlImplRegisterVisualToSelf(void)
-{
-  ToolkitTestApplication application;
-
-  Test::ObjectDestructionTracker objectDestructionTracker;
-
-  {
-    DummyControl dummy = DummyControl::New();
-    DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
-    objectDestructionTracker.Start( dummy );
-
-    Property::Index index = 1;
-    Actor placementActor = Actor::New();
-
-    Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
-    Toolkit::Visual::Base visual;
-
-    Property::Map map;
-    map[Visual::Property::TYPE] = Visual::COLOR;
-    map[ColorVisual::Property::MIX_COLOR] = Color::RED;
-
-    visual = visualFactory.CreateVisual( map );
-    DALI_TEST_CHECK(visual);
-
-    // Register to self
-    dummyImpl.RegisterVisual( index, dummy, visual );
-    DALI_TEST_EQUALS( objectDestructionTracker.IsDestroyed(), false, TEST_LOCATION ); // Control not destroyed yet
-  }
-
-  DALI_TEST_EQUALS( objectDestructionTracker.IsDestroyed(), true, TEST_LOCATION ); // Should be destroyed
-
-  END_TEST;
-}
-
-int UtcDaliControlImplRegisterTwoVisuals(void)
-{
-  ToolkitTestApplication application;
-
-  DummyControl dummy = DummyControl::New();
-  DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
-
-  Property::Index index =1;
-  Actor placementActor = Actor::New();
-
-  Property::Index index2 =2;
-  Actor secondPlacementActor = Actor::New();
-
-  Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
-  Toolkit::Visual::Base visual;
-  Toolkit::Visual::Base secondVisual;
-
-  Property::Map map;
-  map[Visual::Property::TYPE] = Visual::COLOR;
-  map[ColorVisual::Property::MIX_COLOR] = Color::RED;
-
-  visual = visualFactory.CreateVisual( map );
-  DALI_TEST_CHECK(visual);
-
-  // Register index with a color visual
-  dummyImpl.RegisterVisual( index, placementActor, visual );
-
-  Property::Map newMap;
-  newMap[Visual::Property::TYPE] = Visual::COLOR;
-  newMap[ColorVisual::Property::MIX_COLOR] = Color::BLUE;
-
-  secondVisual = visualFactory.CreateVisual( newMap );
-  DALI_TEST_CHECK( secondVisual );
-
-  // ReRegister with altered color visual
-  dummyImpl.RegisterVisual( index2, secondPlacementActor, secondVisual );
-
-  END_TEST;
-}
-
-int UtcDaliControlImplRegisterUnregisterVisual(void)
-{
-  ToolkitTestApplication application;
-
-  DummyControl dummy = DummyControl::New();
-  DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
-
-  Property::Index index =1;
-  Actor placementActor = Actor::New();
-
-  Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
-  Toolkit::Visual::Base visual;
-
-  Property::Map map;
-  map[Visual::Property::TYPE] = Visual::COLOR;
-  map[ColorVisual::Property::MIX_COLOR] = Color::RED;
-
-  visual = visualFactory.CreateVisual( map );
-  DALI_TEST_CHECK(visual);
-
-  // Register index with a color visual
-  dummyImpl.RegisterVisual( index, placementActor, visual );
-
-  // Unregister visual
-  dummyImpl.UnregisterVisual( index );
-
-  END_TEST;
-}
index ef9dab836de1358d0fb51c098c08c838119cafd4..b6080c3705971a0b655560845241e70a3972e2a2 100644 (file)
@@ -177,7 +177,7 @@ int UtcDaliVisualSize(void)
   gradientVisual.GetNaturalSize(naturalSize);
   DALI_TEST_EQUALS( naturalSize, Vector2::ZERO,TEST_LOCATION );
 
-  // svg visual
+  //svg visual
   Visual::Base svgVisual = factory.CreateVisual( TEST_SVG_FILE_NAME, ImageDimensions() );
   svgVisual.SetSize( visualSize );
   DALI_TEST_EQUALS( svgVisual.GetSize(), visualSize, TEST_LOCATION );
@@ -187,18 +187,6 @@ int UtcDaliVisualSize(void)
   //  <circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" />
   //  </svg>
   DALI_TEST_EQUALS( naturalSize, Vector2(100.f, 100.f), TEST_LOCATION );
-
-  // Batch Image visual
-  propertyMap.Clear();
-  propertyMap.Insert( Visual::Property::TYPE, Visual::IMAGE );
-  propertyMap.Insert( ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME );
-  propertyMap.Insert( ImageVisual::Property::BATCHING_ENABLED, true );
-  Visual::Base batchImageVisual = factory.CreateVisual( propertyMap );
-  batchImageVisual.SetSize( visualSize );
-  DALI_TEST_EQUALS( batchImageVisual.GetSize(), visualSize, TEST_LOCATION );
-  batchImageVisual.GetNaturalSize( naturalSize );
-  DALI_TEST_EQUALS( naturalSize, Vector2( 80.0f, 160.0f ), TEST_LOCATION );
-
   END_TEST;
 }
 
@@ -789,70 +777,3 @@ int UtcDaliVisualGetPropertyMap9(void)
 
   END_TEST;
 }
-
-int UtcDaliVisualGetPropertyMapBatchImageVisual(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline( "UtcDaliVisualGetPropertyMapBatchImageVisual:" );
-
-  VisualFactory factory = VisualFactory::Get();
-  Property::Map propertyMap;
-  propertyMap.Insert( Visual::Property::TYPE, Visual::IMAGE );
-  propertyMap.Insert( ImageVisual::Property::BATCHING_ENABLED, true );
-  propertyMap.Insert( ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME );
-  propertyMap.Insert( ImageVisual::Property::DESIRED_WIDTH, 20 );
-  propertyMap.Insert( ImageVisual::Property::DESIRED_HEIGHT, 30 );
-
-  Visual::Base batchImageVisual = factory.CreateVisual( propertyMap );
-  DALI_TEST_CHECK( batchImageVisual );
-
-  Property::Map resultMap;
-  batchImageVisual.CreatePropertyMap( resultMap );
-
-  // Check the property values from the returned map from visual
-  Property::Value* value = resultMap.Find( Visual::Property::TYPE, Property::INTEGER );
-  DALI_TEST_CHECK( value );
-  DALI_TEST_CHECK( value->Get<int>() == Visual::IMAGE );
-
-  value = resultMap.Find( ImageVisual::Property::URL, Property::STRING );
-  DALI_TEST_CHECK( value );
-  DALI_TEST_CHECK( value->Get<std::string>() == TEST_IMAGE_FILE_NAME );
-
-  value = resultMap.Find( ImageVisual::Property::DESIRED_WIDTH, Property::INTEGER );
-  DALI_TEST_CHECK( value );
-  DALI_TEST_CHECK( value->Get<int>() == 20 );
-
-  value = resultMap.Find( ImageVisual::Property::DESIRED_HEIGHT, Property::INTEGER );
-  DALI_TEST_CHECK( value );
-  DALI_TEST_CHECK( value->Get<int>() == 30 );
-
-  END_TEST;
-}
-
-int UtcDaliVisualGetPropertyMapBatchImageVisualNoAtlas(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline( "UtcDaliVisualGetPropertyMapBatchImageVisualNoAtlas:" );
-
-  VisualFactory factory = VisualFactory::Get();
-  Property::Map propertyMap;
-  propertyMap.Insert( Visual::Property::TYPE, Visual::IMAGE );
-  propertyMap.Insert( ImageVisual::Property::BATCHING_ENABLED, true );
-  propertyMap.Insert( ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME );
-
-  // Set the desired size to be larger than the atlas limit of 1024x1024.
-  propertyMap.Insert( ImageVisual::Property::DESIRED_WIDTH, 2048 );
-  propertyMap.Insert( ImageVisual::Property::DESIRED_HEIGHT, 2048 );
-
-  // Create the visual.
-  Visual::Base batchImageVisual = factory.CreateVisual( propertyMap );
-
-  DALI_TEST_CHECK( batchImageVisual );
-
-  Actor actor = Actor::New();
-  batchImageVisual.SetOnStage( actor );
-
-  DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
-
-  END_TEST;
-}
index 76d6aac900212f49043fe0d1f6f1814fa73b689a..f332a7f52a24b539a0e65d9389899b6d5dd08b29 100644 (file)
@@ -1511,110 +1511,3 @@ int UtcDaliVisualFactoryGetPrimitiveVisualN1(void)
 
   END_TEST;
 }
-
-int UtcDaliVisualFactoryGetBatchImageVisual1(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline( "UtcDaliVisualFactoryGetBatchImageVisual1: Request a Batch Image visual with a Property::Map" );
-
-  VisualFactory factory = VisualFactory::Get();
-  DALI_TEST_CHECK( factory );
-
-  Property::Map propertyMap;
-  propertyMap.Insert( Visual::Property::TYPE, Visual::IMAGE );
-  propertyMap.Insert( ImageVisual::Property::BATCHING_ENABLED, true );
-  propertyMap.Insert( ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME );
-
-  Visual::Base visual = factory.CreateVisual( propertyMap );
-  DALI_TEST_CHECK( visual );
-
-  Actor actor = Actor::New();
-
-  actor.SetSize( 200.0f, 200.0f );
-  Stage::GetCurrent().Add( actor );
-  visual.SetSize( Vector2( 200.0f, 200.0f ) );
-
-  // Test SetOnStage().
-  visual.SetOnStage( actor );
-  DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
-
-  application.SendNotification();
-  application.Render();
-
-  // Test SetOffStage().
-  visual.SetOffStage( actor );
-  DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
-
-  END_TEST;
-}
-
-int UtcDaliVisualFactoryGetBatchImageVisual2(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline( "UtcDaliVisualFactoryGetBatchImageVisual2: Request Batch Image visual from an Image Visual with batchingEnabled set" );
-
-  VisualFactory factory = VisualFactory::Get();
-  DALI_TEST_CHECK( factory );
-
-  Property::Map propertyMap;
-  // Create a normal Image Visual.
-  propertyMap.Insert( Visual::Property::TYPE, Visual::IMAGE );
-  // Instruct the factory to change Image Visuals to Batch-Image Visuals.
-  propertyMap.Insert( ImageVisual::Property::BATCHING_ENABLED, true );
-
-  // Properties for the Batch-Image Visual.
-  propertyMap.Insert( ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME );
-
-  Visual::Base visual = factory.CreateVisual( propertyMap );
-  DALI_TEST_CHECK( visual );
-
-  // Check that a Batch-Image visual was created instead of an Image visual.
-  Property::Map resultMap;
-  visual.CreatePropertyMap( resultMap );
-
-  Property::Value* value = resultMap.Find( Visual::Property::TYPE, Property::INTEGER );
-  DALI_TEST_CHECK( value );
-  DALI_TEST_EQUALS( value->Get<int>(), (int)Visual::IMAGE, TEST_LOCATION );
-
-  Actor actor = Actor::New();
-
-  actor.SetSize( 200.0f, 200.0f );
-  Stage::GetCurrent().Add( actor );
-  visual.SetSize( Vector2( 200.0f, 200.0f ) );
-
-  // Test SetOnStage().
-  visual.SetOnStage( actor );
-  DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
-
-  application.SendNotification();
-  application.Render();
-
-  // Test SetOffStage().
-  visual.SetOffStage( actor );
-  DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
-
-  END_TEST;
-}
-
-int UtcDaliVisualFactoryGetBatchImageVisual3(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline( "UtcDaliVisualFactoryGetBatchImageVisual3: Create an ImageView that uses a batched visual internally" );
-
-  VisualFactory factory = VisualFactory::Get();
-  DALI_TEST_CHECK( factory );
-
-  // Create a property-map that enables batching.
-  Property::Map propertyMap;
-  propertyMap.Insert( Dali::Toolkit::ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME );
-  propertyMap.Insert( ImageVisual::Property::BATCHING_ENABLED, true );
-
-  // Create an ImageView, passing the property-map in to instruct it to use batching.
-  Toolkit::ImageView imageView = Toolkit::ImageView::New();
-  imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, propertyMap );
-
-  imageView.SetSize( 200.0f, 200.0f );
-  Stage::GetCurrent().Add( imageView );
-
-  END_TEST;
-}
index 3653af78055ba8c180ce989e6636acfa03e98438..d2e0cae947ba8ca0c492294af01438fb603090fc 100644 (file)
@@ -344,11 +344,9 @@ ALIASES += clip{3}="\dontinclude \1 \n \skip \2 \n \until \3"
 # For Open Source DALi API Reference
 ALIASES += SINCE_1_0="@since 1.0"
 ALIASES += SINCE_1_1="@since 1.1"
-ALIASES += SINCE_1_2="@since 1.2"
 
 ALIASES += DEPRECATED_1_0="@deprecated Deprecated since 1.0"
 ALIASES += DEPRECATED_1_1="@deprecated Deprecated since 1.1"
-ALIASES += DEPRECATED_1_2="@deprecated Deprecated since 1.2"
 
 ALIASES += PLATFORM=""
 ALIASES += PRIVLEVEL_PLATFORM=""
index 2c5fe2a7bad3af788b49290570833e694a9af020..5a9d08d3239f87d03e50c63139e725514c30cad0 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef DALI_TOOLKIT_H
-#define DALI_TOOLKIT_H
+#ifndef __DALI_TOOLKIT_H__
+#define __DALI_TOOLKIT_H__
 
 /*
  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
@@ -73,4 +73,4 @@
 #include <dali-toolkit/public-api/enums.h>
 #include <dali-toolkit/public-api/toolkit-property-index-ranges.h>
 
-#endif // DALI_TOOLKIT_H
+#endif // __DALI_TOOLKIT_H__
index 6562a45d6dd4dedb662b3038ae5c4bfb0ef22a2a..b6c4e3b618f8f199b012ac6ab0e7ee13ad929188 100644 (file)
@@ -1313,7 +1313,7 @@ bool AccessibilityManager::HandlePanGesture(const Integration::PanGestureEvent&
 
     if(!mCurrentGesturedActor)
     {
-      DALI_LOG_ERROR("Gesture detected, but no hit actor\n");
+      DALI_LOG_ERROR("Gesture detected, but no hit actor");
     }
   }
 
@@ -1362,7 +1362,7 @@ bool AccessibilityManager::HandlePanGesture(const Integration::PanGestureEvent&
 
       if(!mCurrentGesturedActor)
       {
-        DALI_LOG_ERROR("no more gestured actor\n");
+        DALI_LOG_ERROR("no more gestured actor");
       }
     }
     else
index 53ccf416bf2426e9926060f51262cbd27ce68ecc..5fc7a898b86a00911af5ae855bc26402cc864ff3 100644 (file)
@@ -539,7 +539,6 @@ void Button::SetColor( const Vector4& color, Button::PaintState selectedState )
 {
   Actor* contentActor = NULL; // Using a pointer as SetupContent assigns the new Actor to this.
   bool imageFileExists = false;
-  Property::Index visualIndex = Toolkit::Button::Property::SELECTED_STATE_IMAGE;
 
   if ( selectedState == SelectedState || selectedState == DisabledSelectedState )
   {
@@ -552,7 +551,6 @@ void Button::SetColor( const Vector4& color, Button::PaintState selectedState )
     mUnselectedColor = color;
     contentActor = &mUnselectedContent;
     imageFileExists = !GetUnselectedImageFilename().empty();
-    visualIndex = Toolkit::Button::Property::UNSELECTED_STATE_IMAGE;
   }
 
   if ( contentActor )
@@ -566,17 +564,15 @@ void Button::SetColor( const Vector4& color, Button::PaintState selectedState )
     {
       // If there is no existing content, create a new actor to use for flat color.
       Actor placementActor = Actor::New();
-      Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
-      Toolkit::Visual::Base visual;
+      Toolkit::VisualFactory rendererFactory = Toolkit::VisualFactory::Get();
+      Toolkit::Visual::Base colorRenderer;
 
       Property::Map map;
       map[ Toolkit::Visual::Property::TYPE ] = Toolkit::Visual::COLOR;
       map[ Toolkit::ColorVisual::Property::MIX_COLOR ] = color;
 
-      visual = visualFactory.CreateVisual( map );
-
-      RegisterVisual( visualIndex, placementActor, visual );
-      visual.SetOnStage( placementActor );
+      colorRenderer = rendererFactory.CreateVisual( map );
+      colorRenderer.SetOnStage( placementActor );
 
       SetupContent( *contentActor, placementActor ); //
       contentActor->SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
index 1954782b283f7ced93316f3bc7948713478369ee..2c22b6195b1aef24b251c35e3af81269cae58009 100644 (file)
@@ -29,7 +29,6 @@ toolkit_src_files = \
    $(toolkit_src_dir)/visuals/svg/svg-visual.cpp \
    $(toolkit_src_dir)/visuals/mesh/mesh-visual.cpp \
    $(toolkit_src_dir)/visuals/primitive/primitive-visual.cpp \
-   $(toolkit_src_dir)/visuals/image/batch-image-visual.cpp \
    $(toolkit_src_dir)/controls/alignment/alignment-impl.cpp \
    $(toolkit_src_dir)/controls/bloom-view/bloom-view-impl.cpp \
    $(toolkit_src_dir)/controls/bubble-effect/bubble-emitter-impl.cpp \
index da49940c7f2ed86fb1e7aceef8a6d0b1b97e22d9..281e43d341575c16ab3b149547527bb881047bbd 100644 (file)
@@ -84,7 +84,6 @@ namespace
 {
 const Dali::Vector3 DEFAULT_GRAB_HANDLE_RELATIVE_SIZE( 1.25f, 1.5f, 1.0f );
 const Dali::Vector3 DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE( 1.25f, 1.5f, 1.0f );
-const Dali::Vector3 ACTIVE_LAYER_ANCHOR_POINT( 0.5f, 0.5f, 0.5f );
 
 const Dali::Vector4 LIGHT_BLUE( 0.75f, 0.96f, 1.f, 1.f ); // The text highlight color. TODO: due some problems, maybe with the blending function in the text clipping, the color is fully opaque.
 
@@ -102,9 +101,36 @@ const float SCROLL_DISTANCE = SCROLL_SPEED * SCROLL_TICK_INTERVAL * TO_SECONDS;
 
 const float CURSOR_WIDTH = 1.f; ///< The cursor's width in pixels.
 
-const float POPUP_PADDING = 2.f; ///< Padding space between the highlight box and the text's popup.
+/**
+ * structure to hold coordinates of each quad, which will make up the mesh.
+ */
+struct QuadCoordinates
+{
+  /**
+   * Default constructor
+   */
+  QuadCoordinates()
+  {
+  }
+
+  /**
+   * Constructor
+   * @param[in] x1 left co-ordinate
+   * @param[in] y1 top co-ordinate
+   * @param[in] x2 right co-ordinate
+   * @param[in] y2 bottom co-ordinate
+   */
+  QuadCoordinates(float x1, float y1, float x2, float y2)
+  : min(x1, y1),
+    max(x2, y2)
+  {
+  }
 
-typedef Dali::Vector<Dali::Vector4> QuadContainer;
+  Dali::Vector2 min;                          ///< top-left (minimum) position of quad
+  Dali::Vector2 max;                          ///< bottom-right (maximum) position of quad
+};
+
+typedef std::vector<QuadCoordinates> QuadContainer;
 
 /**
  * @brief Takes a bounding rectangle in the local coordinates of an actor and returns the world coordinates Bounding Box.
@@ -184,13 +210,11 @@ struct Decorator::Impl : public ConnectionTracker
       grabDisplacementX( 0.f ),
       grabDisplacementY( 0.f ),
       active( false ),
-      horizontallyVisible( false ),
-      verticallyVisible( false ),
+      visible( false ),
       pressed( false ),
       verticallyFlippedPreferred( false ),
       horizontallyFlipped( false ),
-      verticallyFlipped( false ),
-      verticallyFlippedOnTouch( false )
+      verticallyFlipped( false )
     {
     }
 
@@ -204,14 +228,12 @@ struct Decorator::Impl : public ConnectionTracker
     float   lineHeight;              ///< Not the handle height
     float   grabDisplacementX;
     float   grabDisplacementY;
-    bool    active                     : 1;
-    bool    horizontallyVisible        : 1;
-    bool    verticallyVisible          : 1;
-    bool    pressed                    : 1;
+    bool    active  : 1;
+    bool    visible : 1;
+    bool    pressed : 1;
     bool    verticallyFlippedPreferred : 1; ///< Whether the handle is preferred to be vertically flipped.
     bool    horizontallyFlipped        : 1; ///< Whether the handle has been horizontally flipped.
     bool    verticallyFlipped          : 1; ///< Whether the handle has been vertically flipped.
-    bool    verticallyFlippedOnTouch   : 1; ///< Whether the handle is vertically flipped on touch.
   };
 
   struct PopupImpl
@@ -239,7 +261,6 @@ struct Decorator::Impl : public ConnectionTracker
     mCursorBlinkDuration( 0.0f ),
     mCursorWidth( CURSOR_WIDTH ),
     mHandleScrolling( HANDLE_TYPE_COUNT ),
-    mHandleReleased( HANDLE_TYPE_COUNT ),
     mScrollDirection( SCROLL_NONE ),
     mScrollThreshold( SCROLL_THRESHOLD ),
     mScrollSpeed( SCROLL_SPEED ),
@@ -259,9 +280,7 @@ struct Decorator::Impl : public ConnectionTracker
     mIsHandlePreviouslyCrossed( false ),
     mNotifyEndOfScroll( false ),
     mHorizontalScrollingEnabled( false ),
-    mVerticalScrollingEnabled( false ),
-    mSmoothHandlePanEnabled( false ),
-    mIsHighlightBoxActive( false )
+    mVerticalScrollingEnabled( false )
   {
     mQuadVertexFormat[ "aPosition" ] = Property::VECTOR2;
     mHighlightShader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
@@ -285,10 +304,10 @@ struct Decorator::Impl : public ConnectionTracker
     if( mPrimaryCursor )
     {
       const CursorImpl& cursor = mCursor[PRIMARY_CURSOR];
-      mPrimaryCursorVisible = ( ( mControlSize.width - ( cursor.position.x + mCursorWidth ) > -Math::MACHINE_EPSILON_1000 ) &&
-                                ( cursor.position.x > -Math::MACHINE_EPSILON_1000 ) &&
-                                ( mControlSize.height - ( cursor.position.y + cursor.cursorHeight ) > -Math::MACHINE_EPSILON_1000 ) &&
-                                ( cursor.position.y > -Math::MACHINE_EPSILON_1000 ) );
+      mPrimaryCursorVisible = ( ( cursor.position.x + mCursorWidth <= mControlSize.width ) &&
+                                ( cursor.position.x >= 0.f ) &&
+                                ( cursor.position.y + cursor.cursorHeight <= mControlSize.height ) &&
+                                ( cursor.position.y >= 0.f ) );
       if( mPrimaryCursorVisible )
       {
         mPrimaryCursor.SetPosition( cursor.position.x,
@@ -300,10 +319,10 @@ struct Decorator::Impl : public ConnectionTracker
     if( mSecondaryCursor )
     {
       const CursorImpl& cursor = mCursor[SECONDARY_CURSOR];
-      mSecondaryCursorVisible = ( ( mControlSize.width - ( cursor.position.x + mCursorWidth ) > -Math::MACHINE_EPSILON_1000 ) &&
-                                  ( cursor.position.x > -Math::MACHINE_EPSILON_1000 ) &&
-                                  ( mControlSize.height - ( cursor.position.y + cursor.cursorHeight ) > -Math::MACHINE_EPSILON_1000 ) &&
-                                  ( cursor.position.y > -Math::MACHINE_EPSILON_1000 ) );
+      mSecondaryCursorVisible = ( ( cursor.position.x + mCursorWidth <= mControlSize.width ) &&
+                                  ( cursor.position.x >= 0.f ) &&
+                                  ( cursor.position.y + cursor.cursorHeight <= mControlSize.height ) &&
+                                  ( cursor.position.y >= 0.f ) );
       if( mSecondaryCursorVisible )
       {
         mSecondaryCursor.SetPosition( cursor.position.x,
@@ -316,16 +335,13 @@ struct Decorator::Impl : public ConnectionTracker
     // Show or hide the grab handle
     HandleImpl& grabHandle = mHandle[GRAB_HANDLE];
     bool newGrabHandlePosition = false;
-    grabHandle.horizontallyVisible = false;
-    grabHandle.verticallyVisible = false;
     if( grabHandle.active )
     {
-      grabHandle.horizontallyVisible = ( ( mControlSize.width - ( grabHandle.position.x + floor( 0.5f * mCursorWidth ) ) > -Math::MACHINE_EPSILON_1000 ) &&
-                                         ( grabHandle.position.x > -Math::MACHINE_EPSILON_1000 ) );
-      grabHandle.verticallyVisible = ( ( ( mControlSize.height - grabHandle.lineHeight ) - grabHandle.position.y > -Math::MACHINE_EPSILON_1000 ) &&
-                                       ( grabHandle.position.y > -Math::MACHINE_EPSILON_1000 ) );
+      const bool isVisible = ( ( grabHandle.position.x + floor( 0.5f * mCursorWidth ) <= mControlSize.width ) &&
+                               ( grabHandle.position.x >= 0.f ) &&
+                               ( grabHandle.position.y <= mControlSize.height - grabHandle.lineHeight ) &&
+                               ( grabHandle.position.y >= 0.f ) );
 
-      const bool isVisible = grabHandle.horizontallyVisible && grabHandle.verticallyVisible;
       if( isVisible )
       {
         CreateGrabHandle();
@@ -354,26 +370,22 @@ struct Decorator::Impl : public ConnectionTracker
     HandleImpl& secondary = mHandle[ RIGHT_SELECTION_HANDLE ];
     bool newPrimaryHandlePosition = false;
     bool newSecondaryHandlePosition = false;
-
-    primary.horizontallyVisible = ( ( mControlSize.width - primary.position.x > -Math::MACHINE_EPSILON_1000 ) &&
-                                    ( primary.position.x > -Math::MACHINE_EPSILON_1000 ) );
-    primary.verticallyVisible = ( ( ( mControlSize.height - primary.lineHeight ) - primary.position.y > -Math::MACHINE_EPSILON_1000 ) &&
-                                  ( primary.position.y + ( primary.verticallyFlipped ? 0.f : primary.lineHeight ) > -Math::MACHINE_EPSILON_1000 ) );
-    secondary.horizontallyVisible = ( ( mControlSize.width - secondary.position.x > -Math::MACHINE_EPSILON_1000 ) &&
-                                      ( secondary.position.x > -Math::MACHINE_EPSILON_1000 ) );
-    secondary.verticallyVisible = ( ( ( mControlSize.height - secondary.lineHeight ) - secondary.position.y > -Math::MACHINE_EPSILON_1000 ) &&
-                                    ( secondary.position.y + ( secondary.verticallyFlipped ? 0.f : secondary.lineHeight ) > -Math::MACHINE_EPSILON_1000 ) );
-
-    const bool primaryVisible = primary.horizontallyVisible && primary.verticallyVisible;
-    const bool secondaryVisible = secondary.horizontallyVisible && secondary.verticallyVisible;
-
     if( primary.active || secondary.active )
     {
-      if( primaryVisible || secondaryVisible )
+      const bool isPrimaryVisible = ( ( primary.position.x <= mControlSize.width ) &&
+                                      ( primary.position.x >= 0.f ) &&
+                                      ( primary.position.y <= mControlSize.height - primary.lineHeight ) &&
+                                      ( primary.position.y >= 0.f ) );
+      const bool isSecondaryVisible = ( ( secondary.position.x <= mControlSize.width ) &&
+                                        ( secondary.position.x >= 0.f ) &&
+                                        ( secondary.position.y <= mControlSize.height - secondary.lineHeight ) &&
+                                        ( secondary.position.y >= 0.f ) );
+
+      if( isPrimaryVisible || isSecondaryVisible )
       {
         CreateSelectionHandles();
 
-        if( primaryVisible )
+        if( isPrimaryVisible )
         {
           SetSelectionHandlePosition( LEFT_SELECTION_HANDLE );
 
@@ -385,7 +397,7 @@ struct Decorator::Impl : public ConnectionTracker
           newPrimaryHandlePosition = true;
         }
 
-        if( secondaryVisible )
+        if( isSecondaryVisible )
         {
           SetSelectionHandlePosition( RIGHT_SELECTION_HANDLE );
 
@@ -400,13 +412,15 @@ struct Decorator::Impl : public ConnectionTracker
 
       if( primary.actor )
       {
-        primary.actor.SetVisible( primaryVisible );
+        primary.actor.SetVisible( isPrimaryVisible );
       }
       if( secondary.actor )
       {
-        secondary.actor.SetVisible( secondaryVisible );
+        secondary.actor.SetVisible( isSecondaryVisible );
       }
 
+      CreateHighlight();
+      UpdateHighlight();
     }
     else
     {
@@ -418,15 +432,6 @@ struct Decorator::Impl : public ConnectionTracker
       {
         secondary.actor.Unparent();
       }
-    }
-
-    if( mIsHighlightBoxActive )
-    {
-      CreateHighlight();
-      UpdateHighlight();
-    }
-    else
-    {
       if( mHighlightActor )
       {
         mHighlightActor.Unparent();
@@ -441,8 +446,7 @@ struct Decorator::Impl : public ConnectionTracker
       SetupActiveLayerPropertyNotifications();
     }
 
-    if( mActiveCopyPastePopup &&
-        ( primaryVisible || secondaryVisible ) )
+    if( mActiveCopyPastePopup )
     {
       ShowPopup();
       mPopupSetNewPosition = true;
@@ -469,7 +473,7 @@ struct Decorator::Impl : public ConnectionTracker
 
   void ShowPopup()
   {
-    if( !mCopyPastePopup.actor )
+    if ( !mCopyPastePopup.actor )
     {
       return;
     }
@@ -483,124 +487,7 @@ struct Decorator::Impl : public ConnectionTracker
     mCopyPastePopup.actor.ShowPopup();
   }
 
-  float CalculateVerticalPopUpPosition( float halfHeight, bool preferBelow )
-  {
-    float yPosition = 0.f;
-
-    const HandleImpl& primaryHandle = mHandle[LEFT_SELECTION_HANDLE];
-    const HandleImpl& secondaryHandle = mHandle[RIGHT_SELECTION_HANDLE];
-    const HandleImpl& grabHandle = mHandle[GRAB_HANDLE];
-
-    if( primaryHandle.active || secondaryHandle.active )
-    {
-      // The origin of the decorator's coordinate system in world coords.
-      const Vector3 originWorldCoords = mActiveLayer.GetCurrentWorldPosition() - mActiveLayer.GetCurrentSize() * ACTIVE_LAYER_ANCHOR_POINT;
-
-      if( preferBelow )
-      {
-        // Find out if there is enough space for the popup at the bottom.
-        const float primaryBelowY = primaryHandle.position.y + primaryHandle.lineHeight + primaryHandle.size.height;
-        const float secondaryBelowY = secondaryHandle.position.y + secondaryHandle.lineHeight + secondaryHandle.size.height;
-
-        float maxY = std::max( primaryBelowY, secondaryBelowY );
-
-        yPosition = halfHeight + maxY;
-
-        if( originWorldCoords.y + yPosition + halfHeight > mBoundingBox.w )
-        {
-          // Does not fit below.
-
-          // Try to fit first below the non active handle. Otherwise above the active handle.
-          if( RIGHT_SELECTION_HANDLE == mHandleReleased )
-          {
-            if( primaryBelowY < secondaryBelowY )
-            {
-              yPosition = halfHeight + primaryBelowY;
-            }
-            else
-            {
-              yPosition = primaryHandle.position.y - primaryHandle.size.height - halfHeight;
-            }
-          }
-          else if( LEFT_SELECTION_HANDLE == mHandleReleased )
-          {
-            if( secondaryBelowY < primaryBelowY )
-            {
-              yPosition = halfHeight + secondaryBelowY;
-            }
-            else
-            {
-              yPosition = secondaryHandle.position.y - secondaryHandle.size.height - halfHeight;
-            }
-          }
-
-          // Check the handle is whithin the decoration box.
-          if( originWorldCoords.y + yPosition < mBoundingBox.y )
-          {
-            yPosition = mBoundingBox.y - originWorldCoords.y + halfHeight;
-          }
-
-          if( originWorldCoords.y + yPosition > mBoundingBox.w )
-          {
-            yPosition = mBoundingBox.w - originWorldCoords.y - halfHeight;
-          }
-        }
-      } // preferBelow
-      else
-      {
-        // Find out if there is enough space for the popup at the top.
-        const float primaryTopY = primaryHandle.position.y - primaryHandle.size.height;
-        const float secondaryTopY = secondaryHandle.position.y - secondaryHandle.size.height;
-
-        float minY = std::min( primaryTopY, secondaryTopY );
-
-        yPosition = -halfHeight + minY;
-      } // !preferBelow
-    } // ( primaryHandle.active || secondaryHandle.active )
-    else if( grabHandle.active )
-    {
-      if( preferBelow )
-      {
-        yPosition = halfHeight + grabHandle.lineHeight + grabHandle.size.height + grabHandle.position.y;
-      }
-      else
-      {
-        yPosition = -halfHeight + grabHandle.position.y - POPUP_PADDING;
-      }
-    }
-
-    return yPosition;
-  }
-
-  void ConstrainPopupPosition( const Vector3& popupHalfSize )
-  {
-    // Check if the popup is within the boundaries of the decoration box.
-
-    // Check first the horizontal dimension. If is not within the boundaries, it calculates the offset.
-
-    // The origin of the decorator's coordinate system in world coords.
-    const Vector3 originWorldCoords = mActiveLayer.GetCurrentWorldPosition() - mActiveLayer.GetCurrentSize() * ACTIVE_LAYER_ANCHOR_POINT;
-
-    // The popup's position in world coords.
-    Vector3 popupPositionWorldCoords = originWorldCoords + mCopyPastePopup.position;
-
-    if( popupPositionWorldCoords.x - popupHalfSize.width < mBoundingBox.x )
-    {
-       mCopyPastePopup.position.x += mBoundingBox.x - ( popupPositionWorldCoords.x - popupHalfSize.width );
-    }
-    else if( popupPositionWorldCoords.x + popupHalfSize.width > mBoundingBox.z )
-    {
-       mCopyPastePopup.position.x += mBoundingBox.z - ( popupPositionWorldCoords.x + popupHalfSize.width );
-    }
-
-    // Check the vertical dimension. If the popup doesn't fit above the handles, it looks for a valid position below.
-    if( popupPositionWorldCoords.y - popupHalfSize.height < mBoundingBox.y )
-    {
-      mCopyPastePopup.position.y = CalculateVerticalPopUpPosition( popupHalfSize.height, true ); // true -> prefer to set the popup's position below.
-    }
-  }
-
-  void SetPopupPosition( Actor actor )
+  void DeterminePositionPopup()
   {
     if( !mActiveCopyPastePopup )
     {
@@ -608,48 +495,55 @@ struct Decorator::Impl : public ConnectionTracker
     }
 
     // Retrieves the popup's size after relayout.
-    const Vector3 popupSize( mCopyPastePopup.actor.GetRelayoutSize( Dimension::WIDTH ), mCopyPastePopup.actor.GetRelayoutSize( Dimension::HEIGHT ), 0.0f );
-    const Vector3 popupHalfSize = popupSize * 0.5f;
+    const Vector3 popupSize = Vector3( mCopyPastePopup.actor.GetRelayoutSize( Dimension::WIDTH ), mCopyPastePopup.actor.GetRelayoutSize( Dimension::HEIGHT ), 0.0f );
 
     if( mPopupSetNewPosition )
     {
       const HandleImpl& primaryHandle = mHandle[LEFT_SELECTION_HANDLE];
       const HandleImpl& secondaryHandle = mHandle[RIGHT_SELECTION_HANDLE];
-      const HandleImpl& grabHandle = mHandle[GRAB_HANDLE];
+      const CursorImpl& cursor = mCursor[PRIMARY_CURSOR];
 
       if( primaryHandle.active || secondaryHandle.active )
       {
+        // Calculates the popup's position if selection handles are active.
         const float minHandleXPosition = std::min( primaryHandle.position.x, secondaryHandle.position.x );
         const float maxHandleXPosition = std::max( primaryHandle.position.x, secondaryHandle.position.x );
+        const float maxHandleHeight = std::max( primaryHandle.size.height, secondaryHandle.size.height );
 
         mCopyPastePopup.position.x = minHandleXPosition + ( ( maxHandleXPosition - minHandleXPosition ) * 0.5f );
-
-        const float primaryY = -popupHalfSize.height + primaryHandle.position.y - ( primaryHandle.verticallyFlipped ? primaryHandle.size.height : POPUP_PADDING );
-        const float secondaryY = -popupHalfSize.height + secondaryHandle.position.y - ( secondaryHandle.verticallyFlipped ? secondaryHandle.size.height : POPUP_PADDING );
-
-        mCopyPastePopup.position.y = std::min( primaryY, secondaryY );
+        mCopyPastePopup.position.y = -0.5f * popupSize.height - maxHandleHeight + std::min( primaryHandle.position.y, secondaryHandle.position.y );
       }
-      else if( grabHandle.active )
+      else
       {
-        mCopyPastePopup.position.x = grabHandle.position.x;
-
-        mCopyPastePopup.position.y = -popupHalfSize.height + grabHandle.position.y - ( grabHandle.verticallyFlipped ? grabHandle.size.height : POPUP_PADDING );
+        // Calculates the popup's position if the grab handle is active.
+        const HandleImpl& grabHandle = mHandle[GRAB_HANDLE];
+        if( grabHandle.verticallyFlipped )
+        {
+          mCopyPastePopup.position = Vector3( cursor.position.x, -0.5f * popupSize.height - grabHandle.size.height + cursor.position.y, 0.0f );
+        }
+        else
+        {
+          mCopyPastePopup.position = Vector3( cursor.position.x, -0.5f * popupSize.height + cursor.position.y, 0.0f );
+        }
       }
-    } // mPopupSetNewPosition
-
-    // It may change the popup's position to fit within the decoration box.
-    ConstrainPopupPosition( popupHalfSize );
+    }
 
-    SetUpPopupPositionNotifications( popupHalfSize );
+    // Checks if there is enough space above the text control. If not it places the popup under it.
+    GetConstrainedPopupPosition( mCopyPastePopup.position, popupSize * AnchorPoint::CENTER, mActiveLayer, mBoundingBox );
 
-    // Prevent pixel mis-alignment by rounding down.
-    mCopyPastePopup.position.x = floorf( mCopyPastePopup.position.x );
-    mCopyPastePopup.position.y = floorf( mCopyPastePopup.position.y );
+    SetUpPopupPositionNotifications();
 
     mCopyPastePopup.actor.SetPosition( mCopyPastePopup.position );
     mPopupSetNewPosition = false;
   }
 
+  void PopupRelayoutComplete( Actor actor )
+  {
+    // Size negotiation for CopyPastePopup complete so can get the size and constrain position within bounding box.
+
+    DeterminePositionPopup();
+  }
+
   void CreateCursor( Control& cursor, const Vector4& color )
   {
     cursor = Control::New();
@@ -1164,7 +1058,7 @@ struct Decorator::Impl : public ConnectionTracker
       mHighlightActor.SetPosition( mHighlightPosition.x,
                                    mHighlightPosition.y );
 
-      const unsigned int numberOfQuads = mHighlightQuadList.Count();
+      const unsigned int numberOfQuads = mHighlightQuadList.size();
       if( 0u != numberOfQuads )
       {
         // Set the size of the highlighted text to the actor.
@@ -1184,33 +1078,33 @@ struct Decorator::Impl : public ConnectionTracker
         unsigned int v = 0u;
 
         // Traverse all quads.
-        for( Vector<Vector4>::ConstIterator it = mHighlightQuadList.Begin(),
-               endIt = mHighlightQuadList.End();
+        for( std::vector<QuadCoordinates>::iterator it = mHighlightQuadList.begin(),
+               endIt = mHighlightQuadList.end();
              it != endIt;
              ++it, v += 4u )
         {
-          const Vector4& quad = *it;
+          QuadCoordinates& quad = *it;
 
           Vector2 vertex;
 
           // top-left (v+0)
-          vertex.x = quad.x - offsetX;
-          vertex.y = quad.y - offsetY;
+          vertex.x = quad.min.x - offsetX;
+          vertex.y = quad.min.y - offsetY;
           vertices.PushBack( vertex );
 
           // top-right (v+1)
-          vertex.x = quad.z - offsetX;
-          vertex.y = quad.y - offsetY;
+          vertex.x = quad.max.x - offsetX;
+          vertex.y = quad.min.y - offsetY;
           vertices.PushBack( vertex );
 
           // bottom-left (v+2)
-          vertex.x = quad.x - offsetX;
-          vertex.y = quad.w - offsetY;
+          vertex.x = quad.min.x - offsetX;
+          vertex.y = quad.max.y - offsetY;
           vertices.PushBack( vertex );
 
           // bottom-right (v+3)
-          vertex.x = quad.z - offsetX;
-          vertex.y = quad.w - offsetY;
+          vertex.x = quad.max.x - offsetX;
+          vertex.y = quad.max.y - offsetY;
           vertices.PushBack( vertex );
 
           // triangle A (3, 1, 0)
@@ -1245,7 +1139,7 @@ struct Decorator::Impl : public ConnectionTracker
         }
       }
 
-      mHighlightQuadList.Clear();
+      mHighlightQuadList.clear();
 
       if( mHighlightRenderer )
       {
@@ -1269,7 +1163,7 @@ struct Decorator::Impl : public ConnectionTracker
 
     const float x = handle.globalPosition.x + handle.grabDisplacementX;
     const float y = handle.globalPosition.y + handle.grabDisplacementY + 0.5f * handle.lineHeight;
-    const float yVerticallyFlippedCorrected = y - ( handle.verticallyFlippedOnTouch ? handle.lineHeight : 0.f );
+    const float yVerticallyFlippedCorrected = y - ( handle.verticallyFlipped ? handle.lineHeight : 0.f );
 
     if( ( Gesture::Started    == gesture.state ) ||
         ( Gesture::Continuing == gesture.state ) )
@@ -1400,7 +1294,6 @@ struct Decorator::Impl : public ConnectionTracker
       if( PointState::DOWN == state )
       {
         primarySelectionHandle.pressed = true;
-        primarySelectionHandle.verticallyFlippedOnTouch = primarySelectionHandle.verticallyFlipped;
       }
       else if( ( PointState::UP == state ) ||
                ( PointState::INTERRUPTED == state ) )
@@ -1408,7 +1301,6 @@ struct Decorator::Impl : public ConnectionTracker
         primarySelectionHandle.pressed = false;
         mIsHandlePreviouslyCrossed = mIsHandleCurrentlyCrossed;
         mIsHandlePanning = false;
-        mHandleReleased = LEFT_SELECTION_HANDLE;
       }
 
       SetHandleImage( LEFT_SELECTION_HANDLE );
@@ -1431,7 +1323,6 @@ struct Decorator::Impl : public ConnectionTracker
       if( PointState::DOWN == state )
       {
         secondarySelectionHandle.pressed = true;
-        secondarySelectionHandle.verticallyFlippedOnTouch = secondarySelectionHandle.verticallyFlipped;
       }
       else if( ( PointState::UP == state ) ||
                ( PointState::INTERRUPTED == state ) )
@@ -1439,7 +1330,6 @@ struct Decorator::Impl : public ConnectionTracker
         secondarySelectionHandle.pressed = false;
         mIsHandlePreviouslyCrossed = mIsHandleCurrentlyCrossed;
         mIsHandlePanning = false;
-        mHandleReleased = RIGHT_SELECTION_HANDLE;
       }
 
       SetHandleImage( RIGHT_SELECTION_HANDLE );
@@ -1487,16 +1377,16 @@ struct Decorator::Impl : public ConnectionTracker
     // Vertical notifications.
 
     // Disconnect any previous connected callback.
-    if( mHandleVerticalLessThanNotification )
+    if( mVerticalLessThanNotification )
     {
-      mHandleVerticalLessThanNotification.NotifySignal().Disconnect( this, &Decorator::Impl::HandleResetPosition );
-      mActiveLayer.RemovePropertyNotification( mHandleVerticalLessThanNotification );
+      mVerticalLessThanNotification.NotifySignal().Disconnect( this, &Decorator::Impl::HandleResetPosition );
+      mActiveLayer.RemovePropertyNotification( mVerticalLessThanNotification );
     }
 
-    if( mHandleVerticalGreaterThanNotification )
+    if( mVerticalGreaterThanNotification )
     {
-      mHandleVerticalGreaterThanNotification.NotifySignal().Disconnect( this, &Decorator::Impl::HandleResetPosition );
-      mActiveLayer.RemovePropertyNotification( mHandleVerticalGreaterThanNotification );
+      mVerticalGreaterThanNotification.NotifySignal().Disconnect( this, &Decorator::Impl::HandleResetPosition );
+      mActiveLayer.RemovePropertyNotification( mVerticalGreaterThanNotification );
     }
 
     const HandleImpl& grabHandle = mHandle[GRAB_HANDLE];
@@ -1508,36 +1398,36 @@ struct Decorator::Impl : public ConnectionTracker
       if( grabHandle.verticallyFlipped )
       {
         // The grab handle is vertically flipped. Never is going to exceed the bottom edje of the display.
-        mHandleVerticalGreaterThanNotification.Reset();
+        mVerticalGreaterThanNotification.Reset();
 
         // The vertical distance from the center of the active layer to the top edje of the display.
         const float topHeight = 0.5f * mControlSize.height - grabHandle.position.y + grabHandle.size.height;
 
-        mHandleVerticalLessThanNotification = mActiveLayer.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y,
-                                                                                    LessThanCondition( mBoundingBox.y + topHeight ) );
+        mVerticalLessThanNotification = mActiveLayer.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y,
+                                                                              LessThanCondition( mBoundingBox.y + topHeight ) );
 
         // Notifies the change from false to true and from true to false.
-        mHandleVerticalLessThanNotification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
+        mVerticalLessThanNotification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
 
         // Connects the signals with the callbacks.
-        mHandleVerticalLessThanNotification.NotifySignal().Connect( this, &Decorator::Impl::HandleResetPosition );
+        mVerticalLessThanNotification.NotifySignal().Connect( this, &Decorator::Impl::HandleResetPosition );
       }
       else
       {
         // The grab handle is not vertically flipped. Never is going to exceed the top edje of the display.
-        mHandleVerticalLessThanNotification.Reset();
+        mVerticalLessThanNotification.Reset();
 
         // The vertical distance from the center of the active layer to the bottom edje of the display.
         const float bottomHeight = -0.5f * mControlSize.height + grabHandle.position.y + grabHandle.lineHeight + grabHandle.size.height;
 
-        mHandleVerticalGreaterThanNotification = mActiveLayer.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y,
-                                                                                       GreaterThanCondition( mBoundingBox.w - bottomHeight ) );
+        mVerticalGreaterThanNotification = mActiveLayer.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y,
+                                                                                 GreaterThanCondition( mBoundingBox.w - bottomHeight ) );
 
         // Notifies the change from false to true and from true to false.
-        mHandleVerticalGreaterThanNotification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
+        mVerticalGreaterThanNotification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
 
         // Connects the signals with the callbacks.
-        mHandleVerticalGreaterThanNotification.NotifySignal().Connect( this, &Decorator::Impl::HandleResetPosition );
+        mVerticalGreaterThanNotification.NotifySignal().Connect( this, &Decorator::Impl::HandleResetPosition );
       }
     }
     else // The selection handles are active
@@ -1545,37 +1435,37 @@ struct Decorator::Impl : public ConnectionTracker
       if( primaryHandle.verticallyFlipped && secondaryHandle.verticallyFlipped )
       {
         // Both selection handles are vertically flipped. Never are going to exceed the bottom edje of the display.
-        mHandleVerticalGreaterThanNotification.Reset();
+        mVerticalGreaterThanNotification.Reset();
 
         // The vertical distance from the center of the active layer to the top edje of the display.
         const float topHeight = 0.5f * mControlSize.height + std::max( -primaryHandle.position.y + primaryHandle.size.height, -secondaryHandle.position.y + secondaryHandle.size.height );
 
-        mHandleVerticalLessThanNotification = mActiveLayer.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y,
-                                                                                    LessThanCondition( mBoundingBox.y + topHeight ) );
+        mVerticalLessThanNotification = mActiveLayer.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y,
+                                                                              LessThanCondition( mBoundingBox.y + topHeight ) );
 
         // Notifies the change from false to true and from true to false.
-        mHandleVerticalLessThanNotification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
+        mVerticalLessThanNotification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
 
         // Connects the signals with the callbacks.
-        mHandleVerticalLessThanNotification.NotifySignal().Connect( this, &Decorator::Impl::HandleResetPosition );
+        mVerticalLessThanNotification.NotifySignal().Connect( this, &Decorator::Impl::HandleResetPosition );
       }
       else if( !primaryHandle.verticallyFlipped && !secondaryHandle.verticallyFlipped )
       {
         // Both selection handles aren't vertically flipped. Never are going to exceed the top edje of the display.
-        mHandleVerticalLessThanNotification.Reset();
+        mVerticalLessThanNotification.Reset();
 
         // The vertical distance from the center of the active layer to the bottom edje of the display.
         const float bottomHeight = -0.5f * mControlSize.height + std::max( primaryHandle.position.y + primaryHandle.lineHeight + primaryHandle.size.height,
                                                                            secondaryHandle.position.y + secondaryHandle.lineHeight + secondaryHandle.size.height );
 
-        mHandleVerticalGreaterThanNotification = mActiveLayer.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y,
-                                                                                       GreaterThanCondition( mBoundingBox.w - bottomHeight ) );
+        mVerticalGreaterThanNotification = mActiveLayer.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y,
+                                                                                 GreaterThanCondition( mBoundingBox.w - bottomHeight ) );
 
         // Notifies the change from false to true and from true to false.
-        mHandleVerticalGreaterThanNotification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
+        mVerticalGreaterThanNotification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
 
         // Connects the signals with the callbacks.
-        mHandleVerticalGreaterThanNotification.NotifySignal().Connect( this, &Decorator::Impl::HandleResetPosition );
+        mVerticalGreaterThanNotification.NotifySignal().Connect( this, &Decorator::Impl::HandleResetPosition );
       }
       else
       {
@@ -1586,44 +1476,44 @@ struct Decorator::Impl : public ConnectionTracker
                                                                -primaryHandle.position.y + primaryHandle.size.height        :
                                                                -secondaryHandle.position.y + secondaryHandle.size.height );
 
-        mHandleVerticalLessThanNotification = mActiveLayer.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y,
-                                                                                    LessThanCondition( mBoundingBox.y + topHeight ) );
+        mVerticalLessThanNotification = mActiveLayer.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y,
+                                                                              LessThanCondition( mBoundingBox.y + topHeight ) );
 
         // Notifies the change from false to true and from true to false.
-        mHandleVerticalLessThanNotification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
+        mVerticalLessThanNotification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
 
         // Connects the signals with the callbacks.
-        mHandleVerticalLessThanNotification.NotifySignal().Connect( this, &Decorator::Impl::HandleResetPosition );
+        mVerticalLessThanNotification.NotifySignal().Connect( this, &Decorator::Impl::HandleResetPosition );
 
         // The vertical distance from the center of the active layer to the bottom edje of the display.
         const float bottomHeight = -0.5f * mControlSize.height + ( primaryHandle.verticallyFlipped                                                       ?
                                                                    secondaryHandle.position.y + secondaryHandle.lineHeight + secondaryHandle.size.height :
                                                                    primaryHandle.position.y + primaryHandle.lineHeight + primaryHandle.size.height );
 
-        mHandleVerticalGreaterThanNotification = mActiveLayer.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y,
-                                                                                       GreaterThanCondition( mBoundingBox.w - bottomHeight ) );
+        mVerticalGreaterThanNotification = mActiveLayer.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y,
+                                                                                 GreaterThanCondition( mBoundingBox.w - bottomHeight ) );
 
         // Notifies the change from false to true and from true to false.
-        mHandleVerticalGreaterThanNotification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
+        mVerticalGreaterThanNotification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
 
         // Connects the signals with the callbacks.
-        mHandleVerticalGreaterThanNotification.NotifySignal().Connect( this, &Decorator::Impl::HandleResetPosition );
+        mVerticalGreaterThanNotification.NotifySignal().Connect( this, &Decorator::Impl::HandleResetPosition );
       }
     }
 
     // Horizontal notifications.
 
     // Disconnect any previous connected callback.
-    if( mHandleHorizontalLessThanNotification )
+    if( mHorizontalLessThanNotification )
     {
-      mHandleHorizontalLessThanNotification.NotifySignal().Disconnect( this, &Decorator::Impl::HandleResetPosition );
-      mActiveLayer.RemovePropertyNotification( mHandleHorizontalLessThanNotification );
+      mHorizontalLessThanNotification.NotifySignal().Disconnect( this, &Decorator::Impl::HandleResetPosition );
+      mActiveLayer.RemovePropertyNotification( mHorizontalLessThanNotification );
     }
 
-    if( mHandleHorizontalGreaterThanNotification )
+    if( mHorizontalGreaterThanNotification )
     {
-      mHandleHorizontalGreaterThanNotification.NotifySignal().Disconnect( this, &Decorator::Impl::HandleResetPosition );
-      mActiveLayer.RemovePropertyNotification( mHandleHorizontalGreaterThanNotification );
+      mHorizontalGreaterThanNotification.NotifySignal().Disconnect( this, &Decorator::Impl::HandleResetPosition );
+      mActiveLayer.RemovePropertyNotification( mHorizontalGreaterThanNotification );
     }
 
     if( primaryHandle.active || secondaryHandle.active )
@@ -1632,37 +1522,37 @@ struct Decorator::Impl : public ConnectionTracker
       const float leftWidth = 0.5f * mControlSize.width + std::max( -primaryHandle.position.x + primaryHandle.size.width,
                                                                     -secondaryHandle.position.x + secondaryHandle.size.width );
 
-      mHandleHorizontalLessThanNotification = mActiveLayer.AddPropertyNotification( Actor::Property::WORLD_POSITION_X,
-                                                                                    LessThanCondition( mBoundingBox.x + leftWidth ) );
+      mHorizontalLessThanNotification = mActiveLayer.AddPropertyNotification( Actor::Property::WORLD_POSITION_X,
+                                                                              LessThanCondition( mBoundingBox.x + leftWidth ) );
 
       // Notifies the change from false to true and from true to false.
-      mHandleHorizontalLessThanNotification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
+      mHorizontalLessThanNotification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
 
       // Connects the signals with the callbacks.
-      mHandleHorizontalLessThanNotification.NotifySignal().Connect( this, &Decorator::Impl::HandleResetPosition );
+      mHorizontalLessThanNotification.NotifySignal().Connect( this, &Decorator::Impl::HandleResetPosition );
 
       // The horizontal distance from the center of the active layer to the right edje of the display.
       const float rightWidth = -0.5f * mControlSize.width + std::max( primaryHandle.position.x + primaryHandle.size.width,
                                                                       secondaryHandle.position.x + secondaryHandle.size.width );
 
-      mHandleHorizontalGreaterThanNotification = mActiveLayer.AddPropertyNotification( Actor::Property::WORLD_POSITION_X,
-                                                                                       GreaterThanCondition( mBoundingBox.z - rightWidth ) );
+      mHorizontalGreaterThanNotification = mActiveLayer.AddPropertyNotification( Actor::Property::WORLD_POSITION_X,
+                                                                                 GreaterThanCondition( mBoundingBox.z - rightWidth ) );
 
       // Notifies the change from false to true and from true to false.
-      mHandleHorizontalGreaterThanNotification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
+      mHorizontalGreaterThanNotification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
 
       // Connects the signals with the callbacks.
-      mHandleHorizontalGreaterThanNotification.NotifySignal().Connect( this, &Decorator::Impl::HandleResetPosition );
+      mHorizontalGreaterThanNotification.NotifySignal().Connect( this, &Decorator::Impl::HandleResetPosition );
     }
   }
 
   // Popup
 
-  float AlternatePopUpPositionRelativeToCursor( bool topBottom )
+  float AlternatePopUpPositionRelativeToCursor()
   {
     float alternativePosition = 0.0f;
 
-    const float halfPopupHeight = 0.5f * mCopyPastePopup.actor.GetRelayoutSize( Dimension::HEIGHT );
+    const float popupHeight = mCopyPastePopup.actor.GetRelayoutSize( Dimension::HEIGHT );
 
     const HandleImpl& primaryHandle = mHandle[LEFT_SELECTION_HANDLE];
     const HandleImpl& secondaryHandle = mHandle[RIGHT_SELECTION_HANDLE];
@@ -1671,85 +1561,72 @@ struct Decorator::Impl : public ConnectionTracker
 
     if( primaryHandle.active || secondaryHandle.active )
     {
-      float handleY = 0.f;
-      float maxHandleHeight = 0.f;
-
-      const bool primaryVisible = primaryHandle.horizontallyVisible && primaryHandle.verticallyVisible;
-      const bool secondaryVisible = secondaryHandle.horizontallyVisible && secondaryHandle.verticallyVisible;
-
-      if( primaryVisible && secondaryVisible )
-      {
-        handleY = std::max( primaryHandle.position.y, secondaryHandle.position.y );
-        maxHandleHeight = std::max( primaryHandle.size.height, secondaryHandle.size.height );
-      }
-      else if( primaryVisible && !secondaryVisible )
-      {
-        handleY = primaryHandle.position.y;
-        maxHandleHeight = primaryHandle.size.height;
-      }
-      else if( !primaryVisible && secondaryVisible )
-      {
-        handleY = secondaryHandle.position.y;
-        maxHandleHeight = secondaryHandle.size.height;
-      }
-
-      alternativePosition = handleY + ( topBottom ? halfPopupHeight + maxHandleHeight + cursor.lineHeight : -halfPopupHeight - maxHandleHeight );
+      const float maxHandleHeight = std::max( primaryHandle.size.height, secondaryHandle.size.height );
+      alternativePosition = 0.5f * popupHeight + cursor.lineHeight + maxHandleHeight + std::min( primaryHandle.position.y, secondaryHandle.position.y );
     }
     else
     {
-      alternativePosition = cursor.position.y + ( topBottom ? halfPopupHeight + grabHandle.size.height + cursor.lineHeight : -halfPopupHeight - grabHandle.size.height );
+      alternativePosition = 0.5f * popupHeight + cursor.lineHeight + grabHandle.size.height + cursor.position.y;
     }
 
     return alternativePosition;
   }
 
-  void PopUpLeavesTopBoundary( PropertyNotification& source )
+  void PopUpLeavesVerticalBoundary( PropertyNotification& source )
   {
-    const float popupHeight = mCopyPastePopup.actor.GetRelayoutSize( Dimension::HEIGHT );
+    float alternativeYPosition = 0.0f;
+    // todo use AlternatePopUpPositionRelativeToSelectionHandles() if text is highlighted
+    // if can't be positioned above, then position below row.
+    alternativeYPosition = AlternatePopUpPositionRelativeToCursor();
 
-    // Sets the position of the popup below.
-    mCopyPastePopup.actor.SetY( floorf( CalculateVerticalPopUpPosition( 0.5f * popupHeight, true ) ) );
+    mCopyPastePopup.actor.SetY( alternativeYPosition );
   }
 
-  void PopUpLeavesBottomBoundary( PropertyNotification& source )
+  void SetUpPopupPositionNotifications()
   {
+    // Note Property notifications ignore any set anchor point so conditions must allow for this.  Default is Top Left.
+
+    // Exceeding vertical boundary
+
     const float popupHeight = mCopyPastePopup.actor.GetRelayoutSize( Dimension::HEIGHT );
 
-    // Sets the position of the popup above.
-    mCopyPastePopup.actor.SetY( floorf( CalculateVerticalPopUpPosition( 0.5f * popupHeight, false ) ) );
+    PropertyNotification verticalExceedNotification = mCopyPastePopup.actor.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y,
+                                                                                                     OutsideCondition( mBoundingBox.y + popupHeight * 0.5f,
+                                                                                                                       mBoundingBox.w - popupHeight * 0.5f ) );
+
+    verticalExceedNotification.NotifySignal().Connect( this, &Decorator::Impl::PopUpLeavesVerticalBoundary );
   }
 
-  void SetUpPopupPositionNotifications( const Vector3& popupHalfSize )
+  void GetConstrainedPopupPosition( Vector3& requiredPopupPosition, const Vector3& popupDistanceFromAnchorPoint, Actor parent, const Vector4& boundingRectangleWorld )
   {
-    // Disconnect any previous connected callback.
-    if( mPopupTopExceedNotification )
+    DALI_ASSERT_DEBUG ( "Popup parent not on stage" && parent.OnStage() )
+
+    // Parent must already by added to Stage for these Get calls to work
+    const Vector3 parentWorldPositionLeftAnchor = parent.GetCurrentWorldPosition() - parent.GetCurrentSize() * parent.GetCurrentAnchorPoint();
+    const Vector3 popupWorldPosition = parentWorldPositionLeftAnchor + requiredPopupPosition;  // Parent World position plus popup local position gives World Position
+
+    // Calculate distance to move popup (in local space) so fits within the boundary
+    float xOffSetToKeepWithinBounds = 0.0f;
+    if( popupWorldPosition.x - popupDistanceFromAnchorPoint.x < boundingRectangleWorld.x )
     {
-      mPopupTopExceedNotification.NotifySignal().Disconnect( this, &Decorator::Impl::PopUpLeavesTopBoundary );
-      mCopyPastePopup.actor.RemovePropertyNotification( mPopupTopExceedNotification );
+      xOffSetToKeepWithinBounds = boundingRectangleWorld.x - ( popupWorldPosition.x - popupDistanceFromAnchorPoint.x );
     }
-
-    if( mPopupBottomExceedNotification )
+    else if( popupWorldPosition.x +  popupDistanceFromAnchorPoint.x > boundingRectangleWorld.z )
     {
-      mPopupBottomExceedNotification.NotifySignal().Disconnect( this, &Decorator::Impl::PopUpLeavesBottomBoundary );
-      mCopyPastePopup.actor.RemovePropertyNotification( mPopupBottomExceedNotification );
+      xOffSetToKeepWithinBounds = boundingRectangleWorld.z - ( popupWorldPosition.x +  popupDistanceFromAnchorPoint.x );
     }
 
-    // Note Property notifications ignore any set anchor point so conditions must allow for this.  Default is Top Left.
-
-    // Exceeding vertical boundary
-
-    mPopupTopExceedNotification = mCopyPastePopup.actor.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y,
-                                                                                 LessThanCondition( mBoundingBox.y + popupHalfSize.height ) );
-
-    mPopupBottomExceedNotification = mCopyPastePopup.actor.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y,
-                                                                                    GreaterThanCondition( mBoundingBox.w - popupHalfSize.height ) );
+    // Ensure initial display of Popup is in alternative position if can not fit above. As Property notification will be a frame behind.
+    if( popupWorldPosition.y - popupDistanceFromAnchorPoint.y < boundingRectangleWorld.y )
+    {
+      requiredPopupPosition.y = AlternatePopUpPositionRelativeToCursor();
+    }
 
-    // Notifies the change from false to true and from true to false.
-    mPopupTopExceedNotification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
-    mPopupBottomExceedNotification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
+    requiredPopupPosition.x = requiredPopupPosition.x + xOffSetToKeepWithinBounds;
 
-    mPopupTopExceedNotification.NotifySignal().Connect( this, &Decorator::Impl::PopUpLeavesTopBoundary );
-    mPopupBottomExceedNotification.NotifySignal().Connect( this, &Decorator::Impl::PopUpLeavesBottomBoundary );
+    // Prevent pixel mis-alignment by rounding down.
+    requiredPopupPosition.x = floor( requiredPopupPosition.x );
+    requiredPopupPosition.y = floor( requiredPopupPosition.y );
   }
 
   void SetHandleImage( HandleType handleType, HandleImageType handleImageType, Dali::Image image )
@@ -1877,13 +1754,11 @@ struct Decorator::Impl : public ConnectionTracker
   Timer               mCursorBlinkTimer;          ///< Timer to signal cursor to blink
   Timer               mScrollTimer;               ///< Timer used to scroll the text when the grab handle is moved close to the edges.
 
-  Layer                mActiveLayer;                             ///< Layer for active handles and alike that ensures they are above all else.
-  PropertyNotification mHandleVerticalLessThanNotification;      ///< Notifies when the 'y' coord of the active layer is less than a given value.
-  PropertyNotification mHandleVerticalGreaterThanNotification;   ///< Notifies when the 'y' coord of the active layer is grater than a given value.
-  PropertyNotification mHandleHorizontalLessThanNotification;    ///< Notifies when the 'x' coord of the active layer is less than a given value.
-  PropertyNotification mHandleHorizontalGreaterThanNotification; ///< Notifies when the 'x' coord of the active layer is grater than a given value.
-  PropertyNotification mPopupTopExceedNotification;              ///< Notifies when the popup leaves the bounding box through the top.
-  PropertyNotification mPopupBottomExceedNotification;           ///< Notifies when the popup leaves the bounding box through the bottom.
+  Layer                mActiveLayer;                       ///< Layer for active handles and alike that ensures they are above all else.
+  PropertyNotification mVerticalLessThanNotification;      ///< Notifies when the 'y' coord of the active layer is less than a given value.
+  PropertyNotification mVerticalGreaterThanNotification;   ///< Notifies when the 'y' coord of the active layer is grater than a given value.
+  PropertyNotification mHorizontalLessThanNotification;    ///< Notifies when the 'x' coord of the active layer is less than a given value.
+  PropertyNotification mHorizontalGreaterThanNotification; ///< Notifies when the 'x' coord of the active layer is grater than a given value.
   Control              mPrimaryCursor;
   Control              mSecondaryCursor;
 
@@ -1903,7 +1778,7 @@ struct Decorator::Impl : public ConnectionTracker
 
   PropertyBuffer      mQuadVertices;
   Geometry            mQuadGeometry;
-  QuadContainer       mHighlightQuadList;         ///< Sub-selections that combine to create the complete selection highlight.
+  QuadContainer       mHighlightQuadList;         ///< Sub-selections that combine to create the complete selection highlight
 
   Vector4             mBoundingBox;               ///< The bounding box in world coords.
   Vector4             mHighlightColor;            ///< Color of the highlight
@@ -1916,7 +1791,6 @@ struct Decorator::Impl : public ConnectionTracker
   float               mCursorBlinkDuration;
   float               mCursorWidth;             ///< The width of the cursors in pixels.
   HandleType          mHandleScrolling;         ///< The handle which is scrolling.
-  HandleType          mHandleReleased;          ///< The last handle released.
   ScrollDirection     mScrollDirection;         ///< The direction of the scroll.
   float               mScrollThreshold;         ///< Defines a square area inside the control, close to the edge. A cursor entering this area will trigger scroll events.
   float               mScrollSpeed;             ///< The scroll speed in pixels per second.
@@ -1939,7 +1813,6 @@ struct Decorator::Impl : public ConnectionTracker
   bool                mHorizontalScrollingEnabled        : 1; ///< Whether the horizontal scrolling is enabled.
   bool                mVerticalScrollingEnabled          : 1; ///< Whether the vertical scrolling is enabled.
   bool                mSmoothHandlePanEnabled            : 1; ///< Whether to pan smoothly the handles.
-  bool                mIsHighlightBoxActive              : 1; ///< Whether the highlight box is active.
 };
 
 DecoratorPtr Decorator::New( ControllerInterface& controller,
@@ -2180,9 +2053,9 @@ void Decorator::SetSelectionHandleFlipState( bool indicesSwapped, bool left, boo
   mImpl->mFlipRightSelectionHandleDirection = right;
 }
 
-void Decorator::AddHighlight( unsigned int index, const Vector4& quad )
+void Decorator::AddHighlight( float x1, float y1, float x2, float y2 )
 {
-  *( mImpl->mHighlightQuadList.Begin() + index ) = quad;
+  mImpl->mHighlightQuadList.push_back( QuadCoordinates(x1, y1, x2, y2) );
 }
 
 void Decorator::SetHighLightBox( const Vector2& position, const Size& size )
@@ -2193,15 +2066,10 @@ void Decorator::SetHighLightBox( const Vector2& position, const Size& size )
 
 void Decorator::ClearHighlights()
 {
-  mImpl->mHighlightQuadList.Clear();
+  mImpl->mHighlightQuadList.clear();
   mImpl->mHighlightPosition = Vector2::ZERO;
 }
 
-void Decorator::ResizeHighlightQuads( unsigned int numberOfQuads )
-{
-  mImpl->mHighlightQuadList.Resize( numberOfQuads );
-}
-
 void Decorator::SetHighlightColor( const Vector4& color )
 {
   mImpl->mHighlightColor = color;
@@ -2212,16 +2080,6 @@ const Vector4& Decorator::GetHighlightColor() const
   return mImpl->mHighlightColor;
 }
 
-void Decorator::SetHighlightActive( bool active )
-{
-  mImpl->mIsHighlightBoxActive = active;
-}
-
-bool Decorator::IsHighlightActive() const
-{
-  return mImpl->mIsHighlightBoxActive;
-}
-
 void Decorator::SetTextDepth( int textDepth )
 {
   mImpl->mTextDepth = textDepth;
@@ -2234,7 +2092,7 @@ void Decorator::SetPopupActive( bool active )
 
 bool Decorator::IsPopupActive() const
 {
-  return mImpl->mActiveCopyPastePopup;
+  return mImpl->mActiveCopyPastePopup ;
 }
 
 void Decorator::SetEnabledPopupButtons( TextSelectionPopup::Buttons& enabledButtonsBitMask )
@@ -2248,7 +2106,7 @@ void Decorator::SetEnabledPopupButtons( TextSelectionPopup::Buttons& enabledButt
     mImpl->mCopyPastePopup.actor.SetName("mCopyPastePopup");
 #endif
     mImpl->mCopyPastePopup.actor.SetAnchorPoint( AnchorPoint::CENTER );
-    mImpl->mCopyPastePopup.actor.OnRelayoutSignal().Connect( mImpl, &Decorator::Impl::SetPopupPosition ); // Position popup after size negotiation
+    mImpl->mCopyPastePopup.actor.OnRelayoutSignal().Connect( mImpl,  &Decorator::Impl::PopupRelayoutComplete  ); // Position popup after size negotiation
   }
 
   mImpl->mCopyPastePopup.actor.EnableButtons( mImpl->mEnabledPopupButtons );
index 6e7c727fa4290bfdb306e7fd93667ec93d2ef1f2..a868958f9276d64beee2583a1b06fef2a986485d 100644 (file)
@@ -437,10 +437,12 @@ public:
   /**
    * @brief Adds a quad to the existing selection highlights. Vertices are in decorator's coordinates.
    *
-   * @param[in] index Position in the vector where to add the quad.
-   * @param[in] quad The quad. The 'x' and 'y' coordinates store the min 'x' and min 'y'. The 'z' and 'w' coordinates store the max 'x' and max 'y'.
+   * @param[in] x1 The top-left x position.
+   * @param[in] y1 The top-left y position.
+   * @param[in] x2 The bottom-right x position.
+   * @param[in] y3 The bottom-right y position.
    */
-  void AddHighlight( unsigned int index, const Vector4& quad );
+  void AddHighlight( float x1, float y1, float x2, float y2 );
 
   /**
    * @brief Sets the min 'x,y' coordinates and the size of the highlighted box.
@@ -459,13 +461,6 @@ public:
    */
   void ClearHighlights();
 
-  /**
-   * @brief Reserves space for the highlight quads.
-   *
-   * @param[in] numberOfQuads The expected number of quads.
-   */
-  void ResizeHighlightQuads( unsigned int numberOfQuads );
-
   /**
    * @brief Sets the selection highlight color.
    *
@@ -480,20 +475,6 @@ public:
    */
   const Vector4& GetHighlightColor() const;
 
-  /**
-   * @brief Sets whether the highlight is active.
-   *
-   * @param[in] active Whether the highlight is active.
-   */
-  void SetHighlightActive( bool active );
-
-  /**
-   * @brief Retrieves whether the highlight is active.
-   *
-   * @return @e true if the highlight is active, @e false otherwise.
-   */
-  bool IsHighlightActive() const;
-
   /**
    * @brief Sets into the decorator the depth used to render the text.
    *
index 5ae10c828cc6777ba4df16fe39ea6793ccee0759..10602c74165db9f67740309fe229a596505a96b3 100644 (file)
@@ -106,7 +106,7 @@ RendererPtr Backend::NewRenderer( unsigned int renderingType )
 
     default:
     {
-      DALI_LOG_WARNING( "Unknown renderer type: %d\n", renderingType );
+      DALI_LOG_WARNING( "Unknown renderer type: %d", renderingType );
       break;
     }
   }
index 95115da001a76129bfae64c33e72b15aedb7844a..2c45d35b2f5dc70a316fd40af16b39b6ab60e4d8 100644 (file)
@@ -91,7 +91,6 @@ EventData::EventData( DecoratorPtr decorator )
   mUpdateGrabHandlePosition( false ),
   mUpdateLeftSelectionPosition( false ),
   mUpdateRightSelectionPosition( false ),
-  mIsLeftHandleSelected( false ),
   mUpdateHighlightBox( false ),
   mScrollAfterUpdatePosition( false ),
   mScrollAfterDelete( false ),
@@ -219,12 +218,16 @@ bool Controller::Impl::ProcessInputEvents()
       GetCursorPosition( mEventData->mRightSelectionPosition,
                          rightHandleInfo );
 
-      if( mEventData->mScrollAfterUpdatePosition && ( mEventData->mIsLeftHandleSelected ? mEventData->mUpdateLeftSelectionPosition : mEventData->mUpdateRightSelectionPosition ) )
+      if( mEventData->mScrollAfterUpdatePosition && mEventData->mUpdateLeftSelectionPosition )
       {
-        CursorInfo& info = mEventData->mIsLeftHandleSelected ? leftHandleInfo : rightHandleInfo;
+        const Vector2 currentCursorPosition( leftHandleInfo.primaryPosition.x, leftHandleInfo.lineOffset );
+        ScrollToMakePositionVisible( currentCursorPosition, leftHandleInfo.lineHeight );
+       }
 
-        const Vector2 currentCursorPosition( info.primaryPosition.x, info.lineOffset );
-        ScrollToMakePositionVisible( currentCursorPosition, info.lineHeight );
+      if( mEventData->mScrollAfterUpdatePosition && mEventData->mUpdateRightSelectionPosition )
+      {
+        const Vector2 currentCursorPosition( rightHandleInfo.primaryPosition.x, rightHandleInfo.lineOffset );
+        ScrollToMakePositionVisible( currentCursorPosition, rightHandleInfo.lineHeight );
       }
     }
 
@@ -1200,31 +1203,17 @@ void Controller::Impl::OnPanEvent( const Event& event )
     return;
   }
 
-  const bool isHorizontalScrollEnabled = mEventData->mDecorator->IsHorizontalScrollEnabled();
-  const bool isVerticalScrollEnabled = mEventData->mDecorator->IsVerticalScrollEnabled();
+  int state = event.p1.mInt;
 
-  if( !isHorizontalScrollEnabled && !isVerticalScrollEnabled )
+  if( ( Gesture::Started == state ) ||
+      ( Gesture::Continuing == state ) )
   {
-    // Nothing to do if scrolling is not enabled.
-    return;
-  }
-
-  const int state = event.p1.mInt;
-
-  switch( state )
-  {
-    case Gesture::Started:
-    {
-      // Will remove the cursor, handles or text's popup, ...
-      ChangeState( EventData::TEXT_PANNING );
-      break;
-    }
-    case Gesture::Continuing:
+    if( mEventData->mDecorator )
     {
       const Vector2& layoutSize = mVisualModel->GetLayoutSize();
       const Vector2 currentScroll = mScrollPosition;
 
-      if( isHorizontalScrollEnabled )
+      if( mEventData->mDecorator->IsHorizontalScrollEnabled() )
       {
         const float displacementX = event.p2.mFloat;
         mScrollPosition.x += displacementX;
@@ -1232,7 +1221,7 @@ void Controller::Impl::OnPanEvent( const Event& event )
         ClampHorizontalScroll( layoutSize );
       }
 
-      if( isVerticalScrollEnabled )
+      if( mEventData->mDecorator->IsVerticalScrollEnabled() )
       {
         const float displacementY = event.p3.mFloat;
         mScrollPosition.y += displacementY;
@@ -1241,17 +1230,7 @@ void Controller::Impl::OnPanEvent( const Event& event )
       }
 
       mEventData->mDecorator->UpdatePositions( mScrollPosition - currentScroll );
-      break;
-    }
-    case Gesture::Finished:
-    case Gesture::Cancelled: // FALLTHROUGH
-    {
-      // Will go back to the previous state to show the cursor, handles, the text's popup, ...
-      ChangeState( mEventData->mPreviousState );
-      break;
     }
-    default:
-      break;
   }
 }
 
@@ -1323,9 +1302,6 @@ void Controller::Impl::OnHandleEvent( const Event& event )
 
       // Updates the decorator if the soft handle panning is enabled. It triggers a relayout in the decorator and the new position of the handle is set.
       mEventData->mDecoratorUpdated = isSmoothHandlePanEnabled;
-
-      // Will define the order to scroll the text to match the handle position.
-      mEventData->mIsLeftHandleSelected = true;
     }
     else if( Event::RIGHT_SELECTION_HANDLE_EVENT == event.type )
     {
@@ -1343,9 +1319,6 @@ void Controller::Impl::OnHandleEvent( const Event& event )
 
       // Updates the decorator if the soft handle panning is enabled. It triggers a relayout in the decorator and the new position of the handle is set.
       mEventData->mDecoratorUpdated = isSmoothHandlePanEnabled;
-
-      // Will define the order to scroll the text to match the handle position.
-      mEventData->mIsLeftHandleSelected = false;
     }
   } // end ( HANDLE_PRESSED == state )
   else if( ( HANDLE_RELEASED == state ) ||
@@ -1388,7 +1361,6 @@ void Controller::Impl::OnHandleEvent( const Event& event )
 
       mEventData->mUpdateHighlightBox = true;
       mEventData->mUpdateLeftSelectionPosition = true;
-      mEventData->mUpdateRightSelectionPosition = true;
 
       if( handleStopScrolling || isSmoothHandlePanEnabled )
       {
@@ -1407,7 +1379,6 @@ void Controller::Impl::OnHandleEvent( const Event& event )
 
       mEventData->mUpdateHighlightBox = true;
       mEventData->mUpdateRightSelectionPosition = true;
-      mEventData->mUpdateLeftSelectionPosition = true;
 
       if( handleStopScrolling || isSmoothHandlePanEnabled )
       {
@@ -1788,14 +1759,6 @@ void Controller::Impl::RepositionSelectionHandles()
   const Length numberOfCharactersEnd = *( charactersPerGlyphBuffer + glyphEnd );
   bool splitEndGlyph = ( glyphStart != glyphEnd ) && ( numberOfCharactersEnd > 1u ) && HasLigatureMustBreak( mLogicalModel->GetScript( selectionEndMinusOne ) );
 
-  // The number of quads of the selection box.
-  const unsigned int numberOfQuads = 1u + ( glyphEnd - glyphStart ) + ( ( numberOfLines > 1u ) ? 2u * numberOfLines : 0u );
-  mEventData->mDecorator->ResizeHighlightQuads( numberOfQuads );
-
-  // Count the actual number of quads.
-  unsigned int actualNumberOfQuads = 0u;
-  Vector4 quad;
-
   // Traverse the glyphs.
   for( GlyphIndex index = glyphStart; index <= glyphEnd; ++index )
   {
@@ -1819,17 +1782,18 @@ void Controller::Impl::RepositionSelectionHandles()
       // Calculate the number of characters selected.
       const Length numberOfCharacters = ( glyphStart == glyphEnd ) ? ( selectionEnd - selectionStart ) : ( numberOfCharactersStart - interGlyphIndex );
 
-      quad.x = lineRun->alignmentOffset + position.x - glyph.xBearing + mScrollPosition.x + glyphAdvance * static_cast<float>( isCurrentRightToLeft ? ( numberOfCharactersStart - interGlyphIndex - numberOfCharacters ) : interGlyphIndex );
-      quad.y = selectionBoxInfo->lineOffset;
-      quad.z = quad.x + static_cast<float>( numberOfCharacters ) * glyphAdvance;
-      quad.w = selectionBoxInfo->lineOffset + selectionBoxInfo->lineHeight;
+      const float xPosition = lineRun->alignmentOffset + position.x - glyph.xBearing + mScrollPosition.x + glyphAdvance * static_cast<float>( isCurrentRightToLeft ? ( numberOfCharactersStart - interGlyphIndex - numberOfCharacters ) : interGlyphIndex );
+      const float xPositionAdvance = xPosition + static_cast<float>( numberOfCharacters ) * glyphAdvance;
+      const float yPosition = selectionBoxInfo->lineOffset;
 
       // Store the min and max 'x' for each line.
-      selectionBoxInfo->minX = std::min( selectionBoxInfo->minX, quad.x );
-      selectionBoxInfo->maxX = std::max( selectionBoxInfo->maxX, quad.z );
+      selectionBoxInfo->minX = std::min( selectionBoxInfo->minX, xPosition );
+      selectionBoxInfo->maxX = std::max( selectionBoxInfo->maxX, xPositionAdvance );
 
-      mEventData->mDecorator->AddHighlight( actualNumberOfQuads, quad );
-      ++actualNumberOfQuads;
+      mEventData->mDecorator->AddHighlight( xPosition,
+                                            yPosition,
+                                            xPositionAdvance,
+                                            yPosition + selectionBoxInfo->lineHeight );
 
       splitStartGlyph = false;
       continue;
@@ -1850,35 +1814,35 @@ void Controller::Impl::RepositionSelectionHandles()
 
       const Length numberOfCharacters = numberOfCharactersEnd - interGlyphIndex;
 
-      quad.x = lineRun->alignmentOffset + position.x - glyph.xBearing + mScrollPosition.x + ( isCurrentRightToLeft ? ( glyphAdvance * static_cast<float>( numberOfCharacters ) ) : 0.f );
-      quad.y = selectionBoxInfo->lineOffset;
-      quad.z = quad.x + static_cast<float>( interGlyphIndex ) * glyphAdvance;
-      quad.w = quad.y + selectionBoxInfo->lineHeight;
+      const float xPosition = lineRun->alignmentOffset + position.x - glyph.xBearing + mScrollPosition.x + ( isCurrentRightToLeft ? ( glyphAdvance * static_cast<float>( numberOfCharacters ) ) : 0.f );
+      const float xPositionAdvance = xPosition + static_cast<float>( interGlyphIndex ) * glyphAdvance;
+      const float yPosition = selectionBoxInfo->lineOffset;
 
       // Store the min and max 'x' for each line.
-      selectionBoxInfo->minX = std::min( selectionBoxInfo->minX, quad.x );
-      selectionBoxInfo->maxX = std::max( selectionBoxInfo->maxX, quad.z );
+      selectionBoxInfo->minX = std::min( selectionBoxInfo->minX, xPosition );
+      selectionBoxInfo->maxX = std::max( selectionBoxInfo->maxX, xPositionAdvance );
 
-      mEventData->mDecorator->AddHighlight( actualNumberOfQuads,
-                                            quad );
-      ++actualNumberOfQuads;
+      mEventData->mDecorator->AddHighlight( xPosition,
+                                            yPosition,
+                                            xPositionAdvance,
+                                            yPosition + selectionBoxInfo->lineHeight );
 
       splitEndGlyph = false;
       continue;
     }
 
-    quad.x = lineRun->alignmentOffset + position.x - glyph.xBearing + mScrollPosition.x;
-    quad.y = selectionBoxInfo->lineOffset;
-    quad.z = quad.x + glyph.advance;
-    quad.w = quad.y + selectionBoxInfo->lineHeight;
+    const float xPosition = lineRun->alignmentOffset + position.x - glyph.xBearing + mScrollPosition.x;
+    const float xPositionAdvance = xPosition + glyph.advance;
+    const float yPosition = selectionBoxInfo->lineOffset;
 
     // Store the min and max 'x' for each line.
-    selectionBoxInfo->minX = std::min( selectionBoxInfo->minX, quad.x );
-    selectionBoxInfo->maxX = std::max( selectionBoxInfo->maxX, quad.z );
+    selectionBoxInfo->minX = std::min( selectionBoxInfo->minX, xPosition );
+    selectionBoxInfo->maxX = std::max( selectionBoxInfo->maxX, xPositionAdvance );
 
-    mEventData->mDecorator->AddHighlight( actualNumberOfQuads,
-                                          quad );
-    ++actualNumberOfQuads;
+    mEventData->mDecorator->AddHighlight( xPosition,
+                                          yPosition,
+                                          xPositionAdvance,
+                                          yPosition + selectionBoxInfo->lineHeight );
 
     // Whether to retrieve the next line.
     if( index == lastGlyphOfLine )
@@ -1922,7 +1886,7 @@ void Controller::Impl::RepositionSelectionHandles()
     const SelectionBoxInfo& info = *it;
 
     // Update the size of the highlighted text.
-    highLightSize.height += info.lineHeight;
+    highLightSize.height += selectionBoxInfo->lineHeight;
     minHighlightX = std::min( minHighlightX, info.minX );
     maxHighlightX = std::max( maxHighlightX, info.maxX );
   }
@@ -1940,15 +1904,11 @@ void Controller::Impl::RepositionSelectionHandles()
 
     if( boxifyBegin )
     {
-      quad.x = 0.f;
-      quad.y = firstSelectionBoxLineInfo.lineOffset;
-      quad.z = firstSelectionBoxLineInfo.minX;
-      quad.w = firstSelectionBoxLineInfo.lineOffset + firstSelectionBoxLineInfo.lineHeight;
-
       // Boxify at the beginning of the line.
-      mEventData->mDecorator->AddHighlight( actualNumberOfQuads,
-                                            quad );
-      ++actualNumberOfQuads;
+      mEventData->mDecorator->AddHighlight( 0.f,
+                                            firstSelectionBoxLineInfo.lineOffset,
+                                            firstSelectionBoxLineInfo.minX,
+                                            firstSelectionBoxLineInfo.lineOffset + firstSelectionBoxLineInfo.lineHeight );
 
       // Update the size of the highlighted text.
       minHighlightX = 0.f;
@@ -1956,15 +1916,11 @@ void Controller::Impl::RepositionSelectionHandles()
 
     if( boxifyEnd )
     {
-      quad.x = firstSelectionBoxLineInfo.maxX;
-      quad.y = firstSelectionBoxLineInfo.lineOffset;
-      quad.z = mVisualModel->mControlSize.width;
-      quad.w = firstSelectionBoxLineInfo.lineOffset + firstSelectionBoxLineInfo.lineHeight;
-
       // Boxify at the end of the line.
-      mEventData->mDecorator->AddHighlight( actualNumberOfQuads,
-                                            quad );
-      ++actualNumberOfQuads;
+      mEventData->mDecorator->AddHighlight( firstSelectionBoxLineInfo.maxX,
+                                            firstSelectionBoxLineInfo.lineOffset,
+                                            mVisualModel->mControlSize.width,
+                                            firstSelectionBoxLineInfo.lineOffset + firstSelectionBoxLineInfo.lineHeight );
 
       // Update the size of the highlighted text.
       maxHighlightX = mVisualModel->mControlSize.width;
@@ -1980,23 +1936,15 @@ void Controller::Impl::RepositionSelectionHandles()
       {
         const SelectionBoxInfo& info = *it;
 
-        quad.x = 0.f;
-        quad.y = info.lineOffset;
-        quad.z = info.minX;
-        quad.w = info.lineOffset + info.lineHeight;
-
-        mEventData->mDecorator->AddHighlight( actualNumberOfQuads,
-                                              quad );
-        ++actualNumberOfQuads;
-
-        quad.x = info.maxX;
-        quad.y = info.lineOffset;
-        quad.z = mVisualModel->mControlSize.width;
-        quad.w = info.lineOffset + info.lineHeight;
+        mEventData->mDecorator->AddHighlight( 0.f,
+                                              info.lineOffset,
+                                              info.minX,
+                                              info.lineOffset + info.lineHeight );
 
-        mEventData->mDecorator->AddHighlight( actualNumberOfQuads,
-                                              quad );
-        ++actualNumberOfQuads;
+        mEventData->mDecorator->AddHighlight( info.maxX,
+                                              info.lineOffset,
+                                              mVisualModel->mControlSize.width,
+                                              info.lineOffset + info.lineHeight );
       }
 
       // Update the size of the highlighted text.
@@ -2013,15 +1961,11 @@ void Controller::Impl::RepositionSelectionHandles()
 
     if( boxifyBegin )
     {
-      quad.x = 0.f;
-      quad.y = lastSelectionBoxLineInfo.lineOffset;
-      quad.z = lastSelectionBoxLineInfo.minX;
-      quad.w = lastSelectionBoxLineInfo.lineOffset + lastSelectionBoxLineInfo.lineHeight;
-
       // Boxify at the beginning of the line.
-      mEventData->mDecorator->AddHighlight( actualNumberOfQuads,
-                                            quad );
-      ++actualNumberOfQuads;
+      mEventData->mDecorator->AddHighlight( 0.f,
+                                            lastSelectionBoxLineInfo.lineOffset,
+                                            lastSelectionBoxLineInfo.minX,
+                                            lastSelectionBoxLineInfo.lineOffset + lastSelectionBoxLineInfo.lineHeight );
 
       // Update the size of the highlighted text.
       minHighlightX = 0.f;
@@ -2029,24 +1973,17 @@ void Controller::Impl::RepositionSelectionHandles()
 
     if( boxifyEnd )
     {
-      quad.x = lastSelectionBoxLineInfo.maxX;
-      quad.y = lastSelectionBoxLineInfo.lineOffset;
-      quad.z = mVisualModel->mControlSize.width;
-      quad.w = lastSelectionBoxLineInfo.lineOffset + lastSelectionBoxLineInfo.lineHeight;
-
       // Boxify at the end of the line.
-      mEventData->mDecorator->AddHighlight( actualNumberOfQuads,
-                                            quad );
-      ++actualNumberOfQuads;
+      mEventData->mDecorator->AddHighlight( lastSelectionBoxLineInfo.maxX,
+                                            lastSelectionBoxLineInfo.lineOffset,
+                                            mVisualModel->mControlSize.width,
+                                            lastSelectionBoxLineInfo.lineOffset + lastSelectionBoxLineInfo.lineHeight );
 
       // Update the size of the highlighted text.
       maxHighlightX = mVisualModel->mControlSize.width;
     }
   }
 
-  // Set the actual number of quads.
-  mEventData->mDecorator->ResizeHighlightQuads( actualNumberOfQuads );
-
   // Sets the highlight's size and position. In decorator's coords.
   // The highlight's height has been calculated above (before 'boxifying' the highlight).
   highLightSize.width = maxHighlightX - minHighlightX;
@@ -2215,201 +2152,158 @@ void Controller::Impl::ChangeState( EventData::State newState )
 
   if( mEventData->mState != newState )
   {
-    mEventData->mPreviousState = mEventData->mState;
     mEventData->mState = newState;
 
-    switch( mEventData->mState )
+    if( EventData::INACTIVE == mEventData->mState )
+    {
+      mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_NONE );
+      mEventData->mDecorator->StopCursorBlink();
+      mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, false );
+      mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, false );
+      mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, false );
+      mEventData->mDecorator->SetPopupActive( false );
+      mEventData->mDecoratorUpdated = true;
+      HideClipboard();
+    }
+    else if( EventData::INTERRUPTED  == mEventData->mState)
     {
-      case EventData::INACTIVE:
+      mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, false );
+      mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, false );
+      mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, false );
+      mEventData->mDecorator->SetPopupActive( false );
+      mEventData->mDecoratorUpdated = true;
+      HideClipboard();
+    }
+    else if( EventData::SELECTING == mEventData->mState )
+    {
+      mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_NONE );
+      mEventData->mDecorator->StopCursorBlink();
+      mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, false );
+      mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, true );
+      mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, true );
+      if( mEventData->mGrabHandlePopupEnabled )
       {
-        mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_NONE );
-        mEventData->mDecorator->StopCursorBlink();
-        mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, false );
-        mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, false );
-        mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, false );
-        mEventData->mDecorator->SetHighlightActive( false );
-        mEventData->mDecorator->SetPopupActive( false );
-        mEventData->mDecoratorUpdated = true;
-        HideClipboard();
-        break;
+        SetPopupButtons();
+        mEventData->mDecorator->SetPopupActive( true );
       }
-      case EventData::INTERRUPTED:
+      mEventData->mDecoratorUpdated = true;
+    }
+    else if( EventData::EDITING == mEventData->mState )
+    {
+      mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_PRIMARY );
+      if( mEventData->mCursorBlinkEnabled )
+      {
+        mEventData->mDecorator->StartCursorBlink();
+      }
+      // Grab handle is not shown until a tap is received whilst EDITING
+      mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, false );
+      mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, false );
+      mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, false );
+      if( mEventData->mGrabHandlePopupEnabled )
       {
-        mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, false );
-        mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, false );
-        mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, false );
-        mEventData->mDecorator->SetHighlightActive( false );
         mEventData->mDecorator->SetPopupActive( false );
-        mEventData->mDecoratorUpdated = true;
-        HideClipboard();
-        break;
       }
-      case EventData::SELECTING:
+      mEventData->mDecoratorUpdated = true;
+      HideClipboard();
+    }
+    else if( EventData::EDITING_WITH_POPUP == mEventData->mState )
+    {
+      DALI_LOG_INFO( gLogFilter, Debug::Verbose, "EDITING_WITH_POPUP \n", newState );
+
+      mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_PRIMARY );
+      if( mEventData->mCursorBlinkEnabled )
       {
-        mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_NONE );
-        mEventData->mDecorator->StopCursorBlink();
-        mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, false );
-        mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, true );
-        mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, true );
-        mEventData->mDecorator->SetHighlightActive( true );
-        if( mEventData->mGrabHandlePopupEnabled )
-        {
-          SetPopupButtons();
-          mEventData->mDecorator->SetPopupActive( true );
-        }
-        mEventData->mDecoratorUpdated = true;
-        break;
+        mEventData->mDecorator->StartCursorBlink();
       }
-      case EventData::EDITING:
+      if( mEventData->mSelectionEnabled )
       {
-        mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_PRIMARY );
-        if( mEventData->mCursorBlinkEnabled )
-        {
-          mEventData->mDecorator->StartCursorBlink();
-        }
-        // Grab handle is not shown until a tap is received whilst EDITING
-        mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, false );
         mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, false );
         mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, false );
-        mEventData->mDecorator->SetHighlightActive( false );
-        if( mEventData->mGrabHandlePopupEnabled )
-        {
-          mEventData->mDecorator->SetPopupActive( false );
-        }
-        mEventData->mDecoratorUpdated = true;
-        HideClipboard();
-        break;
       }
-      case EventData::EDITING_WITH_POPUP:
+      else
       {
-        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "EDITING_WITH_POPUP \n", newState );
-
-        mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_PRIMARY );
-        if( mEventData->mCursorBlinkEnabled )
-        {
-          mEventData->mDecorator->StartCursorBlink();
-        }
-        if( mEventData->mSelectionEnabled )
-        {
-          mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, false );
-          mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, false );
-          mEventData->mDecorator->SetHighlightActive( false );
-        }
-        else
-        {
-          mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, true );
-        }
-        if( mEventData->mGrabHandlePopupEnabled )
-        {
-          SetPopupButtons();
-          mEventData->mDecorator->SetPopupActive( true );
-        }
-        HideClipboard();
-        mEventData->mDecoratorUpdated = true;
-        break;
+        mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, true );
       }
-      case EventData::EDITING_WITH_GRAB_HANDLE:
+      if( mEventData->mGrabHandlePopupEnabled )
       {
-        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "EDITING_WITH_GRAB_HANDLE \n", newState );
+        SetPopupButtons();
+        mEventData->mDecorator->SetPopupActive( true );
+      }
+      HideClipboard();
+      mEventData->mDecoratorUpdated = true;
+    }
+    else if( EventData::EDITING_WITH_GRAB_HANDLE == mEventData->mState )
+    {
+      DALI_LOG_INFO( gLogFilter, Debug::Verbose, "EDITING_WITH_GRAB_HANDLE \n", newState );
 
-        mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_PRIMARY );
-        if( mEventData->mCursorBlinkEnabled )
-        {
-          mEventData->mDecorator->StartCursorBlink();
-        }
-        // Grab handle is not shown until a tap is received whilst EDITING
-        mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, true );
-        mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, false );
-        mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, false );
-        mEventData->mDecorator->SetHighlightActive( false );
-        if( mEventData->mGrabHandlePopupEnabled )
-        {
-          mEventData->mDecorator->SetPopupActive( false );
-        }
-        mEventData->mDecoratorUpdated = true;
-        HideClipboard();
-        break;
+      mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_PRIMARY );
+      if( mEventData->mCursorBlinkEnabled )
+      {
+        mEventData->mDecorator->StartCursorBlink();
       }
-      case EventData::SELECTION_HANDLE_PANNING:
+      // Grab handle is not shown until a tap is received whilst EDITING
+      mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, true );
+      mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, false );
+      mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, false );
+      if( mEventData->mGrabHandlePopupEnabled )
       {
-        mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_NONE );
-        mEventData->mDecorator->StopCursorBlink();
-        mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, false );
-        mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, true );
-        mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, true );
-        mEventData->mDecorator->SetHighlightActive( true );
-        if( mEventData->mGrabHandlePopupEnabled )
-        {
-          mEventData->mDecorator->SetPopupActive( false );
-        }
-        mEventData->mDecoratorUpdated = true;
-        break;
+        mEventData->mDecorator->SetPopupActive( false );
       }
-      case EventData::GRAB_HANDLE_PANNING:
+      mEventData->mDecoratorUpdated = true;
+      HideClipboard();
+    }
+    else if( EventData::SELECTION_HANDLE_PANNING == mEventData->mState )
+    {
+      mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_NONE );
+      mEventData->mDecorator->StopCursorBlink();
+      mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, false );
+      mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, true );
+      mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, true );
+      if( mEventData->mGrabHandlePopupEnabled )
       {
-        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "GRAB_HANDLE_PANNING \n", newState );
+        mEventData->mDecorator->SetPopupActive( false );
+      }
+      mEventData->mDecoratorUpdated = true;
+    }
+    else if( EventData::GRAB_HANDLE_PANNING == mEventData->mState )
+    {
+      DALI_LOG_INFO( gLogFilter, Debug::Verbose, "GRAB_HANDLE_PANNING \n", newState );
 
-        mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_PRIMARY );
-        if( mEventData->mCursorBlinkEnabled )
-        {
-          mEventData->mDecorator->StartCursorBlink();
-        }
-        mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, true );
-        mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, false );
-        mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, false );
-        mEventData->mDecorator->SetHighlightActive( false );
-        if( mEventData->mGrabHandlePopupEnabled )
-        {
-          mEventData->mDecorator->SetPopupActive( false );
-        }
-        mEventData->mDecoratorUpdated = true;
-        break;
+      mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_PRIMARY );
+      if( mEventData->mCursorBlinkEnabled )
+      {
+        mEventData->mDecorator->StartCursorBlink();
       }
-      case EventData::EDITING_WITH_PASTE_POPUP:
+      mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, true );
+      mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, false );
+      mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, false );
+      if( mEventData->mGrabHandlePopupEnabled )
       {
-        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "EDITING_WITH_PASTE_POPUP \n", newState );
-
-        mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_PRIMARY );
-        if( mEventData->mCursorBlinkEnabled )
-        {
-          mEventData->mDecorator->StartCursorBlink();
-        }
-
-        mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, true );
-        mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, false );
-        mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, false );
-        mEventData->mDecorator->SetHighlightActive( false );
-
-        if( mEventData->mGrabHandlePopupEnabled )
-        {
-          SetPopupButtons();
-          mEventData->mDecorator->SetPopupActive( true );
-        }
-        HideClipboard();
-        mEventData->mDecoratorUpdated = true;
-        break;
+        mEventData->mDecorator->SetPopupActive( false );
       }
-      case EventData::TEXT_PANNING:
+      mEventData->mDecoratorUpdated = true;
+    }
+    else if( EventData::EDITING_WITH_PASTE_POPUP == mEventData->mState )
+    {
+      DALI_LOG_INFO( gLogFilter, Debug::Verbose, "EDITING_WITH_PASTE_POPUP \n", newState );
+
+      mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_PRIMARY );
+      if( mEventData->mCursorBlinkEnabled )
       {
-        mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_NONE );
-        mEventData->mDecorator->StopCursorBlink();
-        mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, false );
-        if( mEventData->mDecorator->IsHandleActive( LEFT_SELECTION_HANDLE ) ||
-            mEventData->mDecorator->IsHandleActive( RIGHT_SELECTION_HANDLE ) )
-        {
-          mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, false );
-          mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, false );
-          mEventData->mDecorator->SetHighlightActive( true );
-        }
+        mEventData->mDecorator->StartCursorBlink();
+      }
 
-        if( mEventData->mGrabHandlePopupEnabled )
-        {
-          mEventData->mDecorator->SetPopupActive( false );
-        }
+      mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, true );
+      mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, false );
+      mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, false );
 
-        mEventData->mDecoratorUpdated = true;
-        break;
+      if( mEventData->mGrabHandlePopupEnabled )
+      {
+        SetPopupButtons();
+        mEventData->mDecorator->SetPopupActive( true );
       }
+      HideClipboard();
+      mEventData->mDecoratorUpdated = true;
     }
   }
 }
index 8e9ab39be9a48426143b9a11ddde10265373b1cd..68659b6b558f067502432cea15cd0d53a30e8b15 100644 (file)
@@ -91,8 +91,7 @@ struct EventData
     EDITING_WITH_GRAB_HANDLE,
     EDITING_WITH_PASTE_POPUP,
     GRAB_HANDLE_PANNING,
-    SELECTION_HANDLE_PANNING,
-    TEXT_PANNING
+    SELECTION_HANDLE_PANNING
   };
 
   EventData( DecoratorPtr decorator );
@@ -118,7 +117,6 @@ struct EventData
 
   InputStyle         mInputStyle;              ///< The style to be set to the new inputed text.
 
-  State              mPreviousState;           ///< Stores the current state before it's updated with the new one.
   State              mState;                   ///< Selection mode, edit mode etc.
 
   CharacterIndex     mPrimaryCursorPosition;   ///< Index into logical model for primary cursor.
@@ -142,7 +140,6 @@ struct EventData
   bool mUpdateGrabHandlePosition        : 1;   ///< True if the visual position of the grab handle must be recalculated.
   bool mUpdateLeftSelectionPosition     : 1;   ///< True if the visual position of the left selection handle must be recalculated.
   bool mUpdateRightSelectionPosition    : 1;   ///< True if the visual position of the right selection handle must be recalculated.
-  bool mIsLeftHandleSelected            : 1;   ///< Whether is the left handle the one which is selected.
   bool mUpdateHighlightBox              : 1;   ///< True if the text selection high light box must be updated.
   bool mScrollAfterUpdatePosition       : 1;   ///< Whether to scroll after the cursor position is updated.
   bool mScrollAfterDelete               : 1;   ///< Whether to scroll after delete characters.
index 4c0316fd90bc5e399ac5aac8d8241377c41de890..643c8b83ab53bb3e4ffd56d3c230bb0be75caa1d 100644 (file)
@@ -164,7 +164,7 @@ void Controller::SetAutoScrollEnabled( bool enable )
   }
   else
   {
-    DALI_LOG_WARNING( "Attempted AutoScrolling on a non SINGLE_LINE_BOX, request ignored\n" );
+    DALI_LOG_WARNING( "Attempted AutoScrolling on a non SINGLE_LINE_BOX, request ignored" );
     mImpl->mAutoScrollEnabled = false;
   }
 }
@@ -572,7 +572,7 @@ float Controller::GetDefaultPointSize() const
 
 void Controller::UpdateAfterFontChange( const std::string& newDefaultFont )
 {
-  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::UpdateAfterFontChange\n");
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::UpdateAfterFontChange");
 
   if( !mImpl->mFontDefaults->familyDefined ) // If user defined font then should not update when system font changes
   {
@@ -2172,7 +2172,7 @@ void Controller::InsertText( const std::string& text, Controller::InsertType typ
     {
       if( !mImpl->mEventData->mPreEditFlag )
       {
-        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Entered PreEdit state\n" );
+        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Entered PreEdit state" );
 
         // Record the start of the pre-edit text
         mImpl->mEventData->mPreEditStartPosition = mImpl->mEventData->mPrimaryCursorPosition;
index 6024c989baca24666a568bf8aea05c47055b9e5f..828ecceb9f8738c9b32440f496e8e9e5643cd390 100644 (file)
@@ -353,7 +353,7 @@ void CubeTransitionEffect::StartTransition( Vector2 panPosition, Vector2 panDisp
 {
   if( !mCurrentRenderer )
   {
-    DALI_LOG_ERROR( "Trying to transition a cube transition without an image set\n" );
+    DALI_LOG_ERROR( "Trying to transition a cube transition without an image set" );
     return;
   }
 
index a56402f37b0e368b5843b7f25cfdbc3538f7086b..dec584e22f780be1e2dd738d962b272f53c89f2b 100644 (file)
@@ -121,13 +121,13 @@ void BorderVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap
   Property::Value* color = propertyMap.Find( Toolkit::BorderVisual::Property::COLOR, COLOR_NAME );
   if( !( color && color->Get(mBorderColor) ) )
   {
-    DALI_LOG_ERROR( "Fail to provide a border color to the BorderVisual object\n" );
+    DALI_LOG_ERROR( "Fail to provide a border color to the BorderVisual object" );
   }
 
   Property::Value* size = propertyMap.Find( Toolkit::BorderVisual::Property::SIZE, SIZE_NAME );
   if( !( size && size->Get(mBorderSize) ) )
   {
-    DALI_LOG_ERROR( "Fail to provide a border size to the BorderVisual object\n" );
+    DALI_LOG_ERROR( "Fail to provide a border size to the BorderVisual object" );
   }
 
   Property::Value* antiAliasing = propertyMap.Find( Toolkit::BorderVisual::Property::ANTI_ALIASING, ANTI_ALIASING );
index 17cf68a4de93054c2ea2ec3db533e609b8ca98da..1c32b407f708fa05830a1937525908d203bc3a2d 100644 (file)
@@ -80,7 +80,7 @@ void ColorVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap )
   Property::Value* color = propertyMap.Find( Toolkit::ColorVisual::Property::MIX_COLOR, COLOR_NAME );
   if( !( color && color->Get(mMixColor) ) )
   {
-    DALI_LOG_ERROR( "Fail to provide a color to the ColorVisual object\n" );
+    DALI_LOG_ERROR( "Fail to provide a color to the ColorVisual object" );
   }
 }
 
index 22f90263278674c9556cb27b031a2a18f4fa48e7..1a4e60475f8272b3a8447c7002e6b398c1fb79b8 100644 (file)
@@ -220,7 +220,7 @@ void GradientVisual::DoInitialize( Actor& actor, const Property::Map& propertyMa
   }
   else
   {
-    DALI_LOG_ERROR( "Fail to provide valid properties to create a GradientVisual object\n" );
+    DALI_LOG_ERROR( "Fail to provide valid properties to create a GradientVisual object" );
   }
 }
 
diff --git a/dali-toolkit/internal/visuals/image/batch-image-visual.cpp b/dali-toolkit/internal/visuals/image/batch-image-visual.cpp
deleted file mode 100644 (file)
index 12bfdad..0000000
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- * Copyright (c) 2016 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 "batch-image-visual.h"
-
-// EXTERNAL HEADER
-#include <cstring> // for strncasecmp
-#include <dali/public-api/images/resource-image.h>
-#include <dali/public-api/images/native-image.h>
-#include <dali/integration-api/debug.h>
-#include <dali/devel-api/adaptor-framework/bitmap-loader.h>
-#include <dali/public-api/images/pixel-data.h>
-#include <dali/public-api/rendering/texture.h>
-#include <dali/public-api/rendering/texture-set.h>
-#include <dali/public-api/shader-effects/shader-effect.h>
-#include <dali/public-api/rendering/texture-set.h>
-
-// INTERNAL HEADER
-#include <dali-toolkit/public-api/visuals/image-visual-properties.h>
-#include <dali-toolkit/internal/visuals/visual-factory-impl.h>
-#include <dali-toolkit/internal/visuals/visual-factory-cache.h>
-#include <dali-toolkit/internal/visuals/visual-base-impl.h>
-#include <dali-toolkit/internal/visuals/visual-base-data-impl.h>
-#include <dali-toolkit/internal/visuals/visual-string-constants.h>
-#include <dali-toolkit/internal/visuals/image-atlas-manager.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-namespace
-{
-const char HTTP_URL[] = "http://";
-const char HTTPS_URL[] = "https://";
-
-// Properties:
-const char * const DESIRED_WIDTH( "desiredWidth" );
-const char * const DESIRED_HEIGHT( "desiredHeight" );
-
-const Vector4 FULL_TEXTURE_RECT( 0.f, 0.f, 1.f, 1.f );
-
-// The shader used for batched rendering. It uses interleaved data for
-// attributes. Limitation is that all batched renderers will share same set of uniforms.
-const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
-  attribute mediump vec2 aPosition;\n
-  attribute mediump vec2 aTexCoord;\n
-  uniform mediump mat4 uMvpMatrix;\n
-  varying mediump vec2 vTexCoord;\n
-  \n
-  void main()\n
-  {\n
-    vTexCoord = aTexCoord;\n
-    gl_Position = uMvpMatrix * vec4( aPosition, 0.0, 1.0 );\n
-  }\n
-);
-
-const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
-  varying mediump vec2 vTexCoord;\n
-  uniform sampler2D sTexture;\n
-  uniform lowp vec4 uColor;\n
-  uniform lowp float uAlphaBlending; // Set to 1.0 for conventional alpha blending; if pre-multiplied alpha blending, set to 0.0
-  \n
-  void main()\n
-  {\n
-    gl_FragColor = texture2D( sTexture, vTexCoord ) * vec4( uColor.rgb*max( uAlphaBlending, uColor.a ), uColor.a );\n
-  }\n
-);
-
-} //unnamed namespace
-
-BatchImageVisual::BatchImageVisual( VisualFactoryCache& factoryCache, ImageAtlasManager& atlasManager )
-  : Visual::Base( factoryCache ),
-    mAtlasManager( atlasManager ),
-    mDesiredSize()
-{
-}
-
-BatchImageVisual::~BatchImageVisual()
-{
-}
-
-void BatchImageVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap )
-{
-  std::string oldImageUrl = mImageUrl;
-  Property::Value* imageURLValue = propertyMap.Find( Dali::Toolkit::ImageVisual::Property::URL, Dali::Toolkit::Internal::IMAGE_URL_NAME );
-
-  if( imageURLValue )
-  {
-    imageURLValue->Get( mImageUrl );
-
-    int desiredWidth = 0;
-    Property::Value* desiredWidthValue = propertyMap.Find( Dali::Toolkit::ImageVisual::Property::DESIRED_WIDTH, DESIRED_WIDTH );
-    if( desiredWidthValue )
-    {
-      desiredWidthValue->Get( desiredWidth );
-    }
-
-    int desiredHeight = 0;
-    Property::Value* desiredHeightValue = propertyMap.Find( Dali::Toolkit::ImageVisual::Property::DESIRED_HEIGHT, DESIRED_HEIGHT );
-    if( desiredHeightValue )
-    {
-      desiredHeightValue->Get( desiredHeight );
-    }
-
-    mDesiredSize = ImageDimensions( desiredWidth, desiredHeight );
-  }
-
-  // Remove old renderer if exit.
-  if( mImpl->mRenderer )
-  {
-    if( actor ) // Remove old renderer from actor.
-    {
-      actor.RemoveRenderer( mImpl->mRenderer );
-    }
-    if( !oldImageUrl.empty() ) // Clean old renderer from cache.
-    {
-      CleanCache( oldImageUrl );
-    }
-  }
-
-  // If actor is on stage, create new renderer and apply to actor.
-  if( actor && actor.OnStage() )
-  {
-    SetOnStage( actor );
-  }
-}
-
-void BatchImageVisual::SetSize( const Vector2& size )
-{
-  Visual::Base::SetSize( size );
-}
-
-void BatchImageVisual::GetNaturalSize( Vector2& naturalSize ) const
-{
-  if( mDesiredSize.GetWidth() > 0 && mDesiredSize.GetHeight() > 0 )
-  {
-    naturalSize.x = mDesiredSize.GetWidth();
-    naturalSize.y = mDesiredSize.GetHeight();
-    return;
-  }
-  else if( !mImageUrl.empty() )
-  {
-    ImageDimensions dimentions = ResourceImage::GetImageSize( mImageUrl );
-    naturalSize.x = dimentions.GetWidth();
-    naturalSize.y = dimentions.GetHeight();
-    return;
-  }
-
-  naturalSize = Vector2::ZERO;
-}
-
-void BatchImageVisual::SetClipRect( const Rect<int>& clipRect )
-{
-  Visual::Base::SetClipRect( clipRect );
-}
-
-void BatchImageVisual::InitializeRenderer( const std::string& imageUrl )
-{
-  if( imageUrl.empty() )
-  {
-    return;
-  }
-
-  mImageUrl = imageUrl;
-  mImpl->mRenderer.Reset();
-  mAtlasRect = FULL_TEXTURE_RECT;
-
-  if( !mImpl->mCustomShader &&
-      ( strncasecmp( imageUrl.c_str(),HTTP_URL,  sizeof( HTTP_URL )  -1 ) != 0 ) && // Ignore remote images
-      ( strncasecmp( imageUrl.c_str(), HTTPS_URL, sizeof( HTTPS_URL ) -1 ) != 0 ) )
-  {
-    if( !mImpl->mRenderer )
-    {
-      TextureSet textureSet = mAtlasManager.Add(
-            mAtlasRect,
-            imageUrl,
-            mDesiredSize );
-
-      // If image doesn't fit the atlas, create new texture set with texture that
-      // is used as whole.
-      if( !textureSet )
-      {
-        BitmapLoader loader = BitmapLoader::New( imageUrl, mDesiredSize );
-        loader.Load();
-        Dali::PixelData pixelData = loader.GetPixelData();
-        Texture texture = Texture::New( TextureType::TEXTURE_2D,
-                                        pixelData.GetPixelFormat(),
-                                        pixelData.GetWidth(),
-                                        pixelData.GetHeight() );
-        texture.Upload( pixelData );
-        textureSet = TextureSet::New();
-        textureSet.SetTexture( 0, texture );
-        mAtlasRect = FULL_TEXTURE_RECT;
-      }
-
-      Geometry geometry = mFactoryCache.CreateBatchQuadGeometry( mAtlasRect );
-      Shader shader( GetBatchShader( mFactoryCache ) );
-      mImpl->mRenderer = Renderer::New( geometry, shader );
-      mImpl->mRenderer.SetTextures( textureSet );
-
-      // Turn batching on, to send message it must be on stage.
-      mImpl->mRenderer.SetProperty( Dali::Renderer::Property::BATCHING_ENABLED, true );
-    }
-    mImpl->mFlags |= Impl::IS_FROM_CACHE;
-  }
-}
-
-void BatchImageVisual::DoSetOnStage( Actor& actor )
-{
-  if( !mImageUrl.empty() )
-  {
-    InitializeRenderer( mImageUrl );
-  }
-  // Turn batching on, to send message it must be on stage
-  mImpl->mRenderer.SetProperty( Dali::Renderer::Property::BATCHING_ENABLED, true );
-}
-
-void BatchImageVisual::DoSetOffStage( Actor& actor )
-{
-  actor.RemoveRenderer( mImpl->mRenderer );
-
-  // If we own the image then make sure we release it when we go off stage
-  if( !mImageUrl.empty() )
-  {
-    CleanCache( mImageUrl );
-  }
-  else
-  {
-    mImpl->mRenderer.Reset();
-  }
-}
-
-void BatchImageVisual::DoCreatePropertyMap( Property::Map& map ) const
-{
-  map.Clear();
-  map.Insert( Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE );
-
-  if( !mImageUrl.empty() )
-  {
-    map.Insert( Toolkit::ImageVisual::Property::URL, mImageUrl );
-    map.Insert( Toolkit::ImageVisual::Property::BATCHING_ENABLED, true );
-    map.Insert( Toolkit::ImageVisual::Property::DESIRED_WIDTH, mDesiredSize.GetWidth() );
-    map.Insert( Toolkit::ImageVisual::Property::DESIRED_HEIGHT, mDesiredSize.GetHeight() );
-  }
-}
-
-Shader BatchImageVisual::GetBatchShader( VisualFactoryCache& factoryCache )
-{
-  Shader shader = factoryCache.GetShader( VisualFactoryCache::BATCH_IMAGE_SHADER );
-  if( !shader )
-  {
-    shader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
-    factoryCache.SaveShader( VisualFactoryCache::BATCH_IMAGE_SHADER, shader );
-  }
-  return shader;
-}
-
-void BatchImageVisual::CleanCache(const std::string& url)
-{
-  TextureSet textureSet = mImpl->mRenderer.GetTextures();
-  mImpl->mRenderer.Reset();
-  if( mFactoryCache.CleanRendererCache( url ) )
-  {
-    mAtlasManager.Remove( textureSet, mAtlasRect );
-  }
-}
-
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/internal/visuals/image/batch-image-visual.h b/dali-toolkit/internal/visuals/image/batch-image-visual.h
deleted file mode 100644 (file)
index 750e28f..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-#ifndef DALI_TOOLKIT_INTERNAL_BATCH_IMAGE_VISUAL_H
-#define DALI_TOOLKIT_INTERNAL_BATCH_IMAGE_VISUAL_H
-
-/*
- * Copyright (c) 2016 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.
- *
- */
-
-// INTERNAL HEADER
-#include <dali-toolkit/internal/visuals/visual-base-impl.h>
-#include <dali-toolkit/internal/visuals/image-atlas-manager.h>
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/images/resource-image.h>
-
-namespace Dali
-{
-namespace Toolkit
-{
-namespace Internal
-{
-
-class BatchImageVisual: public Visual::Base, public ConnectionTracker
-{
-public:
-
-  /**
-   * @brief Constructor.
-   *
-   * @param[in] factoryCache The VisualFactoryCache object
-   * @param[in] atlasManager The atlasManager object
-   */
-  BatchImageVisual( VisualFactoryCache& factoryCache, ImageAtlasManager& atlasManager );
-
-  /**
-   * @brief A reference counted object may only be deleted by calling Unreference().
-   */
-  ~BatchImageVisual();
-
-public:  // from Visual
-
-  /**
-   * @copydoc Visual::Base::SetSize
-   */
-  virtual void SetSize( const Vector2& size );
-
-  /**
-   * @copydoc Visual::Base::GetNaturalSize
-   */
-  virtual void GetNaturalSize( Vector2& naturalSize ) const;
-
-  /**
-   * @copydoc Visual::Base::SetClipRect
-   */
-  virtual void SetClipRect( const Rect<int>& clipRect );
-
-  /**
-   * @copydoc Visual::Base::CreatePropertyMap
-   */
-  virtual void DoCreatePropertyMap( Property::Map& map ) const;
-
-protected:
-
-  /**
-   * @copydoc Visua::Base::DoInitialize
-   */
-  virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
-
-  /**
-   * @copydoc Visual::Base::DoSetOnStage
-   */
-  virtual void DoSetOnStage( Actor& actor );
-
-  /**
-   * @copydoc Visual::Base::DoSetOffStage
-   */
-  virtual void DoSetOffStage( Actor& actor );
-
-private:
-
-  /**
-   * Get the batch image rendering shader.
-   * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
-   */
-  static Shader GetBatchShader( VisualFactoryCache& factoryCache );
-
-  /**
-   * @brief Initializes the Dali::Renderer from an image url string
-   *
-   * @param[in] imageUrl The image url string to intialize this ImageVisual from
-   */
-  void InitializeRenderer( const std::string& imageUrl );
-
-  /**
-   * Clean the Visual from cache, and remove the image from atlas if it is not used anymore
-   */
-  void CleanCache( const std::string& url );
-
-private:
-
-  ImageAtlasManager&      mAtlasManager;
-  Vector4                 mAtlasRect;
-  std::string             mImageUrl;
-  Dali::ImageDimensions   mDesiredSize;
-};
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // DALI_TOOLKIT_INTERNAL_BATCH_IMAGE_VISUAL_H
index 9125acd3645006bef1bebdcdfc15d74d892cf73b..70347ffd2f57ff7a67e95899e545805904c94085 100644 (file)
@@ -58,7 +58,6 @@ const char * const IMAGE_SAMPLING_MODE( "samplingMode" );
 const char * const IMAGE_DESIRED_WIDTH( "desiredWidth" );
 const char * const IMAGE_DESIRED_HEIGHT( "desiredHeight" );
 const char * const SYNCHRONOUS_LOADING( "synchronousLoading" );
-const char * const BATCHING_ENABLED( "batchingEnabled" );
 
 // fitting modes
 DALI_ENUM_TO_STRING_TABLE_BEGIN( FITTING_MODE )
@@ -491,6 +490,7 @@ void ImageVisual::InitializeRenderer( const Image& image )
   }
 }
 
+
 void ImageVisual::DoSetOnStage( Actor& actor )
 {
   if( !mImageUrl.empty() )
index f539dd6650f386823bc5aab5f5ef0700e17d8c1c..4b9de211ba556658760aca322fb74d8210f0d859 100644 (file)
@@ -79,7 +79,7 @@ void Internal::Visual::Base::Impl::CustomShader::SetPropertyMap( const Property:
   {
     if( !vertexShaderValue->Get( mVertexShader ) )
     {
-      DALI_LOG_ERROR( "'%s' parameter does not correctly specify a string\n", CUSTOM_VERTEX_SHADER );
+      DALI_LOG_ERROR( "'%s' parameter does not correctly specify a string", CUSTOM_VERTEX_SHADER );
     }
   }
 
@@ -88,7 +88,7 @@ void Internal::Visual::Base::Impl::CustomShader::SetPropertyMap( const Property:
   {
     if( !fragmentShaderValue->Get( mFragmentShader ) )
     {
-      DALI_LOG_ERROR( "'%s' parameter does not correctly specify a string\n", CUSTOM_FRAGMENT_SHADER );
+      DALI_LOG_ERROR( "'%s' parameter does not correctly specify a string", CUSTOM_FRAGMENT_SHADER );
     }
   }
 
@@ -98,7 +98,7 @@ void Internal::Visual::Base::Impl::CustomShader::SetPropertyMap( const Property:
     int subdivideX;
     if( !subdivideXValue->Get( subdivideX ) || subdivideX < 1 )
     {
-      DALI_LOG_ERROR( "'%s' parameter does not correctly specify a value greater than 1\n", CUSTOM_SUBDIVIDE_GRID_X );
+      DALI_LOG_ERROR( "'%s' parameter does not correctly specify a value greater than 1", CUSTOM_SUBDIVIDE_GRID_X );
     }
     else
     {
@@ -112,7 +112,7 @@ void Internal::Visual::Base::Impl::CustomShader::SetPropertyMap( const Property:
     int subdivideY;
     if( !subdivideYValue->Get( subdivideY ) || subdivideY < 1 )
     {
-      DALI_LOG_ERROR( "'%s' parameter does not correctly specify a value greater than 1\n", CUSTOM_SUBDIVIDE_GRID_Y );
+      DALI_LOG_ERROR( "'%s' parameter does not correctly specify a value greater than 1", CUSTOM_SUBDIVIDE_GRID_Y );
     }
     else
     {
@@ -125,7 +125,7 @@ void Internal::Visual::Base::Impl::CustomShader::SetPropertyMap( const Property:
   {
     if ( ! Scripting::GetBitmaskEnumerationProperty( *hintsValue, SHADER_HINT_TABLE, SHADER_HINT_TABLE_COUNT, mHints ) )
     {
-      DALI_LOG_ERROR( "'%s' parameter does not correctly specify a hint or an array of hint strings\n", CUSTOM_SHADER_HINTS );
+      DALI_LOG_ERROR( "'%s' parameter does not correctly specify a hint or an array of hint strings", CUSTOM_SHADER_HINTS );
     }
   }
 }
index 9d0c964646dcf6358e083f2316eaa69c7d9eefab..10bce2b2fd8ca63672f7e7118fffa923dfdba7ae 100644 (file)
@@ -122,7 +122,6 @@ void Base::SetOnStage( Actor& actor )
   mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA, IsPreMultipliedAlphaEnabled());
   mImpl->mRenderer.SetProperty( Renderer::Property::DEPTH_INDEX, mImpl->mDepthIndex );
   actor.AddRenderer( mImpl->mRenderer );
-
   mImpl->mFlags |= Impl::IS_ON_STAGE;
 }
 
index da15492ad5ba3246e399005a38d53278c4b78c2a..2622a829e37af09c704dccdc41946372edf6b760 100644 (file)
@@ -182,7 +182,7 @@ protected:
    * @param[in] actor The Actor the visual is applied to if, empty if the visual has not been applied to any Actor
    * @param[in] propertyMap The properties for the requested Visual object.
    */
-  virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap ) {}
+  virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap ) {};
 
 protected:
 
index 404f2ecd007f98a2900c4ffc780be058c5b05541..aef0fc826f2a23e44d7dd6624cfdea146274afa3 100644 (file)
@@ -266,49 +266,6 @@ Geometry VisualFactoryCache::CreateGridGeometry( Uint16Pair gridSize )
   return geometry;
 }
 
-Geometry VisualFactoryCache::CreateBatchQuadGeometry( Vector4 texCoords )
-{
-  const float halfWidth = 0.5f;
-  const float halfHeight = 0.5f;
-  struct QuadVertex {
-    QuadVertex( const Vector2& vertexPosition, const Vector2& vertexTexCoords )
-      : position( vertexPosition ),
-        texCoords( vertexTexCoords )
-    {}
-    Vector2 position;
-    Vector2 texCoords;
-  };
-
-  // special case, when texture takes whole space
-  if( texCoords == Vector4::ZERO )
-  {
-    texCoords = Vector4(0.0f, 0.0f, 1.0f, 1.0f);
-  }
-
-  QuadVertex quadVertexData[6] =
-  {
-    QuadVertex( Vector2(-halfWidth,   -halfHeight ),   Vector2(texCoords.x, texCoords.y) ),
-    QuadVertex( Vector2( halfWidth,   -halfHeight ),   Vector2(texCoords.z, texCoords.y) ),
-    QuadVertex( Vector2(-halfWidth,    halfHeight ),   Vector2(texCoords.x, texCoords.w) ),
-    QuadVertex( Vector2( halfWidth,   -halfHeight ),   Vector2(texCoords.z, texCoords.y) ),
-    QuadVertex( Vector2(-halfWidth,    halfHeight ),   Vector2(texCoords.x, texCoords.w) ),
-    QuadVertex( Vector2( halfWidth,    halfHeight ),   Vector2(texCoords.z, texCoords.w) ),
-  };
-
-  Property::Map vertexFormat;
-  vertexFormat[ "aPosition" ] = Property::VECTOR2;
-  vertexFormat[ "aTexCoord" ] = Property::VECTOR2;
-  PropertyBuffer vertexBuffer = PropertyBuffer::New( vertexFormat );
-  vertexBuffer.SetData( quadVertexData, 6 );
-
-  // create geometry as normal, single quad
-  Geometry geometry = Geometry::New();
-  geometry.AddVertexBuffer( vertexBuffer );
-  geometry.SetType( Geometry::TRIANGLES );
-
-  return geometry;
-}
-
 } // namespace Internal
 
 } // namespace Toolkit
index 2c2210a189b5ca2b292d1ae7175aa312edfaf0d1..488be155466bdb94abcb93a677339d08f7c44856 100644 (file)
@@ -59,7 +59,6 @@ public:
     GRADIENT_SHADER_RADIAL_USER_SPACE,
     GRADIENT_SHADER_RADIAL_BOUNDING_BOX,
     IMAGE_SHADER,
-    BATCH_IMAGE_SHADER,
     NINE_PATCH_SHADER,
     SVG_SHADER,
     SHADER_TYPE_MAX = SVG_SHADER
@@ -123,13 +122,6 @@ public:
    */
   static Geometry CreateGridGeometry( Uint16Pair gridSize );
 
-  /**
-   * Create the batchable geometry
-   * @param[in] texCoords The texture atlas rect coordinates
-   * @return The created batchable geometry
-   */
-  static Geometry CreateBatchQuadGeometry( Vector4 texCoords );
-
 public:
 
   /**
index 530feb9835eb705dcd4f768e62d692f4d2a9405d..5775130f7fbbf5358a9cc71c9374263770873934 100644 (file)
@@ -41,7 +41,6 @@
 #include <dali-toolkit/internal/visuals/visual-factory-cache.h>
 #include <dali-toolkit/internal/visuals/visual-string-constants.h>
 #include <dali-toolkit/internal/visuals/image-atlas-manager.h>
-#include <dali-toolkit/internal/visuals/image/batch-image-visual.h>
 
 namespace
 {
@@ -71,7 +70,7 @@ DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::Visual, DEBUG )
 DALI_ENUM_TO_STRING_TABLE_END( VISUAL_TYPE )
 
 const char * const VISUAL_TYPE( "visualType" );
-const char * const BATCHING_ENABLED( "batchingEnabled" );
+
 BaseHandle Create()
 {
   BaseHandle handle = Toolkit::VisualFactory::Get();
@@ -110,7 +109,7 @@ Toolkit::Visual::Base VisualFactory::CreateVisual( const Property::Map& property
   Visual::Base* visualPtr = NULL;
 
   Property::Value* typeValue = propertyMap.Find( Toolkit::Visual::Property::TYPE, VISUAL_TYPE );
-  Toolkit::Visual::Type visualType = Toolkit::Visual::IMAGE; // Default to IMAGE type.
+  Toolkit::Visual::Type visualType = Toolkit::Visual::IMAGE; // Default to IMAGE type
   if( typeValue )
   {
     Scripting::GetEnumerationProperty( *typeValue, VISUAL_TYPE_TABLE, VISUAL_TYPE_TABLE_COUNT, visualType );
@@ -143,19 +142,7 @@ Toolkit::Visual::Base VisualFactory::CreateVisual( const Property::Map& property
       std::string imageUrl;
       if( imageURLValue && imageURLValue->Get( imageUrl ) )
       {
-        Property::Value* batchingEnabledValue = propertyMap.Find( Toolkit::ImageVisual::Property::BATCHING_ENABLED, BATCHING_ENABLED );
-        if( batchingEnabledValue  )
-        {
-          bool batchingEnabled( false );
-          batchingEnabledValue->Get( batchingEnabled );
-          if( batchingEnabled )
-          {
-            CreateAtlasManager();
-            visualPtr = new BatchImageVisual( *( mFactoryCache.Get() ), *( mAtlasManager.Get() ) );
-            break;
-          }
-        }
-        else if( NinePatchImage::IsNinePatchUrl( imageUrl ) )
+        if( NinePatchImage::IsNinePatchUrl( imageUrl ) )
         {
           visualPtr = new NPatchVisual( *( mFactoryCache.Get() ) );
         }
@@ -200,7 +187,6 @@ Toolkit::Visual::Base VisualFactory::CreateVisual( const Property::Map& property
       visualPtr = new DebugVisual( *( mFactoryCache.Get() ) );
       break;
     }
-
   }
 
   if( visualPtr )
@@ -210,7 +196,7 @@ Toolkit::Visual::Base VisualFactory::CreateVisual( const Property::Map& property
   }
   else
   {
-    DALI_LOG_ERROR( "Renderer type unknown\n" );
+    DALI_LOG_ERROR( "Renderer type unknown" );
   }
 
   return Toolkit::Visual::Base( visualPtr );
index b68f27c184d91ee0ee5210e61a71f7a3214196e3..a224124d6d52517acd55de36573db5e50401568b 100644 (file)
@@ -36,7 +36,7 @@ const char * const CUSTOM_SUBDIVIDE_GRID_Y( "subdivideGridY" );
 const char * const CUSTOM_SHADER_HINTS( "hints" );
 
 // Image visual
-const char * const IMAGE_URL_NAME( "url" );
+const char * const IMAGE_URL_NAME("url");
 const char * const ATLAS_RECT_UNIFORM_NAME ( "uAtlasRect" );
 
 } // namespace Internal
index ce56e10f3db887d12cf1b5b85a4617e665ea3ca6..d54df66c14a53770b496953f5a78cf66c59ccc1d 100644 (file)
@@ -51,33 +51,6 @@ namespace Toolkit
 namespace
 {
 
-/**
- * Struct used to store Visual within the control, index is a unique key for each visual.
- */
-struct RegisteredVisual
-{
-  Property::Index index;
-  Toolkit::Visual::Base visual;
-  Actor placementActor;
-
-  RegisteredVisual( Property::Index aIndex, Toolkit::Visual::Base &aVisual, Actor &aPlacementActor) : index(aIndex), visual(aVisual), placementActor(aPlacementActor) {}
-};
-
-/**
- *  Finds visual in given array, returning true if found along with the iterator for that visual as a out parameter
- */
-bool FindVisual( Property::Index targetIndex, std::vector<RegisteredVisual>& visuals, std::vector<RegisteredVisual>::iterator& iter )
-{
-  for ( iter = visuals.begin(); iter != visuals.end(); iter++ )
-  {
-    if ( (*iter).index ==  targetIndex )
-    {
-      return true;
-    }
-  }
-  return false;
-}
-
 /**
  * Creates control through type registry
  */
@@ -394,7 +367,6 @@ public:
   // Data
 
   Control& mControlImpl;
-  std::vector<RegisteredVisual> mVisuals; // Stores visuals needed by the control, non trivial type so std::vector used.
   std::string mStyleName;
   Toolkit::Visual::Base mBackgroundVisual;   ///< The visual to render the background
   Vector4 mBackgroundColor;                       ///< The color of the background visual
@@ -653,44 +625,6 @@ void Control::KeyboardEnter()
   OnKeyboardEnter();
 }
 
-void Control::RegisterVisual( Property::Index index, Actor placementActor, Toolkit::Visual::Base visual )
-{
-  bool visualReplaced ( false );
-  Actor actorToRegister; // Null actor, replaced if placement actor not Self
-
-  if ( placementActor != Self() ) // Prevent increasing ref count if actor self
-  {
-    actorToRegister = placementActor;
-  }
-
-  if ( !mImpl->mVisuals.empty() )
-  {
-      std::vector<RegisteredVisual>::iterator iter;
-      // Check if visual (index) is already registered.  Replace if so.
-      if ( FindVisual( index, mImpl->mVisuals, iter ) )
-      {
-        (*iter).visual = visual;
-        (*iter).placementActor = actorToRegister;
-        visualReplaced = true;
-      }
-  }
-
-  if ( !visualReplaced ) // New registration entry
-  {
-    RegisteredVisual newVisual = RegisteredVisual( index, visual, actorToRegister );
-    mImpl->mVisuals.push_back( newVisual );
-  }
-}
-
-void Control::UnregisterVisual( Property::Index index )
-{
-   std::vector< RegisteredVisual >::iterator iter;
-   if ( FindVisual( index, mImpl->mVisuals, iter ) )
-   {
-     mImpl->mVisuals.erase( iter );
-   }
-}
-
 bool Control::OnAccessibilityActivated()
 {
   return false; // Accessibility activation is not handled by default
index 8b7b045ab1b83881fcebad6133ae308f39fed500..c06235e2d433119adc75cc43233e657f3a02e597 100644 (file)
@@ -42,10 +42,6 @@ namespace Toolkit
 
 class StyleManager;
 
-namespace Visual
-{
-class Base;
-}
 namespace Internal
 {
 /**
@@ -294,27 +290,6 @@ public:
 
 protected: // For derived classes to call
 
-  /**
-   * @brief Register a visual by Property Index, linking an Actor to controlRenderer when required.
-   * In the case of the visual being an actor or control deeming controlRenderer not required then controlRenderer should be an empty handle.
-   * No parenting is done during registration, this should be done by derived class.
-   *
-   * @SINCE_1_2.0
-   *
-   * @param[in] index The Property index of the visual, used to reference visual
-   * @param[in] placementActor The actor used to by the visual.
-   * @param[in] visual The visual to register
-   */
-   void RegisterVisual( Property::Index index, Actor placementActor, Toolkit::Visual::Base visual );
-
-   /**
-    * @brief Erase the entry matching the given index from the list of registered visuals
-    * @param[in] index The Property index of the visual, used to reference visual
-    *
-    * @SINCE_1_2.0
-    */
-   void UnregisterVisual( Property::Index index );
-
   /**
    * @brief Emits KeyInputFocusGained signal if true else emits KeyInputFocusLost signal
    *
index eadaa49f7f0170897f5ac355966c05a9b55da0b6..398939e983e8c01945dac5e62e7d8afffdda9d16 100644 (file)
@@ -190,7 +190,7 @@ FixedRuler::FixedRuler(float spacing)
 {
   if(fabsf(mSpacing) <= Math::MACHINE_EPSILON_1)
   {
-    DALI_LOG_ERROR( "Page spacing too small (%f).\n", double(spacing) );
+    DALI_LOG_ERROR( "Page spacing too small (%f).", double(spacing) );
     mSpacing = spacing >= 0.0f ? Math::MACHINE_EPSILON_1 : -Math::MACHINE_EPSILON_1;
   }
   mType = Fixed;
@@ -257,7 +257,7 @@ unsigned int FixedRuler::GetPageFromPosition(float position, bool wrap) const
       if(pagesPerVolume < 1u)
       {
         pagesPerVolume = 1u;
-        DALI_LOG_ERROR("Ruler domain(%f) is smaller than its spacing(%f).\n", mDomain.GetSize() * 1.0, mSpacing * 1.0 );
+        DALI_LOG_ERROR("Ruler domain(%f) is smaller than its spacing(%f).", mDomain.GetSize() * 1.0, mSpacing * 1.0 );
       }
       page %= pagesPerVolume;
     }
index df243c8acc523ef4030d82c05f267470bc6f6d4c..7ae7885770f735bb45cf3c2d3e7785653df70367 100644 (file)
@@ -30,8 +30,8 @@ namespace Toolkit
 {
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
-const unsigned int TOOLKIT_MINOR_VERSION = 2;
-const unsigned int TOOLKIT_MICRO_VERSION = 0;
+const unsigned int TOOLKIT_MINOR_VERSION = 1;
+const unsigned int TOOLKIT_MICRO_VERSION = 45;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 7d46ac70ce6ca415567e60361d973e365f36b7aa..619a8f16bd7ad4720b06607e0e0daf99375fa7c9 100644 (file)
@@ -98,14 +98,6 @@ enum
    * @note For N-Patch images only.
    */
   BORDER_ONLY,
-
-  /**
-   * @brief This enables Image visuals to automatically be converted to Batch-Image visuals.
-   * @details Name "batchingEnabled", type Property::BOOLEAN.
-   * @SINCE_1_2.0
-   * @note Optional. For Image visuals only. Not to be used with NPatch or SVG images.
-   */
-  BATCHING_ENABLED,
 };
 
 } // namespace Property
index 4c1ff576787e3888476bf5beffc0265f7065601d..4952ebb7487971505684267e931b270436b57af5 100644 (file)
@@ -67,7 +67,7 @@ enum
    * @note Will override the existing shaders.
    * @see Shader::Property
    */
-  SHADER,
+  SHADER
 };
 
 } // namespace Property
index f7897e2424bd7d1b5c3c4caafa97eb1dc87ac42a..3da38ddf830491a7eb7e8bc44b6d78c8d841e31b 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    The OpenGLES Canvas Core Library Toolkit
-Version:    1.2.0
+Version:    1.1.45
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-2-Clause and MIT
index a834d86ca600de17ae7f60bca2f6091386948c51..8b4159db557d170785f25a34913d475e28fd799b 100644 (file)
@@ -57,6 +57,7 @@ namespace TextureSetApi
    /**
     * TextureSet API see texture-set.h for a description
     */
+   void SetImage( const v8::FunctionCallbackInfo< v8::Value >& args );
    void SetSampler( const v8::FunctionCallbackInfo< v8::Value >& args );
 
 }; // namespace TextureSetApi
index 5f503ec2d0ce7af7e5e28e67bb9e97b032bbb7c3..529665144aec18a8df6fd714b9ef62e02413e686 100644 (file)
@@ -45,6 +45,7 @@ const ApiFunction TextureSetFunctionTable[]=
     * TextureSet API (in order of texture-set.h)
     **************************************/
 
+   { "SetImage"                        , TextureSetApi::SetImage },
    { "SetSampler"                      , TextureSetApi::SetSampler },
 };
 
index ce656c0a39bfdb5de8629bc17c79a8094494163e..193836df42282919441bbe793053c39ac5be19c1 100644 (file)
@@ -87,7 +87,7 @@ void LogError(const v8::FunctionCallbackInfo< v8::Value >& args)
     output += *utf8_value;
     output +="\n";
   }
-  DALI_LOG_ERROR_NOFN( "JavaScript: %s\n",output.c_str() );
+  DALI_LOG_ERROR_NOFN( "JavaScript: %s",output.c_str() );
 }
 
 void GetFileContents(const std::string &fileName, std::string& contents)