Merge "DALi Version 1.2.22" into devel/master
authorDavid Steele <david.steele@samsung.com>
Fri, 13 Jan 2017 14:37:15 +0000 (06:37 -0800)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Fri, 13 Jan 2017 14:37:15 +0000 (06:37 -0800)
45 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/utc-Dali-AccessibilityManager.cpp
automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp
automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp
automated-tests/src/dali-toolkit/utc-Dali-KeyInputFocusManager.cpp
automated-tests/src/dali-toolkit/utc-Dali-TransitionData.cpp
automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp
automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp
dali-toolkit/devel-api/visuals/visual-properties-devel.h
dali-toolkit/internal/visuals/animated-image/animated-image-visual.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/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/primitive/primitive-visual.cpp
dali-toolkit/internal/visuals/primitive/primitive-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-cache.h
dali-toolkit/internal/visuals/visual-string-constants.cpp
dali-toolkit/internal/visuals/visual-string-constants.h
dali-toolkit/internal/visuals/wireframe/wireframe-visual.cpp
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/controls/control-impl.h
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.cpp
plugins/dali-swig/Makefile.am
plugins/dali-swig/SWIG/dali.i
plugins/dali-swig/SWIG/devel-properties.i [new file with mode: 0644]
plugins/dali-swig/SWIG/events/actor-event.i
plugins/dali-swig/SWIG/events/button-event.i
plugins/dali-swig/SWIG/events/control-event.i
plugins/dali-swig/manual/cpp/devel-property-wrap.cpp [new file with mode: 0644]
plugins/dali-swig/manual/csharp/ManualPINVOKE.cs

index ed4d02c..f6fb4bf 100644 (file)
@@ -68,9 +68,12 @@ BaseHandle Create()
 DALI_TYPE_REGISTRATION_BEGIN( Toolkit::DummyControl, Toolkit::Control, Create );
 DALI_TYPE_REGISTRATION_END()
 
-Dali::PropertyRegistration dummyControlVisualProperty(
+Dali::PropertyRegistration dummyControlVisualProperty01(
   typeRegistration, "testVisual", Dali::Toolkit::DummyControl::Property::TEST_VISUAL, Dali::Property::MAP, &Dali::Toolkit::DummyControlImpl::SetProperty, &Dali::Toolkit::DummyControlImpl::GetProperty );
 
+Dali::PropertyRegistration dummyControlVisualProperty02(
+  typeRegistration, "testVisual", Dali::Toolkit::DummyControl::Property::TEST_VISUAL2, Dali::Property::MAP, &Dali::Toolkit::DummyControlImpl::SetProperty, &Dali::Toolkit::DummyControlImpl::GetProperty );
+
 }
 
 DummyControl DummyControlImpl::New()
@@ -149,18 +152,16 @@ Property::Value DummyControlImpl::GetProperty( BaseObject* object, Dali::Propert
   return value;
 }
 
-
-
-DummyControl DummyControlImplOverride::New()
+Toolkit::DummyControl Impl::DummyControl::New()
 {
-  IntrusivePtr< DummyControlImplOverride > impl = new DummyControlImplOverride;
-  DummyControl control( *impl );
+  IntrusivePtr< Toolkit::Impl::DummyControl > impl = new Toolkit::Impl::DummyControl;
+  Toolkit::DummyControl control( *impl );
   impl->Initialize();
   return control;
 }
 
 
-DummyControlImplOverride::DummyControlImplOverride()
+Impl::DummyControl::DummyControl()
 : DummyControlImpl(),
   initializeCalled(false),
   activatedCalled(false),
@@ -187,64 +188,75 @@ DummyControlImplOverride::DummyControlImplOverride()
 {
 }
 
-DummyControlImplOverride::~DummyControlImplOverride() { }
+Impl::DummyControl::~DummyControl() { }
 
 
-void DummyControlImplOverride::OnInitialize() { initializeCalled = true; }
-bool DummyControlImplOverride::OnAccessibilityActivated() { activatedCalled = true; return true; }
-bool DummyControlImplOverride::OnAccessibilityTouch(const TouchEvent& touchEvent) { onAccTouchedCalled = true; return true; }
-bool DummyControlImplOverride::OnAccessibilityValueChange( bool isIncrease )
+void Impl::DummyControl::OnInitialize() { initializeCalled = true; }
+bool Impl::DummyControl::OnAccessibilityActivated() { activatedCalled = true; return true; }
+bool Impl::DummyControl::OnAccessibilityTouch(const TouchEvent& touchEvent) { onAccTouchedCalled = true; return true; }
+bool Impl::DummyControl::OnAccessibilityValueChange( bool isIncrease )
 {
   onAccValueChangeCalled = true; return true;
 }
 
-void DummyControlImplOverride::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change )
+void Impl::DummyControl::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change )
 {
   themeChangeCalled = change == StyleChange::THEME_CHANGE;
   fontChangeCalled = change == StyleChange::DEFAULT_FONT_SIZE_CHANGE;
 }
-void DummyControlImplOverride::OnPinch(const PinchGesture& pinch) { pinchCalled = true; }
-void DummyControlImplOverride::OnPan(const PanGesture& pan) { panCalled = true; }
-void DummyControlImplOverride::OnTap(const TapGesture& tap) { tapCalled = true; }
-void DummyControlImplOverride::OnLongPress(const LongPressGesture& longPress) { longPressCalled = true; }
-void DummyControlImplOverride::OnStageConnection( int depth ) { stageConnectionCalled = true; Control::OnStageConnection( depth ); }
-void DummyControlImplOverride::OnStageDisconnection() { stageDisconnectionCalled = true; Control::OnStageDisconnection(); }
-void DummyControlImplOverride::OnChildAdd(Actor& child) { childAddCalled = true; Control::OnChildAdd( child ); }
-void DummyControlImplOverride::OnChildRemove(Actor& child) { childRemoveCalled = true; Control::OnChildRemove( child ); }
-void DummyControlImplOverride::OnSizeSet(const Vector3& targetSize) { sizeSetCalled = true; Control::OnSizeSet( targetSize ); }
-void DummyControlImplOverride::OnSizeAnimation(Animation& animation, const Vector3& targetSize) { sizeAnimationCalled = true; Control::OnSizeAnimation( animation, targetSize ); }
-bool DummyControlImplOverride::OnTouchEvent(const TouchEvent& event) { touchEventCalled = true; return false; }
-bool DummyControlImplOverride::OnHoverEvent(const HoverEvent& event) { hoverEventCalled = true; return false; }
-bool DummyControlImplOverride::OnWheelEvent(const WheelEvent& event) { wheelEventCalled = true; return false; }
-bool DummyControlImplOverride::OnKeyEvent(const KeyEvent& event) { keyEventCalled = true; return false;}
-void DummyControlImplOverride::OnKeyInputFocusGained() { keyInputFocusGained = true; }
-void DummyControlImplOverride::OnKeyInputFocusLost() { keyInputFocusLost = true; }
-
-void DummyControlImplOverride::OnRelayout( const Vector2& size, RelayoutContainer& container )
+void Impl::DummyControl::OnPinch(const PinchGesture& pinch) { pinchCalled = true; }
+void Impl::DummyControl::OnPan(const PanGesture& pan) { panCalled = true; }
+void Impl::DummyControl::OnTap(const TapGesture& tap) { tapCalled = true; }
+void Impl::DummyControl::OnLongPress(const LongPressGesture& longPress) { longPressCalled = true; }
+void Impl::DummyControl::OnStageConnection( int depth ) { Control::OnStageConnection( depth ); stageConnectionCalled = true; }
+void Impl::DummyControl::OnStageDisconnection() { stageDisconnectionCalled = true; Control::OnStageDisconnection(); }
+void Impl::DummyControl::OnChildAdd(Actor& child) { childAddCalled = true; }
+void Impl::DummyControl::OnChildRemove(Actor& child) { childRemoveCalled = true; }
+void Impl::DummyControl::OnSizeSet(const Vector3& targetSize) { Control::OnSizeSet( targetSize ); sizeSetCalled = true; }
+void Impl::DummyControl::OnSizeAnimation(Animation& animation, const Vector3& targetSize) { Control::OnSizeAnimation( animation, targetSize ); sizeAnimationCalled = true; }
+bool Impl::DummyControl::OnTouchEvent(const TouchEvent& event) { touchEventCalled = true; return false; }
+bool Impl::DummyControl::OnHoverEvent(const HoverEvent& event) { hoverEventCalled = true; return false; }
+bool Impl::DummyControl::OnWheelEvent(const WheelEvent& event) { wheelEventCalled = true; return false; }
+bool Impl::DummyControl::OnKeyEvent(const KeyEvent& event) { keyEventCalled = true; return false;}
+void Impl::DummyControl::OnKeyInputFocusGained() { keyInputFocusGained = true; }
+void Impl::DummyControl::OnKeyInputFocusLost() { keyInputFocusLost = true; }
+
+void Impl::DummyControl::SetLayout( Property::Index visualIndex, Property::Map& map )
 {
-  Property::Map transformMap;
-  transformMap
-    .Add( Toolkit::DevelVisual::Transform::Property::OFFSET, Vector2(0.0f, 0.0f) )
-    .Add( Toolkit::DevelVisual::Transform::Property::SIZE, Vector2(1.0f, 1.0f) )
-    .Add( Toolkit::DevelVisual::Transform::Property::ORIGIN, Toolkit::Align::CENTER )
-    .Add( Toolkit::DevelVisual::Transform::Property::ANCHOR_POINT, Toolkit::Align::CENTER )
-    .Add( Toolkit::DevelVisual::Transform::Property::OFFSET_SIZE_MODE, Vector4::ZERO );
+  Property::Value value( map );
+  mLayouts[visualIndex] = value;
+}
+
+void Impl::DummyControl::OnRelayout( const Vector2& size, RelayoutContainer& container )
+{
+  Property::Map emptyMap;
 
   for( VisualIndices::iterator iter = mRegisteredVisualIndices.begin(); iter != mRegisteredVisualIndices.end() ; ++iter )
   {
     Visual::Base visual = GetVisual(*iter);
-    visual.SetTransformAndSize( transformMap, size );
+    Property::Value value = mLayouts[*iter];
+    Property::Map* map = NULL;
+
+    if( value.GetType() != Property::NONE )
+    {
+      map = value.GetMap();
+    }
+    if( map == NULL )
+    {
+      map = &emptyMap;
+    }
+
+    visual.SetTransformAndSize( *map, size );
   }
 }
 
-
 DummyControl DummyControl::New( bool override )
 {
   DummyControl control;
 
   if (override)
   {
-    control = DummyControlImplOverride::New();
+    control = Impl::DummyControl::New();
   }
   else
   {
index a425330..f27f296 100644 (file)
@@ -45,7 +45,8 @@ public:
   {
     enum Type
     {
-      TEST_VISUAL = PROPERTY_START_INDEX
+      TEST_VISUAL = PROPERTY_START_INDEX,
+      TEST_VISUAL2
     };
   };
 
@@ -70,7 +71,7 @@ public: // Not intended for application developers
  * Cannot create an instance of Internal::Control, so use this dummy class for the implementation.
  * This class does not override any of Internal::Control's behaviour.
  */
-class DummyControlImpl : public Internal::Control
+class DummyControlImpl : public Toolkit::Internal::Control
 {
 public:
 
@@ -111,21 +112,26 @@ protected:
   virtual ~DummyControlImpl();
 };
 
+namespace Impl
+{
+
 /**
  * Cannot create an instance of Internal::Control, so use this dummy class for the implementation.
  * This class DOES override Internal::Control's behaviour.
  */
-class DummyControlImplOverride : public DummyControlImpl
+class DummyControl : public Toolkit::DummyControlImpl
 {
 public:
 
-  static DummyControl New();
+  static Toolkit::DummyControl New();
+
+  void SetLayout( Property::Index visualIndex, Property::Map& map );
 
 private:
 
-  DummyControlImplOverride();
+  DummyControl();
 
-  virtual ~DummyControlImplOverride();
+  virtual ~DummyControl();
 
 private: // From Internal::Control
 
@@ -156,6 +162,9 @@ private: // From CustomActorImpl
   virtual void OnKeyInputFocusLost();
   virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
 
+  DALI_INTERNAL DummyControl( const DummyControl& );
+  DALI_INTERNAL DummyControl& operator=( const DummyControl& );
+
 public:
 
   bool initializeCalled;
@@ -180,8 +189,12 @@ public:
   bool keyEventCalled;
   bool keyInputFocusGained;
   bool keyInputFocusLost;
+
+  Property::Map mLayouts;
 };
 
+} // namespace Impl
+
 } // namespace Toolkit
 
 } // namespace Dali
index 6301fd5..23200c0 100644 (file)
@@ -2338,7 +2338,7 @@ int UtcDaliAccessibilityManagerActionTouch(void)
   Dali::AccessibilityAdaptor accessibilityAdaptor = Dali::AccessibilityAdaptor::Get();
 
   DummyControl dummyControl = DummyControl::New(true);
-  DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummyControl.GetImplementation());
+  Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
   dummyControl.SetSize(480, 800);
   manager.SetFocusOrder( dummyControl, 1 );
   Stage::GetCurrent().Add( dummyControl );
index 77c2436..6150385 100644 (file)
@@ -232,7 +232,7 @@ int UtcDaliControlImplOnGestureMethods(void)
     application.SendNotification();
     application.Render();
 
-    DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
+    Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
     dummyImpl.EnableGestureDetection( Gesture::Type(Gesture::Pinch | Gesture::Pan | Gesture::Tap | Gesture::LongPress) );
 
     DALI_TEST_CHECK( dummyImpl.pinchCalled == false );
@@ -347,7 +347,7 @@ int UtcDaliControlImplChildAddAndRemove(void)
   {
     DummyControl dummy = DummyControl::New( true );
     Stage::GetCurrent().Add(dummy);
-    DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
+    Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
 
     application.Render();
     application.SendNotification();
@@ -406,7 +406,7 @@ int UtcDaliControlImplStageConnection(void)
 
   {
     DummyControl dummy = DummyControl::New( true );
-    DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
+    Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
 
     DALI_TEST_EQUALS( dummyImpl.stageConnectionCalled, false, TEST_LOCATION );
     Stage::GetCurrent().Add(dummy);
@@ -446,7 +446,7 @@ int UtcDaliControlImplSizeSetP(void)
 
   {
     DummyControl dummy = DummyControl::New( true );
-    DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
+    Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
 
     Stage::GetCurrent().Add(dummy);
     application.Render();
@@ -503,7 +503,7 @@ int UtcDaliControlImplSizeAnimation(void)
 
   {
     DummyControl dummy = DummyControl::New( true );
-    DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
+    Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
 
     Stage::GetCurrent().Add(dummy);
 
@@ -550,7 +550,7 @@ int UtcDaliControlImplTouchEvent(void)
 
   {
     DummyControl dummy = DummyControl::New( true );
-    DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
+    Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
 
     dummy.SetSize( Vector2( 100.0f, 100.0f ) );
     dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
@@ -606,7 +606,7 @@ int UtcDaliControlImplHoverEvent(void)
 
   {
     DummyControl dummy = DummyControl::New( true );
-    DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
+    Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
 
     dummy.SetSize( Vector2( 100.0f, 100.0f ) );
     dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
@@ -665,7 +665,7 @@ int UtcDaliControlImplKeyEvent(void)
 
   {
     DummyControl dummy = DummyControl::New( true );
-    DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
+    Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
 
     Stage::GetCurrent().Add(dummy);
     dummy.SetKeyInputFocus();
@@ -709,7 +709,7 @@ int UtcDaliControlImplKeyInputFocusGained(void)
 
   {
     DummyControl dummy = DummyControl::New( true );
-    DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
+    Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
 
     Stage::GetCurrent().Add(dummy);
 
@@ -739,7 +739,7 @@ int UtcDaliControlImplKeyInputFocusLost(void)
 
   {
     DummyControl dummy = DummyControl::New( true );
-    DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
+    Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
 
     Stage::GetCurrent().Add(dummy);
 
@@ -761,7 +761,7 @@ int UtcDaliControlImplKeyInputFocusLost(void)
     dummy.SetKeyInputFocus();
     dummy.ClearKeyInputFocus();
 
-    DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
+    Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
 
     dummyImpl.IsKeyboardNavigationSupported();
     dummyImpl.IsKeyboardFocusGroup();
@@ -803,7 +803,7 @@ int UtcDaliControlImplWheelEvent(void)
 
   {
     DummyControl dummy = DummyControl::New( true );
-    DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
+    Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
 
     dummy.SetSize( Vector2( 100.0f, 100.0f ) );
     dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
@@ -1350,7 +1350,6 @@ int UtcDaliControlImplRegisterTwoVisualsAndEnableOnlyOne(void)
 
   END_TEST;
 }
-
 int UtcDaliControlImplAutoClippingWithVisuals(void)
 {
   ToolkitTestApplication application;
index 2ff700b..40f9c7c 100644 (file)
@@ -420,12 +420,54 @@ int UtcDaliImageViewAsyncLoadingWithAtlasing(void)
   END_TEST;
 }
 
+int UtcDaliImageViewAsyncLoadingWithAtlasing02(void)
+{
+  ToolkitTestApplication application;
+
+  //Async loading, automatic atlasing for small size image
+  TraceCallStack& callStack = application.GetGlAbstraction().GetTextureTrace();
+  callStack.Reset();
+  callStack.Enable(true);
+
+  Property::Map asyncLoadingMap;
+  asyncLoadingMap[ "url" ] = gImage_34_RGBA;
+  asyncLoadingMap[ "desiredHeight" ] = 34;
+  asyncLoadingMap[ "desiredWidth" ] = 34;
+  asyncLoadingMap[ "synchronousLoading" ] = false;
+
+  ImageView imageView = ImageView::New();
+  imageView.SetProperty( ImageView::Property::IMAGE, asyncLoadingMap );
+
+  Stage::GetCurrent().Add( imageView );
+  application.SendNotification();
+  application.Render(16);
+  application.Render(16);
+  application.SendNotification();
+
+  // loading started, this waits for the loader thread for max 30 seconds
+  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+
+  application.SendNotification();
+  application.Render(16);
+
+  callStack.Enable(false);
+
+  TraceCallStack::NamedParams params;
+  params["width"] = ToString(34);
+  params["height"] = ToString(34);
+  DALI_TEST_EQUALS( callStack.FindMethodAndParams( "TexSubImage2D", params ), true, TEST_LOCATION );
+
+  END_TEST;
+}
+
 int UtcDaliImageViewSyncLoading(void)
 {
   ToolkitTestApplication application;
 
+  tet_infoline("ImageView Testing sync loading and size using index key property map");
+
   Property::Map syncLoadingMap;
-  syncLoadingMap[ "synchronousLoading" ] = true;
+  syncLoadingMap[ ImageVisual::Property::SYNCHRONOUS_LOADING ] = true;
 
   // Sync loading, no atlasing for big size image
   {
@@ -475,6 +517,51 @@ int UtcDaliImageViewSyncLoading(void)
   END_TEST;
 }
 
+
+int UtcDaliImageViewSyncLoading02(void)
+{
+  ToolkitTestApplication application;
+
+  tet_infoline("ImageView Testing sync loading and size using string key property map");
+
+  // Sync loading, automatic atlasing for small size image
+  {
+    BitmapLoader::ResetLatestCreated();
+    TraceCallStack& callStack = application.GetGlAbstraction().GetTextureTrace();
+    callStack.Reset();
+    callStack.Enable(true);
+
+    ImageView imageView = ImageView::New( );
+
+    // Sync loading is used
+    Property::Map syncLoadingMap;
+    syncLoadingMap[ "url" ] = gImage_34_RGBA;
+    syncLoadingMap[ "desiredHeight" ] = 34;
+    syncLoadingMap[ "desiredWidth" ] = 34;
+    syncLoadingMap[ "synchronousLoading" ] = true;
+    imageView.SetProperty( ImageView::Property::IMAGE, syncLoadingMap );
+
+    // loading is started even if the actor is offStage
+    BitmapLoader loader = BitmapLoader::GetLatestCreated();
+    DALI_TEST_CHECK( loader );
+
+    loader.WaitForLoading();
+
+    DALI_TEST_CHECK( loader.IsLoaded() );
+
+    Stage::GetCurrent().Add( imageView );
+    application.SendNotification();
+    application.Render(16);
+
+    TraceCallStack::NamedParams params;
+    params["width"] = ToString(34);
+    params["height"] = ToString(34);
+    DALI_TEST_EQUALS( callStack.FindMethodAndParams( "TexSubImage2D", params ),
+                      true, TEST_LOCATION );
+  }
+  END_TEST;
+}
+
 int UtcDaliImageViewSizeWithBackground(void)
 {
   ToolkitTestApplication application;
index 395b409..8231d2e 100644 (file)
@@ -141,7 +141,7 @@ int UtcDaliKeyInputFocusManagerSetFocus01(void)
   DALI_TEST_CHECK( ! focusedControl );
 
   DummyControl dummy = DummyControl::New(true);
-  DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
+  Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
   dummy.SetSize(100.0f, 100.0f);
   stage.Add( dummy );
   DALI_TEST_CHECK( ! dummyImpl.keyInputFocusGained );
@@ -168,7 +168,7 @@ int UtcDaliKeyInputFocusManagerSetFocus02(void)
   DALI_TEST_CHECK(manager);
 
   DummyControl dummy1 = DummyControl::New(true);
-  DummyControlImplOverride& dummy1Impl = static_cast<DummyControlImplOverride&>(dummy1.GetImplementation());
+  Impl::DummyControl& dummy1Impl = static_cast<Impl::DummyControl&>(dummy1.GetImplementation());
   dummy1.SetSize(100.0f, 100.0f);
   stage.Add( dummy1 );
   DALI_TEST_CHECK( ! dummy1Impl.keyInputFocusGained );
@@ -182,7 +182,7 @@ int UtcDaliKeyInputFocusManagerSetFocus02(void)
   dummy1Impl.keyInputFocusGained = false;
 
   DummyControl dummy2 = DummyControl::New(true);
-  DummyControlImplOverride& dummy2Impl = static_cast<DummyControlImplOverride&>(dummy2.GetImplementation());
+  Impl::DummyControl& dummy2Impl = static_cast<Impl::DummyControl&>(dummy2.GetImplementation());
   dummy2.SetSize(100.0f, 100.0f);
   stage.Add( dummy2 );
   DALI_TEST_CHECK( ! dummy2Impl.keyInputFocusGained );
@@ -213,14 +213,14 @@ int UtcDaliKeyInputFocusManagerGetCurrentFocusControl(void)
   DALI_TEST_CHECK(manager);
 
   DummyControl dummy1 = DummyControl::New(true);
-  DummyControlImplOverride& dummy1Impl = static_cast<DummyControlImplOverride&>(dummy1.GetImplementation());
+  Impl::DummyControl& dummy1Impl = static_cast<Impl::DummyControl&>(dummy1.GetImplementation());
   dummy1.SetSize(100.0f, 100.0f);
   stage.Add( dummy1 );
   DALI_TEST_CHECK( ! dummy1Impl.keyInputFocusGained );
   DALI_TEST_CHECK( ! dummy1Impl.keyInputFocusLost );
 
   DummyControl dummy2 = DummyControl::New(true);
-  DummyControlImplOverride& dummy2Impl = static_cast<DummyControlImplOverride&>(dummy2.GetImplementation());
+  Impl::DummyControl& dummy2Impl = static_cast<Impl::DummyControl&>(dummy2.GetImplementation());
   dummy2.SetSize(100.0f, 100.0f);
   stage.Add( dummy2 );
   DALI_TEST_CHECK( ! dummy2Impl.keyInputFocusGained );
@@ -265,14 +265,14 @@ int UtcDaliKeyInputFocusManagerRemoveFocus01(void)
   DALI_TEST_CHECK(manager);
 
   DummyControl dummy1 = DummyControl::New(true);
-  DummyControlImplOverride& dummy1Impl = static_cast<DummyControlImplOverride&>(dummy1.GetImplementation());
+  Impl::DummyControl& dummy1Impl = static_cast<Impl::DummyControl&>(dummy1.GetImplementation());
   dummy1.SetSize(100.0f, 100.0f);
   stage.Add( dummy1 );
   DALI_TEST_CHECK( ! dummy1Impl.keyInputFocusGained );
   DALI_TEST_CHECK( ! dummy1Impl.keyInputFocusLost );
 
   DummyControl dummy2 = DummyControl::New(true);
-  DummyControlImplOverride& dummy2Impl = static_cast<DummyControlImplOverride&>(dummy2.GetImplementation());
+  Impl::DummyControl& dummy2Impl = static_cast<Impl::DummyControl&>(dummy2.GetImplementation());
   dummy2.SetSize(100.0f, 100.0f);
   stage.Add( dummy2 );
   DALI_TEST_CHECK( ! dummy2Impl.keyInputFocusGained );
@@ -320,21 +320,21 @@ int UtcDaliKeyInputFocusManagerRemoveFocus02(void)
   DALI_TEST_CHECK(manager);
 
   DummyControl dummy1 = DummyControl::New(true);
-  DummyControlImplOverride& dummy1Impl = static_cast<DummyControlImplOverride&>(dummy1.GetImplementation());
+  Impl::DummyControl& dummy1Impl = static_cast<Impl::DummyControl&>(dummy1.GetImplementation());
   dummy1.SetSize(100.0f, 100.0f);
   stage.Add( dummy1 );
   DALI_TEST_CHECK( ! dummy1Impl.keyInputFocusGained );
   DALI_TEST_CHECK( ! dummy1Impl.keyInputFocusLost );
 
   DummyControl dummy2 = DummyControl::New(true);
-  DummyControlImplOverride& dummy2Impl = static_cast<DummyControlImplOverride&>(dummy2.GetImplementation());
+  Impl::DummyControl& dummy2Impl = static_cast<Impl::DummyControl&>(dummy2.GetImplementation());
   dummy2.SetSize(100.0f, 100.0f);
   stage.Add( dummy2 );
   DALI_TEST_CHECK( ! dummy2Impl.keyInputFocusGained );
   DALI_TEST_CHECK( ! dummy2Impl.keyInputFocusLost );
 
   DummyControl dummy3 = DummyControl::New(true);
-  DummyControlImplOverride& dummy3Impl = static_cast<DummyControlImplOverride&>(dummy3.GetImplementation());
+  Impl::DummyControl& dummy3Impl = static_cast<Impl::DummyControl&>(dummy3.GetImplementation());
   dummy3.SetSize(100.0f, 100.0f);
   stage.Add( dummy3 );
   DALI_TEST_CHECK( ! dummy3Impl.keyInputFocusGained );
@@ -384,14 +384,14 @@ int UtcDaliKeyInputFocusManagerRemoveFocus03(void)
   DALI_TEST_CHECK(manager);
 
   DummyControl dummy1 = DummyControl::New(true);
-  DummyControlImplOverride& dummy1Impl = static_cast<DummyControlImplOverride&>(dummy1.GetImplementation());
+  Impl::DummyControl& dummy1Impl = static_cast<Impl::DummyControl&>(dummy1.GetImplementation());
   dummy1.SetSize(100.0f, 100.0f);
   stage.Add( dummy1 );
   DALI_TEST_CHECK( ! dummy1Impl.keyInputFocusGained );
   DALI_TEST_CHECK( ! dummy1Impl.keyInputFocusLost );
 
   DummyControl dummy2 = DummyControl::New(true);
-  DummyControlImplOverride& dummy2Impl = static_cast<DummyControlImplOverride&>(dummy2.GetImplementation());
+  Impl::DummyControl& dummy2Impl = static_cast<Impl::DummyControl&>(dummy2.GetImplementation());
   dummy2.SetSize(100.0f, 100.0f);
   stage.Add( dummy2 );
   DALI_TEST_CHECK( ! dummy2Impl.keyInputFocusGained );
@@ -473,7 +473,7 @@ int UtcDaliKeyInputFocusManagerDestroyObject01(void)
   DALI_TEST_CHECK(manager);
 
   DummyControl dummy1 = DummyControl::New(true);
-  DummyControlImplOverride& dummy1Impl = static_cast<DummyControlImplOverride&>(dummy1.GetImplementation());
+  Impl::DummyControl& dummy1Impl = static_cast<Impl::DummyControl&>(dummy1.GetImplementation());
   dummy1.SetSize(100.0f, 100.0f);
   stage.Add( dummy1 );
   DALI_TEST_CHECK( ! dummy1Impl.keyInputFocusGained );
@@ -481,7 +481,7 @@ int UtcDaliKeyInputFocusManagerDestroyObject01(void)
 
   {
     DummyControl dummy2 = DummyControl::New(true);
-    DummyControlImplOverride& dummy2Impl = static_cast<DummyControlImplOverride&>(dummy2.GetImplementation());
+    Impl::DummyControl& dummy2Impl = static_cast<Impl::DummyControl&>(dummy2.GetImplementation());
     dummy2.SetSize(100.0f, 100.0f);
     stage.Add( dummy2 );
     DALI_TEST_CHECK( ! dummy2Impl.keyInputFocusGained );
@@ -518,7 +518,7 @@ int UtcDaliKeyInputFocusManagerDestroyObject02(void)
   DALI_TEST_CHECK(manager);
 
   DummyControl dummy1 = DummyControl::New(true);
-  DummyControlImplOverride& dummy1Impl = static_cast<DummyControlImplOverride&>(dummy1.GetImplementation());
+  Impl::DummyControl& dummy1Impl = static_cast<Impl::DummyControl&>(dummy1.GetImplementation());
   dummy1.SetSize(100.0f, 100.0f);
   stage.Add( dummy1 );
   DALI_TEST_CHECK( ! dummy1Impl.keyInputFocusGained );
@@ -526,7 +526,7 @@ int UtcDaliKeyInputFocusManagerDestroyObject02(void)
 
 
   DummyControl dummy2 = DummyControl::New(true);
-  DummyControlImplOverride& dummy2Impl = static_cast<DummyControlImplOverride&>(dummy2.GetImplementation());
+  Impl::DummyControl& dummy2Impl = static_cast<Impl::DummyControl&>(dummy2.GetImplementation());
   dummy2.SetSize(100.0f, 100.0f);
   stage.Add( dummy2 );
   DALI_TEST_CHECK( ! dummy2Impl.keyInputFocusGained );
index 58559d5..5ca2b17 100644 (file)
@@ -262,7 +262,6 @@ int UtcDaliTransitionDataMap1P(void)
   anim.Play();
 
   application.SendNotification();
-  application.Render(0);
   application.Render(500); // Start animation
   application.Render(500); // Halfway thru anim
   application.SendNotification();
index 4885bc2..6d88a51 100644 (file)
@@ -24,6 +24,7 @@
 #include <dali/public-api/rendering/shader.h>
 #include <dali/devel-api/object/handle-devel.h>
 #include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
+#include <dali-toolkit/devel-api/visual-factory/transition-data.h>
 #include <dali-toolkit/devel-api/visuals/text-visual-properties.h>
 #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
 #include <dali-toolkit/devel-api/align-enums.h>
@@ -97,6 +98,19 @@ void dali_visual_cleanup(void)
   test_return_value = TET_PASS;
 }
 
+
+static void TestMixColor( Visual::Base visual, Property::Index mixColorIndex, const Vector4& testColor )
+{
+  Property::Map map;
+  visual.CreatePropertyMap(map);
+  Property::Value* value = map.Find( mixColorIndex );
+  DALI_TEST_CHECK( value );
+  Vector4 mixColor;
+  DALI_TEST_CHECK( value->Get( mixColor ) );
+  DALI_TEST_EQUALS( mixColor, testColor, 0.001, TEST_LOCATION );
+}
+
+
 int UtcDaliVisualCopyAndAssignment(void)
 {
   ToolkitTestApplication application;
@@ -162,9 +176,9 @@ int UtcDaliVisualSetGetDepthIndex(void)
 
   visual.SetDepthIndex( 1.f );
 
-  DummyControl dummyControl = DummyControl::New();
-  DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummyControl.GetImplementation());
-  dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual );
+  DummyControl dummyControl = DummyControl::New(true);
+  Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
 
   dummyControl.SetSize(200.f, 200.f);
   Stage::GetCurrent().Add( dummyControl );
@@ -228,9 +242,11 @@ int UtcDaliVisualSize(void)
   propertyMap.Insert(Visual::Property::TYPE,  Visual::GRADIENT);
   Vector2 start(-1.f, -1.f);
   Vector2 end(1.f, 1.f);
-  propertyMap.Insert(GradientVisual::Property::START_POSITION,   start);
-  propertyMap.Insert(GradientVisual::Property::END_POSITION,   end);
-  propertyMap.Insert(GradientVisual::Property::STOP_OFFSET,   Vector2(0.f, 1.f));
+  propertyMap.Insert( "mixColor", Color::MAGENTA );
+  propertyMap.Insert( GradientVisual::Property::START_POSITION,   start) ;
+  propertyMap.Insert( GradientVisual::Property::END_POSITION,   end );
+  propertyMap.Insert( GradientVisual::Property::STOP_OFFSET,   Vector2(0.f, 1.f) );
+  propertyMap.Insert( GradientVisual::Property::SPREAD_METHOD, GradientVisual::SpreadMethod::REPEAT) ;
   Property::Array stopColors;
   stopColors.PushBack( Color::RED );
   stopColors.PushBack( Color::GREEN );
@@ -262,7 +278,7 @@ int UtcDaliVisualSize(void)
   propertyMap.Clear();
   propertyMap.Insert( Visual::Property::TYPE, Visual::IMAGE );
   propertyMap.Insert( ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME );
-  propertyMap.Insert( ImageVisual::Property::BATCHING_ENABLED, true );
+  propertyMap.Insert( "batchingEnabled", true );
   Visual::Base batchImageVisual = factory.CreateVisual( propertyMap );
   batchImageVisual.SetTransformAndSize(DefaultTransform(), controlSize );
   batchImageVisual.GetNaturalSize( naturalSize );
@@ -315,9 +331,9 @@ int UtcDaliVisualSetOnOffStage(void)
   propertyMap.Insert(ColorVisual::Property::MIX_COLOR,  Color::BLUE);
   Visual::Base visual = factory.CreateVisual( propertyMap );
 
-  DummyControl actor = DummyControl::New();
-  DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
-  dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual );
+  DummyControl actor = DummyControl::New(true);
+  Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
 
   actor.SetSize(200.f, 200.f);
 
@@ -340,16 +356,15 @@ int UtcDaliVisualSetOnOffStage(void)
   END_TEST;
 }
 
-
 int UtcDaliVisualGetPropertyMap1(void)
 {
   ToolkitTestApplication application;
-  tet_infoline( "UtcDaliVisualGetPropertyMap1: ColorVisual" );
+  tet_infoline( "UtcDaliVisualGetPropertyMap1: ColorVisual (With base MixColor" );
 
   VisualFactory factory = VisualFactory::Get();
   Property::Map propertyMap;
   propertyMap.Insert(Visual::Property::TYPE,  Visual::COLOR);
-  propertyMap.Insert(ColorVisual::Property::MIX_COLOR,  Color::BLUE);
+  propertyMap.Insert(DevelVisual::Property::MIX_COLOR,  Color::BLUE);
   Visual::Base colorVisual = factory.CreateVisual( propertyMap );
 
   Property::Map resultMap;
@@ -383,8 +398,10 @@ int UtcDaliVisualGetPropertyMap2(void)
   VisualFactory factory = VisualFactory::Get();
   Property::Map propertyMap;
   propertyMap.Insert(Visual::Property::TYPE,  Visual::BORDER);
-  propertyMap.Insert(BorderVisual::Property::COLOR,  Color::BLUE);
-  propertyMap.Insert(BorderVisual::Property::SIZE,  5.f);
+  propertyMap.Insert("mixColor", Vector4(1.0f, 0.0f, 1.0f, 0.5f) );
+  propertyMap.Insert("borderColor",  Color::BLUE);
+  propertyMap.Insert("borderSize",  5.f);
+  propertyMap.Insert("antiAliasing",  true);
   Visual::Base borderVisual = factory.CreateVisual( propertyMap );
 
   Property::Map resultMap;
@@ -403,6 +420,10 @@ int UtcDaliVisualGetPropertyMap2(void)
   DALI_TEST_CHECK( sizeValue );
   DALI_TEST_CHECK( sizeValue->Get<float>() == 5.f );
 
+  Property::Value* AAValue = resultMap.Find( BorderVisual::Property::ANTI_ALIASING, Property::BOOLEAN );
+  DALI_TEST_CHECK( AAValue );
+  DALI_TEST_CHECK( AAValue->Get<bool>() == true );
+
   Property::Map propertyMap1;
   propertyMap1[ Visual::Property::TYPE ] = Visual::BORDER;
   propertyMap1[ BorderVisual::Property::COLOR  ] = Color::CYAN;
@@ -426,6 +447,30 @@ int UtcDaliVisualGetPropertyMap2(void)
   END_TEST;
 }
 
+int UtcDaliVisualGetPropertyMap2N(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliVisualGetPropertyMap2N: BorderVisual with no setup properties" );
+
+  VisualFactory factory = VisualFactory::Get();
+  Property::Map propertyMap;
+  propertyMap.Insert(Visual::Property::TYPE,  Visual::BORDER);
+  Visual::Base borderVisual = factory.CreateVisual( propertyMap );
+
+  tet_infoline( "Test that the visual is created, with a default renderer" );
+  DALI_TEST_CHECK( borderVisual );
+
+  DummyControl dummyControl = DummyControl::New(true);
+  Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, borderVisual );
+  Stage::GetCurrent().Add( dummyControl );
+
+  DALI_TEST_EQUALS( dummyControl.GetRendererCount(), 1, TEST_LOCATION );
+
+  END_TEST;
+}
+
+
 int UtcDaliVisualGetPropertyMap3(void)
 {
   ToolkitTestApplication application;
@@ -439,9 +484,9 @@ int UtcDaliVisualGetPropertyMap3(void)
 
   Vector2 start(-1.f, -1.f);
   Vector2 end(1.f, 1.f);
-  propertyMap.Insert(GradientVisual::Property::START_POSITION, start);
-  propertyMap.Insert(GradientVisual::Property::END_POSITION, end);
-  propertyMap.Insert(GradientVisual::Property::SPREAD_METHOD, GradientVisual::SpreadMethod::REPEAT);
+  propertyMap.Insert( "startPosition", start);
+  propertyMap.Insert( "endPosition", end);
+  propertyMap.Insert( "spreadMethod", GradientVisual::SpreadMethod::REPEAT);
 
   propertyMap.Insert(GradientVisual::Property::STOP_OFFSET,   Vector2(0.2f, 0.8f));
 
@@ -572,14 +617,15 @@ int UtcDaliVisualGetPropertyMap5(void)
   VisualFactory factory = VisualFactory::Get();
   Property::Map propertyMap;
   propertyMap.Insert( Visual::Property::TYPE,  Visual::IMAGE );
+  propertyMap.Insert( DevelVisual::Property::MIX_COLOR, Color::MAGENTA );
   propertyMap.Insert( ImageVisual::Property::URL,  TEST_IMAGE_FILE_NAME );
   propertyMap.Insert( ImageVisual::Property::DESIRED_WIDTH,   20 );
   propertyMap.Insert( ImageVisual::Property::DESIRED_HEIGHT,   30 );
-  propertyMap.Insert( ImageVisual::Property::FITTING_MODE,   FittingMode::FIT_HEIGHT );
-  propertyMap.Insert( ImageVisual::Property::SAMPLING_MODE,   SamplingMode::BOX_THEN_NEAREST );
-  propertyMap.Insert( ImageVisual::Property::PIXEL_AREA, Vector4( 0.25f, 0.25f, 0.5f, 0.5f ) );
-  propertyMap.Insert( ImageVisual::Property::WRAP_MODE_U, WrapMode::REPEAT );
-  propertyMap.Insert( ImageVisual::Property::WRAP_MODE_V, WrapMode::MIRRORED_REPEAT );
+  propertyMap.Insert( "fittingMode",   FittingMode::FIT_HEIGHT );
+  propertyMap.Insert( "samplingMode",   SamplingMode::BOX_THEN_NEAREST );
+  propertyMap.Insert( "pixelArea", Vector4( 0.25f, 0.25f, 0.5f, 0.5f ) );
+  propertyMap.Insert( "wrapModeU", WrapMode::REPEAT );
+  propertyMap.Insert( "wrapModeV", WrapMode::MIRRORED_REPEAT );
   propertyMap.Insert( "synchronousLoading",   true );
 
   Visual::Base imageVisual = factory.CreateVisual(propertyMap);
@@ -597,6 +643,10 @@ int UtcDaliVisualGetPropertyMap5(void)
   DALI_TEST_CHECK( value );
   DALI_TEST_CHECK( value->Get<std::string>() == TEST_IMAGE_FILE_NAME );
 
+  value = resultMap.Find( DevelVisual::Property::MIX_COLOR,  Property::VECTOR4 );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_CHECK( value->Get<Vector4>() == Color::MAGENTA );
+
   value = resultMap.Find( ImageVisual::Property::FITTING_MODE,   Property::INTEGER );
   DALI_TEST_CHECK( value );
   DALI_TEST_CHECK( value->Get<int>() == FittingMode::FIT_HEIGHT );
@@ -685,6 +735,7 @@ int UtcDaliVisualGetPropertyMap6(void)
   VisualFactory factory = VisualFactory::Get();
   Property::Map propertyMap;
   propertyMap.Insert( Visual::Property::TYPE,  Visual::IMAGE );
+  propertyMap.Insert( "mixColor",  Color::MAGENTA );
   propertyMap.Insert( ImageVisual::Property::URL,  TEST_NPATCH_FILE_NAME );
   propertyMap.Insert( ImageVisual::Property::BORDER_ONLY,  true );
   Visual::Base nPatchVisual = factory.CreateVisual( propertyMap );
@@ -697,6 +748,10 @@ int UtcDaliVisualGetPropertyMap6(void)
   DALI_TEST_CHECK( value );
   DALI_TEST_CHECK( value->Get<int>() == Visual::IMAGE );
 
+  value = resultMap.Find( DevelVisual::Property::MIX_COLOR,  Property::VECTOR4 );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_CHECK( value->Get<Vector4>() == Color::MAGENTA );
+
   value = resultMap.Find( ImageVisual::Property::URL,  Property::STRING );
   DALI_TEST_CHECK( value );
   DALI_TEST_CHECK( value->Get<std::string>() == TEST_NPATCH_FILE_NAME );
@@ -718,6 +773,7 @@ int UtcDaliVisualGetPropertyMap7(void)
   VisualFactory factory = VisualFactory::Get();
   Property::Map propertyMap;
   propertyMap.Insert( Visual::Property::TYPE,  Visual::IMAGE );
+  propertyMap.Insert( DevelVisual::Property::MIX_COLOR, Color::WHITE );
   propertyMap.Insert( ImageVisual::Property::URL, TEST_SVG_FILE_NAME );
   Visual::Base svgVisual = factory.CreateVisual( propertyMap );
 
@@ -758,6 +814,7 @@ int UtcDaliVisualGetPropertyMap8(void)
   VisualFactory factory = VisualFactory::Get();
   Property::Map propertyMap;
   propertyMap.Insert( Visual::Property::TYPE, Visual::MESH );
+  propertyMap.Insert( DevelVisual::Property::MIX_COLOR, Color::BLUE );
   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 );
@@ -767,6 +824,7 @@ int UtcDaliVisualGetPropertyMap8(void)
 
   Property::Map resultMap;
   meshVisual.CreatePropertyMap( resultMap );
+  TestMixColor( meshVisual, DevelVisual::Property::MIX_COLOR, Color::BLUE );
 
   //Check values in the result map are identical to the initial map's values.
   Property::Value* value = resultMap.Find( Visual::Property::TYPE, Property::INTEGER );
@@ -933,6 +991,7 @@ int UtcDaliVisualGetPropertyMap10(void)
 
   Property::Map propertyMap;
   propertyMap.Insert( Visual::Property::TYPE, DevelVisual::TEXT );
+  propertyMap.Insert( DevelVisual::Property::MIX_COLOR, Color::BLACK );
   propertyMap.Insert( "renderingBackend", static_cast<int>( Toolkit::Text::DEFAULT_RENDERING_BACKEND ) );
   propertyMap.Insert( "enableMarkup", false );
   propertyMap.Insert( "text", "Hello world" );
@@ -957,6 +1016,10 @@ int UtcDaliVisualGetPropertyMap10(void)
   DALI_TEST_CHECK( value );
   DALI_TEST_EQUALS( value->Get<int>(), (int)DevelVisual::TEXT, TEST_LOCATION );
 
+  value = resultMap.Find( DevelVisual::Property::MIX_COLOR, Property::VECTOR4 );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get<Vector4>(), Color::BLACK, 0.001f, TEST_LOCATION );
+
   value = resultMap.Find( TextVisual::Property::TEXT, Property::STRING );
   DALI_TEST_CHECK( value );
   DALI_TEST_EQUALS( value->Get<std::string>(), "Hello world", TEST_LOCATION );
@@ -1058,9 +1121,9 @@ int UtcDaliVisualGetPropertyMapBatchImageVisualNoAtlas(void)
 
   DALI_TEST_CHECK( batchImageVisual );
 
-  DummyControl dummyControl = DummyControl::New();
-  DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummyControl.GetImplementation());
-  dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, batchImageVisual );
+  DummyControl dummyControl = DummyControl::New(true);
+  Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, batchImageVisual );
   Stage::GetCurrent().Add( dummyControl );
 
   DALI_TEST_CHECK( dummyControl.GetRendererCount() == 1u );
@@ -1076,13 +1139,26 @@ int UtcDaliVisualAnimateBorderVisual01(void)
   VisualFactory factory = VisualFactory::Get();
   Property::Map propertyMap;
   propertyMap.Insert(Visual::Property::TYPE,  Visual::BORDER);
+  propertyMap.Insert(DevelVisual::Property::MIX_COLOR, Vector4(1, 1, 1, 0.8f));
   propertyMap.Insert(BorderVisual::Property::COLOR,  Color::BLUE);
   propertyMap.Insert(BorderVisual::Property::SIZE,  5.f);
   Visual::Base borderVisual = factory.CreateVisual( propertyMap );
 
-  DummyControl actor = DummyControl::New();
-  DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
-  dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, borderVisual );
+  Property::Map map;
+  map["target"] = "testVisual";
+  map["property"] = "mixColor";
+  map["targetValue"] = Vector4(1,1,1,0);
+  map["animator"] = Property::Map()
+    .Add("alphaFunction", "LINEAR")
+    .Add("timePeriod", Property::Map()
+         .Add("delay", 0.0f)
+         .Add("duration", 4.0f));
+
+  Dali::Toolkit::TransitionData transition = TransitionData::New( map );
+
+  DummyControl actor = DummyControl::New(true);
+  Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, borderVisual );
   actor.SetSize(2000, 2000);
   actor.SetParentOrigin(ParentOrigin::CENTER);
   Stage::GetCurrent().Add(actor);
@@ -1090,27 +1166,41 @@ int UtcDaliVisualAnimateBorderVisual01(void)
   DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
 
   Renderer renderer = actor.GetRendererAt(0);
-  Property::Index index = DevelHandle::GetPropertyIndex( renderer, BorderVisual::Property::COLOR );
+  Property::Index borderColorIndex = DevelHandle::GetPropertyIndex( renderer, BorderVisual::Property::COLOR );
+  Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, DevelVisual::Property::MIX_COLOR );
 
-  Animation animation = Animation::New(4.0f);
-  animation.AnimateTo( Property(renderer, index), Color::WHITE );
+  Animation animation = dummyImpl.CreateTransition( transition );
+
+  // Animate the mix color through the transition, and the border color through
+  // programmatic method.
+  animation.AnimateTo( Property(renderer, borderColorIndex), Color::WHITE );
   animation.Play();
 
   application.SendNotification();
   application.Render(0);
   application.Render(2000u); // halfway point between blue and white
 
-  Vector4 color = renderer.GetProperty<Vector4>( index );
+  Vector4 color = renderer.GetProperty<Vector4>( borderColorIndex );
   Vector4 testColor = (Color::BLUE + Color::WHITE)*0.5f;
   DALI_TEST_EQUALS( color, testColor, TEST_LOCATION );
   DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("borderColor", testColor ), true, TEST_LOCATION );
 
+  color = renderer.GetProperty<Vector4>( mixColorIndex );
+  testColor = Vector4( 1,1,1,0.4f );
+  DALI_TEST_EQUALS( color, testColor, 0.0001f, TEST_LOCATION );
+  DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("mixColor", testColor ), true, TEST_LOCATION );
+
   application.Render(2000u); // halfway point between blue and white
 
-  color = renderer.GetProperty<Vector4>( index );
+  color = renderer.GetProperty<Vector4>( borderColorIndex );
   DALI_TEST_EQUALS( color, Color::WHITE, TEST_LOCATION );
   DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("borderColor", Color::WHITE ), true, TEST_LOCATION );
 
+  color = renderer.GetProperty<Vector4>( mixColorIndex );
+  testColor = Vector4(1,1,1,0);
+  DALI_TEST_EQUALS( color, testColor, TEST_LOCATION );
+  DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("mixColor", testColor ), true, TEST_LOCATION );
+
   END_TEST;
 }
 
@@ -1127,9 +1217,9 @@ int UtcDaliVisualAnimateBorderVisual02(void)
   propertyMap.Insert(BorderVisual::Property::SIZE,  5.f);
   Visual::Base borderVisual = factory.CreateVisual( propertyMap );
 
-  DummyControl actor = DummyControl::New();
-  DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
-  dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, borderVisual );
+  DummyControl actor = DummyControl::New(true);
+  Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, borderVisual );
   actor.SetSize(2000, 2000);
   actor.SetParentOrigin(ParentOrigin::CENTER);
   Stage::GetCurrent().Add(actor);
@@ -1171,9 +1261,9 @@ int UtcDaliVisualAnimateColorVisual(void)
   propertyMap.Insert(ColorVisual::Property::MIX_COLOR, Color::BLUE);
   Visual::Base borderVisual = factory.CreateVisual( propertyMap );
 
-  DummyControl actor = DummyControl::New();
-  DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
-  dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, borderVisual );
+  DummyControl actor = DummyControl::New(true);
+  Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, borderVisual );
   actor.SetSize(2000, 2000);
   actor.SetParentOrigin(ParentOrigin::CENTER);
   Stage::GetCurrent().Add(actor);
@@ -1183,6 +1273,9 @@ int UtcDaliVisualAnimateColorVisual(void)
   Renderer renderer = actor.GetRendererAt(0);
   Property::Index index = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
 
+  Property::Value blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE );
+  DALI_TEST_EQUALS( blendModeValue.Get<int>(), (int)BlendMode::AUTO, TEST_LOCATION );
+
   Animation animation = Animation::New(4.0f);
   animation.AnimateTo( Property(renderer, index), Color::WHITE );
   animation.Play();
@@ -1204,25 +1297,109 @@ int UtcDaliVisualAnimateColorVisual(void)
 
   DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("mixColor", Color::WHITE ), true, TEST_LOCATION );
 
+  blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE );
+  DALI_TEST_EQUALS( blendModeValue.Get<int>(), (int)BlendMode::AUTO, TEST_LOCATION );
 
   END_TEST;
 }
 
-
 int UtcDaliVisualAnimatePrimitiveVisual(void)
 {
   ToolkitTestApplication application;
   tet_infoline( "UtcDaliAnimatePrimitiveVisual color" );
 
+  {
+    VisualFactory factory = VisualFactory::Get();
+    Property::Map propertyMap;
+    propertyMap.Insert(Visual::Property::TYPE,  Visual::PRIMITIVE);
+    propertyMap.Insert(PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::CUBE);
+    propertyMap.Insert(PrimitiveVisual::Property::MIX_COLOR, Color::BLUE);
+    Visual::Base visual = factory.CreateVisual( propertyMap );
+
+    DummyControl actor = DummyControl::New(true);
+    Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
+    dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+    actor.SetSize(2000, 2000);
+    actor.SetParentOrigin(ParentOrigin::CENTER);
+    actor.SetColor(Color::BLACK);
+    Stage::GetCurrent().Add(actor);
+
+    DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
+
+    Renderer renderer = actor.GetRendererAt(0);
+    Property::Index index = DevelHandle::GetPropertyIndex( renderer, PrimitiveVisual::Property::MIX_COLOR );
+
+    tet_infoline("Test that the renderer has the Primitive mix color");
+    DALI_TEST_CHECK( index != Property::INVALID_INDEX );
+
+    const Vector4 INITIAL_MIX_COLOR( 1.0f,0.0f,1.0f,0.5f ); // Magenta with half alpha
+    const Vector4 TARGET_MIX_COLOR( Color::RED );
+
+    Property::Map map;
+    map["target"] = "testVisual";
+    map["property"] = "mixColor";
+    map["initialValue"] = INITIAL_MIX_COLOR;
+    map["targetValue"] = TARGET_MIX_COLOR;
+    map["animator"] = Property::Map()
+      .Add("alphaFunction", "LINEAR")
+      .Add("timePeriod", Property::Map()
+           .Add("delay", 0.0f)
+           .Add("duration", 4.0f));
+
+    Dali::Toolkit::TransitionData transition = TransitionData::New( map );
+
+    Animation animation = dummyImpl.CreateTransition( transition );
+    Property::Value blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE );
+    DALI_TEST_EQUALS( blendModeValue.Get<int>(), (int)BlendMode::ON, TEST_LOCATION );
+
+    animation.AnimateTo( Property(actor, Actor::Property::COLOR), Color::WHITE );
+    animation.Play();
+
+    application.SendNotification();
+    application.Render(0);
+    application.Render(2000u); // halfway point
+    application.SendNotification();
+
+    DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", Vector4(0.5f, 0.5f, 0.5f, 1.0f )), true, TEST_LOCATION );
+
+    Vector4 halfwayColor = (INITIAL_MIX_COLOR + TARGET_MIX_COLOR)*0.5;
+    DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("mixColor", halfwayColor ), true, TEST_LOCATION );
+
+    application.Render(2001u); // go past end
+    application.SendNotification(); // Trigger signals
+
+    DALI_TEST_EQUALS( actor.GetCurrentColor(), Color::WHITE, TEST_LOCATION );
+    DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", Color::WHITE ), true, TEST_LOCATION );
+    DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("mixColor", TARGET_MIX_COLOR ), true, TEST_LOCATION );
+
+    blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE );
+    DALI_TEST_EQUALS( blendModeValue.Get<int>(), (int)BlendMode::AUTO, TEST_LOCATION );
+
+    actor.Unparent();
+  }
+
+  END_TEST;
+}
+
+int UtcDaliVisualAnimateImageVisualMixColor(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliAnimateImageVisual mix color" );
+
+  application.GetPlatform().SetClosestImageSize( Vector2(100, 100) );
+
   VisualFactory factory = VisualFactory::Get();
   Property::Map propertyMap;
-  propertyMap.Insert(Visual::Property::TYPE,  Visual::COLOR);
-  propertyMap.Insert(ColorVisual::Property::MIX_COLOR, Color::BLUE);
-  Visual::Base borderVisual = factory.CreateVisual( propertyMap );
+  propertyMap.Insert(Visual::Property::TYPE,  Visual::IMAGE);
+  propertyMap.Insert(ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME );
+  propertyMap.Insert("mixColor", Color::BLUE);
+  propertyMap.Insert(ImageVisual::Property::SYNCHRONOUS_LOADING, true);
+  Visual::Base visual = factory.CreateVisual( propertyMap );
+
+  DummyControl actor = DummyControl::New(true);
+  Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
 
-  DummyControl actor = DummyControl::New();
-  DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
-  dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, borderVisual );
   actor.SetSize(2000, 2000);
   actor.SetParentOrigin(ParentOrigin::CENTER);
   actor.SetColor(Color::BLACK);
@@ -1231,12 +1408,33 @@ int UtcDaliVisualAnimatePrimitiveVisual(void)
   DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
 
   Renderer renderer = actor.GetRendererAt(0);
-  Property::Index index = DevelHandle::GetPropertyIndex( renderer, PrimitiveVisual::Property::MIX_COLOR );
+  Property::Index index = DevelHandle::GetPropertyIndex( renderer, DevelVisual::Property::MIX_COLOR );
+  Property::Value blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE );
+  DALI_TEST_EQUALS( blendModeValue.Get<int>(), (int)BlendMode::AUTO, TEST_LOCATION );
 
-  // The property isn't registered on the renderer, it's instead registered on the shader.
-  DALI_TEST_EQUALS( index, Property::INVALID_INDEX, TEST_LOCATION );
+  tet_infoline("Test that the renderer has the mixColor property");
+  DALI_TEST_CHECK( index != Property::INVALID_INDEX );
+
+  const Vector4 TARGET_MIX_COLOR( 1.0f, 0.0f, 0.0f, 0.5f );
+
+  Property::Map map;
+  map["target"] = "testVisual";
+  map["property"] = "mixColor";
+  map["initialValue"] = Color::MAGENTA;
+  map["targetValue"] = TARGET_MIX_COLOR;
+  map["animator"] = Property::Map()
+    .Add("alphaFunction", "LINEAR")
+    .Add("timePeriod", Property::Map()
+         .Add("delay", 0.0f)
+         .Add("duration", 4.0f));
+
+  Dali::Toolkit::TransitionData transition = TransitionData::New( map );
+
+  Animation animation = dummyImpl.CreateTransition( transition );
+
+  blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE );
+  DALI_TEST_EQUALS( blendModeValue.Get<int>(), (int)BlendMode::ON, TEST_LOCATION );
 
-  Animation animation = Animation::New(4.0f);
   animation.AnimateTo( Property(actor, Actor::Property::COLOR), Color::WHITE );
   animation.Play();
 
@@ -1244,18 +1442,87 @@ int UtcDaliVisualAnimatePrimitiveVisual(void)
   application.Render(0);
   application.Render(2000u); // halfway point
 
-  // Actor color overrides renderer color.
   DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", Vector4(0.5f, 0.5f, 0.5f, 1.0f )), true, TEST_LOCATION );
+  DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("mixColor", Vector4(1.0f, 0.0f, 0.5f, 0.75f )), true, TEST_LOCATION );
 
   application.Render(2000u); // halfway point between blue and white
 
   DALI_TEST_EQUALS( actor.GetCurrentColor(), Color::WHITE, TEST_LOCATION );
   DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", Color::WHITE ), true, TEST_LOCATION );
+  DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("mixColor", TARGET_MIX_COLOR), true, TEST_LOCATION );
+
+  TestMixColor( visual, DevelVisual::Property::MIX_COLOR, TARGET_MIX_COLOR );
+
+  blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE );
+  DALI_TEST_EQUALS( blendModeValue.Get<int>(), (int)BlendMode::ON, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliVisualAnimateImageVisualPixelArea(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliAnimateImageVisual pixel area" );
+
+  application.GetPlatform().SetClosestImageSize( Vector2(100, 100) );
+
+  VisualFactory factory = VisualFactory::Get();
+  Property::Map propertyMap;
+  propertyMap.Insert(Visual::Property::TYPE,  Visual::IMAGE);
+  propertyMap.Insert(ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME );
+  propertyMap.Insert("mixColor", Color::BLUE);
+  propertyMap.Insert(ImageVisual::Property::SYNCHRONOUS_LOADING, true);
+  Visual::Base visual = factory.CreateVisual( propertyMap );
+
+  DummyControl actor = DummyControl::New(true);
+  Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+
+  actor.SetSize(2000, 2000);
+  actor.SetParentOrigin(ParentOrigin::CENTER);
+  actor.SetColor(Color::BLACK);
+  Stage::GetCurrent().Add(actor);
+
+  DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
+
+  Renderer renderer = actor.GetRendererAt(0);
+  Property::Index index = DevelHandle::GetPropertyIndex( renderer, DevelVisual::Property::MIX_COLOR );
+
+  tet_infoline("Test that the renderer has the mixColor property");
+  DALI_TEST_CHECK( index != Property::INVALID_INDEX );
+
+  // TransitionData only takes string keys
+  Property::Map map;
+  map["target"] = "testVisual";
+  map["property"] = "pixelArea";
+  map["initialValue"] = Vector4( 0,0,0,1 );
+  map["targetValue"] = Vector4( 0,0,1,1 ); // Animate width from zero to full
+  map["animator"] = Property::Map()
+    .Add("alphaFunction", "LINEAR")
+    .Add("timePeriod", Property::Map()
+         .Add("delay", 0.0f)
+         .Add("duration", 4.0f));
+
+  Dali::Toolkit::TransitionData transition = TransitionData::New( map );
+
+  Animation animation = dummyImpl.CreateTransition( transition );
+  animation.AnimateTo( Property(actor, Actor::Property::COLOR), Color::WHITE );
+  animation.Play();
+
+  application.SendNotification();
+  application.Render(0);
+  application.Render(2000u); // halfway point
+
+  DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("pixelArea", Vector4(0.0f, 0.0f, 0.5f, 1.0f )), true, TEST_LOCATION );
 
+  application.Render(2000u);
+
+  DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("pixelArea", Vector4( 0.0f, 0.0f, 1.0f, 1.0f )), true, TEST_LOCATION );
 
   END_TEST;
 }
 
+
 int UtcDaliVisualWireframeVisual(void)
 {
   ToolkitTestApplication application;
@@ -1371,31 +1638,43 @@ static void TestTransform( ToolkitTestApplication& application, Visual::Base vis
   }
 
   //Put the visual on the stage
-  DummyControl actor = DummyControl::New();
-  DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
-  dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual );
+  DummyControl actor = DummyControl::New(true);
+  Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
   actor.SetSize(2000, 2000);
   actor.SetParentOrigin(ParentOrigin::CENTER);
   Stage::GetCurrent().Add(actor);
 
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+  dummyImpl.SetLayout( DummyControl::Property::TEST_VISUAL, transform );
+
   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" ) );
+  Property::Index index = renderer.GetPropertyIndex( "offset" );
+  DALI_TEST_CHECK( index != Property::INVALID_INDEX );
+  Vector2 offset = renderer.GetProperty<Vector2>( index );
   DALI_TEST_EQUALS( offset, Vector2(10.0f,10.0f), TEST_LOCATION );
 
-  Vector2 size = renderer.GetProperty<Vector2>( renderer.GetPropertyIndex( "size" ) );
+  index = renderer.GetPropertyIndex( "size" );
+  DALI_TEST_CHECK( index != Property::INVALID_INDEX );
+  Vector2 size = renderer.GetProperty<Vector2>( index );
   DALI_TEST_EQUALS( size, Vector2(0.2f,0.2f), TEST_LOCATION );
 
-  Vector4 offsetSizeMode = renderer.GetProperty<Vector4>( renderer.GetPropertyIndex( "offsetSizeMode" ) );
+  index = renderer.GetPropertyIndex( "offsetSizeMode" );
+  DALI_TEST_CHECK( index != Property::INVALID_INDEX );
+  Vector4 offsetSizeMode = renderer.GetProperty<Vector4>( index );
   DALI_TEST_EQUALS( offsetSizeMode, Vector4(1.0f,1.0f,0.0f,0.0f), TEST_LOCATION );
 
-  Vector2 parentOrigin = renderer.GetProperty<Vector2>( renderer.GetPropertyIndex( "origin" ) );
+  index = renderer.GetPropertyIndex( "origin" );
+  DALI_TEST_CHECK( index != Property::INVALID_INDEX );
+  Vector2 parentOrigin = renderer.GetProperty<Vector2>( index );
   DALI_TEST_EQUALS( parentOrigin, Vector2(-0.5f,-0.5f), TEST_LOCATION );
 
-  Vector2 anchorPoint = renderer.GetProperty<Vector2>( renderer.GetPropertyIndex( "anchorPoint" ) );
+  index = renderer.GetPropertyIndex( "anchorPoint" );
+  DALI_TEST_CHECK( index != Property::INVALID_INDEX );
+  Vector2 anchorPoint = renderer.GetProperty<Vector2>( index );
   DALI_TEST_EQUALS( anchorPoint, Vector2(-0.5f,-0.5f), TEST_LOCATION );
 
   //Set a new transform
@@ -1436,6 +1715,7 @@ int UtcDaliVisualSetTransform0(void)
   propertyMap.Insert(ColorVisual::Property::MIX_COLOR,  Color::BLUE);
   Visual::Base visual = factory.CreateVisual( propertyMap );
   TestTransform( application, visual );
+  TestMixColor( visual, ColorVisual::Property::MIX_COLOR, Color::BLUE );
 
   END_TEST;
 }
@@ -1448,12 +1728,13 @@ int UtcDaliVisualSetTransform1(void)
   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::MIX_COLOR ] = Color::WHITE;
   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 );
+  TestMixColor( visual, PrimitiveVisual::Property::MIX_COLOR, Color::WHITE );
 
   END_TEST;
 }
@@ -1466,6 +1747,8 @@ int UtcDaliVisualSetTransform2(void)
   VisualFactory factory = VisualFactory::Get();
   Property::Map propertyMap;
   propertyMap.Insert( Visual::Property::TYPE,  Visual::GRADIENT );
+  propertyMap.Insert( DevelVisual::Property::MIX_COLOR,  Color::GREEN );
+
   Property::Array stopOffsets;
   stopOffsets.PushBack( 0.0f );
   stopOffsets.PushBack( 0.3f );
@@ -1485,6 +1768,7 @@ int UtcDaliVisualSetTransform2(void)
   propertyMap.Insert( GradientVisual::Property::RADIUS, 1.414f );
   Visual::Base visual = factory.CreateVisual( propertyMap );
   TestTransform( application, visual );
+  TestMixColor( visual, DevelVisual::Property::MIX_COLOR, Color::GREEN );
 
   END_TEST;
 }
@@ -1497,10 +1781,12 @@ int UtcDaliVisualSetTransform3(void)
   VisualFactory factory = VisualFactory::Get();
   Property::Map propertyMap;
   propertyMap.Insert( Visual::Property::TYPE, Visual::BORDER );
+  propertyMap.Insert( DevelVisual::Property::MIX_COLOR, Color::MAGENTA );
   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 );
+  TestMixColor( visual, DevelVisual::Property::MIX_COLOR, Color::MAGENTA );
 
   END_TEST;
 }
@@ -1513,13 +1799,16 @@ int UtcDaliVisualSetTransform4(void)
   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) );
+  propertyMap.Insert( DevelVisual::Property::MIX_COLOR, Color::CYAN );
+
+  propertyMap.Insert( "objectUrl", TEST_OBJ_FILE_NAME );
+  propertyMap.Insert( "materialUrl", TEST_MTL_FILE_NAME );
+  propertyMap.Insert( "texturesPath", TEST_RESOURCE_LOCATION );
+  propertyMap.Insert( "shadingMode", MeshVisual::ShadingMode::TEXTURELESS_WITH_DIFFUSE_LIGHTING );
+  propertyMap.Insert( "lightPosition", Vector3( 5.0f, 10.0f, 15.0f) );
   Visual::Base visual = factory.CreateVisual( propertyMap );
   TestTransform( application, visual );
+  TestMixColor( visual, DevelVisual::Property::MIX_COLOR, Color::CYAN );
 
   END_TEST;
 }
@@ -1533,6 +1822,7 @@ int UtcDaliVisualSetTransform5(void)
   Image image = ResourceImage::New(TEST_IMAGE_FILE_NAME, ImageDimensions(100, 200));
   Visual::Base visual = factory.CreateVisual(image);
   TestTransform( application, visual );
+  TestMixColor( visual, DevelVisual::Property::MIX_COLOR, Color::WHITE );
 
   END_TEST;
 }
@@ -1545,6 +1835,7 @@ int UtcDaliVisualSetTransform6(void)
   VisualFactory factory = VisualFactory::Get();
   Property::Map propertyMap;
   propertyMap[Toolkit::Visual::Property::TYPE] = Toolkit::Visual::IMAGE;
+  propertyMap[DevelVisual::Property::MIX_COLOR] = Color::YELLOW;
   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;
@@ -1553,6 +1844,7 @@ int UtcDaliVisualSetTransform6(void)
   propertyMap[Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING] = true;
   Visual::Base visual = factory.CreateVisual(propertyMap);
   TestTransform( application, visual );
+  TestMixColor( visual, DevelVisual::Property::MIX_COLOR, Color::YELLOW );
 
   END_TEST;
 }
@@ -1566,6 +1858,7 @@ int UtcDaliVisualSetTransform7(void)
   Image image = ResourceImage::New(TEST_NPATCH_FILE_NAME, ImageDimensions(100, 200));
   Visual::Base visual = factory.CreateVisual(image);
   TestTransform( application, visual );
+  TestMixColor( visual, DevelVisual::Property::MIX_COLOR, Color::WHITE );
 
   END_TEST;
 }
@@ -1589,16 +1882,19 @@ int UtcDaliNPatchVisualCustomShader(void)
   transformMap["origin"] = Align::CENTER;
   properties[DevelVisual::Property::TRANSFORM] = transformMap;
 
-  properties[Dali::Toolkit::Visual::Property::TYPE] = Dali::Toolkit::Visual::IMAGE;
-  properties[Dali::Toolkit::Visual::Property::SHADER]=shader;
-  properties[Dali::Toolkit::ImageVisual::Property::URL] = TEST_NPATCH_FILE_NAME;
+  properties[Visual::Property::TYPE] = Visual::IMAGE;
+  properties[DevelVisual::Property::MIX_COLOR] = Color::BLUE;
+  properties[Visual::Property::SHADER]=shader;
+  properties[ImageVisual::Property::URL] = TEST_NPATCH_FILE_NAME;
 
   Visual::Base visual = factory.CreateVisual( properties );
+  TestMixColor( visual, DevelVisual::Property::MIX_COLOR, Color::BLUE );
 
   // trigger creation through setting on stage
-  DummyControl dummy = DummyControl::New();
-  DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
-  dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual );
+  DummyControl dummy = DummyControl::New(true);
+  Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+  dummyImpl.SetLayout( DummyControl::Property::TEST_VISUAL, transformMap );
   dummy.SetSize(2000, 2000);
   dummy.SetParentOrigin(ParentOrigin::CENTER);
   Stage::GetCurrent().Add(dummy);
@@ -1620,6 +1916,7 @@ int UtcDaliNPatchVisualCustomShader(void)
 
   END_TEST;
 }
+
 int UtcDaliGradientVisualBlendMode(void)
 {
   ToolkitTestApplication application;
@@ -1639,13 +1936,13 @@ int UtcDaliGradientVisualBlendMode(void)
                      .Add( GradientVisual::Property::STOP_COLOR, Property::Array().Add( Color::RED )
                                                                                   .Add( Vector4( 1.0f, 1.0f, 1.0f, 0.5f ) ) ) );
 
-  DummyControl control = DummyControl::New();
+  DummyControl control = DummyControl::New(true);
   control.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
   Stage::GetCurrent().Add( control );
 
-  DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>( control.GetImplementation() );
-  dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, opaqueGradientVisual );
-  dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 2, alphaGradientVisual );
+  Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>( control.GetImplementation() );
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL,  opaqueGradientVisual );
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL2, alphaGradientVisual );
 
   application.SendNotification();
   application.Render();
@@ -1671,9 +1968,9 @@ int UtcDaliVisualRendererRemovalAndReAddition(void)
 
   visual.SetDepthIndex( 1.f );
 
-  DummyControl dummyControl = DummyControl::New();
-  DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummyControl.GetImplementation());
-  dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual );
+  DummyControl dummyControl = DummyControl::New(true);
+  Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
   DALI_TEST_EQUALS( dummyControl.GetRendererCount(), 0, TEST_LOCATION );
 
   dummyControl.SetSize(200.f, 200.f);
@@ -1715,6 +2012,7 @@ int UtcDaliVisualTextVisualRender(void)
   VisualFactory factory = VisualFactory::Get();
   Property::Map propertyMap;
   propertyMap.Insert( Visual::Property::TYPE, DevelVisual::TEXT );
+  propertyMap.Insert( "mixColor", Color::WHITE );
   propertyMap.Insert( "renderingBackend", static_cast<int>( Toolkit::Text::DEFAULT_RENDERING_BACKEND ) );
   propertyMap.Insert( "enableMarkup", false );
   propertyMap.Insert( "text", "Hello world" );
@@ -1733,8 +2031,8 @@ int UtcDaliVisualTextVisualRender(void)
   textVisual.SetDepthIndex( 1.f );
 
   DummyControl dummyControl = DummyControl::New(true);
-  DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummyControl.GetImplementation());
-  dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, textVisual );
+  Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, textVisual );
   DALI_TEST_EQUALS( dummyControl.GetRendererCount(), 0, TEST_LOCATION );
 
   dummyControl.SetSize(200.f, 200.f);
@@ -1759,7 +2057,7 @@ int UtcDaliVisualTextVisualRender(void)
   textVisual = factory.CreateVisual( propertyMap );
   textVisual.SetDepthIndex( 1.f );
 
-  dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, textVisual );
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, textVisual );
   dummyControl.SetSize( 720.f, 640.f );
 
   application.SendNotification(); // force process events to ensure text visual
index 0e9c014..0b1be30 100644 (file)
@@ -1334,6 +1334,30 @@ int UtcDaliVisualFactoryGetMeshVisual2(void)
   END_TEST;
 }
 
+//Test if mesh loads correctly when supplied with all main parameters, an object file, a material file and a directory location, but duff optional parameters
+int UtcDaliVisualFactoryGetMeshVisual3b(void)
+{
+  //Set up test application first, so everything else can be handled.
+  ToolkitTestApplication application;
+
+  tet_infoline( "UtcDaliVisualFactoryGetMeshVisual3:  Request mesh visual with all parameters correct" );
+
+  //Set up visual properties.
+  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::USE_MIPMAPPING, Color::GREEN ); // Test that wrong property types don't prevent the object load
+  propertyMap.Insert( MeshVisual::Property::USE_SOFT_NORMALS, 1.0f );
+  propertyMap.Insert( MeshVisual::Property::LIGHT_POSITION, 1.0f );
+  propertyMap.Insert( MeshVisual::Property::TEXTURES_PATH, TEST_RESOURCE_DIR "/" );
+
+  //Test to see if mesh loads correctly.
+  MeshVisualLoadsCorrectlyTest( propertyMap, application );
+
+  END_TEST;
+}
+
 //Test if mesh loads correctly when supplied with all main parameters, an object file, a material file and a directory location.
 int UtcDaliVisualFactoryGetMeshVisual3(void)
 {
@@ -1347,6 +1371,9 @@ int UtcDaliVisualFactoryGetMeshVisual3(void)
   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::USE_MIPMAPPING, false );
+  propertyMap.Insert( MeshVisual::Property::USE_SOFT_NORMALS, false );
+  propertyMap.Insert( MeshVisual::Property::LIGHT_POSITION, Vector3::XAXIS );
   propertyMap.Insert( MeshVisual::Property::TEXTURES_PATH, TEST_RESOURCE_DIR "/" );
 
   //Test to see if mesh loads correctly.
@@ -1374,7 +1401,6 @@ int UtcDaliVisualFactoryGetMeshVisual4(void)
   //Test to see if mesh loads correctly.
   MeshVisualLoadsCorrectlyTest( propertyMap, application );
 
-
   END_TEST;
 }
 
@@ -1389,10 +1415,13 @@ int UtcDaliVisualFactoryGetMeshVisual5(void)
   //Set up visual properties.
   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_DIR "/" );
-  propertyMap.Insert( MeshVisual::Property::SHADING_MODE, MeshVisual::ShadingMode::TEXTURED_WITH_SPECULAR_LIGHTING );
+  propertyMap.Insert( "objectUrl", TEST_OBJ_FILE_NAME );
+  propertyMap.Insert( "materialUrl", TEST_MTL_FILE_NAME );
+  propertyMap.Insert( "texturesPath", TEST_RESOURCE_DIR "/" );
+  propertyMap.Insert( "useMipmapping", false );
+  propertyMap.Insert( "useSoftNormals", false );
+  propertyMap.Insert( "lightPosition", Vector3::ZAXIS );
+  propertyMap.Insert( "shadingMode", MeshVisual::ShadingMode::TEXTURED_WITH_SPECULAR_LIGHTING );
 
   //Test to see if mesh loads correctly.
   MeshVisualLoadsCorrectlyTest( propertyMap, application );
@@ -2043,8 +2072,35 @@ int UtcDaliVisualFactoryGetBatchImageVisual3(void)
 
   // Create a property-map that enables batching.
   Property::Map propertyMap;
-  propertyMap.Insert( Dali::Toolkit::ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME );
-  propertyMap.Insert( ImageVisual::Property::BATCHING_ENABLED, true );
+  propertyMap[ Dali::Toolkit::ImageVisual::Property::URL ] = TEST_IMAGE_FILE_NAME ;
+  propertyMap[ "desiredHeight" ] = 200;
+  propertyMap[ "desiredWidth" ] = 200;
+  propertyMap[ "batchingEnabled" ] = true;
+
+  // Create an ImageView, passing the property-map in to instruct it to use batching.
+  Toolkit::ImageView imageView = Toolkit::ImageView::New();
+  imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, propertyMap );
+
+  imageView.SetSize( 200.0f, 200.0f );
+  Stage::GetCurrent().Add( imageView );
+
+  END_TEST;
+}
+
+int UtcDaliVisualFactoryGetBatchImageVisual4N(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliVisualFactoryGetBatchImageVisual4: Create an ImageView that uses a batched visual, with desired properties of the wrong type" );
+
+  VisualFactory factory = VisualFactory::Get();
+  DALI_TEST_CHECK( factory );
+
+  // Create a property-map that enables batching.
+  Property::Map propertyMap;
+  propertyMap[ Dali::Toolkit::ImageVisual::Property::URL ] = TEST_IMAGE_FILE_NAME ;
+  propertyMap[ "desiredHeight" ] = Vector2(100, 100);
+  propertyMap[ "desiredWidth" ] = Vector3(1, 1, 1);
+  propertyMap[ "batchingEnabled" ] = true;
 
   // Create an ImageView, passing the property-map in to instruct it to use batching.
   Toolkit::ImageView imageView = Toolkit::ImageView::New();
index 8f7248f..9c9a628 100644 (file)
@@ -57,22 +57,30 @@ enum Type
   /**
    * @brief The transform used by the visual.
    * @details Name "transform", type Property::Map.
-
+   *
    * @note Optional.
    * @see DevelVisual::Transform::Property
    */
-  TRANSFORM = SHADER + 1, // Dali::Toolkit::Visual::Property::SHADER + 1
+  TRANSFORM = SHADER + 1,
 
   /**
    * @brief Enables/disables premultiplied alpha.
    * The premultiplied alpha is false by default unless this behaviour is modified
    * by the derived Visual type.
-
+   *
    * @details Name "premultipliedAlpha", type Property::Boolean.
-
+   *
    * @note Optional.
    */
-  PREMULTIPLIED_ALPHA = SHADER + 2, // Dali::Toolkit::Visual::Property::SHADER + 2
+  PREMULTIPLIED_ALPHA = SHADER + 2,
+
+  /**
+   * @brief Mix color is a blend color for any visual.
+   * @details Name "mixColor", type Property::VECTOR4
+   *
+   * @note Optional
+   */
+  MIX_COLOR = SHADER + 3,
 };
 
 } //namespace Property
index 5a3a154..9a2ba3c 100644 (file)
@@ -84,6 +84,7 @@ void AnimatedImageVisual::DoCreatePropertyMap( Property::Map& map ) const
 {
   map.Clear();
   map.Insert( Toolkit::DevelVisual::Property::TYPE, Toolkit::Visual::IMAGE );
+
   if( !mImageUrl.empty() )
   {
     map.Insert( Toolkit::ImageVisual::Property::URL, mImageUrl );
index 3811a64..05fa234 100644 (file)
@@ -82,10 +82,11 @@ const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
 const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
   uniform lowp vec4 uColor;\n
   uniform lowp vec4 borderColor;\n
+  uniform lowp vec4 mixColor;\n
   \n
   void main()\n
   {\n
-    gl_FragColor = borderColor*uColor;\n
+    gl_FragColor = mixColor*borderColor*uColor;\n
   }\n
 );
 
@@ -108,12 +109,13 @@ const char* VERTEX_SHADER_ANTI_ALIASING = DALI_COMPOSE_SHADER(
 const char* FRAGMENT_SHADER_ANTI_ALIASING = DALI_COMPOSE_SHADER(
   uniform lowp vec4 uColor;\n
   uniform lowp vec4 borderColor;\n
+  uniform lowp vec4 mixColor;\n
   uniform mediump float borderSize;\n
   varying mediump float vAlpha;\n
   \n
   void main()\n
   {\n
-    gl_FragColor = borderColor*uColor;\n
+    gl_FragColor = mixColor*borderColor*uColor;\n
     gl_FragColor.a *= smoothstep(0.0, 1.5, vAlpha)*smoothstep( borderSize+1.5, borderSize, vAlpha );\n
   }\n
 );
@@ -142,22 +144,60 @@ BorderVisual::~BorderVisual()
 
 void BorderVisual::DoSetProperties( const Property::Map& propertyMap )
 {
-  Property::Value* color = propertyMap.Find( Toolkit::BorderVisual::Property::COLOR, COLOR_NAME );
-  if( !( color && color->Get(mBorderColor) ) )
+  for( Property::Map::SizeType iter = 0; iter < propertyMap.Count(); ++iter )
   {
-    DALI_LOG_ERROR( "Fail to provide a border color to the BorderVisual object\n" );
-  }
-
-  Property::Value* size = propertyMap.Find( Toolkit::BorderVisual::Property::SIZE, SIZE_NAME );
-  if( !( size && size->Get(mBorderSize) ) )
-  {
-    DALI_LOG_ERROR( "Fail to provide a border size to the BorderVisual object\n" );
+    KeyValuePair keyValue = propertyMap.GetKeyValue( iter );
+    if( keyValue.first.type == Property::Key::INDEX )
+    {
+      DoSetProperty( keyValue.first.indexKey, keyValue.second );
+    }
+    else
+    {
+      if( keyValue.first == COLOR_NAME )
+      {
+        DoSetProperty( Toolkit::BorderVisual::Property::COLOR, keyValue.second );
+      }
+      else if( keyValue.first == SIZE_NAME )
+      {
+        DoSetProperty( Toolkit::BorderVisual::Property::SIZE, keyValue.second );
+      }
+      else if( keyValue.first == ANTI_ALIASING )
+      {
+        DoSetProperty( Toolkit::BorderVisual::Property::ANTI_ALIASING, keyValue.second );
+      }
+    }
   }
+}
 
-  Property::Value* antiAliasing = propertyMap.Find( Toolkit::BorderVisual::Property::ANTI_ALIASING, ANTI_ALIASING );
-  if( antiAliasing )
+void BorderVisual::DoSetProperty( Dali::Property::Index index,
+                                  const Dali::Property::Value& value )
+{
+  switch( index )
   {
-    antiAliasing->Get( mAntiAliasing );
+    case Toolkit::BorderVisual::Property::COLOR:
+    {
+      if( !value.Get( mBorderColor ) )
+      {
+        DALI_LOG_ERROR("BorderVisual: borderColor property has incorrect type\n");
+      }
+      break;
+    }
+    case Toolkit::BorderVisual::Property::SIZE:
+    {
+      if( !value.Get( mBorderSize ) )
+      {
+        DALI_LOG_ERROR("BorderVisual: borderSize property has incorrect type\n");
+      }
+      break;
+    }
+    case Toolkit::BorderVisual::Property::ANTI_ALIASING:
+    {
+      if( !value.Get( mAntiAliasing ) )
+      {
+        DALI_LOG_ERROR("BorderVisual: antiAliasing property has incorrect type\n");
+      }
+      break;
+    }
   }
 }
 
@@ -178,7 +218,7 @@ void BorderVisual::DoSetOnStage( Actor& actor )
 void BorderVisual::DoCreatePropertyMap( Property::Map& map ) const
 {
   map.Clear();
-  map.Insert( DevelVisual::Property::TYPE, Toolkit::Visual::BORDER );
+  map.Insert( Toolkit::DevelVisual::Property::TYPE, Toolkit::Visual::BORDER );
   map.Insert( Toolkit::BorderVisual::Property::COLOR, mBorderColor );
   map.Insert( Toolkit::BorderVisual::Property::SIZE, mBorderSize );
   map.Insert( Toolkit::BorderVisual::Property::ANTI_ALIASING, mAntiAliasing );
@@ -201,13 +241,11 @@ void BorderVisual::InitializeRenderer()
     mFactoryCache.SaveGeometry( VisualFactoryCache::BORDER_GEOMETRY, geometry );
   }
 
-
   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 c9d6465..7efb142 100644 (file)
@@ -134,6 +134,13 @@ private:
    */
   Geometry CreateBorderGeometry();
 
+  /**
+   * Helper method to set individual values by index key.
+   * @param[in] index The index key of the value
+   * @param[in] value The value
+   */
+  void DoSetProperty( Property::Index index, const Property::Value& value );
+
   // Undefined
   BorderVisual( const BorderVisual& borderRenderer );
 
index 5bc3c6e..6313211 100644 (file)
@@ -41,7 +41,6 @@ namespace Internal
 
 namespace
 {
-const char * const COLOR_NAME("mixColor");
 
 const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
   attribute mediump vec2 aPosition;\n
@@ -88,8 +87,7 @@ ColorVisualPtr ColorVisual::New( VisualFactoryCache& factoryCache, const Propert
 }
 
 ColorVisual::ColorVisual( VisualFactoryCache& factoryCache )
-: Visual::Base( factoryCache ),
-  mMixColorIndex( Property::INVALID_INDEX )
+: Visual::Base( factoryCache )
 {
 }
 
@@ -99,10 +97,20 @@ ColorVisual::~ColorVisual()
 
 void ColorVisual::DoSetProperties( const Property::Map& propertyMap )
 {
-  Property::Value* color = propertyMap.Find( Toolkit::ColorVisual::Property::MIX_COLOR, COLOR_NAME );
-  if( !( color && color->Get(mMixColor) ) )
+  // By virtue of DoSetProperties being called last, this will override
+  // anything set by DevelVisual::Property::MIX_COLOR
+  Property::Value* colorValue = propertyMap.Find( Toolkit::ColorVisual::Property::MIX_COLOR, MIX_COLOR );
+  if( colorValue )
   {
-    DALI_LOG_ERROR( "Fail to provide a color to the ColorVisual object\n" );
+    Vector4 color;
+    if( colorValue->Get( color ) )
+    {
+      SetMixColor( color );
+    }
+    else
+    {
+      DALI_LOG_ERROR("ColorVisual: mixColor property has incorrect type\n");
+    }
   }
 }
 
@@ -117,7 +125,7 @@ void ColorVisual::DoCreatePropertyMap( Property::Map& map ) const
 {
   map.Clear();
   map.Insert( Toolkit::DevelVisual::Property::TYPE, Toolkit::Visual::COLOR );
-  map.Insert( Toolkit::ColorVisual::Property::MIX_COLOR, mMixColor );
+  map.Insert( Toolkit::ColorVisual::Property::MIX_COLOR, mImpl->mMixColor );
 }
 
 void ColorVisual::OnSetTransform()
@@ -141,30 +149,19 @@ void ColorVisual::InitializeRenderer()
 
   mImpl->mRenderer = Renderer::New( geometry, shader );
 
-  mMixColorIndex = DevelHandle::RegisterProperty( mImpl->mRenderer, Toolkit::ColorVisual::Property::MIX_COLOR, COLOR_NAME, mMixColor );
-  if( mMixColor.a < 1.f )
+  // ColorVisual has it's own index key for mix color - use this instead
+  // of using the new base index to avoid changing existing applications
+  // String keys will get to this property.
+  mImpl->mMixColorIndex = DevelHandle::RegisterProperty( mImpl->mRenderer, Toolkit::ColorVisual::Property::MIX_COLOR, MIX_COLOR, mImpl->mMixColor );
+  if( mImpl->mMixColor.a < 1.f )
   {
     mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
   }
 
-  //Register transform properties
+  // Register transform properties
   mImpl->mTransform.RegisterUniforms( mImpl->mRenderer, Direction::LEFT_TO_RIGHT );
 }
 
-void ColorVisual::SetColor(const Vector4& color)
-{
-  mMixColor = color;
-
-  if( mImpl->mRenderer )
-  {
-    (mImpl->mRenderer).SetProperty( mMixColorIndex, color );
-    if( color.a < 1.f )
-    {
-      mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
-    }
-  }
-}
-
 } // namespace Internal
 
 } // namespace Toolkit
index 99758d1..e5f6df1 100644 (file)
@@ -94,14 +94,6 @@ protected:
    */
   virtual void OnSetTransform();
 
-public:
-
-  /**
-   * Set the color for rendering.
-   * @param[in] color The color to be rendered.
-   */
-  void SetColor( const Vector4& color );
-
 private:
   /**
    * @brief Initialize the renderer with the geometry and shader from the cache, if not available, create and save to the cache for sharing.
@@ -115,12 +107,6 @@ private:
 
   // Undefined
   ColorVisual& operator=( const ColorVisual& colorRenderer );
-
-private:
-
-  Vector4 mMixColor;
-  Property::Index mMixColorIndex;
-
 };
 
 } // namespace Internal
index 7826984..7f58d66 100644 (file)
@@ -172,11 +172,12 @@ const char* FRAGMENT_SHADER[] =
 DALI_COMPOSE_SHADER(
   uniform sampler2D sTexture;\n // sampler1D?
   uniform lowp vec4 uColor;\n
+  uniform lowp vec4 mixColor;\n
   varying mediump vec2 vTexCoord;\n
   \n
   void main()\n
   {\n
-    gl_FragColor = texture2D( sTexture, vec2( vTexCoord.y, 0.5 ) ) * uColor;\n
+      gl_FragColor = texture2D( sTexture, vec2( vTexCoord.y, 0.5 ) ) * vec4(mixColor.rgb*mixColor.a, mixColor.a) * uColor;\n
   }\n
 ),
 
@@ -184,11 +185,12 @@ DALI_COMPOSE_SHADER(
 DALI_COMPOSE_SHADER(
   uniform sampler2D sTexture;\n // sampler1D?
   uniform lowp vec4 uColor;\n
+  uniform lowp vec4 mixColor;\n
   varying mediump vec2 vTexCoord;\n
   \n
   void main()\n
   {\n
-    gl_FragColor = texture2D( sTexture, vec2( length(vTexCoord), 0.5 ) ) * uColor;\n
+    gl_FragColor = texture2D( sTexture, vec2( length(vTexCoord), 0.5 ) ) * vec4(mixColor.rgb*mixColor.a, mixColor.a) * uColor;\n
   }\n
 )
 };
index f5b4392..47f0316 100644 (file)
@@ -79,11 +79,16 @@ const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
   varying mediump vec2 vTexCoord;\n
   uniform sampler2D sTexture;\n
   uniform lowp vec4 uColor;\n
-  uniform lowp float uAlphaBlending; // Set to 1.0 for conventional alpha blending; if pre-multiplied alpha blending, set to 0.0
+  uniform lowp vec4 mixColor;\n
+  uniform lowp float preMultipliedAlpha;\n
+  lowp vec4 visualMixColor()\n
+  {\n
+    return vec4( mixColor.rgb * mix( 1.0, mixColor.a, preMultipliedAlpha ), mixColor.a );\n
+  }\n
   \n
   void main()\n
   {\n
-    gl_FragColor = texture2D( sTexture, vTexCoord ) * vec4( uColor.rgb*max( uAlphaBlending, uColor.a ), uColor.a );\n
+    gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor * visualMixColor();
   }\n
 );
 
@@ -113,21 +118,58 @@ void BatchImageVisual::DoSetProperties( const Property::Map& propertyMap )
 {
   // url already passed in constructor
 
-  int desiredWidth = 0;
-  Property::Value* desiredWidthValue = propertyMap.Find( Dali::Toolkit::ImageVisual::Property::DESIRED_WIDTH, DESIRED_WIDTH );
-  if( desiredWidthValue )
+  for( Property::Map::SizeType iter = 0; iter < propertyMap.Count(); ++iter )
   {
-    desiredWidthValue->Get( desiredWidth );
+    KeyValuePair keyValue = propertyMap.GetKeyValue( iter );
+    if( keyValue.first.type == Property::Key::INDEX )
+    {
+      DoSetProperty( keyValue.first.indexKey, keyValue.second );
+    }
+    else
+    {
+      if( keyValue.first == DESIRED_WIDTH )
+      {
+        DoSetProperty( Toolkit::ImageVisual::Property::DESIRED_WIDTH, keyValue.second );
+      }
+      else if( keyValue.first == DESIRED_HEIGHT )
+      {
+        DoSetProperty( Toolkit::ImageVisual::Property::DESIRED_HEIGHT, keyValue.second );
+      }
+    }
   }
+}
 
-  int desiredHeight = 0;
-  Property::Value* desiredHeightValue = propertyMap.Find( Dali::Toolkit::ImageVisual::Property::DESIRED_HEIGHT, DESIRED_HEIGHT );
-  if( desiredHeightValue )
+void BatchImageVisual::DoSetProperty( Property::Index index, const Property::Value& value )
+{
+  switch( index )
   {
-    desiredHeightValue->Get( desiredHeight );
+    case Dali::Toolkit::ImageVisual::Property::DESIRED_WIDTH:
+    {
+      int width;
+      if( value.Get( width ) )
+      {
+        mDesiredSize.SetWidth( width );
+      }
+      else
+      {
+        DALI_LOG_ERROR("BatchImageVisual: width property has incorrect type\n");
+      }
+      break;
+    }
+    case Dali::Toolkit::ImageVisual::Property::DESIRED_HEIGHT:
+    {
+      int height;
+      if( value.Get( height ) )
+      {
+        mDesiredSize.SetHeight( height );
+      }
+      else
+      {
+        DALI_LOG_ERROR("BatchImageVisual: height property has incorrect type\n");
+      }
+      break;
+    }
   }
-
-  mDesiredSize = ImageDimensions( desiredWidth, desiredHeight );
 }
 
 void BatchImageVisual::GetNaturalSize( Vector2& naturalSize )
index 84953f5..1f81195 100644 (file)
@@ -115,6 +115,13 @@ private:
    */
   void CleanCache( const std::string& url );
 
+  /**
+   * Helper method to set individual values by index key.
+   * @param[in] index The index key of the value
+   * @param[in] value The value
+   */
+  void DoSetProperty( Property::Index index, const Property::Value& value );
+
 private:
 
   Vector4                 mAtlasRect;
index b61c23b..6493659 100644 (file)
@@ -132,10 +132,16 @@ const char* FRAGMENT_SHADER_NO_ATLAS = DALI_COMPOSE_SHADER(
   varying mediump vec2 vTexCoord;\n
   uniform sampler2D sTexture;\n
   uniform lowp vec4 uColor;\n
+  uniform lowp vec4 mixColor;\n
+  uniform lowp float preMultipliedAlpha;\n
   \n
+  lowp vec4 visualMixColor()\n
+  {\n
+    return vec4( mixColor.rgb * mix( 1.0, mixColor.a, preMultipliedAlpha ), mixColor.a );\n
+  }\n
   void main()\n
   {\n
-    gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor;\n
+      gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor * visualMixColor();\n
   }\n
 );
 
@@ -144,12 +150,19 @@ const char* FRAGMENT_SHADER_ATLAS_CLAMP = DALI_COMPOSE_SHADER(
     uniform sampler2D sTexture;\n
     uniform mediump vec4 uAtlasRect;\n
     uniform lowp vec4 uColor;\n
+    uniform lowp vec4 mixColor;\n
+    uniform lowp float preMultipliedAlpha;\n
     \n
-    void main()\n
+    lowp vec4 visualMixColor()\n
     {\n
-      mediump vec2 texCoord = clamp( mix( uAtlasRect.xy, uAtlasRect.zw, vTexCoord ), uAtlasRect.xy, uAtlasRect.zw );\n
-      gl_FragColor = texture2D( sTexture, texCoord ) * uColor;\n
+        return vec4( mixColor.rgb * mix( 1.0, mixColor.a, preMultipliedAlpha ), mixColor.a );\n
     }\n
+    \n
+    void main()\n
+    {\n
+        mediump vec2 texCoord = clamp( mix( uAtlasRect.xy, uAtlasRect.zw, vTexCoord ), uAtlasRect.xy, uAtlasRect.zw );\n
+        gl_FragColor = texture2D( sTexture, texCoord ) * uColor * visualMixColor();\n
+     }\n
 );
 
 const char* FRAGMENT_SHADER_ATLAS_VARIOUS_WRAP = DALI_COMPOSE_SHADER(
@@ -159,6 +172,8 @@ const char* FRAGMENT_SHADER_ATLAS_VARIOUS_WRAP = DALI_COMPOSE_SHADER(
     // WrapMode -- 0: CLAMP; 1: REPEAT; 2: REFLECT;
     uniform lowp vec2 wrapMode;\n
     uniform lowp vec4 uColor;\n
+    uniform lowp vec4 mixColor;\n
+    uniform lowp float preMultipliedAlpha;\n
     \n
     mediump float wrapCoordinate( mediump vec2 range, mediump float coordinate, lowp float wrap )\n
     {\n
@@ -170,11 +185,16 @@ const char* FRAGMENT_SHADER_ATLAS_VARIOUS_WRAP = DALI_COMPOSE_SHADER(
       return clamp( mix(range.x, range.y, coord), range.x, range.y );
     }\n
     \n
+    lowp vec4 visualMixColor()\n
+    {\n
+      return vec4( mixColor.rgb * mix( 1.0, mixColor.a, preMultipliedAlpha ), mixColor.a );\n
+    }\n
+    \n
     void main()\n
     {\n
-      mediump vec2 texCoord = vec2( wrapCoordinate( uAtlasRect.xz, vTexCoord.x, wrapMode.x ),
-                                    wrapCoordinate( uAtlasRect.yw, vTexCoord.y, wrapMode.y ) );\n
-      gl_FragColor = texture2D( sTexture, texCoord ) * uColor;\n
+        mediump vec2 texCoord = vec2( wrapCoordinate( uAtlasRect.xz, vTexCoord.x, wrapMode.x ),
+                                      wrapCoordinate( uAtlasRect.yw, vTexCoord.y, wrapMode.y ) );\n
+        gl_FragColor = texture2D( sTexture, texCoord ) * uColor * visualMixColor();\n
     }\n
 );
 
@@ -263,86 +283,149 @@ ImageVisual::~ImageVisual()
 void ImageVisual::DoSetProperties( const Property::Map& propertyMap )
 {
   // Url is already received in constructor
-  Property::Value* fittingValue = propertyMap.Find( Toolkit::ImageVisual::Property::FITTING_MODE, IMAGE_FITTING_MODE );
-  if( fittingValue )
+  for( Property::Map::SizeType iter = 0; iter < propertyMap.Count(); ++iter )
   {
-    int value;
-    Scripting::GetEnumerationProperty( *fittingValue, FITTING_MODE_TABLE, FITTING_MODE_TABLE_COUNT, value );
-    mFittingMode = Dali::FittingMode::Type( value );
+    KeyValuePair keyValue = propertyMap.GetKeyValue( iter );
+    if( keyValue.first.type == Property::Key::INDEX )
+    {
+      DoSetProperty( keyValue.first.indexKey, keyValue.second );
+    }
+    else
+    {
+      if( keyValue.first == IMAGE_FITTING_MODE )
+      {
+        DoSetProperty( Toolkit::ImageVisual::Property::FITTING_MODE, keyValue.second );
+      }
+      else if( keyValue.first == IMAGE_SAMPLING_MODE )
+      {
+        DoSetProperty( Toolkit::ImageVisual::Property::SAMPLING_MODE, keyValue.second );
+      }
+      else if( keyValue.first == IMAGE_DESIRED_WIDTH )
+      {
+        DoSetProperty( Toolkit::ImageVisual::Property::DESIRED_WIDTH, keyValue.second );
+      }
+      else if( keyValue.first == IMAGE_DESIRED_HEIGHT )
+      {
+        DoSetProperty( Toolkit::ImageVisual::Property::DESIRED_HEIGHT, keyValue.second );
+      }
+      else if( keyValue.first == PIXEL_AREA_UNIFORM_NAME )
+      {
+        DoSetProperty( Toolkit::ImageVisual::Property::PIXEL_AREA, keyValue.second );
+      }
+      else if( keyValue.first == IMAGE_WRAP_MODE_U )
+      {
+        DoSetProperty( Toolkit::ImageVisual::Property::WRAP_MODE_U, keyValue.second );
+      }
+      else if( keyValue.first == IMAGE_WRAP_MODE_V )
+      {
+        DoSetProperty( Toolkit::ImageVisual::Property::WRAP_MODE_V, keyValue.second );
+      }
+      else if( keyValue.first == SYNCHRONOUS_LOADING )
+      {
+        DoSetProperty( Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING, keyValue.second );
+      }
+    }
   }
 
-  Property::Value* samplingValue = propertyMap.Find( Toolkit::ImageVisual::Property::SAMPLING_MODE, IMAGE_SAMPLING_MODE );
-  if( samplingValue )
+  if( mImpl->mFlags & Impl::IS_SYNCHRONOUS_RESOURCE_LOADING && mImageUrl.size() > 0u )
   {
-    int value;
-    Scripting::GetEnumerationProperty( *samplingValue, SAMPLING_MODE_TABLE, SAMPLING_MODE_TABLE_COUNT, value );
-    mSamplingMode = Dali::SamplingMode::Type( value );
+    // 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 )
+    LoadResourceSynchronously();
   }
+}
 
-  // Use a variable to detect if the width or height have been modified by the property map.
-  bool desiredSizeSpecified = false;
-  int desiredWidth = 0;
-  Property::Value* desiredWidthValue = propertyMap.Find( Toolkit::ImageVisual::Property::DESIRED_WIDTH, IMAGE_DESIRED_WIDTH );
-  if( desiredWidthValue )
+void ImageVisual::DoSetProperty( Property::Index index, const Property::Value& value )
+{
+  switch( index )
   {
-    desiredWidthValue->Get( desiredWidth );
-    desiredSizeSpecified = true;
-  }
+    case Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING:
+    {
+      bool sync;
+      if( value.Get( sync ) )
+      {
+        if( sync )
+        {
+          mImpl->mFlags |= Impl::IS_SYNCHRONOUS_RESOURCE_LOADING;
+        }
+        else
+        {
+          mImpl->mFlags &= ~Impl::IS_SYNCHRONOUS_RESOURCE_LOADING;
+        }
+      }
+      else
+      {
+        DALI_LOG_ERROR("ImageVisual: synchronousLoading property has incorrect type\n");
+      }
+      break;
+    }
 
-  int desiredHeight = 0;
-  Property::Value* desiredHeightValue = propertyMap.Find( Toolkit::ImageVisual::Property::DESIRED_HEIGHT, IMAGE_DESIRED_HEIGHT );
-  if( desiredHeightValue )
-  {
-    desiredHeightValue->Get( desiredHeight );
-    desiredSizeSpecified = true;
-  }
+    case Toolkit::ImageVisual::Property::DESIRED_WIDTH:
+    {
+      float desiredWidth;
+      if( value.Get( desiredWidth ) )
+      {
+        mDesiredSize.SetWidth( desiredWidth );
+      }
+      else
+      {
+        DALI_LOG_ERROR("ImageVisual: desiredWidth property has incorrect type\n");
+      }
+      break;
+    }
 
-  // Only update the desired size if specified in the property map.
-  if( desiredSizeSpecified )
-  {
-    mDesiredSize = ImageDimensions( desiredWidth, desiredHeight );
-  }
+    case Toolkit::ImageVisual::Property::DESIRED_HEIGHT:
+    {
+      float desiredHeight;
+      if( value.Get( desiredHeight ) )
+      {
+        mDesiredSize.SetHeight( desiredHeight );
+      }
+      else
+      {
+        DALI_LOG_ERROR("ImageVisual: desiredHeight property has incorrect type\n");
+      }
+      break;
+    }
 
-  Property::Value* pixelAreaValue = propertyMap.Find( Toolkit::ImageVisual::Property::PIXEL_AREA, PIXEL_AREA_UNIFORM_NAME );
-  if( pixelAreaValue )
-  {
-    pixelAreaValue->Get( mPixelArea );
-  }
+    case Toolkit::ImageVisual::Property::FITTING_MODE:
+    {
+      int fittingMode;
+      Scripting::GetEnumerationProperty( value, FITTING_MODE_TABLE, FITTING_MODE_TABLE_COUNT, fittingMode );
+      mFittingMode = Dali::FittingMode::Type( fittingMode );
+      break;
+    }
 
-  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 );
-  }
+    case Toolkit::ImageVisual::Property::SAMPLING_MODE:
+    {
+      int samplingMode;
+      Scripting::GetEnumerationProperty( value, SAMPLING_MODE_TABLE, SAMPLING_MODE_TABLE_COUNT, samplingMode );
+      mSamplingMode = Dali::SamplingMode::Type( samplingMode );
+      break;
+    }
 
-  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 );
-  }
+    case Toolkit::ImageVisual::Property::PIXEL_AREA:
+    {
+      value.Get( mPixelArea );
+      break;
+    }
 
-  Property::Value* syncLoading = propertyMap.Find( Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING, SYNCHRONOUS_LOADING );
-  if( syncLoading )
-  {
-    bool sync;
-    syncLoading->Get( sync );
-    if( sync )
+    case Toolkit::ImageVisual::Property::WRAP_MODE_U:
     {
-      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( mImageUrl.size() > 0u )
-      {
-        LoadResourceSynchronously();
-      }
+      int wrapMode;
+      Scripting::GetEnumerationProperty( value, WRAP_MODE_TABLE, WRAP_MODE_TABLE_COUNT, wrapMode );
+      mWrapModeU = Dali::WrapMode::Type( wrapMode );
+      break;
     }
-    else
+
+    case Toolkit::ImageVisual::Property::WRAP_MODE_V:
     {
-      mImpl->mFlags &= ~Impl::IS_SYNCHRONOUS_RESOURCE_LOADING;
+      int wrapMode;
+      Scripting::GetEnumerationProperty( value, WRAP_MODE_TABLE, WRAP_MODE_TABLE_COUNT, wrapMode );
+      mWrapModeV = Dali::WrapMode::Type( wrapMode );
+      break;
     }
   }
 }
@@ -599,7 +682,6 @@ void ImageVisual::InitializeRenderer( const std::string& imageUrl )
 
 void ImageVisual::InitializeRenderer( const Image& image )
 {
-
   mImpl->mFlags &= ~Impl::IS_FROM_CACHE;
 
   // don't reuse CreateTextureSet
@@ -643,7 +725,7 @@ void ImageVisual::DoSetOnStage( Actor& actor )
     InitializeRenderer( mImage );
   }
 
-  if ( !mImpl->mRenderer)
+  if ( !mImpl->mRenderer )
   {
     return;
   }
index 56c45fb..c2ea067 100644 (file)
@@ -280,6 +280,13 @@ private:
    */
   void CleanCache(const std::string& url);
 
+  /**
+   * Helper method to set individual values by index key.
+   * @param[in] index The index key of the value
+   * @param[in] value The value
+   */
+  void DoSetProperty( Property::Index index, const Property::Value& value );
+
 private:
 
   Image mImage;
index 41b99ad..73140cf 100644 (file)
@@ -164,10 +164,16 @@ const char* SIMPLE_FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
   precision mediump float;\n
   varying mediump vec3 vIllumination;\n
   uniform lowp vec4 uColor;\n
+  uniform lowp vec4 mixColor;\n
+  uniform lowp float preMultipliedAlpha;\n
 
+  lowp vec4 visualMixColor()\n
+  {\n
+    return vec4( mixColor.rgb * mix( 1.0, mixColor.a, preMultipliedAlpha ), mixColor.a );\n
+  }\n
   void main()\n
   {\n
-    gl_FragColor = vec4( vIllumination.rgb * uColor.rgb, uColor.a );\n
+    gl_FragColor = vec4( vIllumination.rgb * uColor.rgb, uColor.a ) * visualMixColor();\n
   }\n
 );
 
@@ -241,11 +247,18 @@ const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
   varying mediump float vSpecular;\n
   uniform sampler2D sDiffuse;\n
   uniform lowp vec4 uColor;\n
+  uniform lowp vec4 mixColor;\n
+  uniform lowp float preMultipliedAlpha;\n
 
+  lowp vec4 visualMixColor()\n
+  {\n
+    return vec4( mixColor.rgb * mix( 1.0, mixColor.a, preMultipliedAlpha ), mixColor.a );\n
+  }\n
   void main()\n
   {\n
     vec4 texture = texture2D( sDiffuse, vTexCoord );\n
-    gl_FragColor = vec4( vIllumination.rgb * texture.rgb * uColor.rgb + vSpecular * 0.3, texture.a * uColor.a );\n
+    vec4 visualMixColor = visualMixColor();\n
+    gl_FragColor = vec4( vIllumination.rgb * texture.rgb * uColor.rgb * visualMixColor.rgb + vSpecular * 0.3, texture.a * uColor.a * visualMixColor.a );\n
   }\n
 );
 
@@ -326,19 +339,26 @@ const char* NORMAL_MAP_FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
   uniform sampler2D sNormal;\n
   uniform sampler2D sGloss;\n
   uniform lowp vec4 uColor;\n
+  uniform lowp vec4 mixColor;\n
+  uniform lowp float preMultipliedAlpha;\n
 
+  lowp vec4 visualMixColor()\n
+  {\n
+    return vec4( mixColor.rgb * mix( 1.0, mixColor.a, preMultipliedAlpha ), mixColor.a );\n
+  }\n
   void main()\n
   {\n
     vec4 texture = texture2D( sDiffuse, vTexCoord );\n
     vec3 normal = normalize( texture2D( sNormal, vTexCoord ).xyz * 2.0 - 1.0 );\n
     vec4 glossMap = texture2D( sGloss, vTexCoord );\n
+    vec4 visualMixColor = visualMixColor();\n
 
     float lightDiffuse = max( 0.0, dot( normal, normalize( vLightDirection ) ) );\n
     lightDiffuse = lightDiffuse * 0.5 + 0.5;\n
 
     float shininess = pow ( max ( dot ( normalize( vHalfVector ), normal ), 0.0 ), 16.0 )  ;
 
-    gl_FragColor = vec4( texture.rgb * uColor.rgb * lightDiffuse + shininess * glossMap.rgb, texture.a * uColor.a );\n
+    gl_FragColor = vec4( texture.rgb * uColor.rgb * visualMixColor.rgb * lightDiffuse + shininess * glossMap.rgb, texture.a * uColor.a * visualMixColor.a );\n
   }\n
 );
 
@@ -366,60 +386,119 @@ MeshVisual::~MeshVisual()
 
 void MeshVisual::DoSetProperties( const Property::Map& propertyMap )
 {
-  Property::Value* objectUrl = propertyMap.Find( Toolkit::MeshVisual::Property::OBJECT_URL, OBJECT_URL_NAME );
-  if( !objectUrl || !objectUrl->Get( mObjectUrl ) )
+  for( Property::Map::SizeType iter = 0; iter < propertyMap.Count(); ++iter )
   {
-    DALI_LOG_ERROR( "Fail to provide object URL to the MeshVisual object.\n" );
+    KeyValuePair keyValue = propertyMap.GetKeyValue( iter );
+    if( keyValue.first.type == Property::Key::INDEX )
+    {
+      DoSetProperty( keyValue.first.indexKey, keyValue.second );
+    }
+    else
+    {
+      if( keyValue.first == OBJECT_URL_NAME )
+      {
+        DoSetProperty( Toolkit::MeshVisual::Property::OBJECT_URL, keyValue.second );
+      }
+      else if( keyValue.first == MATERIAL_URL_NAME )
+      {
+        DoSetProperty( Toolkit::MeshVisual::Property::MATERIAL_URL, keyValue.second );
+      }
+      else if( keyValue.first == TEXTURES_PATH_NAME )
+      {
+        DoSetProperty( Toolkit::MeshVisual::Property::TEXTURES_PATH, keyValue.second );
+      }
+      else if( keyValue.first == SHADING_MODE_NAME )
+      {
+        DoSetProperty( Toolkit::MeshVisual::Property::SHADING_MODE, keyValue.second );
+      }
+      else if( keyValue.first == USE_MIPMAPPING_NAME )
+      {
+        DoSetProperty( Toolkit::MeshVisual::Property::USE_MIPMAPPING, keyValue.second );
+      }
+      else if( keyValue.first == USE_SOFT_NORMALS_NAME )
+      {
+        DoSetProperty( Toolkit::MeshVisual::Property::USE_SOFT_NORMALS, keyValue.second );
+      }
+      else if( keyValue.first == LIGHT_POSITION_NAME )
+      {
+        DoSetProperty( Toolkit::MeshVisual::Property::LIGHT_POSITION, keyValue.second );
+      }
+    }
   }
 
-  Property::Value* materialUrl = propertyMap.Find( Toolkit::MeshVisual::Property::MATERIAL_URL, MATERIAL_URL_NAME );
-  if( !materialUrl || !materialUrl->Get( mMaterialUrl ) || mMaterialUrl.empty() )
+  if( mMaterialUrl.empty() )
   {
     mUseTexture = false;
   }
 
-  Property::Value* imagesUrl = propertyMap.Find( Toolkit::MeshVisual::Property::TEXTURES_PATH, TEXTURES_PATH_NAME );
-  if( !imagesUrl || !imagesUrl->Get( mTexturesPath ) )
+  if( mLightPosition == Vector3::ZERO )
   {
-    //Default behaviour is to assume files are in the same directory,
-    // or have their locations detailed in full when supplied.
-    mTexturesPath.clear();
-  }
-
-  Property::Value* shadingMode = propertyMap.Find( Toolkit::MeshVisual::Property::SHADING_MODE, SHADING_MODE_NAME );
-  if( shadingMode )
-  {
-    Scripting::GetEnumerationProperty( *shadingMode, SHADING_MODE_TABLE, SHADING_MODE_TABLE_COUNT, mShadingMode );
-  }
-
-  Property::Value* useMipmapping = propertyMap.Find( Toolkit::MeshVisual::Property::USE_MIPMAPPING, USE_MIPMAPPING_NAME );
-  if( useMipmapping )
-  {
-    useMipmapping->Get( mUseMipmapping );
-  }
+    // Default behaviour is to place the light directly in front of the object,
+    // at a reasonable distance to light everything on screen.
+    Stage stage = Stage::GetCurrent();
 
-  Property::Value* useSoftNormals = propertyMap.Find( Toolkit::MeshVisual::Property::USE_SOFT_NORMALS, USE_SOFT_NORMALS_NAME );
-  if( useSoftNormals )
-  {
-    useSoftNormals->Get( mUseSoftNormals );
+    mLightPosition = Vector3( stage.GetSize().width / 2, stage.GetSize().height / 2, stage.GetSize().width * 5 );
   }
+}
 
-  Property::Value* lightPosition = propertyMap.Find( Toolkit::MeshVisual::Property::LIGHT_POSITION, LIGHT_POSITION_NAME );
-  if( lightPosition )
+void MeshVisual::DoSetProperty( Property::Index index, const Property::Value& value )
+{
+  switch( index )
   {
-    if( !lightPosition->Get( mLightPosition ) )
+    case Toolkit::MeshVisual::Property::OBJECT_URL:
     {
-      DALI_LOG_ERROR( "Invalid value passed for light position in MeshRenderer object.\n" );
-      mLightPosition = Vector3::ZERO;
+      if( !value.Get( mObjectUrl ) )
+      {
+        DALI_LOG_ERROR("MeshVisual: property objectUrl is the wrong type, use STRING\n");
+      }
+      break;
+    }
+    case Toolkit::MeshVisual::Property::MATERIAL_URL:
+    {
+      if( ! value.Get( mMaterialUrl ) )
+      {
+        DALI_LOG_ERROR("MeshVisual: property materialUrl is the wrong type, use STRING\n");
+      }
+      break;
+    }
+    case Toolkit::MeshVisual::Property::TEXTURES_PATH:
+    {
+      if( ! value.Get( mTexturesPath ) )
+      {
+        mTexturesPath.clear();
+      }
+      break;
+    }
+    case Toolkit::MeshVisual::Property::SHADING_MODE:
+    {
+      Scripting::GetEnumerationProperty( value, SHADING_MODE_TABLE, SHADING_MODE_TABLE_COUNT, mShadingMode );
+      break;
+    }
+    case Toolkit::MeshVisual::Property::USE_MIPMAPPING:
+    {
+      if( !value.Get( mUseMipmapping ) )
+      {
+        DALI_LOG_ERROR("MeshVisual: property useMipmapping is the wrong type, use BOOLEAN\n");
+      }
+      break;
+    }
+    case Toolkit::MeshVisual::Property::USE_SOFT_NORMALS:
+    {
+      if( !value.Get( mUseSoftNormals ) )
+      {
+        DALI_LOG_ERROR("MeshVisual: property useSoftNormals is the wrong type, use BOOLEAN\n");
+      }
+      break;
+    }
+    case Toolkit::MeshVisual::Property::LIGHT_POSITION:
+    {
+      if( !value.Get( mLightPosition ) )
+      {
+        mLightPosition = Vector3::ZERO;
+        DALI_LOG_ERROR("MeshVisual: property lightPosition is the wrong type, use VECTOR3\n");
+      }
+      break;
     }
-  }
-  else
-  {
-    //Default behaviour is to place the light directly in front of the object,
-    // at a reasonable distance to light everything on screen.
-    Stage stage = Stage::GetCurrent();
-
-    mLightPosition = Vector3( stage.GetSize().width / 2, stage.GetSize().height / 2, stage.GetSize().width * 5 );
   }
 }
 
index c28b1b2..2c227a3 100644 (file)
@@ -165,6 +165,13 @@ private:
    */
   bool LoadTextures();
 
+  /**
+   * Helper method to set individual values by index key.
+   * @param[in] index The index key of the value
+   * @param[in] value The value
+   */
+  void DoSetProperty( Property::Index index, const Property::Value& value );
+
 private:
 
   // Undefined
index 3af7b72..57c1a48 100644 (file)
@@ -132,10 +132,15 @@ const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
   varying mediump vec2 vTexCoord;\n
   uniform sampler2D sTexture;\n
   uniform lowp vec4 uColor;\n
-  \n
+  uniform lowp vec4 mixColor;\n
+  uniform lowp float preMultipliedAlpha;\n
+  lowp vec4 visualMixColor()\n
+  {\n
+    return vec4( mixColor.rgb * mix( 1.0, mixColor.a, preMultipliedAlpha ), mixColor.a );\n
+  }\n
   void main()\n
   {\n
-    gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor;\n
+    gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor * visualMixColor();\n
   }\n
 );
 
index 4fb6e82..78f4c88 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
@@ -56,7 +56,6 @@ DALI_ENUM_TO_STRING_TABLE_END( SHAPE_TYPE )
 
 //Property names
 const char * const PRIMITIVE_SHAPE( "shape" );
-const char * const SHAPE_COLOR( "mixColor" );
 const char * const SLICES( "slices" );
 const char * const STACKS( "stacks" );
 const char * const SCALE_TOP_RADIUS( "scaleTopRadius" );
@@ -99,7 +98,6 @@ const char * const BEVELLED_CUBE_LABEL( "BEVELLED_CUBE" );
 
 //Shader properties
 const char * const OBJECT_MATRIX_UNIFORM_NAME( "uObjectMatrix" );
-const char * const COLOR_UNIFORM_NAME( "mixColor" );
 const char * const OBJECT_DIMENSIONS_UNIFORM_NAME( "uObjectDimensions" );
 const char * const STAGE_OFFSET_UNIFORM_NAME( "uStageOffset" );
 
@@ -138,6 +136,7 @@ const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
     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
 
@@ -147,18 +146,18 @@ const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
     vec4 vertexPosition = uObjectMatrix * normalisedVertexPosition;\n
     vertexPosition = uMvpMatrix * vertexPosition;\n
 
-    //Illumination in Model-View space - Transform attributes and uniforms\n
-    vec4 mvVertexPosition = uModelView * normalisedVertexPosition;\n
-    vec3 normal = uNormalMatrix * mat3( uObjectMatrix ) * aNormal;\n
+     //Illumination in Model-View space - Transform attributes and uniforms\n
+     vec4 mvVertexPosition = uModelView * normalisedVertexPosition;\n
+     vec3 normal = uNormalMatrix * mat3( uObjectMatrix ) * aNormal;\n
 
-    vec4 mvLightPosition = vec4( ( lightPosition.xy - uStageOffset ), lightPosition.z, 1.0 );\n
-    mvLightPosition = uViewMatrix * mvLightPosition;\n
-    vec3 vectorToLight = normalize( mvLightPosition.xyz - mvVertexPosition.xyz );\n
+     vec4 mvLightPosition = vec4( ( lightPosition.xy - uStageOffset ), lightPosition.z, 1.0 );\n
+     mvLightPosition = uViewMatrix * mvLightPosition;\n
+     vec3 vectorToLight = normalize( mvLightPosition.xyz - mvVertexPosition.xyz );\n
 
-    float lightDiffuse = max( dot( vectorToLight, normal ), 0.0 );\n
-    vIllumination = vec3( lightDiffuse * 0.5 + 0.5 );\n
+     float lightDiffuse = max( dot( vectorToLight, normal ), 0.0 );\n
+     vIllumination = vec3( lightDiffuse * 0.5 + 0.5 );\n
 
-    gl_Position = vertexPosition;\n
+     gl_Position = vertexPosition;\n
   }\n
 );
 
@@ -187,7 +186,6 @@ PrimitiveVisualPtr PrimitiveVisual::New( VisualFactoryCache& factoryCache, const
 
 PrimitiveVisual::PrimitiveVisual( VisualFactoryCache& factoryCache )
 : Visual::Base( factoryCache ),
-  mColor( DEFAULT_COLOR ),
   mScaleDimensions( Vector3::ONE ),
   mScaleTopRadius( DEFAULT_SCALE_TOP_RADIUS ),
   mScaleBottomRadius( DEFAULT_SCALE_BOTTOM_RADIUS ),
@@ -199,6 +197,7 @@ PrimitiveVisual::PrimitiveVisual( VisualFactoryCache& factoryCache )
   mStacks( DEFAULT_STACKS ),
   mPrimitiveType( Toolkit::PrimitiveVisual::Shape::SPHERE )
 {
+  mImpl->mMixColor = DEFAULT_COLOR;
 }
 
 PrimitiveVisual::~PrimitiveVisual()
@@ -218,12 +217,16 @@ void PrimitiveVisual::DoSetProperties( const Property::Map& propertyMap )
     DALI_LOG_ERROR( "Fail to provide shape to the PrimitiveVisual object.\n" );
   }
 
-  //Read in other potential properties.
-
-  Property::Value* color = propertyMap.Find( Toolkit::PrimitiveVisual::Property::MIX_COLOR, SHAPE_COLOR );
-  if( color && !color->Get( mColor ) )
+  // By virtue of DoSetProperties being called last, this will override
+  // anything set by DevelVisual::Property::MIX_COLOR
+  Property::Value* colorValue = propertyMap.Find( Toolkit::PrimitiveVisual::Property::MIX_COLOR, MIX_COLOR );
+  if( colorValue )
   {
-    DALI_LOG_ERROR( "Invalid type for color in PrimitiveVisual.\n" );
+    Vector4 color;
+    if( colorValue->Get( color ) )
+    {
+      SetMixColor( color );
+    }
   }
 
   Property::Value* slices = propertyMap.Find( Toolkit::PrimitiveVisual::Property::SLICES, SLICES );
@@ -412,8 +415,8 @@ void PrimitiveVisual::DoCreatePropertyMap( Property::Map& map ) const
 {
   map.Clear();
   map.Insert( Toolkit::DevelVisual::Property::TYPE, Toolkit::Visual::PRIMITIVE );
+  map.Insert( Toolkit::PrimitiveVisual::Property::MIX_COLOR, mImpl->mMixColor );
   map.Insert( Toolkit::PrimitiveVisual::Property::SHAPE, mPrimitiveType );
-  map.Insert( Toolkit::PrimitiveVisual::Property::MIX_COLOR, mColor );
   map.Insert( Toolkit::PrimitiveVisual::Property::SLICES, mSlices );
   map.Insert( Toolkit::PrimitiveVisual::Property::STACKS, mStacks );
   map.Insert( Toolkit::PrimitiveVisual::Property::SCALE_TOP_RADIUS, mScaleTopRadius );
@@ -449,8 +452,10 @@ void PrimitiveVisual::InitializeRenderer()
   mImpl->mRenderer = Renderer::New( mGeometry, mShader );
   mImpl->mRenderer.SetProperty( Renderer::Property::FACE_CULLING_MODE, FaceCullingMode::BACK );
 
-  //Register transform properties
+  // Register transform properties
   mImpl->mTransform.RegisterUniforms( mImpl->mRenderer, Direction::LEFT_TO_RIGHT );
+
+  mImpl->mMixColorIndex = DevelHandle::RegisterProperty( mImpl->mRenderer, Toolkit::PrimitiveVisual::Property::MIX_COLOR, MIX_COLOR, mImpl->mMixColor );
 }
 
 void PrimitiveVisual::UpdateShaderUniforms()
@@ -466,7 +471,6 @@ void PrimitiveVisual::UpdateShaderUniforms()
   mShader.RegisterProperty( STAGE_OFFSET_UNIFORM_NAME, Vector2( width, height ) / 2.0f );
   mShader.RegisterProperty( LIGHT_POSITION_UNIFORM_NAME, mLightPosition );
   mShader.RegisterProperty( OBJECT_MATRIX_UNIFORM_NAME, scaleMatrix );
-  DevelHandle::RegisterProperty( mShader, Toolkit::PrimitiveVisual::Property::MIX_COLOR, COLOR_UNIFORM_NAME, mColor );
   mShader.RegisterProperty( OBJECT_DIMENSIONS_UNIFORM_NAME, mObjectDimensions );
 }
 
@@ -548,7 +552,7 @@ void PrimitiveVisual::CreateSphere( Vector<Vertex>& vertices, Vector<unsigned sh
 }
 
 void PrimitiveVisual::CreateConic( Vector<Vertex>& vertices, Vector<unsigned short>& indices, float scaleTopRadius,
-                                     float scaleBottomRadius, float scaleHeight, int slices )
+                                   float scaleBottomRadius, float scaleHeight, int slices )
 {
   ComputeConicVertices( vertices, scaleTopRadius, scaleBottomRadius, scaleHeight, slices );
   FormConicTriangles( indices, scaleTopRadius, scaleBottomRadius, slices );
@@ -563,7 +567,7 @@ void PrimitiveVisual::CreateConic( Vector<Vertex>& vertices, Vector<unsigned sho
 }
 
 void PrimitiveVisual::CreateBevelledCube( Vector<Vertex>& vertices, Vector<unsigned short>& indices,
-                                            Vector3 dimensions, float bevelPercentage, float bevelSmoothness )
+                                          Vector3 dimensions, float bevelPercentage, float bevelSmoothness )
 {
   float maxDimension = std::max( std::max( dimensions.x, dimensions.y ), dimensions.z );
   dimensions = dimensions / maxDimension;
@@ -588,7 +592,7 @@ void PrimitiveVisual::CreateBevelledCube( Vector<Vertex>& vertices, Vector<unsig
 }
 
 void PrimitiveVisual::ComputeCircleTables( Vector<float>& sinTable, Vector<float>& cosTable, int divisions,
-                                             bool halfCircle )
+                                           bool halfCircle )
 {
   if( divisions < 0 )
   {
@@ -729,7 +733,7 @@ void PrimitiveVisual::FormSphereTriangles( Vector<unsigned short>& indices, int
 }
 
 void PrimitiveVisual::ComputeConicVertices( Vector<Vertex>& vertices, float scaleTopRadius,
-                                                     float scaleBottomRadius, float scaleHeight, int slices )
+                                            float scaleBottomRadius, float scaleHeight, int slices )
 {
   int vertexIndex = 0;  //Track progress through vertices.
   Vector<float> sinTable;
@@ -816,7 +820,7 @@ void PrimitiveVisual::ComputeConicVertices( Vector<Vertex>& vertices, float scal
 }
 
 void PrimitiveVisual::FormConicTriangles( Vector<unsigned short>& indices, float scaleTopRadius,
-                                                   float scaleBottomRadius, int slices )
+                                          float scaleBottomRadius, int slices )
 {
   int  indiceIndex = 0;  //Track progress through indices.
   int  numTriangles = 0;
@@ -1167,7 +1171,7 @@ void PrimitiveVisual::FormOctahedronTriangles( Vector<unsigned short>& indices )
 }
 
 void PrimitiveVisual::ComputeBevelledCubeVertices( Vector<Vertex>& vertices, Vector3 dimensions,
-                                                     float bevelPercentage, float bevelSmoothness )
+                                                   float bevelPercentage, float bevelSmoothness )
 {
   int numPositions = 24;
   int numFaces = 26;
index 7792321..6b210bd 100644 (file)
@@ -320,7 +320,6 @@ private:
   Shader mShader;
   Geometry mGeometry;
 
-  Vector4 mColor;                //Color of shape.
   Vector3 mObjectDimensions;     //Dimensions of shape, scaled to be between 0.0 and 1.0.
 
   Vector3 mSceneCenter;
index 2b40d32..abca281 100644 (file)
@@ -130,11 +130,12 @@ const char* FRAGMENT_SHADER_ATLAS_CLAMP = DALI_COMPOSE_SHADER(
     uniform sampler2D sTexture;\n
     uniform mediump vec4 uAtlasRect;\n
     uniform lowp vec4 uColor;\n
+    uniform lowp vec4 mixColor;\n
     \n
     void main()\n
     {\n
       mediump vec2 texCoord = clamp( mix( uAtlasRect.xy, uAtlasRect.zw, vTexCoord ), uAtlasRect.xy, uAtlasRect.zw );\n
-      gl_FragColor = texture2D( sTexture, texCoord ) * uColor;\n
+      gl_FragColor = texture2D( sTexture, texCoord ) * uColor * mixColor;\n
     }\n
 );
 
@@ -269,10 +270,14 @@ void TextVisual::DoSetOnStage( Actor& actor )
 
   Geometry geometry = mFactoryCache.GetGeometry( VisualFactoryCache::QUAD_GEOMETRY );
 
-  Shader shader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER_ATLAS_CLAMP );
-  mFactoryCache.SaveShader( VisualFactoryCache::IMAGE_SHADER_ATLAS_DEFAULT_WRAP, shader );
+  Shader shader = mFactoryCache.GetShader( VisualFactoryCache::TEXT_SHADER );
+  if( ! shader )
+  {
+    shader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER_ATLAS_CLAMP );
+    shader.RegisterProperty( PIXEL_AREA_UNIFORM_NAME, FULL_TEXTURE_RECT );
 
-  shader.RegisterProperty( PIXEL_AREA_UNIFORM_NAME, FULL_TEXTURE_RECT );
+    mFactoryCache.SaveShader( VisualFactoryCache::TEXT_SHADER, shader );
+  }
 
   mImpl->mRenderer = Renderer::New( geometry, shader );
   mImpl->mRenderer.SetProperty( Dali::Renderer::Property::DEPTH_INDEX, Toolkit::DepthIndex::TEXT );
index f8d3e5f..16044b7 100644 (file)
@@ -83,9 +83,12 @@ Dali::Vector2 PointToVector2( Toolkit::Align::Type point, Toolkit::Direction::Ty
 
 Internal::Visual::Base::Impl::Impl()
 : mCustomShader( NULL ),
+  mBlendSlotDelegate( NULL ),
   mTransform(),
+  mMixColor( Color::WHITE ),
   mControlSize( Vector2::ZERO ),
   mDepthIndex( 0.0f ),
+  mMixColorIndex( Property::INVALID_INDEX ),
   mFlags( 0 )
 {
 }
@@ -93,6 +96,7 @@ Internal::Visual::Base::Impl::Impl()
 Internal::Visual::Base::Impl::~Impl()
 {
   delete mCustomShader;
+  delete mBlendSlotDelegate;
 }
 
 Internal::Visual::Base::Impl::CustomShader::CustomShader( const Property::Map& map )
@@ -215,6 +219,11 @@ void Internal::Visual::Base::Impl::Transform::SetPropertyMap( const Property::Ma
   mOrigin = Toolkit::Align::CENTER;
   mAnchorPoint = Toolkit::Align::CENTER;
 
+  UpdatePropertyMap( map );
+}
+
+void Internal::Visual::Base::Impl::Transform::UpdatePropertyMap( const Property::Map& map )
+{
   for( Property::Map::SizeType i(0); i<map.Count(); ++i )
   {
     KeyValuePair keyValue = map.GetKeyValue( i );
index 098ad1e..999b41c 100644 (file)
@@ -73,10 +73,37 @@ struct Base::Impl
 
   struct Transform
   {
+    /**
+     * Default constructor ensures the visual fills the control
+     */
     Transform();
+
+    /**
+     * Use the property map to set zero or more of the transform
+     * attributes, and sets the remaining attributes to their default
+     * values.
+     */
     void SetPropertyMap( const Property::Map& map );
+
+    /**
+     * Add the transform attributes to the map (using integer keys)
+     */
     void GetPropertyMap( Property::Map& map ) const;
+
+    /**
+     * Update zero or more attributes from the property map.
+     */
+    void UpdatePropertyMap( const Property::Map& map );
+
+    /**
+     * Register or set the uniform properties onto the renderer
+     */
     void RegisterUniforms( Renderer renderer, Toolkit::Direction::Type direction );
+
+    /**
+     * Convert the control size and the transform attributes into the actual
+     * size of the visual.
+     */
     Vector2 GetVisualSize( const Vector2& controlSize );
 
     Vector2 mOffset;
@@ -86,13 +113,16 @@ struct Base::Impl
     Toolkit::Align::Type mAnchorPoint;
   };
 
-  Renderer      mRenderer;
-  CustomShader* mCustomShader;
-  std::string   mName;
-  Transform     mTransform;
-  Size          mControlSize;
-  float         mDepthIndex;
-  int           mFlags;
+  Renderer        mRenderer;
+  CustomShader*   mCustomShader;
+  SlotDelegate<Visual::Base>* mBlendSlotDelegate; ///< Used to own mix color animation connection
+  std::string     mName;
+  Transform       mTransform;
+  Vector4         mMixColor;
+  Size            mControlSize;
+  float           mDepthIndex;
+  Property::Index mMixColorIndex;
+  int             mFlags;
 };
 
 } // namespace Visual
index 5815c4a..68620ea 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
@@ -20,6 +20,7 @@
 
 // EXTERNAL HEADER
 #include <dali/public-api/common/dali-common.h>
+#include <dali/devel-api/object/handle-devel.h>
 #include <dali/integration-api/debug.h>
 
 //INTERNAL HEARDER
@@ -73,7 +74,29 @@ void Visual::Base::SetProperties( const Property::Map& propertyMap )
     const KeyValuePair& pair = propertyMap.GetKeyValue( i );
     const Property::Key& key = pair.first;
     const Property::Value& value = pair.second;
-    switch( key.indexKey )
+
+    Property::Key matchKey = key;
+    if( matchKey.type == Property::Key::STRING )
+    {
+      if( matchKey == CUSTOM_SHADER )
+      {
+        matchKey = Property::Key( DevelVisual::Property::SHADER );
+      }
+      else if( matchKey == TRANSFORM )
+      {
+        matchKey = Property::Key( DevelVisual::Property::TRANSFORM );
+      }
+      else if( matchKey == PREMULTIPLIED_ALPHA )
+      {
+        matchKey = Property::Key( DevelVisual::Property::PREMULTIPLIED_ALPHA );
+      }
+      else if( matchKey == MIX_COLOR )
+      {
+        matchKey = Property::Key( DevelVisual::Property::MIX_COLOR );
+      }
+    }
+
+    switch( matchKey.indexKey )
     {
       case DevelVisual::Property::SHADER:
       {
@@ -104,6 +127,16 @@ void Visual::Base::SetProperties( const Property::Map& propertyMap )
         }
         break;
       }
+
+      case DevelVisual::Property::MIX_COLOR:
+      {
+        Vector4 mixColor;
+        if( value.Get( mixColor ) )
+        {
+          SetMixColor( mixColor );
+        }
+        break;
+      }
     }
   }
 
@@ -188,6 +221,8 @@ void Visual::Base::SetOnStage( Actor& actor )
 
     if( mImpl->mRenderer )
     {
+      RegisterMixColor();
+
       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
@@ -200,7 +235,7 @@ void Visual::Base::SetOffStage( Actor& actor )
   if( IsOnStage() )
   {
     DoSetOffStage( actor );
-
+    mImpl->mMixColorIndex = Property::INVALID_INDEX;
     mImpl->mFlags &= ~Impl::IS_ON_STAGE;
   }
 }
@@ -220,6 +255,10 @@ void Visual::Base::CreatePropertyMap( Property::Map& map ) const
 
   bool premultipliedAlpha( IsPreMultipliedAlphaEnabled() );
   map.Insert( DevelVisual::Property::PREMULTIPLIED_ALPHA, premultipliedAlpha );
+
+  // Note, Color and Primitive will also insert their own mix color into the map
+  // which is ok, because they have a different key value range.
+  map.Insert( DevelVisual::Property::MIX_COLOR, GetMixColor() );
 }
 
 void Visual::Base::EnablePreMultipliedAlpha( bool preMultipled )
@@ -260,11 +299,224 @@ bool Visual::Base::IsFromCache() const
   return mImpl->mFlags & Impl::IS_FROM_CACHE;
 }
 
+void Visual::Base::RegisterMixColor()
+{
+  // Only register if not already registered.
+  // (Color and Primitive visuals will register their own and save to this index)
+  if( mImpl->mMixColorIndex == Property::INVALID_INDEX )
+  {
+    mImpl->mMixColorIndex = DevelHandle::RegisterProperty(
+      mImpl->mRenderer,
+      Toolkit::DevelVisual::Property::MIX_COLOR,
+      MIX_COLOR,
+      mImpl->mMixColor );
+
+    if( mImpl->mMixColor.a < 1.f )
+    {
+      mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
+    }
+
+    float preMultipliedAlpha = 0.0f;
+    if( IsPreMultipliedAlphaEnabled() )
+    {
+      preMultipliedAlpha = 1.0f;
+    }
+    mImpl->mRenderer.RegisterProperty( "preMultipliedAlpha", preMultipliedAlpha );
+  }
+}
+
+void Visual::Base::SetMixColor( const Vector4& color )
+{
+  mImpl->mMixColor = color;
+
+  if( mImpl->mRenderer )
+  {
+    mImpl->mRenderer.SetProperty( mImpl->mMixColorIndex, color );
+    if( color.a < 1.f )
+    {
+      mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
+    }
+  }
+}
+
+const Vector4& Visual::Base::GetMixColor() const
+{
+  return mImpl->mMixColor;
+}
+
 Renderer Visual::Base::GetRenderer()
 {
   return mImpl->mRenderer;
 }
 
+
+Property::Index Visual::Base::GetPropertyIndex( Property::Key key )
+{
+  Property::Index index = DevelHandle::GetPropertyIndex( mImpl->mRenderer, key );
+
+  if( index == Property::INVALID_INDEX )
+  {
+    // Is it a shader property?
+    Shader shader = mImpl->mRenderer.GetShader();
+    index = DevelHandle::GetPropertyIndex( shader, key );
+    if( index != Property::INVALID_INDEX )
+    {
+      // Yes - we should register it in the Renderer so it can be set / animated
+      // independently, as shaders are shared across multiple renderers.
+      std::string keyName;
+      Property::Index keyIndex( Property::INVALID_KEY );
+      if( key.type == Property::Key::INDEX )
+      {
+        keyName = shader.GetPropertyName( index );
+        keyIndex = key.indexKey;
+      }
+      else
+      {
+        keyName = key.stringKey;
+        // Leave keyIndex as INVALID_KEY - it can still be registered against the string key.
+      }
+      Property::Value value = shader.GetProperty( index );
+      index = DevelHandle::RegisterProperty( mImpl->mRenderer, keyIndex, keyName, value );
+    }
+  }
+  return index;
+}
+
+void Visual::Base::SetupTransition(
+  Dali::Animation& transition,
+  Internal::TransitionData::Animator& animator,
+  Property::Index index )
+{
+  if( index != Property::INVALID_INDEX )
+  {
+    if( mImpl->mRenderer )
+    {
+      if( animator.animate == false )
+      {
+        mImpl->mRenderer.SetProperty( index, animator.targetValue );
+      }
+      else
+      {
+        if( animator.initialValue.GetType() != Property::NONE )
+        {
+          mImpl->mRenderer.SetProperty( index, animator.initialValue );
+        }
+
+        if( ! transition )
+        {
+          transition = Dali::Animation::New( 0.1f );
+        }
+
+        transition.AnimateTo( Property( mImpl->mRenderer, index ),
+                              animator.targetValue,
+                              animator.alphaFunction,
+                              TimePeriod( animator.timePeriodDelay,
+                                          animator.timePeriodDuration ) );
+      }
+    }
+  }
+}
+
+void Visual::Base::AnimateProperty(
+  Dali::Animation& transition,
+  Internal::TransitionData::Animator& animator )
+{
+#if defined(DEBUG_ENABLED)
+  {
+    std::ostringstream oss;
+    oss << "Visual::Base::AnimateProperty(Visual:" << mImpl->mName << " Property:" << animator.propertyKey << " Target: " << animator.targetValue << std::endl;
+    DALI_LOG_INFO( gVisualBaseLogFilter, Debug::General, oss.str().c_str() );
+  }
+#endif
+
+  Property::Index index = Property::INVALID_INDEX;
+
+  bool isMixColor = false;
+  bool isMixColorOpaque = true;
+
+  // Get the property index
+  if( animator.propertyKey == Toolkit::DevelVisual::Property::MIX_COLOR ||
+      animator.propertyKey == MIX_COLOR )
+  {
+    isMixColor = true;
+    index = mImpl->mMixColorIndex;
+
+    Vector4 initialColor;
+    if( animator.initialValue.Get(initialColor) ) // if there is an initial color, test it
+    {
+      isMixColorOpaque = initialColor.a >= 1.0f;
+    }
+    else
+    {
+      isMixColorOpaque = mImpl->mMixColor.a >= 1.0f; // otherwise, test the current color
+    }
+  }
+  else if( mImpl->mRenderer )
+  {
+    index = GetPropertyIndex( animator.propertyKey );
+  }
+
+  // Set target value into data store
+  if( animator.targetValue.GetType() != Property::NONE )
+  {
+    if( isMixColor )
+    {
+      animator.targetValue.Get( mImpl->mMixColor );
+    }
+    else
+    {
+      // Note: there may be several of these calls if more than one
+      // transform property is animated.
+      Property::Map map;
+      if( animator.propertyKey.type == Property::Key::INDEX )
+      {
+        map.Add( animator.propertyKey.indexKey, animator.targetValue );
+      }
+      else
+      {
+        map.Add( animator.propertyKey.stringKey, animator.targetValue );
+      }
+
+      mImpl->mTransform.UpdatePropertyMap( map );
+    }
+  }
+
+  if( index != Property::INVALID_INDEX )
+  {
+    SetupTransition( transition, animator, index );
+
+    // For mix color, ensure the blend mode is on if the initial or final values are not opaque,
+    // and that it is turned off after the animation ends if the final value is opaque
+    if( isMixColor && (!isMixColorOpaque || mImpl->mMixColor.a < 1.0f) )
+    {
+      mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
+
+      if( animator.animate == true && mImpl->mMixColor.a >= 1.0f )
+      {
+        // When it becomes opaque, set the blend mode back to automatically
+        if( ! mImpl->mBlendSlotDelegate )
+        {
+          mImpl->mBlendSlotDelegate = new SlotDelegate<Visual::Base>(this);
+        }
+        transition.FinishedSignal().Connect( *(mImpl->mBlendSlotDelegate),
+                                             &Visual::Base::OnMixColorFinished );
+      }
+    }
+  }
+}
+
+void Visual::Base::OnMixColorFinished( Animation& animation )
+{
+  if( mImpl->mRenderer )
+  {
+    DALI_LOG_INFO( gVisualBaseLogFilter, Debug::General, "Visual::Base::OnMixColorFinished()\n");
+    mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE,
+                                  ( mImpl->mMixColor.a < 1.0 ) ? BlendMode::ON : BlendMode::AUTO );
+  }
+  delete mImpl->mBlendSlotDelegate;
+  mImpl->mBlendSlotDelegate = NULL;
+}
+
 } // namespace Internal
 
 } // namespace Toolkit
index f740909..1722964 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
+#include <dali/public-api/animation/animation.h>
 #include <dali/public-api/common/intrusive-ptr.h>
 #include <dali/public-api/images/image-operations.h>
 #include <dali/public-api/object/base-object.h>
@@ -27,8 +28,9 @@
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
-#include <dali-toolkit/internal/visuals/visual-factory-cache.h>
 #include <dali-toolkit/devel-api/visual-factory/visual-base.h>
+#include <dali-toolkit/internal/visuals/transition-data-impl.h>
+#include <dali-toolkit/internal/visuals/visual-factory-cache.h>
 
 namespace Dali
 {
@@ -163,6 +165,33 @@ public:
    */
   Renderer GetRenderer();
 
+  /**
+   * Sets the mix color of the visual.
+   * @param[in] mixColor The new mix color
+   */
+  void SetMixColor( const Vector4& color );
+
+  /**
+   * Gets the mix color of the visual.
+   * @return The mix color
+   */
+  const Vector4& GetMixColor() const;
+
+  /**
+   * Animate the property if it exists in the visual or renderer.
+   *
+   * If it's a visual property such as mix color or a transform property,
+   * saves the target value to the local data.
+   *
+   * If the visual isn't staged (i.e. it doesn't have a renderer),
+   * then this will not add an animation.
+   *
+   * @param[in] transition The animation to create or attach to
+   * @param[in] animator The animation parameters of the property.
+   */
+  void AnimateProperty( Dali::Animation& transition,
+                        Internal::TransitionData::Animator& animator );
+
 protected:
 
   /**
@@ -233,6 +262,40 @@ protected:
 
 private:
 
+  /**
+   * Register the mix color uniform on the Renderer and store the property index.
+   * Note, this is not used by Color or Primitive Visuals, which will use their
+   * own property index.
+   */
+  void RegisterMixColor();
+
+  /**
+   * Find the matching property on the renderer or shader. If it's a shader
+   * property, register it on the renderer in order to animate it for this
+   * visual independently.
+   * @param[in] key The key to match.
+   * @return the matching index, or INVALID_INDEX if it's not found
+   */
+  Property::Index GetPropertyIndex( Property::Key key );
+
+  /**
+   * Set up the transition. If no animation is required, then
+   * transition will be untouched.
+   *
+   * @param[in] transition The transition to use or set up.
+   * @param[in] animator The animation data to use
+   * @param[in] index The property index on the renderer to animate
+   */
+  void SetupTransition( Dali::Animation& transition,
+                        Internal::TransitionData::Animator& animator,
+                        Property::Index index );
+
+  /**
+   * When a mix color animation has finished, ensure the blend mode is set back
+   * to the right value for the target opacity.
+   */
+  void OnMixColorFinished( Animation& animation );
+
   // Undefined
   Base( const Visual::Base& visual );
 
index 8bbae5c..641c013 100644 (file)
@@ -69,6 +69,7 @@ public:
     IMAGE_SHADER_ATLAS_CUSTOM_WRAP,
     NINE_PATCH_SHADER,
     SVG_SHADER,
+    TEXT_SHADER,
     WIREFRAME_SHADER,
     SHADER_TYPE_MAX = WIREFRAME_SHADER
   };
index 9126fce..6f1875a 100644 (file)
@@ -54,15 +54,18 @@ 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" );
+const char * const TRANSFORM( "transform" );
+const char * const SIZE( "size" );
+const char * const OFFSET( "offset" );
+const char * const OFFSET_SIZE_MODE( "offsetSizeMode" );
+const char * const ORIGIN( "origin" );
+const char * const ANCHOR_POINT( "anchorPoint" );
 
 // Premultipled alpha
-extern const char * const PREMULTIPLIED_ALPHA( "premultipliedAlpha" );
+const char * const PREMULTIPLIED_ALPHA( "premultipliedAlpha" );
+
+// Mix color
+const char * const MIX_COLOR( "mixColor" );
 
 // Image visual
 const char * const IMAGE_URL_NAME( "url" );
index c6692c0..d00feed 100644 (file)
@@ -54,6 +54,9 @@ extern const char * const ANCHOR_POINT;
 // Premultiplied alpha
 extern const char * const PREMULTIPLIED_ALPHA;
 
+// Mix color
+extern const char * const MIX_COLOR;
+
 // Image visual
 extern const char * const IMAGE_URL_NAME;
 extern const char * const ATLAS_RECT_UNIFORM_NAME;
index 5fd3160..0a5221d 100644 (file)
@@ -68,10 +68,11 @@ void main()\n
 
 const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(\n
 uniform lowp vec4 uColor;\n
+uniform lowp vec4 mixColor;\n
 \n
 void main()\n
 {\n
-  gl_FragColor = uColor;\n
+  gl_FragColor = uColor*mixColor;\n
 }\n
 );
 
@@ -153,7 +154,13 @@ void WireframeVisual::DoCreatePropertyMap( Property::Map& map ) const
 
 void WireframeVisual::DoSetProperties( const Property::Map& propertyMap )
 {
-  // no properties supported at the moment
+  Property::Value* mixValue = propertyMap.Find( Toolkit::DevelVisual::Property::MIX_COLOR, MIX_COLOR );
+  if( mixValue )
+  {
+    Vector4 mixColor;
+    mixValue->Get( mixColor );
+    SetMixColor( mixColor );
+  }
 }
 
 void WireframeVisual::DoSetOnStage( Actor& actor )
index c62684f..18dd3fd 100644 (file)
@@ -48,6 +48,7 @@
 #include <dali-toolkit/internal/styling/style-manager-impl.h>
 #include <dali-toolkit/internal/visuals/color/color-visual.h>
 #include <dali-toolkit/internal/visuals/transition-data-impl.h>
+#include <dali-toolkit/internal/visuals/visual-string-constants.h>
 #include <dali-toolkit/devel-api/align-enums.h>
 #include <dali-toolkit/internal/controls/tooltip/tooltip.h>
 
@@ -78,29 +79,12 @@ struct RegisteredVisual
   Toolkit::Visual::Base visual;
   bool enabled;
 
-  RegisteredVisual( Property::Index aIndex, Toolkit::Visual::Base &aVisual, bool aEnabled) :
-                   index(aIndex), visual(aVisual), enabled(aEnabled) {}
-};
-
-struct HandleIndex
-{
-  Handle handle; ///< a handle to the target object
-  Property::Index index; ///< The index of a property provided by the referenced object
-
-  HandleIndex( )
-  : handle(),
-    index( Property::INVALID_INDEX )
-  {
-  }
-
-  HandleIndex( Handle& handle, Property::Index index )
-  : handle( handle ),
-    index( index )
+  RegisteredVisual( Property::Index aIndex, Toolkit::Visual::Base &aVisual, bool aEnabled)
+  : index(aIndex), visual(aVisual), enabled(aEnabled)
   {
   }
 };
 
-
 typedef Dali::OwnerContainer< RegisteredVisual* > RegisteredVisualContainer;
 
 /**
@@ -118,43 +102,23 @@ bool FindVisual( Property::Index targetIndex, RegisteredVisualContainer& visuals
   return false;
 }
 
-HandleIndex GetVisualProperty(
-  Internal::Control& controlImpl,
+Toolkit::Visual::Base GetVisualByName(
   RegisteredVisualContainer& visuals,
-  const std::string& visualName,
-  Property::Key propertyKey )
+  const std::string& visualName )
 {
-#if defined(DEBUG_ENABLED)
-  std::ostringstream oss;
-  oss << "Control::GetVisualProperty(" << visualName << ", " << propertyKey << ")" << std::endl;
-  DALI_LOG_INFO( gLogFilter, Debug::General, oss.str().c_str() );
-#endif
+  Toolkit::Visual::Base visualHandle;
 
-  // Find visualName in the control
   RegisteredVisualContainer::Iterator iter;
   for ( iter = visuals.Begin(); iter != visuals.End(); iter++ )
   {
     Toolkit::Visual::Base visual = (*iter)->visual;
     if( visual && visual.GetName() == visualName )
     {
-      Internal::Visual::Base& visualImpl = GetImplementation(visual);
-      Renderer renderer = visualImpl.GetRenderer();
-      if( renderer )
-      {
-        Property::Index index = DevelHandle::GetPropertyIndex( renderer, propertyKey );
-        if( index != Property::INVALID_INDEX )
-        {
-          return HandleIndex( renderer, index );
-        }
-      }
+      visualHandle = visual;
+      break;
     }
   }
-
-  std::ostringstream noRenderers;
-  noRenderers << propertyKey;
-  DALI_LOG_WARNING( "Control::GetVisualProperty(%s, %s) No renderers\n", visualName.c_str(), noRenderers.str().c_str() );
-  Handle handle;
-  return HandleIndex( handle, Property::INVALID_INDEX );
+  return visualHandle;
 }
 
 void SetDefaultTransform( Property::Map& propertyMap )
@@ -831,8 +795,8 @@ void Control::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visu
   {
     Toolkit::GetImplementation(visual).SetOnStage( self );
   }
-  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Control::RegisterVisual number of registered visuals(%d)\n",  mImpl->mVisuals.Size() );
 
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Control::RegisterVisual() Registered %s(%d), enabled:%s\n",  visual.GetName().c_str(), index, enabled?"T":"F" );
 }
 
 void Control::UnregisterVisual( Property::Index index )
@@ -865,7 +829,7 @@ void Control::EnableVisual( Property::Index index, bool enable )
   {
     if (  (*iter)->enabled == enable )
     {
-      DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Control::EnableVisual Visual Already enabled set (%s) \n", enable?"enabled":"disabled");
+      DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Control::EnableVisual Visual %s(%d) already %s\n", (*iter)->visual.GetName().c_str(), index, enable?"enabled":"disabled");
       return;
     }
 
@@ -875,12 +839,12 @@ void Control::EnableVisual( Property::Index index, bool enable )
     {
       if ( enable )
       {
-        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Control::EnableVisual Setting Visual(%d) on stage \n", index );
+        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Control::EnableVisual Setting %s(%d) on stage \n", (*iter)->visual.GetName().c_str(), index );
         Toolkit::GetImplementation((*iter)->visual).SetOnStage( parentActor );
       }
       else
       {
-        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Control::EnableVisual Setting Visual(%d) off stage \n", index );
+        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Control::EnableVisual Setting %s(%d) off stage \n", (*iter)->visual.GetName().c_str(), index );
         Toolkit::GetImplementation((*iter)->visual).SetOffStage( parentActor );  // No need to call if control not staged.
       }
     }
@@ -910,50 +874,49 @@ Dali::Animation Control::CreateTransition( const Toolkit::TransitionData& handle
          iter != end; ++iter )
     {
       TransitionData::Animator* animator = (*iter);
-      HandleIndex handleIndex;
 
-      // Attempt to find the object name as a child actor
-      Actor child = Self().FindChildByName( animator->objectName );
-      if( child )
+      Toolkit::Visual::Base visual = GetVisualByName( mImpl->mVisuals, animator->objectName );
+
+      if( visual )
       {
-        Property::Index propertyIndex = DevelHandle::GetPropertyIndex( child, animator->propertyKey );
-        handleIndex = HandleIndex( child, propertyIndex );
+        Internal::Visual::Base& visualImpl = Toolkit::GetImplementation( visual );
+        visualImpl.AnimateProperty( transition, *animator );
       }
       else
       {
-        handleIndex = GetVisualProperty( *this, mImpl->mVisuals,
-                                            animator->objectName,
-                                            animator->propertyKey );
-      }
-
-      if( handleIndex.handle && handleIndex.index != Property::INVALID_INDEX )
-      {
-        if( animator->animate == false )
-        {
-          if( animator->targetValue.GetType() != Property::NONE )
-          {
-            handleIndex.handle.SetProperty( handleIndex.index, animator->targetValue );
-          }
-        }
-        else
+        // Otherwise, try any actor children of control (Including the control)
+        Actor child = Self().FindChildByName( animator->objectName );
+        if( child )
         {
-          if( animator->initialValue.GetType() != Property::NONE )
+          Property::Index propertyIndex = DevelHandle::GetPropertyIndex( child, animator->propertyKey );
+          if( propertyIndex != Property::INVALID_INDEX )
           {
-            handleIndex.handle.SetProperty( handleIndex.index, animator->initialValue );
-          }
-
-          if( ! transition )
-          {
-            // Create an animation with a default .1 second duration - the animators
-            // will automatically force it to the 'right' duration.
-            transition = Dali::Animation::New( 0.1f );
+            if( animator->animate == false )
+            {
+              if( animator->targetValue.GetType() != Property::NONE )
+              {
+                child.SetProperty( propertyIndex, animator->targetValue );
+              }
+            }
+            else // animate the property
+            {
+              if( animator->initialValue.GetType() != Property::NONE )
+              {
+                child.SetProperty( propertyIndex, animator->initialValue );
+              }
+
+              if( ! transition )
+              {
+                transition = Dali::Animation::New( 0.1f );
+              }
+
+              transition.AnimateTo( Property( child, propertyIndex ),
+                                    animator->targetValue,
+                                    animator->alphaFunction,
+                                    TimePeriod( animator->timePeriodDelay,
+                                                animator->timePeriodDuration ) );
+            }
           }
-
-          transition.AnimateTo( Property( handleIndex.handle, handleIndex.index ),
-                                animator->targetValue,
-                                animator->alphaFunction,
-                                TimePeriod( animator->timePeriodDelay,
-                                            animator->timePeriodDuration ) );
         }
       }
     }
index d850eb4..729cf80 100644 (file)
@@ -371,6 +371,11 @@ protected: // For derived classes to call
   /**
    * @brief Create a transition effect on the control.
    *
+   * Only generates an animation if the properties described in the transition
+   * data are staged (e.g. the visual is Enabled and the control is on stage).
+   * Otherwise the target values are stored, and will get set onto the properties
+   * when the visual is next staged.
+   *
    * @SINCE_1_2.12
    *
    * @param[in] transitionData The transition data describing the effect to create
index eadaa49..471f371 100644 (file)
@@ -248,7 +248,7 @@ unsigned int FixedRuler::GetPageFromPosition(float position, bool wrap) const
     {
       position = WrapInDomain(position, mDomain.min, mDomain.max);
     }
-    page = std::max(static_cast<double>(0.0f), floor((position - mDomain.min) / mSpacing + 0.5f));
+    page = std::max(static_cast<double>(0.0f), static_cast<double>(floor((position - mDomain.min) / mSpacing + 0.5f)));
 
     if(wrap)
     {
index e1520bf..2f81c64 100755 (executable)
@@ -23,8 +23,8 @@ if BUILD_MCS
 
 all-local: libNDalic.so NDali.dll
 
-libNDalic.so: automatic/cpp/dali_wrap.o manual/cpp/keyboard_focus_manager_wrap.o manual/cpp/view-wrapper-impl-wrap.o manual/cpp/callbackbase_wrap.o
-       g++ -shared automatic/cpp/dali_wrap.o manual/cpp/keyboard_focus_manager_wrap.o manual/cpp/view-wrapper-impl-wrap.o manual/cpp/callbackbase_wrap.o -o libNDalic.so $(DALICORE_LIBS) $(DALIADAPTOR_LIBS) $(DALITOOLKIT_LIBS)
+libNDalic.so: automatic/cpp/dali_wrap.o manual/cpp/keyboard_focus_manager_wrap.o manual/cpp/view-wrapper-impl-wrap.o manual/cpp/callbackbase_wrap.o manual/cpp/devel-property-wrap.o
+       g++ -shared automatic/cpp/dali_wrap.o manual/cpp/keyboard_focus_manager_wrap.o manual/cpp/view-wrapper-impl-wrap.o manual/cpp/callbackbase_wrap.o manual/cpp/devel-property-wrap.o -o libNDalic.so $(DALICORE_LIBS) $(DALIADAPTOR_LIBS) $(DALITOOLKIT_LIBS)
 
 automatic/cpp/dali_wrap.o: $(BUILT_SOURCES)
        g++ -c -fpic $(CXXFLAGS) $(DALICORE_CFLAGS) $(DALIADAPTOR_CFLAGS) $(DALITOOLKIT_CFLAGS) automatic/cpp/dali_wrap.cpp -o automatic/cpp/dali_wrap.o
@@ -38,6 +38,9 @@ manual/cpp/view-wrapper-impl-wrap.o: $(BUILT_SOURCES)
 manual/cpp/callbackbase_wrap.o: $(BUILT_SOURCES)
        g++ -c -fpic $(CXXFLAGS) $(DALICORE_CFLAGS) $(DALIADAPTOR_CFLAGS) $(DALITOOLKIT_CFLAGS) manual/cpp/callbackbase_wrap.cpp -o manual/cpp/callbackbase_wrap.o
 
+manual/cpp/devel-property-wrap.o: $(BUILT_SOURCES)
+       g++ -c -fpic $(CXXFLAGS) $(DALICORE_CFLAGS) $(DALIADAPTOR_CFLAGS) $(DALITOOLKIT_CFLAGS) manual/cpp/devel-property-wrap.cpp -o manual/cpp/devel-property-wrap.o
+
 NDali.dll: $(BUILT_SOURCES)
        $(MCS) -nologo -target:library -out:NDali.dll automatic/csharp/*.cs manual/csharp/*.cs views/*.cs
 
index e4da86b..09963f4 100755 (executable)
@@ -282,6 +282,8 @@ using namespace Dali::Toolkit;
 %include name-changed.i
 %include property-value.i
 %include dali-operator.i
+%include devel-properties.i
+
 %include dali-core.i
 %include dali-adaptor.i
 %include dali-toolkit.i
diff --git a/plugins/dali-swig/SWIG/devel-properties.i b/plugins/dali-swig/SWIG/devel-properties.i
new file mode 100644 (file)
index 0000000..9cd8714
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2017 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.
+ *
+ */
+
+%typemap(cscode) Dali::Actor::Property %{
+  public static readonly int BATCH_PARENT = NDalicManualPINVOKE.Actor_Property_BATCH_PARENT_get();
+  public static readonly int SIBLING_ORDER = NDalicManualPINVOKE.Actor_Property_SIBLING_ORDER_get();
+%}
+
+%typemap(cscode) Dali::Renderer::Property %{
+  public static readonly int BATCHING_ENABLED = NDalicManualPINVOKE.Renderer_Property_BATCHING_ENABLED_get();
+%}
+
+%typemap(cscode) Dali::Renderer %{
+  public bool BatchingEnabled
+  {
+    get
+    {
+      bool temp = false;
+      GetProperty( Renderer.Property.BATCHING_ENABLED).Get( ref temp );
+      return temp;
+    }
+    set
+    {
+      SetProperty( Renderer.Property.BATCHING_ENABLED, new Dali.Property.Value( value ) );
+    }
+  }
+%}
+
+%typemap(cscode) Dali::Toolkit::Control::Property %{
+  public static readonly int TOOLTIP = NDalicManualPINVOKE.View_Property_TOOLTIP_get();
+%}
+
+%typemap(cscode) Dali::Toolkit::ItemView::Property %{
+  public static readonly int LAYOUT = NDalicManualPINVOKE.ItemView_Property_LAYOUT_get();
+%}
+
+%typemap(cscode) Dali::Toolkit::ItemView %{
+  public Dali.Property.Array Layout
+  {
+    get
+    {
+      Dali.Property.Array temp = new Dali.Property.Array();
+      GetProperty( ItemView.Property.LAYOUT).Get( temp );
+      return temp;
+    }
+    set
+    {
+      SetProperty( ItemView.Property.LAYOUT, new Dali.Property.Value( value ) );
+    }
+  }
+%}
+
+%typemap(cscode) Dali::Toolkit::Button::Property %{
+  public static readonly int UNSELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_UNSELECTED_VISUAL_get();
+  public static readonly int SELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_SELECTED_VISUAL_get();
+  public static readonly int DISABLED_SELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_SELECTED_VISUAL_get();
+  public static readonly int DISABLED_UNSELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_UNSELECTED_VISUAL_get();
+  public static readonly int UNSELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_UNSELECTED_BACKGROUND_VISUAL_get();
+  public static readonly int SELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_SELECTED_BACKGROUND_VISUAL_get();
+  public static readonly int DISABLED_UNSELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_UNSELECTED_BACKGROUND_VISUAL_get();
+  public static readonly int DISABLED_SELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_SELECTED_BACKGROUND_VISUAL_get();
+  public static readonly int LABEL_RELATIVE_ALIGNMENT = NDalicManualPINVOKE.Button_Property_LABEL_RELATIVE_ALIGNMENT_get();
+  public static readonly int LABEL_PADDING = NDalicManualPINVOKE.Button_Property_LABEL_PADDING_get();
+  public static readonly int VISUAL_PADDING = NDalicManualPINVOKE.Button_Property_VISUAL_PADDING_get();
+%}
+
index f65e658..93f803c 100755 (executable)
       }
     }
 
+    public bool BatchParent
+    {
+      get
+      {
+        bool temp = false;
+        GetProperty( Actor.Property.BATCH_PARENT).Get( ref temp );
+        return temp;
+      }
+      set
+      {
+        SetProperty( Actor.Property.BATCH_PARENT, new Dali.Property.Value( value ) );
+      }
+    }
+
+    public int SiblingOrder
+    {
+      get
+      {
+        int temp = 0;
+        GetProperty( Actor.Property.SIBLING_ORDER).Get( ref temp );
+        return temp;
+      }
+      set
+      {
+        SetProperty( Actor.Property.SIBLING_ORDER, new Dali.Property.Value( value ) );
+      }
+    }
+
     public void Show()
     {
       SetVisible(true);
     {
       SetVisible(false);
     }
-
 %}
 
 %enddef
index bfef5ad..7dbf6af 100644 (file)
@@ -312,6 +312,159 @@ public class StateChangedEventArgs : EventArgs
     return ret;
   }
 
+  public Dali.Property.Map UnselectedVisual
+  {
+    get
+    {
+      Dali.Property.Map temp = new Dali.Property.Map();
+      GetProperty( Button.Property.UNSELECTED_VISUAL).Get(  temp );
+      return temp;
+    }
+    set
+    {
+      SetProperty( Button.Property.UNSELECTED_VISUAL, new Dali.Property.Value( value ) );
+    }
+  }
+
+  public Dali.Property.Map SelectedVisual
+  {
+    get
+    {
+      Dali.Property.Map temp = new Dali.Property.Map();
+      GetProperty( Button.Property.SELECTED_VISUAL).Get(  temp );
+      return temp;
+    }
+    set
+    {
+      SetProperty( Button.Property.SELECTED_VISUAL, new Dali.Property.Value( value ) );
+    }
+  }
+
+  public Dali.Property.Map DisabledSelectedVisual
+  {
+    get
+    {
+      Dali.Property.Map temp = new Dali.Property.Map();
+      GetProperty( Button.Property.DISABLED_SELECTED_VISUAL).Get(  temp );
+      return temp;
+    }
+    set
+    {
+      SetProperty( Button.Property.DISABLED_SELECTED_VISUAL, new Dali.Property.Value( value ) );
+    }
+  }
+
+  public Dali.Property.Map DisabledUnselectedVisual
+  {
+    get
+    {
+      Dali.Property.Map temp = new Dali.Property.Map();
+      GetProperty( Button.Property.DISABLED_UNSELECTED_VISUAL).Get(  temp );
+      return temp;
+    }
+    set
+    {
+      SetProperty( Button.Property.DISABLED_UNSELECTED_VISUAL, new Dali.Property.Value( value ) );
+    }
+  }
+
+  public Dali.Property.Map UnselectedBackgroundVisual
+  {
+    get
+    {
+      Dali.Property.Map temp = new Dali.Property.Map();
+      GetProperty( Button.Property.UNSELECTED_BACKGROUND_VISUAL).Get(  temp );
+      return temp;
+    }
+    set
+    {
+      SetProperty( Button.Property.UNSELECTED_BACKGROUND_VISUAL, new Dali.Property.Value( value ) );
+    }
+  }
+
+  public Dali.Property.Map SelectedBackgroundVisual
+  {
+    get
+    {
+      Dali.Property.Map temp = new Dali.Property.Map();
+      GetProperty( Button.Property.SELECTED_BACKGROUND_VISUAL).Get(  temp );
+      return temp;
+    }
+    set
+    {
+      SetProperty( Button.Property.SELECTED_BACKGROUND_VISUAL, new Dali.Property.Value( value ) );
+    }
+  }
+
+  public Dali.Property.Map DisabledUnselectedBackgroundVisual
+  {
+    get
+    {
+      Dali.Property.Map temp = new Dali.Property.Map();
+      GetProperty( Button.Property.DISABLED_UNSELECTED_BACKGROUND_VISUAL).Get(  temp );
+      return temp;
+    }
+    set
+    {
+      SetProperty( Button.Property.DISABLED_UNSELECTED_BACKGROUND_VISUAL, new Dali.Property.Value( value ) );
+    }
+  }
+
+  public Dali.Property.Map DisabledSelectedBackgroundVisual
+  {
+    get
+    {
+      Dali.Property.Map temp = new Dali.Property.Map();
+      GetProperty( Button.Property.DISABLED_SELECTED_BACKGROUND_VISUAL).Get(  temp );
+      return temp;
+    }
+    set
+    {
+      SetProperty( Button.Property.DISABLED_SELECTED_BACKGROUND_VISUAL, new Dali.Property.Value( value ) );
+    }
+  }
+
+  public string LabelRelativeAlignment
+  {
+    get
+    {
+      string temp;
+      GetProperty( Button.Property.LABEL_RELATIVE_ALIGNMENT).Get( out temp );
+      return temp;
+    }
+    set
+    {
+      SetProperty( Button.Property.LABEL_RELATIVE_ALIGNMENT, new Dali.Property.Value( value ) );
+    }
+  }
+
+  public Vector4 LabelPadding
+  {
+    get
+    {
+      Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f);
+      GetProperty( Button.Property.LABEL_PADDING).Get(  temp );
+      return temp;
+    }
+    set
+    {
+      SetProperty( Button.Property.LABEL_PADDING, new Dali.Property.Value( value ) );
+    }
+  }
+
+  public Vector4 VisualPadding
+  {
+    get
+    {
+      Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f);
+      GetProperty( Button.Property.VISUAL_PADDING).Get(  temp );
+      return temp;
+    }
+    set
+    {
+      SetProperty( Button.Property.VISUAL_PADDING, new Dali.Property.Value( value ) );
+    }
+  }
 %}
 %enddef
 
index 9d32da5..55c2435 100755 (executable)
@@ -27,7 +27,6 @@
 %define CONTROL_EVENTHANDLER_TYPEMAP_HELPER(NameSpace, ClassName)
   %typemap(cscode) NameSpace::ClassName %{
 
-
     /**
      * @brief Event arguments that passed via KeyInputFocusGained signal
      *
       return ret;
     }
 
-    %}
-
-    %enddef
+    public Dali.Property.Map Tooltip
+    {
+      get
+      {
+        Dali.Property.Map temp = new Dali.Property.Map();
+        GetProperty( View.Property.TOOLTIP).Get(  temp );
+        return temp;
+      }
+      set
+      {
+        SetProperty( View.Property.TOOLTIP, new Dali.Property.Value( value ) );
+      }
+    }
+ %}
+%enddef
 
 %define DALI_CONTROL_EVENTHANDLER_PARAM( NameSpace, ClassName)
 
   CONTROL_EVENTHANDLER_TYPEMAP_EVENTARG( NameSpace, ClassName);
   CONTROL_EVENTHANDLER_TYPEMAP_HELPER( NameSpace, ClassName);
 
-  %enddef
+%enddef
 
-  namespace Dali
+namespace Dali
 {
   DALI_CONTROL_EVENTHANDLER_PARAM( Dali::Toolkit, Control);
 }
diff --git a/plugins/dali-swig/manual/cpp/devel-property-wrap.cpp b/plugins/dali-swig/manual/cpp/devel-property-wrap.cpp
new file mode 100644 (file)
index 0000000..562b822
--- /dev/null
@@ -0,0 +1,181 @@
+/*
+ * Copyright (c) 2017 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.
+ *
+ */
+
+#ifndef CSHARP_DEVEL_PROPERTY
+#define CSHARP_DEVEL_PROPERTY
+#endif
+
+#include "common.h"
+
+#include <dali/devel-api/actors/actor-devel.h>
+#include <dali/devel-api/rendering/renderer-devel.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
+#include <dali-toolkit/devel-api/controls/scrollable/item-view/item-view-devel.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+SWIGEXPORT int SWIGSTDCALL CSharp_Actor_Property_BATCH_PARENT_get() {
+  int jresult ;
+  int result;
+
+  result = (int)Dali::DevelActor::Property::BATCH_PARENT;
+  jresult = (int)result;
+  return jresult;
+}
+
+SWIGEXPORT int SWIGSTDCALL CSharp_Actor_Property_SIBLING_ORDER_get() {
+  int jresult ;
+  int result;
+
+  result = (int)Dali::DevelActor::Property::SIBLING_ORDER;
+  jresult = (int)result;
+  return jresult;
+}
+
+SWIGEXPORT int SWIGSTDCALL CSharp_Renderer_Property_BATCHING_ENABLED_get() {
+  int jresult ;
+  int result;
+
+  result = (int)Dali::DevelRenderer::Property::BATCHING_ENABLED;
+  jresult = (int)result;
+  return jresult;
+}
+
+SWIGEXPORT int SWIGSTDCALL CSharp_View_Property_TOOLTIP_get() {
+  int jresult ;
+  int result;
+
+  result = (int)Dali::Toolkit::DevelControl::Property::TOOLTIP;
+  jresult = (int)result;
+  return jresult;
+}
+
+SWIGEXPORT int SWIGSTDCALL CSharp_ItemView_Property_LAYOUT_get() {
+  int jresult ;
+  int result;
+
+  result = (int)Dali::Toolkit::DevelItemView::Property::LAYOUT;
+  jresult = (int)result;
+  return jresult;
+}
+
+SWIGEXPORT int SWIGSTDCALL CSharp_Button_Property_UNSELECTED_VISUAL_get() {
+  int jresult ;
+  int result;
+
+  result = (int)Dali::Toolkit::DevelButton::Property::UNSELECTED_VISUAL;
+  jresult = (int)result;
+  return jresult;
+}
+
+SWIGEXPORT int SWIGSTDCALL CSharp_Button_Property_SELECTED_VISUAL_get() {
+  int jresult ;
+  int result;
+
+  result = (int)Dali::Toolkit::DevelButton::Property::SELECTED_VISUAL;
+  jresult = (int)result;
+  return jresult;
+}
+
+SWIGEXPORT int SWIGSTDCALL CSharp_Button_Property_DISABLED_SELECTED_VISUAL_get() {
+  int jresult ;
+  int result;
+
+  result = (int)Dali::Toolkit::DevelButton::Property::DISABLED_SELECTED_VISUAL;
+  jresult = (int)result;
+  return jresult;
+}
+
+SWIGEXPORT int SWIGSTDCALL CSharp_Button_Property_DISABLED_UNSELECTED_VISUAL_get() {
+  int jresult ;
+  int result;
+
+  result = (int)Dali::Toolkit::DevelButton::Property::DISABLED_UNSELECTED_VISUAL;
+  jresult = (int)result;
+  return jresult;
+}
+
+SWIGEXPORT int SWIGSTDCALL CSharp_Button_Property_UNSELECTED_BACKGROUND_VISUAL_get() {
+  int jresult ;
+  int result;
+
+  result = (int)Dali::Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL;
+  jresult = (int)result;
+  return jresult;
+}
+
+SWIGEXPORT int SWIGSTDCALL CSharp_Button_Property_SELECTED_BACKGROUND_VISUAL_get() {
+  int jresult ;
+  int result;
+
+  result = (int)Dali::Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL;
+  jresult = (int)result;
+  return jresult;
+}
+
+SWIGEXPORT int SWIGSTDCALL CSharp_Button_Property_DISABLED_UNSELECTED_BACKGROUND_VISUAL_get() {
+  int jresult ;
+  int result;
+
+  result = (int)Dali::Toolkit::DevelButton::Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL;
+  jresult = (int)result;
+  return jresult;
+}
+
+SWIGEXPORT int SWIGSTDCALL CSharp_Button_Property_DISABLED_SELECTED_BACKGROUND_VISUAL_get() {
+  int jresult ;
+  int result;
+
+  result = (int)Dali::Toolkit::DevelButton::Property::DISABLED_SELECTED_BACKGROUND_VISUAL;
+  jresult = (int)result;
+  return jresult;
+}
+
+SWIGEXPORT int SWIGSTDCALL CSharp_Button_Property_LABEL_RELATIVE_ALIGNMENT_get() {
+  int jresult ;
+  int result;
+
+  result = (int)Dali::Toolkit::DevelButton::Property::LABEL_RELATIVE_ALIGNMENT;
+  jresult = (int)result;
+  return jresult;
+}
+
+SWIGEXPORT int SWIGSTDCALL CSharp_Button_Property_LABEL_PADDING_get() {
+  int jresult ;
+  int result;
+
+  result = (int)Dali::Toolkit::DevelButton::Property::LABEL_PADDING;
+  jresult = (int)result;
+  return jresult;
+}
+
+SWIGEXPORT int SWIGSTDCALL CSharp_Button_Property_VISUAL_PADDING_get() {
+  int jresult ;
+  int result;
+
+  result = (int)Dali::Toolkit::DevelButton::Property::VISUAL_PADDING;
+  jresult = (int)result;
+  return jresult;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
index 9a88a14..c982572 100755 (executable)
@@ -187,5 +187,52 @@ namespace Dali
         [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Dali_MakeCallback")]
         public static extern global::System.IntPtr MakeCallback(global::System.Runtime.InteropServices.HandleRef jarg1);
 
+        [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Actor_Property_BATCH_PARENT_get")]
+        public static extern int Actor_Property_BATCH_PARENT_get();
+
+        [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Actor_Property_SIBLING_ORDER_get")]
+        public static extern int Actor_Property_SIBLING_ORDER_get();
+
+        [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Renderer_Property_BATCHING_ENABLED_get")]
+        public static extern int Renderer_Property_BATCHING_ENABLED_get();
+
+        [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_View_Property_TOOLTIP_get")]
+        public static extern int View_Property_TOOLTIP_get();
+
+        [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_ItemView_Property_LAYOUT_get")]
+        public static extern int ItemView_Property_LAYOUT_get();
+
+        [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Button_Property_UNSELECTED_VISUAL_get")]
+        public static extern int Button_Property_UNSELECTED_VISUAL_get();
+
+        [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Button_Property_SELECTED_VISUAL_get")]
+        public static extern int Button_Property_SELECTED_VISUAL_get();
+
+        [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Button_Property_DISABLED_SELECTED_VISUAL_get")]
+        public static extern int Button_Property_DISABLED_SELECTED_VISUAL_get();
+
+        [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Button_Property_DISABLED_UNSELECTED_VISUAL_get")]
+        public static extern int Button_Property_DISABLED_UNSELECTED_VISUAL_get();
+
+        [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Button_Property_UNSELECTED_BACKGROUND_VISUAL_get")]
+        public static extern int Button_Property_UNSELECTED_BACKGROUND_VISUAL_get();
+
+        [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Button_Property_SELECTED_BACKGROUND_VISUAL_get")]
+        public static extern int Button_Property_SELECTED_BACKGROUND_VISUAL_get();
+
+        [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Button_Property_DISABLED_UNSELECTED_BACKGROUND_VISUAL_get")]
+        public static extern int Button_Property_DISABLED_UNSELECTED_BACKGROUND_VISUAL_get();
+
+        [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Button_Property_DISABLED_SELECTED_BACKGROUND_VISUAL_get")]
+        public static extern int Button_Property_DISABLED_SELECTED_BACKGROUND_VISUAL_get();
+
+        [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Button_Property_LABEL_RELATIVE_ALIGNMENT_get")]
+        public static extern int Button_Property_LABEL_RELATIVE_ALIGNMENT_get();
+
+        [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Button_Property_LABEL_PADDING_get")]
+        public static extern int Button_Property_LABEL_PADDING_get();
+
+        [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Button_Property_VISUAL_PADDING_get")]
+        public static extern int Button_Property_VISUAL_PADDING_get();
     }
 }