Merge "DALi C# binding - Avoid removal of dali-swig/manual/cpp/keyboard_focus_manager...
authordongsug song <dongsug.song@samsung.com>
Wed, 2 Nov 2016 12:01:20 +0000 (05:01 -0700)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Wed, 2 Nov 2016 12:01:20 +0000 (05:01 -0700)
68 files changed:
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/toolkit-style-monitor.cpp
automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp
automated-tests/src/dali-toolkit/utc-Dali-PageTurnView.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp
automated-tests/src/dali-toolkit/utc-Dali-TransitionData.cpp
automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp
dali-toolkit/devel-api/align-enums.h [new file with mode: 0644]
dali-toolkit/devel-api/controls/page-turn-view/page-factory.h
dali-toolkit/devel-api/file.list
dali-toolkit/devel-api/visual-factory/devel-visual-properties.h
dali-toolkit/internal/controls/buttons/button-impl.cpp
dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp
dali-toolkit/internal/controls/image-view/image-view-impl.cpp
dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.cpp
dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.h
dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp
dali-toolkit/internal/controls/text-controls/text-field-impl.cpp
dali-toolkit/internal/controls/text-controls/text-label-impl.cpp
dali-toolkit/internal/filters/emboss-filter.cpp
dali-toolkit/internal/text/text-controller-impl.cpp
dali-toolkit/internal/text/text-effects-style.cpp
dali-toolkit/internal/text/text-effects-style.h
dali-toolkit/internal/text/text-font-style.cpp
dali-toolkit/internal/visuals/border/border-visual.cpp
dali-toolkit/internal/visuals/border/border-visual.h
dali-toolkit/internal/visuals/color/color-visual.cpp
dali-toolkit/internal/visuals/color/color-visual.h
dali-toolkit/internal/visuals/gradient/gradient-visual.cpp
dali-toolkit/internal/visuals/gradient/gradient-visual.h
dali-toolkit/internal/visuals/image/batch-image-visual.cpp
dali-toolkit/internal/visuals/image/batch-image-visual.h
dali-toolkit/internal/visuals/image/image-visual.cpp
dali-toolkit/internal/visuals/image/image-visual.h
dali-toolkit/internal/visuals/mesh/mesh-visual.cpp
dali-toolkit/internal/visuals/mesh/mesh-visual.h
dali-toolkit/internal/visuals/npatch/npatch-visual.cpp
dali-toolkit/internal/visuals/npatch/npatch-visual.h
dali-toolkit/internal/visuals/primitive/primitive-visual.cpp
dali-toolkit/internal/visuals/primitive/primitive-visual.h
dali-toolkit/internal/visuals/svg/svg-visual.cpp
dali-toolkit/internal/visuals/svg/svg-visual.h
dali-toolkit/internal/visuals/text/text-visual.cpp
dali-toolkit/internal/visuals/visual-base-data-impl.cpp
dali-toolkit/internal/visuals/visual-base-data-impl.h
dali-toolkit/internal/visuals/visual-base-impl.cpp
dali-toolkit/internal/visuals/visual-base-impl.h
dali-toolkit/internal/visuals/visual-factory-impl.cpp
dali-toolkit/internal/visuals/visual-string-constants.cpp
dali-toolkit/internal/visuals/visual-string-constants.h
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/controls/control-impl.h
dali-toolkit/public-api/controls/text-controls/text-editor.h
dali-toolkit/public-api/controls/text-controls/text-field.h
dali-toolkit/public-api/controls/text-controls/text-label.h
dali-toolkit/public-api/dali-toolkit-version.cpp
dali-toolkit/public-api/visuals/text-visual-properties.h
dali-toolkit/styles/1920x1080/dali-toolkit-default-theme.json
dali-toolkit/styles/480x800/dali-toolkit-default-theme.json
dali-toolkit/styles/720x1280/dali-toolkit-default-theme.json
packaging/dali-addon.spec
packaging/dali-csharp-wrapper.spec
packaging/dali-toolkit.spec
plugins/dali-swig/SWIG/dali-toolkit.i
plugins/dali-swig/SWIG/dali.i

index a100a1f..a71f953 100644 (file)
@@ -74,14 +74,14 @@ DummyControlImpl::~DummyControlImpl()
 {
 }
 
-void DummyControlImpl::RegisterVisual( Property::Index index, Actor placementActor, Toolkit::Visual::Base visual )
+void DummyControlImpl::RegisterVisual( Property::Index index, Toolkit::Visual::Base visual )
 {
-  Control::RegisterVisual( index, placementActor, visual );
+  Control::RegisterVisual( index, visual );
 }
 
-void DummyControlImpl::RegisterVisual( Property::Index index, Actor placementActor, Toolkit::Visual::Base visual, bool enabled )
+void DummyControlImpl::RegisterVisual( Property::Index index, Toolkit::Visual::Base visual, bool enabled )
 {
-  Control::RegisterVisual( index, placementActor, visual, enabled );
+  Control::RegisterVisual( index, visual, enabled );
 }
 
 void DummyControlImpl::UnregisterVisual( Property::Index index )
@@ -104,11 +104,6 @@ bool DummyControlImpl::IsVisualEnabled( Property::Index index )
   return Control::IsVisualEnabled( index );
 }
 
-Actor DummyControlImpl::GetPlacementActor( Property::Index index )
-{
-  return Control::GetPlacementActor( index );
-}
-
 Animation DummyControlImpl::CreateTransition( const Toolkit::TransitionData& transition )
 {
   return Control::CreateTransition( transition );
index d63b853..2351839 100644 (file)
@@ -71,14 +71,13 @@ 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 RegisterVisual( Property::Index index, Actor placementActor, Toolkit::Visual::Base visual, bool enabled );
+  void RegisterVisual( Property::Index index, Toolkit::Visual::Base visual);
+  void RegisterVisual( Property::Index index, Toolkit::Visual::Base visual, bool enabled );
   void UnregisterVisual( Property::Index index );
   void EnableVisual( Property::Index index, bool enabled );
   bool IsVisualEnabled( Property::Index index );
 
   Toolkit::Visual::Base GetVisual( Property::Index index );
-  Actor GetPlacementActor( Property::Index index );
   Animation CreateTransition( const Toolkit::TransitionData& transition );
 
   // Used to test signal connections
index b4f20a2..c17872b 100644 (file)
@@ -30,7 +30,7 @@ const char* DEFAULT_THEME=
   "{\"styles\":{\n"
   "  \"textlabel\":\n"
   "    {\n"
-  "      \"fontStyle\":\"Regular\",\n"
+  "      \"fontStyle\":{\"weight\":\"normal\"},\n"
   "      \"pointSize\":18\n"
   "    }\n"
   "  }\n"
index 6fe4af6..2ed0c4c 100644 (file)
@@ -954,10 +954,8 @@ int UtcDaliControlImplRegisterThenReRegisterVisual(void)
   DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
 
   Property::Index index =1;
-  Actor placementActor = Actor::New();
 
   DALI_TEST_CHECK( !dummyImpl.GetVisual( index )  );
-  DALI_TEST_CHECK( !dummyImpl.GetPlacementActor( index ) );
 
   Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
   Toolkit::Visual::Base visual;
@@ -970,10 +968,9 @@ int UtcDaliControlImplRegisterThenReRegisterVisual(void)
   DALI_TEST_CHECK(visual);
 
   // Register index with a color visual
-  dummyImpl.RegisterVisual( index, placementActor, visual );
+  dummyImpl.RegisterVisual( index, visual );
 
   DALI_TEST_CHECK( dummyImpl.GetVisual( index ) == visual );
-  DALI_TEST_CHECK( dummyImpl.GetPlacementActor( index ) == placementActor );
 
   Property::Map newMap;
   newMap[Visual::Property::TYPE] = Visual::COLOR;
@@ -983,10 +980,9 @@ int UtcDaliControlImplRegisterThenReRegisterVisual(void)
   DALI_TEST_CHECK(visual);
 
   // ReRegister with altered color visual
-  dummyImpl.RegisterVisual( index, placementActor, visual );
+  dummyImpl.RegisterVisual( index, visual );
 
   DALI_TEST_CHECK( dummyImpl.GetVisual( index ) == visual );
-  DALI_TEST_CHECK( dummyImpl.GetPlacementActor( index ) == placementActor );
 
   tet_result(TET_PASS);
 
@@ -1001,7 +997,6 @@ int UtcDaliControlImplRegisterVisaulThenReRegisterToSelf(void)
   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;
@@ -1014,16 +1009,14 @@ int UtcDaliControlImplRegisterVisaulThenReRegisterToSelf(void)
   DALI_TEST_CHECK(visual);
 
   // Register index with a color visual
-  dummyImpl.RegisterVisual( index, placementActor, visual );
+  dummyImpl.RegisterVisual( index, visual );
 
   DALI_TEST_CHECK( dummyImpl.GetVisual( index ) == visual );
-  DALI_TEST_CHECK( dummyImpl.GetPlacementActor( index ) == placementActor );
 
   // ReRegister to self
-  dummyImpl.RegisterVisual( index, dummy, visual );
+  dummyImpl.RegisterVisual( index, visual );
 
   DALI_TEST_CHECK( dummyImpl.GetVisual( index ) == visual );
-  DALI_TEST_CHECK( dummyImpl.GetPlacementActor( index ) == dummy );
 
   END_TEST;
 }
@@ -1040,7 +1033,6 @@ int UtcDaliControlImplRegisterVisualToSelf(void)
     objectDestructionTracker.Start( dummy );
 
     Property::Index index = 1;
-    Actor placementActor = Actor::New();
 
     Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
     Toolkit::Visual::Base visual;
@@ -1053,11 +1045,10 @@ int UtcDaliControlImplRegisterVisualToSelf(void)
     DALI_TEST_CHECK(visual);
 
     // Register to self
-    dummyImpl.RegisterVisual( index, dummy, visual );
+    dummyImpl.RegisterVisual( index, visual );
 
     DALI_TEST_EQUALS( objectDestructionTracker.IsDestroyed(), false, TEST_LOCATION ); // Control not destroyed yet
     DALI_TEST_CHECK( dummyImpl.GetVisual( index ) == visual );
-    DALI_TEST_CHECK( dummyImpl.GetPlacementActor( index ) == dummy );
   }
 
   DALI_TEST_EQUALS( objectDestructionTracker.IsDestroyed(), true, TEST_LOCATION ); // Should be destroyed
@@ -1073,10 +1064,7 @@ int UtcDaliControlImplRegisterTwoVisuals(void)
   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;
@@ -1090,7 +1078,7 @@ int UtcDaliControlImplRegisterTwoVisuals(void)
   DALI_TEST_CHECK(visual);
 
   // Register index with a color visual
-  dummyImpl.RegisterVisual( index, placementActor, visual );
+  dummyImpl.RegisterVisual( index, visual );
 
   Property::Map newMap;
   newMap[Visual::Property::TYPE] = Visual::COLOR;
@@ -1100,13 +1088,10 @@ int UtcDaliControlImplRegisterTwoVisuals(void)
   DALI_TEST_CHECK( secondVisual );
 
   // ReRegister with altered color visual
-  dummyImpl.RegisterVisual( index2, secondPlacementActor, secondVisual );
+  dummyImpl.RegisterVisual( index2, secondVisual );
 
   DALI_TEST_CHECK( dummyImpl.GetVisual( index ) == visual );
-  DALI_TEST_CHECK( dummyImpl.GetPlacementActor( index ) == placementActor );
-
   DALI_TEST_CHECK( dummyImpl.GetVisual( index2 ) == secondVisual );
-  DALI_TEST_CHECK( dummyImpl.GetPlacementActor( index2 ) == secondPlacementActor );
 
   END_TEST;
 }
@@ -1119,7 +1104,6 @@ int UtcDaliControlImplRegisterUnregisterVisual(void)
   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;
@@ -1132,16 +1116,14 @@ int UtcDaliControlImplRegisterUnregisterVisual(void)
   DALI_TEST_CHECK(visual);
 
   // Register index with a color visual
-  dummyImpl.RegisterVisual( index, placementActor, visual );
+  dummyImpl.RegisterVisual( index, visual );
 
   DALI_TEST_CHECK( dummyImpl.GetVisual( index ) == visual );
-  DALI_TEST_CHECK( dummyImpl.GetPlacementActor( index ) == placementActor );
 
   // Unregister visual
   dummyImpl.UnregisterVisual( index );
 
   DALI_TEST_CHECK( !dummyImpl.GetVisual( index ) );
-  DALI_TEST_CHECK( !dummyImpl.GetPlacementActor( index ) );
 
   END_TEST;
 }
@@ -1166,7 +1148,7 @@ int UtcDaliControlImplRegisterDisabledVisual(void)
   DALI_TEST_CHECK(visual);
 
   // Register index with a color visual
-  dummyImpl.RegisterVisual( TEST_PROPERTY, dummy, visual, false );
+  dummyImpl.RegisterVisual( TEST_PROPERTY, visual, false );
 
   DALI_TEST_CHECK( dummyImpl.GetVisual( TEST_PROPERTY ) == visual );
   DALI_TEST_CHECK( dummyImpl.IsVisualEnabled( TEST_PROPERTY ) == false );
@@ -1208,7 +1190,7 @@ int UtcDaliControlImplDisableRegisteredVisual(void)
   DALI_TEST_CHECK(visual);
 
   // Register index with a color visual
-  dummyImpl.RegisterVisual( TEST_PROPERTY, dummy, visual );
+  dummyImpl.RegisterVisual( TEST_PROPERTY, visual );
 
   Stage::GetCurrent().Add(dummy);
 
@@ -1250,7 +1232,7 @@ int UtcDaliControlImplEnabledVisualParentRemovedFromStage(void)
   DALI_TEST_CHECK(visual);
 
   // Register index with a color visual
-  dummyImpl.RegisterVisual( TEST_PROPERTY, dummy, visual, false );
+  dummyImpl.RegisterVisual( TEST_PROPERTY, visual, false );
 
   Stage::GetCurrent().Add(dummy);
   // Render and notify
@@ -1318,9 +1300,9 @@ int UtcDaliControlImplRegisterTwoVisualsAndEnableOnlyOne(void)
   DALI_TEST_CHECK(visual2);
 
   // Register index with a color visual
-  dummyImpl.RegisterVisual( TEST_PROPERTY1, dummy, visual1 );
+  dummyImpl.RegisterVisual( TEST_PROPERTY1, visual1 );
   // Register second index with a color visual
-  dummyImpl.RegisterVisual( TEST_PROPERTY2, dummy, visual2 );
+  dummyImpl.RegisterVisual( TEST_PROPERTY2, visual2 );
 
   Stage::GetCurrent().Add(dummy);
   // Render and notify
index ab4551f..85ba766 100644 (file)
@@ -21,7 +21,6 @@
 #include <sstream>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali/integration-api/events/pan-gesture-event.h>
-#include <dali/public-api/images/buffer-image.h>
 #include <dali-toolkit/devel-api/controls/page-turn-view/page-factory.h>
 #include <dali-toolkit/devel-api/controls/page-turn-view/page-turn-landscape-view.h>
 #include <dali-toolkit/devel-api/controls/page-turn-view/page-turn-portrait-view.h>
@@ -35,9 +34,6 @@ namespace
 const int RENDER_FRAME_INTERVAL = 16;                           ///< Duration of each frame in ms. (at approx 60FPS)
 const unsigned int TOTAL_PAGE_NUMBER = 20;
 const Vector2 PAGE_SIZE( 300.f,400.f );
-const unsigned int IMAGE_WIDTH = 30;
-const unsigned int IMAGE_HEIGHT = 30;
-const Vector2 IMAGE_SIZE( static_cast<float>( IMAGE_WIDTH ), static_cast<float>(IMAGE_HEIGHT) );
 const Vector2 SPINE_SHADOW_PARAMETER( 60.0f, 30.0f );
 
 static bool gObjectCreatedCallBackCalled;
@@ -189,8 +185,9 @@ class TestPageFactory : public PageFactory
 {
 public:
 
-  TestPageFactory(ToolkitTestApplication& application)
-  : mApplication( application )
+  TestPageFactory(ToolkitTestApplication& application, bool returnValidTexture = true )
+  : mApplication( application ),
+    mValidTexture( returnValidTexture )
   {
     mTotalPageNumber = TOTAL_PAGE_NUMBER;
   }
@@ -205,18 +202,23 @@ public:
   }
 
   /**
-   * Create an image to represent a page content.
+   * Create an texture to represent a page content.
    * @param[in] pageId The ID of the page to create.
    * @return An image, or an empty handle if the ID is out of range.
    */
-  virtual Image NewPage( unsigned int pageId )
+  virtual Texture NewPage( unsigned int pageId )
   {
-    return BufferImage::WHITE();
+    if( mValidTexture )
+    {
+      return Texture::New( Dali::TextureType::TEXTURE_2D, Pixel::RGB888, 100, 100 );
+    }
+    return Texture(); // empty handle
   }
 
 private:
   ToolkitTestApplication& mApplication;
   unsigned int            mTotalPageNumber;
+  bool                    mValidTexture;
 };
 
 }// namespace
@@ -689,3 +691,34 @@ int UtcDaliPageImageFactoryGetExtention(void)
   DALI_TEST_CHECK( factory.GetExtension() == NULL );
   END_TEST;
 }
+
+int UtcDaliPageTurnEmptyTextureHandle(void)
+{
+  ToolkitTestApplication application;
+
+  tet_infoline(" UtcDaliPageTurnEmptyTextureHandle ");
+
+  application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
+
+  TestPageFactory factory(application, false); // returns empty handles
+  Vector2 size = Stage::GetCurrent().GetSize();
+  try
+  {
+    PageTurnView portraitView = PageTurnPortraitView::New( factory, size );
+    portraitView.SetParentOrigin( ParentOrigin::CENTER );
+    Stage::GetCurrent().Add( portraitView );
+
+    tet_result(TET_FAIL);
+  }
+  catch (DaliException& e)
+  {
+    DALI_TEST_ASSERT(e, "must pass in valid texture", TEST_LOCATION );
+  }
+  catch (...)
+  {
+    tet_result(TET_FAIL);
+  }
+
+  END_TEST;
+}
+
index b6b638c..022695d 100644 (file)
@@ -163,6 +163,34 @@ Integration::KeyEvent GenerateKey( const std::string& keyName,
                                 keyState );
 }
 
+bool DaliTestCheckMaps( const Property::Map& fontStyleMapGet, const Property::Map& fontStyleMapSet )
+{
+  if( fontStyleMapGet.Count() == fontStyleMapSet.Count() )
+  {
+    for( unsigned int index = 0u; index < fontStyleMapGet.Count(); ++index )
+    {
+      const KeyValuePair& valueGet = fontStyleMapGet.GetKeyValue( index );
+
+      Property::Value* valueSet = fontStyleMapSet.Find( valueGet.first.stringKey );
+      if( NULL != valueSet )
+      {
+        if( valueGet.second.Get<std::string>() != valueSet->Get<std::string>() )
+        {
+          tet_printf( "  Value got : [%s], expected : [%s]", valueGet.second.Get<std::string>().c_str(), valueSet->Get<std::string>().c_str() );
+          return false;
+        }
+      }
+      else
+      {
+        tet_printf( "  The key %s doesn't exist.", valueGet.first.stringKey.c_str() );
+        return false;
+      }
+    }
+  }
+
+  return true;
+}
+
 } // namespace
 
 int UtcDaliToolkitTextEditorConstructorP(void)
@@ -344,18 +372,55 @@ int UtcDaliTextEditorSetPropertyP(void)
   // Check font properties.
   editor.SetProperty( TextEditor::Property::FONT_FAMILY, "Setting font family" );
   DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::FONT_FAMILY ), std::string("Setting font family"), TEST_LOCATION );
-  editor.SetProperty( TextEditor::Property::FONT_STYLE, "{\"weight\":\"bold\",\"width\":\"condensed\",\"slant\":\"italic\"}" );
-  DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::FONT_STYLE ), std::string("{\"weight\":\"bold\",\"width\":\"condensed\",\"slant\":\"italic\"}"), TEST_LOCATION );
+
+  Property::Map fontStyleMapSet;
+  Property::Map fontStyleMapGet;
+  Property::Value* slantValue = NULL;
+
+  fontStyleMapSet.Insert( "weight", "bold" );
+  fontStyleMapSet.Insert( "width", "condensed" );
+  fontStyleMapSet.Insert( "slant", "italic" );
+
+  editor.SetProperty( TextEditor::Property::FONT_STYLE, fontStyleMapSet );
+  fontStyleMapGet = editor.GetProperty<Property::Map>( TextEditor::Property::FONT_STYLE );
+  DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
+
   editor.SetProperty( TextEditor::Property::POINT_SIZE, 10.f );
   DALI_TEST_EQUALS( editor.GetProperty<float>( TextEditor::Property::POINT_SIZE ), 10.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
 
   // Reset font style.
-  editor.SetProperty( TextEditor::Property::FONT_STYLE, "{\"weight\":\"normal\",\"slant\":\"oblique\"}" );
-  DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::FONT_STYLE ), std::string("{\"weight\":\"normal\",\"slant\":\"oblique\"}"), TEST_LOCATION );
-  editor.SetProperty( TextEditor::Property::FONT_STYLE, "{\"slant\":\"roman\"}" );
-  DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::FONT_STYLE ), std::string("{\"slant\":\"normal\"}"), TEST_LOCATION );
-  editor.SetProperty( TextEditor::Property::FONT_STYLE, "" );
-  DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::FONT_STYLE ), std::string(""), TEST_LOCATION );
+  fontStyleMapSet.Clear();
+  fontStyleMapSet.Insert( "weight", "normal" );
+  fontStyleMapSet.Insert( "slant", "oblique" );
+  editor.SetProperty( TextEditor::Property::FONT_STYLE, fontStyleMapSet );
+  fontStyleMapGet = editor.GetProperty<Property::Map>( TextEditor::Property::FONT_STYLE );
+  DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
+
+  fontStyleMapSet.Clear();
+  fontStyleMapSet.Insert( "slant", "roman" );
+  editor.SetProperty( TextEditor::Property::FONT_STYLE, fontStyleMapSet );
+  fontStyleMapGet = editor.GetProperty<Property::Map>( TextEditor::Property::FONT_STYLE );
+
+  // Replace 'roman' for 'normal'.
+  slantValue = fontStyleMapGet.Find( "slant" );
+  if( NULL != slantValue )
+  {
+    if( "normal" == slantValue->Get<std::string>() )
+    {
+      fontStyleMapGet["slant"] = "roman";
+    }
+  }
+  DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
+
+  fontStyleMapSet.Clear();
+
+  editor.SetProperty( TextEditor::Property::FONT_STYLE, fontStyleMapSet );
+  fontStyleMapGet = editor.GetProperty<Property::Map>( TextEditor::Property::FONT_STYLE );
+  DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
 
   // Check that the Alignment properties can be correctly set
   editor.SetProperty( TextEditor::Property::HORIZONTAL_ALIGNMENT, "END" );
@@ -417,18 +482,54 @@ int UtcDaliTextEditorSetPropertyP(void)
   // Check input font properties.
   editor.SetProperty( TextEditor::Property::INPUT_FONT_FAMILY, "Setting input font family" );
   DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::INPUT_FONT_FAMILY ), "Setting input font family", TEST_LOCATION );
-  editor.SetProperty( TextEditor::Property::INPUT_FONT_STYLE, "{\"weight\":\"bold\",\"width\":\"condensed\",\"slant\":\"italic\"}" );
-  DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::INPUT_FONT_STYLE ), "{\"weight\":\"bold\",\"width\":\"condensed\",\"slant\":\"italic\"}", TEST_LOCATION );
+
+  fontStyleMapSet.Clear();
+  fontStyleMapSet.Insert( "weight", "bold" );
+  fontStyleMapSet.Insert( "width", "condensed" );
+  fontStyleMapSet.Insert( "slant", "italic" );
+
+  editor.SetProperty( TextEditor::Property::INPUT_FONT_STYLE, fontStyleMapSet );
+  fontStyleMapGet = editor.GetProperty<Property::Map>( TextEditor::Property::INPUT_FONT_STYLE );
+  DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
+
   editor.SetProperty( TextEditor::Property::INPUT_POINT_SIZE, 12.f );
   DALI_TEST_EQUALS( editor.GetProperty<float>( TextEditor::Property::INPUT_POINT_SIZE ), 12.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
 
   // Reset input font style.
-  editor.SetProperty( TextEditor::Property::INPUT_FONT_STYLE, "{\"weight\":\"normal\",\"slant\":\"oblique\"}" );
-  DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::INPUT_FONT_STYLE ), std::string("{\"weight\":\"normal\",\"slant\":\"oblique\"}"), TEST_LOCATION );
-  editor.SetProperty( TextEditor::Property::INPUT_FONT_STYLE, "{\"slant\":\"roman\"}" );
-  DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::INPUT_FONT_STYLE ), std::string("{\"slant\":\"normal\"}"), TEST_LOCATION );
-  editor.SetProperty( TextEditor::Property::INPUT_FONT_STYLE, "" );
-  DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::INPUT_FONT_STYLE ), std::string(""), TEST_LOCATION );
+  fontStyleMapSet.Clear();
+  fontStyleMapSet.Insert( "weight", "normal" );
+  fontStyleMapSet.Insert( "slant", "oblique" );
+
+  editor.SetProperty( TextEditor::Property::INPUT_FONT_STYLE, fontStyleMapSet );
+  fontStyleMapGet = editor.GetProperty<Property::Map>( TextEditor::Property::INPUT_FONT_STYLE );
+  DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
+
+  fontStyleMapSet.Clear();
+  fontStyleMapSet.Insert( "slant", "roman" );
+
+  editor.SetProperty( TextEditor::Property::INPUT_FONT_STYLE, fontStyleMapSet );
+  fontStyleMapGet = editor.GetProperty<Property::Map>( TextEditor::Property::INPUT_FONT_STYLE );
+
+  // Replace 'roman' for 'normal'.
+  slantValue = fontStyleMapGet.Find( "slant" );
+  if( NULL != slantValue )
+  {
+    if( "normal" == slantValue->Get<std::string>() )
+    {
+      fontStyleMapGet["slant"] = "roman";
+    }
+  }
+  DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
+
+  fontStyleMapSet.Clear();
+
+  editor.SetProperty( TextEditor::Property::INPUT_FONT_STYLE, fontStyleMapSet );
+  fontStyleMapGet = editor.GetProperty<Property::Map>( TextEditor::Property::INPUT_FONT_STYLE );
+  DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
 
   // Check the line spacing property
   DALI_TEST_EQUALS( editor.GetProperty<float>( TextEditor::Property::LINE_SPACING ), 0.0f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
@@ -441,16 +542,36 @@ int UtcDaliTextEditorSetPropertyP(void)
   DALI_TEST_EQUALS( editor.GetProperty<float>( TextEditor::Property::INPUT_LINE_SPACING ), 20.0f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
 
   // Check the underline property
-  editor.SetProperty( TextEditor::Property::UNDERLINE, "{\"enable\":\"true\",\"color\":\"red\",\"height\":\"1\"}" );
-  DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::UNDERLINE ), std::string("{\"enable\":\"true\",\"color\":\"red\",\"height\":\"1\"}"), TEST_LOCATION );
+
+  Property::Map underlineMapSet;
+  Property::Map underlineMapGet;
+
+  underlineMapSet.Insert( "enable", "true" );
+  underlineMapSet.Insert( "color", "red" );
+  underlineMapSet.Insert( "height", "1" );
+
+  editor.SetProperty( TextEditor::Property::UNDERLINE, underlineMapSet );
+
+  underlineMapGet = editor.GetProperty<Property::Map>( TextEditor::Property::UNDERLINE );
+  DALI_TEST_EQUALS( underlineMapGet.Count(), underlineMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( underlineMapGet, underlineMapSet ), true, TEST_LOCATION );
 
   // Check the input underline property
   editor.SetProperty( TextEditor::Property::INPUT_UNDERLINE, "Underline input properties" );
   DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::INPUT_UNDERLINE ), std::string("Underline input properties"), TEST_LOCATION );
 
   // Check the shadow property
-  editor.SetProperty( TextEditor::Property::SHADOW, "{\"color\":\"green\",\"offset\":\"2 2\"}" );
-  DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::SHADOW ), std::string("{\"color\":\"green\",\"offset\":\"2 2\"}"), TEST_LOCATION );
+  Property::Map shadowMapSet;
+  Property::Map shadowMapGet;
+
+  shadowMapSet.Insert( "color", "green" );
+  shadowMapSet.Insert( "offset", "2 2" );
+
+  editor.SetProperty( TextEditor::Property::SHADOW, shadowMapSet );
+
+  shadowMapGet = editor.GetProperty<Property::Map>( TextEditor::Property::SHADOW );
+  DALI_TEST_EQUALS( shadowMapGet.Count(), shadowMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( shadowMapGet, shadowMapSet ), true, TEST_LOCATION );
 
   // Check the input shadow property
   editor.SetProperty( TextEditor::Property::INPUT_SHADOW, "Shadow input properties" );
@@ -681,8 +802,14 @@ int utcDaliTextEditorInputStyleChanged01(void)
     const Vector4 color = editor.GetProperty( TextEditor::Property::INPUT_COLOR ).Get<Vector4>();
     DALI_TEST_EQUALS( color, Color::BLACK, TEST_LOCATION );
 
-    const std::string style = editor.GetProperty( TextEditor::Property::INPUT_FONT_STYLE ).Get<std::string>();
-    DALI_TEST_EQUALS( style, "{\"weight\":\"bold\"}", TEST_LOCATION );
+    Property::Map fontStyleMapSet;
+    Property::Map fontStyleMapGet;
+
+    fontStyleMapSet.Insert( "weight", "bold" );
+
+    fontStyleMapGet = editor.GetProperty<Property::Map>( TextEditor::Property::INPUT_FONT_STYLE );
+    DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
+    DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
   }
   DALI_TEST_CHECK( inputStyleChangedSignal );
 
@@ -724,8 +851,12 @@ int utcDaliTextEditorInputStyleChanged01(void)
   {
     DALI_TEST_EQUALS( static_cast<unsigned int>( gInputStyleMask ), static_cast<unsigned int>( TextEditor::InputStyle::FONT_STYLE ), TEST_LOCATION );
 
-    const std::string style = editor.GetProperty( TextEditor::Property::INPUT_FONT_STYLE ).Get<std::string>();
-    DALI_TEST_CHECK( style.empty() );
+    Property::Map fontStyleMapSet;
+    Property::Map fontStyleMapGet;
+
+    fontStyleMapGet = editor.GetProperty<Property::Map>( TextEditor::Property::INPUT_FONT_STYLE );
+    DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
+    DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
   }
   DALI_TEST_CHECK( inputStyleChangedSignal );
 
@@ -909,7 +1040,12 @@ int utcDaliTextEditorInputStyleChanged02(void)
 
   editor.SetProperty( TextEditor::Property::INPUT_COLOR, Color::YELLOW );
 
-  editor.SetProperty( TextEditor::Property::INPUT_FONT_STYLE, "{\"weight\":\"thin\",\"width\":\"condensed\",\"slant\":\"italic\"}" );
+  Property::Map fontStyleMapSet;
+  fontStyleMapSet.Insert( "weight", "thin" );
+  fontStyleMapSet.Insert( "width", "condensed" );
+  fontStyleMapSet.Insert( "slant", "italic" );
+
+  editor.SetProperty( TextEditor::Property::INPUT_FONT_STYLE, fontStyleMapSet );
   editor.SetProperty( TextEditor::Property::INPUT_POINT_SIZE, 20.f );
   editor.SetProperty( TextEditor::Property::INPUT_LINE_SPACING, 5.f );
 
@@ -965,7 +1101,13 @@ int utcDaliTextEditorInputStyleChanged02(void)
   inputStyleChangedSignal = false;
 
   editor.SetProperty( TextEditor::Property::FONT_FAMILY, "DejaVuSerif" );
-  editor.SetProperty( TextEditor::Property::FONT_STYLE, "{\"weight\":\"black\",\"width\":\"expanded\",\"slant\":\"oblique\"}" );
+
+  fontStyleMapSet.Clear();
+  fontStyleMapSet.Insert( "weight", "black" );
+  fontStyleMapSet.Insert( "width", "expanded" );
+  fontStyleMapSet.Insert( "slant", "oblique" );
+
+  editor.SetProperty( TextEditor::Property::FONT_STYLE, fontStyleMapSet );
 
   // Create a tap event to touch the text editor.
   application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 30.f, 25.f ) ) );
index 80ed1d7..7dffc69 100644 (file)
@@ -282,7 +282,6 @@ Integration::TapGestureEvent GenerateTap(
   return tap;
 }
 
-
 Integration::LongPressGestureEvent GenerateLongPress(
     Gesture::State state,
     unsigned int numberOfTouches,
@@ -311,6 +310,34 @@ Integration::KeyEvent GenerateKey( const std::string& keyName,
                                 keyState );
 }
 
+bool DaliTestCheckMaps( const Property::Map& fontStyleMapGet, const Property::Map& fontStyleMapSet )
+{
+  if( fontStyleMapGet.Count() == fontStyleMapSet.Count() )
+  {
+    for( unsigned int index = 0u; index < fontStyleMapGet.Count(); ++index )
+    {
+      const KeyValuePair& valueGet = fontStyleMapGet.GetKeyValue( index );
+
+      Property::Value* valueSet = fontStyleMapSet.Find( valueGet.first.stringKey );
+      if( NULL != valueSet )
+      {
+        if( valueGet.second.Get<std::string>() != valueSet->Get<std::string>() )
+        {
+          tet_printf( "  Value got : [%s], expected : [%s]", valueGet.second.Get<std::string>().c_str(), valueSet->Get<std::string>().c_str() );
+          return false;
+        }
+      }
+      else
+      {
+        tet_printf( "  The key %s doesn't exist.", valueGet.first.stringKey.c_str() );
+        return false;
+      }
+    }
+  }
+
+  return true;
+}
+
 } // namespace
 
 int UtcDaliToolkitTextFieldConstructorP(void)
@@ -501,18 +528,56 @@ int UtcDaliTextFieldSetPropertyP(void)
   // Check font properties.
   field.SetProperty( TextField::Property::FONT_FAMILY, "Setting font family" );
   DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::FONT_FAMILY ), std::string("Setting font family"), TEST_LOCATION );
-  field.SetProperty( TextField::Property::FONT_STYLE, "{\"weight\":\"bold\",\"width\":\"condensed\",\"slant\":\"italic\"}" );
-  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::FONT_STYLE ), std::string("{\"weight\":\"bold\",\"width\":\"condensed\",\"slant\":\"italic\"}"), TEST_LOCATION );
+
+  Property::Map fontStyleMapSet;
+  Property::Map fontStyleMapGet;
+  Property::Value* slantValue = NULL;
+
+  fontStyleMapSet.Insert( "weight", "bold" );
+  fontStyleMapSet.Insert( "width", "condensed" );
+  fontStyleMapSet.Insert( "slant", "italic" );
+  field.SetProperty( TextField::Property::FONT_STYLE, fontStyleMapSet );
+
+  fontStyleMapGet = field.GetProperty<Property::Map>( TextField::Property::FONT_STYLE );
+  DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
+
   field.SetProperty( TextField::Property::POINT_SIZE, 10.f );
   DALI_TEST_EQUALS( field.GetProperty<float>( TextField::Property::POINT_SIZE ), 10.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
 
   // Reset font style.
-  field.SetProperty( TextField::Property::FONT_STYLE, "{\"weight\":\"normal\",\"slant\":\"oblique\"}" );
-  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::FONT_STYLE ), std::string("{\"weight\":\"normal\",\"slant\":\"oblique\"}"), TEST_LOCATION );
-  field.SetProperty( TextField::Property::FONT_STYLE, "{\"slant\":\"roman\"}" );
-  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::FONT_STYLE ), std::string("{\"slant\":\"normal\"}"), TEST_LOCATION );
-  field.SetProperty( TextField::Property::FONT_STYLE, "" );
-  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::FONT_STYLE ), std::string(""), TEST_LOCATION );
+  fontStyleMapSet.Clear();
+  fontStyleMapSet.Insert( "weight", "normal" );
+  fontStyleMapSet.Insert( "slant", "oblique" );
+  field.SetProperty( TextField::Property::FONT_STYLE, fontStyleMapSet );
+
+  fontStyleMapGet = field.GetProperty<Property::Map>( TextField::Property::FONT_STYLE );
+  DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
+
+  fontStyleMapSet.Clear();
+  fontStyleMapSet.Insert( "slant", "roman" );
+  field.SetProperty( TextField::Property::FONT_STYLE, fontStyleMapSet );
+  fontStyleMapGet = field.GetProperty<Property::Map>( TextField::Property::FONT_STYLE );
+
+  // Replace 'roman' for 'normal'.
+  slantValue = fontStyleMapGet.Find( "slant" );
+  if( NULL != slantValue )
+  {
+    if( "normal" == slantValue->Get<std::string>() )
+    {
+      fontStyleMapGet["slant"] = "roman";
+    }
+  }
+  DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
+
+  fontStyleMapSet.Clear();
+
+  field.SetProperty( TextField::Property::FONT_STYLE, fontStyleMapSet );
+  fontStyleMapGet = field.GetProperty<Property::Map>( TextField::Property::FONT_STYLE );
+  DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
 
   // Check that the MAX_LENGTH property can be correctly set
   const int maxNumberOfCharacters = 20;
@@ -598,30 +663,85 @@ int UtcDaliTextFieldSetPropertyP(void)
   // Check input font properties.
   field.SetProperty( TextField::Property::INPUT_FONT_FAMILY, "Setting input font family" );
   DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::INPUT_FONT_FAMILY ), "Setting input font family", TEST_LOCATION );
-  field.SetProperty( TextField::Property::INPUT_FONT_STYLE, "{\"weight\":\"bold\",\"width\":\"condensed\",\"slant\":\"italic\"}" );
-  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::INPUT_FONT_STYLE ), "{\"weight\":\"bold\",\"width\":\"condensed\",\"slant\":\"italic\"}", TEST_LOCATION );
+
+  fontStyleMapSet.Clear();
+  fontStyleMapSet.Insert( "weight", "bold" );
+  fontStyleMapSet.Insert( "width", "condensed" );
+  fontStyleMapSet.Insert( "slant", "italic" );
+
+  field.SetProperty( TextField::Property::INPUT_FONT_STYLE, fontStyleMapSet );
+  fontStyleMapGet = field.GetProperty<Property::Map>( TextField::Property::INPUT_FONT_STYLE );
+  DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
+
   field.SetProperty( TextField::Property::INPUT_POINT_SIZE, 12.f );
   DALI_TEST_EQUALS( field.GetProperty<float>( TextField::Property::INPUT_POINT_SIZE ), 12.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
 
   // Reset input font style.
-  field.SetProperty( TextField::Property::INPUT_FONT_STYLE, "{\"weight\":\"normal\",\"slant\":\"oblique\"}" );
-  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::INPUT_FONT_STYLE ), std::string("{\"weight\":\"normal\",\"slant\":\"oblique\"}"), TEST_LOCATION );
-  field.SetProperty( TextField::Property::INPUT_FONT_STYLE, "{\"slant\":\"roman\"}" );
-  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::INPUT_FONT_STYLE ), std::string("{\"slant\":\"normal\"}"), TEST_LOCATION );
-  field.SetProperty( TextField::Property::INPUT_FONT_STYLE, "" );
-  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::INPUT_FONT_STYLE ), std::string(""), TEST_LOCATION );
+  fontStyleMapSet.Clear();
+  fontStyleMapSet.Insert( "weight", "normal" );
+  fontStyleMapSet.Insert( "slant", "oblique" );
+
+  field.SetProperty( TextField::Property::INPUT_FONT_STYLE, fontStyleMapSet );
+  fontStyleMapGet = field.GetProperty<Property::Map>( TextField::Property::INPUT_FONT_STYLE );
+  DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
+
+  fontStyleMapSet.Clear();
+  fontStyleMapSet.Insert( "slant", "roman" );
+
+  field.SetProperty( TextField::Property::INPUT_FONT_STYLE, fontStyleMapSet );
+  fontStyleMapGet = field.GetProperty<Property::Map>( TextField::Property::INPUT_FONT_STYLE );
+
+  // Replace 'roman' for 'normal'.
+  slantValue = fontStyleMapGet.Find( "slant" );
+  if( NULL != slantValue )
+  {
+    if( "normal" == slantValue->Get<std::string>() )
+    {
+      fontStyleMapGet["slant"] = "roman";
+    }
+  }
+  DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
+
+  fontStyleMapSet.Clear();
+
+  field.SetProperty( TextField::Property::INPUT_FONT_STYLE, fontStyleMapSet );
+  fontStyleMapGet = field.GetProperty<Property::Map>( TextField::Property::INPUT_FONT_STYLE );
+  DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
+
+  Property::Map underlineMapSet;
+  Property::Map underlineMapGet;
+
+  underlineMapSet.Insert( "enable", "true" );
+  underlineMapSet.Insert( "color", "red" );
+  underlineMapSet.Insert( "height", "1" );
 
   // Check the underline property
-  field.SetProperty( TextField::Property::UNDERLINE, "{\"enable\":\"true\",\"color\":\"red\",\"height\":\"1\"}" );
-  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::UNDERLINE ), std::string("{\"enable\":\"true\",\"color\":\"red\",\"height\":\"1\"}"), TEST_LOCATION );
+  field.SetProperty( TextField::Property::UNDERLINE, underlineMapSet );
+
+  underlineMapGet = field.GetProperty<Property::Map>( TextField::Property::UNDERLINE );
+  DALI_TEST_EQUALS( underlineMapGet.Count(), underlineMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( underlineMapGet, underlineMapSet ), true, TEST_LOCATION );
 
   // Check the input underline property
   field.SetProperty( TextField::Property::INPUT_UNDERLINE, "Underline input properties" );
   DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::INPUT_UNDERLINE ), std::string("Underline input properties"), TEST_LOCATION );
 
   // Check the shadow property
-  field.SetProperty( TextField::Property::SHADOW, "{\"color\":\"green\",\"offset\":\"2 2\"}" );
-  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::SHADOW ), std::string("{\"color\":\"green\",\"offset\":\"2 2\"}"), TEST_LOCATION );
+  Property::Map shadowMapSet;
+  Property::Map shadowMapGet;
+
+  shadowMapSet.Insert( "color", "green" );
+  shadowMapSet.Insert( "offset", "2 2" );
+
+  field.SetProperty( TextField::Property::SHADOW, shadowMapSet );
+
+  shadowMapGet = field.GetProperty<Property::Map>( TextField::Property::SHADOW );
+  DALI_TEST_EQUALS( shadowMapGet.Count(), shadowMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( shadowMapGet, shadowMapSet ), true, TEST_LOCATION );
 
   // Check the input shadow property
   field.SetProperty( TextField::Property::INPUT_SHADOW, "Shadow input properties" );
@@ -940,8 +1060,13 @@ int utcDaliTextFieldInputStyleChanged01(void)
     const Vector4 color = field.GetProperty( TextField::Property::INPUT_COLOR ).Get<Vector4>();
     DALI_TEST_EQUALS( color, Color::BLACK, TEST_LOCATION );
 
-    const std::string style = field.GetProperty( TextField::Property::INPUT_FONT_STYLE ).Get<std::string>();
-    DALI_TEST_EQUALS( style, "{\"weight\":\"bold\"}", TEST_LOCATION );
+    const Property::Map fontStyleMapGet = field.GetProperty( TextField::Property::INPUT_FONT_STYLE ).Get<Property::Map>();
+
+    Property::Map fontStyleMapSet;
+    fontStyleMapSet.Insert( "weight", "bold" );
+
+    DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
+    DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
   }
   DALI_TEST_CHECK( inputStyleChangedSignal );
 
@@ -1168,7 +1293,12 @@ int utcDaliTextFieldInputStyleChanged02(void)
 
   field.SetProperty( TextField::Property::INPUT_COLOR, Color::YELLOW );
 
-  field.SetProperty( TextField::Property::INPUT_FONT_STYLE, "{\"weight\":\"thin\",\"width\":\"condensed\",\"slant\":\"italic\"}" );
+  Property::Map fontStyleMapSet;
+  fontStyleMapSet.Insert( "weight", "thin" );
+  fontStyleMapSet.Insert( "width", "condensed" );
+  fontStyleMapSet.Insert( "slant", "italic" );
+
+  field.SetProperty( TextField::Property::INPUT_FONT_STYLE, fontStyleMapSet );
   field.SetProperty( TextField::Property::INPUT_POINT_SIZE, 20.f );
 
   field.SetProperty( TextField::Property::INPUT_UNDERLINE, "underline" );
@@ -1853,11 +1983,25 @@ int utcDaliTextFieldStyleWhilstSelected(void)
   field.SetProperty( TextField::Property::INPUT_FONT_FAMILY, "Setting input font family" );
   DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::INPUT_FONT_FAMILY ), "Setting input font family", TEST_LOCATION );
 
-  field.SetProperty( TextField::Property::INPUT_FONT_STYLE, "{\"weight\":\"bold\",\"slant\":\"italic\"}" );
-  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::INPUT_FONT_STYLE ), "{\"weight\":\"bold\",\"slant\":\"italic\"}", TEST_LOCATION );
+  Property::Map fontStyleMapSet;
+  Property::Map fontStyleMapGet;
+
+  fontStyleMapSet.Insert( "weight", "bold" );
+  fontStyleMapSet.Insert( "slant", "italic" );
+  field.SetProperty( TextField::Property::INPUT_FONT_STYLE, fontStyleMapSet );
+
+  fontStyleMapGet = field.GetProperty<Property::Map>( TextField::Property::INPUT_FONT_STYLE );
+  DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
 
-  field.SetProperty( TextField::Property::INPUT_FONT_STYLE, "{\"width\":\"expanded\",\"slant\":\"italic\"}" );
-  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::INPUT_FONT_STYLE ), "{\"width\":\"expanded\",\"slant\":\"italic\"}", TEST_LOCATION );
+  fontStyleMapSet.Clear();
+  fontStyleMapSet.Insert( "width", "expanded" );
+  fontStyleMapSet.Insert( "slant", "italic" );
+  field.SetProperty( TextField::Property::INPUT_FONT_STYLE, fontStyleMapSet );
+
+  fontStyleMapGet = field.GetProperty<Property::Map>( TextField::Property::INPUT_FONT_STYLE );
+  DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
 
   field.SetProperty( TextField::Property::INPUT_POINT_SIZE, 12.f );
   DALI_TEST_EQUALS( field.GetProperty<float>( TextField::Property::INPUT_POINT_SIZE ), 12.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
@@ -1865,11 +2009,24 @@ int utcDaliTextFieldStyleWhilstSelected(void)
   field.SetProperty( TextField::Property::TEXT_COLOR, Color::RED );
   DALI_TEST_EQUALS( field.GetProperty<Vector4>( TextField::Property::TEXT_COLOR ), Color::RED, TEST_LOCATION );
 
-  field.SetProperty( TextField::Property::FONT_STYLE, "{\"weight\":\"bold\",\"slant\":\"italic\"}" );
-  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::FONT_STYLE ), "{\"weight\":\"bold\",\"slant\":\"italic\"}", TEST_LOCATION );
+  fontStyleMapSet.Clear();
+  fontStyleMapSet.Insert( "weight", "bold" );
+  fontStyleMapSet.Insert( "slant", "italic" );
+
+  field.SetProperty( TextField::Property::FONT_STYLE, fontStyleMapSet );
+
+  fontStyleMapGet = field.GetProperty<Property::Map>( TextField::Property::FONT_STYLE );
+  DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
+
+  fontStyleMapSet.Clear();
+  fontStyleMapSet.Insert( "width", "expanded" );
+
+  field.SetProperty( TextField::Property::FONT_STYLE, fontStyleMapSet );
 
-  field.SetProperty( TextField::Property::FONT_STYLE, "{\"width\":\"expanded\"}" );
-  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::FONT_STYLE ), "{\"width\":\"expanded\"}", TEST_LOCATION );
+  fontStyleMapGet = field.GetProperty<Property::Map>( TextField::Property::FONT_STYLE );
+  DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
 
   END_TEST;
 }
index 0f0072e..1045ad4 100644 (file)
@@ -64,6 +64,34 @@ const char* const PROPERTY_NAME_OUTLINE = "outline";
 
 const int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND;
 
+bool DaliTestCheckMaps( const Property::Map& fontStyleMapGet, const Property::Map& fontStyleMapSet )
+{
+  if( fontStyleMapGet.Count() == fontStyleMapSet.Count() )
+  {
+    for( unsigned int index = 0u; index < fontStyleMapGet.Count(); ++index )
+    {
+      const KeyValuePair& valueGet = fontStyleMapGet.GetKeyValue( index );
+
+      Property::Value* valueSet = fontStyleMapSet.Find( valueGet.first.stringKey );
+      if( NULL != valueSet )
+      {
+        if( valueGet.second.Get<std::string>() != valueSet->Get<std::string>() )
+        {
+          tet_printf( "  Value got : [%s], expected : [%s]", valueGet.second.Get<std::string>().c_str(), valueSet->Get<std::string>().c_str() );
+          return false;
+        }
+      }
+      else
+      {
+        tet_printf( "  The key %s doesn't exist.", valueGet.first.stringKey.c_str() );
+        return false;
+      }
+    }
+  }
+
+  return true;
+}
+
 } // namespace
 
 int UtcDaliToolkitTextLabelConstructorP(void)
@@ -193,18 +221,67 @@ int UtcDaliToolkitTextLabelSetPropertyP(void)
   // Check font properties.
   label.SetProperty( TextLabel::Property::FONT_FAMILY, "Setting font family" );
   DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::FONT_FAMILY ), std::string("Setting font family"), TEST_LOCATION );
-  label.SetProperty( TextLabel::Property::FONT_STYLE, "{\"weight\":\"bold\",\"width\":\"condensed\",\"slant\":\"italic\"}" );
-  DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::FONT_STYLE ), std::string("{\"weight\":\"bold\",\"width\":\"condensed\",\"slant\":\"italic\"}"), TEST_LOCATION );
+
+  Property::Map fontStyleMapSet;
+  Property::Map fontStyleMapGet;
+
+  fontStyleMapSet.Insert( "weight", "bold" );
+  fontStyleMapSet.Insert( "width", "condensed" );
+  fontStyleMapSet.Insert( "slant", "italic" );
+  label.SetProperty( TextLabel::Property::FONT_STYLE, fontStyleMapSet );
+
+  fontStyleMapGet = label.GetProperty<Property::Map>( TextLabel::Property::FONT_STYLE );
+  DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
+
+  // Check the old font style format.
+  fontStyleMapSet.Clear();
+  fontStyleMapSet.Insert( "weight", "thin" );
+  fontStyleMapSet.Insert( "width", "expanded" );
+  fontStyleMapSet.Insert( "slant", "oblique" );
+
+  label.SetProperty( TextLabel::Property::FONT_STYLE, "{\"weight\":\"thin\",\"width\":\"expanded\",\"slant\":\"oblique\"}" );
+  fontStyleMapGet = label.GetProperty<Property::Map>( TextLabel::Property::FONT_STYLE );
+  DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
+
   label.SetProperty( TextLabel::Property::POINT_SIZE, 10.f );
   DALI_TEST_EQUALS( label.GetProperty<float>( TextLabel::Property::POINT_SIZE ), 10.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
 
   // Reset font style.
-  label.SetProperty( TextLabel::Property::FONT_STYLE, "{\"weight\":\"normal\",\"slant\":\"oblique\"}" );
-  DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::FONT_STYLE ), std::string("{\"weight\":\"normal\",\"slant\":\"oblique\"}"), TEST_LOCATION );
-  label.SetProperty( TextLabel::Property::FONT_STYLE, "{\"slant\":\"roman\"}" );
-  DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::FONT_STYLE ), std::string("{\"slant\":\"normal\"}"), TEST_LOCATION );
-  label.SetProperty( TextLabel::Property::FONT_STYLE, "" );
-  DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::FONT_STYLE ), std::string(""), TEST_LOCATION );
+  fontStyleMapSet.Clear();
+  fontStyleMapSet.Insert( "weight", "normal" );
+  fontStyleMapSet.Insert( "slant", "oblique" );
+
+  label.SetProperty( TextLabel::Property::FONT_STYLE, fontStyleMapSet );
+  fontStyleMapGet = label.GetProperty<Property::Map>( TextLabel::Property::FONT_STYLE );
+  DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
+
+  fontStyleMapSet.Clear();
+  fontStyleMapSet.Insert( "slant", "roman" );
+
+  label.SetProperty( TextLabel::Property::FONT_STYLE, fontStyleMapSet );
+  fontStyleMapGet = label.GetProperty<Property::Map>( TextLabel::Property::FONT_STYLE );
+  DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
+
+  // Replace 'roman' for 'normal'.
+  Property::Value* slantValue = fontStyleMapGet.Find( "slant" );
+  if( NULL != slantValue )
+  {
+    if( "normal" == slantValue->Get<std::string>() )
+    {
+      fontStyleMapGet["slant"] = "roman";
+    }
+  }
+  DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
+
+  fontStyleMapSet.Clear();
+
+  label.SetProperty( TextLabel::Property::FONT_STYLE, fontStyleMapSet );
+  fontStyleMapGet = label.GetProperty<Property::Map>( TextLabel::Property::FONT_STYLE );
+  DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
 
   // Toggle multi-line
   label.SetProperty( TextLabel::Property::MULTI_LINE, true );
@@ -222,7 +299,16 @@ int UtcDaliToolkitTextLabelSetPropertyP(void)
   // The underline color is changed as well.
   DALI_TEST_EQUALS( label.GetProperty<Vector4>( TextLabel::Property::UNDERLINE_COLOR ), Color::BLUE, TEST_LOCATION );
 
-  DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::UNDERLINE ), std::string("{\"enable\":\"false\",\"color\":\"blue\",\"height\":\"0\"}"), TEST_LOCATION );
+  Property::Map underlineMapSet;
+  Property::Map underlineMapGet;
+
+  underlineMapSet.Insert( "enable", "false" );
+  underlineMapSet.Insert( "color", "blue" );
+  underlineMapSet.Insert( "height", "0" );
+
+  underlineMapGet = label.GetProperty<Property::Map>( TextLabel::Property::UNDERLINE );
+  DALI_TEST_EQUALS( underlineMapGet.Count(), underlineMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( underlineMapGet, underlineMapSet ), true, TEST_LOCATION );
 
   // Check that shadow parameters can be correctly set
   label.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 3.0f, 3.0f ) );
@@ -268,18 +354,54 @@ int UtcDaliToolkitTextLabelSetPropertyP(void)
   DALI_TEST_EQUALS( label.GetProperty<float>( TextLabel::Property::LINE_SPACING ), 10.0f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
 
   // Check the underline property
-  label.SetProperty( TextLabel::Property::UNDERLINE, "{\"enable\":\"true\",\"color\":\"red\",\"height\":\"1\"}" );
-  DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::UNDERLINE ), std::string("{\"enable\":\"true\",\"color\":\"red\",\"height\":\"1\"}"), TEST_LOCATION );
 
-  label.SetProperty( TextLabel::Property::UNDERLINE, "" );
-  DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::UNDERLINE ), std::string("{\"enable\":\"false\",\"color\":\"red\",\"height\":\"1\"}"), TEST_LOCATION );
+  underlineMapSet.Clear();
+  underlineMapSet.Insert( "enable", "true" );
+  underlineMapSet.Insert( "color", "red" );
+  underlineMapSet.Insert( "height", "1" );
+
+  label.SetProperty( TextLabel::Property::UNDERLINE, underlineMapSet );
+
+  underlineMapGet = label.GetProperty<Property::Map>( TextLabel::Property::UNDERLINE );
+  DALI_TEST_EQUALS( underlineMapGet.Count(), underlineMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( underlineMapGet, underlineMapSet ), true, TEST_LOCATION );
+
+  underlineMapSet.Clear();
+
+  Property::Map underlineDisabledMapGet;
+  underlineDisabledMapGet.Insert( "enable", "false" );
+  underlineDisabledMapGet.Insert( "color", "red" );
+  underlineDisabledMapGet.Insert( "height", "1" );
+
+  label.SetProperty( TextLabel::Property::UNDERLINE, underlineMapSet );
+  underlineMapGet = label.GetProperty<Property::Map>( TextLabel::Property::UNDERLINE );
+  DALI_TEST_EQUALS( underlineMapGet.Count(), underlineDisabledMapGet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( underlineMapGet, underlineDisabledMapGet ), true, TEST_LOCATION );
 
   // Check the shadow property
-  label.SetProperty( TextLabel::Property::SHADOW, "{\"color\":\"green\",\"offset\":\"2 2\"}" );
-  DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::SHADOW ), std::string("{\"color\":\"green\",\"offset\":\"2 2\"}"), TEST_LOCATION );
 
-  label.SetProperty( TextLabel::Property::SHADOW, "" );
-  DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::SHADOW ), std::string("{\"color\":\"green\",\"offset\":\"0 0\"}"), TEST_LOCATION );
+  Property::Map shadowMapSet;
+  Property::Map shadowMapGet;
+
+  shadowMapSet.Insert( "color", "green" );
+  shadowMapSet.Insert( "offset", "2 2" );
+
+  label.SetProperty( TextLabel::Property::SHADOW, shadowMapSet );
+
+  shadowMapGet = label.GetProperty<Property::Map>( TextLabel::Property::SHADOW );
+  DALI_TEST_EQUALS( shadowMapGet.Count(), shadowMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( shadowMapGet, shadowMapSet ), true, TEST_LOCATION );
+
+  shadowMapSet.Clear();
+  Property::Map shadowDisabledMapGet;
+  shadowDisabledMapGet.Insert( "color", "green" );
+  shadowDisabledMapGet.Insert( "offset", "0 0" );
+
+  label.SetProperty( TextLabel::Property::SHADOW, shadowMapSet );
+
+  shadowMapGet = label.GetProperty<Property::Map>( TextLabel::Property::SHADOW );
+  DALI_TEST_EQUALS( shadowMapGet.Count(), shadowDisabledMapGet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( shadowMapGet, shadowDisabledMapGet ), true, TEST_LOCATION );
 
   // Check the emboss property
   label.SetProperty( TextLabel::Property::EMBOSS, "Emboss properties" );
index 71851de..8fdf936 100644 (file)
@@ -246,7 +246,7 @@ int UtcDaliTransitionDataMap1P(void)
   visual.SetName( "visual1" );
 
   Property::Index visualIndex = Control::CONTROL_PROPERTY_END_INDEX + 1;
-  dummyImpl.RegisterVisual( visualIndex, actor, visual );
+  dummyImpl.RegisterVisual( visualIndex, visual );
 
   Animation anim = dummyImpl.CreateTransition( transition );
   DALI_TEST_CHECK( anim );
@@ -309,7 +309,7 @@ int UtcDaliTransitionDataMap2P(void)
   visual.SetName( "visual1" );
 
   Property::Index visualIndex = Control::CONTROL_PROPERTY_END_INDEX + 1;
-  dummyImpl.RegisterVisual( visualIndex, actor, visual );
+  dummyImpl.RegisterVisual( visualIndex, visual );
 
   Animation anim = dummyImpl.CreateTransition( transition );
   DALI_TEST_CHECK( anim );
@@ -372,7 +372,7 @@ int UtcDaliTransitionDataMap3P(void)
   visual.SetName( "visual1" );
 
   Property::Index visualIndex = Control::CONTROL_PROPERTY_END_INDEX + 1;
-  dummyImpl.RegisterVisual( visualIndex, actor, visual );
+  dummyImpl.RegisterVisual( visualIndex, visual );
 
   Animation anim = dummyImpl.CreateTransition( transition );
   DALI_TEST_CHECK( anim );
@@ -518,7 +518,7 @@ int UtcDaliTransitionDataMapN3(void)
   visual.SetName( "visual1" );
 
   Property::Index visualIndex = Control::CONTROL_PROPERTY_END_INDEX + 1;
-  dummyImpl.RegisterVisual( visualIndex, actor, visual );
+  dummyImpl.RegisterVisual( visualIndex, visual );
 
   Animation anim = dummyImpl.CreateTransition( transition );
   DALI_TEST_CHECK( !anim );
@@ -559,7 +559,7 @@ int UtcDaliTransitionDataMapN4(void)
   visual.SetName( "visual1" );
 
   Property::Index visualIndex = Control::CONTROL_PROPERTY_END_INDEX + 1;
-  dummyImpl.RegisterVisual( visualIndex, actor, visual );
+  dummyImpl.RegisterVisual( visualIndex, visual );
 
   Animation anim = dummyImpl.CreateTransition( transition );
   DALI_TEST_CHECK( !anim );
@@ -610,7 +610,7 @@ int UtcDaliTransitionDataMapN5(void)
   visual.SetName( "visual1" );
 
   Property::Index visualIndex = Control::CONTROL_PROPERTY_END_INDEX + 1;
-  dummyImpl.RegisterVisual( visualIndex, actor, visual );
+  dummyImpl.RegisterVisual( visualIndex, visual );
 
   Animation anim = dummyImpl.CreateTransition( transition );
   DALI_TEST_CHECK( !anim );
@@ -661,7 +661,7 @@ int UtcDaliTransitionDataMapN6(void)
   visual.SetName( "visual1" );
 
   Property::Index visualIndex = Control::CONTROL_PROPERTY_END_INDEX + 1;
-  dummyImpl.RegisterVisual( visualIndex, actor, visual );
+  dummyImpl.RegisterVisual( visualIndex, visual );
 
   Animation anim = dummyImpl.CreateTransition( transition );
   DALI_TEST_CHECK( !anim );
index 270b304..4959ed9 100644 (file)
@@ -24,6 +24,7 @@
 #include <dali/public-api/rendering/shader.h>
 #include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
 #include <dali-toolkit/devel-api/visual-factory/devel-visual-properties.h>
+#include <dali-toolkit/devel-api/align-enums.h>
 #include <dali-toolkit/dali-toolkit.h>
 #include "dummy-control.h"
 
@@ -32,7 +33,7 @@ using namespace Dali::Toolkit;
 
 namespace
 {
-const char* TEST_IMAGE_FILE_NAME =  "gallery_image_01.jpg";
+const char* TEST_IMAGE_FILE_NAME =  TEST_RESOURCE_DIR "/gallery-small-1.jpg";
 const char* TEST_NPATCH_FILE_NAME =  "gallery_image_01.9.jpg";
 const char* TEST_SVG_FILE_NAME = TEST_RESOURCE_DIR "/svg1.svg";
 const char* TEST_OBJ_FILE_NAME = TEST_RESOURCE_DIR "/Cube.obj";
@@ -40,8 +41,37 @@ const char* TEST_MTL_FILE_NAME = TEST_RESOURCE_DIR "/ToyRobot-Metal.mtl";
 const char* TEST_RESOURCE_LOCATION = TEST_RESOURCE_DIR "/";
 
 const std::string DEFAULT_FONT_DIR( "/resources/fonts" );
+
+bool DaliTestCheckMaps( const Property::Map& fontStyleMapGet, const Property::Map& fontStyleMapSet )
+{
+  if( fontStyleMapGet.Count() == fontStyleMapSet.Count() )
+  {
+    for( unsigned int index = 0u; index < fontStyleMapGet.Count(); ++index )
+    {
+      const KeyValuePair& valueGet = fontStyleMapGet.GetKeyValue( index );
+
+      Property::Value* valueSet = fontStyleMapSet.Find( valueGet.first.stringKey );
+      if( NULL != valueSet )
+      {
+        if( valueGet.second.Get<std::string>() != valueSet->Get<std::string>() )
+        {
+          tet_printf( "  Value got : [%s], expected : [%s]", valueGet.second.Get<std::string>().c_str(), valueSet->Get<std::string>().c_str() );
+          return false;
+        }
+      }
+      else
+      {
+        tet_printf( "  The key %s doesn't exist.", valueGet.first.stringKey.c_str() );
+        return false;
+      }
+    }
+  }
+
+  return true;
 }
 
+} //namespace
+
 void dali_visual_startup(void)
 {
   test_return_value = TET_UNDEF;
@@ -962,7 +992,11 @@ int UtcDaliVisualGetPropertyMap10(void)
   propertyMap.Insert( "renderingBackend", static_cast<int>( Toolkit::Text::DEFAULT_RENDERING_BACKEND ) );
   propertyMap.Insert( "text", "Hello world" );
   propertyMap.Insert( "fontFamily", "TizenSans" );
-  propertyMap.Insert( "fontStyle", "{\"weight\":\"bold\"}" );
+
+  Property::Map fontStyleMapSet;
+  fontStyleMapSet.Insert( "weight", "bold" );
+  propertyMap.Insert( "fontStyle", fontStyleMapSet );
+
   propertyMap.Insert( "pointSize", 12.f );
   propertyMap.Insert( "multiLine", true );
   propertyMap.Insert( "horizontalAlignment", "CENTER" );
@@ -994,9 +1028,12 @@ int UtcDaliVisualGetPropertyMap10(void)
   DALI_TEST_CHECK( value );
   DALI_TEST_EQUALS( value->Get<std::string>(), "TizenSans", TEST_LOCATION );
 
-  value = resultMap.Find( TextVisual::Property::FONT_STYLE, Property::STRING );
+  value = resultMap.Find( TextVisual::Property::FONT_STYLE, Property::MAP );
   DALI_TEST_CHECK( value );
-  DALI_TEST_EQUALS( value->Get<std::string>(), "{\"weight\":\"bold\"}", TEST_LOCATION );
+
+  Property::Map fontStyleMapGet = value->Get<Property::Map>();
+  DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
 
   value = resultMap.Find( TextVisual::Property::POINT_SIZE, Property::FLOAT );
   DALI_TEST_CHECK( value );
@@ -1275,3 +1312,288 @@ int UtcDaliVisualWireframeVisual(void)
 
   END_TEST;
 }
+
+int UtcDaliVisualGetTransform(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliVisualGetTransform: ColorVisual" );
+
+  VisualFactory factory = VisualFactory::Get();
+  Property::Map propertyMap;
+  propertyMap.Insert(Visual::Property::TYPE,  Visual::COLOR);
+  propertyMap.Insert(ColorVisual::Property::MIX_COLOR,  Color::BLUE);
+  Visual::Base colorVisual = factory.CreateVisual( propertyMap );
+
+  Dali::Property::Map map;
+  Dali::Property::Value transformProperty = colorVisual.GetProperty( Dali::Toolkit::Visual::DevelProperty::TRANSFORM );
+  transformProperty.Get(map);
+
+  //Test default values
+  {
+    Property::Value* typeValue = map.Find( Toolkit::Visual::DevelProperty::Transform::Property::OFFSET );
+    DALI_TEST_CHECK( typeValue );
+    DALI_TEST_CHECK( typeValue->Get<Vector2>() == Vector2(0.0f,0.0f) );
+  }
+  {
+    Property::Value* typeValue = map.Find( Toolkit::Visual::DevelProperty::Transform::Property::SIZE );
+    DALI_TEST_CHECK( typeValue );
+    DALI_TEST_CHECK( typeValue->Get<Vector2>() == Vector2(1.0f,1.0f) );
+  }
+  {
+    Property::Value* typeValue = map.Find( Toolkit::Visual::DevelProperty::Transform::Property::OFFSET_SIZE_MODE );
+    DALI_TEST_CHECK( typeValue );
+    DALI_TEST_CHECK( typeValue->Get<Vector4>() == Vector4(0.0f,0.0f,0.0f,0.0f) );
+  }
+  {
+    Property::Value* typeValue = map.Find( Toolkit::Visual::DevelProperty::Transform::Property::ORIGIN );
+    DALI_TEST_CHECK( typeValue );
+    DALI_TEST_CHECK( (Toolkit::Align::Type)typeValue->Get<int>() == Toolkit::Align::CENTER );
+  }
+  {
+    Property::Value* typeValue = map.Find( Toolkit::Visual::DevelProperty::Transform::Property::ANCHOR_POINT );
+    DALI_TEST_CHECK( typeValue );
+    DALI_TEST_CHECK( (Toolkit::Align::Type)typeValue->Get<int>() == Toolkit::Align::CENTER );
+  }
+
+  END_TEST;
+}
+
+static void TestTransform( ToolkitTestApplication& application, Visual::Base visual )
+{
+  Property::Map transform;
+  transform.Insert( Visual::DevelProperty::Transform::Property::OFFSET, Vector2(10.0f, 10.0f) );
+  transform.Insert( Visual::DevelProperty::Transform::Property::SIZE, Vector2(0.2f, 0.2f) );
+  transform.Insert( Visual::DevelProperty::Transform::Property::OFFSET_SIZE_MODE, Vector4(1.0f, 1.0f, 0.0f,0.0f) );
+  transform.Insert( Visual::DevelProperty::Transform::Property::ORIGIN, "TOP_BEGIN" );
+  transform.Insert( Visual::DevelProperty::Transform::Property::ANCHOR_POINT, Toolkit::Align::BOTTOM_END );
+
+  visual.SetProperty( Dali::Toolkit::Visual::DevelProperty::TRANSFORM, transform );
+
+  Dali::Property::Map map;
+  Dali::Property::Value transformProperty = visual.GetProperty( Dali::Toolkit::Visual::DevelProperty::TRANSFORM );
+  transformProperty.Get(map);
+
+  {
+    Property::Value* typeValue = map.Find( Toolkit::Visual::DevelProperty::Transform::Property::OFFSET );
+    DALI_TEST_CHECK( typeValue );
+    DALI_TEST_EQUALS( typeValue->Get<Vector2>(),Vector2(10.0f,10.0f), TEST_LOCATION );
+  }
+  {
+    Property::Value* typeValue = map.Find( Toolkit::Visual::DevelProperty::Transform::Property::SIZE );
+    DALI_TEST_CHECK( typeValue );
+    DALI_TEST_EQUALS( typeValue->Get<Vector2>(), Vector2(0.2f,0.2f), TEST_LOCATION );
+  }
+  {
+    Property::Value* typeValue = map.Find( Toolkit::Visual::DevelProperty::Transform::Property::OFFSET_SIZE_MODE );
+    DALI_TEST_CHECK( typeValue );
+    DALI_TEST_EQUALS( typeValue->Get<Vector4>(), Vector4(1.0f,1.0f,0.0f,0.0f), TEST_LOCATION );
+  }
+  {
+    Property::Value* typeValue = map.Find( Toolkit::Visual::DevelProperty::Transform::Property::ORIGIN );
+    DALI_TEST_CHECK( typeValue );
+    DALI_TEST_EQUALS( (Toolkit::Align::Type)typeValue->Get<int>(), Toolkit::Align::TOP_BEGIN, TEST_LOCATION );
+  }
+  {
+    Property::Value* typeValue = map.Find( Toolkit::Visual::DevelProperty::Transform::Property::ANCHOR_POINT );
+    DALI_TEST_CHECK( typeValue );
+    DALI_TEST_EQUALS( (Toolkit::Align::Type)typeValue->Get<int>(), Toolkit::Align::BOTTOM_END, TEST_LOCATION );
+  }
+
+  //Put the visual on the stage
+  Actor actor = Actor::New();
+  actor.SetSize(200.f, 200.f);
+  Stage::GetCurrent().Add( actor );
+  visual.SetOnStage( actor );
+  application.SendNotification();
+  application.Render(0);
+  Renderer renderer( actor.GetRendererAt(0) );
+
+  //Check that the properties have been registered on the Renderer
+  Vector2 offset = renderer.GetProperty<Vector2>( renderer.GetPropertyIndex( "offset" ) );
+  DALI_TEST_EQUALS( offset, Vector2(10.0f,10.0f), TEST_LOCATION );
+
+  Vector2 size = renderer.GetProperty<Vector2>( renderer.GetPropertyIndex( "size" ) );
+  DALI_TEST_EQUALS( size, Vector2(0.2f,0.2f), TEST_LOCATION );
+
+  Vector4 offsetSizeMode = renderer.GetProperty<Vector4>( renderer.GetPropertyIndex( "offsetSizeMode" ) );
+  DALI_TEST_EQUALS( offsetSizeMode, Vector4(1.0f,1.0f,0.0f,0.0f), TEST_LOCATION );
+
+  Vector2 parentOrigin = renderer.GetProperty<Vector2>( renderer.GetPropertyIndex( "origin" ) );
+  DALI_TEST_EQUALS( parentOrigin, Vector2(-0.5f,-0.5f), TEST_LOCATION );
+
+  Vector2 anchorPoint = renderer.GetProperty<Vector2>( renderer.GetPropertyIndex( "anchorPoint" ) );
+  DALI_TEST_EQUALS( anchorPoint, Vector2(-0.5f,-0.5f), TEST_LOCATION );
+
+  //Set a new transform
+  transform.Clear();
+  transform.Insert( Visual::DevelProperty::Transform::Property::OFFSET, Vector2(20.0f, 20.0f) );
+  transform.Insert( Visual::DevelProperty::Transform::Property::SIZE, Vector2(100.0f, 100.0f) );
+  transform.Insert( Visual::DevelProperty::Transform::Property::OFFSET_SIZE_MODE, Vector4(0.0f, 0.0f, 1.0f,1.0f) );
+  visual.SetProperty( Dali::Toolkit::Visual::DevelProperty::TRANSFORM, transform );
+  application.SendNotification();
+  application.Render(0);
+
+  //Check that the values have changed in the renderer
+  offset = renderer.GetProperty<Vector2>( renderer.GetPropertyIndex( "offset" ) );
+  DALI_TEST_EQUALS( offset, Vector2(20.0f,20.0f), TEST_LOCATION );
+
+  size = renderer.GetProperty<Vector2>( renderer.GetPropertyIndex( "size" ) );
+  DALI_TEST_EQUALS( size, Vector2(100.0f,100.0f), TEST_LOCATION );
+
+  offsetSizeMode = renderer.GetProperty<Vector4>( renderer.GetPropertyIndex( "offsetSizeMode" ) );
+  DALI_TEST_EQUALS( offsetSizeMode, Vector4(0.0f,0.0f,1.0f,1.0f), TEST_LOCATION );
+
+  //Parent origin and anchor point should have default values
+  parentOrigin = renderer.GetProperty<Vector2>( renderer.GetPropertyIndex( "origin" ) );
+  DALI_TEST_EQUALS( parentOrigin, Vector2(0.0f,0.0f), TEST_LOCATION );
+
+  anchorPoint = renderer.GetProperty<Vector2>( renderer.GetPropertyIndex( "anchorPoint" ) );
+  DALI_TEST_EQUALS( anchorPoint, Vector2(0.0f,0.0f), TEST_LOCATION );
+}
+
+int UtcDaliVisualSetTransform0(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliVisualSetTransform: ColorVisual" );
+
+  VisualFactory factory = VisualFactory::Get();
+  Property::Map propertyMap;
+  propertyMap.Insert(Visual::Property::TYPE,  Visual::COLOR);
+  propertyMap.Insert(ColorVisual::Property::MIX_COLOR,  Color::BLUE);
+  Visual::Base visual = factory.CreateVisual( propertyMap );
+  TestTransform( application, visual );
+
+  END_TEST;
+}
+
+int UtcDaliVisualSetTransform1(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliVisualSetTransform: PrimitiveVisual" );
+
+  VisualFactory factory = VisualFactory::Get();
+  Property::Map propertyMap;
+  propertyMap[ Visual::Property::TYPE           ] = Visual::PRIMITIVE;
+  propertyMap[ PrimitiveVisual::Property::MIX_COLOR ] = Vector4(1.0f,1.0f,1.0f,1.0f);
+  propertyMap[ PrimitiveVisual::Property::SHAPE  ] = PrimitiveVisual::Shape::SPHERE;
+  propertyMap[ PrimitiveVisual::Property::SLICES ] = 10;
+  propertyMap[ PrimitiveVisual::Property::STACKS ] = 10;
+  Visual::Base visual = factory.CreateVisual( propertyMap );
+  TestTransform( application, visual );
+
+  END_TEST;
+}
+
+int UtcDaliVisualSetTransform2(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliVisualSetTransform: GradientVisual" );
+
+  VisualFactory factory = VisualFactory::Get();
+  Property::Map propertyMap;
+  propertyMap.Insert( Visual::Property::TYPE,  Visual::GRADIENT );
+  Property::Array stopOffsets;
+  stopOffsets.PushBack( 0.0f );
+  stopOffsets.PushBack( 0.3f );
+  stopOffsets.PushBack( 0.6f );
+  stopOffsets.PushBack( 0.8f );
+  stopOffsets.PushBack( 1.0f );
+  propertyMap.Insert( GradientVisual::Property::STOP_OFFSET, stopOffsets );
+
+  Property::Array stopColors;
+  stopColors.PushBack( Vector4( 129.f, 198.f, 193.f, 255.f )/255.f );
+  stopColors.PushBack( Vector4( 196.f, 198.f, 71.f, 122.f )/255.f );
+  stopColors.PushBack( Vector4( 214.f, 37.f, 139.f, 191.f )/255.f );
+  stopColors.PushBack( Vector4( 129.f, 198.f, 193.f, 150.f )/255.f );
+  stopColors.PushBack( Color::YELLOW );
+  propertyMap.Insert( GradientVisual::Property::STOP_COLOR, stopColors );
+  propertyMap.Insert( GradientVisual::Property::CENTER, Vector2( 0.5f, 0.5f ) );
+  propertyMap.Insert( GradientVisual::Property::RADIUS, 1.414f );
+  Visual::Base visual = factory.CreateVisual( propertyMap );
+  TestTransform( application, visual );
+
+  END_TEST;
+}
+
+int UtcDaliVisualSetTransform3(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliVisualSetTransform: BorderVisual" );
+
+  VisualFactory factory = VisualFactory::Get();
+  Property::Map propertyMap;
+  propertyMap.Insert( Visual::Property::TYPE, Visual::BORDER );
+  propertyMap.Insert( BorderVisual::Property::COLOR, Vector4(0.f, 1.f, 0.f, 0.6f) );
+  propertyMap.Insert( BorderVisual::Property::SIZE, 3.0f );
+  Visual::Base visual = factory.CreateVisual( propertyMap );
+  TestTransform( application, visual );
+
+  END_TEST;
+}
+
+int UtcDaliVisualSetTransform4(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliVisualSetTransform: MeshVisual" );
+
+  VisualFactory factory = VisualFactory::Get();
+  Property::Map propertyMap;
+  propertyMap.Insert( Visual::Property::TYPE, Visual::MESH );
+  propertyMap.Insert( MeshVisual::Property::OBJECT_URL, TEST_OBJ_FILE_NAME );
+  propertyMap.Insert( MeshVisual::Property::MATERIAL_URL, TEST_MTL_FILE_NAME );
+  propertyMap.Insert( MeshVisual::Property::TEXTURES_PATH, TEST_RESOURCE_LOCATION );
+  propertyMap.Insert( MeshVisual::Property::SHADING_MODE, MeshVisual::ShadingMode::TEXTURELESS_WITH_DIFFUSE_LIGHTING );
+  propertyMap.Insert( MeshVisual::Property::LIGHT_POSITION, Vector3( 5.0f, 10.0f, 15.0f) );
+  Visual::Base visual = factory.CreateVisual( propertyMap );
+  TestTransform( application, visual );
+
+  END_TEST;
+}
+
+int UtcDaliVisualSetTransform5(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliVisualSetTransform: ImageVisual from Image" );
+
+  VisualFactory factory = VisualFactory::Get();
+  Image image = ResourceImage::New(TEST_IMAGE_FILE_NAME, ImageDimensions(100, 200));
+  Visual::Base visual = factory.CreateVisual(image);
+  TestTransform( application, visual );
+
+  END_TEST;
+}
+
+int UtcDaliVisualSetTransform6(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliVisualSetTransform: ImageVisual for URL " );
+
+  VisualFactory factory = VisualFactory::Get();
+  Property::Map propertyMap;
+  propertyMap[Toolkit::Visual::Property::TYPE] = Toolkit::Visual::IMAGE;
+  propertyMap[Toolkit::ImageVisual::Property::URL] = TEST_IMAGE_FILE_NAME;
+  propertyMap[Toolkit::ImageVisual::Property::DESIRED_WIDTH] = 100.0f;
+  propertyMap[Toolkit::ImageVisual::Property::DESIRED_HEIGHT] = 100.0f;
+  propertyMap[Toolkit::ImageVisual::Property::FITTING_MODE] = FittingMode::SCALE_TO_FILL;
+  propertyMap[Toolkit::ImageVisual::Property::SAMPLING_MODE] = SamplingMode::BOX_THEN_LINEAR;
+  propertyMap[Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING] = true;
+  Visual::Base visual = factory.CreateVisual(propertyMap);
+  TestTransform( application, visual );
+
+  END_TEST;
+}
+
+int UtcDaliVisualSetTransform7(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliVisualSetTransform: NPatch visual" );
+
+  VisualFactory factory = VisualFactory::Get();
+  Image image = ResourceImage::New(TEST_NPATCH_FILE_NAME, ImageDimensions(100, 200));
+  Visual::Base visual = factory.CreateVisual(image);
+  TestTransform( application, visual );
+
+  END_TEST;
+}
+
+
diff --git a/dali-toolkit/devel-api/align-enums.h b/dali-toolkit/devel-api/align-enums.h
new file mode 100644 (file)
index 0000000..7cba1cd
--- /dev/null
@@ -0,0 +1,60 @@
+#ifndef __DALI_TOOLKIT_DEVEL_API_ALIGN_ENUMS_H__
+#define __DALI_TOOLKIT_DEVEL_API_ALIGN_ENUMS_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.
+ *
+ */
+
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Direction
+{
+  enum Type
+  {
+    LEFT_TO_RIGHT = 0,
+    RIGHT_TO_LEFT
+  };
+}
+
+/**
+ * @brief Enum used to describe anchor point and parent origin of visuals
+ */
+namespace Align
+{
+  enum Type
+  {
+    TOP_BEGIN      = 0,
+    TOP_CENTER,
+    TOP_END,
+    CENTER_BEGIN,
+    CENTER,
+    CENTER_END,
+    BOTTOM_BEGIN,
+    BOTTOM_CENTER,
+    BOTTOM_END
+  };
+}
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // __DALI_TOOLKIT_DEVEL_API_ALIGN_ENUMS_H__
index cc12134..64432b4 100644 (file)
@@ -19,7 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/actors/actor.h>
+#include <dali/public-api/rendering/texture.h>
 
 namespace Dali
 {
@@ -28,7 +28,7 @@ namespace Toolkit
 {
 
 /**
- * @brief PageFactory is an abstract interface for providing images to PageTurnView
+ * @brief PageFactory is an abstract interface for providing textures to PageTurnView
  * Each page is identified by a unique ID, and has a linear order from 0 to GetNumberOfPages()-1
  *
  * @SINCE_1_1.4
@@ -41,7 +41,6 @@ public:
 
   /**
    * @brief Virtual destructor
-   * @SINCE_1_1.4
    */
   virtual ~PageFactory(){};
 
@@ -49,26 +48,24 @@ public:
    * @brief Query the number of pages available from the factory.
    *
    * The maximum available page has an ID of GetNumberOfPages()-1.
-   * @SINCE_1_1.4
    * @return The page count.
    */
   virtual unsigned int GetNumberOfPages() = 0;
 
   /**
-   * @brief Create an actor to represent the page content.
-   * @SINCE_1_1.30
+   * @brief Return the texture for the page
    *
-   * If no valid image provided, a broken image is displayed.
-   * For double-sided page( PageTurnLandscapeView ), the left half of image is used as page front side, and the right half as page back side.
+   * For double-sided page( PageTurnLandscapeView ), the left half of texture is used as page front side, and the right half as page back side.
+   *
+   * @note Must return a valid texture handle!
    *
    * @param[in] pageId The ID of the page to create.
    * @return An actor, or an uninitialized pointer if the ID is out of range.
    */
-  virtual Image NewPage( unsigned int pageId ) = 0;
+  virtual Texture NewPage( unsigned int pageId ) = 0;
 
   /**
    * @brief Retrieve the extension for this factory
-   * @SINCE_1_1.30
    *
    * @return The extension if available, NULL otherwise.
    */
index 5bcf750..78e96e5 100755 (executable)
@@ -36,6 +36,9 @@ devel_api_src_files = \
 
 # Add devel header files here
 
+devel_api_header_files = \
+  $(devel_api_src_dir)/align-enums.h
+
 devel_api_controls_header_files = \
   $(devel_api_src_dir)/controls/control-depth-index-ranges.h
 
@@ -74,6 +77,7 @@ devel_api_progress_bar_header_files = \
 
 devel_api_visual_factory_header_files = \
   $(devel_api_src_dir)/visual-factory/transition-data.h \
+  $(devel_api_src_dir)/visual-factory/devel-visual-properties.h \
   $(devel_api_src_dir)/visual-factory/visual-factory.h \
   $(devel_api_src_dir)/visual-factory/visual-base.h
 
index 02e977b..2d76662 100644 (file)
@@ -47,11 +47,60 @@ enum Type
    * @details Name "transform", type Property::Map.
 
    * @note Optional.
-   * @see Transform::Property
+   * @see DevelProperty::Transform::Property
    */
   TRANSFORM = SHADER+1//Dali::Toolkit::Visual::Property::SHADER+1
 };
 
+namespace Transform
+{
+
+namespace Property
+{
+
+enum Type
+{
+  /**
+   * @brief Offset of the visual. It can be either relative (percentage of the parent)
+   * or absolute (in world units).
+   * @details Name "offset", type Property::VECTOR2
+   */
+  OFFSET,
+
+  /**
+   * @brief Size of the visual. It can be either relative (percentage of the parent)
+   * or absolute (in world units).
+   * @details Name "size", type Property::VECTOR2
+   */
+  SIZE,
+
+  /**
+   * @brief The origin of the visual within its control area.
+   * @details Name "origin", type Align::Type (Property::INTEGER) or Property::STRING.
+   * @see Toolkit::Align
+   */
+  ORIGIN,
+
+  /**
+   * @brief The anchor-point of the visual
+   * @details Name "anchorPoint", type Align::Type (Property::INTEGER) or Property::STRING.
+   * @see Toolkit::Align
+   */
+  ANCHOR_POINT,
+
+  /**
+   * @brief Indicates which components of the offset and size are relative
+   * (percentage of the parent) or absolute (in world units).
+   * 0 indicates the component is relative, and 1 absolute.
+   * @details Name "offsetSizeMode", type Property::VECTOR4
+   */
+  OFFSET_SIZE_MODE
+};
+
+} //namespace Property
+
+} //namespace Transform
+
 } // namespace DevelProperty
 
 } // namespace Visual
index 8b4e380..f875173 100644 (file)
@@ -576,7 +576,7 @@ void Button::SetColor( const Vector4& color, Button::PaintState selectedState )
 
       visual = visualFactory.CreateVisual( map );
 
-      RegisterVisual( visualIndex, placementActor, visual );
+      RegisterVisual( visualIndex, visual );
 
       SetupContent( *contentActor, placementActor ); //
       contentActor->SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
index 4c532fd..24f82bc 100644 (file)
@@ -184,7 +184,8 @@ void EffectsView::SetType( Toolkit::EffectsView::EffectType type )
       }
     }
 
-    Image dummyImage; // Dummy image, force creation of an image visual
+    FrameBufferImage dummyImage = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat );
+
     InitializeVisual( self, mVisualPostFilter, dummyImage );
     Property::Map customShader;
     customShader[ Toolkit::Visual::Shader::Property::VERTEX_SHADER ] = EFFECTS_VIEW_VERTEX_SOURCE;
index e015144..3c19992 100644 (file)
@@ -81,9 +81,8 @@ void ImageView::SetImage( Image image )
 
     mImage = image;
 
-    Actor self( Self() );
     mVisual =  Toolkit::VisualFactory::Get().CreateVisual( image );
-    RegisterVisual( Toolkit::ImageView::Property::IMAGE, self, mVisual  );
+    RegisterVisual( Toolkit::ImageView::Property::IMAGE, mVisual  );
     mImageSize = image ? ImageDimensions( image.GetWidth(), image.GetHeight() ) : ImageDimensions( 0, 0 );
 
     RelayoutRequest();
@@ -96,9 +95,8 @@ void ImageView::SetImage( Property::Map map )
   mImage.Reset();
   mPropertyMap = map;
 
-  Actor self( Self() );
   mVisual =  Toolkit::VisualFactory::Get().CreateVisual( mPropertyMap );
-  RegisterVisual( Toolkit::ImageView::Property::IMAGE, self, mVisual  );
+  RegisterVisual( Toolkit::ImageView::Property::IMAGE, mVisual  );
 
   Property::Value* widthValue = mPropertyMap.Find( "width" );
   if( widthValue )
@@ -139,9 +137,8 @@ void ImageView::SetImage( const std::string& url, ImageDimensions size )
       mImageSize = size;
     }
 
-    Actor self( Self() );
     mVisual =  Toolkit::VisualFactory::Get().CreateVisual( url, size );
-    RegisterVisual( Toolkit::ImageView::Property::IMAGE, self, mVisual  );
+    RegisterVisual( Toolkit::ImageView::Property::IMAGE, mVisual  );
 
     mVisual.SetSize( mSizeSet );
 
index 112fa05..3eb9ab0 100644 (file)
 #include <cstring> // for strcmp
 #include <dali/public-api/animation/animation.h>
 #include <dali/public-api/animation/constraint.h>
-#include <dali/public-api/images/resource-image.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/object/type-registry-helper.h>
-#include <dali/devel-api/images/texture-set-image.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
@@ -39,9 +37,6 @@ using namespace Dali;
 
 namespace //Unnamed namespace
 {
-// broken image is loaded if there is no valid image provided for the page
-const char * const BROKEN_IMAGE_URL( DALI_IMAGE_DIR "broken.png");
-
 // properties set on shader, these properties have the constant value in regardless of the page status
 const char * const PROPERTY_SPINE_SHADOW ( "uSpineShadowParameter" ); // uniform for both spine and turn effect
 
@@ -282,14 +277,13 @@ PageTurnView::Page::Page()
   propertyTurnDirection = actor.RegisterProperty(PROPERTY_TURN_DIRECTION, -1.f);
 }
 
-void PageTurnView::Page::SetImage( Image image  )
+void PageTurnView::Page::SetTexture( Texture texture )
 {
   if( !textureSet )
   {
     textureSet = TextureSet::New();
   }
-
-  TextureSetImage( textureSet, 0u, image );
+  textureSet.SetTexture( 0u, texture );
 }
 
 void PageTurnView::Page::UseEffect(Shader newShader)
@@ -398,7 +392,7 @@ void PageTurnView::OnInitialize()
     Self().Add( mPages[i].actor );
   }
 
-  // create the layer for turning images
+  // create the layer for turning pages
   mTurningPageLayer = Layer::New();
   mTurningPageLayer.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
   mTurningPageLayer.SetBehavior(Layer::LAYER_3D);
@@ -584,13 +578,9 @@ void PageTurnView::AddPage( int pageIndex )
   {
     int index = pageIndex % NUMBER_OF_CACHED_PAGES;
 
-    Image newPageImage;
-    newPageImage = mPageFactory->NewPage( pageIndex );
-
-    if( !newPageImage ) // load the broken image
-    {
-      newPageImage = ResourceImage::New( BROKEN_IMAGE_URL );
-    }
+    Texture newPage;
+    newPage = mPageFactory->NewPage( pageIndex );
+    DALI_ASSERT_ALWAYS( newPage && "must pass in valid texture" );
 
     bool isLeftSide = ( pageIndex < mCurrentPageIndex );
     if( mPages[index].isTurnBack != isLeftSide )
@@ -602,11 +592,11 @@ void PageTurnView::AddPage( int pageIndex )
     mPages[index].actor.SetOrientation( Degree( degree ), Vector3::YAXIS );
     mPages[index].actor.SetVisible( false );
     mPages[index].UseEffect( mSpineEffectShader, mGeometry );
-    mPages[index].SetImage( newPageImage );
+    mPages[index].SetTexture( newPage );
 
     // For Portrait, nothing to do
     // For Landscape, set the parent origin to CENTER
-     OnAddPage( mPages[index].actor, isLeftSide );
+    OnAddPage( mPages[index].actor, isLeftSide );
   }
 }
 
index 2d40717..73aff02 100644 (file)
@@ -57,10 +57,10 @@ protected:
     ~Page(){};
 
     /**
-     * Set the page image content
-     * @param[in] image The content of the page.
+     * Set the page texture content
+     * @param[in] texture The content of the page.
      */
-    void SetImage( Image image );
+    void SetTexture( Texture texture );
 
     /**
      * Apply an effect onto the page actor.
index 9d59568..299ef5d 100644 (file)
@@ -84,7 +84,7 @@ DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "renderingBackend",
 DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "text",                                 STRING,    TEXT                                 )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "textColor",                            VECTOR4,   TEXT_COLOR                           )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "fontFamily",                           STRING,    FONT_FAMILY                          )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "fontStyle",                            STRING,    FONT_STYLE                           )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "fontStyle",                            MAP,       FONT_STYLE                           )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "pointSize",                            FLOAT,     POINT_SIZE                           )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "horizontalAlignment",                  STRING,    HORIZONTAL_ALIGNMENT                 )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "scrollThreshold",                      FLOAT,     SCROLL_THRESHOLD                     )
@@ -108,18 +108,18 @@ DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "decorationBoundingBox",
 DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "enableMarkup",                         BOOLEAN,   ENABLE_MARKUP                        )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "inputColor",                           VECTOR4,   INPUT_COLOR                          )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "inputFontFamily",                      STRING,    INPUT_FONT_FAMILY                    )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "inputFontStyle",                       STRING,    INPUT_FONT_STYLE                     )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "inputFontStyle",                       MAP,       INPUT_FONT_STYLE                     )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "inputPointSize",                       FLOAT,     INPUT_POINT_SIZE                     )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "lineSpacing",                          FLOAT,     LINE_SPACING                         )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "inputLineSpacing",                     FLOAT,     INPUT_LINE_SPACING                   )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "underline",                            STRING,    UNDERLINE                            )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "inputUnderline",                       STRING,    INPUT_UNDERLINE                      )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "shadow",                               STRING,    SHADOW                               )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "inputShadow",                          STRING,    INPUT_SHADOW                         )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "emboss",                               STRING,    EMBOSS                               )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "inputEmboss",                          STRING,    INPUT_EMBOSS                         )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "outline",                              STRING,    OUTLINE                              )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "inputOutline",                         STRING,    INPUT_OUTLINE                        )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "underline",                            MAP,       UNDERLINE                            )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "inputUnderline",                       MAP,       INPUT_UNDERLINE                      )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "shadow",                               MAP,       SHADOW                               )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "inputShadow",                          MAP,       INPUT_SHADOW                         )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "emboss",                               MAP,       EMBOSS                               )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "inputEmboss",                          MAP,       INPUT_EMBOSS                         )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "outline",                              MAP,       OUTLINE                              )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "inputOutline",                         MAP,       INPUT_OUTLINE                        )
 
 DALI_SIGNAL_REGISTRATION( Toolkit, TextEditor, "textChanged",        SIGNAL_TEXT_CHANGED )
 DALI_SIGNAL_REGISTRATION( Toolkit, TextEditor, "inputStyleChanged",  SIGNAL_INPUT_STYLE_CHANGED )
index 6e679e3..4723b33 100644 (file)
@@ -91,7 +91,7 @@ DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "text",
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "placeholderText",                      STRING,    PLACEHOLDER_TEXT                     )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "placeholderTextFocused",               STRING,    PLACEHOLDER_TEXT_FOCUSED             )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "fontFamily",                           STRING,    FONT_FAMILY                          )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "fontStyle",                            STRING,    FONT_STYLE                           )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "fontStyle",                            MAP,       FONT_STYLE                           )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "pointSize",                            FLOAT,     POINT_SIZE                           )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "maxLength",                            INTEGER,   MAX_LENGTH                           )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "exceedPolicy",                         INTEGER,   EXCEED_POLICY                        )
@@ -123,16 +123,16 @@ DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "inputMethodSettings",
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "inputColor",                           VECTOR4,   INPUT_COLOR                          )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "enableMarkup",                         BOOLEAN,   ENABLE_MARKUP                        )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "inputFontFamily",                      STRING,    INPUT_FONT_FAMILY                    )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "inputFontStyle",                       STRING,    INPUT_FONT_STYLE                     )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "inputFontStyle",                       MAP,       INPUT_FONT_STYLE                     )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "inputPointSize",                       FLOAT,     INPUT_POINT_SIZE                     )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "underline",                            STRING,    UNDERLINE                            )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "inputUnderline",                       STRING,    INPUT_UNDERLINE                      )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "shadow",                               STRING,    SHADOW                               )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "inputShadow",                          STRING,    INPUT_SHADOW                         )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "emboss",                               STRING,    EMBOSS                               )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "inputEmboss",                          STRING,    INPUT_EMBOSS                         )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "outline",                              STRING,    OUTLINE                              )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "inputOutline",                         STRING,    INPUT_OUTLINE                        )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "underline",                            MAP,       UNDERLINE                            )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "inputUnderline",                       MAP,       INPUT_UNDERLINE                      )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "shadow",                               MAP,       SHADOW                               )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "inputShadow",                          MAP,       INPUT_SHADOW                         )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "emboss",                               MAP,       EMBOSS                               )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "inputEmboss",                          MAP,       INPUT_EMBOSS                         )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "outline",                              MAP,       OUTLINE                              )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "inputOutline",                         MAP,       INPUT_OUTLINE                        )
 
 DALI_SIGNAL_REGISTRATION( Toolkit, TextField, "textChanged",        SIGNAL_TEXT_CHANGED )
 DALI_SIGNAL_REGISTRATION( Toolkit, TextField, "maxLengthReached",   SIGNAL_MAX_LENGTH_REACHED )
index 1114ad5..1d6af0f 100644 (file)
@@ -64,7 +64,7 @@ DALI_TYPE_REGISTRATION_BEGIN( Toolkit::TextLabel, Toolkit::Control, Create );
 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "renderingBackend",     INTEGER, RENDERING_BACKEND      )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "text",                 STRING,  TEXT                   )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "fontFamily",           STRING,  FONT_FAMILY            )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "fontStyle",            STRING,  FONT_STYLE             )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "fontStyle",            MAP,     FONT_STYLE             )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "pointSize",            FLOAT,   POINT_SIZE             )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "multiLine",            BOOLEAN, MULTI_LINE             )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "horizontalAlignment",  STRING,  HORIZONTAL_ALIGNMENT   )
@@ -81,10 +81,10 @@ DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollSpeed",      INTEGER,
 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollLoopCount",  INTEGER, AUTO_SCROLL_LOOP_COUNT )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollGap",        FLOAT,   AUTO_SCROLL_GAP        )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "lineSpacing",          FLOAT,   LINE_SPACING           )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underline",            STRING,  UNDERLINE              )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "shadow",               STRING,  SHADOW                 )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "emboss",               STRING,  EMBOSS                 )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "outline",              STRING,  OUTLINE                )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underline",            MAP,     UNDERLINE              )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "shadow",               MAP,     SHADOW                 )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "emboss",               MAP,     EMBOSS                 )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "outline",              MAP,     OUTLINE                )
 
 DALI_TYPE_REGISTRATION_END()
 
@@ -173,11 +173,11 @@ Property::Value TextLabel::GetProperty( BaseObject* object, Property::Index inde
           Vector4 color;
           bool offsetDefined = false;
           Vector2 offset;
-          const bool empty = Text::ParseProperties( value.Get<std::string>(),
-                                                    colorDefined,
-                                                    color,
-                                                    offsetDefined,
-                                                    offset );
+          const bool empty = Text::ParseShadowProperties( value.Get<Property::Map>(),
+                                                          colorDefined,
+                                                          color,
+                                                          offsetDefined,
+                                                          offset );
 
           if( !empty )
           {
@@ -191,11 +191,11 @@ Property::Value TextLabel::GetProperty( BaseObject* object, Property::Index inde
           Vector4 color;
           bool offsetDefined = false;
           Vector2 offset;
-          const bool empty = Text::ParseProperties( value.Get<std::string>(),
-                                                    colorDefined,
-                                                    color,
-                                                    offsetDefined,
-                                                    offset );
+          const bool empty = Text::ParseShadowProperties( value.Get<Property::Map>(),
+                                                          colorDefined,
+                                                          color,
+                                                          offsetDefined,
+                                                          offset );
 
           if( !empty )
           {
@@ -210,12 +210,12 @@ Property::Value TextLabel::GetProperty( BaseObject* object, Property::Index inde
           Vector4 color;
           bool heightDefined = false;
           float height = 0.f;
-          const bool empty = Text::ParseProperties( value.Get<std::string>(),
-                                                    enabled,
-                                                    colorDefined,
-                                                    color,
-                                                    heightDefined,
-                                                    height );
+          const bool empty = Text::ParseUnderlineProperties( value.Get<Property::Map>(),
+                                                             enabled,
+                                                             colorDefined,
+                                                             color,
+                                                             heightDefined,
+                                                             height );
 
           if( !empty )
           {
@@ -230,12 +230,12 @@ Property::Value TextLabel::GetProperty( BaseObject* object, Property::Index inde
           Vector4 color;
           bool heightDefined = false;
           float height = 0.f;
-          const bool empty = Text::ParseProperties( value.Get<std::string>(),
-                                                    enabled,
-                                                    colorDefined,
-                                                    color,
-                                                    heightDefined,
-                                                    height );
+          const bool empty = Text::ParseUnderlineProperties( value.Get<Property::Map>(),
+                                                             enabled,
+                                                             colorDefined,
+                                                             color,
+                                                             heightDefined,
+                                                             height );
 
           if( !empty && colorDefined )
           {
@@ -250,12 +250,12 @@ Property::Value TextLabel::GetProperty( BaseObject* object, Property::Index inde
           Vector4 color;
           bool heightDefined = false;
           float height = 0.f;
-          const bool empty = Text::ParseProperties( value.Get<std::string>(),
-                                                    enabled,
-                                                    colorDefined,
-                                                    color,
-                                                    heightDefined,
-                                                    height );
+          const bool empty = Text::ParseUnderlineProperties( value.Get<Property::Map>(),
+                                                             enabled,
+                                                             colorDefined,
+                                                             color,
+                                                             heightDefined,
+                                                             height );
 
           if( !empty && heightDefined )
           {
@@ -290,7 +290,7 @@ void TextLabel::OnInitialize()
   visualMap[Toolkit::TextVisual::Property::RENDERING_BACKEND] = static_cast<int>( DEFAULT_RENDERING_BACKEND );
 
   mVisual =  Toolkit::VisualFactory::Get().CreateVisual( visualMap );
-  RegisterVisual( Toolkit::TextLabel::Property::TEXT, self, mVisual );
+  RegisterVisual( Toolkit::TextLabel::Property::TEXT, mVisual );
 
   Internal::Visual::Base& visualBase = Toolkit::GetImplementation( mVisual );
   TextVisual* textVisual = static_cast<TextVisual*>( &visualBase );
index 2a0c81d..849e81b 100644 (file)
@@ -127,22 +127,11 @@ void EmbossFilter::Enable()
 
   mRootActor.Add( mActorForComposite );
 
-  Image dummyImage; // Dummy image, force creation of an image visual
-
-  InitializeVisual( mActorForComposite, mVisualForEmboss1, dummyImage );
+  InitializeVisual( mActorForComposite, mVisualForEmboss1, mImageForEmboss1 );
   Toolkit::GetImplementation( mVisualForEmboss1 ).SetCustomShader( customShader );
-
-  InitializeVisual( mActorForComposite, mVisualForEmboss2, dummyImage );
-  Toolkit::GetImplementation( mVisualForEmboss2 ).SetCustomShader( customShader );
-
-  TextureSet textureSet1 = TextureSet::New();
-  TextureSetImage( textureSet1, 0, mImageForEmboss1 );
-  mActorForComposite.GetRendererAt(0).SetTextures( textureSet1 );
   mActorForComposite.GetRendererAt(0).RegisterProperty( COLOR_UNIFORM_NAME, Color::BLACK );
-
-  TextureSet textureSet2 = TextureSet::New();
-  TextureSetImage( textureSet2, 0, mImageForEmboss2 );
-  mActorForComposite.GetRendererAt(1).SetTextures( textureSet2 );
+  InitializeVisual( mActorForComposite, mVisualForEmboss2, mImageForEmboss2 );
+  Toolkit::GetImplementation( mVisualForEmboss2 ).SetCustomShader( customShader );
   mActorForComposite.GetRendererAt(1).RegisterProperty( COLOR_UNIFORM_NAME, Color::WHITE );
 
   SetupCamera();
index dcb2901..6d2a022 100644 (file)
@@ -89,6 +89,7 @@ EventData::EventData( DecoratorPtr decorator )
   mGrabHandleEnabled( true ),
   mGrabHandlePopupEnabled( true ),
   mSelectionEnabled( true ),
+  mUpdateCursorHookPosition( false ),
   mUpdateCursorPosition( false ),
   mUpdateGrabHandlePosition( false ),
   mUpdateLeftSelectionPosition( false ),
index 083cf47..44302d7 100644 (file)
@@ -38,99 +38,86 @@ const std::string OFFSET_KEY( "offset" );
 const std::string HEIGHT_KEY( "height" );
 const std::string ENABLE_KEY( "enable" );
 const std::string TRUE_TOKEN( "true" );
+const std::string FALSE_TOKEN( "false" );
 }
 
-bool ParseProperties( const std::string& shadowProperties,
-                      bool& colorDefined,
-                      Vector4& color,
-                      bool& offsetDefined,
-                      Vector2& offset )
+bool ParseShadowProperties( const Property::Map& shadowPropertiesMap,
+                            bool& colorDefined,
+                            Vector4& color,
+                            bool& offsetDefined,
+                            Vector2& offset )
 {
-  // Parses and applies the style.
-  Property::Map map;
-  Text::ParsePropertyString( shadowProperties, map );
-
-  const bool empty = map.Empty();
+  const unsigned int numberOfItems = shadowPropertiesMap.Count();
 
-  if( !empty )
+  // Parses and applies the style.
+  for( unsigned int index = 0u; index < numberOfItems; ++index )
   {
-    /// Color key.
-    Property::Value* colorValue = map.Find( COLOR_KEY );
+    const KeyValuePair& valueGet = shadowPropertiesMap.GetKeyValue( index );
 
-    colorDefined = colorValue != NULL;
-    if( colorDefined )
+    if( COLOR_KEY == valueGet.first.stringKey )
     {
-      const std::string colorStr = colorValue->Get<std::string>();
+      /// Color key.
+      colorDefined = true;
+
+      const std::string colorStr = valueGet.second.Get<std::string>();
 
       Text::ColorStringToVector4( colorStr.c_str(), colorStr.size(), color );
     }
-
-    /// Offset key.
-    Property::Value* offsetValue = map.Find( OFFSET_KEY );
-
-    offsetDefined = offsetValue != NULL;
-    if( offsetDefined )
+    else if( OFFSET_KEY == valueGet.first.stringKey )
     {
-      const std::string offsetStr = offsetValue->Get<std::string>();
+      /// Offset key.
+      offsetDefined = true;
+
+      const std::string offsetStr = valueGet.second.Get<std::string>();
 
       StringToVector2( offsetStr.c_str(), offsetStr.size(), offset );
     }
   }
 
-  return empty;
+  return 0u == numberOfItems;
 }
 
-bool ParseProperties( const std::string& underlineProperties,
-                      bool& enabled,
-                      bool& colorDefined,
-                      Vector4& color,
-                      bool& heightDefined,
-                      float& height )
+bool ParseUnderlineProperties( const Property::Map& underlinePropertiesMap,
+                               bool& enabled,
+                               bool& colorDefined,
+                               Vector4& color,
+                               bool& heightDefined,
+                               float& height )
 {
-  // Parses and applies the style.
-  Property::Map map;
-  Text::ParsePropertyString( underlineProperties, map );
+  const unsigned int numberOfItems = underlinePropertiesMap.Count();
 
-  const bool empty = map.Empty();
-
-  if( !empty )
+  // Parses and applies the style.
+  for( unsigned int index = 0u; index < numberOfItems; ++index )
   {
-    /// Enable key.
-    Property::Value* enableValue = map.Find( ENABLE_KEY );
+    const KeyValuePair& valueGet = underlinePropertiesMap.GetKeyValue( index );
 
-    enabled = false;
-    const bool enabledDefined = enableValue != NULL;
-    if( enabledDefined )
+    if( ENABLE_KEY == valueGet.first.stringKey )
     {
-      const std::string enableStr = enableValue->Get<std::string>();
+      /// Enable key.
+      const std::string enableStr = valueGet.second.Get<std::string>();
       enabled = Text::TokenComparison( TRUE_TOKEN, enableStr.c_str(), enableStr.size() );
     }
-
-    /// Color key.
-    Property::Value* colorValue = map.Find( COLOR_KEY );
-
-    colorDefined = colorValue != NULL;
-    if( colorDefined )
+    else if( COLOR_KEY == valueGet.first.stringKey )
     {
-      const std::string colorStr = colorValue->Get<std::string>();
+      /// Color key.
+      colorDefined = true;
+
+      const std::string colorStr = valueGet.second.Get<std::string>();
 
       Text::ColorStringToVector4( colorStr.c_str(), colorStr.size(), color );
     }
-
-    /// Height key.
-    Property::Value* heightValue = map.Find( HEIGHT_KEY );
-
-    height = 0.f;
-    heightDefined = heightValue != NULL;
-    if( heightDefined )
+    else if( HEIGHT_KEY == valueGet.first.stringKey )
     {
-      const std::string heightStr = heightValue->Get<std::string>();
+      /// Height key.
+      heightDefined = true;
+
+      const std::string heightStr = valueGet.second.Get<std::string>();
 
       height = StringToFloat( heightStr.c_str() );
     }
   }
 
-  return empty;
+  return 0u == numberOfItems;
 }
 
 bool SetUnderlineProperties( ControllerPtr controller, const Property::Value& value, EffectStyle::Type type )
@@ -139,26 +126,26 @@ bool SetUnderlineProperties( ControllerPtr controller, const Property::Value& va
 
   if( controller )
   {
-    const std::string properties = value.Get<std::string>();
-
-    bool enabled = false;
-    bool colorDefined = false;
-    Vector4 color;
-    bool heightDefined = false;
-    float height = 0.f;
-
-    const bool empty = ParseProperties( properties,
-                                        enabled,
-                                        colorDefined,
-                                        color,
-                                        heightDefined,
-                                        height );
-
-    if( !empty )
+    switch( type )
     {
-      switch( type )
+      case EffectStyle::DEFAULT:
       {
-        case EffectStyle::DEFAULT:
+        const Property::Map& propertiesMap = value.Get<Property::Map>();
+
+        bool enabled = false;
+        bool colorDefined = false;
+        Vector4 color;
+        bool heightDefined = false;
+        float height = 0.f;
+
+        const bool empty = ParseUnderlineProperties( propertiesMap,
+                                                     enabled,
+                                                     colorDefined,
+                                                     color,
+                                                     heightDefined,
+                                                     height );
+
+        if( !empty )
         {
           if( enabled != controller->IsUnderlineEnabled() )
           {
@@ -178,21 +165,8 @@ bool SetUnderlineProperties( ControllerPtr controller, const Property::Value& va
             controller->SetUnderlineHeight( height );
             update = true;
           }
-          break;
         }
-        case EffectStyle::INPUT:
-        {
-          // Sets the input underline values.
-          // TODO: to be implemented.
-          break;
-        }
-      }
-    }
-    else
-    {
-      switch( type )
-      {
-        case EffectStyle::DEFAULT:
+        else
         {
           // Disable underline.
           if( controller->IsUnderlineEnabled() )
@@ -200,18 +174,18 @@ bool SetUnderlineProperties( ControllerPtr controller, const Property::Value& va
             controller->SetUnderlineEnabled( false );
             update = true;
           }
-          break;
-        }
-        case EffectStyle::INPUT:
-        {
-          // Sets the input underline values.
-          // TODO: to be implemented.
-          controller->SetInputUnderlineProperties( properties );
-          break;
         }
+        break;
       }
-    }
-  }
+      case EffectStyle::INPUT:
+      {
+        const std::string& underlineProperties = value.Get<std::string>();
+
+        controller->SetInputUnderlineProperties( underlineProperties );
+        break;
+      }
+    } // switch
+  } // if( controller )
 
   return update;
 }
@@ -228,19 +202,20 @@ void GetUnderlineProperties( ControllerPtr controller, Property::Value& value, E
         const Vector4& color = controller->GetUnderlineColor();
         const float height = controller->GetUnderlineHeight();
 
-        std::string underlineProperties = "{\"enable\":";
-        const std::string enabledStr = enabled ? "true" : "false";
-        underlineProperties += "\"" + enabledStr + "\",";
+        Property::Map map;
+
+        const std::string enabledStr = enabled ? TRUE_TOKEN : FALSE_TOKEN;
+        map.Insert( ENABLE_KEY, enabledStr );
 
         std::string colorStr;
         Vector4ToColorString( color, colorStr );
-        underlineProperties += "\"color\":\"" + colorStr + "\",";
+        map.Insert( COLOR_KEY, colorStr );
 
         std::string heightStr;
         FloatToString( height, heightStr );
-        underlineProperties += "\"height\":\"" + heightStr + "\"}";
+        map.Insert( HEIGHT_KEY, heightStr );
 
-        value = underlineProperties;
+        value = map;
         break;
       }
       case EffectStyle::INPUT:
@@ -258,24 +233,24 @@ bool SetShadowProperties( ControllerPtr controller, const Property::Value& value
 
   if( controller )
   {
-    const std::string properties = value.Get< std::string >();
+    switch( type )
+    {
+      case EffectStyle::DEFAULT:
+      {
+        const Property::Map& propertiesMap = value.Get<Property::Map>();
 
-    bool colorDefined = false;
-    Vector4 color;
-    bool offsetDefined = false;
-    Vector2 offset;
+        bool colorDefined = false;
+        Vector4 color;
+        bool offsetDefined = false;
+        Vector2 offset;
 
-    const bool empty = ParseProperties( properties,
-                                        colorDefined,
-                                        color,
-                                        offsetDefined,
-                                        offset );
+        const bool empty = ParseShadowProperties( propertiesMap,
+                                                  colorDefined,
+                                                  color,
+                                                  offsetDefined,
+                                                  offset );
 
-    if( !empty )
-    {
-      switch( type )
-      {
-        case EffectStyle::DEFAULT:
+        if( !empty )
         {
           // Sets the default shadow values.
           if( colorDefined && ( controller->GetShadowColor() != color ) )
@@ -289,39 +264,26 @@ bool SetShadowProperties( ControllerPtr controller, const Property::Value& value
             controller->SetShadowOffset( offset );
             update = true;
           }
-          break;
         }
-        case EffectStyle::INPUT:
-        {
-          // Sets the input shadow values.
-          // TODO: to be implemented.
-          break;
-        }
-      }
-    }
-    else
-    {
-      switch( type )
-      {
-        case EffectStyle::DEFAULT:
+        else
         {
           // Disable shadow.
           if( Vector2::ZERO != controller->GetShadowOffset() )
           {
             controller->SetShadowOffset( Vector2::ZERO );
           }
-          break;
-        }
-        case EffectStyle::INPUT:
-        {
-          // Sets the input shadow values.
-          // TODO: to be implemented.
-          controller->SetInputShadowProperties( properties );
-          break;
         }
+        break;
       }
-    }
-  }
+      case EffectStyle::INPUT:
+      {
+        const std::string& shadowString = value.Get<std::string>();
+
+        controller->SetInputShadowProperties( shadowString );
+        break;
+      }
+    } // switch
+  } // if( controller )
 
   return update;
 }
@@ -337,17 +299,17 @@ void GetShadowProperties( ControllerPtr controller, Property::Value& value, Effe
         const Vector4& color = controller->GetShadowColor();
         const Vector2& offset = controller->GetShadowOffset();
 
-        std::string shadowProperties = "{";
+        Property::Map map;
 
         std::string colorStr;
         Vector4ToColorString( color, colorStr );
-        shadowProperties += "\"color\":\"" + colorStr + "\",";
+        map.Insert( COLOR_KEY, colorStr );
 
         std::string offsetStr;
         Vector2ToString( offset, offsetStr );
-        shadowProperties += "\"offset\":\"" + offsetStr + "\"}";
+        map.Insert( OFFSET_KEY, offsetStr );
 
-        value = shadowProperties;
+        value = map;
         break;
       }
       case EffectStyle::INPUT:
index fb21fe9..4ab61a3 100644 (file)
@@ -42,32 +42,34 @@ namespace EffectStyle
 /**
  * @brief Parses the shadow properties.
  *
+ * @param[in] shadowProperties The map with the shadow properties.
  * @param[out] colorDefined Whether the shadow's color is defined.
  * @param[out] color The shadow's color.
  * @param[out] offsetDefined Whether the shadow's offset is defined.
  * @param[out] offset The shadow's offset.
  */
-bool ParseProperties( const std::string& shadowProperties,
-                      bool& colorDefined,
-                      Vector4& color,
-                      bool& offsetDefined,
-                      Vector2& offset );
+bool ParseShadowProperties( const Property::Map& shadowProperties,
+                            bool& colorDefined,
+                            Vector4& color,
+                            bool& offsetDefined,
+                            Vector2& offset );
 
 /**
  * @brief Parses the underline properties.
  *
+ * @param[in] underlineProperties The map with the underline properties.
  * @param[out] enabled Whether the underline is enabled.
  * @param[out] colorDefined Whether the underline's color is defined.
  * @param[out] color The underline's color.
  * @param[out] heightDefined Whether the underline's height is defined.
  * @param[out] height The underline's height.
  */
-bool ParseProperties( const std::string& underlineProperties,
-                      bool& enabled,
-                      bool& colorDefined,
-                      Vector4& color,
-                      bool& heightDefined,
-                      float& height );
+bool ParseUnderlineProperties( const Property::Map& underlineProperties,
+                               bool& enabled,
+                               bool& colorDefined,
+                               Vector4& color,
+                               bool& heightDefined,
+                               float& height );
 
 /**
  * @brief Sets the underline properties.
index b3b9e84..6a57337 100644 (file)
@@ -108,12 +108,17 @@ void SetFontStyleProperty( ControllerPtr controller, const Property::Value& valu
 {
   if( controller )
   {
-    const std::string style = value.Get< std::string >();
-    DALI_LOG_INFO( gLogFilter, Debug::General, "Text Control %p FONT_STYLE %s\n", controller.Get(), style.c_str() );
-
-    // Parses and applies the style.
     Property::Map map;
-    ParsePropertyString( style, map );
+    if( Property::STRING == value.GetType() )
+    {
+      const std::string& fontStyleProperties = value.Get<std::string>();
+
+      ParsePropertyString( fontStyleProperties, map );
+    }
+    else
+    {
+      map = value.Get<Property::Map>();
+    }
 
     if( !map.Empty() )
     {
@@ -289,76 +294,45 @@ void GetFontStyleProperty( ControllerPtr controller, Property::Value& value, Fon
       }
     }
 
-    if( weightDefined || widthDefined || slantDefined )
+    Property::Map map;
+
+    if( weightDefined )
     {
-      std::string styleString("{");
-      if( weightDefined )
+      if( TextAbstraction::FontWeight::NONE != weight )
       {
-        if( TextAbstraction::FontWeight::NONE != weight )
-        {
-          const std::string weightStr( GetEnumerationName( weight,
-                                                           FONT_WEIGHT_STRING_TABLE,
-                                                           FONT_WEIGHT_STRING_TABLE_COUNT ) );
+        const std::string weightStr( GetEnumerationName( weight,
+                                                         FONT_WEIGHT_STRING_TABLE,
+                                                         FONT_WEIGHT_STRING_TABLE_COUNT ) );
 
-          styleString += "\"weight\":\"" + weightStr + "\"";
-        }
-        else
-        {
-          weightDefined = false;
-        }
+        map.Insert( WEIGHT_KEY, weightStr );
       }
+    }
 
-      if( widthDefined )
+    if( widthDefined )
+    {
+      if( TextAbstraction::FontWidth::NONE != width )
       {
-        if( TextAbstraction::FontWidth::NONE != width )
-        {
-          const std::string widthStr( GetEnumerationName( width,
-                                                          FONT_WIDTH_STRING_TABLE,
-                                                          FONT_WIDTH_STRING_TABLE_COUNT ) );
+        const std::string widthStr( GetEnumerationName( width,
+                                                        FONT_WIDTH_STRING_TABLE,
+                                                        FONT_WIDTH_STRING_TABLE_COUNT ) );
 
-          if( weightDefined )
-          {
-            styleString += ",";
-          }
-          styleString += "\"width\":\"" + widthStr + "\"";
-        }
-        else
-        {
-          widthDefined = false;
-        }
+        map.Insert( WIDTH_KEY, widthStr );
       }
+    }
 
-      if( slantDefined )
+    if( slantDefined )
+    {
+      if( TextAbstraction::FontSlant::NONE != slant )
       {
-        if( TextAbstraction::FontSlant::NONE != slant )
-        {
-          const std::string slantStr( GetEnumerationName( slant,
-                                                          FONT_SLANT_STRING_TABLE,
-                                                          FONT_SLANT_STRING_TABLE_COUNT ) );
-
-          if( weightDefined || widthDefined )
-          {
-            styleString += ",";
-          }
-          styleString += "\"slant\":\"" + slantStr + "\"";
-        }
-        else
-        {
-          slantDefined = false;
-        }
-      }
+        const std::string slantStr( GetEnumerationName( slant,
+                                                        FONT_SLANT_STRING_TABLE,
+                                                        FONT_SLANT_STRING_TABLE_COUNT ) );
 
-      if( weightDefined || widthDefined || slantDefined )
-      {
-        styleString += "}";
+        map.Insert( SLANT_KEY, slantStr );
       }
-      else
-      {
-        styleString.clear();
-      }
-
-      value = styleString;
     }
+
+    value = map;
   }
 }
 
index 0203a13..3286712 100644 (file)
@@ -56,9 +56,24 @@ const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
   uniform mediump vec3 uSize;\n
   uniform mediump float borderSize;\n
   \n
+
+  //Visual size and offset
+  uniform mediump vec2 offset;\n
+  uniform mediump vec2 size;\n
+  uniform mediump vec4 offsetSizeMode;\n
+  uniform mediump vec2 origin;\n
+  uniform mediump vec2 anchorPoint;\n
+
+  vec2 ComputeVertexPosition()\n
+  {\n
+    vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw );\n
+    vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy);\n
+    return (aPosition + anchorPoint)*visualSize + (visualOffset + origin)*uSize.xy;\n
+  }\n
+
   void main()\n
   {\n
-    vec2 position = aPosition*uSize.xy + aDrift*borderSize;\n
+    vec2 position = ComputeVertexPosition() + aDrift*borderSize;\n
     gl_Position = uMvpMatrix * vec4(position, 0.0, 1.0);\n
   }\n
 );
@@ -177,6 +192,14 @@ Dali::Property::Value BorderVisual::DoGetProperty( Dali::Property::Index index )
   return Dali::Property::Value();
 }
 
+void BorderVisual::OnSetTransform()
+{
+  if( mImpl->mRenderer )
+  {
+    mImpl->mTransform.RegisterUniforms( mImpl->mRenderer, Direction::LEFT_TO_RIGHT );
+  }
+}
+
 void BorderVisual::InitializeRenderer()
 {
   Geometry geometry = mFactoryCache.GetGeometry( VisualFactoryCache::BORDER_GEOMETRY );
@@ -190,6 +213,9 @@ void BorderVisual::InitializeRenderer()
   Shader shader = GetBorderShader();
   mImpl->mRenderer = Renderer::New( geometry, shader  );
 
+  //Register transform properties
+  mImpl->mTransform.RegisterUniforms( mImpl->mRenderer, Direction::LEFT_TO_RIGHT );
+
 }
 
 void BorderVisual::SetBorderColor(const Vector4& color)
index 4f999b4..f982561 100644 (file)
@@ -99,6 +99,11 @@ protected:
    */
   virtual Dali::Property::Value DoGetProperty( Dali::Property::Index index );
 
+  /**
+   * @copydoc Visual::Base::OnSetTransform
+   */
+  virtual void OnSetTransform();
+
 public:
 
   /**
index 9ceed38..82c6254 100644 (file)
@@ -47,11 +47,24 @@ const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
   uniform mediump mat4 uMvpMatrix;\n
   uniform mediump vec3 uSize;\n
   \n
+
+  //Visual size and offset
+  uniform mediump vec2 offset;\n
+  uniform mediump vec2 size;\n
+  uniform mediump vec4 offsetSizeMode;\n
+  uniform mediump vec2 origin;\n
+  uniform mediump vec2 anchorPoint;\n
+
+  vec4 ComputeVertexPosition()\n
+  {\n
+    vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw );\n
+    vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy);\n
+    return vec4( (aPosition + anchorPoint)*visualSize + (visualOffset + origin)*uSize.xy, 0.0, 1.0 );\n
+  }\n
+
   void main()\n
   {\n
-    mediump vec4 vertexPosition = vec4(aPosition, 0.0, 1.0);\n
-    vertexPosition.xyz *= uSize;\n
-    gl_Position = uMvpMatrix * vertexPosition;\n
+    gl_Position = uMvpMatrix * ComputeVertexPosition();\n
   }\n
 );
 
@@ -132,6 +145,14 @@ Dali::Property::Value ColorVisual::DoGetProperty( Dali::Property::Index index )
   return Dali::Property::Value();
 }
 
+void ColorVisual::OnSetTransform()
+{
+  if( mImpl->mRenderer )
+  {
+    mImpl->mTransform.RegisterUniforms( mImpl->mRenderer, Direction::LEFT_TO_RIGHT );
+  }
+}
+
 void ColorVisual::InitializeRenderer()
 {
   Geometry geometry = mFactoryCache.GetGeometry( VisualFactoryCache::QUAD_GEOMETRY );
@@ -155,6 +176,9 @@ void ColorVisual::InitializeRenderer()
   {
     mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
   }
+
+  //Register transform properties
+  mImpl->mTransform.RegisterUniforms( mImpl->mRenderer, Direction::LEFT_TO_RIGHT );
 }
 
 void ColorVisual::SetColor(const Vector4& color)
index cf2b057..d2f3ebe 100644 (file)
@@ -103,6 +103,11 @@ protected:
    */
   virtual void DoSetOnStage( Actor& actor );
 
+  /**
+   * @copydoc Visual::Base::OnSetTransform
+   */
+  virtual void OnSetTransform();
+
 public:
 
   /**
index d6d90cb..e0ae085 100644 (file)
@@ -108,13 +108,27 @@ const char* VERTEX_SHADER[] =
   uniform mediump mat3 uAlignmentMatrix;\n
   varying mediump vec2 vTexCoord;\n
   \n
+
+  //Visual size and offset
+  uniform mediump vec2 offset;\n
+  uniform mediump vec2 size;\n
+  uniform mediump vec4 offsetSizeMode;\n
+  uniform mediump vec2 origin;\n
+  uniform mediump vec2 anchorPoint;\n
+
+  vec4 ComputeVertexPosition()\n
+  {\n
+    vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw );\n
+    vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy);\n
+    return vec4( (aPosition + anchorPoint)*visualSize + (visualOffset + origin)*uSize.xy, 0.0, 1.0 );\n
+  }\n
+
   void main()\n
   {\n
     mediump vec4 vertexPosition = vec4(aPosition, 0.0, 1.0);\n
     vTexCoord = (uAlignmentMatrix*vertexPosition.xyw).xy;\n
     \n
-    vertexPosition.xyz *= uSize;\n
-    gl_Position = uMvpMatrix * vertexPosition;\n
+    gl_Position = uMvpMatrix * ComputeVertexPosition();\n
   }\n
 ),
 
@@ -126,11 +140,26 @@ DALI_COMPOSE_SHADER(
   uniform mediump mat3 uAlignmentMatrix;\n
   varying mediump vec2 vTexCoord;\n
   \n
+
+  //Visual size and offset
+  uniform mediump vec2 offset;\n
+  uniform mediump vec2 size;\n
+  uniform mediump vec4 offsetSizeMode;\n
+  uniform mediump vec2 origin;\n
+  uniform mediump vec2 anchorPoint;\n
+
+  vec4 ComputeVertexPosition()\n
+  {\n
+    vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw );\n
+    vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy);\n
+    return vec4( (aPosition + anchorPoint)*visualSize + (visualOffset + origin)*uSize.xy, 0.0, 1.0 );\n
+  }\n
+
   void main()\n
   {\n
     mediump vec4 vertexPosition = vec4(aPosition, 0.0, 1.0);\n
     vertexPosition.xyz *= uSize;\n
-    gl_Position = uMvpMatrix * vertexPosition;\n
+    gl_Position = uMvpMatrix * ComputeVertexPosition();\n
     \n
     vTexCoord = (uAlignmentMatrix*vertexPosition.xyw).xy;\n
   }\n
@@ -229,6 +258,14 @@ void GradientVisual::DoSetProperties( const Property::Map& propertyMap )
   }
 }
 
+void GradientVisual::OnSetTransform()
+{
+  if( mImpl->mRenderer )
+  {
+    mImpl->mTransform.RegisterUniforms( mImpl->mRenderer, Direction::LEFT_TO_RIGHT );
+  }
+}
+
 void GradientVisual::SetSize( const Vector2& size )
 {
   Visual::Base::SetSize( size );
@@ -326,6 +363,9 @@ void GradientVisual::InitializeRenderer()
   mImpl->mRenderer.SetTextures( textureSet );
 
   mImpl->mRenderer.RegisterProperty( UNIFORM_ALIGNMENT_MATRIX_NAME, mGradientTransform );
+
+  //Register transform properties
+  mImpl->mTransform.RegisterUniforms( mImpl->mRenderer, Direction::LEFT_TO_RIGHT );
 }
 
 bool GradientVisual::NewGradient(Type gradientType, const Property::Map& propertyMap)
index f7f47ee..e4920d1 100644 (file)
@@ -134,6 +134,11 @@ protected:
   virtual void DoSetProperties( const Property::Map& propertyMap );
 
   /**
+   * @copydoc Visual::Base::OnSetTransform
+   */
+  virtual void OnSetTransform();
+
+  /**
    * @copydoc Visual::Base::DoSetOnStage
    */
   virtual void DoSetOnStage( Actor& actor );
index 2aba159..fe803b2 100644 (file)
@@ -88,13 +88,16 @@ const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
 
 } // unnamed namespace
 
-BatchImageVisualPtr BatchImageVisual::New( VisualFactoryCache& factoryCache )
+BatchImageVisualPtr BatchImageVisual::New( VisualFactoryCache& factoryCache, const std::string& url )
 {
-  return new BatchImageVisual( factoryCache );
+  BatchImageVisualPtr visual = new BatchImageVisual( factoryCache );
+  visual->mImageUrl = url;
+  return visual;
 }
 
 BatchImageVisual::BatchImageVisual( VisualFactoryCache& factoryCache )
 : Visual::Base( factoryCache ),
+  mImageUrl(""),
   mDesiredSize()
 {
 }
@@ -105,29 +108,23 @@ BatchImageVisual::~BatchImageVisual()
 
 void BatchImageVisual::DoSetProperties( const Property::Map& propertyMap )
 {
-  std::string oldImageUrl = mImageUrl;
-  Property::Value* imageURLValue = propertyMap.Find( Dali::Toolkit::ImageVisual::Property::URL, Dali::Toolkit::Internal::IMAGE_URL_NAME );
+  // url already passed in constructor
 
-  if( imageURLValue )
+  int desiredWidth = 0;
+  Property::Value* desiredWidthValue = propertyMap.Find( Dali::Toolkit::ImageVisual::Property::DESIRED_WIDTH, DESIRED_WIDTH );
+  if( desiredWidthValue )
   {
-    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 );
-    }
+    desiredWidthValue->Get( desiredWidth );
+  }
 
-    mDesiredSize = ImageDimensions( desiredWidth, desiredHeight );
+  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 );
 }
 
 void BatchImageVisual::SetSize( const Vector2& size )
index be84aab..d670c5d 100644 (file)
@@ -45,7 +45,7 @@ public:
    * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
    * @return A smart-pointer to the newly allocated visual.
    */
-  static BatchImageVisualPtr New( VisualFactoryCache& factoryCache );
+  static BatchImageVisualPtr New( VisualFactoryCache& factoryCache, const std::string& url );
 
 public:  // from Visual
 
index cbfa445..742f068 100644 (file)
@@ -105,12 +105,24 @@ const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
   uniform mediump vec4 pixelArea;
   varying mediump vec2 vTexCoord;\n
   \n
+
+  //Visual size and offset
+  uniform mediump vec2 offset;\n
+  uniform mediump vec2 size;\n
+  uniform mediump vec4 offsetSizeMode;\n
+  uniform mediump vec2 origin;\n
+  uniform mediump vec2 anchorPoint;\n
+
+  vec4 ComputeVertexPosition()\n
+  {\n
+    vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw );\n
+    vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy);\n
+    return vec4( (aPosition + anchorPoint)*visualSize + (visualOffset + origin)*uSize.xy, 0.0, 1.0 );\n
+  }\n
+
   void main()\n
   {\n
-    mediump vec4 vertexPosition = vec4(aPosition, 0.0, 1.0);\n
-    vertexPosition.xyz *= uSize;\n
-    vertexPosition = uMvpMatrix * vertexPosition;\n
-    \n
+    mediump vec4 vertexPosition = uMvpMatrix *ComputeVertexPosition();\n
     vTexCoord = pixelArea.xy+pixelArea.zw*(aPosition + vec2(0.5) );\n
     gl_Position = vertexPosition;\n
   }\n
@@ -189,11 +201,6 @@ Geometry CreateGeometry( VisualFactoryCache& factoryCache, ImageDimensions gridS
 
 } // unnamed namespace
 
-ImageVisualPtr ImageVisual::New( VisualFactoryCache& factoryCache )
-{
-  return new ImageVisual( factoryCache );
-}
-
 ImageVisualPtr ImageVisual::New( VisualFactoryCache& factoryCache,
                                  const std::string& imageUrl,
                                  ImageDimensions size,
@@ -208,21 +215,6 @@ ImageVisualPtr ImageVisual::New( VisualFactoryCache& factoryCache, const Image&
   return new ImageVisual( factoryCache, image );
 }
 
-ImageVisual::ImageVisual( VisualFactoryCache& factoryCache )
-: Visual::Base( factoryCache ),
-  mImage(),
-  mPixels(),
-  mPixelArea( FULL_TEXTURE_RECT ),
-  mPlacementActor(),
-  mImageUrl(),
-  mDesiredSize(),
-  mFittingMode( FittingMode::DEFAULT ),
-  mSamplingMode( SamplingMode::DEFAULT ),
-  mWrapModeU( WrapMode::DEFAULT ),
-  mWrapModeV( WrapMode::DEFAULT )
-{
-}
-
 ImageVisual::ImageVisual( VisualFactoryCache& factoryCache,
                           const std::string& imageUrl,
                           ImageDimensions size,
@@ -263,70 +255,61 @@ ImageVisual::~ImageVisual()
 
 void ImageVisual::DoSetProperties( const Property::Map& propertyMap )
 {
-  Property::Value* imageURLValue = propertyMap.Find( Toolkit::ImageVisual::Property::URL, IMAGE_URL_NAME );
-  if( imageURLValue )
+  // Url is already received in constructor
+  Property::Value* fittingValue = propertyMap.Find( Toolkit::ImageVisual::Property::FITTING_MODE, IMAGE_FITTING_MODE );
+  if( fittingValue )
   {
-    imageURLValue->Get( mImageUrl );
-    if( !mImageUrl.empty() )
-    {
-      mImage.Reset();
-    }
-
-    Property::Value* fittingValue = propertyMap.Find( Toolkit::ImageVisual::Property::FITTING_MODE, IMAGE_FITTING_MODE );
-    if( fittingValue )
-    {
-      int value;
-      Scripting::GetEnumerationProperty( *fittingValue, FITTING_MODE_TABLE, FITTING_MODE_TABLE_COUNT, value );
-      mFittingMode = Dali::FittingMode::Type( value );
-    }
-
-    Property::Value* samplingValue = propertyMap.Find( Toolkit::ImageVisual::Property::SAMPLING_MODE, IMAGE_SAMPLING_MODE );
-    if( samplingValue )
-    {
-      int value;
-      Scripting::GetEnumerationProperty( *samplingValue, SAMPLING_MODE_TABLE, SAMPLING_MODE_TABLE_COUNT, value );
-      mSamplingMode = Dali::SamplingMode::Type( value );
-    }
+    int value;
+    Scripting::GetEnumerationProperty( *fittingValue, FITTING_MODE_TABLE, FITTING_MODE_TABLE_COUNT, value );
+    mFittingMode = Dali::FittingMode::Type( value );
+  }
 
-    int desiredWidth = 0;
-    Property::Value* desiredWidthValue = propertyMap.Find( Toolkit::ImageVisual::Property::DESIRED_WIDTH, IMAGE_DESIRED_WIDTH );
-    if( desiredWidthValue )
-    {
-      desiredWidthValue->Get( desiredWidth );
-    }
+  Property::Value* samplingValue = propertyMap.Find( Toolkit::ImageVisual::Property::SAMPLING_MODE, IMAGE_SAMPLING_MODE );
+  if( samplingValue )
+  {
+    int value;
+    Scripting::GetEnumerationProperty( *samplingValue, SAMPLING_MODE_TABLE, SAMPLING_MODE_TABLE_COUNT, value );
+    mSamplingMode = Dali::SamplingMode::Type( value );
+  }
 
-    int desiredHeight = 0;
-    Property::Value* desiredHeightValue = propertyMap.Find( Toolkit::ImageVisual::Property::DESIRED_HEIGHT, IMAGE_DESIRED_HEIGHT );
-    if( desiredHeightValue )
-    {
-      desiredHeightValue->Get( desiredHeight );
-    }
+  int desiredWidth = 0;
+  Property::Value* desiredWidthValue = propertyMap.Find( Toolkit::ImageVisual::Property::DESIRED_WIDTH, IMAGE_DESIRED_WIDTH );
+  if( desiredWidthValue )
+  {
+    desiredWidthValue->Get( desiredWidth );
+  }
 
-    Property::Value* pixelAreaValue = propertyMap.Find( Toolkit::ImageVisual::Property::PIXEL_AREA, PIXEL_AREA_UNIFORM_NAME );
-    if( pixelAreaValue )
-    {
-      pixelAreaValue->Get( mPixelArea );
-    }
+  int desiredHeight = 0;
+  Property::Value* desiredHeightValue = propertyMap.Find( Toolkit::ImageVisual::Property::DESIRED_HEIGHT, IMAGE_DESIRED_HEIGHT );
+  if( desiredHeightValue )
+  {
+    desiredHeightValue->Get( desiredHeight );
+  }
 
-    Property::Value* wrapModeValueU = propertyMap.Find( Toolkit::ImageVisual::Property::WRAP_MODE_U, IMAGE_WRAP_MODE_U );
-    if( wrapModeValueU )
-    {
-      int value;
-      Scripting::GetEnumerationProperty( *wrapModeValueU, WRAP_MODE_TABLE, WRAP_MODE_TABLE_COUNT, value );
-      mWrapModeU = Dali::WrapMode::Type( value );
-    }
+  Property::Value* pixelAreaValue = propertyMap.Find( Toolkit::ImageVisual::Property::PIXEL_AREA, PIXEL_AREA_UNIFORM_NAME );
+  if( pixelAreaValue )
+  {
+    pixelAreaValue->Get( mPixelArea );
+  }
 
-    Property::Value* wrapModeValueV = propertyMap.Find( Toolkit::ImageVisual::Property::WRAP_MODE_V, IMAGE_WRAP_MODE_V );
-    if( wrapModeValueV )
-    {
-      int value;
-      Scripting::GetEnumerationProperty( *wrapModeValueV, WRAP_MODE_TABLE, WRAP_MODE_TABLE_COUNT, value );
-      mWrapModeV = Dali::WrapMode::Type( value );
-    }
+  Property::Value* wrapModeValueU = propertyMap.Find( Toolkit::ImageVisual::Property::WRAP_MODE_U, IMAGE_WRAP_MODE_U );
+  if( wrapModeValueU )
+  {
+    int value;
+    Scripting::GetEnumerationProperty( *wrapModeValueU, WRAP_MODE_TABLE, WRAP_MODE_TABLE_COUNT, value );
+    mWrapModeU = Dali::WrapMode::Type( value );
+  }
 
-    mDesiredSize = ImageDimensions( desiredWidth, desiredHeight );
+  Property::Value* wrapModeValueV = propertyMap.Find( Toolkit::ImageVisual::Property::WRAP_MODE_V, IMAGE_WRAP_MODE_V );
+  if( wrapModeValueV )
+  {
+    int value;
+    Scripting::GetEnumerationProperty( *wrapModeValueV, WRAP_MODE_TABLE, WRAP_MODE_TABLE_COUNT, value );
+    mWrapModeV = Dali::WrapMode::Type( value );
   }
 
+  mDesiredSize = ImageDimensions( desiredWidth, desiredHeight );
+
   Property::Value* syncLoading = propertyMap.Find( Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING, SYNCHRONOUS_LOADING );
   if( syncLoading )
   {
@@ -337,7 +320,7 @@ void ImageVisual::DoSetProperties( const Property::Map& propertyMap )
       mImpl->mFlags |= Impl::IS_SYNCHRONOUS_RESOURCE_LOADING;
       // if sync loading is required, the loading should start immediately when new image url is set or the actor is off stage
       // ( for on-stage actor with image url unchanged, resource loading is already finished)
-      if( imageURLValue )
+      if( mImageUrl.size() > 0u )
       {
         LoadResourceSynchronously();
       }
@@ -409,6 +392,9 @@ void ImageVisual::CreateRenderer( TextureSet& textures )
   mImpl->mRenderer = Renderer::New( geometry, shader );
   DALI_ASSERT_DEBUG( textures );
   mImpl->mRenderer.SetTextures( textures );
+
+  //Register transform properties
+  mImpl->mTransform.RegisterUniforms( mImpl->mRenderer, Direction::LEFT_TO_RIGHT );
 }
 
 void ImageVisual::CreateNativeImageRenderer( NativeImage& nativeImage )
@@ -457,6 +443,9 @@ void ImageVisual::CreateNativeImageRenderer( NativeImage& nativeImage )
   }
 
   mImpl->mRenderer = Renderer::New( geometry, shader );
+
+  //Register transform properties
+  mImpl->mTransform.RegisterUniforms( mImpl->mRenderer, Direction::LEFT_TO_RIGHT );
 }
 
 
@@ -533,13 +522,9 @@ TextureSet ImageVisual::CreateTextureSet( Vector4& textureRect, const std::strin
 
 void ImageVisual::InitializeRenderer( const std::string& imageUrl )
 {
-  if( imageUrl.empty() )
-  {
-    return;
-  }
+  mImpl->mRenderer.Reset();
 
   mImageUrl = imageUrl;
-  mImpl->mRenderer.Reset();
   mImpl->mFlags &= ~Impl::IS_ATLASING_APPLIED;
 
   if( !mImpl->mCustomShader &&
@@ -547,7 +532,14 @@ void ImageVisual::InitializeRenderer( const std::string& imageUrl )
       ( strncasecmp( imageUrl.c_str(), HTTPS_URL, sizeof(HTTPS_URL) -1 ) != 0 ) )
   {
     bool defaultWrapMode = mWrapModeU <= WrapMode::CLAMP_TO_EDGE && mWrapModeV <= WrapMode::CLAMP_TO_EDGE;
-    bool cacheable =  defaultWrapMode &&  mPixelArea == FULL_TEXTURE_RECT;
+    bool defaultTransform = mImpl->mTransform.mSize == Vector2::ONE &&
+                            mImpl->mTransform.mOffset == Vector2::ZERO &&
+                            mImpl->mTransform.mOffsetSizeMode == Vector4::ZERO &&
+                            mImpl->mTransform.mOrigin == Toolkit::Align::CENTER &&
+                            mImpl->mTransform.mAnchorPoint == Toolkit::Align::CENTER;
+
+    bool cacheable =  defaultWrapMode && defaultTransform &&  mPixelArea == FULL_TEXTURE_RECT;
+
 
     mImpl->mFlags &= ~Impl::IS_FROM_CACHE;
     if( cacheable ) // fetch the renderer from cache if exist
@@ -595,6 +587,7 @@ void ImageVisual::InitializeRenderer( const std::string& imageUrl )
 void ImageVisual::InitializeRenderer( const Image& image )
 {
   mImpl->mFlags &= ~Impl::IS_FROM_CACHE;
+  mImpl->mRenderer.Reset();
 
   // don't reuse CreateTextureSet
   TextureSet textures = TextureSet::New();
@@ -611,11 +604,7 @@ void ImageVisual::InitializeRenderer( const Image& image )
     // reuse existing code for regular images
     CreateRenderer( textures );
   }
-
-  if( image )
-  {
-    ApplyImageToSampler( image );
-  }
+  ApplyImageToSampler( image );
 }
 
 void ImageVisual::UploadCompleted()
@@ -632,17 +621,22 @@ void ImageVisual::UploadCompleted()
 
 void ImageVisual::DoSetOnStage( Actor& actor )
 {
-  mPlacementActor = actor;
-
   if( !mImageUrl.empty() )
   {
     InitializeRenderer( mImageUrl );
   }
-  else
+  else if ( mImage )
   {
     InitializeRenderer( mImage );
   }
 
+  if ( !mImpl->mRenderer)
+  {
+    return;
+  }
+
+  mPlacementActor = actor;
+
   if( mPixelArea != FULL_TEXTURE_RECT )
   {
     mImpl->mRenderer.RegisterProperty( PIXEL_AREA_UNIFORM_NAME, mPixelArea );
@@ -657,18 +651,17 @@ void ImageVisual::DoSetOnStage( Actor& actor )
 
 void ImageVisual::DoSetOffStage( Actor& actor )
 {
+  // Visual::Base::SetOffStage only calls DoSetOffStage if mRenderer exists (is on onstage)
+
   //If we own the image then make sure we release it when we go off stage
+  actor.RemoveRenderer( mImpl->mRenderer);
   if( !mImageUrl.empty() )
   {
-    actor.RemoveRenderer( mImpl->mRenderer );
     CleanCache(mImageUrl);
     mImage.Reset();
   }
-  else
-  {
-    actor.RemoveRenderer( mImpl->mRenderer );
-    mImpl->mRenderer.Reset();
-  }
+
+  mImpl->mRenderer.Reset();
   mPlacementActor.Reset();
 }
 
@@ -716,6 +709,14 @@ Dali::Property::Value ImageVisual::DoGetProperty( Dali::Property::Index index )
   return Dali::Property::Value();
 }
 
+void ImageVisual::OnSetTransform()
+{
+  if( mImpl->mRenderer )
+  {
+    mImpl->mTransform.RegisterUniforms( mImpl->mRenderer, Direction::LEFT_TO_RIGHT );
+  }
+}
+
 Shader ImageVisual::GetImageShader( VisualFactoryCache& factoryCache, bool atlasing, bool defaultTextureWrapping )
 {
   Shader shader;
index c2eca0e..7ad511f 100644 (file)
@@ -80,14 +80,6 @@ class ImageVisual: public Visual::Base, public ConnectionTracker, public AtlasUp
 public:
 
   /**
-   * @brief Create a new image visual.
-   *
-   * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
-   * @return A smart-pointer to the newly allocated visual.
-   */
-  static ImageVisualPtr New( VisualFactoryCache& factoryCache );
-
-  /**
    * @brief Create a new image visual with a URL.
    *
    * The visual will load the Image asynchronously when the associated actor is put on stage, and destroy the image when it is off stage
@@ -137,13 +129,6 @@ public:  // from Visual
 protected:
 
   /**
-   * @brief Constructor.
-   *
-   * @param[in] factoryCache The VisualFactoryCache object
-   */
-  ImageVisual( VisualFactoryCache& factoryCache );
-
-  /**
    * @brief Constructor with a URL.
    *
    * The visual will load the Image asynchronously when the associated actor is put on stage, and destroy the image when it is off stage
@@ -188,6 +173,11 @@ protected:
    */
   virtual void DoSetOffStage( Actor& actor );
 
+  /**
+   * @copydoc Visual::Base::OnSetTransform
+   */
+  virtual void OnSetTransform();
+
 public:
 
   /**
index 761f1e0..3384976 100644 (file)
@@ -30,6 +30,7 @@
 //INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/visual-factory/devel-visual-properties.h>
 #include <dali-toolkit/internal/visuals/visual-base-data-impl.h>
+#include <dali-toolkit/internal/visuals/visual-string-constants.h>
 
 namespace Dali
 {
@@ -120,9 +121,26 @@ const char* SIMPLE_VERTEX_SHADER = DALI_COMPOSE_SHADER(
   uniform mediump vec3 lightPosition;\n
   uniform mediump vec2 uStageOffset;\n
 
+  //Visual size and offset
+  uniform mediump vec2 offset;\n
+  uniform mediump vec2 size;\n
+  uniform mediump vec4 offsetSizeMode;\n
+  uniform mediump vec2 origin;\n
+  uniform mediump vec2 anchorPoint;\n
+
+  vec4 ComputeVertexPosition()\n
+  {\n
+    vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw );\n
+    float scaleFactor = min( visualSize.x, visualSize.y );\n
+    vec3 originFlipY =  vec3(origin.x, -origin.y, 0.0);
+    vec3 anchorPointFlipY = vec3( anchorPoint.x, -anchorPoint.y, 0.0);
+    vec3 offset = vec3( ( offset / uSize.xy ) * offsetSizeMode.xy + offset * (1.0-offsetSizeMode.xy), 0.0) * vec3(1.0,-1.0,1.0);\n
+    return vec4( (aPosition + anchorPointFlipY)*scaleFactor + (offset + originFlipY)*uSize, 1.0 );\n
+  }\n
+
   void main()\n
   {\n
-    vec4 normalisedVertexPosition = vec4( aPosition * min( uSize.x, uSize.y ), 1.0 );\n
+    vec4 normalisedVertexPosition = ComputeVertexPosition();\n
     vec4 vertexPosition = uObjectMatrix * normalisedVertexPosition;\n
     vertexPosition = uMvpMatrix * vertexPosition;\n
 
@@ -170,9 +188,26 @@ const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
   uniform mediump vec3 lightPosition;\n
   uniform mediump vec2 uStageOffset;\n
 
+  //Visual size and offset
+  uniform mediump vec2 offset;\n
+  uniform mediump vec2 size;\n
+  uniform mediump vec4 offsetSizeMode;\n
+  uniform mediump vec2 origin;\n
+  uniform mediump vec2 anchorPoint;\n
+
+  vec4 ComputeVertexPosition()\n
+  {\n
+    vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw );\n
+    float scaleFactor = min( visualSize.x, visualSize.y );\n
+    vec3 originFlipY =  vec3(origin.x, -origin.y, 0.0);
+    vec3 anchorPointFlipY = vec3( anchorPoint.x, -anchorPoint.y, 0.0);
+    vec3 offset = vec3( ( offset / uSize.xy ) * offsetSizeMode.xy + offset * (1.0-offsetSizeMode.xy), 0.0) * vec3(1.0,-1.0,1.0);\n
+    return vec4( (aPosition + anchorPointFlipY)*scaleFactor + (offset + originFlipY)*uSize, 1.0 );\n
+  }\n
+
   void main()
   {\n
-    vec4 normalisedVertexPosition = vec4( aPosition * min( uSize.x, uSize.y ), 1.0 );\n
+    vec4 normalisedVertexPosition = ComputeVertexPosition();\n
     vec4 vertexPosition = uObjectMatrix * normalisedVertexPosition;\n
     vertexPosition = uMvpMatrix * vertexPosition;\n
 
@@ -233,9 +268,27 @@ const char* NORMAL_MAP_VERTEX_SHADER = DALI_COMPOSE_SHADER(
   uniform mediump mat4 uObjectMatrix;\n
   uniform mediump vec3 lightPosition;\n
   uniform mediump vec2 uStageOffset;\n
+
+  //Visual size and offset
+  uniform mediump vec2 offset;\n
+  uniform mediump vec2 size;\n
+  uniform mediump vec4 offsetSizeMode;\n
+  uniform mediump vec2 origin;\n
+  uniform mediump vec2 anchorPoint;\n
+
+  vec4 ComputeVertexPosition()\n
+  {\n
+    vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw );\n
+    float scaleFactor = min( visualSize.x, visualSize.y );\n
+    vec3 originFlipY =  vec3(origin.x, -origin.y, 0.0);
+    vec3 anchorPointFlipY = vec3( anchorPoint.x, -anchorPoint.y, 0.0);
+    vec3 offset = vec3( ( offset / uSize.xy ) * offsetSizeMode.xy + offset * (1.0-offsetSizeMode.xy), 0.0) * vec3(1.0,-1.0,1.0);\n
+    return vec4( (aPosition + anchorPointFlipY)*scaleFactor + (offset + originFlipY)*uSize, 1.0 );\n
+  }\n
+
   void main()
   {\n
-    vec4 normalisedVertexPosition = vec4( aPosition * min( uSize.x, uSize.y ), 1.0 );\n
+    vec4 normalisedVertexPosition = ComputeVertexPosition();\n
     vec4 vertexPosition = uObjectMatrix * normalisedVertexPosition;\n
     vertexPosition = uMvpMatrix * vertexPosition;\n
 
@@ -368,6 +421,14 @@ void MeshVisual::DoSetProperties( const Property::Map& propertyMap )
   }
 }
 
+void MeshVisual::OnSetTransform()
+{
+  if( mImpl->mRenderer )
+  {
+    mImpl->mTransform.RegisterUniforms( mImpl->mRenderer, Direction::LEFT_TO_RIGHT );
+  }
+}
+
 void MeshVisual::SetSize( const Vector2& size )
 {
   Visual::Base::SetSize( size );
@@ -445,6 +506,9 @@ void MeshVisual::InitializeRenderer()
   mImpl->mRenderer.SetTextures( mTextureSet );
   mImpl->mRenderer.SetProperty( Renderer::Property::DEPTH_WRITE_MODE, DepthWriteMode::ON );
   mImpl->mRenderer.SetProperty( Renderer::Property::DEPTH_TEST_MODE, DepthTestMode::ON );
+
+  //Register transform properties
+  mImpl->mTransform.RegisterUniforms( mImpl->mRenderer, Direction::LEFT_TO_RIGHT );
 }
 
 void MeshVisual::SupplyEmptyGeometry()
index 4c0441a..2e3772c 100644 (file)
@@ -109,6 +109,11 @@ protected:
   virtual void DoSetProperties( const Property::Map& propertyMap );
 
   /**
+   * @copydoc Visual::Base::OnSetTransform
+   */
+  virtual void OnSetTransform();
+
+  /**
    * @copydoc Visual::Base::DoSetOnStage
    */
   virtual void DoSetOnStage( Actor& actor );
index b67fb18..a4cf8c0 100644 (file)
@@ -24,7 +24,7 @@
 #include <dali/public-api/images/resource-image.h>
 #include <dali/devel-api/images/texture-set-image.h>
 
-// INTERNAL IINCLUDES
+// INTERNAL INCLUDES
 #include <dali-toolkit/public-api/visuals/image-visual-properties.h>
 #include <dali-toolkit/devel-api/visual-factory/devel-visual-properties.h>
 #include <dali-toolkit/internal/visuals/visual-factory-impl.h>
@@ -55,6 +55,14 @@ const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
   uniform mediump vec2 uNinePatchFactorsX[ FACTOR_SIZE_X ];\n
   uniform mediump vec2 uNinePatchFactorsY[ FACTOR_SIZE_Y ];\n
   \n
+
+  //Visual size and offset
+  uniform mediump vec2 offset;\n
+  uniform mediump vec2 size;\n
+  uniform mediump vec4 offsetSizeMode;\n
+  uniform mediump vec2 origin;\n
+  uniform mediump vec2 anchorPoint;\n
+
   void main()\n
   {\n
     mediump vec2 fixedFactor  = vec2( uNinePatchFactorsX[ int( ( aPosition.x + 1.0 ) * 0.5 ) ].x, uNinePatchFactorsY[ int( ( aPosition.y + 1.0 ) * 0.5 ) ].x );\n
@@ -63,8 +71,13 @@ const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
     mediump vec2 fixedTotal   = vec2( uNinePatchFactorsX[ FACTOR_SIZE_X - 1 ].x, uNinePatchFactorsY[ FACTOR_SIZE_Y - 1 ].x );\n
     mediump vec2 stretchTotal = vec2( uNinePatchFactorsX[ FACTOR_SIZE_X - 1 ].y, uNinePatchFactorsY[ FACTOR_SIZE_Y - 1 ].y );\n
     \n
-    mediump vec4 vertexPosition = vec4( ( fixedFactor + ( uSize.xy - fixedTotal ) * stretch / stretchTotal ), 0.0, 1.0 );\n
-    vertexPosition.xy -= uSize.xy * vec2( 0.5, 0.5 );\n
+
+    vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw );\n
+    vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy);\n
+
+    mediump vec4 vertexPosition = vec4( ( fixedFactor + ( visualSize.xy - fixedTotal ) * stretch / stretchTotal ) +  anchorPoint*visualSize + (visualOffset + origin)*uSize.xy, 0.0, 1.0 );\n
+    vertexPosition.xy -= visualSize.xy * vec2( 0.5, 0.5 );\n
+
     vertexPosition = uMvpMatrix * vertexPosition;\n
     \n
     vTexCoord = ( fixedFactor + stretch ) / ( fixedTotal + stretchTotal );\n
@@ -82,18 +95,29 @@ const char* VERTEX_SHADER_3X3 = DALI_COMPOSE_SHADER(
     uniform mediump vec2 uFixed[ 3 ];\n
     uniform mediump vec2 uStretchTotal;\n
     \n
+
+    //Visual size and offset
+    uniform mediump vec2 offset;\n
+    uniform mediump vec2 size;\n
+    uniform mediump vec4 offsetSizeMode;\n
+    uniform mediump vec2 origin;\n
+    uniform mediump vec2 anchorPoint;\n
+
     void main()\n
     {\n
+      vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw );\n
+      vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy);\n
+
       mediump vec2 scale        = vec2( length( uModelMatrix[ 0 ].xyz ), length( uModelMatrix[ 1 ].xyz ) );\n
-      mediump vec2 size         = uSize.xy * scale;\n
+      mediump vec2 size         = visualSize.xy * scale;\n
       \n
       mediump vec2 fixedFactor  = vec2( uFixed[ int( ( aPosition.x + 1.0 ) * 0.5 ) ].x, uFixed[ int( ( aPosition.y  + 1.0 ) * 0.5 ) ].y );\n
       mediump vec2 stretch      = floor( aPosition * 0.5 );\n
       mediump vec2 fixedTotal   = uFixed[ 2 ];\n
       \n
-      mediump vec4 vertexPosition = vec4( fixedFactor + ( size - fixedTotal ) * stretch, 0.0, 1.0 );\n
+      mediump vec4 vertexPosition = vec4( fixedFactor + ( size - fixedTotal ) * stretch, 0.0, 1.0 );
       vertexPosition.xy -= size * vec2( 0.5, 0.5 );\n
-      vertexPosition.xy =  vertexPosition.xy / scale;\n
+      vertexPosition.xy =  vertexPosition.xy / scale + anchorPoint*size + (visualOffset + origin)*uSize.xy;\
       \n
       vertexPosition = uMvpMatrix * vertexPosition;\n
       \n
@@ -201,14 +225,9 @@ void RegisterStretchProperties( Renderer& renderer, const char * uniformName, co
 
 /////////////////NPatchVisual////////////////
 
-NPatchVisualPtr NPatchVisual::New( VisualFactoryCache& factoryCache )
+NPatchVisualPtr NPatchVisual::New( VisualFactoryCache& factoryCache, const std::string& imageUrl )
 {
-  return new NPatchVisual( factoryCache );
-}
-
-NPatchVisualPtr NPatchVisual::New( VisualFactoryCache& factoryCache, const std::string& imageUrl, bool borderOnly )
-{
-  NPatchVisual* nPatchVisual = new NPatchVisual( factoryCache, borderOnly );
+  NPatchVisual* nPatchVisual = new NPatchVisual( factoryCache );
   nPatchVisual->mImageUrl = imageUrl;
 
   NinePatchImage image = NinePatchImage::New( imageUrl );
@@ -217,9 +236,9 @@ NPatchVisualPtr NPatchVisual::New( VisualFactoryCache& factoryCache, const std::
   return nPatchVisual;
 }
 
-NPatchVisualPtr NPatchVisual::New( VisualFactoryCache& factoryCache, NinePatchImage image, bool borderOnly )
+NPatchVisualPtr NPatchVisual::New( VisualFactoryCache& factoryCache, NinePatchImage image )
 {
-  NPatchVisual* nPatchVisual = new NPatchVisual( factoryCache, borderOnly );
+  NPatchVisual* nPatchVisual = new NPatchVisual( factoryCache );
   nPatchVisual->mImage = image;
 
   nPatchVisual->InitializeFromImage( image );
@@ -227,7 +246,7 @@ NPatchVisualPtr NPatchVisual::New( VisualFactoryCache& factoryCache, NinePatchIm
   return nPatchVisual;
 }
 
-NPatchVisual::NPatchVisual( VisualFactoryCache& factoryCache, bool borderOnly )
+NPatchVisual::NPatchVisual( VisualFactoryCache& factoryCache )
 : Visual::Base( factoryCache ),
   mImage(),
   mCroppedImage(),
@@ -235,7 +254,7 @@ NPatchVisual::NPatchVisual( VisualFactoryCache& factoryCache, bool borderOnly )
   mStretchPixelsX(),
   mStretchPixelsY(),
   mImageSize(),
-  mBorderOnly( borderOnly )
+  mBorderOnly( false )
 {
 }
 
@@ -245,26 +264,12 @@ NPatchVisual::~NPatchVisual()
 
 void NPatchVisual::DoSetProperties( const Property::Map& propertyMap )
 {
-  Property::Value* imageURLValue = propertyMap.Find( Toolkit::ImageVisual::Property::URL, IMAGE_URL_NAME );
-  if( imageURLValue )
+  // URL is already passed in via constructor
+  //Read the borderOnly property first since InitialiseFromImage relies on mBorderOnly to be properly set
+  Property::Value* borderOnlyValue = propertyMap.Find( Toolkit::ImageVisual::Property::BORDER_ONLY, BORDER_ONLY );
+  if( borderOnlyValue )
   {
-    //Read the borderOnly property first since InitialiseFromImage relies on mBorderOnly to be properly set
-    Property::Value* borderOnlyValue = propertyMap.Find( Toolkit::ImageVisual::Property::BORDER_ONLY, BORDER_ONLY );
-    if( borderOnlyValue )
-    {
-      borderOnlyValue->Get( mBorderOnly );
-    }
-
-    if( imageURLValue->Get( mImageUrl ) )
-    {
-      NinePatchImage nPatch = NinePatchImage::New( mImageUrl );
-      InitializeFromImage( nPatch );
-    }
-    else
-    {
-      InitializeFromBrokenImage();
-      DALI_LOG_ERROR( "The property '%s' is not a string\n", IMAGE_URL_NAME );
-    }
+    borderOnlyValue->Get( mBorderOnly );
   }
 }
 
@@ -387,6 +392,9 @@ void NPatchVisual::InitializeRenderer()
   TextureSet textureSet = TextureSet::New();
   mImpl->mRenderer = Renderer::New( geometry, shader );
   mImpl->mRenderer.SetTextures( textureSet );
+
+  //Register transform properties
+  mImpl->mTransform.RegisterUniforms( mImpl->mRenderer, Direction::LEFT_TO_RIGHT );
 }
 
 
@@ -449,6 +457,15 @@ Dali::Property::Value NPatchVisual::DoGetProperty( Dali::Property::Index index )
   return Dali::Property::Value();
 }
 
+void NPatchVisual::OnSetTransform()
+{
+  if( mImpl->mRenderer )
+  {
+    mImpl->mTransform.RegisterUniforms( mImpl->mRenderer, Direction::LEFT_TO_RIGHT );
+  }
+}
+
+
 void NPatchVisual::ChangeRenderer( bool oldBorderOnly, size_t oldGridX, size_t oldGridY )
 {
   //check to see if the border style has changed
index b3210b9..b3d2815 100644 (file)
@@ -58,32 +58,22 @@ class NPatchVisual: public Visual::Base
 public:
 
   /**
-   * @brief Create a new n-patch visual.
-   *
-   * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
-   * @return A smart-pointer to the newly allocated visual.
-   */
-  static NPatchVisualPtr New( VisualFactoryCache& factoryCache );
-
-  /**
    * @brief Create an N-patch visual using an image URL.
    *
    * The visual will load the image synchronously when the associated actor is put on stage, and destroy the image when it is off stage
    *
    * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
    * @param[in] imageUrl The URL to 9 patch image resource to use
-   * @param[in] borderOnly A Flag to indicate if the image should omit the centre of the n-patch and only render the border
    */
-  static NPatchVisualPtr New( VisualFactoryCache& factoryCache, const std::string& imageUrl, bool borderOnly = false );
+  static NPatchVisualPtr New( VisualFactoryCache& factoryCache, const std::string& imageUrl );
 
   /**
    * @brief Create an N-patch visual with a NinePatchImage resource.
    *
    * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
    * @param[in] image The NinePatchImage to use
-   * @param[in] borderOnly A Flag to indicate if the image should omit the centre of the n-patch and only render the border
    */
-  static NPatchVisualPtr New( VisualFactoryCache& factoryCache, NinePatchImage image, bool borderOnly = false );
+  static NPatchVisualPtr New( VisualFactoryCache& factoryCache, NinePatchImage image );
 
 public:  // from Visual
 
@@ -112,10 +102,9 @@ protected:
   /**
    * @brief Constructor.
    *
-   * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
-   * @param[in] borderOnly A Flag to indicate if the image should omit the centre of the n-patch and only render the border
+   * @param[in] factoryCache Reference to the VisualFactoryCache object
    */
-  NPatchVisual( VisualFactoryCache& factoryCache, bool borderOnly = false );
+  NPatchVisual( VisualFactoryCache& factoryCache );
 
   /**
    * @brief A reference counted object may only be deleted by calling Unreference().
@@ -137,6 +126,11 @@ protected:
    */
   virtual void DoSetOffStage( Actor& actor );
 
+  /**
+   * @copydoc Visual::Base::OnSetTransform
+   */
+  virtual void OnSetTransform();
+
 private:
 
   /**
index bc60560..8285561 100644 (file)
@@ -28,6 +28,7 @@
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/visual-factory/devel-visual-properties.h>
 #include <dali-toolkit/internal/visuals/visual-base-data-impl.h>
+#include <dali-toolkit/internal/visuals/visual-string-constants.h>
 
 namespace Dali
 {
@@ -122,13 +123,26 @@ const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
   uniform   mediump vec3 lightPosition;\n
   uniform   mediump vec2 uStageOffset;\n
 
-  void main()\n
+  //Visual size and offset
+  uniform mediump vec2 offset;\n
+  uniform mediump vec2 size;\n
+  uniform mediump vec4 offsetSizeMode;\n
+  uniform mediump vec2 origin;\n
+  uniform mediump vec2 anchorPoint;\n
+
+  vec4 ComputeVertexPosition()\n
   {\n
-    float xRatio = uSize.x / uObjectDimensions.x;\n
-    float yRatio = uSize.y / uObjectDimensions.y;\n
-    float scaleFactor = min( xRatio, yRatio );\n
+    vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw );\n
+    float scaleFactor = min( visualSize.x / uObjectDimensions.x, visualSize.y / uObjectDimensions.y );\n
+    vec3 originFlipY =  vec3(origin.x, -origin.y, 0.0);
+    vec3 anchorPointFlipY = vec3( anchorPoint.x, -anchorPoint.y, 0.0);
+    vec3 offset = vec3( ( offset / uSize.xy ) * offsetSizeMode.xy + offset * (1.0-offsetSizeMode.xy), 0.0) * vec3(1.0,-1.0,1.0);\n
+    return vec4( (aPosition + anchorPointFlipY)*scaleFactor + (offset + originFlipY)*uSize, 1.0 );\n
+  }\n
 
-    vec4 normalisedVertexPosition = vec4( aPosition * scaleFactor, 1.0 );\n
+  void main()\n
+  {\n
+    vec4 normalisedVertexPosition = ComputeVertexPosition();\n
     vec4 vertexPosition = uObjectMatrix * normalisedVertexPosition;\n
     vertexPosition = uMvpMatrix * vertexPosition;\n
 
@@ -422,6 +436,14 @@ Dali::Property::Value PrimitiveVisual::DoGetProperty( Dali::Property::Index inde
   return Dali::Property::Value();
 }
 
+void PrimitiveVisual::OnSetTransform()
+{
+  if( mImpl->mRenderer )
+  {
+    mImpl->mTransform.RegisterUniforms( mImpl->mRenderer, Direction::LEFT_TO_RIGHT );
+  }
+}
+
 void PrimitiveVisual::InitializeRenderer()
 {
   if( !mGeometry )
@@ -436,6 +458,9 @@ void PrimitiveVisual::InitializeRenderer()
 
   mImpl->mRenderer = Renderer::New( mGeometry, mShader );
   mImpl->mRenderer.SetProperty( Renderer::Property::FACE_CULLING_MODE, FaceCullingMode::BACK );
+
+  //Register transform properties
+  mImpl->mTransform.RegisterUniforms( mImpl->mRenderer, Direction::LEFT_TO_RIGHT );
 }
 
 void PrimitiveVisual::UpdateShaderUniforms()
index c06d55c..c039fe3 100644 (file)
@@ -160,6 +160,11 @@ protected:
    */
   virtual void DoSetOnStage( Actor& actor );
 
+  /**
+   * @copydoc Visual::Base::OnSetTransform
+   */
+  virtual void OnSetTransform();
+
 private:
 
   //Simple struct to store the position and normal of a single vertex.
index 5929eca..652b03d 100644 (file)
@@ -54,11 +54,6 @@ namespace Toolkit
 namespace Internal
 {
 
-SvgVisualPtr SvgVisual::New( VisualFactoryCache& factoryCache )
-{
-  return new SvgVisual( factoryCache );
-}
-
 SvgVisualPtr SvgVisual::New( VisualFactoryCache& factoryCache, const std::string& imageUrl, ImageDimensions size )
 {
   SvgVisual* svgVisual = new SvgVisual( factoryCache );
@@ -87,19 +82,7 @@ SvgVisual::~SvgVisual()
 
 void SvgVisual::DoSetProperties( const Property::Map& propertyMap )
 {
-  Property::Value* imageURLValue = propertyMap.Find( Toolkit::ImageVisual::Property::URL, IMAGE_URL_NAME );
-  if( imageURLValue )
-  {
-    std::string imageUrl;
-    if( imageURLValue->Get( imageUrl ) )
-    {
-      ParseFromUrl( imageUrl );
-    }
-    else
-    {
-      DALI_LOG_ERROR( "The property '%s' is not a string\n", IMAGE_URL_NAME );
-    }
-  }
+  // url already passed in from constructor
 }
 
 void SvgVisual::DoSetOnStage( Actor& actor )
index 0456bb5..7beb6d6 100644 (file)
@@ -54,14 +54,6 @@ class SvgVisual: public Visual::Base
 public:
 
   /**
-   * @brief Create a new SVG visual.
-   *
-   * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
-   * @return A smart-pointer to the newly allocated visual.
-   */
-  static SvgVisualPtr New( VisualFactoryCache& factoryCache );
-
-  /**
    * @brief Create the SVG Visual using the image URL.
    *
    * The visual will parse the SVG image once it is set.
index abaa703..c597e27 100644 (file)
@@ -554,7 +554,7 @@ void TextVisual::DoSetProperty( Dali::Property::Index index, const Dali::Propert
     case Toolkit::TextVisual::Property::UNDERLINE:
     {
       // TODO : This switch can be removed when the deprecated SHADOW_OFFSET and SHADOW_COLOR properties are finally removed.
-      //        Only the code for the STRING case should be kept.
+      //        Only the code for the MAP case should be kept.
       switch( propertyValue.GetType() )
       {
         case Property::VECTOR4:
@@ -587,7 +587,7 @@ void TextVisual::DoSetProperty( Dali::Property::Index index, const Dali::Propert
           }
           break;
         }
-        case Property::STRING:
+        case Property::MAP:
         {
           const bool update = SetUnderlineProperties( mController, propertyValue, Text::EffectStyle::DEFAULT );
           if( update )
@@ -608,7 +608,7 @@ void TextVisual::DoSetProperty( Dali::Property::Index index, const Dali::Propert
     case Toolkit::TextVisual::Property::SHADOW:
     {
       // TODO : This switch can be removed when the deprecated SHADOW_OFFSET and SHADOW_COLOR properties are finally removed.
-      //        Only the code for the STRING case should be kept.
+      //        Only the code for the MAP case should be kept.
       switch( propertyValue.GetType() )
       {
         case Property::VECTOR2:
@@ -631,7 +631,7 @@ void TextVisual::DoSetProperty( Dali::Property::Index index, const Dali::Propert
           }
           break;
         }
-        case Property::STRING:
+        case Property::MAP:
         {
           const bool update = SetShadowProperties( mController, propertyValue, Text::EffectStyle::DEFAULT );
           if( update )
index 21e146f..1826196 100644 (file)
@@ -46,10 +46,44 @@ DALI_ENUM_TO_STRING_WITH_SCOPE( Shader::Hint, OUTPUT_IS_TRANSPARENT )
 DALI_ENUM_TO_STRING_WITH_SCOPE( Shader::Hint, MODIFIES_GEOMETRY )
 DALI_ENUM_TO_STRING_TABLE_END( SHADER_HINT )
 
+DALI_ENUM_TO_STRING_TABLE_BEGIN( ALIGN )
+DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::Align, TOP_BEGIN )
+DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::Align, TOP_CENTER )
+DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::Align, TOP_END )
+DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::Align, CENTER_BEGIN )
+DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::Align, CENTER )
+DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::Align, CENTER_END )
+DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::Align, BOTTOM_BEGIN )
+DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::Align, BOTTOM_CENTER )
+DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::Align, BOTTOM_END )
+DALI_ENUM_TO_STRING_TABLE_END( ALIGN )
+
+Dali::Vector2 PointToVector2( Toolkit::Align::Type point, Toolkit::Direction::Type direction )
+{
+  static const float pointToVector2[] = { 0.0f,0.0f,
+                                          0.5f,0.0f,
+                                          1.0f,0.0f,
+                                          0.0f,0.5f,
+                                          0.5f,0.5f,
+                                          1.0f,0.5f,
+                                          0.0f,1.0f,
+                                          0.5f,1.0f,
+                                          1.0f,1.0f };
+
+  Vector2 result( &pointToVector2[point*2] );
+  if( direction == Direction::RIGHT_TO_LEFT )
+  {
+    result.x = 1.0f - result.x;
+  }
+
+  return result;
+}
+
 } // unnamed namespace
 
 Internal::Visual::Base::Impl::Impl()
 : mCustomShader(NULL),
+  mTransform(),
   mDepthIndex( 0.0f ),
   mFlags( 0 )
 {
@@ -162,6 +196,77 @@ void Internal::Visual::Base::Impl::CustomShader::CreatePropertyMap( Property::Ma
   }
 }
 
+Internal::Visual::Base::Impl::Transform::Transform()
+: mOffset(0.0f,0.0f),
+  mSize(1.0f,1.0f),
+  mOffsetSizeMode(0.0f,0.0f,0.0f,0.0f),
+  mOrigin(Toolkit::Align::CENTER),
+  mAnchorPoint(Toolkit::Align::CENTER)
+{
+}
+
+void Internal::Visual::Base::Impl::Transform::SetPropertyMap( const Property::Map& map )
+{
+  //Set default values
+  mOffset = Vector2(0.0f,0.0f);
+  mSize = Vector2(1.0f,1.0f);
+  mOffsetSizeMode = Vector4(0.0f,0.0f,0.0f,0.0f);
+  mOrigin = Toolkit::Align::CENTER;
+  mAnchorPoint = Toolkit::Align::CENTER;
+
+  for( Property::Map::SizeType i(0); i<map.Count(); ++i )
+  {
+    KeyValuePair keyValue = map.GetKeyValue( i );
+    if( keyValue.first == Toolkit::Visual::DevelProperty::Transform::Property::OFFSET )
+    {
+      keyValue.second.Get( mOffset );
+    }
+    else if( keyValue.first == Toolkit::Visual::DevelProperty::Transform::Property::SIZE )
+    {
+      keyValue.second.Get( mSize );
+    }
+    else if( keyValue.first == Toolkit::Visual::DevelProperty::Transform::Property::ORIGIN )
+    {
+      Toolkit::Align::Type align(Toolkit::Align::CENTER);
+      if( Scripting::GetEnumerationProperty< Toolkit::Align::Type >( keyValue.second, ALIGN_TABLE, ALIGN_TABLE_COUNT, align ) )
+      {
+        mOrigin = align;
+      }
+    }
+    else if( keyValue.first == Toolkit::Visual::DevelProperty::Transform::Property::ANCHOR_POINT )
+    {
+      Toolkit::Align::Type align(Toolkit::Align::CENTER);
+      if( Scripting::GetEnumerationProperty< Toolkit::Align::Type >( keyValue.second, ALIGN_TABLE, ALIGN_TABLE_COUNT, align ) )
+      {
+        mAnchorPoint = align;
+      }
+    }
+    else if( keyValue.first == Toolkit::Visual::DevelProperty::Transform::Property::OFFSET_SIZE_MODE )
+    {
+      keyValue.second.Get( mOffsetSizeMode );
+    }
+  }
+}
+
+void Internal::Visual::Base::Impl::Transform::GetPropertyMap( Property::Map& map ) const
+{
+  map.Clear();
+  map.Add( Toolkit::Visual::DevelProperty::Transform::Property::OFFSET, mOffset )
+     .Add( Toolkit::Visual::DevelProperty::Transform::Property::SIZE, mSize )
+     .Add( Toolkit::Visual::DevelProperty::Transform::Property::ORIGIN, mOrigin )
+     .Add( Toolkit::Visual::DevelProperty::Transform::Property::ANCHOR_POINT, mAnchorPoint )
+     .Add( Toolkit::Visual::DevelProperty::Transform::Property::OFFSET_SIZE_MODE, mOffsetSizeMode );
+}
+
+void Internal::Visual::Base::Impl::Transform::RegisterUniforms( Dali::Renderer renderer, Toolkit::Direction::Type direction )
+{
+  renderer.RegisterProperty( SIZE, mSize );
+  renderer.RegisterProperty( OFFSET, direction == Toolkit::Direction::LEFT_TO_RIGHT ? mOffset : mOffset * Vector2(-1.0f,1.0f));
+  renderer.RegisterProperty( OFFSET_SIZE_MODE, mOffsetSizeMode );
+  renderer.RegisterProperty( ORIGIN, PointToVector2( mOrigin, direction ) - Vector2(0.5,0.5) );
+  renderer.RegisterProperty( ANCHOR_POINT, Vector2(0.5,0.5) - PointToVector2( mAnchorPoint, direction ) );
+}
+
 } // namespace Internal
 
 } // namespace Toolkit
index c4877b4..f8ceabf 100644 (file)
@@ -24,6 +24,7 @@
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/visuals/visual-base-impl.h>
+#include <dali-toolkit/devel-api/align-enums.h>
 
 namespace Dali
 {
@@ -60,9 +61,24 @@ struct Base::Impl
     void CreatePropertyMap( Property::Map& map ) const;
   };
 
+  struct Transform
+  {
+    Vector2 mOffset;
+    Vector2 mSize;
+    Vector4 mOffsetSizeMode;
+    Toolkit::Align::Type mOrigin;
+    Toolkit::Align::Type mAnchorPoint;
+
+    Transform();
+    void SetPropertyMap( const Property::Map& map );
+    void GetPropertyMap( Property::Map& map ) const;
+    void RegisterUniforms( Renderer renderer, Toolkit::Direction::Type direction );
+  };
+
   Renderer      mRenderer;
   CustomShader* mCustomShader;
   std::string   mName;
+  Transform     mTransform;
   Vector2       mSize;
   float         mDepthIndex;
   int           mFlags;
index 2e1a312..1b9cec7 100644 (file)
@@ -71,6 +71,16 @@ void Visual::Base::SetProperties( const Property::Map& propertyMap )
     }
   }
 
+  Property::Value* transform = propertyMap.Find( Toolkit::Visual::DevelProperty::TRANSFORM, TRANSFORM );
+  if( transform )
+  {
+    Property::Map map;
+    if( transform->Get( map ) )
+    {
+      mImpl->mTransform.SetPropertyMap( map );
+    }
+  }
+
   DoSetProperties( propertyMap );
 }
 
@@ -124,9 +134,12 @@ void Visual::Base::SetOnStage( Actor& actor )
   // Thus the calling of actor.AddRenderer() should happen inside derived class as base class does not know the exact timing.
   DoSetOnStage( actor );
 
-  mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA, IsPreMultipliedAlphaEnabled());
-  mImpl->mRenderer.SetProperty( Renderer::Property::DEPTH_INDEX, mImpl->mDepthIndex );
-  mImpl->mFlags |= Impl::IS_ON_STAGE;
+  if( mImpl->mRenderer )
+  {
+    mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA, IsPreMultipliedAlphaEnabled());
+    mImpl->mRenderer.SetProperty( Renderer::Property::DEPTH_INDEX, mImpl->mDepthIndex );
+    mImpl->mFlags |= Impl::IS_ON_STAGE; // Only sets the flag if renderer exists
+  }
 }
 
 void Visual::Base::SetOffStage( Actor& actor )
@@ -147,6 +160,10 @@ void Visual::Base::CreatePropertyMap( Property::Map& map ) const
   {
     mImpl->mCustomShader->CreatePropertyMap( map );
   }
+
+  Property::Map transform;
+  mImpl->mTransform.GetPropertyMap( transform );
+  map.Insert( Toolkit::Visual::DevelProperty::TRANSFORM, transform );
 }
 
 void Visual::Base::EnablePreMultipliedAlpha( bool preMultipled )
@@ -173,8 +190,8 @@ bool Visual::Base::IsPreMultipliedAlphaEnabled() const
 
 void Visual::Base::DoSetOffStage( Actor& actor )
 {
-  actor.RemoveRenderer( mImpl->mRenderer );
-  mImpl->mRenderer.Reset();
+    actor.RemoveRenderer( mImpl->mRenderer );
+    mImpl->mRenderer.Reset();
 }
 
 bool Visual::Base::IsOnStage() const
@@ -195,6 +212,16 @@ void Visual::Base::SetProperty( Dali::Property::Index index, const Dali::Propert
 
   if( index < VISUAL_PROPERTY_START_INDEX )
   {
+    if( index == Dali::Toolkit::Visual::DevelProperty::TRANSFORM )
+    {
+      Property::Map* map = propertyValue.GetMap();
+      if( map )
+      {
+        mImpl->mTransform.SetPropertyMap( *map );
+        OnSetTransform();
+      }
+    }
+
     // TODO set the properties of the visual base.
   }
   else
@@ -213,6 +240,12 @@ Dali::Property::Value Visual::Base::GetProperty( Dali::Property::Index index )
 
   if( index < VISUAL_PROPERTY_START_INDEX )
   {
+    if( index == Dali::Toolkit::Visual::DevelProperty::TRANSFORM )
+    {
+      Property::Map map;
+      mImpl->mTransform.GetPropertyMap( map );
+      return map;
+    }
     // TODO retrieve the properties of the visual base.
   }
   else
index 432a3f2..306f2d9 100644 (file)
@@ -186,6 +186,11 @@ protected:
    */
   virtual void DoSetProperties( const Property::Map& propertyMap ) = 0;
 
+  /**
+   * @brief Called when transform property changes
+   */
+  virtual void OnSetTransform(){}
+
 protected:
 
   /**
index d7e4b97..9b77e63 100644 (file)
@@ -142,11 +142,11 @@ Toolkit::Visual::Base VisualFactory::CreateVisual( const Property::Map& property
         UrlType::Type type = ResolveUrlType( imageUrl );
         if( UrlType::N_PATCH == type )
         {
-          visualPtr = NPatchVisual::New( *( mFactoryCache.Get() ) );
+          visualPtr = NPatchVisual::New( *( mFactoryCache.Get() ), imageUrl );
         }
         else if( UrlType::SVG == type )
         {
-          visualPtr = SvgVisual::New( *( mFactoryCache.Get() ) );
+          visualPtr = SvgVisual::New( *( mFactoryCache.Get() ), imageUrl );
         }
         else // Regular image
         {
@@ -159,12 +159,12 @@ Toolkit::Visual::Base VisualFactory::CreateVisual( const Property::Map& property
 
           if( batchingEnabled )
           {
-            visualPtr = BatchImageVisual::New( *( mFactoryCache.Get() ) );
+            visualPtr = BatchImageVisual::New( *( mFactoryCache.Get() ), imageUrl );
             break;
           }
           else
           {
-            visualPtr = ImageVisual::New( *( mFactoryCache.Get() ) );
+            visualPtr = ImageVisual::New( *( mFactoryCache.Get() ), imageUrl );
           }
         }
       }
index b68f27c..6f99904 100644 (file)
@@ -35,6 +35,14 @@ const char * const CUSTOM_SUBDIVIDE_GRID_X( "subdivideGridX" );
 const char * const CUSTOM_SUBDIVIDE_GRID_Y( "subdivideGridY" );
 const char * const CUSTOM_SHADER_HINTS( "hints" );
 
+// Transform
+extern const char * const TRANSFORM( "transform" );
+extern const char * const SIZE( "size" );
+extern const char * const OFFSET( "offset" );
+extern const char * const OFFSET_SIZE_MODE( "offsetSizeMode" );
+extern const char * const ORIGIN( "origin" );
+extern const char * const ANCHOR_POINT( "anchorPoint" );
+
 // Image visual
 const char * const IMAGE_URL_NAME( "url" );
 const char * const ATLAS_RECT_UNIFORM_NAME ( "uAtlasRect" );
index efb0354..5ec7e30 100644 (file)
@@ -35,6 +35,15 @@ extern const char * const CUSTOM_SUBDIVIDE_GRID_X;
 extern const char * const CUSTOM_SUBDIVIDE_GRID_Y;
 extern const char * const CUSTOM_SHADER_HINTS;
 
+//Transform
+extern const char * const TRANSFORM;
+extern const char * const SIZE;
+extern const char * const OFFSET;
+extern const char * const OFFSET_SIZE_MODE;
+extern const char * const ORIGIN;
+extern const char * const ANCHOR_POINT;
+
+
 // Image visual
 extern const char * const IMAGE_URL_NAME;
 extern const char * const ATLAS_RECT_UNIFORM_NAME;
index a2ddcbe..58f7d4f 100644 (file)
@@ -65,11 +65,10 @@ struct RegisteredVisual
 {
   Property::Index index;
   Toolkit::Visual::Base visual;
-  Actor placementActor;
   bool enabled;
 
-  RegisteredVisual( Property::Index aIndex, Toolkit::Visual::Base &aVisual, Actor &aPlacementActor, bool aEnabled) :
-                   index(aIndex), visual(aVisual), placementActor(aPlacementActor), enabled(aEnabled) {}
+  RegisteredVisual( Property::Index aIndex, Toolkit::Visual::Base &aVisual, bool aEnabled) :
+                   index(aIndex), visual(aVisual), enabled(aEnabled) {}
 };
 
 struct HandleIndex
@@ -130,29 +129,23 @@ HandleIndex GetVisualProperty(
     }
   }
 
-  // Does either it's renderer or placement actor have an associated property?
+  // Does it's renderer have an associated property?
   if( iter != visuals.End() )
   {
-    Actor placementActor = (*iter)->placementActor;
-    if( !placementActor )
-    {
-      placementActor = controlImpl.Self();
-    }
-
-    Property::Index index = placementActor.GetPropertyIndex( propertyKey );
+    Actor self = controlImpl.Self();
+    Property::Index index = self.GetPropertyIndex( propertyKey );
     if( index != Property::INVALID_INDEX )
     {
-      // It's a placement actor property:
-      return HandleIndex( placementActor, index );
+      // It's an actor property:
+      return HandleIndex( self, index );
     }
     else
     {
       // Check if it is a renderer property:
-      if( placementActor.GetRendererCount() > 0 )
+      if( self.GetRendererCount() > 0 )
       {
-        // @todo Need to use correct renderer index when placement actors
-        // are removed
-        Renderer renderer = placementActor.GetRendererAt(0);
+        // @todo Need to use correct renderer index
+        Renderer renderer = self.GetRendererAt(0);
         Property::Index index = renderer.GetPropertyIndex( propertyKey );
         if( index != Property::INVALID_INDEX )
         {
@@ -565,13 +558,12 @@ const std::string& Control::GetStyleName() const
 
 void Control::SetBackgroundColor( const Vector4& color )
 {
-  Actor self( Self() );
   mImpl->mBackgroundColor = color;
   Property::Map map;
   map[ Toolkit::VisualProperty::TYPE ] = Toolkit::Visual::COLOR;
   map[ Toolkit::ColorVisual::Property::MIX_COLOR ] = color;
   mImpl->mBackgroundVisual = Toolkit::VisualFactory::Get().CreateVisual( map );
-  RegisterVisual( Toolkit::Control::Property::BACKGROUND, self, mImpl->mBackgroundVisual );
+  RegisterVisual( Toolkit::Control::Property::BACKGROUND, mImpl->mBackgroundVisual );
   if( mImpl->mBackgroundVisual )
   {
     mImpl->mBackgroundVisual.SetDepthIndex( DepthIndex::BACKGROUND );
@@ -585,9 +577,8 @@ Vector4 Control::GetBackgroundColor() const
 
 void Control::SetBackground( const Property::Map& map )
 {
-  Actor self( Self() );
   mImpl->mBackgroundVisual = Toolkit::VisualFactory::Get().CreateVisual( map );
-  RegisterVisual( Toolkit::Control::Property::BACKGROUND, self, mImpl->mBackgroundVisual );
+  RegisterVisual( Toolkit::Control::Property::BACKGROUND, mImpl->mBackgroundVisual );
   if( mImpl->mBackgroundVisual )
   {
     mImpl->mBackgroundVisual.SetDepthIndex( DepthIndex::BACKGROUND );
@@ -596,9 +587,8 @@ void Control::SetBackground( const Property::Map& map )
 
 void Control::SetBackgroundImage( Image image )
 {
-  Actor self( Self() );
   mImpl->mBackgroundVisual = Toolkit::VisualFactory::Get().CreateVisual( image );
-  RegisterVisual( Toolkit::Control::Property::BACKGROUND, self, mImpl->mBackgroundVisual );
+  RegisterVisual( Toolkit::Control::Property::BACKGROUND, mImpl->mBackgroundVisual );
   if( mImpl->mBackgroundVisual )
   {
     mImpl->mBackgroundVisual.SetDepthIndex( DepthIndex::BACKGROUND );
@@ -751,22 +741,16 @@ void Control::KeyboardEnter()
   OnKeyboardEnter();
 }
 
-void Control::RegisterVisual( Property::Index index, Actor& placementActor, Toolkit::Visual::Base& visual )
+void Control::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual )
 {
-  RegisterVisual( index, placementActor, visual, true );
+  RegisterVisual( index, visual, true );
 }
 
-void Control::RegisterVisual( Property::Index index, Actor& placementActor, Toolkit::Visual::Base& visual, bool enabled )
+void Control::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled )
 {
   bool visualReplaced ( false );
-  Actor actorToRegister; // Null actor, replaced if placement actor not Self
   Actor self = Self();
 
-  if ( placementActor != self ) // Prevent increasing ref count if actor self
-  {
-    actorToRegister = placementActor;
-  }
-
   if ( !mImpl->mVisuals.Empty() )
   {
       RegisteredVisualContainer::Iterator iter;
@@ -775,29 +759,21 @@ void Control::RegisterVisual( Property::Index index, Actor& placementActor, Tool
       {
         if( (*iter)->visual && self.OnStage() )
         {
-          if( (*iter)->placementActor )
-          {
-            (*iter)->visual.SetOffStage( (*iter)->placementActor );
-          }
-          else
-          {
-            (*iter)->visual.SetOffStage( self );
-          }
+          (*iter)->visual.SetOffStage( self );
         }
         (*iter)->visual = visual;
-        (*iter)->placementActor = actorToRegister;
         visualReplaced = true;
       }
   }
 
   if ( !visualReplaced ) // New registration entry
   {
-    mImpl->mVisuals.PushBack( new RegisteredVisual( index, visual, actorToRegister, enabled ) );
+    mImpl->mVisuals.PushBack( new RegisteredVisual( index, visual, enabled ) );
   }
 
   if( visual && self.OnStage() && enabled )
   {
-    visual.SetOnStage( placementActor );
+    visual.SetOnStage( self );
   }
 }
 
@@ -833,11 +809,6 @@ void Control::EnableVisual( Property::Index index, bool enable )
 
     (*iter)->enabled = enable;
     Actor parentActor = Self();
-    if ( (*iter)->placementActor )
-    {
-      parentActor = (*iter)->placementActor;
-    }
-
     if ( Self().OnStage() ) // If control not on Stage then Visual will be added when StageConnection is called.
     {
       if ( enable )
@@ -863,24 +834,6 @@ bool Control::IsVisualEnabled( Property::Index index ) const
   return false;
 }
 
-Actor Control::GetPlacementActor( Property::Index index ) const
-{
-  RegisteredVisualContainer::Iterator iter;
-  if ( FindVisual( index, mImpl->mVisuals, iter ) )
-  {
-    if( (*iter)->placementActor )
-    {
-      return (*iter)->placementActor;
-    }
-    else
-    {
-      return Self();
-    }
-  }
-
-  return Actor();
-}
-
 Dali::Animation Control::CreateTransition( const Toolkit::TransitionData& handle )
 {
   Dali::Animation transition;
@@ -905,7 +858,6 @@ Dali::Animation Control::CreateTransition( const Toolkit::TransitionData& handle
       }
       else
       {
-        // Is it a placement actor/visual pair?;
         handleIndex = GetVisualProperty( *this, mImpl->mVisuals,
                                             animator->objectName,
                                             animator->propertyKey );
@@ -1135,18 +1087,11 @@ void Control::OnStageConnection( int depth )
 {
   for(RegisteredVisualContainer::Iterator iter = mImpl->mVisuals.Begin(); iter!= mImpl->mVisuals.End(); iter++)
   {
-    // Check whether the visual is empty, as it is allowed to register a placement actor without visual.
+    // Check whether the visual is empty and enabled
     if( (*iter)->visual && (*iter)->enabled )
     {
-      if( (*iter)->placementActor )
-      {
-        (*iter)->visual.SetOnStage( (*iter)->placementActor );
-      }
-      else
-      {
-        Actor self( Self() );
-        (*iter)->visual.SetOnStage( self );
-      }
+      Actor self( Self() );
+      (*iter)->visual.SetOnStage( self );
     }
   }
 }
@@ -1155,18 +1100,11 @@ void Control::OnStageDisconnection()
 {
   for(RegisteredVisualContainer::Iterator iter = mImpl->mVisuals.Begin(); iter!= mImpl->mVisuals.End(); iter++)
   {
-    // Check whether the visual is empty, as it is allowed to register a placement actor without visual.
+    // Check whether the visual is empty
     if( (*iter)->visual )
     {
-      if( (*iter)->placementActor )
-      {
-        (*iter)->visual.SetOffStage( (*iter)->placementActor );
-      }
-      else
-      {
-        Actor self( Self() );
-        (*iter)->visual.SetOffStage( self );
-      }
+      Actor self( Self() );
+      (*iter)->visual.SetOffStage( self );
     }
   }
 }
index 92786d4..9993237 100644 (file)
@@ -306,12 +306,11 @@ protected: // For derived classes to call
    * @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
-   * @note Derived class should not call visual.SetOnStage(placementActor). It is the responsibility of the base class to connect/disconnect registered visual to stage.
+   * @note Derived class should not call visual.SetOnStage(actor). It is the responsibility of the base class to connect/disconnect registered visual to stage.
    *       Use below API with enabled set to false if derived class wishes to control when visual is staged.
    */
-  void RegisterVisual( Property::Index index, Actor& placementActor, Toolkit::Visual::Base& visual );
+  void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual );
 
   /**
    * @brief Register a visual by Property Index, linking an Actor to visual when required.
@@ -322,12 +321,11 @@ protected: // For derived classes to call
    * @SINCE_1_2.11
    *
    * @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
    * @param[in] enabled false if derived class wants to control when visual is set on stage.
    *
    */
-  void RegisterVisual( Property::Index index, Actor& placementActor, Toolkit::Visual::Base& visual, bool enabled );
+  void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled );
 
   /**
    * @brief Erase the entry matching the given index from the list of registered visuals
@@ -369,17 +367,6 @@ protected: // For derived classes to call
   bool IsVisualEnabled( Property::Index index ) const;
 
   /**
-   * @brief Retrieve the placement actor associated with the given index.
-   *
-   * @SINCE_1_2.2
-   *
-   * @@param[in] index The Property index of the visual.
-   * @return Then placement actor if exist, otherwise empty handle.
-   * @note For managing object life-cycle, do not store the returned placement actor as a member which increments its reference count.
-   */
-  Actor GetPlacementActor( Property::Index index ) const;
-
-  /**
    * @brief Create a transition effect on the control.
    *
    * @SINCE_1_2.12
index 152a8b7..b398d05 100644 (file)
@@ -72,7 +72,7 @@ public:
       TEXT,                                     ///< name "text",                                The text to display in UTF-8 format,                                             type STRING @SINCE_1_1.37
       TEXT_COLOR,                               ///< name "textColor",                           The text color,                                                                  type VECTOR4 @SINCE_1_1.37
       FONT_FAMILY,                              ///< name "fontFamily",                          The requested font family,                                                       type STRING @SINCE_1_1.37
-      FONT_STYLE,                               ///< name "fontStyle",                           The requested font style,                                                        type STRING @SINCE_1_1.37
+      FONT_STYLE,                               ///< name "fontStyle",                           The requested font style,                                                        type STRING or MAP @SINCE_1_2.13
       POINT_SIZE,                               ///< name "pointSize",                           The size of font in points,                                                      type FLOAT @SINCE_1_1.37
       HORIZONTAL_ALIGNMENT,                     ///< name "horizontalAlignment",                 The text horizontal alignment,                                                   type STRING,  values "BEGIN", "CENTER", "END" @SINCE_1_1.37
       SCROLL_THRESHOLD,                         ///< name "scrollThreshold"                      Vertical scrolling will occur if the cursor is this close to the control border, type FLOAT @SINCE_1_1.37
@@ -96,18 +96,18 @@ public:
       ENABLE_MARKUP,                            ///< name "enableMarkup",                        Whether the mark-up processing is enabled.                                       type BOOLEAN @SINCE_1_1.37
       INPUT_COLOR,                              ///< name "inputColor",                          The color of the new input text,                                                 type VECTOR4 @SINCE_1_1.37
       INPUT_FONT_FAMILY,                        ///< name "inputFontFamily",                     The font's family of the new input text,                                         type STRING @SINCE_1_1.37
-      INPUT_FONT_STYLE,                         ///< name "inputFontStyle",                      The font's style of the new input text,                                          type STRING @SINCE_1_1.37
+      INPUT_FONT_STYLE,                         ///< name "inputFontStyle",                      The font's style of the new input text,                                          type STRING or MAP @SINCE_1_2.13
       INPUT_POINT_SIZE,                         ///< name "inputPointSize",                      The font's size of the new input text in points,                                 type FLOAT @SINCE_1_1.37
       LINE_SPACING,                             ///< name "lineSpacing",                         The default extra space between lines in points,                                 type FLOAT @SINCE_1_1.37
       INPUT_LINE_SPACING,                       ///< name "inputLineSpacing"                     The extra space between lines in points. It affects the whole paragraph where the new input text is inserted, type FLOAT @SINCE_1_1.37
-      UNDERLINE,                                ///< name "underline"                            The default underline parameters,                                                type STRING @SINCE_1_1.37
-      INPUT_UNDERLINE,                          ///< name "inputUnderline"                       The underline parameters of the new input text,                                  type STRING @SINCE_1_1.37
-      SHADOW,                                   ///< name "shadow"                               The default shadow parameters,                                                   type STRING @SINCE_1_1.37
-      INPUT_SHADOW,                             ///< name "inputShadow"                          The shadow parameters of the new input text,                                     type STRING @SINCE_1_1.37
-      EMBOSS,                                   ///< name "emboss"                               The default emboss parameters,                                                   type STRING @SINCE_1_1.37
-      INPUT_EMBOSS,                             ///< name "inputEmboss"                          The emboss parameters of the new input text,                                     type STRING @SINCE_1_1.37
-      OUTLINE,                                  ///< name "outline"                              The default outline parameters,                                                  type STRING @SINCE_1_1.37
-      INPUT_OUTLINE,                            ///< name "inputOutline"                         The outline parameters of the new input text,                                    type STRING @SINCE_1_1.37
+      UNDERLINE,                                ///< name "underline"                            The default underline parameters,                                                type STRING or MAP @SINCE_1_2.13
+      INPUT_UNDERLINE,                          ///< name "inputUnderline"                       The underline parameters of the new input text,                                  type STRING or MAP @SINCE_1_2.13
+      SHADOW,                                   ///< name "shadow"                               The default shadow parameters,                                                   type STRING or MAP @SINCE_1_2.13
+      INPUT_SHADOW,                             ///< name "inputShadow"                          The shadow parameters of the new input text,                                     type STRING or MAP @SINCE_1_2.13
+      EMBOSS,                                   ///< name "emboss"                               The default emboss parameters,                                                   type STRING or MAP @SINCE_1_2.13
+      INPUT_EMBOSS,                             ///< name "inputEmboss"                          The emboss parameters of the new input text,                                     type STRING or MAP @SINCE_1_2.13
+      OUTLINE,                                  ///< name "outline"                              The default outline parameters,                                                  type STRING or MAP @SINCE_1_2.13
+      INPUT_OUTLINE,                            ///< name "inputOutline"                         The outline parameters of the new input text,                                    type STRING or MAP @SINCE_1_2.13
     };
   };
 
index ddfa4af..f678374 100644 (file)
@@ -73,7 +73,7 @@ public:
       PLACEHOLDER_TEXT,                         ///< name "placeholderText",                     The text to display when the TextField is empty and inactive,                      type STRING @SINCE_1_0.0
       PLACEHOLDER_TEXT_FOCUSED,                 ///< name "placeholderTextFocused",              The text to display when the TextField is empty with key-input focus,              type STRING @SINCE_1_0.0
       FONT_FAMILY,                              ///< name "fontFamily",                          The requested font family,                                                         type STRING @SINCE_1_0.0
-      FONT_STYLE,                               ///< name "fontStyle",                           The requested font style,                                                          type STRING @SINCE_1_0.0
+      FONT_STYLE,                               ///< name "fontStyle",                           The requested font style,                                                          type STRING or MAP @SINCE_1_2.13
       POINT_SIZE,                               ///< name "pointSize",                           The size of font in points,                                                        type FLOAT @SINCE_1_0.0
       MAX_LENGTH,                               ///< name "maxLength"                            The maximum number of characters that can be inserted,                             type INTEGER @SINCE_1_0.0
       EXCEED_POLICY,                            ///< name "exceedPolicy"                         Specifies how the text is truncated when it does not fit,                          type INTEGER @SINCE_1_0.0
@@ -105,16 +105,16 @@ public:
       INPUT_COLOR,                              ///< name "inputColor",                          The color of the new input text,                                                   type VECTOR4 @SINCE_1_0.0
       ENABLE_MARKUP,                            ///< name "enableMarkup",                        Whether the mark-up processing is enabled.                                         type BOOLEAN @SINCE_1_0.0
       INPUT_FONT_FAMILY,                        ///< name "inputFontFamily",                     The font's family of the new input text,                                           type STRING @SINCE_1_0.0
-      INPUT_FONT_STYLE,                         ///< name "inputFontStyle",                      The font's style of the new input text,                                            type STRING @SINCE_1_0.0
+      INPUT_FONT_STYLE,                         ///< name "inputFontStyle",                      The font's style of the new input text,                                            type STRING or MAP @SINCE_1_2.13
       INPUT_POINT_SIZE,                         ///< name "inputPointSize",                      The font's size of the new input text in points,                                   type FLOAT @SINCE_1_0.0
-      UNDERLINE,                                ///< name "underline"                            The default underline parameters,                                                  type STRING @SINCE_1_1.37
-      INPUT_UNDERLINE,                          ///< name "inputUnderline"                       The underline parameters of the new input text,                                    type STRING @SINCE_1_1.37
-      SHADOW,                                   ///< name "shadow"                               The default shadow parameters,                                                     type STRING @SINCE_1_1.37
-      INPUT_SHADOW,                             ///< name "inputShadow"                          The shadow parameters of the new input text,                                       type STRING @SINCE_1_1.37
-      EMBOSS,                                   ///< name "emboss"                               The default emboss parameters,                                                     type STRING @SINCE_1_1.37
-      INPUT_EMBOSS,                             ///< name "inputEmboss"                          The emboss parameters of the new input text,                                       type STRING @SINCE_1_1.37
-      OUTLINE,                                  ///< name "outline"                              The default outline parameters,                                                    type STRING @SINCE_1_1.37
-      INPUT_OUTLINE,                            ///< name "inputOutline"                         The outline parameters of the new input text,                                      type STRING @SINCE_1_1.37
+      UNDERLINE,                                ///< name "underline"                            The default underline parameters,                                                  type STRING or MAP @SINCE_1_2.13
+      INPUT_UNDERLINE,                          ///< name "inputUnderline"                       The underline parameters of the new input text,                                    type STRING or MAP @SINCE_1_2.13
+      SHADOW,                                   ///< name "shadow"                               The default shadow parameters,                                                     type STRING or MAP @SINCE_1_2.13
+      INPUT_SHADOW,                             ///< name "inputShadow"                          The shadow parameters of the new input text,                                       type STRING or MAP @SINCE_1_2.13
+      EMBOSS,                                   ///< name "emboss"                               The default emboss parameters,                                                     type STRING or MAP @SINCE_1_2.13
+      INPUT_EMBOSS,                             ///< name "inputEmboss"                          The emboss parameters of the new input text,                                       type STRING or MAP @SINCE_1_2.13
+      OUTLINE,                                  ///< name "outline"                              The default outline parameters,                                                    type STRING or MAP @SINCE_1_2.13
+      INPUT_OUTLINE,                            ///< name "inputOutline"                         The outline parameters of the new input text,                                      type STRING or MAP @SINCE_1_2.13
     };
   };
 
index 9c216c2..829d086 100644 (file)
@@ -42,24 +42,24 @@ class TextLabel;
  * Text labels are lightweight, non-editable and do not respond to user input.
  *
  * @section TextLabelProperties Properties
- * |%Property enum                    |String name          |Type          |Writable|Animatable|
- * |----------------------------------|---------------------|--------------|--------|----------|
- * | Property::RENDERING_BACKEND      | renderingBackend    |  INTEGER     | O      | X        |
- * | Property::TEXT                   | text                |  STRING      | O      | X        |
- * | Property::FONT_FAMILY            | fontFamily          |  STRING      | O      | X        |
- * | Property::FONT_STYLE             | fontStyle           |  STRING      | O      | X        |
- * | Property::POINT_SIZE             | pointSize           |  FLOAT       | O      | X        |
- * | Property::MULTI_LINE             | multiLine           |  BOOLEAN     | O      | X        |
- * | Property::HORIZONTAL_ALIGNMENT   | horizontalAlignment |  STRING      | O      | X        |
- * | Property::VERTICAL_ALIGNMENT     | verticalAlignment   |  STRING      | O      | X        |
- * | Property::TEXT_COLOR             | textColor           |  VECTOR4     | O      | X        |
- * | Property::ENABLE_MARKUP          | enableMarkup        |  BOOLEAN     | O      | X        |
- * | Property::ENABLE_AUTO_SCROLL     | enableAutoScroll    |  BOOLEAN     | O      | X        |
- * | Property::AUTO_SCROLL_SPEED      | autoScrollSpeed     |  INTEGER     | O      | X        |
- * | Property::AUTO_SCROLL_LOOP_COUNT | autoScrollLoopCount |  INTEGER     | O      | X        |
- * | Property::AUTO_SCROLL_GAP        | autoScrollGap       |  INTEGER     | O      | X        |
- * | Property::SHADOW                 | shadow              |  STRING      | O      | X        |
- * | Property::UNDERLINE              | underline           |  STRING      | O      | X        |
+ * |%Property enum                    |String name          |Type            |Writable|Animatable|
+ * |----------------------------------|---------------------|----------------|--------|----------|
+ * | Property::RENDERING_BACKEND      | renderingBackend    |  INTEGER       | O      | X        |
+ * | Property::TEXT                   | text                |  STRING        | O      | X        |
+ * | Property::FONT_FAMILY            | fontFamily          |  STRING        | O      | X        |
+ * | Property::FONT_STYLE             | fontStyle           |  STRING or MAP | O      | X        |
+ * | Property::POINT_SIZE             | pointSize           |  FLOAT         | O      | X        |
+ * | Property::MULTI_LINE             | multiLine           |  BOOLEAN       | O      | X        |
+ * | Property::HORIZONTAL_ALIGNMENT   | horizontalAlignment |  STRING        | O      | X        |
+ * | Property::VERTICAL_ALIGNMENT     | verticalAlignment   |  STRING        | O      | X        |
+ * | Property::TEXT_COLOR             | textColor           |  VECTOR4       | O      | X        |
+ * | Property::ENABLE_MARKUP          | enableMarkup        |  BOOLEAN       | O      | X        |
+ * | Property::ENABLE_AUTO_SCROLL     | enableAutoScroll    |  BOOLEAN       | O      | X        |
+ * | Property::AUTO_SCROLL_SPEED      | autoScrollSpeed     |  INTEGER       | O      | X        |
+ * | Property::AUTO_SCROLL_LOOP_COUNT | autoScrollLoopCount |  INTEGER       | O      | X        |
+ * | Property::AUTO_SCROLL_GAP        | autoScrollGap       |  INTEGER       | O      | X        |
+ * | Property::SHADOW                 | shadow              |  STRING or MAP | O      | X        |
+ * | Property::UNDERLINE              | underline           |  STRING or MAP | O      | X        |
  *
  * @SINCE_1_0.0
  */
@@ -108,8 +108,8 @@ public:
 
       /**
        * @brief The requested font style to use,
-       * @details name "fontStyle", type STRING
-       * @SINCE_1_0.0
+       * @details name "fontStyle", type STRING or MAP
+       * @SINCE_1_2.13
        */
       FONT_STYLE,
 
@@ -227,29 +227,29 @@ public:
 
       /**
        * @brief The default underline parameters.
-       * @details name "underline", type STRING.
-       * @SINCE_1_1.37
+       * @details name "underline", type MAP.
+       * @SINCE_1_2.13
        */
       UNDERLINE,
 
       /**
        * @brief The default shadow parameters.
-       * @details name "shadow", type STRING.
-       * @SINCE_1_1.37
+       * @details name "shadow", type MAP.
+       * @SINCE_1_2.13
        */
       SHADOW,
 
       /**
        * @brief The default emboss parameters.
-       * @details name "emboss", type STRING.
-       * @SINCE_1_1.37
+       * @details name "emboss", type MAP.
+       * @SINCE_1_2.13
        */
       EMBOSS,
 
       /**
        * @brief The default outline parameters.
-       * @details name "outline", type STRING.
-       * @SINCE_1_1.37
+       * @details name "outline", type MAP.
+       * @SINCE_1_2.13
        */
       OUTLINE,
     };
index 8c9ed00..91fe3b9 100644 (file)
@@ -31,7 +31,7 @@ namespace Toolkit
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
 const unsigned int TOOLKIT_MINOR_VERSION = 2;
-const unsigned int TOOLKIT_MICRO_VERSION = 11;
+const unsigned int TOOLKIT_MICRO_VERSION = 12;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 53a0df0..0e2dd5d 100644 (file)
@@ -58,8 +58,8 @@ enum
 
   /**
    * @brief The requested font style to use,
-   * @details name "fontStyle", type STRING
-   * @SINCE_1_2.11
+   * @details name "fontStyle", type STRING or MAP
+   * @SINCE_1_2.13
    */
   FONT_STYLE,
 
@@ -142,29 +142,29 @@ enum
 
   /**
    * @brief The default underline parameters.
-   * @details name "underline", type STRING.
-   * @SINCE_1_2.11
+   * @details name "underline", type STRING or MAP.
+   * @SINCE_1_2.13
    */
   UNDERLINE,
 
   /**
    * @brief The default shadow parameters.
-   * @details name "shadow", type STRING.
-   * @SINCE_1_2.11
+   * @details name "shadow", type STRING or MAP.
+   * @SINCE_1_2.13
    */
   SHADOW,
 
   /**
    * @brief The default emboss parameters.
-   * @details name "emboss", type STRING.
-   * @SINCE_1_2.11
+   * @details name "emboss", type STRING or MAP.
+   * @SINCE_1_2.13
    */
   EMBOSS,
 
   /**
    * @brief The default outline parameters.
-   * @details name "outline", type STRING.
-   * @SINCE_1_2.11
+   * @details name "outline", type STRING or MAP.
+   * @SINCE_1_2.13
    */
   OUTLINE,
 
index 19ac5bf..a710272 100644 (file)
       "label":
       {
         "pointSize":120,
-        "fontStyle":"{\"weight\":\"light\"}"
+        "fontStyle":{"weight":"light"}
       }
     },
     "TextSelectionToolbar":
index 7de04cc..264c19b 100644 (file)
       "label":
       {
         "pointSize":8,
-        "fontStyle":"{\"weight\":\"light\"}"
+        "fontStyle":{"weight":"light"}
       }
     },
     "TextSelectionToolbar":
index 404cc00..923680d 100644 (file)
       "label":
       {
         "pointSize":8,
-        "fontStyle":"{\"weight\":\"light\"}"
+        "fontStyle":{"weight":"light"}
       }
     },
     "TextSelectionToolbar":
index b5a63b2..3a926c1 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-addon
 Summary:    DALi module for Node.JS
-Version:    1.2.11
+Version:    1.2.12
 Release:    1
 Group:      Development/Libraries
 License:    Apache License, Version 2.0
index 788769d..849ebee 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       NDalic
 Summary:    dali wrapper
-Version:    1.2.11
+Version:    1.2.12
 Release:    1
 Group:      uifw/graphic
 License:    TO_BE_FILLED_IN
index bae76d7..27457e1 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    The OpenGLES Canvas Core Library Toolkit
-Version:    1.2.11
+Version:    1.2.12
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-2-Clause and MIT
index d172266..cfa1c57 100644 (file)
 %rename(IMAGE_VISUAL_DESIRED_HEIGHT) Dali::Toolkit::ImageVisual::Property::DESIRED_HEIGHT;
 %rename(IMAGE_VISUAL_SYNCHRONOUS_LOADING) Dali::Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING;
 %rename(IMAGE_VISUAL_BORDER_ONLY) Dali::Toolkit::ImageVisual::Property::BORDER_ONLY;
+%rename(IMAGE_VISUAL_BATCHING_ENABLED) Dali::Toolkit::ImageVisual::Property::BATCHING_ENABLED;
+%rename(IMAGE_VISUAL_PIXEL_AREA) Dali::Toolkit::ImageVisual::Property::PIXEL_AREA;
+%rename(IMAGE_VISUAL_WRAP_MODE_U) Dali::Toolkit::ImageVisual::Property::WRAP_MODE_U;
+%rename(IMAGE_VISUAL_WRAP_MODE_V) Dali::Toolkit::ImageVisual::Property::WRAP_MODE_V;
 %rename(COLOR_VISUAL_MIX_COLOR) Dali::Toolkit::Color::Visual::Property::MIX_COLOR;
+%rename(TEXT_VISUAL_RENDERING_BACKEND) Dali::Toolkit::Text::Visual::Property::RENDERING_BACKEND;
+%rename(TEXT_VISUAL_TEXT) Dali::Toolkit::Text::Visual::Property::TEXT;
+%rename(TEXT_VISUAL_FONT_FAMILY) Dali::Toolkit::Text::Visual::Property::FONT_FAMILY;
+%rename(TEXT_VISUAL_FONT_STYLE) Dali::Toolkit::Text::Visual::Property::FONT_STYLE;
+%rename(TEXT_VISUAL_POINT_SIZE) Dali::Toolkit::Text::Visual::Property::POINT_SIZE;
+%rename(TEXT_VISUAL_MULTI_LINE) Dali::Toolkit::Text::Visual::Property::MULTI_LINE;
+%rename(TEXT_VISUAL_HORIZONTAL_ALIGNMENT) Dali::Toolkit::Text::Visual::Property::HORIZONTAL_ALIGNMENT;
+%rename(TEXT_VISUAL_VERTICAL_ALIGNMENT) Dali::Toolkit::Text::Visual::Property::VERTICAL_ALIGNMENT;
+%rename(TEXT_VISUAL_TEXT_COLOR) Dali::Toolkit::Text::Visual::Property::TEXT_COLOR;
+%rename(TEXT_VISUAL_ENABLE_MARKUP) Dali::Toolkit::Text::Visual::Property::ENABLE_MARKUP;
+%rename(TEXT_VISUAL_ENABLE_AUTO_SCROLL) Dali::Toolkit::Text::Visual::Property::ENABLE_AUTO_SCROLL;
+%rename(TEXT_VISUAL_AUTO_SCROLL_SPEED) Dali::Toolkit::Text::Visual::Property::AUTO_SCROLL_SPEED;
+%rename(TEXT_VISUAL_AUTO_SCROLL_LOOP_COUNT) Dali::Toolkit::Text::Visual::Property::AUTO_SCROLL_LOOP_COUNT;
+%rename(TEXT_VISUAL_AUTO_SCROLL_GAP) Dali::Toolkit::Text::Visual::Property::AUTO_SCROLL_GAP;
+%rename(TEXT_VISUAL_LINE_SPACING) Dali::Toolkit::Text::Visual::Property::LINE_SPACING;
+%rename(TEXT_VISUAL_UNDERLINE) Dali::Toolkit::Text::Visual::Property::UNDERLINE;
+%rename(TEXT_VISUAL_SHADOW) Dali::Toolkit::Text::Visual::Property::SHADOW;
+%rename(TEXT_VISUAL_EMBOSS) Dali::Toolkit::Text::Visual::Property::EMBOSS;
+%rename(TEXT_VISUAL_OUTLINE) Dali::Toolkit::Text::Visual::Property::OUTLINE;
+%rename(TEXT_VISUAL_BATCHING_ENABLED) Dali::Toolkit::Text::Visual::Property::BATCHING_ENABLED;
 
 %csconstvalue("PropertyRanges.PROPERTY_REGISTRATION_START_INDEX") PROPERTY_START_INDEX;
 %csconstvalue("View.PropertyRange.PROPERTY_START_INDEX+1000") PROPERTY_END_INDEX;
@@ -152,12 +176,17 @@ typedef Dali::IntrusivePtr<Dali::Toolkit::Ruler> RulerPtr;
 %include <dali-toolkit/public-api/visuals/image-visual-properties.h>
 %include <dali-toolkit/public-api/visuals/mesh-visual-properties.h>
 %include <dali-toolkit/public-api/visuals/primitive-visual-properties.h>
+%include <dali-toolkit/public-api/visuals/text-visual-properties.h>
 
 %include <dali-toolkit/devel-api/builder/builder.h>
 
+%include <dali-toolkit/devel-api/visual-factory/transition-data.h>
+
 %include <dali-toolkit/public-api/controls/control-impl.h>
 %include <dali-toolkit/public-api/controls/control.h>
 
+%include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
+
 %include <dali-toolkit/public-api/controls/alignment/alignment.h>
 %include <dali-toolkit/public-api/controls/buttons/button.h>
 %include <dali-toolkit/public-api/controls/buttons/check-box-button.h>
index a48c274..7002568 100755 (executable)
@@ -62,6 +62,8 @@
 #include <dali/devel-api/images/nine-patch-image.h>
 
 #include <dali-toolkit/devel-api/builder/builder.h>
+
+#include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
 #include <dali-toolkit/devel-api/controls/popup/popup.h>
 #include <dali-toolkit/devel-api/controls/progress-bar/progress-bar.h>
 #include <dali-toolkit/devel-api/controls/gaussian-blur-view/gaussian-blur-view.h>
@@ -72,6 +74,7 @@
 
 #include <dali-toolkit/devel-api/visual-factory/visual-base.h>
 #include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
+#include <dali-toolkit/devel-api/visual-factory/transition-data.h>
 
 #include <dali-toolkit/public-api/controls/scrollable/item-view/item-view-declarations.h>